timeback-studio 0.1.0
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/README.md +51 -0
- package/dist/bin.js +21905 -0
- package/dist/cli/commands/credentials/add.d.ts +7 -0
- package/dist/cli/commands/credentials/add.d.ts.map +1 -0
- package/dist/cli/commands/credentials/email.d.ts +7 -0
- package/dist/cli/commands/credentials/email.d.ts.map +1 -0
- package/dist/cli/commands/credentials/index.d.ts +8 -0
- package/dist/cli/commands/credentials/index.d.ts.map +1 -0
- package/dist/cli/commands/credentials/lib/index.d.ts +3 -0
- package/dist/cli/commands/credentials/lib/index.d.ts.map +1 -0
- package/dist/cli/commands/credentials/lib/initial.d.ts +7 -0
- package/dist/cli/commands/credentials/lib/initial.d.ts.map +1 -0
- package/dist/cli/commands/credentials/lib/types.d.ts +11 -0
- package/dist/cli/commands/credentials/lib/types.d.ts.map +1 -0
- package/dist/cli/commands/credentials/list.d.ts +7 -0
- package/dist/cli/commands/credentials/list.d.ts.map +1 -0
- package/dist/cli/commands/credentials/menu.d.ts +7 -0
- package/dist/cli/commands/credentials/menu.d.ts.map +1 -0
- package/dist/cli/commands/credentials/remove.d.ts +7 -0
- package/dist/cli/commands/credentials/remove.d.ts.map +1 -0
- package/dist/cli/commands/serve/config.d.ts +57 -0
- package/dist/cli/commands/serve/config.d.ts.map +1 -0
- package/dist/cli/commands/serve/index.d.ts +19 -0
- package/dist/cli/commands/serve/index.d.ts.map +1 -0
- package/dist/cli/commands/serve/server.d.ts +12 -0
- package/dist/cli/commands/serve/server.d.ts.map +1 -0
- package/dist/cli/commands/serve/types.d.ts +16 -0
- package/dist/cli/commands/serve/types.d.ts.map +1 -0
- package/dist/cli/lib/courses.d.ts +17 -0
- package/dist/cli/lib/courses.d.ts.map +1 -0
- package/dist/cli/lib/credentials.d.ts +35 -0
- package/dist/cli/lib/credentials.d.ts.map +1 -0
- package/dist/cli/lib/index.d.ts +6 -0
- package/dist/cli/lib/index.d.ts.map +1 -0
- package/dist/cli/lib/onboarding/import.d.ts +23 -0
- package/dist/cli/lib/onboarding/import.d.ts.map +1 -0
- package/dist/cli/lib/onboarding/index.d.ts +27 -0
- package/dist/cli/lib/onboarding/index.d.ts.map +1 -0
- package/dist/cli/lib/onboarding/types.d.ts +18 -0
- package/dist/cli/lib/onboarding/types.d.ts.map +1 -0
- package/dist/cli/lib/terminal.d.ts +6 -0
- package/dist/cli/lib/terminal.d.ts.map +1 -0
- package/dist/config/constants.d.ts +60 -0
- package/dist/config/constants.d.ts.map +1 -0
- package/dist/config/index.d.ts +6 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/timeback.d.ts +31 -0
- package/dist/config/timeback.d.ts.map +1 -0
- package/dist/config/types.d.ts +59 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/utils.d.ts +12 -0
- package/dist/config/utils.d.ts.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19787 -0
- package/dist/server/app.d.ts +9 -0
- package/dist/server/app.d.ts.map +1 -0
- package/dist/server/controllers/bootstrap.d.ts +619 -0
- package/dist/server/controllers/bootstrap.d.ts.map +1 -0
- package/dist/server/controllers/enrollment.d.ts +98 -0
- package/dist/server/controllers/enrollment.d.ts.map +1 -0
- package/dist/server/controllers/events.d.ts +82 -0
- package/dist/server/controllers/events.d.ts.map +1 -0
- package/dist/server/controllers/index.d.ts +7 -0
- package/dist/server/controllers/index.d.ts.map +1 -0
- package/dist/server/controllers/live.d.ts +22 -0
- package/dist/server/controllers/live.d.ts.map +1 -0
- package/dist/server/controllers/status.d.ts +95 -0
- package/dist/server/controllers/status.d.ts.map +1 -0
- package/dist/server/controllers/student-search.d.ts +39 -0
- package/dist/server/controllers/student-search.d.ts.map +1 -0
- package/dist/server/index.d.ts +2 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/lib/context.d.ts +15 -0
- package/dist/server/lib/context.d.ts.map +1 -0
- package/dist/server/lib/errors.d.ts +40 -0
- package/dist/server/lib/errors.d.ts.map +1 -0
- package/dist/server/lib/index.d.ts +8 -0
- package/dist/server/lib/index.d.ts.map +1 -0
- package/dist/server/lib/manager.d.ts +10 -0
- package/dist/server/lib/manager.d.ts.map +1 -0
- package/dist/server/lib/middleware.d.ts +23 -0
- package/dist/server/lib/middleware.d.ts.map +1 -0
- package/dist/server/lib/request.d.ts +19 -0
- package/dist/server/lib/request.d.ts.map +1 -0
- package/dist/server/lib/sse.d.ts +26 -0
- package/dist/server/lib/sse.d.ts.map +1 -0
- package/dist/server/lib/types.d.ts +64 -0
- package/dist/server/lib/types.d.ts.map +1 -0
- package/dist/server/services/bootstrap.d.ts +38 -0
- package/dist/server/services/bootstrap.d.ts.map +1 -0
- package/dist/server/services/enrollment.d.ts +54 -0
- package/dist/server/services/enrollment.d.ts.map +1 -0
- package/dist/server/services/events.d.ts +50 -0
- package/dist/server/services/events.d.ts.map +1 -0
- package/dist/server/services/index.d.ts +13 -0
- package/dist/server/services/index.d.ts.map +1 -0
- package/dist/server/services/live.d.ts +83 -0
- package/dist/server/services/live.d.ts.map +1 -0
- package/dist/server/services/status.d.ts +24 -0
- package/dist/server/services/status.d.ts.map +1 -0
- package/dist/server/services/student-search.d.ts +32 -0
- package/dist/server/services/student-search.d.ts.map +1 -0
- package/dist/server/services/types/bootstrap.d.ts +47 -0
- package/dist/server/services/types/bootstrap.d.ts.map +1 -0
- package/dist/server/services/types/enrollment.d.ts +26 -0
- package/dist/server/services/types/enrollment.d.ts.map +1 -0
- package/dist/server/services/types/events.d.ts +22 -0
- package/dist/server/services/types/events.d.ts.map +1 -0
- package/dist/server/services/types/index.d.ts +11 -0
- package/dist/server/services/types/index.d.ts.map +1 -0
- package/dist/server/services/types/live.d.ts +34 -0
- package/dist/server/services/types/live.d.ts.map +1 -0
- package/dist/server/services/types/student-search.d.ts +31 -0
- package/dist/server/services/types/student-search.d.ts.map +1 -0
- package/dist/types.d.ts +83 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +0 -0
- package/package.json +47 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CommandOptions } from './lib';
|
|
2
|
+
/**
|
|
3
|
+
* Prompts user to add credentials for one or more environments.
|
|
4
|
+
* @param options - Command execution options
|
|
5
|
+
*/
|
|
6
|
+
export declare function addCredentials(options?: CommandOptions): Promise<void>;
|
|
7
|
+
//# sourceMappingURL=add.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/credentials/add.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAE3C;;;GAGG;AACH,wBAAsB,cAAc,CAAC,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAuEhF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CommandOptions } from './lib';
|
|
2
|
+
/**
|
|
3
|
+
* Prompts user to update the email associated with their credentials.
|
|
4
|
+
* @param options - Command execution options
|
|
5
|
+
*/
|
|
6
|
+
export declare function updateEmail(options?: CommandOptions): Promise<void>;
|
|
7
|
+
//# sourceMappingURL=email.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/credentials/email.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAE3C;;;GAGG;AACH,wBAAsB,WAAW,CAAC,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAqH7E"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { addCredentials } from './add';
|
|
2
|
+
export { updateEmail } from './email';
|
|
3
|
+
export { listCredentials } from './list';
|
|
4
|
+
export { showCredentialsMenu } from './menu';
|
|
5
|
+
export { removeCredentials } from './remove';
|
|
6
|
+
export { promptInitialCredentials } from './lib';
|
|
7
|
+
export type { CommandOptions } from './lib';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/credentials/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAA;AAChD,YAAY,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/credentials/lib/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CredentialEnvironment } from '@timeback/internal-cli-infra';
|
|
2
|
+
/**
|
|
3
|
+
* Runs the first-time credential setup flow.
|
|
4
|
+
* @returns The selected default environment, or null if cancelled
|
|
5
|
+
*/
|
|
6
|
+
export declare function promptInitialCredentials(): Promise<CredentialEnvironment | null>;
|
|
7
|
+
//# sourceMappingURL=initial.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initial.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/credentials/lib/initial.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AAEzE;;;GAGG;AACH,wBAAsB,wBAAwB,IAAI,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAwDtF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/credentials/lib/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,cAAc;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;CAChB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CommandOptions } from './lib';
|
|
2
|
+
/**
|
|
3
|
+
* Lists all configured credential environments and their status.
|
|
4
|
+
* @param options - Command execution options
|
|
5
|
+
*/
|
|
6
|
+
export declare function listCredentials(options?: CommandOptions): Promise<void>;
|
|
7
|
+
//# sourceMappingURL=list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/credentials/list.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAE3C;;;GAGG;AACH,wBAAsB,eAAe,CAAC,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmCjF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CommandOptions } from './lib';
|
|
2
|
+
/**
|
|
3
|
+
* Displays an interactive menu for managing credentials.
|
|
4
|
+
* @param options - Command execution options
|
|
5
|
+
*/
|
|
6
|
+
export declare function showCredentialsMenu(options?: CommandOptions): Promise<void>;
|
|
7
|
+
//# sourceMappingURL=menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/credentials/menu.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAE3C;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgDrF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CommandOptions } from './lib';
|
|
2
|
+
/**
|
|
3
|
+
* Prompts user to select and remove saved credentials.
|
|
4
|
+
* @param options - Command execution options
|
|
5
|
+
*/
|
|
6
|
+
export declare function removeCredentials(options?: CommandOptions): Promise<void>;
|
|
7
|
+
//# sourceMappingURL=remove.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/credentials/remove.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAE3C;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CA+CnF"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Config Resolution for Serve Command
|
|
3
|
+
*/
|
|
4
|
+
import type { CourseConfig } from '@timeback/types';
|
|
5
|
+
import type { Environment, EnvironmentCredentials, LoadedUserConfig, ParserOptions } from '../../../config';
|
|
6
|
+
import type { ImportResult } from '../../lib';
|
|
7
|
+
import type { ResolvedConfig, ServeOptions } from './types';
|
|
8
|
+
/**
|
|
9
|
+
* Builds a LoadedUserConfig from import result (in-memory).
|
|
10
|
+
* @param result - Import result with app name and courses
|
|
11
|
+
* @returns In-memory user config
|
|
12
|
+
*/
|
|
13
|
+
export declare function buildUserConfigFromImport(result: ImportResult): LoadedUserConfig;
|
|
14
|
+
/**
|
|
15
|
+
* Builds a LoadedUserConfig from CourseConfigs (in-memory).
|
|
16
|
+
* @param courses - Course configs
|
|
17
|
+
* @returns In-memory user config
|
|
18
|
+
*/
|
|
19
|
+
export declare function buildUserConfigFromCourses(courses: CourseConfig[]): LoadedUserConfig;
|
|
20
|
+
/**
|
|
21
|
+
* Resolves user config from CLI course IDs.
|
|
22
|
+
* Falls back to import flow if no courses found.
|
|
23
|
+
* @param courseIds - Course IDs from CLI
|
|
24
|
+
* @param env - Target environment
|
|
25
|
+
* @param credentials - Credentials map
|
|
26
|
+
* @param configuredEnvs - List of configured environments
|
|
27
|
+
* @returns Resolved config, or null if cancelled
|
|
28
|
+
*/
|
|
29
|
+
export declare function resolveFromCourseIds(courseIds: string[], env: Environment, credentials: EnvironmentCredentials, configuredEnvs: Environment[]): Promise<ResolvedConfig | null>;
|
|
30
|
+
/**
|
|
31
|
+
* Resolves user config from config file or import flow.
|
|
32
|
+
* @param credentials - Credentials map
|
|
33
|
+
* @param configuredEnvs - List of configured environments
|
|
34
|
+
* @param defaultEnv - Default environment
|
|
35
|
+
* @param parserOpts - Parser selection options
|
|
36
|
+
* @returns Resolved config, or null if cancelled/failed
|
|
37
|
+
*/
|
|
38
|
+
export declare function resolveFromConfigOrImport(credentials: EnvironmentCredentials, configuredEnvs: Environment[], defaultEnv: Environment, parserOpts?: ParserOptions): Promise<ResolvedConfig | null>;
|
|
39
|
+
/**
|
|
40
|
+
* Resolve user config from CLI args, config file, or import flow.
|
|
41
|
+
*
|
|
42
|
+
* Resolution priority:
|
|
43
|
+
* 1. CLI course IDs (if provided)
|
|
44
|
+
* 2. Config file (timeback.config.ts / playcademy.config.ts)
|
|
45
|
+
* 3. Interactive import flow
|
|
46
|
+
*
|
|
47
|
+
* CLI options (--sensors, etc.) are applied as overrides after resolution.
|
|
48
|
+
*
|
|
49
|
+
* @param courseIds - Course IDs from CLI positional args
|
|
50
|
+
* @param opts - CLI options
|
|
51
|
+
* @param credentials - Credentials by environment
|
|
52
|
+
* @param configuredEnvs - List of configured environments
|
|
53
|
+
* @param defaultEnv - Default environment
|
|
54
|
+
* @returns Resolved config with CLI overrides applied, or null if cancelled
|
|
55
|
+
*/
|
|
56
|
+
export declare function resolveConfig(courseIds: string[], opts: ServeOptions, credentials: EnvironmentCredentials, configuredEnvs: Environment[], defaultEnv: Environment): Promise<ResolvedConfig | null>;
|
|
57
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/serve/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,KAAK,EACX,WAAW,EACX,sBAAsB,EACtB,gBAAgB,EAChB,aAAa,EACb,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE3D;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,YAAY,GAAG,gBAAgB,CAqBhF;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,gBAAgB,CAkBpF;AAED;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CACzC,SAAS,EAAE,MAAM,EAAE,EACnB,GAAG,EAAE,WAAW,EAChB,WAAW,EAAE,sBAAsB,EACnC,cAAc,EAAE,WAAW,EAAE,GAC3B,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CA8BhC;AAED;;;;;;;GAOG;AACH,wBAAsB,yBAAyB,CAC9C,WAAW,EAAE,sBAAsB,EACnC,cAAc,EAAE,WAAW,EAAE,EAC7B,UAAU,EAAE,WAAW,EACvB,UAAU,GAAE,aAAkB,GAC5B,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CA0BhC;AAkCD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,aAAa,CAClC,SAAS,EAAE,MAAM,EAAE,EACnB,IAAI,EAAE,YAAY,EAClB,WAAW,EAAE,sBAAsB,EACnC,cAAc,EAAE,WAAW,EAAE,EAC7B,UAAU,EAAE,WAAW,GACrB,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAchC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Serve Command
|
|
3
|
+
*
|
|
4
|
+
* Starts the Studio development server.
|
|
5
|
+
*/
|
|
6
|
+
import type { ServeOptions } from './types';
|
|
7
|
+
/**
|
|
8
|
+
* Serve command entry point.
|
|
9
|
+
*
|
|
10
|
+
* Flow:
|
|
11
|
+
* 1. Setup credentials (interactive if none exist)
|
|
12
|
+
* 2. Resolve config (CLI course IDs > config file > interactive import)
|
|
13
|
+
* 3. Start server
|
|
14
|
+
*
|
|
15
|
+
* @param courseIds - Optional course IDs to load directly
|
|
16
|
+
* @param opts - Server options including optional environment
|
|
17
|
+
*/
|
|
18
|
+
export declare function serveCommand(courseIds: string[], opts: ServeOptions): Promise<void>;
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/serve/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE3C;;;;;;;;;;GAUG;AACH,wBAAsB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAiDzF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server Lifecycle for Serve Command
|
|
3
|
+
*/
|
|
4
|
+
import type { AppContext, ServerConfig } from '../../../config';
|
|
5
|
+
/**
|
|
6
|
+
* Starts the HTTP server and prints startup message.
|
|
7
|
+
* @param ctx - App context
|
|
8
|
+
* @param serverConfig - Server configuration
|
|
9
|
+
* @param configFile - Optional config filename for logging
|
|
10
|
+
*/
|
|
11
|
+
export declare function startServer(ctx: AppContext, serverConfig: ServerConfig, configFile?: string): void;
|
|
12
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/serve/server.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE/D;;;;;GAKG;AACH,wBAAgB,WAAW,CAC1B,GAAG,EAAE,UAAU,EACf,YAAY,EAAE,YAAY,EAC1B,UAAU,CAAC,EAAE,MAAM,GACjB,IAAI,CAqBN"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Serve Command Types
|
|
3
|
+
*/
|
|
4
|
+
import type { Environment, LoadedUserConfig, ParserOptions } from '../../../config';
|
|
5
|
+
export interface ServeOptions extends ParserOptions {
|
|
6
|
+
env?: Environment;
|
|
7
|
+
/** Comma-separated sensor URLs for event filtering */
|
|
8
|
+
sensors?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ResolvedConfig {
|
|
11
|
+
userConfig: LoadedUserConfig;
|
|
12
|
+
environment: Environment;
|
|
13
|
+
/** Config filename for logging (e.g., 'timeback.config.ts') */
|
|
14
|
+
configFile?: string;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/serve/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEnF,MAAM,WAAW,YAAa,SAAQ,aAAa;IAClD,GAAG,CAAC,EAAE,WAAW,CAAA;IACjB,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,cAAc;IAC9B,UAAU,EAAE,gBAAgB,CAAA;IAC5B,WAAW,EAAE,WAAW,CAAA;IACxB,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAA;CACnB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Course Utilities
|
|
3
|
+
*
|
|
4
|
+
* Studio-specific utilities for fetching courses.
|
|
5
|
+
*/
|
|
6
|
+
import type { CourseConfig } from '@timeback/types';
|
|
7
|
+
import type { Credentials, Environment } from '../../config';
|
|
8
|
+
export { toCourseConfig } from '@timeback/internal-cli-infra';
|
|
9
|
+
/**
|
|
10
|
+
* Fetch and convert courses by IDs.
|
|
11
|
+
* @param creds - Credentials for the environment
|
|
12
|
+
* @param env - Target environment
|
|
13
|
+
* @param ids - Course IDs to fetch
|
|
14
|
+
* @returns Array of CourseConfigs
|
|
15
|
+
*/
|
|
16
|
+
export declare function fetchCourses(creds: Credentials, env: Environment, ids: string[]): Promise<CourseConfig[]>;
|
|
17
|
+
//# sourceMappingURL=courses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"courses.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/courses.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AA0B7D;;;;;;GAMG;AACH,wBAAsB,YAAY,CACjC,KAAK,EAAE,WAAW,EAClB,GAAG,EAAE,WAAW,EAChB,GAAG,EAAE,MAAM,EAAE,GACX,OAAO,CAAC,YAAY,EAAE,CAAC,CAmBzB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Credential Utilities
|
|
3
|
+
*
|
|
4
|
+
* Shared credential loading and resolution logic.
|
|
5
|
+
*/
|
|
6
|
+
import type { CredentialEnvironment, Credentials } from '@timeback/internal-cli-infra';
|
|
7
|
+
import type { EnvironmentCredentials } from '../../config';
|
|
8
|
+
/**
|
|
9
|
+
* Loads credentials for all configured environments.
|
|
10
|
+
* @returns Credentials keyed by environment
|
|
11
|
+
*/
|
|
12
|
+
export declare function loadAllCredentials(): Promise<EnvironmentCredentials>;
|
|
13
|
+
/**
|
|
14
|
+
* Determines the default environment (CLI flag > saved > first configured > staging).
|
|
15
|
+
* @param override - Optional environment override from CLI
|
|
16
|
+
* @returns Resolved environment
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolveDefaultEnvironment(override?: CredentialEnvironment): Promise<CredentialEnvironment>;
|
|
19
|
+
/**
|
|
20
|
+
* Handles first-time credential setup when no credentials exist yet.
|
|
21
|
+
* @returns The selected environment and credentials, or null if cancelled
|
|
22
|
+
*/
|
|
23
|
+
export declare function handleCredentialSetup(): Promise<{
|
|
24
|
+
credentials: EnvironmentCredentials;
|
|
25
|
+
defaultEnvironment: CredentialEnvironment;
|
|
26
|
+
} | null>;
|
|
27
|
+
/**
|
|
28
|
+
* Ensures credentials exist for the target environment.
|
|
29
|
+
* Prompts for setup if missing.
|
|
30
|
+
* @param env - Target environment
|
|
31
|
+
* @param credentials - Current credentials map
|
|
32
|
+
* @returns Updated credentials with the target env, or null if cancelled
|
|
33
|
+
*/
|
|
34
|
+
export declare function ensureCredentials(env: CredentialEnvironment, credentials: EnvironmentCredentials): Promise<Credentials | null>;
|
|
35
|
+
//# sourceMappingURL=credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/credentials.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAiBH,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AACtF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAA;AAE1D;;;GAGG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,sBAAsB,CAAC,CAY1E;AAED;;;;GAIG;AACH,wBAAsB,yBAAyB,CAC9C,QAAQ,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,qBAAqB,CAAC,CAQhC;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC;IACtD,WAAW,EAAE,sBAAsB,CAAA;IACnC,kBAAkB,EAAE,qBAAqB,CAAA;CACzC,GAAG,IAAI,CAAC,CAWR;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACtC,GAAG,EAAE,qBAAqB,EAC1B,WAAW,EAAE,sBAAsB,GACjC,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAiB7B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { fetchCourses, toCourseConfig } from './courses';
|
|
2
|
+
export { ensureCredentials, handleCredentialSetup, loadAllCredentials, resolveDefaultEnvironment, } from './credentials';
|
|
3
|
+
export { promptImportApp, promptNoConfig } from './onboarding';
|
|
4
|
+
export { intro, outro } from '@timeback/internal-cli-infra';
|
|
5
|
+
export type { ImportFailure, ImportResult } from './onboarding';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AACxD,OAAO,EACN,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,yBAAyB,GACzB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC9D,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAE3D,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Import App Flow
|
|
3
|
+
*
|
|
4
|
+
* Studio-specific wrapper around cli-common's search utilities.
|
|
5
|
+
* Returns data in-memory; does NOT write any files.
|
|
6
|
+
*/
|
|
7
|
+
import type { Environment, EnvironmentCredentials } from '../../../config';
|
|
8
|
+
import type { ImportFailure, ImportResult } from './types';
|
|
9
|
+
/**
|
|
10
|
+
* Prompt user to search for and import existing courses.
|
|
11
|
+
*
|
|
12
|
+
* Studio-specific wrapper that:
|
|
13
|
+
* 1. Handles environment selection (only prompts if multiple configured)
|
|
14
|
+
* 2. Creates a TimebackClient from credentials
|
|
15
|
+
* 3. Delegates to cli-common's searchAndSelectCourses
|
|
16
|
+
* 4. Transforms result to Studio's ImportResult format
|
|
17
|
+
*
|
|
18
|
+
* @param credentials - Credentials by environment
|
|
19
|
+
* @param configuredEnvs - List of configured environments
|
|
20
|
+
* @returns Result with app name and courses, or cancelled/error
|
|
21
|
+
*/
|
|
22
|
+
export declare function promptImportApp(credentials: EnvironmentCredentials, configuredEnvs: Environment[]): Promise<ImportResult | ImportFailure>;
|
|
23
|
+
//# sourceMappingURL=import.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import.d.ts","sourceRoot":"","sources":["../../../../src/cli/lib/onboarding/import.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,OAAO,KAAK,EAAe,WAAW,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AACvF,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE1D;;;;;;;;;;;;GAYG;AACH,wBAAsB,eAAe,CACpC,WAAW,EAAE,sBAAsB,EACnC,cAAc,EAAE,WAAW,EAAE,GAC3B,OAAO,CAAC,YAAY,GAAG,aAAa,CAAC,CAkDvC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Onboarding Utilities
|
|
3
|
+
*
|
|
4
|
+
* Handles first-time setup when timeback.config.ts is missing.
|
|
5
|
+
* Runs import flow and returns data in-memory (no file writes).
|
|
6
|
+
*/
|
|
7
|
+
import type { Environment, EnvironmentCredentials } from '../../../config';
|
|
8
|
+
import type { ImportResult } from './types';
|
|
9
|
+
export { promptImportApp } from './import';
|
|
10
|
+
export type { ImportFailure, ImportResult } from './types';
|
|
11
|
+
interface PromptNoConfigOptions {
|
|
12
|
+
/** Skip the intro banner. */
|
|
13
|
+
skipIntro?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Entry point for no-config flow.
|
|
17
|
+
*
|
|
18
|
+
* Runs the import flow to let user search and select courses.
|
|
19
|
+
* Returns the imported data in-memory; does NOT write any files.
|
|
20
|
+
*
|
|
21
|
+
* @param credentials - Credentials by environment
|
|
22
|
+
* @param configuredEnvs - List of configured environments
|
|
23
|
+
* @param opts - Optional configuration
|
|
24
|
+
* @returns Import result with app data, or undefined if cancelled/failed
|
|
25
|
+
*/
|
|
26
|
+
export declare function promptNoConfig(credentials: EnvironmentCredentials, configuredEnvs: Environment[], opts?: PromptNoConfigOptions): Promise<ImportResult | undefined>;
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/lib/onboarding/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,OAAO,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC1C,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE1D,UAAU,qBAAqB;IAC9B,6BAA6B;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,cAAc,CACnC,WAAW,EAAE,sBAAsB,EACnC,cAAc,EAAE,WAAW,EAAE,EAC7B,IAAI,GAAE,qBAA0B,GAC9B,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAkBnC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Onboarding Types
|
|
3
|
+
*/
|
|
4
|
+
import type { CourseConfig } from '@timeback/types';
|
|
5
|
+
import type { Environment } from '../../../config';
|
|
6
|
+
export interface ImportResult {
|
|
7
|
+
success: true;
|
|
8
|
+
name: string;
|
|
9
|
+
courses: CourseConfig[];
|
|
10
|
+
environment: Environment;
|
|
11
|
+
sensors?: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface ImportFailure {
|
|
14
|
+
success: false;
|
|
15
|
+
cancelled?: boolean;
|
|
16
|
+
error?: string;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/cli/lib/onboarding/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAElD,MAAM,WAAW,YAAY;IAC5B,OAAO,EAAE,IAAI,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,WAAW,EAAE,WAAW,CAAA;IACxB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CAClB;AAED,MAAM,WAAW,aAAa;IAC7B,OAAO,EAAE,KAAK,CAAA;IACd,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;CACd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/terminal.ts"],"names":[],"mappings":"AAaA;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAwF9D"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Studio Configuration Defaults
|
|
3
|
+
*
|
|
4
|
+
* All static configuration values for the Studio server.
|
|
5
|
+
* Edit the values below to change behavior.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
export declare const configSchema: z.ZodObject<{
|
|
9
|
+
server: z.ZodObject<{
|
|
10
|
+
defaultPort: z.ZodNumber;
|
|
11
|
+
studioUrlProd: z.ZodURL;
|
|
12
|
+
studioUrlDev: z.ZodURL;
|
|
13
|
+
stagingUrlSuffix: z.ZodString;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
events: z.ZodObject<{
|
|
16
|
+
request: z.ZodObject<{
|
|
17
|
+
defaultPageSize: z.ZodNumber;
|
|
18
|
+
maxPageSize: z.ZodNumber;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
catchUp: z.ZodObject<{
|
|
21
|
+
batchSize: z.ZodNumber;
|
|
22
|
+
maxTotalEvents: z.ZodNumber;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
polling: z.ZodObject<{
|
|
25
|
+
eventsPerTick: z.ZodNumber;
|
|
26
|
+
tickIntervalMs: z.ZodNumber;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
sse: z.ZodObject<{
|
|
30
|
+
defaultTickIntervalMs: z.ZodNumber;
|
|
31
|
+
keepAliveIntervalMs: z.ZodNumber;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
export declare const constants: {
|
|
35
|
+
server: {
|
|
36
|
+
defaultPort: number;
|
|
37
|
+
studioUrlProd: string;
|
|
38
|
+
studioUrlDev: string;
|
|
39
|
+
stagingUrlSuffix: string;
|
|
40
|
+
};
|
|
41
|
+
events: {
|
|
42
|
+
request: {
|
|
43
|
+
defaultPageSize: number;
|
|
44
|
+
maxPageSize: number;
|
|
45
|
+
};
|
|
46
|
+
catchUp: {
|
|
47
|
+
batchSize: number;
|
|
48
|
+
maxTotalEvents: number;
|
|
49
|
+
};
|
|
50
|
+
polling: {
|
|
51
|
+
eventsPerTick: number;
|
|
52
|
+
tickIntervalMs: number;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
sse: {
|
|
56
|
+
defaultTickIntervalMs: number;
|
|
57
|
+
keepAliveIntervalMs: number;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/config/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAqEvB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;iBAyBvB,CAAA;AAkDF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;CAA4B,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { constants } from './constants';
|
|
2
|
+
export { getServerConfig } from './utils';
|
|
3
|
+
export { loadConfig, loadTimebackConfig, printConfigError, printError } from './timeback';
|
|
4
|
+
export type { ParserOptions } from '@timeback/internal-cli-infra';
|
|
5
|
+
export type { AppContext, Config, Credentials, Environment, EnvironmentCredentials, LoadedUserConfig, ServerConfig, StudioEnvironment, UserConfig, } from './types';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEzF,YAAY,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AACjE,YAAY,EACX,UAAU,EACV,MAAM,EACN,WAAW,EACX,WAAW,EACX,sBAAsB,EACtB,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,UAAU,GACV,MAAM,SAAS,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Timeback Config Loading
|
|
3
|
+
*
|
|
4
|
+
* Utilities for loading and validating the user's timeback.config.ts file.
|
|
5
|
+
*/
|
|
6
|
+
import type { ConfigParseResult, ParserOptions } from '@timeback/internal-cli-infra';
|
|
7
|
+
/**
|
|
8
|
+
* Loads and validates the user's timeback.config file.
|
|
9
|
+
* @returns Config result with parsed config or error details
|
|
10
|
+
* @deprecated Use getParser().parse() for new code
|
|
11
|
+
*/
|
|
12
|
+
export declare function loadTimebackConfig(): Promise<ConfigParseResult>;
|
|
13
|
+
/**
|
|
14
|
+
* Loads config using the appropriate parser based on options.
|
|
15
|
+
* @param opts - Parser selection options
|
|
16
|
+
* @returns Config result with parsed config or error details
|
|
17
|
+
*/
|
|
18
|
+
export declare function loadConfig(opts?: ParserOptions): Promise<ConfigParseResult>;
|
|
19
|
+
/**
|
|
20
|
+
* Prints a configuration error with example config.
|
|
21
|
+
* @param error - Error message to display
|
|
22
|
+
* @deprecated Use getParser().printError() for new code
|
|
23
|
+
*/
|
|
24
|
+
export declare function printConfigError(error: string): void;
|
|
25
|
+
/**
|
|
26
|
+
* Prints a configuration error using the appropriate parser.
|
|
27
|
+
* @param error - Error message to display
|
|
28
|
+
* @param opts - Parser selection options
|
|
29
|
+
*/
|
|
30
|
+
export declare function printError(error: string, opts?: ParserOptions): void;
|
|
31
|
+
//# sourceMappingURL=timeback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeback.d.ts","sourceRoot":"","sources":["../../src/config/timeback.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAEpF;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAE/D;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,GAAE,aAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAG/E;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAEpD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,aAAkB,GAAG,IAAI,CAGxE"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Studio Config Types
|
|
3
|
+
*
|
|
4
|
+
* Types for Studio configuration and credentials.
|
|
5
|
+
*/
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
import { configSchema } from './constants';
|
|
8
|
+
import type { CredentialEnvironment, Credentials, LoadedUserConfig } from '@timeback/internal-cli-infra';
|
|
9
|
+
export type Config = z.infer<typeof configSchema>;
|
|
10
|
+
/**
|
|
11
|
+
* Deployment environment within a platform.
|
|
12
|
+
*
|
|
13
|
+
* This is an alias for CredentialEnvironment for backwards compatibility
|
|
14
|
+
* within Studio. New code should import CredentialEnvironment directly
|
|
15
|
+
* from `@timeback/internal-cli-infra`.
|
|
16
|
+
*/
|
|
17
|
+
export type Environment = CredentialEnvironment;
|
|
18
|
+
/**
|
|
19
|
+
* All environments including 'local' for development mode.
|
|
20
|
+
* Local is a pseudo-platform, not a true environment, but included here
|
|
21
|
+
* for UI selection purposes.
|
|
22
|
+
*/
|
|
23
|
+
export type StudioEnvironment = CredentialEnvironment | 'local';
|
|
24
|
+
export { CredentialsSchema } from '@timeback/internal-cli-infra';
|
|
25
|
+
export type { Credentials } from '@timeback/internal-cli-infra';
|
|
26
|
+
export interface LoadCredentialsResult {
|
|
27
|
+
success: true;
|
|
28
|
+
credentials: Credentials;
|
|
29
|
+
source: 'env' | 'saved' | 'prompt';
|
|
30
|
+
}
|
|
31
|
+
export interface LoadCredentialsError {
|
|
32
|
+
success: false;
|
|
33
|
+
error: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Credentials stored per environment.
|
|
37
|
+
* Currently assumes the default platform (BEYOND_AI).
|
|
38
|
+
*/
|
|
39
|
+
export type EnvironmentCredentials = {
|
|
40
|
+
[K in CredentialEnvironment]?: Credentials;
|
|
41
|
+
};
|
|
42
|
+
export type { LoadedUserConfig, UserConfig } from '@timeback/internal-cli-infra';
|
|
43
|
+
export declare const ServerConfigSchema: z.ZodObject<{
|
|
44
|
+
name: z.ZodString;
|
|
45
|
+
version: z.ZodString;
|
|
46
|
+
port: z.ZodNumber;
|
|
47
|
+
studioUrl: z.ZodURL;
|
|
48
|
+
corsOrigins: z.ZodArray<z.ZodURL>;
|
|
49
|
+
stagingUrlSuffix: z.ZodString;
|
|
50
|
+
isDev: z.ZodBoolean;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
export type ServerConfig = z.infer<typeof ServerConfigSchema>;
|
|
53
|
+
export interface AppContext {
|
|
54
|
+
serverConfig: ServerConfig;
|
|
55
|
+
userConfig: LoadedUserConfig;
|
|
56
|
+
credentials: EnvironmentCredentials;
|
|
57
|
+
defaultEnvironment: StudioEnvironment;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,KAAK,EACX,qBAAqB,EACrB,WAAW,EACX,gBAAgB,EAEhB,MAAM,8BAA8B,CAAA;AAMrC,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;AAWjD;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,qBAAqB,CAAA;AAE/C;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,GAAG,OAAO,CAAA;AAM/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAEhE,YAAY,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAE/D,MAAM,WAAW,qBAAqB;IACrC,OAAO,EAAE,IAAI,CAAA;IACb,WAAW,EAAE,WAAW,CAAA;IACxB,MAAM,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAA;CAClC;AAED,MAAM,WAAW,oBAAoB;IACpC,OAAO,EAAE,KAAK,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;CACb;AAED;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG;KACnC,CAAC,IAAI,qBAAqB,CAAC,CAAC,EAAE,WAAW;CAC1C,CAAA;AAMD,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAMhF,eAAO,MAAM,kBAAkB;;;;;;;;iBAQ7B,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAM7D,MAAM,WAAW,UAAU;IAC1B,YAAY,EAAE,YAAY,CAAA;IAC1B,UAAU,EAAE,gBAAgB,CAAA;IAC5B,WAAW,EAAE,sBAAsB,CAAA;IACnC,kBAAkB,EAAE,iBAAiB,CAAA;CACrC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration Utilities
|
|
3
|
+
*
|
|
4
|
+
* Functions for building runtime configuration from defaults and environment.
|
|
5
|
+
*/
|
|
6
|
+
import type { ServerConfig } from './types';
|
|
7
|
+
/**
|
|
8
|
+
* Builds the server configuration from environment variables and defaults.
|
|
9
|
+
* @returns Validated server configuration
|
|
10
|
+
*/
|
|
11
|
+
export declare function getServerConfig(): ServerConfig;
|
|
12
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/config/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE3C;;;GAGG;AACH,wBAAgB,eAAe,IAAI,YAAY,CAgB9C"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@timeback/studio`
|
|
3
|
+
*
|
|
4
|
+
* Local development companion for Timeback apps.
|
|
5
|
+
* CLI entry point is in bin.ts; this file is for library exports only.
|
|
6
|
+
*/
|
|
7
|
+
export { serveCommand } from './cli/commands/serve';
|
|
8
|
+
export type { ServeOptions, ResolvedConfig } from './cli/commands/serve/types';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA"}
|