@tailor-platform/sdk 2.36.0 → 2.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +72 -0
- package/dist/{application-DaJbleMi.mjs → application-83WVdH85.mjs} +1 -1
- package/dist/{application-BbORWCj-.mjs → application-Cida-j1g.mjs} +36 -36
- package/dist/application-Cida-j1g.mjs.map +1 -0
- package/dist/cli/commands/deploy/deploy.d.mts +6 -1
- package/dist/cli/commands/deploy/tailordb/migration-validation.d.mts +1 -0
- package/dist/cli/commands/executor/jobs.d.mts +3 -0
- package/dist/cli/commands/tailordb/migrate/bundler.d.mts +3 -0
- package/dist/cli/commands/tailordb/migrate/config.d.mts +4 -0
- package/dist/cli/commands/tailordb/migrate/diff-calculator.d.mts +10 -0
- package/dist/cli/commands/tailordb/migrate/generate.d.mts +28 -2
- package/dist/cli/commands/tailordb/migrate/hints.d.mts +1 -0
- package/dist/cli/commands/tailordb/migrate/remote-state.d.mts +3 -0
- package/dist/cli/commands/tailordb/migrate/schema-checks.d.mts +3 -1
- package/dist/cli/commands/tailordb/migrate/snapshot-comparison.d.mts +4 -0
- package/dist/cli/commands/tailordb/migrate/snapshot-files.d.mts +44 -6
- package/dist/cli/commands/tailordb/migrate/snapshot-local.d.mts +2 -0
- package/dist/cli/commands/tailordb/migrate/snapshot-migrations.d.mts +2 -0
- package/dist/cli/commands/tailordb/migrate/snapshot-types.d.mts +8 -0
- package/dist/cli/commands/tailordb/migrate/types.d.mts +2 -0
- package/dist/cli/commands/workspace/create.d.mts +1 -1
- package/dist/cli/lib.d.mts +2 -2
- package/dist/cli/lib.mjs +1 -1
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/main.mjs +52 -51
- package/dist/cli/main.mjs.map +1 -1
- package/dist/cli/shared/client.d.mts +26 -0
- package/dist/cli/shared/function-execution.d.mts +2 -0
- package/dist/cli/shared/prompt.d.mts +9 -4
- package/dist/completion/zsh-worker.zsh +21 -13
- package/dist/configure/config/index.d.mts +2 -0
- package/dist/configure/config/types.d.mts +2 -0
- package/dist/configure/index.mjs.map +1 -1
- package/dist/configure/services/tailordb/schema.d.mts +1 -0
- package/dist/configure/services/tailordb/types.d.mts +3 -0
- package/dist/crashreport-C2AcQNTe.mjs +1 -0
- package/dist/{crashreport-DGU6lwiX.mjs → crashreport-D_wf4GZh.mjs} +4 -4
- package/dist/{crashreport-DGU6lwiX.mjs.map → crashreport-D_wf4GZh.mjs.map} +1 -1
- package/dist/date-representation-Cr7W7Pn2.mjs.map +1 -1
- package/dist/{errors-BXmGBX-7.mjs → errors-Dmdnq0zi.mjs} +2 -2
- package/dist/errors-Dmdnq0zi.mjs.map +1 -0
- package/dist/{kysely-type-B0ri1-Xs.mjs → kysely-type-DVL90_oX.mjs} +6 -6
- package/dist/kysely-type-DVL90_oX.mjs.map +1 -0
- package/dist/plugin/builtin/kysely-type/index.mjs +1 -1
- package/dist/plugin/builtin/seed/seed-type-processor.d.mts +4 -3
- package/dist/plugin/get-generated-table.d.mts +4 -0
- package/dist/plugin/index.mjs.map +1 -1
- package/dist/plugin/types.d.mts +55 -3
- package/dist/plugin/with-context.d.mts +16 -0
- package/dist/register-ts-hook-Ht4zCseV.mjs +1115 -0
- package/dist/register-ts-hook-Ht4zCseV.mjs.map +1 -0
- package/dist/schema-BU1aIQ63.mjs.map +1 -1
- package/dist/{secret-file-BxZ-J_Nz.mjs → secret-file-DiuEcLFP.mjs} +2 -2
- package/dist/{secret-file-BxZ-J_Nz.mjs.map → secret-file-DiuEcLFP.mjs.map} +1 -1
- package/dist/service-CZ0EdD2-.mjs +10 -0
- package/dist/service-CZ0EdD2-.mjs.map +1 -0
- package/dist/service-DDrbdyd-.mjs +2 -0
- package/dist/{service-CaGmqg0r.mjs.map → service-DDrbdyd-.mjs.map} +1 -1
- package/dist/service-WhSyhaho.mjs +1 -0
- package/dist/service_pb-BMHhVot2.mjs +1 -0
- package/dist/service_pb-BxMSK0gg.mjs +2 -0
- package/dist/service_pb-BxMSK0gg.mjs.map +1 -0
- package/dist/tailor-proto/src/tailor/v1/function_pb.d.mts +3 -3
- package/dist/tailor-proto/src/tailor/v1/function_resource_pb.d.mts +92 -0
- package/dist/tailor-proto/src/tailor/v1/notification_pb.d.mts +176 -0
- package/dist/tailor-proto/src/tailor/v1/notification_resource_pb.d.mts +172 -0
- package/dist/tailor-proto/src/tailor/v1/service_pb.d.mts +78 -0
- package/dist/types/app-config.generated.d.mts +1 -1
- package/dist/types/auth-connection.generated.d.mts +2 -2
- package/dist/types/auth.generated.d.mts +13 -13
- package/dist/types/executor.generated.d.mts +25 -25
- package/dist/types/field.generated.d.mts +2 -2
- package/dist/types/http-adapter.generated.d.mts +4 -4
- package/dist/types/idp.generated.d.mts +272 -272
- package/dist/types/resolver.generated.d.mts +10 -10
- package/dist/types/tailordb.generated.d.mts +84 -80
- package/dist/types/workflow.generated.d.mts +2 -2
- package/dist/vitest/date-representation.d.mts +2 -0
- package/dist/vitest/environment.d.mts +1 -0
- package/dist/vitest/environment.mjs.map +1 -1
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/migration-steps.d.mts +13 -2
- package/dist/vitest/mock-kysely.d.mts +12 -2
- package/dist/vitest/mocks/aigateway.d.mts +7 -1
- package/dist/vitest/mocks/authconnection.d.mts +7 -1
- package/dist/vitest/mocks/file.d.mts +8 -2
- package/dist/vitest/mocks/iconv.d.mts +7 -1
- package/dist/vitest/mocks/idp.d.mts +7 -1
- package/dist/vitest/mocks/logger.d.mts +7 -1
- package/dist/vitest/mocks/secretmanager.d.mts +7 -1
- package/dist/vitest/mocks/tailordb-pglite.d.mts +12 -2
- package/dist/vitest/mocks/tailordb.d.mts +22 -4
- package/dist/vitest/mocks/workflow.d.mts +2 -1
- package/dist/vitest/pglite-kysely.d.mts +18 -2
- package/dist/vitest/pglite-temporal.d.mts +5 -1
- package/dist/vitest/workflow-local.d.mts +7 -0
- package/dist/{workspace_resource_pb-C4CkoYww.mjs → workspace_resource_pb-7smKERdZ.mjs} +2 -2
- package/dist/workspace_resource_pb-7smKERdZ.mjs.map +1 -0
- package/docs/cli/application.md +51 -21
- package/docs/cli/executor.md +2 -0
- package/docs/cli/function.md +3 -1
- package/docs/cli/tailordb.md +30 -22
- package/docs/cli/workflow.md +2 -0
- package/docs/cli/workspace.md +19 -17
- package/docs/cli-reference.md +5 -4
- package/docs/configuration.md +2 -2
- package/docs/data-clone.md +1 -1
- package/docs/github-actions.md +104 -15
- package/docs/plugin/custom.md +4 -4
- package/docs/runtime.md +1 -1
- package/docs/services/auth.md +2 -0
- package/docs/services/idp.md +2 -0
- package/docs/services/tailordb/index.md +7 -2
- package/docs/services/tailordb/migration.md +71 -30
- package/docs/services/workflow.md +1 -1
- package/docs/testing.md +9 -9
- package/package.json +13 -13
- package/dist/application-BbORWCj-.mjs.map +0 -1
- package/dist/crashreport-WsYAWARW.mjs +0 -1
- package/dist/errors-BXmGBX-7.mjs.map +0 -1
- package/dist/kysely-type-B0ri1-Xs.mjs.map +0 -1
- package/dist/register-ts-hook-iAcG1dfz.mjs +0 -1057
- package/dist/register-ts-hook-iAcG1dfz.mjs.map +0 -1
- package/dist/service-CaGmqg0r.mjs +0 -2
- package/dist/service-DTrVVaDJ.mjs +0 -1
- package/dist/service-hIarp2Gl.mjs +0 -8
- package/dist/service-hIarp2Gl.mjs.map +0 -1
- package/dist/service_pb-6EkMfdOb.mjs +0 -2
- package/dist/service_pb-6EkMfdOb.mjs.map +0 -1
- package/dist/service_pb-CsJKokDl.mjs +0 -1
- package/dist/workspace_resource_pb-C4CkoYww.mjs.map +0 -1
|
@@ -2,22 +2,22 @@ import { TailorField } from "./field.generated.mjs";
|
|
|
2
2
|
/**
|
|
3
3
|
* GraphQL operation type
|
|
4
4
|
*/
|
|
5
|
-
export type QueryType = "
|
|
5
|
+
export type QueryType = "mutation" | "query";
|
|
6
6
|
export type Resolver = {
|
|
7
7
|
/** GraphQL operation type (query or mutation) */
|
|
8
8
|
operation: QueryType;
|
|
9
9
|
/** Resolver name */
|
|
10
10
|
name: string;
|
|
11
|
-
/** Resolver implementation function */
|
|
12
|
-
body: Function;
|
|
13
|
-
/** Output field definition */
|
|
14
|
-
output: TailorField;
|
|
15
11
|
/** Resolver description */
|
|
16
12
|
description?: string | undefined;
|
|
17
13
|
/** Input field definitions */
|
|
18
14
|
input?: {
|
|
19
15
|
[x: string]: TailorField;
|
|
20
16
|
};
|
|
17
|
+
/** Resolver implementation function */
|
|
18
|
+
body: Function;
|
|
19
|
+
/** Output field definition */
|
|
20
|
+
output: TailorField;
|
|
21
21
|
/** Enable publishing events from this resolver */
|
|
22
22
|
publishEvents?: boolean | undefined;
|
|
23
23
|
/** Machine user to execute this resolver as */
|
|
@@ -29,15 +29,15 @@ export type Resolver = {
|
|
|
29
29
|
} | undefined;
|
|
30
30
|
/** Access requirement for this resolver, evaluated against the original caller (unaffected by `invoker`) before `body` runs. "allowAnonymous" documents that anonymous callers are allowed. Omitted (default): unchanged, anonymous callers can reach the resolver */
|
|
31
31
|
permission?: "allowAnonymous" | readonly {
|
|
32
|
-
conditions: readonly [(string | boolean | {
|
|
32
|
+
conditions: readonly (readonly [(string | boolean | {
|
|
33
33
|
user: string;
|
|
34
|
-
}), "
|
|
34
|
+
}), "!=" | "=", (string | boolean | {
|
|
35
35
|
user: string;
|
|
36
|
-
})] | readonly
|
|
36
|
+
})])[] | readonly [(string | boolean | {
|
|
37
37
|
user: string;
|
|
38
|
-
}), "
|
|
38
|
+
}), "!=" | "=", (string | boolean | {
|
|
39
39
|
user: string;
|
|
40
|
-
})]
|
|
40
|
+
})];
|
|
41
41
|
permit: boolean;
|
|
42
42
|
/** Reason recorded for this policy, used in the access-denied error message */
|
|
43
43
|
description?: string | undefined;
|
|
@@ -10,13 +10,13 @@ export type GqlOperationsInput = "query" | {
|
|
|
10
10
|
};
|
|
11
11
|
export type GqlOperations = {
|
|
12
12
|
/** Enable create mutation (default: true) */
|
|
13
|
-
create?: boolean
|
|
13
|
+
create?: boolean;
|
|
14
14
|
/** Enable update mutation (default: true) */
|
|
15
|
-
update?: boolean
|
|
15
|
+
update?: boolean;
|
|
16
16
|
/** Enable delete mutation (default: true) */
|
|
17
|
-
delete?: boolean
|
|
17
|
+
delete?: boolean;
|
|
18
18
|
/** Enable read queries - get, list, aggregation (default: true) */
|
|
19
|
-
read?: boolean
|
|
19
|
+
read?: boolean;
|
|
20
20
|
};
|
|
21
21
|
export type DBFieldMetadata = {
|
|
22
22
|
/** Whether the field is required */
|
|
@@ -89,39 +89,7 @@ export type TailorDBTypeParsedSettings = {
|
|
|
89
89
|
};
|
|
90
90
|
export type RawPermissions = {
|
|
91
91
|
record?: {
|
|
92
|
-
create: readonly (readonly [(string | boolean | string[] | boolean[] | {
|
|
93
|
-
user: string;
|
|
94
|
-
} | {
|
|
95
|
-
record: string;
|
|
96
|
-
} | {
|
|
97
|
-
oldRecord: string;
|
|
98
|
-
} | {
|
|
99
|
-
newRecord: string;
|
|
100
|
-
}), "=" | "!=" | "in" | "not in" | "hasAny" | "not hasAny", (string | boolean | string[] | boolean[] | {
|
|
101
|
-
user: string;
|
|
102
|
-
} | {
|
|
103
|
-
record: string;
|
|
104
|
-
} | {
|
|
105
|
-
oldRecord: string;
|
|
106
|
-
} | {
|
|
107
|
-
newRecord: string;
|
|
108
|
-
})] | readonly [(string | boolean | string[] | boolean[] | {
|
|
109
|
-
user: string;
|
|
110
|
-
} | {
|
|
111
|
-
record: string;
|
|
112
|
-
} | {
|
|
113
|
-
oldRecord: string;
|
|
114
|
-
} | {
|
|
115
|
-
newRecord: string;
|
|
116
|
-
}), "=" | "!=" | "in" | "not in" | "hasAny" | "not hasAny", (string | boolean | string[] | boolean[] | {
|
|
117
|
-
user: string;
|
|
118
|
-
} | {
|
|
119
|
-
record: string;
|
|
120
|
-
} | {
|
|
121
|
-
oldRecord: string;
|
|
122
|
-
} | {
|
|
123
|
-
newRecord: string;
|
|
124
|
-
}), boolean] | readonly (boolean | readonly [(string | boolean | string[] | boolean[] | {
|
|
92
|
+
create: readonly (readonly (boolean | readonly [(string | boolean | string[] | boolean[] | {
|
|
125
93
|
user: string;
|
|
126
94
|
} | {
|
|
127
95
|
record: string;
|
|
@@ -129,7 +97,7 @@ export type RawPermissions = {
|
|
|
129
97
|
oldRecord: string;
|
|
130
98
|
} | {
|
|
131
99
|
newRecord: string;
|
|
132
|
-
}), "
|
|
100
|
+
}), "!=" | "=" | "hasAny" | "in" | "not hasAny" | "not in", (string | boolean | string[] | boolean[] | {
|
|
133
101
|
user: string;
|
|
134
102
|
} | {
|
|
135
103
|
record: string;
|
|
@@ -138,7 +106,7 @@ export type RawPermissions = {
|
|
|
138
106
|
} | {
|
|
139
107
|
newRecord: string;
|
|
140
108
|
})])[] | {
|
|
141
|
-
conditions: readonly [(string | boolean | string[] | boolean[] | {
|
|
109
|
+
conditions: readonly (readonly [(string | boolean | string[] | boolean[] | {
|
|
142
110
|
user: string;
|
|
143
111
|
} | {
|
|
144
112
|
record: string;
|
|
@@ -146,7 +114,7 @@ export type RawPermissions = {
|
|
|
146
114
|
oldRecord: string;
|
|
147
115
|
} | {
|
|
148
116
|
newRecord: string;
|
|
149
|
-
}), "
|
|
117
|
+
}), "!=" | "=" | "hasAny" | "in" | "not hasAny" | "not in", (string | boolean | string[] | boolean[] | {
|
|
150
118
|
user: string;
|
|
151
119
|
} | {
|
|
152
120
|
record: string;
|
|
@@ -154,7 +122,7 @@ export type RawPermissions = {
|
|
|
154
122
|
oldRecord: string;
|
|
155
123
|
} | {
|
|
156
124
|
newRecord: string;
|
|
157
|
-
})] | readonly
|
|
125
|
+
})])[] | readonly [(string | boolean | string[] | boolean[] | {
|
|
158
126
|
user: string;
|
|
159
127
|
} | {
|
|
160
128
|
record: string;
|
|
@@ -162,7 +130,7 @@ export type RawPermissions = {
|
|
|
162
130
|
oldRecord: string;
|
|
163
131
|
} | {
|
|
164
132
|
newRecord: string;
|
|
165
|
-
}), "
|
|
133
|
+
}), "!=" | "=" | "hasAny" | "in" | "not hasAny" | "not in", (string | boolean | string[] | boolean[] | {
|
|
166
134
|
user: string;
|
|
167
135
|
} | {
|
|
168
136
|
record: string;
|
|
@@ -170,11 +138,10 @@ export type RawPermissions = {
|
|
|
170
138
|
oldRecord: string;
|
|
171
139
|
} | {
|
|
172
140
|
newRecord: string;
|
|
173
|
-
})]
|
|
141
|
+
})];
|
|
174
142
|
description?: string | undefined;
|
|
175
143
|
permit?: boolean | undefined;
|
|
176
|
-
}
|
|
177
|
-
read: readonly (readonly [(string | boolean | string[] | boolean[] | {
|
|
144
|
+
} | readonly [(string | boolean | string[] | boolean[] | {
|
|
178
145
|
user: string;
|
|
179
146
|
} | {
|
|
180
147
|
record: string;
|
|
@@ -182,7 +149,7 @@ export type RawPermissions = {
|
|
|
182
149
|
oldRecord: string;
|
|
183
150
|
} | {
|
|
184
151
|
newRecord: string;
|
|
185
|
-
}), "
|
|
152
|
+
}), "!=" | "=" | "hasAny" | "in" | "not hasAny" | "not in", (string | boolean | string[] | boolean[] | {
|
|
186
153
|
user: string;
|
|
187
154
|
} | {
|
|
188
155
|
record: string;
|
|
@@ -198,7 +165,7 @@ export type RawPermissions = {
|
|
|
198
165
|
oldRecord: string;
|
|
199
166
|
} | {
|
|
200
167
|
newRecord: string;
|
|
201
|
-
}), "
|
|
168
|
+
}), "!=" | "=" | "hasAny" | "in" | "not hasAny" | "not in", (string | boolean | string[] | boolean[] | {
|
|
202
169
|
user: string;
|
|
203
170
|
} | {
|
|
204
171
|
record: string;
|
|
@@ -206,7 +173,8 @@ export type RawPermissions = {
|
|
|
206
173
|
oldRecord: string;
|
|
207
174
|
} | {
|
|
208
175
|
newRecord: string;
|
|
209
|
-
}), boolean]
|
|
176
|
+
}), boolean])[];
|
|
177
|
+
read: readonly (readonly (boolean | readonly [(string | boolean | string[] | boolean[] | {
|
|
210
178
|
user: string;
|
|
211
179
|
} | {
|
|
212
180
|
record: string;
|
|
@@ -214,7 +182,7 @@ export type RawPermissions = {
|
|
|
214
182
|
oldRecord: string;
|
|
215
183
|
} | {
|
|
216
184
|
newRecord: string;
|
|
217
|
-
}), "
|
|
185
|
+
}), "!=" | "=" | "hasAny" | "in" | "not hasAny" | "not in", (string | boolean | string[] | boolean[] | {
|
|
218
186
|
user: string;
|
|
219
187
|
} | {
|
|
220
188
|
record: string;
|
|
@@ -223,7 +191,7 @@ export type RawPermissions = {
|
|
|
223
191
|
} | {
|
|
224
192
|
newRecord: string;
|
|
225
193
|
})])[] | {
|
|
226
|
-
conditions: readonly [(string | boolean | string[] | boolean[] | {
|
|
194
|
+
conditions: readonly (readonly [(string | boolean | string[] | boolean[] | {
|
|
227
195
|
user: string;
|
|
228
196
|
} | {
|
|
229
197
|
record: string;
|
|
@@ -231,7 +199,7 @@ export type RawPermissions = {
|
|
|
231
199
|
oldRecord: string;
|
|
232
200
|
} | {
|
|
233
201
|
newRecord: string;
|
|
234
|
-
}), "
|
|
202
|
+
}), "!=" | "=" | "hasAny" | "in" | "not hasAny" | "not in", (string | boolean | string[] | boolean[] | {
|
|
235
203
|
user: string;
|
|
236
204
|
} | {
|
|
237
205
|
record: string;
|
|
@@ -239,7 +207,7 @@ export type RawPermissions = {
|
|
|
239
207
|
oldRecord: string;
|
|
240
208
|
} | {
|
|
241
209
|
newRecord: string;
|
|
242
|
-
})] | readonly
|
|
210
|
+
})])[] | readonly [(string | boolean | string[] | boolean[] | {
|
|
243
211
|
user: string;
|
|
244
212
|
} | {
|
|
245
213
|
record: string;
|
|
@@ -247,7 +215,7 @@ export type RawPermissions = {
|
|
|
247
215
|
oldRecord: string;
|
|
248
216
|
} | {
|
|
249
217
|
newRecord: string;
|
|
250
|
-
}), "
|
|
218
|
+
}), "!=" | "=" | "hasAny" | "in" | "not hasAny" | "not in", (string | boolean | string[] | boolean[] | {
|
|
251
219
|
user: string;
|
|
252
220
|
} | {
|
|
253
221
|
record: string;
|
|
@@ -255,11 +223,10 @@ export type RawPermissions = {
|
|
|
255
223
|
oldRecord: string;
|
|
256
224
|
} | {
|
|
257
225
|
newRecord: string;
|
|
258
|
-
})]
|
|
226
|
+
})];
|
|
259
227
|
description?: string | undefined;
|
|
260
228
|
permit?: boolean | undefined;
|
|
261
|
-
}
|
|
262
|
-
update: readonly (readonly [(string | boolean | string[] | boolean[] | {
|
|
229
|
+
} | readonly [(string | boolean | string[] | boolean[] | {
|
|
263
230
|
user: string;
|
|
264
231
|
} | {
|
|
265
232
|
record: string;
|
|
@@ -267,7 +234,7 @@ export type RawPermissions = {
|
|
|
267
234
|
oldRecord: string;
|
|
268
235
|
} | {
|
|
269
236
|
newRecord: string;
|
|
270
|
-
}), "
|
|
237
|
+
}), "!=" | "=" | "hasAny" | "in" | "not hasAny" | "not in", (string | boolean | string[] | boolean[] | {
|
|
271
238
|
user: string;
|
|
272
239
|
} | {
|
|
273
240
|
record: string;
|
|
@@ -283,7 +250,7 @@ export type RawPermissions = {
|
|
|
283
250
|
oldRecord: string;
|
|
284
251
|
} | {
|
|
285
252
|
newRecord: string;
|
|
286
|
-
}), "
|
|
253
|
+
}), "!=" | "=" | "hasAny" | "in" | "not hasAny" | "not in", (string | boolean | string[] | boolean[] | {
|
|
287
254
|
user: string;
|
|
288
255
|
} | {
|
|
289
256
|
record: string;
|
|
@@ -291,7 +258,8 @@ export type RawPermissions = {
|
|
|
291
258
|
oldRecord: string;
|
|
292
259
|
} | {
|
|
293
260
|
newRecord: string;
|
|
294
|
-
}), boolean]
|
|
261
|
+
}), boolean])[];
|
|
262
|
+
update: readonly (readonly (boolean | readonly [(string | boolean | string[] | boolean[] | {
|
|
295
263
|
user: string;
|
|
296
264
|
} | {
|
|
297
265
|
record: string;
|
|
@@ -299,7 +267,7 @@ export type RawPermissions = {
|
|
|
299
267
|
oldRecord: string;
|
|
300
268
|
} | {
|
|
301
269
|
newRecord: string;
|
|
302
|
-
}), "
|
|
270
|
+
}), "!=" | "=" | "hasAny" | "in" | "not hasAny" | "not in", (string | boolean | string[] | boolean[] | {
|
|
303
271
|
user: string;
|
|
304
272
|
} | {
|
|
305
273
|
record: string;
|
|
@@ -308,7 +276,7 @@ export type RawPermissions = {
|
|
|
308
276
|
} | {
|
|
309
277
|
newRecord: string;
|
|
310
278
|
})])[] | {
|
|
311
|
-
conditions: readonly [(string | boolean | string[] | boolean[] | {
|
|
279
|
+
conditions: readonly (readonly [(string | boolean | string[] | boolean[] | {
|
|
312
280
|
user: string;
|
|
313
281
|
} | {
|
|
314
282
|
record: string;
|
|
@@ -316,7 +284,7 @@ export type RawPermissions = {
|
|
|
316
284
|
oldRecord: string;
|
|
317
285
|
} | {
|
|
318
286
|
newRecord: string;
|
|
319
|
-
}), "
|
|
287
|
+
}), "!=" | "=" | "hasAny" | "in" | "not hasAny" | "not in", (string | boolean | string[] | boolean[] | {
|
|
320
288
|
user: string;
|
|
321
289
|
} | {
|
|
322
290
|
record: string;
|
|
@@ -324,7 +292,7 @@ export type RawPermissions = {
|
|
|
324
292
|
oldRecord: string;
|
|
325
293
|
} | {
|
|
326
294
|
newRecord: string;
|
|
327
|
-
})] | readonly
|
|
295
|
+
})])[] | readonly [(string | boolean | string[] | boolean[] | {
|
|
328
296
|
user: string;
|
|
329
297
|
} | {
|
|
330
298
|
record: string;
|
|
@@ -332,7 +300,7 @@ export type RawPermissions = {
|
|
|
332
300
|
oldRecord: string;
|
|
333
301
|
} | {
|
|
334
302
|
newRecord: string;
|
|
335
|
-
}), "
|
|
303
|
+
}), "!=" | "=" | "hasAny" | "in" | "not hasAny" | "not in", (string | boolean | string[] | boolean[] | {
|
|
336
304
|
user: string;
|
|
337
305
|
} | {
|
|
338
306
|
record: string;
|
|
@@ -340,11 +308,10 @@ export type RawPermissions = {
|
|
|
340
308
|
oldRecord: string;
|
|
341
309
|
} | {
|
|
342
310
|
newRecord: string;
|
|
343
|
-
})]
|
|
311
|
+
})];
|
|
344
312
|
description?: string | undefined;
|
|
345
313
|
permit?: boolean | undefined;
|
|
346
|
-
}
|
|
347
|
-
delete: readonly (readonly [(string | boolean | string[] | boolean[] | {
|
|
314
|
+
} | readonly [(string | boolean | string[] | boolean[] | {
|
|
348
315
|
user: string;
|
|
349
316
|
} | {
|
|
350
317
|
record: string;
|
|
@@ -352,7 +319,7 @@ export type RawPermissions = {
|
|
|
352
319
|
oldRecord: string;
|
|
353
320
|
} | {
|
|
354
321
|
newRecord: string;
|
|
355
|
-
}), "
|
|
322
|
+
}), "!=" | "=" | "hasAny" | "in" | "not hasAny" | "not in", (string | boolean | string[] | boolean[] | {
|
|
356
323
|
user: string;
|
|
357
324
|
} | {
|
|
358
325
|
record: string;
|
|
@@ -368,7 +335,7 @@ export type RawPermissions = {
|
|
|
368
335
|
oldRecord: string;
|
|
369
336
|
} | {
|
|
370
337
|
newRecord: string;
|
|
371
|
-
}), "
|
|
338
|
+
}), "!=" | "=" | "hasAny" | "in" | "not hasAny" | "not in", (string | boolean | string[] | boolean[] | {
|
|
372
339
|
user: string;
|
|
373
340
|
} | {
|
|
374
341
|
record: string;
|
|
@@ -376,7 +343,8 @@ export type RawPermissions = {
|
|
|
376
343
|
oldRecord: string;
|
|
377
344
|
} | {
|
|
378
345
|
newRecord: string;
|
|
379
|
-
}), boolean]
|
|
346
|
+
}), boolean])[];
|
|
347
|
+
delete: readonly (readonly (boolean | readonly [(string | boolean | string[] | boolean[] | {
|
|
380
348
|
user: string;
|
|
381
349
|
} | {
|
|
382
350
|
record: string;
|
|
@@ -384,7 +352,7 @@ export type RawPermissions = {
|
|
|
384
352
|
oldRecord: string;
|
|
385
353
|
} | {
|
|
386
354
|
newRecord: string;
|
|
387
|
-
}), "
|
|
355
|
+
}), "!=" | "=" | "hasAny" | "in" | "not hasAny" | "not in", (string | boolean | string[] | boolean[] | {
|
|
388
356
|
user: string;
|
|
389
357
|
} | {
|
|
390
358
|
record: string;
|
|
@@ -393,7 +361,7 @@ export type RawPermissions = {
|
|
|
393
361
|
} | {
|
|
394
362
|
newRecord: string;
|
|
395
363
|
})])[] | {
|
|
396
|
-
conditions: readonly [(string | boolean | string[] | boolean[] | {
|
|
364
|
+
conditions: readonly (readonly [(string | boolean | string[] | boolean[] | {
|
|
397
365
|
user: string;
|
|
398
366
|
} | {
|
|
399
367
|
record: string;
|
|
@@ -401,7 +369,7 @@ export type RawPermissions = {
|
|
|
401
369
|
oldRecord: string;
|
|
402
370
|
} | {
|
|
403
371
|
newRecord: string;
|
|
404
|
-
}), "
|
|
372
|
+
}), "!=" | "=" | "hasAny" | "in" | "not hasAny" | "not in", (string | boolean | string[] | boolean[] | {
|
|
405
373
|
user: string;
|
|
406
374
|
} | {
|
|
407
375
|
record: string;
|
|
@@ -409,7 +377,7 @@ export type RawPermissions = {
|
|
|
409
377
|
oldRecord: string;
|
|
410
378
|
} | {
|
|
411
379
|
newRecord: string;
|
|
412
|
-
})] | readonly
|
|
380
|
+
})])[] | readonly [(string | boolean | string[] | boolean[] | {
|
|
413
381
|
user: string;
|
|
414
382
|
} | {
|
|
415
383
|
record: string;
|
|
@@ -417,7 +385,7 @@ export type RawPermissions = {
|
|
|
417
385
|
oldRecord: string;
|
|
418
386
|
} | {
|
|
419
387
|
newRecord: string;
|
|
420
|
-
}), "
|
|
388
|
+
}), "!=" | "=" | "hasAny" | "in" | "not hasAny" | "not in", (string | boolean | string[] | boolean[] | {
|
|
421
389
|
user: string;
|
|
422
390
|
} | {
|
|
423
391
|
record: string;
|
|
@@ -425,18 +393,50 @@ export type RawPermissions = {
|
|
|
425
393
|
oldRecord: string;
|
|
426
394
|
} | {
|
|
427
395
|
newRecord: string;
|
|
428
|
-
})]
|
|
396
|
+
})];
|
|
429
397
|
description?: string | undefined;
|
|
430
398
|
permit?: boolean | undefined;
|
|
431
|
-
}
|
|
399
|
+
} | readonly [(string | boolean | string[] | boolean[] | {
|
|
400
|
+
user: string;
|
|
401
|
+
} | {
|
|
402
|
+
record: string;
|
|
403
|
+
} | {
|
|
404
|
+
oldRecord: string;
|
|
405
|
+
} | {
|
|
406
|
+
newRecord: string;
|
|
407
|
+
}), "!=" | "=" | "hasAny" | "in" | "not hasAny" | "not in", (string | boolean | string[] | boolean[] | {
|
|
408
|
+
user: string;
|
|
409
|
+
} | {
|
|
410
|
+
record: string;
|
|
411
|
+
} | {
|
|
412
|
+
oldRecord: string;
|
|
413
|
+
} | {
|
|
414
|
+
newRecord: string;
|
|
415
|
+
})] | readonly [(string | boolean | string[] | boolean[] | {
|
|
416
|
+
user: string;
|
|
417
|
+
} | {
|
|
418
|
+
record: string;
|
|
419
|
+
} | {
|
|
420
|
+
oldRecord: string;
|
|
421
|
+
} | {
|
|
422
|
+
newRecord: string;
|
|
423
|
+
}), "!=" | "=" | "hasAny" | "in" | "not hasAny" | "not in", (string | boolean | string[] | boolean[] | {
|
|
424
|
+
user: string;
|
|
425
|
+
} | {
|
|
426
|
+
record: string;
|
|
427
|
+
} | {
|
|
428
|
+
oldRecord: string;
|
|
429
|
+
} | {
|
|
430
|
+
newRecord: string;
|
|
431
|
+
}), boolean])[];
|
|
432
432
|
} | undefined;
|
|
433
433
|
gql?: readonly {
|
|
434
434
|
conditions: readonly (readonly [(string | boolean | string[] | boolean[] | {
|
|
435
435
|
user: string;
|
|
436
|
-
}), "
|
|
436
|
+
}), "!=" | "=" | "hasAny" | "in" | "not hasAny" | "not in", (string | boolean | string[] | boolean[] | {
|
|
437
437
|
user: string;
|
|
438
438
|
})])[];
|
|
439
|
-
actions: "all" | readonly ("
|
|
439
|
+
actions: "all" | readonly ("aggregate" | "bulkUpsert" | "create" | "delete" | "read" | "update")[];
|
|
440
440
|
permit?: boolean | undefined;
|
|
441
441
|
description?: string | undefined;
|
|
442
442
|
}[] | undefined;
|
|
@@ -446,7 +446,11 @@ export type TailorDBServiceConfigInput = {
|
|
|
446
446
|
files: string[];
|
|
447
447
|
/** Glob patterns to exclude from table discovery */
|
|
448
448
|
ignores?: string[] | undefined;
|
|
449
|
-
/**
|
|
449
|
+
/**
|
|
450
|
+
* Migration configuration
|
|
451
|
+
*
|
|
452
|
+
* **Beta:** This API may change in future releases.
|
|
453
|
+
*/
|
|
450
454
|
migration?: {
|
|
451
455
|
/** Directory containing migration files */
|
|
452
456
|
directory: string;
|
|
@@ -2,9 +2,9 @@ export type RetryPolicy = {
|
|
|
2
2
|
/** Maximum number of retries (1-10) */
|
|
3
3
|
maxRetries: number;
|
|
4
4
|
/** Initial backoff duration (e.g., '1s', '500ms', '1m', max 1h) */
|
|
5
|
-
initialBackoff: `${number}
|
|
5
|
+
initialBackoff: `${number}m` | `${number}ms` | `${number}s`;
|
|
6
6
|
/** Maximum backoff duration (e.g., '30s', '5m', max 24h) */
|
|
7
|
-
maxBackoff: `${number}
|
|
7
|
+
maxBackoff: `${number}m` | `${number}ms` | `${number}s`;
|
|
8
8
|
/** Backoff multiplier (>= 1) */
|
|
9
9
|
backoffMultiplier: number;
|
|
10
10
|
};
|
|
@@ -15,6 +15,8 @@ export declare function applyDateDefault(dateDefault: EffectiveDateDefault): ()
|
|
|
15
15
|
* migration tests call it with the representation recorded in the migration's
|
|
16
16
|
* `diff.json`, so a later change to `tailor.config.ts` does not alter what the
|
|
17
17
|
* test exercises.
|
|
18
|
+
*
|
|
19
|
+
* **Beta:** This API may change in future releases.
|
|
18
20
|
* @param representation - The representation to apply, as `as` names it
|
|
19
21
|
* @returns A function that restores the previous representation
|
|
20
22
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.mjs","names":["ES_BUILTINS","cleanupPlatformGlobals","installPlatformGlobals","RUNTIME_FLAG_KEY","ALLOWED_GLOBALS","environment_default","g","global","temporalDescriptor","needsTemporal","temporal","saved","key","descriptor"],"sources":["../../src/vitest/environment.ts"],"sourcesContent":["import { ES_BUILTINS } from \"#/utils/es-builtins\";\n// Import from ./globals (NOT ./mock): this module runs in the Vitest environment\n// realm where `vi` is unavailable, and ./mock imports `vi`. ./globals is\n// dependency-free of vitest.\nimport { RUNTIME_FLAG_KEY, cleanupPlatformGlobals, installPlatformGlobals } from \"./globals\";\n\n// Globals allowed in the Tailor Platform runtime.\n// ES_BUILTINS is the free-variable allowlist the deploy-time check uses, so\n// the emulated runtime exposes exactly the same identifiers as the production\n// platform (ECMAScript builtins + shared Node/browser runtime globals like\n// console, fetch, setTimeout).\n// Platform API mocks (tailor, tailordb, etc.) are not listed here — the base\n// surface is injected by installPlatformGlobals() after the whitelist cleanup,\n// and per-namespace mocks are layered on at `using xMock()` acquisition time.\nconst ALLOWED_GLOBALS = new Set([\n ...ES_BUILTINS,\n\n // The environment-active flag (set in installPlatformGlobals, used by\n // setup.ts to detect the tailor-runtime environment).\n RUNTIME_FLAG_KEY,\n\n // Used by Vitest internally — not in the platform runtime, but removing breaks the test runner\n \"process\",\n \"require\",\n \"module\",\n \"exports\",\n \"__vitest_worker__\",\n \"__vitest_mocker__\",\n \"VITEST_POOL_ID\",\n]);\n\nexport default {\n name: \"tailor-runtime\",\n viteEnvironment: \"ssr\",\n\n async setup(global: typeof globalThis) {\n const g = global as Record<string, unknown>;\n\n const temporalDescriptor = Object.getOwnPropertyDescriptor(g, \"Temporal\");\n const needsTemporal = g.Temporal === undefined;\n const temporal = needsTemporal\n ? (await import(\"temporal-polyfill/full/implementation\")).Temporal\n : undefined;\n\n // Save and remove all non-whitelisted globals\n const saved: Record<string, PropertyDescriptor> = {};\n for (const key of Object.getOwnPropertyNames(g)) {\n if (!ALLOWED_GLOBALS.has(key)) {\n const descriptor = Object.getOwnPropertyDescriptor(g, key);\n if (descriptor?.configurable) {\n saved[key] = descriptor;\n delete g[key];\n }\n }\n }\n\n // Install the base platform surface after whitelist cleanup. Per-namespace\n // mocks (workflow, tailordb, …) are installed on demand by `using xMock()`.\n installPlatformGlobals(global);\n if (needsTemporal) {\n Object.defineProperty(g, \"Temporal\", {\n value: temporal,\n writable: true,\n configurable: true,\n });\n }\n\n return {\n teardown(global: typeof globalThis) {\n cleanupPlatformGlobals(global);\n\n if (needsTemporal) {\n if (temporalDescriptor) {\n Object.defineProperty(global, \"Temporal\", temporalDescriptor);\n } else {\n Reflect.deleteProperty(global, \"Temporal\");\n }\n }\n\n // Restore removed globals\n const g = global as Record<string, unknown>;\n for (const [key, descriptor] of Object.entries(saved)) {\n Object.defineProperty(g, key, descriptor);\n }\n },\n };\n },\n};\n"],"mappings":"A,0GAcA,MAAMI,kBAAkB,IAAI,IAAI,CAC9B,GAAGJ,EAIHG,EAGA,UACA,UACA,SACA,UACA,oBACA,oBACA,gBACF,CAAC,
|
|
1
|
+
{"version":3,"file":"environment.mjs","names":["ES_BUILTINS","cleanupPlatformGlobals","installPlatformGlobals","RUNTIME_FLAG_KEY","ALLOWED_GLOBALS","environment_default","g","global","temporalDescriptor","needsTemporal","temporal","saved","key","descriptor"],"sources":["../../src/vitest/environment.ts"],"sourcesContent":["import { ES_BUILTINS } from \"#/utils/es-builtins\";\n// Import from ./globals (NOT ./mock): this module runs in the Vitest environment\n// realm where `vi` is unavailable, and ./mock imports `vi`. ./globals is\n// dependency-free of vitest.\nimport { RUNTIME_FLAG_KEY, cleanupPlatformGlobals, installPlatformGlobals } from \"./globals\";\n\n// Globals allowed in the Tailor Platform runtime.\n// ES_BUILTINS is the free-variable allowlist the deploy-time check uses, so\n// the emulated runtime exposes exactly the same identifiers as the production\n// platform (ECMAScript builtins + shared Node/browser runtime globals like\n// console, fetch, setTimeout).\n// Platform API mocks (tailor, tailordb, etc.) are not listed here — the base\n// surface is injected by installPlatformGlobals() after the whitelist cleanup,\n// and per-namespace mocks are layered on at `using xMock()` acquisition time.\nconst ALLOWED_GLOBALS = new Set([\n ...ES_BUILTINS,\n\n // The environment-active flag (set in installPlatformGlobals, used by\n // setup.ts to detect the tailor-runtime environment).\n RUNTIME_FLAG_KEY,\n\n // Used by Vitest internally — not in the platform runtime, but removing breaks the test runner\n \"process\",\n \"require\",\n \"module\",\n \"exports\",\n \"__vitest_worker__\",\n \"__vitest_mocker__\",\n \"VITEST_POOL_ID\",\n]);\n\n/** **Beta:** This API may change in future releases. */\nexport default {\n name: \"tailor-runtime\",\n viteEnvironment: \"ssr\",\n\n async setup(global: typeof globalThis) {\n const g = global as Record<string, unknown>;\n\n const temporalDescriptor = Object.getOwnPropertyDescriptor(g, \"Temporal\");\n const needsTemporal = g.Temporal === undefined;\n const temporal = needsTemporal\n ? (await import(\"temporal-polyfill/full/implementation\")).Temporal\n : undefined;\n\n // Save and remove all non-whitelisted globals\n const saved: Record<string, PropertyDescriptor> = {};\n for (const key of Object.getOwnPropertyNames(g)) {\n if (!ALLOWED_GLOBALS.has(key)) {\n const descriptor = Object.getOwnPropertyDescriptor(g, key);\n if (descriptor?.configurable) {\n saved[key] = descriptor;\n delete g[key];\n }\n }\n }\n\n // Install the base platform surface after whitelist cleanup. Per-namespace\n // mocks (workflow, tailordb, …) are installed on demand by `using xMock()`.\n installPlatformGlobals(global);\n if (needsTemporal) {\n Object.defineProperty(g, \"Temporal\", {\n value: temporal,\n writable: true,\n configurable: true,\n });\n }\n\n return {\n teardown(global: typeof globalThis) {\n cleanupPlatformGlobals(global);\n\n if (needsTemporal) {\n if (temporalDescriptor) {\n Object.defineProperty(global, \"Temporal\", temporalDescriptor);\n } else {\n Reflect.deleteProperty(global, \"Temporal\");\n }\n }\n\n // Restore removed globals\n const g = global as Record<string, unknown>;\n for (const [key, descriptor] of Object.entries(saved)) {\n Object.defineProperty(g, key, descriptor);\n }\n },\n };\n },\n};\n"],"mappings":"A,0GAcA,MAAMI,kBAAkB,IAAI,IAAI,CAC9B,GAAGJ,EAIHG,EAGA,UACA,UACA,SACA,UACA,oBACA,oBACA,gBACF,CAAC,EAGD,IAAAE,EAAe,CACb,KAAM,iBACN,gBAAiB,MAEjB,MAAM,MAAM,EAA2B,CACrC,IAAMC,EAAIC,EAEJC,EAAqB,OAAO,yBAAyBF,EAAG,UAAU,EAClEG,EAAgBH,EAAE,WAAa,IAAA,GAC/BI,EAAWD,GACZ,MAAM,OAAO,yCAAA,CAA0C,SACxD,IAAA,GAGEE,EAA4C,CAAC,EACnD,IAAK,IAAMC,KAAO,OAAO,oBAAoBN,CAAC,EAC5C,GAAI,CAACF,EAAgB,IAAIQ,CAAG,EAAG,CAC7B,IAAMC,EAAa,OAAO,yBAAyBP,EAAGM,CAAG,EACrDC,GAAY,eACd,EAAMD,GAAOC,EACb,OAAOP,EAAEM,GAEb,CAcF,OATAV,EAAuBK,CAAM,EACzBE,GACF,OAAO,eAAeH,EAAG,WAAY,CACnC,MAAOI,EACP,SAAU,GACV,aAAc,EAChB,CAAC,EAGI,CACL,SAAS,EAA2B,CAClCT,EAAuBM,CAAM,EAEzBE,IACED,EACF,OAAO,eAAeD,EAAQ,WAAYC,CAAkB,EAE5D,QAAQ,eAAeD,EAAQ,UAAU,GAK7C,IAAMD,EAAIC,EACV,IAAK,GAAM,CAACK,EAAKC,KAAe,OAAO,QAAQF,CAAK,EAClD,OAAO,eAAeL,EAAGM,EAAKC,CAAU,CAE5C,CACF,CACF,CACF,E"}
|