@forge/tunnel 5.3.4-next.3 → 5.4.0-next.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 +24 -0
- package/out/command/start-tunnel-command.d.ts +0 -1
- package/out/command/start-tunnel-command.d.ts.map +1 -1
- package/out/command/start-tunnel-command.js +1 -3
- package/out/services/create-tunnel-service.d.ts +3 -27
- package/out/services/create-tunnel-service.d.ts.map +1 -1
- package/out/services/create-tunnel-service.js +1 -104
- package/out/services/register-tunnel-service.d.ts +1 -3
- package/out/services/register-tunnel-service.d.ts.map +1 -1
- package/out/services/register-tunnel-service.js +2 -11
- package/package.json +5 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @forge/tunnel
|
|
2
2
|
|
|
3
|
+
## 5.4.0-next.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 41ba7c6: Removing Cloudflare enable FF and ngrok tunnel implementation
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [41ba7c6]
|
|
12
|
+
- @forge/cli-shared@5.4.0-next.0
|
|
13
|
+
- @forge/bundler@4.17.6-next.0
|
|
14
|
+
|
|
15
|
+
## 5.3.4
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- c9077a2: Rename function getEnvironment to getEnvironmentConfig
|
|
20
|
+
- Updated dependencies [69aafa2]
|
|
21
|
+
- Updated dependencies [c9077a2]
|
|
22
|
+
- Updated dependencies [07355ac]
|
|
23
|
+
- @forge/runtime@5.10.1
|
|
24
|
+
- @forge/cli-shared@5.3.2
|
|
25
|
+
- @forge/bundler@4.17.5
|
|
26
|
+
|
|
3
27
|
## 5.3.4-next.3
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-tunnel-command.d.ts","sourceRoot":"","sources":["../../src/command/start-tunnel-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,EAAyB,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAChH,OAAO,EAAE,SAAS,EAAqB,MAAM,gBAAgB,CAAC;AAG9D,OAAO,EACL,iBAAiB,EAKlB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAsC,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACzE,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,
|
|
1
|
+
{"version":3,"file":"start-tunnel-command.d.ts","sourceRoot":"","sources":["../../src/command/start-tunnel-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,EAAyB,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAChH,OAAO,EAAE,SAAS,EAAqB,MAAM,gBAAgB,CAAC;AAG9D,OAAO,EACL,iBAAiB,EAKlB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAsC,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACzE,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAChC,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,eAAe,CAAC,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1F;AAED,qBAAa,kBAAkB;IAK3B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAX7B,OAAO,CAAC,aAAa,CAAmE;IACxF,OAAO,CAAC,iBAAiB,CAAgC;gBAGtC,YAAY,EAAE,iBAAiB,EAC/B,SAAS,EAAE,iBAAiB,EAC5B,aAAa,EAAE,mBAAmB,EAClC,YAAY,EAAE,qBAAqB,EACnC,YAAY,EAAE,qBAAqB,EACnC,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU;IAGzC,OAAO,CAAC,YAAY,CAUlB;IAEF,OAAO,CAAC,qBAAqB,CAuB3B;IAEF,OAAO,CAAC,gCAAgC,CAmCtC;IAEW,OAAO,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAwD9E"}
|
|
@@ -39,13 +39,12 @@ class StartTunnelCommand {
|
|
|
39
39
|
this.cspReporterServer?.stop()
|
|
40
40
|
]);
|
|
41
41
|
};
|
|
42
|
-
startFaaSTunnelServer = async ({ port,
|
|
42
|
+
startFaaSTunnelServer = async ({ port, appId, environmentKey }) => {
|
|
43
43
|
const { permissions = {}, remotes = [] } = await this.configFile.readConfig();
|
|
44
44
|
const serverInfo = await this.devServer.start(port, permissions, remotes);
|
|
45
45
|
const { id, token, url } = await this.tunnelClient.setupTunnel(appId, environmentKey);
|
|
46
46
|
const faasTunnelUrl = await this.tunnelFactory.establishTunnel({
|
|
47
47
|
port: serverInfo.port,
|
|
48
|
-
tunnelConfigPath,
|
|
49
48
|
id,
|
|
50
49
|
token,
|
|
51
50
|
tunnelUrl: url
|
|
@@ -86,7 +85,6 @@ class StartTunnelCommand {
|
|
|
86
85
|
try {
|
|
87
86
|
const faasTunnelServer = await this.startFaaSTunnelServer({
|
|
88
87
|
port,
|
|
89
|
-
tunnelConfigPath: options.ngrokConfig,
|
|
90
88
|
appId,
|
|
91
89
|
environmentKey
|
|
92
90
|
});
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
import { URL } from 'url';
|
|
3
|
-
import { BaseError,
|
|
4
|
-
export declare type NgrokTunnelConfig = {
|
|
5
|
-
tunnelConfigPath: string | undefined;
|
|
6
|
-
};
|
|
3
|
+
import { BaseError, Logger } from '@forge/cli-shared';
|
|
7
4
|
export declare type CloudflareTunnelConfig = {
|
|
8
5
|
token: string | null | undefined;
|
|
9
6
|
id: string | null | undefined;
|
|
@@ -11,27 +8,13 @@ export declare type CloudflareTunnelConfig = {
|
|
|
11
8
|
};
|
|
12
9
|
export declare type TunnelConfig = {
|
|
13
10
|
port: number;
|
|
14
|
-
} &
|
|
11
|
+
} & CloudflareTunnelConfig;
|
|
15
12
|
export interface CreateTunnelService {
|
|
16
|
-
establishTunnel({ port,
|
|
13
|
+
establishTunnel({ port, token, id, tunnelUrl }: TunnelConfig): Promise<URL>;
|
|
17
14
|
closeTunnel(): Promise<void>;
|
|
18
15
|
}
|
|
19
|
-
export declare const USER_NGROK_ERRORS: string[];
|
|
20
|
-
export declare class NgrokError extends BaseError {
|
|
21
|
-
constructor(message?: string);
|
|
22
|
-
isUserError(): boolean;
|
|
23
|
-
}
|
|
24
16
|
export declare class CloudflareError extends BaseError {
|
|
25
17
|
}
|
|
26
|
-
export declare class TunnelServiceFacade implements CreateTunnelService {
|
|
27
|
-
private readonly featureFlagService;
|
|
28
|
-
private readonly logger;
|
|
29
|
-
private instance;
|
|
30
|
-
constructor(featureFlagService: FeatureFlagService, logger: Logger);
|
|
31
|
-
private getInstance;
|
|
32
|
-
establishTunnel({ port, tunnelConfigPath, id, token, tunnelUrl }: TunnelConfig): Promise<URL>;
|
|
33
|
-
closeTunnel(): Promise<void>;
|
|
34
|
-
}
|
|
35
18
|
export declare class CloudflareCreateTunnelService implements CreateTunnelService {
|
|
36
19
|
private readonly logger;
|
|
37
20
|
private stopFunction;
|
|
@@ -39,11 +22,4 @@ export declare class CloudflareCreateTunnelService implements CreateTunnelServic
|
|
|
39
22
|
establishTunnel({ port, id, token, tunnelUrl }: TunnelConfig): Promise<URL>;
|
|
40
23
|
closeTunnel(): Promise<void>;
|
|
41
24
|
}
|
|
42
|
-
export declare class NgrokCreateTunnelService implements CreateTunnelService {
|
|
43
|
-
private readonly logger;
|
|
44
|
-
private endpoint;
|
|
45
|
-
constructor(logger: Logger);
|
|
46
|
-
establishTunnel({ port, tunnelConfigPath }: TunnelConfig): Promise<URL>;
|
|
47
|
-
closeTunnel(): Promise<void>;
|
|
48
|
-
}
|
|
49
25
|
//# sourceMappingURL=create-tunnel-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-tunnel-service.d.ts","sourceRoot":"","sources":["../../src/services/create-tunnel-service.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"create-tunnel-service.d.ts","sourceRoot":"","sources":["../../src/services/create-tunnel-service.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAE5D,oBAAY,sBAAsB,GAAG;IACnC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACjC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC9B,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACtC,CAAC;AAEF,oBAAY,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,sBAAsB,CAAC;AAE3B,MAAM,WAAW,mBAAmB;IAClC,eAAe,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5E,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAED,qBAAa,eAAgB,SAAQ,SAAS;CAAG;AAEjD,qBAAa,6BAA8B,YAAW,mBAAmB;IAG3D,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,OAAO,CAAC,YAAY,CAA0E;gBAEjE,MAAM,EAAE,MAAM;IAE9B,eAAe,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC;IAwB3E,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;CAQ1C"}
|
|
@@ -1,67 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const ngrok = tslib_1.__importStar(require("ngrok"));
|
|
3
|
+
exports.CloudflareCreateTunnelService = exports.CloudflareError = void 0;
|
|
6
4
|
const cloudflared_1 = require("cloudflared");
|
|
7
5
|
const url_1 = require("url");
|
|
8
6
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
9
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
10
|
-
exports.USER_NGROK_ERRORS = [
|
|
11
|
-
'ERR_NGROK_105',
|
|
12
|
-
'ERR_NGROK_108',
|
|
13
|
-
'ERR_NGROK_120',
|
|
14
|
-
'ERR_NGROK_714',
|
|
15
|
-
'ERR_NGROK_715',
|
|
16
|
-
'ERR_NGROK_718',
|
|
17
|
-
'ERR_NGROK_720',
|
|
18
|
-
'ERR_NGROK_725',
|
|
19
|
-
'ERR_NGROK_726',
|
|
20
|
-
'ERR_NGROK_727',
|
|
21
|
-
'ERR_NGROK_728',
|
|
22
|
-
'ERR_NGROK_734',
|
|
23
|
-
'ERR_NGROK_1226',
|
|
24
|
-
'ERR_NGROK_3208',
|
|
25
|
-
'no such file or directory',
|
|
26
|
-
'The system cannot find the file specified',
|
|
27
|
-
'context canceled'
|
|
28
|
-
];
|
|
29
|
-
class NgrokError extends cli_shared_1.BaseError {
|
|
30
|
-
constructor(message) {
|
|
31
|
-
super(undefined, cli_shared_1.Text.tunnel.error.ngrok(message));
|
|
32
|
-
}
|
|
33
|
-
isUserError() {
|
|
34
|
-
return exports.USER_NGROK_ERRORS.some((err) => this.message.includes(err));
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports.NgrokError = NgrokError;
|
|
38
7
|
class CloudflareError extends cli_shared_1.BaseError {
|
|
39
8
|
}
|
|
40
9
|
exports.CloudflareError = CloudflareError;
|
|
41
|
-
class TunnelServiceFacade {
|
|
42
|
-
featureFlagService;
|
|
43
|
-
logger;
|
|
44
|
-
instance;
|
|
45
|
-
constructor(featureFlagService, logger) {
|
|
46
|
-
this.featureFlagService = featureFlagService;
|
|
47
|
-
this.logger = logger;
|
|
48
|
-
}
|
|
49
|
-
async getInstance() {
|
|
50
|
-
if (!this.instance) {
|
|
51
|
-
this.instance = (await this.featureFlagService.isCloudflareTunnelEnabled())
|
|
52
|
-
? new CloudflareCreateTunnelService(this.logger)
|
|
53
|
-
: new NgrokCreateTunnelService(this.logger);
|
|
54
|
-
}
|
|
55
|
-
return this.instance;
|
|
56
|
-
}
|
|
57
|
-
async establishTunnel({ port, tunnelConfigPath, id, token, tunnelUrl }) {
|
|
58
|
-
return (await this.getInstance()).establishTunnel({ port, tunnelConfigPath, id, token, tunnelUrl });
|
|
59
|
-
}
|
|
60
|
-
async closeTunnel() {
|
|
61
|
-
return (await this.getInstance()).closeTunnel();
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
exports.TunnelServiceFacade = TunnelServiceFacade;
|
|
65
10
|
class CloudflareCreateTunnelService {
|
|
66
11
|
logger;
|
|
67
12
|
stopFunction;
|
|
@@ -96,51 +41,3 @@ class CloudflareCreateTunnelService {
|
|
|
96
41
|
}
|
|
97
42
|
}
|
|
98
43
|
exports.CloudflareCreateTunnelService = CloudflareCreateTunnelService;
|
|
99
|
-
class NgrokCreateTunnelService {
|
|
100
|
-
logger;
|
|
101
|
-
endpoint;
|
|
102
|
-
constructor(logger) {
|
|
103
|
-
this.logger = logger;
|
|
104
|
-
}
|
|
105
|
-
async establishTunnel({ port, tunnelConfigPath }) {
|
|
106
|
-
const defaultConfigPath = path_1.default.join(__dirname, '..', '..', 'config', 'ngrok.yml');
|
|
107
|
-
let ngrokErrorMessage = undefined;
|
|
108
|
-
try {
|
|
109
|
-
const options = {
|
|
110
|
-
addr: port,
|
|
111
|
-
configPath: tunnelConfigPath ?? defaultConfigPath,
|
|
112
|
-
onStatusChange: (status) => {
|
|
113
|
-
this.logger.debug(cli_shared_1.Text.tunnel.tunnelStatusChange(status));
|
|
114
|
-
},
|
|
115
|
-
onLogEvent: (data) => {
|
|
116
|
-
const errorMatch = /err=(".+")$/m.exec(data);
|
|
117
|
-
if (errorMatch && !data.includes('obj=updater')) {
|
|
118
|
-
ngrokErrorMessage = errorMatch[1];
|
|
119
|
-
try {
|
|
120
|
-
ngrokErrorMessage = JSON.parse(ngrokErrorMessage);
|
|
121
|
-
}
|
|
122
|
-
catch { }
|
|
123
|
-
}
|
|
124
|
-
this.logger.debug(data);
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
this.endpoint = await ngrok.connect(options);
|
|
128
|
-
this.logger.debug(cli_shared_1.Text.tunnel.startedTunnel(this.endpoint));
|
|
129
|
-
return new url_1.URL(this.endpoint);
|
|
130
|
-
}
|
|
131
|
-
catch (e) {
|
|
132
|
-
throw new NgrokError(ngrokErrorMessage);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
async closeTunnel() {
|
|
136
|
-
if (this.endpoint) {
|
|
137
|
-
try {
|
|
138
|
-
await ngrok.disconnect();
|
|
139
|
-
await ngrok.kill();
|
|
140
|
-
}
|
|
141
|
-
catch { }
|
|
142
|
-
this.endpoint = undefined;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
exports.NgrokCreateTunnelService = NgrokCreateTunnelService;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { TunnelClient, TunnelDefinitions, TunnelSetup } from '../graphql';
|
|
2
|
-
import { FeatureFlagService } from '@forge/cli-shared';
|
|
3
2
|
export interface RegisterTunnelService {
|
|
4
3
|
setupTunnel(appId: string, environmentKey: string): Promise<TunnelSetup>;
|
|
5
4
|
registerTunnels(appId: string, environmentKey: string, tunnelDefinitions: TunnelDefinitions): Promise<void>;
|
|
@@ -7,8 +6,7 @@ export interface RegisterTunnelService {
|
|
|
7
6
|
}
|
|
8
7
|
export declare class RegisterTunnelServiceImpl implements RegisterTunnelService {
|
|
9
8
|
private readonly tunnelClient;
|
|
10
|
-
|
|
11
|
-
constructor(tunnelClient: TunnelClient, featureFlagService: FeatureFlagService);
|
|
9
|
+
constructor(tunnelClient: TunnelClient);
|
|
12
10
|
private keepAliveHandler;
|
|
13
11
|
private keepAliveActive;
|
|
14
12
|
registerTunnels(appId: string, environmentKey: string, tunnelDefinitions: TunnelDefinitions): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-tunnel-service.d.ts","sourceRoot":"","sources":["../../src/services/register-tunnel-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"register-tunnel-service.d.ts","sourceRoot":"","sources":["../../src/services/register-tunnel-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAI1E,MAAM,WAAW,qBAAqB;IACpC,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACzE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,iBAAiB,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5G,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzE;AAED,qBAAa,yBAA0B,YAAW,qBAAqB;IACzD,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAAZ,YAAY,EAAE,YAAY;IAIvD,OAAO,CAAC,gBAAgB,CAA6B;IACrD,OAAO,CAAC,eAAe,CAAU;IAEpB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,iBAAiB,EAAE,iBAAiB;IAQ3F,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM;IAIjD,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM;YAQtD,gBAAgB;IAoB9B,OAAO,CAAC,MAAM;CAaf"}
|
|
@@ -4,10 +4,8 @@ exports.RegisterTunnelServiceImpl = void 0;
|
|
|
4
4
|
const ONE_DAY = 1000 * 60 * 60 * 24;
|
|
5
5
|
class RegisterTunnelServiceImpl {
|
|
6
6
|
tunnelClient;
|
|
7
|
-
|
|
8
|
-
constructor(tunnelClient, featureFlagService) {
|
|
7
|
+
constructor(tunnelClient) {
|
|
9
8
|
this.tunnelClient = tunnelClient;
|
|
10
|
-
this.featureFlagService = featureFlagService;
|
|
11
9
|
this.keepAliveActive = true;
|
|
12
10
|
}
|
|
13
11
|
keepAliveHandler;
|
|
@@ -20,14 +18,7 @@ class RegisterTunnelServiceImpl {
|
|
|
20
18
|
await this.keepTunnelsAlive(appId, environmentKey, tunnelDefinitions, expiry);
|
|
21
19
|
}
|
|
22
20
|
async setupTunnel(appId, environmentKey) {
|
|
23
|
-
|
|
24
|
-
return await this.tunnelClient.setupTunnel(appId, environmentKey);
|
|
25
|
-
}
|
|
26
|
-
return {
|
|
27
|
-
token: undefined,
|
|
28
|
-
id: undefined,
|
|
29
|
-
url: undefined
|
|
30
|
-
};
|
|
21
|
+
return await this.tunnelClient.setupTunnel(appId, environmentKey);
|
|
31
22
|
}
|
|
32
23
|
async unregisterTunnels(appId, environmentKey) {
|
|
33
24
|
if (this.keepAliveHandler) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/tunnel",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.4.0-next.0",
|
|
4
4
|
"description": "Tunnel functionality for Forge CLI",
|
|
5
5
|
"author": "Atlassian",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -11,16 +11,15 @@
|
|
|
11
11
|
"compile": "tsc -b -v"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@forge/bundler": "4.17.
|
|
15
|
-
"@forge/cli-shared": "5.
|
|
14
|
+
"@forge/bundler": "4.17.6-next.0",
|
|
15
|
+
"@forge/cli-shared": "5.4.0-next.0",
|
|
16
16
|
"@forge/csp": "3.2.2",
|
|
17
|
-
"@forge/runtime": "5.10.1
|
|
17
|
+
"@forge/runtime": "5.10.1",
|
|
18
18
|
"chokidar": "^3.6.0",
|
|
19
19
|
"cloudflared": "^0.5.2",
|
|
20
20
|
"express": "^4.18.3",
|
|
21
21
|
"express-intercept": "^1.1.0",
|
|
22
22
|
"http-proxy-middleware": "^2.0.6",
|
|
23
|
-
"ngrok": "^5.0.0-beta.2",
|
|
24
23
|
"node-cache": "^5.1.2",
|
|
25
24
|
"tmp": "^0.2.3",
|
|
26
25
|
"tslib": "^2.6.2",
|
|
@@ -29,7 +28,7 @@
|
|
|
29
28
|
},
|
|
30
29
|
"devDependencies": {
|
|
31
30
|
"@atlassian/xen-test-util": "^4.2.0",
|
|
32
|
-
"@forge/manifest": "7.5.3
|
|
31
|
+
"@forge/manifest": "7.5.3",
|
|
33
32
|
"@types/express": "^4.17.21",
|
|
34
33
|
"@types/jest": "^29.5.12",
|
|
35
34
|
"@types/node": "14.18.63",
|