@unito/integration-cli 0.62.2 → 0.62.4

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.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "integration-boilerplate",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "integration-boilerplate",
9
- "version": "0.0.1",
9
+ "version": "0.1.0",
10
10
  "license": "LicenseRef-LICENSE",
11
11
  "dependencies": {
12
12
  "@unito/integration-sdk": "^1.x"
@@ -14,7 +14,7 @@
14
14
  "devDependencies": {
15
15
  "@eslint/js": "9.x",
16
16
  "@types/eslint__js": "8.x",
17
- "@types/node": "22.x",
17
+ "@types/node": "20.x",
18
18
  "eslint": "9.x",
19
19
  "npm-audit-resolver": "^3.0.0-RC.0",
20
20
  "prettier": "3.x",
@@ -23,7 +23,7 @@
23
23
  "typescript-eslint": "8.x"
24
24
  },
25
25
  "engines": {
26
- "node": "20.9"
26
+ "node": ">=20"
27
27
  }
28
28
  },
29
29
  "node_modules/@aashutoshrathi/word-wrap": {
@@ -640,9 +640,9 @@
640
640
  "dev": true
641
641
  },
642
642
  "node_modules/@types/node": {
643
- "version": "22.7.5",
644
- "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz",
645
- "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==",
643
+ "version": "20.17.12",
644
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.12.tgz",
645
+ "integrity": "sha512-vo/wmBgMIiEA23A/knMfn/cf37VnuF52nZh5ZoW0GWt4e4sxNquibrMRJ7UQsA06+MBx9r/H1jsI9grYjQCQlw==",
646
646
  "dev": true,
647
647
  "dependencies": {
648
648
  "undici-types": "~6.19.2"
@@ -26,7 +26,7 @@
26
26
  "@unito/integration-sdk": "^1.x"
27
27
  },
28
28
  "devDependencies": {
29
- "@types/node": "20.9.x",
29
+ "@types/node": "20.x",
30
30
  "@types/eslint__js": "8.x",
31
31
  "npm-audit-resolver": "^3.0.0-RC.0",
32
32
  "prettier": "3.x",
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "extends": "./tsconfig.json",
3
+ "include": ["src/**/*"],
3
4
  "exclude": ["test/**/*"]
4
5
  }
@@ -14,7 +14,7 @@
14
14
  "noImplicitAny": true,
15
15
  "noFallthroughCasesInSwitch": true,
16
16
  "noUnusedLocals": true,
17
- "outDir": "dist",
17
+ "outDir": "./dist",
18
18
  "pretty": true,
19
19
  "moduleResolution": "NodeNext",
20
20
  "rootDir": ".",
@@ -139,9 +139,7 @@ class OAuth2Service {
139
139
  method: 'POST',
140
140
  });
141
141
  if (tokenResponse.status !== 200) {
142
- res.setHeader('Content-Type', 'text/html');
143
- res.send(exports.HTML_ERROR_MSG);
144
- return;
142
+ throw new errors_1.FailedToRetrieveAccessTokenError(await tokenResponse.text());
145
143
  }
146
144
  const response = await tokenResponse.json();
147
145
  this.oauth2Response = {
@@ -156,6 +154,7 @@ class OAuth2Service {
156
154
  res.setHeader('Content-Type', 'text/html');
157
155
  res.send(exports.HTML_ERROR_MSG);
158
156
  }
157
+ throw new errors_1.FailedToRetrieveAccessTokenError(JSON.stringify(error));
159
158
  }
160
159
  }
161
160
  /**
@@ -110,7 +110,12 @@ describe('OAuth2Helper', () => {
110
110
  const req = { query: { code } };
111
111
  const res = { send: sinon_1.default.stub(), setHeader: sinon_1.default.stub() };
112
112
  fetchStub.rejects(new Error('Failed to retrieve access token'));
113
- await oauth2Helper['handleCallback'](req, res);
113
+ try {
114
+ await oauth2Helper['handleCallback'](req, res);
115
+ }
116
+ catch (err) {
117
+ (0, strict_1.default)(err instanceof errors_1.FailedToRetrieveAccessTokenError);
118
+ }
114
119
  sinon_1.default.assert.calledOnce(res.send);
115
120
  sinon_1.default.assert.calledWith(res.send, oauth2Namespace.HTML_ERROR_MSG);
116
121
  });
@@ -119,7 +124,12 @@ describe('OAuth2Helper', () => {
119
124
  const req = { query: { code } };
120
125
  const res = { send: sinon_1.default.stub(), setHeader: sinon_1.default.stub() };
121
126
  fetchStub.resolves({ status: 500 });
122
- await oauth2Helper['handleCallback'](req, res);
127
+ try {
128
+ await oauth2Helper['handleCallback'](req, res);
129
+ }
130
+ catch (err) {
131
+ (0, strict_1.default)(err instanceof errors_1.FailedToRetrieveAccessTokenError);
132
+ }
123
133
  sinon_1.default.assert.calledOnce(res.send);
124
134
  sinon_1.default.assert.calledWith(res.send, oauth2Namespace.HTML_ERROR_MSG);
125
135
  });
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.62.2",
2
+ "version": "0.62.4",
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.2",
3
+ "version": "0.62.4",
4
4
  "description": "Integration CLI",
5
5
  "bin": {
6
6
  "integration-cli": "./bin/run"