shopify-webhook-schemas 0.2.4 → 0.2.5

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 (276) hide show
  1. package/dist/src/infer-schema.d.ts +2 -1
  2. package/dist/src/infer-schema.js +35 -3
  3. package/dist/src/scrape.js +1 -1
  4. package/metadatas/2024-10/app/scopes_update.json +1 -0
  5. package/metadatas/2024-10/app_purchases_one_time/update.json +1 -1
  6. package/metadatas/2024-10/app_subscriptions/approaching_capped_amount.json +1 -1
  7. package/metadatas/2024-10/app_subscriptions/update.json +1 -1
  8. package/metadatas/2024-10/bulk_operations/finish.json +1 -1
  9. package/metadatas/2024-10/checkouts/create.json +10 -10
  10. package/metadatas/2024-10/checkouts/update.json +10 -10
  11. package/metadatas/2024-10/customer.tags_added.json +1 -1
  12. package/metadatas/2024-10/customer.tags_removed.json +1 -1
  13. package/metadatas/2024-10/customers/create.json +7 -3
  14. package/metadatas/2024-10/customers/delete.json +5 -1
  15. package/metadatas/2024-10/customers/disable.json +7 -3
  16. package/metadatas/2024-10/customers/enable.json +7 -3
  17. package/metadatas/2024-10/customers/update.json +7 -3
  18. package/metadatas/2024-10/customers_email_marketing_consent/update.json +1 -1
  19. package/metadatas/2024-10/discounts/create.json +2 -2
  20. package/metadatas/2024-10/discounts/delete.json +1 -1
  21. package/metadatas/2024-10/discounts/redeemcode_added.json +1 -1
  22. package/metadatas/2024-10/discounts/redeemcode_removed.json +1 -1
  23. package/metadatas/2024-10/discounts/update.json +2 -2
  24. package/metadatas/2024-10/draft_orders/create.json +31 -31
  25. package/metadatas/2024-10/draft_orders/update.json +30 -30
  26. package/metadatas/2024-10/orders/cancelled.json +3 -3
  27. package/metadatas/2024-10/orders/create.json +3 -3
  28. package/metadatas/2024-10/orders/fulfilled.json +3 -3
  29. package/metadatas/2024-10/orders/paid.json +3 -3
  30. package/metadatas/2024-10/orders/partially_fulfilled.json +3 -3
  31. package/metadatas/2024-10/orders/updated.json +3 -3
  32. package/metadatas/2024-10/segments/update.json +1 -1
  33. package/metadatas/2024-10/selling_plan_groups/create.json +2 -2
  34. package/metadatas/2024-10/selling_plan_groups/delete.json +2 -2
  35. package/metadatas/2024-10/selling_plan_groups/update.json +2 -2
  36. package/metadatas/2024-10/subscription_billing_attempts/challenged.json +2 -2
  37. package/metadatas/2024-10/subscription_billing_attempts/failure.json +2 -2
  38. package/metadatas/2024-10/subscription_billing_attempts/success.json +2 -2
  39. package/metadatas/2024-10/subscription_billing_cycle_edits/create.json +1 -1
  40. package/metadatas/2024-10/subscription_billing_cycle_edits/delete.json +1 -1
  41. package/metadatas/2024-10/subscription_billing_cycle_edits/update.json +1 -1
  42. package/metadatas/2024-10/subscription_billing_cycles/skip.json +1 -1
  43. package/metadatas/2024-10/subscription_billing_cycles/unskip.json +1 -1
  44. package/metadatas/2024-10/subscription_contracts/activate.json +3 -3
  45. package/metadatas/2024-10/subscription_contracts/cancel.json +3 -3
  46. package/metadatas/2024-10/subscription_contracts/create.json +3 -3
  47. package/metadatas/2024-10/subscription_contracts/expire.json +3 -3
  48. package/metadatas/2024-10/subscription_contracts/fail.json +3 -3
  49. package/metadatas/2024-10/subscription_contracts/pause.json +3 -3
  50. package/metadatas/2024-10/subscription_contracts/update.json +3 -3
  51. package/metadatas/2025-01/app/scopes_update.json +1 -0
  52. package/metadatas/2025-01/app_purchases_one_time/update.json +1 -1
  53. package/metadatas/2025-01/app_subscriptions/approaching_capped_amount.json +1 -1
  54. package/metadatas/2025-01/app_subscriptions/update.json +1 -1
  55. package/metadatas/2025-01/bulk_operations/finish.json +1 -1
  56. package/metadatas/2025-01/checkouts/create.json +10 -10
  57. package/metadatas/2025-01/checkouts/update.json +10 -10
  58. package/metadatas/2025-01/customer.tags_added.json +1 -1
  59. package/metadatas/2025-01/customer.tags_removed.json +1 -1
  60. package/metadatas/2025-01/customers/create.json +2 -2
  61. package/metadatas/2025-01/customers/disable.json +2 -2
  62. package/metadatas/2025-01/customers/enable.json +2 -2
  63. package/metadatas/2025-01/customers/purchasing_summary.json +1 -1
  64. package/metadatas/2025-01/customers/update.json +2 -2
  65. package/metadatas/2025-01/customers_email_marketing_consent/update.json +1 -1
  66. package/metadatas/2025-01/discounts/create.json +2 -2
  67. package/metadatas/2025-01/discounts/delete.json +1 -1
  68. package/metadatas/2025-01/discounts/redeemcode_added.json +1 -1
  69. package/metadatas/2025-01/discounts/redeemcode_removed.json +1 -1
  70. package/metadatas/2025-01/discounts/update.json +2 -2
  71. package/metadatas/2025-01/draft_orders/create.json +29 -29
  72. package/metadatas/2025-01/draft_orders/update.json +30 -30
  73. package/metadatas/2025-01/orders/cancelled.json +3 -3
  74. package/metadatas/2025-01/orders/create.json +3 -3
  75. package/metadatas/2025-01/orders/fulfilled.json +3 -3
  76. package/metadatas/2025-01/orders/paid.json +3 -3
  77. package/metadatas/2025-01/orders/partially_fulfilled.json +3 -3
  78. package/metadatas/2025-01/orders/updated.json +3 -3
  79. package/metadatas/2025-01/segments/update.json +1 -1
  80. package/metadatas/2025-01/selling_plan_groups/create.json +2 -2
  81. package/metadatas/2025-01/selling_plan_groups/delete.json +2 -2
  82. package/metadatas/2025-01/selling_plan_groups/update.json +2 -2
  83. package/metadatas/2025-01/subscription_billing_attempts/challenged.json +2 -2
  84. package/metadatas/2025-01/subscription_billing_attempts/failure.json +2 -2
  85. package/metadatas/2025-01/subscription_billing_attempts/success.json +2 -2
  86. package/metadatas/2025-01/subscription_billing_cycle_edits/create.json +1 -1
  87. package/metadatas/2025-01/subscription_billing_cycle_edits/delete.json +1 -1
  88. package/metadatas/2025-01/subscription_billing_cycle_edits/update.json +1 -1
  89. package/metadatas/2025-01/subscription_billing_cycles/skip.json +1 -1
  90. package/metadatas/2025-01/subscription_billing_cycles/unskip.json +1 -1
  91. package/metadatas/2025-01/subscription_contracts/activate.json +3 -3
  92. package/metadatas/2025-01/subscription_contracts/cancel.json +3 -3
  93. package/metadatas/2025-01/subscription_contracts/create.json +3 -3
  94. package/metadatas/2025-01/subscription_contracts/expire.json +3 -3
  95. package/metadatas/2025-01/subscription_contracts/fail.json +3 -3
  96. package/metadatas/2025-01/subscription_contracts/pause.json +3 -3
  97. package/metadatas/2025-01/subscription_contracts/update.json +3 -3
  98. package/metadatas/2025-04/app/scopes_update.json +1 -0
  99. package/metadatas/2025-04/app_purchases_one_time/update.json +1 -1
  100. package/metadatas/2025-04/app_subscriptions/approaching_capped_amount.json +1 -1
  101. package/metadatas/2025-04/app_subscriptions/update.json +1 -1
  102. package/metadatas/2025-04/bulk_operations/finish.json +1 -1
  103. package/metadatas/2025-04/checkouts/create.json +10 -10
  104. package/metadatas/2025-04/checkouts/update.json +10 -10
  105. package/metadatas/2025-04/customer.tags_added.json +1 -1
  106. package/metadatas/2025-04/customer.tags_removed.json +1 -1
  107. package/metadatas/2025-04/customers/create.json +2 -2
  108. package/metadatas/2025-04/customers/disable.json +2 -2
  109. package/metadatas/2025-04/customers/enable.json +2 -2
  110. package/metadatas/2025-04/customers/purchasing_summary.json +1 -1
  111. package/metadatas/2025-04/customers/update.json +2 -2
  112. package/metadatas/2025-04/customers_email_marketing_consent/update.json +1 -1
  113. package/metadatas/2025-04/discounts/create.json +2 -2
  114. package/metadatas/2025-04/discounts/delete.json +1 -1
  115. package/metadatas/2025-04/discounts/redeemcode_added.json +1 -1
  116. package/metadatas/2025-04/discounts/redeemcode_removed.json +1 -1
  117. package/metadatas/2025-04/discounts/update.json +2 -2
  118. package/metadatas/2025-04/draft_orders/create.json +29 -29
  119. package/metadatas/2025-04/draft_orders/update.json +31 -31
  120. package/metadatas/2025-04/orders/cancelled.json +3 -3
  121. package/metadatas/2025-04/orders/create.json +3 -3
  122. package/metadatas/2025-04/orders/fulfilled.json +3 -3
  123. package/metadatas/2025-04/orders/paid.json +3 -3
  124. package/metadatas/2025-04/orders/partially_fulfilled.json +3 -3
  125. package/metadatas/2025-04/orders/updated.json +3 -3
  126. package/metadatas/2025-04/segments/update.json +1 -1
  127. package/metadatas/2025-04/selling_plan_groups/create.json +2 -2
  128. package/metadatas/2025-04/selling_plan_groups/delete.json +2 -2
  129. package/metadatas/2025-04/selling_plan_groups/update.json +2 -2
  130. package/metadatas/2025-04/subscription_billing_attempts/challenged.json +2 -2
  131. package/metadatas/2025-04/subscription_billing_attempts/failure.json +2 -2
  132. package/metadatas/2025-04/subscription_billing_attempts/success.json +2 -2
  133. package/metadatas/2025-04/subscription_billing_cycle_edits/create.json +1 -1
  134. package/metadatas/2025-04/subscription_billing_cycle_edits/delete.json +1 -1
  135. package/metadatas/2025-04/subscription_billing_cycle_edits/update.json +1 -1
  136. package/metadatas/2025-04/subscription_billing_cycles/skip.json +1 -1
  137. package/metadatas/2025-04/subscription_billing_cycles/unskip.json +1 -1
  138. package/metadatas/2025-04/subscription_contracts/activate.json +3 -3
  139. package/metadatas/2025-04/subscription_contracts/cancel.json +3 -3
  140. package/metadatas/2025-04/subscription_contracts/create.json +3 -3
  141. package/metadatas/2025-04/subscription_contracts/expire.json +3 -3
  142. package/metadatas/2025-04/subscription_contracts/fail.json +3 -3
  143. package/metadatas/2025-04/subscription_contracts/pause.json +3 -3
  144. package/metadatas/2025-04/subscription_contracts/update.json +3 -3
  145. package/metadatas/2025-07/app/scopes_update.json +1 -0
  146. package/metadatas/2025-07/app_purchases_one_time/update.json +1 -1
  147. package/metadatas/2025-07/app_subscriptions/approaching_capped_amount.json +1 -1
  148. package/metadatas/2025-07/app_subscriptions/update.json +1 -1
  149. package/metadatas/2025-07/bulk_operations/finish.json +1 -1
  150. package/metadatas/2025-07/checkouts/create.json +10 -10
  151. package/metadatas/2025-07/checkouts/update.json +4 -4
  152. package/metadatas/2025-07/customer.tags_added.json +1 -1
  153. package/metadatas/2025-07/customer.tags_removed.json +1 -1
  154. package/metadatas/2025-07/customers/create.json +2 -2
  155. package/metadatas/2025-07/customers/disable.json +2 -2
  156. package/metadatas/2025-07/customers/enable.json +2 -2
  157. package/metadatas/2025-07/customers/purchasing_summary.json +1 -1
  158. package/metadatas/2025-07/customers/update.json +2 -2
  159. package/metadatas/2025-07/customers_email_marketing_consent/update.json +1 -1
  160. package/metadatas/2025-07/discounts/create.json +2 -2
  161. package/metadatas/2025-07/discounts/delete.json +1 -1
  162. package/metadatas/2025-07/discounts/redeemcode_added.json +1 -1
  163. package/metadatas/2025-07/discounts/redeemcode_removed.json +1 -1
  164. package/metadatas/2025-07/discounts/update.json +2 -2
  165. package/metadatas/2025-07/draft_orders/create.json +31 -31
  166. package/metadatas/2025-07/draft_orders/update.json +31 -31
  167. package/metadatas/2025-07/inventory_shipments/receive_items.json +1 -1
  168. package/metadatas/2025-07/orders/cancelled.json +3 -3
  169. package/metadatas/2025-07/orders/create.json +3 -3
  170. package/metadatas/2025-07/orders/fulfilled.json +3 -3
  171. package/metadatas/2025-07/orders/paid.json +3 -3
  172. package/metadatas/2025-07/orders/partially_fulfilled.json +3 -3
  173. package/metadatas/2025-07/orders/updated.json +3 -3
  174. package/metadatas/2025-07/returns/process.json +1 -16
  175. package/metadatas/2025-07/segments/update.json +1 -1
  176. package/metadatas/2025-07/selling_plan_groups/create.json +2 -2
  177. package/metadatas/2025-07/selling_plan_groups/delete.json +2 -2
  178. package/metadatas/2025-07/selling_plan_groups/update.json +2 -2
  179. package/metadatas/2025-07/subscription_billing_attempts/challenged.json +2 -2
  180. package/metadatas/2025-07/subscription_billing_attempts/failure.json +2 -2
  181. package/metadatas/2025-07/subscription_billing_attempts/success.json +2 -2
  182. package/metadatas/2025-07/subscription_billing_cycle_edits/create.json +1 -1
  183. package/metadatas/2025-07/subscription_billing_cycle_edits/delete.json +1 -1
  184. package/metadatas/2025-07/subscription_billing_cycle_edits/update.json +1 -1
  185. package/metadatas/2025-07/subscription_billing_cycles/skip.json +1 -1
  186. package/metadatas/2025-07/subscription_billing_cycles/unskip.json +1 -1
  187. package/metadatas/2025-07/subscription_contracts/activate.json +3 -3
  188. package/metadatas/2025-07/subscription_contracts/cancel.json +3 -3
  189. package/metadatas/2025-07/subscription_contracts/create.json +3 -3
  190. package/metadatas/2025-07/subscription_contracts/expire.json +3 -3
  191. package/metadatas/2025-07/subscription_contracts/fail.json +3 -3
  192. package/metadatas/2025-07/subscription_contracts/pause.json +3 -3
  193. package/metadatas/2025-07/subscription_contracts/update.json +3 -3
  194. package/package.json +1 -1
  195. package/schemas/2024-10/app/scopes_update.json +5 -0
  196. package/schemas/2024-10/checkouts/create.json +6 -9
  197. package/schemas/2024-10/checkouts/update.json +6 -9
  198. package/schemas/2024-10/customers/create.json +46 -4
  199. package/schemas/2024-10/customers/delete.json +42 -3
  200. package/schemas/2024-10/customers/disable.json +46 -4
  201. package/schemas/2024-10/customers/enable.json +46 -4
  202. package/schemas/2024-10/customers/update.json +46 -4
  203. package/schemas/2024-10/customers_email_marketing_consent/update.json +1 -4
  204. package/schemas/2024-10/draft_orders/create.json +6 -9
  205. package/schemas/2024-10/draft_orders/update.json +6 -9
  206. package/schemas/2024-10/inventory_levels/connect.json +29 -0
  207. package/schemas/2024-10/inventory_levels/update.json +29 -0
  208. package/schemas/2024-10/orders/cancelled.json +2 -8
  209. package/schemas/2024-10/orders/create.json +2 -8
  210. package/schemas/2024-10/orders/fulfilled.json +2 -8
  211. package/schemas/2024-10/orders/paid.json +2 -8
  212. package/schemas/2024-10/orders/partially_fulfilled.json +2 -8
  213. package/schemas/2024-10/orders/updated.json +2 -8
  214. package/schemas/2024-10/shipping_addresses/create.json +59 -0
  215. package/schemas/2024-10/shipping_addresses/update.json +59 -0
  216. package/schemas/2025-01/app/scopes_update.json +5 -0
  217. package/schemas/2025-01/checkouts/create.json +6 -9
  218. package/schemas/2025-01/checkouts/update.json +6 -9
  219. package/schemas/2025-01/customers/create.json +4 -1
  220. package/schemas/2025-01/customers/disable.json +4 -1
  221. package/schemas/2025-01/customers/enable.json +4 -1
  222. package/schemas/2025-01/customers/update.json +4 -1
  223. package/schemas/2025-01/customers_email_marketing_consent/update.json +1 -4
  224. package/schemas/2025-01/draft_orders/create.json +6 -9
  225. package/schemas/2025-01/draft_orders/update.json +6 -9
  226. package/schemas/2025-01/inventory_levels/connect.json +29 -0
  227. package/schemas/2025-01/inventory_levels/update.json +29 -0
  228. package/schemas/2025-01/orders/cancelled.json +2 -8
  229. package/schemas/2025-01/orders/create.json +2 -8
  230. package/schemas/2025-01/orders/fulfilled.json +2 -8
  231. package/schemas/2025-01/orders/paid.json +2 -8
  232. package/schemas/2025-01/orders/partially_fulfilled.json +2 -8
  233. package/schemas/2025-01/orders/updated.json +2 -8
  234. package/schemas/2025-01/shipping_addresses/create.json +59 -0
  235. package/schemas/2025-01/shipping_addresses/update.json +59 -0
  236. package/schemas/2025-04/app/scopes_update.json +5 -0
  237. package/schemas/2025-04/checkouts/create.json +6 -9
  238. package/schemas/2025-04/checkouts/update.json +6 -9
  239. package/schemas/2025-04/customers/create.json +4 -1
  240. package/schemas/2025-04/customers/disable.json +4 -1
  241. package/schemas/2025-04/customers/enable.json +4 -1
  242. package/schemas/2025-04/customers/update.json +4 -1
  243. package/schemas/2025-04/customers_email_marketing_consent/update.json +1 -4
  244. package/schemas/2025-04/draft_orders/create.json +6 -9
  245. package/schemas/2025-04/draft_orders/update.json +6 -9
  246. package/schemas/2025-04/inventory_levels/connect.json +29 -0
  247. package/schemas/2025-04/inventory_levels/update.json +29 -0
  248. package/schemas/2025-04/orders/cancelled.json +2 -8
  249. package/schemas/2025-04/orders/create.json +2 -8
  250. package/schemas/2025-04/orders/fulfilled.json +2 -8
  251. package/schemas/2025-04/orders/paid.json +2 -8
  252. package/schemas/2025-04/orders/partially_fulfilled.json +2 -8
  253. package/schemas/2025-04/orders/updated.json +2 -8
  254. package/schemas/2025-04/shipping_addresses/create.json +59 -0
  255. package/schemas/2025-04/shipping_addresses/update.json +59 -0
  256. package/schemas/2025-07/app/scopes_update.json +5 -0
  257. package/schemas/2025-07/checkouts/create.json +6 -9
  258. package/schemas/2025-07/checkouts/update.json +6 -9
  259. package/schemas/2025-07/customers/create.json +4 -1
  260. package/schemas/2025-07/customers/disable.json +4 -1
  261. package/schemas/2025-07/customers/enable.json +4 -1
  262. package/schemas/2025-07/customers/update.json +4 -1
  263. package/schemas/2025-07/customers_email_marketing_consent/update.json +1 -4
  264. package/schemas/2025-07/draft_orders/create.json +6 -9
  265. package/schemas/2025-07/draft_orders/update.json +6 -9
  266. package/schemas/2025-07/inventory_levels/connect.json +29 -0
  267. package/schemas/2025-07/inventory_levels/update.json +29 -0
  268. package/schemas/2025-07/orders/cancelled.json +2 -8
  269. package/schemas/2025-07/orders/create.json +2 -8
  270. package/schemas/2025-07/orders/fulfilled.json +2 -8
  271. package/schemas/2025-07/orders/paid.json +2 -8
  272. package/schemas/2025-07/orders/partially_fulfilled.json +2 -8
  273. package/schemas/2025-07/orders/updated.json +2 -8
  274. package/schemas/2025-07/returns/process.json +0 -59
  275. package/schemas/2025-07/shipping_addresses/create.json +59 -0
  276. package/schemas/2025-07/shipping_addresses/update.json +59 -0
