@scout9/app 1.0.0-alpha.0.1.96 → 1.0.0-alpha.0.1.98
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-ecdbe765.cjs → dev-1afc1e7b.cjs} +3788 -3684
- package/dist/{index-ea1273a0.cjs → index-2aedbf12.cjs} +150 -55
- package/dist/index.cjs +6 -47
- package/dist/{multipart-parser-26f98006.cjs → multipart-parser-51d88fc4.cjs} +9 -7
- package/dist/{spirits-32395ac4.cjs → spirits-43ce19cf.cjs} +19 -19
- package/dist/spirits.cjs +1 -1
- package/dist/testing-tools.cjs +7 -6
- package/package.json +4 -3
- package/src/core/config/agents.js +2 -2
- package/src/core/config/entities.js +10 -10
- package/src/core/config/index.js +2 -2
- package/src/core/config/project.js +1 -1
- package/src/core/config/workflow.js +2 -2
- package/src/core/index.js +7 -7
- package/src/core/sync.js +2 -2
- package/src/core/templates/project-files.js +1 -1
- package/src/exports.js +8 -7
- package/src/platform.js +7 -7
- package/src/public.d.ts +3383 -0
- package/src/runtime/client/api.js +0 -22
- package/src/runtime/client/index.js +0 -6
- package/src/runtime/index.js +1 -0
- package/src/runtime/macros/builder.js +25 -4
- package/src/runtime/macros/event.js +139 -35
- package/src/runtime/macros/index.js +0 -1
- package/src/runtime/schemas/api.js +21 -0
- package/src/runtime/{client → schemas}/config.js +13 -17
- package/src/runtime/{client → schemas}/entity.js +16 -29
- package/src/runtime/schemas/index.js +9 -0
- package/src/runtime/{client → schemas}/message.js +0 -3
- package/src/runtime/{client → schemas}/platform.js +1 -1
- package/src/runtime/{client → schemas}/users.js +32 -26
- package/src/runtime/{client → schemas}/workflow.js +7 -59
- package/src/testing-tools/dev.js +15 -17
- package/src/testing-tools/mocks.js +6 -6
- package/src/testing-tools/spirits.js +19 -19
- package/src/utils/configs/agents.js +2 -2
- package/src/utils/configs/entities.js +8 -8
- package/src/utils/project-templates.js +3 -3
- package/types/index.d.ts +2899 -25181
- package/types/index.d.ts.map +67 -108
- package/src/public.d.ts.text +0 -330
- /package/src/runtime/{macros/schemas.js → schemas/macros.js} +0 -0
- /package/src/runtime/{client → schemas}/utils.js +0 -0
|
@@ -587,35 +587,35 @@ function _classCheckPrivateStaticFieldDescriptor(descriptor, action) {
|
|
|
587
587
|
|
|
588
588
|
/**
|
|
589
589
|
* @typedef {Object} ConversationData
|
|
590
|
-
* @property {import('
|
|
591
|
-
* @property {import('
|
|
592
|
-
* @property {Array<import('
|
|
593
|
-
* @property {import('
|
|
594
|
-
* @property {import('
|
|
590
|
+
* @property {import('@scout9/app').Scout9ProjectBuildConfig} config - used to define generation and extract persona metadata
|
|
591
|
+
* @property {import('@scout9/app').Conversation} conversation
|
|
592
|
+
* @property {Array<import('@scout9/app').Message>} messages
|
|
593
|
+
* @property {import('@scout9/app').Message} message - the message sent by the customer (should exist in messages)
|
|
594
|
+
* @property {import('@scout9/app').Customer} customer
|
|
595
595
|
* @property {any} context
|
|
596
596
|
*/
|
|
597
597
|
|
|
598
598
|
/**
|
|
599
599
|
* @typedef {Object} ParseOutput
|
|
600
|
-
* @property {Array<import('
|
|
601
|
-
* @property {import('
|
|
602
|
-
* @property {import('
|
|
600
|
+
* @property {Array<import('@scout9/app').Message>} messages
|
|
601
|
+
* @property {import('@scout9/app').Conversation} conversation
|
|
602
|
+
* @property {import('@scout9/app').Message} message
|
|
603
603
|
* @property {any} context
|
|
604
604
|
*/
|
|
605
605
|
|
|
606
606
|
/**
|
|
607
607
|
* @typedef {Object} WorkflowOutput
|
|
608
|
-
* @property {Array<import('
|
|
609
|
-
* @property {Array<import('
|
|
610
|
-
* @property {import('
|
|
608
|
+
* @property {Array<import('@scout9/app').WorkflowResponseSlot>} slots
|
|
609
|
+
* @property {Array<import('@scout9/app').Message>} messages
|
|
610
|
+
* @property {import('@scout9/app').Conversation} conversation
|
|
611
611
|
* @property {any} context
|
|
612
612
|
*/
|
|
613
613
|
|
|
614
614
|
/**
|
|
615
615
|
* @typedef {Object} GenerateOutput
|
|
616
616
|
* @property {import('@scout9/admin').GenerateResponse | undefined} generate
|
|
617
|
-
* @property {Array<import('
|
|
618
|
-
* @property {import('
|
|
617
|
+
* @property {Array<import('@scout9/app').Message>} messages
|
|
618
|
+
* @property {import('@scout9/app').Conversation} conversation
|
|
619
619
|
* @property {any} context
|
|
620
620
|
*/
|
|
621
621
|
|
|
@@ -628,8 +628,8 @@ function _classCheckPrivateStaticFieldDescriptor(descriptor, action) {
|
|
|
628
628
|
|
|
629
629
|
/**
|
|
630
630
|
* @callback WorkflowFun
|
|
631
|
-
* @param {import('
|
|
632
|
-
* @returns {Promise<import('
|
|
631
|
+
* @param {import('@scout9/app').WorkflowEvent} event - conversation data
|
|
632
|
+
* @returns {Promise<import('@scout9/app').WorkflowResponse>}
|
|
633
633
|
*/
|
|
634
634
|
|
|
635
635
|
/**
|
|
@@ -640,7 +640,7 @@ function _classCheckPrivateStaticFieldDescriptor(descriptor, action) {
|
|
|
640
640
|
|
|
641
641
|
/**
|
|
642
642
|
* @callback IdGeneratorFun
|
|
643
|
-
* @param {import('
|
|
643
|
+
* @param {import('@scout9/app').Message['role']} prefix
|
|
644
644
|
* @returns {string}
|
|
645
645
|
*/
|
|
646
646
|
/**
|
|
@@ -663,10 +663,10 @@ function _classCheckPrivateStaticFieldDescriptor(descriptor, action) {
|
|
|
663
663
|
|
|
664
664
|
/**
|
|
665
665
|
* @typedef {Object} ConversationEvent
|
|
666
|
-
* @property {Change<import('
|
|
667
|
-
* @property {Change<Array<import('
|
|
666
|
+
* @property {Change<import('@scout9/app').Conversation> & {forwardNote?: string; forward?: import('@scout9/app').WorkflowResponseSlot['forward']}} conversation
|
|
667
|
+
* @property {Change<Array<import('@scout9/app').Message>>} messages
|
|
668
668
|
* @property {Change<any>} context
|
|
669
|
-
* @property {Change<import('
|
|
669
|
+
* @property {Change<import('@scout9/app').Message>} message
|
|
670
670
|
*/
|
|
671
671
|
var Spirits = {
|
|
672
672
|
/**
|
package/dist/spirits.cjs
CHANGED
package/dist/testing-tools.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var dev = require("./dev-
|
|
6
|
-
|
|
5
|
+
var dev = require("./dev-1afc1e7b.cjs");
|
|
6
|
+
require("./spirits-43ce19cf.cjs");
|
|
7
7
|
require('util');
|
|
8
8
|
require('stream');
|
|
9
9
|
require('path');
|
|
@@ -20,12 +20,14 @@ require('crypto');
|
|
|
20
20
|
require('node:fs');
|
|
21
21
|
require('node:path');
|
|
22
22
|
require('node:fs/promises');
|
|
23
|
-
require('
|
|
24
|
-
require('
|
|
23
|
+
require('node:url');
|
|
24
|
+
require('node:events');
|
|
25
|
+
require('node:stream');
|
|
26
|
+
require('node:string_decoder');
|
|
25
27
|
require('node:readline');
|
|
26
28
|
require('node:process');
|
|
27
|
-
require('node:url');
|
|
28
29
|
require('node:os');
|
|
30
|
+
require('fs/promises');
|
|
29
31
|
|
|
30
32
|
|
|
31
33
|
|
|
@@ -35,4 +37,3 @@ exports.createMockConversation = dev.createMockConversation;
|
|
|
35
37
|
exports.createMockCustomer = dev.createMockCustomer;
|
|
36
38
|
exports.createMockMessage = dev.createMockMessage;
|
|
37
39
|
exports.createMockWorkflowEvent = dev.createMockWorkflowEvent;
|
|
38
|
-
exports.Spirits = spirits.Spirits;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scout9/app",
|
|
3
|
-
"version": "1.0.0-alpha.0.1.
|
|
3
|
+
"version": "1.0.0-alpha.0.1.98",
|
|
4
4
|
"description": "Build and deploy your Scout9 app for SMS auto replies",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -76,7 +76,8 @@
|
|
|
76
76
|
"jest": "^29.7.0",
|
|
77
77
|
"rollup": "^2.79.1",
|
|
78
78
|
"rollup-plugin-babel": "^4.4.0",
|
|
79
|
-
"typescript": "^5.3.3"
|
|
79
|
+
"typescript": "^5.3.3",
|
|
80
|
+
"zod-to-ts": "^1.2.0"
|
|
80
81
|
},
|
|
81
82
|
"dependencies": {
|
|
82
83
|
"@scout9/admin": "^1.0.0-alpha.0.0.39",
|
|
@@ -87,7 +88,7 @@
|
|
|
87
88
|
"decompress": "^4.2.1",
|
|
88
89
|
"dotenv": "^16.3.1",
|
|
89
90
|
"fast-xml-parser": "^4.3.5",
|
|
90
|
-
"glob": "^
|
|
91
|
+
"glob": "^11.0.0",
|
|
91
92
|
"graphql-request": "^6.1.0",
|
|
92
93
|
"kleur": "^4.1.5",
|
|
93
94
|
"log-update": "^6.0.0",
|
|
@@ -4,7 +4,7 @@ import colors from 'kleur';
|
|
|
4
4
|
import { globSync } from 'glob';
|
|
5
5
|
import { Configuration, Scout9Api } from '@scout9/admin';
|
|
6
6
|
import { checkVariableType, requireProjectFile } from '../../utils/index.js';
|
|
7
|
-
import {
|
|
7
|
+
import { AgentsSchema, AgentsConfigurationSchema } from '../../runtime/index.js';
|
|
8
8
|
import { audioExtensions } from '../../utils/audio-type.js';
|
|
9
9
|
import { fileTypeFromBuffer } from '../../utils/file-type.js';
|
|
10
10
|
import { videoExtensions } from '../../utils/video-type.js';
|
|
@@ -313,7 +313,7 @@ export default async function loadAgentConfig({
|
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
-
const result = (deploying ?
|
|
316
|
+
const result = (deploying ? AgentsConfigurationSchema : AgentsSchema).safeParse(agents);
|
|
317
317
|
if (!result.success) {
|
|
318
318
|
result.error.source = paths[0];
|
|
319
319
|
throw result.error;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { globSync } from 'glob';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
EntitiesRootProjectConfigurationSchema,
|
|
5
|
+
EntityApiConfigurationSchema,
|
|
6
|
+
EntityConfigurationSchema,
|
|
7
|
+
EntityRootProjectConfigurationSchema
|
|
8
8
|
} from '../../runtime/index.js';
|
|
9
9
|
import { checkVariableType, requireOptionalProjectFile, requireProjectFile } from '../../utils/index.js';
|
|
10
10
|
import { logUserValidationError } from '../../report.js';
|
|
@@ -23,7 +23,7 @@ async function loadEntityApiConfig(cwd, filePath) {
|
|
|
23
23
|
config[key] = true;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
EntityApiConfigurationSchema.parse(config);
|
|
27
27
|
return config;
|
|
28
28
|
} else {
|
|
29
29
|
return null;
|
|
@@ -31,12 +31,12 @@ async function loadEntityApiConfig(cwd, filePath) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
|
-
* @returns {Promise<
|
|
34
|
+
* @returns {Promise<EntitiesRootProjectConfiguration>}
|
|
35
35
|
*/
|
|
36
36
|
export default async function loadEntitiesConfig(
|
|
37
37
|
{cwd = process.cwd(), src = 'src', logger, cb = (message) => {}} = {}
|
|
38
38
|
) {
|
|
39
|
-
/** @type
|
|
39
|
+
/** @type EntitiesRootProjectConfiguration */
|
|
40
40
|
const config = [];
|
|
41
41
|
// const paths = globSync(path.resolve(cwd, `${src}/entities/**/{index,config,api}.{ts,js}`), {cwd, absolute: true});
|
|
42
42
|
const filePaths = globSync(`${src}/entities/**/{index,config,api}.{ts,js}`, {cwd, absolute: true});
|
|
@@ -79,7 +79,7 @@ export default async function loadEntitiesConfig(
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
// Validate entity configuration
|
|
82
|
-
const result =
|
|
82
|
+
const result = EntityConfigurationSchema.safeParse(entityConfig, {path: ['entities', config.length]});
|
|
83
83
|
if (!result.success) {
|
|
84
84
|
logUserValidationError(result.error, filePath);
|
|
85
85
|
throw result.error;
|
|
@@ -96,7 +96,7 @@ export default async function loadEntitiesConfig(
|
|
|
96
96
|
entities: parents.reverse(),
|
|
97
97
|
api
|
|
98
98
|
};
|
|
99
|
-
|
|
99
|
+
EntityRootProjectConfigurationSchema.parse(entityProjectConfig);
|
|
100
100
|
const existingIndex = config.findIndex(c => c.entity === entityProjectConfig.entity);
|
|
101
101
|
if (existingIndex > -1) {
|
|
102
102
|
if (config[existingIndex].entities.length !== entityProjectConfig.entities.length) {
|
|
@@ -134,7 +134,7 @@ export default async function loadEntitiesConfig(
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
// Validate the config
|
|
137
|
-
|
|
137
|
+
EntitiesRootProjectConfigurationSchema.parse(config);
|
|
138
138
|
|
|
139
139
|
return config;
|
|
140
140
|
}
|
package/src/core/config/index.js
CHANGED
|
@@ -34,7 +34,7 @@ export function loadEnvConfig({
|
|
|
34
34
|
/**
|
|
35
35
|
* @deprecated use "new ProjectFiles(...).load()" instead
|
|
36
36
|
* @param {{cwd: string; src: string; logger?: ProgressLogger; deploying?: boolean; cb?: (message: string) => void}} - build options
|
|
37
|
-
* @returns {Promise<
|
|
37
|
+
* @returns {Promise<Scout9ProjectBuildConfig>}
|
|
38
38
|
*/
|
|
39
39
|
export async function loadConfig({
|
|
40
40
|
cwd = process.cwd(), src = 'src', dest = '/tmp/project', deploying = false, logger = new ProgressLogger(), cb = (msg) => {
|
|
@@ -49,7 +49,7 @@ export async function loadConfig({
|
|
|
49
49
|
const workflowsConfig = await loadWorkflowsConfig({cwd, src, logger, deploying, cb});
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
|
-
* @type {
|
|
52
|
+
* @type {Scout9ProjectBuildConfig}
|
|
53
53
|
*/
|
|
54
54
|
const projectConfig = {
|
|
55
55
|
...baseProjectConfig,
|
|
@@ -55,7 +55,7 @@ export async function loadUserPackageJson({cwd = process.cwd()}) {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
|
-
* @returns {Promise<
|
|
58
|
+
* @returns {Promise<Scout9ProjectConfig>}
|
|
59
59
|
*/
|
|
60
60
|
export default async function loadProjectConfig({cwd = process.cwd(), deploying = false, src = 'src', cb = (message) => {}} = {}) {
|
|
61
61
|
// Grab the project tag name (from their package.json)
|
|
@@ -3,7 +3,7 @@ import { WorkflowConfigurationSchema, WorkflowsConfigurationSchema } from '../..
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* @returns {Promise<
|
|
6
|
+
* @returns {Promise<WorkflowsConfiguration>}
|
|
7
7
|
*/
|
|
8
8
|
export default async function loadWorkflowsConfig(
|
|
9
9
|
{
|
|
@@ -30,7 +30,7 @@ export default async function loadWorkflowsConfig(
|
|
|
30
30
|
.map(({path, parents}) => {
|
|
31
31
|
|
|
32
32
|
// Validate project configuration
|
|
33
|
-
/** @type {
|
|
33
|
+
/** @type {WorkflowConfiguration} */
|
|
34
34
|
const workflowConfig = {
|
|
35
35
|
entity: parents[0],
|
|
36
36
|
entities: parents.reverse(),
|
package/src/core/index.js
CHANGED
|
@@ -98,7 +98,7 @@ async function downloadAndUnpackZip(outputDir) {
|
|
|
98
98
|
* @param {string} cwd
|
|
99
99
|
* @param {string} src
|
|
100
100
|
* @param {string} dest
|
|
101
|
-
* @param {
|
|
101
|
+
* @param {Scout9ProjectBuildConfig} config
|
|
102
102
|
* @returns {Promise<void>}
|
|
103
103
|
*/
|
|
104
104
|
async function buildApp(cwd, src, dest, config) {
|
|
@@ -292,10 +292,10 @@ export async function getAgentContacts() {
|
|
|
292
292
|
* Runs a given project container from scout9 to given environment
|
|
293
293
|
* Runs the project in a container
|
|
294
294
|
*
|
|
295
|
-
* @param {
|
|
295
|
+
* @param {WorkflowEvent} event - every workflow receives an event object
|
|
296
296
|
* @param {Object} options
|
|
297
297
|
* @param {string} options.eventSource - the source path of the event
|
|
298
|
-
* @returns {Promise<
|
|
298
|
+
* @returns {Promise<WorkflowResponse>}
|
|
299
299
|
*/
|
|
300
300
|
export async function run(event, {eventSource} = {}) {
|
|
301
301
|
const result = WorkflowEventSchema.safeParse(event);
|
|
@@ -338,7 +338,7 @@ export async function runConfig() {
|
|
|
338
338
|
/**
|
|
339
339
|
* Builds a local project
|
|
340
340
|
* @param {{cwd: string; src: string; dest: string; logger: ProgressLogger; mode: string;}} - build options
|
|
341
|
-
* @param {
|
|
341
|
+
* @param {Scout9ProjectBuildConfig} config
|
|
342
342
|
* @returns {messages: string[]}
|
|
343
343
|
*/
|
|
344
344
|
export async function build({
|
|
@@ -435,7 +435,7 @@ export async function deploy(
|
|
|
435
435
|
/**
|
|
436
436
|
* Tests a local project to scout9 by running a dummy parse command with the project's local entities
|
|
437
437
|
* @param {{cwd: string; src: string, dest: string}} - build options
|
|
438
|
-
* @param {
|
|
438
|
+
* @param {Scout9ProjectBuildConfig} config
|
|
439
439
|
*/
|
|
440
440
|
export async function test(
|
|
441
441
|
{cwd = process.cwd(), src = './src', dest = '/tmp/project', logger = new ProgressLogger()},
|
|
@@ -467,8 +467,8 @@ export async function test(
|
|
|
467
467
|
/**
|
|
468
468
|
*
|
|
469
469
|
* @param {{cwd: string; src: string; projectFiles: ProjectFiles; logger: ProgressLogger}} options
|
|
470
|
-
* @param {
|
|
471
|
-
* @returns {Promise<{success: boolean; config:
|
|
470
|
+
* @param {Scout9ProjectBuildConfig} config
|
|
471
|
+
* @returns {Promise<{success: boolean; config: Scout9ProjectBuildConfig}>}
|
|
472
472
|
*/
|
|
473
473
|
export async function sync({
|
|
474
474
|
cwd = process.cwd(), src = 'src',
|
package/src/core/sync.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { platformApi } from './data.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @param {
|
|
5
|
-
* @returns {Promise<
|
|
4
|
+
* @param {Scout9ProjectBuildConfig} config
|
|
5
|
+
* @returns {Promise<Scout9ProjectBuildConfig>}
|
|
6
6
|
*/
|
|
7
7
|
export async function syncData(config) {
|
|
8
8
|
if (!process.env.SCOUT9_API_KEY) {
|
|
@@ -15,7 +15,7 @@ const resolveFilePath = () => {
|
|
|
15
15
|
export const entities = {
|
|
16
16
|
/**
|
|
17
17
|
* Generates ./src/entities/
|
|
18
|
-
* @param {
|
|
18
|
+
* @param {Scout9ProjectBuildConfig} config
|
|
19
19
|
* @param {string} cwd
|
|
20
20
|
* @param {string} src
|
|
21
21
|
* @returns {Promise<void>}
|
package/src/exports.js
CHANGED
|
@@ -8,29 +8,30 @@ export * from './runtime/client/index.js';
|
|
|
8
8
|
export * from './runtime/macros/index.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* @param {
|
|
11
|
+
* @param {WorkflowEvent} event - every workflow receives an event object
|
|
12
12
|
* @param {Object} options
|
|
13
13
|
* @param {string} [options.cwd=process.cwd()] - the working directory
|
|
14
14
|
* @param {string} [options.mode='production'] - the build mode
|
|
15
15
|
* @param {string} [options.src='./src'] - the source directory
|
|
16
16
|
* @param {string} options.eventSource - the source of the workflow event
|
|
17
|
-
* @returns {
|
|
17
|
+
* @returns {WorkflowResponse}
|
|
18
18
|
*/
|
|
19
19
|
export async function run(event, options) {
|
|
20
20
|
return Scout9Platform.run(event, options)
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
* @param {
|
|
24
|
+
* @param {WorkflowEvent} event - every workflow receives an event object
|
|
25
25
|
* @param {{cwd: string; mode: 'development' | 'production'; src: string}} options - build options
|
|
26
|
-
* @returns {
|
|
26
|
+
* @returns {WorkflowResponse}
|
|
27
27
|
*/
|
|
28
28
|
export const sendEvent = run;
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
* @
|
|
32
|
-
* @param
|
|
33
|
-
* @
|
|
31
|
+
* @template T
|
|
32
|
+
* @param {T} data
|
|
33
|
+
* @param {ResponseInit | undefined} [init]
|
|
34
|
+
* @returns {EventResponse<T>}
|
|
34
35
|
*/
|
|
35
36
|
export function json(data, init) {
|
|
36
37
|
if (data instanceof Promise) {
|
package/src/platform.js
CHANGED
|
@@ -23,7 +23,7 @@ export const Scout9Platform = {
|
|
|
23
23
|
* @param {string} [params.cwd=process.cwd()] - the working directory
|
|
24
24
|
* @param {string} [params.src='src'] - the source directory
|
|
25
25
|
* @param {string} [params.mode='production'] - the build mode
|
|
26
|
-
* @returns {Promise<
|
|
26
|
+
* @returns {Promise<Scout9ProjectBuildConfig>}
|
|
27
27
|
*/
|
|
28
28
|
sync: async function ({cwd = process.cwd(), src = 'src', mode = 'production'} = {}) {
|
|
29
29
|
const logger = new ProgressLogger();
|
|
@@ -54,7 +54,7 @@ export const Scout9Platform = {
|
|
|
54
54
|
* @param {string} [params.dest='/tmp/project'] - the destination directory
|
|
55
55
|
* @param {'development' | 'production'} [params.mode='production'] - the build mode
|
|
56
56
|
* @param {boolean} [params.sync=true] - whether to sync the project after deploying
|
|
57
|
-
* @returns {Promise<
|
|
57
|
+
* @returns {Promise<Scout9ProjectBuildConfig>}
|
|
58
58
|
*/
|
|
59
59
|
deploy: async function (
|
|
60
60
|
{
|
|
@@ -108,7 +108,7 @@ export const Scout9Platform = {
|
|
|
108
108
|
* @param {string} [params.src='./src'] - the source directory
|
|
109
109
|
* @param {string} [params.dest='/tmp/project'] - the destination directory
|
|
110
110
|
* @param {'development' | 'production'} [params.mode='production'] - the build mode
|
|
111
|
-
* @returns {Promise<
|
|
111
|
+
* @returns {Promise<Scout9ProjectBuildConfig>}
|
|
112
112
|
*/
|
|
113
113
|
test: async function ({cwd = process.cwd(), src = './src', dest = '/tmp/project', mode = 'production'} = {}) {
|
|
114
114
|
const logger = new ProgressLogger();
|
|
@@ -136,7 +136,7 @@ export const Scout9Platform = {
|
|
|
136
136
|
* @param {string} [params.src='./src'] - the source directory
|
|
137
137
|
* @param {string} [params.dest='/tmp/project'] - the destination directory
|
|
138
138
|
* @param {'development' | 'production'} [params.mode='production'] - the build mode
|
|
139
|
-
* @returns {Promise<
|
|
139
|
+
* @returns {Promise<Scout9ProjectBuildConfig>}
|
|
140
140
|
*/
|
|
141
141
|
build: async function ({cwd = process.cwd(), src = './src', dest = '/tmp/project', mode = 'production'} = {}) {
|
|
142
142
|
const logger = new ProgressLogger();
|
|
@@ -168,7 +168,7 @@ export const Scout9Platform = {
|
|
|
168
168
|
* @param {string} [params.cwd=process.cwd()] - the working directory
|
|
169
169
|
* @param {boolean} [params.local=false] - whether to only load the local config (ignores what's saved on server)
|
|
170
170
|
* @param {string} [params.src='./src'] - the source directory
|
|
171
|
-
* @returns {Promise<
|
|
171
|
+
* @returns {Promise<Scout9ProjectBuildConfig>}
|
|
172
172
|
*/
|
|
173
173
|
config: async function ({cwd = process.cwd(), local = false, src = './src'} = {}) {
|
|
174
174
|
try {
|
|
@@ -188,13 +188,13 @@ export const Scout9Platform = {
|
|
|
188
188
|
|
|
189
189
|
/**
|
|
190
190
|
* Runs the project in a container
|
|
191
|
-
* @param {
|
|
191
|
+
* @param {WorkflowEvent} event - every workflow receives an event object
|
|
192
192
|
* @param {Object} options
|
|
193
193
|
* @param {string} [options.cwd=process.cwd()] - the working directory
|
|
194
194
|
* @param {string} [options.mode='production'] - the build mode
|
|
195
195
|
* @param {string} [options.src='./src'] - the source directory
|
|
196
196
|
* @param {string} options.eventSource - the source of the workflow event
|
|
197
|
-
* @returns {
|
|
197
|
+
* @returns {WorkflowResponse}
|
|
198
198
|
*/
|
|
199
199
|
run: async function (
|
|
200
200
|
event,
|