@tailor-platform/sdk 1.66.1 → 2.0.0-next.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.
Files changed (198) hide show
  1. package/CHANGELOG.md +89 -2
  2. package/dist/application-DB2r36Et.mjs +3 -0
  3. package/dist/{application-DGDmL8i_.mjs → application-DqS1yBg3.mjs} +188 -128
  4. package/dist/application-DqS1yBg3.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 +78 -131
  13. package/dist/cli/index.mjs.map +1 -1
  14. package/dist/cli/lib.d.mts +15 -154
  15. package/dist/cli/lib.mjs +9 -10
  16. package/dist/cli/lib.mjs.map +1 -1
  17. package/dist/{client-boxXYevx.mjs → client-Dbohmtkv.mjs} +1 -2
  18. package/dist/{client-F0a4cWUM.mjs → client-z_oHGVNy.mjs} +8 -6
  19. package/dist/client-z_oHGVNy.mjs.map +1 -0
  20. package/dist/completion/zsh-worker.zsh +5 -19
  21. package/dist/configure/index.d.mts +8 -7
  22. package/dist/configure/index.mjs +11 -28
  23. package/dist/configure/index.mjs.map +1 -1
  24. package/dist/{context-s0lxhu8_.mjs → context-Bd266-ru.mjs} +2 -3
  25. package/dist/{context-s0lxhu8_.mjs.map → context-Bd266-ru.mjs.map} +1 -1
  26. package/dist/{context-CUBwSBq4.d.mts → context-BuuIb8CC.d.mts} +1 -1
  27. package/dist/{crashreport-0EHy-ayY.mjs → crashreport-BsjAkFWw.mjs} +19 -10
  28. package/dist/{crashreport-0EHy-ayY.mjs.map → crashreport-BsjAkFWw.mjs.map} +1 -1
  29. package/dist/{crashreport-Bf6uT6mf.mjs → crashreport-pr6Rhvza.mjs} +1 -2
  30. package/dist/{enum-constants-C7DaWeQo.mjs → enum-constants-j9QBF0cB.mjs} +1 -2
  31. package/dist/enum-constants-j9QBF0cB.mjs.map +1 -0
  32. package/dist/{errors-EsY4XO6O.mjs → errors-Dtf2WPaW.mjs} +1 -2
  33. package/dist/{errors-EsY4XO6O.mjs.map → errors-Dtf2WPaW.mjs.map} +1 -1
  34. package/dist/{field-C4zdJLW5.mjs → field-DOsJCPFa.mjs} +1 -2
  35. package/dist/field-DOsJCPFa.mjs.map +1 -0
  36. package/dist/{file-BzK8z3X-.d.mts → file-BB8Vs9O_.d.mts} +1 -1
  37. package/dist/{file-B58Dm-2P.mjs → file-_oUZo76X.mjs} +2 -3
  38. package/dist/{file-B58Dm-2P.mjs.map → file-_oUZo76X.mjs.map} +1 -1
  39. package/dist/{file-utils-BHPxPXmn.mjs → file-utils-DcyIPFQh.mjs} +2 -3
  40. package/dist/{file-utils-BHPxPXmn.mjs.map → file-utils-DcyIPFQh.mjs.map} +1 -1
  41. package/dist/{globals-ByrCoDip.mjs → globals-Crz8o65k.mjs} +53 -5
  42. package/dist/globals-Crz8o65k.mjs.map +1 -0
  43. package/dist/http-adapter.generated-WgMnb7Sb.d.mts +580 -0
  44. package/dist/{iconv-kwrmd1U_.d.mts → iconv-Co-TOPuH.d.mts} +1 -1
  45. package/dist/{iconv-DreIffeM.mjs → iconv-D2vi8G36.mjs} +2 -3
  46. package/dist/{iconv-DreIffeM.mjs.map → iconv-D2vi8G36.mjs.map} +1 -1
  47. package/dist/{idp-Ch95ag8h.mjs → idp-BDbK5gjm.mjs} +2 -3
  48. package/dist/{idp-Ch95ag8h.mjs.map → idp-BDbK5gjm.mjs.map} +1 -1
  49. package/dist/{idp-BlBPtXJ-.d.mts → idp-DrhVrLmV.d.mts} +1 -1
  50. package/dist/{index-QpC0TNbH.d.mts → index-5vPyRu1y.d.mts} +2 -2
  51. package/dist/{index-Bhjep8cS.d.mts → index-B7AKc18V.d.mts} +2 -2
  52. package/dist/{index-BdLqzJDu.d.mts → index-BlpzXncY.d.mts} +25 -247
  53. package/dist/{index-DRhMpdnA.d.mts → index-CK7u9isy.d.mts} +8 -8
  54. package/dist/{index-CZ2r3qiO.d.mts → index-CNYe5lnW.d.mts} +2 -2
  55. package/dist/{index-Db2RvnEH.d.mts → index-DjUdWlzf.d.mts} +2 -2
  56. package/dist/index-ZePLwxw7.d.mts +208 -0
  57. package/dist/{interceptor-DOqRkCya.mjs → interceptor-D-q1rvRl.mjs} +1 -2
  58. package/dist/{interceptor-DOqRkCya.mjs.map → interceptor-D-q1rvRl.mjs.map} +1 -1
  59. package/dist/{job-BpsFXPbi.mjs → job-fuc3j1Ma.mjs} +9 -10
  60. package/dist/job-fuc3j1Ma.mjs.map +1 -0
  61. package/dist/kysely/index.mjs +0 -1
  62. package/dist/kysely/index.mjs.map +1 -1
  63. package/dist/{kysely-type-D1e0Vwkd.mjs → kysely-type-DR8uzZTA.mjs} +2 -3
  64. package/dist/kysely-type-DR8uzZTA.mjs.map +1 -0
  65. package/dist/{logger-DpJyJvNz.mjs → logger-CxF-Ex5d.mjs} +1 -2
  66. package/dist/{logger-DpJyJvNz.mjs.map → logger-CxF-Ex5d.mjs.map} +1 -1
  67. package/dist/{mock-DMgIygjE.mjs → mock-BjFj5o1I.mjs} +9 -11
  68. package/dist/mock-BjFj5o1I.mjs.map +1 -0
  69. package/dist/{multiline-Cf9ODpr1.mjs → multiline-sfHpTZZK.mjs} +1 -2
  70. package/dist/{multiline-Cf9ODpr1.mjs.map → multiline-sfHpTZZK.mjs.map} +1 -1
  71. package/dist/{package-json-DcQApfPQ.mjs → package-json-8b0O9TlX.mjs} +1 -2
  72. package/dist/{package-json-DcQApfPQ.mjs.map → package-json-8b0O9TlX.mjs.map} +1 -1
  73. package/dist/package-json-Cv2Z-TqQ.mjs +3 -0
  74. package/dist/plugin/builtin/enum-constants/index.d.mts +1 -1
  75. package/dist/plugin/builtin/enum-constants/index.mjs +1 -2
  76. package/dist/plugin/builtin/file-utils/index.d.mts +1 -1
  77. package/dist/plugin/builtin/file-utils/index.mjs +1 -2
  78. package/dist/plugin/builtin/kysely-type/index.d.mts +1 -1
  79. package/dist/plugin/builtin/kysely-type/index.mjs +1 -2
  80. package/dist/plugin/builtin/seed/index.d.mts +1 -1
  81. package/dist/plugin/builtin/seed/index.mjs +1 -2
  82. package/dist/plugin/index.d.mts +1 -3
  83. package/dist/plugin/index.mjs +0 -1
  84. package/dist/plugin/index.mjs.map +1 -1
  85. package/dist/registry-DdsYlL_P.mjs +51 -0
  86. package/dist/registry-DdsYlL_P.mjs.map +1 -0
  87. package/dist/{repl-editor-CJG3sz7A.mjs → repl-editor-DmGr9zMw.mjs} +2 -3
  88. package/dist/{repl-editor-CJG3sz7A.mjs.map → repl-editor-DmGr9zMw.mjs.map} +1 -1
  89. package/dist/{chunk-BkoGK1jX.mjs → rolldown-runtime-DXywRVcq.mjs} +0 -1
  90. package/dist/runtime/authconnection.d.mts +1 -1
  91. package/dist/runtime/authconnection.mjs +1 -2
  92. package/dist/runtime/context.d.mts +1 -1
  93. package/dist/runtime/context.mjs +1 -2
  94. package/dist/runtime/file.d.mts +1 -1
  95. package/dist/runtime/file.mjs +1 -2
  96. package/dist/runtime/globals.d.mts +6 -39
  97. package/dist/runtime/globals.mjs +0 -1
  98. package/dist/runtime/iconv.d.mts +1 -1
  99. package/dist/runtime/iconv.mjs +1 -2
  100. package/dist/runtime/idp.d.mts +1 -1
  101. package/dist/runtime/idp.mjs +1 -2
  102. package/dist/runtime/index.d.mts +8 -8
  103. package/dist/runtime/index.mjs +7 -8
  104. package/dist/runtime/secretmanager.d.mts +1 -1
  105. package/dist/runtime/secretmanager.mjs +1 -2
  106. package/dist/runtime/workflow.d.mts +1 -1
  107. package/dist/runtime/workflow.mjs +1 -2
  108. package/dist/{runtime-2nzOZCUb.mjs → runtime-n9NCkjee.mjs} +65 -232
  109. package/dist/runtime-n9NCkjee.mjs.map +1 -0
  110. package/dist/{schema-1msIhXwA.mjs → schema-BhkpP5Hw.mjs} +3 -4
  111. package/dist/schema-BhkpP5Hw.mjs.map +1 -0
  112. package/dist/{secret-file-CWzF8rry.mjs → secret-file-DBqZhjFQ.mjs} +1 -2
  113. package/dist/{secret-file-CWzF8rry.mjs.map → secret-file-DBqZhjFQ.mjs.map} +1 -1
  114. package/dist/{secretmanager-CKLB3wAQ.d.mts → secretmanager-B3n4KHfm.d.mts} +1 -1
  115. package/dist/{secretmanager-B9h-U_8U.mjs → secretmanager-BVxw3ih_.mjs} +2 -3
  116. package/dist/{secretmanager-B9h-U_8U.mjs.map → secretmanager-BVxw3ih_.mjs.map} +1 -1
  117. package/dist/seed/index.mjs +0 -1
  118. package/dist/seed/index.mjs.map +1 -1
  119. package/dist/{seed-BH2FbrPV.mjs → seed-jf3008-h.mjs} +5 -16
  120. package/dist/seed-jf3008-h.mjs.map +1 -0
  121. package/dist/{service-wI3Hvrgx.mjs → service-CCL8ruDf.mjs} +3 -4
  122. package/dist/service-CCL8ruDf.mjs.map +1 -0
  123. package/dist/service-D6yonf2I.mjs +3 -0
  124. package/dist/{service-DMohAx8a2.mjs → service-DU1mVzri.mjs} +3 -4
  125. package/dist/service-DU1mVzri.mjs.map +1 -0
  126. package/dist/{telemetry-BQbbVo2t.mjs → telemetry-CdqJEzkj.mjs} +2 -3
  127. package/dist/{telemetry-BQbbVo2t.mjs.map → telemetry-CdqJEzkj.mjs.map} +1 -1
  128. package/dist/telemetry-ClwW5ohF.mjs +3 -0
  129. package/dist/test-env-key-D9kM6ETE.mjs +49 -0
  130. package/dist/test-env-key-D9kM6ETE.mjs.map +1 -0
  131. package/dist/type-source-DH_LH20p.mjs +13 -0
  132. package/dist/type-source-DH_LH20p.mjs.map +1 -0
  133. package/dist/{types-CmzfQP_m.mjs → types-B2RpYyA_.mjs} +2 -3
  134. package/dist/types-B2RpYyA_.mjs.map +1 -0
  135. package/dist/types-ClhIrW_C.mjs +4 -0
  136. package/dist/{tailordb-C-ar4XCX.d.mts → types-DCUhgpyI.d.mts} +142 -221
  137. package/dist/{plugin-DylAsA4Z.d.mts → types-DhO_VEZd.d.mts} +119 -179
  138. package/dist/types-DwDgacni.d.mts +338 -0
  139. package/dist/utils/test/index.d.mts +4 -3
  140. package/dist/utils/test/index.mjs +1 -2
  141. package/dist/utils/test/index.mjs.map +1 -1
  142. package/dist/vitest/environment.mjs +1 -2
  143. package/dist/vitest/environment.mjs.map +1 -1
  144. package/dist/vitest/index.d.mts +42 -5
  145. package/dist/vitest/index.mjs +133 -4
  146. package/dist/vitest/index.mjs.map +1 -1
  147. package/dist/vitest/setup.mjs +2 -3
  148. package/dist/vitest/setup.mjs.map +1 -1
  149. package/dist/{workflow-CMamswkK.d.mts → workflow-BbKvGLQg.d.mts} +1 -1
  150. package/dist/{workflow--aPbA8Uq.mjs → workflow-DgemCAz3.mjs} +2 -3
  151. package/dist/{workflow--aPbA8Uq.mjs.map → workflow-DgemCAz3.mjs.map} +1 -1
  152. package/dist/workflow.generated-DtQwEo-x.d.mts +671 -0
  153. package/docs/cli/application.md +0 -2
  154. package/docs/cli/crashreport.md +0 -2
  155. package/docs/cli/function.md +1 -1
  156. package/docs/cli/user.md +3 -3
  157. package/docs/cli/workspace.md +3 -3
  158. package/docs/configuration.md +0 -2
  159. package/docs/plugin/custom.md +2 -2
  160. package/docs/plugin/index.md +1 -1
  161. package/docs/runtime.md +3 -3
  162. package/docs/services/auth.md +0 -2
  163. package/docs/services/executor.md +0 -2
  164. package/docs/services/resolver.md +2 -4
  165. package/docs/services/tailordb.md +1 -1
  166. package/docs/services/workflow.md +13 -15
  167. package/docs/testing.md +18 -11
  168. package/package.json +9 -8
  169. package/dist/actor-D_2aJjYO.d.mts +0 -24
  170. package/dist/application-DGDmL8i_.mjs.map +0 -1
  171. package/dist/application-nTydHJm8.mjs +0 -4
  172. package/dist/cli/skills.d.mts +0 -1
  173. package/dist/cli/skills.mjs +0 -22
  174. package/dist/cli/skills.mjs.map +0 -1
  175. package/dist/client-F0a4cWUM.mjs.map +0 -1
  176. package/dist/enum-constants-C7DaWeQo.mjs.map +0 -1
  177. package/dist/env-B-g-qgE4.d.mts +0 -7
  178. package/dist/field-C4zdJLW5.mjs.map +0 -1
  179. package/dist/globals-ByrCoDip.mjs.map +0 -1
  180. package/dist/job-BpsFXPbi.mjs.map +0 -1
  181. package/dist/kysely-type-D1e0Vwkd.mjs.map +0 -1
  182. package/dist/mock-DMgIygjE.mjs.map +0 -1
  183. package/dist/package-json-wzO6nV9O.mjs +0 -4
  184. package/dist/registry-D0uB0OrK.mjs +0 -178
  185. package/dist/registry-D0uB0OrK.mjs.map +0 -1
  186. package/dist/runtime-2nzOZCUb.mjs.map +0 -1
  187. package/dist/schema-1msIhXwA.mjs.map +0 -1
  188. package/dist/seed-BH2FbrPV.mjs.map +0 -1
  189. package/dist/service-BHQIerYh.mjs +0 -4
  190. package/dist/service-DMohAx8a2.mjs.map +0 -1
  191. package/dist/service-wI3Hvrgx.mjs.map +0 -1
  192. package/dist/telemetry-w92bvGdC.mjs +0 -4
  193. package/dist/types-2Be3wSMc.mjs +0 -5
  194. package/dist/types-CmzfQP_m.mjs.map +0 -1
  195. package/dist/workflow.generated--1Qc15Et.d.mts +0 -1471
  196. package/docs/generator/builtin.md +0 -257
  197. package/docs/generator/custom.md +0 -147
  198. package/docs/generator/index.md +0 -66
