@tailor-platform/sdk 0.24.0 → 1.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/CHANGELOG.md +27 -0
- package/dist/cli/index.mjs +1 -1
- package/dist/cli/lib.d.mts +74 -16
- 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-D_6mOKf-.d.mts → index-2JVUi0to.d.mts} +2 -2
- package/dist/{list-D1V0haDR.mjs → list-C0wNbdbP.mjs} +98 -59
- package/dist/list-C0wNbdbP.mjs.map +1 -0
- package/dist/{types-CbL5qnOl.d.mts → types-UefR8mZn.d.mts} +49 -33
- 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.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#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
|
|
8
|
+
- Generators now declare their dependencies (`tailordb`, `resolver`, `executor`)
|
|
9
|
+
- Execution order is phased: TailorDB → Auth → TailorDB-only generators → Resolver → non-executor generators → Executor → executor-dependent generators
|
|
10
|
+
- This allows generated files to be imported by Resolvers and Executors
|
|
11
|
+
- Added utility types for aggregate input: `TailorDBInput`, `ResolverInput`, `ExecutorInput`, `FullInput`, `AggregateArgs`
|
|
12
|
+
- Fixed console output formatting with proper blank line placement
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#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
|
|
17
|
+
|
|
18
|
+
- [#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
|
|
19
|
+
|
|
20
|
+
- [#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
|
|
21
|
+
|
|
22
|
+
- [#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
|
|
23
|
+
|
|
24
|
+
## 1.0.0
|
|
25
|
+
|
|
26
|
+
### Major Changes
|
|
27
|
+
|
|
28
|
+
- [#310](https://github.com/tailor-platform/sdk/pull/310) [`07f8f43`](https://github.com/tailor-platform/sdk/commit/07f8f43427a61f4aa8cdf45ebfa5380751ca34d5) Thanks [@toiroakr](https://github.com/toiroakr)! - v1 release 🎉
|
|
29
|
+
|
|
3
30
|
## 0.24.0
|
|
4
31
|
|
|
5
32
|
### Minor 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-C0wNbdbP.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,5 +1,5 @@
|
|
|
1
1
|
/// <reference path="./../user-defined.d.ts" />
|
|
2
|
-
import {
|
|
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";
|
|
3
3
|
import "citty";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { OAuth2Client } from "@badgateway/oauth2-client";
|
|
@@ -52,12 +52,10 @@ interface GeneratorAuthInput {
|
|
|
52
52
|
oauth2Clients?: Record<string, OAuth2ClientInput>;
|
|
53
53
|
idProvider?: IdProviderConfig;
|
|
54
54
|
}
|
|
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"> {
|
|
55
|
+
type DependencyKind = "tailordb" | "resolver" | "executor";
|
|
56
|
+
type ArrayIncludes<T extends readonly unknown[], U> = T extends readonly [infer First, ...infer Rest] ? First extends U ? true : ArrayIncludes<Rest, U> : false;
|
|
57
|
+
type HasDependency<Deps extends readonly DependencyKind[], D extends DependencyKind> = ArrayIncludes<Deps, D>;
|
|
58
|
+
interface TailorDBProcessMethods<T, Ts> {
|
|
61
59
|
processType(args: {
|
|
62
60
|
type: ParsedTailorDBType;
|
|
63
61
|
namespace: string;
|
|
@@ -66,26 +64,86 @@ interface CodeGenerator<T = any, R = any, E = any, Ts = any, Rs = any> extends O
|
|
|
66
64
|
exportName: string;
|
|
67
65
|
};
|
|
68
66
|
}): T | Promise<T>;
|
|
69
|
-
processResolver(args: {
|
|
70
|
-
resolver: Resolver;
|
|
71
|
-
namespace: string;
|
|
72
|
-
}): R | Promise<R>;
|
|
73
|
-
processExecutor(executor: Executor): E | Promise<E>;
|
|
74
67
|
processTailorDBNamespace?(args: {
|
|
75
68
|
namespace: string;
|
|
76
69
|
types: Record<string, T>;
|
|
77
70
|
}): Ts | Promise<Ts>;
|
|
71
|
+
}
|
|
72
|
+
interface ResolverProcessMethods<R, Rs> {
|
|
73
|
+
processResolver(args: {
|
|
74
|
+
resolver: Resolver;
|
|
75
|
+
namespace: string;
|
|
76
|
+
}): R | Promise<R>;
|
|
78
77
|
processResolverNamespace?(args: {
|
|
79
78
|
namespace: string;
|
|
80
79
|
resolvers: Record<string, R>;
|
|
81
80
|
}): Rs | Promise<Rs>;
|
|
81
|
+
}
|
|
82
|
+
interface ExecutorProcessMethods<E> {
|
|
83
|
+
processExecutor(executor: Executor): E | Promise<E>;
|
|
84
|
+
}
|
|
85
|
+
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);
|
|
86
|
+
interface TailorDBInputPart<Ts> {
|
|
87
|
+
tailordb: TailorDBNamespaceResult<Ts>[];
|
|
88
|
+
}
|
|
89
|
+
interface ResolverInputPart<Rs> {
|
|
90
|
+
resolver: ResolverNamespaceResult<Rs>[];
|
|
91
|
+
}
|
|
92
|
+
interface ExecutorInputPart<E> {
|
|
93
|
+
executor: E[];
|
|
94
|
+
}
|
|
95
|
+
interface AuthPart {
|
|
96
|
+
auth?: GeneratorAuthInput;
|
|
97
|
+
}
|
|
98
|
+
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;
|
|
99
|
+
/** Input type for aggregate method - use with dependencies */
|
|
100
|
+
|
|
101
|
+
/** Input type for TailorDB-only generators */
|
|
102
|
+
type TailorDBInput<Ts> = TailorDBInputPart<Ts> & AuthPart;
|
|
103
|
+
/** Input type for Resolver-only generators */
|
|
104
|
+
type ResolverInput<Rs> = ResolverInputPart<Rs> & AuthPart;
|
|
105
|
+
/** Input type for Executor-only generators */
|
|
106
|
+
type ExecutorInput<E> = ExecutorInputPart<E> & AuthPart;
|
|
107
|
+
/** Input type for full generators (TailorDB + Resolver + Executor) */
|
|
108
|
+
type FullInput<Ts, Rs, E> = TailorDBInputPart<Ts> & ResolverInputPart<Rs> & ExecutorInputPart<E> & AuthPart;
|
|
109
|
+
/** Arguments type for aggregate method */
|
|
110
|
+
interface AggregateArgs<Input> {
|
|
111
|
+
input: Input;
|
|
112
|
+
baseDir: string;
|
|
113
|
+
configPath: string;
|
|
114
|
+
}
|
|
115
|
+
interface CodeGeneratorCore {
|
|
116
|
+
readonly id: string;
|
|
117
|
+
readonly description: string;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Generator interface with dependencies-based conditional methods.
|
|
121
|
+
*
|
|
122
|
+
* @template Deps - Dependencies array (e.g., ['tailordb'], ['tailordb', 'resolver'])
|
|
123
|
+
* @template T - Return type of processType
|
|
124
|
+
* @template R - Return type of processResolver
|
|
125
|
+
* @template E - Return type of processExecutor
|
|
126
|
+
* @template Ts - Return type of processTailorDBNamespace (default: Record<string, T>)
|
|
127
|
+
* @template Rs - Return type of processResolverNamespace (default: Record<string, R>)
|
|
128
|
+
*/
|
|
129
|
+
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> & {
|
|
130
|
+
readonly dependencies: Deps;
|
|
82
131
|
aggregate(args: {
|
|
83
|
-
input:
|
|
84
|
-
executorInputs: E[];
|
|
132
|
+
input: SelectInput<Deps, Ts, Rs, E>;
|
|
85
133
|
baseDir: string;
|
|
86
134
|
configPath: string;
|
|
87
135
|
}): GeneratorResult | Promise<GeneratorResult>;
|
|
88
|
-
}
|
|
136
|
+
};
|
|
137
|
+
/** TailorDB-only generator */
|
|
138
|
+
type TailorDBGenerator<T = unknown, Ts = Record<string, T>> = CodeGenerator<readonly ["tailordb"], T, never, never, Ts, never>;
|
|
139
|
+
/** Resolver-only generator */
|
|
140
|
+
type ResolverGenerator<R = unknown, Rs = Record<string, R>> = CodeGenerator<readonly ["resolver"], never, R, never, never, Rs>;
|
|
141
|
+
/** Executor-only generator */
|
|
142
|
+
type ExecutorGenerator<E = unknown> = CodeGenerator<readonly ["executor"], never, never, E, never, never>;
|
|
143
|
+
/** TailorDB + Resolver generator */
|
|
144
|
+
type TailorDBResolverGenerator<T = unknown, R = unknown, Ts = Record<string, T>, Rs = Record<string, R>> = CodeGenerator<readonly ["tailordb", "resolver"], T, R, never, Ts, Rs>;
|
|
145
|
+
/** Full generator (all dependencies) */
|
|
146
|
+
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
147
|
//#endregion
|
|
90
148
|
//#region src/cli/generator/options.d.ts
|
|
91
149
|
type GenerateOptions = {
|
|
@@ -368,5 +426,5 @@ interface ApiCallResult {
|
|
|
368
426
|
*/
|
|
369
427
|
declare function apiCall(options: ApiCallOptions): Promise<ApiCallResult>;
|
|
370
428
|
//#endregion
|
|
371
|
-
export { type ApiCallOptions, type ApiCallResult, type ApplicationInfo, type ApplyOptions, type CodeGenerator, type CreateWorkspaceOptions, type DeleteWorkspaceOptions, type Executor, type
|
|
429
|
+
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
430
|
//# 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-C0wNbdbP.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
|
/**
|
|
@@ -99760,6 +99763,11 @@ async function bundleSingleJob(job, allJobs, outputDir, tsconfig, env, triggerCo
|
|
|
99760
99763
|
|
|
99761
99764
|
//#endregion
|
|
99762
99765
|
//#region src/parser/generator-config/index.ts
|
|
99766
|
+
const DependencyKindSchema = z.enum([
|
|
99767
|
+
"tailordb",
|
|
99768
|
+
"resolver",
|
|
99769
|
+
"executor"
|
|
99770
|
+
]);
|
|
99763
99771
|
const KyselyTypeConfigSchema = z.tuple([z.literal("@tailor-platform/kysely-type"), z.object({ distPath: z.string() })]);
|
|
99764
99772
|
const SeedConfigSchema = z.tuple([z.literal("@tailor-platform/seed"), z.object({
|
|
99765
99773
|
distPath: z.string(),
|
|
@@ -99770,9 +99778,10 @@ const FileUtilsConfigSchema = z.tuple([z.literal("@tailor-platform/file-utils"),
|
|
|
99770
99778
|
const CodeGeneratorSchema = z.object({
|
|
99771
99779
|
id: z.string(),
|
|
99772
99780
|
description: z.string(),
|
|
99773
|
-
|
|
99774
|
-
|
|
99775
|
-
|
|
99781
|
+
dependencies: z.array(DependencyKindSchema),
|
|
99782
|
+
processType: z.function().optional(),
|
|
99783
|
+
processResolver: z.function().optional(),
|
|
99784
|
+
processExecutor: z.function().optional(),
|
|
99776
99785
|
processTailorDBNamespace: z.function().optional(),
|
|
99777
99786
|
processResolverNamespace: z.function().optional(),
|
|
99778
99787
|
aggregate: z.function({ output: z.any() })
|
|
@@ -99806,6 +99815,13 @@ function createGeneratorConfigSchema(builtinGenerators$1) {
|
|
|
99806
99815
|
}).brand("CodeGenerator");
|
|
99807
99816
|
}
|
|
99808
99817
|
|
|
99818
|
+
//#endregion
|
|
99819
|
+
//#region src/cli/generator/types.ts
|
|
99820
|
+
/** Type guard to check if a generator has a specific dependency */
|
|
99821
|
+
function hasDependency(generator, dependency) {
|
|
99822
|
+
return generator.dependencies.includes(dependency);
|
|
99823
|
+
}
|
|
99824
|
+
|
|
99809
99825
|
//#endregion
|
|
99810
99826
|
//#region src/cli/generator/builtin/enum-constants/enum-processor.ts
|
|
99811
99827
|
/**
|
|
@@ -99890,14 +99906,13 @@ const EnumConstantsGeneratorID = "@tailor-platform/enum-constants";
|
|
|
99890
99906
|
var EnumConstantsGenerator = class {
|
|
99891
99907
|
id = EnumConstantsGeneratorID;
|
|
99892
99908
|
description = "Generates enum constants from TailorDB type definitions";
|
|
99909
|
+
dependencies = ["tailordb"];
|
|
99893
99910
|
constructor(options) {
|
|
99894
99911
|
this.options = options;
|
|
99895
99912
|
}
|
|
99896
99913
|
async processType(args) {
|
|
99897
99914
|
return await EnumProcessor.processType(args.type);
|
|
99898
99915
|
}
|
|
99899
|
-
processResolver() {}
|
|
99900
|
-
processExecutor() {}
|
|
99901
99916
|
async processTailorDBNamespace(args) {
|
|
99902
99917
|
const allEnums = [];
|
|
99903
99918
|
for (const enumConstantMetadata of Object.values(args.types)) allEnums.push(...enumConstantMetadata.enums);
|
|
@@ -99906,9 +99921,6 @@ var EnumConstantsGenerator = class {
|
|
|
99906
99921
|
enums: allEnums
|
|
99907
99922
|
};
|
|
99908
99923
|
}
|
|
99909
|
-
processIdProvider() {}
|
|
99910
|
-
processAuth() {}
|
|
99911
|
-
processStaticWebsite() {}
|
|
99912
99924
|
aggregate(args) {
|
|
99913
99925
|
const files = [];
|
|
99914
99926
|
const allEnums = [];
|
|
@@ -100020,14 +100032,13 @@ const FileUtilsGeneratorID = "@tailor-platform/file-utils";
|
|
|
100020
100032
|
var FileUtilsGenerator = class {
|
|
100021
100033
|
id = FileUtilsGeneratorID;
|
|
100022
100034
|
description = "Generates TypeWithFiles interface from TailorDB type definitions";
|
|
100035
|
+
dependencies = ["tailordb"];
|
|
100023
100036
|
constructor(options) {
|
|
100024
100037
|
this.options = options;
|
|
100025
100038
|
}
|
|
100026
100039
|
async processType(args) {
|
|
100027
100040
|
return await FileProcessor.processType(args.type);
|
|
100028
100041
|
}
|
|
100029
|
-
processResolver() {}
|
|
100030
|
-
processExecutor() {}
|
|
100031
100042
|
async processTailorDBNamespace(args) {
|
|
100032
100043
|
const typesWithFiles = Object.values(args.types).filter((t$1) => t$1.fileFields.length > 0);
|
|
100033
100044
|
if (typesWithFiles.length === 0) return "";
|
|
@@ -100036,9 +100047,6 @@ var FileUtilsGenerator = class {
|
|
|
100036
100047
|
types: typesWithFiles
|
|
100037
100048
|
});
|
|
100038
100049
|
}
|
|
100039
|
-
processIdProvider() {}
|
|
100040
|
-
processAuth() {}
|
|
100041
|
-
processStaticWebsite() {}
|
|
100042
100050
|
aggregate(args) {
|
|
100043
100051
|
const files = [];
|
|
100044
100052
|
const allNamespaceData = [];
|
|
@@ -100222,7 +100230,7 @@ var TypeProcessor = class {
|
|
|
100222
100230
|
if (globalUsedUtilityTypes.Serial) utilityTypeDeclarations.push(`type Serial<T = string | number> = ColumnType<T, never, never>;`);
|
|
100223
100231
|
return [
|
|
100224
100232
|
ml`
|
|
100225
|
-
import { type ColumnType, Kysely, KyselyConfig } from "kysely";
|
|
100233
|
+
import { type ColumnType, Kysely, type KyselyConfig } from "kysely";
|
|
100226
100234
|
import { TailordbDialect } from "@tailor-platform/function-kysely-tailordb";
|
|
100227
100235
|
|
|
100228
100236
|
${utilityTypeDeclarations.join("\n")}
|
|
@@ -100259,14 +100267,13 @@ const KyselyGeneratorID = "@tailor-platform/kysely-type";
|
|
|
100259
100267
|
var KyselyGenerator = class {
|
|
100260
100268
|
id = KyselyGeneratorID;
|
|
100261
100269
|
description = "Generates Kysely type definitions for TailorDB types";
|
|
100270
|
+
dependencies = ["tailordb"];
|
|
100262
100271
|
constructor(options) {
|
|
100263
100272
|
this.options = options;
|
|
100264
100273
|
}
|
|
100265
100274
|
async processType(args) {
|
|
100266
100275
|
return await TypeProcessor.processType(args.type);
|
|
100267
100276
|
}
|
|
100268
|
-
processResolver() {}
|
|
100269
|
-
processExecutor() {}
|
|
100270
100277
|
async processTailorDBNamespace(args) {
|
|
100271
100278
|
const typesList = Object.values(args.types);
|
|
100272
100279
|
const usedUtilityTypes = typesList.reduce((acc, type) => ({
|
|
@@ -100487,10 +100494,6 @@ function generateLinesDbSchemaFile(metadata, importPath) {
|
|
|
100487
100494
|
//#region src/cli/generator/builtin/seed/index.ts
|
|
100488
100495
|
const SeedGeneratorID = "@tailor-platform/seed";
|
|
100489
100496
|
/**
|
|
100490
|
-
* Factory function to create a Seed generator.
|
|
100491
|
-
* Combines GraphQL Ingest and lines-db schema generation.
|
|
100492
|
-
*/
|
|
100493
|
-
/**
|
|
100494
100497
|
* Generates the exec.mjs script content (Node.js executable)
|
|
100495
100498
|
*/
|
|
100496
100499
|
function generateExecScript(machineUserName, relativeConfigPath) {
|
|
@@ -100526,10 +100529,15 @@ function generateExecScript(machineUserName, relativeConfigPath) {
|
|
|
100526
100529
|
|
|
100527
100530
|
`;
|
|
100528
100531
|
}
|
|
100532
|
+
/**
|
|
100533
|
+
* Factory function to create a Seed generator.
|
|
100534
|
+
* Combines GraphQL Ingest and lines-db schema generation.
|
|
100535
|
+
*/
|
|
100529
100536
|
function createSeedGenerator(options) {
|
|
100530
100537
|
return {
|
|
100531
100538
|
id: SeedGeneratorID,
|
|
100532
100539
|
description: "Generates seed data files (GraphQL Ingest + lines-db schema)",
|
|
100540
|
+
dependencies: ["tailordb"],
|
|
100533
100541
|
processType: ({ type, source }) => {
|
|
100534
100542
|
return {
|
|
100535
100543
|
gqlIngest: processGqlIngest(type),
|
|
@@ -100537,8 +100545,6 @@ function createSeedGenerator(options) {
|
|
|
100537
100545
|
};
|
|
100538
100546
|
},
|
|
100539
100547
|
processTailorDBNamespace: ({ types: types$2 }) => types$2,
|
|
100540
|
-
processExecutor: (_executor) => void 0,
|
|
100541
|
-
processResolver: (_args) => void 0,
|
|
100542
100548
|
aggregate: ({ input, configPath }) => {
|
|
100543
100549
|
const entityDependencies = {};
|
|
100544
100550
|
const files = [];
|
|
@@ -103420,12 +103426,11 @@ async function loadWorkflowScripts() {
|
|
|
103420
103426
|
|
|
103421
103427
|
//#endregion
|
|
103422
103428
|
//#region src/cli/apply/index.ts
|
|
103423
|
-
const enableInlineSourcemap = process.env.TAILOR_ENABLE_INLINE_SOURCEMAP === "true";
|
|
103424
103429
|
async function apply(options) {
|
|
103425
103430
|
const { config, configPath } = await loadConfig(options?.configPath);
|
|
103426
103431
|
const dryRun = options?.dryRun ?? false;
|
|
103427
103432
|
const yes = options?.yes ?? false;
|
|
103428
|
-
const buildOnly = options?.buildOnly ??
|
|
103433
|
+
const buildOnly = options?.buildOnly ?? process.env.TAILOR_PLATFORM_SDK_BUILD_ONLY === "true";
|
|
103429
103434
|
await generateUserTypes(config, configPath);
|
|
103430
103435
|
const application = defineApplication(config);
|
|
103431
103436
|
let workflowResult;
|
|
@@ -104039,6 +104044,19 @@ var GenerationManager = class {
|
|
|
104039
104044
|
this.baseDir = path$20.join(getDistDir(), "generated");
|
|
104040
104045
|
fs$15.mkdirSync(this.baseDir, { recursive: true });
|
|
104041
104046
|
}
|
|
104047
|
+
getDeps(gen) {
|
|
104048
|
+
return new Set(gen.dependencies);
|
|
104049
|
+
}
|
|
104050
|
+
onlyHas(gen, ...required) {
|
|
104051
|
+
const deps = this.getDeps(gen);
|
|
104052
|
+
return required.every((r$1) => deps.has(r$1)) && deps.size === required.length;
|
|
104053
|
+
}
|
|
104054
|
+
hasAll(gen, ...required) {
|
|
104055
|
+
return required.every((r$1) => this.getDeps(gen).has(r$1));
|
|
104056
|
+
}
|
|
104057
|
+
hasNone(gen, ...excluded) {
|
|
104058
|
+
return excluded.every((e) => !this.getDeps(gen).has(e));
|
|
104059
|
+
}
|
|
104042
104060
|
async generate(watch) {
|
|
104043
104061
|
logger.newline();
|
|
104044
104062
|
logger.log(`Generation for application: ${styles.highlight(this.application.config.name)}`);
|
|
@@ -104058,6 +104076,13 @@ var GenerationManager = class {
|
|
|
104058
104076
|
if (!watch) throw error;
|
|
104059
104077
|
}
|
|
104060
104078
|
}
|
|
104079
|
+
if (app.authService) await app.authService.resolveNamespaces();
|
|
104080
|
+
if (app.tailorDBServices.length > 0) logger.newline();
|
|
104081
|
+
const tailordbOnlyGens = this.generators.filter((g$1) => this.onlyHas(g$1, "tailordb"));
|
|
104082
|
+
if (tailordbOnlyGens.length > 0) {
|
|
104083
|
+
await this.runGenerators(tailordbOnlyGens, watch);
|
|
104084
|
+
logger.newline();
|
|
104085
|
+
}
|
|
104061
104086
|
for (const resolverService of app.resolverServices) {
|
|
104062
104087
|
const namespace = resolverService.namespace;
|
|
104063
104088
|
try {
|
|
@@ -104072,41 +104097,54 @@ var GenerationManager = class {
|
|
|
104072
104097
|
if (!watch) throw error;
|
|
104073
104098
|
}
|
|
104074
104099
|
}
|
|
104075
|
-
|
|
104100
|
+
const nonExecutorGens = this.generators.filter((g$1) => !tailordbOnlyGens.includes(g$1) && this.hasNone(g$1, "executor"));
|
|
104101
|
+
if (nonExecutorGens.length > 0) {
|
|
104102
|
+
await this.runGenerators(nonExecutorGens, watch);
|
|
104103
|
+
logger.newline();
|
|
104104
|
+
}
|
|
104076
104105
|
const executors = await this.application.executorService?.loadExecutors();
|
|
104077
104106
|
Object.entries(executors ?? {}).forEach(([filePath, executor]) => {
|
|
104078
104107
|
this.services.executor[filePath] = executor;
|
|
104079
104108
|
});
|
|
104080
|
-
|
|
104109
|
+
const executorGens = this.generators.filter((g$1) => this.hasAll(g$1, "executor"));
|
|
104110
|
+
if (executorGens.length > 0) {
|
|
104111
|
+
await this.runGenerators(executorGens, watch);
|
|
104112
|
+
logger.newline();
|
|
104113
|
+
}
|
|
104081
104114
|
}
|
|
104082
|
-
|
|
104083
|
-
|
|
104084
|
-
|
|
104115
|
+
async runGenerators(generators, watch) {
|
|
104116
|
+
await Promise.allSettled(generators.map(async (gen) => {
|
|
104117
|
+
try {
|
|
104118
|
+
await this.processGenerator(gen);
|
|
104119
|
+
} catch (error) {
|
|
104120
|
+
logger.error(`${styles.error("Error processing generator")} ${styles.errorBright(gen.id)}`);
|
|
104121
|
+
logger.error(String(error));
|
|
104122
|
+
if (!watch) throw error;
|
|
104123
|
+
}
|
|
104124
|
+
}));
|
|
104085
104125
|
}
|
|
104126
|
+
generatorResults = {};
|
|
104086
104127
|
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
|
-
}
|
|
104128
|
+
this.generatorResults[gen.id] = {
|
|
104129
|
+
tailordbResults: {},
|
|
104130
|
+
resolverResults: {},
|
|
104131
|
+
tailordbNamespaceResults: {},
|
|
104132
|
+
resolverNamespaceResults: {},
|
|
104133
|
+
executorResults: {}
|
|
104134
|
+
};
|
|
104135
|
+
if (hasDependency(gen, "tailordb")) for (const [namespace, types$2] of Object.entries(this.services.tailordb)) await this.processTailorDBNamespace(gen, namespace, types$2);
|
|
104136
|
+
if (hasDependency(gen, "resolver")) for (const [namespace, resolvers] of Object.entries(this.services.resolver)) await this.processResolverNamespace(gen, namespace, resolvers);
|
|
104137
|
+
if (hasDependency(gen, "executor")) await this.processExecutors(gen);
|
|
104138
|
+
await this.aggregate(gen);
|
|
104103
104139
|
}
|
|
104104
104140
|
async processTailorDBNamespace(gen, namespace, typeInfo) {
|
|
104105
104141
|
const results = this.generatorResults[gen.id];
|
|
104106
104142
|
results.tailordbResults[namespace] = {};
|
|
104143
|
+
if (!gen.processType) return;
|
|
104144
|
+
const processType = gen.processType;
|
|
104107
104145
|
await Promise.allSettled(Object.entries(typeInfo.types).map(async ([typeName, type]) => {
|
|
104108
104146
|
try {
|
|
104109
|
-
results.tailordbResults[namespace][typeName] = await
|
|
104147
|
+
results.tailordbResults[namespace][typeName] = await processType({
|
|
104110
104148
|
type,
|
|
104111
104149
|
namespace,
|
|
104112
104150
|
source: typeInfo.sourceInfo[typeName]
|
|
@@ -104116,7 +104154,7 @@ var GenerationManager = class {
|
|
|
104116
104154
|
logger.error(String(error));
|
|
104117
104155
|
}
|
|
104118
104156
|
}));
|
|
104119
|
-
if (gen.processTailorDBNamespace) try {
|
|
104157
|
+
if ("processTailorDBNamespace" in gen && typeof gen.processTailorDBNamespace === "function") try {
|
|
104120
104158
|
results.tailordbNamespaceResults[namespace] = await gen.processTailorDBNamespace({
|
|
104121
104159
|
namespace,
|
|
104122
104160
|
types: results.tailordbResults[namespace]
|
|
@@ -104130,9 +104168,11 @@ var GenerationManager = class {
|
|
|
104130
104168
|
async processResolverNamespace(gen, namespace, resolvers) {
|
|
104131
104169
|
const results = this.generatorResults[gen.id];
|
|
104132
104170
|
results.resolverResults[namespace] = {};
|
|
104171
|
+
if (!gen.processResolver) return;
|
|
104172
|
+
const processResolver$1 = gen.processResolver;
|
|
104133
104173
|
await Promise.allSettled(Object.entries(resolvers).map(async ([resolverName, resolver]) => {
|
|
104134
104174
|
try {
|
|
104135
|
-
results.resolverResults[namespace][resolverName] = await
|
|
104175
|
+
results.resolverResults[namespace][resolverName] = await processResolver$1({
|
|
104136
104176
|
resolver,
|
|
104137
104177
|
namespace
|
|
104138
104178
|
});
|
|
@@ -104141,7 +104181,7 @@ var GenerationManager = class {
|
|
|
104141
104181
|
logger.error(String(error));
|
|
104142
104182
|
}
|
|
104143
104183
|
}));
|
|
104144
|
-
if (gen.processResolverNamespace) try {
|
|
104184
|
+
if ("processResolverNamespace" in gen && typeof gen.processResolverNamespace === "function") try {
|
|
104145
104185
|
results.resolverNamespaceResults[namespace] = await gen.processResolverNamespace({
|
|
104146
104186
|
namespace,
|
|
104147
104187
|
resolvers: results.resolverResults[namespace]
|
|
@@ -104154,9 +104194,11 @@ var GenerationManager = class {
|
|
|
104154
104194
|
}
|
|
104155
104195
|
async processExecutors(gen) {
|
|
104156
104196
|
const results = this.generatorResults[gen.id];
|
|
104197
|
+
if (!gen.processExecutor) return;
|
|
104198
|
+
const processExecutor = gen.processExecutor;
|
|
104157
104199
|
await Promise.allSettled(Object.entries(this.services.executor).map(async ([executorId, executor]) => {
|
|
104158
104200
|
try {
|
|
104159
|
-
results.executorResults[executorId] = await
|
|
104201
|
+
results.executorResults[executorId] = await processExecutor(executor);
|
|
104160
104202
|
} catch (error) {
|
|
104161
104203
|
logger.error(`${styles.error(`Error processing executor`)} ${styles.errorBright(executor.name)} ${styles.error(`with generator ${gen.id}`)}`);
|
|
104162
104204
|
logger.error(String(error));
|
|
@@ -104191,14 +104233,12 @@ var GenerationManager = class {
|
|
|
104191
104233
|
namespace,
|
|
104192
104234
|
resolvers
|
|
104193
104235
|
});
|
|
104194
|
-
const input = {
|
|
104195
|
-
|
|
104196
|
-
|
|
104197
|
-
|
|
104198
|
-
};
|
|
104236
|
+
const input = { auth: this.getAuthInput() };
|
|
104237
|
+
if (hasDependency(gen, "tailordb")) input.tailordb = tailordbResults;
|
|
104238
|
+
if (hasDependency(gen, "resolver")) input.resolver = resolverResults;
|
|
104239
|
+
if (hasDependency(gen, "executor")) input.executor = Object.values(results.executorResults);
|
|
104199
104240
|
const result = await gen.aggregate({
|
|
104200
104241
|
input,
|
|
104201
|
-
executorInputs: Object.values(results.executorResults),
|
|
104202
104242
|
baseDir: path$20.join(this.baseDir, gen.id),
|
|
104203
104243
|
configPath: this.configPath ?? "tailor.config.ts"
|
|
104204
104244
|
});
|
|
@@ -104232,7 +104272,6 @@ var GenerationManager = class {
|
|
|
104232
104272
|
});
|
|
104233
104273
|
});
|
|
104234
104274
|
}));
|
|
104235
|
-
logger.newline();
|
|
104236
104275
|
}
|
|
104237
104276
|
watcher = null;
|
|
104238
104277
|
async watch() {
|
|
@@ -105645,4 +105684,4 @@ const listCommand = defineCommand({
|
|
|
105645
105684
|
|
|
105646
105685
|
//#endregion
|
|
105647
105686
|
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-
|
|
105687
|
+
//# sourceMappingURL=list-C0wNbdbP.mjs.map
|