@wix/auto_sdk_automations_trigger-provider 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 +3 -0
- package/build/cjs/index.js +20 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +53 -0
- package/build/cjs/index.typings.js +19 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/src/interfaces-automations-v1-trigger-provider.context.d.ts +5 -0
- package/build/cjs/src/interfaces-automations-v1-trigger-provider.context.js +9 -0
- package/build/cjs/src/interfaces-automations-v1-trigger-provider.context.js.map +1 -0
- package/build/cjs/src/interfaces-automations-v1-trigger-provider.public.d.ts +70 -0
- package/build/cjs/src/interfaces-automations-v1-trigger-provider.public.js +89 -0
- package/build/cjs/src/interfaces-automations-v1-trigger-provider.public.js.map +1 -0
- package/build/cjs/src/service-plugins-error-classes.d.ts +17 -0
- package/build/cjs/src/service-plugins-error-classes.js +21 -0
- package/build/cjs/src/service-plugins-error-classes.js.map +1 -0
- package/build/cjs/src/service-plugins-types.d.ts +592 -0
- package/build/cjs/src/service-plugins-types.js +73 -0
- package/build/cjs/src/service-plugins-types.js.map +1 -0
- package/build/es/index.d.ts +3 -0
- package/build/es/index.js +4 -0
- package/build/es/index.js.map +1 -0
- package/build/es/index.typings.d.ts +53 -0
- package/build/es/index.typings.js +3 -0
- package/build/es/index.typings.js.map +1 -0
- package/build/es/src/interfaces-automations-v1-trigger-provider.context.d.ts +5 -0
- package/build/es/src/interfaces-automations-v1-trigger-provider.context.js +6 -0
- package/build/es/src/interfaces-automations-v1-trigger-provider.context.js.map +1 -0
- package/build/es/src/interfaces-automations-v1-trigger-provider.public.d.ts +70 -0
- package/build/es/src/interfaces-automations-v1-trigger-provider.public.js +86 -0
- package/build/es/src/interfaces-automations-v1-trigger-provider.public.js.map +1 -0
- package/build/es/src/service-plugins-error-classes.d.ts +17 -0
- package/build/es/src/service-plugins-error-classes.js +17 -0
- package/build/es/src/service-plugins-error-classes.js.map +1 -0
- package/build/es/src/service-plugins-types.d.ts +592 -0
- package/build/es/src/service-plugins-types.js +70 -0
- package/build/es/src/service-plugins-types.js.map +1 -0
- package/build/internal/cjs/index.d.ts +3 -0
- package/build/internal/cjs/index.js +20 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +53 -0
- package/build/internal/cjs/index.typings.js +19 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/src/interfaces-automations-v1-trigger-provider.context.d.ts +5 -0
- package/build/internal/cjs/src/interfaces-automations-v1-trigger-provider.context.js +9 -0
- package/build/internal/cjs/src/interfaces-automations-v1-trigger-provider.context.js.map +1 -0
- package/build/internal/cjs/src/interfaces-automations-v1-trigger-provider.public.d.ts +70 -0
- package/build/internal/cjs/src/interfaces-automations-v1-trigger-provider.public.js +89 -0
- package/build/internal/cjs/src/interfaces-automations-v1-trigger-provider.public.js.map +1 -0
- package/build/internal/cjs/src/service-plugins-error-classes.d.ts +17 -0
- package/build/internal/cjs/src/service-plugins-error-classes.js +21 -0
- package/build/internal/cjs/src/service-plugins-error-classes.js.map +1 -0
- package/build/internal/cjs/src/service-plugins-types.d.ts +592 -0
- package/build/internal/cjs/src/service-plugins-types.js +73 -0
- package/build/internal/cjs/src/service-plugins-types.js.map +1 -0
- package/build/internal/es/index.d.ts +3 -0
- package/build/internal/es/index.js +4 -0
- package/build/internal/es/index.js.map +1 -0
- package/build/internal/es/index.typings.d.ts +53 -0
- package/build/internal/es/index.typings.js +3 -0
- package/build/internal/es/index.typings.js.map +1 -0
- package/build/internal/es/src/interfaces-automations-v1-trigger-provider.context.d.ts +5 -0
- package/build/internal/es/src/interfaces-automations-v1-trigger-provider.context.js +6 -0
- package/build/internal/es/src/interfaces-automations-v1-trigger-provider.context.js.map +1 -0
- package/build/internal/es/src/interfaces-automations-v1-trigger-provider.public.d.ts +70 -0
- package/build/internal/es/src/interfaces-automations-v1-trigger-provider.public.js +86 -0
- package/build/internal/es/src/interfaces-automations-v1-trigger-provider.public.js.map +1 -0
- package/build/internal/es/src/service-plugins-error-classes.d.ts +17 -0
- package/build/internal/es/src/service-plugins-error-classes.js +17 -0
- package/build/internal/es/src/service-plugins-error-classes.js.map +1 -0
- package/build/internal/es/src/service-plugins-types.d.ts +592 -0
- package/build/internal/es/src/service-plugins-types.js +70 -0
- package/build/internal/es/src/service-plugins-types.js.map +1 -0
- package/package.json +52 -0
|
@@ -0,0 +1,20 @@
|
|
|
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-automations-v1-trigger-provider.context"), exports);
|
|
19
|
+
__exportStar(require("./src/service-plugins-error-classes"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C,2FAAyE;AACzE,sEAAoD"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ValidateConfigurationResponse, GetDynamicSchemaResponse, RefreshPayloadResponse, OnAutomationSavedResponse, OnAutomationDeletedResponse } from './src/service-plugins-types.js';
|
|
2
|
+
import { ValidateConfigurationEnvelope, GetDynamicSchemaEnvelope, RefreshPayloadEnvelope, OnAutomationSavedEnvelope, OnAutomationDeletedEnvelope } from './src/interfaces-automations-v1-trigger-provider.public.js';
|
|
3
|
+
export * from './src/service-plugins-error-classes';
|
|
4
|
+
export * from './src/service-plugins-types';
|
|
5
|
+
export { ValidateConfigurationEnvelope, GetDynamicSchemaEnvelope, RefreshPayloadEnvelope, OnAutomationSavedEnvelope, OnAutomationDeletedEnvelope, };
|
|
6
|
+
/**
|
|
7
|
+
* This endpoint allows you to run your own logic to validate trigger fields. Implement this endpoint if you need to perform extra validation on top of
|
|
8
|
+
* the Wix validation process.
|
|
9
|
+
*
|
|
10
|
+
* Wix calls Validate Configuration in the following cases:
|
|
11
|
+
*
|
|
12
|
+
* - When a Wix user activates the automation.
|
|
13
|
+
* - When a Wix user selects the automation from the **Your automations** list in the [**Automations**](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Ftriggers/site-automations)
|
|
14
|
+
* dashboard.
|
|
15
|
+
* - When a Wix user opens the automation to edit it.
|
|
16
|
+
*
|
|
17
|
+
* If the user configured filters when setting up their automation, these are included in the request.
|
|
18
|
+
* Wix uses the returned response to display an error message to a user if the requested trigger is invalid.
|
|
19
|
+
* @throws ProviderNotFoundWixError
|
|
20
|
+
*/
|
|
21
|
+
export declare function validateConfiguration(payload: ValidateConfigurationEnvelope): ValidateConfigurationResponse | Promise<ValidateConfigurationResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* This endpoint returns a [JSON schema](https://json-schema.org/) object
|
|
24
|
+
* that's used to dynamically update the fields available to a Wix user
|
|
25
|
+
* when they configure an [automation](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Ftriggers/site-automations).
|
|
26
|
+
*
|
|
27
|
+
* Wix calls this endpoint when a user selects an option from an
|
|
28
|
+
* [item selection filter](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/automations/triggers/filter-fields#item-selection)
|
|
29
|
+
* configured for a trigger.
|
|
30
|
+
* Wix appends the returned schema to the
|
|
31
|
+
* [payload schema](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/automations/triggers/payload-schema)
|
|
32
|
+
* you defined for the trigger and makes the fields available to the Wix user's automation.
|
|
33
|
+
* @throws ProviderNotFoundWixError
|
|
34
|
+
*/
|
|
35
|
+
export declare function getDynamicSchema(payload: GetDynamicSchemaEnvelope): GetDynamicSchemaResponse | Promise<GetDynamicSchemaResponse>;
|
|
36
|
+
/**
|
|
37
|
+
* If an automation's action is delayed, implement this method to retrieve the latest data in the trigger payload before the action fires.
|
|
38
|
+
*
|
|
39
|
+
* For example, if an automation is triggered but its action is set to fire only 24 hours later, Wix calls Refresh Payload before starting
|
|
40
|
+
* the action. This fetches the latest data in the trigger payload. The returned data can be used to update the trigger payload that is passed
|
|
41
|
+
* to the action.
|
|
42
|
+
*/
|
|
43
|
+
export declare function refreshPayload(payload: RefreshPayloadEnvelope): RefreshPayloadResponse | Promise<RefreshPayloadResponse>;
|
|
44
|
+
/**
|
|
45
|
+
* When a Wix user saves an automation, Wix sends the updated automation to your service endpoint, so that you can perform any necessary logic
|
|
46
|
+
* in your service.
|
|
47
|
+
*/
|
|
48
|
+
export declare function onAutomationSaved(payload: OnAutomationSavedEnvelope): OnAutomationSavedResponse | Promise<OnAutomationSavedResponse>;
|
|
49
|
+
/**
|
|
50
|
+
* When a Wix user deletes an automation, Wix sends the automation ID to your service endpoint, so that you can perform any necessary logic
|
|
51
|
+
* in your service. For example, you may want to delete data related to that Wix user if the trigger isn't used on the site.
|
|
52
|
+
*/
|
|
53
|
+
export declare function onAutomationDeleted(payload: OnAutomationDeletedEnvelope): OnAutomationDeletedResponse | Promise<OnAutomationDeletedResponse>;
|
|
@@ -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-error-classes"), exports);
|
|
18
|
+
__exportStar(require("./src/service-plugins-types"), exports);
|
|
19
|
+
//# sourceMappingURL=index.typings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.typings.js","sourceRoot":"","sources":["../../index.typings.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAeA,sEAAoD;AACpD,8DAA4C"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import './interfaces-automations-v1-trigger-provider.public.js';
|
|
2
|
+
import { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';
|
|
3
|
+
import { provideHandlers as publicProvideHandlers } from './interfaces-automations-v1-trigger-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-automations-v1-trigger-provider.public.js");
|
|
5
|
+
const service_plugin_modules_1 = require("@wix/sdk-runtime/service-plugin-modules");
|
|
6
|
+
const interfaces_automations_v1_trigger_provider_public_js_1 = require("./interfaces-automations-v1-trigger-provider.public.js");
|
|
7
|
+
Object.defineProperty(exports, "publicProvideHandlers", { enumerable: true, get: function () { return interfaces_automations_v1_trigger_provider_public_js_1.provideHandlers; } });
|
|
8
|
+
exports.provideHandlers = (0, service_plugin_modules_1.createServicePluginModule)(interfaces_automations_v1_trigger_provider_public_js_1.provideHandlers);
|
|
9
|
+
//# sourceMappingURL=interfaces-automations-v1-trigger-provider.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces-automations-v1-trigger-provider.context.js","sourceRoot":"","sources":["../../../src/interfaces-automations-v1-trigger-provider.context.ts"],"names":[],"mappings":";;;AAAA,kEAAgE;AAChE,oFAAoF;AACpF,iIAAkH;AAEzG,sGAFmB,sEAAqB,OAEnB;AAEjB,QAAA,eAAe,GAExB,IAAA,kDAAyB,EAAC,sEAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ServicePluginDefinition } from '@wix/sdk-types';
|
|
2
|
+
import { Context, ValidateConfigurationRequest, ValidateConfigurationResponse, GetDynamicSchemaRequest, GetDynamicSchemaResponse, RefreshPayloadRequest, RefreshPayloadResponse, OnAutomationSavedRequest, OnAutomationSavedResponse, OnAutomationDeletedRequest, OnAutomationDeletedResponse } from './service-plugins-types.js';
|
|
3
|
+
export interface ValidateConfigurationEnvelope {
|
|
4
|
+
request: ValidateConfigurationRequest;
|
|
5
|
+
metadata: Context;
|
|
6
|
+
}
|
|
7
|
+
export interface GetDynamicSchemaEnvelope {
|
|
8
|
+
request: GetDynamicSchemaRequest;
|
|
9
|
+
metadata: Context;
|
|
10
|
+
}
|
|
11
|
+
export interface RefreshPayloadEnvelope {
|
|
12
|
+
request: RefreshPayloadRequest;
|
|
13
|
+
metadata: Context;
|
|
14
|
+
}
|
|
15
|
+
export interface OnAutomationSavedEnvelope {
|
|
16
|
+
request: OnAutomationSavedRequest;
|
|
17
|
+
metadata: Context;
|
|
18
|
+
}
|
|
19
|
+
export interface OnAutomationDeletedEnvelope {
|
|
20
|
+
request: OnAutomationDeletedRequest;
|
|
21
|
+
metadata: Context;
|
|
22
|
+
}
|
|
23
|
+
export declare const provideHandlers: ServicePluginDefinition<{
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* This endpoint allows you to run your own logic to validate trigger fields. Implement this endpoint if you need to perform extra validation on top of
|
|
27
|
+
* the Wix validation process.
|
|
28
|
+
*
|
|
29
|
+
* Wix calls Validate Configuration in the following cases:
|
|
30
|
+
*
|
|
31
|
+
* - When a Wix user activates the automation.
|
|
32
|
+
* - When a Wix user selects the automation from the **Your automations** list in the [**Automations**](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Ftriggers/site-automations)
|
|
33
|
+
* dashboard.
|
|
34
|
+
* - When a Wix user opens the automation to edit it.
|
|
35
|
+
*
|
|
36
|
+
* If the user configured filters when setting up their automation, these are included in the request.
|
|
37
|
+
* Wix uses the returned response to display an error message to a user if the requested trigger is invalid. */
|
|
38
|
+
validateConfiguration(payload: ValidateConfigurationEnvelope): ValidateConfigurationResponse | Promise<ValidateConfigurationResponse>;
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
* This endpoint returns a [JSON schema](https://json-schema.org/) object
|
|
42
|
+
* that's used to dynamically update the fields available to a Wix user
|
|
43
|
+
* when they configure an [automation](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Ftriggers/site-automations).
|
|
44
|
+
*
|
|
45
|
+
* Wix calls this endpoint when a user selects an option from an
|
|
46
|
+
* [item selection filter](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/automations/triggers/filter-fields#item-selection)
|
|
47
|
+
* configured for a trigger.
|
|
48
|
+
* Wix appends the returned schema to the
|
|
49
|
+
* [payload schema](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/automations/triggers/payload-schema)
|
|
50
|
+
* you defined for the trigger and makes the fields available to the Wix user's automation. */
|
|
51
|
+
getDynamicSchema(payload: GetDynamicSchemaEnvelope): GetDynamicSchemaResponse | Promise<GetDynamicSchemaResponse>;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* If an automation's action is delayed, implement this method to retrieve the latest data in the trigger payload before the action fires.
|
|
55
|
+
*
|
|
56
|
+
* For example, if an automation is triggered but its action is set to fire only 24 hours later, Wix calls Refresh Payload before starting
|
|
57
|
+
* the action. This fetches the latest data in the trigger payload. The returned data can be used to update the trigger payload that is passed
|
|
58
|
+
* to the action. */
|
|
59
|
+
refreshPayload(payload: RefreshPayloadEnvelope): RefreshPayloadResponse | Promise<RefreshPayloadResponse>;
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
* When a Wix user saves an automation, Wix sends the updated automation to your service endpoint, so that you can perform any necessary logic
|
|
63
|
+
* in your service. */
|
|
64
|
+
onAutomationSaved(payload: OnAutomationSavedEnvelope): OnAutomationSavedResponse | Promise<OnAutomationSavedResponse>;
|
|
65
|
+
/**
|
|
66
|
+
*
|
|
67
|
+
* When a Wix user deletes an automation, Wix sends the automation ID to your service endpoint, so that you can perform any necessary logic
|
|
68
|
+
* in your service. For example, you may want to delete data related to that Wix user if the trigger isn't used on the site. */
|
|
69
|
+
onAutomationDeleted(payload: OnAutomationDeletedEnvelope): OnAutomationDeletedResponse | Promise<OnAutomationDeletedResponse>;
|
|
70
|
+
}>;
|
|
@@ -0,0 +1,89 @@
|
|
|
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 timestamp_1 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
6
|
+
const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
7
|
+
const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
8
|
+
exports.provideHandlers = (0, sdk_types_1.ServicePluginDefinition)('AUTOMATIONS_TRIGGER_PROVIDER', [
|
|
9
|
+
{
|
|
10
|
+
name: 'validateConfiguration',
|
|
11
|
+
primaryHttpMappingPath: '/validate-configuration',
|
|
12
|
+
transformations: {
|
|
13
|
+
toREST: (payload) => {
|
|
14
|
+
const toRestResponse = payload;
|
|
15
|
+
return (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)(toRestResponse);
|
|
16
|
+
},
|
|
17
|
+
fromREST: (payload) => {
|
|
18
|
+
const fromRestRequest = payload;
|
|
19
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(fromRestRequest);
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'getDynamicSchema',
|
|
25
|
+
primaryHttpMappingPath: '/dynamic-schema',
|
|
26
|
+
transformations: {
|
|
27
|
+
toREST: (payload) => {
|
|
28
|
+
const toRestResponse = payload;
|
|
29
|
+
return (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)(toRestResponse);
|
|
30
|
+
},
|
|
31
|
+
fromREST: (payload) => {
|
|
32
|
+
const fromRestRequest = payload;
|
|
33
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(fromRestRequest);
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'refreshPayload',
|
|
39
|
+
primaryHttpMappingPath: '/refresh-payload',
|
|
40
|
+
transformations: {
|
|
41
|
+
toREST: (payload) => {
|
|
42
|
+
const toRestResponse = payload;
|
|
43
|
+
return (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)(toRestResponse);
|
|
44
|
+
},
|
|
45
|
+
fromREST: (payload) => {
|
|
46
|
+
const fromRestRequest = payload;
|
|
47
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(fromRestRequest);
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'onAutomationSaved',
|
|
53
|
+
primaryHttpMappingPath: '/on-automation-saved',
|
|
54
|
+
transformations: {
|
|
55
|
+
toREST: (payload) => {
|
|
56
|
+
const toRestResponse = payload;
|
|
57
|
+
return (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)(toRestResponse);
|
|
58
|
+
},
|
|
59
|
+
fromREST: (payload) => {
|
|
60
|
+
const fromRestRequest = (0, transform_paths_1.transformPaths)(payload, [
|
|
61
|
+
{
|
|
62
|
+
transformFn: timestamp_1.transformRESTTimestampToSDKTimestamp,
|
|
63
|
+
paths: [
|
|
64
|
+
{ path: 'request.automation.createdDate' },
|
|
65
|
+
{ path: 'request.automation.updatedDate' },
|
|
66
|
+
{ path: 'request.automation.draftUpdatedDate' },
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
]);
|
|
70
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(fromRestRequest);
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'onAutomationDeleted',
|
|
76
|
+
primaryHttpMappingPath: '/on-automation-deleted',
|
|
77
|
+
transformations: {
|
|
78
|
+
toREST: (payload) => {
|
|
79
|
+
const toRestResponse = payload;
|
|
80
|
+
return (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)(toRestResponse);
|
|
81
|
+
},
|
|
82
|
+
fromREST: (payload) => {
|
|
83
|
+
const fromRestRequest = payload;
|
|
84
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(fromRestRequest);
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
]);
|
|
89
|
+
//# sourceMappingURL=interfaces-automations-v1-trigger-provider.public.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces-automations-v1-trigger-provider.public.js","sourceRoot":"","sources":["../../../src/interfaces-automations-v1-trigger-provider.public.ts"],"names":[],"mappings":";;;AAAA,8CAAyD;AAczD,0EAAkG;AAClG,sFAAkF;AAClF,oFAGiD;AA2BpC,QAAA,eAAe,GAAG,IAAA,mCAAuB,EA6DnD,8BAA8B,EAAE;IACjC;QACE,IAAI,EAAE,uBAAuB;QAC7B,sBAAsB,EAAE,yBAAyB;QACjD,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,OAAO,CAAC;gBAEhC,OAAO,IAAA,gEAAuC,EAAC,eAAe,CAAC,CAAC;YAClE,CAAC;SACF;KACF;IAED;QACE,IAAI,EAAE,kBAAkB;QACxB,sBAAsB,EAAE,iBAAiB;QACzC,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,OAAO,CAAC;gBAEhC,OAAO,IAAA,gEAAuC,EAAC,eAAe,CAAC,CAAC;YAClE,CAAC;SACF;KACF;IAED;QACE,IAAI,EAAE,gBAAgB;QACtB,sBAAsB,EAAE,kBAAkB;QAC1C,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,OAAO,CAAC;gBAEhC,OAAO,IAAA,gEAAuC,EAAC,eAAe,CAAC,CAAC;YAClE,CAAC;SACF;KACF;IAED;QACE,IAAI,EAAE,mBAAmB;QACzB,sBAAsB,EAAE,sBAAsB;QAC9C,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,gDAAoC;wBACjD,KAAK,EAAE;4BACL,EAAE,IAAI,EAAE,gCAAgC,EAAE;4BAC1C,EAAE,IAAI,EAAE,gCAAgC,EAAE;4BAC1C,EAAE,IAAI,EAAE,qCAAqC,EAAE;yBAChD;qBACF;iBACF,CAAC,CAAC;gBAEH,OAAO,IAAA,gEAAuC,EAAC,eAAe,CAAC,CAAC;YAClE,CAAC;SACF;KACF;IAED;QACE,IAAI,EAAE,qBAAqB;QAC3B,sBAAsB,EAAE,wBAAwB;QAChD,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,OAAO,CAAC;gBAEhC,OAAO,IAAA,gEAAuC,EAAC,eAAe,CAAC,CAAC;YAClE,CAAC;SACF;KACF;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare class ProviderNotFoundWixError extends Error {
|
|
2
|
+
/** @hidden */
|
|
3
|
+
httpCode: number;
|
|
4
|
+
/** @hidden */
|
|
5
|
+
statusCode: string;
|
|
6
|
+
/** @hidden */
|
|
7
|
+
applicationCode: string;
|
|
8
|
+
/** @hidden */
|
|
9
|
+
name: string;
|
|
10
|
+
/** @hidden */
|
|
11
|
+
errorType: string;
|
|
12
|
+
/** @hidden */
|
|
13
|
+
spiErrorData: object;
|
|
14
|
+
constructor();
|
|
15
|
+
/** @hidden */
|
|
16
|
+
static readonly __type = "wix_spi_error";
|
|
17
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProviderNotFoundWixError = void 0;
|
|
4
|
+
class ProviderNotFoundWixError extends Error {
|
|
5
|
+
constructor() {
|
|
6
|
+
super('ProviderNotFound');
|
|
7
|
+
this.httpCode = 404;
|
|
8
|
+
this.statusCode = 'NOT_FOUND';
|
|
9
|
+
this.applicationCode = 'PROVIDER_NOT_FOUND';
|
|
10
|
+
this.name = 'ProviderNotFound';
|
|
11
|
+
this.errorType = 'SPI';
|
|
12
|
+
this.spiErrorData = {
|
|
13
|
+
name: 'ProviderNotFound',
|
|
14
|
+
applicationCode: 'PROVIDER_NOT_FOUND',
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.ProviderNotFoundWixError = ProviderNotFoundWixError;
|
|
19
|
+
/** @hidden */
|
|
20
|
+
ProviderNotFoundWixError.__type = 'wix_spi_error';
|
|
21
|
+
//# sourceMappingURL=service-plugins-error-classes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-plugins-error-classes.js","sourceRoot":"","sources":["../../../src/service-plugins-error-classes.ts"],"names":[],"mappings":";;;AAAA,MAAa,wBAAyB,SAAQ,KAAK;IAcjD;QACE,KAAK,CAAC,kBAAkB,CAAC,CAAC;QAE1B,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC;QACpB,IAAI,CAAC,UAAU,GAAG,WAAW,CAAC;QAC9B,IAAI,CAAC,eAAe,GAAG,oBAAoB,CAAC;QAC5C,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;QAC/B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,YAAY,GAAG;YAClB,IAAI,EAAE,kBAAkB;YACxB,eAAe,EAAE,oBAAoB;SACtC,CAAC;IACJ,CAAC;;AA1BH,4DA8BC;AAFC,cAAc;AACE,+BAAM,GAAG,eAAe,CAAC"}
|