@auth-craft/api-contract 0.1.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 (125) hide show
  1. package/dist/auth.contract.d.ts +391 -0
  2. package/dist/auth.contract.d.ts.map +1 -0
  3. package/dist/auth.contract.js +138 -0
  4. package/dist/auth.contract.js.map +1 -0
  5. package/dist/core.d.ts +51 -0
  6. package/dist/core.d.ts.map +1 -0
  7. package/dist/core.js +29 -0
  8. package/dist/core.js.map +1 -0
  9. package/dist/groups/auth.d.ts +3 -0
  10. package/dist/groups/auth.d.ts.map +1 -0
  11. package/dist/groups/auth.js +3 -0
  12. package/dist/groups/auth.js.map +1 -0
  13. package/dist/groups/core.d.ts +15 -0
  14. package/dist/groups/core.d.ts.map +1 -0
  15. package/dist/groups/core.js +13 -0
  16. package/dist/groups/core.js.map +1 -0
  17. package/dist/groups/mfa.d.ts +3 -0
  18. package/dist/groups/mfa.d.ts.map +1 -0
  19. package/dist/groups/mfa.js +3 -0
  20. package/dist/groups/mfa.js.map +1 -0
  21. package/dist/groups/oauth.d.ts +3 -0
  22. package/dist/groups/oauth.d.ts.map +1 -0
  23. package/dist/groups/oauth.js +3 -0
  24. package/dist/groups/oauth.js.map +1 -0
  25. package/dist/groups/password.d.ts +3 -0
  26. package/dist/groups/password.d.ts.map +1 -0
  27. package/dist/groups/password.js +3 -0
  28. package/dist/groups/password.js.map +1 -0
  29. package/dist/groups/session.d.ts +3 -0
  30. package/dist/groups/session.d.ts.map +1 -0
  31. package/dist/groups/session.js +3 -0
  32. package/dist/groups/session.js.map +1 -0
  33. package/dist/groups/tenants.d.ts +3 -0
  34. package/dist/groups/tenants.d.ts.map +1 -0
  35. package/dist/groups/tenants.js +3 -0
  36. package/dist/groups/tenants.js.map +1 -0
  37. package/dist/groups/users.d.ts +3 -0
  38. package/dist/groups/users.d.ts.map +1 -0
  39. package/dist/groups/users.js +3 -0
  40. package/dist/groups/users.js.map +1 -0
  41. package/dist/groups/verification.d.ts +3 -0
  42. package/dist/groups/verification.d.ts.map +1 -0
  43. package/dist/groups/verification.js +3 -0
  44. package/dist/groups/verification.js.map +1 -0
  45. package/dist/index.d.ts +701 -0
  46. package/dist/index.d.ts.map +1 -0
  47. package/dist/index.js +32 -0
  48. package/dist/index.js.map +1 -0
  49. package/dist/internal/index.d.ts +952 -0
  50. package/dist/internal/index.d.ts.map +1 -0
  51. package/dist/internal/index.js +339 -0
  52. package/dist/internal/index.js.map +1 -0
  53. package/dist/internal/responses.d.ts +262 -0
  54. package/dist/internal/responses.d.ts.map +1 -0
  55. package/dist/internal/responses.js +145 -0
  56. package/dist/internal/responses.js.map +1 -0
  57. package/dist/login-result.d.ts +20 -0
  58. package/dist/login-result.d.ts.map +1 -0
  59. package/dist/login-result.js +13 -0
  60. package/dist/login-result.js.map +1 -0
  61. package/dist/mfa.contract.d.ts +155 -0
  62. package/dist/mfa.contract.d.ts.map +1 -0
  63. package/dist/mfa.contract.js +73 -0
  64. package/dist/mfa.contract.js.map +1 -0
  65. package/dist/oauth.contract.d.ts +163 -0
  66. package/dist/oauth.contract.d.ts.map +1 -0
  67. package/dist/oauth.contract.js +65 -0
  68. package/dist/oauth.contract.js.map +1 -0
  69. package/dist/password.contract.d.ts +83 -0
  70. package/dist/password.contract.d.ts.map +1 -0
  71. package/dist/password.contract.js +46 -0
  72. package/dist/password.contract.js.map +1 -0
  73. package/dist/responses/auth.d.ts +19 -0
  74. package/dist/responses/auth.d.ts.map +1 -0
  75. package/dist/responses/auth.js +19 -0
  76. package/dist/responses/auth.js.map +1 -0
  77. package/dist/responses/core.d.ts +86 -0
  78. package/dist/responses/core.d.ts.map +1 -0
  79. package/dist/responses/core.js +72 -0
  80. package/dist/responses/core.js.map +1 -0
  81. package/dist/responses/mfa.d.ts +31 -0
  82. package/dist/responses/mfa.d.ts.map +1 -0
  83. package/dist/responses/mfa.js +24 -0
  84. package/dist/responses/mfa.js.map +1 -0
  85. package/dist/responses/oauth.d.ts +18 -0
  86. package/dist/responses/oauth.d.ts.map +1 -0
  87. package/dist/responses/oauth.js +13 -0
  88. package/dist/responses/oauth.js.map +1 -0
  89. package/dist/responses/session.d.ts +32 -0
  90. package/dist/responses/session.d.ts.map +1 -0
  91. package/dist/responses/session.js +19 -0
  92. package/dist/responses/session.js.map +1 -0
  93. package/dist/responses/tenant.d.ts +92 -0
  94. package/dist/responses/tenant.d.ts.map +1 -0
  95. package/dist/responses/tenant.js +66 -0
  96. package/dist/responses/tenant.js.map +1 -0
  97. package/dist/responses/verification.d.ts +9 -0
  98. package/dist/responses/verification.d.ts.map +1 -0
  99. package/dist/responses/verification.js +9 -0
  100. package/dist/responses/verification.js.map +1 -0
  101. package/dist/responses.d.ts +17 -0
  102. package/dist/responses.d.ts.map +1 -0
  103. package/dist/responses.js +17 -0
  104. package/dist/responses.js.map +1 -0
  105. package/dist/schemas.d.ts +18 -0
  106. package/dist/schemas.d.ts.map +1 -0
  107. package/dist/schemas.js +18 -0
  108. package/dist/schemas.js.map +1 -0
  109. package/dist/session.contract.d.ts +97 -0
  110. package/dist/session.contract.d.ts.map +1 -0
  111. package/dist/session.contract.js +44 -0
  112. package/dist/session.contract.js.map +1 -0
  113. package/dist/tenants.contract.d.ts +403 -0
  114. package/dist/tenants.contract.d.ts.map +1 -0
  115. package/dist/tenants.contract.js +146 -0
  116. package/dist/tenants.contract.js.map +1 -0
  117. package/dist/users.contract.d.ts +63 -0
  118. package/dist/users.contract.d.ts.map +1 -0
  119. package/dist/users.contract.js +25 -0
  120. package/dist/users.contract.js.map +1 -0
  121. package/dist/verification.contract.d.ts +67 -0
  122. package/dist/verification.contract.d.ts.map +1 -0
  123. package/dist/verification.contract.js +35 -0
  124. package/dist/verification.contract.js.map +1 -0
  125. package/package.json +75 -0
