@ehrenkind/shopify-lib 0.3.0 → 0.4.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 (125) hide show
  1. package/dist/generated-api-types/2025-04/admin.generated.d.ts +125 -0
  2. package/dist/generated-api-types/2025-04/admin.generated.d.ts.map +1 -1
  3. package/dist/index.d.ts +7 -1
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +7 -1
  6. package/dist/index.js.map +1 -1
  7. package/dist/mutations/customers/deleteCustomerById.d.ts +1 -3
  8. package/dist/mutations/customers/deleteCustomerById.d.ts.map +1 -1
  9. package/dist/mutations/customers/deleteCustomerById.js +1 -4
  10. package/dist/mutations/customers/deleteCustomerById.js.map +1 -1
  11. package/dist/queries/customers/getCustomersByEmail.d.ts +13 -0
  12. package/dist/queries/customers/getCustomersByEmail.d.ts.map +1 -0
  13. package/dist/queries/customers/getCustomersByEmail.js +26 -0
  14. package/dist/queries/customers/getCustomersByEmail.js.map +1 -0
  15. package/dist/queries/customers/getCustomersByEmail.mock.d.ts +8 -0
  16. package/dist/queries/customers/getCustomersByEmail.mock.d.ts.map +1 -0
  17. package/dist/queries/customers/getCustomersByEmail.mock.js +54 -0
  18. package/dist/queries/customers/getCustomersByEmail.mock.js.map +1 -0
  19. package/dist/queries/customers/getCustomersByEmail.queries.d.ts +2 -0
  20. package/dist/queries/customers/getCustomersByEmail.queries.d.ts.map +1 -0
  21. package/dist/queries/customers/getCustomersByEmail.queries.js +41 -0
  22. package/dist/queries/customers/getCustomersByEmail.queries.js.map +1 -0
  23. package/dist/queries/customers/getCustomersByEmail.test.d.ts +2 -0
  24. package/dist/queries/customers/getCustomersByEmail.test.d.ts.map +1 -0
  25. package/dist/queries/customers/getCustomersByEmail.test.js +29 -0
  26. package/dist/queries/customers/getCustomersByEmail.test.js.map +1 -0
  27. package/dist/queries/fulfillmentOrders/getFulfillmentOrdersByOrderId.d.ts +14 -0
  28. package/dist/queries/fulfillmentOrders/getFulfillmentOrdersByOrderId.d.ts.map +1 -0
  29. package/dist/queries/fulfillmentOrders/getFulfillmentOrdersByOrderId.js +27 -0
  30. package/dist/queries/fulfillmentOrders/getFulfillmentOrdersByOrderId.js.map +1 -0
  31. package/dist/queries/fulfillmentOrders/getFulfillmentOrdersByOrderId.mock.d.ts +12 -0
  32. package/dist/queries/fulfillmentOrders/getFulfillmentOrdersByOrderId.mock.d.ts.map +1 -0
  33. package/dist/queries/fulfillmentOrders/getFulfillmentOrdersByOrderId.mock.js +41 -0
  34. package/dist/queries/fulfillmentOrders/getFulfillmentOrdersByOrderId.mock.js.map +1 -0
  35. package/dist/queries/fulfillmentOrders/getFulfillmentOrdersByOrderId.queries.d.ts +2 -0
  36. package/dist/queries/fulfillmentOrders/getFulfillmentOrdersByOrderId.queries.d.ts.map +1 -0
  37. package/dist/queries/fulfillmentOrders/getFulfillmentOrdersByOrderId.queries.js +28 -0
  38. package/dist/queries/fulfillmentOrders/getFulfillmentOrdersByOrderId.queries.js.map +1 -0
  39. package/dist/queries/fulfillmentOrders/getFulfillmentOrdersByOrderId.test.d.ts +2 -0
  40. package/dist/queries/fulfillmentOrders/getFulfillmentOrdersByOrderId.test.d.ts.map +1 -0
  41. package/dist/queries/fulfillmentOrders/getFulfillmentOrdersByOrderId.test.js +19 -0
  42. package/dist/queries/fulfillmentOrders/getFulfillmentOrdersByOrderId.test.js.map +1 -0
  43. package/dist/queries/fulfillments/getFulfillmentById.d.ts +12 -0
  44. package/dist/queries/fulfillments/getFulfillmentById.d.ts.map +1 -0
  45. package/dist/queries/fulfillments/getFulfillmentById.js +27 -0
  46. package/dist/queries/fulfillments/getFulfillmentById.js.map +1 -0
  47. package/dist/queries/fulfillments/getFulfillmentById.mock.d.ts +21 -0
  48. package/dist/queries/fulfillments/getFulfillmentById.mock.d.ts.map +1 -0
  49. package/dist/queries/fulfillments/getFulfillmentById.mock.js +83 -0
  50. package/dist/queries/fulfillments/getFulfillmentById.mock.js.map +1 -0
  51. package/dist/queries/fulfillments/getFulfillmentById.queries.d.ts +2 -0
  52. package/dist/queries/fulfillments/getFulfillmentById.queries.d.ts.map +1 -0
  53. package/dist/queries/fulfillments/getFulfillmentById.queries.js +60 -0
  54. package/dist/queries/fulfillments/getFulfillmentById.queries.js.map +1 -0
  55. package/dist/queries/fulfillments/getFulfillmentById.test.d.ts +2 -0
  56. package/dist/queries/fulfillments/getFulfillmentById.test.d.ts.map +1 -0
  57. package/dist/queries/fulfillments/getFulfillmentById.test.js +37 -0
  58. package/dist/queries/fulfillments/getFulfillmentById.test.js.map +1 -0
  59. package/dist/queries/fulfillments/getFulfillmentTrackingIds.d.ts +14 -0
  60. package/dist/queries/fulfillments/getFulfillmentTrackingIds.d.ts.map +1 -0
  61. package/dist/queries/fulfillments/getFulfillmentTrackingIds.js +36 -0
  62. package/dist/queries/fulfillments/getFulfillmentTrackingIds.js.map +1 -0
  63. package/dist/queries/fulfillments/getFulfillmentTrackingIds.mock.d.ts +5 -0
  64. package/dist/queries/fulfillments/getFulfillmentTrackingIds.mock.d.ts.map +1 -0
  65. package/dist/queries/fulfillments/getFulfillmentTrackingIds.mock.js +20 -0
  66. package/dist/queries/fulfillments/getFulfillmentTrackingIds.mock.js.map +1 -0
  67. package/dist/queries/fulfillments/getFulfillmentTrackingIds.queries.d.ts +2 -0
  68. package/dist/queries/fulfillments/getFulfillmentTrackingIds.queries.d.ts.map +1 -0
  69. package/dist/queries/fulfillments/getFulfillmentTrackingIds.queries.js +13 -0
  70. package/dist/queries/fulfillments/getFulfillmentTrackingIds.queries.js.map +1 -0
  71. package/dist/queries/fulfillments/getFulfillmentTrackingIds.test.d.ts +2 -0
  72. package/dist/queries/fulfillments/getFulfillmentTrackingIds.test.d.ts.map +1 -0
  73. package/dist/queries/fulfillments/getFulfillmentTrackingIds.test.js +61 -0
  74. package/dist/queries/fulfillments/getFulfillmentTrackingIds.test.js.map +1 -0
  75. package/dist/queries/orders/getOrderById.d.ts +14 -14
  76. package/dist/queries/orders/getOrderById.mock.d.ts.map +1 -1
  77. package/dist/queries/orders/getOrderByName.d.ts +6 -6
  78. package/dist/queries/orders/getOrderCancellationInfo.d.ts +12 -0
  79. package/dist/queries/orders/getOrderCancellationInfo.d.ts.map +1 -0
  80. package/dist/queries/orders/getOrderCancellationInfo.js +35 -0
  81. package/dist/queries/orders/getOrderCancellationInfo.js.map +1 -0
  82. package/dist/queries/orders/getOrderCancellationInfo.mock.d.ts +6 -0
  83. package/dist/queries/orders/getOrderCancellationInfo.mock.d.ts.map +1 -0
  84. package/dist/queries/orders/getOrderCancellationInfo.mock.js +29 -0
  85. package/dist/queries/orders/getOrderCancellationInfo.mock.js.map +1 -0
  86. package/dist/queries/orders/getOrderCancellationInfo.queries.d.ts +2 -0
  87. package/dist/queries/orders/getOrderCancellationInfo.queries.d.ts.map +1 -0
  88. package/dist/queries/orders/getOrderCancellationInfo.queries.js +15 -0
  89. package/dist/queries/orders/getOrderCancellationInfo.queries.js.map +1 -0
  90. package/dist/queries/orders/getOrderCancellationInfo.test.d.ts +2 -0
  91. package/dist/queries/orders/getOrderCancellationInfo.test.d.ts.map +1 -0
  92. package/dist/queries/orders/getOrderCancellationInfo.test.js +34 -0
  93. package/dist/queries/orders/getOrderCancellationInfo.test.js.map +1 -0
  94. package/dist/queries/orders/getOrderPaymentDetails.d.ts +5 -123
  95. package/dist/queries/orders/getOrderPaymentDetails.d.ts.map +1 -1
  96. package/dist/queries/orders/getOrderPaymentDetails.js +3 -22
  97. package/dist/queries/orders/getOrderPaymentDetails.js.map +1 -1
  98. package/dist/queries/orders/getOrderPaymentDetails.mock.d.ts +7 -9
  99. package/dist/queries/orders/getOrderPaymentDetails.mock.d.ts.map +1 -1
  100. package/dist/queries/orders/getOrderPaymentDetails.mock.js +1 -3
  101. package/dist/queries/orders/getOrderPaymentDetails.mock.js.map +1 -1
  102. package/dist/queries/orders/getOrdersByCustomerId.d.ts +15 -0
  103. package/dist/queries/orders/getOrdersByCustomerId.d.ts.map +1 -0
  104. package/dist/queries/orders/getOrdersByCustomerId.js +32 -0
  105. package/dist/queries/orders/getOrdersByCustomerId.js.map +1 -0
  106. package/dist/queries/orders/getOrdersByCustomerId.mock.d.ts +15 -0
  107. package/dist/queries/orders/getOrdersByCustomerId.mock.d.ts.map +1 -0
  108. package/dist/queries/orders/getOrdersByCustomerId.mock.js +76 -0
  109. package/dist/queries/orders/getOrdersByCustomerId.mock.js.map +1 -0
  110. package/dist/queries/orders/getOrdersByCustomerId.queries.d.ts +2 -0
  111. package/dist/queries/orders/getOrdersByCustomerId.queries.d.ts.map +1 -0
  112. package/dist/queries/orders/getOrdersByCustomerId.queries.js +41 -0
  113. package/dist/queries/orders/getOrdersByCustomerId.queries.js.map +1 -0
  114. package/dist/queries/orders/getOrdersByCustomerId.test.d.ts +2 -0
  115. package/dist/queries/orders/getOrdersByCustomerId.test.d.ts.map +1 -0
  116. package/dist/queries/orders/getOrdersByCustomerId.test.js +33 -0
  117. package/dist/queries/orders/getOrdersByCustomerId.test.js.map +1 -0
  118. package/dist/queries/productVariants/getLeanProductVariants.d.ts +2 -2
  119. package/dist/utils/mswHandlers.d.ts.map +1 -1
  120. package/dist/utils/mswHandlers.js +18 -0
  121. package/dist/utils/mswHandlers.js.map +1 -1
  122. package/dist/utils/shopifyFetch.d.ts +1 -1
  123. package/dist/utils/shopifyFetch.d.ts.map +1 -1
  124. package/dist/utils/shopifyFetch.js.map +1 -1
  125. package/package.json +1 -1
