@wix/auto_sdk_containers_plans 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 +708 -0
- package/build/cjs/index.js +731 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +1 -0
- package/build/cjs/index.typings.js +642 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +678 -0
- package/build/cjs/meta.js +571 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/es/index.d.mts +708 -0
- package/build/es/index.mjs +694 -0
- package/build/es/index.mjs.map +1 -0
- package/build/es/index.typings.d.mts +1 -0
- package/build/es/index.typings.mjs +605 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +678 -0
- package/build/es/meta.mjs +531 -0
- package/build/es/meta.mjs.map +1 -0
- package/build/es/package.json +3 -0
- package/build/internal/cjs/index.d.ts +132 -0
- package/build/internal/cjs/index.typings.d.ts +842 -0
- package/build/internal/cjs/meta.d.ts +726 -0
- package/build/internal/es/index.d.mts +132 -0
- package/build/internal/es/index.typings.d.mts +842 -0
- package/build/internal/es/meta.d.mts +726 -0
- package/meta/package.json +3 -0
- package/package.json +54 -0
|
@@ -0,0 +1,605 @@
|
|
|
1
|
+
// src/containers-plans-v1-plan-plans.universal.ts
|
|
2
|
+
import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
|
|
3
|
+
import {
|
|
4
|
+
renameKeysFromSDKRequestToRESTRequest,
|
|
5
|
+
renameKeysFromRESTResponseToSDKResponse
|
|
6
|
+
} from "@wix/sdk-runtime/rename-all-nested-keys";
|
|
7
|
+
|
|
8
|
+
// src/containers-plans-v1-plan-plans.http.ts
|
|
9
|
+
import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
|
|
10
|
+
import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
|
|
11
|
+
import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
|
|
12
|
+
import { transformSDKFieldMaskToRESTFieldMask } from "@wix/sdk-runtime/transformations/field-mask";
|
|
13
|
+
import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
14
|
+
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
15
|
+
function resolveWixContainersPlansV1ContainersPlansUrl(opts) {
|
|
16
|
+
const domainToMappings = {
|
|
17
|
+
"manage._base_domain_": [
|
|
18
|
+
{
|
|
19
|
+
srcPath: "/_api/containers-plans",
|
|
20
|
+
destPath: ""
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
};
|
|
24
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
25
|
+
}
|
|
26
|
+
var PACKAGE_NAME = "@wix/auto_sdk_containers_plans";
|
|
27
|
+
function createPlan(payload) {
|
|
28
|
+
function __createPlan({ host }) {
|
|
29
|
+
const serializedData = transformPaths(payload, [
|
|
30
|
+
{
|
|
31
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
|
32
|
+
paths: [{ path: "plan.createdDate" }, { path: "plan.updatedDate" }]
|
|
33
|
+
}
|
|
34
|
+
]);
|
|
35
|
+
const metadata = {
|
|
36
|
+
entityFqdn: "wix.containers.plans.v1.plan",
|
|
37
|
+
method: "POST",
|
|
38
|
+
methodFqn: "wix.containers.plans.v1.ContainersPlans.CreatePlan",
|
|
39
|
+
packageName: PACKAGE_NAME,
|
|
40
|
+
migrationOptions: {
|
|
41
|
+
optInTransformResponse: true
|
|
42
|
+
},
|
|
43
|
+
url: resolveWixContainersPlansV1ContainersPlansUrl({
|
|
44
|
+
protoPath: "/v1/plans",
|
|
45
|
+
data: serializedData,
|
|
46
|
+
host
|
|
47
|
+
}),
|
|
48
|
+
data: serializedData,
|
|
49
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
50
|
+
{
|
|
51
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
52
|
+
paths: [{ path: "plan.createdDate" }, { path: "plan.updatedDate" }]
|
|
53
|
+
}
|
|
54
|
+
])
|
|
55
|
+
};
|
|
56
|
+
return metadata;
|
|
57
|
+
}
|
|
58
|
+
return __createPlan;
|
|
59
|
+
}
|
|
60
|
+
function createAndGeneratePlan(payload) {
|
|
61
|
+
function __createAndGeneratePlan({ host }) {
|
|
62
|
+
const serializedData = transformPaths(payload, [
|
|
63
|
+
{
|
|
64
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
|
65
|
+
paths: [{ path: "plan.createdDate" }, { path: "plan.updatedDate" }]
|
|
66
|
+
}
|
|
67
|
+
]);
|
|
68
|
+
const metadata = {
|
|
69
|
+
entityFqdn: "wix.containers.plans.v1.plan",
|
|
70
|
+
method: "POST",
|
|
71
|
+
methodFqn: "wix.containers.plans.v1.ContainersPlans.CreateAndGeneratePlan",
|
|
72
|
+
packageName: PACKAGE_NAME,
|
|
73
|
+
migrationOptions: {
|
|
74
|
+
optInTransformResponse: true
|
|
75
|
+
},
|
|
76
|
+
url: resolveWixContainersPlansV1ContainersPlansUrl({
|
|
77
|
+
protoPath: "/v1/plans/create-and-generate",
|
|
78
|
+
data: serializedData,
|
|
79
|
+
host
|
|
80
|
+
}),
|
|
81
|
+
data: serializedData,
|
|
82
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
83
|
+
{
|
|
84
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
85
|
+
paths: [{ path: "plan.createdDate" }, { path: "plan.updatedDate" }]
|
|
86
|
+
}
|
|
87
|
+
])
|
|
88
|
+
};
|
|
89
|
+
return metadata;
|
|
90
|
+
}
|
|
91
|
+
return __createAndGeneratePlan;
|
|
92
|
+
}
|
|
93
|
+
function getPlan(payload) {
|
|
94
|
+
function __getPlan({ host }) {
|
|
95
|
+
const metadata = {
|
|
96
|
+
entityFqdn: "wix.containers.plans.v1.plan",
|
|
97
|
+
method: "GET",
|
|
98
|
+
methodFqn: "wix.containers.plans.v1.ContainersPlans.GetPlan",
|
|
99
|
+
packageName: PACKAGE_NAME,
|
|
100
|
+
migrationOptions: {
|
|
101
|
+
optInTransformResponse: true
|
|
102
|
+
},
|
|
103
|
+
url: resolveWixContainersPlansV1ContainersPlansUrl({
|
|
104
|
+
protoPath: "/v1/plans/{planId}",
|
|
105
|
+
data: payload,
|
|
106
|
+
host
|
|
107
|
+
}),
|
|
108
|
+
params: toURLSearchParams(payload),
|
|
109
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
110
|
+
{
|
|
111
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
112
|
+
paths: [{ path: "plan.createdDate" }, { path: "plan.updatedDate" }]
|
|
113
|
+
}
|
|
114
|
+
])
|
|
115
|
+
};
|
|
116
|
+
return metadata;
|
|
117
|
+
}
|
|
118
|
+
return __getPlan;
|
|
119
|
+
}
|
|
120
|
+
function getPlanByProjectId(payload) {
|
|
121
|
+
function __getPlanByProjectId({ host }) {
|
|
122
|
+
const metadata = {
|
|
123
|
+
entityFqdn: "wix.containers.plans.v1.plan",
|
|
124
|
+
method: "GET",
|
|
125
|
+
methodFqn: "wix.containers.plans.v1.ContainersPlans.GetPlanByProjectId",
|
|
126
|
+
packageName: PACKAGE_NAME,
|
|
127
|
+
migrationOptions: {
|
|
128
|
+
optInTransformResponse: true
|
|
129
|
+
},
|
|
130
|
+
url: resolveWixContainersPlansV1ContainersPlansUrl({
|
|
131
|
+
protoPath: "/v1/plans/by-project/{projectId}",
|
|
132
|
+
data: payload,
|
|
133
|
+
host
|
|
134
|
+
}),
|
|
135
|
+
params: toURLSearchParams(payload),
|
|
136
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
137
|
+
{
|
|
138
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
139
|
+
paths: [{ path: "plan.createdDate" }, { path: "plan.updatedDate" }]
|
|
140
|
+
}
|
|
141
|
+
])
|
|
142
|
+
};
|
|
143
|
+
return metadata;
|
|
144
|
+
}
|
|
145
|
+
return __getPlanByProjectId;
|
|
146
|
+
}
|
|
147
|
+
function updatePlan(payload) {
|
|
148
|
+
function __updatePlan({ host }) {
|
|
149
|
+
const serializedData = transformPaths(payload, [
|
|
150
|
+
{
|
|
151
|
+
transformFn: transformSDKFieldMaskToRESTFieldMask,
|
|
152
|
+
paths: [{ path: "fieldMask" }]
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
|
156
|
+
paths: [{ path: "plan.createdDate" }, { path: "plan.updatedDate" }]
|
|
157
|
+
}
|
|
158
|
+
]);
|
|
159
|
+
const metadata = {
|
|
160
|
+
entityFqdn: "wix.containers.plans.v1.plan",
|
|
161
|
+
method: "PATCH",
|
|
162
|
+
methodFqn: "wix.containers.plans.v1.ContainersPlans.UpdatePlan",
|
|
163
|
+
packageName: PACKAGE_NAME,
|
|
164
|
+
migrationOptions: {
|
|
165
|
+
optInTransformResponse: true
|
|
166
|
+
},
|
|
167
|
+
url: resolveWixContainersPlansV1ContainersPlansUrl({
|
|
168
|
+
protoPath: "/v1/plans/{plan.id}",
|
|
169
|
+
data: serializedData,
|
|
170
|
+
host
|
|
171
|
+
}),
|
|
172
|
+
data: serializedData,
|
|
173
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
174
|
+
{
|
|
175
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
176
|
+
paths: [{ path: "plan.createdDate" }, { path: "plan.updatedDate" }]
|
|
177
|
+
}
|
|
178
|
+
])
|
|
179
|
+
};
|
|
180
|
+
return metadata;
|
|
181
|
+
}
|
|
182
|
+
return __updatePlan;
|
|
183
|
+
}
|
|
184
|
+
function deletePlan(payload) {
|
|
185
|
+
function __deletePlan({ host }) {
|
|
186
|
+
const metadata = {
|
|
187
|
+
entityFqdn: "wix.containers.plans.v1.plan",
|
|
188
|
+
method: "DELETE",
|
|
189
|
+
methodFqn: "wix.containers.plans.v1.ContainersPlans.DeletePlan",
|
|
190
|
+
packageName: PACKAGE_NAME,
|
|
191
|
+
migrationOptions: {
|
|
192
|
+
optInTransformResponse: true
|
|
193
|
+
},
|
|
194
|
+
url: resolveWixContainersPlansV1ContainersPlansUrl({
|
|
195
|
+
protoPath: "/v1/plans/{planId}",
|
|
196
|
+
data: payload,
|
|
197
|
+
host
|
|
198
|
+
}),
|
|
199
|
+
params: toURLSearchParams(payload)
|
|
200
|
+
};
|
|
201
|
+
return metadata;
|
|
202
|
+
}
|
|
203
|
+
return __deletePlan;
|
|
204
|
+
}
|
|
205
|
+
function generatePlan(payload) {
|
|
206
|
+
function __generatePlan({ host }) {
|
|
207
|
+
const metadata = {
|
|
208
|
+
entityFqdn: "wix.containers.plans.v1.plan",
|
|
209
|
+
method: "POST",
|
|
210
|
+
methodFqn: "wix.containers.plans.v1.ContainersPlans.GeneratePlan",
|
|
211
|
+
packageName: PACKAGE_NAME,
|
|
212
|
+
migrationOptions: {
|
|
213
|
+
optInTransformResponse: true
|
|
214
|
+
},
|
|
215
|
+
url: resolveWixContainersPlansV1ContainersPlansUrl({
|
|
216
|
+
protoPath: "/v1/plans/{planId}/generate",
|
|
217
|
+
data: payload,
|
|
218
|
+
host
|
|
219
|
+
}),
|
|
220
|
+
data: payload,
|
|
221
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
222
|
+
{
|
|
223
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
224
|
+
paths: [{ path: "plan.createdDate" }, { path: "plan.updatedDate" }]
|
|
225
|
+
}
|
|
226
|
+
])
|
|
227
|
+
};
|
|
228
|
+
return metadata;
|
|
229
|
+
}
|
|
230
|
+
return __generatePlan;
|
|
231
|
+
}
|
|
232
|
+
function modifyPlan(payload) {
|
|
233
|
+
function __modifyPlan({ host }) {
|
|
234
|
+
const metadata = {
|
|
235
|
+
entityFqdn: "wix.containers.plans.v1.plan",
|
|
236
|
+
method: "POST",
|
|
237
|
+
methodFqn: "wix.containers.plans.v1.ContainersPlans.ModifyPlan",
|
|
238
|
+
packageName: PACKAGE_NAME,
|
|
239
|
+
migrationOptions: {
|
|
240
|
+
optInTransformResponse: true
|
|
241
|
+
},
|
|
242
|
+
url: resolveWixContainersPlansV1ContainersPlansUrl({
|
|
243
|
+
protoPath: "/v1/plans/{planId}/modify",
|
|
244
|
+
data: payload,
|
|
245
|
+
host
|
|
246
|
+
}),
|
|
247
|
+
data: payload,
|
|
248
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
249
|
+
{
|
|
250
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
251
|
+
paths: [{ path: "plan.createdDate" }, { path: "plan.updatedDate" }]
|
|
252
|
+
}
|
|
253
|
+
])
|
|
254
|
+
};
|
|
255
|
+
return metadata;
|
|
256
|
+
}
|
|
257
|
+
return __modifyPlan;
|
|
258
|
+
}
|
|
259
|
+
function regenerateIcon(payload) {
|
|
260
|
+
function __regenerateIcon({ host }) {
|
|
261
|
+
const metadata = {
|
|
262
|
+
entityFqdn: "wix.containers.plans.v1.plan",
|
|
263
|
+
method: "POST",
|
|
264
|
+
methodFqn: "wix.containers.plans.v1.ContainersPlans.RegenerateIcon",
|
|
265
|
+
packageName: PACKAGE_NAME,
|
|
266
|
+
migrationOptions: {
|
|
267
|
+
optInTransformResponse: true
|
|
268
|
+
},
|
|
269
|
+
url: resolveWixContainersPlansV1ContainersPlansUrl({
|
|
270
|
+
protoPath: "/v1/plans/{planId}/regenerate-icon",
|
|
271
|
+
data: payload,
|
|
272
|
+
host
|
|
273
|
+
}),
|
|
274
|
+
data: payload
|
|
275
|
+
};
|
|
276
|
+
return metadata;
|
|
277
|
+
}
|
|
278
|
+
return __regenerateIcon;
|
|
279
|
+
}
|
|
280
|
+
function finalizePlan(payload) {
|
|
281
|
+
function __finalizePlan({ host }) {
|
|
282
|
+
const metadata = {
|
|
283
|
+
entityFqdn: "wix.containers.plans.v1.plan",
|
|
284
|
+
method: "POST",
|
|
285
|
+
methodFqn: "wix.containers.plans.v1.ContainersPlans.FinalizePlan",
|
|
286
|
+
packageName: PACKAGE_NAME,
|
|
287
|
+
migrationOptions: {
|
|
288
|
+
optInTransformResponse: true
|
|
289
|
+
},
|
|
290
|
+
url: resolveWixContainersPlansV1ContainersPlansUrl({
|
|
291
|
+
protoPath: "/v1/plans/{planId}/finalize",
|
|
292
|
+
data: payload,
|
|
293
|
+
host
|
|
294
|
+
}),
|
|
295
|
+
data: payload,
|
|
296
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
297
|
+
{
|
|
298
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
299
|
+
paths: [{ path: "plan.createdDate" }, { path: "plan.updatedDate" }]
|
|
300
|
+
}
|
|
301
|
+
])
|
|
302
|
+
};
|
|
303
|
+
return metadata;
|
|
304
|
+
}
|
|
305
|
+
return __finalizePlan;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// src/containers-plans-v1-plan-plans.universal.ts
|
|
309
|
+
var Platform = /* @__PURE__ */ ((Platform2) => {
|
|
310
|
+
Platform2["HIMALAYA_MOBILE"] = "HIMALAYA_MOBILE";
|
|
311
|
+
return Platform2;
|
|
312
|
+
})(Platform || {});
|
|
313
|
+
var PlanStatus = /* @__PURE__ */ ((PlanStatus2) => {
|
|
314
|
+
PlanStatus2["DRAFT"] = "DRAFT";
|
|
315
|
+
PlanStatus2["FINALIZED"] = "FINALIZED";
|
|
316
|
+
return PlanStatus2;
|
|
317
|
+
})(PlanStatus || {});
|
|
318
|
+
var PlanPartType = /* @__PURE__ */ ((PlanPartType2) => {
|
|
319
|
+
PlanPartType2["APP_NAME"] = "APP_NAME";
|
|
320
|
+
PlanPartType2["APP_DESCRIPTION"] = "APP_DESCRIPTION";
|
|
321
|
+
PlanPartType2["BUSINESS_GOAL"] = "BUSINESS_GOAL";
|
|
322
|
+
PlanPartType2["AUDIENCE"] = "AUDIENCE";
|
|
323
|
+
PlanPartType2["FEATURE"] = "FEATURE";
|
|
324
|
+
PlanPartType2["SCREEN"] = "SCREEN";
|
|
325
|
+
PlanPartType2["WIX_INTEGRATION"] = "WIX_INTEGRATION";
|
|
326
|
+
PlanPartType2["THIRD_PARTY_INTEGRATION"] = "THIRD_PARTY_INTEGRATION";
|
|
327
|
+
PlanPartType2["BRAND_IDENTITY"] = "BRAND_IDENTITY";
|
|
328
|
+
PlanPartType2["COLOR_THEME"] = "COLOR_THEME";
|
|
329
|
+
PlanPartType2["TEXT_THEME"] = "TEXT_THEME";
|
|
330
|
+
return PlanPartType2;
|
|
331
|
+
})(PlanPartType || {});
|
|
332
|
+
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
333
|
+
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
334
|
+
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
335
|
+
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
336
|
+
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
337
|
+
WebhookIdentityType2["APP"] = "APP";
|
|
338
|
+
return WebhookIdentityType2;
|
|
339
|
+
})(WebhookIdentityType || {});
|
|
340
|
+
async function createPlan2(plan) {
|
|
341
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
342
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({ plan });
|
|
343
|
+
const reqOpts = createPlan(payload);
|
|
344
|
+
sideEffects?.onSiteCall?.();
|
|
345
|
+
try {
|
|
346
|
+
const result = await httpClient.request(reqOpts);
|
|
347
|
+
sideEffects?.onSuccess?.(result);
|
|
348
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data)?.plan;
|
|
349
|
+
} catch (err) {
|
|
350
|
+
const transformedError = sdkTransformError(
|
|
351
|
+
err,
|
|
352
|
+
{
|
|
353
|
+
spreadPathsToArguments: {},
|
|
354
|
+
explicitPathsToArguments: { plan: "$[0]" },
|
|
355
|
+
singleArgumentUnchanged: false
|
|
356
|
+
},
|
|
357
|
+
["plan"]
|
|
358
|
+
);
|
|
359
|
+
sideEffects?.onError?.(err);
|
|
360
|
+
throw transformedError;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
async function createAndGeneratePlan2(plan) {
|
|
364
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
365
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({ plan });
|
|
366
|
+
const reqOpts = createAndGeneratePlan(payload);
|
|
367
|
+
sideEffects?.onSiteCall?.();
|
|
368
|
+
try {
|
|
369
|
+
const result = await httpClient.request(reqOpts);
|
|
370
|
+
sideEffects?.onSuccess?.(result);
|
|
371
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
372
|
+
} catch (err) {
|
|
373
|
+
const transformedError = sdkTransformError(
|
|
374
|
+
err,
|
|
375
|
+
{
|
|
376
|
+
spreadPathsToArguments: {},
|
|
377
|
+
explicitPathsToArguments: { plan: "$[0]" },
|
|
378
|
+
singleArgumentUnchanged: false
|
|
379
|
+
},
|
|
380
|
+
["plan"]
|
|
381
|
+
);
|
|
382
|
+
sideEffects?.onError?.(err);
|
|
383
|
+
throw transformedError;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
async function getPlan2(planId) {
|
|
387
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
388
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({ planId });
|
|
389
|
+
const reqOpts = getPlan(payload);
|
|
390
|
+
sideEffects?.onSiteCall?.();
|
|
391
|
+
try {
|
|
392
|
+
const result = await httpClient.request(reqOpts);
|
|
393
|
+
sideEffects?.onSuccess?.(result);
|
|
394
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data)?.plan;
|
|
395
|
+
} catch (err) {
|
|
396
|
+
const transformedError = sdkTransformError(
|
|
397
|
+
err,
|
|
398
|
+
{
|
|
399
|
+
spreadPathsToArguments: {},
|
|
400
|
+
explicitPathsToArguments: { planId: "$[0]" },
|
|
401
|
+
singleArgumentUnchanged: false
|
|
402
|
+
},
|
|
403
|
+
["planId"]
|
|
404
|
+
);
|
|
405
|
+
sideEffects?.onError?.(err);
|
|
406
|
+
throw transformedError;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
async function getPlanByProjectId2(projectId) {
|
|
410
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
411
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
412
|
+
projectId
|
|
413
|
+
});
|
|
414
|
+
const reqOpts = getPlanByProjectId(payload);
|
|
415
|
+
sideEffects?.onSiteCall?.();
|
|
416
|
+
try {
|
|
417
|
+
const result = await httpClient.request(reqOpts);
|
|
418
|
+
sideEffects?.onSuccess?.(result);
|
|
419
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
420
|
+
} catch (err) {
|
|
421
|
+
const transformedError = sdkTransformError(
|
|
422
|
+
err,
|
|
423
|
+
{
|
|
424
|
+
spreadPathsToArguments: {},
|
|
425
|
+
explicitPathsToArguments: { projectId: "$[0]" },
|
|
426
|
+
singleArgumentUnchanged: false
|
|
427
|
+
},
|
|
428
|
+
["projectId"]
|
|
429
|
+
);
|
|
430
|
+
sideEffects?.onError?.(err);
|
|
431
|
+
throw transformedError;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
async function updatePlan2(_id, plan) {
|
|
435
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
436
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
437
|
+
plan: { ...plan, id: _id }
|
|
438
|
+
});
|
|
439
|
+
const reqOpts = updatePlan(payload);
|
|
440
|
+
sideEffects?.onSiteCall?.();
|
|
441
|
+
try {
|
|
442
|
+
const result = await httpClient.request(reqOpts);
|
|
443
|
+
sideEffects?.onSuccess?.(result);
|
|
444
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data)?.plan;
|
|
445
|
+
} catch (err) {
|
|
446
|
+
const transformedError = sdkTransformError(
|
|
447
|
+
err,
|
|
448
|
+
{
|
|
449
|
+
spreadPathsToArguments: { plan: "$[1]" },
|
|
450
|
+
explicitPathsToArguments: { "plan.id": "$[0]" },
|
|
451
|
+
singleArgumentUnchanged: false
|
|
452
|
+
},
|
|
453
|
+
["_id", "plan"]
|
|
454
|
+
);
|
|
455
|
+
sideEffects?.onError?.(err);
|
|
456
|
+
throw transformedError;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
async function deletePlan2(planId) {
|
|
460
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
461
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({ planId });
|
|
462
|
+
const reqOpts = deletePlan(payload);
|
|
463
|
+
sideEffects?.onSiteCall?.();
|
|
464
|
+
try {
|
|
465
|
+
const result = await httpClient.request(reqOpts);
|
|
466
|
+
sideEffects?.onSuccess?.(result);
|
|
467
|
+
} catch (err) {
|
|
468
|
+
const transformedError = sdkTransformError(
|
|
469
|
+
err,
|
|
470
|
+
{
|
|
471
|
+
spreadPathsToArguments: {},
|
|
472
|
+
explicitPathsToArguments: { planId: "$[0]" },
|
|
473
|
+
singleArgumentUnchanged: false
|
|
474
|
+
},
|
|
475
|
+
["planId"]
|
|
476
|
+
);
|
|
477
|
+
sideEffects?.onError?.(err);
|
|
478
|
+
throw transformedError;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
async function generatePlan2(planId) {
|
|
482
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
483
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({ planId });
|
|
484
|
+
const reqOpts = generatePlan(payload);
|
|
485
|
+
sideEffects?.onSiteCall?.();
|
|
486
|
+
try {
|
|
487
|
+
const result = await httpClient.request(reqOpts);
|
|
488
|
+
sideEffects?.onSuccess?.(result);
|
|
489
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
490
|
+
} catch (err) {
|
|
491
|
+
const transformedError = sdkTransformError(
|
|
492
|
+
err,
|
|
493
|
+
{
|
|
494
|
+
spreadPathsToArguments: {},
|
|
495
|
+
explicitPathsToArguments: { planId: "$[0]" },
|
|
496
|
+
singleArgumentUnchanged: false
|
|
497
|
+
},
|
|
498
|
+
["planId"]
|
|
499
|
+
);
|
|
500
|
+
sideEffects?.onError?.(err);
|
|
501
|
+
throw transformedError;
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
async function modifyPlan2(planId, options) {
|
|
505
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
506
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
507
|
+
planId,
|
|
508
|
+
answeredQuestions: options?.answeredQuestions,
|
|
509
|
+
userPrompt: options?.userPrompt,
|
|
510
|
+
planEditContext: options?.planEditContext
|
|
511
|
+
});
|
|
512
|
+
const reqOpts = modifyPlan(payload);
|
|
513
|
+
sideEffects?.onSiteCall?.();
|
|
514
|
+
try {
|
|
515
|
+
const result = await httpClient.request(reqOpts);
|
|
516
|
+
sideEffects?.onSuccess?.(result);
|
|
517
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
518
|
+
} catch (err) {
|
|
519
|
+
const transformedError = sdkTransformError(
|
|
520
|
+
err,
|
|
521
|
+
{
|
|
522
|
+
spreadPathsToArguments: {},
|
|
523
|
+
explicitPathsToArguments: {
|
|
524
|
+
planId: "$[0]",
|
|
525
|
+
answeredQuestions: "$[1].answeredQuestions",
|
|
526
|
+
userPrompt: "$[1].userPrompt",
|
|
527
|
+
planEditContext: "$[1].planEditContext"
|
|
528
|
+
},
|
|
529
|
+
singleArgumentUnchanged: false
|
|
530
|
+
},
|
|
531
|
+
["planId", "options"]
|
|
532
|
+
);
|
|
533
|
+
sideEffects?.onError?.(err);
|
|
534
|
+
throw transformedError;
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
async function regenerateIcon2(planId, prompt) {
|
|
538
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
539
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
540
|
+
planId,
|
|
541
|
+
prompt
|
|
542
|
+
});
|
|
543
|
+
const reqOpts = regenerateIcon(payload);
|
|
544
|
+
sideEffects?.onSiteCall?.();
|
|
545
|
+
try {
|
|
546
|
+
const result = await httpClient.request(reqOpts);
|
|
547
|
+
sideEffects?.onSuccess?.(result);
|
|
548
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
549
|
+
} catch (err) {
|
|
550
|
+
const transformedError = sdkTransformError(
|
|
551
|
+
err,
|
|
552
|
+
{
|
|
553
|
+
spreadPathsToArguments: {},
|
|
554
|
+
explicitPathsToArguments: { planId: "$[0]", prompt: "$[1]" },
|
|
555
|
+
singleArgumentUnchanged: false
|
|
556
|
+
},
|
|
557
|
+
["planId", "prompt"]
|
|
558
|
+
);
|
|
559
|
+
sideEffects?.onError?.(err);
|
|
560
|
+
throw transformedError;
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
async function finalizePlan2(planId, conversationId) {
|
|
564
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
565
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
566
|
+
planId,
|
|
567
|
+
conversationId
|
|
568
|
+
});
|
|
569
|
+
const reqOpts = finalizePlan(payload);
|
|
570
|
+
sideEffects?.onSiteCall?.();
|
|
571
|
+
try {
|
|
572
|
+
const result = await httpClient.request(reqOpts);
|
|
573
|
+
sideEffects?.onSuccess?.(result);
|
|
574
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
575
|
+
} catch (err) {
|
|
576
|
+
const transformedError = sdkTransformError(
|
|
577
|
+
err,
|
|
578
|
+
{
|
|
579
|
+
spreadPathsToArguments: {},
|
|
580
|
+
explicitPathsToArguments: { planId: "$[0]", conversationId: "$[1]" },
|
|
581
|
+
singleArgumentUnchanged: false
|
|
582
|
+
},
|
|
583
|
+
["planId", "conversationId"]
|
|
584
|
+
);
|
|
585
|
+
sideEffects?.onError?.(err);
|
|
586
|
+
throw transformedError;
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
export {
|
|
590
|
+
PlanPartType,
|
|
591
|
+
PlanStatus,
|
|
592
|
+
Platform,
|
|
593
|
+
WebhookIdentityType,
|
|
594
|
+
createAndGeneratePlan2 as createAndGeneratePlan,
|
|
595
|
+
createPlan2 as createPlan,
|
|
596
|
+
deletePlan2 as deletePlan,
|
|
597
|
+
finalizePlan2 as finalizePlan,
|
|
598
|
+
generatePlan2 as generatePlan,
|
|
599
|
+
getPlan2 as getPlan,
|
|
600
|
+
getPlanByProjectId2 as getPlanByProjectId,
|
|
601
|
+
modifyPlan2 as modifyPlan,
|
|
602
|
+
regenerateIcon2 as regenerateIcon,
|
|
603
|
+
updatePlan2 as updatePlan
|
|
604
|
+
};
|
|
605
|
+
//# sourceMappingURL=index.typings.mjs.map
|