@purpleschool/gptbot 0.17.0-stage-2 → 0.17.1-stage-2

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 (46) hide show
  1. package/build/api/controllers/http/index.d.ts +1 -0
  2. package/build/api/controllers/http/index.js +1 -0
  3. package/build/api/controllers/http/loyalty-status.d.ts +4 -0
  4. package/build/api/controllers/http/loyalty-status.js +7 -0
  5. package/build/api/routes.d.ts +3 -0
  6. package/build/api/routes.js +3 -0
  7. package/build/commands/subscription/get-subscriptions-summary.command.d.ts +16 -0
  8. package/build/commands/subscription/get-subscriptions-summary.command.js +1 -0
  9. package/build/commands/tools/marketplace-card/execute-marketplace-card.command.d.ts +1 -0
  10. package/build/commands/tools/marketplace-card/find-marketplace-card-job-by-uuid.command.d.ts +1 -0
  11. package/build/commands/tools/marketplace-card/find-marketplace-card-jobs.command.d.ts +1 -0
  12. package/build/commands/tools/marketplace-card/retry-marketplace-card-job.command.d.ts +1 -0
  13. package/build/commands/tools/marketplace-card/set-reaction-to-marketplace-card.command.d.ts +1 -0
  14. package/build/commands/tools/marketplace-card/update-marketplace-card-job-favorite.command.d.ts +1 -0
  15. package/build/commands/tools/marketplace-card/update-marketplace-card-job-title.command.d.ts +1 -0
  16. package/build/commands/tools/tool-workspace/find-tool-workspace-by-uuid.command.d.ts +3 -0
  17. package/build/commands/tools/tool-workspace/find-tool-workspaces.command.d.ts +5 -1
  18. package/build/commands/tools/tool-workspace/find-tool-workspaces.command.js +3 -0
  19. package/build/commands/tools/tool-workspace/update-tool-workspace.command.d.ts +3 -0
  20. package/build/commands/tools/tool-workspace/update-tool-workspace.command.js +1 -0
  21. package/build/commands/user/get-me.command.d.ts +16 -0
  22. package/build/commands/user/get-me.command.js +1 -0
  23. package/build/constants/index.d.ts +1 -0
  24. package/build/constants/index.js +1 -0
  25. package/build/constants/loyalty-status/enums/index.d.ts +1 -0
  26. package/build/constants/loyalty-status/enums/index.js +17 -0
  27. package/build/constants/loyalty-status/enums/loyalty-level.enum.d.ts +7 -0
  28. package/build/constants/loyalty-status/enums/loyalty-level.enum.js +11 -0
  29. package/build/constants/loyalty-status/index.d.ts +3 -0
  30. package/build/constants/loyalty-status/index.js +19 -0
  31. package/build/constants/loyalty-status/loyalty-levels.constant.d.ts +6 -0
  32. package/build/constants/loyalty-status/loyalty-levels.constant.js +11 -0
  33. package/build/constants/loyalty-status/loyalty-win-back.constant.d.ts +1 -0
  34. package/build/constants/loyalty-status/loyalty-win-back.constant.js +4 -0
  35. package/build/models/index.d.ts +1 -0
  36. package/build/models/index.js +1 -0
  37. package/build/models/tools/marketplace-card/marketplace-card-job.schema.d.ts +1 -0
  38. package/build/models/tools/marketplace-card/marketplace-card-job.schema.js +1 -0
  39. package/build/models/tools/tool-workspace/tool-workspace-contents.schema.d.ts +3 -0
  40. package/build/models/tools/tool-workspace/tool-workspace-item.schema.d.ts +1 -0
  41. package/build/models/tools/tool-workspace/tool-workspace-job.schema.d.ts +1 -0
  42. package/build/models/tools/tool-workspace/tool-workspace.schema.d.ts +2 -0
  43. package/build/models/tools/tool-workspace/tool-workspace.schema.js +2 -0
  44. package/build/models/user-loyalty-status.schema.d.ts +19 -0
  45. package/build/models/user-loyalty-status.schema.js +21 -0
  46. package/package.json +1 -1
@@ -61,6 +61,7 @@ export * from './writer';
61
61
  export * from './image-editor';
62
62
  export * from './image-recognition';
63
63
  export * from './daily-streak';
