@scout9/app 1.0.0-alpha.0.1.95 → 1.0.0-alpha.0.1.97

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.
Files changed (45) hide show
  1. package/dist/{dev-ecdbe765.cjs → dev-1afc1e7b.cjs} +3788 -3684
  2. package/dist/{index-ea1273a0.cjs → index-2aedbf12.cjs} +150 -55
  3. package/dist/index.cjs +6 -47
  4. package/dist/{multipart-parser-26f98006.cjs → multipart-parser-51d88fc4.cjs} +9 -7
  5. package/dist/{spirits-32395ac4.cjs → spirits-43ce19cf.cjs} +19 -19
  6. package/dist/spirits.cjs +1 -1
  7. package/dist/testing-tools.cjs +7 -6
  8. package/package.json +4 -3
  9. package/src/core/config/agents.js +2 -2
  10. package/src/core/config/entities.js +10 -10
  11. package/src/core/config/index.js +2 -2
  12. package/src/core/config/project.js +1 -1
  13. package/src/core/config/workflow.js +2 -2
  14. package/src/core/index.js +7 -7
  15. package/src/core/sync.js +2 -2
  16. package/src/core/templates/app.js +7 -3
  17. package/src/core/templates/project-files.js +1 -1
  18. package/src/exports.js +8 -7
  19. package/src/platform.js +7 -7
  20. package/src/public.d.ts +3383 -0
  21. package/src/runtime/client/api.js +0 -22
  22. package/src/runtime/client/index.js +0 -6
  23. package/src/runtime/index.js +1 -0
  24. package/src/runtime/macros/builder.js +25 -4
  25. package/src/runtime/macros/event.js +139 -35
  26. package/src/runtime/macros/index.js +0 -1
  27. package/src/runtime/schemas/api.js +21 -0
  28. package/src/runtime/{client → schemas}/config.js +13 -17
  29. package/src/runtime/{client → schemas}/entity.js +16 -29
  30. package/src/runtime/schemas/index.js +9 -0
  31. package/src/runtime/{client → schemas}/message.js +0 -3
  32. package/src/runtime/{client → schemas}/platform.js +1 -1
  33. package/src/runtime/{client → schemas}/users.js +32 -26
  34. package/src/runtime/{client → schemas}/workflow.js +7 -59
  35. package/src/testing-tools/dev.js +15 -17
  36. package/src/testing-tools/mocks.js +6 -6
  37. package/src/testing-tools/spirits.js +19 -19
  38. package/src/utils/configs/agents.js +2 -2
  39. package/src/utils/configs/entities.js +8 -8
  40. package/src/utils/project-templates.js +3 -3
  41. package/types/index.d.ts +2899 -25181
  42. package/types/index.d.ts.map +67 -108
  43. package/src/public.d.ts.text +0 -330
  44. /package/src/runtime/{macros/schemas.js → schemas/macros.js} +0 -0
  45. /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('../runtime/client/config.js').IScout9ProjectBuildConfig} config - used to define generation and extract persona metadata
591
- * @property {import('../runtime/client/workflow.js').IConversation} conversation
592
- * @property {Array<import('../runtime/client/message.js').IMessage>} messages
593
- * @property {import('../runtime/client/message.js').IMessage} message - the message sent by the customer (should exist in messages)
594
- * @property {import('../runtime/client/users.js').ICustomer} customer
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('../runtime/client/message.js').IMessage>} messages
601
- * @property {import('../runtime/client/workflow.js').IConversation} conversation
602
- * @property {import('../runtime/client/message.js').IMessage} message
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('../runtime/client/workflow.js').IWorkflowResponseSlot>} slots
609
- * @property {Array<import('../runtime/client/message.js').IMessage>} messages
610
- * @property {import('../runtime/client/workflow.js').IConversation} conversation
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('../runtime/client/message.js').IMessage>} messages
618
- * @property {import('../runtime/client/workflow.js').IConversation} conversation
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('../runtime/client/workflow.js').IWorkflowEvent} event - conversation data
632
- * @returns {Promise<import('../runtime/client/workflow.js').IWorkflowResponse>}
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('../runtime/client/message.js').IMessage.role} prefix
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('../runtime/client/workflow.js').IConversation> & {forwardNote?: string; forward?: import('../runtime/client/message.js').IWorkflowResponseSlot['forward']}} conversation
667
- * @property {Change<Array<import('../runtime/client/message.js').IMessage>>} messages
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('../runtime/client/message.js').IMessage>} message
669
+ * @property {Change<import('@scout9/app').Message>} message
670
670
  */
