@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
|
@@ -1,33 +1,45 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2020
|
|
2
|
+
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
export interface UrlChange {
|
|
7
7
|
(old: URL): Partial<URL>;
|
|
8
8
|
}
|
|
9
9
|
export declare type UrlUpdate = UrlChange | Partial<URL>;
|
|
10
|
-
export declare const workspaceIDRegex: RegExp;
|
|
11
10
|
export declare class GitpodHostUrl {
|
|
12
11
|
readonly url: URL;
|
|
13
12
|
constructor(urlParam?: string | URL);
|
|
13
|
+
static fromWorkspaceUrl(url: string): GitpodHostUrl;
|
|
14
14
|
withWorkspacePrefix(workspaceId: string, region: string): GitpodHostUrl;
|
|
15
15
|
withDomainPrefix(prefix: string): GitpodHostUrl;
|
|
16
16
|
withoutWorkspacePrefix(): GitpodHostUrl;
|
|
17
17
|
withoutDomainPrefix(removeSegmentsCount: number): GitpodHostUrl;
|
|
18
18
|
with(urlUpdate: UrlUpdate): GitpodHostUrl;
|
|
19
19
|
withApi(urlUpdate?: UrlUpdate): GitpodHostUrl;
|
|
20
|
-
withContext(contextUrl: string
|
|
20
|
+
withContext(contextUrl: string, startOptions?: {
|
|
21
|
+
showOptions?: boolean;
|
|
22
|
+
editor?: string;
|
|
23
|
+
workspaceClass?: string;
|
|
24
|
+
}): GitpodHostUrl;
|
|
21
25
|
asWebsocket(): GitpodHostUrl;
|
|
26
|
+
asWorkspacePage(): GitpodHostUrl;
|
|
22
27
|
asDashboard(): GitpodHostUrl;
|
|
28
|
+
asBilling(): GitpodHostUrl;
|
|
23
29
|
asLogin(): GitpodHostUrl;
|
|
24
|
-
asUpgradeSubscription(): GitpodHostUrl;
|
|
25
30
|
asAccessControl(): GitpodHostUrl;
|
|
26
31
|
asSettings(): GitpodHostUrl;
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
asPreferences(): GitpodHostUrl;
|
|
33
|
+
asStart(workspaceId?: string | undefined): GitpodHostUrl;
|
|
34
|
+
asWorkspaceAuth(instanceID: string): GitpodHostUrl;
|
|
29
35
|
toString(): string;
|
|
30
36
|
toStringWoRootSlash(): string;
|
|
31
|
-
|
|
37
|
+
get debugWorkspace(): boolean;
|
|
38
|
+
get workspaceId(): string | undefined;
|
|
39
|
+
get blobServe(): boolean;
|
|
40
|
+
asSorry(message: string): GitpodHostUrl;
|
|
41
|
+
asApiLogout(): GitpodHostUrl;
|
|
42
|
+
asIDEProxy(): GitpodHostUrl;
|
|
43
|
+
asIDEMetrics(): GitpodHostUrl;
|
|
32
44
|
}
|
|
33
45
|
//# sourceMappingURL=gitpod-host-url.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitpod-host-url.d.ts","sourceRoot":"","sources":["../../src/util/gitpod-host-url.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,WAAW,SAAS;IACtB,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"gitpod-host-url.d.ts","sourceRoot":"","sources":["../../src/util/gitpod-host-url.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,WAAW,SAAS;IACtB,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CAC5B;AACD,oBAAY,SAAS,GAAG,SA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 +1,170 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Copyright (c) 2020
|
|
3
|
+
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
4
4
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
5
|
-
* See License
|
|
5
|
+
* See License.AGPL.txt in the project root for license information.
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
exports.GitpodHostUrl = void 0;
|
|
9
|
+
const URL = require("url").URL || window.URL;
|
|
10
|
+
const logging_1 = require("./logging");
|
|
11
|
+
const baseWorkspaceIDRegex = "(([a-f][0-9a-f]{7}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})|([0-9a-z]{2,16}-[0-9a-z]{2,16}-[0-9a-z]{8,11}))";
|
|
12
|
+
// this pattern matches v4 UUIDs as well as the new generated workspace ids (e.g. pink-panda-ns35kd21)
|
|
13
|
+
const workspaceIDRegex = RegExp(`^(?:debug-)?${baseWorkspaceIDRegex}$`);
|
|
14
|
+
// this pattern matches URL prefixes of workspaces
|
|
15
|
+
const workspaceUrlPrefixRegex = RegExp(`^(([0-9]{4,6}|debug)-)?${baseWorkspaceIDRegex}\\.`);
|
|
16
|
+
class GitpodHostUrl {
|
|
17
|
+
constructor(urlParam) {
|
|
18
|
+
if (urlParam === undefined || typeof urlParam === "string") {
|
|
19
|
+
this.url = new URL(urlParam || "https://gitpod.io");
|
|
20
|
+
this.url.search = "";
|
|
21
|
+
this.url.hash = "";
|
|
22
|
+
this.url.pathname = "";
|
|
18
23
|
}
|
|
19
24
|
else if (urlParam instanceof URL) {
|
|
20
25
|
this.url = urlParam;
|
|
21
26
|
}
|
|
22
27
|
else {
|
|
23
|
-
logging_1.log.error(
|
|
28
|
+
logging_1.log.error("Unexpected urlParam", { urlParam });
|
|
24
29
|
}
|
|
25
30
|
}
|
|
26
|
-
|
|
27
|
-
return
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return this.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
static fromWorkspaceUrl(url) {
|
|
32
|
+
return new GitpodHostUrl(new URL(url));
|
|
33
|
+
}
|
|
34
|
+
withWorkspacePrefix(workspaceId, region) {
|
|
35
|
+
return this.withDomainPrefix(`${workspaceId}.ws-${region}.`);
|
|
36
|
+
}
|
|
37
|
+
withDomainPrefix(prefix) {
|
|
38
|
+
return this.with((url) => ({ host: prefix + url.host }));
|
|
39
|
+
}
|
|
40
|
+
withoutWorkspacePrefix() {
|
|
41
|
+
if (!this.url.host.match(workspaceUrlPrefixRegex)) {
|
|
35
42
|
// URL has no workspace prefix
|
|
36
43
|
return this;
|
|
37
44
|
}
|
|
38
45
|
return this.withoutDomainPrefix(2);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return this.with(
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
}
|
|
47
|
+
withoutDomainPrefix(removeSegmentsCount) {
|
|
48
|
+
return this.with((url) => ({ host: url.host.split(".").splice(removeSegmentsCount).join(".") }));
|
|
49
|
+
}
|
|
50
|
+
with(urlUpdate) {
|
|
51
|
+
const update = typeof urlUpdate === "function" ? urlUpdate(this.url) : urlUpdate;
|
|
52
|
+
const addSlashToPath = update.pathname && update.pathname.length > 0 && !update.pathname.startsWith("/");
|
|
46
53
|
if (addSlashToPath) {
|
|
47
|
-
update.pathname =
|
|
54
|
+
update.pathname = "/" + update.pathname;
|
|
48
55
|
}
|
|
49
|
-
|
|
56
|
+
const result = Object.assign(new URL(this.toString()), update);
|
|
50
57
|
return new GitpodHostUrl(result);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return updated.with(
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
58
|
+
}
|
|
59
|
+
withApi(urlUpdate) {
|
|
60
|
+
const updated = urlUpdate ? this.with(urlUpdate) : this;
|
|
61
|
+
return updated.with((url) => ({ pathname: `/api${url.pathname}` }));
|
|
62
|
+
}
|
|
63
|
+
withContext(contextUrl, startOptions) {
|
|
64
|
+
const searchParams = new URLSearchParams();
|
|
65
|
+
if (startOptions === null || startOptions === void 0 ? void 0 : startOptions.showOptions) {
|
|
66
|
+
searchParams.append("showOptions", "true");
|
|
67
|
+
}
|
|
68
|
+
return this.with((url) => ({ hash: contextUrl, search: searchParams.toString() }));
|
|
69
|
+
}
|
|
70
|
+
asWebsocket() {
|
|
71
|
+
return this.with((url) => ({ protocol: url.protocol === "https:" ? "wss:" : "ws:" }));
|
|
72
|
+
}
|
|
73
|
+
asWorkspacePage() {
|
|
74
|
+
return this.with((url) => ({ pathname: "/workspaces" }));
|
|
75
|
+
}
|
|
76
|
+
asDashboard() {
|
|
77
|
+
return this.with((url) => ({ pathname: "/" }));
|
|
78
|
+
}
|
|
79
|
+
asBilling() {
|
|
80
|
+
return this.with((url) => ({ pathname: "/user/billing" }));
|
|
81
|
+
}
|
|
82
|
+
asLogin() {
|
|
83
|
+
return this.with((url) => ({ pathname: "/login" }));
|
|
84
|
+
}
|
|
85
|
+
asAccessControl() {
|
|
86
|
+
return this.with((url) => ({ pathname: "/integrations" }));
|
|
87
|
+
}
|
|
88
|
+
asSettings() {
|
|
89
|
+
return this.with((url) => ({ pathname: "/user/account" }));
|
|
90
|
+
}
|
|
91
|
+
asPreferences() {
|
|
92
|
+
return this.with((url) => ({ pathname: "/user/preferences" }));
|
|
93
|
+
}
|
|
94
|
+
asStart(workspaceId = this.workspaceId) {
|
|
95
|
+
return this.withoutWorkspacePrefix().with({
|
|
96
|
+
pathname: "/start/",
|
|
97
|
+
hash: "#" + workspaceId,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
asWorkspaceAuth(instanceID) {
|
|
101
|
+
return this.with((url) => ({
|
|
102
|
+
pathname: `/api/auth/workspace-cookie/${instanceID}`,
|
|
103
|
+
}));
|
|
104
|
+
}
|
|
105
|
+
toString() {
|
|
84
106
|
return this.url.toString();
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
if (result.endsWith(
|
|
107
|
+
}
|
|
108
|
+
toStringWoRootSlash() {
|
|
109
|
+
let result = this.toString();
|
|
110
|
+
if (result.endsWith("/")) {
|
|
89
111
|
result = result.slice(0, result.length - 1);
|
|
90
112
|
}
|
|
91
113
|
return result;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
114
|
+
}
|
|
115
|
+
get debugWorkspace() {
|
|
116
|
+
var _a;
|
|
117
|
+
return ((_a = this.url.host.match(workspaceUrlPrefixRegex)) === null || _a === void 0 ? void 0 : _a[2]) === "debug";
|
|
118
|
+
}
|
|
119
|
+
get workspaceId() {
|
|
120
|
+
const hostSegs = this.url.host.split(".");
|
|
121
|
+
if (hostSegs.length > 1) {
|
|
122
|
+
const matchResults = hostSegs[0].match(workspaceIDRegex);
|
|
123
|
+
if (matchResults) {
|
|
97
124
|
// URL has a workspace prefix
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
var pathSegs = window.location.pathname.split("/");
|
|
101
|
-
if (pathSegs.length > 3 && pathSegs[1] === "workspace") {
|
|
102
|
-
return pathSegs[2];
|
|
125
|
+
// port prefixes are excluded
|
|
126
|
+
return matchResults[1];
|
|
103
127
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
128
|
+
}
|
|
129
|
+
const pathSegs = this.url.pathname.split("/");
|
|
130
|
+
if (pathSegs.length > 3 && pathSegs[1] === "workspace") {
|
|
131
|
+
return pathSegs[2];
|
|
132
|
+
}
|
|
133
|
+
const cleanHash = this.url.hash.replace(/^#/, "");
|
|
134
|
+
if (this.url.pathname == "/start/" && cleanHash.match(workspaceIDRegex)) {
|
|
135
|
+
return cleanHash;
|
|
136
|
+
}
|
|
137
|
+
return undefined;
|
|
138
|
+
}
|
|
139
|
+
get blobServe() {
|
|
140
|
+
const hostSegments = this.url.host.split(".");
|
|
141
|
+
if (hostSegments[0] === "blobserve") {
|
|
142
|
+
return true;
|
|
143
|
+
}
|
|
144
|
+
const pathSegments = this.url.pathname.split("/");
|
|
145
|
+
return pathSegments[0] === "blobserve";
|
|
146
|
+
}
|
|
147
|
+
asSorry(message) {
|
|
148
|
+
return this.with({ pathname: "/sorry", hash: message });
|
|
149
|
+
}
|
|
150
|
+
asApiLogout() {
|
|
151
|
+
return this.withApi((url) => ({ pathname: "/logout/" }));
|
|
152
|
+
}
|
|
153
|
+
asIDEProxy() {
|
|
154
|
+
const hostSegments = this.url.host.split(".");
|
|
155
|
+
if (hostSegments[0] === "ide") {
|
|
156
|
+
return this;
|
|
157
|
+
}
|
|
158
|
+
return this.with((url) => ({ host: "ide." + url.host }));
|
|
159
|
+
}
|
|
160
|
+
asIDEMetrics() {
|
|
161
|
+
let newUrl = this;
|
|
162
|
+
const hostSegments = this.url.host.split(".");
|
|
163
|
+
if (hostSegments[0] !== "ide") {
|
|
164
|
+
newUrl = newUrl.asIDEProxy();
|
|
165
|
+
}
|
|
166
|
+
return newUrl.with((url) => ({ pathname: "/metrics-api" }));
|
|
167
|
+
}
|
|
168
|
+
}
|
|
111
169
|
exports.GitpodHostUrl = GitpodHostUrl;
|
|
112
170
|
//# sourceMappingURL=gitpod-host-url.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitpod-host-url.js","sourceRoot":"","sources":["../../src/util/gitpod-host-url.ts"],"names":[],"mappings":";AAAA;;;;GAIG
|
|
1
|
+
{"version":3,"file":"gitpod-host-url.js","sourceRoot":"","sources":["../../src/util/gitpod-host-url.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC;AAC7C,uCAAgC;AAOhC,MAAM,oBAAoB,GACtB,sHAAsH,CAAC;AAE3H,sGAAsG;AACtG,MAAM,gBAAgB,GAAG,MAAM,CAAC,eAAe,oBAAoB,GAAG,CAAC,CAAC;AAExE,kDAAkD;AAClD,MAAM,uBAAuB,GAAG,MAAM,CAAC,0BAA0B,oBAAoB,KAAK,CAAC,CAAC;AAE5F,MAAa,aAAa;IAGtB,YAAY,QAAuB;QAC/B,IAAI,QAAQ,KAAK,SAAS,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;YACxD,IAAI,CAAC,GAAG,GAAG,IAAI,GAAG,CAAC,QAAQ,IAAI,mBAAmB,CAAC,CAAC;YACpD,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;YACrB,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC;YACnB,IAAI,CAAC,GAAG,CAAC,QAAQ,GAAG,EAAE,CAAC;SAC1B;aAAM,IAAI,QAAQ,YAAY,GAAG,EAAE;YAChC,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAC;SACvB;aAAM;YACH,aAAG,CAAC,KAAK,CAAC,qBAAqB,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;SAClD;IACL,CAAC;IAED,MAAM,CAAC,gBAAgB,CAAC,GAAW;QAC/B,OAAO,IAAI,aAAa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AAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9C,IAAI,YAAY,CAAC,CAAC,CAAC,KAAK,KAAK,EAAE;YAC3B,MAAM,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;SAChC;QACD,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC;IAChE,CAAC;CACJ;AA1LD,sCA0LC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
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 declare class GitpodHostUrlTest {
|
|
7
|
+
parseWorkspaceId_pathBased(): void;
|
|
8
|
+
parseWorkspaceId_hosts_withEnvVarsInjected(): void;
|
|
9
|
+
testWithoutWorkspacePrefix(): Promise<void>;
|
|
10
|
+
testWithoutWorkspacePrefix2(): Promise<void>;
|
|
11
|
+
testWithoutWorkspacePrefix3(): Promise<void>;
|
|
12
|
+
testWithoutWorkspacePrefix4(): Promise<void>;
|
|
13
|
+
testWithoutWorkspacePrefix5(): Promise<void>;
|
|
14
|
+
testWithoutWorkspacePrefix6(): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=gitpod-host-url.spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitpod-host-url.spec.d.ts","sourceRoot":"","sources":["../../src/util/gitpod-host-url.spec.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,qBACa,iBAAiB;IACb,0BAA0B;IAO1B,0CAA0C;IAOpC,0BAA0B;IAQ1B,2BAA2B;IAM3B,2BAA2B;IAQ3B,2BAA2B;IAQ3B,2BAA2B;IAQ3B,2BAA2B;CASjD"}
|
|
@@ -0,0 +1,134 @@
|
|
|
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
|
+
exports.GitpodHostUrlTest = void 0;
|
|
27
|
+
const chai = require("chai");
|
|
28
|
+
const mocha_typescript_1 = require("mocha-typescript");
|
|
29
|
+
const gitpod_host_url_1 = require("./gitpod-host-url");
|
|
30
|
+
const expect = chai.expect;
|
|
31
|
+
let GitpodHostUrlTest = class GitpodHostUrlTest {
|
|
32
|
+
parseWorkspaceId_pathBased() {
|
|
33
|
+
const actual = gitpod_host_url_1.GitpodHostUrl.fromWorkspaceUrl("http://35.223.201.195/workspace/bc77e03d-c781-4235-bca0-e24087f5e472/").workspaceId;
|
|
34
|
+
expect(actual).to.equal("bc77e03d-c781-4235-bca0-e24087f5e472");
|
|
35
|
+
}
|
|
36
|
+
parseWorkspaceId_hosts_withEnvVarsInjected() {
|
|
37
|
+
const actual = gitpod_host_url_1.GitpodHostUrl.fromWorkspaceUrl("https://gray-grasshopper-nfbitfia.ws-eu02.gitpod-staging.com/#passedin=test%20value/https://github.com/gitpod-io/gitpod-test-repo").workspaceId;
|
|
38
|
+
expect(actual).to.equal("gray-grasshopper-nfbitfia");
|
|
39
|
+
}
|
|
40
|
+
testWithoutWorkspacePrefix() {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
expect(gitpod_host_url_1.GitpodHostUrl.fromWorkspaceUrl("https://3000-moccasin-ferret-155799b3.ws-eu02.gitpod-staging.com/")
|
|
43
|
+
.withoutWorkspacePrefix()
|
|
44
|
+
.toString()).to.equal("https://gitpod-staging.com/");
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
testWithoutWorkspacePrefix2() {
|
|
48
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
expect(gitpod_host_url_1.GitpodHostUrl.fromWorkspaceUrl("https://gitpod-staging.com/").withoutWorkspacePrefix().toString()).to.equal("https://gitpod-staging.com/");
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
testWithoutWorkspacePrefix3() {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
expect(gitpod_host_url_1.GitpodHostUrl.fromWorkspaceUrl("https://gray-rook-5523v5d8.ws-dev.my-branch-1234.staging.gitpod-dev.com/")
|
|
55
|
+
.withoutWorkspacePrefix()
|
|
56
|
+
.toString()).to.equal("https://my-branch-1234.staging.gitpod-dev.com/");
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
testWithoutWorkspacePrefix4() {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
expect(gitpod_host_url_1.GitpodHostUrl.fromWorkspaceUrl("https://my-branch-1234.staging.gitpod-dev.com/")
|
|
62
|
+
.withoutWorkspacePrefix()
|
|
63
|
+
.toString()).to.equal("https://my-branch-1234.staging.gitpod-dev.com/");
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
testWithoutWorkspacePrefix5() {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
expect(gitpod_host_url_1.GitpodHostUrl.fromWorkspaceUrl("https://abc-nice-brunch-4224.staging.gitpod-dev.com/")
|
|
69
|
+
.withoutWorkspacePrefix()
|
|
70
|
+
.toString()).to.equal("https://abc-nice-brunch-4224.staging.gitpod-dev.com/");
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
testWithoutWorkspacePrefix6() {
|
|
74
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
expect(gitpod_host_url_1.GitpodHostUrl.fromWorkspaceUrl("https://gray-rook-5523v5d8.ws-dev.abc-nice-brunch-4224.staging.gitpod-dev.com/")
|
|
76
|
+
.withoutWorkspacePrefix()
|
|
77
|
+
.toString()).to.equal("https://abc-nice-brunch-4224.staging.gitpod-dev.com/");
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
__decorate([
|
|
82
|
+
mocha_typescript_1.test,
|
|
83
|
+
__metadata("design:type", Function),
|
|
84
|
+
__metadata("design:paramtypes", []),
|
|
85
|
+
__metadata("design:returntype", void 0)
|
|
86
|
+
], GitpodHostUrlTest.prototype, "parseWorkspaceId_pathBased", null);
|
|
87
|
+
__decorate([
|
|
88
|
+
mocha_typescript_1.test,
|
|
89
|
+
__metadata("design:type", Function),
|
|
90
|
+
__metadata("design:paramtypes", []),
|
|
91
|
+
__metadata("design:returntype", void 0)
|
|
92
|
+
], GitpodHostUrlTest.prototype, "parseWorkspaceId_hosts_withEnvVarsInjected", null);
|
|
93
|
+
__decorate([
|
|
94
|
+
mocha_typescript_1.test,
|
|
95
|
+
__metadata("design:type", Function),
|
|
96
|
+
__metadata("design:paramtypes", []),
|
|
97
|
+
__metadata("design:returntype", Promise)
|
|
98
|
+
], GitpodHostUrlTest.prototype, "testWithoutWorkspacePrefix", null);
|
|
99
|
+
__decorate([
|
|
100
|
+
mocha_typescript_1.test,
|
|
101
|
+
__metadata("design:type", Function),
|
|
102
|
+
__metadata("design:paramtypes", []),
|
|
103
|
+
__metadata("design:returntype", Promise)
|
|
104
|
+
], GitpodHostUrlTest.prototype, "testWithoutWorkspacePrefix2", null);
|
|
105
|
+
__decorate([
|
|
106
|
+
mocha_typescript_1.test,
|
|
107
|
+
__metadata("design:type", Function),
|
|
108
|
+
__metadata("design:paramtypes", []),
|
|
109
|
+
__metadata("design:returntype", Promise)
|
|
110
|
+
], GitpodHostUrlTest.prototype, "testWithoutWorkspacePrefix3", null);
|
|
111
|
+
__decorate([
|
|
112
|
+
mocha_typescript_1.test,
|
|
113
|
+
__metadata("design:type", Function),
|
|
114
|
+
__metadata("design:paramtypes", []),
|
|
115
|
+
__metadata("design:returntype", Promise)
|
|
116
|
+
], GitpodHostUrlTest.prototype, "testWithoutWorkspacePrefix4", null);
|
|
117
|
+
__decorate([
|
|
118
|
+
mocha_typescript_1.test,
|
|
119
|
+
__metadata("design:type", Function),
|
|
120
|
+
__metadata("design:paramtypes", []),
|
|
121
|
+
__metadata("design:returntype", Promise)
|
|
122
|
+
], GitpodHostUrlTest.prototype, "testWithoutWorkspacePrefix5", null);
|
|
123
|
+
__decorate([
|
|
124
|
+
mocha_typescript_1.test,
|
|
125
|
+
__metadata("design:type", Function),
|
|
126
|
+
__metadata("design:paramtypes", []),
|
|
127
|
+
__metadata("design:returntype", Promise)
|
|
128
|
+
], GitpodHostUrlTest.prototype, "testWithoutWorkspacePrefix6", null);
|
|
129
|
+
GitpodHostUrlTest = __decorate([
|
|
130
|
+
mocha_typescript_1.suite
|
|
131
|
+
], GitpodHostUrlTest);
|
|
132
|
+
exports.GitpodHostUrlTest = GitpodHostUrlTest;
|
|
133
|
+
module.exports = new GitpodHostUrlTest();
|
|
134
|
+
//# sourceMappingURL=gitpod-host-url.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitpod-host-url.spec.js","sourceRoot":"","sources":["../../src/util/gitpod-host-url.spec.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;AAEH,6BAA6B;AAC7B,uDAA+C;AAC/C,uDAAkD;AAClD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAG3B,IAAa,iBAAiB,GAA9B,MAAa,iBAAiB;IACb,0BAA0B;QACnC,MAAM,MAAM,GAAG,+BAAa,CAAC,gBAAgB,CACzC,uEAAuE,CAC1E,CAAC,WAAW,CAAC;QACd,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;IACpE,CAAC;IAEY,0CAA0C;QACnD,MAAM,MAAM,GAAG,+BAAa,CAAC,gBAAgB,CACzC,mIAAmI,CACtI,CAAC,WAAW,CAAC;QACd,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;IACzD,CAAC;IAEkB,0BAA0B;;YACzC,MAAM,CACF,+BAAa,CAAC,gBAAgB,CAAC,mEAAmE,CAAC;iBAC9F,sBAAsB,EAAE;iBACxB,QAAQ,EAAE,CAClB,CAAC,EAAE,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;QAC9C,CAAC;KAAA;IAEkB,2BAA2B;;YAC1C,MAAM,CACF,+BAAa,C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,CA8D7B;AA9DY,8CAAiB;AA+D9B,MAAM,CAAC,OAAO,GAAG,IAAI,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
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 grpc from "@grpc/grpc-js";
|
|
7
|
+
export declare const defaultGRPCOptions: {
|
|
8
|
+
"grpc.keepalive_timeout_ms": number;
|
|
9
|
+
"grpc.keepalive_time_ms": number;
|
|
10
|
+
"grpc.http2.min_time_between_pings_ms": number;
|
|
11
|
+
"grpc.keepalive_permit_without_calls": number;
|
|
12
|
+
"grpc-node.max_session_memory": number;
|
|
13
|
+
"grpc.max_reconnect_backoff_ms": number;
|
|
14
|
+
"grpc.max_receive_message_length": number;
|
|
15
|
+
};
|
|
16
|
+
export declare type GrpcMethodType = "unary" | "client_stream" | "server_stream" | "bidi_stream";
|
|
17
|
+
export interface IGrpcCallMetricsLabels {
|
|
18
|
+
service: string;
|
|
19
|
+
method: string;
|
|
20
|
+
type: GrpcMethodType;
|
|
21
|
+
}
|
|
22
|
+
export interface IGrpcCallMetricsLabelsWithCode extends IGrpcCallMetricsLabels {
|
|
23
|
+
code: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const IClientCallMetrics: unique symbol;
|
|
26
|
+
export interface IClientCallMetrics {
|
|
27
|
+
started(labels: IGrpcCallMetricsLabels): void;
|
|
28
|
+
sent(labels: IGrpcCallMetricsLabels): void;
|
|
29
|
+
received(labels: IGrpcCallMetricsLabels): void;
|
|
30
|
+
handled(labels: IGrpcCallMetricsLabelsWithCode): void;
|
|
31
|
+
startHandleTimer(labels: IGrpcCallMetricsLabels): (labels?: Partial<Record<string, string | number>> | undefined) => number;
|
|
32
|
+
}
|
|
33
|
+
export declare function getGrpcMethodType(requestStream: boolean, responseStream: boolean): GrpcMethodType;
|
|
34
|
+
export declare function createClientCallMetricsInterceptor(metrics: IClientCallMetrics): grpc.Interceptor;
|
|
35
|
+
//# sourceMappingURL=grpc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grpc.d.ts","sourceRoot":"","sources":["../../src/util/grpc.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AAGtC,eAAO,MAAM,kBAAkB;;;;;;;;CAQ9B,CAAC;AAEF,oBAAY,cAAc,GAAG,OAAO,GAAG,eAAe,GAAG,eAAe,GAAG,aAAa,CAAC;AAEzF,MAAM,WAAW,sBAAsB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,cAAc,CAAC;CACxB;AAED,MAAM,WAAW,8BAA+B,SAAQ,sBAAsB;IAC1E,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,kBAAkB,eAA+B,CAAC;AAE/D,MAAM,WAAW,kBAAkB;IAC/B,OAAO,CAAC,MAAM,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAC9C,IAAI,CAAC,MAAM,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAC3C,QAAQ,CAAC,MAAM,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAC/C,OAAO,CAAC,MAAM,EAAE,8BAA8B,GAAG,IAAI,CAAC;IACtD,gBAAgB,CACZ,MAAM,EAAE,sBAAsB,GAC/B,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,GAAG,SAAS,KAAK,MAAM,CAAC;CAChF;AAED,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,GAAG,cAAc,CAcjG;AAED,wBAAgB,kCAAkC,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAAC,WAAW,CA+ChG"}
|