@@ -3,7 +3,7 @@ export type Error = {
3
3
  message: string;
4
4
  path: string;
5
5
  };
6
- export declare const inferSchemaFromExamplePayload: (examplePayload: Record<string, any>, metadata: {
6
+ export declare const inferSchemaFromExamplePayload: (version: string, examplePayload: Record<string, any>, metadata: {
7
7
  name: string;
8
8
  }) => {
9
9
  schema: any;
@@ -14,5 +14,6 @@ export declare const manualExamples: [RegExp, Record<string, any>][];
14
14
  export declare const overrides: {
15
15
  topics: string[];
16
16
  schema: any;
17
+ required?: string[];
17
18
  versions?: string[];
18
19
  }[];
@@ -32,9 +32,8 @@ const getStartVersion = (date = new Date()) => {
32
32
  return `${targetYear}-${quarterToMonth[targetQuarter]}`;
33
33
  };
34
34
  exports.getStartVersion = getStartVersion;
35
- const inferSchemaFromExamplePayload = (examplePayload, metadata) => {
35
+ const inferSchemaFromExamplePayload = (version, examplePayload, metadata) => {
36
36
  const inference = (0, schema_infer_1.inferSchema)(examplePayload);
37
- const startVersion = (0, exports.getStartVersion)();
38
37
  // build a copy of the payload and apply overrides based on the webhook name
39
38
  for (const [matcher, override] of exports.manualExamples) {
40
39
  if (matcher.test(metadata.name)) {
@@ -49,10 +48,14 @@ const inferSchemaFromExamplePayload = (examplePayload, metadata) => {
49
48
  ...inference.toJSONSchema(),
50
49
  };
51
50
  for (const override of exports.overrides) {
52
- if (override.topics.includes(metadata.name) && (!override.versions || override.versions.includes(startVersion))) {
51
+ if (override.topics.includes(metadata.name) && (!override.versions || override.versions.includes(version))) {
53
52
  for (const [key, schemaOverride] of Object.entries(override.schema)) {
53
+ schema.properties ?? (schema.properties = {});
54
54
  schema.properties[key] = schemaOverride;
55
55
  }
56
+ if (override.required) {
57
+ schema.required = override.required;
58
+ }
56
59
  }
57
60
  }
58
61
  const sortedSchema = getDeterministicObject(schema);
@@ -740,4 +743,33 @@ exports.overrides = [
740
743
  },
741
744
  },
742
745
  },
746
+ {
747
+ topics: ["inventory_levels/connect", "inventory_levels/update"],
748
+ schema: {
749
+ admin_graphql_api_id: {
750
+ format: "uri",
751
+ type: "string",
752
+ },
753
+ available: {
754
+ type: ["integer", "null"],
755
+ },
756
+ inventory_item_id: {
757
+ type: "integer",
758
+ },
759
+ location_id: {
760
+ type: "integer",
761
+ },
762
+ updated_at: {
763
+ format: "date-time",
764
+ type: "string",
765
+ },
766
+ },
767
+ required: ["admin_graphql_api_id", "available", "inventory_item_id", "location_id", "updated_at"],
768
+ },
769
+ {
770
+ topics: ["shipping_addresses/create", "shipping_addresses/update"],
771
+ schema: {
772
+ ...shippingAddress.properties,
773
+ },
774
+ },
743
775
  ];
@@ -105,7 +105,7 @@ const main = async () => {
105
105
  const metadataFile = path_1.default.join(rootDir, "metadatas", version, webhook.name + ".json");
106
106
  await fs_extra_1.default.mkdir(path_1.default.dirname(metadataFile), { recursive: true });
107
107
  await fs_extra_1.default.writeFile(metadataFile, JSON.stringify(webhook, null, 2), "utf-8");
108
- const { schema, warnings: warningCount, errors: errorMessages } = (0, infer_schema_1.inferSchemaFromExamplePayload)(webhook.response, webhook);
108
+ const { schema, warnings: warningCount, errors: errorMessages } = (0, infer_schema_1.inferSchemaFromExamplePayload)(version, webhook.response, webhook);
109
109
  warnings += warningCount;
110
110
  for (const error of errorMessages) {
111
111
  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)}`);
@@ -10,6 +10,7 @@
10
10
  "related_resource": "Shop",
11
11
  "response": {
12
12
  "id": 1,
13
+ "shop_id": "gid://shopify/Shop/548380009",
13
14
  "previous": [
14
15
  "read_products"
15
16
  ],
@@ -9,7 +9,7 @@
9
9
  "related_resource": "ApplicationCharge",
10
10
  "response": {
11
11
  "app_purchase_one_time": {
12
- "admin_graphql_api_id": "gid://shopify/AppPurchaseOneTime/1017262353",
12
+ "admin_graphql_api_id": "gid://shopify/AppPurchaseOneTime/1017262354",
13
13
  "name": "Webhook Test",
14
14
  "status": "PENDING",
15
15
  "admin_graphql_api_shop_id": "gid://shopify/Shop/548380009",
@@ -9,7 +9,7 @@
9
9
  "related_resource": "RecurringApplicationCharge",
10
10
  "response": {
11
11
  "app_subscription": {
12
- "admin_graphql_api_id": "gid://shopify/AppSubscription/1029266949",
12
+ "admin_graphql_api_id": "gid://shopify/AppSubscription/1029266960",
13
13
  "name": "Webhook Test",
14
14
  "balance_used": 0,
15
15
  "capped_amount": "20.0",
@@ -10,7 +10,7 @@
10
10
  "related_resource": "RecurringApplicationCharge",
11
11
  "response": {
12
12
  "app_subscription": {
13
- "admin_graphql_api_id": "gid://shopify/AppSubscription/1029266948",
13
+ "admin_graphql_api_id": "gid://shopify/AppSubscription/1029266962",
14
14
  "name": "Webhook Test",
15
15
  "status": "PENDING",
16
16
  "admin_graphql_api_shop_id": "gid://shopify/Shop/548380009",
@@ -11,7 +11,7 @@
11
11
  "response": {
12
12
  "admin_graphql_api_id": "gid://shopify/BulkOperation/147595010",
13
13
  "completed_at": "2024-01-01T07:34:56-05:00",
14
- "created_at": "2025-06-13T11:19:23-04:00",
14
+ "created_at": "2025-07-01T14:03:22-04:00",
15
15
  "error_code": null,
16
16
  "status": "completed",
17
17
  "type": "query"
@@ -44,12 +44,12 @@
44
44
  {
45
45
  "applied_discounts": [],
46
46
  "discount_allocations": [],
47
- "key": "4788bcebfdae50ed3756b05241d17fdd",
48
- "destination_location_id": 1015975126,
47
+ "key": "fdc2f3d43cec601dbe9d1a7b86152329",
48
+ "destination_location_id": 1015975130,
49
49
  "fulfillment_service": "manual",
50
50
  "gift_card": false,
51
51
  "grams": 567,
52
- "origin_location_id": 1015975125,
52
+ "origin_location_id": 1015975129,
53
53
  "presentment_title": "IPod Nano - 8GB",
54
54
  "presentment_variant_title": "Pink",
55
55
  "product_id": 632910392,
@@ -103,12 +103,12 @@
103
103
  {
104
104
  "applied_discounts": [],
105
105
  "discount_allocations": [],
106
- "key": "4788bcebfdae50ed3756b05241d17fdd",
107
- "destination_location_id": 1015975126,
106
+ "key": "fdc2f3d43cec601dbe9d1a7b86152329",
107
+ "destination_location_id": 1015975130,
108
108
  "fulfillment_service": "manual",
109
109
  "gift_card": false,
110
110
  "grams": 567,
111
- "origin_location_id": 1015975125,
111
+ "origin_location_id": 1015975129,
112
112
  "presentment_title": "IPod Nano - 8GB",
113
113
  "presentment_variant_title": "Pink",
114
114
  "product_id": 632910392,
@@ -219,7 +219,7 @@
219
219
  },
220
220
  "customer": {
221
221
  "id": 603851970716743400,
222
- "email": "john@example.com",
222
+ "email": null,
223
223
  "created_at": null,
224
224
  "updated_at": null,
225
225
  "first_name": "John",
@@ -247,8 +247,8 @@
247
247
  "default_address": {
248
248
  "id": null,
249
249
  "customer_id": 603851970716743400,
250
- "first_name": null,
251
- "last_name": null,
250
+ "first_name": "John",
251
+ "last_name": "Smith",
252
252
  "company": null,
253
253
  "address1": "123 Elm St.",
254
254
  "address2": null,
@@ -257,7 +257,7 @@
257
257
  "country": "Canada",
258
258
  "zip": "K2H7A8",
259
259
  "phone": "123-123-1234",
260
- "name": "",
260
+ "name": "John Smith",
261
261
  "province_code": "ON",
262
262
  "country_code": "CA",
263
263
  "country_name": "Canada",
@@ -44,12 +44,12 @@
44
44
  {
45
45
  "applied_discounts": [],
46
46
  "discount_allocations": [],
47
- "key": "fd5774a7c08ef6210bc390184a712caa",
48
- "destination_location_id": 1015975132,
47
+ "key": "bff422fa7717dc622afd0a63413f6269",
48
+ "destination_location_id": 1015975140,
49
49
  "fulfillment_service": "manual",
50
50
  "gift_card": false,
51
51
  "grams": 567,
52
- "origin_location_id": 1015975131,
52
+ "origin_location_id": 1015975139,
53
53
  "presentment_title": "IPod Nano - 8GB",
54
54
  "presentment_variant_title": "Pink",
55
55
  "product_id": 632910392,
@@ -103,12 +103,12 @@
103
103
  {
104
104
  "applied_discounts": [],
105
105
  "discount_allocations": [],
106
- "key": "fd5774a7c08ef6210bc390184a712caa",
107
- "destination_location_id": 1015975132,
106
+ "key": "bff422fa7717dc622afd0a63413f6269",
107
+ "destination_location_id": 1015975140,
108
108
  "fulfillment_service": "manual",
109
109
  "gift_card": false,
110
110
  "grams": 567,
111
- "origin_location_id": 1015975131,
111
+ "origin_location_id": 1015975139,
112
112
  "presentment_title": "IPod Nano - 8GB",
113
113
  "presentment_variant_title": "Pink",
114
114
  "product_id": 632910392,
@@ -219,7 +219,7 @@
219
219
  },
220
220
  "customer": {
221
221
  "id": 603851970716743400,
222
- "email": "john@example.com",
222
+ "email": null,
223
223
  "created_at": null,
224
224
  "updated_at": null,
225
225
  "first_name": "John",
@@ -247,8 +247,8 @@
247
247
  "default_address": {
248
248
  "id": null,
249
249
  "customer_id": 603851970716743400,
250
- "first_name": null,
251
- "last_name": null,
250
+ "first_name": "John",
251
+ "last_name": "Smith",
252
252
  "company": null,
253
253
  "address1": "123 Elm St.",
254
254
  "address2": null,
@@ -257,7 +257,7 @@
257
257
  "country": "Canada",
258
258
  "zip": "K2H7A8",
259
259
  "phone": "123-123-1234",
260
- "name": "",
260
+ "name": "John Smith",
261
261
  "province_code": "ON",
262
262
  "country_code": "CA",
263
263
  "country_name": "Canada",
@@ -19,7 +19,7 @@
19
19
  "tag1",
20
20
  "tag2"
21
21
  ],
22
- "occurredAt": "2005-05-05T04:00:00.000Z"
22
+ "occurredAt": "2005-05-05T05:00:00.000Z"
23
23
  },
24
24
  "shop_feature": false
25
25
  }
@@ -19,7 +19,7 @@
19
19
  "tag1",
20
20
  "tag2"
21
21
  ],
22
- "occurredAt": "2005-05-05T04:00:00.000Z"
22
+ "occurredAt": "2005-05-05T05:00:00.000Z"
23
23
  },
24
24
  "shop_feature": false
25
25
  }
@@ -16,7 +16,7 @@
16
16
  "related_resource": "Customer",
17
17
  "response": {
18
18
  "id": 706405506930370000,
19
- "email": "bob@biller.com",
19
+ "email": null,
20
20
  "created_at": "2021-12-31T19:00:00-05:00",
21
21
  "updated_at": "2021-12-31T19:00:00-05:00",
22
22
  "first_name": "Bob",
@@ -35,7 +35,11 @@
35
35
  "phone": null,
36
36
  "addresses": [],
37
37
  "tax_exemptions": [],
38
- "email_marketing_consent": null,
38
+ "email_marketing_consent": {
39
+ "state": "not_subscribed",
40
+ "opt_in_level": null,
41
+ "consent_updated_at": null
42
+ },
39
43
  "sms_marketing_consent": null,
40
44
  "admin_graphql_api_id": "gid://shopify/Customer/706405506930370084",
41
45
  "default_address": {
@@ -55,7 +59,7 @@
55
59
  "province_code": "ON",
56
60
  "country_code": "CA",
57
61
  "country_name": "CA",
58
- "default": false
62
+ "default": true
59
63
  }
60
64
  },
61
65
  "shop_feature": false
@@ -16,7 +16,11 @@
16
16
  "phone": null,
17
17
  "addresses": [],
18
18
  "tax_exemptions": [],
19
- "email_marketing_consent": null,
19
+ "email_marketing_consent": {
20
+ "state": "not_subscribed",
21
+ "opt_in_level": null,
22
+ "consent_updated_at": null
23
+ },
20
24
  "sms_marketing_consent": null,
21
25
  "admin_graphql_api_id": "gid://shopify/Customer/706405506930370084"
22
26
  },
@@ -16,7 +16,7 @@
16
16
  "related_resource": "Customer",
17
17
  "response": {
18
18
  "id": 706405506930370000,
19
- "email": "bob@biller.com",
19
+ "email": null,
20
20
  "created_at": "2021-12-31T19:00:00-05:00",
21
21
  "updated_at": "2021-12-31T19:00:00-05:00",
22
22
  "first_name": "Bob",
@@ -35,7 +35,11 @@
35
35
  "phone": null,
36
36
  "addresses": [],
37
37
  "tax_exemptions": [],
38
- "email_marketing_consent": null,
38
+ "email_marketing_consent": {
39
+ "state": "not_subscribed",
40
+ "opt_in_level": null,
41
+ "consent_updated_at": null
42
+ },
39
43
  "sms_marketing_consent": null,
40
44
  "admin_graphql_api_id": "gid://shopify/Customer/706405506930370084",
41
45
  "default_address": {
@@ -55,7 +59,7 @@
55
59
  "province_code": "ON",
56
60
  "country_code": "CA",
57
61
  "country_name": "CA",
58
- "default": false
62
+ "default": true
59
63
  }
60
64
  },
61
65
  "shop_feature": false
@@ -16,7 +16,7 @@
16
16
  "related_resource": "Customer",
17
17
  "response": {
18
18
  "id": 706405506930370000,
19
- "email": "bob@biller.com",
19
+ "email": null,
20
20
  "created_at": "2021-12-31T19:00:00-05:00",
21
21
  "updated_at": "2021-12-31T19:00:00-05:00",
22
22
  "first_name": "Bob",
@@ -35,7 +35,11 @@
35
35
  "phone": null,
36
36
  "addresses": [],
37
37
  "tax_exemptions": [],
38
- "email_marketing_consent": null,
38
+ "email_marketing_consent": {
39
+ "state": "not_subscribed",
40
+ "opt_in_level": null,
41
+ "consent_updated_at": null
42
+ },
39
43
  "sms_marketing_consent": null,
40
44
  "admin_graphql_api_id": "gid://shopify/Customer/706405506930370084",
41
45
  "default_address": {
@@ -55,7 +59,7 @@
55
59
  "province_code": "ON",
56
60
  "country_code": "CA",
57
61
  "country_name": "CA",
58
- "default": false
62
+ "default": true
59
63
  }
60
64
  },
61
65
  "shop_feature": false
@@ -16,7 +16,7 @@
16
16
  "related_resource": "Customer",
17
17
  "response": {
18
18
  "id": 706405506930370000,
19
- "email": "bob@biller.com",
19
+ "email": null,
20
20
  "created_at": "2021-12-31T19:00:00-05:00",
21
21
  "updated_at": "2021-12-31T19:00:00-05:00",
22
22
  "first_name": "Bob",
@@ -35,7 +35,11 @@
35
35
  "phone": null,
36
36
  "addresses": [],
37
37
  "tax_exemptions": [],
38
- "email_marketing_consent": null,
38
+ "email_marketing_consent": {
39
+ "state": "not_subscribed",
40
+ "opt_in_level": null,
41
+ "consent_updated_at": null
42
+ },
39
43
  "sms_marketing_consent": null,
40
44
  "admin_graphql_api_id": "gid://shopify/Customer/706405506930370084",
41
45
  "default_address": {
@@ -55,7 +59,7 @@
55
59
  "province_code": "ON",
56
60
  "country_code": "CA",
57
61
  "country_name": "CA",
58
- "default": false
62
+ "default": true
59
63
  }
60
64
  },
61
65
  "shop_feature": false
@@ -16,7 +16,7 @@
16
16
  "related_resource": "Customer",
17
17
  "response": {
18
18
  "customer_id": 706405506930370000,
19
- "email_address": null,
19
+ "email_address": "bob@biller.com",
20
20
  "email_marketing_consent": {
21
21
  "state": null,
22
22
  "opt_in_level": null,
@@ -15,8 +15,8 @@
15
15
  "admin_graphql_api_id": "gid://shopify/DiscountAutomaticNode/1",
16
16
  "title": "Automatic free shipping",
17
17
  "status": "ACTIVE",
18
- "created_at": "2016-08-29T12:00:00-04:00",
19
- "updated_at": "2016-08-29T12:00:00-04:00"
18
+ "created_at": "2016-08-29T13:00:00-04:00",
19
+ "updated_at": "2016-08-29T13:00:00-04:00"
20
20
  },
21
21
  "shop_feature": false
22
22
  }
@@ -13,7 +13,7 @@
13
13
  "related_resource": "PriceRule",
14
14
  "response": {
15
15
  "admin_graphql_api_id": "gid://shopify/DiscountAutomaticNode/1",
16
- "deleted_at": "2018-08-29T12:00:00-04:00"
16
+ "deleted_at": "2018-08-29T13:00:00-04:00"
17
17
  },
18
18
  "shop_feature": false
19
19
  }
@@ -17,7 +17,7 @@
17
17
  "id": "gid://shopify/DiscountRedeemCode/1",
18
18
  "code": "code1"
19
19
  },
20
- "updated_at": "2018-08-29T16:00:00.000Z"
20
+ "updated_at": "2018-08-29T17:00:00.000Z"
21
21
  },
22
22
  "shop_feature": false
23
23
  }
@@ -17,7 +17,7 @@
17
17
  "id": "gid://shopify/DiscountRedeemCode/1",
18
18
  "code": "code1"
19
19
  },
20
- "updated_at": "2018-08-29T16:00:00.000Z"
20
+ "updated_at": "2018-08-29T17:00:00.000Z"
21
21
  },
22
22
  "shop_feature": false
23
23
  }
@@ -15,8 +15,8 @@
15
15
  "admin_graphql_api_id": "gid://shopify/DiscountAutomaticNode/1",
16
16
  "title": "Automatic free shipping updated",
17
17
  "status": "ACTIVE",
18
- "created_at": "2016-08-29T12:00:00-04:00",
19
- "updated_at": "2016-08-29T12:00:00-04:00"
18
+ "created_at": "2016-08-29T13:00:00-04:00",
19
+ "updated_at": "2016-08-29T13:00:00-04:00"
20
20
  },
21
21
  "shop_feature": false
22
22
  }
@@ -25,20 +25,20 @@
25
25
  "updated_at": "2021-12-31T19:00:00-05:00",
26
26
  "tax_exempt": false,
27
27
  "completed_at": null,
28
- "name": "#D150",
28
+ "name": "#D131",
29
29
  "allow_discount_codes_in_checkout?": false,
30
30
  "b2b?": false,
31
31
  "status": "open",
32
32
  "line_items": [
33
33
  {
34
- "id": 4200896,
34
+ "id": 4299028,
35
35
  "variant_id": 49148385,
36
36
  "product_id": 632910392,
37
37
  "title": "IPod Nano - 8GB",
38
38
  "variant_title": "Red",
39
39
  "sku": "IPOD2008RED",
40
40
  "vendor": "Apple",
41
- "quantity": 2,
41
+ "quantity": 4,
42
42
  "requires_shipping": true,
43
43
  "taxable": true,
44
44
  "gift_card": false,
@@ -50,17 +50,17 @@
50
50
  "properties": [],
51
51
  "custom": false,
52
52
  "price": "199.00",
53
- "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/4200896"
53
+ "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/4299028"
54
54
  },
55
55
  {
56
- "id": 2808882,
56
+ "id": 208003,
57
57
  "variant_id": 457924702,
58
58
  "product_id": 632910392,
59
59
  "title": "IPod Nano - 8GB",
60
60
  "variant_title": "Black",
61
61
  "sku": "IPOD2008BLACK",
62
62
  "vendor": "Apple",
63
- "quantity": 5,
63
+ "quantity": 10,
64
64
  "requires_shipping": true,
65
65
  "taxable": true,
66
66
  "gift_card": false,
@@ -72,17 +72,17 @@
72
72
  "properties": [],
73
73
  "custom": false,
74
74
  "price": "199.00",
75
- "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/2808882"
75
+ "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/208003"
76
76
  },
77
77
  {
78
- "id": 964856,
78
+ "id": 3435618,
79
79
  "variant_id": 808950810,
80
80
  "product_id": 632910392,
81
81
  "title": "IPod Nano - 8GB",
82
82
  "variant_title": "Pink",
83
83
  "sku": "IPOD2008PINK",
84
84
  "vendor": "Apple",
85
- "quantity": 9,
85
+ "quantity": 1,
86
86
  "requires_shipping": true,
87
87
  "taxable": true,
88
88
  "gift_card": false,
@@ -94,7 +94,7 @@
94
94
  "properties": [],
95
95
  "custom": false,
96
96
  "price": "199.00",
97
- "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/964856"
97
+ "admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/3435618"
98
98
  }
99
99
  ],
100
100
  "api_client_id": null,
@@ -136,9 +136,9 @@
136
136
  "created_on_api_version_handle": null,
137
137
  "applied_discount": {
138
138
  "description": "ABC 123",
139
- "value": "2.0",
139
+ "value": "3.0",
140
140
  "title": "ABC 123",
141
- "amount": "10.00",
141
+ "amount": "4.00",
142
142
  "value_type": "percentage"
143
143
  },
144
144
  "order_id": null,
@@ -146,30 +146,30 @@
146
146
  "title": "ABC 123",
147
147
  "custom": true,
148
148
  "handle": null,
149
- "price": "3.00"
149
+ "price": "9.00"
150
150
  },
151
151
  "tax_lines": [
152
152
  {
153
- "rate": 0.024013790673784504,
153
+ "rate": 0.030741493752353827,
154
154
  "title": "State tax",
155
- "price": "4.00"
155
+ "price": "1.00"
156
156
  },
157
157
  {
158
- "rate": 0.024013790673784504,
158
+ "rate": 0.030741493752353827,
159
159
  "title": "State tax",
160
- "price": "2.00"
160
+ "price": "1.00"
161
161
  },
162
162
  {
163
- "rate": 0.024013790673784504,
163
+ "rate": 0.030741493752353827,
164
164
  "title": "State tax",
165
- "price": "3.00"
165
+ "price": "5.00"
166
166
  }
167
167
  ],
168
168
  "tags": "",
169
169
  "note_attributes": [],
170
- "total_price": "416.00",
171
- "subtotal_price": "420.00",
172
- "total_tax": "482.00",
170
+ "total_price": "439.00",
171
+ "subtotal_price": "418.00",
172
+ "total_tax": "449.00",
173
173
  "payment_terms": {
174
174
  "id": 706405506930370000,
175
175
  "payment_terms_name": "Net 7",
@@ -188,15 +188,15 @@
188
188
  "issued_at": "2021-01-01T00:00:00-05:00",
189
189
  "due_at": "2021-01-02T00:00:00-05:00",
190
190
  "completed_at": "2021-01-02T00:00:00-05:00",
191
- "amount": "416.00",
191
+ "amount": "439.00",
192
192
  "currency": "USD",
193
- "total_price": "416.00",
193
+ "total_price": "439.00",
194
194
  "total_price_currency": "USD",
195
- "balance_due": "416.00",
195
+ "balance_due": "439.00",
196
196
  "balance_due_currency": "USD",
197
- "total_balance": "416.00",
197
+ "total_balance": "439.00",
198
198
  "total_balance_currency": "USD",
199
- "outstanding_balance": "416.00",
199
+ "outstanding_balance": "439.00",
200
200
  "outstanding_balance_currency": "USD"
201
201
  }
202
202
  ],
@@ -205,7 +205,7 @@
205
205
  "admin_graphql_api_id": "gid://shopify/DraftOrder/890612572568261625",
206
206
  "customer": {
207
207
  "id": 706405506930370000,
208
- "email": "john@doe.ca",
208
+ "email": null,
209
209
  "created_at": null,
210
210
  "updated_at": null,
211
211
  "first_name": "John",
@@ -233,8 +233,8 @@
233
233
  "default_address": {
234
234
  "id": null,
235
235
  "customer_id": 706405506930370000,
236
- "first_name": null,
237
- "last_name": null,
236
+ "first_name": "John",
237
+ "last_name": "Smith",
238
238
  "company": null,
239
239
  "address1": "123 Elm St.",
240
240
  "address2": null,
@@ -243,7 +243,7 @@
243
243
  "country": "Canada",
244
244
  "zip": "K2H7A8",
245
245
  "phone": "123-123-1234",
246
- "name": "",
246
+ "name": "John Smith",
247
247
  "province_code": "ON",
248
248
  "country_code": "CA",
249
249
  "country_name": "Canada",