-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworkflow-schema.json
197 lines (197 loc) · 7.04 KB
/
workflow-schema.json
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "https://raw.githubusercontent.com/wwt/WorkflowSchema/main/workflow-schema.json",
"type": "object",
"title": "Workflow Schema",
"description": "This schema defines how a workflow can be driven from data for SwiftCurrent.",
"default": {},
"examples": [
{
"schemaVersion": "v0.0.1",
"sequence": [
{
"flowRepresentableName": "FR1"
},
{
"flowRepresentableName": "FR2",
"launchStyle": "modal",
"flowPersistence": "removedAfterProceeding"
},
{
"flowRepresentableName": {
"watchOS": "FR3",
"macOS": "FR3",
"iOS": "FR3",
"iPadOS": "FR3",
"tvOS": "FR3",
"android": "FRA3"
},
"launchStyle": {
"watchOS": "modal",
"macOS": "modal",
"iOS": "modal",
"iPadOS": "popover",
"tvOS": "modal",
"android": "widget"
},
"flowPersistence": {
"watchOS": "removedAfterProceeding",
"macOS": "removedAfterProceeding",
"iOS": "removedAfterProceeding",
"iPadOS": "removedAfterProceeding",
"tvOS": "removedAfterProceeding",
"android": "somethingElse"
}
},
{
"flowRepresentableName": {
"*": "FR3",
"android": "FRA3"
},
"launchStyle": {
"*": "modal",
"iPadOS": "popover",
"android": "widget"
},
"flowPersistence": {
"watchOS": "removedAfterProceeding",
"macOS": "removedAfterProceeding",
"iOS": "removedAfterProceeding",
"iPadOS": "removedAfterProceeding",
"tvOS": "removedAfterProceeding",
"android": "somethingElse"
}
},
{
"flowRepresentableName": "FR4",
"launchStyle": "something",
"flowPersistence": {
"*": "something"
}
}
]
}
],
"required": ["schemaVersion", "sequence"],
"properties": {
"schemaVersion": {
"$id": "#/properties/schemaVersion",
"default": "",
"description": "If the currently used version of the library does not recognize this schema number, validation will fail.",
"examples": ["v0.0.1"],
"readOnly": true,
"title": "The version of the SwiftCurrent schema",
"pattern": "^v[0-9]+\\.[0-9]+\\.[0-9]+$",
"type": "string"
},
"sequence": {
"$id": "#/properties/sequence",
"default": [],
"description": "The order of the sequence dictates the order of items in the workflow. Items must match the names/launchStyles/flowPersistences of FlowRepresentables in the codebase or validation will fail.",
"examples": [
[
{
"flowRepresentableName": "FR1"
},
{
"flowRepresentableName": "FR2",
"launchStyle": "modal",
"flowPersistence": "removedAfterProceeding"
}
]
],
"title": "The sequence of FlowRepresentables the workflow should contain",
"minItems": 1,
"type": "array",
"items": {
"$id": "#/properties/sequence/items",
"anyOf": [
{
"$id": "#/properties/sequence/items/anyOf/0",
"type": "object",
"title": "The first anyOf schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"examples": [
{
"flowRepresentableName": "FR2",
"launchStyle": "modal",
"flowPersistence": "removedAfterProceeding"
}
],
"required": ["flowRepresentableName"],
"properties": {
"flowRepresentableName": {
"$id": "#/properties/sequence/items/anyOf/0/properties/flowRepresentableName",
"description": "The library will default to the name of the type, but will allow a custom name for deserialization. Can be a string or object describing the name per platform. Key of `*` means match all platforms.",
"examples": [
"FR2",
{
"iOS": "FR2",
"android": "FRA2"
},
{
"*": "FR2",
"android": "FRA2"
}
],
"title": "The name of the FlowRepresentable in the workflow.",
"$ref": "#/properties/sequence/items/definitions/nonEmptyStringOrObject"
},
"launchStyle": {
"$id": "#/properties/sequence/items/anyOf/0/properties/launchStyle",
"description": "Must be a member of the LaunchStyle type, will fail validation if this interface is not met. Can be a string or object describing the name per platform. Key of `*` means match all platforms.",
"examples": [
"modal",
{
"watchOS": "modal",
"macOS": "modal",
"iOS": "modal",
"iPadOS": "popover",
"tvOS": "modal",
"android": "widget"
},
{
"*": "modal",
"iPadOS": "popover",
"android": "widget"
}
],
"title": "The name of the LaunchStyle in the workflow",
"$ref": "#/properties/sequence/items/definitions/nonEmptyStringOrObject"
},
"flowPersistence": {
"$id": "#/properties/sequence/items/anyOf/0/properties/flowPersistence",
"description": "Must be a member of the FlowPersistence type, will fail validation if this interface is not met. Can be a string or object describing the name per platform. Key of `*` means match all platforms.",
"examples": [
"removedAfterProceeding",
{
"watchOS": "removedAfterProceeding",
"macOS": "removedAfterProceeding",
"iOS": "removedAfterProceeding",
"iPadOS": "removedAfterProceeding",
"tvOS": "removedAfterProceeding",
"android": "somethingElse"
},
{
"*": "removedAfterProceeding",
"android": "someAndroidFlowPersistenceType"
}
],
"title": "The name of the FlowPersistence in the workflow",
"$ref": "#/properties/sequence/items/definitions/nonEmptyStringOrObject"
}
}
}
],
"definitions": {
"nonEmptyStringOrObject": {
"minLength": 1,
"minProperties": 1,
"type": ["string", "object"]
}
}
}
}
}
}