@salesforce/lds-adapters-service-serviceplan 1.295.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/LICENSE.txt +82 -0
- package/dist/es/es2018/service-serviceplan.js +429 -0
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/adapters/executeServicePlan.d.ts +18 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +1 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +2 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectServicePlanExecuteByGeneratedPlanId.d.ts +15 -0
- package/dist/es/es2018/types/src/generated/resources/putConnectServicePlanExecuteByGeneratedPlanId.d.ts +17 -0
- package/dist/es/es2018/types/src/generated/types/ServicePlanExecutionInputRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/ServicePlanExecutionOutputRepresentation.d.ts +46 -0
- package/dist/es/es2018/types/src/generated/types/ServicePlanExecutionSummaryRepresentation.d.ts +35 -0
- package/dist/es/es2018/types/src/generated/types/ServicePlanGenerationInputParamRepresentation.d.ts +38 -0
- package/dist/es/es2018/types/src/generated/types/ServicePlanGenerationSessionInformationOutputRepresentation.d.ts +43 -0
- package/dist/es/es2018/types/src/generated/types/ServicePlanOutputRepresentation.d.ts +51 -0
- package/dist/es/es2018/types/src/generated/types/ServicePlanRepresentation.d.ts +41 -0
- package/dist/es/es2018/types/src/generated/types/ServicePlanStepAttributeRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/ServicePlanStepExecutionSummaryRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/ServicePlanStepRepresentation.d.ts +41 -0
- package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
- package/package.json +66 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +457 -0
- package/src/raml/api.raml +233 -0
- package/src/raml/luvio.raml +18 -0
package/sfdc/index.js
ADDED
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* ATTENTION!
|
|
9
|
+
* THIS IS A GENERATED FILE FROM https://github.com/salesforce-experience-platform-emu/lds-lightning-platform
|
|
10
|
+
* If you would like to contribute to LDS, please follow the steps outlined in the git repo.
|
|
11
|
+
* Any changes made to this file in p4 will be automatically overwritten.
|
|
12
|
+
* *******************************************************************************************
|
|
13
|
+
*/
|
|
14
|
+
/* proxy-compat-disable */
|
|
15
|
+
import { withDefaultLuvio } from 'force/ldsEngine';
|
|
16
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$1, typeCheckConfig as typeCheckConfig$1 } from 'force/luvioEngine';
|
|
17
|
+
|
|
18
|
+
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
19
|
+
const { keys: ObjectKeys, create: ObjectCreate } = Object;
|
|
20
|
+
const { isArray: ArrayIsArray$1 } = Array;
|
|
21
|
+
/**
|
|
22
|
+
* Validates an adapter config is well-formed.
|
|
23
|
+
* @param config The config to validate.
|
|
24
|
+
* @param adapter The adapter validation configuration.
|
|
25
|
+
* @param oneOf The keys the config must contain at least one of.
|
|
26
|
+
* @throws A TypeError if config doesn't satisfy the adapter's config validation.
|
|
27
|
+
*/
|
|
28
|
+
function validateConfig(config, adapter, oneOf) {
|
|
29
|
+
const { displayName } = adapter;
|
|
30
|
+
const { required, optional, unsupported } = adapter.parameters;
|
|
31
|
+
if (config === undefined ||
|
|
32
|
+
required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
33
|
+
throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
|
|
34
|
+
}
|
|
35
|
+
if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
36
|
+
throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
|
|
37
|
+
}
|
|
38
|
+
if (unsupported !== undefined &&
|
|
39
|
+
unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
|
|
40
|
+
throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
|
|
41
|
+
}
|
|
42
|
+
const supported = required.concat(optional);
|
|
43
|
+
if (ObjectKeys(config).some(key => !supported.includes(key))) {
|
|
44
|
+
throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function untrustedIsObject(untrusted) {
|
|
48
|
+
return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
|
|
49
|
+
}
|
|
50
|
+
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
51
|
+
return configPropertyNames.parameters.required.every(req => req in config);
|
|
52
|
+
}
|
|
53
|
+
function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
|
|
54
|
+
return {
|
|
55
|
+
name,
|
|
56
|
+
required,
|
|
57
|
+
resourceType,
|
|
58
|
+
typeCheckShape,
|
|
59
|
+
isArrayShape,
|
|
60
|
+
coerceFn,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function buildAdapterValidationConfig(displayName, paramsMeta) {
|
|
64
|
+
const required = paramsMeta.filter(p => p.required).map(p => p.name);
|
|
65
|
+
const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
|
|
66
|
+
return {
|
|
67
|
+
displayName,
|
|
68
|
+
parameters: {
|
|
69
|
+
required,
|
|
70
|
+
optional,
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
const keyPrefix = 'servicePlan';
|
|
75
|
+
|
|
76
|
+
const { isArray: ArrayIsArray } = Array;
|
|
77
|
+
function equalsArray(a, b, equalsItem) {
|
|
78
|
+
const aLength = a.length;
|
|
79
|
+
const bLength = b.length;
|
|
80
|
+
if (aLength !== bLength) {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
for (let i = 0; i < aLength; i++) {
|
|
84
|
+
if (equalsItem(a[i], b[i]) === false) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
function createLink(ref) {
|
|
91
|
+
return {
|
|
92
|
+
__ref: serializeStructuredKey(ref),
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const VERSION$2 = "49ecad43516b5e32603856ae2fd27e4c";
|
|
97
|
+
function validate$2(obj, path = 'ServicePlanStepExecutionSummaryRepresentation') {
|
|
98
|
+
const v_error = (() => {
|
|
99
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
100
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
101
|
+
}
|
|
102
|
+
const obj_message = obj.message;
|
|
103
|
+
const path_message = path + '.message';
|
|
104
|
+
if (typeof obj_message !== 'string') {
|
|
105
|
+
return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
106
|
+
}
|
|
107
|
+
const obj_status = obj.status;
|
|
108
|
+
const path_status = path + '.status';
|
|
109
|
+
if (typeof obj_status !== 'string') {
|
|
110
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
111
|
+
}
|
|
112
|
+
})();
|
|
113
|
+
return v_error === undefined ? null : v_error;
|
|
114
|
+
}
|
|
115
|
+
const select$3 = function ServicePlanStepExecutionSummaryRepresentationSelect() {
|
|
116
|
+
return {
|
|
117
|
+
kind: 'Fragment',
|
|
118
|
+
version: VERSION$2,
|
|
119
|
+
private: [],
|
|
120
|
+
selections: [
|
|
121
|
+
{
|
|
122
|
+
name: 'message',
|
|
123
|
+
kind: 'Scalar'
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: 'status',
|
|
127
|
+
kind: 'Scalar'
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
function equals$2(existing, incoming) {
|
|
133
|
+
const existing_message = existing.message;
|
|
134
|
+
const incoming_message = incoming.message;
|
|
135
|
+
if (!(existing_message === incoming_message)) {
|
|
136
|
+
return false;
|
|
137
|
+
}
|
|
138
|
+
const existing_status = existing.status;
|
|
139
|
+
const incoming_status = incoming.status;
|
|
140
|
+
if (!(existing_status === incoming_status)) {
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
return true;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const VERSION$1 = "0786fbab705610a53f80f4db85b8cfa3";
|
|
147
|
+
function validate$1(obj, path = 'ServicePlanExecutionSummaryRepresentation') {
|
|
148
|
+
const v_error = (() => {
|
|
149
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
150
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
151
|
+
}
|
|
152
|
+
const obj_executedDate = obj.executedDate;
|
|
153
|
+
const path_executedDate = path + '.executedDate';
|
|
154
|
+
if (typeof obj_executedDate !== 'string') {
|
|
155
|
+
return new TypeError('Expected "string" but received "' + typeof obj_executedDate + '" (at "' + path_executedDate + '")');
|
|
156
|
+
}
|
|
157
|
+
const obj_status = obj.status;
|
|
158
|
+
const path_status = path + '.status';
|
|
159
|
+
if (typeof obj_status !== 'string') {
|
|
160
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
161
|
+
}
|
|
162
|
+
const obj_steps = obj.steps;
|
|
163
|
+
const path_steps = path + '.steps';
|
|
164
|
+
if (!ArrayIsArray(obj_steps)) {
|
|
165
|
+
return new TypeError('Expected "array" but received "' + typeof obj_steps + '" (at "' + path_steps + '")');
|
|
166
|
+
}
|
|
167
|
+
for (let i = 0; i < obj_steps.length; i++) {
|
|
168
|
+
const obj_steps_item = obj_steps[i];
|
|
169
|
+
const path_steps_item = path_steps + '[' + i + ']';
|
|
170
|
+
const referencepath_steps_itemValidationError = validate$2(obj_steps_item, path_steps_item);
|
|
171
|
+
if (referencepath_steps_itemValidationError !== null) {
|
|
172
|
+
let message = 'Object doesn\'t match ServicePlanStepExecutionSummaryRepresentation (at "' + path_steps_item + '")\n';
|
|
173
|
+
message += referencepath_steps_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
174
|
+
return new TypeError(message);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
})();
|
|
178
|
+
return v_error === undefined ? null : v_error;
|
|
179
|
+
}
|
|
180
|
+
const select$2 = function ServicePlanExecutionSummaryRepresentationSelect() {
|
|
181
|
+
const { selections: ServicePlanStepExecutionSummaryRepresentation__selections, opaque: ServicePlanStepExecutionSummaryRepresentation__opaque, } = select$3();
|
|
182
|
+
return {
|
|
183
|
+
kind: 'Fragment',
|
|
184
|
+
version: VERSION$1,
|
|
185
|
+
private: [],
|
|
186
|
+
selections: [
|
|
187
|
+
{
|
|
188
|
+
name: 'executedDate',
|
|
189
|
+
kind: 'Scalar'
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
name: 'status',
|
|
193
|
+
kind: 'Scalar'
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
name: 'steps',
|
|
197
|
+
kind: 'Object',
|
|
198
|
+
plural: true,
|
|
199
|
+
selections: ServicePlanStepExecutionSummaryRepresentation__selections
|
|
200
|
+
}
|
|
201
|
+
]
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
function equals$1(existing, incoming) {
|
|
205
|
+
const existing_executedDate = existing.executedDate;
|
|
206
|
+
const incoming_executedDate = incoming.executedDate;
|
|
207
|
+
if (!(existing_executedDate === incoming_executedDate)) {
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
210
|
+
const existing_status = existing.status;
|
|
211
|
+
const incoming_status = incoming.status;
|
|
212
|
+
if (!(existing_status === incoming_status)) {
|
|
213
|
+
return false;
|
|
214
|
+
}
|
|
215
|
+
const existing_steps = existing.steps;
|
|
216
|
+
const incoming_steps = incoming.steps;
|
|
217
|
+
const equals_steps_items = equalsArray(existing_steps, incoming_steps, (existing_steps_item, incoming_steps_item) => {
|
|
218
|
+
if (!(equals$2(existing_steps_item, incoming_steps_item))) {
|
|
219
|
+
return false;
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
if (equals_steps_items === false) {
|
|
223
|
+
return false;
|
|
224
|
+
}
|
|
225
|
+
return true;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
const VERSION = "0b6d5d82884b30861149227a18c79e34";
|
|
229
|
+
function validate(obj, path = 'ServicePlanExecutionOutputRepresentation') {
|
|
230
|
+
const v_error = (() => {
|
|
231
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
232
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
233
|
+
}
|
|
234
|
+
const obj_reason = obj.reason;
|
|
235
|
+
const path_reason = path + '.reason';
|
|
236
|
+
if (typeof obj_reason !== 'string') {
|
|
237
|
+
return new TypeError('Expected "string" but received "' + typeof obj_reason + '" (at "' + path_reason + '")');
|
|
238
|
+
}
|
|
239
|
+
const obj_reasonDetails = obj.reasonDetails;
|
|
240
|
+
const path_reasonDetails = path + '.reasonDetails';
|
|
241
|
+
if (typeof obj_reasonDetails !== 'string') {
|
|
242
|
+
return new TypeError('Expected "string" but received "' + typeof obj_reasonDetails + '" (at "' + path_reasonDetails + '")');
|
|
243
|
+
}
|
|
244
|
+
const obj_servicePlan = obj.servicePlan;
|
|
245
|
+
const path_servicePlan = path + '.servicePlan';
|
|
246
|
+
const referencepath_servicePlanValidationError = validate$1(obj_servicePlan, path_servicePlan);
|
|
247
|
+
if (referencepath_servicePlanValidationError !== null) {
|
|
248
|
+
let message = 'Object doesn\'t match ServicePlanExecutionSummaryRepresentation (at "' + path_servicePlan + '")\n';
|
|
249
|
+
message += referencepath_servicePlanValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
250
|
+
return new TypeError(message);
|
|
251
|
+
}
|
|
252
|
+
const obj_status = obj.status;
|
|
253
|
+
const path_status = path + '.status';
|
|
254
|
+
if (typeof obj_status !== 'string') {
|
|
255
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
256
|
+
}
|
|
257
|
+
})();
|
|
258
|
+
return v_error === undefined ? null : v_error;
|
|
259
|
+
}
|
|
260
|
+
const RepresentationType = 'ServicePlanExecutionOutputRepresentation';
|
|
261
|
+
function keyBuilder(luvio, config) {
|
|
262
|
+
return keyPrefix + '::' + RepresentationType + ':' + config.id;
|
|
263
|
+
}
|
|
264
|
+
function keyBuilderFromType(luvio, object) {
|
|
265
|
+
const keyParams = {
|
|
266
|
+
id: object.reason
|
|
267
|
+
};
|
|
268
|
+
return keyBuilder(luvio, keyParams);
|
|
269
|
+
}
|
|
270
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
271
|
+
return input;
|
|
272
|
+
}
|
|
273
|
+
const select$1 = function ServicePlanExecutionOutputRepresentationSelect() {
|
|
274
|
+
const { selections: ServicePlanExecutionSummaryRepresentation__selections, opaque: ServicePlanExecutionSummaryRepresentation__opaque, } = select$2();
|
|
275
|
+
return {
|
|
276
|
+
kind: 'Fragment',
|
|
277
|
+
version: VERSION,
|
|
278
|
+
private: [],
|
|
279
|
+
selections: [
|
|
280
|
+
{
|
|
281
|
+
name: 'reason',
|
|
282
|
+
kind: 'Scalar'
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
name: 'reasonDetails',
|
|
286
|
+
kind: 'Scalar'
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
name: 'servicePlan',
|
|
290
|
+
kind: 'Object',
|
|
291
|
+
selections: ServicePlanExecutionSummaryRepresentation__selections
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
name: 'status',
|
|
295
|
+
kind: 'Scalar'
|
|
296
|
+
}
|
|
297
|
+
]
|
|
298
|
+
};
|
|
299
|
+
};
|
|
300
|
+
function equals(existing, incoming) {
|
|
301
|
+
const existing_reason = existing.reason;
|
|
302
|
+
const incoming_reason = incoming.reason;
|
|
303
|
+
if (!(existing_reason === incoming_reason)) {
|
|
304
|
+
return false;
|
|
305
|
+
}
|
|
306
|
+
const existing_reasonDetails = existing.reasonDetails;
|
|
307
|
+
const incoming_reasonDetails = incoming.reasonDetails;
|
|
308
|
+
if (!(existing_reasonDetails === incoming_reasonDetails)) {
|
|
309
|
+
return false;
|
|
310
|
+
}
|
|
311
|
+
const existing_status = existing.status;
|
|
312
|
+
const incoming_status = incoming.status;
|
|
313
|
+
if (!(existing_status === incoming_status)) {
|
|
314
|
+
return false;
|
|
315
|
+
}
|
|
316
|
+
const existing_servicePlan = existing.servicePlan;
|
|
317
|
+
const incoming_servicePlan = incoming.servicePlan;
|
|
318
|
+
if (!(equals$1(existing_servicePlan, incoming_servicePlan))) {
|
|
319
|
+
return false;
|
|
320
|
+
}
|
|
321
|
+
return true;
|
|
322
|
+
}
|
|
323
|
+
const ingest = function ServicePlanExecutionOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
324
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
325
|
+
const validateError = validate(input);
|
|
326
|
+
if (validateError !== null) {
|
|
327
|
+
throw validateError;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
const key = keyBuilderFromType(luvio, input);
|
|
331
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 500;
|
|
332
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "servicePlan", VERSION, RepresentationType, equals);
|
|
333
|
+
return createLink(key);
|
|
334
|
+
};
|
|
335
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
336
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
337
|
+
const rootKey = keyBuilderFromType(luvio, input);
|
|
338
|
+
rootKeySet.set(rootKey, {
|
|
339
|
+
namespace: keyPrefix,
|
|
340
|
+
representationName: RepresentationType,
|
|
341
|
+
mergeable: false
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
function select(luvio, params) {
|
|
346
|
+
return select$1();
|
|
347
|
+
}
|
|
348
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
349
|
+
getTypeCacheKeys(storeKeyMap, luvio, response);
|
|
350
|
+
}
|
|
351
|
+
function ingestSuccess(luvio, resourceParams, response) {
|
|
352
|
+
const { body } = response;
|
|
353
|
+
const key = keyBuilderFromType(luvio, body);
|
|
354
|
+
luvio.storeIngest(key, ingest, body);
|
|
355
|
+
const snapshot = luvio.storeLookup({
|
|
356
|
+
recordId: key,
|
|
357
|
+
node: select(),
|
|
358
|
+
variables: {},
|
|
359
|
+
});
|
|
360
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
361
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
362
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
deepFreeze(snapshot.data);
|
|
366
|
+
return snapshot;
|
|
367
|
+
}
|
|
368
|
+
function createResourceRequest(config) {
|
|
369
|
+
const headers = {};
|
|
370
|
+
return {
|
|
371
|
+
baseUri: '/services/data/v62.0',
|
|
372
|
+
basePath: '/connect/service-plan/execute/' + config.urlParams.generatedPlanId + '',
|
|
373
|
+
method: 'put',
|
|
374
|
+
body: config.body,
|
|
375
|
+
urlParams: config.urlParams,
|
|
376
|
+
queryParams: {},
|
|
377
|
+
headers,
|
|
378
|
+
priority: 'normal',
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
const adapterName = 'executeServicePlan';
|
|
383
|
+
const executeServicePlan_ConfigPropertyMetadata = [
|
|
384
|
+
generateParamConfigMetadata('generatedPlanId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
385
|
+
generateParamConfigMetadata('intent', true, 2 /* Body */, 0 /* String */),
|
|
386
|
+
generateParamConfigMetadata('planId', true, 2 /* Body */, 0 /* String */),
|
|
387
|
+
generateParamConfigMetadata('sessionId', true, 2 /* Body */, 0 /* String */),
|
|
388
|
+
];
|
|
389
|
+
const executeServicePlan_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, executeServicePlan_ConfigPropertyMetadata);
|
|
390
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$1(executeServicePlan_ConfigPropertyMetadata);
|
|
391
|
+
function typeCheckConfig(untrustedConfig) {
|
|
392
|
+
const config = {};
|
|
393
|
+
typeCheckConfig$1(untrustedConfig, config, executeServicePlan_ConfigPropertyMetadata);
|
|
394
|
+
return config;
|
|
395
|
+
}
|
|
396
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
397
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
398
|
+
return null;
|
|
399
|
+
}
|
|
400
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
401
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
402
|
+
}
|
|
403
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
404
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
405
|
+
return null;
|
|
406
|
+
}
|
|
407
|
+
return config;
|
|
408
|
+
}
|
|
409
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
410
|
+
const resourceParams = createResourceParams(config);
|
|
411
|
+
const request = createResourceRequest(resourceParams);
|
|
412
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
413
|
+
.then((response) => {
|
|
414
|
+
return luvio.handleSuccessResponse(() => {
|
|
415
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response);
|
|
416
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
417
|
+
}, () => {
|
|
418
|
+
const cache = new StoreKeyMap();
|
|
419
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
420
|
+
return cache;
|
|
421
|
+
});
|
|
422
|
+
}, (response) => {
|
|
423
|
+
deepFreeze(response);
|
|
424
|
+
throw response;
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
const executeServicePlanAdapterFactory = (luvio) => {
|
|
428
|
+
return function executeServicePlan(untrustedConfig) {
|
|
429
|
+
const config = validateAdapterConfig(untrustedConfig, executeServicePlan_ConfigPropertyNames);
|
|
430
|
+
// Invalid or incomplete config
|
|
431
|
+
if (config === null) {
|
|
432
|
+
throw new Error('Invalid config for "executeServicePlan"');
|
|
433
|
+
}
|
|
434
|
+
return buildNetworkSnapshot(luvio, config);
|
|
435
|
+
};
|
|
436
|
+
};
|
|
437
|
+
|
|
438
|
+
let executeServicePlan;
|
|
439
|
+
// Notify Update Available
|
|
440
|
+
function bindExportsTo(luvio) {
|
|
441
|
+
// LDS Adapters
|
|
442
|
+
function unwrapSnapshotData(factory) {
|
|
443
|
+
const adapter = factory(luvio);
|
|
444
|
+
return (config) => adapter(config).then((snapshot) => snapshot.data);
|
|
445
|
+
}
|
|
446
|
+
return {
|
|
447
|
+
executeServicePlan: unwrapSnapshotData(executeServicePlanAdapterFactory),
|
|
448
|
+
// Imperative GET Adapters
|
|
449
|
+
// Notify Update Availables
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
withDefaultLuvio((luvio) => {
|
|
453
|
+
({ executeServicePlan } = bindExportsTo(luvio));
|
|
454
|
+
});
|
|
455
|
+
|
|
456
|
+
export { executeServicePlan };
|
|
457
|
+
// version: 1.295.0-e85f207c7
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
#%RAML 1.0
|
|
2
|
+
securedBy:
|
|
3
|
+
- OAuth2
|
|
4
|
+
title: Salesforce Connect API
|
|
5
|
+
version: '62.0'
|
|
6
|
+
mediaType: application/json
|
|
7
|
+
protocols:
|
|
8
|
+
- https
|
|
9
|
+
baseUri: /services/data/v62.0
|
|
10
|
+
securitySchemes:
|
|
11
|
+
OAuth2:
|
|
12
|
+
type: OAuth 2.0
|
|
13
|
+
settings:
|
|
14
|
+
authorizationUri: https://example.com/oauth/authorize
|
|
15
|
+
accessTokenUri: ''
|
|
16
|
+
authorizationGrants:
|
|
17
|
+
- implicit
|
|
18
|
+
annotationTypes:
|
|
19
|
+
oas-readOnly:
|
|
20
|
+
type: boolean
|
|
21
|
+
allowedTargets: TypeDeclaration
|
|
22
|
+
oas-collectionFormat:
|
|
23
|
+
type: string
|
|
24
|
+
oas-body-name:
|
|
25
|
+
type: string
|
|
26
|
+
allowedTargets: TypeDeclaration
|
|
27
|
+
types:
|
|
28
|
+
ServicePlanExecutionInputRepresentation:
|
|
29
|
+
description: Represents a generated service plan input context required for service
|
|
30
|
+
plan execution
|
|
31
|
+
type: object
|
|
32
|
+
properties:
|
|
33
|
+
intent:
|
|
34
|
+
description: Intent
|
|
35
|
+
type: string
|
|
36
|
+
planId:
|
|
37
|
+
description: Copilot planId
|
|
38
|
+
type: string
|
|
39
|
+
sessionId:
|
|
40
|
+
description: Copilot SessionId
|
|
41
|
+
type: string
|
|
42
|
+
ServicePlanExecutionOutputRepresentation:
|
|
43
|
+
description: Represent the service plan execution result
|
|
44
|
+
type: object
|
|
45
|
+
properties:
|
|
46
|
+
reason:
|
|
47
|
+
description: The reason of the service plan execution request job failure
|
|
48
|
+
type: string
|
|
49
|
+
reasonDetails:
|
|
50
|
+
description: The details of the service plan execution request job failure
|
|
51
|
+
type: string
|
|
52
|
+
servicePlan:
|
|
53
|
+
description: The generated service plan
|
|
54
|
+
type: ServicePlanExecutionSummaryRepresentation
|
|
55
|
+
status:
|
|
56
|
+
description: The Status of the service plan execution request job
|
|
57
|
+
type: string
|
|
58
|
+
ServicePlanExecutionSummaryRepresentation:
|
|
59
|
+
description: Represents the execution summary of a Service Plan
|
|
60
|
+
type: object # TODO Hand-rolled W-15545227
|
|
61
|
+
properties:
|
|
62
|
+
executedDate:
|
|
63
|
+
description: Executed Date
|
|
64
|
+
type: string
|
|
65
|
+
status:
|
|
66
|
+
description: Service Plan Status
|
|
67
|
+
type: string
|
|
68
|
+
steps:
|
|
69
|
+
description: Executed Steps
|
|
70
|
+
type: array
|
|
71
|
+
items:
|
|
72
|
+
type: ServicePlanStepExecutionSummaryRepresentation
|
|
73
|
+
ServicePlanGenerationInputParamRepresentation:
|
|
74
|
+
description: Represents a request for generating a service plan
|
|
75
|
+
type: object
|
|
76
|
+
properties:
|
|
77
|
+
additionalContext:
|
|
78
|
+
description: Additional context for the plan generation request
|
|
79
|
+
type: object
|
|
80
|
+
properties:
|
|
81
|
+
//:
|
|
82
|
+
type: string
|
|
83
|
+
mode:
|
|
84
|
+
description: Plan generation mode
|
|
85
|
+
type: string
|
|
86
|
+
enum:
|
|
87
|
+
- NoSave
|
|
88
|
+
- Save
|
|
89
|
+
source:
|
|
90
|
+
description: Origin for the plan generation request
|
|
91
|
+
type: string
|
|
92
|
+
ServicePlanGenerationSessionInformationOutputRepresentation:
|
|
93
|
+
description: Represent the session information of a Service Plan Generation
|
|
94
|
+
type: object
|
|
95
|
+
properties:
|
|
96
|
+
botId:
|
|
97
|
+
description: Bot id used for invoking the planner service
|
|
98
|
+
type: string
|
|
99
|
+
botVersionId:
|
|
100
|
+
description: Bot id used for invoking the planner service
|
|
101
|
+
type: string
|
|
102
|
+
clientFeatureId:
|
|
103
|
+
description: Client Feature Id used for feedback on the plan generation
|
|
104
|
+
type: string
|
|
105
|
+
generationsId:
|
|
106
|
+
description: Generations Id used for feedback on the plan generation
|
|
107
|
+
type: string
|
|
108
|
+
planId:
|
|
109
|
+
description: Plan id used for plan execution or plan modification
|
|
110
|
+
type: string
|
|
111
|
+
sessionId:
|
|
112
|
+
description: Session id used for plan execution or plan modification
|
|
113
|
+
type: string
|
|
114
|
+
ServicePlanOutputRepresentation:
|
|
115
|
+
description: Represent the generated Service Plan
|
|
116
|
+
type: object
|
|
117
|
+
properties:
|
|
118
|
+
copilot:
|
|
119
|
+
description: The copilot used to generate the service plan
|
|
120
|
+
type: string
|
|
121
|
+
createdDate:
|
|
122
|
+
description: The created date of the service plan
|
|
123
|
+
type: string
|
|
124
|
+
generatedPlanId:
|
|
125
|
+
description: The Id of the plan record
|
|
126
|
+
type: string
|
|
127
|
+
rawPlan:
|
|
128
|
+
description: The raw plan generated by the copilot
|
|
129
|
+
type: string
|
|
130
|
+
sessionInformation:
|
|
131
|
+
description: The session information related to the copilot generating the
|
|
132
|
+
plan
|
|
133
|
+
type: ServicePlanGenerationSessionInformationOutputRepresentation
|
|
134
|
+
steps:
|
|
135
|
+
description: The steps of the service plan
|
|
136
|
+
type: array
|
|
137
|
+
items:
|
|
138
|
+
type: ServicePlanStepRepresentation
|
|
139
|
+
topic:
|
|
140
|
+
description: The topic identified when generating the service plan
|
|
141
|
+
type: string
|
|
142
|
+
topicDescription:
|
|
143
|
+
description: The description of topic identified when generating the service
|
|
144
|
+
plan
|
|
145
|
+
type: string
|
|
146
|
+
ServicePlanRepresentation:
|
|
147
|
+
description: Service Plan representation
|
|
148
|
+
type: object
|
|
149
|
+
properties:
|
|
150
|
+
copilot:
|
|
151
|
+
description: Copilot
|
|
152
|
+
type: string
|
|
153
|
+
generatedPlanId:
|
|
154
|
+
description: Plan Id
|
|
155
|
+
type: string
|
|
156
|
+
sessionInformation:
|
|
157
|
+
description: Session details
|
|
158
|
+
type: ServicePlanGenerationSessionInformationOutputRepresentation
|
|
159
|
+
topic:
|
|
160
|
+
description: Topic Name
|
|
161
|
+
type: string
|
|
162
|
+
topicDescription:
|
|
163
|
+
description: Topic Description
|
|
164
|
+
type: string
|
|
165
|
+
ServicePlanStepAttributeRepresentation:
|
|
166
|
+
description: Represent an attribute in a step of a generated Service Plan
|
|
167
|
+
type: object
|
|
168
|
+
properties:
|
|
169
|
+
name:
|
|
170
|
+
description: The name of the step attribute
|
|
171
|
+
type: string
|
|
172
|
+
value:
|
|
173
|
+
description: The value of the step attribute
|
|
174
|
+
type: string
|
|
175
|
+
ServicePlanStepExecutionSummaryRepresentation:
|
|
176
|
+
description: Represents the execution summary of a Service Plan Step
|
|
177
|
+
type: object # TODO Hand-rolled W-15545227
|
|
178
|
+
properties:
|
|
179
|
+
message:
|
|
180
|
+
description: Message
|
|
181
|
+
type: string
|
|
182
|
+
status:
|
|
183
|
+
description: Status
|
|
184
|
+
type: string
|
|
185
|
+
ServicePlanStepRepresentation:
|
|
186
|
+
description: Represent a step of a generated Service Plan
|
|
187
|
+
type: object
|
|
188
|
+
properties:
|
|
189
|
+
description:
|
|
190
|
+
description: The description of the service plan step
|
|
191
|
+
type: string
|
|
192
|
+
functionName:
|
|
193
|
+
description: The name of the service plan step
|
|
194
|
+
type: string
|
|
195
|
+
inputs:
|
|
196
|
+
description: The list of inputs of the service plan step
|
|
197
|
+
type: array
|
|
198
|
+
items:
|
|
199
|
+
type: ServicePlanStepAttributeRepresentation
|
|
200
|
+
outputCollection:
|
|
201
|
+
description: The output collection of the service plan step
|
|
202
|
+
type: string
|
|
203
|
+
outputVariable:
|
|
204
|
+
description: The output variable of the service plan step
|
|
205
|
+
type: string
|
|
206
|
+
/connect/service-plan:
|
|
207
|
+
/execute/{generatedPlanId}:
|
|
208
|
+
get:
|
|
209
|
+
displayName: getServicePlanExecution
|
|
210
|
+
description: Returns Service Plan execution summary
|
|
211
|
+
responses:
|
|
212
|
+
'200':
|
|
213
|
+
description: Success
|
|
214
|
+
body:
|
|
215
|
+
application/json:
|
|
216
|
+
type: ServicePlanExecutionOutputRepresentation
|
|
217
|
+
put:
|
|
218
|
+
displayName: putServicePlanExecution
|
|
219
|
+
description: Executes a Service Plan
|
|
220
|
+
responses:
|
|
221
|
+
'200':
|
|
222
|
+
description: Success
|
|
223
|
+
body:
|
|
224
|
+
application/json:
|
|
225
|
+
type: ServicePlanExecutionOutputRepresentation
|
|
226
|
+
body:
|
|
227
|
+
application/json:
|
|
228
|
+
type: ServicePlanExecutionInputRepresentation
|
|
229
|
+
(oas-body-name): servicePlanInputRepresentation
|
|
230
|
+
uriParameters:
|
|
231
|
+
generatedPlanId:
|
|
232
|
+
type: string
|
|
233
|
+
required: true
|