@shipfox/api-auth-dto 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/.turbo/turbo-build.log +2 -0
  2. package/.turbo/turbo-type$colon$emit.log +1 -0
  3. package/.turbo/turbo-type.log +1 -0
  4. package/CHANGELOG.md +30 -0
  5. package/LICENSE +21 -0
  6. package/dist/events.d.ts +30 -0
  7. package/dist/events.d.ts.map +1 -0
  8. package/dist/events.js +19 -0
  9. package/dist/events.js.map +1 -0
  10. package/dist/index.d.ts +2 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +3 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/schemas/auth.d.ts +166 -0
  15. package/dist/schemas/auth.d.ts.map +1 -0
  16. package/dist/schemas/auth.js +64 -0
  17. package/dist/schemas/auth.js.map +1 -0
  18. package/dist/schemas/e2e.d.ts +52 -0
  19. package/dist/schemas/e2e.d.ts.map +1 -0
  20. package/dist/schemas/e2e.js +24 -0
  21. package/dist/schemas/e2e.js.map +1 -0
  22. package/dist/schemas/index.d.ts +7 -0
  23. package/dist/schemas/index.d.ts.map +1 -0
  24. package/dist/schemas/index.js +8 -0
  25. package/dist/schemas/index.js.map +1 -0
  26. package/dist/schemas/job-lease-token.d.ts +24 -0
  27. package/dist/schemas/job-lease-token.d.ts.map +1 -0
  28. package/dist/schemas/job-lease-token.js +24 -0
  29. package/dist/schemas/job-lease-token.js.map +1 -0
  30. package/dist/schemas/runner-session-token.d.ts +19 -0
  31. package/dist/schemas/runner-session-token.d.ts.map +1 -0
  32. package/dist/schemas/runner-session-token.js +18 -0
  33. package/dist/schemas/runner-session-token.js.map +1 -0
  34. package/dist/schemas/user.d.ts +21 -0
  35. package/dist/schemas/user.d.ts.map +1 -0
  36. package/dist/schemas/user.js +17 -0
  37. package/dist/schemas/user.js.map +1 -0
  38. package/dist/tsconfig.test.tsbuildinfo +1 -0
  39. package/package.json +53 -0
  40. package/src/events.ts +34 -0
  41. package/src/index.ts +1 -0
  42. package/src/schemas/auth.ts +119 -0
  43. package/src/schemas/e2e.ts +40 -0
  44. package/src/schemas/index.ts +71 -0
  45. package/src/schemas/job-lease-token.ts +27 -0
  46. package/src/schemas/runner-session-token.ts +21 -0
  47. package/src/schemas/user.ts +15 -0
  48. package/tsconfig.build.json +9 -0
  49. package/tsconfig.build.tsbuildinfo +1 -0
  50. package/tsconfig.json +4 -0
  51. package/tsconfig.test.json +8 -0
