@scout9/app 1.0.0-alpha.0.5.7 → 1.0.0-alpha.0.5.8
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-ccf05f24.cjs} +114 -193
- package/dist/{index-2dbf44c5.cjs → index-b329d3e5.cjs} +5 -5
- package/dist/index.cjs +2 -2
- package/dist/{multipart-parser-473467a4.cjs → multipart-parser-5819fcfd.cjs} +2 -2
- package/dist/testing-tools.cjs +1 -1
- package/package.json +1 -1
- package/src/core/templates/app.js +1 -1
- package/src/runtime/macros/event.js +8 -17
- package/types/index.d.ts +10 -10
|
@@ -26454,10 +26454,11 @@ common.createRequestFunction = createRequestFunction;
|
|
|
26454
26454
|
*
|
|
26455
26455
|
* @summary Gets a customer
|
|
26456
26456
|
* @param {string} idOrEmailOrPhone Either customers id, phone number or email
|
|
26457
|
+
* @param {boolean} [resolve] If a email or phone is provided and the user doesn\'t exist, it will automatically create one
|
|
26457
26458
|
* @param {*} [options] Override http request option.
|
|
26458
26459
|
* @throws {RequiredError}
|
|
26459
26460
|
*/
|
|
26460
|
-
customer: async (idOrEmailOrPhone, options = {}) => {
|
|
26461
|
+
customer: async (idOrEmailOrPhone, resolve, options = {}) => {
|
|
26461
26462
|
// verify required parameter 'idOrEmailOrPhone' is not null or undefined
|
|
26462
26463
|
(0, common_1.assertParamExists)('customer', 'idOrEmailOrPhone', idOrEmailOrPhone);
|
|
26463
26464
|
const localVarPath = `/v1-customer`;
|
|
@@ -26477,6 +26478,9 @@ common.createRequestFunction = createRequestFunction;
|
|
|
26477
26478
|
if (idOrEmailOrPhone !== undefined) {
|
|
26478
26479
|
localVarQueryParameter['idOrEmailOrPhone'] = idOrEmailOrPhone;
|
|
26479
26480
|
}
|
|
26481
|
+
if (resolve !== undefined) {
|
|
26482
|
+
localVarQueryParameter['resolve'] = resolve;
|
|
26483
|
+
}
|
|
26480
26484
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
26481
26485
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
26482
26486
|
localVarRequestOptions.headers = {
|
|
@@ -27461,10 +27465,11 @@ common.createRequestFunction = createRequestFunction;
|
|
|
27461
27465
|
* 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
27466
|
* @summary Generate a message from conversation
|
|
27463
27467
|
* @param {GenerateRequest} generateRequest
|
|
27468
|
+
* @param {string} [convo] In relation to which conversation
|
|
27464
27469
|
* @param {*} [options] Override http request option.
|
|
27465
27470
|
* @throws {RequiredError}
|
|
27466
27471
|
*/
|
|
27467
|
-
generate: async (generateRequest, options = {}) => {
|
|
27472
|
+
generate: async (generateRequest, convo, options = {}) => {
|
|
27468
27473
|
// verify required parameter 'generateRequest' is not null or undefined
|
|
27469
27474
|
(0, common_1.assertParamExists)('generate', 'generateRequest', generateRequest);
|
|
27470
27475
|
const localVarPath = `/v1-generate`;
|
|
@@ -27481,6 +27486,9 @@ common.createRequestFunction = createRequestFunction;
|
|
|
27481
27486
|
};
|
|
27482
27487
|
const localVarHeaderParameter = {};
|
|
27483
27488
|
const localVarQueryParameter = {};
|
|
27489
|
+
if (convo !== undefined) {
|
|
27490
|
+
localVarQueryParameter['convo'] = convo;
|
|
27491
|
+
}
|
|
27484
27492
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
27485
27493
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
27486
27494
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
@@ -27886,6 +27894,48 @@ common.createRequestFunction = createRequestFunction;
|
|
|
27886
27894
|
options: localVarRequestOptions
|
|
27887
27895
|
};
|
|
27888
27896
|
},
|
|
27897
|
+
/**
|
|
27898
|
+
* xxx
|
|
27899
|
+
* @summary xxx
|
|
27900
|
+
* @param {GenerateRequest} generateRequest
|
|
27901
|
+
* @param {string} [convo] xxx
|
|
27902
|
+
* @param {*} [options] Override http request option.
|
|
27903
|
+
* @throws {RequiredError}
|
|
27904
|
+
*/
|
|
27905
|
+
temp: async (generateRequest, convo, options = {}) => {
|
|
27906
|
+
// verify required parameter 'generateRequest' is not null or undefined
|
|
27907
|
+
(0, common_1.assertParamExists)('temp', 'generateRequest', generateRequest);
|
|
27908
|
+
const localVarPath = `/v1-temp`;
|
|
27909
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
27910
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
27911
|
+
let baseOptions;
|
|
27912
|
+
if (configuration) {
|
|
27913
|
+
baseOptions = configuration.baseOptions;
|
|
27914
|
+
}
|
|
27915
|
+
const localVarRequestOptions = {
|
|
27916
|
+
method: 'POST',
|
|
27917
|
+
...baseOptions,
|
|
27918
|
+
...options
|
|
27919
|
+
};
|
|
27920
|
+
const localVarHeaderParameter = {};
|
|
27921
|
+
const localVarQueryParameter = {};
|
|
27922
|
+
if (convo !== undefined) {
|
|
27923
|
+
localVarQueryParameter['convo'] = convo;
|
|
27924
|
+
}
|
|
27925
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
27926
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
27927
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
27928
|
+
localVarRequestOptions.headers = {
|
|
27929
|
+
...localVarHeaderParameter,
|
|
27930
|
+
...headersFromBaseOptions,
|
|
27931
|
+
...options.headers
|
|
27932
|
+
};
|
|
27933
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(generateRequest, localVarRequestOptions, configuration);
|
|
27934
|
+
return {
|
|
27935
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
27936
|
+
options: localVarRequestOptions
|
|
27937
|
+
};
|
|
27938
|
+
},
|
|
27889
27939
|
/**
|
|
27890
27940
|
* Updates an existing entity with the specified type and ID.
|
|
27891
27941
|
* @summary Update an existing entity
|
|
@@ -28145,11 +28195,12 @@ common.createRequestFunction = createRequestFunction;
|
|
|
28145
28195
|
*
|
|
28146
28196
|
* @summary Gets a customer
|
|
28147
28197
|
* @param {string} idOrEmailOrPhone Either customers id, phone number or email
|
|
28198
|
+
* @param {boolean} [resolve] If a email or phone is provided and the user doesn\'t exist, it will automatically create one
|
|
28148
28199
|
* @param {*} [options] Override http request option.
|
|
28149
28200
|
* @throws {RequiredError}
|
|
28150
28201
|
*/
|
|
28151
|
-
async customer(idOrEmailOrPhone, options) {
|
|
28152
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.customer(idOrEmailOrPhone, options);
|
|
28202
|
+
async customer(idOrEmailOrPhone, resolve, options) {
|
|
28203
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.customer(idOrEmailOrPhone, resolve, options);
|
|
28153
28204
|
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1$1.default, base_1.BASE_PATH, configuration);
|
|
28154
28205
|
},
|
|
28155
28206
|
/**
|
|
@@ -28433,11 +28484,12 @@ common.createRequestFunction = createRequestFunction;
|
|
|
28433
28484
|
* 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
28485
|
* @summary Generate a message from conversation
|
|
28435
28486
|
* @param {GenerateRequest} generateRequest
|
|
28487
|
+
* @param {string} [convo] In relation to which conversation
|
|
28436
28488
|
* @param {*} [options] Override http request option.
|
|
28437
28489
|
* @throws {RequiredError}
|
|
28438
28490
|
*/
|
|
28439
|
-
async generate(generateRequest, options) {
|
|
28440
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.generate(generateRequest, options);
|
|
28491
|
+
async generate(generateRequest, convo, options) {
|
|
28492
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.generate(generateRequest, convo, options);
|
|
28441
28493
|
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1$1.default, base_1.BASE_PATH, configuration);
|
|
28442
28494
|
},
|
|
28443
28495
|
/**
|
|
@@ -28554,6 +28606,18 @@ common.createRequestFunction = createRequestFunction;
|
|
|
28554
28606
|
const localVarAxiosArgs = await localVarAxiosParamCreator.runPlatformConfig(options);
|
|
28555
28607
|
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1$1.default, base_1.BASE_PATH, configuration);
|
|
28556
28608
|
},
|
|
28609
|
+
/**
|
|
28610
|
+
* xxx
|
|
28611
|
+
* @summary xxx
|
|
28612
|
+
* @param {GenerateRequest} generateRequest
|
|
28613
|
+
* @param {string} [convo] xxx
|
|
28614
|
+
* @param {*} [options] Override http request option.
|
|
28615
|
+
* @throws {RequiredError}
|
|
28616
|
+
*/
|
|
28617
|
+
async temp(generateRequest, convo, options) {
|
|
28618
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.temp(generateRequest, convo, options);
|
|
28619
|
+
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1$1.default, base_1.BASE_PATH, configuration);
|
|
28620
|
+
},
|
|
28557
28621
|
/**
|
|
28558
28622
|
* Updates an existing entity with the specified type and ID.
|
|
28559
28623
|
* @summary Update an existing entity
|
|
@@ -28764,11 +28828,12 @@ common.createRequestFunction = createRequestFunction;
|
|
|
28764
28828
|
*
|
|
28765
28829
|
* @summary Gets a customer
|
|
28766
28830
|
* @param {string} idOrEmailOrPhone Either customers id, phone number or email
|
|
28831
|
+
* @param {boolean} [resolve] If a email or phone is provided and the user doesn\'t exist, it will automatically create one
|
|
28767
28832
|
* @param {*} [options] Override http request option.
|
|
28768
28833
|
* @throws {RequiredError}
|
|
28769
28834
|
*/
|
|
28770
|
-
customer(idOrEmailOrPhone, options) {
|
|
28771
|
-
return localVarFp.customer(idOrEmailOrPhone, options).then(request => request(axios, basePath));
|
|
28835
|
+
customer(idOrEmailOrPhone, resolve, options) {
|
|
28836
|
+
return localVarFp.customer(idOrEmailOrPhone, resolve, options).then(request => request(axios, basePath));
|
|
28772
28837
|
},
|
|
28773
28838
|
/**
|
|
28774
28839
|
*
|
|
@@ -29027,11 +29092,12 @@ common.createRequestFunction = createRequestFunction;
|
|
|
29027
29092
|
* 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
29093
|
* @summary Generate a message from conversation
|
|
29029
29094
|
* @param {GenerateRequest} generateRequest
|
|
29095
|
+
* @param {string} [convo] In relation to which conversation
|
|
29030
29096
|
* @param {*} [options] Override http request option.
|
|
29031
29097
|
* @throws {RequiredError}
|
|
29032
29098
|
*/
|
|
29033
|
-
generate(generateRequest, options) {
|
|
29034
|
-
return localVarFp.generate(generateRequest, options).then(request => request(axios, basePath));
|
|
29099
|
+
generate(generateRequest, convo, options) {
|
|
29100
|
+
return localVarFp.generate(generateRequest, convo, options).then(request => request(axios, basePath));
|
|
29035
29101
|
},
|
|
29036
29102
|
/**
|
|
29037
29103
|
* Returns log data for a given range, specified by start and end Unix timestamps.
|
|
@@ -29137,6 +29203,17 @@ common.createRequestFunction = createRequestFunction;
|
|
|
29137
29203
|
runPlatformConfig(options) {
|
|
29138
29204
|
return localVarFp.runPlatformConfig(options).then(request => request(axios, basePath));
|
|
29139
29205
|
},
|
|
29206
|
+
/**
|
|
29207
|
+
* xxx
|
|
29208
|
+
* @summary xxx
|
|
29209
|
+
* @param {GenerateRequest} generateRequest
|
|
29210
|
+
* @param {string} [convo] xxx
|
|
29211
|
+
* @param {*} [options] Override http request option.
|
|
29212
|
+
* @throws {RequiredError}
|
|
29213
|
+
*/
|
|
29214
|
+
temp(generateRequest, convo, options) {
|
|
29215
|
+
return localVarFp.temp(generateRequest, convo, options).then(request => request(axios, basePath));
|
|
29216
|
+
},
|
|
29140
29217
|
/**
|
|
29141
29218
|
* Updates an existing entity with the specified type and ID.
|
|
29142
29219
|
* @summary Update an existing entity
|
|
@@ -29364,12 +29441,13 @@ common.createRequestFunction = createRequestFunction;
|
|
|
29364
29441
|
*
|
|
29365
29442
|
* @summary Gets a customer
|
|
29366
29443
|
* @param {string} idOrEmailOrPhone Either customers id, phone number or email
|
|
29444
|
+
* @param {boolean} [resolve] If a email or phone is provided and the user doesn\'t exist, it will automatically create one
|
|
29367
29445
|
* @param {*} [options] Override http request option.
|
|
29368
29446
|
* @throws {RequiredError}
|
|
29369
29447
|
* @memberof Scout9Api
|
|
29370
29448
|
*/
|
|
29371
|
-
customer(idOrEmailOrPhone, options) {
|
|
29372
|
-
return (0, exports.Scout9ApiFp)(this.configuration).customer(idOrEmailOrPhone, options).then(request => request(this.axios, this.basePath));
|
|
29449
|
+
customer(idOrEmailOrPhone, resolve, options) {
|
|
29450
|
+
return (0, exports.Scout9ApiFp)(this.configuration).customer(idOrEmailOrPhone, resolve, options).then(request => request(this.axios, this.basePath));
|
|
29373
29451
|
}
|
|
29374
29452
|
/**
|
|
29375
29453
|
*
|
|
@@ -29652,12 +29730,13 @@ common.createRequestFunction = createRequestFunction;
|
|
|
29652
29730
|
* 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
29731
|
* @summary Generate a message from conversation
|
|
29654
29732
|
* @param {GenerateRequest} generateRequest
|
|
29733
|
+
* @param {string} [convo] In relation to which conversation
|
|
29655
29734
|
* @param {*} [options] Override http request option.
|
|
29656
29735
|
* @throws {RequiredError}
|
|
29657
29736
|
* @memberof Scout9Api
|
|
29658
29737
|
*/
|
|
29659
|
-
generate(generateRequest, options) {
|
|
29660
|
-
return (0, exports.Scout9ApiFp)(this.configuration).generate(generateRequest, options).then(request => request(this.axios, this.basePath));
|
|
29738
|
+
generate(generateRequest, convo, options) {
|
|
29739
|
+
return (0, exports.Scout9ApiFp)(this.configuration).generate(generateRequest, convo, options).then(request => request(this.axios, this.basePath));
|
|
29661
29740
|
}
|
|
29662
29741
|
/**
|
|
29663
29742
|
* Returns log data for a given range, specified by start and end Unix timestamps.
|
|
@@ -29773,6 +29852,18 @@ common.createRequestFunction = createRequestFunction;
|
|
|
29773
29852
|
runPlatformConfig(options) {
|
|
29774
29853
|
return (0, exports.Scout9ApiFp)(this.configuration).runPlatformConfig(options).then(request => request(this.axios, this.basePath));
|
|
29775
29854
|
}
|
|
29855
|
+
/**
|
|
29856
|
+
* xxx
|
|
29857
|
+
* @summary xxx
|
|
29858
|
+
* @param {GenerateRequest} generateRequest
|
|
29859
|
+
* @param {string} [convo] xxx
|
|
29860
|
+
* @param {*} [options] Override http request option.
|
|
29861
|
+
* @throws {RequiredError}
|
|
29862
|
+
* @memberof Scout9Api
|
|
29863
|
+
*/
|
|
29864
|
+
temp(generateRequest, convo, options) {
|
|
29865
|
+
return (0, exports.Scout9ApiFp)(this.configuration).temp(generateRequest, convo, options).then(request => request(this.axios, this.basePath));
|
|
29866
|
+
}
|
|
29776
29867
|
/**
|
|
29777
29868
|
* Updates an existing entity with the specified type and ID.
|
|
29778
29869
|
* @summary Update an existing entity
|
|
@@ -29939,7 +30030,7 @@ common.createRequestFunction = createRequestFunction;
|
|
|
29939
30030
|
var configuration = {};
|
|
29940
30031
|
|
|
29941
30032
|
var name$1 = "@scout9/admin";
|
|
29942
|
-
var version$2 = "1.0.0-alpha.0.0.
|
|
30033
|
+
var version$2 = "1.0.0-alpha.0.0.53";
|
|
29943
30034
|
var description$1 = "";
|
|
29944
30035
|
var main$2 = "./build/index.js";
|
|
29945
30036
|
var types$1 = "./build/index.d.ts";
|
|
@@ -30178,169 +30269,9 @@ var Scout9Webhooks;
|
|
|
30178
30269
|
Object.defineProperty(exports, "__esModule", {
|
|
30179
30270
|
value: true
|
|
30180
30271
|
});
|
|
30181
|
-
exports.Scout9Admin = exports.toQuery = void 0;
|
|
30182
30272
|
__exportStar(api, exports);
|
|
30183
30273
|
__exportStar(configuration, exports);
|
|
30184
30274
|
__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
30275
|
})(build);
|
|
30345
30276
|
|
|
30346
30277
|
// lib/isZodErrorLike.ts
|
|
@@ -35164,7 +35095,7 @@ function _loadUserPackageJson() {
|
|
|
35164
35095
|
targetPkgUrl = isTest ? packageTestJsonUrl : packageJsonUrl;
|
|
35165
35096
|
_context2.t0 = JSON;
|
|
35166
35097
|
_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-
|
|
35098
|
+
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-ccf05f24.js', document.baseURI).href))), 'utf-8');
|
|
35168
35099
|
case 10:
|
|
35169
35100
|
_context2.t1 = _context2.sent;
|
|
35170
35101
|
pkg = _context2.t0.parse.call(_context2.t0, _context2.t1);
|
|
@@ -35998,26 +35929,10 @@ var _excluded$1 = ["success"];
|
|
|
35998
35929
|
* @property {WorkflowResponseSlotBaseWithKeywords[]} withoutCondition.instruction - Array of slots with keywords.
|
|
35999
35930
|
*/
|
|
36000
35931
|
|
|
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
35932
|
/**
|
|
36019
35933
|
* Event macros to be used inside your scout9 auto reply workflows
|
|
36020
35934
|
* @typedef {Object} EventMacros
|
|
35935
|
+
* @property {function(string, [ContextExamples]): EventMacros} context
|
|
36021
35936
|
* @property {function(Record<string, any>): EventMacros} upsert
|
|
36022
35937
|
* @property {function(string, (Date | string | OptionsFollowup)): EventMacros} followup
|
|
36023
35938
|
* @property {AnticipateFunction} anticipate
|
|
@@ -36225,6 +36140,12 @@ function EventMacrosFactory() {
|
|
|
36225
36140
|
}
|
|
36226
36141
|
return this;
|
|
36227
36142
|
},
|
|
36143
|
+
/**
|
|
36144
|
+
* Same as the context
|
|
36145
|
+
*/
|
|
36146
|
+
// context() {
|
|
36147
|
+
// @TODO insert context proxy
|
|
36148
|
+
// },
|
|
36228
36149
|
/**
|
|
36229
36150
|
* If conversation is not stagnant, return instructions to guide next auto reply response, otherwise it will forward the conversation
|
|
36230
36151
|
* @param {string} instruction
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var spirits = require("./spirits-2ab4d673.cjs");
|
|
4
|
-
var dev = require("./dev-
|
|
4
|
+
var dev = require("./dev-ccf05f24.cjs");
|
|
5
5
|
var macros = require("./macros-f855de63.cjs");
|
|
6
6
|
var require$$0 = require('fs');
|
|
7
7
|
var require$$2$1 = require('events');
|
|
@@ -29483,7 +29483,7 @@ class Body {
|
|
|
29483
29483
|
}
|
|
29484
29484
|
const {
|
|
29485
29485
|
toFormData
|
|
29486
|
-
} = await Promise.resolve().then(function () { return require("./multipart-parser-
|
|
29486
|
+
} = await Promise.resolve().then(function () { return require("./multipart-parser-5819fcfd.cjs"); });
|
|
29487
29487
|
return toFormData(this.body, ct);
|
|
29488
29488
|
}
|
|
29489
29489
|
|
|
@@ -41884,7 +41884,7 @@ function _loadUserPackageJson() {
|
|
|
41884
41884
|
targetPkgUrl = isTest ? packageTestJsonUrl : packageJsonUrl;
|
|
41885
41885
|
_context.t0 = JSON;
|
|
41886
41886
|
_context.next = 10;
|
|
41887
|
-
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('index-
|
|
41887
|
+
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('index-b329d3e5.js', document.baseURI).href))), 'utf-8');
|
|
41888
41888
|
case 10:
|
|
41889
41889
|
_context.t1 = _context.sent;
|
|
41890
41890
|
pkg = _context.t0.parse.call(_context.t0, _context.t1);
|
|
@@ -43176,7 +43176,7 @@ var ProjectFiles = /*#__PURE__*/function () {
|
|
|
43176
43176
|
return ProjectFiles;
|
|
43177
43177
|
}();
|
|
43178
43178
|
|
|
43179
|
-
var __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index-
|
|
43179
|
+
var __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index-b329d3e5.js', document.baseURI).href)));
|
|
43180
43180
|
var __dirname$1 = path__default["default"].dirname(__filename$1);
|
|
43181
43181
|
function zipDirectory(source, out) {
|
|
43182
43182
|
var archive = archiver$1('tar', {
|
|
@@ -43391,7 +43391,7 @@ function _buildApp() {
|
|
|
43391
43391
|
case 11:
|
|
43392
43392
|
_context4.t0 = JSON;
|
|
43393
43393
|
_context4.next = 14;
|
|
43394
|
-
return fs__default["default"].readFile(new URL(templatePackagePath, (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index-
|
|
43394
|
+
return fs__default["default"].readFile(new URL(templatePackagePath, (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index-b329d3e5.js', document.baseURI).href))), 'utf-8');
|
|
43395
43395
|
case 14:
|
|
43396
43396
|
_context4.t1 = _context4.sent;
|
|
43397
43397
|
packageTemplate = _context4.t0.parse.call(_context4.t0, _context4.t1);
|
package/dist/index.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require("./index-
|
|
6
|
-
var dev = require("./dev-
|
|
5
|
+
var index = require("./index-b329d3e5.cjs");
|
|
6
|
+
var dev = require("./dev-ccf05f24.cjs");
|
|
7
7
|
require("./spirits-2ab4d673.cjs");
|
|
8
8
|
require("./macros-f855de63.cjs");
|
|
9
9
|
require('fs');
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
require('node:fs');
|
|
4
4
|
require('node:path');
|
|
5
|
-
var index = require("./index-
|
|
5
|
+
var index = require("./index-b329d3e5.cjs");
|
|
6
6
|
require("./spirits-2ab4d673.cjs");
|
|
7
|
-
require("./dev-
|
|
7
|
+
require("./dev-ccf05f24.cjs");
|
|
8
8
|
require('util');
|
|
9
9
|
require('stream');
|
|
10
10
|
require('path');
|
package/dist/testing-tools.cjs
CHANGED
package/package.json
CHANGED
|
@@ -1046,7 +1046,7 @@ app.listen(process.env.PORT || 8080, async (err) => {
|
|
|
1046
1046
|
const fullUrl = `${protocol}://${host}:${port}`;
|
|
1047
1047
|
if (dev) {
|
|
1048
1048
|
console.log(bold(green(art_scout9)));
|
|
1049
|
-
console.log(bold(cyan(art_pmt)));
|
|
1049
|
+
// console.log(bold(cyan(art_pmt)));
|
|
1050
1050
|
console.log(`${grey(`${cyan('>')} Running ${bold(white('Scout9'))}`)} ${grey('dev environment on')} ${fullUrl}`);
|
|
1051
1051
|
} else {
|
|
1052
1052
|
console.log(`Running Scout9 app on ${fullUrl}`);
|
|
@@ -62,27 +62,11 @@ import MacroGlobals from './globals.js';
|
|
|
62
62
|
* @property {WorkflowResponseSlotBaseWithKeywords[]} withoutCondition.instruction - Array of slots with keywords.
|
|
63
63
|
*/
|
|
64
64
|
|
|
65
|
-
// export type WorkflowResponseSlotBase = {
|
|
66
|
-
// /** Forward input information of a conversation */
|
|
67
|
-
// forward?: Forward | undefined;
|
|
68
|
-
// /** Note to provide to the agent, recommend using forward object api instead */
|
|
69
|
-
// forwardNote?: string | undefined;
|
|
70
|
-
// instructions?: Instruction[] | undefined;
|
|
71
|
-
// removeInstructions?: string[] | undefined;
|
|
72
|
-
// message?: string | undefined;
|
|
73
|
-
// secondsDelay?: number | undefined;
|
|
74
|
-
// scheduled?: number | undefined;
|
|
75
|
-
// contextUpsert?: {
|
|
76
|
-
// [x: string]: any;
|
|
77
|
-
// } | undefined;
|
|
78
|
-
// resetIntent?: boolean | undefined;
|
|
79
|
-
// followup?: Followup | undefined;
|
|
80
|
-
// };
|
|
81
|
-
|
|
82
65
|
|
|
83
66
|
/**
|
|
84
67
|
* Event macros to be used inside your scout9 auto reply workflows
|
|
85
68
|
* @typedef {Object} EventMacros
|
|
69
|
+
* @property {function(string, [ContextExamples]): EventMacros} context
|
|
86
70
|
* @property {function(Record<string, any>): EventMacros} upsert
|
|
87
71
|
* @property {function(string, (Date | string | OptionsFollowup)): EventMacros} followup
|
|
88
72
|
* @property {AnticipateFunction} anticipate
|
|
@@ -287,6 +271,13 @@ function EventMacrosFactory() {
|
|
|
287
271
|
return this;
|
|
288
272
|
},
|
|
289
273
|
|
|
274
|
+
/**
|
|
275
|
+
* Same as the context
|
|
276
|
+
*/
|
|
277
|
+
// context() {
|
|
278
|
+
// @TODO insert context proxy
|
|
279
|
+
// },
|
|
280
|
+
|
|
290
281
|
/**
|
|
291
282
|
* If conversation is not stagnant, return instructions to guide next auto reply response, otherwise it will forward the conversation
|
|
292
283
|
* @param {string} instruction
|
package/types/index.d.ts
CHANGED
|
@@ -996,8 +996,8 @@ declare module '@scout9/app/schemas' {
|
|
|
996
996
|
}>>;
|
|
997
997
|
}, "strip", z.ZodTypeAny, {
|
|
998
998
|
environment: "email" | "phone" | "web";
|
|
999
|
-
$agent: string;
|
|
1000
999
|
$id: string;
|
|
1000
|
+
$agent: string;
|
|
1001
1001
|
$customer: string;
|
|
1002
1002
|
initialContexts?: string[] | undefined;
|
|
1003
1003
|
environmentProps?: {
|
|
@@ -1027,8 +1027,8 @@ declare module '@scout9/app/schemas' {
|
|
|
1027
1027
|
} | undefined;
|
|
1028
1028
|
}, {
|
|
1029
1029
|
environment: "email" | "phone" | "web";
|
|
1030
|
-
$agent: string;
|
|
1031
1030
|
$id: string;
|
|
1031
|
+
$agent: string;
|
|
1032
1032
|
$customer: string;
|
|
1033
1033
|
initialContexts?: string[] | undefined;
|
|
1034
1034
|
environmentProps?: {
|
|
@@ -4285,8 +4285,8 @@ declare module '@scout9/app/schemas' {
|
|
|
4285
4285
|
}>>;
|
|
4286
4286
|
}, "strip", z.ZodTypeAny, {
|
|
4287
4287
|
environment: "email" | "phone" | "web";
|
|
4288
|
-
$agent: string;
|
|
4289
4288
|
$id: string;
|
|
4289
|
+
$agent: string;
|
|
4290
4290
|
$customer: string;
|
|
4291
4291
|
initialContexts?: string[] | undefined;
|
|
4292
4292
|
environmentProps?: {
|
|
@@ -4316,8 +4316,8 @@ declare module '@scout9/app/schemas' {
|
|
|
4316
4316
|
} | undefined;
|
|
4317
4317
|
}, {
|
|
4318
4318
|
environment: "email" | "phone" | "web";
|
|
4319
|
-
$agent: string;
|
|
4320
4319
|
$id: string;
|
|
4320
|
+
$agent: string;
|
|
4321
4321
|
$customer: string;
|
|
4322
4322
|
initialContexts?: string[] | undefined;
|
|
4323
4323
|
environmentProps?: {
|
|
@@ -4621,8 +4621,8 @@ declare module '@scout9/app/schemas' {
|
|
|
4621
4621
|
}[];
|
|
4622
4622
|
conversation: {
|
|
4623
4623
|
environment: "email" | "phone" | "web";
|
|
4624
|
-
$agent: string;
|
|
4625
4624
|
$id: string;
|
|
4625
|
+
$agent: string;
|
|
4626
4626
|
$customer: string;
|
|
4627
4627
|
initialContexts?: string[] | undefined;
|
|
4628
4628
|
environmentProps?: {
|
|
@@ -4725,8 +4725,8 @@ declare module '@scout9/app/schemas' {
|
|
|
4725
4725
|
}[];
|
|
4726
4726
|
conversation: {
|
|
4727
4727
|
environment: "email" | "phone" | "web";
|
|
4728
|
-
$agent: string;
|
|
4729
4728
|
$id: string;
|
|
4729
|
+
$agent: string;
|
|
4730
4730
|
$customer: string;
|
|
4731
4731
|
initialContexts?: string[] | undefined;
|
|
4732
4732
|
environmentProps?: {
|
|
@@ -9432,8 +9432,8 @@ declare module '@scout9/app/schemas' {
|
|
|
9432
9432
|
}>>;
|
|
9433
9433
|
}, "strip", z.ZodTypeAny, {
|
|
9434
9434
|
environment: "email" | "phone" | "web";
|
|
9435
|
-
$agent: string;
|
|
9436
9435
|
$id: string;
|
|
9436
|
+
$agent: string;
|
|
9437
9437
|
$customer: string;
|
|
9438
9438
|
initialContexts?: string[] | undefined;
|
|
9439
9439
|
environmentProps?: {
|
|
@@ -9463,8 +9463,8 @@ declare module '@scout9/app/schemas' {
|
|
|
9463
9463
|
} | undefined;
|
|
9464
9464
|
}, {
|
|
9465
9465
|
environment: "email" | "phone" | "web";
|
|
9466
|
-
$agent: string;
|
|
9467
9466
|
$id: string;
|
|
9467
|
+
$agent: string;
|
|
9468
9468
|
$customer: string;
|
|
9469
9469
|
initialContexts?: string[] | undefined;
|
|
9470
9470
|
environmentProps?: {
|
|
@@ -9768,8 +9768,8 @@ declare module '@scout9/app/schemas' {
|
|
|
9768
9768
|
}[];
|
|
9769
9769
|
conversation: {
|
|
9770
9770
|
environment: "email" | "phone" | "web";
|
|
9771
|
-
$agent: string;
|
|
9772
9771
|
$id: string;
|
|
9772
|
+
$agent: string;
|
|
9773
9773
|
$customer: string;
|
|
9774
9774
|
initialContexts?: string[] | undefined;
|
|
9775
9775
|
environmentProps?: {
|
|
@@ -9872,8 +9872,8 @@ declare module '@scout9/app/schemas' {
|
|
|
9872
9872
|
}[];
|
|
9873
9873
|
conversation: {
|
|
9874
9874
|
environment: "email" | "phone" | "web";
|
|
9875
|
-
$agent: string;
|
|
9876
9875
|
$id: string;
|
|
9876
|
+
$agent: string;
|
|
9877
9877
|
$customer: string;
|
|
9878
9878
|
initialContexts?: string[] | undefined;
|
|
9879
9879
|
environmentProps?: {
|