@purpleschool/gptbot 0.12.94 → 0.12.96
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/api/controllers/http/index.ts +1 -0
- package/api/controllers/http/update-post.ts +15 -0
- package/api/routes.ts +17 -0
- package/build/api/controllers/http/index.js +1 -0
- package/build/api/controllers/http/update-post.js +16 -0
- package/build/api/routes.js +11 -0
- package/build/commands/index.js +1 -0
- package/build/commands/tools/marketplace-card/generate-marketplace-card-description.command.js +1 -1
- package/build/commands/update-post/create-update-post-translation.command.js +20 -0
- package/build/commands/update-post/create-update-post.command.js +14 -0
- package/build/commands/update-post/find-all-update-posts.command.js +11 -0
- package/build/commands/update-post/find-update-post.command.js +17 -0
- package/build/commands/update-post/get-all-update-post-translations.query.js +14 -0
- package/build/commands/update-post/get-latest-update-posts.command.js +11 -0
- package/build/commands/update-post/index.js +24 -0
- package/build/commands/update-post/update-update-post-translation.command.js +20 -0
- package/build/commands/update-post/update-update-post.command.js +17 -0
- package/build/models/index.js +2 -0
- package/build/models/update-post-translation.schema.js +15 -0
- package/build/models/update-post.schema.js +13 -0
- package/commands/index.ts +1 -0
- package/commands/tools/marketplace-card/generate-marketplace-card-description.command.ts +1 -1
- package/commands/update-post/create-update-post-translation.command.ts +25 -0
- package/commands/update-post/create-update-post.command.ts +16 -0
- package/commands/update-post/find-all-update-posts.command.ts +10 -0
- package/commands/update-post/find-update-post.command.ts +22 -0
- package/commands/update-post/get-all-update-post-translations.query.ts +16 -0
- package/commands/update-post/get-latest-update-posts.command.ts +10 -0
- package/commands/update-post/index.ts +8 -0
- package/commands/update-post/update-update-post-translation.command.ts +25 -0
- package/commands/update-post/update-update-post.command.ts +22 -0
- package/models/index.ts +2 -0
- package/models/update-post-translation.schema.ts +13 -0
- package/models/update-post.schema.ts +11 -0
- package/package.json +1 -1
|
@@ -36,6 +36,7 @@ export * from './paraphrase';
|
|
|
36
36
|
export * from './tool';
|
|
37
37
|
export * from './tts';
|
|
38
38
|
export * from './unregistered-user';
|
|
39
|
+
export * from './update-post';
|
|
39
40
|
export * from './user-to-task-private';
|
|
40
41
|
export * from './user-to-task-public';
|
|
41
42
|
export * from './user';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const UPDATE_POST_CONTROLLER = 'update-post' as const;
|
|
2
|
+
export const UPDATE_POST_ADMIN_CONTROLLER = 'update-post/admin' as const;
|
|
3
|
+
|
|
4
|
+
export const UPDATE_POST_ROUTES = {
|
|
5
|
+
CREATE: 'create',
|
|
6
|
+
UPDATE: (uuid: string) => `${uuid}`,
|
|
7
|
+
FIND_BY_UUID: (uuid: string) => `by/uuid/${uuid}`,
|
|
8
|
+
FIND_BY_SLUG: (slug: string) => `by/slug/${slug}`,
|
|
9
|
+
FIND_ALL: 'all',
|
|
10
|
+
LATEST: 'latest',
|
|
11
|
+
GET_ALL_TRANSLATIONS: (uuid: string) => `${uuid}/translations`,
|
|
12
|
+
CREATE_TRANSLATION: (uuid: string) => `${uuid}/translations`,
|
|
13
|
+
UPDATE_TRANSLATION: (uuid: string, translationUuid: string) =>
|
|
14
|
+
`${uuid}/translations/${translationUuid}`,
|
|
15
|
+
} as const;
|
package/api/routes.ts
CHANGED
|
@@ -308,6 +308,23 @@ export const REST_API = {
|
|
|
308
308
|
LATEST: `${ROOT}/${CONTROLLERS.BLOG_CONTROLLER(POST_TYPE.UPDATE)}/${CONTROLLERS.BLOG_ROUTES.LATEST}`,
|
|
309
309
|
COUNT: `${ROOT}/${CONTROLLERS.BLOG_CONTROLLER(POST_TYPE.UPDATE)}/${CONTROLLERS.BLOG_ROUTES.COUNT}`,
|
|
310
310
|
},
|
|
311
|
+
UPDATE_POSTS: {
|
|
312
|
+
CREATE: `${ROOT}/${CONTROLLERS.UPDATE_POST_ADMIN_CONTROLLER}/${CONTROLLERS.UPDATE_POST_ROUTES.CREATE}`,
|
|
313
|
+
PATCH: (uuid: string) =>
|
|
314
|
+
`${ROOT}/${CONTROLLERS.UPDATE_POST_ADMIN_CONTROLLER}/${CONTROLLERS.UPDATE_POST_ROUTES.UPDATE(uuid)}`,
|
|
315
|
+
GET_BY_UUID: (uuid: string) =>
|
|
316
|
+
`${ROOT}/${CONTROLLERS.UPDATE_POST_ADMIN_CONTROLLER}/${CONTROLLERS.UPDATE_POST_ROUTES.FIND_BY_UUID(uuid)}`,
|
|
317
|
+
GET_BY_SLUG: (slug: string) =>
|
|
318
|
+
`${ROOT}/${CONTROLLERS.UPDATE_POST_ADMIN_CONTROLLER}/${CONTROLLERS.UPDATE_POST_ROUTES.FIND_BY_SLUG(slug)}`,
|
|
319
|
+
GET_ALL: `${ROOT}/${CONTROLLERS.UPDATE_POST_ADMIN_CONTROLLER}/${CONTROLLERS.UPDATE_POST_ROUTES.FIND_ALL}`,
|
|
320
|
+
GET_ALL_TRANSLATIONS: (uuid: string) =>
|
|
321
|
+
`${ROOT}/${CONTROLLERS.UPDATE_POST_ADMIN_CONTROLLER}/${CONTROLLERS.UPDATE_POST_ROUTES.GET_ALL_TRANSLATIONS(uuid)}`,
|
|
322
|
+
CREATE_TRANSLATION: (uuid: string) =>
|
|
323
|
+
`${ROOT}/${CONTROLLERS.UPDATE_POST_ADMIN_CONTROLLER}/${CONTROLLERS.UPDATE_POST_ROUTES.CREATE_TRANSLATION(uuid)}`,
|
|
324
|
+
UPDATE_TRANSLATION: (uuid: string, translationUuid: string) =>
|
|
325
|
+
`${ROOT}/${CONTROLLERS.UPDATE_POST_ADMIN_CONTROLLER}/${CONTROLLERS.UPDATE_POST_ROUTES.UPDATE_TRANSLATION(uuid, translationUuid)}`,
|
|
326
|
+
LATEST: `${ROOT}/${CONTROLLERS.UPDATE_POST_CONTROLLER}/${CONTROLLERS.UPDATE_POST_ROUTES.LATEST}`,
|
|
327
|
+
},
|
|
311
328
|
PROMOCODE: {
|
|
312
329
|
CREATE: `${ROOT}/${CONTROLLERS.PROMOCODE_PRIVATE_CONTROLLER}`,
|
|
313
330
|
PATCH: (uuid: string) => `${ROOT}/${CONTROLLERS.PROMOCODE_PRIVATE_CONTROLLER}/${uuid}`,
|
|
@@ -52,6 +52,7 @@ __exportStar(require("./paraphrase"), exports);
|
|
|
52
52
|
__exportStar(require("./tool"), exports);
|
|
53
53
|
__exportStar(require("./tts"), exports);
|
|
54
54
|
__exportStar(require("./unregistered-user"), exports);
|
|
55
|
+
__exportStar(require("./update-post"), exports);
|
|
55
56
|
__exportStar(require("./user-to-task-private"), exports);
|
|
56
57
|
__exportStar(require("./user-to-task-public"), exports);
|
|
57
58
|
__exportStar(require("./user"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UPDATE_POST_ROUTES = exports.UPDATE_POST_ADMIN_CONTROLLER = exports.UPDATE_POST_CONTROLLER = void 0;
|
|
4
|
+
exports.UPDATE_POST_CONTROLLER = 'update-post';
|
|
5
|
+
exports.UPDATE_POST_ADMIN_CONTROLLER = 'update-post/admin';
|
|
6
|
+
exports.UPDATE_POST_ROUTES = {
|
|
7
|
+
CREATE: 'create',
|
|
8
|
+
UPDATE: (uuid) => `${uuid}`,
|
|
9
|
+
FIND_BY_UUID: (uuid) => `by/uuid/${uuid}`,
|
|
10
|
+
FIND_BY_SLUG: (slug) => `by/slug/${slug}`,
|
|
11
|
+
FIND_ALL: 'all',
|
|
12
|
+
LATEST: 'latest',
|
|
13
|
+
GET_ALL_TRANSLATIONS: (uuid) => `${uuid}/translations`,
|
|
14
|
+
CREATE_TRANSLATION: (uuid) => `${uuid}/translations`,
|
|
15
|
+
UPDATE_TRANSLATION: (uuid, translationUuid) => `${uuid}/translations/${translationUuid}`,
|
|
16
|
+
};
|
package/build/api/routes.js
CHANGED
|
@@ -270,6 +270,17 @@ exports.REST_API = {
|
|
|
270
270
|
LATEST: `${exports.ROOT}/${CONTROLLERS.BLOG_CONTROLLER(constants_1.POST_TYPE.UPDATE)}/${CONTROLLERS.BLOG_ROUTES.LATEST}`,
|
|
271
271
|
COUNT: `${exports.ROOT}/${CONTROLLERS.BLOG_CONTROLLER(constants_1.POST_TYPE.UPDATE)}/${CONTROLLERS.BLOG_ROUTES.COUNT}`,
|
|
272
272
|
},
|
|
273
|
+
UPDATE_POSTS: {
|
|
274
|
+
CREATE: `${exports.ROOT}/${CONTROLLERS.UPDATE_POST_ADMIN_CONTROLLER}/${CONTROLLERS.UPDATE_POST_ROUTES.CREATE}`,
|
|
275
|
+
PATCH: (uuid) => `${exports.ROOT}/${CONTROLLERS.UPDATE_POST_ADMIN_CONTROLLER}/${CONTROLLERS.UPDATE_POST_ROUTES.UPDATE(uuid)}`,
|
|
276
|
+
GET_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.UPDATE_POST_ADMIN_CONTROLLER}/${CONTROLLERS.UPDATE_POST_ROUTES.FIND_BY_UUID(uuid)}`,
|
|
277
|
+
GET_BY_SLUG: (slug) => `${exports.ROOT}/${CONTROLLERS.UPDATE_POST_ADMIN_CONTROLLER}/${CONTROLLERS.UPDATE_POST_ROUTES.FIND_BY_SLUG(slug)}`,
|
|
278
|
+
GET_ALL: `${exports.ROOT}/${CONTROLLERS.UPDATE_POST_ADMIN_CONTROLLER}/${CONTROLLERS.UPDATE_POST_ROUTES.FIND_ALL}`,
|
|
279
|
+
GET_ALL_TRANSLATIONS: (uuid) => `${exports.ROOT}/${CONTROLLERS.UPDATE_POST_ADMIN_CONTROLLER}/${CONTROLLERS.UPDATE_POST_ROUTES.GET_ALL_TRANSLATIONS(uuid)}`,
|
|
280
|
+
CREATE_TRANSLATION: (uuid) => `${exports.ROOT}/${CONTROLLERS.UPDATE_POST_ADMIN_CONTROLLER}/${CONTROLLERS.UPDATE_POST_ROUTES.CREATE_TRANSLATION(uuid)}`,
|
|
281
|
+
UPDATE_TRANSLATION: (uuid, translationUuid) => `${exports.ROOT}/${CONTROLLERS.UPDATE_POST_ADMIN_CONTROLLER}/${CONTROLLERS.UPDATE_POST_ROUTES.UPDATE_TRANSLATION(uuid, translationUuid)}`,
|
|
282
|
+
LATEST: `${exports.ROOT}/${CONTROLLERS.UPDATE_POST_CONTROLLER}/${CONTROLLERS.UPDATE_POST_ROUTES.LATEST}`,
|
|
283
|
+
},
|
|
273
284
|
PROMOCODE: {
|
|
274
285
|
CREATE: `${exports.ROOT}/${CONTROLLERS.PROMOCODE_PRIVATE_CONTROLLER}`,
|
|
275
286
|
PATCH: (uuid) => `${exports.ROOT}/${CONTROLLERS.PROMOCODE_PRIVATE_CONTROLLER}/${uuid}`,
|
package/build/commands/index.js
CHANGED
|
@@ -46,6 +46,7 @@ __exportStar(require("./telegram-auth"), exports);
|
|
|
46
46
|
__exportStar(require("./telegram-profile"), exports);
|
|
47
47
|
__exportStar(require("./tools"), exports);
|
|
48
48
|
__exportStar(require("./unregistered-user"), exports);
|
|
49
|
+
__exportStar(require("./update-post"), exports);
|
|
49
50
|
__exportStar(require("./user"), exports);
|
|
50
51
|
__exportStar(require("./user-to-subscription"), exports);
|
|
51
52
|
__exportStar(require("./user-to-task"), exports);
|
package/build/commands/tools/marketplace-card/generate-marketplace-card-description.command.js
CHANGED
|
@@ -6,7 +6,7 @@ const models_1 = require("../../../models");
|
|
|
6
6
|
var GenerateMarketplaceCardDescriptionCommand;
|
|
7
7
|
(function (GenerateMarketplaceCardDescriptionCommand) {
|
|
8
8
|
GenerateMarketplaceCardDescriptionCommand.RequestSchema = zod_1.z.object({
|
|
9
|
-
description: zod_1.z.string().min(1),
|
|
9
|
+
description: zod_1.z.string().min(1).max(10000),
|
|
10
10
|
});
|
|
11
11
|
GenerateMarketplaceCardDescriptionCommand.ResponseSchema = zod_1.z.object({
|
|
12
12
|
data: models_1.MarketplaceCardDescriptionGenerationSchema,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateUpdatePostTranslationCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var CreateUpdatePostTranslationCommand;
|
|
7
|
+
(function (CreateUpdatePostTranslationCommand) {
|
|
8
|
+
CreateUpdatePostTranslationCommand.RequestSchema = models_1.UpdatePostTranslationSchema.pick({
|
|
9
|
+
locale: true,
|
|
10
|
+
title: true,
|
|
11
|
+
description: true,
|
|
12
|
+
image: true,
|
|
13
|
+
});
|
|
14
|
+
CreateUpdatePostTranslationCommand.RequestParamSchema = zod_1.z.object({
|
|
15
|
+
uuid: zod_1.z.string().uuid(),
|
|
16
|
+
});
|
|
17
|
+
CreateUpdatePostTranslationCommand.ResponseSchema = zod_1.z.object({
|
|
18
|
+
data: models_1.UpdatePostTranslationSchema,
|
|
19
|
+
});
|
|
20
|
+
})(CreateUpdatePostTranslationCommand || (exports.CreateUpdatePostTranslationCommand = CreateUpdatePostTranslationCommand = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateUpdatePostCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var CreateUpdatePostCommand;
|
|
7
|
+
(function (CreateUpdatePostCommand) {
|
|
8
|
+
CreateUpdatePostCommand.RequestSchema = models_1.UpdatePostSchema.pick({
|
|
9
|
+
slug: true,
|
|
10
|
+
});
|
|
11
|
+
CreateUpdatePostCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
+
data: models_1.UpdatePostSchema,
|
|
13
|
+
});
|
|
14
|
+
})(CreateUpdatePostCommand || (exports.CreateUpdatePostCommand = CreateUpdatePostCommand = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindAllUpdatePostsCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var FindAllUpdatePostsCommand;
|
|
7
|
+
(function (FindAllUpdatePostsCommand) {
|
|
8
|
+
FindAllUpdatePostsCommand.ResponseSchema = zod_1.z.object({
|
|
9
|
+
data: zod_1.z.array(models_1.UpdatePostSchema),
|
|
10
|
+
});
|
|
11
|
+
})(FindAllUpdatePostsCommand || (exports.FindAllUpdatePostsCommand = FindAllUpdatePostsCommand = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindUpdatePostCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var FindUpdatePostCommand;
|
|
7
|
+
(function (FindUpdatePostCommand) {
|
|
8
|
+
FindUpdatePostCommand.RequestUuidParamSchema = zod_1.z.object({
|
|
9
|
+
uuid: zod_1.z.string().uuid(),
|
|
10
|
+
});
|
|
11
|
+
FindUpdatePostCommand.RequestSlugParamSchema = zod_1.z.object({
|
|
12
|
+
slug: zod_1.z.string(),
|
|
13
|
+
});
|
|
14
|
+
FindUpdatePostCommand.ResponseSchema = zod_1.z.object({
|
|
15
|
+
data: models_1.UpdatePostSchema,
|
|
16
|
+
});
|
|
17
|
+
})(FindUpdatePostCommand || (exports.FindUpdatePostCommand = FindUpdatePostCommand = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetAllUpdatePostTranslationsQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var GetAllUpdatePostTranslationsQuery;
|
|
7
|
+
(function (GetAllUpdatePostTranslationsQuery) {
|
|
8
|
+
GetAllUpdatePostTranslationsQuery.RequestParamSchema = zod_1.z.object({
|
|
9
|
+
uuid: zod_1.z.string().uuid(),
|
|
10
|
+
});
|
|
11
|
+
GetAllUpdatePostTranslationsQuery.ResponseSchema = zod_1.z.object({
|
|
12
|
+
data: zod_1.z.array(models_1.UpdatePostTranslationSchema),
|
|
13
|
+
});
|
|
14
|
+
})(GetAllUpdatePostTranslationsQuery || (exports.GetAllUpdatePostTranslationsQuery = GetAllUpdatePostTranslationsQuery = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetLatestUpdatePostsCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var GetLatestUpdatePostsCommand;
|
|
7
|
+
(function (GetLatestUpdatePostsCommand) {
|
|
8
|
+
GetLatestUpdatePostsCommand.ResponseSchema = zod_1.z.object({
|
|
9
|
+
data: zod_1.z.array(models_1.UpdatePostSchema),
|
|
10
|
+
});
|
|
11
|
+
})(GetLatestUpdatePostsCommand || (exports.GetLatestUpdatePostsCommand = GetLatestUpdatePostsCommand = {}));
|
|
@@ -0,0 +1,24 @@
|
|
|
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("./create-update-post.command"), exports);
|
|
18
|
+
__exportStar(require("./create-update-post-translation.command"), exports);
|
|
19
|
+
__exportStar(require("./find-all-update-posts.command"), exports);
|
|
20
|
+
__exportStar(require("./find-update-post.command"), exports);
|
|
21
|
+
__exportStar(require("./get-all-update-post-translations.query"), exports);
|
|
22
|
+
__exportStar(require("./get-latest-update-posts.command"), exports);
|
|
23
|
+
__exportStar(require("./update-update-post.command"), exports);
|
|
24
|
+
__exportStar(require("./update-update-post-translation.command"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateUpdatePostTranslationCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var UpdateUpdatePostTranslationCommand;
|
|
7
|
+
(function (UpdateUpdatePostTranslationCommand) {
|
|
8
|
+
UpdateUpdatePostTranslationCommand.RequestSchema = models_1.UpdatePostTranslationSchema.pick({
|
|
9
|
+
title: true,
|
|
10
|
+
description: true,
|
|
11
|
+
image: true,
|
|
12
|
+
}).partial();
|
|
13
|
+
UpdateUpdatePostTranslationCommand.RequestParamSchema = zod_1.z.object({
|
|
14
|
+
uuid: zod_1.z.string().uuid(),
|
|
15
|
+
translationUuid: zod_1.z.string().uuid(),
|
|
16
|
+
});
|
|
17
|
+
UpdateUpdatePostTranslationCommand.ResponseSchema = zod_1.z.object({
|
|
18
|
+
data: models_1.UpdatePostTranslationSchema,
|
|
19
|
+
});
|
|
20
|
+
})(UpdateUpdatePostTranslationCommand || (exports.UpdateUpdatePostTranslationCommand = UpdateUpdatePostTranslationCommand = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateUpdatePostCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var UpdateUpdatePostCommand;
|
|
7
|
+
(function (UpdateUpdatePostCommand) {
|
|
8
|
+
UpdateUpdatePostCommand.RequestSchema = models_1.UpdatePostSchema.pick({
|
|
9
|
+
slug: true,
|
|
10
|
+
}).partial();
|
|
11
|
+
UpdateUpdatePostCommand.RequestParamSchema = zod_1.z.object({
|
|
12
|
+
uuid: zod_1.z.string().uuid(),
|
|
13
|
+
});
|
|
14
|
+
UpdateUpdatePostCommand.ResponseSchema = zod_1.z.object({
|
|
15
|
+
data: models_1.UpdatePostSchema,
|
|
16
|
+
});
|
|
17
|
+
})(UpdateUpdatePostCommand || (exports.UpdateUpdatePostCommand = UpdateUpdatePostCommand = {}));
|
package/build/models/index.js
CHANGED
|
@@ -66,6 +66,8 @@ __exportStar(require("./tool-group.schema"), exports);
|
|
|
66
66
|
__exportStar(require("./tool.schema"), exports);
|
|
67
67
|
__exportStar(require("./unlocked-by-subscription.schema"), exports);
|
|
68
68
|
__exportStar(require("./unregistered-user.schema"), exports);
|
|
69
|
+
__exportStar(require("./update-post.schema"), exports);
|
|
70
|
+
__exportStar(require("./update-post-translation.schema"), exports);
|
|
69
71
|
__exportStar(require("./user-task.schema"), exports);
|
|
70
72
|
__exportStar(require("./user-to-product.schema"), exports);
|
|
71
73
|
__exportStar(require("./user-to-subscription.schema"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdatePostTranslationSchema = void 0;
|
|
4
|
+
const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
exports.UpdatePostTranslationSchema = zod_1.z.object({
|
|
7
|
+
uuid: zod_1.z.string().uuid(),
|
|
8
|
+
updatePostId: zod_1.z.string().uuid(),
|
|
9
|
+
locale: zod_1.z.nativeEnum(rugpt_lib_common_1.LOCALE),
|
|
10
|
+
title: zod_1.z.string(),
|
|
11
|
+
description: zod_1.z.string(),
|
|
12
|
+
image: zod_1.z.string(),
|
|
13
|
+
createdAt: zod_1.z.date(),
|
|
14
|
+
updatedAt: zod_1.z.date(),
|
|
15
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdatePostSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.UpdatePostSchema = zod_1.z.object({
|
|
6
|
+
uuid: zod_1.z.string().uuid(),
|
|
7
|
+
slug: zod_1.z.string(),
|
|
8
|
+
title: zod_1.z.string(),
|
|
9
|
+
description: zod_1.z.string(),
|
|
10
|
+
image: zod_1.z.string(),
|
|
11
|
+
createdAt: zod_1.z.date(),
|
|
12
|
+
updatedAt: zod_1.z.date(),
|
|
13
|
+
});
|
package/commands/index.ts
CHANGED
|
@@ -30,6 +30,7 @@ export * from './telegram-auth';
|
|
|
30
30
|
export * from './telegram-profile';
|
|
31
31
|
export * from './tools';
|
|
32
32
|
export * from './unregistered-user';
|
|
33
|
+
export * from './update-post';
|
|
33
34
|
export * from './user';
|
|
34
35
|
export * from './user-to-subscription';
|
|
35
36
|
export * from './user-to-task';
|
|
@@ -3,7 +3,7 @@ import { MarketplaceCardDescriptionGenerationSchema } from '../../../models';
|
|
|
3
3
|
|
|
4
4
|
export namespace GenerateMarketplaceCardDescriptionCommand {
|
|
5
5
|
export const RequestSchema = z.object({
|
|
6
|
-
description: z.string().min(1),
|
|
6
|
+
description: z.string().min(1).max(10_000),
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
export type Request = z.infer<typeof RequestSchema>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { UpdatePostTranslationSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace CreateUpdatePostTranslationCommand {
|
|
5
|
+
export const RequestSchema = UpdatePostTranslationSchema.pick({
|
|
6
|
+
locale: true,
|
|
7
|
+
title: true,
|
|
8
|
+
description: true,
|
|
9
|
+
image: true,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
13
|
+
|
|
14
|
+
export const RequestParamSchema = z.object({
|
|
15
|
+
uuid: z.string().uuid(),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
19
|
+
|
|
20
|
+
export const ResponseSchema = z.object({
|
|
21
|
+
data: UpdatePostTranslationSchema,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { UpdatePostSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace CreateUpdatePostCommand {
|
|
5
|
+
export const RequestSchema = UpdatePostSchema.pick({
|
|
6
|
+
slug: true,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseSchema = z.object({
|
|
12
|
+
data: UpdatePostSchema,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { UpdatePostSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace FindAllUpdatePostsCommand {
|
|
5
|
+
export const ResponseSchema = z.object({
|
|
6
|
+
data: z.array(UpdatePostSchema),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { UpdatePostSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace FindUpdatePostCommand {
|
|
5
|
+
export const RequestUuidParamSchema = z.object({
|
|
6
|
+
uuid: z.string().uuid(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type RequestUuidParam = z.infer<typeof RequestUuidParamSchema>;
|
|
10
|
+
|
|
11
|
+
export const RequestSlugParamSchema = z.object({
|
|
12
|
+
slug: z.string(),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export type RequestSlugParam = z.infer<typeof RequestSlugParamSchema>;
|
|
16
|
+
|
|
17
|
+
export const ResponseSchema = z.object({
|
|
18
|
+
data: UpdatePostSchema,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { UpdatePostTranslationSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace GetAllUpdatePostTranslationsQuery {
|
|
5
|
+
export const RequestParamSchema = z.object({
|
|
6
|
+
uuid: z.string().uuid(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseSchema = z.object({
|
|
12
|
+
data: z.array(UpdatePostTranslationSchema),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { UpdatePostSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace GetLatestUpdatePostsCommand {
|
|
5
|
+
export const ResponseSchema = z.object({
|
|
6
|
+
data: z.array(UpdatePostSchema),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './create-update-post.command';
|
|
2
|
+
export * from './create-update-post-translation.command';
|
|
3
|
+
export * from './find-all-update-posts.command';
|
|
4
|
+
export * from './find-update-post.command';
|
|
5
|
+
export * from './get-all-update-post-translations.query';
|
|
6
|
+
export * from './get-latest-update-posts.command';
|
|
7
|
+
export * from './update-update-post.command';
|
|
8
|
+
export * from './update-update-post-translation.command';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { UpdatePostTranslationSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace UpdateUpdatePostTranslationCommand {
|
|
5
|
+
export const RequestSchema = UpdatePostTranslationSchema.pick({
|
|
6
|
+
title: true,
|
|
7
|
+
description: true,
|
|
8
|
+
image: true,
|
|
9
|
+
}).partial();
|
|
10
|
+
|
|
11
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
12
|
+
|
|
13
|
+
export const RequestParamSchema = z.object({
|
|
14
|
+
uuid: z.string().uuid(),
|
|
15
|
+
translationUuid: z.string().uuid(),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
19
|
+
|
|
20
|
+
export const ResponseSchema = z.object({
|
|
21
|
+
data: UpdatePostTranslationSchema,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { UpdatePostSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace UpdateUpdatePostCommand {
|
|
5
|
+
export const RequestSchema = UpdatePostSchema.pick({
|
|
6
|
+
slug: true,
|
|
7
|
+
}).partial();
|
|
8
|
+
|
|
9
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
10
|
+
|
|
11
|
+
export const RequestParamSchema = z.object({
|
|
12
|
+
uuid: z.string().uuid(),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
16
|
+
|
|
17
|
+
export const ResponseSchema = z.object({
|
|
18
|
+
data: UpdatePostSchema,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
22
|
+
}
|
package/models/index.ts
CHANGED
|
@@ -50,6 +50,8 @@ export * from './tool-group.schema';
|
|
|
50
50
|
export * from './tool.schema';
|
|
51
51
|
export * from './unlocked-by-subscription.schema';
|
|
52
52
|
export * from './unregistered-user.schema';
|
|
53
|
+
export * from './update-post.schema';
|
|
54
|
+
export * from './update-post-translation.schema';
|
|
53
55
|
export * from './user-task.schema';
|
|
54
56
|
export * from './user-to-product.schema';
|
|
55
57
|
export * from './user-to-subscription.schema';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
export const UpdatePostTranslationSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
updatePostId: z.string().uuid(),
|
|
7
|
+
locale: z.nativeEnum(LOCALE),
|
|
8
|
+
title: z.string(),
|
|
9
|
+
description: z.string(),
|
|
10
|
+
image: z.string(),
|
|
11
|
+
createdAt: z.date(),
|
|
12
|
+
updatedAt: z.date(),
|
|
13
|
+
});
|