@platform-x-shp/shopify-adapter 0.10.0 → 0.12.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/dist/src/cart.d.ts +12 -0
- package/dist/src/cart.d.ts.map +1 -1
- package/dist/src/cart.js +36 -0
- package/dist/src/cart.js.map +1 -1
- package/dist/src/customer-account.d.ts +11 -0
- package/dist/src/customer-account.d.ts.map +1 -0
- package/dist/src/customer-account.js +95 -0
- package/dist/src/customer-account.js.map +1 -0
- package/dist/src/delivery-sso.d.ts +34 -7
- package/dist/src/delivery-sso.d.ts.map +1 -1
- package/dist/src/delivery-sso.js +94 -53
- package/dist/src/delivery-sso.js.map +1 -1
- package/dist/src/errors.d.ts +8 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/errors.js +13 -1
- package/dist/src/errors.js.map +1 -1
- package/dist/src/gateway-session.d.ts +38 -0
- package/dist/src/gateway-session.d.ts.map +1 -0
- package/dist/src/gateway-session.js +82 -0
- package/dist/src/gateway-session.js.map +1 -0
- package/dist/src/index.d.ts +10 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +34 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/my-account.d.ts +44 -0
- package/dist/src/my-account.d.ts.map +1 -0
- package/dist/src/my-account.js +280 -0
- package/dist/src/my-account.js.map +1 -0
- package/dist/src/redis-connector.d.ts +14 -0
- package/dist/src/redis-connector.d.ts.map +1 -1
- package/dist/src/redis-connector.js +60 -0
- package/dist/src/redis-connector.js.map +1 -1
- package/dist/src/shopify-oidc.d.ts +31 -0
- package/dist/src/shopify-oidc.d.ts.map +1 -0
- package/dist/src/shopify-oidc.js +80 -0
- package/dist/src/shopify-oidc.js.map +1 -0
- package/dist/src/shopify-session.d.ts +102 -0
- package/dist/src/shopify-session.d.ts.map +1 -0
- package/dist/src/shopify-session.js +317 -0
- package/dist/src/shopify-session.js.map +1 -0
- package/dist/src/tenant-config.d.ts.map +1 -1
- package/dist/src/tenant-config.js +3 -1
- package/dist/src/tenant-config.js.map +1 -1
- package/dist/src/tenant-types.d.ts +7 -0
- package/dist/src/tenant-types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/src/errors.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ShopifyUserErrorsError = exports.ShopifyNotFoundError = exports.ShopifyAdapterError = void 0;
|
|
3
|
+
exports.ShopifyCustomerTokenError = exports.ShopifyUserErrorsError = exports.ShopifyNotFoundError = exports.ShopifyAdapterError = void 0;
|
|
4
4
|
class ShopifyAdapterError extends Error {
|
|
5
5
|
details;
|
|
6
6
|
constructor(message, details) {
|
|
@@ -29,4 +29,16 @@ class ShopifyUserErrorsError extends ShopifyAdapterError {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
exports.ShopifyUserErrorsError = ShopifyUserErrorsError;
|
|
32
|
+
/**
|
|
33
|
+
* Shopify refused the visitor's Customer Account access token (revoked, expired earlier than its stated
|
|
34
|
+
* lifetime, or not valid for this call). The caller should refresh the session and retry once, then ask
|
|
35
|
+
* the visitor to sign in to Shopify again.
|
|
36
|
+
*/
|
|
37
|
+
class ShopifyCustomerTokenError extends ShopifyAdapterError {
|
|
38
|
+
constructor(message = 'Shopify rejected the customer access token', details) {
|
|
39
|
+
super(message, details);
|
|
40
|
+
this.name = 'ShopifyCustomerTokenError';
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.ShopifyCustomerTokenError = ShopifyCustomerTokenError;
|
|
32
44
|
//# sourceMappingURL=errors.js.map
|
package/dist/src/errors.js.map
CHANGED
|
@@ -1 +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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AiC;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;AAED;;;;GAIG;AACH,MAAa,yBAA0B,SAAQ,mBAAmB;IAChE,YAAY,OAAO,GAAG,4CAA4C,EAAE,OAAiC;QACnG,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;IAC1C,CAAC;CACF;AALD,8DAKC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read-only access to the delivery gateway's `express-session` record, so a
|
|
3
|
+
* backend behind the gateway can learn who the logged-in user is from the
|
|
4
|
+
* forwarded `platform-x-session` cookie instead of trusting plain headers.
|
|
5
|
+
*
|
|
6
|
+
* Deliberately not `express-session` itself: that middleware resets the
|
|
7
|
+
* record's TTL on every response, and this service must never write to the
|
|
8
|
+
* gateway's session. This only verifies the cookie signature and does one
|
|
9
|
+
* Redis GET.
|
|
10
|
+
*/
|
|
11
|
+
export interface GatewaySessionConfig {
|
|
12
|
+
/** Cookie name, `platform-x-session` at the gateway. */
|
|
13
|
+
cookieName: string;
|
|
14
|
+
/** Gateway cookie secret(s). More than one allows secret rotation; the first is the current one. */
|
|
15
|
+
secrets: string[];
|
|
16
|
+
/** Redis key prefix of the gateway's session store, `platform-x-session:` at the gateway. */
|
|
17
|
+
prefix: string;
|
|
18
|
+
}
|
|
19
|
+
export interface GatewaySession {
|
|
20
|
+
/** The gateway session id, the unsigned cookie value. */
|
|
21
|
+
sessionId: string;
|
|
22
|
+
/** `session.userInfo` as the gateway stores it after Keycloak login. */
|
|
23
|
+
userInfo?: Record<string, unknown>;
|
|
24
|
+
/** `session.token` as the gateway stores it (Keycloak access token and expiry). */
|
|
25
|
+
token?: Record<string, unknown>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Same check as `cookie-signature`'s `unsign`: the value is `s:<id>.<sig>` and
|
|
29
|
+
* `<sig>` is the base64 HMAC-SHA256 of `<id>`, without padding.
|
|
30
|
+
*/
|
|
31
|
+
export declare function unsignGatewayCookie(rawValue: string, secrets: string[]): string | null;
|
|
32
|
+
/**
|
|
33
|
+
* Returns the gateway session for a request's `Cookie` header, or `null` when
|
|
34
|
+
* there is no cookie, the signature is wrong, or no record exists. Throws
|
|
35
|
+
* {@link ShopifySessionUnavailableError} only when Redis cannot be read.
|
|
36
|
+
*/
|
|
37
|
+
export declare function readGatewaySession(cookieHeader: string | undefined, config: GatewaySessionConfig): Promise<GatewaySession | null>;
|
|
38
|
+
//# sourceMappingURL=gateway-session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateway-session.d.ts","sourceRoot":"","sources":["../../src/gateway-session.ts"],"names":[],"mappings":"AAKA;;;;;;;;;GASG;AAEH,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,UAAU,EAAE,MAAM,CAAC;IACnB,oGAAoG;IACpG,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,6FAA6F;IAC7F,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,yDAAyD;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,mFAAmF;IACnF,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAwBD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAatF;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAmBhC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.unsignGatewayCookie = unsignGatewayCookie;
|
|
7
|
+
exports.readGatewaySession = readGatewaySession;
|
|
8
|
+
const node_crypto_1 = __importDefault(require("node:crypto"));
|
|
9
|
+
const redis_connector_1 = require("./redis-connector");
|
|
10
|
+
const shopify_session_1 = require("./shopify-session");
|
|
11
|
+
function parseCookie(header, name) {
|
|
12
|
+
if (!header)
|
|
13
|
+
return undefined;
|
|
14
|
+
for (const part of header.split(';')) {
|
|
15
|
+
const index = part.indexOf('=');
|
|
16
|
+
if (index < 0)
|
|
17
|
+
continue;
|
|
18
|
+
if (part.slice(0, index).trim() === name)
|
|
19
|
+
return part.slice(index + 1).trim();
|
|
20
|
+
}
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
function safeDecode(value) {
|
|
24
|
+
try {
|
|
25
|
+
return decodeURIComponent(value);
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return value;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function signature(sessionId, secret) {
|
|
32
|
+
return node_crypto_1.default.createHmac('sha256', secret).update(sessionId).digest('base64').replace(/=+$/, '');
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Same check as `cookie-signature`'s `unsign`: the value is `s:<id>.<sig>` and
|
|
36
|
+
* `<sig>` is the base64 HMAC-SHA256 of `<id>`, without padding.
|
|
37
|
+
*/
|
|
38
|
+
function unsignGatewayCookie(rawValue, secrets) {
|
|
39
|
+
const value = safeDecode(rawValue);
|
|
40
|
+
if (!value.startsWith('s:'))
|
|
41
|
+
return null;
|
|
42
|
+
const signed = value.slice(2);
|
|
43
|
+
const dot = signed.lastIndexOf('.');
|
|
44
|
+
if (dot <= 0)
|
|
45
|
+
return null;
|
|
46
|
+
const sessionId = signed.slice(0, dot);
|
|
47
|
+
const given = Buffer.from(signed.slice(dot + 1));
|
|
48
|
+
for (const secret of secrets) {
|
|
49
|
+
const expected = Buffer.from(signature(sessionId, secret));
|
|
50
|
+
if (given.length === expected.length && node_crypto_1.default.timingSafeEqual(given, expected))
|
|
51
|
+
return sessionId;
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Returns the gateway session for a request's `Cookie` header, or `null` when
|
|
57
|
+
* there is no cookie, the signature is wrong, or no record exists. Throws
|
|
58
|
+
* {@link ShopifySessionUnavailableError} only when Redis cannot be read.
|
|
59
|
+
*/
|
|
60
|
+
async function readGatewaySession(cookieHeader, config) {
|
|
61
|
+
if (config.secrets.length === 0)
|
|
62
|
+
return null;
|
|
63
|
+
const raw = parseCookie(cookieHeader, config.cookieName);
|
|
64
|
+
if (!raw)
|
|
65
|
+
return null;
|
|
66
|
+
const sessionId = unsignGatewayCookie(raw, config.secrets);
|
|
67
|
+
if (!sessionId)
|
|
68
|
+
return null;
|
|
69
|
+
let record;
|
|
70
|
+
try {
|
|
71
|
+
record = (await (0, redis_connector_1.getRedisValueStrict)(`${config.prefix}${sessionId}`, true));
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
if (err instanceof redis_connector_1.RedisUnavailableError)
|
|
75
|
+
throw new shopify_session_1.ShopifySessionUnavailableError('Session store is unavailable');
|
|
76
|
+
throw err;
|
|
77
|
+
}
|
|
78
|
+
if (!record)
|
|
79
|
+
return null;
|
|
80
|
+
return { sessionId, userInfo: record.userInfo, token: record.token };
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=gateway-session.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateway-session.js","sourceRoot":"","sources":["../../src/gateway-session.ts"],"names":[],"mappings":";;;;;AA4DA,kDAaC;AAOD,gDAsBC;AAtGD,8DAAiC;AAEjC,uDAA+E;AAC/E,uDAAmE;AA+BnE,SAAS,WAAW,CAAC,MAA0B,EAAE,IAAY;IAC3D,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IAC9B,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QACrC,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAChC,IAAI,KAAK,GAAG,CAAC;YAAE,SAAS;QACxB,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAChF,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,UAAU,CAAC,KAAa;IAC/B,IAAI,CAAC;QACH,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,SAAS,SAAS,CAAC,SAAiB,EAAE,MAAc;IAClD,OAAO,qBAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACnG,C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,CAAC,OAAO,CAAC,CAAC;IAC3D,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAE5B,IAAI,MAAsF,CAAC;IAC3F,IAAI,CAAC;QACH,MAAM,GAAG,CAAC,MAAM,IAAA,qCAAmB,EACjC,GAAG,MAAM,CAAC,MAAM,GAAG,SAAS,EAAE,EAC9B,IAAI,CACL,CAAkB,CAAC;IACtB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,uCAAqB;YAAE,MAAM,IAAI,gDAA8B,CAAC,8BAA8B,CAAC,CAAC;QACnH,MAAM,GAAG,CAAC;IACZ,CAAC;IACD,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC;AACvE,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -18,11 +18,13 @@
|
|
|
18
18
|
*/
|
|
19
19
|
export { adminGraphql, storefrontGraphql } from './client';
|
|
20
20
|
export type { ShopifyApiType } from './client';
|
|
21
|
-
export { ShopifyAdapterError, ShopifyNotFoundError, ShopifyUserErrorsError } from './errors';
|
|
21
|
+
export { ShopifyAdapterError, ShopifyNotFoundError, ShopifyUserErrorsError, ShopifyCustomerTokenError } from './errors';
|
|
22
|
+
export { customerAccountGraphql, customerAccountEndpoint } from './customer-account';
|
|
23
|
+
export { getMyCustomer, updateMyCustomer, listMyAddresses, getMyAddress, createMyAddress, updateMyAddress, deleteMyAddress, setMyDefaultAddress, listMyOrders, getMyOrder, } from './my-account';
|
|
22
24
|
export type { ShopifyUserError } from './errors';
|
|
23
25
|
export { fetchProducts, fetchProductById, fetchProductByIdOrThrow, fetchProductByHandle, searchProducts, getProductFilters, fetchProductVariants, fetchVariantById, fetchVariantInventory, fetchProductMedia, fetchCollections, fetchCollectionById, fetchCollectionProducts, } from './products';
|
|
24
26
|
export type { ShopifyProduct, ProductsPage, PageInfo, ShopifyProductVariant, ShopifyProductMedia, InventoryByLocation, VariantInventory, ShopifyCollection, CollectionsPage, FilterOptions, } from './products';
|
|
25
|
-
export { createCart, getCart, addCartLines, updateCartLines, removeCartLines, linkCartToCustomer, } from './cart';
|
|
27
|
+
export { createCart, getCart, addCartLines, updateCartLines, removeCartLines, linkCartToCustomer, linkCartToCustomerAccount, } from './cart';
|
|
26
28
|
export type { ShopifyCart, ShopifyCartLine, ShopifyMoney, CartLineInput, CartLineUpdateInput } from './cart';
|
|
27
29
|
export { listOrders, getOrderById, updateOrder, cancelOrder, closeOrder, reopenOrder, captureOrderPayment, markOrderAsPaid, calculateRefund, createRefund, createDraftOrder, getDraftOrder, completeDraftOrder, sendDraftOrderInvoice, } from './orders';
|
|
28
30
|
export type { ShopifyOrder, ShopifyOrderSummary, ShopifyOrderLineItem, ShopifyOrderAddress, OrdersPage, OrdersPageInfo, OrderUpdateInput, OrderCancelInput, OrderCancelResult, OrderCaptureInput, ShopifyOrderTransaction, RefundLineItemInput, CalculateRefundInput, SuggestedRefund, SuggestedRefundLineItem, RefundInput, ShopifyRefund, DraftOrderLineItemInput, DraftOrderInput, ShopifyDraftOrder, DraftOrderCompleteInput, EmailInput, } from './orders';
|
|
@@ -47,8 +49,12 @@ export { extractBearer, verifyKeycloakToken, keycloakConfigForTenant, requireKey
|
|
|
47
49
|
export type { KeycloakTokenPayload, KeycloakVerifyConfig } from './keycloak-auth';
|
|
48
50
|
export { signPlatformXToken, verifyPlatformXToken, platformXConfigForTenant, platformXSigningConfigForTenant, requirePlatformXAuth, } from './platformx-auth';
|
|
49
51
|
export type { PlatformXTokenPayload, PlatformXSigningConfig, PlatformXVerifyConfig } from './platformx-auth';
|
|
50
|
-
export { beginDeliverySso, handleShopifyOAuthCallback, mintShopifySession, logoutShopifySession, errorReturnUrl, requireCsrfHeader, sessionCors, HttpError, SESSION_COOKIE_NAME, SESSION_TTL_SECONDS, } from './delivery-sso';
|
|
51
|
-
export type { DeliverySsoConfig, MintedSession } from './delivery-sso';
|
|
52
|
+
export { beginDeliverySso, handleShopifyOAuthCallback, mintShopifySession, logoutShopifySession, errorReturnUrl, requireCsrfHeader, sessionCors, HttpError, SESSION_COOKIE_NAME, SESSION_TTL_SECONDS, EMAIL_MISMATCH_ERROR, } from './delivery-sso';
|
|
53
|
+
export type { DeliverySsoConfig, MintedSession, GatewaySessionIdentity } from './delivery-sso';
|
|
54
|
+
export { validateShopifySession, refreshShopifySessionAfterRejection, ensureShopifySession, endShopifySession, getShopifySession, saveShopifySession, deleteShopifySession, shopifySessionKey, resolveSessionSettings, ShopifySessionUnavailableError, } from './shopify-session';
|
|
55
|
+
export { readGatewaySession, unsignGatewayCookie } from './gateway-session';
|
|
56
|
+
export type { GatewaySession, GatewaySessionConfig } from './gateway-session';
|
|
57
|
+
export type { ShopifySessionRecord, ShopifySessionValidation, EnsureShopifySessionResult, ShopifySessionSettings, } from './shopify-session';
|
|
52
58
|
export { Logger } from './utils/logger';
|
|
53
59
|
export type { LoggerInterface } from './utils/logger';
|
|
54
60
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC3D,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC3D,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mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,YAAY,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9E,YAAY,EACV,oBAAoB,EACpB,wBAAwB,EACxB,0BAA0B,EAC1B,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -18,8 +18,9 @@
|
|
|
18
18
|
* shopify-adapter stack.
|
|
19
19
|
*/
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.
|
|
22
|
-
exports.
|
|
21
|
+
exports.getDraftOrder = exports.createDraftOrder = exports.createRefund = exports.calculateRefund = exports.markOrderAsPaid = exports.captureOrderPayment = exports.reopenOrder = exports.closeOrder = exports.cancelOrder = exports.updateOrder = exports.getOrderById = exports.listOrders = exports.linkCartToCustomerAccount = exports.linkCartToCustomer = exports.removeCartLines = exports.updateCartLines = exports.addCartLines = exports.getCart = exports.createCart = exports.fetchCollectionProducts = exports.fetchCollectionById = exports.fetchCollections = exports.fetchProductMedia = exports.fetchVariantInventory = exports.fetchVariantById = exports.fetchProductVariants = exports.getProductFilters = exports.searchProducts = exports.fetchProductByHandle = exports.fetchProductByIdOrThrow = exports.fetchProductById = exports.fetchProducts = exports.getMyOrder = exports.listMyOrders = exports.setMyDefaultAddress = exports.deleteMyAddress = exports.updateMyAddress = exports.createMyAddress = exports.getMyAddress = exports.listMyAddresses = exports.updateMyCustomer = exports.getMyCustomer = exports.customerAccountEndpoint = exports.customerAccountGraphql = exports.ShopifyCustomerTokenError = exports.ShopifyUserErrorsError = exports.ShopifyNotFoundError = exports.ShopifyAdapterError = exports.storefrontGraphql = exports.adminGraphql = void 0;
|
|
22
|
+
exports.handleShopifyOAuthCallback = exports.beginDeliverySso = exports.requirePlatformXAuth = exports.platformXSigningConfigForTenant = exports.platformXConfigForTenant = exports.verifyPlatformXToken = exports.signPlatformXToken = exports.requireKeycloakAuth = exports.keycloakConfigForTenant = exports.verifyKeycloakToken = exports.extractBearer = exports.UnauthorizedError = exports.TokenInvalidError = exports.TokenExpiredError = exports.SecretNotFoundError = exports.TenantNotFoundError = exports.CircuitOpenError = exports.TimeoutError = exports.CircuitBreaker = exports.withTimeout = exports.withRetry = exports.ClientError = exports.gql = exports.clearGraphQLClientCache = exports.getGraphQLClient = exports.HepSecretProvider = exports.createConfigProvider = exports.buildSecretId = exports.extractSiteName = exports.getClientTenantDetails = exports.setConfigProvider = exports.clearTenantCache = exports.getActiveCommerceProvider = exports.getTenantConfig = exports.registerShopifyWebhooks = exports.createShopifyWebhookRouter = exports.shopifyTopicToRoutingKey = exports.ORDER_WEBHOOK_TOPICS = exports.cartCreatedEvent = exports.setDefaultCustomerAddress = exports.deleteCustomerAddress = exports.updateCustomerAddress = exports.createCustomerAddress = exports.getCustomerAddress = exports.listCustomerAddresses = exports.updateCustomer = exports.getCustomerByEmail = exports.getCustomerById = exports.sendDraftOrderInvoice = exports.completeDraftOrder = void 0;
|
|
23
|
+
exports.Logger = exports.unsignGatewayCookie = exports.readGatewaySession = exports.ShopifySessionUnavailableError = exports.resolveSessionSettings = exports.shopifySessionKey = exports.deleteShopifySession = exports.saveShopifySession = exports.getShopifySession = exports.endShopifySession = exports.ensureShopifySession = exports.refreshShopifySessionAfterRejection = exports.validateShopifySession = exports.EMAIL_MISMATCH_ERROR = exports.SESSION_TTL_SECONDS = exports.SESSION_COOKIE_NAME = exports.HttpError = exports.sessionCors = exports.requireCsrfHeader = exports.errorReturnUrl = exports.logoutShopifySession = exports.mintShopifySession = void 0;
|
|
23
24
|
var client_1 = require("./client");
|
|
24
25
|
Object.defineProperty(exports, "adminGraphql", { enumerable: true, get: function () { return client_1.adminGraphql; } });
|
|
25
26
|
Object.defineProperty(exports, "storefrontGraphql", { enumerable: true, get: function () { return client_1.storefrontGraphql; } });
|
|
@@ -27,6 +28,21 @@ var errors_1 = require("./errors");
|
|
|
27
28
|
Object.defineProperty(exports, "ShopifyAdapterError", { enumerable: true, get: function () { return errors_1.ShopifyAdapterError; } });
|
|
28
29
|
Object.defineProperty(exports, "ShopifyNotFoundError", { enumerable: true, get: function () { return errors_1.ShopifyNotFoundError; } });
|
|
29
30
|
Object.defineProperty(exports, "ShopifyUserErrorsError", { enumerable: true, get: function () { return errors_1.ShopifyUserErrorsError; } });
|
|
31
|
+
Object.defineProperty(exports, "ShopifyCustomerTokenError", { enumerable: true, get: function () { return errors_1.ShopifyCustomerTokenError; } });
|
|
32
|
+
var customer_account_1 = require("./customer-account");
|
|
33
|
+
Object.defineProperty(exports, "customerAccountGraphql", { enumerable: true, get: function () { return customer_account_1.customerAccountGraphql; } });
|
|
34
|
+
Object.defineProperty(exports, "customerAccountEndpoint", { enumerable: true, get: function () { return customer_account_1.customerAccountEndpoint; } });
|
|
35
|
+
var my_account_1 = require("./my-account");
|
|
36
|
+
Object.defineProperty(exports, "getMyCustomer", { enumerable: true, get: function () { return my_account_1.getMyCustomer; } });
|
|
37
|
+
Object.defineProperty(exports, "updateMyCustomer", { enumerable: true, get: function () { return my_account_1.updateMyCustomer; } });
|
|
38
|
+
Object.defineProperty(exports, "listMyAddresses", { enumerable: true, get: function () { return my_account_1.listMyAddresses; } });
|
|
39
|
+
Object.defineProperty(exports, "getMyAddress", { enumerable: true, get: function () { return my_account_1.getMyAddress; } });
|
|
40
|
+
Object.defineProperty(exports, "createMyAddress", { enumerable: true, get: function () { return my_account_1.createMyAddress; } });
|
|
41
|
+
Object.defineProperty(exports, "updateMyAddress", { enumerable: true, get: function () { return my_account_1.updateMyAddress; } });
|
|
42
|
+
Object.defineProperty(exports, "deleteMyAddress", { enumerable: true, get: function () { return my_account_1.deleteMyAddress; } });
|
|
43
|
+
Object.defineProperty(exports, "setMyDefaultAddress", { enumerable: true, get: function () { return my_account_1.setMyDefaultAddress; } });
|
|
44
|
+
Object.defineProperty(exports, "listMyOrders", { enumerable: true, get: function () { return my_account_1.listMyOrders; } });
|
|
45
|
+
Object.defineProperty(exports, "getMyOrder", { enumerable: true, get: function () { return my_account_1.getMyOrder; } });
|
|
30
46
|
var products_1 = require("./products");
|
|
31
47
|
Object.defineProperty(exports, "fetchProducts", { enumerable: true, get: function () { return products_1.fetchProducts; } });
|
|
32
48
|
Object.defineProperty(exports, "fetchProductById", { enumerable: true, get: function () { return products_1.fetchProductById; } });
|
|
@@ -48,6 +64,7 @@ Object.defineProperty(exports, "addCartLines", { enumerable: true, get: function
|
|
|
48
64
|
Object.defineProperty(exports, "updateCartLines", { enumerable: true, get: function () { return cart_1.updateCartLines; } });
|
|
49
65
|
Object.defineProperty(exports, "removeCartLines", { enumerable: true, get: function () { return cart_1.removeCartLines; } });
|
|
50
66
|
Object.defineProperty(exports, "linkCartToCustomer", { enumerable: true, get: function () { return cart_1.linkCartToCustomer; } });
|
|
67
|
+
Object.defineProperty(exports, "linkCartToCustomerAccount", { enumerable: true, get: function () { return cart_1.linkCartToCustomerAccount; } });
|
|
51
68
|
var orders_1 = require("./orders");
|
|
52
69
|
Object.defineProperty(exports, "listOrders", { enumerable: true, get: function () { return orders_1.listOrders; } });
|
|
53
70
|
Object.defineProperty(exports, "getOrderById", { enumerable: true, get: function () { return orders_1.getOrderById; } });
|
|
@@ -134,6 +151,21 @@ Object.defineProperty(exports, "sessionCors", { enumerable: true, get: function
|
|
|
134
151
|
Object.defineProperty(exports, "HttpError", { enumerable: true, get: function () { return delivery_sso_1.HttpError; } });
|
|
135
152
|
Object.defineProperty(exports, "SESSION_COOKIE_NAME", { enumerable: true, get: function () { return delivery_sso_1.SESSION_COOKIE_NAME; } });
|
|
136
153
|
Object.defineProperty(exports, "SESSION_TTL_SECONDS", { enumerable: true, get: function () { return delivery_sso_1.SESSION_TTL_SECONDS; } });
|
|
154
|
+
Object.defineProperty(exports, "EMAIL_MISMATCH_ERROR", { enumerable: true, get: function () { return delivery_sso_1.EMAIL_MISMATCH_ERROR; } });
|
|
155
|
+
var shopify_session_1 = require("./shopify-session");
|
|
156
|
+
Object.defineProperty(exports, "validateShopifySession", { enumerable: true, get: function () { return shopify_session_1.validateShopifySession; } });
|
|
157
|
+
Object.defineProperty(exports, "refreshShopifySessionAfterRejection", { enumerable: true, get: function () { return shopify_session_1.refreshShopifySessionAfterRejection; } });
|
|
158
|
+
Object.defineProperty(exports, "ensureShopifySession", { enumerable: true, get: function () { return shopify_session_1.ensureShopifySession; } });
|
|
159
|
+
Object.defineProperty(exports, "endShopifySession", { enumerable: true, get: function () { return shopify_session_1.endShopifySession; } });
|
|
160
|
+
Object.defineProperty(exports, "getShopifySession", { enumerable: true, get: function () { return shopify_session_1.getShopifySession; } });
|
|
161
|
+
Object.defineProperty(exports, "saveShopifySession", { enumerable: true, get: function () { return shopify_session_1.saveShopifySession; } });
|
|
162
|
+
Object.defineProperty(exports, "deleteShopifySession", { enumerable: true, get: function () { return shopify_session_1.deleteShopifySession; } });
|
|
163
|
+
Object.defineProperty(exports, "shopifySessionKey", { enumerable: true, get: function () { return shopify_session_1.shopifySessionKey; } });
|
|
164
|
+
Object.defineProperty(exports, "resolveSessionSettings", { enumerable: true, get: function () { return shopify_session_1.resolveSessionSettings; } });
|
|
165
|
+
Object.defineProperty(exports, "ShopifySessionUnavailableError", { enumerable: true, get: function () { return shopify_session_1.ShopifySessionUnavailableError; } });
|
|
166
|
+
var gateway_session_1 = require("./gateway-session");
|
|
167
|
+
Object.defineProperty(exports, "readGatewaySession", { enumerable: true, get: function () { return gateway_session_1.readGatewaySession; } });
|
|
168
|
+
Object.defineProperty(exports, "unsignGatewayCookie", { enumerable: true, get: function () { return gateway_session_1.unsignGatewayCookie; } });
|
|
137
169
|
var logger_1 = require("./utils/logger");
|
|
138
170
|
Object.defineProperty(exports, "Logger", { enumerable: true, get: function () { return logger_1.Logger; } });
|
|
139
171
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;AAEH,mCAA2D;AAAlD,sGAAA,YAAY,OAAA;AAAE,2GAAA,iBAAiB,OAAA;AAExC,mCAAwH;AAA/G,6GAAA,mBAAmB,OAAA;AAAE,8GAAA,oBAAoB,OAAA;AAAE,gHAAA,sBAAsB,OAAA;AAAE,mHAAA,yBAAyB,OAAA;AACrG,uDAAqF;AAA5E,0HAAA,sBAAsB,OAAA;AAAE,2HAAA,uBAAuB,OAAA;AACxD,2CAWsB;AAVpB,2GAAA,aAAa,OAAA;AACb,8GAAA,gBAAgB,OAAA;AAChB,6GAAA,eAAe,OAAA;AACf,0GAAA,YAAY,OAAA;AACZ,6GAAA,eAAe,OAAA;AACf,6GAAA,eAAe,OAAA;AACf,6GAAA,eAAe,OAAA;AACf,iHAAA,mBAAmB,OAAA;AACnB,0GAAA,YAAY,OAAA;AACZ,wGAAA,UAAU,OAAA;AAGZ,uCAcoB;AAblB,yGAAA,aAAa,OAAA;AACb,4GAAA,gBAAgB,OAAA;AAChB,mHAAA,uBAAuB,OAAA;AACvB,gHAAA,oBAAoB,OAAA;AACpB,0GAAA,cAAc,OAAA;AACd,6GAAA,iBAAiB,OAAA;AACjB,gHAAA,oBAAoB,OAAA;AACpB,4GAAA,gBAAgB,OAAA;AAChB,iHAAA,qBAAqB,OAAA;AACrB,6GAAA,iBAAiB,OAAA;AACjB,4GAAA,gBAAgB,OAAA;AAChB,+GAAA,mBAAmB,OAAA;AACnB,mHAAA,uBAAuB,OAAA;AAczB,+BAQgB;AAPd,kGAAA,UAAU,OAAA;AACV,+FAAA,OAAO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A;AAClB,uHAAA,oBAAoB,OAAA;AACpB,oHAAA,iBAAiB,OAAA;AACjB,yHAAA,sBAAsB,OAAA;AACtB,iIAAA,8BAA8B,OAAA;AAEhC,qDAA4E;AAAnE,qHAAA,kBAAkB,OAAA;AAAE,sHAAA,mBAAmB,OAAA;AAQhD,yCAAwC;AAA/B,gGAAA,MAAM,OAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { AddressInput, CustomerUpdateInput, ShopifyAddress, ShopifyCustomer } from './customers';
|
|
2
|
+
import type { OrdersPage, ShopifyOrder } from './orders';
|
|
3
|
+
/** The logged-in customer's own profile. */
|
|
4
|
+
export declare function getMyCustomer(siteName: string, accessToken: string): Promise<ShopifyCustomer>;
|
|
5
|
+
/**
|
|
6
|
+
* Updates the customer's name, phone and marketing consent.
|
|
7
|
+
*
|
|
8
|
+
* Their email is their login identity, so it cannot be changed here: passing a different one is rejected
|
|
9
|
+
* (passing the current one is ignored, so a form that always sends it still works).
|
|
10
|
+
*
|
|
11
|
+
* The Customer Account API has no mutation for the phone number, so a changed phone is written with the
|
|
12
|
+
* Admin API. The customer id for that call is read from the access token's own customer, never taken from
|
|
13
|
+
* the caller, so a customer can only ever change their own phone.
|
|
14
|
+
*/
|
|
15
|
+
export declare function updateMyCustomer(siteName: string, accessToken: string, input: CustomerUpdateInput): Promise<ShopifyCustomer>;
|
|
16
|
+
/** The customer's addresses, each flagged with whether it is their default. */
|
|
17
|
+
export declare function listMyAddresses(siteName: string, accessToken: string): Promise<ShopifyAddress[]>;
|
|
18
|
+
/** One of the customer's addresses by id (numeric or GID), or `null`. */
|
|
19
|
+
export declare function getMyAddress(siteName: string, accessToken: string, addressId: string): Promise<ShopifyAddress | null>;
|
|
20
|
+
/** Adds an address, optionally as the default. */
|
|
21
|
+
export declare function createMyAddress(siteName: string, accessToken: string, input: AddressInput): Promise<ShopifyAddress>;
|
|
22
|
+
/** Updates an address's fields, optionally making it the default. `null` if it is not one of the customer's addresses. */
|
|
23
|
+
export declare function updateMyAddress(siteName: string, accessToken: string, addressId: string, input: AddressInput): Promise<ShopifyAddress | null>;
|
|
24
|
+
/** Removes an address and returns its id, or `null` if it is not one of the customer's addresses. */
|
|
25
|
+
export declare function deleteMyAddress(siteName: string, accessToken: string, addressId: string): Promise<string | null>;
|
|
26
|
+
/** Makes an existing address the customer's default and returns the updated profile, or `null` if it does not exist. */
|
|
27
|
+
export declare function setMyDefaultAddress(siteName: string, accessToken: string, addressId: string): Promise<ShopifyCustomer | null>;
|
|
28
|
+
/**
|
|
29
|
+
* The customer's own orders, newest first, with cursor pagination. An optional Shopify search `query` only ever
|
|
30
|
+
* narrows the customer's own orders further: Shopify applies it inside the token's scope.
|
|
31
|
+
*/
|
|
32
|
+
export declare function listMyOrders(siteName: string, accessToken: string, opts?: {
|
|
33
|
+
first?: number;
|
|
34
|
+
after?: string;
|
|
35
|
+
query?: string;
|
|
36
|
+
}): Promise<OrdersPage>;
|
|
37
|
+
/**
|
|
38
|
+
* One of the customer's own orders, with line items. Throws `ShopifyNotFoundError` for an order that does
|
|
39
|
+
* not exist or belongs to someone else: Shopify does not distinguish them, and neither do we.
|
|
40
|
+
*
|
|
41
|
+
* The Customer Account API has no tags or archived flag on an order, so `tags` is empty and `closed` false.
|
|
42
|
+
*/
|
|
43
|
+
export declare function getMyOrder(siteName: string, accessToken: string, orderId: string): Promise<ShopifyOrder>;
|
|
44
|
+
//# sourceMappingURL=my-account.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"my-account.d.ts","sourceRoot":"","sources":["../../src/my-account.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEtG,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAuB,MAAM,UAAU,CAAC;AA6F9E,4CAA4C;AAC5C,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,E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