@veruna/api-contracts 1.0.4 → 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.
Files changed (73) hide show
  1. package/build/index.d.ts +3 -5
  2. package/build/index.js +3 -5
  3. package/build/rest-api.d.ts +3 -0
  4. package/build/rest-api.js +6 -0
  5. package/build/shared/error-response.schema.d.ts +25 -0
  6. package/build/shared/error-response.schema.js +22 -0
  7. package/build/shared/index.d.ts +2 -0
  8. package/build/shared/index.js +18 -0
  9. package/build/utils/index.d.ts +1 -0
  10. package/build/utils/index.js +17 -0
  11. package/build/utils/path-builder.d.ts +20 -0
  12. package/build/utils/path-builder.js +46 -0
  13. package/build/v1/auth/commands/delete-session.command.d.ts +3 -5
  14. package/build/v1/auth/commands/delete-session.command.js +8 -4
  15. package/build/v1/auth/commands/login.command.d.ts +3 -5
  16. package/build/v1/auth/commands/login.command.js +7 -5
  17. package/build/v1/auth/commands/logout-all.command.d.ts +2 -4
  18. package/build/v1/auth/commands/logout-all.command.js +8 -4
  19. package/build/v1/auth/commands/logout.command.d.ts +2 -4
  20. package/build/v1/auth/commands/logout.command.js +8 -4
  21. package/build/v1/auth/commands/signup.command.d.ts +3 -5
  22. package/build/v1/auth/commands/signup.command.js +7 -5
  23. package/build/v1/auth/index.d.ts +2 -0
  24. package/build/v1/auth/index.js +2 -0
  25. package/build/v1/auth/queries/get-sessions.query.d.ts +3 -5
  26. package/build/v1/auth/queries/get-sessions.query.js +8 -5
  27. package/build/v1/blog/admin/commands/create-category.command.d.ts +2 -5
  28. package/build/v1/blog/admin/commands/create-category.command.js +1 -5
  29. package/build/v1/blog/admin/commands/create-post.command.d.ts +2 -5
  30. package/build/v1/blog/admin/commands/create-post.command.js +1 -5
  31. package/build/v1/blog/admin/commands/delete-category.command.d.ts +1 -4
  32. package/build/v1/blog/admin/commands/delete-category.command.js +1 -3
  33. package/build/v1/blog/admin/commands/delete-post.command.d.ts +1 -4
  34. package/build/v1/blog/admin/commands/delete-post.command.js +1 -3
  35. package/build/v1/blog/admin/commands/update-category.command.d.ts +2 -5
  36. package/build/v1/blog/admin/commands/update-category.command.js +1 -5
  37. package/build/v1/blog/admin/commands/update-post.command.d.ts +2 -5
  38. package/build/v1/blog/admin/commands/update-post.command.js +1 -5
  39. package/build/v1/blog/admin/queries/get-categories.query.d.ts +2 -5
  40. package/build/v1/blog/admin/queries/get-categories.query.js +1 -4
  41. package/build/v1/blog/admin/queries/get-category.query.d.ts +2 -5
  42. package/build/v1/blog/admin/queries/get-category.query.js +1 -4
  43. package/build/v1/blog/admin/queries/get-post.query.d.ts +2 -5
  44. package/build/v1/blog/admin/queries/get-post.query.js +1 -4
  45. package/build/v1/blog/admin/queries/get-posts.query.d.ts +2 -38
  46. package/build/v1/blog/admin/queries/get-posts.query.js +3 -6
  47. package/build/v1/blog/index.d.ts +2 -0
  48. package/build/v1/blog/index.js +2 -0
  49. package/build/v1/blog/public/queries/get-categories.query.d.ts +2 -5
  50. package/build/v1/blog/public/queries/get-categories.query.js +1 -4
  51. package/build/v1/blog/public/queries/get-post-by-alias.query.d.ts +2 -5
  52. package/build/v1/blog/public/queries/get-post-by-alias.query.js +1 -4
  53. package/build/v1/blog/public/queries/get-posts.query.d.ts +2 -38
  54. package/build/v1/blog/public/queries/get-posts.query.js +3 -6
  55. package/build/v1/unregistered-users/commands/authenticate.command.d.ts +4 -6
  56. package/build/v1/unregistered-users/commands/authenticate.command.js +5 -5
  57. package/build/v1/unregistered-users/controllers.d.ts +4 -0
  58. package/build/v1/unregistered-users/controllers.js +7 -0
  59. package/build/v1/unregistered-users/routes/unreg-users.routes.d.ts +6 -0
  60. package/build/v1/unregistered-users/routes/unreg-users.routes.js +9 -0
  61. package/build/v1/users/commands/change-password.command.d.ts +2 -4
  62. package/build/v1/users/commands/change-password.command.js +8 -5
  63. package/build/v1/users/commands/delete-account.command.d.ts +2 -4
  64. package/build/v1/users/commands/delete-account.command.js +8 -5
  65. package/build/v1/users/commands/toggle-marketing-consent.command.d.ts +2 -4
  66. package/build/v1/users/commands/toggle-marketing-consent.command.js +8 -5
  67. package/build/v1/users/commands/update-profile.command.d.ts +2 -4
  68. package/build/v1/users/commands/update-profile.command.js +8 -5
  69. package/build/v1/users/index.d.ts +2 -0
  70. package/build/v1/users/index.js +2 -0
  71. package/build/v1/users/queries/get-current-user.query.d.ts +3 -5
  72. package/build/v1/users/queries/get-current-user.query.js +7 -5
  73. package/package.json +1 -1
