@unito/integration-cli 0.60.0 → 0.60.2

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.
@@ -0,0 +1,435 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HttpError = 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.getCredentialAccount = exports.deleteCredential = exports.updateCredential = exports.getCredentialById = exports.createCredential = exports.getCredentials = exports.getIntegrationLogo = exports.getIntegrationEvents = exports.deleteIntegration = exports.updateIntegration = exports.getIntegrationById = exports.inviteOrganization = exports.inviteUser = exports.getIntegrationByName = exports.publishIntegration = exports.createIntegration = exports.getIntegrations = exports.servers = exports.defaults = void 0;
4
+ const tslib_1 = require("tslib");
5
+ /**
6
+ * Integrations Platform API
7
+ * 0.1.0
8
+ * DO NOT MODIFY - This file has been generated using oazapfts.
9
+ * See https://www.npmjs.com/package/oazapfts
10
+ */
11
+ const Oazapfts = tslib_1.__importStar(require("@oazapfts/runtime"));
12
+ const QS = tslib_1.__importStar(require("@oazapfts/runtime/query"));
13
+ exports.defaults = {
14
+ headers: {},
15
+ baseUrl: 'http://localhost:9000',
16
+ };
17
+ const oazapfts = Oazapfts.runtime(exports.defaults);
18
+ exports.servers = {
19
+ local: 'http://localhost:9000',
20
+ staging: 'https://staging-integrations-platform.unito.io',
21
+ production: 'https://integrations-platform.unito.io',
22
+ };
23
+ /**
24
+ * Get all the integrations
25
+ */
26
+ function getIntegrations({ pagination, unitoOrganizationId, search, } = {}, opts) {
27
+ return oazapfts.ok(oazapfts.fetchJson(`/integrations${QS.query(QS.explode({
28
+ pagination,
29
+ unitoOrganizationId,
30
+ search,
31
+ }))}`, {
32
+ ...opts,
33
+ }));
34
+ }
35
+ exports.getIntegrations = getIntegrations;
36
+ /**
37
+ * Create an integration
38
+ */
39
+ function createIntegration(body, opts) {
40
+ return oazapfts.ok(oazapfts.fetchJson('/integrations', oazapfts.json({
41
+ ...opts,
42
+ method: 'POST',
43
+ body,
44
+ })));
45
+ }
46
+ exports.createIntegration = createIntegration;
47
+ /**
48
+ * Publish an integration
49
+ */
50
+ function publishIntegration(body, opts) {
51
+ return oazapfts.ok(oazapfts.fetchJson('/integrations/publish', oazapfts.multipart({
52
+ ...opts,
53
+ method: 'POST',
54
+ body,
55
+ })));
56
+ }
57
+ exports.publishIntegration = publishIntegration;
58
+ /**
59
+ * Find an integration by exact name
60
+ */
61
+ function getIntegrationByName(integrationName, opts) {
62
+ return oazapfts.ok(oazapfts.fetchJson(`/integrations/find/${encodeURIComponent(integrationName)}`, {
63
+ ...opts,
64
+ }));
65
+ }
66
+ exports.getIntegrationByName = getIntegrationByName;
67
+ /**
68
+ * Invite a user to an integration
69
+ */
70
+ function inviteUser(integrationId, body, opts) {
71
+ return oazapfts.ok(oazapfts.fetchJson(`/integrations/${encodeURIComponent(integrationId)}/users/invite`, oazapfts.json({
72
+ ...opts,
73
+ method: 'POST',
74
+ body,
75
+ })));
76
+ }
77
+ exports.inviteUser = inviteUser;
78
+ /**
79
+ * Invite a unito organization to an integration
80
+ */
81
+ function inviteOrganization(integrationId, body, opts) {
82
+ return oazapfts.ok(oazapfts.fetchJson(`/integrations/${encodeURIComponent(integrationId)}/organizations/invite`, oazapfts.json({
83
+ ...opts,
84
+ method: 'POST',
85
+ body,
86
+ })));
87
+ }
88
+ exports.inviteOrganization = inviteOrganization;
89
+ /**
90
+ * Get an integration
91
+ */
92
+ function getIntegrationById(integrationId, opts) {
93
+ return oazapfts.ok(oazapfts.fetchJson(`/integrations/${encodeURIComponent(integrationId)}`, {
94
+ ...opts,
95
+ }));
96
+ }
97
+ exports.getIntegrationById = getIntegrationById;
98
+ /**
99
+ * Update an integration
100
+ */
101
+ function updateIntegration(integrationId, body, opts) {
102
+ return oazapfts.ok(oazapfts.fetchJson(`/integrations/${encodeURIComponent(integrationId)}`, oazapfts.json({
103
+ ...opts,
104
+ method: 'PATCH',
105
+ body,
106
+ })));
107
+ }
108
+ exports.updateIntegration = updateIntegration;
109
+ /**
110
+ * Delete an integration
111
+ */
112
+ function deleteIntegration(integrationId, name, opts) {
113
+ return oazapfts.ok(oazapfts.fetchJson(`/integrations/${encodeURIComponent(integrationId)}${QS.query(QS.explode({
114
+ name,
115
+ }))}`, {
116
+ ...opts,
117
+ method: 'DELETE',
118
+ }));
119
+ }
120
+ exports.deleteIntegration = deleteIntegration;
121
+ /**
122
+ * Get the events associated with this integration.
123
+ */
124
+ function getIntegrationEvents(integrationId, { search, $from, limit, } = {}, opts) {
125
+ return oazapfts.ok(oazapfts.fetchJson(`/integrations/${encodeURIComponent(integrationId)}/events${QS.query(QS.explode({
126
+ search,
127
+ from: $from,
128
+ limit,
129
+ }))}`, {
130
+ ...opts,
131
+ }));
132
+ }
133
+ exports.getIntegrationEvents = getIntegrationEvents;
134
+ /**
135
+ * Get the logo of the integration, in SVG format.
136
+ */
137
+ function getIntegrationLogo(integrationName, opts) {
138
+ return oazapfts.ok(oazapfts.fetchJson(`/public/${encodeURIComponent(integrationName)}/logo.svg`, {
139
+ ...opts,
140
+ }));
141
+ }
142
+ exports.getIntegrationLogo = getIntegrationLogo;
143
+ /**
144
+ * Get all the credentials
145
+ */
146
+ function getCredentials({ pagination, filters, } = {}, opts) {
147
+ return oazapfts.ok(oazapfts.fetchJson(`/credentials${QS.query(QS.explode({
148
+ pagination,
149
+ filters,
150
+ }))}`, {
151
+ ...opts,
152
+ }));
153
+ }
154
+ exports.getCredentials = getCredentials;
155
+ /**
156
+ * Create a credential
157
+ */
158
+ function createCredential(body, opts) {
159
+ return oazapfts.ok(oazapfts.fetchJson('/credentials', oazapfts.json({
160
+ ...opts,
161
+ method: 'POST',
162
+ body,
163
+ })));
164
+ }
165
+ exports.createCredential = createCredential;
166
+ /**
167
+ * Get a credential
168
+ */
169
+ function getCredentialById(credentialId, opts) {
170
+ return oazapfts.ok(oazapfts.fetchJson(`/credentials/${encodeURIComponent(credentialId)}`, {
171
+ ...opts,
172
+ }));
173
+ }
174
+ exports.getCredentialById = getCredentialById;
175
+ /**
176
+ * Update a credential
177
+ */
178
+ function updateCredential(credentialId, body, opts) {
179
+ return oazapfts.ok(oazapfts.fetchJson(`/credentials/${encodeURIComponent(credentialId)}`, oazapfts.json({
180
+ ...opts,
181
+ method: 'PATCH',
182
+ body,
183
+ })));
184
+ }
185
+ exports.updateCredential = updateCredential;
186
+ /**
187
+ * Delete a credential
188
+ */
189
+ function deleteCredential(credentialId, opts) {
190
+ return oazapfts.ok(oazapfts.fetchJson(`/credentials/${encodeURIComponent(credentialId)}`, {
191
+ ...opts,
192
+ method: 'DELETE',
193
+ }));
194
+ }
195
+ exports.deleteCredential = deleteCredential;
196
+ /**
197
+ * Returns the credentialAccount either from the integration's /me endpoint, if available, or the credential's latestCredentialAccount
198
+ */
199
+ function getCredentialAccount(xUnitoCredentialId, { xUnitoCorrelationId, xUnitoAdditionalLoggingContext, } = {}, opts) {
200
+ return oazapfts.ok(oazapfts.fetchJson('/credentialAccount', {
201
+ ...opts,
202
+ headers: oazapfts.mergeHeaders(opts?.headers, {
203
+ 'X-Unito-Credential-Id': xUnitoCredentialId,
204
+ 'X-Unito-Correlation-Id': xUnitoCorrelationId,
205
+ 'X-Unito-Additional-Logging-Context': xUnitoAdditionalLoggingContext,
206
+ }),
207
+ }));
208
+ }
209
+ exports.getCredentialAccount = getCredentialAccount;
210
+ /**
211
+ * Used by the frontend to send analytics data
212
+ */
213
+ function postTrack(body, opts) {
214
+ return oazapfts.ok(oazapfts.fetchJson('/track', oazapfts.json({
215
+ ...opts,
216
+ method: 'POST',
217
+ body,
218
+ })));
219
+ }
220
+ exports.postTrack = postTrack;
221
+ /**
222
+ * Encrypt data
223
+ */
224
+ function encryptData(body, opts) {
225
+ return oazapfts.ok(oazapfts.fetchJson('/encryptions/encrypt', oazapfts.json({
226
+ ...opts,
227
+ method: 'POST',
228
+ body,
229
+ })));
230
+ }
231
+ exports.encryptData = encryptData;
232
+ /**
233
+ * Decrypt data
234
+ */
235
+ function decryptData(body, opts) {
236
+ return oazapfts.ok(oazapfts.fetchJson('/encryptions/decrypt', oazapfts.json({
237
+ ...opts,
238
+ method: 'POST',
239
+ body,
240
+ })));
241
+ }
242
+ exports.decryptData = decryptData;
243
+ /**
244
+ * Decrypt and encrypt data
245
+ */
246
+ function reencryptData(body, opts) {
247
+ return oazapfts.ok(oazapfts.fetchJson('/encryptions/reencrypt', oazapfts.json({
248
+ ...opts,
249
+ method: 'POST',
250
+ body,
251
+ })));
252
+ }
253
+ exports.reencryptData = reencryptData;
254
+ /**
255
+ * Get my profile
256
+ */
257
+ function getProfile(opts) {
258
+ return oazapfts.ok(oazapfts.fetchJson('/profile', {
259
+ ...opts,
260
+ }));
261
+ }
262
+ exports.getProfile = getProfile;
263
+ /**
264
+ * Update my profile
265
+ */
266
+ function updateProfile(body, opts) {
267
+ return oazapfts.ok(oazapfts.fetchJson('/profile', oazapfts.json({
268
+ ...opts,
269
+ method: 'PATCH',
270
+ body,
271
+ })));
272
+ }
273
+ exports.updateProfile = updateProfile;
274
+ /**
275
+ * Call an integration's me
276
+ */
277
+ function getProxyMe(xUnitoCredentialId, { xUnitoCorrelationId, xUnitoAdditionalLoggingContext, } = {}, opts) {
278
+ return oazapfts.ok(oazapfts.fetchJson('/proxy/me', {
279
+ ...opts,
280
+ headers: oazapfts.mergeHeaders(opts?.headers, {
281
+ 'X-Unito-Credential-Id': xUnitoCredentialId,
282
+ 'X-Unito-Correlation-Id': xUnitoCorrelationId,
283
+ 'X-Unito-Additional-Logging-Context': xUnitoAdditionalLoggingContext,
284
+ }),
285
+ }));
286
+ }
287
+ exports.getProxyMe = getProxyMe;
288
+ /**
289
+ * Update a webhook subscription
290
+ */
291
+ function updateWebhookSubscription(xUnitoCredentialId, body, { xUnitoCorrelationId, xUnitoAdditionalLoggingContext, } = {}, opts) {
292
+ return oazapfts.ok(oazapfts.fetchJson('/proxy/webhooks/subscriptions', oazapfts.json({
293
+ ...opts,
294
+ method: 'PUT',
295
+ body,
296
+ headers: oazapfts.mergeHeaders(opts?.headers, {
297
+ 'X-Unito-Credential-Id': xUnitoCredentialId,
298
+ 'X-Unito-Correlation-Id': xUnitoCorrelationId,
299
+ 'X-Unito-Additional-Logging-Context': xUnitoAdditionalLoggingContext,
300
+ }),
301
+ })));
302
+ }
303
+ exports.updateWebhookSubscription = updateWebhookSubscription;
304
+ /**
305
+ * Call an integration's graph
306
+ */
307
+ function getProxyGraph(xUnitoCredentialId, path, { xUnitoCorrelationId, xUnitoAdditionalLoggingContext, } = {}, opts) {
308
+ return oazapfts.ok(oazapfts.fetchJson(`/proxy/graph${QS.query(QS.explode({
309
+ path,
310
+ }))}`, {
311
+ ...opts,
312
+ headers: oazapfts.mergeHeaders(opts?.headers, {
313
+ 'X-Unito-Credential-Id': xUnitoCredentialId,
314
+ 'X-Unito-Correlation-Id': xUnitoCorrelationId,
315
+ 'X-Unito-Additional-Logging-Context': xUnitoAdditionalLoggingContext,
316
+ }),
317
+ }));
318
+ }
319
+ exports.getProxyGraph = getProxyGraph;
320
+ /**
321
+ * Call an integration's graph
322
+ */
323
+ function patchProxyGraph(xUnitoCredentialId, path, body, { xUnitoCorrelationId, xUnitoAdditionalLoggingContext, } = {}, opts) {
324
+ return oazapfts.ok(oazapfts.fetchJson(`/proxy/graph${QS.query(QS.explode({
325
+ path,
326
+ }))}`, oazapfts.json({
327
+ ...opts,
328
+ method: 'PATCH',
329
+ body,
330
+ headers: oazapfts.mergeHeaders(opts?.headers, {
331
+ 'X-Unito-Credential-Id': xUnitoCredentialId,
332
+ 'X-Unito-Correlation-Id': xUnitoCorrelationId,
333
+ 'X-Unito-Additional-Logging-Context': xUnitoAdditionalLoggingContext,
334
+ }),
335
+ })));
336
+ }
337
+ exports.patchProxyGraph = patchProxyGraph;
338
+ /**
339
+ * Call an integration's graph
340
+ */
341
+ function postProxyGraph(xUnitoCredentialId, path, body, { xUnitoCorrelationId, xUnitoAdditionalLoggingContext, } = {}, opts) {
342
+ return oazapfts.ok(oazapfts.fetchJson(`/proxy/graph${QS.query(QS.explode({
343
+ path,
344
+ }))}`, oazapfts.json({
345
+ ...opts,
346
+ method: 'POST',
347
+ body,
348
+ headers: oazapfts.mergeHeaders(opts?.headers, {
349
+ 'X-Unito-Credential-Id': xUnitoCredentialId,
350
+ 'X-Unito-Correlation-Id': xUnitoCorrelationId,
351
+ 'X-Unito-Additional-Logging-Context': xUnitoAdditionalLoggingContext,
352
+ }),
353
+ })));
354
+ }
355
+ exports.postProxyGraph = postProxyGraph;
356
+ /**
357
+ * Call an integration's graph
358
+ */
359
+ function deleteProxyGraph(xUnitoCredentialId, path, { xUnitoCorrelationId, xUnitoAdditionalLoggingContext, } = {}, opts) {
360
+ return oazapfts.ok(oazapfts.fetchJson(`/proxy/graph${QS.query(QS.explode({
361
+ path,
362
+ }))}`, {
363
+ ...opts,
364
+ method: 'DELETE',
365
+ headers: oazapfts.mergeHeaders(opts?.headers, {
366
+ 'X-Unito-Credential-Id': xUnitoCredentialId,
367
+ 'X-Unito-Correlation-Id': xUnitoCorrelationId,
368
+ 'X-Unito-Additional-Logging-Context': xUnitoAdditionalLoggingContext,
369
+ }),
370
+ }));
371
+ }
372
+ exports.deleteProxyGraph = deleteProxyGraph;
373
+ /**
374
+ * Get all the users
375
+ */
376
+ function getUsers({ pagination, } = {}, opts) {
377
+ return oazapfts.ok(oazapfts.fetchJson(`/users${QS.query(QS.explode({
378
+ pagination,
379
+ }))}`, {
380
+ ...opts,
381
+ }));
382
+ }
383
+ exports.getUsers = getUsers;
384
+ /**
385
+ * Create a user
386
+ */
387
+ function createUser(body, opts) {
388
+ return oazapfts.ok(oazapfts.fetchJson('/users', oazapfts.json({
389
+ ...opts,
390
+ method: 'POST',
391
+ body,
392
+ })));
393
+ }
394
+ exports.createUser = createUser;
395
+ /**
396
+ * Get a user
397
+ */
398
+ function getUserById(userId, opts) {
399
+ return oazapfts.ok(oazapfts.fetchJson(`/users/${encodeURIComponent(userId)}`, {
400
+ ...opts,
401
+ }));
402
+ }
403
+ exports.getUserById = getUserById;
404
+ /**
405
+ * Update a user
406
+ */
407
+ function updateUser(userId, body, opts) {
408
+ return oazapfts.ok(oazapfts.fetchJson(`/users/${encodeURIComponent(userId)}`, oazapfts.json({
409
+ ...opts,
410
+ method: 'PATCH',
411
+ body,
412
+ })));
413
+ }
414
+ exports.updateUser = updateUser;
415
+ /**
416
+ * Regenerate the api key of a user
417
+ */
418
+ function regenerateApiKey(userId, opts) {
419
+ return oazapfts.ok(oazapfts.fetchJson(`/users/${encodeURIComponent(userId)}/apiKey`, {
420
+ ...opts,
421
+ method: 'POST',
422
+ }));
423
+ }
424
+ exports.regenerateApiKey = regenerateApiKey;
425
+ /**
426
+ * Get a user by its email address
427
+ */
428
+ function getUserByEmail(email, opts) {
429
+ return oazapfts.ok(oazapfts.fetchJson(`/users/find/${encodeURIComponent(email)}`, {
430
+ ...opts,
431
+ }));
432
+ }
433
+ exports.getUserByEmail = getUserByEmail;
434
+ const runtime_1 = require("@oazapfts/runtime");
435
+ Object.defineProperty(exports, "HttpError", { enumerable: true, get: function () { return runtime_1.HttpError; } });
@@ -205,4 +205,23 @@ describe('Dev', () => {
205
205
  (0, test_1.expect)(spawnStub.getCall(0).args.at(2).env.success).to.equal('a');
206
206
  (0, test_1.expect)(spawnStub.getCall(0).args.at(2).env.failure).to.be.undefined;
207
207
  });
