@forge/tunnel 3.8.0-next.8 → 3.8.0

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,259 @@
1
1
  # @forge/tunnel
2
2
 
3
+ ## 3.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - bd192806: Added ngrok config option to tunnel
8
+
9
+ ### Patch Changes
10
+
11
+ - 3a516891: Allow function timeout to be determined by payload in tunnel
12
+ - efffc256: Bumping dependencies via Renovate:
13
+
14
+ - @types/node
15
+
16
+ - c1c5fb59: Bumping dependencies via Renovate:
17
+
18
+ - @types/node
19
+
20
+ - 6f4e2f01: Bumping dependencies via Renovate:
21
+
22
+ - @types/jest
23
+
24
+ - 3d8ad494: Bumping dependencies via Renovate:
25
+
26
+ - @atlassian/xen-test-util
27
+
28
+ - 2c1ee248: Bumping dependencies via Renovate:
29
+
30
+ - @types/tmp
31
+
32
+ - Updated dependencies [31dc4c57]
33
+ - Updated dependencies [0160dc8c]
34
+ - Updated dependencies [00a6d9d6]
35
+ - Updated dependencies [3a516891]
36
+ - Updated dependencies [f232da40]
37
+ - Updated dependencies [33e05f3f]
38
+ - Updated dependencies [3994557a]
39
+ - Updated dependencies [641b0551]
40
+ - Updated dependencies [4fc8a79b]
41
+ - Updated dependencies [083a487e]
42
+ - Updated dependencies [7aba0598]
43
+ - Updated dependencies [efffc256]
44
+ - Updated dependencies [feb7bf63]
45
+ - Updated dependencies [521fda43]
46
+ - Updated dependencies [5540b552]
47
+ - Updated dependencies [c1c5fb59]
48
+ - Updated dependencies [6f4e2f01]
49
+ - Updated dependencies [764d4c0f]
50
+ - Updated dependencies [6ec038fe]
51
+ - Updated dependencies [4268a819]
52
+ - Updated dependencies [7d3fb7aa]
53
+ - Updated dependencies [3d8ad494]
54
+ - Updated dependencies [cbba9bd4]
55
+ - Updated dependencies [9d9361e8]
56
+ - Updated dependencies [4523b9cc]
57
+ - Updated dependencies [e6d5a27f]
58
+ - Updated dependencies [9e921628]
59
+ - Updated dependencies [fe74dfbd]
60
+ - Updated dependencies [bd192806]
61
+ - Updated dependencies [2c1ee248]
62
+ - @forge/bundler@4.12.1
63
+ - @forge/cli-shared@3.19.0
64
+ - @forge/runtime@5.1.0
65
+ - @forge/csp@2.2.2
66
+
67
+ ## 3.8.0-next.29
68
+
69
+ ### Patch Changes
70
+
71
+ - Updated dependencies [7aba0598]
72
+ - @forge/cli-shared@3.19.0-next.22
73
+ - @forge/bundler@4.12.1-next.28
74
+
75
+ ## 3.8.0-next.28
76
+
77
+ ### Patch Changes
78
+
79
+ - Updated dependencies [e6d5a27f]
80
+ - @forge/cli-shared@3.19.0-next.21
81
+ - @forge/bundler@4.12.1-next.27
82
+
83
+ ## 3.8.0-next.27
84
+
85
+ ### Patch Changes
86
+
87
+ - Updated dependencies [0160dc8c]
88
+ - Updated dependencies [083a487e]
89
+ - @forge/cli-shared@3.19.0-next.20
90
+ - @forge/bundler@4.12.1-next.26
91
+
92
+ ## 3.8.0-next.26
93
+
94
+ ### Patch Changes
95
+
96
+ - 3d8ad494: Bumping dependencies via Renovate:
97
+
98
+ - @atlassian/xen-test-util
99
+
100
+ - Updated dependencies [3d8ad494]
101
+ - @forge/bundler@4.12.1-next.25
102
+ - @forge/cli-shared@3.19.0-next.19
103
+
104
+ ## 3.8.0-next.25
105
+
106
+ ### Patch Changes
107
+
108
+ - @forge/cli-shared@3.19.0-next.18
109
+ - @forge/bundler@4.12.1-next.24
110
+
111
+ ## 3.8.0-next.24
112
+
113
+ ### Patch Changes
114
+
115
+ - @forge/cli-shared@3.19.0-next.17
116
+ - @forge/bundler@4.12.1-next.23
117
+
118
+ ## 3.8.0-next.23
119
+
120
+ ### Patch Changes
121
+
122
+ - 2c1ee248: Bumping dependencies via Renovate:
123
+
124
+ - @types/tmp
125
+
126
+ - Updated dependencies [f232da40]
127
+ - Updated dependencies [2c1ee248]
128
+ - @forge/cli-shared@3.19.0-next.16
129
+ - @forge/bundler@4.12.1-next.22
130
+
131
+ ## 3.8.0-next.22
132
+
133
+ ### Patch Changes
134
+
135
+ - Updated dependencies [31dc4c57]
136
+ - @forge/bundler@4.12.1-next.21
137
+
138
+ ## 3.8.0-next.21
139
+
140
+ ### Patch Changes
141
+
142
+ - Updated dependencies [764d4c0f]
143
+ - @forge/cli-shared@3.19.0-next.15
144
+ - @forge/bundler@4.12.1-next.20
145
+
146
+ ## 3.8.0-next.20
147
+
148
+ ### Patch Changes
149
+
150
+ - 3a516891: Allow function timeout to be determined by payload in tunnel
151
+ - Updated dependencies [3a516891]
152
+ - @forge/runtime@5.1.0-next.7
153
+ - @forge/bundler@4.12.1-next.19
154
+
155
+ ## 3.8.0-next.19
156
+
157
+ ### Patch Changes
158
+
159
+ - 6f4e2f01: Bumping dependencies via Renovate:
160
+
161
+ - @types/jest
162
+
163
+ - Updated dependencies [6f4e2f01]
164
+ - Updated dependencies [4523b9cc]
165
+ - @forge/bundler@4.12.1-next.18
166
+ - @forge/cli-shared@3.19.0-next.14
167
+ - @forge/csp@2.2.2-next.3
168
+ - @forge/runtime@5.1.0-next.6
169
+
170
+ ## 3.8.0-next.18
171
+
172
+ ### Patch Changes
173
+
174
+ - Updated dependencies [9d9361e8]
175
+ - @forge/cli-shared@3.19.0-next.13
176
+ - @forge/runtime@5.1.0-next.5
177
+ - @forge/bundler@4.12.1-next.17
178
+
179
+ ## 3.8.0-next.17
180
+
181
+ ### Patch Changes
182
+
183
+ - efffc256: Bumping dependencies via Renovate:
184
+
185
+ - @types/node
186
+
187
+ - Updated dependencies [efffc256]
188
+ - @forge/bundler@4.12.1-next.16
189
+ - @forge/cli-shared@3.19.0-next.12
190
+ - @forge/csp@2.2.2-next.2
191
+ - @forge/runtime@5.1.0-next.4
192
+
193
+ ## 3.8.0-next.16
194
+
195
+ ### Patch Changes
196
+
197
+ - Updated dependencies [641b0551]
198
+ - Updated dependencies [9e921628]
199
+ - @forge/cli-shared@3.19.0-next.11
200
+ - @forge/runtime@5.1.0-next.3
201
+ - @forge/bundler@4.12.1-next.15
202
+
203
+ ## 3.8.0-next.15
204
+
205
+ ### Patch Changes
206
+
207
+ - Updated dependencies [33e05f3f]
208
+ - @forge/csp@2.2.2-next.1
209
+
210
+ ## 3.8.0-next.14
211
+
212
+ ### Patch Changes
213
+
214
+ - Updated dependencies [4fc8a79b]
215
+ - Updated dependencies [feb7bf63]
216
+ - @forge/runtime@5.1.0-next.2
217
+ - @forge/cli-shared@3.19.0-next.10
218
+ - @forge/bundler@4.12.1-next.14
219
+
220
+ ## 3.8.0-next.13
221
+
222
+ ### Patch Changes
223
+
224
+ - Updated dependencies [cbba9bd4]
225
+ - @forge/cli-shared@3.19.0-next.9
226
+ - @forge/bundler@4.12.1-next.13
227
+
228
+ ## 3.8.0-next.12
229
+
230
+ ### Patch Changes
231
+
232
+ - @forge/cli-shared@3.19.0-next.8
233
+ - @forge/bundler@4.12.1-next.12
234
+
235
+ ## 3.8.0-next.11
236
+
237
+ ### Patch Changes
238
+
239
+ - @forge/cli-shared@3.19.0-next.7
240
+ - @forge/bundler@4.12.1-next.11
241
+
242
+ ## 3.8.0-next.10
243
+
244
+ ### Patch Changes
245
+
246
+ - Updated dependencies [00a6d9d6]
247
+ - @forge/runtime@5.1.0-next.1
248
+ - @forge/bundler@4.12.1-next.10
249
+
250
+ ## 3.8.0-next.9
251
+
252
+ ### Patch Changes
253
+
254
+ - @forge/cli-shared@3.19.0-next.6
255
+ - @forge/bundler@4.12.1-next.9
256
+
3
257
  ## 3.8.0-next.8
