shopify-webhook-schemas 0.1.8 → 0.1.9

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.
@@ -1,3 +1,5 @@
1
+ import { inferSchemaFromExamplePayload } from "./infer-schema";
2
+ export { inferSchemaFromExamplePayload };
1
3
  export declare function getPackageRootDir(): string;
2
4
  /** Return a metadata blob from Shopify's docs describing a webhook topic */
3
5
  export declare function metadataForWebhook(apiVersion: string, topic: string): any;
package/dist/src/index.js CHANGED
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.inferSchemaFromExamplePayload = void 0;
6
7
  exports.getPackageRootDir = getPackageRootDir;
7
8
  exports.metadataForWebhook = metadataForWebhook;
8
9
  exports.schemaForWebhook = schemaForWebhook;
@@ -10,6 +11,8 @@ exports.allTopicsForVersion = allTopicsForVersion;
10
11
  const fs_1 = __importDefault(require("fs"));
11
12
  const path_1 = __importDefault(require("path"));
12
13
  const fast_glob_1 = __importDefault(require("fast-glob"));
14
+ const infer_schema_1 = require("./infer-schema");
15
+ Object.defineProperty(exports, "inferSchemaFromExamplePayload", { enumerable: true, get: function () { return infer_schema_1.inferSchemaFromExamplePayload; } });
13
16
  const loaded = { metadatas: {}, schemas: {} };
