@unito/integration-cli 0.62.14 → 0.63.1

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.
@@ -97,7 +97,11 @@ class Dev extends baseCommand_1.BaseCommand {
97
97
  let readOnly = flags['read-only'] ?? false;
98
98
  if (flags['credential-id']) {
99
99
  const credential = await (0, credentials_1.fetchCredential)(environment, this.config.configDir, flags['credential-id']);
100
- credentialPayload = JSON.stringify(credential.payload);
100
+ credentialPayload = JSON.stringify({
101
+ ...credential.payload,
102
+ unitoCredentialId: credential.id,
103
+ unitoUserId: credential.unitoUserId,
104
+ });
101
105
  // When "credential-id" is provided, the default value of "read-only" is false.
102
106
  readOnly = flags['read-only'] ?? true;
103
107
  }
@@ -111,7 +115,11 @@ class Dev extends baseCommand_1.BaseCommand {
111
115
  if (decryptedEntries.failed.length) {
112
116
  throw new errors_1.EntryDecryptionError(decryptedEntries.failed.at(0), environment);
113
117
  }
114
- credentialPayload = JSON.stringify(decryptedEntries.successful);
118
+ credentialPayload = JSON.stringify({
119
+ ...decryptedEntries.successful,
120
+ unitoCredentialId: flags['test-account'],
121
+ unitoUserId: flags['test-account'],
122
+ });
115
123
  }
116
124
  }
117
125
  // Load secrets.
@@ -115,7 +115,11 @@ class Test extends baseCommand_1.BaseCommand {
115
115
  let readOnly = flags['read-only'] ?? false;
116
116
  if (flags['credential-id']) {
117
117
  const credential = await (0, credentials_1.fetchCredential)(environment, this.config.configDir, flags['credential-id']);
118
- credentialPayload = JSON.stringify(credential.payload);
118
+ credentialPayload = JSON.stringify({
119
+ ...credential.payload,
120
+ unitoCredentialId: credential.id,
121
+ unitoUserId: credential.unitoUserId,
122
+ });
119
123
  // When "credential-id" is provided, the default value of "read-only" is false.
120
124
  readOnly = flags['read-only'] ?? true;
121
125
  }
@@ -129,7 +133,11 @@ class Test extends baseCommand_1.BaseCommand {
129
133
  if (decryptedEntries.failed.length) {
130
134
  throw new errors_1.EntryDecryptionError(decryptedEntries.failed.at(0), environment);
131
135
  }
132
- credentialPayload = JSON.stringify(decryptedEntries.successful);
136
+ credentialPayload = JSON.stringify({
137
+ ...decryptedEntries.successful,
138
+ unitoCredentialId: flags['test-account'],
139
+ unitoUserId: flags['test-account'],
140
+ });
133
141
  }
134
142
  }
135
143
  // Load secrets.