64
+ export * from './loyalty-status';
64
65
  export * from './cabinet';
65
66
  export * from './webmaster';
66
67
  export * from './music';
@@ -77,6 +77,7 @@ __exportStar(require("./writer"), exports);
77
77
  __exportStar(require("./image-editor"), exports);
78
78
  __exportStar(require("./image-recognition"), exports);
79
79
  __exportStar(require("./daily-streak"), exports);
80
+ __exportStar(require("./loyalty-status"), exports);
80
81
  __exportStar(require("./cabinet"), exports);
81
82
  __exportStar(require("./webmaster"), exports);
82
83
  __exportStar(require("./music"), exports);
@@ -0,0 +1,4 @@
1
+ export declare const LOYALTY_STATUS_CONTROLLER: 'loyalty-status';
2
+ export declare const LOYALTY_STATUS_ROUTES: {
3
+ readonly CRON_RUN_LIFECYCLE: 'cron/run-lifecycle';
4
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LOYALTY_STATUS_ROUTES = exports.LOYALTY_STATUS_CONTROLLER = void 0;
4
+ exports.LOYALTY_STATUS_CONTROLLER = 'loyalty-status';
5
+ exports.LOYALTY_STATUS_ROUTES = {
6
+ CRON_RUN_LIFECYCLE: 'cron/run-lifecycle',
7
+ };
@@ -490,6 +490,9 @@ export declare const REST_API: {
490
490
  readonly GET: "/api/private/daily-streak/";
491
491
  readonly COLLECT: "/api/private/daily-streak/collect";
492
492
  };
493
+ readonly LOYALTY_STATUS: {
494
+ readonly CRON_RUN_LIFECYCLE: "/api/loyalty-status/cron/run-lifecycle";
495
+ };
493
496
  readonly CABINET: {
494
497
  readonly GET_USER_STATISTICS_OVERVIEW: "/api/private/cabinet/statistics/overview";
495
498
  readonly GET_USER_STATISTICS_BY_MONTH: "/api/private/cabinet/statistics/by-month";
@@ -528,6 +528,9 @@ exports.REST_API = {
528
528
  GET: `${exports.ROOT}/${CONTROLLERS.DAILY_STREAK_PRIVATE_CONTROLLER}/${CONTROLLERS.DAILY_STREAK_ROUTES.GET}`,
529
529
  COLLECT: `${exports.ROOT}/${CONTROLLERS.DAILY_STREAK_PRIVATE_CONTROLLER}/${CONTROLLERS.DAILY_STREAK_ROUTES.COLLECT}`,
530
530
  },
531
+ LOYALTY_STATUS: {
532
+ CRON_RUN_LIFECYCLE: `${exports.ROOT}/${CONTROLLERS.LOYALTY_STATUS_CONTROLLER}/${CONTROLLERS.LOYALTY_STATUS_ROUTES.CRON_RUN_LIFECYCLE}`,
533
+ },
531
534
  CABINET: {
532
535
  GET_USER_STATISTICS_OVERVIEW: `${exports.ROOT}/${CONTROLLERS.CABINET_CONTROLLER}/${CONTROLLERS.CABINET_ROUTES.GET_USER_STATISTICS_OVERVIEW}`,
533
536
  GET_USER_STATISTICS_BY_MONTH: `${exports.ROOT}/${CONTROLLERS.CABINET_CONTROLLER}/${CONTROLLERS.CABINET_ROUTES.GET_USER_STATISTICS_BY_MONTH}`,
@@ -1641,6 +1641,22 @@ export declare namespace GetSubscriptionsSummaryCommand {
1641
1641
  updatedAt: z.ZodDate;
1642
1642
  }, z.core.$strip>;
1643
1643
  }, z.core.$strip>>>;
1644
+ loyaltyStatus: z.ZodObject<{
1645
+ level: z.ZodEnum<typeof import("../..").LOYALTY_LEVEL>;
1646
+ paidMonths: z.ZodNumber;
1647
+ renewalBonusPercent: z.ZodNumber;
1648
+ nextLevel: z.ZodNullable<z.ZodEnum<typeof import("../..").LOYALTY_LEVEL>>;
1649
+ nextLevelThresholdMonths: z.ZodNullable<z.ZodNumber>;
1650
+ nextLevelRenewalBonusPercent: z.ZodNullable<z.ZodNumber>;
1651
+ monthsToNextLevel: z.ZodNullable<z.ZodNumber>;
1652
+ isLapsed: z.ZodBoolean;
1653
+ winBackDeadline: z.ZodNullable<z.ZodDate>;
1654
+ levels: z.ZodArray<z.ZodObject<{
1655
+ level: z.ZodEnum<typeof import("../..").LOYALTY_LEVEL>;
1656
+ thresholdMonths: z.ZodNumber;
1657
+ renewalBonusPercent: z.ZodNumber;
1658
+ }, z.core.$strip>>;
1659
+ }, z.core.$strip>;
1644
1660
  }, z.core.$strip>;
1645
1661
  type Response = z.infer<typeof ResponseSchema>;
1646
1662
  }
