@purpleschool/multisite 0.0.20 → 0.0.21

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 (51) hide show
  1. package/api/controller/http/payment.ts +1 -0
  2. package/api/controller/http/product.ts +2 -0
  3. package/api/controller/http/subscription.ts +0 -1
  4. package/api/routes.ts +5 -2
  5. package/build/api/controller/http/payment.d.ts +1 -0
  6. package/build/api/controller/http/payment.d.ts.map +1 -1
  7. package/build/api/controller/http/payment.js +1 -0
  8. package/build/api/controller/http/product.d.ts +2 -0
  9. package/build/api/controller/http/product.d.ts.map +1 -1
  10. package/build/api/controller/http/product.js +2 -0
  11. package/build/api/controller/http/subscription.d.ts +0 -1
  12. package/build/api/controller/http/subscription.d.ts.map +1 -1
  13. package/build/api/controller/http/subscription.js +0 -1
  14. package/build/api/routes.d.ts +3 -1
  15. package/build/api/routes.d.ts.map +1 -1
  16. package/build/api/routes.js +3 -1
  17. package/build/commands/payment/index.d.ts +1 -0
  18. package/build/commands/payment/index.d.ts.map +1 -1
  19. package/build/commands/payment/index.js +1 -0
  20. package/build/commands/payment/refund-payment.command.d.ts +20 -0
  21. package/build/commands/payment/refund-payment.command.d.ts.map +1 -0
  22. package/build/commands/payment/refund-payment.command.js +13 -0
  23. package/build/commands/{subscription/refund-subscription.command.d.ts → product/delete-product.command.d.ts} +2 -2
  24. package/build/commands/product/delete-product.command.d.ts.map +1 -0
  25. package/build/commands/product/delete-product.command.js +13 -0
  26. package/build/commands/product/index.d.ts +2 -0
  27. package/build/commands/product/index.d.ts.map +1 -1
  28. package/build/commands/product/index.js +2 -0
  29. package/build/commands/product/update-product.command.d.ts +116 -0
  30. package/build/commands/product/update-product.command.d.ts.map +1 -0
  31. package/build/commands/product/update-product.command.js +26 -0
  32. package/build/commands/subscription/index.d.ts +0 -1
  33. package/build/commands/subscription/index.d.ts.map +1 -1
  34. package/build/commands/subscription/index.js +0 -1
  35. package/build/constants/errors/errors.d.ts +5 -0
  36. package/build/constants/errors/errors.d.ts.map +1 -1
  37. package/build/constants/errors/errors.js +5 -0
  38. package/build/constants/payment/enums/payment-status.enum.d.ts +2 -1
  39. package/build/constants/payment/enums/payment-status.enum.d.ts.map +1 -1
  40. package/build/constants/payment/enums/payment-status.enum.js +1 -0
  41. package/commands/payment/index.ts +1 -0
  42. package/commands/payment/refund-payment.command.ts +13 -0
  43. package/commands/{subscription/refund-subscription.command.ts → product/delete-product.command.ts} +1 -1
  44. package/commands/product/index.ts +2 -0
  45. package/commands/product/update-product.command.ts +30 -0
  46. package/commands/subscription/index.ts +0 -1
  47. package/constants/errors/errors.ts +5 -0
  48. package/constants/payment/enums/payment-status.enum.ts +1 -0
  49. package/package.json +1 -1
  50. package/build/commands/subscription/refund-subscription.command.d.ts.map +0 -1
  51. package/build/commands/subscription/refund-subscription.command.js +0 -13
@@ -2,4 +2,5 @@ export const PAYMENT_CONTROLLER = 'payments' as const;
2
2
 
3
3
  export const PAYMENT_ROUTES = {
4
4
  HISTORY: 'history',
5
+ REFUND: 'refund',
5
6
  } as const;
@@ -6,4 +6,6 @@ export const PRODUCT_ROUTES = {
6
6
  BUY: 'buy',
7
7
  FAST_BUY: 'fast/buy',
8
8
  MY: 'my',
9
+ UPDATE: (uuid: string) => `${uuid}`,
10
+ DELETE: (uuid: string) => `${uuid}`,
9
11
  } as const;
