btrz-api-client 5.170.0 → 5.172.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/lib/client-standalone-min.js +1 -1
- package/lib/endpoints/accounts/users.js +18 -0
- package/lib/endpoints/sales/order.js +5 -2
- package/package.json +1 -1
- package/src/endpoints/accounts/users.js +11 -0
- package/src/endpoints/sales/order.js +9 -8
- package/test/endpoints/accounts/users.js +18 -0
- package/types/client.d.ts +11 -7
- package/types/endpoints/accounts/users.d.ts +9 -6
- package/types/endpoints/sales/order.d.ts +2 -1
- package/types/initializedClient.d.ts +11 -7
|
@@ -95,6 +95,24 @@ function usersFactory(_ref) {
|
|
|
95
95
|
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
96
96
|
data: sequence
|
|
97
97
|
});
|
|
98
|
+
},
|
|
99
|
+
transfer: function transfer(_ref8) {
|
|
100
|
+
var jwtToken = _ref8.jwtToken,
|
|
101
|
+
token = _ref8.token,
|
|
102
|
+
userId = _ref8.userId,
|
|
103
|
+
sequenceId = _ref8.sequenceId,
|
|
104
|
+
newUserId = _ref8.newUserId,
|
|
105
|
+
headers = _ref8.headers;
|
|
106
|
+
|
|
107
|
+
return client({
|
|
108
|
+
url: "/users/" + userId + "/sequences/" + sequenceId,
|
|
109
|
+
method: "patch",
|
|
110
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
111
|
+
data: {
|
|
112
|
+
operation: "transfer",
|
|
113
|
+
newUserId: newUserId
|
|
114
|
+
}
|
|
115
|
+
});
|
|
98
116
|
}
|
|
99
117
|
};
|
|
100
118
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _require = require("./../endpoints_helpers"),
|
|
3
|
+
var _require = require("./../endpoints_helpers.js"),
|
|
4
4
|
authorizationHeaders = _require.authorizationHeaders;
|
|
5
5
|
|
|
6
6
|
function orderFactory(_ref) {
|
|
@@ -40,12 +40,15 @@ function orderFactory(_ref) {
|
|
|
40
40
|
orderId = _ref4.orderId,
|
|
41
41
|
payments = _ref4.payments,
|
|
42
42
|
jwtToken = _ref4.jwtToken,
|
|
43
|
-
headers = _ref4.headers
|
|
43
|
+
headers = _ref4.headers,
|
|
44
|
+
_ref4$query = _ref4.query,
|
|
45
|
+
query = _ref4$query === undefined ? {} : _ref4$query;
|
|
44
46
|
|
|
45
47
|
return client({
|
|
46
48
|
url: "/orders/" + orderId + "/payments",
|
|
47
49
|
method: "post",
|
|
48
50
|
data: payments,
|
|
51
|
+
params: query,
|
|
49
52
|
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
50
53
|
});
|
|
51
54
|
}
|
package/package.json
CHANGED
|
@@ -51,6 +51,17 @@ function usersFactory({client, internalAuthTokenProvider}) {
|
|
|
51
51
|
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
52
52
|
data: sequence
|
|
53
53
|
});
|
|
54
|
+
},
|
|
55
|
+
transfer({jwtToken, token, userId, sequenceId, newUserId, headers}) {
|
|
56
|
+
return client({
|
|
57
|
+
url: `/users/${userId}/sequences/${sequenceId}`,
|
|
58
|
+
method: "patch",
|
|
59
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
60
|
+
data: {
|
|
61
|
+
operation: "transfer",
|
|
62
|
+
newUserId
|
|
63
|
+
}
|
|
64
|
+
});
|
|
54
65
|
}
|
|
55
66
|
};
|
|
56
67
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {authorizationHeaders} = require("./../endpoints_helpers.js");
|
|
2
2
|
|
|
3
|
-
function orderFactory({
|
|
4
|
-
function create({
|
|
5
|
-
return client({
|
|
3
|
+
function orderFactory({client, internalAuthTokenProvider}) {
|
|
4
|
+
function create({token, order, jwtToken, headers}) {
|
|
5
|
+
return client({
|
|
6
6
|
url: "/order",
|
|
7
7
|
method: "post",
|
|
8
8
|
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
@@ -10,7 +10,7 @@ function orderFactory({ client, internalAuthTokenProvider }) {
|
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
function get({
|
|
13
|
+
function get({token, orderId, query = {}, headers}) {
|
|
14
14
|
return client({
|
|
15
15
|
url: `/order/${orderId}`,
|
|
16
16
|
params: query,
|
|
@@ -18,16 +18,17 @@ function orderFactory({ client, internalAuthTokenProvider }) {
|
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
function overwrite({token, orderId, payments, jwtToken, headers}) {
|
|
21
|
+
function overwrite({token, orderId, payments, jwtToken, headers, query = {}}) {
|
|
22
22
|
return client({
|
|
23
23
|
url: `/orders/${orderId}/payments`,
|
|
24
24
|
method: "post",
|
|
25
25
|
data: payments,
|
|
26
|
-
|
|
26
|
+
params: query,
|
|
27
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
27
28
|
});
|
|
28
29
|
}
|
|
29
30
|
|
|
30
|
-
return {
|
|
31
|
+
return {
|
|
31
32
|
create,
|
|
32
33
|
get,
|
|
33
34
|
overwrite
|
|
@@ -70,4 +70,22 @@ describe("accounts/user/{id}", () => {
|
|
|
70
70
|
sequence: userSequenceData
|
|
71
71
|
});
|
|
72
72
|
});
|
|
73
|
+
|
|
74
|
+
it("should transfer an user sequence", () => {
|
|
75
|
+
const sequenceId = "123";
|
|
76
|
+
const newUserId = "123";
|
|
77
|
+
const operationData = {
|
|
78
|
+
operation: "transfer",
|
|
79
|
+
newUserId
|
|
80
|
+
};
|
|
81
|
+
// eslint-disable-next-line max-len
|
|
82
|
+
axiosMock.onPatch(`/users/${id}/sequences/${sequenceId}`).reply(expectRequest({statusCode: 200, token, jwtToken, body: operationData}));
|
|
83
|
+
return api.accounts.users.sequences.transfer({
|
|
84
|
+
jwtToken,
|
|
85
|
+
userId: id,
|
|
86
|
+
sequenceId,
|
|
87
|
+
token,
|
|
88
|
+
newUserId
|
|
89
|
+
});
|
|
90
|
+
});
|
|
73
91
|
});
|
package/types/client.d.ts
CHANGED
|
@@ -2409,12 +2409,7 @@ export function createApiClient(options: {
|
|
|
2409
2409
|
}) => any;
|
|
2410
2410
|
};
|
|
2411
2411
|
users: {
|
|
2412
|
-
get: ({ token, jwtToken, id, headers }?: {
|
|
2413
|
-
token: any;
|
|
2414
|
-
jwtToken: any;
|
|
2415
|
-
id: any;
|
|
2416
|
-
headers: any;
|
|
2417
|
-
}) => any;
|
|
2412
|
+
get: ({ token, jwtToken, id, headers }?: {}) => any;
|
|
2418
2413
|
all: ({ token, jwtToken, query, headers }: {
|
|
2419
2414
|
token: any;
|
|
2420
2415
|
jwtToken: any;
|
|
@@ -2451,6 +2446,14 @@ export function createApiClient(options: {
|
|
|
2451
2446
|
sequence: any;
|
|
2452
2447
|
headers: any;
|
|
2453
2448
|
}): any;
|
|
2449
|
+
transfer({ jwtToken, token, userId, sequenceId, newUserId, headers }: {
|
|
2450
|
+
jwtToken: any;
|
|
2451
|
+
token: any;
|
|
2452
|
+
userId: any;
|
|
2453
|
+
sequenceId: any;
|
|
2454
|
+
newUserId: any;
|
|
2455
|
+
headers: any;
|
|
2456
|
+
}): any;
|
|
2454
2457
|
};
|
|
2455
2458
|
};
|
|
2456
2459
|
__test: {
|
|
@@ -2589,12 +2592,13 @@ export function createApiClient(options: {
|
|
|
2589
2592
|
query?: {};
|
|
2590
2593
|
headers: any;
|
|
2591
2594
|
}) => any;
|
|
2592
|
-
overwrite: ({ token, orderId, payments, jwtToken, headers }: {
|
|
2595
|
+
overwrite: ({ token, orderId, payments, jwtToken, headers, query }: {
|
|
2593
2596
|
token: any;
|
|
2594
2597
|
orderId: any;
|
|
2595
2598
|
payments: any;
|
|
2596
2599
|
jwtToken: any;
|
|
2597
2600
|
headers: any;
|
|
2601
|
+
query?: {};
|
|
2598
2602
|
}) => any;
|
|
2599
2603
|
};
|
|
2600
2604
|
voucher: {
|
|
@@ -3,12 +3,7 @@ declare function usersFactory({ client, internalAuthTokenProvider }: {
|
|
|
3
3
|
client: any;
|
|
4
4
|
internalAuthTokenProvider: any;
|
|
5
5
|
}): {
|
|
6
|
-
get: ({ token, jwtToken, id, headers }?: {
|
|
7
|
-
token: any;
|
|
8
|
-
jwtToken: any;
|
|
9
|
-
id: any;
|
|
10
|
-
headers: any;
|
|
11
|
-
}) => any;
|
|
6
|
+
get: ({ token, jwtToken, id, headers }?: {}) => any;
|
|
12
7
|
all: ({ token, jwtToken, query, headers }: {
|
|
13
8
|
token: any;
|
|
14
9
|
jwtToken: any;
|
|
@@ -45,5 +40,13 @@ declare function usersFactory({ client, internalAuthTokenProvider }: {
|
|
|
45
40
|
sequence: any;
|
|
46
41
|
headers: any;
|
|
47
42
|
}): any;
|
|
43
|
+
transfer({ jwtToken, token, userId, sequenceId, newUserId, headers }: {
|
|
44
|
+
jwtToken: any;
|
|
45
|
+
token: any;
|
|
46
|
+
userId: any;
|
|
47
|
+
sequenceId: any;
|
|
48
|
+
newUserId: any;
|
|
49
|
+
headers: any;
|
|
50
|
+
}): any;
|
|
48
51
|
};
|
|
49
52
|
};
|
|
@@ -15,11 +15,12 @@ declare function orderFactory({ client, internalAuthTokenProvider }: {
|
|
|
15
15
|
query?: {};
|
|
16
16
|
headers: any;
|
|
17
17
|
}) => any;
|
|
18
|
-
overwrite: ({ token, orderId, payments, jwtToken, headers }: {
|
|
18
|
+
overwrite: ({ token, orderId, payments, jwtToken, headers, query }: {
|
|
19
19
|
token: any;
|
|
20
20
|
orderId: any;
|
|
21
21
|
payments: any;
|
|
22
22
|
jwtToken: any;
|
|
23
23
|
headers: any;
|
|
24
|
+
query?: {};
|
|
24
25
|
}) => any;
|
|
25
26
|
};
|
|
@@ -2363,12 +2363,7 @@ declare const _exports: {
|
|
|
2363
2363
|
}) => any;
|
|
2364
2364
|
};
|
|
2365
2365
|
users: {
|
|
2366
|
-
get: ({ token, jwtToken, id, headers }?: {
|
|
2367
|
-
token: any;
|
|
2368
|
-
jwtToken: any;
|
|
2369
|
-
id: any;
|
|
2370
|
-
headers: any;
|
|
2371
|
-
}) => any;
|
|
2366
|
+
get: ({ token, jwtToken, id, headers }?: {}) => any;
|
|
2372
2367
|
all: ({ token, jwtToken, query, headers }: {
|
|
2373
2368
|
token: any;
|
|
2374
2369
|
jwtToken: any;
|
|
@@ -2405,6 +2400,14 @@ declare const _exports: {
|
|
|
2405
2400
|
sequence: any;
|
|
2406
2401
|
headers: any;
|
|
2407
2402
|
}): any;
|
|
2403
|
+
transfer({ jwtToken, token, userId, sequenceId, newUserId, headers }: {
|
|
2404
|
+
jwtToken: any;
|
|
2405
|
+
token: any;
|
|
2406
|
+
userId: any;
|
|
2407
|
+
sequenceId: any;
|
|
2408
|
+
newUserId: any;
|
|
2409
|
+
headers: any;
|
|
2410
|
+
}): any;
|
|
2408
2411
|
};
|
|
2409
2412
|
};
|
|
2410
2413
|
__test: {
|
|
@@ -2543,12 +2546,13 @@ declare const _exports: {
|
|
|
2543
2546
|
query?: {};
|
|
2544
2547
|
headers: any;
|
|
2545
2548
|
}) => any;
|
|
2546
|
-
overwrite: ({ token, orderId, payments, jwtToken, headers }: {
|
|
2549
|
+
overwrite: ({ token, orderId, payments, jwtToken, headers, query }: {
|
|
2547
2550
|
token: any;
|
|
2548
2551
|
orderId: any;
|
|
2549
2552
|
payments: any;
|
|
2550
2553
|
jwtToken: any;
|
|
2551
2554
|
headers: any;
|
|
2555
|
+
query?: {};
|
|
2552
2556
|
}) => any;
|
|
2553
2557
|
};
|
|
2554
2558
|
voucher: {
|