@storewright/cli 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/README.md +19 -0
  2. package/VERSION +1 -0
  3. package/bin/storewright.mjs +62 -0
  4. package/contracts/action-registry.json +175 -0
  5. package/contracts/capability-registry.json +63 -0
  6. package/contracts/workflow-manifest.json +207 -0
  7. package/lib/cli/storewright-cli.mjs +259 -0
  8. package/lib/internal/launch-envelope.mjs +223 -0
  9. package/lib/internal/multi-agent-contracts.mjs +137 -0
  10. package/lib/internal/operation-ledger.mjs +190 -0
  11. package/lib/internal/pricing/default-preview-pricing.mjs +181 -0
  12. package/lib/internal/run-state-helpers.mjs +313 -0
  13. package/lib/internal/shopify-operation-adapter.mjs +456 -0
  14. package/package.json +38 -0
  15. package/schemas/action-registry.schema.json +11 -0
  16. package/schemas/agent-report.schema.json +14 -0
  17. package/schemas/approval-grant.schema.json +16 -0
  18. package/schemas/base-theme-report.schema.json +25 -0
  19. package/schemas/brand-identity.schema.json +142 -0
  20. package/schemas/capability-registry.schema.json +11 -0
  21. package/schemas/competitor-audit.schema.json +38 -0
  22. package/schemas/design-direction.schema.json +64 -0
  23. package/schemas/external-operation.schema.json +34 -0
  24. package/schemas/intake-blocked-report.schema.json +76 -0
  25. package/schemas/launch-envelope.schema.json +25 -0
  26. package/schemas/launch-readiness.schema.json +73 -0
  27. package/schemas/media-file-inspection-report.schema.json +223 -0
  28. package/schemas/media-manifest.schema.json +84 -0
  29. package/schemas/merchandising-brief.schema.json +27 -0
  30. package/schemas/normalized-product-catalog.schema.json +42 -0
  31. package/schemas/product-content-generation-input.schema.json +40 -0
  32. package/schemas/product-content-generation-output.schema.json +43 -0
  33. package/schemas/raw-product-candidates.schema.json +32 -0
  34. package/schemas/shopify-access-preflight-report.schema.json +213 -0
  35. package/schemas/shopify-content-sync-report.schema.json +190 -0
  36. package/schemas/shopify-media-map.schema.json +87 -0
  37. package/schemas/shopify-media-upload-report.schema.json +96 -0
  38. package/schemas/shopify-operation-request.schema.json +81 -0
  39. package/schemas/shopify-preflight-report.schema.json +187 -0
  40. package/schemas/store-blueprint.schema.json +112 -0
  41. package/schemas/store-content-generation-output.schema.json +102 -0
  42. package/schemas/store-intake.schema.json +205 -0
  43. package/schemas/store-ops-plan.schema.json +82 -0
  44. package/schemas/storefront-preview-review.schema.json +227 -0
  45. package/schemas/supplier-access-report.schema.json +36 -0
  46. package/schemas/supplier-extraction-report.schema.json +185 -0
  47. package/schemas/theme-build-report.schema.json +43 -0
  48. package/schemas/theme-code-change-summary.schema.json +65 -0
  49. package/schemas/theme-plan.schema.json +26 -0
  50. package/schemas/theme-push-report.schema.json +151 -0
  51. package/schemas/theme-workspace-validation-report.schema.json +61 -0
  52. package/schemas/workflow-manifest.schema.json +29 -0
  53. package/scripts/audit-run-state.mjs +472 -0
  54. package/scripts/execute-shopify-operation.mjs +190 -0
  55. package/scripts/generate-image-assets-openai.mjs +342 -0
  56. package/scripts/generate-media-assets.mjs +121 -0
  57. package/scripts/init-run-state.mjs +69 -0
  58. package/scripts/inspect-media-files.mjs +334 -0
  59. package/scripts/prepare-launch-envelope.mjs +47 -0
  60. package/scripts/shopify-access-preflight.mjs +432 -0
  61. package/scripts/upload-shopify-media.mjs +831 -0
  62. package/scripts/validate-agent-report.mjs +46 -0
  63. package/scripts/validate-artifact.mjs +196 -0
  64. package/scripts/validate-launch-envelope.mjs +50 -0
  65. package/scripts/validate-registries.mjs +50 -0
  66. package/scripts/validate-workflow-manifest.mjs +38 -0
  67. package/scripts/version.mjs +192 -0