@@ -11,5 +11,4 @@ export const SUBSCRIPTION_ROUTES = {
11
11
  RECOVER: (uuid: string) => `${uuid}/recover`,
12
12
  UPDATE: (uuid: string) => `${uuid}`,
13
13
  DELETE: (uuid: string) => `${uuid}`,
14
- REFUND: (uuid: string) => `${uuid}/refund`,
15
14
  } as const;
package/api/routes.ts CHANGED
@@ -49,6 +49,10 @@ export const REST_API = {
49
49
  BUY: (uuid: string) =>
50
50
  `${ROOT}/${CONTROLLERS.PRODUCT_PRIVATE_CONTROLLER}/${uuid}/${CONTROLLERS.PRODUCT_ROUTES.BUY}`,
51
51
  MY: `${ROOT}/${CONTROLLERS.PRODUCT_PRIVATE_CONTROLLER}/${CONTROLLERS.PRODUCT_ROUTES.MY}`,
52
+ UPDATE: (uuid: string) =>
53
+ `${ROOT}/${CONTROLLERS.PRODUCT_PRIVATE_CONTROLLER}/${CONTROLLERS.PRODUCT_ROUTES.UPDATE(uuid)}`,
54
+ DELETE: (uuid: string) =>
55
+ `${ROOT}/${CONTROLLERS.PRODUCT_PRIVATE_CONTROLLER}/${CONTROLLERS.PRODUCT_ROUTES.DELETE(uuid)}`,
52
56
  },
