@gitpod/gitpod-protocol 0.1.5-update-ovsx.0 → 0.1.5-update-yarnlock.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/gitpod-schema.json +159 -25
- package/lib/accounting-protocol.d.ts +165 -0
- package/lib/accounting-protocol.d.ts.map +1 -0
- package/lib/accounting-protocol.js +120 -0
- package/lib/accounting-protocol.js.map +1 -0
- package/lib/admin-protocol.d.ts +51 -6
- package/lib/admin-protocol.d.ts.map +1 -1
- package/lib/admin-protocol.js +17 -2
- package/lib/admin-protocol.js.map +1 -1
- package/lib/analytics.d.ts +44 -0
- package/lib/analytics.d.ts.map +1 -0
- package/lib/analytics.js +10 -0
- package/lib/analytics.js.map +1 -0
- package/lib/attribution.d.ts +25 -0
- package/lib/attribution.d.ts.map +1 -0
- package/lib/attribution.js +58 -0
- package/lib/attribution.js.map +1 -0
- package/lib/auth.d.ts +25 -0
- package/lib/auth.d.ts.map +1 -0
- package/lib/auth.js +16 -0
- package/lib/auth.js.map +1 -0
- package/lib/billing-mode.d.ts +45 -0
- package/lib/billing-mode.d.ts.map +1 -0
- package/lib/billing-mode.js +44 -0
- package/lib/billing-mode.js.map +1 -0
- package/lib/blocked-repositories-protocol.d.ts +13 -0
- package/lib/blocked-repositories-protocol.d.ts.map +1 -0
- package/lib/blocked-repositories-protocol.js +8 -0
- package/lib/blocked-repositories-protocol.js.map +1 -0
- package/lib/context-url.d.ts +30 -0
- package/lib/context-url.d.ts.map +1 -0
- package/lib/context-url.js +100 -0
- package/lib/context-url.js.map +1 -0
- package/lib/context-url.spec.d.ts +12 -0
- package/lib/context-url.spec.d.ts.map +1 -0
- package/lib/context-url.spec.js +81 -0
- package/lib/context-url.spec.js.map +1 -0
- package/lib/encryption/container-module.d.ts +2 -2
- package/lib/encryption/container-module.d.ts.map +1 -1
- package/lib/encryption/container-module.js +8 -6
- package/lib/encryption/container-module.js.map +1 -1
- package/lib/encryption/encryption-engine.d.ts +2 -2
- package/lib/encryption/encryption-engine.d.ts.map +1 -1
- package/lib/encryption/encryption-engine.js +28 -28
- package/lib/encryption/encryption-engine.js.map +1 -1
- package/lib/encryption/encryption-engine.spec.d.ts +3 -3
- package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
- package/lib/encryption/encryption-engine.spec.js +32 -39
- package/lib/encryption/encryption-engine.spec.js.map +1 -1
- package/lib/encryption/encryption-service.d.ts +2 -2
- package/lib/encryption/encryption-service.d.ts.map +1 -1
- package/lib/encryption/encryption-service.js +33 -46
- package/lib/encryption/encryption-service.js.map +1 -1
- package/lib/encryption/key-provider.d.ts +3 -3
- package/lib/encryption/key-provider.d.ts.map +1 -1
- package/lib/encryption/key-provider.js +34 -40
- package/lib/encryption/key-provider.js.map +1 -1
- package/lib/env.d.ts +2 -8
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +10 -29
- package/lib/env.js.map +1 -1
- package/lib/experiments/always-default.d.ts +8 -0
- package/lib/experiments/always-default.d.ts.map +1 -0
- package/lib/experiments/always-default.js +20 -0
- package/lib/experiments/always-default.js.map +1 -0
- package/lib/experiments/configcat-server.d.ts +10 -0
- package/lib/experiments/configcat-server.d.ts.map +1 -0
- package/lib/experiments/configcat-server.js +37 -0
- package/lib/experiments/configcat-server.js.map +1 -0
- package/lib/experiments/configcat.d.ts +21 -0
- package/lib/experiments/configcat.d.ts.map +1 -0
- package/lib/experiments/configcat.js +51 -0
- package/lib/experiments/configcat.js.map +1 -0
- package/lib/experiments/types.d.ts +22 -0
- package/lib/experiments/types.d.ts.map +1 -0
- package/lib/experiments/types.js +10 -0
- package/lib/experiments/types.js.map +1 -0
- package/lib/frontend-dashboard-service.d.ts +99 -0
- package/lib/frontend-dashboard-service.d.ts.map +1 -0
- package/lib/frontend-dashboard-service.js +55 -0
- package/lib/frontend-dashboard-service.js.map +1 -0
- package/lib/gitpod-file-parser.d.ts +2 -2
- package/lib/gitpod-file-parser.d.ts.map +1 -1
- package/lib/gitpod-file-parser.js +29 -44
- package/lib/gitpod-file-parser.js.map +1 -1
- package/lib/gitpod-file-parser.spec.d.ts +2 -2
- package/lib/gitpod-file-parser.spec.js +147 -144
- package/lib/gitpod-file-parser.spec.js.map +1 -1
- package/lib/gitpod-service.d.ts +290 -50
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +288 -123
- package/lib/gitpod-service.js.map +1 -1
- package/lib/headless-workspace-log.d.ts +11 -13
- package/lib/headless-workspace-log.d.ts.map +1 -1
- package/lib/headless-workspace-log.js +8 -9
- package/lib/headless-workspace-log.js.map +1 -1
- package/lib/ide-frontend-service.d.ts +26 -0
- package/lib/ide-frontend-service.d.ts.map +1 -0
- package/lib/ide-frontend-service.js +8 -0
- package/lib/ide-frontend-service.js.map +1 -0
- package/lib/ide-protocol.d.ts +126 -0
- package/lib/ide-protocol.d.ts.map +1 -0
- package/lib/ide-protocol.js +18 -0
- package/lib/ide-protocol.js.map +1 -0
- package/lib/index.d.ts +18 -12
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +28 -13
- package/lib/index.js.map +1 -1
- package/lib/installation-admin-protocol.d.ts +30 -0
- package/lib/installation-admin-protocol.d.ts.map +1 -0
- package/lib/installation-admin-protocol.js +31 -0
- package/lib/installation-admin-protocol.js.map +1 -0
- package/lib/license-protocol.d.ts +9 -2
- package/lib/license-protocol.d.ts.map +1 -1
- package/lib/license-protocol.js +3 -2
- package/lib/license-protocol.js.map +1 -1
- package/lib/messaging/browser/connection.d.ts +6 -4
- package/lib/messaging/browser/connection.d.ts.map +1 -1
- package/lib/messaging/browser/connection.js +188 -48
- package/lib/messaging/browser/connection.js.map +1 -1
- package/lib/messaging/browser/window-connection.d.ts +9 -4
- package/lib/messaging/browser/window-connection.d.ts.map +1 -1
- package/lib/messaging/browser/window-connection.js +48 -59
- package/lib/messaging/browser/window-connection.js.map +1 -1
- package/lib/messaging/client-call-metrics.d.ts +21 -0
- package/lib/messaging/client-call-metrics.d.ts.map +1 -0
- package/lib/messaging/client-call-metrics.js +95 -0
- package/lib/messaging/client-call-metrics.js.map +1 -0
- package/lib/messaging/error.d.ts +18 -4
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +38 -7
- package/lib/messaging/error.js.map +1 -1
- package/lib/messaging/handler.d.ts +10 -0
- package/lib/messaging/handler.d.ts.map +1 -1
- package/lib/messaging/handler.js +2 -1
- package/lib/messaging/handler.js.map +1 -1
- package/lib/messaging/node/connection.d.ts +1 -17
- package/lib/messaging/node/connection.d.ts.map +1 -1
- package/lib/messaging/node/connection.js +24 -59
- package/lib/messaging/node/connection.js.map +1 -1
- package/lib/messaging/proxy-factory.d.ts +3 -1
- package/lib/messaging/proxy-factory.d.ts.map +1 -1
- package/lib/messaging/proxy-factory.js +76 -162
- package/lib/messaging/proxy-factory.js.map +1 -1
- package/lib/oss-allowlist.d.ts +14 -0
- package/lib/oss-allowlist.d.ts.map +1 -0
- package/lib/oss-allowlist.js +8 -0
- package/lib/oss-allowlist.js.map +1 -0
- package/lib/payment-protocol.d.ts +18 -0
- package/lib/payment-protocol.d.ts.map +1 -0
- package/lib/payment-protocol.js +13 -0
- package/lib/payment-protocol.js.map +1 -0
- package/lib/permission.d.ts +26 -15
- package/lib/permission.d.ts.map +1 -1
- package/lib/permission.js +50 -36
- package/lib/permission.js.map +1 -1
- package/lib/plans.d.ts +213 -0
- package/lib/plans.d.ts.map +1 -0
- package/lib/plans.js +625 -0
- package/lib/plans.js.map +1 -0
- package/lib/protocol.d.ts +338 -111
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +422 -201
- package/lib/protocol.js.map +1 -1
- package/lib/protocol.spec.d.ts +7 -0
- package/lib/protocol.spec.d.ts.map +1 -0
- package/lib/protocol.spec.js +127 -0
- package/lib/protocol.spec.js.map +1 -0
- package/lib/snapshot-url.d.ts +14 -0
- package/lib/snapshot-url.d.ts.map +1 -0
- package/lib/snapshot-url.js +26 -0
- package/lib/snapshot-url.js.map +1 -0
- package/lib/snapshot-url.spec.d.ts +7 -0
- package/lib/snapshot-url.spec.d.ts.map +1 -0
- package/lib/snapshot-url.spec.js +41 -0
- package/lib/snapshot-url.spec.js.map +1 -0
- package/lib/team-subscription-protocol.d.ts +93 -0
- package/lib/team-subscription-protocol.d.ts.map +1 -0
- package/lib/team-subscription-protocol.js +82 -0
- package/lib/team-subscription-protocol.js.map +1 -0
- package/lib/teams-projects-protocol.d.ts +136 -0
- package/lib/teams-projects-protocol.d.ts.map +1 -0
- package/lib/teams-projects-protocol.js +41 -0
- package/lib/teams-projects-protocol.js.map +1 -0
- package/lib/typings/globals.d.ts +8 -3
- package/lib/typings/globals.d.ts.map +1 -1
- package/lib/typings/globals.js +2 -2
- package/lib/usage.d.ts +73 -0
- package/lib/usage.d.ts.map +1 -0
- package/lib/usage.js +20 -0
- package/lib/usage.js.map +1 -0
- package/lib/util/analytics.d.ts +8 -0
- package/lib/util/analytics.d.ts.map +1 -0
- package/lib/util/analytics.js +88 -0
- package/lib/util/analytics.js.map +1 -0
- package/lib/util/async-iterator.d.ts +2 -2
- package/lib/util/async-iterator.d.ts.map +1 -1
- package/lib/util/async-iterator.js +60 -137
- package/lib/util/async-iterator.js.map +1 -1
- package/lib/util/cancelable.d.ts +2 -2
- package/lib/util/cancelable.js +20 -61
- package/lib/util/cancelable.js.map +1 -1
- package/lib/util/date-time.d.ts +2 -2
- package/lib/util/date-time.js +14 -13
- package/lib/util/date-time.js.map +1 -1
- package/lib/util/debug-app.d.ts +25 -0
- package/lib/util/debug-app.d.ts.map +1 -0
- package/lib/util/debug-app.js +100 -0
- package/lib/util/debug-app.js.map +1 -0
- package/lib/util/deep-partial.d.ts +2 -2
- package/lib/util/deep-partial.js +2 -2
- package/lib/util/deferred.d.ts +2 -2
- package/lib/util/deferred.js +13 -14
- package/lib/util/deferred.js.map +1 -1
- package/lib/util/disposable.d.ts +2 -2
- package/lib/util/disposable.d.ts.map +1 -1
- package/lib/util/disposable.js +28 -40
- package/lib/util/disposable.js.map +1 -1
- package/lib/util/event.d.ts +1 -1
- package/lib/util/event.d.ts.map +1 -1
- package/lib/util/event.js +64 -77
- package/lib/util/event.js.map +1 -1
- package/lib/util/garbage-collected-cache.d.ts +3 -2
- package/lib/util/garbage-collected-cache.d.ts.map +1 -1
- package/lib/util/garbage-collected-cache.js +35 -49
- package/lib/util/garbage-collected-cache.js.map +1 -1
- package/lib/util/generate-workspace-id.d.ts +9 -0
- package/lib/util/generate-workspace-id.d.ts.map +1 -0
- package/lib/util/generate-workspace-id.js +491 -0
- package/lib/util/generate-workspace-id.js.map +1 -0
- package/lib/util/generate-workspace-id.spec.d.ts +7 -0
- package/lib/util/generate-workspace-id.spec.d.ts.map +1 -0
- package/lib/util/generate-workspace-id.spec.js +98 -0
- package/lib/util/generate-workspace-id.spec.js.map +1 -0
- package/lib/util/gitpod-cookie.d.ts +20 -0
- package/lib/util/gitpod-cookie.d.ts.map +1 -0
- package/lib/util/gitpod-cookie.js +41 -0
- package/lib/util/gitpod-cookie.js.map +1 -0
- package/lib/util/gitpod-host-url.d.ts +20 -8
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +143 -85
- package/lib/util/gitpod-host-url.js.map +1 -1
- package/lib/util/gitpod-host-url.spec.d.ts +16 -0
- package/lib/util/gitpod-host-url.spec.d.ts.map +1 -0
- package/lib/util/gitpod-host-url.spec.js +134 -0
- package/lib/util/gitpod-host-url.spec.js.map +1 -0
- package/lib/util/grpc.d.ts +35 -0
- package/lib/util/grpc.d.ts.map +1 -0
- package/lib/util/grpc.js +90 -0
- package/lib/util/grpc.js.map +1 -0
- package/lib/util/jaeger-client-types.d.ts +68 -0
- package/lib/util/jaeger-client-types.d.ts.map +1 -0
- package/lib/util/jaeger-client-types.js +8 -0
- package/lib/util/jaeger-client-types.js.map +1 -0
- package/lib/util/logging.d.ts +58 -35
- package/lib/util/logging.d.ts.map +1 -1
- package/lib/util/logging.js +144 -129
- package/lib/util/logging.js.map +1 -1
- package/lib/util/logging.spec.d.ts +7 -0
- package/lib/util/logging.spec.d.ts.map +1 -0
- package/lib/util/logging.spec.js +52 -0
- package/lib/util/logging.spec.js.map +1 -0
- package/lib/util/make-link.d.ts +2 -2
- package/lib/util/make-link.js +8 -7
- package/lib/util/make-link.js.map +1 -1
- package/lib/util/nice-grpc.d.ts +9 -0
- package/lib/util/nice-grpc.d.ts.map +1 -0
- package/lib/util/nice-grpc.js +121 -0
- package/lib/util/nice-grpc.js.map +1 -0
- package/lib/util/parse-workspace-id.d.ts +15 -5
- package/lib/util/parse-workspace-id.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.js +39 -9
- package/lib/util/parse-workspace-id.js.map +1 -1
- package/lib/util/parse-workspace-id.spec.d.ts +10 -2
- package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.spec.js +130 -49
- package/lib/util/parse-workspace-id.spec.js.map +1 -1
- package/lib/util/queue.d.ts +2 -2
- package/lib/util/queue.js +19 -57
- package/lib/util/queue.js.map +1 -1
- package/lib/util/queue.spec.d.ts +2 -2
- package/lib/util/queue.spec.js +149 -288
- package/lib/util/queue.spec.js.map +1 -1
- package/lib/util/repeat.d.ts +15 -0
- package/lib/util/repeat.d.ts.map +1 -0
- package/lib/util/repeat.js +55 -0
- package/lib/util/repeat.js.map +1 -0
- package/lib/util/semaphore.d.ts +2 -2
- package/lib/util/semaphore.d.ts.map +1 -1
- package/lib/util/semaphore.js +18 -48
- package/lib/util/semaphore.js.map +1 -1
- package/lib/util/skip-if.d.ts +2 -2
- package/lib/util/skip-if.d.ts.map +1 -1
- package/lib/util/skip-if.js +9 -8
- package/lib/util/skip-if.js.map +1 -1
- package/lib/util/timeutil.d.ts +4 -2
- package/lib/util/timeutil.d.ts.map +1 -1
- package/lib/util/timeutil.js +43 -18
- package/lib/util/timeutil.js.map +1 -1
- package/lib/util/timeutil.spec.d.ts +4 -2
- package/lib/util/timeutil.spec.d.ts.map +1 -1
- package/lib/util/timeutil.spec.js +57 -25
- package/lib/util/timeutil.spec.js.map +1 -1
- package/lib/util/tracing.d.ts +55 -8
- package/lib/util/tracing.d.ts.map +1 -1
- package/lib/util/tracing.js +210 -66
- package/lib/util/tracing.js.map +1 -1
- package/lib/util/tracing.spec.d.ts +7 -0
- package/lib/util/tracing.spec.d.ts.map +1 -0
- package/lib/util/tracing.spec.js +121 -0
- package/lib/util/tracing.spec.js.map +1 -0
- package/lib/util/workspace-port-authentication.d.ts +9 -9
- package/lib/util/workspace-port-authentication.d.ts.map +1 -1
- package/lib/util/workspace-port-authentication.js +13 -14
- package/lib/util/workspace-port-authentication.js.map +1 -1
- package/lib/webhook-event.d.ts +44 -0
- package/lib/webhook-event.d.ts.map +1 -0
- package/lib/webhook-event.js +8 -0
- package/lib/webhook-event.js.map +1 -0
- package/lib/workspace-class.d.ts +14 -0
- package/lib/workspace-class.d.ts.map +1 -0
- package/lib/workspace-class.js +8 -0
- package/lib/workspace-class.js.map +1 -0
- package/lib/workspace-cluster.d.ts +80 -0
- package/lib/workspace-cluster.d.ts.map +1 -0
- package/lib/workspace-cluster.js +36 -0
- package/lib/workspace-cluster.js.map +1 -0
- package/lib/workspace-instance.d.ts +51 -8
- package/lib/workspace-instance.d.ts.map +1 -1
- package/lib/workspace-instance.js +2 -2
- package/lib/wsready.d.ts +8 -2
- package/lib/wsready.d.ts.map +1 -1
- package/lib/wsready.js +4 -3
- package/lib/wsready.js.map +1 -1
- package/package.json +42 -18
- package/pkg-yarn.lock +24 -10
- package/provenance-bundle.jsonl +2 -0
- package/src/accounting-protocol.ts +253 -0
- package/src/admin-protocol.ts +96 -21
- package/src/analytics.ts +52 -0
- package/src/attribution.ts +67 -0
- package/src/auth.ts +27 -0
- package/src/billing-mode.ts +84 -0
- package/src/blocked-repositories-protocol.ts +13 -0
- package/src/context-url.spec.ts +49 -0
- package/src/context-url.ts +107 -0
- package/src/encryption/container-module.ts +4 -5
- package/src/encryption/encryption-engine.spec.ts +11 -10
- package/src/encryption/encryption-engine.ts +22 -18
- package/src/encryption/encryption-service.ts +6 -7
- package/src/encryption/key-provider.ts +18 -21
- package/src/env.ts +3 -26
- package/src/experiments/always-default.ts +24 -0
- package/src/experiments/configcat-server.ts +42 -0
- package/src/experiments/configcat.ts +56 -0
- package/src/experiments/types.ts +34 -0
- package/src/frontend-dashboard-service.ts +148 -0
- package/src/gitpod-file-parser.spec.ts +57 -63
- package/src/gitpod-file-parser.ts +18 -19
- package/src/gitpod-service.ts +602 -99
- package/src/headless-workspace-log.ts +14 -16
- package/src/ide-frontend-service.ts +28 -0
- package/src/ide-protocol.ts +147 -0
- package/src/index.ts +18 -12
- package/src/installation-admin-protocol.ts +45 -0
- package/src/license-protocol.ts +14 -8
- package/src/messaging/browser/connection.ts +202 -26
- package/src/messaging/browser/window-connection.ts +45 -29
- package/src/messaging/client-call-metrics.ts +94 -0
- package/src/messaging/error.ts +51 -10
- package/src/messaging/handler.ts +13 -1
- package/src/messaging/node/connection.ts +23 -70
- package/src/messaging/proxy-factory.ts +35 -34
- package/src/oss-allowlist.ts +15 -0
- package/src/payment-protocol.ts +20 -0
- package/src/permission.ts +53 -40
- package/src/plans.ts +699 -0
- package/src/protocol.spec.ts +97 -0
- package/src/protocol.ts +790 -302
- package/src/snapshot-url.spec.ts +27 -0
- package/src/snapshot-url.ts +27 -0
- package/src/team-subscription-protocol.ts +153 -0
- package/src/teams-projects-protocol.ts +180 -0
- package/src/typings/globals.ts +13 -5
- package/src/usage.ts +85 -0
- package/src/util/analytics.ts +109 -0
- package/src/util/async-iterator.ts +6 -7
- package/src/util/cancelable.ts +5 -5
- package/src/util/date-time.ts +10 -10
- package/src/util/debug-app.ts +81 -0
- package/src/util/deep-partial.ts +2 -2
- package/src/util/deferred.ts +8 -8
- package/src/util/disposable.ts +3 -6
- package/src/util/event.ts +9 -11
- package/src/util/garbage-collected-cache.ts +18 -10
- package/src/util/generate-workspace-id.spec.ts +58 -0
- package/src/util/generate-workspace-id.ts +481 -0
- package/src/util/gitpod-cookie.ts +38 -0
- package/src/util/gitpod-host-url.spec.ts +76 -0
- package/src/util/gitpod-host-url.ts +119 -40
- package/src/util/grpc.ts +107 -0
- package/src/util/jaeger-client-types.ts +102 -0
- package/src/util/logging.spec.ts +23 -0
- package/src/util/logging.ts +163 -73
- package/src/util/make-link.ts +8 -9
- package/src/util/nice-grpc.ts +96 -0
- package/src/util/parse-workspace-id.spec.ts +62 -12
- package/src/util/parse-workspace-id.ts +40 -10
- package/src/util/queue.spec.ts +30 -28
- package/src/util/queue.ts +2 -2
- package/src/util/repeat.ts +45 -0
- package/src/util/semaphore.ts +8 -10
- package/src/util/skip-if.ts +12 -9
- package/src/util/timeutil.spec.ts +42 -16
- package/src/util/timeutil.ts +33 -17
- package/src/util/tracing.spec.ts +88 -0
- package/src/util/tracing.ts +211 -33
- package/src/util/workspace-port-authentication.ts +12 -15
- package/src/webhook-event.ts +55 -0
- package/src/workspace-class.ts +14 -0
- package/src/workspace-cluster.ts +121 -0
- package/src/workspace-instance.ts +120 -36
- package/src/wsready.ts +11 -4
- package/data/builtin-theia-plugins.json +0 -362
- package/lib/email-protocol.d.ts +0 -49
- package/lib/email-protocol.d.ts.map +0 -1
- package/lib/email-protocol.js +0 -27
- package/lib/email-protocol.js.map +0 -1
- package/lib/messaging/connection-error-handler.d.ts +0 -27
- package/lib/messaging/connection-error-handler.d.ts.map +0 -1
- package/lib/messaging/connection-error-handler.js +0 -45
- package/lib/messaging/connection-error-handler.js.map +0 -1
- package/lib/theia-plugins.d.ts +0 -11
- package/lib/theia-plugins.d.ts.map +0 -1
- package/lib/theia-plugins.js +0 -8
- package/lib/theia-plugins.js.map +0 -1
- package/lib/util/repeater.d.ts +0 -22
- package/lib/util/repeater.d.ts.map +0 -1
- package/lib/util/repeater.js +0 -117
- package/lib/util/repeater.js.map +0 -1
- package/lib/util/safe-promise.d.ts +0 -11
- package/lib/util/safe-promise.d.ts.map +0 -1
- package/lib/util/safe-promise.js +0 -33
- package/lib/util/safe-promise.js.map +0 -1
- package/lib/util/without.d.ts +0 -7
- package/lib/util/without.d.ts.map +0 -1
- package/lib/util/without.js +0 -8
- package/lib/util/without.js.map +0 -1
- package/src/email-protocol.ts +0 -67
- package/src/messaging/connection-error-handler.ts +0 -62
- package/src/theia-plugins.ts +0 -11
- package/src/util/jaeger-client.d.ts +0 -105
- package/src/util/repeater.ts +0 -49
- package/src/util/safe-promise.ts +0 -26
- package/src/util/without.ts +0 -8
package/data/gitpod-schema.json
CHANGED
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://gitpod.io/gitpod
|
|
2
|
+
"$id": "https://gitpod.io/schemas/gitpod-schema.json",
|
|
3
3
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
4
|
"title": "Gitpod Config",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"properties": {
|
|
7
|
-
"ide": {
|
|
8
|
-
"type": "string",
|
|
9
|
-
"enum": [
|
|
10
|
-
"theia",
|
|
11
|
-
"code"
|
|
12
|
-
],
|
|
13
|
-
"default": "theia"
|
|
14
|
-
},
|
|
15
7
|
"ports": {
|
|
16
8
|
"type": "array",
|
|
17
9
|
"description": "List of exposed ports.",
|
|
@@ -42,12 +34,12 @@
|
|
|
42
34
|
"private",
|
|
43
35
|
"public"
|
|
44
36
|
],
|
|
45
|
-
"
|
|
37
|
+
"default": "private",
|
|
38
|
+
"description": "Whether the port visibility should be private or public. 'private' (default) will only allow users with workspace access to access the port. 'public' will allow everyone with the port URL to access the port."
|
|
46
39
|
},
|
|
47
40
|
"name": {
|
|
48
41
|
"type": "string",
|
|
49
|
-
"
|
|
50
|
-
"description": "Port name (deprecated)."
|
|
42
|
+
"description": "Port name."
|
|
51
43
|
},
|
|
52
44
|
"protocol": {
|
|
53
45
|
"type": "string",
|
|
@@ -58,6 +50,10 @@
|
|
|
58
50
|
],
|
|
59
51
|
"deprecationMessage": "The 'protocol' property is deprecated.",
|
|
60
52
|
"description": "The protocol to be used. (deprecated)"
|
|
53
|
+
},
|
|
54
|
+
"description": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"description": "A description to identify what is this port used for."
|
|
61
57
|
}
|
|
62
58
|
},
|
|
63
59
|
"additionalProperties": false
|
|
@@ -83,7 +79,8 @@
|
|
|
83
79
|
},
|
|
84
80
|
"prebuild": {
|
|
85
81
|
"type": "string",
|
|
86
|
-
"description": "A shell command to run after `before`. This command is executed only on during workspace prebuilds. This command is expected to terminate. If it fails, the workspace build fails."
|
|
82
|
+
"description": "A shell command to run after `before`. This command is executed only on during workspace prebuilds. This command is expected to terminate. If it fails, the workspace build fails.",
|
|
83
|
+
"deprecationMessage": "Deprecated. Please use `init` task instead. See https://www.gitpod.io/docs/config-start-tasks."
|
|
87
84
|
},
|
|
88
85
|
"command": {
|
|
89
86
|
"type": "string",
|
|
@@ -106,10 +103,8 @@
|
|
|
106
103
|
"openMode": {
|
|
107
104
|
"type": "string",
|
|
108
105
|
"enum": [
|
|
109
|
-
"split-top",
|
|
110
106
|
"split-left",
|
|
111
107
|
"split-right",
|
|
112
|
-
"split-bottom",
|
|
113
108
|
"tab-before",
|
|
114
109
|
"tab-after"
|
|
115
110
|
],
|
|
@@ -124,7 +119,8 @@
|
|
|
124
119
|
"object",
|
|
125
120
|
"string"
|
|
126
121
|
],
|
|
127
|
-
"description": "
|
|
122
|
+
"description": "The Docker image to run your workspace in.",
|
|
123
|
+
"default": "gitpod/workspace-full",
|
|
128
124
|
"required": [
|
|
129
125
|
"file"
|
|
130
126
|
],
|
|
@@ -140,18 +136,38 @@
|
|
|
140
136
|
},
|
|
141
137
|
"additionalProperties": false
|
|
142
138
|
},
|
|
139
|
+
"additionalRepositories": {
|
|
140
|
+
"type": "array",
|
|
141
|
+
"description": "List of additional repositories that are part of this project.",
|
|
142
|
+
"items": {
|
|
143
|
+
"type": "object",
|
|
144
|
+
"required": [
|
|
145
|
+
"url"
|
|
146
|
+
],
|
|
147
|
+
"properties": {
|
|
148
|
+
"url": {
|
|
149
|
+
"type": ["string"],
|
|
150
|
+
"description": "The url of the git repository to clone. Supports any context URLs."
|
|
151
|
+
},
|
|
152
|
+
"checkoutLocation": {
|
|
153
|
+
"type": "string",
|
|
154
|
+
"description": "Path to where the repository should be checked out relative to `/workspace`. Defaults to the simple repository name."
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"additionalProperties": false
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"mainConfiguration": {
|
|
161
|
+
"type": "string",
|
|
162
|
+
"description": "The main repository, containing the dev environment configuration."
|
|
163
|
+
},
|
|
143
164
|
"checkoutLocation": {
|
|
144
165
|
"type": "string",
|
|
145
|
-
"description": "Path to where the repository should be checked out."
|
|
166
|
+
"description": "Path to where the repository should be checked out relative to `/workspace`. Defaults to the simple repository name."
|
|
146
167
|
},
|
|
147
168
|
"workspaceLocation": {
|
|
148
169
|
"type": "string",
|
|
149
|
-
"description": "Path to where the IDE's workspace should be opened."
|
|
150
|
-
},
|
|
151
|
-
"privileged": {
|
|
152
|
-
"type": "boolean",
|
|
153
|
-
"deprecationMessage": "The 'privileged' property only works for privileged users.",
|
|
154
|
-
"description": "Whether the workspace is started in privileged mode."
|
|
170
|
+
"description": "Path to where the IDE's workspace should be opened. Supports vscode's `*.code-workspace` files."
|
|
155
171
|
},
|
|
156
172
|
"gitConfig": {
|
|
157
173
|
"type": [
|
|
@@ -193,6 +209,18 @@
|
|
|
193
209
|
"type": "boolean",
|
|
194
210
|
"description": "Add a Review in Gitpod badge to pull requests. Defaults to true."
|
|
195
211
|
},
|
|
212
|
+
"addCheck": {
|
|
213
|
+
"type": [
|
|
214
|
+
"boolean",
|
|
215
|
+
"string"
|
|
216
|
+
],
|
|
217
|
+
"enum": [
|
|
218
|
+
true,
|
|
219
|
+
false,
|
|
220
|
+
"prevent-merge-on-error"
|
|
221
|
+
],
|
|
222
|
+
"description": "Add a commit check to pull requests. Set to 'fail-on-error' if you want broken prebuilds to block merging. Defaults to true."
|
|
223
|
+
},
|
|
196
224
|
"addLabel": {
|
|
197
225
|
"type": [
|
|
198
226
|
"boolean",
|
|
@@ -218,7 +246,113 @@
|
|
|
218
246
|
}
|
|
219
247
|
}
|
|
220
248
|
}
|
|
249
|
+
},
|
|
250
|
+
"jetbrains": {
|
|
251
|
+
"type": "object",
|
|
252
|
+
"description": "Configure JetBrains integration",
|
|
253
|
+
"deprecationMessage": "The 'jetbrains' property is experimental.",
|
|
254
|
+
"additionalProperties": false,
|
|
255
|
+
"properties": {
|
|
256
|
+
"plugins": {
|
|
257
|
+
"type": "array",
|
|
258
|
+
"description": "List of plugins which should be installed for all JetBrains product for users of this workspace. From the JetBrains Marketplace page, find a page of the required plugin, select 'Versions' tab, click any version to copy pluginId (short name such as org.rust.lang) of the plugin you want to install.",
|
|
259
|
+
"items": {
|
|
260
|
+
"type": "string"
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
"intellij": {
|
|
264
|
+
"$ref": "#/definitions/jetbrainsProduct",
|
|
265
|
+
"description": "Configure IntelliJ integration"
|
|
266
|
+
},
|
|
267
|
+
"goland": {
|
|
268
|
+
"$ref": "#/definitions/jetbrainsProduct",
|
|
269
|
+
"description": "Configure GoLand integration"
|
|
270
|
+
},
|
|
271
|
+
"pycharm": {
|
|
272
|
+
"$ref": "#/definitions/jetbrainsProduct",
|
|
273
|
+
"description": "Configure PyCharm integration"
|
|
274
|
+
},
|
|
275
|
+
"phpstorm": {
|
|
276
|
+
"$ref": "#/definitions/jetbrainsProduct",
|
|
277
|
+
"description": "Configure PhpStorm integration"
|
|
278
|
+
},
|
|
279
|
+
"rubymine": {
|
|
280
|
+
"$ref": "#/definitions/jetbrainsProduct",
|
|
281
|
+
"description": "Configure RubyMine integration"
|
|
282
|
+
},
|
|
283
|
+
"webstorm": {
|
|
284
|
+
"$ref": "#/definitions/jetbrainsProduct",
|
|
285
|
+
"description": "Configure WebStorm integration"
|
|
286
|
+
},
|
|
287
|
+
"rider": {
|
|
288
|
+
"$ref": "#/definitions/jetbrainsProduct",
|
|
289
|
+
"description": "Configure Rider integration"
|
|
290
|
+
},
|
|
291
|
+
"clion": {
|
|
292
|
+
"$ref": "#/definitions/jetbrainsProduct",
|
|
293
|
+
"description": "Configure CLion integration"
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
"experimentalNetwork": {
|
|
298
|
+
"type": "boolean",
|
|
299
|
+
"deprecationMessage": "The 'experimentalNetwork' property is deprecated.",
|
|
300
|
+
"description": "Experimental network configuration in workspaces (deprecated). Enabled by default"
|
|
301
|
+
},
|
|
302
|
+
"coreDump": {
|
|
303
|
+
"type": "object",
|
|
304
|
+
"description": "Configure the default action of certain signals is to cause a process to terminate and produce a core dump file, a file containing an image of the process's memory at the time of termination. Disabled by default.",
|
|
305
|
+
"deprecationMessage": "The 'coreDump' property is experimental.",
|
|
306
|
+
"additionalProperties": false,
|
|
307
|
+
"properties": {
|
|
308
|
+
"enabled": {
|
|
309
|
+
"type": "boolean"
|
|
310
|
+
},
|
|
311
|
+
"softLimit": {
|
|
312
|
+
"type": "number",
|
|
313
|
+
"description": "upper limit on the size of the core dump file that will be produced if it receives a core dump signal"
|
|
314
|
+
},
|
|
315
|
+
"hardLimit": {
|
|
316
|
+
"type": "number",
|
|
317
|
+
"description": "the hard limit acts as a ceiling for the soft limit. For more details please check https://man7.org/linux/man-pages/man2/getrlimit.2.html"
|
|
318
|
+
}
|
|
319
|
+
}
|
|
221
320
|
}
|
|
222
321
|
},
|
|
223
|
-
"additionalProperties": false
|
|
224
|
-
|
|
322
|
+
"additionalProperties": false,
|
|
323
|
+
"definitions": {
|
|
324
|
+
"jetbrainsProduct": {
|
|
325
|
+
"type": "object",
|
|
326
|
+
"additionalProperties": false,
|
|
327
|
+
"properties": {
|
|
328
|
+
"plugins": {
|
|
329
|
+
"type": "array",
|
|
330
|
+
"description": "List of plugins which should be installed for users of this workspace. From the JetBrains Marketplace page, find a page of the required plugin, select 'Versions' tab, click any version to copy pluginId (short name such as org.rust.lang) of the plugin you want to install.",
|
|
331
|
+
"items": {
|
|
332
|
+
"type": "string"
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
"prebuilds": {
|
|
336
|
+
"type": "object",
|
|
337
|
+
"description": "Enable warming up of JetBrains backend in prebuilds.",
|
|
338
|
+
"additionalProperties": false,
|
|
339
|
+
"properties": {
|
|
340
|
+
"version": {
|
|
341
|
+
"type": "string",
|
|
342
|
+
"enum": [
|
|
343
|
+
"stable",
|
|
344
|
+
"latest",
|
|
345
|
+
"both"
|
|
346
|
+
],
|
|
347
|
+
"description": "Whether only stable, latest or both versions should be warmed up. Default is stable only."
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
"vmoptions": {
|
|
352
|
+
"type": "string",
|
|
353
|
+
"description": "Configure JVM options, for instance '-Xmx=4096m'."
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
|
|
3
|
+
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
|
+
*/
|
|
6
|
+
import { User } from "./protocol";
|
|
7
|
+
export interface AccountEntry {
|
|
8
|
+
uid: string;
|
|
9
|
+
userId: string;
|
|
10
|
+
/** [hours] */
|
|
11
|
+
amount: number;
|
|
12
|
+
/**
|
|
13
|
+
* credit: start of validity,
|
|
14
|
+
* session: end of (split-) session
|
|
15
|
+
*/
|
|
16
|
+
date: string;
|
|
17
|
+
/**
|
|
18
|
+
* debits (session, expiry, loss): relation to credit
|
|
19
|
+
*/
|
|
20
|
+
creditId?: string;
|
|
21
|
+
/**
|
|
22
|
+
* credit: end of validity
|
|
23
|
+
*/
|
|
24
|
+
expiryDate?: string;
|
|
25
|
+
kind: AccountEntryKind;
|
|
26
|
+
/**
|
|
27
|
+
* credit: amount - accounted debits
|
|
28
|
+
* [hours]
|
|
29
|
+
*/
|
|
30
|
+
remainingAmount?: number;
|
|
31
|
+
description?: object;
|
|
32
|
+
}
|
|
33
|
+
export declare namespace AccountEntry {
|
|
34
|
+
function create<T extends AccountEntry>(entry: Omit<T, "uid">): T;
|
|
35
|
+
}
|
|
36
|
+
export declare type DebitAccountEntryKind = "session" | "expiry" | "loss";
|
|
37
|
+
export declare type AccountEntryKind = "credit" | DebitAccountEntryKind | "carry" | "open";
|
|
38
|
+
export interface Credit extends AccountEntry {
|
|
39
|
+
kind: "credit";
|
|
40
|
+
expiryDate: string;
|
|
41
|
+
}
|
|
42
|
+
export declare type Debit = LossDebit | ExpiryDebit | SessionDebit;
|
|
43
|
+
export interface LossDebit extends AccountEntry {
|
|
44
|
+
kind: "loss";
|
|
45
|
+
}
|
|
46
|
+
export interface ExpiryDebit extends AccountEntry {
|
|
47
|
+
kind: "expiry";
|
|
48
|
+
creditId: undefined;
|
|
49
|
+
}
|
|
50
|
+
export interface SessionDebit extends AccountEntry {
|
|
51
|
+
kind: DebitAccountEntryKind;
|
|
52
|
+
creditId: string;
|
|
53
|
+
}
|
|
54
|
+
export declare type AccountEntryDescription = SessionDescription | CreditDescription;
|
|
55
|
+
export interface CreditDescription {
|
|
56
|
+
subscriptionId: string;
|
|
57
|
+
planId: string;
|
|
58
|
+
}
|
|
59
|
+
export declare namespace CreditDescription {
|
|
60
|
+
function is(obj: any): obj is CreditDescription;
|
|
61
|
+
}
|
|
62
|
+
export interface SessionDescription {
|
|
63
|
+
contextTitle: string;
|
|
64
|
+
contextUrl: string;
|
|
65
|
+
workspaceId: string;
|
|
66
|
+
workspaceInstanceId: string;
|
|
67
|
+
}
|
|
68
|
+
export declare namespace SessionDescription {
|
|
69
|
+
function is(obj: any): obj is SessionDescription;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* - The earliest subscription may start with User.creationDate
|
|
73
|
+
* - There may be multiple Gitpod subscriptions for a user at any given time
|
|
74
|
+
* - The dates form an interval of the form: [startDate, endDate)
|
|
75
|
+
* - Subscriptions that directly map to a Chargebee plan have their paymentReference set and MAY carry additional paymentData (UserPaidSubscription)
|
|
76
|
+
* - Subscriptions that are assigned to a user through a Team Subscription carry a teamSubscriptionSlotId (AssignedTeamSubscription)
|
|
77
|
+
*/
|
|
78
|
+
export interface Subscription {
|
|
79
|
+
uid: string;
|
|
80
|
+
userId: string;
|
|
81
|
+
startDate: string;
|
|
82
|
+
/** When the subscription will end (must be >= cancellationDate!) */
|
|
83
|
+
endDate?: string;
|
|
84
|
+
/** When the subscription was cancelled */
|
|
85
|
+
cancellationDate?: string;
|
|
86
|
+
/** Number of granted hours */
|
|
87
|
+
amount: number;
|
|
88
|
+
/** Number of granted hours for the first month: If this is set, use this value for the first month */
|
|
89
|
+
firstMonthAmount?: number;
|
|
90
|
+
planId?: string;
|
|
91
|
+
paymentReference?: string;
|
|
92
|
+
paymentData?: PaymentData;
|
|
93
|
+
teamSubscriptionSlotId?: string;
|
|
94
|
+
teamMembershipId?: string;
|
|
95
|
+
/** marks the subscription as deleted */
|
|
96
|
+
deleted?: boolean;
|
|
97
|
+
}
|
|
98
|
+
export interface SubscriptionAndUser extends Subscription {
|
|
99
|
+
user: User;
|
|
100
|
+
}
|
|
101
|
+
export interface PaymentData {
|
|
102
|
+
/** Marks the date as of which the _switch_ is effective. */
|
|
103
|
+
downgradeDate?: string;
|
|
104
|
+
/** Determines the new plan the dowgrade is targeted against (optional for backwards compatibility) */
|
|
105
|
+
newPlan?: string;
|
|
106
|
+
}
|
|
107
|
+
export interface UserPaidSubscription extends Subscription {
|
|
108
|
+
paymentReference: string;
|
|
109
|
+
paymentData?: PaymentData;
|
|
110
|
+
}
|
|
111
|
+
export declare namespace UserPaidSubscription {
|
|
112
|
+
function is(data: any): data is UserPaidSubscription;
|
|
113
|
+
}
|
|
114
|
+
export interface AssignedTeamSubscription extends Subscription {
|
|
115
|
+
teamSubscriptionSlotId: string;
|
|
116
|
+
}
|
|
117
|
+
export declare namespace AssignedTeamSubscription {
|
|
118
|
+
function is(data: any): data is AssignedTeamSubscription;
|
|
119
|
+
}
|
|
120
|
+
export interface AssignedTeamSubscription2 extends Subscription {
|
|
121
|
+
teamMembershipId: string;
|
|
122
|
+
}
|
|
123
|
+
export declare namespace AssignedTeamSubscription2 {
|
|
124
|
+
function is(data: any): data is AssignedTeamSubscription2;
|
|
125
|
+
}
|
|
126
|
+
export declare namespace Subscription {
|
|
127
|
+
function create(newSubscription: Omit<Subscription, "uid">): Subscription;
|
|
128
|
+
function cancelSubscription(s: Subscription, cancellationDate: string, endDate?: string): void;
|
|
129
|
+
function isSame(s1: Subscription | undefined, s2: Subscription | undefined): boolean;
|
|
130
|
+
function isActive(s: Subscription, date: string): boolean;
|
|
131
|
+
function isCancelled(s: Subscription, date: string): boolean;
|
|
132
|
+
function isDowngraded(s: Subscription): string | undefined;
|
|
133
|
+
function calculateCurrentPeriod(startDate: string, now: Date): {
|
|
134
|
+
startDate: string;
|
|
135
|
+
endDate: string;
|
|
136
|
+
};
|
|
137
|
+
function isOldTeamSubscription(s: Subscription): boolean;
|
|
138
|
+
function isTeamSubscription2(s: Subscription): boolean;
|
|
139
|
+
}
|
|
140
|
+
export declare type MaybeSubscription = Subscription | undefined;
|
|
141
|
+
export interface Period {
|
|
142
|
+
startDate: string;
|
|
143
|
+
endDate: string;
|
|
144
|
+
}
|
|
145
|
+
export declare type MaybePeriod = Period | undefined;
|
|
146
|
+
export declare type AccountEntryFixedPeriod = Omit<AccountEntry, "uid"> & {
|
|
147
|
+
expiryDate: string;
|
|
148
|
+
};
|
|
149
|
+
export interface AccountStatement extends Period {
|
|
150
|
+
userId: string;
|
|
151
|
+
/**
|
|
152
|
+
* The subscriptions that have not been cancelled yet at the end of the period
|
|
153
|
+
*/
|
|
154
|
+
subscriptions: Subscription[];
|
|
155
|
+
credits: Credit[];
|
|
156
|
+
debits: Debit[];
|
|
157
|
+
/** Remaining valid hours (accumulated from credits) */
|
|
158
|
+
remainingHours: RemainingHours;
|
|
159
|
+
}
|
|
160
|
+
export declare type RemainingHours = number | "unlimited";
|
|
161
|
+
export interface CreditAlert {
|
|
162
|
+
userId: string;
|
|
163
|
+
remainingUsageHours: number;
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=accounting-protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounting-protocol.d.ts","sourceRoot":"","sources":["../src/accounting-protocol.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAMlC,MAAM,WAAW,YAAY;IACzB,GAAG,EAAE,MAAM,CAAC;IAEZ,MAAM,EAAE,MAAM,CAAC;IAEf,cAAc;IACd,MAAM,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,IAAI,EAAE,gBAAgB,CAAC;IAEvB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AACD,yBAAiB,YAAY,CAAC;IAC1B,SAAgB,MAAM,CAAC,CAAC,SAAS,YAAY,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAIvE;CACJ;AAED,oBAAY,qBAAqB,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;AAClE,oBAAY,gBAAgB,GAAG,QAAQ,GAAG,qBAAqB,GAAG,OAAO,GAAG,MAAM,CAAC;AAEnF,MAAM,WAAW,MAAO,SAAQ,YAAY;IACxC,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACtB;AACD,oBAAY,KAAK,GAAG,SAAS,GAAG,WA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 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.Subscription = exports.AssignedTeamSubscription2 = exports.AssignedTeamSubscription = exports.UserPaidSubscription = exports.SessionDescription = exports.CreditDescription = exports.AccountEntry = void 0;
|
|
9
|
+
const uuid_1 = require("uuid");
|
|
10
|
+
const plans_1 = require("./plans");
|
|
11
|
+
const timeutil_1 = require("./util/timeutil");
|
|
12
|
+
var AccountEntry;
|
|
13
|
+
(function (AccountEntry) {
|
|
14
|
+
function create(entry) {
|
|
15
|
+
const result = entry;
|
|
16
|
+
result.uid = (0, uuid_1.v4)();
|
|
17
|
+
return result;
|
|
18
|
+
}
|
|
19
|
+
AccountEntry.create = create;
|
|
20
|
+
})(AccountEntry = exports.AccountEntry || (exports.AccountEntry = {}));
|
|
21
|
+
var CreditDescription;
|
|
22
|
+
(function (CreditDescription) {
|
|
23
|
+
function is(obj) {
|
|
24
|
+
return !!obj && obj.hasOwnProperty("subscriptionId") && obj.hasOwnProperty("planId");
|
|
25
|
+
}
|
|
26
|
+
CreditDescription.is = is;
|
|
27
|
+
})(CreditDescription = exports.CreditDescription || (exports.CreditDescription = {}));
|
|
28
|
+
var SessionDescription;
|
|
29
|
+
(function (SessionDescription) {
|
|
30
|
+
function is(obj) {
|
|
31
|
+
return (!!obj &&
|
|
32
|
+
obj.hasOwnProperty("contextTitle") &&
|
|
33
|
+
obj.hasOwnProperty("contextUrl") &&
|
|
34
|
+
obj.hasOwnProperty("workspaceId") &&
|
|
35
|
+
obj.hasOwnProperty("workspaceInstanceId"));
|
|
36
|
+
}
|
|
37
|
+
SessionDescription.is = is;
|
|
38
|
+
})(SessionDescription = exports.SessionDescription || (exports.SessionDescription = {}));
|
|
39
|
+
var UserPaidSubscription;
|
|
40
|
+
(function (UserPaidSubscription) {
|
|
41
|
+
function is(data) {
|
|
42
|
+
return !!data && data.hasOwnProperty("paymentReference");
|
|
43
|
+
}
|
|
44
|
+
UserPaidSubscription.is = is;
|
|
45
|
+
})(UserPaidSubscription = exports.UserPaidSubscription || (exports.UserPaidSubscription = {}));
|
|
46
|
+
var AssignedTeamSubscription;
|
|
47
|
+
(function (AssignedTeamSubscription) {
|
|
48
|
+
function is(data) {
|
|
49
|
+
return !!data && data.hasOwnProperty("teamSubscriptionSlotId");
|
|
50
|
+
}
|
|
51
|
+
AssignedTeamSubscription.is = is;
|
|
52
|
+
})(AssignedTeamSubscription = exports.AssignedTeamSubscription || (exports.AssignedTeamSubscription = {}));
|
|
53
|
+
var AssignedTeamSubscription2;
|
|
54
|
+
(function (AssignedTeamSubscription2) {
|
|
55
|
+
function is(data) {
|
|
56
|
+
return typeof data === "object" && data.hasOwnProperty("teamMembershipId");
|
|
57
|
+
}
|
|
58
|
+
AssignedTeamSubscription2.is = is;
|
|
59
|
+
})(AssignedTeamSubscription2 = exports.AssignedTeamSubscription2 || (exports.AssignedTeamSubscription2 = {}));
|
|
60
|
+
var Subscription;
|
|
61
|
+
(function (Subscription) {
|
|
62
|
+
function create(newSubscription) {
|
|
63
|
+
const subscription = newSubscription;
|
|
64
|
+
subscription.uid = (0, uuid_1.v4)();
|
|
65
|
+
return subscription;
|
|
66
|
+
}
|
|
67
|
+
Subscription.create = create;
|
|
68
|
+
function cancelSubscription(s, cancellationDate, endDate) {
|
|
69
|
+
s.endDate = endDate || cancellationDate;
|
|
70
|
+
s.cancellationDate = cancellationDate;
|
|
71
|
+
}
|
|
72
|
+
Subscription.cancelSubscription = cancelSubscription;
|
|
73
|
+
function isSame(s1, s2) {
|
|
74
|
+
return (!!s1 &&
|
|
75
|
+
!!s2 &&
|
|
76
|
+
s1.userId === s2.userId &&
|
|
77
|
+
s1.planId === s2.planId &&
|
|
78
|
+
s1.startDate === s2.startDate &&
|
|
79
|
+
s1.endDate === s2.endDate &&
|
|
80
|
+
s1.amount === s2.amount &&
|
|
81
|
+
s1.cancellationDate === s2.cancellationDate &&
|
|
82
|
+
s1.deleted === s2.deleted &&
|
|
83
|
+
((s1.paymentData === undefined && s2.paymentData === undefined) ||
|
|
84
|
+
(!!s1.paymentData &&
|
|
85
|
+
!!s2.paymentData &&
|
|
86
|
+
s1.paymentData.downgradeDate === s2.paymentData.downgradeDate &&
|
|
87
|
+
s1.paymentData.newPlan === s2.paymentData.newPlan)));
|
|
88
|
+
}
|
|
89
|
+
Subscription.isSame = isSame;
|
|
90
|
+
function isActive(s, date) {
|
|
91
|
+
return s.startDate <= date && (s.endDate === undefined || date < s.endDate);
|
|
92
|
+
}
|
|
93
|
+
Subscription.isActive = isActive;
|
|
94
|
+
function isCancelled(s, date) {
|
|
95
|
+
return (!!s.cancellationDate && s.cancellationDate < date) || (!!s.endDate && s.endDate < date); // This edge case is meant to handle bad data: If for whatever reason cancellationDate has not been set: treat endDate as such
|
|
96
|
+
}
|
|
97
|
+
Subscription.isCancelled = isCancelled;
|
|
98
|
+
function isDowngraded(s) {
|
|
99
|
+
return s.paymentData && s.paymentData.downgradeDate;
|
|
100
|
+
}
|
|
101
|
+
Subscription.isDowngraded = isDowngraded;
|
|
102
|
+
function calculateCurrentPeriod(startDate, now) {
|
|
103
|
+
let nextStartDate = startDate;
|
|
104
|
+
do {
|
|
105
|
+
startDate = nextStartDate;
|
|
106
|
+
nextStartDate = (0, timeutil_1.oneMonthLater)(startDate, new Date(startDate).getDate());
|
|
107
|
+
} while (nextStartDate < now.toISOString());
|
|
108
|
+
return { startDate, endDate: nextStartDate };
|
|
109
|
+
}
|
|
110
|
+
Subscription.calculateCurrentPeriod = calculateCurrentPeriod;
|
|
111
|
+
function isOldTeamSubscription(s) {
|
|
112
|
+
return plans_1.Plans.isTeamPlan(s.planId) && !s.teamMembershipId;
|
|
113
|
+
}
|
|
114
|
+
Subscription.isOldTeamSubscription = isOldTeamSubscription;
|
|
115
|
+
function isTeamSubscription2(s) {
|
|
116
|
+
return plans_1.Plans.isTeamPlan(s.planId) && !!s.teamMembershipId;
|
|
117
|
+
}
|
|
118
|
+
Subscription.isTeamSubscription2 = isTeamSubscription2;
|
|
119
|
+
})(Subscription = exports.Subscription || (exports.Subscription = {}));
|
|
120
|
+
//# sourceMappingURL=accounting-protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounting-protocol.js","sourceRoot":"","sources":["../src/accounting-protocol.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,+BAAoC;AACpC,mCAAgC;AAEhC,8CAAgD;AAuChD,IAAiB,YAAY,CAM5B;AAND,WAAiB,YAAY;IACzB,SAAgB,MAAM,CAAyB,KAAqB;QAChE,MAAM,MAAM,GAAG,KAAU,CAAC;QAC1B,MAAM,CAAC,GAAG,GAAG,IAAA,SAAM,GAAE,CAAC;QACtB,OAAO,MAAM,CAAC;IAClB,CAAC;IAJe,mBAAM,SAIrB,CAAA;AACL,CAAC,EANgB,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAM5B;AA2BD,IAAiB,iBAAiB,CAIjC;AAJD,WAAiB,iBAAiB;IAC9B,SAAgB,EAAE,CAAC,GAAQ;QACvB,OAAO,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,gBAAgB,CAAC,IAAI,GAAG,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IACzF,CAAC;IAFe,oBAAE,KAEjB,CAAA;AACL,CAAC,EAJgB,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAIjC;AAOD,IAAiB,kBAAkB,CAUlC;AAVD,WAAiB,kBAAkB;IAC/B,SAAgB,EAAE,CAAC,GAAQ;QACvB,OAAO,CACH,CAAC,CAAC,GAAG;YACL,GAAG,CAAC,cAAc,CAAC,cAAc,CAAC;YAClC,GAAG,CAAC,cAAc,CAAC,YAAY,C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AZ,oBAAY,KAAZ,oBAAY,QAqD5B"}
|
package/lib/admin-protocol.d.ts
CHANGED
|
@@ -1,22 +1,57 @@
|
|
|
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
|
import { User, Workspace, NamedWorkspaceFeatureFlag } from "./protocol";
|
|
7
|
-
import {
|
|
7
|
+
import { BlockedRepository } from "./blocked-repositories-protocol";
|
|
8
|
+
import { FindPrebuildsParams } from "./gitpod-service";
|
|
9
|
+
import { Project, Team, PrebuildWithStatus, TeamMemberInfo, TeamMemberRole } from "./teams-projects-protocol";
|
|
8
10
|
import { WorkspaceInstance, WorkspaceInstancePhase } from "./workspace-instance";
|
|
9
11
|
import { RoleOrPermission } from "./permission";
|
|
12
|
+
import { AccountStatement } from "./accounting-protocol";
|
|
13
|
+
import { BillingMode } from "./billing-mode";
|
|
14
|
+
import { CostCenterJSON, ListUsageRequest, ListUsageResponse } from "./usage";
|
|
15
|
+
import { InstallationAdminSettings, TelemetryData } from "./installation-admin-protocol";
|
|
10
16
|
export interface AdminServer {
|
|
11
17
|
adminGetUsers(req: AdminGetListRequest<User>): Promise<AdminGetListResult<User>>;
|
|
12
18
|
adminGetUser(id: string): Promise<User>;
|
|
13
19
|
adminBlockUser(req: AdminBlockUserRequest): Promise<User>;
|
|
20
|
+
adminDeleteUser(id: string): Promise<void>;
|
|
21
|
+
adminVerifyUser(id: string): Promise<User>;
|
|
14
22
|
adminModifyRoleOrPermission(req: AdminModifyRoleOrPermissionRequest): Promise<User>;
|
|
15
23
|
adminModifyPermanentWorkspaceFeatureFlag(req: AdminModifyPermanentWorkspaceFeatureFlagRequest): Promise<User>;
|
|
24
|
+
adminCreateBlockedRepository(urlRegexp: string, blockUser: boolean): Promise<BlockedRepository>;
|
|
25
|
+
adminDeleteBlockedRepository(id: number): Promise<void>;
|
|
26
|
+
adminGetBlockedRepositories(req: AdminGetListRequest<BlockedRepository>): Promise<AdminGetListResult<BlockedRepository>>;
|
|
27
|
+
adminGetTeamMembers(teamId: string): Promise<TeamMemberInfo[]>;
|
|
28
|
+
adminGetTeams(req: AdminGetListRequest<Team>): Promise<AdminGetListResult<Team>>;
|
|
29
|
+
adminGetTeamById(id: string): Promise<Team | undefined>;
|
|
30
|
+
adminSetTeamMemberRole(teamId: string, userId: string, role: TeamMemberRole): Promise<void>;
|
|
16
31
|
adminGetWorkspaces(req: AdminGetWorkspacesRequest): Promise<AdminGetListResult<WorkspaceAndInstance>>;
|
|
17
32
|
adminGetWorkspace(id: string): Promise<WorkspaceAndInstance>;
|
|
18
33
|
adminForceStopWorkspace(id: string): Promise<void>;
|
|
34
|
+
adminRestoreSoftDeletedWorkspace(id: string): Promise<void>;
|
|
35
|
+
adminGetProjectsBySearchTerm(req: AdminGetListRequest<Project>): Promise<AdminGetListResult<Project>>;
|
|
36
|
+
adminGetProjectById(id: string): Promise<Project | undefined>;
|
|
37
|
+
adminFindPrebuilds(params: FindPrebuildsParams): Promise<PrebuildWithStatus[]>;
|
|
19
38
|
adminSetLicense(key: string): Promise<void>;
|
|
39
|
+
adminGetAccountStatement(userId: string): Promise<AccountStatement>;
|
|
40
|
+
adminSetProfessionalOpenSource(userId: string, shouldGetProfOSS: boolean): Promise<void>;
|
|
41
|
+
adminIsStudent(userId: string): Promise<boolean>;
|
|
42
|
+
adminAddStudentEmailDomain(userId: string, domain: string): Promise<void>;
|
|
43
|
+
adminGrantExtraHours(userId: string, extraHours: number): Promise<void>;
|
|
44
|
+
adminGetBillingMode(attributionId: string): Promise<BillingMode>;
|
|
45
|
+
adminGetSettings(): Promise<InstallationAdminSettings>;
|
|
46
|
+
adminUpdateSettings(settings: InstallationAdminSettings): Promise<void>;
|
|
47
|
+
adminGetCostCenter(attributionId: string): Promise<CostCenterJSON | undefined>;
|
|
48
|
+
adminSetUsageLimit(attributionId: string, usageLimit: number): Promise<void>;
|
|
49
|
+
adminListUsage(req: ListUsageRequest): Promise<ListUsageResponse>;
|
|
50
|
+
adminAddUsageCreditNote(attributionId: string, credits: number, note: string): Promise<void>;
|
|
51
|
+
adminGetUsageBalance(attributionId: string): Promise<number>;
|
|
52
|
+
adminGetSettings(): Promise<InstallationAdminSettings>;
|
|
53
|
+
adminUpdateSettings(settings: InstallationAdminSettings): Promise<void>;
|
|
54
|
+
adminGetTelemetryData(): Promise<TelemetryData>;
|
|
20
55
|
}
|
|
21
56
|
export interface AdminGetListRequest<T> {
|
|
22
57
|
offset: number;
|
|
@@ -47,14 +82,24 @@ export interface AdminModifyPermanentWorkspaceFeatureFlagRequest {
|
|
|
47
82
|
add: boolean;
|
|
48
83
|
}[];
|
|
49
84
|
}
|
|
50
|
-
export interface WorkspaceAndInstance extends
|
|
85
|
+
export interface WorkspaceAndInstance extends Omit<Workspace, "id" | "creationTime">, Omit<WorkspaceInstance, "id" | "creationTime"> {
|
|
51
86
|
workspaceId: string;
|
|
52
87
|
workspaceCreationTime: string;
|
|
53
88
|
instanceId: string;
|
|
54
89
|
instanceCreationTime: string;
|
|
55
90
|
phase: WorkspaceInstancePhase;
|
|
56
91
|
}
|
|
57
|
-
export
|
|
58
|
-
|
|
92
|
+
export declare namespace WorkspaceAndInstance {
|
|
93
|
+
function toWorkspace(wai: WorkspaceAndInstance): Workspace;
|
|
94
|
+
function toInstance(wai: WorkspaceAndInstance): WorkspaceInstance | undefined;
|
|
59
95
|
}
|
|
96
|
+
export declare type AdminGetWorkspacesRequest = AdminGetListRequest<WorkspaceAndInstance> & AdminGetWorkspacesQuery;
|
|
97
|
+
/** The fields are meant to be used either OR (not combined) */
|
|
98
|
+
export declare type AdminGetWorkspacesQuery = {
|
|
99
|
+
/** we use this field in case we have a UUIDv4 and don't know whether it's an (old) workspace or instance id */
|
|
100
|
+
instanceIdOrWorkspaceId?: string;
|
|
101
|
+
instanceId?: string;
|
|
102
|
+
workspaceId?: string;
|
|
103
|
+
ownerId?: string;
|
|
104
|
+
};
|
|
60
105
|
//# sourceMappingURL=admin-protocol.d.ts.map
|