@gitpod/gitpod-protocol 0.1.5-v0.6.0-beta2 → 0.1.5-vn-integrate-gitpod-yml-tasks-into-jetbrainsa.5
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/data/builtin-theia-plugins.json +9 -9
- package/data/gitpod-schema.json +25 -24
- package/lib/accounting-protocol.d.ts +155 -0
- package/lib/accounting-protocol.d.ts.map +1 -0
- package/lib/accounting-protocol.js +109 -0
- package/lib/accounting-protocol.js.map +1 -0
- package/lib/admin-protocol.d.ts +31 -4
- package/lib/admin-protocol.d.ts.map +1 -1
- package/lib/admin-protocol.js +15 -0
- package/lib/admin-protocol.js.map +1 -1
- package/lib/analytics.d.ts +45 -0
- package/lib/analytics.d.ts.map +1 -0
- package/lib/analytics.js +10 -0
- package/lib/analytics.js.map +1 -0
- package/lib/auth.d.ts +25 -0
- package/lib/auth.d.ts.map +1 -0
- package/lib/auth.js +16 -0
- package/lib/auth.js.map +1 -0
- package/lib/context-url.d.ts +31 -0
- package/lib/context-url.d.ts.map +1 -0
- package/lib/context-url.js +102 -0
- package/lib/context-url.js.map +1 -0
- package/lib/context-url.spec.d.ts +14 -0
- package/lib/context-url.spec.d.ts.map +1 -0
- package/lib/context-url.spec.js +94 -0
- package/lib/context-url.spec.js.map +1 -0
- package/lib/email-protocol.d.ts +1 -2
- package/lib/email-protocol.d.ts.map +1 -1
- package/lib/email-protocol.js +4 -4
- package/lib/email-protocol.js.map +1 -1
- package/lib/encryption/container-module.js +5 -4
- package/lib/encryption/container-module.js.map +1 -1
- package/lib/encryption/encryption-engine.js +19 -20
- package/lib/encryption/encryption-engine.js.map +1 -1
- package/lib/encryption/encryption-engine.spec.js +29 -36
- package/lib/encryption/encryption-engine.spec.js.map +1 -1
- package/lib/encryption/encryption-service.js +29 -43
- package/lib/encryption/encryption-service.js.map +1 -1
- package/lib/encryption/key-provider.js +25 -30
- package/lib/encryption/key-provider.js.map +1 -1
- package/lib/env.d.ts +1 -2
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +20 -21
- package/lib/env.js.map +1 -1
- package/lib/gitpod-file-parser.js +25 -41
- package/lib/gitpod-file-parser.js.map +1 -1
- package/lib/gitpod-file-parser.spec.js +116 -116
- package/lib/gitpod-file-parser.spec.js.map +1 -1
- package/lib/gitpod-service.d.ts +162 -20
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +170 -256
- package/lib/gitpod-service.js.map +1 -1
- package/lib/headless-workspace-log.d.ts +8 -11
- package/lib/headless-workspace-log.d.ts.map +1 -1
- package/lib/headless-workspace-log.js +4 -7
- package/lib/headless-workspace-log.js.map +1 -1
- package/lib/ide-frontend-service.d.ts +4 -0
- package/lib/ide-frontend-service.d.ts.map +1 -1
- package/lib/ide-protocol.d.ts +105 -0
- package/lib/ide-protocol.d.ts.map +1 -0
- package/lib/ide-protocol.js +8 -0
- package/lib/ide-protocol.js.map +1 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +7 -1
- package/lib/index.js.map +1 -1
- package/lib/installation-admin-protocol.d.ts +27 -0
- package/lib/installation-admin-protocol.d.ts.map +1 -0
- package/lib/installation-admin-protocol.js +30 -0
- package/lib/installation-admin-protocol.js.map +1 -0
- package/lib/messaging/browser/connection.d.ts +5 -3
- package/lib/messaging/browser/connection.d.ts.map +1 -1
- package/lib/messaging/browser/connection.js +183 -33
- package/lib/messaging/browser/connection.js.map +1 -1
- package/lib/messaging/browser/window-connection.js +35 -55
- package/lib/messaging/browser/window-connection.js.map +1 -1
- package/lib/messaging/client-call-metrics.d.ts +35 -0
- package/lib/messaging/client-call-metrics.d.ts.map +1 -0
- package/lib/messaging/client-call-metrics.js +83 -0
- package/lib/messaging/client-call-metrics.js.map +1 -0
- package/lib/messaging/error.d.ts +5 -1
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +10 -2
- package/lib/messaging/error.js.map +1 -1
- package/lib/messaging/handler.d.ts +10 -0
- package/lib/messaging/handler.d.ts.map +1 -1
- package/lib/messaging/node/connection.d.ts +1 -17
- package/lib/messaging/node/connection.d.ts.map +1 -1
- package/lib/messaging/node/connection.js +23 -59
- package/lib/messaging/node/connection.js.map +1 -1
- package/lib/messaging/proxy-factory.d.ts +2 -0
- package/lib/messaging/proxy-factory.d.ts.map +1 -1
- package/lib/messaging/proxy-factory.js +74 -159
- package/lib/messaging/proxy-factory.js.map +1 -1
- package/lib/oss-allowlist.d.ts +14 -0
- package/lib/oss-allowlist.d.ts.map +1 -0
- package/lib/oss-allowlist.js +8 -0
- package/lib/oss-allowlist.js.map +1 -0
- package/lib/payment-protocol.d.ts +18 -0
- package/lib/payment-protocol.d.ts.map +1 -0
- package/lib/payment-protocol.js +13 -0
- package/lib/payment-protocol.js.map +1 -0
- package/lib/permission.d.ts +8 -3
- package/lib/permission.d.ts.map +1 -1
- package/lib/permission.js +36 -19
- package/lib/permission.js.map +1 -1
- package/lib/plans.d.ts +210 -0
- package/lib/plans.d.ts.map +1 -0
- package/lib/plans.js +570 -0
- package/lib/plans.js.map +1 -0
- package/lib/protocol.d.ts +118 -58
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +116 -130
- package/lib/protocol.js.map +1 -1
- package/lib/snapshot-url.d.ts +14 -0
- package/lib/snapshot-url.d.ts.map +1 -0
- package/lib/snapshot-url.js +26 -0
- package/lib/snapshot-url.js.map +1 -0
- package/{src/util/without.ts → lib/snapshot-url.spec.d.ts} +2 -3
- package/lib/snapshot-url.spec.d.ts.map +1 -0
- package/lib/snapshot-url.spec.js +41 -0
- package/lib/snapshot-url.spec.js.map +1 -0
- package/lib/team-subscription-protocol.d.ts +73 -0
- package/lib/team-subscription-protocol.d.ts.map +1 -0
- package/lib/team-subscription-protocol.js +63 -0
- package/lib/team-subscription-protocol.js.map +1 -0
- package/lib/teams-projects-protocol.d.ts +113 -0
- package/lib/teams-projects-protocol.d.ts.map +1 -0
- package/lib/teams-projects-protocol.js +30 -0
- package/lib/teams-projects-protocol.js.map +1 -0
- package/lib/util/analytics.d.ts +8 -0
- package/lib/util/analytics.d.ts.map +1 -0
- package/lib/util/analytics.js +79 -0
- package/lib/util/analytics.js.map +1 -0
- package/lib/util/async-iterator.js +55 -133
- package/lib/util/async-iterator.js.map +1 -1
- package/lib/util/cancelable.js +17 -59
- package/lib/util/cancelable.js.map +1 -1
- package/lib/util/date-time.js +8 -8
- package/lib/util/date-time.js.map +1 -1
- package/lib/util/deferred.js +10 -12
- package/lib/util/deferred.js.map +1 -1
- package/lib/util/disposable.js +26 -39
- package/lib/util/disposable.js.map +1 -1
- package/lib/util/event.js +58 -74
- package/lib/util/event.js.map +1 -1
- package/lib/util/garbage-collected-cache.d.ts +1 -0
- package/lib/util/garbage-collected-cache.d.ts.map +1 -1
- package/lib/util/garbage-collected-cache.js +26 -46
- package/lib/util/garbage-collected-cache.js.map +1 -1
- package/lib/util/generate-workspace-id.d.ts +4 -0
- package/lib/util/generate-workspace-id.d.ts.map +1 -0
- package/lib/util/generate-workspace-id.js +487 -0
- package/lib/util/generate-workspace-id.js.map +1 -0
- package/lib/util/{without.d.ts → generate-workspace-id.spec.d.ts} +2 -2
- package/lib/util/generate-workspace-id.spec.d.ts.map +1 -0
- package/lib/util/generate-workspace-id.spec.js +87 -0
- package/lib/util/generate-workspace-id.spec.js.map +1 -0
- package/lib/util/gitpod-cookie.d.ts +20 -0
- package/lib/util/gitpod-cookie.d.ts.map +1 -0
- package/lib/util/gitpod-cookie.js +44 -0
- package/lib/util/gitpod-cookie.js.map +1 -0
- package/lib/util/gitpod-host-url.d.ts +2 -2
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +96 -95
- package/lib/util/gitpod-host-url.js.map +1 -1
- package/lib/util/gitpod-host-url.spec.d.ts +8 -1
- package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.spec.js +104 -22
- package/lib/util/gitpod-host-url.spec.js.map +1 -1
- package/lib/util/grpc.d.ts +15 -0
- package/lib/util/grpc.d.ts.map +1 -0
- package/lib/util/grpc.js +18 -0
- package/lib/util/grpc.js.map +1 -0
- package/lib/util/jaeger-client-types.d.ts +68 -0
- package/lib/util/jaeger-client-types.d.ts.map +1 -0
- package/lib/util/{without.js → jaeger-client-types.js} +1 -1
- package/lib/util/jaeger-client-types.js.map +1 -0
- package/lib/util/logging.d.ts +49 -33
- package/lib/util/logging.d.ts.map +1 -1
- package/lib/util/logging.js +107 -110
- package/lib/util/logging.js.map +1 -1
- package/lib/util/make-link.js +2 -2
- package/lib/util/make-link.js.map +1 -1
- package/lib/util/parse-workspace-id.d.ts +13 -3
- package/lib/util/parse-workspace-id.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.js +38 -8
- package/lib/util/parse-workspace-id.js.map +1 -1
- package/lib/util/parse-workspace-id.spec.d.ts +8 -0
- package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.spec.js +127 -47
- package/lib/util/parse-workspace-id.spec.js.map +1 -1
- package/lib/util/queue.js +16 -55
- package/lib/util/queue.js.map +1 -1
- package/lib/util/queue.spec.js +144 -288
- package/lib/util/queue.spec.js.map +1 -1
- package/lib/util/repeat.d.ts +15 -0
- package/lib/util/repeat.d.ts.map +1 -0
- package/lib/util/repeat.js +55 -0
- package/lib/util/repeat.js.map +1 -0
- package/lib/util/semaphore.js +15 -46
- package/lib/util/semaphore.js.map +1 -1
- package/lib/util/skip-if.js +6 -6
- package/lib/util/skip-if.js.map +1 -1
- package/lib/util/timeutil.js +28 -16
- package/lib/util/timeutil.js.map +1 -1
- package/lib/util/timeutil.spec.js +21 -24
- package/lib/util/timeutil.spec.js.map +1 -1
- package/lib/util/tracing.d.ts +51 -5
- package/lib/util/tracing.d.ts.map +1 -1
- package/lib/util/tracing.js +197 -62
- package/lib/util/tracing.js.map +1 -1
- package/lib/util/tracing.spec.d.ts +7 -0
- package/lib/util/tracing.spec.d.ts.map +1 -0
- package/lib/util/tracing.spec.js +121 -0
- package/lib/util/tracing.spec.js.map +1 -0
- package/lib/util/workspace-port-authentication.js +3 -2
- package/lib/util/workspace-port-authentication.js.map +1 -1
- package/lib/workspace-cluster.d.ts +76 -0
- package/lib/workspace-cluster.d.ts.map +1 -0
- package/lib/workspace-cluster.js +33 -0
- package/lib/workspace-cluster.js.map +1 -0
- package/lib/workspace-instance.d.ts +26 -2
- package/lib/workspace-instance.d.ts.map +1 -1
- package/lib/wsready.d.ts +1 -1
- package/lib/wsready.js +2 -2
- package/package.json +33 -17
- package/pkg-yarn.lock +18 -9
- package/provenance-bundle.jsonl +2 -0
- package/src/accounting-protocol.ts +229 -0
- package/src/admin-protocol.ts +53 -5
- package/src/analytics.ts +54 -0
- package/src/auth.ts +27 -0
- package/src/context-url.spec.ts +53 -0
- package/src/context-url.ts +107 -0
- package/src/email-protocol.ts +2 -3
- package/src/env.ts +10 -10
- package/src/gitpod-service.ts +237 -38
- package/src/headless-workspace-log.ts +7 -11
- package/src/ide-frontend-service.ts +5 -1
- package/src/ide-protocol.ts +119 -0
- package/src/index.ts +7 -1
- package/src/installation-admin-protocol.ts +42 -0
- package/src/messaging/browser/connection.ts +195 -14
- package/src/messaging/client-call-metrics.ts +97 -0
- package/src/messaging/error.ts +14 -2
- package/src/messaging/handler.ts +12 -0
- package/src/messaging/node/connection.ts +21 -68
- package/src/messaging/proxy-factory.ts +14 -6
- package/src/oss-allowlist.ts +15 -0
- package/src/payment-protocol.ts +20 -0
- package/src/permission.ts +24 -9
- package/src/plans.ts +632 -0
- package/src/protocol.ts +192 -87
- package/src/snapshot-url.spec.ts +25 -0
- package/src/snapshot-url.ts +27 -0
- package/src/team-subscription-protocol.ts +113 -0
- package/src/teams-projects-protocol.ts +147 -0
- package/src/util/analytics.ts +87 -0
- package/src/util/deferred.ts +1 -1
- package/src/util/garbage-collected-cache.ts +9 -3
- package/src/util/generate-workspace-id.spec.ts +48 -0
- package/src/util/generate-workspace-id.ts +475 -0
- package/src/util/gitpod-cookie.ts +39 -0
- package/src/util/gitpod-host-url.spec.ts +30 -1
- package/src/util/gitpod-host-url.ts +27 -13
- package/src/util/grpc.ts +15 -0
- package/src/util/jaeger-client-types.ts +102 -0
- package/src/util/logging.ts +102 -38
- package/src/util/parse-workspace-id.spec.ts +45 -4
- package/src/util/parse-workspace-id.ts +38 -7
- package/src/util/queue.spec.ts +1 -1
- package/src/util/repeat.ts +45 -0
- package/src/util/semaphore.ts +2 -2
- package/src/util/skip-if.ts +1 -1
- package/src/util/timeutil.ts +4 -4
- package/src/util/tracing.spec.ts +83 -0
- package/src/util/tracing.ts +183 -17
- package/src/workspace-cluster.ts +104 -0
- package/src/workspace-instance.ts +51 -13
- package/src/wsready.ts +2 -2
- package/lib/messaging/connection-error-handler.d.ts +0 -27
- package/lib/messaging/connection-error-handler.d.ts.map +0 -1
- package/lib/messaging/connection-error-handler.js +0 -46
- package/lib/messaging/connection-error-handler.js.map +0 -1
- package/lib/util/repeater.d.ts +0 -22
- package/lib/util/repeater.d.ts.map +0 -1
- package/lib/util/repeater.js +0 -118
- package/lib/util/repeater.js.map +0 -1
- package/lib/util/safe-promise.d.ts +0 -11
- package/lib/util/safe-promise.d.ts.map +0 -1
- package/lib/util/safe-promise.js +0 -34
- package/lib/util/safe-promise.js.map +0 -1
- package/lib/util/without.d.ts.map +0 -1
- package/lib/util/without.js.map +0 -1
- package/src/messaging/connection-error-handler.ts +0 -62
- package/src/util/jaeger-client.d.ts +0 -105
- package/src/util/repeater.ts +0 -49
- package/src/util/safe-promise.ts +0 -26
|
@@ -18,44 +18,40 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.KeyProviderImpl = exports.KeyProviderConfig = exports.KeyProvider = void 0;
|
|
21
|
-
|
|
21
|
+
const inversify_1 = require("inversify");
|
|
22
22
|
exports.KeyProvider = Symbol('KeyProvider');
|
|
23
23
|
exports.KeyProviderConfig = Symbol('KeyProviderConfig');
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
let KeyProviderImpl = class KeyProviderImpl {
|
|
25
|
+
constructor(config) {
|
|
26
26
|
this.config = config;
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
static loadKeyConfigFromJsonString(configStr) {
|
|
29
|
+
const keys = (JSON.parse(configStr) || []);
|
|
30
30
|
if (!Array.isArray(keys)
|
|
31
31
|
|| keys.length < 0
|
|
32
|
-
|| 1 !== keys.reduce(
|
|
32
|
+
|| 1 !== keys.reduce((p, k) => k.primary ? p + 1 : p, 0)) {
|
|
33
33
|
throw new Error('Invalid key config!');
|
|
34
34
|
}
|
|
35
35
|
return keys;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
configurable: true
|
|
43
|
-
});
|
|
44
|
-
KeyProviderImpl.prototype.getPrimaryKey = function () {
|
|
45
|
-
var primaryKey = this.keys.find(function (key) { return !!key.primary; });
|
|
36
|
+
}
|
|
37
|
+
get keys() {
|
|
38
|
+
return this.config.keys;
|
|
39
|
+
}
|
|
40
|
+
getPrimaryKey() {
|
|
41
|
+
const primaryKey = this.keys.find((key) => !!key.primary);
|
|
46
42
|
if (!primaryKey) {
|
|
47
43
|
throw new Error('No primary encryption key found!');
|
|
48
44
|
}
|
|
49
45
|
return this.configToKey(primaryKey);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
}
|
|
47
|
+
getKeyFor(metadata) {
|
|
48
|
+
const key = this.keys.find((k) => k.name === metadata.name && k.version === metadata.version);
|
|
53
49
|
if (!key) {
|
|
54
|
-
throw new Error(
|
|
50
|
+
throw new Error(`No key found for metadata ${metadata.name}/${metadata.version}`);
|
|
55
51
|
}
|
|
56
52
|
return this.configToKey(key);
|
|
57
|
-
}
|
|
58
|
-
|
|
53
|
+
}
|
|
54
|
+
configToKey(config) {
|
|
59
55
|
return {
|
|
60
56
|
metadata: {
|
|
61
57
|
name: config.name,
|
|
@@ -63,13 +59,12 @@ var KeyProviderImpl = /** @class */ (function () {
|
|
|
63
59
|
},
|
|
64
60
|
material: new Buffer(config.material, 'base64')
|
|
65
61
|
};
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}());
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
KeyProviderImpl = __decorate([
|
|
65
|
+
(0, inversify_1.injectable)(),
|
|
66
|
+
__param(0, (0, inversify_1.inject)(exports.KeyProviderConfig)),
|
|
67
|
+
__metadata("design:paramtypes", [Object])
|
|
68
|
+
], KeyProviderImpl);
|
|
74
69
|
exports.KeyProviderImpl = KeyProviderImpl;
|
|
75
70
|
//# sourceMappingURL=key-provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-provider.js","sourceRoot":"","sources":["../../src/encryption/key-provider.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;AAEH,
|
|
1
|
+
{"version":3,"file":"key-provider.js","sourceRoot":"","sources":["../../src/encryption/key-provider.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;AAEH,yCAA+C;AAYlC,QAAA,WAAW,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAYpC,QAAA,iBAAiB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAM7D,IAAa,eAAe,GAA5B,MAAa,eAAe;IAYxB,YAA0D,MAAyB;QAAzB,WAAM,GAAN,MAAM,CAAmB;IAAG,CAAC;IAVvF,MAAM,CAAC,2BAA2B,CAAC,SAAiB;QAChD,MAAM,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,CAAgB,CAAC;QAC1D,IAAI,CAAC,KAAK,CAAC,OAAO,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AE,MAAM,CAAC,OAAO;aAC1B;YACD,QAAQ,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC;SAClD,CAAC;IACN,CAAC;CACJ,CAAA;AA3CY,eAAe;IAD3B,IAAA,sBAAU,GAAE;IAaI,WAAA,IAAA,kBAAM,EAAC,yBAAiB,CAAC,CAAA;;GAZ7B,eAAe,CA2C3B;AA3CY,0CAAe"}
|
package/lib/env.d.ts
CHANGED
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
4
|
* See License-AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
|
+
export declare function translateLegacyStagename(kubeStage: string): KubeStage;
|
|
6
7
|
export declare abstract class AbstractComponentEnv {
|
|
7
8
|
readonly kubeStage: KubeStage;
|
|
8
|
-
readonly kubeNamespace: string;
|
|
9
|
-
readonly version: string;
|
|
10
9
|
readonly installationLongname: string;
|
|
11
10
|
readonly installationShortname: string;
|
|
12
11
|
}
|
package/lib/env.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAOrE;AAED,8BACsB,oBAAoB;IACtC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAA2D;IAExF,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAA4C;IACjF,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAA6C;CACtF;AAED,oBAAY,SAAS,GAAG,YAAY,GAAG,UAAU,GAAG,SAAS,GAAG,KAAK,CAAC;AAEtE,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAMrE;AAED,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKlE;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,CAAC,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,CAAC,CAEvG"}
|
package/lib/env.js
CHANGED
|
@@ -11,38 +11,37 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
11
11
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.getEnvVarParsed = exports.filePathTelepresenceAware = exports.getEnvVar = exports.AbstractComponentEnv = void 0;
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
exports.getEnvVarParsed = exports.filePathTelepresenceAware = exports.getEnvVar = exports.AbstractComponentEnv = exports.translateLegacyStagename = void 0;
|
|
15
|
+
const inversify_1 = require("inversify");
|
|
16
|
+
const legacyStagenameTranslation = {
|
|
17
17
|
"production": "production",
|
|
18
18
|
"staging": "prodcopy",
|
|
19
19
|
"devstaging": "dev",
|
|
20
20
|
"dev": "dev"
|
|
21
21
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
this.
|
|
22
|
+
function translateLegacyStagename(kubeStage) {
|
|
23
|
+
const stage = legacyStagenameTranslation[kubeStage];
|
|
24
|
+
if (!stage) {
|
|
25
|
+
throw new Error(`Invalid KUBE_STAGE: ${kubeStage}`);
|
|
26
|
+
}
|
|
27
|
+
return stage;
|
|
28
|
+
}
|
|
29
|
+
exports.translateLegacyStagename = translateLegacyStagename;
|
|
30
|
+
let AbstractComponentEnv = class AbstractComponentEnv {
|
|
31
|
+
constructor() {
|
|
32
|
+
this.kubeStage = getEnvVarParsed('KUBE_STAGE', translateLegacyStagename);
|
|
33
33
|
this.installationLongname = getEnvVar("GITPOD_INSTALLATION_LONGNAME");
|
|
34
34
|
this.installationShortname = getEnvVar("GITPOD_INSTALLATION_SHORTNAME");
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}());
|
|
36
|
+
};
|
|
37
|
+
AbstractComponentEnv = __decorate([
|
|
38
|
+
(0, inversify_1.injectable)()
|
|
39
|
+
], AbstractComponentEnv);
|
|
41
40
|
exports.AbstractComponentEnv = AbstractComponentEnv;
|
|
42
41
|
function getEnvVar(name, defaultValue) {
|
|
43
|
-
|
|
42
|
+
const value = process.env[name] || defaultValue;
|
|
44
43
|
if (!value) {
|
|
45
|
-
throw new Error(
|
|
44
|
+
throw new Error(`Environment variable undefined or empty: ${name}`);
|
|
46
45
|
}
|
|
47
46
|
return value;
|
|
48
47
|
}
|
package/lib/env.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.js","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;AAEH,
|
|
1
|
+
{"version":3,"file":"env.js","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;AAEH,yCAAuC;AAEvC,MAAM,0BAA0B,GAAiC;IAC7D,YAAY,EAAE,YAAY;IAC1B,SAAS,EAAE,UAAU;IACrB,YAAY,EAAE,KAAK;IACnB,KAAK,EAAE,KAAK;CACf,CAAA;AAED,SAAgB,wBAAwB,CAAC,SAAiB;IACtD,MAAM,KAAK,GAAG,0BAA0B,CAAC,SAAS,CAAC,CAAC;IACpD,IAAI,CAAC,KAAK,EAAE;QACR,MAAM,IAAI,KAAK,CAAC,uBAAuB,SAAS,EAAE,CAAC,CAAC;KACvD;IAED,OAAO,KAAK,CAAC;AACjB,CAAC;AAPD,4DAOC;AAGD,IAAsB,oBAAoB,GAA1C,MAAsB,oBAAoB;IAA1C;QACa,cAAS,GAAc,eAAe,CAAC,YAAY,EAAE,wBAAwB,CAAC,CAAC;QAE/E,yBAAoB,GAAW,SAAS,CAAC,8BAA8B,CAAC,CAAA;QACxE,0BAAqB,GAAW,SAAS,CAAC,+BAA+B,CAAC,CAAA;IACvF,CAAC;CAAA,CAAA;AALqB,oBAAoB;IADzC,IAAA,sBAAU,GAAE;GACS,oBAAoB,CAKzC;AALqB,oDAAoB;AAS1C,SAAgB,SAAS,CAAC,IAAY,EAAE,YAAqB;IACzD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,YAAY,CAAC;IAChD,IAAI,CAAC,KAAK,EAAE;QACR,MAAM,IAAI,KAAK,CAAC,4CAA4C,IAAI,EAAE,CAAC,CAAC;KACvE;IACD,OAAO,KAAK,CAAC;AACjB,CAAC;AAND,8BAMC;AAED,SAAgB,yBAAyB,CAAC,QAAgB;IACtD,IAAI,QAAQ,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE;QAC3C,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,GAAG,QAAQ,CAAC;KACvD;IACD,OAAO,QAAQ,CAAC;AACpB,CAAC;AALD,8DAKC;AAED,SAAgB,eAAe,CAAI,IAAY,EAAE,MAA4B,EAAE,YAAqB;IAChG,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;AACjD,CAAC;AAFD,0CAEC"}
|
|
@@ -4,17 +4,6 @@
|
|
|
4
4
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
5
5
|
* See License-AGPL.txt in the project root for license information.
|
|
6
6
|
*/
|
|
7
|
-
var __assign = (this && this.__assign) || function () {
|
|
8
|
-
__assign = Object.assign || function(t) {
|
|
9
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
10
|
-
s = arguments[i];
|
|
11
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
12
|
-
t[p] = s[p];
|
|
13
|
-
}
|
|
14
|
-
return t;
|
|
15
|
-
};
|
|
16
|
-
return __assign.apply(this, arguments);
|
|
17
|
-
};
|
|
18
7
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
8
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
9
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -23,55 +12,50 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
23
12
|
};
|
|
24
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
14
|
exports.GitpodFileParser = void 0;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
15
|
+
const inversify_1 = require("inversify");
|
|
16
|
+
const yaml = require("js-yaml");
|
|
17
|
+
const Ajv = require("ajv");
|
|
18
|
+
const logging_1 = require("./util/logging");
|
|
19
|
+
const protocol_1 = require("./protocol");
|
|
20
|
+
const schema = require('../data/gitpod-schema.json');
|
|
21
|
+
const validate = new Ajv().compile(schema);
|
|
22
|
+
const defaultParseOptions = {
|
|
34
23
|
acceptPortRanges: false,
|
|
35
24
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
GitpodFileParser.prototype.parse = function (content, parseOptions, defaultConfig) {
|
|
40
|
-
if (parseOptions === void 0) { parseOptions = {}; }
|
|
41
|
-
if (defaultConfig === void 0) { defaultConfig = {}; }
|
|
42
|
-
var options = __assign(__assign({}, defaultParseOptions), parseOptions);
|
|
25
|
+
let GitpodFileParser = class GitpodFileParser {
|
|
26
|
+
parse(content, parseOptions = {}, defaultConfig = {}) {
|
|
27
|
+
const options = Object.assign(Object.assign({}, defaultParseOptions), parseOptions);
|
|
43
28
|
try {
|
|
44
|
-
|
|
29
|
+
const parsedConfig = yaml.safeLoad(content);
|
|
45
30
|
validate(parsedConfig);
|
|
46
|
-
|
|
31
|
+
const validationErrors = validate.errors ? validate.errors.map(e => e.message || e.keyword) : undefined;
|
|
47
32
|
if (validationErrors && validationErrors.length > 0) {
|
|
48
33
|
return {
|
|
49
34
|
config: defaultConfig,
|
|
50
|
-
parsedConfig
|
|
51
|
-
validationErrors
|
|
35
|
+
parsedConfig,
|
|
36
|
+
validationErrors
|
|
52
37
|
};
|
|
53
38
|
}
|
|
54
|
-
|
|
39
|
+
const overrides = {};
|
|
55
40
|
if (!options.acceptPortRanges && Array.isArray(parsedConfig.ports)) {
|
|
56
|
-
overrides.ports = parsedConfig.ports.filter(
|
|
41
|
+
overrides.ports = parsedConfig.ports.filter((port) => !protocol_1.PortRangeConfig.is(port));
|
|
57
42
|
}
|
|
58
43
|
return {
|
|
59
|
-
config:
|
|
60
|
-
parsedConfig
|
|
44
|
+
config: Object.assign(Object.assign(Object.assign({}, defaultConfig), parsedConfig), overrides),
|
|
45
|
+
parsedConfig
|
|
61
46
|
};
|
|
62
47
|
}
|
|
63
48
|
catch (err) {
|
|
64
|
-
logging_1.log.error('Unparsable Gitpod configuration', err, { content
|
|
49
|
+
logging_1.log.error('Unparsable Gitpod configuration', err, { content });
|
|
65
50
|
return {
|
|
66
51
|
config: defaultConfig,
|
|
67
52
|
validationErrors: ['Unparsable Gitpod configuration: ' + err.toString()]
|
|
68
53
|
};
|
|
69
54
|
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}());
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
GitpodFileParser = __decorate([
|
|
58
|
+
(0, inversify_1.injectable)()
|
|
59
|
+
], GitpodFileParser);
|
|
76
60
|
exports.GitpodFileParser = GitpodFileParser;
|
|
77
61
|
//# sourceMappingURL=gitpod-file-parser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitpod-file-parser.js","sourceRoot":"","sources":["../src/gitpod-file-parser.ts"],"names":[],"mappings":";AAAA;;;;GAIG
|
|
1
|
+
{"version":3,"file":"gitpod-file-parser.js","sourceRoot":"","sources":["../src/gitpod-file-parser.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;AAEH,yCAAuC;AACvC,gCAAgC;AAChC,2BAA2B;AAC3B,4CAAqC;AACrC,yCAA8D;AAI9D,MAAM,MAAM,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;AACrD,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAC3C,MAAM,mBAAmB,GAAG;IACxB,gBAAgB,EAAE,KAAK;CAC1B,CAAC;AASF,IAAa,gBAAgB,GAA7B,MAAa,gBAAgB;IAElB,KAAK,CAAC,OAAe,EAAE,YAAY,GAAG,EAAE,EAAE,gBAAiC,EAAE;QAChF,MAAM,OAAO,mCACP,mBAAmB,GACnB,YAAY,CACjB,CAAC;QACF,IAAI;YACA,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAQ,CAAC;YACnD,QAAQ,CAAC,YAAY,CAAC,CAAC;YACvB,MAAM,gBAAgB,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,CAAE,CAAC,CAAC,CAAC,SAAS,CAAC;YAC1G,IAAI,gBAAgB,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;gBACjD,OAAO;oBACH,MAAM,EAAE,aAAa;oBACrB,YAAY;oBACZ,gBAAgB;iBACnB,CAAC;aACL;YACD,MAAM,SAAS,GAAG,EAAS,CAAC;YAC5B,IAAI,CAAC,OAAO,CAAC,gBAAgB,IAAI,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE;gBAChE,SAAS,CAAC,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,CAAC,0BAAe,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;aACzF;YACD,OAAO;gBACH,MAAM,gDACE,aAAa,GACb,YAAY,GACZ,SAAS,CAChB;gBACD,YAAY;aACf,CAAC;SACL;QAAC,OAAO,GAAG,EAAE;YACV,aAAG,CAAC,KAAK,CAAC,iCAAiC,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;YAC/D,OAAO;gBACH,MAAM,EAAE,aAAa;gBACrB,gBAAgB,EAAE,CAAC,mCAAmC,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;aAC3E,CAAC;SACL;IACL,CAAC;CACJ,CAAA;AAtCY,gBAAgB;IAD5B,IAAA,sBAAU,GAAE;GACA,gBAAgB,CAsC5B;AAtCY,4CAAgB"}
|
|
@@ -14,46 +14,44 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
14
14
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
TestGitpodFileParser.prototype.before = function () {
|
|
17
|
+
const mocha_typescript_1 = require("mocha-typescript");
|
|
18
|
+
const chai = require("chai");
|
|
19
|
+
const gitpod_file_parser_1 = require("./gitpod-file-parser");
|
|
20
|
+
const expect = chai.expect;
|
|
21
|
+
const DEFAULT_IMAGE = "default-image";
|
|
22
|
+
const DEFAULT_CONFIG = { image: DEFAULT_IMAGE };
|
|
23
|
+
let TestGitpodFileParser = class TestGitpodFileParser {
|
|
24
|
+
before() {
|
|
27
25
|
this.parser = new gitpod_file_parser_1.GitpodFileParser();
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
}
|
|
27
|
+
testOnlyOnePort() {
|
|
28
|
+
const content = `ports:\n` +
|
|
29
|
+
` - port: 5555`;
|
|
30
|
+
const result = this.parser.parse(content, {}, DEFAULT_CONFIG);
|
|
33
31
|
expect(result.config).to.deep.equal({
|
|
34
32
|
ports: [{
|
|
35
33
|
port: 5555
|
|
36
34
|
}],
|
|
37
35
|
image: DEFAULT_IMAGE
|
|
38
36
|
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
}
|
|
38
|
+
testPortRange() {
|
|
39
|
+
const content = `ports:\n` +
|
|
40
|
+
` - port: 5555\n` +
|
|
41
|
+
` - port: 3000-3999`; // should be filtered out by default
|
|
42
|
+
const result = this.parser.parse(content, {}, DEFAULT_CONFIG);
|
|
45
43
|
expect(result.config).to.deep.equal({
|
|
46
44
|
ports: [{
|
|
47
45
|
port: 5555
|
|
48
46
|
}],
|
|
49
47
|
image: DEFAULT_IMAGE
|
|
50
48
|
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
49
|
+
}
|
|
50
|
+
testPortRangeAccepted() {
|
|
51
|
+
const content = `ports:\n` +
|
|
52
|
+
` - port: 5555\n` +
|
|
53
|
+
` - port: 3000-3999`; // should be included if explicitly supported
|
|
54
|
+
const result = this.parser.parse(content, { acceptPortRanges: true }, DEFAULT_CONFIG);
|
|
57
55
|
expect(result.config).to.deep.equal({
|
|
58
56
|
ports: [{
|
|
59
57
|
port: 5555
|
|
@@ -62,123 +60,125 @@ var TestGitpodFileParser = /** @class */ (function () {
|
|
|
62
60
|
}],
|
|
63
61
|
image: DEFAULT_IMAGE
|
|
64
62
|
});
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
}
|
|
64
|
+
testSimpleTask() {
|
|
65
|
+
const content = `tasks:\n` +
|
|
66
|
+
` - command: yarn`;
|
|
67
|
+
const result = this.parser.parse(content, {}, DEFAULT_CONFIG);
|
|
70
68
|
expect(result.config).to.deep.equal({
|
|
71
69
|
tasks: [{
|
|
72
70
|
command: "yarn"
|
|
73
71
|
}],
|
|
74
72
|
image: DEFAULT_IMAGE
|
|
75
73
|
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
}
|
|
75
|
+
testSimpleImage() {
|
|
76
|
+
const imageName = "my-test-org/my-test-image:some-tag";
|
|
77
|
+
const content = `image: "${imageName}"\n`;
|
|
78
|
+
const result = this.parser.parse(content);
|
|
81
79
|
expect(result.config).to.deep.equal({
|
|
82
80
|
image: imageName
|
|
83
81
|
});
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
82
|
+
}
|
|
83
|
+
testComplexImageWithoutContext() {
|
|
84
|
+
const dockerFileName = 'Dockerfile';
|
|
85
|
+
const content = `image:\n file: ${dockerFileName}\n`;
|
|
86
|
+
const result = this.parser.parse(content);
|
|
89
87
|
expect(result.config).to.deep.equal({
|
|
90
88
|
image: {
|
|
91
89
|
file: dockerFileName
|
|
92
90
|
}
|
|
93
91
|
});
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
92
|
+
}
|
|
93
|
+
testComplexImageWithContext() {
|
|
94
|
+
const dockerFileName = 'Dockerfile';
|
|
95
|
+
const dockerContext = 'docker';
|
|
96
|
+
const content = `image:\n file: ${dockerFileName}\n context: ${dockerContext}\n`;
|
|
97
|
+
const result = this.parser.parse(content);
|
|
100
98
|
expect(result.config).to.deep.equal({
|
|
101
99
|
image: {
|
|
102
100
|
file: dockerFileName,
|
|
103
101
|
context: dockerContext
|
|
104
102
|
}
|
|
105
103
|
});
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
104
|
+
}
|
|
105
|
+
testGitconfig() {
|
|
106
|
+
const content = `
|
|
107
|
+
gitConfig:
|
|
108
|
+
core.autocrlf: input
|
|
109
|
+
`;
|
|
110
|
+
const result = this.parser.parse(content, {}, DEFAULT_CONFIG);
|
|
110
111
|
expect(result.config).to.deep.equal({
|
|
111
112
|
gitConfig: {
|
|
112
113
|
"core.autocrlf": "input"
|
|
113
114
|
},
|
|
114
115
|
image: DEFAULT_IMAGE
|
|
115
116
|
});
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
}
|
|
118
|
+
testBrokenConfig() {
|
|
119
|
+
const content = `image: 42\n`;
|
|
120
|
+
const result = this.parser.parse(content, {}, DEFAULT_CONFIG);
|
|
120
121
|
expect(result.config).to.deep.equal({
|
|
121
122
|
image: DEFAULT_IMAGE
|
|
122
123
|
});
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}());
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
__decorate([
|
|
127
|
+
mocha_typescript_1.test,
|
|
128
|
+
__metadata("design:type", Function),
|
|
129
|
+
__metadata("design:paramtypes", []),
|
|
130
|
+
__metadata("design:returntype", void 0)
|
|
131
|
+
], TestGitpodFileParser.prototype, "testOnlyOnePort", null);
|
|
132
|
+
__decorate([
|
|
133
|
+
mocha_typescript_1.test,
|
|
134
|
+
__metadata("design:type", Function),
|
|
135
|
+
__metadata("design:paramtypes", []),
|
|
136
|
+
__metadata("design:returntype", void 0)
|
|
137
|
+
], TestGitpodFileParser.prototype, "testPortRange", null);
|
|
138
|
+
__decorate([
|
|
139
|
+
mocha_typescript_1.test,
|
|
140
|
+
__metadata("design:type", Function),
|
|
141
|
+
__metadata("design:paramtypes", []),
|
|
142
|
+
__metadata("design:returntype", void 0)
|
|
143
|
+
], TestGitpodFileParser.prototype, "testPortRangeAccepted", null);
|
|
144
|
+
__decorate([
|
|
145
|
+
mocha_typescript_1.test,
|
|
146
|
+
__metadata("design:type", Function),
|
|
147
|
+
__metadata("design:paramtypes", []),
|
|
148
|
+
__metadata("design:returntype", void 0)
|
|
149
|
+
], TestGitpodFileParser.prototype, "testSimpleTask", null);
|
|
150
|
+
__decorate([
|
|
151
|
+
mocha_typescript_1.test,
|
|
152
|
+
__metadata("design:type", Function),
|
|
153
|
+
__metadata("design:paramtypes", []),
|
|
154
|
+
__metadata("design:returntype", void 0)
|
|
155
|
+
], TestGitpodFileParser.prototype, "testSimpleImage", null);
|
|
156
|
+
__decorate([
|
|
157
|
+
mocha_typescript_1.test,
|
|
158
|
+
__metadata("design:type", Function),
|
|
159
|
+
__metadata("design:paramtypes", []),
|
|
160
|
+
__metadata("design:returntype", void 0)
|
|
161
|
+
], TestGitpodFileParser.prototype, "testComplexImageWithoutContext", null);
|
|
162
|
+
__decorate([
|
|
163
|
+
mocha_typescript_1.test,
|
|
164
|
+
__metadata("design:type", Function),
|
|
165
|
+
__metadata("design:paramtypes", []),
|
|
166
|
+
__metadata("design:returntype", void 0)
|
|
167
|
+
], TestGitpodFileParser.prototype, "testComplexImageWithContext", null);
|
|
168
|
+
__decorate([
|
|
169
|
+
mocha_typescript_1.test,
|
|
170
|
+
__metadata("design:type", Function),
|
|
171
|
+
__metadata("design:paramtypes", []),
|
|
172
|
+
__metadata("design:returntype", void 0)
|
|
173
|
+
], TestGitpodFileParser.prototype, "testGitconfig", null);
|
|
174
|
+
__decorate([
|
|
175
|
+
mocha_typescript_1.test,
|
|
176
|
+
__metadata("design:type", Function),
|
|
177
|
+
__metadata("design:paramtypes", []),
|
|
178
|
+
__metadata("design:returntype", void 0)
|
|
179
|
+
], TestGitpodFileParser.prototype, "testBrokenConfig", null);
|
|
180
|
+
TestGitpodFileParser = __decorate([
|
|
181
|
+
mocha_typescript_1.suite
|
|
182
|
+
], TestGitpodFileParser);
|
|
183
183
|
module.exports = new TestGitpodFileParser(); // Only to circumvent no usage warning :-/
|
|
184
184
|
//# sourceMappingURL=gitpod-file-parser.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitpod-file-parser.spec.js","sourceRoot":"","sources":["../src/gitpod-file-parser.spec.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;AAEH,
|
|
1
|
+
{"version":3,"file":"gitpod-file-parser.spec.js","sourceRoot":"","sources":["../src/gitpod-file-parser.spec.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;AAEH,uDAA8C;AAC9C,6BAA4B;AAG5B,6DAAwD;AAExD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;AAE1B,MAAM,aAAa,GAAG,eAAe,CAAC;AACtC,MAAM,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