starta.apiclient 1.34.796 → 1.35.841
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/lib/index.d.ts +2 -2
- package/lib/request.d.ts +2 -2
- package/lib/request.js +29 -22
- package/lib/services/accounts.d.ts +5 -4
- package/lib/services/accounts.js +21 -20
- package/lib/services/emailConfirmations.d.ts +3 -3
- package/lib/services/emailConfirmations.js +4 -4
- package/lib/services/healthcheck.d.ts +3 -3
- package/lib/services/healthcheck.js +3 -3
- package/lib/services/index.d.ts +4 -3
- package/lib/services/index.js +13 -10
- package/lib/services/organizations/customers.d.ts +3 -3
- package/lib/services/organizations/customers.js +8 -8
- package/lib/services/organizations/dashboard.d.ts +3 -3
- package/lib/services/organizations/dashboard.js +4 -4
- package/lib/services/organizations/index.d.ts +10 -3
- package/lib/services/organizations/index.js +47 -31
- package/lib/services/organizations/integrations.d.ts +3 -3
- package/lib/services/organizations/integrations.js +3 -3
- package/lib/services/organizations/members.d.ts +3 -3
- package/lib/services/organizations/members.js +3 -3
- package/lib/services/organizations/orders.d.ts +3 -3
- package/lib/services/organizations/orders.js +8 -8
- package/lib/services/organizations/payments.d.ts +3 -3
- package/lib/services/organizations/payments.js +4 -4
- package/lib/services/organizations/public.d.ts +3 -3
- package/lib/services/organizations/public.js +7 -7
- package/lib/services/organizations/rooms.d.ts +3 -3
- package/lib/services/organizations/rooms.js +6 -6
- package/lib/services/organizations/seminars.d.ts +3 -3
- package/lib/services/organizations/seminars.js +7 -7
- package/lib/services/organizations/services.d.ts +3 -3
- package/lib/services/organizations/services.js +5 -5
- package/lib/services/passwordResets.d.ts +3 -3
- package/lib/services/passwordResets.js +4 -4
- package/lib/services/sessions.d.ts +3 -3
- package/lib/services/sessions.js +6 -6
- package/lib/services/system.d.ts +3 -3
- package/lib/services/system.js +3 -3
- package/lib/services/webhooks.d.ts +3 -3
- package/lib/services/webhooks.js +3 -3
- package/lib/types.d.ts +5 -2
- package/package.json +3 -3
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import factory from './factory';
|
|
2
2
|
import StartaApiClient from './services';
|
|
3
|
-
import {
|
|
3
|
+
import { StartaRequestRunner, StartaRequestConfig, StartaRequestData, StartaRequestMiddlewares, StartaResponse } from './types';
|
|
4
4
|
export default factory;
|
|
5
|
-
export { StartaApiClient,
|
|
5
|
+
export { StartaApiClient, StartaRequestRunner, StartaRequestConfig, StartaRequestData, StartaRequestMiddlewares, StartaResponse };
|
package/lib/request.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const requestFactory: (baseURL: string, middlewares: StartaRequestMiddlewares) =>
|
|
1
|
+
import { StartaRequestRunner, StartaRequestMiddlewares } from './types';
|
|
2
|
+
declare const requestFactory: (baseURL: string, middlewares: StartaRequestMiddlewares) => StartaRequestRunner;
|
|
3
3
|
export { requestFactory };
|
package/lib/request.js
CHANGED
|
@@ -13,6 +13,35 @@ var __assign = (this && this.__assign) || function () {
|
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.requestFactory = void 0;
|
|
15
15
|
var axios_1 = require("axios");
|
|
16
|
+
var requestFactory = function (baseURL, middlewares) {
|
|
17
|
+
var authHeaderToken = '';
|
|
18
|
+
return {
|
|
19
|
+
setAuthHeaderToken: function (token) { authHeaderToken = token; },
|
|
20
|
+
performRequest: function (_a) {
|
|
21
|
+
var url = _a.url, method = _a.method, urlParams = _a.urlParams, body = _a.body, _b = _a.config, config = _b === void 0 ? {} : _b;
|
|
22
|
+
if (!config.headers) {
|
|
23
|
+
config.headers = {};
|
|
24
|
+
}
|
|
25
|
+
var cookie = (middlewares === null || middlewares === void 0 ? void 0 : middlewares.cookieFactory) && (middlewares === null || middlewares === void 0 ? void 0 : middlewares.cookieFactory());
|
|
26
|
+
if (cookie) {
|
|
27
|
+
config.headers.Cookie = cookie;
|
|
28
|
+
}
|
|
29
|
+
if (authHeaderToken) {
|
|
30
|
+
config.headers.Authorization = authHeaderToken;
|
|
31
|
+
}
|
|
32
|
+
var requestConfig = __assign({ baseURL: config.rewriteBaseUrl ? config.rewriteBaseUrl(baseURL) : baseURL, method: method, params: urlParams, data: body, withCredentials: true }, config);
|
|
33
|
+
(middlewares === null || middlewares === void 0 ? void 0 : middlewares.logger) && (middlewares === null || middlewares === void 0 ? void 0 : middlewares.logger("Sending request to: ".concat(url, " with config:"), requestConfig));
|
|
34
|
+
return (0, axios_1.default)(url, requestConfig)
|
|
35
|
+
.then(onSuccess, onErrorFactory(middlewares))
|
|
36
|
+
.then(function (_a) {
|
|
37
|
+
var success = _a.success, data = _a.data, httpResponse = _a.httpResponse;
|
|
38
|
+
(middlewares === null || middlewares === void 0 ? void 0 : middlewares.logger) && (middlewares === null || middlewares === void 0 ? void 0 : middlewares.logger('received result', { success: success, data: data }));
|
|
39
|
+
return { success: success, data: data, httpResponse: httpResponse };
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
exports.requestFactory = requestFactory;
|
|
16
45
|
function onSuccess(response) {
|
|
17
46
|
return {
|
|
18
47
|
httpResponse: response,
|
|
@@ -36,25 +65,3 @@ var onErrorFactory = function (middlewares) { return function (error) {
|
|
|
36
65
|
}
|
|
37
66
|
return result;
|
|
38
67
|
}; };
|
|
39
|
-
var requestFactory = function (baseURL, middlewares) {
|
|
40
|
-
return function (_a) {
|
|
41
|
-
var url = _a.url, method = _a.method, urlParams = _a.urlParams, body = _a.body, _b = _a.config, config = _b === void 0 ? {} : _b;
|
|
42
|
-
if (!config.headers) {
|
|
43
|
-
config.headers = {};
|
|
44
|
-
}
|
|
45
|
-
var cookie = (middlewares === null || middlewares === void 0 ? void 0 : middlewares.cookieFactory) && (middlewares === null || middlewares === void 0 ? void 0 : middlewares.cookieFactory());
|
|
46
|
-
if (cookie) {
|
|
47
|
-
config.headers.Cookie = cookie;
|
|
48
|
-
}
|
|
49
|
-
var requestConfig = __assign({ baseURL: config.rewriteBaseUrl ? config.rewriteBaseUrl(baseURL) : baseURL, method: method, params: urlParams, data: body, withCredentials: true }, config);
|
|
50
|
-
(middlewares === null || middlewares === void 0 ? void 0 : middlewares.logger) && (middlewares === null || middlewares === void 0 ? void 0 : middlewares.logger("Sending request to: ".concat(url, " with config:"), requestConfig));
|
|
51
|
-
return (0, axios_1.default)(url, requestConfig)
|
|
52
|
-
.then(onSuccess, onErrorFactory(middlewares))
|
|
53
|
-
.then(function (_a) {
|
|
54
|
-
var success = _a.success, data = _a.data, httpResponse = _a.httpResponse;
|
|
55
|
-
(middlewares === null || middlewares === void 0 ? void 0 : middlewares.logger) && (middlewares === null || middlewares === void 0 ? void 0 : middlewares.logger('received result', { success: success, data: data }));
|
|
56
|
-
return { success: success, data: data, httpResponse: httpResponse };
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
exports.requestFactory = requestFactory;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StartaRequestRunner } from '../types';
|
|
2
2
|
export default class Accounts {
|
|
3
|
-
private
|
|
4
|
-
constructor(
|
|
3
|
+
private _requestRunner;
|
|
4
|
+
constructor(requestRunner: StartaRequestRunner);
|
|
5
5
|
update(login: string, { phone, firstName, lastName, timeZone }: {
|
|
6
6
|
phone: any;
|
|
7
7
|
firstName: any;
|
|
@@ -48,7 +48,8 @@ export default class Accounts {
|
|
|
48
48
|
getKeys(login: string): Promise<import("../types").StartaResponse>;
|
|
49
49
|
getAllKeys(): Promise<import("../types").StartaResponse>;
|
|
50
50
|
getAddressSuggestions(login: string, term: any): Promise<import("../types").StartaResponse>;
|
|
51
|
-
orders(login: string, { from, to, status, product: { type, id, executor } }: {
|
|
51
|
+
orders(login: string, { organizationLogin, from, to, status, product: { type, id, executor } }: {
|
|
52
|
+
organizationLogin: any;
|
|
52
53
|
from: any;
|
|
53
54
|
to: any;
|
|
54
55
|
status: any;
|
package/lib/services/accounts.js
CHANGED
|
@@ -2,32 +2,32 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var _helpers_1 = require("./_helpers");
|
|
4
4
|
var Accounts = /** @class */ (function () {
|
|
5
|
-
function Accounts(
|
|
6
|
-
this.
|
|
5
|
+
function Accounts(requestRunner) {
|
|
6
|
+
this._requestRunner = requestRunner;
|
|
7
7
|
}
|
|
8
8
|
Accounts.prototype.update = function (login, _a) {
|
|
9
9
|
var phone = _a.phone, firstName = _a.firstName, lastName = _a.lastName, timeZone = _a.timeZone;
|
|
10
|
-
return this.
|
|
10
|
+
return this._requestRunner.performRequest({
|
|
11
11
|
url: "accounts/".concat(login),
|
|
12
12
|
method: 'PUT',
|
|
13
13
|
body: { phone: phone, firstName: firstName, lastName: lastName, timeZone: timeZone },
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
Accounts.prototype.getMainData = function (login) {
|
|
17
|
-
return this.
|
|
17
|
+
return this._requestRunner.performRequest({
|
|
18
18
|
url: "accounts/".concat(login, "/mainData"),
|
|
19
19
|
method: 'GET',
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
Accounts.prototype.serviceProviders = function (login) {
|
|
23
|
-
return this.
|
|
23
|
+
return this._requestRunner.performRequest({
|
|
24
24
|
url: "accounts/".concat(login, "/serviceProviders"),
|
|
25
25
|
method: 'GET',
|
|
26
26
|
});
|
|
27
27
|
};
|
|
28
28
|
Accounts.prototype.createViaSocialNetwork = function (_a) {
|
|
29
29
|
var email = _a.email, login = _a.login, socialNetworksKey = _a.socialNetworksKey, _b = _a.authMethod, authMethod = _b === void 0 ? 'cookie' : _b, acceptedTermsAndConditions = _a.acceptedTermsAndConditions;
|
|
30
|
-
return this.
|
|
30
|
+
return this._requestRunner.performRequest({
|
|
31
31
|
url: "accounts/sn",
|
|
32
32
|
method: 'POST',
|
|
33
33
|
body: {
|
|
@@ -41,7 +41,7 @@ var Accounts = /** @class */ (function () {
|
|
|
41
41
|
};
|
|
42
42
|
Accounts.prototype.create = function (_a) {
|
|
43
43
|
var email = _a.email, login = _a.login, password = _a.password, passwordConfirm = _a.passwordConfirm, firstName = _a.firstName, lastName = _a.lastName, key = _a.key, phone = _a.phone, _b = _a.authMethod, authMethod = _b === void 0 ? 'cookie' : _b, recaptchaToken = _a.recaptchaToken, acceptedTermsAndConditions = _a.acceptedTermsAndConditions;
|
|
44
|
-
return this.
|
|
44
|
+
return this._requestRunner.performRequest({
|
|
45
45
|
url: "accounts",
|
|
46
46
|
method: 'POST',
|
|
47
47
|
body: {
|
|
@@ -61,7 +61,7 @@ var Accounts = /** @class */ (function () {
|
|
|
61
61
|
};
|
|
62
62
|
Accounts.prototype.changePassword = function (login, _a) {
|
|
63
63
|
var currentPassword = _a.currentPassword, newPassword = _a.newPassword;
|
|
64
|
-
return this.
|
|
64
|
+
return this._requestRunner.performRequest({
|
|
65
65
|
url: "accounts/".concat(login, "/password"),
|
|
66
66
|
method: 'PUT',
|
|
67
67
|
body: { currentPassword: currentPassword, newPassword: newPassword },
|
|
@@ -69,21 +69,21 @@ var Accounts = /** @class */ (function () {
|
|
|
69
69
|
};
|
|
70
70
|
Accounts.prototype.acceptTermsAndConditions = function (login, _a) {
|
|
71
71
|
var acceptedTermsAndConditions = _a.acceptedTermsAndConditions;
|
|
72
|
-
return this.
|
|
72
|
+
return this._requestRunner.performRequest({
|
|
73
73
|
url: "accounts/".concat(login, "/acceptedTermsAndConditions"),
|
|
74
74
|
method: 'PUT',
|
|
75
75
|
body: { acceptedTermsAndConditions: acceptedTermsAndConditions },
|
|
76
76
|
});
|
|
77
77
|
};
|
|
78
78
|
Accounts.prototype.changeAvatar = function (login, file) {
|
|
79
|
-
return this.
|
|
79
|
+
return this._requestRunner.performRequest({
|
|
80
80
|
url: "accounts/".concat(login, "/avatar"),
|
|
81
81
|
method: 'PUT',
|
|
82
82
|
body: { file: file },
|
|
83
83
|
});
|
|
84
84
|
};
|
|
85
85
|
Accounts.prototype.changeLanguage = function (login, language) {
|
|
86
|
-
return this.
|
|
86
|
+
return this._requestRunner.performRequest({
|
|
87
87
|
url: "accounts/".concat(login, "/language"),
|
|
88
88
|
method: 'PUT',
|
|
89
89
|
body: { language: language },
|
|
@@ -91,7 +91,7 @@ var Accounts = /** @class */ (function () {
|
|
|
91
91
|
};
|
|
92
92
|
Accounts.prototype.addFile = function (login, fileFormData, _a) {
|
|
93
93
|
var _b = _a === void 0 ? {} : _a, headers = _b.headers;
|
|
94
|
-
return this.
|
|
94
|
+
return this._requestRunner.performRequest({
|
|
95
95
|
url: "accounts/".concat(login, "/files"),
|
|
96
96
|
method: 'POST',
|
|
97
97
|
body: fileFormData,
|
|
@@ -103,7 +103,7 @@ var Accounts = /** @class */ (function () {
|
|
|
103
103
|
});
|
|
104
104
|
};
|
|
105
105
|
Accounts.prototype.getFile = function (login, fileId) {
|
|
106
|
-
return this.
|
|
106
|
+
return this._requestRunner.performRequest({
|
|
107
107
|
url: "accounts/".concat(login, "/files/").concat(fileId),
|
|
108
108
|
method: 'GET',
|
|
109
109
|
config: {
|
|
@@ -112,7 +112,7 @@ var Accounts = /** @class */ (function () {
|
|
|
112
112
|
});
|
|
113
113
|
};
|
|
114
114
|
Accounts.prototype.getAvatar = function (login, version) {
|
|
115
|
-
return this.
|
|
115
|
+
return this._requestRunner.performRequest({
|
|
116
116
|
url: "accounts/".concat(login, "/avatar/?").concat(version),
|
|
117
117
|
method: 'GET',
|
|
118
118
|
config: {
|
|
@@ -121,34 +121,35 @@ var Accounts = /** @class */ (function () {
|
|
|
121
121
|
});
|
|
122
122
|
};
|
|
123
123
|
Accounts.prototype.createKey = function (login) {
|
|
124
|
-
return this.
|
|
124
|
+
return this._requestRunner.performRequest({
|
|
125
125
|
url: "accounts/".concat(login, "/keys"),
|
|
126
126
|
method: 'POST',
|
|
127
127
|
body: {},
|
|
128
128
|
});
|
|
129
129
|
};
|
|
130
130
|
Accounts.prototype.getKeys = function (login) {
|
|
131
|
-
return this.
|
|
131
|
+
return this._requestRunner.performRequest({
|
|
132
132
|
url: "accounts/".concat(login, "/keys"),
|
|
133
133
|
method: 'GET',
|
|
134
134
|
});
|
|
135
135
|
};
|
|
136
136
|
Accounts.prototype.getAllKeys = function () {
|
|
137
|
-
return this.
|
|
137
|
+
return this._requestRunner.performRequest({
|
|
138
138
|
url: "keys",
|
|
139
139
|
method: 'GET',
|
|
140
140
|
});
|
|
141
141
|
};
|
|
142
142
|
Accounts.prototype.getAddressSuggestions = function (login, term) {
|
|
143
|
-
return this.
|
|
143
|
+
return this._requestRunner.performRequest({
|
|
144
144
|
url: "accounts/".concat(login, "/address/suggestions?term=").concat(term),
|
|
145
145
|
method: 'GET',
|
|
146
146
|
});
|
|
147
147
|
};
|
|
148
148
|
Accounts.prototype.orders = function (login, _a) {
|
|
149
|
-
var from = _a.from, to = _a.to, status = _a.status, _b = _a.product, _c = _b === void 0 ? { type: undefined, id: undefined, executor: undefined } : _b, type = _c.type, id = _c.id, executor = _c.executor;
|
|
150
|
-
return this.
|
|
149
|
+
var organizationLogin = _a.organizationLogin, from = _a.from, to = _a.to, status = _a.status, _b = _a.product, _c = _b === void 0 ? { type: undefined, id: undefined, executor: undefined } : _b, type = _c.type, id = _c.id, executor = _c.executor;
|
|
150
|
+
return this._requestRunner.performRequest({
|
|
151
151
|
url: "accounts/".concat(login, "/orders").concat((0, _helpers_1.buildQuery)({
|
|
152
|
+
organizationLogin: organizationLogin,
|
|
152
153
|
from: from,
|
|
153
154
|
to: to,
|
|
154
155
|
status: status,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StartaRequestRunner } from '../types';
|
|
2
2
|
export default class EmailConfirmations {
|
|
3
|
-
private
|
|
4
|
-
constructor(
|
|
3
|
+
private _requestRunner;
|
|
4
|
+
constructor(requestRunner: StartaRequestRunner);
|
|
5
5
|
confirm(confirmEmailToken: any): Promise<import("../types").StartaResponse>;
|
|
6
6
|
create(): Promise<import("../types").StartaResponse>;
|
|
7
7
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var EmailConfirmations = /** @class */ (function () {
|
|
4
|
-
function EmailConfirmations(
|
|
5
|
-
this.
|
|
4
|
+
function EmailConfirmations(requestRunner) {
|
|
5
|
+
this._requestRunner = requestRunner;
|
|
6
6
|
}
|
|
7
7
|
EmailConfirmations.prototype.confirm = function (confirmEmailToken) {
|
|
8
|
-
return this.
|
|
8
|
+
return this._requestRunner.performRequest({
|
|
9
9
|
url: "emailConfirmations/".concat(confirmEmailToken),
|
|
10
10
|
method: 'PUT',
|
|
11
11
|
body: {},
|
|
12
12
|
});
|
|
13
13
|
};
|
|
14
14
|
EmailConfirmations.prototype.create = function () {
|
|
15
|
-
return this.
|
|
15
|
+
return this._requestRunner.performRequest({
|
|
16
16
|
url: "emailConfirmations",
|
|
17
17
|
method: 'POST',
|
|
18
18
|
body: {},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StartaRequestRunner } from '../types';
|
|
2
2
|
export default class Healthcheck {
|
|
3
|
-
private
|
|
4
|
-
constructor(
|
|
3
|
+
private _requestRunner;
|
|
4
|
+
constructor(requestRunner: StartaRequestRunner);
|
|
5
5
|
get(): Promise<import("../types").StartaResponse>;
|
|
6
6
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var Healthcheck = /** @class */ (function () {
|
|
4
|
-
function Healthcheck(
|
|
5
|
-
this.
|
|
4
|
+
function Healthcheck(requestRunner) {
|
|
5
|
+
this._requestRunner = requestRunner;
|
|
6
6
|
}
|
|
7
7
|
Healthcheck.prototype.get = function () {
|
|
8
|
-
return this.
|
|
8
|
+
return this._requestRunner.performRequest({
|
|
9
9
|
url: "healthcheck",
|
|
10
10
|
method: 'GET',
|
|
11
11
|
});
|
package/lib/services/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StartaRequestRunner } from '../types';
|
|
2
2
|
import Sessions from './sessions';
|
|
3
3
|
import Accounts from './accounts';
|
|
4
4
|
import Organizations from './organizations';
|
|
@@ -8,8 +8,9 @@ import EmailConfirmations from './emailConfirmations';
|
|
|
8
8
|
import System from './system';
|
|
9
9
|
import Webhooks from './webhooks';
|
|
10
10
|
export default class StartaApiClient {
|
|
11
|
-
private
|
|
12
|
-
constructor(
|
|
11
|
+
private _requestRunner;
|
|
12
|
+
constructor(requestRunner: StartaRequestRunner);
|
|
13
|
+
setAuthHeaderToken(token: any): void;
|
|
13
14
|
get sessions(): Sessions;
|
|
14
15
|
get accounts(): Accounts;
|
|
15
16
|
get organizations(): Organizations;
|
package/lib/services/index.js
CHANGED
|
@@ -9,61 +9,64 @@ var emailConfirmations_1 = require("./emailConfirmations");
|
|
|
9
9
|
var system_1 = require("./system");
|
|
10
10
|
var webhooks_1 = require("./webhooks");
|
|
11
11
|
var StartaApiClient = /** @class */ (function () {
|
|
12
|
-
function StartaApiClient(
|
|
13
|
-
this.
|
|
12
|
+
function StartaApiClient(requestRunner) {
|
|
13
|
+
this._requestRunner = requestRunner;
|
|
14
14
|
}
|
|
15
|
+
StartaApiClient.prototype.setAuthHeaderToken = function (token) {
|
|
16
|
+
this._requestRunner.setAuthHeaderToken(token);
|
|
17
|
+
};
|
|
15
18
|
Object.defineProperty(StartaApiClient.prototype, "sessions", {
|
|
16
19
|
get: function () {
|
|
17
|
-
return new sessions_1.default(this.
|
|
20
|
+
return new sessions_1.default(this._requestRunner);
|
|
18
21
|
},
|
|
19
22
|
enumerable: false,
|
|
20
23
|
configurable: true
|
|
21
24
|
});
|
|
22
25
|
Object.defineProperty(StartaApiClient.prototype, "accounts", {
|
|
23
26
|
get: function () {
|
|
24
|
-
return new accounts_1.default(this.
|
|
27
|
+
return new accounts_1.default(this._requestRunner);
|
|
25
28
|
},
|
|
26
29
|
enumerable: false,
|
|
27
30
|
configurable: true
|
|
28
31
|
});
|
|
29
32
|
Object.defineProperty(StartaApiClient.prototype, "organizations", {
|
|
30
33
|
get: function () {
|
|
31
|
-
return new organizations_1.default(this.
|
|
34
|
+
return new organizations_1.default(this._requestRunner);
|
|
32
35
|
},
|
|
33
36
|
enumerable: false,
|
|
34
37
|
configurable: true
|
|
35
38
|
});
|
|
36
39
|
Object.defineProperty(StartaApiClient.prototype, "passwordResets", {
|
|
37
40
|
get: function () {
|
|
38
|
-
return new passwordResets_1.default(this.
|
|
41
|
+
return new passwordResets_1.default(this._requestRunner);
|
|
39
42
|
},
|
|
40
43
|
enumerable: false,
|
|
41
44
|
configurable: true
|
|
42
45
|
});
|
|
43
46
|
Object.defineProperty(StartaApiClient.prototype, "webhooks", {
|
|
44
47
|
get: function () {
|
|
45
|
-
return new webhooks_1.default(this.
|
|
48
|
+
return new webhooks_1.default(this._requestRunner);
|
|
46
49
|
},
|
|
47
50
|
enumerable: false,
|
|
48
51
|
configurable: true
|
|
49
52
|
});
|
|
50
53
|
Object.defineProperty(StartaApiClient.prototype, "system", {
|
|
51
54
|
get: function () {
|
|
52
|
-
return new system_1.default(this.
|
|
55
|
+
return new system_1.default(this._requestRunner);
|
|
53
56
|
},
|
|
54
57
|
enumerable: false,
|
|
55
58
|
configurable: true
|
|
56
59
|
});
|
|
57
60
|
Object.defineProperty(StartaApiClient.prototype, "emailConfirmations", {
|
|
58
61
|
get: function () {
|
|
59
|
-
return new emailConfirmations_1.default(this.
|
|
62
|
+
return new emailConfirmations_1.default(this._requestRunner);
|
|
60
63
|
},
|
|
61
64
|
enumerable: false,
|
|
62
65
|
configurable: true
|
|
63
66
|
});
|
|
64
67
|
Object.defineProperty(StartaApiClient.prototype, "healthcheck", {
|
|
65
68
|
get: function () {
|
|
66
|
-
return new healthcheck_1.default(this.
|
|
69
|
+
return new healthcheck_1.default(this._requestRunner);
|
|
67
70
|
},
|
|
68
71
|
enumerable: false,
|
|
69
72
|
configurable: true
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StartaRequestRunner } from '../../types';
|
|
2
2
|
export default class Accounts {
|
|
3
|
-
private
|
|
4
|
-
constructor(
|
|
3
|
+
private _requestRunner;
|
|
4
|
+
constructor(requestRunner: StartaRequestRunner);
|
|
5
5
|
index(organizationLogin: any, { phone, email }?: {
|
|
6
6
|
phone?: string;
|
|
7
7
|
email?: string;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var _helpers_1 = require("../_helpers");
|
|
4
4
|
var Accounts = /** @class */ (function () {
|
|
5
|
-
function Accounts(
|
|
6
|
-
this.
|
|
5
|
+
function Accounts(requestRunner) {
|
|
6
|
+
this._requestRunner = requestRunner;
|
|
7
7
|
}
|
|
8
8
|
Accounts.prototype.index = function (organizationLogin, _a) {
|
|
9
9
|
var _b = _a === void 0 ? {} : _a, phone = _b.phone, email = _b.email;
|
|
10
|
-
return this.
|
|
10
|
+
return this._requestRunner.performRequest({
|
|
11
11
|
url: "accounts/".concat(organizationLogin, "/customers").concat((0, _helpers_1.buildQuery)({
|
|
12
12
|
phone: phone,
|
|
13
13
|
email: email,
|
|
@@ -16,20 +16,20 @@ var Accounts = /** @class */ (function () {
|
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
18
|
Accounts.prototype.get = function (organizationLogin, customerId) {
|
|
19
|
-
return this.
|
|
19
|
+
return this._requestRunner.performRequest({
|
|
20
20
|
url: "accounts/".concat(organizationLogin, "/customers/").concat(customerId),
|
|
21
21
|
method: 'GET',
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
24
|
Accounts.prototype.orders = function (organizationLogin, customerId) {
|
|
25
|
-
return this.
|
|
25
|
+
return this._requestRunner.performRequest({
|
|
26
26
|
url: "accounts/".concat(organizationLogin, "/customers/").concat(customerId, "/orders"),
|
|
27
27
|
method: 'GET',
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
30
|
Accounts.prototype.add = function (organizationLogin, _a) {
|
|
31
31
|
var login = _a.login, _b = _a.type, type = _b === void 0 ? 'client' : _b, email = _a.email, phone = _a.phone, firstName = _a.firstName, lastName = _a.lastName, countryIso2 = _a.countryIso2, region = _a.region, province = _a.province, zip = _a.zip, city = _a.city, addressLine1 = _a.addressLine1, addressLine2 = _a.addressLine2, dateOfBirth = _a.dateOfBirth, comment = _a.comment, language = _a.language;
|
|
32
|
-
return this.
|
|
32
|
+
return this._requestRunner.performRequest({
|
|
33
33
|
url: "accounts/".concat(organizationLogin, "/customers"),
|
|
34
34
|
method: 'POST',
|
|
35
35
|
body: {
|
|
@@ -54,7 +54,7 @@ var Accounts = /** @class */ (function () {
|
|
|
54
54
|
};
|
|
55
55
|
Accounts.prototype.update = function (organizationLogin, customerId, _a) {
|
|
56
56
|
var _b = _a.type, type = _b === void 0 ? 'client' : _b, email = _a.email, phone = _a.phone, firstName = _a.firstName, lastName = _a.lastName, countryIso2 = _a.countryIso2, region = _a.region, province = _a.province, zip = _a.zip, city = _a.city, addressLine1 = _a.addressLine1, addressLine2 = _a.addressLine2, dateOfBirth = _a.dateOfBirth, comment = _a.comment, language = _a.language;
|
|
57
|
-
return this.
|
|
57
|
+
return this._requestRunner.performRequest({
|
|
58
58
|
url: "accounts/".concat(organizationLogin, "/customers/").concat(customerId),
|
|
59
59
|
method: 'PUT',
|
|
60
60
|
body: {
|
|
@@ -77,7 +77,7 @@ var Accounts = /** @class */ (function () {
|
|
|
77
77
|
});
|
|
78
78
|
};
|
|
79
79
|
Accounts.prototype.delete = function (organizationLogin, customerId) {
|
|
80
|
-
return this.
|
|
80
|
+
return this._requestRunner.performRequest({
|
|
81
81
|
url: "accounts/".concat(organizationLogin, "/customers/").concat(customerId),
|
|
82
82
|
method: 'DELETE',
|
|
83
83
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StartaRequestRunner } from '../../types';
|
|
2
2
|
export default class Accounts {
|
|
3
|
-
private
|
|
4
|
-
constructor(
|
|
3
|
+
private _requestRunner;
|
|
4
|
+
constructor(requestRunner: StartaRequestRunner);
|
|
5
5
|
ordersStats(organizationLogin: any, { period, customFrom, customTo }: {
|
|
6
6
|
period: any;
|
|
7
7
|
customFrom: any;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var Accounts = /** @class */ (function () {
|
|
4
|
-
function Accounts(
|
|
5
|
-
this.
|
|
4
|
+
function Accounts(requestRunner) {
|
|
5
|
+
this._requestRunner = requestRunner;
|
|
6
6
|
}
|
|
7
7
|
Accounts.prototype.ordersStats = function (organizationLogin, _a) {
|
|
8
8
|
var period = _a.period, customFrom = _a.customFrom, customTo = _a.customTo;
|
|
@@ -12,13 +12,13 @@ var Accounts = /** @class */ (function () {
|
|
|
12
12
|
if (period === 'custom' && (!customFrom || !customTo)) {
|
|
13
13
|
throw new Error('For custom period please pass values to customFrom and customTo');
|
|
14
14
|
}
|
|
15
|
-
return this.
|
|
15
|
+
return this._requestRunner.performRequest({
|
|
16
16
|
url: "accounts/".concat(organizationLogin, "/dashboard/orders-stats?period=").concat(period, "&customFrom=").concat(customFrom, "&customTo=").concat(customTo),
|
|
17
17
|
method: 'GET',
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
Accounts.prototype.orders = function (organizationLogin) {
|
|
21
|
-
return this.
|
|
21
|
+
return this._requestRunner.performRequest({
|
|
22
22
|
url: "accounts/".concat(organizationLogin, "/dashboard/orders"),
|
|
23
23
|
method: 'GET',
|
|
24
24
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StartaRequestRunner } from '../../types';
|
|
2
2
|
import Customers from './customers';
|
|
3
3
|
import Orders from './orders';
|
|
4
4
|
import Rooms from './rooms';
|
|
@@ -10,8 +10,8 @@ import Dashboard from './dashboard';
|
|
|
10
10
|
import Public from './public';
|
|
11
11
|
import Integrations from './integrations';
|
|
12
12
|
export default class Organizations {
|
|
13
|
-
private
|
|
14
|
-
constructor(
|
|
13
|
+
private _requestRunner;
|
|
14
|
+
constructor(requestRunner: StartaRequestRunner);
|
|
15
15
|
create(account: any, { login, name, currency, isPrivate, description, timeZone, orgType }: {
|
|
16
16
|
login: any;
|
|
17
17
|
name: any;
|
|
@@ -21,6 +21,10 @@ export default class Organizations {
|
|
|
21
21
|
timeZone: any;
|
|
22
22
|
orgType: any;
|
|
23
23
|
}): Promise<import("../../types").StartaResponse>;
|
|
24
|
+
update(account: any, { name, timeZone }: {
|
|
25
|
+
name: any;
|
|
26
|
+
timeZone: any;
|
|
27
|
+
}): Promise<import("../../types").StartaResponse>;
|
|
24
28
|
get(organizationLogin: any): Promise<import("../../types").StartaResponse>;
|
|
25
29
|
getPermissionGroups(organizationLogin: any): Promise<import("../../types").StartaResponse>;
|
|
26
30
|
changeBanner(login: any, file: any): Promise<import("../../types").StartaResponse>;
|
|
@@ -32,6 +36,9 @@ export default class Organizations {
|
|
|
32
36
|
setCategories(organizationLogin: any, { categories }: {
|
|
33
37
|
categories?: never[] | undefined;
|
|
34
38
|
}): Promise<import("../../types").StartaResponse>;
|
|
39
|
+
setOrgType(organizationLogin: any, { orgType }: {
|
|
40
|
+
orgType: 'individual' | 'corporate';
|
|
41
|
+
}): Promise<import("../../types").StartaResponse>;
|
|
35
42
|
setPhoneNumbersSettings(organizationLogin: any, phoneNumbersSettings: any): Promise<import("../../types").StartaResponse>;
|
|
36
43
|
setOnboardingStepComplete(organizationLogin: any, step: any): Promise<import("../../types").StartaResponse>;
|
|
37
44
|
setAddressSettings(organizationLogin: any, addressSettings: any): Promise<import("../../types").StartaResponse>;
|