@tailor-platform/sdk 2.14.0 → 2.14.2
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 +28 -0
- package/dist/{application-CiN_er9X.mjs → application-BAqZFMWP.mjs} +9 -9
- package/dist/application-BAqZFMWP.mjs.map +1 -0
- package/dist/application-BKlOiD1x.mjs +1 -0
- package/dist/cli/commands/api/api-call.d.mts +4 -5
- package/dist/cli/commands/deploy/config-id-injector.d.mts +3 -4
- package/dist/cli/commands/deploy/deploy.d.mts +3 -4
- package/dist/cli/commands/deploy/function-registry-types.d.mts +2 -3
- package/dist/cli/commands/executor/get.d.mts +3 -4
- package/dist/cli/commands/executor/jobs.d.mts +10 -11
- package/dist/cli/commands/executor/list.d.mts +3 -4
- package/dist/cli/commands/executor/transform.d.mts +6 -7
- package/dist/cli/commands/executor/trigger.d.mts +4 -5
- package/dist/cli/commands/executor/webhook.d.mts +4 -5
- package/dist/cli/commands/function/get.d.mts +3 -4
- package/dist/cli/commands/function/list.d.mts +3 -4
- package/dist/cli/commands/function/transform.d.mts +2 -3
- package/dist/cli/commands/generate/options.d.mts +2 -3
- package/dist/cli/commands/generate/seed/bundler.d.mts +3 -4
- package/dist/cli/commands/generate/service.d.mts +2 -3
- package/dist/cli/commands/machineuser/list.d.mts +4 -5
- package/dist/cli/commands/machineuser/token.d.mts +4 -5
- package/dist/cli/commands/oauth2client/get.d.mts +3 -4
- package/dist/cli/commands/oauth2client/list.d.mts +3 -4
- package/dist/cli/commands/oauth2client/transform.d.mts +3 -4
- package/dist/cli/commands/organization/folder/create.d.mts +3 -4
- package/dist/cli/commands/organization/folder/delete.d.mts +3 -4
- package/dist/cli/commands/organization/folder/get.d.mts +3 -4
- package/dist/cli/commands/organization/folder/list.d.mts +3 -4
- package/dist/cli/commands/organization/folder/update.d.mts +3 -4
- package/dist/cli/commands/organization/get.d.mts +3 -4
- package/dist/cli/commands/organization/list.d.mts +3 -4
- package/dist/cli/commands/organization/transform.d.mts +5 -6
- package/dist/cli/commands/organization/tree.d.mts +3 -4
- package/dist/cli/commands/organization/update.d.mts +3 -4
- package/dist/cli/commands/remove.d.mts +3 -4
- package/dist/cli/commands/show.d.mts +6 -7
- package/dist/cli/commands/staticwebsite/deploy.d.mts +3 -4
- package/dist/cli/commands/tailordb/migrate/bundler.d.mts +3 -4
- package/dist/cli/commands/tailordb/migrate/config.d.mts +3 -4
- package/dist/cli/commands/tailordb/migrate/diff-calculator.d.mts +34 -35
- package/dist/cli/commands/tailordb/migrate/generate.d.mts +3 -4
- package/dist/cli/commands/tailordb/migrate/rename-detection.d.mts +3 -4
- package/dist/cli/commands/tailordb/migrate/snapshot-comparison.d.mts +4 -5
- package/dist/cli/commands/tailordb/migrate/snapshot-files.d.mts +13 -14
- package/dist/cli/commands/tailordb/migrate/snapshot-local.d.mts +2 -3
- package/dist/cli/commands/tailordb/migrate/snapshot-migrations.d.mts +2 -3
- package/dist/cli/commands/tailordb/migrate/snapshot-types.d.mts +21 -22
- package/dist/cli/commands/tailordb/migrate/types.d.mts +2 -3
- package/dist/cli/commands/tailordb/truncate.d.mts +3 -4
- package/dist/cli/commands/workflow/executions.d.mts +8 -9
- package/dist/cli/commands/workflow/get.d.mts +3 -4
- package/dist/cli/commands/workflow/list.d.mts +3 -4
- package/dist/cli/commands/workflow/resume.d.mts +4 -5
- package/dist/cli/commands/workflow/start.d.mts +5 -6
- package/dist/cli/commands/workflow/status.d.mts +3 -4
- package/dist/cli/commands/workflow/transform.d.mts +5 -6
- package/dist/cli/commands/workflow/wait.d.mts +3 -4
- package/dist/cli/commands/workflow/waiter.d.mts +3 -4
- package/dist/cli/commands/workspace/app/health.d.mts +3 -4
- package/dist/cli/commands/workspace/app/list.d.mts +3 -4
- package/dist/cli/commands/workspace/app/transform.d.mts +3 -4
- package/dist/cli/commands/workspace/create.d.mts +3 -4
- package/dist/cli/commands/workspace/delete.d.mts +3 -4
- package/dist/cli/commands/workspace/get.d.mts +3 -4
- package/dist/cli/commands/workspace/list.d.mts +3 -4
- package/dist/cli/commands/workspace/restore.d.mts +3 -4
- package/dist/cli/commands/workspace/transform.d.mts +3 -4
- package/dist/cli/commands/workspace/user/invite.d.mts +3 -4
- package/dist/cli/commands/workspace/user/list.d.mts +3 -4
- package/dist/cli/commands/workspace/user/remove.d.mts +3 -4
- package/dist/cli/commands/workspace/user/transform.d.mts +2 -3
- package/dist/cli/commands/workspace/user/update.d.mts +3 -4
- package/dist/cli/lib.mjs +1 -1
- package/dist/cli/main.d.mts +2 -3
- package/dist/cli/main.mjs +18 -18
- package/dist/cli/main.mjs.map +1 -1
- package/dist/cli/query/index.d.mts +2 -3
- package/dist/cli/shared/args.d.mts +11 -12
- package/dist/cli/shared/beta.d.mts +2 -3
- package/dist/cli/shared/client.d.mts +4 -5
- package/dist/cli/shared/command.d.mts +2 -3
- package/dist/cli/shared/config-loader.d.mts +5 -6
- package/dist/cli/shared/config.d.mts +2 -3
- package/dist/cli/shared/context.d.mts +3 -4
- package/dist/cli/shared/error-json.d.mts +4 -5
- package/dist/cli/shared/logger.d.mts +7 -8
- package/dist/cli/shared/prompt.d.mts +7 -8
- package/dist/cli/shared/readonly-guard.d.mts +2 -3
- package/dist/cli/shared/script-executor.d.mts +7 -8
- package/dist/cli/shared/seed-chunker.d.mts +5 -6
- package/dist/cli/shared/seed-context.d.mts +5 -5
- package/dist/cli/shared/tailordb-namespaces.d.mts +5 -6
- package/dist/cli/shared/type-generator.d.mts +2 -3
- package/dist/cli/shared/workspace-name.d.mts +2 -3
- package/dist/completion/zsh-worker.zsh +1 -1
- package/dist/configure/config/index.d.mts +3 -4
- package/dist/configure/config/types.d.mts +14 -15
- package/dist/configure/index.d.mts +6 -6
- package/dist/configure/services/aigateway/index.d.mts +2 -2
- package/dist/configure/services/aigateway/types.d.mts +4 -5
- package/dist/configure/services/auth/index.d.mts +3 -3
- package/dist/configure/services/auth/types.d.mts +24 -25
- package/dist/configure/services/executor/executor.d.mts +3 -4
- package/dist/configure/services/executor/operation.d.mts +6 -7
- package/dist/configure/services/executor/trigger/event.d.mts +56 -57
- package/dist/configure/services/executor/trigger/index.d.mts +2 -2
- package/dist/configure/services/executor/trigger/schedule.d.mts +4 -5
- package/dist/configure/services/executor/trigger/webhook.d.mts +8 -9
- package/dist/configure/services/http-adapter/http-adapter.d.mts +12 -13
- package/dist/configure/services/idp/index.d.mts +2 -2
- package/dist/configure/services/idp/permission.d.mts +4 -5
- package/dist/configure/services/idp/types.d.mts +5 -6
- package/dist/configure/services/resolver/permission.d.mts +4 -5
- package/dist/configure/services/resolver/resolver.d.mts +3 -4
- package/dist/configure/services/resolver/types.d.mts +2 -3
- package/dist/configure/services/secrets/index.d.mts +3 -3
- package/dist/configure/services/secrets/types.d.mts +3 -4
- package/dist/configure/services/staticwebsite/index.d.mts +2 -2
- package/dist/configure/services/staticwebsite/types.d.mts +3 -4
- package/dist/configure/services/tailordb/permission.d.mts +6 -7
- package/dist/configure/services/tailordb/schema.d.mts +7 -8
- package/dist/configure/services/tailordb/types.d.mts +25 -26
- package/dist/configure/services/workflow/execution-policy.d.mts +3 -3
- package/dist/configure/services/workflow/execution-policy.types.d.mts +8 -9
- package/dist/configure/services/workflow/job.d.mts +4 -5
- package/dist/configure/services/workflow/wait-point.d.mts +5 -6
- package/dist/configure/services/workflow/workflow.d.mts +4 -4
- package/dist/configure/types/aigateway-name.d.mts +3 -4
- package/dist/configure/types/auth-namespace-name.d.mts +3 -4
- package/dist/configure/types/connection-name.d.mts +3 -4
- package/dist/configure/types/field.d.mts +3 -4
- package/dist/configure/types/field.types.d.mts +13 -14
- package/dist/configure/types/idp-name.d.mts +3 -4
- package/dist/configure/types/permission-operand.types.d.mts +7 -8
- package/dist/configure/types/type.d.mts +3 -4
- package/dist/kysely/index.d.mts +18 -18
- package/dist/parser/service/idp/types.d.mts +2 -3
- package/dist/parser/service/tailordb/type-source.d.mts +2 -3
- package/dist/parser/service/tailordb/types.d.mts +13 -14
- package/dist/plugin/builtin/enum-constants/index.d.mts +3 -4
- package/dist/plugin/builtin/file-utils/index.d.mts +3 -4
- package/dist/plugin/builtin/kysely-type/index.d.mts +4 -5
- package/dist/plugin/builtin/seed/index.d.mts +4 -5
- package/dist/plugin/builtin/seed/seed-type-processor.d.mts +2 -3
- package/dist/plugin/get-generated-table.d.mts +2 -3
- package/dist/plugin/index.mjs +1 -1
- package/dist/plugin/index.mjs.map +1 -1
- package/dist/plugin/types.d.mts +29 -29
- package/dist/plugin/with-context.d.mts +9 -10
- package/dist/{register-ts-hook-DS1zYiCV.mjs → register-ts-hook-Cphn4r8s.mjs} +44 -44
- package/dist/register-ts-hook-Cphn4r8s.mjs.map +1 -0
- package/dist/runtime/aigateway.d.mts +4 -5
- package/dist/runtime/authconnection.d.mts +3 -4
- package/dist/runtime/context.d.mts +6 -7
- package/dist/runtime/date.d.mts +2 -3
- package/dist/runtime/field-parse.d.mts +2 -3
- package/dist/runtime/file.d.mts +14 -15
- package/dist/runtime/globals.d.mts +2 -1
- package/dist/runtime/iconv.d.mts +5 -6
- package/dist/runtime/idp.d.mts +14 -15
- package/dist/runtime/index.d.mts +7 -7
- package/dist/runtime/logger.d.mts +10 -11
- package/dist/runtime/secretmanager.d.mts +3 -4
- package/dist/runtime/types.d.mts +7 -8
- package/dist/runtime/workflow.d.mts +7 -8
- package/dist/seed/index.d.mts +3 -3
- package/dist/{service_pb-CxHztLk1.mjs → service_pb-BdzjiHfC.mjs} +2 -2
- package/dist/{service_pb-CxHztLk1.mjs.map → service_pb-BdzjiHfC.mjs.map} +1 -1
- package/dist/service_pb-p68oLtp9.mjs +1 -0
- package/dist/shared/src/color.d.mts +2 -3
- package/dist/tailor-proto/src/tailor/v1/aigateway_pb.d.mts +21 -22
- package/dist/tailor-proto/src/tailor/v1/aigateway_resource_pb.d.mts +2 -3
- package/dist/tailor-proto/src/tailor/v1/application_pb.d.mts +35 -36
- package/dist/tailor-proto/src/tailor/v1/application_resource_pb.d.mts +6 -7
- package/dist/tailor-proto/src/tailor/v1/auth_pb.d.mts +229 -230
- package/dist/tailor-proto/src/tailor/v1/auth_resource_pb.d.mts +40 -41
- package/dist/tailor-proto/src/tailor/v1/events_pb.d.mts +9 -10
- package/dist/tailor-proto/src/tailor/v1/events_resource_pb.d.mts +3 -4
- package/dist/tailor-proto/src/tailor/v1/executor_pb.d.mts +45 -46
- package/dist/tailor-proto/src/tailor/v1/executor_resource_pb.d.mts +24 -25
- package/dist/tailor-proto/src/tailor/v1/function_pb.d.mts +17 -18
- package/dist/tailor-proto/src/tailor/v1/function_registry_pb.d.mts +29 -30
- package/dist/tailor-proto/src/tailor/v1/function_resource_pb.d.mts +8 -9
- package/dist/tailor-proto/src/tailor/v1/http_adapter_resource_pb.d.mts +2 -3
- package/dist/tailor-proto/src/tailor/v1/idp_pb.d.mts +37 -38
- package/dist/tailor-proto/src/tailor/v1/idp_resource_pb.d.mts +18 -15
- package/dist/tailor-proto/src/tailor/v1/metadata_pb.d.mts +19 -20
- package/dist/tailor-proto/src/tailor/v1/metadata_resource_pb.d.mts +2 -3
- package/dist/tailor-proto/src/tailor/v1/meter_pb.d.mts +25 -26
- package/dist/tailor-proto/src/tailor/v1/pipeline_pb.d.mts +59 -60
- package/dist/tailor-proto/src/tailor/v1/pipeline_resource_pb.d.mts +10 -11
- package/dist/tailor-proto/src/tailor/v1/resource_pb.d.mts +7 -8
- package/dist/tailor-proto/src/tailor/v1/secret_manager_pb.d.mts +37 -38
- package/dist/tailor-proto/src/tailor/v1/secret_manager_resource_pb.d.mts +4 -5
- package/dist/tailor-proto/src/tailor/v1/service_pb.d.mts +6 -7
- package/dist/tailor-proto/src/tailor/v1/stateflow_pb.d.mts +21 -22
- package/dist/tailor-proto/src/tailor/v1/stateflow_resource_pb.d.mts +3 -4
- package/dist/tailor-proto/src/tailor/v1/staticwebsite_pb.d.mts +50 -51
- package/dist/tailor-proto/src/tailor/v1/staticwebsite_resource_pb.d.mts +4 -5
- package/dist/tailor-proto/src/tailor/v1/tailordb_pb.d.mts +74 -75
- package/dist/tailor-proto/src/tailor/v1/tailordb_resource_pb.d.mts +35 -36
- package/dist/tailor-proto/src/tailor/v1/telemetryrouter_pb.d.mts +41 -42
- package/dist/tailor-proto/src/tailor/v1/telemetryrouter_resource_pb.d.mts +11 -12
- package/dist/tailor-proto/src/tailor/v1/workflow_pb.d.mts +97 -98
- package/dist/tailor-proto/src/tailor/v1/workflow_resource_pb.d.mts +11 -12
- package/dist/tailor-proto/src/tailor/v1/workspace_pb.d.mts +209 -210
- package/dist/tailor-proto/src/tailor/v1/workspace_resource_pb.d.mts +24 -25
- package/dist/types/aigateway.generated.d.mts +3 -4
- package/dist/types/app-config.generated.d.mts +2 -3
- package/dist/types/auth-connection.generated.d.mts +3 -4
- package/dist/types/auth.generated.d.mts +15 -16
- package/dist/types/executor.generated.d.mts +26 -27
- package/dist/types/helpers.d.mts +15 -13
- package/dist/types/http-adapter.generated.d.mts +2 -3
- package/dist/types/idp.generated.d.mts +7 -8
- package/dist/types/resolver.generated.d.mts +4 -5
- package/dist/types/secrets.generated.d.mts +3 -4
- package/dist/types/staticwebsite.generated.d.mts +3 -4
- package/dist/types/tailordb.generated.d.mts +7 -8
- package/dist/types/workflow.generated.d.mts +3 -4
- package/dist/utils/test/index.d.mts +3 -4
- package/dist/vitest/index.d.mts +2 -2
- package/dist/vitest/mock-kysely.d.mts +4 -5
- package/dist/vitest/mocks/aigateway.d.mts +3 -4
- package/dist/vitest/mocks/authconnection.d.mts +3 -4
- package/dist/vitest/mocks/file.d.mts +3 -4
- package/dist/vitest/mocks/iconv.d.mts +3 -4
- package/dist/vitest/mocks/idp.d.mts +3 -4
- package/dist/vitest/mocks/logger.d.mts +3 -4
- package/dist/vitest/mocks/secretmanager.d.mts +3 -4
- package/dist/vitest/mocks/tailordb-pglite.d.mts +4 -5
- package/dist/vitest/mocks/tailordb.d.mts +6 -7
- package/dist/vitest/mocks/workflow.d.mts +2 -3
- package/dist/vitest/pglite-kysely.d.mts +5 -6
- package/dist/vitest/setup.d.mts +6 -7
- package/dist/vitest/workflow-local.d.mts +5 -6
- package/dist/{workspace_resource_pb-u9bj6p3i.mjs → workspace_resource_pb-C4EY-Gns.mjs} +2 -2
- package/dist/{workspace_resource_pb-u9bj6p3i.mjs.map → workspace_resource_pb-C4EY-Gns.mjs.map} +1 -1
- package/docs/services/idp.md +6 -3
- package/package.json +12 -12
- package/dist/application-CiN_er9X.mjs.map +0 -1
- package/dist/application-_8rjQRx8.mjs +0 -1
- package/dist/register-ts-hook-DS1zYiCV.mjs.map +0 -1
- package/dist/service_pb-CFVlGYdr.mjs +0 -1
|
@@ -3,14 +3,14 @@ import { ConcurrencyPolicy, RetryPolicy } from "../../../types/workflow.generate
|
|
|
3
3
|
import "../../types/machine-user.mjs";
|
|
4
4
|
import { WorkflowJob } from "./job.mjs";
|
|
5
5
|
//#region src/configure/services/workflow/workflow.d.ts
|
|
6
|
-
interface WorkflowConfig<Job extends WorkflowJob<any, any, any> = WorkflowJob<any, any, any>> {
|
|
6
|
+
export interface WorkflowConfig<Job extends WorkflowJob<any, any, any> = WorkflowJob<any, any, any>> {
|
|
7
7
|
name: string;
|
|
8
8
|
mainJob: Job;
|
|
9
9
|
retryPolicy?: RetryPolicy;
|
|
10
10
|
concurrencyPolicy?: ConcurrencyPolicy;
|
|
11
11
|
publishEvents?: boolean;
|
|
12
12
|
}
|
|
13
|
-
interface Workflow<Job extends WorkflowJob<any, any, any> = WorkflowJob<any, any, any>> {
|
|
13
|
+
export interface Workflow<Job extends WorkflowJob<any, any, any> = WorkflowJob<any, any, any>> {
|
|
14
14
|
name: string;
|
|
15
15
|
mainJob: Job;
|
|
16
16
|
retryPolicy?: RetryPolicy;
|
|
@@ -61,6 +61,6 @@ interface WorkflowDefinition<Job extends WorkflowJob<any, any, any>> {
|
|
|
61
61
|
* mainJob: processData,
|
|
62
62
|
* });
|
|
63
63
|
*/
|
|
64
|
-
declare function createWorkflow<Job extends WorkflowJob<any, any, any>>(config: WorkflowDefinition<Job>): Workflow<Job>;
|
|
64
|
+
export declare function createWorkflow<Job extends WorkflowJob<any, any, any>>(config: WorkflowDefinition<Job>): Workflow<Job>;
|
|
65
65
|
//#endregion
|
|
66
|
-
export {
|
|
66
|
+
export type { ConcurrencyPolicy, RetryPolicy };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/configure/types/aigateway-name.d.ts
|
|
2
|
-
interface AIGatewayNameRegistry {}
|
|
2
|
+
export interface AIGatewayNameRegistry {}
|
|
3
3
|
/**
|
|
4
4
|
* AI Gateway name.
|
|
5
5
|
*
|
|
@@ -7,6 +7,5 @@ interface AIGatewayNameRegistry {}
|
|
|
7
7
|
* to the union of AI Gateway names defined via `defineAIGateway()`. Falls back to
|
|
8
8
|
* `string` before the first generate run.
|
|
9
9
|
*/
|
|
10
|
-
type AIGatewayName = keyof AIGatewayNameRegistry extends never ? string : keyof AIGatewayNameRegistry & string;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { AIGatewayName, AIGatewayNameRegistry };
|
|
10
|
+
export type AIGatewayName = keyof AIGatewayNameRegistry extends never ? string : keyof AIGatewayNameRegistry & string;
|
|
11
|
+
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/configure/types/auth-namespace-name.d.ts
|
|
2
|
-
interface AuthNamespaceNameRegistry {}
|
|
2
|
+
export interface AuthNamespaceNameRegistry {}
|
|
3
3
|
/**
|
|
4
4
|
* Auth namespace name.
|
|
5
5
|
*
|
|
@@ -13,6 +13,5 @@ interface AuthNamespaceNameRegistry {}
|
|
|
13
13
|
* workspace, extend the registry: `declare module "@tailor-platform/sdk" { interface
|
|
14
14
|
* AuthNamespaceNameRegistry { "other-app-auth": true } }`.
|
|
15
15
|
*/
|
|
16
|
-
type AuthNamespaceName = keyof AuthNamespaceNameRegistry extends never ? string : keyof AuthNamespaceNameRegistry & string;
|
|
17
|
-
//#endregion
|
|
18
|
-
export { AuthNamespaceName, AuthNamespaceNameRegistry };
|
|
16
|
+
export type AuthNamespaceName = keyof AuthNamespaceNameRegistry extends never ? string : keyof AuthNamespaceNameRegistry & string;
|
|
17
|
+
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/configure/types/connection-name.d.ts
|
|
2
|
-
interface ConnectionNameRegistry {}
|
|
2
|
+
export interface ConnectionNameRegistry {}
|
|
3
3
|
/**
|
|
4
4
|
* Auth connection name.
|
|
5
5
|
*
|
|
@@ -7,6 +7,5 @@ interface ConnectionNameRegistry {}
|
|
|
7
7
|
* to the union of connection names defined in `defineAuth()`'s `connections`. Falls back
|
|
8
8
|
* to `string` before the first generate run.
|
|
9
9
|
*/
|
|
10
|
-
type ConnectionName = keyof ConnectionNameRegistry extends never ? string : keyof ConnectionNameRegistry & string;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { ConnectionName, ConnectionNameRegistry };
|
|
10
|
+
export type ConnectionName = keyof ConnectionNameRegistry extends never ? string : keyof ConnectionNameRegistry & string;
|
|
11
|
+
//#endregion
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { EnumValue } from "./field.types.mjs";
|
|
2
2
|
//#region src/configure/types/field.d.ts
|
|
3
|
-
type AllowedValues = readonly [string | EnumValue, ...(string | EnumValue)[]];
|
|
4
|
-
type AllowedValuesOutput<V extends AllowedValues> = V[number] extends (infer T) ? T extends string ? T : T extends {
|
|
3
|
+
export type AllowedValues = readonly [string | EnumValue, ...(string | EnumValue)[]];
|
|
4
|
+
export type AllowedValuesOutput<V extends AllowedValues> = V[number] extends (infer T) ? T extends string ? T : T extends {
|
|
5
5
|
value: infer K;
|
|
6
6
|
} ? K : never : never;
|
|
7
|
-
//#endregion
|
|
8
|
-
export { AllowedValues, AllowedValuesOutput };
|
|
7
|
+
//#endregion
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
//#region src/configure/types/field.types.d.ts
|
|
2
|
-
interface EnumValue {
|
|
2
|
+
export interface EnumValue {
|
|
3
3
|
value: string;
|
|
4
4
|
description?: string;
|
|
5
5
|
}
|
|
6
|
-
type TailorFieldType = "uuid" | "string" | "boolean" | "integer" | "float" | "decimal" | "enum" | "date" | "datetime" | "time" | "nested";
|
|
7
|
-
type TailorToTs = {
|
|
6
|
+
export type TailorFieldType = "uuid" | "string" | "boolean" | "integer" | "float" | "decimal" | "enum" | "date" | "datetime" | "time" | "nested";
|
|
7
|
+
export type TailorToTs = {
|
|
8
8
|
string: string;
|
|
9
9
|
integer: number;
|
|
10
10
|
float: number;
|
|
@@ -18,7 +18,7 @@ type TailorToTs = {
|
|
|
18
18
|
object: Record<string, unknown>;
|
|
19
19
|
nested: Record<string, unknown>;
|
|
20
20
|
} & Record<TailorFieldType, unknown>;
|
|
21
|
-
interface FieldMetadata {
|
|
21
|
+
export interface FieldMetadata {
|
|
22
22
|
as?: "string" | "date";
|
|
23
23
|
description?: string;
|
|
24
24
|
required?: boolean;
|
|
@@ -27,24 +27,24 @@ interface FieldMetadata {
|
|
|
27
27
|
validate?: FieldValidateInput<any>[];
|
|
28
28
|
typeName?: string;
|
|
29
29
|
}
|
|
30
|
-
interface DefinedFieldMetadata {
|
|
30
|
+
export interface DefinedFieldMetadata {
|
|
31
31
|
type: TailorFieldType;
|
|
32
32
|
array: boolean;
|
|
33
33
|
description?: boolean;
|
|
34
34
|
validate?: boolean;
|
|
35
35
|
typeName?: boolean;
|
|
36
36
|
}
|
|
37
|
-
type FieldOptions = {
|
|
37
|
+
export type FieldOptions = {
|
|
38
38
|
optional?: boolean;
|
|
39
39
|
array?: boolean;
|
|
40
40
|
};
|
|
41
41
|
/** Options for a date field. */
|
|
42
|
-
type DateFieldOptions = FieldOptions & {
|
|
42
|
+
export type DateFieldOptions = FieldOptions & {
|
|
43
43
|
/** Use a Date at midnight UTC instead of a YYYY-MM-DD string. Defaults to string. */
|
|
44
44
|
as?: "string" | "date";
|
|
45
45
|
};
|
|
46
|
-
type DateFieldValue<As> = As extends "date" ? Date : string;
|
|
47
|
-
type FieldOutput<T, O extends FieldOptions> = OptionalFieldOutput<ArrayFieldOutput<T, O>, O>;
|
|
46
|
+
export type DateFieldValue<As> = As extends "date" ? Date : string;
|
|
47
|
+
export type FieldOutput<T, O extends FieldOptions> = OptionalFieldOutput<ArrayFieldOutput<T, O>, O>;
|
|
48
48
|
type OptionalFieldOutput<T, O extends FieldOptions> = O["optional"] extends true ? T | null : T;
|
|
49
49
|
type ArrayFieldOutput<T, O extends FieldOptions> = [O] extends [{
|
|
50
50
|
array: true;
|
|
@@ -58,20 +58,19 @@ type ValidateFn<O> = (args: {
|
|
|
58
58
|
/**
|
|
59
59
|
* Input type for field validation
|
|
60
60
|
*/
|
|
61
|
-
type FieldValidateInput<O> = ValidateFn<O>;
|
|
61
|
+
export type FieldValidateInput<O> = ValidateFn<O>;
|
|
62
62
|
/**
|
|
63
63
|
* Minimal structural interface for TailorField.
|
|
64
64
|
* Defines only the properties needed by parser, plugin, cli, and types layers.
|
|
65
65
|
* The full interface with builder methods (description, typeName, validate, parse)
|
|
66
66
|
* is defined in configure/types/type.ts.
|
|
67
67
|
*/
|
|
68
|
-
interface TailorField<Defined extends DefinedFieldMetadata = DefinedFieldMetadata, Output = any, M extends FieldMetadata = FieldMetadata, T extends TailorFieldType = TailorFieldType> {
|
|
68
|
+
export interface TailorField<Defined extends DefinedFieldMetadata = DefinedFieldMetadata, Output = any, M extends FieldMetadata = FieldMetadata, T extends TailorFieldType = TailorFieldType> {
|
|
69
69
|
readonly type: T;
|
|
70
70
|
readonly fields: Record<string, TailorAnyField>;
|
|
71
71
|
readonly _defined: Defined;
|
|
72
72
|
readonly _output: Output;
|
|
73
73
|
readonly metadata: M;
|
|
74
74
|
}
|
|
75
|
-
type TailorAnyField = TailorField<any>;
|
|
76
|
-
//#endregion
|
|
77
|
-
export { DateFieldOptions, DateFieldValue, DefinedFieldMetadata, EnumValue, FieldMetadata, FieldOptions, FieldOutput, FieldValidateInput, TailorAnyField, TailorField, TailorFieldType, TailorToTs };
|
|
75
|
+
export type TailorAnyField = TailorField<any>;
|
|
76
|
+
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/configure/types/idp-name.d.ts
|
|
2
|
-
interface IdpNameRegistry {}
|
|
2
|
+
export interface IdpNameRegistry {}
|
|
3
3
|
/**
|
|
4
4
|
* IdP namespace name.
|
|
5
5
|
*
|
|
@@ -7,6 +7,5 @@ interface IdpNameRegistry {}
|
|
|
7
7
|
* to the union of defined IdP names. When no IdPs are registered yet, falls back to
|
|
8
8
|
* `string` to avoid blocking editing before the first generate run.
|
|
9
9
|
*/
|
|
10
|
-
type IdpName = keyof IdpNameRegistry extends never ? string : keyof IdpNameRegistry & string;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { IdpName, IdpNameRegistry };
|
|
10
|
+
export type IdpName = keyof IdpNameRegistry extends never ? string : keyof IdpNameRegistry & string;
|
|
11
|
+
//#endregion
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { InferredAttributes } from "../../runtime/types.mjs";
|
|
2
2
|
//#region src/configure/types/permission-operand.types.d.ts
|
|
3
|
-
type StringFieldKeys<User extends object> = { [K in keyof User]-?: NonNullable<User[K]> extends string ? K : never; }[keyof User];
|
|
3
|
+
export type StringFieldKeys<User extends object> = { [K in keyof User]-?: NonNullable<User[K]> extends string ? K : never; }[keyof User];
|
|
4
4
|
type StringArrayFieldKeys<User extends object> = { [K in keyof User]-?: NonNullable<User[K]> extends string[] ? K : never; }[keyof User];
|
|
5
|
-
type BooleanFieldKeys<User extends object> = { [K in keyof User]-?: NonNullable<User[K]> extends boolean ? K : never; }[keyof User];
|
|
5
|
+
export type BooleanFieldKeys<User extends object> = { [K in keyof User]-?: NonNullable<User[K]> extends boolean ? K : never; }[keyof User];
|
|
6
6
|
type BooleanArrayFieldKeys<User extends object> = { [K in keyof User]-?: NonNullable<User[K]> extends boolean[] ? K : never; }[keyof User];
|
|
7
|
-
type UserStringOperand<User extends object = InferredAttributes> = {
|
|
7
|
+
export type UserStringOperand<User extends object = InferredAttributes> = {
|
|
8
8
|
user: StringFieldKeys<User> | "id";
|
|
9
9
|
};
|
|
10
|
-
type UserStringArrayOperand<User extends object = InferredAttributes> = {
|
|
10
|
+
export type UserStringArrayOperand<User extends object = InferredAttributes> = {
|
|
11
11
|
user: StringArrayFieldKeys<User>;
|
|
12
12
|
};
|
|
13
|
-
type UserBooleanOperand<User extends object = InferredAttributes> = {
|
|
13
|
+
export type UserBooleanOperand<User extends object = InferredAttributes> = {
|
|
14
14
|
user: BooleanFieldKeys<User> | "_loggedIn";
|
|
15
15
|
};
|
|
16
|
-
type UserBooleanArrayOperand<User extends object = InferredAttributes> = {
|
|
16
|
+
export type UserBooleanArrayOperand<User extends object = InferredAttributes> = {
|
|
17
17
|
user: BooleanArrayFieldKeys<User>;
|
|
18
18
|
};
|
|
19
|
-
//#endregion
|
|
20
|
-
export { BooleanFieldKeys, StringFieldKeys, UserBooleanArrayOperand, UserBooleanOperand, UserStringArrayOperand, UserStringOperand };
|
|
19
|
+
//#endregion
|
|
@@ -4,7 +4,7 @@ import { FieldParseArgs } from "../../runtime/field-parse.mjs";
|
|
|
4
4
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
5
5
|
//#region src/configure/types/type.d.ts
|
|
6
6
|
type AnyBuilderMethod = any;
|
|
7
|
-
type TailorAnyField = Omit<TailorField$1<AnyBuilderMethod, AnyBuilderMethod, FieldMetadata, TailorFieldType>, "fields"> & {
|
|
7
|
+
export type TailorAnyField = Omit<TailorField$1<AnyBuilderMethod, AnyBuilderMethod, FieldMetadata, TailorFieldType>, "fields"> & {
|
|
8
8
|
readonly fields: Record<string, AnyBuilderMethod>;
|
|
9
9
|
_metadata: FieldMetadata;
|
|
10
10
|
description: AnyBuilderMethod;
|
|
@@ -40,7 +40,7 @@ type FieldValidateMethod<Defined extends DefinedFieldMetadata, Output> = IsAny<D
|
|
|
40
40
|
* Full TailorField interface with builder methods.
|
|
41
41
|
* Extends the minimal structural interface from types/ with fluent API methods.
|
|
42
42
|
*/
|
|
43
|
-
interface TailorField<Defined extends DefinedFieldMetadata = DefinedFieldMetadata, Output = any, M extends FieldMetadata = FieldMetadata, T extends TailorFieldType = TailorFieldType> extends TailorField$1<Defined, Output, M, T> {
|
|
43
|
+
export interface TailorField<Defined extends DefinedFieldMetadata = DefinedFieldMetadata, Output = any, M extends FieldMetadata = FieldMetadata, T extends TailorFieldType = TailorFieldType> extends TailorField$1<Defined, Output, M, T> {
|
|
44
44
|
readonly fields: Record<string, TailorAnyField>;
|
|
45
45
|
_metadata: M;
|
|
46
46
|
/**
|
|
@@ -69,5 +69,4 @@ interface TailorField<Defined extends DefinedFieldMetadata = DefinedFieldMetadat
|
|
|
69
69
|
*/
|
|
70
70
|
parse(args: FieldParseArgs): StandardSchemaV1.Result<Output>;
|
|
71
71
|
}
|
|
72
|
-
//#endregion
|
|
73
|
-
export { TailorAnyField, TailorField };
|
|
72
|
+
//#endregion
|
package/dist/kysely/index.d.mts
CHANGED
|
@@ -3,29 +3,29 @@ import { IsAutoFilledDBField, IsReadOnlyDBField, TailorAnyDBField, TailorAnyDBTy
|
|
|
3
3
|
import { ColumnType, ColumnType as ColumnType$1, Insertable, Insertable as Insertable$1, Kysely, Kysely as Kysely$1, KyselyConfig, KyselyConfig as KyselyConfig$1, Selectable, Selectable as Selectable$1, Transaction, Transaction as Transaction$1, Updateable, Updateable as Updateable$1, sql } from "kysely";
|
|
4
4
|
import { TailordbDialect } from "@tailor-platform/function-kysely-tailordb";
|
|
5
5
|
//#region src/kysely/index.d.ts
|
|
6
|
-
type Timestamp = ColumnType$1<Date, Date | string, Date | string>;
|
|
6
|
+
export type Timestamp = ColumnType$1<Date, Date | string, Date | string>;
|
|
7
7
|
type ResolveSelect<T> = T extends ColumnType$1<infer S, unknown, unknown> ? S : T;
|
|
8
8
|
type ResolveInsert<T> = T extends ColumnType$1<unknown, infer I, unknown> ? I : T;
|
|
9
9
|
type ResolveUpdate<T> = T extends ColumnType$1<unknown, unknown, infer U> ? U : T;
|
|
10
|
-
type ObjectColumnType<T> = ColumnType$1<{ [K in keyof T]-?: Exclude<ResolveSelect<T[K]>, undefined>; }, { [K in keyof T]: ResolveInsert<T[K]>; }, { [K in keyof T]: ResolveUpdate<T[K]>; }>;
|
|
11
|
-
type ArrayColumnType<T> = ColumnType$1<ResolveSelect<T>[], ResolveInsert<T>[], ResolveUpdate<T>[]>;
|
|
12
|
-
type Generated<T> = T extends ColumnType$1<infer S, infer I, infer U> ? ColumnType$1<S, I | undefined, U> : ColumnType$1<T, T | undefined, T>;
|
|
10
|
+
export type ObjectColumnType<T> = ColumnType$1<{ [K in keyof T]-?: Exclude<ResolveSelect<T[K]>, undefined>; }, { [K in keyof T]: ResolveInsert<T[K]>; }, { [K in keyof T]: ResolveUpdate<T[K]>; }>;
|
|
11
|
+
export type ArrayColumnType<T> = ColumnType$1<ResolveSelect<T>[], ResolveInsert<T>[], ResolveUpdate<T>[]>;
|
|
12
|
+
export type Generated<T> = T extends ColumnType$1<infer S, infer I, infer U> ? ColumnType$1<S, I | undefined, U> : ColumnType$1<T, T | undefined, T>;
|
|
13
13
|
type SerialColumnMustBeOmitted = TypeLevelError<"assigned by .serial(); remove it from the input">;
|
|
14
|
-
type Serial<T = string | number> = ColumnType$1<T, SerialColumnMustBeOmitted | undefined, SerialColumnMustBeOmitted | undefined>;
|
|
14
|
+
export type Serial<T = string | number> = ColumnType$1<T, SerialColumnMustBeOmitted | undefined, SerialColumnMustBeOmitted | undefined>;
|
|
15
15
|
type FlattenColumns<T> = { [K in keyof T]: T[K]; } & {};
|
|
16
|
-
type TailordbKysely<DB> = Kysely$1<DB>;
|
|
17
|
-
type NamespaceDB<NS, N extends keyof NS = keyof NS> = TailordbKysely<NS[N]>;
|
|
16
|
+
export type TailordbKysely<DB> = Kysely$1<DB>;
|
|
17
|
+
export type NamespaceDB<NS, N extends keyof NS = keyof NS> = TailordbKysely<NS[N]>;
|
|
18
18
|
/**
|
|
19
19
|
* Create a namespace-aware getDB function for generated code.
|
|
20
20
|
* @returns A getDB function that creates Kysely instances for specific namespaces
|
|
21
21
|
*/
|
|
22
|
-
declare function createGetDB<NS>(): <const N extends keyof NS & string>(namespace: N, config?: Omit<KyselyConfig$1, "dialect">) => TailordbKysely<NS[N]>;
|
|
23
|
-
type NamespaceTransaction<NS, K extends keyof NS | TailordbKysely<NS[keyof NS]> = keyof NS> = K extends TailordbKysely<infer DB> ? Transaction$1<DB> : K extends keyof NS ? Transaction$1<NS[K]> : never;
|
|
24
|
-
type NamespaceTableName<NS> = { [N in keyof NS]: keyof NS[N]; }[keyof NS];
|
|
25
|
-
type NamespaceTable<NS, T extends NamespaceTableName<NS>> = { [N in keyof NS]: T extends keyof NS[N] ? NS[N][T] : never; }[keyof NS];
|
|
26
|
-
type NamespaceInsertable<NS, T extends NamespaceTableName<NS>> = FlattenColumns<Insertable$1<NamespaceTable<NS, T>>>;
|
|
27
|
-
type NamespaceSelectable<NS, T extends NamespaceTableName<NS>> = FlattenColumns<Selectable$1<NamespaceTable<NS, T>>>;
|
|
28
|
-
type NamespaceUpdateable<NS, T extends NamespaceTableName<NS>> = FlattenColumns<Updateable$1<NamespaceTable<NS, T>>>;
|
|
22
|
+
export declare function createGetDB<NS>(): <const N extends keyof NS & string>(namespace: N, config?: Omit<KyselyConfig$1, "dialect">) => TailordbKysely<NS[N]>;
|
|
23
|
+
export type NamespaceTransaction<NS, K extends keyof NS | TailordbKysely<NS[keyof NS]> = keyof NS> = K extends TailordbKysely<infer DB> ? Transaction$1<DB> : K extends keyof NS ? Transaction$1<NS[K]> : never;
|
|
24
|
+
export type NamespaceTableName<NS> = { [N in keyof NS]: keyof NS[N]; }[keyof NS];
|
|
25
|
+
export type NamespaceTable<NS, T extends NamespaceTableName<NS>> = { [N in keyof NS]: T extends keyof NS[N] ? NS[N][T] : never; }[keyof NS];
|
|
26
|
+
export type NamespaceInsertable<NS, T extends NamespaceTableName<NS>> = FlattenColumns<Insertable$1<NamespaceTable<NS, T>>>;
|
|
27
|
+
export type NamespaceSelectable<NS, T extends NamespaceTableName<NS>> = FlattenColumns<Selectable$1<NamespaceTable<NS, T>>>;
|
|
28
|
+
export type NamespaceUpdateable<NS, T extends NamespaceTableName<NS>> = FlattenColumns<Updateable$1<NamespaceTable<NS, T>>>;
|
|
29
29
|
/** What the derived input types accept: a table (`typeof myTable`) or a field collection. */
|
|
30
30
|
type TailorDBColumnsSource = TailorAnyDBType | Record<string, TailorAnyDBField>;
|
|
31
31
|
type DBFieldsOf<T> = T extends TailorAnyDBType ? T["fields"] : T;
|
|
@@ -65,10 +65,10 @@ type TailorDBColumns<T extends TailorDBColumnsSource> = { [K in keyof DBFieldsOf
|
|
|
65
65
|
* return (input: TailorDBInsertable<F>) => { ... };
|
|
66
66
|
* }
|
|
67
67
|
*/
|
|
68
|
-
type TailorDBInsertable<T extends TailorDBColumnsSource> = FlattenColumns<Insertable$1<TailorDBColumns<T>>>;
|
|
68
|
+
export type TailorDBInsertable<T extends TailorDBColumnsSource> = FlattenColumns<Insertable$1<TailorDBColumns<T>>>;
|
|
69
69
|
/** Read shape of a TailorDB table or field collection. See {@link TailorDBInsertable}. */
|
|
70
|
-
type TailorDBSelectable<T extends TailorDBColumnsSource> = FlattenColumns<Selectable$1<TailorDBColumns<T>>>;
|
|
70
|
+
export type TailorDBSelectable<T extends TailorDBColumnsSource> = FlattenColumns<Selectable$1<TailorDBColumns<T>>>;
|
|
71
71
|
/** Update input for a TailorDB table or field collection. See {@link TailorDBInsertable}. */
|
|
72
|
-
type TailorDBUpdateable<T extends TailorDBColumnsSource> = FlattenColumns<Updateable$1<TailorDBColumns<T>>>;
|
|
72
|
+
export type TailorDBUpdateable<T extends TailorDBColumnsSource> = FlattenColumns<Updateable$1<TailorDBColumns<T>>>;
|
|
73
73
|
//#endregion
|
|
74
|
-
export {
|
|
74
|
+
export { type ColumnType, type Insertable, Kysely, type KyselyConfig, type Selectable, TailordbDialect, type Transaction, type Updateable, sql };
|
|
@@ -5,6 +5,5 @@ import { PluginGeneratedTableSource, TypeSourceInfoEntry } from "./types.mjs";
|
|
|
5
5
|
* @param source - The table source entry to check.
|
|
6
6
|
* @returns True if the source was generated by a plugin.
|
|
7
7
|
*/
|
|
8
|
-
declare function isPluginGeneratedTable(source: TypeSourceInfoEntry): source is PluginGeneratedTableSource;
|
|
9
|
-
//#endregion
|
|
10
|
-
export { isPluginGeneratedTable };
|
|
8
|
+
export declare function isPluginGeneratedTable(source: TypeSourceInfoEntry): source is PluginGeneratedTableSource;
|
|
9
|
+
//#endregion
|
|
@@ -8,7 +8,7 @@ interface UserDefinedTypeSource {
|
|
|
8
8
|
exportName: string;
|
|
9
9
|
pluginId?: never;
|
|
10
10
|
}
|
|
11
|
-
interface PluginGeneratedTableSource {
|
|
11
|
+
export interface PluginGeneratedTableSource {
|
|
12
12
|
filePath?: never;
|
|
13
13
|
exportName: string;
|
|
14
14
|
pluginId: string;
|
|
@@ -19,7 +19,7 @@ interface PluginGeneratedTableSource {
|
|
|
19
19
|
pluginConfig?: unknown;
|
|
20
20
|
namespace?: string;
|
|
21
21
|
}
|
|
22
|
-
type TypeSourceInfoEntry = UserDefinedTypeSource | PluginGeneratedTableSource;
|
|
22
|
+
export type TypeSourceInfoEntry = UserDefinedTypeSource | PluginGeneratedTableSource;
|
|
23
23
|
interface Script {
|
|
24
24
|
expr: string;
|
|
25
25
|
}
|
|
@@ -31,7 +31,7 @@ interface OperatorFieldHook {
|
|
|
31
31
|
create?: Script;
|
|
32
32
|
update?: Script;
|
|
33
33
|
}
|
|
34
|
-
interface OperatorFieldConfig {
|
|
34
|
+
export interface OperatorFieldConfig {
|
|
35
35
|
type: string;
|
|
36
36
|
required?: boolean;
|
|
37
37
|
description?: string;
|
|
@@ -68,30 +68,30 @@ type StandardRecordOperand<Update extends boolean = false> = Update extends true
|
|
|
68
68
|
record: string;
|
|
69
69
|
};
|
|
70
70
|
type PermissionOperand<Level extends "record" | "gql" = "record" | "gql", Update extends boolean = boolean> = UserOperand | ValueOperand | (Level extends "record" ? StandardRecordOperand<Update> : never);
|
|
71
|
-
type StandardPermissionCondition<Level extends "record" | "gql" = "record" | "gql", Update extends boolean = boolean> = readonly [PermissionOperand<Level, Update>, StandardPermissionOperator, PermissionOperand<Level, Update>];
|
|
72
|
-
type StandardActionPermission<Level extends "record" | "gql" = "record" | "gql", Update extends boolean = boolean> = {
|
|
71
|
+
export type StandardPermissionCondition<Level extends "record" | "gql" = "record" | "gql", Update extends boolean = boolean> = readonly [PermissionOperand<Level, Update>, StandardPermissionOperator, PermissionOperand<Level, Update>];
|
|
72
|
+
export type StandardActionPermission<Level extends "record" | "gql" = "record" | "gql", Update extends boolean = boolean> = {
|
|
73
73
|
conditions: readonly StandardPermissionCondition<Level, Update>[];
|
|
74
74
|
description?: string;
|
|
75
75
|
permit: "allow" | "deny";
|
|
76
76
|
};
|
|
77
|
-
type StandardTailorTypePermission = {
|
|
77
|
+
export type StandardTailorTypePermission = {
|
|
78
78
|
create: readonly StandardActionPermission<"record", false>[];
|
|
79
79
|
read: readonly StandardActionPermission<"record", false>[];
|
|
80
80
|
update: readonly StandardActionPermission<"record", true>[];
|
|
81
81
|
delete: readonly StandardActionPermission<"record", false>[];
|
|
82
82
|
};
|
|
83
|
-
type StandardGqlPermissionPolicy = {
|
|
83
|
+
export type StandardGqlPermissionPolicy = {
|
|
84
84
|
conditions: readonly StandardPermissionCondition<"gql">[];
|
|
85
85
|
actions: readonly ["all"] | readonly GqlPermissionAction[];
|
|
86
86
|
permit: "allow" | "deny";
|
|
87
87
|
description?: string;
|
|
88
88
|
};
|
|
89
|
-
type StandardTailorTypeGqlPermission = readonly StandardGqlPermissionPolicy[];
|
|
90
|
-
interface Permissions {
|
|
89
|
+
export type StandardTailorTypeGqlPermission = readonly StandardGqlPermissionPolicy[];
|
|
90
|
+
export interface Permissions {
|
|
91
91
|
record?: StandardTailorTypePermission;
|
|
92
92
|
gql?: StandardTailorTypeGqlPermission;
|
|
93
93
|
}
|
|
94
|
-
interface ParsedField {
|
|
94
|
+
export interface ParsedField {
|
|
95
95
|
name: string;
|
|
96
96
|
config: OperatorFieldConfig;
|
|
97
97
|
relation?: {
|
|
@@ -102,7 +102,7 @@ interface ParsedField {
|
|
|
102
102
|
unique: boolean;
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
|
-
interface ParsedRelationship {
|
|
105
|
+
export interface ParsedRelationship {
|
|
106
106
|
name: string;
|
|
107
107
|
targetType: string;
|
|
108
108
|
targetField: string;
|
|
@@ -110,7 +110,7 @@ interface ParsedRelationship {
|
|
|
110
110
|
isArray: boolean;
|
|
111
111
|
description: string;
|
|
112
112
|
}
|
|
113
|
-
interface TailorDBType {
|
|
113
|
+
export interface TailorDBType {
|
|
114
114
|
name: string;
|
|
115
115
|
pluralForm: string;
|
|
116
116
|
description?: string;
|
|
@@ -127,5 +127,4 @@ interface TailorDBType {
|
|
|
127
127
|
};
|
|
128
128
|
typeValidateExpr?: string;
|
|
129
129
|
}
|
|
130
|
-
//#endregion
|
|
131
|
-
export { OperatorFieldConfig, ParsedField, ParsedRelationship, Permissions, PluginGeneratedTableSource, StandardActionPermission, StandardGqlPermissionPolicy, StandardPermissionCondition, StandardTailorTypeGqlPermission, StandardTailorTypePermission, TailorDBType, TypeSourceInfoEntry };
|
|
130
|
+
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Plugin } from "../../types.mjs";
|
|
2
2
|
//#region src/plugin/builtin/enum-constants/index.d.ts
|
|
3
3
|
/** Unique identifier for the enum constants generator plugin. */
|
|
4
|
-
declare const EnumConstantsGeneratorID = "@tailor-platform/enum-constants";
|
|
4
|
+
export declare const EnumConstantsGeneratorID = "@tailor-platform/enum-constants";
|
|
5
5
|
type EnumConstantsPluginOptions = {
|
|
6
6
|
distPath: string;
|
|
7
7
|
};
|
|
@@ -11,6 +11,5 @@ type EnumConstantsPluginOptions = {
|
|
|
11
11
|
* @param options.distPath - Output file path for generated constants
|
|
12
12
|
* @returns Plugin instance with onTailorDBReady hook
|
|
13
13
|
*/
|
|
14
|
-
declare function enumConstantsPlugin(options: EnumConstantsPluginOptions): Plugin<unknown, EnumConstantsPluginOptions>;
|
|
15
|
-
//#endregion
|
|
16
|
-
export { EnumConstantsGeneratorID, enumConstantsPlugin };
|
|
14
|
+
export declare function enumConstantsPlugin(options: EnumConstantsPluginOptions): Plugin<unknown, EnumConstantsPluginOptions>;
|
|
15
|
+
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Plugin } from "../../types.mjs";
|
|
2
2
|
//#region src/plugin/builtin/file-utils/index.d.ts
|
|
3
3
|
/** Unique identifier for the file utilities generator plugin. */
|
|
4
|
-
declare const FileUtilsGeneratorID = "@tailor-platform/file-utils";
|
|
4
|
+
export declare const FileUtilsGeneratorID = "@tailor-platform/file-utils";
|
|
5
5
|
type FileUtilsPluginOptions = {
|
|
6
6
|
distPath: string;
|
|
7
7
|
};
|
|
@@ -11,6 +11,5 @@ type FileUtilsPluginOptions = {
|
|
|
11
11
|
* @param options.distPath - Output file path for generated file utilities
|
|
12
12
|
* @returns Plugin instance with onTailorDBReady hook
|
|
13
13
|
*/
|
|
14
|
-
declare function fileUtilsPlugin(options: FileUtilsPluginOptions): Plugin<unknown, FileUtilsPluginOptions>;
|
|
15
|
-
//#endregion
|
|
16
|
-
export { FileUtilsGeneratorID, fileUtilsPlugin };
|
|
14
|
+
export declare function fileUtilsPlugin(options: FileUtilsPluginOptions): Plugin<unknown, FileUtilsPluginOptions>;
|
|
15
|
+
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Plugin } from "../../types.mjs";
|
|
2
2
|
//#region src/plugin/builtin/kysely-type/index.d.ts
|
|
3
3
|
/** Unique identifier for the Kysely type generator plugin. */
|
|
4
|
-
declare const KyselyGeneratorID = "@tailor-platform/kysely-type";
|
|
4
|
+
export declare const KyselyGeneratorID = "@tailor-platform/kysely-type";
|
|
5
5
|
type KyselyTypePluginOptions = {
|
|
6
6
|
distPath: string;
|
|
7
7
|
};
|
|
@@ -11,13 +11,12 @@ declare module "@tailor-platform/sdk/plugin" {
|
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
/** Conventional output path used when `kyselyTypePlugin` has no `distPath` configured. */
|
|
14
|
-
declare const DEFAULT_KYSELY_TYPES_DIST_PATH = "./generated/tailordb.ts";
|
|
14
|
+
export declare const DEFAULT_KYSELY_TYPES_DIST_PATH = "./generated/tailordb.ts";
|
|
15
15
|
/**
|
|
16
16
|
* Plugin that generates Kysely type definitions for TailorDB tables.
|
|
17
17
|
* @param options - Plugin options
|
|
18
18
|
* @param options.distPath - Output file path for generated types
|
|
19
19
|
* @returns Plugin instance with onTailorDBReady hook
|
|
20
20
|
*/
|
|
21
|
-
declare function kyselyTypePlugin(options: KyselyTypePluginOptions): Plugin<unknown, KyselyTypePluginOptions>;
|
|
22
|
-
//#endregion
|
|
23
|
-
export { DEFAULT_KYSELY_TYPES_DIST_PATH, KyselyGeneratorID, kyselyTypePlugin };
|
|
21
|
+
export declare function kyselyTypePlugin(options: KyselyTypePluginOptions): Plugin<unknown, KyselyTypePluginOptions>;
|
|
22
|
+
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Plugin } from "../../types.mjs";
|
|
2
2
|
//#region src/plugin/builtin/seed/index.d.ts
|
|
3
3
|
/** Unique identifier for the seed generator plugin. */
|
|
4
|
-
declare const SeedGeneratorID = "@tailor-platform/seed";
|
|
4
|
+
export declare const SeedGeneratorID = "@tailor-platform/seed";
|
|
5
5
|
type DisableIdpUserSyncDirections = {
|
|
6
6
|
/**
|
|
7
7
|
* Skip emitting the foreign key from `<userProfile>.<usernameField>` to
|
|
@@ -20,7 +20,7 @@ type DisableIdpUserSyncDirections = {
|
|
|
20
20
|
*/
|
|
21
21
|
idpToUser?: boolean;
|
|
22
22
|
};
|
|
23
|
-
type SeedPluginOptions = {
|
|
23
|
+
export type SeedPluginOptions = {
|
|
24
24
|
distPath: string;
|
|
25
25
|
machineUserName?: string;
|
|
26
26
|
/**
|
|
@@ -46,6 +46,5 @@ declare module "@tailor-platform/sdk/plugin" {
|
|
|
46
46
|
* @param options.disableIdpUserSync - Skip emitting individual `_User <-> userProfile` foreign keys. Both directions are emitted by default; set a direction to `true` to relax that side.
|
|
47
47
|
* @returns Plugin instance with onTailorDBReady hook
|
|
48
48
|
*/
|
|
49
|
-
declare function seedPlugin(options: SeedPluginOptions): Plugin<unknown, SeedPluginOptions>;
|
|
50
|
-
//#endregion
|
|
51
|
-
export { SeedGeneratorID, SeedPluginOptions, seedPlugin };
|
|
49
|
+
export declare function seedPlugin(options: SeedPluginOptions): Plugin<unknown, SeedPluginOptions>;
|
|
50
|
+
//#endregion
|
|
@@ -3,7 +3,7 @@ import "../../types.mjs";
|
|
|
3
3
|
/**
|
|
4
4
|
* Seed ordering information for a TailorDB namespace.
|
|
5
5
|
*/
|
|
6
|
-
interface SeedNamespaceConfig {
|
|
6
|
+
export interface SeedNamespaceConfig {
|
|
7
7
|
/** TailorDB namespace name. */
|
|
8
8
|
namespace: string;
|
|
9
9
|
/** Table names in the namespace, in definition order. */
|
|
@@ -15,5 +15,4 @@ interface SeedNamespaceConfig {
|
|
|
15
15
|
/** Field names a seed row must supply per table, enforced with `--upsert`. */
|
|
16
16
|
requiredFields: Record<string, string[]>;
|
|
17
17
|
}
|
|
18
|
-
//#endregion
|
|
19
|
-
export { SeedNamespaceConfig };
|
|
18
|
+
//#endregion
|
|
@@ -11,6 +11,5 @@ import { TailorAnyDBType } from "../configure/services/tailordb/types.mjs";
|
|
|
11
11
|
* @param kind - The generated table kind (e.g., "request", "step")
|
|
12
12
|
* @returns The generated TailorDB table
|
|
13
13
|
*/
|
|
14
|
-
declare function getGeneratedTable(configPath: string, pluginId: string, sourceTable: TailorAnyDBType | null, kind: string): Promise<TailorAnyDBType>;
|
|
15
|
-
//#endregion
|
|
16
|
-
export { getGeneratedTable };
|
|
14
|
+
export declare function getGeneratedTable(configPath: string, pluginId: string, sourceTable: TailorAnyDBType | null, kind: string): Promise<TailorAnyDBType>;
|
|
15
|
+
//#endregion
|
package/dist/plugin/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as e from"pathe";import*as t from"node:fs";import{pathToFileURL as n}from"node:url";function withPluginContext(e){return e}const r=new Map;function isPlugin(e){return typeof e==`object`&&!!e&&typeof e.id==`string`&&typeof e.description==`string`}async function loadAndCacheConfig(i){let a=e.resolve(i),o=r.get(a);if(o)return o;if(!t.existsSync(a))return null;let s=await import(n(a).href);if(!s?.default)throw Error(`Invalid config module at "${a}": default export not found`);let c=s.default,l=e.dirname(a),u=new Map;for(let e of Object.values(s))if(Array.isArray(e))for(let t of e)isPlugin(t)&&u.set(t.id,{plugin:t,pluginConfig:t.pluginConfig});let d={config:c,plugins:u,configDir:l};return r.set(a,d),d}async function resolveNamespaceForTable(r,i,a){if(!r.db)throw Error(`No db configuration found in config`);for(let[o,s]of Object.entries(r.db)){let r=s;if(!
|
|
1
|
+
import*as e from"pathe";import*as t from"node:fs";import{pathToFileURL as n}from"node:url";function withPluginContext(e){return e}const r=new Map;function isPlugin(e){return typeof e==`object`&&!!e&&typeof e.id==`string`&&typeof e.description==`string`}async function loadAndCacheConfig(i){let a=e.resolve(i),o=r.get(a);if(o)return o;if(!t.existsSync(a))return null;let s=await import(n(a).href);if(!s?.default)throw Error(`Invalid config module at "${a}": default export not found`);let c=s.default,l=e.dirname(a),u=new Map;for(let e of Object.values(s))if(Array.isArray(e))for(let t of e)isPlugin(t)&&u.set(t.id,{plugin:t,pluginConfig:t.pluginConfig});let d={config:c,plugins:u,configDir:l};return r.set(a,d),d}async function resolveNamespaceForTable(r,i,a){if(!r.db)throw Error(`No db configuration found in config`);for(let[o,s]of Object.entries(r.db)){let r=s;if(!r.external&&r.files)for(let s of r.files){let r=e.resolve(i,s),c;try{c=t.globSync(r)}catch{continue}for(let e of c){let t=await import(n(e).href);for(let e of Object.values(t))if(e===a)return o}}}throw Error(`Could not resolve namespace for table "${a.name}". Ensure the table file is included in a db namespace's files pattern.`)}async function resolveNamespaceForNamespacePlugin(e,t,n,r){if(!e.db)throw Error(`No db configuration found in config`);if(!t.onNamespaceLoaded)throw Error(`Plugin "${t.id}" does not have a onNamespaceLoaded() method`);for(let i of Object.keys(e.db)){if(e.db[i].external)continue;let a=await t.onNamespaceLoaded({pluginConfig:r,namespace:i});if(a.tables?.[n])return{namespace:i,output:a}}throw Error(`Could not resolve namespace for plugin "${t.id}" with kind "${n}". No namespace produced a table with that kind.`)}const i=new WeakMap,a=new WeakMap;function getCacheKey(e,t){if(t===void 0)return e;try{return`${e}:${JSON.stringify(t)}`}catch{throw Error(`pluginConfig must be JSON-serializable for caching. Received non-serializable value.`)}}async function getGeneratedTable(e,t,n,r){let i=await loadAndCacheConfig(e);if(!i)return{name:`__placeholder_${r}__`,fields:{}};let{config:a,configDir:o,plugins:s}=i,c=s.get(t);if(!c)throw Error(`Plugin "${t}" not found in config at "${e}". Ensure the plugin is registered via definePlugins().`);let{plugin:l,pluginConfig:u}=c;return n===null?getGeneratedTableForNamespacePlugin(a,l,r,u):getGeneratedTableForTableAttachedPlugin(l,n,r,u,await resolveNamespaceForTable(a,o,n))}async function getGeneratedTableForTableAttachedPlugin(e,t,n,r,a){if(!e.onTableLoaded)throw Error(`Plugin "${e.id}" does not have an onTableLoaded() method`);let o=i.get(e);o||(o=new Map,i.set(e,o));let s=getCacheKey(`${t.name}:ns=${a}`,r),c=o.get(s);if(!c){let n=t.plugins.find(t=>t.pluginId===e.id)?.config;c=await e.onTableLoaded({table:t,tableConfig:n??{},pluginConfig:r,namespace:a}),o.set(s,c)}let l=c.tables?.[n];if(!l)throw Error(`Generated table not found: plugin=${e.id}, sourceTable=${t.name}, kind=${n}`);return l}async function getGeneratedTableForNamespacePlugin(e,t,n,r){if(!t.onNamespaceLoaded)throw Error(`Plugin "${t.id}" does not have a onNamespaceLoaded() method`);let i=a.get(t);if(i||(i=new Map,a.set(t,i)),e.db)for(let t of Object.keys(e.db)){if(e.db[t].external)continue;let a=getCacheKey(`namespace:ns=${t}`,r),o=i.get(a);if(o?.tables?.[n])return o.tables[n]}let{namespace:o,output:s}=await resolveNamespaceForNamespacePlugin(e,t,n,r),c=getCacheKey(`namespace:ns=${o}`,r);i.set(c,s);let l=s.tables?.[n];if(!l)throw Error(`Generated table not found: plugin=${t.id}, kind=${n}`);return l}export{getGeneratedTable,withPluginContext};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|