@@ -0,0 +1,2 @@
1
+ $ shipfox-swc
2
+ Successfully compiled: 8 files with swc (30.24ms)
@@ -0,0 +1 @@
1
+ $ shipfox-tsc-emit
@@ -0,0 +1 @@
1
+ $ shipfox-tsc-check
package/CHANGELOG.md ADDED
@@ -0,0 +1,30 @@
1
+ # @shipfox/api-auth-dto
2
+
3
+ ## 2.0.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 1b0d344: Publishes the complete API runtime closure with packed-consumer-safe internal imports and records its exact package set in application releases.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [1b0d344]
12
+ - @shipfox/api-common-dto@2.0.0
13
+
14
+ ## 0.1.0
15
+
16
+ ### Minor Changes
17
+
18
+ - d02c5fd: Queues auth and workspace transactional emails through module-owned outbox events so account verification, password reset, and invitation sends retry outside request transactions.
19
+ - c0a883c: Moves the job lease capability token codec and its claims schema from the runners packages into api-auth/api-auth-dto, renaming its config to `AUTH_JOB_LEASE_TOKEN_*`, so all signed-token codecs live with authentication. Adds a shared leased-job auth context for request-scoped lease claims, and a shared `createLeaseTokenAuthMethod` (the `leased-job` auth method) registered on the auth module so any feature module can protect routes with a lease token by name.
20
+ - 3afb7e3: Adds job execution success expressions and execution timeouts to workflow documents.
21
+ Renames job execution IDs in auth, runner, workflow, and timeout event contracts to the explicit `jobExecutionId` / `job_execution_id` shape.
22
+ - 6181819: Adds runner registration sessions with bounded label contracts, session-token auth, and lease-token heartbeat ownership.
23
+
24
+ ### Patch Changes
25
+
26
+ - e250c4c: Propagates `projectId` end-to-end into the job lease token. Workflows sources the `{workspaceId, projectId, workflowRunId, workflowRunAttemptId, jobId, jobExecutionId}` identity tuple and threads it through the runner pending/running job tables and lease claims. This is lease-shape groundwork for per-project log-ingest authorization; the stream-stamping consumer lands separately.
27
+ - 362b3eb: Scope runner log append authorization to the dispatched step attempt carried by the job lease token.
28
+ - 27770eb: Tightens signup, workspace, and project display-name validation with shared trimming, control and format-character rejection, length limits, and contextual client form errors.
29
+ - Updated dependencies [27770eb]
30
+ - @shipfox/api-common-dto@0.1.0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Shipfox
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,30 @@
1
+ import { z } from 'zod';
2
+ export declare const AUTH_EMAIL_VERIFICATION_SEND_REQUESTED: "auth.email_verification.send_requested";
3
+ export declare const AUTH_PASSWORD_RESET_SEND_REQUESTED: "auth.password_reset.send_requested";
4
+ export declare const authEmailVerificationSendRequestedSchema: z.ZodObject<{
5
+ email: z.ZodString;
6
+ verifyLink: z.ZodString;
7
+ }, z.core.$strip>;
8
+ export type AuthEmailVerificationSendRequestedEvent = z.infer<typeof authEmailVerificationSendRequestedSchema>;
9
+ export declare const authPasswordResetSendRequestedSchema: z.ZodObject<{
10
+ email: z.ZodString;
11
+ resetLink: z.ZodString;
12
+ expiresInHours: z.ZodNumber;
13
+ }, z.core.$strip>;
14
+ export type AuthPasswordResetSendRequestedEvent = z.infer<typeof authPasswordResetSendRequestedSchema>;
15
+ export interface AuthEventMap {
16
+ [AUTH_EMAIL_VERIFICATION_SEND_REQUESTED]: AuthEmailVerificationSendRequestedEvent;
17
+ [AUTH_PASSWORD_RESET_SEND_REQUESTED]: AuthPasswordResetSendRequestedEvent;
18
+ }
19
+ export declare const authEventSchemas: {
20
+ "auth.email_verification.send_requested": z.ZodObject<{
21
+ email: z.ZodString;
22
+ verifyLink: z.ZodString;
23
+ }, z.core.$strip>;
24
+ "auth.password_reset.send_requested": z.ZodObject<{
25
+ email: z.ZodString;
26
+ resetLink: z.ZodString;
27
+ expiresInHours: z.ZodNumber;
28
+ }, z.core.$strip>;
29
+ };
30
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAItB,eAAO,MAAM,sCAAsC,EACjD,wCAAiD,CAAC;AACpD,eAAO,MAAM,kCAAkC,EAAG,oCAA6C,CAAC;AAEhG,eAAO,MAAM,wCAAwC;;;iBAGnD,CAAC;AACH,MAAM,MAAM,uCAAuC,GAAG,CAAC,CAAC,KAAK,CAC3D,OAAO,wCAAwC,CAChD,CAAC;AAEF,eAAO,MAAM,oCAAoC;;;;iBAI/C,CAAC;AACH,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,oCAAoC,CAC5C,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,CAAC,sCAAsC,CAAC,EAAE,uCAAuC,CAAC;IAClF,CAAC,kCAAkC,CAAC,EAAE,mCAAmC,CAAC;CAC3E;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;;CAGoB,CAAC"}
package/dist/events.js ADDED
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ const emailLinkSchema = z.string().url();
3
+ export const AUTH_EMAIL_VERIFICATION_SEND_REQUESTED = 'auth.email_verification.send_requested';
4
+ export const AUTH_PASSWORD_RESET_SEND_REQUESTED = 'auth.password_reset.send_requested';
5
+ export const authEmailVerificationSendRequestedSchema = z.object({
6
+ email: z.string().email(),
7
+ verifyLink: emailLinkSchema
8
+ });
9
+ export const authPasswordResetSendRequestedSchema = z.object({
10
+ email: z.string().email(),
11
+ resetLink: emailLinkSchema,
12
+ expiresInHours: z.number().int().positive()
13
+ });
14
+ export const authEventSchemas = {
15
+ [AUTH_EMAIL_VERIFICATION_SEND_REQUESTED]: authEmailVerificationSendRequestedSchema,
16
+ [AUTH_PASSWORD_RESET_SEND_REQUESTED]: authPasswordResetSendRequestedSchema
17
+ };
18
+
19
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/events.ts"],"sourcesContent":["import {z} from 'zod';\n\nconst emailLinkSchema = z.string().url();\n\nexport const AUTH_EMAIL_VERIFICATION_SEND_REQUESTED =\n 'auth.email_verification.send_requested' as const;\nexport const AUTH_PASSWORD_RESET_SEND_REQUESTED = 'auth.password_reset.send_requested' as const;\n\nexport const authEmailVerificationSendRequestedSchema = z.object({\n email: z.string().email(),\n verifyLink: emailLinkSchema,\n});\nexport type AuthEmailVerificationSendRequestedEvent = z.infer<\n typeof authEmailVerificationSendRequestedSchema\n>;\n\nexport const authPasswordResetSendRequestedSchema = z.object({\n email: z.string().email(),\n resetLink: emailLinkSchema,\n expiresInHours: z.number().int().positive(),\n});\nexport type AuthPasswordResetSendRequestedEvent = z.infer<\n typeof authPasswordResetSendRequestedSchema\n>;\n\nexport interface AuthEventMap {\n [AUTH_EMAIL_VERIFICATION_SEND_REQUESTED]: AuthEmailVerificationSendRequestedEvent;\n [AUTH_PASSWORD_RESET_SEND_REQUESTED]: AuthPasswordResetSendRequestedEvent;\n}\n\nexport const authEventSchemas = {\n [AUTH_EMAIL_VERIFICATION_SEND_REQUESTED]: authEmailVerificationSendRequestedSchema,\n [AUTH_PASSWORD_RESET_SEND_REQUESTED]: authPasswordResetSendRequestedSchema,\n} satisfies Record<keyof AuthEventMap, z.ZodType>;\n"],"names":["z","emailLinkSchema","string","url","AUTH_EMAIL_VERIFICATION_SEND_REQUESTED","AUTH_PASSWORD_RESET_SEND_REQUESTED","authEmailVerificationSendRequestedSchema","object","email","verifyLink","authPasswordResetSendRequestedSchema","resetLink","expiresInHours","number","int","positive","authEventSchemas"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AAEtB,MAAMC,kBAAkBD,EAAEE,MAAM,GAAGC,GAAG;AAEtC,OAAO,MAAMC,yCACX,yCAAkD;AACpD,OAAO,MAAMC,qCAAqC,qCAA8C;AAEhG,OAAO,MAAMC,2CAA2CN,EAAEO,MAAM,CAAC;IAC/DC,OAAOR,EAAEE,MAAM,GAAGM,KAAK;IACvBC,YAAYR;AACd,GAAG;AAKH,OAAO,MAAMS,uCAAuCV,EAAEO,MAAM,CAAC;IAC3DC,OAAOR,EAAEE,MAAM,GAAGM,KAAK;IACvBG,WAAWV;IACXW,gBAAgBZ,EAAEa,MAAM,GAAGC,GAAG,GAAGC,QAAQ;AAC3C,GAAG;AAUH,OAAO,MAAMC,mBAAmB;IAC9B,CAACZ,uCAAuC,EAAEE;IAC1C,CAACD,mCAAmC,EAAEK;AACxC,EAAkD"}
@@ -0,0 +1,2 @@
1
+ export * from './schemas/index.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export * from './schemas/index.js';
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './schemas/index.js';\n"],"names":[],"mappings":"AAAA,cAAc,qBAAqB"}
@@ -0,0 +1,166 @@
1
+ import { z } from 'zod';
2
+ export declare const EMAIL_VERIFICATION_RESEND_COOLDOWN_SECONDS = 60;
3
+ export declare const passwordSchema: z.ZodString;
4
+ export declare const emailSchema: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
5
+ export declare const signupBodySchema: z.ZodObject<{
6
+ email: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
7
+ password: z.ZodString;
8
+ name: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
9
+ invitation_token: z.ZodOptional<z.ZodString>;
10
+ }, z.core.$strip>;
11
+ export type SignupBodyDto = z.infer<typeof signupBodySchema>;
12
+ export declare const signupAcceptErrorSchema: z.ZodObject<{
13
+ code: z.ZodString;
14
+ message: z.ZodString;
15
+ }, z.core.$strip>;
16
+ export type SignupAcceptErrorDto = z.infer<typeof signupAcceptErrorSchema>;
17
+ export declare const signupMembershipSchema: z.ZodObject<{
18
+ id: z.ZodString;
19
+ user_id: z.ZodString;
20
+ workspace_id: z.ZodString;
21
+ }, z.core.$strip>;
22
+ export type SignupMembershipDto = z.infer<typeof signupMembershipSchema>;
23
+ export declare const signupResponseSchema: z.ZodObject<{
24
+ user: z.ZodObject<{
25
+ id: z.ZodString;
26
+ email: z.ZodString;
27
+ name: z.ZodNullable<z.ZodString>;
28
+ email_verified_at: z.ZodNullable<z.ZodString>;
29
+ status: z.ZodEnum<{
30
+ active: "active";
31
+ suspended: "suspended";
32
+ deleted: "deleted";
33
+ }>;
34
+ created_at: z.ZodString;
35
+ updated_at: z.ZodString;
36
+ }, z.core.$strip>;
37
+ token: z.ZodOptional<z.ZodString>;
38
+ membership: z.ZodOptional<z.ZodNullable<z.ZodObject<{
39
+ id: z.ZodString;
40
+ user_id: z.ZodString;
41
+ workspace_id: z.ZodString;
42
+ }, z.core.$strip>>>;
43
+ accept_error: z.ZodOptional<z.ZodObject<{
44
+ code: z.ZodString;
45
+ message: z.ZodString;
46
+ }, z.core.$strip>>;
47
+ }, z.core.$strip>;
48
+ export type SignupResponseDto = z.infer<typeof signupResponseSchema>;
49
+ export declare const loginBodySchema: z.ZodObject<{
50
+ email: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
51
+ password: z.ZodString;
52
+ }, z.core.$strip>;
53
+ export type LoginBodyDto = z.infer<typeof loginBodySchema>;
54
+ export declare const loginResponseSchema: z.ZodObject<{
55
+ token: z.ZodString;
56
+ user: z.ZodObject<{
57
+ id: z.ZodString;
58
+ email: z.ZodString;
59
+ name: z.ZodNullable<z.ZodString>;
60
+ email_verified_at: z.ZodNullable<z.ZodString>;
61
+ status: z.ZodEnum<{
62
+ active: "active";
63
+ suspended: "suspended";
64
+ deleted: "deleted";
65
+ }>;
66
+ created_at: z.ZodString;
67
+ updated_at: z.ZodString;
68
+ }, z.core.$strip>;
69
+ }, z.core.$strip>;
70
+ export type LoginResponseDto = z.infer<typeof loginResponseSchema>;
71
+ export declare const refreshResponseSchema: z.ZodObject<{
72
+ token: z.ZodString;
73
+ user: z.ZodObject<{
74
+ id: z.ZodString;
75
+ email: z.ZodString;
76
+ name: z.ZodNullable<z.ZodString>;
77
+ email_verified_at: z.ZodNullable<z.ZodString>;
78
+ status: z.ZodEnum<{
79
+ active: "active";
80
+ suspended: "suspended";
81
+ deleted: "deleted";
82
+ }>;
83
+ created_at: z.ZodString;
84
+ updated_at: z.ZodString;
85
+ }, z.core.$strip>;
86
+ }, z.core.$strip>;
87
+ export type RefreshResponseDto = z.infer<typeof refreshResponseSchema>;
88
+ export declare const meResponseSchema: z.ZodObject<{
89
+ user: z.ZodObject<{
90
+ id: z.ZodString;
91
+ email: z.ZodString;
92
+ name: z.ZodNullable<z.ZodString>;
93
+ email_verified_at: z.ZodNullable<z.ZodString>;
94
+ status: z.ZodEnum<{
95
+ active: "active";
96
+ suspended: "suspended";
97
+ deleted: "deleted";
98
+ }>;
99
+ created_at: z.ZodString;
100
+ updated_at: z.ZodString;
101
+ }, z.core.$strip>;
102
+ }, z.core.$strip>;
103
+ export type MeResponseDto = z.infer<typeof meResponseSchema>;
104
+ export declare const logoutBodySchema: z.ZodObject<{}, z.core.$strip>;
105
+ export type LogoutBodyDto = z.infer<typeof logoutBodySchema>;
106
+ export declare const changePasswordBodySchema: z.ZodObject<{
107
+ current_password: z.ZodString;
108
+ new_password: z.ZodString;
109
+ }, z.core.$strip>;
110
+ export type ChangePasswordBodyDto = z.infer<typeof changePasswordBodySchema>;
111
+ export declare const passwordResetRequestBodySchema: z.ZodObject<{
112
+ email: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
113
+ }, z.core.$strip>;
114
+ export type PasswordResetRequestBodyDto = z.infer<typeof passwordResetRequestBodySchema>;
115
+ export declare const passwordResetConfirmBodySchema: z.ZodObject<{
116
+ token: z.ZodString;
117
+ new_password: z.ZodString;
118
+ }, z.core.$strip>;
119
+ export type PasswordResetConfirmBodyDto = z.infer<typeof passwordResetConfirmBodySchema>;
120
+ export declare const passwordResetConfirmResponseSchema: z.ZodObject<{
121
+ token: z.ZodString;
122
+ user: z.ZodObject<{
123
+ id: z.ZodString;
124
+ email: z.ZodString;
125
+ name: z.ZodNullable<z.ZodString>;
126
+ email_verified_at: z.ZodNullable<z.ZodString>;
127
+ status: z.ZodEnum<{
128
+ active: "active";
129
+ suspended: "suspended";
130
+ deleted: "deleted";
131
+ }>;
132
+ created_at: z.ZodString;
133
+ updated_at: z.ZodString;
134
+ }, z.core.$strip>;
135
+ }, z.core.$strip>;
136
+ export type PasswordResetConfirmResponseDto = z.infer<typeof passwordResetConfirmResponseSchema>;
137
+ export declare const verifyEmailConfirmBodySchema: z.ZodObject<{
138
+ token: z.ZodString;
139
+ }, z.core.$strip>;
140
+ export type VerifyEmailConfirmBodyDto = z.infer<typeof verifyEmailConfirmBodySchema>;
141
+ export declare const verifyEmailConfirmResponseSchema: z.ZodObject<{
142
+ token: z.ZodString;
143
+ user: z.ZodObject<{
144
+ id: z.ZodString;
145
+ email: z.ZodString;
146
+ name: z.ZodNullable<z.ZodString>;
147
+ email_verified_at: z.ZodNullable<z.ZodString>;
148
+ status: z.ZodEnum<{
149
+ active: "active";
150
+ suspended: "suspended";
151
+ deleted: "deleted";
152
+ }>;
153
+ created_at: z.ZodString;
154
+ updated_at: z.ZodString;
155
+ }, z.core.$strip>;
156
+ }, z.core.$strip>;
157
+ export type VerifyEmailConfirmResponseDto = z.infer<typeof verifyEmailConfirmResponseSchema>;
158
+ export declare const verifyEmailResendBodySchema: z.ZodObject<{
159
+ email: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
160
+ }, z.core.$strip>;
161
+ export type VerifyEmailResendBodyDto = z.infer<typeof verifyEmailResendBodySchema>;
162
+ export declare const verifyEmailResendResponseSchema: z.ZodObject<{
163
+ next_resend_available_at: z.ZodString;
164
+ }, z.core.$strip>;
165
+ export type VerifyEmailResendResponseDto = z.infer<typeof verifyEmailResendResponseSchema>;
166
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/schemas/auth.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,eAAO,MAAM,0CAA0C,KAAK,CAAC;AAE7D,eAAO,MAAM,cAAc,aAA8B,CAAC;AAC1D,eAAO,MAAM,WAAW,wDAIoB,CAAC;AAE7C,eAAO,MAAM,gBAAgB;;;;;iBAK3B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE7D,eAAO,MAAM,uBAAuB;;;iBAGlC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE3E,eAAO,MAAM,sBAAsB;;;;iBAIjC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEzE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;iBAK/B,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAErE,eAAO,MAAM,eAAe;;;iBAG1B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE3D,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;iBAG9B,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEnE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;iBAAsB,CAAC;AAEzD,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEvE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;iBAE3B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE7D,eAAO,MAAM,gBAAgB,gCAAe,CAAC;AAE7C,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE7D,eAAO,MAAM,wBAAwB;;;iBAGnC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE7E,eAAO,MAAM,8BAA8B;;iBAEzC,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEzF,eAAO,MAAM,8BAA8B;;;iBAGzC,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEzF,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;iBAAsB,CAAC;AAEtE,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAEjG,eAAO,MAAM,4BAA4B;;iBAEvC,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAErF,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;iBAAsB,CAAC;AAEpE,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE7F,eAAO,MAAM,2BAA2B;;iBAEtC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEnF,eAAO,MAAM,+BAA+B;;iBAE1C,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC"}
@@ -0,0 +1,64 @@
1
+ import { displayNameSchema } from '@shipfox/api-common-dto';
2
+ import { z } from 'zod';
3
+ import { userDtoSchema } from './user.js';
4
+ export const EMAIL_VERIFICATION_RESEND_COOLDOWN_SECONDS = 60;
5
+ export const passwordSchema = z.string().min(12).max(128);
6
+ export const emailSchema = z.string().email().max(254).transform((value)=>value.toLowerCase());
7
+ export const signupBodySchema = z.object({
8
+ email: emailSchema,
9
+ password: passwordSchema,
10
+ name: displayNameSchema,
11
+ invitation_token: z.string().min(1).max(256).optional()
12
+ });
13
+ export const signupAcceptErrorSchema = z.object({
14
+ code: z.string(),
15
+ message: z.string()
16
+ });
17
+ export const signupMembershipSchema = z.object({
18
+ id: z.string().uuid(),
19
+ user_id: z.string().uuid(),
20
+ workspace_id: z.string().uuid()
21
+ });
22
+ export const signupResponseSchema = z.object({
23
+ user: userDtoSchema,
24
+ token: z.string().optional(),
25
+ membership: signupMembershipSchema.nullable().optional(),
26
+ accept_error: signupAcceptErrorSchema.optional()
27
+ });
28
+ export const loginBodySchema = z.object({
29
+ email: emailSchema,
30
+ password: z.string().min(1).max(128)
31
+ });
32
+ export const loginResponseSchema = z.object({
33
+ token: z.string(),
34
+ user: userDtoSchema
35
+ });
36
+ export const refreshResponseSchema = loginResponseSchema;
37
+ export const meResponseSchema = z.object({
38
+ user: userDtoSchema
39
+ });
40
+ export const logoutBodySchema = z.object({});
41
+ export const changePasswordBodySchema = z.object({
42
+ current_password: z.string().min(1).max(128),
43
+ new_password: passwordSchema
44
+ });
45
+ export const passwordResetRequestBodySchema = z.object({
46
+ email: emailSchema
47
+ });
48
+ export const passwordResetConfirmBodySchema = z.object({
49
+ token: z.string().min(1),
50
+ new_password: passwordSchema
51
+ });
52
+ export const passwordResetConfirmResponseSchema = loginResponseSchema;
53
+ export const verifyEmailConfirmBodySchema = z.object({
54
+ token: z.string().min(1)
55
+ });
56
+ export const verifyEmailConfirmResponseSchema = loginResponseSchema;
57
+ export const verifyEmailResendBodySchema = z.object({
58
+ email: emailSchema
59
+ });
60
+ export const verifyEmailResendResponseSchema = z.object({
61
+ next_resend_available_at: z.string().datetime()
62
+ });
63
+
64
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/schemas/auth.ts"],"sourcesContent":["import {displayNameSchema} from '@shipfox/api-common-dto';\nimport {z} from 'zod';\nimport {userDtoSchema} from './user.js';\n\nexport const EMAIL_VERIFICATION_RESEND_COOLDOWN_SECONDS = 60;\n\nexport const passwordSchema = z.string().min(12).max(128);\nexport const emailSchema = z\n .string()\n .email()\n .max(254)\n .transform((value) => value.toLowerCase());\n\nexport const signupBodySchema = z.object({\n email: emailSchema,\n password: passwordSchema,\n name: displayNameSchema,\n invitation_token: z.string().min(1).max(256).optional(),\n});\n\nexport type SignupBodyDto = z.infer<typeof signupBodySchema>;\n\nexport const signupAcceptErrorSchema = z.object({\n code: z.string(),\n message: z.string(),\n});\n\nexport type SignupAcceptErrorDto = z.infer<typeof signupAcceptErrorSchema>;\n\nexport const signupMembershipSchema = z.object({\n id: z.string().uuid(),\n user_id: z.string().uuid(),\n workspace_id: z.string().uuid(),\n});\n\nexport type SignupMembershipDto = z.infer<typeof signupMembershipSchema>;\n\nexport const signupResponseSchema = z.object({\n user: userDtoSchema,\n token: z.string().optional(),\n membership: signupMembershipSchema.nullable().optional(),\n accept_error: signupAcceptErrorSchema.optional(),\n});\n\nexport type SignupResponseDto = z.infer<typeof signupResponseSchema>;\n\nexport const loginBodySchema = z.object({\n email: emailSchema,\n password: z.string().min(1).max(128),\n});\n\nexport type LoginBodyDto = z.infer<typeof loginBodySchema>;\n\nexport const loginResponseSchema = z.object({\n token: z.string(),\n user: userDtoSchema,\n});\n\nexport type LoginResponseDto = z.infer<typeof loginResponseSchema>;\n\nexport const refreshResponseSchema = loginResponseSchema;\n\nexport type RefreshResponseDto = z.infer<typeof refreshResponseSchema>;\n\nexport const meResponseSchema = z.object({\n user: userDtoSchema,\n});\n\nexport type MeResponseDto = z.infer<typeof meResponseSchema>;\n\nexport const logoutBodySchema = z.object({});\n\nexport type LogoutBodyDto = z.infer<typeof logoutBodySchema>;\n\nexport const changePasswordBodySchema = z.object({\n current_password: z.string().min(1).max(128),\n new_password: passwordSchema,\n});\n\nexport type ChangePasswordBodyDto = z.infer<typeof changePasswordBodySchema>;\n\nexport const passwordResetRequestBodySchema = z.object({\n email: emailSchema,\n});\n\nexport type PasswordResetRequestBodyDto = z.infer<typeof passwordResetRequestBodySchema>;\n\nexport const passwordResetConfirmBodySchema = z.object({\n token: z.string().min(1),\n new_password: passwordSchema,\n});\n\nexport type PasswordResetConfirmBodyDto = z.infer<typeof passwordResetConfirmBodySchema>;\n\nexport const passwordResetConfirmResponseSchema = loginResponseSchema;\n\nexport type PasswordResetConfirmResponseDto = z.infer<typeof passwordResetConfirmResponseSchema>;\n\nexport const verifyEmailConfirmBodySchema = z.object({\n token: z.string().min(1),\n});\n\nexport type VerifyEmailConfirmBodyDto = z.infer<typeof verifyEmailConfirmBodySchema>;\n\nexport const verifyEmailConfirmResponseSchema = loginResponseSchema;\n\nexport type VerifyEmailConfirmResponseDto = z.infer<typeof verifyEmailConfirmResponseSchema>;\n\nexport const verifyEmailResendBodySchema = z.object({\n email: emailSchema,\n});\n\nexport type VerifyEmailResendBodyDto = z.infer<typeof verifyEmailResendBodySchema>;\n\nexport const verifyEmailResendResponseSchema = z.object({\n next_resend_available_at: z.string().datetime(),\n});\n\nexport type VerifyEmailResendResponseDto = z.infer<typeof verifyEmailResendResponseSchema>;\n"],"names":["displayNameSchema","z","userDtoSchema","EMAIL_VERIFICATION_RESEND_COOLDOWN_SECONDS","passwordSchema","string","min","max","emailSchema","email","transform","value","toLowerCase","signupBodySchema","object","password","name","invitation_token","optional","signupAcceptErrorSchema","code","message","signupMembershipSchema","id","uuid","user_id","workspace_id","signupResponseSchema","user","token","membership","nullable","accept_error","loginBodySchema","loginResponseSchema","refreshResponseSchema","meResponseSchema","logoutBodySchema","changePasswordBodySchema","current_password","new_password","passwordResetRequestBodySchema","passwordResetConfirmBodySchema","passwordResetConfirmResponseSchema","verifyEmailConfirmBodySchema","verifyEmailConfirmResponseSchema","verifyEmailResendBodySchema","verifyEmailResendResponseSchema","next_resend_available_at","datetime"],"mappings":"AAAA,SAAQA,iBAAiB,QAAO,0BAA0B;AAC1D,SAAQC,CAAC,QAAO,MAAM;AACtB,SAAQC,aAAa,QAAO,YAAY;AAExC,OAAO,MAAMC,6CAA6C,GAAG;AAE7D,OAAO,MAAMC,iBAAiBH,EAAEI,MAAM,GAAGC,GAAG,CAAC,IAAIC,GAAG,CAAC,KAAK;AAC1D,OAAO,MAAMC,cAAcP,EACxBI,MAAM,GACNI,KAAK,GACLF,GAAG,CAAC,KACJG,SAAS,CAAC,CAACC,QAAUA,MAAMC,WAAW,IAAI;AAE7C,OAAO,MAAMC,mBAAmBZ,EAAEa,MAAM,CAAC;IACvCL,OAAOD;IACPO,UAAUX;IACVY,MAAMhB;IACNiB,kBAAkBhB,EAAEI,MAAM,GAAGC,GAAG,CAAC,GAAGC,GAAG,CAAC,KAAKW,QAAQ;AACvD,GAAG;AAIH,OAAO,MAAMC,0BAA0BlB,EAAEa,MAAM,CAAC;IAC9CM,MAAMnB,EAAEI,MAAM;IACdgB,SAASpB,EAAEI,MAAM;AACnB,GAAG;AAIH,OAAO,MAAMiB,yBAAyBrB,EAAEa,MAAM,CAAC;IAC7CS,IAAItB,EAAEI,MAAM,GAAGmB,IAAI;IACnBC,SAASxB,EAAEI,MAAM,GAAGmB,IAAI;IACxBE,cAAczB,EAAEI,MAAM,GAAGmB,IAAI;AAC/B,GAAG;AAIH,OAAO,MAAMG,uBAAuB1B,EAAEa,MAAM,CAAC;IAC3Cc,MAAM1B;IACN2B,OAAO5B,EAAEI,MAAM,GAAGa,QAAQ;IAC1BY,YAAYR,uBAAuBS,QAAQ,GAAGb,QAAQ;IACtDc,cAAcb,wBAAwBD,QAAQ;AAChD,GAAG;AAIH,OAAO,MAAMe,kBAAkBhC,EAAEa,MAAM,CAAC;IACtCL,OAAOD;IACPO,UAAUd,EAAEI,MAAM,GAAGC,GAAG,CAAC,GAAGC,GAAG,CAAC;AAClC,GAAG;AAIH,OAAO,MAAM2B,sBAAsBjC,EAAEa,MAAM,CAAC;IAC1Ce,OAAO5B,EAAEI,MAAM;IACfuB,MAAM1B;AACR,GAAG;AAIH,OAAO,MAAMiC,wBAAwBD,oBAAoB;AAIzD,OAAO,MAAME,mBAAmBnC,EAAEa,MAAM,CAAC;IACvCc,MAAM1B;AACR,GAAG;AAIH,OAAO,MAAMmC,mBAAmBpC,EAAEa,MAAM,CAAC,CAAC,GAAG;AAI7C,OAAO,MAAMwB,2BAA2BrC,EAAEa,MAAM,CAAC;IAC/CyB,kBAAkBtC,EAAEI,MAAM,GAAGC,GAAG,CAAC,GAAGC,GAAG,CAAC;IACxCiC,cAAcpC;AAChB,GAAG;AAIH,OAAO,MAAMqC,iCAAiCxC,EAAEa,MAAM,CAAC;IACrDL,OAAOD;AACT,GAAG;AAIH,OAAO,MAAMkC,iCAAiCzC,EAAEa,MAAM,CAAC;IACrDe,OAAO5B,EAAEI,MAAM,GAAGC,GAAG,CAAC;IACtBkC,cAAcpC;AAChB,GAAG;AAIH,OAAO,MAAMuC,qCAAqCT,oBAAoB;AAItE,OAAO,MAAMU,+BAA+B3C,EAAEa,MAAM,CAAC;IACnDe,OAAO5B,EAAEI,MAAM,GAAGC,GAAG,CAAC;AACxB,GAAG;AAIH,OAAO,MAAMuC,mCAAmCX,oBAAoB;AAIpE,OAAO,MAAMY,8BAA8B7C,EAAEa,MAAM,CAAC;IAClDL,OAAOD;AACT,GAAG;AAIH,OAAO,MAAMuC,kCAAkC9C,EAAEa,MAAM,CAAC;IACtDkC,0BAA0B/C,EAAEI,MAAM,GAAG4C,QAAQ;AAC/C,GAAG"}
@@ -0,0 +1,52 @@
1
+ import { z } from 'zod';
2
+ export declare const e2eCreateUserBodySchema: z.ZodObject<{
3
+ email: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
4
+ password: z.ZodString;
5
+ verified: z.ZodBoolean;
6
+ name: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>>;
7
+ }, z.core.$strip>;
8
+ export type E2eCreateUserBodyDto = z.infer<typeof e2eCreateUserBodySchema>;
9
+ export declare const e2eCreateUserResponseSchema: z.ZodObject<{
10
+ user: z.ZodObject<{
11
+ id: z.ZodString;
12
+ email: z.ZodString;
13
+ name: z.ZodNullable<z.ZodString>;
14
+ email_verified_at: z.ZodNullable<z.ZodString>;
15
+ status: z.ZodEnum<{
16
+ active: "active";
17
+ suspended: "suspended";
18
+ deleted: "deleted";
19
+ }>;
20
+ created_at: z.ZodString;
21
+ updated_at: z.ZodString;
22
+ }, z.core.$strip>;
23
+ email: z.ZodString;
24
+ password: z.ZodString;
25
+ }, z.core.$strip>;
26
+ export type E2eCreateUserResponseDto = z.infer<typeof e2eCreateUserResponseSchema>;
27
+ export declare const e2eCreateSessionBodySchema: z.ZodObject<{
28
+ user_id: z.ZodOptional<z.ZodString>;
29
+ email: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
30
+ }, z.core.$strip>;
31
+ export type E2eCreateSessionBodyDto = z.infer<typeof e2eCreateSessionBodySchema>;
32
+ export declare const e2eCreateSessionResponseSchema: z.ZodObject<{
33
+ token: z.ZodString;
34
+ user: z.ZodObject<{
35
+ id: z.ZodString;
36
+ email: z.ZodString;
37
+ name: z.ZodNullable<z.ZodString>;
38
+ email_verified_at: z.ZodNullable<z.ZodString>;
39
+ status: z.ZodEnum<{
40
+ active: "active";
41
+ suspended: "suspended";
42
+ deleted: "deleted";
43
+ }>;
44
+ created_at: z.ZodString;
45
+ updated_at: z.ZodString;
46
+ }, z.core.$strip>;
47
+ }, z.core.$strip>;
48
+ export type E2eCreateSessionResponseDto = z.infer<typeof e2eCreateSessionResponseSchema>;
49
+ export type E2eSessionDto = E2eCreateSessionResponseDto & {
50
+ setCookie: string;
51
+ };
52
+ //# sourceMappingURL=e2e.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"e2e.d.ts","sourceRoot":"","sources":["../../src/schemas/e2e.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAItB,eAAO,MAAM,uBAAuB;;;;;iBAKlC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE3E,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;iBAItC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEnF,eAAO,MAAM,0BAA0B;;;iBAOnC,CAAC;AAEL,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAEjF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;iBAAsB,CAAC;AAElE,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEzF,MAAM,MAAM,aAAa,GAAG,2BAA2B,GAAG;IACxD,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { displayNameSchema } from '@shipfox/api-common-dto';
2
+ import { z } from 'zod';
3
+ import { emailSchema, loginResponseSchema, passwordSchema } from './auth.js';
4
+ import { userDtoSchema } from './user.js';
5
+ export const e2eCreateUserBodySchema = z.object({
6
+ email: emailSchema,
7
+ password: passwordSchema,
8
+ verified: z.boolean(),
9
+ name: displayNameSchema.optional()
10
+ });
11
+ export const e2eCreateUserResponseSchema = z.object({
12
+ user: userDtoSchema,
13
+ email: z.string().email(),
14
+ password: passwordSchema
15
+ });
16
+ export const e2eCreateSessionBodySchema = z.object({
17
+ user_id: z.string().uuid().optional(),
18
+ email: emailSchema.optional()
19
+ }).refine((value)=>Boolean(value.user_id || value.email), {
20
+ message: 'Either user_id or email is required'
21
+ });
22
+ export const e2eCreateSessionResponseSchema = loginResponseSchema;
23
+
24
+ //# sourceMappingURL=e2e.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/schemas/e2e.ts"],"sourcesContent":["import {displayNameSchema} from '@shipfox/api-common-dto';\nimport {z} from 'zod';\nimport {emailSchema, loginResponseSchema, passwordSchema} from './auth.js';\nimport {userDtoSchema} from './user.js';\n\nexport const e2eCreateUserBodySchema = z.object({\n email: emailSchema,\n password: passwordSchema,\n verified: z.boolean(),\n name: displayNameSchema.optional(),\n});\n\nexport type E2eCreateUserBodyDto = z.infer<typeof e2eCreateUserBodySchema>;\n\nexport const e2eCreateUserResponseSchema = z.object({\n user: userDtoSchema,\n email: z.string().email(),\n password: passwordSchema,\n});\n\nexport type E2eCreateUserResponseDto = z.infer<typeof e2eCreateUserResponseSchema>;\n\nexport const e2eCreateSessionBodySchema = z\n .object({\n user_id: z.string().uuid().optional(),\n email: emailSchema.optional(),\n })\n .refine((value) => Boolean(value.user_id || value.email), {\n message: 'Either user_id or email is required',\n });\n\nexport type E2eCreateSessionBodyDto = z.infer<typeof e2eCreateSessionBodySchema>;\n\nexport const e2eCreateSessionResponseSchema = loginResponseSchema;\n\nexport type E2eCreateSessionResponseDto = z.infer<typeof e2eCreateSessionResponseSchema>;\n\nexport type E2eSessionDto = E2eCreateSessionResponseDto & {\n setCookie: string;\n};\n"],"names":["displayNameSchema","z","emailSchema","loginResponseSchema","passwordSchema","userDtoSchema","e2eCreateUserBodySchema","object","email","password","verified","boolean","name","optional","e2eCreateUserResponseSchema","user","string","e2eCreateSessionBodySchema","user_id","uuid","refine","value","Boolean","message","e2eCreateSessionResponseSchema"],"mappings":"AAAA,SAAQA,iBAAiB,QAAO,0BAA0B;AAC1D,SAAQC,CAAC,QAAO,MAAM;AACtB,SAAQC,WAAW,EAAEC,mBAAmB,EAAEC,cAAc,QAAO,YAAY;AAC3E,SAAQC,aAAa,QAAO,YAAY;AAExC,OAAO,MAAMC,0BAA0BL,EAAEM,MAAM,CAAC;IAC9CC,OAAON;IACPO,UAAUL;IACVM,UAAUT,EAAEU,OAAO;IACnBC,MAAMZ,kBAAkBa,QAAQ;AAClC,GAAG;AAIH,OAAO,MAAMC,8BAA8Bb,EAAEM,MAAM,CAAC;IAClDQ,MAAMV;IACNG,OAAOP,EAAEe,MAAM,GAAGR,KAAK;IACvBC,UAAUL;AACZ,GAAG;AAIH,OAAO,MAAMa,6BAA6BhB,EACvCM,MAAM,CAAC;IACNW,SAASjB,EAAEe,MAAM,GAAGG,IAAI,GAAGN,QAAQ;IACnCL,OAAON,YAAYW,QAAQ;AAC7B,GACCO,MAAM,CAAC,CAACC,QAAUC,QAAQD,MAAMH,OAAO,IAAIG,MAAMb,KAAK,GAAG;IACxDe,SAAS;AACX,GAAG;AAIL,OAAO,MAAMC,iCAAiCrB,oBAAoB"}
@@ -0,0 +1,7 @@
1
+ export { AUTH_EMAIL_VERIFICATION_SEND_REQUESTED, AUTH_PASSWORD_RESET_SEND_REQUESTED, type AuthEmailVerificationSendRequestedEvent, type AuthEventMap, type AuthPasswordResetSendRequestedEvent, authEmailVerificationSendRequestedSchema, authEventSchemas, authPasswordResetSendRequestedSchema, } from '../events.js';
2
+ export { type ChangePasswordBodyDto, changePasswordBodySchema, EMAIL_VERIFICATION_RESEND_COOLDOWN_SECONDS, emailSchema, type LoginBodyDto, type LoginResponseDto, type LogoutBodyDto, loginBodySchema, loginResponseSchema, logoutBodySchema, type MeResponseDto, meResponseSchema, type PasswordResetConfirmBodyDto, type PasswordResetConfirmResponseDto, type PasswordResetRequestBodyDto, passwordResetConfirmBodySchema, passwordResetConfirmResponseSchema, passwordResetRequestBodySchema, passwordSchema, type RefreshResponseDto, refreshResponseSchema, type SignupAcceptErrorDto, type SignupBodyDto, type SignupMembershipDto, type SignupResponseDto, signupAcceptErrorSchema, signupBodySchema, signupMembershipSchema, signupResponseSchema, type VerifyEmailConfirmBodyDto, type VerifyEmailConfirmResponseDto, type VerifyEmailResendBodyDto, type VerifyEmailResendResponseDto, verifyEmailConfirmBodySchema, verifyEmailConfirmResponseSchema, verifyEmailResendBodySchema, verifyEmailResendResponseSchema, } from './auth.js';
3
+ export { type E2eCreateSessionBodyDto, type E2eCreateSessionResponseDto, type E2eCreateUserBodyDto, type E2eCreateUserResponseDto, type E2eSessionDto, e2eCreateSessionBodySchema, e2eCreateSessionResponseSchema, e2eCreateUserBodySchema, e2eCreateUserResponseSchema, } from './e2e.js';
4
+ export { JOB_LEASE_TOKEN_AUDIENCE, type JobLeaseTokenClaims, jobLeaseTokenClaimsSchema, } from './job-lease-token.js';
5
+ export { RUNNER_SESSION_TOKEN_AUDIENCE, type RunnerSessionTokenClaims, runnerSessionTokenClaimsSchema, } from './runner-session-token.js';
6
+ export { type UserDto, userDtoSchema, userStatusSchema } from './user.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sCAAsC,EACtC,kCAAkC,EAClC,KAAK,uCAAuC,EAC5C,KAAK,YAAY,EACjB,KAAK,mCAAmC,EACxC,wCAAwC,EACxC,gBAAgB,EAChB,oCAAoC,GACrC,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,KAAK,qBAAqB,EAC1B,wBAAwB,EACxB,0CAA0C,EAC1C,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,KAAK,aAAa,EAClB,gBAAgB,EAChB,KAAK,2BAA2B,EAChC,KAAK,+BAA+B,EACpC,KAAK,2BAA2B,EAChC,8BAA8B,EAC9B,kCAAkC,EAClC,8BAA8B,EAC9B,cAAc,EACd,KAAK,kBAAkB,EACvB,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,uBAAuB,EACvB,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,KAAK,yBAAyB,EAC9B,KAAK,6BAA6B,EAClC,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,EACjC,4BAA4B,EAC5B,gCAAgC,EAChC,2BAA2B,EAC3B,+BAA+B,GAChC,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAClB,0BAA0B,EAC1B,8BAA8B,EAC9B,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,wBAAwB,EACxB,KAAK,mBAAmB,EACxB,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,6BAA6B,EAC7B,KAAK,wBAAwB,EAC7B,8BAA8B,GAC/B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAC,KAAK,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAC,MAAM,WAAW,CAAC"}
@@ -0,0 +1,8 @@
1
+ export { AUTH_EMAIL_VERIFICATION_SEND_REQUESTED, AUTH_PASSWORD_RESET_SEND_REQUESTED, authEmailVerificationSendRequestedSchema, authEventSchemas, authPasswordResetSendRequestedSchema } from '../events.js';
2
+ export { changePasswordBodySchema, EMAIL_VERIFICATION_RESEND_COOLDOWN_SECONDS, emailSchema, loginBodySchema, loginResponseSchema, logoutBodySchema, meResponseSchema, passwordResetConfirmBodySchema, passwordResetConfirmResponseSchema, passwordResetRequestBodySchema, passwordSchema, refreshResponseSchema, signupAcceptErrorSchema, signupBodySchema, signupMembershipSchema, signupResponseSchema, verifyEmailConfirmBodySchema, verifyEmailConfirmResponseSchema, verifyEmailResendBodySchema, verifyEmailResendResponseSchema } from './auth.js';
3
+ export { e2eCreateSessionBodySchema, e2eCreateSessionResponseSchema, e2eCreateUserBodySchema, e2eCreateUserResponseSchema } from './e2e.js';
4
+ export { JOB_LEASE_TOKEN_AUDIENCE, jobLeaseTokenClaimsSchema } from './job-lease-token.js';
5
+ export { RUNNER_SESSION_TOKEN_AUDIENCE, runnerSessionTokenClaimsSchema } from './runner-session-token.js';
6
+ export { userDtoSchema, userStatusSchema } from './user.js';
7
+
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/schemas/index.ts"],"sourcesContent":["export {\n AUTH_EMAIL_VERIFICATION_SEND_REQUESTED,\n AUTH_PASSWORD_RESET_SEND_REQUESTED,\n type AuthEmailVerificationSendRequestedEvent,\n type AuthEventMap,\n type AuthPasswordResetSendRequestedEvent,\n authEmailVerificationSendRequestedSchema,\n authEventSchemas,\n authPasswordResetSendRequestedSchema,\n} from '../events.js';\nexport {\n type ChangePasswordBodyDto,\n changePasswordBodySchema,\n EMAIL_VERIFICATION_RESEND_COOLDOWN_SECONDS,\n emailSchema,\n type LoginBodyDto,\n type LoginResponseDto,\n type LogoutBodyDto,\n loginBodySchema,\n loginResponseSchema,\n logoutBodySchema,\n type MeResponseDto,\n meResponseSchema,\n type PasswordResetConfirmBodyDto,\n type PasswordResetConfirmResponseDto,\n type PasswordResetRequestBodyDto,\n passwordResetConfirmBodySchema,\n passwordResetConfirmResponseSchema,\n passwordResetRequestBodySchema,\n passwordSchema,\n type RefreshResponseDto,\n refreshResponseSchema,\n type SignupAcceptErrorDto,\n type SignupBodyDto,\n type SignupMembershipDto,\n type SignupResponseDto,\n signupAcceptErrorSchema,\n signupBodySchema,\n signupMembershipSchema,\n signupResponseSchema,\n type VerifyEmailConfirmBodyDto,\n type VerifyEmailConfirmResponseDto,\n type VerifyEmailResendBodyDto,\n type VerifyEmailResendResponseDto,\n verifyEmailConfirmBodySchema,\n verifyEmailConfirmResponseSchema,\n verifyEmailResendBodySchema,\n verifyEmailResendResponseSchema,\n} from './auth.js';\nexport {\n type E2eCreateSessionBodyDto,\n type E2eCreateSessionResponseDto,\n type E2eCreateUserBodyDto,\n type E2eCreateUserResponseDto,\n type E2eSessionDto,\n e2eCreateSessionBodySchema,\n e2eCreateSessionResponseSchema,\n e2eCreateUserBodySchema,\n e2eCreateUserResponseSchema,\n} from './e2e.js';\nexport {\n JOB_LEASE_TOKEN_AUDIENCE,\n type JobLeaseTokenClaims,\n jobLeaseTokenClaimsSchema,\n} from './job-lease-token.js';\nexport {\n RUNNER_SESSION_TOKEN_AUDIENCE,\n type RunnerSessionTokenClaims,\n runnerSessionTokenClaimsSchema,\n} from './runner-session-token.js';\nexport {type UserDto, userDtoSchema, userStatusSchema} from './user.js';\n"],"names":["AUTH_EMAIL_VERIFICATION_SEND_REQUESTED","AUTH_PASSWORD_RESET_SEND_REQUESTED","authEmailVerificationSendRequestedSchema","authEventSchemas","authPasswordResetSendRequestedSchema","changePasswordBodySchema","EMAIL_VERIFICATION_RESEND_COOLDOWN_SECONDS","emailSchema","loginBodySchema","loginResponseSchema","logoutBodySchema","meResponseSchema","passwordResetConfirmBodySchema","passwordResetConfirmResponseSchema","passwordResetRequestBodySchema","passwordSchema","refreshResponseSchema","signupAcceptErrorSchema","signupBodySchema","signupMembershipSchema","signupResponseSchema","verifyEmailConfirmBodySchema","verifyEmailConfirmResponseSchema","verifyEmailResendBodySchema","verifyEmailResendResponseSchema","e2eCreateSessionBodySchema","e2eCreateSessionResponseSchema","e2eCreateUserBodySchema","e2eCreateUserResponseSchema","JOB_LEASE_TOKEN_AUDIENCE","jobLeaseTokenClaimsSchema","RUNNER_SESSION_TOKEN_AUDIENCE","runnerSessionTokenClaimsSchema","userDtoSchema","userStatusSchema"],"mappings":"AAAA,SACEA,sCAAsC,EACtCC,kCAAkC,EAIlCC,wCAAwC,EACxCC,gBAAgB,EAChBC,oCAAoC,QAC/B,eAAe;AACtB,SAEEC,wBAAwB,EACxBC,0CAA0C,EAC1CC,WAAW,EAIXC,eAAe,EACfC,mBAAmB,EACnBC,gBAAgB,EAEhBC,gBAAgB,EAIhBC,8BAA8B,EAC9BC,kCAAkC,EAClCC,8BAA8B,EAC9BC,cAAc,EAEdC,qBAAqB,EAKrBC,uBAAuB,EACvBC,gBAAgB,EAChBC,sBAAsB,EACtBC,oBAAoB,EAKpBC,4BAA4B,EAC5BC,gCAAgC,EAChCC,2BAA2B,EAC3BC,+BAA+B,QAC1B,YAAY;AACnB,SAMEC,0BAA0B,EAC1BC,8BAA8B,EAC9BC,uBAAuB,EACvBC,2BAA2B,QACtB,WAAW;AAClB,SACEC,wBAAwB,EAExBC,yBAAyB,QACpB,uBAAuB;AAC9B,SACEC,6BAA6B,EAE7BC,8BAA8B,QACzB,4BAA4B;AACnC,SAAsBC,aAAa,EAAEC,gBAAgB,QAAO,YAAY"}
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Audience claim binding a token to the job-lease use case. Distinct from auth
4
+ * tokens (separate secret) — this is defense-in-depth so the two token classes stay
5
+ * non-interchangeable even if a verifier is ever misconfigured.
6
+ */
7
+ export declare const JOB_LEASE_TOKEN_AUDIENCE = "runner-job-lease";
8
+ export declare const jobLeaseTokenClaimsSchema: z.ZodObject<{
9
+ workflowRunId: z.ZodString;
10
+ workflowRunAttempt: z.ZodOptional<z.ZodNumber>;
11
+ workflowRunAttemptId: z.ZodString;
12
+ jobId: z.ZodString;
13
+ jobExecutionId: z.ZodString;
14
+ projectId: z.ZodString;
15
+ workspaceId: z.ZodString;
16
+ runnerSessionId: z.ZodString;
17
+ currentStepId: z.ZodOptional<z.ZodString>;
18
+ currentStepAttempt: z.ZodOptional<z.ZodNumber>;
19
+ aud: z.ZodLiteral<"runner-job-lease">;
20
+ iat: z.ZodNumber;
21
+ exp: z.ZodNumber;
22
+ }, z.core.$strip>;
23
+ export type JobLeaseTokenClaims = z.infer<typeof jobLeaseTokenClaimsSchema>;
24
+ //# sourceMappingURL=job-lease-token.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"job-lease-token.d.ts","sourceRoot":"","sources":["../../src/schemas/job-lease-token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,qBAAqB,CAAC;AAE3D,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;iBAepC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Audience claim binding a token to the job-lease use case. Distinct from auth
4
+ * tokens (separate secret) — this is defense-in-depth so the two token classes stay
5
+ * non-interchangeable even if a verifier is ever misconfigured.
6
+ */ export const JOB_LEASE_TOKEN_AUDIENCE = 'runner-job-lease';
7
+ export const jobLeaseTokenClaimsSchema = z.object({
8
+ workflowRunId: z.string().uuid(),
9
+ workflowRunAttempt: z.number().int().positive().optional(),
10
+ workflowRunAttemptId: z.string().uuid(),
11
+ jobId: z.string().uuid(),
12
+ jobExecutionId: z.string().uuid(),
13
+ projectId: z.string().uuid(),
14
+ workspaceId: z.string().uuid(),
15
+ runnerSessionId: z.string().uuid(),
16
+ // Narrows append-log authorization to the step attempt currently dispatched to the runner.
17
+ currentStepId: z.string().uuid().optional(),
18
+ currentStepAttempt: z.number().int().positive().optional(),
19
+ aud: z.literal(JOB_LEASE_TOKEN_AUDIENCE),
20
+ iat: z.number().int(),
21
+ exp: z.number().int()
22
+ });
23
+
24
+ //# sourceMappingURL=job-lease-token.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/schemas/job-lease-token.ts"],"sourcesContent":["import {z} from 'zod';\n\n/**\n * Audience claim binding a token to the job-lease use case. Distinct from auth\n * tokens (separate secret) — this is defense-in-depth so the two token classes stay\n * non-interchangeable even if a verifier is ever misconfigured.\n */\nexport const JOB_LEASE_TOKEN_AUDIENCE = 'runner-job-lease';\n\nexport const jobLeaseTokenClaimsSchema = z.object({\n workflowRunId: z.string().uuid(),\n workflowRunAttempt: z.number().int().positive().optional(),\n workflowRunAttemptId: z.string().uuid(),\n jobId: z.string().uuid(),\n jobExecutionId: z.string().uuid(),\n projectId: z.string().uuid(),\n workspaceId: z.string().uuid(),\n runnerSessionId: z.string().uuid(),\n // Narrows append-log authorization to the step attempt currently dispatched to the runner.\n currentStepId: z.string().uuid().optional(),\n currentStepAttempt: z.number().int().positive().optional(),\n aud: z.literal(JOB_LEASE_TOKEN_AUDIENCE),\n iat: z.number().int(),\n exp: z.number().int(),\n});\n\nexport type JobLeaseTokenClaims = z.infer<typeof jobLeaseTokenClaimsSchema>;\n"],"names":["z","JOB_LEASE_TOKEN_AUDIENCE","jobLeaseTokenClaimsSchema","object","workflowRunId","string","uuid","workflowRunAttempt","number","int","positive","optional","workflowRunAttemptId","jobId","jobExecutionId","projectId","workspaceId","runnerSessionId","currentStepId","currentStepAttempt","aud","literal","iat","exp"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AAEtB;;;;CAIC,GACD,OAAO,MAAMC,2BAA2B,mBAAmB;AAE3D,OAAO,MAAMC,4BAA4BF,EAAEG,MAAM,CAAC;IAChDC,eAAeJ,EAAEK,MAAM,GAAGC,IAAI;IAC9BC,oBAAoBP,EAAEQ,MAAM,GAAGC,GAAG,GAAGC,QAAQ,GAAGC,QAAQ;IACxDC,sBAAsBZ,EAAEK,MAAM,GAAGC,IAAI;IACrCO,OAAOb,EAAEK,MAAM,GAAGC,IAAI;IACtBQ,gBAAgBd,EAAEK,MAAM,GAAGC,IAAI;IAC/BS,WAAWf,EAAEK,MAAM,GAAGC,IAAI;IAC1BU,aAAahB,EAAEK,MAAM,GAAGC,IAAI;IAC5BW,iBAAiBjB,EAAEK,MAAM,GAAGC,IAAI;IAChC,2FAA2F;IAC3FY,eAAelB,EAAEK,MAAM,GAAGC,IAAI,GAAGK,QAAQ;IACzCQ,oBAAoBnB,EAAEQ,MAAM,GAAGC,GAAG,GAAGC,QAAQ,GAAGC,QAAQ;IACxDS,KAAKpB,EAAEqB,OAAO,CAACpB;IACfqB,KAAKtB,EAAEQ,MAAM,GAAGC,GAAG;IACnBc,KAAKvB,EAAEQ,MAAM,GAAGC,GAAG;AACrB,GAAG"}
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Audience claim binding a token to runner-session data-plane auth. Distinct from
4
+ * job lease tokens (separate secret) so session tokens and per-job capabilities
5
+ * stay non-interchangeable.
6
+ */
7
+ export declare const RUNNER_SESSION_TOKEN_AUDIENCE = "runner-session";
8
+ export declare const runnerSessionTokenClaimsSchema: z.ZodObject<{
9
+ runnerSessionId: z.ZodString;
10
+ workspaceId: z.ZodString;
11
+ scope: z.ZodLiteral<"workspace">;
12
+ labels: z.ZodArray<z.ZodString>;
13
+ maxClaims: z.ZodNullable<z.ZodNumber>;
14
+ aud: z.ZodLiteral<"runner-session">;
15
+ iat: z.ZodNumber;
16
+ exp: z.ZodNumber;
17
+ }, z.core.$strip>;
18
+ export type RunnerSessionTokenClaims = z.infer<typeof runnerSessionTokenClaimsSchema>;
19
+ //# sourceMappingURL=runner-session-token.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner-session-token.d.ts","sourceRoot":"","sources":["../../src/schemas/runner-session-token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,mBAAmB,CAAC;AAE9D,eAAO,MAAM,8BAA8B;;;;;;;;;iBASzC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Audience claim binding a token to runner-session data-plane auth. Distinct from
4
+ * job lease tokens (separate secret) so session tokens and per-job capabilities
5
+ * stay non-interchangeable.
6
+ */ export const RUNNER_SESSION_TOKEN_AUDIENCE = 'runner-session';
7
+ export const runnerSessionTokenClaimsSchema = z.object({
8
+ runnerSessionId: z.string().uuid(),
9
+ workspaceId: z.string().uuid(),
10
+ scope: z.literal('workspace'),
11
+ labels: z.array(z.string()).min(1),
12
+ maxClaims: z.number().int().positive().nullable(),
13
+ aud: z.literal(RUNNER_SESSION_TOKEN_AUDIENCE),
14
+ iat: z.number().int(),
15
+ exp: z.number().int()
16
+ });
17
+
18
+ //# sourceMappingURL=runner-session-token.js.map