@platform-x-shp/shopify-adapter 0.7.0 → 0.8.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/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +12 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/products.d.ts +85 -0
- package/dist/src/products.d.ts.map +1 -1
- package/dist/src/products.js +315 -0
- package/dist/src/products.js.map +1 -1
- package/package.json +1 -1
package/dist/src/index.d.ts
CHANGED
|
@@ -20,8 +20,8 @@ export { adminGraphql, storefrontGraphql } from './client';
|
|
|
20
20
|
export type { ShopifyApiType } from './client';
|
|
21
21
|
export { ShopifyAdapterError, ShopifyNotFoundError, ShopifyUserErrorsError } from './errors';
|
|
22
22
|
export type { ShopifyUserError } from './errors';
|
|
23
|
-
export { fetchProducts, fetchProductById, fetchProductByIdOrThrow, } from './products';
|
|
24
|
-
export type { ShopifyProduct, ProductsPage, PageInfo } from './products';
|
|
23
|
+
export { fetchProducts, fetchProductById, fetchProductByIdOrThrow, fetchProductByHandle, searchProducts, getProductFilters, fetchProductVariants, fetchVariantById, fetchVariantInventory, fetchProductMedia, fetchCollections, fetchCollectionById, fetchCollectionProducts, } from './products';
|
|
24
|
+
export type { ShopifyProduct, ProductsPage, PageInfo, ShopifyProductVariant, ShopifyProductMedia, InventoryByLocation, VariantInventory, ShopifyCollection, CollectionsPage, FilterOptions, } from './products';
|
|
25
25
|
export { createCart, getCart, addCartLines, updateCartLines, removeCartLines, linkCartToCustomer, } from './cart';
|
|
26
26
|
export type { ShopifyCart, ShopifyCartLine, ShopifyMoney, CartLineInput, CartLineUpdateInput } from './cart';
|
|
27
27
|
export { listOrders, getOrderById, updateOrder, cancelOrder, closeOrder, reopenOrder, captureOrderPayment, markOrderAsPaid, calculateRefund, createRefund, createDraftOrder, getDraftOrder, completeDraftOrder, sendDraftOrderInvoice, } from './orders';
|
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;AAC7F,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,YAAY,CAAC;AACpB,YAAY,
|
|
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;AAC7F,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,UAAU,EACV,OAAO,EACP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,EAAE,MAAM,gBAAgB,CAAC;AAChG,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
* shopify-adapter stack.
|
|
19
19
|
*/
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.
|
|
22
|
-
exports.Logger = exports.SESSION_COOKIE_NAME = exports.createDeliverySsoRouter = 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 = void 0;
|
|
21
|
+
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 = 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.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.ShopifyUserErrorsError = exports.ShopifyNotFoundError = exports.ShopifyAdapterError = exports.storefrontGraphql = exports.adminGraphql = void 0;
|
|
22
|
+
exports.Logger = exports.SESSION_COOKIE_NAME = exports.createDeliverySsoRouter = 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.getTenantConfig = exports.registerShopifyWebhooks = exports.createShopifyWebhookRouter = void 0;
|
|
23
23
|
var client_1 = require("./client");
|
|
24
24
|
Object.defineProperty(exports, "adminGraphql", { enumerable: true, get: function () { return client_1.adminGraphql; } });
|
|
25
25
|
Object.defineProperty(exports, "storefrontGraphql", { enumerable: true, get: function () { return client_1.storefrontGraphql; } });
|
|
@@ -31,6 +31,16 @@ var products_1 = require("./products");
|
|
|
31
31
|
Object.defineProperty(exports, "fetchProducts", { enumerable: true, get: function () { return products_1.fetchProducts; } });
|
|
32
32
|
Object.defineProperty(exports, "fetchProductById", { enumerable: true, get: function () { return products_1.fetchProductById; } });
|
|
33
33
|
Object.defineProperty(exports, "fetchProductByIdOrThrow", { enumerable: true, get: function () { return products_1.fetchProductByIdOrThrow; } });
|
|
34
|
+
Object.defineProperty(exports, "fetchProductByHandle", { enumerable: true, get: function () { return products_1.fetchProductByHandle; } });
|
|
35
|
+
Object.defineProperty(exports, "searchProducts", { enumerable: true, get: function () { return products_1.searchProducts; } });
|
|
36
|
+
Object.defineProperty(exports, "getProductFilters", { enumerable: true, get: function () { return products_1.getProductFilters; } });
|
|
37
|
+
Object.defineProperty(exports, "fetchProductVariants", { enumerable: true, get: function () { return products_1.fetchProductVariants; } });
|
|
38
|
+
Object.defineProperty(exports, "fetchVariantById", { enumerable: true, get: function () { return products_1.fetchVariantById; } });
|
|
39
|
+
Object.defineProperty(exports, "fetchVariantInventory", { enumerable: true, get: function () { return products_1.fetchVariantInventory; } });
|
|
40
|
+
Object.defineProperty(exports, "fetchProductMedia", { enumerable: true, get: function () { return products_1.fetchProductMedia; } });
|
|
41
|
+
Object.defineProperty(exports, "fetchCollections", { enumerable: true, get: function () { return products_1.fetchCollections; } });
|
|
42
|
+
Object.defineProperty(exports, "fetchCollectionById", { enumerable: true, get: function () { return products_1.fetchCollectionById; } });
|
|
43
|
+
Object.defineProperty(exports, "fetchCollectionProducts", { enumerable: true, get: function () { return products_1.fetchCollectionProducts; } });
|
|
34
44
|
var cart_1 = require("./cart");
|
|
35
45
|
Object.defineProperty(exports, "createCart", { enumerable: true, get: function () { return cart_1.createCart; } });
|
|
36
46
|
Object.defineProperty(exports, "getCart", { enumerable: true, get: function () { return cart_1.getCart; } });
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,mCAA6F;AAApF,6GAAA,mBAAmB,OAAA;AAAE,8GAAA,oBAAoB,OAAA;AAAE,gHAAA,sBAAsB,OAAA;AAE1E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GrB,mDAM0B;AALxB,oHAAA,kBAAkB,OAAA;AAClB,sHAAA,oBAAoB,OAAA;AACpB,0HAAA,wBAAwB,OAAA;AACxB,iIAAA,+BAA+B,OAAA;AAC/B,sHAAA,oBAAoB,OAAA;AAGtB,+CAAgG;AAAvF,gHAAA,gBAAgB,OAAA;AAAE,uHAAA,uBAAuB,OAAA;AAAE,mHAAA,mBAAmB,OAAA;AAEvE,yCAAwC;AAA/B,gGAAA,MAAM,OAAA"}
|
package/dist/src/products.d.ts
CHANGED
|
@@ -22,10 +22,95 @@ export interface ProductsPage {
|
|
|
22
22
|
count: number;
|
|
23
23
|
pageInfo: PageInfo;
|
|
24
24
|
}
|
|
25
|
+
export interface ShopifyProductVariant {
|
|
26
|
+
shopifyId: string;
|
|
27
|
+
productId: string;
|
|
28
|
+
title: string;
|
|
29
|
+
sku?: string;
|
|
30
|
+
price: string;
|
|
31
|
+
compareAtPrice?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface ShopifyProductMedia {
|
|
34
|
+
id: string;
|
|
35
|
+
alt?: string;
|
|
36
|
+
type: 'IMAGE' | 'VIDEO' | 'EXTERNAL_VIDEO' | 'MODEL_3D';
|
|
37
|
+
url: string;
|
|
38
|
+
}
|
|
39
|
+
export interface InventoryByLocation {
|
|
40
|
+
locationId: string;
|
|
41
|
+
locationName: string;
|
|
42
|
+
available: number;
|
|
43
|
+
reserved: number;
|
|
44
|
+
}
|
|
45
|
+
export interface VariantInventory {
|
|
46
|
+
variantId: string;
|
|
47
|
+
sku?: string;
|
|
48
|
+
inventoryByLocation: InventoryByLocation[];
|
|
49
|
+
}
|
|
50
|
+
export interface ShopifyCollection {
|
|
51
|
+
shopifyId: string;
|
|
52
|
+
title: string;
|
|
53
|
+
handle: string;
|
|
54
|
+
description?: string;
|
|
55
|
+
image?: {
|
|
56
|
+
url: string;
|
|
57
|
+
alt?: string;
|
|
58
|
+
};
|
|
59
|
+
productsCount?: number;
|
|
60
|
+
updatedAtShopify?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface CollectionsPage {
|
|
63
|
+
items: ShopifyCollection[];
|
|
64
|
+
count: number;
|
|
65
|
+
pageInfo: PageInfo;
|
|
66
|
+
}
|
|
67
|
+
export interface FilterOptions {
|
|
68
|
+
vendors: string[];
|
|
69
|
+
tags: string[];
|
|
70
|
+
types: string[];
|
|
71
|
+
}
|
|
25
72
|
/** Fetch purchasable products with cursor pagination. */
|
|
26
73
|
export declare function fetchProducts(siteName: string, first?: number, after?: string): Promise<ProductsPage>;
|
|
27
74
|
/** Fetch a single purchasable product by Shopify ID; `null` if missing or not purchasable. */
|
|
28
75
|
export declare function fetchProductById(siteName: string, productId: string): Promise<ShopifyProduct | null>;
|
|
29
76
|
/** Throwing variant of {@link fetchProductById}, for callers that treat a miss as an error. */
|
|
30
77
|
export declare function fetchProductByIdOrThrow(siteName: string, productId: string): Promise<ShopifyProduct>;
|
|
78
|
+
/** Fetch a single purchasable product by handle (slug); `null` if missing or not purchasable. */
|
|
79
|
+
export declare function fetchProductByHandle(siteName: string, handle: string): Promise<ShopifyProduct | null>;
|
|
80
|
+
/**
|
|
81
|
+
* Searches purchasable products by a caller-supplied Shopify search query
|
|
82
|
+
* term, ANDed with the purchasable filter. Also backs FilterProducts — the
|
|
83
|
+
* legacy `filterProducts` just builds a vendor/tag/type query string into
|
|
84
|
+
* the same `products(query:)` call (see shp-product-service's
|
|
85
|
+
* `filterProducts`, which delegates straight to `searchProducts`).
|
|
86
|
+
*/
|
|
87
|
+
export declare function searchProducts(siteName: string, searchQuery: string, first?: number, after?: string): Promise<ProductsPage>;
|
|
88
|
+
/**
|
|
89
|
+
* Fetches up to 250 products' vendor/type/tags and dedupes them into the
|
|
90
|
+
* available filter facets. Ported as-is from shp-product-service's
|
|
91
|
+
* `getAvailableFilters`, including its known limitations: no purchasable
|
|
92
|
+
* filter (draft/archived products contribute facets too) and a hardcoded
|
|
93
|
+
* single-page cap (no pagination past 250 products). Backs GetProductFilters
|
|
94
|
+
* plus the derived GetProductTags/GetProductTypes/GetProductVendors.
|
|
95
|
+
*/
|
|
96
|
+
export declare function getProductFilters(siteName: string): Promise<FilterOptions>;
|
|
97
|
+
/**
|
|
98
|
+
* Fetch all variants for a purchasable product. A non-purchasable product's
|
|
99
|
+
* variants don't exist on the storefront, so the cart would reject them —
|
|
100
|
+
* returns `[]` rather than letting add-to-cart resolve a dead merchandiseId
|
|
101
|
+
* (same as shp-product-service's `fetchProductVariants`).
|
|
102
|
+
*/
|
|
103
|
+
export declare function fetchProductVariants(siteName: string, productId: string, first?: number): Promise<ShopifyProductVariant[]>;
|
|
104
|
+
/** Fetch a single variant by ID; `null` if missing. No purchasability gate — mirrors the legacy quirk. */
|
|
105
|
+
export declare function fetchVariantById(siteName: string, variantId: string): Promise<ShopifyProductVariant | null>;
|
|
106
|
+
/** Fetch inventory levels for a specific variant across all stock locations; `null` if missing. */
|
|
107
|
+
export declare function fetchVariantInventory(siteName: string, variantId: string): Promise<VariantInventory | null>;
|
|
108
|
+
/** Fetch media (images/external video) attached to a product. Only MediaImage/ExternalVideo are mapped — same as legacy. */
|
|
109
|
+
export declare function fetchProductMedia(siteName: string, productId: string, first?: number): Promise<ShopifyProductMedia[]>;
|
|
110
|
+
/** Fetch collections with cursor pagination. */
|
|
111
|
+
export declare function fetchCollections(siteName: string, first?: number, after?: string): Promise<CollectionsPage>;
|
|
112
|
+
/** Fetch a single collection by gid, numeric id, or handle; `null` if missing. */
|
|
113
|
+
export declare function fetchCollectionById(siteName: string, collectionId: string): Promise<ShopifyCollection | null>;
|
|
114
|
+
/** Fetch purchasable products in a collection, by gid, numeric id, or handle. */
|
|
115
|
+
export declare function fetchCollectionProducts(siteName: string, collectionId: string, first?: number, after?: string): Promise<ProductsPage>;
|
|
31
116
|
//# sourceMappingURL=products.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"products.d.ts","sourceRoot":"","sources":["../../src/products.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,cAA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qB,EAAE,CAAC,CAmClC;AAED,0GAA0G;AAC1G,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAsBjH;AAED,mGAAmG;AACnG,wBAAsB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAwBjH;AAED,4HAA4H;AAC5H,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,KAAK,SAAK,GACT,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAiChC;AAED,gDAAgD;AAChD,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,SAAK,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAkB7G;AAED,kFAAkF;AAClF,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAYnH;AAED,iFAAiF;AACjF,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,KAAK,SAAK,EACV,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,YAAY,CAAC,CA6BvB"}
|
package/dist/src/products.js
CHANGED
|
@@ -3,6 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.fetchProducts = fetchProducts;
|
|
4
4
|
exports.fetchProductById = fetchProductById;
|
|
5
5
|
exports.fetchProductByIdOrThrow = fetchProductByIdOrThrow;
|
|
6
|
+
exports.fetchProductByHandle = fetchProductByHandle;
|
|
7
|
+
exports.searchProducts = searchProducts;
|
|
8
|
+
exports.getProductFilters = getProductFilters;
|
|
9
|
+
exports.fetchProductVariants = fetchProductVariants;
|
|
10
|
+
exports.fetchVariantById = fetchVariantById;
|
|
11
|
+
exports.fetchVariantInventory = fetchVariantInventory;
|
|
12
|
+
exports.fetchProductMedia = fetchProductMedia;
|
|
13
|
+
exports.fetchCollections = fetchCollections;
|
|
14
|
+
exports.fetchCollectionById = fetchCollectionById;
|
|
15
|
+
exports.fetchCollectionProducts = fetchCollectionProducts;
|
|
6
16
|
const client_1 = require("./client");
|
|
7
17
|
const errors_1 = require("./errors");
|
|
8
18
|
// Only surface products a shopper can actually buy on the storefront: ACTIVE status
|
|
@@ -50,6 +60,69 @@ function mapProduct(node) {
|
|
|
50
60
|
function normalizeProductId(id) {
|
|
51
61
|
return id.startsWith('gid://shopify/Product/') ? id : `gid://shopify/Product/${id}`;
|
|
52
62
|
}
|
|
63
|
+
function normalizeVariantId(id) {
|
|
64
|
+
return id.startsWith('gid://shopify/ProductVariant/') ? id : `gid://shopify/ProductVariant/${id}`;
|
|
65
|
+
}
|
|
66
|
+
function normalizeCollectionId(id) {
|
|
67
|
+
return id.startsWith('gid://shopify/Collection/') ? id : `gid://shopify/Collection/${id}`;
|
|
68
|
+
}
|
|
69
|
+
function mapInventoryByLocation(levelEdges = []) {
|
|
70
|
+
return levelEdges
|
|
71
|
+
.map((edge) => {
|
|
72
|
+
const level = edge?.node;
|
|
73
|
+
const locationId = level?.location?.id;
|
|
74
|
+
const locationName = level?.location?.name;
|
|
75
|
+
if (!locationId || !locationName)
|
|
76
|
+
return null;
|
|
77
|
+
const quantities = Array.isArray(level?.quantities) ? level.quantities : [];
|
|
78
|
+
const available = quantities.find((q) => q?.name === 'available')?.quantity ?? 0;
|
|
79
|
+
const reserved = quantities.find((q) => q?.name === 'reserved')?.quantity ?? 0;
|
|
80
|
+
return { locationId, locationName, available, reserved };
|
|
81
|
+
})
|
|
82
|
+
.filter((item) => item !== null);
|
|
83
|
+
}
|
|
84
|
+
function mapCollection(node) {
|
|
85
|
+
return {
|
|
86
|
+
shopifyId: node.id,
|
|
87
|
+
title: node.title,
|
|
88
|
+
handle: node.handle,
|
|
89
|
+
description: node.description || undefined,
|
|
90
|
+
image: node.image ? { url: node.image.url, alt: node.image.altText } : undefined,
|
|
91
|
+
productsCount: node.productsCount?.count,
|
|
92
|
+
updatedAtShopify: node.updatedAt,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Resolves a caller-supplied collection id, numeric id, or handle to a real
|
|
97
|
+
* collection gid. Ported from shp-product-service's `resolveCollectionId` —
|
|
98
|
+
* `GetCollection`/`GetCollectionProducts` both accept any of the three forms.
|
|
99
|
+
*/
|
|
100
|
+
async function resolveCollectionId(siteName, idOrHandle) {
|
|
101
|
+
if (idOrHandle.startsWith('gid://shopify/Collection/'))
|
|
102
|
+
return idOrHandle;
|
|
103
|
+
if (/^\d+$/.test(idOrHandle))
|
|
104
|
+
return normalizeCollectionId(idOrHandle);
|
|
105
|
+
const query = `
|
|
106
|
+
query GetCollectionByHandle($handle: String!) {
|
|
107
|
+
collectionByHandle(handle: $handle) { id }
|
|
108
|
+
}
|
|
109
|
+
`;
|
|
110
|
+
const result = await (0, client_1.adminGraphql)(siteName, query, {
|
|
111
|
+
handle: idOrHandle,
|
|
112
|
+
});
|
|
113
|
+
return result.collectionByHandle?.id ?? null;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Combines a caller's product-search query with the purchasable filter. An
|
|
117
|
+
* empty or wildcard ('*') query means "all purchasable products" — mirrors
|
|
118
|
+
* shp-product-service's `buildPurchasableQuery`.
|
|
119
|
+
*/
|
|
120
|
+
function buildPurchasableQuery(userQuery) {
|
|
121
|
+
const q = (userQuery ?? '').trim();
|
|
122
|
+
if (!q || q === '*')
|
|
123
|
+
return PURCHASABLE_PRODUCT_QUERY;
|
|
124
|
+
return `(${q}) AND ${PURCHASABLE_PRODUCT_QUERY}`;
|
|
125
|
+
}
|
|
53
126
|
/** Fetch purchasable products with cursor pagination. */
|
|
54
127
|
async function fetchProducts(siteName, first = 50, after) {
|
|
55
128
|
const query = `
|
|
@@ -89,4 +162,246 @@ async function fetchProductByIdOrThrow(siteName, productId) {
|
|
|
89
162
|
}
|
|
90
163
|
return product;
|
|
91
164
|
}
|
|
165
|
+
/** Fetch a single purchasable product by handle (slug); `null` if missing or not purchasable. */
|
|
166
|
+
async function fetchProductByHandle(siteName, handle) {
|
|
167
|
+
const query = `
|
|
168
|
+
query GetProductByHandle($handle: String!) {
|
|
169
|
+
productByHandle(handle: $handle) { ${PRODUCT_FIELDS} }
|
|
170
|
+
}
|
|
171
|
+
`;
|
|
172
|
+
const result = await (0, client_1.adminGraphql)(siteName, query, { handle });
|
|
173
|
+
if (!result.productByHandle || !isPurchasable(result.productByHandle)) {
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
176
|
+
return mapProduct(result.productByHandle);
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Searches purchasable products by a caller-supplied Shopify search query
|
|
180
|
+
* term, ANDed with the purchasable filter. Also backs FilterProducts — the
|
|
181
|
+
* legacy `filterProducts` just builds a vendor/tag/type query string into
|
|
182
|
+
* the same `products(query:)` call (see shp-product-service's
|
|
183
|
+
* `filterProducts`, which delegates straight to `searchProducts`).
|
|
184
|
+
*/
|
|
185
|
+
async function searchProducts(siteName, searchQuery, first = 50, after) {
|
|
186
|
+
const query = `
|
|
187
|
+
query SearchProducts($query: String!, $first: Int!, $after: String) {
|
|
188
|
+
products(first: $first, after: $after, query: $query) {
|
|
189
|
+
edges { node { ${PRODUCT_FIELDS} } }
|
|
190
|
+
pageInfo { hasNextPage endCursor }
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
`;
|
|
194
|
+
const result = await (0, client_1.adminGraphql)(siteName, query, { query: buildPurchasableQuery(searchQuery), first, after });
|
|
195
|
+
return {
|
|
196
|
+
items: result.products.edges.map((e) => mapProduct(e.node)),
|
|
197
|
+
count: result.products.edges.length,
|
|
198
|
+
pageInfo: result.products.pageInfo,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Fetches up to 250 products' vendor/type/tags and dedupes them into the
|
|
203
|
+
* available filter facets. Ported as-is from shp-product-service's
|
|
204
|
+
* `getAvailableFilters`, including its known limitations: no purchasable
|
|
205
|
+
* filter (draft/archived products contribute facets too) and a hardcoded
|
|
206
|
+
* single-page cap (no pagination past 250 products). Backs GetProductFilters
|
|
207
|
+
* plus the derived GetProductTags/GetProductTypes/GetProductVendors.
|
|
208
|
+
*/
|
|
209
|
+
async function getProductFilters(siteName) {
|
|
210
|
+
const query = `
|
|
211
|
+
query GetAllFilters {
|
|
212
|
+
products(first: 250) {
|
|
213
|
+
edges { node { vendor productType tags } }
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
`;
|
|
217
|
+
const result = await (0, client_1.adminGraphql)(siteName, query, {});
|
|
218
|
+
const vendors = new Set();
|
|
219
|
+
const types = new Set();
|
|
220
|
+
const tags = new Set();
|
|
221
|
+
result.products.edges.forEach(({ node }) => {
|
|
222
|
+
if (node.vendor)
|
|
223
|
+
vendors.add(node.vendor);
|
|
224
|
+
if (node.productType)
|
|
225
|
+
types.add(node.productType);
|
|
226
|
+
(node.tags || []).forEach((tag) => tags.add(tag));
|
|
227
|
+
});
|
|
228
|
+
return {
|
|
229
|
+
vendors: Array.from(vendors).sort(),
|
|
230
|
+
types: Array.from(types).sort(),
|
|
231
|
+
tags: Array.from(tags).sort(),
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Fetch all variants for a purchasable product. A non-purchasable product's
|
|
236
|
+
* variants don't exist on the storefront, so the cart would reject them —
|
|
237
|
+
* returns `[]` rather than letting add-to-cart resolve a dead merchandiseId
|
|
238
|
+
* (same as shp-product-service's `fetchProductVariants`).
|
|
239
|
+
*/
|
|
240
|
+
async function fetchProductVariants(siteName, productId, first = 50) {
|
|
241
|
+
const normalizedId = normalizeProductId(productId);
|
|
242
|
+
const query = `
|
|
243
|
+
query GetProductVariants($id: ID!, $first: Int!) {
|
|
244
|
+
product(id: $id) {
|
|
245
|
+
status
|
|
246
|
+
publishedAt
|
|
247
|
+
variants(first: $first) {
|
|
248
|
+
edges { node { id title sku price compareAtPrice } }
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
`;
|
|
253
|
+
const result = await (0, client_1.adminGraphql)(siteName, query, { id: normalizedId, first });
|
|
254
|
+
if (!result.product) {
|
|
255
|
+
throw new errors_1.ShopifyNotFoundError('Product not found', { productId });
|
|
256
|
+
}
|
|
257
|
+
if (!isPurchasable(result.product)) {
|
|
258
|
+
return [];
|
|
259
|
+
}
|
|
260
|
+
return result.product.variants.edges.map((edge) => ({
|
|
261
|
+
shopifyId: edge.node.id,
|
|
262
|
+
productId: normalizedId,
|
|
263
|
+
title: edge.node.title,
|
|
264
|
+
sku: edge.node.sku || undefined,
|
|
265
|
+
price: edge.node.price,
|
|
266
|
+
compareAtPrice: edge.node.compareAtPrice || undefined,
|
|
267
|
+
}));
|
|
268
|
+
}
|
|
269
|
+
/** Fetch a single variant by ID; `null` if missing. No purchasability gate — mirrors the legacy quirk. */
|
|
270
|
+
async function fetchVariantById(siteName, variantId) {
|
|
271
|
+
const normalizedId = normalizeVariantId(variantId);
|
|
272
|
+
const query = `
|
|
273
|
+
query GetVariant($id: ID!) {
|
|
274
|
+
productVariant(id: $id) {
|
|
275
|
+
id title sku price compareAtPrice
|
|
276
|
+
product { id }
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
`;
|
|
280
|
+
const result = await (0, client_1.adminGraphql)(siteName, query, { id: normalizedId });
|
|
281
|
+
if (!result.productVariant) {
|
|
282
|
+
return null;
|
|
283
|
+
}
|
|
284
|
+
return {
|
|
285
|
+
shopifyId: result.productVariant.id,
|
|
286
|
+
productId: result.productVariant.product.id,
|
|
287
|
+
title: result.productVariant.title,
|
|
288
|
+
sku: result.productVariant.sku || undefined,
|
|
289
|
+
price: result.productVariant.price,
|
|
290
|
+
compareAtPrice: result.productVariant.compareAtPrice || undefined,
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
/** Fetch inventory levels for a specific variant across all stock locations; `null` if missing. */
|
|
294
|
+
async function fetchVariantInventory(siteName, variantId) {
|
|
295
|
+
const normalizedId = normalizeVariantId(variantId);
|
|
296
|
+
const query = `
|
|
297
|
+
query GetVariantInventory($id: ID!) {
|
|
298
|
+
productVariant(id: $id) {
|
|
299
|
+
id
|
|
300
|
+
sku
|
|
301
|
+
inventoryItem {
|
|
302
|
+
inventoryLevels(first: 50) {
|
|
303
|
+
edges { node { quantities(names: ["available", "reserved"]) { name quantity } location { id name } } }
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
`;
|
|
309
|
+
const result = await (0, client_1.adminGraphql)(siteName, query, { id: normalizedId });
|
|
310
|
+
if (!result.productVariant) {
|
|
311
|
+
return null;
|
|
312
|
+
}
|
|
313
|
+
return {
|
|
314
|
+
variantId: result.productVariant.id,
|
|
315
|
+
sku: result.productVariant.sku || undefined,
|
|
316
|
+
inventoryByLocation: mapInventoryByLocation(result.productVariant.inventoryItem?.inventoryLevels?.edges),
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
/** Fetch media (images/external video) attached to a product. Only MediaImage/ExternalVideo are mapped — same as legacy. */
|
|
320
|
+
async function fetchProductMedia(siteName, productId, first = 50) {
|
|
321
|
+
const normalizedId = normalizeProductId(productId);
|
|
322
|
+
const query = `
|
|
323
|
+
query GetProductMedia($id: ID!, $first: Int!) {
|
|
324
|
+
product(id: $id) {
|
|
325
|
+
media(first: $first) {
|
|
326
|
+
edges {
|
|
327
|
+
node {
|
|
328
|
+
id
|
|
329
|
+
alt
|
|
330
|
+
mediaContentType
|
|
331
|
+
... on MediaImage { image { url } }
|
|
332
|
+
... on ExternalVideo { embeddedUrl }
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
`;
|
|
339
|
+
const result = await (0, client_1.adminGraphql)(siteName, query, { id: normalizedId, first });
|
|
340
|
+
if (!result.product) {
|
|
341
|
+
throw new errors_1.ShopifyNotFoundError('Product not found', { productId });
|
|
342
|
+
}
|
|
343
|
+
return result.product.media.edges.map((edge) => ({
|
|
344
|
+
id: edge.node.id,
|
|
345
|
+
alt: edge.node.alt || undefined,
|
|
346
|
+
type: edge.node.mediaContentType || 'IMAGE',
|
|
347
|
+
url: edge.node.image?.url || edge.node.embeddedUrl || '',
|
|
348
|
+
}));
|
|
349
|
+
}
|
|
350
|
+
/** Fetch collections with cursor pagination. */
|
|
351
|
+
async function fetchCollections(siteName, first = 50, after) {
|
|
352
|
+
const query = `
|
|
353
|
+
query GetCollections($first: Int!, $after: String) {
|
|
354
|
+
collections(first: $first, after: $after) {
|
|
355
|
+
edges { node { id title handle description image { url altText } productsCount { count } updatedAt } }
|
|
356
|
+
pageInfo { hasNextPage endCursor }
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
`;
|
|
360
|
+
const result = await (0, client_1.adminGraphql)(siteName, query, { first, after });
|
|
361
|
+
return {
|
|
362
|
+
items: result.collections.edges.map((e) => mapCollection(e.node)),
|
|
363
|
+
count: result.collections.edges.length,
|
|
364
|
+
pageInfo: result.collections.pageInfo,
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
/** Fetch a single collection by gid, numeric id, or handle; `null` if missing. */
|
|
368
|
+
async function fetchCollectionById(siteName, collectionId) {
|
|
369
|
+
const resolvedId = await resolveCollectionId(siteName, collectionId);
|
|
370
|
+
if (!resolvedId) {
|
|
371
|
+
return null;
|
|
372
|
+
}
|
|
373
|
+
const query = `
|
|
374
|
+
query GetCollection($id: ID!) {
|
|
375
|
+
collection(id: $id) { id title handle description image { url altText } productsCount { count } updatedAt }
|
|
376
|
+
}
|
|
377
|
+
`;
|
|
378
|
+
const result = await (0, client_1.adminGraphql)(siteName, query, { id: resolvedId });
|
|
379
|
+
return result.collection ? mapCollection(result.collection) : null;
|
|
380
|
+
}
|
|
381
|
+
/** Fetch purchasable products in a collection, by gid, numeric id, or handle. */
|
|
382
|
+
async function fetchCollectionProducts(siteName, collectionId, first = 50, after) {
|
|
383
|
+
const resolvedId = await resolveCollectionId(siteName, collectionId);
|
|
384
|
+
if (!resolvedId) {
|
|
385
|
+
throw new errors_1.ShopifyNotFoundError('Collection not found', { collectionId });
|
|
386
|
+
}
|
|
387
|
+
const query = `
|
|
388
|
+
query GetCollectionProducts($id: ID!, $first: Int!, $after: String) {
|
|
389
|
+
collection(id: $id) {
|
|
390
|
+
products(first: $first, after: $after) {
|
|
391
|
+
edges { node { ${PRODUCT_FIELDS} } }
|
|
392
|
+
pageInfo { hasNextPage endCursor }
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
`;
|
|
397
|
+
const result = await (0, client_1.adminGraphql)(siteName, query, { id: resolvedId, first, after });
|
|
398
|
+
if (!result.collection) {
|
|
399
|
+
throw new errors_1.ShopifyNotFoundError('Collection not found', { collectionId });
|
|
400
|
+
}
|
|
401
|
+
return {
|
|
402
|
+
items: result.collection.products.edges.map((e) => mapProduct(e.node)),
|
|
403
|
+
count: result.collection.products.edges.length,
|
|
404
|
+
pageInfo: result.collection.products.pageInfo,
|
|
405
|
+
};
|
|
406
|
+
}
|
|
92
407
|
//# sourceMappingURL=products.js.map
|
package/dist/src/products.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"products.js","sourceRoot":"","sources":["../../src/products.ts"],"names":[],"mappings":";;AA8EA,sCAmBC;AAGD,4CAcC;AAGD,0DAMC;AA3HD,qCAAwC;AACxC,qCAAgD;AAEhD,oFAAoF;AACpF,oFAAoF;AACpF,wFAAwF;AACxF,yDAAyD;AACzD,MAAM,yBAAyB,GAAG,8CAA8C,CAAC;AA0BjF,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;CAgBtB,C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C;QACtE,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM;QAC9C,QAAQ,EAAE,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,QAAQ;KAC9C,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platform-x-shp/shopify-adapter",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Shopify commerce adapter — Admin API client, read-model mappers, tenant-config resolution, and Keycloak/PlatformX auth verification, consumed by hep-ecommerce-service. Self-contained: does not depend on shp-auth-client.",
|
|
5
5
|
"main": "./dist/src/index.js",
|
|
6
6
|
"types": "./dist/src/index.d.ts",
|