@veruna/api-contracts 1.0.32 → 1.0.34

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.
@@ -36,7 +36,6 @@ export declare const REST_API: {
36
36
  readonly STATUS: "/api/v1/users/me/password/change/status";
37
37
  readonly COMPLETE: "/api/v1/users/me/password/change/complete";
38
38
  };
39
- readonly VERIFICATIONS_ACTIVE: "/api/v1/users/me/verifications/active";
40
39
  };
41
40
  readonly UNREG: {
42
41
  readonly AUTHENTICATE: "/api/v1/unreg/";
@@ -136,6 +135,8 @@ export declare const REST_API: {
136
135
  };
137
136
  readonly VERIFICATION: {
138
137
  readonly RESEND: "/api/v1/verification/resend";
138
+ readonly ACTIVE: "/api/v1/verification/active";
139
+ readonly CANCEL: (requestId: string) => string;
139
140
  };
140
141
  };
141
142
  };
package/build/rest-api.js CHANGED
@@ -43,7 +43,6 @@ exports.REST_API = {
43
43
  STATUS: `${exports.ROOT}/${controllers_1.USERS_CONTROLLER}/${routes_1.USERS_ROUTES.PASSWORD_CHANGE_STATUS}`,
44
44
  COMPLETE: `${exports.ROOT}/${controllers_1.USERS_CONTROLLER}/${routes_1.USERS_ROUTES.PASSWORD_CHANGE_COMPLETE}`,
45
45
  },
46
- VERIFICATIONS_ACTIVE: `${exports.ROOT}/${controllers_1.USERS_CONTROLLER}/${routes_1.USERS_ROUTES.VERIFICATIONS_ACTIVE}`,
47
46
  },
48
47
  // Unregistered Users
49
48
  UNREG: {
@@ -153,6 +152,8 @@ exports.REST_API = {
153
152
  },
154
153
  VERIFICATION: {
155
154
  RESEND: `${exports.ROOT}/${controllers_1.VERIFICATION_CONTROLLER}/${routes_1.VERIFICATION_ROUTES.RESEND}`,
155
+ ACTIVE: `${exports.ROOT}/${controllers_1.VERIFICATION_CONTROLLER}/${routes_1.VERIFICATION_ROUTES.ACTIVE}`,
156
+ CANCEL: (requestId) => `${exports.ROOT}/${controllers_1.VERIFICATION_CONTROLLER}/${requestId}/cancel`,
156
157
  },
157
158
  },
158
159
  };
@@ -18,5 +18,4 @@ export declare const USERS_ROUTES: {
18
18
  readonly PASSWORD_CHANGE_VERIFY: "me/password/change/verify";
19
19
  readonly PASSWORD_CHANGE_STATUS: "me/password/change/status";
20
20
  readonly PASSWORD_CHANGE_COMPLETE: "me/password/change/complete";
21
- readonly VERIFICATIONS_ACTIVE: "me/verifications/active";
22
21
  };
@@ -21,5 +21,4 @@ exports.USERS_ROUTES = {
21
21
  PASSWORD_CHANGE_VERIFY: 'me/password/change/verify',
22
22
  PASSWORD_CHANGE_STATUS: 'me/password/change/status',
23
23
  PASSWORD_CHANGE_COMPLETE: 'me/password/change/complete',
24
- VERIFICATIONS_ACTIVE: 'me/verifications/active',
25
24
  };
@@ -4,4 +4,6 @@
4
4
  */
5
5
  export declare const VERIFICATION_ROUTES: {
6
6
  readonly RESEND: "resend";
7
+ readonly ACTIVE: "active";
8
+ readonly CANCEL: ":requestId/cancel";
7
9
  };
@@ -7,4 +7,6 @@ exports.VERIFICATION_ROUTES = void 0;
7
7
  */
8
8
  exports.VERIFICATION_ROUTES = {
9
9
  RESEND: 'resend',
10
+ ACTIVE: 'active',
11
+ CANCEL: ':requestId/cancel',
10
12
  };
