@internxt/sdk 1.4.77 → 1.5.25
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/auth/index.d.ts +122 -122
- package/dist/auth/index.js +310 -310
- package/dist/auth/types.d.ts +54 -54
- package/dist/auth/types.js +26 -26
- package/dist/drive/backups/index.d.ts +18 -18
- package/dist/drive/backups/index.js +40 -40
- package/dist/drive/backups/types.d.ts +27 -27
- package/dist/drive/backups/types.js +2 -2
- package/dist/drive/index.d.ts +7 -7
- package/dist/drive/index.js +19 -19
- package/dist/drive/payments/index.d.ts +71 -53
- package/dist/drive/payments/index.js +208 -153
- package/dist/drive/payments/types.d.ts +176 -114
- package/dist/drive/payments/types.js +37 -32
- package/dist/drive/referrals/index.d.ts +19 -19
- package/dist/drive/referrals/index.js +50 -50
- package/dist/drive/referrals/types.d.ts +21 -21
- package/dist/drive/referrals/types.js +18 -18
- package/dist/drive/share/index.d.ts +319 -319
- package/dist/drive/share/index.js +540 -539
- package/dist/drive/share/types.d.ts +360 -358
- package/dist/drive/share/types.js +2 -2
- package/dist/drive/storage/index.d.ts +315 -195
- package/dist/drive/storage/index.js +630 -434
- package/dist/drive/storage/types.d.ts +473 -394
- package/dist/drive/storage/types.js +13 -13
- package/dist/drive/trash/index.d.ts +75 -55
- package/dist/drive/trash/index.js +180 -149
- package/dist/drive/trash/types.d.ts +29 -20
- package/dist/drive/trash/types.js +2 -2
- package/dist/drive/users/index.d.ts +135 -108
- package/dist/drive/users/index.js +204 -174
- package/dist/drive/users/types.d.ts +51 -43
- package/dist/drive/users/types.js +2 -2
- package/dist/index.d.ts +6 -5
- package/dist/index.js +31 -30
- package/dist/network/download.d.ts +8 -8
- package/dist/network/download.js +123 -123
- package/dist/network/errors/codes.d.ts +24 -24
- package/dist/network/errors/codes.js +48 -48
- package/dist/network/errors/context.d.ts +35 -35
- package/dist/network/errors/context.js +39 -39
- package/dist/network/errors/download.d.ts +4 -4
- package/dist/network/errors/download.js +48 -48
- package/dist/network/errors/index.d.ts +3 -3
- package/dist/network/errors/index.js +15 -15
- package/dist/network/errors/upload.d.ts +13 -13
- package/dist/network/errors/upload.js +78 -78
- package/dist/network/index.d.ts +70 -71
- package/dist/network/index.js +311 -310
- package/dist/network/types.d.ts +102 -102
- package/dist/network/types.js +18 -18
- package/dist/network/upload.d.ts +4 -4
- package/dist/network/upload.js +159 -159
- package/dist/photos/devices/index.d.ts +10 -10
- package/dist/photos/devices/index.js +79 -79
- package/dist/photos/index.d.ts +17 -17
- package/dist/photos/index.js +52 -52
- package/dist/photos/photos/index.d.ts +60 -60
- package/dist/photos/photos/index.js +225 -225
- package/dist/photos/shares/index.d.ts +8 -8
- package/dist/photos/shares/index.js +34 -34
- package/dist/photos/types.d.ts +154 -154
- package/dist/photos/types.js +19 -19
- package/dist/photos/users/index.d.ts +7 -7
- package/dist/photos/users/index.js +46 -46
- package/dist/shared/headers/index.d.ts +21 -18
- package/dist/shared/headers/index.js +79 -69
- package/dist/shared/http/client.d.ts +85 -85
- package/dist/shared/http/client.js +172 -181
- package/dist/shared/http/types.d.ts +7 -7
- package/dist/shared/http/types.js +2 -2
- package/dist/shared/index.d.ts +1 -1
- package/dist/shared/index.js +13 -13
- package/dist/shared/types/apiConnection.d.ts +12 -11
- package/dist/shared/types/apiConnection.js +2 -2
- package/dist/shared/types/appsumo.d.ts +16 -16
- package/dist/shared/types/appsumo.js +12 -12
- package/dist/shared/types/errors.d.ts +5 -4
- package/dist/shared/types/errors.js +28 -27
- package/dist/shared/types/teams.d.ts +9 -9
- package/dist/shared/types/teams.js +2 -2
- package/dist/shared/types/userSettings.d.ts +29 -27
- package/dist/shared/types/userSettings.js +2 -2
- package/dist/utils.d.ts +3 -3
- package/dist/utils.js +25 -25
- package/dist/workspaces/index.d.ts +176 -0
- package/dist/workspaces/index.js +415 -0
- package/dist/workspaces/index.test.d.ts +1 -0
- package/dist/workspaces/index.test.js +903 -0
- package/dist/workspaces/types.d.ts +291 -0
- package/dist/workspaces/types.js +2 -0
- package/package.json +1 -1
|
@@ -1,153 +1,208 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
-
function step(op) {
|
|
27
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (_) try {
|
|
29
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
-
switch (op[0]) {
|
|
32
|
-
case 0: case 1: t = op; break;
|
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
-
default:
|
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
-
if (t[2]) _.ops.pop();
|
|
42
|
-
_.trys.pop(); continue;
|
|
43
|
-
}
|
|
44
|
-
op = body.call(thisArg, _);
|
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
-
exports.Payments = void 0;
|
|
51
|
-
var headers_1 = require("../../shared/headers");
|
|
52
|
-
var client_1 = require("../../shared/http/client");
|
|
53
|
-
var Payments = /** @class */ (function () {
|
|
54
|
-
function Payments(apiUrl, appDetails, apiSecurity) {
|
|
55
|
-
this.client = client_1.HttpClient.create(apiUrl, apiSecurity.unauthorizedCallback);
|
|
56
|
-
this.appDetails = appDetails;
|
|
57
|
-
this.apiSecurity = apiSecurity;
|
|
58
|
-
}
|
|
59
|
-
Payments.client = function (apiUrl, appDetails, apiSecurity) {
|
|
60
|
-
return new Payments(apiUrl, appDetails, apiSecurity);
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
Payments.prototype.
|
|
66
|
-
return this.client.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
Payments.prototype.
|
|
98
|
-
return this.client.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (_) try {
|
|
29
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
exports.Payments = void 0;
|
|
51
|
+
var headers_1 = require("../../shared/headers");
|
|
52
|
+
var client_1 = require("../../shared/http/client");
|
|
53
|
+
var Payments = /** @class */ (function () {
|
|
54
|
+
function Payments(apiUrl, appDetails, apiSecurity) {
|
|
55
|
+
this.client = client_1.HttpClient.create(apiUrl, apiSecurity.unauthorizedCallback);
|
|
56
|
+
this.appDetails = appDetails;
|
|
57
|
+
this.apiSecurity = apiSecurity;
|
|
58
|
+
}
|
|
59
|
+
Payments.client = function (apiUrl, appDetails, apiSecurity) {
|
|
60
|
+
return new Payments(apiUrl, appDetails, apiSecurity);
|
|
61
|
+
};
|
|
62
|
+
Payments.prototype.createCustomer = function (name, email, country, companyVatId) {
|
|
63
|
+
return this.client.post('/create-customer', { name: name, email: email, country: country, companyVatId: companyVatId }, this.headers());
|
|
64
|
+
};
|
|
65
|
+
Payments.prototype.createSubscription = function (customerId, priceId, token, quantity, currency, promoCodeId) {
|
|
66
|
+
return this.client.post('/create-subscription', {
|
|
67
|
+
customerId: customerId,
|
|
68
|
+
priceId: priceId,
|
|
69
|
+
token: token,
|
|
70
|
+
quantity: quantity,
|
|
71
|
+
currency: currency,
|
|
72
|
+
promoCodeId: promoCodeId,
|
|
73
|
+
}, this.headers());
|
|
74
|
+
};
|
|
75
|
+
Payments.prototype.createPaymentIntent = function (customerId, amount, planId, token, currency, promoCodeName) {
|
|
76
|
+
var query = new URLSearchParams();
|
|
77
|
+
query.set('customerId', customerId);
|
|
78
|
+
query.set('amount', String(amount));
|
|
79
|
+
query.set('planId', planId);
|
|
80
|
+
query.set('token', token);
|
|
81
|
+
if (currency !== undefined)
|
|
82
|
+
query.set('currency', currency);
|
|
83
|
+
if (promoCodeName !== undefined)
|
|
84
|
+
query.set('promoCodeName', promoCodeName);
|
|
85
|
+
return this.client.get("/payment-intent?" + query.toString(), this.headers());
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Fetches the existing products and its details
|
|
89
|
+
*/
|
|
90
|
+
Payments.prototype.getProducts = function () {
|
|
91
|
+
return this.client.get('/v3/stripe/products', this.headers());
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Creates and returns a new session identifier for the client to go to payment platform
|
|
95
|
+
* @param payload
|
|
96
|
+
*/
|
|
97
|
+
Payments.prototype.createSession = function (payload) {
|
|
98
|
+
return this.client.post('/v2/stripe/session', {
|
|
99
|
+
test: payload.test,
|
|
100
|
+
lifetime_tier: payload.lifetime_tier,
|
|
101
|
+
mode: payload.mode,
|
|
102
|
+
priceId: payload.priceId,
|
|
103
|
+
successUrl: payload.successUrl,
|
|
104
|
+
canceledUrl: payload.canceledUrl,
|
|
105
|
+
}, this.headers());
|
|
106
|
+
};
|
|
107
|
+
Payments.prototype.getSetupIntent = function (userType) {
|
|
108
|
+
var query = new URLSearchParams();
|
|
109
|
+
if (userType)
|
|
110
|
+
query.set('userType', userType);
|
|
111
|
+
return this.client.get("/setup-intent?" + query.toString(), this.headers());
|
|
112
|
+
};
|
|
113
|
+
Payments.prototype.getDefaultPaymentMethod = function (userType) {
|
|
114
|
+
var query = new URLSearchParams();
|
|
115
|
+
if (userType)
|
|
116
|
+
query.set('userType', userType);
|
|
117
|
+
return this.client.get("/default-payment-method?" + query.toString(), this.headers());
|
|
118
|
+
};
|
|
119
|
+
Payments.prototype.getInvoices = function (_a) {
|
|
120
|
+
var subscriptionId = _a.subscriptionId, startingAfter = _a.startingAfter, limit = _a.limit;
|
|
121
|
+
var query = new URLSearchParams();
|
|
122
|
+
if (subscriptionId)
|
|
123
|
+
query.set('subscription', subscriptionId);
|
|
124
|
+
if (startingAfter !== undefined)
|
|
125
|
+
query.set('starting_after', startingAfter);
|
|
126
|
+
if (limit !== undefined)
|
|
127
|
+
query.set('limit', limit.toString());
|
|
128
|
+
return this.client.get("/invoices?" + query.toString(), this.headers());
|
|
129
|
+
};
|
|
130
|
+
Payments.prototype.isCouponUsedByUser = function (_a) {
|
|
131
|
+
var couponCode = _a.couponCode;
|
|
132
|
+
var query = new URLSearchParams();
|
|
133
|
+
if (couponCode !== undefined)
|
|
134
|
+
query.set('code', couponCode);
|
|
135
|
+
return this.client.get("/coupon-in-use?" + query.toString(), this.headers());
|
|
136
|
+
};
|
|
137
|
+
Payments.prototype.getUserSubscription = function (userType) {
|
|
138
|
+
var query = new URLSearchParams();
|
|
139
|
+
if (userType)
|
|
140
|
+
query.set('userType', userType);
|
|
141
|
+
return this.client.get("/subscriptions?" + query.toString(), this.headers()).catch(function (err) {
|
|
142
|
+
var error = err;
|
|
143
|
+
if (error.status === 404)
|
|
144
|
+
return { type: 'free' };
|
|
145
|
+
else
|
|
146
|
+
throw err;
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
Payments.prototype.getPrices = function (currency, userType) {
|
|
150
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
151
|
+
var query;
|
|
152
|
+
return __generator(this, function (_a) {
|
|
153
|
+
query = new URLSearchParams();
|
|
154
|
+
if (currency !== undefined)
|
|
155
|
+
query.set('currency', currency);
|
|
156
|
+
if (userType)
|
|
157
|
+
query.set('userType', userType);
|
|
158
|
+
return [2 /*return*/, this.client.get("/prices?" + query.toString(), this.headers())];
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
Payments.prototype.requestPreventCancellation = function () {
|
|
163
|
+
return this.client.get('/request-prevent-cancellation', this.headers());
|
|
164
|
+
};
|
|
165
|
+
Payments.prototype.preventCancellation = function () {
|
|
166
|
+
return this.client.put('/prevent-cancellation', {}, this.headers());
|
|
167
|
+
};
|
|
168
|
+
Payments.prototype.applyRedeemCode = function (payload) {
|
|
169
|
+
return this.client.post('/licenses', { code: payload.code, provider: payload.provider }, this.headers());
|
|
170
|
+
};
|
|
171
|
+
Payments.prototype.updateSubscriptionPaymentMethod = function (payload) {
|
|
172
|
+
return this.client.post('/subscriptions/update-payment-method', __assign({}, payload), this.headers());
|
|
173
|
+
};
|
|
174
|
+
Payments.prototype.updateSubscriptionPrice = function (_a) {
|
|
175
|
+
var priceId = _a.priceId, couponCode = _a.couponCode, userType = _a.userType;
|
|
176
|
+
return this.client.put('/subscriptions', { price_id: priceId, couponCode: couponCode, userType: userType }, this.headers());
|
|
177
|
+
};
|
|
178
|
+
Payments.prototype.cancelSubscription = function (userType) {
|
|
179
|
+
var query = new URLSearchParams();
|
|
180
|
+
if (userType)
|
|
181
|
+
query.set('userType', userType);
|
|
182
|
+
return this.client.delete("/subscriptions?" + query.toString(), this.headers());
|
|
183
|
+
};
|
|
184
|
+
Payments.prototype.createCheckoutSession = function (payload) {
|
|
185
|
+
return this.client.post('/checkout-session', __assign({}, payload), this.headers());
|
|
186
|
+
};
|
|
187
|
+
Payments.prototype.updateCustomerBillingInfo = function (payload) {
|
|
188
|
+
return this.client.patch('/billing', __assign({}, payload), this.headers());
|
|
189
|
+
};
|
|
190
|
+
Payments.prototype.getPaypalSetupIntent = function (_a) {
|
|
191
|
+
var priceId = _a.priceId, coupon = _a.coupon;
|
|
192
|
+
var query = new URLSearchParams();
|
|
193
|
+
if (priceId !== undefined)
|
|
194
|
+
query.set('priceId', priceId);
|
|
195
|
+
if (coupon !== undefined)
|
|
196
|
+
query.set('coupon', coupon);
|
|
197
|
+
return this.client.get("/paypal-setup-intent?" + query.toString(), this.headers());
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* Returns the needed headers for the module requests
|
|
201
|
+
* @private
|
|
202
|
+
*/
|
|
203
|
+
Payments.prototype.headers = function () {
|
|
204
|
+
return (0, headers_1.headersWithToken)(this.appDetails.clientName, this.appDetails.clientVersion, this.apiSecurity.token);
|
|
205
|
+
};
|
|
206
|
+
return Payments;
|
|
207
|
+
}());
|
|
208
|
+
exports.Payments = Payments;
|