@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
|
@@ -5,20 +5,15 @@
|
|
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
|
|
6
6
|
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
7
7
|
*/
|
|
8
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
9
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
10
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
11
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
12
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
13
|
-
};
|
|
14
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
exports.WebSocketConnectionProvider = void 0;
|
|
10
|
+
const vscode_ws_jsonrpc_1 = require("vscode-ws-jsonrpc");
|
|
11
|
+
const vscode_jsonrpc_1 = require("vscode-jsonrpc");
|
|
12
|
+
const messageWriter_1 = require("vscode-jsonrpc/lib/messageWriter");
|
|
13
|
+
const messageReader_1 = require("vscode-jsonrpc/lib/messageReader");
|
|
14
|
+
const proxy_factory_1 = require("../proxy-factory");
|
|
15
|
+
const reconnecting_websocket_1 = require("reconnecting-websocket");
|
|
16
|
+
class WebSocketConnectionProvider {
|
|
22
17
|
/**
|
|
23
18
|
* Create a proxy object to remote interface of T type
|
|
24
19
|
* over a web socket connection for the given path.
|
|
@@ -26,59 +21,204 @@ var WebSocketConnectionProvider = /** @class */ (function () {
|
|
|
26
21
|
* An optional target can be provided to handle
|
|
27
22
|
* notifications and requests from a remote side.
|
|
28
23
|
*/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
24
|
+
createProxy(path, target, options) {
|
|
25
|
+
const factory = new proxy_factory_1.JsonRpcProxyFactory(target);
|
|
26
|
+
const startListening = (path) => {
|
|
27
|
+
const socket = this.listen({
|
|
28
|
+
path,
|
|
29
|
+
onConnection: (c) => factory.listen(c),
|
|
30
|
+
}, {
|
|
31
|
+
onTransportDidClose: () => factory.fireConnectionClosed(),
|
|
32
|
+
onTransportDidOpen: () => factory.fireConnectionOpened(),
|
|
33
|
+
}, options);
|
|
34
|
+
if (options === null || options === void 0 ? void 0 : options.onListening) {
|
|
35
|
+
options.onListening(socket);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
if (typeof path === "string") {
|
|
39
|
+
startListening(path);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
path.then((path) => startListening(path));
|
|
43
|
+
}
|
|
35
44
|
return factory.createProxy();
|
|
36
|
-
}
|
|
45
|
+
}
|
|
37
46
|
/**
|
|
38
47
|
* Install a connection handler for the given path.
|
|
39
48
|
*/
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
listen(handler, eventHandler, options) {
|
|
50
|
+
const url = handler.path;
|
|
51
|
+
const webSocket = this.createWebSocket(url);
|
|
52
|
+
const logger = this.createLogger();
|
|
44
53
|
if (options && options.onerror) {
|
|
45
|
-
|
|
46
|
-
webSocket.addEventListener(
|
|
47
|
-
|
|
54
|
+
const onerror = options.onerror;
|
|
55
|
+
webSocket.addEventListener("error", (event) => {
|
|
56
|
+
onerror(event);
|
|
48
57
|
});
|
|
49
58
|
}
|
|
50
59
|
else {
|
|
51
|
-
webSocket.addEventListener(
|
|
60
|
+
webSocket.addEventListener("error", (error) => {
|
|
52
61
|
logger.error(JSON.stringify(error));
|
|
53
62
|
});
|
|
54
63
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
|
-
WebSocketConnectionProvider.prototype.createLogger = function () {
|
|
64
|
+
doListen(webSocket, handler, eventHandler, logger);
|
|
65
|
+
return webSocket;
|
|
66
|
+
}
|
|
67
|
+
createLogger() {
|
|
62
68
|
return new vscode_ws_jsonrpc_1.ConsoleLogger();
|
|
63
|
-
}
|
|
69
|
+
}
|
|
64
70
|
/**
|
|
65
71
|
* Creates a web socket for the given url
|
|
66
72
|
*/
|
|
67
|
-
|
|
68
|
-
|
|
73
|
+
createWebSocket(url) {
|
|
74
|
+
return new reconnecting_websocket_1.default(url, undefined, {
|
|
69
75
|
maxReconnectionDelay: 10000,
|
|
70
76
|
minReconnectionDelay: 1000,
|
|
71
77
|
reconnectionDelayGrowFactor: 1.3,
|
|
72
78
|
maxRetries: Infinity,
|
|
73
|
-
debug: false
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
WebSocketConnectionProvider = __decorate([
|
|
79
|
-
inversify_1.injectable()
|
|
80
|
-
], WebSocketConnectionProvider);
|
|
81
|
-
return WebSocketConnectionProvider;
|
|
82
|
-
}());
|
|
79
|
+
debug: false,
|
|
80
|
+
WebSocket: WebSocket,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
83
84
|
exports.WebSocketConnectionProvider = WebSocketConnectionProvider;
|
|
85
|
+
// The following was extracted from vscode-ws-jsonrpc to make these changes:
|
|
86
|
+
// - switch from WebSocket to ReconnectingWebSocket
|
|
87
|
+
// - webSocket.onopen: making sure it's only ever called once so we're re-using MessageConnection
|
|
88
|
+
// - WebSocketMessageWriter: buffer and re-try messages instead of throwing an error immidiately
|
|
89
|
+
// - WebSocketMessageReader: don't close MessageConnection on 'socket.onclose'
|
|
90
|
+
function doListen(resocket, handler, eventHandler, logger) {
|
|
91
|
+
resocket.addEventListener("close", () => eventHandler.onTransportDidClose());
|
|
92
|
+
let alreadyOpened = false;
|
|
93
|
+
resocket.onopen = () => {
|
|
94
|
+
// trigerr "open" every time we re-open the underlying websocket
|
|
95
|
+
eventHandler.onTransportDidOpen();
|
|
96
|
+
// make sure we're only ever creating one MessageConnection, irregardless of how many times we have to re-open the underlying (reconnecting) websocket
|
|
97
|
+
if (alreadyOpened) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
alreadyOpened = true;
|
|
101
|
+
const connection = createWebSocketConnection(resocket, logger);
|
|
102
|
+
handler.onConnection(connection);
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
function createWebSocketConnection(resocket, logger) {
|
|
106
|
+
const socket = (0, vscode_ws_jsonrpc_1.toSocket)(resocket);
|
|
107
|
+
const messageReader = new NonClosingWebSocketMessageReader(socket);
|
|
108
|
+
const messageWriter = new BufferingWebSocketMessageWriter(resocket, logger);
|
|
109
|
+
const connection = (0, vscode_jsonrpc_1.createMessageConnection)(messageReader, messageWriter, logger);
|
|
110
|
+
connection.onClose(() => connection.dispose());
|
|
111
|
+
return connection;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* This takes vscode-ws-jsonrpc/lib/socket/writer/WebSocketMessageWriter and adds a buffer
|
|
115
|
+
*/
|
|
116
|
+
class BufferingWebSocketMessageWriter extends messageWriter_1.AbstractMessageWriter {
|
|
117
|
+
constructor(socket, logger) {
|
|
118
|
+
super();
|
|
119
|
+
this.errorCount = 0;
|
|
120
|
+
this.buffer = [];
|
|
121
|
+
this.socket = socket;
|
|
122
|
+
this.logger = logger;
|
|
123
|
+
socket.addEventListener("open", (event) => this.flushBuffer());
|
|
124
|
+
}
|
|
125
|
+
write(msg) {
|
|
126
|
+
if (this.socket.readyState !== reconnecting_websocket_1.default.OPEN) {
|
|
127
|
+
this.bufferMsg(msg);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
try {
|
|
131
|
+
const content = JSON.stringify(msg);
|
|
132
|
+
this.socket.send(content);
|
|
133
|
+
}
|
|
134
|
+
catch (e) {
|
|
135
|
+
this.errorCount++;
|
|
136
|
+
this.fireError(e, msg, this.errorCount);
|
|
137
|
+
this.bufferMsg(msg);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
flushBuffer() {
|
|
141
|
+
if (this.buffer.length === 0) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const buffer = [...this.buffer];
|
|
145
|
+
this.buffer = [];
|
|
146
|
+
for (const msg of buffer) {
|
|
147
|
+
this.write(msg);
|
|
148
|
+
}
|
|
149
|
+
//this.logger.info(`flushed buffer (${this.buffer.length})`)
|
|
150
|
+
}
|
|
151
|
+
bufferMsg(msg) {
|
|
152
|
+
this.buffer.push(msg);
|
|
153
|
+
//this.logger.info(`buffered message (${this.buffer.length})`);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* This takes vscode-ws-jsonrpc/lib/socket/reader/WebSocketMessageReader and removes the "onClose -> fireClose" connection
|
|
158
|
+
*/
|
|
159
|
+
class NonClosingWebSocketMessageReader extends messageReader_1.AbstractMessageReader {
|
|
160
|
+
constructor(socket) {
|
|
161
|
+
super();
|
|
162
|
+
this.events = [];
|
|
163
|
+
this.state = "initial";
|
|
164
|
+
this.callback = () => { };
|
|
165
|
+
this.socket = socket;
|
|
166
|
+
this.socket.onMessage((message) => this.readMessage(message));
|
|
167
|
+
this.socket.onError((error) => this.fireError(error));
|
|
168
|
+
this.socket.onClose((code, reason) => {
|
|
169
|
+
if (code !== 1000) {
|
|
170
|
+
const error = {
|
|
171
|
+
name: "" + code,
|
|
172
|
+
message: `Error during socket reconnect: code = ${code}, reason = ${reason}`,
|
|
173
|
+
};
|
|
174
|
+
this.fireError(error);
|
|
175
|
+
}
|
|
176
|
+
// this.fireClose(); // <-- reason for this class to be copied over
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
listen(callback) {
|
|
180
|
+
if (this.state === "initial") {
|
|
181
|
+
this.state = "listening";
|
|
182
|
+
this.callback = callback;
|
|
183
|
+
while (this.events.length !== 0) {
|
|
184
|
+
const event = this.events.pop();
|
|
185
|
+
if (event.message) {
|
|
186
|
+
this.readMessage(event.message);
|
|
187
|
+
}
|
|
188
|
+
else if (event.error) {
|
|
189
|
+
this.fireError(event.error);
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
this.fireClose();
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
readMessage(message) {
|
|
198
|
+
if (this.state === "initial") {
|
|
199
|
+
this.events.splice(0, 0, { message });
|
|
200
|
+
}
|
|
201
|
+
else if (this.state === "listening") {
|
|
202
|
+
const data = JSON.parse(message);
|
|
203
|
+
this.callback(data);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
fireError(error) {
|
|
207
|
+
if (this.state === "initial") {
|
|
208
|
+
this.events.splice(0, 0, { error });
|
|
209
|
+
}
|
|
210
|
+
else if (this.state === "listening") {
|
|
211
|
+
super.fireError(error);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
fireClose() {
|
|
215
|
+
if (this.state === "initial") {
|
|
216
|
+
this.events.splice(0, 0, {});
|
|
217
|
+
}
|
|
218
|
+
else if (this.state === "listening") {
|
|
219
|
+
super.fireClose();
|
|
220
|
+
}
|
|
221
|
+
this.state = "closed";
|
|
222
|
+
}
|
|
223
|
+
}
|
|
84
224
|
//# sourceMappingURL=connection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../src/messaging/browser/connection.ts"],"names":[],"mappings":";AAAA;;;;;GAKG
|
|
1
|
+
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../src/messaging/browser/connection.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,yDAAgF;AAChF,mDAAyD;AACzD,oEAAyE;AACzE,oEAAyE;AACzE,oDAAqE;AAErE,mEAAsE;AAOtE,MAAa,2BAA2B;IACpC;;;;;;OAMG;IACH,WAAW,CACP,IAA8B,EAC9B,MAAe,EACf,OAA0B;QAE1B,MAAM,OAAO,GAAG,IAAI,mCAAmB,CAAI,MAAM,CAAC,CAAC;QACnD,MAAM,cAAc,GAAG,CAAC,IAAY,EAAE,EAAE;YACpC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CACtB;gBACI,IAAI;gBACJ,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;aACzC,EACD;gBACI,mBAAmB,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,oBAAoB,EAAE;gBACzD,kBAAkB,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,oBAAoB,EAAE;aAC3D,EACD,OAAO,CACV,CAAC;YACF,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,EAAE;gBACtB,OAAO,CAAC,WAAW,CAAC,MAAsC,CAAC,CAAC;aAC/D;QACL,CAAC,CAAC;QAEF,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;YAC1B,cAAc,CAAC,IAAI,CAAC,CAAC;SACxB;aAAM;YACH,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;SAC7C;QACD,OAAO,OAAO,CAAC,WAAW,EAAE,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,OAA0B,EAAE,YAAoC,EAAE,OAA0B;QAC/F,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;QAC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E,CAAC,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;SACzC;aAAM,IAAI,IAAI,CAAC,KAAK,KAAK,WAAW,EAAE;YACnC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACjC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;SACvB;IACL,CAAC;IACD,SAAS,CAAC,KAAU;QAChB,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE;YAC1B,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;SACvC;aAAM,IAAI,IAAI,CAAC,KAAK,KAAK,WAAW,EAAE;YACnC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;SAC1B;IACL,CAAC;IACD,SAAS;QACL,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE;YAC1B,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;SAChC;aAAM,IAAI,IAAI,CAAC,KAAK,KAAK,WAAW,EAAE;YACnC,KAAK,CAAC,SAAS,EAAE,CAAC;SACrB;QACD,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC;IAC1B,CAAC;CACJ"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
|
+
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
|
+
*/
|
|
6
|
+
import { Message } from "vscode-jsonrpc/lib/messages";
|
|
7
|
+
import { AbstractMessageWriter, MessageWriter } from "vscode-jsonrpc/lib/messageWriter";
|
|
8
|
+
import { AbstractMessageReader, MessageReader, DataCallback } from "vscode-jsonrpc/lib/messageReader";
|
|
9
|
+
import { MessageConnection } from "vscode-jsonrpc/lib/main";
|
|
5
10
|
export declare class WindowMessageWriter extends AbstractMessageWriter implements MessageWriter {
|
|
6
11
|
readonly serviceId: string;
|
|
7
12
|
readonly window: Window;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"window-connection.d.ts","sourceRoot":"","sources":["../../../src/messaging/browser/window-connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AACtG,OAAO,EAAE,iBAAiB,EAA2B,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"window-connection.d.ts","sourceRoot":"","sources":["../../../src/messaging/browser/window-connection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AACtG,OAAO,EAAE,iBAAiB,EAA2B,MAAM,yBAAyB,CAAC;AAiBrF,qBAAa,mBAAoB,SAAQ,qBAAsB,YAAW,aAAa;IACvE,QAAQ,CAAC,SAAS,EAAE,MAAM;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM;IAAE,QAAQ,CAAC,YAAY,EAAE,MAAM;gBAAzE,SAAS,EAAE,MAAM,EAAW,MAAM,EAAE,MAAM,EAAW,YAAY,EAAE,MAAM;IAI9F,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI;CAI5B;AAED,qBAAa,mBAAoB,SAAQ,qBAAsB,YAAW,aAAa;IAIvE,QAAQ,CAAC,SAAS,EAAE,MAAM;IAAE,QAAQ,CAAC,YAAY,EAAE,MAAM;IAHrE,SAAS,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC;IAClC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,CAAM;gBAErB,SAAS,EAAE,MAAM,EAAW,YAAY,EAAE,MAAM;IAqBrE,MAAM,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI;CAQvC;AAED,wBAAgB,6BAA6B,CACzC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,EACpB,YAAY,SAAe,GAC5B,iBAAiB,CAInB"}
|
|
@@ -1,82 +1,71 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
4
|
+
* Licensed under the GNU Affero General Public License (AGPL).
|
|
5
|
+
* See License.AGPL.txt in the project root for license information.
|
|
6
|
+
*/
|
|
15
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
exports.createWindowMessageConnection = exports.WindowMessageReader = exports.WindowMessageWriter = void 0;
|
|
9
|
+
const messageWriter_1 = require("vscode-jsonrpc/lib/messageWriter");
|
|
10
|
+
const messageReader_1 = require("vscode-jsonrpc/lib/messageReader");
|
|
11
|
+
const main_1 = require("vscode-jsonrpc/lib/main");
|
|
12
|
+
const vscode_ws_jsonrpc_1 = require("vscode-ws-jsonrpc");
|
|
20
13
|
function isWindowMessage(value) {
|
|
21
|
-
return !!value &&
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
return (!!value &&
|
|
15
|
+
typeof value === "object" &&
|
|
16
|
+
"jsonrpc" in value &&
|
|
17
|
+
typeof value["jsonrpc"] === "string" &&
|
|
18
|
+
"serviceId" in value &&
|
|
19
|
+
typeof value["serviceId"] === "string");
|
|
24
20
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
_this.targetOrigin = targetOrigin;
|
|
32
|
-
return _this;
|
|
21
|
+
class WindowMessageWriter extends messageWriter_1.AbstractMessageWriter {
|
|
22
|
+
constructor(serviceId, window, targetOrigin) {
|
|
23
|
+
super();
|
|
24
|
+
this.serviceId = serviceId;
|
|
25
|
+
this.window = window;
|
|
26
|
+
this.targetOrigin = targetOrigin;
|
|
33
27
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
this.window.postMessage(Object.assign(msg, { serviceId
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
}(messageWriter_1.AbstractMessageWriter));
|
|
28
|
+
write(msg) {
|
|
29
|
+
const { serviceId } = this;
|
|
30
|
+
this.window.postMessage(Object.assign(msg, { serviceId }), this.targetOrigin);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
40
33
|
exports.WindowMessageWriter = WindowMessageWriter;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (_this.sourceOrigin !== '*' && event.origin !== _this.sourceOrigin) {
|
|
34
|
+
class WindowMessageReader extends messageReader_1.AbstractMessageReader {
|
|
35
|
+
constructor(serviceId, sourceOrigin) {
|
|
36
|
+
super();
|
|
37
|
+
this.serviceId = serviceId;
|
|
38
|
+
this.sourceOrigin = sourceOrigin;
|
|
39
|
+
this.buffer = [];
|
|
40
|
+
window.addEventListener("message", (event) => {
|
|
41
|
+
if (this.sourceOrigin !== "*" && event.origin !== this.sourceOrigin) {
|
|
50
42
|
return;
|
|
51
43
|
}
|
|
52
|
-
if (!isWindowMessage(event.data) || event.data.serviceId !==
|
|
44
|
+
if (!isWindowMessage(event.data) || event.data.serviceId !== this.serviceId) {
|
|
53
45
|
return;
|
|
54
46
|
}
|
|
55
|
-
if (
|
|
56
|
-
|
|
47
|
+
if (this.callback) {
|
|
48
|
+
this.callback(event.data);
|
|
57
49
|
}
|
|
58
50
|
else {
|
|
59
|
-
|
|
51
|
+
this.buffer.push(event.data);
|
|
60
52
|
}
|
|
61
53
|
}, false);
|
|
62
|
-
return _this;
|
|
63
54
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
while (message = this.buffer.pop()) {
|
|
55
|
+
listen(callback) {
|
|
56
|
+
let message;
|
|
57
|
+
while ((message = this.buffer.pop())) {
|
|
67
58
|
callback(message);
|
|
68
59
|
}
|
|
69
60
|
Object.freeze(this.buffer);
|
|
70
61
|
this.callback = callback;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
}(messageReader_1.AbstractMessageReader));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
74
64
|
exports.WindowMessageReader = WindowMessageReader;
|
|
75
|
-
function createWindowMessageConnection(serviceId, window, sourceOrigin, targetOrigin) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
return main_1.createMessageConnection(reader, writer, new vscode_ws_jsonrpc_1.ConsoleLogger());
|
|
65
|
+
function createWindowMessageConnection(serviceId, window, sourceOrigin, targetOrigin = sourceOrigin) {
|
|
66
|
+
const reader = new WindowMessageReader(serviceId, sourceOrigin);
|
|
67
|
+
const writer = new WindowMessageWriter(serviceId, window, targetOrigin);
|
|
68
|
+
return (0, main_1.createMessageConnection)(reader, writer, new vscode_ws_jsonrpc_1.ConsoleLogger());
|
|
80
69
|
}
|
|
81
70
|
exports.createWindowMessageConnection = createWindowMessageConnection;
|
|
82
71
|
//# sourceMappingURL=window-connection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"window-connection.js","sourceRoot":"","sources":["../../../src/messaging/browser/window-connection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"window-connection.js","sourceRoot":"","sources":["../../../src/messaging/browser/window-connection.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAGH,oEAAwF;AACxF,oEAAsG;AACtG,kDAAqF;AACrF,yDAAkD;AAKlD,SAAS,eAAe,CAAC,KAAU;IAC/B,OAAO,CACH,CAAC,CAAC,KAAK;QACP,OAAO,KAAK,KAAK,QAAQ;QACzB,SAAS,IAAI,KAAK;QAClB,OAAO,KAAK,CAAC,SAAS,CAAC,KAAK,QAAQ;QACpC,WAAW,IAAI,KAAK;QACpB,OAAO,KAAK,CAAC,WAAW,CAAC,KAAK,QAAQ,CACzC,CAAC;AACN,CAAC;AAED,MAAa,mBAAoB,SAAQ,qCAAqB;IAC1D,YAAqB,SAAiB,EAAW,MAAc,EAAW,YAAoB;QAC1F,KAAK,EAAE,CAAC;QADS,cAAS,GAAT,SAAS,CAAQ;QAAW,WAAM,GAAN,MAAM,CAAQ;QAAW,iBAAY,GAAZ,YAAY,CAAQ;IAE9F,CAAC;IAED,KAAK,CAAC,GAAY;QACd,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;QAC3B,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAClF,CAAC;CACJ;AATD,kDASC;AAED,MAAa,mBAAoB,SAAQ,qCAAqB;IAI1D,YAAqB,SAAiB,EAAW,YAAoB;QACjE,KAAK,EAAE,CAAC;QADS,cAAS,GAAT,SAAS,CAAQ;QAAW,iBAAY,GAAZ,YAAY,CAAQ;QAFlD,WAAM,GAAc,EAAE,CAAC;QAItC,MAAM,CAAC,gBAAgB,CACnB,SAAS,EACT,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yright (c) 2021 Gitpod GmbH. All rights reserved.
|
|
3
|
+
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
|
+
*/
|
|
6
|
+
import * as prometheusClient from "prom-client";
|
|
7
|
+
import { IClientCallMetrics, IGrpcCallMetricsLabels, IGrpcCallMetricsLabelsWithCode } from "../util/grpc";
|
|
8
|
+
export declare class PrometheusClientCallMetrics implements IClientCallMetrics {
|
|
9
|
+
readonly startedCounter: prometheusClient.Counter<string>;
|
|
10
|
+
readonly sentCounter: prometheusClient.Counter<string>;
|
|
11
|
+
readonly receivedCounter: prometheusClient.Counter<string>;
|
|
12
|
+
readonly handledCounter: prometheusClient.Counter<string>;
|
|
13
|
+
readonly handledSecondsHistogram: prometheusClient.Histogram<string>;
|
|
14
|
+
constructor();
|
|
15
|
+
started(labels: IGrpcCallMetricsLabels): void;
|
|
16
|
+
sent(labels: IGrpcCallMetricsLabels): void;
|
|
17
|
+
received(labels: IGrpcCallMetricsLabels): void;
|
|
18
|
+
handled(labels: IGrpcCallMetricsLabelsWithCode): void;
|
|
19
|
+
startHandleTimer(labels: IGrpcCallMetricsLabelsWithCode): (labels?: Partial<Record<string, string | number>> | undefined) => number;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=client-call-metrics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-call-metrics.d.ts","sourceRoot":"","sources":["../../src/messaging/client-call-metrics.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,gBAAgB,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAC;AAE1G,qBACa,2BAA4B,YAAW,kBAAkB;IAClE,QAAQ,CAAC,cAAc,EAAE,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1D,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACvD,QAAQ,CAAC,eAAe,EAAE,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3D,QAAQ,CAAC,cAAc,EAAE,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1D,QAAQ,CAAC,uBAAuB,EAAE,gBAAgB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;;IAmCrE,OAAO,CAAC,MAAM,EAAE,sBAAsB,GAAG,IAAI;IAQ7C,IAAI,CAAC,MAAM,EAAE,sBAAsB,GAAG,IAAI;IAQ1C,QAAQ,CAAC,MAAM,EAAE,sBAAsB,GAAG,IAAI;IAQ9C,OAAO,CAAC,MAAM,EAAE,8BAA8B,GAAG,IAAI;IASrD,gBAAgB,CACZ,MAAM,EAAE,8BAA8B,GACvC,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,GAAG,SAAS,KAAK,MAAM;CAO/E"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
|
|
4
|
+
* Licensed under the GNU Affero General Public License (AGPL).
|
|
5
|
+
* See License.AGPL.txt in the project root for license information.
|
|
6
|
+
*/
|
|
7
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
8
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
10
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
11
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12
|
+
};
|
|
13
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
14
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.PrometheusClientCallMetrics = void 0;
|
|
18
|
+
const inversify_1 = require("inversify");
|
|
19
|
+
const prometheusClient = require("prom-client");
|
|
20
|
+
let PrometheusClientCallMetrics = class PrometheusClientCallMetrics {
|
|
21
|
+
constructor() {
|
|
22
|
+
this.startedCounter = new prometheusClient.Counter({
|
|
23
|
+
name: "grpc_client_started_total",
|
|
24
|
+
help: "Total number of RPCs started on the client.",
|
|
25
|
+
labelNames: ["grpc_service", "grpc_method", "grpc_type"],
|
|
26
|
+
registers: [prometheusClient.register],
|
|
27
|
+
});
|
|
28
|
+
this.sentCounter = new prometheusClient.Counter({
|
|
29
|
+
name: "grpc_client_msg_sent_total",
|
|
30
|
+
help: " Total number of gRPC stream messages sent by the client.",
|
|
31
|
+
labelNames: ["grpc_service", "grpc_method", "grpc_type"],
|
|
32
|
+
registers: [prometheusClient.register],
|
|
33
|
+
});
|
|
34
|
+
this.receivedCounter = new prometheusClient.Counter({
|
|
35
|
+
name: "grpc_client_msg_received_total",
|
|
36
|
+
help: "Total number of RPC stream messages received by the client.",
|
|
37
|
+
labelNames: ["grpc_service", "grpc_method", "grpc_type"],
|
|
38
|
+
registers: [prometheusClient.register],
|
|
39
|
+
});
|
|
40
|
+
this.handledCounter = new prometheusClient.Counter({
|
|
41
|
+
name: "grpc_client_handled_total",
|
|
42
|
+
help: "Total number of RPCs completed by the client, regardless of success or failure.",
|
|
43
|
+
labelNames: ["grpc_service", "grpc_method", "grpc_type", "grpc_code"],
|
|
44
|
+
registers: [prometheusClient.register],
|
|
45
|
+
});
|
|
46
|
+
this.handledSecondsHistogram = new prometheusClient.Histogram({
|
|
47
|
+
name: "grpc_client_handling_seconds",
|
|
48
|
+
help: "Histogram of response latency (seconds) of the gRPC until it is finished by the application.",
|
|
49
|
+
labelNames: ["grpc_service", "grpc_method", "grpc_type", "grpc_code"],
|
|
50
|
+
registers: [prometheusClient.register],
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
started(labels) {
|
|
54
|
+
this.startedCounter.inc({
|
|
55
|
+
grpc_service: labels.service,
|
|
56
|
+
grpc_method: labels.method,
|
|
57
|
+
grpc_type: labels.type,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
sent(labels) {
|
|
61
|
+
this.sentCounter.inc({
|
|
62
|
+
grpc_service: labels.service,
|
|
63
|
+
grpc_method: labels.method,
|
|
64
|
+
grpc_type: labels.type,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
received(labels) {
|
|
68
|
+
this.receivedCounter.inc({
|
|
69
|
+
grpc_service: labels.service,
|
|
70
|
+
grpc_method: labels.method,
|
|
71
|
+
grpc_type: labels.type,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
handled(labels) {
|
|
75
|
+
this.handledCounter.inc({
|
|
76
|
+
grpc_service: labels.service,
|
|
77
|
+
grpc_method: labels.method,
|
|
78
|
+
grpc_type: labels.type,
|
|
79
|
+
grpc_code: labels.code,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
startHandleTimer(labels) {
|
|
83
|
+
return this.handledSecondsHistogram.startTimer({
|
|
84
|
+
grpc_service: labels.service,
|
|
85
|
+
grpc_method: labels.method,
|
|
86
|
+
grpc_type: labels.type,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
PrometheusClientCallMetrics = __decorate([
|
|
91
|
+
(0, inversify_1.injectable)(),
|
|
92
|
+
__metadata("design:paramtypes", [])
|
|
93
|
+
], PrometheusClientCallMetrics);
|
|
94
|
+
exports.PrometheusClientCallMetrics = PrometheusClientCallMetrics;
|
|
95
|
+
//# sourceMappingURL=client-call-metrics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{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