@replohq/canopy-sdk 0.14.1 → 0.15.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 (81) hide show
  1. package/_vendor/replo-utils/lib/fonts.mjs +40 -2
  2. package/_vendor/replo-utils/lib/json.mjs +1 -1
  3. package/_vendor/replo-utils/lib/misc.mjs +2 -2
  4. package/_vendor/schemas/loaderKeys.mjs +1 -1
  5. package/_vendor/schemas/selectMode.mjs +2 -2
  6. package/cart/buy-now-action.js +3 -3
  7. package/cart/buy-now-action.js.map +2 -2
  8. package/cart/cart-provider.js +2 -2
  9. package/cart/cart-provider.js.map +2 -2
  10. package/{_vendor/schemas/cart.mjs → cart/cart-schema.js} +26 -17
  11. package/cart/cart-schema.js.map +7 -0
  12. package/cart/cart-types.d.ts +1 -2
  13. package/cart/cart-types.js.map +2 -2
  14. package/cart/hooks/use-add-to-cart.js +1 -1
  15. package/cart/hooks/use-add-to-cart.js.map +2 -2
  16. package/cart/hooks/use-buy-now.js +2 -2
  17. package/cart/hooks/use-buy-now.js.map +2 -2
  18. package/cart/utils/variant-to-cart-line.d.ts +2 -1
  19. package/cart/utils/variant-to-cart-line.js.map +1 -1
  20. package/{chunk-OCB5XQYL.mjs → chunk-ME5W2TJM.mjs} +2 -2
  21. package/gateways/canopy-api.d.ts +3 -3
  22. package/gateways/canopy-api.js +3 -3
  23. package/gateways/canopy-api.js.map +2 -2
  24. package/lib/canopy-error.d.ts +25 -0
  25. package/lib/canopy-error.js +24 -0
  26. package/lib/canopy-error.js.map +7 -0
  27. package/loaders/collection-loader.d.ts +1 -1
  28. package/loaders/collection-loader.js +1 -1
  29. package/loaders/collection-loader.js.map +2 -2
  30. package/loaders/collection-products-loader.d.ts +1 -1
  31. package/loaders/collection-products-loader.js +1 -1
  32. package/loaders/collection-products-loader.js.map +2 -2
  33. package/loaders/invoke-loader.d.ts +2 -2
  34. package/loaders/invoke-loader.js +2 -2
  35. package/loaders/invoke-loader.js.map +2 -2
  36. package/loaders/levanta-product-loader.d.ts +1 -1
  37. package/loaders/levanta-product-loader.js +1 -1
  38. package/loaders/levanta-product-loader.js.map +2 -2
  39. package/{_vendor/schemas/loaderKeys.d.ts → loaders/loader-keys.d.ts} +4 -4
  40. package/loaders/loader-keys.js +22 -0
  41. package/loaders/loader-keys.js.map +7 -0
  42. package/loaders/loader-schemas.d.ts +755 -0
  43. package/loaders/loader-schemas.js +257 -0
  44. package/loaders/loader-schemas.js.map +7 -0
  45. package/loaders/okendo-reviews-loader.js +1 -1
  46. package/loaders/okendo-reviews-loader.js.map +2 -2
  47. package/loaders/prefetch-loaders.d.ts +1 -1
  48. package/loaders/prefetch-loaders.js.map +1 -1
  49. package/loaders/product-loader.d.ts +1 -1
  50. package/loaders/product-loader.js +1 -1
  51. package/loaders/product-loader.js.map +2 -2
  52. package/loaders/rebuy-recommendations-loader.js +1 -1
  53. package/loaders/rebuy-recommendations-loader.js.map +2 -2
  54. package/loaders/yotpo-review-aggregate-loader.d.ts +1 -1
  55. package/loaders/yotpo-review-aggregate-loader.js +1 -1
  56. package/loaders/yotpo-review-aggregate-loader.js.map +2 -2
  57. package/loaders/yotpo-reviews-loader.d.ts +1 -1
  58. package/loaders/yotpo-reviews-loader.js +1 -1
  59. package/loaders/yotpo-reviews-loader.js.map +2 -2
  60. package/package.json +1 -1
  61. package/_vendor/replo-utils/lib/errors.d.ts +0 -83
  62. package/_vendor/schemas/agentTools/customIntegrations/loaders/levanta.d.ts +0 -49
  63. package/_vendor/schemas/agentTools/customIntegrations/loaders/levanta.mjs +0 -36
  64. package/_vendor/schemas/agentTools/customIntegrations/loaders/product.d.ts +0 -340
  65. package/_vendor/schemas/agentTools/customIntegrations/loaders/product.mjs +0 -51
  66. package/_vendor/schemas/agentTools/customIntegrations/loaders/yotpo.d.ts +0 -37
  67. package/_vendor/schemas/agentTools/customIntegrations/loaders/yotpo.mjs +0 -37
  68. package/_vendor/schemas/errors.d.ts +0 -438
  69. package/_vendor/schemas/errors.mjs +0 -932
  70. package/_vendor/schemas/generated/errors.d.ts +0 -61
  71. package/_vendor/schemas/objectType.d.ts +0 -1038
  72. package/_vendor/schemas/objectType.mjs +0 -2
  73. package/_vendor/schemas/registry.d.ts +0 -539
  74. package/_vendor/schemas/sandboxFiles.d.ts +0 -36
  75. package/_vendor/schemas/sellingPlan.d.ts +0 -60
  76. package/_vendor/schemas/sellingPlan.mjs +0 -1
  77. package/chunk-4XLTENDR.mjs +0 -33
  78. package/chunk-A7EUNWRQ.mjs +0 -765
  79. package/chunk-QFYIXADC.mjs +0 -42
  80. package/{_vendor/schemas/cart.d.ts → cart/cart-schema.d.ts} +0 -0
  81. package/{chunk-ILGEM42C.mjs → chunk-NCKKAFF7.mjs} +7 -7
