@veruna/api-contracts 1.0.29 → 1.0.31
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.
- package/build/controllers/index.d.ts +3 -2
- package/build/controllers/index.js +3 -1
- package/build/controllers/verification.controllers.d.ts +5 -0
- package/build/controllers/verification.controllers.js +8 -0
- package/build/rest-api.d.ts +21 -0
- package/build/rest-api.js +21 -0
- package/build/routes/index.d.ts +1 -0
- package/build/routes/index.js +3 -1
- package/build/routes/users.routes.d.ts +12 -0
- package/build/routes/users.routes.js +12 -0
- package/build/routes/verification.routes.d.ts +7 -0
- package/build/routes/verification.routes.js +10 -0
- package/build/v1/chat/commands/create-unreg-chat.command.d.ts +11 -0
- package/build/v1/chat/queries/get-unreg-chat.query.d.ts +11 -0
- package/build/v1/chat/schemas/chat-with-messages-response.schema.d.ts +11 -0
- package/build/v1/index.d.ts +1 -0
- package/build/v1/index.js +1 -0
- package/build/v1/message/schemas/index.d.ts +1 -0
- package/build/v1/message/schemas/index.js +5 -1
- package/build/v1/message/schemas/message-meta.schema.d.ts +36 -0
- package/build/v1/message/schemas/message-meta.schema.js +29 -0
- package/build/v1/message/schemas/message-response.schema.d.ts +11 -0
- package/build/v1/message/schemas/message-response.schema.js +2 -0
- package/build/v1/notifications/schemas/email-template.enum.d.ts +1 -0
- package/build/v1/notifications/schemas/email-template.enum.js +1 -0
- package/build/v1/users/commands/delete-account-complete.command.d.ts +15 -0
- package/build/v1/users/commands/delete-account-complete.command.js +13 -0
- package/build/v1/users/commands/delete-account-start.command.d.ts +22 -0
- package/build/v1/users/commands/delete-account-start.command.js +14 -0
- package/build/v1/users/commands/delete-account-verify.command.d.ts +19 -0
- package/build/v1/users/commands/delete-account-verify.command.js +13 -0
- package/build/v1/users/commands/email-change-complete.command.d.ts +15 -0
- package/build/v1/users/commands/email-change-complete.command.js +13 -0
- package/build/v1/users/commands/email-change-start.command.d.ts +22 -0
- package/build/v1/users/commands/email-change-start.command.js +14 -0
- package/build/v1/users/commands/email-change-verify.command.d.ts +19 -0
- package/build/v1/users/commands/email-change-verify.command.js +13 -0
- package/build/v1/users/commands/index.d.ts +9 -0
- package/build/v1/users/commands/index.js +9 -0
- package/build/v1/users/commands/password-change-complete.command.d.ts +17 -0
- package/build/v1/users/commands/password-change-complete.command.js +14 -0
- package/build/v1/users/commands/password-change-start.command.d.ts +22 -0
- package/build/v1/users/commands/password-change-start.command.js +14 -0
- package/build/v1/users/commands/password-change-verify.command.d.ts +19 -0
- package/build/v1/users/commands/password-change-verify.command.js +13 -0
- package/build/v1/users/queries/delete-account-status.query.d.ts +22 -0
- package/build/v1/users/queries/delete-account-status.query.js +16 -0
- package/build/v1/users/queries/email-change-status.query.d.ts +22 -0
- package/build/v1/users/queries/email-change-status.query.js +16 -0
- package/build/v1/users/queries/index.d.ts +3 -0
- package/build/v1/users/queries/index.js +3 -0
- package/build/v1/users/queries/password-change-status.query.d.ts +22 -0
- package/build/v1/users/queries/password-change-status.query.js +16 -0
- package/build/v1/users/schemas/delete-account-start-request.schema.d.ts +4 -0
- package/build/v1/users/schemas/delete-account-start-request.schema.js +7 -0
- package/build/v1/users/schemas/email-change-start-request.schema.d.ts +4 -0
- package/build/v1/users/schemas/email-change-start-request.schema.js +7 -0
- package/build/v1/users/schemas/index.d.ts +4 -0
- package/build/v1/users/schemas/index.js +4 -0
- package/build/v1/users/schemas/password-change-complete-request.schema.d.ts +6 -0
- package/build/v1/users/schemas/password-change-complete-request.schema.js +10 -0
- package/build/v1/users/schemas/password-change-start-request.schema.d.ts +4 -0
- package/build/v1/users/schemas/password-change-start-request.schema.js +7 -0
- package/build/v1/users/users.errors.d.ts +2 -0
- package/build/v1/users/users.errors.js +10 -0
- package/build/v1/verification/commands/index.d.ts +1 -0
- package/build/v1/verification/commands/index.js +17 -0
- package/build/v1/verification/commands/resend.command.d.ts +17 -0
- package/build/v1/verification/commands/resend.command.js +13 -0
- package/build/v1/verification/index.d.ts +3 -0
- package/build/v1/verification/index.js +19 -0
- package/build/v1/verification/schemas/index.d.ts +13 -0
- package/build/v1/verification/schemas/index.js +29 -0
- package/build/v1/verification/schemas/verification-channel.enum.d.ts +3 -0
- package/build/v1/verification/schemas/verification-channel.enum.js +7 -0
- package/build/v1/verification/schemas/verification-complete-request.schema.d.ts +4 -0
- package/build/v1/verification/schemas/verification-complete-request.schema.js +7 -0
- package/build/v1/verification/schemas/verification-complete-response.schema.d.ts +6 -0
- package/build/v1/verification/schemas/verification-complete-response.schema.js +9 -0
- package/build/v1/verification/schemas/verification-request-status.enum.d.ts +7 -0
- package/build/v1/verification/schemas/verification-request-status.enum.js +11 -0
- package/build/v1/verification/schemas/verification-resend-request.schema.d.ts +5 -0
- package/build/v1/verification/schemas/verification-resend-request.schema.js +8 -0
- package/build/v1/verification/schemas/verification-resend-response.schema.d.ts +7 -0
- package/build/v1/verification/schemas/verification-resend-response.schema.js +10 -0
- package/build/v1/verification/schemas/verification-start-response.schema.d.ts +14 -0
- package/build/v1/verification/schemas/verification-start-response.schema.js +13 -0
- package/build/v1/verification/schemas/verification-status-response.schema.d.ts +14 -0
- package/build/v1/verification/schemas/verification-status-response.schema.js +13 -0
- package/build/v1/verification/schemas/verification-step-status.enum.d.ts +6 -0
- package/build/v1/verification/schemas/verification-step-status.enum.js +10 -0
- package/build/v1/verification/schemas/verification-step.schema.d.ts +9 -0
- package/build/v1/verification/schemas/verification-step.schema.js +12 -0
- package/build/v1/verification/schemas/verification-type.enum.d.ts +5 -0
- package/build/v1/verification/schemas/verification-type.enum.js +9 -0
- package/build/v1/verification/schemas/verification-verify-request.schema.d.ts +6 -0
- package/build/v1/verification/schemas/verification-verify-request.schema.js +9 -0
- package/build/v1/verification/schemas/verification-verify-response.schema.d.ts +9 -0
- package/build/v1/verification/schemas/verification-verify-response.schema.js +12 -0
- package/build/v1/verification/verification.errors.d.ts +14 -0
- package/build/v1/verification/verification.errors.js +58 -0
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VerificationResendResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const verification_step_status_enum_1 = require("./verification-step-status.enum");
|
|
6
|
+
exports.VerificationResendResponseSchema = zod_1.z.object({
|
|
7
|
+
requestId: zod_1.z.string(),
|
|
8
|
+
stepId: zod_1.z.string(),
|
|
9
|
+
status: zod_1.z.enum(verification_step_status_enum_1.VerificationStepStatus),
|
|
10
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { VerificationType } from './verification-type.enum';
|
|
3
|
+
import { VerificationRequestStatus } from './verification-request-status.enum';
|
|
4
|
+
export declare const VerificationStartResponseSchema: z.ZodObject<{
|
|
5
|
+
requestId: z.ZodString;
|
|
6
|
+
type: z.ZodEnum<typeof VerificationType>;
|
|
7
|
+
status: z.ZodEnum<typeof VerificationRequestStatus>;
|
|
8
|
+
steps: z.ZodArray<z.ZodObject<{
|
|
9
|
+
stepId: z.ZodString;
|
|
10
|
+
channel: z.ZodEnum<typeof import("./verification-channel.enum").VerificationChannel>;
|
|
11
|
+
address: z.ZodString;
|
|
12
|
+
status: z.ZodEnum<typeof import("./verification-step-status.enum").VerificationStepStatus>;
|
|
13
|
+
}, z.core.$strip>>;
|
|
14
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VerificationStartResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const verification_type_enum_1 = require("./verification-type.enum");
|
|
6
|
+
const verification_request_status_enum_1 = require("./verification-request-status.enum");
|
|
7
|
+
const verification_step_schema_1 = require("./verification-step.schema");
|
|
8
|
+
exports.VerificationStartResponseSchema = zod_1.z.object({
|
|
9
|
+
requestId: zod_1.z.string(),
|
|
10
|
+
type: zod_1.z.enum(verification_type_enum_1.VerificationType),
|
|
11
|
+
status: zod_1.z.enum(verification_request_status_enum_1.VerificationRequestStatus),
|
|
12
|
+
steps: zod_1.z.array(verification_step_schema_1.VerificationStepSchema),
|
|
13
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { VerificationType } from './verification-type.enum';
|
|
3
|
+
import { VerificationRequestStatus } from './verification-request-status.enum';
|
|
4
|
+
export declare const VerificationStatusResponseSchema: z.ZodObject<{
|
|
5
|
+
requestId: z.ZodString;
|
|
6
|
+
type: z.ZodEnum<typeof VerificationType>;
|
|
7
|
+
status: z.ZodEnum<typeof VerificationRequestStatus>;
|
|
8
|
+
steps: z.ZodArray<z.ZodObject<{
|
|
9
|
+
stepId: z.ZodString;
|
|
10
|
+
channel: z.ZodEnum<typeof import("./verification-channel.enum").VerificationChannel>;
|
|
11
|
+
address: z.ZodString;
|
|
12
|
+
status: z.ZodEnum<typeof import("./verification-step-status.enum").VerificationStepStatus>;
|
|
13
|
+
}, z.core.$strip>>;
|
|
14
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VerificationStatusResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const verification_type_enum_1 = require("./verification-type.enum");
|
|
6
|
+
const verification_request_status_enum_1 = require("./verification-request-status.enum");
|
|
7
|
+
const verification_step_schema_1 = require("./verification-step.schema");
|
|
8
|
+
exports.VerificationStatusResponseSchema = zod_1.z.object({
|
|
9
|
+
requestId: zod_1.z.string(),
|
|
10
|
+
type: zod_1.z.enum(verification_type_enum_1.VerificationType),
|
|
11
|
+
status: zod_1.z.enum(verification_request_status_enum_1.VerificationRequestStatus),
|
|
12
|
+
steps: zod_1.z.array(verification_step_schema_1.VerificationStepSchema),
|
|
13
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VerificationStepStatus = void 0;
|
|
4
|
+
var VerificationStepStatus;
|
|
5
|
+
(function (VerificationStepStatus) {
|
|
6
|
+
VerificationStepStatus["PENDING"] = "PENDING";
|
|
7
|
+
VerificationStepStatus["VERIFIED"] = "VERIFIED";
|
|
8
|
+
VerificationStepStatus["EXPIRED"] = "EXPIRED";
|
|
9
|
+
VerificationStepStatus["CANCELLED"] = "CANCELLED";
|
|
10
|
+
})(VerificationStepStatus || (exports.VerificationStepStatus = VerificationStepStatus = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { VerificationChannel } from './verification-channel.enum';
|
|
3
|
+
import { VerificationStepStatus } from './verification-step-status.enum';
|
|
4
|
+
export declare const VerificationStepSchema: z.ZodObject<{
|
|
5
|
+
stepId: z.ZodString;
|
|
6
|
+
channel: z.ZodEnum<typeof VerificationChannel>;
|
|
7
|
+
address: z.ZodString;
|
|
8
|
+
status: z.ZodEnum<typeof VerificationStepStatus>;
|
|
9
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VerificationStepSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const verification_channel_enum_1 = require("./verification-channel.enum");
|
|
6
|
+
const verification_step_status_enum_1 = require("./verification-step-status.enum");
|
|
7
|
+
exports.VerificationStepSchema = zod_1.z.object({
|
|
8
|
+
stepId: zod_1.z.string(),
|
|
9
|
+
channel: zod_1.z.enum(verification_channel_enum_1.VerificationChannel),
|
|
10
|
+
address: zod_1.z.string().email(),
|
|
11
|
+
status: zod_1.z.enum(verification_step_status_enum_1.VerificationStepStatus),
|
|
12
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VerificationType = void 0;
|
|
4
|
+
var VerificationType;
|
|
5
|
+
(function (VerificationType) {
|
|
6
|
+
VerificationType["CHANGE_EMAIL"] = "CHANGE_EMAIL";
|
|
7
|
+
VerificationType["DELETE_ACCOUNT"] = "DELETE_ACCOUNT";
|
|
8
|
+
VerificationType["CHANGE_PASSWORD"] = "CHANGE_PASSWORD";
|
|
9
|
+
})(VerificationType || (exports.VerificationType = VerificationType = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VerificationVerifyRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.VerificationVerifyRequestSchema = zod_1.z.object({
|
|
6
|
+
requestId: zod_1.z.string().uuid(),
|
|
7
|
+
stepId: zod_1.z.string().uuid(),
|
|
8
|
+
code: zod_1.z.string().regex(/^[0-9]{6}$/, 'Code must be exactly 6 digits'),
|
|
9
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { VerificationStepStatus } from './verification-step-status.enum';
|
|
3
|
+
import { VerificationRequestStatus } from './verification-request-status.enum';
|
|
4
|
+
export declare const VerificationVerifyResponseSchema: z.ZodObject<{
|
|
5
|
+
requestId: z.ZodString;
|
|
6
|
+
stepId: z.ZodString;
|
|
7
|
+
stepStatus: z.ZodEnum<typeof VerificationStepStatus>;
|
|
8
|
+
requestStatus: z.ZodEnum<typeof VerificationRequestStatus>;
|
|
9
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VerificationVerifyResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const verification_step_status_enum_1 = require("./verification-step-status.enum");
|
|
6
|
+
const verification_request_status_enum_1 = require("./verification-request-status.enum");
|
|
7
|
+
exports.VerificationVerifyResponseSchema = zod_1.z.object({
|
|
8
|
+
requestId: zod_1.z.string(),
|
|
9
|
+
stepId: zod_1.z.string(),
|
|
10
|
+
stepStatus: zod_1.z.enum(verification_step_status_enum_1.VerificationStepStatus),
|
|
11
|
+
requestStatus: zod_1.z.enum(verification_request_status_enum_1.VerificationRequestStatus),
|
|
12
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ErrorMetadata } from '../../shared';
|
|
2
|
+
export declare enum VerificationErrorCode {
|
|
3
|
+
CODE_INVALID = "CODE_INVALID",
|
|
4
|
+
CODE_ATTEMPTS_EXCEEDED = "CODE_ATTEMPTS_EXCEEDED",
|
|
5
|
+
RESEND_LIMIT_EXCEEDED = "RESEND_LIMIT_EXCEEDED",
|
|
6
|
+
STEP_EXPIRED = "STEP_EXPIRED",
|
|
7
|
+
REQUEST_EXPIRED = "REQUEST_EXPIRED",
|
|
8
|
+
REQUEST_COMPLETED = "REQUEST_COMPLETED",
|
|
9
|
+
STEP_NOT_READY = "STEP_NOT_READY",
|
|
10
|
+
INVALID_PAYLOAD = "INVALID_PAYLOAD",
|
|
11
|
+
RATE_LIMITED = "RATE_LIMITED",
|
|
12
|
+
INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR"
|
|
13
|
+
}
|
|
14
|
+
export declare const VERIFICATION_ERRORS: Record<VerificationErrorCode, ErrorMetadata>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VERIFICATION_ERRORS = exports.VerificationErrorCode = void 0;
|
|
4
|
+
var VerificationErrorCode;
|
|
5
|
+
(function (VerificationErrorCode) {
|
|
6
|
+
VerificationErrorCode["CODE_INVALID"] = "CODE_INVALID";
|
|
7
|
+
VerificationErrorCode["CODE_ATTEMPTS_EXCEEDED"] = "CODE_ATTEMPTS_EXCEEDED";
|
|
8
|
+
VerificationErrorCode["RESEND_LIMIT_EXCEEDED"] = "RESEND_LIMIT_EXCEEDED";
|
|
9
|
+
VerificationErrorCode["STEP_EXPIRED"] = "STEP_EXPIRED";
|
|
10
|
+
VerificationErrorCode["REQUEST_EXPIRED"] = "REQUEST_EXPIRED";
|
|
11
|
+
VerificationErrorCode["REQUEST_COMPLETED"] = "REQUEST_COMPLETED";
|
|
12
|
+
VerificationErrorCode["STEP_NOT_READY"] = "STEP_NOT_READY";
|
|
13
|
+
VerificationErrorCode["INVALID_PAYLOAD"] = "INVALID_PAYLOAD";
|
|
14
|
+
VerificationErrorCode["RATE_LIMITED"] = "RATE_LIMITED";
|
|
15
|
+
VerificationErrorCode["INTERNAL_SERVER_ERROR"] = "INTERNAL_SERVER_ERROR";
|
|
16
|
+
})(VerificationErrorCode || (exports.VerificationErrorCode = VerificationErrorCode = {}));
|
|
17
|
+
exports.VERIFICATION_ERRORS = {
|
|
18
|
+
[VerificationErrorCode.CODE_INVALID]: {
|
|
19
|
+
code: VerificationErrorCode.CODE_INVALID,
|
|
20
|
+
statusCode: 400,
|
|
21
|
+
},
|
|
22
|
+
[VerificationErrorCode.CODE_ATTEMPTS_EXCEEDED]: {
|
|
23
|
+
code: VerificationErrorCode.CODE_ATTEMPTS_EXCEEDED,
|
|
24
|
+
statusCode: 429,
|
|
25
|
+
},
|
|
26
|
+
[VerificationErrorCode.RESEND_LIMIT_EXCEEDED]: {
|
|
27
|
+
code: VerificationErrorCode.RESEND_LIMIT_EXCEEDED,
|
|
28
|
+
statusCode: 429,
|
|
29
|
+
},
|
|
30
|
+
[VerificationErrorCode.STEP_EXPIRED]: {
|
|
31
|
+
code: VerificationErrorCode.STEP_EXPIRED,
|
|
32
|
+
statusCode: 410,
|
|
33
|
+
},
|
|
34
|
+
[VerificationErrorCode.REQUEST_EXPIRED]: {
|
|
35
|
+
code: VerificationErrorCode.REQUEST_EXPIRED,
|
|
36
|
+
statusCode: 410,
|
|
37
|
+
},
|
|
38
|
+
[VerificationErrorCode.REQUEST_COMPLETED]: {
|
|
39
|
+
code: VerificationErrorCode.REQUEST_COMPLETED,
|
|
40
|
+
statusCode: 400,
|
|
41
|
+
},
|
|
42
|
+
[VerificationErrorCode.STEP_NOT_READY]: {
|
|
43
|
+
code: VerificationErrorCode.STEP_NOT_READY,
|
|
44
|
+
statusCode: 400,
|
|
45
|
+
},
|
|
46
|
+
[VerificationErrorCode.INVALID_PAYLOAD]: {
|
|
47
|
+
code: VerificationErrorCode.INVALID_PAYLOAD,
|
|
48
|
+
statusCode: 400,
|
|
49
|
+
},
|
|
50
|
+
[VerificationErrorCode.RATE_LIMITED]: {
|
|
51
|
+
code: VerificationErrorCode.RATE_LIMITED,
|
|
52
|
+
statusCode: 429,
|
|
53
|
+
},
|
|
54
|
+
[VerificationErrorCode.INTERNAL_SERVER_ERROR]: {
|
|
55
|
+
code: VerificationErrorCode.INTERNAL_SERVER_ERROR,
|
|
56
|
+
statusCode: 500,
|
|
57
|
+
},
|
|
58
|
+
};
|