@forge/api 2.17.0-next.0-experimental-5ec0ed7 → 2.17.0-next.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.
- package/CHANGELOG.md +15 -3
- package/out/api/runtime.d.ts.map +1 -1
- package/out/api/runtime.js +10 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
# @forge/api
|
|
2
2
|
|
|
3
|
-
## 2.17.0-next.
|
|
3
|
+
## 2.17.0-next.2
|
|
4
4
|
|
|
5
|
-
###
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- cf453494: Bumping dependencies via Renovate:
|
|
8
|
+
|
|
9
|
+
- node-fetch
|
|
10
|
+
- @types/node-fetch
|
|
11
|
+
|
|
12
|
+
- Updated dependencies [cf453494]
|
|
13
|
+
- @forge/storage@1.5.3-next.0
|
|
14
|
+
|
|
15
|
+
## 2.17.0-next.1
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
6
18
|
|
|
7
|
-
-
|
|
19
|
+
- 5ba685b6: Add new success dimension to proxy fetch metrics on node runtime
|
|
8
20
|
|
|
9
21
|
## 2.17.0-next.0
|
|
10
22
|
|
package/out/api/runtime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/api/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/api/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,wCAAwC,CAAC;AAS5E,oBAAY,YAAY,GAAG;IACzB,KAAK,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE;QACV,KAAK,EAAE,MAAM,CAAC;QACd,aAAa,EAAE,MAAM,CAAC;QACtB,UAAU,EAAE,MAAM,CAAC;QACnB,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE;QACb,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,OAAO,EAAE;QACP,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE;QACJ,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH,CAAC;AAEF,wBAAgB,UAAU,IAAI,YAAY,CAOzC;AAED,wBAAgB,aAAa,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,GAAG,EACvD,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,GAAG,CAAC,EACnC,EAAE,IAAI,EAAE,GAAE;IAAE,IAAI,CAAC,EAAE,IAAI,CAAA;CAAO,GAC7B,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,GAAG,CAAC,CAiBjC"}
|
package/out/api/runtime.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.wrapInMetrics = exports.getRuntime = void 0;
|
|
4
|
+
const errors_1 = require("./errors");
|
|
5
|
+
const node_fetch_1 = require("node-fetch");
|
|
4
6
|
function getRuntime() {
|
|
5
7
|
const runtime = global.__forge_runtime__;
|
|
6
8
|
if (!runtime) {
|
|
@@ -14,11 +16,18 @@ function wrapInMetrics(name, fn, { tags } = {}) {
|
|
|
14
16
|
const { metrics } = getRuntime();
|
|
15
17
|
metrics.counter(name, tags).incr();
|
|
16
18
|
const timer = metrics.timing(name, tags).measure();
|
|
19
|
+
let success = true;
|
|
17
20
|
try {
|
|
18
21
|
return await fn(...args);
|
|
19
22
|
}
|
|
23
|
+
catch (e) {
|
|
24
|
+
if (e instanceof errors_1.ProxyRequestError || e instanceof node_fetch_1.FetchError) {
|
|
25
|
+
success = false;
|
|
26
|
+
}
|
|
27
|
+
throw e;
|
|
28
|
+
}
|
|
20
29
|
finally {
|
|
21
|
-
timer.stop();
|
|
30
|
+
timer.stop({ success: success.toString() });
|
|
22
31
|
}
|
|
23
32
|
};
|
|
24
33
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/api",
|
|
3
|
-
"version": "2.17.0-next.
|
|
3
|
+
"version": "2.17.0-next.2",
|
|
4
4
|
"description": "Forge API methods",
|
|
5
5
|
"author": "Atlassian",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"compile": "tsc -b -v"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@forge/runtime": "4.4.
|
|
15
|
+
"@forge/runtime": "4.4.1-next.1",
|
|
16
16
|
"@forge/util": "1.2.3",
|
|
17
17
|
"@types/node": "14.18.44",
|
|
18
18
|
"jest-matcher-specific-error": "^1.0.0",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@forge/auth": "0.0.1",
|
|
23
23
|
"@forge/egress": "1.2.1",
|
|
24
|
-
"@forge/storage": "1.5.
|
|
25
|
-
"@types/node-fetch": "^2.
|
|
26
|
-
"node-fetch": "2.6.
|
|
24
|
+
"@forge/storage": "1.5.3-next.0",
|
|
25
|
+
"@types/node-fetch": "^2.6.4",
|
|
26
|
+
"node-fetch": "2.6.11"
|
|
27
27
|
}
|
|
28
28
|
}
|