@gitpod/gitpod-protocol 0.1.5-ps-commit-email-fork.0 → 0.1.5-release-2022.6.1.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/data/gitpod-schema.json +206 -28
- package/lib/accounting-protocol.d.ts +17 -13
- package/lib/accounting-protocol.d.ts.map +1 -1
- package/lib/accounting-protocol.js +39 -47
- package/lib/accounting-protocol.js.map +1 -1
- package/lib/admin-protocol.d.ts +21 -4
- package/lib/admin-protocol.d.ts.map +1 -1
- package/lib/admin-protocol.js +2 -13
- package/lib/admin-protocol.js.map +1 -1
- package/lib/analytics.d.ts +44 -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.map +1 -1
- 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/{util/context-url.spec.d.ts → context-url.spec.d.ts} +4 -0
- package/lib/context-url.spec.d.ts.map +1 -0
- package/lib/context-url.spec.js +109 -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.d.ts.map +1 -1
- package/lib/encryption/container-module.js +4 -4
- package/lib/encryption/container-module.js.map +1 -1
- package/lib/encryption/encryption-engine.d.ts.map +1 -1
- package/lib/encryption/encryption-engine.js +25 -26
- package/lib/encryption/encryption-engine.js.map +1 -1
- package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
- package/lib/encryption/encryption-engine.spec.js +29 -37
- package/lib/encryption/encryption-engine.spec.js.map +1 -1
- package/lib/encryption/encryption-service.d.ts.map +1 -1
- package/lib/encryption/encryption-service.js +30 -44
- package/lib/encryption/encryption-service.js.map +1 -1
- package/lib/encryption/key-provider.d.ts.map +1 -1
- package/lib/encryption/key-provider.js +31 -38
- package/lib/encryption/key-provider.js.map +1 -1
- package/lib/env.d.ts +0 -6
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +7 -27
- package/lib/env.js.map +1 -1
- package/lib/experiments/always-default.d.ts +8 -0
- package/lib/experiments/always-default.d.ts.map +1 -0
- package/lib/experiments/always-default.js +20 -0
- package/lib/experiments/always-default.js.map +1 -0
- package/lib/experiments/configcat-server.d.ts +8 -0
- package/lib/experiments/configcat-server.d.ts.map +1 -0
- package/lib/experiments/configcat-server.js +34 -0
- package/lib/experiments/configcat-server.js.map +1 -0
- package/lib/experiments/configcat.d.ts +21 -0
- package/lib/experiments/configcat.d.ts.map +1 -0
- package/lib/experiments/configcat.js +47 -0
- package/lib/experiments/configcat.js.map +1 -0
- package/lib/experiments/types.d.ts +19 -0
- package/lib/experiments/types.d.ts.map +1 -0
- package/lib/{util/without.js → experiments/types.js} +2 -2
- package/lib/experiments/types.js.map +1 -0
- package/lib/gitpod-file-parser.d.ts.map +1 -1
- package/lib/gitpod-file-parser.js +26 -42
- package/lib/gitpod-file-parser.js.map +1 -1
- package/lib/gitpod-file-parser.spec.js +145 -142
- package/lib/gitpod-file-parser.spec.js.map +1 -1
- package/lib/gitpod-service.d.ts +140 -38
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +181 -317
- package/lib/gitpod-service.js.map +1 -1
- package/lib/headless-workspace-log.d.ts +9 -11
- package/lib/headless-workspace-log.d.ts.map +1 -1
- package/lib/headless-workspace-log.js +6 -8
- package/lib/headless-workspace-log.js.map +1 -1
- package/lib/ide-frontend-service.d.ts +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 +16 -10
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +6 -0
- package/lib/index.js.map +1 -1
- package/lib/installation-admin-protocol.d.ts +30 -0
- package/lib/installation-admin-protocol.d.ts.map +1 -0
- package/lib/installation-admin-protocol.js +31 -0
- package/lib/installation-admin-protocol.js.map +1 -0
- package/lib/license-protocol.d.ts +7 -0
- package/lib/license-protocol.d.ts.map +1 -1
- package/lib/license-protocol.js.map +1 -1
- package/lib/messaging/browser/connection.d.ts +3 -3
- package/lib/messaging/browser/connection.d.ts.map +1 -1
- package/lib/messaging/browser/connection.js +173 -36
- package/lib/messaging/browser/connection.js.map +1 -1
- package/lib/messaging/browser/window-connection.d.ts +4 -4
- package/lib/messaging/browser/window-connection.d.ts.map +1 -1
- package/lib/messaging/browser/window-connection.js +42 -59
- 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/handler.js +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 +24 -60
- package/lib/messaging/node/connection.js.map +1 -1
- package/lib/messaging/proxy-factory.d.ts +3 -1
- package/lib/messaging/proxy-factory.d.ts.map +1 -1
- package/lib/messaging/proxy-factory.js +75 -162
- 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.map +1 -1
- package/lib/payment-protocol.js +1 -1
- package/lib/payment-protocol.js.map +1 -1
- package/lib/permission.d.ts +10 -3
- package/lib/permission.d.ts.map +1 -1
- package/lib/permission.js +41 -31
- package/lib/permission.js.map +1 -1
- package/lib/plans.d.ts +4 -4
- package/lib/plans.d.ts.map +1 -1
- package/lib/plans.js +225 -209
- package/lib/plans.js.map +1 -1
- package/lib/protocol.d.ts +172 -85
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +230 -187
- 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 +22 -4
- package/lib/team-subscription-protocol.d.ts.map +1 -1
- package/lib/team-subscription-protocol.js +31 -17
- package/lib/team-subscription-protocol.js.map +1 -1
- package/lib/teams-projects-protocol.d.ts +118 -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/typings/globals.d.ts +2 -2
- package/lib/typings/globals.d.ts.map +1 -1
- package/lib/util/analytics.d.ts +8 -0
- package/lib/util/analytics.d.ts.map +1 -0
- package/lib/util/analytics.js +88 -0
- package/lib/util/analytics.js.map +1 -0
- package/lib/util/async-iterator.d.ts.map +1 -1
- package/lib/util/async-iterator.js +57 -135
- 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 +11 -11
- package/lib/util/date-time.js.map +1 -1
- package/lib/util/debug-app.d.ts +25 -0
- package/lib/util/debug-app.d.ts.map +1 -0
- package/lib/util/debug-app.js +100 -0
- package/lib/util/debug-app.js.map +1 -0
- package/lib/util/deferred.js +10 -12
- package/lib/util/deferred.js.map +1 -1
- package/lib/util/disposable.d.ts.map +1 -1
- package/lib/util/disposable.js +27 -40
- package/lib/util/disposable.js.map +1 -1
- package/lib/util/event.d.ts.map +1 -1
- package/lib/util/event.js +63 -77
- 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 +27 -47
- package/lib/util/garbage-collected-cache.js.map +1 -1
- package/lib/util/generate-workspace-id.d.ts +6 -1
- package/lib/util/generate-workspace-id.d.ts.map +1 -1
- package/lib/util/generate-workspace-id.js +469 -502
- package/lib/util/generate-workspace-id.js.map +1 -1
- package/lib/util/generate-workspace-id.spec.js +68 -78
- package/lib/util/generate-workspace-id.spec.js.map +1 -1
- 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 +41 -0
- package/lib/util/gitpod-cookie.js.map +1 -0
- package/lib/util/gitpod-host-url.d.ts +1 -2
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +108 -109
- package/lib/util/gitpod-host-url.js.map +1 -1
- package/lib/util/gitpod-host-url.spec.d.ts +6 -0
- package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.spec.js +112 -30
- 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/{theia-plugins.js → util/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 +125 -129
- package/lib/util/logging.js.map +1 -1
- package/lib/util/make-link.js +5 -5
- package/lib/util/make-link.js.map +1 -1
- package/lib/util/parse-workspace-id.d.ts +10 -0
- package/lib/util/parse-workspace-id.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.js +30 -7
- package/lib/util/parse-workspace-id.js.map +1 -1
- package/lib/util/parse-workspace-id.spec.d.ts +4 -0
- package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.spec.js +123 -84
- 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 +147 -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.d.ts.map +1 -1
- package/lib/util/semaphore.js +15 -46
- package/lib/util/semaphore.js.map +1 -1
- package/lib/util/skip-if.d.ts.map +1 -1
- package/lib/util/skip-if.js +6 -6
- package/lib/util/skip-if.js.map +1 -1
- package/lib/util/timeutil.d.ts +1 -0
- package/lib/util/timeutil.d.ts.map +1 -1
- package/lib/util/timeutil.js +23 -17
- package/lib/util/timeutil.js.map +1 -1
- package/lib/util/timeutil.spec.d.ts.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 +52 -6
- package/lib/util/tracing.d.ts.map +1 -1
- package/lib/util/tracing.js +197 -64
- 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.d.ts +7 -7
- package/lib/util/workspace-port-authentication.d.ts.map +1 -1
- package/lib/util/workspace-port-authentication.js +9 -12
- package/lib/util/workspace-port-authentication.js.map +1 -1
- package/lib/workspace-cluster.d.ts +24 -3
- package/lib/workspace-cluster.d.ts.map +1 -1
- package/lib/workspace-cluster.js +19 -4
- package/lib/workspace-cluster.js.map +1 -1
- package/lib/workspace-instance.d.ts +42 -5
- package/lib/workspace-instance.d.ts.map +1 -1
- package/lib/wsready.d.ts +1 -1
- package/lib/wsready.d.ts.map +1 -1
- package/lib/wsready.js +2 -2
- package/lib/wsready.js.map +1 -1
- package/package.json +35 -18
- package/pkg-yarn.lock +20 -10
- package/provenance-bundle.jsonl +2 -0
- package/src/accounting-protocol.ts +63 -57
- package/src/admin-protocol.ts +43 -21
- package/src/analytics.ts +52 -0
- package/src/auth.ts +2 -2
- package/src/context-url.spec.ts +67 -0
- package/src/context-url.ts +109 -0
- package/src/email-protocol.ts +5 -7
- package/src/encryption/container-module.ts +2 -3
- package/src/encryption/encryption-engine.spec.ts +9 -8
- package/src/encryption/encryption-engine.ts +14 -14
- package/src/encryption/encryption-service.ts +4 -5
- package/src/encryption/key-provider.ts +16 -19
- package/src/env.ts +0 -22
- package/src/experiments/always-default.ts +24 -0
- package/src/experiments/configcat-server.ts +37 -0
- package/src/experiments/configcat.ts +53 -0
- package/src/experiments/types.ts +32 -0
- package/src/gitpod-file-parser.spec.ts +55 -61
- package/src/gitpod-file-parser.ts +16 -17
- package/src/gitpod-service.ts +278 -127
- package/src/headless-workspace-log.ts +12 -14
- package/src/ide-frontend-service.ts +2 -2
- package/src/ide-protocol.ts +119 -0
- package/src/index.ts +16 -10
- package/src/installation-admin-protocol.ts +45 -0
- package/src/license-protocol.ts +12 -6
- package/src/messaging/browser/connection.ts +185 -21
- package/src/messaging/browser/window-connection.ts +39 -29
- package/src/messaging/client-call-metrics.ts +96 -0
- package/src/messaging/error.ts +15 -5
- package/src/messaging/handler.ts +13 -1
- package/src/messaging/node/connection.ts +23 -70
- package/src/messaging/proxy-factory.ts +35 -34
- package/src/oss-allowlist.ts +15 -0
- package/src/payment-protocol.ts +2 -2
- package/src/permission.ts +42 -33
- package/src/plans.ts +236 -189
- package/src/protocol.ts +454 -276
- package/src/snapshot-url.spec.ts +27 -0
- package/src/snapshot-url.ts +27 -0
- package/src/team-subscription-protocol.ts +59 -23
- package/src/teams-projects-protocol.ts +153 -0
- package/src/typings/globals.ts +4 -4
- package/src/util/analytics.ts +109 -0
- package/src/util/async-iterator.ts +4 -5
- package/src/util/cancelable.ts +3 -3
- package/src/util/date-time.ts +8 -8
- package/src/util/debug-app.ts +81 -0
- package/src/util/deferred.ts +6 -6
- package/src/util/disposable.ts +3 -6
- package/src/util/event.ts +9 -11
- package/src/util/garbage-collected-cache.ts +9 -6
- package/src/util/generate-workspace-id.spec.ts +37 -10
- package/src/util/generate-workspace-id.ts +464 -438
- package/src/util/gitpod-cookie.ts +38 -0
- package/src/util/gitpod-host-url.spec.ts +58 -7
- package/src/util/gitpod-host-url.ts +52 -40
- package/src/util/grpc.ts +15 -0
- package/src/util/jaeger-client-types.ts +102 -0
- package/src/util/logging.ts +145 -72
- package/src/util/make-link.ts +6 -7
- package/src/util/parse-workspace-id.spec.ts +37 -8
- package/src/util/parse-workspace-id.ts +32 -7
- package/src/util/queue.spec.ts +27 -25
- package/src/util/repeat.ts +45 -0
- package/src/util/semaphore.ts +4 -6
- package/src/util/skip-if.ts +9 -6
- package/src/util/timeutil.spec.ts +14 -15
- package/src/util/timeutil.ts +21 -11
- package/src/util/tracing.spec.ts +88 -0
- package/src/util/tracing.ts +200 -31
- package/src/util/workspace-port-authentication.ts +10 -13
- package/src/workspace-cluster.ts +34 -7
- package/src/workspace-instance.ts +91 -31
- package/src/wsready.ts +3 -3
- package/data/builtin-theia-plugins.json +0 -372
- 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/theia-plugins.d.ts +0 -11
- package/lib/theia-plugins.d.ts.map +0 -1
- package/lib/theia-plugins.js.map +0 -1
- package/lib/util/context-url.d.ts +0 -13
- package/lib/util/context-url.d.ts.map +0 -1
- package/lib/util/context-url.js +0 -26
- package/lib/util/context-url.js.map +0 -1
- package/lib/util/context-url.spec.d.ts.map +0 -1
- package/lib/util/context-url.spec.js +0 -52
- package/lib/util/context-url.spec.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 +0 -7
- 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/theia-plugins.ts +0 -11
- package/src/util/context-url.spec.ts +0 -25
- package/src/util/context-url.ts +0 -23
- package/src/util/jaeger-client.d.ts +0 -105
- package/src/util/repeater.ts +0 -49
- package/src/util/safe-promise.ts +0 -26
|
@@ -15,45 +15,37 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.t = void 0;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
const mocha_typescript_1 = require("mocha-typescript");
|
|
19
|
+
const chai = require("chai");
|
|
20
|
+
const path = require("path");
|
|
21
|
+
const fs = require("fs");
|
|
22
|
+
const encryption_engine_1 = require("./encryption-engine");
|
|
23
|
+
const expect = chai.expect;
|
|
24
|
+
let TestEncryptionEngineImpl = class TestEncryptionEngineImpl {
|
|
25
|
+
// Created with openssl rand -rand /dev/urandom -out key -base64 32
|
|
26
|
+
get testkey() {
|
|
27
|
+
const keyFilePath = path.resolve(__dirname, "../../test/fixtures/encryption/testkey");
|
|
28
|
+
const keyBuffer = fs.readFileSync(keyFilePath);
|
|
29
|
+
return keyBuffer.toString().trim();
|
|
26
30
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return keyBuffer.toString().trim();
|
|
33
|
-
},
|
|
34
|
-
enumerable: false,
|
|
35
|
-
configurable: true
|
|
36
|
-
});
|
|
37
|
-
;
|
|
38
|
-
TestEncryptionEngineImpl.prototype.basicSymmetry = function () {
|
|
39
|
-
var plaintext = "12345678901234567890";
|
|
40
|
-
var key = new Buffer(this.testkey, 'base64');
|
|
41
|
-
var cut = new encryption_engine_1.EncryptionEngineImpl();
|
|
42
|
-
var encryptedData = cut.encrypt(plaintext, key);
|
|
31
|
+
basicSymmetry() {
|
|
32
|
+
const plaintext = "12345678901234567890";
|
|
33
|
+
const key = new Buffer(this.testkey, "base64");
|
|
34
|
+
const cut = new encryption_engine_1.EncryptionEngineImpl();
|
|
35
|
+
const encryptedData = cut.encrypt(plaintext, key);
|
|
43
36
|
expect(encryptedData).to.be.not.undefined;
|
|
44
|
-
|
|
37
|
+
const decryptedPlaintext = cut.decrypt(encryptedData, key);
|
|
45
38
|
expect(decryptedPlaintext).equals(plaintext);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}());
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
__decorate([
|
|
42
|
+
mocha_typescript_1.test,
|
|
43
|
+
__metadata("design:type", Function),
|
|
44
|
+
__metadata("design:paramtypes", []),
|
|
45
|
+
__metadata("design:returntype", void 0)
|
|
46
|
+
], TestEncryptionEngineImpl.prototype, "basicSymmetry", null);
|
|
47
|
+
TestEncryptionEngineImpl = __decorate([
|
|
48
|
+
mocha_typescript_1.suite
|
|
49
|
+
], TestEncryptionEngineImpl);
|
|
58
50
|
exports.t = new TestEncryptionEngineImpl();
|
|
59
51
|
//# sourceMappingURL=encryption-engine.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encryption-engine.spec.js","sourceRoot":"","sources":["../../src/encryption/encryption-engine.spec.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,
|
|
1
|
+
{"version":3,"file":"encryption-engine.spec.js","sourceRoot":"","sources":["../../src/encryption/encryption-engine.spec.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,uDAA+C;AAC/C,6BAA6B;AAC7B,6BAA6B;AAC7B,yBAAyB;AAEzB,2DAA2D;AAE3D,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAG3B,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAC1B,mEAAmE;IACnE,IAAc,OAAO;QACjB,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,wCAAwC,CAAC,CAAC;QACtF,MAAM,SAAS,GAAG,EAAE,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QAC/C,OAAO,SAAS,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC;IACvC,CAAC;IAEK,aAAa;QACf,MAAM,SAAS,GAAG,sBAAsB,CAAC;QACzC,MAAM,GAAG,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAE/C,MAAM,GAAG,GAAG,IAAI,wCAAoB,EAAE,CAAC;QACvC,MAAM,aAAa,GAAG,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;QAClD,MAAM,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC;QAE1C,MAAM,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;QAC3D,MAAM,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACjD,CAAC;CACJ,CAAA;AAXS;IAAL,uBAAI;;;;6DAUJ;AAlBC,wBAAwB;IAD7B,wBAAK;GACA,wBAAwB,CAmB7B;AACY,QAAA,CAAC,GAAG,IAAI,wBAAwB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encryption-service.d.ts","sourceRoot":"","sources":["../../src/encryption/encryption-service.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"encryption-service.d.ts","sourceRoot":"","sources":["../../src/encryption/encryption-service.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE1D,MAAM,WAAW,SAAS,CAAC,EAAE,CAAE,SAAQ,aAAa;IAChD,WAAW,EAAE,WAAW,CAAC;CAC5B;AAED,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAC7D,MAAM,WAAW,iBAAiB;IAC9B,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;IAClC,OAAO,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CAC1C;AAED,qBACa,qBAAsB,YAAW,iBAAiB;IACjC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IACjD,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAEjE,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC;IAWjC,OAAO,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC;IAMtC,SAAS,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM;IAItC,SAAS,CAAC,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;CAG5C"}
|
|
@@ -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);
|
|
@@ -26,42 +15,39 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
26
15
|
};
|
|
27
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
17
|
exports.EncryptionServiceImpl = exports.EncryptionService = void 0;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
exports.EncryptionService = Symbol(
|
|
33
|
-
|
|
34
|
-
|
|
18
|
+
const inversify_1 = require("inversify");
|
|
19
|
+
const encryption_engine_1 = require("./encryption-engine");
|
|
20
|
+
const key_provider_1 = require("./key-provider");
|
|
21
|
+
exports.EncryptionService = Symbol("EncryptionService");
|
|
22
|
+
let EncryptionServiceImpl = class EncryptionServiceImpl {
|
|
23
|
+
encrypt(data) {
|
|
24
|
+
const dataStr = this.serialize(data);
|
|
25
|
+
const key = this.keyProvider.getPrimaryKey();
|
|
26
|
+
const encryptedData = this.engine.encrypt(dataStr, key.material);
|
|
27
|
+
return Object.assign(Object.assign({}, encryptedData), { keyMetadata: key.metadata });
|
|
35
28
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
var encryptedData = this.engine.encrypt(dataStr, key.material);
|
|
40
|
-
return __assign(__assign({}, encryptedData), { keyMetadata: key.metadata });
|
|
41
|
-
};
|
|
42
|
-
EncryptionServiceImpl.prototype.decrypt = function (encrypted) {
|
|
43
|
-
var key = this.keyProvider.getKeyFor(encrypted.keyMetadata);
|
|
44
|
-
var serializedData = this.engine.decrypt(encrypted, key.material);
|
|
29
|
+
decrypt(encrypted) {
|
|
30
|
+
const key = this.keyProvider.getKeyFor(encrypted.keyMetadata);
|
|
31
|
+
const serializedData = this.engine.decrypt(encrypted, key.material);
|
|
45
32
|
return this.deserialize(serializedData);
|
|
46
|
-
}
|
|
47
|
-
|
|
33
|
+
}
|
|
34
|
+
serialize(data) {
|
|
48
35
|
return JSON.stringify(data);
|
|
49
|
-
}
|
|
50
|
-
|
|
36
|
+
}
|
|
37
|
+
deserialize(data) {
|
|
51
38
|
return JSON.parse(data);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}());
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, inversify_1.inject)(encryption_engine_1.EncryptionEngine),
|
|
43
|
+
__metadata("design:type", Object)
|
|
44
|
+
], EncryptionServiceImpl.prototype, "engine", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, inversify_1.inject)(key_provider_1.KeyProvider),
|
|
47
|
+
__metadata("design:type", Object)
|
|
48
|
+
], EncryptionServiceImpl.prototype, "keyProvider", void 0);
|
|
49
|
+
EncryptionServiceImpl = __decorate([
|
|
50
|
+
(0, inversify_1.injectable)()
|
|
51
|
+
], EncryptionServiceImpl);
|
|
66
52
|
exports.EncryptionServiceImpl = EncryptionServiceImpl;
|
|
67
53
|
//# sourceMappingURL=encryption-service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encryption-service.js","sourceRoot":"","sources":["../../src/encryption/encryption-service.ts"],"names":[],"mappings":";AAAA;;;;GAIG
|
|
1
|
+
{"version":3,"file":"encryption-service.js","sourceRoot":"","sources":["../../src/encryption/encryption-service.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,yCAA+C;AAE/C,2DAAsE;AACtE,iDAA0D;AAM7C,QAAA,iBAAiB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAO7D,IAAa,qBAAqB,GAAlC,MAAa,qBAAqB;IAI9B,OAAO,CAAI,IAAO;QACd,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACrC,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC;QAE7C,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;QACjE,uCACO,aAAa,KAChB,WAAW,EAAE,GAAG,CAAC,QAAQ,IAC3B;IACN,CAAC;IAED,OAAO,CAAI,SAAuB;QAC9B,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QAC9D,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;QACpE,OAAO,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IAC5C,CAAC;IAES,SAAS,CAAC,IAAS;QACzB,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAES,WAAW,CAAI,IAAY;QACjC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAM,CAAC;IACjC,CAAC;CACJ,CAAA;AA3B6B;IAAzB,IAAA,kBAAM,EAAC,oCAAgB,CAAC;;qDAA6C;AACjD;IAApB,IAAA,kBAAM,EAAC,0BAAW,CAAC;;0DAA6C;AAFxD,qBAAqB;IADjC,IAAA,sBAAU,GAAE;GACA,qBAAqB,CA4BjC;AA5BY,sDAAqB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-provider.d.ts","sourceRoot":"","sources":["../../src/encryption/key-provider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAIH,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"key-provider.d.ts","sourceRoot":"","sources":["../../src/encryption/key-provider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAIH,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,GAAG;IAChB,QAAQ,EAAE,WAAW,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,WAAW,eAAwB,CAAC;AACjD,MAAM,WAAW,WAAW;IACxB,aAAa,IAAI,GAAG,CAAC;IACrB,SAAS,CAAC,QAAQ,EAAE,WAAW,GAAG,GAAG,CAAC;CACzC;AAED,oBAAY,SAAS,GAAG,WAAW,GAAG;IAClC,qBAAqB;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAC7D,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,SAAS,EAAE,CAAC;CACrB;AAED,qBACa,eAAgB,YAAW,WAAW;IASR,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,iBAAiB;IARnF,MAAM,CAAC,2BAA2B,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE;gBAQR,MAAM,EAAE,iBAAiB;IAEnF,SAAS,KAAK,IAAI,gBAEjB;IAED,aAAa,IAAI,GAAG;IAQpB,SAAS,CAAC,QAAQ,EAAE,WAAW,GAAG,GAAG;IAQrC,SAAS,CAAC,WAAW,CAAC,MAAM,EAAE,SAAS,GAAG,GAAG;CAShD"}
|
|
@@ -18,58 +18,51 @@ 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
|
-
|
|
22
|
-
exports.KeyProvider = Symbol(
|
|
23
|
-
exports.KeyProviderConfig = Symbol(
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
const inversify_1 = require("inversify");
|
|
22
|
+
exports.KeyProvider = Symbol("KeyProvider");
|
|
23
|
+
exports.KeyProviderConfig = Symbol("KeyProviderConfig");
|
|
24
|
+
let KeyProviderImpl = class KeyProviderImpl {
|
|
25
|
+
constructor(config) {
|
|
26
26
|
this.config = config;
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (!Array.isArray(keys)
|
|
31
|
-
|
|
32
|
-
|| 1 !== keys.reduce(function (p, k) { return k.primary ? p + 1 : p; }, 0)) {
|
|
33
|
-
throw new Error('Invalid key config!');
|
|
28
|
+
static loadKeyConfigFromJsonString(configStr) {
|
|
29
|
+
const keys = (JSON.parse(configStr) || []);
|
|
30
|
+
if (!Array.isArray(keys) || keys.length < 0 || 1 !== keys.reduce((p, k) => (k.primary ? p + 1 : p), 0)) {
|
|
31
|
+
throw new Error("Invalid key config!");
|
|
34
32
|
}
|
|
35
33
|
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; });
|
|
34
|
+
}
|
|
35
|
+
get keys() {
|
|
36
|
+
return this.config.keys;
|
|
37
|
+
}
|
|
38
|
+
getPrimaryKey() {
|
|
39
|
+
const primaryKey = this.keys.find((key) => !!key.primary);
|
|
46
40
|
if (!primaryKey) {
|
|
47
|
-
throw new Error(
|
|
41
|
+
throw new Error("No primary encryption key found!");
|
|
48
42
|
}
|
|
49
43
|
return this.configToKey(primaryKey);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
}
|
|
45
|
+
getKeyFor(metadata) {
|
|
46
|
+
const key = this.keys.find((k) => k.name === metadata.name && k.version === metadata.version);
|
|
53
47
|
if (!key) {
|
|
54
|
-
throw new Error(
|
|
48
|
+
throw new Error(`No key found for metadata ${metadata.name}/${metadata.version}`);
|
|
55
49
|
}
|
|
56
50
|
return this.configToKey(key);
|
|
57
|
-
}
|
|
58
|
-
|
|
51
|
+
}
|
|
52
|
+
configToKey(config) {
|
|
59
53
|
return {
|
|
60
54
|
metadata: {
|
|
61
55
|
name: config.name,
|
|
62
|
-
version: config.version
|
|
56
|
+
version: config.version,
|
|
63
57
|
},
|
|
64
|
-
material: new Buffer(config.material,
|
|
58
|
+
material: new Buffer(config.material, "base64"),
|
|
65
59
|
};
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}());
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
KeyProviderImpl = __decorate([
|
|
63
|
+
(0, inversify_1.injectable)(),
|
|
64
|
+
__param(0, (0, inversify_1.inject)(exports.KeyProviderConfig)),
|
|
65
|
+
__metadata("design:paramtypes", [Object])
|
|
66
|
+
], KeyProviderImpl);
|
|
74
67
|
exports.KeyProviderImpl = KeyProviderImpl;
|
|
75
68
|
//# 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;IASxB,YAA0D,MAAyB;QAAzB,WAAM,GAAN,MAAM,CAAmB;IAAG,CAAC;IARvF,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,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;YACpG,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;SAC1C;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAID,IAAc,IAAI;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IAC5B,CAAC;IAED,aAAa;QACT,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC1D,IAAI,CAAC,UAAU,EAAE;YACb,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;SACvD;QACD,OAAO,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;IAED,SAAS,CAAC,QAAqB;QAC3B,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI,IAAI,CAAC,CAAC,OAAO,KAAK,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC9F,IAAI,CAAC,GAAG,EAAE;YACN,MAAM,IAAI,KAAK,CAAC,6BAA6B,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;SACrF;QACD,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;IAES,WAAW,CAAC,MAAiB;QACnC,OAAO;YACH,QAAQ,EAAE;gBACN,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,OAAO,EAAE,MAAM,CAAC,OAAO;aAC1B;YACD,QAAQ,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC;SAClD,CAAC;IACN,CAAC;CACJ,CAAA;AAxCY,eAAe;IAD3B,IAAA,sBAAU,GAAE;IAUI,WAAA,IAAA,kBAAM,EAAC,yBAAiB,CAAC,CAAA;;GAT7B,eAAe,CAwC3B;AAxCY,0CAAe"}
|
package/lib/env.d.ts
CHANGED
|
@@ -4,13 +4,7 @@
|
|
|
4
4
|
* See License-AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
export declare abstract class AbstractComponentEnv {
|
|
7
|
-
readonly kubeStage: KubeStage;
|
|
8
|
-
readonly kubeNamespace: string;
|
|
9
|
-
readonly version: string;
|
|
10
|
-
readonly installationLongname: string;
|
|
11
|
-
readonly installationShortname: string;
|
|
12
7
|
}
|
|
13
|
-
export declare type KubeStage = 'production' | 'prodcopy' | 'staging' | 'dev';
|
|
14
8
|
export declare function getEnvVar(name: string, defaultValue?: string): string;
|
|
15
9
|
export declare function filePathTelepresenceAware(filePath: string): string;
|
|
16
10
|
export declare function getEnvVarParsed<T>(name: string, parser: (value: string) => T, defaultValue?: string): T;
|
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;
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,8BACsB,oBAAoB;CACzC;AAED,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
|
@@ -12,37 +12,17 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.getEnvVarParsed = exports.filePathTelepresenceAware = exports.getEnvVar = exports.AbstractComponentEnv = void 0;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"production": "production",
|
|
18
|
-
"staging": "prodcopy",
|
|
19
|
-
"devstaging": "dev",
|
|
20
|
-
"dev": "dev"
|
|
15
|
+
const inversify_1 = require("inversify");
|
|
16
|
+
let AbstractComponentEnv = class AbstractComponentEnv {
|
|
21
17
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var stage = legacyStagenameTranslation[kubeStage];
|
|
26
|
-
if (!stage) {
|
|
27
|
-
throw new Error("Environment variable invalid: KUBE_STAGE=" + kubeStage);
|
|
28
|
-
}
|
|
29
|
-
return stage;
|
|
30
|
-
});
|
|
31
|
-
this.kubeNamespace = getEnvVar('KUBE_NAMESPACE');
|
|
32
|
-
this.version = getEnvVar('VERSION');
|
|
33
|
-
this.installationLongname = getEnvVar("GITPOD_INSTALLATION_LONGNAME");
|
|
34
|
-
this.installationShortname = getEnvVar("GITPOD_INSTALLATION_SHORTNAME");
|
|
35
|
-
}
|
|
36
|
-
AbstractComponentEnv = __decorate([
|
|
37
|
-
inversify_1.injectable()
|
|
38
|
-
], AbstractComponentEnv);
|
|
39
|
-
return AbstractComponentEnv;
|
|
40
|
-
}());
|
|
18
|
+
AbstractComponentEnv = __decorate([
|
|
19
|
+
(0, inversify_1.injectable)()
|
|
20
|
+
], AbstractComponentEnv);
|
|
41
21
|
exports.AbstractComponentEnv = AbstractComponentEnv;
|
|
42
22
|
function getEnvVar(name, defaultValue) {
|
|
43
|
-
|
|
23
|
+
const value = process.env[name] || defaultValue;
|
|
44
24
|
if (!value) {
|
|
45
|
-
throw new Error(
|
|
25
|
+
throw new Error(`Environment variable undefined or empty: ${name}`);
|
|
46
26
|
}
|
|
47
27
|
return value;
|
|
48
28
|
}
|
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;AAGvC,IAAsB,oBAAoB,GAA1C,MAAsB,oBAAoB;CACzC,CAAA;AADqB,oBAAoB;IADzC,IAAA,sBAAU,GAAE;GACS,oBAAoB,CACzC;AADqB,oDAAoB;AAG1C,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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 Gitpod GmbH. All rights reserved.
|
|
3
|
+
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
+
* See License-AGPL.txt in the project root for license information.
|
|
5
|
+
*/
|
|
6
|
+
import { Client } from "./types";
|
|
7
|
+
export declare function newAlwaysReturningDefaultValueClient(): Client;
|
|
8
|
+
//# sourceMappingURL=always-default.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"always-default.d.ts","sourceRoot":"","sources":["../../src/experiments/always-default.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAc,MAAM,EAAE,MAAM,SAAS,CAAC;AAgB7C,wBAAgB,oCAAoC,IAAI,MAAM,CAE7D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.newAlwaysReturningDefaultValueClient = void 0;
|
|
4
|
+
// AlwaysReturningDefaultValueClient is an implemention of an experiments.Client which performs no lookup/network operation
|
|
5
|
+
// and always returns the default value for a given experimentName.
|
|
6
|
+
// This client is used for non-SaaS version of Gitpod, in particular for self-hosted installations where external
|
|
7
|
+
// network connections are not desirable or even possible.
|
|
8
|
+
class AlwaysReturningDefaultValueClient {
|
|
9
|
+
getValueAsync(experimentName, defaultValue, attributes) {
|
|
10
|
+
return Promise.resolve(defaultValue);
|
|
11
|
+
}
|
|
12
|
+
dispose() {
|
|
13
|
+
// there is nothing to dispose, no-op.
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function newAlwaysReturningDefaultValueClient() {
|
|
17
|
+
return new AlwaysReturningDefaultValueClient();
|
|
18
|
+
}
|
|
19
|
+
exports.newAlwaysReturningDefaultValueClient = newAlwaysReturningDefaultValueClient;
|
|
20
|
+
//# sourceMappingURL=always-default.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"always-default.js","sourceRoot":"","sources":["../../src/experiments/always-default.ts"],"names":[],"mappings":";;;AAOA,2HAA2H;AAC3H,mEAAmE;AACnE,iHAAiH;AACjH,0DAA0D;AAC1D,MAAM,iCAAiC;IACnC,aAAa,CAAI,cAAsB,EAAE,YAAe,EAAE,UAAsB;QAC5E,OAAO,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACzC,CAAC;IAED,OAAO;QACH,sCAAsC;IAC1C,CAAC;CACJ;AAED,SAAgB,oCAAoC;IAChD,OAAO,IAAI,iCAAiC,EAAE,CAAC;AACnD,CAAC;AAFD,oFAEC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 Gitpod GmbH. All rights reserved.
|
|
3
|
+
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
+
* See License-AGPL.txt in the project root for license information.
|
|
5
|
+
*/
|
|
6
|
+
import { Client } from "./types";
|
|
7
|
+
export declare function getExperimentsClientForBackend(): Client;
|
|
8
|
+
//# sourceMappingURL=configcat-server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configcat-server.d.ts","sourceRoot":"","sources":["../../src/experiments/configcat-server.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAQjC,wBAAgB,8BAA8B,IAAI,MAAM,CAsBvD"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2022 Gitpod GmbH. All rights reserved.
|
|
4
|
+
* Licensed under the GNU Affero General Public License (AGPL).
|
|
5
|
+
* See License-AGPL.txt in the project root for license information.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.getExperimentsClientForBackend = void 0;
|
|
9
|
+
const configcat = require("configcat-node");
|
|
10
|
+
const configcat_common_1 = require("configcat-common");
|
|
11
|
+
const configcat_1 = require("./configcat");
|
|
12
|
+
const always_default_1 = require("./always-default");
|
|
13
|
+
let client;
|
|
14
|
+
function getExperimentsClientForBackend() {
|
|
15
|
+
// We have already instantiated a client, we can just re-use it.
|
|
16
|
+
if (client !== undefined) {
|
|
17
|
+
return client;
|
|
18
|
+
}
|
|
19
|
+
// Retrieve SDK key from ENV Variable
|
|
20
|
+
const sdkKey = process.env.CONFIGCAT_SDK_KEY;
|
|
21
|
+
// Self-hosted installations do not set the ConfigCat SDK key, so always use a client which returns the default value.
|
|
22
|
+
if (sdkKey === undefined || sdkKey === "") {
|
|
23
|
+
client = (0, always_default_1.newAlwaysReturningDefaultValueClient)();
|
|
24
|
+
return client;
|
|
25
|
+
}
|
|
26
|
+
const configCatClient = configcat.createClient(sdkKey, {
|
|
27
|
+
logger: configcat.createConsoleLogger(configcat_common_1.LogLevel.Error),
|
|
28
|
+
maxInitWaitTimeSeconds: 0,
|
|
29
|
+
});
|
|
30
|
+
client = new configcat_1.ConfigCatClient(configCatClient);
|
|
31
|
+
return client;
|
|
32
|
+
}
|
|
33
|
+
exports.getExperimentsClientForBackend = getExperimentsClientForBackend;
|
|
34
|
+
//# sourceMappingURL=configcat-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configcat-server.js","sourceRoot":"","sources":["../../src/experiments/configcat-server.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAGH,4CAA4C;AAC5C,uDAA4C;AAC5C,2CAA8C;AAC9C,qDAAwE;AAExE,IAAI,MAA0B,CAAC;AAE/B,SAAgB,8BAA8B;IAC1C,gEAAgE;IAChE,IAAI,MAAM,KAAK,SAAS,EAAE;QACtB,OAAO,MAAM,CAAC;KACjB;IAED,qCAAqC;IACrC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;IAE7C,sHAAsH;IACtH,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,EAAE,EAAE;QACvC,MAAM,GAAG,IAAA,qDAAoC,GAAE,CAAC;QAChD,OAAO,MAAM,CAAC;KACjB;IAED,MAAM,eAAe,GAAG,SAAS,CAAC,YAAY,CAAC,MAAM,EAAE;QACnD,MAAM,EAAE,SAAS,CAAC,mBAAmB,CAAC,2BAAQ,CAAC,KAAK,CAAC;QACrD,sBAAsB,EAAE,CAAC;KAC5B,CAAC,CAAC;IAEH,MAAM,GAAG,IAAI,2BAAe,CAAC,eAAe,CAAC,CAAC;IAC9C,OAAO,MAAM,CAAC;AAClB,CAAC;AAtBD,wEAsBC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 Gitpod GmbH. All rights reserved.
|
|
3
|
+
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
+
* See License-AGPL.txt in the project root for license information.
|
|
5
|
+
*/
|
|
6
|
+
import { Attributes, Client } from "./types";
|
|
7
|
+
import { User } from "configcat-common/lib/RolloutEvaluator";
|
|
8
|
+
import { IConfigCatClient } from "configcat-common/lib/ConfigCatClient";
|
|
9
|
+
export declare const PROJECT_ID_ATTRIBUTE = "project_id";
|
|
10
|
+
export declare const TEAM_ID_ATTRIBUTE = "team_id";
|
|
11
|
+
export declare const TEAM_IDS_ATTRIBUTE = "team_ids";
|
|
12
|
+
export declare const TEAM_NAME_ATTRIBUTE = "team_name";
|
|
13
|
+
export declare const TEAM_NAMES_ATTRIBUTE = "team_names";
|
|
14
|
+
export declare class ConfigCatClient implements Client {
|
|
15
|
+
private client;
|
|
16
|
+
constructor(cc: IConfigCatClient);
|
|
17
|
+
getValueAsync<T>(experimentName: string, defaultValue: T, attributes: Attributes): Promise<T>;
|
|
18
|
+
dispose(): void;
|
|
19
|
+
}
|
|
20
|
+
export declare function attributesToUser(attributes: Attributes): User;
|
|
21
|
+
//# sourceMappingURL=configcat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configcat.d.ts","sourceRoot":"","sources":["../../src/experiments/configcat.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,uCAAuC,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,eAAO,MAAM,oBAAoB,eAAe,CAAC;AACjD,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,eAAO,MAAM,kBAAkB,aAAa,CAAC;AAC7C,eAAO,MAAM,mBAAmB,cAAc,CAAC;AAC/C,eAAO,MAAM,oBAAoB,eAAe,CAAC;AAEjD,qBAAa,eAAgB,YAAW,MAAM;IAC1C,OAAO,CAAC,MAAM,CAAmB;gBAErB,EAAE,EAAE,gBAAgB;IAIhC,aAAa,CAAC,CAAC,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC;IAI7F,OAAO,IAAI,IAAI;CAGlB;AAED,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAoB7D"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2022 Gitpod GmbH. All rights reserved.
|
|
4
|
+
* Licensed under the GNU Affero General Public License (AGPL).
|
|
5
|
+
* See License-AGPL.txt in the project root for license information.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.attributesToUser = exports.ConfigCatClient = exports.TEAM_NAMES_ATTRIBUTE = exports.TEAM_NAME_ATTRIBUTE = exports.TEAM_IDS_ATTRIBUTE = exports.TEAM_ID_ATTRIBUTE = exports.PROJECT_ID_ATTRIBUTE = void 0;
|
|
9
|
+
const RolloutEvaluator_1 = require("configcat-common/lib/RolloutEvaluator");
|
|
10
|
+
exports.PROJECT_ID_ATTRIBUTE = "project_id";
|
|
11
|
+
exports.TEAM_ID_ATTRIBUTE = "team_id";
|
|
12
|
+
exports.TEAM_IDS_ATTRIBUTE = "team_ids";
|
|
13
|
+
exports.TEAM_NAME_ATTRIBUTE = "team_name";
|
|
14
|
+
exports.TEAM_NAMES_ATTRIBUTE = "team_names";
|
|
15
|
+
class ConfigCatClient {
|
|
16
|
+
constructor(cc) {
|
|
17
|
+
this.client = cc;
|
|
18
|
+
}
|
|
19
|
+
getValueAsync(experimentName, defaultValue, attributes) {
|
|
20
|
+
return this.client.getValueAsync(experimentName, defaultValue, attributesToUser(attributes));
|
|
21
|
+
}
|
|
22
|
+
dispose() {
|
|
23
|
+
return this.client.dispose();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.ConfigCatClient = ConfigCatClient;
|
|
27
|
+
function attributesToUser(attributes) {
|
|
28
|
+
const userId = attributes.userId || "";
|
|
29
|
+
const email = attributes.email || "";
|
|
30
|
+
const custom = {};
|
|
31
|
+
if (attributes.projectId) {
|
|
32
|
+
custom[exports.PROJECT_ID_ATTRIBUTE] = attributes.projectId;
|
|
33
|
+
}
|
|
34
|
+
if (attributes.teamId) {
|
|
35
|
+
custom[exports.TEAM_ID_ATTRIBUTE] = attributes.teamId;
|
|
36
|
+
}
|
|
37
|
+
if (attributes.teamName) {
|
|
38
|
+
custom[exports.TEAM_NAME_ATTRIBUTE] = attributes.teamName;
|
|
39
|
+
}
|
|
40
|
+
if (attributes.teams) {
|
|
41
|
+
custom[exports.TEAM_NAMES_ATTRIBUTE] = attributes.teams.map((t) => t.name).join(",");
|
|
42
|
+
custom[exports.TEAM_IDS_ATTRIBUTE] = attributes.teams.map((t) => t.id).join(",");
|
|
43
|
+
}
|
|
44
|
+
return new RolloutEvaluator_1.User(userId, email, "", custom);
|
|
45
|
+
}
|
|
46
|
+
exports.attributesToUser = attributesToUser;
|
|
47
|
+
//# sourceMappingURL=configcat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configcat.js","sourceRoot":"","sources":["../../src/experiments/configcat.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAGH,4EAA6D;AAGhD,QAAA,oBAAoB,GAAG,YAAY,CAAC;AACpC,QAAA,iBAAiB,GAAG,SAAS,CAAC;AAC9B,QAAA,kBAAkB,GAAG,UAAU,CAAC;AAChC,QAAA,mBAAmB,GAAG,WAAW,CAAC;AAClC,QAAA,oBAAoB,GAAG,YAAY,CAAC;AAEjD,MAAa,eAAe;IAGxB,YAAY,EAAoB;QAC5B,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;IACrB,CAAC;IAED,aAAa,CAAI,cAAsB,EAAE,YAAe,EAAE,UAAsB;QAC5E,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,cAAc,EAAE,YAAY,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAAC;IACjG,CAAC;IAED,OAAO;QACH,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;IACjC,CAAC;CACJ;AAdD,0CAcC;AAED,SAAgB,gBAAgB,CAAC,UAAsB;IACnD,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,IAAI,EAAE,CAAC;IACvC,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,EAAE,CAAC;IAErC,MAAM,MAAM,GAA8B,EAAE,CAAC;IAC7C,IAAI,UAAU,CAAC,SAAS,EAAE;QACtB,MAAM,CAAC,4BAAoB,CAAC,GAAG,UAAU,CAAC,SAAS,CAAC;KACvD;IACD,IAAI,UAAU,CAAC,MAAM,EAAE;QACnB,MAAM,CAAC,yBAAiB,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC;KACjD;IACD,IAAI,UAAU,CAAC,QAAQ,EAAE;QACrB,MAAM,CAAC,2BAAmB,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC;KACrD;IACD,IAAI,UAAU,CAAC,KAAK,EAAE;QAClB,MAAM,CAAC,4BAAoB,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC7E,MAAM,CAAC,0BAAkB,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAC5E;IAED,OAAO,IAAI,uBAAI,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;AAC/C,CAAC;AApBD,4CAoBC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 Gitpod GmbH. All rights reserved.
|
|
3
|
+
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
+
* See License-AGPL.txt in the project root for license information.
|
|
5
|
+
*/
|
|
6
|
+
import { Team } from "../teams-projects-protocol";
|
|
7
|
+
export interface Attributes {
|
|
8
|
+
userId?: string;
|
|
9
|
+
email?: string;
|
|
10
|
+
projectId?: string;
|
|
11
|
+
teamId?: string;
|
|
12
|
+
teamName?: string;
|
|
13
|
+
teams?: Array<Team>;
|
|
14
|
+
}
|
|
15
|
+
export interface Client {
|
|
16
|
+
getValueAsync<T>(experimentName: string, defaultValue: T, attributes: Attributes): Promise<T>;
|
|
17
|
+
dispose(): void;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/experiments/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAIlD,MAAM,WAAW,UAAU;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,KAAK,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;CACvB;AAED,MAAM,WAAW,MAAM;IACnB,aAAa,CAAC,CAAC,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAG9F,OAAO,IAAI,IAAI,CAAC;CACnB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2022 Gitpod GmbH. All rights reserved.
|
|
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
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
//# sourceMappingURL=
|
|
8
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/experiments/types.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitpod-file-parser.d.ts","sourceRoot":"","sources":["../src/gitpod-file-parser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,EAAE,eAAe,EAAmB,MAAM,YAAY,CAAC;AAE9D,oBAAY,WAAW,GAAG,eAAe,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"gitpod-file-parser.d.ts","sourceRoot":"","sources":["../src/gitpod-file-parser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,EAAE,eAAe,EAAmB,MAAM,YAAY,CAAC;AAE9D,oBAAY,WAAW,GAAG,eAAe,GAAG,SAAS,CAAC;AAQtD,MAAM,WAAW,WAAW;IACxB,MAAM,EAAE,eAAe,CAAC;IACxB,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED,qBACa,gBAAgB;IAClB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,KAAK,EAAE,aAAa,GAAE,eAAoB,GAAG,WAAW;CAoCrG"}
|