seatsio 87.1.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 +29 -22
- package/package.json +4 -4
|
@@ -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
|
|
30
|
-
_axiosConfig(baseUrl: string, secretKey: string, workspaceKey: string, extraHeaders:
|
|
31
|
-
baseURL: string;
|
|
32
|
-
auth: {
|
|
33
|
-
username: string;
|
|
34
|
-
password: null;
|
|
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,31 +1,41 @@
|
|
|
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; }
|
|
23
35
|
if (extraHeaders === void 0) { extraHeaders = {}; }
|
|
24
|
-
// @ts-expect-error TS(2345): Argument of type '{ baseURL: string; auth: { username... Remove this comment to see the full error message
|
|
25
36
|
this.client = axios_1.default.create(this._axiosConfig(region.url, secretKey, workspaceKey, extraHeaders));
|
|
26
37
|
this._setupRequestListenerInterceptors();
|
|
27
|
-
|
|
28
|
-
this.client.maxRetries = 5;
|
|
38
|
+
this.setMaxRetries(5);
|
|
29
39
|
this.client.interceptors.response.use(function (response) { return response; }, exponentialBackoffInterceptor(this.client));
|
|
30
40
|
this.errInterceptor = this.client.interceptors.response.use(function (response) { return response; }, errorInterceptor_1.errorResponseHandler);
|
|
31
41
|
this.charts = new Charts_1.Charts(this.client);
|
|
@@ -41,22 +51,19 @@ var SeatsioClient = /** @class */ (function () {
|
|
|
41
51
|
this.ticketBuyers = new TicketBuyers_1.TicketBuyers(this.client, this);
|
|
42
52
|
}
|
|
43
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 } : {}));
|
|
44
55
|
var config = {
|
|
45
56
|
baseURL: baseUrl,
|
|
46
57
|
auth: {
|
|
47
58
|
username: secretKey,
|
|
48
|
-
password:
|
|
59
|
+
password: ''
|
|
49
60
|
},
|
|
50
|
-
headers:
|
|
51
|
-
|
|
61
|
+
headers: headers,
|
|
62
|
+
timeout: TEN_SECONDS,
|
|
52
63
|
paramsSerializer: {
|
|
53
64
|
indexes: null
|
|
54
65
|
}
|
|
55
66
|
};
|
|
56
|
-
config.headers['X-Client-Lib'] = 'js';
|
|
57
|
-
if (workspaceKey) {
|
|
58
|
-
config.headers['X-Workspace-Key'] = workspaceKey;
|
|
59
|
-
}
|
|
60
67
|
return config;
|
|
61
68
|
};
|
|
62
69
|
SeatsioClient.prototype._setupRequestListenerInterceptors = function () {
|
|
@@ -93,24 +100,24 @@ var SeatsioClient = /** @class */ (function () {
|
|
|
93
100
|
}());
|
|
94
101
|
exports.SeatsioClient = SeatsioClient;
|
|
95
102
|
function exponentialBackoffInterceptor(axios) {
|
|
96
|
-
return function (
|
|
97
|
-
|
|
98
|
-
|
|
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);
|
|
99
107
|
}
|
|
100
|
-
var config =
|
|
108
|
+
var config = error.config;
|
|
101
109
|
if (!config) {
|
|
102
|
-
return Promise.reject(
|
|
110
|
+
return Promise.reject(error);
|
|
103
111
|
}
|
|
104
112
|
config.__retryCount = config.__retryCount || 0;
|
|
105
113
|
if (config.__retryCount >= axios.maxRetries) {
|
|
106
|
-
return Promise.reject(
|
|
114
|
+
return Promise.reject(error);
|
|
107
115
|
}
|
|
108
116
|
var backoff = new Promise(function (resolve) {
|
|
109
117
|
var waitTime = Math.pow(2, config.__retryCount + 2) * 100;
|
|
110
118
|
config.__retryCount++;
|
|
111
|
-
// @ts-expect-error TS(2794): Expected 1 arguments, but got 0. Did you forget to... Remove this comment to see the full error message
|
|
112
119
|
setTimeout(function () { return resolve(); }, waitTime);
|
|
113
120
|
});
|
|
114
|
-
return backoff.then(function () { return axios(config); });
|
|
121
|
+
return backoff.then(function () { return axios.request(config); });
|
|
115
122
|
};
|
|
116
123
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "seatsio",
|
|
3
|
-
"version": "87.
|
|
3
|
+
"version": "87.3.0",
|
|
4
4
|
"main": "dist/src/index.js",
|
|
5
5
|
"types": "dist/src/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@jest/globals": "30.2.0",
|
|
25
25
|
"@types/jest": "30.0.0",
|
|
26
|
-
"@types/node": "
|
|
26
|
+
"@types/node": "25.0.3",
|
|
27
27
|
"@typescript-eslint/eslint-plugin": "5.62.0",
|
|
28
28
|
"@typescript-eslint/parser": "5.62.0",
|
|
29
|
-
"ctix": "2.7.
|
|
29
|
+
"ctix": "2.7.2",
|
|
30
30
|
"eslint": "8.57.1",
|
|
31
31
|
"eslint-config-standard": "17.1.0",
|
|
32
32
|
"eslint-plugin-import": "2.32.0",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"eslint-plugin-promise": "6.6.0",
|
|
35
35
|
"jest": "30.2.0",
|
|
36
36
|
"jest-cli": "30.2.0",
|
|
37
|
-
"prettier": "3.7.
|
|
37
|
+
"prettier": "3.7.4",
|
|
38
38
|
"semver": "7.7.3",
|
|
39
39
|
"ts-jest": "29.4.6",
|
|
40
40
|
"typescript": "5.9.3",
|