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