@salesforce/lds-adapters-service-einstein-copilot-bot 1.266.0-dev2 → 1.266.0-dev21
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/dist/es/es2018/service-einstein-copilot-bot.js +757 -168
- package/dist/es/es2018/types/src/generated/adapters/getRecommendedPlanTemplates.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/adapters/sendMessage.d.ts +5 -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 +3 -1
- package/dist/es/es2018/types/src/generated/resources/getConnectRecommendedPlanTemplatesByPageTypeAndObjectType.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/postConnectConversationRuntimeProxy.d.ts +5 -0
- package/dist/es/es2018/types/src/generated/types/CollectMessageRepresentation.d.ts +6 -3
- package/dist/es/es2018/types/src/generated/types/ConversationRuntimeProxyInputRepresentation.d.ts +16 -1
- package/dist/es/es2018/types/src/generated/types/ConversationRuntimeProxyMessageRepresentation.d.ts +7 -1
- package/dist/es/es2018/types/src/generated/types/EsTypeMessageRepresentation.d.ts +4 -1
- package/dist/es/es2018/types/src/generated/types/PlanTemplateRepresentation.d.ts +45 -0
- package/dist/es/es2018/types/src/generated/types/RecommendedPlanTemplatesRepresentation.d.ts +36 -0
- package/dist/es/es2018/types/src/generated/types/VariableRepresentation.d.ts +3 -3
- package/package.json +3 -3
- package/sfdc/index.js +656 -51
- package/src/raml/api.raml +97 -0
- package/src/raml/luvio.raml +8 -0
package/sfdc/index.js
CHANGED
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
/* proxy-compat-disable */
|
|
15
15
|
import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
|
|
16
16
|
import { withDefaultLuvio } from 'force/ldsEngine';
|
|
17
|
-
import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$
|
|
17
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$2, StoreKeyMap, createResourceParams as createResourceParams$3, typeCheckConfig as typeCheckConfig$3 } from 'force/luvioEngine';
|
|
18
18
|
|
|
19
19
|
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
20
|
-
const { keys: ObjectKeys, create: ObjectCreate } = Object;
|
|
20
|
+
const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
|
|
21
21
|
const { isArray: ArrayIsArray$1 } = Array;
|
|
22
22
|
/**
|
|
23
23
|
* Validates an adapter config is well-formed.
|
|
@@ -41,7 +41,7 @@ function validateConfig(config, adapter, oneOf) {
|
|
|
41
41
|
throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
|
|
42
42
|
}
|
|
43
43
|
const supported = required.concat(optional);
|
|
44
|
-
if (ObjectKeys(config).some(key => !supported.includes(key))) {
|
|
44
|
+
if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
|
|
45
45
|
throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -81,6 +81,7 @@ function buildAdapterValidationConfig(displayName, paramsMeta) {
|
|
|
81
81
|
}
|
|
82
82
|
const keyPrefix = 'einstein-copilot-bot';
|
|
83
83
|
|
|
84
|
+
const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
84
85
|
const { isArray: ArrayIsArray } = Array;
|
|
85
86
|
const { stringify: JSONStringify } = JSON;
|
|
86
87
|
function equalsArray(a, b, equalsItem) {
|
|
@@ -96,15 +97,34 @@ function equalsArray(a, b, equalsItem) {
|
|
|
96
97
|
}
|
|
97
98
|
return true;
|
|
98
99
|
}
|
|
100
|
+
function equalsObject(a, b, equalsProp) {
|
|
101
|
+
const aKeys = ObjectKeys(a).sort();
|
|
102
|
+
const bKeys = ObjectKeys(b).sort();
|
|
103
|
+
const aKeysLength = aKeys.length;
|
|
104
|
+
const bKeysLength = bKeys.length;
|
|
105
|
+
if (aKeysLength !== bKeysLength) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
for (let i = 0; i < aKeys.length; i++) {
|
|
109
|
+
const key = aKeys[i];
|
|
110
|
+
if (key !== bKeys[i]) {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
if (equalsProp(a[key], b[key]) === false) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
99
119
|
function createLink(ref) {
|
|
100
120
|
return {
|
|
101
121
|
__ref: serializeStructuredKey(ref),
|
|
102
122
|
};
|
|
103
123
|
}
|
|
104
124
|
|
|
105
|
-
const TTL$
|
|
106
|
-
const VERSION$
|
|
107
|
-
function validate$
|
|
125
|
+
const TTL$3 = 30000;
|
|
126
|
+
const VERSION$7 = "ab85410a28124cfed3d8eae7b8236853";
|
|
127
|
+
function validate$8(obj, path = 'CopilotBotInfoRepresentation') {
|
|
108
128
|
const v_error = (() => {
|
|
109
129
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
110
130
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -131,14 +151,14 @@ function validate$6(obj, path = 'CopilotBotInfoRepresentation') {
|
|
|
131
151
|
})();
|
|
132
152
|
return v_error === undefined ? null : v_error;
|
|
133
153
|
}
|
|
134
|
-
const RepresentationType$
|
|
135
|
-
function normalize$
|
|
154
|
+
const RepresentationType$3 = 'CopilotBotInfoRepresentation';
|
|
155
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
136
156
|
return input;
|
|
137
157
|
}
|
|
138
|
-
const select$
|
|
158
|
+
const select$a = function CopilotBotInfoRepresentationSelect() {
|
|
139
159
|
return {
|
|
140
160
|
kind: 'Fragment',
|
|
141
|
-
version: VERSION$
|
|
161
|
+
version: VERSION$7,
|
|
142
162
|
private: [],
|
|
143
163
|
selections: [
|
|
144
164
|
{
|
|
@@ -158,7 +178,7 @@ const select$7 = function CopilotBotInfoRepresentationSelect() {
|
|
|
158
178
|
]
|
|
159
179
|
};
|
|
160
180
|
};
|
|
161
|
-
function equals$
|
|
181
|
+
function equals$7(existing, incoming) {
|
|
162
182
|
const existing_isSuccess = existing.isSuccess;
|
|
163
183
|
const incoming_isSuccess = incoming.isSuccess;
|
|
164
184
|
if (!(existing_isSuccess === incoming_isSuccess)) {
|
|
@@ -192,7 +212,368 @@ function equals$5(existing, incoming) {
|
|
|
192
212
|
}
|
|
193
213
|
return true;
|
|
194
214
|
}
|
|
195
|
-
const ingest$
|
|
215
|
+
const ingest$3 = function CopilotBotInfoRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
216
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
217
|
+
const validateError = validate$8(input);
|
|
218
|
+
if (validateError !== null) {
|
|
219
|
+
throw validateError;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
const key = path.fullPath;
|
|
223
|
+
const ttlToUse = TTL$3;
|
|
224
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "einstein-copilot-bot", VERSION$7, RepresentationType$3, equals$7);
|
|
225
|
+
return createLink(key);
|
|
226
|
+
};
|
|
227
|
+
function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
|
|
228
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
229
|
+
const rootKey = fullPathFactory();
|
|
230
|
+
rootKeySet.set(rootKey, {
|
|
231
|
+
namespace: keyPrefix,
|
|
232
|
+
representationName: RepresentationType$3,
|
|
233
|
+
mergeable: false
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
function select$9(luvio, params) {
|
|
238
|
+
return select$a();
|
|
239
|
+
}
|
|
240
|
+
function keyBuilder$5(luvio, params) {
|
|
241
|
+
return keyPrefix + '::CopilotBotInfoRepresentation:(' + ')';
|
|
242
|
+
}
|
|
243
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
244
|
+
getTypeCacheKeys$3(storeKeyMap, luvio, response, () => keyBuilder$5());
|
|
245
|
+
}
|
|
246
|
+
function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
247
|
+
const { body } = response;
|
|
248
|
+
const key = keyBuilder$5();
|
|
249
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
250
|
+
const snapshot = luvio.storeLookup({
|
|
251
|
+
recordId: key,
|
|
252
|
+
node: select$9(),
|
|
253
|
+
variables: {},
|
|
254
|
+
}, snapshotRefresh);
|
|
255
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
256
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
257
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
deepFreeze(snapshot.data);
|
|
261
|
+
return snapshot;
|
|
262
|
+
}
|
|
263
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
264
|
+
const key = keyBuilder$5();
|
|
265
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
266
|
+
const storeMetadataParams = {
|
|
267
|
+
ttl: TTL$3,
|
|
268
|
+
namespace: keyPrefix,
|
|
269
|
+
version: VERSION$7,
|
|
270
|
+
representationName: RepresentationType$3
|
|
271
|
+
};
|
|
272
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
273
|
+
return errorSnapshot;
|
|
274
|
+
}
|
|
275
|
+
function createResourceRequest$2(config) {
|
|
276
|
+
const headers = {};
|
|
277
|
+
return {
|
|
278
|
+
baseUri: '/services/data/v60.0',
|
|
279
|
+
basePath: '/connect/conversation-runtime-proxy',
|
|
280
|
+
method: 'get',
|
|
281
|
+
body: null,
|
|
282
|
+
urlParams: {},
|
|
283
|
+
queryParams: {},
|
|
284
|
+
headers,
|
|
285
|
+
priority: 'normal',
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
const adapterName$2 = 'getBotId';
|
|
290
|
+
const getBotId_ConfigPropertyMetadata = [];
|
|
291
|
+
const getBotId_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getBotId_ConfigPropertyMetadata);
|
|
292
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$3(getBotId_ConfigPropertyMetadata);
|
|
293
|
+
function keyBuilder$4(luvio, config) {
|
|
294
|
+
createResourceParams$2(config);
|
|
295
|
+
return keyBuilder$5();
|
|
296
|
+
}
|
|
297
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
298
|
+
const config = {};
|
|
299
|
+
return config;
|
|
300
|
+
}
|
|
301
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
302
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
303
|
+
return null;
|
|
304
|
+
}
|
|
305
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
306
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
307
|
+
}
|
|
308
|
+
const config = typeCheckConfig$2();
|
|
309
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
310
|
+
return null;
|
|
311
|
+
}
|
|
312
|
+
return config;
|
|
313
|
+
}
|
|
314
|
+
function adapterFragment$1(luvio, config) {
|
|
315
|
+
createResourceParams$2(config);
|
|
316
|
+
return select$9();
|
|
317
|
+
}
|
|
318
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
319
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
|
|
320
|
+
config,
|
|
321
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
322
|
+
});
|
|
323
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
324
|
+
}
|
|
325
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
326
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
327
|
+
config,
|
|
328
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
329
|
+
});
|
|
330
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
331
|
+
}
|
|
332
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
333
|
+
const resourceParams = createResourceParams$2(config);
|
|
334
|
+
const request = createResourceRequest$2();
|
|
335
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
336
|
+
.then((response) => {
|
|
337
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
|
|
338
|
+
const cache = new StoreKeyMap();
|
|
339
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
340
|
+
return cache;
|
|
341
|
+
});
|
|
342
|
+
}, (response) => {
|
|
343
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
347
|
+
return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
|
|
348
|
+
}
|
|
349
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
350
|
+
const { luvio, config } = context;
|
|
351
|
+
const selector = {
|
|
352
|
+
recordId: keyBuilder$4(luvio, config),
|
|
353
|
+
node: adapterFragment$1(luvio, config),
|
|
354
|
+
variables: {},
|
|
355
|
+
};
|
|
356
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
357
|
+
config,
|
|
358
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
359
|
+
});
|
|
360
|
+
return cacheSnapshot;
|
|
361
|
+
}
|
|
362
|
+
const getBotIdAdapterFactory = (luvio) => function einsteinCopilotBot__getBotId(untrustedConfig, requestContext) {
|
|
363
|
+
const config = validateAdapterConfig$2(untrustedConfig, getBotId_ConfigPropertyNames);
|
|
364
|
+
// Invalid or incomplete config
|
|
365
|
+
if (config === null) {
|
|
366
|
+
return null;
|
|
367
|
+
}
|
|
368
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
369
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
const VERSION$6 = "504437088c2317480c651ac05a7565b5";
|
|
373
|
+
function validate$7(obj, path = 'PlanTemplateRepresentation') {
|
|
374
|
+
const v_error = (() => {
|
|
375
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
376
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
377
|
+
}
|
|
378
|
+
const obj_intent = obj.intent;
|
|
379
|
+
const path_intent = path + '.intent';
|
|
380
|
+
if (typeof obj_intent !== 'string') {
|
|
381
|
+
return new TypeError('Expected "string" but received "' + typeof obj_intent + '" (at "' + path_intent + '")');
|
|
382
|
+
}
|
|
383
|
+
const obj_label = obj.label;
|
|
384
|
+
const path_label = path + '.label';
|
|
385
|
+
if (typeof obj_label !== 'string') {
|
|
386
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
387
|
+
}
|
|
388
|
+
const obj_planTemplateId = obj.planTemplateId;
|
|
389
|
+
const path_planTemplateId = path + '.planTemplateId';
|
|
390
|
+
if (typeof obj_planTemplateId !== 'string') {
|
|
391
|
+
return new TypeError('Expected "string" but received "' + typeof obj_planTemplateId + '" (at "' + path_planTemplateId + '")');
|
|
392
|
+
}
|
|
393
|
+
const obj_userUtterance = obj.userUtterance;
|
|
394
|
+
const path_userUtterance = path + '.userUtterance';
|
|
395
|
+
if (typeof obj_userUtterance !== 'string') {
|
|
396
|
+
return new TypeError('Expected "string" but received "' + typeof obj_userUtterance + '" (at "' + path_userUtterance + '")');
|
|
397
|
+
}
|
|
398
|
+
const obj_variables = obj.variables;
|
|
399
|
+
const path_variables = path + '.variables';
|
|
400
|
+
if (typeof obj_variables !== 'object' || ArrayIsArray(obj_variables) || obj_variables === null) {
|
|
401
|
+
return new TypeError('Expected "object" but received "' + typeof obj_variables + '" (at "' + path_variables + '")');
|
|
402
|
+
}
|
|
403
|
+
const obj_variables_keys = ObjectKeys(obj_variables);
|
|
404
|
+
for (let i = 0; i < obj_variables_keys.length; i++) {
|
|
405
|
+
const key = obj_variables_keys[i];
|
|
406
|
+
const obj_variables_prop = obj_variables[key];
|
|
407
|
+
const path_variables_prop = path_variables + '["' + key + '"]';
|
|
408
|
+
if (typeof obj_variables_prop !== 'string') {
|
|
409
|
+
return new TypeError('Expected "string" but received "' + typeof obj_variables_prop + '" (at "' + path_variables_prop + '")');
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
})();
|
|
413
|
+
return v_error === undefined ? null : v_error;
|
|
414
|
+
}
|
|
415
|
+
const select$8 = function PlanTemplateRepresentationSelect() {
|
|
416
|
+
return {
|
|
417
|
+
kind: 'Fragment',
|
|
418
|
+
version: VERSION$6,
|
|
419
|
+
private: [],
|
|
420
|
+
selections: [
|
|
421
|
+
{
|
|
422
|
+
name: 'intent',
|
|
423
|
+
kind: 'Scalar'
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
name: 'label',
|
|
427
|
+
kind: 'Scalar'
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
name: 'planTemplateId',
|
|
431
|
+
kind: 'Scalar'
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
name: 'userUtterance',
|
|
435
|
+
kind: 'Scalar'
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
name: 'variables',
|
|
439
|
+
kind: 'Scalar',
|
|
440
|
+
map: true
|
|
441
|
+
}
|
|
442
|
+
]
|
|
443
|
+
};
|
|
444
|
+
};
|
|
445
|
+
function equals$6(existing, incoming) {
|
|
446
|
+
const existing_intent = existing.intent;
|
|
447
|
+
const incoming_intent = incoming.intent;
|
|
448
|
+
if (!(existing_intent === incoming_intent)) {
|
|
449
|
+
return false;
|
|
450
|
+
}
|
|
451
|
+
const existing_label = existing.label;
|
|
452
|
+
const incoming_label = incoming.label;
|
|
453
|
+
if (!(existing_label === incoming_label)) {
|
|
454
|
+
return false;
|
|
455
|
+
}
|
|
456
|
+
const existing_planTemplateId = existing.planTemplateId;
|
|
457
|
+
const incoming_planTemplateId = incoming.planTemplateId;
|
|
458
|
+
if (!(existing_planTemplateId === incoming_planTemplateId)) {
|
|
459
|
+
return false;
|
|
460
|
+
}
|
|
461
|
+
const existing_userUtterance = existing.userUtterance;
|
|
462
|
+
const incoming_userUtterance = incoming.userUtterance;
|
|
463
|
+
if (!(existing_userUtterance === incoming_userUtterance)) {
|
|
464
|
+
return false;
|
|
465
|
+
}
|
|
466
|
+
const existing_variables = existing.variables;
|
|
467
|
+
const incoming_variables = incoming.variables;
|
|
468
|
+
const equals_variables_props = equalsObject(existing_variables, incoming_variables, (existing_variables_prop, incoming_variables_prop) => {
|
|
469
|
+
if (!(existing_variables_prop === incoming_variables_prop)) {
|
|
470
|
+
return false;
|
|
471
|
+
}
|
|
472
|
+
});
|
|
473
|
+
if (equals_variables_props === false) {
|
|
474
|
+
return false;
|
|
475
|
+
}
|
|
476
|
+
return true;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
const TTL$2 = 900000;
|
|
480
|
+
const VERSION$5 = "0503b0c5ce250e7f5fbf16f2d3f2fec4";
|
|
481
|
+
function validate$6(obj, path = 'RecommendedPlanTemplatesRepresentation') {
|
|
482
|
+
const v_error = (() => {
|
|
483
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
484
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
485
|
+
}
|
|
486
|
+
if (obj.errorMessage !== undefined) {
|
|
487
|
+
const obj_errorMessage = obj.errorMessage;
|
|
488
|
+
const path_errorMessage = path + '.errorMessage';
|
|
489
|
+
if (typeof obj_errorMessage !== 'string') {
|
|
490
|
+
return new TypeError('Expected "string" but received "' + typeof obj_errorMessage + '" (at "' + path_errorMessage + '")');
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
const obj_isSuccess = obj.isSuccess;
|
|
494
|
+
const path_isSuccess = path + '.isSuccess';
|
|
495
|
+
if (typeof obj_isSuccess !== 'boolean') {
|
|
496
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
|
|
497
|
+
}
|
|
498
|
+
const obj_planTemplates = obj.planTemplates;
|
|
499
|
+
const path_planTemplates = path + '.planTemplates';
|
|
500
|
+
if (!ArrayIsArray(obj_planTemplates)) {
|
|
501
|
+
return new TypeError('Expected "array" but received "' + typeof obj_planTemplates + '" (at "' + path_planTemplates + '")');
|
|
502
|
+
}
|
|
503
|
+
for (let i = 0; i < obj_planTemplates.length; i++) {
|
|
504
|
+
const obj_planTemplates_item = obj_planTemplates[i];
|
|
505
|
+
const path_planTemplates_item = path_planTemplates + '[' + i + ']';
|
|
506
|
+
const referencepath_planTemplates_itemValidationError = validate$7(obj_planTemplates_item, path_planTemplates_item);
|
|
507
|
+
if (referencepath_planTemplates_itemValidationError !== null) {
|
|
508
|
+
let message = 'Object doesn\'t match PlanTemplateRepresentation (at "' + path_planTemplates_item + '")\n';
|
|
509
|
+
message += referencepath_planTemplates_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
510
|
+
return new TypeError(message);
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
})();
|
|
514
|
+
return v_error === undefined ? null : v_error;
|
|
515
|
+
}
|
|
516
|
+
const RepresentationType$2 = 'RecommendedPlanTemplatesRepresentation';
|
|
517
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
518
|
+
return input;
|
|
519
|
+
}
|
|
520
|
+
const select$7 = function RecommendedPlanTemplatesRepresentationSelect() {
|
|
521
|
+
const { selections: PlanTemplateRepresentation__selections, opaque: PlanTemplateRepresentation__opaque, } = select$8();
|
|
522
|
+
return {
|
|
523
|
+
kind: 'Fragment',
|
|
524
|
+
version: VERSION$5,
|
|
525
|
+
private: [],
|
|
526
|
+
selections: [
|
|
527
|
+
{
|
|
528
|
+
name: 'errorMessage',
|
|
529
|
+
kind: 'Scalar',
|
|
530
|
+
required: false
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
name: 'isSuccess',
|
|
534
|
+
kind: 'Scalar'
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
name: 'planTemplates',
|
|
538
|
+
kind: 'Object',
|
|
539
|
+
plural: true,
|
|
540
|
+
selections: PlanTemplateRepresentation__selections
|
|
541
|
+
}
|
|
542
|
+
]
|
|
543
|
+
};
|
|
544
|
+
};
|
|
545
|
+
function equals$5(existing, incoming) {
|
|
546
|
+
const existing_isSuccess = existing.isSuccess;
|
|
547
|
+
const incoming_isSuccess = incoming.isSuccess;
|
|
548
|
+
if (!(existing_isSuccess === incoming_isSuccess)) {
|
|
549
|
+
return false;
|
|
550
|
+
}
|
|
551
|
+
const existing_errorMessage = existing.errorMessage;
|
|
552
|
+
const incoming_errorMessage = incoming.errorMessage;
|
|
553
|
+
// if at least one of these optionals is defined
|
|
554
|
+
if (existing_errorMessage !== undefined || incoming_errorMessage !== undefined) {
|
|
555
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
556
|
+
// not equal
|
|
557
|
+
if (existing_errorMessage === undefined || incoming_errorMessage === undefined) {
|
|
558
|
+
return false;
|
|
559
|
+
}
|
|
560
|
+
if (!(existing_errorMessage === incoming_errorMessage)) {
|
|
561
|
+
return false;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
const existing_planTemplates = existing.planTemplates;
|
|
565
|
+
const incoming_planTemplates = incoming.planTemplates;
|
|
566
|
+
const equals_planTemplates_items = equalsArray(existing_planTemplates, incoming_planTemplates, (existing_planTemplates_item, incoming_planTemplates_item) => {
|
|
567
|
+
if (!(equals$6(existing_planTemplates_item, incoming_planTemplates_item))) {
|
|
568
|
+
return false;
|
|
569
|
+
}
|
|
570
|
+
});
|
|
571
|
+
if (equals_planTemplates_items === false) {
|
|
572
|
+
return false;
|
|
573
|
+
}
|
|
574
|
+
return true;
|
|
575
|
+
}
|
|
576
|
+
const ingest$2 = function RecommendedPlanTemplatesRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
196
577
|
if (process.env.NODE_ENV !== 'production') {
|
|
197
578
|
const validateError = validate$6(input);
|
|
198
579
|
if (validateError !== null) {
|
|
@@ -218,14 +599,14 @@ function select$6(luvio, params) {
|
|
|
218
599
|
return select$7();
|
|
219
600
|
}
|
|
220
601
|
function keyBuilder$3(luvio, params) {
|
|
221
|
-
return keyPrefix + '::
|
|
602
|
+
return keyPrefix + '::RecommendedPlanTemplatesRepresentation:(' + 'pageType:' + params.urlParams.pageType + ',' + 'objectType:' + params.urlParams.objectType + ')';
|
|
222
603
|
}
|
|
223
604
|
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
224
|
-
getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$3());
|
|
605
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$3(luvio, resourceParams));
|
|
225
606
|
}
|
|
226
607
|
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
227
608
|
const { body } = response;
|
|
228
|
-
const key = keyBuilder$3();
|
|
609
|
+
const key = keyBuilder$3(luvio, resourceParams);
|
|
229
610
|
luvio.storeIngest(key, ingest$2, body);
|
|
230
611
|
const snapshot = luvio.storeLookup({
|
|
231
612
|
recordId: key,
|
|
@@ -241,7 +622,7 @@ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
241
622
|
return snapshot;
|
|
242
623
|
}
|
|
243
624
|
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
244
|
-
const key = keyBuilder$3();
|
|
625
|
+
const key = keyBuilder$3(luvio, params);
|
|
245
626
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
246
627
|
const storeMetadataParams = {
|
|
247
628
|
ttl: TTL$2,
|
|
@@ -256,26 +637,30 @@ function createResourceRequest$1(config) {
|
|
|
256
637
|
const headers = {};
|
|
257
638
|
return {
|
|
258
639
|
baseUri: '/services/data/v60.0',
|
|
259
|
-
basePath: '/connect/
|
|
640
|
+
basePath: '/connect/recommended-plan-templates/' + config.urlParams.pageType + '/' + config.urlParams.objectType + '',
|
|
260
641
|
method: 'get',
|
|
261
642
|
body: null,
|
|
262
|
-
urlParams:
|
|
643
|
+
urlParams: config.urlParams,
|
|
263
644
|
queryParams: {},
|
|
264
645
|
headers,
|
|
265
646
|
priority: 'normal',
|
|
266
647
|
};
|
|
267
648
|
}
|
|
268
649
|
|
|
269
|
-
const adapterName$1 = '
|
|
270
|
-
const
|
|
271
|
-
|
|
272
|
-
|
|
650
|
+
const adapterName$1 = 'getRecommendedPlanTemplates';
|
|
651
|
+
const getRecommendedPlanTemplates_ConfigPropertyMetadata = [
|
|
652
|
+
generateParamConfigMetadata('pageType', true, 0 /* UrlParameter */, 0 /* String */),
|
|
653
|
+
generateParamConfigMetadata('objectType', true, 0 /* UrlParameter */, 0 /* String */),
|
|
654
|
+
];
|
|
655
|
+
const getRecommendedPlanTemplates_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getRecommendedPlanTemplates_ConfigPropertyMetadata);
|
|
656
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$3(getRecommendedPlanTemplates_ConfigPropertyMetadata);
|
|
273
657
|
function keyBuilder$2(luvio, config) {
|
|
274
|
-
createResourceParams$1(config);
|
|
275
|
-
return keyBuilder$3();
|
|
658
|
+
const resourceParams = createResourceParams$1(config);
|
|
659
|
+
return keyBuilder$3(luvio, resourceParams);
|
|
276
660
|
}
|
|
277
661
|
function typeCheckConfig$1(untrustedConfig) {
|
|
278
662
|
const config = {};
|
|
663
|
+
typeCheckConfig$3(untrustedConfig, config, getRecommendedPlanTemplates_ConfigPropertyMetadata);
|
|
279
664
|
return config;
|
|
280
665
|
}
|
|
281
666
|
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
@@ -285,7 +670,7 @@ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
|
285
670
|
if (process.env.NODE_ENV !== 'production') {
|
|
286
671
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
287
672
|
}
|
|
288
|
-
const config = typeCheckConfig$1();
|
|
673
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
289
674
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
290
675
|
return null;
|
|
291
676
|
}
|
|
@@ -311,7 +696,7 @@ function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
|
311
696
|
}
|
|
312
697
|
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
313
698
|
const resourceParams = createResourceParams$1(config);
|
|
314
|
-
const request = createResourceRequest$1();
|
|
699
|
+
const request = createResourceRequest$1(resourceParams);
|
|
315
700
|
return luvio.dispatchResourceRequest(request, options)
|
|
316
701
|
.then((response) => {
|
|
317
702
|
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
@@ -324,7 +709,7 @@ function buildNetworkSnapshot$1(luvio, config, options) {
|
|
|
324
709
|
});
|
|
325
710
|
}
|
|
326
711
|
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
327
|
-
return buildNetworkSnapshotCachePolicy$
|
|
712
|
+
return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
|
|
328
713
|
}
|
|
329
714
|
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
330
715
|
const { luvio, config } = context;
|
|
@@ -339,8 +724,8 @@ function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
|
339
724
|
});
|
|
340
725
|
return cacheSnapshot;
|
|
341
726
|
}
|
|
342
|
-
const
|
|
343
|
-
const config = validateAdapterConfig$1(untrustedConfig,
|
|
727
|
+
const getRecommendedPlanTemplatesAdapterFactory = (luvio) => function einsteinCopilotBot__getRecommendedPlanTemplates(untrustedConfig, requestContext) {
|
|
728
|
+
const config = validateAdapterConfig$1(untrustedConfig, getRecommendedPlanTemplates_ConfigPropertyNames);
|
|
344
729
|
// Invalid or incomplete config
|
|
345
730
|
if (config === null) {
|
|
346
731
|
return null;
|
|
@@ -349,12 +734,40 @@ const getBotIdAdapterFactory = (luvio) => function einsteinCopilotBot__getBotId(
|
|
|
349
734
|
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
350
735
|
};
|
|
351
736
|
|
|
352
|
-
const VERSION$4 = "
|
|
737
|
+
const VERSION$4 = "e8cb7e20392935088ea2f98edb927e8a";
|
|
353
738
|
function validate$5(obj, path = 'EsTypeMessageRepresentation') {
|
|
354
739
|
const v_error = (() => {
|
|
355
740
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
356
741
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
357
742
|
}
|
|
743
|
+
if (obj.property !== undefined) {
|
|
744
|
+
const obj_property = obj.property;
|
|
745
|
+
const path_property = path + '.property';
|
|
746
|
+
let obj_property_union0 = null;
|
|
747
|
+
const obj_property_union0_error = (() => {
|
|
748
|
+
if (typeof obj_property !== 'string') {
|
|
749
|
+
return new TypeError('Expected "string" but received "' + typeof obj_property + '" (at "' + path_property + '")');
|
|
750
|
+
}
|
|
751
|
+
})();
|
|
752
|
+
if (obj_property_union0_error != null) {
|
|
753
|
+
obj_property_union0 = obj_property_union0_error.message;
|
|
754
|
+
}
|
|
755
|
+
let obj_property_union1 = null;
|
|
756
|
+
const obj_property_union1_error = (() => {
|
|
757
|
+
if (obj_property !== null) {
|
|
758
|
+
return new TypeError('Expected "null" but received "' + typeof obj_property + '" (at "' + path_property + '")');
|
|
759
|
+
}
|
|
760
|
+
})();
|
|
761
|
+
if (obj_property_union1_error != null) {
|
|
762
|
+
obj_property_union1 = obj_property_union1_error.message;
|
|
763
|
+
}
|
|
764
|
+
if (obj_property_union0 && obj_property_union1) {
|
|
765
|
+
let message = 'Object doesn\'t match union (at "' + path_property + '")';
|
|
766
|
+
message += '\n' + obj_property_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
767
|
+
message += '\n' + obj_property_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
768
|
+
return new TypeError(message);
|
|
769
|
+
}
|
|
770
|
+
}
|
|
358
771
|
const obj_type = obj.type;
|
|
359
772
|
const path_type = path + '.type';
|
|
360
773
|
if (typeof obj_type !== 'string') {
|
|
@@ -374,6 +787,11 @@ const select$5 = function EsTypeMessageRepresentationSelect() {
|
|
|
374
787
|
version: VERSION$4,
|
|
375
788
|
private: [],
|
|
376
789
|
selections: [
|
|
790
|
+
{
|
|
791
|
+
name: 'property',
|
|
792
|
+
kind: 'Scalar',
|
|
793
|
+
required: false
|
|
794
|
+
},
|
|
377
795
|
{
|
|
378
796
|
name: 'type',
|
|
379
797
|
kind: 'Scalar'
|
|
@@ -392,6 +810,19 @@ function equals$4(existing, incoming) {
|
|
|
392
810
|
if (!(existing_type === incoming_type)) {
|
|
393
811
|
return false;
|
|
394
812
|
}
|
|
813
|
+
const existing_property = existing.property;
|
|
814
|
+
const incoming_property = incoming.property;
|
|
815
|
+
// if at least one of these optionals is defined
|
|
816
|
+
if (existing_property !== undefined || incoming_property !== undefined) {
|
|
817
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
818
|
+
// not equal
|
|
819
|
+
if (existing_property === undefined || incoming_property === undefined) {
|
|
820
|
+
return false;
|
|
821
|
+
}
|
|
822
|
+
if (!(existing_property === incoming_property)) {
|
|
823
|
+
return false;
|
|
824
|
+
}
|
|
825
|
+
}
|
|
395
826
|
const existing_value = existing.value;
|
|
396
827
|
const incoming_value = incoming.value;
|
|
397
828
|
if (JSONStringify(incoming_value) !== JSONStringify(existing_value)) {
|
|
@@ -410,10 +841,12 @@ function validate$4(obj, path = 'VariableRepresentation') {
|
|
|
410
841
|
if (typeof obj_name !== 'string') {
|
|
411
842
|
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
412
843
|
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
844
|
+
if (obj.value !== undefined) {
|
|
845
|
+
const obj_value = obj.value;
|
|
846
|
+
const path_value = path + '.value';
|
|
847
|
+
if (typeof obj_value !== 'string') {
|
|
848
|
+
return new TypeError('Expected "string" but received "' + typeof obj_value + '" (at "' + path_value + '")');
|
|
849
|
+
}
|
|
417
850
|
}
|
|
418
851
|
})();
|
|
419
852
|
return v_error === undefined ? null : v_error;
|
|
@@ -469,19 +902,49 @@ function equals$3(existing, incoming) {
|
|
|
469
902
|
return true;
|
|
470
903
|
}
|
|
471
904
|
|
|
472
|
-
const VERSION$2 = "
|
|
905
|
+
const VERSION$2 = "477724425d0742c030025796c88ebf5d";
|
|
473
906
|
function validate$2(obj, path = 'CollectMessageRepresentation') {
|
|
474
907
|
const v_error = (() => {
|
|
475
908
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
476
909
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
477
910
|
}
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
911
|
+
if (obj.data !== undefined) {
|
|
912
|
+
const obj_data = obj.data;
|
|
913
|
+
const path_data = path + '.data';
|
|
914
|
+
const referencepath_dataValidationError = validate$5(obj_data, path_data);
|
|
915
|
+
if (referencepath_dataValidationError !== null) {
|
|
916
|
+
let message = 'Object doesn\'t match EsTypeMessageRepresentation (at "' + path_data + '")\n';
|
|
917
|
+
message += referencepath_dataValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
918
|
+
return new TypeError(message);
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
if (obj.targetProperty !== undefined) {
|
|
922
|
+
const obj_targetProperty = obj.targetProperty;
|
|
923
|
+
const path_targetProperty = path + '.targetProperty';
|
|
924
|
+
let obj_targetProperty_union0 = null;
|
|
925
|
+
const obj_targetProperty_union0_error = (() => {
|
|
926
|
+
if (typeof obj_targetProperty !== 'string') {
|
|
927
|
+
return new TypeError('Expected "string" but received "' + typeof obj_targetProperty + '" (at "' + path_targetProperty + '")');
|
|
928
|
+
}
|
|
929
|
+
})();
|
|
930
|
+
if (obj_targetProperty_union0_error != null) {
|
|
931
|
+
obj_targetProperty_union0 = obj_targetProperty_union0_error.message;
|
|
932
|
+
}
|
|
933
|
+
let obj_targetProperty_union1 = null;
|
|
934
|
+
const obj_targetProperty_union1_error = (() => {
|
|
935
|
+
if (obj_targetProperty !== null) {
|
|
936
|
+
return new TypeError('Expected "null" but received "' + typeof obj_targetProperty + '" (at "' + path_targetProperty + '")');
|
|
937
|
+
}
|
|
938
|
+
})();
|
|
939
|
+
if (obj_targetProperty_union1_error != null) {
|
|
940
|
+
obj_targetProperty_union1 = obj_targetProperty_union1_error.message;
|
|
941
|
+
}
|
|
942
|
+
if (obj_targetProperty_union0 && obj_targetProperty_union1) {
|
|
943
|
+
let message = 'Object doesn\'t match union (at "' + path_targetProperty + '")';
|
|
944
|
+
message += '\n' + obj_targetProperty_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
945
|
+
message += '\n' + obj_targetProperty_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
946
|
+
return new TypeError(message);
|
|
947
|
+
}
|
|
485
948
|
}
|
|
486
949
|
const obj_targetType = obj.targetType;
|
|
487
950
|
const path_targetType = path + '.targetType';
|
|
@@ -501,7 +964,13 @@ const select$3 = function CollectMessageRepresentationSelect() {
|
|
|
501
964
|
{
|
|
502
965
|
name: 'data',
|
|
503
966
|
kind: 'Object',
|
|
504
|
-
selections: EsTypeMessageRepresentation__selections
|
|
967
|
+
selections: EsTypeMessageRepresentation__selections,
|
|
968
|
+
required: false
|
|
969
|
+
},
|
|
970
|
+
{
|
|
971
|
+
name: 'targetProperty',
|
|
972
|
+
kind: 'Scalar',
|
|
973
|
+
required: false
|
|
505
974
|
},
|
|
506
975
|
{
|
|
507
976
|
name: 'targetType',
|
|
@@ -518,14 +987,35 @@ function equals$2(existing, incoming) {
|
|
|
518
987
|
}
|
|
519
988
|
const existing_data = existing.data;
|
|
520
989
|
const incoming_data = incoming.data;
|
|
521
|
-
if
|
|
522
|
-
|
|
990
|
+
// if at least one of these optionals is defined
|
|
991
|
+
if (existing_data !== undefined || incoming_data !== undefined) {
|
|
992
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
993
|
+
// not equal
|
|
994
|
+
if (existing_data === undefined || incoming_data === undefined) {
|
|
995
|
+
return false;
|
|
996
|
+
}
|
|
997
|
+
if (!(equals$4(existing_data, incoming_data))) {
|
|
998
|
+
return false;
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
const existing_targetProperty = existing.targetProperty;
|
|
1002
|
+
const incoming_targetProperty = incoming.targetProperty;
|
|
1003
|
+
// if at least one of these optionals is defined
|
|
1004
|
+
if (existing_targetProperty !== undefined || incoming_targetProperty !== undefined) {
|
|
1005
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1006
|
+
// not equal
|
|
1007
|
+
if (existing_targetProperty === undefined || incoming_targetProperty === undefined) {
|
|
1008
|
+
return false;
|
|
1009
|
+
}
|
|
1010
|
+
if (!(existing_targetProperty === incoming_targetProperty)) {
|
|
1011
|
+
return false;
|
|
1012
|
+
}
|
|
523
1013
|
}
|
|
524
1014
|
return true;
|
|
525
1015
|
}
|
|
526
1016
|
|
|
527
1017
|
const TTL$1 = 30000;
|
|
528
|
-
const VERSION$1 = "
|
|
1018
|
+
const VERSION$1 = "55ac02bd055f57a2a12aa0fa4844d1a2";
|
|
529
1019
|
function validate$1(obj, path = 'ConversationRuntimeProxyMessageRepresentation') {
|
|
530
1020
|
const v_error = (() => {
|
|
531
1021
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
@@ -624,6 +1114,34 @@ function validate$1(obj, path = 'ConversationRuntimeProxyMessageRepresentation')
|
|
|
624
1114
|
return new TypeError(message);
|
|
625
1115
|
}
|
|
626
1116
|
}
|
|
1117
|
+
if (obj.feedbackId !== undefined) {
|
|
1118
|
+
const obj_feedbackId = obj.feedbackId;
|
|
1119
|
+
const path_feedbackId = path + '.feedbackId';
|
|
1120
|
+
let obj_feedbackId_union0 = null;
|
|
1121
|
+
const obj_feedbackId_union0_error = (() => {
|
|
1122
|
+
if (typeof obj_feedbackId !== 'string') {
|
|
1123
|
+
return new TypeError('Expected "string" but received "' + typeof obj_feedbackId + '" (at "' + path_feedbackId + '")');
|
|
1124
|
+
}
|
|
1125
|
+
})();
|
|
1126
|
+
if (obj_feedbackId_union0_error != null) {
|
|
1127
|
+
obj_feedbackId_union0 = obj_feedbackId_union0_error.message;
|
|
1128
|
+
}
|
|
1129
|
+
let obj_feedbackId_union1 = null;
|
|
1130
|
+
const obj_feedbackId_union1_error = (() => {
|
|
1131
|
+
if (obj_feedbackId !== null) {
|
|
1132
|
+
return new TypeError('Expected "null" but received "' + typeof obj_feedbackId + '" (at "' + path_feedbackId + '")');
|
|
1133
|
+
}
|
|
1134
|
+
})();
|
|
1135
|
+
if (obj_feedbackId_union1_error != null) {
|
|
1136
|
+
obj_feedbackId_union1 = obj_feedbackId_union1_error.message;
|
|
1137
|
+
}
|
|
1138
|
+
if (obj_feedbackId_union0 && obj_feedbackId_union1) {
|
|
1139
|
+
let message = 'Object doesn\'t match union (at "' + path_feedbackId + '")';
|
|
1140
|
+
message += '\n' + obj_feedbackId_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1141
|
+
message += '\n' + obj_feedbackId_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1142
|
+
return new TypeError(message);
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
627
1145
|
const obj_id = obj.id;
|
|
628
1146
|
const path_id = path + '.id';
|
|
629
1147
|
if (typeof obj_id !== 'string') {
|
|
@@ -685,6 +1203,34 @@ function validate$1(obj, path = 'ConversationRuntimeProxyMessageRepresentation')
|
|
|
685
1203
|
return new TypeError(message);
|
|
686
1204
|
}
|
|
687
1205
|
}
|
|
1206
|
+
if (obj.planId !== undefined) {
|
|
1207
|
+
const obj_planId = obj.planId;
|
|
1208
|
+
const path_planId = path + '.planId';
|
|
1209
|
+
let obj_planId_union0 = null;
|
|
1210
|
+
const obj_planId_union0_error = (() => {
|
|
1211
|
+
if (typeof obj_planId !== 'string') {
|
|
1212
|
+
return new TypeError('Expected "string" but received "' + typeof obj_planId + '" (at "' + path_planId + '")');
|
|
1213
|
+
}
|
|
1214
|
+
})();
|
|
1215
|
+
if (obj_planId_union0_error != null) {
|
|
1216
|
+
obj_planId_union0 = obj_planId_union0_error.message;
|
|
1217
|
+
}
|
|
1218
|
+
let obj_planId_union1 = null;
|
|
1219
|
+
const obj_planId_union1_error = (() => {
|
|
1220
|
+
if (obj_planId !== null) {
|
|
1221
|
+
return new TypeError('Expected "null" but received "' + typeof obj_planId + '" (at "' + path_planId + '")');
|
|
1222
|
+
}
|
|
1223
|
+
})();
|
|
1224
|
+
if (obj_planId_union1_error != null) {
|
|
1225
|
+
obj_planId_union1 = obj_planId_union1_error.message;
|
|
1226
|
+
}
|
|
1227
|
+
if (obj_planId_union0 && obj_planId_union1) {
|
|
1228
|
+
let message = 'Object doesn\'t match union (at "' + path_planId + '")';
|
|
1229
|
+
message += '\n' + obj_planId_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1230
|
+
message += '\n' + obj_planId_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1231
|
+
return new TypeError(message);
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
688
1234
|
if (obj.result !== undefined) {
|
|
689
1235
|
const obj_result = obj.result;
|
|
690
1236
|
const path_result = path + '.result';
|
|
@@ -822,6 +1368,11 @@ const select$2 = function ConversationRuntimeProxyMessageRepresentationSelect()
|
|
|
822
1368
|
kind: 'Scalar',
|
|
823
1369
|
required: false
|
|
824
1370
|
},
|
|
1371
|
+
{
|
|
1372
|
+
name: 'feedbackId',
|
|
1373
|
+
kind: 'Scalar',
|
|
1374
|
+
required: false
|
|
1375
|
+
},
|
|
825
1376
|
{
|
|
826
1377
|
name: 'id',
|
|
827
1378
|
kind: 'Scalar'
|
|
@@ -836,6 +1387,11 @@ const select$2 = function ConversationRuntimeProxyMessageRepresentationSelect()
|
|
|
836
1387
|
kind: 'Scalar',
|
|
837
1388
|
required: false
|
|
838
1389
|
},
|
|
1390
|
+
{
|
|
1391
|
+
name: 'planId',
|
|
1392
|
+
kind: 'Scalar',
|
|
1393
|
+
required: false
|
|
1394
|
+
},
|
|
839
1395
|
{
|
|
840
1396
|
name: 'result',
|
|
841
1397
|
kind: 'Object',
|
|
@@ -965,6 +1521,19 @@ function equals$1(existing, incoming) {
|
|
|
965
1521
|
return false;
|
|
966
1522
|
}
|
|
967
1523
|
}
|
|
1524
|
+
const existing_feedbackId = existing.feedbackId;
|
|
1525
|
+
const incoming_feedbackId = incoming.feedbackId;
|
|
1526
|
+
// if at least one of these optionals is defined
|
|
1527
|
+
if (existing_feedbackId !== undefined || incoming_feedbackId !== undefined) {
|
|
1528
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1529
|
+
// not equal
|
|
1530
|
+
if (existing_feedbackId === undefined || incoming_feedbackId === undefined) {
|
|
1531
|
+
return false;
|
|
1532
|
+
}
|
|
1533
|
+
if (!(existing_feedbackId === incoming_feedbackId)) {
|
|
1534
|
+
return false;
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
968
1537
|
const existing_message = existing.message;
|
|
969
1538
|
const incoming_message = incoming.message;
|
|
970
1539
|
// if at least one of these optionals is defined
|
|
@@ -991,6 +1560,19 @@ function equals$1(existing, incoming) {
|
|
|
991
1560
|
return false;
|
|
992
1561
|
}
|
|
993
1562
|
}
|
|
1563
|
+
const existing_planId = existing.planId;
|
|
1564
|
+
const incoming_planId = incoming.planId;
|
|
1565
|
+
// if at least one of these optionals is defined
|
|
1566
|
+
if (existing_planId !== undefined || incoming_planId !== undefined) {
|
|
1567
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1568
|
+
// not equal
|
|
1569
|
+
if (existing_planId === undefined || incoming_planId === undefined) {
|
|
1570
|
+
return false;
|
|
1571
|
+
}
|
|
1572
|
+
if (!(existing_planId === incoming_planId)) {
|
|
1573
|
+
return false;
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
994
1576
|
const existing_result = existing.result;
|
|
995
1577
|
const incoming_result = incoming.result;
|
|
996
1578
|
// if at least one of these optionals is defined
|
|
@@ -1290,17 +1872,24 @@ const sendMessage_ConfigPropertyMetadata = [
|
|
|
1290
1872
|
generateParamConfigMetadata('botVersionId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1291
1873
|
generateParamConfigMetadata('message', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1292
1874
|
generateParamConfigMetadata('sessionId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1875
|
+
generateParamConfigMetadata('inReplyToMessageId', false, 2 /* Body */, 0 /* String */),
|
|
1876
|
+
generateParamConfigMetadata('intent', false, 2 /* Body */, 0 /* String */),
|
|
1293
1877
|
generateParamConfigMetadata('messageType', false, 2 /* Body */, 0 /* String */),
|
|
1878
|
+
generateParamConfigMetadata('planId', false, 2 /* Body */, 0 /* String */),
|
|
1879
|
+
generateParamConfigMetadata('planTemplateVariables', false, 2 /* Body */, 4 /* Unsupported */),
|
|
1294
1880
|
generateParamConfigMetadata('reply', false, 2 /* Body */, 4 /* Unsupported */, true),
|
|
1295
1881
|
generateParamConfigMetadata('text', false, 2 /* Body */, 0 /* String */),
|
|
1296
1882
|
generateParamConfigMetadata('type', false, 2 /* Body */, 0 /* String */),
|
|
1883
|
+
generateParamConfigMetadata('userUtterance', false, 2 /* Body */, 0 /* String */),
|
|
1297
1884
|
generateParamConfigMetadata('variables', false, 2 /* Body */, 4 /* Unsupported */, true),
|
|
1298
1885
|
];
|
|
1299
1886
|
const sendMessage_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, sendMessage_ConfigPropertyMetadata);
|
|
1300
|
-
const createResourceParams = /*#__PURE__*/ createResourceParams$
|
|
1887
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$3(sendMessage_ConfigPropertyMetadata);
|
|
1301
1888
|
function typeCheckConfig(untrustedConfig) {
|
|
1302
1889
|
const config = {};
|
|
1303
|
-
typeCheckConfig$
|
|
1890
|
+
typeCheckConfig$3(untrustedConfig, config, sendMessage_ConfigPropertyMetadata);
|
|
1891
|
+
const untrustedConfig_planTemplateVariables = untrustedConfig.planTemplateVariables;
|
|
1892
|
+
config.planTemplateVariables = untrustedConfig_planTemplateVariables;
|
|
1304
1893
|
const untrustedConfig_reply = untrustedConfig.reply;
|
|
1305
1894
|
if (ArrayIsArray$1(untrustedConfig_reply)) {
|
|
1306
1895
|
const untrustedConfig_reply_array = [];
|
|
@@ -1370,30 +1959,46 @@ const sendMessageAdapterFactory = (luvio) => {
|
|
|
1370
1959
|
};
|
|
1371
1960
|
|
|
1372
1961
|
let getBotId;
|
|
1962
|
+
let getRecommendedPlanTemplates;
|
|
1373
1963
|
let sendMessage;
|
|
1374
1964
|
// Imperative GET Adapters
|
|
1375
1965
|
let getBotId_imperative;
|
|
1966
|
+
let getRecommendedPlanTemplates_imperative;
|
|
1376
1967
|
// Adapter Metadata
|
|
1377
1968
|
const getBotIdMetadata = { apiFamily: 'einsteincopilot-bot', name: 'getBotId', ttl: 30000 };
|
|
1969
|
+
const getRecommendedPlanTemplatesMetadata = {
|
|
1970
|
+
apiFamily: 'einsteincopilot-bot',
|
|
1971
|
+
name: 'getRecommendedPlanTemplates',
|
|
1972
|
+
ttl: 900000,
|
|
1973
|
+
};
|
|
1378
1974
|
// Notify Update Available
|
|
1379
1975
|
function bindExportsTo(luvio) {
|
|
1380
1976
|
// LDS Adapters
|
|
1381
1977
|
const getBotId_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getBotId', getBotIdAdapterFactory), getBotIdMetadata);
|
|
1978
|
+
const getRecommendedPlanTemplates_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getRecommendedPlanTemplates', getRecommendedPlanTemplatesAdapterFactory), getRecommendedPlanTemplatesMetadata);
|
|
1382
1979
|
function unwrapSnapshotData(factory) {
|
|
1383
1980
|
const adapter = factory(luvio);
|
|
1384
1981
|
return (config) => adapter(config).then((snapshot) => snapshot.data);
|
|
1385
1982
|
}
|
|
1386
1983
|
return {
|
|
1387
1984
|
getBotId: createWireAdapterConstructor(luvio, getBotId_ldsAdapter, getBotIdMetadata),
|
|
1985
|
+
getRecommendedPlanTemplates: createWireAdapterConstructor(luvio, getRecommendedPlanTemplates_ldsAdapter, getRecommendedPlanTemplatesMetadata),
|
|
1388
1986
|
sendMessage: unwrapSnapshotData(sendMessageAdapterFactory),
|
|
1389
1987
|
// Imperative GET Adapters
|
|
1390
1988
|
getBotId_imperative: createImperativeAdapter(luvio, getBotId_ldsAdapter, getBotIdMetadata),
|
|
1989
|
+
getRecommendedPlanTemplates_imperative: createImperativeAdapter(luvio, getRecommendedPlanTemplates_ldsAdapter, getRecommendedPlanTemplatesMetadata),
|
|
1391
1990
|
// Notify Update Availables
|
|
1392
1991
|
};
|
|
1393
1992
|
}
|
|
1394
1993
|
withDefaultLuvio((luvio) => {
|
|
1395
|
-
({
|
|
1994
|
+
({
|
|
1995
|
+
getBotId,
|
|
1996
|
+
getRecommendedPlanTemplates,
|
|
1997
|
+
sendMessage,
|
|
1998
|
+
getBotId_imperative,
|
|
1999
|
+
getRecommendedPlanTemplates_imperative,
|
|
2000
|
+
} = bindExportsTo(luvio));
|
|
1396
2001
|
});
|
|
1397
2002
|
|
|
1398
|
-
export { getBotId, getBotId_imperative, sendMessage };
|
|
1399
|
-
// version: 1.266.0-
|
|
2003
|
+
export { getBotId, getBotId_imperative, getRecommendedPlanTemplates, getRecommendedPlanTemplates_imperative, sendMessage };
|
|
2004
|
+
// version: 1.266.0-dev21-7d5715511
|