@@ -0,0 +1,32 @@
1
+ import { logger } from '../../utils/logger.js';
2
+ import { convertIdIntoGid, fetchShopifyGraphql, } from '../../utils/shopifyFetch.js';
3
+ import { queryOrdersByCustomerId } from './getOrdersByCustomerId.queries.js';
4
+ /**
5
+ * Retrieves orders for a specific customer from Shopify.
6
+ * Returns orders sorted by most recent first, or an empty array if customer not found.
7
+ *
8
+ * @param {number | bigint} customerId - The numerical Shopify customer ID.
9
+ * @param {number} limit - Maximum number of orders to return. Defaults to 250.
10
+ * @returns {Promise<OrderPreview[]>} A promise that resolves to an array of order previews.
11
+ * @throws {Error} If the GraphQL query fails.
12
+ */
13
+ export async function getOrdersByCustomerId(customerId, limit = 250) {
14
+ const bigIntId = typeof customerId === 'number' ? BigInt(customerId) : customerId;
15
+ const gid = convertIdIntoGid(bigIntId, 'Customer');
16
+ const variables = {
17
+ customerId: gid,
18
+ first: limit,
19
+ };
20
+ const response = await fetchShopifyGraphql({
21
+ query: queryOrdersByCustomerId,
22
+ variables,
23
+ });
24
+ if (!response.customer) {
25
+ logger.debug(`No customer found with ID: ${customerId}`);
26
+ return [];
27
+ }
28
+ const orders = response.customer.orders.edges.map((edge) => edge.node);
29
+ logger.debug(`Got ${orders.length} orders for customer ${customerId}`);
30
+ return orders;
31
+ }
32
+ //# sourceMappingURL=getOrdersByCustomerId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getOrdersByCustomerId.js","sourceRoot":"","sources":["../../../src/queries/orders/getOrdersByCustomerId.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC9C,OAAO,EACL,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAM5E;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,UAA2B,EAC3B,KAAK,GAAG,GAAG;IAEX,MAAM,QAAQ,GACZ,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAA;IAClE,MAAM,GAAG,GAAG,gBAAgB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAA;IAElD,MAAM,SAAS,GAAqC;QAClD,UAAU,EAAE,GAAG;QACf,KAAK,EAAE,KAAK;KACb,CAAA;IAED,MAAM,QAAQ,GAAG,MAAM,mBAAmB,CAA0B;QAClE,KAAK,EAAE,uBAAuB;QAC9B,SAAS;KACV,CAAC,CAAA;IAEF,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;QACvB,MAAM,CAAC,KAAK,CAAC,8BAA8B,UAAU,EAAE,CAAC,CAAA;QACxD,OAAO,EAAE,CAAA;IACX,CAAC;IAED,MAAM,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAEtE,MAAM,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,MAAM,wBAAwB,UAAU,EAAE,CAAC,CAAA;IAEtE,OAAO,MAAM,CAAA;AACf,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { OrdersByCustomerIdQuery } from '../../generated-api-types/2025-04/admin.generated';
2
+ export declare const ordersByCustomerIdMock: OrdersByCustomerIdQuery;
3
+ export declare const expectedOrdersByCustomerId: (Pick<import("../../generated-api-types/2025-04/admin.types").Order, "id" | "createdAt" | "name" | "cancelledAt" | "cancelReason" | "displayFulfillmentStatus"> & {
4
+ totalPriceSet: {
5
+ shopMoney: Pick<import("../../generated-api-types/2025-04/admin.types").MoneyV2, "amount" | "currencyCode">;
6
+ };
7
+ lineItems: {
8
+ edges: Array<{
9
+ node: (Pick<import("../../generated-api-types/2025-04/admin.types").LineItem, "sku" | "title"> & {
10
+ image?: import("../../generated-api-types/2025-04/admin.types").Maybe<Pick<import("../../generated-api-types/2025-04/admin.types").Image, "url" | "width" | "height" | "altText">>;
11
+ });
12
+ }>;
13
+ };
14
+ })[];
15
+ //# sourceMappingURL=getOrdersByCustomerId.mock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getOrdersByCustomerId.mock.d.ts","sourceRoot":"","sources":["../../../src/queries/orders/getOrdersByCustomerId.mock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mDAAmD,CAAA;AAMhG,eAAO,MAAM,sBAAsB,EAAE,uBAwEpC,CAAA;AAED,eAAO,MAAM,0BAA0B;;;;;;;qBAEmxX,CAAC;;;;IAD7uX,CAAA"}
@@ -0,0 +1,76 @@
1
+ import { CurrencyCode, OrderDisplayFulfillmentStatus, } from '../../generated-api-types/2025-04/admin.types';
2
+ export const ordersByCustomerIdMock = {
3
+ customer: {
4
+ id: 'gid://shopify/Customer/98765432101234',
5
+ orders: {
6
+ edges: [
7
+ {
8
+ node: {
9
+ id: 'gid://shopify/Order/12345678901234',
10
+ name: 'B12345',
11
+ createdAt: '2023-09-19T16:15:23Z',
12
+ cancelledAt: null,
13
+ cancelReason: null,
14
+ displayFulfillmentStatus: OrderDisplayFulfillmentStatus.Fulfilled,
15
+ totalPriceSet: {
16
+ shopMoney: {
17
+ amount: '139.0',
18
+ currencyCode: CurrencyCode.Eur,
19
+ },
20
+ },
21
+ lineItems: {
22
+ edges: [
23
+ {
24
+ node: {
25
+ sku: 'MATTRESS-001',
26
+ title: 'Premium Mattress',
27
+ image: {
28
+ url: 'https://cdn.shopify.com/mattress.jpg',
29
+ width: 800,
30
+ height: 600,
31
+ altText: 'Premium Mattress',
32
+ },
33
+ },
34
+ },
35
+ ],
36
+ },
37
+ },
38
+ },
39
+ {
40
+ node: {
41
+ id: 'gid://shopify/Order/12345678901235',
42
+ name: 'B12346',
43
+ createdAt: '2023-08-15T10:30:00Z',
44
+ cancelledAt: null,
45
+ cancelReason: null,
46
+ displayFulfillmentStatus: OrderDisplayFulfillmentStatus.Fulfilled,
47
+ totalPriceSet: {
48
+ shopMoney: {
49
+ amount: '49.0',
50
+ currencyCode: CurrencyCode.Eur,
51
+ },
52
+ },
53
+ lineItems: {
54
+ edges: [
55
+ {
56
+ node: {
57
+ sku: 'PILLOW-002',
58
+ title: 'Pillow Set',
59
+ image: {
60
+ url: 'https://cdn.shopify.com/pillow.jpg',
61
+ width: 800,
62
+ height: 600,
63
+ altText: 'Pillow Set',
64
+ },
65
+ },
66
+ },
67
+ ],
68
+ },
69
+ },
70
+ },
71
+ ],
72
+ },
73
+ },
74
+ };
75
+ export const expectedOrdersByCustomerId = ordersByCustomerIdMock.customer?.orders.edges.map((edge) => edge.node) ?? [];
76
+ //# sourceMappingURL=getOrdersByCustomerId.mock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getOrdersByCustomerId.mock.js","sourceRoot":"","sources":["../../../src/queries/orders/getOrdersByCustomerId.mock.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EACZ,6BAA6B,GAC9B,MAAM,+CAA+C,CAAA;AAEtD,MAAM,CAAC,MAAM,sBAAsB,GAA4B;IAC7D,QAAQ,EAAE;QACR,EAAE,EAAE,uCAAuC;QAC3C,MAAM,EAAE;YACN,KAAK,EAAE;gBACL;oBACE,IAAI,EAAE;wBACJ,EAAE,EAAE,oCAAoC;wBACxC,IAAI,EAAE,QAAQ;wBACd,SAAS,EAAE,sBAAsB;wBACjC,WAAW,EAAE,IAAI;wBACjB,YAAY,EAAE,IAAI;wBAClB,wBAAwB,EAAE,6BAA6B,CAAC,SAAS;wBACjE,aAAa,EAAE;4BACb,SAAS,EAAE;gCACT,MAAM,EAAE,OAAO;gCACf,YAAY,EAAE,YAAY,CAAC,GAAG;6BAC/B;yBACF;wBACD,SAAS,EAAE;4BACT,KAAK,EAAE;gCACL;oCACE,IAAI,EAAE;wCACJ,GAAG,EAAE,cAAc;wCACnB,KAAK,EAAE,kBAAkB;wCACzB,KAAK,EAAE;4CACL,GAAG,EAAE,sCAAsC;4CAC3C,KAAK,EAAE,GAAG;4CACV,MAAM,EAAE,GAAG;4CACX,OAAO,EAAE,kBAAkB;yCAC5B;qCACF;iCACF;6BACF;yBACF;qBACF;iBACF;gBACD;oBACE,IAAI,EAAE;wBACJ,EAAE,EAAE,oCAAoC;wBACxC,IAAI,EAAE,QAAQ;wBACd,SAAS,EAAE,sBAAsB;wBACjC,WAAW,EAAE,IAAI;wBACjB,YAAY,EAAE,IAAI;wBAClB,wBAAwB,EAAE,6BAA6B,CAAC,SAAS;wBACjE,aAAa,EAAE;4BACb,SAAS,EAAE;gCACT,MAAM,EAAE,MAAM;gCACd,YAAY,EAAE,YAAY,CAAC,GAAG;6BAC/B;yBACF;wBACD,SAAS,EAAE;4BACT,KAAK,EAAE;gCACL;oCACE,IAAI,EAAE;wCACJ,GAAG,EAAE,YAAY;wCACjB,KAAK,EAAE,YAAY;wCACnB,KAAK,EAAE;4CACL,GAAG,EAAE,oCAAoC;4CACzC,KAAK,EAAE,GAAG;4CACV,MAAM,EAAE,GAAG;4CACX,OAAO,EAAE,YAAY;yCACtB;qCACF;iCACF;6BACF;yBACF;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAA;AAED,MAAM,CAAC,MAAM,0BAA0B,GACrC,sBAAsB,CAAC,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const queryOrdersByCustomerId: string;
2
+ //# sourceMappingURL=getOrdersByCustomerId.queries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getOrdersByCustomerId.queries.d.ts","sourceRoot":"","sources":["../../../src/queries/orders/getOrdersByCustomerId.queries.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB,QAsCnC,CAAA"}
@@ -0,0 +1,41 @@
1
+ import { gql } from '../../utils/logger';
2
+ export const queryOrdersByCustomerId = gql `#graphql
3
+ query ordersByCustomerId($customerId: ID!, $first: Int!) {
4
+ customer(id: $customerId) {
5
+ id
6
+ orders(first: $first, reverse: true) {
7
+ edges {
8
+ node {
9
+ id
10
+ name
11
+ createdAt
12
+ cancelledAt
13
+ cancelReason
14
+ displayFulfillmentStatus
15
+ totalPriceSet {
16
+ shopMoney {
17
+ amount
18
+ currencyCode
19
+ }
20
+ }
21
+ lineItems(first: 100) {
22
+ edges {
23
+ node {
24
+ sku
25
+ title
26
+ image {
27
+ url
28
+ width
29
+ height
30
+ altText
31
+ }
32
+ }
33
+ }
34
+ }
35
+ }
36
+ }
37
+ }
38
+ }
39
+ }
40
+ `;
41
+ //# sourceMappingURL=getOrdersByCustomerId.queries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getOrdersByCustomerId.queries.js","sourceRoot":"","sources":["../../../src/queries/orders/getOrdersByCustomerId.queries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAA;AAExC,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCzC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=getOrdersByCustomerId.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getOrdersByCustomerId.test.d.ts","sourceRoot":"","sources":["../../../src/queries/orders/getOrdersByCustomerId.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,33 @@
1
+ import { graphql, passthrough } from 'msw';
2
+ import { describe, expect, it } from 'vitest';
3
+ import { server } from '../../utils/mswHandlers';
4
+ import { getOrdersByCustomerId } from './getOrdersByCustomerId';
5
+ import { expectedOrdersByCustomerId } from './getOrdersByCustomerId.mock';
6
+ describe('getOrdersByCustomerId', () => {
7
+ it('should return orders when customer found', async () => {
8
+ const result = await getOrdersByCustomerId(98765432101234n);
9
+ expect(result).toEqual(expectedOrdersByCustomerId);
10
+ });
11
+ it('should work with number input', async () => {
12
+ const result = await getOrdersByCustomerId(98765432101234);
13
+ expect(result).toEqual(expectedOrdersByCustomerId);
14
+ });
15
+ it('should include order line items', async () => {
16
+ const result = await getOrdersByCustomerId(98765432101234n);
17
+ expect(result[0]?.lineItems.edges).toHaveLength(1);
18
+ expect(result[0]?.lineItems.edges[0]?.node.sku).toBe('MATTRESS-001');
19
+ });
20
+ it('should return multiple orders', async () => {
21
+ const result = await getOrdersByCustomerId(98765432101234n);
22
+ expect(result).toHaveLength(2);
23
+ expect(result[1]?.name).toBe('B12346');
24
+ });
25
+ describe('Live', () => {
26
+ it('should return empty array when customer not found', async () => {
27
+ server.use(graphql.query('ordersByCustomerId', () => passthrough()));
28
+ const result = await getOrdersByCustomerId(99999999999n);
29
+ expect(result).toEqual([]);
30
+ });
31
+ });
32
+ });
33
+ //# sourceMappingURL=getOrdersByCustomerId.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getOrdersByCustomerId.test.js","sourceRoot":"","sources":["../../../src/queries/orders/getOrdersByCustomerId.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAA;AAEzE,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,EAAE,CAAC,0CAA0C,EAAE,KAAK,IAAI,EAAE;QACxD,MAAM,MAAM,GAAG,MAAM,qBAAqB,CAAC,eAAe,CAAC,CAAA;QAC3D,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAA;IACpD,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,+BAA+B,EAAE,KAAK,IAAI,EAAE;QAC7C,MAAM,MAAM,GAAG,MAAM,qBAAqB,CAAC,cAAc,CAAC,CAAA;QAC1D,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAA;IACpD,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,iCAAiC,EAAE,KAAK,IAAI,EAAE;QAC/C,MAAM,MAAM,GAAG,MAAM,qBAAqB,CAAC,eAAe,CAAC,CAAA;QAC3D,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;QAClD,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;IACtE,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,+BAA+B,EAAE,KAAK,IAAI,EAAE;QAC7C,MAAM,MAAM,GAAG,MAAM,qBAAqB,CAAC,eAAe,CAAC,CAAA;QAC3D,MAAM,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;QAC9B,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACxC,CAAC,CAAC,CAAA;IAEF,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE;QACpB,EAAE,CAAC,mDAAmD,EAAE,KAAK,IAAI,EAAE;YACjE,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,oBAAoB,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,CAAA;YACpE,MAAM,MAAM,GAAG,MAAM,qBAAqB,CAAC,YAAY,CAAC,CAAA;YACxD,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QAC5B,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -9,14 +9,14 @@ declare const GetLeanProductVariantsReturn: z.ZodArray<z.ZodObject<{
9
9
  productId: string;
