@forge/tunnel 1.5.3-next.2 → 1.6.0-next.11

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 CHANGED
@@ -1,5 +1,80 @@
1
1
  # @forge/tunnel
2
2
 
3
+ ## 1.6.0-next.11
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [cf2420d2]
8
+ - @forge/cli-shared@2.3.0-next.9
9
+ - @forge/bundler@3.0.1-next.10
10
+
11
+ ## 1.6.0-next.10
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [b6730093]
16
+ - @forge/runtime@1.15.0-next.3
17
+
18
+ ## 1.6.0-next.9
19
+
20
+ ### Patch Changes
21
+
22
+ - @forge/cli-shared@2.3.0-next.8
23
+ - @forge/bundler@3.0.1-next.9
24
+
25
+ ## 1.6.0-next.8
26
+
27
+ ### Patch Changes
28
+
29
+ - ca79652: Improve observability
30
+ - Updated dependencies [ca79652]
31
+ - @forge/runtime@1.15.0-next.2
32
+ - @forge/cli-shared@2.3.0-next.7
33
+ - @forge/bundler@3.0.1-next.8
34
+
35
+ ## 1.6.0-next.7
36
+
37
+ ### Patch Changes
38
+
39
+ - Updated dependencies [e95919f]
40
+ - @forge/csp@1.10.0-next.1
41
+ - @forge/cli-shared@2.3.0-next.6
42
+ - @forge/bundler@3.0.1-next.7
43
+
44
+ ## 1.6.0-next.6
45
+
46
+ ### Patch Changes
47
+
48
+ - @forge/cli-shared@2.3.0-next.5
49
+ - @forge/bundler@3.0.1-next.6
50
+
51
+ ## 1.6.0-next.5
52
+
53
+ ### Patch Changes
54
+
55
+ - @forge/cli-shared@2.3.0-next.4
56
+ - @forge/bundler@3.0.1-next.5
57
+
58
+ ## 1.6.0-next.4
59
+
60
+ ### Minor Changes
61
+
62
+ - cee5eea: Observability improvements
63
+
64
+ ### Patch Changes
65
+
66
+ - Updated dependencies [cee5eea]
67
+ - @forge/runtime@1.15.0-next.1
68
+ - @forge/cli-shared@2.3.0-next.3
69
+ - @forge/bundler@3.0.1-next.4
70
+
71
+ ## 1.5.3-next.3
72
+
73
+ ### Patch Changes
74
+
75
+ - @forge/cli-shared@2.3.0-next.2
76
+ - @forge/bundler@3.0.1-next.3
77
+
3
78
  ## 1.5.3-next.2
4
79
 
5
80
  ### Patch Changes
@@ -49,7 +49,7 @@ class LocalFunctionHost {
49
49
  bundleFileSourceMapPath: path_1.resolve(directory, `${bundleName}.js.map`),
50
50
  bundleFileSourceMap: bundledCode.sourceMap ? bundledCode.sourceMap[bundleName] : undefined
51
51
  }));
52
- const manifestFilePath = path_1.resolve(directory, cli_shared_1.manifestFilename);
52
+ const manifestFilePath = path_1.resolve(directory, cli_shared_1.manifestFileName);
53
53
  const manifestContents = JSON.stringify(await this.configFile.readConfig());
54
54
  const allPromises = [];
55
55
  bundles.forEach((bundle) => allPromises.push(this.generateBundleFiles(bundle, isSnapshotEnabled)));
@@ -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 body = await this.invocationService.invoke(request.handler, request);
31
- res.json(body);
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;AAE9E,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;CA+CjF"}
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;CAsDjF"}
@@ -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,17 @@ 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
- return body;
53
+ const reportMetrics = xenInvocationRequest.isFeatureFlagEnabled(feature_flag_1.XEN_RUNTIME_SHOULD_REPORT_METRICS);
54
+ if (reportMetrics && metrics) {
55
+ this.logger.debug(`Metrics: ${JSON.stringify(metrics, null, 2)}`);
56
+ }
57
+ return reportMetrics ? { body, metrics } : body;
53
58
  }
54
59
  }
55
60
  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;CACrB;AAED,UAAU,oBAAqB,SAAQ,KAAK;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,aAAa,UAAW,oBAAoB,KAAG,WAO3D,CAAC;AAEF,eAAO,MAAM,YAAY,Y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@ 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.5.3-next.2",
3
+ "version": "1.6.0-next.11",
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.2",
20
- "@forge/cli-shared": "2.3.0-next.1",
21
- "@forge/csp": "^1.10.0-next.0",
19
+ "@forge/bundler": "3.0.1-next.10",
20
+ "@forge/cli-shared": "2.3.0-next.9",
21
+ "@forge/csp": "^1.10.0-next.1",
22
22
  "@forge/isolated-vm": "3.3.10",
23
- "@forge/runtime": "1.14.1-next.0",
23
+ "@forge/runtime": "1.15.0-next.3",
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.0",
34
+ "@forge/manifest": "^3.3.0-next.7",
35
35
  "@types/express": "^4.17.2",
36
36
  "@types/express-mung": "^0.5.2",
37
37
  "@types/jest": "^26.0.0",