namirasoft-payment 1.4.63 → 1.4.65

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.
@@ -16,7 +16,7 @@ const NamirasoftPaymentServerSubscriptionPaid_1 = require("./NamirasoftPaymentSe
16
16
  const NamirasoftPaymentServerValue_1 = require("./NamirasoftPaymentServerValue");
17
17
  class NamirasoftPaymentServer extends namirasoft_account_1.NSABaseServer {
18
18
  constructor(base_url, manager, onError) {
19
- super(base_url, `1.4.63`, manager, onError);
19
+ super(base_url, `1.4.65`, manager, onError);
20
20
  this.healthz = new NamirasoftPaymentServerHealthz_1.NamirasoftPaymentServerHealthz(this);
21
21
  this.value = new NamirasoftPaymentServerValue_1.NamirasoftPaymentServerValue(this);
22
22
  this.invoice = new NamirasoftPaymentServerInvoice_1.NamirasoftPaymentServerInvoice(this);
@@ -16,9 +16,9 @@ export declare class NamirasoftPaymentServerSubscription extends NamirasoftPayme
16
16
  }>;
17
17
  Cancel(id: string, body: {
18
18
  cancellation_reason_id: string;
19
- cancellatino_explaination: string;
19
+ cancellation_explaination: string;
20
20
  }): Promise<void>;
21
- Checkout(offer_id: string, body: {
21
+ CheckoutOffer(offer_id: string, body: {
22
22
  gateway: GatewayType;
23
23
  success_url: string;
24
24
  cancel_url: string;
@@ -18,7 +18,7 @@ class NamirasoftPaymentServerSubscription extends NamirasoftPaymentServerBase_1.
18
18
  super(server);
19
19
  this.AcceptCancellationOffer = this.AcceptCancellationOffer.bind(this);
20
20
  this.Cancel = this.Cancel.bind(this);
21
- this.Checkout = this.Checkout.bind(this);
21
+ this.CheckoutOffer = this.CheckoutOffer.bind(this);
22
22
  this.List = this.List.bind(this);
23
23
  this.GetCancellationOffer = this.GetCancellationOffer.bind(this);
24
24
  this.Get = this.Get.bind(this);
@@ -36,7 +36,7 @@ class NamirasoftPaymentServerSubscription extends NamirasoftPaymentServerBase_1.
36
36
  yield this.server._post(path, {}, body);
37
37
  });
38
38
  }
39
- Checkout(offer_id, body) {
39
+ CheckoutOffer(offer_id, body) {
40
40
  return __awaiter(this, void 0, void 0, function* () {
41
41
  let path = `/subscription/checkout/offer/${offer_id}`;
42
42
  let { data } = yield this.server._post(path, {}, body);
@@ -1 +1 @@
1
- {"version":3,"file":"NamirasoftPaymentServerSubscription.js","sourceRoot":"","sources":["../src/NamirasoftPaymentServerSubscription.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,qDAA6C;AAG7C,+EAA4E;AAC5E,qDAA2C;AAI3C,MAAa,mCAAoC,SAAQ,yDAA2B;IAEhF,YAAY,MAA+B;QAEvC,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjE,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IACK,uBAAuB,CAAC,EAAU,EAAE,SAAiB,EAAE,IAAuE;;YAEhI,IAAI,IAAI,GAAG,iBAAiB,EAAE,qCAAqC,SAAS,EAAE,CAAC;YAC/E,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAkB,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;YACxE,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;IACK,MAAM,CA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AAC,EAAU;;YAEhB,IAAI,IAAI,GAAG,iBAAiB,EAAE,EAAE,CAAC;YACjC,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAsB,IAAI,EAAE,EAAE,CAAC,CAAC;YACrE,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;CACJ;AAjDD,kFAiDC;AAAA,CAAC"}
@@ -26,11 +26,11 @@ class SubscriptionCancelCommand extends namirasoft_node_cli_1.BaseFinalCommand {
26
26
  defaults: [""]
27
27
  },
28
28
  {
29
- name: "cancellatino_explaination",
29
+ name: "cancellation_explaination",
30
30
  short: "",
31
- description: "Provides the value of 'cancellatino_explaination' in body",
31
+ description: "Provides the value of 'cancellation_explaination' in body",
32
32
  optional: false,
33
- args: ["cancellatino_explaination"],
33
+ args: ["cancellation_explaination"],
34
34
  defaults: [""]
35
35
  }
36
36
  ]);
@@ -47,7 +47,7 @@ class SubscriptionCancelCommand extends namirasoft_node_cli_1.BaseFinalCommand {
47
47
  let server = new NamirasoftPaymentServer_1.NamirasoftPaymentServer(url, manager, e => this.app.logger.error(e.message));
48
48
  let ans = yield server.subscription.Cancel(this.arg_values[0], {
49
49
  cancellation_reason_id: this.option_values.cancellation_reason_id,
50
- cancellatino_explaination: this.option_values.cancellatino_explaination
50
+ cancellation_explaination: this.option_values.cancellation_explaination
51
51
  });
52
52
  this.app.logger.success(JSON.stringify(ans));
53
53
  });
@@ -1,5 +1,5 @@
1
1
  import { BaseFinalCommand } from "namirasoft-node-cli";
2
- export declare class SubscriptionCheckoutCommand extends BaseFinalCommand {
2
+ export declare class SubscriptionCheckoutOfferCommand extends BaseFinalCommand {
3
3
  constructor(argv: string[]);
4
4
  exec(): Promise<void>;
5
5
  }
@@ -9,12 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.SubscriptionCheckoutCommand = void 0;
12
+ exports.SubscriptionCheckoutOfferCommand = void 0;
13
13
  const namirasoft_node_cli_1 = require("namirasoft-node-cli");
14
14
  const namirasoft_core_1 = require("namirasoft-core");
15
15
  const NamirasoftPaymentServer_1 = require("../NamirasoftPaymentServer");
16
16
  const namirasoft_account_1 = require("namirasoft-account");
17
- class SubscriptionCheckoutCommand extends namirasoft_node_cli_1.BaseFinalCommand {
17
+ class SubscriptionCheckoutOfferCommand extends namirasoft_node_cli_1.BaseFinalCommand {
18
18
  constructor(argv) {
19
19
  super(argv, ["offer_id"], [
20
20
  {
@@ -53,7 +53,7 @@ class SubscriptionCheckoutCommand extends namirasoft_node_cli_1.BaseFinalCommand
53
53
  manager.setValue(token, false);
54
54
  let url = this.app.storage.getItem("ns-payment-server-url");
55
55
  let server = new NamirasoftPaymentServer_1.NamirasoftPaymentServer(url, manager, e => this.app.logger.error(e.message));
56
- let ans = yield server.subscription.Checkout(this.arg_values[0], {
56
+ let ans = yield server.subscription.CheckoutOffer(this.arg_values[0], {
57
57
  gateway: this.option_values.gateway,
58
58
  success_url: this.option_values.success_url,
59
59
  cancel_url: this.option_values.cancel_url
@@ -62,6 +62,6 @@ class SubscriptionCheckoutCommand extends namirasoft_node_cli_1.BaseFinalCommand
62
62
  });
63
63
  }
64
64
  }
65
- exports.SubscriptionCheckoutCommand = SubscriptionCheckoutCommand;
65
+ exports.SubscriptionCheckoutOfferCommand = SubscriptionCheckoutOfferCommand;
66
66
  ;
67
- //# sourceMappingURL=SubscriptionCheckoutCommand.js.map
67
+ //# sourceMappingURL=SubscriptionCheckoutOfferCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SubscriptionCheckoutOfferCommand.js","sourceRoot":"","sources":["../../src/command/SubscriptionCheckoutOfferCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAAiD;AACjD,wEAAqE;AACrE,2DAAkD;AAElD,MAAa,gCAAiC,SAAQ,sCAAgB;IAElE,YAAY,IAAc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C,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YAC9F,IAAI,GAAG,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE;gBAClE,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO;gBACnC,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,WAAW;gBAC3C,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU;aAC5C,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AAhDD,4EAgDC;AAAA,CAAC"}
@@ -4,7 +4,7 @@ exports.SubscriptionCommand = void 0;
4
4
  const namirasoft_node_cli_1 = require("namirasoft-node-cli");
5
5
  const SubscriptionAcceptCancellationOfferCommand_1 = require("./SubscriptionAcceptCancellationOfferCommand");
6
6
  const SubscriptionCancelCommand_1 = require("./SubscriptionCancelCommand");
7
- const SubscriptionCheckoutCommand_1 = require("./SubscriptionCheckoutCommand");
7
+ const SubscriptionCheckoutOfferCommand_1 = require("./SubscriptionCheckoutOfferCommand");
8
8
  const SubscriptionGetCancellationOfferCommand_1 = require("./SubscriptionGetCancellationOfferCommand");
9
9
  const SubscriptionGetCommand_1 = require("./SubscriptionGetCommand");
10
10
  const SubscriptionListCommand_1 = require("./SubscriptionListCommand");
@@ -13,7 +13,7 @@ class SubscriptionCommand extends namirasoft_node_cli_1.BaseNavigatorCommand {
13
13
  super(argv, {
14
14
  "acceptcancellationoffer": SubscriptionAcceptCancellationOfferCommand_1.SubscriptionAcceptCancellationOfferCommand,
15
15
  "cancel": SubscriptionCancelCommand_1.SubscriptionCancelCommand,
16
- "checkout": SubscriptionCheckoutCommand_1.SubscriptionCheckoutCommand,
16
+ "checkoutoffer": SubscriptionCheckoutOfferCommand_1.SubscriptionCheckoutOfferCommand,
17
17
  "list": SubscriptionListCommand_1.SubscriptionListCommand,
18
18
  "getcancellationoffer": SubscriptionGetCancellationOfferCommand_1.SubscriptionGetCancellationOfferCommand,
19
19
  "get": SubscriptionGetCommand_1.SubscriptionGetCommand,
@@ -1 +1 @@
1
- {"version":3,"file":"SubscriptionCommand.js","sourceRoot":"","sources":["../../src/command/SubscriptionCommand.ts"],"names":[],"mappings":";;;AAoBA,6DAA2D;AAC3D,6GAA0G;AAC1G,2EAAwE;AACxE,+EAA4E;AAC5E,uGAAoG;AACpG,qEAAkE;AAClE,uEAAoE;AAEpE,MAAa,mBAAoB,SAAQ,0CAAoB;IAEzD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE;YACR,yBAAyB,EAAE,uFAA0C;YACrE,QAAQ,EAAE,qDAAyB;YACnC,UAAU,EAAE,yDAA2B;YACvC,MAAM,EAAE,iDAAuB;YAC/B,sBAAsB,EAAE,iFAAuC;YAC/D,KAAK,EAAE,+CAAsB;SAChC,CAAC,CAAC;IACP,CAAC;CACJ;AAbD,kDAaC;AAAA,CAAC"}
1
+ {"version":3,"file":"SubscriptionCommand.js","sourceRoot":"","sources":["../../src/command/SubscriptionCommand.ts"],"names":[],"mappings":";;;AAoBA,6DAA2D;AAC3D,6GAA0G;AAC1G,2EAAwE;AACxE,yFAAsF;AACtF,uGAAoG;AACpG,qEAAkE;AAClE,uEAAoE;AAEpE,MAAa,mBAAoB,SAAQ,0CAAoB;IAEzD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE;YACR,yBAAyB,EAAE,uFAA0C;YACrE,QAAQ,EAAE,qDAAyB;YACnC,eAAe,EAAE,mEAAgC;YACjD,MAAM,EAAE,iDAAuB;YAC/B,sBAAsB,EAAE,iFAAuC;YAC/D,KAAK,EAAE,+CAAsB;SAChC,CAAC,CAAC;IACP,CAAC;CACJ;AAbD,kDAaC;AAAA,CAAC"}
package/dist/index.d.ts CHANGED
@@ -39,7 +39,7 @@ export * from "./command/SubscriptionCancelCommand";
39
39
  export * from "./command/SubscriptionCancellationReasonCommand";
40
40
  export * from "./command/SubscriptionCancellationReasonGetCommand";
41
41
  export * from "./command/SubscriptionCancellationReasonListCommand";
42
- export * from "./command/SubscriptionCheckoutCommand";
42
+ export * from "./command/SubscriptionCheckoutOfferCommand";
43
43
  export * from "./command/SubscriptionCommand";
44
44
  export * from "./command/SubscriptionGetCancellationOfferCommand";
45
45
  export * from "./command/SubscriptionGetCommand";
package/dist/index.js CHANGED
@@ -55,7 +55,7 @@ __exportStar(require("./command/SubscriptionCancelCommand"), exports);
55
55
  __exportStar(require("./command/SubscriptionCancellationReasonCommand"), exports);
56
56
  __exportStar(require("./command/SubscriptionCancellationReasonGetCommand"), exports);
57
57
  __exportStar(require("./command/SubscriptionCancellationReasonListCommand"), exports);
58
- __exportStar(require("./command/SubscriptionCheckoutCommand"), exports);
58
+ __exportStar(require("./command/SubscriptionCheckoutOfferCommand"), exports);
59
59
  __exportStar(require("./command/SubscriptionCommand"), exports);
60
60
  __exportStar(require("./command/SubscriptionGetCancellationOfferCommand"), exports);
61
61
  __exportStar(require("./command/SubscriptionGetCommand"), exports);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAoBA,4DAA0C;AAC1C,gEAA8C;AAC9C,mEAAiD;AACjD,mEAAiD;AACjD,iEAA+C;AAC/C,mEAAiD;AACjD,mEAAiD;AACjD,mEAAiD;AACjD,qEAAmD;AACnD,wEAAsD;AACtD,0FAAwE;AACxE,4EAA0D;AAC1D,4EAA0D;AAC1D,iEAA+C;AAC/C,2DAAyC;AACzC,8DAA4C;AAC5C,iEAA+C;AAC/C,2DAAyC;AACzC,8DAA4C;AAC5C,+DAA6C;AAC7C,kEAAgD;AAChD,kEAAgD;AAChD,yDAAuC;AACvC,4DAA0C;AAC1C,6DAA2C;AAC3C,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AC1C,uDAAqC;AACrC,uDAAqC;AACrC,wDAAsC;AACtC,4DAA0C;AAC1C,uDAAqC;AACrC,mDAAiC;AACjC,qDAAmC;AACnC,qDAAmC;AACnC,iDAA+B;AAC/B,mDAAiC;AACjC,mDAAiC;AACjC,qDAAmC;AACnC,0EAAwD;AACxD,4DAA0C;AAC1C,4DAA0C;AAC1C,4DAA0C;AAC1C,wDAAsC"}
@@ -1,5 +1,6 @@
1
1
  import { OfferItemRow } from "./OfferItemRow";
2
2
  import { OfferRecurringDurationUnit } from "../enum/OfferRecurringDurationUnit";
3
+ import { SubscriptionRow } from "./SubscriptionRow";
3
4
  export type OfferFullRow = {
4
5
  id: string;
5
6
  product_id: string;
@@ -18,4 +19,5 @@ export type OfferFullRow = {
18
19
  created_at: Date;
19
20
  updated_at: Date;
20
21
  offer_item: OfferItemRow[];
22
+ subscription: SubscriptionRow;
21
23
  };
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "framework": "npm",
9
9
  "application": "package",
10
10
  "private": false,
11
- "version": "1.4.63",
11
+ "version": "1.4.65",
12
12
  "author": "Amir Abolhasani",
13
13
  "license": "MIT",
14
14
  "main": "./dist/index.js",
@@ -49,7 +49,7 @@ export class NamirasoftPaymentServer extends NSABaseServer
49
49
  product: NamirasoftPaymentServerProduct;
50
50
  constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void)
51
51
  {
52
- super(base_url, `1.4.63`, manager, onError);
52
+ super(base_url, `1.4.65`, manager, onError);
53
53
  this.healthz = new NamirasoftPaymentServerHealthz(this);
54
54
  this.value = new NamirasoftPaymentServerValue(this);
55
55
  this.invoice = new NamirasoftPaymentServerInvoice(this);
@@ -33,7 +33,7 @@ export class NamirasoftPaymentServerSubscription extends NamirasoftPaymentServer
33
33
  super(server);
34
34
  this.AcceptCancellationOffer = this.AcceptCancellationOffer.bind(this);
35
35
  this.Cancel = this.Cancel.bind(this);
36
- this.Checkout = this.Checkout.bind(this);
36
+ this.CheckoutOffer = this.CheckoutOffer.bind(this);
37
37
  this.List = this.List.bind(this);
38
38
  this.GetCancellationOffer = this.GetCancellationOffer.bind(this);
39
39
  this.Get = this.Get.bind(this);
@@ -44,12 +44,12 @@ export class NamirasoftPaymentServerSubscription extends NamirasoftPaymentServer
44
44
  let { data } = await this.server._post<{ url: string }>(path, {}, body);
45
45
  return data;
46
46
  }
47
- async Cancel(id: string, body: { cancellation_reason_id: string, cancellatino_explaination: string }): Promise<void>
47
+ async Cancel(id: string, body: { cancellation_reason_id: string, cancellation_explaination: string }): Promise<void>
48
48
  {
49
49
  let path = `/subscription/${id}/cancel`;
50
50
  await this.server._post<void>(path, {}, body);
51
51
  }
52
- async Checkout(offer_id: string, body: { gateway: GatewayType, success_url: string, cancel_url: string }): Promise<{ url: string }>
52
+ async CheckoutOffer(offer_id: string, body: { gateway: GatewayType, success_url: string, cancel_url: string }): Promise<{ url: string }>
53
53
  {
54
54
  let path = `/subscription/checkout/offer/${offer_id}`;
55
55
  let { data } = await this.server._post<{ url: string }>(path, {}, body);
@@ -37,11 +37,11 @@ export class SubscriptionCancelCommand extends BaseFinalCommand
37
37
  defaults: [""]
38
38
  },
39
39
  {
40
- name: "cancellatino_explaination",
40
+ name: "cancellation_explaination",
41
41
  short: "",
42
- description: "Provides the value of 'cancellatino_explaination' in body",
42
+ description: "Provides the value of 'cancellation_explaination' in body",
43
43
  optional: false,
44
- args: ["cancellatino_explaination"],
44
+ args: ["cancellation_explaination"],
45
45
  defaults: [""]
46
46
  }
47
47
  ]);
@@ -58,7 +58,7 @@ export class SubscriptionCancelCommand extends BaseFinalCommand
58
58
  let server = new NamirasoftPaymentServer(url, manager, e => this.app.logger.error(e.message));
59
59
  let ans = await server.subscription.Cancel(this.arg_values[0], {
60
60
  cancellation_reason_id: this.option_values.cancellation_reason_id,
61
- cancellatino_explaination: this.option_values.cancellatino_explaination
61
+ cancellation_explaination: this.option_values.cancellation_explaination
62
62
  });
63
63
  this.app.logger.success(JSON.stringify(ans));
64
64
  }
@@ -23,7 +23,7 @@ import { IStorageMemory } from "namirasoft-core";
23
23
  import { NamirasoftPaymentServer } from "../NamirasoftPaymentServer";
24
24
  import { TokenManager } from "namirasoft-account";
25
25
 
26
- export class SubscriptionCheckoutCommand extends BaseFinalCommand
26
+ export class SubscriptionCheckoutOfferCommand extends BaseFinalCommand
27
27
  {
28
28
  constructor(argv: string[])
29
29
  {
@@ -64,7 +64,7 @@ export class SubscriptionCheckoutCommand extends BaseFinalCommand
64
64
  manager.setValue(token, false);
65
65
  let url = this.app.storage.getItem("ns-payment-server-url");
66
66
  let server = new NamirasoftPaymentServer(url, manager, e => this.app.logger.error(e.message));
67
- let ans = await server.subscription.Checkout(this.arg_values[0], {
67
+ let ans = await server.subscription.CheckoutOffer(this.arg_values[0], {
68
68
  gateway: this.option_values.gateway,
69
69
  success_url: this.option_values.success_url,
70
70
  cancel_url: this.option_values.cancel_url
@@ -21,7 +21,7 @@
21
21
  import { BaseNavigatorCommand } from "namirasoft-node-cli";
22
22
  import { SubscriptionAcceptCancellationOfferCommand } from "./SubscriptionAcceptCancellationOfferCommand";
23
23
  import { SubscriptionCancelCommand } from "./SubscriptionCancelCommand";
24
- import { SubscriptionCheckoutCommand } from "./SubscriptionCheckoutCommand";
24
+ import { SubscriptionCheckoutOfferCommand } from "./SubscriptionCheckoutOfferCommand";
25
25
  import { SubscriptionGetCancellationOfferCommand } from "./SubscriptionGetCancellationOfferCommand";
26
26
  import { SubscriptionGetCommand } from "./SubscriptionGetCommand";
27
27
  import { SubscriptionListCommand } from "./SubscriptionListCommand";
@@ -33,7 +33,7 @@ export class SubscriptionCommand extends BaseNavigatorCommand
33
33
  super(argv, {
34
34
  "acceptcancellationoffer": SubscriptionAcceptCancellationOfferCommand,
35
35
  "cancel": SubscriptionCancelCommand,
36
- "checkout": SubscriptionCheckoutCommand,
36
+ "checkoutoffer": SubscriptionCheckoutOfferCommand,
37
37
  "list": SubscriptionListCommand,
38
38
  "getcancellationoffer": SubscriptionGetCancellationOfferCommand,
39
39
  "get": SubscriptionGetCommand,
package/src/index.ts CHANGED
@@ -59,7 +59,7 @@ export * from "./command/SubscriptionCancelCommand";
59
59
  export * from "./command/SubscriptionCancellationReasonCommand";
60
60
  export * from "./command/SubscriptionCancellationReasonGetCommand";
61
61
  export * from "./command/SubscriptionCancellationReasonListCommand";
62
- export * from "./command/SubscriptionCheckoutCommand";
62
+ export * from "./command/SubscriptionCheckoutOfferCommand";
63
63
  export * from "./command/SubscriptionCommand";
64
64
  export * from "./command/SubscriptionGetCancellationOfferCommand";
65
65
  export * from "./command/SubscriptionGetCommand";
@@ -20,6 +20,7 @@
20
20
 
21
21
  import { OfferItemRow } from "./OfferItemRow";
22
22
  import { OfferRecurringDurationUnit } from "../enum/OfferRecurringDurationUnit";
23
+ import { SubscriptionRow } from "./SubscriptionRow";
23
24
 
24
25
  export type OfferFullRow =
25
26
  {
@@ -40,4 +41,5 @@ export type OfferFullRow =
40
41
  created_at: Date;
41
42
  updated_at: Date;
42
43
  offer_item: OfferItemRow[];
44
+ subscription: SubscriptionRow;
43
45
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"SubscriptionCheckoutCommand.js","sourceRoot":"","sources":["../../src/command/SubscriptionCheckoutCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAAiD;AACjD,wEAAqE;AACrE,2DAAkD;AAElD,MAAa,2BAA4B,SAAQ,sCAAgB;IAE7D,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,EAAE;YACtB;gBACI,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,yCAAyC;gBACtD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,SAAS,CAAC;gBACjB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,aAAa;gBACnB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,6CAA6C;gBAC1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