@platform-x-shp/shopify-adapter 0.0.0-stage → 0.2.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.
- package/README.md +42 -2
- package/dist/src/cart.d.ts +38 -0
- package/dist/src/cart.d.ts.map +1 -0
- package/dist/src/cart.js +150 -0
- package/dist/src/cart.js.map +1 -0
- package/dist/src/client.d.ts +13 -0
- package/dist/src/client.d.ts.map +1 -0
- package/dist/src/client.js +66 -0
- package/dist/src/client.js.map +1 -0
- package/dist/src/config-provider.d.ts +17 -0
- package/dist/src/config-provider.d.ts.map +1 -0
- package/dist/src/config-provider.js +54 -0
- package/dist/src/config-provider.js.map +1 -0
- package/dist/src/customers.d.ts +19 -0
- package/dist/src/customers.d.ts.map +1 -0
- package/dist/src/customers.js +62 -0
- package/dist/src/customers.js.map +1 -0
- package/dist/src/errors.d.ts +17 -0
- package/dist/src/errors.d.ts.map +1 -0
- package/dist/src/errors.js +32 -0
- package/dist/src/errors.js.map +1 -0
- package/dist/src/extract-site-name.d.ts +15 -0
- package/dist/src/extract-site-name.d.ts.map +1 -0
- package/dist/src/extract-site-name.js +26 -0
- package/dist/src/extract-site-name.js.map +1 -0
- package/dist/src/graphql-client.d.ts +16 -0
- package/dist/src/graphql-client.d.ts.map +1 -0
- package/dist/src/graphql-client.js +58 -0
- package/dist/src/graphql-client.js.map +1 -0
- package/dist/src/hep-secret-provider.d.ts +18 -0
- package/dist/src/hep-secret-provider.d.ts.map +1 -0
- package/dist/src/hep-secret-provider.js +29 -0
- package/dist/src/hep-secret-provider.js.map +1 -0
- package/dist/src/index.d.ts +52 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +97 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/keycloak-auth.d.ts +74 -0
- package/dist/src/keycloak-auth.d.ts.map +1 -0
- package/dist/src/keycloak-auth.js +123 -0
- package/dist/src/keycloak-auth.js.map +1 -0
- package/dist/src/messaging.d.ts +21 -0
- package/dist/src/messaging.d.ts.map +1 -0
- package/dist/src/messaging.js +11 -0
- package/dist/src/messaging.js.map +1 -0
- package/dist/src/orders.d.ts +57 -0
- package/dist/src/orders.d.ts.map +1 -0
- package/dist/src/orders.js +112 -0
- package/dist/src/orders.js.map +1 -0
- package/dist/src/platformx-auth.d.ts +51 -0
- package/dist/src/platformx-auth.d.ts.map +1 -0
- package/dist/src/platformx-auth.js +84 -0
- package/dist/src/platformx-auth.js.map +1 -0
- package/dist/src/products.d.ts +31 -0
- package/dist/src/products.d.ts.map +1 -0
- package/dist/src/products.js +92 -0
- package/dist/src/products.js.map +1 -0
- package/dist/src/redis-connector.d.ts +17 -0
- package/dist/src/redis-connector.d.ts.map +1 -0
- package/dist/src/redis-connector.js +227 -0
- package/dist/src/redis-connector.js.map +1 -0
- package/dist/src/resilience.d.ts +40 -0
- package/dist/src/resilience.d.ts.map +1 -0
- package/dist/src/resilience.js +124 -0
- package/dist/src/resilience.js.map +1 -0
- package/dist/src/tenant-config.d.ts +34 -0
- package/dist/src/tenant-config.d.ts.map +1 -0
- package/dist/src/tenant-config.js +285 -0
- package/dist/src/tenant-config.js.map +1 -0
- package/dist/src/tenant-errors.d.ts +16 -0
- package/dist/src/tenant-errors.d.ts.map +1 -0
- package/dist/src/tenant-errors.js +41 -0
- package/dist/src/tenant-errors.js.map +1 -0
- package/dist/src/tenant-types.d.ts +68 -0
- package/dist/src/tenant-types.d.ts.map +1 -0
- package/dist/src/tenant-types.js +3 -0
- package/dist/src/tenant-types.js.map +1 -0
- package/dist/src/tls-trust.d.ts +2 -0
- package/dist/src/tls-trust.d.ts.map +1 -0
- package/dist/src/tls-trust.js +27 -0
- package/dist/src/tls-trust.js.map +1 -0
- package/dist/src/utils/logger.d.ts +8 -0
- package/dist/src/utils/logger.d.ts.map +1 -0
- package/dist/src/utils/logger.js +108 -0
- package/dist/src/utils/logger.js.map +1 -0
- package/dist/src/webhookTopics.d.ts +31 -0
- package/dist/src/webhookTopics.d.ts.map +1 -0
- package/dist/src/webhookTopics.js +38 -0
- package/dist/src/webhookTopics.js.map +1 -0
- package/dist/src/webhooks.d.ts +59 -0
- package/dist/src/webhooks.d.ts.map +1 -0
- package/dist/src/webhooks.js +223 -0
- package/dist/src/webhooks.js.map +1 -0
- package/package.json +58 -4
package/README.md
CHANGED
|
@@ -1,3 +1,43 @@
|
|
|
1
|
-
#
|
|
1
|
+
# shopify-adapter
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Shopify commerce adapter: a plain Admin API client library plus read-model mappers, consumed by `hep-ecommerce-service`'s outbound adapter layer. No Express app of its own — structured to mirror [`hep-observability`](https://github.com/hcl-x/hep-observability) (flat `src/*.ts` by concern, single `index.ts` barrel, published scoped npm package).
|
|
4
|
+
|
|
5
|
+
Callers pass `siteName` explicitly to every function — unlike the 5 legacy `shp-*` microservices, this library has no request-scoped site context of its own.
|
|
6
|
+
|
|
7
|
+
**Self-contained — does not depend on `@platform-x-shp/shp-auth-client`.** That package is scoped to the 5 legacy microservices; this stack is meant to be fully independent of them. Everything this package needs from it was ported in directly rather than taken as a dependency:
|
|
8
|
+
|
|
9
|
+
- `tenant-config.ts` + `redis-connector.ts` + `config-provider.ts`/`hep-secret-provider.ts` — Redis-cached tenant config, backed by GCP Secret Manager/env (via `hep-secret-access`, same as the legacy services)
|
|
10
|
+
- `keycloak-auth.ts` / `platformx-auth.ts` — the same Keycloak + PlatformX JWT verification `hep-ecommerce-service`'s auth relies on
|
|
11
|
+
- `client.ts` — the resilient GraphQL wrapper (breaker/retry/timeout), now calling the locally-ported `graphql-client.ts` directly instead of an external `resilientGraphqlRequest`
|
|
12
|
+
|
|
13
|
+
Redis cache keys use their own `shopify-adapter:*` prefix (not `shp-auth-client:*`), so this package's cache never collides with the legacy services' — they're independent, even though both may point at the same Redis instance and read the same underlying secrets.
|
|
14
|
+
|
|
15
|
+
102 tests cover this, including the full ported `shp-auth-client` test suites for tenant-config/keycloak-auth/platformx-auth/config-provider/resilience — not just the Shopify-specific capabilities.
|
|
16
|
+
|
|
17
|
+
## Status
|
|
18
|
+
|
|
19
|
+
**Products** (Admin API) and **Cart** (Storefront API) are implemented, as the first two vertical slices through the new hexagonal `hep-ecommerce-service` / `shopify-adapter` stack:
|
|
20
|
+
|
|
21
|
+
- `fetchProducts(siteName, first?, after?)`, `fetchProductById(siteName, productId)`, `fetchProductByIdOrThrow(siteName, productId)`
|
|
22
|
+
- `createCart(siteName, lines?)`, `getCart(siteName, cartId)`, `addCartLines`, `updateCartLines`, `removeCartLines`
|
|
23
|
+
|
|
24
|
+
- `listOrders(siteName, opts?)`, `getOrderById(siteName, orderId)`
|
|
25
|
+
- `getCustomerById(siteName, customerId)`, `getCustomerByEmail(siteName, email)`
|
|
26
|
+
- `messaging.ts`: typed event shapes (currently just `CartCreatedEvent`) and a `Publish` function type — no amqplib dependency here; `hep-ecommerce-service` owns the actual RabbitMQ connection and injects a `publish` function.
|
|
27
|
+
- **Order webhooks**: `createShopifyWebhookRouter(onVerified)` — an Express router handling Shopify's `POST /shopify/:siteName` callback (HMAC-SHA256 verified against the tenant's `webhookHmacSecret`, raw-body read manually since the signature covers the exact bytes Shopify sent). No event store or message-bus connection of its own — same "caller decides what to do" shape as `messaging.ts`: `onVerified(event)` is called once per verified webhook, with `event.routingKey` pre-mapped via `shopifyTopicToRoutingKey` (`null` for a non-order topic, still worth recording, just not forwarding). `registerShopifyWebhooks({ siteNames, callbackUrlBase })` idempotently subscribes the order topics via the Admin API; whether/when to call it is the caller's deployment decision, not read from env here.
|
|
28
|
+
|
|
29
|
+
Cart is intentionally smaller than `shp-cart-service`'s original: no `buyerIdentity`, `discountCodes`, `attributes`/`note`, `deleteCart`, or `validateCheckout` yet. Orders has no refunds/fulfillments/transactions yet. Customers has no signup/login/address mutations yet. Webhooks cover only the order topics (`ORDER_WEBHOOK_TOPICS`) — no product/customer/app topics yet. All extend their respective files the same way, following `shp-order-service` / `shp-customer-service` / `shp-auth-service`.
|
|
30
|
+
|
|
31
|
+
## Scripts
|
|
32
|
+
|
|
33
|
+
- `npm run build` — compile to `dist/`
|
|
34
|
+
- `npm test` — run the Jest suite
|
|
35
|
+
- `npm run lint` — ESLint
|
|
36
|
+
|
|
37
|
+
## Node
|
|
38
|
+
|
|
39
|
+
Targets Node 22 (current Active LTS) — see the scoping doc for why this doesn't match `hep-api-gateway`/`hep-cx-delivery-api-service`'s current Node 18 pin.
|
|
40
|
+
|
|
41
|
+
## Secrets / env
|
|
42
|
+
|
|
43
|
+
Reads the same shape of secrets/env vars the legacy services do (`${SITENAME}_SHOPIFY_*` via Secret Manager or `.env`, `KEYCLOCK_HOST`, `REDIS_HOST`/`REDIS_PORT`, `SECRET_MODE`, `GOOGLE_PROJECT_ID` in production) — this is a parallel reader of the same tenant config, not a new provisioning path. `AUTH_TENANTS_INFO` and the `${SITENAME}_SHOPIFY_PLATFORMX_*` keys are shared secrets read by both this package and `shp-auth-client`.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface ShopifyMoney {
|
|
2
|
+
amount: string;
|
|
3
|
+
currencyCode: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ShopifyCartLine {
|
|
6
|
+
id: string;
|
|
7
|
+
quantity: number;
|
|
8
|
+
merchandiseId: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
productTitle?: string;
|
|
11
|
+
price?: ShopifyMoney;
|
|
12
|
+
}
|
|
13
|
+
export interface ShopifyCart {
|
|
14
|
+
id: string;
|
|
15
|
+
checkoutUrl: string | null;
|
|
16
|
+
totalQuantity: number;
|
|
17
|
+
totalAmount: ShopifyMoney | null;
|
|
18
|
+
lines: ShopifyCartLine[];
|
|
19
|
+
}
|
|
20
|
+
export interface CartLineInput {
|
|
21
|
+
merchandiseId: string;
|
|
22
|
+
quantity: number;
|
|
23
|
+
}
|
|
24
|
+
export interface CartLineUpdateInput {
|
|
25
|
+
id: string;
|
|
26
|
+
quantity: number;
|
|
27
|
+
}
|
|
28
|
+
/** Create a new cart, optionally with initial lines. */
|
|
29
|
+
export declare function createCart(siteName: string, lines?: CartLineInput[]): Promise<ShopifyCart>;
|
|
30
|
+
/** Fetch a cart by ID; `null` if it doesn't exist (expired carts return null from Shopify). */
|
|
31
|
+
export declare function getCart(siteName: string, cartId: string): Promise<ShopifyCart | null>;
|
|
32
|
+
/** Add one or more lines to an existing cart. */
|
|
33
|
+
export declare function addCartLines(siteName: string, cartId: string, lines: CartLineInput[]): Promise<ShopifyCart>;
|
|
34
|
+
/** Update the quantity of existing cart lines. */
|
|
35
|
+
export declare function updateCartLines(siteName: string, cartId: string, lines: CartLineUpdateInput[]): Promise<ShopifyCart>;
|
|
36
|
+
/** Remove lines from a cart by line ID. */
|
|
37
|
+
export declare function removeCartLines(siteName: string, cartId: string, lineIds: string[]): Promise<ShopifyCart>;
|
|
38
|
+
//# sourceMappingURL=cart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cart.d.ts","sourceRoot":"","sources":["../../src/cart.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,YAAY,GAAG,IAAI,CAAC;IACjC,KAAK,EAAE,eAAe,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;CAClB;AAwED,wDAAwD;AACxD,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAoBhG;AAED,+FAA+F;AAC/F,wBAAsB,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAU3F;AAED,iDAAiD;AACjD,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAqBjH;AAED,kDAAkD;AAClD,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,mBAAmB,EAAE,GAC3B,OAAO,CAAC,WAAW,CAAC,CAqBtB;AAED,2CAA2C;AAC3C,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAqB/G"}
|
package/dist/src/cart.js
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createCart = createCart;
|
|
4
|
+
exports.getCart = getCart;
|
|
5
|
+
exports.addCartLines = addCartLines;
|
|
6
|
+
exports.updateCartLines = updateCartLines;
|
|
7
|
+
exports.removeCartLines = removeCartLines;
|
|
8
|
+
const client_1 = require("./client");
|
|
9
|
+
const errors_1 = require("./errors");
|
|
10
|
+
// Kept intentionally smaller than shp-cart-service's full fragment (no buyerIdentity,
|
|
11
|
+
// discountCodes, attributes/note) — this is the first Cart slice through the new
|
|
12
|
+
// stack; those extend the same way once ported.
|
|
13
|
+
const CART_FRAGMENT = `
|
|
14
|
+
fragment CartFields on Cart {
|
|
15
|
+
id
|
|
16
|
+
checkoutUrl
|
|
17
|
+
totalQuantity
|
|
18
|
+
cost { totalAmount { amount currencyCode } }
|
|
19
|
+
lines(first: 100) {
|
|
20
|
+
nodes {
|
|
21
|
+
id
|
|
22
|
+
quantity
|
|
23
|
+
merchandise {
|
|
24
|
+
... on ProductVariant {
|
|
25
|
+
id
|
|
26
|
+
title
|
|
27
|
+
price { amount currencyCode }
|
|
28
|
+
product { title }
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
function mapCart(raw) {
|
|
36
|
+
return {
|
|
37
|
+
id: raw.id,
|
|
38
|
+
checkoutUrl: raw.checkoutUrl ?? null,
|
|
39
|
+
totalQuantity: raw.totalQuantity ?? 0,
|
|
40
|
+
totalAmount: raw.cost?.totalAmount ?? null,
|
|
41
|
+
lines: (raw.lines?.nodes ?? []).map((line) => ({
|
|
42
|
+
id: line.id,
|
|
43
|
+
quantity: line.quantity,
|
|
44
|
+
merchandiseId: line.merchandise?.id ?? '',
|
|
45
|
+
title: line.merchandise?.title,
|
|
46
|
+
productTitle: line.merchandise?.product?.title ?? undefined,
|
|
47
|
+
price: line.merchandise?.price,
|
|
48
|
+
})),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function ensureNoUserErrors(errors, message) {
|
|
52
|
+
if (errors.length > 0) {
|
|
53
|
+
throw new errors_1.ShopifyUserErrorsError(message, errors);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/** Create a new cart, optionally with initial lines. */
|
|
57
|
+
async function createCart(siteName, lines) {
|
|
58
|
+
const mutation = `
|
|
59
|
+
${CART_FRAGMENT}
|
|
60
|
+
mutation CartCreate($input: CartInput) {
|
|
61
|
+
cartCreate(input: $input) {
|
|
62
|
+
cart { ...CartFields }
|
|
63
|
+
userErrors { field message }
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
`;
|
|
67
|
+
const data = await (0, client_1.storefrontGraphql)(siteName, mutation, {
|
|
68
|
+
input: lines ? { lines } : undefined,
|
|
69
|
+
});
|
|
70
|
+
ensureNoUserErrors(data.cartCreate.userErrors, 'Failed to create cart');
|
|
71
|
+
if (!data.cartCreate.cart) {
|
|
72
|
+
throw new errors_1.ShopifyUserErrorsError('Failed to create cart', data.cartCreate.userErrors);
|
|
73
|
+
}
|
|
74
|
+
return mapCart(data.cartCreate.cart);
|
|
75
|
+
}
|
|
76
|
+
/** Fetch a cart by ID; `null` if it doesn't exist (expired carts return null from Shopify). */
|
|
77
|
+
async function getCart(siteName, cartId) {
|
|
78
|
+
const query = `
|
|
79
|
+
${CART_FRAGMENT}
|
|
80
|
+
query GetCart($id: ID!) {
|
|
81
|
+
cart(id: $id) { ...CartFields }
|
|
82
|
+
}
|
|
83
|
+
`;
|
|
84
|
+
const data = await (0, client_1.storefrontGraphql)(siteName, query, { id: cartId });
|
|
85
|
+
return data.cart ? mapCart(data.cart) : null;
|
|
86
|
+
}
|
|
87
|
+
/** Add one or more lines to an existing cart. */
|
|
88
|
+
async function addCartLines(siteName, cartId, lines) {
|
|
89
|
+
const mutation = `
|
|
90
|
+
${CART_FRAGMENT}
|
|
91
|
+
mutation CartLinesAdd($cartId: ID!, $lines: [CartLineInput!]!) {
|
|
92
|
+
cartLinesAdd(cartId: $cartId, lines: $lines) {
|
|
93
|
+
cart { ...CartFields }
|
|
94
|
+
userErrors { field message }
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
`;
|
|
98
|
+
const data = await (0, client_1.storefrontGraphql)(siteName, mutation, {
|
|
99
|
+
cartId,
|
|
100
|
+
lines,
|
|
101
|
+
});
|
|
102
|
+
ensureNoUserErrors(data.cartLinesAdd.userErrors, 'Failed to add cart lines');
|
|
103
|
+
if (!data.cartLinesAdd.cart) {
|
|
104
|
+
throw new errors_1.ShopifyUserErrorsError('Failed to add cart lines', data.cartLinesAdd.userErrors);
|
|
105
|
+
}
|
|
106
|
+
return mapCart(data.cartLinesAdd.cart);
|
|
107
|
+
}
|
|
108
|
+
/** Update the quantity of existing cart lines. */
|
|
109
|
+
async function updateCartLines(siteName, cartId, lines) {
|
|
110
|
+
const mutation = `
|
|
111
|
+
${CART_FRAGMENT}
|
|
112
|
+
mutation CartLinesUpdate($cartId: ID!, $lines: [CartLineUpdateInput!]!) {
|
|
113
|
+
cartLinesUpdate(cartId: $cartId, lines: $lines) {
|
|
114
|
+
cart { ...CartFields }
|
|
115
|
+
userErrors { field message }
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
`;
|
|
119
|
+
const data = await (0, client_1.storefrontGraphql)(siteName, mutation, {
|
|
120
|
+
cartId,
|
|
121
|
+
lines,
|
|
122
|
+
});
|
|
123
|
+
ensureNoUserErrors(data.cartLinesUpdate.userErrors, 'Failed to update cart lines');
|
|
124
|
+
if (!data.cartLinesUpdate.cart) {
|
|
125
|
+
throw new errors_1.ShopifyUserErrorsError('Failed to update cart lines', data.cartLinesUpdate.userErrors);
|
|
126
|
+
}
|
|
127
|
+
return mapCart(data.cartLinesUpdate.cart);
|
|
128
|
+
}
|
|
129
|
+
/** Remove lines from a cart by line ID. */
|
|
130
|
+
async function removeCartLines(siteName, cartId, lineIds) {
|
|
131
|
+
const mutation = `
|
|
132
|
+
${CART_FRAGMENT}
|
|
133
|
+
mutation CartLinesRemove($cartId: ID!, $lineIds: [ID!]!) {
|
|
134
|
+
cartLinesRemove(cartId: $cartId, lineIds: $lineIds) {
|
|
135
|
+
cart { ...CartFields }
|
|
136
|
+
userErrors { field message }
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
`;
|
|
140
|
+
const data = await (0, client_1.storefrontGraphql)(siteName, mutation, {
|
|
141
|
+
cartId,
|
|
142
|
+
lineIds,
|
|
143
|
+
});
|
|
144
|
+
ensureNoUserErrors(data.cartLinesRemove.userErrors, 'Failed to remove cart lines');
|
|
145
|
+
if (!data.cartLinesRemove.cart) {
|
|
146
|
+
throw new errors_1.ShopifyUserErrorsError('Failed to remove cart lines', data.cartLinesRemove.userErrors);
|
|
147
|
+
}
|
|
148
|
+
return mapCart(data.cartLinesRemove.cart);
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=cart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cart.js","sourceRoot":"","sources":["../../src/cart.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type ShopifyApiType = 'admin' | 'storefront';
|
|
2
|
+
/**
|
|
3
|
+
* Runs a Shopify Admin GraphQL query for `siteName`.
|
|
4
|
+
*
|
|
5
|
+
* Unlike the 5 legacy microservices, this library has no request-scoped site
|
|
6
|
+
* context of its own — callers (hep-ecommerce-service) resolve the tenant
|
|
7
|
+
* and pass `siteName` explicitly, since shopify-adapter is a plain client
|
|
8
|
+
* library, not an Express app.
|
|
9
|
+
*/
|
|
10
|
+
export declare function adminGraphql<T = unknown>(siteName: string, query: string, variables?: Record<string, unknown>): Promise<T>;
|
|
11
|
+
/** Same as {@link adminGraphql}, against Shopify's Storefront API — used by Cart (and checkout). */
|
|
12
|
+
export declare function storefrontGraphql<T = unknown>(siteName: string, query: string, variables?: Record<string, unknown>): Promise<T>;
|
|
13
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,YAAY,CAAC;AAoEpD;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,CAAC,GAAG,OAAO,EACtC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,OAAO,CAAC,CAAC,CAAC,CAEZ;AAED,oGAAoG;AACpG,wBAAgB,iBAAiB,CAAC,CAAC,GAAG,OAAO,EAC3C,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,OAAO,CAAC,CAAC,CAAC,CAEZ"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.adminGraphql = adminGraphql;
|
|
4
|
+
exports.storefrontGraphql = storefrontGraphql;
|
|
5
|
+
const graphql_client_1 = require("./graphql-client");
|
|
6
|
+
const errors_1 = require("./errors");
|
|
7
|
+
const resilience_1 = require("./resilience");
|
|
8
|
+
function defaultIsRetryable(err) {
|
|
9
|
+
if (!(err instanceof graphql_client_1.ClientError))
|
|
10
|
+
return true;
|
|
11
|
+
const status = err.response?.status;
|
|
12
|
+
return status === 429 || (status ?? 0) >= 500;
|
|
13
|
+
}
|
|
14
|
+
// One breaker per API type, shared by every tenant this process serves.
|
|
15
|
+
const breakers = {
|
|
16
|
+
admin: new resilience_1.CircuitBreaker(5, 30_000, 'shopify-admin'),
|
|
17
|
+
storefront: new resilience_1.CircuitBreaker(5, 30_000, 'shopify-storefront'),
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Runs a Shopify Admin/Storefront GraphQL query or mutation for a tenant via
|
|
21
|
+
* the shared, cached `getGraphQLClient`, guarded by a per-API-type circuit
|
|
22
|
+
* breaker, retry-with-backoff, and an overall timeout.
|
|
23
|
+
*
|
|
24
|
+
* Previously delegated to `@platform-x-shp/shp-auth-client`'s
|
|
25
|
+
* `resilientGraphqlRequest` — ported in directly (along with tenant-config
|
|
26
|
+
* resolution, Redis caching, and Keycloak/PlatformX verification) so this
|
|
27
|
+
* package doesn't depend on shp-auth-client, which is scoped to the 5
|
|
28
|
+
* legacy `shp-*` services.
|
|
29
|
+
*/
|
|
30
|
+
async function resilientGraphqlRequest(siteName, apiType, query, variables) {
|
|
31
|
+
const breaker = breakers[apiType];
|
|
32
|
+
return breaker.call(() => (0, resilience_1.withTimeout)(() => (0, resilience_1.withRetry)(async () => {
|
|
33
|
+
const client = await (0, graphql_client_1.getGraphQLClient)(siteName, apiType);
|
|
34
|
+
return client.request(query, variables);
|
|
35
|
+
}, 3, 300, defaultIsRetryable), 15000));
|
|
36
|
+
}
|
|
37
|
+
async function graphql(apiType, siteName, query, variables) {
|
|
38
|
+
try {
|
|
39
|
+
return await resilientGraphqlRequest(siteName, apiType, query, variables);
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
if (err instanceof graphql_client_1.ClientError) {
|
|
43
|
+
throw new errors_1.ShopifyAdapterError(err.message, {
|
|
44
|
+
status: err.response?.status,
|
|
45
|
+
errors: err.response?.errors,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
throw err instanceof Error ? new errors_1.ShopifyAdapterError(err.message) : err;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Runs a Shopify Admin GraphQL query for `siteName`.
|
|
53
|
+
*
|
|
54
|
+
* Unlike the 5 legacy microservices, this library has no request-scoped site
|
|
55
|
+
* context of its own — callers (hep-ecommerce-service) resolve the tenant
|
|
56
|
+
* and pass `siteName` explicitly, since shopify-adapter is a plain client
|
|
57
|
+
* library, not an Express app.
|
|
58
|
+
*/
|
|
59
|
+
function adminGraphql(siteName, query, variables) {
|
|
60
|
+
return graphql('admin', siteName, query, variables);
|
|
61
|
+
}
|
|
62
|
+
/** Same as {@link adminGraphql}, against Shopify's Storefront API — used by Cart (and checkout). */
|
|
63
|
+
function storefrontGraphql(siteName, query, variables) {
|
|
64
|
+
return graphql('storefront', siteName, query, variables);
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":";;AAgFA,oCAMC;AAGD,8CAMC;AA/FD,qDAAiE;AACjE,qCAA+C;AAC/C,6CAAsE;AAItE,SAAS,kBAAkB,CAAC,GAAY;IACtC,IAAI,CAAC,CAAC,GAAG,YAAY,4BAAW,CAAC;QAAE,OAAO,IAAI,CAAC;IAC/C,MAAM,MAAM,GAAG,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC;IACpC,OAAO,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC;AAChD,CAAC;AAED,wEAAwE;AACxE,MAAM,QAAQ,GAA2C;IACvD,KAAK,EAAE,IAAI,2BAAc,CAAC,CAAC,EAAE,MAAM,EAAE,eAAe,CAAC;IACrD,UAAU,EAAE,IAAI,2BAAc,CAAC,CAAC,EAAE,MAAM,EAAE,oBAAoB,CAAC;CAChE,CAAC;AAEF;;;;;;;;;;GAUG;AACH,KAAK,UAAU,uBAAuB,CACpC,QAAgB,EAChB,OAAuB,EACvB,KAAa,EACb,SAAmC;IAEnC,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;IAClC,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,CACvB,IAAA,wBAAW,EACT,GAAG,EAAE,CACH,IAAA,sBAAS,EACP,KAAK,IAAI,EAAE;QACT,MAAM,MAAM,GAAG,MAAM,IAAA,iCAAgB,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACzD,OAAO,MAAM,CAAC,OAAO,CAAI,KAAK,EAAE,SAAS,CAAC,CAAC;IAC7C,CAAC,EACD,CAAC,EACD,GAAG,EACH,kBAAkB,CACnB,EACH,KAAK,CACN,CACF,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,OAAO,CACpB,OAAuB,EACvB,QAAgB,EAChB,KAAa,EACb,SAAmC;IAEnC,IAAI,CAAC;QACH,OAAO,MAAM,uBAAuB,CAAI,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;IAC/E,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,4BAAW,EAAE,CAAC;YAC/B,MAAM,IAAI,4BAAmB,CAAC,GAAG,CAAC,OAAO,EAAE;gBACzC,MAAM,EAAE,GAAG,CAAC,QAAQ,EAAE,MAAM;gBAC5B,MAAM,EAAG,GAAG,CAAC,QAAiC,EAAE,MAAM;aACvD,CAAC,CAAC;QACL,CAAC;QACD,MAAM,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,IAAI,4BAAmB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IAC1E,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,YAAY,CAC1B,QAAgB,EAChB,KAAa,EACb,SAAmC;IAEnC,OAAO,OAAO,CAAI,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;AACzD,CAAC;AAED,oGAAoG;AACpG,SAAgB,iBAAiB,CAC/B,QAAgB,EAChB,KAAa,EACb,SAAmC;IAEnC,OAAO,OAAO,CAAI,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ConfigProvider } from './tenant-types';
|
|
2
|
+
export type ProviderMode = 'secret-manager' | 'env' | 'csi' | 'auto';
|
|
3
|
+
/**
|
|
4
|
+
* Factory to create the appropriate config provider. Secrets are actually
|
|
5
|
+
* resolved by hep-secret-access's secretManager() (env | gsm | csi, chosen via
|
|
6
|
+
* SECRET_MODE — see hep-delivery-service's secret_key.services.ts for the
|
|
7
|
+
* reference usage this mirrors).
|
|
8
|
+
*
|
|
9
|
+
* An explicit mode forces that SECRET_MODE (set just before constructing the
|
|
10
|
+
* provider, then restored) regardless of the ambient value. 'auto' (the
|
|
11
|
+
* default) defers to whatever SECRET_MODE is already set; only when it isn't
|
|
12
|
+
* set at all does this fall back to NODE_ENV-based selection (gsm in
|
|
13
|
+
* production, env otherwise) so deployments that never set SECRET_MODE keep
|
|
14
|
+
* working unchanged.
|
|
15
|
+
*/
|
|
16
|
+
export declare function createConfigProvider(mode?: ProviderMode): ConfigProvider;
|
|
17
|
+
//# sourceMappingURL=config-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-provider.d.ts","sourceRoot":"","sources":["../../src/config-provider.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;AASrE;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,GAAE,YAAqB,GAAG,cAAc,CAyBhF"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createConfigProvider = createConfigProvider;
|
|
4
|
+
const hep_secret_provider_1 = require("./hep-secret-provider");
|
|
5
|
+
/** Our mode names -> hep-secret-access's SECRET_MODE values. */
|
|
6
|
+
const TO_HEP_MODE = {
|
|
7
|
+
env: 'env',
|
|
8
|
+
'secret-manager': 'gsm',
|
|
9
|
+
csi: 'csi',
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Factory to create the appropriate config provider. Secrets are actually
|
|
13
|
+
* resolved by hep-secret-access's secretManager() (env | gsm | csi, chosen via
|
|
14
|
+
* SECRET_MODE — see hep-delivery-service's secret_key.services.ts for the
|
|
15
|
+
* reference usage this mirrors).
|
|
16
|
+
*
|
|
17
|
+
* An explicit mode forces that SECRET_MODE (set just before constructing the
|
|
18
|
+
* provider, then restored) regardless of the ambient value. 'auto' (the
|
|
19
|
+
* default) defers to whatever SECRET_MODE is already set; only when it isn't
|
|
20
|
+
* set at all does this fall back to NODE_ENV-based selection (gsm in
|
|
21
|
+
* production, env otherwise) so deployments that never set SECRET_MODE keep
|
|
22
|
+
* working unchanged.
|
|
23
|
+
*/
|
|
24
|
+
function createConfigProvider(mode = 'auto') {
|
|
25
|
+
if (mode !== 'auto') {
|
|
26
|
+
const previous = process.env.SECRET_MODE;
|
|
27
|
+
process.env.SECRET_MODE = TO_HEP_MODE[mode];
|
|
28
|
+
try {
|
|
29
|
+
return new hep_secret_provider_1.HepSecretProvider();
|
|
30
|
+
}
|
|
31
|
+
finally {
|
|
32
|
+
if (previous === undefined)
|
|
33
|
+
delete process.env.SECRET_MODE;
|
|
34
|
+
else
|
|
35
|
+
process.env.SECRET_MODE = previous;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (!process.env.SECRET_MODE) {
|
|
39
|
+
if (process.env.NODE_ENV === 'production') {
|
|
40
|
+
// GOOGLE_PROJECT_ID (not GCP_PROJECT_ID) is what hep-secret-access's
|
|
41
|
+
// GoogleSecretManagerProvider actually reads — checking the wrong name
|
|
42
|
+
// here would let this pass while GSM silently falls back to its own
|
|
43
|
+
// default project.
|
|
44
|
+
if (!process.env.GOOGLE_PROJECT_ID)
|
|
45
|
+
throw new Error('GOOGLE_PROJECT_ID is required in production');
|
|
46
|
+
process.env.SECRET_MODE = 'gsm';
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
process.env.SECRET_MODE = 'env';
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return new hep_secret_provider_1.HepSecretProvider();
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=config-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-provider.js","sourceRoot":"","sources":["../../src/config-provider.ts"],"names":[],"mappings":";;AAyBA,oDAyBC;AAlDD,+DAA0D;AAK1D,gEAAgE;AAChE,MAAM,WAAW,GAAqD;IACpE,GAAG,EAAE,KAAK;IACV,gBAAgB,EAAE,KAAK;IACvB,GAAG,EAAE,KAAK;CACX,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,SAAgB,oBAAoB,CAAC,OAAqB,MAAM;IAC9D,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACpB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;QACzC,OAAO,CAAC,GAAG,CAAC,WAAW,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;QAC5C,IAAI,CAAC;YACH,OAAO,IAAI,uCAAiB,EAAE,CAAC;QACjC,CAAC;gBAAS,CAAC;YACT,IAAI,QAAQ,KAAK,SAAS;gBAAE,OAAO,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;;gBACtD,OAAO,CAAC,GAAG,CAAC,WAAW,GAAG,QAAQ,CAAC;QAC1C,CAAC;IACH,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;QAC7B,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;YAC1C,qEAAqE;YACrE,uEAAuE;YACvE,oEAAoE;YACpE,mBAAmB;YACnB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB;gBAAE,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;YACnG,OAAO,CAAC,GAAG,CAAC,WAAW,GAAG,KAAK,CAAC;QAClC,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,WAAW,GAAG,KAAK,CAAC;QAClC,CAAC;IACH,CAAC;IACD,OAAO,IAAI,uCAAiB,EAAE,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface ShopifyCustomer {
|
|
2
|
+
shopifyId: string;
|
|
3
|
+
firstName?: string;
|
|
4
|
+
lastName?: string;
|
|
5
|
+
email?: string;
|
|
6
|
+
phone?: string;
|
|
7
|
+
acceptsMarketing: boolean;
|
|
8
|
+
createdAt?: string;
|
|
9
|
+
updatedAt?: string;
|
|
10
|
+
defaultAddressId?: string;
|
|
11
|
+
}
|
|
12
|
+
/** Fetch a customer by Shopify ID; `null` if missing. */
|
|
13
|
+
export declare function getCustomerById(siteName: string, customerId: string): Promise<ShopifyCustomer | null>;
|
|
14
|
+
/**
|
|
15
|
+
* Resolve a customer by email — used when the only identity available is an
|
|
16
|
+
* auth principal's email claim rather than a Shopify customer GID.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getCustomerByEmail(siteName: string, email: string): Promise<ShopifyCustomer | null>;
|
|
19
|
+
//# sourceMappingURL=customers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customers.d.ts","sourceRoot":"","sources":["../../src/customers.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAoCD,yDAAyD;AACzD,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAS3G;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAYzG"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCustomerById = getCustomerById;
|
|
4
|
+
exports.getCustomerByEmail = getCustomerByEmail;
|
|
5
|
+
const client_1 = require("./client");
|
|
6
|
+
const CUSTOMER_FIELDS = `
|
|
7
|
+
id
|
|
8
|
+
firstName
|
|
9
|
+
lastName
|
|
10
|
+
email
|
|
11
|
+
phone
|
|
12
|
+
emailMarketingConsent { marketingState }
|
|
13
|
+
createdAt
|
|
14
|
+
updatedAt
|
|
15
|
+
defaultAddress { id }
|
|
16
|
+
`;
|
|
17
|
+
function toAcceptsMarketing(node) {
|
|
18
|
+
return node.emailMarketingConsent?.marketingState === 'SUBSCRIBED';
|
|
19
|
+
}
|
|
20
|
+
function normalizeCustomerId(customerId) {
|
|
21
|
+
return customerId.startsWith('gid://shopify/Customer/') ? customerId : `gid://shopify/Customer/${customerId}`;
|
|
22
|
+
}
|
|
23
|
+
function mapCustomer(node) {
|
|
24
|
+
return {
|
|
25
|
+
shopifyId: node.id,
|
|
26
|
+
firstName: node.firstName ?? undefined,
|
|
27
|
+
lastName: node.lastName ?? undefined,
|
|
28
|
+
email: node.email ?? undefined,
|
|
29
|
+
phone: node.phone ?? undefined,
|
|
30
|
+
acceptsMarketing: toAcceptsMarketing(node),
|
|
31
|
+
createdAt: node.createdAt,
|
|
32
|
+
updatedAt: node.updatedAt,
|
|
33
|
+
defaultAddressId: node.defaultAddress?.id ?? undefined,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/** Fetch a customer by Shopify ID; `null` if missing. */
|
|
37
|
+
async function getCustomerById(siteName, customerId) {
|
|
38
|
+
const query = `
|
|
39
|
+
query GetCustomer($id: ID!) {
|
|
40
|
+
customer(id: $id) { ${CUSTOMER_FIELDS} }
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
43
|
+
const data = await (0, client_1.adminGraphql)(siteName, query, { id: normalizeCustomerId(customerId) });
|
|
44
|
+
return data.customer ? mapCustomer(data.customer) : null;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Resolve a customer by email — used when the only identity available is an
|
|
48
|
+
* auth principal's email claim rather than a Shopify customer GID.
|
|
49
|
+
*/
|
|
50
|
+
async function getCustomerByEmail(siteName, email) {
|
|
51
|
+
const query = `
|
|
52
|
+
query CustomerByEmail($query: String!) {
|
|
53
|
+
customers(first: 1, query: $query) {
|
|
54
|
+
nodes { ${CUSTOMER_FIELDS} }
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
58
|
+
const data = await (0, client_1.adminGraphql)(siteName, query, { query: `email:${email}` });
|
|
59
|
+
const customer = data.customers.nodes[0];
|
|
60
|
+
return customer ? mapCustomer(customer) : null;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=customers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customers.js","sourceRoot":"","sources":["../../src/customers.ts"],"names":[],"mappings":";;AAiDA,0CASC;AAMD,gDAYC;AA5ED,qCAAwC;AAcxC,MAAM,eAAe,GAAG;;;;;;;;;;CAUvB,CAAC;AAEF,SAAS,kBAAkB,CAAC,IAA6D;IACvF,OAAO,IAAI,CAAC,qBAAqB,EAAE,cAAc,KAAK,YAAY,CAAC;AACrE,CAAC;AAED,SAAS,mBAAmB,CAAC,UAAkB;IAC7C,OAAO,UAAU,CAAC,UAAU,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,0BAA0B,UAAU,EAAE,CAAC;AAChH,CAAC;AAED,SAAS,WAAW,CAAC,IAAS;IAC5B,OAAO;QACL,SAAS,EAAE,IAAI,CAAC,EAAE;QAClB,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,SAAS;QACtC,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,SAAS;QACpC,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,SAAS;QAC9B,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,SAAS;QAC9B,gBAAgB,EAAE,kBAAkB,CAAC,IAAI,CAAC;QAC1C,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,gBAAgB,EAAE,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,SAAS;KACvD,CAAC;AACJ,CAAC;AAED,yDAAyD;AAClD,KAAK,UAAU,eAAe,CAAC,QAAgB,EAAE,UAAkB;IACxE,MAAM,KAAK,GAAG;;4BAEY,eAAe;;GAExC,CAAC;IAEF,MAAM,IAAI,GAAG,MAAM,IAAA,qBAAY,EAAoB,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,mBAAmB,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAC7G,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC3D,CAAC;AAED;;;GAGG;AACI,KAAK,UAAU,kBAAkB,CAAC,QAAgB,EAAE,KAAa;IACtE,MAAM,KAAK,GAAG;;;kBAGE,eAAe;;;GAG9B,CAAC;IAEF,MAAM,IAAI,GAAG,MAAM,IAAA,qBAAY,EAAkC,QAAQ,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,KAAK,EAAE,EAAE,CAAC,CAAC;IAC/G,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACzC,OAAO,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare class ShopifyAdapterError extends Error {
|
|
2
|
+
readonly details?: Record<string, unknown> | undefined;
|
|
3
|
+
constructor(message: string, details?: Record<string, unknown> | undefined);
|
|
4
|
+
}
|
|
5
|
+
export declare class ShopifyNotFoundError extends ShopifyAdapterError {
|
|
6
|
+
constructor(message?: string, details?: Record<string, unknown>);
|
|
7
|
+
}
|
|
8
|
+
export interface ShopifyUserError {
|
|
9
|
+
field?: string[];
|
|
10
|
+
message: string;
|
|
11
|
+
}
|
|
12
|
+
/** A Shopify mutation returned field-level `userErrors` (e.g. an invalid merchandiseId). */
|
|
13
|
+
export declare class ShopifyUserErrorsError extends ShopifyAdapterError {
|
|
14
|
+
readonly userErrors: ShopifyUserError[];
|
|
15
|
+
constructor(message: string, userErrors: ShopifyUserError[]);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,mBAAoB,SAAQ,KAAK;aAG1B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;gBADjD,OAAO,EAAE,MAAM,EACC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,YAAA;CAOpD;AAED,qBAAa,oBAAqB,SAAQ,mBAAmB;gBAC/C,OAAO,SAAc,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAIrE;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,4FAA4F;AAC5F,qBAAa,sBAAuB,SAAQ,mBAAmB;aAG3C,UAAU,EAAE,gBAAgB,EAAE;gBAD9C,OAAO,EAAE,MAAM,EACC,UAAU,EAAE,gBAAgB,EAAE;CAKjD"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ShopifyUserErrorsError = exports.ShopifyNotFoundError = exports.ShopifyAdapterError = void 0;
|
|
4
|
+
class ShopifyAdapterError extends Error {
|
|
5
|
+
details;
|
|
6
|
+
constructor(message, details) {
|
|
7
|
+
super(message);
|
|
8
|
+
this.details = details;
|
|
9
|
+
this.name = 'ShopifyAdapterError';
|
|
10
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
11
|
+
Error.captureStackTrace(this);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.ShopifyAdapterError = ShopifyAdapterError;
|
|
15
|
+
class ShopifyNotFoundError extends ShopifyAdapterError {
|
|
16
|
+
constructor(message = 'Not found', details) {
|
|
17
|
+
super(message, details);
|
|
18
|
+
this.name = 'ShopifyNotFoundError';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.ShopifyNotFoundError = ShopifyNotFoundError;
|
|
22
|
+
/** A Shopify mutation returned field-level `userErrors` (e.g. an invalid merchandiseId). */
|
|
23
|
+
class ShopifyUserErrorsError extends ShopifyAdapterError {
|
|
24
|
+
userErrors;
|
|
25
|
+
constructor(message, userErrors) {
|
|
26
|
+
super(message, { userErrors });
|
|
27
|
+
this.userErrors = userErrors;
|
|
28
|
+
this.name = 'ShopifyUserErrorsError';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.ShopifyUserErrorsError = ShopifyUserErrorsError;
|
|
32
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":";;;AAAA,MAAa,mBAAoB,SAAQ,KAAK;IAG1B;IAFlB,YACE,OAAe,EACC,OAAiC;QAEjD,KAAK,CAAC,OAAO,CAAC,CAAC;QAFC,YAAO,GAAP,OAAO,CAA0B;QAGjD,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QAClC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAClD,KAAK,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;CACF;AAVD,kDAUC;AAED,MAAa,oBAAqB,SAAQ,mBAAmB;IAC3D,YAAY,OAAO,GAAG,WAAW,EAAE,OAAiC;QAClE,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AALD,oDAKC;AAOD,4FAA4F;AAC5F,MAAa,sBAAuB,SAAQ,mBAAmB;IAG3C;IAFlB,YACE,OAAe,EACC,UAA8B;QAE9C,KAAK,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;QAFf,eAAU,GAAV,UAAU,CAAoB;QAG9C,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;IACvC,CAAC;CACF;AARD,wDAQC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Request } from 'express';
|
|
2
|
+
/**
|
|
3
|
+
* Extracts and normalizes site name from request headers.
|
|
4
|
+
* Priority: sitename > sitehost > hostname
|
|
5
|
+
* Header 'sitename: KIWI' or 'sitehost: kiwi.hcl-x.com' => 'KIWI'
|
|
6
|
+
* Used to build Secret Manager keys: KIWI_SHOPIFY_STORE_DOMAIN
|
|
7
|
+
*/
|
|
8
|
+
export declare function extractSiteName(req: Request): string | null;
|
|
9
|
+
/**
|
|
10
|
+
* Builds a Secret Manager secret ID using the convention:
|
|
11
|
+
* ${SITENAME}_${PROVIDER}_${KEY}
|
|
12
|
+
* e.g. buildSecretId('KIWI', 'SHOPIFY', 'STORE_DOMAIN') => 'KIWI_SHOPIFY_STORE_DOMAIN'
|
|
13
|
+
*/
|
|
14
|
+
export declare function buildSecretId(siteName: string, provider: string, key: string): string;
|
|
15
|
+
//# sourceMappingURL=extract-site-name.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-site-name.d.ts","sourceRoot":"","sources":["../../src/extract-site-name.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvC;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAO3D;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAErF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.extractSiteName = extractSiteName;
|
|
4
|
+
exports.buildSecretId = buildSecretId;
|
|
5
|
+
/**
|
|
6
|
+
* Extracts and normalizes site name from request headers.
|
|
7
|
+
* Priority: sitename > sitehost > hostname
|
|
8
|
+
* Header 'sitename: KIWI' or 'sitehost: kiwi.hcl-x.com' => 'KIWI'
|
|
9
|
+
* Used to build Secret Manager keys: KIWI_SHOPIFY_STORE_DOMAIN
|
|
10
|
+
*/
|
|
11
|
+
function extractSiteName(req) {
|
|
12
|
+
const siteHeader = req.headers['sitename'] || req.headers['sitehost'] || req.hostname;
|
|
13
|
+
if (!siteHeader)
|
|
14
|
+
return null;
|
|
15
|
+
// 'kiwi.hcl-x.com' => 'KIWI'
|
|
16
|
+
return siteHeader.split('.')[0].toUpperCase();
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Builds a Secret Manager secret ID using the convention:
|
|
20
|
+
* ${SITENAME}_${PROVIDER}_${KEY}
|
|
21
|
+
* e.g. buildSecretId('KIWI', 'SHOPIFY', 'STORE_DOMAIN') => 'KIWI_SHOPIFY_STORE_DOMAIN'
|
|
22
|
+
*/
|
|
23
|
+
function buildSecretId(siteName, provider, key) {
|
|
24
|
+
return `${siteName}_${provider}_${key}`.toUpperCase();
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=extract-site-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-site-name.js","sourceRoot":"","sources":["../../src/extract-site-name.ts"],"names":[],"mappings":";;AAQA,0CAOC;AAOD,sCAEC;AAtBD;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,GAAY;IAC1C,MAAM,UAAU,GAAI,GAAG,CAAC,OAAO,CAAC,UAAU,CAAY,IAAK,GAAG,CAAC,OAAO,CAAC,UAAU,CAAY,IAAI,GAAG,CAAC,QAAQ,CAAC;IAE9G,IAAI,CAAC,UAAU;QAAE,OAAO,IAAI,CAAC;IAE7B,6BAA6B;IAC7B,OAAO,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AAChD,CAAC;AAED;;;;GAIG;AACH,SAAgB,aAAa,CAAC,QAAgB,EAAE,QAAgB,EAAE,GAAW;IAC3E,OAAO,GAAG,QAAQ,IAAI,QAAQ,IAAI,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import './tls-trust';
|
|
2
|
+
import { GraphQLClient, gql, ClientError } from 'graphql-request';
|
|
3
|
+
type ClientType = 'admin' | 'storefront';
|
|
4
|
+
/**
|
|
5
|
+
* Returns a cached GraphQL client for the given tenant and API type.
|
|
6
|
+
* admin → Shopify Admin API (uses adminApiAccessToken)
|
|
7
|
+
* storefront → Shopify Storefront API (uses storefrontPrivateToken)
|
|
8
|
+
*/
|
|
9
|
+
export declare function getGraphQLClient(siteName: string, type?: ClientType): Promise<GraphQLClient>;
|
|
10
|
+
/** Cached client keys (`siteName:type`), for debug/inspection endpoints — never includes tokens. */
|
|
11
|
+
export declare function getGraphQLClientCacheStats(): string[];
|
|
12
|
+
/** Clears cached GraphQL clients (call after tenant config changes). */
|
|
13
|
+
export declare function clearGraphQLClientCache(siteName?: string): void;
|
|
14
|
+
/** Re-exports for convenience */
|
|
15
|
+
export { gql, ClientError };
|
|
16
|
+
//# sourceMappingURL=graphql-client.d.ts.map
|