@@ -10,5 +10,6 @@ var GetSubscriptionsSummaryCommand;
10
10
  subscriptions: zod_1.z.array(models_1.UserToSubscriptionWithDowngradeSubscriptionSchema),
11
11
  products: zod_1.z.array(models_1.UserToProductWithProductSchema),
12
12
  teamSubscription: models_1.TeamToSubscriptionWithSubscriptionSchema.nullable(),
13
+ loyaltyStatus: models_1.UserLoyaltyStatusResponseSchema,
13
14
  });
14
15
  })(GetSubscriptionsSummaryCommand || (exports.GetSubscriptionsSummaryCommand = GetSubscriptionsSummaryCommand = {}));
@@ -28,6 +28,7 @@ export declare namespace ExecuteMarketplaceCardCommand {
28
28
  createdAt: z.ZodCoercedDate<unknown>;
29
29
  updatedAt: z.ZodCoercedDate<unknown>;
30
30
  uuid: z.ZodUUID;
31
+ modelId: z.ZodUUID;
31
32
  title: z.ZodNullable<z.ZodString>;
32
33
  subtitle: z.ZodNullable<z.ZodString>;
33
34
  reaction: z.ZodNullable<z.ZodEnum<typeof import("../../..").USER_REACTION>>;
@@ -12,6 +12,7 @@ export declare namespace FindMarketplaceCardJobByUUIDCommand {
12
12
  createdAt: z.ZodCoercedDate<unknown>;
13
13
  updatedAt: z.ZodCoercedDate<unknown>;
14
14
  uuid: z.ZodUUID;
15
+ modelId: z.ZodUUID;
15
16
  title: z.ZodNullable<z.ZodString>;
16
17
  subtitle: z.ZodNullable<z.ZodString>;
17
18
  reaction: z.ZodNullable<z.ZodEnum<typeof import("../../..").USER_REACTION>>;
@@ -18,6 +18,7 @@ export declare namespace FindMarketplaceCardJobsCommand {
18
18
  createdAt: z.ZodCoercedDate<unknown>;
19
19
  updatedAt: z.ZodCoercedDate<unknown>;
20
20
  uuid: z.ZodUUID;
21
+ modelId: z.ZodUUID;
21
22
  title: z.ZodNullable<z.ZodString>;
22
23
  subtitle: z.ZodNullable<z.ZodString>;
23
24
  reaction: z.ZodNullable<z.ZodEnum<typeof import("../../..").USER_REACTION>>;
@@ -25,6 +25,7 @@ export declare namespace RetryMarketplaceCardJobCommand {
25
25
  createdAt: z.ZodCoercedDate<unknown>;
26
26
  updatedAt: z.ZodCoercedDate<unknown>;
27
27
  uuid: z.ZodUUID;
28
+ modelId: z.ZodUUID;
28
29
  title: z.ZodNullable<z.ZodString>;
29
30
  subtitle: z.ZodNullable<z.ZodString>;
30
31
  reaction: z.ZodNullable<z.ZodEnum<typeof import("../../..").USER_REACTION>>;
@@ -18,6 +18,7 @@ export declare namespace SetReactionToMarketplaceCardJobCommand {
18
18
  createdAt: z.ZodCoercedDate<unknown>;
19
19
  updatedAt: z.ZodCoercedDate<unknown>;
20
20
  uuid: z.ZodUUID;
21
+ modelId: z.ZodUUID;
21
22
  title: z.ZodNullable<z.ZodString>;
22
23
  subtitle: z.ZodNullable<z.ZodString>;
23
24
  reaction: z.ZodNullable<z.ZodEnum<typeof USER_REACTION>>;
@@ -16,6 +16,7 @@ export declare namespace UpdateMarketplaceCardJobFavoriteCommand {
16
16
  createdAt: z.ZodCoercedDate<unknown>;
17
17
  updatedAt: z.ZodCoercedDate<unknown>;
18
18
  uuid: z.ZodUUID;
19
+ modelId: z.ZodUUID;
19
20
  title: z.ZodNullable<z.ZodString>;
20
21
  subtitle: z.ZodNullable<z.ZodString>;
21
22
  reaction: z.ZodNullable<z.ZodEnum<typeof import("../../..").USER_REACTION>>;
@@ -16,6 +16,7 @@ export declare namespace UpdateMarketplaceCardJobTitleCommand {
16
16
  createdAt: z.ZodCoercedDate<unknown>;
17
17
  updatedAt: z.ZodCoercedDate<unknown>;
18
18
  uuid: z.ZodUUID;
19
+ modelId: z.ZodUUID;
19
20
  title: z.ZodNullable<z.ZodString>;
20
21
  subtitle: z.ZodNullable<z.ZodString>;
21
22
  reaction: z.ZodNullable<z.ZodEnum<typeof import("../../..").USER_REACTION>>;
@@ -11,6 +11,8 @@ export declare namespace FindToolWorkspaceByUUIDCommand {
11
11
  toolType: z.ZodEnum<typeof import("../../..").TOOL_CONTENT_TYPE>;
12
12
  title: z.ZodString;
13
13
  coverUrl: z.ZodNullable<z.ZodString>;
14
+ isFavorite: z.ZodBoolean;
15
+ pendingJobsCount: z.ZodOptional<z.ZodNumber>;
14
16
  status: z.ZodEnum<typeof import("../../..").TOOL_WORKSPACE_STATUS>;
15
17
  userId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
16
18
  unregisteredUserId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
@@ -32,6 +34,7 @@ export declare namespace FindToolWorkspaceByUUIDCommand {
32
34
  createdAt: z.ZodCoercedDate<unknown>;
33
35
  updatedAt: z.ZodCoercedDate<unknown>;
34
36
  uuid: z.ZodUUID;
37
+ modelId: z.ZodUUID;
35
38
  title: z.ZodNullable<z.ZodString>;
36
39
  subtitle: z.ZodNullable<z.ZodString>;
37
40
  reaction: z.ZodNullable<z.ZodEnum<typeof import("../../..").USER_REACTION>>;
@@ -1,11 +1,13 @@
1
1
  import { z } from 'zod';
2
- import { TOOL_CONTENT_TYPE } from '../../../constants';
2
+ import { JOB_SORT, TOOL_CONTENT_TYPE } from '../../../constants';
3
3
  export declare namespace FindToolWorkspacesCommand {
4
4
  const RequestQuerySchema: z.ZodObject<{
5
5
  toolType: z.ZodOptional<z.ZodEnum<typeof TOOL_CONTENT_TYPE>>;
6
6
  title: z.ZodOptional<z.ZodString>;
7
+ isFavorite: z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>;
7
8
  limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
8
9
  offset: z.ZodOptional<z.ZodDefault<z.ZodCoercedNumber<unknown>>>;
10
+ updatedAtSortOrder: z.ZodDefault<z.ZodOptional<z.ZodEnum<typeof JOB_SORT>>>;
9
11
  }, z.core.$strip>;
10
12
  type RequestQuery = z.infer<typeof RequestQuerySchema>;
11
13
  const ResponseSchema: z.ZodObject<{
@@ -14,6 +16,8 @@ export declare namespace FindToolWorkspacesCommand {
14
16
  toolType: z.ZodEnum<typeof TOOL_CONTENT_TYPE>;
15
17
  title: z.ZodString;
16
18
  coverUrl: z.ZodNullable<z.ZodString>;
19
+ isFavorite: z.ZodBoolean;
20
+ pendingJobsCount: z.ZodOptional<z.ZodNumber>;
17
21
  status: z.ZodEnum<typeof import("../../..").TOOL_WORKSPACE_STATUS>;
18
22
  userId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
19
23
  unregisteredUserId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
@@ -3,14 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FindToolWorkspacesCommand = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const constants_1 = require("../../../constants");
6
+ const query_boolean_schema_1 = require("../../../helpers/query-boolean.schema");
6
7
  const models_1 = require("../../../models");
7
8
  var FindToolWorkspacesCommand;
8
9
  (function (FindToolWorkspacesCommand) {
9
10
  FindToolWorkspacesCommand.RequestQuerySchema = zod_1.z.object({
10
11
  toolType: zod_1.z.enum(constants_1.TOOL_CONTENT_TYPE).optional(),
11
12
  title: zod_1.z.string().optional(),
13
+ isFavorite: query_boolean_schema_1.QueryBooleanSchema.optional(),
12
14
  limit: zod_1.z.coerce.number().min(1).optional(),
13
15
  offset: zod_1.z.coerce.number().min(0).default(0).optional(),
16
+ updatedAtSortOrder: zod_1.z.enum(constants_1.JOB_SORT).optional().default(constants_1.JOB_SORT.DESC),
14
17
  });
15
18
  FindToolWorkspacesCommand.ResponseSchema = zod_1.z.object({
16
19
  data: zod_1.z.array(models_1.ToolWorkspaceSchema),
@@ -4,6 +4,7 @@ export declare namespace UpdateToolWorkspaceCommand {
4
4
  const RequestSchema: z.ZodObject<{
5
5
  title: z.ZodOptional<z.ZodString>;
6
6
  coverUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7
+ isFavorite: z.ZodOptional<z.ZodBoolean>;
7
8
  status: z.ZodOptional<z.ZodEnum<typeof TOOL_WORKSPACE_STATUS>>;
8
9
  }, z.core.$strip>;
9
10
  type Request = z.infer<typeof RequestSchema>;
@@ -17,6 +18,8 @@ export declare namespace UpdateToolWorkspaceCommand {
17
18
  toolType: z.ZodEnum<typeof import("../../..").TOOL_CONTENT_TYPE>;
18
19
  title: z.ZodString;
19
20
  coverUrl: z.ZodNullable<z.ZodString>;
21
+ isFavorite: z.ZodBoolean;
22
+ pendingJobsCount: z.ZodOptional<z.ZodNumber>;
20
23
  status: z.ZodEnum<typeof TOOL_WORKSPACE_STATUS>;
21
24
  userId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
22
25
  unregisteredUserId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
@@ -9,6 +9,7 @@ var UpdateToolWorkspaceCommand;
9
9
  UpdateToolWorkspaceCommand.RequestSchema = zod_1.z.object({
10
10
  title: zod_1.z.string().min(1).optional(),
11
11
  coverUrl: zod_1.z.string().nullable().optional(),
12
+ isFavorite: zod_1.z.boolean().optional(),
12
13
  status: zod_1.z.enum(constants_1.TOOL_WORKSPACE_STATUS).optional(),
13
14
  });
14
15
  UpdateToolWorkspaceCommand.RequestParamsSchema = zod_1.z.object({
@@ -27,6 +27,22 @@ export declare namespace GetMeCommand {
27
27
  avatarKey: z.ZodNullable<z.ZodString>;
28
28
  isPremium: z.ZodBoolean;
29
29
  }, z.core.$strip>;
30
+ loyaltyStatus: z.ZodObject<{
31
+ level: z.ZodEnum<typeof import("../..").LOYALTY_LEVEL>;
32
+ paidMonths: z.ZodNumber;
33
+ renewalBonusPercent: z.ZodNumber;
34
+ nextLevel: z.ZodNullable<z.ZodEnum<typeof import("../..").LOYALTY_LEVEL>>;
35
+ nextLevelThresholdMonths: z.ZodNullable<z.ZodNumber>;
36
+ nextLevelRenewalBonusPercent: z.ZodNullable<z.ZodNumber>;
37
+ monthsToNextLevel: z.ZodNullable<z.ZodNumber>;
38
+ isLapsed: z.ZodBoolean;
39
+ winBackDeadline: z.ZodNullable<z.ZodDate>;
40
+ levels: z.ZodArray<z.ZodObject<{
41
+ level: z.ZodEnum<typeof import("../..").LOYALTY_LEVEL>;
42
+ thresholdMonths: z.ZodNumber;
43
+ renewalBonusPercent: z.ZodNumber;
44
+ }, z.core.$strip>>;
45
+ }, z.core.$strip>;
30
46
  }, z.core.$strip>;
31
47
  }, z.core.$strip>;
32
48
  type Response = z.infer<typeof ResponseSchema>;
@@ -21,6 +21,7 @@ var GetMeCommand;
21
21
  locale: zod_1.z.enum(rugpt_lib_common_1.LOCALE),
22
22
  digitalProcessingConsent: zod_1.z.boolean(),
23
23
  profile: models_1.UserProfileResponseSchema,
24
+ loyaltyStatus: models_1.UserLoyaltyStatusResponseSchema,
24
25
  }),
25
26
  });
26
27
  })(GetMeCommand || (exports.GetMeCommand = GetMeCommand = {}));
@@ -48,6 +48,7 @@ export * from './tool-interior-design';
48
48
  export * from './tool-html-page-builder';
49
49
  export * from './feedback';
50
50
  export * from './daily-streak';
51
+ export * from './loyalty-status';
51
52
  export * from './cabinet';
52
53
  export * from './canvas-node';
53
54
  export * from './canvas-edge';
@@ -64,6 +64,7 @@ __exportStar(require("./tool-interior-design"), exports);
64
64
  __exportStar(require("./tool-html-page-builder"), exports);
65
65
  __exportStar(require("./feedback"), exports);
66
66
  __exportStar(require("./daily-streak"), exports);
67
+ __exportStar(require("./loyalty-status"), exports);
67
68
  __exportStar(require("./cabinet"), exports);
68
69
  __exportStar(require("./canvas-node"), exports);
69
70
  __exportStar(require("./canvas-edge"), exports);
@@ -0,0 +1 @@
1
+ export * from './loyalty-level.enum';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./loyalty-level.enum"), exports);
@@ -0,0 +1,7 @@
1
+ export declare enum LOYALTY_LEVEL {
2
+ NONE = "none",
3
+ BRONZE = "bronze",
4
+ SILVER = "silver",
5
+ GOLD = "gold",
6
+ PLATINUM = "platinum"
7
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LOYALTY_LEVEL = void 0;
4
+ var LOYALTY_LEVEL;
5
+ (function (LOYALTY_LEVEL) {
6
+ LOYALTY_LEVEL["NONE"] = "none";
7
+ LOYALTY_LEVEL["BRONZE"] = "bronze";
8
+ LOYALTY_LEVEL["SILVER"] = "silver";
9
+ LOYALTY_LEVEL["GOLD"] = "gold";
10
+ LOYALTY_LEVEL["PLATINUM"] = "platinum";
11
+ })(LOYALTY_LEVEL || (exports.LOYALTY_LEVEL = LOYALTY_LEVEL = {}));
@@ -0,0 +1,3 @@
1
+ export * from './enums';
2
+ export * from './loyalty-levels.constant';
3
+ export * from './loyalty-win-back.constant';
@@ -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("./enums"), exports);
18
+ __exportStar(require("./loyalty-levels.constant"), exports);
19
+ __exportStar(require("./loyalty-win-back.constant"), exports);
@@ -0,0 +1,6 @@
1
+ import { LOYALTY_LEVEL } from './enums';
2
+ export declare const LOYALTY_LEVELS: ReadonlyArray<{
3
+ level: LOYALTY_LEVEL;
4
+ thresholdMonths: number;
5
+ renewalBonusPercent: number;
6
+ }>;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LOYALTY_LEVELS = void 0;
4
+ const enums_1 = require("./enums");
5
+ exports.LOYALTY_LEVELS = [
6
+ { level: enums_1.LOYALTY_LEVEL.NONE, thresholdMonths: 0, renewalBonusPercent: 0 },
7
+ { level: enums_1.LOYALTY_LEVEL.BRONZE, thresholdMonths: 3, renewalBonusPercent: 5 },
8
+ { level: enums_1.LOYALTY_LEVEL.SILVER, thresholdMonths: 6, renewalBonusPercent: 10 },
9
+ { level: enums_1.LOYALTY_LEVEL.GOLD, thresholdMonths: 12, renewalBonusPercent: 15 },
10
+ { level: enums_1.LOYALTY_LEVEL.PLATINUM, thresholdMonths: 24, renewalBonusPercent: 20 },
11
+ ];
@@ -0,0 +1 @@
1
+ export declare const LOYALTY_WIN_BACK_DAYS = 30;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LOYALTY_WIN_BACK_DAYS = void 0;
4
+ exports.LOYALTY_WIN_BACK_DAYS = 30;
@@ -85,3 +85,4 @@ export * from './b2b';
85
85
  export * from './json-value.schema';
86
86
  export * from './team-account';
87
87
  export * from './canvas-template.schema';
88
+ export * from './user-loyalty-status.schema';
@@ -101,3 +101,4 @@ __exportStar(require("./b2b"), exports);
101
101
  __exportStar(require("./json-value.schema"), exports);
102
102
  __exportStar(require("./team-account"), exports);
103
103
  __exportStar(require("./canvas-template.schema"), exports);
104
+ __exportStar(require("./user-loyalty-status.schema"), exports);
@@ -25,6 +25,7 @@ export declare const MarketplaceCardJobSchema: z.ZodObject<{
25
25
  createdAt: z.ZodCoercedDate<unknown>;
26
26
  updatedAt: z.ZodCoercedDate<unknown>;
27
27
  uuid: z.ZodUUID;
28
+ modelId: z.ZodUUID;
28
29
  title: z.ZodNullable<z.ZodString>;
29
30
  subtitle: z.ZodNullable<z.ZodString>;
30
31
  reaction: z.ZodNullable<z.ZodEnum<typeof USER_REACTION>>;
@@ -18,6 +18,7 @@ exports.MarketplaceCardJobAttachmentsSchema = zod_1.z.object({
18
18
  });
19
19
  exports.MarketplaceCardJobSchema = tool_job_schema_1.ToolJobSchema.extend({
20
20
  uuid: zod_1.z.uuid(),
21
+ modelId: zod_1.z.uuid(),
21
22
  title: zod_1.z.string().nullable(),
22
23
  subtitle: zod_1.z.string().nullable(),
23
24
  reaction: zod_1.z.enum(constants_1.USER_REACTION).nullable(),
@@ -5,6 +5,8 @@ export declare const ToolWorkspaceContentsSchema: z.ZodObject<{
5
5
  toolType: z.ZodEnum<typeof import("../../..").TOOL_CONTENT_TYPE>;
6
6
  title: z.ZodString;
7
7
  coverUrl: z.ZodNullable<z.ZodString>;
8
+ isFavorite: z.ZodBoolean;
9
+ pendingJobsCount: z.ZodOptional<z.ZodNumber>;
8
10
  status: z.ZodEnum<typeof import("../../..").TOOL_WORKSPACE_STATUS>;
9
11
  userId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
10
12
  unregisteredUserId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
@@ -26,6 +28,7 @@ export declare const ToolWorkspaceContentsSchema: z.ZodObject<{
26
28
  createdAt: z.ZodCoercedDate<unknown>;
27
29
  updatedAt: z.ZodCoercedDate<unknown>;
28
30
  uuid: z.ZodUUID;
31
+ modelId: z.ZodUUID;
29
32
  title: z.ZodNullable<z.ZodString>;
30
33
  subtitle: z.ZodNullable<z.ZodString>;
31
34
  reaction: z.ZodNullable<z.ZodEnum<typeof import("../../..").USER_REACTION>>;
@@ -15,6 +15,7 @@ export declare const ToolWorkspaceItemSchema: z.ZodObject<{
15
15
  createdAt: z.ZodCoercedDate<unknown>;
16
16
  updatedAt: z.ZodCoercedDate<unknown>;
17
17
  uuid: z.ZodUUID;
18
+ modelId: z.ZodUUID;
18
19
  title: z.ZodNullable<z.ZodString>;
19
20
  subtitle: z.ZodNullable<z.ZodString>;
20
21
  reaction: z.ZodNullable<z.ZodEnum<typeof import("../../..").USER_REACTION>>;
@@ -9,6 +9,7 @@ export declare const ToolWorkspaceJobSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
9
9
  createdAt: z.ZodCoercedDate<unknown>;
10
10
  updatedAt: z.ZodCoercedDate<unknown>;
11
11
  uuid: z.ZodUUID;
12
+ modelId: z.ZodUUID;
12
13
  title: z.ZodNullable<z.ZodString>;
13
14
  subtitle: z.ZodNullable<z.ZodString>;
14
15
  reaction: z.ZodNullable<z.ZodEnum<typeof import("../../..").USER_REACTION>>;
@@ -5,6 +5,8 @@ export declare const ToolWorkspaceSchema: z.ZodObject<{
5
5
  toolType: z.ZodEnum<typeof TOOL_CONTENT_TYPE>;
6
6
  title: z.ZodString;
7
7
  coverUrl: z.ZodNullable<z.ZodString>;
8
+ isFavorite: z.ZodBoolean;
9
+ pendingJobsCount: z.ZodOptional<z.ZodNumber>;
8
10
  status: z.ZodEnum<typeof TOOL_WORKSPACE_STATUS>;
9
11
  userId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
10
12
  unregisteredUserId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
@@ -8,6 +8,8 @@ exports.ToolWorkspaceSchema = zod_1.z.object({
8
8
  toolType: zod_1.z.enum(constants_1.TOOL_CONTENT_TYPE),
9
9
  title: zod_1.z.string(),
10
10
  coverUrl: zod_1.z.string().nullable(),
11
+ isFavorite: zod_1.z.boolean(),
12
+ pendingJobsCount: zod_1.z.number().int().nonnegative().optional(),
11
13
  status: zod_1.z.enum(constants_1.TOOL_WORKSPACE_STATUS),
12
14
  userId: zod_1.z.uuid().nullable().optional(),
13
15
  unregisteredUserId: zod_1.z.uuid().nullable().optional(),
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ import { LOYALTY_LEVEL } from '../constants';
3
+ export declare const UserLoyaltyStatusResponseSchema: z.ZodObject<{
4
+ level: z.ZodEnum<typeof LOYALTY_LEVEL>;
5
+ paidMonths: z.ZodNumber;
6
+ renewalBonusPercent: z.ZodNumber;
7
+ nextLevel: z.ZodNullable<z.ZodEnum<typeof LOYALTY_LEVEL>>;
8
+ nextLevelThresholdMonths: z.ZodNullable<z.ZodNumber>;
9
+ nextLevelRenewalBonusPercent: z.ZodNullable<z.ZodNumber>;
10
+ monthsToNextLevel: z.ZodNullable<z.ZodNumber>;
11
+ isLapsed: z.ZodBoolean;
12
+ winBackDeadline: z.ZodNullable<z.ZodDate>;
13
+ levels: z.ZodArray<z.ZodObject<{
14
+ level: z.ZodEnum<typeof LOYALTY_LEVEL>;
15
+ thresholdMonths: z.ZodNumber;
16
+ renewalBonusPercent: z.ZodNumber;
17
+ }, z.core.$strip>>;
18
+ }, z.core.$strip>;
19
+ export type UserLoyaltyStatusResponse = z.infer<typeof UserLoyaltyStatusResponseSchema>;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserLoyaltyStatusResponseSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../constants");
6
+ exports.UserLoyaltyStatusResponseSchema = zod_1.z.object({
7
+ level: zod_1.z.enum(constants_1.LOYALTY_LEVEL),
8
+ paidMonths: zod_1.z.number().int(),
9
+ renewalBonusPercent: zod_1.z.number().int(),
10
+ nextLevel: zod_1.z.enum(constants_1.LOYALTY_LEVEL).nullable(),
11
+ nextLevelThresholdMonths: zod_1.z.number().int().nullable(),
12
+ nextLevelRenewalBonusPercent: zod_1.z.number().int().nullable(),
13
+ monthsToNextLevel: zod_1.z.number().int().nullable(),
14
+ isLapsed: zod_1.z.boolean(),
15
+ winBackDeadline: zod_1.z.date().nullable(),
16
+ levels: zod_1.z.array(zod_1.z.object({
17
+ level: zod_1.z.enum(constants_1.LOYALTY_LEVEL),
18
+ thresholdMonths: zod_1.z.number().int(),
19
+ renewalBonusPercent: zod_1.z.number().int(),
20
+ })),
21
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.17.0-stage-2",
3
+ "version": "0.17.1-stage-2",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",