10
10
  variantId: string;
11
11
  sku: string;
12
- variantTitle: string;
13
12
  productTitle: string;
13
+ variantTitle: string;
14
14
  }, {
15
15
  productId: string;
16
16
  variantId: string;
17
17
  sku: string;
18
- variantTitle: string;
19
18
  productTitle: string;
19
+ variantTitle: string;
20
20
  }>, "many">;
21
21
  type GetLeanProductVariantsReturnType = z.infer<typeof GetLeanProductVariantsReturn>;
22
22
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"mswHandlers.d.ts","sourceRoot":"","sources":["../../src/utils/mswHandlers.ts"],"names":[],"mappings":"AAqDA,KAAK,kBAAkB,GAAG,CAAC,IAAI,EAAE;IAC/B,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,EAAE,MAAM,CAAA;CACd,KAAK,QAAQ,CAAA;AAEd,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,kBAAkB,CAUpE;AAED,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAE7B,eAAO,MAAM,MAAM,mCAA2B,CAAA"}
1
+ {"version":3,"file":"mswHandlers.d.ts","sourceRoot":"","sources":["../../src/utils/mswHandlers.ts"],"names":[],"mappings":"AAqFA,KAAK,kBAAkB,GAAG,CAAC,IAAI,EAAE;IAC/B,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,EAAE,MAAM,CAAA;CACd,KAAK,QAAQ,CAAA;AAEd,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,kBAAkB,CAUpE;AAED,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAE7B,eAAO,MAAM,MAAM,mCAA2B,CAAA"}
@@ -3,9 +3,15 @@ import { setupServer } from 'msw/node';
3
3
  import { customerDeleteMock } from '../mutations/customers/deleteCustomerById.mock';