@@ -0,0 +1,65 @@
1
+ /** OAuth endpoints. */
2
+ import * as v from 'valibot';
3
+ import { endpoint } from './core';
4
+ import { loginResultResponse, messageResponse } from './responses/core';
5
+ import { listOAuthProvidersResponse, oauthStateResponse } from './responses/oauth';
6
+ // POST /oauth/state — CSRF double-submit: returns { state }, sets oauth_state cookie. (public)
7
+ export const oauthState = endpoint({
8
+ method: 'POST',
9
+ path: '/oauth/state',
10
+ kind: 'data',
11
+ public: true,
12
+ response: oauthStateResponse
13
+ });
14
+ // POST /oauth/callback — login/register via provider. (public, session-bootstrapping)
15
+ // `accessToken` is intentionally NOT accepted (token-substitution); use code/credential.
16
+ export const oauthCallback = endpoint({
17
+ method: 'POST',
18
+ path: '/oauth/callback',
19
+ kind: 'login',
20
+ public: true,
21
+ body: v.object({
22
+ provider: v.pipe(v.string(), v.maxLength(100)),
23
+ code: v.optional(v.pipe(v.string(), v.maxLength(8192))),
24
+ credential: v.optional(v.pipe(v.string(), v.maxLength(8192))),
25
+ state: v.optional(v.pipe(v.string(), v.maxLength(1024))),
26
+ tenantId: v.optional(v.pipe(v.string(), v.maxLength(100)))
27
+ }),
28
+ response: loginResultResponse
29
+ });
30
+ // POST /oauth/link (authenticated). `accessToken` intentionally not accepted.
31
+ export const linkProvider = endpoint({
32
+ method: 'POST',
33
+ path: '/oauth/link',
34
+ kind: 'data',
35
+ body: v.object({
36
+ provider: v.string(),
37
+ code: v.optional(v.string())
38
+ }),
39
+ response: messageResponse
40
+ });
41
+ // POST /oauth/unlink (authenticated)
42
+ export const unlinkProvider = endpoint({
43
+ method: 'POST',
44
+ path: '/oauth/unlink',
45
+ kind: 'data',
46
+ body: v.object({
47
+ provider: v.string()
48
+ }),
49
+ response: messageResponse
50
+ });
51
+ // GET /oauth/providers (authenticated)
52
+ export const getProviders = endpoint({
53
+ method: 'GET',
54
+ path: '/oauth/providers',
55
+ kind: 'data',
56
+ response: listOAuthProvidersResponse
57
+ });
58
+ export const oauthContract = {
59
+ oauthState,
60
+ oauthCallback,
61
+ linkProvider,
62
+ unlinkProvider,
63
+ getProviders
64
+ };
65
+ //# sourceMappingURL=oauth.contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth.contract.js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+ readonly method: "PATCH";
5
+ readonly path: "/password/change";
6
+ readonly kind: "data";
7
+ readonly body: v.ObjectSchema<{
8
+ readonly currentPassword: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 4096, undefined>]>;
9
+ readonly newPassword: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 4096, undefined>]>;
10
+ }, undefined>;
11
+ readonly response: v.ObjectSchema<{
12
+ readonly message: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
13
+ }, undefined>;
14
+ };
15
+ export declare const forgotPassword: {
16
+ readonly method: "POST";
17
+ readonly path: "/password/forgot";
18
+ readonly kind: "data";
19
+ readonly public: true;
20
+ readonly body: v.ObjectSchema<{
21
+ readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 320, undefined>, v.EmailAction<string, undefined>]>;
22
+ }, undefined>;
23
+ readonly response: v.ObjectSchema<{
24
+ readonly challengeId: v.StringSchema<undefined>;
25
+ readonly expiresAt: v.StringSchema<undefined>;
26
+ }, undefined>;
27
+ };
28
+ export declare const resetPassword: {
29
+ readonly method: "POST";
30
+ readonly path: "/password/reset";
31
+ readonly kind: "data";
32
+ readonly public: true;
33
+ readonly body: v.ObjectSchema<{
34
+ readonly challengeId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, number, undefined>]>;
35
+ readonly code: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, number, undefined>]>;
36
+ readonly newPassword: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 4096, undefined>]>;
37
+ }, undefined>;
38
+ readonly response: v.ObjectSchema<{
39
+ readonly message: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
40
+ }, undefined>;
41
+ };
42
+ export declare const passwordContract: {
43
+ readonly changePassword: {
44
+ readonly method: "PATCH";
45
+ readonly path: "/password/change";
46
+ readonly kind: "data";
47
+ readonly body: v.ObjectSchema<{
48
+ readonly currentPassword: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 4096, undefined>]>;
49
+ readonly newPassword: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 4096, undefined>]>;
50
+ }, undefined>;
51
+ readonly response: v.ObjectSchema<{
52
+ readonly message: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
53
+ }, undefined>;
54
+ };
55
+ readonly forgotPassword: {
56
+ readonly method: "POST";
57
+ readonly path: "/password/forgot";
58
+ readonly kind: "data";
59
+ readonly public: true;
60
+ readonly body: v.ObjectSchema<{
61
+ readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 320, undefined>, v.EmailAction<string, undefined>]>;
62
+ }, undefined>;
63
+ readonly response: v.ObjectSchema<{
64
+ readonly challengeId: v.StringSchema<undefined>;
65
+ readonly expiresAt: v.StringSchema<undefined>;
66
+ }, undefined>;
67
+ };
68
+ readonly resetPassword: {
69
+ readonly method: "POST";
70
+ readonly path: "/password/reset";
71
+ readonly kind: "data";
72
+ readonly public: true;
73
+ readonly body: v.ObjectSchema<{
74
+ readonly challengeId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, number, undefined>]>;
75
+ readonly code: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, number, undefined>]>;
76
+ readonly newPassword: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 4096, undefined>]>;
77
+ }, undefined>;
78
+ readonly response: v.ObjectSchema<{
79
+ readonly message: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
80
+ }, undefined>;
81
+ };
82
+ };
83
+ //# sourceMappingURL=password.contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"password.contract.d.ts","sourceRoot":"","sources":["../src/password.contract.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAM5B,eAAO,MAAM,cAAc;;;;;;;;;;;CASzB,CAAA;AAGF,eAAO,MAAM,cAAc;;;;;;;;;;;;CASzB,CAAA;AAGF,eAAO,MAAM,aAAa;;;;;;;;;;;;;CAWxB,CAAA;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAInB,CAAA"}
@@ -0,0 +1,46 @@
1
+ /** Password management endpoints. */
2
+ import * as v from 'valibot';
3
+ import { endpoint } from './core';
4
+ import { challengeAckResponse, messageResponse } from './responses/core';
5
+ import { secretString, shortString } from './schemas';
6
+ // PATCH /password/change (authenticated)
7
+ export const changePassword = endpoint({
8
+ method: 'PATCH',
9
+ path: '/password/change',
10
+ kind: 'data',
11
+ body: v.object({
12
+ currentPassword: secretString,
13
+ newPassword: secretString
14
+ }),
15
+ response: messageResponse
16
+ });
17
+ // POST /password/forgot (public)
18
+ export const forgotPassword = endpoint({
19
+ method: 'POST',
20
+ path: '/password/forgot',
21
+ kind: 'data',
22
+ public: true,
23
+ body: v.object({
24
+ email: v.pipe(v.string(), v.maxLength(320), v.email())
25
+ }),
26
+ response: challengeAckResponse
27
+ });
28
+ // POST /password/reset (public)
29
+ export const resetPassword = endpoint({
30
+ method: 'POST',
31
+ path: '/password/reset',
32
+ kind: 'data',
33
+ public: true,
34
+ body: v.object({
35
+ challengeId: shortString(),
36
+ code: shortString(),
37
+ newPassword: secretString
38
+ }),
39
+ response: messageResponse
40
+ });
41
+ export const passwordContract = {
42
+ changePassword,
43
+ forgotPassword,
44
+ resetPassword
45
+ };
46
+ //# sourceMappingURL=password.contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"password.contract.js","sourceRoot":"","sources":["../src/password.contract.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AACjC,OAAO,EA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 -0,0 +1,19 @@
1
+ /** Auth-group response schemas (login union/profile live in responses/core). */
2
+ import * as v from 'valibot';
3
+ /** MFA challenge issued (masked recipient + expiry). */
4
+ export declare const issueMfaResponse: v.ObjectSchema<{
5
+ readonly maskedRecipient: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
6
+ readonly expiresAt: v.StringSchema<undefined>;
7
+ }, undefined>;
8
+ /** Registration result — userId, plus an optional verification challenge. */
9
+ export declare const registerResponse: v.ObjectSchema<{
10
+ readonly userId: v.StringSchema<undefined>;
11
+ readonly verification: v.OptionalSchema<v.ObjectSchema<{
12
+ readonly channel: v.StringSchema<undefined>;
13
+ readonly challengeId: v.StringSchema<undefined>;
14
+ readonly expiresAt: v.StringSchema<undefined>;
15
+ readonly identityType: v.StringSchema<undefined>;
16
+ readonly identityValue: v.StringSchema<undefined>;
17
+ }, undefined>, undefined>;
18
+ }, undefined>;
19
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/responses/auth.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,wDAAwD;AACxD,eAAO,MAAM,gBAAgB;;;aAG3B,CAAA;AAEF,6EAA6E;AAC7E,eAAO,MAAM,gBAAgB;;;;;;;;;aAW3B,CAAA"}
@@ -0,0 +1,19 @@
1
+ /** Auth-group response schemas (login union/profile live in responses/core). */
2
+ import * as v from 'valibot';
3
+ /** MFA challenge issued (masked recipient + expiry). */
4
+ export const issueMfaResponse = v.object({
5
+ maskedRecipient: v.optional(v.string()),
6
+ expiresAt: v.string()
7
+ });
8
+ /** Registration result — userId, plus an optional verification challenge. */
9
+ export const registerResponse = v.object({
10
+ userId: v.string(),
11
+ verification: v.optional(v.object({
12
+ channel: v.string(),
13
+ challengeId: v.string(),
14
+ expiresAt: v.string(),
15
+ identityType: v.string(),
16
+ identityValue: v.string()
17
+ }))
18
+ });
19
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/responses/auth.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,wDAAwD;AACxD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,eAAe,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACvC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAA;AAEF,6EAA6E;AAC7E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,YAAY,EAAE,CAAC,CAAC,QAAQ,CACtB,CAAC,CAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;QACnB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;QACvB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;QACrB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;QACxB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;KAC1B,CAAC,CACH;CACF,CAAC,CAAA"}
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Shared response schemas — used by more than one group.
3
+ *
4
+ * Lives in `core` so a single group (e.g. auth) can import what it needs
5
+ * without dragging in unrelated groups' shapes. Group-specific responses live
6
+ * in `responses/<group>.ts`.
7
+ *
8
+ * IMPORTANT: these describe the JSON the client receives AFTER the
9
+ * ts-micro-result envelope is unwrapped. Timestamps are `string` (ISO), not
10
+ * Date — backend DTOs use Date but they serialize over HTTP.
11
+ */
12
+ import * as v from 'valibot';
13
+ /** A simple { message } acknowledgement. */
14
+ export declare const messageResponse: v.ObjectSchema<{
15
+ readonly message: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
16
+ }, undefined>;
17
+ export declare const authTokensResponse: v.ObjectSchema<{
18
+ readonly accessToken: v.StringSchema<undefined>;
19
+ readonly refreshToken: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
20
+ readonly expiresAt: v.NumberSchema<undefined>;
21
+ }, undefined>;
22
+ export declare const challengeRequiredResponse: v.ObjectSchema<{
23
+ readonly requiresChallenge: v.LiteralSchema<true, undefined>;
24
+ readonly challenge: v.ObjectSchema<{
25
+ readonly type: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
26
+ readonly phase: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
27
+ readonly expiresAt: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
28
+ readonly data: v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>;
29
+ }, undefined>;
30
+ }, undefined>;
31
+ export declare const mfaRequiredResponse: v.ObjectSchema<{
32
+ readonly requiresMfa: v.LiteralSchema<true, undefined>;
33
+ readonly mfa: v.ObjectSchema<{
34
+ readonly phase: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
35
+ readonly challengeId: v.StringSchema<undefined>;
36
+ readonly methods: v.ArraySchema<v.StringSchema<undefined>, undefined>;
37
+ readonly method: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
38
+ readonly expiresAt: v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>;
39
+ readonly userId: v.StringSchema<undefined>;
40
+ }, undefined>;
41
+ }, undefined>;
42
+ /** Discriminated union returned by login-kind endpoints. */
43
+ export declare const loginResultResponse: v.UnionSchema<[v.ObjectSchema<{
44
+ readonly requiresChallenge: v.LiteralSchema<true, undefined>;
45
+ readonly challenge: v.ObjectSchema<{
46
+ readonly type: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
47
+ readonly phase: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
48
+ readonly expiresAt: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
49
+ readonly data: v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>;
50
+ }, undefined>;
51
+ }, undefined>, v.ObjectSchema<{
52
+ readonly requiresMfa: v.LiteralSchema<true, undefined>;
53
+ readonly mfa: v.ObjectSchema<{
54
+ readonly phase: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
55
+ readonly challengeId: v.StringSchema<undefined>;
56
+ readonly methods: v.ArraySchema<v.StringSchema<undefined>, undefined>;
57
+ readonly method: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
58
+ readonly expiresAt: v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>;
59
+ readonly userId: v.StringSchema<undefined>;
60
+ }, undefined>;
61
+ }, undefined>, v.ObjectSchema<{
62
+ readonly accessToken: v.StringSchema<undefined>;
63
+ readonly refreshToken: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
64
+ readonly expiresAt: v.NumberSchema<undefined>;
65
+ }, undefined>], undefined>;
66
+ /** Global user profile (GET /auth/me, PATCH /users/profile). */
67
+ export declare const userProfileResponse: v.ObjectSchema<{
68
+ readonly id: v.StringSchema<undefined>;
69
+ readonly contactEmail: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
70
+ readonly contactPhone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
71
+ readonly username: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
72
+ readonly displayName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
73
+ readonly givenName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
74
+ readonly familyName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
75
+ readonly avatarUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
76
+ readonly locale: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
77
+ readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
78
+ readonly createdAt: v.StringSchema<undefined>;
79
+ readonly updatedAt: v.StringSchema<undefined>;
80
+ }, undefined>;
81
+ /** A 2-step challenge acknowledgement (password reset / verification start). */
82
+ export declare const challengeAckResponse: v.ObjectSchema<{
83
+ readonly challengeId: v.StringSchema<undefined>;
84
+ readonly expiresAt: v.StringSchema<undefined>;
85
+ }, undefined>;
86
+ //# sourceMappingURL=core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/responses/core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,4CAA4C;AAC5C,eAAO,MAAM,eAAe;;aAE1B,CAAA;AAOF,eAAO,MAAM,kBAAkB;;;;aAI7B,CAAA;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;aAQpC,CAAA;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;aAU9B,CAAA;AAEF,4DAA4D;AAC5D,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;0BAI9B,CAAA;AAEF,gEAAgE;AAChE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;aAa9B,CAAA;AAEF,gFAAgF;AAChF,eAAO,MAAM,oBAAoB;;;aAG/B,CAAA"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Shared response schemas — used by more than one group.
3
+ *
4
+ * Lives in `core` so a single group (e.g. auth) can import what it needs
5
+ * without dragging in unrelated groups' shapes. Group-specific responses live
6
+ * in `responses/<group>.ts`.
7
+ *
8
+ * IMPORTANT: these describe the JSON the client receives AFTER the
9
+ * ts-micro-result envelope is unwrapped. Timestamps are `string` (ISO), not
10
+ * Date — backend DTOs use Date but they serialize over HTTP.
11
+ */
12
+ import * as v from 'valibot';
13
+ /** A simple { message } acknowledgement. */
14
+ export const messageResponse = v.object({
15
+ message: v.optional(v.string())
16
+ });
17
+ // ── Login result union (authenticate / complete-challenge / oauth callback) ────
18
+ // A login call resolves to ONE of: tokens (success), a credential challenge
19
+ // (2-step, e.g. OTP), or an MFA requirement. The client discriminates on the
20
+ // `requiresChallenge` / `requiresMfa` flags (see the type guards in core).
21
+ export const authTokensResponse = v.object({
22
+ accessToken: v.string(),
23
+ refreshToken: v.optional(v.string()),
24
+ expiresAt: v.number()
25
+ });
26
+ export const challengeRequiredResponse = v.object({
27
+ requiresChallenge: v.literal(true),
28
+ challenge: v.object({
29
+ type: v.optional(v.string()),
30
+ phase: v.optional(v.string()),
31
+ expiresAt: v.optional(v.union([v.string(), v.number()])),
32
+ data: v.record(v.string(), v.unknown())
33
+ })
34
+ });
35
+ export const mfaRequiredResponse = v.object({
36
+ requiresMfa: v.literal(true),
37
+ mfa: v.object({
38
+ phase: v.optional(v.string()),
39
+ challengeId: v.string(),
40
+ methods: v.array(v.string()),
41
+ method: v.optional(v.string()),
42
+ expiresAt: v.union([v.string(), v.number()]),
43
+ userId: v.string()
44
+ })
45
+ });
46
+ /** Discriminated union returned by login-kind endpoints. */
47
+ export const loginResultResponse = v.union([
48
+ challengeRequiredResponse,
49
+ mfaRequiredResponse,
50
+ authTokensResponse
51
+ ]);
52
+ /** Global user profile (GET /auth/me, PATCH /users/profile). */
53
+ export const userProfileResponse = v.object({
54
+ id: v.string(),
55
+ contactEmail: v.optional(v.string()),
56
+ contactPhone: v.optional(v.string()),
57
+ username: v.optional(v.string()),
58
+ displayName: v.optional(v.string()),
59
+ givenName: v.optional(v.string()),
60
+ familyName: v.optional(v.string()),
61
+ avatarUrl: v.optional(v.string()),
62
+ locale: v.optional(v.string()),
63
+ metadata: v.optional(v.record(v.string(), v.unknown())),
64
+ createdAt: v.string(),
65
+ updatedAt: v.string()
66
+ });
67
+ /** A 2-step challenge acknowledgement (password reset / verification start). */
68
+ export const challengeAckResponse = v.object({
69
+ challengeId: v.string(),
70
+ expiresAt: v.string()
71
+ });
72
+ //# sourceMappingURL=core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.js","sourceRoot":"","sources":["../../src/responses/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EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACjC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC9B,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACvD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAA;AAEF,gFAAgF;AAChF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAA"}
@@ -0,0 +1,31 @@
1
+ /** MFA-group response schemas. */
2
+ import * as v from 'valibot';
3
+ export declare const mfaSetupResponse: v.ObjectSchema<{
4
+ readonly method: v.StringSchema<undefined>;
5
+ readonly data: v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>;
6
+ }, undefined>;
7
+ export declare const mfaVerifyResponse: v.ObjectSchema<{
8
+ readonly method: v.StringSchema<undefined>;
9
+ readonly verified: v.BooleanSchema<undefined>;
10
+ readonly data: v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>;
11
+ }, undefined>;
12
+ export declare const mfaAuthenticatorResponse: v.ObjectSchema<{
13
+ readonly method: v.StringSchema<undefined>;
14
+ readonly verifiedAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
15
+ readonly createdAt: v.StringSchema<undefined>;
16
+ readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
17
+ readonly label: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
18
+ readonly lastUsedAt: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
19
+ }, undefined>;
20
+ export declare const listAuthenticatorsResponse: v.ObjectSchema<{
21
+ readonly authenticators: v.ArraySchema<v.ObjectSchema<{
22
+ readonly method: v.StringSchema<undefined>;
23
+ readonly verifiedAt: v.NullableSchema<v.StringSchema<undefined>, undefined>;
24
+ readonly createdAt: v.StringSchema<undefined>;
25
+ readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
26
+ readonly label: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
27
+ readonly lastUsedAt: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
28
+ }, undefined>, undefined>;
29
+ readonly total: v.NumberSchema<undefined>;
30
+ }, undefined>;
31
+ //# sourceMappingURL=mfa.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mfa.d.ts","sourceRoot":"","sources":["../../src/responses/mfa.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,eAAO,MAAM,gBAAgB;;;aAG3B,CAAA;AAEF,eAAO,MAAM,iBAAiB;;;;aAI5B,CAAA;AAEF,eAAO,MAAM,wBAAwB;;;;;;;aAOnC,CAAA;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;aAGrC,CAAA"}
@@ -0,0 +1,24 @@
1
+ /** MFA-group response schemas. */
2
+ import * as v from 'valibot';
3
+ export const mfaSetupResponse = v.object({
4
+ method: v.string(),
5
+ data: v.record(v.string(), v.unknown())
6
+ });
7
+ export const mfaVerifyResponse = v.object({
8
+ method: v.string(),
9
+ verified: v.boolean(),
10
+ data: v.record(v.string(), v.unknown())
11
+ });
12
+ export const mfaAuthenticatorResponse = v.object({
13
+ method: v.string(),
14
+ verifiedAt: v.nullable(v.string()),
15
+ createdAt: v.string(),
16
+ id: v.optional(v.string()),
17
+ label: v.optional(v.string()),
18
+ lastUsedAt: v.optional(v.string())
19
+ });
20
+ export const listAuthenticatorsResponse = v.object({
21
+ authenticators: v.array(mfaAuthenticatorResponse),
22
+ total: v.number()
23
+ });
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,wBAAwB,CAAC;IACjD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;CAClB,CAAC,CAAA"}
@@ -0,0 +1,18 @@
1
+ /** OAuth-group response schemas (login union lives in responses/core). */
2
+ import * as v from 'valibot';
3
+ export declare const oauthStateResponse: v.ObjectSchema<{
4
+ readonly state: v.StringSchema<undefined>;
5
+ }, undefined>;
6
+ export declare const oauthProviderResponse: v.ObjectSchema<{
7
+ readonly provider: v.StringSchema<undefined>;
8
+ readonly providerId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
9
+ readonly email: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
10
+ readonly linkedAt: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
11
+ }, undefined>;
12
+ export declare const listOAuthProvidersResponse: v.ArraySchema<v.ObjectSchema<{
13
+ readonly provider: v.StringSchema<undefined>;
14
+ readonly providerId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
15
+ readonly email: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
16
+ readonly linkedAt: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
17
+ }, undefined>, undefined>;
18
+ //# sourceMappingURL=oauth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../src/responses/oauth.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,eAAO,MAAM,kBAAkB;;aAE7B,CAAA;AAEF,eAAO,MAAM,qBAAqB;;;;;aAKhC,CAAA;AAEF,eAAO,MAAM,0BAA0B;;;;;yBAAiC,CAAA"}
@@ -0,0 +1,13 @@
1
+ /** OAuth-group response schemas (login union lives in responses/core). */
2
+ import * as v from 'valibot';
3
+ export const oauthStateResponse = v.object({
4
+ state: v.string()
5
+ });
6
+ export const oauthProviderResponse = v.object({
7
+ provider: v.string(),
8
+ providerId: v.optional(v.string()),
9
+ email: v.optional(v.string()),
10
+ linkedAt: v.optional(v.string())
11
+ });
12
+ export const listOAuthProvidersResponse = v.array(oauthProviderResponse);
13
+ //# sourceMappingURL=oauth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth.js","sourceRoot":"","sources":["../../src/responses/oauth.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;CAClB,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAClC,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC7B,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CACjC,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAA"}
@@ -0,0 +1,32 @@
1
+ /** Session-group response schemas. */
2
+ import * as v from 'valibot';
3
+ /** One session in the list (GET /sessions). */
4
+ export declare const sessionInfoResponse: v.ObjectSchema<{
5
+ readonly id: v.StringSchema<undefined>;
6
+ readonly tokenId: v.StringSchema<undefined>;
7
+ readonly tenantId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
8
+ readonly deviceLabel: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
9
+ readonly country: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
10
+ readonly city: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
11
+ readonly createdAt: v.StringSchema<undefined>;
12
+ readonly expiresAt: v.StringSchema<undefined>;
13
+ readonly lastUsedAt: v.StringSchema<undefined>;
14
+ readonly revokedAt: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
15
+ readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
16
+ readonly isCurrent: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
17
+ }, undefined>;
18
+ export declare const listSessionsResponse: v.ArraySchema<v.ObjectSchema<{
19
+ readonly id: v.StringSchema<undefined>;
20
+ readonly tokenId: v.StringSchema<undefined>;
21
+ readonly tenantId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
22
+ readonly deviceLabel: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
23
+ readonly country: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
24
+ readonly city: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
25
+ readonly createdAt: v.StringSchema<undefined>;
26
+ readonly expiresAt: v.StringSchema<undefined>;
27
+ readonly lastUsedAt: v.StringSchema<undefined>;
28
+ readonly revokedAt: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
29
+ readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
30
+ readonly isCurrent: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
31
+ }, undefined>, undefined>;
32
+ //# sourceMappingURL=session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/responses/session.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,+CAA+C;AAC/C,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;aAa9B,CAAA;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;yBAA+B,CAAA"}
@@ -0,0 +1,19 @@
1
+ /** Session-group response schemas. */
2
+ import * as v from 'valibot';
3
+ /** One session in the list (GET /sessions). */
4
+ export const sessionInfoResponse = v.object({
5
+ id: v.string(),
6
+ tokenId: v.string(),
7
+ tenantId: v.optional(v.string()),
8
+ deviceLabel: v.optional(v.string()),
9
+ country: v.optional(v.string()),
10
+ city: v.optional(v.string()),
11
+ createdAt: v.string(),
12
+ expiresAt: v.string(),
13
+ lastUsedAt: v.string(),
14
+ revokedAt: v.optional(v.nullable(v.string())),
15
+ metadata: v.optional(v.record(v.string(), v.unknown())),
16
+ isCurrent: v.optional(v.boolean())
17
+ });
18
+ export const listSessionsResponse = v.array(sessionInfoResponse);
19
+ //# sourceMappingURL=session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/responses/session.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,+CAA+C;AAC/C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAChC,WAAW,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC/B,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC5B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IAC7C,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACvD,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;CACnC,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAA"}