@purpleschool/gptbot 0.6.16 → 0.6.17

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.
@@ -15,4 +15,5 @@ export const SUBSCRIPTION_ROUTES = {
15
15
  CREATE_CUSTOM: 'custom',
16
16
  FREE: 'free',
17
17
  SUMMARY: 'summary',
18
+ RECOVER_PAST_DUE: (uuid: string) => `${uuid}/recover-past-due`,
18
19
  } as const;
@@ -16,4 +16,5 @@ exports.SUBSCRIPTION_ROUTES = {
16
16
  CREATE_CUSTOM: 'custom',
17
17
  FREE: 'free',
18
18
  SUMMARY: 'summary',
19
+ RECOVER_PAST_DUE: (uuid) => `${uuid}/recover-past-due`,
19
20
  };
@@ -23,6 +23,7 @@ __exportStar(require("./find-subscription.command"), exports);
23
23
  __exportStar(require("./get-available-upgrades.command"), exports);
24
24
  __exportStar(require("./get-free-subscription.command"), exports);
25
25
  __exportStar(require("./get-subscriptions-summary.command"), exports);
26
+ __exportStar(require("./recover-past-due-subscription.command"), exports);
26
27
  __exportStar(require("./recover-subscription.command"), exports);
27
28
  __exportStar(require("./update-subscription.command"), exports);
28
29
  __exportStar(require("./upgrade-subscription.command"), exports);
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RecoverPastDueSubscriptionCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ var RecoverPastDueSubscriptionCommand;
6
+ (function (RecoverPastDueSubscriptionCommand) {
7
+ RecoverPastDueSubscriptionCommand.RequestParamSchema = zod_1.z.object({
8
+ uuid: zod_1.z.string().uuid(),
9
+ });
10
+ RecoverPastDueSubscriptionCommand.ResponseSchema = zod_1.z.object({
11
+ message: zod_1.z.string(),
12
+ });
13
+ })(RecoverPastDueSubscriptionCommand || (exports.RecoverPastDueSubscriptionCommand = RecoverPastDueSubscriptionCommand = {}));
@@ -1493,4 +1493,9 @@ exports.ERRORS = {
1493
1493
  message: 'Промпт тема с таким alias уже существует',
1494
1494
  httpCode: 409,
1495
1495
  },
1496
+ SUBSCRIPTION_NOT_PAST_DUE: {
1497
+ code: 'A320',
1498
+ message: 'Подписка не требует повторной оплаты',
1499
+ httpCode: 400,
1500
+ },
1496
1501
  };
@@ -6,4 +6,5 @@ var USER_TO_SUBSCRIPTION_MARKS;
6
6
  USER_TO_SUBSCRIPTION_MARKS["WITHOUT_AUTO_RENEWAL"] = "WITHOUT_AUTO_RENEWAL";
7
7
  USER_TO_SUBSCRIPTION_MARKS["MOCK"] = "MOCK";
8
8
  USER_TO_SUBSCRIPTION_MARKS["SENT_RENEWAL_REMINDER"] = "SENT_RENEWAL_REMINDER";
9
+ USER_TO_SUBSCRIPTION_MARKS["SENT_PAST_DUE_RECOVER_REQUEST"] = "SENT_PAST_DUE_RECOVER_REQUEST";
9
10
  })(USER_TO_SUBSCRIPTION_MARKS || (exports.USER_TO_SUBSCRIPTION_MARKS = USER_TO_SUBSCRIPTION_MARKS = {}));
@@ -7,6 +7,7 @@ export * from './find-subscription.command';
7
7
  export * from './get-available-upgrades.command';
8
8
  export * from './get-free-subscription.command';
9
9
  export * from './get-subscriptions-summary.command';
10
+ export * from './recover-past-due-subscription.command';
10
11
  export * from './recover-subscription.command';
11
12
  export * from './update-subscription.command';
12
13
  export * from './upgrade-subscription.command';
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace RecoverPastDueSubscriptionCommand {
4
+ export const RequestParamSchema = z.object({
5
+ uuid: z.string().uuid(),
6
+ });
7
+
8
+ export type RequestParam = z.infer<typeof RequestParamSchema>;
9
+
10
+ export const ResponseSchema = z.object({
11
+ message: z.string(),
12
+ });
13
+
14
+ export type Response = z.infer<typeof ResponseSchema>;
15
+ }
@@ -1500,4 +1500,9 @@ export const ERRORS = {
1500
1500
  message: 'Промпт тема с таким alias уже существует',
1501
1501
  httpCode: 409,
1502
1502
  },
1503
+ SUBSCRIPTION_NOT_PAST_DUE: {
1504
+ code: 'A320',
1505
+ message: 'Подписка не требует повторной оплаты',
1506
+ httpCode: 400,
1507
+ },
1503
1508
  };
@@ -2,4 +2,5 @@ export enum USER_TO_SUBSCRIPTION_MARKS {
2
2
  WITHOUT_AUTO_RENEWAL = 'WITHOUT_AUTO_RENEWAL',
3
3
  MOCK = 'MOCK',
4
4
  SENT_RENEWAL_REMINDER = 'SENT_RENEWAL_REMINDER',
5
+ SENT_PAST_DUE_RECOVER_REQUEST = 'SENT_PAST_DUE_RECOVER_REQUEST',
5
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.6.16",
3
+ "version": "0.6.17",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",