4
258
 
5
259
  ### Minor Changes
@@ -11,7 +11,6 @@ export interface Bundle {
11
11
  bundleFileSourceMapPath: string;
12
12
  bundleFileSourceMap?: string;
13
13
  }
14
- export declare const INVOCATION_TIMEOUT = 25;
15
14
  export declare const MEMORY_LIMIT = 256;
16
15
  export declare class LocalFunctionHost implements FunctionChangeWatcher {
17
16
  private readonly configFile;
@@ -1 +1 @@
1
- {"version":3,"file":"function-change-watcher.d.ts","sour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ts","sourceRoot":"","sources":["../../../src/command/interactors/function-change-watcher.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAA8B,MAAM,EAAqB,MAAM,mBAAmB,CAAC;AACtG,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAIL,OAAO,EACP,aAAa,EACb,eAAe,EAChB,MAAM,gBAAgB,CAAC;AAIxB,MAAM,WAAW,qBAAqB;IACpC,aAAa,CAAC,WAAW,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,MAAM;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,uBAAuB,EAAE,MAAM,CAAC;IAChC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,eAAO,MAAM,YAAY,MAAM,CAAC;AAEhC,qBAAa,iBAAkB,YAAW,qBAAqB;IAI3D,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,aAAa;IANhC,OAAO,CAAC,YAAY,CAA8C;gBAG/C,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,eAAe,GAAG,IAAI,EAChC,aAAa,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,OAAO,CAAC,OAAO,CAAC;YAG5D,mBAAmB;IA2BpB,aAAa,CAAC,WAAW,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IA+CxD,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAI1C,OAAO,CAAC,YAAY,CAElB;YAEY,mBAAmB;CAqBlC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LocalFunctionHost = exports.MEMORY_LIMIT = exports.INVOCATION_TIMEOUT = void 0;
3
+ exports.LocalFunctionHost = exports.MEMORY_LIMIT = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const path_1 = require("path");
6
6
  const fs_1 = require("fs");
@@ -8,7 +8,6 @@ const tmp_1 = tslib_1.__importDefault(require("tmp"));
8
8
  const cli_shared_1 = require("@forge/cli-shared");
9
9
  const runtime_1 = require("@forge/runtime");
10
10
  const util_1 = require("../../util");
11
- exports.INVOCATION_TIMEOUT = 25;
12
11
  exports.MEMORY_LIMIT = 256;
13
12
  class LocalFunctionHost {
14
13
  constructor(configFile, logger, snapshot, createSandbox) {
@@ -93,7 +92,6 @@ class LocalFunctionHost {
93
92
  modName: module,
94
93
  appPath: srcPath,
95
94
  handler: func,
96
- timeout: exports.INVOCATION_TIMEOUT,
97
95
  isolateMemory: exports.MEMORY_LIMIT
98
96
  });
99
97
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"local-invocation-service.d.ts","sourceRoot":"","sources":["../../src/services/local-invocation-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAI/C,OAAO,EACL,mBAAmB,EACnB,SAAS,EAKV,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;IA2DhF,MAAM,CAAC,gBAAgB,WAA6D;IAEpF,MAAM,CAAC,YAAY,wBACI,OAAO;;6BAEpB,MAAM,KACb,IAAI,CAUL;CACH"}
1
+ {"version":3,"file":"local-invocation-service.d.ts","sourceRoot":"","sources":["../../src/services/local-invocation-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAI/C,OAAO,EACL,mBAAmB,EACnB,SAAS,EAKV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,EAAyB,MAAM,mBAAmB,CAAC;AAI9E,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;IA4DhF,MAAM,CAAC,gBAAgB,WAA6D;IAEpF,MAAM,CAAC,YAAY,wBACI,OAAO;;6BAEpB,MAAM,KACb,IAAI,CAUL;CACH"}
@@ -7,7 +7,7 @@ const index_1 = require("../index");
7
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
- const interactors_1 = require("../command/interactors");
10
+ const DEFAULT_INVOCATION_TIMEOUT = 25;
11
11
  class LocalInvocationService {
12
12
  constructor(configFile, logger, inspector) {
13
13
  this.configFile = configFile;
@@ -15,6 +15,7 @@ class LocalInvocationService {
15
15
  this.inspector = inspector;
16
16
  }
17
17
  async invoke(handler, request) {
18
+ var _a;
18
19
  this.logger.info('');
19
20
  this.logger.info((0, util_1.formatInvocation)(handler, request));
20
21
  const sandbox = util_1.SandboxesContainer.get()[handler];
@@ -38,21 +39,22 @@ class LocalInvocationService {
38
39
  variables.push({ key: 'FUNCTION_IS_SNAPSHOTTED', value: isSnapshotEnabled.toString(), secure: false });
39
40
  }
40
41
  const requestId = (0, util_1.getRequestId)(request, (0, v4_1.default)());
42
+ const timeout = (_a = request._meta.timeout) !== null && _a !== void 0 ? _a : DEFAULT_INVOCATION_TIMEOUT;
41
43
  const xenInvocationRequest = (0, runtime_1.xenInvocationRequestFactory)({
42
44
  request: Object.assign(Object.assign({}, request), { variables }),
43
- ctx: { requestId, traceId: requestId, timeout: interactors_1.INVOCATION_TIMEOUT }
45
+ ctx: { requestId, traceId: requestId, timeout }
44
46
  });
45
47
  const invocationLimits = (0, runtime_1.perInvocationLimitsTrackerFactory)(xenInvocationRequest);
46
- const timeout = setTimeout(() => {
47
- this.logger.warn(cli_shared_1.Text.tunnel.invocationTimeout(interactors_1.INVOCATION_TIMEOUT));
48
- }, interactors_1.INVOCATION_TIMEOUT * 1000);
48
+ const tunnelWarningTimeout = setTimeout(() => {
49
+ this.logger.warn(cli_shared_1.Text.tunnel.invocationTimeout(timeout));
50
+ }, timeout * 1000);
49
51
  const { body, metrics, success, error } = await (0, runtime_1.invoke)({
50
52
  sandbox,
51
53
  xenInvocationRequest,
52
54
  invocationLimits,
53
55
  inspector: inspect ? this.inspector : undefined
54
56
  });
55
- clearTimeout(timeout);
57
+ clearTimeout(tunnelWarningTimeout);
56
58
  const reportMetrics = xenInvocationRequest.isFeatureFlagEnabled(runtime_1.XEN_RUNTIME_SHOULD_REPORT_METRICS);
57
59
  LocalInvocationService.printMetrics(reportMetrics, metrics, this.logger);
58
60
  return reportMetrics ? { body, metrics, success, error } : body;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/tunnel",
3
- "version": "3.8.0-next.8",
3
+ "version": "3.8.0",
4
4
  "description": "Tunnel functionality for Forge CLI",
5
5
  "author": "Atlassian",
6
6
  "license": "UNLICENSED",
@@ -11,10 +11,10 @@
11
11
  "compile": "tsc -b -v"
12
12
  },
13
13
  "dependencies": {
14
- "@forge/bundler": "4.12.1-next.8",
15
- "@forge/cli-shared": "3.19.0-next.5",
16
- "@forge/csp": "2.2.2-next.0",
17
- "@forge/runtime": "5.0.2-next.0",
14
+ "@forge/bundler": "4.12.1",
15
+ "@forge/cli-shared": "3.19.0",
16
+ "@forge/csp": "2.2.2",
17
+ "@forge/runtime": "5.1.0",
18
18
  "express": "^4.18.2",
19
19
  "express-intercept": "^1.1.0",
20
20
  "http-proxy-middleware": "^1.3.1",
@@ -26,13 +26,13 @@
26
26
  "webpack-dev-server": "^4.15.1"
27
27
  },
28
28
  "devDependencies": {
29
- "@atlassian/xen-test-util": "^3.0.5",
30
- "@forge/manifest": "4.20.1-next.1",
29
+ "@atlassian/xen-test-util": "^3.1.0",
30
+ "@forge/manifest": "4.20.1",
31
31
  "@types/express": "^4.17.17",
32
- "@types/jest": "^29.5.4",
33
- "@types/node": "14.18.59",
32
+ "@types/jest": "^29.5.5",
33
+ "@types/node": "14.18.61",
34
34
  "@types/supertest": "^2.0.12",
35
- "@types/tmp": "^0.2.3",
35
+ "@types/tmp": "^0.2.4",
36
36
  "@types/uuid": "^3.4.11",
37
37
  "supertest": "^6.3.3"
38
38
  }