14
17
  function getPackageRootDir() {
15
18
  let currentDir = __dirname;
@@ -0,0 +1,18 @@
1
+ export declare const startVersion = "2024-04";
2
+ export type Error = {
3
+ message: string;
4
+ path: string;
5
+ };
6
+ export declare const inferSchemaFromExamplePayload: (examplePayload: Record<string, any>, metadata: {
7
+ name: string;
8
+ }) => {
9
+ schema: any;
10
+ warnings: number;
11
+ errors: Error[];
12
+ };
13
+ export declare const manualExamples: [RegExp, Record<string, any>][];
14
+ export declare const overrides: {
15
+ topics: string[];
16
+ schema: any;
17
+ versions?: string[];
18
+ }[];
@@ -0,0 +1,627 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.overrides = exports.manualExamples = exports.inferSchemaFromExamplePayload = exports.startVersion = void 0;
4
+ const json_schema_walker_1 = require("@cloudflare/json-schema-walker");
5
+ const schema_infer_1 = require("@jsonhero/schema-infer");
6
+ const lodash_1 = require("lodash");
7
+ const safe_stable_stringify_1 = require("safe-stable-stringify");
8
+ const stringify = (0, safe_stable_stringify_1.configure)({ deterministic: true });
9
+ exports.startVersion = "2024-04";
10
+ const inferSchemaFromExamplePayload = (examplePayload, metadata) => {
11
+ const inference = (0, schema_infer_1.inferSchema)(examplePayload);
12
+ // build a copy of the payload and apply overrides based on the webhook name
13
+ for (const [matcher, override] of exports.manualExamples) {
14
+ if (matcher.test(metadata.name)) {
15
+ const overridesPayload = (0, lodash_1.cloneDeep)(examplePayload);
16
+ const maskedOverride = (0, lodash_1.pick)(override, Object.keys(examplePayload));
17
+ (0, lodash_1.merge)(overridesPayload, maskedOverride);
18
+ inference.infer(overridesPayload);
19
+ }
20
+ }
21
+ const schema = {
22
+ $schema: "https://json-schema.org/draft/2020-12/schema",
23
+ ...inference.toJSONSchema(),
24
+ };
25
+ for (const override of exports.overrides) {
26
+ if (override.topics.includes(metadata.name) && (!override.versions || override.versions.includes(exports.startVersion))) {
27
+ for (const [key, schemaOverride] of Object.entries(override.schema)) {
28
+ schema.properties[key] = schemaOverride;
29
+ }
30
+ }
31
+ }
32
+ const sortedSchema = getDeterministicObject(schema);
33
+ let warnings = 0;
34
+ const errors = [];
35
+ (0, json_schema_walker_1.schemaWalk)(sortedSchema, (subschema, path, _parent, parentPath) => {
36
+ if ((0, lodash_1.isEqual)(subschema, { type: "null" })) {
37
+ warnings += 1;
38
+ const fullPath = [...parentPath, ...path].join(".");
39
+ if (unknownPaths.some(([pattern, paths]) => pattern.test(metadata.name) && paths.includes(fullPath))) {
40
+ // we know this path is always null, so don't error
41
+ }
42
+ else {
43
+ errors.push({
44
+ message: "null type found in final schema",
45
+ path: fullPath,
46
+ });
47
+ }
48
+ }
49
+ }, () => { }, (0, json_schema_walker_1.getVocabulary)(sortedSchema));
50
+ return { schema: sortedSchema, warnings, errors };
51
+ };
52
+ exports.inferSchemaFromExamplePayload = inferSchemaFromExamplePayload;
53
+ const getDeterministicObject = (obj) => {
54
+ const stableString = stringify(sortStringArrays(obj));
55
+ return JSON.parse(stableString);
56
+ };
57
+ const sortStringArrays = (obj) => {
58
+ return (0, lodash_1.cloneDeepWith)(obj, (value) => {
59
+ if (Array.isArray(value) && value.every((item) => typeof item === "string")) {
60
+ return value.sort();
61
+ }
62
+ });
63
+ };
64
+ // paths that we can't find any source data for at all, so we don't know what type they should be
65
+ const unknownPaths = [
66
+ [
67
+ /checkouts\/.+/,
68
+ [
69
+ "properties.line_items.items.properties.unit_price_measurement.properties.measured_type",
70
+ "properties.line_items.items.properties.unit_price_measurement.properties.quantity_value",
71
+ "properties.line_items.items.properties.unit_price_measurement.properties.quantity_unit",
72
+ "properties.line_items.items.properties.unit_price_measurement.properties.reference_value",
73
+ "properties.line_items.items.properties.unit_price_measurement.properties.reference_unit",
74
+ "properties.line_items.items.properties.tax_lines.items.properties.reporting_jurisdiction_name",
75
+ "properties.line_items.items.properties.tax_lines.items.properties.reporting_jurisdiction_type",
76
+ "properties.line_items.items.properties.tax_lines.items.properties.reporting_jurisdiction_code",
77
+ "properties.line_items.items.properties.user_id",
78
+ "properties.line_items.items.properties.compare_at_price",
79
+ "properties.gateway",
80
+ "properties.shipping_lines.items.properties.delivery_category",
81
+ "properties.shipping_lines.items.properties.validation_context",
82
+ "properties.shipping_lines.items.properties.requested_fulfillment_service_id",
83
+ "properties.shipping_lines.items.properties.tax_lines.items.properties.identifier",
84
+ "properties.shipping_lines.items.properties.tax_lines.items.properties.reporting_jurisdiction_name",
85
+ "properties.shipping_lines.items.properties.tax_lines.items.properties.tax_api_client_id",
86
+ "properties.shipping_lines.items.properties.tax_lines.items.properties.reporting_exempt_amount",
87
+ "properties.shipping_lines.items.properties.tax_lines.items.properties.jurisdiction_source",
88
+ "properties.shipping_lines.items.properties.tax_lines.items.properties.reporting_jurisdiction_code",
89
+ "properties.shipping_lines.items.properties.tax_lines.items.properties.reporting_jurisdiction_type",
90
+ "properties.shipping_lines.items.properties.tax_lines.items.properties.reporting_taxable_amount",
91
+ "properties.shipping_lines.items.properties.tax_lines.items.properties.jurisdiction_type",
92
+ "properties.shipping_lines.items.properties.tax_lines.items.properties.tax_type",
93
+ "properties.shipping_lines.items.properties.tax_lines.items.properties.jurisdiction_id",
94
+ "properties.shipping_lines.items.properties.tax_lines.items.properties.reporting_non_taxable_amount",
95
+ "properties.shipping_lines.items.properties.custom_tax_lines",
96
+ "properties.shipping_lines.items.properties.estimated_delivery_time_range",
97
+ "properties.line_items.items.properties.tax_lines.items.properties.tax_type",
98
+ "properties.line_items.items.properties.tax_lines.items.properties.identifier",
99
+ "properties.line_items.items.properties.discount_allocations.items.properties.id",
100
+ "properties.line_items.items.properties.discount_allocations.items.properties.created_at",
101
+ ],
102
+ ],
103
+ [
104
+ /collection_listings\/.+/,
105
+ ["properties.collection_listing.properties.default_product_image", "properties.collection_listing.properties.image"],
106
+ ],
107
+ [/domains\/.+/, ["properties.localization.properties.country"]],
108
+ [/orders\/.+/, ["properties.client_details.properties.session_hash"]],
109
+ ];
110
+ // example data we feed the schema infer-er for each topic to allow it to discover real types
111
+ exports.manualExamples = [
112
+ [
113
+ /.+/,
114
+ {
115
+ admin_graphql_api_id: "gid://shopify/Something/1234567890",
116
+ admin_graphql_api_job_id: "gid://shopify/Job/1234567890",
117
+ created_at: "2021-12-30T19:00:00-05:00",
118
+ updated_at: "2021-12-30T19:00:00-05:00",
119
+ address2: "Apt 123",
120
+ latitude: 10.1,
121
+ longitude: 10.1,
122
+ location_id: 111111,
123
+ },
124
+ ],
125
+ [
126
+ /(app|shop)\/.+/,
127
+ {
128
+ domain: "example.com",
129
+ source: "example source",
130
+ myshopify_domain: "example.myshopify.com",
131
+ google_apps_domain: "example.com",
132
+ google_apps_login_enabled: true,
133
+ password_enabled: true,
134
+ taxes_included: true,
135
+ tax_shipping: true,
136
+ iana_timezone: "America/New_York",
137
+ auto_configure_tax_inclusivity: true,
138
+ county_taxes: true,
139
+ },
140
+ ],
141
+ [
142
+ /bulk_operations\/.+/,
143
+ {
144
+ error_code: "SOME_ERROR_ENUM",
145
+ },
146
+ ],
147
+ [
148
+ /carts\/.+/,
149
+ {
150
+ note: "some cart note string",
151
+ },
152
+ ],
153
+ [
154
+ /(checkouts|orders)\/.+/,
155
+ {
156
+ gateway: "shopify_payments",
157
+ landing_site: "https://example.com",
158
+ note: "some order note",
159
+ referring_site: "https://example.com",
160
+ completed_at: "2021-12-30T19:00:00-05:00",
161
+ closed_at: "2021-12-30T19:00:00-05:00",
162
+ user_id: 11111111,
163
+ location_id: 22222222,
164
+ source_identifier: "some_source_identifier",
165
+ source_url: "https://example.com",
166
+ device_id: "some_device_id",
167
+ phone: "+1 (123) 456 7890",
168
+ sms_marketing_phone: "+1 (123) 456 7890",
169
+ customer_locale: "en",
170
+ source: "some_source",
171
+ total_duties: 10.11,
172
+ app_id: 12345,
173
+ browser_ip: "10.0.0.1",
174
+ cart_token: "some_cart_token",
175
+ checkout_id: 12345,
176
+ client_details: {
177
+ accept_language: "en-US,en;q=0.9",
178
+ browser_height: 800,
179
+ },
180
+ confirmation_number: "some_confirmation_number",
181
+ current_total_additional_fees_set: {
182
+ shop_money: {
183
+ amount: "0.00",
184
+ currency_code: "USD",
185
+ },
186
+ presentment_money: {
187
+ amount: "0.00",
188
+ currency_code: "USD",
189
+ },
190
+ },
191
+ current_total_duties_set: {
192
+ shop_money: {
193
+ amount: "0.00",
194
+ currency_code: "USD",
195
+ },
196
+ presentment_money: {
197
+ amount: "0.00",
198
+ currency_code: "USD",
199
+ },
200
+ },
201
+ original_total_additional_fees_set: {
202
+ shop_money: {
203
+ amount: "0.00",
204
+ currency_code: "USD",
205
+ },
206
+ presentment_money: {
207
+ amount: "0.00",
208
+ currency_code: "USD",
209
+ },
210
+ },
211
+ original_total_duties_set: {
212
+ shop_money: {
213
+ amount: "0.00",
214
+ currency_code: "USD",
215
+ },
216
+ presentment_money: {
217
+ amount: "0.00",
218
+ currency_code: "USD",
219
+ },
220
+ },
221
+ checkout_token: "some_checkout_token",
222
+ landing_site_ref: "https://example.com",
223
+ merchant_of_record_app_id: 12345,
224
+ po_number: "some_po_number",
225
+ processed_at: "2021-12-30T19:00:00-05:00",
226
+ reference: "some_reference",
227
+ payment_terms: "some_payment_terms",
228
+ reservation_token: "some_reservation_token",
229
+ billing_address: {
230
+ address2: "suite 101",
231
+ latitude: 34.1,
232
+ longitude: 34.1,
233
+ },
234
+ shipping_address: {
235
+ address2: "suite 101",
236
+ latitude: 34.1,
237
+ longitude: 34.1,
238
+ },
239
+ customer: {
240
+ created_at: "2024-05-05T02:42:32+08:00",
241
+ marketing_opt_in_level: "single_opt_in",
242
+ note: "some string",
243
+ multipass_identifier: "hello",
244
+ },
245
+ },
246
+ ],
247
+ [
248
+ /checkouts\/.+/,
249
+ {
250
+ line_items: [
251
+ {
252
+ presentment_variant_title: "51 x 76 / Blanc / 1",
253
+ taxable: true,
254
+ variant_price: "69.00",
255
+ presentment_title: "Taie d'oreiller Pure Soie de Mûrier",
256
+ requires_shipping: true,
257
+ unit_price_measurement: {
258
+ measured_type: null,
259
+ quantity_unit: null,
260
+ quantity_value: null,
261
+ reference_unit: null,
262
+ reference_value: null,
263
+ },
264
+ variant_title: "51 x 76 / Blanc / 1",
265
+ title: "Taie d'oreiller Pure Soie de Mûrier",
266
+ gift_card: false,
267
+ destination_location_id: 4042942054746,
268
+ compare_at_price: null,
269
+ key: "e0105d4efb1970501cf831566fa79752",
270
+ line_price: "69.00",
271
+ vendor: "Emily's pillow",
272
+ quantity: 1,
273
+ applied_discounts: [],
274
+ grams: 110,
275
+ properties: [
276
+ {
277
+ name: "_isJust",
278
+ value: "true",
279
+ },
280
+ ],
281
+ tax_lines: [
282
+ {
283
+ reporting_jurisdiction_type: null,
284
+ reporting_non_taxable_amount: "0.00",
285
+ zone: null,
286
+ compare_at: 0.2,
287
+ reporting_taxable_amount: "57.50",
288
+ tax_api_client_id: null,
289
+ jurisdiction_source: "ActiveTax",
290
+ title: "FR TVA",
291
+ identifier: null,
292
+ jurisdiction_type: "COUNTRY",
293
+ reporting_jurisdiction_code: null,
294
+ source: "MerchantActiveTax",
295
+ reporting_exempt_amount: "0.00",
296
+ reporting_jurisdiction_name: null,
297
+ jurisdiction_id: "FR",
298
+ tax_type: null,
299
+ channel_liable: false,
300
+ price: "11.50",
301
+ rate: 0.2,
302
+ position: 1,
303
+ tax_calculation_price: "11.50",
304
+ },
305
+ ],
306
+ sku: "EMIL-TO5176-22WH",
307
+ rank: 0,
308
+ user_id: null,
309
+ product_id: 4610455470216,
310
+ discount_allocations: [],
311
+ origin_location_id: 1743669821576,
312
+ fulfillment_service: "manual",
313
+ variant_id: 32516187029640,
314
+ price: "69.00",
315
+ },
316
+ ],
317
+ },
318
+ ],
319
+ [
320
+ /collections\/.+/,
321
+ {
322
+ sort_order: "manual",
323
+ template_suffix: "some_template_suffix",
324
+ },
325
+ ],
326
+ [
327
+ /collection_listings\/.+/,
328
+ {
329
+ collection_listing: {
330
+ updated_at: "2021-12-30T19:00:00-05:00",
331
+ sort_order: 1,
332
+ },
333
+ },
334
+ ],
335
+ [
336
+ /company_locations\/.+/,
337
+ {
338
+ buyer_experience_configuration: { pay_now_only: true },
339
+ billing_address: {
340
+ address2: "suite 101",
341
+ },
342
+ shipping_address: {
343
+ address2: "suite 101",
344
+ },
345
+ },
346
+ ],
347
+ [
348
+ /customers\/.+/,
349
+ {
350
+ last_order_id: 12345,
351
+ multipass_identifier: "some_multipass_identifier",
352
+ last_order_name: "Foobar",
353
+ phone: "+1 (123) 456 7890",
354
+ sms_marketing_consent: false,
355
+ email_marketing_consent: false,
356
+ accepts_marketing_updated_at: "2021-12-30T19:00:00-05:00",
357
+ marketing_opt_in_level: "single_opt_in",
358
+ },
359
+ ],
360
+ [
361
+ /customer_account_settings\/.+/,
362
+ {
363
+ url: "https://example.com",
364
+ },
365
+ ],
366
+ [
367
+ /customer.+consent\/.+/,
368
+ {
369
+ phone: "+1 (123) 456 7890",
370
+ email_address: "test@test.com",
371
+ },
372
+ ],
373
+ [
374
+ /disputes\/.+/,
375
+ {
376
+ evidence_sent_on: "2021-12-30T19:00:00-05:00",
377
+ finalized_on: "2021-12-30T19:00:00-05:00",
378
+ },
379
+ ],
380
+ [
381
+ /draft_orders\/.+/,
382
+ {
383
+ invoice_sent_at: "2021-12-30T19:00:00-05:00",
384
+ order_id: 12345,
385
+ },
386
+ ],
387
+ [
388
+ /fulfillment_events\/.+/,
389
+ {
390
+ city: "Ottawa",
391
+ province: "ON",
392
+ zip: "K1P1J1",
393
+ address1: "150 Elgin St",
394
+ estimated_delivery_at: "2021-12-30T19:00:00-05:00",
395
+ },
396
+ ],
397
+ [
398
+ /fulfillment_orders\/.+/,
399
+ {
400
+ remaining_fulfillment_order: {
401
+ id: 5859333242902,
402
+ shop_id: 20978040854,
403
+ order_id: 4804938989590,
404
+ assigned_location_id: 67794436118,
405
+ request_status: "unsubmitted",
406
+ status: "open",
407
+ supported_actions: ["request_fulfillment", "hold", "move"],
408
+ destination: {
409
+ id: 5479404371990,
410
+ address1: "23 Hassall Street",
411
+ address2: "",
412
+ city: "Parramatta",
413
+ company: null,
414
+ country: "Australia",
415
+ email: "",
416
+ first_name: "Tyler",
417
+ last_name: "Kelleher",
418
+ phone: null,
419
+ province: "New South Wales",
420
+ zip: "2150",
421
+ },
422
+ line_items: [
423
+ {
424
+ id: 12675478814742,
425
+ shop_id: 20978040854,
426
+ fulfillment_order_id: 5859333242902,
427
+ quantity: 1,
428
+ line_item_id: 12553770336278,
429
+ inventory_item_id: 44276125368342,
430
+ fulfillable_quantity: 1,
431
+ variant_id: 42182036422678,
432
+ },
433
+ ],
434
+ fulfill_at: "2022-10-13T13:00:00-04:00",
435
+ fulfill_by: null,
436
+ international_duties: {
437
+ incoterm: "DAP",
438
+ },
439
+ fulfillment_holds: [],
440
+ delivery_method: {
441
+ id: 140816351254,
442
+ method_type: "shipping",
443
+ min_delivery_date_time: null,
444
+ max_delivery_date_time: null,
445
+ },
446
+ assigned_location: {
447
+ address1: null,
448
+ address2: null,
449
+ city: null,
450
+ country_code: "CA",
451
+ location_id: 67794436118,
452
+ name: "test-created-via-api-2",
453
+ phone: null,
454
+ province: null,
455
+ zip: null,
456
+ },
457
+ },
458
+ },
459
+ ],
460
+ [
461
+ /fulfillments\/.+/,
462
+ {
463
+ service: "manual",
464
+ shipment_status: "confirmed",
465
+ origin_address: {
466
+ first_name: "Steve",
467
+ address1: "123 Shipping Street",
468
+ phone: "555-555-SHIP",
469
+ city: "Shippington",
470
+ zip: "40003",
471
+ province: "Kentucky",
472
+ country: "United States",
473
+ last_name: "Shipper",
474
+ address2: null,
475
+ company: "Shipping Company",
476
+ latitude: null,
477
+ longitude: null,
478
+ name: "Steve Shipper",
479
+ country_code: "US",
480
+ province_code: "KY",
481
+ },
482
+ },
483
+ ],
484
+ [
485
+ /inventory_items\/.+/,
486
+ {
487
+ cost: 10.11,
488
+ country_code_of_origin: "CA",
489
+ province_code_of_origin: "CA",
490
+ harmonized_system_code: "1234567890",
491
+ },
492
+ ],
493
+ [
494
+ /inventory_levels\/.+/,
495
+ {
496
+ available: 10,
497
+ },
498
+ ],
499
+ [
500
+ /order_transactions\/.+/,
501
+ {
502
+ message: "some message from the gateway",
503
+ user_id: 12345,
504
+ parent_id: 12345,
505
+ processed_at: "2021-12-30T19:00:00-05:00",
506
+ device_id: "some_device_id",
507
+ error_code: "SOME_ERROR_ENUM",
508
+ },
509
+ ],
510
+ [
511
+ /orders\/risk_assessment.+/,
512
+ {
513
+ provider_id: 12345,
514
+ provider_title: "whatever",
515
+ },
516
+ ],
517
+ [
518
+ /products\/.+/,
519
+ {
520
+ template_suffix: "something",
521
+ image: "gid://shopify/ProductImage/1234567890",
522
+ },
523
+ ],
524
+ [
525
+ /refunds\/.+/,
526
+ {
527
+ return: "unknown",
528
+ },
529
+ ],
530
+ [
531
+ /selling_plan_groups\/.+/,
532
+ {
533
+ app_id: 12345,
534
+ description: "some description",
535
+ position: 1,
536
+ },
537
+ ],
538
+ [
539
+ /subscription_billing_attempts\/.+/,
540
+ {
541
+ id: 12345,
542
+ error_message: "some error message",
543
+ error_code: "some error copde",
544
+ },
545
+ ],
546
+ [
547
+ /subscription_billing_cycle.+/,
548
+ {
549
+ contract_edit: "some contract edit",
550
+ },
551
+ ],
552
+ [
553
+ /tender_transactions\/.+/,
554
+ {
555
+ user_id: 12345,
556
+ processed_at: "2021-12-30T19:00:00-05:00",
557
+ payment_details: { something: "true" },
558
+ },
559
+ ],
560
+ ];
561
+ const shippingAddress = {
562
+ type: "object",
563
+ properties: {
564
+ first_name: {
565
+ type: "string",
566
+ },
567
+ address1: {
568
+ type: "string",
569
+ },
570
+ phone: {
571
+ type: "string",
572
+ },
573
+ city: {
574
+ type: "string",
575
+ },
576
+ zip: {
577
+ type: "string",
578
+ },
579
+ province: {
580
+ type: "string",
581
+ },
582
+ country: {
583
+ type: "string",
584
+ },
585
+ last_name: {
586
+ type: "string",
587
+ },
588
+ address2: {
589
+ type: ["string", "null"],
590
+ },
591
+ company: {
592
+ type: ["string", "null"],
593
+ },
594
+ latitude: {
595
+ type: ["number", "null"],
596
+ },
597
+ longitude: {
598
+ type: ["number", "null"],
599
+ },
600
+ name: {
601
+ type: "string",
602
+ },
603
+ country_code: {
604
+ type: "string",
605
+ },
606
+ province_code: {
607
+ type: "string",
608
+ },
609
+ },
610
+ };
611
+ exports.overrides = [
612
+ {
613
+ topics: ["checkouts/create", "checkouts/update"],
614
+ schema: {
615
+ shipping_address: shippingAddress,
616
+ },
617
+ },
618
+ {
619
+ topics: ["order_transactions/create", "order_transactions/update"],
620
+ schema: {
621
+ receipt: {
622
+ type: "object",
623
+ additionalProperties: true,
624
+ },
625
+ },
626
+ },
627
+ ];
@@ -3,20 +3,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const json_schema_walker_1 = require("@cloudflare/json-schema-walker");
7
- const schema_infer_1 = require("@jsonhero/schema-infer");
8
- const chalk_1 = __importDefault(require("chalk"));
9
6
  const cheerio_1 = __importDefault(require("cheerio"));
10
7
  const fs_extra_1 = __importDefault(require("fs-extra"));
11
8
  const globby_1 = require("globby");
12
9
  const got_1 = __importDefault(require("got"));
13
10
  const lodash_1 = require("lodash");
11
+ const chalk_1 = __importDefault(require("chalk"));
14
12
  const path_1 = __importDefault(require("path"));
15
- const safe_stable_stringify_1 = require("safe-stable-stringify");
16
13
  const src_1 = require("src");
17
14
  const shopify_js_1 = require("./shopify.js");
18
- const stringify = (0, safe_stable_stringify_1.configure)({ deterministic: true });
19
- const startVersion = "2024-04";
15
+ const infer_schema_1 = require("./infer-schema");
20
16
  function assert(value, message) {
21
17
  if (!value) {
22
18
  throw new Error(message ?? "value is not truthy");
@@ -67,55 +63,6 @@ const loadRailsData = async (url) => {
67
63
  const docsWebhooksPageForVersion = (version) => `https://shopify.dev/docs/api/admin-rest/${version}/resources/webhook#event-topics`;
68
64
  let warnings = 0;
69
65
  let errors = 0;
70
- const sortStringArrays = (obj) => {
71
- return (0, lodash_1.cloneDeepWith)(obj, (value) => {
72
- if (Array.isArray(value) && value.every((item) => typeof item === "string")) {
73
- return value.sort();
74
- }
75
- });
76
- };
77
- const getDeterministicObject = (obj) => {
78
- const stableString = stringify(sortStringArrays(obj));
79
- return JSON.parse(stableString);
80
- };
81
- const inferSchemaFromExamplePayload = (examplePayload, metadata, version) => {
82
- const inference = (0, schema_infer_1.inferSchema)(examplePayload);
83
- // build a copy of the payload and apply overrides based on the webhook name
84
- for (const [matcher, override] of manualExamples) {
85
- if (matcher.test(metadata.name)) {
86
- const overridesPayload = (0, lodash_1.cloneDeep)(examplePayload);
87
- const maskedOverride = (0, lodash_1.pick)(override, Object.keys(examplePayload));
88
- (0, lodash_1.merge)(overridesPayload, maskedOverride);
89
- inference.infer(overridesPayload);
90
- }
91
- }
92
- const schema = {
93
- $schema: "https://json-schema.org/draft/2020-12/schema",
94
- ...inference.toJSONSchema(),
95
- };
96
- for (const override of overrides) {
97
- if (override.topics.includes(metadata.name) && (!override.versions || override.versions.includes(startVersion))) {
98
- for (const [key, schemaOverride] of Object.entries(override.schema)) {
99
- schema.properties[key] = schemaOverride;
100
- }
101
- }
102
- }
103
- const sortedSchema = getDeterministicObject(schema);
104
- (0, json_schema_walker_1.schemaWalk)(sortedSchema, (subschema, path, _parent, parentPath) => {
105
- if ((0, lodash_1.isEqual)(subschema, { type: "null" })) {
106
- warnings += 1;
107
- const fullPath = [...parentPath, ...path].join(".");
108
- if (unknownPaths.some(([pattern, paths]) => pattern.test(metadata.name) && paths.includes(fullPath))) {
109
- // we know this path is always null, so don't error
110
- }
111
- else {
112
- errors += 1;
113
- console.error(`${chalk_1.default.red("schema error")}: null type found in final schema for version ${chalk_1.default.blue(version)} for ${chalk_1.default.blue(metadata.name)} at path ${chalk_1.default.green(fullPath)}`);
114
- }
115
- }
116
- }, () => { }, (0, json_schema_walker_1.getVocabulary)(sortedSchema));
117
- return sortedSchema;
118
- };
119
66
  const loadExemplars = async () => {
120
67
  const files = await (0, globby_1.globby)(path_1.default.join(__dirname, "../exemplars/**/*.json"));
121
68
  for (const file of files) {
@@ -124,13 +71,13 @@ const loadExemplars = async () => {
124
71
  const topicPattern = new RegExp(`${segments.pop()}.+`);
125
72
  const _version = segments.pop();
126
73
  const exemplar = await fs_extra_1.default.readJSON(file);
127
- manualExamples.push([topicPattern, exemplar]);
74
+ infer_schema_1.manualExamples.push([topicPattern, exemplar]);
128
75
  }
129
76
  console.log(`loaded ${files.length} exemplars`);
130
77
  };
131
78
  const getAllVersions = async () => {
132
- const rootPage = await loadRailsData(docsWebhooksPageForVersion(startVersion));
133
- return (0, lodash_1.uniq)([startVersion, ...rootPage.api.selectable_versions]).filter((version) => version != "unstable");
79
+ const rootPage = await loadRailsData(docsWebhooksPageForVersion(infer_schema_1.startVersion));
80
+ return (0, lodash_1.uniq)([infer_schema_1.startVersion, ...rootPage.api.selectable_versions]).filter((version) => version != "unstable");
134
81
  };
135
82
  const main = async () => {
136
83
  await loadExemplars();
@@ -152,7 +99,12 @@ const main = async () => {
152
99
  const metadataFile = path_1.default.join(rootDir, "metadatas", version, webhook.name + ".json");
153
100
  await fs_extra_1.default.mkdir(path_1.default.dirname(metadataFile), { recursive: true });
154
101
  await fs_extra_1.default.writeFile(metadataFile, JSON.stringify(webhook, null, 2), "utf-8");
155
- const schema = inferSchemaFromExamplePayload(webhook.response, webhook, version);
102
+ const { schema, warnings: warningCount, errors: errorMessages } = (0, infer_schema_1.inferSchemaFromExamplePayload)(webhook.response, webhook);
103
+ warnings += warningCount;
104
+ for (const error of errorMessages) {
105
+ console.error(`${chalk_1.default.red("schema error")}: ${error.message} for version ${chalk_1.default.blue(version)} for ${chalk_1.default.blue(webhook.name)} at path ${chalk_1.default.green(error.path)}`);
106
+ errors += 1;
107
+ }
156
108
  const schemaFile = path_1.default.join(rootDir, "schemas", version, webhook.name + ".json");
157
109
  await fs_extra_1.default.mkdir(path_1.default.dirname(schemaFile), { recursive: true });
158
110
  await fs_extra_1.default.writeFile(schemaFile, JSON.stringify(schema, null, 2), "utf-8");
@@ -167,567 +119,3 @@ const main = async () => {
167
119
  }
168
120
  };
169
121
  void main();
170
- // paths that we can't find any source data for at all, so we don't know what type they should be
171
- const unknownPaths = [
172
- [
173
- /checkouts\/.+/,
174
- [
175
- "properties.line_items.items.properties.unit_price_measurement.properties.measured_type",
176
- "properties.line_items.items.properties.unit_price_measurement.properties.quantity_value",
177
- "properties.line_items.items.properties.unit_price_measurement.properties.quantity_unit",
178
- "properties.line_items.items.properties.unit_price_measurement.properties.reference_value",
179
- "properties.line_items.items.properties.unit_price_measurement.properties.reference_unit",
180
- "properties.line_items.items.properties.tax_lines.items.properties.reporting_jurisdiction_name",
181
- "properties.line_items.items.properties.tax_lines.items.properties.reporting_jurisdiction_type",
182
- "properties.line_items.items.properties.tax_lines.items.properties.reporting_jurisdiction_code",
183
- "properties.line_items.items.properties.user_id",
184
- "properties.line_items.items.properties.compare_at_price",
185
- "properties.gateway",
186
- "properties.shipping_lines.items.properties.delivery_category",
187
- "properties.shipping_lines.items.properties.validation_context",
188
- "properties.shipping_lines.items.properties.requested_fulfillment_service_id",
189
- "properties.shipping_lines.items.properties.tax_lines.items.properties.identifier",
190
- "properties.shipping_lines.items.properties.tax_lines.items.properties.reporting_jurisdiction_name",
191
- "properties.shipping_lines.items.properties.tax_lines.items.properties.tax_api_client_id",
192
- "properties.shipping_lines.items.properties.tax_lines.items.properties.reporting_exempt_amount",
193
- "properties.shipping_lines.items.properties.tax_lines.items.properties.jurisdiction_source",
194
- "properties.shipping_lines.items.properties.tax_lines.items.properties.reporting_jurisdiction_code",
195
- "properties.shipping_lines.items.properties.tax_lines.items.properties.reporting_jurisdiction_type",
196
- "properties.shipping_lines.items.properties.tax_lines.items.properties.reporting_taxable_amount",
197
- "properties.shipping_lines.items.properties.tax_lines.items.properties.jurisdiction_type",
198
- "properties.shipping_lines.items.properties.tax_lines.items.properties.tax_type",
199
- "properties.shipping_lines.items.properties.tax_lines.items.properties.jurisdiction_id",
200
- "properties.shipping_lines.items.properties.tax_lines.items.properties.reporting_non_taxable_amount",
201
- "properties.shipping_lines.items.properties.custom_tax_lines",
202
- "properties.shipping_lines.items.properties.estimated_delivery_time_range",
203
- "properties.line_items.items.properties.tax_lines.items.properties.tax_type",
204
- "properties.line_items.items.properties.tax_lines.items.properties.identifier",
205
- "properties.line_items.items.properties.discount_allocations.items.properties.id",
206
- "properties.line_items.items.properties.discount_allocations.items.properties.created_at",
207
- ],
208
- ],
209
- [
210
- /collection_listings\/.+/,
211
- ["properties.collection_listing.properties.default_product_image", "properties.collection_listing.properties.image"],
212
- ],
213
- [/domains\/.+/, ["properties.localization.properties.country"]],
214
- [/orders\/.+/, ["properties.client_details.properties.session_hash"]],
215
- ];
216
- // example data we feed the schema infer-er for each topic to allow it to discover real types
217
- const manualExamples = [
218
- [
219
- /.+/,
220
- {
221
- admin_graphql_api_id: "gid://shopify/Something/1234567890",
222
- admin_graphql_api_job_id: "gid://shopify/Job/1234567890",
223
- created_at: "2021-12-30T19:00:00-05:00",
224
- updated_at: "2021-12-30T19:00:00-05:00",
225
- address2: "Apt 123",
226
- latitude: 10.1,
227
- longitude: 10.1,
228
- location_id: 111111,
229
- },
230
- ],
231
- [
232
- /(app|shop)\/.+/,
233
- {
234
- domain: "example.com",
235
- source: "example source",
236
- myshopify_domain: "example.myshopify.com",
237
- google_apps_domain: "example.com",
238
- google_apps_login_enabled: true,
239
- password_enabled: true,
240
- taxes_included: true,
241
- tax_shipping: true,
242
- iana_timezone: "America/New_York",
243
- auto_configure_tax_inclusivity: true,
244
- county_taxes: true,
245
- },
246
- ],
247
- [
248
- /bulk_operations\/.+/,
249
- {
250
- error_code: "SOME_ERROR_ENUM",
251
- },
252
- ],
253
- [
254
- /carts\/.+/,
255
- {
256
- note: "some cart note string",
257
- },
258
- ],
259
- [
260
- /(checkouts|orders)\/.+/,
261
- {
262
- gateway: "shopify_payments",
263
- landing_site: "https://example.com",
264
- note: "some order note",
265
- referring_site: "https://example.com",
266
- completed_at: "2021-12-30T19:00:00-05:00",
267
- closed_at: "2021-12-30T19:00:00-05:00",
268
- user_id: 11111111,
269
- location_id: 22222222,
270
- source_identifier: "some_source_identifier",
271
- source_url: "https://example.com",
272
- device_id: "some_device_id",
273
- phone: "+1 (123) 456 7890",
274
- sms_marketing_phone: "+1 (123) 456 7890",
275
- customer_locale: "en",
276
- source: "some_source",
277
- total_duties: 10.11,
278
- app_id: 12345,
279
- browser_ip: "10.0.0.1",
280
- cart_token: "some_cart_token",
281
- checkout_id: 12345,
282
- client_details: {
283
- accept_language: "en-US,en;q=0.9",
284
- browser_height: 800,
285
- },
286
- confirmation_number: "some_confirmation_number",
287
- current_total_additional_fees_set: {
288
- shop_money: {
289
- amount: "0.00",
290
- currency_code: "USD",
291
- },
292
- presentment_money: {
293
- amount: "0.00",
294
- currency_code: "USD",
295
- },
296
- },
297
- current_total_duties_set: {
298
- shop_money: {
299
- amount: "0.00",
300
- currency_code: "USD",
301
- },
302
- presentment_money: {
303
- amount: "0.00",
304
- currency_code: "USD",
305
- },
306
- },
307
- original_total_additional_fees_set: {
308
- shop_money: {
309
- amount: "0.00",
310
- currency_code: "USD",
311
- },
312
- presentment_money: {
313
- amount: "0.00",
314
- currency_code: "USD",
315
- },
316
- },
317
- original_total_duties_set: {
318
- shop_money: {
319
- amount: "0.00",
320
- currency_code: "USD",
321
- },
322
- presentment_money: {
323
- amount: "0.00",
324
- currency_code: "USD",
325
- },
326
- },
327
- checkout_token: "some_checkout_token",
328
- landing_site_ref: "https://example.com",
329
- merchant_of_record_app_id: 12345,
330
- po_number: "some_po_number",
331
- processed_at: "2021-12-30T19:00:00-05:00",
332
- reference: "some_reference",
333
- payment_terms: "some_payment_terms",
334
- reservation_token: "some_reservation_token",
335
- billing_address: {
336
- address2: "suite 101",
337
- latitude: 34.1,
338
- longitude: 34.1,
339
- },
340
- shipping_address: {
341
- address2: "suite 101",
342
- latitude: 34.1,
343
- longitude: 34.1,
344
- },
345
- customer: {
346
- created_at: "2024-05-05T02:42:32+08:00",
347
- marketing_opt_in_level: "single_opt_in",
348
- note: "some string",
349
- multipass_identifier: "hello",
350
- },
351
- },
352
- ],
353
- [
354
- /checkouts\/.+/,
355
- {
356
- line_items: [
357
- {
358
- presentment_variant_title: "51 x 76 / Blanc / 1",
359
- taxable: true,
360
- variant_price: "69.00",
361
- presentment_title: "Taie d'oreiller Pure Soie de Mûrier",
362
- requires_shipping: true,
363
- unit_price_measurement: {
364
- measured_type: null,
365
- quantity_unit: null,
366
- quantity_value: null,
367
- reference_unit: null,
368
- reference_value: null,
369
- },
370
- variant_title: "51 x 76 / Blanc / 1",
371
- title: "Taie d'oreiller Pure Soie de Mûrier",
372
- gift_card: false,
373
- destination_location_id: 4042942054746,
374
- compare_at_price: null,
375
- key: "e0105d4efb1970501cf831566fa79752",
376
- line_price: "69.00",
377
- vendor: "Emily's pillow",
378
- quantity: 1,
379
- applied_discounts: [],
380
- grams: 110,
381
- properties: [
382
- {
383
- name: "_isJust",
384
- value: "true",
385
- },
386
- ],
387
- tax_lines: [
388
- {
389
- reporting_jurisdiction_type: null,
390
- reporting_non_taxable_amount: "0.00",
391
- zone: null,
392
- compare_at: 0.2,
393
- reporting_taxable_amount: "57.50",
394
- tax_api_client_id: null,
395
- jurisdiction_source: "ActiveTax",
396
- title: "FR TVA",
397
- identifier: null,
398
- jurisdiction_type: "COUNTRY",
399
- reporting_jurisdiction_code: null,
400
- source: "MerchantActiveTax",
401
- reporting_exempt_amount: "0.00",
402
- reporting_jurisdiction_name: null,
403
- jurisdiction_id: "FR",
404
- tax_type: null,
405
- channel_liable: false,
406
- price: "11.50",
407
- rate: 0.2,
408
- position: 1,
409
- tax_calculation_price: "11.50",
410
- },
411
- ],
412
- sku: "EMIL-TO5176-22WH",
413
- rank: 0,
414
- user_id: null,
415
- product_id: 4610455470216,
416
- discount_allocations: [],
417
- origin_location_id: 1743669821576,
418
- fulfillment_service: "manual",
419
- variant_id: 32516187029640,
420
- price: "69.00",
421
- },
422
- ],
423
- },
424
- ],
425
- [
426
- /collections\/.+/,
427
- {
428
- sort_order: "manual",
429
- template_suffix: "some_template_suffix",
430
- },
431
- ],
432
- [
433
- /collection_listings\/.+/,
434
- {
435
- collection_listing: {
436
- updated_at: "2021-12-30T19:00:00-05:00",
437
- sort_order: 1,
438
- },
439
- },
440
- ],
441
- [
442
- /company_locations\/.+/,
443
- {
444
- buyer_experience_configuration: { pay_now_only: true },
445
- billing_address: {
446
- address2: "suite 101",
447
- },
448
- shipping_address: {
449
- address2: "suite 101",
450
- },
451
- },
452
- ],
453
- [
454
- /customers\/.+/,
455
- {
456
- last_order_id: 12345,
457
- multipass_identifier: "some_multipass_identifier",
458
- last_order_name: "Foobar",
459
- phone: "+1 (123) 456 7890",
460
- sms_marketing_consent: false,
461
- email_marketing_consent: false,
462
- accepts_marketing_updated_at: "2021-12-30T19:00:00-05:00",
463
- marketing_opt_in_level: "single_opt_in",
464
- },
465
- ],
466
- [
467
- /customer_account_settings\/.+/,
468
- {
469
- url: "https://example.com",
470
- },
471
- ],
472
- [
473
- /customer.+consent\/.+/,
474
- {
475
- phone: "+1 (123) 456 7890",
476
- email_address: "test@test.com",
477
- },
478
- ],
479
- [
480
- /disputes\/.+/,
481
- {
482
- evidence_sent_on: "2021-12-30T19:00:00-05:00",
483
- finalized_on: "2021-12-30T19:00:00-05:00",
484
- },
485
- ],
486
- [
487
- /draft_orders\/.+/,
488
- {
489
- invoice_sent_at: "2021-12-30T19:00:00-05:00",
490
- order_id: 12345,
491
- },
492
- ],
493
- [
494
- /fulfillment_events\/.+/,
495
- {
496
- city: "Ottawa",
497
- province: "ON",
498
- zip: "K1P1J1",
499
- address1: "150 Elgin St",
500
- estimated_delivery_at: "2021-12-30T19:00:00-05:00",
501
- },
502
- ],
503
- [
504
- /fulfillment_orders\/.+/,
505
- {
506
- remaining_fulfillment_order: {
507
- id: 5859333242902,
508
- shop_id: 20978040854,
509
- order_id: 4804938989590,
510
- assigned_location_id: 67794436118,
511
- request_status: "unsubmitted",
512
- status: "open",
513
- supported_actions: ["request_fulfillment", "hold", "move"],
514
- destination: {
515
- id: 5479404371990,
516
- address1: "23 Hassall Street",
517
- address2: "",
518
- city: "Parramatta",
519
- company: null,
520
- country: "Australia",
521
- email: "",
522
- first_name: "Tyler",
523
- last_name: "Kelleher",
524
- phone: null,
525
- province: "New South Wales",
526
- zip: "2150",
527
- },
528
- line_items: [
529
- {
530
- id: 12675478814742,
531
- shop_id: 20978040854,
532
- fulfillment_order_id: 5859333242902,
533
- quantity: 1,
534
- line_item_id: 12553770336278,
535
- inventory_item_id: 44276125368342,
536
- fulfillable_quantity: 1,
537
- variant_id: 42182036422678,
538
- },
539
- ],
540
- fulfill_at: "2022-10-13T13:00:00-04:00",
541
- fulfill_by: null,
542
- international_duties: {
543
- incoterm: "DAP",
544
- },
545
- fulfillment_holds: [],
546
- delivery_method: {
547
- id: 140816351254,
548
- method_type: "shipping",
549
- min_delivery_date_time: null,
550
- max_delivery_date_time: null,
551
- },
552
- assigned_location: {
553
- address1: null,
554
- address2: null,
555
- city: null,
556
- country_code: "CA",
557
- location_id: 67794436118,
558
- name: "test-created-via-api-2",
559
- phone: null,
560
- province: null,
561
- zip: null,
562
- },
563
- },
564
- },
565
- ],
566
- [
567
- /fulfillments\/.+/,
568
- {
569
- service: "manual",
570
- shipment_status: "confirmed",
571
- origin_address: {
572
- first_name: "Steve",
573
- address1: "123 Shipping Street",
574
- phone: "555-555-SHIP",
575
- city: "Shippington",
576
- zip: "40003",
577
- province: "Kentucky",
578
- country: "United States",
579
- last_name: "Shipper",
580
- address2: null,
581
- company: "Shipping Company",
582
- latitude: null,
583
- longitude: null,
584
- name: "Steve Shipper",
585
- country_code: "US",
586
- province_code: "KY",
587
- },
588
- },
589
- ],
590
- [
591
- /inventory_items\/.+/,
592
- {
593
- cost: 10.11,
594
- country_code_of_origin: "CA",
595
- province_code_of_origin: "CA",
596
- harmonized_system_code: "1234567890",
597
- },
598
- ],
599
- [
600
- /inventory_levels\/.+/,
601
- {
602
- available: 10,
603
- },
604
- ],
605
- [
606
- /order_transactions\/.+/,
607
- {
608
- message: "some message from the gateway",
609
- user_id: 12345,
610
- parent_id: 12345,
611
- processed_at: "2021-12-30T19:00:00-05:00",
612
- device_id: "some_device_id",
613
- error_code: "SOME_ERROR_ENUM",
614
- },
615
- ],
616
- [
617
- /orders\/risk_assessment.+/,
618
- {
619
- provider_id: 12345,
620
- provider_title: "whatever",
621
- },
622
- ],
623
- [
624
- /products\/.+/,
625
- {
626
- template_suffix: "something",
627
- image: "gid://shopify/ProductImage/1234567890",
628
- },
629
- ],
630
- [
631
- /refunds\/.+/,
632
- {
633
- return: "unknown",
634
- },
635
- ],
636
- [
637
- /selling_plan_groups\/.+/,
638
- {
639
- app_id: 12345,
640
- description: "some description",
641
- position: 1,
642
- },
643
- ],
644
- [
645
- /subscription_billing_attempts\/.+/,
646
- {
647
- id: 12345,
648
- error_message: "some error message",
649
- error_code: "some error copde",
650
- },
651
- ],
652
- [
653
- /subscription_billing_cycle.+/,
654
- {
655
- contract_edit: "some contract edit",
656
- },
657
- ],
658
- [
659
- /tender_transactions\/.+/,
660
- {
661
- user_id: 12345,
662
- processed_at: "2021-12-30T19:00:00-05:00",
663
- payment_details: { something: "true" },
664
- },
665
- ],
666
- ];
667
- const shippingAddress = {
668
- type: "object",
669
- properties: {
670
- first_name: {
671
- type: "string",
672
- },
673
- address1: {
674
- type: "string",
675
- },
676
- phone: {
677
- type: "string",
678
- },
679
- city: {
680
- type: "string",
681
- },
682
- zip: {
683
- type: "string",
684
- },
685
- province: {
686
- type: "string",
687
- },
688
- country: {
689
- type: "string",
690
- },
691
- last_name: {
692
- type: "string",
693
- },
694
- address2: {
695
- type: ["string", "null"],
696
- },
697
- company: {
698
- type: ["string", "null"],
699
- },
700
- latitude: {
701
- type: ["number", "null"],
702
- },
703
- longitude: {
704
- type: ["number", "null"],
705
- },
706
- name: {
707
- type: "string",
708
- },
709
- country_code: {
710
- type: "string",
711
- },
712
- province_code: {
713
- type: "string",
714
- },
715
- },
716
- };
717
- const overrides = [
718
- {
719
- topics: ["checkouts/create", "checkouts/update"],
720
- schema: {
721
- shipping_address: shippingAddress,
722
- },
723
- },
724
- {
725
- topics: ["order_transactions/create", "order_transactions/update"],
726
- schema: {
727
- receipt: {
728
- type: "object",
729
- additionalProperties: true,
730
- },
731
- },
732
- },
733
- ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shopify-webhook-schemas",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "",
5
5
  "main": "dist/src/index.js",
6
6
  "type": "commonjs",
@@ -30,11 +30,9 @@
30
30
  "license": "MIT",
31
31
  "devDependencies": {
32
32
  "@arethetypeswrong/cli": "^0.15.3",
33
- "@cloudflare/json-schema-walker": "^0.1.1",
34
33
  "@gadgetinc/eslint-config": "^0.6.1",
35
34
  "@gadgetinc/prettier-config": "^0.4.0",
36
35
  "@jsonhero/json-infer-types": "^1.2.11",
37
- "@jsonhero/schema-infer": "^0.1.5",
38
36
  "@opentelemetry/api": "^1.8.0",
39
37
  "@types/fs-extra": "^11.0.4",
40
38
  "@types/lodash": "^4.17.0",
@@ -48,16 +46,18 @@
48
46
  "globby": "^14.0.1",
49
47
  "got": "^11.8.6",
50
48
  "inflected": "^2.1.0",
51
- "lodash": "^4.17.21",
52
49
  "prettier": "^2.8.8",
53
50
  "publint": "^0.2.7",
54
- "safe-stable-stringify": "^2.5.0",
55
51
  "traverse": "^0.6.9",
56
52
  "tsx": "^4.7.3",
57
53
  "typescript": "^5.4.5"
58
54
  },
59
55
  "dependencies": {
60
- "fast-glob": "^3.3.2"
56
+ "fast-glob": "^3.3.2",
57
+ "@cloudflare/json-schema-walker": "^0.1.1",
58
+ "@jsonhero/schema-infer": "^0.1.5",
59
+ "lodash": "^4.17.21",
60
+ "safe-stable-stringify": "^2.5.0"
61
61
  },
62
62
  "packageManager": "pnpm@9.11.0+sha512.0a203ffaed5a3f63242cd064c8fb5892366c103e328079318f78062f24ea8c9d50bc6a47aa3567cabefd824d170e78fa2745ed1f16b132e16436146b7688f19b"
63
63
  }