namirasoft-payment 1.4.79 → 1.4.81
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/.ns-sdkg-file-keep +1 -1
- package/dist/SubscriptionValidation.d.ts +8 -5
- package/dist/SubscriptionValidation.js +23 -16
- package/dist/SubscriptionValidation.js.map +1 -1
- package/package.json +27 -27
- package/src/NamirasoftPaymentServer.ts +68 -68
- package/src/NamirasoftPaymentServerBase.ts +29 -29
- package/src/NamirasoftPaymentServerHealthz.ts +35 -35
- package/src/NamirasoftPaymentServerInvoice.ts +69 -69
- package/src/NamirasoftPaymentServerMeter.ts +36 -36
- package/src/NamirasoftPaymentServerOffer.ts +51 -51
- package/src/NamirasoftPaymentServerOneTime.ts +37 -37
- package/src/NamirasoftPaymentServerPayment.ts +48 -48
- package/src/NamirasoftPaymentServerProduct.ts +48 -48
- package/src/NamirasoftPaymentServerSalesItem.ts +48 -48
- package/src/NamirasoftPaymentServerSubscription.ts +77 -77
- package/src/NamirasoftPaymentServerSubscriptionCancellationReason.ts +48 -48
- package/src/NamirasoftPaymentServerSubscriptionItem.ts +41 -41
- package/src/NamirasoftPaymentServerSubscriptionPaid.ts +55 -55
- package/src/NamirasoftPaymentServerValue.ts +36 -36
- package/src/PaymentUUID.ts +70 -70
- package/src/SubscriptionValidation.ts +57 -48
- package/src/command/HealthzCommand.ts +31 -31
- package/src/command/HealthzGetCommand.ts +44 -44
- package/src/command/InvoiceCancelCommand.ts +44 -44
- package/src/command/InvoiceCommand.ts +39 -39
- package/src/command/InvoiceGetCommand.ts +44 -44
- package/src/command/InvoiceListCommand.ts +44 -44
- package/src/command/Invoice_CreateForCommand.ts +109 -109
- package/src/command/Invoice_DeleteForCommand.ts +44 -44
- package/src/command/MeterCommand.ts +31 -31
- package/src/command/Meter_RecordForCommand.ts +91 -91
- package/src/command/OfferCommand.ts +33 -33
- package/src/command/OfferGetCommand.ts +44 -44
- package/src/command/OfferListCommand.ts +44 -44
- package/src/command/OneTimeCheckoutCommand.ts +82 -82
- package/src/command/OneTimeCommand.ts +31 -31
- package/src/command/PaymentCommand.ts +33 -33
- package/src/command/PaymentGetCommand.ts +44 -44
- package/src/command/PaymentListCommand.ts +44 -44
- package/src/command/ProductCommand.ts +33 -33
- package/src/command/ProductGetCommand.ts +44 -44
- package/src/command/ProductListCommand.ts +44 -44
- package/src/command/SalesItemCommand.ts +33 -33
- package/src/command/SalesItemGetCommand.ts +44 -44
- package/src/command/SalesItemListCommand.ts +44 -44
- package/src/command/SubscriptionAcceptCancellationOfferCommand.ts +73 -73
- package/src/command/SubscriptionCancelCommand.ts +64 -64
- package/src/command/SubscriptionCancellationReasonCommand.ts +33 -33
- package/src/command/SubscriptionCancellationReasonGetCommand.ts +44 -44
- package/src/command/SubscriptionCancellationReasonListCommand.ts +44 -44
- package/src/command/SubscriptionCheckoutOfferCommand.ts +73 -73
- package/src/command/SubscriptionCommand.ts +41 -41
- package/src/command/SubscriptionGetCancellationOfferCommand.ts +44 -44
- package/src/command/SubscriptionGetCommand.ts +44 -44
- package/src/command/SubscriptionItemCommand.ts +31 -31
- package/src/command/SubscriptionItemListCommand.ts +44 -44
- package/src/command/SubscriptionListCommand.ts +44 -44
- package/src/command/SubscriptionPaidCommand.ts +35 -35
- package/src/command/SubscriptionPaidGetCommand.ts +44 -44
- package/src/command/SubscriptionPaidListCommand.ts +44 -44
- package/src/command/SubscriptionPaid_ListForCommand.ts +44 -44
- package/src/command/ValueCommand.ts +31 -31
- package/src/command/ValueListCommand.ts +44 -44
- package/src/command/cli.ts +56 -56
- package/src/enum/GatewayType.ts +23 -23
- package/src/enum/InvoiceCostType.ts +25 -25
- package/src/enum/OfferItemExpireUnit.ts +27 -27
- package/src/enum/OfferItemOneOffModel.ts +25 -25
- package/src/enum/OfferItemRecurringDurationUnit.ts +26 -26
- package/src/enum/OfferItemRecurringModel.ts +26 -26
- package/src/enum/OfferItemRecurringTieredType.ts +24 -24
- package/src/enum/OfferItemRecurringUsageTieredType.ts +24 -24
- package/src/enum/OfferItemRecurringUsageType.ts +25 -25
- package/src/enum/OfferItemType.ts +24 -24
- package/src/enum/OfferRecurringDurationUnit.ts +26 -26
- package/src/enum/PaymentGateway.ts +23 -23
- package/src/enum/PaymentStatus.ts +26 -26
- package/src/enum/SalesItemExpireUnit.ts +27 -27
- package/src/enum/SubscriptionGateway.ts +23 -23
- package/src/enum/SubscriptionStatus.ts +30 -30
- package/src/index.ts +125 -125
- package/src/meta/InvoiceCostMetaTable.ts +59 -59
- package/src/meta/InvoiceItemMetaTable.ts +75 -75
- package/src/meta/InvoiceMetaTable.ts +87 -87
- package/src/meta/NamirasoftPaymentMetaDatabase.ts +83 -83
- package/src/meta/OfferItemMetaTable.ts +137 -137
- package/src/meta/OfferMetaTable.ts +77 -77
- package/src/meta/PaymentMetaTable.ts +75 -75
- package/src/meta/ProductMetaTable.ts +59 -59
- package/src/meta/SalesItemMetaTable.ts +73 -73
- package/src/meta/SubscriptionCancellationReasonMetaTable.ts +67 -67
- package/src/meta/SubscriptionItemMetaTable.ts +61 -61
- package/src/meta/SubscriptionMetaTable.ts +65 -65
- package/src/meta/SubscriptionPaidMetaTable.ts +65 -65
- package/src/row/InvoiceCostInputRow.ts +27 -27
- package/src/row/InvoiceCostRow.ts +31 -31
- package/src/row/InvoiceFullRow.ts +48 -48
- package/src/row/InvoiceInputRow.ts +32 -32
- package/src/row/InvoiceItemInputRow.ts +29 -29
- package/src/row/InvoiceItemRow.ts +37 -37
- package/src/row/InvoiceRow.ts +43 -43
- package/src/row/OfferFullRow.ts +44 -44
- package/src/row/OfferItemRow.ts +77 -77
- package/src/row/OfferRow.ts +40 -40
- package/src/row/PaymentRow.ts +40 -40
- package/src/row/ProductRow.ts +29 -29
- package/src/row/SalesItemRow.ts +38 -38
- package/src/row/SubscriptionCancellationReasonRow.ts +33 -33
- package/src/row/SubscriptionFullRow.ts +37 -37
- package/src/row/SubscriptionItemRow.ts +30 -30
- package/src/row/SubscriptionPaidRow.ts +32 -32
- package/src/row/SubscriptionRow.ts +35 -35
package/.ns-sdkg-file-keep
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
src/PaymentUUID.ts
|
|
1
|
+
src/PaymentUUID.ts
|
|
2
2
|
src/SubscriptionValidation.ts
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { SubscriptionPaidRow } from "./row/SubscriptionPaidRow";
|
|
2
|
+
import { SubscriptionRow } from "./row/SubscriptionRow";
|
|
2
3
|
export declare class SubscriptionValidation {
|
|
3
4
|
date: Date;
|
|
4
5
|
valid: boolean;
|
|
5
6
|
valid_row: SubscriptionPaidRow | null;
|
|
6
7
|
valid_date: Date | null;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
subscriptions: SubscriptionRow[] | null;
|
|
9
|
+
paids: SubscriptionPaidRow[] | null;
|
|
10
|
+
constructor(subscriptions: SubscriptionRow[] | null, paids: SubscriptionPaidRow[] | null);
|
|
11
|
+
static isSubscribed(validation: SubscriptionValidation, sales_item_id: string, offer_id: string): boolean;
|
|
12
|
+
static isValid(validation: SubscriptionValidation, now?: Date | null): boolean;
|
|
13
|
+
static getValid(validation: SubscriptionValidation, now?: Date | null): SubscriptionPaidRow | null;
|
|
14
|
+
static getValidDateTo(validation: SubscriptionValidation, now?: Date | null): Date | null;
|
|
12
15
|
}
|
|
@@ -1,37 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SubscriptionValidation = void 0;
|
|
4
|
+
const SubscriptionStatus_1 = require("./enum/SubscriptionStatus");
|
|
4
5
|
class SubscriptionValidation {
|
|
5
|
-
constructor(
|
|
6
|
+
constructor(subscriptions, paids) {
|
|
6
7
|
this.date = new Date();
|
|
7
|
-
this.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
this.subscriptions = subscriptions;
|
|
9
|
+
this.paids = paids;
|
|
10
|
+
if (paids)
|
|
11
|
+
for (let i = 0; i < paids.length; i++) {
|
|
12
|
+
const row = paids[i];
|
|
11
13
|
row.applies_at = new Date(row.applies_at);
|
|
12
14
|
row.expires_at = new Date(row.expires_at);
|
|
13
15
|
}
|
|
14
|
-
this.valid =
|
|
15
|
-
this.valid_row =
|
|
16
|
-
this.valid_date =
|
|
16
|
+
this.valid = SubscriptionValidation.isValid(this, this.date);
|
|
17
|
+
this.valid_row = SubscriptionValidation.getValid(this, this.date);
|
|
18
|
+
this.valid_date = SubscriptionValidation.getValidDateTo(this, this.date);
|
|
17
19
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
static isSubscribed(validation, sales_item_id, offer_id) {
|
|
21
|
+
var _a;
|
|
22
|
+
let s = ((_a = validation.subscriptions) !== null && _a !== void 0 ? _a : []).filter(s => s.status === SubscriptionStatus_1.SubscriptionStatus.Active).filter(s => s.sales_item_id == sales_item_id && (offer_id == null || s.offer_id == offer_id));
|
|
23
|
+
return s.length > 0;
|
|
20
24
|
}
|
|
21
|
-
|
|
25
|
+
static isValid(validation, now = null) {
|
|
26
|
+
return SubscriptionValidation.getValid(validation, now) != null;
|
|
27
|
+
}
|
|
28
|
+
static getValid(validation, now = null) {
|
|
22
29
|
if (now == null)
|
|
23
30
|
now = new Date();
|
|
24
|
-
if (
|
|
25
|
-
for (let i = 0; i <
|
|
26
|
-
const row =
|
|
31
|
+
if (validation.paids)
|
|
32
|
+
for (let i = 0; i < validation.paids.length; i++) {
|
|
33
|
+
const row = validation.paids[i];
|
|
27
34
|
if (row.applies_at <= now)
|
|
28
35
|
if (now <= row.expires_at)
|
|
29
36
|
return row;
|
|
30
37
|
}
|
|
31
38
|
return null;
|
|
32
39
|
}
|
|
33
|
-
getValidDateTo(now = null) {
|
|
34
|
-
let row =
|
|
40
|
+
static getValidDateTo(validation, now = null) {
|
|
41
|
+
let row = SubscriptionValidation.getValid(validation, now);
|
|
35
42
|
if (row)
|
|
36
43
|
return row.expires_at;
|
|
37
44
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubscriptionValidation.js","sourceRoot":"","sources":["../src/SubscriptionValidation.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"SubscriptionValidation.js","sourceRoot":"","sources":["../src/SubscriptionValidation.ts"],"names":[],"mappings":";;;AAAA,kEAA+D;AAI/D,MAAa,sBAAsB;IAQ/B,YAAY,aAAuC,EAAE,KAAmC;QANjF,SAAI,GAAS,IAAI,IAAI,EAAE,CAAC;QAQ3B,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,KAAK;YACL,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EACrC,CAAC;gBACG,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;gBACrB,GAAG,CAAC,UAAU,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;gBAC1C,GAAG,CAAC,UAAU,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YAC9C,CAAC;QACL,IAAI,CAAC,KAAK,GAAG,sBAAsB,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7D,IAAI,CAAC,SAAS,GAAG,sBAAsB,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAClE,IAAI,CAAC,UAAU,GAAG,sBAAsB,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7E,CAAC;IACD,MAAM,CAAC,YAAY,CAAC,UAAkC,EAAE,aAAqB,EAAE,QAAgB;;QAE3F,IAAI,CAAC,GAAG,CAAC,MAAA,UAAU,CAAC,aAAa,mCAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,uCAAkB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,IAAI,aAAa,IAAI,CAAC,QAAQ,IAAI,IAAI,IAAI,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,CAAC,CAAC;QAC3L,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IACxB,CAAC;IACD,MAAM,CAAC,OAAO,CAAC,UAAkC,EAAE,MAAmB,IAAI;QAEtE,OAAO,sBAAsB,CAAC,QAAQ,CAAC,UAAU,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC;IACpE,CAAC;IACD,MAAM,CAAC,QAAQ,CAAC,UAAkC,EAAE,MAAmB,IAAI;QAEvE,IAAI,GAAG,IAAI,IAAI;YACX,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;QACrB,IAAI,UAAU,CAAC,KAAK;YAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAChD,CAAC;gBACG,MAAM,GAAG,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBAChC,IAAI,GAAG,CAAC,UAAU,IAAI,GAAG;oBACrB,IAAI,GAAG,IAAI,GAAG,CAAC,UAAU;wBACrB,OAAO,GAAG,CAAC;YACvB,CAAC;QACL,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,MAAM,CAAC,cAAc,CAAC,UAAkC,EAAE,MAAmB,IAAI;QAE7E,IAAI,GAAG,GAAG,sBAAsB,CAAC,QAAQ,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;QAC3D,IAAI,GAAG;YACH,OAAO,GAAG,CAAC,UAAU,CAAC;QAC1B,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AArDD,wDAqDC"}
|
package/package.json
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "namirasoft-payment",
|
|
3
|
-
"title": "Namirasoft Payment NPM Package",
|
|
4
|
-
"description": "Namira Software Corporation Payment NPM Package",
|
|
5
|
-
"icon": "logo.png",
|
|
6
|
-
"logo": "https://static.namirasoft.com/image/namirasoft/payment/logo/base.png",
|
|
7
|
-
"language": "ts",
|
|
8
|
-
"framework": "npm",
|
|
9
|
-
"application": "package",
|
|
10
|
-
"private": false,
|
|
11
|
-
"version": "1.4.
|
|
12
|
-
"author": "Amir Abolhasani",
|
|
13
|
-
"license": "MIT",
|
|
14
|
-
"main": "./dist/index.js",
|
|
15
|
-
"types": "./dist/index.d.ts",
|
|
16
|
-
"scripts": {
|
|
17
|
-
"build": ""
|
|
18
|
-
},
|
|
19
|
-
"dependencies": {
|
|
20
|
-
"namirasoft-core": "^1.4.72",
|
|
21
|
-
"namirasoft-site": "^1.4.37",
|
|
22
|
-
"namirasoft-node-cli": "^1.4.7",
|
|
23
|
-
"namirasoft-account": "^1.4.72"
|
|
24
|
-
},
|
|
25
|
-
"bin": {
|
|
26
|
-
"ns-payment": "./dist/command/cli.js"
|
|
27
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "namirasoft-payment",
|
|
3
|
+
"title": "Namirasoft Payment NPM Package",
|
|
4
|
+
"description": "Namira Software Corporation Payment NPM Package",
|
|
5
|
+
"icon": "logo.png",
|
|
6
|
+
"logo": "https://static.namirasoft.com/image/namirasoft/payment/logo/base.png",
|
|
7
|
+
"language": "ts",
|
|
8
|
+
"framework": "npm",
|
|
9
|
+
"application": "package",
|
|
10
|
+
"private": false,
|
|
11
|
+
"version": "1.4.81",
|
|
12
|
+
"author": "Amir Abolhasani",
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"main": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": ""
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"namirasoft-core": "^1.4.72",
|
|
21
|
+
"namirasoft-site": "^1.4.37",
|
|
22
|
+
"namirasoft-node-cli": "^1.4.7",
|
|
23
|
+
"namirasoft-account": "^1.4.72"
|
|
24
|
+
},
|
|
25
|
+
"bin": {
|
|
26
|
+
"ns-payment": "./dist/command/cli.js"
|
|
27
|
+
}
|
|
28
28
|
}
|
|
@@ -1,69 +1,69 @@
|
|
|
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 { NSABaseServer } from "namirasoft-account";
|
|
22
|
-
import { NamirasoftPaymentServerHealthz } from "./NamirasoftPaymentServerHealthz";
|
|
23
|
-
import { NamirasoftPaymentServerInvoice } from "./NamirasoftPaymentServerInvoice";
|
|
24
|
-
import { NamirasoftPaymentServerMeter } from "./NamirasoftPaymentServerMeter";
|
|
25
|
-
import { NamirasoftPaymentServerOffer } from "./NamirasoftPaymentServerOffer";
|
|
26
|
-
import { NamirasoftPaymentServerOneTime } from "./NamirasoftPaymentServerOneTime";
|
|
27
|
-
import { NamirasoftPaymentServerPayment } from "./NamirasoftPaymentServerPayment";
|
|
28
|
-
import { NamirasoftPaymentServerProduct } from "./NamirasoftPaymentServerProduct";
|
|
29
|
-
import { NamirasoftPaymentServerSalesItem } from "./NamirasoftPaymentServerSalesItem";
|
|
30
|
-
import { NamirasoftPaymentServerSubscription } from "./NamirasoftPaymentServerSubscription";
|
|
31
|
-
import { NamirasoftPaymentServerSubscriptionCancellationReason } from "./NamirasoftPaymentServerSubscriptionCancellationReason";
|
|
32
|
-
import { NamirasoftPaymentServerSubscriptionItem } from "./NamirasoftPaymentServerSubscriptionItem";
|
|
33
|
-
import { NamirasoftPaymentServerSubscriptionPaid } from "./NamirasoftPaymentServerSubscriptionPaid";
|
|
34
|
-
import { NamirasoftPaymentServerValue } from "./NamirasoftPaymentServerValue";
|
|
35
|
-
import { TokenManager } from "namirasoft-account";
|
|
36
|
-
|
|
37
|
-
export class NamirasoftPaymentServer extends NSABaseServer
|
|
38
|
-
{
|
|
39
|
-
healthz: NamirasoftPaymentServerHealthz;
|
|
40
|
-
value: NamirasoftPaymentServerValue;
|
|
41
|
-
invoice: NamirasoftPaymentServerInvoice;
|
|
42
|
-
meter: NamirasoftPaymentServerMeter;
|
|
43
|
-
offer: NamirasoftPaymentServerOffer;
|
|
44
|
-
one_time: NamirasoftPaymentServerOneTime;
|
|
45
|
-
payment: NamirasoftPaymentServerPayment;
|
|
46
|
-
sales_item: NamirasoftPaymentServerSalesItem;
|
|
47
|
-
subscription_cancellation_reason: NamirasoftPaymentServerSubscriptionCancellationReason;
|
|
48
|
-
subscription_item: NamirasoftPaymentServerSubscriptionItem;
|
|
49
|
-
subscription_paid: NamirasoftPaymentServerSubscriptionPaid;
|
|
50
|
-
subscription: NamirasoftPaymentServerSubscription;
|
|
51
|
-
product: NamirasoftPaymentServerProduct;
|
|
52
|
-
constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void)
|
|
53
|
-
{
|
|
54
|
-
super(base_url, `1.4.79`, manager, onError);
|
|
55
|
-
this.healthz = new NamirasoftPaymentServerHealthz(this);
|
|
56
|
-
this.value = new NamirasoftPaymentServerValue(this);
|
|
57
|
-
this.invoice = new NamirasoftPaymentServerInvoice(this);
|
|
58
|
-
this.meter = new NamirasoftPaymentServerMeter(this);
|
|
59
|
-
this.offer = new NamirasoftPaymentServerOffer(this);
|
|
60
|
-
this.one_time = new NamirasoftPaymentServerOneTime(this);
|
|
61
|
-
this.payment = new NamirasoftPaymentServerPayment(this);
|
|
62
|
-
this.sales_item = new NamirasoftPaymentServerSalesItem(this);
|
|
63
|
-
this.subscription_cancellation_reason = new NamirasoftPaymentServerSubscriptionCancellationReason(this);
|
|
64
|
-
this.subscription_item = new NamirasoftPaymentServerSubscriptionItem(this);
|
|
65
|
-
this.subscription_paid = new NamirasoftPaymentServerSubscriptionPaid(this);
|
|
66
|
-
this.subscription = new NamirasoftPaymentServerSubscription(this);
|
|
67
|
-
this.product = new NamirasoftPaymentServerProduct(this);
|
|
68
|
-
}
|
|
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 { NSABaseServer } from "namirasoft-account";
|
|
22
|
+
import { NamirasoftPaymentServerHealthz } from "./NamirasoftPaymentServerHealthz";
|
|
23
|
+
import { NamirasoftPaymentServerInvoice } from "./NamirasoftPaymentServerInvoice";
|
|
24
|
+
import { NamirasoftPaymentServerMeter } from "./NamirasoftPaymentServerMeter";
|
|
25
|
+
import { NamirasoftPaymentServerOffer } from "./NamirasoftPaymentServerOffer";
|
|
26
|
+
import { NamirasoftPaymentServerOneTime } from "./NamirasoftPaymentServerOneTime";
|
|
27
|
+
import { NamirasoftPaymentServerPayment } from "./NamirasoftPaymentServerPayment";
|
|
28
|
+
import { NamirasoftPaymentServerProduct } from "./NamirasoftPaymentServerProduct";
|
|
29
|
+
import { NamirasoftPaymentServerSalesItem } from "./NamirasoftPaymentServerSalesItem";
|
|
30
|
+
import { NamirasoftPaymentServerSubscription } from "./NamirasoftPaymentServerSubscription";
|
|
31
|
+
import { NamirasoftPaymentServerSubscriptionCancellationReason } from "./NamirasoftPaymentServerSubscriptionCancellationReason";
|
|
32
|
+
import { NamirasoftPaymentServerSubscriptionItem } from "./NamirasoftPaymentServerSubscriptionItem";
|
|
33
|
+
import { NamirasoftPaymentServerSubscriptionPaid } from "./NamirasoftPaymentServerSubscriptionPaid";
|
|
34
|
+
import { NamirasoftPaymentServerValue } from "./NamirasoftPaymentServerValue";
|
|
35
|
+
import { TokenManager } from "namirasoft-account";
|
|
36
|
+
|
|
37
|
+
export class NamirasoftPaymentServer extends NSABaseServer
|
|
38
|
+
{
|
|
39
|
+
healthz: NamirasoftPaymentServerHealthz;
|
|
40
|
+
value: NamirasoftPaymentServerValue;
|
|
41
|
+
invoice: NamirasoftPaymentServerInvoice;
|
|
42
|
+
meter: NamirasoftPaymentServerMeter;
|
|
43
|
+
offer: NamirasoftPaymentServerOffer;
|
|
44
|
+
one_time: NamirasoftPaymentServerOneTime;
|
|
45
|
+
payment: NamirasoftPaymentServerPayment;
|
|
46
|
+
sales_item: NamirasoftPaymentServerSalesItem;
|
|
47
|
+
subscription_cancellation_reason: NamirasoftPaymentServerSubscriptionCancellationReason;
|
|
48
|
+
subscription_item: NamirasoftPaymentServerSubscriptionItem;
|
|
49
|
+
subscription_paid: NamirasoftPaymentServerSubscriptionPaid;
|
|
50
|
+
subscription: NamirasoftPaymentServerSubscription;
|
|
51
|
+
product: NamirasoftPaymentServerProduct;
|
|
52
|
+
constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void)
|
|
53
|
+
{
|
|
54
|
+
super(base_url, `1.4.79`, manager, onError);
|
|
55
|
+
this.healthz = new NamirasoftPaymentServerHealthz(this);
|
|
56
|
+
this.value = new NamirasoftPaymentServerValue(this);
|
|
57
|
+
this.invoice = new NamirasoftPaymentServerInvoice(this);
|
|
58
|
+
this.meter = new NamirasoftPaymentServerMeter(this);
|
|
59
|
+
this.offer = new NamirasoftPaymentServerOffer(this);
|
|
60
|
+
this.one_time = new NamirasoftPaymentServerOneTime(this);
|
|
61
|
+
this.payment = new NamirasoftPaymentServerPayment(this);
|
|
62
|
+
this.sales_item = new NamirasoftPaymentServerSalesItem(this);
|
|
63
|
+
this.subscription_cancellation_reason = new NamirasoftPaymentServerSubscriptionCancellationReason(this);
|
|
64
|
+
this.subscription_item = new NamirasoftPaymentServerSubscriptionItem(this);
|
|
65
|
+
this.subscription_paid = new NamirasoftPaymentServerSubscriptionPaid(this);
|
|
66
|
+
this.subscription = new NamirasoftPaymentServerSubscription(this);
|
|
67
|
+
this.product = new NamirasoftPaymentServerProduct(this);
|
|
68
|
+
}
|
|
69
69
|
};
|
|
@@ -1,30 +1,30 @@
|
|
|
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 { NamirasoftPaymentServer } from "./NamirasoftPaymentServer";
|
|
22
|
-
|
|
23
|
-
export class NamirasoftPaymentServerBase
|
|
24
|
-
{
|
|
25
|
-
public server: NamirasoftPaymentServer;
|
|
26
|
-
constructor(server: NamirasoftPaymentServer)
|
|
27
|
-
{
|
|
28
|
-
this.server = server;
|
|
29
|
-
}
|
|
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 { NamirasoftPaymentServer } from "./NamirasoftPaymentServer";
|
|
22
|
+
|
|
23
|
+
export class NamirasoftPaymentServerBase
|
|
24
|
+
{
|
|
25
|
+
public server: NamirasoftPaymentServer;
|
|
26
|
+
constructor(server: NamirasoftPaymentServer)
|
|
27
|
+
{
|
|
28
|
+
this.server = server;
|
|
29
|
+
}
|
|
30
30
|
};
|
|
@@ -1,36 +1,36 @@
|
|
|
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 { NamirasoftPaymentServer } from "./NamirasoftPaymentServer";
|
|
22
|
-
import { NamirasoftPaymentServerBase } from "./NamirasoftPaymentServerBase";
|
|
23
|
-
|
|
24
|
-
export class NamirasoftPaymentServerHealthz extends NamirasoftPaymentServerBase
|
|
25
|
-
{
|
|
26
|
-
constructor(server: NamirasoftPaymentServer)
|
|
27
|
-
{
|
|
28
|
-
super(server);
|
|
29
|
-
this.Get = this.Get.bind(this);
|
|
30
|
-
}
|
|
31
|
-
async Get(): Promise<void>
|
|
32
|
-
{
|
|
33
|
-
let path = `/healthz`;
|
|
34
|
-
await this.server._get<void>(path, {});
|
|
35
|
-
}
|
|
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 { NamirasoftPaymentServer } from "./NamirasoftPaymentServer";
|
|
22
|
+
import { NamirasoftPaymentServerBase } from "./NamirasoftPaymentServerBase";
|
|
23
|
+
|
|
24
|
+
export class NamirasoftPaymentServerHealthz extends NamirasoftPaymentServerBase
|
|
25
|
+
{
|
|
26
|
+
constructor(server: NamirasoftPaymentServer)
|
|
27
|
+
{
|
|
28
|
+
super(server);
|
|
29
|
+
this.Get = this.Get.bind(this);
|
|
30
|
+
}
|
|
31
|
+
async Get(): Promise<void>
|
|
32
|
+
{
|
|
33
|
+
let path = `/healthz`;
|
|
34
|
+
await this.server._get<void>(path, {});
|
|
35
|
+
}
|
|
36
36
|
};
|
|
@@ -1,70 +1,70 @@
|
|
|
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 { InvoiceFullRow } from "./row/InvoiceFullRow";
|
|
23
|
-
import { InvoiceInputRow } from "./row/InvoiceInputRow";
|
|
24
|
-
import { InvoiceRow } from "./row/InvoiceRow";
|
|
25
|
-
import { NamirasoftPaymentServer } from "./NamirasoftPaymentServer";
|
|
26
|
-
import { NamirasoftPaymentServerBase } from "./NamirasoftPaymentServerBase";
|
|
27
|
-
import { SortItem } from "namirasoft-core";
|
|
28
|
-
|
|
29
|
-
export class NamirasoftPaymentServerInvoice extends NamirasoftPaymentServerBase
|
|
30
|
-
{
|
|
31
|
-
constructor(server: NamirasoftPaymentServer)
|
|
32
|
-
{
|
|
33
|
-
super(server);
|
|
34
|
-
this.List = this.List.bind(this);
|
|
35
|
-
this.Get = this.Get.bind(this);
|
|
36
|
-
this._CreateFor = this._CreateFor.bind(this);
|
|
37
|
-
this._DeleteFor = this._DeleteFor.bind(this);
|
|
38
|
-
this.Cancel = this.Cancel.bind(this);
|
|
39
|
-
}
|
|
40
|
-
async List(filters: FilterItem[] | null, page: (number | null), size: (number | null), sorts: SortItem[]): Promise<{ rows: InvoiceRow[], count: number }>
|
|
41
|
-
{
|
|
42
|
-
let filters_string_value: string = FilterItem.stringify(filters);
|
|
43
|
-
let sorts_string_value: string = SortItem.stringify(sorts);
|
|
44
|
-
let path = `/invoice/list`;
|
|
45
|
-
let { data } = await this.server._get<{ rows: InvoiceRow[], count: number }>(path, { filters: filters_string_value, page, size, sorts: sorts_string_value });
|
|
46
|
-
return data;
|
|
47
|
-
}
|
|
48
|
-
async Get(id: string): Promise<InvoiceFullRow>
|
|
49
|
-
{
|
|
50
|
-
let path = `/invoice/${id}`;
|
|
51
|
-
let { data } = await this.server._get<InvoiceFullRow>(path, {});
|
|
52
|
-
return data;
|
|
53
|
-
}
|
|
54
|
-
async _CreateFor(user_id: string, body: InvoiceInputRow): Promise<InvoiceFullRow>
|
|
55
|
-
{
|
|
56
|
-
let path = `/application/user/${user_id}/invoice`;
|
|
57
|
-
let { data } = await this.server._post<InvoiceFullRow>(path, {}, body);
|
|
58
|
-
return data;
|
|
59
|
-
}
|
|
60
|
-
async _DeleteFor(user_id: string, id: string): Promise<void>
|
|
61
|
-
{
|
|
62
|
-
let path = `/application/user/${user_id}/invoice/${id}`;
|
|
63
|
-
await this.server._delete<void>(path, {});
|
|
64
|
-
}
|
|
65
|
-
async Cancel(id: string): Promise<void>
|
|
66
|
-
{
|
|
67
|
-
let path = `/invoice/cancel/${id}`;
|
|
68
|
-
await this.server._put<void>(path, {});
|
|
69
|
-
}
|
|
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 { InvoiceFullRow } from "./row/InvoiceFullRow";
|
|
23
|
+
import { InvoiceInputRow } from "./row/InvoiceInputRow";
|
|
24
|
+
import { InvoiceRow } from "./row/InvoiceRow";
|
|
25
|
+
import { NamirasoftPaymentServer } from "./NamirasoftPaymentServer";
|
|
26
|
+
import { NamirasoftPaymentServerBase } from "./NamirasoftPaymentServerBase";
|
|
27
|
+
import { SortItem } from "namirasoft-core";
|
|
28
|
+
|
|
29
|
+
export class NamirasoftPaymentServerInvoice extends NamirasoftPaymentServerBase
|
|
30
|
+
{
|
|
31
|
+
constructor(server: NamirasoftPaymentServer)
|
|
32
|
+
{
|
|
33
|
+
super(server);
|
|
34
|
+
this.List = this.List.bind(this);
|
|
35
|
+
this.Get = this.Get.bind(this);
|
|
36
|
+
this._CreateFor = this._CreateFor.bind(this);
|
|
37
|
+
this._DeleteFor = this._DeleteFor.bind(this);
|
|
38
|
+
this.Cancel = this.Cancel.bind(this);
|
|
39
|
+
}
|
|
40
|
+
async List(filters: FilterItem[] | null, page: (number | null), size: (number | null), sorts: SortItem[]): Promise<{ rows: InvoiceRow[], count: number }>
|
|
41
|
+
{
|
|
42
|
+
let filters_string_value: string = FilterItem.stringify(filters);
|
|
43
|
+
let sorts_string_value: string = SortItem.stringify(sorts);
|
|
44
|
+
let path = `/invoice/list`;
|
|
45
|
+
let { data } = await this.server._get<{ rows: InvoiceRow[], count: number }>(path, { filters: filters_string_value, page, size, sorts: sorts_string_value });
|
|
46
|
+
return data;
|
|
47
|
+
}
|
|
48
|
+
async Get(id: string): Promise<InvoiceFullRow>
|
|
49
|
+
{
|
|
50
|
+
let path = `/invoice/${id}`;
|
|
51
|
+
let { data } = await this.server._get<InvoiceFullRow>(path, {});
|
|
52
|
+
return data;
|
|
53
|
+
}
|
|
54
|
+
async _CreateFor(user_id: string, body: InvoiceInputRow): Promise<InvoiceFullRow>
|
|
55
|
+
{
|
|
56
|
+
let path = `/application/user/${user_id}/invoice`;
|
|
57
|
+
let { data } = await this.server._post<InvoiceFullRow>(path, {}, body);
|
|
58
|
+
return data;
|
|
59
|
+
}
|
|
60
|
+
async _DeleteFor(user_id: string, id: string): Promise<void>
|
|
61
|
+
{
|
|
62
|
+
let path = `/application/user/${user_id}/invoice/${id}`;
|
|
63
|
+
await this.server._delete<void>(path, {});
|
|
64
|
+
}
|
|
65
|
+
async Cancel(id: string): Promise<void>
|
|
66
|
+
{
|
|
67
|
+
let path = `/invoice/cancel/${id}`;
|
|
68
|
+
await this.server._put<void>(path, {});
|
|
69
|
+
}
|
|
70
70
|
};
|