@wix/auto_sdk_ecom_validations 1.0.8 → 1.0.10
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 +15 -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-validations-provider.context.d.ts +5 -0
- package/build/cjs/src/interfaces-ecommerce-v1-validations-provider.context.js +9 -0
- package/build/cjs/src/interfaces-ecommerce-v1-validations-provider.context.js.map +1 -0
- package/build/cjs/src/interfaces-ecommerce-v1-validations-provider.public.d.ts +19 -0
- package/build/cjs/src/interfaces-ecommerce-v1-validations-provider.public.js +50 -0
- package/build/cjs/src/interfaces-ecommerce-v1-validations-provider.public.js.map +1 -0
- package/build/{index.d.mts → cjs/src/service-plugins-types.d.ts} +69 -94
- package/build/cjs/src/service-plugins-types.js +121 -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 +15 -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-validations-provider.context.d.ts +5 -0
- package/build/es/src/interfaces-ecommerce-v1-validations-provider.context.js +6 -0
- package/build/es/src/interfaces-ecommerce-v1-validations-provider.context.js.map +1 -0
- package/build/es/src/interfaces-ecommerce-v1-validations-provider.public.d.ts +19 -0
- package/build/es/src/interfaces-ecommerce-v1-validations-provider.public.js +47 -0
- package/build/es/src/interfaces-ecommerce-v1-validations-provider.public.js.map +1 -0
- package/build/{index.d.ts → es/src/service-plugins-types.d.ts} +69 -94
- package/build/es/src/service-plugins-types.js +118 -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 +15 -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-validations-provider.context.d.ts +5 -0
- package/build/internal/cjs/src/interfaces-ecommerce-v1-validations-provider.context.js +9 -0
- package/build/internal/cjs/src/interfaces-ecommerce-v1-validations-provider.context.js.map +1 -0
- package/build/internal/cjs/src/interfaces-ecommerce-v1-validations-provider.public.d.ts +19 -0
- package/build/internal/cjs/src/interfaces-ecommerce-v1-validations-provider.public.js +50 -0
- package/build/internal/cjs/src/interfaces-ecommerce-v1-validations-provider.public.js.map +1 -0
- package/build/internal/{index.d.mts → cjs/src/service-plugins-types.d.ts} +69 -94
- package/build/internal/cjs/src/service-plugins-types.js +121 -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 +15 -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-validations-provider.context.d.ts +5 -0
- package/build/internal/es/src/interfaces-ecommerce-v1-validations-provider.context.js +6 -0
- package/build/internal/es/src/interfaces-ecommerce-v1-validations-provider.context.js.map +1 -0
- package/build/internal/es/src/interfaces-ecommerce-v1-validations-provider.public.d.ts +19 -0
- package/build/internal/es/src/interfaces-ecommerce-v1-validations-provider.public.js +47 -0
- package/build/internal/es/src/interfaces-ecommerce-v1-validations-provider.public.js.map +1 -0
- package/build/internal/{index.d.ts → es/src/service-plugins-types.d.ts} +69 -94
- package/build/internal/es/src/service-plugins-types.js +118 -0
- package/build/internal/es/src/service-plugins-types.js.map +1 -0
- package/package.json +11 -12
- package/build/index.js +0 -194
- package/build/index.js.map +0 -1
- package/build/index.mjs +0 -156
- package/build/index.mjs.map +0 -1
- package/build/internal/index.js +0 -194
- package/build/internal/index.js.map +0 -1
- package/build/internal/index.mjs +0 -156
- package/build/internal/index.mjs.map +0 -1
|
@@ -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.js"), exports);
|
|
18
|
+
__exportStar(require("./src/interfaces-ecommerce-v1-validations-provider.context.js"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iEAA+C;AAC/C,gGAA8E"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { GetValidationViolationsResponse } from './src/service-plugins-types.js';
|
|
2
|
+
import { GetValidationViolationsEnvelope } from './src/interfaces-ecommerce-v1-validations-provider.public.js';
|
|
3
|
+
export * from './src/service-plugins-types';
|
|
4
|
+
export { GetValidationViolationsEnvelope };
|
|
5
|
+
/**
|
|
6
|
+
* This method retrieves validation violations from your app.
|
|
7
|
+
*
|
|
8
|
+
* Wix calls this method when certain actions are performed on a visitor's cart and checkout. For example, when an item is added to the cart, or when a coupon is added to a checkout.
|
|
9
|
+
* This method validates a visitor's cart and checkout, and returns any validation violations (using the structure provided by Wix eCommerce). Site visitors can see the validation violations in their cart and checkout pages. If there aren't any validation violations, the method returns an object containing an empty list.
|
|
10
|
+
*
|
|
11
|
+
* > __Notes:__
|
|
12
|
+
* > + Do not call the Estimate Cart Totals, Estimate Current Cart Totals or Get Checkout methods from your implementation code for Get Validation Violations. Doing so will result in an error.
|
|
13
|
+
* > + By default, this method only retrieves validation violations from a visitor's checkout. If you want to also retrieve validation violations from a visitor's cart, set the `validateInCart` parameter to `true` in the Ecom Validations Integration's config file.
|
|
14
|
+
*/
|
|
15
|
+
export declare function getValidationViolations(payload: GetValidationViolationsEnvelope): GetValidationViolationsResponse | Promise<GetValidationViolationsResponse>;
|
|
@@ -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-validations-provider.public.js';
|
|
2
|
+
import { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';
|
|
3
|
+
import { provideHandlers as publicProvideHandlers } from './interfaces-ecommerce-v1-validations-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-validations-provider.public.js");
|
|
5
|
+
const service_plugin_modules_1 = require("@wix/sdk-runtime/service-plugin-modules");
|
|
6
|
+
const interfaces_ecommerce_v1_validations_provider_public_js_1 = require("./interfaces-ecommerce-v1-validations-provider.public.js");
|
|
7
|
+
Object.defineProperty(exports, "publicProvideHandlers", { enumerable: true, get: function () { return interfaces_ecommerce_v1_validations_provider_public_js_1.provideHandlers; } });
|
|
8
|
+
exports.provideHandlers = (0, service_plugin_modules_1.createServicePluginModule)(interfaces_ecommerce_v1_validations_provider_public_js_1.provideHandlers);
|
|
9
|
+
//# sourceMappingURL=interfaces-ecommerce-v1-validations-provider.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces-ecommerce-v1-validations-provider.context.js","sourceRoot":"","sources":["../../../src/interfaces-ecommerce-v1-validations-provider.context.ts"],"names":[],"mappings":";;;AAAA,oEAAkE;AAClE,oFAAoF;AACpF,qIAAoH;AAE3G,sGAFmB,wEAAqB,OAEnB;AAEjB,QAAA,eAAe,GAExB,IAAA,kDAAyB,EAAC,wEAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ServicePluginDefinition } from '@wix/sdk-types';
|
|
2
|
+
import { Context, GetValidationViolationsRequest, GetValidationViolationsResponse } from './service-plugins-types.js';
|
|
3
|
+
export interface GetValidationViolationsEnvelope {
|
|
4
|
+
request: GetValidationViolationsRequest;
|
|
5
|
+
metadata: Context;
|
|
6
|
+
}
|
|
7
|
+
export declare const provideHandlers: ServicePluginDefinition<{
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* This method retrieves validation violations from your app.
|
|
11
|
+
*
|
|
12
|
+
* Wix calls this method when certain actions are performed on a visitor's cart and checkout. For example, when an item is added to the cart, or when a coupon is added to a checkout.
|
|
13
|
+
* This method validates a visitor's cart and checkout, and returns any validation violations (using the structure provided by Wix eCommerce). Site visitors can see the validation violations in their cart and checkout pages. If there aren't any validation violations, the method returns an object containing an empty list.
|
|
14
|
+
*
|
|
15
|
+
* > __Notes:__
|
|
16
|
+
* > + Do not call the Estimate Cart Totals, Estimate Current Cart Totals or Get Checkout methods from your implementation code for Get Validation Violations. Doing so will result in an error.
|
|
17
|
+
* > + By default, this method only retrieves validation violations from a visitor's checkout. If you want to also retrieve validation violations from a visitor's cart, set the `validateInCart` parameter to `true` in the Ecom Validations Integration's config file. */
|
|
18
|
+
getValidationViolations(payload: GetValidationViolationsEnvelope): GetValidationViolationsResponse | Promise<GetValidationViolationsResponse>;
|
|
19
|
+
}>;
|
|
@@ -0,0 +1,50 @@
|
|
|
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 address_1 = require("@wix/sdk-runtime/transformations/address");
|
|
6
|
+
const float_1 = require("@wix/sdk-runtime/transformations/float");
|
|
7
|
+
const timestamp_1 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
8
|
+
const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
9
|
+
const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
10
|
+
exports.provideHandlers = (0, sdk_types_1.ServicePluginDefinition)('ECOM_VALIDATIONS', [
|
|
11
|
+
{
|
|
12
|
+
name: 'getValidationViolations',
|
|
13
|
+
primaryHttpMappingPath: '/v1/get-violations',
|
|
14
|
+
transformations: {
|
|
15
|
+
toREST: (payload) => {
|
|
16
|
+
const toRestResponse = payload;
|
|
17
|
+
return (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)(toRestResponse);
|
|
18
|
+
},
|
|
19
|
+
fromREST: (payload) => {
|
|
20
|
+
const fromRestRequest = (0, transform_paths_1.transformPaths)(payload, [
|
|
21
|
+
{
|
|
22
|
+
transformFn: float_1.transformRESTFloatToSDKFloat,
|
|
23
|
+
paths: [
|
|
24
|
+
{
|
|
25
|
+
path: 'request.validationInfo.lineItems.physicalProperties.weight',
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
transformFn: timestamp_1.transformRESTTimestampToSDKTimestamp,
|
|
31
|
+
paths: [
|
|
32
|
+
{
|
|
33
|
+
path: 'request.validationInfo.lineItems.subscriptionOptionInfo.subscriptionSettings.startDate',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
transformFn: address_1.transformRESTAddressToSDKAddress,
|
|
39
|
+
paths: [
|
|
40
|
+
{ path: 'request.validationInfo.billingInfo.address' },
|
|
41
|
+
{ path: 'request.validationInfo.shippingAddress.address' },
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
]);
|
|
45
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(fromRestRequest);
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
]);
|
|
50
|
+
//# sourceMappingURL=interfaces-ecommerce-v1-validations-provider.public.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces-ecommerce-v1-validations-provider.public.js","sourceRoot":"","sources":["../../../src/interfaces-ecommerce-v1-validations-provider.public.ts"],"names":[],"mappings":";;;AAAA,8CAAyD;AAMzD,sEAA4F;AAC5F,kEAAsF;AACtF,0EAAkG;AAClG,sFAAkF;AAClF,oFAGiD;AAOpC,QAAA,eAAe,GAAG,IAAA,mCAAuB,EAcnD,kBAAkB,EAAE;IACrB;QACE,IAAI,EAAE,yBAAyB;QAC/B,sBAAsB,EAAE,oBAAoB;QAC5C,eAAe,EAAE;YACf,MAAM,EAAE,CAAC,OAAY,EAAE,EAAE;gBACvB,MAAM,cAAc,GAAG,OAAO,CAAC;gBAE/B,OAAO,IAAA,8DAAqC,EAAC,cAAc,CAAC,CAAC;YAC/D,CAAC;YACD,QAAQ,EAAE,CAAC,OAAY,EAAE,EAAE;gBACzB,MAAM,eAAe,GAAG,IAAA,gCAAc,EAAC,OAAO,EAAE;oBAC9C;wBACE,WAAW,EAAE,oCAA4B;wBACzC,KAAK,EAAE;4BACL;gCACE,IAAI,EAAE,4DAA4D;6BACnE;yBACF;qBACF;oBACD;wBACE,WAAW,EAAE,gDAAoC;wBACjD,KAAK,EAAE;4BACL;gCACE,IAAI,EAAE,wFAAwF;6BAC/F;yBACF;qBACF;oBACD;wBACE,WAAW,EAAE,0CAAgC;wBAC7C,KAAK,EAAE;4BACL,EAAE,IAAI,EAAE,4CAA4C,EAAE;4BACtD,EAAE,IAAI,EAAE,gDAAgD,EAAE;yBAC3D;qBACF;iBACF,CAAC,CAAC;gBAEH,OAAO,IAAA,gEAAuC,EAAC,eAAe,CAAC,CAAC;YAClE,CAAC;SACF;KACF;CACF,CAAC,CAAC"}
|