namirasoft-payment 1.4.50 → 1.4.51
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.d.ts +2 -0
- package/dist/NamirasoftPaymentServer.js +3 -1
- package/dist/NamirasoftPaymentServer.js.map +1 -1
- package/dist/NamirasoftPaymentServerSubscriptionItem.d.ts +13 -0
- package/dist/NamirasoftPaymentServerSubscriptionItem.js +41 -0
- package/dist/NamirasoftPaymentServerSubscriptionItem.js.map +1 -0
- package/dist/command/SubscriptionItemCommand.d.ts +4 -0
- package/dist/command/SubscriptionItemCommand.js +17 -0
- package/dist/command/SubscriptionItemCommand.js.map +1 -0
- package/dist/command/SubscriptionItemGetCommand.d.ts +5 -0
- package/dist/command/SubscriptionItemGetCommand.js +38 -0
- package/dist/command/SubscriptionItemGetCommand.js.map +1 -0
- package/dist/command/SubscriptionItemListCommand.d.ts +5 -0
- package/dist/command/SubscriptionItemListCommand.js +38 -0
- package/dist/command/SubscriptionItemListCommand.js.map +1 -0
- package/dist/command/cli.js +2 -0
- package/dist/command/cli.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/row/SubscriptionItemRow.d.ts +10 -0
- package/dist/row/SubscriptionItemRow.js +3 -0
- package/dist/row/SubscriptionItemRow.js.map +1 -0
- package/package.json +2 -2
- package/src/NamirasoftPaymentServer.ts +4 -1
- package/src/NamirasoftPaymentServerSubscriptionItem.ts +49 -0
- package/src/command/SubscriptionItemCommand.ts +34 -0
- package/src/command/SubscriptionItemGetCommand.ts +45 -0
- package/src/command/SubscriptionItemListCommand.ts +45 -0
- package/src/command/cli.ts +2 -0
- package/src/index.ts +5 -0
- package/src/row/SubscriptionItemRow.ts +31 -0
|
@@ -7,6 +7,7 @@ import { NamirasoftPaymentServerPayment } from "./NamirasoftPaymentServerPayment
|
|
|
7
7
|
import { NamirasoftPaymentServerProduct } from "./NamirasoftPaymentServerProduct";
|
|
8
8
|
import { NamirasoftPaymentServerSalesItem } from "./NamirasoftPaymentServerSalesItem";
|
|
9
9
|
import { NamirasoftPaymentServerSubscription } from "./NamirasoftPaymentServerSubscription";
|
|
10
|
+
import { NamirasoftPaymentServerSubscriptionItem } from "./NamirasoftPaymentServerSubscriptionItem";
|
|
10
11
|
import { NamirasoftPaymentServerSubscriptionPaid } from "./NamirasoftPaymentServerSubscriptionPaid";
|
|
11
12
|
import { NamirasoftPaymentServerValue } from "./NamirasoftPaymentServerValue";
|
|
12
13
|
import { TokenManager } from "namirasoft-account";
|
|
@@ -18,6 +19,7 @@ export declare class NamirasoftPaymentServer extends NSABaseServer {
|
|
|
18
19
|
onetime: NamirasoftPaymentServerOneTime;
|
|
19
20
|
payment: NamirasoftPaymentServerPayment;
|
|
20
21
|
salesitem: NamirasoftPaymentServerSalesItem;
|
|
22
|
+
subscriptionitem: NamirasoftPaymentServerSubscriptionItem;
|
|
21
23
|
subscriptionpaid: NamirasoftPaymentServerSubscriptionPaid;
|
|
22
24
|
subscription: NamirasoftPaymentServerSubscription;
|
|
23
25
|
product: NamirasoftPaymentServerProduct;
|
|
@@ -10,11 +10,12 @@ const NamirasoftPaymentServerPayment_1 = require("./NamirasoftPaymentServerPayme
|
|
|
10
10
|
const NamirasoftPaymentServerProduct_1 = require("./NamirasoftPaymentServerProduct");
|
|
11
11
|
const NamirasoftPaymentServerSalesItem_1 = require("./NamirasoftPaymentServerSalesItem");
|
|
12
12
|
const NamirasoftPaymentServerSubscription_1 = require("./NamirasoftPaymentServerSubscription");
|
|
13
|
+
const NamirasoftPaymentServerSubscriptionItem_1 = require("./NamirasoftPaymentServerSubscriptionItem");
|
|
13
14
|
const NamirasoftPaymentServerSubscriptionPaid_1 = require("./NamirasoftPaymentServerSubscriptionPaid");
|
|
14
15
|
const NamirasoftPaymentServerValue_1 = require("./NamirasoftPaymentServerValue");
|
|
15
16
|
class NamirasoftPaymentServer extends namirasoft_account_1.NSABaseServer {
|
|
16
17
|
constructor(base_url, manager, onError) {
|
|
17
|
-
super(base_url, `1.4.
|
|
18
|
+
super(base_url, `1.4.51`, manager, onError);
|
|
18
19
|
this.healthz = new NamirasoftPaymentServerHealthz_1.NamirasoftPaymentServerHealthz(this);
|
|
19
20
|
this.value = new NamirasoftPaymentServerValue_1.NamirasoftPaymentServerValue(this);
|
|
20
21
|
this.invoice = new NamirasoftPaymentServerInvoice_1.NamirasoftPaymentServerInvoice(this);
|
|
@@ -22,6 +23,7 @@ class NamirasoftPaymentServer extends namirasoft_account_1.NSABaseServer {
|
|
|
22
23
|
this.onetime = new NamirasoftPaymentServerOneTime_1.NamirasoftPaymentServerOneTime(this);
|
|
23
24
|
this.payment = new NamirasoftPaymentServerPayment_1.NamirasoftPaymentServerPayment(this);
|
|
24
25
|
this.salesitem = new NamirasoftPaymentServerSalesItem_1.NamirasoftPaymentServerSalesItem(this);
|
|
26
|
+
this.subscriptionitem = new NamirasoftPaymentServerSubscriptionItem_1.NamirasoftPaymentServerSubscriptionItem(this);
|
|
25
27
|
this.subscriptionpaid = new NamirasoftPaymentServerSubscriptionPaid_1.NamirasoftPaymentServerSubscriptionPaid(this);
|
|
26
28
|
this.subscription = new NamirasoftPaymentServerSubscription_1.NamirasoftPaymentServerSubscription(this);
|
|
27
29
|
this.product = new NamirasoftPaymentServerProduct_1.NamirasoftPaymentServerProduct(this);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NamirasoftPaymentServer.js","sourceRoot":"","sources":["../src/NamirasoftPaymentServer.ts"],"names":[],"mappings":";;;AAoBA,2DAAmD;AACnD,qFAAkF;AAClF,qFAAkF;AAClF,iFAA8E;AAC9E,qFAAkF;AAClF,qFAAkF;AAClF,qFAAkF;AAClF,yFAAsF;AACtF,+FAA4F;AAC5F,uGAAoG;AACpG,iFAA8E;AAG9E,MAAa,uBAAwB,SAAQ,kCAAa;
|
|
1
|
+
{"version":3,"file":"NamirasoftPaymentServer.js","sourceRoot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+
import { FilterItem } from "namirasoft-core";
|
|
2
|
+
import { NamirasoftPaymentServer } from "./NamirasoftPaymentServer";
|
|
3
|
+
import { NamirasoftPaymentServerBase } from "./NamirasoftPaymentServerBase";
|
|
4
|
+
import { SortItem } from "namirasoft-core";
|
|
5
|
+
import { SubscriptionItemRow } from "./row/SubscriptionItemRow";
|
|
6
|
+
export declare class NamirasoftPaymentServerSubscriptionItem extends NamirasoftPaymentServerBase {
|
|
7
|
+
constructor(server: NamirasoftPaymentServer);
|
|
8
|
+
List(filters: FilterItem[] | null, page: (number | null), size: (number | null), sorts: SortItem[]): Promise<{
|
|
9
|
+
rows: SubscriptionItemRow[];
|
|
10
|
+
count: number;
|
|
11
|
+
}>;
|
|
12
|
+
Get(id: string): Promise<SubscriptionItemRow>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
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.NamirasoftPaymentServerSubscriptionItem = void 0;
|
|
13
|
+
const namirasoft_core_1 = require("namirasoft-core");
|
|
14
|
+
const NamirasoftPaymentServerBase_1 = require("./NamirasoftPaymentServerBase");
|
|
15
|
+
const namirasoft_core_2 = require("namirasoft-core");
|
|
16
|
+
class NamirasoftPaymentServerSubscriptionItem extends NamirasoftPaymentServerBase_1.NamirasoftPaymentServerBase {
|
|
17
|
+
constructor(server) {
|
|
18
|
+
super(server);
|
|
19
|
+
this.List = this.List.bind(this);
|
|
20
|
+
this.Get = this.Get.bind(this);
|
|
21
|
+
}
|
|
22
|
+
List(filters, page, size, sorts) {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
let filters_string_value = namirasoft_core_1.FilterItem.stringify(filters);
|
|
25
|
+
let sorts_string_value = namirasoft_core_2.SortItem.stringify(sorts);
|
|
26
|
+
let path = `/subscription/item/list`;
|
|
27
|
+
let { data } = yield this.server._get(path, { filters: filters_string_value, page, size, sorts: sorts_string_value });
|
|
28
|
+
return data;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
Get(id) {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
let path = `/subscription/item/${id}`;
|
|
34
|
+
let { data } = yield this.server._get(path, {});
|
|
35
|
+
return data;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.NamirasoftPaymentServerSubscriptionItem = NamirasoftPaymentServerSubscriptionItem;
|
|
40
|
+
;
|
|
41
|
+
//# sourceMappingURL=NamirasoftPaymentServerSubscriptionItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NamirasoftPaymentServerSubscriptionItem.js","sourceRoot":"","sources":["../src/NamirasoftPaymentServerSubscriptionItem.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,qDAA6C;AAE7C,+EAA4E;AAC5E,qDAA2C;AAG3C,MAAa,uCAAwC,SAAQ,yDAA2B;IAEpF,YAAY,MAA+B;QAEvC,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IACK,IAAI,CAAC,OAA4B,EAAE,IAAqB,EAAE,IAAqB,EAAE,KAAiB;;YAEpG,IAAI,oBAAoB,GAAW,4BAAU,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;YACjE,IAAI,kBAAkB,GAAW,0BAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YAC3D,IAAI,IAAI,GAAG,yBAAyB,CAAC;YACrC,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAiD,IAAI,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAC,CAAC;YACtK,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;IACK,GAAG,CAAC,EAAU;;YAEhB,IAAI,IAAI,GAAG,sBAAsB,EAAE,EAAE,CAAC;YACtC,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;AAtBD,0FAsBC;AAAA,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SubscriptionItemCommand = void 0;
|
|
4
|
+
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
|
5
|
+
const SubscriptionItemGetCommand_1 = require("./SubscriptionItemGetCommand");
|
|
6
|
+
const SubscriptionItemListCommand_1 = require("./SubscriptionItemListCommand");
|
|
7
|
+
class SubscriptionItemCommand extends namirasoft_node_cli_1.BaseNavigatorCommand {
|
|
8
|
+
constructor(argv) {
|
|
9
|
+
super(argv, {
|
|
10
|
+
"list": SubscriptionItemListCommand_1.SubscriptionItemListCommand,
|
|
11
|
+
"get": SubscriptionItemGetCommand_1.SubscriptionItemGetCommand,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.SubscriptionItemCommand = SubscriptionItemCommand;
|
|
16
|
+
;
|
|
17
|
+
//# sourceMappingURL=SubscriptionItemCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubscriptionItemCommand.js","sourceRoot":"","sources":["../../src/command/SubscriptionItemCommand.ts"],"names":[],"mappings":";;;AAoBA,6DAA2D;AAC3D,6EAA0E;AAC1E,+EAA4E;AAE5E,MAAa,uBAAwB,SAAQ,0CAAoB;IAE7D,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE;YACR,MAAM,EAAE,yDAA2B;YACnC,KAAK,EAAE,uDAA0B;SACpC,CAAC,CAAC;IACP,CAAC;CACJ;AATD,0DASC;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.SubscriptionItemGetCommand = 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 SubscriptionItemGetCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
|
18
|
+
constructor(argv) {
|
|
19
|
+
super(argv, ["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 \n{this.command} account login.");
|
|
26
|
+
let storage = new namirasoft_core_1.IStorageMemory();
|
|
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.subscriptionitem.Get(this.arg_values[0]);
|
|
32
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.SubscriptionItemGetCommand = SubscriptionItemGetCommand;
|
|
37
|
+
;
|
|
38
|
+
//# sourceMappingURL=SubscriptionItemGetCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubscriptionItemGetCommand.js","sourceRoot":"","sources":["../../src/command/SubscriptionItemGetCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAAiD;AACjD,wEAAqE;AACrE,2DAAkD;AAElD,MAAa,0BAA2B,SAAQ,sCAAgB;IAE5D,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAC5B,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,mHAAmH,CAAC,CAAC;YACzI,IAAI,OAAO,GAAG,IAAI,gCAAc,EAAE,CAAC;YACnC,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,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;YAChE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AAnBD,gEAmBC;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.SubscriptionItemListCommand = 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 SubscriptionItemListCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
|
18
|
+
constructor(argv) {
|
|
19
|
+
super(argv, ["filters", "page", "size", "sorts"], []);
|
|
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 \n{this.command} account login.");
|
|
26
|
+
let storage = new namirasoft_core_1.IStorageMemory();
|
|
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.subscriptionitem.List(this.arg_values[0], this.arg_values[1], this.arg_values[2], this.arg_values[3]);
|
|
32
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.SubscriptionItemListCommand = SubscriptionItemListCommand;
|
|
37
|
+
;
|
|
38
|
+
//# sourceMappingURL=SubscriptionItemListCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubscriptionItemListCommand.js","sourceRoot":"","sources":["../../src/command/SubscriptionItemListCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6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C;KAAA;CACJ;AAnBD,kEAmBC;AAAA,CAAC"}
|
package/dist/command/cli.js
CHANGED
|
@@ -12,6 +12,7 @@ const PaymentCommand_1 = require("./PaymentCommand");
|
|
|
12
12
|
const ProductCommand_1 = require("./ProductCommand");
|
|
13
13
|
const SalesItemCommand_1 = require("./SalesItemCommand");
|
|
14
14
|
const SubscriptionCommand_1 = require("./SubscriptionCommand");
|
|
15
|
+
const SubscriptionItemCommand_1 = require("./SubscriptionItemCommand");
|
|
15
16
|
const SubscriptionPaidCommand_1 = require("./SubscriptionPaidCommand");
|
|
16
17
|
const ValueCommand_1 = require("./ValueCommand");
|
|
17
18
|
let app = new namirasoft_node_cli_1.Application("ns-payment", new namirasoft_node_cli_1.BaseStorage(), {
|
|
@@ -22,6 +23,7 @@ let app = new namirasoft_node_cli_1.Application("ns-payment", new namirasoft_nod
|
|
|
22
23
|
"onetime": OneTimeCommand_1.OneTimeCommand,
|
|
23
24
|
"payment": PaymentCommand_1.PaymentCommand,
|
|
24
25
|
"salesitem": SalesItemCommand_1.SalesItemCommand,
|
|
26
|
+
"subscriptionitem": SubscriptionItemCommand_1.SubscriptionItemCommand,
|
|
25
27
|
"subscriptionpaid": SubscriptionPaidCommand_1.SubscriptionPaidCommand,
|
|
26
28
|
"subscription": SubscriptionCommand_1.SubscriptionCommand,
|
|
27
29
|
"product": ProductCommand_1.ProductCommand,
|
package/dist/command/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/command/cli.ts"],"names":[],"mappings":";;;AAqBA,2DAAoD;AACpD,6DAA+D;AAC/D,6DAAoD;AACpD,qDAAkD;AAClD,qDAAkD;AAClD,iDAA8C;AAC9C,qDAAkD;AAClD,qDAAkD;AAClD,qDAAkD;AAClD,yDAAsD;AACtD,+DAA4D;AAC5D,uEAAoE;AACpE,iDAA8C;AAE9C,IAAI,GAAG,GAAG,IAAI,iCAAW,CAAC,YAAY,EAAE,IAA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AAC,uBAAuB,CAAC,CAAC;CACnF,CAAC,CAAC;AACP,GAAG,CAAC,GAAG,EAAE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from "./NamirasoftPaymentServerPayment";
|
|
|
8
8
|
export * from "./NamirasoftPaymentServerProduct";
|
|
9
9
|
export * from "./NamirasoftPaymentServerSalesItem";
|
|
10
10
|
export * from "./NamirasoftPaymentServerSubscription";
|
|
11
|
+
export * from "./NamirasoftPaymentServerSubscriptionItem";
|
|
11
12
|
export * from "./NamirasoftPaymentServerSubscriptionPaid";
|
|
12
13
|
export * from "./NamirasoftPaymentServerValue";
|
|
13
14
|
export * from "./command/HealthzCommand";
|
|
@@ -36,6 +37,9 @@ export * from "./command/SubscriptionCancelCommand";
|
|
|
36
37
|
export * from "./command/SubscriptionCheckoutCommand";
|
|
37
38
|
export * from "./command/SubscriptionCommand";
|
|
38
39
|
export * from "./command/SubscriptionGetCommand";
|
|
40
|
+
export * from "./command/SubscriptionItemCommand";
|
|
41
|
+
export * from "./command/SubscriptionItemGetCommand";
|
|
42
|
+
export * from "./command/SubscriptionItemListCommand";
|
|
39
43
|
export * from "./command/SubscriptionListCommand";
|
|
40
44
|
export * from "./command/SubscriptionPaidCommand";
|
|
41
45
|
export * from "./command/SubscriptionPaidGetCommand";
|
|
@@ -84,5 +88,6 @@ export * from "./row/OfferRow";
|
|
|
84
88
|
export * from "./row/PaymentRow";
|
|
85
89
|
export * from "./row/ProductRow";
|
|
86
90
|
export * from "./row/SalesItemRow";
|
|
91
|
+
export * from "./row/SubscriptionItemRow";
|
|
87
92
|
export * from "./row/SubscriptionPaidRow";
|
|
88
93
|
export * from "./row/SubscriptionRow";
|
package/dist/index.js
CHANGED
|
@@ -24,6 +24,7 @@ __exportStar(require("./NamirasoftPaymentServerPayment"), exports);
|
|
|
24
24
|
__exportStar(require("./NamirasoftPaymentServerProduct"), exports);
|
|
25
25
|
__exportStar(require("./NamirasoftPaymentServerSalesItem"), exports);
|
|
26
26
|
__exportStar(require("./NamirasoftPaymentServerSubscription"), exports);
|
|
27
|
+
__exportStar(require("./NamirasoftPaymentServerSubscriptionItem"), exports);
|
|
27
28
|
__exportStar(require("./NamirasoftPaymentServerSubscriptionPaid"), exports);
|
|
28
29
|
__exportStar(require("./NamirasoftPaymentServerValue"), exports);
|
|
29
30
|
__exportStar(require("./command/HealthzCommand"), exports);
|
|
@@ -52,6 +53,9 @@ __exportStar(require("./command/SubscriptionCancelCommand"), exports);
|
|
|
52
53
|
__exportStar(require("./command/SubscriptionCheckoutCommand"), exports);
|
|
53
54
|
__exportStar(require("./command/SubscriptionCommand"), exports);
|
|
54
55
|
__exportStar(require("./command/SubscriptionGetCommand"), exports);
|
|
56
|
+
__exportStar(require("./command/SubscriptionItemCommand"), exports);
|
|
57
|
+
__exportStar(require("./command/SubscriptionItemGetCommand"), exports);
|
|
58
|
+
__exportStar(require("./command/SubscriptionItemListCommand"), exports);
|
|
55
59
|
__exportStar(require("./command/SubscriptionListCommand"), exports);
|
|
56
60
|
__exportStar(require("./command/SubscriptionPaidCommand"), exports);
|
|
57
61
|
__exportStar(require("./command/SubscriptionPaidGetCommand"), exports);
|
|
@@ -100,6 +104,7 @@ __exportStar(require("./row/OfferRow"), exports);
|
|
|
100
104
|
__exportStar(require("./row/PaymentRow"), exports);
|
|
101
105
|
__exportStar(require("./row/ProductRow"), exports);
|
|
102
106
|
__exportStar(require("./row/SalesItemRow"), exports);
|
|
107
|
+
__exportStar(require("./row/SubscriptionItemRow"), exports);
|
|
103
108
|
__exportStar(require("./row/SubscriptionPaidRow"), exports);
|
|
104
109
|
__exportStar(require("./row/SubscriptionRow"), exports);
|
|
105
110
|
//# sourceMappingURL=index.js.map
|
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;AAC9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xC,iEAA+C;AAC/C,4DAA0C;AAC1C,mEAAiD;AACjD,+DAA6C;AAC7C,mEAAiD;AACjD,uDAAqC;AACrC,4DAA0C;AAC1C,uDAAqC;AACrC,wDAAsC;AACtC,4DAA0C;AAC1C,mDAAiC;AACjC,qDAAmC;AACnC,qDAAmC;AACnC,iDAA+B;AAC/B,mDAAiC;AACjC,mDAAiC;AACjC,qDAAmC;AACnC,4DAA0C;AAC1C,4DAA0C;AAC1C,wDAAsC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubscriptionItemRow.js","sourceRoot":"","sources":["../../src/row/SubscriptionItemRow.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"framework": "npm",
|
|
9
9
|
"application": "package",
|
|
10
10
|
"private": false,
|
|
11
|
-
"version": "1.4.
|
|
11
|
+
"version": "1.4.51",
|
|
12
12
|
"author": "Amir Abolhasani",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"main": "./dist/index.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"build": ""
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"namirasoft-core": "^1.4.
|
|
20
|
+
"namirasoft-core": "^1.4.52",
|
|
21
21
|
"namirasoft-site": "^1.4.20",
|
|
22
22
|
"namirasoft-node-cli": "^1.4.5",
|
|
23
23
|
"namirasoft-account": "^1.4.66"
|
|
@@ -27,6 +27,7 @@ import { NamirasoftPaymentServerPayment } from "./NamirasoftPaymentServerPayment
|
|
|
27
27
|
import { NamirasoftPaymentServerProduct } from "./NamirasoftPaymentServerProduct";
|
|
28
28
|
import { NamirasoftPaymentServerSalesItem } from "./NamirasoftPaymentServerSalesItem";
|
|
29
29
|
import { NamirasoftPaymentServerSubscription } from "./NamirasoftPaymentServerSubscription";
|
|
30
|
+
import { NamirasoftPaymentServerSubscriptionItem } from "./NamirasoftPaymentServerSubscriptionItem";
|
|
30
31
|
import { NamirasoftPaymentServerSubscriptionPaid } from "./NamirasoftPaymentServerSubscriptionPaid";
|
|
31
32
|
import { NamirasoftPaymentServerValue } from "./NamirasoftPaymentServerValue";
|
|
32
33
|
import { TokenManager } from "namirasoft-account";
|
|
@@ -40,12 +41,13 @@ export class NamirasoftPaymentServer extends NSABaseServer
|
|
|
40
41
|
onetime: NamirasoftPaymentServerOneTime;
|
|
41
42
|
payment: NamirasoftPaymentServerPayment;
|
|
42
43
|
salesitem: NamirasoftPaymentServerSalesItem;
|
|
44
|
+
subscriptionitem: NamirasoftPaymentServerSubscriptionItem;
|
|
43
45
|
subscriptionpaid: NamirasoftPaymentServerSubscriptionPaid;
|
|
44
46
|
subscription: NamirasoftPaymentServerSubscription;
|
|
45
47
|
product: NamirasoftPaymentServerProduct;
|
|
46
48
|
constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void)
|
|
47
49
|
{
|
|
48
|
-
super(base_url, `1.4.
|
|
50
|
+
super(base_url, `1.4.51`, manager, onError);
|
|
49
51
|
this.healthz = new NamirasoftPaymentServerHealthz(this);
|
|
50
52
|
this.value = new NamirasoftPaymentServerValue(this);
|
|
51
53
|
this.invoice = new NamirasoftPaymentServerInvoice(this);
|
|
@@ -53,6 +55,7 @@ export class NamirasoftPaymentServer extends NSABaseServer
|
|
|
53
55
|
this.onetime = new NamirasoftPaymentServerOneTime(this);
|
|
54
56
|
this.payment = new NamirasoftPaymentServerPayment(this);
|
|
55
57
|
this.salesitem = new NamirasoftPaymentServerSalesItem(this);
|
|
58
|
+
this.subscriptionitem = new NamirasoftPaymentServerSubscriptionItem(this);
|
|
56
59
|
this.subscriptionpaid = new NamirasoftPaymentServerSubscriptionPaid(this);
|
|
57
60
|
this.subscription = new NamirasoftPaymentServerSubscription(this);
|
|
58
61
|
this.product = new NamirasoftPaymentServerProduct(this);
|
|
@@ -0,0 +1,49 @@
|
|
|
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 { FilterItem } from "namirasoft-core";
|
|
22
|
+
import { NamirasoftPaymentServer } from "./NamirasoftPaymentServer";
|
|
23
|
+
import { NamirasoftPaymentServerBase } from "./NamirasoftPaymentServerBase";
|
|
24
|
+
import { SortItem } from "namirasoft-core";
|
|
25
|
+
import { SubscriptionItemRow } from "./row/SubscriptionItemRow";
|
|
26
|
+
|
|
27
|
+
export class NamirasoftPaymentServerSubscriptionItem extends NamirasoftPaymentServerBase
|
|
28
|
+
{
|
|
29
|
+
constructor(server: NamirasoftPaymentServer)
|
|
30
|
+
{
|
|
31
|
+
super(server);
|
|
32
|
+
this.List = this.List.bind(this);
|
|
33
|
+
this.Get = this.Get.bind(this);
|
|
34
|
+
}
|
|
35
|
+
async List(filters: FilterItem[] | null, page: (number | null), size: (number | null), sorts: SortItem[]): Promise<{ rows: SubscriptionItemRow[], count: number }>
|
|
36
|
+
{
|
|
37
|
+
let filters_string_value: string = FilterItem.stringify(filters);
|
|
38
|
+
let sorts_string_value: string = SortItem.stringify(sorts);
|
|
39
|
+
let path = `/subscription/item/list`;
|
|
40
|
+
let { data } = await this.server._get<{ rows: SubscriptionItemRow[], count: number }>(path, { filters: filters_string_value, page, size, sorts: sorts_string_value });
|
|
41
|
+
return data;
|
|
42
|
+
}
|
|
43
|
+
async Get(id: string): Promise<SubscriptionItemRow>
|
|
44
|
+
{
|
|
45
|
+
let path = `/subscription/item/${id}`;
|
|
46
|
+
let { data } = await this.server._get<SubscriptionItemRow>(path, {});
|
|
47
|
+
return data;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
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 { BaseNavigatorCommand } from "namirasoft-node-cli";
|
|
22
|
+
import { SubscriptionItemGetCommand } from "./SubscriptionItemGetCommand";
|
|
23
|
+
import { SubscriptionItemListCommand } from "./SubscriptionItemListCommand";
|
|
24
|
+
|
|
25
|
+
export class SubscriptionItemCommand extends BaseNavigatorCommand
|
|
26
|
+
{
|
|
27
|
+
constructor(argv: string[])
|
|
28
|
+
{
|
|
29
|
+
super(argv, {
|
|
30
|
+
"list": SubscriptionItemListCommand,
|
|
31
|
+
"get": SubscriptionItemGetCommand,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
};
|
|
@@ -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 { IStorageMemory } from "namirasoft-core";
|
|
23
|
+
import { NamirasoftPaymentServer } from "../NamirasoftPaymentServer";
|
|
24
|
+
import { TokenManager } from "namirasoft-account";
|
|
25
|
+
|
|
26
|
+
export class SubscriptionItemGetCommand extends BaseFinalCommand
|
|
27
|
+
{
|
|
28
|
+
constructor(argv: string[])
|
|
29
|
+
{
|
|
30
|
+
super(argv, ["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 \n{this.command} account login.");
|
|
37
|
+
let storage = new IStorageMemory();
|
|
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.subscriptionitem.Get(this.arg_values[0]);
|
|
43
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
44
|
+
}
|
|
45
|
+
};
|
|
@@ -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 { IStorageMemory } from "namirasoft-core";
|
|
23
|
+
import { NamirasoftPaymentServer } from "../NamirasoftPaymentServer";
|
|
24
|
+
import { TokenManager } from "namirasoft-account";
|
|
25
|
+
|
|
26
|
+
export class SubscriptionItemListCommand extends BaseFinalCommand
|
|
27
|
+
{
|
|
28
|
+
constructor(argv: string[])
|
|
29
|
+
{
|
|
30
|
+
super(argv, ["filters", "page", "size", "sorts"], []);
|
|
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 \n{this.command} account login.");
|
|
37
|
+
let storage = new IStorageMemory();
|
|
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.subscriptionitem.List(this.arg_values[0], this.arg_values[1], this.arg_values[2], this.arg_values[3]);
|
|
43
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
44
|
+
}
|
|
45
|
+
};
|
package/src/command/cli.ts
CHANGED
|
@@ -30,6 +30,7 @@ import { PaymentCommand } from "./PaymentCommand";
|
|
|
30
30
|
import { ProductCommand } from "./ProductCommand";
|
|
31
31
|
import { SalesItemCommand } from "./SalesItemCommand";
|
|
32
32
|
import { SubscriptionCommand } from "./SubscriptionCommand";
|
|
33
|
+
import { SubscriptionItemCommand } from "./SubscriptionItemCommand";
|
|
33
34
|
import { SubscriptionPaidCommand } from "./SubscriptionPaidCommand";
|
|
34
35
|
import { ValueCommand } from "./ValueCommand";
|
|
35
36
|
|
|
@@ -42,6 +43,7 @@ let app = new Application("ns-payment", new BaseStorage(),
|
|
|
42
43
|
"onetime": OneTimeCommand,
|
|
43
44
|
"payment": PaymentCommand,
|
|
44
45
|
"salesitem": SalesItemCommand,
|
|
46
|
+
"subscriptionitem": SubscriptionItemCommand,
|
|
45
47
|
"subscriptionpaid": SubscriptionPaidCommand,
|
|
46
48
|
"subscription": SubscriptionCommand,
|
|
47
49
|
"product": ProductCommand,
|
package/src/index.ts
CHANGED
|
@@ -28,6 +28,7 @@ export * from "./NamirasoftPaymentServerPayment";
|
|
|
28
28
|
export * from "./NamirasoftPaymentServerProduct";
|
|
29
29
|
export * from "./NamirasoftPaymentServerSalesItem";
|
|
30
30
|
export * from "./NamirasoftPaymentServerSubscription";
|
|
31
|
+
export * from "./NamirasoftPaymentServerSubscriptionItem";
|
|
31
32
|
export * from "./NamirasoftPaymentServerSubscriptionPaid";
|
|
32
33
|
export * from "./NamirasoftPaymentServerValue";
|
|
33
34
|
export * from "./command/HealthzCommand";
|
|
@@ -56,6 +57,9 @@ export * from "./command/SubscriptionCancelCommand";
|
|
|
56
57
|
export * from "./command/SubscriptionCheckoutCommand";
|
|
57
58
|
export * from "./command/SubscriptionCommand";
|
|
58
59
|
export * from "./command/SubscriptionGetCommand";
|
|
60
|
+
export * from "./command/SubscriptionItemCommand";
|
|
61
|
+
export * from "./command/SubscriptionItemGetCommand";
|
|
62
|
+
export * from "./command/SubscriptionItemListCommand";
|
|
59
63
|
export * from "./command/SubscriptionListCommand";
|
|
60
64
|
export * from "./command/SubscriptionPaidCommand";
|
|
61
65
|
export * from "./command/SubscriptionPaidGetCommand";
|
|
@@ -104,5 +108,6 @@ export * from "./row/OfferRow";
|
|
|
104
108
|
export * from "./row/PaymentRow";
|
|
105
109
|
export * from "./row/ProductRow";
|
|
106
110
|
export * from "./row/SalesItemRow";
|
|
111
|
+
export * from "./row/SubscriptionItemRow";
|
|
107
112
|
export * from "./row/SubscriptionPaidRow";
|
|
108
113
|
export * from "./row/SubscriptionRow";
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
export type SubscriptionItemRow =
|
|
22
|
+
{
|
|
23
|
+
id: number;
|
|
24
|
+
subscription_id: string;
|
|
25
|
+
sales_item_id: string;
|
|
26
|
+
offer_id: string;
|
|
27
|
+
offer_item_id: string;
|
|
28
|
+
quantity: number;
|
|
29
|
+
created_at: Date;
|
|
30
|
+
updated_at: Date;
|
|
31
|
+
}
|