@salesforce/lds-adapters-service-einstein-copilot-bot 1.287.0-dev1 → 1.287.0-dev3
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 +898 -223
- package/dist/es/es2018/types/src/generated/adapters/getRecommendedActions.d.ts +33 -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/getConnectRecommendedActions.d.ts +21 -0
- package/dist/es/es2018/types/src/generated/types/CopilotQuickActionRepresentation.d.ts +75 -0
- package/dist/es/es2018/types/src/generated/types/RecommendedActionsRepresentation.d.ts +36 -0
- package/package.json +3 -3
- package/sfdc/index.js +721 -34
- package/src/raml/api.raml +119 -0
- package/src/raml/luvio.raml +8 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* For full license text, see the LICENSE.txt file
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$
|
|
7
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$3, StoreKeyMap, createResourceParams as createResourceParams$4, typeCheckConfig as typeCheckConfig$4 } from '@luvio/engine';
|
|
8
8
|
|
|
9
9
|
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
10
10
|
const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
|
|
@@ -112,9 +112,9 @@ function createLink(ref) {
|
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
const TTL$
|
|
116
|
-
const VERSION$
|
|
117
|
-
function validate$
|
|
115
|
+
const TTL$4 = 30000;
|
|
116
|
+
const VERSION$9 = "ab85410a28124cfed3d8eae7b8236853";
|
|
117
|
+
function validate$a(obj, path = 'CopilotBotInfoRepresentation') {
|
|
118
118
|
const v_error = (() => {
|
|
119
119
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
120
120
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -141,14 +141,14 @@ function validate$8(obj, path = 'CopilotBotInfoRepresentation') {
|
|
|
141
141
|
})();
|
|
142
142
|
return v_error === undefined ? null : v_error;
|
|
143
143
|
}
|
|
144
|
-
const RepresentationType$
|
|
145
|
-
function normalize$
|
|
144
|
+
const RepresentationType$4 = 'CopilotBotInfoRepresentation';
|
|
145
|
+
function normalize$4(input, existing, path, luvio, store, timestamp) {
|
|
146
146
|
return input;
|
|
147
147
|
}
|
|
148
|
-
const select$
|
|
148
|
+
const select$d = function CopilotBotInfoRepresentationSelect() {
|
|
149
149
|
return {
|
|
150
150
|
kind: 'Fragment',
|
|
151
|
-
version: VERSION$
|
|
151
|
+
version: VERSION$9,
|
|
152
152
|
private: [],
|
|
153
153
|
selections: [
|
|
154
154
|
{
|
|
@@ -168,7 +168,7 @@ const select$a = function CopilotBotInfoRepresentationSelect() {
|
|
|
168
168
|
]
|
|
169
169
|
};
|
|
170
170
|
};
|
|
171
|
-
function equals$
|
|
171
|
+
function equals$9(existing, incoming) {
|
|
172
172
|
const existing_isSuccess = existing.isSuccess;
|
|
173
173
|
const incoming_isSuccess = incoming.isSuccess;
|
|
174
174
|
if (!(existing_isSuccess === incoming_isSuccess)) {
|
|
@@ -202,44 +202,44 @@ function equals$7(existing, incoming) {
|
|
|
202
202
|
}
|
|
203
203
|
return true;
|
|
204
204
|
}
|
|
205
|
-
const ingest$
|
|
205
|
+
const ingest$4 = function CopilotBotInfoRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
206
206
|
if (process.env.NODE_ENV !== 'production') {
|
|
207
|
-
const validateError = validate$
|
|
207
|
+
const validateError = validate$a(input);
|
|
208
208
|
if (validateError !== null) {
|
|
209
209
|
throw validateError;
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
const key = path.fullPath;
|
|
213
|
-
const ttlToUse = TTL$
|
|
214
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
213
|
+
const ttlToUse = TTL$4;
|
|
214
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "einstein-copilot-bot", VERSION$9, RepresentationType$4, equals$9);
|
|
215
215
|
return createLink(key);
|
|
216
216
|
};
|
|
217
|
-
function getTypeCacheKeys$
|
|
217
|
+
function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
|
|
218
218
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
219
219
|
const rootKey = fullPathFactory();
|
|
220
220
|
rootKeySet.set(rootKey, {
|
|
221
221
|
namespace: keyPrefix,
|
|
222
|
-
representationName: RepresentationType$
|
|
222
|
+
representationName: RepresentationType$4,
|
|
223
223
|
mergeable: false
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
-
function select$
|
|
228
|
-
return select$
|
|
227
|
+
function select$c(luvio, params) {
|
|
228
|
+
return select$d();
|
|
229
229
|
}
|
|
230
|
-
function keyBuilder$
|
|
230
|
+
function keyBuilder$7(luvio, params) {
|
|
231
231
|
return keyPrefix + '::CopilotBotInfoRepresentation:(' + ')';
|
|
232
232
|
}
|
|
233
|
-
function getResponseCacheKeys$
|
|
234
|
-
getTypeCacheKeys$
|
|
233
|
+
function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
|
|
234
|
+
getTypeCacheKeys$4(storeKeyMap, luvio, response, () => keyBuilder$7());
|
|
235
235
|
}
|
|
236
|
-
function ingestSuccess$
|
|
236
|
+
function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
|
|
237
237
|
const { body } = response;
|
|
238
|
-
const key = keyBuilder$
|
|
239
|
-
luvio.storeIngest(key, ingest$
|
|
238
|
+
const key = keyBuilder$7();
|
|
239
|
+
luvio.storeIngest(key, ingest$4, body);
|
|
240
240
|
const snapshot = luvio.storeLookup({
|
|
241
241
|
recordId: key,
|
|
242
|
-
node: select$
|
|
242
|
+
node: select$c(),
|
|
243
243
|
variables: {},
|
|
244
244
|
}, snapshotRefresh);
|
|
245
245
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -250,19 +250,19 @@ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
250
250
|
deepFreeze(snapshot.data);
|
|
251
251
|
return snapshot;
|
|
252
252
|
}
|
|
253
|
-
function ingestError$
|
|
254
|
-
const key = keyBuilder$
|
|
253
|
+
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
254
|
+
const key = keyBuilder$7();
|
|
255
255
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
256
256
|
const storeMetadataParams = {
|
|
257
|
-
ttl: TTL$
|
|
257
|
+
ttl: TTL$4,
|
|
258
258
|
namespace: keyPrefix,
|
|
259
|
-
version: VERSION$
|
|
260
|
-
representationName: RepresentationType$
|
|
259
|
+
version: VERSION$9,
|
|
260
|
+
representationName: RepresentationType$4
|
|
261
261
|
};
|
|
262
262
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
263
263
|
return errorSnapshot;
|
|
264
264
|
}
|
|
265
|
-
function createResourceRequest$
|
|
265
|
+
function createResourceRequest$3(config) {
|
|
266
266
|
const headers = {};
|
|
267
267
|
return {
|
|
268
268
|
baseUri: '/services/data/v61.0',
|
|
@@ -276,91 +276,91 @@ function createResourceRequest$2(config) {
|
|
|
276
276
|
};
|
|
277
277
|
}
|
|
278
278
|
|
|
279
|
-
const adapterName$
|
|
279
|
+
const adapterName$3 = 'getBotId';
|
|
280
280
|
const getBotId_ConfigPropertyMetadata = [];
|
|
281
|
-
const getBotId_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
282
|
-
const createResourceParams$
|
|
283
|
-
function keyBuilder$
|
|
284
|
-
createResourceParams$
|
|
285
|
-
return keyBuilder$
|
|
281
|
+
const getBotId_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getBotId_ConfigPropertyMetadata);
|
|
282
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$4(getBotId_ConfigPropertyMetadata);
|
|
283
|
+
function keyBuilder$6(luvio, config) {
|
|
284
|
+
createResourceParams$3(config);
|
|
285
|
+
return keyBuilder$7();
|
|
286
286
|
}
|
|
287
|
-
function typeCheckConfig$
|
|
287
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
288
288
|
const config = {};
|
|
289
289
|
return config;
|
|
290
290
|
}
|
|
291
|
-
function validateAdapterConfig$
|
|
291
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
292
292
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
293
293
|
return null;
|
|
294
294
|
}
|
|
295
295
|
if (process.env.NODE_ENV !== 'production') {
|
|
296
296
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
297
297
|
}
|
|
298
|
-
const config = typeCheckConfig$
|
|
298
|
+
const config = typeCheckConfig$3();
|
|
299
299
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
300
300
|
return null;
|
|
301
301
|
}
|
|
302
302
|
return config;
|
|
303
303
|
}
|
|
304
|
-
function adapterFragment$
|
|
305
|
-
createResourceParams$
|
|
306
|
-
return select$
|
|
304
|
+
function adapterFragment$2(luvio, config) {
|
|
305
|
+
createResourceParams$3(config);
|
|
306
|
+
return select$c();
|
|
307
307
|
}
|
|
308
|
-
function onFetchResponseSuccess$
|
|
309
|
-
const snapshot = ingestSuccess$
|
|
308
|
+
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
309
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
|
|
310
310
|
config,
|
|
311
|
-
resolve: () => buildNetworkSnapshot$
|
|
311
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
312
312
|
});
|
|
313
313
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
314
314
|
}
|
|
315
|
-
function onFetchResponseError$
|
|
316
|
-
const snapshot = ingestError$
|
|
315
|
+
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
316
|
+
const snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
317
317
|
config,
|
|
318
|
-
resolve: () => buildNetworkSnapshot$
|
|
318
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
319
319
|
});
|
|
320
320
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
321
321
|
}
|
|
322
|
-
function buildNetworkSnapshot$
|
|
323
|
-
const resourceParams = createResourceParams$
|
|
324
|
-
const request = createResourceRequest$
|
|
322
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
323
|
+
const resourceParams = createResourceParams$3(config);
|
|
324
|
+
const request = createResourceRequest$3();
|
|
325
325
|
return luvio.dispatchResourceRequest(request, options)
|
|
326
326
|
.then((response) => {
|
|
327
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$
|
|
327
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
|
|
328
328
|
const cache = new StoreKeyMap();
|
|
329
|
-
getResponseCacheKeys$
|
|
329
|
+
getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
|
|
330
330
|
return cache;
|
|
331
331
|
});
|
|
332
332
|
}, (response) => {
|
|
333
|
-
return luvio.handleErrorResponse(() => onFetchResponseError$
|
|
333
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
|
|
334
334
|
});
|
|
335
335
|
}
|
|
336
|
-
function buildNetworkSnapshotCachePolicy$
|
|
337
|
-
return buildNetworkSnapshotCachePolicy$
|
|
336
|
+
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
337
|
+
return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$3, undefined, false);
|
|
338
338
|
}
|
|
339
|
-
function buildCachedSnapshotCachePolicy$
|
|
339
|
+
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
340
340
|
const { luvio, config } = context;
|
|
341
341
|
const selector = {
|
|
342
|
-
recordId: keyBuilder$
|
|
343
|
-
node: adapterFragment$
|
|
342
|
+
recordId: keyBuilder$6(luvio, config),
|
|
343
|
+
node: adapterFragment$2(luvio, config),
|
|
344
344
|
variables: {},
|
|
345
345
|
};
|
|
346
346
|
const cacheSnapshot = storeLookup(selector, {
|
|
347
347
|
config,
|
|
348
|
-
resolve: () => buildNetworkSnapshot$
|
|
348
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
349
349
|
});
|
|
350
350
|
return cacheSnapshot;
|
|
351
351
|
}
|
|
352
352
|
const getBotIdAdapterFactory = (luvio) => function einsteinCopilotBot__getBotId(untrustedConfig, requestContext) {
|
|
353
|
-
const config = validateAdapterConfig$
|
|
353
|
+
const config = validateAdapterConfig$3(untrustedConfig, getBotId_ConfigPropertyNames);
|
|
354
354
|
// Invalid or incomplete config
|
|
355
355
|
if (config === null) {
|
|
356
356
|
return null;
|
|
357
357
|
}
|
|
358
358
|
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
359
|
-
buildCachedSnapshotCachePolicy$
|
|
359
|
+
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
360
360
|
};
|
|
361
361
|
|
|
362
|
-
const VERSION$
|
|
363
|
-
function validate$
|
|
362
|
+
const VERSION$8 = "e8cb7e20392935088ea2f98edb927e8a";
|
|
363
|
+
function validate$9(obj, path = 'EsTypeMessageRepresentation') {
|
|
364
364
|
const v_error = (() => {
|
|
365
365
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
366
366
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -406,10 +406,10 @@ function validate$7(obj, path = 'EsTypeMessageRepresentation') {
|
|
|
406
406
|
})();
|
|
407
407
|
return v_error === undefined ? null : v_error;
|
|
408
408
|
}
|
|
409
|
-
const select$
|
|
409
|
+
const select$b = function EsTypeMessageRepresentationSelect() {
|
|
410
410
|
return {
|
|
411
411
|
kind: 'Fragment',
|
|
412
|
-
version: VERSION$
|
|
412
|
+
version: VERSION$8,
|
|
413
413
|
private: [],
|
|
414
414
|
selections: [
|
|
415
415
|
{
|
|
@@ -429,7 +429,7 @@ const select$8 = function EsTypeMessageRepresentationSelect() {
|
|
|
429
429
|
]
|
|
430
430
|
};
|
|
431
431
|
};
|
|
432
|
-
function equals$
|
|
432
|
+
function equals$8(existing, incoming) {
|
|
433
433
|
const existing_type = existing.type;
|
|
434
434
|
const incoming_type = incoming.type;
|
|
435
435
|
if (!(existing_type === incoming_type)) {
|
|
@@ -456,7 +456,7 @@ function equals$6(existing, incoming) {
|
|
|
456
456
|
return true;
|
|
457
457
|
}
|
|
458
458
|
|
|
459
|
-
function validate$
|
|
459
|
+
function validate$8(obj, path = 'VariableRepresentation') {
|
|
460
460
|
const v_error = (() => {
|
|
461
461
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
462
462
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -477,8 +477,8 @@ function validate$6(obj, path = 'VariableRepresentation') {
|
|
|
477
477
|
return v_error === undefined ? null : v_error;
|
|
478
478
|
}
|
|
479
479
|
|
|
480
|
-
const VERSION$
|
|
481
|
-
function validate$
|
|
480
|
+
const VERSION$7 = "4e28b61c3ea362f1c68b28897784111e";
|
|
481
|
+
function validate$7(obj, path = 'ConversationRuntimeProxyChoiceRepresentation') {
|
|
482
482
|
const v_error = (() => {
|
|
483
483
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
484
484
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -496,10 +496,10 @@ function validate$5(obj, path = 'ConversationRuntimeProxyChoiceRepresentation')
|
|
|
496
496
|
})();
|
|
497
497
|
return v_error === undefined ? null : v_error;
|
|
498
498
|
}
|
|
499
|
-
const select$
|
|
499
|
+
const select$a = function ConversationRuntimeProxyChoiceRepresentationSelect() {
|
|
500
500
|
return {
|
|
501
501
|
kind: 'Fragment',
|
|
502
|
-
version: VERSION$
|
|
502
|
+
version: VERSION$7,
|
|
503
503
|
private: [],
|
|
504
504
|
selections: [
|
|
505
505
|
{
|
|
@@ -513,7 +513,7 @@ const select$7 = function ConversationRuntimeProxyChoiceRepresentationSelect() {
|
|
|
513
513
|
]
|
|
514
514
|
};
|
|
515
515
|
};
|
|
516
|
-
function equals$
|
|
516
|
+
function equals$7(existing, incoming) {
|
|
517
517
|
const existing_alias = existing.alias;
|
|
518
518
|
const incoming_alias = incoming.alias;
|
|
519
519
|
if (!(existing_alias === incoming_alias)) {
|
|
@@ -527,8 +527,8 @@ function equals$5(existing, incoming) {
|
|
|
527
527
|
return true;
|
|
528
528
|
}
|
|
529
529
|
|
|
530
|
-
const VERSION$
|
|
531
|
-
function validate$
|
|
530
|
+
const VERSION$6 = "477724425d0742c030025796c88ebf5d";
|
|
531
|
+
function validate$6(obj, path = 'CollectMessageRepresentation') {
|
|
532
532
|
const v_error = (() => {
|
|
533
533
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
534
534
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -536,7 +536,7 @@ function validate$4(obj, path = 'CollectMessageRepresentation') {
|
|
|
536
536
|
if (obj.data !== undefined) {
|
|
537
537
|
const obj_data = obj.data;
|
|
538
538
|
const path_data = path + '.data';
|
|
539
|
-
const referencepath_dataValidationError = validate$
|
|
539
|
+
const referencepath_dataValidationError = validate$9(obj_data, path_data);
|
|
540
540
|
if (referencepath_dataValidationError !== null) {
|
|
541
541
|
let message = 'Object doesn\'t match EsTypeMessageRepresentation (at "' + path_data + '")\n';
|
|
542
542
|
message += referencepath_dataValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -579,11 +579,11 @@ function validate$4(obj, path = 'CollectMessageRepresentation') {
|
|
|
579
579
|
})();
|
|
580
580
|
return v_error === undefined ? null : v_error;
|
|
581
581
|
}
|
|
582
|
-
const select$
|
|
583
|
-
const { selections: EsTypeMessageRepresentation__selections, opaque: EsTypeMessageRepresentation__opaque, } = select$
|
|
582
|
+
const select$9 = function CollectMessageRepresentationSelect() {
|
|
583
|
+
const { selections: EsTypeMessageRepresentation__selections, opaque: EsTypeMessageRepresentation__opaque, } = select$b();
|
|
584
584
|
return {
|
|
585
585
|
kind: 'Fragment',
|
|
586
|
-
version: VERSION$
|
|
586
|
+
version: VERSION$6,
|
|
587
587
|
private: [],
|
|
588
588
|
selections: [
|
|
589
589
|
{
|
|
@@ -604,7 +604,7 @@ const select$6 = function CollectMessageRepresentationSelect() {
|
|
|
604
604
|
]
|
|
605
605
|
};
|
|
606
606
|
};
|
|
607
|
-
function equals$
|
|
607
|
+
function equals$6(existing, incoming) {
|
|
608
608
|
const existing_targetType = existing.targetType;
|
|
609
609
|
const incoming_targetType = incoming.targetType;
|
|
610
610
|
if (!(existing_targetType === incoming_targetType)) {
|
|
@@ -619,7 +619,7 @@ function equals$4(existing, incoming) {
|
|
|
619
619
|
if (existing_data === undefined || incoming_data === undefined) {
|
|
620
620
|
return false;
|
|
621
621
|
}
|
|
622
|
-
if (!(equals$
|
|
622
|
+
if (!(equals$8(existing_data, incoming_data))) {
|
|
623
623
|
return false;
|
|
624
624
|
}
|
|
625
625
|
}
|
|
@@ -639,9 +639,9 @@ function equals$4(existing, incoming) {
|
|
|
639
639
|
return true;
|
|
640
640
|
}
|
|
641
641
|
|
|
642
|
-
const TTL$
|
|
643
|
-
const VERSION$
|
|
644
|
-
function validate$
|
|
642
|
+
const TTL$3 = 30000;
|
|
643
|
+
const VERSION$5 = "55ac02bd055f57a2a12aa0fa4844d1a2";
|
|
644
|
+
function validate$5(obj, path = 'ConversationRuntimeProxyMessageRepresentation') {
|
|
645
645
|
const v_error = (() => {
|
|
646
646
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
647
647
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -655,7 +655,7 @@ function validate$3(obj, path = 'ConversationRuntimeProxyMessageRepresentation')
|
|
|
655
655
|
for (let i = 0; i < obj_choices.length; i++) {
|
|
656
656
|
const obj_choices_item = obj_choices[i];
|
|
657
657
|
const path_choices_item = path_choices + '[' + i + ']';
|
|
658
|
-
const referencepath_choices_itemValidationError = validate$
|
|
658
|
+
const referencepath_choices_itemValidationError = validate$7(obj_choices_item, path_choices_item);
|
|
659
659
|
if (referencepath_choices_itemValidationError !== null) {
|
|
660
660
|
let message = 'Object doesn\'t match ConversationRuntimeProxyChoiceRepresentation (at "' + path_choices_item + '")\n';
|
|
661
661
|
message += referencepath_choices_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -672,7 +672,7 @@ function validate$3(obj, path = 'ConversationRuntimeProxyMessageRepresentation')
|
|
|
672
672
|
for (let i = 0; i < obj_collect.length; i++) {
|
|
673
673
|
const obj_collect_item = obj_collect[i];
|
|
674
674
|
const path_collect_item = path_collect + '[' + i + ']';
|
|
675
|
-
const referencepath_collect_itemValidationError = validate$
|
|
675
|
+
const referencepath_collect_itemValidationError = validate$6(obj_collect_item, path_collect_item);
|
|
676
676
|
if (referencepath_collect_itemValidationError !== null) {
|
|
677
677
|
let message = 'Object doesn\'t match CollectMessageRepresentation (at "' + path_collect_item + '")\n';
|
|
678
678
|
message += referencepath_collect_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -689,7 +689,7 @@ function validate$3(obj, path = 'ConversationRuntimeProxyMessageRepresentation')
|
|
|
689
689
|
for (let i = 0; i < obj_confirm.length; i++) {
|
|
690
690
|
const obj_confirm_item = obj_confirm[i];
|
|
691
691
|
const path_confirm_item = path_confirm + '[' + i + ']';
|
|
692
|
-
const referencepath_confirm_itemValidationError = validate$
|
|
692
|
+
const referencepath_confirm_itemValidationError = validate$9(obj_confirm_item, path_confirm_item);
|
|
693
693
|
if (referencepath_confirm_itemValidationError !== null) {
|
|
694
694
|
let message = 'Object doesn\'t match EsTypeMessageRepresentation (at "' + path_confirm_item + '")\n';
|
|
695
695
|
message += referencepath_confirm_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -865,7 +865,7 @@ function validate$3(obj, path = 'ConversationRuntimeProxyMessageRepresentation')
|
|
|
865
865
|
for (let i = 0; i < obj_result.length; i++) {
|
|
866
866
|
const obj_result_item = obj_result[i];
|
|
867
867
|
const path_result_item = path_result + '[' + i + ']';
|
|
868
|
-
const referencepath_result_itemValidationError = validate$
|
|
868
|
+
const referencepath_result_itemValidationError = validate$9(obj_result_item, path_result_item);
|
|
869
869
|
if (referencepath_result_itemValidationError !== null) {
|
|
870
870
|
let message = 'Object doesn\'t match EsTypeMessageRepresentation (at "' + path_result_item + '")\n';
|
|
871
871
|
message += referencepath_result_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -939,26 +939,26 @@ function validate$3(obj, path = 'ConversationRuntimeProxyMessageRepresentation')
|
|
|
939
939
|
})();
|
|
940
940
|
return v_error === undefined ? null : v_error;
|
|
941
941
|
}
|
|
942
|
-
const RepresentationType$
|
|
943
|
-
function keyBuilder$
|
|
944
|
-
return keyPrefix + '::' + RepresentationType$
|
|
942
|
+
const RepresentationType$3 = 'ConversationRuntimeProxyMessageRepresentation';
|
|
943
|
+
function keyBuilder$5(luvio, config) {
|
|
944
|
+
return keyPrefix + '::' + RepresentationType$3 + ':' + config.id;
|
|
945
945
|
}
|
|
946
946
|
function keyBuilderFromType$1(luvio, object) {
|
|
947
947
|
const keyParams = {
|
|
948
948
|
id: object.id
|
|
949
949
|
};
|
|
950
|
-
return keyBuilder$
|
|
950
|
+
return keyBuilder$5(luvio, keyParams);
|
|
951
951
|
}
|
|
952
|
-
function normalize$
|
|
952
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
953
953
|
return input;
|
|
954
954
|
}
|
|
955
|
-
const select$
|
|
956
|
-
const { selections: ConversationRuntimeProxyChoiceRepresentation__selections, opaque: ConversationRuntimeProxyChoiceRepresentation__opaque, } = select$
|
|
957
|
-
const { selections: CollectMessageRepresentation__selections, opaque: CollectMessageRepresentation__opaque, } = select$
|
|
958
|
-
const { selections: EsTypeMessageRepresentation__selections, opaque: EsTypeMessageRepresentation__opaque, } = select$
|
|
955
|
+
const select$8 = function ConversationRuntimeProxyMessageRepresentationSelect() {
|
|
956
|
+
const { selections: ConversationRuntimeProxyChoiceRepresentation__selections, opaque: ConversationRuntimeProxyChoiceRepresentation__opaque, } = select$a();
|
|
957
|
+
const { selections: CollectMessageRepresentation__selections, opaque: CollectMessageRepresentation__opaque, } = select$9();
|
|
958
|
+
const { selections: EsTypeMessageRepresentation__selections, opaque: EsTypeMessageRepresentation__opaque, } = select$b();
|
|
959
959
|
return {
|
|
960
960
|
kind: 'Fragment',
|
|
961
|
-
version: VERSION$
|
|
961
|
+
version: VERSION$5,
|
|
962
962
|
private: [],
|
|
963
963
|
selections: [
|
|
964
964
|
{
|
|
@@ -1042,7 +1042,7 @@ const select$5 = function ConversationRuntimeProxyMessageRepresentationSelect()
|
|
|
1042
1042
|
]
|
|
1043
1043
|
};
|
|
1044
1044
|
};
|
|
1045
|
-
function equals$
|
|
1045
|
+
function equals$5(existing, incoming) {
|
|
1046
1046
|
const existing_id = existing.id;
|
|
1047
1047
|
const incoming_id = incoming.id;
|
|
1048
1048
|
if (!(existing_id === incoming_id)) {
|
|
@@ -1071,7 +1071,7 @@ function equals$3(existing, incoming) {
|
|
|
1071
1071
|
return false;
|
|
1072
1072
|
}
|
|
1073
1073
|
const equals_choices_items = equalsArray(existing_choices, incoming_choices, (existing_choices_item, incoming_choices_item) => {
|
|
1074
|
-
if (!(equals$
|
|
1074
|
+
if (!(equals$7(existing_choices_item, incoming_choices_item))) {
|
|
1075
1075
|
return false;
|
|
1076
1076
|
}
|
|
1077
1077
|
});
|
|
@@ -1089,7 +1089,7 @@ function equals$3(existing, incoming) {
|
|
|
1089
1089
|
return false;
|
|
1090
1090
|
}
|
|
1091
1091
|
const equals_collect_items = equalsArray(existing_collect, incoming_collect, (existing_collect_item, incoming_collect_item) => {
|
|
1092
|
-
if (!(equals$
|
|
1092
|
+
if (!(equals$6(existing_collect_item, incoming_collect_item))) {
|
|
1093
1093
|
return false;
|
|
1094
1094
|
}
|
|
1095
1095
|
});
|
|
@@ -1107,7 +1107,7 @@ function equals$3(existing, incoming) {
|
|
|
1107
1107
|
return false;
|
|
1108
1108
|
}
|
|
1109
1109
|
const equals_confirm_items = equalsArray(existing_confirm, incoming_confirm, (existing_confirm_item, incoming_confirm_item) => {
|
|
1110
|
-
if (!(equals$
|
|
1110
|
+
if (!(equals$8(existing_confirm_item, incoming_confirm_item))) {
|
|
1111
1111
|
return false;
|
|
1112
1112
|
}
|
|
1113
1113
|
});
|
|
@@ -1208,7 +1208,7 @@ function equals$3(existing, incoming) {
|
|
|
1208
1208
|
return false;
|
|
1209
1209
|
}
|
|
1210
1210
|
const equals_result_items = equalsArray(existing_result, incoming_result, (existing_result_item, incoming_result_item) => {
|
|
1211
|
-
if (!(equals$
|
|
1211
|
+
if (!(equals$8(existing_result_item, incoming_result_item))) {
|
|
1212
1212
|
return false;
|
|
1213
1213
|
}
|
|
1214
1214
|
});
|
|
@@ -1244,31 +1244,31 @@ function equals$3(existing, incoming) {
|
|
|
1244
1244
|
}
|
|
1245
1245
|
return true;
|
|
1246
1246
|
}
|
|
1247
|
-
const ingest$
|
|
1247
|
+
const ingest$3 = function ConversationRuntimeProxyMessageRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1248
1248
|
if (process.env.NODE_ENV !== 'production') {
|
|
1249
|
-
const validateError = validate$
|
|
1249
|
+
const validateError = validate$5(input);
|
|
1250
1250
|
if (validateError !== null) {
|
|
1251
1251
|
throw validateError;
|
|
1252
1252
|
}
|
|
1253
1253
|
}
|
|
1254
1254
|
const key = keyBuilderFromType$1(luvio, input);
|
|
1255
|
-
const ttlToUse = TTL$
|
|
1256
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
1255
|
+
const ttlToUse = TTL$3;
|
|
1256
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "einstein-copilot-bot", VERSION$5, RepresentationType$3, equals$5);
|
|
1257
1257
|
return createLink(key);
|
|
1258
1258
|
};
|
|
1259
|
-
function getTypeCacheKeys$
|
|
1259
|
+
function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
|
|
1260
1260
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1261
1261
|
const rootKey = keyBuilderFromType$1(luvio, input);
|
|
1262
1262
|
rootKeySet.set(rootKey, {
|
|
1263
1263
|
namespace: keyPrefix,
|
|
1264
|
-
representationName: RepresentationType$
|
|
1264
|
+
representationName: RepresentationType$3,
|
|
1265
1265
|
mergeable: false
|
|
1266
1266
|
});
|
|
1267
1267
|
}
|
|
1268
1268
|
|
|
1269
|
-
const TTL$
|
|
1270
|
-
const VERSION$
|
|
1271
|
-
function validate$
|
|
1269
|
+
const TTL$2 = 30000;
|
|
1270
|
+
const VERSION$4 = "fe7024fb1132250f97d9616482f09f99";
|
|
1271
|
+
function validate$4(obj, path = 'ConversationRuntimeProxyRepresentation') {
|
|
1272
1272
|
const v_error = (() => {
|
|
1273
1273
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1274
1274
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1320,23 +1320,23 @@ function validate$2(obj, path = 'ConversationRuntimeProxyRepresentation') {
|
|
|
1320
1320
|
})();
|
|
1321
1321
|
return v_error === undefined ? null : v_error;
|
|
1322
1322
|
}
|
|
1323
|
-
const RepresentationType$
|
|
1324
|
-
function keyBuilder$
|
|
1325
|
-
return keyPrefix + '::' + RepresentationType$
|
|
1323
|
+
const RepresentationType$2 = 'ConversationRuntimeProxyRepresentation';
|
|
1324
|
+
function keyBuilder$4(luvio, config) {
|
|
1325
|
+
return keyPrefix + '::' + RepresentationType$2 + ':' + config.id;
|
|
1326
1326
|
}
|
|
1327
1327
|
function keyBuilderFromType(luvio, object) {
|
|
1328
1328
|
const keyParams = {
|
|
1329
1329
|
id: object.requestId
|
|
1330
1330
|
};
|
|
1331
|
-
return keyBuilder$
|
|
1331
|
+
return keyBuilder$4(luvio, keyParams);
|
|
1332
1332
|
}
|
|
1333
|
-
function normalize$
|
|
1333
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
1334
1334
|
const input_messages = input.messages;
|
|
1335
1335
|
const input_messages_id = path.fullPath + '__messages';
|
|
1336
1336
|
for (let i = 0; i < input_messages.length; i++) {
|
|
1337
1337
|
const input_messages_item = input_messages[i];
|
|
1338
1338
|
let input_messages_item_id = input_messages_id + '__' + i;
|
|
1339
|
-
input_messages[i] = ingest$
|
|
1339
|
+
input_messages[i] = ingest$3(input_messages_item, {
|
|
1340
1340
|
fullPath: input_messages_item_id,
|
|
1341
1341
|
propertyName: i,
|
|
1342
1342
|
parent: {
|
|
@@ -1349,10 +1349,10 @@ function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
|
1349
1349
|
}
|
|
1350
1350
|
return input;
|
|
1351
1351
|
}
|
|
1352
|
-
const select$
|
|
1352
|
+
const select$7 = function ConversationRuntimeProxyRepresentationSelect() {
|
|
1353
1353
|
return {
|
|
1354
1354
|
kind: 'Fragment',
|
|
1355
|
-
version: VERSION$
|
|
1355
|
+
version: VERSION$4,
|
|
1356
1356
|
private: [],
|
|
1357
1357
|
selections: [
|
|
1358
1358
|
{
|
|
@@ -1367,7 +1367,7 @@ const select$4 = function ConversationRuntimeProxyRepresentationSelect() {
|
|
|
1367
1367
|
name: 'messages',
|
|
1368
1368
|
kind: 'Link',
|
|
1369
1369
|
plural: true,
|
|
1370
|
-
fragment: select$
|
|
1370
|
+
fragment: select$8()
|
|
1371
1371
|
},
|
|
1372
1372
|
{
|
|
1373
1373
|
name: 'processedSequenceIds',
|
|
@@ -1385,7 +1385,7 @@ const select$4 = function ConversationRuntimeProxyRepresentationSelect() {
|
|
|
1385
1385
|
]
|
|
1386
1386
|
};
|
|
1387
1387
|
};
|
|
1388
|
-
function equals$
|
|
1388
|
+
function equals$4(existing, incoming) {
|
|
1389
1389
|
const existing_botId = existing.botId;
|
|
1390
1390
|
const incoming_botId = incoming.botId;
|
|
1391
1391
|
if (!(existing_botId === incoming_botId)) {
|
|
@@ -1428,45 +1428,45 @@ function equals$2(existing, incoming) {
|
|
|
1428
1428
|
}
|
|
1429
1429
|
return true;
|
|
1430
1430
|
}
|
|
1431
|
-
const ingest$
|
|
1431
|
+
const ingest$2 = function ConversationRuntimeProxyRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1432
1432
|
if (process.env.NODE_ENV !== 'production') {
|
|
1433
|
-
const validateError = validate$
|
|
1433
|
+
const validateError = validate$4(input);
|
|
1434
1434
|
if (validateError !== null) {
|
|
1435
1435
|
throw validateError;
|
|
1436
1436
|
}
|
|
1437
1437
|
}
|
|
1438
1438
|
const key = keyBuilderFromType(luvio, input);
|
|
1439
|
-
const ttlToUse = TTL$
|
|
1440
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
1439
|
+
const ttlToUse = TTL$2;
|
|
1440
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "einstein-copilot-bot", VERSION$4, RepresentationType$2, equals$4);
|
|
1441
1441
|
return createLink(key);
|
|
1442
1442
|
};
|
|
1443
|
-
function getTypeCacheKeys$
|
|
1443
|
+
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
1444
1444
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1445
1445
|
const rootKey = keyBuilderFromType(luvio, input);
|
|
1446
1446
|
rootKeySet.set(rootKey, {
|
|
1447
1447
|
namespace: keyPrefix,
|
|
1448
|
-
representationName: RepresentationType$
|
|
1448
|
+
representationName: RepresentationType$2,
|
|
1449
1449
|
mergeable: false
|
|
1450
1450
|
});
|
|
1451
1451
|
const input_messages_length = input.messages.length;
|
|
1452
1452
|
for (let i = 0; i < input_messages_length; i++) {
|
|
1453
|
-
getTypeCacheKeys$
|
|
1453
|
+
getTypeCacheKeys$3(rootKeySet, luvio, input.messages[i]);
|
|
1454
1454
|
}
|
|
1455
1455
|
}
|
|
1456
1456
|
|
|
1457
|
-
function select$
|
|
1458
|
-
return select$
|
|
1457
|
+
function select$6(luvio, params) {
|
|
1458
|
+
return select$7();
|
|
1459
1459
|
}
|
|
1460
|
-
function getResponseCacheKeys$
|
|
1461
|
-
getTypeCacheKeys$
|
|
1460
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
1461
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response);
|
|
1462
1462
|
}
|
|
1463
|
-
function ingestSuccess$
|
|
1463
|
+
function ingestSuccess$2(luvio, resourceParams, response) {
|
|
1464
1464
|
const { body } = response;
|
|
1465
1465
|
const key = keyBuilderFromType(luvio, body);
|
|
1466
|
-
luvio.storeIngest(key, ingest$
|
|
1466
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
1467
1467
|
const snapshot = luvio.storeLookup({
|
|
1468
1468
|
recordId: key,
|
|
1469
|
-
node: select$
|
|
1469
|
+
node: select$6(),
|
|
1470
1470
|
variables: {},
|
|
1471
1471
|
});
|
|
1472
1472
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -1477,7 +1477,7 @@ function ingestSuccess$1(luvio, resourceParams, response) {
|
|
|
1477
1477
|
deepFreeze(snapshot.data);
|
|
1478
1478
|
return snapshot;
|
|
1479
1479
|
}
|
|
1480
|
-
function createResourceRequest$
|
|
1480
|
+
function createResourceRequest$2(config) {
|
|
1481
1481
|
const headers = {};
|
|
1482
1482
|
return {
|
|
1483
1483
|
baseUri: '/services/data/v61.0',
|
|
@@ -1491,7 +1491,7 @@ function createResourceRequest$1(config) {
|
|
|
1491
1491
|
};
|
|
1492
1492
|
}
|
|
1493
1493
|
|
|
1494
|
-
const adapterName$
|
|
1494
|
+
const adapterName$2 = 'sendMessage';
|
|
1495
1495
|
const sendMessage_ConfigPropertyMetadata = [
|
|
1496
1496
|
generateParamConfigMetadata('botId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1497
1497
|
generateParamConfigMetadata('botVersionId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
@@ -1508,11 +1508,11 @@ const sendMessage_ConfigPropertyMetadata = [
|
|
|
1508
1508
|
generateParamConfigMetadata('variables', false, 2 /* Body */, 4 /* Unsupported */, true),
|
|
1509
1509
|
generateParamConfigMetadata('userUtterance', false, 2 /* Body */, 0 /* String */),
|
|
1510
1510
|
];
|
|
1511
|
-
const sendMessage_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
1512
|
-
const createResourceParams$
|
|
1513
|
-
function typeCheckConfig$
|
|
1511
|
+
const sendMessage_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, sendMessage_ConfigPropertyMetadata);
|
|
1512
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$4(sendMessage_ConfigPropertyMetadata);
|
|
1513
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
1514
1514
|
const config = {};
|
|
1515
|
-
typeCheckConfig$
|
|
1515
|
+
typeCheckConfig$4(untrustedConfig, config, sendMessage_ConfigPropertyMetadata);
|
|
1516
1516
|
const untrustedConfig_planTemplateVariables = untrustedConfig.planTemplateVariables;
|
|
1517
1517
|
config.planTemplateVariables = untrustedConfig_planTemplateVariables;
|
|
1518
1518
|
const untrustedConfig_reply = untrustedConfig.reply;
|
|
@@ -1520,7 +1520,7 @@ function typeCheckConfig$1(untrustedConfig) {
|
|
|
1520
1520
|
const untrustedConfig_reply_array = [];
|
|
1521
1521
|
for (let i = 0, arrayLength = untrustedConfig_reply.length; i < arrayLength; i++) {
|
|
1522
1522
|
const untrustedConfig_reply_item = untrustedConfig_reply[i];
|
|
1523
|
-
const referenceEsTypeMessageRepresentationValidationError = validate$
|
|
1523
|
+
const referenceEsTypeMessageRepresentationValidationError = validate$9(untrustedConfig_reply_item);
|
|
1524
1524
|
if (referenceEsTypeMessageRepresentationValidationError === null) {
|
|
1525
1525
|
untrustedConfig_reply_array.push(untrustedConfig_reply_item);
|
|
1526
1526
|
}
|
|
@@ -1532,7 +1532,7 @@ function typeCheckConfig$1(untrustedConfig) {
|
|
|
1532
1532
|
const untrustedConfig_variables_array = [];
|
|
1533
1533
|
for (let i = 0, arrayLength = untrustedConfig_variables.length; i < arrayLength; i++) {
|
|
1534
1534
|
const untrustedConfig_variables_item = untrustedConfig_variables[i];
|
|
1535
|
-
const referenceVariableRepresentationValidationError = validate$
|
|
1535
|
+
const referenceVariableRepresentationValidationError = validate$8(untrustedConfig_variables_item);
|
|
1536
1536
|
if (referenceVariableRepresentationValidationError === null) {
|
|
1537
1537
|
untrustedConfig_variables_array.push(untrustedConfig_variables_item);
|
|
1538
1538
|
}
|
|
@@ -1541,30 +1541,30 @@ function typeCheckConfig$1(untrustedConfig) {
|
|
|
1541
1541
|
}
|
|
1542
1542
|
return config;
|
|
1543
1543
|
}
|
|
1544
|
-
function validateAdapterConfig$
|
|
1544
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
1545
1545
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
1546
1546
|
return null;
|
|
1547
1547
|
}
|
|
1548
1548
|
if (process.env.NODE_ENV !== 'production') {
|
|
1549
1549
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
1550
1550
|
}
|
|
1551
|
-
const config = typeCheckConfig$
|
|
1551
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
1552
1552
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1553
1553
|
return null;
|
|
1554
1554
|
}
|
|
1555
1555
|
return config;
|
|
1556
1556
|
}
|
|
1557
|
-
function buildNetworkSnapshot$
|
|
1558
|
-
const resourceParams = createResourceParams$
|
|
1559
|
-
const request = createResourceRequest$
|
|
1557
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
1558
|
+
const resourceParams = createResourceParams$2(config);
|
|
1559
|
+
const request = createResourceRequest$2(resourceParams);
|
|
1560
1560
|
return luvio.dispatchResourceRequest(request, options)
|
|
1561
1561
|
.then((response) => {
|
|
1562
1562
|
return luvio.handleSuccessResponse(() => {
|
|
1563
|
-
const snapshot = ingestSuccess$
|
|
1563
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response);
|
|
1564
1564
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1565
1565
|
}, () => {
|
|
1566
1566
|
const cache = new StoreKeyMap();
|
|
1567
|
-
getResponseCacheKeys$
|
|
1567
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
1568
1568
|
return cache;
|
|
1569
1569
|
});
|
|
1570
1570
|
}, (response) => {
|
|
@@ -1574,17 +1574,17 @@ function buildNetworkSnapshot$1(luvio, config, options) {
|
|
|
1574
1574
|
}
|
|
1575
1575
|
const sendMessageAdapterFactory = (luvio) => {
|
|
1576
1576
|
return function sendMessage(untrustedConfig) {
|
|
1577
|
-
const config = validateAdapterConfig$
|
|
1577
|
+
const config = validateAdapterConfig$2(untrustedConfig, sendMessage_ConfigPropertyNames);
|
|
1578
1578
|
// Invalid or incomplete config
|
|
1579
1579
|
if (config === null) {
|
|
1580
1580
|
throw new Error('Invalid config for "sendMessage"');
|
|
1581
1581
|
}
|
|
1582
|
-
return buildNetworkSnapshot$
|
|
1582
|
+
return buildNetworkSnapshot$2(luvio, config);
|
|
1583
1583
|
};
|
|
1584
1584
|
};
|
|
1585
1585
|
|
|
1586
|
-
const VERSION$
|
|
1587
|
-
function validate$
|
|
1586
|
+
const VERSION$3 = "504437088c2317480c651ac05a7565b5";
|
|
1587
|
+
function validate$3(obj, path = 'PlanTemplateRepresentation') {
|
|
1588
1588
|
const v_error = (() => {
|
|
1589
1589
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1590
1590
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1626,10 +1626,10 @@ function validate$1(obj, path = 'PlanTemplateRepresentation') {
|
|
|
1626
1626
|
})();
|
|
1627
1627
|
return v_error === undefined ? null : v_error;
|
|
1628
1628
|
}
|
|
1629
|
-
const select$
|
|
1629
|
+
const select$5 = function PlanTemplateRepresentationSelect() {
|
|
1630
1630
|
return {
|
|
1631
1631
|
kind: 'Fragment',
|
|
1632
|
-
version: VERSION$
|
|
1632
|
+
version: VERSION$3,
|
|
1633
1633
|
private: [],
|
|
1634
1634
|
selections: [
|
|
1635
1635
|
{
|
|
@@ -1656,7 +1656,7 @@ const select$2 = function PlanTemplateRepresentationSelect() {
|
|
|
1656
1656
|
]
|
|
1657
1657
|
};
|
|
1658
1658
|
};
|
|
1659
|
-
function equals$
|
|
1659
|
+
function equals$3(existing, incoming) {
|
|
1660
1660
|
const existing_intent = existing.intent;
|
|
1661
1661
|
const incoming_intent = incoming.intent;
|
|
1662
1662
|
if (!(existing_intent === incoming_intent)) {
|
|
@@ -1690,9 +1690,9 @@ function equals$1(existing, incoming) {
|
|
|
1690
1690
|
return true;
|
|
1691
1691
|
}
|
|
1692
1692
|
|
|
1693
|
-
const TTL = 900000;
|
|
1694
|
-
const VERSION = "0503b0c5ce250e7f5fbf16f2d3f2fec4";
|
|
1695
|
-
function validate(obj, path = 'RecommendedPlanTemplatesRepresentation') {
|
|
1693
|
+
const TTL$1 = 900000;
|
|
1694
|
+
const VERSION$2 = "0503b0c5ce250e7f5fbf16f2d3f2fec4";
|
|
1695
|
+
function validate$2(obj, path = 'RecommendedPlanTemplatesRepresentation') {
|
|
1696
1696
|
const v_error = (() => {
|
|
1697
1697
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1698
1698
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1717,7 +1717,7 @@ function validate(obj, path = 'RecommendedPlanTemplatesRepresentation') {
|
|
|
1717
1717
|
for (let i = 0; i < obj_planTemplates.length; i++) {
|
|
1718
1718
|
const obj_planTemplates_item = obj_planTemplates[i];
|
|
1719
1719
|
const path_planTemplates_item = path_planTemplates + '[' + i + ']';
|
|
1720
|
-
const referencepath_planTemplates_itemValidationError = validate$
|
|
1720
|
+
const referencepath_planTemplates_itemValidationError = validate$3(obj_planTemplates_item, path_planTemplates_item);
|
|
1721
1721
|
if (referencepath_planTemplates_itemValidationError !== null) {
|
|
1722
1722
|
let message = 'Object doesn\'t match PlanTemplateRepresentation (at "' + path_planTemplates_item + '")\n';
|
|
1723
1723
|
message += referencepath_planTemplates_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1727,15 +1727,15 @@ function validate(obj, path = 'RecommendedPlanTemplatesRepresentation') {
|
|
|
1727
1727
|
})();
|
|
1728
1728
|
return v_error === undefined ? null : v_error;
|
|
1729
1729
|
}
|
|
1730
|
-
const RepresentationType = 'RecommendedPlanTemplatesRepresentation';
|
|
1731
|
-
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
1730
|
+
const RepresentationType$1 = 'RecommendedPlanTemplatesRepresentation';
|
|
1731
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
1732
1732
|
return input;
|
|
1733
1733
|
}
|
|
1734
|
-
const select$
|
|
1735
|
-
const { selections: PlanTemplateRepresentation__selections, opaque: PlanTemplateRepresentation__opaque, } = select$
|
|
1734
|
+
const select$4 = function RecommendedPlanTemplatesRepresentationSelect() {
|
|
1735
|
+
const { selections: PlanTemplateRepresentation__selections, opaque: PlanTemplateRepresentation__opaque, } = select$5();
|
|
1736
1736
|
return {
|
|
1737
1737
|
kind: 'Fragment',
|
|
1738
|
-
version: VERSION,
|
|
1738
|
+
version: VERSION$2,
|
|
1739
1739
|
private: [],
|
|
1740
1740
|
selections: [
|
|
1741
1741
|
{
|
|
@@ -1756,7 +1756,7 @@ const select$1 = function RecommendedPlanTemplatesRepresentationSelect() {
|
|
|
1756
1756
|
]
|
|
1757
1757
|
};
|
|
1758
1758
|
};
|
|
1759
|
-
function equals(existing, incoming) {
|
|
1759
|
+
function equals$2(existing, incoming) {
|
|
1760
1760
|
const existing_isSuccess = existing.isSuccess;
|
|
1761
1761
|
const incoming_isSuccess = incoming.isSuccess;
|
|
1762
1762
|
if (!(existing_isSuccess === incoming_isSuccess)) {
|
|
@@ -1778,7 +1778,7 @@ function equals(existing, incoming) {
|
|
|
1778
1778
|
const existing_planTemplates = existing.planTemplates;
|
|
1779
1779
|
const incoming_planTemplates = incoming.planTemplates;
|
|
1780
1780
|
const equals_planTemplates_items = equalsArray(existing_planTemplates, incoming_planTemplates, (existing_planTemplates_item, incoming_planTemplates_item) => {
|
|
1781
|
-
if (!(equals$
|
|
1781
|
+
if (!(equals$3(existing_planTemplates_item, incoming_planTemplates_item))) {
|
|
1782
1782
|
return false;
|
|
1783
1783
|
}
|
|
1784
1784
|
});
|
|
@@ -1787,44 +1787,44 @@ function equals(existing, incoming) {
|
|
|
1787
1787
|
}
|
|
1788
1788
|
return true;
|
|
1789
1789
|
}
|
|
1790
|
-
const ingest = function RecommendedPlanTemplatesRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1790
|
+
const ingest$1 = function RecommendedPlanTemplatesRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1791
1791
|
if (process.env.NODE_ENV !== 'production') {
|
|
1792
|
-
const validateError = validate(input);
|
|
1792
|
+
const validateError = validate$2(input);
|
|
1793
1793
|
if (validateError !== null) {
|
|
1794
1794
|
throw validateError;
|
|
1795
1795
|
}
|
|
1796
1796
|
}
|
|
1797
1797
|
const key = path.fullPath;
|
|
1798
|
-
const ttlToUse = TTL;
|
|
1799
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "einstein-copilot-bot", VERSION, RepresentationType, equals);
|
|
1798
|
+
const ttlToUse = TTL$1;
|
|
1799
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "einstein-copilot-bot", VERSION$2, RepresentationType$1, equals$2);
|
|
1800
1800
|
return createLink(key);
|
|
1801
1801
|
};
|
|
1802
|
-
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
1802
|
+
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
1803
1803
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1804
1804
|
const rootKey = fullPathFactory();
|
|
1805
1805
|
rootKeySet.set(rootKey, {
|
|
1806
1806
|
namespace: keyPrefix,
|
|
1807
|
-
representationName: RepresentationType,
|
|
1807
|
+
representationName: RepresentationType$1,
|
|
1808
1808
|
mergeable: false
|
|
1809
1809
|
});
|
|
1810
1810
|
}
|
|
1811
1811
|
|
|
1812
|
-
function select(luvio, params) {
|
|
1813
|
-
return select$
|
|
1812
|
+
function select$3(luvio, params) {
|
|
1813
|
+
return select$4();
|
|
1814
1814
|
}
|
|
1815
|
-
function keyBuilder$
|
|
1815
|
+
function keyBuilder$3(luvio, params) {
|
|
1816
1816
|
return keyPrefix + '::RecommendedPlanTemplatesRepresentation:(' + 'pageType:' + params.urlParams.pageType + ',' + 'objectType:' + params.urlParams.objectType + ')';
|
|
1817
1817
|
}
|
|
1818
|
-
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
1819
|
-
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$
|
|
1818
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
1819
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$3(luvio, resourceParams));
|
|
1820
1820
|
}
|
|
1821
|
-
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
1821
|
+
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
1822
1822
|
const { body } = response;
|
|
1823
|
-
const key = keyBuilder$
|
|
1824
|
-
luvio.storeIngest(key, ingest, body);
|
|
1823
|
+
const key = keyBuilder$3(luvio, resourceParams);
|
|
1824
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
1825
1825
|
const snapshot = luvio.storeLookup({
|
|
1826
1826
|
recordId: key,
|
|
1827
|
-
node: select(),
|
|
1827
|
+
node: select$3(),
|
|
1828
1828
|
variables: {},
|
|
1829
1829
|
}, snapshotRefresh);
|
|
1830
1830
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -1835,19 +1835,19 @@ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
1835
1835
|
deepFreeze(snapshot.data);
|
|
1836
1836
|
return snapshot;
|
|
1837
1837
|
}
|
|
1838
|
-
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
1839
|
-
const key = keyBuilder$
|
|
1838
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
1839
|
+
const key = keyBuilder$3(luvio, params);
|
|
1840
1840
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1841
1841
|
const storeMetadataParams = {
|
|
1842
|
-
ttl: TTL,
|
|
1842
|
+
ttl: TTL$1,
|
|
1843
1843
|
namespace: keyPrefix,
|
|
1844
|
-
version: VERSION,
|
|
1845
|
-
representationName: RepresentationType
|
|
1844
|
+
version: VERSION$2,
|
|
1845
|
+
representationName: RepresentationType$1
|
|
1846
1846
|
};
|
|
1847
1847
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1848
1848
|
return errorSnapshot;
|
|
1849
1849
|
}
|
|
1850
|
-
function createResourceRequest(config) {
|
|
1850
|
+
function createResourceRequest$1(config) {
|
|
1851
1851
|
const headers = {};
|
|
1852
1852
|
return {
|
|
1853
1853
|
baseUri: '/services/data/v61.0',
|
|
@@ -1861,85 +1861,760 @@ function createResourceRequest(config) {
|
|
|
1861
1861
|
};
|
|
1862
1862
|
}
|
|
1863
1863
|
|
|
1864
|
-
const adapterName = 'getRecommendedPlanTemplates';
|
|
1864
|
+
const adapterName$1 = 'getRecommendedPlanTemplates';
|
|
1865
1865
|
const getRecommendedPlanTemplates_ConfigPropertyMetadata = [
|
|
1866
1866
|
generateParamConfigMetadata('pageType', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1867
1867
|
generateParamConfigMetadata('objectType', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1868
1868
|
];
|
|
1869
|
-
const getRecommendedPlanTemplates_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getRecommendedPlanTemplates_ConfigPropertyMetadata);
|
|
1870
|
-
const createResourceParams = /*#__PURE__*/ createResourceParams$
|
|
1871
|
-
function keyBuilder(luvio, config) {
|
|
1872
|
-
const resourceParams = createResourceParams(config);
|
|
1873
|
-
return keyBuilder$
|
|
1869
|
+
const getRecommendedPlanTemplates_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getRecommendedPlanTemplates_ConfigPropertyMetadata);
|
|
1870
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$4(getRecommendedPlanTemplates_ConfigPropertyMetadata);
|
|
1871
|
+
function keyBuilder$2(luvio, config) {
|
|
1872
|
+
const resourceParams = createResourceParams$1(config);
|
|
1873
|
+
return keyBuilder$3(luvio, resourceParams);
|
|
1874
1874
|
}
|
|
1875
|
-
function typeCheckConfig(untrustedConfig) {
|
|
1875
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
1876
1876
|
const config = {};
|
|
1877
|
-
typeCheckConfig$
|
|
1877
|
+
typeCheckConfig$4(untrustedConfig, config, getRecommendedPlanTemplates_ConfigPropertyMetadata);
|
|
1878
1878
|
return config;
|
|
1879
1879
|
}
|
|
1880
|
-
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
1880
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
1881
1881
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
1882
1882
|
return null;
|
|
1883
1883
|
}
|
|
1884
1884
|
if (process.env.NODE_ENV !== 'production') {
|
|
1885
1885
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
1886
1886
|
}
|
|
1887
|
-
const config = typeCheckConfig(untrustedConfig);
|
|
1887
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
1888
1888
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1889
1889
|
return null;
|
|
1890
1890
|
}
|
|
1891
1891
|
return config;
|
|
1892
1892
|
}
|
|
1893
|
-
function adapterFragment(luvio, config) {
|
|
1894
|
-
createResourceParams(config);
|
|
1895
|
-
return select();
|
|
1893
|
+
function adapterFragment$1(luvio, config) {
|
|
1894
|
+
createResourceParams$1(config);
|
|
1895
|
+
return select$3();
|
|
1896
1896
|
}
|
|
1897
|
-
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
1898
|
-
const snapshot = ingestSuccess(luvio, resourceParams, response, {
|
|
1897
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
1898
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
|
|
1899
1899
|
config,
|
|
1900
|
-
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
1900
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
1901
1901
|
});
|
|
1902
1902
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1903
1903
|
}
|
|
1904
|
-
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
1905
|
-
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
1904
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
1905
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
1906
1906
|
config,
|
|
1907
|
-
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
1907
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
1908
1908
|
});
|
|
1909
1909
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1910
1910
|
}
|
|
1911
|
-
function buildNetworkSnapshot(luvio, config, options) {
|
|
1912
|
-
const resourceParams = createResourceParams(config);
|
|
1913
|
-
const request = createResourceRequest(resourceParams);
|
|
1911
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
1912
|
+
const resourceParams = createResourceParams$1(config);
|
|
1913
|
+
const request = createResourceRequest$1(resourceParams);
|
|
1914
1914
|
return luvio.dispatchResourceRequest(request, options)
|
|
1915
1915
|
.then((response) => {
|
|
1916
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
1916
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
|
|
1917
1917
|
const cache = new StoreKeyMap();
|
|
1918
|
-
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
1918
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
1919
1919
|
return cache;
|
|
1920
1920
|
});
|
|
1921
1921
|
}, (response) => {
|
|
1922
|
-
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
1922
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
1923
1923
|
});
|
|
1924
1924
|
}
|
|
1925
|
-
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
1926
|
-
return buildNetworkSnapshotCachePolicy$
|
|
1925
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
1926
|
+
return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
|
|
1927
1927
|
}
|
|
1928
|
-
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
1928
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
1929
1929
|
const { luvio, config } = context;
|
|
1930
1930
|
const selector = {
|
|
1931
|
-
recordId: keyBuilder(luvio, config),
|
|
1932
|
-
node: adapterFragment(luvio, config),
|
|
1931
|
+
recordId: keyBuilder$2(luvio, config),
|
|
1932
|
+
node: adapterFragment$1(luvio, config),
|
|
1933
1933
|
variables: {},
|
|
1934
1934
|
};
|
|
1935
1935
|
const cacheSnapshot = storeLookup(selector, {
|
|
1936
1936
|
config,
|
|
1937
|
-
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
1937
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
1938
1938
|
});
|
|
1939
1939
|
return cacheSnapshot;
|
|
1940
1940
|
}
|
|
1941
1941
|
const getRecommendedPlanTemplatesAdapterFactory = (luvio) => function einsteinCopilotBot__getRecommendedPlanTemplates(untrustedConfig, requestContext) {
|
|
1942
|
-
const config = validateAdapterConfig(untrustedConfig, getRecommendedPlanTemplates_ConfigPropertyNames);
|
|
1942
|
+
const config = validateAdapterConfig$1(untrustedConfig, getRecommendedPlanTemplates_ConfigPropertyNames);
|
|
1943
|
+
// Invalid or incomplete config
|
|
1944
|
+
if (config === null) {
|
|
1945
|
+
return null;
|
|
1946
|
+
}
|
|
1947
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1948
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
1949
|
+
};
|
|
1950
|
+
|
|
1951
|
+
const VERSION$1 = "3d8b52828ddd11f23f898b0bba8db802";
|
|
1952
|
+
function validate$1(obj, path = 'CopilotQuickActionRepresentation') {
|
|
1953
|
+
const v_error = (() => {
|
|
1954
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1955
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1956
|
+
}
|
|
1957
|
+
if (obj.actionApiName !== undefined) {
|
|
1958
|
+
const obj_actionApiName = obj.actionApiName;
|
|
1959
|
+
const path_actionApiName = path + '.actionApiName';
|
|
1960
|
+
if (typeof obj_actionApiName !== 'string') {
|
|
1961
|
+
return new TypeError('Expected "string" but received "' + typeof obj_actionApiName + '" (at "' + path_actionApiName + '")');
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1964
|
+
if (obj.createdDate !== undefined) {
|
|
1965
|
+
const obj_createdDate = obj.createdDate;
|
|
1966
|
+
const path_createdDate = path + '.createdDate';
|
|
1967
|
+
if (typeof obj_createdDate !== 'string') {
|
|
1968
|
+
return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
|
|
1969
|
+
}
|
|
1970
|
+
}
|
|
1971
|
+
if (obj.description !== undefined) {
|
|
1972
|
+
const obj_description = obj.description;
|
|
1973
|
+
const path_description = path + '.description';
|
|
1974
|
+
if (typeof obj_description !== 'string') {
|
|
1975
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
1976
|
+
}
|
|
1977
|
+
}
|
|
1978
|
+
if (obj.icon !== undefined) {
|
|
1979
|
+
const obj_icon = obj.icon;
|
|
1980
|
+
const path_icon = path + '.icon';
|
|
1981
|
+
if (typeof obj_icon !== 'string') {
|
|
1982
|
+
return new TypeError('Expected "string" but received "' + typeof obj_icon + '" (at "' + path_icon + '")');
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1985
|
+
if (obj.intent !== undefined) {
|
|
1986
|
+
const obj_intent = obj.intent;
|
|
1987
|
+
const path_intent = path + '.intent';
|
|
1988
|
+
if (typeof obj_intent !== 'string') {
|
|
1989
|
+
return new TypeError('Expected "string" but received "' + typeof obj_intent + '" (at "' + path_intent + '")');
|
|
1990
|
+
}
|
|
1991
|
+
}
|
|
1992
|
+
if (obj.isGlobal !== undefined) {
|
|
1993
|
+
const obj_isGlobal = obj.isGlobal;
|
|
1994
|
+
const path_isGlobal = path + '.isGlobal';
|
|
1995
|
+
if (typeof obj_isGlobal !== 'boolean') {
|
|
1996
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isGlobal + '" (at "' + path_isGlobal + '")');
|
|
1997
|
+
}
|
|
1998
|
+
}
|
|
1999
|
+
if (obj.isStandard !== undefined) {
|
|
2000
|
+
const obj_isStandard = obj.isStandard;
|
|
2001
|
+
const path_isStandard = path + '.isStandard';
|
|
2002
|
+
if (typeof obj_isStandard !== 'boolean') {
|
|
2003
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isStandard + '" (at "' + path_isStandard + '")');
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
if (obj.label !== undefined) {
|
|
2007
|
+
const obj_label = obj.label;
|
|
2008
|
+
const path_label = path + '.label';
|
|
2009
|
+
if (typeof obj_label !== 'string') {
|
|
2010
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
2011
|
+
}
|
|
2012
|
+
}
|
|
2013
|
+
if (obj.lastModifiedDate !== undefined) {
|
|
2014
|
+
const obj_lastModifiedDate = obj.lastModifiedDate;
|
|
2015
|
+
const path_lastModifiedDate = path + '.lastModifiedDate';
|
|
2016
|
+
if (typeof obj_lastModifiedDate !== 'string') {
|
|
2017
|
+
return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
|
|
2018
|
+
}
|
|
2019
|
+
}
|
|
2020
|
+
if (obj.namespace !== undefined) {
|
|
2021
|
+
const obj_namespace = obj.namespace;
|
|
2022
|
+
const path_namespace = path + '.namespace';
|
|
2023
|
+
if (typeof obj_namespace !== 'string') {
|
|
2024
|
+
return new TypeError('Expected "string" but received "' + typeof obj_namespace + '" (at "' + path_namespace + '")');
|
|
2025
|
+
}
|
|
2026
|
+
}
|
|
2027
|
+
if (obj.orgAccess !== undefined) {
|
|
2028
|
+
const obj_orgAccess = obj.orgAccess;
|
|
2029
|
+
const path_orgAccess = path + '.orgAccess';
|
|
2030
|
+
if (typeof obj_orgAccess !== 'string') {
|
|
2031
|
+
return new TypeError('Expected "string" but received "' + typeof obj_orgAccess + '" (at "' + path_orgAccess + '")');
|
|
2032
|
+
}
|
|
2033
|
+
}
|
|
2034
|
+
if (obj.planTemplateId !== undefined) {
|
|
2035
|
+
const obj_planTemplateId = obj.planTemplateId;
|
|
2036
|
+
const path_planTemplateId = path + '.planTemplateId';
|
|
2037
|
+
if (typeof obj_planTemplateId !== 'string') {
|
|
2038
|
+
return new TypeError('Expected "string" but received "' + typeof obj_planTemplateId + '" (at "' + path_planTemplateId + '")');
|
|
2039
|
+
}
|
|
2040
|
+
}
|
|
2041
|
+
if (obj.planTemplateInput !== undefined) {
|
|
2042
|
+
const obj_planTemplateInput = obj.planTemplateInput;
|
|
2043
|
+
const path_planTemplateInput = path + '.planTemplateInput';
|
|
2044
|
+
if (typeof obj_planTemplateInput !== 'object' || ArrayIsArray(obj_planTemplateInput) || obj_planTemplateInput === null) {
|
|
2045
|
+
return new TypeError('Expected "object" but received "' + typeof obj_planTemplateInput + '" (at "' + path_planTemplateInput + '")');
|
|
2046
|
+
}
|
|
2047
|
+
const obj_planTemplateInput_keys = ObjectKeys(obj_planTemplateInput);
|
|
2048
|
+
for (let i = 0; i < obj_planTemplateInput_keys.length; i++) {
|
|
2049
|
+
const key = obj_planTemplateInput_keys[i];
|
|
2050
|
+
const obj_planTemplateInput_prop = obj_planTemplateInput[key];
|
|
2051
|
+
const path_planTemplateInput_prop = path_planTemplateInput + '["' + key + '"]';
|
|
2052
|
+
if (typeof obj_planTemplateInput_prop !== 'string') {
|
|
2053
|
+
return new TypeError('Expected "string" but received "' + typeof obj_planTemplateInput_prop + '" (at "' + path_planTemplateInput_prop + '")');
|
|
2054
|
+
}
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
if (obj.type !== undefined) {
|
|
2058
|
+
const obj_type = obj.type;
|
|
2059
|
+
const path_type = path + '.type';
|
|
2060
|
+
if (typeof obj_type !== 'string') {
|
|
2061
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
if (obj.userUtterance !== undefined) {
|
|
2065
|
+
const obj_userUtterance = obj.userUtterance;
|
|
2066
|
+
const path_userUtterance = path + '.userUtterance';
|
|
2067
|
+
if (typeof obj_userUtterance !== 'string') {
|
|
2068
|
+
return new TypeError('Expected "string" but received "' + typeof obj_userUtterance + '" (at "' + path_userUtterance + '")');
|
|
2069
|
+
}
|
|
2070
|
+
}
|
|
2071
|
+
})();
|
|
2072
|
+
return v_error === undefined ? null : v_error;
|
|
2073
|
+
}
|
|
2074
|
+
const select$2 = function CopilotQuickActionRepresentationSelect() {
|
|
2075
|
+
return {
|
|
2076
|
+
kind: 'Fragment',
|
|
2077
|
+
version: VERSION$1,
|
|
2078
|
+
private: [],
|
|
2079
|
+
selections: [
|
|
2080
|
+
{
|
|
2081
|
+
name: 'actionApiName',
|
|
2082
|
+
kind: 'Scalar',
|
|
2083
|
+
required: false
|
|
2084
|
+
},
|
|
2085
|
+
{
|
|
2086
|
+
name: 'createdDate',
|
|
2087
|
+
kind: 'Scalar',
|
|
2088
|
+
required: false
|
|
2089
|
+
},
|
|
2090
|
+
{
|
|
2091
|
+
name: 'description',
|
|
2092
|
+
kind: 'Scalar',
|
|
2093
|
+
required: false
|
|
2094
|
+
},
|
|
2095
|
+
{
|
|
2096
|
+
name: 'icon',
|
|
2097
|
+
kind: 'Scalar',
|
|
2098
|
+
required: false
|
|
2099
|
+
},
|
|
2100
|
+
{
|
|
2101
|
+
name: 'intent',
|
|
2102
|
+
kind: 'Scalar',
|
|
2103
|
+
required: false
|
|
2104
|
+
},
|
|
2105
|
+
{
|
|
2106
|
+
name: 'isGlobal',
|
|
2107
|
+
kind: 'Scalar',
|
|
2108
|
+
required: false
|
|
2109
|
+
},
|
|
2110
|
+
{
|
|
2111
|
+
name: 'isStandard',
|
|
2112
|
+
kind: 'Scalar',
|
|
2113
|
+
required: false
|
|
2114
|
+
},
|
|
2115
|
+
{
|
|
2116
|
+
name: 'label',
|
|
2117
|
+
kind: 'Scalar',
|
|
2118
|
+
required: false
|
|
2119
|
+
},
|
|
2120
|
+
{
|
|
2121
|
+
name: 'lastModifiedDate',
|
|
2122
|
+
kind: 'Scalar',
|
|
2123
|
+
required: false
|
|
2124
|
+
},
|
|
2125
|
+
{
|
|
2126
|
+
name: 'namespace',
|
|
2127
|
+
kind: 'Scalar',
|
|
2128
|
+
required: false
|
|
2129
|
+
},
|
|
2130
|
+
{
|
|
2131
|
+
name: 'orgAccess',
|
|
2132
|
+
kind: 'Scalar',
|
|
2133
|
+
required: false
|
|
2134
|
+
},
|
|
2135
|
+
{
|
|
2136
|
+
name: 'planTemplateId',
|
|
2137
|
+
kind: 'Scalar',
|
|
2138
|
+
required: false
|
|
2139
|
+
},
|
|
2140
|
+
{
|
|
2141
|
+
name: 'planTemplateInput',
|
|
2142
|
+
kind: 'Scalar',
|
|
2143
|
+
map: true,
|
|
2144
|
+
required: false
|
|
2145
|
+
},
|
|
2146
|
+
{
|
|
2147
|
+
name: 'type',
|
|
2148
|
+
kind: 'Scalar',
|
|
2149
|
+
required: false
|
|
2150
|
+
},
|
|
2151
|
+
{
|
|
2152
|
+
name: 'userUtterance',
|
|
2153
|
+
kind: 'Scalar',
|
|
2154
|
+
required: false
|
|
2155
|
+
}
|
|
2156
|
+
]
|
|
2157
|
+
};
|
|
2158
|
+
};
|
|
2159
|
+
function equals$1(existing, incoming) {
|
|
2160
|
+
const existing_isGlobal = existing.isGlobal;
|
|
2161
|
+
const incoming_isGlobal = incoming.isGlobal;
|
|
2162
|
+
// if at least one of these optionals is defined
|
|
2163
|
+
if (existing_isGlobal !== undefined || incoming_isGlobal !== undefined) {
|
|
2164
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2165
|
+
// not equal
|
|
2166
|
+
if (existing_isGlobal === undefined || incoming_isGlobal === undefined) {
|
|
2167
|
+
return false;
|
|
2168
|
+
}
|
|
2169
|
+
if (!(existing_isGlobal === incoming_isGlobal)) {
|
|
2170
|
+
return false;
|
|
2171
|
+
}
|
|
2172
|
+
}
|
|
2173
|
+
const existing_isStandard = existing.isStandard;
|
|
2174
|
+
const incoming_isStandard = incoming.isStandard;
|
|
2175
|
+
// if at least one of these optionals is defined
|
|
2176
|
+
if (existing_isStandard !== undefined || incoming_isStandard !== undefined) {
|
|
2177
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2178
|
+
// not equal
|
|
2179
|
+
if (existing_isStandard === undefined || incoming_isStandard === undefined) {
|
|
2180
|
+
return false;
|
|
2181
|
+
}
|
|
2182
|
+
if (!(existing_isStandard === incoming_isStandard)) {
|
|
2183
|
+
return false;
|
|
2184
|
+
}
|
|
2185
|
+
}
|
|
2186
|
+
const existing_actionApiName = existing.actionApiName;
|
|
2187
|
+
const incoming_actionApiName = incoming.actionApiName;
|
|
2188
|
+
// if at least one of these optionals is defined
|
|
2189
|
+
if (existing_actionApiName !== undefined || incoming_actionApiName !== undefined) {
|
|
2190
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2191
|
+
// not equal
|
|
2192
|
+
if (existing_actionApiName === undefined || incoming_actionApiName === undefined) {
|
|
2193
|
+
return false;
|
|
2194
|
+
}
|
|
2195
|
+
if (!(existing_actionApiName === incoming_actionApiName)) {
|
|
2196
|
+
return false;
|
|
2197
|
+
}
|
|
2198
|
+
}
|
|
2199
|
+
const existing_createdDate = existing.createdDate;
|
|
2200
|
+
const incoming_createdDate = incoming.createdDate;
|
|
2201
|
+
// if at least one of these optionals is defined
|
|
2202
|
+
if (existing_createdDate !== undefined || incoming_createdDate !== undefined) {
|
|
2203
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2204
|
+
// not equal
|
|
2205
|
+
if (existing_createdDate === undefined || incoming_createdDate === undefined) {
|
|
2206
|
+
return false;
|
|
2207
|
+
}
|
|
2208
|
+
if (!(existing_createdDate === incoming_createdDate)) {
|
|
2209
|
+
return false;
|
|
2210
|
+
}
|
|
2211
|
+
}
|
|
2212
|
+
const existing_description = existing.description;
|
|
2213
|
+
const incoming_description = incoming.description;
|
|
2214
|
+
// if at least one of these optionals is defined
|
|
2215
|
+
if (existing_description !== undefined || incoming_description !== undefined) {
|
|
2216
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2217
|
+
// not equal
|
|
2218
|
+
if (existing_description === undefined || incoming_description === undefined) {
|
|
2219
|
+
return false;
|
|
2220
|
+
}
|
|
2221
|
+
if (!(existing_description === incoming_description)) {
|
|
2222
|
+
return false;
|
|
2223
|
+
}
|
|
2224
|
+
}
|
|
2225
|
+
const existing_icon = existing.icon;
|
|
2226
|
+
const incoming_icon = incoming.icon;
|
|
2227
|
+
// if at least one of these optionals is defined
|
|
2228
|
+
if (existing_icon !== undefined || incoming_icon !== undefined) {
|
|
2229
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2230
|
+
// not equal
|
|
2231
|
+
if (existing_icon === undefined || incoming_icon === undefined) {
|
|
2232
|
+
return false;
|
|
2233
|
+
}
|
|
2234
|
+
if (!(existing_icon === incoming_icon)) {
|
|
2235
|
+
return false;
|
|
2236
|
+
}
|
|
2237
|
+
}
|
|
2238
|
+
const existing_intent = existing.intent;
|
|
2239
|
+
const incoming_intent = incoming.intent;
|
|
2240
|
+
// if at least one of these optionals is defined
|
|
2241
|
+
if (existing_intent !== undefined || incoming_intent !== undefined) {
|
|
2242
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2243
|
+
// not equal
|
|
2244
|
+
if (existing_intent === undefined || incoming_intent === undefined) {
|
|
2245
|
+
return false;
|
|
2246
|
+
}
|
|
2247
|
+
if (!(existing_intent === incoming_intent)) {
|
|
2248
|
+
return false;
|
|
2249
|
+
}
|
|
2250
|
+
}
|
|
2251
|
+
const existing_label = existing.label;
|
|
2252
|
+
const incoming_label = incoming.label;
|
|
2253
|
+
// if at least one of these optionals is defined
|
|
2254
|
+
if (existing_label !== undefined || incoming_label !== undefined) {
|
|
2255
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2256
|
+
// not equal
|
|
2257
|
+
if (existing_label === undefined || incoming_label === undefined) {
|
|
2258
|
+
return false;
|
|
2259
|
+
}
|
|
2260
|
+
if (!(existing_label === incoming_label)) {
|
|
2261
|
+
return false;
|
|
2262
|
+
}
|
|
2263
|
+
}
|
|
2264
|
+
const existing_lastModifiedDate = existing.lastModifiedDate;
|
|
2265
|
+
const incoming_lastModifiedDate = incoming.lastModifiedDate;
|
|
2266
|
+
// if at least one of these optionals is defined
|
|
2267
|
+
if (existing_lastModifiedDate !== undefined || incoming_lastModifiedDate !== undefined) {
|
|
2268
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2269
|
+
// not equal
|
|
2270
|
+
if (existing_lastModifiedDate === undefined || incoming_lastModifiedDate === undefined) {
|
|
2271
|
+
return false;
|
|
2272
|
+
}
|
|
2273
|
+
if (!(existing_lastModifiedDate === incoming_lastModifiedDate)) {
|
|
2274
|
+
return false;
|
|
2275
|
+
}
|
|
2276
|
+
}
|
|
2277
|
+
const existing_namespace = existing.namespace;
|
|
2278
|
+
const incoming_namespace = incoming.namespace;
|
|
2279
|
+
// if at least one of these optionals is defined
|
|
2280
|
+
if (existing_namespace !== undefined || incoming_namespace !== undefined) {
|
|
2281
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2282
|
+
// not equal
|
|
2283
|
+
if (existing_namespace === undefined || incoming_namespace === undefined) {
|
|
2284
|
+
return false;
|
|
2285
|
+
}
|
|
2286
|
+
if (!(existing_namespace === incoming_namespace)) {
|
|
2287
|
+
return false;
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
const existing_orgAccess = existing.orgAccess;
|
|
2291
|
+
const incoming_orgAccess = incoming.orgAccess;
|
|
2292
|
+
// if at least one of these optionals is defined
|
|
2293
|
+
if (existing_orgAccess !== undefined || incoming_orgAccess !== undefined) {
|
|
2294
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2295
|
+
// not equal
|
|
2296
|
+
if (existing_orgAccess === undefined || incoming_orgAccess === undefined) {
|
|
2297
|
+
return false;
|
|
2298
|
+
}
|
|
2299
|
+
if (!(existing_orgAccess === incoming_orgAccess)) {
|
|
2300
|
+
return false;
|
|
2301
|
+
}
|
|
2302
|
+
}
|
|
2303
|
+
const existing_planTemplateId = existing.planTemplateId;
|
|
2304
|
+
const incoming_planTemplateId = incoming.planTemplateId;
|
|
2305
|
+
// if at least one of these optionals is defined
|
|
2306
|
+
if (existing_planTemplateId !== undefined || incoming_planTemplateId !== undefined) {
|
|
2307
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2308
|
+
// not equal
|
|
2309
|
+
if (existing_planTemplateId === undefined || incoming_planTemplateId === undefined) {
|
|
2310
|
+
return false;
|
|
2311
|
+
}
|
|
2312
|
+
if (!(existing_planTemplateId === incoming_planTemplateId)) {
|
|
2313
|
+
return false;
|
|
2314
|
+
}
|
|
2315
|
+
}
|
|
2316
|
+
const existing_type = existing.type;
|
|
2317
|
+
const incoming_type = incoming.type;
|
|
2318
|
+
// if at least one of these optionals is defined
|
|
2319
|
+
if (existing_type !== undefined || incoming_type !== undefined) {
|
|
2320
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2321
|
+
// not equal
|
|
2322
|
+
if (existing_type === undefined || incoming_type === undefined) {
|
|
2323
|
+
return false;
|
|
2324
|
+
}
|
|
2325
|
+
if (!(existing_type === incoming_type)) {
|
|
2326
|
+
return false;
|
|
2327
|
+
}
|
|
2328
|
+
}
|
|
2329
|
+
const existing_userUtterance = existing.userUtterance;
|
|
2330
|
+
const incoming_userUtterance = incoming.userUtterance;
|
|
2331
|
+
// if at least one of these optionals is defined
|
|
2332
|
+
if (existing_userUtterance !== undefined || incoming_userUtterance !== undefined) {
|
|
2333
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2334
|
+
// not equal
|
|
2335
|
+
if (existing_userUtterance === undefined || incoming_userUtterance === undefined) {
|
|
2336
|
+
return false;
|
|
2337
|
+
}
|
|
2338
|
+
if (!(existing_userUtterance === incoming_userUtterance)) {
|
|
2339
|
+
return false;
|
|
2340
|
+
}
|
|
2341
|
+
}
|
|
2342
|
+
const existing_planTemplateInput = existing.planTemplateInput;
|
|
2343
|
+
const incoming_planTemplateInput = incoming.planTemplateInput;
|
|
2344
|
+
// if at least one of these optionals is defined
|
|
2345
|
+
if (existing_planTemplateInput !== undefined || incoming_planTemplateInput !== undefined) {
|
|
2346
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2347
|
+
// not equal
|
|
2348
|
+
if (existing_planTemplateInput === undefined || incoming_planTemplateInput === undefined) {
|
|
2349
|
+
return false;
|
|
2350
|
+
}
|
|
2351
|
+
const equals_planTemplateInput_props = equalsObject(existing_planTemplateInput, incoming_planTemplateInput, (existing_planTemplateInput_prop, incoming_planTemplateInput_prop) => {
|
|
2352
|
+
if (!(existing_planTemplateInput_prop === incoming_planTemplateInput_prop)) {
|
|
2353
|
+
return false;
|
|
2354
|
+
}
|
|
2355
|
+
});
|
|
2356
|
+
if (equals_planTemplateInput_props === false) {
|
|
2357
|
+
return false;
|
|
2358
|
+
}
|
|
2359
|
+
}
|
|
2360
|
+
return true;
|
|
2361
|
+
}
|
|
2362
|
+
|
|
2363
|
+
const TTL = 900000;
|
|
2364
|
+
const VERSION = "122e61b0db6dc38d244a87570efc5522";
|
|
2365
|
+
function validate(obj, path = 'RecommendedActionsRepresentation') {
|
|
2366
|
+
const v_error = (() => {
|
|
2367
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2368
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2369
|
+
}
|
|
2370
|
+
const obj_copilotQuickActions = obj.copilotQuickActions;
|
|
2371
|
+
const path_copilotQuickActions = path + '.copilotQuickActions';
|
|
2372
|
+
if (!ArrayIsArray(obj_copilotQuickActions)) {
|
|
2373
|
+
return new TypeError('Expected "array" but received "' + typeof obj_copilotQuickActions + '" (at "' + path_copilotQuickActions + '")');
|
|
2374
|
+
}
|
|
2375
|
+
for (let i = 0; i < obj_copilotQuickActions.length; i++) {
|
|
2376
|
+
const obj_copilotQuickActions_item = obj_copilotQuickActions[i];
|
|
2377
|
+
const path_copilotQuickActions_item = path_copilotQuickActions + '[' + i + ']';
|
|
2378
|
+
const referencepath_copilotQuickActions_itemValidationError = validate$1(obj_copilotQuickActions_item, path_copilotQuickActions_item);
|
|
2379
|
+
if (referencepath_copilotQuickActions_itemValidationError !== null) {
|
|
2380
|
+
let message = 'Object doesn\'t match CopilotQuickActionRepresentation (at "' + path_copilotQuickActions_item + '")\n';
|
|
2381
|
+
message += referencepath_copilotQuickActions_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2382
|
+
return new TypeError(message);
|
|
2383
|
+
}
|
|
2384
|
+
}
|
|
2385
|
+
if (obj.errorMessage !== undefined) {
|
|
2386
|
+
const obj_errorMessage = obj.errorMessage;
|
|
2387
|
+
const path_errorMessage = path + '.errorMessage';
|
|
2388
|
+
if (typeof obj_errorMessage !== 'string') {
|
|
2389
|
+
return new TypeError('Expected "string" but received "' + typeof obj_errorMessage + '" (at "' + path_errorMessage + '")');
|
|
2390
|
+
}
|
|
2391
|
+
}
|
|
2392
|
+
const obj_isSuccess = obj.isSuccess;
|
|
2393
|
+
const path_isSuccess = path + '.isSuccess';
|
|
2394
|
+
if (typeof obj_isSuccess !== 'boolean') {
|
|
2395
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
|
|
2396
|
+
}
|
|
2397
|
+
})();
|
|
2398
|
+
return v_error === undefined ? null : v_error;
|
|
2399
|
+
}
|
|
2400
|
+
const RepresentationType = 'RecommendedActionsRepresentation';
|
|
2401
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
2402
|
+
return input;
|
|
2403
|
+
}
|
|
2404
|
+
const select$1 = function RecommendedActionsRepresentationSelect() {
|
|
2405
|
+
const { selections: CopilotQuickActionRepresentation__selections, opaque: CopilotQuickActionRepresentation__opaque, } = select$2();
|
|
2406
|
+
return {
|
|
2407
|
+
kind: 'Fragment',
|
|
2408
|
+
version: VERSION,
|
|
2409
|
+
private: [],
|
|
2410
|
+
selections: [
|
|
2411
|
+
{
|
|
2412
|
+
name: 'copilotQuickActions',
|
|
2413
|
+
kind: 'Object',
|
|
2414
|
+
plural: true,
|
|
2415
|
+
selections: CopilotQuickActionRepresentation__selections
|
|
2416
|
+
},
|
|
2417
|
+
{
|
|
2418
|
+
name: 'errorMessage',
|
|
2419
|
+
kind: 'Scalar',
|
|
2420
|
+
required: false
|
|
2421
|
+
},
|
|
2422
|
+
{
|
|
2423
|
+
name: 'isSuccess',
|
|
2424
|
+
kind: 'Scalar'
|
|
2425
|
+
}
|
|
2426
|
+
]
|
|
2427
|
+
};
|
|
2428
|
+
};
|
|
2429
|
+
function equals(existing, incoming) {
|
|
2430
|
+
const existing_isSuccess = existing.isSuccess;
|
|
2431
|
+
const incoming_isSuccess = incoming.isSuccess;
|
|
2432
|
+
if (!(existing_isSuccess === incoming_isSuccess)) {
|
|
2433
|
+
return false;
|
|
2434
|
+
}
|
|
2435
|
+
const existing_errorMessage = existing.errorMessage;
|
|
2436
|
+
const incoming_errorMessage = incoming.errorMessage;
|
|
2437
|
+
// if at least one of these optionals is defined
|
|
2438
|
+
if (existing_errorMessage !== undefined || incoming_errorMessage !== undefined) {
|
|
2439
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2440
|
+
// not equal
|
|
2441
|
+
if (existing_errorMessage === undefined || incoming_errorMessage === undefined) {
|
|
2442
|
+
return false;
|
|
2443
|
+
}
|
|
2444
|
+
if (!(existing_errorMessage === incoming_errorMessage)) {
|
|
2445
|
+
return false;
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2448
|
+
const existing_copilotQuickActions = existing.copilotQuickActions;
|
|
2449
|
+
const incoming_copilotQuickActions = incoming.copilotQuickActions;
|
|
2450
|
+
const equals_copilotQuickActions_items = equalsArray(existing_copilotQuickActions, incoming_copilotQuickActions, (existing_copilotQuickActions_item, incoming_copilotQuickActions_item) => {
|
|
2451
|
+
if (!(equals$1(existing_copilotQuickActions_item, incoming_copilotQuickActions_item))) {
|
|
2452
|
+
return false;
|
|
2453
|
+
}
|
|
2454
|
+
});
|
|
2455
|
+
if (equals_copilotQuickActions_items === false) {
|
|
2456
|
+
return false;
|
|
2457
|
+
}
|
|
2458
|
+
return true;
|
|
2459
|
+
}
|
|
2460
|
+
const ingest = function RecommendedActionsRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2461
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2462
|
+
const validateError = validate(input);
|
|
2463
|
+
if (validateError !== null) {
|
|
2464
|
+
throw validateError;
|
|
2465
|
+
}
|
|
2466
|
+
}
|
|
2467
|
+
const key = path.fullPath;
|
|
2468
|
+
const ttlToUse = TTL;
|
|
2469
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "einstein-copilot-bot", VERSION, RepresentationType, equals);
|
|
2470
|
+
return createLink(key);
|
|
2471
|
+
};
|
|
2472
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
2473
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2474
|
+
const rootKey = fullPathFactory();
|
|
2475
|
+
rootKeySet.set(rootKey, {
|
|
2476
|
+
namespace: keyPrefix,
|
|
2477
|
+
representationName: RepresentationType,
|
|
2478
|
+
mergeable: false
|
|
2479
|
+
});
|
|
2480
|
+
}
|
|
2481
|
+
|
|
2482
|
+
function select(luvio, params) {
|
|
2483
|
+
return select$1();
|
|
2484
|
+
}
|
|
2485
|
+
function keyBuilder$1(luvio, params) {
|
|
2486
|
+
return keyPrefix + '::RecommendedActionsRepresentation:(' + 'pageName:' + params.queryParams.pageName + ',' + 'pageType:' + params.queryParams.pageType + ',' + 'actionName:' + params.queryParams.actionName + ',' + 'objectApiName:' + params.queryParams.objectApiName + ',' + 'customApplicationName:' + params.queryParams.customApplicationName + ',' + 'sessionId:' + params.queryParams.sessionId + ',' + 'formFactor:' + params.queryParams.formFactor + ')';
|
|
2487
|
+
}
|
|
2488
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
2489
|
+
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
|
|
2490
|
+
}
|
|
2491
|
+
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
2492
|
+
const { body } = response;
|
|
2493
|
+
const key = keyBuilder$1(luvio, resourceParams);
|
|
2494
|
+
luvio.storeIngest(key, ingest, body);
|
|
2495
|
+
const snapshot = luvio.storeLookup({
|
|
2496
|
+
recordId: key,
|
|
2497
|
+
node: select(),
|
|
2498
|
+
variables: {},
|
|
2499
|
+
}, snapshotRefresh);
|
|
2500
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2501
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2502
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
deepFreeze(snapshot.data);
|
|
2506
|
+
return snapshot;
|
|
2507
|
+
}
|
|
2508
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
2509
|
+
const key = keyBuilder$1(luvio, params);
|
|
2510
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2511
|
+
const storeMetadataParams = {
|
|
2512
|
+
ttl: TTL,
|
|
2513
|
+
namespace: keyPrefix,
|
|
2514
|
+
version: VERSION,
|
|
2515
|
+
representationName: RepresentationType
|
|
2516
|
+
};
|
|
2517
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
2518
|
+
return errorSnapshot;
|
|
2519
|
+
}
|
|
2520
|
+
function createResourceRequest(config) {
|
|
2521
|
+
const headers = {};
|
|
2522
|
+
return {
|
|
2523
|
+
baseUri: '/services/data/v61.0',
|
|
2524
|
+
basePath: '/connect/recommended-actions',
|
|
2525
|
+
method: 'get',
|
|
2526
|
+
body: null,
|
|
2527
|
+
urlParams: {},
|
|
2528
|
+
queryParams: config.queryParams,
|
|
2529
|
+
headers,
|
|
2530
|
+
priority: 'normal',
|
|
2531
|
+
};
|
|
2532
|
+
}
|
|
2533
|
+
|
|
2534
|
+
const adapterName = 'getRecommendedActions';
|
|
2535
|
+
const getRecommendedActions_ConfigPropertyMetadata = [
|
|
2536
|
+
generateParamConfigMetadata('pageName', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2537
|
+
generateParamConfigMetadata('pageType', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2538
|
+
generateParamConfigMetadata('actionName', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2539
|
+
generateParamConfigMetadata('objectApiName', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2540
|
+
generateParamConfigMetadata('customApplicationName', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2541
|
+
generateParamConfigMetadata('sessionId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2542
|
+
generateParamConfigMetadata('formFactor', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2543
|
+
];
|
|
2544
|
+
const getRecommendedActions_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getRecommendedActions_ConfigPropertyMetadata);
|
|
2545
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$4(getRecommendedActions_ConfigPropertyMetadata);
|
|
2546
|
+
function keyBuilder(luvio, config) {
|
|
2547
|
+
const resourceParams = createResourceParams(config);
|
|
2548
|
+
return keyBuilder$1(luvio, resourceParams);
|
|
2549
|
+
}
|
|
2550
|
+
function typeCheckConfig(untrustedConfig) {
|
|
2551
|
+
const config = {};
|
|
2552
|
+
typeCheckConfig$4(untrustedConfig, config, getRecommendedActions_ConfigPropertyMetadata);
|
|
2553
|
+
return config;
|
|
2554
|
+
}
|
|
2555
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
2556
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2557
|
+
return null;
|
|
2558
|
+
}
|
|
2559
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2560
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2561
|
+
}
|
|
2562
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
2563
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2564
|
+
return null;
|
|
2565
|
+
}
|
|
2566
|
+
return config;
|
|
2567
|
+
}
|
|
2568
|
+
function adapterFragment(luvio, config) {
|
|
2569
|
+
createResourceParams(config);
|
|
2570
|
+
return select();
|
|
2571
|
+
}
|
|
2572
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
2573
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response, {
|
|
2574
|
+
config,
|
|
2575
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
2576
|
+
});
|
|
2577
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2578
|
+
}
|
|
2579
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
2580
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
2581
|
+
config,
|
|
2582
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
2583
|
+
});
|
|
2584
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2585
|
+
}
|
|
2586
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
2587
|
+
const resourceParams = createResourceParams(config);
|
|
2588
|
+
const request = createResourceRequest(resourceParams);
|
|
2589
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2590
|
+
.then((response) => {
|
|
2591
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
2592
|
+
const cache = new StoreKeyMap();
|
|
2593
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
2594
|
+
return cache;
|
|
2595
|
+
});
|
|
2596
|
+
}, (response) => {
|
|
2597
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
2598
|
+
});
|
|
2599
|
+
}
|
|
2600
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
2601
|
+
return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
2602
|
+
}
|
|
2603
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
2604
|
+
const { luvio, config } = context;
|
|
2605
|
+
const selector = {
|
|
2606
|
+
recordId: keyBuilder(luvio, config),
|
|
2607
|
+
node: adapterFragment(luvio, config),
|
|
2608
|
+
variables: {},
|
|
2609
|
+
};
|
|
2610
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
2611
|
+
config,
|
|
2612
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
2613
|
+
});
|
|
2614
|
+
return cacheSnapshot;
|
|
2615
|
+
}
|
|
2616
|
+
const getRecommendedActionsAdapterFactory = (luvio) => function einsteinCopilotBot__getRecommendedActions(untrustedConfig, requestContext) {
|
|
2617
|
+
const config = validateAdapterConfig(untrustedConfig, getRecommendedActions_ConfigPropertyNames);
|
|
1943
2618
|
// Invalid or incomplete config
|
|
1944
2619
|
if (config === null) {
|
|
1945
2620
|
return null;
|
|
@@ -1948,4 +2623,4 @@ const getRecommendedPlanTemplatesAdapterFactory = (luvio) => function einsteinCo
|
|
|
1948
2623
|
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
1949
2624
|
};
|
|
1950
2625
|
|
|
1951
|
-
export { getBotIdAdapterFactory, getRecommendedPlanTemplatesAdapterFactory, sendMessageAdapterFactory };
|
|
2626
|
+
export { getBotIdAdapterFactory, getRecommendedActionsAdapterFactory, getRecommendedPlanTemplatesAdapterFactory, sendMessageAdapterFactory };
|