208
+ test_1.test
209
+ .stdout()
210
+ .stub(ConfigurationResource, 'getConfiguration', stub => stub.resolves(cliConfiguration))
211
+ .stub(IntegrationResource, 'validateIsIntegrationDirectory', stub => stub.returns(true))
212
+ .stub(CredentialResource, 'fetchCredential', stub => stub.resolves({ payload: { from: 'credential' } }))
213
+ .stub(DecryptionResource, 'decryptEntries', stub => stub
214
+ .onFirstCall()
215
+ .resolves({ successful: {}, failed: [] })
216
+ .onSecondCall()
217
+ .resolves({ successful: {}, failed: [] })
218
+ .onThirdCall()
219
+ .resolves({ successful: { success: 'a' }, failed: ['failure'] }))
220
+ .env({ failure: 'b' })
221
+ .command(['dev'])
222
+ .it('override environment variables', ctx => {
223
+ (0, test_1.expect)(ctx.stdout).to.not.contain((0, styles_1.uncolorize)('Could not decrypt the environment variable failure.'));
224
+ (0, test_1.expect)(spawnStub.getCall(0).args.at(2).env.success).to.equal('a');
225
+ (0, test_1.expect)(spawnStub.getCall(0).args.at(2).env.failure).to.equal('b');
226
+ });
208
227
  });
