@tailor-platform/sdk 0.15.0 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/cli/api.d.mts +1 -1
- package/dist/cli/api.mjs +2 -2
- package/dist/cli/index.mjs +2 -2
- package/dist/configure/index.d.mts +3 -3
- package/dist/configure/index.mjs +1 -1
- package/dist/{index-Aa13uIsJ.d.mts → index-Bv27MRk4.d.mts} +56 -11
- package/dist/{job-zmVw-pOP.mjs → job-Dx7eROGy.mjs} +7 -4
- package/dist/{job-zmVw-pOP.mjs.map → job-Dx7eROGy.mjs.map} +1 -1
- package/dist/{resume-DS5fjl1f.mjs → resume-DJfAvxVb.mjs} +2 -2
- package/dist/{resume-DS5fjl1f.mjs.map → resume-DJfAvxVb.mjs.map} +1 -1
- package/dist/{types-B1XNYM4Q.d.mts → types-Ct3a5JOo.d.mts} +23 -14
- package/dist/utils/test/index.d.mts +2 -2
- package/docs/core-concepts.md +3 -12
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference path="./user-defined.d.ts" />
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as zod34 from "zod";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
6
6
|
import * as type_fest0 from "type-fest";
|
|
7
7
|
import { IsAny, NonEmptyObject } from "type-fest";
|
|
8
|
-
import * as
|
|
8
|
+
import * as zod_v4_core50 from "zod/v4/core";
|
|
9
9
|
|
|
10
10
|
//#region src/configure/types/helpers.d.ts
|
|
11
11
|
type Prettify<T> = { [K in keyof T as string extends K ? never : K]: T[K] } & {};
|
|
@@ -18,6 +18,15 @@ type InferFieldsOutput<F extends Record<string, {
|
|
|
18
18
|
_output: any;
|
|
19
19
|
[key: string]: any;
|
|
20
20
|
}>> = DeepWritable<Prettify<NullableToOptional<{ [K in keyof F]: output<F[K]> }>>>;
|
|
21
|
+
/**
|
|
22
|
+
* A looser version of JsonValue that accepts interfaces.
|
|
23
|
+
* TypeScript interfaces don't have index signatures by default,
|
|
24
|
+
* so they can't be assigned to JsonValue's {[Key in string]: JsonValue}.
|
|
25
|
+
* This type uses a recursive check instead.
|
|
26
|
+
*/
|
|
27
|
+
type JsonCompatible<T> = T extends string | number | boolean | null | undefined ? T : T extends readonly (infer U)[] ? JsonCompatible<U>[] : T extends object ? T extends {
|
|
28
|
+
toJSON: () => unknown;
|
|
29
|
+
} ? never : { [K in keyof T]: JsonCompatible<T[K]> } : never;
|
|
21
30
|
//#endregion
|
|
22
31
|
//#region src/parser/service/resolver/schema.d.ts
|
|
23
32
|
declare const QueryTypeSchema: z.ZodUnion<readonly [z.ZodLiteral<"query">, z.ZodLiteral<"mutation">]>;
|
|
@@ -266,7 +275,7 @@ type TailorToTs = {
|
|
|
266
275
|
boolean: boolean;
|
|
267
276
|
uuid: string;
|
|
268
277
|
date: string;
|
|
269
|
-
datetime: string;
|
|
278
|
+
datetime: string | Date;
|
|
270
279
|
time: string;
|
|
271
280
|
enum: string;
|
|
272
281
|
object: Record<string, unknown>;
|
|
@@ -990,7 +999,7 @@ declare function datetime<const Opt extends FieldOptions>(options?: Opt): Tailor
|
|
|
990
999
|
array: Opt extends {
|
|
991
1000
|
array: true;
|
|
992
1001
|
} ? true : false;
|
|
993
|
-
}, Opt["optional"] extends true ? ArrayFieldOutput<string, Opt> | null : ArrayFieldOutput<string, Opt>>;
|
|
1002
|
+
}, Opt["optional"] extends true ? ArrayFieldOutput<string | Date, Opt> | null : ArrayFieldOutput<string | Date, Opt>>;
|
|
994
1003
|
declare function time<const Opt extends FieldOptions>(options?: Opt): TailorDBField<{
|
|
995
1004
|
type: "time";
|
|
996
1005
|
array: Opt extends {
|
|
@@ -1102,7 +1111,7 @@ declare const db: {
|
|
|
1102
1111
|
} | undefined;
|
|
1103
1112
|
serial: false;
|
|
1104
1113
|
description: true;
|
|
1105
|
-
}, string>;
|
|
1114
|
+
}, string | Date>;
|
|
1106
1115
|
updatedAt: TailorDBField<{
|
|
1107
1116
|
type: "datetime";
|
|
1108
1117
|
array: false;
|
|
@@ -1112,7 +1121,7 @@ declare const db: {
|
|
|
1112
1121
|
} | undefined;
|
|
1113
1122
|
serial: false;
|
|
1114
1123
|
description: true;
|
|
1115
|
-
}, string | null>;
|
|
1124
|
+
}, string | Date | null>;
|
|
1116
1125
|
};
|
|
1117
1126
|
};
|
|
1118
1127
|
};
|
|
@@ -1326,12 +1335,12 @@ declare function defineGenerators(...configs: GeneratorConfig[]): (["@tailor-pla
|
|
|
1326
1335
|
}] | {
|
|
1327
1336
|
id: string;
|
|
1328
1337
|
description: string;
|
|
1329
|
-
processType:
|
|
1330
|
-
processResolver:
|
|
1331
|
-
processExecutor:
|
|
1332
|
-
aggregate:
|
|
1333
|
-
processTailorDBNamespace?:
|
|
1334
|
-
processResolverNamespace?:
|
|
1338
|
+
processType: zod_v4_core50.$InferInnerFunctionType<zod_v4_core50.$ZodFunctionArgs, zod_v4_core50.$ZodFunctionOut>;
|
|
1339
|
+
processResolver: zod_v4_core50.$InferInnerFunctionType<zod_v4_core50.$ZodFunctionArgs, zod_v4_core50.$ZodFunctionOut>;
|
|
1340
|
+
processExecutor: zod_v4_core50.$InferInnerFunctionType<zod_v4_core50.$ZodFunctionArgs, zod_v4_core50.$ZodFunctionOut>;
|
|
1341
|
+
aggregate: zod_v4_core50.$InferInnerFunctionType<zod_v4_core50.$ZodFunctionArgs, zod34.ZodAny>;
|
|
1342
|
+
processTailorDBNamespace?: zod_v4_core50.$InferInnerFunctionType<zod_v4_core50.$ZodFunctionArgs, zod_v4_core50.$ZodFunctionOut> | undefined;
|
|
1343
|
+
processResolverNamespace?: zod_v4_core50.$InferInnerFunctionType<zod_v4_core50.$ZodFunctionArgs, zod_v4_core50.$ZodFunctionOut> | undefined;
|
|
1335
1344
|
})[];
|
|
1336
1345
|
//#endregion
|
|
1337
1346
|
//#region src/parser/service/executor/schema.d.ts
|
|
@@ -1451,5 +1460,5 @@ type WebhookOperation = z.infer<typeof WebhookOperationSchema>;
|
|
|
1451
1460
|
type Executor = z.infer<typeof ExecutorSchema>;
|
|
1452
1461
|
type ExecutorInput = z.input<typeof ExecutorSchema>;
|
|
1453
1462
|
//#endregion
|
|
1454
|
-
export { AllowedValues, AllowedValuesOutput, AppConfig, ArrayFieldOutput, AttributeList$1 as AttributeList, AttributeMap$1 as AttributeMap, AuthConfig, AuthExternalConfig, AuthInvoker$1 as AuthInvoker, AuthOwnConfig, type AuthServiceInput, type BuiltinIdP, CodeGeneratorBase, Executor, ExecutorInput, ExecutorServiceConfig, ExecutorServiceInput, FieldMetadata, FieldOptions, FieldOutput, FunctionOperation, Generator, GqlOperation, type IDToken, IdPConfig, IdPExternalConfig, type IdProviderConfig, IncomingWebhookTrigger, InferFieldsOutput, type OAuth2Client, type OAuth2ClientGrantType, type OIDC, PermissionCondition, QueryType, RecordTrigger, Resolver, ResolverExecutedTrigger, ResolverExternalConfig, ResolverInput, ResolverServiceConfig, ResolverServiceInput, type SAML, type SCIMAttribute, type SCIMAttributeMapping, type SCIMAttributeType, type SCIMAuthorization, type SCIMConfig, type SCIMResource, ScheduleTriggerInput, StaticWebsiteConfig, TailorDBField, TailorDBInstance, TailorDBType, TailorDBTypeConfig, TailorField, TailorTypeGqlPermission, TailorTypePermission, TailorUser, type TenantProviderConfig, type UserAttributeKey, type UserAttributeListKey, type UserAttributeMap, type UsernameFieldKey, type ValueOperand, WebhookOperation, WorkflowServiceConfig, WorkflowServiceInput, db, defineAuth, defineConfig, defineGenerators, defineIdp, defineStaticWebSite, output, unauthenticatedTailorUser, unsafeAllowAllGqlPermission, unsafeAllowAllTypePermission };
|
|
1455
|
-
//# sourceMappingURL=types-
|
|
1463
|
+
export { AllowedValues, AllowedValuesOutput, AppConfig, ArrayFieldOutput, AttributeList$1 as AttributeList, AttributeMap$1 as AttributeMap, AuthConfig, AuthExternalConfig, AuthInvoker$1 as AuthInvoker, AuthOwnConfig, type AuthServiceInput, type BuiltinIdP, CodeGeneratorBase, Executor, ExecutorInput, ExecutorServiceConfig, ExecutorServiceInput, FieldMetadata, FieldOptions, FieldOutput, FunctionOperation, Generator, GqlOperation, type IDToken, IdPConfig, IdPExternalConfig, type IdProviderConfig, IncomingWebhookTrigger, InferFieldsOutput, JsonCompatible, type OAuth2Client, type OAuth2ClientGrantType, type OIDC, PermissionCondition, QueryType, RecordTrigger, Resolver, ResolverExecutedTrigger, ResolverExternalConfig, ResolverInput, ResolverServiceConfig, ResolverServiceInput, type SAML, type SCIMAttribute, type SCIMAttributeMapping, type SCIMAttributeType, type SCIMAuthorization, type SCIMConfig, type SCIMResource, ScheduleTriggerInput, StaticWebsiteConfig, TailorDBField, TailorDBInstance, TailorDBType, TailorDBTypeConfig, TailorField, TailorTypeGqlPermission, TailorTypePermission, TailorUser, type TenantProviderConfig, type UserAttributeKey, type UserAttributeListKey, type UserAttributeMap, type UsernameFieldKey, type ValueOperand, WebhookOperation, WorkflowServiceConfig, WorkflowServiceInput, db, defineAuth, defineConfig, defineGenerators, defineIdp, defineStaticWebSite, output, unauthenticatedTailorUser, unsafeAllowAllGqlPermission, unsafeAllowAllTypePermission };
|
|
1464
|
+
//# sourceMappingURL=types-Ct3a5JOo.d.mts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference path="./../../user-defined.d.ts" />
|
|
2
2
|
|
|
3
|
-
import { TailorDBType, TailorField, TailorUser } from "../../types-
|
|
4
|
-
import { output } from "../../index-
|
|
3
|
+
import { TailorDBType, TailorField, TailorUser } from "../../types-Ct3a5JOo.mjs";
|
|
4
|
+
import { output } from "../../index-Bv27MRk4.mjs";
|
|
5
5
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
6
6
|
|
|
7
7
|
//#region src/utils/test/index.d.ts
|
package/docs/core-concepts.md
CHANGED
|
@@ -51,15 +51,6 @@ db.string({ array: true });
|
|
|
51
51
|
db.string({ optional: true, array: true });
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
The `assertNonNull` option creates a field that doesn't allow null in TypeScript types but does allow null in TailorDB. This is useful for fields like createdAt where non-null values are set through hooks:
|
|
55
|
-
|
|
56
|
-
```typescript
|
|
57
|
-
db.string({ optional: true, assertNonNull: true }).hooks({
|
|
58
|
-
create: () => "created value",
|
|
59
|
-
update: () => "updated value",
|
|
60
|
-
});
|
|
61
|
-
```
|
|
62
|
-
|
|
63
54
|
#### Field Modifiers
|
|
64
55
|
|
|
65
56
|
**Description** - Add a description to field:
|
|
@@ -145,8 +136,8 @@ const userProfile = db.type("UserProfile", {
|
|
|
145
136
|
|
|
146
137
|
```typescript
|
|
147
138
|
db.datetime().hooks({
|
|
148
|
-
create: (
|
|
149
|
-
update: (
|
|
139
|
+
create: () => new Date(),
|
|
140
|
+
update: () => new Date(),
|
|
150
141
|
});
|
|
151
142
|
```
|
|
152
143
|
|
|
@@ -449,7 +440,7 @@ createExecutor({
|
|
|
449
440
|
},
|
|
450
441
|
body: ({ newRecord }) => ({
|
|
451
442
|
id: newRecord.id,
|
|
452
|
-
timestamp: new Date()
|
|
443
|
+
timestamp: new Date(),
|
|
453
444
|
data: newRecord,
|
|
454
445
|
}),
|
|
455
446
|
},
|