namirasoft-payment 1.4.130 → 1.4.131
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.
- package/dist/NamirasoftPaymentServer.js +1 -1
- package/dist/NamirasoftPaymentServerSubscription.d.ts +1 -0
- package/dist/NamirasoftPaymentServerSubscription.js +8 -0
- package/dist/NamirasoftPaymentServerSubscription.js.map +1 -1
- package/dist/command/SubscriptionCommand.js +2 -0
- package/dist/command/SubscriptionCommand.js.map +1 -1
- package/dist/command/SubscriptionGetValidationCommand.d.ts +5 -0
- package/dist/command/SubscriptionGetValidationCommand.js +38 -0
- package/dist/command/SubscriptionGetValidationCommand.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/NamirasoftPaymentServer.ts +1 -1
- package/src/NamirasoftPaymentServerSubscription.ts +7 -0
- package/src/command/SubscriptionCommand.ts +2 -0
- package/src/command/SubscriptionGetValidationCommand.ts +45 -0
- package/src/index.ts +1 -0
|
@@ -20,7 +20,7 @@ const NamirasoftPaymentServerTrial_1 = require("./NamirasoftPaymentServerTrial")
|
|
|
20
20
|
const NamirasoftPaymentServerValue_1 = require("./NamirasoftPaymentServerValue");
|
|
21
21
|
class NamirasoftPaymentServer extends namirasoft_account_1.NSABaseServer {
|
|
22
22
|
constructor(base_url, manager, onError) {
|
|
23
|
-
super(base_url, `1.4.
|
|
23
|
+
super(base_url, `1.4.131`, manager, onError);
|
|
24
24
|
this.healthz = new NamirasoftPaymentServerHealthz_1.NamirasoftPaymentServerHealthz(this);
|
|
25
25
|
this.metrics = new NamirasoftPaymentServerMetrics_1.NamirasoftPaymentServerMetrics(this);
|
|
26
26
|
this.value = new NamirasoftPaymentServerValue_1.NamirasoftPaymentServerValue(this);
|
|
@@ -10,6 +10,7 @@ import { SubscriptionValidation } from "./SubscriptionValidation";
|
|
|
10
10
|
export declare class NamirasoftPaymentServerSubscription extends NamirasoftPaymentServerBase {
|
|
11
11
|
constructor(server: NamirasoftPaymentServer);
|
|
12
12
|
_GetValidationFor(user_id: string, sales_item_id: string, config?: BaseServerConfig<any>): Promise<SubscriptionValidation>;
|
|
13
|
+
GetValidation(sales_item_id: string, config?: BaseServerConfig<any>): Promise<SubscriptionValidation>;
|
|
13
14
|
AcceptCancellationOffer(id: string, reason_id: string, body: {
|
|
14
15
|
gateway: GatewayType;
|
|
15
16
|
success_url: string;
|
|
@@ -17,6 +17,7 @@ class NamirasoftPaymentServerSubscription extends NamirasoftPaymentServerBase_1.
|
|
|
17
17
|
constructor(server) {
|
|
18
18
|
super(server);
|
|
19
19
|
this._GetValidationFor = this._GetValidationFor.bind(this);
|
|
20
|
+
this.GetValidation = this.GetValidation.bind(this);
|
|
20
21
|
this.AcceptCancellationOffer = this.AcceptCancellationOffer.bind(this);
|
|
21
22
|
this.Cancel = this.Cancel.bind(this);
|
|
22
23
|
this.List = this.List.bind(this);
|
|
@@ -30,6 +31,13 @@ class NamirasoftPaymentServerSubscription extends NamirasoftPaymentServerBase_1.
|
|
|
30
31
|
return data;
|
|
31
32
|
});
|
|
32
33
|
}
|
|
34
|
+
GetValidation(sales_item_id, config) {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
let path = `subscription/validation/sales_item/${sales_item_id}`;
|
|
37
|
+
let { data } = yield this.server._get(path, {}, config);
|
|
38
|
+
return data;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
33
41
|
AcceptCancellationOffer(id, reason_id, body, config) {
|
|
34
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
35
43
|
let path = `/subscription/${id}/accept/cancellation/offer/reason/${reason_id}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NamirasoftPaymentServerSubscription.js","sourceRoot":"","sources":["../src/NamirasoftPaymentServerSubscription.ts"],"names":[],"mappings":";;;;;;;;;;;;AAqBA,qDAA6C;AAG7C,+EAA4E;AAC5E,qDAA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,CAAC;KAAA;IACK,oBAAoB,CAAC,EAAU,EAAE,SAAiB,EAAE,MAA8B;;YAEpF,IAAI,IAAI,GAAG,iBAAiB,EAAE,8BAA8B,SAAS,EAAE,CAAC;YACxE,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAuB,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;YAC9E,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;IACK,GAAG,CAAC,EAAU,EAAE,MAA8B;;YAEhD,IAAI,IAAI,GAAG,iBAAiB,EAAE,EAAE,CAAC;YACjC,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAsB,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;YAC7E,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;CACJ;AAxDD,kFAwDC;AAAA,CAAC"}
|
|
@@ -6,12 +6,14 @@ const SubscriptionAcceptCancellationOfferCommand_1 = require("./SubscriptionAcce
|
|
|
6
6
|
const SubscriptionCancelCommand_1 = require("./SubscriptionCancelCommand");
|
|
7
7
|
const SubscriptionGetCancellationOfferCommand_1 = require("./SubscriptionGetCancellationOfferCommand");
|
|
8
8
|
const SubscriptionGetCommand_1 = require("./SubscriptionGetCommand");
|
|
9
|
+
const SubscriptionGetValidationCommand_1 = require("./SubscriptionGetValidationCommand");
|
|
9
10
|
const SubscriptionListCommand_1 = require("./SubscriptionListCommand");
|
|
10
11
|
const Subscription_GetValidationForCommand_1 = require("./Subscription_GetValidationForCommand");
|
|
11
12
|
class SubscriptionCommand extends namirasoft_node_cli_1.BaseNavigatorCommand {
|
|
12
13
|
constructor(argv) {
|
|
13
14
|
super(argv, {
|
|
14
15
|
"_getvalidationfor": Subscription_GetValidationForCommand_1.Subscription_GetValidationForCommand,
|
|
16
|
+
"getvalidation": SubscriptionGetValidationCommand_1.SubscriptionGetValidationCommand,
|
|
15
17
|
"acceptcancellationoffer": SubscriptionAcceptCancellationOfferCommand_1.SubscriptionAcceptCancellationOfferCommand,
|
|
16
18
|
"cancel": SubscriptionCancelCommand_1.SubscriptionCancelCommand,
|
|
17
19
|
"list": SubscriptionListCommand_1.SubscriptionListCommand,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubscriptionCommand.js","sourceRoot":"","sources":["../../src/command/SubscriptionCommand.ts"],"names":[],"mappings":";;;AAoBA,6DAA2D;AAC3D,6GAA0G;AAC1G,2EAAwE;AACxE,uGAAoG;AACpG,qEAAkE;AAClE,uEAAoE;AACpE,iGAA8F;AAE9F,MAAa,mBAAoB,SAAQ,0CAAoB;IAEzD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE;YACR,mBAAmB,EAAE,2EAAoC;YACzD,yBAAyB,EAAE,uFAA0C;YACrE,QAAQ,EAAE,qDAAyB;YACnC,MAAM,EAAE,iDAAuB;YAC/B,sBAAsB,EAAE,iFAAuC;YAC/D,KAAK,EAAE,+CAAsB;SAChC,CAAC,CAAC;IACP,CAAC;CACJ;
|
|
1
|
+
{"version":3,"file":"SubscriptionCommand.js","sourceRoot":"","sources":["../../src/command/SubscriptionCommand.ts"],"names":[],"mappings":";;;AAoBA,6DAA2D;AAC3D,6GAA0G;AAC1G,2EAAwE;AACxE,uGAAoG;AACpG,qEAAkE;AAClE,yFAAsF;AACtF,uEAAoE;AACpE,iGAA8F;AAE9F,MAAa,mBAAoB,SAAQ,0CAAoB;IAEzD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE;YACR,mBAAmB,EAAE,2EAAoC;YACzD,eAAe,EAAE,mEAAgC;YACjD,yBAAyB,EAAE,uFAA0C;YACrE,QAAQ,EAAE,qDAAyB;YACnC,MAAM,EAAE,iDAAuB;YAC/B,sBAAsB,EAAE,iFAAuC;YAC/D,KAAK,EAAE,+CAAsB;SAChC,CAAC,CAAC;IACP,CAAC;CACJ;AAdD,kDAcC;AAAA,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SubscriptionGetValidationCommand = void 0;
|
|
13
|
+
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
|
14
|
+
const namirasoft_core_1 = require("namirasoft-core");
|
|
15
|
+
const NamirasoftPaymentServer_1 = require("../NamirasoftPaymentServer");
|
|
16
|
+
const namirasoft_account_1 = require("namirasoft-account");
|
|
17
|
+
class SubscriptionGetValidationCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
|
18
|
+
constructor(argv) {
|
|
19
|
+
super(argv, ["sales_item_id"], []);
|
|
20
|
+
}
|
|
21
|
+
exec() {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
let token = this.app.storage.getNSAToken();
|
|
24
|
+
if (token == null)
|
|
25
|
+
throw new Error("Token is not available. Please login first using:\nns-payment account config \nor \nns-payment account login.");
|
|
26
|
+
let storage = new namirasoft_core_1.IStorageMemoryDedicated();
|
|
27
|
+
let manager = new namirasoft_account_1.TokenManager(storage, () => { });
|
|
28
|
+
manager.setValue(token, false);
|
|
29
|
+
let url = this.app.storage.getItem("ns-payment-server-url");
|
|
30
|
+
let server = new NamirasoftPaymentServer_1.NamirasoftPaymentServer(url, manager, e => this.app.logger.error(e.message));
|
|
31
|
+
let ans = yield server.subscription.GetValidation(this.arg_values[0]);
|
|
32
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.SubscriptionGetValidationCommand = SubscriptionGetValidationCommand;
|
|
37
|
+
;
|
|
38
|
+
//# sourceMappingURL=SubscriptionGetValidationCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubscriptionGetValidationCommand.js","sourceRoot":"","sources":["../../src/command/SubscriptionGetValidationCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAA0D;AAC1D,wEAAqE;AACrE,2DAAkD;AAElD,MAAa,gCAAiC,SAAQ,sCAAgB;IAElE,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC,CAAC;IACvC,CAAC;IACc,IAAI;;YAEf,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;YAC3C,IAAI,KAAK,IAAI,IAAI;gBACb,MAAM,IAAI,KAAK,CAAC,+GAA+G,CAAC,CAAC;YACrI,IAAI,OAAO,GAAG,IAAI,yCAAuB,EAAE,CAAC;YAC5C,IAAI,OAAO,GAAG,IAAI,iCAAY,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;YACnD,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YAC/B,IAAI,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC;YAC5D,IAAI,MAAM,GAAG,IAAI,iDAAuB,CAAC,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,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,CAAC,CAAC;YACtE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AAnBD,4EAmBC;AAAA,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -58,6 +58,7 @@ export * from "./command/SubscriptionCancellationReasonListCommand";
|
|
|
58
58
|
export * from "./command/SubscriptionCommand";
|
|
59
59
|
export * from "./command/SubscriptionGetCancellationOfferCommand";
|
|
60
60
|
export * from "./command/SubscriptionGetCommand";
|
|
61
|
+
export * from "./command/SubscriptionGetValidationCommand";
|
|
61
62
|
export * from "./command/SubscriptionItemCommand";
|
|
62
63
|
export * from "./command/SubscriptionItemListCommand";
|
|
63
64
|
export * from "./command/SubscriptionListCommand";
|
package/dist/index.js
CHANGED
|
@@ -74,6 +74,7 @@ __exportStar(require("./command/SubscriptionCancellationReasonListCommand"), exp
|
|
|
74
74
|
__exportStar(require("./command/SubscriptionCommand"), exports);
|
|
75
75
|
__exportStar(require("./command/SubscriptionGetCancellationOfferCommand"), exports);
|
|
76
76
|
__exportStar(require("./command/SubscriptionGetCommand"), exports);
|
|
77
|
+
__exportStar(require("./command/SubscriptionGetValidationCommand"), exports);
|
|
77
78
|
__exportStar(require("./command/SubscriptionItemCommand"), exports);
|
|
78
79
|
__exportStar(require("./command/SubscriptionItemListCommand"), exports);
|
|
79
80
|
__exportStar(require("./command/SubscriptionListCommand"), 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,gEAA8C;AA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C;AACrC,mDAAiC;AACjC,qDAAmC;AACnC,yDAAuC;AACvC,qDAAmC;AACnC,iDAA+B;AAC/B,mDAAiC;AACjC,mDAAiC;AACjC,yDAAuC;AACvC,qDAAmC;AACnC,0EAAwD;AACxD,4DAA0C;AAC1C,4DAA0C;AAC1C,4DAA0C;AAC1C,wDAAsC;AACtC,iDAA+B"}
|
package/package.json
CHANGED
|
@@ -57,7 +57,7 @@ export class NamirasoftPaymentServer extends NSABaseServer
|
|
|
57
57
|
product: NamirasoftPaymentServerProduct;
|
|
58
58
|
constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void)
|
|
59
59
|
{
|
|
60
|
-
super(base_url, `1.4.
|
|
60
|
+
super(base_url, `1.4.131`, manager, onError);
|
|
61
61
|
this.healthz = new NamirasoftPaymentServerHealthz(this);
|
|
62
62
|
this.metrics = new NamirasoftPaymentServerMetrics(this);
|
|
63
63
|
this.value = new NamirasoftPaymentServerValue(this);
|
|
@@ -34,6 +34,7 @@ export class NamirasoftPaymentServerSubscription extends NamirasoftPaymentServer
|
|
|
34
34
|
{
|
|
35
35
|
super(server);
|
|
36
36
|
this._GetValidationFor = this._GetValidationFor.bind(this);
|
|
37
|
+
this.GetValidation = this.GetValidation.bind(this);
|
|
37
38
|
this.AcceptCancellationOffer = this.AcceptCancellationOffer.bind(this);
|
|
38
39
|
this.Cancel = this.Cancel.bind(this);
|
|
39
40
|
this.List = this.List.bind(this);
|
|
@@ -46,6 +47,12 @@ export class NamirasoftPaymentServerSubscription extends NamirasoftPaymentServer
|
|
|
46
47
|
let { data } = await this.server._get<SubscriptionValidation>(path, {}, config);
|
|
47
48
|
return data;
|
|
48
49
|
}
|
|
50
|
+
async GetValidation(sales_item_id: string, config?: BaseServerConfig<any>): Promise<SubscriptionValidation>
|
|
51
|
+
{
|
|
52
|
+
let path = `subscription/validation/sales_item/${sales_item_id}`;
|
|
53
|
+
let { data } = await this.server._get<SubscriptionValidation>(path, {}, config);
|
|
54
|
+
return data;
|
|
55
|
+
}
|
|
49
56
|
async AcceptCancellationOffer(id: string, reason_id: string, body: { gateway: GatewayType, success_url: string, cancel_url: string }, config?: BaseServerConfig<any>): Promise<{ url: string }>
|
|
50
57
|
{
|
|
51
58
|
let path = `/subscription/${id}/accept/cancellation/offer/reason/${reason_id}`;
|
|
@@ -23,6 +23,7 @@ import { SubscriptionAcceptCancellationOfferCommand } from "./SubscriptionAccept
|
|
|
23
23
|
import { SubscriptionCancelCommand } from "./SubscriptionCancelCommand";
|
|
24
24
|
import { SubscriptionGetCancellationOfferCommand } from "./SubscriptionGetCancellationOfferCommand";
|
|
25
25
|
import { SubscriptionGetCommand } from "./SubscriptionGetCommand";
|
|
26
|
+
import { SubscriptionGetValidationCommand } from "./SubscriptionGetValidationCommand";
|
|
26
27
|
import { SubscriptionListCommand } from "./SubscriptionListCommand";
|
|
27
28
|
import { Subscription_GetValidationForCommand } from "./Subscription_GetValidationForCommand";
|
|
28
29
|
|
|
@@ -32,6 +33,7 @@ export class SubscriptionCommand extends BaseNavigatorCommand
|
|
|
32
33
|
{
|
|
33
34
|
super(argv, {
|
|
34
35
|
"_getvalidationfor": Subscription_GetValidationForCommand,
|
|
36
|
+
"getvalidation": SubscriptionGetValidationCommand,
|
|
35
37
|
"acceptcancellationoffer": SubscriptionAcceptCancellationOfferCommand,
|
|
36
38
|
"cancel": SubscriptionCancelCommand,
|
|
37
39
|
"list": SubscriptionListCommand,
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any change is required, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { BaseFinalCommand } from "namirasoft-node-cli";
|
|
22
|
+
import { IStorageMemoryDedicated } from "namirasoft-core";
|
|
23
|
+
import { NamirasoftPaymentServer } from "../NamirasoftPaymentServer";
|
|
24
|
+
import { TokenManager } from "namirasoft-account";
|
|
25
|
+
|
|
26
|
+
export class SubscriptionGetValidationCommand extends BaseFinalCommand
|
|
27
|
+
{
|
|
28
|
+
constructor(argv: string[])
|
|
29
|
+
{
|
|
30
|
+
super(argv, ["sales_item_id"], []);
|
|
31
|
+
}
|
|
32
|
+
override async exec()
|
|
33
|
+
{
|
|
34
|
+
let token = this.app.storage.getNSAToken();
|
|
35
|
+
if (token == null)
|
|
36
|
+
throw new Error("Token is not available. Please login first using:\nns-payment account config \nor \nns-payment account login.");
|
|
37
|
+
let storage = new IStorageMemoryDedicated();
|
|
38
|
+
let manager = new TokenManager(storage, () => { });
|
|
39
|
+
manager.setValue(token, false);
|
|
40
|
+
let url = this.app.storage.getItem("ns-payment-server-url");
|
|
41
|
+
let server = new NamirasoftPaymentServer(url, manager, e => this.app.logger.error(e.message));
|
|
42
|
+
let ans = await server.subscription.GetValidation(this.arg_values[0]);
|
|
43
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
44
|
+
}
|
|
45
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -78,6 +78,7 @@ export * from "./command/SubscriptionCancellationReasonListCommand";
|
|
|
78
78
|
export * from "./command/SubscriptionCommand";
|
|
79
79
|
export * from "./command/SubscriptionGetCancellationOfferCommand";
|
|
80
80
|
export * from "./command/SubscriptionGetCommand";
|
|
81
|
+
export * from "./command/SubscriptionGetValidationCommand";
|
|
81
82
|
export * from "./command/SubscriptionItemCommand";
|
|
82
83
|
export * from "./command/SubscriptionItemListCommand";
|
|
83
84
|
export * from "./command/SubscriptionListCommand";
|