@tailor-platform/sdk 2.0.0-next.0 → 2.0.0-next.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.
Files changed (208) hide show
  1. package/CHANGELOG.md +161 -0
  2. package/dist/application-Dtqap5jM.mjs +3 -0
  3. package/dist/{client-CobIRHl-.mjs → application-XuMWK4eq.mjs} +5869 -25
  4. package/dist/application-XuMWK4eq.mjs.map +1 -0
  5. package/dist/{assert-CKfwrmCV.mjs → assert-DBxo8jPo.mjs} +1 -2
  6. package/dist/{assert-CKfwrmCV.mjs.map → assert-DBxo8jPo.mjs.map} +1 -1
  7. package/dist/{authconnection-D8SJGMpj.mjs → authconnection-D2MhtTN5.mjs} +2 -3
  8. package/dist/{authconnection-D8SJGMpj.mjs.map → authconnection-D2MhtTN5.mjs.map} +1 -1
  9. package/dist/{authconnection-BIYzEh2p.d.mts → authconnection-DvUQAjQS.d.mts} +1 -1
  10. package/dist/{brand-DlnJ375c.mjs → brand-Eo4pLXPJ.mjs} +1 -2
  11. package/dist/{brand-DlnJ375c.mjs.map → brand-Eo4pLXPJ.mjs.map} +1 -1
  12. package/dist/cli/index.mjs +241 -237
  13. package/dist/cli/index.mjs.map +1 -1
  14. package/dist/cli/lib.d.mts +547 -620
  15. package/dist/cli/lib.mjs +9 -11
  16. package/dist/cli/lib.mjs.map +1 -1
  17. package/dist/completion/zsh-worker.zsh +4108 -0
  18. package/dist/configure/index.d.mts +9 -7
  19. package/dist/configure/index.mjs +76 -40
  20. package/dist/configure/index.mjs.map +1 -1
  21. package/dist/{context-s0lxhu8_.mjs → context-Bd266-ru.mjs} +2 -3
  22. package/dist/context-Bd266-ru.mjs.map +1 -0
  23. package/dist/{context-CUBwSBq4.d.mts → context-C2lEi9uw.d.mts} +7 -28
  24. package/dist/{crashreport-D1wKBJ8N.mjs → crashreport-BMWcxeSE.mjs} +1 -2
  25. package/dist/{crashreport-BhD0y14F.mjs → crashreport-DFq-vsU0.mjs} +21 -14
  26. package/dist/{crashreport-BhD0y14F.mjs.map → crashreport-DFq-vsU0.mjs.map} +1 -1
  27. package/dist/{enum-constants-C7DaWeQo.mjs → enum-constants-j9QBF0cB.mjs} +1 -2
  28. package/dist/enum-constants-j9QBF0cB.mjs.map +1 -0
  29. package/dist/{errors-EsY4XO6O.mjs → errors-Dtf2WPaW.mjs} +1 -2
  30. package/dist/{errors-EsY4XO6O.mjs.map → errors-Dtf2WPaW.mjs.map} +1 -1
  31. package/dist/{field-C4zdJLW5.mjs → field-DOsJCPFa.mjs} +1 -2
  32. package/dist/field-DOsJCPFa.mjs.map +1 -0
  33. package/dist/{file-B58Dm-2P.mjs → file-BbdFGdMV.mjs} +3 -12
  34. package/dist/file-BbdFGdMV.mjs.map +1 -0
  35. package/dist/{file-BzK8z3X-.d.mts → file-Dq3NIt_F.d.mts} +3 -42
  36. package/dist/{file-utils-BHPxPXmn.mjs → file-utils-CYZnO1pX.mjs} +6 -7
  37. package/dist/file-utils-CYZnO1pX.mjs.map +1 -0
  38. package/dist/{globals-ByrCoDip.mjs → globals-Cf0sxIt8.mjs} +53 -5
  39. package/dist/globals-Cf0sxIt8.mjs.map +1 -0
  40. package/dist/http-adapter.generated-DFsXDdm5.d.mts +581 -0
  41. package/dist/{iconv-kwrmd1U_.d.mts → iconv-Co-TOPuH.d.mts} +1 -1
  42. package/dist/{iconv-DreIffeM.mjs → iconv-D2vi8G36.mjs} +2 -3
  43. package/dist/{iconv-DreIffeM.mjs.map → iconv-D2vi8G36.mjs.map} +1 -1
  44. package/dist/{idp-Ch95ag8h.mjs → idp-BDbK5gjm.mjs} +2 -3
  45. package/dist/{idp-Ch95ag8h.mjs.map → idp-BDbK5gjm.mjs.map} +1 -1
  46. package/dist/{idp-BlBPtXJ-.d.mts → idp-DrhVrLmV.d.mts} +1 -1
  47. package/dist/{index-CLxubakC.d.mts → index-BI-_j9Z3.d.mts} +49 -261
  48. package/dist/{index-CPRnOjjt.d.mts → index-C4JirJH8.d.mts} +2 -2
  49. package/dist/{index-CQZVJ5SX.d.mts → index-CZfWhr0a.d.mts} +2 -2
  50. package/dist/{index-DRhMpdnA.d.mts → index-Cg8VKAdN.d.mts} +8 -8
  51. package/dist/{index-CfRFkXIO.d.mts → index-DYRjoLXD.d.mts} +2 -2
  52. package/dist/index-lFpcjHPU.d.mts +201 -0
  53. package/dist/{index-DUupuPhZ.d.mts → index-nW7hE6oE.d.mts} +2 -2
  54. package/dist/{interceptor-DOqRkCya.mjs → interceptor-D-q1rvRl.mjs} +1 -2
  55. package/dist/{interceptor-DOqRkCya.mjs.map → interceptor-D-q1rvRl.mjs.map} +1 -1
  56. package/dist/kysely/index.mjs +0 -1
  57. package/dist/kysely/index.mjs.map +1 -1
  58. package/dist/{kysely-type-D1e0Vwkd.mjs → kysely-type-DR8uzZTA.mjs} +2 -3
  59. package/dist/kysely-type-DR8uzZTA.mjs.map +1 -0
  60. package/dist/{logger-DpJyJvNz.mjs → logger-CxF-Ex5d.mjs} +1 -2
  61. package/dist/{logger-DpJyJvNz.mjs.map → logger-CxF-Ex5d.mjs.map} +1 -1
  62. package/dist/{mock-DMgIygjE.mjs → mock-FPxmnt-y.mjs} +9 -56
  63. package/dist/mock-FPxmnt-y.mjs.map +1 -0
  64. package/dist/{multiline-Cf9ODpr1.mjs → multiline-sfHpTZZK.mjs} +1 -2
  65. package/dist/{multiline-Cf9ODpr1.mjs.map → multiline-sfHpTZZK.mjs.map} +1 -1
  66. package/dist/{package-json-DcQApfPQ.mjs → package-json-8b0O9TlX.mjs} +1 -2
  67. package/dist/{package-json-DcQApfPQ.mjs.map → package-json-8b0O9TlX.mjs.map} +1 -1
  68. package/dist/package-json-Cv2Z-TqQ.mjs +3 -0
  69. package/dist/plugin/builtin/enum-constants/index.d.mts +1 -1
  70. package/dist/plugin/builtin/enum-constants/index.mjs +1 -2
  71. package/dist/plugin/builtin/file-utils/index.d.mts +1 -1
  72. package/dist/plugin/builtin/file-utils/index.mjs +1 -2
  73. package/dist/plugin/builtin/kysely-type/index.d.mts +1 -1
  74. package/dist/plugin/builtin/kysely-type/index.mjs +1 -2
  75. package/dist/plugin/builtin/seed/index.d.mts +1 -1
  76. package/dist/plugin/builtin/seed/index.mjs +1 -2
  77. package/dist/plugin/index.d.mts +4 -5
  78. package/dist/plugin/index.mjs +0 -1
  79. package/dist/plugin/index.mjs.map +1 -1
  80. package/dist/registry-DH4m7eYo.mjs +53 -0
  81. package/dist/registry-DH4m7eYo.mjs.map +1 -0
  82. package/dist/{repl-editor-CJG3sz7A.mjs → repl-editor-DmGr9zMw.mjs} +2 -3
  83. package/dist/{repl-editor-CJG3sz7A.mjs.map → repl-editor-DmGr9zMw.mjs.map} +1 -1
  84. package/dist/{chunk-BkoGK1jX.mjs → rolldown-runtime-DXywRVcq.mjs} +0 -1
  85. package/dist/runtime/authconnection.d.mts +1 -1
  86. package/dist/runtime/authconnection.mjs +1 -2
  87. package/dist/runtime/context.d.mts +1 -1
  88. package/dist/runtime/context.mjs +1 -2
  89. package/dist/runtime/file.d.mts +2 -2
  90. package/dist/runtime/file.mjs +2 -3
  91. package/dist/runtime/globals.d.mts +8 -41
  92. package/dist/runtime/globals.mjs +0 -1
  93. package/dist/runtime/iconv.d.mts +1 -1
  94. package/dist/runtime/iconv.mjs +1 -2
  95. package/dist/runtime/idp.d.mts +1 -1
  96. package/dist/runtime/idp.mjs +1 -2
  97. package/dist/runtime/index.d.mts +8 -8
  98. package/dist/runtime/index.mjs +7 -8
  99. package/dist/runtime/secretmanager.d.mts +1 -1
  100. package/dist/runtime/secretmanager.mjs +1 -2
  101. package/dist/runtime/workflow.d.mts +2 -2
  102. package/dist/runtime/workflow.mjs +1 -2
  103. package/dist/{runtime-C7qTBDD2.mjs → runtime-CY4JvrDj.mjs} +1069 -542
  104. package/dist/runtime-CY4JvrDj.mjs.map +1 -0
  105. package/dist/{schema-1msIhXwA.mjs → schema-Dtw9Orye.mjs} +18 -16
  106. package/dist/schema-Dtw9Orye.mjs.map +1 -0
  107. package/dist/{secret-file-CWzF8rry.mjs → secret-file-VSVGy1V0.mjs} +27 -3
  108. package/dist/{secret-file-CWzF8rry.mjs.map → secret-file-VSVGy1V0.mjs.map} +1 -1
  109. package/dist/{secretmanager-CKLB3wAQ.d.mts → secretmanager-B3n4KHfm.d.mts} +1 -1
  110. package/dist/{secretmanager-B9h-U_8U.mjs → secretmanager-BVxw3ih_.mjs} +2 -3
  111. package/dist/{secretmanager-B9h-U_8U.mjs.map → secretmanager-BVxw3ih_.mjs.map} +1 -1
  112. package/dist/seed/index.mjs +0 -1
  113. package/dist/seed/index.mjs.map +1 -1
  114. package/dist/{seed-BH2FbrPV.mjs → seed-izIEyP3z.mjs} +7 -19
  115. package/dist/seed-izIEyP3z.mjs.map +1 -0
  116. package/dist/service-DCqIWibD.mjs +3 -0
  117. package/dist/{service-DMohAx8a2.mjs → service-DU1mVzri2.mjs} +3 -4
  118. package/dist/{service-DMohAx8a2.mjs.map → service-DU1mVzri2.mjs.map} +1 -1
  119. package/dist/{service-wI3Hvrgx.mjs → service-DjyqbCaJ.mjs} +9 -10
  120. package/dist/service-DjyqbCaJ.mjs.map +1 -0
  121. package/dist/{telemetry-BQbbVo2t.mjs → telemetry-CdqJEzkj.mjs} +2 -3
  122. package/dist/{telemetry-BQbbVo2t.mjs.map → telemetry-CdqJEzkj.mjs.map} +1 -1
  123. package/dist/telemetry-ClwW5ohF.mjs +3 -0
  124. package/dist/test-env-key-D7UkZp99.mjs +75 -0
  125. package/dist/test-env-key-D7UkZp99.mjs.map +1 -0
  126. package/dist/type-source-DH_LH20p.mjs +13 -0
  127. package/dist/type-source-DH_LH20p.mjs.map +1 -0
  128. package/dist/types-74etvaxy.mjs +4 -0
  129. package/dist/{plugin-C_FyVSdl.d.mts → types-BDRml5C3.d.mts} +128 -188
  130. package/dist/{types-CmzfQP_m.mjs → types-BQijbo4m.mjs} +10 -11
  131. package/dist/types-BQijbo4m.mjs.map +1 -0
  132. package/dist/types-BX4q6Mo6.d.mts +339 -0
  133. package/dist/types-BZ7QKVE8.d.mts +21 -0
  134. package/dist/{tailordb-BlBGmQK-.d.mts → types-CdcQh4Z2.d.mts} +92 -242
  135. package/dist/utils/test/index.d.mts +6 -14
  136. package/dist/utils/test/index.mjs +4 -14
  137. package/dist/utils/test/index.mjs.map +1 -1
  138. package/dist/vitest/environment.mjs +1 -2
  139. package/dist/vitest/environment.mjs.map +1 -1
  140. package/dist/vitest/index.d.mts +42 -5
  141. package/dist/vitest/index.mjs +133 -4
  142. package/dist/vitest/index.mjs.map +1 -1
  143. package/dist/vitest/setup.mjs +2 -3
  144. package/dist/vitest/setup.mjs.map +1 -1
  145. package/dist/{workflow--aPbA8Uq.mjs → workflow-BOmaZwwG.mjs} +9 -5
  146. package/dist/workflow-BOmaZwwG.mjs.map +1 -0
  147. package/dist/{workflow-CMamswkK.d.mts → workflow-BVy4XWjS.d.mts} +15 -10
  148. package/dist/workflow.generated-ClEjBYhm.d.mts +671 -0
  149. package/docs/cli/application.md +0 -2
  150. package/docs/cli/completion.md +3 -0
  151. package/docs/cli/crashreport.md +0 -2
  152. package/docs/cli/executor.md +53 -0
  153. package/docs/cli/function.md +1 -1
  154. package/docs/cli/setup.md +35 -33
  155. package/docs/cli/user.md +3 -3
  156. package/docs/cli/workflow.md +157 -20
  157. package/docs/cli/workspace.md +3 -3
  158. package/docs/cli-reference.md +26 -20
  159. package/docs/configuration.md +0 -2
  160. package/docs/github-actions.md +29 -16
  161. package/docs/migration/v2.md +475 -0
  162. package/docs/plugin/custom.md +2 -2
  163. package/docs/plugin/index.md +1 -1
  164. package/docs/runtime.md +4 -4
  165. package/docs/services/aigateway.md +97 -0
  166. package/docs/services/auth.md +31 -14
  167. package/docs/services/executor.md +3 -5
  168. package/docs/services/resolver.md +8 -10
  169. package/docs/services/tailordb.md +15 -13
  170. package/docs/services/workflow.md +17 -19
  171. package/docs/testing.md +75 -56
  172. package/package.json +18 -17
  173. package/dist/actor-J2gJ0eK5.d.mts +0 -24
  174. package/dist/application-76hhIhnJ.mjs +0 -5594
  175. package/dist/application-76hhIhnJ.mjs.map +0 -1
  176. package/dist/application-av2raLs6.mjs +0 -4
  177. package/dist/cli/skills.d.mts +0 -1
  178. package/dist/cli/skills.mjs +0 -22
  179. package/dist/cli/skills.mjs.map +0 -1
  180. package/dist/client-C68VWo4g.mjs +0 -4
  181. package/dist/client-CobIRHl-.mjs.map +0 -1
  182. package/dist/context-s0lxhu8_.mjs.map +0 -1
  183. package/dist/enum-constants-C7DaWeQo.mjs.map +0 -1
  184. package/dist/env-B-g-qgE4.d.mts +0 -7
  185. package/dist/field-C4zdJLW5.mjs.map +0 -1
  186. package/dist/file-B58Dm-2P.mjs.map +0 -1
  187. package/dist/file-utils-BHPxPXmn.mjs.map +0 -1
  188. package/dist/globals-ByrCoDip.mjs.map +0 -1
  189. package/dist/job-BpsFXPbi.mjs +0 -54
  190. package/dist/job-BpsFXPbi.mjs.map +0 -1
  191. package/dist/kysely-type-D1e0Vwkd.mjs.map +0 -1
  192. package/dist/mock-DMgIygjE.mjs.map +0 -1
  193. package/dist/package-json-wzO6nV9O.mjs +0 -4
  194. package/dist/registry-D0uB0OrK.mjs +0 -178
  195. package/dist/registry-D0uB0OrK.mjs.map +0 -1
  196. package/dist/runtime-C7qTBDD2.mjs.map +0 -1
  197. package/dist/schema-1msIhXwA.mjs.map +0 -1
  198. package/dist/seed-BH2FbrPV.mjs.map +0 -1
  199. package/dist/service-BHQIerYh.mjs +0 -4
  200. package/dist/service-wI3Hvrgx.mjs.map +0 -1
  201. package/dist/telemetry-w92bvGdC.mjs +0 -4
  202. package/dist/types-2Be3wSMc.mjs +0 -5
  203. package/dist/types-CmzfQP_m.mjs.map +0 -1
  204. package/dist/workflow--aPbA8Uq.mjs.map +0 -1
  205. package/dist/workflow.generated-Bf1tWylx.d.mts +0 -1416
  206. package/docs/generator/builtin.md +0 -257
  207. package/docs/generator/custom.md +0 -147
  208. package/docs/generator/index.md +0 -66