@@ -62,7 +62,7 @@ describe('Dev', () => {
62
62
  .stub(ConfigurationResource, 'getConfiguration', stub => stub.returns(cliConfiguration))
63
63
  .command(['dev'])
64
64
  .it('decrypts credentials', () => {
65
- (0, test_1.expect)(spawnStub.getCall(0).args.at(1)).to.include('--credential-payload={"key":"value","encryptedToken":"decrypted-me"}');
65
+ (0, test_1.expect)(spawnStub.getCall(0).args.at(1)).to.include('--credential-payload={"key":"value","encryptedToken":"decrypted-me","unitoCredentialId":"development","unitoUserId":"development"}');
66
66
  });
67
67
  test_1.test
68
68
  .stdout()
@@ -171,27 +171,27 @@ describe('Dev', () => {
171
171
  .stdout()
172
172
  .stub(ConfigurationResource, 'getConfiguration', stub => stub.returns({}))
173
173
  .stub(IntegrationResource, 'validateIsIntegrationDirectory', stub => stub.returns(true))
174
- .stub(CredentialResource, 'fetchCredential', stub => stub.resolves({ payload: { from: 'credential' } }))
174
+ .stub(CredentialResource, 'fetchCredential', stub => stub.resolves({ payload: { from: 'credential' }, id: '123', unitoUserId: '456' }))
175
175
  .command(['dev', '--credential-id=123'])
176
176
  .it('credential-id', () => {
177
- (0, test_1.expect)(spawnStub.getCall(0).args.at(1)).to.include('--credential-payload={"from":"credential"}');
177
+ (0, test_1.expect)(spawnStub.getCall(0).args.at(1)).to.include('--credential-payload={"from":"credential","unitoCredentialId":"123","unitoUserId":"456"}');
178
178
  (0, test_1.expect)(spawnStub.getCall(0).args.at(1)).to.include('--read-only');
179
179
  });
180
180
  test_1.test
181
181
  .stdout()
182
182
  .stub(ConfigurationResource, 'getConfiguration', stub => stub.returns({}))
183
183
  .stub(IntegrationResource, 'validateIsIntegrationDirectory', stub => stub.returns(true))
184
- .stub(CredentialResource, 'fetchCredential', stub => stub.resolves({ payload: { from: 'credential' } }))
184
+ .stub(CredentialResource, 'fetchCredential', stub => stub.resolves({ payload: { from: 'credential' }, id: '123', unitoUserId: '456' }))
185
185
  .command(['dev', '--credential-id=123', '--no-read-only'])
186
186
  .it('credential-id && read-only', () => {
187
- (0, test_1.expect)(spawnStub.getCall(0).args.at(1)).to.include('--credential-payload={"from":"credential"}');
187
+ (0, test_1.expect)(spawnStub.getCall(0).args.at(1)).to.include('--credential-payload={"from":"credential","unitoCredentialId":"123","unitoUserId":"456"}');
188
188
  (0, test_1.expect)(spawnStub.getCall(0).args.at(1)).to.not.include('--read-only');
189
189
  });
190
190
  test_1.test
191
191
  .stdout()
192
192
  .stub(ConfigurationResource, 'getConfiguration', stub => stub.resolves(cliConfiguration))
193
193
  .stub(IntegrationResource, 'validateIsIntegrationDirectory', stub => stub.returns(true))
194
- .stub(CredentialResource, 'fetchCredential', stub => stub.resolves({ payload: { from: 'credential' } }))
194
+ .stub(CredentialResource, 'fetchCredential', stub => stub.resolves({ payload: { from: 'credential' }, id: '123', unitoUserId: '456' }))
195
195
  .stub(DecryptionResource, 'decryptEntries', stub => stub
196
196
  .onFirstCall()
197
197
  .resolves({ successful: {}, failed: [] })
@@ -209,7 +209,7 @@ describe('Dev', () => {
209
209
  .stdout()
210
210
  .stub(ConfigurationResource, 'getConfiguration', stub => stub.resolves(cliConfiguration))
211
211
  .stub(IntegrationResource, 'validateIsIntegrationDirectory', stub => stub.returns(true))
212
- .stub(CredentialResource, 'fetchCredential', stub => stub.resolves({ payload: { from: 'credential' } }))
212
+ .stub(CredentialResource, 'fetchCredential', stub => stub.resolves({ payload: { from: 'credential' }, unitoCredentialId: '123', unitoUserId: '456' }))
213
213
  .stub(DecryptionResource, 'decryptEntries', stub => stub
214
214
  .onFirstCall()
215
215
  .resolves({ successful: {}, failed: [] })
@@ -94,7 +94,7 @@ describe('Test', () => {
94
94
  .stub(IntegrationResource, 'validateIsIntegrationDirectory', stub => stub.returns(true))
95
95
  .command(['test'])
96
96
  .it('defaults to test account when no flag is provided', () => {
97
- (0, test_1.expect)(spawnStub.getCall(0).args.at(1)).to.include('--credential-payload={"accessToken":"developmentToken"}');
97
+ (0, test_1.expect)(spawnStub.getCall(0).args.at(1)).to.include('--credential-payload={"accessToken":"developmentToken","unitoCredentialId":"development","unitoUserId":"development"}');
98
98
  });
99
99
  test_1.test
100
100
  .stdout()
@@ -102,7 +102,7 @@ describe('Test', () => {
102
102
  .stub(IntegrationResource, 'validateIsIntegrationDirectory', stub => stub.returns(true))
103
103
  .command(['test', '--test-account', 'compliance'])
104
104
  .it('uses compliance credentials when a flag is provided', () => {
105
- (0, test_1.expect)(spawnStub.getCall(0).args.at(1)).to.include('--credential-payload={"accessToken":"token","encryptedToken":"decrypted-me"}');
105
+ (0, test_1.expect)(spawnStub.getCall(0).args.at(1)).to.include('--credential-payload={"accessToken":"token","encryptedToken":"decrypted-me","unitoCredentialId":"compliance","unitoUserId":"compliance"}');
106
106
  });
107
107
  test_1.test
108
108
  .stdout()
@@ -199,27 +199,27 @@ describe('Test', () => {
199
199
  .stdout()
200
200
  .stub(ConfigurationResource, 'getConfiguration', stub => stub.resolves(cliConfiguration))
201
201
  .stub(IntegrationResource, 'validateIsIntegrationDirectory', stub => stub.returns(true))
202
- .stub(CredentialResource, 'fetchCredential', stub => stub.resolves({ payload: { from: 'credential' } }))
202
+ .stub(CredentialResource, 'fetchCredential', stub => stub.resolves({ payload: { from: 'credential' }, id: '123', unitoUserId: '456' }))
203
203
  .command(['test', '--credential-id=123'])
204
204
  .it('credential-id', () => {
205
- (0, test_1.expect)(spawnStub.getCall(0).args.at(1)).to.include('--credential-payload={"from":"credential"}');
205
+ (0, test_1.expect)(spawnStub.getCall(0).args.at(1)).to.include('--credential-payload={"from":"credential","unitoCredentialId":"123","unitoUserId":"456"}');
206
206
  (0, test_1.expect)(spawnStub.getCall(0).args.at(1)).to.include('--read-only');
207
207
  });
208
208
  test_1.test
209
209
  .stdout()
210
210
  .stub(ConfigurationResource, 'getConfiguration', stub => stub.resolves(cliConfiguration))
211
211
  .stub(IntegrationResource, 'validateIsIntegrationDirectory', stub => stub.returns(true))
212
- .stub(CredentialResource, 'fetchCredential', stub => stub.resolves({ payload: { from: 'credential' } }))
212
+ .stub(CredentialResource, 'fetchCredential', stub => stub.resolves({ payload: { from: 'credential' }, id: '123', unitoUserId: '456' }))
213
213
  .command(['test', '--credential-id=123', '--no-read-only'])
214
214
  .it('credential-id && read-only', () => {
215
- (0, test_1.expect)(spawnStub.getCall(0).args.at(1)).to.include('--credential-payload={"from":"credential"}');
215
+ (0, test_1.expect)(spawnStub.getCall(0).args.at(1)).to.include('--credential-payload={"from":"credential","unitoCredentialId":"123","unitoUserId":"456"}');
216
216
  (0, test_1.expect)(spawnStub.getCall(0).args.at(1)).to.not.include('--read-only');
217
217
  });
218
218
  test_1.test
219
219
  .stdout()
220
220
  .stub(ConfigurationResource, 'getConfiguration', stub => stub.resolves(cliConfiguration))
221
221
  .stub(IntegrationResource, 'validateIsIntegrationDirectory', stub => stub.returns(true))
222
- .stub(CredentialResource, 'fetchCredential', stub => stub.resolves({ payload: { from: 'credential' } }))
222
+ .stub(CredentialResource, 'fetchCredential', stub => stub.resolves({ payload: { from: 'credential' }, id: '123', unitoUserId: '456' }))
223
223
  .stub(DecryptionResource, 'decryptEntries', stub => stub
224
224
  .onFirstCall()
225
225
  .resolves({ successful: {}, failed: [] })
@@ -237,7 +237,7 @@ describe('Test', () => {
237
237
  .stdout()
238
238
  .stub(ConfigurationResource, 'getConfiguration', stub => stub.resolves(cliConfiguration))
239
239
  .stub(IntegrationResource, 'validateIsIntegrationDirectory', stub => stub.returns(true))
240
- .stub(CredentialResource, 'fetchCredential', stub => stub.resolves({ payload: { from: 'credential' } }))
240
+ .stub(CredentialResource, 'fetchCredential', stub => stub.resolves({ payload: { from: 'credential' }, id: '123', unitoUserId: '456' }))
241
241
  .stub(DecryptionResource, 'decryptEntries', stub => stub
242
242
  .onFirstCall()
243
243
  .resolves({ successful: {}, failed: [] })
@@ -8,9 +8,9 @@ export declare function generateIntegration(overrides?: Partial<IntegrationsPlat
8
8
  baseUrl: string | null;
9
9
  graphRelativeUrl: string;
10
10
  credentialAccountRelativeUrl: string;
11
- webhookParsingRelativeUrl?: (string | null) | undefined;
12
- webhookSubscriptionsRelativeUrl?: (string | null) | undefined;
13
- webhookAcknowledgeRelativeUrl?: (string | null) | undefined;
11
+ webhookParsingRelativeUrl?: string | null | undefined;
12
+ webhookSubscriptionsRelativeUrl?: string | null | undefined;
13
+ webhookAcknowledgeRelativeUrl?: string | null | undefined;
14
14
  visibility: string;
15
15
  unitoOrganizationIds: string[];
16
16
  ui: {
@@ -20,7 +20,7 @@ export declare function generateIntegration(overrides?: Partial<IntegrationsPlat
20
20
  secrets?: {
21
21
  [key: string]: string;
22
22
  } | undefined;
23
- disabledAt?: (string | null) | undefined;
23
+ disabledAt?: string | null | undefined;
24
24
  authorizations: import("../../src/services/integrationsPlatformClient").Authorization[];
25
25
  userIds: number[];
26
26
  };
@@ -1 +1 @@
1
- {"root":["../src/baseCommand.ts","../src/configurationTypes.ts","../src/errors.ts","../src/index.ts","../src/commands/activity.ts","../src/commands/dev.ts","../src/commands/encrypt.ts","../src/commands/init.ts","../src/commands/invite.ts","../src/commands/login.ts","../src/commands/oauth2.ts","../src/commands/publish.ts","../src/commands/test.ts","../src/commands/upgrade.ts","../src/hooks/init/displayLogo.ts","../src/resources/configuration.ts","../src/resources/credentials.ts","../src/resources/decryption.ts","../src/resources/fileSystem.ts","../src/resources/globalConfiguration.ts","../src/resources/integrations.ts","../src/resources/integrationsPlatform.ts","../src/resources/oauth2.ts","../src/resources/template.ts","../src/services/integrationsPlatform.ts","../src/services/integrationsPlatformClient.ts","../src/services/oauth2.ts","../test/errors.test.ts","../test/commands/activity.test.ts","../test/commands/dev.test.ts","../test/commands/encrypt.test.ts","../test/commands/init.test.ts","../test/commands/invite.test.ts","../test/commands/login.test.ts","../test/commands/oauth2.test.ts","../test/commands/publish.test.ts","../test/commands/test.test.ts","../test/commands/upgrade.test.ts","../test/helpers/init.js","../test/helpers/integrations.ts","../test/helpers/styles.ts","../test/resources/configuration.test.ts","../test/resources/decryption.test.ts","../test/resources/globalConfiguration.test.ts","../test/resources/integrations.test.ts","../test/resources/oauth2.test.ts","../test/resources/template.test.ts","../test/services/integrationsPlatform.test.ts","../test/services/oauth2.test.ts","../scripts/generateTypes.ts","../.eslintrc.js"],"version":"5.6.3"}
1
+ {"root":["../src/baseCommand.ts","../src/configurationTypes.ts","../src/errors.ts","../src/index.ts","../src/commands/activity.ts","../src/commands/dev.ts","../src/commands/encrypt.ts","../src/commands/init.ts","../src/commands/invite.ts","../src/commands/login.ts","../src/commands/oauth2.ts","../src/commands/publish.ts","../src/commands/test.ts","../src/commands/upgrade.ts","../src/hooks/init/displayLogo.ts","../src/resources/configuration.ts","../src/resources/credentials.ts","../src/resources/decryption.ts","../src/resources/fileSystem.ts","../src/resources/globalConfiguration.ts","../src/resources/integrations.ts","../src/resources/integrationsPlatform.ts","../src/resources/oauth2.ts","../src/resources/template.ts","../src/services/integrationsPlatform.ts","../src/services/integrationsPlatformClient.ts","../src/services/oauth2.ts","../test/errors.test.ts","../test/commands/activity.test.ts","../test/commands/dev.test.ts","../test/commands/encrypt.test.ts","../test/commands/init.test.ts","../test/commands/invite.test.ts","../test/commands/login.test.ts","../test/commands/oauth2.test.ts","../test/commands/publish.test.ts","../test/commands/test.test.ts","../test/commands/upgrade.test.ts","../test/helpers/init.js","../test/helpers/integrations.ts","../test/helpers/styles.ts","../test/resources/configuration.test.ts","../test/resources/decryption.test.ts","../test/resources/globalConfiguration.test.ts","../test/resources/integrations.test.ts","../test/resources/oauth2.test.ts","../test/resources/template.test.ts","../test/services/integrationsPlatform.test.ts","../test/services/oauth2.test.ts","../scripts/generateTypes.ts","../.eslintrc.js"],"version":"5.8.3"}
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.62.14",
2
+ "version": "0.63.1",
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.62.14",
3
+ "version": "0.63.1",
4
4
  "description": "Integration CLI",
5
5
  "bin": {
6
6
  "integration-cli": "./bin/run"
@@ -39,13 +39,13 @@
39
39
  "@ngrok/ngrok": "^1.4.1",
40
40
  "@oazapfts/runtime": "1.x",
41
41
  "@oclif/core": "3.x",
42
- "@unito/integration-debugger": "0.28.5",
42
+ "@unito/integration-debugger": "0.28.7",
43
43
  "ajv": "8.x",
44
- "ajv-formats": "2.x",
44
+ "ajv-formats": "3.x",
45
45
  "better-ajv-errors": "1.x",
46
46
  "chalk": "4.x",
47
47
  "cors": "2.x",
48
- "express": "5.0.1",
48
+ "express": "5.x",
49
49
  "gradient-string": "2.x",
50
50
  "inquirer": "8.x",
51
51
  "json-colorizer": "2.x",