@unito/integration-cli 0.60.1 → 0.60.3

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.
@@ -6,6 +6,7 @@ declare let _extends: string[];
6
6
  export { _extends as extends };
7
7
  export declare let rules: {
8
8
  'no-console': string;
9
+ '@typescript-eslint/no-explicit-any': string;
9
10
  };
10
11
  export declare let ignorePatterns: string[];
11
12
  export declare let overrides: {
package/dist/.eslintrc.js CHANGED
@@ -12,6 +12,7 @@ module.exports = {
12
12
  ],
13
13
  rules: {
14
14
  'no-console': 'off',
15
+ '@typescript-eslint/no-explicit-any': 'off',
15
16
  },
16
17
  ignorePatterns: [
17
18
  'boilerplate',
@@ -1 +1 @@
1
- lts/iron
1
+ 20.9
@@ -4,7 +4,7 @@
4
4
  # Build
5
5
  #
6
6
 
7
- FROM --platform=$BUILDPLATFORM public.ecr.aws/docker/library/node:20-alpine as build
7
+ FROM --platform=$BUILDPLATFORM public.ecr.aws/docker/library/node:20.9-alpine as build
8
8
 
9
9
  WORKDIR /build
10
10
 
@@ -19,7 +19,7 @@ RUN npm run compile
19
19
  # Runtime
20
20
  #
21
21
 
22
- FROM --platform=$TARGETPLATFORM public.ecr.aws/docker/library/node:20-alpine as runtime
22
+ FROM --platform=$TARGETPLATFORM public.ecr.aws/docker/library/node:20.9-alpine as runtime
23
23
 
24
24
  WORKDIR /app
25
25
 
@@ -20,13 +20,13 @@
20
20
  "email": "hello@unito.io"
21
21
  },
22
22
  "engines": {
23
- "node": ">=20.0.0"
23
+ "node": "20.9"
24
24
  },
25
25
  "dependencies": {
26
26
  "@unito/integration-sdk": "^0.x"
27
27
  },
28
28
  "devDependencies": {
29
- "@types/node": "20.x",
29
+ "@types/node": "20.9.x",
30
30
  "typescript-eslint": "7.x",
31
31
  "eslint": "8.x",
32
32
  "npm-audit-resolver": "^3.0.0-RC.0",
@@ -1,4 +1,4 @@
1
- import IntegrationsPlatform from '@unito/integrations-platform-client';
1
+ import * as IntegrationsPlatform from './integrationsPlatformClient';
2
2
  import { Environment } from '../resources/globalConfiguration';
3
3
  import { Configuration } from '../configurationTypes';
4
4
  export type User = IntegrationsPlatform.User;
@@ -3,40 +3,40 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getCredential = exports.updateIntegration = exports.getIntegrationEvents = exports.inviteUserToIntegration = exports.createIntegration = exports.publishIntegration = exports.getIntegrations = exports.getIntegrationByName = exports.getIntegration = exports.reencryptData = exports.decryptData = exports.encryptData = exports.getProfile = exports.setApiKey = exports.getApiKey = exports.setEnvironment = exports.Servers = exports.HttpError = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const fs = tslib_1.__importStar(require("fs"));
6
- const integrations_platform_client_1 = tslib_1.__importDefault(require("@unito/integrations-platform-client"));
6
+ const IntegrationsPlatform = tslib_1.__importStar(require("./integrationsPlatformClient"));
7
7
  const globalConfiguration_1 = require("../resources/globalConfiguration");
8
- const { HttpError } = integrations_platform_client_1.default;
8
+ const { HttpError } = IntegrationsPlatform;
9
9
  exports.HttpError = HttpError;
10
10
  exports.Servers = {
11
- [globalConfiguration_1.Environment.Local]: integrations_platform_client_1.default.servers.local,
12
- [globalConfiguration_1.Environment.Staging]: integrations_platform_client_1.default.servers.staging,
13
- [globalConfiguration_1.Environment.Production]: integrations_platform_client_1.default.servers.production,
11
+ [globalConfiguration_1.Environment.Local]: IntegrationsPlatform.servers.local,
12
+ [globalConfiguration_1.Environment.Staging]: IntegrationsPlatform.servers.staging,
13
+ [globalConfiguration_1.Environment.Production]: IntegrationsPlatform.servers.production,
14
14
  };
15
15
  function setEnvironment(environment) {
16
- integrations_platform_client_1.default.defaults.fetch = fetch;
17
- integrations_platform_client_1.default.defaults.baseUrl = exports.Servers[environment];
16
+ IntegrationsPlatform.defaults.fetch = fetch;
17
+ IntegrationsPlatform.defaults.baseUrl = exports.Servers[environment];
18
18
  }
19
19
  exports.setEnvironment = setEnvironment;
20
20
  function getApiKey() {
21
- const header = integrations_platform_client_1.default.defaults.headers?.Authorization?.toString();
21
+ const header = IntegrationsPlatform.defaults.headers?.Authorization?.toString();
22
22
  return header?.split(' ')?.at(1);
23
23
  }
24
24
  exports.getApiKey = getApiKey;
25
25
  function setApiKey(apiKey) {
26
26
  if (apiKey) {
27
- integrations_platform_client_1.default.defaults.headers = { Authorization: `Bearer ${apiKey}` };
27
+ IntegrationsPlatform.defaults.headers = { Authorization: `Bearer ${apiKey}` };
28
28
  }
29
29
  else {
30
- integrations_platform_client_1.default.defaults.headers = {};
30
+ IntegrationsPlatform.defaults.headers = {};
31
31
  }
32
32
  }
33
33
  exports.setApiKey = setApiKey;
34
34
  async function getProfile() {
35
- return integrations_platform_client_1.default.getProfile();
35
+ return IntegrationsPlatform.getProfile();
36
36
  }
37
37
  exports.getProfile = getProfile;
38
38
  async function encryptData(integrationName, data, sensitive) {
39
- return integrations_platform_client_1.default.encryptData({
39
+ return IntegrationsPlatform.encryptData({
40
40
  integrationName,
41
41
  data,
42
42
  sensitive,
@@ -44,14 +44,14 @@ async function encryptData(integrationName, data, sensitive) {
44
44
  }
45
45
  exports.encryptData = encryptData;
46
46
  async function decryptData(integrationName, data) {
47
- return integrations_platform_client_1.default.decryptData({
47
+ return IntegrationsPlatform.decryptData({
48
48
  integrationName,
49
49
  data,
50
50
  });
51
51
  }
52
52
  exports.decryptData = decryptData;
53
53
  async function reencryptData(integrationName, encryptedData, newIntegrationName) {
54
- return integrations_platform_client_1.default.reencryptData({
54
+ return IntegrationsPlatform.reencryptData({
55
55
  integrationName,
56
56
  encryptedData,
57
57
  newIntegrationName,
@@ -59,11 +59,11 @@ async function reencryptData(integrationName, encryptedData, newIntegrationName)
59
59
  }
60
60
  exports.reencryptData = reencryptData;
61
61
  async function getIntegration(integrationId) {
62
- return integrations_platform_client_1.default.getIntegrationById(integrationId);
62
+ return IntegrationsPlatform.getIntegrationById(integrationId);
63
63
  }
64
64
  exports.getIntegration = getIntegration;
65
65
  async function getIntegrationByName(integrationName) {
66
- return integrations_platform_client_1.default.getIntegrationByName(integrationName);
66
+ return IntegrationsPlatform.getIntegrationByName(integrationName);
67
67
  }
68
68
  exports.getIntegrationByName = getIntegrationByName;
69
69
  async function getIntegrations() {
@@ -72,7 +72,7 @@ async function getIntegrations() {
72
72
  const limit = 100;
73
73
  let nextPageOffset = 0;
74
74
  do {
75
- page = await integrations_platform_client_1.default.getIntegrations({
75
+ page = await IntegrationsPlatform.getIntegrations({
76
76
  pagination: { offset: nextPageOffset, limit },
77
77
  });
78
78
  nextPageOffset += limit;
@@ -84,27 +84,27 @@ exports.getIntegrations = getIntegrations;
84
84
  async function publishIntegration(archivePath) {
85
85
  const file = fs.readFileSync(archivePath);
86
86
  const blob = new Blob([file], { type: 'binary' });
87
- return await integrations_platform_client_1.default.publishIntegration({ file: blob });
87
+ return await IntegrationsPlatform.publishIntegration({ file: blob });
88
88
  }
89
89
  exports.publishIntegration = publishIntegration;
90
90
  async function createIntegration(configuration) {
91
91
  // The creation of an integration is kept to its minimal required fields...
92
- const integration = await integrations_platform_client_1.default.createIntegration({ name: configuration.name });
92
+ const integration = await IntegrationsPlatform.createIntegration({ name: configuration.name });
93
93
  // ... as all other non-required fields are updated here.
94
94
  return updateIntegration(integration.id, configuration);
95
95
  }
96
96
  exports.createIntegration = createIntegration;
97
97
  async function inviteUserToIntegration(integrationId, email) {
98
- await integrations_platform_client_1.default.inviteUser(integrationId, { email });
98
+ await IntegrationsPlatform.inviteUser(integrationId, { email });
99
99
  }
100
100
  exports.inviteUserToIntegration = inviteUserToIntegration;
101
101
  async function getIntegrationEvents(integrationId, options = {}) {
102
- const { data: events } = await integrations_platform_client_1.default.getIntegrationEvents(integrationId, options);
102
+ const { data: events } = await IntegrationsPlatform.getIntegrationEvents(integrationId, options);
103
103
  return events;
104
104
  }
105
105
  exports.getIntegrationEvents = getIntegrationEvents;
106
106
  async function updateIntegration(integrationId, configuration) {
107
- const current = await integrations_platform_client_1.default.getIntegrationById(integrationId);
107
+ const current = await IntegrationsPlatform.getIntegrationById(integrationId);
108
108
  // Create authorizations.
109
109
  const authorizationsToCreate = configuration.authorizations
110
110
  ?.filter(configAuthorization => !current.authorizations.some(platformAuthorization => platformAuthorization.name === configAuthorization.name))
@@ -141,7 +141,7 @@ async function updateIntegration(integrationId, configuration) {
141
141
  };
142
142
  return authorizationToUpdate;
143
143
  });
144
- return await integrations_platform_client_1.default.updateIntegration(current.id, {
144
+ return await IntegrationsPlatform.updateIntegration(current.id, {
145
145
  baseUrl: configuration.baseUrl,
146
146
  graphRelativeUrl: configuration.graphRelativeUrl ?? '/',
147
147
  credentialAccountRelativeUrl: configuration.credentialAccountRelativeUrl ?? '/me',
@@ -156,6 +156,6 @@ async function updateIntegration(integrationId, configuration) {
156
156
  }
157
157
  exports.updateIntegration = updateIntegration;
158
158
  async function getCredential(credentialId) {
159
- return integrations_platform_client_1.default.getCredentialById(credentialId);
159
+ return IntegrationsPlatform.getCredentialById(credentialId);
160
160
  }
161
161
  exports.getCredential = getCredential;