@tailor-platform/sdk 0.22.0 → 0.22.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 +17 -0
- package/dist/cli/index.mjs +2 -2
- package/dist/cli/lib.d.mts +1 -43
- package/dist/cli/lib.mjs +2 -2
- package/dist/{config-BGY8v5d7.mjs → config-BYrX78K0.mjs} +7 -65
- package/dist/config-BYrX78K0.mjs.map +1 -0
- package/dist/configure/index.d.mts +2 -2
- package/dist/configure/index.mjs +1 -1
- package/dist/{index--_tMHIHD.d.mts → index-43O2EJml.d.mts} +2 -2
- package/dist/{list-B11wQhss.mjs → list-CqNMJdug.mjs} +197 -147
- package/dist/list-CqNMJdug.mjs.map +1 -0
- package/dist/{types-DhLfUYWN.d.mts → types-DkG_CWKo.d.mts} +578 -553
- package/dist/utils/test/index.d.mts +2 -2
- package/package.json +3 -3
- package/dist/config-BGY8v5d7.mjs.map +0 -1
- package/dist/list-B11wQhss.mjs.map +0 -1
|
@@ -1,11 +1,179 @@
|
|
|
1
1
|
/// <reference path="./user-defined.d.ts" />
|
|
2
|
-
import * as
|
|
2
|
+
import * as zod0 from "zod";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
5
4
|
import * as type_fest0 from "type-fest";
|
|
6
5
|
import { IsAny, NonEmptyObject } from "type-fest";
|
|
7
|
-
import
|
|
6
|
+
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
7
|
+
import * as zod_v4_core0 from "zod/v4/core";
|
|
8
8
|
|
|
9
|
+
//#region src/parser/service/auth/schema.d.ts
|
|
10
|
+
declare const AuthInvokerSchema: z.ZodObject<{
|
|
11
|
+
namespace: z.ZodString;
|
|
12
|
+
machineUserName: z.ZodString;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
declare const OIDCSchema: z.ZodObject<{
|
|
15
|
+
name: z.ZodString;
|
|
16
|
+
kind: z.ZodLiteral<"OIDC">;
|
|
17
|
+
clientID: z.ZodString;
|
|
18
|
+
clientSecret: z.ZodObject<{
|
|
19
|
+
vaultName: z.ZodString;
|
|
20
|
+
secretKey: z.ZodString;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
providerURL: z.ZodString;
|
|
23
|
+
issuerURL: z.ZodOptional<z.ZodString>;
|
|
24
|
+
usernameClaim: z.ZodOptional<z.ZodString>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
declare const SAMLSchema: z.ZodObject<{
|
|
27
|
+
name: z.ZodString;
|
|
28
|
+
kind: z.ZodLiteral<"SAML">;
|
|
29
|
+
enableSignRequest: z.ZodDefault<z.ZodBoolean>;
|
|
30
|
+
metadataURL: z.ZodOptional<z.ZodString>;
|
|
31
|
+
rawMetadata: z.ZodOptional<z.ZodString>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
declare const IDTokenSchema: z.ZodObject<{
|
|
34
|
+
name: z.ZodString;
|
|
35
|
+
kind: z.ZodLiteral<"IDToken">;
|
|
36
|
+
providerURL: z.ZodString;
|
|
37
|
+
issuerURL: z.ZodOptional<z.ZodString>;
|
|
38
|
+
clientID: z.ZodString;
|
|
39
|
+
usernameClaim: z.ZodOptional<z.ZodString>;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
declare const BuiltinIdPSchema: z.ZodObject<{
|
|
42
|
+
name: z.ZodString;
|
|
43
|
+
kind: z.ZodLiteral<"BuiltInIdP">;
|
|
44
|
+
namespace: z.ZodString;
|
|
45
|
+
clientName: z.ZodString;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
declare const IdProviderSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
48
|
+
name: z.ZodString;
|
|
49
|
+
kind: z.ZodLiteral<"OIDC">;
|
|
50
|
+
clientID: z.ZodString;
|
|
51
|
+
clientSecret: z.ZodObject<{
|
|
52
|
+
vaultName: z.ZodString;
|
|
53
|
+
secretKey: z.ZodString;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
providerURL: z.ZodString;
|
|
56
|
+
issuerURL: z.ZodOptional<z.ZodString>;
|
|
57
|
+
usernameClaim: z.ZodOptional<z.ZodString>;
|
|
58
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
59
|
+
name: z.ZodString;
|
|
60
|
+
kind: z.ZodLiteral<"SAML">;
|
|
61
|
+
enableSignRequest: z.ZodDefault<z.ZodBoolean>;
|
|
62
|
+
metadataURL: z.ZodOptional<z.ZodString>;
|
|
63
|
+
rawMetadata: z.ZodOptional<z.ZodString>;
|
|
64
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
65
|
+
name: z.ZodString;
|
|
66
|
+
kind: z.ZodLiteral<"IDToken">;
|
|
67
|
+
providerURL: z.ZodString;
|
|
68
|
+
issuerURL: z.ZodOptional<z.ZodString>;
|
|
69
|
+
clientID: z.ZodString;
|
|
70
|
+
usernameClaim: z.ZodOptional<z.ZodString>;
|
|
71
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
72
|
+
name: z.ZodString;
|
|
73
|
+
kind: z.ZodLiteral<"BuiltInIdP">;
|
|
74
|
+
namespace: z.ZodString;
|
|
75
|
+
clientName: z.ZodString;
|
|
76
|
+
}, z.core.$strip>], "kind">;
|
|
77
|
+
declare const OAuth2ClientGrantTypeSchema: z.ZodUnion<readonly [z.ZodLiteral<"authorization_code">, z.ZodLiteral<"refresh_token">]>;
|
|
78
|
+
declare const OAuth2ClientSchema: z.ZodObject<{
|
|
79
|
+
description: z.ZodOptional<z.ZodString>;
|
|
80
|
+
grantTypes: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"authorization_code">, z.ZodLiteral<"refresh_token">]>>>;
|
|
81
|
+
redirectURIs: z.ZodArray<z.ZodUnion<readonly [z.ZodTemplateLiteral<`https://${string}`>, z.ZodTemplateLiteral<`http://${string}`>, z.ZodTemplateLiteral<`${string}:url`>, z.ZodTemplateLiteral<`${string}:url/${string}`>]>>;
|
|
82
|
+
clientType: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"confidential">, z.ZodLiteral<"public">, z.ZodLiteral<"browser">]>>;
|
|
83
|
+
accessTokenLifetimeSeconds: z.ZodPipe<z.ZodOptional<z.ZodNumber>, z.ZodTransform<{
|
|
84
|
+
seconds: bigint;
|
|
85
|
+
nanos: number;
|
|
86
|
+
} | undefined, number | undefined>>;
|
|
87
|
+
refreshTokenLifetimeSeconds: z.ZodPipe<z.ZodOptional<z.ZodNumber>, z.ZodTransform<{
|
|
88
|
+
seconds: bigint;
|
|
89
|
+
nanos: number;
|
|
90
|
+
} | undefined, number | undefined>>;
|
|
91
|
+
}, z.core.$strip>;
|
|
92
|
+
declare const SCIMAuthorizationSchema: z.ZodObject<{
|
|
93
|
+
type: z.ZodUnion<readonly [z.ZodLiteral<"oauth2">, z.ZodLiteral<"bearer">]>;
|
|
94
|
+
bearerSecret: z.ZodOptional<z.ZodObject<{
|
|
95
|
+
vaultName: z.ZodString;
|
|
96
|
+
secretKey: z.ZodString;
|
|
97
|
+
}, z.core.$strip>>;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
declare const SCIMAttributeTypeSchema: z.ZodUnion<readonly [z.ZodLiteral<"string">, z.ZodLiteral<"number">, z.ZodLiteral<"boolean">, z.ZodLiteral<"datetime">, z.ZodLiteral<"complex">]>;
|
|
100
|
+
declare const SCIMAttributeSchema: z.ZodObject<{
|
|
101
|
+
type: z.ZodUnion<readonly [z.ZodLiteral<"string">, z.ZodLiteral<"number">, z.ZodLiteral<"boolean">, z.ZodLiteral<"datetime">, z.ZodLiteral<"complex">]>;
|
|
102
|
+
name: z.ZodString;
|
|
103
|
+
description: z.ZodOptional<z.ZodString>;
|
|
104
|
+
mutability: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"readOnly">, z.ZodLiteral<"readWrite">, z.ZodLiteral<"writeOnly">]>>;
|
|
105
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
106
|
+
multiValued: z.ZodOptional<z.ZodBoolean>;
|
|
107
|
+
uniqueness: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"server">, z.ZodLiteral<"global">]>>;
|
|
108
|
+
canonicalValues: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
109
|
+
subAttributes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject< /*elided*/any, z.core.$strip>>>>;
|
|
110
|
+
}, z.core.$strip>;
|
|
111
|
+
declare const SCIMAttributeMappingSchema: z.ZodObject<{
|
|
112
|
+
tailorDBField: z.ZodString;
|
|
113
|
+
scimPath: z.ZodString;
|
|
114
|
+
}, z.core.$strip>;
|
|
115
|
+
declare const SCIMResourceSchema: z.ZodObject<{
|
|
116
|
+
name: z.ZodString;
|
|
117
|
+
tailorDBNamespace: z.ZodString;
|
|
118
|
+
tailorDBType: z.ZodString;
|
|
119
|
+
coreSchema: z.ZodObject<{
|
|
120
|
+
name: z.ZodString;
|
|
121
|
+
attributes: z.ZodArray<z.ZodObject<{
|
|
122
|
+
type: z.ZodUnion<readonly [z.ZodLiteral<"string">, z.ZodLiteral<"number">, z.ZodLiteral<"boolean">, z.ZodLiteral<"datetime">, z.ZodLiteral<"complex">]>;
|
|
123
|
+
name: z.ZodString;
|
|
124
|
+
description: z.ZodOptional<z.ZodString>;
|
|
125
|
+
mutability: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"readOnly">, z.ZodLiteral<"readWrite">, z.ZodLiteral<"writeOnly">]>>;
|
|
126
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
127
|
+
multiValued: z.ZodOptional<z.ZodBoolean>;
|
|
128
|
+
uniqueness: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"server">, z.ZodLiteral<"global">]>>;
|
|
129
|
+
canonicalValues: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
130
|
+
subAttributes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject< /*elided*/any, z.core.$strip>>>>;
|
|
131
|
+
}, z.core.$strip>>;
|
|
132
|
+
}, z.core.$strip>;
|
|
133
|
+
attributeMapping: z.ZodArray<z.ZodObject<{
|
|
134
|
+
tailorDBField: z.ZodString;
|
|
135
|
+
scimPath: z.ZodString;
|
|
136
|
+
}, z.core.$strip>>;
|
|
137
|
+
}, z.core.$strip>;
|
|
138
|
+
declare const SCIMSchema: z.ZodObject<{
|
|
139
|
+
machineUserName: z.ZodString;
|
|
140
|
+
authorization: z.ZodObject<{
|
|
141
|
+
type: z.ZodUnion<readonly [z.ZodLiteral<"oauth2">, z.ZodLiteral<"bearer">]>;
|
|
142
|
+
bearerSecret: z.ZodOptional<z.ZodObject<{
|
|
143
|
+
vaultName: z.ZodString;
|
|
144
|
+
secretKey: z.ZodString;
|
|
145
|
+
}, z.core.$strip>>;
|
|
146
|
+
}, z.core.$strip>;
|
|
147
|
+
resources: z.ZodArray<z.ZodObject<{
|
|
148
|
+
name: z.ZodString;
|
|
149
|
+
tailorDBNamespace: z.ZodString;
|
|
150
|
+
tailorDBType: z.ZodString;
|
|
151
|
+
coreSchema: z.ZodObject<{
|
|
152
|
+
name: z.ZodString;
|
|
153
|
+
attributes: z.ZodArray<z.ZodObject<{
|
|
154
|
+
type: z.ZodUnion<readonly [z.ZodLiteral<"string">, z.ZodLiteral<"number">, z.ZodLiteral<"boolean">, z.ZodLiteral<"datetime">, z.ZodLiteral<"complex">]>;
|
|
155
|
+
name: z.ZodString;
|
|
156
|
+
description: z.ZodOptional<z.ZodString>;
|
|
157
|
+
mutability: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"readOnly">, z.ZodLiteral<"readWrite">, z.ZodLiteral<"writeOnly">]>>;
|
|
158
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
159
|
+
multiValued: z.ZodOptional<z.ZodBoolean>;
|
|
160
|
+
uniqueness: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"server">, z.ZodLiteral<"global">]>>;
|
|
161
|
+
canonicalValues: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
162
|
+
subAttributes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject< /*elided*/any, z.core.$strip>>>>;
|
|
163
|
+
}, z.core.$strip>>;
|
|
164
|
+
}, z.core.$strip>;
|
|
165
|
+
attributeMapping: z.ZodArray<z.ZodObject<{
|
|
166
|
+
tailorDBField: z.ZodString;
|
|
167
|
+
scimPath: z.ZodString;
|
|
168
|
+
}, z.core.$strip>>;
|
|
169
|
+
}, z.core.$strip>>;
|
|
170
|
+
}, z.core.$strip>;
|
|
171
|
+
declare const TenantProviderSchema: z.ZodObject<{
|
|
172
|
+
namespace: z.ZodString;
|
|
173
|
+
type: z.ZodString;
|
|
174
|
+
signatureField: z.ZodString;
|
|
175
|
+
}, z.core.$strip>;
|
|
176
|
+
//#endregion
|
|
9
177
|
//#region src/configure/types/helpers.d.ts
|
|
10
178
|
type Prettify<T$1> = { [K in keyof T$1 as string extends K ? never : K]: T$1[K] } & {};
|
|
11
179
|
type DeepWritable<T$1> = T$1 extends Date | RegExp | Function ? T$1 : T$1 extends object ? { -readonly [P in keyof T$1]: DeepWritable<T$1[P]> } & {} : T$1;
|
|
@@ -27,201 +195,74 @@ type JsonCompatible<T$1> = T$1 extends string | number | boolean | null | undefi
|
|
|
27
195
|
toJSON: () => unknown;
|
|
28
196
|
} ? never : { [K in keyof T$1]: JsonCompatible<T$1[K]> } : never;
|
|
29
197
|
//#endregion
|
|
30
|
-
//#region src/parser/service/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
string: "string";
|
|
98
|
-
boolean: "boolean";
|
|
99
|
-
uuid: "uuid";
|
|
100
|
-
integer: "integer";
|
|
101
|
-
float: "float";
|
|
102
|
-
enum: "enum";
|
|
103
|
-
date: "date";
|
|
104
|
-
datetime: "datetime";
|
|
105
|
-
time: "time";
|
|
106
|
-
nested: "nested";
|
|
107
|
-
}>;
|
|
108
|
-
metadata: z.ZodObject<{
|
|
109
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
110
|
-
array: z.ZodOptional<z.ZodBoolean>;
|
|
111
|
-
description: z.ZodOptional<z.ZodString>;
|
|
112
|
-
allowedValues: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
113
|
-
value: z.ZodString;
|
|
114
|
-
description: z.ZodOptional<z.ZodString>;
|
|
115
|
-
}, z.core.$strip>>>;
|
|
116
|
-
hooks: z.ZodOptional<z.ZodObject<{
|
|
117
|
-
create: z.ZodOptional<z.ZodCustom<Function, Function>>;
|
|
118
|
-
update: z.ZodOptional<z.ZodCustom<Function, Function>>;
|
|
119
|
-
}, z.core.$strip>>;
|
|
120
|
-
typeName: z.ZodOptional<z.ZodString>;
|
|
121
|
-
}, z.core.$strip>;
|
|
122
|
-
fields: z.ZodRecord<z.ZodString, z.ZodObject< /*elided*/any, z.core.$strip>>;
|
|
123
|
-
}, z.core.$strip>;
|
|
124
|
-
}, z.core.$strip>;
|
|
125
|
-
//#endregion
|
|
126
|
-
//#region src/parser/service/resolver/types.d.ts
|
|
127
|
-
type TailorFieldInput = z.input<typeof TailorFieldSchema>;
|
|
128
|
-
type QueryType = z.output<typeof QueryTypeSchema>;
|
|
129
|
-
type ResolverInput = z.input<typeof ResolverSchema>;
|
|
130
|
-
type Resolver = z.output<typeof ResolverSchema>;
|
|
131
|
-
//#endregion
|
|
132
|
-
//#region src/configure/types/type.d.ts
|
|
133
|
-
declare class TailorField<const Defined extends DefinedFieldMetadata = DefinedFieldMetadata, const Output = any, M extends FieldMetadata = FieldMetadata> implements TailorFieldInput {
|
|
134
|
-
readonly type: TailorFieldType;
|
|
135
|
-
readonly fields: Record<string, TailorField<any>>;
|
|
136
|
-
protected _metadata: M;
|
|
137
|
-
readonly _defined: Defined;
|
|
138
|
-
readonly _output: Output;
|
|
139
|
-
get metadata(): M;
|
|
140
|
-
protected constructor(type: TailorFieldType, options?: FieldOptions, fields?: Record<string, TailorField<any>>, values?: AllowedValues);
|
|
141
|
-
static create<const TType extends TailorFieldType, const TOptions extends FieldOptions, const OutputBase = TailorToTs[TType]>(type: TType, options?: TOptions, fields?: Record<string, TailorField<any>>, values?: AllowedValues): TailorField<{
|
|
142
|
-
type: TType;
|
|
143
|
-
array: TOptions extends {
|
|
144
|
-
array: true;
|
|
145
|
-
} ? true : false;
|
|
146
|
-
}, FieldOutput$1<OutputBase, TOptions>, FieldMetadata>;
|
|
147
|
-
description<CurrentDefined extends Defined>(this: CurrentDefined extends {
|
|
148
|
-
description: unknown;
|
|
149
|
-
} ? never : TailorField<CurrentDefined, Output>, description: string): TailorField<Prettify<CurrentDefined & {
|
|
150
|
-
description: true;
|
|
151
|
-
}>, Output>;
|
|
152
|
-
typeName<CurrentDefined extends Defined>(this: CurrentDefined extends {
|
|
153
|
-
typeName: unknown;
|
|
154
|
-
} ? never : CurrentDefined extends {
|
|
155
|
-
type: "enum" | "nested";
|
|
156
|
-
} ? TailorField<CurrentDefined, Output> : never, typeName: string): TailorField<Prettify<CurrentDefined & {
|
|
157
|
-
typeName: true;
|
|
158
|
-
}>, Output>;
|
|
159
|
-
validate<CurrentDefined extends Defined>(this: CurrentDefined extends {
|
|
160
|
-
validate: unknown;
|
|
161
|
-
} ? never : TailorField<CurrentDefined, Output>, ...validate: FieldValidateInput<Output>[]): TailorField<Prettify<CurrentDefined & {
|
|
162
|
-
validate: true;
|
|
163
|
-
}>, Output>;
|
|
164
|
-
/**
|
|
165
|
-
* Parse and validate a value against this field's validation rules
|
|
166
|
-
* Returns StandardSchema Result type with success or failure
|
|
167
|
-
*/
|
|
168
|
-
parse(args: {
|
|
169
|
-
value: any;
|
|
170
|
-
data: any;
|
|
171
|
-
user: TailorUser;
|
|
172
|
-
}): StandardSchemaV1.Result<Output>;
|
|
173
|
-
/**
|
|
174
|
-
* Validate a single value (not an array element)
|
|
175
|
-
* Used internally for array element validation
|
|
176
|
-
* @private
|
|
177
|
-
*/
|
|
178
|
-
private _validateValue;
|
|
179
|
-
/**
|
|
180
|
-
* Internal parse method that tracks field path for nested validation
|
|
181
|
-
* @private
|
|
182
|
-
*/
|
|
183
|
-
private _parseInternal;
|
|
184
|
-
}
|
|
185
|
-
//#endregion
|
|
186
|
-
//#region src/configure/types/user.d.ts
|
|
187
|
-
interface AttributeMap {}
|
|
188
|
-
interface AttributeList {
|
|
189
|
-
__tuple?: [];
|
|
190
|
-
}
|
|
191
|
-
type InferredAttributeMap = keyof AttributeMap extends never ? Record<string, string | string[] | boolean | boolean[] | undefined> : AttributeMap;
|
|
192
|
-
type InferredAttributeList = AttributeList["__tuple"] extends [] ? string[] : AttributeList["__tuple"];
|
|
193
|
-
/** Represents a user in the Tailor platform. */
|
|
194
|
-
type TailorUser = {
|
|
195
|
-
/**
|
|
196
|
-
* The ID of the user.
|
|
197
|
-
* For unauthenticated users, this will be a nil UUID.
|
|
198
|
-
*/
|
|
199
|
-
id: string;
|
|
200
|
-
/**
|
|
201
|
-
* The type of the user.
|
|
202
|
-
* For unauthenticated users, this will be an empty string.
|
|
203
|
-
*/
|
|
204
|
-
type: "user" | "machine_user" | "";
|
|
205
|
-
/** The ID of the workspace the user belongs to. */
|
|
206
|
-
workspaceId: string;
|
|
207
|
-
/**
|
|
208
|
-
* A map of the user's attributes.
|
|
209
|
-
* For unauthenticated users, this will be null.
|
|
210
|
-
*/
|
|
211
|
-
attributes: InferredAttributeMap | null;
|
|
212
|
-
/**
|
|
213
|
-
* A list of the user's attributes.
|
|
214
|
-
* For unauthenticated users, this will be an empty array.
|
|
215
|
-
*/
|
|
216
|
-
attributeList: InferredAttributeList;
|
|
198
|
+
//#region src/parser/service/auth/types.d.ts
|
|
199
|
+
type AuthInvoker$1 = z.output<typeof AuthInvokerSchema>;
|
|
200
|
+
type OIDC = z.output<typeof OIDCSchema>;
|
|
201
|
+
type SAML = z.output<typeof SAMLSchema>;
|
|
202
|
+
type IDToken = z.output<typeof IDTokenSchema>;
|
|
203
|
+
type BuiltinIdP = z.output<typeof BuiltinIdPSchema>;
|
|
204
|
+
type IdProviderConfig = z.output<typeof IdProviderSchema>;
|
|
205
|
+
type OAuth2ClientGrantType = z.output<typeof OAuth2ClientGrantTypeSchema>;
|
|
206
|
+
type OAuth2ClientInput = z.input<typeof OAuth2ClientSchema>;
|
|
207
|
+
type SCIMAuthorization = z.output<typeof SCIMAuthorizationSchema>;
|
|
208
|
+
type SCIMAttributeType = z.output<typeof SCIMAttributeTypeSchema>;
|
|
209
|
+
type SCIMAttribute = z.output<typeof SCIMAttributeSchema>;
|
|
210
|
+
type SCIMAttributeMapping = z.output<typeof SCIMAttributeMappingSchema>;
|
|
211
|
+
type SCIMResource = z.output<typeof SCIMResourceSchema>;
|
|
212
|
+
type SCIMConfig = z.output<typeof SCIMSchema>;
|
|
213
|
+
type TenantProviderConfig = z.output<typeof TenantProviderSchema>;
|
|
214
|
+
type ValueOperand = string | boolean | string[] | boolean[];
|
|
215
|
+
type AuthAttributeValue = ValueOperand | null | undefined;
|
|
216
|
+
type UserFieldKeys<User extends TailorDBInstance> = keyof output<User> & string;
|
|
217
|
+
type FieldDefined<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = User["fields"][Key] extends {
|
|
218
|
+
_defined: infer Defined;
|
|
219
|
+
} ? Defined : never;
|
|
220
|
+
type FieldOutput$1<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = output<User>[Key];
|
|
221
|
+
type FieldIsRequired<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = undefined extends FieldOutput$1<User, Key> ? false : true;
|
|
222
|
+
type FieldIsOfType<User extends TailorDBInstance, Key extends UserFieldKeys<User>, Type extends string> = FieldDefined<User, Key> extends {
|
|
223
|
+
type: Type;
|
|
224
|
+
} ? true : false;
|
|
225
|
+
type FieldIsArray<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = FieldDefined<User, Key> extends {
|
|
226
|
+
array: true;
|
|
227
|
+
} ? true : false;
|
|
228
|
+
type FieldIsUnique<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = FieldDefined<User, Key> extends {
|
|
229
|
+
unique: true;
|
|
230
|
+
} ? true : false;
|
|
231
|
+
type FieldSupportsValueOperand<User extends TailorDBInstance, Key extends UserFieldKeys<User>> = FieldOutput$1<User, Key> extends ValueOperand | null | undefined ? true : false;
|
|
232
|
+
type UsernameFieldKey<User extends TailorDBInstance> = IsAny<User> extends true ? string : { [K in UserFieldKeys<User>]: FieldIsRequired<User, K> extends true ? FieldIsOfType<User, K, "string"> extends true ? FieldIsArray<User, K> extends true ? never : FieldIsUnique<User, K> extends true ? K : never : never : never }[UserFieldKeys<User>];
|
|
233
|
+
type UserAttributeKey<User extends TailorDBInstance> = { [K in UserFieldKeys<User>]: K extends "id" ? never : FieldSupportsValueOperand<User, K> extends true ? FieldIsOfType<User, K, "datetime" | "date" | "time"> extends true ? never : K : never }[UserFieldKeys<User>];
|
|
234
|
+
type UserAttributeListKey<User extends TailorDBInstance> = { [K in UserFieldKeys<User>]: K extends "id" ? never : FieldIsOfType<User, K, "uuid"> extends true ? FieldIsArray<User, K> extends true ? never : K : never }[UserFieldKeys<User>];
|
|
235
|
+
type UserAttributeMap<User extends TailorDBInstance> = { [K in UserAttributeKey<User>]?: true };
|
|
236
|
+
type DisallowExtraKeys<T$1, Allowed extends PropertyKey> = T$1 & { [K in Exclude<keyof T$1, Allowed>]: never };
|
|
237
|
+
type AttributeListValue<User extends TailorDBInstance, Key extends UserAttributeListKey<User>> = Key extends keyof output<User> ? output<User>[Key] : never;
|
|
238
|
+
type AttributeListToTuple<User extends TailorDBInstance, AttributeList$1 extends readonly UserAttributeListKey<User>[]> = { [Index in keyof AttributeList$1]: AttributeList$1[Index] extends UserAttributeListKey<User> ? AttributeListValue<User, AttributeList$1[Index]> : never };
|
|
239
|
+
type AttributeMapSelectedKeys<User extends TailorDBInstance, AttributeMap$1 extends UserAttributeMap<User>> = Extract<{ [K in keyof AttributeMap$1]-?: undefined extends AttributeMap$1[K] ? never : K }[keyof AttributeMap$1], UserAttributeKey<User>>;
|
|
240
|
+
type UserProfile<User extends TailorDBInstance, AttributeMap$1 extends UserAttributeMap<User>, AttributeList$1 extends UserAttributeListKey<User>[]> = {
|
|
241
|
+
type: User;
|
|
242
|
+
usernameField: UsernameFieldKey<User>;
|
|
243
|
+
attributes?: DisallowExtraKeys<AttributeMap$1, UserAttributeKey<User>>;
|
|
244
|
+
attributeList?: AttributeList$1;
|
|
245
|
+
};
|
|
246
|
+
type MachineUser<User extends TailorDBInstance, AttributeMap$1 extends UserAttributeMap<User> = UserAttributeMap<User>, AttributeList$1 extends UserAttributeListKey<User>[] = []> = IsAny<User> extends true ? {
|
|
247
|
+
attributes: Record<string, AuthAttributeValue>;
|
|
248
|
+
attributeList?: string[];
|
|
249
|
+
} : (AttributeMapSelectedKeys<User, AttributeMap$1> extends never ? {
|
|
250
|
+
attributes?: never;
|
|
251
|
+
} : {
|
|
252
|
+
attributes: { [K in AttributeMapSelectedKeys<User, AttributeMap$1>]: K extends keyof output<User> ? output<User>[K] : never } & { [K in Exclude<keyof output<User>, AttributeMapSelectedKeys<User, AttributeMap$1>>]?: never };
|
|
253
|
+
}) & ([] extends AttributeList$1 ? {
|
|
254
|
+
attributeList?: never;
|
|
255
|
+
} : {
|
|
256
|
+
attributeList: AttributeListToTuple<User, AttributeList$1>;
|
|
257
|
+
});
|
|
258
|
+
type AuthServiceInput<User extends TailorDBInstance, AttributeMap$1 extends UserAttributeMap<User>, AttributeList$1 extends UserAttributeListKey<User>[], MachineUserNames extends string> = {
|
|
259
|
+
userProfile?: UserProfile<User, AttributeMap$1, AttributeList$1>;
|
|
260
|
+
machineUsers?: Record<MachineUserNames, MachineUser<User, AttributeMap$1, AttributeList$1>>;
|
|
261
|
+
oauth2Clients?: Record<string, OAuth2ClientInput>;
|
|
262
|
+
idProvider?: IdProviderConfig;
|
|
263
|
+
scim?: SCIMConfig;
|
|
264
|
+
tenantProvider?: TenantProviderConfig;
|
|
217
265
|
};
|
|
218
|
-
/** Represents an unauthenticated user in the Tailor platform. */
|
|
219
|
-
declare const unauthenticatedTailorUser: TailorUser;
|
|
220
|
-
//#endregion
|
|
221
|
-
//#region src/configure/types/env.d.ts
|
|
222
|
-
interface Env {}
|
|
223
|
-
/** Represents environment variables in the Tailor platform. */
|
|
224
|
-
type TailorEnv = keyof Env extends never ? Record<string, string> : Env;
|
|
225
266
|
//#endregion
|
|
226
267
|
//#region src/configure/types/validation.d.ts
|
|
227
268
|
/**
|
|
@@ -285,13 +326,6 @@ type TailorToTs = {
|
|
|
285
326
|
object: Record<string, unknown>;
|
|
286
327
|
nested: Record<string, unknown>;
|
|
287
328
|
} & Record<TailorFieldType, unknown>;
|
|
288
|
-
interface Script {
|
|
289
|
-
expr: string;
|
|
290
|
-
}
|
|
291
|
-
interface EnumValue {
|
|
292
|
-
value: string;
|
|
293
|
-
description?: string;
|
|
294
|
-
}
|
|
295
329
|
interface FieldMetadata {
|
|
296
330
|
description?: string;
|
|
297
331
|
required?: boolean;
|
|
@@ -311,300 +345,207 @@ type FieldOptions = {
|
|
|
311
345
|
optional?: boolean;
|
|
312
346
|
array?: boolean;
|
|
313
347
|
};
|
|
314
|
-
type FieldOutput
|
|
348
|
+
type FieldOutput<T$1, O extends FieldOptions> = OptionalFieldOutput<ArrayFieldOutput<T$1, O>, O>;
|
|
315
349
|
type OptionalFieldOutput<T$1, O extends FieldOptions> = O["optional"] extends true ? T$1 | null : T$1;
|
|
316
350
|
type ArrayFieldOutput<T$1, O extends FieldOptions> = [O] extends [{
|
|
317
351
|
array: true;
|
|
318
352
|
}] ? T$1[] : T$1;
|
|
319
353
|
//#endregion
|
|
320
|
-
//#region src/
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
type
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
validate?: OperatorValidateConfig[];
|
|
349
|
-
hooks?: OperatorFieldHook;
|
|
350
|
-
serial?: {
|
|
351
|
-
start: number;
|
|
352
|
-
maxValue?: number;
|
|
353
|
-
format?: string;
|
|
354
|
-
};
|
|
355
|
-
fields?: Record<string, OperatorFieldConfig>;
|
|
356
|
-
}
|
|
357
|
-
//#endregion
|
|
358
|
-
//#region src/parser/service/auth/schema.d.ts
|
|
359
|
-
declare const AuthInvokerSchema: z.ZodObject<{
|
|
360
|
-
namespace: z.ZodString;
|
|
361
|
-
machineUserName: z.ZodString;
|
|
362
|
-
}, z.core.$strip>;
|
|
363
|
-
declare const OIDCSchema: z.ZodObject<{
|
|
364
|
-
name: z.ZodString;
|
|
365
|
-
kind: z.ZodLiteral<"OIDC">;
|
|
366
|
-
clientID: z.ZodString;
|
|
367
|
-
clientSecret: z.ZodObject<{
|
|
368
|
-
vaultName: z.ZodString;
|
|
369
|
-
secretKey: z.ZodString;
|
|
370
|
-
}, z.core.$strip>;
|
|
371
|
-
providerURL: z.ZodString;
|
|
372
|
-
issuerURL: z.ZodOptional<z.ZodString>;
|
|
373
|
-
usernameClaim: z.ZodOptional<z.ZodString>;
|
|
374
|
-
}, z.core.$strip>;
|
|
375
|
-
declare const SAMLSchema: z.ZodObject<{
|
|
376
|
-
name: z.ZodString;
|
|
377
|
-
kind: z.ZodLiteral<"SAML">;
|
|
378
|
-
spCertBase64: z.ZodOptional<z.ZodObject<{
|
|
379
|
-
vaultName: z.ZodString;
|
|
380
|
-
secretKey: z.ZodString;
|
|
381
|
-
}, z.core.$strip>>;
|
|
382
|
-
spKeyBase64: z.ZodOptional<z.ZodObject<{
|
|
383
|
-
vaultName: z.ZodString;
|
|
384
|
-
secretKey: z.ZodString;
|
|
385
|
-
}, z.core.$strip>>;
|
|
386
|
-
metadataURL: z.ZodOptional<z.ZodString>;
|
|
387
|
-
rawMetadata: z.ZodOptional<z.ZodString>;
|
|
388
|
-
}, z.core.$strip>;
|
|
389
|
-
declare const IDTokenSchema: z.ZodObject<{
|
|
390
|
-
name: z.ZodString;
|
|
391
|
-
kind: z.ZodLiteral<"IDToken">;
|
|
392
|
-
providerURL: z.ZodString;
|
|
393
|
-
issuerURL: z.ZodOptional<z.ZodString>;
|
|
394
|
-
clientID: z.ZodString;
|
|
395
|
-
usernameClaim: z.ZodOptional<z.ZodString>;
|
|
396
|
-
}, z.core.$strip>;
|
|
397
|
-
declare const BuiltinIdPSchema: z.ZodObject<{
|
|
398
|
-
name: z.ZodString;
|
|
399
|
-
kind: z.ZodLiteral<"BuiltInIdP">;
|
|
400
|
-
namespace: z.ZodString;
|
|
401
|
-
clientName: z.ZodString;
|
|
402
|
-
}, z.core.$strip>;
|
|
403
|
-
declare const IdProviderSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
404
|
-
name: z.ZodString;
|
|
405
|
-
kind: z.ZodLiteral<"OIDC">;
|
|
406
|
-
clientID: z.ZodString;
|
|
407
|
-
clientSecret: z.ZodObject<{
|
|
408
|
-
vaultName: z.ZodString;
|
|
409
|
-
secretKey: z.ZodString;
|
|
354
|
+
//#region src/parser/service/resolver/schema.d.ts
|
|
355
|
+
declare const QueryTypeSchema: z.ZodUnion<readonly [z.ZodLiteral<"query">, z.ZodLiteral<"mutation">]>;
|
|
356
|
+
declare const TailorFieldSchema: z.ZodObject<{
|
|
357
|
+
type: z.ZodEnum<{
|
|
358
|
+
string: "string";
|
|
359
|
+
boolean: "boolean";
|
|
360
|
+
uuid: "uuid";
|
|
361
|
+
integer: "integer";
|
|
362
|
+
float: "float";
|
|
363
|
+
enum: "enum";
|
|
364
|
+
date: "date";
|
|
365
|
+
datetime: "datetime";
|
|
366
|
+
time: "time";
|
|
367
|
+
nested: "nested";
|
|
368
|
+
}>;
|
|
369
|
+
metadata: z.ZodObject<{
|
|
370
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
371
|
+
array: z.ZodOptional<z.ZodBoolean>;
|
|
372
|
+
description: z.ZodOptional<z.ZodString>;
|
|
373
|
+
allowedValues: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
374
|
+
value: z.ZodString;
|
|
375
|
+
description: z.ZodOptional<z.ZodString>;
|
|
376
|
+
}, z.core.$strip>>>;
|
|
377
|
+
hooks: z.ZodOptional<z.ZodObject<{
|
|
378
|
+
create: z.ZodOptional<z.ZodCustom<Function, Function>>;
|
|
379
|
+
update: z.ZodOptional<z.ZodCustom<Function, Function>>;
|
|
380
|
+
}, z.core.$strip>>;
|
|
381
|
+
typeName: z.ZodOptional<z.ZodString>;
|
|
410
382
|
}, z.core.$strip>;
|
|
411
|
-
|
|
412
|
-
issuerURL: z.ZodOptional<z.ZodString>;
|
|
413
|
-
usernameClaim: z.ZodOptional<z.ZodString>;
|
|
414
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
415
|
-
name: z.ZodString;
|
|
416
|
-
kind: z.ZodLiteral<"SAML">;
|
|
417
|
-
spCertBase64: z.ZodOptional<z.ZodObject<{
|
|
418
|
-
vaultName: z.ZodString;
|
|
419
|
-
secretKey: z.ZodString;
|
|
420
|
-
}, z.core.$strip>>;
|
|
421
|
-
spKeyBase64: z.ZodOptional<z.ZodObject<{
|
|
422
|
-
vaultName: z.ZodString;
|
|
423
|
-
secretKey: z.ZodString;
|
|
424
|
-
}, z.core.$strip>>;
|
|
425
|
-
metadataURL: z.ZodOptional<z.ZodString>;
|
|
426
|
-
rawMetadata: z.ZodOptional<z.ZodString>;
|
|
427
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
428
|
-
name: z.ZodString;
|
|
429
|
-
kind: z.ZodLiteral<"IDToken">;
|
|
430
|
-
providerURL: z.ZodString;
|
|
431
|
-
issuerURL: z.ZodOptional<z.ZodString>;
|
|
432
|
-
clientID: z.ZodString;
|
|
433
|
-
usernameClaim: z.ZodOptional<z.ZodString>;
|
|
434
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
435
|
-
name: z.ZodString;
|
|
436
|
-
kind: z.ZodLiteral<"BuiltInIdP">;
|
|
437
|
-
namespace: z.ZodString;
|
|
438
|
-
clientName: z.ZodString;
|
|
439
|
-
}, z.core.$strip>], "kind">;
|
|
440
|
-
declare const OAuth2ClientGrantTypeSchema: z.ZodUnion<readonly [z.ZodLiteral<"authorization_code">, z.ZodLiteral<"refresh_token">]>;
|
|
441
|
-
declare const OAuth2ClientSchema: z.ZodObject<{
|
|
442
|
-
description: z.ZodOptional<z.ZodString>;
|
|
443
|
-
grantTypes: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"authorization_code">, z.ZodLiteral<"refresh_token">]>>>;
|
|
444
|
-
redirectURIs: z.ZodArray<z.ZodUnion<readonly [z.ZodTemplateLiteral<`https://${string}`>, z.ZodTemplateLiteral<`http://${string}`>, z.ZodTemplateLiteral<`${string}:url`>, z.ZodTemplateLiteral<`${string}:url/${string}`>]>>;
|
|
445
|
-
clientType: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"confidential">, z.ZodLiteral<"public">, z.ZodLiteral<"browser">]>>;
|
|
446
|
-
accessTokenLifetimeSeconds: z.ZodPipe<z.ZodOptional<z.ZodNumber>, z.ZodTransform<{
|
|
447
|
-
seconds: bigint;
|
|
448
|
-
nanos: number;
|
|
449
|
-
} | undefined, number | undefined>>;
|
|
450
|
-
refreshTokenLifetimeSeconds: z.ZodPipe<z.ZodOptional<z.ZodNumber>, z.ZodTransform<{
|
|
451
|
-
seconds: bigint;
|
|
452
|
-
nanos: number;
|
|
453
|
-
} | undefined, number | undefined>>;
|
|
454
|
-
}, z.core.$strip>;
|
|
455
|
-
declare const SCIMAuthorizationSchema: z.ZodObject<{
|
|
456
|
-
type: z.ZodUnion<readonly [z.ZodLiteral<"oauth2">, z.ZodLiteral<"bearer">]>;
|
|
457
|
-
bearerSecret: z.ZodOptional<z.ZodObject<{
|
|
458
|
-
vaultName: z.ZodString;
|
|
459
|
-
secretKey: z.ZodString;
|
|
460
|
-
}, z.core.$strip>>;
|
|
383
|
+
fields: z.ZodRecord<z.ZodString, z.ZodObject< /*elided*/any, z.core.$strip>>;
|
|
461
384
|
}, z.core.$strip>;
|
|
462
|
-
declare const
|
|
463
|
-
|
|
464
|
-
type: z.ZodUnion<readonly [z.ZodLiteral<"string">, z.ZodLiteral<"number">, z.ZodLiteral<"boolean">, z.ZodLiteral<"datetime">, z.ZodLiteral<"complex">]>;
|
|
385
|
+
declare const ResolverSchema: z.ZodObject<{
|
|
386
|
+
operation: z.ZodUnion<readonly [z.ZodLiteral<"query">, z.ZodLiteral<"mutation">]>;
|
|
465
387
|
name: z.ZodString;
|
|
466
388
|
description: z.ZodOptional<z.ZodString>;
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
name: z.ZodString;
|
|
484
|
-
attributes: z.ZodArray<z.ZodObject<{
|
|
485
|
-
type: z.ZodUnion<readonly [z.ZodLiteral<"string">, z.ZodLiteral<"number">, z.ZodLiteral<"boolean">, z.ZodLiteral<"datetime">, z.ZodLiteral<"complex">]>;
|
|
486
|
-
name: z.ZodString;
|
|
389
|
+
input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
390
|
+
type: z.ZodEnum<{
|
|
391
|
+
string: "string";
|
|
392
|
+
boolean: "boolean";
|
|
393
|
+
uuid: "uuid";
|
|
394
|
+
integer: "integer";
|
|
395
|
+
float: "float";
|
|
396
|
+
enum: "enum";
|
|
397
|
+
date: "date";
|
|
398
|
+
datetime: "datetime";
|
|
399
|
+
time: "time";
|
|
400
|
+
nested: "nested";
|
|
401
|
+
}>;
|
|
402
|
+
metadata: z.ZodObject<{
|
|
403
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
404
|
+
array: z.ZodOptional<z.ZodBoolean>;
|
|
487
405
|
description: z.ZodOptional<z.ZodString>;
|
|
488
|
-
|
|
406
|
+
allowedValues: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
407
|
+
value: z.ZodString;
|
|
408
|
+
description: z.ZodOptional<z.ZodString>;
|
|
409
|
+
}, z.core.$strip>>>;
|
|
410
|
+
hooks: z.ZodOptional<z.ZodObject<{
|
|
411
|
+
create: z.ZodOptional<z.ZodCustom<Function, Function>>;
|
|
412
|
+
update: z.ZodOptional<z.ZodCustom<Function, Function>>;
|
|
413
|
+
}, z.core.$strip>>;
|
|
414
|
+
typeName: z.ZodOptional<z.ZodString>;
|
|
415
|
+
}, z.core.$strip>;
|
|
416
|
+
fields: z.ZodRecord<z.ZodString, z.ZodObject< /*elided*/any, z.core.$strip>>;
|
|
417
|
+
}, z.core.$strip>>>;
|
|
418
|
+
body: z.ZodCustom<Function, Function>;
|
|
419
|
+
output: z.ZodObject<{
|
|
420
|
+
type: z.ZodEnum<{
|
|
421
|
+
string: "string";
|
|
422
|
+
boolean: "boolean";
|
|
423
|
+
uuid: "uuid";
|
|
424
|
+
integer: "integer";
|
|
425
|
+
float: "float";
|
|
426
|
+
enum: "enum";
|
|
427
|
+
date: "date";
|
|
428
|
+
datetime: "datetime";
|
|
429
|
+
time: "time";
|
|
430
|
+
nested: "nested";
|
|
431
|
+
}>;
|
|
432
|
+
metadata: z.ZodObject<{
|
|
489
433
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
}, z.core.$strip>>;
|
|
495
|
-
}, z.core.$strip>;
|
|
496
|
-
attributeMapping: z.ZodArray<z.ZodObject<{
|
|
497
|
-
tailorDBField: z.ZodString;
|
|
498
|
-
scimPath: z.ZodString;
|
|
499
|
-
}, z.core.$strip>>;
|
|
500
|
-
}, z.core.$strip>;
|
|
501
|
-
declare const SCIMSchema: z.ZodObject<{
|
|
502
|
-
machineUserName: z.ZodString;
|
|
503
|
-
authorization: z.ZodObject<{
|
|
504
|
-
type: z.ZodUnion<readonly [z.ZodLiteral<"oauth2">, z.ZodLiteral<"bearer">]>;
|
|
505
|
-
bearerSecret: z.ZodOptional<z.ZodObject<{
|
|
506
|
-
vaultName: z.ZodString;
|
|
507
|
-
secretKey: z.ZodString;
|
|
508
|
-
}, z.core.$strip>>;
|
|
509
|
-
}, z.core.$strip>;
|
|
510
|
-
resources: z.ZodArray<z.ZodObject<{
|
|
511
|
-
name: z.ZodString;
|
|
512
|
-
tailorDBNamespace: z.ZodString;
|
|
513
|
-
tailorDBType: z.ZodString;
|
|
514
|
-
coreSchema: z.ZodObject<{
|
|
515
|
-
name: z.ZodString;
|
|
516
|
-
attributes: z.ZodArray<z.ZodObject<{
|
|
517
|
-
type: z.ZodUnion<readonly [z.ZodLiteral<"string">, z.ZodLiteral<"number">, z.ZodLiteral<"boolean">, z.ZodLiteral<"datetime">, z.ZodLiteral<"complex">]>;
|
|
518
|
-
name: z.ZodString;
|
|
434
|
+
array: z.ZodOptional<z.ZodBoolean>;
|
|
435
|
+
description: z.ZodOptional<z.ZodString>;
|
|
436
|
+
allowedValues: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
437
|
+
value: z.ZodString;
|
|
519
438
|
description: z.ZodOptional<z.ZodString>;
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
canonicalValues: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
525
|
-
subAttributes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject< /*elided*/any, z.core.$strip>>>>;
|
|
439
|
+
}, z.core.$strip>>>;
|
|
440
|
+
hooks: z.ZodOptional<z.ZodObject<{
|
|
441
|
+
create: z.ZodOptional<z.ZodCustom<Function, Function>>;
|
|
442
|
+
update: z.ZodOptional<z.ZodCustom<Function, Function>>;
|
|
526
443
|
}, z.core.$strip>>;
|
|
444
|
+
typeName: z.ZodOptional<z.ZodString>;
|
|
527
445
|
}, z.core.$strip>;
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
scimPath: z.ZodString;
|
|
531
|
-
}, z.core.$strip>>;
|
|
532
|
-
}, z.core.$strip>>;
|
|
533
|
-
}, z.core.$strip>;
|
|
534
|
-
declare const TenantProviderSchema: z.ZodObject<{
|
|
535
|
-
namespace: z.ZodString;
|
|
536
|
-
type: z.ZodString;
|
|
537
|
-
signatureField: z.ZodString;
|
|
446
|
+
fields: z.ZodRecord<z.ZodString, z.ZodObject< /*elided*/any, z.core.$strip>>;
|
|
447
|
+
}, z.core.$strip>;
|
|
538
448
|
}, z.core.$strip>;
|
|
539
449
|
//#endregion
|
|
540
|
-
//#region src/parser/service/
|
|
541
|
-
type
|
|
542
|
-
type
|
|
543
|
-
type
|
|
544
|
-
type
|
|
545
|
-
|
|
546
|
-
type
|
|
547
|
-
|
|
548
|
-
type
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
type
|
|
555
|
-
|
|
556
|
-
type
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
450
|
+
//#region src/parser/service/resolver/types.d.ts
|
|
451
|
+
type TailorFieldInput = z.input<typeof TailorFieldSchema>;
|
|
452
|
+
type QueryType = z.output<typeof QueryTypeSchema>;
|
|
453
|
+
type ResolverInput = z.input<typeof ResolverSchema>;
|
|
454
|
+
type Resolver = z.output<typeof ResolverSchema>;
|
|
455
|
+
//#endregion
|
|
456
|
+
//#region src/configure/types/type.d.ts
|
|
457
|
+
declare class TailorField<const Defined extends DefinedFieldMetadata = DefinedFieldMetadata, const Output = any, M extends FieldMetadata = FieldMetadata> implements TailorFieldInput {
|
|
458
|
+
readonly type: TailorFieldType;
|
|
459
|
+
readonly fields: Record<string, TailorField<any>>;
|
|
460
|
+
protected _metadata: M;
|
|
461
|
+
readonly _defined: Defined;
|
|
462
|
+
readonly _output: Output;
|
|
463
|
+
get metadata(): M;
|
|
464
|
+
protected constructor(type: TailorFieldType, options?: FieldOptions, fields?: Record<string, TailorField<any>>, values?: AllowedValues);
|
|
465
|
+
static create<const TType extends TailorFieldType, const TOptions extends FieldOptions, const OutputBase = TailorToTs[TType]>(type: TType, options?: TOptions, fields?: Record<string, TailorField<any>>, values?: AllowedValues): TailorField<{
|
|
466
|
+
type: TType;
|
|
467
|
+
array: TOptions extends {
|
|
468
|
+
array: true;
|
|
469
|
+
} ? true : false;
|
|
470
|
+
}, FieldOutput<OutputBase, TOptions>, FieldMetadata>;
|
|
471
|
+
description<CurrentDefined extends Defined>(this: CurrentDefined extends {
|
|
472
|
+
description: unknown;
|
|
473
|
+
} ? never : TailorField<CurrentDefined, Output>, description: string): TailorField<Prettify<CurrentDefined & {
|
|
474
|
+
description: true;
|
|
475
|
+
}>, Output>;
|
|
476
|
+
typeName<CurrentDefined extends Defined>(this: CurrentDefined extends {
|
|
477
|
+
typeName: unknown;
|
|
478
|
+
} ? never : CurrentDefined extends {
|
|
479
|
+
type: "enum" | "nested";
|
|
480
|
+
} ? TailorField<CurrentDefined, Output> : never, typeName: string): TailorField<Prettify<CurrentDefined & {
|
|
481
|
+
typeName: true;
|
|
482
|
+
}>, Output>;
|
|
483
|
+
validate<CurrentDefined extends Defined>(this: CurrentDefined extends {
|
|
484
|
+
validate: unknown;
|
|
485
|
+
} ? never : TailorField<CurrentDefined, Output>, ...validate: FieldValidateInput<Output>[]): TailorField<Prettify<CurrentDefined & {
|
|
486
|
+
validate: true;
|
|
487
|
+
}>, Output>;
|
|
488
|
+
/**
|
|
489
|
+
* Parse and validate a value against this field's validation rules
|
|
490
|
+
* Returns StandardSchema Result type with success or failure
|
|
491
|
+
*/
|
|
492
|
+
parse(args: {
|
|
493
|
+
value: any;
|
|
494
|
+
data: any;
|
|
495
|
+
user: TailorUser;
|
|
496
|
+
}): StandardSchemaV1.Result<Output>;
|
|
497
|
+
/**
|
|
498
|
+
* Validate a single value (not an array element)
|
|
499
|
+
* Used internally for array element validation
|
|
500
|
+
* @private
|
|
501
|
+
*/
|
|
502
|
+
private _validateValue;
|
|
503
|
+
/**
|
|
504
|
+
* Internal parse method that tracks field path for nested validation
|
|
505
|
+
* @private
|
|
506
|
+
*/
|
|
507
|
+
private _parseInternal;
|
|
508
|
+
}
|
|
509
|
+
//#endregion
|
|
510
|
+
//#region src/configure/types/user.d.ts
|
|
511
|
+
interface AttributeMap {}
|
|
512
|
+
interface AttributeList {
|
|
513
|
+
__tuple?: [];
|
|
514
|
+
}
|
|
515
|
+
type InferredAttributeMap = keyof AttributeMap extends never ? Record<string, string | string[] | boolean | boolean[] | undefined> : AttributeMap;
|
|
516
|
+
type InferredAttributeList = AttributeList["__tuple"] extends [] ? string[] : AttributeList["__tuple"];
|
|
517
|
+
/** Represents a user in the Tailor platform. */
|
|
518
|
+
type TailorUser = {
|
|
519
|
+
/**
|
|
520
|
+
* The ID of the user.
|
|
521
|
+
* For unauthenticated users, this will be a nil UUID.
|
|
522
|
+
*/
|
|
523
|
+
id: string;
|
|
524
|
+
/**
|
|
525
|
+
* The type of the user.
|
|
526
|
+
* For unauthenticated users, this will be an empty string.
|
|
527
|
+
*/
|
|
528
|
+
type: "user" | "machine_user" | "";
|
|
529
|
+
/** The ID of the workspace the user belongs to. */
|
|
530
|
+
workspaceId: string;
|
|
531
|
+
/**
|
|
532
|
+
* A map of the user's attributes.
|
|
533
|
+
* For unauthenticated users, this will be null.
|
|
534
|
+
*/
|
|
535
|
+
attributes: InferredAttributeMap | null;
|
|
536
|
+
/**
|
|
537
|
+
* A list of the user's attributes.
|
|
538
|
+
* For unauthenticated users, this will be an empty array.
|
|
539
|
+
*/
|
|
540
|
+
attributeList: InferredAttributeList;
|
|
607
541
|
};
|
|
542
|
+
/** Represents an unauthenticated user in the Tailor platform. */
|
|
543
|
+
declare const unauthenticatedTailorUser: TailorUser;
|
|
544
|
+
//#endregion
|
|
545
|
+
//#region src/configure/types/env.d.ts
|
|
546
|
+
interface Env {}
|
|
547
|
+
/** Represents environment variables in the Tailor platform. */
|
|
548
|
+
type TailorEnv = keyof Env extends never ? Record<string, string> : Env;
|
|
608
549
|
//#endregion
|
|
609
550
|
//#region src/configure/services/auth/index.d.ts
|
|
610
551
|
declare const authDefinitionBrand: unique symbol;
|
|
@@ -656,68 +597,38 @@ type AuthOwnConfig = ReturnType<typeof defineAuth<string, any, any, any, string>
|
|
|
656
597
|
type AuthConfig = AuthOwnConfig | AuthExternalConfig;
|
|
657
598
|
//#endregion
|
|
658
599
|
//#region src/configure/services/tailordb/permission.d.ts
|
|
659
|
-
interface Permissions {
|
|
660
|
-
record?: StandardTailorTypePermission;
|
|
661
|
-
gql?: StandardTailorTypeGqlPermission;
|
|
662
|
-
}
|
|
663
600
|
type TailorTypePermission<User extends object = InferredAttributeMap, Type extends object = object> = {
|
|
664
601
|
create: readonly ActionPermission<"record", User, Type, false>[];
|
|
665
602
|
read: readonly ActionPermission<"record", User, Type, false>[];
|
|
666
603
|
update: readonly ActionPermission<"record", User, Type, true>[];
|
|
667
604
|
delete: readonly ActionPermission<"record", User, Type, false>[];
|
|
668
605
|
};
|
|
669
|
-
type StandardTailorTypePermission = {
|
|
670
|
-
create: readonly StandardActionPermission<"record", false>[];
|
|
671
|
-
read: readonly StandardActionPermission<"record", false>[];
|
|
672
|
-
update: readonly StandardActionPermission<"record", true>[];
|
|
673
|
-
delete: readonly StandardActionPermission<"record", false>[];
|
|
674
|
-
};
|
|
675
606
|
type ActionPermission<Level extends "record" | "gql" = "record" | "gql", User extends object = InferredAttributeMap, Type extends object = object, Update extends boolean = boolean> = {
|
|
676
607
|
conditions: PermissionCondition<Level, User, Update, Type> | readonly PermissionCondition<Level, User, Update, Type>[];
|
|
677
608
|
description?: string | undefined;
|
|
678
609
|
permit?: boolean;
|
|
679
610
|
} | readonly [...PermissionCondition<Level, User, Update, Type>, ...([] | [boolean])] | readonly [...PermissionCondition<Level, User, Update, Type>[], ...([] | [boolean])];
|
|
680
|
-
type StandardActionPermission<Level extends "record" | "gql" = "record" | "gql", Update extends boolean = boolean> = {
|
|
681
|
-
conditions: readonly StandardPermissionCondition<Level, Update>[];
|
|
682
|
-
description?: string;
|
|
683
|
-
permit: "allow" | "deny";
|
|
684
|
-
};
|
|
685
611
|
type TailorTypeGqlPermission<User extends object = InferredAttributeMap, Type extends object = object> = readonly GqlPermissionPolicy<User, Type>[];
|
|
686
|
-
type StandardTailorTypeGqlPermission = readonly StandardGqlPermissionPolicy[];
|
|
687
612
|
type GqlPermissionPolicy<User extends object = InferredAttributeMap, Type extends object = object> = {
|
|
688
613
|
conditions: readonly PermissionCondition<"gql", User, boolean, Type>[];
|
|
689
|
-
actions: "all" | readonly GqlPermissionAction[];
|
|
614
|
+
actions: "all" | readonly GqlPermissionAction$1[];
|
|
690
615
|
permit?: boolean;
|
|
691
616
|
description?: string;
|
|
692
617
|
};
|
|
693
|
-
type
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
permit: "allow" | "deny";
|
|
697
|
-
description?: string;
|
|
698
|
-
};
|
|
699
|
-
type GqlPermissionAction = "read" | "create" | "update" | "delete" | "aggregate" | "bulkUpsert";
|
|
700
|
-
type PermissionCondition<Level extends "record" | "gql" = "record" | "gql", User extends object = InferredAttributeMap, Update extends boolean = boolean, Type extends object = object> = readonly [PermissionOperand<Level, User, Type, Update>, PermissionOperator, PermissionOperand<Level, User, Type, Update>];
|
|
701
|
-
type StandardPermissionCondition<Level extends "record" | "gql" = "record" | "gql", Update extends boolean = boolean> = readonly [PermissionOperand<Level, Record<string, unknown>, Record<string, unknown>, Update>, StandardPermissionOperator, PermissionOperand<Level, Record<string, unknown>, Record<string, unknown>, Update>];
|
|
702
|
-
type UserOperand<User extends object = InferredAttributeMap> = {
|
|
618
|
+
type GqlPermissionAction$1 = "read" | "create" | "update" | "delete" | "aggregate" | "bulkUpsert";
|
|
619
|
+
type PermissionCondition<Level extends "record" | "gql" = "record" | "gql", User extends object = InferredAttributeMap, Update extends boolean = boolean, Type extends object = object> = readonly [PermissionOperand$1<Level, User, Type, Update>, PermissionOperator, PermissionOperand$1<Level, User, Type, Update>];
|
|
620
|
+
type UserOperand$1<User extends object = InferredAttributeMap> = {
|
|
703
621
|
user: { [K in keyof User]: User[K] extends string | string[] | boolean | boolean[] ? K : never }[keyof User] | "id" | "_loggedIn";
|
|
704
622
|
};
|
|
705
|
-
type RecordOperand<Type extends object, Update extends boolean = false> = Update extends true ? {
|
|
623
|
+
type RecordOperand$1<Type extends object, Update extends boolean = false> = Update extends true ? {
|
|
706
624
|
oldRecord: (keyof Type & string) | "id";
|
|
707
625
|
} | {
|
|
708
626
|
newRecord: (keyof Type & string) | "id";
|
|
709
627
|
} : {
|
|
710
628
|
record: (keyof Type & string) | "id";
|
|
711
629
|
};
|
|
712
|
-
type PermissionOperand<Level extends "record" | "gql" = "record" | "gql", User extends object = InferredAttributeMap, Type extends object = object, Update extends boolean = boolean> = UserOperand<User> | ValueOperand | (Level extends "record" ? RecordOperand<Type, Update> : never);
|
|
630
|
+
type PermissionOperand$1<Level extends "record" | "gql" = "record" | "gql", User extends object = InferredAttributeMap, Type extends object = object, Update extends boolean = boolean> = UserOperand$1<User> | ValueOperand | (Level extends "record" ? RecordOperand$1<Type, Update> : never);
|
|
713
631
|
type PermissionOperator = "=" | "!=" | "in" | "not in";
|
|
714
|
-
declare const operatorMap: {
|
|
715
|
-
readonly "=": "eq";
|
|
716
|
-
readonly "!=": "ne";
|
|
717
|
-
readonly in: "in";
|
|
718
|
-
readonly "not in": "nin";
|
|
719
|
-
};
|
|
720
|
-
type StandardPermissionOperator = (typeof operatorMap)[keyof typeof operatorMap];
|
|
721
632
|
/**
|
|
722
633
|
* Grants full record-level access without any conditions.
|
|
723
634
|
*
|
|
@@ -735,27 +646,6 @@ declare const unsafeAllowAllTypePermission: TailorTypePermission;
|
|
|
735
646
|
*/
|
|
736
647
|
declare const unsafeAllowAllGqlPermission: TailorTypeGqlPermission;
|
|
737
648
|
//#endregion
|
|
738
|
-
//#region src/configure/services/tailordb/operator-types.d.ts
|
|
739
|
-
interface TailorDBTypeConfig {
|
|
740
|
-
name: string;
|
|
741
|
-
schema: {
|
|
742
|
-
description?: string;
|
|
743
|
-
extends: boolean;
|
|
744
|
-
fields: Record<string, OperatorFieldConfig>;
|
|
745
|
-
settings?: {
|
|
746
|
-
pluralForm?: string;
|
|
747
|
-
aggregation?: boolean;
|
|
748
|
-
bulkUpsert?: boolean;
|
|
749
|
-
};
|
|
750
|
-
permissions: Permissions;
|
|
751
|
-
files: Record<string, string>;
|
|
752
|
-
indexes?: Record<string, {
|
|
753
|
-
fields: string[];
|
|
754
|
-
unique?: boolean;
|
|
755
|
-
}>;
|
|
756
|
-
};
|
|
757
|
-
}
|
|
758
|
-
//#endregion
|
|
759
649
|
//#region src/configure/services/tailordb/types.d.ts
|
|
760
650
|
type SerialConfig<T$1 extends "string" | "integer" = "string" | "integer"> = Prettify<{
|
|
761
651
|
start: number;
|
|
@@ -829,6 +719,142 @@ interface TypeFeatures {
|
|
|
829
719
|
bulkUpsert?: true;
|
|
830
720
|
}
|
|
831
721
|
//#endregion
|
|
722
|
+
//#region src/parser/service/tailordb/types.d.ts
|
|
723
|
+
interface Script {
|
|
724
|
+
expr: string;
|
|
725
|
+
}
|
|
726
|
+
interface EnumValue {
|
|
727
|
+
value: string;
|
|
728
|
+
description?: string;
|
|
729
|
+
}
|
|
730
|
+
interface OperatorValidateConfig {
|
|
731
|
+
script: Script;
|
|
732
|
+
errorMessage: string;
|
|
733
|
+
}
|
|
734
|
+
interface OperatorFieldHook {
|
|
735
|
+
create?: Script;
|
|
736
|
+
update?: Script;
|
|
737
|
+
}
|
|
738
|
+
interface OperatorFieldConfig {
|
|
739
|
+
type: string;
|
|
740
|
+
required?: boolean;
|
|
741
|
+
description?: string;
|
|
742
|
+
allowedValues?: EnumValue[];
|
|
743
|
+
array?: boolean;
|
|
744
|
+
index?: boolean;
|
|
745
|
+
unique?: boolean;
|
|
746
|
+
vector?: boolean;
|
|
747
|
+
foreignKey?: boolean;
|
|
748
|
+
foreignKeyType?: string;
|
|
749
|
+
foreignKeyField?: string;
|
|
750
|
+
validate?: OperatorValidateConfig[];
|
|
751
|
+
hooks?: OperatorFieldHook;
|
|
752
|
+
serial?: {
|
|
753
|
+
start: number;
|
|
754
|
+
maxValue?: number;
|
|
755
|
+
format?: string;
|
|
756
|
+
};
|
|
757
|
+
fields?: Record<string, OperatorFieldConfig>;
|
|
758
|
+
}
|
|
759
|
+
type GqlPermissionAction = "read" | "create" | "update" | "delete" | "aggregate" | "bulkUpsert";
|
|
760
|
+
type StandardPermissionOperator = "eq" | "ne" | "in" | "nin";
|
|
761
|
+
type UserOperand = {
|
|
762
|
+
user: string;
|
|
763
|
+
};
|
|
764
|
+
type RecordOperand<Update extends boolean = false> = Update extends true ? {
|
|
765
|
+
oldRecord: string;
|
|
766
|
+
} | {
|
|
767
|
+
newRecord: string;
|
|
768
|
+
} : {
|
|
769
|
+
record: string;
|
|
770
|
+
};
|
|
771
|
+
type PermissionOperand<Level extends "record" | "gql" = "record" | "gql", Update extends boolean = boolean> = UserOperand | ValueOperand | (Level extends "record" ? RecordOperand<Update> : never);
|
|
772
|
+
type StandardPermissionCondition<Level extends "record" | "gql" = "record" | "gql", Update extends boolean = boolean> = readonly [PermissionOperand<Level, Update>, StandardPermissionOperator, PermissionOperand<Level, Update>];
|
|
773
|
+
type StandardActionPermission<Level extends "record" | "gql" = "record" | "gql", Update extends boolean = boolean> = {
|
|
774
|
+
conditions: readonly StandardPermissionCondition<Level, Update>[];
|
|
775
|
+
description?: string;
|
|
776
|
+
permit: "allow" | "deny";
|
|
777
|
+
};
|
|
778
|
+
type StandardTailorTypePermission = {
|
|
779
|
+
create: readonly StandardActionPermission<"record", false>[];
|
|
780
|
+
read: readonly StandardActionPermission<"record", false>[];
|
|
781
|
+
update: readonly StandardActionPermission<"record", true>[];
|
|
782
|
+
delete: readonly StandardActionPermission<"record", false>[];
|
|
783
|
+
};
|
|
784
|
+
type StandardGqlPermissionPolicy = {
|
|
785
|
+
conditions: readonly StandardPermissionCondition<"gql">[];
|
|
786
|
+
actions: readonly ["all"] | readonly GqlPermissionAction[];
|
|
787
|
+
permit: "allow" | "deny";
|
|
788
|
+
description?: string;
|
|
789
|
+
};
|
|
790
|
+
type StandardTailorTypeGqlPermission = readonly StandardGqlPermissionPolicy[];
|
|
791
|
+
interface Permissions {
|
|
792
|
+
record?: StandardTailorTypePermission;
|
|
793
|
+
gql?: StandardTailorTypeGqlPermission;
|
|
794
|
+
}
|
|
795
|
+
interface TailorDBTypeMetadata {
|
|
796
|
+
name: string;
|
|
797
|
+
description?: string;
|
|
798
|
+
settings?: {
|
|
799
|
+
pluralForm?: string;
|
|
800
|
+
aggregation?: boolean;
|
|
801
|
+
bulkUpsert?: boolean;
|
|
802
|
+
};
|
|
803
|
+
permissions: Permissions;
|
|
804
|
+
files: Record<string, string>;
|
|
805
|
+
indexes?: Record<string, {
|
|
806
|
+
fields: string[];
|
|
807
|
+
unique?: boolean;
|
|
808
|
+
}>;
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
811
|
+
* Parsed and normalized TailorDB field information
|
|
812
|
+
*/
|
|
813
|
+
interface ParsedField {
|
|
814
|
+
name: string;
|
|
815
|
+
config: OperatorFieldConfig;
|
|
816
|
+
relation?: {
|
|
817
|
+
targetType: string;
|
|
818
|
+
forwardName: string;
|
|
819
|
+
backwardName: string;
|
|
820
|
+
key: string;
|
|
821
|
+
unique: boolean;
|
|
822
|
+
};
|
|
823
|
+
}
|
|
824
|
+
/**
|
|
825
|
+
* Parsed and normalized TailorDB relationship information
|
|
826
|
+
*/
|
|
827
|
+
interface ParsedRelationship {
|
|
828
|
+
name: string;
|
|
829
|
+
targetType: string;
|
|
830
|
+
targetField: string;
|
|
831
|
+
sourceField: string;
|
|
832
|
+
isArray: boolean;
|
|
833
|
+
description: string;
|
|
834
|
+
}
|
|
835
|
+
/**
|
|
836
|
+
* Parsed and normalized TailorDB type information
|
|
837
|
+
*/
|
|
838
|
+
interface ParsedTailorDBType {
|
|
839
|
+
name: string;
|
|
840
|
+
pluralForm: string;
|
|
841
|
+
description?: string;
|
|
842
|
+
fields: Record<string, ParsedField>;
|
|
843
|
+
forwardRelationships: Record<string, ParsedRelationship>;
|
|
844
|
+
backwardRelationships: Record<string, ParsedRelationship>;
|
|
845
|
+
settings: TailorDBTypeMetadata["settings"];
|
|
846
|
+
permissions: TailorDBTypeMetadata["permissions"];
|
|
847
|
+
indexes?: TailorDBTypeMetadata["indexes"];
|
|
848
|
+
files?: TailorDBTypeMetadata["files"];
|
|
849
|
+
}
|
|
850
|
+
//#endregion
|
|
851
|
+
//#region src/configure/types/field.d.ts
|
|
852
|
+
type AllowedValue = EnumValue;
|
|
853
|
+
type AllowedValues = [string | EnumValue, ...(string | EnumValue)[]];
|
|
854
|
+
type AllowedValuesOutput<V extends AllowedValues> = V[number] extends infer T ? T extends string ? T : T extends {
|
|
855
|
+
value: infer K;
|
|
856
|
+
} ? K : never : never;
|
|
857
|
+
//#endregion
|
|
832
858
|
//#region src/configure/services/tailordb/schema.d.ts
|
|
833
859
|
type RelationType = "oneToOne" | "1-1" | "manyToOne" | "n-1" | "N-1" | "keyOnly";
|
|
834
860
|
interface RelationConfig<S extends RelationType, T$1 extends TailorDBType> {
|
|
@@ -875,14 +901,13 @@ declare class TailorDBField<const Defined extends DefinedDBFieldMetadata, const
|
|
|
875
901
|
validate?: FieldValidateInput<any>[];
|
|
876
902
|
typeName?: string;
|
|
877
903
|
};
|
|
878
|
-
get config(): OperatorFieldConfig;
|
|
879
904
|
private constructor();
|
|
880
905
|
static create<const T$1 extends TailorFieldType, const TOptions extends FieldOptions, const OutputBase = TailorToTs[T$1]>(type: T$1, options?: TOptions, fields?: Record<string, TailorDBField<any, any>>, values?: AllowedValues): TailorDBField<{
|
|
881
906
|
type: T$1;
|
|
882
907
|
array: TOptions extends {
|
|
883
908
|
array: true;
|
|
884
909
|
} ? true : false;
|
|
885
|
-
}, FieldOutput
|
|
910
|
+
}, FieldOutput<OutputBase, TOptions>>;
|
|
886
911
|
description<CurrentDefined extends Defined>(this: CurrentDefined extends {
|
|
887
912
|
description: unknown;
|
|
888
913
|
} ? never : TailorField<CurrentDefined, Output>, description: string): TailorDBField<Prettify<CurrentDefined & {
|
|
@@ -968,7 +993,7 @@ declare class TailorDBField<const Defined extends DefinedDBFieldMetadata, const
|
|
|
968
993
|
array: NewOpt extends {
|
|
969
994
|
array: true;
|
|
970
995
|
} ? true : Defined["array"];
|
|
971
|
-
}>, FieldOutput
|
|
996
|
+
}>, FieldOutput<TailorToTs[Defined["type"]], NewOpt>>;
|
|
972
997
|
}
|
|
973
998
|
declare function uuid<const Opt extends FieldOptions>(options?: Opt): TailorDBField<{
|
|
974
999
|
type: "uuid";
|
|
@@ -1023,13 +1048,13 @@ declare function _enum<const V extends AllowedValues, const Opt extends FieldOpt
|
|
|
1023
1048
|
array: Opt extends {
|
|
1024
1049
|
array: true;
|
|
1025
1050
|
} ? true : false;
|
|
1026
|
-
}, FieldOutput
|
|
1051
|
+
}, FieldOutput<AllowedValuesOutput<V>, Opt>>;
|
|
1027
1052
|
declare function object<const F extends Record<string, TailorDBField<any, any>> & ExcludeNestedDBFields<F>, const Opt extends FieldOptions>(fields: F, options?: Opt): TailorDBField<{
|
|
1028
1053
|
type: "nested";
|
|
1029
1054
|
array: Opt extends {
|
|
1030
1055
|
array: true;
|
|
1031
1056
|
} ? true : false;
|
|
1032
|
-
}, FieldOutput
|
|
1057
|
+
}, FieldOutput<InferFieldsOutput<F>, Opt>>;
|
|
1033
1058
|
declare class TailorDBType<const Fields extends Record<string, TailorDBField<any, any>> = any, User extends object = InferredAttributeMap> {
|
|
1034
1059
|
readonly name: string;
|
|
1035
1060
|
readonly fields: Fields;
|
|
@@ -1043,7 +1068,7 @@ declare class TailorDBType<const Fields extends Record<string, TailorDBField<any
|
|
|
1043
1068
|
pluralForm?: string;
|
|
1044
1069
|
description?: string;
|
|
1045
1070
|
});
|
|
1046
|
-
get metadata():
|
|
1071
|
+
get metadata(): TailorDBTypeMetadata;
|
|
1047
1072
|
hooks(hooks: Hooks<Fields>): this;
|
|
1048
1073
|
validate(validators: Validators<Fields>): this;
|
|
1049
1074
|
features(features: Omit<TypeFeatures, "pluralForm">): this;
|
|
@@ -1062,7 +1087,7 @@ declare class TailorDBType<const Fields extends Record<string, TailorDBField<any
|
|
|
1062
1087
|
array: Opt extends {
|
|
1063
1088
|
array: true;
|
|
1064
1089
|
} ? true : D["array"];
|
|
1065
|
-
}, FieldOutput
|
|
1090
|
+
}, FieldOutput<TailorToTs[D["type"]], Opt>> : never };
|
|
1066
1091
|
/**
|
|
1067
1092
|
* Omit specific fields from the type
|
|
1068
1093
|
* @param keys - Array of field keys to omit
|
|
@@ -1385,12 +1410,12 @@ declare function defineGenerators(...configs: GeneratorConfig[]): (["@tailor-pla
|
|
|
1385
1410
|
}] | {
|
|
1386
1411
|
id: string;
|
|
1387
1412
|
description: string;
|
|
1388
|
-
processType:
|
|
1389
|
-
processResolver:
|
|
1390
|
-
processExecutor:
|
|
1391
|
-
aggregate:
|
|
1392
|
-
processTailorDBNamespace?:
|
|
1393
|
-
processResolverNamespace?:
|
|
1413
|
+
processType: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod_v4_core0.$ZodFunctionOut>;
|
|
1414
|
+
processResolver: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod_v4_core0.$ZodFunctionOut>;
|
|
1415
|
+
processExecutor: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod_v4_core0.$ZodFunctionOut>;
|
|
1416
|
+
aggregate: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod0.ZodAny>;
|
|
1417
|
+
processTailorDBNamespace?: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod_v4_core0.$ZodFunctionOut> | undefined;
|
|
1418
|
+
processResolverNamespace?: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod_v4_core0.$ZodFunctionOut> | undefined;
|
|
1394
1419
|
})[];
|
|
1395
1420
|
//#endregion
|
|
1396
1421
|
//#region src/parser/service/executor/schema.d.ts
|
|
@@ -1528,5 +1553,5 @@ type WorkflowOperation = z.infer<typeof WorkflowOperationSchema>;
|
|
|
1528
1553
|
type Executor = z.infer<typeof ExecutorSchema>;
|
|
1529
1554
|
type ExecutorInput = z.input<typeof ExecutorSchema>;
|
|
1530
1555
|
//#endregion
|
|
1531
|
-
export {
|
|
1532
|
-
//# sourceMappingURL=types-
|
|
1556
|
+
export { Resolver as $, TailorDBType as A, AuthConfig as B, ResolverExternalConfig as C, UsernameFieldKey as Ct, ExecutorServiceInput as D, output as Dt, ExecutorServiceConfig as E, JsonCompatible as Et, PermissionCondition as F, Env as G, AuthInvoker as H, TailorTypeGqlPermission as I, AttributeMap as J, TailorEnv as K, TailorTypePermission as L, AllowedValues as M, AllowedValuesOutput as N, TailorDBField as O, ParsedTailorDBType as P, QueryType as Q, unsafeAllowAllGqlPermission as R, defineIdp as S, UserAttributeMap as St, ResolverServiceInput as T, InferFieldsOutput as Tt, AuthOwnConfig as U, AuthExternalConfig as V, defineAuth as W, unauthenticatedTailorUser as X, TailorUser as Y, TailorField as Z, WorkflowServiceInput as _, SCIMConfig as _t, IncomingWebhookTrigger as a, AuthServiceInput as at, IdPConfig as b, UserAttributeKey as bt, ScheduleTriggerInput as c, IdProviderConfig as ct, AppConfig as d, OIDC as dt, ResolverInput as et, defineConfig as f, SAML as ft, WorkflowServiceConfig as g, SCIMAuthorization as gt, Generator as h, SCIMAttributeType as ht, GqlOperation as i, FieldOutput as it, db as j, TailorDBInstance as k, WebhookOperation as l, OAuth2ClientGrantType as lt, CodeGeneratorBase as m, SCIMAttributeMapping as mt, ExecutorInput as n, FieldMetadata as nt, RecordTrigger as o, BuiltinIdP as ot, defineGenerators as p, SCIMAttribute as pt, AttributeList as q, FunctionOperation as r, FieldOptions as rt, ResolverExecutedTrigger as s, IDToken as st, Executor as t, ArrayFieldOutput as tt, WorkflowOperation as u, OAuth2ClientInput as ut, StaticWebsiteConfig as v, SCIMResource as vt, ResolverServiceConfig as w, ValueOperand as wt, IdPExternalConfig as x, UserAttributeListKey as xt, defineStaticWebSite as y, TenantProviderConfig as yt, unsafeAllowAllTypePermission as z };
|
|
1557
|
+
//# sourceMappingURL=types-DkG_CWKo.d.mts.map
|