@wix/auto_sdk_data_movement-workflows 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 +48 -0
- package/build/cjs/index.js +573 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +1003 -0
- package/build/cjs/index.typings.js +475 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +759 -0
- package/build/cjs/meta.js +394 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/cjs/schemas.d.ts +478 -0
- package/build/cjs/schemas.js +748 -0
- package/build/cjs/schemas.js.map +1 -0
- package/build/es/index.d.mts +48 -0
- package/build/es/index.mjs +533 -0
- package/build/es/index.mjs.map +1 -0
- package/build/es/index.typings.d.mts +1003 -0
- package/build/es/index.typings.mjs +436 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +759 -0
- package/build/es/meta.mjs +354 -0
- package/build/es/meta.mjs.map +1 -0
- package/build/es/package.json +3 -0
- package/build/es/schemas.d.mts +478 -0
- package/build/es/schemas.mjs +704 -0
- package/build/es/schemas.mjs.map +1 -0
- package/build/internal/cjs/index.d.ts +48 -0
- package/build/internal/cjs/index.js +573 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +1014 -0
- package/build/internal/cjs/index.typings.js +475 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +759 -0
- package/build/internal/cjs/meta.js +394 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/cjs/schemas.d.ts +478 -0
- package/build/internal/cjs/schemas.js +748 -0
- package/build/internal/cjs/schemas.js.map +1 -0
- package/build/internal/es/index.d.mts +48 -0
- package/build/internal/es/index.mjs +533 -0
- package/build/internal/es/index.mjs.map +1 -0
- package/build/internal/es/index.typings.d.mts +1014 -0
- package/build/internal/es/index.typings.mjs +436 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +759 -0
- package/build/internal/es/meta.mjs +354 -0
- package/build/internal/es/meta.mjs.map +1 -0
- package/build/internal/es/schemas.d.mts +478 -0
- package/build/internal/es/schemas.mjs +704 -0
- package/build/internal/es/schemas.mjs.map +1 -0
- package/meta/package.json +3 -0
- package/package.json +61 -0
- package/schemas/package.json +3 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
|
|
2
|
+
import { Workflow, TerminateWorkflowResponse, WorkflowCreatedEnvelope, WorkflowUpdatedEnvelope, WorkflowsQueryBuilder, WorkflowQuery, typedQueryWorkflows } from './index.typings.js';
|
|
3
|
+
export { AccountInfo, AccountInfoMetadata, ActionEvent, BaseEventMetadata, CommonQueryWithEntityContext, CreateWorkflowRequest, CreateWorkflowResponse, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DataMovementJobLogs, Destination, DestinationDestinationOneOf, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, ExternalFileSource, Field, FieldType, FieldTypeWithLiterals, FileDestination, FileFormat, FileFormatWithLiterals, FileSource, GetWorkflowRequest, GetWorkflowResponse, GoogleSheetsSource, IdentificationData, IdentificationDataIdOneOf, JobSpec, JobSpecSiteOverrideOneOf, LocalizationDestination, LocalizationSource, MediaType, MediaTypeWithLiterals, MessageEnvelope, QueryWorkflowsRequest, QueryWorkflowsResponse, RestoreInfo, Schema, SortOrder, SortOrderWithLiterals, Sorting, Source, SourceSourceOneOf, Status, StatusWithLiterals, StoresCatalogProductsDestination, TerminateWorkflowRequest, TestDestination, TestSource, TestTransformation, Transformation, TransformationTransformationOneOf, WebhookIdentityType, WebhookIdentityTypeWithLiterals, WixDataCollectionDefinitionDestination, WixDataCollectionDefinitionSource, WixDataDestination, WixDataDestinationWritePolicy, WixDataDestinationWritePolicyWithLiterals, WixDataEnvironment, WixDataEnvironmentWithLiterals, WixDataSource, WixMediaDestination, WixMediaDestinationWritePolicy, WixMediaDestinationWritePolicyWithLiterals, WixMediaSource, WorkflowQuerySpec, WorkflowsQueryResult, WritePolicy, WritePolicyWithLiterals, utils } from './index.typings.js';
|
|
4
|
+
|
|
5
|
+
declare function createWorkflow$1(httpClient: HttpClient): CreateWorkflowSignature;
|
|
6
|
+
interface CreateWorkflowSignature {
|
|
7
|
+
/**
|
|
8
|
+
* Creates a workflow and persists its immutable execution plan.
|
|
9
|
+
* @param - Workflow to create.
|
|
10
|
+
* @returns Created workflow.
|
|
11
|
+
*/
|
|
12
|
+
(workflow: NonNullablePaths<Workflow, `specs`, 2>): Promise<NonNullablePaths<Workflow, `_id` | `status` | `specs` | `specs.${number}.sourceSiteId` | `specs.${number}.destinationSiteId` | `specs.${number}.source.wixDataCollection.collectionId` | `specs.${number}.source.file.format` | `specs.${number}.source.file.fileId` | `specs.${number}.source.file.url` | `specs.${number}.destination.wixDataCollection.collectionId` | `specs.${number}.destination.wixDataCollection.writePolicy` | `specs.${number}.destination.file.format` | `specs.${number}.destination.file.url`, 6>>;
|
|
13
|
+
}
|
|
14
|
+
declare function getWorkflow$1(httpClient: HttpClient): GetWorkflowSignature;
|
|
15
|
+
interface GetWorkflowSignature {
|
|
16
|
+
/**
|
|
17
|
+
* Retrieves a workflow by ID.
|
|
18
|
+
* @param - ID of the workflow to retrieve.
|
|
19
|
+
* @returns Retrieved workflow.
|
|
20
|
+
*/
|
|
21
|
+
(workflowId: string): Promise<NonNullablePaths<Workflow, `_id` | `status` | `specs` | `specs.${number}.sourceSiteId` | `specs.${number}.destinationSiteId` | `specs.${number}.source.wixDataCollection.collectionId` | `specs.${number}.source.file.format` | `specs.${number}.source.file.fileId` | `specs.${number}.source.file.url` | `specs.${number}.destination.wixDataCollection.collectionId` | `specs.${number}.destination.wixDataCollection.writePolicy` | `specs.${number}.destination.file.format` | `specs.${number}.destination.file.url`, 6>>;
|
|
22
|
+
}
|
|
23
|
+
declare function terminateWorkflow$1(httpClient: HttpClient): TerminateWorkflowSignature;
|
|
24
|
+
interface TerminateWorkflowSignature {
|
|
25
|
+
/**
|
|
26
|
+
* Terminates a workflow and prevents further step creation.
|
|
27
|
+
* @param - ID of the workflow to terminate.
|
|
28
|
+
* @returns Terminate workflow response.
|
|
29
|
+
*/
|
|
30
|
+
(workflowId: string): Promise<NonNullablePaths<TerminateWorkflowResponse, `workflow._id` | `workflow.status` | `workflow.specs` | `workflow.specs.${number}.sourceSiteId` | `workflow.specs.${number}.destinationSiteId` | `workflow.specs.${number}.source.wixDataCollection.collectionId` | `workflow.specs.${number}.source.file.format` | `workflow.specs.${number}.source.file.fileId` | `workflow.specs.${number}.source.file.url` | `workflow.specs.${number}.destination.wixDataCollection.collectionId` | `workflow.specs.${number}.destination.wixDataCollection.writePolicy` | `workflow.specs.${number}.destination.file.format` | `workflow.specs.${number}.destination.file.url`, 7>>;
|
|
31
|
+
}
|
|
32
|
+
declare const onWorkflowCreated$1: EventDefinition<WorkflowCreatedEnvelope, "wix.hub.v1.workflow_created">;
|
|
33
|
+
declare const onWorkflowUpdated$1: EventDefinition<WorkflowUpdatedEnvelope, "wix.hub.v1.workflow_updated">;
|
|
34
|
+
|
|
35
|
+
declare function customQueryWorkflows(httpClient: HttpClient): {
|
|
36
|
+
(): WorkflowsQueryBuilder;
|
|
37
|
+
(query: WorkflowQuery): ReturnType<typeof typedQueryWorkflows>;
|
|
38
|
+
};
|
|
39
|
+
declare const createWorkflow: MaybeContext<BuildRESTFunction<typeof createWorkflow$1> & typeof createWorkflow$1>;
|
|
40
|
+
declare const getWorkflow: MaybeContext<BuildRESTFunction<typeof getWorkflow$1> & typeof getWorkflow$1>;
|
|
41
|
+
declare const terminateWorkflow: MaybeContext<BuildRESTFunction<typeof terminateWorkflow$1> & typeof terminateWorkflow$1>;
|
|
42
|
+
declare const queryWorkflows: MaybeContext<BuildRESTFunction<typeof customQueryWorkflows> & typeof customQueryWorkflows>;
|
|
43
|
+
/** */
|
|
44
|
+
declare const onWorkflowCreated: BuildEventDefinition<typeof onWorkflowCreated$1> & typeof onWorkflowCreated$1;
|
|
45
|
+
/** */
|
|
46
|
+
declare const onWorkflowUpdated: BuildEventDefinition<typeof onWorkflowUpdated$1> & typeof onWorkflowUpdated$1;
|
|
47
|
+
|
|
48
|
+
export { TerminateWorkflowResponse, Workflow, WorkflowCreatedEnvelope, WorkflowQuery, WorkflowUpdatedEnvelope, WorkflowsQueryBuilder, createWorkflow, getWorkflow, onWorkflowCreated, onWorkflowUpdated, queryWorkflows, terminateWorkflow };
|
|
@@ -0,0 +1,573 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
FieldType: () => FieldType,
|
|
24
|
+
FileFormat: () => FileFormat,
|
|
25
|
+
MediaType: () => MediaType,
|
|
26
|
+
SortOrder: () => SortOrder,
|
|
27
|
+
Status: () => Status,
|
|
28
|
+
WebhookIdentityType: () => WebhookIdentityType,
|
|
29
|
+
WixDataDestinationWritePolicy: () => WixDataDestinationWritePolicy,
|
|
30
|
+
WixDataEnvironment: () => WixDataEnvironment,
|
|
31
|
+
WixMediaDestinationWritePolicy: () => WixMediaDestinationWritePolicy,
|
|
32
|
+
WritePolicy: () => WritePolicy,
|
|
33
|
+
createWorkflow: () => createWorkflow4,
|
|
34
|
+
getWorkflow: () => getWorkflow4,
|
|
35
|
+
onWorkflowCreated: () => onWorkflowCreated2,
|
|
36
|
+
onWorkflowUpdated: () => onWorkflowUpdated2,
|
|
37
|
+
queryWorkflows: () => queryWorkflows4,
|
|
38
|
+
terminateWorkflow: () => terminateWorkflow4,
|
|
39
|
+
utils: () => utils
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(index_exports);
|
|
42
|
+
|
|
43
|
+
// src/hub-v1-workflow-movement-workflows.public.ts
|
|
44
|
+
var import_rename_all_nested_keys2 = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
45
|
+
var import_timestamp3 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
46
|
+
var import_transform_paths3 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
47
|
+
var import_sdk_types = require("@wix/sdk-types");
|
|
48
|
+
|
|
49
|
+
// src/hub-v1-workflow-movement-workflows.universal.ts
|
|
50
|
+
var import_transform_error = require("@wix/sdk-runtime/transform-error");
|
|
51
|
+
var import_query_builder = require("@wix/sdk-runtime/query-builder");
|
|
52
|
+
var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
53
|
+
|
|
54
|
+
// src/hub-v1-workflow-movement-workflows.http.ts
|
|
55
|
+
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
56
|
+
var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
|
|
57
|
+
var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
58
|
+
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
59
|
+
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
60
|
+
function resolveWixHubV1DataMovementWorkflowServiceUrl(opts) {
|
|
61
|
+
const domainToMappings = {
|
|
62
|
+
"editor._base_domain_": [
|
|
63
|
+
{
|
|
64
|
+
srcPath: "/_api/wix-data-hub-workflow",
|
|
65
|
+
destPath: ""
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
"blocks._base_domain_": [
|
|
69
|
+
{
|
|
70
|
+
srcPath: "/_api/wix-data-hub-workflow",
|
|
71
|
+
destPath: ""
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"create.editorx": [
|
|
75
|
+
{
|
|
76
|
+
srcPath: "/_api/wix-data-hub-workflow",
|
|
77
|
+
destPath: ""
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
_: [
|
|
81
|
+
{
|
|
82
|
+
srcPath: "/_api/wix-data-hub-workflow",
|
|
83
|
+
destPath: ""
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
"manage._base_domain_": [
|
|
87
|
+
{
|
|
88
|
+
srcPath: "/_api/wix-data-hub-workflow",
|
|
89
|
+
destPath: ""
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"*.dev.wix-code.com": [
|
|
93
|
+
{
|
|
94
|
+
srcPath: "/_api/wix-data-hub-workflow",
|
|
95
|
+
destPath: ""
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
};
|
|
99
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
100
|
+
}
|
|
101
|
+
var PACKAGE_NAME = "@wix/auto_sdk_data_movement-workflows";
|
|
102
|
+
function createWorkflow(payload) {
|
|
103
|
+
function __createWorkflow({ host }) {
|
|
104
|
+
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
105
|
+
{
|
|
106
|
+
transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
|
|
107
|
+
paths: [
|
|
108
|
+
{ path: "workflow.createdDate" },
|
|
109
|
+
{ path: "workflow.updatedDate" }
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
]);
|
|
113
|
+
const metadata = {
|
|
114
|
+
entityFqdn: "wix.hub.v1.workflow",
|
|
115
|
+
method: "POST",
|
|
116
|
+
methodFqn: "wix.hub.v1.DataMovementWorkflowService.CreateWorkflow",
|
|
117
|
+
packageName: PACKAGE_NAME,
|
|
118
|
+
migrationOptions: {
|
|
119
|
+
optInTransformResponse: true
|
|
120
|
+
},
|
|
121
|
+
url: resolveWixHubV1DataMovementWorkflowServiceUrl({
|
|
122
|
+
protoPath: "/v1/workflows",
|
|
123
|
+
data: serializedData,
|
|
124
|
+
host
|
|
125
|
+
}),
|
|
126
|
+
data: serializedData,
|
|
127
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
128
|
+
{
|
|
129
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
130
|
+
paths: [
|
|
131
|
+
{ path: "workflow.createdDate" },
|
|
132
|
+
{ path: "workflow.updatedDate" }
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
])
|
|
136
|
+
};
|
|
137
|
+
return metadata;
|
|
138
|
+
}
|
|
139
|
+
return __createWorkflow;
|
|
140
|
+
}
|
|
141
|
+
function getWorkflow(payload) {
|
|
142
|
+
function __getWorkflow({ host }) {
|
|
143
|
+
const metadata = {
|
|
144
|
+
entityFqdn: "wix.hub.v1.workflow",
|
|
145
|
+
method: "GET",
|
|
146
|
+
methodFqn: "wix.hub.v1.DataMovementWorkflowService.GetWorkflow",
|
|
147
|
+
packageName: PACKAGE_NAME,
|
|
148
|
+
migrationOptions: {
|
|
149
|
+
optInTransformResponse: true
|
|
150
|
+
},
|
|
151
|
+
url: resolveWixHubV1DataMovementWorkflowServiceUrl({
|
|
152
|
+
protoPath: "/v1/workflows/{workflowId}",
|
|
153
|
+
data: payload,
|
|
154
|
+
host
|
|
155
|
+
}),
|
|
156
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
157
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
158
|
+
{
|
|
159
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
160
|
+
paths: [
|
|
161
|
+
{ path: "workflow.createdDate" },
|
|
162
|
+
{ path: "workflow.updatedDate" }
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
])
|
|
166
|
+
};
|
|
167
|
+
return metadata;
|
|
168
|
+
}
|
|
169
|
+
return __getWorkflow;
|
|
170
|
+
}
|
|
171
|
+
function queryWorkflows(payload) {
|
|
172
|
+
function __queryWorkflows({ host }) {
|
|
173
|
+
const metadata = {
|
|
174
|
+
entityFqdn: "wix.hub.v1.workflow",
|
|
175
|
+
method: "GET",
|
|
176
|
+
methodFqn: "wix.hub.v1.DataMovementWorkflowService.QueryWorkflows",
|
|
177
|
+
packageName: PACKAGE_NAME,
|
|
178
|
+
migrationOptions: {
|
|
179
|
+
optInTransformResponse: true
|
|
180
|
+
},
|
|
181
|
+
url: resolveWixHubV1DataMovementWorkflowServiceUrl({
|
|
182
|
+
protoPath: "/v1/workflows/query",
|
|
183
|
+
data: payload,
|
|
184
|
+
host
|
|
185
|
+
}),
|
|
186
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload, true),
|
|
187
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
188
|
+
{
|
|
189
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
190
|
+
paths: [
|
|
191
|
+
{ path: "workflows.createdDate" },
|
|
192
|
+
{ path: "workflows.updatedDate" }
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
]),
|
|
196
|
+
fallback: [
|
|
197
|
+
{
|
|
198
|
+
method: "POST",
|
|
199
|
+
url: resolveWixHubV1DataMovementWorkflowServiceUrl({
|
|
200
|
+
protoPath: "/v1/workflows/query",
|
|
201
|
+
data: payload,
|
|
202
|
+
host
|
|
203
|
+
}),
|
|
204
|
+
data: payload
|
|
205
|
+
}
|
|
206
|
+
]
|
|
207
|
+
};
|
|
208
|
+
return metadata;
|
|
209
|
+
}
|
|
210
|
+
return __queryWorkflows;
|
|
211
|
+
}
|
|
212
|
+
function terminateWorkflow(payload) {
|
|
213
|
+
function __terminateWorkflow({ host }) {
|
|
214
|
+
const metadata = {
|
|
215
|
+
entityFqdn: "wix.hub.v1.workflow",
|
|
216
|
+
method: "POST",
|
|
217
|
+
methodFqn: "wix.hub.v1.DataMovementWorkflowService.TerminateWorkflow",
|
|
218
|
+
packageName: PACKAGE_NAME,
|
|
219
|
+
migrationOptions: {
|
|
220
|
+
optInTransformResponse: true
|
|
221
|
+
},
|
|
222
|
+
url: resolveWixHubV1DataMovementWorkflowServiceUrl({
|
|
223
|
+
protoPath: "/v1/workflows/{workflowId}/terminate",
|
|
224
|
+
data: payload,
|
|
225
|
+
host
|
|
226
|
+
}),
|
|
227
|
+
data: payload,
|
|
228
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
229
|
+
{
|
|
230
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
231
|
+
paths: [
|
|
232
|
+
{ path: "workflow.createdDate" },
|
|
233
|
+
{ path: "workflow.updatedDate" }
|
|
234
|
+
]
|
|
235
|
+
}
|
|
236
|
+
])
|
|
237
|
+
};
|
|
238
|
+
return metadata;
|
|
239
|
+
}
|
|
240
|
+
return __terminateWorkflow;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// src/hub-v1-workflow-movement-workflows.universal.ts
|
|
244
|
+
var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
245
|
+
var import_query_builder_utils = require("@wix/sdk-runtime/query-builder-utils");
|
|
246
|
+
var Status = /* @__PURE__ */ ((Status2) => {
|
|
247
|
+
Status2["UNINITIALIZED"] = "UNINITIALIZED";
|
|
248
|
+
Status2["RUNNING"] = "RUNNING";
|
|
249
|
+
Status2["FINISHED"] = "FINISHED";
|
|
250
|
+
return Status2;
|
|
251
|
+
})(Status || {});
|
|
252
|
+
var WixDataEnvironment = /* @__PURE__ */ ((WixDataEnvironment2) => {
|
|
253
|
+
WixDataEnvironment2["LIVE"] = "LIVE";
|
|
254
|
+
WixDataEnvironment2["SANDBOX"] = "SANDBOX";
|
|
255
|
+
return WixDataEnvironment2;
|
|
256
|
+
})(WixDataEnvironment || {});
|
|
257
|
+
var FileFormat = /* @__PURE__ */ ((FileFormat2) => {
|
|
258
|
+
FileFormat2["UNKNOWN"] = "UNKNOWN";
|
|
259
|
+
FileFormat2["CSV"] = "CSV";
|
|
260
|
+
FileFormat2["JSONL"] = "JSONL";
|
|
261
|
+
return FileFormat2;
|
|
262
|
+
})(FileFormat || {});
|
|
263
|
+
var MediaType = /* @__PURE__ */ ((MediaType2) => {
|
|
264
|
+
MediaType2["ALL"] = "ALL";
|
|
265
|
+
MediaType2["IMAGE"] = "IMAGE";
|
|
266
|
+
MediaType2["VIDEO"] = "VIDEO";
|
|
267
|
+
MediaType2["AUDIO"] = "AUDIO";
|
|
268
|
+
MediaType2["DOCUMENT"] = "DOCUMENT";
|
|
269
|
+
return MediaType2;
|
|
270
|
+
})(MediaType || {});
|
|
271
|
+
var WixDataDestinationWritePolicy = /* @__PURE__ */ ((WixDataDestinationWritePolicy2) => {
|
|
272
|
+
WixDataDestinationWritePolicy2["OVERWRITE"] = "OVERWRITE";
|
|
273
|
+
WixDataDestinationWritePolicy2["SKIP_EXISTING"] = "SKIP_EXISTING";
|
|
274
|
+
WixDataDestinationWritePolicy2["TRUNCATE_BEFORE"] = "TRUNCATE_BEFORE";
|
|
275
|
+
return WixDataDestinationWritePolicy2;
|
|
276
|
+
})(WixDataDestinationWritePolicy || {});
|
|
277
|
+
var FieldType = /* @__PURE__ */ ((FieldType2) => {
|
|
278
|
+
FieldType2["ANY"] = "ANY";
|
|
279
|
+
FieldType2["STRING"] = "STRING";
|
|
280
|
+
FieldType2["NUMBER"] = "NUMBER";
|
|
281
|
+
FieldType2["BOOLEAN"] = "BOOLEAN";
|
|
282
|
+
FieldType2["DATE"] = "DATE";
|
|
283
|
+
FieldType2["DATETIME"] = "DATETIME";
|
|
284
|
+
FieldType2["BINARY"] = "BINARY";
|
|
285
|
+
FieldType2["OBJECT"] = "OBJECT";
|
|
286
|
+
FieldType2["ARRAY"] = "ARRAY";
|
|
287
|
+
FieldType2["URL"] = "URL";
|
|
288
|
+
FieldType2["WIX_MEDIA_URL"] = "WIX_MEDIA_URL";
|
|
289
|
+
FieldType2["WIX_MEDIA_IMAGE_URL"] = "WIX_MEDIA_IMAGE_URL";
|
|
290
|
+
FieldType2["WIX_MEDIA_VIDEO_URL"] = "WIX_MEDIA_VIDEO_URL";
|
|
291
|
+
FieldType2["WIX_MEDIA_DOCUMENT_URL"] = "WIX_MEDIA_DOCUMENT_URL";
|
|
292
|
+
FieldType2["IMAGE_URL"] = "IMAGE_URL";
|
|
293
|
+
FieldType2["VIDEO_URL"] = "VIDEO_URL";
|
|
294
|
+
return FieldType2;
|
|
295
|
+
})(FieldType || {});
|
|
296
|
+
var WixMediaDestinationWritePolicy = /* @__PURE__ */ ((WixMediaDestinationWritePolicy2) => {
|
|
297
|
+
WixMediaDestinationWritePolicy2["OVERWRITE"] = "OVERWRITE";
|
|
298
|
+
WixMediaDestinationWritePolicy2["SKIP_EXISTING"] = "SKIP_EXISTING";
|
|
299
|
+
return WixMediaDestinationWritePolicy2;
|
|
300
|
+
})(WixMediaDestinationWritePolicy || {});
|
|
301
|
+
var WritePolicy = /* @__PURE__ */ ((WritePolicy2) => {
|
|
302
|
+
WritePolicy2["SKIP_EXISTING"] = "SKIP_EXISTING";
|
|
303
|
+
WritePolicy2["OVERWRITE"] = "OVERWRITE";
|
|
304
|
+
return WritePolicy2;
|
|
305
|
+
})(WritePolicy || {});
|
|
306
|
+
var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
|
|
307
|
+
SortOrder2["ASC"] = "ASC";
|
|
308
|
+
SortOrder2["DESC"] = "DESC";
|
|
309
|
+
return SortOrder2;
|
|
310
|
+
})(SortOrder || {});
|
|
311
|
+
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
312
|
+
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
313
|
+
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
314
|
+
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
315
|
+
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
316
|
+
WebhookIdentityType2["APP"] = "APP";
|
|
317
|
+
return WebhookIdentityType2;
|
|
318
|
+
})(WebhookIdentityType || {});
|
|
319
|
+
async function createWorkflow2(workflow) {
|
|
320
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
321
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ workflow });
|
|
322
|
+
const reqOpts = createWorkflow(payload);
|
|
323
|
+
sideEffects?.onSiteCall?.();
|
|
324
|
+
try {
|
|
325
|
+
const result = await httpClient.request(reqOpts);
|
|
326
|
+
sideEffects?.onSuccess?.(result);
|
|
327
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.workflow;
|
|
328
|
+
} catch (err) {
|
|
329
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
330
|
+
err,
|
|
331
|
+
{
|
|
332
|
+
spreadPathsToArguments: {},
|
|
333
|
+
explicitPathsToArguments: { workflow: "$[0]" },
|
|
334
|
+
singleArgumentUnchanged: false
|
|
335
|
+
},
|
|
336
|
+
["workflow"]
|
|
337
|
+
);
|
|
338
|
+
sideEffects?.onError?.(err);
|
|
339
|
+
throw transformedError;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
async function getWorkflow2(workflowId) {
|
|
343
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
344
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
345
|
+
workflowId
|
|
346
|
+
});
|
|
347
|
+
const reqOpts = getWorkflow(payload);
|
|
348
|
+
sideEffects?.onSiteCall?.();
|
|
349
|
+
try {
|
|
350
|
+
const result = await httpClient.request(reqOpts);
|
|
351
|
+
sideEffects?.onSuccess?.(result);
|
|
352
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.workflow;
|
|
353
|
+
} catch (err) {
|
|
354
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
355
|
+
err,
|
|
356
|
+
{
|
|
357
|
+
spreadPathsToArguments: {},
|
|
358
|
+
explicitPathsToArguments: { workflowId: "$[0]" },
|
|
359
|
+
singleArgumentUnchanged: false
|
|
360
|
+
},
|
|
361
|
+
["workflowId"]
|
|
362
|
+
);
|
|
363
|
+
sideEffects?.onError?.(err);
|
|
364
|
+
throw transformedError;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
function queryWorkflows2() {
|
|
368
|
+
const { httpClient, sideEffects } = arguments[0];
|
|
369
|
+
return (0, import_query_builder.queryBuilder)({
|
|
370
|
+
func: async (payload) => {
|
|
371
|
+
const reqOpts = queryWorkflows(payload);
|
|
372
|
+
sideEffects?.onSiteCall?.();
|
|
373
|
+
try {
|
|
374
|
+
const result = await httpClient.request(reqOpts);
|
|
375
|
+
sideEffects?.onSuccess?.(result);
|
|
376
|
+
return result;
|
|
377
|
+
} catch (err) {
|
|
378
|
+
sideEffects?.onError?.(err);
|
|
379
|
+
throw err;
|
|
380
|
+
}
|
|
381
|
+
},
|
|
382
|
+
requestTransformer: (query) => {
|
|
383
|
+
const args = [query, {}];
|
|
384
|
+
return (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
385
|
+
...args?.[1],
|
|
386
|
+
query: args?.[0]
|
|
387
|
+
});
|
|
388
|
+
},
|
|
389
|
+
responseTransformer: ({ data }) => {
|
|
390
|
+
const transformedData = (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
|
|
391
|
+
(0, import_transform_paths2.transformPaths)(data, [])
|
|
392
|
+
);
|
|
393
|
+
return {
|
|
394
|
+
items: transformedData?.workflows,
|
|
395
|
+
pagingMetadata: transformedData?.pagingMetadata
|
|
396
|
+
};
|
|
397
|
+
},
|
|
398
|
+
errorTransformer: (err) => {
|
|
399
|
+
const transformedError = (0, import_transform_error.transformError)(err, {
|
|
400
|
+
spreadPathsToArguments: {},
|
|
401
|
+
explicitPathsToArguments: { query: "$[0]" },
|
|
402
|
+
singleArgumentUnchanged: false
|
|
403
|
+
});
|
|
404
|
+
throw transformedError;
|
|
405
|
+
},
|
|
406
|
+
pagingMethod: "CURSOR",
|
|
407
|
+
transformationPaths: {}
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
async function typedQueryWorkflows(query) {
|
|
411
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
412
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ query });
|
|
413
|
+
const reqOpts = queryWorkflows(payload);
|
|
414
|
+
sideEffects?.onSiteCall?.();
|
|
415
|
+
try {
|
|
416
|
+
const result = await httpClient.request(reqOpts);
|
|
417
|
+
sideEffects?.onSuccess?.(result);
|
|
418
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
419
|
+
} catch (err) {
|
|
420
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
421
|
+
err,
|
|
422
|
+
{
|
|
423
|
+
spreadPathsToArguments: {},
|
|
424
|
+
explicitPathsToArguments: { query: "$[0]" },
|
|
425
|
+
singleArgumentUnchanged: false
|
|
426
|
+
},
|
|
427
|
+
["query"]
|
|
428
|
+
);
|
|
429
|
+
sideEffects?.onError?.(err);
|
|
430
|
+
throw transformedError;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
var utils = {
|
|
434
|
+
query: {
|
|
435
|
+
...(0, import_query_builder_utils.createQueryUtils)()
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
async function terminateWorkflow2(workflowId) {
|
|
439
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
440
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
441
|
+
workflowId
|
|
442
|
+
});
|
|
443
|
+
const reqOpts = terminateWorkflow(payload);
|
|
444
|
+
sideEffects?.onSiteCall?.();
|
|
445
|
+
try {
|
|
446
|
+
const result = await httpClient.request(reqOpts);
|
|
447
|
+
sideEffects?.onSuccess?.(result);
|
|
448
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
449
|
+
} catch (err) {
|
|
450
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
451
|
+
err,
|
|
452
|
+
{
|
|
453
|
+
spreadPathsToArguments: {},
|
|
454
|
+
explicitPathsToArguments: { workflowId: "$[0]" },
|
|
455
|
+
singleArgumentUnchanged: false
|
|
456
|
+
},
|
|
457
|
+
["workflowId"]
|
|
458
|
+
);
|
|
459
|
+
sideEffects?.onError?.(err);
|
|
460
|
+
throw transformedError;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
// src/hub-v1-workflow-movement-workflows.public.ts
|
|
465
|
+
function createWorkflow3(httpClient) {
|
|
466
|
+
return (workflow) => createWorkflow2(
|
|
467
|
+
workflow,
|
|
468
|
+
// @ts-ignore
|
|
469
|
+
{ httpClient }
|
|
470
|
+
);
|
|
471
|
+
}
|
|
472
|
+
function getWorkflow3(httpClient) {
|
|
473
|
+
return (workflowId) => getWorkflow2(
|
|
474
|
+
workflowId,
|
|
475
|
+
// @ts-ignore
|
|
476
|
+
{ httpClient }
|
|
477
|
+
);
|
|
478
|
+
}
|
|
479
|
+
function queryWorkflows3(httpClient) {
|
|
480
|
+
return () => queryWorkflows2(
|
|
481
|
+
// @ts-ignore
|
|
482
|
+
{ httpClient }
|
|
483
|
+
);
|
|
484
|
+
}
|
|
485
|
+
function typedQueryWorkflows2(httpClient) {
|
|
486
|
+
return (query) => typedQueryWorkflows(
|
|
487
|
+
query,
|
|
488
|
+
// @ts-ignore
|
|
489
|
+
{ httpClient }
|
|
490
|
+
);
|
|
491
|
+
}
|
|
492
|
+
function terminateWorkflow3(httpClient) {
|
|
493
|
+
return (workflowId) => terminateWorkflow2(
|
|
494
|
+
workflowId,
|
|
495
|
+
// @ts-ignore
|
|
496
|
+
{ httpClient }
|
|
497
|
+
);
|
|
498
|
+
}
|
|
499
|
+
var onWorkflowCreated = (0, import_sdk_types.EventDefinition)(
|
|
500
|
+
"wix.hub.v1.workflow_created",
|
|
501
|
+
true,
|
|
502
|
+
(event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
|
|
503
|
+
(0, import_transform_paths3.transformPaths)(event, [
|
|
504
|
+
{
|
|
505
|
+
transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
|
|
506
|
+
paths: [
|
|
507
|
+
{ path: "entity.createdDate" },
|
|
508
|
+
{ path: "entity.updatedDate" },
|
|
509
|
+
{ path: "metadata.eventTime" }
|
|
510
|
+
]
|
|
511
|
+
}
|
|
512
|
+
])
|
|
513
|
+
)
|
|
514
|
+
)();
|
|
515
|
+
var onWorkflowUpdated = (0, import_sdk_types.EventDefinition)(
|
|
516
|
+
"wix.hub.v1.workflow_updated",
|
|
517
|
+
true,
|
|
518
|
+
(event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
|
|
519
|
+
(0, import_transform_paths3.transformPaths)(event, [
|
|
520
|
+
{
|
|
521
|
+
transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
|
|
522
|
+
paths: [
|
|
523
|
+
{ path: "entity.createdDate" },
|
|
524
|
+
{ path: "entity.updatedDate" },
|
|
525
|
+
{ path: "metadata.eventTime" }
|
|
526
|
+
]
|
|
527
|
+
}
|
|
528
|
+
])
|
|
529
|
+
)
|
|
530
|
+
)();
|
|
531
|
+
|
|
532
|
+
// src/hub-v1-workflow-movement-workflows.context.ts
|
|
533
|
+
var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
|
|
534
|
+
var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
|
|
535
|
+
var import_query_method_router = require("@wix/sdk-runtime/query-method-router");
|
|
536
|
+
function customQueryWorkflows(httpClient) {
|
|
537
|
+
const router = (0, import_query_method_router.createQueryOverloadRouter)({
|
|
538
|
+
builderQueryFunction: () => queryWorkflows3(httpClient)(),
|
|
539
|
+
typedQueryFunction: (query) => typedQueryWorkflows2(httpClient)(query),
|
|
540
|
+
hasOptionsParameter: false
|
|
541
|
+
});
|
|
542
|
+
function overloadedQuery(query) {
|
|
543
|
+
return router(...arguments);
|
|
544
|
+
}
|
|
545
|
+
return overloadedQuery;
|
|
546
|
+
}
|
|
547
|
+
var createWorkflow4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createWorkflow3);
|
|
548
|
+
var getWorkflow4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getWorkflow3);
|
|
549
|
+
var terminateWorkflow4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(terminateWorkflow3);
|
|
550
|
+
var queryWorkflows4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQueryWorkflows);
|
|
551
|
+
var onWorkflowCreated2 = (0, import_event_definition_modules.createEventModule)(onWorkflowCreated);
|
|
552
|
+
var onWorkflowUpdated2 = (0, import_event_definition_modules.createEventModule)(onWorkflowUpdated);
|
|
553
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
554
|
+
0 && (module.exports = {
|
|
555
|
+
FieldType,
|
|
556
|
+
FileFormat,
|
|
557
|
+
MediaType,
|
|
558
|
+
SortOrder,
|
|
559
|
+
Status,
|
|
560
|
+
WebhookIdentityType,
|
|
561
|
+
WixDataDestinationWritePolicy,
|
|
562
|
+
WixDataEnvironment,
|
|
563
|
+
WixMediaDestinationWritePolicy,
|
|
564
|
+
WritePolicy,
|
|
565
|
+
createWorkflow,
|
|
566
|
+
getWorkflow,
|
|
567
|
+
onWorkflowCreated,
|
|
568
|
+
onWorkflowUpdated,
|
|
569
|
+
queryWorkflows,
|
|
570
|
+
terminateWorkflow,
|
|
571
|
+
utils
|
|
572
|
+
});
|
|
573
|
+
//# sourceMappingURL=index.js.map
|