-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstants.go
More file actions
126 lines (108 loc) · 4.86 KB
/
Copy pathconstants.go
File metadata and controls
126 lines (108 loc) · 4.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/*
* Copyright 2025 - 2026 Zigflow authors <https://github.com/zigflow/schema/graphs/contributors>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package schema
const (
// SchemaVersion is the JSON Schema draft used by the generated schema.
SchemaVersion = "https://json-schema.org/draft/2020-12/schema"
// SchemaIDVersioned is the canonical versioned URI for the generated Zigflow workflow schema.
SchemaIDVersioned = "https://zigflow.dev/schemas/%s/schema.%s"
// SchemaIDVersioned is the canonical unversioned URI for the generated Zigflow workflow schema.
SchemaID = "https://zigflow.dev/schema.%s"
// SchemaTitle is the title of the generated schema.
SchemaTitle = "Zigflow"
// SchemaDescription is the description of the generated schema.
SchemaDescription = "JSON Schema for a Zigflow workflow definition."
// dnsLabelPattern ensures that a string meets the RFC1123 DNS label spec https://datatracker.ietf.org/doc/html/rfc1123#section-2.1
dnsLabelPattern = `^[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$`
// domainNamePattern ensures that a string meets the RFC1123 DNS label as an full host/domain name
domainNamePattern = `^[a-zA-Z0-9](?:[a-zA-Z0-9-.]{0,61}[a-zA-Z0-9])?$`
// runtimeExpressionString ensures a valid runtime expression
runtimeExpressionString = `^\s*\$\{.+\}\s*$`
// rfc3339Pattern ensures a string is a literal RFC 3339 date-time.
// JSON Schema's `format: date-time` is informational only and not
// enforced by the validator, so we use a regex pattern to enforce it.
rfc3339Pattern = `^\d{4}-\d{2}-\d{2}[Tt]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:[Zz]|[+-]\d{2}:\d{2})$`
// semVerPattern is the official regex from https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
semVerPattern = `^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)` +
`(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?` +
`(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`
// urlPattern ensures a valid URL
urlPattern = `^[A-Za-z][A-Za-z0-9+\-.]*://.*`
ref = "#/$defs/%s"
// Definition keys used in buildDefinitions() and SchemaRef().
defCommonMetadata = "commonMetadata"
defDocumentMetadata = "documentMetadata"
// Schema property names used across schema definitions and tests.
propDo = "do"
propDocument = "document"
propCall = "call"
propArguments = "arguments"
propActivityOptions = "activityOptions"
propDisableEager = "disableEagerExecution"
propCanMaxHistory = "canMaxHistoryLength"
propZigflowID = "__zigflow_id"
propCommand = "command"
propCron = "cron"
// JSON Schema type values.
typeArray = "array"
typeBoolean = "boolean"
typeInteger = "integer"
typeObject = "object"
typeString = "string"
// Definition keys used in buildDefinitions() and SchemaRef().
defOutput = "output"
defSchema = "schema"
defTaskMetadata = "taskMetadata"
defTimeout = "timeout"
// Additional schema property names.
propAs = "as"
propEndpoint = "endpoint"
propError = "error"
propExport = "export"
propInput = "input"
propMethod = "method"
propMetadata = "metadata"
propHeartbeatTimeout = "heartbeatTimeout"
propMaximumAttempts = "maximumAttempts"
propHeartbeat = "heartbeat"
propEnvironment = "environment"
propDSL = "dsl"
propDays = "days"
propHours = "hours"
propMilliseconds = "milliseconds"
propMinutes = "minutes"
propUntil = "until"
propWait = "wait"
propWith = "with"
propName = "name"
propOutput = "output"
propSchema = "schema"
propRetryPolicy = "retryPolicy"
propTaskQueue = "taskQueue"
propType = "type"
propScheduleWorkflowName = "scheduleWorkflowName"
propScheduleID = "scheduleId"
propScheduleInput = "scheduleInput"
propSeconds = "seconds"
propStartToCloseTimeout = "startToCloseTimeout"
propSummary = "summary"
propURI = "uri"
propSource = "source"
propSet = "set"
propThen = "then"
propWorkflowType = "workflowType"
propVersion = "version"
)