4
4
  import { orderCancelSuccessMock } from '../mutations/orders/cancelOrderById.mock';
5
5
  import { connectMetaObjectToProductVariantMock } from '../mutations/productVariantsBulkUpdate/connectMetaObjectToProductVariant.mock';
6
+ import { customersByEmailMock } from '../queries/customers/getCustomersByEmail.mock';
7
+ import { fulfillmentOrdersByOrderIdMock } from '../queries/fulfillmentOrders/getFulfillmentOrdersByOrderId.mock';
8
+ import { fulfillmentByIdMock } from '../queries/fulfillments/getFulfillmentById.mock';
9
+ import { fulfillmentTrackingIdsMock } from '../queries/fulfillments/getFulfillmentTrackingIds.mock';
6
10
  import { orderByIdFullMock, orderByIdMock, } from '../queries/orders/getOrderById.mock';
7
11
  import { ordersByNameMock } from '../queries/orders/getOrderByName.mock';
12
+ import { orderCancellationInfoMock } from '../queries/orders/getOrderCancellationInfo.mock';
8
13
  import { orderPaymentDetailsMock } from '../queries/orders/getOrderPaymentDetails.mock';
14
+ import { ordersByCustomerIdMock } from '../queries/orders/getOrdersByCustomerId.mock';
9
15
  import { leanProductVariantsMock } from '../queries/productVariants/getLeanProductVariants.mock';