@@ -0,0 +1,580 @@
1
+ import { A as Validators, D as TailorField, E as FieldValidateInput, F as output, P as Prettify, S as EnumValue, T as FieldOutput, U as TailorUser, a as Hooks, b as ArrayFieldOutput, g as TailorDBType$1, i as Hook, j as InferFieldsOutput, k as TailorToTs, l as RelationType, n as DefinedDBFieldMetadata, o as IndexDef, p as TailorDBField$1, r as ExcludeNestedDBFields, t as DBFieldMetadata, u as SerialConfig, v as TypeFeatures, w as FieldOptions, z as InferredAttributeMap } from "./types-DCUhgpyI.mjs";
2
+ import { a as PluginConfigs } from "./types-DhO_VEZd.mjs";
3
+ import { StandardSchemaV1 } from "@standard-schema/spec";
4
+
5
+ //#region src/configure/types/field.d.ts
6
+ type AllowedValues = readonly [string | EnumValue, ...(string | EnumValue)[]];
7
+ type AllowedValuesOutput<V extends AllowedValues> = V[number] extends infer T ? T extends string ? T : T extends {
8
+ value: infer K;
9
+ } ? K : never : never;
10
+ //#endregion
11
+ //#region src/configure/services/tailordb/permission.d.ts
12
+ /**
13
+ * Record-level permission configuration for a TailorDB type.
14
+ * Defines create, read, update, and delete permissions.
15
+ *
16
+ * Prefer object format with explicit `conditions` and `permit` for readability.
17
+ * Shorthand array format is supported for compatibility, but less readable.
18
+ *
19
+ * For update operations, use `newRecord`/`oldRecord` operands instead of `record`.
20
+ * @example
21
+ * const permission: TailorTypePermission = {
22
+ * create: [{ conditions: [[{ user: "_loggedIn" }, "=", true]], permit: true }],
23
+ * read: [{ conditions: [[{ record: "isPublic" }, "=", true]], permit: true }],
24
+ * update: [{ conditions: [[{ newRecord: "ownerId" }, "=", { user: "id" }]], permit: true }],
25
+ * delete: [{ conditions: [[{ record: "ownerId" }, "=", { user: "id" }]], permit: true }],
26
+ * };
27
+ */
28
+ type TailorTypePermission<User extends object = InferredAttributeMap, Type extends object = object> = {
29
+ create: readonly ActionPermission<"record", User, Type, false>[];
30
+ read: readonly ActionPermission<"record", User, Type, false>[];
31
+ update: readonly ActionPermission<"record", User, Type, true>[];
32
+ delete: readonly ActionPermission<"record", User, Type, false>[];
33
+ };
34
+ type ActionPermission<Level extends "record" | "gql" = "record" | "gql", User extends object = InferredAttributeMap, Type extends object = object, Update extends boolean = boolean> = {
35
+ conditions: PermissionCondition<Level, User, Update, Type> | readonly PermissionCondition<Level, User, Update, Type>[];
36
+ description?: string | undefined;
37
+ /**
38
+ * Whether matching records are granted (`true`) or denied (`false`).
39
+ * Omitting `permit` in this object form defaults to `deny` and emits a
40
+ * warning; set it explicitly. (The array shorthand defaults to `allow`.)
41
+ */
42
+ permit?: boolean;
43
+ } | readonly [...PermissionCondition<Level, User, Update, Type>, ...([] | [boolean])] | readonly [...PermissionCondition<Level, User, Update, Type>[], ...([] | [boolean])];
44
+ type TailorTypeGqlPermission<User extends object = InferredAttributeMap, Type extends object = object> = readonly GqlPermissionPolicy<User, Type>[];
45
+ type GqlPermissionPolicy<User extends object = InferredAttributeMap, Type extends object = object> = {
46
+ conditions: readonly PermissionCondition<"gql", User, boolean, Type>[];
47
+ actions: "all" | readonly GqlPermissionAction[];
48
+ /**
49
+ * Whether matching requests are granted (`true`) or denied (`false`).
50
+ * Omitting `permit` defaults to `deny` and emits a warning; set it explicitly.
51
+ */
52
+ permit?: boolean;
53
+ description?: string;
54
+ };
55
+ type GqlPermissionAction = "read" | "create" | "update" | "delete" | "aggregate" | "bulkUpsert";
56
+ type EqualityOperator = "=" | "!=";
57
+ type ContainsOperator = "in" | "not in";
58
+ type HasAnyOperator = "hasAny" | "not hasAny";
59
+ type StringFieldKeys<User extends object> = { [K in keyof User]: User[K] extends string ? K : never }[keyof User];
60
+ type StringArrayFieldKeys<User extends object> = { [K in keyof User]: User[K] extends string[] ? K : never }[keyof User];
61
+ type BooleanFieldKeys<User extends object> = { [K in keyof User]: User[K] extends boolean ? K : never }[keyof User];
62
+ type BooleanArrayFieldKeys<User extends object> = { [K in keyof User]: User[K] extends boolean[] ? K : never }[keyof User];
63
+ type UserStringOperand<User extends object = InferredAttributeMap> = {
64
+ user: StringFieldKeys<User> | "id";
65
+ };
66
+ type UserStringArrayOperand<User extends object = InferredAttributeMap> = {
67
+ user: StringArrayFieldKeys<User>;
68
+ };
69
+ type UserBooleanOperand<User extends object = InferredAttributeMap> = {
70
+ user: BooleanFieldKeys<User> | "_loggedIn";
71
+ };
72
+ type UserBooleanArrayOperand<User extends object = InferredAttributeMap> = {
73
+ user: BooleanArrayFieldKeys<User>;
74
+ };
75
+ type RecordOperand<Type extends object, Update extends boolean = false> = Update extends true ? {
76
+ oldRecord: (keyof Type & string) | "id";
77
+ } | {
78
+ newRecord: (keyof Type & string) | "id";
79
+ } : {
80
+ record: (keyof Type & string) | "id";
81
+ };
82
+ 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);
83
+ 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);
84
+ 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>;
85
+ 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);
86
+ 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);
87
+ 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>;
88
+ 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);
89
+ /**
90
+ * Type representing a permission condition that combines user attributes, record fields, and literal values using comparison operators.
91
+ *
92
+ * The User type is extended by `tailor.d.ts`, which is automatically generated when running `tailor-sdk generate`.
93
+ * Attributes enabled in the config file's `auth.userProfile.attributes` (or
94
+ * `auth.machineUserAttributes` when userProfile is omitted) become available as types.
95
+ * @example
96
+ * ```ts
97
+ * // tailor.config.ts
98
+ * export const auth = defineAuth("my-auth", {
99
+ * userProfile: {
100
+ * type: user,
101
+ * attributes: {
102
+ * isAdmin: true,
103
+ * roles: true,
104
+ * }
105
+ * }
106
+ * });
107
+ * ```
108
+ */
109
+ 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>;
110
+ /**
111
+ * Grants full record-level access without any conditions.
112
+ *
113
+ * Unsafe and intended only for local development, prototyping, or tests.
114
+ * Do not use this in production environments, as it effectively disables
115
+ * authorization checks.
116
+ */
117
+ declare const unsafeAllowAllTypePermission: TailorTypePermission;
118
+ /**
119
+ * Grants full GraphQL access (all actions) without any conditions.
120
+ *
121
+ * Unsafe and intended only for local development, prototyping, or tests.
122
+ * Do not use this in production environments, as it effectively disables
123
+ * authorization checks.
124
+ */
125
+ declare const unsafeAllowAllGqlPermission: TailorTypeGqlPermission;
126
+ //#endregion
127
+ //#region src/configure/services/tailordb/schema.d.ts
128
+ type TailorAnyDBField = TailorDBField<any, any>;
129
+ type TailorAnyDBType = TailorDBType<any, any>;
130
+ /**
131
+ * Full TailorDBField interface with builder methods.
132
+ * Extends the minimal structural interface from types/ with fluent API methods.
133
+ */
134
+ interface TailorDBField<Defined extends DefinedDBFieldMetadata = DefinedDBFieldMetadata, Output = any> extends Omit<TailorDBField$1<Defined, Output>, "fields"> {
135
+ readonly fields: Record<string, TailorAnyDBField>;
136
+ _metadata: DBFieldMetadata;
137
+ /**
138
+ * Parse and validate a value against this field's validation rules
139
+ */
140
+ parse(args: FieldParseArgs): StandardSchemaV1.Result<Output>;
141
+ /**
142
+ * Internal parse method that tracks field path for nested validation
143
+ * @private
144
+ */
145
+ _parseInternal(args: FieldParseInternalArgs): StandardSchemaV1.Result<Output>;
146
+ /**
147
+ * typeName is not available on TailorDB fields.
148
+ * Use typeName on pipeline fields (t.enum / t.object) instead.
149
+ */
150
+ typeName(this: never, typeName: string): never;
151
+ /**
152
+ * Set a description for the field
153
+ */
154
+ description<CurrentDefined extends Defined>(this: CurrentDefined extends {
155
+ description: unknown;
156
+ } ? never : TailorField<CurrentDefined, Output>, description: string): TailorDBField<Prettify<CurrentDefined & {
157
+ description: true;
158
+ }>, Output>;
159
+ /**
160
+ * Define a relation to another type.
161
+ */
162
+ relation<S extends RelationType, T extends TailorAnyDBType, CurrentDefined extends Defined>(this: CurrentDefined extends {
163
+ relation: unknown;
164
+ } ? never : TailorDBField<CurrentDefined, Output>, config: RelationConfig<S, T>): TailorDBField<S extends "oneToOne" | "1-1" ? Prettify<CurrentDefined & {
165
+ unique: true;
166
+ index: true;
167
+ relation: true;
168
+ }> : Prettify<CurrentDefined & {
169
+ index: true;
170
+ relation: true;
171
+ }>, Output>;
172
+ /**
173
+ * Define a self-referencing relation
174
+ */
175
+ relation<S extends RelationSelfConfig, CurrentDefined extends Defined>(this: CurrentDefined extends {
176
+ relation: unknown;
177
+ } ? never : TailorDBField<CurrentDefined, Output>, config: S): TailorDBField<S["type"] extends "oneToOne" | "1-1" ? Prettify<CurrentDefined & {
178
+ unique: true;
179
+ index: true;
180
+ relation: true;
181
+ }> : Prettify<CurrentDefined & {
182
+ index: true;
183
+ relation: true;
184
+ }>, Output>;
185
+ /**
186
+ * Add an index to the field
187
+ */
188
+ index<CurrentDefined extends Defined>(this: CurrentDefined extends {
189
+ index: unknown;
190
+ } ? never : CurrentDefined extends {
191
+ array: true;
192
+ } ? never : TailorDBField<CurrentDefined, Output>): TailorDBField<Prettify<CurrentDefined & {
193
+ index: true;
194
+ }>, Output>;
195
+ /**
196
+ * Make the field unique (also adds an index)
197
+ */
198
+ unique<CurrentDefined extends Defined>(this: CurrentDefined extends {
199
+ unique: unknown;
200
+ } ? never : CurrentDefined extends {
201
+ array: true;
202
+ } ? never : TailorDBField<CurrentDefined, Output>): TailorDBField<Prettify<CurrentDefined & {
203
+ unique: true;
204
+ index: true;
205
+ }>, Output>;
206
+ /**
207
+ * Enable vector search on the field (string type only)
208
+ */
209
+ vector<CurrentDefined extends Defined>(this: CurrentDefined extends {
210
+ vector: unknown;
211
+ } ? never : CurrentDefined extends {
212
+ type: "string";
213
+ array: false;
214
+ } ? TailorDBField<CurrentDefined, Output> : never): TailorDBField<Prettify<CurrentDefined & {
215
+ vector: true;
216
+ }>, Output>;
217
+ /**
218
+ * Add hooks for create/update operations on this field.
219
+ */
220
+ hooks<CurrentDefined extends Defined, const H extends Hook<unknown, Output>>(this: CurrentDefined extends {
221
+ hooks: unknown;
222
+ } ? never : CurrentDefined extends {
223
+ type: "nested";
224
+ } ? never : TailorDBField<CurrentDefined, Output>, hooks: H): TailorDBField<Prettify<CurrentDefined & {
225
+ hooks?: {
226
+ create: H extends {
227
+ create: unknown;
228
+ } ? true : false;
229
+ update: H extends {
230
+ update: unknown;
231
+ } ? true : false;
232
+ };
233
+ serial: false;
234
+ }>, Output>;
235
+ /**
236
+ * Add validation functions to the field.
237
+ */
238
+ validate<CurrentDefined extends Defined>(this: CurrentDefined extends {
239
+ validate: unknown;
240
+ } ? never : TailorDBField<CurrentDefined, Output>, ...validate: FieldValidateInput<Output>[]): TailorDBField<Prettify<CurrentDefined & {
241
+ validate: true;
242
+ }>, Output>;
243
+ /**
244
+ * Configure serial/auto-increment behavior
245
+ */
246
+ serial<CurrentDefined extends Defined>(this: CurrentDefined extends {
247
+ serial: unknown;
248
+ } ? never : Output extends null ? never : CurrentDefined extends {
249
+ type: "integer" | "string";
250
+ array: false;
251
+ } ? TailorDBField<CurrentDefined, Output> : never, config: SerialConfig<CurrentDefined["type"] & ("integer" | "string")>): TailorDBField<Prettify<CurrentDefined & {
252
+ serial: true;
253
+ hooks: {
254
+ create: false;
255
+ update: false;
256
+ };
257
+ }>, Output>;
258
+ /**
259
+ * Clone the field with optional overrides for field options
260
+ */
261
+ clone<const NewOpt extends FieldOptions>(options?: NewOpt): TailorDBField<Prettify<Omit<Defined, "array"> & {
262
+ array: NewOpt extends {
263
+ array: true;
264
+ } ? true : Defined["array"];
265
+ }>, FieldOutput<TailorToTs[Defined["type"]], NewOpt>>;
266
+ }
267
+ /**
268
+ * Full TailorDBType interface with builder methods.
269
+ * Extends the minimal structural interface from types/ with fluent API methods.
270
+ */
271
+ interface TailorDBType<Fields extends Record<string, TailorAnyDBField> = any, User extends object = InferredAttributeMap> extends TailorDBType$1<Fields, User> {
272
+ _description?: string;
273
+ hooks(hooks: Hooks<Fields>): TailorDBType<Fields, User>;
274
+ validate(validators: Validators<Fields>): TailorDBType<Fields, User>;
275
+ features(features: Omit<TypeFeatures, "pluralForm">): TailorDBType<Fields, User>;
276
+ indexes(...indexes: IndexDef<TailorDBType<Fields, User>>[]): TailorDBType<Fields, User>;
277
+ files<const F extends string>(files: Record<F, string> & Partial<Record<keyof output<TailorDBType<Fields, User>>, never>>): TailorDBType<Fields, User>;
278
+ permission<U extends object = User, P extends TailorTypePermission<U, output<TailorDBType<Fields, User>>> = TailorTypePermission<U, output<TailorDBType<Fields, User>>>>(permission: P): TailorDBType<Fields, U>;
279
+ gqlPermission<U extends object = User, P extends TailorTypeGqlPermission<U> = TailorTypeGqlPermission<U>>(permission: P): TailorDBType<Fields, U>;
280
+ description(description: string): TailorDBType<Fields, User>;
281
+ pickFields<K extends keyof Fields>(keys: K[]): Pick<Fields, K>;
282
+ 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"> & {
283
+ array: Opt extends {
284
+ array: true;
285
+ } ? true : D["array"];
286
+ }, FieldOutput<TailorToTs[D["type"]], Opt>> : never };
287
+ omitFields<K extends keyof Fields>(keys: K[]): Omit<Fields, K>;
288
+ plugin<P extends keyof PluginConfigs<keyof Fields & string>>(config: { [K in P]: PluginConfigs<keyof Fields & string>[K] }): TailorDBType<Fields, User>;
289
+ }
290
+ type TailorDBInstance<Fields extends Record<string, TailorAnyDBField> = any, User extends object = InferredAttributeMap> = TailorDBType<Fields, User>;
291
+ interface RelationConfig<S extends RelationType, T extends TailorDBType> {
292
+ type: S;
293
+ toward: {
294
+ type: T;
295
+ as?: string;
296
+ key?: keyof T["fields"] & string;
297
+ };
298
+ backward?: string;
299
+ }
300
+ type RelationSelfConfig = {
301
+ type: RelationType;
302
+ toward: {
303
+ type: "self";
304
+ as?: string;
305
+ key?: string;
306
+ };
307
+ backward?: string;
308
+ };
309
+ type FieldParseArgs = {
310
+ value: unknown;
311
+ data: unknown;
312
+ user: TailorUser;
313
+ };
314
+ type FieldParseInternalArgs = {
315
+ value: any;
316
+ data: unknown;
317
+ user: TailorUser;
318
+ pathArray: string[];
319
+ };
320
+ /**
321
+ * Create a UUID field.
322
+ * @param options - Field configuration options
323
+ * @returns A UUID field
324
+ * @example db.uuid()
325
+ * @example db.uuid({ optional: true })
326
+ */
327
+ declare function uuid<const Opt extends FieldOptions>(options?: Opt): TailorDBField<{
328
+ type: "uuid";
329
+ array: Opt extends {
330
+ array: true;
331
+ } ? true : false;
332
+ }, Opt["optional"] extends true ? ArrayFieldOutput<string, Opt> | null : ArrayFieldOutput<string, Opt>>;
333
+ /**
334
+ * Create a string field.
335
+ * @param options - Field configuration options
336
+ * @returns A string field
337
+ * @example db.string()
338
+ * @example db.string({ optional: true })
339
+ */
340
+ declare function string<const Opt extends FieldOptions>(options?: Opt): TailorDBField<{
341
+ type: "string";
342
+ array: Opt extends {
343
+ array: true;
344
+ } ? true : false;
345
+ }, Opt["optional"] extends true ? ArrayFieldOutput<string, Opt> | null : ArrayFieldOutput<string, Opt>>;
346
+ /**
347
+ * Create a boolean field.
348
+ * Note: The method name is `bool` but creates a `boolean` type field.
349
+ * @param options - Field configuration options
350
+ * @returns A boolean field
351
+ * @example db.bool()
352
+ * @example db.bool({ optional: true })
353
+ */
354
+ declare function bool<const Opt extends FieldOptions>(options?: Opt): TailorDBField<{
355
+ type: "boolean";
356
+ array: Opt extends {
357
+ array: true;
358
+ } ? true : false;
359
+ }, Opt["optional"] extends true ? ArrayFieldOutput<boolean, Opt> | null : ArrayFieldOutput<boolean, Opt>>;
360
+ /**
361
+ * Create an integer field.
362
+ * @param options - Field configuration options
363
+ * @returns An integer field
364
+ * @example db.int()
365
+ * @example db.int({ optional: true })
366
+ */
367
+ declare function int<const Opt extends FieldOptions>(options?: Opt): TailorDBField<{
368
+ type: "integer";
369
+ array: Opt extends {
370
+ array: true;
371
+ } ? true : false;
372
+ }, Opt["optional"] extends true ? ArrayFieldOutput<number, Opt> | null : ArrayFieldOutput<number, Opt>>;
373
+ /**
374
+ * Create a float (decimal number) field.
375
+ * @param options - Field configuration options
376
+ * @returns A float field
377
+ * @example db.float()
378
+ * @example db.float({ optional: true })
379
+ */
380
+ declare function float<const Opt extends FieldOptions>(options?: Opt): TailorDBField<{
381
+ type: "float";
382
+ array: Opt extends {
383
+ array: true;
384
+ } ? true : false;
385
+ }, Opt["optional"] extends true ? ArrayFieldOutput<number, Opt> | null : ArrayFieldOutput<number, Opt>>;
386
+ interface DecimalFieldOptions extends FieldOptions {
387
+ scale?: number;
388
+ }
389
+ /**
390
+ * Create a decimal field (stored as string for precision).
391
+ * @param options - Field configuration options including optional scale (0-12)
392
+ * @returns A decimal field
393
+ * @example db.decimal()
394
+ * @example db.decimal({ scale: 2 })
395
+ * @example db.decimal({ scale: 2, optional: true })
396
+ */
397
+ declare function decimal<const Opt extends DecimalFieldOptions>(options?: Opt): TailorDBField<{
398
+ type: "decimal";
399
+ array: Opt extends {
400
+ array: true;
401
+ } ? true : false;
402
+ }, Opt["optional"] extends true ? ArrayFieldOutput<string, Opt> | null : ArrayFieldOutput<string, Opt>>;
403
+ /**
404
+ * Create a date field (date only, no time component).
405
+ * Format: "yyyy-MM-dd"
406
+ * @param options - Field configuration options
407
+ * @returns A date field
408
+ * @example db.date()
409
+ */
410
+ declare function date<const Opt extends FieldOptions>(options?: Opt): TailorDBField<{
411
+ type: "date";
412
+ array: Opt extends {
413
+ array: true;
414
+ } ? true : false;
415
+ }, Opt["optional"] extends true ? ArrayFieldOutput<string, Opt> | null : ArrayFieldOutput<string, Opt>>;
416
+ /**
417
+ * Create a datetime field (date and time).
418
+ * Format: ISO 8601 "yyyy-MM-ddTHH:mm:ssZ"
419
+ * @param options - Field configuration options
420
+ * @returns A datetime field
421
+ * @example db.datetime()
422
+ */
423
+ declare function datetime<const Opt extends FieldOptions>(options?: Opt): TailorDBField<{
424
+ type: "datetime";
425
+ array: Opt extends {
426
+ array: true;
427
+ } ? true : false;
428
+ }, Opt["optional"] extends true ? ArrayFieldOutput<string | Date, Opt> | null : ArrayFieldOutput<string | Date, Opt>>;
429
+ /**
430
+ * Create a time field (time only, no date component).
431
+ * Format: "HH:mm"
432
+ * @param options - Field configuration options
433
+ * @returns A time field
434
+ * @example db.time()
435
+ */
436
+ declare function time<const Opt extends FieldOptions>(options?: Opt): TailorDBField<{
437
+ type: "time";
438
+ array: Opt extends {
439
+ array: true;
440
+ } ? true : false;
441
+ }, Opt["optional"] extends true ? ArrayFieldOutput<string, Opt> | null : ArrayFieldOutput<string, Opt>>;
442
+ /**
443
+ * Create an enum field with a fixed set of allowed string values.
444
+ * @param values - Array of allowed string values, or array of `{ value, description }` objects
445
+ * @param options - Field configuration options
446
+ * @returns An enum field
447
+ * @example db.enum(["active", "inactive", "suspended"])
448
+ * @example db.enum(["small", "medium", "large"], { optional: true })
449
+ */
450
+ declare function _enum<const V extends AllowedValues, const Opt extends FieldOptions>(values: V, options?: Opt): TailorDBField<{
451
+ type: "enum";
452
+ array: Opt extends {
453
+ array: true;
454
+ } ? true : false;
455
+ }, FieldOutput<AllowedValuesOutput<V>, Opt>>;
456
+ /**
457
+ * Create a nested object field with sub-fields.
458
+ * @param fields - Record of nested field definitions
459
+ * @param options - Field configuration options
460
+ * @returns A nested object field
461
+ * @example db.object({ street: db.string(), city: db.string(), zip: db.string() })
462
+ * @example db.object({ name: db.string() }, { optional: true })
463
+ */
464
+ declare function object<const F extends Record<string, TailorAnyDBField> & ExcludeNestedDBFields<F>, const Opt extends FieldOptions>(fields: F, options?: Opt): TailorDBField<{
465
+ type: "nested";
466
+ array: Opt extends {
467
+ array: true;
468
+ } ? true : false;
469
+ }, FieldOutput<InferFieldsOutput<F>, Opt>>;
470
+ declare const idField: TailorDBField<{
471
+ type: "uuid";
472
+ array: false;
473
+ }, string>;
474
+ type idField = typeof idField;
475
+ type DBType<F extends {
476
+ id?: never;
477
+ } & Record<string, TailorAnyDBField>> = TailorDBInstance<{
478
+ id: idField;
479
+ } & F>;
480
+ /**
481
+ * Creates a new database type with the specified fields.
482
+ * An `id` field (UUID) is automatically added to every type.
483
+ * @param name - The name of the type, or a tuple of [name, pluralForm]
484
+ * @param fields - The field definitions for the type
485
+ * @returns A new TailorDBType instance
486
+ * @example
487
+ * export const user = db.type("User", {
488
+ * name: db.string(),
489
+ * email: db.string(),
490
+ * age: db.int({ optional: true }),
491
+ * role: db.enum(["admin", "member"]),
492
+ * ...db.fields.timestamps(),
493
+ * });
494
+ * // Always export both the value and type:
495
+ * export type user = typeof user;
496
+ */
497
+ declare function dbType<const F extends {
498
+ id?: never;
499
+ } & Record<string, TailorAnyDBField>>(name: string | [string, string], fields: F): DBType<F>;
500
+ /**
501
+ * Creates a new database type with the specified fields and description.
502
+ * An `id` field (UUID) is automatically added to every type.
503
+ * @param name - The name of the type, or a tuple of [name, pluralForm]
504
+ * @param description - A description of the type
505
+ * @param fields - The field definitions for the type
506
+ * @returns A new TailorDBType instance
507
+ */
508
+ declare function dbType<const F extends {
509
+ id?: never;
510
+ } & Record<string, TailorAnyDBField>>(name: string | [string, string], description: string, fields: F): DBType<F>;
511
+ /** TailorDB schema builder utilities for defining types and fields. */
512
+ declare const db: {
513
+ type: typeof dbType;
514
+ uuid: typeof uuid;
515
+ string: typeof string;
516
+ bool: typeof bool;
517
+ int: typeof int;
518
+ float: typeof float;
519
+ decimal: typeof decimal;
520
+ date: typeof date;
521
+ datetime: typeof datetime;
522
+ time: typeof time;
523
+ enum: typeof _enum;
524
+ object: typeof object;
525
+ fields: {
526
+ /**
527
+ * Creates standard timestamp fields (createdAt, updatedAt) with auto-hooks.
528
+ * createdAt is set on create, updatedAt is set on update.
529
+ * A user-specified createdAt is respected when provided (e.g. seeding historical
530
+ * records); the current time is used only when the value is omitted.
531
+ * @returns An object with createdAt and updatedAt fields
532
+ * @example
533
+ * const model = db.type("Model", {
534
+ * name: db.string(),
535
+ * ...db.fields.timestamps(),
536
+ * });
537
+ */
538
+ timestamps: () => {
539
+ createdAt: TailorDBField<{
540
+ type: "datetime";
541
+ array: false;
542
+ hooks?: {
543
+ create: true;
544
+ update: false;
545
+ } | undefined;
546
+ serial: false;
547
+ description: true;
548
+ }, string | Date>;
549
+ updatedAt: TailorDBField<{
550
+ type: "datetime";
551
+ array: false;
552
+ hooks?: {
553
+ create: false;
554
+ update: true;
555
+ } | undefined;
556
+ serial: false;
557
+ description: true;
558
+ }, string | Date | null>;
559
+ };
560
+ };
561
+ };
562
+ //#endregion
563
+ //#region src/types/http-adapter.generated.d.ts
564
+ type HttpAdapterConfigInput = {
565
+ /** Unique adapter name within the domain */name: string; /** Path pattern with segment wildcards (trailing or single-segment) */
566
+ pathPattern: string; /** Per-method functions that transform HTTP requests to GraphQL requests */
567
+ input: {
568
+ get?: Function | undefined;
569
+ post?: Function | undefined;
570
+ put?: Function | undefined;
571
+ patch?: Function | undefined;
572
+ delete?: Function | undefined;
573
+ }; /** Whether the adapter is active */
574
+ enabled?: boolean | undefined; /** Matching priority; the lowest value wins when multiple adapters match */
575
+ priority?: number | undefined; /** Function that transforms GraphQL response to HTTP response */
576
+ output?: Function | undefined;
577
+ };
578
+ //#endregion
579
+ export { TailorDBInstance as a, PermissionCondition as c, unsafeAllowAllGqlPermission as d, unsafeAllowAllTypePermission as f, TailorDBField as i, TailorTypeGqlPermission as l, AllowedValuesOutput as m, TailorAnyDBField as n, TailorDBType as o, AllowedValues as p, TailorAnyDBType as r, db as s, HttpAdapterConfigInput as t, TailorTypePermission as u };
580
+ //# sourceMappingURL=http-adapter.generated-WgMnb7Sb.d.mts.map
@@ -119,4 +119,4 @@ declare class Iconv {
119
119
  }
