@unito/integrations-platform-client 0.44.4 → 0.46.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/api.d.ts +82 -3
- package/dist/src/api.js +70 -122
- package/dist/src/httpError.d.ts +6 -0
- package/dist/src/httpError.js +11 -0
- package/dist/src/index.cjs +477 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +2 -27
- package/package.json +24 -21
package/dist/src/api.js
CHANGED
|
@@ -1,42 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.HttpError = exports.getHealthAlive = exports.getHealthReady = exports.getUserByEmail = exports.regenerateApiKey = exports.updateUser = exports.getUserById = exports.createUser = exports.getUsers = exports.deleteProxyGraph = exports.postProxyGraph = exports.patchProxyGraph = exports.getProxyGraph = exports.updateWebhookSubscription = exports.getProxyMe = exports.updateProfile = exports.getProfile = exports.reencryptData = exports.decryptData = exports.encryptData = exports.postTrack = exports.deleteCredential = exports.updateCredential = exports.getCredentialById = exports.createCredential = exports.getCredentials = exports.getIntegrationLogo = exports.getIntegrationEvents = exports.deleteIntegration = exports.updateIntegration = exports.getIntegrationById = exports.inviteUser = exports.getIntegrationByName = exports.publishIntegration = exports.createIntegration = exports.getIntegrations = exports.servers = exports.defaults = void 0;
|
|
27
1
|
/**
|
|
28
2
|
* Integrations Platform API
|
|
29
3
|
* 0.1.0
|
|
30
4
|
* DO NOT MODIFY - This file has been generated using oazapfts.
|
|
31
5
|
* See https://www.npmjs.com/package/oazapfts
|
|
32
6
|
*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
7
|
+
import * as Oazapfts from 'oazapfts/lib/runtime';
|
|
8
|
+
import * as QS from 'oazapfts/lib/runtime/query';
|
|
9
|
+
export const defaults = {
|
|
10
|
+
headers: {},
|
|
36
11
|
baseUrl: 'http://localhost:9000',
|
|
37
12
|
};
|
|
38
|
-
const oazapfts = Oazapfts.runtime(
|
|
39
|
-
|
|
13
|
+
const oazapfts = Oazapfts.runtime(defaults);
|
|
14
|
+
export const servers = {
|
|
40
15
|
local: 'http://localhost:9000',
|
|
41
16
|
staging: 'https://staging-integrations-platform.unito.io',
|
|
42
17
|
production: 'https://integrations-platform.unito.io',
|
|
@@ -44,7 +19,7 @@ exports.servers = {
|
|
|
44
19
|
/**
|
|
45
20
|
* Get all the integrations
|
|
46
21
|
*/
|
|
47
|
-
function getIntegrations({ pagination, unitoOrganizationId, search, } = {}, opts) {
|
|
22
|
+
export function getIntegrations({ pagination, unitoOrganizationId, search, } = {}, opts) {
|
|
48
23
|
return oazapfts.ok(oazapfts.fetchJson(`/integrations${QS.query(QS.explode({
|
|
49
24
|
pagination,
|
|
50
25
|
unitoOrganizationId,
|
|
@@ -53,73 +28,76 @@ function getIntegrations({ pagination, unitoOrganizationId, search, } = {}, opts
|
|
|
53
28
|
...opts,
|
|
54
29
|
}));
|
|
55
30
|
}
|
|
56
|
-
exports.getIntegrations = getIntegrations;
|
|
57
31
|
/**
|
|
58
32
|
* Create an integration
|
|
59
33
|
*/
|
|
60
|
-
function createIntegration(body, opts) {
|
|
34
|
+
export function createIntegration(body, opts) {
|
|
61
35
|
return oazapfts.ok(oazapfts.fetchJson('/integrations', oazapfts.json({
|
|
62
36
|
...opts,
|
|
63
37
|
method: 'POST',
|
|
64
38
|
body,
|
|
65
39
|
})));
|
|
66
40
|
}
|
|
67
|
-
exports.createIntegration = createIntegration;
|
|
68
41
|
/**
|
|
69
42
|
* Publish an integration
|
|
70
43
|
*/
|
|
71
|
-
function publishIntegration(body, opts) {
|
|
44
|
+
export function publishIntegration(body, opts) {
|
|
72
45
|
return oazapfts.ok(oazapfts.fetchJson('/integrations/publish', oazapfts.multipart({
|
|
73
46
|
...opts,
|
|
74
47
|
method: 'POST',
|
|
75
48
|
body,
|
|
76
49
|
})));
|
|
77
50
|
}
|
|
78
|
-
exports.publishIntegration = publishIntegration;
|
|
79
51
|
/**
|
|
80
52
|
* Find an integration by exact name
|
|
81
53
|
*/
|
|
82
|
-
function getIntegrationByName(integrationName, opts) {
|
|
54
|
+
export function getIntegrationByName(integrationName, opts) {
|
|
83
55
|
return oazapfts.ok(oazapfts.fetchJson(`/integrations/find/${encodeURIComponent(integrationName)}`, {
|
|
84
56
|
...opts,
|
|
85
57
|
}));
|
|
86
58
|
}
|
|
87
|
-
exports.getIntegrationByName = getIntegrationByName;
|
|
88
59
|
/**
|
|
89
60
|
* Invite a user to an integration
|
|
90
61
|
*/
|
|
91
|
-
function inviteUser(integrationId, body, opts) {
|
|
62
|
+
export function inviteUser(integrationId, body, opts) {
|
|
92
63
|
return oazapfts.ok(oazapfts.fetchJson(`/integrations/${encodeURIComponent(integrationId)}/users/invite`, oazapfts.json({
|
|
93
64
|
...opts,
|
|
94
65
|
method: 'POST',
|
|
95
66
|
body,
|
|
96
67
|
})));
|
|
97
68
|
}
|
|
98
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Invite a unito organization to an integration
|
|
71
|
+
*/
|
|
72
|
+
export function inviteOrganization(integrationId, body, opts) {
|
|
73
|
+
return oazapfts.ok(oazapfts.fetchJson(`/integrations/${encodeURIComponent(integrationId)}/organizations/invite`, oazapfts.json({
|
|
74
|
+
...opts,
|
|
75
|
+
method: 'POST',
|
|
76
|
+
body,
|
|
77
|
+
})));
|
|
78
|
+
}
|
|
99
79
|
/**
|
|
100
80
|
* Get an integration
|
|
101
81
|
*/
|
|
102
|
-
function getIntegrationById(integrationId, opts) {
|
|
82
|
+
export function getIntegrationById(integrationId, opts) {
|
|
103
83
|
return oazapfts.ok(oazapfts.fetchJson(`/integrations/${encodeURIComponent(integrationId)}`, {
|
|
104
84
|
...opts,
|
|
105
85
|
}));
|
|
106
86
|
}
|
|
107
|
-
exports.getIntegrationById = getIntegrationById;
|
|
108
87
|
/**
|
|
109
88
|
* Update an integration
|
|
110
89
|
*/
|
|
111
|
-
function updateIntegration(integrationId, body, opts) {
|
|
90
|
+
export function updateIntegration(integrationId, body, opts) {
|
|
112
91
|
return oazapfts.ok(oazapfts.fetchJson(`/integrations/${encodeURIComponent(integrationId)}`, oazapfts.json({
|
|
113
92
|
...opts,
|
|
114
93
|
method: 'PATCH',
|
|
115
94
|
body,
|
|
116
95
|
})));
|
|
117
96
|
}
|
|
118
|
-
exports.updateIntegration = updateIntegration;
|
|
119
97
|
/**
|
|
120
98
|
* Delete an integration
|
|
121
99
|
*/
|
|
122
|
-
function deleteIntegration(integrationId, name, opts) {
|
|
100
|
+
export function deleteIntegration(integrationId, name, opts) {
|
|
123
101
|
return oazapfts.ok(oazapfts.fetchJson(`/integrations/${encodeURIComponent(integrationId)}${QS.query(QS.explode({
|
|
124
102
|
name,
|
|
125
103
|
}))}`, {
|
|
@@ -127,29 +105,30 @@ function deleteIntegration(integrationId, name, opts) {
|
|
|
127
105
|
method: 'DELETE',
|
|
128
106
|
}));
|
|
129
107
|
}
|
|
130
|
-
exports.deleteIntegration = deleteIntegration;
|
|
131
108
|
/**
|
|
132
109
|
* Get the events associated with this integration.
|
|
133
110
|
*/
|
|
134
|
-
function getIntegrationEvents(integrationId, opts) {
|
|
135
|
-
return oazapfts.ok(oazapfts.fetchJson(`/integrations/${encodeURIComponent(integrationId)}/events
|
|
111
|
+
export function getIntegrationEvents(integrationId, { search, $from, limit, } = {}, opts) {
|
|
112
|
+
return oazapfts.ok(oazapfts.fetchJson(`/integrations/${encodeURIComponent(integrationId)}/events${QS.query(QS.explode({
|
|
113
|
+
search,
|
|
114
|
+
from: $from,
|
|
115
|
+
limit,
|
|
116
|
+
}))}`, {
|
|
136
117
|
...opts,
|
|
137
118
|
}));
|
|
138
119
|
}
|
|
139
|
-
exports.getIntegrationEvents = getIntegrationEvents;
|
|
140
120
|
/**
|
|
141
121
|
* Get the logo of the integration, in SVG format.
|
|
142
122
|
*/
|
|
143
|
-
function getIntegrationLogo(integrationName, opts) {
|
|
123
|
+
export function getIntegrationLogo(integrationName, opts) {
|
|
144
124
|
return oazapfts.ok(oazapfts.fetchJson(`/public/${encodeURIComponent(integrationName)}/logo.svg`, {
|
|
145
125
|
...opts,
|
|
146
126
|
}));
|
|
147
127
|
}
|
|
148
|
-
exports.getIntegrationLogo = getIntegrationLogo;
|
|
149
128
|
/**
|
|
150
129
|
* Get all the credentials
|
|
151
130
|
*/
|
|
152
|
-
function getCredentials({ pagination, filters, } = {}, opts) {
|
|
131
|
+
export function getCredentials({ pagination, filters, } = {}, opts) {
|
|
153
132
|
return oazapfts.ok(oazapfts.fetchJson(`/credentials${QS.query(QS.explode({
|
|
154
133
|
pagination,
|
|
155
134
|
filters,
|
|
@@ -157,295 +136,264 @@ function getCredentials({ pagination, filters, } = {}, opts) {
|
|
|
157
136
|
...opts,
|
|
158
137
|
}));
|
|
159
138
|
}
|
|
160
|
-
exports.getCredentials = getCredentials;
|
|
161
139
|
/**
|
|
162
140
|
* Create a credential
|
|
163
141
|
*/
|
|
164
|
-
function createCredential(body, opts) {
|
|
142
|
+
export function createCredential(body, opts) {
|
|
165
143
|
return oazapfts.ok(oazapfts.fetchJson('/credentials', oazapfts.json({
|
|
166
144
|
...opts,
|
|
167
145
|
method: 'POST',
|
|
168
146
|
body,
|
|
169
147
|
})));
|
|
170
148
|
}
|
|
171
|
-
exports.createCredential = createCredential;
|
|
172
149
|
/**
|
|
173
150
|
* Get a credential
|
|
174
151
|
*/
|
|
175
|
-
function getCredentialById(credentialId, opts) {
|
|
152
|
+
export function getCredentialById(credentialId, opts) {
|
|
176
153
|
return oazapfts.ok(oazapfts.fetchJson(`/credentials/${encodeURIComponent(credentialId)}`, {
|
|
177
154
|
...opts,
|
|
178
155
|
}));
|
|
179
156
|
}
|
|
180
|
-
exports.getCredentialById = getCredentialById;
|
|
181
157
|
/**
|
|
182
158
|
* Update a credential
|
|
183
159
|
*/
|
|
184
|
-
function updateCredential(credentialId, body, opts) {
|
|
160
|
+
export function updateCredential(credentialId, body, opts) {
|
|
185
161
|
return oazapfts.ok(oazapfts.fetchJson(`/credentials/${encodeURIComponent(credentialId)}`, oazapfts.json({
|
|
186
162
|
...opts,
|
|
187
163
|
method: 'PATCH',
|
|
188
164
|
body,
|
|
189
165
|
})));
|
|
190
166
|
}
|
|
191
|
-
exports.updateCredential = updateCredential;
|
|
192
167
|
/**
|
|
193
168
|
* Delete a credential
|
|
194
169
|
*/
|
|
195
|
-
function deleteCredential(credentialId, opts) {
|
|
170
|
+
export function deleteCredential(credentialId, opts) {
|
|
196
171
|
return oazapfts.ok(oazapfts.fetchJson(`/credentials/${encodeURIComponent(credentialId)}`, {
|
|
197
172
|
...opts,
|
|
198
173
|
method: 'DELETE',
|
|
199
174
|
}));
|
|
200
175
|
}
|
|
201
|
-
exports.deleteCredential = deleteCredential;
|
|
202
176
|
/**
|
|
203
177
|
* Used by the frontend to send analytics data
|
|
204
178
|
*/
|
|
205
|
-
function postTrack(body, opts) {
|
|
179
|
+
export function postTrack(body, opts) {
|
|
206
180
|
return oazapfts.ok(oazapfts.fetchJson('/track', oazapfts.json({
|
|
207
181
|
...opts,
|
|
208
182
|
method: 'POST',
|
|
209
183
|
body,
|
|
210
184
|
})));
|
|
211
185
|
}
|
|
212
|
-
exports.postTrack = postTrack;
|
|
213
186
|
/**
|
|
214
187
|
* Encrypt data
|
|
215
188
|
*/
|
|
216
|
-
function encryptData(body, opts) {
|
|
189
|
+
export function encryptData(body, opts) {
|
|
217
190
|
return oazapfts.ok(oazapfts.fetchJson('/encryptions/encrypt', oazapfts.json({
|
|
218
191
|
...opts,
|
|
219
192
|
method: 'POST',
|
|
220
193
|
body,
|
|
221
194
|
})));
|
|
222
195
|
}
|
|
223
|
-
exports.encryptData = encryptData;
|
|
224
196
|
/**
|
|
225
197
|
* Decrypt data
|
|
226
198
|
*/
|
|
227
|
-
function decryptData(body, opts) {
|
|
199
|
+
export function decryptData(body, opts) {
|
|
228
200
|
return oazapfts.ok(oazapfts.fetchJson('/encryptions/decrypt', oazapfts.json({
|
|
229
201
|
...opts,
|
|
230
202
|
method: 'POST',
|
|
231
203
|
body,
|
|
232
204
|
})));
|
|
233
205
|
}
|
|
234
|
-
exports.decryptData = decryptData;
|
|
235
206
|
/**
|
|
236
207
|
* Decrypt and encrypt data
|
|
237
208
|
*/
|
|
238
|
-
function reencryptData(body, opts) {
|
|
209
|
+
export function reencryptData(body, opts) {
|
|
239
210
|
return oazapfts.ok(oazapfts.fetchJson('/encryptions/reencrypt', oazapfts.json({
|
|
240
211
|
...opts,
|
|
241
212
|
method: 'POST',
|
|
242
213
|
body,
|
|
243
214
|
})));
|
|
244
215
|
}
|
|
245
|
-
exports.reencryptData = reencryptData;
|
|
246
216
|
/**
|
|
247
217
|
* Get my profile
|
|
248
218
|
*/
|
|
249
|
-
function getProfile(opts) {
|
|
219
|
+
export function getProfile(opts) {
|
|
250
220
|
return oazapfts.ok(oazapfts.fetchJson('/profile', {
|
|
251
221
|
...opts,
|
|
252
222
|
}));
|
|
253
223
|
}
|
|
254
|
-
exports.getProfile = getProfile;
|
|
255
224
|
/**
|
|
256
225
|
* Update my profile
|
|
257
226
|
*/
|
|
258
|
-
function updateProfile(body, opts) {
|
|
227
|
+
export function updateProfile(body, opts) {
|
|
259
228
|
return oazapfts.ok(oazapfts.fetchJson('/profile', oazapfts.json({
|
|
260
229
|
...opts,
|
|
261
230
|
method: 'PATCH',
|
|
262
231
|
body,
|
|
263
232
|
})));
|
|
264
233
|
}
|
|
265
|
-
exports.updateProfile = updateProfile;
|
|
266
234
|
/**
|
|
267
235
|
* Call an integration's me
|
|
268
236
|
*/
|
|
269
|
-
function getProxyMe(xUnitoCredentialId, { xUnitoCorrelationId, xUnitoAdditionalLoggingContext, } = {}, opts) {
|
|
237
|
+
export function getProxyMe(xUnitoCredentialId, { xUnitoCorrelationId, xUnitoAdditionalLoggingContext, } = {}, opts) {
|
|
270
238
|
return oazapfts.ok(oazapfts.fetchJson('/proxy/me', {
|
|
271
239
|
...opts,
|
|
272
|
-
headers: {
|
|
273
|
-
...(opts && opts.headers),
|
|
240
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
274
241
|
'X-Unito-Credential-Id': xUnitoCredentialId,
|
|
275
242
|
'X-Unito-Correlation-Id': xUnitoCorrelationId,
|
|
276
243
|
'X-Unito-Additional-Logging-Context': xUnitoAdditionalLoggingContext,
|
|
277
|
-
},
|
|
244
|
+
}),
|
|
278
245
|
}));
|
|
279
246
|
}
|
|
280
|
-
exports.getProxyMe = getProxyMe;
|
|
281
247
|
/**
|
|
282
248
|
* Update a webhook subscription
|
|
283
249
|
*/
|
|
284
|
-
function updateWebhookSubscription(xUnitoCredentialId, body, { xUnitoCorrelationId, xUnitoAdditionalLoggingContext, } = {}, opts) {
|
|
250
|
+
export function updateWebhookSubscription(xUnitoCredentialId, body, { xUnitoCorrelationId, xUnitoAdditionalLoggingContext, } = {}, opts) {
|
|
285
251
|
return oazapfts.ok(oazapfts.fetchJson('/proxy/webhooks/subscriptions', oazapfts.json({
|
|
286
252
|
...opts,
|
|
287
253
|
method: 'PUT',
|
|
288
254
|
body,
|
|
289
|
-
headers: {
|
|
290
|
-
...(opts && opts.headers),
|
|
255
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
291
256
|
'X-Unito-Credential-Id': xUnitoCredentialId,
|
|
292
257
|
'X-Unito-Correlation-Id': xUnitoCorrelationId,
|
|
293
258
|
'X-Unito-Additional-Logging-Context': xUnitoAdditionalLoggingContext,
|
|
294
|
-
},
|
|
259
|
+
}),
|
|
295
260
|
})));
|
|
296
261
|
}
|
|
297
|
-
exports.updateWebhookSubscription = updateWebhookSubscription;
|
|
298
262
|
/**
|
|
299
263
|
* Call an integration's graph
|
|
300
264
|
*/
|
|
301
|
-
function getProxyGraph(xUnitoCredentialId, path, { xUnitoCorrelationId, xUnitoAdditionalLoggingContext, } = {}, opts) {
|
|
265
|
+
export function getProxyGraph(xUnitoCredentialId, path, { xUnitoCorrelationId, xUnitoAdditionalLoggingContext, } = {}, opts) {
|
|
302
266
|
return oazapfts.ok(oazapfts.fetchJson(`/proxy/graph${QS.query(QS.explode({
|
|
303
267
|
path,
|
|
304
268
|
}))}`, {
|
|
305
269
|
...opts,
|
|
306
|
-
headers: {
|
|
307
|
-
...(opts && opts.headers),
|
|
270
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
308
271
|
'X-Unito-Credential-Id': xUnitoCredentialId,
|
|
309
272
|
'X-Unito-Correlation-Id': xUnitoCorrelationId,
|
|
310
273
|
'X-Unito-Additional-Logging-Context': xUnitoAdditionalLoggingContext,
|
|
311
|
-
},
|
|
274
|
+
}),
|
|
312
275
|
}));
|
|
313
276
|
}
|
|
314
|
-
exports.getProxyGraph = getProxyGraph;
|
|
315
277
|
/**
|
|
316
278
|
* Call an integration's graph
|
|
317
279
|
*/
|
|
318
|
-
function patchProxyGraph(xUnitoCredentialId, path, body, { xUnitoCorrelationId, xUnitoAdditionalLoggingContext, } = {}, opts) {
|
|
280
|
+
export function patchProxyGraph(xUnitoCredentialId, path, body, { xUnitoCorrelationId, xUnitoAdditionalLoggingContext, } = {}, opts) {
|
|
319
281
|
return oazapfts.ok(oazapfts.fetchJson(`/proxy/graph${QS.query(QS.explode({
|
|
320
282
|
path,
|
|
321
283
|
}))}`, oazapfts.json({
|
|
322
284
|
...opts,
|
|
323
285
|
method: 'PATCH',
|
|
324
286
|
body,
|
|
325
|
-
headers: {
|
|
326
|
-
...(opts && opts.headers),
|
|
287
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
327
288
|
'X-Unito-Credential-Id': xUnitoCredentialId,
|
|
328
289
|
'X-Unito-Correlation-Id': xUnitoCorrelationId,
|
|
329
290
|
'X-Unito-Additional-Logging-Context': xUnitoAdditionalLoggingContext,
|
|
330
|
-
},
|
|
291
|
+
}),
|
|
331
292
|
})));
|
|
332
293
|
}
|
|
333
|
-
exports.patchProxyGraph = patchProxyGraph;
|
|
334
294
|
/**
|
|
335
295
|
* Call an integration's graph
|
|
336
296
|
*/
|
|
337
|
-
function postProxyGraph(xUnitoCredentialId, path, body, { xUnitoCorrelationId, xUnitoAdditionalLoggingContext, } = {}, opts) {
|
|
297
|
+
export function postProxyGraph(xUnitoCredentialId, path, body, { xUnitoCorrelationId, xUnitoAdditionalLoggingContext, } = {}, opts) {
|
|
338
298
|
return oazapfts.ok(oazapfts.fetchJson(`/proxy/graph${QS.query(QS.explode({
|
|
339
299
|
path,
|
|
340
300
|
}))}`, oazapfts.json({
|
|
341
301
|
...opts,
|
|
342
302
|
method: 'POST',
|
|
343
303
|
body,
|
|
344
|
-
headers: {
|
|
345
|
-
...(opts && opts.headers),
|
|
304
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
346
305
|
'X-Unito-Credential-Id': xUnitoCredentialId,
|
|
347
306
|
'X-Unito-Correlation-Id': xUnitoCorrelationId,
|
|
348
307
|
'X-Unito-Additional-Logging-Context': xUnitoAdditionalLoggingContext,
|
|
349
|
-
},
|
|
308
|
+
}),
|
|
350
309
|
})));
|
|
351
310
|
}
|
|
352
|
-
exports.postProxyGraph = postProxyGraph;
|
|
353
311
|
/**
|
|
354
312
|
* Call an integration's graph
|
|
355
313
|
*/
|
|
356
|
-
function deleteProxyGraph(xUnitoCredentialId, path, { xUnitoCorrelationId, xUnitoAdditionalLoggingContext, } = {}, opts) {
|
|
314
|
+
export function deleteProxyGraph(xUnitoCredentialId, path, { xUnitoCorrelationId, xUnitoAdditionalLoggingContext, } = {}, opts) {
|
|
357
315
|
return oazapfts.ok(oazapfts.fetchJson(`/proxy/graph${QS.query(QS.explode({
|
|
358
316
|
path,
|
|
359
317
|
}))}`, {
|
|
360
318
|
...opts,
|
|
361
319
|
method: 'DELETE',
|
|
362
|
-
headers: {
|
|
363
|
-
...(opts && opts.headers),
|
|
320
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
364
321
|
'X-Unito-Credential-Id': xUnitoCredentialId,
|
|
365
322
|
'X-Unito-Correlation-Id': xUnitoCorrelationId,
|
|
366
323
|
'X-Unito-Additional-Logging-Context': xUnitoAdditionalLoggingContext,
|
|
367
|
-
},
|
|
324
|
+
}),
|
|
368
325
|
}));
|
|
369
326
|
}
|
|
370
|
-
exports.deleteProxyGraph = deleteProxyGraph;
|
|
371
327
|
/**
|
|
372
328
|
* Get all the users
|
|
373
329
|
*/
|
|
374
|
-
function getUsers({ pagination, } = {}, opts) {
|
|
330
|
+
export function getUsers({ pagination, } = {}, opts) {
|
|
375
331
|
return oazapfts.ok(oazapfts.fetchJson(`/users${QS.query(QS.explode({
|
|
376
332
|
pagination,
|
|
377
333
|
}))}`, {
|
|
378
334
|
...opts,
|
|
379
335
|
}));
|
|
380
336
|
}
|
|
381
|
-
exports.getUsers = getUsers;
|
|
382
337
|
/**
|
|
383
338
|
* Create a user
|
|
384
339
|
*/
|
|
385
|
-
function createUser(body, opts) {
|
|
340
|
+
export function createUser(body, opts) {
|
|
386
341
|
return oazapfts.ok(oazapfts.fetchJson('/users', oazapfts.json({
|
|
387
342
|
...opts,
|
|
388
343
|
method: 'POST',
|
|
389
344
|
body,
|
|
390
345
|
})));
|
|
391
346
|
}
|
|
392
|
-
exports.createUser = createUser;
|
|
393
347
|
/**
|
|
394
348
|
* Get a user
|
|
395
349
|
*/
|
|
396
|
-
function getUserById(userId, opts) {
|
|
350
|
+
export function getUserById(userId, opts) {
|
|
397
351
|
return oazapfts.ok(oazapfts.fetchJson(`/users/${encodeURIComponent(userId)}`, {
|
|
398
352
|
...opts,
|
|
399
353
|
}));
|
|
400
354
|
}
|
|
401
|
-
exports.getUserById = getUserById;
|
|
402
355
|
/**
|
|
403
356
|
* Update a user
|
|
404
357
|
*/
|
|
405
|
-
function updateUser(userId, body, opts) {
|
|
358
|
+
export function updateUser(userId, body, opts) {
|
|
406
359
|
return oazapfts.ok(oazapfts.fetchJson(`/users/${encodeURIComponent(userId)}`, oazapfts.json({
|
|
407
360
|
...opts,
|
|
408
361
|
method: 'PATCH',
|
|
409
362
|
body,
|
|
410
363
|
})));
|
|
411
364
|
}
|
|
412
|
-
exports.updateUser = updateUser;
|
|
413
365
|
/**
|
|
414
366
|
* Regenerate the api key of a user
|
|
415
367
|
*/
|
|
416
|
-
function regenerateApiKey(userId, opts) {
|
|
368
|
+
export function regenerateApiKey(userId, opts) {
|
|
417
369
|
return oazapfts.ok(oazapfts.fetchJson(`/users/${encodeURIComponent(userId)}/apiKey`, {
|
|
418
370
|
...opts,
|
|
419
371
|
method: 'POST',
|
|
420
372
|
}));
|
|
421
373
|
}
|
|
422
|
-
exports.regenerateApiKey = regenerateApiKey;
|
|
423
374
|
/**
|
|
424
375
|
* Get a user by its email address
|
|
425
376
|
*/
|
|
426
|
-
function getUserByEmail(email, opts) {
|
|
377
|
+
export function getUserByEmail(email, opts) {
|
|
427
378
|
return oazapfts.ok(oazapfts.fetchJson(`/users/find/${encodeURIComponent(email)}`, {
|
|
428
379
|
...opts,
|
|
429
380
|
}));
|
|
430
381
|
}
|
|
431
|
-
exports.getUserByEmail = getUserByEmail;
|
|
432
382
|
/**
|
|
433
383
|
* Whether the service is ready to serve requests
|
|
434
384
|
*/
|
|
435
|
-
function getHealthReady(opts) {
|
|
385
|
+
export function getHealthReady(opts) {
|
|
436
386
|
return oazapfts.ok(oazapfts.fetchText('/health/ready', {
|
|
437
387
|
...opts,
|
|
438
388
|
}));
|
|
439
389
|
}
|
|
440
|
-
exports.getHealthReady = getHealthReady;
|
|
441
390
|
/**
|
|
442
391
|
* Whether the service is responsive
|
|
443
392
|
*/
|
|
444
|
-
function getHealthAlive(opts) {
|
|
393
|
+
export function getHealthAlive(opts) {
|
|
445
394
|
return oazapfts.ok(oazapfts.fetchText('/health/alive', {
|
|
446
395
|
...opts,
|
|
447
396
|
}));
|
|
448
397
|
}
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
Object.defineProperty(exports, "HttpError", { enumerable: true, get: function () { return oazapfts_1.HttpError; } });
|
|
398
|
+
import { HttpError } from './httpError.js';
|
|
399
|
+
export { HttpError };
|