@scout9/app 1.0.0-alpha.0.5.7 → 1.0.0-alpha.0.5.9
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/{dev-cd37b736.cjs → dev-8ed1e379.cjs} +263 -196
- package/dist/{index-2dbf44c5.cjs → index-4f698e67.cjs} +7 -7
- package/dist/index.cjs +4 -4
- package/dist/{macros-f855de63.cjs → macros-4bff92c7.cjs} +12 -3
- package/dist/{multipart-parser-473467a4.cjs → multipart-parser-8f894f70.cjs} +4 -4
- package/dist/schemas.cjs +1 -1
- package/dist/{spirits-2ab4d673.cjs → spirits-82575cd5.cjs} +160 -78
- package/dist/spirits.cjs +1 -1
- package/dist/testing-tools.cjs +3 -3
- package/package.json +2 -1
- package/src/core/templates/app.js +278 -179
- package/src/public.d.ts +8 -2
- package/src/runtime/macros/event.js +8 -17
- package/src/runtime/schemas/users.js +6 -1
- package/src/runtime/schemas/workflow.js +6 -2
- package/src/testing-tools/spirits.js +46 -0
- package/types/index.d.ts +1067 -171
- package/types/index.d.ts.map +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var spirits = require("./spirits-
|
|
3
|
+
var spirits = require("./spirits-82575cd5.cjs");
|
|
4
4
|
var require$$0$4 = require('util');
|
|
5
5
|
var require$$0$3 = require('stream');
|
|
6
6
|
var require$$1 = require('path');
|
|
@@ -21,7 +21,7 @@ var node_url = require('node:url');
|
|
|
21
21
|
var node_events = require('node:events');
|
|
22
22
|
var Stream = require('node:stream');
|
|
23
23
|
var node_string_decoder = require('node:string_decoder');
|
|
24
|
-
var macros = require("./macros-
|
|
24
|
+
var macros = require("./macros-4bff92c7.cjs");
|
|
25
25
|
var readline = require('node:readline');
|
|
26
26
|
var process$2 = require('node:process');
|
|
27
27
|
var node_os = require('node:os');
|
|
@@ -25458,7 +25458,7 @@ common.createRequestFunction = createRequestFunction;
|
|
|
25458
25458
|
Object.defineProperty(exports, "__esModule", {
|
|
25459
25459
|
value: true
|
|
25460
25460
|
});
|
|
25461
|
-
exports.Scout9Api = exports.Scout9ApiGenerated = exports.Scout9ApiFactory = exports.Scout9ApiFp = exports.Scout9ApiAxiosParamCreator = exports.NoopApi = exports.NoopApiFactory = exports.NoopApiFp = exports.NoopApiAxiosParamCreator = exports.WorkflowResponseSlotForwardOneOfModeEnum = exports.PurposeEnum = exports.PmtConfigModelEnum = exports.PmtConfigEngineEnum = exports.MessageGetResponseInnerRoleEnum = exports.MessageCreateRequestRoleEnum = exports.MessageBaseRoleEnum = exports.MessageRoleEnum = exports.MacroResultTypeEnum = exports.MacroDoesResultTypeEnum = exports.MacroDoesInputRoleEnum = exports.MacroDidResultTypeEnum = exports.MacroContextResultTypeEnum = exports.LlmConfigOneOf2EngineEnum = exports.LlmConfigOneOf1EngineEnum = exports.LlmConfigOneOfModelEnum = exports.LlmConfigOneOfEngineEnum = exports.ListApiOperationsResponseInnerMethodEnum = exports.GetApiOperationResponseMethodEnum = exports.ForwardRequestLatestMessageRoleEnum = exports.ForwardRequestForwardOneOfModeEnum = exports.ExistenceOperator = exports.EqualityOperator = exports.ConversationEnvironment = exports.ConversationContextFieldConditionOperatorEnum = exports.ApiOperationMethodEnum = void 0;
|
|
25461
|
+
exports.Scout9Api = exports.Scout9ApiGenerated = exports.Scout9ApiFactory = exports.Scout9ApiFp = exports.Scout9ApiAxiosParamCreator = exports.NoopApi = exports.NoopApiFactory = exports.NoopApiFp = exports.NoopApiAxiosParamCreator = exports.WorkflowResponseSlotForwardOneOfModeEnum = exports.PurposeEnum = exports.PmtTransformResponseTypeEnum = exports.PmtConfigModelEnum = exports.PmtConfigEngineEnum = exports.MessageGetResponseInnerRoleEnum = exports.MessageCreateRequestRoleEnum = exports.MessageBaseRoleEnum = exports.MessageRoleEnum = exports.MacroResultTypeEnum = exports.MacroDoesResultTypeEnum = exports.MacroDoesInputRoleEnum = exports.MacroDidResultTypeEnum = exports.MacroContextResultTypeEnum = exports.LlmConfigOneOf2EngineEnum = exports.LlmConfigOneOf1EngineEnum = exports.LlmConfigOneOfModelEnum = exports.LlmConfigOneOfEngineEnum = exports.ListApiOperationsResponseInnerMethodEnum = exports.GetApiOperationResponseMethodEnum = exports.ForwardRequestLatestMessageRoleEnum = exports.ForwardRequestForwardOneOfModeEnum = exports.ExistenceOperator = exports.EqualityOperator = exports.ConversationEnvironment = exports.ConversationContextFieldConditionOperatorEnum = exports.ApiOperationMethodEnum = void 0;
|
|
25462
25462
|
const axios_1$1 = __importDefault(axios_1);
|
|
25463
25463
|
// Some imports not used depending on template conditions
|
|
25464
25464
|
// @ts-ignore
|
|
@@ -25627,6 +25627,12 @@ common.createRequestFunction = createRequestFunction;
|
|
|
25627
25627
|
_10: 'orin-1.0',
|
|
25628
25628
|
_20Preview: 'orin-2.0-preview'
|
|
25629
25629
|
};
|
|
25630
|
+
exports.PmtTransformResponseTypeEnum = {
|
|
25631
|
+
Question: 'question',
|
|
25632
|
+
Statement: 'statement',
|
|
25633
|
+
Exclamation: 'exclamation',
|
|
25634
|
+
Other: 'other'
|
|
25635
|
+
};
|
|
25630
25636
|
/**
|
|
25631
25637
|
*
|
|
25632
25638
|
* @export
|
|
@@ -26454,10 +26460,11 @@ common.createRequestFunction = createRequestFunction;
|
|
|
26454
26460
|
*
|
|
26455
26461
|
* @summary Gets a customer
|
|
26456
26462
|
* @param {string} idOrEmailOrPhone Either customers id, phone number or email
|
|
26463
|
+
* @param {boolean} [resolve] If a email or phone is provided and the customer doesn\'t exist, it will automatically create one
|
|
26457
26464
|
* @param {*} [options] Override http request option.
|
|
26458
26465
|
* @throws {RequiredError}
|
|
26459
26466
|
*/
|
|
26460
|
-
customer: async (idOrEmailOrPhone, options = {}) => {
|
|
26467
|
+
customer: async (idOrEmailOrPhone, resolve, options = {}) => {
|
|
26461
26468
|
// verify required parameter 'idOrEmailOrPhone' is not null or undefined
|
|
26462
26469
|
(0, common_1.assertParamExists)('customer', 'idOrEmailOrPhone', idOrEmailOrPhone);
|
|
26463
26470
|
const localVarPath = `/v1-customer`;
|
|
@@ -26477,6 +26484,9 @@ common.createRequestFunction = createRequestFunction;
|
|
|
26477
26484
|
if (idOrEmailOrPhone !== undefined) {
|
|
26478
26485
|
localVarQueryParameter['idOrEmailOrPhone'] = idOrEmailOrPhone;
|
|
26479
26486
|
}
|
|
26487
|
+
if (resolve !== undefined) {
|
|
26488
|
+
localVarQueryParameter['resolve'] = resolve;
|
|
26489
|
+
}
|
|
26480
26490
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
26481
26491
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
26482
26492
|
localVarRequestOptions.headers = {
|
|
@@ -27461,10 +27471,11 @@ common.createRequestFunction = createRequestFunction;
|
|
|
27461
27471
|
* Generates a message in the agent\'s voice based on the state of the given conversation. This is useful for testing and debugging. The message will not be sent to the conversation, you must run .message() with the body of the generated message to send it to the conversation.
|
|
27462
27472
|
* @summary Generate a message from conversation
|
|
27463
27473
|
* @param {GenerateRequest} generateRequest
|
|
27474
|
+
* @param {string} [convo] In relation to which conversation
|
|
27464
27475
|
* @param {*} [options] Override http request option.
|
|
27465
27476
|
* @throws {RequiredError}
|
|
27466
27477
|
*/
|
|
27467
|
-
generate: async (generateRequest, options = {}) => {
|
|
27478
|
+
generate: async (generateRequest, convo, options = {}) => {
|
|
27468
27479
|
// verify required parameter 'generateRequest' is not null or undefined
|
|
27469
27480
|
(0, common_1.assertParamExists)('generate', 'generateRequest', generateRequest);
|
|
27470
27481
|
const localVarPath = `/v1-generate`;
|
|
@@ -27481,6 +27492,9 @@ common.createRequestFunction = createRequestFunction;
|
|
|
27481
27492
|
};
|
|
27482
27493
|
const localVarHeaderParameter = {};
|
|
27483
27494
|
const localVarQueryParameter = {};
|
|
27495
|
+
if (convo !== undefined) {
|
|
27496
|
+
localVarQueryParameter['convo'] = convo;
|
|
27497
|
+
}
|
|
27484
27498
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
27485
27499
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
27486
27500
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
@@ -27886,6 +27900,124 @@ common.createRequestFunction = createRequestFunction;
|
|
|
27886
27900
|
options: localVarRequestOptions
|
|
27887
27901
|
};
|
|
27888
27902
|
},
|
|
27903
|
+
/**
|
|
27904
|
+
* xxx
|
|
27905
|
+
* @summary xxx
|
|
27906
|
+
* @param {GenerateRequest} generateRequest
|
|
27907
|
+
* @param {string} [convo] xxx
|
|
27908
|
+
* @param {*} [options] Override http request option.
|
|
27909
|
+
* @throws {RequiredError}
|
|
27910
|
+
*/
|
|
27911
|
+
temp: async (generateRequest, convo, options = {}) => {
|
|
27912
|
+
// verify required parameter 'generateRequest' is not null or undefined
|
|
27913
|
+
(0, common_1.assertParamExists)('temp', 'generateRequest', generateRequest);
|
|
27914
|
+
const localVarPath = `/v1-temp`;
|
|
27915
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
27916
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
27917
|
+
let baseOptions;
|
|
27918
|
+
if (configuration) {
|
|
27919
|
+
baseOptions = configuration.baseOptions;
|
|
27920
|
+
}
|
|
27921
|
+
const localVarRequestOptions = {
|
|
27922
|
+
method: 'POST',
|
|
27923
|
+
...baseOptions,
|
|
27924
|
+
...options
|
|
27925
|
+
};
|
|
27926
|
+
const localVarHeaderParameter = {};
|
|
27927
|
+
const localVarQueryParameter = {};
|
|
27928
|
+
if (convo !== undefined) {
|
|
27929
|
+
localVarQueryParameter['convo'] = convo;
|
|
27930
|
+
}
|
|
27931
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
27932
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
27933
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
27934
|
+
localVarRequestOptions.headers = {
|
|
27935
|
+
...localVarHeaderParameter,
|
|
27936
|
+
...headersFromBaseOptions,
|
|
27937
|
+
...options.headers
|
|
27938
|
+
};
|
|
27939
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(generateRequest, localVarRequestOptions, configuration);
|
|
27940
|
+
return {
|
|
27941
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
27942
|
+
options: localVarRequestOptions
|
|
27943
|
+
};
|
|
27944
|
+
},
|
|
27945
|
+
/**
|
|
27946
|
+
* Trains a PMT model based on the uploaded transcripts provided (Will include the ability to add more transcripts)
|
|
27947
|
+
* @summary Trains a given or default persona\'s PMT model
|
|
27948
|
+
* @param {PmtTrainRequest} pmtTrainRequest
|
|
27949
|
+
* @param {*} [options] Override http request option.
|
|
27950
|
+
* @throws {RequiredError}
|
|
27951
|
+
*/
|
|
27952
|
+
train: async (pmtTrainRequest, options = {}) => {
|
|
27953
|
+
// verify required parameter 'pmtTrainRequest' is not null or undefined
|
|
27954
|
+
(0, common_1.assertParamExists)('train', 'pmtTrainRequest', pmtTrainRequest);
|
|
27955
|
+
const localVarPath = `/v1-pmt-train`;
|
|
27956
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
27957
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
27958
|
+
let baseOptions;
|
|
27959
|
+
if (configuration) {
|
|
27960
|
+
baseOptions = configuration.baseOptions;
|
|
27961
|
+
}
|
|
27962
|
+
const localVarRequestOptions = {
|
|
27963
|
+
method: 'POST',
|
|
27964
|
+
...baseOptions,
|
|
27965
|
+
...options
|
|
27966
|
+
};
|
|
27967
|
+
const localVarHeaderParameter = {};
|
|
27968
|
+
const localVarQueryParameter = {};
|
|
27969
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
27970
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
27971
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
27972
|
+
localVarRequestOptions.headers = {
|
|
27973
|
+
...localVarHeaderParameter,
|
|
27974
|
+
...headersFromBaseOptions,
|
|
27975
|
+
...options.headers
|
|
27976
|
+
};
|
|
27977
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(pmtTrainRequest, localVarRequestOptions, configuration);
|
|
27978
|
+
return {
|
|
27979
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
27980
|
+
options: localVarRequestOptions
|
|
27981
|
+
};
|
|
27982
|
+
},
|
|
27983
|
+
/**
|
|
27984
|
+
* Transforms a given message and context into the owners own words. Failure to transform would be a lack of transcription data or the message detected as not applicable to the owners intended use.
|
|
27985
|
+
* @summary Transforms a given message and context into the owners own words
|
|
27986
|
+
* @param {PmtTransformRequest} pmtTransformRequest
|
|
27987
|
+
* @param {*} [options] Override http request option.
|
|
27988
|
+
* @throws {RequiredError}
|
|
27989
|
+
*/
|
|
27990
|
+
transform: async (pmtTransformRequest, options = {}) => {
|
|
27991
|
+
// verify required parameter 'pmtTransformRequest' is not null or undefined
|
|
27992
|
+
(0, common_1.assertParamExists)('transform', 'pmtTransformRequest', pmtTransformRequest);
|
|
27993
|
+
const localVarPath = `/v1-pmt-transform`;
|
|
27994
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
27995
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
27996
|
+
let baseOptions;
|
|
27997
|
+
if (configuration) {
|
|
27998
|
+
baseOptions = configuration.baseOptions;
|
|
27999
|
+
}
|
|
28000
|
+
const localVarRequestOptions = {
|
|
28001
|
+
method: 'POST',
|
|
28002
|
+
...baseOptions,
|
|
28003
|
+
...options
|
|
28004
|
+
};
|
|
28005
|
+
const localVarHeaderParameter = {};
|
|
28006
|
+
const localVarQueryParameter = {};
|
|
28007
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
28008
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
28009
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
28010
|
+
localVarRequestOptions.headers = {
|
|
28011
|
+
...localVarHeaderParameter,
|
|
28012
|
+
...headersFromBaseOptions,
|
|
28013
|
+
...options.headers
|
|
28014
|
+
};
|
|
28015
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(pmtTransformRequest, localVarRequestOptions, configuration);
|
|
28016
|
+
return {
|
|
28017
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
28018
|
+
options: localVarRequestOptions
|
|
28019
|
+
};
|
|
28020
|
+
},
|
|
27889
28021
|
/**
|
|
27890
28022
|
* Updates an existing entity with the specified type and ID.
|
|
27891
28023
|
* @summary Update an existing entity
|
|
@@ -28145,11 +28277,12 @@ common.createRequestFunction = createRequestFunction;
|
|
|
28145
28277
|
*
|
|
28146
28278
|
* @summary Gets a customer
|
|
28147
28279
|
* @param {string} idOrEmailOrPhone Either customers id, phone number or email
|
|
28280
|
+
* @param {boolean} [resolve] If a email or phone is provided and the customer doesn\'t exist, it will automatically create one
|
|
28148
28281
|
* @param {*} [options] Override http request option.
|
|
28149
28282
|
* @throws {RequiredError}
|
|
28150
28283
|
*/
|
|
28151
|
-
async customer(idOrEmailOrPhone, options) {
|
|
28152
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.customer(idOrEmailOrPhone, options);
|
|
28284
|
+
async customer(idOrEmailOrPhone, resolve, options) {
|
|
28285
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.customer(idOrEmailOrPhone, resolve, options);
|
|
28153
28286
|
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1$1.default, base_1.BASE_PATH, configuration);
|
|
28154
28287
|
},
|
|
28155
28288
|
/**
|
|
@@ -28433,11 +28566,12 @@ common.createRequestFunction = createRequestFunction;
|
|
|
28433
28566
|
* Generates a message in the agent\'s voice based on the state of the given conversation. This is useful for testing and debugging. The message will not be sent to the conversation, you must run .message() with the body of the generated message to send it to the conversation.
|
|
28434
28567
|
* @summary Generate a message from conversation
|
|
28435
28568
|
* @param {GenerateRequest} generateRequest
|
|
28569
|
+
* @param {string} [convo] In relation to which conversation
|
|
28436
28570
|
* @param {*} [options] Override http request option.
|
|
28437
28571
|
* @throws {RequiredError}
|
|
28438
28572
|
*/
|
|
28439
|
-
async generate(generateRequest, options) {
|
|
28440
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.generate(generateRequest, options);
|
|
28573
|
+
async generate(generateRequest, convo, options) {
|
|
28574
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.generate(generateRequest, convo, options);
|
|
28441
28575
|
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1$1.default, base_1.BASE_PATH, configuration);
|
|
28442
28576
|
},
|
|
28443
28577
|
/**
|
|
@@ -28554,6 +28688,40 @@ common.createRequestFunction = createRequestFunction;
|
|
|
28554
28688
|
const localVarAxiosArgs = await localVarAxiosParamCreator.runPlatformConfig(options);
|
|
28555
28689
|
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1$1.default, base_1.BASE_PATH, configuration);
|
|
28556
28690
|
},
|
|
28691
|
+
/**
|
|
28692
|
+
* xxx
|
|
28693
|
+
* @summary xxx
|
|
28694
|
+
* @param {GenerateRequest} generateRequest
|
|
28695
|
+
* @param {string} [convo] xxx
|
|
28696
|
+
* @param {*} [options] Override http request option.
|
|
28697
|
+
* @throws {RequiredError}
|
|
28698
|
+
*/
|
|
28699
|
+
async temp(generateRequest, convo, options) {
|
|
28700
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.temp(generateRequest, convo, options);
|
|
28701
|
+
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1$1.default, base_1.BASE_PATH, configuration);
|
|
28702
|
+
},
|
|
28703
|
+
/**
|
|
28704
|
+
* Trains a PMT model based on the uploaded transcripts provided (Will include the ability to add more transcripts)
|
|
28705
|
+
* @summary Trains a given or default persona\'s PMT model
|
|
28706
|
+
* @param {PmtTrainRequest} pmtTrainRequest
|
|
28707
|
+
* @param {*} [options] Override http request option.
|
|
28708
|
+
* @throws {RequiredError}
|
|
28709
|
+
*/
|
|
28710
|
+
async train(pmtTrainRequest, options) {
|
|
28711
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.train(pmtTrainRequest, options);
|
|
28712
|
+
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1$1.default, base_1.BASE_PATH, configuration);
|
|
28713
|
+
},
|
|
28714
|
+
/**
|
|
28715
|
+
* Transforms a given message and context into the owners own words. Failure to transform would be a lack of transcription data or the message detected as not applicable to the owners intended use.
|
|
28716
|
+
* @summary Transforms a given message and context into the owners own words
|
|
28717
|
+
* @param {PmtTransformRequest} pmtTransformRequest
|
|
28718
|
+
* @param {*} [options] Override http request option.
|
|
28719
|
+
* @throws {RequiredError}
|
|
28720
|
+
*/
|
|
28721
|
+
async transform(pmtTransformRequest, options) {
|
|
28722
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.transform(pmtTransformRequest, options);
|
|
28723
|
+
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1$1.default, base_1.BASE_PATH, configuration);
|
|
28724
|
+
},
|
|
28557
28725
|
/**
|
|
28558
28726
|
* Updates an existing entity with the specified type and ID.
|
|
28559
28727
|
* @summary Update an existing entity
|
|
@@ -28764,11 +28932,12 @@ common.createRequestFunction = createRequestFunction;
|
|
|
28764
28932
|
*
|
|
28765
28933
|
* @summary Gets a customer
|
|
28766
28934
|
* @param {string} idOrEmailOrPhone Either customers id, phone number or email
|
|
28935
|
+
* @param {boolean} [resolve] If a email or phone is provided and the customer doesn\'t exist, it will automatically create one
|
|
28767
28936
|
* @param {*} [options] Override http request option.
|
|
28768
28937
|
* @throws {RequiredError}
|
|
28769
28938
|
*/
|
|
28770
|
-
customer(idOrEmailOrPhone, options) {
|
|
28771
|
-
return localVarFp.customer(idOrEmailOrPhone, options).then(request => request(axios, basePath));
|
|
28939
|
+
customer(idOrEmailOrPhone, resolve, options) {
|
|
28940
|
+
return localVarFp.customer(idOrEmailOrPhone, resolve, options).then(request => request(axios, basePath));
|
|
28772
28941
|
},
|
|
28773
28942
|
/**
|
|
28774
28943
|
*
|
|
@@ -29027,11 +29196,12 @@ common.createRequestFunction = createRequestFunction;
|
|
|
29027
29196
|
* Generates a message in the agent\'s voice based on the state of the given conversation. This is useful for testing and debugging. The message will not be sent to the conversation, you must run .message() with the body of the generated message to send it to the conversation.
|
|
29028
29197
|
* @summary Generate a message from conversation
|
|
29029
29198
|
* @param {GenerateRequest} generateRequest
|
|
29199
|
+
* @param {string} [convo] In relation to which conversation
|
|
29030
29200
|
* @param {*} [options] Override http request option.
|
|
29031
29201
|
* @throws {RequiredError}
|
|
29032
29202
|
*/
|
|
29033
|
-
generate(generateRequest, options) {
|
|
29034
|
-
return localVarFp.generate(generateRequest, options).then(request => request(axios, basePath));
|
|
29203
|
+
generate(generateRequest, convo, options) {
|
|
29204
|
+
return localVarFp.generate(generateRequest, convo, options).then(request => request(axios, basePath));
|
|
29035
29205
|
},
|
|
29036
29206
|
/**
|
|
29037
29207
|
* Returns log data for a given range, specified by start and end Unix timestamps.
|
|
@@ -29137,6 +29307,37 @@ common.createRequestFunction = createRequestFunction;
|
|
|
29137
29307
|
runPlatformConfig(options) {
|
|
29138
29308
|
return localVarFp.runPlatformConfig(options).then(request => request(axios, basePath));
|
|
29139
29309
|
},
|
|
29310
|
+
/**
|
|
29311
|
+
* xxx
|
|
29312
|
+
* @summary xxx
|
|
29313
|
+
* @param {GenerateRequest} generateRequest
|
|
29314
|
+
* @param {string} [convo] xxx
|
|
29315
|
+
* @param {*} [options] Override http request option.
|
|
29316
|
+
* @throws {RequiredError}
|
|
29317
|
+
*/
|
|
29318
|
+
temp(generateRequest, convo, options) {
|
|
29319
|
+
return localVarFp.temp(generateRequest, convo, options).then(request => request(axios, basePath));
|
|
29320
|
+
},
|
|
29321
|
+
/**
|
|
29322
|
+
* Trains a PMT model based on the uploaded transcripts provided (Will include the ability to add more transcripts)
|
|
29323
|
+
* @summary Trains a given or default persona\'s PMT model
|
|
29324
|
+
* @param {PmtTrainRequest} pmtTrainRequest
|
|
29325
|
+
* @param {*} [options] Override http request option.
|
|
29326
|
+
* @throws {RequiredError}
|
|
29327
|
+
*/
|
|
29328
|
+
train(pmtTrainRequest, options) {
|
|
29329
|
+
return localVarFp.train(pmtTrainRequest, options).then(request => request(axios, basePath));
|
|
29330
|
+
},
|
|
29331
|
+
/**
|
|
29332
|
+
* Transforms a given message and context into the owners own words. Failure to transform would be a lack of transcription data or the message detected as not applicable to the owners intended use.
|
|
29333
|
+
* @summary Transforms a given message and context into the owners own words
|
|
29334
|
+
* @param {PmtTransformRequest} pmtTransformRequest
|
|
29335
|
+
* @param {*} [options] Override http request option.
|
|
29336
|
+
* @throws {RequiredError}
|
|
29337
|
+
*/
|
|
29338
|
+
transform(pmtTransformRequest, options) {
|
|
29339
|
+
return localVarFp.transform(pmtTransformRequest, options).then(request => request(axios, basePath));
|
|
29340
|
+
},
|
|
29140
29341
|
/**
|
|
29141
29342
|
* Updates an existing entity with the specified type and ID.
|
|
29142
29343
|
* @summary Update an existing entity
|
|
@@ -29364,12 +29565,13 @@ common.createRequestFunction = createRequestFunction;
|
|
|
29364
29565
|
*
|
|
29365
29566
|
* @summary Gets a customer
|
|
29366
29567
|
* @param {string} idOrEmailOrPhone Either customers id, phone number or email
|
|
29568
|
+
* @param {boolean} [resolve] If a email or phone is provided and the customer doesn\'t exist, it will automatically create one
|
|
29367
29569
|
* @param {*} [options] Override http request option.
|
|
29368
29570
|
* @throws {RequiredError}
|
|
29369
29571
|
* @memberof Scout9Api
|
|
29370
29572
|
*/
|
|
29371
|
-
customer(idOrEmailOrPhone, options) {
|
|
29372
|
-
return (0, exports.Scout9ApiFp)(this.configuration).customer(idOrEmailOrPhone, options).then(request => request(this.axios, this.basePath));
|
|
29573
|
+
customer(idOrEmailOrPhone, resolve, options) {
|
|
29574
|
+
return (0, exports.Scout9ApiFp)(this.configuration).customer(idOrEmailOrPhone, resolve, options).then(request => request(this.axios, this.basePath));
|
|
29373
29575
|
}
|
|
29374
29576
|
/**
|
|
29375
29577
|
*
|
|
@@ -29652,12 +29854,13 @@ common.createRequestFunction = createRequestFunction;
|
|
|
29652
29854
|
* Generates a message in the agent\'s voice based on the state of the given conversation. This is useful for testing and debugging. The message will not be sent to the conversation, you must run .message() with the body of the generated message to send it to the conversation.
|
|
29653
29855
|
* @summary Generate a message from conversation
|
|
29654
29856
|
* @param {GenerateRequest} generateRequest
|
|
29857
|
+
* @param {string} [convo] In relation to which conversation
|
|
29655
29858
|
* @param {*} [options] Override http request option.
|
|
29656
29859
|
* @throws {RequiredError}
|
|
29657
29860
|
* @memberof Scout9Api
|
|
29658
29861
|
*/
|
|
29659
|
-
generate(generateRequest, options) {
|
|
29660
|
-
return (0, exports.Scout9ApiFp)(this.configuration).generate(generateRequest, options).then(request => request(this.axios, this.basePath));
|
|
29862
|
+
generate(generateRequest, convo, options) {
|
|
29863
|
+
return (0, exports.Scout9ApiFp)(this.configuration).generate(generateRequest, convo, options).then(request => request(this.axios, this.basePath));
|
|
29661
29864
|
}
|
|
29662
29865
|
/**
|
|
29663
29866
|
* Returns log data for a given range, specified by start and end Unix timestamps.
|
|
@@ -29773,6 +29976,40 @@ common.createRequestFunction = createRequestFunction;
|
|
|
29773
29976
|
runPlatformConfig(options) {
|
|
29774
29977
|
return (0, exports.Scout9ApiFp)(this.configuration).runPlatformConfig(options).then(request => request(this.axios, this.basePath));
|
|
29775
29978
|
}
|
|
29979
|
+
/**
|
|
29980
|
+
* xxx
|
|
29981
|
+
* @summary xxx
|
|
29982
|
+
* @param {GenerateRequest} generateRequest
|
|
29983
|
+
* @param {string} [convo] xxx
|
|
29984
|
+
* @param {*} [options] Override http request option.
|
|
29985
|
+
* @throws {RequiredError}
|
|
29986
|
+
* @memberof Scout9Api
|
|
29987
|
+
*/
|
|
29988
|
+
temp(generateRequest, convo, options) {
|
|
29989
|
+
return (0, exports.Scout9ApiFp)(this.configuration).temp(generateRequest, convo, options).then(request => request(this.axios, this.basePath));
|
|
29990
|
+
}
|
|
29991
|
+
/**
|
|
29992
|
+
* Trains a PMT model based on the uploaded transcripts provided (Will include the ability to add more transcripts)
|
|
29993
|
+
* @summary Trains a given or default persona\'s PMT model
|
|
29994
|
+
* @param {PmtTrainRequest} pmtTrainRequest
|
|
29995
|
+
* @param {*} [options] Override http request option.
|
|
29996
|
+
* @throws {RequiredError}
|
|
29997
|
+
* @memberof Scout9Api
|
|
29998
|
+
*/
|
|
29999
|
+
train(pmtTrainRequest, options) {
|
|
30000
|
+
return (0, exports.Scout9ApiFp)(this.configuration).train(pmtTrainRequest, options).then(request => request(this.axios, this.basePath));
|
|
30001
|
+
}
|
|
30002
|
+
/**
|
|
30003
|
+
* Transforms a given message and context into the owners own words. Failure to transform would be a lack of transcription data or the message detected as not applicable to the owners intended use.
|
|
30004
|
+
* @summary Transforms a given message and context into the owners own words
|
|
30005
|
+
* @param {PmtTransformRequest} pmtTransformRequest
|
|
30006
|
+
* @param {*} [options] Override http request option.
|
|
30007
|
+
* @throws {RequiredError}
|
|
30008
|
+
* @memberof Scout9Api
|
|
30009
|
+
*/
|
|
30010
|
+
transform(pmtTransformRequest, options) {
|
|
30011
|
+
return (0, exports.Scout9ApiFp)(this.configuration).transform(pmtTransformRequest, options).then(request => request(this.axios, this.basePath));
|
|
30012
|
+
}
|
|
29776
30013
|
/**
|
|
29777
30014
|
* Updates an existing entity with the specified type and ID.
|
|
29778
30015
|
* @summary Update an existing entity
|
|
@@ -29939,7 +30176,7 @@ common.createRequestFunction = createRequestFunction;
|
|
|
29939
30176
|
var configuration = {};
|
|
29940
30177
|
|
|
29941
30178
|
var name$1 = "@scout9/admin";
|
|
29942
|
-
var version$2 = "1.0.0-alpha.0.0.
|
|
30179
|
+
var version$2 = "1.0.0-alpha.0.0.54";
|
|
29943
30180
|
var description$1 = "";
|
|
29944
30181
|
var main$2 = "./build/index.js";
|
|
29945
30182
|
var types$1 = "./build/index.d.ts";
|
|
@@ -30178,169 +30415,9 @@ var Scout9Webhooks;
|
|
|
30178
30415
|
Object.defineProperty(exports, "__esModule", {
|
|
30179
30416
|
value: true
|
|
30180
30417
|
});
|
|
30181
|
-
exports.Scout9Admin = exports.toQuery = void 0;
|
|
30182
30418
|
__exportStar(api, exports);
|
|
30183
30419
|
__exportStar(configuration, exports);
|
|
30184
30420
|
__exportStar(webhooks, exports);
|
|
30185
|
-
const api_1 = api;
|
|
30186
|
-
const configuration_1 = configuration;
|
|
30187
|
-
const toQuery = payload => `${payload.field},${payload.operator},${payload.value}`;
|
|
30188
|
-
exports.toQuery = toQuery;
|
|
30189
|
-
async function sendMessage(_scout9, input) {
|
|
30190
|
-
if (!('convo' in input) && !input.to) {
|
|
30191
|
-
throw new Error('Either .convo or .to must be provided in message payload');
|
|
30192
|
-
}
|
|
30193
|
-
const request = {
|
|
30194
|
-
convo: 'convo' in input ? input.convo : {
|
|
30195
|
-
customerIdOrPhoneOrEmail: input.to || '',
|
|
30196
|
-
agentIdOrPhoneOrEmail: input.from || '',
|
|
30197
|
-
environment: input.environment
|
|
30198
|
-
},
|
|
30199
|
-
message: input.message,
|
|
30200
|
-
...(input.html ? {
|
|
30201
|
-
html: input.html
|
|
30202
|
-
} : {}),
|
|
30203
|
-
role: input.role || 'agent'
|
|
30204
|
-
};
|
|
30205
|
-
if (input.scheduled) {
|
|
30206
|
-
request.scheduled = input.scheduled;
|
|
30207
|
-
}
|
|
30208
|
-
if (input.secondsDelay) {
|
|
30209
|
-
request.secondsDelay = input.secondsDelay;
|
|
30210
|
-
}
|
|
30211
|
-
return _scout9.message(request).then(resolve);
|
|
30212
|
-
}
|
|
30213
|
-
function resolve(res) {
|
|
30214
|
-
return res.data;
|
|
30215
|
-
}
|
|
30216
|
-
function Scout9Admin(apiKey, basePath, axiosInstance) {
|
|
30217
|
-
const configuration = new configuration_1.Configuration({
|
|
30218
|
-
apiKey,
|
|
30219
|
-
basePath
|
|
30220
|
-
});
|
|
30221
|
-
const scout9 = new api_1.Scout9Api(configuration, basePath, axiosInstance);
|
|
30222
|
-
return {
|
|
30223
|
-
app: {
|
|
30224
|
-
run: async event => scout9.runPlatform(event),
|
|
30225
|
-
config: async () => scout9.runPlatformConfig().then(resolve),
|
|
30226
|
-
context: {
|
|
30227
|
-
files: {
|
|
30228
|
-
list: async () => scout9.files('context').then(resolve),
|
|
30229
|
-
retrieve: async contextId => scout9.file('context', contextId),
|
|
30230
|
-
remove: async contextId => scout9.fileRemove('context', contextId)
|
|
30231
|
-
}
|
|
30232
|
-
}
|
|
30233
|
-
},
|
|
30234
|
-
parse: scout9.parse,
|
|
30235
|
-
generate: scout9.generate,
|
|
30236
|
-
agents: {
|
|
30237
|
-
retrieve: async id => scout9.agent(id).then(resolve),
|
|
30238
|
-
list: async query => scout9.agents((0, exports.toQuery)(query)).then(resolve),
|
|
30239
|
-
create: async data => scout9.agentRegister({
|
|
30240
|
-
firstName: '',
|
|
30241
|
-
lastName: '',
|
|
30242
|
-
forwardEmail: '',
|
|
30243
|
-
forwardPhone: '',
|
|
30244
|
-
...data
|
|
30245
|
-
}).then(resolve),
|
|
30246
|
-
update: async (id, data) => scout9.agentUpdate({
|
|
30247
|
-
...data,
|
|
30248
|
-
$id: id
|
|
30249
|
-
}).then(resolve),
|
|
30250
|
-
purchasePhone: async (agentId, purchaseOptions) => scout9.purchasePhone(agentId ? {
|
|
30251
|
-
$agent: agentId,
|
|
30252
|
-
...(purchaseOptions || {})
|
|
30253
|
-
} : undefined).then(resolve),
|
|
30254
|
-
remove: async id => scout9.agentDelete(id).then(resolve),
|
|
30255
|
-
bulkRemove: async ids => scout9.agentsDelete(ids).then(resolve),
|
|
30256
|
-
bulkCreate: async data => scout9.agentsCreate({
|
|
30257
|
-
agents: data.map(a => ({
|
|
30258
|
-
firstName: '',
|
|
30259
|
-
lastName: '',
|
|
30260
|
-
...a
|
|
30261
|
-
}))
|
|
30262
|
-
}).then(resolve),
|
|
30263
|
-
bulkUpdate: async data => scout9.agentsUpdate({
|
|
30264
|
-
agents: data.map(a => ({
|
|
30265
|
-
$id: a.id,
|
|
30266
|
-
...a
|
|
30267
|
-
}))
|
|
30268
|
-
}).then(resolve)
|
|
30269
|
-
// transcripts: {
|
|
30270
|
-
// list: async (agentId?: string) => scout9.files('agent-transcript', agentId).then(resolve<S9File[]>),
|
|
30271
|
-
// retrieve: async (agentId: string, fileId: string,) => scout9.file('agent-transcript', fileId, agentId).then(resolve),
|
|
30272
|
-
// remove: async (agentId: string, fileId: string) => scout9.fileRemove('agent-transcript', fileId, agentId).then(resolve),
|
|
30273
|
-
// upload: async (agentId: string, file: File | Buffer | Blob, context?: string, fileId?: string) => scout9.fileUpload(
|
|
30274
|
-
// file,
|
|
30275
|
-
// 'agent-transcript',
|
|
30276
|
-
// context,
|
|
30277
|
-
// fileId,
|
|
30278
|
-
// agentId
|
|
30279
|
-
// ).then(res => res.data.files?.[0] || null),
|
|
30280
|
-
// },
|
|
30281
|
-
// audio: {
|
|
30282
|
-
// list: async (agentId?: string) => scout9.files('agent-audio', agentId).then(resolve<S9File[]>),
|
|
30283
|
-
// retrieve: async (agentId: string, fileId: string,) => scout9.file('agent-audio', fileId, agentId).then(resolve<S9File | null>),
|
|
30284
|
-
// remove: async (agentId: string, fileId: string) => scout9.fileRemove('agent-audio', fileId, agentId).then(resolve),
|
|
30285
|
-
// upload: async (agentId: string, file: File | Buffer | Blob, context?: string, fileId?: string) => scout9.fileUpload(
|
|
30286
|
-
// file,
|
|
30287
|
-
// 'agent-audio',
|
|
30288
|
-
// context,
|
|
30289
|
-
// fileId,
|
|
30290
|
-
// agentId
|
|
30291
|
-
// ).then(res => res.data.files?.[0] || null),
|
|
30292
|
-
// }
|
|
30293
|
-
},
|
|
30294
|
-
conversation: {
|
|
30295
|
-
retrieve: async id => scout9.conversation(id).then(resolve),
|
|
30296
|
-
list: async query => scout9.conversations((0, exports.toQuery)(query)).then(resolve),
|
|
30297
|
-
remove: async id => scout9.conversationDelete(id).then(resolve),
|
|
30298
|
-
create: async data => scout9.conversationCreate({
|
|
30299
|
-
...data
|
|
30300
|
-
}).then(resolve),
|
|
30301
|
-
update: async (id, data) => scout9.conversationUpdate({
|
|
30302
|
-
...data,
|
|
30303
|
-
$id: id
|
|
30304
|
-
}).then(resolve),
|
|
30305
|
-
forward: async (conversationId, options) => scout9.forward({
|
|
30306
|
-
convo: conversationId,
|
|
30307
|
-
...(options || {})
|
|
30308
|
-
}).then(resolve),
|
|
30309
|
-
generate: async (conversationId, mockData) => scout9.generate(mockData ? mockData : conversationId),
|
|
30310
|
-
message: input => sendMessage(scout9, input),
|
|
30311
|
-
messages: async conversationId => scout9.messages(conversationId).then(resolve)
|
|
30312
|
-
},
|
|
30313
|
-
message: input => sendMessage(scout9, input),
|
|
30314
|
-
messages: async conversationId => scout9.messages(conversationId).then(resolve),
|
|
30315
|
-
customers: {
|
|
30316
|
-
retrieve: async idOrEmailOrPhone => scout9.customer(idOrEmailOrPhone).then(resolve),
|
|
30317
|
-
list: async query => scout9.customers((0, exports.toQuery)(query)).then(resolve),
|
|
30318
|
-
remove: async customerId => scout9.customerDelete(customerId).then(resolve),
|
|
30319
|
-
create: async data => scout9.customerCreate(data).then(resolve),
|
|
30320
|
-
update: async (customerId, data) => scout9.customerUpdate({
|
|
30321
|
-
name: '',
|
|
30322
|
-
...data,
|
|
30323
|
-
$id: customerId
|
|
30324
|
-
}).then(resolve),
|
|
30325
|
-
bulkCreate: async customers => scout9.customersCreate({
|
|
30326
|
-
customers
|
|
30327
|
-
}).then(resolve),
|
|
30328
|
-
bulkRemove: async ids => scout9.customersDelete(ids).then(resolve),
|
|
30329
|
-
bulkUpdate: async data => scout9.customersUpdate({
|
|
30330
|
-
customers: data.map(c => ({
|
|
30331
|
-
...c
|
|
30332
|
-
}))
|
|
30333
|
-
}).then(resolve)
|
|
30334
|
-
},
|
|
30335
|
-
utils: {
|
|
30336
|
-
fileUpload: scout9.fileUpload,
|
|
30337
|
-
files: scout9.files
|
|
30338
|
-
},
|
|
30339
|
-
v1: scout9
|
|
30340
|
-
};
|
|
30341
|
-
}
|
|
30342
|
-
exports.Scout9Admin = Scout9Admin;
|
|
30343
|
-
exports.default = Scout9Admin;
|
|
30344
30421
|
})(build);
|
|
30345
30422
|
|
|
30346
30423
|
// lib/isZodErrorLike.ts
|
|
@@ -35164,7 +35241,7 @@ function _loadUserPackageJson() {
|
|
|
35164
35241
|
targetPkgUrl = isTest ? packageTestJsonUrl : packageJsonUrl;
|
|
35165
35242
|
_context2.t0 = JSON;
|
|
35166
35243
|
_context2.next = 10;
|
|
35167
|
-
return fs__default["default"].readFile(new URL(targetPkgUrl, (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('dev-
|
|
35244
|
+
return fs__default["default"].readFile(new URL(targetPkgUrl, (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('dev-8ed1e379.js', document.baseURI).href))), 'utf-8');
|
|
35168
35245
|
case 10:
|
|
35169
35246
|
_context2.t1 = _context2.sent;
|
|
35170
35247
|
pkg = _context2.t0.parse.call(_context2.t0, _context2.t1);
|
|
@@ -35998,26 +36075,10 @@ var _excluded$1 = ["success"];
|
|
|
35998
36075
|
* @property {WorkflowResponseSlotBaseWithKeywords[]} withoutCondition.instruction - Array of slots with keywords.
|
|
35999
36076
|
*/
|
|
36000
36077
|
|
|
36001
|
-
// export type WorkflowResponseSlotBase = {
|
|
36002
|
-
// /** Forward input information of a conversation */
|
|
36003
|
-
// forward?: Forward | undefined;
|
|
36004
|
-
// /** Note to provide to the agent, recommend using forward object api instead */
|
|
36005
|
-
// forwardNote?: string | undefined;
|
|
36006
|
-
// instructions?: Instruction[] | undefined;
|
|
36007
|
-
// removeInstructions?: string[] | undefined;
|
|
36008
|
-
// message?: string | undefined;
|
|
36009
|
-
// secondsDelay?: number | undefined;
|
|
36010
|
-
// scheduled?: number | undefined;
|
|
36011
|
-
// contextUpsert?: {
|
|
36012
|
-
// [x: string]: any;
|
|
36013
|
-
// } | undefined;
|
|
36014
|
-
// resetIntent?: boolean | undefined;
|
|
36015
|
-
// followup?: Followup | undefined;
|
|
36016
|
-
// };
|
|
36017
|
-
|
|
36018
36078
|
/**
|
|
36019
36079
|
* Event macros to be used inside your scout9 auto reply workflows
|
|
36020
36080
|
* @typedef {Object} EventMacros
|
|
36081
|
+
* @property {function(string, [ContextExamples]): EventMacros} context
|
|
36021
36082
|
* @property {function(Record<string, any>): EventMacros} upsert
|
|
36022
36083
|
* @property {function(string, (Date | string | OptionsFollowup)): EventMacros} followup
|
|
36023
36084
|
* @property {AnticipateFunction} anticipate
|
|
@@ -36225,6 +36286,12 @@ function EventMacrosFactory() {
|
|
|
36225
36286
|
}
|
|
36226
36287
|
return this;
|
|
36227
36288
|
},
|
|
36289
|
+
/**
|
|
36290
|
+
* Same as the context
|
|
36291
|
+
*/
|
|
36292
|
+
// context() {
|
|
36293
|
+
// @TODO insert context proxy
|
|
36294
|
+
// },
|
|
36228
36295
|
/**
|
|
36229
36296
|
* If conversation is not stagnant, return instructions to guide next auto reply response, otherwise it will forward the conversation
|
|
36230
36297
|
* @param {string} instruction
|