671
671
  var Spirits = {
672
672
  /**
package/dist/spirits.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var spirits = require("./spirits-32395ac4.cjs");
5
+ var spirits = require("./spirits-43ce19cf.cjs");
6
6
 
7
7
 
8
8
 
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var dev = require("./dev-ecdbe765.cjs");
6
- var spirits = require("./spirits-32395ac4.cjs");
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('fs/promises');
24
- require('string_decoder');
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.95",
3
+ "version": "1.0.0-alpha.0.1.97",
4
4
  "description": "Build and deploy your Scout9 app for SMS auto replies",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -73,10 +73,12 @@
73
73
  "babel-jest": "^29.7.0",
74
74
  "babel-preset-minify": "^0.5.2",
75
75
  "dts-buddy": "^0.4.3",
76
+ "glob": "^11.0.0",
76
77
  "jest": "^29.7.0",
77
78
  "rollup": "^2.79.1",
78
79
  "rollup-plugin-babel": "^4.4.0",
79
- "typescript": "^5.3.3"
80
+ "typescript": "^5.3.3",
81
+ "zod-to-ts": "^1.2.0"
80
82
  },
81
83
  "dependencies": {
82
84
  "@scout9/admin": "^1.0.0-alpha.0.0.39",
@@ -87,7 +89,6 @@
87
89
  "decompress": "^4.2.1",
88
90
  "dotenv": "^16.3.1",
89
91
  "fast-xml-parser": "^4.3.5",
90
- "glob": "^10.3.10",
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 { agentsBaseConfigurationSchema, agentsConfigurationSchema } from '../../runtime/index.js';
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 ? agentsConfigurationSchema : agentsBaseConfigurationSchema).safeParse(agents);
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
- entitiesRootProjectConfigurationSchema,
5
- entityApiConfigurationSchema,
6
- entityConfigurationSchema,
7
- entityRootProjectConfigurationSchema
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
- entityApiConfigurationSchema.parse(config);
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<import('../../runtime/client/config.js').IEntitiesRootProjectConfiguration>}
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 import('../../runtime/client/config.js').IEntitiesRootProjectConfiguration */
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 = entityConfigurationSchema.safeParse(entityConfig, {path: ['entities', config.length]});
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
- entityRootProjectConfigurationSchema.parse(entityProjectConfig);
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
- entitiesRootProjectConfigurationSchema.parse(config);
137
+ EntitiesRootProjectConfigurationSchema.parse(config);
138
138
 
139
139
  return config;
140
140
  }
@@ -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<import('../../runtime/client/config.js').IScout9ProjectBuildConfig>}
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 {import('../../runtime/client/config.js').IScout9ProjectBuildConfig}
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<import('../../runtime/client/config.js').IScout9ProjectConfig>}
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<import('../../runtime/client/workflow.js').IWorkflowsConfiguration>}
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 {import('../../runtime/client/workflow.js').IWorkflowConfiguration} */
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 {import('../runtime/client/config.js').IScout9ProjectBuildConfig} config
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 {import('../runtime/client/workflow.js').IWorkflowEvent} event - every workflow receives an event object
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<import('../runtime/client/workflow.js').IWorkflowResponse>}
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 {import('../runtime/client/').IScout9ProjectBuildConfig} config
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 {import('../runtime/client/config.js').IScout9ProjectBuildConfig} config
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 {import('../runtime/client/config.js').IScout9ProjectBuildConfig} config
471
- * @returns {Promise<{success: boolean; config: import('../runtime/client/config.js').IScout9ProjectBuildConfig}>}
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 {import('../runtime/client/config.js').IScout9ProjectBuildConfig} config
5
- * @returns {Promise<import('../runtime/client/config.js').IScout9ProjectBuildConfig>}
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) {
@@ -5,7 +5,7 @@ import bodyParser from 'body-parser';
5
5
  import colors from 'kleur';
6
6
  import { config as dotenv } from 'dotenv';
7
7
  import { Configuration, Scout9Api } from '@scout9/admin';
8
- import { EventResponse } from '@scout9/app';
8
+ import { EventResponse, WorkflowEventSchema } from '@scout9/app';
9
9
  import path from 'node:path';
10
10
  import fs from 'node:fs';
11
11
  import https from 'node:https';
@@ -162,8 +162,12 @@ if (dev) {
162
162
  // Root application POST endpoint will run the scout9 app
163
163
  app.post(dev ? '/dev/workflow' : '/', async (req, res) => {
164
164
  try {
165
- // @TODO use zod to check if req.body is a valid event object
166
- const response = await projectApp(req.body);
165
+ const event = WorkflowEventSchema.parse(req.body.event);
166
+ globalThis.SCOUT9 = {
167
+ ...event,
168
+ $convo: req.body.$convo,
169
+ }
170
+ const response = await projectApp(event);
167
171
  res.writeHead(200, {'Content-Type': 'application/json'});
168
172
  res.end(JSON.stringify(response));
169
173
  } catch (e) {
@@ -15,7 +15,7 @@ const resolveFilePath = () => {
15
15
  export const entities = {
16
16
  /**
17
17
  * Generates ./src/entities/
18
- * @param {import('../../runtime/client/config.js').IScout9ProjectBuildConfig} config
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 {import('./runtime/client/workflow.js').IWorkflowEvent} event - every workflow receives an event object
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 {Promise<import('./runtime/client/workflow.js').IWorkflowResponse>}
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 {import('./runtime/client/workflow.js').IWorkflowEvent} event - every workflow receives an event object
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 {Promise<import('./runtime/client/workflow.js').IWorkflowResponse>}
26
+ * @returns {WorkflowResponse}
27
27
  */
28
28
  export const sendEvent = run;
29
29
 
30
30
  /**
31
- * @param data {T}
32
- * @param init {ResponseInit | undefined}
33
- * @returns {import('./runtime/client/api.js').EventResponse<T>}
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<import('./runtime/client/config.js').IScout9ProjectBuildConfig>}
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<import('./runtime/client/config.js').IScout9ProjectBuildConfig>}
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<import('./runtime/client/config.js').IScout9ProjectBuildConfig>}
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<import('./runtime/client/config.js').IScout9ProjectBuildConfig>}
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<import('./runtime/client/config.js').IScout9ProjectBuildConfig>}
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 {import('./runtime/client/workflow.js').IWorkflowEvent} event - every workflow receives an event object
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 {Promise<import('./runtime/client/workflow.js').IWorkflowResponse>}
197
+ * @returns {WorkflowResponse}
198
198
  */
199
199
  run: async function (
200
200
  event,