@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
package/lib/protocol.js
CHANGED
|
@@ -1,180 +1,373 @@
|
|
|
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
|
-
var __values = (this && this.__values) || function(o) {
|
|
8
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
9
|
-
if (m) return m.call(o);
|
|
10
|
-
if (o && typeof o.length === "number") return {
|
|
11
|
-
next: function () {
|
|
12
|
-
if (o && i >= o.length) o = void 0;
|
|
13
|
-
return { value: o && o[i++], done: !o };
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
17
|
-
};
|
|
18
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
19
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
20
|
-
if (!m) return o;
|
|
21
|
-
var i = m.call(o), r, ar = [], e;
|
|
22
|
-
try {
|
|
23
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
24
|
-
}
|
|
25
|
-
catch (error) { e = { error: error }; }
|
|
26
|
-
finally {
|
|
27
|
-
try {
|
|
28
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
29
|
-
}
|
|
30
|
-
finally { if (e) throw e.error; }
|
|
31
|
-
}
|
|
32
|
-
return ar;
|
|
33
|
-
};
|
|
34
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.TheiaPlugin = exports.AuthProviderEntry = exports.WorkspaceCreationResult = exports.WorkspaceInfo = exports.WorkspaceInstancePortsChangedEvent = exports.Repository = exports.NavigatorContext = exports.IssueContext = exports.PullRequestContext = exports.CommitContext = exports.OpenPrebuildContext = exports.AdditionalContentContext = exports.RefType = exports.WithEnvvarsContext = exports.WithReferrerContext = exports.PrebuiltWorkspaceContext = exports.StartPrebuildContext = exports.SnapshotContext = exports.WithDefaultConfig = exports.WithPrebuild = exports.WithSnapshot = exports.WorkspaceContext = exports.ExternalImageConfigFile = exports.ImageConfigFile = exports.ImageConfigString = exports.WorkspaceImageBuild = exports.TaskConfig = exports.PortRangeConfig = exports.PortConfig = exports.PrebuiltWorkspace = exports.WorkspaceImageSourceReference = exports.WorkspaceImageSourceDocker = exports.GithubAppPrebuildConfig = exports.Workspace = exports.Identity = exports.GitpodTokenType = exports.SSHPublicKeyValue = exports.UserEnvVar = exports.NamedWorkspaceFeatureFlag = exports.WorkspaceFeatureFlags = exports.AdditionalUserData = exports.User = void 0;
|
|
9
|
+
const crypto_1 = require("crypto");
|
|
10
|
+
const attribution_1 = require("./attribution");
|
|
35
11
|
var User;
|
|
36
12
|
(function (User) {
|
|
37
13
|
function is(data) {
|
|
38
|
-
return data
|
|
39
|
-
&& data.hasOwnProperty('id')
|
|
40
|
-
&& data.hasOwnProperty('identities');
|
|
14
|
+
return data && data.hasOwnProperty("id") && data.hasOwnProperty("identities");
|
|
41
15
|
}
|
|
42
16
|
User.is = is;
|
|
43
17
|
function getIdentity(user, authProviderId) {
|
|
44
|
-
return user.identities.find(
|
|
18
|
+
return user.identities.find((id) => id.authProviderId === authProviderId);
|
|
45
19
|
}
|
|
46
20
|
User.getIdentity = getIdentity;
|
|
21
|
+
function censor(user) {
|
|
22
|
+
const res = Object.assign({}, user);
|
|
23
|
+
delete res.additionalData;
|
|
24
|
+
res.identities = res.identities.map((i) => {
|
|
25
|
+
delete i.tokens;
|
|
26
|
+
// The user field is not in the Identity shape, but actually exists on DBIdentity.
|
|
27
|
+
// Trying to push this object out via JSON RPC will fail because of the cyclic nature
|
|
28
|
+
// of this field.
|
|
29
|
+
delete i.user;
|
|
30
|
+
return i;
|
|
31
|
+
});
|
|
32
|
+
return res;
|
|
33
|
+
}
|
|
34
|
+
User.censor = censor;
|
|
35
|
+
/**
|
|
36
|
+
* Returns the stored email or if it doesn't exist returns the primaryEmail of the first identity this user signed up with.
|
|
37
|
+
* @param user
|
|
38
|
+
* @returns A primaryEmail, or undefined if there is none.
|
|
39
|
+
*/
|
|
47
40
|
function getPrimaryEmail(user) {
|
|
48
|
-
var
|
|
41
|
+
var _a, _b, _c, _d;
|
|
42
|
+
if ((_b = (_a = user.additionalData) === null || _a === void 0 ? void 0 : _a.profile) === null || _b === void 0 ? void 0 : _b.emailAddress) {
|
|
43
|
+
return (_d = (_c = user.additionalData) === null || _c === void 0 ? void 0 : _c.profile) === null || _d === void 0 ? void 0 : _d.emailAddress;
|
|
44
|
+
}
|
|
45
|
+
const identities = user.identities.filter((i) => !!i.primaryEmail);
|
|
49
46
|
if (identities.length <= 0) {
|
|
50
|
-
|
|
47
|
+
return undefined;
|
|
51
48
|
}
|
|
52
|
-
return identities[0].primaryEmail;
|
|
49
|
+
return identities[0].primaryEmail || undefined;
|
|
53
50
|
}
|
|
54
51
|
User.getPrimaryEmail = getPrimaryEmail;
|
|
55
52
|
function getName(user) {
|
|
56
|
-
|
|
57
|
-
var name = user.fullName || user.name;
|
|
53
|
+
const name = user.fullName || user.name;
|
|
58
54
|
if (name) {
|
|
59
55
|
return name;
|
|
60
56
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (id.authName !== "") {
|
|
65
|
-
return id.authName;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
70
|
-
finally {
|
|
71
|
-
try {
|
|
72
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
57
|
+
for (const id of user.identities) {
|
|
58
|
+
if (id.authName !== "") {
|
|
59
|
+
return id.authName;
|
|
73
60
|
}
|
|
74
|
-
finally { if (e_1) throw e_1.error; }
|
|
75
61
|
}
|
|
76
62
|
return undefined;
|
|
77
63
|
}
|
|
78
64
|
User.getName = getName;
|
|
65
|
+
function hasPreferredIde(user) {
|
|
66
|
+
var _a, _b, _c, _d;
|
|
67
|
+
return (typeof ((_b = (_a = user === null || user === void 0 ? void 0 : user.additionalData) === null || _a === void 0 ? void 0 : _a.ideSettings) === null || _b === void 0 ? void 0 : _b.defaultIde) !== "undefined" ||
|
|
68
|
+
typeof ((_d = (_c = user === null || user === void 0 ? void 0 : user.additionalData) === null || _c === void 0 ? void 0 : _c.ideSettings) === null || _d === void 0 ? void 0 : _d.useLatestVersion) !== "undefined");
|
|
69
|
+
}
|
|
70
|
+
User.hasPreferredIde = hasPreferredIde;
|
|
71
|
+
function isOnboardingUser(user) {
|
|
72
|
+
return !hasPreferredIde(user);
|
|
73
|
+
}
|
|
74
|
+
User.isOnboardingUser = isOnboardingUser;
|
|
75
|
+
function migrationIDESettings(user) {
|
|
76
|
+
var _a;
|
|
77
|
+
if (!((_a = user === null || user === void 0 ? void 0 : user.additionalData) === null || _a === void 0 ? void 0 : _a.ideSettings) ||
|
|
78
|
+
Object.keys(user.additionalData.ideSettings).length === 0 ||
|
|
79
|
+
user.additionalData.ideSettings.settingVersion === "2.0") {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const newIDESettings = {
|
|
83
|
+
settingVersion: "2.0",
|
|
84
|
+
};
|
|
85
|
+
const ideSettings = user.additionalData.ideSettings;
|
|
86
|
+
if (ideSettings.useDesktopIde) {
|
|
87
|
+
if (ideSettings.defaultDesktopIde === "code-desktop") {
|
|
88
|
+
newIDESettings.defaultIde = "code-desktop";
|
|
89
|
+
}
|
|
90
|
+
else if (ideSettings.defaultDesktopIde === "code-desktop-insiders") {
|
|
91
|
+
newIDESettings.defaultIde = "code-desktop";
|
|
92
|
+
newIDESettings.useLatestVersion = true;
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
newIDESettings.defaultIde = ideSettings.defaultDesktopIde;
|
|
96
|
+
newIDESettings.useLatestVersion = ideSettings.useLatestVersion;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
const useLatest = ideSettings.defaultIde === "code-latest";
|
|
101
|
+
newIDESettings.defaultIde = "code";
|
|
102
|
+
newIDESettings.useLatestVersion = useLatest;
|
|
103
|
+
}
|
|
104
|
+
user.additionalData.ideSettings = newIDESettings;
|
|
105
|
+
}
|
|
106
|
+
User.migrationIDESettings = migrationIDESettings;
|
|
107
|
+
// TODO: make it more explicit that these field names are relied for our tracking purposes
|
|
108
|
+
// and decouple frontend from relying on them - instead use user.additionalData.profile object directly in FE
|
|
109
|
+
function getProfile(user) {
|
|
110
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
111
|
+
return {
|
|
112
|
+
name: User.getName(user) || "",
|
|
113
|
+
email: User.getPrimaryEmail(user) || "",
|
|
114
|
+
company: (_b = (_a = user === null || user === void 0 ? void 0 : user.additionalData) === null || _a === void 0 ? void 0 : _a.profile) === null || _b === void 0 ? void 0 : _b.companyName,
|
|
115
|
+
avatarURL: user === null || user === void 0 ? void 0 : user.avatarUrl,
|
|
116
|
+
companyWebsite: (_d = (_c = user === null || user === void 0 ? void 0 : user.additionalData) === null || _c === void 0 ? void 0 : _c.profile) === null || _d === void 0 ? void 0 : _d.companyWebsite,
|
|
117
|
+
jobRole: (_f = (_e = user === null || user === void 0 ? void 0 : user.additionalData) === null || _e === void 0 ? void 0 : _e.profile) === null || _f === void 0 ? void 0 : _f.jobRole,
|
|
118
|
+
jobRoleOther: (_h = (_g = user === null || user === void 0 ? void 0 : user.additionalData) === null || _g === void 0 ? void 0 : _g.profile) === null || _h === void 0 ? void 0 : _h.jobRoleOther,
|
|
119
|
+
explorationReasons: (_k = (_j = user === null || user === void 0 ? void 0 : user.additionalData) === null || _j === void 0 ? void 0 : _j.profile) === null || _k === void 0 ? void 0 : _k.explorationReasons,
|
|
120
|
+
signupGoals: (_m = (_l = user === null || user === void 0 ? void 0 : user.additionalData) === null || _l === void 0 ? void 0 : _l.profile) === null || _m === void 0 ? void 0 : _m.signupGoals,
|
|
121
|
+
signupGoalsOther: (_p = (_o = user === null || user === void 0 ? void 0 : user.additionalData) === null || _o === void 0 ? void 0 : _o.profile) === null || _p === void 0 ? void 0 : _p.signupGoalsOther,
|
|
122
|
+
companySize: (_r = (_q = user === null || user === void 0 ? void 0 : user.additionalData) === null || _q === void 0 ? void 0 : _q.profile) === null || _r === void 0 ? void 0 : _r.companySize,
|
|
123
|
+
onboardedTimestamp: (_t = (_s = user === null || user === void 0 ? void 0 : user.additionalData) === null || _s === void 0 ? void 0 : _s.profile) === null || _t === void 0 ? void 0 : _t.onboardedTimestamp,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
User.getProfile = getProfile;
|
|
127
|
+
function setProfile(user, profile) {
|
|
128
|
+
user.fullName = profile.name;
|
|
129
|
+
user.avatarUrl = profile.avatarURL;
|
|
130
|
+
if (!user.additionalData) {
|
|
131
|
+
user.additionalData = {};
|
|
132
|
+
}
|
|
133
|
+
if (!user.additionalData.profile) {
|
|
134
|
+
user.additionalData.profile = {};
|
|
135
|
+
}
|
|
136
|
+
user.additionalData.profile.emailAddress = profile.email;
|
|
137
|
+
user.additionalData.profile.companyName = profile.company;
|
|
138
|
+
user.additionalData.profile.lastUpdatedDetailsNudge = new Date().toISOString();
|
|
139
|
+
return user;
|
|
140
|
+
}
|
|
141
|
+
User.setProfile = setProfile;
|
|
142
|
+
function getDefaultAttributionId(user) {
|
|
143
|
+
if (user.usageAttributionId) {
|
|
144
|
+
const result = attribution_1.AttributionId.parse(user.usageAttributionId);
|
|
145
|
+
if (!result) {
|
|
146
|
+
throw new Error("Invalid attribution ID: " + user.usageAttributionId);
|
|
147
|
+
}
|
|
148
|
+
return result;
|
|
149
|
+
}
|
|
150
|
+
return attribution_1.AttributionId.create(user);
|
|
151
|
+
}
|
|
152
|
+
User.getDefaultAttributionId = getDefaultAttributionId;
|
|
153
|
+
let Profile;
|
|
154
|
+
(function (Profile) {
|
|
155
|
+
function hasChanges(before, after) {
|
|
156
|
+
return (before.name !== after.name ||
|
|
157
|
+
before.email !== after.email ||
|
|
158
|
+
before.company !== after.company ||
|
|
159
|
+
before.avatarURL !== after.avatarURL ||
|
|
160
|
+
before.companyWebsite !== after.companyWebsite ||
|
|
161
|
+
before.jobRole !== after.jobRole ||
|
|
162
|
+
before.jobRoleOther !== after.jobRoleOther ||
|
|
163
|
+
// not checking explorationReasons or signupGoals atm as it's an array - need to check deep equality
|
|
164
|
+
before.signupGoalsOther !== after.signupGoalsOther ||
|
|
165
|
+
before.onboardedTimestamp !== after.onboardedTimestamp ||
|
|
166
|
+
before.companySize !== after.companySize);
|
|
167
|
+
}
|
|
168
|
+
Profile.hasChanges = hasChanges;
|
|
169
|
+
})(Profile = User.Profile || (User.Profile = {}));
|
|
79
170
|
})(User = exports.User || (exports.User = {}));
|
|
171
|
+
var AdditionalUserData;
|
|
172
|
+
(function (AdditionalUserData) {
|
|
173
|
+
function set(user, partialData) {
|
|
174
|
+
if (!user.additionalData) {
|
|
175
|
+
user.additionalData = Object.assign({}, partialData);
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
user.additionalData = Object.assign(Object.assign({}, user.additionalData), partialData);
|
|
179
|
+
}
|
|
180
|
+
return user;
|
|
181
|
+
}
|
|
182
|
+
AdditionalUserData.set = set;
|
|
183
|
+
})(AdditionalUserData = exports.AdditionalUserData || (exports.AdditionalUserData = {}));
|
|
80
184
|
/**
|
|
81
185
|
* The values of this type MUST MATCH enum values in WorkspaceFeatureFlag from ws-manager/client/core_pb.d.ts
|
|
82
186
|
* If they don't we'll break things during workspace startup.
|
|
83
187
|
*/
|
|
84
|
-
exports.WorkspaceFeatureFlags = {
|
|
188
|
+
exports.WorkspaceFeatureFlags = {
|
|
189
|
+
full_workspace_backup: undefined,
|
|
190
|
+
workspace_class_limiting: undefined,
|
|
191
|
+
workspace_connection_limiting: undefined,
|
|
192
|
+
workspace_psi: undefined,
|
|
193
|
+
};
|
|
194
|
+
var NamedWorkspaceFeatureFlag;
|
|
195
|
+
(function (NamedWorkspaceFeatureFlag) {
|
|
196
|
+
NamedWorkspaceFeatureFlag.WORKSPACE_PERSISTED_FEATTURE_FLAGS = ["full_workspace_backup"];
|
|
197
|
+
function isWorkspacePersisted(ff) {
|
|
198
|
+
return NamedWorkspaceFeatureFlag.WORKSPACE_PERSISTED_FEATTURE_FLAGS.includes(ff);
|
|
199
|
+
}
|
|
200
|
+
NamedWorkspaceFeatureFlag.isWorkspacePersisted = isWorkspacePersisted;
|
|
201
|
+
})(NamedWorkspaceFeatureFlag = exports.NamedWorkspaceFeatureFlag || (exports.NamedWorkspaceFeatureFlag = {}));
|
|
85
202
|
var UserEnvVar;
|
|
86
203
|
(function (UserEnvVar) {
|
|
204
|
+
/**
|
|
205
|
+
* @param variable
|
|
206
|
+
* @returns Either a string containing an error message or undefined.
|
|
207
|
+
*/
|
|
208
|
+
function validate(variable) {
|
|
209
|
+
const name = variable.name;
|
|
210
|
+
const pattern = variable.repositoryPattern;
|
|
211
|
+
if (name.trim() === "") {
|
|
212
|
+
return "Name must not be empty.";
|
|
213
|
+
}
|
|
214
|
+
if (name.length > 255) {
|
|
215
|
+
return "Name too long. Maximum name length is 255 characters.";
|
|
216
|
+
}
|
|
217
|
+
if (!/^[a-zA-Z_]+[a-zA-Z0-9_]*$/.test(name)) {
|
|
218
|
+
return "Name must match /^[a-zA-Z_]+[a-zA-Z0-9_]*$/.";
|
|
219
|
+
}
|
|
220
|
+
if (variable.value.trim() === "") {
|
|
221
|
+
return "Value must not be empty.";
|
|
222
|
+
}
|
|
223
|
+
if (variable.value.length > 32767) {
|
|
224
|
+
return "Value too long. Maximum value length is 32767 characters.";
|
|
225
|
+
}
|
|
226
|
+
if (pattern.trim() === "") {
|
|
227
|
+
return "Scope must not be empty.";
|
|
228
|
+
}
|
|
229
|
+
const split = pattern.split("/");
|
|
230
|
+
if (split.length < 2) {
|
|
231
|
+
return "A scope must use the form 'organization/repo'.";
|
|
232
|
+
}
|
|
233
|
+
for (const name of split) {
|
|
234
|
+
if (name !== "*") {
|
|
235
|
+
if (!/^[a-zA-Z0-9_\-.\*]+$/.test(name)) {
|
|
236
|
+
return "Invalid scope segment. Only ASCII characters, numbers, -, _, . or * are allowed.";
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return undefined;
|
|
241
|
+
}
|
|
242
|
+
UserEnvVar.validate = validate;
|
|
243
|
+
// DEPRECATED: Use ProjectEnvVar instead of repositoryPattern - https://github.com/gitpod-com/gitpod/issues/5322
|
|
87
244
|
function normalizeRepoPattern(pattern) {
|
|
88
245
|
return pattern.toLocaleLowerCase();
|
|
89
246
|
}
|
|
90
247
|
UserEnvVar.normalizeRepoPattern = normalizeRepoPattern;
|
|
248
|
+
// DEPRECATED: Use ProjectEnvVar instead of repositoryPattern - https://github.com/gitpod-com/gitpod/issues/5322
|
|
249
|
+
function score(value) {
|
|
250
|
+
// We use a score to enforce precedence:
|
|
251
|
+
// value/value = 0
|
|
252
|
+
// value/* = 1
|
|
253
|
+
// */value = 2
|
|
254
|
+
// */* = 3
|
|
255
|
+
// #/# = 4 (used for env vars passed through the URL)
|
|
256
|
+
// the lower the score, the higher the precedence.
|
|
257
|
+
const [ownerPattern, repoPattern] = splitRepositoryPattern(value.repositoryPattern);
|
|
258
|
+
let score = 0;
|
|
259
|
+
if (repoPattern == "*") {
|
|
260
|
+
score += 1;
|
|
261
|
+
}
|
|
262
|
+
if (ownerPattern == "*") {
|
|
263
|
+
score += 2;
|
|
264
|
+
}
|
|
265
|
+
if (ownerPattern == "#" || repoPattern == "#") {
|
|
266
|
+
score = 4;
|
|
267
|
+
}
|
|
268
|
+
return score;
|
|
269
|
+
}
|
|
270
|
+
UserEnvVar.score = score;
|
|
271
|
+
// DEPRECATED: Use ProjectEnvVar instead of repositoryPattern - https://github.com/gitpod-com/gitpod/issues/5322
|
|
91
272
|
function filter(vars, owner, repo) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
if (ownerPattern !== '*' && ownerPattern !== '#' && (!!owner && ownerPattern !== owner.toLocaleLowerCase())) {
|
|
273
|
+
let result = vars.filter((e) => {
|
|
274
|
+
const [ownerPattern, repoPattern] = splitRepositoryPattern(e.repositoryPattern);
|
|
275
|
+
if (ownerPattern !== "*" && ownerPattern !== "#" && !!owner && ownerPattern !== owner.toLocaleLowerCase()) {
|
|
96
276
|
return false;
|
|
97
277
|
}
|
|
98
|
-
if (repoPattern !==
|
|
278
|
+
if (repoPattern !== "*" && repoPattern !== "#" && !!repo && repoPattern !== repo.toLocaleLowerCase()) {
|
|
99
279
|
return false;
|
|
100
280
|
}
|
|
101
281
|
return true;
|
|
102
282
|
});
|
|
103
|
-
|
|
104
|
-
result.forEach(
|
|
105
|
-
|
|
283
|
+
const resmap = new Map();
|
|
284
|
+
result.forEach((e) => {
|
|
285
|
+
const l = resmap.get(e.name) || [];
|
|
106
286
|
l.push(e);
|
|
107
287
|
resmap.set(e.name, l);
|
|
108
288
|
});
|
|
109
289
|
result = [];
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
// not sure how this can happen, but so be it
|
|
116
|
-
continue;
|
|
117
|
-
}
|
|
118
|
-
if (candidates.length == 1) {
|
|
119
|
-
result.push(candidates[0]);
|
|
120
|
-
continue;
|
|
121
|
-
}
|
|
122
|
-
var minscore = 10;
|
|
123
|
-
var bestCandidate = void 0;
|
|
124
|
-
try {
|
|
125
|
-
for (var candidates_1 = (e_3 = void 0, __values(candidates)), candidates_1_1 = candidates_1.next(); !candidates_1_1.done; candidates_1_1 = candidates_1.next()) {
|
|
126
|
-
var e = candidates_1_1.value;
|
|
127
|
-
// We use a score to enforce precedence:
|
|
128
|
-
// value/value = 0
|
|
129
|
-
// value/* = 1
|
|
130
|
-
// */value = 2
|
|
131
|
-
// */* = 3
|
|
132
|
-
// #/# = 4 (used for env vars passed through the URL)
|
|
133
|
-
// the lower the score, the higher the precedence.
|
|
134
|
-
var _e = __read(splitRepositoryPattern(e.repositoryPattern), 2), ownerPattern = _e[0], repoPattern = _e[1];
|
|
135
|
-
var score = 0;
|
|
136
|
-
if (repoPattern == "*") {
|
|
137
|
-
score += 1;
|
|
138
|
-
}
|
|
139
|
-
if (ownerPattern == '*') {
|
|
140
|
-
score += 2;
|
|
141
|
-
}
|
|
142
|
-
if (ownerPattern == "#" || repoPattern == "#") {
|
|
143
|
-
score = 4;
|
|
144
|
-
}
|
|
145
|
-
if (!bestCandidate || score < minscore) {
|
|
146
|
-
minscore = score;
|
|
147
|
-
bestCandidate = e;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
152
|
-
finally {
|
|
153
|
-
try {
|
|
154
|
-
if (candidates_1_1 && !candidates_1_1.done && (_b = candidates_1.return)) _b.call(candidates_1);
|
|
155
|
-
}
|
|
156
|
-
finally { if (e_3) throw e_3.error; }
|
|
157
|
-
}
|
|
158
|
-
result.push(bestCandidate);
|
|
290
|
+
for (const name of resmap.keys()) {
|
|
291
|
+
const candidates = resmap.get(name);
|
|
292
|
+
if (!candidates) {
|
|
293
|
+
// not sure how this can happen, but so be it
|
|
294
|
+
continue;
|
|
159
295
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
296
|
+
if (candidates.length == 1) {
|
|
297
|
+
result.push(candidates[0]);
|
|
298
|
+
continue;
|
|
299
|
+
}
|
|
300
|
+
let minscore = 10;
|
|
301
|
+
let bestCandidate;
|
|
302
|
+
for (const e of candidates) {
|
|
303
|
+
const score = UserEnvVar.score(e);
|
|
304
|
+
if (!bestCandidate || score < minscore) {
|
|
305
|
+
minscore = score;
|
|
306
|
+
bestCandidate = e;
|
|
307
|
+
}
|
|
165
308
|
}
|
|
166
|
-
|
|
309
|
+
result.push(bestCandidate);
|
|
167
310
|
}
|
|
168
311
|
return result;
|
|
169
312
|
}
|
|
170
313
|
UserEnvVar.filter = filter;
|
|
314
|
+
// DEPRECATED: Use ProjectEnvVar instead of repositoryPattern - https://github.com/gitpod-com/gitpod/issues/5322
|
|
171
315
|
function splitRepositoryPattern(repositoryPattern) {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
316
|
+
const patterns = repositoryPattern.split("/");
|
|
317
|
+
const repoPattern = patterns.slice(1).join("/");
|
|
318
|
+
const ownerPattern = patterns[0];
|
|
175
319
|
return [ownerPattern, repoPattern];
|
|
176
320
|
}
|
|
321
|
+
UserEnvVar.splitRepositoryPattern = splitRepositoryPattern;
|
|
177
322
|
})(UserEnvVar = exports.UserEnvVar || (exports.UserEnvVar = {}));
|
|
323
|
+
var SSHPublicKeyValue;
|
|
324
|
+
(function (SSHPublicKeyValue) {
|
|
325
|
+
function validate(value) {
|
|
326
|
+
if (value.name.length === 0) {
|
|
327
|
+
return "Title must not be empty.";
|
|
328
|
+
}
|
|
329
|
+
if (value.name.length > 255) {
|
|
330
|
+
return "Title too long. Maximum value length is 255 characters.";
|
|
331
|
+
}
|
|
332
|
+
if (value.key.length === 0) {
|
|
333
|
+
return "Key must not be empty.";
|
|
334
|
+
}
|
|
335
|
+
try {
|
|
336
|
+
getData(value);
|
|
337
|
+
}
|
|
338
|
+
catch (e) {
|
|
339
|
+
return "Key is invalid. You must supply a key in OpenSSH public key format.";
|
|
340
|
+
}
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
SSHPublicKeyValue.validate = validate;
|
|
344
|
+
function getData(value) {
|
|
345
|
+
var _a, _b, _c;
|
|
346
|
+
// Begins with 'ssh-rsa', 'ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp384', 'ecdsa-sha2-nistp521', 'ssh-ed25519', 'sk-ecdsa-sha2-nistp256@openssh.com', or 'sk-ssh-ed25519@openssh.com'.
|
|
347
|
+
const regex = /^(?<type>ssh-rsa|ecdsa-sha2-nistp256|ecdsa-sha2-nistp384|ecdsa-sha2-nistp521|ssh-ed25519|sk-ecdsa-sha2-nistp256@openssh\.com|sk-ssh-ed25519@openssh\.com) (?<key>.*?)( (?<email>.*?))?$/;
|
|
348
|
+
const resultGroup = regex.exec(value.key.trim());
|
|
349
|
+
if (!resultGroup) {
|
|
350
|
+
throw new Error("Key is invalid.");
|
|
351
|
+
}
|
|
352
|
+
return {
|
|
353
|
+
type: (_a = resultGroup.groups) === null || _a === void 0 ? void 0 : _a["type"],
|
|
354
|
+
key: (_b = resultGroup.groups) === null || _b === void 0 ? void 0 : _b["key"],
|
|
355
|
+
email: ((_c = resultGroup.groups) === null || _c === void 0 ? void 0 : _c["email"]) || undefined,
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
SSHPublicKeyValue.getData = getData;
|
|
359
|
+
function getFingerprint(value) {
|
|
360
|
+
const data = getData(value);
|
|
361
|
+
let buf = Buffer.from(data.key, "base64");
|
|
362
|
+
// gitlab style
|
|
363
|
+
// const hash = createHash("md5").update(buf).digest("hex");
|
|
364
|
+
// github style
|
|
365
|
+
const hash = (0, crypto_1.createHash)("sha256").update(buf).digest("base64");
|
|
366
|
+
return hash;
|
|
367
|
+
}
|
|
368
|
+
SSHPublicKeyValue.getFingerprint = getFingerprint;
|
|
369
|
+
SSHPublicKeyValue.MAXIMUM_KEY_LENGTH = 5;
|
|
370
|
+
})(SSHPublicKeyValue = exports.SSHPublicKeyValue || (exports.SSHPublicKeyValue = {}));
|
|
178
371
|
var GitpodTokenType;
|
|
179
372
|
(function (GitpodTokenType) {
|
|
180
373
|
GitpodTokenType[GitpodTokenType["API_AUTH_TOKEN"] = 0] = "API_AUTH_TOKEN";
|
|
@@ -183,14 +376,11 @@ var GitpodTokenType;
|
|
|
183
376
|
var Identity;
|
|
184
377
|
(function (Identity) {
|
|
185
378
|
function is(data) {
|
|
186
|
-
return data.hasOwnProperty(
|
|
187
|
-
&& data.hasOwnProperty('authId')
|
|
188
|
-
&& data.hasOwnProperty('authName');
|
|
379
|
+
return (data.hasOwnProperty("authProviderId") && data.hasOwnProperty("authId") && data.hasOwnProperty("authName"));
|
|
189
380
|
}
|
|
190
381
|
Identity.is = is;
|
|
191
382
|
function equals(id1, id2) {
|
|
192
|
-
return id1.authProviderId === id2.authProviderId
|
|
193
|
-
&& id1.authId === id2.authId;
|
|
383
|
+
return id1.authProviderId === id2.authProviderId && id1.authId === id2.authId;
|
|
194
384
|
}
|
|
195
385
|
Identity.equals = equals;
|
|
196
386
|
})(Identity = exports.Identity || (exports.Identity = {}));
|
|
@@ -198,14 +388,14 @@ var Workspace;
|
|
|
198
388
|
(function (Workspace) {
|
|
199
389
|
function getFullRepositoryName(ws) {
|
|
200
390
|
if (CommitContext.is(ws.context)) {
|
|
201
|
-
return ws.context.repository.owner +
|
|
391
|
+
return ws.context.repository.owner + "/" + ws.context.repository.name;
|
|
202
392
|
}
|
|
203
393
|
return undefined;
|
|
204
394
|
}
|
|
205
395
|
Workspace.getFullRepositoryName = getFullRepositoryName;
|
|
206
396
|
function getFullRepositoryUrl(ws) {
|
|
207
397
|
if (CommitContext.is(ws.context)) {
|
|
208
|
-
return
|
|
398
|
+
return `https://${ws.context.repository.host}/${getFullRepositoryName(ws)}`;
|
|
209
399
|
}
|
|
210
400
|
return undefined;
|
|
211
401
|
}
|
|
@@ -242,28 +432,30 @@ var Workspace;
|
|
|
242
432
|
var GithubAppPrebuildConfig;
|
|
243
433
|
(function (GithubAppPrebuildConfig) {
|
|
244
434
|
function is(obj) {
|
|
245
|
-
return !(typeof obj ===
|
|
435
|
+
return !(typeof obj === "boolean");
|
|
246
436
|
}
|
|
247
437
|
GithubAppPrebuildConfig.is = is;
|
|
248
438
|
})(GithubAppPrebuildConfig = exports.GithubAppPrebuildConfig || (exports.GithubAppPrebuildConfig = {}));
|
|
249
439
|
var WorkspaceImageSourceDocker;
|
|
250
440
|
(function (WorkspaceImageSourceDocker) {
|
|
251
441
|
function is(obj) {
|
|
252
|
-
return
|
|
253
|
-
&& 'dockerFileSource' in obj
|
|
254
|
-
&& 'dockerFilePath' in obj;
|
|
442
|
+
return "dockerFileHash" in obj && "dockerFilePath" in obj;
|
|
255
443
|
}
|
|
256
444
|
WorkspaceImageSourceDocker.is = is;
|
|
257
445
|
})(WorkspaceImageSourceDocker = exports.WorkspaceImageSourceDocker || (exports.WorkspaceImageSourceDocker = {}));
|
|
258
446
|
var WorkspaceImageSourceReference;
|
|
259
447
|
(function (WorkspaceImageSourceReference) {
|
|
260
448
|
function is(obj) {
|
|
261
|
-
return
|
|
449
|
+
return "baseImageResolved" in obj;
|
|
262
450
|
}
|
|
263
451
|
WorkspaceImageSourceReference.is = is;
|
|
264
452
|
})(WorkspaceImageSourceReference = exports.WorkspaceImageSourceReference || (exports.WorkspaceImageSourceReference = {}));
|
|
265
453
|
var PrebuiltWorkspace;
|
|
266
454
|
(function (PrebuiltWorkspace) {
|
|
455
|
+
function isDone(pws) {
|
|
456
|
+
return (pws.state === "available" || pws.state === "timeout" || pws.state === "aborted" || pws.state === "failed");
|
|
457
|
+
}
|
|
458
|
+
PrebuiltWorkspace.isDone = isDone;
|
|
267
459
|
function isAvailable(pws) {
|
|
268
460
|
return pws.state === "available" && !!pws.snapshot;
|
|
269
461
|
}
|
|
@@ -276,129 +468,123 @@ var PrebuiltWorkspace;
|
|
|
276
468
|
var PortConfig;
|
|
277
469
|
(function (PortConfig) {
|
|
278
470
|
function is(config) {
|
|
279
|
-
return config &&
|
|
471
|
+
return config && "port" in config && typeof config.port === "number";
|
|
280
472
|
}
|
|
281
473
|
PortConfig.is = is;
|
|
282
474
|
})(PortConfig = exports.PortConfig || (exports.PortConfig = {}));
|
|
283
475
|
var PortRangeConfig;
|
|
284
476
|
(function (PortRangeConfig) {
|
|
285
477
|
function is(config) {
|
|
286
|
-
return config &&
|
|
478
|
+
return config && "port" in config && (typeof config.port === "string" || config.port instanceof String);
|
|
287
479
|
}
|
|
288
480
|
PortRangeConfig.is = is;
|
|
289
481
|
})(PortRangeConfig = exports.PortRangeConfig || (exports.PortRangeConfig = {}));
|
|
290
482
|
var TaskConfig;
|
|
291
483
|
(function (TaskConfig) {
|
|
292
484
|
function is(config) {
|
|
293
|
-
return config
|
|
294
|
-
&& ('command' in config || 'init' in config || 'before' in config);
|
|
485
|
+
return config && ("command" in config || "init" in config || "before" in config);
|
|
295
486
|
}
|
|
296
487
|
TaskConfig.is = is;
|
|
297
488
|
})(TaskConfig = exports.TaskConfig || (exports.TaskConfig = {}));
|
|
298
489
|
var WorkspaceImageBuild;
|
|
299
490
|
(function (WorkspaceImageBuild) {
|
|
300
|
-
|
|
491
|
+
let LogLine;
|
|
301
492
|
(function (LogLine) {
|
|
302
|
-
LogLine.DELIMITER =
|
|
493
|
+
LogLine.DELIMITER = "\r\n";
|
|
303
494
|
LogLine.DELIMITER_REGEX = /\r?\n/;
|
|
304
495
|
})(LogLine = WorkspaceImageBuild.LogLine || (WorkspaceImageBuild.LogLine = {}));
|
|
305
496
|
})(WorkspaceImageBuild = exports.WorkspaceImageBuild || (exports.WorkspaceImageBuild = {}));
|
|
306
497
|
var ImageConfigString;
|
|
307
498
|
(function (ImageConfigString) {
|
|
308
499
|
function is(config) {
|
|
309
|
-
return typeof config ===
|
|
500
|
+
return typeof config === "string";
|
|
310
501
|
}
|
|
311
502
|
ImageConfigString.is = is;
|
|
312
503
|
})(ImageConfigString = exports.ImageConfigString || (exports.ImageConfigString = {}));
|
|
313
504
|
var ImageConfigFile;
|
|
314
505
|
(function (ImageConfigFile) {
|
|
315
506
|
function is(config) {
|
|
316
|
-
return typeof config ===
|
|
317
|
-
&& 'file' in config;
|
|
507
|
+
return typeof config === "object" && "file" in config;
|
|
318
508
|
}
|
|
319
509
|
ImageConfigFile.is = is;
|
|
320
510
|
})(ImageConfigFile = exports.ImageConfigFile || (exports.ImageConfigFile = {}));
|
|
321
511
|
var ExternalImageConfigFile;
|
|
322
512
|
(function (ExternalImageConfigFile) {
|
|
323
513
|
function is(config) {
|
|
324
|
-
return typeof config ===
|
|
325
|
-
&& 'file' in config
|
|
326
|
-
&& 'externalSource' in config;
|
|
514
|
+
return typeof config === "object" && "file" in config && "externalSource" in config;
|
|
327
515
|
}
|
|
328
516
|
ExternalImageConfigFile.is = is;
|
|
329
517
|
})(ExternalImageConfigFile = exports.ExternalImageConfigFile || (exports.ExternalImageConfigFile = {}));
|
|
330
518
|
var WorkspaceContext;
|
|
331
519
|
(function (WorkspaceContext) {
|
|
332
520
|
function is(context) {
|
|
333
|
-
return context
|
|
334
|
-
&& 'title' in context;
|
|
521
|
+
return context && "title" in context;
|
|
335
522
|
}
|
|
336
523
|
WorkspaceContext.is = is;
|
|
337
524
|
})(WorkspaceContext = exports.WorkspaceContext || (exports.WorkspaceContext = {}));
|
|
338
525
|
var WithSnapshot;
|
|
339
526
|
(function (WithSnapshot) {
|
|
340
527
|
function is(context) {
|
|
341
|
-
return context
|
|
342
|
-
&& 'snapshotBucketId' in context;
|
|
528
|
+
return context && "snapshotBucketId" in context;
|
|
343
529
|
}
|
|
344
530
|
WithSnapshot.is = is;
|
|
345
531
|
})(WithSnapshot = exports.WithSnapshot || (exports.WithSnapshot = {}));
|
|
346
532
|
var WithPrebuild;
|
|
347
533
|
(function (WithPrebuild) {
|
|
348
534
|
function is(context) {
|
|
349
|
-
return context
|
|
350
|
-
&& 'snapshotBucketId' in context
|
|
351
|
-
&& 'prebuildWorkspaceId' in context
|
|
352
|
-
&& 'wasPrebuilt' in context;
|
|
535
|
+
return context && WithSnapshot.is(context) && "prebuildWorkspaceId" in context && "wasPrebuilt" in context;
|
|
353
536
|
}
|
|
354
537
|
WithPrebuild.is = is;
|
|
355
538
|
})(WithPrebuild = exports.WithPrebuild || (exports.WithPrebuild = {}));
|
|
539
|
+
var WithDefaultConfig;
|
|
540
|
+
(function (WithDefaultConfig) {
|
|
541
|
+
function is(context) {
|
|
542
|
+
return context && "withDefaultConfig" in context && context.withDefaultConfig;
|
|
543
|
+
}
|
|
544
|
+
WithDefaultConfig.is = is;
|
|
545
|
+
function mark(ctx) {
|
|
546
|
+
return Object.assign(Object.assign({}, ctx), { withDefaultConfig: true });
|
|
547
|
+
}
|
|
548
|
+
WithDefaultConfig.mark = mark;
|
|
549
|
+
})(WithDefaultConfig = exports.WithDefaultConfig || (exports.WithDefaultConfig = {}));
|
|
356
550
|
var SnapshotContext;
|
|
357
551
|
(function (SnapshotContext) {
|
|
358
552
|
function is(context) {
|
|
359
|
-
return context
|
|
360
|
-
&& WithSnapshot.is(context)
|
|
361
|
-
&& 'snapshotId' in context;
|
|
553
|
+
return context && WithSnapshot.is(context) && "snapshotId" in context;
|
|
362
554
|
}
|
|
363
555
|
SnapshotContext.is = is;
|
|
364
556
|
})(SnapshotContext = exports.SnapshotContext || (exports.SnapshotContext = {}));
|
|
365
557
|
var StartPrebuildContext;
|
|
366
558
|
(function (StartPrebuildContext) {
|
|
367
559
|
function is(context) {
|
|
368
|
-
return context
|
|
369
|
-
&& 'actual' in context;
|
|
560
|
+
return context && "actual" in context;
|
|
370
561
|
}
|
|
371
562
|
StartPrebuildContext.is = is;
|
|
372
563
|
})(StartPrebuildContext = exports.StartPrebuildContext || (exports.StartPrebuildContext = {}));
|
|
373
564
|
var PrebuiltWorkspaceContext;
|
|
374
565
|
(function (PrebuiltWorkspaceContext) {
|
|
375
566
|
function is(context) {
|
|
376
|
-
return context
|
|
377
|
-
&& 'originalContext' in context
|
|
378
|
-
&& 'prebuiltWorkspace' in context;
|
|
567
|
+
return context && "originalContext" in context && "prebuiltWorkspace" in context;
|
|
379
568
|
}
|
|
380
569
|
PrebuiltWorkspaceContext.is = is;
|
|
381
570
|
})(PrebuiltWorkspaceContext = exports.PrebuiltWorkspaceContext || (exports.PrebuiltWorkspaceContext = {}));
|
|
571
|
+
var WithReferrerContext;
|
|
572
|
+
(function (WithReferrerContext) {
|
|
573
|
+
function is(context) {
|
|
574
|
+
return context && "referrer" in context;
|
|
575
|
+
}
|
|
576
|
+
WithReferrerContext.is = is;
|
|
577
|
+
})(WithReferrerContext = exports.WithReferrerContext || (exports.WithReferrerContext = {}));
|
|
382
578
|
var WithEnvvarsContext;
|
|
383
579
|
(function (WithEnvvarsContext) {
|
|
384
580
|
function is(context) {
|
|
385
|
-
return context
|
|
386
|
-
&& 'envvars' in context;
|
|
581
|
+
return context && "envvars" in context;
|
|
387
582
|
}
|
|
388
583
|
WithEnvvarsContext.is = is;
|
|
389
584
|
})(WithEnvvarsContext = exports.WithEnvvarsContext || (exports.WithEnvvarsContext = {}));
|
|
390
|
-
var WorkspaceProbeContext;
|
|
391
|
-
(function (WorkspaceProbeContext) {
|
|
392
|
-
function is(context) {
|
|
393
|
-
return context
|
|
394
|
-
&& 'responseURL' in context
|
|
395
|
-
&& 'responseToken' in context;
|
|
396
|
-
}
|
|
397
|
-
WorkspaceProbeContext.is = is;
|
|
398
|
-
})(WorkspaceProbeContext = exports.WorkspaceProbeContext || (exports.WorkspaceProbeContext = {}));
|
|
399
585
|
var RefType;
|
|
400
586
|
(function (RefType) {
|
|
401
|
-
RefType.getRefType =
|
|
587
|
+
RefType.getRefType = (commit) => {
|
|
402
588
|
if (!commit.ref) {
|
|
403
589
|
return "revision";
|
|
404
590
|
}
|
|
@@ -406,48 +592,78 @@ var RefType;
|
|
|
406
592
|
return commit.refType || "branch";
|
|
407
593
|
};
|
|
408
594
|
})(RefType = exports.RefType || (exports.RefType = {}));
|
|
595
|
+
var AdditionalContentContext;
|
|
596
|
+
(function (AdditionalContentContext) {
|
|
597
|
+
function is(ctx) {
|
|
598
|
+
return "additionalFiles" in ctx;
|
|
599
|
+
}
|
|
600
|
+
AdditionalContentContext.is = is;
|
|
601
|
+
function hasDockerConfig(ctx, config) {
|
|
602
|
+
return is(ctx) && ImageConfigFile.is(config.image) && !!ctx.additionalFiles[config.image.file];
|
|
603
|
+
}
|
|
604
|
+
AdditionalContentContext.hasDockerConfig = hasDockerConfig;
|
|
605
|
+
})(AdditionalContentContext = exports.AdditionalContentContext || (exports.AdditionalContentContext = {}));
|
|
606
|
+
var OpenPrebuildContext;
|
|
607
|
+
(function (OpenPrebuildContext) {
|
|
608
|
+
function is(ctx) {
|
|
609
|
+
return "openPrebuildID" in ctx;
|
|
610
|
+
}
|
|
611
|
+
OpenPrebuildContext.is = is;
|
|
612
|
+
})(OpenPrebuildContext = exports.OpenPrebuildContext || (exports.OpenPrebuildContext = {}));
|
|
409
613
|
var CommitContext;
|
|
614
|
+
(function (CommitContext) {
|
|
615
|
+
/**
|
|
616
|
+
* Creates a hash for all the commits of the CommitContext and all sub-repo commit infos.
|
|
617
|
+
* The hash is max 255 chars long.
|
|
618
|
+
* @param commitContext
|
|
619
|
+
* @returns hash for commitcontext
|
|
620
|
+
*/
|
|
621
|
+
function computeHash(commitContext) {
|
|
622
|
+
// for single commits we use the revision to be backward compatible.
|
|
623
|
+
if (!commitContext.additionalRepositoryCheckoutInfo ||
|
|
624
|
+
commitContext.additionalRepositoryCheckoutInfo.length === 0) {
|
|
625
|
+
return commitContext.revision;
|
|
626
|
+
}
|
|
627
|
+
const hasher = (0, crypto_1.createHash)("sha256");
|
|
628
|
+
hasher.update(commitContext.revision);
|
|
629
|
+
for (const info of commitContext.additionalRepositoryCheckoutInfo) {
|
|
630
|
+
hasher.update(info.revision);
|
|
631
|
+
}
|
|
632
|
+
return hasher.digest("hex");
|
|
633
|
+
}
|
|
634
|
+
CommitContext.computeHash = computeHash;
|
|
635
|
+
})(CommitContext = exports.CommitContext || (exports.CommitContext = {}));
|
|
410
636
|
(function (CommitContext) {
|
|
411
637
|
function is(commit) {
|
|
412
|
-
return WorkspaceContext.is(commit)
|
|
413
|
-
&& 'repository' in commit
|
|
414
|
-
&& 'revision' in commit;
|
|
638
|
+
return WorkspaceContext.is(commit) && "repository" in commit && "revision" in commit;
|
|
415
639
|
}
|
|
416
640
|
CommitContext.is = is;
|
|
417
641
|
})(CommitContext = exports.CommitContext || (exports.CommitContext = {}));
|
|
418
642
|
var PullRequestContext;
|
|
419
643
|
(function (PullRequestContext) {
|
|
420
644
|
function is(ctx) {
|
|
421
|
-
return CommitContext.is(ctx)
|
|
422
|
-
&& 'nr' in ctx
|
|
423
|
-
&& 'ref' in ctx
|
|
424
|
-
&& 'base' in ctx;
|
|
645
|
+
return CommitContext.is(ctx) && "nr" in ctx && "ref" in ctx && "base" in ctx;
|
|
425
646
|
}
|
|
426
647
|
PullRequestContext.is = is;
|
|
427
648
|
})(PullRequestContext = exports.PullRequestContext || (exports.PullRequestContext = {}));
|
|
428
649
|
var IssueContext;
|
|
429
650
|
(function (IssueContext) {
|
|
430
651
|
function is(ctx) {
|
|
431
|
-
return CommitContext.is(ctx)
|
|
432
|
-
&& 'nr' in ctx
|
|
433
|
-
&& 'ref' in ctx
|
|
434
|
-
&& 'localBranch' in ctx;
|
|
652
|
+
return CommitContext.is(ctx) && "nr" in ctx && "ref" in ctx && "localBranch" in ctx;
|
|
435
653
|
}
|
|
436
654
|
IssueContext.is = is;
|
|
437
655
|
})(IssueContext = exports.IssueContext || (exports.IssueContext = {}));
|
|
438
656
|
var NavigatorContext;
|
|
439
657
|
(function (NavigatorContext) {
|
|
440
658
|
function is(ctx) {
|
|
441
|
-
return CommitContext.is(ctx)
|
|
442
|
-
&& 'path' in ctx
|
|
443
|
-
&& 'isFile' in ctx;
|
|
659
|
+
return CommitContext.is(ctx) && "path" in ctx && "isFile" in ctx;
|
|
444
660
|
}
|
|
445
661
|
NavigatorContext.is = is;
|
|
446
662
|
})(NavigatorContext = exports.NavigatorContext || (exports.NavigatorContext = {}));
|
|
447
663
|
var Repository;
|
|
448
664
|
(function (Repository) {
|
|
449
665
|
function fullRepoName(repo) {
|
|
450
|
-
return repo.host
|
|
666
|
+
return `${repo.host}/${repo.owner}/${repo.name}`;
|
|
451
667
|
}
|
|
452
668
|
Repository.fullRepoName = fullRepoName;
|
|
453
669
|
})(Repository = exports.Repository || (exports.Repository = {}));
|
|
@@ -458,30 +674,35 @@ var WorkspaceInstancePortsChangedEvent;
|
|
|
458
674
|
}
|
|
459
675
|
WorkspaceInstancePortsChangedEvent.is = is;
|
|
460
676
|
})(WorkspaceInstancePortsChangedEvent = exports.WorkspaceInstancePortsChangedEvent || (exports.WorkspaceInstancePortsChangedEvent = {}));
|
|
461
|
-
var
|
|
462
|
-
(function (
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
// SelectIfRunning returns a list of currently running workspaces for the context URL if there are any, otherwise falls back to Default mode
|
|
470
|
-
CreateWorkspaceMode["SelectIfRunning"] = "select-if-running";
|
|
471
|
-
})(CreateWorkspaceMode = exports.CreateWorkspaceMode || (exports.CreateWorkspaceMode = {}));
|
|
677
|
+
var WorkspaceInfo;
|
|
678
|
+
(function (WorkspaceInfo) {
|
|
679
|
+
function lastActiveISODate(info) {
|
|
680
|
+
var _a;
|
|
681
|
+
return ((_a = info.latestInstance) === null || _a === void 0 ? void 0 : _a.creationTime) || info.workspace.creationTime;
|
|
682
|
+
}
|
|
683
|
+
WorkspaceInfo.lastActiveISODate = lastActiveISODate;
|
|
684
|
+
})(WorkspaceInfo = exports.WorkspaceInfo || (exports.WorkspaceInfo = {}));
|
|
472
685
|
var WorkspaceCreationResult;
|
|
473
686
|
(function (WorkspaceCreationResult) {
|
|
474
687
|
function is(data) {
|
|
475
|
-
return data &&
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
688
|
+
return (data &&
|
|
689
|
+
("createdWorkspaceId" in data ||
|
|
690
|
+
"existingWorkspaces" in data ||
|
|
691
|
+
"runningWorkspacePrebuild" in data ||
|
|
692
|
+
"runningPrebuildWorkspaceID" in data));
|
|
479
693
|
}
|
|
480
694
|
WorkspaceCreationResult.is = is;
|
|
481
695
|
})(WorkspaceCreationResult = exports.WorkspaceCreationResult || (exports.WorkspaceCreationResult = {}));
|
|
696
|
+
var AuthProviderEntry;
|
|
697
|
+
(function (AuthProviderEntry) {
|
|
698
|
+
function redact(entry) {
|
|
699
|
+
return Object.assign(Object.assign({}, entry), { oauth: Object.assign(Object.assign({}, entry.oauth), { clientSecret: "redacted" }) });
|
|
700
|
+
}
|
|
701
|
+
AuthProviderEntry.redact = redact;
|
|
702
|
+
})(AuthProviderEntry = exports.AuthProviderEntry || (exports.AuthProviderEntry = {}));
|
|
482
703
|
var TheiaPlugin;
|
|
483
704
|
(function (TheiaPlugin) {
|
|
484
|
-
|
|
705
|
+
let State;
|
|
485
706
|
(function (State) {
|
|
486
707
|
State["Uploading"] = "uploading";
|
|
487
708
|
State["Uploaded"] = "uploaded";
|