@@ -0,0 +1,213 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://example.local/storewright/shopify-access-preflight-report.schema.json",
4
+ "title": "Storewright Shopify Access Preflight Report",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "runId", "authoring", "accessPreflight"],
8
+ "properties": {
9
+ "schemaVersion": { "type": "string", "const": "1.0.0" },
10
+ "runId": { "type": "string", "minLength": 1 },
11
+ "authoring": {
12
+ "type": "object",
13
+ "additionalProperties": false,
14
+ "required": ["mode", "createdBy", "sourceInputArtifacts"],
15
+ "properties": {
16
+ "mode": { "type": "string", "const": "worker-authored" },
17
+ "createdBy": { "type": "string", "minLength": 1 },
18
+ "sourceInputArtifacts": {
19
+ "type": "array",
20
+ "items": { "type": "string", "minLength": 1 },
21
+ "minItems": 1
22
+ }
23
+ }
24
+ },
25
+ "accessPreflight": {
26
+ "type": "object",
27
+ "additionalProperties": false,
28
+ "required": [
29
+ "store",
30
+ "shopifyCli",
31
+ "requestedScopes",
32
+ "verifiedScopes",
33
+ "storeAuth",
34
+ "storeAccess",
35
+ "adminGraphqlAccess",
36
+ "requiredManualApprovals",
37
+ "commands"
38
+ ],
39
+ "anyOf": [
40
+ {
41
+ "type": "object",
42
+ "properties": {
43
+ "verifiedScopes": {
44
+ "minItems": 12,
45
+ "allOf": [
46
+ { "contains": { "const": "read_files" }, "minContains": 1 },
47
+ { "contains": { "const": "write_files" }, "minContains": 1 },
48
+ { "contains": { "const": "read_themes" }, "minContains": 1 },
49
+ { "contains": { "const": "write_themes" }, "minContains": 1 },
50
+ { "contains": { "const": "read_products" }, "minContains": 1 },
51
+ { "contains": { "const": "write_products" }, "minContains": 1 },
52
+ { "contains": { "const": "read_publications" }, "minContains": 1 },
53
+ { "contains": { "const": "write_publications" }, "minContains": 1 },
54
+ { "contains": { "const": "read_content" }, "minContains": 1 },
55
+ { "contains": { "const": "write_content" }, "minContains": 1 },
56
+ { "contains": { "const": "read_online_store_navigation" }, "minContains": 1 },
57
+ { "contains": { "const": "write_online_store_navigation" }, "minContains": 1 }
58
+ ]
59
+ }
60
+ }
61
+ },
62
+ {
63
+ "type": "object",
64
+ "required": ["blockers"],
65
+ "properties": {
66
+ "blockers": { "type": "array", "minItems": 1 }
67
+ }
68
+ }
69
+ ],
70
+ "properties": {
71
+ "store": { "type": "string", "minLength": 1 },
72
+ "shopifyCli": {
73
+ "type": "object",
74
+ "additionalProperties": false,
75
+ "required": ["result", "version"],
76
+ "properties": {
77
+ "result": { "type": "string", "enum": ["ok", "error"] },
78
+ "version": { "type": "string" },
79
+ "installAttempted": { "type": "boolean" },
80
+ "details": { "type": "string" }
81
+ }
82
+ },
83
+ "requestedScopes": {
84
+ "type": "array",
85
+ "items": { "type": "string", "minLength": 1 },
86
+ "minItems": 12,
87
+ "allOf": [
88
+ { "contains": { "const": "read_files" }, "minContains": 1 },
89
+ { "contains": { "const": "write_files" }, "minContains": 1 },
90
+ { "contains": { "const": "read_themes" }, "minContains": 1 },
91
+ { "contains": { "const": "write_themes" }, "minContains": 1 },
92
+ { "contains": { "const": "read_products" }, "minContains": 1 },
93
+ { "contains": { "const": "write_products" }, "minContains": 1 },
94
+ { "contains": { "const": "read_publications" }, "minContains": 1 },
95
+ { "contains": { "const": "write_publications" }, "minContains": 1 },
96
+ { "contains": { "const": "read_content" }, "minContains": 1 },
97
+ { "contains": { "const": "write_content" }, "minContains": 1 },
98
+ { "contains": { "const": "read_online_store_navigation" }, "minContains": 1 },
99
+ { "contains": { "const": "write_online_store_navigation" }, "minContains": 1 }
100
+ ]
101
+ },
102
+ "verifiedScopes": {
103
+ "type": "array",
104
+ "items": { "type": "string", "minLength": 1 }
105
+ },
106
+ "scopeMatrix": {
107
+ "type": "array",
108
+ "items": {
109
+ "type": "object",
110
+ "additionalProperties": false,
111
+ "required": ["operation", "scopes", "reason"],
112
+ "properties": {
113
+ "operation": { "type": "string", "minLength": 1 },
114
+ "scopes": {
115
+ "type": "array",
116
+ "items": { "type": "string", "minLength": 1 },
117
+ "minItems": 1
118
+ },
119
+ "reason": { "type": "string", "minLength": 1 }
120
+ }
121
+ }
122
+ },
123
+ "storeAuth": {
124
+ "type": "object",
125
+ "additionalProperties": false,
126
+ "required": ["commandResult", "attempted", "requiredScopes", "rawOutputPath"],
127
+ "properties": {
128
+ "commandResult": { "type": "string", "enum": ["ok", "error", "timeout", "skipped"] },
129
+ "attempted": { "type": "boolean" },
130
+ "requiredScopes": {
131
+ "type": "array",
132
+ "items": { "type": "string", "minLength": 1 },
133
+ "minItems": 12,
134
+ "allOf": [
135
+ { "contains": { "const": "read_files" }, "minContains": 1 },
136
+ { "contains": { "const": "write_files" }, "minContains": 1 },
137
+ { "contains": { "const": "read_themes" }, "minContains": 1 },
138
+ { "contains": { "const": "write_themes" }, "minContains": 1 },
139
+ { "contains": { "const": "read_products" }, "minContains": 1 },
140
+ { "contains": { "const": "write_products" }, "minContains": 1 },
141
+ { "contains": { "const": "read_publications" }, "minContains": 1 },
142
+ { "contains": { "const": "write_publications" }, "minContains": 1 },
143
+ { "contains": { "const": "read_content" }, "minContains": 1 },
144
+ { "contains": { "const": "write_content" }, "minContains": 1 },
145
+ { "contains": { "const": "read_online_store_navigation" }, "minContains": 1 },
146
+ { "contains": { "const": "write_online_store_navigation" }, "minContains": 1 }
147
+ ]
148
+ },
149
+ "rawOutputPath": { "type": "string" },
150
+ "approvalState": { "type": "string", "enum": ["approved", "not-needed", "waiting", "denied", "timeout", "unknown"] },
151
+ "details": { "type": "string" }
152
+ }
153
+ },
154
+ "storeAccess": {
155
+ "type": "object",
156
+ "additionalProperties": false,
157
+ "required": ["verificationResult", "details", "rawOutputPath"],
158
+ "properties": {
159
+ "verificationResult": { "type": "string", "enum": ["ok", "error", "skipped"] },
160
+ "details": { "type": "string" },
161
+ "rawOutputPath": { "type": "string" }
162
+ }
163
+ },
164
+ "adminGraphqlAccess": {
165
+ "type": "object",
166
+ "additionalProperties": false,
167
+ "required": ["verificationResult", "details", "rawOutputPath"],
168
+ "properties": {
169
+ "verificationResult": { "type": "string", "enum": ["ok", "error", "skipped"] },
170
+ "details": { "type": "string" },
171
+ "rawOutputPath": { "type": "string" }
172
+ }
173
+ },
174
+ "requiredManualApprovals": {
175
+ "type": "array",
176
+ "items": { "type": "string", "minLength": 1 }
177
+ },
178
+ "blockers": {
179
+ "type": "array",
180
+ "items": {
181
+ "type": "object",
182
+ "additionalProperties": false,
183
+ "required": ["blockerId", "details"],
184
+ "properties": {
185
+ "blockerId": { "type": "string", "minLength": 1 },
186
+ "details": { "type": "string", "minLength": 1 },
187
+ "rawOutputPath": { "type": "string" }
188
+ }
189
+ }
190
+ },
191
+ "commands": {
192
+ "type": "array",
193
+ "minItems": 1,
194
+ "items": {
195
+ "type": "object",
196
+ "additionalProperties": false,
197
+ "required": ["command", "cwd", "exitCode", "commandResult", "stdoutSummary", "stderrSummary", "rawOutputPath"],
198
+ "properties": {
199
+ "command": { "type": "string", "minLength": 1 },
200
+ "cwd": { "type": "string", "minLength": 1 },
201
+ "exitCode": { "type": "number" },
202
+ "commandResult": { "type": "string", "enum": ["ok", "error", "timeout", "skipped"] },
203
+ "stdoutSummary": { "type": "string" },
204
+ "stderrSummary": { "type": "string" },
205
+ "parsedFacts": { "type": "object", "additionalProperties": true },
206
+ "rawOutputPath": { "type": "string", "minLength": 1 }
207
+ }
208
+ }
209
+ }
210
+ }
211
+ }
212
+ }
213
+ }
@@ -0,0 +1,190 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://example.local/storewright/shopify-content-sync-report.schema.json",
4
+ "title": "Storewright Shopify Content Sync Report",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "runId", "authoring", "shopifyContentSync"],
8
+ "properties": {
9
+ "schemaVersion": { "type": "string", "const": "1.0.0" },
10
+ "runId": { "type": "string", "minLength": 1 },
11
+ "authoring": {
12
+ "type": "object",
13
+ "additionalProperties": false,
14
+ "required": ["mode", "createdBy", "sourceInputArtifacts"],
15
+ "properties": {
16
+ "mode": { "type": "string", "const": "worker-authored" },
17
+ "createdBy": { "type": "string", "minLength": 1 },
18
+ "sourceInputArtifacts": {
19
+ "type": "array",
20
+ "minItems": 1,
21
+ "items": { "type": "string", "minLength": 1 }
22
+ }
23
+ }
24
+ },
25
+ "shopifyContentSync": {
26
+ "type": "object",
27
+ "additionalProperties": false,
28
+ "required": ["targetStore", "pages", "navigation", "commandAttempts", "errors", "blockerIds"],
29
+ "properties": {
30
+ "targetStore": { "type": "string", "minLength": 1 },
31
+ "pages": {
32
+ "type": "array",
33
+ "items": {
34
+ "type": "object",
35
+ "additionalProperties": false,
36
+ "required": [
37
+ "handle",
38
+ "sourceContent",
39
+ "placement",
40
+ "pageSyncStatus",
41
+ "rawOutputPath"
42
+ ],
43
+ "anyOf": [
44
+ {
45
+ "type": "object",
46
+ "required": [
47
+ "pageId",
48
+ "isPublished",
49
+ "publishedAt",
50
+ "adminUrl",
51
+ "onlineStorePath",
52
+ "visibilityVerification"
53
+ ],
54
+ "properties": {
55
+ "pageSyncStatus": { "type": "string", "const": "visible" },
56
+ "isPublished": { "type": "boolean", "const": true },
57
+ "visibilityVerification": {
58
+ "type": "object",
59
+ "required": ["query", "rawOutputPath", "isPublished", "publishedAt"],
60
+ "properties": {
61
+ "isPublished": { "type": "boolean", "const": true }
62
+ }
63
+ }
64
+ }
65
+ },
66
+ {
67
+ "type": "object",
68
+ "required": ["pageId", "isPublished", "visibilityVerification", "blockerId"],
69
+ "properties": {
70
+ "pageSyncStatus": { "type": "string", "const": "hidden" },
71
+ "isPublished": { "type": "boolean", "const": false },
72
+ "visibilityVerification": {
73
+ "type": "object",
74
+ "required": ["query", "rawOutputPath", "isPublished"],
75
+ "properties": {
76
+ "isPublished": { "type": "boolean", "const": false }
77
+ }
78
+ }
79
+ }
80
+ },
81
+ {
82
+ "type": "object",
83
+ "required": ["blockerId"],
84
+ "properties": {
85
+ "pageSyncStatus": { "type": "string", "const": "error" }
86
+ }
87
+ }
88
+ ],
89
+ "properties": {
90
+ "handle": { "type": "string", "minLength": 1 },
91
+ "sourceContent": {
92
+ "type": "string",
93
+ "enum": ["storeContent.brandStory", "storeContent.pageBodies"]
94
+ },
95
+ "placement": {
96
+ "type": "object",
97
+ "additionalProperties": false,
98
+ "required": ["type", "required"],
99
+ "properties": {
100
+ "type": {
101
+ "type": "string",
102
+ "enum": ["standalone-page", "footer-navigation"]
103
+ },
104
+ "required": { "type": "boolean" }
105
+ }
106
+ },
107
+ "pageSyncStatus": {
108
+ "type": "string",
109
+ "enum": ["visible", "hidden", "error"]
110
+ },
111
+ "pageId": { "type": "string", "minLength": 1 },
112
+ "isPublished": { "type": "boolean" },
113
+ "publishedAt": { "type": "string", "minLength": 1 },
114
+ "adminUrl": { "type": "string", "minLength": 1 },
115
+ "onlineStorePath": { "type": "string", "minLength": 1 },
116
+ "visibilityVerification": {
117
+ "type": "object",
118
+ "additionalProperties": false,
119
+ "required": ["query", "rawOutputPath", "isPublished"],
120
+ "properties": {
121
+ "query": { "type": "string", "minLength": 1 },
122
+ "rawOutputPath": { "type": "string", "minLength": 1 },
123
+ "isPublished": { "type": "boolean" },
124
+ "publishedAt": { "type": "string", "minLength": 1 }
125
+ }
126
+ },
127
+ "rawOutputPath": { "type": "string", "minLength": 1 },
128
+ "blockerId": { "type": "string", "minLength": 1 },
129
+ "warnings": {
130
+ "type": "array",
131
+ "items": { "type": "string" }
132
+ },
133
+ "errors": {
134
+ "type": "array",
135
+ "items": { "type": "string" }
136
+ }
137
+ }
138
+ }
139
+ },
140
+ "navigation": {
141
+ "type": "object",
142
+ "additionalProperties": false,
143
+ "required": ["mode", "menuHandle", "placement", "linkedPageHandles", "liveNavigationModified"],
144
+ "properties": {
145
+ "mode": { "type": "string", "const": "isolated-preview" },
146
+ "menuHandle": { "type": "string", "minLength": 1 },
147
+ "placement": {
148
+ "type": "string",
149
+ "enum": ["footer-navigation", "isolated-preview-menu"]
150
+ },
151
+ "linkedPageHandles": {
152
+ "type": "array",
153
+ "items": { "type": "string", "minLength": 1 }
154
+ },
155
+ "liveNavigationModified": { "type": "boolean", "const": false },
156
+ "rawOutputPath": { "type": "string", "minLength": 1 }
157
+ }
158
+ },
159
+ "commandAttempts": {
160
+ "type": "array",
161
+ "items": {
162
+ "type": "object",
163
+ "additionalProperties": false,
164
+ "required": ["command", "status", "exitCode", "stdoutSummary", "stderrSummary", "rawOutputPath"],
165
+ "properties": {
166
+ "command": { "type": "string", "minLength": 1 },
167
+ "status": { "type": "string", "enum": ["success", "error", "timeout"] },
168
+ "exitCode": { "type": "number" },
169
+ "stdoutSummary": { "type": "string" },
170
+ "stderrSummary": { "type": "string" },
171
+ "parsedFacts": {
172
+ "type": "array",
173
+ "items": { "type": "string" }
174
+ },
175
+ "rawOutputPath": { "type": "string", "minLength": 1 }
176
+ }
177
+ }
178
+ },
179
+ "errors": {
180
+ "type": "array",
181
+ "items": { "type": "string" }
182
+ },
183
+ "blockerIds": {
184
+ "type": "array",
185
+ "items": { "type": "string" }
186
+ }
187
+ }
188
+ }
189
+ }
190
+ }
@@ -0,0 +1,87 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://example.local/storewright/shopify-media-map.schema.json",
4
+ "title": "Storewright Shopify Media Map",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "runId", "authoring", "shopifyMedia"],
8
+ "properties": {
9
+ "schemaVersion": { "type": "string", "const": "1.0.0" },
10
+ "runId": { "type": "string", "minLength": 1 },
11
+ "authoring": {
12
+ "type": "object",
13
+ "additionalProperties": false,
14
+ "required": ["mode", "createdBy", "sourceInputArtifacts"],
15
+ "properties": {
16
+ "mode": { "type": "string", "const": "worker-authored" },
17
+ "createdBy": { "type": "string", "minLength": 1 },
18
+ "sourceInputArtifacts": {
19
+ "type": "array",
20
+ "minItems": 1,
21
+ "items": { "type": "string", "minLength": 1 }
22
+ }
23
+ }
24
+ },
25
+ "shopifyMedia": {
26
+ "type": "object",
27
+ "additionalProperties": false,
28
+ "required": ["assets"],
29
+ "properties": {
30
+ "assets": {
31
+ "type": "array",
32
+ "items": {
33
+ "type": "object",
34
+ "additionalProperties": false,
35
+ "required": ["assetId", "localPath", "uploadStatus"],
36
+ "anyOf": [
37
+ {
38
+ "type": "object",
39
+ "required": ["shopifyFileId", "shopifyUrl"],
40
+ "properties": {
41
+ "uploadStatus": { "type": "string", "const": "uploaded" }
42
+ }
43
+ },
44
+ {
45
+ "type": "object",
46
+ "required": ["shopifyMediaId", "shopifyUrl"],
47
+ "properties": {
48
+ "uploadStatus": { "type": "string", "const": "uploaded" }
49
+ }
50
+ },
51
+ {
52
+ "type": "object",
53
+ "properties": {
54
+ "uploadStatus": { "type": "string", "const": "skipped" }
55
+ }
56
+ },
57
+ {
58
+ "type": "object",
59
+ "properties": {
60
+ "uploadStatus": { "type": "string", "const": "error" }
61
+ }
62
+ }
63
+ ],
64
+ "properties": {
65
+ "assetId": { "type": "string", "minLength": 1 },
66
+ "slotId": { "type": "string", "minLength": 1 },
67
+ "candidateId": { "type": "string", "minLength": 1 },
68
+ "localPath": { "type": "string", "minLength": 1 },
69
+ "seoFilename": {
70
+ "type": "string",
71
+ "minLength": 5,
72
+ "maxLength": 180,
73
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*\\.[a-z0-9]+$"
74
+ },
75
+ "altText": { "type": "string", "minLength": 1, "maxLength": 512 },
76
+ "shopifyFileId": { "type": "string", "minLength": 1 },
77
+ "shopifyMediaId": { "type": "string", "minLength": 1 },
78
+ "shopifyUrl": { "type": "string", "minLength": 1 },
79
+ "uploadStatus": { "type": "string", "enum": ["uploaded", "skipped", "error"] },
80
+ "warnings": { "type": "array", "items": { "type": "string" } }
81
+ }
82
+ }
83
+ }
84
+ }
85
+ }
86
+ }
87
+ }
@@ -0,0 +1,96 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://example.local/storewright/shopify-media-upload-report.schema.json",
4
+ "title": "Storewright Shopify Media Upload Report",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "runId", "authoring", "shopifyMediaUpload"],
8
+ "properties": {
9
+ "schemaVersion": { "type": "string", "const": "1.0.0" },
10
+ "runId": { "type": "string", "minLength": 1 },
11
+ "authoring": {
12
+ "type": "object",
13
+ "additionalProperties": false,
14
+ "required": ["mode", "createdBy", "sourceInputArtifacts"],
15
+ "properties": {
16
+ "mode": { "type": "string", "const": "worker-authored" },
17
+ "createdBy": { "type": "string", "minLength": 1 },
18
+ "sourceInputArtifacts": {
19
+ "type": "array",
20
+ "minItems": 1,
21
+ "items": { "type": "string", "minLength": 1 }
22
+ }
23
+ }
24
+ },
25
+ "shopifyMediaUpload": {
26
+ "type": "object",
27
+ "additionalProperties": false,
28
+ "required": ["targetStore", "apiVersion", "commandAttempts", "graphqlUserErrors", "assets"],
29
+ "properties": {
30
+ "targetStore": { "type": "string", "minLength": 1 },
31
+ "apiVersion": { "type": "string", "minLength": 1 },
32
+ "commandAttempts": {
33
+ "type": "array",
34
+ "items": {
35
+ "type": "object",
36
+ "additionalProperties": false,
37
+ "required": ["command", "status", "exitCode", "stdout", "stderr"],
38
+ "properties": {
39
+ "command": { "type": "string", "minLength": 1 },
40
+ "status": { "type": "string", "enum": ["success", "error", "timeout"] },
41
+ "exitCode": { "type": "number" },
42
+ "stdout": { "type": "string" },
43
+ "stderr": { "type": "string" },
44
+ "attempt": { "type": "number" },
45
+ "maxAttempts": { "type": "number" }
46
+ }
47
+ }
48
+ },
49
+ "graphqlUserErrors": {
50
+ "type": "array",
51
+ "items": {
52
+ "type": "object",
53
+ "additionalProperties": false,
54
+ "required": ["message"],
55
+ "properties": {
56
+ "message": { "type": "string", "minLength": 1 },
57
+ "field": {
58
+ "type": "array",
59
+ "items": { "type": "string", "minLength": 1 }
60
+ }
61
+ }
62
+ }
63
+ },
64
+ "assets": {
65
+ "type": "array",
66
+ "items": {
67
+ "type": "object",
68
+ "additionalProperties": false,
69
+ "required": ["assetId", "localPath", "uploadStatus"],
70
+ "properties": {
71
+ "assetId": { "type": "string", "minLength": 1 },
72
+ "slotId": { "type": "string", "minLength": 1 },
73
+ "candidateId": { "type": "string", "minLength": 1 },
74
+ "localPath": { "type": "string", "minLength": 1 },
75
+ "seoFilename": {
76
+ "type": "string",
77
+ "minLength": 5,
78
+ "maxLength": 180,
79
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*\\.[a-z0-9]+$"
80
+ },
81
+ "altText": { "type": "string", "minLength": 1, "maxLength": 512 },
82
+ "shopifyFileId": { "type": "string", "minLength": 1 },
83
+ "shopifyMediaId": { "type": "string", "minLength": 1 },
84
+ "shopifyUrl": { "type": "string", "minLength": 1 },
85
+ "uploadStatus": { "type": "string", "enum": ["uploaded", "skipped", "error"] },
86
+ "warnings": {
87
+ "type": "array",
88
+ "items": { "type": "string" }
89
+ }
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
95
+ }
96
+ }