@managespace/sdk 0.0.139 → 0.0.141
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/extensibility/functions/project/billing.d.ts +8 -1
- package/dist/extensibility/functions/project/billing.d.ts.map +1 -1
- package/dist/extensibility/functions/project/billing.js +5 -0
- package/dist/generated/apis/default-api.d.ts +11 -1
- package/dist/generated/apis/default-api.d.ts.map +1 -1
- package/dist/generated/apis/default-api.js +32 -0
- package/dist/generated/models/index.d.ts +3 -0
- package/dist/generated/models/index.d.ts.map +1 -1
- package/dist/generated/models/index.js +3 -0
- package/dist/generated/models/subscription-preview.d.ts +120 -78
- package/dist/generated/models/subscription-preview.d.ts.map +1 -1
- package/dist/generated/models/subscription-preview.js +56 -90
- package/package.json +1 -1
- package/src/extensibility/functions/project/billing.ts +9 -0
- package/src/generated/.openapi-generator/FILES +3 -0
- package/src/generated/apis/default-api.ts +54 -0
- package/src/generated/models/index.ts +3 -0
- package/src/generated/models/subscription-invoice-line.ts +192 -0
- package/src/generated/models/subscription-invoice.ts +110 -0
- package/src/generated/models/subscription-preview.ts +472 -0
- package/dist/generated/models/create-subscription-plan.d.ts +0 -69
- package/dist/generated/models/create-subscription-plan.d.ts.map +0 -1
- package/dist/generated/models/create-subscription-plan.js +0 -71
- package/dist/generated/models/subscription-plan.d.ts +0 -268
- package/dist/generated/models/subscription-plan.d.ts.map +0 -1
- package/dist/generated/models/subscription-plan.js +0 -208
|
@@ -131,6 +131,7 @@ import type {
|
|
|
131
131
|
Statement,
|
|
132
132
|
StepData,
|
|
133
133
|
Subscription,
|
|
134
|
+
SubscriptionPreview,
|
|
134
135
|
Success,
|
|
135
136
|
Task,
|
|
136
137
|
TaskTemplate,
|
|
@@ -392,6 +393,8 @@ import {
|
|
|
392
393
|
StepDataToJSON,
|
|
393
394
|
SubscriptionFromJSON,
|
|
394
395
|
SubscriptionToJSON,
|
|
396
|
+
SubscriptionPreviewFromJSON,
|
|
397
|
+
SubscriptionPreviewToJSON,
|
|
395
398
|
SuccessFromJSON,
|
|
396
399
|
SuccessToJSON,
|
|
397
400
|
TaskFromJSON,
|
|
@@ -944,6 +947,11 @@ export interface GetSubscriptionRequest {
|
|
|
944
947
|
subscriptionId: string;
|
|
945
948
|
}
|
|
946
949
|
|
|
950
|
+
export interface GetSubscriptionPreviewRequest {
|
|
951
|
+
siteId: string;
|
|
952
|
+
subscriptionId: string;
|
|
953
|
+
}
|
|
954
|
+
|
|
947
955
|
export interface GetSubscriptionsRequest {
|
|
948
956
|
siteId: string;
|
|
949
957
|
offset?: number;
|
|
@@ -5641,6 +5649,52 @@ export class DefaultApi extends runtime.BaseAPI {
|
|
|
5641
5649
|
return await response.value();
|
|
5642
5650
|
}
|
|
5643
5651
|
|
|
5652
|
+
/**
|
|
5653
|
+
*/
|
|
5654
|
+
async getSubscriptionPreviewRaw(requestParameters: GetSubscriptionPreviewRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SubscriptionPreview>> {
|
|
5655
|
+
if (requestParameters['siteId'] == null) {
|
|
5656
|
+
throw new runtime.RequiredError(
|
|
5657
|
+
'siteId',
|
|
5658
|
+
'Required parameter "siteId" was null or undefined when calling getSubscriptionPreview().'
|
|
5659
|
+
);
|
|
5660
|
+
}
|
|
5661
|
+
|
|
5662
|
+
if (requestParameters['subscriptionId'] == null) {
|
|
5663
|
+
throw new runtime.RequiredError(
|
|
5664
|
+
'subscriptionId',
|
|
5665
|
+
'Required parameter "subscriptionId" was null or undefined when calling getSubscriptionPreview().'
|
|
5666
|
+
);
|
|
5667
|
+
}
|
|
5668
|
+
|
|
5669
|
+
const queryParameters: any = {};
|
|
5670
|
+
|
|
5671
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
5672
|
+
|
|
5673
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
5674
|
+
const token = this.configuration.accessToken;
|
|
5675
|
+
const tokenString = await token("bearer", []);
|
|
5676
|
+
|
|
5677
|
+
if (tokenString) {
|
|
5678
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
5679
|
+
}
|
|
5680
|
+
}
|
|
5681
|
+
const response = await this.request({
|
|
5682
|
+
path: `/api/sites/{siteId}/subscriptions/{subscriptionId}/preview`.replace(`{${"siteId"}}`, encodeURIComponent(String(requestParameters['siteId']))).replace(`{${"subscriptionId"}}`, encodeURIComponent(String(requestParameters['subscriptionId']))),
|
|
5683
|
+
method: 'GET',
|
|
5684
|
+
headers: headerParameters,
|
|
5685
|
+
query: queryParameters,
|
|
5686
|
+
}, initOverrides);
|
|
5687
|
+
|
|
5688
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SubscriptionPreviewFromJSON(jsonValue));
|
|
5689
|
+
}
|
|
5690
|
+
|
|
5691
|
+
/**
|
|
5692
|
+
*/
|
|
5693
|
+
async getSubscriptionPreview(requestParameters: GetSubscriptionPreviewRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SubscriptionPreview> {
|
|
5694
|
+
const response = await this.getSubscriptionPreviewRaw(requestParameters, initOverrides);
|
|
5695
|
+
return await response.value();
|
|
5696
|
+
}
|
|
5697
|
+
|
|
5644
5698
|
/**
|
|
5645
5699
|
*/
|
|
5646
5700
|
async getSubscriptionsRaw(requestParameters: GetSubscriptionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetSubscriptions200Response>> {
|
|
@@ -165,6 +165,9 @@ export * from './step-data';
|
|
|
165
165
|
export * from './sub-total';
|
|
166
166
|
export * from './subscription';
|
|
167
167
|
export * from './subscription-charge';
|
|
168
|
+
export * from './subscription-invoice';
|
|
169
|
+
export * from './subscription-invoice-line';
|
|
170
|
+
export * from './subscription-preview';
|
|
168
171
|
export * from './success';
|
|
169
172
|
export * from './task';
|
|
170
173
|
export * from './task-completion-status';
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* ManageSpace API
|
|
5
|
+
* ManageSpace API Documentation
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface SubscriptionInvoiceLine
|
|
20
|
+
*/
|
|
21
|
+
export interface SubscriptionInvoiceLine {
|
|
22
|
+
/**
|
|
23
|
+
* Product ID
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof SubscriptionInvoiceLine
|
|
26
|
+
*/
|
|
27
|
+
productId: string;
|
|
28
|
+
/**
|
|
29
|
+
* Product name
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof SubscriptionInvoiceLine
|
|
32
|
+
*/
|
|
33
|
+
productName: string;
|
|
34
|
+
/**
|
|
35
|
+
* Charge ID
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof SubscriptionInvoiceLine
|
|
38
|
+
*/
|
|
39
|
+
chargeId: string;
|
|
40
|
+
/**
|
|
41
|
+
* Charge name
|
|
42
|
+
* @type {string}
|
|
43
|
+
* @memberof SubscriptionInvoiceLine
|
|
44
|
+
*/
|
|
45
|
+
chargeName: string;
|
|
46
|
+
/**
|
|
47
|
+
* Charge type
|
|
48
|
+
* @type {string}
|
|
49
|
+
* @memberof SubscriptionInvoiceLine
|
|
50
|
+
*/
|
|
51
|
+
chargeType: string;
|
|
52
|
+
/**
|
|
53
|
+
* Description of the line item
|
|
54
|
+
* @type {string}
|
|
55
|
+
* @memberof SubscriptionInvoiceLine
|
|
56
|
+
*/
|
|
57
|
+
description: string;
|
|
58
|
+
/**
|
|
59
|
+
* Line item start date
|
|
60
|
+
* @type {string}
|
|
61
|
+
* @memberof SubscriptionInvoiceLine
|
|
62
|
+
*/
|
|
63
|
+
startDate: string;
|
|
64
|
+
/**
|
|
65
|
+
* Line item start date
|
|
66
|
+
* @type {string}
|
|
67
|
+
* @memberof SubscriptionInvoiceLine
|
|
68
|
+
*/
|
|
69
|
+
endDate: string;
|
|
70
|
+
/**
|
|
71
|
+
* Unit price of the line item
|
|
72
|
+
* @type {string}
|
|
73
|
+
* @memberof SubscriptionInvoiceLine
|
|
74
|
+
*/
|
|
75
|
+
unitPrice: string;
|
|
76
|
+
/**
|
|
77
|
+
* The number of the items
|
|
78
|
+
* @type {number}
|
|
79
|
+
* @memberof SubscriptionInvoiceLine
|
|
80
|
+
*/
|
|
81
|
+
quantity: number;
|
|
82
|
+
/**
|
|
83
|
+
* Charge ready date
|
|
84
|
+
* @type {string}
|
|
85
|
+
* @memberof SubscriptionInvoiceLine
|
|
86
|
+
*/
|
|
87
|
+
chargeReadyDate: string;
|
|
88
|
+
/**
|
|
89
|
+
* The discount applied to product
|
|
90
|
+
* @type {number}
|
|
91
|
+
* @memberof SubscriptionInvoiceLine
|
|
92
|
+
*/
|
|
93
|
+
discount: number;
|
|
94
|
+
/**
|
|
95
|
+
* If line item is invoiced
|
|
96
|
+
* @type {boolean}
|
|
97
|
+
* @memberof SubscriptionInvoiceLine
|
|
98
|
+
*/
|
|
99
|
+
invoiced: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Charge effective price
|
|
102
|
+
* @type {string}
|
|
103
|
+
* @memberof SubscriptionInvoiceLine
|
|
104
|
+
*/
|
|
105
|
+
chgEffectivePrice: string;
|
|
106
|
+
/**
|
|
107
|
+
* MRR
|
|
108
|
+
* @type {string}
|
|
109
|
+
* @memberof SubscriptionInvoiceLine
|
|
110
|
+
*/
|
|
111
|
+
mrr: string;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Check if a given object implements the SubscriptionInvoiceLine interface.
|
|
116
|
+
*/
|
|
117
|
+
export function instanceOfSubscriptionInvoiceLine(value: object): value is SubscriptionInvoiceLine {
|
|
118
|
+
if (!('productId' in value) || value['productId'] === undefined) return false;
|
|
119
|
+
if (!('productName' in value) || value['productName'] === undefined) return false;
|
|
120
|
+
if (!('chargeId' in value) || value['chargeId'] === undefined) return false;
|
|
121
|
+
if (!('chargeName' in value) || value['chargeName'] === undefined) return false;
|
|
122
|
+
if (!('chargeType' in value) || value['chargeType'] === undefined) return false;
|
|
123
|
+
if (!('description' in value) || value['description'] === undefined) return false;
|
|
124
|
+
if (!('startDate' in value) || value['startDate'] === undefined) return false;
|
|
125
|
+
if (!('endDate' in value) || value['endDate'] === undefined) return false;
|
|
126
|
+
if (!('unitPrice' in value) || value['unitPrice'] === undefined) return false;
|
|
127
|
+
if (!('quantity' in value) || value['quantity'] === undefined) return false;
|
|
128
|
+
if (!('chargeReadyDate' in value) || value['chargeReadyDate'] === undefined) return false;
|
|
129
|
+
if (!('discount' in value) || value['discount'] === undefined) return false;
|
|
130
|
+
if (!('invoiced' in value) || value['invoiced'] === undefined) return false;
|
|
131
|
+
if (!('chgEffectivePrice' in value) || value['chgEffectivePrice'] === undefined) return false;
|
|
132
|
+
if (!('mrr' in value) || value['mrr'] === undefined) return false;
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export function SubscriptionInvoiceLineFromJSON(json: any): SubscriptionInvoiceLine {
|
|
137
|
+
return SubscriptionInvoiceLineFromJSONTyped(json, false);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export function SubscriptionInvoiceLineFromJSONTyped(json: any, ignoreDiscriminator: boolean): SubscriptionInvoiceLine {
|
|
141
|
+
if (json == null) {
|
|
142
|
+
return json;
|
|
143
|
+
}
|
|
144
|
+
return {
|
|
145
|
+
|
|
146
|
+
'productId': json['productId'],
|
|
147
|
+
'productName': json['productName'],
|
|
148
|
+
'chargeId': json['chargeId'],
|
|
149
|
+
'chargeName': json['chargeName'],
|
|
150
|
+
'chargeType': json['chargeType'],
|
|
151
|
+
'description': json['description'],
|
|
152
|
+
'startDate': json['startDate'],
|
|
153
|
+
'endDate': json['endDate'],
|
|
154
|
+
'unitPrice': json['unitPrice'],
|
|
155
|
+
'quantity': json['quantity'],
|
|
156
|
+
'chargeReadyDate': json['chargeReadyDate'],
|
|
157
|
+
'discount': json['discount'],
|
|
158
|
+
'invoiced': json['invoiced'],
|
|
159
|
+
'chgEffectivePrice': json['chgEffectivePrice'],
|
|
160
|
+
'mrr': json['mrr'],
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export function SubscriptionInvoiceLineToJSON(json: any): SubscriptionInvoiceLine {
|
|
165
|
+
return SubscriptionInvoiceLineToJSONTyped(json, false);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export function SubscriptionInvoiceLineToJSONTyped(value?: SubscriptionInvoiceLine | null, ignoreDiscriminator: boolean = false): any {
|
|
169
|
+
if (value == null) {
|
|
170
|
+
return value;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return {
|
|
174
|
+
|
|
175
|
+
'productId': value['productId'],
|
|
176
|
+
'productName': value['productName'],
|
|
177
|
+
'chargeId': value['chargeId'],
|
|
178
|
+
'chargeName': value['chargeName'],
|
|
179
|
+
'chargeType': value['chargeType'],
|
|
180
|
+
'description': value['description'],
|
|
181
|
+
'startDate': value['startDate'],
|
|
182
|
+
'endDate': value['endDate'],
|
|
183
|
+
'unitPrice': value['unitPrice'],
|
|
184
|
+
'quantity': value['quantity'],
|
|
185
|
+
'chargeReadyDate': value['chargeReadyDate'],
|
|
186
|
+
'discount': value['discount'],
|
|
187
|
+
'invoiced': value['invoiced'],
|
|
188
|
+
'chgEffectivePrice': value['chgEffectivePrice'],
|
|
189
|
+
'mrr': value['mrr'],
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* ManageSpace API
|
|
5
|
+
* ManageSpace API Documentation
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
import type { SubscriptionInvoiceLine } from './subscription-invoice-line';
|
|
17
|
+
import {
|
|
18
|
+
SubscriptionInvoiceLineFromJSON,
|
|
19
|
+
SubscriptionInvoiceLineFromJSONTyped,
|
|
20
|
+
SubscriptionInvoiceLineToJSON,
|
|
21
|
+
SubscriptionInvoiceLineToJSONTyped,
|
|
22
|
+
} from './subscription-invoice-line';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @export
|
|
27
|
+
* @interface SubscriptionInvoice
|
|
28
|
+
*/
|
|
29
|
+
export interface SubscriptionInvoice {
|
|
30
|
+
/**
|
|
31
|
+
* Subtotal of invoice
|
|
32
|
+
* @type {number}
|
|
33
|
+
* @memberof SubscriptionInvoice
|
|
34
|
+
*/
|
|
35
|
+
substoal: number;
|
|
36
|
+
/**
|
|
37
|
+
* Invoice amount
|
|
38
|
+
* @type {number}
|
|
39
|
+
* @memberof SubscriptionInvoice
|
|
40
|
+
*/
|
|
41
|
+
invoiceAmount: number;
|
|
42
|
+
/**
|
|
43
|
+
* Invioice date
|
|
44
|
+
* @type {string}
|
|
45
|
+
* @memberof SubscriptionInvoice
|
|
46
|
+
*/
|
|
47
|
+
period: string;
|
|
48
|
+
/**
|
|
49
|
+
* Invoice line items
|
|
50
|
+
* @type {Array<SubscriptionInvoiceLine>}
|
|
51
|
+
* @memberof SubscriptionInvoice
|
|
52
|
+
*/
|
|
53
|
+
invoiceLines: Array<SubscriptionInvoiceLine>;
|
|
54
|
+
/**
|
|
55
|
+
* Ready date of invoice
|
|
56
|
+
* @type {string}
|
|
57
|
+
* @memberof SubscriptionInvoice
|
|
58
|
+
*/
|
|
59
|
+
readyDate: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Check if a given object implements the SubscriptionInvoice interface.
|
|
64
|
+
*/
|
|
65
|
+
export function instanceOfSubscriptionInvoice(value: object): value is SubscriptionInvoice {
|
|
66
|
+
if (!('substoal' in value) || value['substoal'] === undefined) return false;
|
|
67
|
+
if (!('invoiceAmount' in value) || value['invoiceAmount'] === undefined) return false;
|
|
68
|
+
if (!('period' in value) || value['period'] === undefined) return false;
|
|
69
|
+
if (!('invoiceLines' in value) || value['invoiceLines'] === undefined) return false;
|
|
70
|
+
if (!('readyDate' in value) || value['readyDate'] === undefined) return false;
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function SubscriptionInvoiceFromJSON(json: any): SubscriptionInvoice {
|
|
75
|
+
return SubscriptionInvoiceFromJSONTyped(json, false);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function SubscriptionInvoiceFromJSONTyped(json: any, ignoreDiscriminator: boolean): SubscriptionInvoice {
|
|
79
|
+
if (json == null) {
|
|
80
|
+
return json;
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
|
|
84
|
+
'substoal': json['substoal'],
|
|
85
|
+
'invoiceAmount': json['invoiceAmount'],
|
|
86
|
+
'period': json['period'],
|
|
87
|
+
'invoiceLines': ((json['invoiceLines'] as Array<any>).map(SubscriptionInvoiceLineFromJSON)),
|
|
88
|
+
'readyDate': json['readyDate'],
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function SubscriptionInvoiceToJSON(json: any): SubscriptionInvoice {
|
|
93
|
+
return SubscriptionInvoiceToJSONTyped(json, false);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function SubscriptionInvoiceToJSONTyped(value?: SubscriptionInvoice | null, ignoreDiscriminator: boolean = false): any {
|
|
97
|
+
if (value == null) {
|
|
98
|
+
return value;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return {
|
|
102
|
+
|
|
103
|
+
'substoal': value['substoal'],
|
|
104
|
+
'invoiceAmount': value['invoiceAmount'],
|
|
105
|
+
'period': value['period'],
|
|
106
|
+
'invoiceLines': ((value['invoiceLines'] as Array<any>).map(SubscriptionInvoiceLineToJSON)),
|
|
107
|
+
'readyDate': value['readyDate'],
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|