@@ -233,4 +233,23 @@ describe('Test', () => {
233
233
  (0, test_1.expect)(spawnStub.getCall(0).args.at(2).env.success).to.equal('a');
234
234
  (0, test_1.expect)(spawnStub.getCall(0).args.at(2).env.failure).to.be.undefined;
235
235
  });
236
+ test_1.test
237
+ .stdout()
238
+ .stub(ConfigurationResource, 'getConfiguration', stub => stub.resolves(cliConfiguration))
239
+ .stub(IntegrationResource, 'validateIsIntegrationDirectory', stub => stub.returns(true))
240
+ .stub(CredentialResource, 'fetchCredential', stub => stub.resolves({ payload: { from: 'credential' } }))
241
+ .stub(DecryptionResource, 'decryptEntries', stub => stub
242
+ .onFirstCall()
243
+ .resolves({ successful: {}, failed: [] })
244
+ .onSecondCall()
245
+ .resolves({ successful: {}, failed: [] })
246
+ .onThirdCall()
247
+ .resolves({ successful: { success: 'a' }, failed: ['failure'] }))
248
+ .env({ failure: 'b' })
249
+ .command(['test'])
250
+ .it('override environment variables', ctx => {
251
+ (0, test_1.expect)(ctx.stdout).to.not.contain((0, styles_1.uncolorize)('Could not decrypt the environment variable failure.'));
252
+ (0, test_1.expect)(spawnStub.getCall(0).args.at(2).env.success).to.equal('a');
253
+ (0, test_1.expect)(spawnStub.getCall(0).args.at(2).env.failure).to.equal('b');
254
+ });
236
255
  });