@@ -1,1416 +0,0 @@
1
- import { C as FieldOutput$1, D as Validators, E as FieldValidateInput, F as InferFieldsOutput, N as TailorUser, R as Prettify, S as FieldOptions, T as TailorToTs, b as EnumValue, d as TailorDBType$1, f as DBFieldMetadata, g as TailorField, h as SerialConfig, j as InferredAttributeMap, l as TailorDBField$1, m as GqlOperationsConfig, n as RelationType, o as ValueOperand, p as DefinedDBFieldMetadata, r as TailorDBServiceInput, s as TailorAnyDBField$1, t as IndexDef, u as TailorDBInstance$1, v as ArrayFieldOutput, w as TailorFieldType, x as FieldMetadata, y as DefinedFieldMetadata, z as output } from "./tailordb-BlBGmQK-.mjs";
2
- import { B as IdProvider, G as SCIMAttribute, H as OAuth2ClientInput, J as SCIMConfig, L as AuthInvoker, R as BuiltinIdP, V as OAuth2Client, X as TenantProvider, r as PluginConfigs } from "./plugin-C_FyVSdl.mjs";
3
- import { n as TailorEnv } from "./env-B-g-qgE4.mjs";
4
- import { IsAny, JsonObject, NonEmptyObject } from "type-fest";
5
- import { StandardSchemaV1 } from "@standard-schema/spec";
6
-
7
- //#region src/configure/types/field.d.ts
8
- type AllowedValues = readonly [string | EnumValue, ...(string | EnumValue)[]];
9
- type AllowedValuesOutput<V extends AllowedValues> = V[number] extends infer T ? T extends string ? T : T extends {
10
- value: infer K;
11
- } ? K : never : never;
12
- //#endregion
13
- //#region src/configure/services/tailordb/permission.d.ts
14
- /**
15
- * Record-level permission configuration for a TailorDB type.
16
- * Defines create, read, update, and delete permissions.
17
- *
18
- * Prefer object format with explicit `conditions` and `permit` for readability.
19
- * Shorthand array format is supported for compatibility, but less readable.
20
- *
21
- * For update operations, use `newRecord`/`oldRecord` operands instead of `record`.
22
- * @example
23
- * const permission: TailorTypePermission = {
24
- * create: [{ conditions: [[{ user: "_loggedIn" }, "=", true]], permit: true }],
25
- * read: [{ conditions: [[{ record: "isPublic" }, "=", true]], permit: true }],
26
- * update: [{ conditions: [[{ newRecord: "ownerId" }, "=", { user: "id" }]], permit: true }],
27
- * delete: [{ conditions: [[{ record: "ownerId" }, "=", { user: "id" }]], permit: true }],
28
- * };
29
- */
30
- type TailorTypePermission<User extends object = InferredAttributeMap, Type extends object = object> = {
31
- create: readonly ActionPermission<"record", User, Type, false>[];
32
- read: readonly ActionPermission<"record", User, Type, false>[];
33
- update: readonly ActionPermission<"record", User, Type, true>[];
34
- delete: readonly ActionPermission<"record", User, Type, false>[];
35
- };
36
- type ActionPermission<Level extends "record" | "gql" = "record" | "gql", User extends object = InferredAttributeMap, Type extends object = object, Update extends boolean = boolean> = {
37
- conditions: PermissionCondition<Level, User, Update, Type> | readonly PermissionCondition<Level, User, Update, Type>[];
38
- description?: string | undefined;
39
- /**
40
- * Whether matching records are granted (`true`) or denied (`false`).
41
- * Omitting `permit` in this object form defaults to `deny` and emits a
42
- * warning; set it explicitly. (The array shorthand defaults to `allow`.)
43
- */
44
- permit?: boolean;
45
- } | readonly [...PermissionCondition<Level, User, Update, Type>, ...([] | [boolean])] | readonly [...PermissionCondition<Level, User, Update, Type>[], ...([] | [boolean])];
46
- type TailorTypeGqlPermission<User extends object = InferredAttributeMap, Type extends object = object> = readonly GqlPermissionPolicy<User, Type>[];
47
- type GqlPermissionPolicy<User extends object = InferredAttributeMap, Type extends object = object> = {
48
- conditions: readonly PermissionCondition<"gql", User, boolean, Type>[];
49
- actions: "all" | readonly GqlPermissionAction[];
50
- /**
51
- * Whether matching requests are granted (`true`) or denied (`false`).
52
- * Omitting `permit` defaults to `deny` and emits a warning; set it explicitly.
53
- */
54
- permit?: boolean;
55
- description?: string;
56
- };
57
- type GqlPermissionAction = "read" | "create" | "update" | "delete" | "aggregate" | "bulkUpsert";
58
- type EqualityOperator = "=" | "!=";
59
- type ContainsOperator = "in" | "not in";
60
- type HasAnyOperator = "hasAny" | "not hasAny";
61
- type StringFieldKeys<User extends object> = { [K in keyof User]: User[K] extends string ? K : never }[keyof User];
62
- type StringArrayFieldKeys<User extends object> = { [K in keyof User]: User[K] extends string[] ? K : never }[keyof User];
63
- type BooleanFieldKeys<User extends object> = { [K in keyof User]: User[K] extends boolean ? K : never }[keyof User];
64
- type BooleanArrayFieldKeys<User extends object> = { [K in keyof User]: User[K] extends boolean[] ? K : never }[keyof User];
65
- type UserStringOperand<User extends object = InferredAttributeMap> = {
66
- user: StringFieldKeys<User> | "id";
67
- };
68
- type UserStringArrayOperand<User extends object = InferredAttributeMap> = {
69
- user: StringArrayFieldKeys<User>;
70
- };
71
- type UserBooleanOperand<User extends object = InferredAttributeMap> = {
72
- user: BooleanFieldKeys<User> | "_loggedIn";
73
- };
74
- type UserBooleanArrayOperand<User extends object = InferredAttributeMap> = {
75
- user: BooleanArrayFieldKeys<User>;
76
- };
77
- type RecordOperand<Type extends object, Update extends boolean = false> = Update extends true ? {
78
- oldRecord: (keyof Type & string) | "id";
79
- } | {
80
- newRecord: (keyof Type & string) | "id";
81
- } : {
82
- record: (keyof Type & string) | "id";
83
- };
84
- type StringEqualityCondition<Level extends "record" | "gql", User extends object, Update extends boolean, Type extends object> = (Level extends "gql" ? readonly [string, EqualityOperator, boolean] : never) | readonly [string, EqualityOperator, string] | readonly [UserStringOperand<User>, EqualityOperator, string] | readonly [string, EqualityOperator, UserStringOperand<User>] | (Level extends "record" ? readonly [RecordOperand<Type, Update>, EqualityOperator, string | UserStringOperand<User>] | readonly [string | UserStringOperand<User>, EqualityOperator, RecordOperand<Type, Update>] : never);
85
- type BooleanEqualityCondition<Level extends "record" | "gql", User extends object, Update extends boolean, Type extends object> = readonly [boolean, EqualityOperator, boolean] | readonly [UserBooleanOperand<User>, EqualityOperator, boolean] | readonly [boolean, EqualityOperator, UserBooleanOperand<User>] | (Level extends "record" ? readonly [RecordOperand<Type, Update>, EqualityOperator, boolean | UserBooleanOperand<User>] | readonly [boolean | UserBooleanOperand<User>, EqualityOperator, RecordOperand<Type, Update>] : never);
86
- type EqualityCondition<Level extends "record" | "gql" = "record", User extends object = InferredAttributeMap, Update extends boolean = boolean, Type extends object = object> = StringEqualityCondition<Level, User, Update, Type> | BooleanEqualityCondition<Level, User, Update, Type>;
87
- type StringContainsCondition<Level extends "record" | "gql", User extends object, Update extends boolean, Type extends object> = readonly [string, ContainsOperator, string[]] | readonly [UserStringOperand<User>, ContainsOperator, string[]] | readonly [string, ContainsOperator, UserStringArrayOperand<User>] | (Level extends "record" ? readonly [RecordOperand<Type, Update>, ContainsOperator, string[] | UserStringArrayOperand<User>] | readonly [string | UserStringOperand<User>, ContainsOperator, RecordOperand<Type, Update>] : never);
88
- type BooleanContainsCondition<Level extends "record" | "gql", User extends object, Update extends boolean, Type extends object> = (Level extends "gql" ? readonly [string, ContainsOperator, boolean[]] : never) | readonly [boolean, ContainsOperator, boolean[]] | readonly [UserBooleanOperand<User>, ContainsOperator, boolean[]] | readonly [boolean, ContainsOperator, UserBooleanArrayOperand<User>] | (Level extends "record" ? readonly [RecordOperand<Type, Update>, ContainsOperator, boolean[] | UserBooleanArrayOperand<User>] | readonly [boolean | UserBooleanOperand<User>, ContainsOperator, RecordOperand<Type, Update>] : never);
89
- type ContainsCondition<Level extends "record" | "gql" = "record", User extends object = InferredAttributeMap, Update extends boolean = boolean, Type extends object = object> = StringContainsCondition<Level, User, Update, Type> | BooleanContainsCondition<Level, User, Update, Type>;
90
- type HasAnyCondition<Level extends "record" | "gql", User extends object, Update extends boolean, Type extends object> = readonly [string[] | UserStringArrayOperand<User>, HasAnyOperator, string[] | UserStringArrayOperand<User>] | (Level extends "record" ? readonly [RecordOperand<Type, Update>, HasAnyOperator, string[] | UserStringArrayOperand<User>] | readonly [string[] | UserStringArrayOperand<User>, HasAnyOperator, RecordOperand<Type, Update>] : never);
91
- /**
92
- * Type representing a permission condition that combines user attributes, record fields, and literal values using comparison operators.
93
- *
94
- * The User type is extended by `tailor.d.ts`, which is automatically generated when running `tailor-sdk generate`.
95
- * Attributes enabled in the config file's `auth.userProfile.attributes` (or
96
- * `auth.machineUserAttributes` when userProfile is omitted) become available as types.
97
- * @example
98
- * ```ts
99
- * // tailor.config.ts
100
- * export const auth = defineAuth("my-auth", {
101
- * userProfile: {
102
- * type: user,
103
- * attributes: {
104
- * isAdmin: true,
105
- * roles: true,
106
- * }
107
- * }
108
- * });
109
- * ```
110
- */
111
- type PermissionCondition<Level extends "record" | "gql" = "record", User extends object = InferredAttributeMap, Update extends boolean = boolean, Type extends object = object> = EqualityCondition<Level, User, Update, Type> | ContainsCondition<Level, User, Update, Type> | HasAnyCondition<Level, User, Update, Type>;
112
- /**
113
- * Grants full record-level access without any conditions.
114
- *
115
- * Unsafe and intended only for local development, prototyping, or tests.
116
- * Do not use this in production environments, as it effectively disables
117
- * authorization checks.
118
- */
119
- declare const unsafeAllowAllTypePermission: TailorTypePermission;
120
- /**
121
- * Grants full GraphQL access (all actions) without any conditions.
122
- *
123
- * Unsafe and intended only for local development, prototyping, or tests.
124
- * Do not use this in production environments, as it effectively disables
125
- * authorization checks.
126
- */
127
- declare const unsafeAllowAllGqlPermission: TailorTypeGqlPermission;
128
- //#endregion
129
- //#region src/configure/services/tailordb/types.d.ts
130
- type HookFn<TValue, TData, TReturn> = (args: {
131
- value: TValue;
132
- data: TData extends Record<string, unknown> ? { readonly [K in keyof TData]?: TData[K] | null | undefined } : unknown;
133
- user: TailorUser;
134
- }) => TReturn;
135
- type Hook<TData, TReturn> = {
136
- create?: HookFn<TReturn | null, TData, TReturn>;
137
- update?: HookFn<TReturn | null, TData, TReturn>;
138
- };
139
- type Hooks<F extends Record<string, TailorAnyDBField$1>, TData = { [K in keyof F]: output<F[K]> }> = NonEmptyObject<{ [K in Exclude<keyof F, "id"> as F[K]["_defined"] extends {
140
- hooks: unknown;
141
- } ? never : F[K]["_defined"] extends {
142
- type: "nested";
143
- } ? never : K]?: Hook<TData, output<F[K]>> }>;
144
- type ExcludeNestedDBFields<T extends Record<string, TailorAnyDBField$1>> = { [K in keyof T]: T[K] extends TailorDBField$1<{
145
- type: "nested";
146
- array: boolean;
147
- }, any> ? never : T[K] };
148
- interface TypeFeatures {
149
- pluralForm?: string;
150
- aggregation?: true;
151
- bulkUpsert?: true;
152
- /** Configure GraphQL operations for this type. Use "query" for read-only mode, or an object for granular control. */
153
- gqlOperations?: GqlOperationsConfig;
154
- /**
155
- * Enable publishing events for this type.
156
- * When enabled, record creation/update/deletion events are published.
157
- * If not specified, this is automatically set to true when an executor uses this type
158
- * with recordCreated/recordUpdated/recordDeleted triggers. If explicitly set to false
159
- * while an executor uses this type, an error will be thrown during apply.
160
- */
161
- publishEvents?: boolean;
162
- }
163
- //#endregion
164
- //#region src/configure/services/tailordb/schema.d.ts
165
- type TailorAnyDBField = TailorDBField<any, any>;
166
- type TailorAnyDBType = TailorDBType<any, any>;
167
- /**
168
- * Full TailorDBField interface with builder methods.
169
- * Extends the minimal structural interface from types/ with fluent API methods.
170
- */
171
- interface TailorDBField<Defined extends DefinedDBFieldMetadata = DefinedDBFieldMetadata, Output = any> extends Omit<TailorDBField$1<Defined, Output>, "fields"> {
172
- readonly fields: Record<string, TailorAnyDBField>;
173
- _metadata: DBFieldMetadata;
174
- /**
175
- * Parse and validate a value against this field's validation rules
176
- */
177
- parse(args: FieldParseArgs): StandardSchemaV1.Result<Output>;
178
- /**
179
- * Internal parse method that tracks field path for nested validation
180
- * @private
181
- */
182
- _parseInternal(args: FieldParseInternalArgs): StandardSchemaV1.Result<Output>;
183
- /**
184
- * typeName is not available on TailorDB fields.
185
- * Use typeName on pipeline fields (t.enum / t.object) instead.
186
- */
187
- typeName(this: never, typeName: string): never;
188
- /**
189
- * Set a description for the field
190
- */
191
- description<CurrentDefined extends Defined>(this: CurrentDefined extends {
192
- description: unknown;
193
- } ? never : TailorField<CurrentDefined, Output>, description: string): TailorDBField<Prettify<CurrentDefined & {
194
- description: true;
195
- }>, Output>;
196
- /**
197
- * Define a relation to another type.
198
- */
199
- relation<S extends RelationType, T extends TailorAnyDBType, CurrentDefined extends Defined>(this: CurrentDefined extends {
200
- relation: unknown;
201
- } ? never : TailorDBField<CurrentDefined, Output>, config: RelationConfig<S, T>): TailorDBField<S extends "oneToOne" | "1-1" ? Prettify<CurrentDefined & {
202
- unique: true;
203
- index: true;
204
- relation: true;
205
- }> : Prettify<CurrentDefined & {
206
- index: true;
207
- relation: true;
208
- }>, Output>;
209
- /**
210
- * Define a self-referencing relation
211
- */
212
- relation<S extends RelationSelfConfig, CurrentDefined extends Defined>(this: CurrentDefined extends {
213
- relation: unknown;
214
- } ? never : TailorDBField<CurrentDefined, Output>, config: S): TailorDBField<S["type"] extends "oneToOne" | "1-1" ? Prettify<CurrentDefined & {
215
- unique: true;
216
- index: true;
217
- relation: true;
218
- }> : Prettify<CurrentDefined & {
219
- index: true;
220
- relation: true;
221
- }>, Output>;
222
- /**
223
- * Add an index to the field
224
- */
225
- index<CurrentDefined extends Defined>(this: CurrentDefined extends {
226
- index: unknown;
227
- } ? never : CurrentDefined extends {
228
- array: true;
229
- } ? never : TailorDBField<CurrentDefined, Output>): TailorDBField<Prettify<CurrentDefined & {
230
- index: true;
231
- }>, Output>;
232
- /**
233
- * Make the field unique (also adds an index)
234
- */
235
- unique<CurrentDefined extends Defined>(this: CurrentDefined extends {
236
- unique: unknown;
237
- } ? never : CurrentDefined extends {
238
- array: true;
239
- } ? never : TailorDBField<CurrentDefined, Output>): TailorDBField<Prettify<CurrentDefined & {
240
- unique: true;
241
- index: true;
242
- }>, Output>;
243
- /**
244
- * Enable vector search on the field (string type only)
245
- */
246
- vector<CurrentDefined extends Defined>(this: CurrentDefined extends {
247
- vector: unknown;
248
- } ? never : CurrentDefined extends {
249
- type: "string";
250
- array: false;
251
- } ? TailorDBField<CurrentDefined, Output> : never): TailorDBField<Prettify<CurrentDefined & {
252
- vector: true;
253
- }>, Output>;
254
- /**
255
- * Add hooks for create/update operations on this field.
256
- */
257
- hooks<CurrentDefined extends Defined, const H extends Hook<unknown, Output>>(this: CurrentDefined extends {
258
- hooks: unknown;
259
- } ? never : CurrentDefined extends {
260
- type: "nested";
261
- } ? never : TailorDBField<CurrentDefined, Output>, hooks: H): TailorDBField<Prettify<CurrentDefined & {
262
- hooks?: {
263
- create: H extends {
264
- create: unknown;
265
- } ? true : false;
266
- update: H extends {
267
- update: unknown;
268
- } ? true : false;
269
- };
270
- serial: false;
271
- }>, Output>;
272
- /**
273
- * Add validation functions to the field.
274
- */
275
- validate<CurrentDefined extends Defined>(this: CurrentDefined extends {
276
- validate: unknown;
277
- } ? never : TailorDBField<CurrentDefined, Output>, ...validate: FieldValidateInput<Output>[]): TailorDBField<Prettify<CurrentDefined & {
278
- validate: true;
279
- }>, Output>;
280
- /**
281
- * Configure serial/auto-increment behavior
282
- */
283
- serial<CurrentDefined extends Defined>(this: CurrentDefined extends {
284
- serial: unknown;
285
- } ? never : Output extends null ? never : CurrentDefined extends {
286
- type: "integer" | "string";
287
- array: false;
288
- } ? TailorDBField<CurrentDefined, Output> : never, config: SerialConfig<CurrentDefined["type"] & ("integer" | "string")>): TailorDBField<Prettify<CurrentDefined & {
289
- serial: true;
290
- hooks: {
291
- create: false;
292
- update: false;
293
- };
294
- }>, Output>;
295
- /**
296
- * Clone the field with optional overrides for field options
297
- */
298
- clone<const NewOpt extends FieldOptions>(options?: NewOpt): TailorDBField<Prettify<Omit<Defined, "array"> & {
299
- array: NewOpt extends {
300
- array: true;
301
- } ? true : Defined["array"];
302
- }>, FieldOutput$1<TailorToTs[Defined["type"]], NewOpt>>;
303
- }
304
- /**
305
- * Full TailorDBType interface with builder methods.
306
- * Extends the minimal structural interface from types/ with fluent API methods.
307
- */
308
- interface TailorDBType<Fields extends Record<string, TailorAnyDBField> = any, User extends object = InferredAttributeMap> extends TailorDBType$1<Fields, User> {
309
- _description?: string;
310
- hooks(hooks: Hooks<Fields>): TailorDBType<Fields, User>;
311
- validate(validators: Validators<Fields>): TailorDBType<Fields, User>;
312
- features(features: Omit<TypeFeatures, "pluralForm">): TailorDBType<Fields, User>;
313
- indexes(...indexes: IndexDef<TailorDBType<Fields, User>>[]): TailorDBType<Fields, User>;
314
- files<const F extends string>(files: Record<F, string> & Partial<Record<keyof output<TailorDBType<Fields, User>>, never>>): TailorDBType<Fields, User>;
315
- permission<U extends object = User, P extends TailorTypePermission<U, output<TailorDBType<Fields, User>>> = TailorTypePermission<U, output<TailorDBType<Fields, User>>>>(permission: P): TailorDBType<Fields, U>;
316
- gqlPermission<U extends object = User, P extends TailorTypeGqlPermission<U> = TailorTypeGqlPermission<U>>(permission: P): TailorDBType<Fields, U>;
317
- description(description: string): TailorDBType<Fields, User>;
318
- pickFields<K extends keyof Fields>(keys: K[]): Pick<Fields, K>;
319
- pickFields<K extends keyof Fields, const Opt extends FieldOptions>(keys: K[], options: Opt): { [P in K]: Fields[P] extends TailorDBField<infer D, infer _O> ? TailorDBField<Omit<D, "array"> & {
320
- array: Opt extends {
321
- array: true;
322
- } ? true : D["array"];
323
- }, FieldOutput$1<TailorToTs[D["type"]], Opt>> : never };
324
- omitFields<K extends keyof Fields>(keys: K[]): Omit<Fields, K>;
325
- plugin<P extends keyof PluginConfigs<keyof Fields & string>>(config: { [K in P]: PluginConfigs<keyof Fields & string>[K] }): TailorDBType<Fields, User>;
326
- }
327
- type TailorDBInstance<Fields extends Record<string, TailorAnyDBField> = any, User extends object = InferredAttributeMap> = TailorDBType<Fields, User>;
328
- interface RelationConfig<S extends RelationType, T extends TailorDBType> {
329
- type: S;
330
- toward: {
331
- type: T;
332
- as?: string;
333
- key?: keyof T["fields"] & string;
334
- };
335
- backward?: string;
336
- }
337
- type RelationSelfConfig = {
338
- type: RelationType;
339
- toward: {
340
- type: "self";
341
- as?: string;
342
- key?: string;
343
- };
344
- backward?: string;
345
- };
346
- type FieldParseArgs = {
347
- value: unknown;
348
- data: unknown;
349
- user: TailorUser;
350
- };
351
- type FieldParseInternalArgs = {
352
- value: any;
353
- data: unknown;
354
- user: TailorUser;
355
- pathArray: string[];
356
- };
357
- /**
358
- * Create a UUID field.
359
- * @param options - Field configuration options
360
- * @returns A UUID field
361
- * @example db.uuid()
362
- * @example db.uuid({ optional: true })
363
- */
364
- declare function uuid<const Opt extends FieldOptions>(options?: Opt): TailorDBField<{
365
- type: "uuid";
366
- array: Opt extends {
367
- array: true;
368
- } ? true : false;
369
- }, Opt["optional"] extends true ? ArrayFieldOutput<string, Opt> | null : ArrayFieldOutput<string, Opt>>;
370
- /**
371
- * Create a string field.
372
- * @param options - Field configuration options
373
- * @returns A string field
374
- * @example db.string()
375
- * @example db.string({ optional: true })
376
- */
377
- declare function string<const Opt extends FieldOptions>(options?: Opt): TailorDBField<{
378
- type: "string";
379
- array: Opt extends {
380
- array: true;
381
- } ? true : false;
382
- }, Opt["optional"] extends true ? ArrayFieldOutput<string, Opt> | null : ArrayFieldOutput<string, Opt>>;
383
- /**
384
- * Create a boolean field.
385
- * Note: The method name is `bool` but creates a `boolean` type field.
386
- * @param options - Field configuration options
387
- * @returns A boolean field
388
- * @example db.bool()
389
- * @example db.bool({ optional: true })
390
- */
391
- declare function bool<const Opt extends FieldOptions>(options?: Opt): TailorDBField<{
392
- type: "boolean";
393
- array: Opt extends {
394
- array: true;
395
- } ? true : false;
396
- }, Opt["optional"] extends true ? ArrayFieldOutput<boolean, Opt> | null : ArrayFieldOutput<boolean, Opt>>;
397
- /**
398
- * Create an integer field.
399
- * @param options - Field configuration options
400
- * @returns An integer field
401
- * @example db.int()
402
- * @example db.int({ optional: true })
403
- */
404
- declare function int<const Opt extends FieldOptions>(options?: Opt): TailorDBField<{
405
- type: "integer";
406
- array: Opt extends {
407
- array: true;
408
- } ? true : false;
409
- }, Opt["optional"] extends true ? ArrayFieldOutput<number, Opt> | null : ArrayFieldOutput<number, Opt>>;
410
- /**
411
- * Create a float (decimal number) field.
412
- * @param options - Field configuration options
413
- * @returns A float field
414
- * @example db.float()
415
- * @example db.float({ optional: true })
416
- */
417
- declare function float<const Opt extends FieldOptions>(options?: Opt): TailorDBField<{
418
- type: "float";
419
- array: Opt extends {
420
- array: true;
421
- } ? true : false;
422
- }, Opt["optional"] extends true ? ArrayFieldOutput<number, Opt> | null : ArrayFieldOutput<number, Opt>>;
423
- interface DecimalFieldOptions extends FieldOptions {
424
- scale?: number;
425
- }
426
- /**
427
- * Create a decimal field (stored as string for precision).
428
- * @param options - Field configuration options including optional scale (0-12)
429
- * @returns A decimal field
430
- * @example db.decimal()
431
- * @example db.decimal({ scale: 2 })
432
- * @example db.decimal({ scale: 2, optional: true })
433
- */
434
- declare function decimal<const Opt extends DecimalFieldOptions>(options?: Opt): TailorDBField<{
435
- type: "decimal";
436
- array: Opt extends {
437
- array: true;
438
- } ? true : false;
439
- }, Opt["optional"] extends true ? ArrayFieldOutput<string, Opt> | null : ArrayFieldOutput<string, Opt>>;
440
- /**
441
- * Create a date field (date only, no time component).
442
- * Format: "yyyy-MM-dd"
443
- * @param options - Field configuration options
444
- * @returns A date field
445
- * @example db.date()
446
- */
447
- declare function date<const Opt extends FieldOptions>(options?: Opt): TailorDBField<{
448
- type: "date";
449
- array: Opt extends {
450
- array: true;
451
- } ? true : false;
452
- }, Opt["optional"] extends true ? ArrayFieldOutput<string, Opt> | null : ArrayFieldOutput<string, Opt>>;
453
- /**
454
- * Create a datetime field (date and time).
455
- * Format: ISO 8601 "yyyy-MM-ddTHH:mm:ssZ"
456
- * @param options - Field configuration options
457
- * @returns A datetime field
458
- * @example db.datetime()
459
- */
460
- declare function datetime<const Opt extends FieldOptions>(options?: Opt): TailorDBField<{
461
- type: "datetime";
462
- array: Opt extends {
463
- array: true;
464
- } ? true : false;
465
- }, Opt["optional"] extends true ? ArrayFieldOutput<string | Date, Opt> | null : ArrayFieldOutput<string | Date, Opt>>;
466
- /**
467
- * Create a time field (time only, no date component).
468
- * Format: "HH:mm"
469
- * @param options - Field configuration options
470
- * @returns A time field
471
- * @example db.time()
472
- */
473
- declare function time<const Opt extends FieldOptions>(options?: Opt): TailorDBField<{
474
- type: "time";
475
- array: Opt extends {
476
- array: true;
477
- } ? true : false;
478
- }, Opt["optional"] extends true ? ArrayFieldOutput<string, Opt> | null : ArrayFieldOutput<string, Opt>>;
479
- /**
480
- * Create an enum field with a fixed set of allowed string values.
481
- * @param values - Array of allowed string values, or array of `{ value, description }` objects
482
- * @param options - Field configuration options
483
- * @returns An enum field
484
- * @example db.enum(["active", "inactive", "suspended"])
485
- * @example db.enum(["small", "medium", "large"], { optional: true })
486
- */
487
- declare function _enum<const V extends AllowedValues, const Opt extends FieldOptions>(values: V, options?: Opt): TailorDBField<{
488
- type: "enum";
489
- array: Opt extends {
490
- array: true;
491
- } ? true : false;
492
- }, FieldOutput$1<AllowedValuesOutput<V>, Opt>>;
493
- /**
494
- * Create a nested object field with sub-fields.
495
- * @param fields - Record of nested field definitions
496
- * @param options - Field configuration options
497
- * @returns A nested object field
498
- * @example db.object({ street: db.string(), city: db.string(), zip: db.string() })
499
- * @example db.object({ name: db.string() }, { optional: true })
500
- */
501
- declare function object<const F extends Record<string, TailorAnyDBField> & ExcludeNestedDBFields<F>, const Opt extends FieldOptions>(fields: F, options?: Opt): TailorDBField<{
502
- type: "nested";
503
- array: Opt extends {
504
- array: true;
505
- } ? true : false;
506
- }, FieldOutput$1<InferFieldsOutput<F>, Opt>>;
507
- declare const idField: TailorDBField<{
508
- type: "uuid";
509
- array: false;
510
- }, string>;
511
- type idField = typeof idField;
512
- type DBType<F extends {
513
- id?: never;
514
- } & Record<string, TailorAnyDBField>> = TailorDBInstance<{
515
- id: idField;
516
- } & F>;
517
- /**
518
- * Creates a new database type with the specified fields.
519
- * An `id` field (UUID) is automatically added to every type.
520
- * @param name - The name of the type, or a tuple of [name, pluralForm]
521
- * @param fields - The field definitions for the type
522
- * @returns A new TailorDBType instance
523
- * @example
524
- * export const user = db.type("User", {
525
- * name: db.string(),
526
- * email: db.string(),
527
- * age: db.int({ optional: true }),
528
- * role: db.enum(["admin", "member"]),
529
- * ...db.fields.timestamps(),
530
- * });
531
- * // Always export both the value and type:
532
- * export type user = typeof user;
533
- */
534
- declare function dbType<const F extends {
535
- id?: never;
536
- } & Record<string, TailorAnyDBField>>(name: string | [string, string], fields: F): DBType<F>;
537
- /**
538
- * Creates a new database type with the specified fields and description.
539
- * An `id` field (UUID) is automatically added to every type.
540
- * @param name - The name of the type, or a tuple of [name, pluralForm]
541
- * @param description - A description of the type
542
- * @param fields - The field definitions for the type
543
- * @returns A new TailorDBType instance
544
- */
545
- declare function dbType<const F extends {
546
- id?: never;
547
- } & Record<string, TailorAnyDBField>>(name: string | [string, string], description: string, fields: F): DBType<F>;
548
- /** TailorDB schema builder utilities for defining types and fields. */
549
- declare const db: {
550
- type: typeof dbType;
551
- uuid: typeof uuid;
552
- string: typeof string;
553
- bool: typeof bool;
554
- int: typeof int;
555
- float: typeof float;
556
- decimal: typeof decimal;
557
- date: typeof date;
558
- datetime: typeof datetime;
559
- time: typeof time;
560
- enum: typeof _enum;
561
- object: typeof object;
562
- fields: {
563
- /**
564
- * Creates standard timestamp fields (createdAt, updatedAt) with auto-hooks.
565
- * createdAt is set on create, updatedAt is set on update.
566
- * A user-specified createdAt is respected when provided (e.g. seeding historical
567
- * records); the current time is used only when the value is omitted.
568
- * @returns An object with createdAt and updatedAt fields
569
- * @example
570
- * const model = db.type("Model", {
571
- * name: db.string(),
572
- * ...db.fields.timestamps(),
573
- * });
574
- */
575
- timestamps: () => {
576
- createdAt: TailorDBField<{
577
- type: "datetime";
578
- array: false;
579
- hooks?: {
580
- create: true;
581
- update: false;
582
- } | undefined;
583
- serial: false;
584
- description: true;
585
- }, string | Date>;
586
- updatedAt: TailorDBField<{
587
- type: "datetime";
588
- array: false;
589
- hooks?: {
590
- create: false;
591
- update: true;
592
- } | undefined;
593
- serial: false;
594
- description: true;
595
- }, string | Date | null>;
596
- };
597
- };
598
- };
599
- //#endregion
600
- //#region src/types/auth-connection.generated.d.ts
601
- type AuthConnectionOAuth2Config = {
602
- /** OAuth2 provider URL */providerUrl: string; /** OAuth2 issuer URL */
603
- issuerUrl: string; /** OAuth2 client ID */
604
- clientId: string; /** OAuth2 client secret */
605
- clientSecret: string; /** OAuth2 authorization endpoint override */
606
- authUrl?: string | undefined; /** OAuth2 token endpoint override */
607
- tokenUrl?: string | undefined;
608
- };
609
- type AuthConnectionConfig = {
610
- type: "oauth2";
611
- providerUrl: string;
612
- issuerUrl: string;
613
- clientId: string;
614
- clientSecret: string;
615
- authUrl?: string | undefined;
616
- tokenUrl?: string | undefined;
617
- };
618
- //#endregion
619
- //#region src/types/auth.d.ts
620
- type OAuth2ClientGrantType = OAuth2Client["grantTypes"][number];
621
- type SCIMAttributeType = SCIMAttribute["type"];
622
- type AuthInvokerWithName<M extends string> = Omit<AuthInvoker, "machineUserName"> & {
623
- machineUserName: M;
624
- };
625
- /** Result of retrieving a connection token at runtime. */
626
- type AuthConnectionTokenResult = {
627
- access_token: string;
628
- refresh_token?: string;
629
- token_type?: string;
630
- expiry?: string;
631
- };
632
- type AuthAttributeValue = ValueOperand | null | undefined;
633
- type UserFieldKeys<User extends TailorDBInstance$1> = keyof output<User> & string;
634
- type FieldDefined<User extends TailorDBInstance$1, Key extends UserFieldKeys<User>> = User["fields"][Key] extends {
635
- _defined: infer Defined;
636
- } ? Defined : never;
637
- type FieldOutput<User extends TailorDBInstance$1, Key extends UserFieldKeys<User>> = output<User>[Key];
638
- type FieldIsRequired<User extends TailorDBInstance$1, Key extends UserFieldKeys<User>> = undefined extends FieldOutput<User, Key> ? false : true;
639
- type FieldIsOfType<User extends TailorDBInstance$1, Key extends UserFieldKeys<User>, Type extends string> = FieldDefined<User, Key> extends {
640
- type: Type;
641
- } ? true : false;
642
- type FieldIsArray<User extends TailorDBInstance$1, Key extends UserFieldKeys<User>> = FieldDefined<User, Key> extends {
643
- array: true;
644
- } ? true : false;
645
- type FieldIsUnique<User extends TailorDBInstance$1, Key extends UserFieldKeys<User>> = FieldDefined<User, Key> extends {
646
- unique: true;
647
- } ? true : false;
648
- type FieldSupportsValueOperand<User extends TailorDBInstance$1, Key extends UserFieldKeys<User>> = FieldOutput<User, Key> extends ValueOperand | null | undefined ? true : false;
649
- type UsernameFieldKey<User extends TailorDBInstance$1> = 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>];
650
- type UserAttributeKey<User extends TailorDBInstance$1> = { [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>];
651
- type UserAttributeListKey<User extends TailorDBInstance$1> = { [K in UserFieldKeys<User>]: K extends "id" ? never : FieldIsOfType<User, K, "uuid"> extends true ? FieldIsArray<User, K> extends true ? never : K : never }[UserFieldKeys<User>];
652
- type UserAttributeMap<User extends TailorDBInstance$1> = { [K in UserAttributeKey<User>]?: true };
653
- type DisallowExtraKeys<T, Allowed extends PropertyKey> = T & { [K in Exclude<keyof T, Allowed>]: never };
654
- type AttributeListValue<User extends TailorDBInstance$1, Key extends UserAttributeListKey<User>> = Key extends keyof output<User> ? output<User>[Key] : never;
655
- type AttributeListToTuple<User extends TailorDBInstance$1, AttributeList extends readonly UserAttributeListKey<User>[]> = { [Index in keyof AttributeList]: AttributeList[Index] extends UserAttributeListKey<User> ? AttributeListValue<User, AttributeList[Index]> : never };
656
- type AttributeMapSelectedKeys<User extends TailorDBInstance$1, AttributeMap extends UserAttributeMap<User>> = Extract<{ [K in keyof AttributeMap]-?: undefined extends AttributeMap[K] ? never : K }[keyof AttributeMap], UserAttributeKey<User>>;
657
- type UserProfile<User extends TailorDBInstance$1, AttributeMap extends UserAttributeMap<User>, AttributeList extends UserAttributeListKey<User>[]> = {
658
- /**
659
- * TailorDB namespace where the user type is defined.
660
- *
661
- * Usually auto-resolved, so you don't need to specify this.
662
- * Required only when multiple TailorDBs exist and the type is in an external TailorDB.
663
- */
664
- namespace?: string;
665
- type: User;
666
- usernameField: UsernameFieldKey<User>;
667
- attributes?: DisallowExtraKeys<AttributeMap, UserAttributeKey<User>>;
668
- attributeList?: AttributeList;
669
- };
670
- type MachineUserAttributeFields = Record<string, TailorField<DefinedFieldMetadata, unknown, FieldMetadata, TailorFieldType>>;
671
- type TailorFieldOutputValue<Field> = Field extends TailorField<DefinedFieldMetadata, infer Output, FieldMetadata, TailorFieldType> ? Output : never;
672
- type MachineUserAttributeValues<Fields extends MachineUserAttributeFields> = { [K in keyof Fields]: TailorFieldOutputValue<Fields[K]> extends ValueOperand | null | undefined ? TailorFieldOutputValue<Fields[K]> : never };
673
- type MachineUserFromAttributes<Fields extends MachineUserAttributeFields> = (keyof Fields extends never ? {
674
- attributes?: never;
675
- } : {
676
- attributes: DisallowExtraKeys<MachineUserAttributeValues<Fields>, keyof Fields>;
677
- }) & {
678
- attributeList?: string[];
679
- };
680
- type MachineUser<User extends TailorDBInstance$1, AttributeMap extends UserAttributeMap<User> = UserAttributeMap<User>, AttributeList extends UserAttributeListKey<User>[] = [], MachineUserAttributes extends MachineUserAttributeFields | undefined = undefined> = IsAny<MachineUserAttributes> extends true ? IsAny<User> extends true ? {
681
- attributes: Record<string, AuthAttributeValue>;
682
- attributeList?: string[];
683
- } : (AttributeMapSelectedKeys<User, AttributeMap> extends never ? {
684
- attributes?: never;
685
- } : {
686
- attributes: { [K in AttributeMapSelectedKeys<User, AttributeMap>]: K extends keyof output<User> ? output<User>[K] : never } & { [K in Exclude<keyof output<User>, AttributeMapSelectedKeys<User, AttributeMap>>]?: never };
687
- }) & ([] extends AttributeList ? {
688
- attributeList?: never;
689
- } : {
690
- attributeList: AttributeListToTuple<User, AttributeList>;
691
- }) : [MachineUserAttributes] extends [MachineUserAttributeFields] ? MachineUserFromAttributes<MachineUserAttributes> : IsAny<User> extends true ? {
692
- attributes: Record<string, AuthAttributeValue>;
693
- attributeList?: string[];
694
- } : (AttributeMapSelectedKeys<User, AttributeMap> extends never ? {
695
- attributes?: never;
696
- } : {
697
- attributes: { [K in AttributeMapSelectedKeys<User, AttributeMap>]: K extends keyof output<User> ? output<User>[K] : never } & { [K in Exclude<keyof output<User>, AttributeMapSelectedKeys<User, AttributeMap>>]?: never };
698
- }) & ([] extends AttributeList ? {
699
- attributeList?: never;
700
- } : {
701
- attributeList: AttributeListToTuple<User, AttributeList>;
702
- });
703
- type BeforeLoginHookArgs = {
704
- claims: JsonObject;
705
- idpConfigName: string; /** Environment variables defined in `defineConfig({ env })`. */
706
- env: TailorEnv;
707
- };
708
- type BeforeLoginHook<MachineUserNames extends string> = {
709
- handler(args: BeforeLoginHookArgs): Promise<void>;
710
- invoker: NoInfer<MachineUserNames>;
711
- };
712
- type AuthHooks<MachineUserNames extends string> = {
713
- beforeLogin?: BeforeLoginHook<MachineUserNames>;
714
- };
715
- type AuthServiceInput<User extends TailorDBInstance$1, AttributeMap extends UserAttributeMap<User>, AttributeList extends UserAttributeListKey<User>[], MachineUserNames extends string, MachineUserAttributes extends MachineUserAttributeFields | undefined = MachineUserAttributeFields | undefined, ConnectionNames extends string = string> = {
716
- hooks?: AuthHooks<MachineUserNames>;
717
- userProfile?: UserProfile<User, AttributeMap, AttributeList>;
718
- machineUserAttributes?: MachineUserAttributes;
719
- machineUsers?: Record<MachineUserNames, MachineUser<User, AttributeMap, AttributeList, MachineUserAttributes>>;
720
- oauth2Clients?: Record<string, OAuth2ClientInput>;
721
- idProvider?: IdProvider;
722
- scim?: SCIMConfig;
723
- tenantProvider?: TenantProvider;
724
- connections?: Record<ConnectionNames, AuthConnectionConfig>;
725
- publishSessionEvents?: boolean;
726
- };
727
- declare const authDefinitionBrand: unique symbol;
728
- type AuthDefinitionBrand = {
729
- readonly [authDefinitionBrand]: true;
730
- };
731
- type ConnectionNames<Config> = Config extends {
732
- connections?: Record<infer K, unknown>;
733
- } ? K & string : string;
734
- type DefinedAuth<Name extends string, Config, MachineUserNames extends string> = Config & {
735
- name: Name;
736
- /**
737
- * @deprecated Pass the machine user name directly as a string instead, e.g. `authInvoker: "machine-user-name"`.
738
- * Using this function pulls config-layer (Node-only) dependencies into runtime bundles.
739
- */
740
- invoker<M extends MachineUserNames>(machineUser: M): AuthInvokerWithName<M>;
741
- getConnectionToken<C extends ConnectionNames<Config>>(connectionName: C): Promise<AuthConnectionTokenResult>;
742
- } & AuthDefinitionBrand;
743
- type AuthExternalConfig = {
744
- name: string;
745
- external: true;
746
- };
747
- type AuthServiceInputLoose = AuthServiceInput<any, any, any, string, any>;
748
- type AuthOwnConfig = DefinedAuth<string, AuthServiceInputLoose, string>;
749
- type AuthConfig = AuthOwnConfig | AuthExternalConfig;
750
- //#endregion
751
- //#region src/types/app-config.generated.d.ts
752
- type LogLevelEnum = "DEBUG" | "INFO" | "WARN" | "ERROR" | "SILENT";
753
- //#endregion
754
- //#region src/types/idp.generated.d.ts
755
- /**
756
- * Configuration for GraphQL operations on IdP users.
757
- * All operations are enabled by default (undefined or true = enabled, false = disabled).
758
- */
759
- type IdPGqlOperationsInput = "query" | {
760
- create?: boolean | undefined;
761
- update?: boolean | undefined;
762
- delete?: boolean | undefined;
763
- read?: boolean | undefined;
764
- sendPasswordResetEmail?: boolean | undefined;
765
- };
766
- type IdPGqlOperations = {
767
- create?: boolean | undefined;
768
- update?: boolean | undefined;
769
- delete?: boolean | undefined;
770
- read?: boolean | undefined;
771
- sendPasswordResetEmail?: boolean | undefined;
772
- };
773
- /**
774
- * Namespace-level email configuration defaults
775
- */
776
- type IdPEmailConfig = {
777
- /** Default sender display name for emails */fromName?: string | undefined; /** Default subject for password reset emails */
778
- passwordResetSubject?: string | undefined;
779
- };
780
- type IdPInput = {
781
- /** IdP service name */name: string; /** OAuth2 client names that can use this IdP */
782
- clients: string[]; /** Authorization mode for IdP API access */
783
- authorization?: "insecure" | "loggedIn" | {
784
- cel: string;
785
- } | undefined; /** UI language for IdP pages */
786
- lang?: "en" | "ja" | undefined; /** User authentication policy configuration */
787
- userAuthPolicy?: {
788
- useNonEmailIdentifier?: boolean | undefined;
789
- allowSelfPasswordReset?: boolean | undefined;
790
- passwordRequireUppercase?: boolean | undefined;
791
- passwordRequireLowercase?: boolean | undefined;
792
- passwordRequireNonAlphanumeric?: boolean | undefined;
793
- passwordRequireNumeric?: boolean | undefined;
794
- passwordMinLength?: number | undefined;
795
- passwordMaxLength?: number | undefined;
796
- allowedEmailDomains?: string[] | undefined;
797
- allowGoogleOauth?: boolean | undefined;
798
- allowMicrosoftOauth?: boolean | undefined;
799
- disablePasswordAuth?: boolean | undefined;
800
- } | undefined; /** Enable publishing user lifecycle events */
801
- publishUserEvents?: boolean | undefined; /** Configure which GraphQL operations are enabled */
802
- gqlOperations?: "query" | {
803
- create?: boolean | undefined;
804
- update?: boolean | undefined;
805
- delete?: boolean | undefined;
806
- read?: boolean | undefined;
807
- sendPasswordResetEmail?: boolean | undefined;
808
- } | undefined; /** Namespace-level email configuration defaults */
809
- emailConfig?: {
810
- fromName?: string | undefined;
811
- passwordResetSubject?: string | undefined;
812
- } | undefined; /** Per-operation permission policies for IdP users */
813
- permission?: {
814
- create: readonly (readonly [(string | boolean | readonly string[] | readonly boolean[] | {
815
- user: string;
816
- } | {
817
- idpUser: "name" | "id" | "disabled";
818
- } | {
819
- oldIdpUser: "name" | "id" | "disabled";
820
- } | {
821
- newIdpUser: "name" | "id" | "disabled";
822
- }), "in" | "=" | "!=" | "not in", (string | boolean | readonly string[] | readonly boolean[] | {
823
- user: string;
824
- } | {
825
- idpUser: "name" | "id" | "disabled";
826
- } | {
827
- oldIdpUser: "name" | "id" | "disabled";
828
- } | {
829
- newIdpUser: "name" | "id" | "disabled";
830
- })] | readonly [(string | boolean | readonly string[] | readonly boolean[] | {
831
- user: string;
832
- } | {
833
- idpUser: "name" | "id" | "disabled";
834
- } | {
835
- oldIdpUser: "name" | "id" | "disabled";
836
- } | {
837
- newIdpUser: "name" | "id" | "disabled";
838
- }), "in" | "=" | "!=" | "not in", (string | boolean | readonly string[] | readonly boolean[] | {
839
- user: string;
840
- } | {
841
- idpUser: "name" | "id" | "disabled";
842
- } | {
843
- oldIdpUser: "name" | "id" | "disabled";
844
- } | {
845
- newIdpUser: "name" | "id" | "disabled";
846
- }), boolean] | readonly (boolean | readonly [(string | boolean | readonly string[] | readonly boolean[] | {
847
- user: string;
848
- } | {
849
- idpUser: "name" | "id" | "disabled";
850
- } | {
851
- oldIdpUser: "name" | "id" | "disabled";
852
- } | {
853
- newIdpUser: "name" | "id" | "disabled";
854
- }), "in" | "=" | "!=" | "not in", (string | boolean | readonly string[] | readonly boolean[] | {
855
- user: string;
856
- } | {
857
- idpUser: "name" | "id" | "disabled";
858
- } | {
859
- oldIdpUser: "name" | "id" | "disabled";
860
- } | {
861
- newIdpUser: "name" | "id" | "disabled";
862
- })])[] | {
863
- conditions: readonly [(string | boolean | readonly string[] | readonly boolean[] | {
864
- user: string;
865
- } | {
866
- idpUser: "name" | "id" | "disabled";
867
- } | {
868
- oldIdpUser: "name" | "id" | "disabled";
869
- } | {
870
- newIdpUser: "name" | "id" | "disabled";
871
- }), "in" | "=" | "!=" | "not in", (string | boolean | readonly string[] | readonly boolean[] | {
872
- user: string;
873
- } | {
874
- idpUser: "name" | "id" | "disabled";
875
- } | {
876
- oldIdpUser: "name" | "id" | "disabled";
877
- } | {
878
- newIdpUser: "name" | "id" | "disabled";
879
- })] | readonly (readonly [(string | boolean | readonly string[] | readonly boolean[] | {
880
- user: string;
881
- } | {
882
- idpUser: "name" | "id" | "disabled";
883
- } | {
884
- oldIdpUser: "name" | "id" | "disabled";
885
- } | {
886
- newIdpUser: "name" | "id" | "disabled";
887
- }), "in" | "=" | "!=" | "not in", (string | boolean | readonly string[] | readonly boolean[] | {
888
- user: string;
889
- } | {
890
- idpUser: "name" | "id" | "disabled";
891
- } | {
892
- oldIdpUser: "name" | "id" | "disabled";
893
- } | {
894
- newIdpUser: "name" | "id" | "disabled";
895
- })])[];
896
- description?: string | undefined;
897
- permit?: boolean | undefined;
898
- })[];
899
- read: readonly (readonly [(string | boolean | readonly string[] | readonly boolean[] | {
900
- user: string;
901
- } | {
902
- idpUser: "name" | "id" | "disabled";
903
- } | {
904
- oldIdpUser: "name" | "id" | "disabled";
905
- } | {
906
- newIdpUser: "name" | "id" | "disabled";
907
- }), "in" | "=" | "!=" | "not in", (string | boolean | readonly string[] | readonly boolean[] | {
908
- user: string;
909
- } | {
910
- idpUser: "name" | "id" | "disabled";
911
- } | {
912
- oldIdpUser: "name" | "id" | "disabled";
913
- } | {
914
- newIdpUser: "name" | "id" | "disabled";
915
- })] | readonly [(string | boolean | readonly string[] | readonly boolean[] | {
916
- user: string;
917
- } | {
918
- idpUser: "name" | "id" | "disabled";
919
- } | {
920
- oldIdpUser: "name" | "id" | "disabled";
921
- } | {
922
- newIdpUser: "name" | "id" | "disabled";
923
- }), "in" | "=" | "!=" | "not in", (string | boolean | readonly string[] | readonly boolean[] | {
924
- user: string;
925
- } | {
926
- idpUser: "name" | "id" | "disabled";
927
- } | {
928
- oldIdpUser: "name" | "id" | "disabled";
929
- } | {
930
- newIdpUser: "name" | "id" | "disabled";
931
- }), boolean] | readonly (boolean | readonly [(string | boolean | readonly string[] | readonly boolean[] | {
932
- user: string;
933
- } | {
934
- idpUser: "name" | "id" | "disabled";
935
- } | {
936
- oldIdpUser: "name" | "id" | "disabled";
937
- } | {
938
- newIdpUser: "name" | "id" | "disabled";
939
- }), "in" | "=" | "!=" | "not in", (string | boolean | readonly string[] | readonly boolean[] | {
940
- user: string;
941
- } | {
942
- idpUser: "name" | "id" | "disabled";
943
- } | {
944
- oldIdpUser: "name" | "id" | "disabled";
945
- } | {
946
- newIdpUser: "name" | "id" | "disabled";
947
- })])[] | {
948
- conditions: readonly [(string | boolean | readonly string[] | readonly boolean[] | {
949
- user: string;
950
- } | {
951
- idpUser: "name" | "id" | "disabled";
952
- } | {
953
- oldIdpUser: "name" | "id" | "disabled";
954
- } | {
955
- newIdpUser: "name" | "id" | "disabled";
956
- }), "in" | "=" | "!=" | "not in", (string | boolean | readonly string[] | readonly boolean[] | {
957
- user: string;
958
- } | {
959
- idpUser: "name" | "id" | "disabled";
960
- } | {
961
- oldIdpUser: "name" | "id" | "disabled";
962
- } | {
963
- newIdpUser: "name" | "id" | "disabled";
964
- })] | readonly (readonly [(string | boolean | readonly string[] | readonly boolean[] | {
965
- user: string;
966
- } | {
967
- idpUser: "name" | "id" | "disabled";
968
- } | {
969
- oldIdpUser: "name" | "id" | "disabled";
970
- } | {
971
- newIdpUser: "name" | "id" | "disabled";
972
- }), "in" | "=" | "!=" | "not in", (string | boolean | readonly string[] | readonly boolean[] | {
973
- user: string;
974
- } | {
975
- idpUser: "name" | "id" | "disabled";
976
- } | {
977
- oldIdpUser: "name" | "id" | "disabled";
978
- } | {
979
- newIdpUser: "name" | "id" | "disabled";
980
- })])[];
981
- description?: string | undefined;
982
- permit?: boolean | undefined;
983
- })[];
984
- update: readonly (readonly [(string | boolean | readonly string[] | readonly boolean[] | {
985
- user: string;
986
- } | {
987
- idpUser: "name" | "id" | "disabled";
988
- } | {
989
- oldIdpUser: "name" | "id" | "disabled";
990
- } | {
991
- newIdpUser: "name" | "id" | "disabled";
992
- }), "in" | "=" | "!=" | "not in", (string | boolean | readonly string[] | readonly boolean[] | {
993
- user: string;
994
- } | {
995
- idpUser: "name" | "id" | "disabled";
996
- } | {
997
- oldIdpUser: "name" | "id" | "disabled";
998
- } | {
999
- newIdpUser: "name" | "id" | "disabled";
1000
- })] | readonly [(string | boolean | readonly string[] | readonly boolean[] | {
1001
- user: string;
1002
- } | {
1003
- idpUser: "name" | "id" | "disabled";
1004
- } | {
1005
- oldIdpUser: "name" | "id" | "disabled";
1006
- } | {
1007
- newIdpUser: "name" | "id" | "disabled";
1008
- }), "in" | "=" | "!=" | "not in", (string | boolean | readonly string[] | readonly boolean[] | {
1009
- user: string;
1010
- } | {
1011
- idpUser: "name" | "id" | "disabled";
1012
- } | {
1013
- oldIdpUser: "name" | "id" | "disabled";
1014
- } | {
1015
- newIdpUser: "name" | "id" | "disabled";
1016
- }), boolean] | readonly (boolean | readonly [(string | boolean | readonly string[] | readonly boolean[] | {
1017
- user: string;
1018
- } | {
1019
- idpUser: "name" | "id" | "disabled";
1020
- } | {
1021
- oldIdpUser: "name" | "id" | "disabled";
1022
- } | {
1023
- newIdpUser: "name" | "id" | "disabled";
1024
- }), "in" | "=" | "!=" | "not in", (string | boolean | readonly string[] | readonly boolean[] | {
1025
- user: string;
1026
- } | {
1027
- idpUser: "name" | "id" | "disabled";
1028
- } | {
1029
- oldIdpUser: "name" | "id" | "disabled";
1030
- } | {
1031
- newIdpUser: "name" | "id" | "disabled";
1032
- })])[] | {
1033
- conditions: readonly [(string | boolean | readonly string[] | readonly boolean[] | {
1034
- user: string;
1035
- } | {
1036
- idpUser: "name" | "id" | "disabled";
1037
- } | {
1038
- oldIdpUser: "name" | "id" | "disabled";
1039
- } | {
1040
- newIdpUser: "name" | "id" | "disabled";
1041
- }), "in" | "=" | "!=" | "not in", (string | boolean | readonly string[] | readonly boolean[] | {
1042
- user: string;
1043
- } | {
1044
- idpUser: "name" | "id" | "disabled";
1045
- } | {
1046
- oldIdpUser: "name" | "id" | "disabled";
1047
- } | {
1048
- newIdpUser: "name" | "id" | "disabled";
1049
- })] | readonly (readonly [(string | boolean | readonly string[] | readonly boolean[] | {
1050
- user: string;
1051
- } | {
1052
- idpUser: "name" | "id" | "disabled";
1053
- } | {
1054
- oldIdpUser: "name" | "id" | "disabled";
1055
- } | {
1056
- newIdpUser: "name" | "id" | "disabled";
1057
- }), "in" | "=" | "!=" | "not in", (string | boolean | readonly string[] | readonly boolean[] | {
1058
- user: string;
1059
- } | {
1060
- idpUser: "name" | "id" | "disabled";
1061
- } | {
1062
- oldIdpUser: "name" | "id" | "disabled";
1063
- } | {
1064
- newIdpUser: "name" | "id" | "disabled";
1065
- })])[];
1066
- description?: string | undefined;
1067
- permit?: boolean | undefined;
1068
- })[];
1069
- delete: readonly (readonly [(string | boolean | readonly string[] | readonly boolean[] | {
1070
- user: string;
1071
- } | {
1072
- idpUser: "name" | "id" | "disabled";
1073
- } | {
1074
- oldIdpUser: "name" | "id" | "disabled";
1075
- } | {
1076
- newIdpUser: "name" | "id" | "disabled";
1077
- }), "in" | "=" | "!=" | "not in", (string | boolean | readonly string[] | readonly boolean[] | {
1078
- user: string;
1079
- } | {
1080
- idpUser: "name" | "id" | "disabled";
1081
- } | {
1082
- oldIdpUser: "name" | "id" | "disabled";
1083
- } | {
1084
- newIdpUser: "name" | "id" | "disabled";
1085
- })] | readonly [(string | boolean | readonly string[] | readonly boolean[] | {
1086
- user: string;
1087
- } | {
1088
- idpUser: "name" | "id" | "disabled";
1089
- } | {
1090
- oldIdpUser: "name" | "id" | "disabled";
1091
- } | {
1092
- newIdpUser: "name" | "id" | "disabled";
1093
- }), "in" | "=" | "!=" | "not in", (string | boolean | readonly string[] | readonly boolean[] | {
1094
- user: string;
1095
- } | {
1096
- idpUser: "name" | "id" | "disabled";
1097
- } | {
1098
- oldIdpUser: "name" | "id" | "disabled";
1099
- } | {
1100
- newIdpUser: "name" | "id" | "disabled";
1101
- }), boolean] | readonly (boolean | readonly [(string | boolean | readonly string[] | readonly boolean[] | {
1102
- user: string;
1103
- } | {
1104
- idpUser: "name" | "id" | "disabled";
1105
- } | {
1106
- oldIdpUser: "name" | "id" | "disabled";
1107
- } | {
1108
- newIdpUser: "name" | "id" | "disabled";
1109
- }), "in" | "=" | "!=" | "not in", (string | boolean | readonly string[] | readonly boolean[] | {
1110
- user: string;
1111
- } | {
1112
- idpUser: "name" | "id" | "disabled";
1113
- } | {
1114
- oldIdpUser: "name" | "id" | "disabled";
1115
- } | {
1116
- newIdpUser: "name" | "id" | "disabled";
1117
- })])[] | {
1118
- conditions: readonly [(string | boolean | readonly string[] | readonly boolean[] | {
1119
- user: string;
1120
- } | {
1121
- idpUser: "name" | "id" | "disabled";
1122
- } | {
1123
- oldIdpUser: "name" | "id" | "disabled";
1124
- } | {
1125
- newIdpUser: "name" | "id" | "disabled";
1126
- }), "in" | "=" | "!=" | "not in", (string | boolean | readonly string[] | readonly boolean[] | {
1127
- user: string;
1128
- } | {
1129
- idpUser: "name" | "id" | "disabled";
1130
- } | {
1131
- oldIdpUser: "name" | "id" | "disabled";
1132
- } | {
1133
- newIdpUser: "name" | "id" | "disabled";
1134
- })] | readonly (readonly [(string | boolean | readonly string[] | readonly boolean[] | {
1135
- user: string;
1136
- } | {
1137
- idpUser: "name" | "id" | "disabled";
1138
- } | {
1139
- oldIdpUser: "name" | "id" | "disabled";
1140
- } | {
1141
- newIdpUser: "name" | "id" | "disabled";
1142
- }), "in" | "=" | "!=" | "not in", (string | boolean | readonly string[] | readonly boolean[] | {
1143
- user: string;
1144
- } | {
1145
- idpUser: "name" | "id" | "disabled";
1146
- } | {
1147
- oldIdpUser: "name" | "id" | "disabled";
1148
- } | {
1149
- newIdpUser: "name" | "id" | "disabled";
1150
- })])[];
1151
- description?: string | undefined;
1152
- permit?: boolean | undefined;
1153
- })[];
1154
- sendPasswordResetEmail: readonly (readonly [(string | boolean | readonly string[] | readonly boolean[] | {
1155
- user: string;
1156
- } | {
1157
- idpUser: "name" | "id" | "disabled";
1158
- } | {
1159
- oldIdpUser: "name" | "id" | "disabled";
1160
- } | {
1161
- newIdpUser: "name" | "id" | "disabled";
1162
- }), "in" | "=" | "!=" | "not in", (string | boolean | readonly string[] | readonly boolean[] | {
1163
- user: string;
1164
- } | {
1165
- idpUser: "name" | "id" | "disabled";
1166
- } | {
1167
- oldIdpUser: "name" | "id" | "disabled";
1168
- } | {
1169
- newIdpUser: "name" | "id" | "disabled";
1170
- })] | readonly [(string | boolean | readonly string[] | readonly boolean[] | {
1171
- user: string;
1172
- } | {
1173
- idpUser: "name" | "id" | "disabled";
1174
- } | {
1175
- oldIdpUser: "name" | "id" | "disabled";
1176
- } | {
1177
- newIdpUser: "name" | "id" | "disabled";
1178
- }), "in" | "=" | "!=" | "not in", (string | boolean | readonly string[] | readonly boolean[] | {
1179
- user: string;
1180
- } | {
1181
- idpUser: "name" | "id" | "disabled";
1182
- } | {
1183
- oldIdpUser: "name" | "id" | "disabled";
1184
- } | {
1185
- newIdpUser: "name" | "id" | "disabled";
1186
- }), boolean] | readonly (boolean | readonly [(string | boolean | readonly string[] | readonly boolean[] | {
1187
- user: string;
1188
- } | {
1189
- idpUser: "name" | "id" | "disabled";
1190
- } | {
1191
- oldIdpUser: "name" | "id" | "disabled";
1192
- } | {
1193
- newIdpUser: "name" | "id" | "disabled";
1194
- }), "in" | "=" | "!=" | "not in", (string | boolean | readonly string[] | readonly boolean[] | {
1195
- user: string;
1196
- } | {
1197
- idpUser: "name" | "id" | "disabled";
1198
- } | {
1199
- oldIdpUser: "name" | "id" | "disabled";
1200
- } | {
1201
- newIdpUser: "name" | "id" | "disabled";
1202
- })])[] | {
1203
- conditions: readonly [(string | boolean | readonly string[] | readonly boolean[] | {
1204
- user: string;
1205
- } | {
1206
- idpUser: "name" | "id" | "disabled";
1207
- } | {
1208
- oldIdpUser: "name" | "id" | "disabled";
1209
- } | {
1210
- newIdpUser: "name" | "id" | "disabled";
1211
- }), "in" | "=" | "!=" | "not in", (string | boolean | readonly string[] | readonly boolean[] | {
1212
- user: string;
1213
- } | {
1214
- idpUser: "name" | "id" | "disabled";
1215
- } | {
1216
- oldIdpUser: "name" | "id" | "disabled";
1217
- } | {
1218
- newIdpUser: "name" | "id" | "disabled";
1219
- })] | readonly (readonly [(string | boolean | readonly string[] | readonly boolean[] | {
1220
- user: string;
1221
- } | {
1222
- idpUser: "name" | "id" | "disabled";
1223
- } | {
1224
- oldIdpUser: "name" | "id" | "disabled";
1225
- } | {
1226
- newIdpUser: "name" | "id" | "disabled";
1227
- }), "in" | "=" | "!=" | "not in", (string | boolean | readonly string[] | readonly boolean[] | {
1228
- user: string;
1229
- } | {
1230
- idpUser: "name" | "id" | "disabled";
1231
- } | {
1232
- oldIdpUser: "name" | "id" | "disabled";
1233
- } | {
1234
- newIdpUser: "name" | "id" | "disabled";
1235
- })])[];
1236
- description?: string | undefined;
1237
- permit?: boolean | undefined;
1238
- })[];
1239
- } | undefined;
1240
- };
1241
- //#endregion
1242
- //#region src/types/idp.d.ts
1243
- declare const idpDefinitionBrand: unique symbol;
1244
- type IdpDefinitionBrand = {
1245
- readonly [idpDefinitionBrand]: true;
1246
- };
1247
- type DefinedIdp<Name extends string, Config, ClientNames extends string> = Config & {
1248
- name: Name;
1249
- provider(providerName: string, clientName: ClientNames): BuiltinIdP;
1250
- } & IdpDefinitionBrand;
1251
- type IdPExternalConfig = {
1252
- name: string;
1253
- external: true;
1254
- };
1255
- type IdPOwnConfig = Omit<DefinedIdp<string, IdPInput, string>, "provider">;
1256
- type IdPConfig = IdPOwnConfig | IdPExternalConfig;
1257
- type IdPUserField = "id" | "name" | "disabled";
1258
- //#endregion
1259
- //#region src/types/secrets.generated.d.ts
1260
- type Secrets = {
1261
- vaults: {
1262
- [x: string]: {
1263
- [x: string]: string | null | undefined;
1264
- };
1265
- };
1266
- options: {
1267
- ignoreNullishValues: boolean;
1268
- };
1269
- };
1270
- type SecretsInput = Secrets;
1271
- //#endregion
1272
- //#region src/types/secrets-config.d.ts
1273
- declare const secretsDefinitionBrand: unique symbol;
1274
- type SecretsDefinitionBrand = {
1275
- readonly [secretsDefinitionBrand]: true;
1276
- };
1277
- /** Type accepted by `AppConfig.secrets`. Only values returned by `defineSecretManager()` satisfy this. */
1278
- type SecretsConfig = SecretsInput & SecretsDefinitionBrand;
1279
- //#endregion
1280
- //#region src/types/staticwebsite.generated.d.ts
1281
- type StaticWebsite = {
1282
- /** Static website name */name: string; /** Static website description */
1283
- description?: string | undefined; /** IP addresses allowed to access the website */
1284
- allowedIpAddresses?: string[] | undefined; /** Custom domains for the static website */
1285
- customDomains?: string[] | undefined;
1286
- };
1287
- type StaticWebsiteInput = StaticWebsite;
1288
- //#endregion
1289
- //#region src/types/staticwebsite-config.d.ts
1290
- declare const staticWebsiteDefinitionBrand: unique symbol;
1291
- type StaticWebsiteDefinitionBrand = {
1292
- readonly [staticWebsiteDefinitionBrand]: true;
1293
- };
1294
- /** Type accepted by `AppConfig.staticWebsites`. Only values returned by `defineStaticWebSite()` satisfy this. */
1295
- type StaticWebsiteConfig = StaticWebsiteInput & StaticWebsiteDefinitionBrand;
1296
- //#endregion
1297
- //#region src/types/app-config.d.ts
1298
- type LogLevel = LogLevelEnum;
1299
- type LogLevelInput = LogLevel | (string & {});
1300
- type ExecutorServiceConfig = {
1301
- files: string[];
1302
- ignores?: string[];
1303
- };
1304
- type ExecutorServiceInput = ExecutorServiceConfig;
1305
- type HttpAdapterServiceInput = {
1306
- files: string[];
1307
- ignores?: string[];
1308
- };
1309
- type ResolverServiceConfig = {
1310
- files: string[];
1311
- ignores?: string[];
1312
- };
1313
- type ResolverExternalConfig = {
1314
- external: true;
1315
- };
1316
- type ResolverServiceInput = {
1317
- [namespace: string]: ResolverServiceConfig | ResolverExternalConfig;
1318
- };
1319
- type WorkflowServiceConfig = {
1320
- files: string[];
1321
- job_files?: string[];
1322
- ignores?: string[];
1323
- job_ignores?: string[];
1324
- };
1325
- type WorkflowServiceInput = WorkflowServiceConfig;
1326
- /**
1327
- * Application configuration for `defineConfig()`.
1328
- *
1329
- * Key fields:
1330
- * - `name` (required): Application name
1331
- * - `cors`: Array of allowed origins, e.g. `["https://example.com"]`
1332
- * - `auth`: Single auth config object (not an array)
1333
- * - `idp`: Array of IdP configs, e.g. `[myIdp]`
1334
- * - `staticWebsites`: Array of static website configs, e.g. `[website]`
1335
- * - `db`, `resolver`, `executor`, `workflow`: Service configs with file globs
1336
- */
1337
- interface AppConfig<Auth extends AuthConfig = AuthConfig, Idp extends IdPConfig[] = IdPConfig[], StaticWebsites extends StaticWebsiteConfig[] = StaticWebsiteConfig[], Env extends Record<string, string | number | boolean> = Record<string, string | number | boolean>> {
1338
- /** Application name (required). */
1339
- name: string;
1340
- /**
1341
- * Stable identifier used to track the application across renames.
1342
- * Managed by the SDK: auto-generated and written into `tailor.config.ts`
1343
- * on first `deploy`. Delete this field if you want the SDK to assign a
1344
- * new id on the next `deploy` — typical case: `tailor.config.ts` was
1345
- * copied from another project and the new application should not share
1346
- * the original's id. Existing resources are re-tagged with the new id;
1347
- * data is preserved.
1348
- */
1349
- id?: string;
1350
- /** Environment variables accessible via `context.env` in resolvers and via the second argument `{ env }` in workflow job bodies. */
1351
- env?: Env;
1352
- /** Allowed CORS origins. Must be an array of strings, e.g. `["https://example.com"]`. */
1353
- cors?: string[];
1354
- /** IP addresses allowed to access the application. */
1355
- allowedIpAddresses?: string[];
1356
- /** Disable GraphQL introspection in production. */
1357
- disableIntrospection?: boolean;
1358
- /** TailorDB service configuration with type definition files. */
1359
- db?: TailorDBServiceInput;
1360
- /** Resolver service configuration with resolver files. */
1361
- resolver?: ResolverServiceInput;
1362
- /** Identity Provider configurations. Must be an array, e.g. `[myIdp]`. */
1363
- idp?: Idp;
1364
- /** Auth configuration (single object, not an array). */
1365
- auth?: Auth;
1366
- /** Executor service configuration with executor files. */
1367
- executor?: ExecutorServiceInput;
1368
- /** Workflow service configuration with workflow files. */
1369
- workflow?: WorkflowServiceInput;
1370
- /** HTTP adapter service configuration with adapter files. */
1371
- httpAdapter?: HttpAdapterServiceInput;
1372
- /** Static website configurations. Must be an array, e.g. `[website]`. */
1373
- staticWebsites?: StaticWebsites;
1374
- /** Secret Manager vault configurations. Keys are vault names, values are records of secret names to values. */
1375
- secrets?: SecretsConfig;
1376
- /**
1377
- * Enable inline sourcemaps in bundled functions for better error stack traces.
1378
- * @default true
1379
- */
1380
- inlineSourcemap?: boolean;
1381
- /**
1382
- * Controls which `console.*` calls remain in bundled functions.
1383
- * @default "DEBUG"
1384
- */
1385
- logLevel?: LogLevelInput;
1386
- }
1387
- //#endregion
1388
- //#region src/types/http-adapter.generated.d.ts
1389
- type HttpAdapterConfigInput = {
1390
- /** Unique adapter name within the domain */name: string; /** Path pattern with segment wildcards (trailing or single-segment) */
1391
- pathPattern: string; /** Per-method functions that transform HTTP requests to GraphQL requests */
1392
- input: {
1393
- get?: Function | undefined;
1394
- post?: Function | undefined;
1395
- put?: Function | undefined;
1396
- patch?: Function | undefined;
1397
- delete?: Function | undefined;
1398
- }; /** Whether the adapter is active */
1399
- enabled?: boolean | undefined; /** Matching priority; the lowest value wins when multiple adapters match */
1400
- priority?: number | undefined; /** Function that transforms GraphQL response to HTTP response */
1401
- output?: Function | undefined;
1402
- };
1403
- //#endregion
1404
- //#region src/types/workflow.generated.d.ts
1405
- type RetryPolicy = {
1406
- /** Maximum number of retries (1-10) */maxRetries: number; /** Initial backoff duration (e.g., '1s', '500ms', '1m', max 1h) */
1407
- initialBackoff: `${number}ms` | `${number}s` | `${number}m`; /** Maximum backoff duration (e.g., '30s', '5m', max 24h) */
1408
- maxBackoff: `${number}ms` | `${number}s` | `${number}m`; /** Backoff multiplier (>= 1) */
1409
- backoffMultiplier: number;
1410
- };
1411
- type ConcurrencyPolicy = {
1412
- /** Maximum number of concurrent executions (1-1000) */maxConcurrentExecutions: number;
1413
- };
1414
- //#endregion
1415
- export { BeforeLoginHookArgs as A, TailorAnyDBField as B, IdPGqlOperationsInput as C, AuthExternalConfig as D, AuthConnectionTokenResult as E, UserAttributeListKey as F, db as G, TailorDBField as H, UserAttributeMap as I, TailorTypePermission as J, PermissionCondition as K, UsernameFieldKey as L, OAuth2ClientGrantType as M, SCIMAttributeType as N, AuthOwnConfig as O, UserAttributeKey as P, AllowedValuesOutput as Q, AuthConnectionConfig as R, IdPGqlOperations as S, AuthConfig as T, TailorDBInstance as U, TailorAnyDBType as V, TailorDBType as W, unsafeAllowAllTypePermission as X, unsafeAllowAllGqlPermission as Y, AllowedValues as Z, IdPConfig as _, ExecutorServiceConfig as a, IdpDefinitionBrand as b, ResolverServiceConfig as c, WorkflowServiceInput as d, StaticWebsiteConfig as f, SecretsDefinitionBrand as g, SecretsConfig as h, AppConfig as i, DefinedAuth as j, AuthServiceInput as k, ResolverServiceInput as l, StaticWebsiteInput as m, RetryPolicy as n, ExecutorServiceInput as o, StaticWebsiteDefinitionBrand as p, TailorTypeGqlPermission as q, HttpAdapterConfigInput as r, ResolverExternalConfig as s, ConcurrencyPolicy as t, WorkflowServiceConfig as u, IdPExternalConfig as v, IdPInput as w, IdPEmailConfig as x, IdPUserField as y, AuthConnectionOAuth2Config as z };
1416
- //# sourceMappingURL=workflow.generated-Bf1tWylx.d.mts.map