120
120
  //#endregion
121
121
  export { convert as a, encode as c, TailorIconvAPI as i, encodings as l, IconvConstructor as n, convertBuffer as o, IconvInstance as r, decode as s, Iconv as t, iconv_d_exports as u };
122
- //# sourceMappingURL=iconv-kwrmd1U_.d.mts.map
122
+ //# sourceMappingURL=iconv-Co-TOPuH.d.mts.map
@@ -1,5 +1,4 @@
1
-
2
- import { t as __exportAll } from "./chunk-BkoGK1jX.mjs";
1
+ import { t as __exportAll } from "./rolldown-runtime-DXywRVcq.mjs";
3
2
 
4
3
  //#region src/runtime/iconv.ts
5
4
  var iconv_exports = /* @__PURE__ */ __exportAll({
@@ -61,4 +60,4 @@ var Iconv = class {
61
60
 
62
61
  //#endregion
63
62
  export { encode as a, decode as i, convert as n, encodings as o, convertBuffer as r, iconv_exports as s, Iconv as t };
64
- //# sourceMappingURL=iconv-DreIffeM.mjs.map
63
+ //# sourceMappingURL=iconv-D2vi8G36.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"iconv-DreIffeM.mjs","names":[],"sources":["../src/runtime/iconv.ts"],"sourcesContent":["/**\n * Character encoding conversion utilities.\n *\n * Thin typed wrapper around the platform-provided `tailor.iconv` runtime API.\n * At runtime this delegates to `globalThis.tailor.iconv`, which is provided by\n * the Tailor Platform Function runtime. Use `mockIconv` from\n * `@tailor-platform/sdk/vitest` to mock these calls in unit tests.\n * @example\n * import { iconv } from \"@tailor-platform/sdk/runtime\";\n *\n * const utf8 = iconv.convert(sjisBuffer, \"Shift_JIS\", \"UTF-8\"); // string\n * const sjis = iconv.convert(\"こんにちは\", \"UTF-8\", \"Shift_JIS\"); // Uint8Array\n *\n * const conv = new iconv.Iconv(\"Shift_JIS\", \"UTF-8\");\n * const out = conv.convert(sjisBuffer);\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/** Instance methods exposed by `tailor.iconv.Iconv`. */\nexport interface IconvInstance {\n convert(input: string | Uint8Array | ArrayBuffer): string | Uint8Array;\n}\n\n/** Constructor shape for `tailor.iconv.Iconv`. */\nexport interface IconvConstructor {\n new (fromEncoding: string, toEncoding: string): IconvInstance;\n}\n\n/**\n * Platform API surface for `tailor.iconv`. Describes the shape the platform\n * runtime injects on `globalThis.tailor.iconv` so the wrapper and ambient\n * globals stay in sync.\n *\n * Each method below is also re-exported as a top-level named export from this\n * module (e.g. `convert`, `decode`, `encode`) so callers can either\n * `import * as iconv from \"@tailor-platform/sdk/runtime/iconv\"` or pick\n * individual methods.\n */\nexport interface TailorIconvAPI {\n /**\n * Convert a string or buffer between encodings.\n * @param str - Input data to convert\n * @param fromEncoding - Source encoding name\n * @param toEncoding - Target encoding name\n * @returns `string` when `toEncoding` is `\"UTF8\"` or `\"UTF-8\"`, otherwise `Uint8Array`.\n */\n convert<T extends string>(\n str: string | Uint8Array | ArrayBuffer,\n fromEncoding: string,\n toEncoding: T,\n ): T extends \"UTF8\" | \"UTF-8\" ? string : Uint8Array;\n\n /**\n * Convert a buffer between encodings.\n * @param buffer - Input bytes to convert\n * @param fromEncoding - Source encoding name\n * @param toEncoding - Target encoding name\n * @returns `string` when `toEncoding` is `\"UTF8\"` or `\"UTF-8\"`, otherwise `Uint8Array`.\n */\n convertBuffer<T extends string>(\n buffer: Uint8Array | ArrayBuffer,\n fromEncoding: string,\n toEncoding: T,\n ): T extends \"UTF8\" | \"UTF-8\" ? string : Uint8Array;\n\n /**\n * Decode a buffer to a UTF-8 string using the given source encoding.\n * @param buffer - Input bytes\n * @param encoding - Source encoding name\n * @returns Decoded UTF-8 string\n */\n decode(buffer: Uint8Array | ArrayBuffer, encoding: string): string;\n\n /**\n * Encode a UTF-8 string into the given target encoding.\n * @param str - Input string\n * @param encoding - Target encoding name\n * @returns `string` when `encoding` is `\"UTF8\"` or `\"UTF-8\"`, otherwise `Uint8Array`.\n */\n encode<T extends string>(\n str: string,\n encoding: T,\n ): T extends \"UTF8\" | \"UTF-8\" ? string : Uint8Array;\n\n /**\n * Returns the list of supported encoding names.\n * @returns Array of encoding names supported by the platform iconv runtime\n */\n encodings(): string[];\n\n /** Constructor for the stateful {@link Iconv} converter. */\n Iconv: IconvConstructor;\n}\n\nconst api = (): TailorIconvAPI =>\n (globalThis as { tailor: { iconv: TailorIconvAPI } }).tailor.iconv;\n\n/**\n * See {@link TailorIconvAPI.convert}.\n * @param args - Forwarded to {@link TailorIconvAPI.convert}\n * @returns `string` when `toEncoding` is `\"UTF8\"` or `\"UTF-8\"`, otherwise `Uint8Array`.\n */\nexport const convert: TailorIconvAPI[\"convert\"] = (...args) => api().convert(...args);\n\n/**\n * See {@link TailorIconvAPI.convertBuffer}.\n * @param args - Forwarded to {@link TailorIconvAPI.convertBuffer}\n * @returns `string` when `toEncoding` is `\"UTF8\"` or `\"UTF-8\"`, otherwise `Uint8Array`.\n */\nexport const convertBuffer: TailorIconvAPI[\"convertBuffer\"] = (...args) =>\n api().convertBuffer(...args);\n\n/**\n * See {@link TailorIconvAPI.decode}.\n * @param args - Forwarded to {@link TailorIconvAPI.decode}\n * @returns Decoded UTF-8 string\n */\nexport const decode: TailorIconvAPI[\"decode\"] = (...args) => api().decode(...args);\n\n/**\n * See {@link TailorIconvAPI.encode}.\n * @param args - Forwarded to {@link TailorIconvAPI.encode}\n * @returns `string` when `encoding` is `\"UTF8\"` or `\"UTF-8\"`, otherwise `Uint8Array`.\n */\nexport const encode: TailorIconvAPI[\"encode\"] = (...args) => api().encode(...args);\n\n/**\n * See {@link TailorIconvAPI.encodings}.\n * @returns Array of encoding names supported by the platform iconv runtime\n */\nexport const encodings: TailorIconvAPI[\"encodings\"] = () => api().encodings();\n\n/**\n * Stateful converter for repeated conversions between a fixed encoding pair.\n * Compatible with the `node-iconv` API surface.\n */\nexport class Iconv {\n private impl: IconvInstance;\n\n constructor(fromEncoding: string, toEncoding: string) {\n this.impl = new (api().Iconv)(fromEncoding, toEncoding);\n }\n\n /**\n * Convert input using this converter's fixed encoding pair.\n * @param input - Bytes or string to convert\n * @returns Encoded output (string for UTF-8 targets, otherwise `Uint8Array`).\n */\n convert(input: string | Uint8Array | ArrayBuffer): string | Uint8Array {\n return this.impl.convert(input);\n }\n}\n"],"mappings":";;;;;;;;;;;;AA+FA,MAAM,YACH,WAAqD,OAAO;;;;;;AAO/D,MAAa,WAAsC,GAAG,SAAS,IAAI,CAAC,CAAC,QAAQ,GAAG,IAAI;;;;;;AAOpF,MAAa,iBAAkD,GAAG,SAChE,IAAI,CAAC,CAAC,cAAc,GAAG,IAAI;;;;;;AAO7B,MAAa,UAAoC,GAAG,SAAS,IAAI,CAAC,CAAC,OAAO,GAAG,IAAI;;;;;;AAOjF,MAAa,UAAoC,GAAG,SAAS,IAAI,CAAC,CAAC,OAAO,GAAG,IAAI;;;;;AAMjF,MAAa,kBAA+C,IAAI,CAAC,CAAC,UAAU;;;;;AAM5E,IAAa,QAAb,MAAmB;CACjB,AAAQ;CAER,YAAY,cAAsB,YAAoB;EACpD,KAAK,OAAO,KAAK,IAAI,EAAC,CAAC,MAAO,cAAc,UAAU;CACxD;;;;;;CAOA,QAAQ,OAA+D;EACrE,OAAO,KAAK,KAAK,QAAQ,KAAK;CAChC;AACF"}
1
+ {"version":3,"file":"iconv-D2vi8G36.mjs","names":[],"sources":["../src/runtime/iconv.ts"],"sourcesContent":["/**\n * Character encoding conversion utilities.\n *\n * Thin typed wrapper around the platform-provided `tailor.iconv` runtime API.\n * At runtime this delegates to `globalThis.tailor.iconv`, which is provided by\n * the Tailor Platform Function runtime. Use `mockIconv` from\n * `@tailor-platform/sdk/vitest` to mock these calls in unit tests.\n * @example\n * import { iconv } from \"@tailor-platform/sdk/runtime\";\n *\n * const utf8 = iconv.convert(sjisBuffer, \"Shift_JIS\", \"UTF-8\"); // string\n * const sjis = iconv.convert(\"こんにちは\", \"UTF-8\", \"Shift_JIS\"); // Uint8Array\n *\n * const conv = new iconv.Iconv(\"Shift_JIS\", \"UTF-8\");\n * const out = conv.convert(sjisBuffer);\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/** Instance methods exposed by `tailor.iconv.Iconv`. */\nexport interface IconvInstance {\n convert(input: string | Uint8Array | ArrayBuffer): string | Uint8Array;\n}\n\n/** Constructor shape for `tailor.iconv.Iconv`. */\nexport interface IconvConstructor {\n new (fromEncoding: string, toEncoding: string): IconvInstance;\n}\n\n/**\n * Platform API surface for `tailor.iconv`. Describes the shape the platform\n * runtime injects on `globalThis.tailor.iconv` so the wrapper and ambient\n * globals stay in sync.\n *\n * Each method below is also re-exported as a top-level named export from this\n * module (e.g. `convert`, `decode`, `encode`) so callers can either\n * `import * as iconv from \"@tailor-platform/sdk/runtime/iconv\"` or pick\n * individual methods.\n */\nexport interface TailorIconvAPI {\n /**\n * Convert a string or buffer between encodings.\n * @param str - Input data to convert\n * @param fromEncoding - Source encoding name\n * @param toEncoding - Target encoding name\n * @returns `string` when `toEncoding` is `\"UTF8\"` or `\"UTF-8\"`, otherwise `Uint8Array`.\n */\n convert<T extends string>(\n str: string | Uint8Array | ArrayBuffer,\n fromEncoding: string,\n toEncoding: T,\n ): T extends \"UTF8\" | \"UTF-8\" ? string : Uint8Array;\n\n /**\n * Convert a buffer between encodings.\n * @param buffer - Input bytes to convert\n * @param fromEncoding - Source encoding name\n * @param toEncoding - Target encoding name\n * @returns `string` when `toEncoding` is `\"UTF8\"` or `\"UTF-8\"`, otherwise `Uint8Array`.\n */\n convertBuffer<T extends string>(\n buffer: Uint8Array | ArrayBuffer,\n fromEncoding: string,\n toEncoding: T,\n ): T extends \"UTF8\" | \"UTF-8\" ? string : Uint8Array;\n\n /**\n * Decode a buffer to a UTF-8 string using the given source encoding.\n * @param buffer - Input bytes\n * @param encoding - Source encoding name\n * @returns Decoded UTF-8 string\n */\n decode(buffer: Uint8Array | ArrayBuffer, encoding: string): string;\n\n /**\n * Encode a UTF-8 string into the given target encoding.\n * @param str - Input string\n * @param encoding - Target encoding name\n * @returns `string` when `encoding` is `\"UTF8\"` or `\"UTF-8\"`, otherwise `Uint8Array`.\n */\n encode<T extends string>(\n str: string,\n encoding: T,\n ): T extends \"UTF8\" | \"UTF-8\" ? string : Uint8Array;\n\n /**\n * Returns the list of supported encoding names.\n * @returns Array of encoding names supported by the platform iconv runtime\n */\n encodings(): string[];\n\n /** Constructor for the stateful {@link Iconv} converter. */\n Iconv: IconvConstructor;\n}\n\nconst api = (): TailorIconvAPI =>\n (globalThis as { tailor: { iconv: TailorIconvAPI } }).tailor.iconv;\n\n/**\n * See {@link TailorIconvAPI.convert}.\n * @param args - Forwarded to {@link TailorIconvAPI.convert}\n * @returns `string` when `toEncoding` is `\"UTF8\"` or `\"UTF-8\"`, otherwise `Uint8Array`.\n */\nexport const convert: TailorIconvAPI[\"convert\"] = (...args) => api().convert(...args);\n\n/**\n * See {@link TailorIconvAPI.convertBuffer}.\n * @param args - Forwarded to {@link TailorIconvAPI.convertBuffer}\n * @returns `string` when `toEncoding` is `\"UTF8\"` or `\"UTF-8\"`, otherwise `Uint8Array`.\n */\nexport const convertBuffer: TailorIconvAPI[\"convertBuffer\"] = (...args) =>\n api().convertBuffer(...args);\n\n/**\n * See {@link TailorIconvAPI.decode}.\n * @param args - Forwarded to {@link TailorIconvAPI.decode}\n * @returns Decoded UTF-8 string\n */\nexport const decode: TailorIconvAPI[\"decode\"] = (...args) => api().decode(...args);\n\n/**\n * See {@link TailorIconvAPI.encode}.\n * @param args - Forwarded to {@link TailorIconvAPI.encode}\n * @returns `string` when `encoding` is `\"UTF8\"` or `\"UTF-8\"`, otherwise `Uint8Array`.\n */\nexport const encode: TailorIconvAPI[\"encode\"] = (...args) => api().encode(...args);\n\n/**\n * See {@link TailorIconvAPI.encodings}.\n * @returns Array of encoding names supported by the platform iconv runtime\n */\nexport const encodings: TailorIconvAPI[\"encodings\"] = () => api().encodings();\n\n/**\n * Stateful converter for repeated conversions between a fixed encoding pair.\n * Compatible with the `node-iconv` API surface.\n */\nexport class Iconv {\n private impl: IconvInstance;\n\n constructor(fromEncoding: string, toEncoding: string) {\n this.impl = new (api().Iconv)(fromEncoding, toEncoding);\n }\n\n /**\n * Convert input using this converter's fixed encoding pair.\n * @param input - Bytes or string to convert\n * @returns Encoded output (string for UTF-8 targets, otherwise `Uint8Array`).\n */\n convert(input: string | Uint8Array | ArrayBuffer): string | Uint8Array {\n return this.impl.convert(input);\n }\n}\n"],"mappings":";;;;;;;;;;;AA+FA,MAAM,YACH,WAAqD,OAAO;;;;;;AAO/D,MAAa,WAAsC,GAAG,SAAS,IAAI,CAAC,CAAC,QAAQ,GAAG,IAAI;;;;;;AAOpF,MAAa,iBAAkD,GAAG,SAChE,IAAI,CAAC,CAAC,cAAc,GAAG,IAAI;;;;;;AAO7B,MAAa,UAAoC,GAAG,SAAS,IAAI,CAAC,CAAC,OAAO,GAAG,IAAI;;;;;;AAOjF,MAAa,UAAoC,GAAG,SAAS,IAAI,CAAC,CAAC,OAAO,GAAG,IAAI;;;;;AAMjF,MAAa,kBAA+C,IAAI,CAAC,CAAC,UAAU;;;;;AAM5E,IAAa,QAAb,MAAmB;CACjB,AAAQ;CAER,YAAY,cAAsB,YAAoB;EACpD,KAAK,OAAO,KAAK,IAAI,EAAC,CAAC,MAAO,cAAc,UAAU;CACxD;;;;;;CAOA,QAAQ,OAA+D;EACrE,OAAO,KAAK,KAAK,QAAQ,KAAK;CAChC;AACF"}
@@ -1,5 +1,4 @@
1
-
2
- import { t as __exportAll } from "./chunk-BkoGK1jX.mjs";
1
+ import { t as __exportAll } from "./rolldown-runtime-DXywRVcq.mjs";
3
2
 
4
3
  //#region src/runtime/idp.ts
5
4
  var idp_exports = /* @__PURE__ */ __exportAll({ Client: () => Client });
@@ -73,4 +72,4 @@ var Client = class {
73
72
 
74
73
  //#endregion
75
74
  export { idp_exports as n, Client as t };
76
- //# sourceMappingURL=idp-Ch95ag8h.mjs.map
75
+ //# sourceMappingURL=idp-BDbK5gjm.mjs.map