@@ -0,0 +1,29 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * API Error Response Schema
4
+ *
5
+ * This is the standard error response format returned by the API.
6
+ * All errors follow this structure.
7
+ *
8
+ * @example
9
+ * {
10
+ * "code": "EMAIL_ALREADY_EXISTS",
11
+ * "requestId": "41572f77-891e-4d64-9887-6f31b952e0a1"
12
+ * }
13
+ *
14
+ * @example with details (validation errors)
15
+ * {
16
+ * "code": "VALIDATION_ERROR",
17
+ * "requestId": "41572f77-891e-4d64-9887-6f31b952e0a1",
18
+ * "details": {
19
+ * "email": ["Invalid email format"],
20
+ * "password": ["Password must be at least 8 characters"]
21
+ * }
22
+ * }
23
+ */
24
+ export declare const ApiErrorResponseSchema: z.ZodObject<{
25
+ code: z.ZodString;
26
+ requestId: z.ZodString;
27
+ details: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodString>, z.ZodString]>>;
28
+ }, z.core.$strip>;
29
+ export type ApiErrorResponse = z.infer<typeof ApiErrorResponseSchema>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ApiErrorResponseSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * API Error Response Schema
7
+ *
8
+ * This is the standard error response format returned by the API.
9
+ * All errors follow this structure.
10
+ *
11
+ * @example
12
+ * {
13
+ * "code": "EMAIL_ALREADY_EXISTS",
14
+ * "requestId": "41572f77-891e-4d64-9887-6f31b952e0a1"
15
+ * }
16
+ *
17
+ * @example with details (validation errors)
18
+ * {
19
+ * "code": "VALIDATION_ERROR",
20
+ * "requestId": "41572f77-891e-4d64-9887-6f31b952e0a1",
21
+ * "details": {
22
+ * "email": ["Invalid email format"],
23
+ * "password": ["Password must be at least 8 characters"]
24
+ * }
25
+ * }
26
+ */
27
+ exports.ApiErrorResponseSchema = zod_1.z.object({
28
+ /** Error code for client-side localization and error handling */
29
+ code: zod_1.z.string(),
30
+ /** Unique request identifier for debugging and support */
31
+ requestId: zod_1.z.string().uuid(),
32
+ /** Optional error details (validation errors, additional context) */
33
+ details: zod_1.z.union([zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()), zod_1.z.array(zod_1.z.string()), zod_1.z.string()]).optional(),
34
+ });
@@ -1,5 +1,5 @@
1
1
  export * from './error-metadata';
2
- export * from './error-response.schema';
2
+ export * from './api-error-response.schema';
3
3
  export * from './pagination.schema';
4
4
  export * from './common.errors';
5
5
  export * from './regex';
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./error-metadata"), exports);
18
- __exportStar(require("./error-response.schema"), exports);
18
+ __exportStar(require("./api-error-response.schema"), exports);
19
19
  __exportStar(require("./pagination.schema"), exports);
20
20
  __exportStar(require("./common.errors"), exports);
21
21
  __exportStar(require("./regex"), exports);
@@ -2,4 +2,3 @@ export * from './get-current-user.query';
2
2
  export * from './email-change-status.query';
3
3
  export * from './delete-account-status.query';
4
4
  export * from './password-change-status.query';
5
- export * from './get-active-verifications.query';
@@ -18,4 +18,3 @@ __exportStar(require("./get-current-user.query"), exports);
18
18
  __exportStar(require("./email-change-status.query"), exports);
19
19
  __exportStar(require("./delete-account-status.query"), exports);
20
20
  __exportStar(require("./password-change-status.query"), exports);
