@wix/auto_sdk_ecom_catalog 1.0.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/build/cjs/index.d.ts +2 -0
- package/build/cjs/index.js +19 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +30 -0
- package/build/cjs/index.typings.js +18 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/src/interfaces-ecommerce-v1-catalog-provider.context.d.ts +5 -0
- package/build/cjs/src/interfaces-ecommerce-v1-catalog-provider.context.js +9 -0
- package/build/cjs/src/interfaces-ecommerce-v1-catalog-provider.context.js.map +1 -0
- package/build/cjs/src/interfaces-ecommerce-v1-catalog-provider.public.d.ts +34 -0
- package/build/cjs/src/interfaces-ecommerce-v1-catalog-provider.public.js +49 -0
- package/build/cjs/src/interfaces-ecommerce-v1-catalog-provider.public.js.map +1 -0
- package/build/cjs/src/service-plugins-types.d.ts +599 -0
- package/build/cjs/src/service-plugins-types.js +77 -0
- package/build/cjs/src/service-plugins-types.js.map +1 -0
- package/build/es/index.d.ts +2 -0
- package/build/es/index.js +3 -0
- package/build/es/index.js.map +1 -0
- package/build/es/index.typings.d.ts +30 -0
- package/build/es/index.typings.js +2 -0
- package/build/es/index.typings.js.map +1 -0
- package/build/es/src/interfaces-ecommerce-v1-catalog-provider.context.d.ts +5 -0
- package/build/es/src/interfaces-ecommerce-v1-catalog-provider.context.js +6 -0
- package/build/es/src/interfaces-ecommerce-v1-catalog-provider.context.js.map +1 -0
- package/build/es/src/interfaces-ecommerce-v1-catalog-provider.public.d.ts +34 -0
- package/build/es/src/interfaces-ecommerce-v1-catalog-provider.public.js +46 -0
- package/build/es/src/interfaces-ecommerce-v1-catalog-provider.public.js.map +1 -0
- package/build/es/src/service-plugins-types.d.ts +599 -0
- package/build/es/src/service-plugins-types.js +74 -0
- package/build/es/src/service-plugins-types.js.map +1 -0
- package/build/internal/cjs/index.d.ts +2 -0
- package/build/internal/cjs/index.js +19 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +30 -0
- package/build/internal/cjs/index.typings.js +18 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/src/interfaces-ecommerce-v1-catalog-provider.context.d.ts +5 -0
- package/build/internal/cjs/src/interfaces-ecommerce-v1-catalog-provider.context.js +9 -0
- package/build/internal/cjs/src/interfaces-ecommerce-v1-catalog-provider.context.js.map +1 -0
- package/build/internal/cjs/src/interfaces-ecommerce-v1-catalog-provider.public.d.ts +34 -0
- package/build/internal/cjs/src/interfaces-ecommerce-v1-catalog-provider.public.js +49 -0
- package/build/internal/cjs/src/interfaces-ecommerce-v1-catalog-provider.public.js.map +1 -0
- package/build/internal/cjs/src/service-plugins-types.d.ts +599 -0
- package/build/internal/cjs/src/service-plugins-types.js +77 -0
- package/build/internal/cjs/src/service-plugins-types.js.map +1 -0
- package/build/internal/es/index.d.ts +2 -0
- package/build/internal/es/index.js +3 -0
- package/build/internal/es/index.js.map +1 -0
- package/build/internal/es/index.typings.d.ts +30 -0
- package/build/internal/es/index.typings.js +2 -0
- package/build/internal/es/index.typings.js.map +1 -0
- package/build/internal/es/src/interfaces-ecommerce-v1-catalog-provider.context.d.ts +5 -0
- package/build/internal/es/src/interfaces-ecommerce-v1-catalog-provider.context.js +6 -0
- package/build/internal/es/src/interfaces-ecommerce-v1-catalog-provider.context.js.map +1 -0
- package/build/internal/es/src/interfaces-ecommerce-v1-catalog-provider.public.d.ts +34 -0
- package/build/internal/es/src/interfaces-ecommerce-v1-catalog-provider.public.js +46 -0
- package/build/internal/es/src/interfaces-ecommerce-v1-catalog-provider.public.js.map +1 -0
- package/build/internal/es/src/service-plugins-types.d.ts +599 -0
- package/build/internal/es/src/service-plugins-types.js +74 -0
- package/build/internal/es/src/service-plugins-types.js.map +1 -0
- package/package.json +52 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./src/service-plugins-types"), exports);
|
|
18
|
+
__exportStar(require("./src/interfaces-ecommerce-v1-catalog-provider.context"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C,yFAAuE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { GetCatalogItemsResponse } from './src/service-plugins-types.js';
|
|
2
|
+
import { GetCatalogItemsEnvelope } from './src/interfaces-ecommerce-v1-catalog-provider.public.js';
|
|
3
|
+
export * from './src/service-plugins-types';
|
|
4
|
+
export { GetCatalogItemsEnvelope };
|
|
5
|
+
/**
|
|
6
|
+
* Retrieves data for specified items in a specified catalog.
|
|
7
|
+
*
|
|
8
|
+
* Wix calls this method whenever a cart or checkout is updated, and when an item is added to an order.
|
|
9
|
+
*
|
|
10
|
+
* The method receives a `catalogReferences` array. Each catalog reference in the array contains:
|
|
11
|
+
* + The ID of the item whose latest information Wix needs to retrieve.
|
|
12
|
+
* + The ID of the app providing the catalog containing the item.
|
|
13
|
+
* + Optional details about preferences or customization of the item.
|
|
14
|
+
*
|
|
15
|
+
* The method also receives preferences for the currency and weight unit to be used in the response.
|
|
16
|
+
*
|
|
17
|
+
* Your external catalog can store and organize item details in any way you prefer.
|
|
18
|
+
* When implementing the Catalog service plugin, learn how to [handle item variants](https://dev.wix.com/docs/rest/business-solutions/e-commerce/catalog-service-plugin/handle-item-variants) in a way that meets your needs.
|
|
19
|
+
*
|
|
20
|
+
* The method's response must contain a `catalogItems` array. Each item in the array must contain:
|
|
21
|
+
* + A `catalogReference` object. This must be identical to the `catalogReference` object received in the request.
|
|
22
|
+
* + A `data` object with full details about the item.
|
|
23
|
+
*
|
|
24
|
+
* > **Notes:**
|
|
25
|
+
* > + If an item doesn't exist in the catalog, the response must exclude it from the `catalogItems` array in the response.
|
|
26
|
+
* > + When none of the items requested exist in the catalog, `catalogItems` must contain an empty array.
|
|
27
|
+
* > + Wix calls the method every time a cart or checkout is updated. If the response doesn't include an item that was already in the cart or checkout, Wix removes the item from the cart or checkout.
|
|
28
|
+
* > + Learn more about [implementing a Wix service plugin](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions).
|
|
29
|
+
*/
|
|
30
|
+
export declare function getCatalogItems(payload: GetCatalogItemsEnvelope): GetCatalogItemsResponse | Promise<GetCatalogItemsResponse>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./src/service-plugins-types"), exports);
|
|
18
|
+
//# sourceMappingURL=index.typings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.typings.js","sourceRoot":"","sources":["../../index.typings.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAGA,8DAA4C"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import './interfaces-ecommerce-v1-catalog-provider.public.js';
|
|
2
|
+
import { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';
|
|
3
|
+
import { provideHandlers as publicProvideHandlers } from './interfaces-ecommerce-v1-catalog-provider.public.js';
|
|
4
|
+
export { publicProvideHandlers };
|
|
5
|
+
export declare const provideHandlers: ReturnType<typeof createServicePluginModule<typeof publicProvideHandlers>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.provideHandlers = exports.publicProvideHandlers = void 0;
|
|
4
|
+
require("./interfaces-ecommerce-v1-catalog-provider.public.js");
|
|
5
|
+
const service_plugin_modules_1 = require("@wix/sdk-runtime/service-plugin-modules");
|
|
6
|
+
const interfaces_ecommerce_v1_catalog_provider_public_js_1 = require("./interfaces-ecommerce-v1-catalog-provider.public.js");
|
|
7
|
+
Object.defineProperty(exports, "publicProvideHandlers", { enumerable: true, get: function () { return interfaces_ecommerce_v1_catalog_provider_public_js_1.provideHandlers; } });
|
|
8
|
+
exports.provideHandlers = (0, service_plugin_modules_1.createServicePluginModule)(interfaces_ecommerce_v1_catalog_provider_public_js_1.provideHandlers);
|
|
9
|
+
//# sourceMappingURL=interfaces-ecommerce-v1-catalog-provider.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces-ecommerce-v1-catalog-provider.context.js","sourceRoot":"","sources":["../../../src/interfaces-ecommerce-v1-catalog-provider.context.ts"],"names":[],"mappings":";;;AAAA,gEAA8D;AAC9D,oFAAoF;AACpF,6HAAgH;AAEvG,sGAFmB,oEAAqB,OAEnB;AAEjB,QAAA,eAAe,GAExB,IAAA,kDAAyB,EAAC,oEAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ServicePluginDefinition } from '@wix/sdk-types';
|
|
2
|
+
import { Context, GetCatalogItemsRequest, GetCatalogItemsResponse } from './service-plugins-types.js';
|
|
3
|
+
export interface GetCatalogItemsEnvelope {
|
|
4
|
+
request: GetCatalogItemsRequest;
|
|
5
|
+
metadata: Context;
|
|
6
|
+
}
|
|
7
|
+
export declare const provideHandlers: ServicePluginDefinition<{
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* Retrieves data for specified items in a specified catalog.
|
|
11
|
+
*
|
|
12
|
+
* Wix calls this method whenever a cart or checkout is updated, and when an item is added to an order.
|
|
13
|
+
*
|
|
14
|
+
* The method receives a `catalogReferences` array. Each catalog reference in the array contains:
|
|
15
|
+
* + The ID of the item whose latest information Wix needs to retrieve.
|
|
16
|
+
* + The ID of the app providing the catalog containing the item.
|
|
17
|
+
* + Optional details about preferences or customization of the item.
|
|
18
|
+
*
|
|
19
|
+
* The method also receives preferences for the currency and weight unit to be used in the response.
|
|
20
|
+
*
|
|
21
|
+
* Your external catalog can store and organize item details in any way you prefer.
|
|
22
|
+
* When implementing the Catalog service plugin, learn how to [handle item variants](https://dev.wix.com/docs/rest/business-solutions/e-commerce/catalog-service-plugin/handle-item-variants) in a way that meets your needs.
|
|
23
|
+
*
|
|
24
|
+
* The method's response must contain a `catalogItems` array. Each item in the array must contain:
|
|
25
|
+
* + A `catalogReference` object. This must be identical to the `catalogReference` object received in the request.
|
|
26
|
+
* + A `data` object with full details about the item.
|
|
27
|
+
*
|
|
28
|
+
* > **Notes:**
|
|
29
|
+
* > + If an item doesn't exist in the catalog, the response must exclude it from the `catalogItems` array in the response.
|
|
30
|
+
* > + When none of the items requested exist in the catalog, `catalogItems` must contain an empty array.
|
|
31
|
+
* > + Wix calls the method every time a cart or checkout is updated. If the response doesn't include an item that was already in the cart or checkout, Wix removes the item from the cart or checkout.
|
|
32
|
+
* > + Learn more about [implementing a Wix service plugin](https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/self-hosting/supported-extensions/backend-extensions/add-self-hosted-service-plugin-extensions). */
|
|
33
|
+
getCatalogItems(payload: GetCatalogItemsEnvelope): GetCatalogItemsResponse | Promise<GetCatalogItemsResponse>;
|
|
34
|
+
}>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.provideHandlers = void 0;
|
|
4
|
+
const sdk_types_1 = require("@wix/sdk-types");
|
|
5
|
+
const image_1 = require("@wix/sdk-runtime/transformations/image");
|
|
6
|
+
const page_url_v2_1 = require("@wix/sdk-runtime/transformations/page-url-v2");
|
|
7
|
+
const float_1 = require("@wix/sdk-runtime/transformations/float");
|
|
8
|
+
const timestamp_1 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
9
|
+
const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
10
|
+
const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
11
|
+
exports.provideHandlers = (0, sdk_types_1.ServicePluginDefinition)('ECOM_CATALOG', [
|
|
12
|
+
{
|
|
13
|
+
name: 'getCatalogItems',
|
|
14
|
+
primaryHttpMappingPath: '/get-catalog-items',
|
|
15
|
+
transformations: {
|
|
16
|
+
toREST: (payload) => {
|
|
17
|
+
const toRestResponse = (0, transform_paths_1.transformPaths)(payload, [
|
|
18
|
+
{
|
|
19
|
+
transformFn: page_url_v2_1.transformSDKPageURLV2ToRESTPageURLV2,
|
|
20
|
+
paths: [{ path: 'catalogItems.data.url' }],
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
transformFn: image_1.transformSDKImageToRESTImage,
|
|
24
|
+
paths: [{ path: 'catalogItems.data.media' }],
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
transformFn: float_1.transformSDKFloatToRESTFloat,
|
|
28
|
+
paths: [{ path: 'catalogItems.data.physicalProperties.weight' }],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
|
|
32
|
+
paths: [
|
|
33
|
+
{
|
|
34
|
+
path: 'catalogItems.data.subscriptionOptionInfo.subscriptionSettings.startDate',
|
|
35
|
+
},
|
|
36
|
+
{ path: 'catalogItems.data.serviceProperties.scheduledDate' },
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
]);
|
|
40
|
+
return (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)(toRestResponse);
|
|
41
|
+
},
|
|
42
|
+
fromREST: (payload) => {
|
|
43
|
+
const fromRestRequest = payload;
|
|
44
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(fromRestRequest);
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
]);
|
|
49
|
+
//# sourceMappingURL=interfaces-ecommerce-v1-catalog-provider.public.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces-ecommerce-v1-catalog-provider.public.js","sourceRoot":"","sources":["../../../src/interfaces-ecommerce-v1-catalog-provider.public.ts"],"names":[],"mappings":";;;AAAA,8CAAyD;AAMzD,kEAAsF;AACtF,8EAAoG;AACpG,kEAAsF;AACtF,0EAAkG;AAClG,sFAAkF;AAClF,oFAGiD;AAOpC,QAAA,eAAe,GAAG,IAAA,mCAAuB,EA6BnD,cAAc,EAAE;IACjB;QACE,IAAI,EAAE,iBAAiB;QACvB,sBAAsB,EAAE,oBAAoB;QAC5C,eAAe,EAAE;YACf,MAAM,EAAE,CAAC,OAAY,EAAE,EAAE;gBACvB,MAAM,cAAc,GAAG,IAAA,gCAAc,EAAC,OAAO,EAAE;oBAC7C;wBACE,WAAW,EAAE,kDAAoC;wBACjD,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,CAAC;qBAC3C;oBACD;wBACE,WAAW,EAAE,oCAA4B;wBACzC,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,yBAAyB,EAAE,CAAC;qBAC7C;oBACD;wBACE,WAAW,EAAE,oCAA4B;wBACzC,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,6CAA6C,EAAE,CAAC;qBACjE;oBACD;wBACE,WAAW,EAAE,gDAAoC;wBACjD,KAAK,EAAE;4BACL;gCACE,IAAI,EAAE,yEAAyE;6BAChF;4BACD,EAAE,IAAI,EAAE,mDAAmD,EAAE;yBAC9D;qBACF;iBACF,CAAC,CAAC;gBAEH,OAAO,IAAA,8DAAqC,EAAC,cAAc,CAAC,CAAC;YAC/D,CAAC;YACD,QAAQ,EAAE,CAAC,OAAY,EAAE,EAAE;gBACzB,MAAM,eAAe,GAAG,OAAO,CAAC;gBAEhC,OAAO,IAAA,gEAAuC,EAAC,eAAe,CAAC,CAAC;YAClE,CAAC;SACF;KACF;CACF,CAAC,CAAC"}
|