seatsio 77.4.0 → 78.1.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/AsyncIterator.d.ts +0 -2
- package/dist/src/AsyncIterator.js +0 -16
- package/dist/src/Charts/Charts.d.ts +0 -1
- package/dist/src/Charts/Charts.js +0 -4
- package/dist/src/Events/EventObjectInfo.js +2 -1
- package/dist/src/Reports/ChartReports.d.ts +15 -11
- package/dist/src/Reports/ChartReports.js +31 -23
- package/dist/src/SeatsioClient.d.ts +0 -2
- package/dist/src/SeatsioClient.js +0 -2
- package/dist/src/index.d.ts +0 -2
- package/dist/src/index.js +0 -2
- package/package.json +12 -12
- package/dist/src/Subaccounts/Subaccount.d.ts +0 -11
- package/dist/src/Subaccounts/Subaccount.js +0 -15
- package/dist/src/Subaccounts/Subaccounts.d.ts +0 -25
- package/dist/src/Subaccounts/Subaccounts.js +0 -91
|
@@ -2,7 +2,6 @@ import { SeasonJson } from './Seasons/Season';
|
|
|
2
2
|
import { ChartJson } from './Charts/Chart';
|
|
3
3
|
import { Page } from './Page';
|
|
4
4
|
import { StatusChangeJson } from './Events/StatusChange';
|
|
5
|
-
import { SubaccountJson } from './Subaccounts/Subaccount';
|
|
6
5
|
import { WorkspaceJson } from './Workspaces/Workspace';
|
|
7
6
|
import { UserJson } from './Users/User';
|
|
8
7
|
import { EventJson } from './Events/Event';
|
|
@@ -31,7 +30,6 @@ export declare class AsyncIterator<T> {
|
|
|
31
30
|
events(data: PaginatedJson<EventJson>): void;
|
|
32
31
|
seasons(data: PaginatedJson<SeasonJson>): void;
|
|
33
32
|
statusChanges(data: PaginatedJson<StatusChangeJson>): void;
|
|
34
|
-
subaccounts(data: PaginatedJson<SubaccountJson>): void;
|
|
35
33
|
workspaces(data: PaginatedJson<WorkspaceJson>): void;
|
|
36
34
|
users(data: PaginatedJson<UserJson>): void;
|
|
37
35
|
fetch(fetchParams?: {}): Promise<void>;
|
|
@@ -42,7 +42,6 @@ var Chart_1 = require("./Charts/Chart");
|
|
|
42
42
|
var Page_1 = require("./Page");
|
|
43
43
|
var EventDeserializer_1 = require("./Events/EventDeserializer");
|
|
44
44
|
var StatusChange_1 = require("./Events/StatusChange");
|
|
45
|
-
var Subaccount_1 = require("./Subaccounts/Subaccount");
|
|
46
45
|
var Workspace_1 = require("./Workspaces/Workspace");
|
|
47
46
|
var User_1 = require("./Users/User");
|
|
48
47
|
var AsyncIterator = /** @class */ (function () {
|
|
@@ -105,18 +104,6 @@ var AsyncIterator = /** @class */ (function () {
|
|
|
105
104
|
// @ts-ignore
|
|
106
105
|
this.pages.push(new Page_1.Page(statusChanges, data.next_page_starts_after, data.previous_page_ends_before));
|
|
107
106
|
};
|
|
108
|
-
AsyncIterator.prototype.subaccounts = function (data) {
|
|
109
|
-
var _this_1 = this;
|
|
110
|
-
var subaccounts = [];
|
|
111
|
-
data.items.forEach(function (subaccountData) {
|
|
112
|
-
var subaccount = new Subaccount_1.Subaccount(subaccountData);
|
|
113
|
-
// @ts-ignore
|
|
114
|
-
_this_1.items.push(subaccount);
|
|
115
|
-
subaccounts.push(subaccount);
|
|
116
|
-
});
|
|
117
|
-
// @ts-ignore
|
|
118
|
-
this.pages.push(new Page_1.Page(subaccounts, data.next_page_starts_after, data.previous_page_ends_before));
|
|
119
|
-
};
|
|
120
107
|
AsyncIterator.prototype.workspaces = function (data) {
|
|
121
108
|
var _this_1 = this;
|
|
122
109
|
var workspaces = [];
|
|
@@ -166,9 +153,6 @@ var AsyncIterator = /** @class */ (function () {
|
|
|
166
153
|
case 'statusChanges':
|
|
167
154
|
_this_1.statusChanges(res.data);
|
|
168
155
|
break;
|
|
169
|
-
case 'subaccounts':
|
|
170
|
-
_this_1.subaccounts(res.data);
|
|
171
|
-
break;
|
|
172
156
|
case 'users':
|
|
173
157
|
_this_1.users(res.data);
|
|
174
158
|
break;
|
|
@@ -25,7 +25,6 @@ export declare class Charts {
|
|
|
25
25
|
moveOutOfArchive(key: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
26
26
|
copy(key: string): Promise<Chart>;
|
|
27
27
|
copyDraftVersion(key: string): Promise<Chart>;
|
|
28
|
-
copyToSubaccount(key: string, subaccountId: number): Promise<Chart>;
|
|
29
28
|
copyToWorkspace(key: string, workspaceKey: string): Promise<Chart>;
|
|
30
29
|
retrievePublishedVersionThumbnail(key: string): Promise<any>;
|
|
31
30
|
retrieveDraftVersionThumbnail(key: string): Promise<any>;
|
|
@@ -95,10 +95,6 @@ var Charts = /** @class */ (function () {
|
|
|
95
95
|
return this.client.post("charts/".concat(key, "/version/draft/actions/copy"))
|
|
96
96
|
.then(function (res) { return new Chart_1.Chart(res.data); });
|
|
97
97
|
};
|
|
98
|
-
Charts.prototype.copyToSubaccount = function (key, subaccountId) {
|
|
99
|
-
return this.client.post("charts/".concat(key, "/version/published/actions/copy-to/").concat(subaccountId))
|
|
100
|
-
.then(function (res) { return new Chart_1.Chart(res.data); });
|
|
101
|
-
};
|
|
102
98
|
Charts.prototype.copyToWorkspace = function (key, workspaceKey) {
|
|
103
99
|
return this.client.post("charts/".concat(key, "/version/published/actions/copy-to-workspace/").concat(workspaceKey))
|
|
104
100
|
.then(function (res) { return new Chart_1.Chart(res.data); });
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.EventObjectInfo = void 0;
|
|
4
4
|
var helperFunctions_1 = require("../utilities/helperFunctions");
|
|
5
5
|
var IDs_1 = require("../Common/IDs");
|
|
6
|
-
var EventObjectInfo =
|
|
6
|
+
var EventObjectInfo = /** @class */ (function () {
|
|
7
7
|
function EventObjectInfo(json) {
|
|
8
8
|
this.label = json.label;
|
|
9
9
|
this.labels = helperFunctions_1.HelperFunctions.labelCreator(json);
|
|
@@ -45,3 +45,4 @@ var EventObjectInfo = exports.EventObjectInfo = /** @class */ (function () {
|
|
|
45
45
|
EventObjectInfo.HELD = 'reservedByToken';
|
|
46
46
|
return EventObjectInfo;
|
|
47
47
|
}());
|
|
48
|
+
exports.EventObjectInfo = EventObjectInfo;
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { Axios } from 'axios';
|
|
2
|
+
export declare class Versions {
|
|
3
|
+
static publishedVersion: string;
|
|
4
|
+
static draftVersion: string;
|
|
5
|
+
}
|
|
2
6
|
export declare class ChartReports {
|
|
3
7
|
client: Axios;
|
|
4
8
|
constructor(client: Axios);
|
|
5
|
-
byLabel(chartKey: string, bookWholeTables?: string): Promise<import("..").Dict<import("..").ChartObjectInfo[]>>;
|
|
6
|
-
byObjectType(chartKey: string, bookWholeTables?: string): Promise<import("..").Dict<import("..").ChartObjectInfo[]>>;
|
|
7
|
-
summaryByObjectType(chartKey: string, bookWholeTables?: string): Promise<any>;
|
|
8
|
-
byCategoryLabel(chartKey: string, bookWholeTables?: string): Promise<import("..").Dict<import("..").ChartObjectInfo[]>>;
|
|
9
|
-
summaryByCategoryLabel(chartKey: string, bookWholeTables?: string): Promise<any>;
|
|
10
|
-
byCategoryKey(chartKey: string, bookWholeTables?: string): Promise<import("..").Dict<import("..").ChartObjectInfo[]>>;
|
|
11
|
-
summaryByCategoryKey(chartKey: string, bookWholeTables?: string): Promise<any>;
|
|
12
|
-
bySection(chartKey: string, bookWholeTables?: string): Promise<import("..").Dict<import("..").ChartObjectInfo[]>>;
|
|
13
|
-
summaryBySection(chartKey: string, bookWholeTables?: string): Promise<any>;
|
|
14
|
-
fetchReport(reportType: string, chartKey: string, bookWholeTables?: string): Promise<import("..").Dict<import("..").ChartObjectInfo[]>>;
|
|
15
|
-
fetchSummaryReport(reportType: string, chartKey: string, bookWholeTables?: string): Promise<any>;
|
|
9
|
+
byLabel(chartKey: string, bookWholeTables?: string, version?: string): Promise<import("..").Dict<import("..").ChartObjectInfo[]>>;
|
|
10
|
+
byObjectType(chartKey: string, bookWholeTables?: string, version?: string): Promise<import("..").Dict<import("..").ChartObjectInfo[]>>;
|
|
11
|
+
summaryByObjectType(chartKey: string, bookWholeTables?: string, version?: string): Promise<any>;
|
|
12
|
+
byCategoryLabel(chartKey: string, bookWholeTables?: string, version?: string): Promise<import("..").Dict<import("..").ChartObjectInfo[]>>;
|
|
13
|
+
summaryByCategoryLabel(chartKey: string, bookWholeTables?: string, version?: string): Promise<any>;
|
|
14
|
+
byCategoryKey(chartKey: string, bookWholeTables?: string, version?: string): Promise<import("..").Dict<import("..").ChartObjectInfo[]>>;
|
|
15
|
+
summaryByCategoryKey(chartKey: string, bookWholeTables?: string, version?: string): Promise<any>;
|
|
16
|
+
bySection(chartKey: string, bookWholeTables?: string, version?: string): Promise<import("..").Dict<import("..").ChartObjectInfo[]>>;
|
|
17
|
+
summaryBySection(chartKey: string, bookWholeTables?: string, version?: string): Promise<any>;
|
|
18
|
+
fetchReport(reportType: string, chartKey: string, bookWholeTables?: string, version?: string): Promise<import("..").Dict<import("..").ChartObjectInfo[]>>;
|
|
19
|
+
fetchSummaryReport(reportType: string, chartKey: string, bookWholeTables?: string, version?: string): Promise<any>;
|
|
16
20
|
}
|
|
@@ -1,44 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ChartReports = void 0;
|
|
3
|
+
exports.ChartReports = exports.Versions = void 0;
|
|
4
4
|
var reportUtility_1 = require("../utilities/reportUtility");
|
|
5
|
+
var Versions = /** @class */ (function () {
|
|
6
|
+
function Versions() {
|
|
7
|
+
}
|
|
8
|
+
Versions.publishedVersion = 'published';
|
|
9
|
+
Versions.draftVersion = 'draft';
|
|
10
|
+
return Versions;
|
|
11
|
+
}());
|
|
12
|
+
exports.Versions = Versions;
|
|
5
13
|
var ChartReports = /** @class */ (function () {
|
|
6
14
|
function ChartReports(client) {
|
|
7
15
|
this.client = client;
|
|
8
16
|
}
|
|
9
|
-
ChartReports.prototype.byLabel = function (chartKey, bookWholeTables) {
|
|
10
|
-
return this.fetchReport('byLabel', chartKey, bookWholeTables);
|
|
17
|
+
ChartReports.prototype.byLabel = function (chartKey, bookWholeTables, version) {
|
|
18
|
+
return this.fetchReport('byLabel', chartKey, bookWholeTables, version);
|
|
11
19
|
};
|
|
12
|
-
ChartReports.prototype.byObjectType = function (chartKey, bookWholeTables) {
|
|
13
|
-
return this.fetchReport('byObjectType', chartKey, bookWholeTables);
|
|
20
|
+
ChartReports.prototype.byObjectType = function (chartKey, bookWholeTables, version) {
|
|
21
|
+
return this.fetchReport('byObjectType', chartKey, bookWholeTables, version);
|
|
14
22
|
};
|
|
15
|
-
ChartReports.prototype.summaryByObjectType = function (chartKey, bookWholeTables) {
|
|
16
|
-
return this.fetchSummaryReport('byObjectType', chartKey, bookWholeTables);
|
|
23
|
+
ChartReports.prototype.summaryByObjectType = function (chartKey, bookWholeTables, version) {
|
|
24
|
+
return this.fetchSummaryReport('byObjectType', chartKey, bookWholeTables, version);
|
|
17
25
|
};
|
|
18
|
-
ChartReports.prototype.byCategoryLabel = function (chartKey, bookWholeTables) {
|
|
19
|
-
return this.fetchReport('byCategoryLabel', chartKey, bookWholeTables);
|
|
26
|
+
ChartReports.prototype.byCategoryLabel = function (chartKey, bookWholeTables, version) {
|
|
27
|
+
return this.fetchReport('byCategoryLabel', chartKey, bookWholeTables, version);
|
|
20
28
|
};
|
|
21
|
-
ChartReports.prototype.summaryByCategoryLabel = function (chartKey, bookWholeTables) {
|
|
22
|
-
return this.fetchSummaryReport('byCategoryLabel', chartKey, bookWholeTables);
|
|
29
|
+
ChartReports.prototype.summaryByCategoryLabel = function (chartKey, bookWholeTables, version) {
|
|
30
|
+
return this.fetchSummaryReport('byCategoryLabel', chartKey, bookWholeTables, version);
|
|
23
31
|
};
|
|
24
|
-
ChartReports.prototype.byCategoryKey = function (chartKey, bookWholeTables) {
|
|
25
|
-
return this.fetchReport('byCategoryKey', chartKey, bookWholeTables);
|
|
32
|
+
ChartReports.prototype.byCategoryKey = function (chartKey, bookWholeTables, version) {
|
|
33
|
+
return this.fetchReport('byCategoryKey', chartKey, bookWholeTables, version);
|
|
26
34
|
};
|
|
27
|
-
ChartReports.prototype.summaryByCategoryKey = function (chartKey, bookWholeTables) {
|
|
28
|
-
return this.fetchSummaryReport('byCategoryKey', chartKey, bookWholeTables);
|
|
35
|
+
ChartReports.prototype.summaryByCategoryKey = function (chartKey, bookWholeTables, version) {
|
|
36
|
+
return this.fetchSummaryReport('byCategoryKey', chartKey, bookWholeTables, version);
|
|
29
37
|
};
|
|
30
|
-
ChartReports.prototype.bySection = function (chartKey, bookWholeTables) {
|
|
31
|
-
return this.fetchReport('bySection', chartKey, bookWholeTables);
|
|
38
|
+
ChartReports.prototype.bySection = function (chartKey, bookWholeTables, version) {
|
|
39
|
+
return this.fetchReport('bySection', chartKey, bookWholeTables, version);
|
|
32
40
|
};
|
|
33
|
-
ChartReports.prototype.summaryBySection = function (chartKey, bookWholeTables) {
|
|
34
|
-
return this.fetchSummaryReport('bySection', chartKey, bookWholeTables);
|
|
41
|
+
ChartReports.prototype.summaryBySection = function (chartKey, bookWholeTables, version) {
|
|
42
|
+
return this.fetchSummaryReport('bySection', chartKey, bookWholeTables, version);
|
|
35
43
|
};
|
|
36
|
-
ChartReports.prototype.fetchReport = function (reportType, chartKey, bookWholeTables) {
|
|
37
|
-
return this.client.get("/reports/charts/".concat(encodeURIComponent(chartKey), "/").concat(reportType), { params: { bookWholeTables: bookWholeTables } })
|
|
44
|
+
ChartReports.prototype.fetchReport = function (reportType, chartKey, bookWholeTables, version) {
|
|
45
|
+
return this.client.get("/reports/charts/".concat(encodeURIComponent(chartKey), "/").concat(reportType), { params: { bookWholeTables: bookWholeTables, version: version } })
|
|
38
46
|
.then(function (res) { return reportUtility_1.Utilities.createChartReport(res.data); });
|
|
39
47
|
};
|
|
40
|
-
ChartReports.prototype.fetchSummaryReport = function (reportType, chartKey, bookWholeTables) {
|
|
41
|
-
return this.client.get("/reports/charts/".concat(encodeURIComponent(chartKey), "/").concat(reportType, "/summary"), { params: { bookWholeTables: bookWholeTables } })
|
|
48
|
+
ChartReports.prototype.fetchSummaryReport = function (reportType, chartKey, bookWholeTables, version) {
|
|
49
|
+
return this.client.get("/reports/charts/".concat(encodeURIComponent(chartKey), "/").concat(reportType, "/summary"), { params: { bookWholeTables: bookWholeTables, version: version } })
|
|
42
50
|
.then(function (res) { return res.data; });
|
|
43
51
|
};
|
|
44
52
|
return ChartReports;
|
|
@@ -3,7 +3,6 @@ import { Users } from './Users/Users';
|
|
|
3
3
|
import { Invitations } from './Invitations/Invitations';
|
|
4
4
|
import { Charts } from './Charts/Charts';
|
|
5
5
|
import { Events } from './Events/Events';
|
|
6
|
-
import { Subaccounts } from './Subaccounts/Subaccounts';
|
|
7
6
|
import { Workspaces } from './Workspaces/Workspaces';
|
|
8
7
|
import { HoldTokens } from './HoldTokens/HoldTokens';
|
|
9
8
|
import { ChartReports } from './Reports/ChartReports';
|
|
@@ -24,7 +23,6 @@ export declare class SeatsioClient {
|
|
|
24
23
|
invitations: Invitations;
|
|
25
24
|
requestListener: any;
|
|
26
25
|
seasons: Seasons;
|
|
27
|
-
subaccounts: Subaccounts;
|
|
28
26
|
usageReports: UsageReports;
|
|
29
27
|
users: Users;
|
|
30
28
|
workspaces: Workspaces;
|
|
@@ -9,7 +9,6 @@ var Users_1 = require("./Users/Users");
|
|
|
9
9
|
var Invitations_1 = require("./Invitations/Invitations");
|
|
10
10
|
var Charts_1 = require("./Charts/Charts");
|
|
11
11
|
var Events_1 = require("./Events/Events");
|
|
12
|
-
var Subaccounts_1 = require("./Subaccounts/Subaccounts");
|
|
13
12
|
var Workspaces_1 = require("./Workspaces/Workspaces");
|
|
14
13
|
var HoldTokens_1 = require("./HoldTokens/HoldTokens");
|
|
15
14
|
var ChartReports_1 = require("./Reports/ChartReports");
|
|
@@ -31,7 +30,6 @@ var SeatsioClient = /** @class */ (function () {
|
|
|
31
30
|
this.errInterceptor = this.client.interceptors.response.use(function (response) { return response; }, errorInterceptor_1.errorResponseHandler);
|
|
32
31
|
this.charts = new Charts_1.Charts(this.client);
|
|
33
32
|
this.events = new Events_1.Events(this.client);
|
|
34
|
-
this.subaccounts = new Subaccounts_1.Subaccounts(this.client);
|
|
35
33
|
this.workspaces = new Workspaces_1.Workspaces(this.client);
|
|
36
34
|
this.users = new Users_1.Users(this.client);
|
|
37
35
|
this.invitations = new Invitations_1.Invitations(this.client);
|
package/dist/src/index.d.ts
CHANGED
|
@@ -40,8 +40,6 @@ export * from './Reports/UsageReports';
|
|
|
40
40
|
export * from './Seasons/Season';
|
|
41
41
|
export * from './Seasons/SeasonParams';
|
|
42
42
|
export * from './Seasons/Seasons';
|
|
43
|
-
export * from './Subaccounts/Subaccount';
|
|
44
|
-
export * from './Subaccounts/Subaccounts';
|
|
45
43
|
export * from './Users/User';
|
|
46
44
|
export * from './Users/Users';
|
|
47
45
|
export * from './Workspaces/Workspace';
|
package/dist/src/index.js
CHANGED
|
@@ -56,8 +56,6 @@ __exportStar(require("./Reports/UsageReports"), exports);
|
|
|
56
56
|
__exportStar(require("./Seasons/Season"), exports);
|
|
57
57
|
__exportStar(require("./Seasons/SeasonParams"), exports);
|
|
58
58
|
__exportStar(require("./Seasons/Seasons"), exports);
|
|
59
|
-
__exportStar(require("./Subaccounts/Subaccount"), exports);
|
|
60
|
-
__exportStar(require("./Subaccounts/Subaccounts"), exports);
|
|
61
59
|
__exportStar(require("./Users/User"), exports);
|
|
62
60
|
__exportStar(require("./Users/Users"), exports);
|
|
63
61
|
__exportStar(require("./Workspaces/Workspace"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "seatsio",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "78.1.0",
|
|
4
4
|
"main": "dist/src/index.js",
|
|
5
5
|
"types": "dist/src/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -18,24 +18,24 @@
|
|
|
18
18
|
"url": "https://github.com/seatsio/seatsio-js"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"axios": "1.
|
|
21
|
+
"axios": "1.5.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@jest/globals": "29.6.
|
|
25
|
-
"@types/jest": "29.5.
|
|
26
|
-
"@types/node": "20.
|
|
27
|
-
"@types/uuid": "9.0.
|
|
24
|
+
"@jest/globals": "29.6.4",
|
|
25
|
+
"@types/jest": "29.5.4",
|
|
26
|
+
"@types/node": "20.5.9",
|
|
27
|
+
"@types/uuid": "9.0.3",
|
|
28
28
|
"@typescript-eslint/eslint-plugin": "5.62.0",
|
|
29
29
|
"@typescript-eslint/parser": "5.62.0",
|
|
30
|
-
"eslint": "8.
|
|
30
|
+
"eslint": "8.48.0",
|
|
31
31
|
"eslint-config-standard": "17.1.0",
|
|
32
|
-
"eslint-plugin-import": "2.28.
|
|
33
|
-
"eslint-plugin-n": "16.0.
|
|
32
|
+
"eslint-plugin-import": "2.28.1",
|
|
33
|
+
"eslint-plugin-n": "16.0.2",
|
|
34
34
|
"eslint-plugin-promise": "6.1.1",
|
|
35
|
-
"jest": "29.6.
|
|
36
|
-
"jest-cli": "29.6.
|
|
35
|
+
"jest": "29.6.4",
|
|
36
|
+
"jest-cli": "29.6.4",
|
|
37
37
|
"ts-jest": "29.1.1",
|
|
38
|
-
"typescript": "5.
|
|
38
|
+
"typescript": "5.2.2",
|
|
39
39
|
"ctix": "1.8.2",
|
|
40
40
|
"uuid": "9.0.0"
|
|
41
41
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Dict } from '../Dict';
|
|
2
|
-
export type SubaccountJson = Dict<any>;
|
|
3
|
-
export declare class Subaccount {
|
|
4
|
-
active: boolean;
|
|
5
|
-
designerKey: string;
|
|
6
|
-
id: number;
|
|
7
|
-
name: string;
|
|
8
|
-
publicKey: string;
|
|
9
|
-
secretKey: string;
|
|
10
|
-
constructor(json: SubaccountJson);
|
|
11
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Subaccount = void 0;
|
|
4
|
-
var Subaccount = /** @class */ (function () {
|
|
5
|
-
function Subaccount(json) {
|
|
6
|
-
this.id = json.id;
|
|
7
|
-
this.secretKey = json.secretKey;
|
|
8
|
-
this.designerKey = json.designerKey;
|
|
9
|
-
this.publicKey = json.publicKey;
|
|
10
|
-
this.name = json.name;
|
|
11
|
-
this.active = json.active;
|
|
12
|
-
}
|
|
13
|
-
return Subaccount;
|
|
14
|
-
}());
|
|
15
|
-
exports.Subaccount = Subaccount;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Lister } from '../Lister';
|
|
2
|
-
import { Subaccount, SubaccountJson } from './Subaccount';
|
|
3
|
-
import { Page } from '../Page';
|
|
4
|
-
import { Chart } from '../Charts/Chart';
|
|
5
|
-
import { Axios } from 'axios';
|
|
6
|
-
export declare class Subaccounts {
|
|
7
|
-
active: Lister<Subaccount, SubaccountJson>;
|
|
8
|
-
client: Axios;
|
|
9
|
-
inactive: Lister<Subaccount, SubaccountJson>;
|
|
10
|
-
constructor(client: Axios);
|
|
11
|
-
retrieve(id: number): Promise<Subaccount>;
|
|
12
|
-
create(name?: string | null): Promise<Subaccount>;
|
|
13
|
-
update(id: number, name?: string | null): Promise<import("axios").AxiosResponse<any, any>>;
|
|
14
|
-
activate(id: number): Promise<import("axios").AxiosResponse<any, any>>;
|
|
15
|
-
deactivate(id: number): Promise<import("axios").AxiosResponse<any, any>>;
|
|
16
|
-
regenerateSecretKey(id: number): Promise<any>;
|
|
17
|
-
regenerateDesignerKey(id: number): Promise<any>;
|
|
18
|
-
copyChartToParent(id: number, chartKey: string): Promise<Chart>;
|
|
19
|
-
copyChartToSubaccount(fromId: number, toId: number, chartKey: string): Promise<Chart>;
|
|
20
|
-
listAll(filter?: string | null): import("..").AsyncIterator<Subaccount>;
|
|
21
|
-
listFirstPage(filter?: string | null, pageSize?: number | null): Promise<Page<Subaccount>>;
|
|
22
|
-
listPageAfter(afterId: number, filter?: string | null, pageSize?: number | null): Promise<Page<Subaccount>>;
|
|
23
|
-
listPageBefore(beforeId: number, filter?: string | null, pageSize?: number | null): Promise<Page<Subaccount>>;
|
|
24
|
-
iterator(): Lister<Subaccount, SubaccountJson>;
|
|
25
|
-
}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Subaccounts = void 0;
|
|
4
|
-
var Lister_1 = require("../Lister");
|
|
5
|
-
var Subaccount_1 = require("./Subaccount");
|
|
6
|
-
var Page_1 = require("../Page");
|
|
7
|
-
var Chart_1 = require("../Charts/Chart");
|
|
8
|
-
var Subaccounts = /** @class */ (function () {
|
|
9
|
-
function Subaccounts(client) {
|
|
10
|
-
this.client = client;
|
|
11
|
-
this.active = new Lister_1.Lister('/subaccounts/active', this.client, 'subaccounts', function (data) {
|
|
12
|
-
var subaccounts = data.items.map(function (subaccountsData) { return new Subaccount_1.Subaccount(subaccountsData); });
|
|
13
|
-
return new Page_1.Page(subaccounts, data.next_page_starts_after, data.previous_page_ends_before);
|
|
14
|
-
});
|
|
15
|
-
this.inactive = new Lister_1.Lister('/subaccounts/inactive', this.client, 'subaccounts', function (data) {
|
|
16
|
-
var subaccounts = data.items.map(function (subaccountsData) { return new Subaccount_1.Subaccount(subaccountsData); });
|
|
17
|
-
return new Page_1.Page(subaccounts, data.next_page_starts_after, data.previous_page_ends_before);
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
Subaccounts.prototype.retrieve = function (id) {
|
|
21
|
-
return this.client.get("/subaccounts/".concat(id)).then(function (res) { return new Subaccount_1.Subaccount(res.data); });
|
|
22
|
-
};
|
|
23
|
-
Subaccounts.prototype.create = function (name) {
|
|
24
|
-
if (name === void 0) { name = null; }
|
|
25
|
-
var requestParameters = {};
|
|
26
|
-
if (name !== null) {
|
|
27
|
-
requestParameters.name = name;
|
|
28
|
-
}
|
|
29
|
-
return this.client.post('/subaccounts', requestParameters)
|
|
30
|
-
.then(function (res) { return new Subaccount_1.Subaccount(res.data); });
|
|
31
|
-
};
|
|
32
|
-
Subaccounts.prototype.update = function (id, name) {
|
|
33
|
-
if (name === void 0) { name = null; }
|
|
34
|
-
var requestParameters = {};
|
|
35
|
-
if (name !== null) {
|
|
36
|
-
requestParameters.name = name;
|
|
37
|
-
}
|
|
38
|
-
return this.client.post("/subaccounts/".concat(id), requestParameters);
|
|
39
|
-
};
|
|
40
|
-
Subaccounts.prototype.activate = function (id) {
|
|
41
|
-
return this.client.post("/subaccounts/".concat(id, "/actions/activate"));
|
|
42
|
-
};
|
|
43
|
-
Subaccounts.prototype.deactivate = function (id) {
|
|
44
|
-
return this.client.post("/subaccounts/".concat(id, "/actions/deactivate"));
|
|
45
|
-
};
|
|
46
|
-
Subaccounts.prototype.regenerateSecretKey = function (id) {
|
|
47
|
-
return this.client.post("/subaccounts/".concat(id, "/secret-key/actions/regenerate")).then(function (res) { return res.data; });
|
|
48
|
-
};
|
|
49
|
-
Subaccounts.prototype.regenerateDesignerKey = function (id) {
|
|
50
|
-
return this.client.post("/subaccounts/".concat(id, "/designer-key/actions/regenerate")).then(function (res) { return res.data; });
|
|
51
|
-
};
|
|
52
|
-
Subaccounts.prototype.copyChartToParent = function (id, chartKey) {
|
|
53
|
-
return this.client.post("/subaccounts/".concat(id, "/charts/").concat(chartKey, "/actions/copy-to/parent"))
|
|
54
|
-
.then(function (res) { return new Chart_1.Chart(res.data); });
|
|
55
|
-
};
|
|
56
|
-
Subaccounts.prototype.copyChartToSubaccount = function (fromId, toId, chartKey) {
|
|
57
|
-
return this.client.post("/subaccounts/".concat(fromId, "/charts/").concat(chartKey, "/actions/copy-to/").concat(toId))
|
|
58
|
-
.then(function (res) { return new Chart_1.Chart(res.data); });
|
|
59
|
-
};
|
|
60
|
-
Subaccounts.prototype.listAll = function (filter) {
|
|
61
|
-
if (filter === void 0) { filter = null; }
|
|
62
|
-
var requestParameters = filter !== null ? { filter: filter } : {};
|
|
63
|
-
return this.iterator().all(requestParameters);
|
|
64
|
-
};
|
|
65
|
-
Subaccounts.prototype.listFirstPage = function (filter, pageSize) {
|
|
66
|
-
if (filter === void 0) { filter = null; }
|
|
67
|
-
if (pageSize === void 0) { pageSize = null; }
|
|
68
|
-
var requestParameters = filter !== null ? { filter: filter } : null;
|
|
69
|
-
return this.iterator().firstPage(requestParameters, pageSize);
|
|
70
|
-
};
|
|
71
|
-
Subaccounts.prototype.listPageAfter = function (afterId, filter, pageSize) {
|
|
72
|
-
if (filter === void 0) { filter = null; }
|
|
73
|
-
if (pageSize === void 0) { pageSize = null; }
|
|
74
|
-
var requestParameters = filter !== null ? { filter: filter } : null;
|
|
75
|
-
return this.iterator().pageAfter(afterId, requestParameters, pageSize);
|
|
76
|
-
};
|
|
77
|
-
Subaccounts.prototype.listPageBefore = function (beforeId, filter, pageSize) {
|
|
78
|
-
if (filter === void 0) { filter = null; }
|
|
79
|
-
if (pageSize === void 0) { pageSize = null; }
|
|
80
|
-
var requestParameters = filter !== null ? { filter: filter } : null;
|
|
81
|
-
return this.iterator().pageBefore(beforeId, requestParameters, pageSize);
|
|
82
|
-
};
|
|
83
|
-
Subaccounts.prototype.iterator = function () {
|
|
84
|
-
return new Lister_1.Lister('/subaccounts', this.client, 'subaccounts', function (data) {
|
|
85
|
-
var subaccounts = data.items.map(function (subaccountsData) { return new Subaccount_1.Subaccount(subaccountsData); });
|
|
86
|
-
return new Page_1.Page(subaccounts, data.next_page_starts_after, data.previous_page_ends_before);
|
|
87
|
-
});
|
|
88
|
-
};
|
|
89
|
-
return Subaccounts;
|
|
90
|
-
}());
|
|
91
|
-
exports.Subaccounts = Subaccounts;
|