@gitpod/gitpod-protocol 0.1.5-update-ovsx.0 → 0.1.5-update-yarnlock.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 +159 -25
- package/lib/accounting-protocol.d.ts +165 -0
- package/lib/accounting-protocol.d.ts.map +1 -0
- package/lib/accounting-protocol.js +120 -0
- package/lib/accounting-protocol.js.map +1 -0
- package/lib/admin-protocol.d.ts +51 -6
- package/lib/admin-protocol.d.ts.map +1 -1
- package/lib/admin-protocol.js +17 -2
- 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/attribution.d.ts +25 -0
- package/lib/attribution.d.ts.map +1 -0
- package/lib/attribution.js +58 -0
- package/lib/attribution.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/billing-mode.d.ts +45 -0
- package/lib/billing-mode.d.ts.map +1 -0
- package/lib/billing-mode.js +44 -0
- package/lib/billing-mode.js.map +1 -0
- package/lib/blocked-repositories-protocol.d.ts +13 -0
- package/lib/blocked-repositories-protocol.d.ts.map +1 -0
- package/lib/blocked-repositories-protocol.js +8 -0
- package/lib/blocked-repositories-protocol.js.map +1 -0
- package/lib/context-url.d.ts +30 -0
- package/lib/context-url.d.ts.map +1 -0
- package/lib/context-url.js +100 -0
- package/lib/context-url.js.map +1 -0
- package/lib/context-url.spec.d.ts +12 -0
- package/lib/context-url.spec.d.ts.map +1 -0
- package/lib/context-url.spec.js +81 -0
- package/lib/context-url.spec.js.map +1 -0
- package/lib/encryption/container-module.d.ts +2 -2
- package/lib/encryption/container-module.d.ts.map +1 -1
- package/lib/encryption/container-module.js +8 -6
- package/lib/encryption/container-module.js.map +1 -1
- package/lib/encryption/encryption-engine.d.ts +2 -2
- package/lib/encryption/encryption-engine.d.ts.map +1 -1
- package/lib/encryption/encryption-engine.js +28 -28
- package/lib/encryption/encryption-engine.js.map +1 -1
- package/lib/encryption/encryption-engine.spec.d.ts +3 -3
- package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
- package/lib/encryption/encryption-engine.spec.js +32 -39
- package/lib/encryption/encryption-engine.spec.js.map +1 -1
- package/lib/encryption/encryption-service.d.ts +2 -2
- package/lib/encryption/encryption-service.d.ts.map +1 -1
- package/lib/encryption/encryption-service.js +33 -46
- package/lib/encryption/encryption-service.js.map +1 -1
- package/lib/encryption/key-provider.d.ts +3 -3
- package/lib/encryption/key-provider.d.ts.map +1 -1
- package/lib/encryption/key-provider.js +34 -40
- package/lib/encryption/key-provider.js.map +1 -1
- package/lib/env.d.ts +2 -8
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +10 -29
- 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 +10 -0
- package/lib/experiments/configcat-server.d.ts.map +1 -0
- package/lib/experiments/configcat-server.js +37 -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 +51 -0
- package/lib/experiments/configcat.js.map +1 -0
- package/lib/experiments/types.d.ts +22 -0
- package/lib/experiments/types.d.ts.map +1 -0
- package/lib/experiments/types.js +10 -0
- package/lib/experiments/types.js.map +1 -0
- package/lib/frontend-dashboard-service.d.ts +99 -0
- package/lib/frontend-dashboard-service.d.ts.map +1 -0
- package/lib/frontend-dashboard-service.js +55 -0
- package/lib/frontend-dashboard-service.js.map +1 -0
- package/lib/gitpod-file-parser.d.ts +2 -2
- package/lib/gitpod-file-parser.d.ts.map +1 -1
- package/lib/gitpod-file-parser.js +29 -44
- package/lib/gitpod-file-parser.js.map +1 -1
- package/lib/gitpod-file-parser.spec.d.ts +2 -2
- package/lib/gitpod-file-parser.spec.js +147 -144
- package/lib/gitpod-file-parser.spec.js.map +1 -1
- package/lib/gitpod-service.d.ts +290 -50
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +288 -123
- package/lib/gitpod-service.js.map +1 -1
- package/lib/headless-workspace-log.d.ts +11 -13
- package/lib/headless-workspace-log.d.ts.map +1 -1
- package/lib/headless-workspace-log.js +8 -9
- package/lib/headless-workspace-log.js.map +1 -1
- package/lib/ide-frontend-service.d.ts +26 -0
- package/lib/ide-frontend-service.d.ts.map +1 -0
- package/lib/ide-frontend-service.js +8 -0
- package/lib/ide-frontend-service.js.map +1 -0
- package/lib/ide-protocol.d.ts +126 -0
- package/lib/ide-protocol.d.ts.map +1 -0
- package/lib/ide-protocol.js +18 -0
- package/lib/ide-protocol.js.map +1 -0
- package/lib/index.d.ts +18 -12
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +28 -13
- 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 +9 -2
- package/lib/license-protocol.d.ts.map +1 -1
- package/lib/license-protocol.js +3 -2
- package/lib/license-protocol.js.map +1 -1
- package/lib/messaging/browser/connection.d.ts +6 -4
- package/lib/messaging/browser/connection.d.ts.map +1 -1
- package/lib/messaging/browser/connection.js +188 -48
- package/lib/messaging/browser/connection.js.map +1 -1
- package/lib/messaging/browser/window-connection.d.ts +9 -4
- package/lib/messaging/browser/window-connection.d.ts.map +1 -1
- package/lib/messaging/browser/window-connection.js +48 -59
- package/lib/messaging/browser/window-connection.js.map +1 -1
- package/lib/messaging/client-call-metrics.d.ts +21 -0
- package/lib/messaging/client-call-metrics.d.ts.map +1 -0
- package/lib/messaging/client-call-metrics.js +95 -0
- package/lib/messaging/client-call-metrics.js.map +1 -0
- package/lib/messaging/error.d.ts +18 -4
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +38 -7
- 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 +2 -1
- package/lib/messaging/handler.js.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 +24 -59
- 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 +76 -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 +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 +26 -15
- package/lib/permission.d.ts.map +1 -1
- package/lib/permission.js +50 -36
- package/lib/permission.js.map +1 -1
- package/lib/plans.d.ts +213 -0
- package/lib/plans.d.ts.map +1 -0
- package/lib/plans.js +625 -0
- package/lib/plans.js.map +1 -0
- package/lib/protocol.d.ts +338 -111
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +422 -201
- package/lib/protocol.js.map +1 -1
- package/lib/protocol.spec.d.ts +7 -0
- package/lib/protocol.spec.d.ts.map +1 -0
- package/lib/protocol.spec.js +127 -0
- package/lib/protocol.spec.js.map +1 -0
- 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/lib/snapshot-url.spec.d.ts +7 -0
- 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 +93 -0
- package/lib/team-subscription-protocol.d.ts.map +1 -0
- package/lib/team-subscription-protocol.js +82 -0
- package/lib/team-subscription-protocol.js.map +1 -0
- package/lib/teams-projects-protocol.d.ts +136 -0
- package/lib/teams-projects-protocol.d.ts.map +1 -0
- package/lib/teams-projects-protocol.js +41 -0
- package/lib/teams-projects-protocol.js.map +1 -0
- package/lib/typings/globals.d.ts +8 -3
- package/lib/typings/globals.d.ts.map +1 -1
- package/lib/typings/globals.js +2 -2
- package/lib/usage.d.ts +73 -0
- package/lib/usage.d.ts.map +1 -0
- package/lib/usage.js +20 -0
- package/lib/usage.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 +88 -0
- package/lib/util/analytics.js.map +1 -0
- package/lib/util/async-iterator.d.ts +2 -2
- package/lib/util/async-iterator.d.ts.map +1 -1
- package/lib/util/async-iterator.js +60 -137
- package/lib/util/async-iterator.js.map +1 -1
- package/lib/util/cancelable.d.ts +2 -2
- package/lib/util/cancelable.js +20 -61
- package/lib/util/cancelable.js.map +1 -1
- package/lib/util/date-time.d.ts +2 -2
- package/lib/util/date-time.js +14 -13
- 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/deep-partial.d.ts +2 -2
- package/lib/util/deep-partial.js +2 -2
- package/lib/util/deferred.d.ts +2 -2
- package/lib/util/deferred.js +13 -14
- package/lib/util/deferred.js.map +1 -1
- package/lib/util/disposable.d.ts +2 -2
- package/lib/util/disposable.d.ts.map +1 -1
- package/lib/util/disposable.js +28 -40
- package/lib/util/disposable.js.map +1 -1
- package/lib/util/event.d.ts +1 -1
- package/lib/util/event.d.ts.map +1 -1
- package/lib/util/event.js +64 -77
- package/lib/util/event.js.map +1 -1
- package/lib/util/garbage-collected-cache.d.ts +3 -2
- package/lib/util/garbage-collected-cache.d.ts.map +1 -1
- package/lib/util/garbage-collected-cache.js +35 -49
- package/lib/util/garbage-collected-cache.js.map +1 -1
- package/lib/util/generate-workspace-id.d.ts +9 -0
- package/lib/util/generate-workspace-id.d.ts.map +1 -0
- package/lib/util/generate-workspace-id.js +491 -0
- package/lib/util/generate-workspace-id.js.map +1 -0
- package/lib/util/generate-workspace-id.spec.d.ts +7 -0
- package/lib/util/generate-workspace-id.spec.d.ts.map +1 -0
- package/lib/util/generate-workspace-id.spec.js +98 -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 +41 -0
- package/lib/util/gitpod-cookie.js.map +1 -0
- package/lib/util/gitpod-host-url.d.ts +20 -8
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +143 -85
- package/lib/util/gitpod-host-url.js.map +1 -1
- package/lib/util/gitpod-host-url.spec.d.ts +16 -0
- package/lib/util/gitpod-host-url.spec.d.ts.map +1 -0
- package/lib/util/gitpod-host-url.spec.js +134 -0
- package/lib/util/gitpod-host-url.spec.js.map +1 -0
- package/lib/util/grpc.d.ts +35 -0
- package/lib/util/grpc.d.ts.map +1 -0
- package/lib/util/grpc.js +90 -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/jaeger-client-types.js +8 -0
- package/lib/util/jaeger-client-types.js.map +1 -0
- package/lib/util/logging.d.ts +58 -35
- package/lib/util/logging.d.ts.map +1 -1
- package/lib/util/logging.js +144 -129
- package/lib/util/logging.js.map +1 -1
- package/lib/util/logging.spec.d.ts +7 -0
- package/lib/util/logging.spec.d.ts.map +1 -0
- package/lib/util/logging.spec.js +52 -0
- package/lib/util/logging.spec.js.map +1 -0
- package/lib/util/make-link.d.ts +2 -2
- package/lib/util/make-link.js +8 -7
- package/lib/util/make-link.js.map +1 -1
- package/lib/util/nice-grpc.d.ts +9 -0
- package/lib/util/nice-grpc.d.ts.map +1 -0
- package/lib/util/nice-grpc.js +121 -0
- package/lib/util/nice-grpc.js.map +1 -0
- package/lib/util/parse-workspace-id.d.ts +15 -5
- package/lib/util/parse-workspace-id.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.js +39 -9
- package/lib/util/parse-workspace-id.js.map +1 -1
- package/lib/util/parse-workspace-id.spec.d.ts +10 -2
- package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.spec.js +130 -49
- package/lib/util/parse-workspace-id.spec.js.map +1 -1
- package/lib/util/queue.d.ts +2 -2
- package/lib/util/queue.js +19 -57
- package/lib/util/queue.js.map +1 -1
- package/lib/util/queue.spec.d.ts +2 -2
- package/lib/util/queue.spec.js +149 -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 +2 -2
- package/lib/util/semaphore.d.ts.map +1 -1
- package/lib/util/semaphore.js +18 -48
- package/lib/util/semaphore.js.map +1 -1
- package/lib/util/skip-if.d.ts +2 -2
- package/lib/util/skip-if.d.ts.map +1 -1
- package/lib/util/skip-if.js +9 -8
- package/lib/util/skip-if.js.map +1 -1
- package/lib/util/timeutil.d.ts +4 -2
- package/lib/util/timeutil.d.ts.map +1 -1
- package/lib/util/timeutil.js +43 -18
- package/lib/util/timeutil.js.map +1 -1
- package/lib/util/timeutil.spec.d.ts +4 -2
- package/lib/util/timeutil.spec.d.ts.map +1 -1
- package/lib/util/timeutil.spec.js +57 -25
- package/lib/util/timeutil.spec.js.map +1 -1
- package/lib/util/tracing.d.ts +55 -8
- package/lib/util/tracing.d.ts.map +1 -1
- package/lib/util/tracing.js +210 -66
- 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 +9 -9
- package/lib/util/workspace-port-authentication.d.ts.map +1 -1
- package/lib/util/workspace-port-authentication.js +13 -14
- package/lib/util/workspace-port-authentication.js.map +1 -1
- package/lib/webhook-event.d.ts +44 -0
- package/lib/webhook-event.d.ts.map +1 -0
- package/lib/webhook-event.js +8 -0
- package/lib/webhook-event.js.map +1 -0
- package/lib/workspace-class.d.ts +14 -0
- package/lib/workspace-class.d.ts.map +1 -0
- package/lib/workspace-class.js +8 -0
- package/lib/workspace-class.js.map +1 -0
- package/lib/workspace-cluster.d.ts +80 -0
- package/lib/workspace-cluster.d.ts.map +1 -0
- package/lib/workspace-cluster.js +36 -0
- package/lib/workspace-cluster.js.map +1 -0
- package/lib/workspace-instance.d.ts +51 -8
- package/lib/workspace-instance.d.ts.map +1 -1
- package/lib/workspace-instance.js +2 -2
- package/lib/wsready.d.ts +8 -2
- package/lib/wsready.d.ts.map +1 -1
- package/lib/wsready.js +4 -3
- package/lib/wsready.js.map +1 -1
- package/package.json +42 -18
- package/pkg-yarn.lock +24 -10
- package/provenance-bundle.jsonl +2 -0
- package/src/accounting-protocol.ts +253 -0
- package/src/admin-protocol.ts +96 -21
- package/src/analytics.ts +52 -0
- package/src/attribution.ts +67 -0
- package/src/auth.ts +27 -0
- package/src/billing-mode.ts +84 -0
- package/src/blocked-repositories-protocol.ts +13 -0
- package/src/context-url.spec.ts +49 -0
- package/src/context-url.ts +107 -0
- package/src/encryption/container-module.ts +4 -5
- package/src/encryption/encryption-engine.spec.ts +11 -10
- package/src/encryption/encryption-engine.ts +22 -18
- package/src/encryption/encryption-service.ts +6 -7
- package/src/encryption/key-provider.ts +18 -21
- package/src/env.ts +3 -26
- package/src/experiments/always-default.ts +24 -0
- package/src/experiments/configcat-server.ts +42 -0
- package/src/experiments/configcat.ts +56 -0
- package/src/experiments/types.ts +34 -0
- package/src/frontend-dashboard-service.ts +148 -0
- package/src/gitpod-file-parser.spec.ts +57 -63
- package/src/gitpod-file-parser.ts +18 -19
- package/src/gitpod-service.ts +602 -99
- package/src/headless-workspace-log.ts +14 -16
- package/src/ide-frontend-service.ts +28 -0
- package/src/ide-protocol.ts +147 -0
- package/src/index.ts +18 -12
- package/src/installation-admin-protocol.ts +45 -0
- package/src/license-protocol.ts +14 -8
- package/src/messaging/browser/connection.ts +202 -26
- package/src/messaging/browser/window-connection.ts +45 -29
- package/src/messaging/client-call-metrics.ts +94 -0
- package/src/messaging/error.ts +51 -10
- 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 +20 -0
- package/src/permission.ts +53 -40
- package/src/plans.ts +699 -0
- package/src/protocol.spec.ts +97 -0
- package/src/protocol.ts +790 -302
- package/src/snapshot-url.spec.ts +27 -0
- package/src/snapshot-url.ts +27 -0
- package/src/team-subscription-protocol.ts +153 -0
- package/src/teams-projects-protocol.ts +180 -0
- package/src/typings/globals.ts +13 -5
- package/src/usage.ts +85 -0
- package/src/util/analytics.ts +109 -0
- package/src/util/async-iterator.ts +6 -7
- package/src/util/cancelable.ts +5 -5
- package/src/util/date-time.ts +10 -10
- package/src/util/debug-app.ts +81 -0
- package/src/util/deep-partial.ts +2 -2
- package/src/util/deferred.ts +8 -8
- package/src/util/disposable.ts +3 -6
- package/src/util/event.ts +9 -11
- package/src/util/garbage-collected-cache.ts +18 -10
- package/src/util/generate-workspace-id.spec.ts +58 -0
- package/src/util/generate-workspace-id.ts +481 -0
- package/src/util/gitpod-cookie.ts +38 -0
- package/src/util/gitpod-host-url.spec.ts +76 -0
- package/src/util/gitpod-host-url.ts +119 -40
- package/src/util/grpc.ts +107 -0
- package/src/util/jaeger-client-types.ts +102 -0
- package/src/util/logging.spec.ts +23 -0
- package/src/util/logging.ts +163 -73
- package/src/util/make-link.ts +8 -9
- package/src/util/nice-grpc.ts +96 -0
- package/src/util/parse-workspace-id.spec.ts +62 -12
- package/src/util/parse-workspace-id.ts +40 -10
- package/src/util/queue.spec.ts +30 -28
- package/src/util/queue.ts +2 -2
- package/src/util/repeat.ts +45 -0
- package/src/util/semaphore.ts +8 -10
- package/src/util/skip-if.ts +12 -9
- package/src/util/timeutil.spec.ts +42 -16
- package/src/util/timeutil.ts +33 -17
- package/src/util/tracing.spec.ts +88 -0
- package/src/util/tracing.ts +211 -33
- package/src/util/workspace-port-authentication.ts +12 -15
- package/src/webhook-event.ts +55 -0
- package/src/workspace-class.ts +14 -0
- package/src/workspace-cluster.ts +121 -0
- package/src/workspace-instance.ts +120 -36
- package/src/wsready.ts +11 -4
- package/data/builtin-theia-plugins.json +0 -362
- package/lib/email-protocol.d.ts +0 -49
- package/lib/email-protocol.d.ts.map +0 -1
- package/lib/email-protocol.js +0 -27
- package/lib/email-protocol.js.map +0 -1
- 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 -45
- 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 +0 -8
- package/lib/theia-plugins.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 -117
- 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 -33
- 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 +0 -8
- package/lib/util/without.js.map +0 -1
- package/src/email-protocol.ts +0 -67
- package/src/messaging/connection-error-handler.ts +0 -62
- package/src/theia-plugins.ts +0 -11
- package/src/util/jaeger-client.d.ts +0 -105
- package/src/util/repeater.ts +0 -49
- package/src/util/safe-promise.ts +0 -26
- package/src/util/without.ts +0 -8
|
@@ -0,0 +1,491 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2020 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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
9
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
11
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
12
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
13
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.animals = exports.colors = exports.generateWorkspaceID = void 0;
|
|
18
|
+
const randomNumber = require("random-number-csprng");
|
|
19
|
+
function generateWorkspaceID(firstSegment, secondSegment) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
const firstSeg = clean(firstSegment) || (yield random(exports.colors));
|
|
22
|
+
const secSeg = clean(secondSegment) || (yield random(exports.animals));
|
|
23
|
+
function fit(makeFit, otherSeg) {
|
|
24
|
+
return makeFit.substring(0, Math.max(segLength, 2 * segLength - otherSeg.length));
|
|
25
|
+
}
|
|
26
|
+
return fit(firstSeg, secSeg) + "-" + fit(secSeg, firstSeg) + "-" + (yield random(characters, segLength));
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
exports.generateWorkspaceID = generateWorkspaceID;
|
|
30
|
+
function clean(segment, maxChars = 16) {
|
|
31
|
+
if (!segment) {
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
segment = segment.toLowerCase();
|
|
35
|
+
let result = "";
|
|
36
|
+
for (let i = 0; i < segment.length; i++) {
|
|
37
|
+
if (characters.indexOf(segment[i]) !== -1) {
|
|
38
|
+
result += segment[i];
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (result.length >= 2) {
|
|
42
|
+
return result.substring(0, maxChars);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function random(array, length = 1) {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
var result = "";
|
|
48
|
+
for (var i = 0; i < length; i++) {
|
|
49
|
+
result += array[yield randomNumber(0, array.length - 1)];
|
|
50
|
+
}
|
|
51
|
+
return result;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
const segLength = 11;
|
|
55
|
+
const characters = "abcdefghijklmnopqrstuvwxyz0123456789".split("");
|
|
56
|
+
exports.colors = [
|
|
57
|
+
"amaranth",
|
|
58
|
+
"amber",
|
|
59
|
+
"amethyst",
|
|
60
|
+
"apricot",
|
|
61
|
+
"aqua",
|
|
62
|
+
"aquamarine",
|
|
63
|
+
"azure",
|
|
64
|
+
"beige",
|
|
65
|
+
"black",
|
|
66
|
+
"blue",
|
|
67
|
+
"blush",
|
|
68
|
+
"bronze",
|
|
69
|
+
"brown",
|
|
70
|
+
"chocolate",
|
|
71
|
+
"coffee",
|
|
72
|
+
"copper",
|
|
73
|
+
"coral",
|
|
74
|
+
"crimson",
|
|
75
|
+
"cyan",
|
|
76
|
+
"emerald",
|
|
77
|
+
"fuchsia",
|
|
78
|
+
"gold",
|
|
79
|
+
"gray",
|
|
80
|
+
"green",
|
|
81
|
+
"harlequin",
|
|
82
|
+
"indigo",
|
|
83
|
+
"ivory",
|
|
84
|
+
"jade",
|
|
85
|
+
"kumquat",
|
|
86
|
+
"lavender",
|
|
87
|
+
"lime",
|
|
88
|
+
"magenta",
|
|
89
|
+
"maroon",
|
|
90
|
+
"moccasin",
|
|
91
|
+
"olive",
|
|
92
|
+
"orange",
|
|
93
|
+
"peach",
|
|
94
|
+
"pink",
|
|
95
|
+
"plum",
|
|
96
|
+
"purple",
|
|
97
|
+
"red",
|
|
98
|
+
"rose",
|
|
99
|
+
"salmon",
|
|
100
|
+
"sapphire",
|
|
101
|
+
"scarlet",
|
|
102
|
+
"silver",
|
|
103
|
+
"tan",
|
|
104
|
+
"teal",
|
|
105
|
+
"tomato",
|
|
106
|
+
"turquoise",
|
|
107
|
+
"violet",
|
|
108
|
+
"white",
|
|
109
|
+
"yellow",
|
|
110
|
+
];
|
|
111
|
+
exports.animals = [
|
|
112
|
+
"canidae",
|
|
113
|
+
"felidae",
|
|
114
|
+
"cat",
|
|
115
|
+
"cattle",
|
|
116
|
+
"dog",
|
|
117
|
+
"donkey",
|
|
118
|
+
"goat",
|
|
119
|
+
"horse",
|
|
120
|
+
"pig",
|
|
121
|
+
"rabbit",
|
|
122
|
+
"aardvark",
|
|
123
|
+
"aardwolf",
|
|
124
|
+
"albatross",
|
|
125
|
+
"alligator",
|
|
126
|
+
"alpaca",
|
|
127
|
+
"amphibian",
|
|
128
|
+
"anaconda",
|
|
129
|
+
"angelfish",
|
|
130
|
+
"anglerfish",
|
|
131
|
+
"ant",
|
|
132
|
+
"anteater",
|
|
133
|
+
"antelope",
|
|
134
|
+
"antlion",
|
|
135
|
+
"ape",
|
|
136
|
+
"aphid",
|
|
137
|
+
"armadillo",
|
|
138
|
+
"asp",
|
|
139
|
+
"baboon",
|
|
140
|
+
"badger",
|
|
141
|
+
"bandicoot",
|
|
142
|
+
"barnacle",
|
|
143
|
+
"barracuda",
|
|
144
|
+
"basilisk",
|
|
145
|
+
"bass",
|
|
146
|
+
"bat",
|
|
147
|
+
"bear",
|
|
148
|
+
"beaver",
|
|
149
|
+
"bedbug",
|
|
150
|
+
"bee",
|
|
151
|
+
"beetle",
|
|
152
|
+
"bird",
|
|
153
|
+
"bison",
|
|
154
|
+
"blackbird",
|
|
155
|
+
"boa",
|
|
156
|
+
"boar",
|
|
157
|
+
"bobcat",
|
|
158
|
+
"bobolink",
|
|
159
|
+
"bonobo",
|
|
160
|
+
"booby",
|
|
161
|
+
"bovid",
|
|
162
|
+
"bug",
|
|
163
|
+
"butterfly",
|
|
164
|
+
"buzzard",
|
|
165
|
+
"camel",
|
|
166
|
+
"canid",
|
|
167
|
+
"capybara",
|
|
168
|
+
"cardinal",
|
|
169
|
+
"caribou",
|
|
170
|
+
"carp",
|
|
171
|
+
"cat",
|
|
172
|
+
"catshark",
|
|
173
|
+
"caterpillar",
|
|
174
|
+
"catfish",
|
|
175
|
+
"cattle",
|
|
176
|
+
"centipede",
|
|
177
|
+
"cephalopod",
|
|
178
|
+
"chameleon",
|
|
179
|
+
"cheetah",
|
|
180
|
+
"chickadee",
|
|
181
|
+
"chicken",
|
|
182
|
+
"chimpanzee",
|
|
183
|
+
"chinchilla",
|
|
184
|
+
"chipmunk",
|
|
185
|
+
"clam",
|
|
186
|
+
"clownfish",
|
|
187
|
+
"cobra",
|
|
188
|
+
"cockroach",
|
|
189
|
+
"cod",
|
|
190
|
+
"condor",
|
|
191
|
+
"constrictor",
|
|
192
|
+
"coral",
|
|
193
|
+
"cougar",
|
|
194
|
+
"cow",
|
|
195
|
+
"coyote",
|
|
196
|
+
"crab",
|
|
197
|
+
"crane",
|
|
198
|
+
"crawdad",
|
|
199
|
+
"crayfish",
|
|
200
|
+
"cricket",
|
|
201
|
+
"crocodile",
|
|
202
|
+
"crow",
|
|
203
|
+
"cuckoo",
|
|
204
|
+
"cicada",
|
|
205
|
+
"damselfly",
|
|
206
|
+
"deer",
|
|
207
|
+
"dingo",
|
|
208
|
+
"dinosaur",
|
|
209
|
+
"dodo",
|
|
210
|
+
"dog",
|
|
211
|
+
"dolphin",
|
|
212
|
+
"donkey",
|
|
213
|
+
"dormouse",
|
|
214
|
+
"dove",
|
|
215
|
+
"dragonfly",
|
|
216
|
+
"dragon",
|
|
217
|
+
"duck",
|
|
218
|
+
"eagle",
|
|
219
|
+
"earthworm",
|
|
220
|
+
"earwig",
|
|
221
|
+
"echidna",
|
|
222
|
+
"eel",
|
|
223
|
+
"egret",
|
|
224
|
+
"elephant",
|
|
225
|
+
"elk",
|
|
226
|
+
"emu",
|
|
227
|
+
"ermine",
|
|
228
|
+
"falcon",
|
|
229
|
+
"ferret",
|
|
230
|
+
"finch",
|
|
231
|
+
"firefly",
|
|
232
|
+
"fish",
|
|
233
|
+
"flamingo",
|
|
234
|
+
"flea",
|
|
235
|
+
"fly",
|
|
236
|
+
"flyingfish",
|
|
237
|
+
"fowl",
|
|
238
|
+
"fox",
|
|
239
|
+
"frog",
|
|
240
|
+
"gamefowl",
|
|
241
|
+
"galliform",
|
|
242
|
+
"gazelle",
|
|
243
|
+
"gecko",
|
|
244
|
+
"gerbil",
|
|
245
|
+
"gibbon",
|
|
246
|
+
"giraffe",
|
|
247
|
+
"goat",
|
|
248
|
+
"goldfish",
|
|
249
|
+
"goose",
|
|
250
|
+
"gopher",
|
|
251
|
+
"gorilla",
|
|
252
|
+
"grasshopper",
|
|
253
|
+
"grouse",
|
|
254
|
+
"guan",
|
|
255
|
+
"guanaco",
|
|
256
|
+
"guineafowl",
|
|
257
|
+
"gull",
|
|
258
|
+
"guppy",
|
|
259
|
+
"haddock",
|
|
260
|
+
"halibut",
|
|
261
|
+
"hamster",
|
|
262
|
+
"hare",
|
|
263
|
+
"harrier",
|
|
264
|
+
"hawk",
|
|
265
|
+
"hedgehog",
|
|
266
|
+
"heron",
|
|
267
|
+
"herring",
|
|
268
|
+
"hippopotamus",
|
|
269
|
+
"hookworm",
|
|
270
|
+
"hornet",
|
|
271
|
+
"horse",
|
|
272
|
+
"hoverfly",
|
|
273
|
+
"hummingbird",
|
|
274
|
+
"hyena",
|
|
275
|
+
"iguana",
|
|
276
|
+
"impala",
|
|
277
|
+
"jackal",
|
|
278
|
+
"jaguar",
|
|
279
|
+
"jay",
|
|
280
|
+
"jellyfish",
|
|
281
|
+
"junglefowl",
|
|
282
|
+
"kangaroo",
|
|
283
|
+
"kingfisher",
|
|
284
|
+
"kite",
|
|
285
|
+
"kiwi",
|
|
286
|
+
"koala",
|
|
287
|
+
"koi",
|
|
288
|
+
"krill",
|
|
289
|
+
"ladybug",
|
|
290
|
+
"lamprey",
|
|
291
|
+
"landfowl",
|
|
292
|
+
"lark",
|
|
293
|
+
"leech",
|
|
294
|
+
"lemming",
|
|
295
|
+
"lemur",
|
|
296
|
+
"leopard",
|
|
297
|
+
"leopon",
|
|
298
|
+
"limpet",
|
|
299
|
+
"lion",
|
|
300
|
+
"lizard",
|
|
301
|
+
"llama",
|
|
302
|
+
"lobster",
|
|
303
|
+
"locust",
|
|
304
|
+
"loon",
|
|
305
|
+
"louse",
|
|
306
|
+
"lungfish",
|
|
307
|
+
"lynx",
|
|
308
|
+
"macaw",
|
|
309
|
+
"mackerel",
|
|
310
|
+
"magpie",
|
|
311
|
+
"mammal",
|
|
312
|
+
"manatee",
|
|
313
|
+
"mandrill",
|
|
314
|
+
"marlin",
|
|
315
|
+
"marmoset",
|
|
316
|
+
"marmot",
|
|
317
|
+
"marsupial",
|
|
318
|
+
"marten",
|
|
319
|
+
"mastodon",
|
|
320
|
+
"meadowlark",
|
|
321
|
+
"meerkat",
|
|
322
|
+
"mink",
|
|
323
|
+
"minnow",
|
|
324
|
+
"mite",
|
|
325
|
+
"mockingbird",
|
|
326
|
+
"mole",
|
|
327
|
+
"mollusk",
|
|
328
|
+
"mongoose",
|
|
329
|
+
"monkey",
|
|
330
|
+
"moose",
|
|
331
|
+
"mosquito",
|
|
332
|
+
"moth",
|
|
333
|
+
"mouse",
|
|
334
|
+
"mule",
|
|
335
|
+
"muskox",
|
|
336
|
+
"narwhal",
|
|
337
|
+
"newt",
|
|
338
|
+
"nightingale",
|
|
339
|
+
"ocelot",
|
|
340
|
+
"octopus",
|
|
341
|
+
"opossum",
|
|
342
|
+
"orangutan",
|
|
343
|
+
"orca",
|
|
344
|
+
"ostrich",
|
|
345
|
+
"otter",
|
|
346
|
+
"owl",
|
|
347
|
+
"ox",
|
|
348
|
+
"panda",
|
|
349
|
+
"panther",
|
|
350
|
+
"parakeet",
|
|
351
|
+
"parrot",
|
|
352
|
+
"parrotfish",
|
|
353
|
+
"partridge",
|
|
354
|
+
"peacock",
|
|
355
|
+
"peafowl",
|
|
356
|
+
"pelican",
|
|
357
|
+
"penguin",
|
|
358
|
+
"perch",
|
|
359
|
+
"pheasant",
|
|
360
|
+
"pig",
|
|
361
|
+
"pigeon",
|
|
362
|
+
"pike",
|
|
363
|
+
"pinniped",
|
|
364
|
+
"piranha",
|
|
365
|
+
"planarian",
|
|
366
|
+
"platypus",
|
|
367
|
+
"pony",
|
|
368
|
+
"porcupine",
|
|
369
|
+
"porpoise",
|
|
370
|
+
"possum",
|
|
371
|
+
"prawn",
|
|
372
|
+
"primate",
|
|
373
|
+
"ptarmigan",
|
|
374
|
+
"puffin",
|
|
375
|
+
"puma",
|
|
376
|
+
"python",
|
|
377
|
+
"quail",
|
|
378
|
+
"quelea",
|
|
379
|
+
"quokka",
|
|
380
|
+
"rabbit",
|
|
381
|
+
"raccoon",
|
|
382
|
+
"rat",
|
|
383
|
+
"rattlesnake",
|
|
384
|
+
"raven",
|
|
385
|
+
"reindeer",
|
|
386
|
+
"reptile",
|
|
387
|
+
"rhinoceros",
|
|
388
|
+
"roadrunner",
|
|
389
|
+
"rodent",
|
|
390
|
+
"rook",
|
|
391
|
+
"rooster",
|
|
392
|
+
"roundworm",
|
|
393
|
+
"sailfish",
|
|
394
|
+
"salamander",
|
|
395
|
+
"salmon",
|
|
396
|
+
"sawfish",
|
|
397
|
+
"scallop",
|
|
398
|
+
"scorpion",
|
|
399
|
+
"seahorse",
|
|
400
|
+
"shark",
|
|
401
|
+
"sheep",
|
|
402
|
+
"shrew",
|
|
403
|
+
"shrimp",
|
|
404
|
+
"silkworm",
|
|
405
|
+
"silverfish",
|
|
406
|
+
"skink",
|
|
407
|
+
"skunk",
|
|
408
|
+
"sloth",
|
|
409
|
+
"slug",
|
|
410
|
+
"smelt",
|
|
411
|
+
"snail",
|
|
412
|
+
"snake",
|
|
413
|
+
"snipe",
|
|
414
|
+
"sole",
|
|
415
|
+
"sparrow",
|
|
416
|
+
"spider",
|
|
417
|
+
"spoonbill",
|
|
418
|
+
"squid",
|
|
419
|
+
"squirrel",
|
|
420
|
+
"starfish",
|
|
421
|
+
"stingray",
|
|
422
|
+
"stoat",
|
|
423
|
+
"stork",
|
|
424
|
+
"sturgeon",
|
|
425
|
+
"swallow",
|
|
426
|
+
"swan",
|
|
427
|
+
"swift",
|
|
428
|
+
"swordfish",
|
|
429
|
+
"swordtail",
|
|
430
|
+
"tahr",
|
|
431
|
+
"takin",
|
|
432
|
+
"tapir",
|
|
433
|
+
"tarantula",
|
|
434
|
+
"tarsier",
|
|
435
|
+
"termite",
|
|
436
|
+
"tern",
|
|
437
|
+
"thrush",
|
|
438
|
+
"tick",
|
|
439
|
+
"tiger",
|
|
440
|
+
"tiglon",
|
|
441
|
+
"toad",
|
|
442
|
+
"tortoise",
|
|
443
|
+
"toucan",
|
|
444
|
+
"trout",
|
|
445
|
+
"tuna",
|
|
446
|
+
"turkey",
|
|
447
|
+
"turtle",
|
|
448
|
+
"tyrannosaurus",
|
|
449
|
+
"urial",
|
|
450
|
+
"vicuna",
|
|
451
|
+
"viper",
|
|
452
|
+
"vole",
|
|
453
|
+
"vulture",
|
|
454
|
+
"wallaby",
|
|
455
|
+
"walrus",
|
|
456
|
+
"wasp",
|
|
457
|
+
"warbler",
|
|
458
|
+
"weasel",
|
|
459
|
+
"whale",
|
|
460
|
+
"whippet",
|
|
461
|
+
"whitefish",
|
|
462
|
+
"wildcat",
|
|
463
|
+
"wildebeest",
|
|
464
|
+
"wildfowl",
|
|
465
|
+
"wolf",
|
|
466
|
+
"wolverine",
|
|
467
|
+
"wombat",
|
|
468
|
+
"woodpecker",
|
|
469
|
+
"worm",
|
|
470
|
+
"wren",
|
|
471
|
+
"xerinae",
|
|
472
|
+
"yak",
|
|
473
|
+
"zebra",
|
|
474
|
+
"alpaca",
|
|
475
|
+
"cat",
|
|
476
|
+
"cattle",
|
|
477
|
+
"chicken",
|
|
478
|
+
"dog",
|
|
479
|
+
"donkey",
|
|
480
|
+
"ferret",
|
|
481
|
+
"gayal",
|
|
482
|
+
"goldfish",
|
|
483
|
+
"guppy",
|
|
484
|
+
"horse",
|
|
485
|
+
"koi",
|
|
486
|
+
"llama",
|
|
487
|
+
"sheep",
|
|
488
|
+
"yak",
|
|
489
|
+
"unicorn",
|
|
490
|
+
];
|
|
491
|
+
//# sourceMappingURL=generate-workspace-id.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-workspace-id.js","sourceRoot":"","sources":["../../src/util/generate-workspace-id.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,qDAAsD;AAEtD,SAAsB,mBAAmB,CAAC,YAAqB,EAAE,aAAsB;;QACnF,MAAM,QAAQ,GAAG,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,MAAM,CAAC,cAAM,CAAC,CAAC,CAAC;QAC/D,MAAM,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,MAAM,CAAC,eAAO,CAAC,CAAC,CAAC;QAC/D,SAAS,GAAG,CAAC,OAAe,EAAE,QAAgB;YAC1C,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,GAAG,SAAS,GA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
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020 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
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=generate-workspace-id.spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-workspace-id.spec.d.ts","sourceRoot":"","sources":["../../src/util/generate-workspace-id.spec.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2020 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
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
8
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
10
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
11
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12
|
+
};
|
|
13
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
14
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
15
|
+
};
|
|
16
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const mocha_typescript_1 = require("mocha-typescript");
|
|
27
|
+
const chai = require("chai");
|
|
28
|
+
const generate_workspace_id_1 = require("./generate-workspace-id");
|
|
29
|
+
const gitpod_host_url_1 = require("./gitpod-host-url");
|
|
30
|
+
const expect = chai.expect;
|
|
31
|
+
let TestGenerateWorkspaceId = class TestGenerateWorkspaceId {
|
|
32
|
+
testGenerateWorkspaceId() {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
for (let i = 0; i < 10; i++) {
|
|
35
|
+
const id = yield (0, generate_workspace_id_1.generateWorkspaceID)();
|
|
36
|
+
expect(new gitpod_host_url_1.GitpodHostUrl().withWorkspacePrefix(id, "eu").workspaceId).to.equal(id);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
testLongestName() {
|
|
41
|
+
const longestColor = generate_workspace_id_1.colors.sort((a, b) => b.length - a.length)[0];
|
|
42
|
+
const longestAnimal = generate_workspace_id_1.animals.sort((a, b) => b.length - a.length)[0];
|
|
43
|
+
const longestName = `${longestColor}-${longestAnimal}-12345678`;
|
|
44
|
+
expect(longestName.length <= 36, `"${longestName}" is longer than 36 chars (${longestName.length})`).to.be.true;
|
|
45
|
+
}
|
|
46
|
+
testCustomName() {
|
|
47
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
const data = [
|
|
49
|
+
["foo", "bar", "foo-bar-"],
|
|
50
|
+
["f", "bar", ".{2,16}-bar-"],
|
|
51
|
+
["gitpod-io", "gitpod", "gitpodio-gitpod-"],
|
|
52
|
+
["breatheco-de", "python-flask-api-tutorial", "breathecode-pythonflask-"],
|
|
53
|
+
["short", "muchlongerthaneleven", "short-muchlongerthanel-"],
|
|
54
|
+
["muchlongerthaneleven", "short", "muchlongerthanel-short-"],
|
|
55
|
+
[
|
|
56
|
+
'this is rather long and has some "§$"% special chars',
|
|
57
|
+
"also here pretty long and needs abbreviation",
|
|
58
|
+
"thisisrathe-alsoherepre-",
|
|
59
|
+
],
|
|
60
|
+
["UPPER", "CaSe", "upper-case-"],
|
|
61
|
+
[
|
|
62
|
+
"superlongfirstsegment",
|
|
63
|
+
"---------",
|
|
64
|
+
"superlong" /* we don't mantch for the whole first segment, because it has different length depending on the animal that is used to replace the -------*/,
|
|
65
|
+
],
|
|
66
|
+
];
|
|
67
|
+
for (const d of data) {
|
|
68
|
+
const id = yield (0, generate_workspace_id_1.generateWorkspaceID)(d[0], d[1]);
|
|
69
|
+
expect(id).match(new RegExp("^" + d[2]));
|
|
70
|
+
expect(new gitpod_host_url_1.GitpodHostUrl().withWorkspacePrefix(id, "eu").workspaceId).to.equal(id);
|
|
71
|
+
expect(id.length <= 36, `"${id}" is longer than 36 chars (${id.length})`).to.be.true;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
__decorate([
|
|
77
|
+
mocha_typescript_1.test,
|
|
78
|
+
__metadata("design:type", Function),
|
|
79
|
+
__metadata("design:paramtypes", []),
|
|
80
|
+
__metadata("design:returntype", Promise)
|
|
81
|
+
], TestGenerateWorkspaceId.prototype, "testGenerateWorkspaceId", null);
|
|
82
|
+
__decorate([
|
|
83
|
+
mocha_typescript_1.test,
|
|
84
|
+
__metadata("design:type", Function),
|
|
85
|
+
__metadata("design:paramtypes", []),
|
|
86
|
+
__metadata("design:returntype", void 0)
|
|
87
|
+
], TestGenerateWorkspaceId.prototype, "testLongestName", null);
|
|
88
|
+
__decorate([
|
|
89
|
+
mocha_typescript_1.test,
|
|
90
|
+
__metadata("design:type", Function),
|
|
91
|
+
__metadata("design:paramtypes", []),
|
|
92
|
+
__metadata("design:returntype", Promise)
|
|
93
|
+
], TestGenerateWorkspaceId.prototype, "testCustomName", null);
|
|
94
|
+
TestGenerateWorkspaceId = __decorate([
|
|
95
|
+
mocha_typescript_1.suite
|
|
96
|
+
], TestGenerateWorkspaceId);
|
|
97
|
+
module.exports = new TestGenerateWorkspaceId();
|
|
98
|
+
//# sourceMappingURL=generate-workspace-id.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-workspace-id.spec.js","sourceRoot":"","sources":["../../src/util/generate-workspace-id.spec.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;AAEH,uDAA+C;AAC/C,6BAA6B;AAC7B,mEAA+E;AAC/E,uDAAkD;AAElD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAG3B,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IACN,uBAAuB;;YACtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;gBACzB,MAAM,EAAE,GAAG,MAAM,IAAA,2CAAmB,GAAE,CAAC;gBACvC,MAAM,CAAC,IAAI,+BAAa,EAAE,CAAC,mBAAmB,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;aACtF;QACL,CAAC;KAAA;IAEY,eAAe;QACxB,MAAM,YAAY,GAAG,8BAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QACnE,MAAM,aAAa,GAAG,+BAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GA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,EAAE,CAAC,CAAC;gBACnF,MAAM,CAAC,EAAE,CAAC,MAAM,IAAI,EAAE,EAAE,IAAI,EAAE,8BAA8B,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;aACxF;QACL,CAAC;KAAA;CACJ,CAAA;AAzCS;IAAL,uBAAI;;;;sEAKJ;AAEK;IAAL,uBAAI;;;;8DAKJ;AAEK;IAAL,uBAAI;;;;6DA0BJ;AAzCC,uBAAuB;IAD5B,wBAAK;GACA,uBAAuB,CA0C5B;AACD,MAAM,CAAC,OAAO,GAAG,IAAI,uBAAuB,EAAE,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2021 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 * as cookie from "cookie";
|
|
7
|
+
/**
|
|
8
|
+
* This cookie indicates whether the connected client is a Gitpod user (= "has logged in within the last year") or not.
|
|
9
|
+
* This is used by "gitpod.io" and "www.gitpod.io" to display different content/buttons.
|
|
10
|
+
*/
|
|
11
|
+
export declare const NAME = "gitpod-user";
|
|
12
|
+
export declare const VALUE = "true";
|
|
13
|
+
/**
|
|
14
|
+
* @param domain The domain the Gitpod installation is installed onto
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
export declare function options(domain: string): cookie.CookieSerializeOptions;
|
|
18
|
+
export declare function generateCookie(domain: string): string;
|
|
19
|
+
export declare function isPresent(cookies: string): boolean;
|
|
20
|
+
//# sourceMappingURL=gitpod-cookie.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitpod-cookie.d.ts","sourceRoot":"","sources":["../../src/util/gitpod-cookie.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC;;;GAGG;AACH,eAAO,MAAM,IAAI,gBAAgB,CAAC;AAClC,eAAO,MAAM,KAAK,SAAS,CAAC;AAE5B;;;GAGG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,sBAAsB,CAUrE;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAGlD"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isPresent = exports.generateCookie = exports.options = exports.VALUE = exports.NAME = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
|
|
6
|
+
* Licensed under the GNU Affero General Public License (AGPL).
|
|
7
|
+
* See License.AGPL.txt in the project root for license information.
|
|
8
|
+
*/
|
|
9
|
+
const cookie = require("cookie");
|
|
10
|
+
/**
|
|
11
|
+
* This cookie indicates whether the connected client is a Gitpod user (= "has logged in within the last year") or not.
|
|
12
|
+
* This is used by "gitpod.io" and "www.gitpod.io" to display different content/buttons.
|
|
13
|
+
*/
|
|
14
|
+
exports.NAME = "gitpod-user";
|
|
15
|
+
exports.VALUE = "true";
|
|
16
|
+
/**
|
|
17
|
+
* @param domain The domain the Gitpod installation is installed onto
|
|
18
|
+
* @returns
|
|
19
|
+
*/
|
|
20
|
+
function options(domain) {
|
|
21
|
+
// Reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies
|
|
22
|
+
return {
|
|
23
|
+
path: "/",
|
|
24
|
+
httpOnly: false,
|
|
25
|
+
secure: false,
|
|
26
|
+
maxAge: 60 * 60 * 24 * 365,
|
|
27
|
+
sameSite: "lax",
|
|
28
|
+
domain: `.${domain}`, // explicilty include subdomains to not only cover "gitpod.io", but also "www.gitpod.io" or workspaces
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
exports.options = options;
|
|
32
|
+
function generateCookie(domain) {
|
|
33
|
+
return cookie.serialize(exports.NAME, exports.VALUE, options(domain));
|
|
34
|
+
}
|
|
35
|
+
exports.generateCookie = generateCookie;
|
|
36
|
+
function isPresent(cookies) {
|
|
37
|
+
// needs to match the old (gitpod-user=loggedIn) and new (gitpod-user=true) values to ensure a smooth transition during rollout.
|
|
38
|
+
return !!cookies.match(`${exports.NAME}=`);
|
|
39
|
+
}
|
|
40
|
+
exports.isPresent = isPresent;
|
|
41
|
+
//# sourceMappingURL=gitpod-cookie.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitpod-cookie.js","sourceRoot":"","sources":["../../src/util/gitpod-cookie.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,iCAAiC;AAEjC;;;GAGG;AACU,QAAA,IAAI,GAAG,aAAa,CAAC;AACrB,QAAA,KAAK,GAAG,MAAM,CAAC;AAE5B;;;GAGG;AACH,SAAgB,OAAO,CAAC,MAAc;IAClC,uEAAuE;IACvE,OAAO;QACH,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG;QAC1B,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,IAAI,MAAM,EAAE,EAAE,sGAAsG;KAC/H,CAAC;AACN,CAAC;AAVD,0BAUC;AAED,SAAgB,cAAc,CAAC,MAAc;IACzC,OAAO,MAAM,CAAC,SAAS,CAAC,YAAI,EAAE,aAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;AAC1D,CAAC;AAFD,wCAEC;AAED,SAAgB,SAAS,CAAC,OAAe;IACrC,gIAAgI;IAChI,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,YAAI,GAAG,CAAC,CAAC;AACvC,CAAC;AAHD,8BAGC"}
|