@@ -7,7 +7,7 @@ export declare namespace AdminBlogUpdateCategoryCommand {
7
7
  order: z.ZodOptional<z.ZodNumber>;
8
8
  status: z.ZodOptional<z.ZodEnum<typeof import("../../schemas").BlogCategoryStatus>>;
9
9
  }, z.core.$strip>;
10
- const Response: z.ZodUnion<readonly [z.ZodObject<{
10
+ const Response: z.ZodObject<{
11
11
  uuid: z.ZodString;
12
12
  alias: z.ZodString;
13
13
  title: z.ZodString;
@@ -15,10 +15,7 @@ export declare namespace AdminBlogUpdateCategoryCommand {
15
15
  status: z.ZodEnum<typeof import("../../schemas").BlogCategoryStatus>;
16
16
  createdAt: z.ZodString;
17
17
  updatedAt: z.ZodString;
18
- }, z.core.$strip>, z.ZodObject<{
19
- code: z.ZodString;
20
- details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
21
- }, z.core.$strip>]>;
18
+ }, z.core.$strip>;
22
19
  const PATH: ":uuid";
23
20
  const URL: (uuid: string) => string;
24
21
  const METHOD = HttpMethod.PATCH;
@@ -1,18 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AdminBlogUpdateCategoryCommand = void 0;
4
- const zod_1 = require("zod");
5
4
  const schemas_1 = require("../../schemas");
6
5
  const blog_admin_categories_routes_1 = require("../../routes/blog-admin-categories.routes");
7
6
  const rest_api_1 = require("../../../../rest-api");
8
7
  const http_method_1 = require("../../../../shared/http-method");
9
- const common_schemas_1 = require("../../../../shared/common-schemas");
10
8
  var AdminBlogUpdateCategoryCommand;
11
9
  (function (AdminBlogUpdateCategoryCommand) {
12
- // Request/Response
13
10
  AdminBlogUpdateCategoryCommand.Request = schemas_1.UpdateCategoryRequestSchema;
14
- AdminBlogUpdateCategoryCommand.Response = zod_1.z.union([schemas_1.CategoryResponseSchema, common_schemas_1.ErrorResponseSchema]);
15
- // Path/URL/Method
11
+ AdminBlogUpdateCategoryCommand.Response = schemas_1.CategoryResponseSchema;
16
12
  AdminBlogUpdateCategoryCommand.PATH = blog_admin_categories_routes_1.BLOG_ADMIN_CATEGORIES_ROUTES.UPDATE;
17
13
  AdminBlogUpdateCategoryCommand.URL = (uuid) => rest_api_1.REST_API.V1.BLOG.ADMIN.CATEGORIES.UPDATE(uuid);
18
14
  AdminBlogUpdateCategoryCommand.METHOD = http_method_1.HttpMethod.PATCH;
@@ -12,7 +12,7 @@ export declare namespace AdminBlogUpdatePostCommand {
12
12
  categoryIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
13
13
  status: z.ZodOptional<z.ZodEnum<typeof import("../../schemas").BlogPostStatus>>;
14
14
  }, z.core.$strip>;
15
- const Response: z.ZodUnion<readonly [z.ZodObject<{
15
+ const Response: z.ZodObject<{
16
16
  uuid: z.ZodString;
17
17
  alias: z.ZodString;
18
18
  title: z.ZodString;
@@ -34,10 +34,7 @@ export declare namespace AdminBlogUpdatePostCommand {
34
34
  status: z.ZodEnum<typeof import("../../schemas").BlogPostStatus>;
35
35
  createdAt: z.ZodString;
36
36
  updatedAt: z.ZodString;
37
- }, z.core.$strip>, z.ZodObject<{
38
- code: z.ZodString;
39
- details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
40
- }, z.core.$strip>]>;
37
+ }, z.core.$strip>;
41
38
  const PATH: ":uuid";
42
39
  const URL: (uuid: string) => string;
43
40
  const METHOD = HttpMethod.PATCH;
@@ -1,18 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AdminBlogUpdatePostCommand = void 0;
4
- const zod_1 = require("zod");
5
4
  const schemas_1 = require("../../schemas");
6
5
  const blog_admin_posts_routes_1 = require("../../routes/blog-admin-posts.routes");
7
6
  const rest_api_1 = require("../../../../rest-api");
8
7
  const http_method_1 = require("../../../../shared/http-method");
9
- const common_schemas_1 = require("../../../../shared/common-schemas");
10
8
  var AdminBlogUpdatePostCommand;
11
9
  (function (AdminBlogUpdatePostCommand) {
12
- // Request/Response
13
10
  AdminBlogUpdatePostCommand.Request = schemas_1.UpdatePostRequestSchema;
14
- AdminBlogUpdatePostCommand.Response = zod_1.z.union([schemas_1.PostResponseSchema, common_schemas_1.ErrorResponseSchema]);
15
- // Path/URL/Method
11
+ AdminBlogUpdatePostCommand.Response = schemas_1.PostResponseSchema;
16
12
  AdminBlogUpdatePostCommand.PATH = blog_admin_posts_routes_1.BLOG_ADMIN_POSTS_ROUTES.UPDATE;
17
13
  AdminBlogUpdatePostCommand.URL = (uuid) => rest_api_1.REST_API.V1.BLOG.ADMIN.POSTS.UPDATE(uuid);
18
14
  AdminBlogUpdatePostCommand.METHOD = http_method_1.HttpMethod.PATCH;
@@ -5,7 +5,7 @@ export declare namespace AdminBlogGetCategoriesQuery {
5
5
  const Request: z.ZodObject<{
6
6
  status: z.ZodOptional<z.ZodEnum<typeof BlogCategoryStatus>>;
7
7
  }, z.core.$strip>;
8
- const Response: z.ZodUnion<readonly [z.ZodObject<{
8
+ const Response: z.ZodObject<{
9
9
  categories: z.ZodArray<z.ZodObject<{
10
10
  uuid: z.ZodString;
11
11
  alias: z.ZodString;
@@ -15,10 +15,7 @@ export declare namespace AdminBlogGetCategoriesQuery {
15
15
  createdAt: z.ZodString;
16
16
  updatedAt: z.ZodString;
17
17
  }, z.core.$strip>>;
18
- }, z.core.$strip>, z.ZodObject<{
19
- code: z.ZodString;
20
- details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
21
- }, z.core.$strip>]>;
18
+ }, z.core.$strip>;
22
19
  const PATH: "";
23
20
  const URL: "/api/v1/admin/blog/categories/";
24
21
  const METHOD = HttpMethod.GET;
@@ -6,7 +6,6 @@ const schemas_1 = require("../../schemas");
6
6
  const blog_admin_categories_routes_1 = require("../../routes/blog-admin-categories.routes");
7
7
  const rest_api_1 = require("../../../../rest-api");
8
8
  const http_method_1 = require("../../../../shared/http-method");
9
- const common_schemas_1 = require("../../../../shared/common-schemas");
10
9
  const CategoriesListAdminResponseSchema = zod_1.z.object({
11
10
  categories: zod_1.z.array(schemas_1.CategoryResponseSchema),
12
11
  });
@@ -15,10 +14,8 @@ const GetCategoriesQueryAdminSchema = zod_1.z.object({
15
14
  });
16
15
  var AdminBlogGetCategoriesQuery;
17
16
  (function (AdminBlogGetCategoriesQuery) {
18
- // Request/Response
19
17
  AdminBlogGetCategoriesQuery.Request = GetCategoriesQueryAdminSchema;
20
- AdminBlogGetCategoriesQuery.Response = zod_1.z.union([CategoriesListAdminResponseSchema, common_schemas_1.ErrorResponseSchema]);
21
- // Path/URL/Method
18
+ AdminBlogGetCategoriesQuery.Response = CategoriesListAdminResponseSchema;
22
19
  AdminBlogGetCategoriesQuery.PATH = blog_admin_categories_routes_1.BLOG_ADMIN_CATEGORIES_ROUTES.GET_ALL;
23
20
  AdminBlogGetCategoriesQuery.URL = rest_api_1.REST_API.V1.BLOG.ADMIN.CATEGORIES.GET_ALL;
24
21
  AdminBlogGetCategoriesQuery.METHOD = http_method_1.HttpMethod.GET;
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  import { HttpMethod } from '../../../../shared/http-method';
3
3
  export declare namespace AdminBlogGetCategoryQuery {
4
4
  const Request: z.ZodObject<{}, z.core.$strip>;
5
- const Response: z.ZodUnion<readonly [z.ZodObject<{
5
+ const Response: z.ZodObject<{
6
6
  uuid: z.ZodString;
7
7
  alias: z.ZodString;
8
8
  title: z.ZodString;
@@ -10,10 +10,7 @@ export declare namespace AdminBlogGetCategoryQuery {
10
10
  status: z.ZodEnum<typeof import("../../schemas").BlogCategoryStatus>;
11
11
  createdAt: z.ZodString;
12
12
  updatedAt: z.ZodString;
13
- }, z.core.$strip>, z.ZodObject<{
14
- code: z.ZodString;
15
- details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
16
- }, z.core.$strip>]>;
13
+ }, z.core.$strip>;
17
14
  const PATH: ":uuid";
18
15
  const URL: (uuid: string) => string;
19
16
  const METHOD = HttpMethod.GET;
@@ -6,13 +6,10 @@ const schemas_1 = require("../../schemas");
6
6
  const blog_admin_categories_routes_1 = require("../../routes/blog-admin-categories.routes");
7
7
  const rest_api_1 = require("../../../../rest-api");
8
8
  const http_method_1 = require("../../../../shared/http-method");
9
- const common_schemas_1 = require("../../../../shared/common-schemas");
10
9
  var AdminBlogGetCategoryQuery;
11
10
  (function (AdminBlogGetCategoryQuery) {
12
- // Request/Response
13
11
  AdminBlogGetCategoryQuery.Request = zod_1.z.object({});
14
- AdminBlogGetCategoryQuery.Response = zod_1.z.union([schemas_1.CategoryResponseSchema, common_schemas_1.ErrorResponseSchema]);
15
- // Path/URL/Method
12
+ AdminBlogGetCategoryQuery.Response = schemas_1.CategoryResponseSchema;
16
13
  AdminBlogGetCategoryQuery.PATH = blog_admin_categories_routes_1.BLOG_ADMIN_CATEGORIES_ROUTES.GET_BY_UUID;
17
14
  AdminBlogGetCategoryQuery.URL = (uuid) => rest_api_1.REST_API.V1.BLOG.ADMIN.CATEGORIES.GET_BY_UUID(uuid);
18
15
  AdminBlogGetCategoryQuery.METHOD = http_method_1.HttpMethod.GET;
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  import { HttpMethod } from '../../../../shared/http-method';
3
3
  export declare namespace AdminBlogGetPostQuery {
4
4
  const Request: z.ZodObject<{}, z.core.$strip>;
5
- const Response: z.ZodUnion<readonly [z.ZodObject<{
5
+ const Response: z.ZodObject<{
6
6
  uuid: z.ZodString;
7
7
  alias: z.ZodString;
8
8
  title: z.ZodString;
@@ -24,10 +24,7 @@ export declare namespace AdminBlogGetPostQuery {
24
24
  status: z.ZodEnum<typeof import("../../schemas").BlogPostStatus>;
25
25
  createdAt: z.ZodString;
26
26
  updatedAt: z.ZodString;
27
- }, z.core.$strip>, z.ZodObject<{
28
- code: z.ZodString;
29
- details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
30
- }, z.core.$strip>]>;
27
+ }, z.core.$strip>;
31
28
  const PATH: ":uuid";
32
29
  const URL: (uuid: string) => string;
33
30
  const METHOD = HttpMethod.GET;
@@ -6,13 +6,10 @@ const schemas_1 = require("../../schemas");
6
6
  const blog_admin_posts_routes_1 = require("../../routes/blog-admin-posts.routes");
7
7
  const rest_api_1 = require("../../../../rest-api");
8
8
  const http_method_1 = require("../../../../shared/http-method");
9
- const common_schemas_1 = require("../../../../shared/common-schemas");
10
9
  var AdminBlogGetPostQuery;
11
10
  (function (AdminBlogGetPostQuery) {
12
- // Request/Response
13
11
  AdminBlogGetPostQuery.Request = zod_1.z.object({});
14
- AdminBlogGetPostQuery.Response = zod_1.z.union([schemas_1.PostResponseSchema, common_schemas_1.ErrorResponseSchema]);
15
- // Path/URL/Method
12
+ AdminBlogGetPostQuery.Response = schemas_1.PostResponseSchema;
16
13
  AdminBlogGetPostQuery.PATH = blog_admin_posts_routes_1.BLOG_ADMIN_POSTS_ROUTES.GET_BY_UUID;
17
14
  AdminBlogGetPostQuery.URL = (uuid) => rest_api_1.REST_API.V1.BLOG.ADMIN.POSTS.GET_BY_UUID(uuid);
18
15
  AdminBlogGetPostQuery.METHOD = http_method_1.HttpMethod.GET;
@@ -1,38 +1,5 @@
1
1
  import { z } from 'zod';
2
2
  import { HttpMethod } from '../../../../shared/http-method';
3
- export declare const PostsListAdminResponseSchema: z.ZodObject<{
4
- data: z.ZodArray<z.ZodObject<{
5
- uuid: z.ZodString;
6
- alias: z.ZodString;
7
- title: z.ZodString;
8
- metaTitle: z.ZodString;
9
- metaDescription: z.ZodString;
10
- content: z.ZodString;
11
- image: z.ZodString;
12
- author: z.ZodString;
13
- categories: z.ZodArray<z.ZodObject<{
14
- uuid: z.ZodString;
15
- alias: z.ZodString;
16
- title: z.ZodString;
17
- order: z.ZodNumber;
18
- status: z.ZodEnum<typeof import("../../schemas").BlogCategoryStatus>;
19
- createdAt: z.ZodString;
20
- updatedAt: z.ZodString;
21
- }, z.core.$strip>>;
22
- viewsCount: z.ZodNumber;
23
- status: z.ZodEnum<typeof import("../../schemas").BlogPostStatus>;
24
- createdAt: z.ZodString;
25
- updatedAt: z.ZodString;
26
- }, z.core.$strip>>;
27
- meta: z.ZodObject<{
28
- page: z.ZodNumber;
29
- limit: z.ZodNumber;
30
- total: z.ZodNumber;
31
- totalPages: z.ZodNumber;
32
- hasNext: z.ZodBoolean;
33
- hasPrev: z.ZodBoolean;
34
- }, z.core.$strip>;
35
- }, z.core.$strip>;
36
3
  export declare namespace AdminBlogGetPostsQuery {
37
4
  const Request: z.ZodObject<{
38
5
  page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
@@ -40,7 +7,7 @@ export declare namespace AdminBlogGetPostsQuery {
40
7
  status: z.ZodOptional<z.ZodEnum<typeof import("../../schemas").BlogPostStatus>>;
41
8
  categoryAliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
42
9
  }, z.core.$strip>;
43
- const Response: z.ZodUnion<readonly [z.ZodObject<{
10
+ const Response: z.ZodObject<{
44
11
  data: z.ZodArray<z.ZodObject<{
45
12
  uuid: z.ZodString;
46
13
  alias: z.ZodString;
@@ -72,10 +39,7 @@ export declare namespace AdminBlogGetPostsQuery {
72
39
  hasNext: z.ZodBoolean;
73
40
  hasPrev: z.ZodBoolean;
74
41
  }, z.core.$strip>;
75
- }, z.core.$strip>, z.ZodObject<{
76
- code: z.ZodString;
77
- details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
78
- }, z.core.$strip>]>;
42
+ }, z.core.$strip>;
79
43
  const PATH: "";
80
44
  const URL: "/api/v1/admin/blog/posts/";
81
45
  const METHOD = HttpMethod.GET;
@@ -1,23 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AdminBlogGetPostsQuery = exports.PostsListAdminResponseSchema = void 0;
3
+ exports.AdminBlogGetPostsQuery = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const schemas_1 = require("../../schemas");
6
6
  const pagination_schema_1 = require("../../../../shared/pagination.schema");
7
7
  const blog_admin_posts_routes_1 = require("../../routes/blog-admin-posts.routes");
8
8
  const rest_api_1 = require("../../../../rest-api");
9
9
  const http_method_1 = require("../../../../shared/http-method");
10
- const common_schemas_1 = require("../../../../shared/common-schemas");
11
- exports.PostsListAdminResponseSchema = zod_1.z.object({
10
+ const PostsListAdminResponseSchema = zod_1.z.object({
12
11
  data: zod_1.z.array(schemas_1.PostResponseSchema),
13
12
  meta: pagination_schema_1.PaginationMetaSchema,
14
13
  });
15
14
  var AdminBlogGetPostsQuery;
16
15
  (function (AdminBlogGetPostsQuery) {
17
- // Request/Response
18
16
  AdminBlogGetPostsQuery.Request = schemas_1.GetPostsQueryAdminSchema;
19
- AdminBlogGetPostsQuery.Response = zod_1.z.union([exports.PostsListAdminResponseSchema, common_schemas_1.ErrorResponseSchema]);
20
- // Path/URL/Method
17
+ AdminBlogGetPostsQuery.Response = PostsListAdminResponseSchema;
21
18
  AdminBlogGetPostsQuery.PATH = blog_admin_posts_routes_1.BLOG_ADMIN_POSTS_ROUTES.GET_ALL;
22
19
  AdminBlogGetPostsQuery.URL = rest_api_1.REST_API.V1.BLOG.ADMIN.POSTS.GET_ALL;
23
20
  AdminBlogGetPostsQuery.METHOD = http_method_1.HttpMethod.GET;
@@ -1,6 +1,8 @@
1
1
  export * from './schemas';
2
2
  export * from './blog.types';
3
3
  export * from './blog.paths';
4
+ export * from './controllers';
5
+ export * from './routes';
4
6
  export * from './admin/commands';
5
7
  export * from './admin/queries';
6
8
  export * from './public/queries';
@@ -17,6 +17,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./schemas"), exports);
18
18
  __exportStar(require("./blog.types"), exports);
19
19
  __exportStar(require("./blog.paths"), exports);
20
+ __exportStar(require("./controllers"), exports);
21
+ __exportStar(require("./routes"), exports);
20
22
  __exportStar(require("./admin/commands"), exports);
21
23
  __exportStar(require("./admin/queries"), exports);
22
24
  __exportStar(require("./public/queries"), exports);
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  import { HttpMethod } from '../../../../shared/http-method';
3
3
  export declare namespace BlogGetCategoriesQuery {
4
4
  const Request: z.ZodObject<{}, z.core.$strip>;
5
- const Response: z.ZodUnion<readonly [z.ZodObject<{
5
+ const Response: z.ZodObject<{
6
6
  categories: z.ZodArray<z.ZodObject<{
7
7
  uuid: z.ZodString;
8
8
  alias: z.ZodString;
@@ -12,10 +12,7 @@ export declare namespace BlogGetCategoriesQuery {
12
12
  createdAt: z.ZodString;
13
13
  updatedAt: z.ZodString;
14
14
  }, z.core.$strip>>;
15
- }, z.core.$strip>, z.ZodObject<{
16
- code: z.ZodString;
17
- details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
18
- }, z.core.$strip>]>;
15
+ }, z.core.$strip>;
19
16
  const PATH: "";
20
17
  const URL: "/api/v1/blog/categories/";
21
18
  const METHOD = HttpMethod.GET;
@@ -6,16 +6,13 @@ const schemas_1 = require("../../schemas");
6
6
  const blog_public_routes_1 = require("../../routes/blog-public.routes");
7
7
  const rest_api_1 = require("../../../../rest-api");
8
8
  const http_method_1 = require("../../../../shared/http-method");
9
- const common_schemas_1 = require("../../../../shared/common-schemas");
10
9
  const CategoriesListPublicResponseSchema = zod_1.z.object({
11
10
  categories: zod_1.z.array(schemas_1.CategoryResponseSchema),
12
11
  });
13
12
  var BlogGetCategoriesQuery;
14
13
  (function (BlogGetCategoriesQuery) {
15
- // Request/Response
16
14
  BlogGetCategoriesQuery.Request = zod_1.z.object({});
17
- BlogGetCategoriesQuery.Response = zod_1.z.union([CategoriesListPublicResponseSchema, common_schemas_1.ErrorResponseSchema]);
18
- // Path/URL/Method
15
+ BlogGetCategoriesQuery.Response = CategoriesListPublicResponseSchema;
19
16
  BlogGetCategoriesQuery.PATH = blog_public_routes_1.BLOG_PUBLIC_CATEGORIES_ROUTES.GET_ALL;
20
17
  BlogGetCategoriesQuery.URL = rest_api_1.REST_API.V1.BLOG.PUBLIC.CATEGORIES.GET_ALL;
21
18
  BlogGetCategoriesQuery.METHOD = http_method_1.HttpMethod.GET;
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  import { HttpMethod } from '../../../../shared/http-method';
3
3
  export declare namespace BlogGetPostByAliasQuery {
4
4
  const Request: z.ZodObject<{}, z.core.$strip>;
5
- const Response: z.ZodUnion<readonly [z.ZodObject<{
5
+ const Response: z.ZodObject<{
6
6
  uuid: z.ZodString;
7
7
  alias: z.ZodString;
8
8
  title: z.ZodString;
@@ -24,10 +24,7 @@ export declare namespace BlogGetPostByAliasQuery {
24
24
  status: z.ZodEnum<typeof import("../../schemas").BlogPostStatus>;
25
25
  createdAt: z.ZodString;
26
26
  updatedAt: z.ZodString;
27
- }, z.core.$strip>, z.ZodObject<{
28
- code: z.ZodString;
29
- details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
30
- }, z.core.$strip>]>;
27
+ }, z.core.$strip>;
31
28
  const PATH: ":alias";
32
29
  const URL: (alias: string) => string;
33
30
  const METHOD = HttpMethod.GET;
@@ -6,13 +6,10 @@ const schemas_1 = require("../../schemas");
6
6
  const blog_public_routes_1 = require("../../routes/blog-public.routes");
7
7
  const rest_api_1 = require("../../../../rest-api");
8
8
  const http_method_1 = require("../../../../shared/http-method");
9
- const common_schemas_1 = require("../../../../shared/common-schemas");
10
9
  var BlogGetPostByAliasQuery;
11
10
  (function (BlogGetPostByAliasQuery) {
12
- // Request/Response
13
11
  BlogGetPostByAliasQuery.Request = zod_1.z.object({});
14
- BlogGetPostByAliasQuery.Response = zod_1.z.union([schemas_1.PostResponseSchema, common_schemas_1.ErrorResponseSchema]);
15
- // Path/URL/Method
12
+ BlogGetPostByAliasQuery.Response = schemas_1.PostResponseSchema;
16
13
  BlogGetPostByAliasQuery.PATH = blog_public_routes_1.BLOG_PUBLIC_POSTS_ROUTES.GET_BY_ALIAS;
17
14
  BlogGetPostByAliasQuery.URL = (alias) => rest_api_1.REST_API.V1.BLOG.PUBLIC.POSTS.GET_BY_ALIAS(alias);
18
15
  BlogGetPostByAliasQuery.METHOD = http_method_1.HttpMethod.GET;
@@ -1,45 +1,12 @@
1
1
  import { z } from 'zod';
2
2
  import { HttpMethod } from '../../../../shared/http-method';
3
- export declare const PostsListResponseSchema: z.ZodObject<{
4
- data: z.ZodArray<z.ZodObject<{
5
- uuid: z.ZodString;
6
- alias: z.ZodString;
7
- title: z.ZodString;
8
- metaTitle: z.ZodString;
9
- metaDescription: z.ZodString;
10
- content: z.ZodString;
11
- image: z.ZodString;
12
- author: z.ZodString;
13
- categories: z.ZodArray<z.ZodObject<{
14
- uuid: z.ZodString;
15
- alias: z.ZodString;
16
- title: z.ZodString;
17
- order: z.ZodNumber;
18
- status: z.ZodEnum<typeof import("../../schemas").BlogCategoryStatus>;
19
- createdAt: z.ZodString;
20
- updatedAt: z.ZodString;
21
- }, z.core.$strip>>;
22
- viewsCount: z.ZodNumber;
23
- status: z.ZodEnum<typeof import("../../schemas").BlogPostStatus>;
24
- createdAt: z.ZodString;
25
- updatedAt: z.ZodString;
26
- }, z.core.$strip>>;
27
- meta: z.ZodObject<{
28
- page: z.ZodNumber;
29
- limit: z.ZodNumber;
30
- total: z.ZodNumber;
31
- totalPages: z.ZodNumber;
32
- hasNext: z.ZodBoolean;
33
- hasPrev: z.ZodBoolean;
34
- }, z.core.$strip>;
35
- }, z.core.$strip>;
36
3
  export declare namespace BlogGetPostsQuery {
37
4
  const Request: z.ZodObject<{
38
5
  page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
39
6
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
40
7
  categoryAliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
41
8
  }, z.core.$strip>;
42
- const Response: z.ZodUnion<readonly [z.ZodObject<{
9
+ const Response: z.ZodObject<{
43
10
  data: z.ZodArray<z.ZodObject<{
44
11
  uuid: z.ZodString;
45
12
  alias: z.ZodString;
@@ -71,10 +38,7 @@ export declare namespace BlogGetPostsQuery {
71
38
  hasNext: z.ZodBoolean;
72
39
  hasPrev: z.ZodBoolean;
73
40
  }, z.core.$strip>;
74
- }, z.core.$strip>, z.ZodObject<{
75
- code: z.ZodString;
76
- details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
77
- }, z.core.$strip>]>;
41
+ }, z.core.$strip>;
78
42
  const PATH: "";
79
43
  const URL: "/api/v1/blog/posts/";
80
44
  const METHOD = HttpMethod.GET;
@@ -1,23 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BlogGetPostsQuery = exports.PostsListResponseSchema = void 0;
3
+ exports.BlogGetPostsQuery = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const schemas_1 = require("../../schemas");
6
6
  const pagination_schema_1 = require("../../../../shared/pagination.schema");
7
7
  const blog_public_routes_1 = require("../../routes/blog-public.routes");
8
8
  const rest_api_1 = require("../../../../rest-api");
9
9
  const http_method_1 = require("../../../../shared/http-method");
10
- const common_schemas_1 = require("../../../../shared/common-schemas");
11
- exports.PostsListResponseSchema = zod_1.z.object({
10
+ const PostsListResponseSchema = zod_1.z.object({
12
11
  data: zod_1.z.array(schemas_1.PostResponseSchema),
13
12
  meta: pagination_schema_1.PaginationMetaSchema,
14
13
  });
15
14
  var BlogGetPostsQuery;
16
15
  (function (BlogGetPostsQuery) {
17
- // Request/Response
18
16
  BlogGetPostsQuery.Request = schemas_1.GetPostsQueryPublicSchema;
19
- BlogGetPostsQuery.Response = zod_1.z.union([exports.PostsListResponseSchema, common_schemas_1.ErrorResponseSchema]);
20
- // Path/URL/Method
17
+ BlogGetPostsQuery.Response = PostsListResponseSchema;
21
18
  BlogGetPostsQuery.PATH = blog_public_routes_1.BLOG_PUBLIC_POSTS_ROUTES.GET_ALL;
22
19
  BlogGetPostsQuery.URL = rest_api_1.REST_API.V1.BLOG.PUBLIC.POSTS.GET_ALL;
23
20
  BlogGetPostsQuery.METHOD = http_method_1.HttpMethod.GET;
@@ -4,16 +4,14 @@ export declare namespace UnregAuthenticateCommand {
4
4
  const Request: z.ZodObject<{
5
5
  token: z.ZodOptional<z.ZodString>;
6
6
  }, z.core.$strip>;
7
- const Response: z.ZodUnion<readonly [z.ZodObject<{
7
+ const Response: z.ZodObject<{
8
8
  token: z.ZodString;
9
9
  requests: z.ZodNumber;
10
10
  nextResetAt: z.ZodString;
11
11
  status: z.ZodEnum<typeof import("../schemas").UnregUserStatus>;
12
- }, z.core.$strip>, z.ZodObject<{
13
- code: z.ZodString;
14
- details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
15
- }, z.core.$strip>]>;
16
- const URL: "/api/v1/unreg";
12
+ }, z.core.$strip>;
13
+ const PATH: "";
14
+ const URL: "/api/v1/unreg/";
17
15
  const METHOD = HttpMethod.PUT;
18
16
  type RequestType = z.infer<typeof Request>;
19
17
  type ResponseType = z.infer<typeof Response>;
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UnregAuthenticateCommand = void 0;
4
- const zod_1 = require("zod");
5
4
  const schemas_1 = require("../schemas");
6
- const unregistered_users_paths_1 = require("../unregistered-users.paths");
5
+ const unreg_users_routes_1 = require("../routes/unreg-users.routes");
6
+ const rest_api_1 = require("../../../rest-api");
7
7
  const http_method_1 = require("../../../shared/http-method");
8
- const common_schemas_1 = require("../../../shared/common-schemas");
9
8
  var UnregAuthenticateCommand;
10
9
  (function (UnregAuthenticateCommand) {
11
10
  UnregAuthenticateCommand.Request = schemas_1.AuthenticateUnregUserRequestSchema;
12
- UnregAuthenticateCommand.Response = zod_1.z.union([schemas_1.AuthenticateUnregUserResponseSchema, common_schemas_1.ErrorResponseSchema]);
13
- UnregAuthenticateCommand.URL = unregistered_users_paths_1.UNREG_USERS_API_PATHS.AUTHENTICATE;
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
14
  UnregAuthenticateCommand.METHOD = http_method_1.HttpMethod.PUT;
15
15
  })(UnregAuthenticateCommand || (exports.UnregAuthenticateCommand = UnregAuthenticateCommand = {}));
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Unregistered Users Controller path
3
+ */
4
+ export declare const UNREG_USERS_CONTROLLER: "v1/unreg";
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UNREG_USERS_CONTROLLER = void 0;
4
+ /**
5
+ * Unregistered Users Controller path
6
+ */
7
+ exports.UNREG_USERS_CONTROLLER = 'v1/unreg';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Unregistered Users Routes
3
+ */
4
+ export declare const UNREG_USERS_ROUTES: {
5
+ readonly AUTHENTICATE: "";
6
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UNREG_USERS_ROUTES = void 0;
4
+ /**
5
+ * Unregistered Users Routes
6
+ */
7
+ exports.UNREG_USERS_ROUTES = {
8
+ AUTHENTICATE: '', // PUT to controller base
9
+ };
@@ -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.ZodUnion<readonly [z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
10
- code: z.ZodString;
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 schemas_1 = require("../schemas");
5
- const users_paths_1 = require("../users.paths");
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 = schemas_1.ChangePasswordRequestSchema;
10
- UserChangePasswordCommand.Response = schemas_1.ChangePasswordResponseSchema;
11
- UserChangePasswordCommand.URL = users_paths_1.USERS_API_PATHS.ME_PASSWORD;
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 = {}));
@@ -2,10 +2,8 @@ import { z } from 'zod';
2
2
  import { HttpMethod } from '../../../shared/http-method';
3
3
  export declare namespace UserDeleteAccountCommand {
4
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>]>;
5
+ const Response: z.ZodObject<{}, z.core.$strip>;
6
+ const PATH: "me";
9
7
  const URL: "/api/v1/users/me";
10
8
  const METHOD = HttpMethod.DELETE;
11
9
  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.UserDeleteAccountCommand = void 0;
4
- const schemas_1 = require("../schemas");
5
- const users_paths_1 = require("../users.paths");
4
+ const zod_1 = require("zod");
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 UserDeleteAccountCommand;
8
10
  (function (UserDeleteAccountCommand) {
9
- UserDeleteAccountCommand.Request = schemas_1.DeleteAccountRequestSchema;
10
- UserDeleteAccountCommand.Response = schemas_1.DeleteAccountResponseSchema;
11
- UserDeleteAccountCommand.URL = users_paths_1.USERS_API_PATHS.ME;
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;
12
15
  UserDeleteAccountCommand.METHOD = http_method_1.HttpMethod.DELETE;
13
16
  })(UserDeleteAccountCommand || (exports.UserDeleteAccountCommand = UserDeleteAccountCommand = {}));