@salesforce/lds-adapters-service-einstein-copilot-bot 1.264.0 → 1.266.0-dev1
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 +53 -12
- package/dist/es/es2018/types/src/generated/adapters/sendMessage.d.ts +2 -0
- package/dist/es/es2018/types/src/generated/resources/postConnectConversationRuntimeProxy.d.ts +2 -0
- package/dist/es/es2018/types/src/generated/types/ConversationRuntimeProxyInputRepresentation.d.ts +5 -1
- package/dist/es/es2018/types/src/generated/types/EsTypeMessageRepresentation.d.ts +3 -3
- package/dist/es/es2018/types/src/generated/types/VariableRepresentation.d.ts +32 -0
- package/package.json +3 -3
- package/sfdc/index.js +54 -13
- package/src/raml/api.raml +18 -1
- package/src/raml/luvio.raml +2 -0
|
@@ -72,6 +72,7 @@ function buildAdapterValidationConfig(displayName, paramsMeta) {
|
|
|
72
72
|
const keyPrefix = 'einstein-copilot-bot';
|
|
73
73
|
|
|
74
74
|
const { isArray: ArrayIsArray } = Array;
|
|
75
|
+
const { stringify: JSONStringify } = JSON;
|
|
75
76
|
function equalsArray(a, b, equalsItem) {
|
|
76
77
|
const aLength = a.length;
|
|
77
78
|
const bLength = b.length;
|
|
@@ -93,7 +94,7 @@ function createLink(ref) {
|
|
|
93
94
|
|
|
94
95
|
const TTL$2 = 30000;
|
|
95
96
|
const VERSION$5 = "ab85410a28124cfed3d8eae7b8236853";
|
|
96
|
-
function validate$
|
|
97
|
+
function validate$6(obj, path = 'CopilotBotInfoRepresentation') {
|
|
97
98
|
const v_error = (() => {
|
|
98
99
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
99
100
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -183,7 +184,7 @@ function equals$5(existing, incoming) {
|
|
|
183
184
|
}
|
|
184
185
|
const ingest$2 = function CopilotBotInfoRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
185
186
|
if (process.env.NODE_ENV !== 'production') {
|
|
186
|
-
const validateError = validate$
|
|
187
|
+
const validateError = validate$6(input);
|
|
187
188
|
if (validateError !== null) {
|
|
188
189
|
throw validateError;
|
|
189
190
|
}
|
|
@@ -338,8 +339,8 @@ const getBotIdAdapterFactory = (luvio) => function einsteinCopilotBot__getBotId(
|
|
|
338
339
|
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
339
340
|
};
|
|
340
341
|
|
|
341
|
-
const VERSION$4 = "
|
|
342
|
-
function validate$
|
|
342
|
+
const VERSION$4 = "35edf813cf9e135085be6a7af45aada2";
|
|
343
|
+
function validate$5(obj, path = 'EsTypeMessageRepresentation') {
|
|
343
344
|
const v_error = (() => {
|
|
344
345
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
345
346
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -351,8 +352,8 @@ function validate$4(obj, path = 'EsTypeMessageRepresentation') {
|
|
|
351
352
|
}
|
|
352
353
|
const obj_value = obj.value;
|
|
353
354
|
const path_value = path + '.value';
|
|
354
|
-
if (
|
|
355
|
-
return new TypeError('Expected "
|
|
355
|
+
if (obj_value === undefined) {
|
|
356
|
+
return new TypeError('Expected "defined" but received "' + typeof obj_value + '" (at "' + path_value + '")');
|
|
356
357
|
}
|
|
357
358
|
})();
|
|
358
359
|
return v_error === undefined ? null : v_error;
|
|
@@ -366,6 +367,11 @@ const select$5 = function EsTypeMessageRepresentationSelect() {
|
|
|
366
367
|
{
|
|
367
368
|
name: 'type',
|
|
368
369
|
kind: 'Scalar'
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
name: 'value',
|
|
373
|
+
kind: 'Object',
|
|
374
|
+
// any
|
|
369
375
|
}
|
|
370
376
|
]
|
|
371
377
|
};
|
|
@@ -376,11 +382,33 @@ function equals$4(existing, incoming) {
|
|
|
376
382
|
if (!(existing_type === incoming_type)) {
|
|
377
383
|
return false;
|
|
378
384
|
}
|
|
379
|
-
existing.value;
|
|
380
|
-
incoming.value;
|
|
385
|
+
const existing_value = existing.value;
|
|
386
|
+
const incoming_value = incoming.value;
|
|
387
|
+
if (JSONStringify(incoming_value) !== JSONStringify(existing_value)) {
|
|
388
|
+
return false;
|
|
389
|
+
}
|
|
381
390
|
return true;
|
|
382
391
|
}
|
|
383
392
|
|
|
393
|
+
function validate$4(obj, path = 'VariableRepresentation') {
|
|
394
|
+
const v_error = (() => {
|
|
395
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
396
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
397
|
+
}
|
|
398
|
+
const obj_name = obj.name;
|
|
399
|
+
const path_name = path + '.name';
|
|
400
|
+
if (typeof obj_name !== 'string') {
|
|
401
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
402
|
+
}
|
|
403
|
+
const obj_value = obj.value;
|
|
404
|
+
const path_value = path + '.value';
|
|
405
|
+
if (typeof obj_value !== 'string') {
|
|
406
|
+
return new TypeError('Expected "string" but received "' + typeof obj_value + '" (at "' + path_value + '")');
|
|
407
|
+
}
|
|
408
|
+
})();
|
|
409
|
+
return v_error === undefined ? null : v_error;
|
|
410
|
+
}
|
|
411
|
+
|
|
384
412
|
const VERSION$3 = "4e28b61c3ea362f1c68b28897784111e";
|
|
385
413
|
function validate$3(obj, path = 'ConversationRuntimeProxyChoiceRepresentation') {
|
|
386
414
|
const v_error = (() => {
|
|
@@ -439,7 +467,7 @@ function validate$2(obj, path = 'CollectMessageRepresentation') {
|
|
|
439
467
|
}
|
|
440
468
|
const obj_data = obj.data;
|
|
441
469
|
const path_data = path + '.data';
|
|
442
|
-
const referencepath_dataValidationError = validate$
|
|
470
|
+
const referencepath_dataValidationError = validate$5(obj_data, path_data);
|
|
443
471
|
if (referencepath_dataValidationError !== null) {
|
|
444
472
|
let message = 'Object doesn\'t match EsTypeMessageRepresentation (at "' + path_data + '")\n';
|
|
445
473
|
message += referencepath_dataValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -536,7 +564,7 @@ function validate$1(obj, path = 'ConversationRuntimeProxyMessageRepresentation')
|
|
|
536
564
|
for (let i = 0; i < obj_confirm.length; i++) {
|
|
537
565
|
const obj_confirm_item = obj_confirm[i];
|
|
538
566
|
const path_confirm_item = path_confirm + '[' + i + ']';
|
|
539
|
-
const referencepath_confirm_itemValidationError = validate$
|
|
567
|
+
const referencepath_confirm_itemValidationError = validate$5(obj_confirm_item, path_confirm_item);
|
|
540
568
|
if (referencepath_confirm_itemValidationError !== null) {
|
|
541
569
|
let message = 'Object doesn\'t match EsTypeMessageRepresentation (at "' + path_confirm_item + '")\n';
|
|
542
570
|
message += referencepath_confirm_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -656,7 +684,7 @@ function validate$1(obj, path = 'ConversationRuntimeProxyMessageRepresentation')
|
|
|
656
684
|
for (let i = 0; i < obj_result.length; i++) {
|
|
657
685
|
const obj_result_item = obj_result[i];
|
|
658
686
|
const path_result_item = path_result + '[' + i + ']';
|
|
659
|
-
const referencepath_result_itemValidationError = validate$
|
|
687
|
+
const referencepath_result_itemValidationError = validate$5(obj_result_item, path_result_item);
|
|
660
688
|
if (referencepath_result_itemValidationError !== null) {
|
|
661
689
|
let message = 'Object doesn\'t match EsTypeMessageRepresentation (at "' + path_result_item + '")\n';
|
|
662
690
|
message += referencepath_result_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1256,6 +1284,7 @@ const sendMessage_ConfigPropertyMetadata = [
|
|
|
1256
1284
|
generateParamConfigMetadata('reply', false, 2 /* Body */, 4 /* Unsupported */, true),
|
|
1257
1285
|
generateParamConfigMetadata('text', false, 2 /* Body */, 0 /* String */),
|
|
1258
1286
|
generateParamConfigMetadata('type', false, 2 /* Body */, 0 /* String */),
|
|
1287
|
+
generateParamConfigMetadata('variables', false, 2 /* Body */, 4 /* Unsupported */, true),
|
|
1259
1288
|
];
|
|
1260
1289
|
const sendMessage_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, sendMessage_ConfigPropertyMetadata);
|
|
1261
1290
|
const createResourceParams = /*#__PURE__*/ createResourceParams$2(sendMessage_ConfigPropertyMetadata);
|
|
@@ -1267,13 +1296,25 @@ function typeCheckConfig(untrustedConfig) {
|
|
|
1267
1296
|
const untrustedConfig_reply_array = [];
|
|
1268
1297
|
for (let i = 0, arrayLength = untrustedConfig_reply.length; i < arrayLength; i++) {
|
|
1269
1298
|
const untrustedConfig_reply_item = untrustedConfig_reply[i];
|
|
1270
|
-
const referenceEsTypeMessageRepresentationValidationError = validate$
|
|
1299
|
+
const referenceEsTypeMessageRepresentationValidationError = validate$5(untrustedConfig_reply_item);
|
|
1271
1300
|
if (referenceEsTypeMessageRepresentationValidationError === null) {
|
|
1272
1301
|
untrustedConfig_reply_array.push(untrustedConfig_reply_item);
|
|
1273
1302
|
}
|
|
1274
1303
|
}
|
|
1275
1304
|
config.reply = untrustedConfig_reply_array;
|
|
1276
1305
|
}
|
|
1306
|
+
const untrustedConfig_variables = untrustedConfig.variables;
|
|
1307
|
+
if (ArrayIsArray$1(untrustedConfig_variables)) {
|
|
1308
|
+
const untrustedConfig_variables_array = [];
|
|
1309
|
+
for (let i = 0, arrayLength = untrustedConfig_variables.length; i < arrayLength; i++) {
|
|
1310
|
+
const untrustedConfig_variables_item = untrustedConfig_variables[i];
|
|
1311
|
+
const referenceVariableRepresentationValidationError = validate$4(untrustedConfig_variables_item);
|
|
1312
|
+
if (referenceVariableRepresentationValidationError === null) {
|
|
1313
|
+
untrustedConfig_variables_array.push(untrustedConfig_variables_item);
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
config.variables = untrustedConfig_variables_array;
|
|
1317
|
+
}
|
|
1277
1318
|
return config;
|
|
1278
1319
|
}
|
|
1279
1320
|
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AdapterConfigMetadata as $64$luvio_engine_AdapterConfigMetadata, Luvio as $64$luvio_engine_Luvio, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
|
|
2
2
|
import { Untrusted as adapter$45$utils_Untrusted, AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig } from './adapter-utils';
|
|
3
3
|
import { EsTypeMessageRepresentation as types_EsTypeMessageRepresentation_EsTypeMessageRepresentation } from '../types/EsTypeMessageRepresentation';
|
|
4
|
+
import { VariableRepresentation as types_VariableRepresentation_VariableRepresentation } from '../types/VariableRepresentation';
|
|
4
5
|
import { ResourceRequestConfig as resources_postConnectConversationRuntimeProxy_ResourceRequestConfig } from '../resources/postConnectConversationRuntimeProxy';
|
|
5
6
|
import { ConversationRuntimeProxyRepresentation as types_ConversationRuntimeProxyRepresentation_ConversationRuntimeProxyRepresentation } from '../types/ConversationRuntimeProxyRepresentation';
|
|
6
7
|
export declare const adapterName = "sendMessage";
|
|
@@ -15,6 +16,7 @@ export interface SendMessageConfig {
|
|
|
15
16
|
reply?: Array<types_EsTypeMessageRepresentation_EsTypeMessageRepresentation>;
|
|
16
17
|
text?: string;
|
|
17
18
|
type?: string;
|
|
19
|
+
variables?: Array<types_VariableRepresentation_VariableRepresentation>;
|
|
18
20
|
}
|
|
19
21
|
export declare const createResourceParams: (config: SendMessageConfig) => resources_postConnectConversationRuntimeProxy_ResourceRequestConfig;
|
|
20
22
|
export declare function typeCheckConfig(untrustedConfig: adapter$45$utils_Untrusted<SendMessageConfig>): adapter$45$utils_Untrusted<SendMessageConfig>;
|
package/dist/es/es2018/types/src/generated/resources/postConnectConversationRuntimeProxy.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EsTypeMessageRepresentation as types_EsTypeMessageRepresentation_EsTypeMessageRepresentation } from '../types/EsTypeMessageRepresentation';
|
|
2
|
+
import { VariableRepresentation as types_VariableRepresentation_VariableRepresentation } from '../types/VariableRepresentation';
|
|
2
3
|
import { Luvio as $64$luvio_engine_Luvio, Fragment as $64$luvio_engine_Fragment, FetchResponse as $64$luvio_engine_FetchResponse, FulfilledSnapshot as $64$luvio_engine_FulfilledSnapshot, StaleSnapshot as $64$luvio_engine_StaleSnapshot, PendingSnapshot as $64$luvio_engine_PendingSnapshot, ResourceRequest as $64$luvio_engine_ResourceRequest } from '@luvio/engine';
|
|
3
4
|
import { ConversationRuntimeProxyRepresentation as types_ConversationRuntimeProxyRepresentation_ConversationRuntimeProxyRepresentation } from '../types/ConversationRuntimeProxyRepresentation';
|
|
4
5
|
export interface ResourceRequestConfig {
|
|
@@ -13,6 +14,7 @@ export interface ResourceRequestConfig {
|
|
|
13
14
|
reply?: Array<types_EsTypeMessageRepresentation_EsTypeMessageRepresentation>;
|
|
14
15
|
text?: string;
|
|
15
16
|
type?: string;
|
|
17
|
+
variables?: Array<types_VariableRepresentation_VariableRepresentation>;
|
|
16
18
|
};
|
|
17
19
|
}
|
|
18
20
|
export declare function select(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig): $64$luvio_engine_Fragment;
|
package/dist/es/es2018/types/src/generated/types/ConversationRuntimeProxyInputRepresentation.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EsTypeMessageRepresentation as EsTypeMessageRepresentation_EsTypeMessageRepresentation } from './EsTypeMessageRepresentation';
|
|
2
|
+
import { VariableRepresentation as VariableRepresentation_VariableRepresentation } from './VariableRepresentation';
|
|
2
3
|
import { IngestPath as $64$luvio_engine_IngestPath, Luvio as $64$luvio_engine_Luvio, Store as $64$luvio_engine_Store, FragmentSelection as $64$luvio_engine_FragmentSelection, ResourceIngest as $64$luvio_engine_ResourceIngest, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
|
|
3
|
-
export declare const VERSION = "
|
|
4
|
+
export declare const VERSION = "980bf6b4b948d722de8661d7f0f93eb0";
|
|
4
5
|
export declare function validate(obj: any, path?: string): TypeError | null;
|
|
5
6
|
export declare const RepresentationType: string;
|
|
6
7
|
export declare function normalize(input: ConversationRuntimeProxyInputRepresentation, existing: ConversationRuntimeProxyInputRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): ConversationRuntimeProxyInputRepresentationNormalized;
|
|
@@ -23,6 +24,8 @@ export interface ConversationRuntimeProxyInputRepresentationNormalized {
|
|
|
23
24
|
text?: string;
|
|
24
25
|
/** Type */
|
|
25
26
|
type?: string;
|
|
27
|
+
/** Variables */
|
|
28
|
+
variables?: Array<VariableRepresentation_VariableRepresentation>;
|
|
26
29
|
}
|
|
27
30
|
/**
|
|
28
31
|
* Bot conversation input
|
|
@@ -35,4 +38,5 @@ export interface ConversationRuntimeProxyInputRepresentation {
|
|
|
35
38
|
reply?: Array<EsTypeMessageRepresentation_EsTypeMessageRepresentation>;
|
|
36
39
|
text?: string;
|
|
37
40
|
type?: string;
|
|
41
|
+
variables?: Array<VariableRepresentation_VariableRepresentation>;
|
|
38
42
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IngestPath as $64$luvio_engine_IngestPath, Luvio as $64$luvio_engine_Luvio, Store as $64$luvio_engine_Store, FragmentSelection as $64$luvio_engine_FragmentSelection, ResourceIngest as $64$luvio_engine_ResourceIngest, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
|
|
2
2
|
export declare const TTL = 30000;
|
|
3
|
-
export declare const VERSION = "
|
|
3
|
+
export declare const VERSION = "35edf813cf9e135085be6a7af45aada2";
|
|
4
4
|
export declare function validate(obj: any, path?: string): TypeError | null;
|
|
5
5
|
export declare const RepresentationType: string;
|
|
6
6
|
export declare function normalize(input: EsTypeMessageRepresentation, existing: EsTypeMessageRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): EsTypeMessageRepresentationNormalized;
|
|
@@ -18,7 +18,7 @@ export interface EsTypeMessageRepresentationNormalized {
|
|
|
18
18
|
/** Type for the ES type message. */
|
|
19
19
|
type: string;
|
|
20
20
|
/** Value for the ES type message. */
|
|
21
|
-
value:
|
|
21
|
+
value: unknown;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Represents a ES type message
|
|
@@ -28,5 +28,5 @@ export interface EsTypeMessageRepresentationNormalized {
|
|
|
28
28
|
*/
|
|
29
29
|
export interface EsTypeMessageRepresentation {
|
|
30
30
|
type: string;
|
|
31
|
-
value:
|
|
31
|
+
value: unknown;
|
|
32
32
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { IngestPath as $64$luvio_engine_IngestPath, Luvio as $64$luvio_engine_Luvio, Store as $64$luvio_engine_Store, FragmentSelection as $64$luvio_engine_FragmentSelection, ResourceIngest as $64$luvio_engine_ResourceIngest, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
|
|
2
|
+
export declare const TTL = 30000;
|
|
3
|
+
export declare const VERSION = "810e13d8bf55f296fbb9eed86a0019f5";
|
|
4
|
+
export declare function validate(obj: any, path?: string): TypeError | null;
|
|
5
|
+
export declare const RepresentationType: string;
|
|
6
|
+
export declare function normalize(input: VariableRepresentation, existing: VariableRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): VariableRepresentationNormalized;
|
|
7
|
+
export declare const select: () => $64$luvio_engine_FragmentSelection;
|
|
8
|
+
export declare function equals(existing: VariableRepresentationNormalized, incoming: VariableRepresentationNormalized): boolean;
|
|
9
|
+
export declare const ingest: $64$luvio_engine_ResourceIngest;
|
|
10
|
+
export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableStoreKeyMetadataMap, luvio: $64$luvio_engine_Luvio, input: VariableRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): void;
|
|
11
|
+
/**
|
|
12
|
+
* Represents a single variable for an operation to set variables
|
|
13
|
+
*
|
|
14
|
+
* Keys:
|
|
15
|
+
* (none)
|
|
16
|
+
*/
|
|
17
|
+
export interface VariableRepresentationNormalized {
|
|
18
|
+
/** Name of the variable */
|
|
19
|
+
name: string;
|
|
20
|
+
/** Value of the variable */
|
|
21
|
+
value: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Represents a single variable for an operation to set variables
|
|
25
|
+
*
|
|
26
|
+
* Keys:
|
|
27
|
+
* (none)
|
|
28
|
+
*/
|
|
29
|
+
export interface VariableRepresentation {
|
|
30
|
+
name: string;
|
|
31
|
+
value: string;
|
|
32
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-adapters-service-einstein-copilot-bot",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.266.0-dev1",
|
|
4
4
|
"description": "Einstein Copilot Bot API Family",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "dist/es/es2018/service-einstein-copilot-bot.js",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"test:unit": "jest"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@salesforce/lds-bindings": "^1.
|
|
43
|
+
"@salesforce/lds-bindings": "^1.266.0-dev1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@salesforce/lds-compiler-plugins": "^1.
|
|
46
|
+
"@salesforce/lds-compiler-plugins": "^1.266.0-dev1"
|
|
47
47
|
},
|
|
48
48
|
"nx": {
|
|
49
49
|
"targets": {
|
package/sfdc/index.js
CHANGED
|
@@ -82,6 +82,7 @@ function buildAdapterValidationConfig(displayName, paramsMeta) {
|
|
|
82
82
|
const keyPrefix = 'einstein-copilot-bot';
|
|
83
83
|
|
|
84
84
|
const { isArray: ArrayIsArray } = Array;
|
|
85
|
+
const { stringify: JSONStringify } = JSON;
|
|
85
86
|
function equalsArray(a, b, equalsItem) {
|
|
86
87
|
const aLength = a.length;
|
|
87
88
|
const bLength = b.length;
|
|
@@ -103,7 +104,7 @@ function createLink(ref) {
|
|
|
103
104
|
|
|
104
105
|
const TTL$2 = 30000;
|
|
105
106
|
const VERSION$5 = "ab85410a28124cfed3d8eae7b8236853";
|
|
106
|
-
function validate$
|
|
107
|
+
function validate$6(obj, path = 'CopilotBotInfoRepresentation') {
|
|
107
108
|
const v_error = (() => {
|
|
108
109
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
109
110
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -193,7 +194,7 @@ function equals$5(existing, incoming) {
|
|
|
193
194
|
}
|
|
194
195
|
const ingest$2 = function CopilotBotInfoRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
195
196
|
if (process.env.NODE_ENV !== 'production') {
|
|
196
|
-
const validateError = validate$
|
|
197
|
+
const validateError = validate$6(input);
|
|
197
198
|
if (validateError !== null) {
|
|
198
199
|
throw validateError;
|
|
199
200
|
}
|
|
@@ -348,8 +349,8 @@ const getBotIdAdapterFactory = (luvio) => function einsteinCopilotBot__getBotId(
|
|
|
348
349
|
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
349
350
|
};
|
|
350
351
|
|
|
351
|
-
const VERSION$4 = "
|
|
352
|
-
function validate$
|
|
352
|
+
const VERSION$4 = "35edf813cf9e135085be6a7af45aada2";
|
|
353
|
+
function validate$5(obj, path = 'EsTypeMessageRepresentation') {
|
|
353
354
|
const v_error = (() => {
|
|
354
355
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
355
356
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -361,8 +362,8 @@ function validate$4(obj, path = 'EsTypeMessageRepresentation') {
|
|
|
361
362
|
}
|
|
362
363
|
const obj_value = obj.value;
|
|
363
364
|
const path_value = path + '.value';
|
|
364
|
-
if (
|
|
365
|
-
return new TypeError('Expected "
|
|
365
|
+
if (obj_value === undefined) {
|
|
366
|
+
return new TypeError('Expected "defined" but received "' + typeof obj_value + '" (at "' + path_value + '")');
|
|
366
367
|
}
|
|
367
368
|
})();
|
|
368
369
|
return v_error === undefined ? null : v_error;
|
|
@@ -376,6 +377,11 @@ const select$5 = function EsTypeMessageRepresentationSelect() {
|
|
|
376
377
|
{
|
|
377
378
|
name: 'type',
|
|
378
379
|
kind: 'Scalar'
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
name: 'value',
|
|
383
|
+
kind: 'Object',
|
|
384
|
+
// any
|
|
379
385
|
}
|
|
380
386
|
]
|
|
381
387
|
};
|
|
@@ -386,11 +392,33 @@ function equals$4(existing, incoming) {
|
|
|
386
392
|
if (!(existing_type === incoming_type)) {
|
|
387
393
|
return false;
|
|
388
394
|
}
|
|
389
|
-
existing.value;
|
|
390
|
-
incoming.value;
|
|
395
|
+
const existing_value = existing.value;
|
|
396
|
+
const incoming_value = incoming.value;
|
|
397
|
+
if (JSONStringify(incoming_value) !== JSONStringify(existing_value)) {
|
|
398
|
+
return false;
|
|
399
|
+
}
|
|
391
400
|
return true;
|
|
392
401
|
}
|
|
393
402
|
|
|
403
|
+
function validate$4(obj, path = 'VariableRepresentation') {
|
|
404
|
+
const v_error = (() => {
|
|
405
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
406
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
407
|
+
}
|
|
408
|
+
const obj_name = obj.name;
|
|
409
|
+
const path_name = path + '.name';
|
|
410
|
+
if (typeof obj_name !== 'string') {
|
|
411
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
412
|
+
}
|
|
413
|
+
const obj_value = obj.value;
|
|
414
|
+
const path_value = path + '.value';
|
|
415
|
+
if (typeof obj_value !== 'string') {
|
|
416
|
+
return new TypeError('Expected "string" but received "' + typeof obj_value + '" (at "' + path_value + '")');
|
|
417
|
+
}
|
|
418
|
+
})();
|
|
419
|
+
return v_error === undefined ? null : v_error;
|
|
420
|
+
}
|
|
421
|
+
|
|
394
422
|
const VERSION$3 = "4e28b61c3ea362f1c68b28897784111e";
|
|
395
423
|
function validate$3(obj, path = 'ConversationRuntimeProxyChoiceRepresentation') {
|
|
396
424
|
const v_error = (() => {
|
|
@@ -449,7 +477,7 @@ function validate$2(obj, path = 'CollectMessageRepresentation') {
|
|
|
449
477
|
}
|
|
450
478
|
const obj_data = obj.data;
|
|
451
479
|
const path_data = path + '.data';
|
|
452
|
-
const referencepath_dataValidationError = validate$
|
|
480
|
+
const referencepath_dataValidationError = validate$5(obj_data, path_data);
|
|
453
481
|
if (referencepath_dataValidationError !== null) {
|
|
454
482
|
let message = 'Object doesn\'t match EsTypeMessageRepresentation (at "' + path_data + '")\n';
|
|
455
483
|
message += referencepath_dataValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -546,7 +574,7 @@ function validate$1(obj, path = 'ConversationRuntimeProxyMessageRepresentation')
|
|
|
546
574
|
for (let i = 0; i < obj_confirm.length; i++) {
|
|
547
575
|
const obj_confirm_item = obj_confirm[i];
|
|
548
576
|
const path_confirm_item = path_confirm + '[' + i + ']';
|
|
549
|
-
const referencepath_confirm_itemValidationError = validate$
|
|
577
|
+
const referencepath_confirm_itemValidationError = validate$5(obj_confirm_item, path_confirm_item);
|
|
550
578
|
if (referencepath_confirm_itemValidationError !== null) {
|
|
551
579
|
let message = 'Object doesn\'t match EsTypeMessageRepresentation (at "' + path_confirm_item + '")\n';
|
|
552
580
|
message += referencepath_confirm_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -666,7 +694,7 @@ function validate$1(obj, path = 'ConversationRuntimeProxyMessageRepresentation')
|
|
|
666
694
|
for (let i = 0; i < obj_result.length; i++) {
|
|
667
695
|
const obj_result_item = obj_result[i];
|
|
668
696
|
const path_result_item = path_result + '[' + i + ']';
|
|
669
|
-
const referencepath_result_itemValidationError = validate$
|
|
697
|
+
const referencepath_result_itemValidationError = validate$5(obj_result_item, path_result_item);
|
|
670
698
|
if (referencepath_result_itemValidationError !== null) {
|
|
671
699
|
let message = 'Object doesn\'t match EsTypeMessageRepresentation (at "' + path_result_item + '")\n';
|
|
672
700
|
message += referencepath_result_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1266,6 +1294,7 @@ const sendMessage_ConfigPropertyMetadata = [
|
|
|
1266
1294
|
generateParamConfigMetadata('reply', false, 2 /* Body */, 4 /* Unsupported */, true),
|
|
1267
1295
|
generateParamConfigMetadata('text', false, 2 /* Body */, 0 /* String */),
|
|
1268
1296
|
generateParamConfigMetadata('type', false, 2 /* Body */, 0 /* String */),
|
|
1297
|
+
generateParamConfigMetadata('variables', false, 2 /* Body */, 4 /* Unsupported */, true),
|
|
1269
1298
|
];
|
|
1270
1299
|
const sendMessage_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, sendMessage_ConfigPropertyMetadata);
|
|
1271
1300
|
const createResourceParams = /*#__PURE__*/ createResourceParams$2(sendMessage_ConfigPropertyMetadata);
|
|
@@ -1277,13 +1306,25 @@ function typeCheckConfig(untrustedConfig) {
|
|
|
1277
1306
|
const untrustedConfig_reply_array = [];
|
|
1278
1307
|
for (let i = 0, arrayLength = untrustedConfig_reply.length; i < arrayLength; i++) {
|
|
1279
1308
|
const untrustedConfig_reply_item = untrustedConfig_reply[i];
|
|
1280
|
-
const referenceEsTypeMessageRepresentationValidationError = validate$
|
|
1309
|
+
const referenceEsTypeMessageRepresentationValidationError = validate$5(untrustedConfig_reply_item);
|
|
1281
1310
|
if (referenceEsTypeMessageRepresentationValidationError === null) {
|
|
1282
1311
|
untrustedConfig_reply_array.push(untrustedConfig_reply_item);
|
|
1283
1312
|
}
|
|
1284
1313
|
}
|
|
1285
1314
|
config.reply = untrustedConfig_reply_array;
|
|
1286
1315
|
}
|
|
1316
|
+
const untrustedConfig_variables = untrustedConfig.variables;
|
|
1317
|
+
if (ArrayIsArray$1(untrustedConfig_variables)) {
|
|
1318
|
+
const untrustedConfig_variables_array = [];
|
|
1319
|
+
for (let i = 0, arrayLength = untrustedConfig_variables.length; i < arrayLength; i++) {
|
|
1320
|
+
const untrustedConfig_variables_item = untrustedConfig_variables[i];
|
|
1321
|
+
const referenceVariableRepresentationValidationError = validate$4(untrustedConfig_variables_item);
|
|
1322
|
+
if (referenceVariableRepresentationValidationError === null) {
|
|
1323
|
+
untrustedConfig_variables_array.push(untrustedConfig_variables_item);
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
config.variables = untrustedConfig_variables_array;
|
|
1327
|
+
}
|
|
1287
1328
|
return config;
|
|
1288
1329
|
}
|
|
1289
1330
|
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
@@ -1355,4 +1396,4 @@ withDefaultLuvio((luvio) => {
|
|
|
1355
1396
|
});
|
|
1356
1397
|
|
|
1357
1398
|
export { getBotId, getBotId_imperative, sendMessage };
|
|
1358
|
-
// version: 1.
|
|
1399
|
+
// version: 1.266.0-dev1-0affa7d84
|
package/src/raml/api.raml
CHANGED
|
@@ -72,7 +72,14 @@ types:
|
|
|
72
72
|
enum:
|
|
73
73
|
- Cancel
|
|
74
74
|
- EsMessage
|
|
75
|
+
- SetVariables
|
|
75
76
|
- Text
|
|
77
|
+
variables:
|
|
78
|
+
description: Variables
|
|
79
|
+
type: array
|
|
80
|
+
required: false
|
|
81
|
+
items:
|
|
82
|
+
type: VariableRepresentation
|
|
76
83
|
ConversationRuntimeProxyMessageRepresentation:
|
|
77
84
|
description: Represents a message from the bot
|
|
78
85
|
type: object
|
|
@@ -196,7 +203,17 @@ types:
|
|
|
196
203
|
type: string
|
|
197
204
|
value:
|
|
198
205
|
description: Value for the ES type message.
|
|
199
|
-
type:
|
|
206
|
+
type: any
|
|
207
|
+
VariableRepresentation:
|
|
208
|
+
description: Represents a single variable for an operation to set variables
|
|
209
|
+
type: object
|
|
210
|
+
properties:
|
|
211
|
+
name:
|
|
212
|
+
description: Name of the variable
|
|
213
|
+
type: string
|
|
214
|
+
value:
|
|
215
|
+
description: Value of the variable
|
|
216
|
+
type: string
|
|
200
217
|
/connect:
|
|
201
218
|
/conversation-runtime-proxy:
|
|
202
219
|
get:
|