53
57
  SUBSCRIPTION_PUBLIC: {
54
58
  GET: `${ROOT}/${CONTROLLERS.SUBSCRIPTION_PUBLIC_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.GET_ALL}`,
@@ -69,11 +73,10 @@ export const REST_API = {
69
73
  `${ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.UPDATE(uuid)}`,
70
74
  DELETE: (uuid: string) =>
71
75
  `${ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.DELETE(uuid)}`,
72
- REFUND: (uuid: string) =>
73
- `${ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.REFUND(uuid)}`,
74
76
  },
75
77
  PAYMENT: {
76
78
  HISTORY: `${ROOT}/${CONTROLLERS.PAYMENT_CONTROLLER}/${CONTROLLERS.PAYMENT_ROUTES.HISTORY}`,
79
+ REFUND: `${ROOT}/${CONTROLLERS.PAYMENT_CONTROLLER}/${CONTROLLERS.PAYMENT_ROUTES.REFUND}`,
77
80
  },
78
81
  CLOUD_PAYMENTS: {
79
82
  CALLBACK: (type: string) =>
@@ -1,5 +1,6 @@
1
1
  export declare const PAYMENT_CONTROLLER: "payments";
2
2
  export declare const PAYMENT_ROUTES: {
3
3
  readonly HISTORY: "history";
4
+ readonly REFUND: "refund";
4
5
  };
5
6
  //# sourceMappingURL=payment.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../../../../api/controller/http/payment.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,EAAG,UAAmB,CAAC;AAEtD,eAAO,MAAM,cAAc;;CAEjB,CAAC"}
1
+ {"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../../../../api/controller/http/payment.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,EAAG,UAAmB,CAAC;AAEtD,eAAO,MAAM,cAAc;;;CAGjB,CAAC"}
@@ -4,4 +4,5 @@ exports.PAYMENT_ROUTES = exports.PAYMENT_CONTROLLER = void 0;
4
4
  exports.PAYMENT_CONTROLLER = 'payments';
5
5
  exports.PAYMENT_ROUTES = {
6
6
  HISTORY: 'history',
7
+ REFUND: 'refund',
7
8
  };
@@ -5,5 +5,7 @@ export declare const PRODUCT_ROUTES: {
5
5
  readonly BUY: "buy";
6
6
  readonly FAST_BUY: "fast/buy";
7
7
  readonly MY: "my";
8
+ readonly UPDATE: (uuid: string) => string;
9
+ readonly DELETE: (uuid: string) => string;
8
10
  };
9
11
  //# sourceMappingURL=product.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"product.d.ts","sourceRoot":"","sources":["../../../../api/controller/http/product.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0BAA0B,EAAG,iBAA0B,CAAC;AACrE,eAAO,MAAM,yBAAyB,EAAG,gBAAyB,CAAC;AAEnE,eAAO,MAAM,cAAc;;;;;CAKjB,CAAC"}
1
+ {"version":3,"file":"product.d.ts","sourceRoot":"","sources":["../../../../api/controller/http/product.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0BAA0B,EAAG,iBAA0B,CAAC;AACrE,eAAO,MAAM,yBAAyB,EAAG,gBAAyB,CAAC;AAEnE,eAAO,MAAM,cAAc;;;;;4BAKR,MAAM;4BACN,MAAM;CACf,CAAC"}
@@ -8,4 +8,6 @@ exports.PRODUCT_ROUTES = {
8
8
  BUY: 'buy',
9
9
  FAST_BUY: 'fast/buy',
10
10
  MY: 'my',
11
+ UPDATE: (uuid) => `${uuid}`,
12
+ DELETE: (uuid) => `${uuid}`,
11
13
  };
@@ -10,6 +10,5 @@ export declare const SUBSCRIPTION_ROUTES: {
10
10
  readonly RECOVER: (uuid: string) => string;
11
11
  readonly UPDATE: (uuid: string) => string;
12
12
  readonly DELETE: (uuid: string) => string;
13
- readonly REFUND: (uuid: string) => string;
14
13
  };
15
14
  //# sourceMappingURL=subscription.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../../../api/controller/http/subscription.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,+BAA+B,EAAG,sBAA+B,CAAC;AAC/E,eAAO,MAAM,8BAA8B,EAAG,qBAA8B,CAAC;AAE7E,eAAO,MAAM,mBAAmB;;;;;;4BAMb,MAAM;6BACL,MAAM;4BACP,MAAM;4BACN,MAAM;4BACN,MAAM;CACf,CAAC"}
1
+ {"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../../../api/controller/http/subscription.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,+BAA+B,EAAG,sBAA+B,CAAC;AAC/E,eAAO,MAAM,8BAA8B,EAAG,qBAA8B,CAAC;AAE7E,eAAO,MAAM,mBAAmB;;;;;;4BAMb,MAAM;6BACL,MAAM;4BACP,MAAM;4BACN,MAAM;CACf,CAAC"}
@@ -13,5 +13,4 @@ exports.SUBSCRIPTION_ROUTES = {
13
13
  RECOVER: (uuid) => `${uuid}/recover`,
14
14
  UPDATE: (uuid) => `${uuid}`,
15
15
  DELETE: (uuid) => `${uuid}`,
16
- REFUND: (uuid) => `${uuid}/refund`,
17
16
  };
@@ -39,6 +39,8 @@ export declare const REST_API: {
39
39
  readonly GET: "/api/product/private/all";
40
40
  readonly BUY: (uuid: string) => string;
41
41
  readonly MY: "/api/product/private/my";
42
+ readonly UPDATE: (uuid: string) => string;
43
+ readonly DELETE: (uuid: string) => string;
42
44
  };
43
45
  readonly SUBSCRIPTION_PUBLIC: {
44
46
  readonly GET: "/api/subscription/public/all";
@@ -53,10 +55,10 @@ export declare const REST_API: {
53
55
  readonly RECOVER: (uuid: string) => string;
54
56
  readonly UPDATE: (uuid: string) => string;
55
57
  readonly DELETE: (uuid: string) => string;
56
- readonly REFUND: (uuid: string) => string;
57
58
  };
58
59
  readonly PAYMENT: {
59
60
  readonly HISTORY: "/api/payments/history";
61
+ readonly REFUND: "/api/payments/refund";
60
62
  };
61
63
  readonly CLOUD_PAYMENTS: {
62
64
  readonly CALLBACK: (type: string) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../api/routes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,EAAG,MAAe,CAAC;AAEpC,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;sCA0BQ,MAAM;qCAEP,MAAM;2CAEA,MAAM;sCAEX,MAAM;sCAEN,MAAM;;;;kCAKV,MAAM;;;;6BAKX,MAAM;;;;;kCAMD,MAAM;;;;6BAKX,MAAM;;;gCAIH,MAAM;iCAEL,MAAM;gCAEP,MAAM;gCAEN,MAAM;gCAEN,MAAM;;;;;;kCAOJ,MAAM;;;;;;iCAOP,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;;iCAQJ,MAAM;+BAER,MAAM;sCAEC,MAAM;gCAEZ,MAAM;gCAEN,MAAM;;;;;;;;iCASL,MAAM;+BAER,MAAM;sCAEC,MAAM;gCAEZ,MAAM;gCAEN,MAAM;;;;;;;;;;;iCAYL,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;;6BAQR,MAAM;;;;;6BAKN,MAAM;;;;;;;;sCAQG,MAAM;wCAEJ,MAAM;;gCAGd,MAAM;gCAEN,MAAM;iDAEW,MAAM;;;;sCAKjB,MAAM;;gCAGZ,MAAM;gCAEN,MAAM;;CAGnB,CAAC"}
1
+ {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../api/routes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI,EAAG,MAAe,CAAC;AAEpC,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;sCA0BQ,MAAM;qCAEP,MAAM;2CAEA,MAAM;sCAEX,MAAM;sCAEN,MAAM;;;;kCAKV,MAAM;;;;6BAKX,MAAM;;gCAGH,MAAM;gCAEN,MAAM;;;;kCAKJ,MAAM;;;;6BAKX,MAAM;;;gCAIH,MAAM;iCAEL,MAAM;gCAEP,MAAM;gCAEN,MAAM;;;;;;;kCAQJ,MAAM;;;;;;iCAOP,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;;iCAQJ,MAAM;+BAER,MAAM;sCAEC,MAAM;gCAEZ,MAAM;gCAEN,MAAM;;;;;;;;iCASL,MAAM;+BAER,MAAM;sCAEC,MAAM;gCAEZ,MAAM;gCAEN,MAAM;;;;;;;;;;;iCAYL,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;iCAOJ,MAAM;gCAEP,MAAM;sCAEA,MAAM;gCAEZ,MAAM;;+BAGP,MAAM;;;;;;;6BAQR,MAAM;;;;;6BAKN,MAAM;;;;;;;;sCAQG,MAAM;wCAEJ,MAAM;;gCAGd,MAAM;gCAEN,MAAM;iDAEW,MAAM;;;;sCAKjB,MAAM;;gCAGZ,MAAM;gCAEN,MAAM;;CAGnB,CAAC"}
@@ -76,6 +76,8 @@ exports.REST_API = {
76
76
  GET: `${exports.ROOT}/${CONTROLLERS.PRODUCT_PRIVATE_CONTROLLER}/${CONTROLLERS.PRODUCT_ROUTES.GET_ALL}`,
77
77
  BUY: (uuid) => `${exports.ROOT}/${CONTROLLERS.PRODUCT_PRIVATE_CONTROLLER}/${uuid}/${CONTROLLERS.PRODUCT_ROUTES.BUY}`,
78
78
  MY: `${exports.ROOT}/${CONTROLLERS.PRODUCT_PRIVATE_CONTROLLER}/${CONTROLLERS.PRODUCT_ROUTES.MY}`,
79
+ UPDATE: (uuid) => `${exports.ROOT}/${CONTROLLERS.PRODUCT_PRIVATE_CONTROLLER}/${CONTROLLERS.PRODUCT_ROUTES.UPDATE(uuid)}`,
80
+ DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.PRODUCT_PRIVATE_CONTROLLER}/${CONTROLLERS.PRODUCT_ROUTES.DELETE(uuid)}`,
79
81
  },
80
82
  SUBSCRIPTION_PUBLIC: {
81
83
  GET: `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_PUBLIC_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.GET_ALL}`,
@@ -90,10 +92,10 @@ exports.REST_API = {
90
92
  RECOVER: (uuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.RECOVER(uuid)}`,
91
93
  UPDATE: (uuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.UPDATE(uuid)}`,
92
94
  DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.DELETE(uuid)}`,
93
- REFUND: (uuid) => `${exports.ROOT}/${CONTROLLERS.SUBSCRIPTION_PRIVATE_CONTROLLER}/${CONTROLLERS.SUBSCRIPTION_ROUTES.REFUND(uuid)}`,
94
95
  },
95
96
  PAYMENT: {
96
97
  HISTORY: `${exports.ROOT}/${CONTROLLERS.PAYMENT_CONTROLLER}/${CONTROLLERS.PAYMENT_ROUTES.HISTORY}`,
98
+ REFUND: `${exports.ROOT}/${CONTROLLERS.PAYMENT_CONTROLLER}/${CONTROLLERS.PAYMENT_ROUTES.REFUND}`,
97
99
  },
98
100
  CLOUD_PAYMENTS: {
99
101
  CALLBACK: (type) => `${exports.ROOT}/${CONTROLLERS.CLOUD_PAYMENTS_CONTROLLER}/${CONTROLLERS.CLOUD_PAYMENTS_ROUTES.CALLBACK}/${type}`,
@@ -1,2 +1,3 @@
1
1
  export * from './cloud-payments.command';
2
+ export * from './refund-payment.command';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../commands/payment/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../commands/payment/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC"}
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./cloud-payments.command"), exports);
18
+ __exportStar(require("./refund-payment.command"), exports);
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ export declare namespace RefundPaymentCommand {
3
+ const RequestSchema: z.ZodObject<{
4
+ uuid: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ uuid: string;
7
+ }, {
8
+ uuid: string;
9
+ }>;
10
+ type Request = z.infer<typeof RequestSchema>;
11
+ const ResponseSchema: z.ZodObject<{
12
+ data: z.ZodBoolean;
13
+ }, "strip", z.ZodTypeAny, {
14
+ data: boolean;
15
+ }, {
16
+ data: boolean;
17
+ }>;
18
+ type Response = z.infer<typeof ResponseSchema>;
19
+ }
20
+ //# sourceMappingURL=refund-payment.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refund-payment.command.d.ts","sourceRoot":"","sources":["../../../commands/payment/refund-payment.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,yBAAiB,oBAAoB,CAAC;IAC3B,MAAM,aAAa;;;;;;MAExB,CAAC;IACH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;MAEzB,CAAC;IACH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RefundPaymentCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ var RefundPaymentCommand;
6
+ (function (RefundPaymentCommand) {
7
+ RefundPaymentCommand.RequestSchema = zod_1.z.object({
8
+ uuid: zod_1.z.string().uuid(),
9
+ });
10
+ RefundPaymentCommand.ResponseSchema = zod_1.z.object({
11
+ data: zod_1.z.boolean(),
12
+ });
13
+ })(RefundPaymentCommand || (exports.RefundPaymentCommand = RefundPaymentCommand = {}));
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- export declare namespace RefundSubscriptionCommand {
2
+ export declare namespace DeleteProductCommand {
3
3
  const RequestParamSchema: z.ZodObject<{
4
4
  uuid: z.ZodString;
5
5
  }, "strip", z.ZodTypeAny, {
@@ -17,4 +17,4 @@ export declare namespace RefundSubscriptionCommand {
17
17
  }>;
18
18
  type Response = z.infer<typeof ResponseSchema>;
19
19
  }
20
- //# sourceMappingURL=refund-subscription.command.d.ts.map
20
+ //# sourceMappingURL=delete-product.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-product.command.d.ts","sourceRoot":"","sources":["../../../commands/product/delete-product.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,yBAAiB,oBAAoB,CAAC;IAC3B,MAAM,kBAAkB;;;;;;MAE7B,CAAC;IACH,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAEvD,MAAM,cAAc;;;;;;MAEzB,CAAC;IACH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeleteProductCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ var DeleteProductCommand;
6
+ (function (DeleteProductCommand) {
7
+ DeleteProductCommand.RequestParamSchema = zod_1.z.object({
8
+ uuid: zod_1.z.string().uuid(),
9
+ });
10
+ DeleteProductCommand.ResponseSchema = zod_1.z.object({
11
+ data: zod_1.z.boolean(),
12
+ });
13
+ })(DeleteProductCommand || (exports.DeleteProductCommand = DeleteProductCommand = {}));
@@ -1,3 +1,5 @@
1
1
  export * from './buy-product.command';
2
2
  export * from './fast-buy-product.command';
3
+ export * from './update-product.command';
4
+ export * from './delete-product.command';
3
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../commands/product/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../commands/product/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC"}
@@ -16,3 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./buy-product.command"), exports);
18
18
  __exportStar(require("./fast-buy-product.command"), exports);
19
+ __exportStar(require("./update-product.command"), exports);
20
+ __exportStar(require("./delete-product.command"), exports);
@@ -0,0 +1,116 @@
1
+ import { z } from 'zod';
2
+ export declare namespace UpdateProductCommand {
3
+ const RequestParamSchema: z.ZodObject<{
4
+ uuid: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ uuid: string;
7
+ }, {
8
+ uuid: string;
9
+ }>;
10
+ type RequestParam = z.infer<typeof RequestParamSchema>;
11
+ const RequestSchema: z.ZodObject<{
12
+ name: z.ZodOptional<z.ZodString>;
13
+ description: z.ZodOptional<z.ZodString>;
14
+ price: z.ZodOptional<z.ZodNumber>;
15
+ tokens: z.ZodOptional<z.ZodNumber>;
16
+ features: z.ZodOptional<z.ZodArray<z.ZodObject<{
17
+ type: z.ZodString;
18
+ name: z.ZodString;
19
+ }, "strip", z.ZodTypeAny, {
20
+ type: string;
21
+ name: string;
22
+ }, {
23
+ type: string;
24
+ name: string;
25
+ }>, "many">>;
26
+ }, "strip", z.ZodTypeAny, {
27
+ price?: number | undefined;
28
+ name?: string | undefined;
29
+ description?: string | undefined;
30
+ tokens?: number | undefined;
31
+ features?: {
32
+ type: string;
33
+ name: string;
34
+ }[] | undefined;
35
+ }, {
36
+ price?: number | undefined;
37
+ name?: string | undefined;
38
+ description?: string | undefined;
39
+ tokens?: number | undefined;
40
+ features?: {
41
+ type: string;
42
+ name: string;
43
+ }[] | undefined;
44
+ }>;
45
+ type Request = z.infer<typeof RequestSchema>;
46
+ const ResponseSchema: z.ZodObject<{
47
+ data: z.ZodObject<{
48
+ uuid: z.ZodString;
49
+ siteId: z.ZodString;
50
+ name: z.ZodString;
51
+ description: z.ZodString;
52
+ tokens: z.ZodNumber;
53
+ price: z.ZodNumber;
54
+ features: z.ZodArray<z.ZodObject<{
55
+ type: z.ZodString;
56
+ name: z.ZodString;
57
+ }, "strip", z.ZodTypeAny, {
58
+ type: string;
59
+ name: string;
60
+ }, {
61
+ type: string;
62
+ name: string;
63
+ }>, "many">;
64
+ }, "strip", z.ZodTypeAny, {
65
+ price: number;
66
+ uuid: string;
67
+ siteId: string;
68
+ name: string;
69
+ description: string;
70
+ tokens: number;
71
+ features: {
72
+ type: string;
73
+ name: string;
74
+ }[];
75
+ }, {
76
+ price: number;
77
+ uuid: string;
78
+ siteId: string;
79
+ name: string;
80
+ description: string;
81
+ tokens: number;
82
+ features: {
83
+ type: string;
84
+ name: string;
85
+ }[];
86
+ }>;
87
+ }, "strip", z.ZodTypeAny, {
88
+ data: {
89
+ price: number;
90
+ uuid: string;
91
+ siteId: string;
92
+ name: string;
93
+ description: string;
94
+ tokens: number;
95
+ features: {
96
+ type: string;
97
+ name: string;
98
+ }[];
99
+ };
100
+ }, {
101
+ data: {
102
+ price: number;
103
+ uuid: string;
104
+ siteId: string;
105
+ name: string;
106
+ description: string;
107
+ tokens: number;
108
+ features: {
109
+ type: string;
110
+ name: string;
111
+ }[];
112
+ };
113
+ }>;
114
+ type Response = z.infer<typeof ResponseSchema>;
115
+ }
116
+ //# sourceMappingURL=update-product.command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-product.command.d.ts","sourceRoot":"","sources":["../../../commands/product/update-product.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,yBAAiB,oBAAoB,CAAC;IAC3B,MAAM,kBAAkB;;;;;;MAE7B,CAAC;IACH,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAEvD,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAaxB,CAAC;IACH,KAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;IAE7C,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAEzB,CAAC;IACH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateProductCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ var UpdateProductCommand;
7
+ (function (UpdateProductCommand) {
8
+ UpdateProductCommand.RequestParamSchema = zod_1.z.object({
9
+ uuid: zod_1.z.string().uuid(),
10
+ });
11
+ UpdateProductCommand.RequestSchema = zod_1.z.object({
12
+ name: zod_1.z.string().min(1).max(200).optional(),
13
+ description: zod_1.z.string().min(1).max(2000).optional(),
14
+ price: zod_1.z.number().int().min(0).optional(),
15
+ tokens: zod_1.z.number().int().min(0).optional(),
16
+ features: zod_1.z
17
+ .array(zod_1.z.object({
18
+ type: zod_1.z.string(),
19
+ name: zod_1.z.string(),
20
+ }))
21
+ .optional(),
22
+ });
23
+ UpdateProductCommand.ResponseSchema = zod_1.z.object({
24
+ data: models_1.ProductSchema,
25
+ });
26
+ })(UpdateProductCommand || (exports.UpdateProductCommand = UpdateProductCommand = {}));
@@ -4,5 +4,4 @@ export * from './cancel-subscription.command';
4
4
  export * from './recover-subscription.command';
5
5
  export * from './update-subscription.command';
6
6
  export * from './delete-subscription.command';
7
- export * from './refund-subscription.command';
8
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../commands/subscription/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../commands/subscription/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC"}
@@ -20,4 +20,3 @@ __exportStar(require("./cancel-subscription.command"), exports);
20
20
  __exportStar(require("./recover-subscription.command"), exports);
21
21
  __exportStar(require("./update-subscription.command"), exports);
22
22
  __exportStar(require("./delete-subscription.command"), exports);
23
- __exportStar(require("./refund-subscription.command"), exports);
@@ -244,6 +244,11 @@ export declare const ERRORS: {
244
244
  readonly code: "PAYMENT_002";
245
245
  readonly httpCode: 500;
246
246
  };
247
+ readonly PAYMENT_REFUND_ERROR: {
248
+ readonly message: "Ошибка при возврате платежа";
249
+ readonly code: "PAYMENT_003";
250
+ readonly httpCode: 500;
251
+ };
247
252
  readonly TRANSACTION_WRITE_OFF_ERROR: {
248
253
  readonly message: "Ошибка при списании токенов";
249
254
  readonly code: "TRANSACTION_001";
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../constants/errors/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgyBT,CAAC"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../constants/errors/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqyBT,CAAC"}
@@ -255,6 +255,11 @@ exports.ERRORS = {
255
255
  code: 'PAYMENT_002',
256
256
  httpCode: 500,
257
257
  },
258
+ PAYMENT_REFUND_ERROR: {
259
+ message: 'Ошибка при возврате платежа',
260
+ code: 'PAYMENT_003',
261
+ httpCode: 500,
262
+ },
258
263
  // TRANSACTION
259
264
  TRANSACTION_WRITE_OFF_ERROR: {
260
265
  message: 'Ошибка при списании токенов',
@@ -1,4 +1,5 @@
1
1
  export declare enum PAYMENT_STATUS {
2
- SUCCESS = "success"
2
+ SUCCESS = "success",
3
+ REFUNDED = "refunded"
3
4
  }
4
5
  //# sourceMappingURL=payment-status.enum.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"payment-status.enum.d.ts","sourceRoot":"","sources":["../../../../constants/payment/enums/payment-status.enum.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc;IACtB,OAAO,YAAY;CACtB"}
1
+ {"version":3,"file":"payment-status.enum.d.ts","sourceRoot":"","sources":["../../../../constants/payment/enums/payment-status.enum.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc;IACtB,OAAO,YAAY;IACnB,QAAQ,aAAa;CACxB"}
@@ -4,4 +4,5 @@ exports.PAYMENT_STATUS = void 0;
4
4
  var PAYMENT_STATUS;
5
5
  (function (PAYMENT_STATUS) {
6
6
  PAYMENT_STATUS["SUCCESS"] = "success";
7
+ PAYMENT_STATUS["REFUNDED"] = "refunded";
7
8
  })(PAYMENT_STATUS || (exports.PAYMENT_STATUS = PAYMENT_STATUS = {}));
@@ -1 +1,2 @@
1
1
  export * from './cloud-payments.command';
2
+ export * from './refund-payment.command';
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace RefundPaymentCommand {
4
+ export const RequestSchema = z.object({
5
+ uuid: z.string().uuid(),
6
+ });
7
+ export type Request = z.infer<typeof RequestSchema>;
8
+
9
+ export const ResponseSchema = z.object({
10
+ data: z.boolean(),
11
+ });
12
+ export type Response = z.infer<typeof ResponseSchema>;
13
+ }
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
 
3
- export namespace RefundSubscriptionCommand {
3
+ export namespace DeleteProductCommand {
4
4
  export const RequestParamSchema = z.object({
5
5
  uuid: z.string().uuid(),
6
6
  });
@@ -1,2 +1,4 @@
1
1
  export * from './buy-product.command';
2
2
  export * from './fast-buy-product.command';
3
+ export * from './update-product.command';
4
+ export * from './delete-product.command';
@@ -0,0 +1,30 @@
1
+ import { z } from 'zod';
2
+ import { ProductSchema } from '../../models';
3
+
4
+ export namespace UpdateProductCommand {
5
+ export const RequestParamSchema = z.object({
6
+ uuid: z.string().uuid(),
7
+ });
8
+ export type RequestParam = z.infer<typeof RequestParamSchema>;
9
+
10
+ export const RequestSchema = z.object({
11
+ name: z.string().min(1).max(200).optional(),
12
+ description: z.string().min(1).max(2000).optional(),
13
+ price: z.number().int().min(0).optional(),
14
+ tokens: z.number().int().min(0).optional(),
15
+ features: z
16
+ .array(
17
+ z.object({
18
+ type: z.string(),
19
+ name: z.string(),
20
+ }),
21
+ )
22
+ .optional(),
23
+ });
24
+ export type Request = z.infer<typeof RequestSchema>;
25
+
26
+ export const ResponseSchema = z.object({
27
+ data: ProductSchema,
28
+ });
29
+ export type Response = z.infer<typeof ResponseSchema>;
30
+ }
@@ -4,4 +4,3 @@ export * from './cancel-subscription.command';
4
4
  export * from './recover-subscription.command';
5
5
  export * from './update-subscription.command';
6
6
  export * from './delete-subscription.command';
7
- export * from './refund-subscription.command';
@@ -260,6 +260,11 @@ export const ERRORS = {
260
260
  code: 'PAYMENT_002',
261
261
  httpCode: 500,
262
262
  },
263
+ PAYMENT_REFUND_ERROR: {
264
+ message: 'Ошибка при возврате платежа',
265
+ code: 'PAYMENT_003',
266
+ httpCode: 500,
267
+ },
263
268
 
264
269
  // TRANSACTION
265
270
  TRANSACTION_WRITE_OFF_ERROR: {
@@ -1,3 +1,4 @@
1
1
  export enum PAYMENT_STATUS {
2
2
  SUCCESS = 'success',
3
+ REFUNDED = 'refunded',
3
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/multisite",
3
- "version": "0.0.20",
3
+ "version": "0.0.21",
4
4
  "description": "Multisite API contracts (DTO schemas, routes, constants)",
5
5
  "type": "commonjs",
6
6
  "main": "build/index.js",
@@ -1 +0,0 @@
1
- {"version":3,"file":"refund-subscription.command.d.ts","sourceRoot":"","sources":["../../../commands/subscription/refund-subscription.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,yBAAiB,yBAAyB,CAAC;IAChC,MAAM,kBAAkB;;;;;;MAE7B,CAAC;IACH,KAAY,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAEvD,MAAM,cAAc;;;;;;MAEzB,CAAC;IACH,KAAY,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;CACzD"}
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RefundSubscriptionCommand = void 0;
4
- const zod_1 = require("zod");
5
- var RefundSubscriptionCommand;
6
- (function (RefundSubscriptionCommand) {
7
- RefundSubscriptionCommand.RequestParamSchema = zod_1.z.object({
8
- uuid: zod_1.z.string().uuid(),
9
- });
10
- RefundSubscriptionCommand.ResponseSchema = zod_1.z.object({
11
- data: zod_1.z.boolean(),
12
- });
13
- })(RefundSubscriptionCommand || (exports.RefundSubscriptionCommand = RefundSubscriptionCommand = {}));