@tailor-platform/sdk 1.0.0 → 1.1.1
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/CHANGELOG.md +27 -0
- package/dist/cli/index.mjs +1 -1
- package/dist/cli/lib.d.mts +74 -17
- package/dist/cli/lib.mjs +1 -1
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/configure/index.d.mts +2 -2
- package/dist/{index-BkfOioTo.d.mts → index-2JVUi0to.d.mts} +2 -2
- package/dist/{list-D1V0haDR.mjs → list-LSl71zs8.mjs} +107 -62
- package/dist/list-LSl71zs8.mjs.map +1 -0
- package/dist/{types-CGvgLrme.d.mts → types-UefR8mZn.d.mts} +44 -28
- package/dist/utils/test/index.d.mts +2 -2
- package/package.json +3 -2
- package/dist/list-D1V0haDR.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @tailor-platform/sdk
|
|
2
2
|
|
|
3
|
+
## 1.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#322](https://github.com/tailor-platform/sdk/pull/322) [`5d1805b`](https://github.com/tailor-platform/sdk/commit/5d1805b1c920285fa5e79f03e6604b898002c355) Thanks [@toiroakr](https://github.com/toiroakr)! - Handle empty resolver/executor/workflow bundles without error and add tests
|
|
8
|
+
|
|
9
|
+
## 1.1.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#314](https://github.com/tailor-platform/sdk/pull/314) [`a073fb9`](https://github.com/tailor-platform/sdk/commit/a073fb92837a3bbe053ce2571c557f9084756c04) Thanks [@toiroakr](https://github.com/toiroakr)! - Add dependencies-based execution order for generators
|
|
14
|
+
- Generators now declare their dependencies (`tailordb`, `resolver`, `executor`)
|
|
15
|
+
- Execution order is phased: TailorDB → Auth → TailorDB-only generators → Resolver → non-executor generators → Executor → executor-dependent generators
|
|
16
|
+
- This allows generated files to be imported by Resolvers and Executors
|
|
17
|
+
- Added utility types for aggregate input: `TailorDBInput`, `ResolverInput`, `ExecutorInput`, `FullInput`, `AggregateArgs`
|
|
18
|
+
- Fixed console output formatting with proper blank line placement
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- [#317](https://github.com/tailor-platform/sdk/pull/317) [`5af7004`](https://github.com/tailor-platform/sdk/commit/5af700468d48c18b31c3c1d6e7c45d25f9d51962) Thanks [@riku99](https://github.com/riku99)! - Break CLI apply/bundler dependency cycle by extracting enableInlineSourcemap into a shared bundler utility
|
|
23
|
+
|
|
24
|
+
- [#321](https://github.com/tailor-platform/sdk/pull/321) [`be23262`](https://github.com/tailor-platform/sdk/commit/be23262e0cb09078137d648ee4b6f8d2131e291e) Thanks [@toiroakr](https://github.com/toiroakr)! - fix: use type import in kysely generator template
|
|
25
|
+
|
|
26
|
+
- [#312](https://github.com/tailor-platform/sdk/pull/312) [`514ca72`](https://github.com/tailor-platform/sdk/commit/514ca7231d2a7d0c37066af0b562ec03a63488fc) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency rolldown to v1.0.0-beta.56
|
|
27
|
+
|
|
28
|
+
- [#319](https://github.com/tailor-platform/sdk/pull/319) [`33d0849`](https://github.com/tailor-platform/sdk/commit/33d08492062bad5622aa0a83214641fd725fbe73) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update actions/download-artifact action to v7
|
|
29
|
+
|
|
3
30
|
## 1.0.0
|
|
4
31
|
|
|
5
32
|
### Major Changes
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import "../chunk-DhYkiPYI.mjs";
|
|
3
3
|
import "../config-CtRi0Lgg.mjs";
|
|
4
|
-
import { $ as jsonArgs, A as printData, B as loadAccessToken, D as tokenCommand, G as fetchUserInfo, H as readPlatformConfig, I as loadConfig, J as readPackageJson, K as initOAuth2Client, M as generateCommand, O as listCommand$5, P as applyCommand, Q as deploymentArgs, R as apiCommand, S as listCommand$6, U as writePlatformConfig, V as loadWorkspaceId, W as fetchAll, X as commonArgs, Y as PATScope, Z as confirmationArgs, a as createCommand$3, d as listCommand$7, et as withCommonArgs, h as executionsCommand, l as startCommand, nt as logger, p as getCommand$2, q as initOperatorClient, r as deleteCommand$3, s as resumeCommand, t as listCommand$8, tt as workspaceArgs, w as getCommand$1, x as removeCommand, y as showCommand, z as fetchLatestToken } from "../list-
|
|
4
|
+
import { $ as jsonArgs, A as printData, B as loadAccessToken, D as tokenCommand, G as fetchUserInfo, H as readPlatformConfig, I as loadConfig, J as readPackageJson, K as initOAuth2Client, M as generateCommand, O as listCommand$5, P as applyCommand, Q as deploymentArgs, R as apiCommand, S as listCommand$6, U as writePlatformConfig, V as loadWorkspaceId, W as fetchAll, X as commonArgs, Y as PATScope, Z as confirmationArgs, a as createCommand$3, d as listCommand$7, et as withCommonArgs, h as executionsCommand, l as startCommand, nt as logger, p as getCommand$2, q as initOperatorClient, r as deleteCommand$3, s as resumeCommand, t as listCommand$8, tt as workspaceArgs, w as getCommand$1, x as removeCommand, y as showCommand, z as fetchLatestToken } from "../list-LSl71zs8.mjs";
|
|
5
5
|
import { register } from "node:module";
|
|
6
6
|
import { defineCommand, runCommand, runMain } from "citty";
|
|
7
7
|
import { generateCodeVerifier } from "@badgateway/oauth2-client";
|
package/dist/cli/lib.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference path="./../user-defined.d.ts" />
|
|
2
|
-
import {
|
|
3
|
-
import "citty";
|
|
2
|
+
import { N as ParsedTailorDBType, Y as OAuth2ClientInput, d as AppConfig, gt as Resolver, m as Generator, q as IdProviderConfig, t as Executor } from "../types-UefR8mZn.mjs";
|
|
4
3
|
import { z } from "zod";
|
|
5
4
|
import { OAuth2Client } from "@badgateway/oauth2-client";
|
|
6
5
|
import "@bufbuild/protobuf/wkt";
|
|
@@ -52,12 +51,10 @@ interface GeneratorAuthInput {
|
|
|
52
51
|
oauth2Clients?: Record<string, OAuth2ClientInput>;
|
|
53
52
|
idProvider?: IdProviderConfig;
|
|
54
53
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
interface CodeGenerator<T = any, R = any, E = any, Ts = any, Rs = any> extends Omit<CodeGeneratorBase, "processType" | "processResolver" | "processExecutor" | "aggregate"> {
|
|
54
|
+
type DependencyKind = "tailordb" | "resolver" | "executor";
|
|
55
|
+
type ArrayIncludes<T extends readonly unknown[], U> = T extends readonly [infer First, ...infer Rest] ? First extends U ? true : ArrayIncludes<Rest, U> : false;
|
|
56
|
+
type HasDependency<Deps extends readonly DependencyKind[], D extends DependencyKind> = ArrayIncludes<Deps, D>;
|
|
57
|
+
interface TailorDBProcessMethods<T, Ts> {
|
|
61
58
|
processType(args: {
|
|
62
59
|
type: ParsedTailorDBType;
|
|
63
60
|
namespace: string;
|
|
@@ -66,26 +63,86 @@ interface CodeGenerator<T = any, R = any, E = any, Ts = any, Rs = any> extends O
|
|
|
66
63
|
exportName: string;
|
|
67
64
|
};
|
|
68
65
|
}): T | Promise<T>;
|
|
69
|
-
processResolver(args: {
|
|
70
|
-
resolver: Resolver;
|
|
71
|
-
namespace: string;
|
|
72
|
-
}): R | Promise<R>;
|
|
73
|
-
processExecutor(executor: Executor): E | Promise<E>;
|
|
74
66
|
processTailorDBNamespace?(args: {
|
|
75
67
|
namespace: string;
|
|
76
68
|
types: Record<string, T>;
|
|
77
69
|
}): Ts | Promise<Ts>;
|
|
70
|
+
}
|
|
71
|
+
interface ResolverProcessMethods<R, Rs> {
|
|
72
|
+
processResolver(args: {
|
|
73
|
+
resolver: Resolver;
|
|
74
|
+
namespace: string;
|
|
75
|
+
}): R | Promise<R>;
|
|
78
76
|
processResolverNamespace?(args: {
|
|
79
77
|
namespace: string;
|
|
80
78
|
resolvers: Record<string, R>;
|
|
81
79
|
}): Rs | Promise<Rs>;
|
|
80
|
+
}
|
|
81
|
+
interface ExecutorProcessMethods<E> {
|
|
82
|
+
processExecutor(executor: Executor): E | Promise<E>;
|
|
83
|
+
}
|
|
84
|
+
type SelectMethods<Deps extends readonly DependencyKind[], T, R, E, Ts, Rs> = (HasDependency<Deps, "tailordb"> extends true ? TailorDBProcessMethods<T, Ts> : object) & (HasDependency<Deps, "resolver"> extends true ? ResolverProcessMethods<R, Rs> : object) & (HasDependency<Deps, "executor"> extends true ? ExecutorProcessMethods<E> : object);
|
|
85
|
+
interface TailorDBInputPart<Ts> {
|
|
86
|
+
tailordb: TailorDBNamespaceResult<Ts>[];
|
|
87
|
+
}
|
|
88
|
+
interface ResolverInputPart<Rs> {
|
|
89
|
+
resolver: ResolverNamespaceResult<Rs>[];
|
|
90
|
+
}
|
|
91
|
+
interface ExecutorInputPart<E> {
|
|
92
|
+
executor: E[];
|
|
93
|
+
}
|
|
94
|
+
interface AuthPart {
|
|
95
|
+
auth?: GeneratorAuthInput;
|
|
96
|
+
}
|
|
97
|
+
type SelectInput<Deps extends readonly DependencyKind[], Ts, Rs, E> = (HasDependency<Deps, "tailordb"> extends true ? TailorDBInputPart<Ts> : object) & (HasDependency<Deps, "resolver"> extends true ? ResolverInputPart<Rs> : object) & (HasDependency<Deps, "executor"> extends true ? ExecutorInputPart<E> : object) & AuthPart;
|
|
98
|
+
/** Input type for aggregate method - use with dependencies */
|
|
99
|
+
|
|
100
|
+
/** Input type for TailorDB-only generators */
|
|
101
|
+
type TailorDBInput<Ts> = TailorDBInputPart<Ts> & AuthPart;
|
|
102
|
+
/** Input type for Resolver-only generators */
|
|
103
|
+
type ResolverInput<Rs> = ResolverInputPart<Rs> & AuthPart;
|
|
104
|
+
/** Input type for Executor-only generators */
|
|
105
|
+
type ExecutorInput<E> = ExecutorInputPart<E> & AuthPart;
|
|
106
|
+
/** Input type for full generators (TailorDB + Resolver + Executor) */
|
|
107
|
+
type FullInput<Ts, Rs, E> = TailorDBInputPart<Ts> & ResolverInputPart<Rs> & ExecutorInputPart<E> & AuthPart;
|
|
108
|
+
/** Arguments type for aggregate method */
|
|
109
|
+
interface AggregateArgs<Input> {
|
|
110
|
+
input: Input;
|
|
111
|
+
baseDir: string;
|
|
112
|
+
configPath: string;
|
|
113
|
+
}
|
|
114
|
+
interface CodeGeneratorCore {
|
|
115
|
+
readonly id: string;
|
|
116
|
+
readonly description: string;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Generator interface with dependencies-based conditional methods.
|
|
120
|
+
*
|
|
121
|
+
* @template Deps - Dependencies array (e.g., ['tailordb'], ['tailordb', 'resolver'])
|
|
122
|
+
* @template T - Return type of processType
|
|
123
|
+
* @template R - Return type of processResolver
|
|
124
|
+
* @template E - Return type of processExecutor
|
|
125
|
+
* @template Ts - Return type of processTailorDBNamespace (default: Record<string, T>)
|
|
126
|
+
* @template Rs - Return type of processResolverNamespace (default: Record<string, R>)
|
|
127
|
+
*/
|
|
128
|
+
type CodeGenerator<Deps extends readonly DependencyKind[], T = unknown, R = unknown, E = unknown, Ts = Record<string, T>, Rs = Record<string, R>> = CodeGeneratorCore & SelectMethods<Deps, T, R, E, Ts, Rs> & {
|
|
129
|
+
readonly dependencies: Deps;
|
|
82
130
|
aggregate(args: {
|
|
83
|
-
input:
|
|
84
|
-
executorInputs: E[];
|
|
131
|
+
input: SelectInput<Deps, Ts, Rs, E>;
|
|
85
132
|
baseDir: string;
|
|
86
133
|
configPath: string;
|
|
87
134
|
}): GeneratorResult | Promise<GeneratorResult>;
|
|
88
|
-
}
|
|
135
|
+
};
|
|
136
|
+
/** TailorDB-only generator */
|
|
137
|
+
type TailorDBGenerator<T = unknown, Ts = Record<string, T>> = CodeGenerator<readonly ["tailordb"], T, never, never, Ts, never>;
|
|
138
|
+
/** Resolver-only generator */
|
|
139
|
+
type ResolverGenerator<R = unknown, Rs = Record<string, R>> = CodeGenerator<readonly ["resolver"], never, R, never, never, Rs>;
|
|
140
|
+
/** Executor-only generator */
|
|
141
|
+
type ExecutorGenerator<E = unknown> = CodeGenerator<readonly ["executor"], never, never, E, never, never>;
|
|
142
|
+
/** TailorDB + Resolver generator */
|
|
143
|
+
type TailorDBResolverGenerator<T = unknown, R = unknown, Ts = Record<string, T>, Rs = Record<string, R>> = CodeGenerator<readonly ["tailordb", "resolver"], T, R, never, Ts, Rs>;
|
|
144
|
+
/** Full generator (all dependencies) */
|
|
145
|
+
type FullCodeGenerator<T = unknown, R = unknown, E = unknown, Ts = Record<string, T>, Rs = Record<string, R>> = CodeGenerator<readonly ["tailordb", "resolver", "executor"], T, R, E, Ts, Rs>;
|
|
89
146
|
//#endregion
|
|
90
147
|
//#region src/cli/generator/options.d.ts
|
|
91
148
|
type GenerateOptions = {
|
|
@@ -368,5 +425,5 @@ interface ApiCallResult {
|
|
|
368
425
|
*/
|
|
369
426
|
declare function apiCall(options: ApiCallOptions): Promise<ApiCallResult>;
|
|
370
427
|
//#endregion
|
|
371
|
-
export { type ApiCallOptions, type ApiCallResult, type ApplicationInfo, type ApplyOptions, type CodeGenerator, type CreateWorkspaceOptions, type DeleteWorkspaceOptions, type Executor, type
|
|
428
|
+
export { type AggregateArgs, type ApiCallOptions, type ApiCallResult, type ApplicationInfo, type ApplyOptions, type CodeGenerator, type CreateWorkspaceOptions, type DeleteWorkspaceOptions, type DependencyKind, type Executor, type ExecutorGenerator, type ExecutorInput, type FullCodeGenerator, type FullInput, type GenerateOptions, type GeneratorResult, type GetMachineUserTokenOptions, type GetOAuth2ClientOptions, type GetWorkflowExecutionOptions, type GetWorkflowExecutionResult, type GetWorkflowOptions, type ListMachineUsersOptions, type ListOAuth2ClientsOptions, type ListWorkflowExecutionsOptions, type ListWorkflowsOptions, type ListWorkspacesOptions, type MachineUserInfo, type MachineUserTokenInfo, type OAuth2ClientCredentials, type OAuth2ClientInfo, type RemoveOptions, type Resolver, type ResolverGenerator, type ResolverInput, type ResumeWorkflowOptions, type ResumeWorkflowResultWithWait, type ShowOptions, type StartWorkflowOptions, type StartWorkflowResultWithWait, type TailorDBGenerator, type TailorDBInput, type TailorDBResolverGenerator, type ParsedTailorDBType as TailorDBType, type WaitOptions, type WorkflowExecutionInfo, type WorkflowInfo, type WorkflowJobExecutionInfo, type WorkflowListInfo, type WorkspaceInfo, apiCall, apply, createWorkspace, deleteWorkspace, generate, generateUserTypes, getMachineUserToken, getOAuth2Client, getWorkflow, getWorkflowExecution, listMachineUsers, listOAuth2Clients, listWorkflowExecutions, listWorkflows, listWorkspaces, loadAccessToken, loadConfig, loadWorkspaceId, remove, resumeWorkflow, show, startWorkflow };
|
|
372
429
|
//# sourceMappingURL=lib.d.mts.map
|
package/dist/cli/lib.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../chunk-DhYkiPYI.mjs";
|
|
2
2
|
import "../config-CtRi0Lgg.mjs";
|
|
3
|
-
import { B as loadAccessToken, C as listOAuth2Clients, E as getMachineUserToken, F as generateUserTypes, I as loadConfig, L as apiCall, N as apply, T as getOAuth2Client, V as loadWorkspaceId, _ as listWorkflowExecutions, b as remove, c as resumeWorkflow, f as listWorkflows, g as getWorkflowExecution, i as deleteWorkspace, j as generate, k as listMachineUsers, m as getWorkflow, n as listWorkspaces, o as createWorkspace, u as startWorkflow, v as show } from "../list-
|
|
3
|
+
import { B as loadAccessToken, C as listOAuth2Clients, E as getMachineUserToken, F as generateUserTypes, I as loadConfig, L as apiCall, N as apply, T as getOAuth2Client, V as loadWorkspaceId, _ as listWorkflowExecutions, b as remove, c as resumeWorkflow, f as listWorkflows, g as getWorkflowExecution, i as deleteWorkspace, j as generate, k as listMachineUsers, m as getWorkflow, n as listWorkspaces, o as createWorkspace, u as startWorkflow, v as show } from "../list-LSl71zs8.mjs";
|
|
4
4
|
import { register } from "node:module";
|
|
5
5
|
|
|
6
6
|
//#region src/cli/lib.ts
|
package/dist/cli/lib.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.mjs","names":[],"sources":["../../src/cli/lib.ts"],"sourcesContent":["// CLI API exports for programmatic usage\nimport { register } from \"node:module\";\n\n// Register tsx to handle TypeScript files when using CLI API programmatically\nregister(\"tsx\", import.meta.url, { data: {} });\n\nexport { apply } from \"./apply/index\";\nexport type { ApplyOptions } from \"./apply/index\";\nexport { generate } from \"./generator/index\";\nexport type { GenerateOptions } from \"./generator/options\";\nexport { loadConfig } from \"./config-loader\";\nexport { generateUserTypes } from \"./type-generator\";\nexport type {\n CodeGenerator,\n
|
|
1
|
+
{"version":3,"file":"lib.mjs","names":[],"sources":["../../src/cli/lib.ts"],"sourcesContent":["// CLI API exports for programmatic usage\nimport { register } from \"node:module\";\n\n// Register tsx to handle TypeScript files when using CLI API programmatically\nregister(\"tsx\", import.meta.url, { data: {} });\n\nexport { apply } from \"./apply/index\";\nexport type { ApplyOptions } from \"./apply/index\";\nexport { generate } from \"./generator/index\";\nexport type { GenerateOptions } from \"./generator/options\";\nexport { loadConfig } from \"./config-loader\";\nexport { generateUserTypes } from \"./type-generator\";\nexport type {\n CodeGenerator,\n TailorDBGenerator,\n ResolverGenerator,\n ExecutorGenerator,\n TailorDBResolverGenerator,\n FullCodeGenerator,\n TailorDBInput,\n ResolverInput,\n ExecutorInput,\n FullInput,\n AggregateArgs,\n GeneratorResult,\n DependencyKind,\n} from \"./generator/types\";\nexport type { ParsedTailorDBType as TailorDBType } from \"@/parser/service/tailordb/types\";\nexport type { Resolver } from \"@/parser/service/resolver\";\nexport type { Executor } from \"@/parser/service/executor\";\n\nexport { show, type ShowOptions, type ApplicationInfo } from \"./show\";\nexport { remove, type RemoveOptions } from \"./remove\";\nexport {\n createWorkspace,\n type CreateWorkspaceOptions,\n} from \"./workspace/create\";\nexport { listWorkspaces, type ListWorkspacesOptions } from \"./workspace/list\";\nexport {\n deleteWorkspace,\n type DeleteWorkspaceOptions,\n} from \"./workspace/delete\";\nexport type { WorkspaceInfo } from \"./workspace/transform\";\nexport {\n listMachineUsers,\n type ListMachineUsersOptions,\n type MachineUserInfo,\n} from \"./machineuser/list\";\nexport {\n getMachineUserToken,\n type GetMachineUserTokenOptions,\n type MachineUserTokenInfo,\n} from \"./machineuser/token\";\nexport {\n getOAuth2Client,\n type GetOAuth2ClientOptions,\n} from \"./oauth2client/get\";\nexport {\n listOAuth2Clients,\n type ListOAuth2ClientsOptions,\n} from \"./oauth2client/list\";\nexport type {\n OAuth2ClientInfo,\n OAuth2ClientCredentials,\n} from \"./oauth2client/transform\";\nexport { listWorkflows, type ListWorkflowsOptions } from \"./workflow/list\";\nexport { getWorkflow, type GetWorkflowOptions } from \"./workflow/get\";\nexport {\n startWorkflow,\n type StartWorkflowOptions,\n type StartWorkflowResultWithWait,\n type WaitOptions,\n} from \"./workflow/start\";\nexport {\n listWorkflowExecutions,\n getWorkflowExecution,\n type ListWorkflowExecutionsOptions,\n type GetWorkflowExecutionOptions,\n type GetWorkflowExecutionResult,\n} from \"./workflow/executions\";\nexport {\n resumeWorkflow,\n type ResumeWorkflowOptions,\n type ResumeWorkflowResultWithWait,\n} from \"./workflow/resume\";\nexport type {\n WorkflowListInfo,\n WorkflowInfo,\n WorkflowExecutionInfo,\n WorkflowJobExecutionInfo,\n} from \"./workflow/transform\";\nexport { loadAccessToken, loadWorkspaceId } from \"./context\";\nexport { apiCall, type ApiCallOptions, type ApiCallResult } from \"./api\";\n"],"mappings":";;;;;;AAIA,SAAS,OAAO,OAAO,KAAK,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference path="./../user-defined.d.ts" />
|
|
2
|
-
import { $ as
|
|
3
|
-
import { A as WORKFLOW_JOB_BRAND, C as GqlOperation, D as Workflow, E as WorkflowOperation, F as createWorkflowJob, I as createResolver, L as Env, M as WorkflowJobContext, N as WorkflowJobInput, O as WorkflowConfig, P as WorkflowJobOutput, S as FunctionOperation, T as WebhookOperation, _ as ResolverExecutedTrigger, a as Trigger, b as recordUpdatedTrigger, c as IncomingWebhookTrigger, d as scheduleTrigger, f as RecordCreatedArgs, g as ResolverExecutedArgs, h as RecordUpdatedArgs, i as createExecutor, j as WorkflowJob, k as createWorkflow, l as incomingWebhookTrigger, m as RecordTrigger, n as output, o as IncomingWebhookArgs, p as RecordDeletedArgs, r as t, s as IncomingWebhookRequest, t as infer, u as ScheduleTrigger, v as recordCreatedTrigger, w as Operation, x as resolverExecutedTrigger, y as recordDeletedTrigger } from "../index-
|
|
2
|
+
import { $ as SCIMAttributeMapping, A as db, B as AuthExternalConfig, C as ResolverServiceConfig, D as TailorDBField, E as ExecutorServiceInput, F as TailorTypeGqlPermission, G as BuiltinIdP, H as AuthOwnConfig, I as TailorTypePermission, J as OAuth2ClientGrantType, K as IDToken, L as unsafeAllowAllGqlPermission, O as TailorDBInstance, P as PermissionCondition, Q as SCIMAttribute, R as unsafeAllowAllTypePermission, S as ResolverExternalConfig, T as ExecutorServiceConfig, U as defineAuth, V as AuthInvoker, W as AuthServiceInput, X as OIDC, Y as OAuth2ClientInput, Z as SAML, _ as StaticWebsiteConfig, at as UserAttributeKey, b as IdPExternalConfig, ct as UsernameFieldKey, dt as AttributeMap, et as SCIMAttributeType, f as defineConfig, ft as TailorUser, g as WorkflowServiceInput, gt as Resolver, h as WorkflowServiceConfig, ht as QueryType, it as TenantProviderConfig, k as TailorDBType, lt as ValueOperand, mt as TailorField, nt as SCIMConfig, ot as UserAttributeListKey, p as defineGenerators, pt as unauthenticatedTailorUser, q as IdProviderConfig, rt as SCIMResource, st as UserAttributeMap, tt as SCIMAuthorization, ut as AttributeList, v as defineStaticWebSite, w as ResolverServiceInput, x as defineIdp, y as IdPConfig, z as AuthConfig } from "../types-UefR8mZn.mjs";
|
|
3
|
+
import { A as WORKFLOW_JOB_BRAND, C as GqlOperation, D as Workflow, E as WorkflowOperation, F as createWorkflowJob, I as createResolver, L as Env, M as WorkflowJobContext, N as WorkflowJobInput, O as WorkflowConfig, P as WorkflowJobOutput, S as FunctionOperation, T as WebhookOperation, _ as ResolverExecutedTrigger, a as Trigger, b as recordUpdatedTrigger, c as IncomingWebhookTrigger, d as scheduleTrigger, f as RecordCreatedArgs, g as ResolverExecutedArgs, h as RecordUpdatedArgs, i as createExecutor, j as WorkflowJob, k as createWorkflow, l as incomingWebhookTrigger, m as RecordTrigger, n as output, o as IncomingWebhookArgs, p as RecordDeletedArgs, r as t, s as IncomingWebhookRequest, t as infer, u as ScheduleTrigger, v as recordCreatedTrigger, w as Operation, x as resolverExecutedTrigger, y as recordDeletedTrigger } from "../index-2JVUi0to.mjs";
|
|
4
4
|
export { AttributeList, AttributeMap, AuthConfig, AuthExternalConfig, AuthInvoker, AuthOwnConfig, AuthServiceInput, BuiltinIdP, Env, ExecutorServiceConfig, ExecutorServiceInput, FunctionOperation, GqlOperation, IDToken, IdPConfig, IdPExternalConfig, IdProviderConfig, IncomingWebhookArgs, IncomingWebhookRequest, IncomingWebhookTrigger, OAuth2ClientInput as OAuth2Client, OAuth2ClientGrantType, OIDC, Operation, PermissionCondition, QueryType, RecordCreatedArgs, RecordDeletedArgs, RecordTrigger, RecordUpdatedArgs, Resolver, ResolverExecutedArgs, ResolverExecutedTrigger, ResolverExternalConfig, ResolverServiceConfig, ResolverServiceInput, SAML, SCIMAttribute, SCIMAttributeMapping, SCIMAttributeType, SCIMAuthorization, SCIMConfig, SCIMResource, ScheduleTrigger, StaticWebsiteConfig, TailorDBField, TailorDBInstance, TailorDBType, TailorField, TailorTypeGqlPermission, TailorTypePermission, TailorUser, TenantProviderConfig, Trigger, UserAttributeKey, UserAttributeListKey, UserAttributeMap, UsernameFieldKey, ValueOperand, WORKFLOW_JOB_BRAND, WebhookOperation, Workflow, WorkflowConfig, WorkflowJob, WorkflowJobContext, WorkflowJobInput, WorkflowJobOutput, WorkflowOperation, WorkflowServiceConfig, WorkflowServiceInput, createExecutor, createResolver, createWorkflow, createWorkflowJob, db, defineAuth, defineConfig, defineGenerators, defineIdp, defineStaticWebSite, incomingWebhookTrigger, infer, output, recordCreatedTrigger, recordDeletedTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, t, unauthenticatedTailorUser, unsafeAllowAllGqlPermission, unsafeAllowAllTypePermission };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference path="./user-defined.d.ts" />
|
|
2
|
-
import {
|
|
2
|
+
import { Ct as JsonCompatible, M as AllowedValuesOutput, St as InferFieldsOutput, V as AuthInvoker, _t as ResolverInput, a as IncomingWebhookTrigger$1, bt as FieldOptions, c as ScheduleTriggerInput, ft as TailorUser, i as GqlOperation$1, j as AllowedValues, k as TailorDBType, l as WebhookOperation$1, mt as TailorField, n as ExecutorInput, o as RecordTrigger$1, r as FunctionOperation$1, s as ResolverExecutedTrigger$1, u as WorkflowOperation$1, vt as ArrayFieldOutput, wt as output$1, xt as FieldOutput, yt as FieldMetadata } from "./types-UefR8mZn.mjs";
|
|
3
3
|
import { EmptyObject, JsonPrimitive, Jsonifiable, Jsonify } from "type-fest";
|
|
4
4
|
import { Client } from "@urql/core";
|
|
5
5
|
import { StandardCRON } from "ts-cron-validator";
|
|
@@ -355,4 +355,4 @@ declare namespace t {
|
|
|
355
355
|
}
|
|
356
356
|
//#endregion
|
|
357
357
|
export { WORKFLOW_JOB_BRAND as A, GqlOperation as C, Workflow as D, WorkflowOperation as E, createWorkflowJob as F, createResolver as I, Env as L, WorkflowJobContext as M, WorkflowJobInput as N, WorkflowConfig as O, WorkflowJobOutput as P, FunctionOperation as S, WebhookOperation as T, ResolverExecutedTrigger as _, Trigger as a, recordUpdatedTrigger as b, IncomingWebhookTrigger as c, scheduleTrigger as d, RecordCreatedArgs as f, ResolverExecutedArgs as g, RecordUpdatedArgs as h, createExecutor as i, WorkflowJob as j, createWorkflow as k, incomingWebhookTrigger as l, RecordTrigger as m, output as n, IncomingWebhookArgs as o, RecordDeletedArgs as p, t as r, IncomingWebhookRequest as s, infer as t, ScheduleTrigger as u, recordCreatedTrigger as v, Operation as w, resolverExecutedTrigger as x, recordDeletedTrigger as y };
|
|
358
|
-
//# sourceMappingURL=index-
|
|
358
|
+
//# sourceMappingURL=index-2JVUi0to.d.mts.map
|
|
@@ -1875,7 +1875,6 @@ var ResolverService = class {
|
|
|
1875
1875
|
if (Object.keys(this.resolvers).length > 0) return;
|
|
1876
1876
|
if (!this.config.files || this.config.files.length === 0) return;
|
|
1877
1877
|
const resolverFiles = loadFilesWithIgnores(this.config);
|
|
1878
|
-
logger.newline();
|
|
1879
1878
|
logger.log(`Found ${styles.highlight(resolverFiles.length.toString())} resolver files for service ${styles.highlight(`"${this.namespace}"`)}`);
|
|
1880
1879
|
await Promise.all(resolverFiles.map((resolverFile) => this.loadResolverForFile(resolverFile)));
|
|
1881
1880
|
}
|
|
@@ -98696,6 +98695,10 @@ function isWorkflowJob(value) {
|
|
|
98696
98695
|
return value != null && typeof value === "object" && WORKFLOW_JOB_BRAND in value && value[WORKFLOW_JOB_BRAND] === true;
|
|
98697
98696
|
}
|
|
98698
98697
|
|
|
98698
|
+
//#endregion
|
|
98699
|
+
//#region src/cli/bundler/inline-sourcemap.ts
|
|
98700
|
+
const enableInlineSourcemap = process.env.TAILOR_ENABLE_INLINE_SOURCEMAP === "true";
|
|
98701
|
+
|
|
98699
98702
|
//#endregion
|
|
98700
98703
|
//#region src/cli/bundler/workflow/ast-utils.ts
|
|
98701
98704
|
/**
|
|
@@ -99292,7 +99295,10 @@ async function loadExecutor(executorFilePath) {
|
|
|
99292
99295
|
*/
|
|
99293
99296
|
async function bundleExecutors(config, triggerContext) {
|
|
99294
99297
|
const files = loadFilesWithIgnores(config);
|
|
99295
|
-
if (files.length === 0)
|
|
99298
|
+
if (files.length === 0) {
|
|
99299
|
+
logger.warn(`No executor files found for patterns: ${config.files?.join(", ") ?? "(none)"}`);
|
|
99300
|
+
return;
|
|
99301
|
+
}
|
|
99296
99302
|
logger.newline();
|
|
99297
99303
|
logger.log(`Bundling ${styles.highlight(files.length.toString())} files for ${styles.info("\"executor\"")}`);
|
|
99298
99304
|
const executors = [];
|
|
@@ -99380,7 +99386,10 @@ async function loadResolver(resolverFilePath) {
|
|
|
99380
99386
|
*/
|
|
99381
99387
|
async function bundleResolvers(namespace, config, triggerContext) {
|
|
99382
99388
|
const files = loadFilesWithIgnores(config);
|
|
99383
|
-
if (files.length === 0)
|
|
99389
|
+
if (files.length === 0) {
|
|
99390
|
+
logger.warn(`No resolver files found for patterns: ${config.files?.join(", ") ?? "(none)"}`);
|
|
99391
|
+
return;
|
|
99392
|
+
}
|
|
99384
99393
|
logger.newline();
|
|
99385
99394
|
logger.log(`Bundling ${styles.highlight(files.length.toString())} files for ${styles.info(`"${namespace}"`)}`);
|
|
99386
99395
|
const resolvers = [];
|
|
@@ -99622,7 +99631,7 @@ function transformWorkflowSource(source, targetJobName, targetJobExportName, oth
|
|
|
99622
99631
|
*/
|
|
99623
99632
|
async function bundleWorkflowJobs(allJobs, mainJobNames, env = {}, triggerContext) {
|
|
99624
99633
|
if (allJobs.length === 0) {
|
|
99625
|
-
logger.
|
|
99634
|
+
logger.warn("No workflow jobs to bundle");
|
|
99626
99635
|
return { mainJobDeps: {} };
|
|
99627
99636
|
}
|
|
99628
99637
|
const { usedJobs, mainJobDeps } = await filterUsedJobs(allJobs, mainJobNames);
|
|
@@ -99760,6 +99769,11 @@ async function bundleSingleJob(job, allJobs, outputDir, tsconfig, env, triggerCo
|
|
|
99760
99769
|
|
|
99761
99770
|
//#endregion
|
|
99762
99771
|
//#region src/parser/generator-config/index.ts
|
|
99772
|
+
const DependencyKindSchema = z.enum([
|
|
99773
|
+
"tailordb",
|
|
99774
|
+
"resolver",
|
|
99775
|
+
"executor"
|
|
99776
|
+
]);
|
|
99763
99777
|
const KyselyTypeConfigSchema = z.tuple([z.literal("@tailor-platform/kysely-type"), z.object({ distPath: z.string() })]);
|
|
99764
99778
|
const SeedConfigSchema = z.tuple([z.literal("@tailor-platform/seed"), z.object({
|
|
99765
99779
|
distPath: z.string(),
|
|
@@ -99770,9 +99784,10 @@ const FileUtilsConfigSchema = z.tuple([z.literal("@tailor-platform/file-utils"),
|
|
|
99770
99784
|
const CodeGeneratorSchema = z.object({
|
|
99771
99785
|
id: z.string(),
|
|
99772
99786
|
description: z.string(),
|
|
99773
|
-
|
|
99774
|
-
|
|
99775
|
-
|
|
99787
|
+
dependencies: z.array(DependencyKindSchema),
|
|
99788
|
+
processType: z.function().optional(),
|
|
99789
|
+
processResolver: z.function().optional(),
|
|
99790
|
+
processExecutor: z.function().optional(),
|
|
99776
99791
|
processTailorDBNamespace: z.function().optional(),
|
|
99777
99792
|
processResolverNamespace: z.function().optional(),
|
|
99778
99793
|
aggregate: z.function({ output: z.any() })
|
|
@@ -99806,6 +99821,13 @@ function createGeneratorConfigSchema(builtinGenerators$1) {
|
|
|
99806
99821
|
}).brand("CodeGenerator");
|
|
99807
99822
|
}
|
|
99808
99823
|
|
|
99824
|
+
//#endregion
|
|
99825
|
+
//#region src/cli/generator/types.ts
|
|
99826
|
+
/** Type guard to check if a generator has a specific dependency */
|
|
99827
|
+
function hasDependency(generator, dependency) {
|
|
99828
|
+
return generator.dependencies.includes(dependency);
|
|
99829
|
+
}
|
|
99830
|
+
|
|
99809
99831
|
//#endregion
|
|
99810
99832
|
//#region src/cli/generator/builtin/enum-constants/enum-processor.ts
|
|
99811
99833
|
/**
|
|
@@ -99890,14 +99912,13 @@ const EnumConstantsGeneratorID = "@tailor-platform/enum-constants";
|
|
|
99890
99912
|
var EnumConstantsGenerator = class {
|
|
99891
99913
|
id = EnumConstantsGeneratorID;
|
|
99892
99914
|
description = "Generates enum constants from TailorDB type definitions";
|
|
99915
|
+
dependencies = ["tailordb"];
|
|
99893
99916
|
constructor(options) {
|
|
99894
99917
|
this.options = options;
|
|
99895
99918
|
}
|
|
99896
99919
|
async processType(args) {
|
|
99897
99920
|
return await EnumProcessor.processType(args.type);
|
|
99898
99921
|
}
|
|
99899
|
-
processResolver() {}
|
|
99900
|
-
processExecutor() {}
|
|
99901
99922
|
async processTailorDBNamespace(args) {
|
|
99902
99923
|
const allEnums = [];
|
|
99903
99924
|
for (const enumConstantMetadata of Object.values(args.types)) allEnums.push(...enumConstantMetadata.enums);
|
|
@@ -99906,9 +99927,6 @@ var EnumConstantsGenerator = class {
|
|
|
99906
99927
|
enums: allEnums
|
|
99907
99928
|
};
|
|
99908
99929
|
}
|
|
99909
|
-
processIdProvider() {}
|
|
99910
|
-
processAuth() {}
|
|
99911
|
-
processStaticWebsite() {}
|
|
99912
99930
|
aggregate(args) {
|
|
99913
99931
|
const files = [];
|
|
99914
99932
|
const allEnums = [];
|
|
@@ -100020,14 +100038,13 @@ const FileUtilsGeneratorID = "@tailor-platform/file-utils";
|
|
|
100020
100038
|
var FileUtilsGenerator = class {
|
|
100021
100039
|
id = FileUtilsGeneratorID;
|
|
100022
100040
|
description = "Generates TypeWithFiles interface from TailorDB type definitions";
|
|
100041
|
+
dependencies = ["tailordb"];
|
|
100023
100042
|
constructor(options) {
|
|
100024
100043
|
this.options = options;
|
|
100025
100044
|
}
|
|
100026
100045
|
async processType(args) {
|
|
100027
100046
|
return await FileProcessor.processType(args.type);
|
|
100028
100047
|
}
|
|
100029
|
-
processResolver() {}
|
|
100030
|
-
processExecutor() {}
|
|
100031
100048
|
async processTailorDBNamespace(args) {
|
|
100032
100049
|
const typesWithFiles = Object.values(args.types).filter((t$1) => t$1.fileFields.length > 0);
|
|
100033
100050
|
if (typesWithFiles.length === 0) return "";
|
|
@@ -100036,9 +100053,6 @@ var FileUtilsGenerator = class {
|
|
|
100036
100053
|
types: typesWithFiles
|
|
100037
100054
|
});
|
|
100038
100055
|
}
|
|
100039
|
-
processIdProvider() {}
|
|
100040
|
-
processAuth() {}
|
|
100041
|
-
processStaticWebsite() {}
|
|
100042
100056
|
aggregate(args) {
|
|
100043
100057
|
const files = [];
|
|
100044
100058
|
const allNamespaceData = [];
|
|
@@ -100222,7 +100236,7 @@ var TypeProcessor = class {
|
|
|
100222
100236
|
if (globalUsedUtilityTypes.Serial) utilityTypeDeclarations.push(`type Serial<T = string | number> = ColumnType<T, never, never>;`);
|
|
100223
100237
|
return [
|
|
100224
100238
|
ml`
|
|
100225
|
-
import { type ColumnType, Kysely, KyselyConfig } from "kysely";
|
|
100239
|
+
import { type ColumnType, Kysely, type KyselyConfig } from "kysely";
|
|
100226
100240
|
import { TailordbDialect } from "@tailor-platform/function-kysely-tailordb";
|
|
100227
100241
|
|
|
100228
100242
|
${utilityTypeDeclarations.join("\n")}
|
|
@@ -100259,14 +100273,13 @@ const KyselyGeneratorID = "@tailor-platform/kysely-type";
|
|
|
100259
100273
|
var KyselyGenerator = class {
|
|
100260
100274
|
id = KyselyGeneratorID;
|
|
100261
100275
|
description = "Generates Kysely type definitions for TailorDB types";
|
|
100276
|
+
dependencies = ["tailordb"];
|
|
100262
100277
|
constructor(options) {
|
|
100263
100278
|
this.options = options;
|
|
100264
100279
|
}
|
|
100265
100280
|
async processType(args) {
|
|
100266
100281
|
return await TypeProcessor.processType(args.type);
|
|
100267
100282
|
}
|
|
100268
|
-
processResolver() {}
|
|
100269
|
-
processExecutor() {}
|
|
100270
100283
|
async processTailorDBNamespace(args) {
|
|
100271
100284
|
const typesList = Object.values(args.types);
|
|
100272
100285
|
const usedUtilityTypes = typesList.reduce((acc, type) => ({
|
|
@@ -100487,10 +100500,6 @@ function generateLinesDbSchemaFile(metadata, importPath) {
|
|
|
100487
100500
|
//#region src/cli/generator/builtin/seed/index.ts
|
|
100488
100501
|
const SeedGeneratorID = "@tailor-platform/seed";
|
|
100489
100502
|
/**
|
|
100490
|
-
* Factory function to create a Seed generator.
|
|
100491
|
-
* Combines GraphQL Ingest and lines-db schema generation.
|
|
100492
|
-
*/
|
|
100493
|
-
/**
|
|
100494
100503
|
* Generates the exec.mjs script content (Node.js executable)
|
|
100495
100504
|
*/
|
|
100496
100505
|
function generateExecScript(machineUserName, relativeConfigPath) {
|
|
@@ -100526,10 +100535,15 @@ function generateExecScript(machineUserName, relativeConfigPath) {
|
|
|
100526
100535
|
|
|
100527
100536
|
`;
|
|
100528
100537
|
}
|
|
100538
|
+
/**
|
|
100539
|
+
* Factory function to create a Seed generator.
|
|
100540
|
+
* Combines GraphQL Ingest and lines-db schema generation.
|
|
100541
|
+
*/
|
|
100529
100542
|
function createSeedGenerator(options) {
|
|
100530
100543
|
return {
|
|
100531
100544
|
id: SeedGeneratorID,
|
|
100532
100545
|
description: "Generates seed data files (GraphQL Ingest + lines-db schema)",
|
|
100546
|
+
dependencies: ["tailordb"],
|
|
100533
100547
|
processType: ({ type, source }) => {
|
|
100534
100548
|
return {
|
|
100535
100549
|
gqlIngest: processGqlIngest(type),
|
|
@@ -100537,8 +100551,6 @@ function createSeedGenerator(options) {
|
|
|
100537
100551
|
};
|
|
100538
100552
|
},
|
|
100539
100553
|
processTailorDBNamespace: ({ types: types$2 }) => types$2,
|
|
100540
|
-
processExecutor: (_executor) => void 0,
|
|
100541
|
-
processResolver: (_args) => void 0,
|
|
100542
100554
|
aggregate: ({ input, configPath }) => {
|
|
100543
100555
|
const entityDependencies = {};
|
|
100544
100556
|
const files = [];
|
|
@@ -103420,12 +103432,11 @@ async function loadWorkflowScripts() {
|
|
|
103420
103432
|
|
|
103421
103433
|
//#endregion
|
|
103422
103434
|
//#region src/cli/apply/index.ts
|
|
103423
|
-
const enableInlineSourcemap = process.env.TAILOR_ENABLE_INLINE_SOURCEMAP === "true";
|
|
103424
103435
|
async function apply(options) {
|
|
103425
103436
|
const { config, configPath } = await loadConfig(options?.configPath);
|
|
103426
103437
|
const dryRun = options?.dryRun ?? false;
|
|
103427
103438
|
const yes = options?.yes ?? false;
|
|
103428
|
-
const buildOnly = options?.buildOnly ??
|
|
103439
|
+
const buildOnly = options?.buildOnly ?? process.env.TAILOR_PLATFORM_SDK_BUILD_ONLY === "true";
|
|
103429
103440
|
await generateUserTypes(config, configPath);
|
|
103430
103441
|
const application = defineApplication(config);
|
|
103431
103442
|
let workflowResult;
|
|
@@ -104039,6 +104050,19 @@ var GenerationManager = class {
|
|
|
104039
104050
|
this.baseDir = path$20.join(getDistDir(), "generated");
|
|
104040
104051
|
fs$15.mkdirSync(this.baseDir, { recursive: true });
|
|
104041
104052
|
}
|
|
104053
|
+
getDeps(gen) {
|
|
104054
|
+
return new Set(gen.dependencies);
|
|
104055
|
+
}
|
|
104056
|
+
onlyHas(gen, ...required) {
|
|
104057
|
+
const deps = this.getDeps(gen);
|
|
104058
|
+
return required.every((r$1) => deps.has(r$1)) && deps.size === required.length;
|
|
104059
|
+
}
|
|
104060
|
+
hasAll(gen, ...required) {
|
|
104061
|
+
return required.every((r$1) => this.getDeps(gen).has(r$1));
|
|
104062
|
+
}
|
|
104063
|
+
hasNone(gen, ...excluded) {
|
|
104064
|
+
return excluded.every((e) => !this.getDeps(gen).has(e));
|
|
104065
|
+
}
|
|
104042
104066
|
async generate(watch) {
|
|
104043
104067
|
logger.newline();
|
|
104044
104068
|
logger.log(`Generation for application: ${styles.highlight(this.application.config.name)}`);
|
|
@@ -104058,6 +104082,13 @@ var GenerationManager = class {
|
|
|
104058
104082
|
if (!watch) throw error;
|
|
104059
104083
|
}
|
|
104060
104084
|
}
|
|
104085
|
+
if (app.authService) await app.authService.resolveNamespaces();
|
|
104086
|
+
if (app.tailorDBServices.length > 0) logger.newline();
|
|
104087
|
+
const tailordbOnlyGens = this.generators.filter((g$1) => this.onlyHas(g$1, "tailordb"));
|
|
104088
|
+
if (tailordbOnlyGens.length > 0) {
|
|
104089
|
+
await this.runGenerators(tailordbOnlyGens, watch);
|
|
104090
|
+
logger.newline();
|
|
104091
|
+
}
|
|
104061
104092
|
for (const resolverService of app.resolverServices) {
|
|
104062
104093
|
const namespace = resolverService.namespace;
|
|
104063
104094
|
try {
|
|
@@ -104072,41 +104103,54 @@ var GenerationManager = class {
|
|
|
104072
104103
|
if (!watch) throw error;
|
|
104073
104104
|
}
|
|
104074
104105
|
}
|
|
104075
|
-
|
|
104106
|
+
const nonExecutorGens = this.generators.filter((g$1) => !tailordbOnlyGens.includes(g$1) && this.hasNone(g$1, "executor"));
|
|
104107
|
+
if (nonExecutorGens.length > 0) {
|
|
104108
|
+
await this.runGenerators(nonExecutorGens, watch);
|
|
104109
|
+
logger.newline();
|
|
104110
|
+
}
|
|
104076
104111
|
const executors = await this.application.executorService?.loadExecutors();
|
|
104077
104112
|
Object.entries(executors ?? {}).forEach(([filePath, executor]) => {
|
|
104078
104113
|
this.services.executor[filePath] = executor;
|
|
104079
104114
|
});
|
|
104080
|
-
|
|
104115
|
+
const executorGens = this.generators.filter((g$1) => this.hasAll(g$1, "executor"));
|
|
104116
|
+
if (executorGens.length > 0) {
|
|
104117
|
+
await this.runGenerators(executorGens, watch);
|
|
104118
|
+
logger.newline();
|
|
104119
|
+
}
|
|
104081
104120
|
}
|
|
104082
|
-
|
|
104083
|
-
|
|
104084
|
-
|
|
104121
|
+
async runGenerators(generators, watch) {
|
|
104122
|
+
await Promise.allSettled(generators.map(async (gen) => {
|
|
104123
|
+
try {
|
|
104124
|
+
await this.processGenerator(gen);
|
|
104125
|
+
} catch (error) {
|
|
104126
|
+
logger.error(`${styles.error("Error processing generator")} ${styles.errorBright(gen.id)}`);
|
|
104127
|
+
logger.error(String(error));
|
|
104128
|
+
if (!watch) throw error;
|
|
104129
|
+
}
|
|
104130
|
+
}));
|
|
104085
104131
|
}
|
|
104132
|
+
generatorResults = {};
|
|
104086
104133
|
async processGenerator(gen) {
|
|
104087
|
-
|
|
104088
|
-
|
|
104089
|
-
|
|
104090
|
-
|
|
104091
|
-
|
|
104092
|
-
|
|
104093
|
-
|
|
104094
|
-
|
|
104095
|
-
|
|
104096
|
-
|
|
104097
|
-
|
|
104098
|
-
await this.aggregate(gen);
|
|
104099
|
-
} catch (error) {
|
|
104100
|
-
logger.error(`${styles.error("Error processing generator")} ${styles.errorBright(gen.id)}`);
|
|
104101
|
-
logger.error(String(error));
|
|
104102
|
-
}
|
|
104134
|
+
this.generatorResults[gen.id] = {
|
|
104135
|
+
tailordbResults: {},
|
|
104136
|
+
resolverResults: {},
|
|
104137
|
+
tailordbNamespaceResults: {},
|
|
104138
|
+
resolverNamespaceResults: {},
|
|
104139
|
+
executorResults: {}
|
|
104140
|
+
};
|
|
104141
|
+
if (hasDependency(gen, "tailordb")) for (const [namespace, types$2] of Object.entries(this.services.tailordb)) await this.processTailorDBNamespace(gen, namespace, types$2);
|
|
104142
|
+
if (hasDependency(gen, "resolver")) for (const [namespace, resolvers] of Object.entries(this.services.resolver)) await this.processResolverNamespace(gen, namespace, resolvers);
|
|
104143
|
+
if (hasDependency(gen, "executor")) await this.processExecutors(gen);
|
|
104144
|
+
await this.aggregate(gen);
|
|
104103
104145
|
}
|
|
104104
104146
|
async processTailorDBNamespace(gen, namespace, typeInfo) {
|
|
104105
104147
|
const results = this.generatorResults[gen.id];
|
|
104106
104148
|
results.tailordbResults[namespace] = {};
|
|
104149
|
+
if (!gen.processType) return;
|
|
104150
|
+
const processType = gen.processType;
|
|
104107
104151
|
await Promise.allSettled(Object.entries(typeInfo.types).map(async ([typeName, type]) => {
|
|
104108
104152
|
try {
|
|
104109
|
-
results.tailordbResults[namespace][typeName] = await
|
|
104153
|
+
results.tailordbResults[namespace][typeName] = await processType({
|
|
104110
104154
|
type,
|
|
104111
104155
|
namespace,
|
|
104112
104156
|
source: typeInfo.sourceInfo[typeName]
|
|
@@ -104116,7 +104160,7 @@ var GenerationManager = class {
|
|
|
104116
104160
|
logger.error(String(error));
|
|
104117
104161
|
}
|
|
104118
104162
|
}));
|
|
104119
|
-
if (gen.processTailorDBNamespace) try {
|
|
104163
|
+
if ("processTailorDBNamespace" in gen && typeof gen.processTailorDBNamespace === "function") try {
|
|
104120
104164
|
results.tailordbNamespaceResults[namespace] = await gen.processTailorDBNamespace({
|
|
104121
104165
|
namespace,
|
|
104122
104166
|
types: results.tailordbResults[namespace]
|
|
@@ -104130,9 +104174,11 @@ var GenerationManager = class {
|
|
|
104130
104174
|
async processResolverNamespace(gen, namespace, resolvers) {
|
|
104131
104175
|
const results = this.generatorResults[gen.id];
|
|
104132
104176
|
results.resolverResults[namespace] = {};
|
|
104177
|
+
if (!gen.processResolver) return;
|
|
104178
|
+
const processResolver$1 = gen.processResolver;
|
|
104133
104179
|
await Promise.allSettled(Object.entries(resolvers).map(async ([resolverName, resolver]) => {
|
|
104134
104180
|
try {
|
|
104135
|
-
results.resolverResults[namespace][resolverName] = await
|
|
104181
|
+
results.resolverResults[namespace][resolverName] = await processResolver$1({
|
|
104136
104182
|
resolver,
|
|
104137
104183
|
namespace
|
|
104138
104184
|
});
|
|
@@ -104141,7 +104187,7 @@ var GenerationManager = class {
|
|
|
104141
104187
|
logger.error(String(error));
|
|
104142
104188
|
}
|
|
104143
104189
|
}));
|
|
104144
|
-
if (gen.processResolverNamespace) try {
|
|
104190
|
+
if ("processResolverNamespace" in gen && typeof gen.processResolverNamespace === "function") try {
|
|
104145
104191
|
results.resolverNamespaceResults[namespace] = await gen.processResolverNamespace({
|
|
104146
104192
|
namespace,
|
|
104147
104193
|
resolvers: results.resolverResults[namespace]
|
|
@@ -104154,9 +104200,11 @@ var GenerationManager = class {
|
|
|
104154
104200
|
}
|
|
104155
104201
|
async processExecutors(gen) {
|
|
104156
104202
|
const results = this.generatorResults[gen.id];
|
|
104203
|
+
if (!gen.processExecutor) return;
|
|
104204
|
+
const processExecutor = gen.processExecutor;
|
|
104157
104205
|
await Promise.allSettled(Object.entries(this.services.executor).map(async ([executorId, executor]) => {
|
|
104158
104206
|
try {
|
|
104159
|
-
results.executorResults[executorId] = await
|
|
104207
|
+
results.executorResults[executorId] = await processExecutor(executor);
|
|
104160
104208
|
} catch (error) {
|
|
104161
104209
|
logger.error(`${styles.error(`Error processing executor`)} ${styles.errorBright(executor.name)} ${styles.error(`with generator ${gen.id}`)}`);
|
|
104162
104210
|
logger.error(String(error));
|
|
@@ -104191,14 +104239,12 @@ var GenerationManager = class {
|
|
|
104191
104239
|
namespace,
|
|
104192
104240
|
resolvers
|
|
104193
104241
|
});
|
|
104194
|
-
const input = {
|
|
104195
|
-
|
|
104196
|
-
|
|
104197
|
-
|
|
104198
|
-
};
|
|
104242
|
+
const input = { auth: this.getAuthInput() };
|
|
104243
|
+
if (hasDependency(gen, "tailordb")) input.tailordb = tailordbResults;
|
|
104244
|
+
if (hasDependency(gen, "resolver")) input.resolver = resolverResults;
|
|
104245
|
+
if (hasDependency(gen, "executor")) input.executor = Object.values(results.executorResults);
|
|
104199
104246
|
const result = await gen.aggregate({
|
|
104200
104247
|
input,
|
|
104201
|
-
executorInputs: Object.values(results.executorResults),
|
|
104202
104248
|
baseDir: path$20.join(this.baseDir, gen.id),
|
|
104203
104249
|
configPath: this.configPath ?? "tailor.config.ts"
|
|
104204
104250
|
});
|
|
@@ -104232,7 +104278,6 @@ var GenerationManager = class {
|
|
|
104232
104278
|
});
|
|
104233
104279
|
});
|
|
104234
104280
|
}));
|
|
104235
|
-
logger.newline();
|
|
104236
104281
|
}
|
|
104237
104282
|
watcher = null;
|
|
104238
104283
|
async watch() {
|
|
@@ -105645,4 +105690,4 @@ const listCommand = defineCommand({
|
|
|
105645
105690
|
|
|
105646
105691
|
//#endregion
|
|
105647
105692
|
export { jsonArgs as $, printData as A, loadAccessToken as B, listOAuth2Clients as C, tokenCommand as D, getMachineUserToken as E, generateUserTypes as F, fetchUserInfo as G, readPlatformConfig as H, loadConfig as I, readPackageJson as J, initOAuth2Client as K, apiCall as L, generateCommand as M, apply as N, listCommand$3 as O, applyCommand as P, deploymentArgs as Q, apiCommand as R, listCommand$2 as S, getOAuth2Client as T, writePlatformConfig as U, loadWorkspaceId as V, fetchAll as W, commonArgs as X, PATScope as Y, confirmationArgs as Z, listWorkflowExecutions as _, createCommand as a, remove as b, resumeWorkflow as c, listCommand$1 as d, withCommonArgs as et, listWorkflows as f, getWorkflowExecution as g, executionsCommand as h, deleteWorkspace as i, generate as j, listMachineUsers as k, startCommand as l, getWorkflow as m, listWorkspaces as n, logger as nt, createWorkspace as o, getCommand as p, initOperatorClient as q, deleteCommand as r, resumeCommand as s, listCommand as t, workspaceArgs as tt, startWorkflow as u, show as v, getCommand$1 as w, removeCommand as x, showCommand as y, fetchLatestToken as z };
|
|
105648
|
-
//# sourceMappingURL=list-
|
|
105693
|
+
//# sourceMappingURL=list-LSl71zs8.mjs.map
|