@@ -21,6 +21,6 @@ export declare function generateIntegration(overrides?: Partial<IntegrationsPlat
21
21
  [key: string]: string;
22
22
  } | undefined;
23
23
  disabledAt?: string | null | undefined;
24
- authorizations: import("@unito/integrations-platform-client/dist/src/api").Authorization[];
24
+ authorizations: import("../../src/services/integrationsPlatformClient").Authorization[];
25
25
  userIds: number[];
26
26
  };
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const strict_1 = tslib_1.__importDefault(require("node:assert/strict"));
5
5
  const sinon = tslib_1.__importStar(require("sinon"));
6
- const integrations_platform_client_1 = tslib_1.__importDefault(require("@unito/integrations-platform-client"));
6
+ const IntegrationsPlatformClient = tslib_1.__importStar(require("../../src/services/integrationsPlatformClient"));
7
7
  const IntegrationsPlatform = tslib_1.__importStar(require("../../src/services/integrationsPlatform"));
8
8
  const globalConfiguration_1 = require("../../src/resources/globalConfiguration");
9
9
  const configurationTypes_1 = require("../../src/configurationTypes");
@@ -45,49 +45,49 @@ describe('integrations platform', function () {
45
45
  });
46
46
  it('environment', function () {
47
47
  IntegrationsPlatform.setEnvironment(globalConfiguration_1.Environment.Local);
48
- strict_1.default.equal(integrations_platform_client_1.default.defaults.baseUrl, integrations_platform_client_1.default.servers.local);
48
+ strict_1.default.equal(IntegrationsPlatformClient.defaults.baseUrl, IntegrationsPlatformClient.servers.local);
49
49
  IntegrationsPlatform.setEnvironment(globalConfiguration_1.Environment.Production);
50
- strict_1.default.equal(integrations_platform_client_1.default.defaults.baseUrl, integrations_platform_client_1.default.servers.production);
50
+ strict_1.default.equal(IntegrationsPlatformClient.defaults.baseUrl, IntegrationsPlatformClient.servers.production);
51
51
  });