21
- __exportStar(require("./get-active-verifications.query"), exports);
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+ import { HttpMethod } from '../../../shared/http-method';
3
+ export declare namespace CancelVerificationCommand {
4
+ const Request: z.ZodObject<{
5
+ requestId: z.ZodString;
6
+ }, z.core.$strip>;
7
+ const Response: z.ZodObject<{
8
+ requestId: z.ZodString;
9
+ cancelled: z.ZodBoolean;
10
+ }, z.core.$strip>;
11
+ const URL: (requestId: string) => string;
12
+ const METHOD = HttpMethod.POST;
13
+ type RequestType = z.infer<typeof Request>;
14
+ type ResponseType = z.infer<typeof Response>;
15
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CancelVerificationCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const http_method_1 = require("../../../shared/http-method");
6
+ const rest_api_1 = require("../../../rest-api");
7
+ var CancelVerificationCommand;
8
+ (function (CancelVerificationCommand) {
9
+ CancelVerificationCommand.Request = zod_1.z.object({
10
+ requestId: zod_1.z.string().uuid(),
11
+ });
12
+ CancelVerificationCommand.Response = zod_1.z.object({
13
+ requestId: zod_1.z.string(),
14
+ cancelled: zod_1.z.boolean(),
15
+ });
16
+ CancelVerificationCommand.URL = rest_api_1.REST_API.V1.VERIFICATION.CANCEL;
17
+ CancelVerificationCommand.METHOD = http_method_1.HttpMethod.POST;
18
+ })(CancelVerificationCommand || (exports.CancelVerificationCommand = CancelVerificationCommand = {}));
@@ -1 +1,2 @@
1
1
  export * from './resend.command';
2
+ export * from './cancel-verification.command';
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./resend.command"), exports);
18
+ __exportStar(require("./cancel-verification.command"), exports);
@@ -1,3 +1,4 @@
1
1
  export * from './verification.errors';
2
2
  export * from './commands';
3
+ export * from './queries';
3
4
  export * from './schemas';
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./verification.errors"), exports);
18
18
  __exportStar(require("./commands"), exports);
19
+ __exportStar(require("./queries"), exports);
19
20
  __exportStar(require("./schemas"), exports);
@@ -1,21 +1,21 @@
1
1
  import { z } from 'zod';
2
2
  import { HttpMethod } from '../../../shared/http-method';
3
- export declare namespace UserGetActiveVerificationsQuery {
3
+ export declare namespace GetActiveVerificationsQuery {
4
4
  const Request: z.ZodObject<{}, z.core.$strip>;
5
5
  const Response: z.ZodObject<{
6
6
  verifications: z.ZodArray<z.ZodObject<{
7
7
  requestId: z.ZodString;
8
- type: z.ZodEnum<typeof import("../..").VerificationType>;
9
- status: z.ZodEnum<typeof import("../..").VerificationRequestStatus>;
8
+ type: z.ZodEnum<typeof import("..").VerificationType>;
9
+ status: z.ZodEnum<typeof import("..").VerificationRequestStatus>;
10
10
  steps: z.ZodArray<z.ZodObject<{
11
11
  stepId: z.ZodString;
12
- channel: z.ZodEnum<typeof import("../..").VerificationChannel>;
12
+ channel: z.ZodEnum<typeof import("..").VerificationChannel>;
13
13
  address: z.ZodString;
14
- status: z.ZodEnum<typeof import("../..").VerificationStepStatus>;
14
+ status: z.ZodEnum<typeof import("..").VerificationStepStatus>;
15
15
  }, z.core.$strip>>;
16
16
  }, z.core.$strip>>;
17
17
  }, z.core.$strip>;
18
- const URL: "/api/v1/users/me/verifications/active";
18
+ const URL: "/api/v1/verification/active";
19
19
  const METHOD = HttpMethod.GET;
20
20
  type RequestType = z.infer<typeof Request>;
21
21
  type ResponseType = z.infer<typeof Response>;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetActiveVerificationsQuery = void 0;
4
+ const zod_1 = require("zod");
5
+ const verification_status_response_schema_1 = require("../schemas/verification-status-response.schema");
6
+ const rest_api_1 = require("../../../rest-api");
7
+ const http_method_1 = require("../../../shared/http-method");
8
+ var GetActiveVerificationsQuery;
9
+ (function (GetActiveVerificationsQuery) {
10
+ GetActiveVerificationsQuery.Request = zod_1.z.object({});
11
+ GetActiveVerificationsQuery.Response = zod_1.z.object({
12
+ verifications: zod_1.z.array(verification_status_response_schema_1.VerificationStatusResponseSchema),
13
+ });
14
+ GetActiveVerificationsQuery.URL = rest_api_1.REST_API.V1.VERIFICATION.ACTIVE;
15
+ GetActiveVerificationsQuery.METHOD = http_method_1.HttpMethod.GET;
16
+ })(GetActiveVerificationsQuery || (exports.GetActiveVerificationsQuery = GetActiveVerificationsQuery = {}));
@@ -0,0 +1 @@
1
+ export * from './get-active-verifications.query';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./get-active-verifications.query"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veruna/api-contracts",
3
- "version": "1.0.32",
3
+ "version": "1.0.34",
4
4
  "description": "API contracts for Veruna project - Zod schemas, types, and paths",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -1,25 +0,0 @@
1
- import { z } from 'zod';
2
- /**
3
- * Base error response schema
4
- */
5
- export declare const ErrorResponseSchema: z.ZodObject<{
6
- statusCode: z.ZodNumber;
7
- message: z.ZodString;
8
- error: z.ZodString;
9
- code: z.ZodOptional<z.ZodString>;
10
- details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
11
- timestamp: z.ZodString;
12
- }, z.core.$strip>;
13
- export type ErrorResponse = z.infer<typeof ErrorResponseSchema>;
14
- /**
15
- * Validation error response schema
16
- */
17
- export declare const ValidationErrorResponseSchema: z.ZodObject<{
18
- statusCode: z.ZodNumber;
19
- message: z.ZodString;
20
- error: z.ZodString;
21
- timestamp: z.ZodString;
22
- code: z.ZodLiteral<"VALIDATION_ERROR">;
23
- details: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
24
- }, z.core.$strip>;
25
- export type ValidationErrorResponse = z.infer<typeof ValidationErrorResponseSchema>;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ValidationErrorResponseSchema = exports.ErrorResponseSchema = void 0;
4
- const zod_1 = require("zod");
5
- /**
6
- * Base error response schema
7
- */
8
- exports.ErrorResponseSchema = zod_1.z.object({
9
- statusCode: zod_1.z.number(),
10
- message: zod_1.z.string(),
11
- error: zod_1.z.string(),
12
- code: zod_1.z.string().optional(),
13
- details: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
14
- timestamp: zod_1.z.string(),
15
- });
16
- /**
17
- * Validation error response schema
18
- */
19
- exports.ValidationErrorResponseSchema = exports.ErrorResponseSchema.extend({
20
- code: zod_1.z.literal('VALIDATION_ERROR'),
21
- details: zod_1.z.record(zod_1.z.string(), zod_1.z.array(zod_1.z.string())),
22
- });
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UserGetActiveVerificationsQuery = void 0;
4
- const zod_1 = require("zod");
5
- const verification_status_response_schema_1 = require("../../verification/schemas/verification-status-response.schema");
6
- const rest_api_1 = require("../../../rest-api");
7
- const http_method_1 = require("../../../shared/http-method");
8
- var UserGetActiveVerificationsQuery;
9
- (function (UserGetActiveVerificationsQuery) {
10
- UserGetActiveVerificationsQuery.Request = zod_1.z.object({});
11
- UserGetActiveVerificationsQuery.Response = zod_1.z.object({
12
- verifications: zod_1.z.array(verification_status_response_schema_1.VerificationStatusResponseSchema),
13
- });
14
- UserGetActiveVerificationsQuery.URL = rest_api_1.REST_API.V1.USERS.VERIFICATIONS_ACTIVE;
15
- UserGetActiveVerificationsQuery.METHOD = http_method_1.HttpMethod.GET;
16
- })(UserGetActiveVerificationsQuery || (exports.UserGetActiveVerificationsQuery = UserGetActiveVerificationsQuery = {}));