btrz-api-client 5.121.0 → 5.123.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/interline.js +14 -14
- package/lib/endpoints/accounts/users.js +24 -6
- package/package.json +1 -1
- package/src/endpoints/accounts/interline.js +12 -12
- package/src/endpoints/accounts/users.js +11 -0
- package/test/endpoints/accounts/interline.test.js +10 -10
- package/test/endpoints/accounts/users.js +10 -0
- package/types/client.d.ts +17 -10
- package/types/endpoints/accounts/interline.d.ts +10 -10
- package/types/endpoints/accounts/users.d.ts +7 -0
- package/types/initializedClient.d.ts +17 -10
|
@@ -94,47 +94,47 @@ function interlineFactory(_ref) {
|
|
|
94
94
|
var network = {
|
|
95
95
|
get: function get(_ref8) {
|
|
96
96
|
var token = _ref8.token,
|
|
97
|
-
|
|
97
|
+
interlineId = _ref8.interlineId,
|
|
98
98
|
headers = _ref8.headers;
|
|
99
99
|
|
|
100
|
-
return client.get("/interline/" +
|
|
100
|
+
return client.get("/interline/" + interlineId + "/network", {
|
|
101
101
|
headers: authorizationHeaders({ token: token, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
102
102
|
});
|
|
103
103
|
},
|
|
104
104
|
update: function update(_ref9) {
|
|
105
|
-
var
|
|
105
|
+
var interlineId = _ref9.interlineId,
|
|
106
106
|
data = _ref9.data,
|
|
107
107
|
token = _ref9.token,
|
|
108
108
|
jwtToken = _ref9.jwtToken,
|
|
109
109
|
headers = _ref9.headers;
|
|
110
110
|
|
|
111
111
|
return client({
|
|
112
|
-
url: "/interline/" +
|
|
112
|
+
url: "/interline/" + interlineId + "/network",
|
|
113
113
|
method: "put",
|
|
114
114
|
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
115
115
|
data: data
|
|
116
116
|
});
|
|
117
|
-
}
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
return {
|
|
121
|
+
invitations: invitations,
|
|
122
|
+
consumers: consumers,
|
|
123
|
+
providers: providers,
|
|
124
|
+
network: network,
|
|
118
125
|
remove: function remove(_ref10) {
|
|
119
|
-
var
|
|
126
|
+
var interlineId = _ref10.interlineId,
|
|
120
127
|
token = _ref10.token,
|
|
121
128
|
jwtToken = _ref10.jwtToken,
|
|
122
129
|
headers = _ref10.headers;
|
|
123
130
|
|
|
124
131
|
return client({
|
|
125
|
-
url: "/interline/" +
|
|
132
|
+
url: "/interline/" + interlineId,
|
|
126
133
|
method: "delete",
|
|
127
134
|
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
128
135
|
});
|
|
129
136
|
}
|
|
130
137
|
};
|
|
131
|
-
|
|
132
|
-
return {
|
|
133
|
-
invitations: invitations,
|
|
134
|
-
consumers: consumers,
|
|
135
|
-
providers: providers,
|
|
136
|
-
network: network
|
|
137
|
-
};
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
module.exports = interlineFactory;
|
|
@@ -34,13 +34,30 @@ function usersFactory(_ref) {
|
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
function create(_ref4) {
|
|
38
|
+
var token = _ref4.token,
|
|
39
|
+
jwtToken = _ref4.jwtToken,
|
|
40
|
+
_ref4$query = _ref4.query,
|
|
41
|
+
query = _ref4$query === undefined ? {} : _ref4$query,
|
|
42
|
+
data = _ref4.data,
|
|
43
|
+
headers = _ref4.headers;
|
|
44
|
+
|
|
45
|
+
return client({
|
|
46
|
+
url: "/users",
|
|
47
|
+
method: "post",
|
|
48
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
49
|
+
params: query,
|
|
50
|
+
data: data
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
37
54
|
var sequences = {
|
|
38
|
-
create: function create(
|
|
39
|
-
var jwtToken =
|
|
40
|
-
token =
|
|
41
|
-
userId =
|
|
42
|
-
sequence =
|
|
43
|
-
headers =
|
|
55
|
+
create: function create(_ref5) {
|
|
56
|
+
var jwtToken = _ref5.jwtToken,
|
|
57
|
+
token = _ref5.token,
|
|
58
|
+
userId = _ref5.userId,
|
|
59
|
+
sequence = _ref5.sequence,
|
|
60
|
+
headers = _ref5.headers;
|
|
44
61
|
|
|
45
62
|
return client({
|
|
46
63
|
url: "/users/" + userId + "/sequences",
|
|
@@ -54,6 +71,7 @@ function usersFactory(_ref) {
|
|
|
54
71
|
return {
|
|
55
72
|
get: get,
|
|
56
73
|
all: all,
|
|
74
|
+
create: create,
|
|
57
75
|
sequences: sequences
|
|
58
76
|
};
|
|
59
77
|
}
|
package/package.json
CHANGED
|
@@ -55,25 +55,18 @@ function interlineFactory({client, internalAuthTokenProvider}) {
|
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
const network = {
|
|
58
|
-
get({token,
|
|
59
|
-
return client.get(`/interline/${
|
|
58
|
+
get({token, interlineId, headers}) {
|
|
59
|
+
return client.get(`/interline/${interlineId}/network`, {
|
|
60
60
|
headers: authorizationHeaders({token, internalAuthTokenProvider, headers})
|
|
61
61
|
});
|
|
62
62
|
},
|
|
63
|
-
update({
|
|
63
|
+
update({interlineId, data, token, jwtToken, headers}) {
|
|
64
64
|
return client({
|
|
65
|
-
url: `/interline/${
|
|
65
|
+
url: `/interline/${interlineId}/network`,
|
|
66
66
|
method: "put",
|
|
67
67
|
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
68
68
|
data
|
|
69
69
|
});
|
|
70
|
-
},
|
|
71
|
-
remove({networkId, token, jwtToken, headers}) {
|
|
72
|
-
return client({
|
|
73
|
-
url: `/interline/${networkId}`,
|
|
74
|
-
method: "delete",
|
|
75
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
76
|
-
});
|
|
77
70
|
}
|
|
78
71
|
};
|
|
79
72
|
|
|
@@ -81,7 +74,14 @@ function interlineFactory({client, internalAuthTokenProvider}) {
|
|
|
81
74
|
invitations,
|
|
82
75
|
consumers,
|
|
83
76
|
providers,
|
|
84
|
-
network
|
|
77
|
+
network,
|
|
78
|
+
remove({interlineId, token, jwtToken, headers}) {
|
|
79
|
+
return client({
|
|
80
|
+
url: `/interline/${interlineId}`,
|
|
81
|
+
method: "delete",
|
|
82
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
87
|
|
|
@@ -16,6 +16,16 @@ function usersFactory({client, internalAuthTokenProvider}) {
|
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
function create({token, jwtToken, query = {}, data, headers}) {
|
|
20
|
+
return client({
|
|
21
|
+
url: "/users",
|
|
22
|
+
method: "post",
|
|
23
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
24
|
+
params: query,
|
|
25
|
+
data
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
19
29
|
const sequences = {
|
|
20
30
|
create({jwtToken, token, userId, sequence, headers}) {
|
|
21
31
|
return client({
|
|
@@ -30,6 +40,7 @@ function usersFactory({client, internalAuthTokenProvider}) {
|
|
|
30
40
|
return {
|
|
31
41
|
get,
|
|
32
42
|
all,
|
|
43
|
+
create,
|
|
33
44
|
sequences
|
|
34
45
|
};
|
|
35
46
|
}
|
|
@@ -81,15 +81,15 @@ describe("accounts/interline", () => {
|
|
|
81
81
|
});
|
|
82
82
|
|
|
83
83
|
it("should DELETE the network & interline relationship", () => {
|
|
84
|
-
const
|
|
84
|
+
const interlineId = "interlineId123123";
|
|
85
85
|
|
|
86
|
-
axiosMock.onDelete(`/interline/${
|
|
86
|
+
axiosMock.onDelete(`/interline/${interlineId}`).reply(expectRequest({
|
|
87
87
|
statusCode: 204,
|
|
88
88
|
token,
|
|
89
89
|
jwtToken
|
|
90
90
|
}));
|
|
91
|
-
return api.accounts.interline.
|
|
92
|
-
|
|
91
|
+
return api.accounts.interline.remove({
|
|
92
|
+
interlineId,
|
|
93
93
|
token,
|
|
94
94
|
jwtToken
|
|
95
95
|
}).then((httpResponse) => {
|
|
@@ -122,33 +122,33 @@ describe("accounts/interline", () => {
|
|
|
122
122
|
});
|
|
123
123
|
|
|
124
124
|
it("should PUT and update a network", () => {
|
|
125
|
-
const
|
|
125
|
+
const interlineId = "interline123";
|
|
126
126
|
const data = {
|
|
127
127
|
productIds: ["product ids", "multiple", "times"],
|
|
128
128
|
fares: ["fare ids", "also multiple", "times"]
|
|
129
129
|
};
|
|
130
130
|
|
|
131
|
-
axiosMock.onPut(`/interline/${
|
|
131
|
+
axiosMock.onPut(`/interline/${interlineId}/network`).reply(expectRequest({
|
|
132
132
|
statusCode: 200,
|
|
133
133
|
token,
|
|
134
134
|
jwtToken
|
|
135
135
|
}));
|
|
136
136
|
|
|
137
|
-
return api.accounts.interline.network.update({
|
|
137
|
+
return api.accounts.interline.network.update({interlineId, token, jwtToken, data})
|
|
138
138
|
.then((httpResponse) => {
|
|
139
139
|
expect(httpResponse.status).eql(200);
|
|
140
140
|
});
|
|
141
141
|
});
|
|
142
142
|
|
|
143
143
|
it("should GET an interline network", () => {
|
|
144
|
-
const
|
|
144
|
+
const interlineId = "network123";
|
|
145
145
|
|
|
146
|
-
axiosMock.onGet(`/interline/${
|
|
146
|
+
axiosMock.onGet(`/interline/${interlineId}/network`).reply(expectRequest({
|
|
147
147
|
statusCode: 200,
|
|
148
148
|
token
|
|
149
149
|
}));
|
|
150
150
|
return api.accounts.interline.network.get({
|
|
151
|
-
|
|
151
|
+
interlineId,
|
|
152
152
|
token
|
|
153
153
|
}).then((httpResponse) => {
|
|
154
154
|
expect(httpResponse.status).eql(200);
|
|
@@ -20,6 +20,16 @@ describe("accounts/user/{id}", () => {
|
|
|
20
20
|
return api.accounts.users.all({token});
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
+
it("should create a user login", () => {
|
|
24
|
+
const data = {audience: "lala"};
|
|
25
|
+
axiosMock.onPost("/users").reply(expectRequest({statusCode: 200, token, jwtToken, body: data}));
|
|
26
|
+
return api.accounts.users.create({
|
|
27
|
+
jwtToken,
|
|
28
|
+
token,
|
|
29
|
+
data
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
23
33
|
it("should create user sequence", () => {
|
|
24
34
|
const userSequenceData = {};
|
|
25
35
|
axiosMock.onPost(`/users/${id}/sequences`).reply(expectRequest({statusCode: 200, token, jwtToken, body: userSequenceData}));
|
package/types/client.d.ts
CHANGED
|
@@ -1728,25 +1728,25 @@ export function createApiClient(options: {
|
|
|
1728
1728
|
}): any;
|
|
1729
1729
|
};
|
|
1730
1730
|
network: {
|
|
1731
|
-
get({ token,
|
|
1731
|
+
get({ token, interlineId, headers }: {
|
|
1732
1732
|
token: any;
|
|
1733
|
-
|
|
1733
|
+
interlineId: any;
|
|
1734
1734
|
headers: any;
|
|
1735
1735
|
}): any;
|
|
1736
|
-
update({
|
|
1737
|
-
|
|
1736
|
+
update({ interlineId, data, token, jwtToken, headers }: {
|
|
1737
|
+
interlineId: any;
|
|
1738
1738
|
data: any;
|
|
1739
1739
|
token: any;
|
|
1740
1740
|
jwtToken: any;
|
|
1741
1741
|
headers: any;
|
|
1742
1742
|
}): any;
|
|
1743
|
-
remove({ networkId, token, jwtToken, headers }: {
|
|
1744
|
-
networkId: any;
|
|
1745
|
-
token: any;
|
|
1746
|
-
jwtToken: any;
|
|
1747
|
-
headers: any;
|
|
1748
|
-
}): any;
|
|
1749
1743
|
};
|
|
1744
|
+
remove({ interlineId, token, jwtToken, headers }: {
|
|
1745
|
+
interlineId: any;
|
|
1746
|
+
token: any;
|
|
1747
|
+
jwtToken: any;
|
|
1748
|
+
headers: any;
|
|
1749
|
+
}): any;
|
|
1750
1750
|
};
|
|
1751
1751
|
lexicons: {
|
|
1752
1752
|
all: ({ token, context, query, headers }: {
|
|
@@ -2217,6 +2217,13 @@ export function createApiClient(options: {
|
|
|
2217
2217
|
query?: {};
|
|
2218
2218
|
headers: any;
|
|
2219
2219
|
}) => any;
|
|
2220
|
+
create: ({ token, jwtToken, query, data, headers }: {
|
|
2221
|
+
token: any;
|
|
2222
|
+
jwtToken: any;
|
|
2223
|
+
query?: {};
|
|
2224
|
+
data: any;
|
|
2225
|
+
headers: any;
|
|
2226
|
+
}) => any;
|
|
2220
2227
|
sequences: {
|
|
2221
2228
|
create({ jwtToken, token, userId, sequence, headers }: {
|
|
2222
2229
|
jwtToken: any;
|
|
@@ -46,23 +46,23 @@ declare function interlineFactory({ client, internalAuthTokenProvider }: {
|
|
|
46
46
|
}): any;
|
|
47
47
|
};
|
|
48
48
|
network: {
|
|
49
|
-
get({ token,
|
|
49
|
+
get({ token, interlineId, headers }: {
|
|
50
50
|
token: any;
|
|
51
|
-
|
|
51
|
+
interlineId: any;
|
|
52
52
|
headers: any;
|
|
53
53
|
}): any;
|
|
54
|
-
update({
|
|
55
|
-
|
|
54
|
+
update({ interlineId, data, token, jwtToken, headers }: {
|
|
55
|
+
interlineId: any;
|
|
56
56
|
data: any;
|
|
57
57
|
token: any;
|
|
58
58
|
jwtToken: any;
|
|
59
59
|
headers: any;
|
|
60
60
|
}): any;
|
|
61
|
-
remove({ networkId, token, jwtToken, headers }: {
|
|
62
|
-
networkId: any;
|
|
63
|
-
token: any;
|
|
64
|
-
jwtToken: any;
|
|
65
|
-
headers: any;
|
|
66
|
-
}): any;
|
|
67
61
|
};
|
|
62
|
+
remove({ interlineId, token, jwtToken, headers }: {
|
|
63
|
+
interlineId: any;
|
|
64
|
+
token: any;
|
|
65
|
+
jwtToken: any;
|
|
66
|
+
headers: any;
|
|
67
|
+
}): any;
|
|
68
68
|
};
|
|
@@ -15,6 +15,13 @@ declare function usersFactory({ client, internalAuthTokenProvider }: {
|
|
|
15
15
|
query?: {};
|
|
16
16
|
headers: any;
|
|
17
17
|
}) => any;
|
|
18
|
+
create: ({ token, jwtToken, query, data, headers }: {
|
|
19
|
+
token: any;
|
|
20
|
+
jwtToken: any;
|
|
21
|
+
query?: {};
|
|
22
|
+
data: any;
|
|
23
|
+
headers: any;
|
|
24
|
+
}) => any;
|
|
18
25
|
sequences: {
|
|
19
26
|
create({ jwtToken, token, userId, sequence, headers }: {
|
|
20
27
|
jwtToken: any;
|
|
@@ -1682,25 +1682,25 @@ declare const _exports: {
|
|
|
1682
1682
|
}): any;
|
|
1683
1683
|
};
|
|
1684
1684
|
network: {
|
|
1685
|
-
get({ token,
|
|
1685
|
+
get({ token, interlineId, headers }: {
|
|
1686
1686
|
token: any;
|
|
1687
|
-
|
|
1687
|
+
interlineId: any;
|
|
1688
1688
|
headers: any;
|
|
1689
1689
|
}): any;
|
|
1690
|
-
update({
|
|
1691
|
-
|
|
1690
|
+
update({ interlineId, data, token, jwtToken, headers }: {
|
|
1691
|
+
interlineId: any;
|
|
1692
1692
|
data: any;
|
|
1693
1693
|
token: any;
|
|
1694
1694
|
jwtToken: any;
|
|
1695
1695
|
headers: any;
|
|
1696
1696
|
}): any;
|
|
1697
|
-
remove({ networkId, token, jwtToken, headers }: {
|
|
1698
|
-
networkId: any;
|
|
1699
|
-
token: any;
|
|
1700
|
-
jwtToken: any;
|
|
1701
|
-
headers: any;
|
|
1702
|
-
}): any;
|
|
1703
1697
|
};
|
|
1698
|
+
remove({ interlineId, token, jwtToken, headers }: {
|
|
1699
|
+
interlineId: any;
|
|
1700
|
+
token: any;
|
|
1701
|
+
jwtToken: any;
|
|
1702
|
+
headers: any;
|
|
1703
|
+
}): any;
|
|
1704
1704
|
};
|
|
1705
1705
|
lexicons: {
|
|
1706
1706
|
all: ({ token, context, query, headers }: {
|
|
@@ -2171,6 +2171,13 @@ declare const _exports: {
|
|
|
2171
2171
|
query?: {};
|
|
2172
2172
|
headers: any;
|
|
2173
2173
|
}) => any;
|
|
2174
|
+
create: ({ token, jwtToken, query, data, headers }: {
|
|
2175
|
+
token: any;
|
|
2176
|
+
jwtToken: any;
|
|
2177
|
+
query?: {};
|
|
2178
|
+
data: any;
|
|
2179
|
+
headers: any;
|
|
2180
|
+
}) => any;
|
|
2174
2181
|
sequences: {
|
|
2175
2182
|
create({ jwtToken, token, userId, sequence, headers }: {
|
|
2176
2183
|
jwtToken: any;
|