10
16
  import { logger } from './logger';
11
17
  import { productHandlesMock } from './shopifyClient.mock';
@@ -14,9 +20,18 @@ const orders = [
14
20
  graphql.query('orderByIdFull', createGqlResponse(orderByIdFullMock)),
15
21
  graphql.query('ordersByName', createGqlResponse(ordersByNameMock)),
16
22
  graphql.query('ordersByNameFull', createGqlResponse(ordersByNameMock)),
23
+ graphql.query('ordersByCustomerId', createGqlResponse(ordersByCustomerIdMock)),
17
24
  graphql.query('orderPaymentDetailsById', createGqlResponse(orderPaymentDetailsMock)),
25
+ graphql.query('orderCancellationInfoByName', createGqlResponse(orderCancellationInfoMock)),
18
26
  graphql.mutation('orderCancel', createGqlResponse(orderCancelSuccessMock)),
19
27
  ];
28
+ const fulfillments = [
29
+ graphql.query('fulfillmentById', createGqlResponse(fulfillmentByIdMock)),
30
+ graphql.query('fulfillmentTrackingIds', createGqlResponse(fulfillmentTrackingIdsMock)),
31
+ ];
32
+ const fulfillmentOrders = [
33
+ graphql.query('fulfillmentOrdersByOrderId', createGqlResponse(fulfillmentOrdersByOrderIdMock)),
34
+ ];
20
35
  const productVariants = [
21
36
  graphql.query('productHandles', createGqlResponse(productHandlesMock)),
22
37
  graphql.query('leanProductVariants', createGqlResponse(leanProductVariantsMock)),
@@ -25,10 +40,13 @@ const productVariantsBulkUpdate = [
25
40
  graphql.mutation('connectMetaObjectToProductVariant', createGqlResponse(connectMetaObjectToProductVariantMock)),
26
41
  ];
27
42
  const customers = [
43
+ graphql.query('customersByEmail', createGqlResponse(customersByEmailMock)),
28
44
  graphql.mutation('customerDelete', createGqlResponse(customerDeleteMock)),
29
45
  ];
30
46
  const handlers = [
31
47
  ...orders,
48
+ ...fulfillments,
49
+ ...fulfillmentOrders,
32
50
  ...productVariants,
33
51
  ...productVariantsBulkUpdate,
34
52
  ...customers,
@@ -1 +1 @@
1
- {"version":3,"file":"mswHandlers.js","sourceRoot":"","sources":["../../src/utils/mswHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAA;AACnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAA;AACjF,OAAO,EAAE,qCAAqC,EAAE,MAAM,+EAA+E,CAAA;AACrI,OAAO,EACL,iBAAiB,EACjB,aAAa,GACd,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAA;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,wDAAwD,CAAA;AAChG,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEzD,MAAM,MAAM,GAAG;IACb,OAAO,CAAC,KAAK,CAAC,WAAW,EAAE,iBAAiB,CAAC,aAAa,CAAC,CAAC;IAC5D,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACpE,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,iBAAiB,CAAC,gBAAgB,CAAC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AAQ,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;CAC1E,CAAA;AAED,MAAM,QAAQ,GAAG;IACf,GAAG,MAAM;IACT,GAAG,YAAY;IACf,GAAG,iBAAiB;IACpB,GAAG,eAAe;IAClB,GAAG,yBAAyB;IAC5B,GAAG,SAAS;CACb,CAAA;AAOD,MAAM,UAAU,iBAAiB,CAAI,QAAW;IAC9C,OAAO,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,EAAE,EAAE;QAClC,MAAM,CAAC,KAAK,CAAC,gCAAgC,aAAa,EAAE,CAAC,CAAA;QAC7D,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACnB,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE;YACtD,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;SACF,CAAC,CAAA;IACJ,CAAC,CAAA;AACH,CAAC;AAED,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAE7B,MAAM,CAAC,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,QAAQ,CAAC,CAAA"}
@@ -1,4 +1,4 @@
1
- export declare function convertIdIntoGid(id: bigint, type: 'Order' | 'Customer'): string;
1
+ export declare function convertIdIntoGid(id: bigint, type: 'Order' | 'Customer' | 'Fulfillment'): string;
2
2
  interface PageInfo {
3
3
  hasNextPage: boolean;
4
4
  endCursor?: string | null | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"shopifyFetch.d.ts","sourceRoot":"","sources":["../../src/utils/shopifyFetch.ts"],"names":[],"mappings":"AAGA,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,OAAO,GAAG,UAAU,GACzB,MAAM,CAER;AAED,UAAU,QAAQ;IAChB,WAAW,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,G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AAM,IAAI,KAAK,CAAC,mBAAmB,aAAa,EAAE,CAAC,CAAA;IACrD,CAAC;IAED,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;IACpD,CAAC;IAED,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ehrenkind/shopify-lib",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "main": "dist/index.cjs",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",