@gitpod/gitpod-protocol 0.1.5-update-ovsx.0 → 0.1.5-update-yarnlock.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/gitpod-schema.json +159 -25
- package/lib/accounting-protocol.d.ts +165 -0
- package/lib/accounting-protocol.d.ts.map +1 -0
- package/lib/accounting-protocol.js +120 -0
- package/lib/accounting-protocol.js.map +1 -0
- package/lib/admin-protocol.d.ts +51 -6
- package/lib/admin-protocol.d.ts.map +1 -1
- package/lib/admin-protocol.js +17 -2
- package/lib/admin-protocol.js.map +1 -1
- package/lib/analytics.d.ts +44 -0
- package/lib/analytics.d.ts.map +1 -0
- package/lib/analytics.js +10 -0
- package/lib/analytics.js.map +1 -0
- package/lib/attribution.d.ts +25 -0
- package/lib/attribution.d.ts.map +1 -0
- package/lib/attribution.js +58 -0
- package/lib/attribution.js.map +1 -0
- package/lib/auth.d.ts +25 -0
- package/lib/auth.d.ts.map +1 -0
- package/lib/auth.js +16 -0
- package/lib/auth.js.map +1 -0
- package/lib/billing-mode.d.ts +45 -0
- package/lib/billing-mode.d.ts.map +1 -0
- package/lib/billing-mode.js +44 -0
- package/lib/billing-mode.js.map +1 -0
- package/lib/blocked-repositories-protocol.d.ts +13 -0
- package/lib/blocked-repositories-protocol.d.ts.map +1 -0
- package/lib/blocked-repositories-protocol.js +8 -0
- package/lib/blocked-repositories-protocol.js.map +1 -0
- package/lib/context-url.d.ts +30 -0
- package/lib/context-url.d.ts.map +1 -0
- package/lib/context-url.js +100 -0
- package/lib/context-url.js.map +1 -0
- package/lib/context-url.spec.d.ts +12 -0
- package/lib/context-url.spec.d.ts.map +1 -0
- package/lib/context-url.spec.js +81 -0
- package/lib/context-url.spec.js.map +1 -0
- package/lib/encryption/container-module.d.ts +2 -2
- package/lib/encryption/container-module.d.ts.map +1 -1
- package/lib/encryption/container-module.js +8 -6
- package/lib/encryption/container-module.js.map +1 -1
- package/lib/encryption/encryption-engine.d.ts +2 -2
- package/lib/encryption/encryption-engine.d.ts.map +1 -1
- package/lib/encryption/encryption-engine.js +28 -28
- package/lib/encryption/encryption-engine.js.map +1 -1
- package/lib/encryption/encryption-engine.spec.d.ts +3 -3
- package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
- package/lib/encryption/encryption-engine.spec.js +32 -39
- package/lib/encryption/encryption-engine.spec.js.map +1 -1
- package/lib/encryption/encryption-service.d.ts +2 -2
- package/lib/encryption/encryption-service.d.ts.map +1 -1
- package/lib/encryption/encryption-service.js +33 -46
- package/lib/encryption/encryption-service.js.map +1 -1
- package/lib/encryption/key-provider.d.ts +3 -3
- package/lib/encryption/key-provider.d.ts.map +1 -1
- package/lib/encryption/key-provider.js +34 -40
- package/lib/encryption/key-provider.js.map +1 -1
- package/lib/env.d.ts +2 -8
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +10 -29
- package/lib/env.js.map +1 -1
- package/lib/experiments/always-default.d.ts +8 -0
- package/lib/experiments/always-default.d.ts.map +1 -0
- package/lib/experiments/always-default.js +20 -0
- package/lib/experiments/always-default.js.map +1 -0
- package/lib/experiments/configcat-server.d.ts +10 -0
- package/lib/experiments/configcat-server.d.ts.map +1 -0
- package/lib/experiments/configcat-server.js +37 -0
- package/lib/experiments/configcat-server.js.map +1 -0
- package/lib/experiments/configcat.d.ts +21 -0
- package/lib/experiments/configcat.d.ts.map +1 -0
- package/lib/experiments/configcat.js +51 -0
- package/lib/experiments/configcat.js.map +1 -0
- package/lib/experiments/types.d.ts +22 -0
- package/lib/experiments/types.d.ts.map +1 -0
- package/lib/experiments/types.js +10 -0
- package/lib/experiments/types.js.map +1 -0
- package/lib/frontend-dashboard-service.d.ts +99 -0
- package/lib/frontend-dashboard-service.d.ts.map +1 -0
- package/lib/frontend-dashboard-service.js +55 -0
- package/lib/frontend-dashboard-service.js.map +1 -0
- package/lib/gitpod-file-parser.d.ts +2 -2
- package/lib/gitpod-file-parser.d.ts.map +1 -1
- package/lib/gitpod-file-parser.js +29 -44
- package/lib/gitpod-file-parser.js.map +1 -1
- package/lib/gitpod-file-parser.spec.d.ts +2 -2
- package/lib/gitpod-file-parser.spec.js +147 -144
- package/lib/gitpod-file-parser.spec.js.map +1 -1
- package/lib/gitpod-service.d.ts +290 -50
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +288 -123
- package/lib/gitpod-service.js.map +1 -1
- package/lib/headless-workspace-log.d.ts +11 -13
- package/lib/headless-workspace-log.d.ts.map +1 -1
- package/lib/headless-workspace-log.js +8 -9
- package/lib/headless-workspace-log.js.map +1 -1
- package/lib/ide-frontend-service.d.ts +26 -0
- package/lib/ide-frontend-service.d.ts.map +1 -0
- package/lib/ide-frontend-service.js +8 -0
- package/lib/ide-frontend-service.js.map +1 -0
- package/lib/ide-protocol.d.ts +126 -0
- package/lib/ide-protocol.d.ts.map +1 -0
- package/lib/ide-protocol.js +18 -0
- package/lib/ide-protocol.js.map +1 -0
- package/lib/index.d.ts +18 -12
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +28 -13
- package/lib/index.js.map +1 -1
- package/lib/installation-admin-protocol.d.ts +30 -0
- package/lib/installation-admin-protocol.d.ts.map +1 -0
- package/lib/installation-admin-protocol.js +31 -0
- package/lib/installation-admin-protocol.js.map +1 -0
- package/lib/license-protocol.d.ts +9 -2
- package/lib/license-protocol.d.ts.map +1 -1
- package/lib/license-protocol.js +3 -2
- package/lib/license-protocol.js.map +1 -1
- package/lib/messaging/browser/connection.d.ts +6 -4
- package/lib/messaging/browser/connection.d.ts.map +1 -1
- package/lib/messaging/browser/connection.js +188 -48
- package/lib/messaging/browser/connection.js.map +1 -1
- package/lib/messaging/browser/window-connection.d.ts +9 -4
- package/lib/messaging/browser/window-connection.d.ts.map +1 -1
- package/lib/messaging/browser/window-connection.js +48 -59
- package/lib/messaging/browser/window-connection.js.map +1 -1
- package/lib/messaging/client-call-metrics.d.ts +21 -0
- package/lib/messaging/client-call-metrics.d.ts.map +1 -0
- package/lib/messaging/client-call-metrics.js +95 -0
- package/lib/messaging/client-call-metrics.js.map +1 -0
- package/lib/messaging/error.d.ts +18 -4
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +38 -7
- package/lib/messaging/error.js.map +1 -1
- package/lib/messaging/handler.d.ts +10 -0
- package/lib/messaging/handler.d.ts.map +1 -1
- package/lib/messaging/handler.js +2 -1
- package/lib/messaging/handler.js.map +1 -1
- package/lib/messaging/node/connection.d.ts +1 -17
- package/lib/messaging/node/connection.d.ts.map +1 -1
- package/lib/messaging/node/connection.js +24 -59
- package/lib/messaging/node/connection.js.map +1 -1
- package/lib/messaging/proxy-factory.d.ts +3 -1
- package/lib/messaging/proxy-factory.d.ts.map +1 -1
- package/lib/messaging/proxy-factory.js +76 -162
- package/lib/messaging/proxy-factory.js.map +1 -1
- package/lib/oss-allowlist.d.ts +14 -0
- package/lib/oss-allowlist.d.ts.map +1 -0
- package/lib/oss-allowlist.js +8 -0
- package/lib/oss-allowlist.js.map +1 -0
- package/lib/payment-protocol.d.ts +18 -0
- package/lib/payment-protocol.d.ts.map +1 -0
- package/lib/payment-protocol.js +13 -0
- package/lib/payment-protocol.js.map +1 -0
- package/lib/permission.d.ts +26 -15
- package/lib/permission.d.ts.map +1 -1
- package/lib/permission.js +50 -36
- package/lib/permission.js.map +1 -1
- package/lib/plans.d.ts +213 -0
- package/lib/plans.d.ts.map +1 -0
- package/lib/plans.js +625 -0
- package/lib/plans.js.map +1 -0
- package/lib/protocol.d.ts +338 -111
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +422 -201
- package/lib/protocol.js.map +1 -1
- package/lib/protocol.spec.d.ts +7 -0
- package/lib/protocol.spec.d.ts.map +1 -0
- package/lib/protocol.spec.js +127 -0
- package/lib/protocol.spec.js.map +1 -0
- package/lib/snapshot-url.d.ts +14 -0
- package/lib/snapshot-url.d.ts.map +1 -0
- package/lib/snapshot-url.js +26 -0
- package/lib/snapshot-url.js.map +1 -0
- package/lib/snapshot-url.spec.d.ts +7 -0
- package/lib/snapshot-url.spec.d.ts.map +1 -0
- package/lib/snapshot-url.spec.js +41 -0
- package/lib/snapshot-url.spec.js.map +1 -0
- package/lib/team-subscription-protocol.d.ts +93 -0
- package/lib/team-subscription-protocol.d.ts.map +1 -0
- package/lib/team-subscription-protocol.js +82 -0
- package/lib/team-subscription-protocol.js.map +1 -0
- package/lib/teams-projects-protocol.d.ts +136 -0
- package/lib/teams-projects-protocol.d.ts.map +1 -0
- package/lib/teams-projects-protocol.js +41 -0
- package/lib/teams-projects-protocol.js.map +1 -0
- package/lib/typings/globals.d.ts +8 -3
- package/lib/typings/globals.d.ts.map +1 -1
- package/lib/typings/globals.js +2 -2
- package/lib/usage.d.ts +73 -0
- package/lib/usage.d.ts.map +1 -0
- package/lib/usage.js +20 -0
- package/lib/usage.js.map +1 -0
- package/lib/util/analytics.d.ts +8 -0
- package/lib/util/analytics.d.ts.map +1 -0
- package/lib/util/analytics.js +88 -0
- package/lib/util/analytics.js.map +1 -0
- package/lib/util/async-iterator.d.ts +2 -2
- package/lib/util/async-iterator.d.ts.map +1 -1
- package/lib/util/async-iterator.js +60 -137
- package/lib/util/async-iterator.js.map +1 -1
- package/lib/util/cancelable.d.ts +2 -2
- package/lib/util/cancelable.js +20 -61
- package/lib/util/cancelable.js.map +1 -1
- package/lib/util/date-time.d.ts +2 -2
- package/lib/util/date-time.js +14 -13
- package/lib/util/date-time.js.map +1 -1
- package/lib/util/debug-app.d.ts +25 -0
- package/lib/util/debug-app.d.ts.map +1 -0
- package/lib/util/debug-app.js +100 -0
- package/lib/util/debug-app.js.map +1 -0
- package/lib/util/deep-partial.d.ts +2 -2
- package/lib/util/deep-partial.js +2 -2
- package/lib/util/deferred.d.ts +2 -2
- package/lib/util/deferred.js +13 -14
- package/lib/util/deferred.js.map +1 -1
- package/lib/util/disposable.d.ts +2 -2
- package/lib/util/disposable.d.ts.map +1 -1
- package/lib/util/disposable.js +28 -40
- package/lib/util/disposable.js.map +1 -1
- package/lib/util/event.d.ts +1 -1
- package/lib/util/event.d.ts.map +1 -1
- package/lib/util/event.js +64 -77
- package/lib/util/event.js.map +1 -1
- package/lib/util/garbage-collected-cache.d.ts +3 -2
- package/lib/util/garbage-collected-cache.d.ts.map +1 -1
- package/lib/util/garbage-collected-cache.js +35 -49
- package/lib/util/garbage-collected-cache.js.map +1 -1
- package/lib/util/generate-workspace-id.d.ts +9 -0
- package/lib/util/generate-workspace-id.d.ts.map +1 -0
- package/lib/util/generate-workspace-id.js +491 -0
- package/lib/util/generate-workspace-id.js.map +1 -0
- package/lib/util/generate-workspace-id.spec.d.ts +7 -0
- package/lib/util/generate-workspace-id.spec.d.ts.map +1 -0
- package/lib/util/generate-workspace-id.spec.js +98 -0
- package/lib/util/generate-workspace-id.spec.js.map +1 -0
- package/lib/util/gitpod-cookie.d.ts +20 -0
- package/lib/util/gitpod-cookie.d.ts.map +1 -0
- package/lib/util/gitpod-cookie.js +41 -0
- package/lib/util/gitpod-cookie.js.map +1 -0
- package/lib/util/gitpod-host-url.d.ts +20 -8
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +143 -85
- package/lib/util/gitpod-host-url.js.map +1 -1
- package/lib/util/gitpod-host-url.spec.d.ts +16 -0
- package/lib/util/gitpod-host-url.spec.d.ts.map +1 -0
- package/lib/util/gitpod-host-url.spec.js +134 -0
- package/lib/util/gitpod-host-url.spec.js.map +1 -0
- package/lib/util/grpc.d.ts +35 -0
- package/lib/util/grpc.d.ts.map +1 -0
- package/lib/util/grpc.js +90 -0
- package/lib/util/grpc.js.map +1 -0
- package/lib/util/jaeger-client-types.d.ts +68 -0
- package/lib/util/jaeger-client-types.d.ts.map +1 -0
- package/lib/util/jaeger-client-types.js +8 -0
- package/lib/util/jaeger-client-types.js.map +1 -0
- package/lib/util/logging.d.ts +58 -35
- package/lib/util/logging.d.ts.map +1 -1
- package/lib/util/logging.js +144 -129
- package/lib/util/logging.js.map +1 -1
- package/lib/util/logging.spec.d.ts +7 -0
- package/lib/util/logging.spec.d.ts.map +1 -0
- package/lib/util/logging.spec.js +52 -0
- package/lib/util/logging.spec.js.map +1 -0
- package/lib/util/make-link.d.ts +2 -2
- package/lib/util/make-link.js +8 -7
- package/lib/util/make-link.js.map +1 -1
- package/lib/util/nice-grpc.d.ts +9 -0
- package/lib/util/nice-grpc.d.ts.map +1 -0
- package/lib/util/nice-grpc.js +121 -0
- package/lib/util/nice-grpc.js.map +1 -0
- package/lib/util/parse-workspace-id.d.ts +15 -5
- package/lib/util/parse-workspace-id.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.js +39 -9
- package/lib/util/parse-workspace-id.js.map +1 -1
- package/lib/util/parse-workspace-id.spec.d.ts +10 -2
- package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.spec.js +130 -49
- package/lib/util/parse-workspace-id.spec.js.map +1 -1
- package/lib/util/queue.d.ts +2 -2
- package/lib/util/queue.js +19 -57
- package/lib/util/queue.js.map +1 -1
- package/lib/util/queue.spec.d.ts +2 -2
- package/lib/util/queue.spec.js +149 -288
- package/lib/util/queue.spec.js.map +1 -1
- package/lib/util/repeat.d.ts +15 -0
- package/lib/util/repeat.d.ts.map +1 -0
- package/lib/util/repeat.js +55 -0
- package/lib/util/repeat.js.map +1 -0
- package/lib/util/semaphore.d.ts +2 -2
- package/lib/util/semaphore.d.ts.map +1 -1
- package/lib/util/semaphore.js +18 -48
- package/lib/util/semaphore.js.map +1 -1
- package/lib/util/skip-if.d.ts +2 -2
- package/lib/util/skip-if.d.ts.map +1 -1
- package/lib/util/skip-if.js +9 -8
- package/lib/util/skip-if.js.map +1 -1
- package/lib/util/timeutil.d.ts +4 -2
- package/lib/util/timeutil.d.ts.map +1 -1
- package/lib/util/timeutil.js +43 -18
- package/lib/util/timeutil.js.map +1 -1
- package/lib/util/timeutil.spec.d.ts +4 -2
- package/lib/util/timeutil.spec.d.ts.map +1 -1
- package/lib/util/timeutil.spec.js +57 -25
- package/lib/util/timeutil.spec.js.map +1 -1
- package/lib/util/tracing.d.ts +55 -8
- package/lib/util/tracing.d.ts.map +1 -1
- package/lib/util/tracing.js +210 -66
- package/lib/util/tracing.js.map +1 -1
- package/lib/util/tracing.spec.d.ts +7 -0
- package/lib/util/tracing.spec.d.ts.map +1 -0
- package/lib/util/tracing.spec.js +121 -0
- package/lib/util/tracing.spec.js.map +1 -0
- package/lib/util/workspace-port-authentication.d.ts +9 -9
- package/lib/util/workspace-port-authentication.d.ts.map +1 -1
- package/lib/util/workspace-port-authentication.js +13 -14
- package/lib/util/workspace-port-authentication.js.map +1 -1
- package/lib/webhook-event.d.ts +44 -0
- package/lib/webhook-event.d.ts.map +1 -0
- package/lib/webhook-event.js +8 -0
- package/lib/webhook-event.js.map +1 -0
- package/lib/workspace-class.d.ts +14 -0
- package/lib/workspace-class.d.ts.map +1 -0
- package/lib/workspace-class.js +8 -0
- package/lib/workspace-class.js.map +1 -0
- package/lib/workspace-cluster.d.ts +80 -0
- package/lib/workspace-cluster.d.ts.map +1 -0
- package/lib/workspace-cluster.js +36 -0
- package/lib/workspace-cluster.js.map +1 -0
- package/lib/workspace-instance.d.ts +51 -8
- package/lib/workspace-instance.d.ts.map +1 -1
- package/lib/workspace-instance.js +2 -2
- package/lib/wsready.d.ts +8 -2
- package/lib/wsready.d.ts.map +1 -1
- package/lib/wsready.js +4 -3
- package/lib/wsready.js.map +1 -1
- package/package.json +42 -18
- package/pkg-yarn.lock +24 -10
- package/provenance-bundle.jsonl +2 -0
- package/src/accounting-protocol.ts +253 -0
- package/src/admin-protocol.ts +96 -21
- package/src/analytics.ts +52 -0
- package/src/attribution.ts +67 -0
- package/src/auth.ts +27 -0
- package/src/billing-mode.ts +84 -0
- package/src/blocked-repositories-protocol.ts +13 -0
- package/src/context-url.spec.ts +49 -0
- package/src/context-url.ts +107 -0
- package/src/encryption/container-module.ts +4 -5
- package/src/encryption/encryption-engine.spec.ts +11 -10
- package/src/encryption/encryption-engine.ts +22 -18
- package/src/encryption/encryption-service.ts +6 -7
- package/src/encryption/key-provider.ts +18 -21
- package/src/env.ts +3 -26
- package/src/experiments/always-default.ts +24 -0
- package/src/experiments/configcat-server.ts +42 -0
- package/src/experiments/configcat.ts +56 -0
- package/src/experiments/types.ts +34 -0
- package/src/frontend-dashboard-service.ts +148 -0
- package/src/gitpod-file-parser.spec.ts +57 -63
- package/src/gitpod-file-parser.ts +18 -19
- package/src/gitpod-service.ts +602 -99
- package/src/headless-workspace-log.ts +14 -16
- package/src/ide-frontend-service.ts +28 -0
- package/src/ide-protocol.ts +147 -0
- package/src/index.ts +18 -12
- package/src/installation-admin-protocol.ts +45 -0
- package/src/license-protocol.ts +14 -8
- package/src/messaging/browser/connection.ts +202 -26
- package/src/messaging/browser/window-connection.ts +45 -29
- package/src/messaging/client-call-metrics.ts +94 -0
- package/src/messaging/error.ts +51 -10
- package/src/messaging/handler.ts +13 -1
- package/src/messaging/node/connection.ts +23 -70
- package/src/messaging/proxy-factory.ts +35 -34
- package/src/oss-allowlist.ts +15 -0
- package/src/payment-protocol.ts +20 -0
- package/src/permission.ts +53 -40
- package/src/plans.ts +699 -0
- package/src/protocol.spec.ts +97 -0
- package/src/protocol.ts +790 -302
- package/src/snapshot-url.spec.ts +27 -0
- package/src/snapshot-url.ts +27 -0
- package/src/team-subscription-protocol.ts +153 -0
- package/src/teams-projects-protocol.ts +180 -0
- package/src/typings/globals.ts +13 -5
- package/src/usage.ts +85 -0
- package/src/util/analytics.ts +109 -0
- package/src/util/async-iterator.ts +6 -7
- package/src/util/cancelable.ts +5 -5
- package/src/util/date-time.ts +10 -10
- package/src/util/debug-app.ts +81 -0
- package/src/util/deep-partial.ts +2 -2
- package/src/util/deferred.ts +8 -8
- package/src/util/disposable.ts +3 -6
- package/src/util/event.ts +9 -11
- package/src/util/garbage-collected-cache.ts +18 -10
- package/src/util/generate-workspace-id.spec.ts +58 -0
- package/src/util/generate-workspace-id.ts +481 -0
- package/src/util/gitpod-cookie.ts +38 -0
- package/src/util/gitpod-host-url.spec.ts +76 -0
- package/src/util/gitpod-host-url.ts +119 -40
- package/src/util/grpc.ts +107 -0
- package/src/util/jaeger-client-types.ts +102 -0
- package/src/util/logging.spec.ts +23 -0
- package/src/util/logging.ts +163 -73
- package/src/util/make-link.ts +8 -9
- package/src/util/nice-grpc.ts +96 -0
- package/src/util/parse-workspace-id.spec.ts +62 -12
- package/src/util/parse-workspace-id.ts +40 -10
- package/src/util/queue.spec.ts +30 -28
- package/src/util/queue.ts +2 -2
- package/src/util/repeat.ts +45 -0
- package/src/util/semaphore.ts +8 -10
- package/src/util/skip-if.ts +12 -9
- package/src/util/timeutil.spec.ts +42 -16
- package/src/util/timeutil.ts +33 -17
- package/src/util/tracing.spec.ts +88 -0
- package/src/util/tracing.ts +211 -33
- package/src/util/workspace-port-authentication.ts +12 -15
- package/src/webhook-event.ts +55 -0
- package/src/workspace-class.ts +14 -0
- package/src/workspace-cluster.ts +121 -0
- package/src/workspace-instance.ts +120 -36
- package/src/wsready.ts +11 -4
- package/data/builtin-theia-plugins.json +0 -362
- package/lib/email-protocol.d.ts +0 -49
- package/lib/email-protocol.d.ts.map +0 -1
- package/lib/email-protocol.js +0 -27
- package/lib/email-protocol.js.map +0 -1
- package/lib/messaging/connection-error-handler.d.ts +0 -27
- package/lib/messaging/connection-error-handler.d.ts.map +0 -1
- package/lib/messaging/connection-error-handler.js +0 -45
- package/lib/messaging/connection-error-handler.js.map +0 -1
- package/lib/theia-plugins.d.ts +0 -11
- package/lib/theia-plugins.d.ts.map +0 -1
- package/lib/theia-plugins.js +0 -8
- package/lib/theia-plugins.js.map +0 -1
- package/lib/util/repeater.d.ts +0 -22
- package/lib/util/repeater.d.ts.map +0 -1
- package/lib/util/repeater.js +0 -117
- package/lib/util/repeater.js.map +0 -1
- package/lib/util/safe-promise.d.ts +0 -11
- package/lib/util/safe-promise.d.ts.map +0 -1
- package/lib/util/safe-promise.js +0 -33
- package/lib/util/safe-promise.js.map +0 -1
- package/lib/util/without.d.ts +0 -7
- package/lib/util/without.d.ts.map +0 -1
- package/lib/util/without.js +0 -8
- package/lib/util/without.js.map +0 -1
- package/src/email-protocol.ts +0 -67
- package/src/messaging/connection-error-handler.ts +0 -62
- package/src/theia-plugins.ts +0 -11
- package/src/util/jaeger-client.d.ts +0 -105
- package/src/util/repeater.ts +0 -49
- package/src/util/safe-promise.ts +0 -26
- package/src/util/without.ts +0 -8
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2022 Gitpod GmbH. All rights reserved.
|
|
4
|
+
* Licensed under the GNU Affero General Public License (AGPL).
|
|
5
|
+
* See License.AGPL.txt in the project root for license information.
|
|
6
|
+
*/
|
|
7
|
+
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
8
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
9
|
+
var m = o[Symbol.asyncIterator], i;
|
|
10
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
11
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
12
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
13
|
+
};
|
|
14
|
+
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
|
15
|
+
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
|
16
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
17
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
18
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
19
|
+
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
20
|
+
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
21
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
22
|
+
function fulfill(value) { resume("next", value); }
|
|
23
|
+
function reject(value) { resume("throw", value); }
|
|
24
|
+
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
25
|
+
};
|
|
26
|
+
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
|
27
|
+
var i, p;
|
|
28
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
29
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
30
|
+
};
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.prometheusClientMiddleware = void 0;
|
|
33
|
+
const abort_controller_x_1 = require("abort-controller-x");
|
|
34
|
+
const nice_grpc_common_1 = require("nice-grpc-common");
|
|
35
|
+
function getLabels(method) {
|
|
36
|
+
const callType = method.requestStream
|
|
37
|
+
? method.responseStream
|
|
38
|
+
? "bidi_stream"
|
|
39
|
+
: "client_stream"
|
|
40
|
+
: method.responseStream
|
|
41
|
+
? "server_stream"
|
|
42
|
+
: "unary";
|
|
43
|
+
const { path } = method;
|
|
44
|
+
const [serviceName, methodName] = path.split("/").slice(1);
|
|
45
|
+
return {
|
|
46
|
+
type: callType,
|
|
47
|
+
service: serviceName,
|
|
48
|
+
method: methodName,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function incrementStreamMessagesCounter(iterable, callback) {
|
|
52
|
+
return __asyncGenerator(this, arguments, function* incrementStreamMessagesCounter_1() {
|
|
53
|
+
var e_1, _a;
|
|
54
|
+
try {
|
|
55
|
+
for (var iterable_1 = __asyncValues(iterable), iterable_1_1; iterable_1_1 = yield __await(iterable_1.next()), !iterable_1_1.done;) {
|
|
56
|
+
const item = iterable_1_1.value;
|
|
57
|
+
callback();
|
|
58
|
+
yield yield __await(item);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
62
|
+
finally {
|
|
63
|
+
try {
|
|
64
|
+
if (iterable_1_1 && !iterable_1_1.done && (_a = iterable_1.return)) yield __await(_a.call(iterable_1));
|
|
65
|
+
}
|
|
66
|
+
finally { if (e_1) throw e_1.error; }
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function prometheusClientMiddleware(metrics) {
|
|
71
|
+
return function prometheusClientMiddlewareGenerator(call, options) {
|
|
72
|
+
return __asyncGenerator(this, arguments, function* prometheusClientMiddlewareGenerator_1() {
|
|
73
|
+
const labels = getLabels(call.method);
|
|
74
|
+
metrics.started(labels);
|
|
75
|
+
const stopTimer = metrics.startHandleTimer(labels);
|
|
76
|
+
let settled = false;
|
|
77
|
+
let status = nice_grpc_common_1.Status.OK;
|
|
78
|
+
try {
|
|
79
|
+
let request;
|
|
80
|
+
if (!call.requestStream) {
|
|
81
|
+
request = call.request;
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
request = incrementStreamMessagesCounter(call.request, metrics.sent.bind(metrics, labels));
|
|
85
|
+
}
|
|
86
|
+
if (!call.responseStream) {
|
|
87
|
+
const response = yield __await(yield* __asyncDelegator(__asyncValues(call.next(request, options))));
|
|
88
|
+
settled = true;
|
|
89
|
+
return yield __await(response);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
yield __await(yield* __asyncDelegator(__asyncValues(incrementStreamMessagesCounter(call.next(request, options), metrics.received.bind(metrics, labels)))));
|
|
93
|
+
settled = true;
|
|
94
|
+
return yield __await(void 0);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
catch (err) {
|
|
98
|
+
settled = true;
|
|
99
|
+
if (err instanceof nice_grpc_common_1.ClientError) {
|
|
100
|
+
status = err.code;
|
|
101
|
+
}
|
|
102
|
+
else if ((0, abort_controller_x_1.isAbortError)(err)) {
|
|
103
|
+
status = nice_grpc_common_1.Status.CANCELLED;
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
status = nice_grpc_common_1.Status.UNKNOWN;
|
|
107
|
+
}
|
|
108
|
+
throw err;
|
|
109
|
+
}
|
|
110
|
+
finally {
|
|
111
|
+
if (!settled) {
|
|
112
|
+
status = nice_grpc_common_1.Status.CANCELLED;
|
|
113
|
+
}
|
|
114
|
+
stopTimer({ grpc_code: nice_grpc_common_1.Status[status] });
|
|
115
|
+
metrics.handled(Object.assign(Object.assign({}, labels), { code: nice_grpc_common_1.Status[status] }));
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
exports.prometheusClientMiddleware = prometheusClientMiddleware;
|
|
121
|
+
//# sourceMappingURL=nice-grpc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nice-grpc.js","sourceRoot":"","sources":["../../src/util/nice-grpc.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,2DAAkD;AAClD,uDAO0B;AAG1B,SAAS,SAAS,CAAC,MAAwB;IACvC,MAAM,QAAQ,GAAG,MAAM,CAAC,aAAa;QACjC,CAAC,CAAC,MAAM,CAAC,cAAc;YACnB,CAAC,CAAC,aAAa;YACf,CAAC,CAAC,eAAe;QACrB,CAAC,CAAC,MAAM,CAAC,cAAc;YACvB,CAAC,CAAC,eAAe;YACjB,CAAC,CAAC,OAAO,CAAC;IACd,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,WAAW,EAAE,UAAU,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAE3D,OAAO;QACH,IAAI,EAAE,QAA0B;QAChC,OAAO,EAAE,WAAW;QACpB,MAAM,EAAE,UAAU;KACrB,CAAC;AACN,CAAC;AAED,SAAgB,8BAA8B,CAAI,QAA0B,EAAE,QAAoB;;;;YAC9F,KAAyB,IAAA,aAAA,cAAA,QAAQ,CAAA,cAAA;gBAAtB,MAAM,IAAI,qBAAA,CAAA;gBACjB,QAAQ,EAAE,CAAC;gBACX,oBAAM,IAAI,CAAA,CAAC;aACd;;;;;;;;;IACL,CAAC;CAAA;AAED,SAAgB,0BAA0B,CAAC,OAA2B;IAClE,OAAO,SAAgB,mCAAmC,CACtD,IAA6C,EAC7C,OAAoB;;YAEpB,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAEtC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YAExB,MAAM,SAAS,GAAG,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;YAEnD,IAAI,OAAO,GAAG,KAAK,CAAC;YACpB,IAAI,MAAM,GAAW,yBAAM,CAAC,EAAE,CAAC;YAE/B,IAAI;gBACA,IAAI,OAAO,CAAC;gBAEZ,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;oBACrB,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;iBAC1B;qBAAM;oBACH,OAAO,GAAG,8BAA8B,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;iBAC9F;gBAED,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE;oBACtB,MAAM,QAAQ,GAAG,cAAA,KAAK,CAAC,CAAC,iBAAA,cAAA,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA,CAAA,CAAA,CAAC;oBACpD,OAAO,GAAG,IAAI,CAAC;oBACf,qBAAO,QAAQ,EAAC;iBACnB;qBAAM;oBACH,cAAA,KAAK,CAAC,CAAC,iBAAA,cAAA,8BAA8B,CACjC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,EAC3B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CACzC,CAAA,CAAA,CAAA,CAAC;oBACF,OAAO,GAAG,IAAI,CAAC;oBACf,6BAAO;iBACV;aACJ;YAAC,OAAO,GAAG,EAAE;gBACV,OAAO,GAAG,IAAI,CAAC;gBACf,IAAI,GAAG,YAAY,8BAAW,EAAE;oBAC5B,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC;iBACrB;qBAAM,IAAI,IAAA,iCAAY,EAAC,GAAG,CAAC,EAAE;oBAC1B,MAAM,GAAG,yBAAM,CAAC,SAAS,CAAC;iBAC7B;qBAAM;oBACH,MAAM,GAAG,yBAAM,CAAC,OAAO,CAAC;iBAC3B;gBACD,MAAM,GAAG,CAAC;aACb;oBAAS;gBACN,IAAI,CAAC,OAAO,EAAE;oBACV,MAAM,GAAG,yBAAM,CAAC,SAAS,CAAC;iBAC7B;gBACD,SAAS,CAAC,EAAE,SAAS,EAAE,yBAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;gBACzC,OAAO,CAAC,OAAO,iCAAM,MAAM,KAAE,IAAI,EAAE,yBAAM,CAAC,MAAM,CAAC,IAAG,CAAC;aACxD;QACL,CAAC;KAAA,CAAC;AACN,CAAC;AArDD,gEAqDC"}
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2020
|
|
2
|
+
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
7
|
* Hostname may be of the form:
|
|
8
|
-
* -
|
|
9
|
-
* - 1234-
|
|
10
|
-
* - webview-1234-
|
|
8
|
+
* - moccasin-ferret-155799b3.ws-eu01.gitpod.io
|
|
9
|
+
* - 1234-moccasin-ferret-155799b3.ws-eu01.gitpod.io
|
|
10
|
+
* - webview-1234-moccasin-ferret-155799b3.ws-eu01.gitpod.io (or any other string replacing webview)
|
|
11
11
|
* @param hostname The hostname the request is headed to
|
|
12
12
|
*/
|
|
13
13
|
export declare const parseWorkspaceIdFromHostname: (hostname: string) => string | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* @param maybeId
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
export declare const matchesInstanceIdOrLegacyWorkspaceIdExactly: (maybeId: string) => boolean;
|
|
19
|
+
/**
|
|
20
|
+
* @param maybeWorkspaceId
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
export declare const matchesNewWorkspaceIdExactly: (maybeWorkspaceId: string) => boolean;
|
|
14
24
|
//# sourceMappingURL=parse-workspace-id.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-workspace-id.d.ts","sourceRoot":"","sources":["../../src/util/parse-workspace-id.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"parse-workspace-id.d.ts","sourceRoot":"","sources":["../../src/util/parse-workspace-id.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,aAAuB,MAAM,uBAWrE,CAAC;AAMF;;;GAGG;AACH,eAAO,MAAM,2CAA2C,YAAsB,MAAM,KAAG,OAEtF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,qBAA+B,MAAM,KAAG,OAEhF,CAAC"}
|
|
@@ -1,26 +1,56 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Copyright (c) 2020
|
|
3
|
+
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
4
4
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
5
|
-
* See License
|
|
5
|
+
* See License.AGPL.txt in the project root for license information.
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.matchesNewWorkspaceIdExactly = exports.matchesInstanceIdOrLegacyWorkspaceIdExactly = exports.parseWorkspaceIdFromHostname = void 0;
|
|
9
|
+
const REGEX_WORKSPACE_ID = /[0-9a-z]{2,16}-[0-9a-z]{2,16}-[0-9a-z]{8,11}/;
|
|
10
|
+
const REGEX_WORKSPACE_ID_EXACT = new RegExp(`^${REGEX_WORKSPACE_ID.source}$`);
|
|
11
|
+
// We need to parse the workspace id precisely here to get the case '<some-str>-<port>-<wsid>.ws.' right
|
|
12
|
+
const REGEX_WORKSPACE_ID_FROM_HOSTNAME = new RegExp(`(${REGEX_WORKSPACE_ID.source})\.ws`);
|
|
13
|
+
const REGEX_WORKSPACE_ID_LEGACY = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/;
|
|
14
|
+
const REGEX_WORKSPACE_ID_LEGACY_EXACT = new RegExp(`^${REGEX_WORKSPACE_ID_LEGACY.source}$`);
|
|
15
|
+
const REGEX_WORKSPACE_ID_LEGACY_FROM_HOSTNAME = new RegExp(`(${REGEX_WORKSPACE_ID_LEGACY.source})\.ws`);
|
|
8
16
|
/**
|
|
9
17
|
* Hostname may be of the form:
|
|
10
|
-
* -
|
|
11
|
-
* - 1234-
|
|
12
|
-
* - webview-1234-
|
|
18
|
+
* - moccasin-ferret-155799b3.ws-eu01.gitpod.io
|
|
19
|
+
* - 1234-moccasin-ferret-155799b3.ws-eu01.gitpod.io
|
|
20
|
+
* - webview-1234-moccasin-ferret-155799b3.ws-eu01.gitpod.io (or any other string replacing webview)
|
|
13
21
|
* @param hostname The hostname the request is headed to
|
|
14
22
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var wsIdExpression = /([a-z][0-9a-z]+\-([0-9a-z]+\-){3}[0-9a-z]+)\.ws/g;
|
|
18
|
-
var match = wsIdExpression.exec(hostname);
|
|
23
|
+
const parseWorkspaceIdFromHostname = function (hostname) {
|
|
24
|
+
const match = REGEX_WORKSPACE_ID_FROM_HOSTNAME.exec(hostname);
|
|
19
25
|
if (match && match.length >= 2) {
|
|
20
26
|
return match[1];
|
|
21
27
|
}
|
|
22
28
|
else {
|
|
29
|
+
const legacyMatch = REGEX_WORKSPACE_ID_LEGACY_FROM_HOSTNAME.exec(hostname);
|
|
30
|
+
if (legacyMatch && legacyMatch.length >= 2) {
|
|
31
|
+
return legacyMatch[1];
|
|
32
|
+
}
|
|
23
33
|
return undefined;
|
|
24
34
|
}
|
|
25
35
|
};
|
|
36
|
+
exports.parseWorkspaceIdFromHostname = parseWorkspaceIdFromHostname;
|
|
37
|
+
/** Equalls UUIDv4 (and REGEX_WORKSPACE_ID_LEGACY!) */
|
|
38
|
+
const REGEX_INSTANCE_ID = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/;
|
|
39
|
+
const REGEX_INSTANCE_ID_EXACT = new RegExp(`^${REGEX_INSTANCE_ID.source}$`);
|
|
40
|
+
/**
|
|
41
|
+
* @param maybeId
|
|
42
|
+
* @returns
|
|
43
|
+
*/
|
|
44
|
+
const matchesInstanceIdOrLegacyWorkspaceIdExactly = function (maybeId) {
|
|
45
|
+
return REGEX_INSTANCE_ID_EXACT.test(maybeId) || REGEX_WORKSPACE_ID_LEGACY_EXACT.test(maybeId);
|
|
46
|
+
};
|
|
47
|
+
exports.matchesInstanceIdOrLegacyWorkspaceIdExactly = matchesInstanceIdOrLegacyWorkspaceIdExactly;
|
|
48
|
+
/**
|
|
49
|
+
* @param maybeWorkspaceId
|
|
50
|
+
* @returns
|
|
51
|
+
*/
|
|
52
|
+
const matchesNewWorkspaceIdExactly = function (maybeWorkspaceId) {
|
|
53
|
+
return REGEX_WORKSPACE_ID_EXACT.test(maybeWorkspaceId);
|
|
54
|
+
};
|
|
55
|
+
exports.matchesNewWorkspaceIdExactly = matchesNewWorkspaceIdExactly;
|
|
26
56
|
//# sourceMappingURL=parse-workspace-id.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-workspace-id.js","sourceRoot":"","sources":["../../src/util/parse-workspace-id.ts"],"names":[],"mappings":";AAAA;;;;GAIG
|
|
1
|
+
{"version":3,"file":"parse-workspace-id.js","sourceRoot":"","sources":["../../src/util/parse-workspace-id.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,MAAM,kBAAkB,GAAG,8CAA8C,CAAC;AAC1E,MAAM,wBAAwB,GAAG,IAAI,MAAM,CAAC,IAAI,kBAAkB,CAAC,MAAM,GAAG,CAAC,CAAC;AAC9E,wGAAwG;AACxG,MAAM,gCAAgC,GAAG,IAAI,MAAM,CAAC,IAAI,kBAAkB,CAAC,MAAM,OAAO,CAAC,CAAC;AAE1F,MAAM,yBAAyB,GAAG,8DAA8D,CAAC;AACjG,MAAM,+BAA+B,GAAG,IAAI,MAAM,CAAC,IAAI,yBAAyB,CAAC,MAAM,GAAG,CAAC,CAAC;AAC5F,MAAM,uCAAuC,GAAG,IAAI,MAAM,CAAC,IAAI,yBAAyB,CAAC,MAAM,OAAO,CAAC,CAAC;AAExG;;;;;;GAMG;AACI,MAAM,4BAA4B,GAAG,UAAU,QAAgB;IAClE,MAAM,KAAK,GAAG,gCAAgC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC9D,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,EAAE;QAC5B,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;KACnB;SAAM;QACH,MAAM,WAAW,GAAG,uCAAuC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC3E,IAAI,WAAW,IAAI,WAAW,CAAC,MAAM,IAAI,CAAC,EAAE;YACxC,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC;SACzB;QACD,OAAO,SAAS,CAAC;KACpB;AACL,CAAC,CAAC;AAXW,QAAA,4BAA4B,gCAWvC;AAEF,sDAAsD;AACtD,MAAM,iBAAiB,GAAG,8DAA8D,CAAC;AACzF,MAAM,uBAAuB,GAAG,IAAI,MAAM,CAAC,IAAI,iBAAiB,CAAC,MAAM,GAAG,CAAC,CAAC;AAE5E;;;GAGG;AACI,MAAM,2CAA2C,GAAG,UAAU,OAAe;IAChF,OAAO,uBAAuB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,+BAA+B,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAClG,CAAC,CAAC;AAFW,QAAA,2CAA2C,+CAEtD;AAEF;;;GAGG;AACI,MAAM,4BAA4B,GAAG,UAAU,gBAAwB;IAC1E,OAAO,wBAAwB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;AAC3D,CAAC,CAAC;AAFW,QAAA,4BAA4B,gCAEvC"}
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2020
|
|
2
|
+
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
export declare class ParseWorkspaceIdTest {
|
|
7
7
|
parseWorkspaceIdFromHostname_fromWorkspaceLocation(): void;
|
|
8
8
|
parseWorkspaceIdFromHostname_fromWorkspacePortLocation(): void;
|
|
9
9
|
parseWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefix(): void;
|
|
10
10
|
parseWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefixCustomHost(): void;
|
|
11
|
+
parseLegacyWorkspaceIdFromHostname_fromWorkspaceLocation(): void;
|
|
12
|
+
parseLegacyWorkspaceIdFromHostname_fromWorkspacePortLocation(): void;
|
|
13
|
+
parseLegacyWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefix(): void;
|
|
14
|
+
parseLegacyWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefixCustomHost(): void;
|
|
15
|
+
matchesInstanceIdOrLegacyWorkspaceIdExactly_positive(): void;
|
|
16
|
+
matchesInstanceIdOrLegacyWorkspaceIdExactly_negative(): void;
|
|
17
|
+
matchesWorkspaceIdExactly_new_positive(): void;
|
|
18
|
+
matchesWorkspaceIdExactly_new_negative(): void;
|
|
11
19
|
}
|
|
12
20
|
//# sourceMappingURL=parse-workspace-id.spec.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-workspace-id.spec.d.ts","sourceRoot":"","sources":["../../src/util/parse-workspace-id.spec.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"parse-workspace-id.spec.d.ts","sourceRoot":"","sources":["../../src/util/parse-workspace-id.spec.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,qBACa,oBAAoB;IAChB,kDAAkD;IAKlD,sDAAsD;IAKtD,uEAAuE;IAKvE,iFAAiF;IAQjF,wDAAwD;IAKxD,4DAA4D;IAK5D,6EAA6E;IAO7E,uFAAuF;IAQvF,oDAAoD;IAIpD,oDAAoD;IAMpD,sCAAsC;IAItC,sCAAsC;CAItD"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Copyright (c) 2020
|
|
3
|
+
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
4
4
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
5
|
-
* See License
|
|
5
|
+
* See License.AGPL.txt in the project root for license information.
|
|
6
6
|
*/
|
|
7
7
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
8
8
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -14,58 +14,139 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
14
14
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
exports.ParseWorkspaceIdTest = void 0;
|
|
18
|
+
const chai = require("chai");
|
|
19
|
+
const mocha_typescript_1 = require("mocha-typescript");
|
|
20
|
+
const parse_workspace_id_1 = require("./parse-workspace-id");
|
|
21
|
+
const expect = chai.expect;
|
|
22
|
+
let ParseWorkspaceIdTest = class ParseWorkspaceIdTest {
|
|
23
|
+
parseWorkspaceIdFromHostname_fromWorkspaceLocation() {
|
|
24
|
+
const actual = (0, parse_workspace_id_1.parseWorkspaceIdFromHostname)("moccasin-ferret-155799b3.ws-eu01.gitpod.io");
|
|
25
|
+
expect(actual).to.equal("moccasin-ferret-155799b3");
|
|
23
26
|
}
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
parseWorkspaceIdFromHostname_fromWorkspacePortLocation() {
|
|
28
|
+
const actual = (0, parse_workspace_id_1.parseWorkspaceIdFromHostname)("3000-moccasin-ferret-155799b3.ws-eu01.gitpod.io");
|
|
29
|
+
expect(actual).to.equal("moccasin-ferret-155799b3");
|
|
30
|
+
}
|
|
31
|
+
parseWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefix() {
|
|
32
|
+
const actual = (0, parse_workspace_id_1.parseWorkspaceIdFromHostname)("webview-3000-moccasin-ferret-155799b3.ws-eu01.gitpod.io");
|
|
33
|
+
expect(actual).to.equal("moccasin-ferret-155799b3");
|
|
34
|
+
}
|
|
35
|
+
parseWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefixCustomHost() {
|
|
36
|
+
const actual = (0, parse_workspace_id_1.parseWorkspaceIdFromHostname)("webview-3000-moccasin-ferret-155799b3.ws-eu01.some.subdomain.somehost.com");
|
|
37
|
+
expect(actual).to.equal("moccasin-ferret-155799b3");
|
|
38
|
+
}
|
|
39
|
+
// legacy mode
|
|
40
|
+
parseLegacyWorkspaceIdFromHostname_fromWorkspaceLocation() {
|
|
41
|
+
const actual = (0, parse_workspace_id_1.parseWorkspaceIdFromHostname)("b7e0eaf8-ec73-44ec-81ea-04859263b656.ws-eu01.gitpod.io");
|
|
26
42
|
expect(actual).to.equal("b7e0eaf8-ec73-44ec-81ea-04859263b656");
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
43
|
+
}
|
|
44
|
+
parseLegacyWorkspaceIdFromHostname_fromWorkspacePortLocation() {
|
|
45
|
+
const actual = (0, parse_workspace_id_1.parseWorkspaceIdFromHostname)("3000-b7e0eaf8-ec73-44ec-81ea-04859263b656.ws-eu01.gitpod.io");
|
|
30
46
|
expect(actual).to.equal("b7e0eaf8-ec73-44ec-81ea-04859263b656");
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
47
|
+
}
|
|
48
|
+
parseLegacyWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefix() {
|
|
49
|
+
const actual = (0, parse_workspace_id_1.parseWorkspaceIdFromHostname)("webview-3000-b7e0eaf8-ec73-44ec-81ea-04859263b656.ws-eu01.gitpod.io");
|
|
34
50
|
expect(actual).to.equal("b7e0eaf8-ec73-44ec-81ea-04859263b656");
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
51
|
+
}
|
|
52
|
+
parseLegacyWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefixCustomHost() {
|
|
53
|
+
const actual = (0, parse_workspace_id_1.parseWorkspaceIdFromHostname)("webview-3000-ca81a50f-09d7-465c-acd9-264a747d5351.ws-eu01.some.subdomain.somehost.com");
|
|
38
54
|
expect(actual).to.equal("ca81a50f-09d7-465c-acd9-264a747d5351");
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
55
|
+
}
|
|
56
|
+
// match - instance ID
|
|
57
|
+
matchesInstanceIdOrLegacyWorkspaceIdExactly_positive() {
|
|
58
|
+
const actual = (0, parse_workspace_id_1.matchesInstanceIdOrLegacyWorkspaceIdExactly)("b7e0eaf8-ec73-44ec-81ea-04859263b656");
|
|
59
|
+
expect(actual).to.be.true;
|
|
60
|
+
}
|
|
61
|
+
matchesInstanceIdOrLegacyWorkspaceIdExactly_negative() {
|
|
62
|
+
const actual = (0, parse_workspace_id_1.matchesInstanceIdOrLegacyWorkspaceIdExactly)("b7e0eaf8-ec73-44ec-81a-04859263b656");
|
|
63
|
+
expect(actual).to.be.false;
|
|
64
|
+
}
|
|
65
|
+
// match - new workspace ID
|
|
66
|
+
matchesWorkspaceIdExactly_new_positive() {
|
|
67
|
+
const actual = (0, parse_workspace_id_1.matchesNewWorkspaceIdExactly)("moccasin-ferret-155799b3");
|
|
68
|
+
expect(actual).to.be.true;
|
|
69
|
+
}
|
|
70
|
+
matchesWorkspaceIdExactly_new_negative() {
|
|
71
|
+
const actual = (0, parse_workspace_id_1.matchesNewWorkspaceIdExactly)("moccasin-ferret-15599b3");
|
|
72
|
+
expect(actual).to.be.false;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
__decorate([
|
|
76
|
+
mocha_typescript_1.test,
|
|
77
|
+
__metadata("design:type", Function),
|
|
78
|
+
__metadata("design:paramtypes", []),
|
|
79
|
+
__metadata("design:returntype", void 0)
|
|
80
|
+
], ParseWorkspaceIdTest.prototype, "parseWorkspaceIdFromHostname_fromWorkspaceLocation", null);
|
|
81
|
+
__decorate([
|
|
82
|
+
mocha_typescript_1.test,
|
|
83
|
+
__metadata("design:type", Function),
|
|
84
|
+
__metadata("design:paramtypes", []),
|
|
85
|
+
__metadata("design:returntype", void 0)
|
|
86
|
+
], ParseWorkspaceIdTest.prototype, "parseWorkspaceIdFromHostname_fromWorkspacePortLocation", null);
|
|
87
|
+
__decorate([
|
|
88
|
+
mocha_typescript_1.test,
|
|
89
|
+
__metadata("design:type", Function),
|
|
90
|
+
__metadata("design:paramtypes", []),
|
|
91
|
+
__metadata("design:returntype", void 0)
|
|
92
|
+
], ParseWorkspaceIdTest.prototype, "parseWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefix", null);
|
|
93
|
+
__decorate([
|
|
94
|
+
mocha_typescript_1.test,
|
|
95
|
+
__metadata("design:type", Function),
|
|
96
|
+
__metadata("design:paramtypes", []),
|
|
97
|
+
__metadata("design:returntype", void 0)
|
|
98
|
+
], ParseWorkspaceIdTest.prototype, "parseWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefixCustomHost", null);
|
|
99
|
+
__decorate([
|
|
100
|
+
mocha_typescript_1.test,
|
|
101
|
+
__metadata("design:type", Function),
|
|
102
|
+
__metadata("design:paramtypes", []),
|
|
103
|
+
__metadata("design:returntype", void 0)
|
|
104
|
+
], ParseWorkspaceIdTest.prototype, "parseLegacyWorkspaceIdFromHostname_fromWorkspaceLocation", null);
|
|
105
|
+
__decorate([
|
|
106
|
+
mocha_typescript_1.test,
|
|
107
|
+
__metadata("design:type", Function),
|
|
108
|
+
__metadata("design:paramtypes", []),
|
|
109
|
+
__metadata("design:returntype", void 0)
|
|
110
|
+
], ParseWorkspaceIdTest.prototype, "parseLegacyWorkspaceIdFromHostname_fromWorkspacePortLocation", null);
|
|
111
|
+
__decorate([
|
|
112
|
+
mocha_typescript_1.test,
|
|
113
|
+
__metadata("design:type", Function),
|
|
114
|
+
__metadata("design:paramtypes", []),
|
|
115
|
+
__metadata("design:returntype", void 0)
|
|
116
|
+
], ParseWorkspaceIdTest.prototype, "parseLegacyWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefix", null);
|
|
117
|
+
__decorate([
|
|
118
|
+
mocha_typescript_1.test,
|
|
119
|
+
__metadata("design:type", Function),
|
|
120
|
+
__metadata("design:paramtypes", []),
|
|
121
|
+
__metadata("design:returntype", void 0)
|
|
122
|
+
], ParseWorkspaceIdTest.prototype, "parseLegacyWorkspaceIdFromHostname_fromWorkspacePortLocationWithWebviewPrefixCustomHost", null);
|
|
123
|
+
__decorate([
|
|
124
|
+
mocha_typescript_1.test,
|
|
125
|
+
__metadata("design:type", Function),
|
|
126
|
+
__metadata("design:paramtypes", []),
|
|
127
|
+
__metadata("design:returntype", void 0)
|
|
128
|
+
], ParseWorkspaceIdTest.prototype, "matchesInstanceIdOrLegacyWorkspaceIdExactly_positive", null);
|
|
129
|
+
__decorate([
|
|
130
|
+
mocha_typescript_1.test,
|
|
131
|
+
__metadata("design:type", Function),
|
|
132
|
+
__metadata("design:paramtypes", []),
|
|
133
|
+
__metadata("design:returntype", void 0)
|
|
134
|
+
], ParseWorkspaceIdTest.prototype, "matchesInstanceIdOrLegacyWorkspaceIdExactly_negative", null);
|
|
135
|
+
__decorate([
|
|
136
|
+
mocha_typescript_1.test,
|
|
137
|
+
__metadata("design:type", Function),
|
|
138
|
+
__metadata("design:paramtypes", []),
|
|
139
|
+
__metadata("design:returntype", void 0)
|
|
140
|
+
], ParseWorkspaceIdTest.prototype, "matchesWorkspaceIdExactly_new_positive", null);
|
|
141
|
+
__decorate([
|
|
142
|
+
mocha_typescript_1.test,
|
|
143
|
+
__metadata("design:type", Function),
|
|
144
|
+
__metadata("design:paramtypes", []),
|
|
145
|
+
__metadata("design:returntype", void 0)
|
|
146
|
+
], ParseWorkspaceIdTest.prototype, "matchesWorkspaceIdExactly_new_negative", null);
|
|
147
|
+
ParseWorkspaceIdTest = __decorate([
|
|
148
|
+
mocha_typescript_1.suite
|
|
149
|
+
], ParseWorkspaceIdTest);
|
|
69
150
|
exports.ParseWorkspaceIdTest = ParseWorkspaceIdTest;
|
|
70
151
|
module.exports = new ParseWorkspaceIdTest();
|
|
71
152
|
//# sourceMappingURL=parse-workspace-id.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-workspace-id.spec.js","sourceRoot":"","sources":["../../src/util/parse-workspace-id.spec.ts"],"names":[],"mappings":";AAAA;;;;GAIG
|
|
1
|
+
{"version":3,"file":"parse-workspace-id.spec.js","sourceRoot":"","sources":["../../src/util/parse-workspace-id.spec.ts"],"names":[],"mappings":"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"}
|
package/lib/util/queue.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2020
|
|
2
|
+
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
7
|
* Queues asynchronous operations in a synchronous context
|
package/lib/util/queue.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Copyright (c) 2020
|
|
3
|
+
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
4
4
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
5
|
-
* See License
|
|
5
|
+
* See License.AGPL.txt in the project root for license information.
|
|
6
6
|
*/
|
|
7
7
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8
8
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -13,67 +13,29 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
13
13
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
17
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
18
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
19
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
20
|
-
function step(op) {
|
|
21
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
22
|
-
while (_) try {
|
|
23
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
24
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
25
|
-
switch (op[0]) {
|
|
26
|
-
case 0: case 1: t = op; break;
|
|
27
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
28
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
29
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
30
|
-
default:
|
|
31
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
32
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
33
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
34
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
35
|
-
if (t[2]) _.ops.pop();
|
|
36
|
-
_.trys.pop(); continue;
|
|
37
|
-
}
|
|
38
|
-
op = body.call(thisArg, _);
|
|
39
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
40
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
-
|
|
17
|
+
exports.Queue = void 0;
|
|
18
|
+
const deferred_1 = require("./deferred");
|
|
45
19
|
/**
|
|
46
20
|
* Queues asynchronous operations in a synchronous context
|
|
47
21
|
*/
|
|
48
|
-
|
|
49
|
-
|
|
22
|
+
class Queue {
|
|
23
|
+
constructor() {
|
|
50
24
|
this.queue = Promise.resolve();
|
|
51
25
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
result = _a.sent();
|
|
64
|
-
enqueue.resolve(result);
|
|
65
|
-
return [3 /*break*/, 3];
|
|
66
|
-
case 2:
|
|
67
|
-
err_1 = _a.sent();
|
|
68
|
-
enqueue.reject(err_1);
|
|
69
|
-
return [3 /*break*/, 3];
|
|
70
|
-
case 3: return [2 /*return*/];
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
}); });
|
|
26
|
+
enqueue(operation) {
|
|
27
|
+
const enqueue = new deferred_1.Deferred();
|
|
28
|
+
this.queue = this.queue.then(() => __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
try {
|
|
30
|
+
const result = yield operation();
|
|
31
|
+
enqueue.resolve(result);
|
|
32
|
+
}
|
|
33
|
+
catch (err) {
|
|
34
|
+
enqueue.reject(err);
|
|
35
|
+
}
|
|
36
|
+
}));
|
|
74
37
|
return enqueue.promise;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
}());
|
|
38
|
+
}
|
|
39
|
+
}
|
|
78
40
|
exports.Queue = Queue;
|
|
79
41
|
//# sourceMappingURL=queue.js.map
|
package/lib/util/queue.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue.js","sourceRoot":"","sources":["../../src/util/queue.ts"],"names":[],"mappings":";AAAA;;;;GAIG
|
|
1
|
+
{"version":3,"file":"queue.js","sourceRoot":"","sources":["../../src/util/queue.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,yCAAsC;AAEtC;;GAEG;AACH,MAAa,KAAK;IAAlB;QACc,UAAK,GAAiB,OAAO,CAAC,OAAO,EAAE,CAAC;IActD,CAAC;IAZG,OAAO,CAAI,SAA2B;QAClC,MAAM,OAAO,GAAG,IAAI,mBAAQ,EAAK,CAAC;QAClC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAS,EAAE;YACpC,IAAI;gBACA,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;gBACjC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;aAC3B;YAAC,OAAO,GAAG,EAAE;gBACV,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;aACvB;QACL,CAAC,CAAA,CAAC,CAAC;QACH,OAAO,OAAO,CAAC,OAAO,CAAC;IAC3B,CAAC;CACJ;AAfD,sBAeC"}
|
package/lib/util/queue.spec.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c) 2020
|
|
2
|
+
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
export {};
|
|
7
7
|
//# sourceMappingURL=queue.spec.d.ts.map
|