@purpleschool/gptbot 0.10.9 → 0.11.0

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.
@@ -21,6 +21,7 @@ var BuySubscriptionCommand;
21
21
  partnerId: zod_1.z.string().uuid().optional(),
22
22
  promocode: zod_1.z.string().optional(),
23
23
  webmasterAlias: zod_1.z.string().optional(),
24
+ teamAccountPurchase: zod_1.z.boolean().optional().default(false),
24
25
  webmasterReferralProvidedAt: zod_1.z
25
26
  .preprocess((val) => (typeof val === 'string' ? new Date(val) : val), zod_1.z.date())
26
27
  .optional(),
@@ -2,12 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CancelSubscriptionCommand = void 0;
4
4
  const zod_1 = require("zod");
5
+ const constants_1 = require("../../constants");
5
6
  var CancelSubscriptionCommand;
6
7
  (function (CancelSubscriptionCommand) {
7
8
  CancelSubscriptionCommand.RequestParamSchema = zod_1.z.object({
8
- uuidSiteUserToSubscription: zod_1.z.string(),
9
+ scopeToSubscription: zod_1.z.string(),
9
10
  });
10
11
  CancelSubscriptionCommand.RequestSchema = zod_1.z.object({
12
+ scope: zod_1.z.nativeEnum(constants_1.BILLING_SCOPE),
11
13
  text: zod_1.z.string(),
12
14
  });
13
15
  CancelSubscriptionCommand.ResponseSchema = zod_1.z.void();
@@ -2,10 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RecoverSubscriptionCommand = void 0;
4
4
  const zod_1 = require("zod");
5
+ const constants_1 = require("../../constants");
5
6
  var RecoverSubscriptionCommand;
6
7
  (function (RecoverSubscriptionCommand) {
7
8
  RecoverSubscriptionCommand.RequestParamSchema = zod_1.z.object({
8
- uuidSiteUserToSubscription: zod_1.z.string(),
9
+ scopeToSubscription: zod_1.z.string(),
10
+ });
11
+ RecoverSubscriptionCommand.RequestSchema = zod_1.z.object({
12
+ scope: zod_1.z.nativeEnum(constants_1.BILLING_SCOPE),
9
13
  });
10
14
  RecoverSubscriptionCommand.ResponseSchema = zod_1.z.void();
11
15
  })(RecoverSubscriptionCommand || (exports.RecoverSubscriptionCommand = RecoverSubscriptionCommand = {}));
@@ -21,6 +21,7 @@ export namespace BuySubscriptionCommand {
21
21
  partnerId: z.string().uuid().optional(),
22
22
  promocode: z.string().optional(),
23
23
  webmasterAlias: z.string().optional(),
24
+ teamAccountPurchase: z.boolean().optional().default(false),
24
25
  webmasterReferralProvidedAt: z
25
26
  .preprocess((val) => (typeof val === 'string' ? new Date(val) : val), z.date())
26
27
  .optional(),
@@ -1,13 +1,15 @@
1
1
  import { z } from 'zod';
2
+ import { BILLING_SCOPE } from '../../constants';
2
3
 
3
4
  export namespace CancelSubscriptionCommand {
4
5
  export const RequestParamSchema = z.object({
5
- uuidSiteUserToSubscription: z.string(),
6
+ scopeToSubscription: z.string(),
6
7
  });
7
8
 
8
9
  export type RequestParam = z.infer<typeof RequestParamSchema>;
9
10
 
10
11
  export const RequestSchema = z.object({
12
+ scope: z.nativeEnum(BILLING_SCOPE),
11
13
  text: z.string(),
12
14
  });
13
15
 
@@ -1,12 +1,19 @@
1
1
  import { z } from 'zod';
2
+ import { BILLING_SCOPE } from '../../constants';
2
3
 
3
4
  export namespace RecoverSubscriptionCommand {
4
5
  export const RequestParamSchema = z.object({
5
- uuidSiteUserToSubscription: z.string(),
6
+ scopeToSubscription: z.string(),
6
7
  });
7
8
 
8
9
  export type RequestParam = z.infer<typeof RequestParamSchema>;
9
10
 
11
+ export const RequestSchema = z.object({
12
+ scope: z.nativeEnum(BILLING_SCOPE),
13
+ });
14
+
15
+ export type Request = z.infer<typeof RequestSchema>;
16
+
10
17
  export const ResponseSchema = z.void();
11
18
 
12
19
  export type Response = z.infer<typeof ResponseSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.10.9",
3
+ "version": "0.11.0",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",