@@ -1,765 +0,0 @@
1
- import { sellingPlanGroupSchema } from './chunk-4XLTENDR.mjs';
2
- import { z } from 'zod';
3
-
4
- var registryItemTypeSchema = z.enum(["site", "page", "section", "skill", "plan", "branding", "product"]).describe("RegistryItemType");
5
- var registryItemVisibilitySchema = z.enum(["public", "unlisted"]).describe("RegistryItemVisibility");
6
- var registrySlugSchema = z.string().min(1).max(120).regex(/^[\da-z][\d_a-z-]*$/);
7
- var registryItemIdSchema = z.uuid();
8
- var registryContentFilesSchema = z.record(z.string().min(1), z.string()).refine((files) => Object.keys(files).length > 0, {
9
- message: "Registry item content must include at least one file"
10
- });
11
- z.object({
12
- sourceType: z.string().min(1).max(80),
13
- sourceKey: z.string().min(1).max(512)
14
- }).describe("RegistryItemSourceIdentity");
15
- var visualDisplayMetadataSchema = z.object({
16
- brandName: z.string().optional(),
17
- brandDomain: z.string().optional(),
18
- logoUrl: z.url().optional()
19
- }).strict();
20
- var siteTemplatePageSchema = z.object({
21
- route: z.string(),
22
- name: z.string(),
23
- url: z.url()
24
- }).strict();
25
- var siteRegistryItemMetadataSchema = visualDisplayMetadataSchema.extend({
26
- artifactRepo: z.string().optional(),
27
- liveUrl: z.url().optional(),
28
- pages: z.array(siteTemplatePageSchema).optional()
29
- }).describe("SiteRegistryItemMetadata");
30
- var pageRegistryItemMetadataSchema = visualDisplayMetadataSchema.extend({
31
- keyFeatures: z.array(z.string().min(1).max(80)).max(6).optional(),
32
- sectionsIncluded: z.array(z.string().min(1).max(80)).max(12).optional()
33
- }).describe("PageRegistryItemMetadata");
34
- var sectionRegistryItemMetadataSchema = visualDisplayMetadataSchema.describe("SectionRegistryItemMetadata");
35
- var brandingRegistryItemMetadataSchema = z.object({
36
- palette: z.array(z.string()).max(8).optional(),
37
- logoUrl: z.url().optional(),
38
- faviconUrl: z.url().optional(),
39
- tagline: z.string().max(140).optional()
40
- }).strict().describe("BrandingRegistryItemMetadata");
41
- var skillRegistryItemMetadataSchema = z.object({
42
- command: z.string().optional(),
43
- tagline: z.string().optional(),
44
- // (Ezra, 2026-07-09, REPL-29107): marks a catalog skill that bedrock-api
45
- // preinstalls into every user's workspace skills. String-valued because
46
- // catalog metadata is a string record end to end.
47
- preinstall: z.literal("true").optional()
48
- }).strict().describe("SkillRegistryItemMetadata");
49
- var productRegistryItemMetadataSchema = z.object({
50
- provider: z.string(),
51
- providerDisplayName: z.string(),
52
- providerProductId: z.string(),
53
- type: z.string(),
54
- categoryIds: z.array(z.string()).default([]),
55
- defaultVariantId: z.string().nullish(),
56
- areaCount: z.number().default(0),
57
- methods: z.array(z.string()).default([]),
58
- optionFacets: z.array(
59
- z.object({ name: z.string(), values: z.array(z.string()) }).strict()
60
- ).default([])
61
- }).strict().describe("ProductRegistryItemMetadata");
62
- var genericRegistryItemMetadataSchema = z.union([
63
- siteRegistryItemMetadataSchema,
64
- pageRegistryItemMetadataSchema,
65
- sectionRegistryItemMetadataSchema,
66
- skillRegistryItemMetadataSchema,
67
- brandingRegistryItemMetadataSchema,
68
- productRegistryItemMetadataSchema
69
- ]).describe("GenericRegistryItemMetadata");
70
- var registryItemMetadataSchema = z.object({
71
- id: z.string(),
72
- slug: z.string(),
73
- name: z.string(),
74
- type: registryItemTypeSchema,
75
- metadata: genericRegistryItemMetadataSchema.nullable(),
76
- projectId: z.string().nullable(),
77
- createdBy: z.string().nullable(),
78
- sourceType: z.string().nullable(),
79
- sourceKey: z.string().nullable(),
80
- shortLink: z.string().nullable(),
81
- description: z.string().nullable(),
82
- visibility: z.string(),
83
- tags: z.array(z.string()),
84
- category: z.string().nullable(),
85
- previewUrls: z.array(z.string()),
86
- createdAt: z.string(),
87
- updatedAt: z.string()
88
- }).describe("RegistryItemMetadata");
89
- z.object({
90
- items: z.array(registryItemMetadataSchema),
91
- nextCursor: z.string().nullable()
92
- }).describe("FindRegistryItemsResult");
93
- z.object({
94
- categories: z.array(z.string())
95
- }).describe("RegistryItemCategoriesResult");
96
- z.object({
97
- tags: z.array(z.string())
98
- }).describe("RegistryItemTagsResult");
99
- var registryItemDetailSchema = registryItemMetadataSchema.extend({
100
- previewHtml: z.string().nullable()
101
- }).describe("RegistryItemDetail");
102
- z.object({
103
- item: registryItemDetailSchema.extend({
104
- projectId: z.null(),
105
- createdBy: z.null()
106
- })
107
- }).describe("RegistryItemPreviewResult");
108
- z.object({
109
- meta: z.object({
110
- id: z.string(),
111
- slug: z.string(),
112
- type: registryItemTypeSchema,
113
- name: z.string(),
114
- description: z.string().nullable()
115
- }),
116
- files: z.record(z.string(), z.string()),
117
- dependencies: z.array(z.string())
118
- }).describe("RegistryItemContent");
119
- z.object({
120
- id: z.uuid(),
121
- slug: z.string().min(1),
122
- name: z.string().min(1),
123
- type: registryItemTypeSchema,
124
- projectId: z.string().min(1).nullable(),
125
- createdBy: z.string().min(1).nullable(),
126
- description: z.string().nullable(),
127
- visibility: z.string(),
128
- tags: z.array(z.string()),
129
- category: z.string().nullable(),
130
- sourceType: z.string().nullable().default(null),
131
- sourceKey: z.string().nullable().default(null),
132
- shortLink: z.string().nullable().default(null),
133
- previewUrls: z.array(z.string()),
134
- previewHtml: z.string().nullable(),
135
- metadata: z.record(z.string(), z.unknown()).nullable(),
136
- files: registryContentFilesSchema,
137
- dependencies: z.array(z.string()),
138
- embeddingText: z.string(),
139
- embedding: z.array(z.number()),
140
- createdAt: z.string().min(1),
141
- updatedAt: z.string().min(1)
142
- }).describe("RegistryItemDocument");
143
- z.object({
144
- item: z.object({
145
- id: registryItemIdSchema,
146
- slug: registrySlugSchema,
147
- name: z.string().min(1),
148
- type: registryItemTypeSchema,
149
- projectId: z.string().min(1).nullable().default(null),
150
- createdBy: z.string().min(1).nullable().default(null),
151
- sourceType: z.string().min(1).max(80).nullable().default(null),
152
- sourceKey: z.string().min(1).max(512).nullable().default(null),
153
- description: z.string().nullable().default(null),
154
- metadata: z.record(z.string(), z.unknown()).nullable().default(null),
155
- // (Ezra, 2026-07-07, REPL-27571): owned channels (REST create, MCP
156
- // create_registry_item) may not author public items — only the internal
157
- // registry-catalog endpoint does — so an omitted visibility must resolve
158
- // to the project-scoped lane instead of silently going public.
159
- visibility: registryItemVisibilitySchema.default("unlisted"),
160
- tags: z.array(z.string()).default([]),
161
- category: z.string().nullable().default(null),
162
- previewUrls: z.array(z.string()).default([]),
163
- previewHtml: z.string().nullable().default(null),
164
- files: registryContentFilesSchema,
165
- dependencies: z.array(z.string()).default([])
166
- })
167
- }).describe("RegistryCreateItemInput");
168
- z.object({
169
- created: z.object({
170
- id: registryItemIdSchema,
171
- type: registryItemTypeSchema,
172
- slug: registrySlugSchema,
173
- sourceType: z.string().nullable(),
174
- sourceKey: z.string().nullable(),
175
- url: z.url().describe(
176
- "Canonical public-facing URL for the new registry item. The skill returns this to the user immediately so they can share / preview without waiting on verification."
177
- ),
178
- shareUrl: z.url().nullable()
179
- })
180
- }).describe("RegistryCreateItemOutput");
181
- z.object({
182
- name: z.string().min(1),
183
- description: z.string().nullish(),
184
- metadata: z.record(z.string(), z.unknown()).nullish(),
185
- visibility: registryItemVisibilitySchema.optional(),
186
- tags: z.array(z.string()).optional(),
187
- category: z.string().nullish(),
188
- previewUrls: z.array(z.string()).optional(),
189
- previewHtml: z.string().nullish(),
190
- files: registryContentFilesSchema,
191
- dependencies: z.array(z.string()).optional()
192
- }).describe("RegistryCatalogUpsertInput");
193
- z.object({
194
- appName: z.string(),
195
- filepath: z.string(),
196
- route: z.string(),
197
- modifiedAt: z.number().optional(),
198
- // Birth-time (epoch ms) from `stat`, falling back to mtime when the
199
- // filesystem reports 0/unsupported. Used to sort the pages dashboard.
200
- createdAt: z.number().optional()
201
- }).describe("SandboxFile");
202
- var workspaceSkillSourceSchema = z.enum(["builtin", "project"]).describe("WorkspaceSkillSource");
203
- z.object({
204
- slug: z.string(),
205
- source: workspaceSkillSourceSchema,
206
- filepath: z.string().optional(),
207
- name: z.string(),
208
- description: z.string(),
209
- body: z.string(),
210
- tagline: z.string().optional(),
211
- category: z.string().optional(),
212
- tags: z.array(z.string()),
213
- imageUrl: z.string().optional(),
214
- shape: z.string().optional(),
215
- gradient: z.string().optional(),
216
- modifiedAt: z.number().optional()
217
- }).describe("WorkspaceSkill");
218
- var skillFileSchema = z.object({
219
- id: z.string(),
220
- name: z.string(),
221
- description: z.string(),
222
- body: z.string()
223
- }).describe("SkillFile");
224
-
225
- // ../schemas/objectType.ts
226
- var imageSchema = z.object({
227
- url: z.string(),
228
- altText: z.string().nullable(),
229
- width: z.number().nullable(),
230
- height: z.number().nullable()
231
- });
232
- var mediaImageSchema = z.object({
233
- type: z.literal("image"),
234
- alt: z.string().nullable(),
235
- url: z.string(),
236
- width: z.number().nullable(),
237
- height: z.number().nullable()
238
- });
239
- var videoSourceSchema = z.object({
240
- url: z.string(),
241
- mimeType: z.string(),
242
- format: z.string(),
243
- width: z.number().nullable(),
244
- height: z.number().nullable()
245
- });
246
- var previewImageSchema = z.object({
247
- alt: z.string().nullable(),
248
- url: z.string(),
249
- width: z.number().nullable(),
250
- height: z.number().nullable()
251
- });
252
- var videoSchema = z.object({
253
- type: z.literal("video"),
254
- alt: z.string().nullable(),
255
- sources: z.array(videoSourceSchema),
256
- previewImage: previewImageSchema.nullable()
257
- });
258
- var externalVideoSchema = z.object({
259
- type: z.literal("externalVideo"),
260
- alt: z.string().nullable(),
261
- embedUrl: z.string(),
262
- host: z.string(),
263
- originUrl: z.string(),
264
- previewImage: previewImageSchema.nullable()
265
- });
266
- var mediaSchema = z.discriminatedUnion("type", [
267
- mediaImageSchema,
268
- videoSchema,
269
- externalVideoSchema
270
- ]);
271
- var priceSchema = z.object({
272
- amount: z.string(),
273
- currencyCode: z.string()
274
- });
275
- var selectedOptionSchema = z.object({
276
- name: z.string(),
277
- value: z.string()
278
- });
279
- var optionValueSwatchSchema = z.object({
280
- color: z.string().nullable(),
281
- imageUrl: z.string().nullable()
282
- });
283
- var optionValueSchema = z.object({
284
- id: z.string(),
285
- value: z.string(),
286
- swatch: optionValueSwatchSchema.nullable()
287
- });
288
- var productOptionSchema = z.object({
289
- id: z.string().optional(),
290
- name: z.string(),
291
- values: z.array(z.string()),
292
- optionValues: z.array(optionValueSchema).optional()
293
- });
294
- var metafieldSchema = z.object({
295
- key: z.string(),
296
- namespace: z.string(),
297
- type: z.string(),
298
- value: z.string()
299
- });
300
- var variantSchema = z.object({
301
- id: z.string(),
302
- title: z.string().optional(),
303
- availableForSale: z.boolean().optional(),
304
- sku: z.string().nullish(),
305
- selectedOptions: z.array(selectedOptionSchema).optional(),
306
- image: imageSchema.nullish(),
307
- price: priceSchema.optional(),
308
- compareAtPrice: priceSchema.nullish(),
309
- sellingPlanIds: z.array(z.string()).optional()
310
- });
311
- var productSchema = z.object({
312
- id: z.string(),
313
- handle: z.string().optional(),
314
- title: z.string().optional(),
315
- description: z.string().nullish(),
316
- descriptionHtml: z.string().nullish(),
317
- availableForSale: z.boolean().optional(),
318
- featuredImage: imageSchema.nullish(),
319
- options: z.array(productOptionSchema).optional(),
320
- variants: z.array(variantSchema).optional(),
321
- minPrice: priceSchema.optional(),
322
- maxPrice: priceSchema.optional(),
323
- // Storefront `compareAtPriceRange` returns 0.0 amounts when no variant has a
324
- // compare-at price. Consumers should treat `amount === "0.0"` as "no
325
- // discount" rather than infer it from nullability.
326
- compareAtMinPrice: priceSchema.optional(),
327
- compareAtMaxPrice: priceSchema.optional(),
328
- images: z.array(imageSchema).optional(),
329
- media: z.array(mediaSchema).optional(),
330
- vendor: z.string().nullish(),
331
- productType: z.string().nullish(),
332
- tags: z.array(z.string()).optional(),
333
- sellingPlanGroups: z.array(sellingPlanGroupSchema).optional(),
334
- metafields: z.array(metafieldSchema).optional()
335
- });
336
- var collectionSchema = z.object({
337
- id: z.string(),
338
- handle: z.string().optional(),
339
- title: z.string().optional(),
340
- descriptionHtml: z.string().nullish(),
341
- image: imageSchema.nullish()
342
- });
343
- var discountCodeSchema = z.object({
344
- id: z.string(),
345
- // The redeemable code(s) customers enter at checkout. A single Shopify
346
- // discount can expose more than one code, so this is an array.
347
- codes: z.array(z.string()).optional(),
348
- // The merchant-facing discount name, which is distinct from the code itself.
349
- title: z.string().optional(),
350
- // Shopify DiscountStatus: ACTIVE, EXPIRED, or SCHEDULED. Kept as a string so
351
- // new Shopify statuses do not break parsing.
352
- status: z.string().optional(),
353
- // Human-readable explanation of the discount (e.g. "20% off all products").
354
- summary: z.string().nullish(),
355
- // Shopify discount union type: DiscountCodeBasic, DiscountCodeBxgy,
356
- // DiscountCodeFreeShipping, or DiscountCodeApp.
357
- discountType: z.string().optional(),
358
- startsAt: z.string().nullish(),
359
- endsAt: z.string().nullish(),
360
- usageLimit: z.number().nullish(),
361
- usageCount: z.number().optional(),
362
- appliesOncePerCustomer: z.boolean().optional()
363
- });
364
- var assetSchema = z.object({
365
- id: z.string(),
366
- name: z.string().optional(),
367
- url: z.string().optional(),
368
- fileExtension: z.string().optional()
369
- });
370
- var integrationSchema = z.object({
371
- type: z.string(),
372
- title: z.string().optional(),
373
- image: z.string().optional()
374
- });
375
- var pageSchema = z.object({
376
- id: z.string(),
377
- name: z.string().optional(),
378
- route: z.string().optional()
379
- }).describe("ObjectTypePage");
380
- var registryItemSchema = z.object({
381
- id: z.string(),
382
- slug: z.string().optional(),
383
- title: z.string().optional(),
384
- type: registryItemTypeSchema.optional(),
385
- description: z.string().optional(),
386
- previewUrl: z.string().optional()
387
- }).describe("ObjectTypeRegistryItem");
388
- var opusClipSchema = z.object({
389
- id: z.string(),
390
- title: z.string().optional(),
391
- description: z.string().optional(),
392
- previewUrl: z.string().optional(),
393
- exportUrl: z.string().optional(),
394
- durationMs: z.number().optional(),
395
- opusProjectId: z.string().optional(),
396
- projectTitle: z.string().optional()
397
- });
398
- var opusProjectSchema = z.object({
399
- id: z.string(),
400
- title: z.string().optional(),
401
- sourceVideoUrl: z.string().optional(),
402
- createdAtIso: z.string().optional()
403
- }).describe("OpusProject");
404
- var opusCollectionSchema = z.object({
405
- id: z.string(),
406
- name: z.string().optional(),
407
- createdAt: z.string().optional(),
408
- updatedAt: z.string().optional()
409
- });
410
- var segmentSourceSchema = z.object({
411
- id: z.string().describe("segmentSource primaryId"),
412
- slug: z.string().optional(),
413
- name: z.string().optional(),
414
- enabled: z.boolean().optional(),
415
- sourceType: z.string().optional(),
416
- writeKeys: z.array(z.string()).optional()
417
- }).describe("SegmentSource");
418
- var levantaAffiliateLinkSchema = z.object({
419
- linkId: z.string(),
420
- url: z.string()
421
- });
422
- var levantaProductSchema = z.object({
423
- id: z.string(),
424
- asin: z.string().optional(),
425
- title: z.string().optional(),
426
- price: z.string().optional().describe('Product price as a decimal string in USD (e.g. "34.99").'),
427
- commission: z.string().optional().describe(
428
- 'Creator commission rate as a decimal string percentage (e.g. "8.5" meaning 8.5%).'
429
- ),
430
- imageUrl: z.string().nullish(),
431
- brand: z.object({ id: z.string(), name: z.string() }).nullish(),
432
- inStock: z.boolean().optional(),
433
- marketplace: z.string().optional(),
434
- affiliateLink: levantaAffiliateLinkSchema.nullish()
435
- }).describe("LevantaProduct");
436
- var intelligemsExperienceSchema = z.object({
437
- id: z.string(),
438
- name: z.string().optional(),
439
- category: z.string().optional(),
440
- status: z.string().optional()
441
- }).describe("IntelligemsExperience");
442
- var customerIoSegmentSchema = z.object({
443
- id: z.string().describe("customerIoSegment primaryId"),
444
- name: z.string().optional(),
445
- description: z.string().optional(),
446
- type: z.string().optional()
447
- }).describe("CustomerIoSegment");
448
- var customerIoCampaignSchema = z.object({
449
- id: z.string().describe("customerIoCampaign primaryId"),
450
- name: z.string().optional(),
451
- type: z.string().optional(),
452
- active: z.boolean().optional()
453
- }).describe("CustomerIoCampaign");
454
- var customerIoBroadcastSchema = z.object({
455
- id: z.string().describe("customerIoBroadcast primaryId"),
456
- name: z.string().optional(),
457
- active: z.boolean().optional()
458
- }).describe("CustomerIoBroadcast");
459
- var vwoCampaignSchema = z.object({
460
- id: z.string(),
461
- name: z.string().optional(),
462
- type: z.string().optional(),
463
- status: z.string().optional()
464
- }).describe("VwoCampaign");
465
- var okendoReviewSchema = z.object({
466
- id: z.string(),
467
- title: z.string().optional(),
468
- body: z.string().optional(),
469
- rating: z.number().optional(),
470
- productName: z.string().optional(),
471
- reviewerName: z.string().optional(),
472
- dateCreated: z.string().optional(),
473
- status: z.string().optional()
474
- }).describe("OkendoReview");
475
- var looxReviewSchema = z.object({
476
- id: z.string(),
477
- title: z.string().optional(),
478
- body: z.string().optional(),
479
- rating: z.number().optional(),
480
- productName: z.string().optional(),
481
- reviewerName: z.string().optional(),
482
- dateCreated: z.string().optional(),
483
- status: z.string().optional()
484
- }).describe("LooxReview");
485
- var planSchema = z.object({
486
- id: z.string(),
487
- name: z.string().optional(),
488
- path: z.string().optional()
489
- }).describe("ObjectTypePlan");
490
- var OBJECT_TYPE_REGISTRY = {
491
- product: {
492
- type: "product",
493
- displayName: "Product",
494
- identifiers: {
495
- primaryId: "id",
496
- handle: "handle"
497
- },
498
- canonicalSchema: productSchema,
499
- mentionable: true
500
- },
501
- collection: {
502
- type: "collection",
503
- displayName: "Collection",
504
- identifiers: {
505
- primaryId: "id",
506
- handle: "handle"
507
- },
508
- canonicalSchema: collectionSchema,
509
- mentionable: true
510
- },
511
- discountCode: {
512
- type: "discountCode",
513
- displayName: "Discount Code",
514
- identifiers: {
515
- primaryId: "id"
516
- },
517
- canonicalSchema: discountCodeSchema,
518
- mentionable: true
519
- },
520
- variant: {
521
- type: "variant",
522
- displayName: "Variant",
523
- identifiers: {
524
- primaryId: "id",
525
- cartMerchandiseId: "id"
526
- },
527
- canonicalSchema: variantSchema
528
- },
529
- asset: {
530
- type: "asset",
531
- displayName: "Asset",
532
- identifiers: {
533
- primaryId: "id"
534
- },
535
- canonicalSchema: assetSchema,
536
- mentionable: true
537
- },
538
- integration: {
539
- type: "integration",
540
- displayName: "Integration",
541
- identifiers: {
542
- primaryId: "type"
543
- },
544
- canonicalSchema: integrationSchema,
545
- mentionable: true
546
- },
547
- page: {
548
- type: "page",
549
- displayName: "Page",
550
- identifiers: {
551
- primaryId: "id"
552
- },
553
- canonicalSchema: pageSchema,
554
- mentionable: true
555
- },
556
- skill: {
557
- type: "skill",
558
- displayName: "Skill",
559
- identifiers: {
560
- primaryId: "id"
561
- },
562
- canonicalSchema: skillFileSchema,
563
- mentionable: true
564
- },
565
- registryItem: {
566
- type: "registryItem",
567
- displayName: "Registry Item",
568
- identifiers: {
569
- primaryId: "id",
570
- handle: "slug"
571
- },
572
- canonicalSchema: registryItemSchema,
573
- mentionable: true
574
- },
575
- opusClip: {
576
- type: "opusClip",
577
- displayName: "Opus Clip",
578
- identifiers: {
579
- primaryId: "id"
580
- },
581
- canonicalSchema: opusClipSchema,
582
- mentionable: true
583
- },
584
- opusProject: {
585
- type: "opusProject",
586
- displayName: "Opus Project",
587
- identifiers: {
588
- primaryId: "id"
589
- },
590
- canonicalSchema: opusProjectSchema,
591
- mentionable: true
592
- },
593
- opusCollection: {
594
- type: "opusCollection",
595
- displayName: "Opus Clip Collection",
596
- identifiers: {
597
- primaryId: "id"
598
- },
599
- canonicalSchema: opusCollectionSchema,
600
- mentionable: true
601
- },
602
- segmentSource: {
603
- type: "segmentSource",
604
- displayName: "Segment Source",
605
- identifiers: {
606
- primaryId: "id"
607
- },
608
- canonicalSchema: segmentSourceSchema,
609
- mentionable: true
610
- },
611
- intelligemsExperience: {
612
- type: "intelligemsExperience",
613
- displayName: "Intelligems Experience",
614
- identifiers: {
615
- primaryId: "id"
616
- },
617
- canonicalSchema: intelligemsExperienceSchema,
618
- mentionable: true
619
- },
620
- customerIoSegment: {
621
- type: "customerIoSegment",
622
- displayName: "Customer.io Segment",
623
- identifiers: {
624
- primaryId: "id"
625
- },
626
- canonicalSchema: customerIoSegmentSchema,
627
- mentionable: true
628
- },
629
- customerIoCampaign: {
630
- type: "customerIoCampaign",
631
- displayName: "Customer.io Campaign",
632
- identifiers: {
633
- primaryId: "id"
634
- },
635
- canonicalSchema: customerIoCampaignSchema,
636
- mentionable: true
637
- },
638
- customerIoBroadcast: {
639
- type: "customerIoBroadcast",
640
- displayName: "Customer.io Broadcast",
641
- identifiers: {
642
- primaryId: "id"
643
- },
644
- canonicalSchema: customerIoBroadcastSchema,
645
- mentionable: true
646
- },
647
- vwoCampaign: {
648
- type: "vwoCampaign",
649
- displayName: "VWO Campaign",
650
- identifiers: {
651
- primaryId: "id"
652
- },
653
- canonicalSchema: vwoCampaignSchema,
654
- mentionable: true
655
- },
656
- levantaProduct: {
657
- type: "levantaProduct",
658
- displayName: "Levanta Product",
659
- identifiers: {
660
- primaryId: "id"
661
- },
662
- canonicalSchema: levantaProductSchema,
663
- mentionable: true
664
- },
665
- okendoReview: {
666
- type: "okendoReview",
667
- displayName: "Okendo Review",
668
- identifiers: {
669
- primaryId: "id"
670
- },
671
- canonicalSchema: okendoReviewSchema,
672
- mentionable: true
673
- },
674
- looxReview: {
675
- type: "looxReview",
676
- displayName: "Loox Review",
677
- identifiers: {
678
- primaryId: "id"
679
- },
680
- canonicalSchema: looxReviewSchema,
681
- mentionable: true
682
- },
683
- plan: {
684
- type: "plan",
685
- displayName: "Plan",
686
- identifiers: {
687
- primaryId: "id"
688
- },
689
- canonicalSchema: planSchema,
690
- mentionable: true
691
- }
692
- };
693
- function getObjectTypeDefinition(objectTypeKey) {
694
- return OBJECT_TYPE_REGISTRY[objectTypeKey];
695
- }
696
- function transformReploProductToCanonical(product) {
697
- const options = product.options ?? [];
698
- const variants = product.variants ?? [];
699
- return {
700
- id: product.id,
701
- title: product.title,
702
- handle: product.slug ?? product.id,
703
- description: null,
704
- descriptionHtml: product.descriptionHtml ?? null,
705
- availableForSale: variants.length > 0 ? variants.some((variant) => variant.availableForSale ?? true) : true,
706
- featuredImage: product.featuredMedia ? {
707
- url: product.featuredMedia.url,
708
- altText: product.featuredMedia.alt ?? null,
709
- width: product.featuredMedia.width ?? null,
710
- height: product.featuredMedia.height ?? null
711
- } : null,
712
- images: product.featuredMedia ? [
713
- {
714
- url: product.featuredMedia.url,
715
- altText: product.featuredMedia.alt ?? null,
716
- width: product.featuredMedia.width ?? null,
717
- height: product.featuredMedia.height ?? null
718
- }
719
- ] : [],
720
- media: product.featuredMedia ? [
721
- {
722
- type: "image",
723
- alt: product.featuredMedia.alt ?? null,
724
- url: product.featuredMedia.url,
725
- width: product.featuredMedia.width ?? null,
726
- height: product.featuredMedia.height ?? null
727
- }
728
- ] : [],
729
- vendor: null,
730
- productType: null,
731
- tags: [],
732
- sellingPlanGroups: [],
733
- metafields: [],
734
- options: options.map((option) => ({
735
- name: option.title,
736
- values: option.optionValues.map((optionValue) => optionValue.value)
737
- })),
738
- variants: variants.map((variant) => ({
739
- id: variant.id,
740
- title: variant.title ?? "",
741
- availableForSale: variant.availableForSale ?? true,
742
- sku: variant.sku ?? null,
743
- selectedOptions: (variant.optionValues ?? []).map((optionValue) => {
744
- const parentOption = options.find((option) => {
745
- return option.optionValues.some(
746
- (parentOptionValue) => parentOptionValue.id === optionValue.id
747
- );
748
- });
749
- return {
750
- name: parentOption?.title ?? "",
751
- value: optionValue.value
752
- };
753
- }),
754
- image: null,
755
- price: {
756
- amount: String(variant.price ?? 0),
757
- currencyCode: variant.priceCurrencyCode ?? "USD"
758
- },
759
- compareAtPrice: null,
760
- sellingPlanIds: []
761
- }))
762
- };
763
- }
764
-
765
- export { assetSchema, collectionSchema, customerIoBroadcastSchema, customerIoCampaignSchema, customerIoSegmentSchema, discountCodeSchema, externalVideoSchema, getObjectTypeDefinition, imageSchema, integrationSchema, intelligemsExperienceSchema, levantaAffiliateLinkSchema, levantaProductSchema, looxReviewSchema, mediaImageSchema, mediaSchema, metafieldSchema, okendoReviewSchema, optionValueSchema, optionValueSwatchSchema, opusClipSchema, opusCollectionSchema, opusProjectSchema, pageSchema, planSchema, previewImageSchema, priceSchema, productOptionSchema, productSchema, registryItemSchema, segmentSourceSchema, selectedOptionSchema, transformReploProductToCanonical, variantSchema, videoSchema, videoSourceSchema, vwoCampaignSchema };