@forge/tunnel 1.5.3-next.2 → 1.6.0-next.5
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 +27 -0
- package/out/tunnelling/servers/dev-server.js +2 -2
- package/out/tunnelling/services/local-invocation-service.d.ts.map +1 -1
- package/out/tunnelling/services/local-invocation-service.js +4 -2
- package/out/tunnelling/util/invocation-utils.d.ts +6 -0
- package/out/tunnelling/util/invocation-utils.d.ts.map +1 -1
- package/out/tunnelling/util/invocation-utils.js +2 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @forge/tunnel
|
|
2
2
|
|
|
3
|
+
## 1.6.0-next.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @forge/cli-shared@2.3.0-next.4
|
|
8
|
+
- @forge/bundler@3.0.1-next.5
|
|
9
|
+
|
|
10
|
+
## 1.6.0-next.4
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- cee5eea: Observability improvements
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [cee5eea]
|
|
19
|
+
- @forge/runtime@1.15.0-next.1
|
|
20
|
+
- @forge/cli-shared@2.3.0-next.3
|
|
21
|
+
- @forge/bundler@3.0.1-next.4
|
|
22
|
+
|
|
23
|
+
## 1.5.3-next.3
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- @forge/cli-shared@2.3.0-next.2
|
|
28
|
+
- @forge/bundler@3.0.1-next.3
|
|
29
|
+
|
|
3
30
|
## 1.5.3-next.2
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
|
@@ -27,8 +27,8 @@ class LocalDevelopmentServer {
|
|
|
27
27
|
}).filter((item) => typeof item === 'string')) !== null && _f !== void 0 ? _f : undefined;
|
|
28
28
|
request._meta = Object.assign(Object.assign({}, request._meta), { fetchAllowList: allowList });
|
|
29
29
|
try {
|
|
30
|
-
const
|
|
31
|
-
res.json(
|
|
30
|
+
const invokeResults = await this.invocationService.invoke(request.handler, request);
|
|
31
|
+
res.json(invokeResults);
|
|
32
32
|
}
|
|
33
33
|
catch (error) {
|
|
34
34
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-invocation-service.d.ts","sourceRoot":"","sources":["../../../src/tunnelling/services/local-invocation-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAI/C,OAAO,EACL,mBAAmB,EACnB,SAAS,EAIV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,EAAyB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"local-invocation-service.d.ts","sourceRoot":"","sources":["../../../src/tunnelling/services/local-invocation-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAI/C,OAAO,EACL,mBAAmB,EACnB,SAAS,EAIV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,EAAyB,MAAM,mBAAmB,CAAC;AAG9E,qBAAa,sBAAuB,YAAW,iBAAiB;IAE5D,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAFT,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS;IAG1B,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,GAAG,CAAC;CAkDjF"}
|
|
@@ -8,6 +8,7 @@ const v4_1 = tslib_1.__importDefault(require("uuid/v4"));
|
|
|
8
8
|
const runtime_1 = require("@forge/runtime");
|
|
9
9
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
10
10
|
const interactors_1 = require("../command/interactors");
|
|
11
|
+
const feature_flag_1 = require("@forge/runtime/out/feature-flag");
|
|
11
12
|
class LocalInvocationService {
|
|
12
13
|
constructor(configFile, logger, inspector) {
|
|
13
14
|
this.configFile = configFile;
|
|
@@ -43,13 +44,14 @@ class LocalInvocationService {
|
|
|
43
44
|
ctx: { requestId, traceId: requestId, timeout: interactors_1.INVOCATION_TIMEOUT }
|
|
44
45
|
});
|
|
45
46
|
const invocationLimits = runtime_1.perInvocationLimitsTrackerFactory(xenInvocationRequest);
|
|
46
|
-
const { body } = await runtime_1.invoke({
|
|
47
|
+
const { body, metrics } = await runtime_1.invoke({
|
|
47
48
|
sandbox,
|
|
48
49
|
xenInvocationRequest,
|
|
49
50
|
invocationLimits,
|
|
50
51
|
inspector: inspect ? this.inspector : undefined
|
|
51
52
|
});
|
|
52
|
-
|
|
53
|
+
const reportMetrics = xenInvocationRequest.isFeatureFlagEnabled(feature_flag_1.XEN_RUNTIME_SHOULD_REPORT_METRICS);
|
|
54
|
+
return reportMetrics ? { body, metrics } : body;
|
|
53
55
|
}
|
|
54
56
|
}
|
|
55
57
|
exports.LocalInvocationService = LocalInvocationService;
|
|
@@ -5,9 +5,15 @@ interface LambdaError {
|
|
|
5
5
|
errorMessage: string;
|
|
6
6
|
stack: string[];
|
|
7
7
|
serviceKey?: string;
|
|
8
|
+
metrics?: {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}[];
|
|
8
11
|
}
|
|
9
12
|
interface InvokeFunctionErrors extends Error {
|
|
10
13
|
serviceKey?: string;
|
|
14
|
+
metrics?: {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}[];
|
|
11
17
|
}
|
|
12
18
|
export declare const toLambdaError: (error: InvokeFunctionErrors) => LambdaError;
|
|
13
19
|
export declare const getRequestId: (request: any, value?: string) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invocation-utils.d.ts","sourceRoot":"","sources":["../../../src/tunnelling/util/invocation-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAK3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,UAAU,WAAW;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"invocation-utils.d.ts","sourceRoot":"","sources":["../../../src/tunnelling/util/invocation-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAK3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,UAAU,WAAW;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,EAAE,CAAC;CACpC;AAED,UAAU,oBAAqB,SAAQ,KAAK;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,EAAE,CAAC;CACpC;AAED,eAAO,MAAM,aAAa,UAAW,oBAAoB,KAAG,WAQ3D,CAAC;AAEF,eAAO,MAAM,YAAY,YAAa,GAAG,qBAAsB,MAU9D,CAAC;AAEF,eAAO,MAAM,gBAAgB,YAAa,MAAM,WAAW,GAAG,KAAG,MAGhE,CAAC;AAMF,eAAO,MAAM,eAAe,QAAO,MAOlC,CAAC;AAEF,eAAO,MAAM,gBAAgB,UAAW,UAAU,KAAG,MAUpD,CAAC;AAEF,eAAO,MAAM,WAAW,UAAW,MAAM,KAAG,0BAY3C,CAAC"}
|
|
@@ -7,7 +7,8 @@ exports.toLambdaError = (error) => {
|
|
|
7
7
|
errorMessage: error.message,
|
|
8
8
|
errorType: error.name,
|
|
9
9
|
stack: (error.stack || '').split('\n'),
|
|
10
|
-
serviceKey: error.serviceKey
|
|
10
|
+
serviceKey: error.serviceKey,
|
|
11
|
+
metrics: error.metrics
|
|
11
12
|
};
|
|
12
13
|
};
|
|
13
14
|
exports.getRequestId = (request, value = 'unknown') => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/tunnel",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0-next.5",
|
|
4
4
|
"description": "Tunnel functionality for Forge CLI",
|
|
5
5
|
"author": "Atlassian",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"postbuild": "chmod +x out/*.js"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@forge/bundler": "3.0.1-next.
|
|
20
|
-
"@forge/cli-shared": "2.3.0-next.
|
|
19
|
+
"@forge/bundler": "3.0.1-next.5",
|
|
20
|
+
"@forge/cli-shared": "2.3.0-next.4",
|
|
21
21
|
"@forge/csp": "^1.10.0-next.0",
|
|
22
22
|
"@forge/isolated-vm": "3.3.10",
|
|
23
|
-
"@forge/runtime": "1.
|
|
23
|
+
"@forge/runtime": "1.15.0-next.1",
|
|
24
24
|
"express": "^4.17.1",
|
|
25
25
|
"express-mung": "^0.5.1",
|
|
26
26
|
"http-proxy-middleware": "^1.0.6",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"uuid": "^3.4.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@forge/manifest": "^3.3.0-next.
|
|
34
|
+
"@forge/manifest": "^3.3.0-next.3",
|
|
35
35
|
"@types/express": "^4.17.2",
|
|
36
36
|
"@types/express-mung": "^0.5.2",
|
|
37
37
|
"@types/jest": "^26.0.0",
|