@salesforce/lds-adapters-service-einstein-copilot-bot 1.287.0-dev16 → 1.287.0-dev17
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 +567 -273
- package/dist/es/es2018/types/src/generated/adapters/getCopilotObjects.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/adapters/getRecommendedActions.d.ts +4 -4
- 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/getConnectCopilotObjects.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectRecommendedActions.d.ts +4 -4
- package/dist/es/es2018/types/src/generated/types/ConversationRuntimeProxyMessageRepresentation.d.ts +4 -1
- package/dist/es/es2018/types/src/generated/types/CopilotObjectInfoRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/CopilotObjectListRepresentation.d.ts +30 -0
- package/package.json +3 -3
- package/sfdc/index.js +353 -47
- package/src/raml/api.raml +60 -18
- package/src/raml/luvio.raml +11 -4
|
@@ -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$5, StoreKeyMap, createResourceParams as createResourceParams$7, typeCheckConfig as typeCheckConfig$7 } 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$7 = 30000;
|
|
116
|
+
const VERSION$e = "ab85410a28124cfed3d8eae7b8236853";
|
|
117
|
+
function validate$l(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$j(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$7 = 'CopilotBotInfoRepresentation';
|
|
145
|
+
function normalize$7(input, existing, path, luvio, store, timestamp) {
|
|
146
146
|
return input;
|
|
147
147
|
}
|
|
148
|
-
const select$
|
|
148
|
+
const select$l = function CopilotBotInfoRepresentationSelect() {
|
|
149
149
|
return {
|
|
150
150
|
kind: 'Fragment',
|
|
151
|
-
version: VERSION$
|
|
151
|
+
version: VERSION$e,
|
|
152
152
|
private: [],
|
|
153
153
|
selections: [
|
|
154
154
|
{
|
|
@@ -168,7 +168,7 @@ const select$i = function CopilotBotInfoRepresentationSelect() {
|
|
|
168
168
|
]
|
|
169
169
|
};
|
|
170
170
|
};
|
|
171
|
-
function equals$
|
|
171
|
+
function equals$e(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$c(existing, incoming) {
|
|
|
202
202
|
}
|
|
203
203
|
return true;
|
|
204
204
|
}
|
|
205
|
-
const ingest$
|
|
205
|
+
const ingest$7 = function CopilotBotInfoRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
206
206
|
if (process.env.NODE_ENV !== 'production') {
|
|
207
|
-
const validateError = validate$
|
|
207
|
+
const validateError = validate$l(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$7;
|
|
214
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$7, "einstein-copilot-bot", VERSION$e, RepresentationType$7, equals$e);
|
|
215
215
|
return createLink(key);
|
|
216
216
|
};
|
|
217
|
-
function getTypeCacheKeys$
|
|
217
|
+
function getTypeCacheKeys$7(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$7,
|
|
223
223
|
mergeable: false
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
-
function select$
|
|
228
|
-
return select$
|
|
227
|
+
function select$k(luvio, params) {
|
|
228
|
+
return select$l();
|
|
229
229
|
}
|
|
230
|
-
function keyBuilder$
|
|
230
|
+
function keyBuilder$c(luvio, params) {
|
|
231
231
|
return keyPrefix + '::CopilotBotInfoRepresentation:(' + ')';
|
|
232
232
|
}
|
|
233
|
-
function getResponseCacheKeys$
|
|
234
|
-
getTypeCacheKeys$
|
|
233
|
+
function getResponseCacheKeys$6(storeKeyMap, luvio, resourceParams, response) {
|
|
234
|
+
getTypeCacheKeys$7(storeKeyMap, luvio, response, () => keyBuilder$c());
|
|
235
235
|
}
|
|
236
|
-
function ingestSuccess$
|
|
236
|
+
function ingestSuccess$6(luvio, resourceParams, response, snapshotRefresh) {
|
|
237
237
|
const { body } = response;
|
|
238
|
-
const key = keyBuilder$
|
|
239
|
-
luvio.storeIngest(key, ingest$
|
|
238
|
+
const key = keyBuilder$c();
|
|
239
|
+
luvio.storeIngest(key, ingest$7, body);
|
|
240
240
|
const snapshot = luvio.storeLookup({
|
|
241
241
|
recordId: key,
|
|
242
|
-
node: select$
|
|
242
|
+
node: select$k(),
|
|
243
243
|
variables: {},
|
|
244
244
|
}, snapshotRefresh);
|
|
245
245
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -250,19 +250,19 @@ function ingestSuccess$5(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$4(luvio, params, error, snapshotRefresh) {
|
|
254
|
+
const key = keyBuilder$c();
|
|
255
255
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
256
256
|
const storeMetadataParams = {
|
|
257
|
-
ttl: TTL$
|
|
257
|
+
ttl: TTL$7,
|
|
258
258
|
namespace: keyPrefix,
|
|
259
|
-
version: VERSION$
|
|
260
|
-
representationName: RepresentationType$
|
|
259
|
+
version: VERSION$e,
|
|
260
|
+
representationName: RepresentationType$7
|
|
261
261
|
};
|
|
262
262
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
263
263
|
return errorSnapshot;
|
|
264
264
|
}
|
|
265
|
-
function createResourceRequest$
|
|
265
|
+
function createResourceRequest$6(config) {
|
|
266
266
|
const headers = {};
|
|
267
267
|
return {
|
|
268
268
|
baseUri: '/services/data/v61.0',
|
|
@@ -276,91 +276,91 @@ function createResourceRequest$5(config) {
|
|
|
276
276
|
};
|
|
277
277
|
}
|
|
278
278
|
|
|
279
|
-
const adapterName$
|
|
279
|
+
const adapterName$6 = '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$6, getBotId_ConfigPropertyMetadata);
|
|
282
|
+
const createResourceParams$6 = /*#__PURE__*/ createResourceParams$7(getBotId_ConfigPropertyMetadata);
|
|
283
|
+
function keyBuilder$b(luvio, config) {
|
|
284
|
+
createResourceParams$6(config);
|
|
285
|
+
return keyBuilder$c();
|
|
286
286
|
}
|
|
287
|
-
function typeCheckConfig$
|
|
287
|
+
function typeCheckConfig$6(untrustedConfig) {
|
|
288
288
|
const config = {};
|
|
289
289
|
return config;
|
|
290
290
|
}
|
|
291
|
-
function validateAdapterConfig$
|
|
291
|
+
function validateAdapterConfig$6(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$6();
|
|
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$4(luvio, config) {
|
|
305
|
+
createResourceParams$6(config);
|
|
306
|
+
return select$k();
|
|
307
307
|
}
|
|
308
|
-
function onFetchResponseSuccess$
|
|
309
|
-
const snapshot = ingestSuccess$
|
|
308
|
+
function onFetchResponseSuccess$4(luvio, config, resourceParams, response) {
|
|
309
|
+
const snapshot = ingestSuccess$6(luvio, resourceParams, response, {
|
|
310
310
|
config,
|
|
311
|
-
resolve: () => buildNetworkSnapshot$
|
|
311
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
312
312
|
});
|
|
313
313
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
314
314
|
}
|
|
315
|
-
function onFetchResponseError$
|
|
316
|
-
const snapshot = ingestError$
|
|
315
|
+
function onFetchResponseError$4(luvio, config, resourceParams, response) {
|
|
316
|
+
const snapshot = ingestError$4(luvio, resourceParams, response, {
|
|
317
317
|
config,
|
|
318
|
-
resolve: () => buildNetworkSnapshot$
|
|
318
|
+
resolve: () => buildNetworkSnapshot$6(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$6(luvio, config, options) {
|
|
323
|
+
const resourceParams = createResourceParams$6(config);
|
|
324
|
+
const request = createResourceRequest$6();
|
|
325
325
|
return luvio.dispatchResourceRequest(request, options)
|
|
326
326
|
.then((response) => {
|
|
327
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$
|
|
327
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$4(luvio, config, resourceParams, response), () => {
|
|
328
328
|
const cache = new StoreKeyMap();
|
|
329
|
-
getResponseCacheKeys$
|
|
329
|
+
getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
|
|
330
330
|
return cache;
|
|
331
331
|
});
|
|
332
332
|
}, (response) => {
|
|
333
|
-
return luvio.handleErrorResponse(() => onFetchResponseError$
|
|
333
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$4(luvio, config, resourceParams, response));
|
|
334
334
|
});
|
|
335
335
|
}
|
|
336
|
-
function buildNetworkSnapshotCachePolicy$
|
|
337
|
-
return buildNetworkSnapshotCachePolicy$
|
|
336
|
+
function buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext) {
|
|
337
|
+
return buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext, buildNetworkSnapshot$6, undefined, false);
|
|
338
338
|
}
|
|
339
|
-
function buildCachedSnapshotCachePolicy$
|
|
339
|
+
function buildCachedSnapshotCachePolicy$4(context, storeLookup) {
|
|
340
340
|
const { luvio, config } = context;
|
|
341
341
|
const selector = {
|
|
342
|
-
recordId: keyBuilder$
|
|
343
|
-
node: adapterFragment$
|
|
342
|
+
recordId: keyBuilder$b(luvio, config),
|
|
343
|
+
node: adapterFragment$4(luvio, config),
|
|
344
344
|
variables: {},
|
|
345
345
|
};
|
|
346
346
|
const cacheSnapshot = storeLookup(selector, {
|
|
347
347
|
config,
|
|
348
|
-
resolve: () => buildNetworkSnapshot$
|
|
348
|
+
resolve: () => buildNetworkSnapshot$6(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$6(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$4, buildNetworkSnapshotCachePolicy$4);
|
|
360
360
|
};
|
|
361
361
|
|
|
362
|
-
const VERSION$
|
|
363
|
-
function validate$
|
|
362
|
+
const VERSION$d = "e8cb7e20392935088ea2f98edb927e8a";
|
|
363
|
+
function validate$k(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$i(obj, path = 'EsTypeMessageRepresentation') {
|
|
|
406
406
|
})();
|
|
407
407
|
return v_error === undefined ? null : v_error;
|
|
408
408
|
}
|
|
409
|
-
const select$
|
|
409
|
+
const select$j = function EsTypeMessageRepresentationSelect() {
|
|
410
410
|
return {
|
|
411
411
|
kind: 'Fragment',
|
|
412
|
-
version: VERSION$
|
|
412
|
+
version: VERSION$d,
|
|
413
413
|
private: [],
|
|
414
414
|
selections: [
|
|
415
415
|
{
|
|
@@ -429,7 +429,7 @@ const select$g = function EsTypeMessageRepresentationSelect() {
|
|
|
429
429
|
]
|
|
430
430
|
};
|
|
431
431
|
};
|
|
432
|
-
function equals$
|
|
432
|
+
function equals$d(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$b(existing, incoming) {
|
|
|
456
456
|
return true;
|
|
457
457
|
}
|
|
458
458
|
|
|
459
|
-
function validate$
|
|
459
|
+
function validate$j(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 + '")');
|
|
@@ -482,8 +482,8 @@ function validate$h(obj, path = 'VariableRepresentation') {
|
|
|
482
482
|
return v_error === undefined ? null : v_error;
|
|
483
483
|
}
|
|
484
484
|
|
|
485
|
-
const VERSION$
|
|
486
|
-
function validate$
|
|
485
|
+
const VERSION$c = "4e28b61c3ea362f1c68b28897784111e";
|
|
486
|
+
function validate$i(obj, path = 'ConversationRuntimeProxyChoiceRepresentation') {
|
|
487
487
|
const v_error = (() => {
|
|
488
488
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
489
489
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -501,10 +501,10 @@ function validate$g(obj, path = 'ConversationRuntimeProxyChoiceRepresentation')
|
|
|
501
501
|
})();
|
|
502
502
|
return v_error === undefined ? null : v_error;
|
|
503
503
|
}
|
|
504
|
-
const select$
|
|
504
|
+
const select$i = function ConversationRuntimeProxyChoiceRepresentationSelect() {
|
|
505
505
|
return {
|
|
506
506
|
kind: 'Fragment',
|
|
507
|
-
version: VERSION$
|
|
507
|
+
version: VERSION$c,
|
|
508
508
|
private: [],
|
|
509
509
|
selections: [
|
|
510
510
|
{
|
|
@@ -518,7 +518,7 @@ const select$f = function ConversationRuntimeProxyChoiceRepresentationSelect() {
|
|
|
518
518
|
]
|
|
519
519
|
};
|
|
520
520
|
};
|
|
521
|
-
function equals$
|
|
521
|
+
function equals$c(existing, incoming) {
|
|
522
522
|
const existing_alias = existing.alias;
|
|
523
523
|
const incoming_alias = incoming.alias;
|
|
524
524
|
if (!(existing_alias === incoming_alias)) {
|
|
@@ -532,8 +532,8 @@ function equals$a(existing, incoming) {
|
|
|
532
532
|
return true;
|
|
533
533
|
}
|
|
534
534
|
|
|
535
|
-
const VERSION$
|
|
536
|
-
function validate$
|
|
535
|
+
const VERSION$b = "477724425d0742c030025796c88ebf5d";
|
|
536
|
+
function validate$h(obj, path = 'CollectMessageRepresentation') {
|
|
537
537
|
const v_error = (() => {
|
|
538
538
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
539
539
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -541,7 +541,7 @@ function validate$f(obj, path = 'CollectMessageRepresentation') {
|
|
|
541
541
|
if (obj.data !== undefined) {
|
|
542
542
|
const obj_data = obj.data;
|
|
543
543
|
const path_data = path + '.data';
|
|
544
|
-
const referencepath_dataValidationError = validate$
|
|
544
|
+
const referencepath_dataValidationError = validate$k(obj_data, path_data);
|
|
545
545
|
if (referencepath_dataValidationError !== null) {
|
|
546
546
|
let message = 'Object doesn\'t match EsTypeMessageRepresentation (at "' + path_data + '")\n';
|
|
547
547
|
message += referencepath_dataValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -584,11 +584,11 @@ function validate$f(obj, path = 'CollectMessageRepresentation') {
|
|
|
584
584
|
})();
|
|
585
585
|
return v_error === undefined ? null : v_error;
|
|
586
586
|
}
|
|
587
|
-
const select$
|
|
588
|
-
const { selections: EsTypeMessageRepresentation__selections, opaque: EsTypeMessageRepresentation__opaque, } = select$
|
|
587
|
+
const select$h = function CollectMessageRepresentationSelect() {
|
|
588
|
+
const { selections: EsTypeMessageRepresentation__selections, opaque: EsTypeMessageRepresentation__opaque, } = select$j();
|
|
589
589
|
return {
|
|
590
590
|
kind: 'Fragment',
|
|
591
|
-
version: VERSION$
|
|
591
|
+
version: VERSION$b,
|
|
592
592
|
private: [],
|
|
593
593
|
selections: [
|
|
594
594
|
{
|
|
@@ -609,7 +609,7 @@ const select$e = function CollectMessageRepresentationSelect() {
|
|
|
609
609
|
]
|
|
610
610
|
};
|
|
611
611
|
};
|
|
612
|
-
function equals$
|
|
612
|
+
function equals$b(existing, incoming) {
|
|
613
613
|
const existing_targetType = existing.targetType;
|
|
614
614
|
const incoming_targetType = incoming.targetType;
|
|
615
615
|
if (!(existing_targetType === incoming_targetType)) {
|
|
@@ -624,7 +624,7 @@ function equals$9(existing, incoming) {
|
|
|
624
624
|
if (existing_data === undefined || incoming_data === undefined) {
|
|
625
625
|
return false;
|
|
626
626
|
}
|
|
627
|
-
if (!(equals$
|
|
627
|
+
if (!(equals$d(existing_data, incoming_data))) {
|
|
628
628
|
return false;
|
|
629
629
|
}
|
|
630
630
|
}
|
|
@@ -644,9 +644,9 @@ function equals$9(existing, incoming) {
|
|
|
644
644
|
return true;
|
|
645
645
|
}
|
|
646
646
|
|
|
647
|
-
const TTL$
|
|
648
|
-
const VERSION$
|
|
649
|
-
function validate$
|
|
647
|
+
const TTL$6 = 30000;
|
|
648
|
+
const VERSION$a = "983ede912bc103cfd2e2c2758140c5c9";
|
|
649
|
+
function validate$g(obj, path = 'ConversationRuntimeProxyMessageRepresentation') {
|
|
650
650
|
const v_error = (() => {
|
|
651
651
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
652
652
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -660,7 +660,7 @@ function validate$e(obj, path = 'ConversationRuntimeProxyMessageRepresentation')
|
|
|
660
660
|
for (let i = 0; i < obj_choices.length; i++) {
|
|
661
661
|
const obj_choices_item = obj_choices[i];
|
|
662
662
|
const path_choices_item = path_choices + '[' + i + ']';
|
|
663
|
-
const referencepath_choices_itemValidationError = validate$
|
|
663
|
+
const referencepath_choices_itemValidationError = validate$i(obj_choices_item, path_choices_item);
|
|
664
664
|
if (referencepath_choices_itemValidationError !== null) {
|
|
665
665
|
let message = 'Object doesn\'t match ConversationRuntimeProxyChoiceRepresentation (at "' + path_choices_item + '")\n';
|
|
666
666
|
message += referencepath_choices_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -677,7 +677,7 @@ function validate$e(obj, path = 'ConversationRuntimeProxyMessageRepresentation')
|
|
|
677
677
|
for (let i = 0; i < obj_collect.length; i++) {
|
|
678
678
|
const obj_collect_item = obj_collect[i];
|
|
679
679
|
const path_collect_item = path_collect + '[' + i + ']';
|
|
680
|
-
const referencepath_collect_itemValidationError = validate$
|
|
680
|
+
const referencepath_collect_itemValidationError = validate$h(obj_collect_item, path_collect_item);
|
|
681
681
|
if (referencepath_collect_itemValidationError !== null) {
|
|
682
682
|
let message = 'Object doesn\'t match CollectMessageRepresentation (at "' + path_collect_item + '")\n';
|
|
683
683
|
message += referencepath_collect_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -694,7 +694,7 @@ function validate$e(obj, path = 'ConversationRuntimeProxyMessageRepresentation')
|
|
|
694
694
|
for (let i = 0; i < obj_confirm.length; i++) {
|
|
695
695
|
const obj_confirm_item = obj_confirm[i];
|
|
696
696
|
const path_confirm_item = path_confirm + '[' + i + ']';
|
|
697
|
-
const referencepath_confirm_itemValidationError = validate$
|
|
697
|
+
const referencepath_confirm_itemValidationError = validate$k(obj_confirm_item, path_confirm_item);
|
|
698
698
|
if (referencepath_confirm_itemValidationError !== null) {
|
|
699
699
|
let message = 'Object doesn\'t match EsTypeMessageRepresentation (at "' + path_confirm_item + '")\n';
|
|
700
700
|
message += referencepath_confirm_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -777,6 +777,13 @@ function validate$e(obj, path = 'ConversationRuntimeProxyMessageRepresentation')
|
|
|
777
777
|
if (typeof obj_id !== 'string') {
|
|
778
778
|
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
779
779
|
}
|
|
780
|
+
if (obj.isContentSafe !== undefined) {
|
|
781
|
+
const obj_isContentSafe = obj.isContentSafe;
|
|
782
|
+
const path_isContentSafe = path + '.isContentSafe';
|
|
783
|
+
if (typeof obj_isContentSafe !== 'boolean') {
|
|
784
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isContentSafe + '" (at "' + path_isContentSafe + '")');
|
|
785
|
+
}
|
|
786
|
+
}
|
|
780
787
|
if (obj.message !== undefined) {
|
|
781
788
|
const obj_message = obj.message;
|
|
782
789
|
const path_message = path + '.message';
|
|
@@ -870,7 +877,7 @@ function validate$e(obj, path = 'ConversationRuntimeProxyMessageRepresentation')
|
|
|
870
877
|
for (let i = 0; i < obj_result.length; i++) {
|
|
871
878
|
const obj_result_item = obj_result[i];
|
|
872
879
|
const path_result_item = path_result + '[' + i + ']';
|
|
873
|
-
const referencepath_result_itemValidationError = validate$
|
|
880
|
+
const referencepath_result_itemValidationError = validate$k(obj_result_item, path_result_item);
|
|
874
881
|
if (referencepath_result_itemValidationError !== null) {
|
|
875
882
|
let message = 'Object doesn\'t match EsTypeMessageRepresentation (at "' + path_result_item + '")\n';
|
|
876
883
|
message += referencepath_result_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -944,26 +951,26 @@ function validate$e(obj, path = 'ConversationRuntimeProxyMessageRepresentation')
|
|
|
944
951
|
})();
|
|
945
952
|
return v_error === undefined ? null : v_error;
|
|
946
953
|
}
|
|
947
|
-
const RepresentationType$
|
|
948
|
-
function keyBuilder$
|
|
949
|
-
return keyPrefix + '::' + RepresentationType$
|
|
954
|
+
const RepresentationType$6 = 'ConversationRuntimeProxyMessageRepresentation';
|
|
955
|
+
function keyBuilder$a(luvio, config) {
|
|
956
|
+
return keyPrefix + '::' + RepresentationType$6 + ':' + config.id;
|
|
950
957
|
}
|
|
951
958
|
function keyBuilderFromType$2(luvio, object) {
|
|
952
959
|
const keyParams = {
|
|
953
960
|
id: object.id
|
|
954
961
|
};
|
|
955
|
-
return keyBuilder$
|
|
962
|
+
return keyBuilder$a(luvio, keyParams);
|
|
956
963
|
}
|
|
957
|
-
function normalize$
|
|
964
|
+
function normalize$6(input, existing, path, luvio, store, timestamp) {
|
|
958
965
|
return input;
|
|
959
966
|
}
|
|
960
|
-
const select$
|
|
961
|
-
const { selections: ConversationRuntimeProxyChoiceRepresentation__selections, opaque: ConversationRuntimeProxyChoiceRepresentation__opaque, } = select$
|
|
962
|
-
const { selections: CollectMessageRepresentation__selections, opaque: CollectMessageRepresentation__opaque, } = select$
|
|
963
|
-
const { selections: EsTypeMessageRepresentation__selections, opaque: EsTypeMessageRepresentation__opaque, } = select$
|
|
967
|
+
const select$g = function ConversationRuntimeProxyMessageRepresentationSelect() {
|
|
968
|
+
const { selections: ConversationRuntimeProxyChoiceRepresentation__selections, opaque: ConversationRuntimeProxyChoiceRepresentation__opaque, } = select$i();
|
|
969
|
+
const { selections: CollectMessageRepresentation__selections, opaque: CollectMessageRepresentation__opaque, } = select$h();
|
|
970
|
+
const { selections: EsTypeMessageRepresentation__selections, opaque: EsTypeMessageRepresentation__opaque, } = select$j();
|
|
964
971
|
return {
|
|
965
972
|
kind: 'Fragment',
|
|
966
|
-
version: VERSION$
|
|
973
|
+
version: VERSION$a,
|
|
967
974
|
private: [],
|
|
968
975
|
selections: [
|
|
969
976
|
{
|
|
@@ -1007,6 +1014,11 @@ const select$d = function ConversationRuntimeProxyMessageRepresentationSelect()
|
|
|
1007
1014
|
name: 'id',
|
|
1008
1015
|
kind: 'Scalar'
|
|
1009
1016
|
},
|
|
1017
|
+
{
|
|
1018
|
+
name: 'isContentSafe',
|
|
1019
|
+
kind: 'Scalar',
|
|
1020
|
+
required: false
|
|
1021
|
+
},
|
|
1010
1022
|
{
|
|
1011
1023
|
name: 'message',
|
|
1012
1024
|
kind: 'Scalar',
|
|
@@ -1047,7 +1059,20 @@ const select$d = function ConversationRuntimeProxyMessageRepresentationSelect()
|
|
|
1047
1059
|
]
|
|
1048
1060
|
};
|
|
1049
1061
|
};
|
|
1050
|
-
function equals$
|
|
1062
|
+
function equals$a(existing, incoming) {
|
|
1063
|
+
const existing_isContentSafe = existing.isContentSafe;
|
|
1064
|
+
const incoming_isContentSafe = incoming.isContentSafe;
|
|
1065
|
+
// if at least one of these optionals is defined
|
|
1066
|
+
if (existing_isContentSafe !== undefined || incoming_isContentSafe !== undefined) {
|
|
1067
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1068
|
+
// not equal
|
|
1069
|
+
if (existing_isContentSafe === undefined || incoming_isContentSafe === undefined) {
|
|
1070
|
+
return false;
|
|
1071
|
+
}
|
|
1072
|
+
if (!(existing_isContentSafe === incoming_isContentSafe)) {
|
|
1073
|
+
return false;
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1051
1076
|
const existing_id = existing.id;
|
|
1052
1077
|
const incoming_id = incoming.id;
|
|
1053
1078
|
if (!(existing_id === incoming_id)) {
|
|
@@ -1076,7 +1101,7 @@ function equals$8(existing, incoming) {
|
|
|
1076
1101
|
return false;
|
|
1077
1102
|
}
|
|
1078
1103
|
const equals_choices_items = equalsArray(existing_choices, incoming_choices, (existing_choices_item, incoming_choices_item) => {
|
|
1079
|
-
if (!(equals$
|
|
1104
|
+
if (!(equals$c(existing_choices_item, incoming_choices_item))) {
|
|
1080
1105
|
return false;
|
|
1081
1106
|
}
|
|
1082
1107
|
});
|
|
@@ -1094,7 +1119,7 @@ function equals$8(existing, incoming) {
|
|
|
1094
1119
|
return false;
|
|
1095
1120
|
}
|
|
1096
1121
|
const equals_collect_items = equalsArray(existing_collect, incoming_collect, (existing_collect_item, incoming_collect_item) => {
|
|
1097
|
-
if (!(equals$
|
|
1122
|
+
if (!(equals$b(existing_collect_item, incoming_collect_item))) {
|
|
1098
1123
|
return false;
|
|
1099
1124
|
}
|
|
1100
1125
|
});
|
|
@@ -1112,7 +1137,7 @@ function equals$8(existing, incoming) {
|
|
|
1112
1137
|
return false;
|
|
1113
1138
|
}
|
|
1114
1139
|
const equals_confirm_items = equalsArray(existing_confirm, incoming_confirm, (existing_confirm_item, incoming_confirm_item) => {
|
|
1115
|
-
if (!(equals$
|
|
1140
|
+
if (!(equals$d(existing_confirm_item, incoming_confirm_item))) {
|
|
1116
1141
|
return false;
|
|
1117
1142
|
}
|
|
1118
1143
|
});
|
|
@@ -1213,7 +1238,7 @@ function equals$8(existing, incoming) {
|
|
|
1213
1238
|
return false;
|
|
1214
1239
|
}
|
|
1215
1240
|
const equals_result_items = equalsArray(existing_result, incoming_result, (existing_result_item, incoming_result_item) => {
|
|
1216
|
-
if (!(equals$
|
|
1241
|
+
if (!(equals$d(existing_result_item, incoming_result_item))) {
|
|
1217
1242
|
return false;
|
|
1218
1243
|
}
|
|
1219
1244
|
});
|
|
@@ -1249,31 +1274,31 @@ function equals$8(existing, incoming) {
|
|
|
1249
1274
|
}
|
|
1250
1275
|
return true;
|
|
1251
1276
|
}
|
|
1252
|
-
const ingest$
|
|
1277
|
+
const ingest$6 = function ConversationRuntimeProxyMessageRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1253
1278
|
if (process.env.NODE_ENV !== 'production') {
|
|
1254
|
-
const validateError = validate$
|
|
1279
|
+
const validateError = validate$g(input);
|
|
1255
1280
|
if (validateError !== null) {
|
|
1256
1281
|
throw validateError;
|
|
1257
1282
|
}
|
|
1258
1283
|
}
|
|
1259
1284
|
const key = keyBuilderFromType$2(luvio, input);
|
|
1260
|
-
const ttlToUse = TTL$
|
|
1261
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
1285
|
+
const ttlToUse = TTL$6;
|
|
1286
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$6, "einstein-copilot-bot", VERSION$a, RepresentationType$6, equals$a);
|
|
1262
1287
|
return createLink(key);
|
|
1263
1288
|
};
|
|
1264
|
-
function getTypeCacheKeys$
|
|
1289
|
+
function getTypeCacheKeys$6(rootKeySet, luvio, input, fullPathFactory) {
|
|
1265
1290
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1266
1291
|
const rootKey = keyBuilderFromType$2(luvio, input);
|
|
1267
1292
|
rootKeySet.set(rootKey, {
|
|
1268
1293
|
namespace: keyPrefix,
|
|
1269
|
-
representationName: RepresentationType$
|
|
1294
|
+
representationName: RepresentationType$6,
|
|
1270
1295
|
mergeable: false
|
|
1271
1296
|
});
|
|
1272
1297
|
}
|
|
1273
1298
|
|
|
1274
|
-
const TTL$
|
|
1275
|
-
const VERSION$
|
|
1276
|
-
function validate$
|
|
1299
|
+
const TTL$5 = 30000;
|
|
1300
|
+
const VERSION$9 = "fe7024fb1132250f97d9616482f09f99";
|
|
1301
|
+
function validate$f(obj, path = 'ConversationRuntimeProxyRepresentation') {
|
|
1277
1302
|
const v_error = (() => {
|
|
1278
1303
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1279
1304
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1325,23 +1350,23 @@ function validate$d(obj, path = 'ConversationRuntimeProxyRepresentation') {
|
|
|
1325
1350
|
})();
|
|
1326
1351
|
return v_error === undefined ? null : v_error;
|
|
1327
1352
|
}
|
|
1328
|
-
const RepresentationType$
|
|
1329
|
-
function keyBuilder$
|
|
1330
|
-
return keyPrefix + '::' + RepresentationType$
|
|
1353
|
+
const RepresentationType$5 = 'ConversationRuntimeProxyRepresentation';
|
|
1354
|
+
function keyBuilder$9(luvio, config) {
|
|
1355
|
+
return keyPrefix + '::' + RepresentationType$5 + ':' + config.id;
|
|
1331
1356
|
}
|
|
1332
1357
|
function keyBuilderFromType$1(luvio, object) {
|
|
1333
1358
|
const keyParams = {
|
|
1334
1359
|
id: object.requestId
|
|
1335
1360
|
};
|
|
1336
|
-
return keyBuilder$
|
|
1361
|
+
return keyBuilder$9(luvio, keyParams);
|
|
1337
1362
|
}
|
|
1338
|
-
function normalize$
|
|
1363
|
+
function normalize$5(input, existing, path, luvio, store, timestamp) {
|
|
1339
1364
|
const input_messages = input.messages;
|
|
1340
1365
|
const input_messages_id = path.fullPath + '__messages';
|
|
1341
1366
|
for (let i = 0; i < input_messages.length; i++) {
|
|
1342
1367
|
const input_messages_item = input_messages[i];
|
|
1343
1368
|
let input_messages_item_id = input_messages_id + '__' + i;
|
|
1344
|
-
input_messages[i] = ingest$
|
|
1369
|
+
input_messages[i] = ingest$6(input_messages_item, {
|
|
1345
1370
|
fullPath: input_messages_item_id,
|
|
1346
1371
|
propertyName: i,
|
|
1347
1372
|
parent: {
|
|
@@ -1354,10 +1379,10 @@ function normalize$4(input, existing, path, luvio, store, timestamp) {
|
|
|
1354
1379
|
}
|
|
1355
1380
|
return input;
|
|
1356
1381
|
}
|
|
1357
|
-
const select$
|
|
1382
|
+
const select$f = function ConversationRuntimeProxyRepresentationSelect() {
|
|
1358
1383
|
return {
|
|
1359
1384
|
kind: 'Fragment',
|
|
1360
|
-
version: VERSION$
|
|
1385
|
+
version: VERSION$9,
|
|
1361
1386
|
private: [],
|
|
1362
1387
|
selections: [
|
|
1363
1388
|
{
|
|
@@ -1372,7 +1397,7 @@ const select$c = function ConversationRuntimeProxyRepresentationSelect() {
|
|
|
1372
1397
|
name: 'messages',
|
|
1373
1398
|
kind: 'Link',
|
|
1374
1399
|
plural: true,
|
|
1375
|
-
fragment: select$
|
|
1400
|
+
fragment: select$g()
|
|
1376
1401
|
},
|
|
1377
1402
|
{
|
|
1378
1403
|
name: 'processedSequenceIds',
|
|
@@ -1390,7 +1415,7 @@ const select$c = function ConversationRuntimeProxyRepresentationSelect() {
|
|
|
1390
1415
|
]
|
|
1391
1416
|
};
|
|
1392
1417
|
};
|
|
1393
|
-
function equals$
|
|
1418
|
+
function equals$9(existing, incoming) {
|
|
1394
1419
|
const existing_botId = existing.botId;
|
|
1395
1420
|
const incoming_botId = incoming.botId;
|
|
1396
1421
|
if (!(existing_botId === incoming_botId)) {
|
|
@@ -1433,45 +1458,45 @@ function equals$7(existing, incoming) {
|
|
|
1433
1458
|
}
|
|
1434
1459
|
return true;
|
|
1435
1460
|
}
|
|
1436
|
-
const ingest$
|
|
1461
|
+
const ingest$5 = function ConversationRuntimeProxyRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1437
1462
|
if (process.env.NODE_ENV !== 'production') {
|
|
1438
|
-
const validateError = validate$
|
|
1463
|
+
const validateError = validate$f(input);
|
|
1439
1464
|
if (validateError !== null) {
|
|
1440
1465
|
throw validateError;
|
|
1441
1466
|
}
|
|
1442
1467
|
}
|
|
1443
1468
|
const key = keyBuilderFromType$1(luvio, input);
|
|
1444
|
-
const ttlToUse = TTL$
|
|
1445
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
1469
|
+
const ttlToUse = TTL$5;
|
|
1470
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$5, "einstein-copilot-bot", VERSION$9, RepresentationType$5, equals$9);
|
|
1446
1471
|
return createLink(key);
|
|
1447
1472
|
};
|
|
1448
|
-
function getTypeCacheKeys$
|
|
1473
|
+
function getTypeCacheKeys$5(rootKeySet, luvio, input, fullPathFactory) {
|
|
1449
1474
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1450
1475
|
const rootKey = keyBuilderFromType$1(luvio, input);
|
|
1451
1476
|
rootKeySet.set(rootKey, {
|
|
1452
1477
|
namespace: keyPrefix,
|
|
1453
|
-
representationName: RepresentationType$
|
|
1478
|
+
representationName: RepresentationType$5,
|
|
1454
1479
|
mergeable: false
|
|
1455
1480
|
});
|
|
1456
1481
|
const input_messages_length = input.messages.length;
|
|
1457
1482
|
for (let i = 0; i < input_messages_length; i++) {
|
|
1458
|
-
getTypeCacheKeys$
|
|
1483
|
+
getTypeCacheKeys$6(rootKeySet, luvio, input.messages[i]);
|
|
1459
1484
|
}
|
|
1460
1485
|
}
|
|
1461
1486
|
|
|
1462
|
-
function select$
|
|
1463
|
-
return select$
|
|
1487
|
+
function select$e(luvio, params) {
|
|
1488
|
+
return select$f();
|
|
1464
1489
|
}
|
|
1465
|
-
function getResponseCacheKeys$
|
|
1466
|
-
getTypeCacheKeys$
|
|
1490
|
+
function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
|
|
1491
|
+
getTypeCacheKeys$5(storeKeyMap, luvio, response);
|
|
1467
1492
|
}
|
|
1468
|
-
function ingestSuccess$
|
|
1493
|
+
function ingestSuccess$5(luvio, resourceParams, response) {
|
|
1469
1494
|
const { body } = response;
|
|
1470
1495
|
const key = keyBuilderFromType$1(luvio, body);
|
|
1471
|
-
luvio.storeIngest(key, ingest$
|
|
1496
|
+
luvio.storeIngest(key, ingest$5, body);
|
|
1472
1497
|
const snapshot = luvio.storeLookup({
|
|
1473
1498
|
recordId: key,
|
|
1474
|
-
node: select$
|
|
1499
|
+
node: select$e(),
|
|
1475
1500
|
variables: {},
|
|
1476
1501
|
});
|
|
1477
1502
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -1482,7 +1507,7 @@ function ingestSuccess$4(luvio, resourceParams, response) {
|
|
|
1482
1507
|
deepFreeze(snapshot.data);
|
|
1483
1508
|
return snapshot;
|
|
1484
1509
|
}
|
|
1485
|
-
function createResourceRequest$
|
|
1510
|
+
function createResourceRequest$5(config) {
|
|
1486
1511
|
const headers = {};
|
|
1487
1512
|
return {
|
|
1488
1513
|
baseUri: '/services/data/v61.0',
|
|
@@ -1496,7 +1521,7 @@ function createResourceRequest$4(config) {
|
|
|
1496
1521
|
};
|
|
1497
1522
|
}
|
|
1498
1523
|
|
|
1499
|
-
const adapterName$
|
|
1524
|
+
const adapterName$5 = 'sendMessage';
|
|
1500
1525
|
const sendMessage_ConfigPropertyMetadata = [
|
|
1501
1526
|
generateParamConfigMetadata('botId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1502
1527
|
generateParamConfigMetadata('botVersionId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
@@ -1513,11 +1538,11 @@ const sendMessage_ConfigPropertyMetadata = [
|
|
|
1513
1538
|
generateParamConfigMetadata('variables', false, 2 /* Body */, 4 /* Unsupported */, true),
|
|
1514
1539
|
generateParamConfigMetadata('userUtterance', false, 2 /* Body */, 0 /* String */),
|
|
1515
1540
|
];
|
|
1516
|
-
const sendMessage_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
1517
|
-
const createResourceParams$
|
|
1518
|
-
function typeCheckConfig$
|
|
1541
|
+
const sendMessage_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, sendMessage_ConfigPropertyMetadata);
|
|
1542
|
+
const createResourceParams$5 = /*#__PURE__*/ createResourceParams$7(sendMessage_ConfigPropertyMetadata);
|
|
1543
|
+
function typeCheckConfig$5(untrustedConfig) {
|
|
1519
1544
|
const config = {};
|
|
1520
|
-
typeCheckConfig$
|
|
1545
|
+
typeCheckConfig$7(untrustedConfig, config, sendMessage_ConfigPropertyMetadata);
|
|
1521
1546
|
const untrustedConfig_planTemplateVariables = untrustedConfig.planTemplateVariables;
|
|
1522
1547
|
config.planTemplateVariables = untrustedConfig_planTemplateVariables;
|
|
1523
1548
|
const untrustedConfig_reply = untrustedConfig.reply;
|
|
@@ -1525,7 +1550,7 @@ function typeCheckConfig$4(untrustedConfig) {
|
|
|
1525
1550
|
const untrustedConfig_reply_array = [];
|
|
1526
1551
|
for (let i = 0, arrayLength = untrustedConfig_reply.length; i < arrayLength; i++) {
|
|
1527
1552
|
const untrustedConfig_reply_item = untrustedConfig_reply[i];
|
|
1528
|
-
const referenceEsTypeMessageRepresentationValidationError = validate$
|
|
1553
|
+
const referenceEsTypeMessageRepresentationValidationError = validate$k(untrustedConfig_reply_item);
|
|
1529
1554
|
if (referenceEsTypeMessageRepresentationValidationError === null) {
|
|
1530
1555
|
untrustedConfig_reply_array.push(untrustedConfig_reply_item);
|
|
1531
1556
|
}
|
|
@@ -1537,7 +1562,7 @@ function typeCheckConfig$4(untrustedConfig) {
|
|
|
1537
1562
|
const untrustedConfig_variables_array = [];
|
|
1538
1563
|
for (let i = 0, arrayLength = untrustedConfig_variables.length; i < arrayLength; i++) {
|
|
1539
1564
|
const untrustedConfig_variables_item = untrustedConfig_variables[i];
|
|
1540
|
-
const referenceVariableRepresentationValidationError = validate$
|
|
1565
|
+
const referenceVariableRepresentationValidationError = validate$j(untrustedConfig_variables_item);
|
|
1541
1566
|
if (referenceVariableRepresentationValidationError === null) {
|
|
1542
1567
|
untrustedConfig_variables_array.push(untrustedConfig_variables_item);
|
|
1543
1568
|
}
|
|
@@ -1546,30 +1571,30 @@ function typeCheckConfig$4(untrustedConfig) {
|
|
|
1546
1571
|
}
|
|
1547
1572
|
return config;
|
|
1548
1573
|
}
|
|
1549
|
-
function validateAdapterConfig$
|
|
1574
|
+
function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
|
|
1550
1575
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
1551
1576
|
return null;
|
|
1552
1577
|
}
|
|
1553
1578
|
if (process.env.NODE_ENV !== 'production') {
|
|
1554
1579
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
1555
1580
|
}
|
|
1556
|
-
const config = typeCheckConfig$
|
|
1581
|
+
const config = typeCheckConfig$5(untrustedConfig);
|
|
1557
1582
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1558
1583
|
return null;
|
|
1559
1584
|
}
|
|
1560
1585
|
return config;
|
|
1561
1586
|
}
|
|
1562
|
-
function buildNetworkSnapshot$
|
|
1563
|
-
const resourceParams = createResourceParams$
|
|
1564
|
-
const request = createResourceRequest$
|
|
1587
|
+
function buildNetworkSnapshot$5(luvio, config, options) {
|
|
1588
|
+
const resourceParams = createResourceParams$5(config);
|
|
1589
|
+
const request = createResourceRequest$5(resourceParams);
|
|
1565
1590
|
return luvio.dispatchResourceRequest(request, options)
|
|
1566
1591
|
.then((response) => {
|
|
1567
1592
|
return luvio.handleSuccessResponse(() => {
|
|
1568
|
-
const snapshot = ingestSuccess$
|
|
1593
|
+
const snapshot = ingestSuccess$5(luvio, resourceParams, response);
|
|
1569
1594
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1570
1595
|
}, () => {
|
|
1571
1596
|
const cache = new StoreKeyMap();
|
|
1572
|
-
getResponseCacheKeys$
|
|
1597
|
+
getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
|
|
1573
1598
|
return cache;
|
|
1574
1599
|
});
|
|
1575
1600
|
}, (response) => {
|
|
@@ -1579,17 +1604,17 @@ function buildNetworkSnapshot$4(luvio, config, options) {
|
|
|
1579
1604
|
}
|
|
1580
1605
|
const sendMessageAdapterFactory = (luvio) => {
|
|
1581
1606
|
return function sendMessage(untrustedConfig) {
|
|
1582
|
-
const config = validateAdapterConfig$
|
|
1607
|
+
const config = validateAdapterConfig$5(untrustedConfig, sendMessage_ConfigPropertyNames);
|
|
1583
1608
|
// Invalid or incomplete config
|
|
1584
1609
|
if (config === null) {
|
|
1585
1610
|
throw new Error('Invalid config for "sendMessage"');
|
|
1586
1611
|
}
|
|
1587
|
-
return buildNetworkSnapshot$
|
|
1612
|
+
return buildNetworkSnapshot$5(luvio, config);
|
|
1588
1613
|
};
|
|
1589
1614
|
};
|
|
1590
1615
|
|
|
1591
|
-
const VERSION$
|
|
1592
|
-
function validate$
|
|
1616
|
+
const VERSION$8 = "504437088c2317480c651ac05a7565b5";
|
|
1617
|
+
function validate$e(obj, path = 'PlanTemplateRepresentation') {
|
|
1593
1618
|
const v_error = (() => {
|
|
1594
1619
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1595
1620
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1631,10 +1656,10 @@ function validate$c(obj, path = 'PlanTemplateRepresentation') {
|
|
|
1631
1656
|
})();
|
|
1632
1657
|
return v_error === undefined ? null : v_error;
|
|
1633
1658
|
}
|
|
1634
|
-
const select$
|
|
1659
|
+
const select$d = function PlanTemplateRepresentationSelect() {
|
|
1635
1660
|
return {
|
|
1636
1661
|
kind: 'Fragment',
|
|
1637
|
-
version: VERSION$
|
|
1662
|
+
version: VERSION$8,
|
|
1638
1663
|
private: [],
|
|
1639
1664
|
selections: [
|
|
1640
1665
|
{
|
|
@@ -1661,7 +1686,7 @@ const select$a = function PlanTemplateRepresentationSelect() {
|
|
|
1661
1686
|
]
|
|
1662
1687
|
};
|
|
1663
1688
|
};
|
|
1664
|
-
function equals$
|
|
1689
|
+
function equals$8(existing, incoming) {
|
|
1665
1690
|
const existing_intent = existing.intent;
|
|
1666
1691
|
const incoming_intent = incoming.intent;
|
|
1667
1692
|
if (!(existing_intent === incoming_intent)) {
|
|
@@ -1695,9 +1720,9 @@ function equals$6(existing, incoming) {
|
|
|
1695
1720
|
return true;
|
|
1696
1721
|
}
|
|
1697
1722
|
|
|
1698
|
-
const TTL$
|
|
1699
|
-
const VERSION$
|
|
1700
|
-
function validate$
|
|
1723
|
+
const TTL$4 = 900000;
|
|
1724
|
+
const VERSION$7 = "0503b0c5ce250e7f5fbf16f2d3f2fec4";
|
|
1725
|
+
function validate$d(obj, path = 'RecommendedPlanTemplatesRepresentation') {
|
|
1701
1726
|
const v_error = (() => {
|
|
1702
1727
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1703
1728
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1722,7 +1747,7 @@ function validate$b(obj, path = 'RecommendedPlanTemplatesRepresentation') {
|
|
|
1722
1747
|
for (let i = 0; i < obj_planTemplates.length; i++) {
|
|
1723
1748
|
const obj_planTemplates_item = obj_planTemplates[i];
|
|
1724
1749
|
const path_planTemplates_item = path_planTemplates + '[' + i + ']';
|
|
1725
|
-
const referencepath_planTemplates_itemValidationError = validate$
|
|
1750
|
+
const referencepath_planTemplates_itemValidationError = validate$e(obj_planTemplates_item, path_planTemplates_item);
|
|
1726
1751
|
if (referencepath_planTemplates_itemValidationError !== null) {
|
|
1727
1752
|
let message = 'Object doesn\'t match PlanTemplateRepresentation (at "' + path_planTemplates_item + '")\n';
|
|
1728
1753
|
message += referencepath_planTemplates_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1732,15 +1757,15 @@ function validate$b(obj, path = 'RecommendedPlanTemplatesRepresentation') {
|
|
|
1732
1757
|
})();
|
|
1733
1758
|
return v_error === undefined ? null : v_error;
|
|
1734
1759
|
}
|
|
1735
|
-
const RepresentationType$
|
|
1736
|
-
function normalize$
|
|
1760
|
+
const RepresentationType$4 = 'RecommendedPlanTemplatesRepresentation';
|
|
1761
|
+
function normalize$4(input, existing, path, luvio, store, timestamp) {
|
|
1737
1762
|
return input;
|
|
1738
1763
|
}
|
|
1739
|
-
const select$
|
|
1740
|
-
const { selections: PlanTemplateRepresentation__selections, opaque: PlanTemplateRepresentation__opaque, } = select$
|
|
1764
|
+
const select$c = function RecommendedPlanTemplatesRepresentationSelect() {
|
|
1765
|
+
const { selections: PlanTemplateRepresentation__selections, opaque: PlanTemplateRepresentation__opaque, } = select$d();
|
|
1741
1766
|
return {
|
|
1742
1767
|
kind: 'Fragment',
|
|
1743
|
-
version: VERSION$
|
|
1768
|
+
version: VERSION$7,
|
|
1744
1769
|
private: [],
|
|
1745
1770
|
selections: [
|
|
1746
1771
|
{
|
|
@@ -1761,7 +1786,7 @@ const select$9 = function RecommendedPlanTemplatesRepresentationSelect() {
|
|
|
1761
1786
|
]
|
|
1762
1787
|
};
|
|
1763
1788
|
};
|
|
1764
|
-
function equals$
|
|
1789
|
+
function equals$7(existing, incoming) {
|
|
1765
1790
|
const existing_isSuccess = existing.isSuccess;
|
|
1766
1791
|
const incoming_isSuccess = incoming.isSuccess;
|
|
1767
1792
|
if (!(existing_isSuccess === incoming_isSuccess)) {
|
|
@@ -1783,7 +1808,7 @@ function equals$5(existing, incoming) {
|
|
|
1783
1808
|
const existing_planTemplates = existing.planTemplates;
|
|
1784
1809
|
const incoming_planTemplates = incoming.planTemplates;
|
|
1785
1810
|
const equals_planTemplates_items = equalsArray(existing_planTemplates, incoming_planTemplates, (existing_planTemplates_item, incoming_planTemplates_item) => {
|
|
1786
|
-
if (!(equals$
|
|
1811
|
+
if (!(equals$8(existing_planTemplates_item, incoming_planTemplates_item))) {
|
|
1787
1812
|
return false;
|
|
1788
1813
|
}
|
|
1789
1814
|
});
|
|
@@ -1792,44 +1817,44 @@ function equals$5(existing, incoming) {
|
|
|
1792
1817
|
}
|
|
1793
1818
|
return true;
|
|
1794
1819
|
}
|
|
1795
|
-
const ingest$
|
|
1820
|
+
const ingest$4 = function RecommendedPlanTemplatesRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1796
1821
|
if (process.env.NODE_ENV !== 'production') {
|
|
1797
|
-
const validateError = validate$
|
|
1822
|
+
const validateError = validate$d(input);
|
|
1798
1823
|
if (validateError !== null) {
|
|
1799
1824
|
throw validateError;
|
|
1800
1825
|
}
|
|
1801
1826
|
}
|
|
1802
1827
|
const key = path.fullPath;
|
|
1803
|
-
const ttlToUse = TTL$
|
|
1804
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
1828
|
+
const ttlToUse = TTL$4;
|
|
1829
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "einstein-copilot-bot", VERSION$7, RepresentationType$4, equals$7);
|
|
1805
1830
|
return createLink(key);
|
|
1806
1831
|
};
|
|
1807
|
-
function getTypeCacheKeys$
|
|
1832
|
+
function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
|
|
1808
1833
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1809
1834
|
const rootKey = fullPathFactory();
|
|
1810
1835
|
rootKeySet.set(rootKey, {
|
|
1811
1836
|
namespace: keyPrefix,
|
|
1812
|
-
representationName: RepresentationType$
|
|
1837
|
+
representationName: RepresentationType$4,
|
|
1813
1838
|
mergeable: false
|
|
1814
1839
|
});
|
|
1815
1840
|
}
|
|
1816
1841
|
|
|
1817
|
-
function select$
|
|
1818
|
-
return select$
|
|
1842
|
+
function select$b(luvio, params) {
|
|
1843
|
+
return select$c();
|
|
1819
1844
|
}
|
|
1820
|
-
function keyBuilder$
|
|
1845
|
+
function keyBuilder$8(luvio, params) {
|
|
1821
1846
|
return keyPrefix + '::RecommendedPlanTemplatesRepresentation:(' + 'pageType:' + params.urlParams.pageType + ',' + 'objectType:' + params.urlParams.objectType + ')';
|
|
1822
1847
|
}
|
|
1823
|
-
function getResponseCacheKeys$
|
|
1824
|
-
getTypeCacheKeys$
|
|
1848
|
+
function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
|
|
1849
|
+
getTypeCacheKeys$4(storeKeyMap, luvio, response, () => keyBuilder$8(luvio, resourceParams));
|
|
1825
1850
|
}
|
|
1826
|
-
function ingestSuccess$
|
|
1851
|
+
function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
|
|
1827
1852
|
const { body } = response;
|
|
1828
|
-
const key = keyBuilder$
|
|
1829
|
-
luvio.storeIngest(key, ingest$
|
|
1853
|
+
const key = keyBuilder$8(luvio, resourceParams);
|
|
1854
|
+
luvio.storeIngest(key, ingest$4, body);
|
|
1830
1855
|
const snapshot = luvio.storeLookup({
|
|
1831
1856
|
recordId: key,
|
|
1832
|
-
node: select$
|
|
1857
|
+
node: select$b(),
|
|
1833
1858
|
variables: {},
|
|
1834
1859
|
}, snapshotRefresh);
|
|
1835
1860
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -1840,19 +1865,19 @@ function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
1840
1865
|
deepFreeze(snapshot.data);
|
|
1841
1866
|
return snapshot;
|
|
1842
1867
|
}
|
|
1843
|
-
function ingestError$
|
|
1844
|
-
const key = keyBuilder$
|
|
1868
|
+
function ingestError$3(luvio, params, error, snapshotRefresh) {
|
|
1869
|
+
const key = keyBuilder$8(luvio, params);
|
|
1845
1870
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1846
1871
|
const storeMetadataParams = {
|
|
1847
|
-
ttl: TTL$
|
|
1872
|
+
ttl: TTL$4,
|
|
1848
1873
|
namespace: keyPrefix,
|
|
1849
|
-
version: VERSION$
|
|
1850
|
-
representationName: RepresentationType$
|
|
1874
|
+
version: VERSION$7,
|
|
1875
|
+
representationName: RepresentationType$4
|
|
1851
1876
|
};
|
|
1852
1877
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1853
1878
|
return errorSnapshot;
|
|
1854
1879
|
}
|
|
1855
|
-
function createResourceRequest$
|
|
1880
|
+
function createResourceRequest$4(config) {
|
|
1856
1881
|
const headers = {};
|
|
1857
1882
|
return {
|
|
1858
1883
|
baseUri: '/services/data/v61.0',
|
|
@@ -1866,96 +1891,96 @@ function createResourceRequest$3(config) {
|
|
|
1866
1891
|
};
|
|
1867
1892
|
}
|
|
1868
1893
|
|
|
1869
|
-
const adapterName$
|
|
1894
|
+
const adapterName$4 = 'getRecommendedPlanTemplates';
|
|
1870
1895
|
const getRecommendedPlanTemplates_ConfigPropertyMetadata = [
|
|
1871
1896
|
generateParamConfigMetadata('pageType', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1872
1897
|
generateParamConfigMetadata('objectType', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1873
1898
|
];
|
|
1874
|
-
const getRecommendedPlanTemplates_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
1875
|
-
const createResourceParams$
|
|
1876
|
-
function keyBuilder$
|
|
1877
|
-
const resourceParams = createResourceParams$
|
|
1878
|
-
return keyBuilder$
|
|
1899
|
+
const getRecommendedPlanTemplates_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, getRecommendedPlanTemplates_ConfigPropertyMetadata);
|
|
1900
|
+
const createResourceParams$4 = /*#__PURE__*/ createResourceParams$7(getRecommendedPlanTemplates_ConfigPropertyMetadata);
|
|
1901
|
+
function keyBuilder$7(luvio, config) {
|
|
1902
|
+
const resourceParams = createResourceParams$4(config);
|
|
1903
|
+
return keyBuilder$8(luvio, resourceParams);
|
|
1879
1904
|
}
|
|
1880
|
-
function typeCheckConfig$
|
|
1905
|
+
function typeCheckConfig$4(untrustedConfig) {
|
|
1881
1906
|
const config = {};
|
|
1882
|
-
typeCheckConfig$
|
|
1907
|
+
typeCheckConfig$7(untrustedConfig, config, getRecommendedPlanTemplates_ConfigPropertyMetadata);
|
|
1883
1908
|
return config;
|
|
1884
1909
|
}
|
|
1885
|
-
function validateAdapterConfig$
|
|
1910
|
+
function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
|
|
1886
1911
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
1887
1912
|
return null;
|
|
1888
1913
|
}
|
|
1889
1914
|
if (process.env.NODE_ENV !== 'production') {
|
|
1890
1915
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
1891
1916
|
}
|
|
1892
|
-
const config = typeCheckConfig$
|
|
1917
|
+
const config = typeCheckConfig$4(untrustedConfig);
|
|
1893
1918
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1894
1919
|
return null;
|
|
1895
1920
|
}
|
|
1896
1921
|
return config;
|
|
1897
1922
|
}
|
|
1898
|
-
function adapterFragment$
|
|
1899
|
-
createResourceParams$
|
|
1900
|
-
return select$
|
|
1923
|
+
function adapterFragment$3(luvio, config) {
|
|
1924
|
+
createResourceParams$4(config);
|
|
1925
|
+
return select$b();
|
|
1901
1926
|
}
|
|
1902
|
-
function onFetchResponseSuccess$
|
|
1903
|
-
const snapshot = ingestSuccess$
|
|
1927
|
+
function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
|
|
1928
|
+
const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
|
|
1904
1929
|
config,
|
|
1905
|
-
resolve: () => buildNetworkSnapshot$
|
|
1930
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
1906
1931
|
});
|
|
1907
1932
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1908
1933
|
}
|
|
1909
|
-
function onFetchResponseError$
|
|
1910
|
-
const snapshot = ingestError$
|
|
1934
|
+
function onFetchResponseError$3(luvio, config, resourceParams, response) {
|
|
1935
|
+
const snapshot = ingestError$3(luvio, resourceParams, response, {
|
|
1911
1936
|
config,
|
|
1912
|
-
resolve: () => buildNetworkSnapshot$
|
|
1937
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
1913
1938
|
});
|
|
1914
1939
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1915
1940
|
}
|
|
1916
|
-
function buildNetworkSnapshot$
|
|
1917
|
-
const resourceParams = createResourceParams$
|
|
1918
|
-
const request = createResourceRequest$
|
|
1941
|
+
function buildNetworkSnapshot$4(luvio, config, options) {
|
|
1942
|
+
const resourceParams = createResourceParams$4(config);
|
|
1943
|
+
const request = createResourceRequest$4(resourceParams);
|
|
1919
1944
|
return luvio.dispatchResourceRequest(request, options)
|
|
1920
1945
|
.then((response) => {
|
|
1921
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$
|
|
1946
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => {
|
|
1922
1947
|
const cache = new StoreKeyMap();
|
|
1923
|
-
getResponseCacheKeys$
|
|
1948
|
+
getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
|
|
1924
1949
|
return cache;
|
|
1925
1950
|
});
|
|
1926
1951
|
}, (response) => {
|
|
1927
|
-
return luvio.handleErrorResponse(() => onFetchResponseError$
|
|
1952
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
|
|
1928
1953
|
});
|
|
1929
1954
|
}
|
|
1930
|
-
function buildNetworkSnapshotCachePolicy$
|
|
1931
|
-
return buildNetworkSnapshotCachePolicy$
|
|
1955
|
+
function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
|
|
1956
|
+
return buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext, buildNetworkSnapshot$4, undefined, false);
|
|
1932
1957
|
}
|
|
1933
|
-
function buildCachedSnapshotCachePolicy$
|
|
1958
|
+
function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
|
|
1934
1959
|
const { luvio, config } = context;
|
|
1935
1960
|
const selector = {
|
|
1936
|
-
recordId: keyBuilder$
|
|
1937
|
-
node: adapterFragment$
|
|
1961
|
+
recordId: keyBuilder$7(luvio, config),
|
|
1962
|
+
node: adapterFragment$3(luvio, config),
|
|
1938
1963
|
variables: {},
|
|
1939
1964
|
};
|
|
1940
1965
|
const cacheSnapshot = storeLookup(selector, {
|
|
1941
1966
|
config,
|
|
1942
|
-
resolve: () => buildNetworkSnapshot$
|
|
1967
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
1943
1968
|
});
|
|
1944
1969
|
return cacheSnapshot;
|
|
1945
1970
|
}
|
|
1946
1971
|
const getRecommendedPlanTemplatesAdapterFactory = (luvio) => function einsteinCopilotBot__getRecommendedPlanTemplates(untrustedConfig, requestContext) {
|
|
1947
|
-
const config = validateAdapterConfig$
|
|
1972
|
+
const config = validateAdapterConfig$4(untrustedConfig, getRecommendedPlanTemplates_ConfigPropertyNames);
|
|
1948
1973
|
// Invalid or incomplete config
|
|
1949
1974
|
if (config === null) {
|
|
1950
1975
|
return null;
|
|
1951
1976
|
}
|
|
1952
1977
|
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1953
|
-
buildCachedSnapshotCachePolicy$
|
|
1978
|
+
buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
|
|
1954
1979
|
};
|
|
1955
1980
|
|
|
1956
|
-
const TTL$
|
|
1957
|
-
const VERSION$
|
|
1958
|
-
function validate$
|
|
1981
|
+
const TTL$3 = 100;
|
|
1982
|
+
const VERSION$6 = "7454bdd46af1622eb677a9bb9eac3a8b";
|
|
1983
|
+
function validate$c(obj, path = 'CopilotLLMFeedbackOutputRepresentation') {
|
|
1959
1984
|
const v_error = (() => {
|
|
1960
1985
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1961
1986
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1968,23 +1993,23 @@ function validate$a(obj, path = 'CopilotLLMFeedbackOutputRepresentation') {
|
|
|
1968
1993
|
})();
|
|
1969
1994
|
return v_error === undefined ? null : v_error;
|
|
1970
1995
|
}
|
|
1971
|
-
const RepresentationType$
|
|
1972
|
-
function keyBuilder$
|
|
1973
|
-
return keyPrefix + '::' + RepresentationType$
|
|
1996
|
+
const RepresentationType$3 = 'CopilotLLMFeedbackOutputRepresentation';
|
|
1997
|
+
function keyBuilder$6(luvio, config) {
|
|
1998
|
+
return keyPrefix + '::' + RepresentationType$3 + ':' + config.id;
|
|
1974
1999
|
}
|
|
1975
2000
|
function keyBuilderFromType(luvio, object) {
|
|
1976
2001
|
const keyParams = {
|
|
1977
2002
|
id: object.submitFeedbackStatus
|
|
1978
2003
|
};
|
|
1979
|
-
return keyBuilder$
|
|
2004
|
+
return keyBuilder$6(luvio, keyParams);
|
|
1980
2005
|
}
|
|
1981
|
-
function normalize$
|
|
2006
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
1982
2007
|
return input;
|
|
1983
2008
|
}
|
|
1984
|
-
const select$
|
|
2009
|
+
const select$a = function CopilotLLMFeedbackOutputRepresentationSelect() {
|
|
1985
2010
|
return {
|
|
1986
2011
|
kind: 'Fragment',
|
|
1987
|
-
version: VERSION$
|
|
2012
|
+
version: VERSION$6,
|
|
1988
2013
|
private: [],
|
|
1989
2014
|
selections: [
|
|
1990
2015
|
{
|
|
@@ -1994,7 +2019,7 @@ const select$7 = function CopilotLLMFeedbackOutputRepresentationSelect() {
|
|
|
1994
2019
|
]
|
|
1995
2020
|
};
|
|
1996
2021
|
};
|
|
1997
|
-
function equals$
|
|
2022
|
+
function equals$6(existing, incoming) {
|
|
1998
2023
|
const existing_submitFeedbackStatus = existing.submitFeedbackStatus;
|
|
1999
2024
|
const incoming_submitFeedbackStatus = incoming.submitFeedbackStatus;
|
|
2000
2025
|
if (!(existing_submitFeedbackStatus === incoming_submitFeedbackStatus)) {
|
|
@@ -2002,41 +2027,41 @@ function equals$4(existing, incoming) {
|
|
|
2002
2027
|
}
|
|
2003
2028
|
return true;
|
|
2004
2029
|
}
|
|
2005
|
-
const ingest$
|
|
2030
|
+
const ingest$3 = function CopilotLLMFeedbackOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2006
2031
|
if (process.env.NODE_ENV !== 'production') {
|
|
2007
|
-
const validateError = validate$
|
|
2032
|
+
const validateError = validate$c(input);
|
|
2008
2033
|
if (validateError !== null) {
|
|
2009
2034
|
throw validateError;
|
|
2010
2035
|
}
|
|
2011
2036
|
}
|
|
2012
2037
|
const key = keyBuilderFromType(luvio, input);
|
|
2013
|
-
const ttlToUse = TTL$
|
|
2014
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
2038
|
+
const ttlToUse = TTL$3;
|
|
2039
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "einstein-copilot-bot", VERSION$6, RepresentationType$3, equals$6);
|
|
2015
2040
|
return createLink(key);
|
|
2016
2041
|
};
|
|
2017
|
-
function getTypeCacheKeys$
|
|
2042
|
+
function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
|
|
2018
2043
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2019
2044
|
const rootKey = keyBuilderFromType(luvio, input);
|
|
2020
2045
|
rootKeySet.set(rootKey, {
|
|
2021
2046
|
namespace: keyPrefix,
|
|
2022
|
-
representationName: RepresentationType$
|
|
2047
|
+
representationName: RepresentationType$3,
|
|
2023
2048
|
mergeable: false
|
|
2024
2049
|
});
|
|
2025
2050
|
}
|
|
2026
2051
|
|
|
2027
|
-
function select$
|
|
2028
|
-
return select$
|
|
2052
|
+
function select$9(luvio, params) {
|
|
2053
|
+
return select$a();
|
|
2029
2054
|
}
|
|
2030
|
-
function getResponseCacheKeys$
|
|
2031
|
-
getTypeCacheKeys$
|
|
2055
|
+
function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
|
|
2056
|
+
getTypeCacheKeys$3(storeKeyMap, luvio, response);
|
|
2032
2057
|
}
|
|
2033
|
-
function ingestSuccess$
|
|
2058
|
+
function ingestSuccess$3(luvio, resourceParams, response) {
|
|
2034
2059
|
const { body } = response;
|
|
2035
2060
|
const key = keyBuilderFromType(luvio, body);
|
|
2036
|
-
luvio.storeIngest(key, ingest$
|
|
2061
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
2037
2062
|
const snapshot = luvio.storeLookup({
|
|
2038
2063
|
recordId: key,
|
|
2039
|
-
node: select$
|
|
2064
|
+
node: select$9(),
|
|
2040
2065
|
variables: {},
|
|
2041
2066
|
});
|
|
2042
2067
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -2047,7 +2072,7 @@ function ingestSuccess$2(luvio, resourceParams, response) {
|
|
|
2047
2072
|
deepFreeze(snapshot.data);
|
|
2048
2073
|
return snapshot;
|
|
2049
2074
|
}
|
|
2050
|
-
function createResourceRequest$
|
|
2075
|
+
function createResourceRequest$3(config) {
|
|
2051
2076
|
const headers = {};
|
|
2052
2077
|
return {
|
|
2053
2078
|
baseUri: '/services/data/v61.0',
|
|
@@ -2061,7 +2086,7 @@ function createResourceRequest$2(config) {
|
|
|
2061
2086
|
};
|
|
2062
2087
|
}
|
|
2063
2088
|
|
|
2064
|
-
const adapterName$
|
|
2089
|
+
const adapterName$3 = 'submitFeedback';
|
|
2065
2090
|
const submitFeedback_ConfigPropertyMetadata = [
|
|
2066
2091
|
generateParamConfigMetadata('details', true, 2 /* Body */, 4 /* Unsupported */),
|
|
2067
2092
|
generateParamConfigMetadata('feedback', true, 2 /* Body */, 0 /* String */),
|
|
@@ -2069,11 +2094,11 @@ const submitFeedback_ConfigPropertyMetadata = [
|
|
|
2069
2094
|
generateParamConfigMetadata('sessionId', true, 2 /* Body */, 0 /* String */),
|
|
2070
2095
|
generateParamConfigMetadata('text', true, 2 /* Body */, 0 /* String */),
|
|
2071
2096
|
];
|
|
2072
|
-
const submitFeedback_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
2073
|
-
const createResourceParams$
|
|
2074
|
-
function typeCheckConfig$
|
|
2097
|
+
const submitFeedback_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, submitFeedback_ConfigPropertyMetadata);
|
|
2098
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$7(submitFeedback_ConfigPropertyMetadata);
|
|
2099
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
2075
2100
|
const config = {};
|
|
2076
|
-
typeCheckConfig$
|
|
2101
|
+
typeCheckConfig$7(untrustedConfig, config, submitFeedback_ConfigPropertyMetadata);
|
|
2077
2102
|
const untrustedConfig_details = untrustedConfig.details;
|
|
2078
2103
|
if (untrustedIsObject(untrustedConfig_details)) {
|
|
2079
2104
|
const untrustedConfig_details_object = {};
|
|
@@ -2091,30 +2116,30 @@ function typeCheckConfig$2(untrustedConfig) {
|
|
|
2091
2116
|
}
|
|
2092
2117
|
return config;
|
|
2093
2118
|
}
|
|
2094
|
-
function validateAdapterConfig$
|
|
2119
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
2095
2120
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
2096
2121
|
return null;
|
|
2097
2122
|
}
|
|
2098
2123
|
if (process.env.NODE_ENV !== 'production') {
|
|
2099
2124
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
2100
2125
|
}
|
|
2101
|
-
const config = typeCheckConfig$
|
|
2126
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
2102
2127
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2103
2128
|
return null;
|
|
2104
2129
|
}
|
|
2105
2130
|
return config;
|
|
2106
2131
|
}
|
|
2107
|
-
function buildNetworkSnapshot$
|
|
2108
|
-
const resourceParams = createResourceParams$
|
|
2109
|
-
const request = createResourceRequest$
|
|
2132
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
2133
|
+
const resourceParams = createResourceParams$3(config);
|
|
2134
|
+
const request = createResourceRequest$3(resourceParams);
|
|
2110
2135
|
return luvio.dispatchResourceRequest(request, options)
|
|
2111
2136
|
.then((response) => {
|
|
2112
2137
|
return luvio.handleSuccessResponse(() => {
|
|
2113
|
-
const snapshot = ingestSuccess$
|
|
2138
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response);
|
|
2114
2139
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
2115
2140
|
}, () => {
|
|
2116
2141
|
const cache = new StoreKeyMap();
|
|
2117
|
-
getResponseCacheKeys$
|
|
2142
|
+
getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
|
|
2118
2143
|
return cache;
|
|
2119
2144
|
});
|
|
2120
2145
|
}, (response) => {
|
|
@@ -2124,13 +2149,282 @@ function buildNetworkSnapshot$2(luvio, config, options) {
|
|
|
2124
2149
|
}
|
|
2125
2150
|
const submitFeedbackAdapterFactory = (luvio) => {
|
|
2126
2151
|
return function submitFeedback(untrustedConfig) {
|
|
2127
|
-
const config = validateAdapterConfig$
|
|
2152
|
+
const config = validateAdapterConfig$3(untrustedConfig, submitFeedback_ConfigPropertyNames);
|
|
2128
2153
|
// Invalid or incomplete config
|
|
2129
2154
|
if (config === null) {
|
|
2130
2155
|
throw new Error('Invalid config for "submitFeedback"');
|
|
2131
2156
|
}
|
|
2132
|
-
return buildNetworkSnapshot$
|
|
2157
|
+
return buildNetworkSnapshot$3(luvio, config);
|
|
2158
|
+
};
|
|
2159
|
+
};
|
|
2160
|
+
|
|
2161
|
+
const VERSION$5 = "24d61d5f37ff09155ee4a9d90eb4fcb5";
|
|
2162
|
+
function validate$b(obj, path = 'CopilotObjectInfoRepresentation') {
|
|
2163
|
+
const v_error = (() => {
|
|
2164
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2165
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2166
|
+
}
|
|
2167
|
+
const obj_apiName = obj.apiName;
|
|
2168
|
+
const path_apiName = path + '.apiName';
|
|
2169
|
+
if (typeof obj_apiName !== 'string') {
|
|
2170
|
+
return new TypeError('Expected "string" but received "' + typeof obj_apiName + '" (at "' + path_apiName + '")');
|
|
2171
|
+
}
|
|
2172
|
+
const obj_label = obj.label;
|
|
2173
|
+
const path_label = path + '.label';
|
|
2174
|
+
if (typeof obj_label !== 'string') {
|
|
2175
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
2176
|
+
}
|
|
2177
|
+
})();
|
|
2178
|
+
return v_error === undefined ? null : v_error;
|
|
2179
|
+
}
|
|
2180
|
+
const select$8 = function CopilotObjectInfoRepresentationSelect() {
|
|
2181
|
+
return {
|
|
2182
|
+
kind: 'Fragment',
|
|
2183
|
+
version: VERSION$5,
|
|
2184
|
+
private: [],
|
|
2185
|
+
selections: [
|
|
2186
|
+
{
|
|
2187
|
+
name: 'apiName',
|
|
2188
|
+
kind: 'Scalar'
|
|
2189
|
+
},
|
|
2190
|
+
{
|
|
2191
|
+
name: 'label',
|
|
2192
|
+
kind: 'Scalar'
|
|
2193
|
+
}
|
|
2194
|
+
]
|
|
2195
|
+
};
|
|
2196
|
+
};
|
|
2197
|
+
function equals$5(existing, incoming) {
|
|
2198
|
+
const existing_apiName = existing.apiName;
|
|
2199
|
+
const incoming_apiName = incoming.apiName;
|
|
2200
|
+
if (!(existing_apiName === incoming_apiName)) {
|
|
2201
|
+
return false;
|
|
2202
|
+
}
|
|
2203
|
+
const existing_label = existing.label;
|
|
2204
|
+
const incoming_label = incoming.label;
|
|
2205
|
+
if (!(existing_label === incoming_label)) {
|
|
2206
|
+
return false;
|
|
2207
|
+
}
|
|
2208
|
+
return true;
|
|
2209
|
+
}
|
|
2210
|
+
|
|
2211
|
+
const TTL$2 = 900000;
|
|
2212
|
+
const VERSION$4 = "ca1aedcbd4e34795fadf2dcaf66e5825";
|
|
2213
|
+
function validate$a(obj, path = 'CopilotObjectListRepresentation') {
|
|
2214
|
+
const v_error = (() => {
|
|
2215
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2216
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2217
|
+
}
|
|
2218
|
+
const obj_objects = obj.objects;
|
|
2219
|
+
const path_objects = path + '.objects';
|
|
2220
|
+
if (!ArrayIsArray(obj_objects)) {
|
|
2221
|
+
return new TypeError('Expected "array" but received "' + typeof obj_objects + '" (at "' + path_objects + '")');
|
|
2222
|
+
}
|
|
2223
|
+
for (let i = 0; i < obj_objects.length; i++) {
|
|
2224
|
+
const obj_objects_item = obj_objects[i];
|
|
2225
|
+
const path_objects_item = path_objects + '[' + i + ']';
|
|
2226
|
+
const referencepath_objects_itemValidationError = validate$b(obj_objects_item, path_objects_item);
|
|
2227
|
+
if (referencepath_objects_itemValidationError !== null) {
|
|
2228
|
+
let message = 'Object doesn\'t match CopilotObjectInfoRepresentation (at "' + path_objects_item + '")\n';
|
|
2229
|
+
message += referencepath_objects_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2230
|
+
return new TypeError(message);
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2233
|
+
})();
|
|
2234
|
+
return v_error === undefined ? null : v_error;
|
|
2235
|
+
}
|
|
2236
|
+
const RepresentationType$2 = 'CopilotObjectListRepresentation';
|
|
2237
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
2238
|
+
return input;
|
|
2239
|
+
}
|
|
2240
|
+
const select$7 = function CopilotObjectListRepresentationSelect() {
|
|
2241
|
+
const { selections: CopilotObjectInfoRepresentation__selections, opaque: CopilotObjectInfoRepresentation__opaque, } = select$8();
|
|
2242
|
+
return {
|
|
2243
|
+
kind: 'Fragment',
|
|
2244
|
+
version: VERSION$4,
|
|
2245
|
+
private: [],
|
|
2246
|
+
selections: [
|
|
2247
|
+
{
|
|
2248
|
+
name: 'objects',
|
|
2249
|
+
kind: 'Object',
|
|
2250
|
+
plural: true,
|
|
2251
|
+
selections: CopilotObjectInfoRepresentation__selections
|
|
2252
|
+
}
|
|
2253
|
+
]
|
|
2254
|
+
};
|
|
2255
|
+
};
|
|
2256
|
+
function equals$4(existing, incoming) {
|
|
2257
|
+
const existing_objects = existing.objects;
|
|
2258
|
+
const incoming_objects = incoming.objects;
|
|
2259
|
+
const equals_objects_items = equalsArray(existing_objects, incoming_objects, (existing_objects_item, incoming_objects_item) => {
|
|
2260
|
+
if (!(equals$5(existing_objects_item, incoming_objects_item))) {
|
|
2261
|
+
return false;
|
|
2262
|
+
}
|
|
2263
|
+
});
|
|
2264
|
+
if (equals_objects_items === false) {
|
|
2265
|
+
return false;
|
|
2266
|
+
}
|
|
2267
|
+
return true;
|
|
2268
|
+
}
|
|
2269
|
+
const ingest$2 = function CopilotObjectListRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2270
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2271
|
+
const validateError = validate$a(input);
|
|
2272
|
+
if (validateError !== null) {
|
|
2273
|
+
throw validateError;
|
|
2274
|
+
}
|
|
2275
|
+
}
|
|
2276
|
+
const key = path.fullPath;
|
|
2277
|
+
const ttlToUse = TTL$2;
|
|
2278
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "einstein-copilot-bot", VERSION$4, RepresentationType$2, equals$4);
|
|
2279
|
+
return createLink(key);
|
|
2280
|
+
};
|
|
2281
|
+
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
2282
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2283
|
+
const rootKey = fullPathFactory();
|
|
2284
|
+
rootKeySet.set(rootKey, {
|
|
2285
|
+
namespace: keyPrefix,
|
|
2286
|
+
representationName: RepresentationType$2,
|
|
2287
|
+
mergeable: false
|
|
2288
|
+
});
|
|
2289
|
+
}
|
|
2290
|
+
|
|
2291
|
+
function select$6(luvio, params) {
|
|
2292
|
+
return select$7();
|
|
2293
|
+
}
|
|
2294
|
+
function keyBuilder$5(luvio, params) {
|
|
2295
|
+
return keyPrefix + '::CopilotObjectListRepresentation:(' + 'limit:' + params.queryParams.limit + ',' + 'searchTerm:' + params.queryParams.searchTerm + ')';
|
|
2296
|
+
}
|
|
2297
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
2298
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$5(luvio, resourceParams));
|
|
2299
|
+
}
|
|
2300
|
+
function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
2301
|
+
const { body } = response;
|
|
2302
|
+
const key = keyBuilder$5(luvio, resourceParams);
|
|
2303
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
2304
|
+
const snapshot = luvio.storeLookup({
|
|
2305
|
+
recordId: key,
|
|
2306
|
+
node: select$6(),
|
|
2307
|
+
variables: {},
|
|
2308
|
+
}, snapshotRefresh);
|
|
2309
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2310
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2311
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2312
|
+
}
|
|
2313
|
+
}
|
|
2314
|
+
deepFreeze(snapshot.data);
|
|
2315
|
+
return snapshot;
|
|
2316
|
+
}
|
|
2317
|
+
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
2318
|
+
const key = keyBuilder$5(luvio, params);
|
|
2319
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2320
|
+
const storeMetadataParams = {
|
|
2321
|
+
ttl: TTL$2,
|
|
2322
|
+
namespace: keyPrefix,
|
|
2323
|
+
version: VERSION$4,
|
|
2324
|
+
representationName: RepresentationType$2
|
|
2325
|
+
};
|
|
2326
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
2327
|
+
return errorSnapshot;
|
|
2328
|
+
}
|
|
2329
|
+
function createResourceRequest$2(config) {
|
|
2330
|
+
const headers = {};
|
|
2331
|
+
return {
|
|
2332
|
+
baseUri: '/services/data/v61.0',
|
|
2333
|
+
basePath: '/connect/copilot/objects',
|
|
2334
|
+
method: 'get',
|
|
2335
|
+
body: null,
|
|
2336
|
+
urlParams: {},
|
|
2337
|
+
queryParams: config.queryParams,
|
|
2338
|
+
headers,
|
|
2339
|
+
priority: 'normal',
|
|
2340
|
+
};
|
|
2341
|
+
}
|
|
2342
|
+
|
|
2343
|
+
const adapterName$2 = 'getCopilotObjects';
|
|
2344
|
+
const getCopilotObjects_ConfigPropertyMetadata = [
|
|
2345
|
+
generateParamConfigMetadata('limit', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
2346
|
+
generateParamConfigMetadata('searchTerm', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2347
|
+
];
|
|
2348
|
+
const getCopilotObjects_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getCopilotObjects_ConfigPropertyMetadata);
|
|
2349
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$7(getCopilotObjects_ConfigPropertyMetadata);
|
|
2350
|
+
function keyBuilder$4(luvio, config) {
|
|
2351
|
+
const resourceParams = createResourceParams$2(config);
|
|
2352
|
+
return keyBuilder$5(luvio, resourceParams);
|
|
2353
|
+
}
|
|
2354
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
2355
|
+
const config = {};
|
|
2356
|
+
typeCheckConfig$7(untrustedConfig, config, getCopilotObjects_ConfigPropertyMetadata);
|
|
2357
|
+
return config;
|
|
2358
|
+
}
|
|
2359
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
2360
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2361
|
+
return null;
|
|
2362
|
+
}
|
|
2363
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2364
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2365
|
+
}
|
|
2366
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
2367
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2368
|
+
return null;
|
|
2369
|
+
}
|
|
2370
|
+
return config;
|
|
2371
|
+
}
|
|
2372
|
+
function adapterFragment$2(luvio, config) {
|
|
2373
|
+
createResourceParams$2(config);
|
|
2374
|
+
return select$6();
|
|
2375
|
+
}
|
|
2376
|
+
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
2377
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
|
|
2378
|
+
config,
|
|
2379
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
2380
|
+
});
|
|
2381
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2382
|
+
}
|
|
2383
|
+
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
2384
|
+
const snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
2385
|
+
config,
|
|
2386
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
2387
|
+
});
|
|
2388
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2389
|
+
}
|
|
2390
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
2391
|
+
const resourceParams = createResourceParams$2(config);
|
|
2392
|
+
const request = createResourceRequest$2(resourceParams);
|
|
2393
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2394
|
+
.then((response) => {
|
|
2395
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
|
|
2396
|
+
const cache = new StoreKeyMap();
|
|
2397
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
2398
|
+
return cache;
|
|
2399
|
+
});
|
|
2400
|
+
}, (response) => {
|
|
2401
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
|
|
2402
|
+
});
|
|
2403
|
+
}
|
|
2404
|
+
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
2405
|
+
return buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
|
|
2406
|
+
}
|
|
2407
|
+
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
2408
|
+
const { luvio, config } = context;
|
|
2409
|
+
const selector = {
|
|
2410
|
+
recordId: keyBuilder$4(luvio, config),
|
|
2411
|
+
node: adapterFragment$2(luvio, config),
|
|
2412
|
+
variables: {},
|
|
2133
2413
|
};
|
|
2414
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
2415
|
+
config,
|
|
2416
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
2417
|
+
});
|
|
2418
|
+
return cacheSnapshot;
|
|
2419
|
+
}
|
|
2420
|
+
const getCopilotObjectsAdapterFactory = (luvio) => function einsteinCopilotBot__getCopilotObjects(untrustedConfig, requestContext) {
|
|
2421
|
+
const config = validateAdapterConfig$2(untrustedConfig, getCopilotObjects_ConfigPropertyNames);
|
|
2422
|
+
// Invalid or incomplete config
|
|
2423
|
+
if (config === null) {
|
|
2424
|
+
return null;
|
|
2425
|
+
}
|
|
2426
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
2427
|
+
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
2134
2428
|
};
|
|
2135
2429
|
|
|
2136
2430
|
function validate$9(obj, path = 'FollowUpActionsDesignConfigRepresentation') {
|
|
@@ -2534,14 +2828,14 @@ const getFollowUpActions_ConfigPropertyMetadata = [
|
|
|
2534
2828
|
generateParamConfigMetadata('followUpActionsInputs', true, 2 /* Body */, 4 /* Unsupported */, true),
|
|
2535
2829
|
];
|
|
2536
2830
|
const getFollowUpActions_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getFollowUpActions_ConfigPropertyMetadata);
|
|
2537
|
-
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$
|
|
2831
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$7(getFollowUpActions_ConfigPropertyMetadata);
|
|
2538
2832
|
function keyBuilder$2(luvio, config) {
|
|
2539
2833
|
const resourceParams = createResourceParams$1(config);
|
|
2540
2834
|
return keyBuilder$3(luvio, resourceParams);
|
|
2541
2835
|
}
|
|
2542
2836
|
function typeCheckConfig$1(untrustedConfig) {
|
|
2543
2837
|
const config = {};
|
|
2544
|
-
typeCheckConfig$
|
|
2838
|
+
typeCheckConfig$7(untrustedConfig, config, getFollowUpActions_ConfigPropertyMetadata);
|
|
2545
2839
|
const untrustedConfig_followUpActionsInputs = untrustedConfig.followUpActionsInputs;
|
|
2546
2840
|
if (ArrayIsArray$1(untrustedConfig_followUpActionsInputs)) {
|
|
2547
2841
|
const untrustedConfig_followUpActionsInputs_array = [];
|
|
@@ -2602,7 +2896,7 @@ function buildNetworkSnapshot$1(luvio, config, options) {
|
|
|
2602
2896
|
});
|
|
2603
2897
|
}
|
|
2604
2898
|
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
2605
|
-
return buildNetworkSnapshotCachePolicy$
|
|
2899
|
+
return buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, 'get', false);
|
|
2606
2900
|
}
|
|
2607
2901
|
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
2608
2902
|
const { luvio, config } = context;
|
|
@@ -3213,22 +3507,22 @@ function createResourceRequest(config) {
|
|
|
3213
3507
|
const adapterName = 'getRecommendedActions';
|
|
3214
3508
|
const getRecommendedActions_ConfigPropertyMetadata = [
|
|
3215
3509
|
generateParamConfigMetadata('pageName', false, 1 /* QueryParameter */, 0 /* String */),
|
|
3216
|
-
generateParamConfigMetadata('pageType',
|
|
3510
|
+
generateParamConfigMetadata('pageType', true, 1 /* QueryParameter */, 0 /* String */),
|
|
3217
3511
|
generateParamConfigMetadata('actionName', false, 1 /* QueryParameter */, 0 /* String */),
|
|
3218
3512
|
generateParamConfigMetadata('objectApiName', false, 1 /* QueryParameter */, 0 /* String */),
|
|
3219
|
-
generateParamConfigMetadata('customApplicationName',
|
|
3220
|
-
generateParamConfigMetadata('sessionId',
|
|
3221
|
-
generateParamConfigMetadata('formFactor',
|
|
3513
|
+
generateParamConfigMetadata('customApplicationName', true, 1 /* QueryParameter */, 0 /* String */),
|
|
3514
|
+
generateParamConfigMetadata('sessionId', true, 1 /* QueryParameter */, 0 /* String */),
|
|
3515
|
+
generateParamConfigMetadata('formFactor', true, 1 /* QueryParameter */, 0 /* String */),
|
|
3222
3516
|
];
|
|
3223
3517
|
const getRecommendedActions_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getRecommendedActions_ConfigPropertyMetadata);
|
|
3224
|
-
const createResourceParams = /*#__PURE__*/ createResourceParams$
|
|
3518
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$7(getRecommendedActions_ConfigPropertyMetadata);
|
|
3225
3519
|
function keyBuilder(luvio, config) {
|
|
3226
3520
|
const resourceParams = createResourceParams(config);
|
|
3227
3521
|
return keyBuilder$1(luvio, resourceParams);
|
|
3228
3522
|
}
|
|
3229
3523
|
function typeCheckConfig(untrustedConfig) {
|
|
3230
3524
|
const config = {};
|
|
3231
|
-
typeCheckConfig$
|
|
3525
|
+
typeCheckConfig$7(untrustedConfig, config, getRecommendedActions_ConfigPropertyMetadata);
|
|
3232
3526
|
return config;
|
|
3233
3527
|
}
|
|
3234
3528
|
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
@@ -3277,7 +3571,7 @@ function buildNetworkSnapshot(luvio, config, options) {
|
|
|
3277
3571
|
});
|
|
3278
3572
|
}
|
|
3279
3573
|
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
3280
|
-
return buildNetworkSnapshotCachePolicy$
|
|
3574
|
+
return buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
3281
3575
|
}
|
|
3282
3576
|
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
3283
3577
|
const { luvio, config } = context;
|
|
@@ -3302,4 +3596,4 @@ const getRecommendedActionsAdapterFactory = (luvio) => function einsteinCopilotB
|
|
|
3302
3596
|
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
3303
3597
|
};
|
|
3304
3598
|
|
|
3305
|
-
export { getBotIdAdapterFactory, getFollowUpActionsAdapterFactory, getRecommendedActionsAdapterFactory, getRecommendedPlanTemplatesAdapterFactory, sendMessageAdapterFactory, submitFeedbackAdapterFactory };
|
|
3599
|
+
export { getBotIdAdapterFactory, getCopilotObjectsAdapterFactory, getFollowUpActionsAdapterFactory, getRecommendedActionsAdapterFactory, getRecommendedPlanTemplatesAdapterFactory, sendMessageAdapterFactory, submitFeedbackAdapterFactory };
|