@salesforce/lds-adapters-service-einstein-copilot-bot 1.266.0-dev21 → 1.266.0-dev23
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 +944 -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/ConversationRuntimeProxyMessageRepresentation.d.ts +4 -1
- 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 +768 -35
- package/src/raml/api.raml +123 -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/v60.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 = "205b55ee28d637afd2916e42363d735f";
|
|
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');
|
|
@@ -772,6 +772,34 @@ function validate$3(obj, path = 'ConversationRuntimeProxyMessageRepresentation')
|
|
|
772
772
|
if (typeof obj_id !== 'string') {
|
|
773
773
|
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
774
774
|
}
|
|
775
|
+
if (obj.isContentSafe !== undefined) {
|
|
776
|
+
const obj_isContentSafe = obj.isContentSafe;
|
|
777
|
+
const path_isContentSafe = path + '.isContentSafe';
|
|
778
|
+
let obj_isContentSafe_union0 = null;
|
|
779
|
+
const obj_isContentSafe_union0_error = (() => {
|
|
780
|
+
if (typeof obj_isContentSafe !== 'boolean') {
|
|
781
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isContentSafe + '" (at "' + path_isContentSafe + '")');
|
|
782
|
+
}
|
|
783
|
+
})();
|
|
784
|
+
if (obj_isContentSafe_union0_error != null) {
|
|
785
|
+
obj_isContentSafe_union0 = obj_isContentSafe_union0_error.message;
|
|
786
|
+
}
|
|
787
|
+
let obj_isContentSafe_union1 = null;
|
|
788
|
+
const obj_isContentSafe_union1_error = (() => {
|
|
789
|
+
if (obj_isContentSafe !== null) {
|
|
790
|
+
return new TypeError('Expected "null" but received "' + typeof obj_isContentSafe + '" (at "' + path_isContentSafe + '")');
|
|
791
|
+
}
|
|
792
|
+
})();
|
|
793
|
+
if (obj_isContentSafe_union1_error != null) {
|
|
794
|
+
obj_isContentSafe_union1 = obj_isContentSafe_union1_error.message;
|
|
795
|
+
}
|
|
796
|
+
if (obj_isContentSafe_union0 && obj_isContentSafe_union1) {
|
|
797
|
+
let message = 'Object doesn\'t match union (at "' + path_isContentSafe + '")';
|
|
798
|
+
message += '\n' + obj_isContentSafe_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
799
|
+
message += '\n' + obj_isContentSafe_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
800
|
+
return new TypeError(message);
|
|
801
|
+
}
|
|
802
|
+
}
|
|
775
803
|
if (obj.message !== undefined) {
|
|
776
804
|
const obj_message = obj.message;
|
|
777
805
|
const path_message = path + '.message';
|
|
@@ -865,7 +893,7 @@ function validate$3(obj, path = 'ConversationRuntimeProxyMessageRepresentation')
|
|
|
865
893
|
for (let i = 0; i < obj_result.length; i++) {
|
|
866
894
|
const obj_result_item = obj_result[i];
|
|
867
895
|
const path_result_item = path_result + '[' + i + ']';
|
|
868
|
-
const referencepath_result_itemValidationError = validate$
|
|
896
|
+
const referencepath_result_itemValidationError = validate$9(obj_result_item, path_result_item);
|
|
869
897
|
if (referencepath_result_itemValidationError !== null) {
|
|
870
898
|
let message = 'Object doesn\'t match EsTypeMessageRepresentation (at "' + path_result_item + '")\n';
|
|
871
899
|
message += referencepath_result_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -939,26 +967,26 @@ function validate$3(obj, path = 'ConversationRuntimeProxyMessageRepresentation')
|
|
|
939
967
|
})();
|
|
940
968
|
return v_error === undefined ? null : v_error;
|
|
941
969
|
}
|
|
942
|
-
const RepresentationType$
|
|
943
|
-
function keyBuilder$
|
|
944
|
-
return keyPrefix + '::' + RepresentationType$
|
|
970
|
+
const RepresentationType$3 = 'ConversationRuntimeProxyMessageRepresentation';
|
|
971
|
+
function keyBuilder$5(luvio, config) {
|
|
972
|
+
return keyPrefix + '::' + RepresentationType$3 + ':' + config.id;
|
|
945
973
|
}
|
|
946
974
|
function keyBuilderFromType$1(luvio, object) {
|
|
947
975
|
const keyParams = {
|
|
948
976
|
id: object.id
|
|
949
977
|
};
|
|
950
|
-
return keyBuilder$
|
|
978
|
+
return keyBuilder$5(luvio, keyParams);
|
|
951
979
|
}
|
|
952
|
-
function normalize$
|
|
980
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
953
981
|
return input;
|
|
954
982
|
}
|
|
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$
|
|
983
|
+
const select$8 = function ConversationRuntimeProxyMessageRepresentationSelect() {
|
|
984
|
+
const { selections: ConversationRuntimeProxyChoiceRepresentation__selections, opaque: ConversationRuntimeProxyChoiceRepresentation__opaque, } = select$a();
|
|
985
|
+
const { selections: CollectMessageRepresentation__selections, opaque: CollectMessageRepresentation__opaque, } = select$9();
|
|
986
|
+
const { selections: EsTypeMessageRepresentation__selections, opaque: EsTypeMessageRepresentation__opaque, } = select$b();
|
|
959
987
|
return {
|
|
960
988
|
kind: 'Fragment',
|
|
961
|
-
version: VERSION$
|
|
989
|
+
version: VERSION$5,
|
|
962
990
|
private: [],
|
|
963
991
|
selections: [
|
|
964
992
|
{
|
|
@@ -1002,6 +1030,11 @@ const select$5 = function ConversationRuntimeProxyMessageRepresentationSelect()
|
|
|
1002
1030
|
name: 'id',
|
|
1003
1031
|
kind: 'Scalar'
|
|
1004
1032
|
},
|
|
1033
|
+
{
|
|
1034
|
+
name: 'isContentSafe',
|
|
1035
|
+
kind: 'Scalar',
|
|
1036
|
+
required: false
|
|
1037
|
+
},
|
|
1005
1038
|
{
|
|
1006
1039
|
name: 'message',
|
|
1007
1040
|
kind: 'Scalar',
|
|
@@ -1042,7 +1075,7 @@ const select$5 = function ConversationRuntimeProxyMessageRepresentationSelect()
|
|
|
1042
1075
|
]
|
|
1043
1076
|
};
|
|
1044
1077
|
};
|
|
1045
|
-
function equals$
|
|
1078
|
+
function equals$5(existing, incoming) {
|
|
1046
1079
|
const existing_id = existing.id;
|
|
1047
1080
|
const incoming_id = incoming.id;
|
|
1048
1081
|
if (!(existing_id === incoming_id)) {
|
|
@@ -1071,7 +1104,7 @@ function equals$3(existing, incoming) {
|
|
|
1071
1104
|
return false;
|
|
1072
1105
|
}
|
|
1073
1106
|
const equals_choices_items = equalsArray(existing_choices, incoming_choices, (existing_choices_item, incoming_choices_item) => {
|
|
1074
|
-
if (!(equals$
|
|
1107
|
+
if (!(equals$7(existing_choices_item, incoming_choices_item))) {
|
|
1075
1108
|
return false;
|
|
1076
1109
|
}
|
|
1077
1110
|
});
|
|
@@ -1089,7 +1122,7 @@ function equals$3(existing, incoming) {
|
|
|
1089
1122
|
return false;
|
|
1090
1123
|
}
|
|
1091
1124
|
const equals_collect_items = equalsArray(existing_collect, incoming_collect, (existing_collect_item, incoming_collect_item) => {
|
|
1092
|
-
if (!(equals$
|
|
1125
|
+
if (!(equals$6(existing_collect_item, incoming_collect_item))) {
|
|
1093
1126
|
return false;
|
|
1094
1127
|
}
|
|
1095
1128
|
});
|
|
@@ -1107,7 +1140,7 @@ function equals$3(existing, incoming) {
|
|
|
1107
1140
|
return false;
|
|
1108
1141
|
}
|
|
1109
1142
|
const equals_confirm_items = equalsArray(existing_confirm, incoming_confirm, (existing_confirm_item, incoming_confirm_item) => {
|
|
1110
|
-
if (!(equals$
|
|
1143
|
+
if (!(equals$8(existing_confirm_item, incoming_confirm_item))) {
|
|
1111
1144
|
return false;
|
|
1112
1145
|
}
|
|
1113
1146
|
});
|
|
@@ -1159,6 +1192,19 @@ function equals$3(existing, incoming) {
|
|
|
1159
1192
|
return false;
|
|
1160
1193
|
}
|
|
1161
1194
|
}
|
|
1195
|
+
const existing_isContentSafe = existing.isContentSafe;
|
|
1196
|
+
const incoming_isContentSafe = incoming.isContentSafe;
|
|
1197
|
+
// if at least one of these optionals is defined
|
|
1198
|
+
if (existing_isContentSafe !== undefined || incoming_isContentSafe !== undefined) {
|
|
1199
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1200
|
+
// not equal
|
|
1201
|
+
if (existing_isContentSafe === undefined || incoming_isContentSafe === undefined) {
|
|
1202
|
+
return false;
|
|
1203
|
+
}
|
|
1204
|
+
if (!(existing_isContentSafe === incoming_isContentSafe)) {
|
|
1205
|
+
return false;
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1162
1208
|
const existing_message = existing.message;
|
|
1163
1209
|
const incoming_message = incoming.message;
|
|
1164
1210
|
// if at least one of these optionals is defined
|
|
@@ -1208,7 +1254,7 @@ function equals$3(existing, incoming) {
|
|
|
1208
1254
|
return false;
|
|
1209
1255
|
}
|
|
1210
1256
|
const equals_result_items = equalsArray(existing_result, incoming_result, (existing_result_item, incoming_result_item) => {
|
|
1211
|
-
if (!(equals$
|
|
1257
|
+
if (!(equals$8(existing_result_item, incoming_result_item))) {
|
|
1212
1258
|
return false;
|
|
1213
1259
|
}
|
|
1214
1260
|
});
|
|
@@ -1244,31 +1290,31 @@ function equals$3(existing, incoming) {
|
|
|
1244
1290
|
}
|
|
1245
1291
|
return true;
|
|
1246
1292
|
}
|
|
1247
|
-
const ingest$
|
|
1293
|
+
const ingest$3 = function ConversationRuntimeProxyMessageRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1248
1294
|
if (process.env.NODE_ENV !== 'production') {
|
|
1249
|
-
const validateError = validate$
|
|
1295
|
+
const validateError = validate$5(input);
|
|
1250
1296
|
if (validateError !== null) {
|
|
1251
1297
|
throw validateError;
|
|
1252
1298
|
}
|
|
1253
1299
|
}
|
|
1254
1300
|
const key = keyBuilderFromType$1(luvio, input);
|
|
1255
|
-
const ttlToUse = TTL$
|
|
1256
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
1301
|
+
const ttlToUse = TTL$3;
|
|
1302
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "einstein-copilot-bot", VERSION$5, RepresentationType$3, equals$5);
|
|
1257
1303
|
return createLink(key);
|
|
1258
1304
|
};
|
|
1259
|
-
function getTypeCacheKeys$
|
|
1305
|
+
function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
|
|
1260
1306
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1261
1307
|
const rootKey = keyBuilderFromType$1(luvio, input);
|
|
1262
1308
|
rootKeySet.set(rootKey, {
|
|
1263
1309
|
namespace: keyPrefix,
|
|
1264
|
-
representationName: RepresentationType$
|
|
1310
|
+
representationName: RepresentationType$3,
|
|
1265
1311
|
mergeable: false
|
|
1266
1312
|
});
|
|
1267
1313
|
}
|
|
1268
1314
|
|
|
1269
|
-
const TTL$
|
|
1270
|
-
const VERSION$
|
|
1271
|
-
function validate$
|
|
1315
|
+
const TTL$2 = 30000;
|
|
1316
|
+
const VERSION$4 = "fe7024fb1132250f97d9616482f09f99";
|
|
1317
|
+
function validate$4(obj, path = 'ConversationRuntimeProxyRepresentation') {
|
|
1272
1318
|
const v_error = (() => {
|
|
1273
1319
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1274
1320
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1320,23 +1366,23 @@ function validate$2(obj, path = 'ConversationRuntimeProxyRepresentation') {
|
|
|
1320
1366
|
})();
|
|
1321
1367
|
return v_error === undefined ? null : v_error;
|
|
1322
1368
|
}
|
|
1323
|
-
const RepresentationType$
|
|
1324
|
-
function keyBuilder$
|
|
1325
|
-
return keyPrefix + '::' + RepresentationType$
|
|
1369
|
+
const RepresentationType$2 = 'ConversationRuntimeProxyRepresentation';
|
|
1370
|
+
function keyBuilder$4(luvio, config) {
|
|
1371
|
+
return keyPrefix + '::' + RepresentationType$2 + ':' + config.id;
|
|
1326
1372
|
}
|
|
1327
1373
|
function keyBuilderFromType(luvio, object) {
|
|
1328
1374
|
const keyParams = {
|
|
1329
1375
|
id: object.requestId
|
|
1330
1376
|
};
|
|
1331
|
-
return keyBuilder$
|
|
1377
|
+
return keyBuilder$4(luvio, keyParams);
|
|
1332
1378
|
}
|
|
1333
|
-
function normalize$
|
|
1379
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
1334
1380
|
const input_messages = input.messages;
|
|
1335
1381
|
const input_messages_id = path.fullPath + '__messages';
|
|
1336
1382
|
for (let i = 0; i < input_messages.length; i++) {
|
|
1337
1383
|
const input_messages_item = input_messages[i];
|
|
1338
1384
|
let input_messages_item_id = input_messages_id + '__' + i;
|
|
1339
|
-
input_messages[i] = ingest$
|
|
1385
|
+
input_messages[i] = ingest$3(input_messages_item, {
|
|
1340
1386
|
fullPath: input_messages_item_id,
|
|
1341
1387
|
propertyName: i,
|
|
1342
1388
|
parent: {
|
|
@@ -1349,10 +1395,10 @@ function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
|
1349
1395
|
}
|
|
1350
1396
|
return input;
|
|
1351
1397
|
}
|
|
1352
|
-
const select$
|
|
1398
|
+
const select$7 = function ConversationRuntimeProxyRepresentationSelect() {
|
|
1353
1399
|
return {
|
|
1354
1400
|
kind: 'Fragment',
|
|
1355
|
-
version: VERSION$
|
|
1401
|
+
version: VERSION$4,
|
|
1356
1402
|
private: [],
|
|
1357
1403
|
selections: [
|
|
1358
1404
|
{
|
|
@@ -1367,7 +1413,7 @@ const select$4 = function ConversationRuntimeProxyRepresentationSelect() {
|
|
|
1367
1413
|
name: 'messages',
|
|
1368
1414
|
kind: 'Link',
|
|
1369
1415
|
plural: true,
|
|
1370
|
-
fragment: select$
|
|
1416
|
+
fragment: select$8()
|
|
1371
1417
|
},
|
|
1372
1418
|
{
|
|
1373
1419
|
name: 'processedSequenceIds',
|
|
@@ -1385,7 +1431,7 @@ const select$4 = function ConversationRuntimeProxyRepresentationSelect() {
|
|
|
1385
1431
|
]
|
|
1386
1432
|
};
|
|
1387
1433
|
};
|
|
1388
|
-
function equals$
|
|
1434
|
+
function equals$4(existing, incoming) {
|
|
1389
1435
|
const existing_botId = existing.botId;
|
|
1390
1436
|
const incoming_botId = incoming.botId;
|
|
1391
1437
|
if (!(existing_botId === incoming_botId)) {
|
|
@@ -1428,45 +1474,45 @@ function equals$2(existing, incoming) {
|
|
|
1428
1474
|
}
|
|
1429
1475
|
return true;
|
|
1430
1476
|
}
|
|
1431
|
-
const ingest$
|
|
1477
|
+
const ingest$2 = function ConversationRuntimeProxyRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1432
1478
|
if (process.env.NODE_ENV !== 'production') {
|
|
1433
|
-
const validateError = validate$
|
|
1479
|
+
const validateError = validate$4(input);
|
|
1434
1480
|
if (validateError !== null) {
|
|
1435
1481
|
throw validateError;
|
|
1436
1482
|
}
|
|
1437
1483
|
}
|
|
1438
1484
|
const key = keyBuilderFromType(luvio, input);
|
|
1439
|
-
const ttlToUse = TTL$
|
|
1440
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
1485
|
+
const ttlToUse = TTL$2;
|
|
1486
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "einstein-copilot-bot", VERSION$4, RepresentationType$2, equals$4);
|
|
1441
1487
|
return createLink(key);
|
|
1442
1488
|
};
|
|
1443
|
-
function getTypeCacheKeys$
|
|
1489
|
+
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
1444
1490
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1445
1491
|
const rootKey = keyBuilderFromType(luvio, input);
|
|
1446
1492
|
rootKeySet.set(rootKey, {
|
|
1447
1493
|
namespace: keyPrefix,
|
|
1448
|
-
representationName: RepresentationType$
|
|
1494
|
+
representationName: RepresentationType$2,
|
|
1449
1495
|
mergeable: false
|
|
1450
1496
|
});
|
|
1451
1497
|
const input_messages_length = input.messages.length;
|
|
1452
1498
|
for (let i = 0; i < input_messages_length; i++) {
|
|
1453
|
-
getTypeCacheKeys$
|
|
1499
|
+
getTypeCacheKeys$3(rootKeySet, luvio, input.messages[i]);
|
|
1454
1500
|
}
|
|
1455
1501
|
}
|
|
1456
1502
|
|
|
1457
|
-
function select$
|
|
1458
|
-
return select$
|
|
1503
|
+
function select$6(luvio, params) {
|
|
1504
|
+
return select$7();
|
|
1459
1505
|
}
|
|
1460
|
-
function getResponseCacheKeys$
|
|
1461
|
-
getTypeCacheKeys$
|
|
1506
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
1507
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response);
|
|
1462
1508
|
}
|
|
1463
|
-
function ingestSuccess$
|
|
1509
|
+
function ingestSuccess$2(luvio, resourceParams, response) {
|
|
1464
1510
|
const { body } = response;
|
|
1465
1511
|
const key = keyBuilderFromType(luvio, body);
|
|
1466
|
-
luvio.storeIngest(key, ingest$
|
|
1512
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
1467
1513
|
const snapshot = luvio.storeLookup({
|
|
1468
1514
|
recordId: key,
|
|
1469
|
-
node: select$
|
|
1515
|
+
node: select$6(),
|
|
1470
1516
|
variables: {},
|
|
1471
1517
|
});
|
|
1472
1518
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -1477,7 +1523,7 @@ function ingestSuccess$1(luvio, resourceParams, response) {
|
|
|
1477
1523
|
deepFreeze(snapshot.data);
|
|
1478
1524
|
return snapshot;
|
|
1479
1525
|
}
|
|
1480
|
-
function createResourceRequest$
|
|
1526
|
+
function createResourceRequest$2(config) {
|
|
1481
1527
|
const headers = {};
|
|
1482
1528
|
return {
|
|
1483
1529
|
baseUri: '/services/data/v60.0',
|
|
@@ -1491,7 +1537,7 @@ function createResourceRequest$1(config) {
|
|
|
1491
1537
|
};
|
|
1492
1538
|
}
|
|
1493
1539
|
|
|
1494
|
-
const adapterName$
|
|
1540
|
+
const adapterName$2 = 'sendMessage';
|
|
1495
1541
|
const sendMessage_ConfigPropertyMetadata = [
|
|
1496
1542
|
generateParamConfigMetadata('botId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1497
1543
|
generateParamConfigMetadata('botVersionId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
@@ -1508,11 +1554,11 @@ const sendMessage_ConfigPropertyMetadata = [
|
|
|
1508
1554
|
generateParamConfigMetadata('userUtterance', false, 2 /* Body */, 0 /* String */),
|
|
1509
1555
|
generateParamConfigMetadata('variables', false, 2 /* Body */, 4 /* Unsupported */, true),
|
|
1510
1556
|
];
|
|
1511
|
-
const sendMessage_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
1512
|
-
const createResourceParams$
|
|
1513
|
-
function typeCheckConfig$
|
|
1557
|
+
const sendMessage_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, sendMessage_ConfigPropertyMetadata);
|
|
1558
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$4(sendMessage_ConfigPropertyMetadata);
|
|
1559
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
1514
1560
|
const config = {};
|
|
1515
|
-
typeCheckConfig$
|
|
1561
|
+
typeCheckConfig$4(untrustedConfig, config, sendMessage_ConfigPropertyMetadata);
|
|
1516
1562
|
const untrustedConfig_planTemplateVariables = untrustedConfig.planTemplateVariables;
|
|
1517
1563
|
config.planTemplateVariables = untrustedConfig_planTemplateVariables;
|
|
1518
1564
|
const untrustedConfig_reply = untrustedConfig.reply;
|
|
@@ -1520,7 +1566,7 @@ function typeCheckConfig$1(untrustedConfig) {
|
|
|
1520
1566
|
const untrustedConfig_reply_array = [];
|
|
1521
1567
|
for (let i = 0, arrayLength = untrustedConfig_reply.length; i < arrayLength; i++) {
|
|
1522
1568
|
const untrustedConfig_reply_item = untrustedConfig_reply[i];
|
|
1523
|
-
const referenceEsTypeMessageRepresentationValidationError = validate$
|
|
1569
|
+
const referenceEsTypeMessageRepresentationValidationError = validate$9(untrustedConfig_reply_item);
|
|
1524
1570
|
if (referenceEsTypeMessageRepresentationValidationError === null) {
|
|
1525
1571
|
untrustedConfig_reply_array.push(untrustedConfig_reply_item);
|
|
1526
1572
|
}
|
|
@@ -1532,7 +1578,7 @@ function typeCheckConfig$1(untrustedConfig) {
|
|
|
1532
1578
|
const untrustedConfig_variables_array = [];
|
|
1533
1579
|
for (let i = 0, arrayLength = untrustedConfig_variables.length; i < arrayLength; i++) {
|
|
1534
1580
|
const untrustedConfig_variables_item = untrustedConfig_variables[i];
|
|
1535
|
-
const referenceVariableRepresentationValidationError = validate$
|
|
1581
|
+
const referenceVariableRepresentationValidationError = validate$8(untrustedConfig_variables_item);
|
|
1536
1582
|
if (referenceVariableRepresentationValidationError === null) {
|
|
1537
1583
|
untrustedConfig_variables_array.push(untrustedConfig_variables_item);
|
|
1538
1584
|
}
|
|
@@ -1541,30 +1587,30 @@ function typeCheckConfig$1(untrustedConfig) {
|
|
|
1541
1587
|
}
|
|
1542
1588
|
return config;
|
|
1543
1589
|
}
|
|
1544
|
-
function validateAdapterConfig$
|
|
1590
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
1545
1591
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
1546
1592
|
return null;
|
|
1547
1593
|
}
|
|
1548
1594
|
if (process.env.NODE_ENV !== 'production') {
|
|
1549
1595
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
1550
1596
|
}
|
|
1551
|
-
const config = typeCheckConfig$
|
|
1597
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
1552
1598
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1553
1599
|
return null;
|
|
1554
1600
|
}
|
|
1555
1601
|
return config;
|
|
1556
1602
|
}
|
|
1557
|
-
function buildNetworkSnapshot$
|
|
1558
|
-
const resourceParams = createResourceParams$
|
|
1559
|
-
const request = createResourceRequest$
|
|
1603
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
1604
|
+
const resourceParams = createResourceParams$2(config);
|
|
1605
|
+
const request = createResourceRequest$2(resourceParams);
|
|
1560
1606
|
return luvio.dispatchResourceRequest(request, options)
|
|
1561
1607
|
.then((response) => {
|
|
1562
1608
|
return luvio.handleSuccessResponse(() => {
|
|
1563
|
-
const snapshot = ingestSuccess$
|
|
1609
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response);
|
|
1564
1610
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1565
1611
|
}, () => {
|
|
1566
1612
|
const cache = new StoreKeyMap();
|
|
1567
|
-
getResponseCacheKeys$
|
|
1613
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
1568
1614
|
return cache;
|
|
1569
1615
|
});
|
|
1570
1616
|
}, (response) => {
|
|
@@ -1574,17 +1620,17 @@ function buildNetworkSnapshot$1(luvio, config, options) {
|
|
|
1574
1620
|
}
|
|
1575
1621
|
const sendMessageAdapterFactory = (luvio) => {
|
|
1576
1622
|
return function sendMessage(untrustedConfig) {
|
|
1577
|
-
const config = validateAdapterConfig$
|
|
1623
|
+
const config = validateAdapterConfig$2(untrustedConfig, sendMessage_ConfigPropertyNames);
|
|
1578
1624
|
// Invalid or incomplete config
|
|
1579
1625
|
if (config === null) {
|
|
1580
1626
|
throw new Error('Invalid config for "sendMessage"');
|
|
1581
1627
|
}
|
|
1582
|
-
return buildNetworkSnapshot$
|
|
1628
|
+
return buildNetworkSnapshot$2(luvio, config);
|
|
1583
1629
|
};
|
|
1584
1630
|
};
|
|
1585
1631
|
|
|
1586
|
-
const VERSION$
|
|
1587
|
-
function validate$
|
|
1632
|
+
const VERSION$3 = "504437088c2317480c651ac05a7565b5";
|
|
1633
|
+
function validate$3(obj, path = 'PlanTemplateRepresentation') {
|
|
1588
1634
|
const v_error = (() => {
|
|
1589
1635
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1590
1636
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1626,10 +1672,10 @@ function validate$1(obj, path = 'PlanTemplateRepresentation') {
|
|
|
1626
1672
|
})();
|
|
1627
1673
|
return v_error === undefined ? null : v_error;
|
|
1628
1674
|
}
|
|
1629
|
-
const select$
|
|
1675
|
+
const select$5 = function PlanTemplateRepresentationSelect() {
|
|
1630
1676
|
return {
|
|
1631
1677
|
kind: 'Fragment',
|
|
1632
|
-
version: VERSION$
|
|
1678
|
+
version: VERSION$3,
|
|
1633
1679
|
private: [],
|
|
1634
1680
|
selections: [
|
|
1635
1681
|
{
|
|
@@ -1656,7 +1702,7 @@ const select$2 = function PlanTemplateRepresentationSelect() {
|
|
|
1656
1702
|
]
|
|
1657
1703
|
};
|
|
1658
1704
|
};
|
|
1659
|
-
function equals$
|
|
1705
|
+
function equals$3(existing, incoming) {
|
|
1660
1706
|
const existing_intent = existing.intent;
|
|
1661
1707
|
const incoming_intent = incoming.intent;
|
|
1662
1708
|
if (!(existing_intent === incoming_intent)) {
|
|
@@ -1690,9 +1736,9 @@ function equals$1(existing, incoming) {
|
|
|
1690
1736
|
return true;
|
|
1691
1737
|
}
|
|
1692
1738
|
|
|
1693
|
-
const TTL = 900000;
|
|
1694
|
-
const VERSION = "0503b0c5ce250e7f5fbf16f2d3f2fec4";
|
|
1695
|
-
function validate(obj, path = 'RecommendedPlanTemplatesRepresentation') {
|
|
1739
|
+
const TTL$1 = 900000;
|
|
1740
|
+
const VERSION$2 = "0503b0c5ce250e7f5fbf16f2d3f2fec4";
|
|
1741
|
+
function validate$2(obj, path = 'RecommendedPlanTemplatesRepresentation') {
|
|
1696
1742
|
const v_error = (() => {
|
|
1697
1743
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1698
1744
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1717,7 +1763,7 @@ function validate(obj, path = 'RecommendedPlanTemplatesRepresentation') {
|
|
|
1717
1763
|
for (let i = 0; i < obj_planTemplates.length; i++) {
|
|
1718
1764
|
const obj_planTemplates_item = obj_planTemplates[i];
|
|
1719
1765
|
const path_planTemplates_item = path_planTemplates + '[' + i + ']';
|
|
1720
|
-
const referencepath_planTemplates_itemValidationError = validate$
|
|
1766
|
+
const referencepath_planTemplates_itemValidationError = validate$3(obj_planTemplates_item, path_planTemplates_item);
|
|
1721
1767
|
if (referencepath_planTemplates_itemValidationError !== null) {
|
|
1722
1768
|
let message = 'Object doesn\'t match PlanTemplateRepresentation (at "' + path_planTemplates_item + '")\n';
|
|
1723
1769
|
message += referencepath_planTemplates_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1727,15 +1773,15 @@ function validate(obj, path = 'RecommendedPlanTemplatesRepresentation') {
|
|
|
1727
1773
|
})();
|
|
1728
1774
|
return v_error === undefined ? null : v_error;
|
|
1729
1775
|
}
|
|
1730
|
-
const RepresentationType = 'RecommendedPlanTemplatesRepresentation';
|
|
1731
|
-
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
1776
|
+
const RepresentationType$1 = 'RecommendedPlanTemplatesRepresentation';
|
|
1777
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
1732
1778
|
return input;
|
|
1733
1779
|
}
|
|
1734
|
-
const select$
|
|
1735
|
-
const { selections: PlanTemplateRepresentation__selections, opaque: PlanTemplateRepresentation__opaque, } = select$
|
|
1780
|
+
const select$4 = function RecommendedPlanTemplatesRepresentationSelect() {
|
|
1781
|
+
const { selections: PlanTemplateRepresentation__selections, opaque: PlanTemplateRepresentation__opaque, } = select$5();
|
|
1736
1782
|
return {
|
|
1737
1783
|
kind: 'Fragment',
|
|
1738
|
-
version: VERSION,
|
|
1784
|
+
version: VERSION$2,
|
|
1739
1785
|
private: [],
|
|
1740
1786
|
selections: [
|
|
1741
1787
|
{
|
|
@@ -1756,7 +1802,7 @@ const select$1 = function RecommendedPlanTemplatesRepresentationSelect() {
|
|
|
1756
1802
|
]
|
|
1757
1803
|
};
|
|
1758
1804
|
};
|
|
1759
|
-
function equals(existing, incoming) {
|
|
1805
|
+
function equals$2(existing, incoming) {
|
|
1760
1806
|
const existing_isSuccess = existing.isSuccess;
|
|
1761
1807
|
const incoming_isSuccess = incoming.isSuccess;
|
|
1762
1808
|
if (!(existing_isSuccess === incoming_isSuccess)) {
|
|
@@ -1778,7 +1824,7 @@ function equals(existing, incoming) {
|
|
|
1778
1824
|
const existing_planTemplates = existing.planTemplates;
|
|
1779
1825
|
const incoming_planTemplates = incoming.planTemplates;
|
|
1780
1826
|
const equals_planTemplates_items = equalsArray(existing_planTemplates, incoming_planTemplates, (existing_planTemplates_item, incoming_planTemplates_item) => {
|
|
1781
|
-
if (!(equals$
|
|
1827
|
+
if (!(equals$3(existing_planTemplates_item, incoming_planTemplates_item))) {
|
|
1782
1828
|
return false;
|
|
1783
1829
|
}
|
|
1784
1830
|
});
|
|
@@ -1787,44 +1833,44 @@ function equals(existing, incoming) {
|
|
|
1787
1833
|
}
|
|
1788
1834
|
return true;
|
|
1789
1835
|
}
|
|
1790
|
-
const ingest = function RecommendedPlanTemplatesRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1836
|
+
const ingest$1 = function RecommendedPlanTemplatesRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1791
1837
|
if (process.env.NODE_ENV !== 'production') {
|
|
1792
|
-
const validateError = validate(input);
|
|
1838
|
+
const validateError = validate$2(input);
|
|
1793
1839
|
if (validateError !== null) {
|
|
1794
1840
|
throw validateError;
|
|
1795
1841
|
}
|
|
1796
1842
|
}
|
|
1797
1843
|
const key = path.fullPath;
|
|
1798
|
-
const ttlToUse = TTL;
|
|
1799
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "einstein-copilot-bot", VERSION, RepresentationType, equals);
|
|
1844
|
+
const ttlToUse = TTL$1;
|
|
1845
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "einstein-copilot-bot", VERSION$2, RepresentationType$1, equals$2);
|
|
1800
1846
|
return createLink(key);
|
|
1801
1847
|
};
|
|
1802
|
-
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
1848
|
+
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
1803
1849
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1804
1850
|
const rootKey = fullPathFactory();
|
|
1805
1851
|
rootKeySet.set(rootKey, {
|
|
1806
1852
|
namespace: keyPrefix,
|
|
1807
|
-
representationName: RepresentationType,
|
|
1853
|
+
representationName: RepresentationType$1,
|
|
1808
1854
|
mergeable: false
|
|
1809
1855
|
});
|
|
1810
1856
|
}
|
|
1811
1857
|
|
|
1812
|
-
function select(luvio, params) {
|
|
1813
|
-
return select$
|
|
1858
|
+
function select$3(luvio, params) {
|
|
1859
|
+
return select$4();
|
|
1814
1860
|
}
|
|
1815
|
-
function keyBuilder$
|
|
1861
|
+
function keyBuilder$3(luvio, params) {
|
|
1816
1862
|
return keyPrefix + '::RecommendedPlanTemplatesRepresentation:(' + 'pageType:' + params.urlParams.pageType + ',' + 'objectType:' + params.urlParams.objectType + ')';
|
|
1817
1863
|
}
|
|
1818
|
-
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
1819
|
-
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$
|
|
1864
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
1865
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$3(luvio, resourceParams));
|
|
1820
1866
|
}
|
|
1821
|
-
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
1867
|
+
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
1822
1868
|
const { body } = response;
|
|
1823
|
-
const key = keyBuilder$
|
|
1824
|
-
luvio.storeIngest(key, ingest, body);
|
|
1869
|
+
const key = keyBuilder$3(luvio, resourceParams);
|
|
1870
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
1825
1871
|
const snapshot = luvio.storeLookup({
|
|
1826
1872
|
recordId: key,
|
|
1827
|
-
node: select(),
|
|
1873
|
+
node: select$3(),
|
|
1828
1874
|
variables: {},
|
|
1829
1875
|
}, snapshotRefresh);
|
|
1830
1876
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -1835,19 +1881,19 @@ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
1835
1881
|
deepFreeze(snapshot.data);
|
|
1836
1882
|
return snapshot;
|
|
1837
1883
|
}
|
|
1838
|
-
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
1839
|
-
const key = keyBuilder$
|
|
1884
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
1885
|
+
const key = keyBuilder$3(luvio, params);
|
|
1840
1886
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1841
1887
|
const storeMetadataParams = {
|
|
1842
|
-
ttl: TTL,
|
|
1888
|
+
ttl: TTL$1,
|
|
1843
1889
|
namespace: keyPrefix,
|
|
1844
|
-
version: VERSION,
|
|
1845
|
-
representationName: RepresentationType
|
|
1890
|
+
version: VERSION$2,
|
|
1891
|
+
representationName: RepresentationType$1
|
|
1846
1892
|
};
|
|
1847
1893
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1848
1894
|
return errorSnapshot;
|
|
1849
1895
|
}
|
|
1850
|
-
function createResourceRequest(config) {
|
|
1896
|
+
function createResourceRequest$1(config) {
|
|
1851
1897
|
const headers = {};
|
|
1852
1898
|
return {
|
|
1853
1899
|
baseUri: '/services/data/v60.0',
|
|
@@ -1861,85 +1907,760 @@ function createResourceRequest(config) {
|
|
|
1861
1907
|
};
|
|
1862
1908
|
}
|
|
1863
1909
|
|
|
1864
|
-
const adapterName = 'getRecommendedPlanTemplates';
|
|
1910
|
+
const adapterName$1 = 'getRecommendedPlanTemplates';
|
|
1865
1911
|
const getRecommendedPlanTemplates_ConfigPropertyMetadata = [
|
|
1866
1912
|
generateParamConfigMetadata('pageType', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1867
1913
|
generateParamConfigMetadata('objectType', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1868
1914
|
];
|
|
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$
|
|
1915
|
+
const getRecommendedPlanTemplates_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getRecommendedPlanTemplates_ConfigPropertyMetadata);
|
|
1916
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$4(getRecommendedPlanTemplates_ConfigPropertyMetadata);
|
|
1917
|
+
function keyBuilder$2(luvio, config) {
|
|
1918
|
+
const resourceParams = createResourceParams$1(config);
|
|
1919
|
+
return keyBuilder$3(luvio, resourceParams);
|
|
1874
1920
|
}
|
|
1875
|
-
function typeCheckConfig(untrustedConfig) {
|
|
1921
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
1876
1922
|
const config = {};
|
|
1877
|
-
typeCheckConfig$
|
|
1923
|
+
typeCheckConfig$4(untrustedConfig, config, getRecommendedPlanTemplates_ConfigPropertyMetadata);
|
|
1878
1924
|
return config;
|
|
1879
1925
|
}
|
|
1880
|
-
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
1926
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
1881
1927
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
1882
1928
|
return null;
|
|
1883
1929
|
}
|
|
1884
1930
|
if (process.env.NODE_ENV !== 'production') {
|
|
1885
1931
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
1886
1932
|
}
|
|
1887
|
-
const config = typeCheckConfig(untrustedConfig);
|
|
1933
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
1888
1934
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1889
1935
|
return null;
|
|
1890
1936
|
}
|
|
1891
1937
|
return config;
|
|
1892
1938
|
}
|
|
1893
|
-
function adapterFragment(luvio, config) {
|
|
1894
|
-
createResourceParams(config);
|
|
1895
|
-
return select();
|
|
1939
|
+
function adapterFragment$1(luvio, config) {
|
|
1940
|
+
createResourceParams$1(config);
|
|
1941
|
+
return select$3();
|
|
1896
1942
|
}
|
|
1897
|
-
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
1898
|
-
const snapshot = ingestSuccess(luvio, resourceParams, response, {
|
|
1943
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
1944
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
|
|
1899
1945
|
config,
|
|
1900
|
-
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
1946
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
1901
1947
|
});
|
|
1902
1948
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1903
1949
|
}
|
|
1904
|
-
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
1905
|
-
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
1950
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
1951
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
1906
1952
|
config,
|
|
1907
|
-
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
1953
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
1908
1954
|
});
|
|
1909
1955
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1910
1956
|
}
|
|
1911
|
-
function buildNetworkSnapshot(luvio, config, options) {
|
|
1912
|
-
const resourceParams = createResourceParams(config);
|
|
1913
|
-
const request = createResourceRequest(resourceParams);
|
|
1957
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
1958
|
+
const resourceParams = createResourceParams$1(config);
|
|
1959
|
+
const request = createResourceRequest$1(resourceParams);
|
|
1914
1960
|
return luvio.dispatchResourceRequest(request, options)
|
|
1915
1961
|
.then((response) => {
|
|
1916
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
1962
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
|
|
1917
1963
|
const cache = new StoreKeyMap();
|
|
1918
|
-
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
1964
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
1919
1965
|
return cache;
|
|
1920
1966
|
});
|
|
1921
1967
|
}, (response) => {
|
|
1922
|
-
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
1968
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
1923
1969
|
});
|
|
1924
1970
|
}
|
|
1925
|
-
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
1926
|
-
return buildNetworkSnapshotCachePolicy$
|
|
1971
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
1972
|
+
return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
|
|
1927
1973
|
}
|
|
1928
|
-
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
1974
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
1929
1975
|
const { luvio, config } = context;
|
|
1930
1976
|
const selector = {
|
|
1931
|
-
recordId: keyBuilder(luvio, config),
|
|
1932
|
-
node: adapterFragment(luvio, config),
|
|
1977
|
+
recordId: keyBuilder$2(luvio, config),
|
|
1978
|
+
node: adapterFragment$1(luvio, config),
|
|
1933
1979
|
variables: {},
|
|
1934
1980
|
};
|
|
1935
1981
|
const cacheSnapshot = storeLookup(selector, {
|
|
1936
1982
|
config,
|
|
1937
|
-
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
1983
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
1938
1984
|
});
|
|
1939
1985
|
return cacheSnapshot;
|
|
1940
1986
|
}
|
|
1941
1987
|
const getRecommendedPlanTemplatesAdapterFactory = (luvio) => function einsteinCopilotBot__getRecommendedPlanTemplates(untrustedConfig, requestContext) {
|
|
1942
|
-
const config = validateAdapterConfig(untrustedConfig, getRecommendedPlanTemplates_ConfigPropertyNames);
|
|
1988
|
+
const config = validateAdapterConfig$1(untrustedConfig, getRecommendedPlanTemplates_ConfigPropertyNames);
|
|
1989
|
+
// Invalid or incomplete config
|
|
1990
|
+
if (config === null) {
|
|
1991
|
+
return null;
|
|
1992
|
+
}
|
|
1993
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1994
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
1995
|
+
};
|
|
1996
|
+
|
|
1997
|
+
const VERSION$1 = "3d8b52828ddd11f23f898b0bba8db802";
|
|
1998
|
+
function validate$1(obj, path = 'CopilotQuickActionRepresentation') {
|
|
1999
|
+
const v_error = (() => {
|
|
2000
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2001
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2002
|
+
}
|
|
2003
|
+
if (obj.actionApiName !== undefined) {
|
|
2004
|
+
const obj_actionApiName = obj.actionApiName;
|
|
2005
|
+
const path_actionApiName = path + '.actionApiName';
|
|
2006
|
+
if (typeof obj_actionApiName !== 'string') {
|
|
2007
|
+
return new TypeError('Expected "string" but received "' + typeof obj_actionApiName + '" (at "' + path_actionApiName + '")');
|
|
2008
|
+
}
|
|
2009
|
+
}
|
|
2010
|
+
if (obj.createdDate !== undefined) {
|
|
2011
|
+
const obj_createdDate = obj.createdDate;
|
|
2012
|
+
const path_createdDate = path + '.createdDate';
|
|
2013
|
+
if (typeof obj_createdDate !== 'string') {
|
|
2014
|
+
return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
|
|
2015
|
+
}
|
|
2016
|
+
}
|
|
2017
|
+
if (obj.description !== undefined) {
|
|
2018
|
+
const obj_description = obj.description;
|
|
2019
|
+
const path_description = path + '.description';
|
|
2020
|
+
if (typeof obj_description !== 'string') {
|
|
2021
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
2022
|
+
}
|
|
2023
|
+
}
|
|
2024
|
+
if (obj.icon !== undefined) {
|
|
2025
|
+
const obj_icon = obj.icon;
|
|
2026
|
+
const path_icon = path + '.icon';
|
|
2027
|
+
if (typeof obj_icon !== 'string') {
|
|
2028
|
+
return new TypeError('Expected "string" but received "' + typeof obj_icon + '" (at "' + path_icon + '")');
|
|
2029
|
+
}
|
|
2030
|
+
}
|
|
2031
|
+
if (obj.intent !== undefined) {
|
|
2032
|
+
const obj_intent = obj.intent;
|
|
2033
|
+
const path_intent = path + '.intent';
|
|
2034
|
+
if (typeof obj_intent !== 'string') {
|
|
2035
|
+
return new TypeError('Expected "string" but received "' + typeof obj_intent + '" (at "' + path_intent + '")');
|
|
2036
|
+
}
|
|
2037
|
+
}
|
|
2038
|
+
if (obj.isGlobal !== undefined) {
|
|
2039
|
+
const obj_isGlobal = obj.isGlobal;
|
|
2040
|
+
const path_isGlobal = path + '.isGlobal';
|
|
2041
|
+
if (typeof obj_isGlobal !== 'boolean') {
|
|
2042
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isGlobal + '" (at "' + path_isGlobal + '")');
|
|
2043
|
+
}
|
|
2044
|
+
}
|
|
2045
|
+
if (obj.isStandard !== undefined) {
|
|
2046
|
+
const obj_isStandard = obj.isStandard;
|
|
2047
|
+
const path_isStandard = path + '.isStandard';
|
|
2048
|
+
if (typeof obj_isStandard !== 'boolean') {
|
|
2049
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isStandard + '" (at "' + path_isStandard + '")');
|
|
2050
|
+
}
|
|
2051
|
+
}
|
|
2052
|
+
if (obj.label !== undefined) {
|
|
2053
|
+
const obj_label = obj.label;
|
|
2054
|
+
const path_label = path + '.label';
|
|
2055
|
+
if (typeof obj_label !== 'string') {
|
|
2056
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
2057
|
+
}
|
|
2058
|
+
}
|
|
2059
|
+
if (obj.lastModifiedDate !== undefined) {
|
|
2060
|
+
const obj_lastModifiedDate = obj.lastModifiedDate;
|
|
2061
|
+
const path_lastModifiedDate = path + '.lastModifiedDate';
|
|
2062
|
+
if (typeof obj_lastModifiedDate !== 'string') {
|
|
2063
|
+
return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
|
|
2064
|
+
}
|
|
2065
|
+
}
|
|
2066
|
+
if (obj.namespace !== undefined) {
|
|
2067
|
+
const obj_namespace = obj.namespace;
|
|
2068
|
+
const path_namespace = path + '.namespace';
|
|
2069
|
+
if (typeof obj_namespace !== 'string') {
|
|
2070
|
+
return new TypeError('Expected "string" but received "' + typeof obj_namespace + '" (at "' + path_namespace + '")');
|
|
2071
|
+
}
|
|
2072
|
+
}
|
|
2073
|
+
if (obj.orgAccess !== undefined) {
|
|
2074
|
+
const obj_orgAccess = obj.orgAccess;
|
|
2075
|
+
const path_orgAccess = path + '.orgAccess';
|
|
2076
|
+
if (typeof obj_orgAccess !== 'string') {
|
|
2077
|
+
return new TypeError('Expected "string" but received "' + typeof obj_orgAccess + '" (at "' + path_orgAccess + '")');
|
|
2078
|
+
}
|
|
2079
|
+
}
|
|
2080
|
+
if (obj.planTemplateId !== undefined) {
|
|
2081
|
+
const obj_planTemplateId = obj.planTemplateId;
|
|
2082
|
+
const path_planTemplateId = path + '.planTemplateId';
|
|
2083
|
+
if (typeof obj_planTemplateId !== 'string') {
|
|
2084
|
+
return new TypeError('Expected "string" but received "' + typeof obj_planTemplateId + '" (at "' + path_planTemplateId + '")');
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
if (obj.planTemplateInput !== undefined) {
|
|
2088
|
+
const obj_planTemplateInput = obj.planTemplateInput;
|
|
2089
|
+
const path_planTemplateInput = path + '.planTemplateInput';
|
|
2090
|
+
if (typeof obj_planTemplateInput !== 'object' || ArrayIsArray(obj_planTemplateInput) || obj_planTemplateInput === null) {
|
|
2091
|
+
return new TypeError('Expected "object" but received "' + typeof obj_planTemplateInput + '" (at "' + path_planTemplateInput + '")');
|
|
2092
|
+
}
|
|
2093
|
+
const obj_planTemplateInput_keys = ObjectKeys(obj_planTemplateInput);
|
|
2094
|
+
for (let i = 0; i < obj_planTemplateInput_keys.length; i++) {
|
|
2095
|
+
const key = obj_planTemplateInput_keys[i];
|
|
2096
|
+
const obj_planTemplateInput_prop = obj_planTemplateInput[key];
|
|
2097
|
+
const path_planTemplateInput_prop = path_planTemplateInput + '["' + key + '"]';
|
|
2098
|
+
if (typeof obj_planTemplateInput_prop !== 'string') {
|
|
2099
|
+
return new TypeError('Expected "string" but received "' + typeof obj_planTemplateInput_prop + '" (at "' + path_planTemplateInput_prop + '")');
|
|
2100
|
+
}
|
|
2101
|
+
}
|
|
2102
|
+
}
|
|
2103
|
+
if (obj.type !== undefined) {
|
|
2104
|
+
const obj_type = obj.type;
|
|
2105
|
+
const path_type = path + '.type';
|
|
2106
|
+
if (typeof obj_type !== 'string') {
|
|
2107
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
if (obj.userUtterance !== undefined) {
|
|
2111
|
+
const obj_userUtterance = obj.userUtterance;
|
|
2112
|
+
const path_userUtterance = path + '.userUtterance';
|
|
2113
|
+
if (typeof obj_userUtterance !== 'string') {
|
|
2114
|
+
return new TypeError('Expected "string" but received "' + typeof obj_userUtterance + '" (at "' + path_userUtterance + '")');
|
|
2115
|
+
}
|
|
2116
|
+
}
|
|
2117
|
+
})();
|
|
2118
|
+
return v_error === undefined ? null : v_error;
|
|
2119
|
+
}
|
|
2120
|
+
const select$2 = function CopilotQuickActionRepresentationSelect() {
|
|
2121
|
+
return {
|
|
2122
|
+
kind: 'Fragment',
|
|
2123
|
+
version: VERSION$1,
|
|
2124
|
+
private: [],
|
|
2125
|
+
selections: [
|
|
2126
|
+
{
|
|
2127
|
+
name: 'actionApiName',
|
|
2128
|
+
kind: 'Scalar',
|
|
2129
|
+
required: false
|
|
2130
|
+
},
|
|
2131
|
+
{
|
|
2132
|
+
name: 'createdDate',
|
|
2133
|
+
kind: 'Scalar',
|
|
2134
|
+
required: false
|
|
2135
|
+
},
|
|
2136
|
+
{
|
|
2137
|
+
name: 'description',
|
|
2138
|
+
kind: 'Scalar',
|
|
2139
|
+
required: false
|
|
2140
|
+
},
|
|
2141
|
+
{
|
|
2142
|
+
name: 'icon',
|
|
2143
|
+
kind: 'Scalar',
|
|
2144
|
+
required: false
|
|
2145
|
+
},
|
|
2146
|
+
{
|
|
2147
|
+
name: 'intent',
|
|
2148
|
+
kind: 'Scalar',
|
|
2149
|
+
required: false
|
|
2150
|
+
},
|
|
2151
|
+
{
|
|
2152
|
+
name: 'isGlobal',
|
|
2153
|
+
kind: 'Scalar',
|
|
2154
|
+
required: false
|
|
2155
|
+
},
|
|
2156
|
+
{
|
|
2157
|
+
name: 'isStandard',
|
|
2158
|
+
kind: 'Scalar',
|
|
2159
|
+
required: false
|
|
2160
|
+
},
|
|
2161
|
+
{
|
|
2162
|
+
name: 'label',
|
|
2163
|
+
kind: 'Scalar',
|
|
2164
|
+
required: false
|
|
2165
|
+
},
|
|
2166
|
+
{
|
|
2167
|
+
name: 'lastModifiedDate',
|
|
2168
|
+
kind: 'Scalar',
|
|
2169
|
+
required: false
|
|
2170
|
+
},
|
|
2171
|
+
{
|
|
2172
|
+
name: 'namespace',
|
|
2173
|
+
kind: 'Scalar',
|
|
2174
|
+
required: false
|
|
2175
|
+
},
|
|
2176
|
+
{
|
|
2177
|
+
name: 'orgAccess',
|
|
2178
|
+
kind: 'Scalar',
|
|
2179
|
+
required: false
|
|
2180
|
+
},
|
|
2181
|
+
{
|
|
2182
|
+
name: 'planTemplateId',
|
|
2183
|
+
kind: 'Scalar',
|
|
2184
|
+
required: false
|
|
2185
|
+
},
|
|
2186
|
+
{
|
|
2187
|
+
name: 'planTemplateInput',
|
|
2188
|
+
kind: 'Scalar',
|
|
2189
|
+
map: true,
|
|
2190
|
+
required: false
|
|
2191
|
+
},
|
|
2192
|
+
{
|
|
2193
|
+
name: 'type',
|
|
2194
|
+
kind: 'Scalar',
|
|
2195
|
+
required: false
|
|
2196
|
+
},
|
|
2197
|
+
{
|
|
2198
|
+
name: 'userUtterance',
|
|
2199
|
+
kind: 'Scalar',
|
|
2200
|
+
required: false
|
|
2201
|
+
}
|
|
2202
|
+
]
|
|
2203
|
+
};
|
|
2204
|
+
};
|
|
2205
|
+
function equals$1(existing, incoming) {
|
|
2206
|
+
const existing_isGlobal = existing.isGlobal;
|
|
2207
|
+
const incoming_isGlobal = incoming.isGlobal;
|
|
2208
|
+
// if at least one of these optionals is defined
|
|
2209
|
+
if (existing_isGlobal !== undefined || incoming_isGlobal !== undefined) {
|
|
2210
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2211
|
+
// not equal
|
|
2212
|
+
if (existing_isGlobal === undefined || incoming_isGlobal === undefined) {
|
|
2213
|
+
return false;
|
|
2214
|
+
}
|
|
2215
|
+
if (!(existing_isGlobal === incoming_isGlobal)) {
|
|
2216
|
+
return false;
|
|
2217
|
+
}
|
|
2218
|
+
}
|
|
2219
|
+
const existing_isStandard = existing.isStandard;
|
|
2220
|
+
const incoming_isStandard = incoming.isStandard;
|
|
2221
|
+
// if at least one of these optionals is defined
|
|
2222
|
+
if (existing_isStandard !== undefined || incoming_isStandard !== undefined) {
|
|
2223
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2224
|
+
// not equal
|
|
2225
|
+
if (existing_isStandard === undefined || incoming_isStandard === undefined) {
|
|
2226
|
+
return false;
|
|
2227
|
+
}
|
|
2228
|
+
if (!(existing_isStandard === incoming_isStandard)) {
|
|
2229
|
+
return false;
|
|
2230
|
+
}
|
|
2231
|
+
}
|
|
2232
|
+
const existing_actionApiName = existing.actionApiName;
|
|
2233
|
+
const incoming_actionApiName = incoming.actionApiName;
|
|
2234
|
+
// if at least one of these optionals is defined
|
|
2235
|
+
if (existing_actionApiName !== undefined || incoming_actionApiName !== undefined) {
|
|
2236
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2237
|
+
// not equal
|
|
2238
|
+
if (existing_actionApiName === undefined || incoming_actionApiName === undefined) {
|
|
2239
|
+
return false;
|
|
2240
|
+
}
|
|
2241
|
+
if (!(existing_actionApiName === incoming_actionApiName)) {
|
|
2242
|
+
return false;
|
|
2243
|
+
}
|
|
2244
|
+
}
|
|
2245
|
+
const existing_createdDate = existing.createdDate;
|
|
2246
|
+
const incoming_createdDate = incoming.createdDate;
|
|
2247
|
+
// if at least one of these optionals is defined
|
|
2248
|
+
if (existing_createdDate !== undefined || incoming_createdDate !== undefined) {
|
|
2249
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2250
|
+
// not equal
|
|
2251
|
+
if (existing_createdDate === undefined || incoming_createdDate === undefined) {
|
|
2252
|
+
return false;
|
|
2253
|
+
}
|
|
2254
|
+
if (!(existing_createdDate === incoming_createdDate)) {
|
|
2255
|
+
return false;
|
|
2256
|
+
}
|
|
2257
|
+
}
|
|
2258
|
+
const existing_description = existing.description;
|
|
2259
|
+
const incoming_description = incoming.description;
|
|
2260
|
+
// if at least one of these optionals is defined
|
|
2261
|
+
if (existing_description !== undefined || incoming_description !== undefined) {
|
|
2262
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2263
|
+
// not equal
|
|
2264
|
+
if (existing_description === undefined || incoming_description === undefined) {
|
|
2265
|
+
return false;
|
|
2266
|
+
}
|
|
2267
|
+
if (!(existing_description === incoming_description)) {
|
|
2268
|
+
return false;
|
|
2269
|
+
}
|
|
2270
|
+
}
|
|
2271
|
+
const existing_icon = existing.icon;
|
|
2272
|
+
const incoming_icon = incoming.icon;
|
|
2273
|
+
// if at least one of these optionals is defined
|
|
2274
|
+
if (existing_icon !== undefined || incoming_icon !== undefined) {
|
|
2275
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2276
|
+
// not equal
|
|
2277
|
+
if (existing_icon === undefined || incoming_icon === undefined) {
|
|
2278
|
+
return false;
|
|
2279
|
+
}
|
|
2280
|
+
if (!(existing_icon === incoming_icon)) {
|
|
2281
|
+
return false;
|
|
2282
|
+
}
|
|
2283
|
+
}
|
|
2284
|
+
const existing_intent = existing.intent;
|
|
2285
|
+
const incoming_intent = incoming.intent;
|
|
2286
|
+
// if at least one of these optionals is defined
|
|
2287
|
+
if (existing_intent !== undefined || incoming_intent !== undefined) {
|
|
2288
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2289
|
+
// not equal
|
|
2290
|
+
if (existing_intent === undefined || incoming_intent === undefined) {
|
|
2291
|
+
return false;
|
|
2292
|
+
}
|
|
2293
|
+
if (!(existing_intent === incoming_intent)) {
|
|
2294
|
+
return false;
|
|
2295
|
+
}
|
|
2296
|
+
}
|
|
2297
|
+
const existing_label = existing.label;
|
|
2298
|
+
const incoming_label = incoming.label;
|
|
2299
|
+
// if at least one of these optionals is defined
|
|
2300
|
+
if (existing_label !== undefined || incoming_label !== undefined) {
|
|
2301
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2302
|
+
// not equal
|
|
2303
|
+
if (existing_label === undefined || incoming_label === undefined) {
|
|
2304
|
+
return false;
|
|
2305
|
+
}
|
|
2306
|
+
if (!(existing_label === incoming_label)) {
|
|
2307
|
+
return false;
|
|
2308
|
+
}
|
|
2309
|
+
}
|
|
2310
|
+
const existing_lastModifiedDate = existing.lastModifiedDate;
|
|
2311
|
+
const incoming_lastModifiedDate = incoming.lastModifiedDate;
|
|
2312
|
+
// if at least one of these optionals is defined
|
|
2313
|
+
if (existing_lastModifiedDate !== undefined || incoming_lastModifiedDate !== undefined) {
|
|
2314
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2315
|
+
// not equal
|
|
2316
|
+
if (existing_lastModifiedDate === undefined || incoming_lastModifiedDate === undefined) {
|
|
2317
|
+
return false;
|
|
2318
|
+
}
|
|
2319
|
+
if (!(existing_lastModifiedDate === incoming_lastModifiedDate)) {
|
|
2320
|
+
return false;
|
|
2321
|
+
}
|
|
2322
|
+
}
|
|
2323
|
+
const existing_namespace = existing.namespace;
|
|
2324
|
+
const incoming_namespace = incoming.namespace;
|
|
2325
|
+
// if at least one of these optionals is defined
|
|
2326
|
+
if (existing_namespace !== undefined || incoming_namespace !== undefined) {
|
|
2327
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2328
|
+
// not equal
|
|
2329
|
+
if (existing_namespace === undefined || incoming_namespace === undefined) {
|
|
2330
|
+
return false;
|
|
2331
|
+
}
|
|
2332
|
+
if (!(existing_namespace === incoming_namespace)) {
|
|
2333
|
+
return false;
|
|
2334
|
+
}
|
|
2335
|
+
}
|
|
2336
|
+
const existing_orgAccess = existing.orgAccess;
|
|
2337
|
+
const incoming_orgAccess = incoming.orgAccess;
|
|
2338
|
+
// if at least one of these optionals is defined
|
|
2339
|
+
if (existing_orgAccess !== undefined || incoming_orgAccess !== undefined) {
|
|
2340
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2341
|
+
// not equal
|
|
2342
|
+
if (existing_orgAccess === undefined || incoming_orgAccess === undefined) {
|
|
2343
|
+
return false;
|
|
2344
|
+
}
|
|
2345
|
+
if (!(existing_orgAccess === incoming_orgAccess)) {
|
|
2346
|
+
return false;
|
|
2347
|
+
}
|
|
2348
|
+
}
|
|
2349
|
+
const existing_planTemplateId = existing.planTemplateId;
|
|
2350
|
+
const incoming_planTemplateId = incoming.planTemplateId;
|
|
2351
|
+
// if at least one of these optionals is defined
|
|
2352
|
+
if (existing_planTemplateId !== undefined || incoming_planTemplateId !== undefined) {
|
|
2353
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2354
|
+
// not equal
|
|
2355
|
+
if (existing_planTemplateId === undefined || incoming_planTemplateId === undefined) {
|
|
2356
|
+
return false;
|
|
2357
|
+
}
|
|
2358
|
+
if (!(existing_planTemplateId === incoming_planTemplateId)) {
|
|
2359
|
+
return false;
|
|
2360
|
+
}
|
|
2361
|
+
}
|
|
2362
|
+
const existing_type = existing.type;
|
|
2363
|
+
const incoming_type = incoming.type;
|
|
2364
|
+
// if at least one of these optionals is defined
|
|
2365
|
+
if (existing_type !== undefined || incoming_type !== undefined) {
|
|
2366
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2367
|
+
// not equal
|
|
2368
|
+
if (existing_type === undefined || incoming_type === undefined) {
|
|
2369
|
+
return false;
|
|
2370
|
+
}
|
|
2371
|
+
if (!(existing_type === incoming_type)) {
|
|
2372
|
+
return false;
|
|
2373
|
+
}
|
|
2374
|
+
}
|
|
2375
|
+
const existing_userUtterance = existing.userUtterance;
|
|
2376
|
+
const incoming_userUtterance = incoming.userUtterance;
|
|
2377
|
+
// if at least one of these optionals is defined
|
|
2378
|
+
if (existing_userUtterance !== undefined || incoming_userUtterance !== undefined) {
|
|
2379
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2380
|
+
// not equal
|
|
2381
|
+
if (existing_userUtterance === undefined || incoming_userUtterance === undefined) {
|
|
2382
|
+
return false;
|
|
2383
|
+
}
|
|
2384
|
+
if (!(existing_userUtterance === incoming_userUtterance)) {
|
|
2385
|
+
return false;
|
|
2386
|
+
}
|
|
2387
|
+
}
|
|
2388
|
+
const existing_planTemplateInput = existing.planTemplateInput;
|
|
2389
|
+
const incoming_planTemplateInput = incoming.planTemplateInput;
|
|
2390
|
+
// if at least one of these optionals is defined
|
|
2391
|
+
if (existing_planTemplateInput !== undefined || incoming_planTemplateInput !== undefined) {
|
|
2392
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2393
|
+
// not equal
|
|
2394
|
+
if (existing_planTemplateInput === undefined || incoming_planTemplateInput === undefined) {
|
|
2395
|
+
return false;
|
|
2396
|
+
}
|
|
2397
|
+
const equals_planTemplateInput_props = equalsObject(existing_planTemplateInput, incoming_planTemplateInput, (existing_planTemplateInput_prop, incoming_planTemplateInput_prop) => {
|
|
2398
|
+
if (!(existing_planTemplateInput_prop === incoming_planTemplateInput_prop)) {
|
|
2399
|
+
return false;
|
|
2400
|
+
}
|
|
2401
|
+
});
|
|
2402
|
+
if (equals_planTemplateInput_props === false) {
|
|
2403
|
+
return false;
|
|
2404
|
+
}
|
|
2405
|
+
}
|
|
2406
|
+
return true;
|
|
2407
|
+
}
|
|
2408
|
+
|
|
2409
|
+
const TTL = 900000;
|
|
2410
|
+
const VERSION = "122e61b0db6dc38d244a87570efc5522";
|
|
2411
|
+
function validate(obj, path = 'RecommendedActionsRepresentation') {
|
|
2412
|
+
const v_error = (() => {
|
|
2413
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2414
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2415
|
+
}
|
|
2416
|
+
const obj_copilotQuickActions = obj.copilotQuickActions;
|
|
2417
|
+
const path_copilotQuickActions = path + '.copilotQuickActions';
|
|
2418
|
+
if (!ArrayIsArray(obj_copilotQuickActions)) {
|
|
2419
|
+
return new TypeError('Expected "array" but received "' + typeof obj_copilotQuickActions + '" (at "' + path_copilotQuickActions + '")');
|
|
2420
|
+
}
|
|
2421
|
+
for (let i = 0; i < obj_copilotQuickActions.length; i++) {
|
|
2422
|
+
const obj_copilotQuickActions_item = obj_copilotQuickActions[i];
|
|
2423
|
+
const path_copilotQuickActions_item = path_copilotQuickActions + '[' + i + ']';
|
|
2424
|
+
const referencepath_copilotQuickActions_itemValidationError = validate$1(obj_copilotQuickActions_item, path_copilotQuickActions_item);
|
|
2425
|
+
if (referencepath_copilotQuickActions_itemValidationError !== null) {
|
|
2426
|
+
let message = 'Object doesn\'t match CopilotQuickActionRepresentation (at "' + path_copilotQuickActions_item + '")\n';
|
|
2427
|
+
message += referencepath_copilotQuickActions_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2428
|
+
return new TypeError(message);
|
|
2429
|
+
}
|
|
2430
|
+
}
|
|
2431
|
+
if (obj.errorMessage !== undefined) {
|
|
2432
|
+
const obj_errorMessage = obj.errorMessage;
|
|
2433
|
+
const path_errorMessage = path + '.errorMessage';
|
|
2434
|
+
if (typeof obj_errorMessage !== 'string') {
|
|
2435
|
+
return new TypeError('Expected "string" but received "' + typeof obj_errorMessage + '" (at "' + path_errorMessage + '")');
|
|
2436
|
+
}
|
|
2437
|
+
}
|
|
2438
|
+
const obj_isSuccess = obj.isSuccess;
|
|
2439
|
+
const path_isSuccess = path + '.isSuccess';
|
|
2440
|
+
if (typeof obj_isSuccess !== 'boolean') {
|
|
2441
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
|
|
2442
|
+
}
|
|
2443
|
+
})();
|
|
2444
|
+
return v_error === undefined ? null : v_error;
|
|
2445
|
+
}
|
|
2446
|
+
const RepresentationType = 'RecommendedActionsRepresentation';
|
|
2447
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
2448
|
+
return input;
|
|
2449
|
+
}
|
|
2450
|
+
const select$1 = function RecommendedActionsRepresentationSelect() {
|
|
2451
|
+
const { selections: CopilotQuickActionRepresentation__selections, opaque: CopilotQuickActionRepresentation__opaque, } = select$2();
|
|
2452
|
+
return {
|
|
2453
|
+
kind: 'Fragment',
|
|
2454
|
+
version: VERSION,
|
|
2455
|
+
private: [],
|
|
2456
|
+
selections: [
|
|
2457
|
+
{
|
|
2458
|
+
name: 'copilotQuickActions',
|
|
2459
|
+
kind: 'Object',
|
|
2460
|
+
plural: true,
|
|
2461
|
+
selections: CopilotQuickActionRepresentation__selections
|
|
2462
|
+
},
|
|
2463
|
+
{
|
|
2464
|
+
name: 'errorMessage',
|
|
2465
|
+
kind: 'Scalar',
|
|
2466
|
+
required: false
|
|
2467
|
+
},
|
|
2468
|
+
{
|
|
2469
|
+
name: 'isSuccess',
|
|
2470
|
+
kind: 'Scalar'
|
|
2471
|
+
}
|
|
2472
|
+
]
|
|
2473
|
+
};
|
|
2474
|
+
};
|
|
2475
|
+
function equals(existing, incoming) {
|
|
2476
|
+
const existing_isSuccess = existing.isSuccess;
|
|
2477
|
+
const incoming_isSuccess = incoming.isSuccess;
|
|
2478
|
+
if (!(existing_isSuccess === incoming_isSuccess)) {
|
|
2479
|
+
return false;
|
|
2480
|
+
}
|
|
2481
|
+
const existing_errorMessage = existing.errorMessage;
|
|
2482
|
+
const incoming_errorMessage = incoming.errorMessage;
|
|
2483
|
+
// if at least one of these optionals is defined
|
|
2484
|
+
if (existing_errorMessage !== undefined || incoming_errorMessage !== undefined) {
|
|
2485
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2486
|
+
// not equal
|
|
2487
|
+
if (existing_errorMessage === undefined || incoming_errorMessage === undefined) {
|
|
2488
|
+
return false;
|
|
2489
|
+
}
|
|
2490
|
+
if (!(existing_errorMessage === incoming_errorMessage)) {
|
|
2491
|
+
return false;
|
|
2492
|
+
}
|
|
2493
|
+
}
|
|
2494
|
+
const existing_copilotQuickActions = existing.copilotQuickActions;
|
|
2495
|
+
const incoming_copilotQuickActions = incoming.copilotQuickActions;
|
|
2496
|
+
const equals_copilotQuickActions_items = equalsArray(existing_copilotQuickActions, incoming_copilotQuickActions, (existing_copilotQuickActions_item, incoming_copilotQuickActions_item) => {
|
|
2497
|
+
if (!(equals$1(existing_copilotQuickActions_item, incoming_copilotQuickActions_item))) {
|
|
2498
|
+
return false;
|
|
2499
|
+
}
|
|
2500
|
+
});
|
|
2501
|
+
if (equals_copilotQuickActions_items === false) {
|
|
2502
|
+
return false;
|
|
2503
|
+
}
|
|
2504
|
+
return true;
|
|
2505
|
+
}
|
|
2506
|
+
const ingest = function RecommendedActionsRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2507
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2508
|
+
const validateError = validate(input);
|
|
2509
|
+
if (validateError !== null) {
|
|
2510
|
+
throw validateError;
|
|
2511
|
+
}
|
|
2512
|
+
}
|
|
2513
|
+
const key = path.fullPath;
|
|
2514
|
+
const ttlToUse = TTL;
|
|
2515
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "einstein-copilot-bot", VERSION, RepresentationType, equals);
|
|
2516
|
+
return createLink(key);
|
|
2517
|
+
};
|
|
2518
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
2519
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2520
|
+
const rootKey = fullPathFactory();
|
|
2521
|
+
rootKeySet.set(rootKey, {
|
|
2522
|
+
namespace: keyPrefix,
|
|
2523
|
+
representationName: RepresentationType,
|
|
2524
|
+
mergeable: false
|
|
2525
|
+
});
|
|
2526
|
+
}
|
|
2527
|
+
|
|
2528
|
+
function select(luvio, params) {
|
|
2529
|
+
return select$1();
|
|
2530
|
+
}
|
|
2531
|
+
function keyBuilder$1(luvio, params) {
|
|
2532
|
+
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 + ')';
|
|
2533
|
+
}
|
|
2534
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
2535
|
+
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
|
|
2536
|
+
}
|
|
2537
|
+
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
2538
|
+
const { body } = response;
|
|
2539
|
+
const key = keyBuilder$1(luvio, resourceParams);
|
|
2540
|
+
luvio.storeIngest(key, ingest, body);
|
|
2541
|
+
const snapshot = luvio.storeLookup({
|
|
2542
|
+
recordId: key,
|
|
2543
|
+
node: select(),
|
|
2544
|
+
variables: {},
|
|
2545
|
+
}, snapshotRefresh);
|
|
2546
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2547
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2548
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2549
|
+
}
|
|
2550
|
+
}
|
|
2551
|
+
deepFreeze(snapshot.data);
|
|
2552
|
+
return snapshot;
|
|
2553
|
+
}
|
|
2554
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
2555
|
+
const key = keyBuilder$1(luvio, params);
|
|
2556
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2557
|
+
const storeMetadataParams = {
|
|
2558
|
+
ttl: TTL,
|
|
2559
|
+
namespace: keyPrefix,
|
|
2560
|
+
version: VERSION,
|
|
2561
|
+
representationName: RepresentationType
|
|
2562
|
+
};
|
|
2563
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
2564
|
+
return errorSnapshot;
|
|
2565
|
+
}
|
|
2566
|
+
function createResourceRequest(config) {
|
|
2567
|
+
const headers = {};
|
|
2568
|
+
return {
|
|
2569
|
+
baseUri: '/services/data/v60.0',
|
|
2570
|
+
basePath: '/connect/recommended-actions',
|
|
2571
|
+
method: 'get',
|
|
2572
|
+
body: null,
|
|
2573
|
+
urlParams: {},
|
|
2574
|
+
queryParams: config.queryParams,
|
|
2575
|
+
headers,
|
|
2576
|
+
priority: 'normal',
|
|
2577
|
+
};
|
|
2578
|
+
}
|
|
2579
|
+
|
|
2580
|
+
const adapterName = 'getRecommendedActions';
|
|
2581
|
+
const getRecommendedActions_ConfigPropertyMetadata = [
|
|
2582
|
+
generateParamConfigMetadata('pageName', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2583
|
+
generateParamConfigMetadata('pageType', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2584
|
+
generateParamConfigMetadata('actionName', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2585
|
+
generateParamConfigMetadata('objectApiName', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2586
|
+
generateParamConfigMetadata('customApplicationName', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2587
|
+
generateParamConfigMetadata('sessionId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2588
|
+
generateParamConfigMetadata('formFactor', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2589
|
+
];
|
|
2590
|
+
const getRecommendedActions_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getRecommendedActions_ConfigPropertyMetadata);
|
|
2591
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$4(getRecommendedActions_ConfigPropertyMetadata);
|
|
2592
|
+
function keyBuilder(luvio, config) {
|
|
2593
|
+
const resourceParams = createResourceParams(config);
|
|
2594
|
+
return keyBuilder$1(luvio, resourceParams);
|
|
2595
|
+
}
|
|
2596
|
+
function typeCheckConfig(untrustedConfig) {
|
|
2597
|
+
const config = {};
|
|
2598
|
+
typeCheckConfig$4(untrustedConfig, config, getRecommendedActions_ConfigPropertyMetadata);
|
|
2599
|
+
return config;
|
|
2600
|
+
}
|
|
2601
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
2602
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2603
|
+
return null;
|
|
2604
|
+
}
|
|
2605
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2606
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2607
|
+
}
|
|
2608
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
2609
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2610
|
+
return null;
|
|
2611
|
+
}
|
|
2612
|
+
return config;
|
|
2613
|
+
}
|
|
2614
|
+
function adapterFragment(luvio, config) {
|
|
2615
|
+
createResourceParams(config);
|
|
2616
|
+
return select();
|
|
2617
|
+
}
|
|
2618
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
2619
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response, {
|
|
2620
|
+
config,
|
|
2621
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
2622
|
+
});
|
|
2623
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2624
|
+
}
|
|
2625
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
2626
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
2627
|
+
config,
|
|
2628
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
2629
|
+
});
|
|
2630
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2631
|
+
}
|
|
2632
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
2633
|
+
const resourceParams = createResourceParams(config);
|
|
2634
|
+
const request = createResourceRequest(resourceParams);
|
|
2635
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2636
|
+
.then((response) => {
|
|
2637
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
2638
|
+
const cache = new StoreKeyMap();
|
|
2639
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
2640
|
+
return cache;
|
|
2641
|
+
});
|
|
2642
|
+
}, (response) => {
|
|
2643
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
2644
|
+
});
|
|
2645
|
+
}
|
|
2646
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
2647
|
+
return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
2648
|
+
}
|
|
2649
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
2650
|
+
const { luvio, config } = context;
|
|
2651
|
+
const selector = {
|
|
2652
|
+
recordId: keyBuilder(luvio, config),
|
|
2653
|
+
node: adapterFragment(luvio, config),
|
|
2654
|
+
variables: {},
|
|
2655
|
+
};
|
|
2656
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
2657
|
+
config,
|
|
2658
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
2659
|
+
});
|
|
2660
|
+
return cacheSnapshot;
|
|
2661
|
+
}
|
|
2662
|
+
const getRecommendedActionsAdapterFactory = (luvio) => function einsteinCopilotBot__getRecommendedActions(untrustedConfig, requestContext) {
|
|
2663
|
+
const config = validateAdapterConfig(untrustedConfig, getRecommendedActions_ConfigPropertyNames);
|
|
1943
2664
|
// Invalid or incomplete config
|
|
1944
2665
|
if (config === null) {
|
|
1945
2666
|
return null;
|
|
@@ -1948,4 +2669,4 @@ const getRecommendedPlanTemplatesAdapterFactory = (luvio) => function einsteinCo
|
|
|
1948
2669
|
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
1949
2670
|
};
|
|
1950
2671
|
|
|
1951
|
-
export { getBotIdAdapterFactory, getRecommendedPlanTemplatesAdapterFactory, sendMessageAdapterFactory };
|
|
2672
|
+
export { getBotIdAdapterFactory, getRecommendedActionsAdapterFactory, getRecommendedPlanTemplatesAdapterFactory, sendMessageAdapterFactory };
|