@gitpod/gitpod-protocol 0.1.5-wth-test.80 → 0.1.5-wv-add-image-builds-to-dashboard.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 +132 -5
- package/lib/accounting-protocol.d.ts +19 -11
- package/lib/accounting-protocol.d.ts.map +1 -1
- package/lib/accounting-protocol.js +35 -33
- package/lib/accounting-protocol.js.map +1 -1
- package/lib/admin-protocol.d.ts +19 -2
- package/lib/admin-protocol.d.ts.map +1 -1
- package/lib/admin-protocol.js +1 -1
- package/lib/admin-protocol.js.map +1 -1
- package/lib/analytics.d.ts +1 -1
- package/lib/analytics.d.ts.map +1 -1
- package/lib/analytics.js +1 -1
- package/lib/analytics.js.map +1 -1
- package/lib/attribution.d.ts +24 -0
- package/lib/attribution.d.ts.map +1 -0
- package/lib/attribution.js +54 -0
- package/lib/attribution.js.map +1 -0
- package/lib/auth.d.ts +1 -1
- package/lib/auth.d.ts.map +1 -1
- package/lib/auth.js +1 -1
- 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 +1 -2
- package/lib/context-url.d.ts.map +1 -1
- package/lib/context-url.js +5 -7
- package/lib/context-url.js.map +1 -1
- package/lib/context-url.spec.d.ts +1 -3
- package/lib/context-url.spec.d.ts.map +1 -1
- package/lib/context-url.spec.js +13 -26
- package/lib/context-url.spec.js.map +1 -1
- package/lib/encryption/container-module.d.ts +1 -1
- package/lib/encryption/container-module.d.ts.map +1 -1
- package/lib/encryption/container-module.js +2 -2
- package/lib/encryption/container-module.js.map +1 -1
- package/lib/encryption/encryption-engine.d.ts +1 -1
- package/lib/encryption/encryption-engine.d.ts.map +1 -1
- package/lib/encryption/encryption-engine.js +10 -10
- package/lib/encryption/encryption-engine.js.map +1 -1
- package/lib/encryption/encryption-engine.spec.d.ts +1 -1
- package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
- package/lib/encryption/encryption-engine.spec.js +3 -4
- package/lib/encryption/encryption-engine.spec.js.map +1 -1
- package/lib/encryption/encryption-service.d.ts +1 -1
- package/lib/encryption/encryption-service.d.ts.map +1 -1
- package/lib/encryption/encryption-service.js +2 -2
- package/lib/encryption/encryption-service.js.map +1 -1
- package/lib/encryption/key-provider.d.ts +1 -1
- package/lib/encryption/key-provider.d.ts.map +1 -1
- package/lib/encryption/key-provider.js +8 -10
- package/lib/encryption/key-provider.js.map +1 -1
- package/lib/env.d.ts +1 -6
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +2 -21
- 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/gitpod-file-parser.d.ts +1 -1
- package/lib/gitpod-file-parser.d.ts.map +1 -1
- package/lib/gitpod-file-parser.js +7 -7
- package/lib/gitpod-file-parser.js.map +1 -1
- package/lib/gitpod-file-parser.spec.d.ts +1 -1
- package/lib/gitpod-file-parser.spec.js +43 -40
- package/lib/gitpod-file-parser.spec.js.map +1 -1
- package/lib/gitpod-service.d.ts +70 -52
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +53 -34
- package/lib/gitpod-service.js.map +1 -1
- package/lib/headless-workspace-log.d.ts +2 -1
- package/lib/headless-workspace-log.d.ts.map +1 -1
- package/lib/headless-workspace-log.js +3 -2
- package/lib/headless-workspace-log.js.map +1 -1
- package/lib/ide-frontend-service.d.ts +2 -2
- package/lib/ide-frontend-service.js +1 -1
- package/lib/ide-protocol.d.ts +29 -8
- package/lib/ide-protocol.d.ts.map +1 -1
- package/lib/ide-protocol.js +11 -1
- package/lib/ide-protocol.js.map +1 -1
- package/lib/index.d.ts +17 -17
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/installation-admin-protocol.d.ts +4 -1
- package/lib/installation-admin-protocol.d.ts.map +1 -1
- package/lib/installation-admin-protocol.js +4 -3
- package/lib/installation-admin-protocol.js.map +1 -1
- package/lib/license-protocol.d.ts +8 -1
- package/lib/license-protocol.d.ts.map +1 -1
- package/lib/license-protocol.js +1 -1
- package/lib/license-protocol.js.map +1 -1
- package/lib/messaging/browser/connection.d.ts +1 -1
- package/lib/messaging/browser/connection.d.ts.map +1 -1
- package/lib/messaging/browser/connection.js +19 -19
- package/lib/messaging/browser/connection.js.map +1 -1
- package/lib/messaging/browser/window-connection.d.ts +5 -5
- package/lib/messaging/browser/window-connection.d.ts.map +1 -1
- package/lib/messaging/browser/window-connection.js +10 -7
- package/lib/messaging/browser/window-connection.js.map +1 -1
- package/lib/messaging/client-call-metrics.d.ts +5 -19
- package/lib/messaging/client-call-metrics.d.ts.map +1 -1
- package/lib/messaging/client-call-metrics.js +35 -23
- package/lib/messaging/client-call-metrics.js.map +1 -1
- package/lib/messaging/error.d.ts +10 -2
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +20 -4
- package/lib/messaging/error.js.map +1 -1
- package/lib/messaging/handler.d.ts.map +1 -1
- package/lib/messaging/handler.js +1 -1
- package/lib/messaging/node/connection.js +8 -8
- package/lib/messaging/node/connection.js.map +1 -1
- package/lib/messaging/proxy-factory.d.ts +1 -1
- package/lib/messaging/proxy-factory.d.ts.map +1 -1
- package/lib/messaging/proxy-factory.js +7 -9
- package/lib/messaging/proxy-factory.js.map +1 -1
- package/lib/oss-allowlist.d.ts +1 -1
- package/lib/oss-allowlist.js +1 -1
- package/lib/payment-protocol.d.ts +1 -1
- package/lib/payment-protocol.d.ts.map +1 -1
- package/lib/payment-protocol.js +2 -2
- package/lib/payment-protocol.js.map +1 -1
- package/lib/permission.d.ts +3 -3
- package/lib/permission.d.ts.map +1 -1
- package/lib/permission.js +13 -24
- package/lib/permission.js.map +1 -1
- package/lib/plans.d.ts +5 -4
- package/lib/plans.d.ts.map +1 -1
- package/lib/plans.js +211 -172
- package/lib/plans.js.map +1 -1
- package/lib/protocol.d.ts +166 -61
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +282 -106
- 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 +1 -1
- package/lib/snapshot-url.js +1 -1
- package/lib/snapshot-url.spec.d.ts +1 -1
- package/lib/snapshot-url.spec.js +1 -1
- package/lib/snapshot-url.spec.js.map +1 -1
- package/lib/team-subscription-protocol.d.ts +23 -4
- package/lib/team-subscription-protocol.d.ts.map +1 -1
- package/lib/team-subscription-protocol.js +21 -6
- package/lib/team-subscription-protocol.js.map +1 -1
- package/lib/teams-projects-protocol.d.ts +26 -6
- package/lib/teams-projects-protocol.d.ts.map +1 -1
- package/lib/teams-projects-protocol.js +2 -2
- package/lib/teams-projects-protocol.js.map +1 -1
- package/lib/typings/globals.d.ts +3 -3
- package/lib/typings/globals.d.ts.map +1 -1
- package/lib/typings/globals.js +1 -1
- 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 +1 -1
- package/lib/util/analytics.d.ts.map +1 -1
- package/lib/util/analytics.js +7 -7
- package/lib/util/analytics.js.map +1 -1
- package/lib/util/async-iterator.d.ts +1 -1
- package/lib/util/async-iterator.d.ts.map +1 -1
- package/lib/util/async-iterator.js +4 -4
- package/lib/util/async-iterator.js.map +1 -1
- package/lib/util/cancelable.d.ts +1 -1
- package/lib/util/cancelable.js +1 -1
- package/lib/util/cancelable.js.map +1 -1
- package/lib/util/date-time.d.ts +1 -1
- package/lib/util/date-time.js +7 -7
- 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 +1 -1
- package/lib/util/deep-partial.js +1 -1
- package/lib/util/deferred.d.ts +1 -1
- package/lib/util/deferred.js +1 -1
- package/lib/util/deferred.js.map +1 -1
- package/lib/util/disposable.d.ts.map +1 -1
- package/lib/util/disposable.js +2 -2
- package/lib/util/disposable.js.map +1 -1
- package/lib/util/event.d.ts.map +1 -1
- package/lib/util/event.js +5 -3
- package/lib/util/event.js.map +1 -1
- package/lib/util/garbage-collected-cache.d.ts +1 -1
- package/lib/util/garbage-collected-cache.d.ts.map +1 -1
- package/lib/util/garbage-collected-cache.js +7 -2
- package/lib/util/garbage-collected-cache.js.map +1 -1
- package/lib/util/generate-workspace-id.d.ts +5 -0
- package/lib/util/generate-workspace-id.d.ts.map +1 -1
- package/lib/util/generate-workspace-id.js +446 -442
- package/lib/util/generate-workspace-id.js.map +1 -1
- package/lib/util/generate-workspace-id.spec.d.ts +1 -1
- package/lib/util/generate-workspace-id.spec.js +19 -8
- package/lib/util/generate-workspace-id.spec.js.map +1 -1
- package/lib/util/gitpod-cookie.d.ts +2 -2
- package/lib/util/gitpod-cookie.d.ts.map +1 -1
- package/lib/util/gitpod-cookie.js +1 -4
- package/lib/util/gitpod-cookie.js.map +1 -1
- package/lib/util/gitpod-host-url.d.ts +6 -1
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +60 -33
- package/lib/util/gitpod-host-url.js.map +1 -1
- package/lib/util/gitpod-host-url.spec.d.ts +1 -1
- package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.spec.js +16 -6
- package/lib/util/gitpod-host-url.spec.js.map +1 -1
- package/lib/util/grpc.d.ts +21 -1
- package/lib/util/grpc.d.ts.map +1 -1
- package/lib/util/grpc.js +74 -2
- package/lib/util/grpc.js.map +1 -1
- package/lib/util/jaeger-client-types.d.ts +1 -1
- package/lib/util/jaeger-client-types.d.ts.map +1 -1
- package/lib/util/jaeger-client-types.js +1 -1
- package/lib/util/logging.d.ts +2 -2
- package/lib/util/logging.d.ts.map +1 -1
- package/lib/util/logging.js +32 -26
- 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 +1 -1
- package/lib/util/make-link.js +6 -6
- 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 +1 -1
- package/lib/util/parse-workspace-id.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.js +2 -3
- package/lib/util/parse-workspace-id.js.map +1 -1
- package/lib/util/parse-workspace-id.spec.d.ts +1 -1
- package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.spec.js +1 -1
- package/lib/util/parse-workspace-id.spec.js.map +1 -1
- package/lib/util/queue.d.ts +1 -1
- package/lib/util/queue.js +1 -1
- package/lib/util/queue.spec.d.ts +1 -1
- package/lib/util/queue.spec.js +10 -7
- package/lib/util/queue.spec.js.map +1 -1
- package/lib/util/repeat.d.ts +1 -1
- package/lib/util/repeat.js +1 -1
- package/lib/util/semaphore.d.ts +1 -1
- package/lib/util/semaphore.d.ts.map +1 -1
- package/lib/util/semaphore.js +1 -1
- package/lib/util/semaphore.js.map +1 -1
- package/lib/util/skip-if.d.ts +1 -1
- package/lib/util/skip-if.d.ts.map +1 -1
- package/lib/util/skip-if.js +1 -1
- package/lib/util/skip-if.js.map +1 -1
- package/lib/util/timeutil.d.ts +3 -1
- package/lib/util/timeutil.d.ts.map +1 -1
- package/lib/util/timeutil.js +16 -4
- package/lib/util/timeutil.js.map +1 -1
- package/lib/util/timeutil.spec.d.ts +3 -1
- package/lib/util/timeutil.spec.d.ts.map +1 -1
- package/lib/util/timeutil.spec.js +35 -1
- package/lib/util/timeutil.spec.js.map +1 -1
- package/lib/util/tracing.d.ts +7 -7
- package/lib/util/tracing.d.ts.map +1 -1
- package/lib/util/tracing.js +15 -17
- package/lib/util/tracing.js.map +1 -1
- package/lib/util/tracing.spec.d.ts +1 -1
- package/lib/util/tracing.spec.js +4 -4
- package/lib/util/tracing.spec.js.map +1 -1
- package/lib/util/workspace-port-authentication.d.ts +8 -8
- package/lib/util/workspace-port-authentication.d.ts.map +1 -1
- package/lib/util/workspace-port-authentication.js +9 -12
- 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 +13 -14
- package/lib/workspace-cluster.d.ts.map +1 -1
- package/lib/workspace-cluster.js +3 -5
- package/lib/workspace-cluster.js.map +1 -1
- package/lib/workspace-instance.d.ts +22 -4
- package/lib/workspace-instance.d.ts.map +1 -1
- package/lib/workspace-instance.js +1 -1
- package/lib/wsready.d.ts +8 -2
- package/lib/wsready.d.ts.map +1 -1
- package/lib/wsready.js +3 -3
- package/package.json +14 -6
- package/pkg-yarn.lock +10 -5
- package/provenance-bundle.jsonl +1 -1
- package/src/accounting-protocol.ts +67 -52
- package/src/admin-protocol.ts +48 -22
- package/src/analytics.ts +22 -22
- package/src/attribution.ts +63 -0
- package/src/auth.ts +3 -3
- package/src/billing-mode.ts +84 -0
- package/src/blocked-repositories-protocol.ts +13 -0
- package/src/context-url.spec.ts +18 -22
- package/src/context-url.ts +79 -79
- package/src/encryption/container-module.ts +3 -4
- package/src/encryption/encryption-engine.spec.ts +10 -9
- package/src/encryption/encryption-engine.ts +21 -17
- package/src/encryption/encryption-service.ts +5 -6
- package/src/encryption/key-provider.ts +17 -20
- package/src/env.ts +2 -25
- 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/gitpod-file-parser.spec.ts +56 -62
- package/src/gitpod-file-parser.ts +17 -18
- package/src/gitpod-service.ts +216 -140
- package/src/headless-workspace-log.ts +7 -5
- package/src/ide-frontend-service.ts +3 -3
- package/src/ide-protocol.ts +38 -10
- package/src/index.ts +17 -17
- package/src/installation-admin-protocol.ts +12 -9
- package/src/license-protocol.ts +13 -7
- package/src/messaging/browser/connection.ts +45 -47
- package/src/messaging/browser/window-connection.ts +40 -30
- package/src/messaging/client-call-metrics.ts +79 -82
- package/src/messaging/error.ts +30 -8
- package/src/messaging/handler.ts +6 -6
- package/src/messaging/node/connection.ts +8 -8
- package/src/messaging/proxy-factory.ts +23 -30
- package/src/oss-allowlist.ts +4 -4
- package/src/payment-protocol.ts +3 -3
- package/src/permission.ts +21 -32
- package/src/plans.ts +241 -190
- package/src/protocol.spec.ts +97 -0
- package/src/protocol.ts +524 -265
- package/src/snapshot-url.spec.ts +10 -8
- package/src/snapshot-url.ts +1 -1
- package/src/team-subscription-protocol.ts +60 -23
- package/src/teams-projects-protocol.ts +36 -12
- package/src/typings/globals.ts +5 -5
- package/src/usage.ts +85 -0
- package/src/util/analytics.ts +47 -43
- package/src/util/async-iterator.ts +5 -6
- package/src/util/cancelable.ts +4 -4
- package/src/util/date-time.ts +9 -9
- package/src/util/debug-app.ts +81 -0
- package/src/util/deep-partial.ts +1 -1
- package/src/util/deferred.ts +7 -7
- package/src/util/disposable.ts +3 -6
- package/src/util/event.ts +9 -11
- package/src/util/garbage-collected-cache.ts +9 -7
- package/src/util/generate-workspace-id.spec.ts +27 -17
- package/src/util/generate-workspace-id.ts +461 -455
- package/src/util/gitpod-cookie.ts +9 -10
- package/src/util/gitpod-host-url.spec.ts +41 -14
- package/src/util/gitpod-host-url.ts +69 -37
- package/src/util/grpc.ts +94 -2
- package/src/util/jaeger-client-types.ts +3 -3
- package/src/util/logging.spec.ts +23 -0
- package/src/util/logging.ts +61 -43
- package/src/util/make-link.ts +7 -8
- package/src/util/nice-grpc.ts +96 -0
- package/src/util/parse-workspace-id.spec.ts +18 -9
- package/src/util/parse-workspace-id.ts +6 -7
- package/src/util/queue.spec.ts +28 -26
- package/src/util/queue.ts +1 -1
- package/src/util/repeat.ts +2 -2
- package/src/util/semaphore.ts +5 -7
- package/src/util/skip-if.ts +10 -7
- package/src/util/timeutil.spec.ts +41 -15
- package/src/util/timeutil.ts +28 -12
- package/src/util/tracing.spec.ts +29 -24
- package/src/util/tracing.ts +55 -52
- package/src/util/workspace-port-authentication.ts +11 -14
- package/src/webhook-event.ts +55 -0
- package/src/workspace-class.ts +14 -0
- package/src/workspace-cluster.ts +25 -19
- package/src/workspace-instance.ts +67 -25
- package/src/wsready.ts +11 -4
- package/data/builtin-theia-plugins.json +0 -372
- package/lib/email-protocol.d.ts +0 -49
- package/lib/email-protocol.d.ts.map +0 -1
- package/lib/email-protocol.js +0 -28
- package/lib/email-protocol.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/src/email-protocol.ts +0 -66
- package/src/theia-plugins.ts +0 -11
package/src/plans.ts
CHANGED
|
@@ -1,46 +1,56 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
export type Currency =
|
|
7
|
+
export type Currency = "USD" | "EUR";
|
|
8
8
|
export namespace Currency {
|
|
9
9
|
export const getAll = (): Currency[] => {
|
|
10
|
-
return [
|
|
11
|
-
}
|
|
10
|
+
return ["USD", "EUR"];
|
|
11
|
+
};
|
|
12
12
|
export const getSymbol = (c: Currency) => {
|
|
13
|
-
return c ===
|
|
14
|
-
}
|
|
13
|
+
return c === "USD" ? "$" : "€";
|
|
14
|
+
};
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Different plans of the same type MAY have different prices ($/€, for example) but MUST have the same feature set.
|
|
19
19
|
*/
|
|
20
|
-
export type PlanType =
|
|
21
|
-
|
|
20
|
+
export type PlanType =
|
|
21
|
+
| "free"
|
|
22
|
+
| "free-50"
|
|
23
|
+
| "free-open-source"
|
|
24
|
+
| "student"
|
|
25
|
+
| "basic"
|
|
26
|
+
| "personal"
|
|
27
|
+
| "professional"
|
|
28
|
+
| "professional-new";
|
|
29
|
+
export type HoursPerMonthType = number | "unlimited";
|
|
22
30
|
export interface Plan {
|
|
23
|
-
chargebeeId: string
|
|
24
|
-
githubId?: number
|
|
25
|
-
githubPlanNumber?: number
|
|
31
|
+
chargebeeId: string;
|
|
32
|
+
githubId?: number;
|
|
33
|
+
githubPlanNumber?: number;
|
|
26
34
|
|
|
27
|
-
name: string
|
|
28
|
-
currency: Currency
|
|
35
|
+
name: string;
|
|
36
|
+
currency: Currency;
|
|
29
37
|
/** In full currencies (Euro, US Dollar, ...) */
|
|
30
|
-
pricePerMonth: number
|
|
31
|
-
hoursPerMonth: HoursPerMonthType
|
|
32
|
-
type: PlanType
|
|
33
|
-
team?: boolean
|
|
38
|
+
pricePerMonth: number;
|
|
39
|
+
hoursPerMonth: HoursPerMonthType;
|
|
40
|
+
type: PlanType;
|
|
41
|
+
team?: boolean;
|
|
34
42
|
}
|
|
35
43
|
export namespace Plan {
|
|
36
44
|
export const is = (o: any): o is Plan => {
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
return (
|
|
46
|
+
"chargebeeId" in o &&
|
|
47
|
+
"name" in o &&
|
|
48
|
+
"currency" in o &&
|
|
49
|
+
"pricePerMonth" in o &&
|
|
50
|
+
"hoursPerMonth" in o &&
|
|
51
|
+
"type" in o
|
|
52
|
+
);
|
|
53
|
+
};
|
|
44
54
|
}
|
|
45
55
|
|
|
46
56
|
export const MAX_PARALLEL_WORKSPACES = 16;
|
|
@@ -51,24 +61,24 @@ export interface Coupon {
|
|
|
51
61
|
}
|
|
52
62
|
export namespace Coupon {
|
|
53
63
|
export const is = (o: any): o is Coupon => {
|
|
54
|
-
return
|
|
55
|
-
}
|
|
64
|
+
return "id" in o;
|
|
65
|
+
};
|
|
56
66
|
}
|
|
57
67
|
export namespace Coupons {
|
|
58
68
|
export const INTERNAL_GITPOD_GHSP: Coupon = {
|
|
59
69
|
id: "INTERNAL_GITPOD_GHSP",
|
|
60
|
-
isGithubStudentCoupon: true
|
|
70
|
+
isGithubStudentCoupon: true,
|
|
61
71
|
};
|
|
62
72
|
export const INTERNAL_GITPOD_GHSP_2: Coupon = {
|
|
63
73
|
id: "INTERNAL_GITPOD_GHSP_2",
|
|
64
|
-
isGithubStudentCoupon: true
|
|
74
|
+
isGithubStudentCoupon: true,
|
|
65
75
|
};
|
|
66
76
|
export const GITHUBSTUDENTPACKFORFACULTY: Coupon = {
|
|
67
77
|
id: "GITHUBSTUDENTPACKFORFACULTY",
|
|
68
|
-
isGithubStudentCoupon: true
|
|
78
|
+
isGithubStudentCoupon: true,
|
|
69
79
|
};
|
|
70
80
|
export const isGithubStudentCoupon = (id: string): boolean | undefined => {
|
|
71
|
-
const c = getAllCoupons().find(ic => ic.id === id);
|
|
81
|
+
const c = getAllCoupons().find((ic) => ic.id === id);
|
|
72
82
|
if (!c) {
|
|
73
83
|
return undefined;
|
|
74
84
|
}
|
|
@@ -76,8 +86,8 @@ export namespace Coupons {
|
|
|
76
86
|
};
|
|
77
87
|
export const getAllCoupons = (): Coupon[] => {
|
|
78
88
|
return Object.keys(Coupons)
|
|
79
|
-
.map(k => (Coupons as any)[k])
|
|
80
|
-
.filter(a => typeof a ===
|
|
89
|
+
.map((k) => (Coupons as any)[k])
|
|
90
|
+
.filter((a) => typeof a === "object" && Coupon.is(a));
|
|
81
91
|
};
|
|
82
92
|
}
|
|
83
93
|
|
|
@@ -116,151 +126,151 @@ export namespace Plans {
|
|
|
116
126
|
* The old default plan (v1): 100h hours for public repos
|
|
117
127
|
*/
|
|
118
128
|
export const FREE: Plan = {
|
|
119
|
-
chargebeeId:
|
|
129
|
+
chargebeeId: "free",
|
|
120
130
|
githubId: 2034,
|
|
121
131
|
githubPlanNumber: 1,
|
|
122
132
|
|
|
123
|
-
type:
|
|
124
|
-
name:
|
|
125
|
-
currency:
|
|
133
|
+
type: "free",
|
|
134
|
+
name: "Free",
|
|
135
|
+
currency: "USD",
|
|
126
136
|
pricePerMonth: 0,
|
|
127
|
-
hoursPerMonth: 100
|
|
137
|
+
hoursPerMonth: 100,
|
|
128
138
|
};
|
|
129
139
|
|
|
130
140
|
/**
|
|
131
141
|
* The new default plan (v3): 50h hours for public repos
|
|
132
142
|
*/
|
|
133
143
|
export const FREE_50: Plan = {
|
|
134
|
-
chargebeeId:
|
|
144
|
+
chargebeeId: "free-50",
|
|
135
145
|
githubId: 4902,
|
|
136
146
|
githubPlanNumber: 5,
|
|
137
147
|
|
|
138
|
-
type:
|
|
139
|
-
name:
|
|
140
|
-
currency:
|
|
148
|
+
type: "free-50",
|
|
149
|
+
name: "Free",
|
|
150
|
+
currency: "USD",
|
|
141
151
|
pricePerMonth: 0,
|
|
142
|
-
hoursPerMonth: 50
|
|
152
|
+
hoursPerMonth: 50,
|
|
143
153
|
};
|
|
144
154
|
|
|
145
155
|
/**
|
|
146
156
|
* Users created after this date get the FREE_50 plan (v3) instead of the (old) FREE plan (v1)
|
|
147
157
|
*/
|
|
148
|
-
export const FREE_50_START_DATE =
|
|
158
|
+
export const FREE_50_START_DATE = "2019-12-19T00:00:00.000Z";
|
|
149
159
|
|
|
150
160
|
/**
|
|
151
161
|
* The 'Professional Open Source' plan was introduced to offer professional open-souce developers unlimited hours.
|
|
152
162
|
*/
|
|
153
163
|
export const FREE_OPEN_SOURCE: Plan = {
|
|
154
|
-
chargebeeId:
|
|
155
|
-
type:
|
|
156
|
-
name:
|
|
157
|
-
currency:
|
|
164
|
+
chargebeeId: "free-open-source",
|
|
165
|
+
type: "free-open-source",
|
|
166
|
+
name: "Professional Open Source",
|
|
167
|
+
currency: "USD",
|
|
158
168
|
pricePerMonth: 0,
|
|
159
|
-
hoursPerMonth:
|
|
169
|
+
hoursPerMonth: "unlimited",
|
|
160
170
|
};
|
|
161
171
|
|
|
162
172
|
/**
|
|
163
173
|
* The 'Student Unleashed' plans were introduced to give students access to the highly-priced unlimited plans.
|
|
164
174
|
*/
|
|
165
175
|
export const PROFESSIONAL_STUDENT_EUR: Plan = {
|
|
166
|
-
chargebeeId:
|
|
167
|
-
type:
|
|
168
|
-
name:
|
|
169
|
-
currency:
|
|
176
|
+
chargebeeId: "professional-student-eur",
|
|
177
|
+
type: "student",
|
|
178
|
+
name: "Student Unleashed",
|
|
179
|
+
currency: "EUR",
|
|
170
180
|
pricePerMonth: 8,
|
|
171
|
-
hoursPerMonth:
|
|
181
|
+
hoursPerMonth: "unlimited",
|
|
172
182
|
};
|
|
173
183
|
|
|
174
184
|
/**
|
|
175
185
|
* The 'Student Unleashed' plans were introduced to give students access to the highly-priced unlimited plans.
|
|
176
186
|
*/
|
|
177
187
|
export const PROFESSIONAL_STUDENT_USD: Plan = {
|
|
178
|
-
chargebeeId:
|
|
179
|
-
type:
|
|
180
|
-
name:
|
|
181
|
-
currency:
|
|
188
|
+
chargebeeId: "professional-student-usd",
|
|
189
|
+
type: "student",
|
|
190
|
+
name: "Student Unleashed",
|
|
191
|
+
currency: "USD",
|
|
182
192
|
pricePerMonth: 9,
|
|
183
|
-
hoursPerMonth:
|
|
193
|
+
hoursPerMonth: "unlimited",
|
|
184
194
|
};
|
|
185
195
|
|
|
186
196
|
/**
|
|
187
197
|
* The 'Student Unleashed' plans were introduced to give students access to the highly-priced unlimited plans.
|
|
188
198
|
*/
|
|
189
199
|
export const TEAM_PROFESSIONAL_STUDENT_EUR: Plan = {
|
|
190
|
-
chargebeeId:
|
|
191
|
-
type:
|
|
192
|
-
name:
|
|
200
|
+
chargebeeId: "team-professional-student-eur",
|
|
201
|
+
type: "student",
|
|
202
|
+
name: "Team Student Unleashed",
|
|
193
203
|
team: true,
|
|
194
|
-
currency:
|
|
204
|
+
currency: "EUR",
|
|
195
205
|
pricePerMonth: 8,
|
|
196
|
-
hoursPerMonth:
|
|
206
|
+
hoursPerMonth: "unlimited",
|
|
197
207
|
};
|
|
198
208
|
|
|
199
209
|
/**
|
|
200
210
|
* The 'Student Unleashed' plans were introduced to give students access to the highly-priced unlimited plans.
|
|
201
211
|
*/
|
|
202
212
|
export const TEAM_PROFESSIONAL_STUDENT_USD: Plan = {
|
|
203
|
-
chargebeeId:
|
|
204
|
-
type:
|
|
205
|
-
name:
|
|
213
|
+
chargebeeId: "team-professional-student-usd",
|
|
214
|
+
type: "student",
|
|
215
|
+
name: "Team Student Unleashed",
|
|
206
216
|
team: true,
|
|
207
|
-
currency:
|
|
217
|
+
currency: "USD",
|
|
208
218
|
pricePerMonth: 9,
|
|
209
|
-
hoursPerMonth:
|
|
219
|
+
hoursPerMonth: "unlimited",
|
|
210
220
|
};
|
|
211
221
|
|
|
212
222
|
/**
|
|
213
223
|
* The 'basic' plan was the original differentiator between FREE and Professional (v1) but got discarded soon.
|
|
214
224
|
*/
|
|
215
225
|
export const BASIC_EUR: Plan = {
|
|
216
|
-
chargebeeId:
|
|
217
|
-
type:
|
|
218
|
-
name:
|
|
219
|
-
currency:
|
|
226
|
+
chargebeeId: "basic-eur",
|
|
227
|
+
type: "basic",
|
|
228
|
+
name: "Standard",
|
|
229
|
+
currency: "EUR",
|
|
220
230
|
pricePerMonth: 17,
|
|
221
|
-
hoursPerMonth: 100
|
|
231
|
+
hoursPerMonth: 100,
|
|
222
232
|
};
|
|
223
233
|
|
|
224
234
|
/**
|
|
225
235
|
* The 'basic' plan was the original differentiator between FREE and Professional (v1) but got discarded soon.
|
|
226
236
|
*/
|
|
227
237
|
export const BASIC_USD: Plan = {
|
|
228
|
-
chargebeeId:
|
|
238
|
+
chargebeeId: "basic-usd",
|
|
229
239
|
githubId: 2035,
|
|
230
240
|
githubPlanNumber: 2,
|
|
231
241
|
|
|
232
|
-
type:
|
|
233
|
-
name:
|
|
234
|
-
currency:
|
|
242
|
+
type: "basic",
|
|
243
|
+
name: "Standard",
|
|
244
|
+
currency: "USD",
|
|
235
245
|
pricePerMonth: 19,
|
|
236
|
-
hoursPerMonth: 100
|
|
246
|
+
hoursPerMonth: 100,
|
|
237
247
|
};
|
|
238
248
|
|
|
239
249
|
/**
|
|
240
250
|
* The 'personal' plan was introduced to superseed the 'basic' plan (introduced with v2) to be more attractive to hobbyists.
|
|
241
251
|
*/
|
|
242
252
|
export const PERSONAL_EUR: Plan = {
|
|
243
|
-
chargebeeId:
|
|
244
|
-
type:
|
|
245
|
-
name:
|
|
246
|
-
currency:
|
|
253
|
+
chargebeeId: "personal-eur",
|
|
254
|
+
type: "personal",
|
|
255
|
+
name: "Personal",
|
|
256
|
+
currency: "EUR",
|
|
247
257
|
pricePerMonth: 8,
|
|
248
|
-
hoursPerMonth: 100
|
|
258
|
+
hoursPerMonth: 100,
|
|
249
259
|
};
|
|
250
260
|
|
|
251
261
|
/**
|
|
252
262
|
* The 'personal' plan was introduced to superseed the 'basic' plan (introduced with v2) to be more attractive to hobbyists.
|
|
253
263
|
*/
|
|
254
264
|
export const PERSONAL_USD: Plan = {
|
|
255
|
-
chargebeeId:
|
|
265
|
+
chargebeeId: "personal-usd",
|
|
256
266
|
githubId: 2274,
|
|
257
267
|
githubPlanNumber: 4,
|
|
258
268
|
|
|
259
|
-
type:
|
|
260
|
-
name:
|
|
261
|
-
currency:
|
|
269
|
+
type: "personal",
|
|
270
|
+
name: "Personal",
|
|
271
|
+
currency: "USD",
|
|
262
272
|
pricePerMonth: 9,
|
|
263
|
-
hoursPerMonth: 100
|
|
273
|
+
hoursPerMonth: 100,
|
|
264
274
|
};
|
|
265
275
|
|
|
266
276
|
/**
|
|
@@ -268,12 +278,12 @@ export namespace Plans {
|
|
|
268
278
|
* Unleashed (39$/35€) on the right.
|
|
269
279
|
*/
|
|
270
280
|
export const PROFESSIONAL_NEW_EUR: Plan = {
|
|
271
|
-
chargebeeId:
|
|
272
|
-
type:
|
|
273
|
-
name:
|
|
274
|
-
currency:
|
|
281
|
+
chargebeeId: "professional-new-eur",
|
|
282
|
+
type: "professional-new",
|
|
283
|
+
name: "Professional",
|
|
284
|
+
currency: "EUR",
|
|
275
285
|
pricePerMonth: 23,
|
|
276
|
-
hoursPerMonth:
|
|
286
|
+
hoursPerMonth: "unlimited",
|
|
277
287
|
};
|
|
278
288
|
|
|
279
289
|
/**
|
|
@@ -281,12 +291,12 @@ export namespace Plans {
|
|
|
281
291
|
* Unleashed (39$/35€) on the right.
|
|
282
292
|
*/
|
|
283
293
|
export const PROFESSIONAL_NEW_USD: Plan = {
|
|
284
|
-
chargebeeId:
|
|
285
|
-
type:
|
|
286
|
-
name:
|
|
287
|
-
currency:
|
|
294
|
+
chargebeeId: "professional-new-usd",
|
|
295
|
+
type: "professional-new",
|
|
296
|
+
name: "Professional",
|
|
297
|
+
currency: "USD",
|
|
288
298
|
pricePerMonth: 25,
|
|
289
|
-
hoursPerMonth:
|
|
299
|
+
hoursPerMonth: "unlimited",
|
|
290
300
|
};
|
|
291
301
|
|
|
292
302
|
/**
|
|
@@ -294,13 +304,13 @@ export namespace Plans {
|
|
|
294
304
|
* Unleashed (39$/35€) on the right.
|
|
295
305
|
*/
|
|
296
306
|
export const TEAM_PROFESSIONAL_NEW_EUR: Plan = {
|
|
297
|
-
chargebeeId:
|
|
298
|
-
type:
|
|
299
|
-
name:
|
|
300
|
-
currency:
|
|
307
|
+
chargebeeId: "team-professional-new-eur",
|
|
308
|
+
type: "professional-new",
|
|
309
|
+
name: "Team Professional",
|
|
310
|
+
currency: "EUR",
|
|
301
311
|
team: true,
|
|
302
312
|
pricePerMonth: 23,
|
|
303
|
-
hoursPerMonth:
|
|
313
|
+
hoursPerMonth: "unlimited",
|
|
304
314
|
};
|
|
305
315
|
|
|
306
316
|
/**
|
|
@@ -308,13 +318,13 @@ export namespace Plans {
|
|
|
308
318
|
* Unleashed (39$/35€) on the right.
|
|
309
319
|
*/
|
|
310
320
|
export const TEAM_PROFESSIONAL_NEW_USD: Plan = {
|
|
311
|
-
chargebeeId:
|
|
312
|
-
type:
|
|
313
|
-
name:
|
|
314
|
-
currency:
|
|
321
|
+
chargebeeId: "team-professional-new-usd",
|
|
322
|
+
type: "professional-new",
|
|
323
|
+
name: "Team Professional",
|
|
324
|
+
currency: "USD",
|
|
315
325
|
team: true,
|
|
316
326
|
pricePerMonth: 25,
|
|
317
|
-
hoursPerMonth:
|
|
327
|
+
hoursPerMonth: "unlimited",
|
|
318
328
|
};
|
|
319
329
|
|
|
320
330
|
/**
|
|
@@ -322,12 +332,12 @@ export namespace Plans {
|
|
|
322
332
|
* It was originally introduced as 'Professional', and we cannot update the ids, so it stays that way in the code.
|
|
323
333
|
*/
|
|
324
334
|
export const PROFESSIONAL_EUR: Plan = {
|
|
325
|
-
chargebeeId:
|
|
326
|
-
type:
|
|
327
|
-
name:
|
|
328
|
-
currency:
|
|
335
|
+
chargebeeId: "professional-eur",
|
|
336
|
+
type: "professional",
|
|
337
|
+
name: "Unleashed",
|
|
338
|
+
currency: "EUR",
|
|
329
339
|
pricePerMonth: 35,
|
|
330
|
-
hoursPerMonth:
|
|
340
|
+
hoursPerMonth: "unlimited",
|
|
331
341
|
};
|
|
332
342
|
|
|
333
343
|
/**
|
|
@@ -335,15 +345,15 @@ export namespace Plans {
|
|
|
335
345
|
* It was originally introduced as 'Professional', and we cannot update the ids, so it stays that way in the code.
|
|
336
346
|
*/
|
|
337
347
|
export const PROFESSIONAL_USD: Plan = {
|
|
338
|
-
chargebeeId:
|
|
348
|
+
chargebeeId: "professional-usd",
|
|
339
349
|
githubId: 2036,
|
|
340
350
|
githubPlanNumber: 3,
|
|
341
351
|
|
|
342
|
-
type:
|
|
343
|
-
name:
|
|
344
|
-
currency:
|
|
352
|
+
type: "professional",
|
|
353
|
+
name: "Unleashed",
|
|
354
|
+
currency: "USD",
|
|
345
355
|
pricePerMonth: 39,
|
|
346
|
-
hoursPerMonth:
|
|
356
|
+
hoursPerMonth: "unlimited",
|
|
347
357
|
};
|
|
348
358
|
|
|
349
359
|
/**
|
|
@@ -351,13 +361,13 @@ export namespace Plans {
|
|
|
351
361
|
* It was originally introduced as 'Professional', and we cannot update the ids, so it stays that way in the code.
|
|
352
362
|
*/
|
|
353
363
|
export const TEAM_PROFESSIONAL_USD: Plan = {
|
|
354
|
-
chargebeeId:
|
|
355
|
-
type:
|
|
356
|
-
name:
|
|
357
|
-
currency:
|
|
364
|
+
chargebeeId: "team-professional-usd",
|
|
365
|
+
type: "professional",
|
|
366
|
+
name: "Team Unleashed",
|
|
367
|
+
currency: "USD",
|
|
358
368
|
team: true,
|
|
359
369
|
pricePerMonth: 39,
|
|
360
|
-
hoursPerMonth:
|
|
370
|
+
hoursPerMonth: "unlimited",
|
|
361
371
|
};
|
|
362
372
|
|
|
363
373
|
/**
|
|
@@ -365,22 +375,21 @@ export namespace Plans {
|
|
|
365
375
|
* It was originally introduced as 'Professional', and we cannot update the ids, so it stays that way in the code.
|
|
366
376
|
*/
|
|
367
377
|
export const TEAM_PROFESSIONAL_EUR: Plan = {
|
|
368
|
-
chargebeeId:
|
|
369
|
-
type:
|
|
370
|
-
name:
|
|
371
|
-
currency:
|
|
378
|
+
chargebeeId: "team-professional-eur",
|
|
379
|
+
type: "professional",
|
|
380
|
+
name: "Team Unleashed",
|
|
381
|
+
currency: "EUR",
|
|
372
382
|
team: true,
|
|
373
383
|
pricePerMonth: 35,
|
|
374
|
-
hoursPerMonth:
|
|
384
|
+
hoursPerMonth: "unlimited",
|
|
375
385
|
};
|
|
376
386
|
|
|
377
387
|
const getAllPlans = (): Plan[] => {
|
|
378
388
|
return Object.keys(Plans)
|
|
379
|
-
.map(k => (Plans as any)[k])
|
|
380
|
-
.filter(a => typeof a ===
|
|
389
|
+
.map((k) => (Plans as any)[k])
|
|
390
|
+
.filter((a) => typeof a === "object" && Plan.is(a));
|
|
381
391
|
};
|
|
382
392
|
|
|
383
|
-
|
|
384
393
|
/**
|
|
385
394
|
* This function returns all individual plans that might be active (= we have subscriptions for) at the moment
|
|
386
395
|
*/
|
|
@@ -393,67 +402,71 @@ export namespace Plans {
|
|
|
393
402
|
Plans.PROFESSIONAL_NEW_EUR,
|
|
394
403
|
Plans.PROFESSIONAL_NEW_USD,
|
|
395
404
|
Plans.PROFESSIONAL_EUR,
|
|
396
|
-
Plans.PROFESSIONAL_USD
|
|
405
|
+
Plans.PROFESSIONAL_USD,
|
|
397
406
|
];
|
|
398
|
-
return [
|
|
399
|
-
|
|
400
|
-
Plans.FREE_50,
|
|
401
|
-
Plans.FREE_OPEN_SOURCE,
|
|
402
|
-
...availablePaidPlans.filter(p => p.currency)
|
|
403
|
-
]
|
|
404
|
-
};
|
|
407
|
+
return [Plans.FREE, Plans.FREE_50, Plans.FREE_OPEN_SOURCE, ...availablePaidPlans.filter((p) => p.currency)];
|
|
408
|
+
}
|
|
405
409
|
|
|
406
410
|
export const getAvailableTeamPlans = (currency?: Currency): Plan[] => {
|
|
407
|
-
const teamPlans = getAllPlans().filter(p => !!p.team);
|
|
408
|
-
return currency ? teamPlans.filter(p => p.currency === currency) : teamPlans;
|
|
411
|
+
const teamPlans = getAllPlans().filter((p) => !!p.team);
|
|
412
|
+
return currency ? teamPlans.filter((p) => p.currency === currency) : teamPlans;
|
|
409
413
|
};
|
|
410
414
|
|
|
411
415
|
export function getById(id: string | undefined): Plan | undefined {
|
|
412
416
|
if (id === undefined) {
|
|
413
417
|
return undefined;
|
|
414
418
|
}
|
|
415
|
-
return getAllPlans()
|
|
416
|
-
|
|
417
|
-
};
|
|
419
|
+
return getAllPlans().find((p) => p.chargebeeId === id) || undefined;
|
|
420
|
+
}
|
|
418
421
|
|
|
419
422
|
export function getByTypeAndCurrency(type: PlanType, currency: Currency): Plan | undefined {
|
|
420
423
|
return getAllPlans()
|
|
421
|
-
.filter(p => p.type)
|
|
422
|
-
.find(p => p.currency === currency);
|
|
424
|
+
.filter((p) => p.type)
|
|
425
|
+
.find((p) => p.currency === currency);
|
|
423
426
|
}
|
|
424
427
|
|
|
425
428
|
export function getProPlan(currency: Currency): Plan {
|
|
426
429
|
switch (currency) {
|
|
427
|
-
case "EUR":
|
|
428
|
-
|
|
430
|
+
case "EUR":
|
|
431
|
+
return Plans.PROFESSIONAL_EUR;
|
|
432
|
+
case "USD":
|
|
433
|
+
return Plans.PROFESSIONAL_USD;
|
|
429
434
|
}
|
|
430
435
|
}
|
|
431
436
|
|
|
432
437
|
export function getNewProPlan(currency: Currency): Plan {
|
|
433
438
|
switch (currency) {
|
|
434
|
-
case "EUR":
|
|
435
|
-
|
|
439
|
+
case "EUR":
|
|
440
|
+
return Plans.PROFESSIONAL_NEW_EUR;
|
|
441
|
+
case "USD":
|
|
442
|
+
return Plans.PROFESSIONAL_NEW_USD;
|
|
436
443
|
}
|
|
437
444
|
}
|
|
438
445
|
|
|
439
446
|
export function getStudentProPlan(currency: Currency): Plan {
|
|
440
447
|
switch (currency) {
|
|
441
|
-
case "EUR":
|
|
442
|
-
|
|
448
|
+
case "EUR":
|
|
449
|
+
return Plans.PROFESSIONAL_STUDENT_EUR;
|
|
450
|
+
case "USD":
|
|
451
|
+
return Plans.PROFESSIONAL_STUDENT_USD;
|
|
443
452
|
}
|
|
444
453
|
}
|
|
445
454
|
|
|
446
455
|
export function getBasicPlan(currency: Currency): Plan {
|
|
447
456
|
switch (currency) {
|
|
448
|
-
case "EUR":
|
|
449
|
-
|
|
457
|
+
case "EUR":
|
|
458
|
+
return Plans.BASIC_EUR;
|
|
459
|
+
case "USD":
|
|
460
|
+
return Plans.BASIC_USD;
|
|
450
461
|
}
|
|
451
462
|
}
|
|
452
463
|
|
|
453
464
|
export function getPersonalPlan(currency: Currency): Plan {
|
|
454
465
|
switch (currency) {
|
|
455
|
-
case "EUR":
|
|
456
|
-
|
|
466
|
+
case "EUR":
|
|
467
|
+
return Plans.PERSONAL_EUR;
|
|
468
|
+
case "USD":
|
|
469
|
+
return Plans.PERSONAL_USD;
|
|
457
470
|
}
|
|
458
471
|
}
|
|
459
472
|
|
|
@@ -462,9 +475,15 @@ export namespace Plans {
|
|
|
462
475
|
}
|
|
463
476
|
|
|
464
477
|
export function isFreePlan(chargebeeId: string | undefined): boolean {
|
|
465
|
-
return
|
|
466
|
-
|
|
467
|
-
|
|
478
|
+
return (
|
|
479
|
+
chargebeeId === Plans.FREE.chargebeeId ||
|
|
480
|
+
chargebeeId === Plans.FREE_50.chargebeeId ||
|
|
481
|
+
chargebeeId === Plans.FREE_OPEN_SOURCE.chargebeeId
|
|
482
|
+
);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
export function isFreeTier(chargebeeId: string | undefined): boolean {
|
|
486
|
+
return chargebeeId === Plans.FREE.chargebeeId || chargebeeId === Plans.FREE_50.chargebeeId;
|
|
468
487
|
}
|
|
469
488
|
|
|
470
489
|
export function isFreeNonTransientPlan(chargebeeId: string | undefined): boolean {
|
|
@@ -472,7 +491,7 @@ export namespace Plans {
|
|
|
472
491
|
}
|
|
473
492
|
|
|
474
493
|
export function getHoursPerMonth(plan: Plan): number {
|
|
475
|
-
return plan.hoursPerMonth ==
|
|
494
|
+
return plan.hoursPerMonth == "unlimited" ? ABSOLUTE_MAX_USAGE : plan.hoursPerMonth;
|
|
476
495
|
}
|
|
477
496
|
|
|
478
497
|
/**
|
|
@@ -504,7 +523,6 @@ export namespace Plans {
|
|
|
504
523
|
return DEFAULT;
|
|
505
524
|
}
|
|
506
525
|
|
|
507
|
-
|
|
508
526
|
/**
|
|
509
527
|
* This declares the plan structure we have in Gitpod: All entries in a sub-array have the same arity in this structure.
|
|
510
528
|
* This is used to impose a partial order on plan types (cmp. compareTypes(...)).
|
|
@@ -515,7 +533,7 @@ export namespace Plans {
|
|
|
515
533
|
["free-50", "free", "free-open-source"],
|
|
516
534
|
["personal", "basic"],
|
|
517
535
|
["professional-new"],
|
|
518
|
-
["professional", "student"]
|
|
536
|
+
["professional", "student"],
|
|
519
537
|
];
|
|
520
538
|
|
|
521
539
|
function getPlanTypeArity(type: PlanType) {
|
|
@@ -571,60 +589,93 @@ export namespace Plans {
|
|
|
571
589
|
export const getFeaturesFor = (p: Plan): Feature[] => {
|
|
572
590
|
switch (p.type) {
|
|
573
591
|
case "free":
|
|
574
|
-
return [
|
|
575
|
-
{ title: 'Public repositories' }
|
|
576
|
-
];
|
|
592
|
+
return [{ title: "Public repositories" }];
|
|
577
593
|
|
|
578
594
|
case "free-50":
|
|
579
|
-
return [
|
|
580
|
-
{ title: 'Public repositories' }
|
|
581
|
-
];
|
|
595
|
+
return [{ title: "Public repositories" }];
|
|
582
596
|
|
|
583
597
|
case "free-open-source":
|
|
584
|
-
return [
|
|
585
|
-
{ title: 'Public repositories' },
|
|
586
|
-
];
|
|
598
|
+
return [{ title: "Public repositories" }];
|
|
587
599
|
|
|
588
600
|
case "student":
|
|
589
601
|
return [
|
|
590
|
-
{ title:
|
|
591
|
-
{
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
602
|
+
{ title: "Private & Public repos" },
|
|
603
|
+
{
|
|
604
|
+
title: `${Plans.getParallelWorkspaces(p)} Parallel Workspaces`,
|
|
605
|
+
tooltip: "The number of workspaces running at the same time",
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
title: "Team Manageable",
|
|
609
|
+
link: "/teams/",
|
|
610
|
+
tooltip: "Setup Gitpod for an entire Team with a single invoice and credit card",
|
|
611
|
+
},
|
|
612
|
+
{ title: "1h Timeout", tooltip: "Workspaces without user activity are stopped after 1 hour" },
|
|
613
|
+
{
|
|
614
|
+
title: "3h Timeout Boost",
|
|
615
|
+
tooltip: "You can manually boost the timeout to 3 hours within a running workspace",
|
|
616
|
+
},
|
|
595
617
|
];
|
|
596
618
|
|
|
597
619
|
case "basic":
|
|
598
620
|
return [
|
|
599
|
-
{ title:
|
|
600
|
-
{
|
|
621
|
+
{ title: "Private & Public repos" },
|
|
622
|
+
{
|
|
623
|
+
title: `${Plans.getParallelWorkspaces(p)} Parallel Workspaces`,
|
|
624
|
+
tooltip: "The number of workspaces running at the same time.",
|
|
625
|
+
},
|
|
601
626
|
];
|
|
602
627
|
|
|
603
628
|
// Personal
|
|
604
629
|
case "personal":
|
|
605
630
|
return [
|
|
606
|
-
{ title:
|
|
607
|
-
{
|
|
608
|
-
|
|
631
|
+
{ title: "Private & Public repos" },
|
|
632
|
+
{
|
|
633
|
+
title: `${Plans.getParallelWorkspaces(p)} Parallel Workspaces`,
|
|
634
|
+
tooltip: "The number of workspaces running at the same time",
|
|
635
|
+
},
|
|
636
|
+
{
|
|
637
|
+
title: "30min Timeout",
|
|
638
|
+
tooltip: "Workspaces without user activity are stopped after 30 minutes",
|
|
639
|
+
},
|
|
609
640
|
];
|
|
610
641
|
|
|
611
642
|
// Professional
|
|
612
643
|
case "professional-new":
|
|
613
644
|
return [
|
|
614
|
-
{ title:
|
|
615
|
-
{
|
|
616
|
-
|
|
617
|
-
|
|
645
|
+
{ title: "Private & Public repos" },
|
|
646
|
+
{
|
|
647
|
+
title: `${Plans.getParallelWorkspaces(p)} Parallel Workspaces`,
|
|
648
|
+
tooltip: "The number of workspaces running at the same time",
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
title: "Team Manageable",
|
|
652
|
+
link: "/teams/",
|
|
653
|
+
tooltip: "Setup Gitpod for an entire Team with a single invoice and credit card",
|
|
654
|
+
},
|
|
655
|
+
{
|
|
656
|
+
title: "30min Timeout",
|
|
657
|
+
tooltip: "Workspaces without user activity are stopped after 30 minutes",
|
|
658
|
+
},
|
|
618
659
|
];
|
|
619
660
|
|
|
620
661
|
// Unleashed
|
|
621
662
|
case "professional":
|
|
622
663
|
return [
|
|
623
|
-
{ title:
|
|
624
|
-
{
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
664
|
+
{ title: "Private & Public repos" },
|
|
665
|
+
{
|
|
666
|
+
title: `${Plans.getParallelWorkspaces(p)} Parallel Workspaces`,
|
|
667
|
+
tooltip: "The number of workspaces running at the same time",
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
title: "Team Manageable",
|
|
671
|
+
link: "/teams/",
|
|
672
|
+
tooltip: "Setup Gitpod for an entire Team with a single invoice and credit card",
|
|
673
|
+
},
|
|
674
|
+
{ title: "1h Timeout", tooltip: "Workspaces without user activity are stopped after 1 hour" },
|
|
675
|
+
{
|
|
676
|
+
title: "3h Timeout Boost",
|
|
677
|
+
tooltip: "You can manually boost the timeout to 3 hours within a running workspace",
|
|
678
|
+
},
|
|
628
679
|
];
|
|
629
680
|
}
|
|
630
681
|
};
|