@forge/tunnel 1.5.3-next.3 → 1.6.0-next.12

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,82 @@
1
1
  # @forge/tunnel
2
2
 
3
+ ## 1.6.0-next.12
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [47a71a62]
8
+ - @forge/cli-shared@2.3.0-next.10
9
+ - @forge/runtime@1.15.0-next.4
10
+ - @forge/bundler@3.0.1-next.11
11
+
12
+ ## 1.6.0-next.11
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [cf2420d2]
17
+ - @forge/cli-shared@2.3.0-next.9
18
+ - @forge/bundler@3.0.1-next.10
19
+
20
+ ## 1.6.0-next.10
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies [b6730093]
25
+ - @forge/runtime@1.15.0-next.3
26
+
27
+ ## 1.6.0-next.9
28
+
29
+ ### Patch Changes
30
+
31
+ - @forge/cli-shared@2.3.0-next.8
32
+ - @forge/bundler@3.0.1-next.9
33
+
34
+ ## 1.6.0-next.8
35
+
36
+ ### Patch Changes
37
+
38
+ - ca79652: Improve observability
39
+ - Updated dependencies [ca79652]
40
+ - @forge/runtime@1.15.0-next.2
41
+ - @forge/cli-shared@2.3.0-next.7
42
+ - @forge/bundler@3.0.1-next.8
43
+
44
+ ## 1.6.0-next.7
45
+
46
+ ### Patch Changes
47
+
48
+ - Updated dependencies [e95919f]
49
+ - @forge/csp@1.10.0-next.1
50
+ - @forge/cli-shared@2.3.0-next.6
51
+ - @forge/bundler@3.0.1-next.7
52
+
53
+ ## 1.6.0-next.6
54
+
55
+ ### Patch Changes
56
+
57
+ - @forge/cli-shared@2.3.0-next.5
58
+ - @forge/bundler@3.0.1-next.6
59
+
60
+ ## 1.6.0-next.5
61
+
62
+ ### Patch Changes
63
+
64
+ - @forge/cli-shared@2.3.0-next.4
65
+ - @forge/bundler@3.0.1-next.5
66
+
67
+ ## 1.6.0-next.4
68
+
69
+ ### Minor Changes
70
+
71
+ - cee5eea: Observability improvements
72
+
73
+ ### Patch Changes
74
+
75
+ - Updated dependencies [cee5eea]
76
+ - @forge/runtime@1.15.0-next.1
77
+ - @forge/cli-shared@2.3.0-next.3
78
+ - @forge/bundler@3.0.1-next.4
79
+
3
80
  ## 1.5.3-next.3
4
81
 
5
82
  ### 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,o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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.5.3-next.3",
3
+ "version": "1.6.0-next.12",
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.3",
20
- "@forge/cli-shared": "2.3.0-next.2",
21
- "@forge/csp": "^1.10.0-next.0",
19
+ "@forge/bundler": "3.0.1-next.11",
20
+ "@forge/cli-shared": "2.3.0-next.10",
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.4",
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.1",
34
+ "@forge/manifest": "^3.3.0-next.8",
35
35
  "@types/express": "^4.17.2",
36
36
  "@types/express-mung": "^0.5.2",
37
37
  "@types/jest": "^26.0.0",