@veruna/api-contracts 1.0.3 → 1.0.4
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 +3 -0
- package/build/index.js +3 -0
- 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 +49 -0
- package/build/rest-api.js +61 -0
- package/build/shared/common-schemas.d.ts +12 -0
- package/build/shared/common-schemas.js +15 -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/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 +13 -0
- package/build/v1/auth/commands/delete-session.command.js +14 -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.js +5 -4
- package/build/v1/auth/commands/logout-all.command.d.ts +13 -0
- package/build/v1/auth/commands/logout-all.command.js +14 -0
- package/build/v1/auth/commands/logout.command.js +2 -2
- package/build/v1/auth/commands/signup.command.js +5 -4
- package/build/v1/auth/controllers.d.ts +4 -0
- package/build/v1/auth/controllers.js +7 -0
- package/build/v1/auth/index.d.ts +2 -1
- package/build/v1/auth/index.js +2 -1
- package/build/v1/auth/queries/get-sessions.query.d.ts +22 -0
- package/build/v1/auth/queries/get-sessions.query.js +15 -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 +27 -0
- package/build/v1/blog/admin/commands/create-category.command.js +19 -0
- package/build/v1/blog/admin/commands/create-post.command.d.ts +46 -0
- package/build/v1/blog/admin/commands/create-post.command.js +19 -0
- package/build/v1/blog/admin/commands/delete-category.command.d.ts +14 -0
- package/build/v1/blog/admin/commands/delete-category.command.js +18 -0
- package/build/v1/blog/admin/commands/delete-post.command.d.ts +14 -0
- package/build/v1/blog/admin/commands/delete-post.command.js +18 -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 +27 -0
- package/build/v1/blog/admin/commands/update-category.command.js +19 -0
- package/build/v1/blog/admin/commands/update-post.command.d.ts +46 -0
- package/build/v1/blog/admin/commands/update-post.command.js +19 -0
- package/build/v1/blog/admin/queries/get-categories.query.d.ts +27 -0
- package/build/v1/blog/admin/queries/get-categories.query.js +25 -0
- package/build/v1/blog/admin/queries/get-category.query.d.ts +22 -0
- package/build/v1/blog/admin/queries/get-category.query.js +19 -0
- package/build/v1/blog/admin/queries/get-post.query.d.ts +36 -0
- package/build/v1/blog/admin/queries/get-post.query.js +19 -0
- package/build/v1/blog/admin/queries/get-posts.query.d.ts +84 -0
- package/build/v1/blog/admin/queries/get-posts.query.js +24 -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 +6 -0
- package/build/v1/blog/index.js +22 -0
- package/build/v1/blog/public/queries/get-categories.query.d.ts +24 -0
- package/build/v1/blog/public/queries/get-categories.query.js +22 -0
- package/build/v1/blog/public/queries/get-post-by-alias.query.d.ts +36 -0
- package/build/v1/blog/public/queries/get-post-by-alias.query.js +19 -0
- package/build/v1/blog/public/queries/get-posts.query.d.ts +83 -0
- package/build/v1/blog/public/queries/get-posts.query.js +24 -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 +20 -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/index.d.ts +2 -1
- package/build/v1/unregistered-users/index.js +2 -1
- 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.js +3 -3
- package/build/v1/users/commands/delete-account.command.d.ts +13 -0
- package/build/v1/users/commands/delete-account.command.js +13 -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 +15 -0
- package/build/v1/users/commands/toggle-marketing-consent.command.js +13 -0
- package/build/v1/users/commands/update-profile.command.js +3 -3
- package/build/v1/users/controllers.d.ts +4 -0
- package/build/v1/users/controllers.js +7 -0
- package/build/v1/users/index.d.ts +1 -1
- package/build/v1/users/index.js +1 -1
- package/build/v1/users/queries/get-current-user.query.js +2 -2
- 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,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; } });
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UserChangePasswordCommand = void 0;
|
|
4
|
-
const
|
|
4
|
+
const schemas_1 = require("../schemas");
|
|
5
5
|
const users_paths_1 = require("../users.paths");
|
|
6
6
|
const http_method_1 = require("../../../shared/http-method");
|
|
7
7
|
var UserChangePasswordCommand;
|
|
8
8
|
(function (UserChangePasswordCommand) {
|
|
9
|
-
UserChangePasswordCommand.Request =
|
|
10
|
-
UserChangePasswordCommand.Response =
|
|
9
|
+
UserChangePasswordCommand.Request = schemas_1.ChangePasswordRequestSchema;
|
|
10
|
+
UserChangePasswordCommand.Response = schemas_1.ChangePasswordResponseSchema;
|
|
11
11
|
UserChangePasswordCommand.URL = users_paths_1.USERS_API_PATHS.ME_PASSWORD;
|
|
12
12
|
UserChangePasswordCommand.METHOD = http_method_1.HttpMethod.PUT;
|
|
13
13
|
})(UserChangePasswordCommand || (exports.UserChangePasswordCommand = UserChangePasswordCommand = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
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.ZodUnion<readonly [z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
6
|
+
code: z.ZodString;
|
|
7
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
8
|
+
}, z.core.$strip>]>;
|
|
9
|
+
const URL: "/api/v1/users/me";
|
|
10
|
+
const METHOD = HttpMethod.DELETE;
|
|
11
|
+
type RequestType = z.infer<typeof Request>;
|
|
12
|
+
type ResponseType = z.infer<typeof Response>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserDeleteAccountCommand = void 0;
|
|
4
|
+
const schemas_1 = require("../schemas");
|
|
5
|
+
const users_paths_1 = require("../users.paths");
|
|
6
|
+
const http_method_1 = require("../../../shared/http-method");
|
|
7
|
+
var UserDeleteAccountCommand;
|
|
8
|
+
(function (UserDeleteAccountCommand) {
|
|
9
|
+
UserDeleteAccountCommand.Request = schemas_1.DeleteAccountRequestSchema;
|
|
10
|
+
UserDeleteAccountCommand.Response = schemas_1.DeleteAccountResponseSchema;
|
|
11
|
+
UserDeleteAccountCommand.URL = users_paths_1.USERS_API_PATHS.ME;
|
|
12
|
+
UserDeleteAccountCommand.METHOD = http_method_1.HttpMethod.DELETE;
|
|
13
|
+
})(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,15 @@
|
|
|
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.ZodUnion<readonly [z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
8
|
+
code: z.ZodString;
|
|
9
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
10
|
+
}, z.core.$strip>]>;
|
|
11
|
+
const URL: "/api/v1/users/me/marketing-consent";
|
|
12
|
+
const METHOD = HttpMethod.PUT;
|
|
13
|
+
type RequestType = z.infer<typeof Request>;
|
|
14
|
+
type ResponseType = z.infer<typeof Response>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserToggleMarketingConsentCommand = void 0;
|
|
4
|
+
const schemas_1 = require("../schemas");
|
|
5
|
+
const users_paths_1 = require("../users.paths");
|
|
6
|
+
const http_method_1 = require("../../../shared/http-method");
|
|
7
|
+
var UserToggleMarketingConsentCommand;
|
|
8
|
+
(function (UserToggleMarketingConsentCommand) {
|
|
9
|
+
UserToggleMarketingConsentCommand.Request = schemas_1.ToggleMarketingConsentRequestSchema;
|
|
10
|
+
UserToggleMarketingConsentCommand.Response = schemas_1.ToggleMarketingConsentResponseSchema;
|
|
11
|
+
UserToggleMarketingConsentCommand.URL = users_paths_1.USERS_API_PATHS.ME_MARKETING_CONSENT;
|
|
12
|
+
UserToggleMarketingConsentCommand.METHOD = http_method_1.HttpMethod.PUT;
|
|
13
|
+
})(UserToggleMarketingConsentCommand || (exports.UserToggleMarketingConsentCommand = UserToggleMarketingConsentCommand = {}));
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UserUpdateProfileCommand = void 0;
|
|
4
|
-
const
|
|
4
|
+
const schemas_1 = require("../schemas");
|
|
5
5
|
const users_paths_1 = require("../users.paths");
|
|
6
6
|
const http_method_1 = require("../../../shared/http-method");
|
|
7
7
|
var UserUpdateProfileCommand;
|
|
8
8
|
(function (UserUpdateProfileCommand) {
|
|
9
|
-
UserUpdateProfileCommand.Request =
|
|
10
|
-
UserUpdateProfileCommand.Response =
|
|
9
|
+
UserUpdateProfileCommand.Request = schemas_1.UpdateProfileRequestSchema;
|
|
10
|
+
UserUpdateProfileCommand.Response = schemas_1.UpdateProfileResponseSchema;
|
|
11
11
|
UserUpdateProfileCommand.URL = users_paths_1.USERS_API_PATHS.ME;
|
|
12
12
|
UserUpdateProfileCommand.METHOD = http_method_1.HttpMethod.PATCH;
|
|
13
13
|
})(UserUpdateProfileCommand || (exports.UserUpdateProfileCommand = UserUpdateProfileCommand = {}));
|
package/build/v1/users/index.js
CHANGED
|
@@ -14,7 +14,7 @@ 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
20
|
__exportStar(require("./commands"), exports);
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UserGetCurrentUserQuery = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
5
|
+
const schemas_1 = require("../schemas");
|
|
6
6
|
const users_paths_1 = require("../users.paths");
|
|
7
7
|
const http_method_1 = require("../../../shared/http-method");
|
|
8
8
|
var UserGetCurrentUserQuery;
|
|
9
9
|
(function (UserGetCurrentUserQuery) {
|
|
10
10
|
UserGetCurrentUserQuery.Request = zod_1.z.object({}); // No request body for GET
|
|
11
|
-
UserGetCurrentUserQuery.Response =
|
|
11
|
+
UserGetCurrentUserQuery.Response = schemas_1.GetCurrentUserResponseSchema;
|
|
12
12
|
UserGetCurrentUserQuery.URL = users_paths_1.USERS_API_PATHS.ME;
|
|
13
13
|
UserGetCurrentUserQuery.METHOD = http_method_1.HttpMethod.GET;
|
|
14
14
|
})(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);
|
|
@@ -1,46 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* Update Profile Request Schema
|
|
4
|
-
*/
|
|
5
|
-
export declare const UpdateProfileRequestSchema: z.ZodObject<{
|
|
6
|
-
name: z.ZodString;
|
|
7
|
-
}, z.core.$strip>;
|
|
8
|
-
/**
|
|
9
|
-
* Toggle Marketing Consent Request Schema
|
|
10
|
-
*/
|
|
11
|
-
export declare const ToggleMarketingConsentRequestSchema: z.ZodObject<{
|
|
12
|
-
marketingConsent: z.ZodBoolean;
|
|
13
|
-
}, z.core.$strip>;
|
|
14
|
-
/**
|
|
15
|
-
* Change Password Request Schema
|
|
16
|
-
*/
|
|
17
|
-
export declare const ChangePasswordRequestSchema: z.ZodObject<{
|
|
18
|
-
oldPassword: z.ZodString;
|
|
19
|
-
newPassword: z.ZodString;
|
|
20
|
-
logoutFromAllDevices: z.ZodDefault<z.ZodBoolean>;
|
|
21
|
-
}, z.core.$strip>;
|
|
22
|
-
/**
|
|
23
|
-
* User Response Schema
|
|
24
|
-
*/
|
|
25
|
-
export declare const UserResponseSchema: z.ZodObject<{
|
|
26
|
-
uuid: z.ZodString;
|
|
27
|
-
email: z.ZodString;
|
|
28
|
-
name: z.ZodString;
|
|
29
|
-
role: z.ZodString;
|
|
30
|
-
marketingConsent: z.ZodBoolean;
|
|
31
|
-
createdAt: z.ZodString;
|
|
32
|
-
}, z.core.$strip>;
|
|
33
|
-
/**
|
|
34
|
-
* Empty Response (for void operations like update, delete)
|
|
35
|
-
*/
|
|
36
|
-
export declare const EmptyResponseSchema: z.ZodObject<{}, z.core.$strip>;
|
|
37
|
-
/**
|
|
38
|
-
* Error Response Schema
|
|
39
|
-
*/
|
|
40
|
-
export declare const ErrorResponseSchema: z.ZodObject<{
|
|
41
|
-
code: z.ZodString;
|
|
42
|
-
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
43
|
-
}, z.core.$strip>;
|
|
44
2
|
/**
|
|
45
3
|
* Endpoint Response Unions (for frontend type safety)
|
|
46
4
|
*/
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetCurrentUserResponseSchema = exports.ChangePasswordResponseSchema = exports.ToggleMarketingConsentResponseSchema = exports.DeleteAccountResponseSchema = exports.UpdateProfileResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const user_response_schema_1 = require("./user-response.schema");
|
|
6
|
+
const common_schemas_1 = require("../../../shared/common-schemas");
|
|
7
|
+
/**
|
|
8
|
+
* Endpoint Response Unions (for frontend type safety)
|
|
9
|
+
*/
|
|
10
|
+
exports.UpdateProfileResponseSchema = zod_1.z.union([common_schemas_1.EmptyResponseSchema, common_schemas_1.ErrorResponseSchema]);
|
|
11
|
+
exports.DeleteAccountResponseSchema = zod_1.z.union([common_schemas_1.EmptyResponseSchema, common_schemas_1.ErrorResponseSchema]);
|
|
12
|
+
exports.ToggleMarketingConsentResponseSchema = zod_1.z.union([common_schemas_1.EmptyResponseSchema, common_schemas_1.ErrorResponseSchema]);
|
|
13
|
+
exports.ChangePasswordResponseSchema = zod_1.z.union([common_schemas_1.EmptyResponseSchema, common_schemas_1.ErrorResponseSchema]);
|
|
14
|
+
exports.GetCurrentUserResponseSchema = zod_1.z.union([user_response_schema_1.UserResponseSchema, common_schemas_1.ErrorResponseSchema]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ToggleMarketingConsentRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Toggle Marketing Consent Request Schema
|
|
7
|
+
*/
|
|
8
|
+
exports.ToggleMarketingConsentRequestSchema = zod_1.z.object({
|
|
9
|
+
marketingConsent: zod_1.z.boolean(),
|
|
10
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateProfileRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Update Profile Request Schema
|
|
7
|
+
* Error messages are in locales (en.ts, ru.ts)
|
|
8
|
+
*/
|
|
9
|
+
exports.UpdateProfileRequestSchema = zod_1.z.object({
|
|
10
|
+
name: zod_1.z.string().min(2).max(100),
|
|
11
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* User Response Schema
|
|
4
|
+
*/
|
|
5
|
+
export declare const UserResponseSchema: z.ZodObject<{
|
|
6
|
+
uuid: z.ZodString;
|
|
7
|
+
email: z.ZodString;
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
role: z.ZodString;
|
|
10
|
+
marketingConsent: z.ZodBoolean;
|
|
11
|
+
createdAt: z.ZodString;
|
|
12
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const regex_1 = require("../../../shared/regex");
|
|
6
|
+
/**
|
|
7
|
+
* User Response Schema
|
|
8
|
+
*/
|
|
9
|
+
exports.UserResponseSchema = zod_1.z.object({
|
|
10
|
+
uuid: zod_1.z.string().regex(regex_1.UUID_REGEX),
|
|
11
|
+
email: zod_1.z.string().regex(regex_1.EMAIL_REGEX),
|
|
12
|
+
name: zod_1.z.string(),
|
|
13
|
+
role: zod_1.z.string(),
|
|
14
|
+
marketingConsent: zod_1.z.boolean(),
|
|
15
|
+
createdAt: zod_1.z.string().regex(regex_1.DATETIME_REGEX),
|
|
16
|
+
});
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { UserResponseSchema, UpdateProfileRequestSchema, ChangePasswordRequestSchema, ToggleMarketingConsentRequestSchema, UpdateProfileResponseSchema, DeleteAccountResponseSchema, ToggleMarketingConsentResponseSchema, ChangePasswordResponseSchema, GetCurrentUserResponseSchema } from './schemas';
|
|
3
3
|
export type UpdateProfileRequest = z.infer<typeof UpdateProfileRequestSchema>;
|
|
4
|
-
export type ToggleMarketingConsentRequest = z.infer<typeof ToggleMarketingConsentRequestSchema>;
|
|
5
4
|
export type ChangePasswordRequest = z.infer<typeof ChangePasswordRequestSchema>;
|
|
5
|
+
export type ToggleMarketingConsentRequest = z.infer<typeof ToggleMarketingConsentRequestSchema>;
|
|
6
6
|
export type UserResponse = z.infer<typeof UserResponseSchema>;
|
|
7
|
-
export type EmptyResponse = z.infer<typeof EmptyResponseSchema>;
|
|
8
|
-
export type ErrorResponse = z.infer<typeof ErrorResponseSchema>;
|
|
9
7
|
export type UpdateProfileResponse = z.infer<typeof UpdateProfileResponseSchema>;
|
|
10
8
|
export type DeleteAccountResponse = z.infer<typeof DeleteAccountResponseSchema>;
|
|
11
9
|
export type ToggleMarketingConsentResponse = z.infer<typeof ToggleMarketingConsentResponseSchema>;
|
package/package.json
CHANGED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* User Role enum
|
|
4
|
-
*/
|
|
5
|
-
export declare enum UserRole {
|
|
6
|
-
USER = "user",
|
|
7
|
-
ADMIN = "admin"
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* UTM Schema
|
|
11
|
-
*/
|
|
12
|
-
export declare const UtmSchema: z.ZodObject<{
|
|
13
|
-
utmSource: z.ZodOptional<z.ZodString>;
|
|
14
|
-
utmMedium: z.ZodOptional<z.ZodString>;
|
|
15
|
-
utmCampaign: z.ZodOptional<z.ZodString>;
|
|
16
|
-
utmContent: z.ZodOptional<z.ZodString>;
|
|
17
|
-
utmTerm: z.ZodOptional<z.ZodString>;
|
|
18
|
-
}, z.core.$strip>;
|
|
19
|
-
/**
|
|
20
|
-
* Sign Up Request Schema
|
|
21
|
-
*/
|
|
22
|
-
export declare const SignUpRequestSchema: z.ZodObject<{
|
|
23
|
-
email: z.ZodString;
|
|
24
|
-
password: z.ZodString;
|
|
25
|
-
name: z.ZodString;
|
|
26
|
-
marketingConsent: z.ZodDefault<z.ZodBoolean>;
|
|
27
|
-
utm: z.ZodOptional<z.ZodObject<{
|
|
28
|
-
utmSource: z.ZodOptional<z.ZodString>;
|
|
29
|
-
utmMedium: z.ZodOptional<z.ZodString>;
|
|
30
|
-
utmCampaign: z.ZodOptional<z.ZodString>;
|
|
31
|
-
utmContent: z.ZodOptional<z.ZodString>;
|
|
32
|
-
utmTerm: z.ZodOptional<z.ZodString>;
|
|
33
|
-
}, z.core.$strip>>;
|
|
34
|
-
}, z.core.$strip>;
|
|
35
|
-
/**
|
|
36
|
-
* Login Request Schema
|
|
37
|
-
*/
|
|
38
|
-
export declare const LoginRequestSchema: z.ZodObject<{
|
|
39
|
-
email: z.ZodString;
|
|
40
|
-
password: z.ZodString;
|
|
41
|
-
}, z.core.$strip>;
|
|
42
|
-
/**
|
|
43
|
-
* Session Response Schema
|
|
44
|
-
*/
|
|
45
|
-
export declare const SessionResponseSchema: z.ZodObject<{
|
|
46
|
-
uuid: z.ZodString;
|
|
47
|
-
deviceName: z.ZodString;
|
|
48
|
-
ip: z.ZodString;
|
|
49
|
-
isCurrent: z.ZodBoolean;
|
|
50
|
-
createdAt: z.ZodString;
|
|
51
|
-
lastUsedAt: z.ZodString;
|
|
52
|
-
}, z.core.$strip>;
|
|
53
|
-
/**
|
|
54
|
-
* Auth Response Schema (signup/login)
|
|
55
|
-
*/
|
|
56
|
-
export declare const AuthResponseSchema: z.ZodObject<{
|
|
57
|
-
user: z.ZodObject<{
|
|
58
|
-
uuid: z.ZodString;
|
|
59
|
-
email: z.ZodString;
|
|
60
|
-
name: z.ZodString;
|
|
61
|
-
role: z.ZodString;
|
|
62
|
-
marketingConsent: z.ZodBoolean;
|
|
63
|
-
createdAt: z.ZodString;
|
|
64
|
-
}, z.core.$strip>;
|
|
65
|
-
accessToken: z.ZodString;
|
|
66
|
-
session: z.ZodObject<{
|
|
67
|
-
uuid: z.ZodString;
|
|
68
|
-
deviceName: z.ZodString;
|
|
69
|
-
ip: z.ZodString;
|
|
70
|
-
isCurrent: z.ZodBoolean;
|
|
71
|
-
createdAt: z.ZodString;
|
|
72
|
-
lastUsedAt: z.ZodString;
|
|
73
|
-
}, z.core.$strip>;
|
|
74
|
-
}, z.core.$strip>;
|
|
75
|
-
/**
|
|
76
|
-
* Sessions List Response Schema
|
|
77
|
-
*/
|
|
78
|
-
export declare const SessionsListResponseSchema: z.ZodObject<{
|
|
79
|
-
sessions: z.ZodArray<z.ZodObject<{
|
|
80
|
-
uuid: z.ZodString;
|
|
81
|
-
deviceName: z.ZodString;
|
|
82
|
-
ip: z.ZodString;
|
|
83
|
-
isCurrent: z.ZodBoolean;
|
|
84
|
-
createdAt: z.ZodString;
|
|
85
|
-
lastUsedAt: z.ZodString;
|
|
86
|
-
}, z.core.$strip>>;
|
|
87
|
-
}, z.core.$strip>;
|