@forge/tunnel 0.0.0-experimental-e739c13 → 0.0.0-experimental-9fff5da
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 +337 -7
- package/out/index.d.ts.map +1 -1
- package/out/index.js +1 -1
- package/out/tunnelling/command/start-tunnel-command.js +2 -2
- package/out/tunnelling/graphql/tunnel-graphql-client.js +2 -2
- package/out/tunnelling/index.d.ts +2 -0
- package/out/tunnelling/index.d.ts.map +1 -1
- package/out/tunnelling/index.js +5 -1
- package/out/tunnelling/servers/dev-server.d.ts +4 -3
- package/out/tunnelling/servers/dev-server.d.ts.map +1 -1
- package/out/tunnelling/servers/dev-server.js +10 -3
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,345 @@
|
|
|
1
1
|
# @forge/tunnel
|
|
2
2
|
|
|
3
|
-
## 0.0.0-experimental-
|
|
3
|
+
## 0.0.0-experimental-9fff5da
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
- Updated dependencies [
|
|
8
|
-
- Updated dependencies [
|
|
9
|
-
-
|
|
10
|
-
- @forge/
|
|
11
|
-
- @forge/
|
|
12
|
-
|
|
7
|
+
- Updated dependencies [b7fc722]
|
|
8
|
+
- Updated dependencies [b050beb]
|
|
9
|
+
- @forge/runtime@0.0.0-experimental-9fff5da
|
|
10
|
+
- @forge/cli-shared@0.0.0-experimental-9fff5da
|
|
11
|
+
- @forge/bundler@0.0.0-experimental-9fff5da
|
|
12
|
+
|
|
13
|
+
## 1.4.5-next.0
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [b050beb]
|
|
18
|
+
- @forge/runtime@1.8.0-next.0
|
|
19
|
+
- @forge/cli-shared@2.1.2-next.0
|
|
20
|
+
- @forge/bundler@1.0.17-next.0
|
|
21
|
+
|
|
22
|
+
## 1.4.4
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies [9fe841c]
|
|
27
|
+
- Updated dependencies [4178c57]
|
|
28
|
+
- Updated dependencies [4b41a80]
|
|
29
|
+
- Updated dependencies [ae076c2]
|
|
30
|
+
- @forge/runtime@1.7.0
|
|
31
|
+
- @forge/cli-shared@2.1.1
|
|
32
|
+
- @forge/csp@1.7.1
|
|
33
|
+
- @forge/bundler@1.0.16
|
|
34
|
+
|
|
35
|
+
## 1.4.4-next.10
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- @forge/cli-shared@2.1.1-next.7
|
|
40
|
+
- @forge/bundler@1.0.16-next.8
|
|
41
|
+
|
|
42
|
+
## 1.4.4-next.9
|
|
43
|
+
|
|
44
|
+
### Patch Changes
|
|
45
|
+
|
|
46
|
+
- @forge/cli-shared@2.1.1-next.6
|
|
47
|
+
- @forge/bundler@1.0.16-next.7
|
|
48
|
+
|
|
49
|
+
## 1.4.4-next.8
|
|
50
|
+
|
|
51
|
+
### Patch Changes
|
|
52
|
+
|
|
53
|
+
- @forge/bundler@1.0.16-next.6
|
|
54
|
+
|
|
55
|
+
## 1.4.4-next.7
|
|
56
|
+
|
|
57
|
+
### Patch Changes
|
|
58
|
+
|
|
59
|
+
- @forge/cli-shared@2.1.1-next.5
|
|
60
|
+
- @forge/bundler@1.0.16-next.5
|
|
61
|
+
|
|
62
|
+
## 1.4.4-next.6
|
|
63
|
+
|
|
64
|
+
### Patch Changes
|
|
65
|
+
|
|
66
|
+
- Updated dependencies [4b41a80]
|
|
67
|
+
- @forge/cli-shared@2.1.1-next.4
|
|
68
|
+
- @forge/csp@1.7.1-next.0
|
|
69
|
+
- @forge/bundler@1.0.16-next.4
|
|
70
|
+
- @forge/runtime@1.7.0-next.2
|
|
71
|
+
|
|
72
|
+
## 1.4.4-next.5
|
|
73
|
+
|
|
74
|
+
### Patch Changes
|
|
75
|
+
|
|
76
|
+
- @forge/cli-shared@2.1.1-next.3
|
|
77
|
+
- @forge/bundler@1.0.16-next.3
|
|
78
|
+
|
|
79
|
+
## 1.4.4-next.4
|
|
80
|
+
|
|
81
|
+
### Patch Changes
|
|
82
|
+
|
|
83
|
+
- Updated dependencies [ae076c2]
|
|
84
|
+
- @forge/cli-shared@2.1.1-next.2
|
|
85
|
+
- @forge/bundler@1.0.16-next.2
|
|
86
|
+
|
|
87
|
+
## 1.4.4-next.3
|
|
88
|
+
|
|
89
|
+
### Patch Changes
|
|
90
|
+
|
|
91
|
+
- Updated dependencies [4178c57]
|
|
92
|
+
- @forge/runtime@1.7.0-next.1
|
|
93
|
+
|
|
94
|
+
## 1.4.4-next.2
|
|
95
|
+
|
|
96
|
+
### Patch Changes
|
|
97
|
+
|
|
98
|
+
- @forge/cli-shared@2.1.1-next.1
|
|
99
|
+
- @forge/bundler@1.0.16-next.1
|
|
100
|
+
|
|
101
|
+
## 1.4.4-next.1
|
|
102
|
+
|
|
103
|
+
### Patch Changes
|
|
104
|
+
|
|
105
|
+
- @forge/cli-shared@2.1.1-next.0
|
|
106
|
+
- @forge/bundler@1.0.16-next.0
|
|
107
|
+
|
|
108
|
+
## 1.4.4-next.0
|
|
109
|
+
|
|
110
|
+
### Patch Changes
|
|
111
|
+
|
|
112
|
+
- Updated dependencies [767d40d]
|
|
113
|
+
- @forge/runtime@1.7.0-next.0
|
|
114
|
+
|
|
115
|
+
## 1.4.3
|
|
116
|
+
|
|
117
|
+
### Patch Changes
|
|
118
|
+
|
|
119
|
+
- Updated dependencies [0571cfa]
|
|
120
|
+
- Updated dependencies [9ff0508]
|
|
121
|
+
- Updated dependencies [a5797b3]
|
|
122
|
+
- @forge/runtime@1.6.1
|
|
123
|
+
- @forge/cli-shared@2.1.0
|
|
124
|
+
- @forge/bundler@1.0.15
|
|
125
|
+
|
|
126
|
+
## 1.4.3-next.8
|
|
127
|
+
|
|
128
|
+
### Patch Changes
|
|
129
|
+
|
|
130
|
+
- @forge/cli-shared@2.1.0-next.6
|
|
131
|
+
- @forge/bundler@1.0.15-next.7
|
|
132
|
+
|
|
133
|
+
## 1.4.3-next.7
|
|
134
|
+
|
|
135
|
+
### Patch Changes
|
|
136
|
+
|
|
137
|
+
- @forge/cli-shared@2.1.0-next.5
|
|
138
|
+
- @forge/bundler@1.0.15-next.6
|
|
139
|
+
|
|
140
|
+
## 1.4.3-next.6
|
|
141
|
+
|
|
142
|
+
### Patch Changes
|
|
143
|
+
|
|
144
|
+
- @forge/cli-shared@2.1.0-next.4
|
|
145
|
+
- @forge/bundler@1.0.15-next.5
|
|
146
|
+
|
|
147
|
+
## 1.4.3-next.5
|
|
148
|
+
|
|
149
|
+
### Patch Changes
|
|
150
|
+
|
|
151
|
+
- Updated dependencies [9ff0508]
|
|
152
|
+
- @forge/cli-shared@2.1.0-next.3
|
|
153
|
+
- @forge/bundler@1.0.15-next.4
|
|
154
|
+
|
|
155
|
+
## 1.4.3-next.4
|
|
156
|
+
|
|
157
|
+
### Patch Changes
|
|
158
|
+
|
|
159
|
+
- @forge/bundler@1.0.15-next.3
|
|
160
|
+
|
|
161
|
+
## 1.4.3-next.3
|
|
162
|
+
|
|
163
|
+
### Patch Changes
|
|
164
|
+
|
|
165
|
+
- @forge/cli-shared@2.1.0-next.2
|
|
166
|
+
- @forge/bundler@1.0.15-next.2
|
|
167
|
+
|
|
168
|
+
## 1.4.3-next.2
|
|
169
|
+
|
|
170
|
+
### Patch Changes
|
|
171
|
+
|
|
172
|
+
- Updated dependencies [0571cfa]
|
|
173
|
+
- @forge/runtime@1.6.1-next.0
|
|
174
|
+
|
|
175
|
+
## 1.4.3-next.1
|
|
176
|
+
|
|
177
|
+
### Patch Changes
|
|
178
|
+
|
|
179
|
+
- Updated dependencies [a5797b3]
|
|
180
|
+
- @forge/cli-shared@2.1.0-next.1
|
|
181
|
+
- @forge/bundler@1.0.15-next.1
|
|
182
|
+
|
|
183
|
+
## 1.4.3-next.0
|
|
184
|
+
|
|
185
|
+
### Patch Changes
|
|
186
|
+
|
|
187
|
+
- @forge/bundler@1.0.15-next.0
|
|
188
|
+
- @forge/cli-shared@2.0.1-next.0
|
|
189
|
+
|
|
190
|
+
## 1.4.2
|
|
191
|
+
|
|
192
|
+
### Patch Changes
|
|
193
|
+
|
|
194
|
+
- 8606a9f: Fix client headers
|
|
195
|
+
- 88ee5f0: Adding External Auth
|
|
196
|
+
- 0700578: Fix GraphQL query naming convention
|
|
197
|
+
- Updated dependencies [9d9c302]
|
|
198
|
+
- Updated dependencies [742b6b2]
|
|
199
|
+
- Updated dependencies [fce32a0]
|
|
200
|
+
- Updated dependencies [1a759c3]
|
|
201
|
+
- Updated dependencies [bfc9f8c]
|
|
202
|
+
- Updated dependencies [88ee5f0]
|
|
203
|
+
- Updated dependencies [c0b25b5]
|
|
204
|
+
- Updated dependencies [0aeac8c]
|
|
205
|
+
- Updated dependencies [aa649a4]
|
|
206
|
+
- Updated dependencies [898efdc]
|
|
207
|
+
- Updated dependencies [0700578]
|
|
208
|
+
- Updated dependencies [3c47373]
|
|
209
|
+
- Updated dependencies [084a9f5]
|
|
210
|
+
- @forge/cli-shared@2.0.0
|
|
211
|
+
- @forge/runtime@1.6.0
|
|
212
|
+
- @forge/isolated-vm@3.3.10
|
|
213
|
+
- @forge/bundler@1.0.14
|
|
214
|
+
|
|
215
|
+
## 1.4.2-next.19
|
|
216
|
+
|
|
217
|
+
### Patch Changes
|
|
218
|
+
|
|
219
|
+
- Updated dependencies [3c47373]
|
|
220
|
+
- @forge/cli-shared@2.0.0-next.16
|
|
221
|
+
- @forge/bundler@1.0.14-next.16
|
|
222
|
+
|
|
223
|
+
## 1.4.2-next.18
|
|
224
|
+
|
|
225
|
+
### Patch Changes
|
|
226
|
+
|
|
227
|
+
- Updated dependencies [898efdc]
|
|
228
|
+
- @forge/isolated-vm@3.3.10-next.0
|
|
229
|
+
- @forge/runtime@1.6.0-next.6
|
|
230
|
+
|
|
231
|
+
## 1.4.2-next.17
|
|
232
|
+
|
|
233
|
+
### Patch Changes
|
|
234
|
+
|
|
235
|
+
- Updated dependencies [aa649a4]
|
|
236
|
+
- @forge/runtime@1.6.0-next.5
|
|
237
|
+
- @forge/cli-shared@2.0.0-next.15
|
|
238
|
+
- @forge/bundler@1.0.14-next.15
|
|
239
|
+
|
|
240
|
+
## 1.4.2-next.16
|
|
241
|
+
|
|
242
|
+
### Patch Changes
|
|
243
|
+
|
|
244
|
+
- @forge/cli-shared@2.0.0-next.14
|
|
245
|
+
- @forge/bundler@1.0.14-next.14
|
|
246
|
+
|
|
247
|
+
## 1.4.2-next.15
|
|
248
|
+
|
|
249
|
+
### Patch Changes
|
|
250
|
+
|
|
251
|
+
- Updated dependencies [9d9c302]
|
|
252
|
+
- @forge/cli-shared@2.0.0-next.13
|
|
253
|
+
- @forge/bundler@1.0.14-next.13
|
|
254
|
+
|
|
255
|
+
## 1.4.2-next.14
|
|
256
|
+
|
|
257
|
+
### Patch Changes
|
|
258
|
+
|
|
259
|
+
- 8606a9f: Fix client headers
|
|
260
|
+
- Updated dependencies [c0b25b5]
|
|
261
|
+
- Updated dependencies [084a9f5]
|
|
262
|
+
- @forge/cli-shared@2.0.0-next.12
|
|
263
|
+
- @forge/runtime@1.6.0-next.4
|
|
264
|
+
- @forge/bundler@1.0.14-next.12
|
|
265
|
+
|
|
266
|
+
## 1.4.2-next.13
|
|
267
|
+
|
|
268
|
+
### Patch Changes
|
|
269
|
+
|
|
270
|
+
- Updated dependencies [0aeac8c]
|
|
271
|
+
- @forge/cli-shared@2.0.0-next.11
|
|
272
|
+
- @forge/bundler@1.0.14-next.11
|
|
273
|
+
|
|
274
|
+
## 1.4.2-next.12
|
|
275
|
+
|
|
276
|
+
### Patch Changes
|
|
277
|
+
|
|
278
|
+
- 0700578: Fix GraphQL query naming convention
|
|
279
|
+
- Updated dependencies [0700578]
|
|
280
|
+
- @forge/cli-shared@2.0.0-next.10
|
|
281
|
+
- @forge/runtime@1.6.0-next.3
|
|
282
|
+
- @forge/bundler@1.0.14-next.10
|
|
283
|
+
|
|
284
|
+
## 1.4.2-next.11
|
|
285
|
+
|
|
286
|
+
### Patch Changes
|
|
287
|
+
|
|
288
|
+
- @forge/cli-shared@2.0.0-next.9
|
|
289
|
+
- @forge/bundler@1.0.14-next.9
|
|
290
|
+
|
|
291
|
+
## 1.4.2-next.10
|
|
292
|
+
|
|
293
|
+
### Patch Changes
|
|
294
|
+
|
|
295
|
+
- @forge/cli-shared@2.0.0-next.8
|
|
296
|
+
- @forge/bundler@1.0.14-next.8
|
|
297
|
+
|
|
298
|
+
## 1.4.2-next.9
|
|
299
|
+
|
|
300
|
+
### Patch Changes
|
|
301
|
+
|
|
302
|
+
- @forge/cli-shared@2.0.0-next.7
|
|
303
|
+
- @forge/bundler@1.0.14-next.7
|
|
304
|
+
|
|
305
|
+
## 1.4.2-next.8
|
|
306
|
+
|
|
307
|
+
### Patch Changes
|
|
308
|
+
|
|
309
|
+
- @forge/cli-shared@2.0.0-next.6
|
|
310
|
+
- @forge/bundler@1.0.14-next.6
|
|
311
|
+
|
|
312
|
+
## 1.4.2-next.7
|
|
313
|
+
|
|
314
|
+
### Patch Changes
|
|
315
|
+
|
|
316
|
+
- @forge/cli-shared@2.0.0-next.5
|
|
317
|
+
- @forge/bundler@1.0.14-next.5
|
|
318
|
+
|
|
319
|
+
## 1.4.2-next.6
|
|
320
|
+
|
|
321
|
+
### Patch Changes
|
|
322
|
+
|
|
323
|
+
- Updated dependencies [fce32a0]
|
|
324
|
+
- @forge/cli-shared@2.0.0-next.4
|
|
325
|
+
- @forge/bundler@1.0.14-next.4
|
|
326
|
+
|
|
327
|
+
## 1.4.2-next.5
|
|
328
|
+
|
|
329
|
+
### Patch Changes
|
|
330
|
+
|
|
331
|
+
- 88ee5f0: Adding External Auth
|
|
332
|
+
- Updated dependencies [88ee5f0]
|
|
333
|
+
- @forge/runtime@1.6.0-next.2
|
|
334
|
+
- @forge/cli-shared@1.5.0-next.3
|
|
335
|
+
- @forge/bundler@1.0.14-next.3
|
|
336
|
+
|
|
337
|
+
## 1.4.2-next.4
|
|
338
|
+
|
|
339
|
+
### Patch Changes
|
|
340
|
+
|
|
341
|
+
- @forge/cli-shared@1.5.0-next.2
|
|
342
|
+
- @forge/bundler@1.0.14-next.2
|
|
13
343
|
|
|
14
344
|
## 1.4.2-next.3
|
|
15
345
|
|
package/out/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AA+EA,eAAO,MAAM,SAAS,QAAa,OAAO,CAAC,IAAI,CAU9C,CAAC"}
|
package/out/index.js
CHANGED
|
@@ -17,7 +17,7 @@ const assertiveAppConfigReader = cli_shared_1.assertiveAppConfigProvider(appConf
|
|
|
17
17
|
const credentialsGetter = cli_shared_1.getCredentialsStoreProvider(ui);
|
|
18
18
|
const authenticator = new cli_shared_1.PersonalTokenAuthenticator(credentialsGetter);
|
|
19
19
|
const createGraphQLClient = (auth) => {
|
|
20
|
-
const minimalGraphQLRunner = new cli_shared_1.MinimalGraphQLRunner(auth, graphqlGateway,
|
|
20
|
+
const minimalGraphQLRunner = new cli_shared_1.MinimalGraphQLRunner(auth, graphqlGateway, tunnelling_1.getCliDetails());
|
|
21
21
|
const graphQLRunner = new cli_shared_1.DebuggingGraphqlRunner(minimalGraphQLRunner, graphqlGateway, ui);
|
|
22
22
|
return new cli_shared_1.MutationAwareGraphQLClient(graphQLRunner);
|
|
23
23
|
};
|
|
@@ -32,8 +32,8 @@ class StartTunnelCommand {
|
|
|
32
32
|
]);
|
|
33
33
|
};
|
|
34
34
|
this.startFaaSTunnelServer = async (port) => {
|
|
35
|
-
const { permissions = {} } = await this.configFile.readConfig();
|
|
36
|
-
const localPort = await this.devServer.start(port, permissions);
|
|
35
|
+
const { permissions = {}, remotes = [] } = await this.configFile.readConfig();
|
|
36
|
+
const localPort = await this.devServer.start(port, permissions, remotes);
|
|
37
37
|
const faasTunnelUrl = await this.tunnelFactory.establishTunnel(localPort);
|
|
38
38
|
return {
|
|
39
39
|
port: localPort,
|
|
@@ -19,7 +19,7 @@ class TunnelGraphqlClient {
|
|
|
19
19
|
}
|
|
20
20
|
async createAppTunnels(appId, environmentKey, tunnelDefinitions) {
|
|
21
21
|
const mutation = `
|
|
22
|
-
mutation
|
|
22
|
+
mutation forge_cli_createApplicationTunnels($input: CreateAppTunnelsInput!) {
|
|
23
23
|
createAppTunnels(input: $input) {
|
|
24
24
|
success
|
|
25
25
|
errors {
|
|
@@ -48,7 +48,7 @@ class TunnelGraphqlClient {
|
|
|
48
48
|
}
|
|
49
49
|
async deleteTunnels(appId, environmentKey) {
|
|
50
50
|
const mutation = `
|
|
51
|
-
mutation
|
|
51
|
+
mutation forge_cli_deleteApplicationTunnels($input: DeleteAppTunnelInput!) {
|
|
52
52
|
deleteAppTunnels(input: $input) {
|
|
53
53
|
success
|
|
54
54
|
errors {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { CLIDetails } from '@forge/cli-shared';
|
|
1
2
|
export declare const INSPECTOR_PORT: number;
|
|
2
3
|
export declare function isInspectorEnabled(): boolean;
|
|
4
|
+
export declare function getCliDetails(): CLIDetails | undefined;
|
|
3
5
|
export * from './services';
|
|
4
6
|
export * from './servers';
|
|
5
7
|
export * from './command';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tunnelling/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,QAEnB,CAAC;AAET,wBAAgB,kBAAkB,YAEjC;AAED,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tunnelling/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,eAAO,MAAM,cAAc,QAEnB,CAAC;AAET,wBAAgB,kBAAkB,YAEjC;AAED,wBAAgB,aAAa,IAAI,UAAU,GAAG,SAAS,CAEtD;AAED,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC"}
|
package/out/tunnelling/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isInspectorEnabled = exports.INSPECTOR_PORT = void 0;
|
|
3
|
+
exports.getCliDetails = exports.isInspectorEnabled = exports.INSPECTOR_PORT = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
exports.INSPECTOR_PORT = process.env.TUNNEL_INSPECTOR_PORT
|
|
6
6
|
? parseInt(process.env.TUNNEL_INSPECTOR_PORT, 10)
|
|
@@ -9,6 +9,10 @@ function isInspectorEnabled() {
|
|
|
9
9
|
return process.env.TUNNEL_INSPECTOR_ENABLED === 'true';
|
|
10
10
|
}
|
|
11
11
|
exports.isInspectorEnabled = isInspectorEnabled;
|
|
12
|
+
function getCliDetails() {
|
|
13
|
+
return process.env.CLIDetails ? JSON.parse(process.env.CLIDetails) : undefined;
|
|
14
|
+
}
|
|
15
|
+
exports.getCliDetails = getCliDetails;
|
|
12
16
|
tslib_1.__exportStar(require("./services"), exports);
|
|
13
17
|
tslib_1.__exportStar(require("./servers"), exports);
|
|
14
18
|
tslib_1.__exportStar(require("./command"), exports);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
import { Logger } from '@forge/cli-shared';
|
|
3
3
|
import { ExternalRequestBody } from '@forge/runtime';
|
|
4
|
-
import { Permissions } from '@forge/manifest';
|
|
4
|
+
import { Permissions, Remotes } from '@forge/manifest';
|
|
5
5
|
export interface DevelopmentServer {
|
|
6
|
-
start(port?: number, permissions?: Permissions): Promise<number>;
|
|
6
|
+
start(port?: number, permissions?: Permissions, remotes?: Remotes): Promise<number>;
|
|
7
7
|
stop(): Promise<void>;
|
|
8
8
|
}
|
|
9
9
|
export interface InvocationService {
|
|
@@ -15,8 +15,9 @@ export declare class LocalDevelopmentServer implements DevelopmentServer {
|
|
|
15
15
|
private app;
|
|
16
16
|
private httpServer;
|
|
17
17
|
private permissions;
|
|
18
|
+
private remotes;
|
|
18
19
|
constructor(invocationService: InvocationService, logger: Logger);
|
|
19
|
-
start(port?: number, permissions?: Permissions
|
|
20
|
+
start(port?: number, permissions?: Permissions, remotes?: Remotes): Promise<number>;
|
|
20
21
|
stop(): Promise<void>;
|
|
21
22
|
getApp(): express.Application;
|
|
22
23
|
handleInvocation: express.Handler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-server.d.ts","sourceRoot":"","sources":["../../../src/tunnelling/servers/dev-server.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAI9B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAe,MAAM,gBAAgB,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"dev-server.d.ts","sourceRoot":"","sources":["../../../src/tunnelling/servers/dev-server.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAI9B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAe,MAAM,gBAAgB,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACpF,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CACrE;AAED,qBAAa,sBAAuB,YAAW,iBAAiB;IAMlD,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAAqB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAL1F,OAAO,CAAC,GAAG,CAAsB;IACjC,OAAO,CAAC,UAAU,CAA0B;IAC5C,OAAO,CAAC,WAAW,CAA0B;IAC7C,OAAO,CAAC,OAAO,CAAsB;gBAER,iBAAiB,EAAE,iBAAiB,EAAmB,MAAM,EAAE,MAAM;IAOrF,KAAK,CAAC,IAAI,SAAI,EAAE,WAAW,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAY9E,IAAI;IAUV,MAAM,IAAI,OAAO,CAAC,WAAW;IAI7B,gBAAgB,EAAE,OAAO,CAAC,OAAO,CAsCtC;CACH"}
|
|
@@ -10,7 +10,7 @@ class LocalDevelopmentServer {
|
|
|
10
10
|
this.invocationService = invocationService;
|
|
11
11
|
this.logger = logger;
|
|
12
12
|
this.handleInvocation = async (req, res) => {
|
|
13
|
-
var _a, _b, _c, _d;
|
|
13
|
+
var _a, _b, _c, _d, _e, _f;
|
|
14
14
|
const request = req.body;
|
|
15
15
|
const envVars = runtime_1.getUserVars();
|
|
16
16
|
(_a = request.variables) === null || _a === void 0 ? void 0 : _a.forEach((item) => {
|
|
@@ -19,7 +19,13 @@ class LocalDevelopmentServer {
|
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
21
|
request.variables = [...envVars].sort((a, b) => a.key.localeCompare(b.key));
|
|
22
|
-
|
|
22
|
+
const allowList = (_f = (_e = (_d = (_c = (_b = this.permissions) === null || _b === void 0 ? void 0 : _b.external) === null || _c === void 0 ? void 0 : _c.fetch) === null || _d === void 0 ? void 0 : _d.backend) === null || _e === void 0 ? void 0 : _e.map((item) => {
|
|
23
|
+
var _a, _b;
|
|
24
|
+
if (typeof item === 'string')
|
|
25
|
+
return item;
|
|
26
|
+
return (_b = (_a = this.remotes) === null || _a === void 0 ? void 0 : _a.find((remote) => remote.key === item.remote)) === null || _b === void 0 ? void 0 : _b.baseUrl;
|
|
27
|
+
}).filter((item) => typeof item === 'string')) !== null && _f !== void 0 ? _f : undefined;
|
|
28
|
+
request._meta = Object.assign(Object.assign({}, request._meta), { fetchAllowList: allowList });
|
|
23
29
|
try {
|
|
24
30
|
const body = await this.invocationService.invoke(request.handler, request);
|
|
25
31
|
res.json(body);
|
|
@@ -37,8 +43,9 @@ class LocalDevelopmentServer {
|
|
|
37
43
|
this.app.use(express_1.default.json({ limit: '6mb' }));
|
|
38
44
|
this.app.post(`/:fnKey`, this.handleInvocation);
|
|
39
45
|
}
|
|
40
|
-
async start(port = 0, permissions
|
|
46
|
+
async start(port = 0, permissions, remotes) {
|
|
41
47
|
this.permissions = permissions;
|
|
48
|
+
this.remotes = remotes;
|
|
42
49
|
this.httpServer = await new Promise((resolve, reject) => {
|
|
43
50
|
const httpServer = this.app.listen({ port });
|
|
44
51
|
httpServer.on('error', reject).on('listening', () => resolve(httpServer));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/tunnel",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-9fff5da",
|
|
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": "0.0.0-experimental-
|
|
20
|
-
"@forge/cli-shared": "0.0.0-experimental-
|
|
21
|
-
"@forge/csp": "^1.7.
|
|
22
|
-
"@forge/isolated-vm": "3.3.
|
|
23
|
-
"@forge/runtime": "0.0.0-experimental-
|
|
19
|
+
"@forge/bundler": "0.0.0-experimental-9fff5da",
|
|
20
|
+
"@forge/cli-shared": "0.0.0-experimental-9fff5da",
|
|
21
|
+
"@forge/csp": "^1.7.1",
|
|
22
|
+
"@forge/isolated-vm": "3.3.10",
|
|
23
|
+
"@forge/runtime": "0.0.0-experimental-9fff5da",
|
|
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": "^0.0.0-experimental-
|
|
34
|
+
"@forge/manifest": "^0.0.0-experimental-9fff5da",
|
|
35
35
|
"@types/express": "^4.17.2",
|
|
36
36
|
"@types/express-mung": "^0.5.2",
|
|
37
37
|
"@types/jest": "^26.0.0",
|