52
52
  it('apiKey', function () {
53
53
  IntegrationsPlatform.setApiKey('foo');
54
54
  strict_1.default.equal(IntegrationsPlatform.getApiKey(), 'foo');
55
- strict_1.default.deepEqual(integrations_platform_client_1.default.defaults.headers, {
55
+ strict_1.default.deepEqual(IntegrationsPlatformClient.defaults.headers, {
56
56
  Authorization: 'Bearer foo',
57
57
  });
58
58
  IntegrationsPlatform.setApiKey(undefined);
59
59
  strict_1.default.equal(IntegrationsPlatform.getApiKey(), undefined);
60
- strict_1.default.deepEqual(integrations_platform_client_1.default.defaults.headers, {});
60
+ strict_1.default.deepEqual(IntegrationsPlatformClient.defaults.headers, {});
61
61
  });
62
62
  it('getProfile', async function () {
63
- sinon.stub(integrations_platform_client_1.default, 'getProfile').resolves(user);
63
+ sinon.stub(IntegrationsPlatformClient, 'getProfile').resolves(user);
64
64
  strict_1.default.deepEqual(await IntegrationsPlatform.getProfile(), user);
65
65
  });
66
66
  it('getIntegration', async function () {
67
- sinon.stub(integrations_platform_client_1.default, 'getIntegrationById').resolves(integration);
67
+ sinon.stub(IntegrationsPlatformClient, 'getIntegrationById').resolves(integration);
68
68
  strict_1.default.deepEqual(await IntegrationsPlatform.getIntegration(1), integration);
69
69
  });
70
70
  it('getIntegrationByName', async function () {
71
- sinon.stub(integrations_platform_client_1.default, 'getIntegrationByName').resolves(integration);
71
+ sinon.stub(IntegrationsPlatformClient, 'getIntegrationByName').resolves(integration);
72
72
  strict_1.default.deepEqual(await IntegrationsPlatform.getIntegrationByName('foo'), integration);
73
73
  });
74
74
  it('getIntegrations', async function () {
75
- sinon.stub(integrations_platform_client_1.default, 'getIntegrations').resolves({ total: 1, data: [integrationSummary] });
75
+ sinon.stub(IntegrationsPlatformClient, 'getIntegrations').resolves({ total: 1, data: [integrationSummary] });
76
76
  strict_1.default.deepEqual(await IntegrationsPlatform.getIntegrations(), [integrationSummary]);
77
77
  });
78
78
  it('createIntegration', async function () {
79
- sinon.stub(integrations_platform_client_1.default, 'createIntegration').resolves(integration);
80
- sinon.stub(integrations_platform_client_1.default, 'getIntegrationById').resolves(integration);
81
- sinon.stub(integrations_platform_client_1.default, 'updateIntegration').resolves(integration);
79
+ sinon.stub(IntegrationsPlatformClient, 'createIntegration').resolves(integration);
80
+ sinon.stub(IntegrationsPlatformClient, 'getIntegrationById').resolves(integration);
81
+ sinon.stub(IntegrationsPlatformClient, 'updateIntegration').resolves(integration);
82
82
  strict_1.default.deepEqual(await IntegrationsPlatform.createIntegration({ name: 'foo' }), integration);
83
83
  });
84
84
  it('updateIntegration', async function () {
85
- sinon.stub(integrations_platform_client_1.default, 'getIntegrationById').resolves(integration);
86
- sinon.stub(integrations_platform_client_1.default, 'updateIntegration').resolves(integration);
85
+ sinon.stub(IntegrationsPlatformClient, 'getIntegrationById').resolves(integration);
86
+ sinon.stub(IntegrationsPlatformClient, 'updateIntegration').resolves(integration);
87
87
  strict_1.default.deepEqual(await IntegrationsPlatform.updateIntegration(1, { name: 'foo' }), integration);
88
88
  });
89
89
  it('updateIntegration - create / archive authorization', async function () {
90
- sinon.stub(integrations_platform_client_1.default, 'getIntegrationById').resolves({
90
+ sinon.stub(IntegrationsPlatformClient, 'getIntegrationById').resolves({
91
91
  ...integration,
92
92
  authorizations: [
93
93
  {
@@ -103,14 +103,14 @@ describe('integrations platform', function () {
103
103
  },
104
104
  ],
105
105
  });
106
- sinon.stub(integrations_platform_client_1.default, 'updateIntegration').resolves(integration);
106
+ sinon.stub(IntegrationsPlatformClient, 'updateIntegration').resolves(integration);
107
107
  strict_1.default.deepEqual(await IntegrationsPlatform.updateIntegration(1, {
108
108
  name: 'foo',
109
109
  authorizations: [{ name: 'bar', method: configurationTypes_1.Method.CUSTOM }],
110
110
  }), integration);
111
111
  });
112
112
  it('updateIntegration - update authorization', async function () {
113
- sinon.stub(integrations_platform_client_1.default, 'getIntegrationById').resolves({
113
+ sinon.stub(IntegrationsPlatformClient, 'getIntegrationById').resolves({
114
114
  ...integration,
115
115
  authorizations: [
116
116
  {
@@ -126,7 +126,7 @@ describe('integrations platform', function () {
126
126
  },
127
127
  ],
128
128
  });
129
- sinon.stub(integrations_platform_client_1.default, 'updateIntegration').resolves(integration);
129
+ sinon.stub(IntegrationsPlatformClient, 'updateIntegration').resolves(integration);
130
130
  strict_1.default.deepEqual(await IntegrationsPlatform.updateIntegration(1, { name: 'foo' }), integration);
131
131
  strict_1.default.deepEqual(await IntegrationsPlatform.updateIntegration(1, {
132
132
  name: 'foo',
@@ -134,8 +134,8 @@ describe('integrations platform', function () {
134
134
  }), integration);
135
135
  });
136
136
  it('updateIntegration - update secrets', async function () {
137
- sinon.stub(integrations_platform_client_1.default, 'getIntegrationById').resolves({ ...integration });
138
- const mockUpdateIntegration = sinon.stub(integrations_platform_client_1.default, 'updateIntegration');
137
+ sinon.stub(IntegrationsPlatformClient, 'getIntegrationById').resolves({ ...integration });
138
+ const mockUpdateIntegration = sinon.stub(IntegrationsPlatformClient, 'updateIntegration');
139
139
  const integrationId = 1;
140
140
  const configuration = {
141
141
  name: 'foo',
@@ -158,8 +158,8 @@ describe('integrations platform', function () {
158
158
  });
159
159
  });
160
160
  it('updateIntegration - unarchive', async function () {
161
- sinon.stub(integrations_platform_client_1.default, 'getIntegrationById').resolves({ ...integration });
162
- const mockUpdateIntegration = sinon.stub(integrations_platform_client_1.default, 'updateIntegration');
161
+ sinon.stub(IntegrationsPlatformClient, 'getIntegrationById').resolves({ ...integration });
162
+ const mockUpdateIntegration = sinon.stub(IntegrationsPlatformClient, 'updateIntegration');
163
163
  const integrationId = 1;
164
164
  const archived = false;
165
165
  const configuration = {
@@ -183,7 +183,7 @@ describe('integrations platform', function () {
183
183
  });
184
184
  });
185
185
  it('encryptData', async function () {
186
- sinon.stub(integrations_platform_client_1.default, 'encryptData').resolves({ encryptedData: 'encryptedFoo' });
186
+ sinon.stub(IntegrationsPlatformClient, 'encryptData').resolves({ encryptedData: 'encryptedFoo' });
187
187
  strict_1.default.deepEqual(await IntegrationsPlatform.encryptData('mySuperIntegration', 'foo', false), {
188
188
  encryptedData: 'encryptedFoo',
189
189
  });
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.60.0",
2
+ "version": "0.60.2",
3
3
  "commands": {
4
4
  "activity": {
5
5
  "id": "activity",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unito/integration-cli",
3
- "version": "0.60.0",
3
+ "version": "0.60.2",
4
4
  "description": "Integration CLI",
5
5
  "bin": {
6
6
  "integration-cli": "./bin/run"
@@ -36,8 +36,8 @@
36
36
  ],
37
37
  "dependencies": {
38
38
  "@oclif/core": "3.x",
39
- "@unito/integration-debugger": "0.25.1",
40
- "@unito/integrations-platform-client": "0.48.2",
39
+ "@unito/integration-debugger": "0.26.0",
40
+ "@oazapfts/runtime": "1.x",
41
41
  "ajv": "8.x",
42
42
  "ajv-formats": "2.x",
43
43
  "better-ajv-errors": "1.x",