seatsio 87.2.0 → 87.3.0
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/src/SeatsioClient.d.ts +6 -17
- package/dist/src/SeatsioClient.js +27 -18
- package/package.json +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
+
import { Axios, type AxiosRequestConfig, type RawAxiosRequestHeaders } from 'axios';
|
|
1
2
|
import { Accounts } from './Accounts/Accounts';
|
|
2
3
|
import { Charts } from './Charts/Charts';
|
|
4
|
+
import { EventLog } from './EventLog/EventLog';
|
|
3
5
|
import { Events } from './Events/Events';
|
|
4
|
-
import { Workspaces } from './Workspaces/Workspaces';
|
|
5
6
|
import { HoldTokens } from './HoldTokens/HoldTokens';
|
|
7
|
+
import { Region } from './Region';
|
|
6
8
|
import { ChartReports } from './Reports/ChartReports';
|
|
7
9
|
import { EventReports } from './Reports/EventReports';
|
|
8
10
|
import { UsageReports } from './Reports/UsageReports';
|
|
9
11
|
import { Seasons } from './Seasons/Seasons';
|
|
10
|
-
import { Region } from './Region';
|
|
11
|
-
import { Axios } from 'axios';
|
|
12
|
-
import { EventLog } from './EventLog/EventLog';
|
|
13
12
|
import { TicketBuyers } from './TicketBuyers/TicketBuyers';
|
|
13
|
+
import { Workspaces } from './Workspaces/Workspaces';
|
|
14
14
|
export declare class SeatsioClient {
|
|
15
15
|
accounts: Accounts;
|
|
16
16
|
chartReports: ChartReports;
|
|
@@ -26,19 +26,8 @@ export declare class SeatsioClient {
|
|
|
26
26
|
workspaces: Workspaces;
|
|
27
27
|
eventLog: EventLog;
|
|
28
28
|
ticketBuyers: TicketBuyers;
|
|
29
|
-
constructor(region: Region, secretKey: string, workspaceKey?: string | undefined, extraHeaders?:
|
|
30
|
-
_axiosConfig(baseUrl: string, secretKey: string, workspaceKey: string | undefined, extraHeaders:
|
|
31
|
-
baseURL: string;
|
|
32
|
-
auth: {
|
|
33
|
-
username: string;
|
|
34
|
-
password: string;
|
|
35
|
-
};
|
|
36
|
-
headers: any;
|
|
37
|
-
errorHandle: boolean;
|
|
38
|
-
paramsSerializer: {
|
|
39
|
-
indexes: null;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
29
|
+
constructor(region: Region, secretKey: string, workspaceKey?: string | undefined, extraHeaders?: RawAxiosRequestHeaders);
|
|
30
|
+
_axiosConfig(baseUrl: string, secretKey: string, workspaceKey: string | undefined, extraHeaders: RawAxiosRequestHeaders): AxiosRequestConfig<any>;
|
|
42
31
|
_setupRequestListenerInterceptors(): void;
|
|
43
32
|
setRequestListener(requestListener: any): this;
|
|
44
33
|
setMaxRetries(maxRetries: number): this;
|
|
@@ -1,22 +1,34 @@
|
|
|
1
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
|
+
};
|
|
2
13
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
15
|
};
|
|
5
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
17
|
exports.SeatsioClient = void 0;
|
|
18
|
+
var axios_1 = __importDefault(require("axios"));
|
|
7
19
|
var Accounts_1 = require("./Accounts/Accounts");
|
|
8
20
|
var Charts_1 = require("./Charts/Charts");
|
|
21
|
+
var errorInterceptor_1 = require("./errorInterceptor");
|
|
22
|
+
var EventLog_1 = require("./EventLog/EventLog");
|
|
9
23
|
var Events_1 = require("./Events/Events");
|
|
10
|
-
var Workspaces_1 = require("./Workspaces/Workspaces");
|
|
11
24
|
var HoldTokens_1 = require("./HoldTokens/HoldTokens");
|
|
12
25
|
var ChartReports_1 = require("./Reports/ChartReports");
|
|
13
26
|
var EventReports_1 = require("./Reports/EventReports");
|
|
14
27
|
var UsageReports_1 = require("./Reports/UsageReports");
|
|
15
|
-
var errorInterceptor_1 = require("./errorInterceptor");
|
|
16
28
|
var Seasons_1 = require("./Seasons/Seasons");
|
|
17
|
-
var axios_1 = __importDefault(require("axios"));
|
|
18
|
-
var EventLog_1 = require("./EventLog/EventLog");
|
|
19
29
|
var TicketBuyers_1 = require("./TicketBuyers/TicketBuyers");
|
|
30
|
+
var Workspaces_1 = require("./Workspaces/Workspaces");
|
|
31
|
+
var TEN_SECONDS = 10000;
|
|
20
32
|
var SeatsioClient = /** @class */ (function () {
|
|
21
33
|
function SeatsioClient(region, secretKey, workspaceKey, extraHeaders) {
|
|
22
34
|
if (workspaceKey === void 0) { workspaceKey = undefined; }
|
|
@@ -39,22 +51,19 @@ var SeatsioClient = /** @class */ (function () {
|
|
|
39
51
|
this.ticketBuyers = new TicketBuyers_1.TicketBuyers(this.client, this);
|
|
40
52
|
}
|
|
41
53
|
SeatsioClient.prototype._axiosConfig = function (baseUrl, secretKey, workspaceKey, extraHeaders) {
|
|
54
|
+
var headers = __assign(__assign(__assign({}, extraHeaders), { 'X-Client-Lib': 'js' }), (workspaceKey ? { 'X-Workspace-Key': workspaceKey } : {}));
|
|
42
55
|
var config = {
|
|
43
56
|
baseURL: baseUrl,
|
|
44
57
|
auth: {
|
|
45
58
|
username: secretKey,
|
|
46
59
|
password: ''
|
|
47
60
|
},
|
|
48
|
-
headers:
|
|
49
|
-
|
|
61
|
+
headers: headers,
|
|
62
|
+
timeout: TEN_SECONDS,
|
|
50
63
|
paramsSerializer: {
|
|
51
64
|
indexes: null
|
|
52
65
|
}
|
|
53
66
|
};
|
|
54
|
-
config.headers['X-Client-Lib'] = 'js';
|
|
55
|
-
if (workspaceKey) {
|
|
56
|
-
config.headers['X-Workspace-Key'] = workspaceKey;
|
|
57
|
-
}
|
|
58
67
|
return config;
|
|
59
68
|
};
|
|
60
69
|
SeatsioClient.prototype._setupRequestListenerInterceptors = function () {
|
|
@@ -91,24 +100,24 @@ var SeatsioClient = /** @class */ (function () {
|
|
|
91
100
|
}());
|
|
92
101
|
exports.SeatsioClient = SeatsioClient;
|
|
93
102
|
function exponentialBackoffInterceptor(axios) {
|
|
94
|
-
return function (
|
|
95
|
-
|
|
96
|
-
|
|
103
|
+
return function (error) {
|
|
104
|
+
var _a;
|
|
105
|
+
if (((_a = error.response) === null || _a === void 0 ? void 0 : _a.status) !== 429) {
|
|
106
|
+
return Promise.reject(error);
|
|
97
107
|
}
|
|
98
|
-
var config =
|
|
108
|
+
var config = error.config;
|
|
99
109
|
if (!config) {
|
|
100
|
-
return Promise.reject(
|
|
110
|
+
return Promise.reject(error);
|
|
101
111
|
}
|
|
102
112
|
config.__retryCount = config.__retryCount || 0;
|
|
103
113
|
if (config.__retryCount >= axios.maxRetries) {
|
|
104
|
-
return Promise.reject(
|
|
114
|
+
return Promise.reject(error);
|
|
105
115
|
}
|
|
106
116
|
var backoff = new Promise(function (resolve) {
|
|
107
117
|
var waitTime = Math.pow(2, config.__retryCount + 2) * 100;
|
|
108
118
|
config.__retryCount++;
|
|
109
|
-
// @ts-expect-error TS(2794): Expected 1 arguments, but got 0. Did you forget to... Remove this comment to see the full error message
|
|
110
119
|
setTimeout(function () { return resolve(); }, waitTime);
|
|
111
120
|
});
|
|
112
|
-
return backoff.then(function () { return axios(config); });
|
|
121
|
+
return backoff.then(function () { return axios.request(config); });
|
|
113
122
|
};
|
|
114
123
|
}
|