@veruna/api-contracts 1.0.3 → 1.0.7
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/index.d.ts +4 -3
- package/build/index.js +4 -3
- package/build/locales/en.d.ts +31 -0
- package/build/locales/en.js +38 -0
- package/build/locales/index.d.ts +66 -0
- package/build/locales/index.js +22 -0
- package/build/locales/ru.d.ts +30 -0
- package/build/locales/ru.js +38 -0
- package/build/rest-api.d.ts +52 -0
- package/build/rest-api.js +67 -0
- package/build/shared/common-schemas.d.ts +12 -0
- package/build/shared/common-schemas.js +15 -0
- package/build/shared/error-response.schema.d.ts +25 -0
- package/build/shared/error-response.schema.js +22 -0
- package/build/shared/index.d.ts +2 -0
- package/build/shared/index.js +18 -0
- package/build/shared/pagination.schema.d.ts +35 -0
- package/build/shared/pagination.schema.js +30 -0
- package/build/shared/regex.d.ts +8 -0
- package/build/shared/regex.js +16 -0
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.js +17 -0
- package/build/utils/path-builder.d.ts +20 -0
- package/build/utils/path-builder.js +46 -0
- package/build/v1/auth/auth.types.d.ts +2 -1
- package/build/v1/auth/auth.types.js +4 -1
- package/build/v1/auth/commands/delete-session.command.d.ts +11 -0
- package/build/v1/auth/commands/delete-session.command.js +18 -0
- package/build/v1/auth/commands/index.d.ts +2 -0
- package/build/v1/auth/commands/index.js +2 -0
- package/build/v1/auth/commands/login.command.d.ts +3 -5
- package/build/v1/auth/commands/login.command.js +10 -7
- package/build/v1/auth/commands/logout-all.command.d.ts +11 -0
- package/build/v1/auth/commands/logout-all.command.js +18 -0
- package/build/v1/auth/commands/logout.command.d.ts +2 -4
- package/build/v1/auth/commands/logout.command.js +9 -5
- package/build/v1/auth/commands/signup.command.d.ts +3 -5
- package/build/v1/auth/commands/signup.command.js +10 -7
- package/build/v1/auth/controllers.d.ts +4 -0
- package/build/v1/auth/controllers.js +7 -0
- package/build/v1/auth/index.d.ts +4 -1
- package/build/v1/auth/index.js +4 -1
- package/build/v1/auth/queries/get-sessions.query.d.ts +20 -0
- package/build/v1/auth/queries/get-sessions.query.js +18 -0
- package/build/v1/auth/queries/index.d.ts +1 -0
- package/build/v1/auth/queries/index.js +17 -0
- package/build/v1/auth/routes/auth.routes.d.ts +12 -0
- package/build/v1/auth/routes/auth.routes.js +15 -0
- package/build/v1/auth/schemas/auth-response.schema.d.ts +36 -0
- package/build/v1/auth/schemas/auth-response.schema.js +20 -0
- package/build/v1/auth/schemas/index.d.ts +5 -0
- package/build/v1/auth/schemas/index.js +21 -0
- package/build/v1/auth/schemas/login-request.schema.d.ts +9 -0
- package/build/v1/auth/schemas/login-request.schema.js +13 -0
- package/build/v1/auth/schemas/session-response.schema.d.ts +13 -0
- package/build/v1/auth/schemas/session-response.schema.js +17 -0
- package/build/v1/auth/schemas/signup-request.schema.d.ts +28 -0
- package/build/v1/auth/schemas/signup-request.schema.js +26 -0
- package/build/v1/auth/schemas/user-role.enum.d.ts +7 -0
- package/build/v1/auth/schemas/user-role.enum.js +11 -0
- package/build/v1/blog/admin/commands/create-category.command.d.ts +24 -0
- package/build/v1/blog/admin/commands/create-category.command.js +15 -0
- package/build/v1/blog/admin/commands/create-post.command.d.ts +43 -0
- package/build/v1/blog/admin/commands/create-post.command.js +15 -0
- package/build/v1/blog/admin/commands/delete-category.command.d.ts +11 -0
- package/build/v1/blog/admin/commands/delete-category.command.js +16 -0
- package/build/v1/blog/admin/commands/delete-post.command.d.ts +11 -0
- package/build/v1/blog/admin/commands/delete-post.command.js +16 -0
- package/build/v1/blog/admin/commands/index.d.ts +6 -0
- package/build/v1/blog/admin/commands/index.js +22 -0
- package/build/v1/blog/admin/commands/update-category.command.d.ts +24 -0
- package/build/v1/blog/admin/commands/update-category.command.js +15 -0
- package/build/v1/blog/admin/commands/update-post.command.d.ts +43 -0
- package/build/v1/blog/admin/commands/update-post.command.js +15 -0
- package/build/v1/blog/admin/queries/get-categories.query.d.ts +24 -0
- package/build/v1/blog/admin/queries/get-categories.query.js +22 -0
- package/build/v1/blog/admin/queries/get-category.query.d.ts +19 -0
- package/build/v1/blog/admin/queries/get-category.query.js +16 -0
- package/build/v1/blog/admin/queries/get-post.query.d.ts +33 -0
- package/build/v1/blog/admin/queries/get-post.query.js +16 -0
- package/build/v1/blog/admin/queries/get-posts.query.d.ts +48 -0
- package/build/v1/blog/admin/queries/get-posts.query.js +21 -0
- package/build/v1/blog/admin/queries/index.d.ts +4 -0
- package/build/v1/blog/admin/queries/index.js +20 -0
- package/build/v1/blog/blog.paths.d.ts +36 -0
- package/build/v1/blog/blog.paths.js +47 -0
- package/build/v1/blog/blog.types.d.ts +12 -0
- package/build/v1/blog/blog.types.js +7 -0
- package/build/v1/blog/controllers.d.ts +7 -0
- package/build/v1/blog/controllers.js +10 -0
- package/build/v1/blog/index.d.ts +8 -0
- package/build/v1/blog/index.js +24 -0
- package/build/v1/blog/public/queries/get-categories.query.d.ts +21 -0
- package/build/v1/blog/public/queries/get-categories.query.js +19 -0
- package/build/v1/blog/public/queries/get-post-by-alias.query.d.ts +33 -0
- package/build/v1/blog/public/queries/get-post-by-alias.query.js +16 -0
- package/build/v1/blog/public/queries/get-posts.query.d.ts +47 -0
- package/build/v1/blog/public/queries/get-posts.query.js +21 -0
- package/build/v1/blog/public/queries/index.d.ts +3 -0
- package/build/v1/blog/public/queries/index.js +19 -0
- package/build/v1/blog/routes/blog-admin-categories.routes.d.ts +11 -0
- package/build/v1/blog/routes/blog-admin-categories.routes.js +14 -0
- package/build/v1/blog/routes/blog-admin-posts.routes.d.ts +10 -0
- package/build/v1/blog/routes/blog-admin-posts.routes.js +13 -0
- package/build/v1/blog/routes/blog-public.routes.d.ts +10 -0
- package/build/v1/blog/routes/blog-public.routes.js +13 -0
- package/build/v1/blog/routes/index.d.ts +3 -0
- package/build/v1/blog/routes/index.js +19 -0
- package/build/v1/blog/schemas/blog-category-status.enum.d.ts +8 -0
- package/build/v1/blog/schemas/blog-category-status.enum.js +12 -0
- package/build/v1/blog/schemas/blog-post-status.enum.d.ts +8 -0
- package/build/v1/blog/schemas/blog-post-status.enum.js +12 -0
- package/build/v1/blog/schemas/category-response.schema.d.ts +14 -0
- package/build/v1/blog/schemas/category-response.schema.js +18 -0
- package/build/v1/blog/schemas/create-category-request.schema.d.ts +8 -0
- package/build/v1/blog/schemas/create-category-request.schema.js +12 -0
- package/build/v1/blog/schemas/create-post-request.schema.d.ts +13 -0
- package/build/v1/blog/schemas/create-post-request.schema.js +17 -0
- package/build/v1/blog/schemas/get-posts-query.schema.d.ts +13 -0
- package/build/v1/blog/schemas/get-posts-query.schema.js +13 -0
- package/build/v1/blog/schemas/index.d.ts +9 -0
- package/build/v1/blog/schemas/index.js +25 -0
- package/build/v1/blog/schemas/post-response.schema.d.ts +28 -0
- package/build/v1/blog/schemas/post-response.schema.js +25 -0
- package/build/v1/blog/schemas/update-category-request.schema.d.ts +8 -0
- package/build/v1/blog/schemas/update-category-request.schema.js +12 -0
- package/build/v1/blog/schemas/update-post-request.schema.d.ts +13 -0
- package/build/v1/blog/schemas/update-post-request.schema.js +17 -0
- package/build/v1/unregistered-users/commands/authenticate.command.d.ts +18 -0
- package/build/v1/unregistered-users/commands/authenticate.command.js +15 -0
- package/build/v1/unregistered-users/commands/index.d.ts +1 -0
- package/build/v1/unregistered-users/commands/index.js +17 -0
- package/build/v1/unregistered-users/controllers.d.ts +4 -0
- package/build/v1/unregistered-users/controllers.js +7 -0
- package/build/v1/unregistered-users/index.d.ts +2 -1
- package/build/v1/unregistered-users/index.js +2 -1
- package/build/v1/unregistered-users/routes/unreg-users.routes.d.ts +6 -0
- package/build/v1/unregistered-users/routes/unreg-users.routes.js +9 -0
- package/build/v1/unregistered-users/schemas/authenticate-request.schema.d.ts +7 -0
- package/build/v1/unregistered-users/schemas/authenticate-request.schema.js +10 -0
- package/build/v1/unregistered-users/schemas/authenticate-response.schema.d.ts +11 -0
- package/build/v1/unregistered-users/schemas/authenticate-response.schema.js +15 -0
- package/build/v1/unregistered-users/schemas/index.d.ts +3 -0
- package/build/v1/unregistered-users/schemas/index.js +19 -0
- package/build/v1/unregistered-users/schemas/unreg-user-status.enum.d.ts +8 -0
- package/build/v1/unregistered-users/schemas/unreg-user-status.enum.js +12 -0
- package/build/v1/unregistered-users/unregistered-users.types.d.ts +3 -1
- package/build/v1/unregistered-users/unregistered-users.types.js +6 -0
- package/build/v1/users/commands/change-password.command.d.ts +2 -4
- package/build/v1/users/commands/change-password.command.js +8 -5
- package/build/v1/users/commands/delete-account.command.d.ts +11 -0
- package/build/v1/users/commands/delete-account.command.js +16 -0
- package/build/v1/users/commands/index.d.ts +2 -0
- package/build/v1/users/commands/index.js +2 -0
- package/build/v1/users/commands/toggle-marketing-consent.command.d.ts +13 -0
- package/build/v1/users/commands/toggle-marketing-consent.command.js +16 -0
- package/build/v1/users/commands/update-profile.command.d.ts +2 -4
- package/build/v1/users/commands/update-profile.command.js +8 -5
- package/build/v1/users/controllers.d.ts +4 -0
- package/build/v1/users/controllers.js +7 -0
- package/build/v1/users/index.d.ts +3 -1
- package/build/v1/users/index.js +3 -1
- package/build/v1/users/queries/get-current-user.query.d.ts +3 -5
- package/build/v1/users/queries/get-current-user.query.js +7 -5
- package/build/v1/users/routes/users.routes.d.ts +9 -0
- package/build/v1/users/routes/users.routes.js +12 -0
- package/build/v1/users/schemas/change-password-request.schema.d.ts +10 -0
- package/build/v1/users/schemas/change-password-request.schema.js +14 -0
- package/build/v1/users/schemas/delete-account-request.schema.d.ts +5 -0
- package/build/v1/users/schemas/delete-account-request.schema.js +8 -0
- package/build/v1/users/schemas/index.d.ts +6 -0
- package/build/v1/users/schemas/index.js +22 -0
- package/build/v1/users/{users.schemas.d.ts → schemas/response-unions.schema.d.ts} +0 -42
- package/build/v1/users/schemas/response-unions.schema.js +14 -0
- package/build/v1/users/schemas/toggle-marketing-consent-request.schema.d.ts +7 -0
- package/build/v1/users/schemas/toggle-marketing-consent-request.schema.js +10 -0
- package/build/v1/users/schemas/update-profile-request.schema.d.ts +8 -0
- package/build/v1/users/schemas/update-profile-request.schema.js +11 -0
- package/build/v1/users/schemas/user-response.schema.d.ts +12 -0
- package/build/v1/users/schemas/user-response.schema.js +16 -0
- package/build/v1/users/users.types.d.ts +2 -4
- package/package.json +1 -1
- package/build/v1/auth/auth.schemas.d.ts +0 -87
- package/build/v1/auth/auth.schemas.js +0 -69
- package/build/v1/unregistered-users/unregistered-users.schemas.d.ts +0 -24
- package/build/v1/unregistered-users/unregistered-users.schemas.js +0 -28
- package/build/v1/users/users.schemas.js +0 -58
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BlogPostStatus } from './blog-post-status.enum';
|
|
3
|
+
export declare const UpdatePostRequestSchema: z.ZodObject<{
|
|
4
|
+
alias: z.ZodOptional<z.ZodString>;
|
|
5
|
+
title: z.ZodOptional<z.ZodString>;
|
|
6
|
+
metaTitle: z.ZodOptional<z.ZodString>;
|
|
7
|
+
metaDescription: z.ZodOptional<z.ZodString>;
|
|
8
|
+
content: z.ZodOptional<z.ZodString>;
|
|
9
|
+
image: z.ZodOptional<z.ZodString>;
|
|
10
|
+
author: z.ZodOptional<z.ZodString>;
|
|
11
|
+
categoryIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
12
|
+
status: z.ZodOptional<z.ZodEnum<typeof BlogPostStatus>>;
|
|
13
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdatePostRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const regex_1 = require("../../../shared/regex");
|
|
6
|
+
const blog_post_status_enum_1 = require("./blog-post-status.enum");
|
|
7
|
+
exports.UpdatePostRequestSchema = zod_1.z.object({
|
|
8
|
+
alias: zod_1.z.string().min(1).max(200).regex(regex_1.SLUG_REGEX).optional(),
|
|
9
|
+
title: zod_1.z.string().min(1).max(300).optional(),
|
|
10
|
+
metaTitle: zod_1.z.string().min(1).max(100).optional(),
|
|
11
|
+
metaDescription: zod_1.z.string().min(1).max(200).optional(),
|
|
12
|
+
content: zod_1.z.string().min(1).optional(),
|
|
13
|
+
image: zod_1.z.string().url().optional(),
|
|
14
|
+
author: zod_1.z.string().min(1).max(100).optional(),
|
|
15
|
+
categoryIds: zod_1.z.array(zod_1.z.string().regex(regex_1.UUID_REGEX)).min(1).optional(),
|
|
16
|
+
status: zod_1.z.nativeEnum(blog_post_status_enum_1.BlogPostStatus).optional(),
|
|
17
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HttpMethod } from '../../../shared/http-method';
|
|
3
|
+
export declare namespace UnregAuthenticateCommand {
|
|
4
|
+
const Request: z.ZodObject<{
|
|
5
|
+
token: z.ZodOptional<z.ZodString>;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
const Response: z.ZodObject<{
|
|
8
|
+
token: z.ZodString;
|
|
9
|
+
requests: z.ZodNumber;
|
|
10
|
+
nextResetAt: z.ZodString;
|
|
11
|
+
status: z.ZodEnum<typeof import("../schemas").UnregUserStatus>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
const PATH: "";
|
|
14
|
+
const URL: "/api/v1/unreg/";
|
|
15
|
+
const METHOD = HttpMethod.PUT;
|
|
16
|
+
type RequestType = z.infer<typeof Request>;
|
|
17
|
+
type ResponseType = z.infer<typeof Response>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UnregAuthenticateCommand = void 0;
|
|
4
|
+
const schemas_1 = require("../schemas");
|
|
5
|
+
const unreg_users_routes_1 = require("../routes/unreg-users.routes");
|
|
6
|
+
const rest_api_1 = require("../../../rest-api");
|
|
7
|
+
const http_method_1 = require("../../../shared/http-method");
|
|
8
|
+
var UnregAuthenticateCommand;
|
|
9
|
+
(function (UnregAuthenticateCommand) {
|
|
10
|
+
UnregAuthenticateCommand.Request = schemas_1.AuthenticateUnregUserRequestSchema;
|
|
11
|
+
UnregAuthenticateCommand.Response = schemas_1.AuthenticateUnregUserResponseSchema;
|
|
12
|
+
UnregAuthenticateCommand.PATH = unreg_users_routes_1.UNREG_USERS_ROUTES.AUTHENTICATE;
|
|
13
|
+
UnregAuthenticateCommand.URL = rest_api_1.REST_API.V1.UNREG.AUTHENTICATE;
|
|
14
|
+
UnregAuthenticateCommand.METHOD = http_method_1.HttpMethod.PUT;
|
|
15
|
+
})(UnregAuthenticateCommand || (exports.UnregAuthenticateCommand = UnregAuthenticateCommand = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './authenticate.command';
|
|
@@ -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("./authenticate.command"), exports);
|
|
@@ -14,7 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./schemas"), exports);
|
|
18
18
|
__exportStar(require("./unregistered-users.types"), exports);
|
|
19
19
|
__exportStar(require("./unregistered-users.paths"), exports);
|
|
20
20
|
__exportStar(require("./unregistered-users.errors"), exports);
|
|
21
|
+
__exportStar(require("./commands"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthenticateUnregUserRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Authenticate Unregistered User Request Schema
|
|
7
|
+
*/
|
|
8
|
+
exports.AuthenticateUnregUserRequestSchema = zod_1.z.object({
|
|
9
|
+
token: zod_1.z.string().optional(),
|
|
10
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { UnregUserStatus } from './unreg-user-status.enum';
|
|
3
|
+
/**
|
|
4
|
+
* Authenticate Unregistered User Response Schema
|
|
5
|
+
*/
|
|
6
|
+
export declare const AuthenticateUnregUserResponseSchema: z.ZodObject<{
|
|
7
|
+
token: z.ZodString;
|
|
8
|
+
requests: z.ZodNumber;
|
|
9
|
+
nextResetAt: z.ZodString;
|
|
10
|
+
status: z.ZodEnum<typeof UnregUserStatus>;
|
|
11
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthenticateUnregUserResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const regex_1 = require("../../../shared/regex");
|
|
6
|
+
const unreg_user_status_enum_1 = require("./unreg-user-status.enum");
|
|
7
|
+
/**
|
|
8
|
+
* Authenticate Unregistered User Response Schema
|
|
9
|
+
*/
|
|
10
|
+
exports.AuthenticateUnregUserResponseSchema = zod_1.z.object({
|
|
11
|
+
token: zod_1.z.string(),
|
|
12
|
+
requests: zod_1.z.number().int().nonnegative(),
|
|
13
|
+
nextResetAt: zod_1.z.string().regex(regex_1.DATETIME_REGEX),
|
|
14
|
+
status: zod_1.z.nativeEnum(unreg_user_status_enum_1.UnregUserStatus),
|
|
15
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
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("./unreg-user-status.enum"), exports);
|
|
18
|
+
__exportStar(require("./authenticate-request.schema"), exports);
|
|
19
|
+
__exportStar(require("./authenticate-response.schema"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UnregUserStatus = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Unregistered User Status
|
|
6
|
+
*/
|
|
7
|
+
var UnregUserStatus;
|
|
8
|
+
(function (UnregUserStatus) {
|
|
9
|
+
UnregUserStatus["ACTIVE"] = "active";
|
|
10
|
+
UnregUserStatus["FRAUD"] = "fraud";
|
|
11
|
+
UnregUserStatus["MIGRATED"] = "migrated";
|
|
12
|
+
})(UnregUserStatus || (exports.UnregUserStatus = UnregUserStatus = {}));
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { AuthenticateUnregUserRequestSchema, AuthenticateUnregUserResponseSchema } from './
|
|
2
|
+
import { AuthenticateUnregUserRequestSchema, AuthenticateUnregUserResponseSchema } from './schemas';
|
|
3
|
+
export { UnregUserStatus } from './schemas/unreg-user-status.enum';
|
|
4
|
+
export { UnregUserStatus as UnregUserStatusContract } from './schemas/unreg-user-status.enum';
|
|
3
5
|
/**
|
|
4
6
|
* Request/Response Types
|
|
5
7
|
*/
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UnregUserStatusContract = exports.UnregUserStatus = void 0;
|
|
4
|
+
var unreg_user_status_enum_1 = require("./schemas/unreg-user-status.enum");
|
|
5
|
+
Object.defineProperty(exports, "UnregUserStatus", { enumerable: true, get: function () { return unreg_user_status_enum_1.UnregUserStatus; } });
|
|
6
|
+
// Backward compatibility
|
|
7
|
+
var unreg_user_status_enum_2 = require("./schemas/unreg-user-status.enum");
|
|
8
|
+
Object.defineProperty(exports, "UnregUserStatusContract", { enumerable: true, get: function () { return unreg_user_status_enum_2.UnregUserStatus; } });
|
|
@@ -6,10 +6,8 @@ export declare namespace UserChangePasswordCommand {
|
|
|
6
6
|
newPassword: z.ZodString;
|
|
7
7
|
logoutFromAllDevices: z.ZodDefault<z.ZodBoolean>;
|
|
8
8
|
}, z.core.$strip>;
|
|
9
|
-
const Response: z.
|
|
10
|
-
|
|
11
|
-
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
12
|
-
}, z.core.$strip>]>;
|
|
9
|
+
const Response: z.ZodObject<{}, z.core.$strip>;
|
|
10
|
+
const PATH: "me/password";
|
|
13
11
|
const URL: "/api/v1/users/me/password";
|
|
14
12
|
const METHOD = HttpMethod.PUT;
|
|
15
13
|
type RequestType = z.infer<typeof Request>;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UserChangePasswordCommand = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const change_password_request_schema_1 = require("../schemas/change-password-request.schema");
|
|
5
|
+
const users_routes_1 = require("../routes/users.routes");
|
|
6
|
+
const rest_api_1 = require("../../../rest-api");
|
|
6
7
|
const http_method_1 = require("../../../shared/http-method");
|
|
8
|
+
const common_schemas_1 = require("../../../shared/common-schemas");
|
|
7
9
|
var UserChangePasswordCommand;
|
|
8
10
|
(function (UserChangePasswordCommand) {
|
|
9
|
-
UserChangePasswordCommand.Request =
|
|
10
|
-
UserChangePasswordCommand.Response =
|
|
11
|
-
UserChangePasswordCommand.
|
|
11
|
+
UserChangePasswordCommand.Request = change_password_request_schema_1.ChangePasswordRequestSchema;
|
|
12
|
+
UserChangePasswordCommand.Response = common_schemas_1.EmptyResponseSchema;
|
|
13
|
+
UserChangePasswordCommand.PATH = users_routes_1.USERS_ROUTES.ME_PASSWORD;
|
|
14
|
+
UserChangePasswordCommand.URL = rest_api_1.REST_API.V1.USERS.ME_PASSWORD;
|
|
12
15
|
UserChangePasswordCommand.METHOD = http_method_1.HttpMethod.PUT;
|
|
13
16
|
})(UserChangePasswordCommand || (exports.UserChangePasswordCommand = UserChangePasswordCommand = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HttpMethod } from '../../../shared/http-method';
|
|
3
|
+
export declare namespace UserDeleteAccountCommand {
|
|
4
|
+
const Request: z.ZodObject<{}, z.core.$strip>;
|
|
5
|
+
const Response: z.ZodObject<{}, z.core.$strip>;
|
|
6
|
+
const PATH: "me";
|
|
7
|
+
const URL: "/api/v1/users/me";
|
|
8
|
+
const METHOD = HttpMethod.DELETE;
|
|
9
|
+
type RequestType = z.infer<typeof Request>;
|
|
10
|
+
type ResponseType = z.infer<typeof Response>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserDeleteAccountCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const users_routes_1 = require("../routes/users.routes");
|
|
6
|
+
const rest_api_1 = require("../../../rest-api");
|
|
7
|
+
const http_method_1 = require("../../../shared/http-method");
|
|
8
|
+
const common_schemas_1 = require("../../../shared/common-schemas");
|
|
9
|
+
var UserDeleteAccountCommand;
|
|
10
|
+
(function (UserDeleteAccountCommand) {
|
|
11
|
+
UserDeleteAccountCommand.Request = zod_1.z.object({});
|
|
12
|
+
UserDeleteAccountCommand.Response = common_schemas_1.EmptyResponseSchema;
|
|
13
|
+
UserDeleteAccountCommand.PATH = users_routes_1.USERS_ROUTES.ME;
|
|
14
|
+
UserDeleteAccountCommand.URL = rest_api_1.REST_API.V1.USERS.ME;
|
|
15
|
+
UserDeleteAccountCommand.METHOD = http_method_1.HttpMethod.DELETE;
|
|
16
|
+
})(UserDeleteAccountCommand || (exports.UserDeleteAccountCommand = UserDeleteAccountCommand = {}));
|
|
@@ -16,3 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./update-profile.command"), exports);
|
|
18
18
|
__exportStar(require("./change-password.command"), exports);
|
|
19
|
+
__exportStar(require("./toggle-marketing-consent.command"), exports);
|
|
20
|
+
__exportStar(require("./delete-account.command"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HttpMethod } from '../../../shared/http-method';
|
|
3
|
+
export declare namespace UserToggleMarketingConsentCommand {
|
|
4
|
+
const Request: z.ZodObject<{
|
|
5
|
+
marketingConsent: z.ZodBoolean;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
const Response: z.ZodObject<{}, z.core.$strip>;
|
|
8
|
+
const PATH: "me/marketing-consent";
|
|
9
|
+
const URL: "/api/v1/users/me/marketing-consent";
|
|
10
|
+
const METHOD = HttpMethod.PUT;
|
|
11
|
+
type RequestType = z.infer<typeof Request>;
|
|
12
|
+
type ResponseType = z.infer<typeof Response>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserToggleMarketingConsentCommand = void 0;
|
|
4
|
+
const toggle_marketing_consent_request_schema_1 = require("../schemas/toggle-marketing-consent-request.schema");
|
|
5
|
+
const users_routes_1 = require("../routes/users.routes");
|
|
6
|
+
const rest_api_1 = require("../../../rest-api");
|
|
7
|
+
const http_method_1 = require("../../../shared/http-method");
|
|
8
|
+
const common_schemas_1 = require("../../../shared/common-schemas");
|
|
9
|
+
var UserToggleMarketingConsentCommand;
|
|
10
|
+
(function (UserToggleMarketingConsentCommand) {
|
|
11
|
+
UserToggleMarketingConsentCommand.Request = toggle_marketing_consent_request_schema_1.ToggleMarketingConsentRequestSchema;
|
|
12
|
+
UserToggleMarketingConsentCommand.Response = common_schemas_1.EmptyResponseSchema;
|
|
13
|
+
UserToggleMarketingConsentCommand.PATH = users_routes_1.USERS_ROUTES.ME_MARKETING_CONSENT;
|
|
14
|
+
UserToggleMarketingConsentCommand.URL = rest_api_1.REST_API.V1.USERS.ME_MARKETING_CONSENT;
|
|
15
|
+
UserToggleMarketingConsentCommand.METHOD = http_method_1.HttpMethod.PUT;
|
|
16
|
+
})(UserToggleMarketingConsentCommand || (exports.UserToggleMarketingConsentCommand = UserToggleMarketingConsentCommand = {}));
|
|
@@ -4,10 +4,8 @@ export declare namespace UserUpdateProfileCommand {
|
|
|
4
4
|
const Request: z.ZodObject<{
|
|
5
5
|
name: z.ZodString;
|
|
6
6
|
}, z.core.$strip>;
|
|
7
|
-
const Response: z.
|
|
8
|
-
|
|
9
|
-
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
10
|
-
}, z.core.$strip>]>;
|
|
7
|
+
const Response: z.ZodObject<{}, z.core.$strip>;
|
|
8
|
+
const PATH: "me";
|
|
11
9
|
const URL: "/api/v1/users/me";
|
|
12
10
|
const METHOD = HttpMethod.PATCH;
|
|
13
11
|
type RequestType = z.infer<typeof Request>;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UserUpdateProfileCommand = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const update_profile_request_schema_1 = require("../schemas/update-profile-request.schema");
|
|
5
|
+
const users_routes_1 = require("../routes/users.routes");
|
|
6
|
+
const rest_api_1 = require("../../../rest-api");
|
|
6
7
|
const http_method_1 = require("../../../shared/http-method");
|
|
8
|
+
const common_schemas_1 = require("../../../shared/common-schemas");
|
|
7
9
|
var UserUpdateProfileCommand;
|
|
8
10
|
(function (UserUpdateProfileCommand) {
|
|
9
|
-
UserUpdateProfileCommand.Request =
|
|
10
|
-
UserUpdateProfileCommand.Response =
|
|
11
|
-
UserUpdateProfileCommand.
|
|
11
|
+
UserUpdateProfileCommand.Request = update_profile_request_schema_1.UpdateProfileRequestSchema;
|
|
12
|
+
UserUpdateProfileCommand.Response = common_schemas_1.EmptyResponseSchema;
|
|
13
|
+
UserUpdateProfileCommand.PATH = users_routes_1.USERS_ROUTES.ME;
|
|
14
|
+
UserUpdateProfileCommand.URL = rest_api_1.REST_API.V1.USERS.ME;
|
|
12
15
|
UserUpdateProfileCommand.METHOD = http_method_1.HttpMethod.PATCH;
|
|
13
16
|
})(UserUpdateProfileCommand || (exports.UserUpdateProfileCommand = UserUpdateProfileCommand = {}));
|
package/build/v1/users/index.js
CHANGED
|
@@ -14,8 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./schemas"), exports);
|
|
18
18
|
__exportStar(require("./users.types"), exports);
|
|
19
19
|
__exportStar(require("./users.paths"), exports);
|
|
20
|
+
__exportStar(require("./controllers"), exports);
|
|
21
|
+
__exportStar(require("./routes/users.routes"), exports);
|
|
20
22
|
__exportStar(require("./commands"), exports);
|
|
21
23
|
__exportStar(require("./queries"), exports);
|
|
@@ -2,17 +2,15 @@ import { z } from 'zod';
|
|
|
2
2
|
import { HttpMethod } from '../../../shared/http-method';
|
|
3
3
|
export declare namespace UserGetCurrentUserQuery {
|
|
4
4
|
const Request: z.ZodObject<{}, z.core.$strip>;
|
|
5
|
-
const Response: z.
|
|
5
|
+
const Response: z.ZodObject<{
|
|
6
6
|
uuid: z.ZodString;
|
|
7
7
|
email: z.ZodString;
|
|
8
8
|
name: z.ZodString;
|
|
9
9
|
role: z.ZodString;
|
|
10
10
|
marketingConsent: z.ZodBoolean;
|
|
11
11
|
createdAt: z.ZodString;
|
|
12
|
-
}, z.core.$strip
|
|
13
|
-
|
|
14
|
-
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
15
|
-
}, z.core.$strip>]>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
const PATH: "me";
|
|
16
14
|
const URL: "/api/v1/users/me";
|
|
17
15
|
const METHOD = HttpMethod.GET;
|
|
18
16
|
type RequestType = z.infer<typeof Request>;
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UserGetCurrentUserQuery = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const user_response_schema_1 = require("../schemas/user-response.schema");
|
|
6
|
+
const users_routes_1 = require("../routes/users.routes");
|
|
7
|
+
const rest_api_1 = require("../../../rest-api");
|
|
7
8
|
const http_method_1 = require("../../../shared/http-method");
|
|
8
9
|
var UserGetCurrentUserQuery;
|
|
9
10
|
(function (UserGetCurrentUserQuery) {
|
|
10
|
-
UserGetCurrentUserQuery.Request = zod_1.z.object({});
|
|
11
|
-
UserGetCurrentUserQuery.Response =
|
|
12
|
-
UserGetCurrentUserQuery.
|
|
11
|
+
UserGetCurrentUserQuery.Request = zod_1.z.object({});
|
|
12
|
+
UserGetCurrentUserQuery.Response = user_response_schema_1.UserResponseSchema;
|
|
13
|
+
UserGetCurrentUserQuery.PATH = users_routes_1.USERS_ROUTES.ME;
|
|
14
|
+
UserGetCurrentUserQuery.URL = rest_api_1.REST_API.V1.USERS.ME;
|
|
13
15
|
UserGetCurrentUserQuery.METHOD = http_method_1.HttpMethod.GET;
|
|
14
16
|
})(UserGetCurrentUserQuery || (exports.UserGetCurrentUserQuery = UserGetCurrentUserQuery = {}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.USERS_ROUTES = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Users Routes
|
|
6
|
+
* For NestJS method decorators
|
|
7
|
+
*/
|
|
8
|
+
exports.USERS_ROUTES = {
|
|
9
|
+
ME: 'me',
|
|
10
|
+
ME_MARKETING_CONSENT: 'me/marketing-consent',
|
|
11
|
+
ME_PASSWORD: 'me/password',
|
|
12
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Change Password Request Schema
|
|
4
|
+
* Error messages are in locales (en.ts, ru.ts)
|
|
5
|
+
*/
|
|
6
|
+
export declare const ChangePasswordRequestSchema: z.ZodObject<{
|
|
7
|
+
oldPassword: z.ZodString;
|
|
8
|
+
newPassword: z.ZodString;
|
|
9
|
+
logoutFromAllDevices: z.ZodDefault<z.ZodBoolean>;
|
|
10
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChangePasswordRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const regex_1 = require("../../../shared/regex");
|
|
6
|
+
/**
|
|
7
|
+
* Change Password Request Schema
|
|
8
|
+
* Error messages are in locales (en.ts, ru.ts)
|
|
9
|
+
*/
|
|
10
|
+
exports.ChangePasswordRequestSchema = zod_1.z.object({
|
|
11
|
+
oldPassword: zod_1.z.string().min(1),
|
|
12
|
+
newPassword: zod_1.z.string().min(8).max(128).regex(regex_1.PASSWORD_STRENGTH_REGEX),
|
|
13
|
+
logoutFromAllDevices: zod_1.z.boolean().default(false),
|
|
14
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteAccountRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Delete Account Request Schema (empty - no body)
|
|
7
|
+
*/
|
|
8
|
+
exports.DeleteAccountRequestSchema = zod_1.z.object({});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './user-response.schema';
|
|
2
|
+
export * from './update-profile-request.schema';
|
|
3
|
+
export * from './change-password-request.schema';
|
|
4
|
+
export * from './toggle-marketing-consent-request.schema';
|
|
5
|
+
export * from './delete-account-request.schema';
|
|
6
|
+
export * from './response-unions.schema';
|
|
@@ -0,0 +1,22 @@
|
|
|
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("./user-response.schema"), exports);
|
|
18
|
+
__exportStar(require("./update-profile-request.schema"), exports);
|
|
19
|
+
__exportStar(require("./change-password-request.schema"), exports);
|
|
20
|
+
__exportStar(require("./toggle-marketing-consent-request.schema"), exports);
|
|
21
|
+
__exportStar(require("./delete-account-request.schema"), exports);
|
|
22
|
+
__exportStar(require("./response-unions.schema"), exports);
|