@gitpod/gitpod-protocol 0.1.5-upgrade-code.5 → 0.1.5-vn-implement-jetbrains-terminals.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.
Files changed (299) hide show
  1. package/data/builtin-theia-plugins.json +9 -9
  2. package/data/gitpod-schema.json +25 -24
  3. package/lib/accounting-protocol.d.ts +155 -0
  4. package/lib/accounting-protocol.d.ts.map +1 -0
  5. package/lib/accounting-protocol.js +109 -0
  6. package/lib/accounting-protocol.js.map +1 -0
  7. package/lib/admin-protocol.d.ts +31 -4
  8. package/lib/admin-protocol.d.ts.map +1 -1
  9. package/lib/admin-protocol.js +15 -0
  10. package/lib/admin-protocol.js.map +1 -1
  11. package/lib/analytics.d.ts +45 -0
  12. package/lib/analytics.d.ts.map +1 -0
  13. package/lib/analytics.js +10 -0
  14. package/lib/analytics.js.map +1 -0
  15. package/lib/auth.d.ts +25 -0
  16. package/lib/auth.d.ts.map +1 -0
  17. package/lib/auth.js +16 -0
  18. package/lib/auth.js.map +1 -0
  19. package/lib/context-url.d.ts +31 -0
  20. package/lib/context-url.d.ts.map +1 -0
  21. package/lib/context-url.js +102 -0
  22. package/lib/context-url.js.map +1 -0
  23. package/lib/context-url.spec.d.ts +14 -0
  24. package/lib/context-url.spec.d.ts.map +1 -0
  25. package/lib/context-url.spec.js +94 -0
  26. package/lib/context-url.spec.js.map +1 -0
  27. package/lib/email-protocol.d.ts +1 -2
  28. package/lib/email-protocol.d.ts.map +1 -1
  29. package/lib/email-protocol.js +4 -4
  30. package/lib/email-protocol.js.map +1 -1
  31. package/lib/encryption/container-module.js +5 -4
  32. package/lib/encryption/container-module.js.map +1 -1
  33. package/lib/encryption/encryption-engine.js +19 -20
  34. package/lib/encryption/encryption-engine.js.map +1 -1
  35. package/lib/encryption/encryption-engine.spec.js +29 -36
  36. package/lib/encryption/encryption-engine.spec.js.map +1 -1
  37. package/lib/encryption/encryption-service.js +29 -43
  38. package/lib/encryption/encryption-service.js.map +1 -1
  39. package/lib/encryption/key-provider.js +25 -30
  40. package/lib/encryption/key-provider.js.map +1 -1
  41. package/lib/env.d.ts +1 -2
  42. package/lib/env.d.ts.map +1 -1
  43. package/lib/env.js +20 -21
  44. package/lib/env.js.map +1 -1
  45. package/lib/gitpod-file-parser.js +25 -41
  46. package/lib/gitpod-file-parser.js.map +1 -1
  47. package/lib/gitpod-file-parser.spec.js +116 -116
  48. package/lib/gitpod-file-parser.spec.js.map +1 -1
  49. package/lib/gitpod-service.d.ts +162 -20
  50. package/lib/gitpod-service.d.ts.map +1 -1
  51. package/lib/gitpod-service.js +170 -256
  52. package/lib/gitpod-service.js.map +1 -1
  53. package/lib/headless-workspace-log.d.ts +8 -11
  54. package/lib/headless-workspace-log.d.ts.map +1 -1
  55. package/lib/headless-workspace-log.js +4 -7
  56. package/lib/headless-workspace-log.js.map +1 -1
  57. package/lib/ide-frontend-service.d.ts +4 -0
  58. package/lib/ide-frontend-service.d.ts.map +1 -1
  59. package/lib/ide-protocol.d.ts +105 -0
  60. package/lib/ide-protocol.d.ts.map +1 -0
  61. package/lib/ide-protocol.js +8 -0
  62. package/lib/ide-protocol.js.map +1 -0
  63. package/lib/index.d.ts +6 -0
  64. package/lib/index.d.ts.map +1 -1
  65. package/lib/index.js +7 -1
  66. package/lib/index.js.map +1 -1
  67. package/lib/installation-admin-protocol.d.ts +21 -0
  68. package/lib/installation-admin-protocol.d.ts.map +1 -0
  69. package/lib/installation-admin-protocol.js +30 -0
  70. package/lib/installation-admin-protocol.js.map +1 -0
  71. package/lib/messaging/browser/connection.d.ts +5 -3
  72. package/lib/messaging/browser/connection.d.ts.map +1 -1
  73. package/lib/messaging/browser/connection.js +183 -33
  74. package/lib/messaging/browser/connection.js.map +1 -1
  75. package/lib/messaging/browser/window-connection.js +35 -55
  76. package/lib/messaging/browser/window-connection.js.map +1 -1
  77. package/lib/messaging/client-call-metrics.d.ts +35 -0
  78. package/lib/messaging/client-call-metrics.d.ts.map +1 -0
  79. package/lib/messaging/client-call-metrics.js +83 -0
  80. package/lib/messaging/client-call-metrics.js.map +1 -0
  81. package/lib/messaging/error.d.ts +5 -1
  82. package/lib/messaging/error.d.ts.map +1 -1
  83. package/lib/messaging/error.js +10 -2
  84. package/lib/messaging/error.js.map +1 -1
  85. package/lib/messaging/handler.d.ts +10 -0
  86. package/lib/messaging/handler.d.ts.map +1 -1
  87. package/lib/messaging/node/connection.d.ts +1 -17
  88. package/lib/messaging/node/connection.d.ts.map +1 -1
  89. package/lib/messaging/node/connection.js +23 -59
  90. package/lib/messaging/node/connection.js.map +1 -1
  91. package/lib/messaging/proxy-factory.d.ts +2 -0
  92. package/lib/messaging/proxy-factory.d.ts.map +1 -1
  93. package/lib/messaging/proxy-factory.js +74 -159
  94. package/lib/messaging/proxy-factory.js.map +1 -1
  95. package/lib/oss-allowlist.d.ts +14 -0
  96. package/lib/oss-allowlist.d.ts.map +1 -0
  97. package/lib/oss-allowlist.js +8 -0
  98. package/lib/oss-allowlist.js.map +1 -0
  99. package/lib/payment-protocol.d.ts +18 -0
  100. package/lib/payment-protocol.d.ts.map +1 -0
  101. package/lib/payment-protocol.js +13 -0
  102. package/lib/payment-protocol.js.map +1 -0
  103. package/lib/permission.d.ts +5 -3
  104. package/lib/permission.d.ts.map +1 -1
  105. package/lib/permission.js +18 -17
  106. package/lib/permission.js.map +1 -1
  107. package/lib/plans.d.ts +210 -0
  108. package/lib/plans.d.ts.map +1 -0
  109. package/lib/plans.js +570 -0
  110. package/lib/plans.js.map +1 -0
  111. package/lib/protocol.d.ts +120 -58
  112. package/lib/protocol.d.ts.map +1 -1
  113. package/lib/protocol.js +116 -130
  114. package/lib/protocol.js.map +1 -1
  115. package/lib/snapshot-url.d.ts +14 -0
  116. package/lib/snapshot-url.d.ts.map +1 -0
  117. package/lib/snapshot-url.js +26 -0
  118. package/lib/snapshot-url.js.map +1 -0
  119. package/{src/util/without.ts → lib/snapshot-url.spec.d.ts} +2 -3
  120. package/lib/snapshot-url.spec.d.ts.map +1 -0
  121. package/lib/snapshot-url.spec.js +41 -0
  122. package/lib/snapshot-url.spec.js.map +1 -0
  123. package/lib/team-subscription-protocol.d.ts +73 -0
  124. package/lib/team-subscription-protocol.d.ts.map +1 -0
  125. package/lib/team-subscription-protocol.js +63 -0
  126. package/lib/team-subscription-protocol.js.map +1 -0
  127. package/lib/teams-projects-protocol.d.ts +113 -0
  128. package/lib/teams-projects-protocol.d.ts.map +1 -0
  129. package/lib/teams-projects-protocol.js +30 -0
  130. package/lib/teams-projects-protocol.js.map +1 -0
  131. package/lib/util/analytics.d.ts +8 -0
  132. package/lib/util/analytics.d.ts.map +1 -0
  133. package/lib/util/analytics.js +79 -0
  134. package/lib/util/analytics.js.map +1 -0
  135. package/lib/util/async-iterator.js +55 -133
  136. package/lib/util/async-iterator.js.map +1 -1
  137. package/lib/util/cancelable.js +17 -59
  138. package/lib/util/cancelable.js.map +1 -1
  139. package/lib/util/date-time.js +8 -8
  140. package/lib/util/date-time.js.map +1 -1
  141. package/lib/util/deferred.js +10 -12
  142. package/lib/util/deferred.js.map +1 -1
  143. package/lib/util/disposable.js +26 -39
  144. package/lib/util/disposable.js.map +1 -1
  145. package/lib/util/event.js +58 -74
  146. package/lib/util/event.js.map +1 -1
  147. package/lib/util/garbage-collected-cache.d.ts +1 -0
  148. package/lib/util/garbage-collected-cache.d.ts.map +1 -1
  149. package/lib/util/garbage-collected-cache.js +26 -46
  150. package/lib/util/garbage-collected-cache.js.map +1 -1
  151. package/lib/util/generate-workspace-id.d.ts +4 -0
  152. package/lib/util/generate-workspace-id.d.ts.map +1 -0
  153. package/lib/util/generate-workspace-id.js +487 -0
  154. package/lib/util/generate-workspace-id.js.map +1 -0
  155. package/lib/util/{without.d.ts → generate-workspace-id.spec.d.ts} +2 -2
  156. package/lib/util/generate-workspace-id.spec.d.ts.map +1 -0
  157. package/lib/util/generate-workspace-id.spec.js +87 -0
  158. package/lib/util/generate-workspace-id.spec.js.map +1 -0
  159. package/lib/util/gitpod-cookie.d.ts +20 -0
  160. package/lib/util/gitpod-cookie.d.ts.map +1 -0
  161. package/lib/util/gitpod-cookie.js +44 -0
  162. package/lib/util/gitpod-cookie.js.map +1 -0
  163. package/lib/util/gitpod-host-url.d.ts +1 -2
  164. package/lib/util/gitpod-host-url.d.ts.map +1 -1
  165. package/lib/util/gitpod-host-url.js +96 -98
  166. package/lib/util/gitpod-host-url.js.map +1 -1
  167. package/lib/util/gitpod-host-url.spec.d.ts +8 -1
  168. package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
  169. package/lib/util/gitpod-host-url.spec.js +104 -22
  170. package/lib/util/gitpod-host-url.spec.js.map +1 -1
  171. package/lib/util/grpc.d.ts +15 -0
  172. package/lib/util/grpc.d.ts.map +1 -0
  173. package/lib/util/grpc.js +18 -0
  174. package/lib/util/grpc.js.map +1 -0
  175. package/lib/util/jaeger-client-types.d.ts +68 -0
  176. package/lib/util/jaeger-client-types.d.ts.map +1 -0
  177. package/lib/util/{without.js → jaeger-client-types.js} +1 -1
  178. package/lib/util/jaeger-client-types.js.map +1 -0
  179. package/lib/util/logging.d.ts +49 -33
  180. package/lib/util/logging.d.ts.map +1 -1
  181. package/lib/util/logging.js +107 -110
  182. package/lib/util/logging.js.map +1 -1
  183. package/lib/util/make-link.js +2 -2
  184. package/lib/util/make-link.js.map +1 -1
  185. package/lib/util/parse-workspace-id.d.ts +13 -3
  186. package/lib/util/parse-workspace-id.d.ts.map +1 -1
  187. package/lib/util/parse-workspace-id.js +38 -8
  188. package/lib/util/parse-workspace-id.js.map +1 -1
  189. package/lib/util/parse-workspace-id.spec.d.ts +8 -0
  190. package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
  191. package/lib/util/parse-workspace-id.spec.js +127 -47
  192. package/lib/util/parse-workspace-id.spec.js.map +1 -1
  193. package/lib/util/queue.js +16 -55
  194. package/lib/util/queue.js.map +1 -1
  195. package/lib/util/queue.spec.js +144 -288
  196. package/lib/util/queue.spec.js.map +1 -1
  197. package/lib/util/repeat.d.ts +15 -0
  198. package/lib/util/repeat.d.ts.map +1 -0
  199. package/lib/util/repeat.js +55 -0
  200. package/lib/util/repeat.js.map +1 -0
  201. package/lib/util/semaphore.js +15 -46
  202. package/lib/util/semaphore.js.map +1 -1
  203. package/lib/util/skip-if.js +6 -6
  204. package/lib/util/skip-if.js.map +1 -1
  205. package/lib/util/timeutil.js +28 -16
  206. package/lib/util/timeutil.js.map +1 -1
  207. package/lib/util/timeutil.spec.js +21 -24
  208. package/lib/util/timeutil.spec.js.map +1 -1
  209. package/lib/util/tracing.d.ts +51 -5
  210. package/lib/util/tracing.d.ts.map +1 -1
  211. package/lib/util/tracing.js +197 -62
  212. package/lib/util/tracing.js.map +1 -1
  213. package/lib/util/tracing.spec.d.ts +7 -0
  214. package/lib/util/tracing.spec.d.ts.map +1 -0
  215. package/lib/util/tracing.spec.js +121 -0
  216. package/lib/util/tracing.spec.js.map +1 -0
  217. package/lib/util/workspace-port-authentication.js +3 -2
  218. package/lib/util/workspace-port-authentication.js.map +1 -1
  219. package/lib/workspace-cluster.d.ts +71 -0
  220. package/lib/workspace-cluster.d.ts.map +1 -0
  221. package/lib/workspace-cluster.js +16 -0
  222. package/lib/workspace-cluster.js.map +1 -0
  223. package/lib/workspace-instance.d.ts +26 -2
  224. package/lib/workspace-instance.d.ts.map +1 -1
  225. package/lib/wsready.d.ts +1 -1
  226. package/lib/wsready.js +2 -2
  227. package/package.json +33 -17
  228. package/pkg-yarn.lock +18 -9
  229. package/provenance-bundle.jsonl +2 -0
  230. package/src/accounting-protocol.ts +229 -0
  231. package/src/admin-protocol.ts +53 -5
  232. package/src/analytics.ts +54 -0
  233. package/src/auth.ts +27 -0
  234. package/src/context-url.spec.ts +53 -0
  235. package/src/context-url.ts +107 -0
  236. package/src/email-protocol.ts +2 -3
  237. package/src/env.ts +10 -10
  238. package/src/gitpod-service.ts +237 -38
  239. package/src/headless-workspace-log.ts +7 -11
  240. package/src/ide-frontend-service.ts +5 -1
  241. package/src/ide-protocol.ts +119 -0
  242. package/src/index.ts +7 -1
  243. package/src/installation-admin-protocol.ts +35 -0
  244. package/src/messaging/browser/connection.ts +195 -14
  245. package/src/messaging/client-call-metrics.ts +97 -0
  246. package/src/messaging/error.ts +14 -2
  247. package/src/messaging/handler.ts +12 -0
  248. package/src/messaging/node/connection.ts +21 -68
  249. package/src/messaging/proxy-factory.ts +14 -6
  250. package/src/oss-allowlist.ts +15 -0
  251. package/src/payment-protocol.ts +20 -0
  252. package/src/permission.ts +7 -6
  253. package/src/plans.ts +632 -0
  254. package/src/protocol.ts +194 -87
  255. package/src/snapshot-url.spec.ts +25 -0
  256. package/src/snapshot-url.ts +27 -0
  257. package/src/team-subscription-protocol.ts +113 -0
  258. package/src/teams-projects-protocol.ts +147 -0
  259. package/src/util/analytics.ts +87 -0
  260. package/src/util/deferred.ts +1 -1
  261. package/src/util/garbage-collected-cache.ts +9 -3
  262. package/src/util/generate-workspace-id.spec.ts +48 -0
  263. package/src/util/generate-workspace-id.ts +475 -0
  264. package/src/util/gitpod-cookie.ts +39 -0
  265. package/src/util/gitpod-host-url.spec.ts +30 -1
  266. package/src/util/gitpod-host-url.ts +23 -13
  267. package/src/util/grpc.ts +15 -0
  268. package/src/util/jaeger-client-types.ts +102 -0
  269. package/src/util/logging.ts +102 -38
  270. package/src/util/parse-workspace-id.spec.ts +45 -4
  271. package/src/util/parse-workspace-id.ts +38 -7
  272. package/src/util/queue.spec.ts +1 -1
  273. package/src/util/repeat.ts +45 -0
  274. package/src/util/semaphore.ts +2 -2
  275. package/src/util/skip-if.ts +1 -1
  276. package/src/util/timeutil.ts +4 -4
  277. package/src/util/tracing.spec.ts +83 -0
  278. package/src/util/tracing.ts +183 -17
  279. package/src/workspace-cluster.ts +91 -0
  280. package/src/workspace-instance.ts +51 -13
  281. package/src/wsready.ts +2 -2
  282. package/lib/messaging/connection-error-handler.d.ts +0 -27
  283. package/lib/messaging/connection-error-handler.d.ts.map +0 -1
  284. package/lib/messaging/connection-error-handler.js +0 -46
  285. package/lib/messaging/connection-error-handler.js.map +0 -1
  286. package/lib/util/repeater.d.ts +0 -22
  287. package/lib/util/repeater.d.ts.map +0 -1
  288. package/lib/util/repeater.js +0 -118
  289. package/lib/util/repeater.js.map +0 -1
  290. package/lib/util/safe-promise.d.ts +0 -11
  291. package/lib/util/safe-promise.d.ts.map +0 -1
  292. package/lib/util/safe-promise.js +0 -34
  293. package/lib/util/safe-promise.js.map +0 -1
  294. package/lib/util/without.d.ts.map +0 -1
  295. package/lib/util/without.js.map +0 -1
  296. package/src/messaging/connection-error-handler.ts +0 -62
  297. package/src/util/jaeger-client.d.ts +0 -105
  298. package/src/util/repeater.ts +0 -49
  299. package/src/util/safe-promise.ts +0 -26
package/lib/plans.d.ts ADDED
@@ -0,0 +1,210 @@
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
+ export declare type Currency = 'USD' | 'EUR';
7
+ export declare namespace Currency {
8
+ const getAll: () => Currency[];
9
+ const getSymbol: (c: Currency) => "$" | "€";
10
+ }
11
+ /**
12
+ * Different plans of the same type MAY have different prices ($/€, for example) but MUST have the same feature set.
13
+ */
14
+ export declare type PlanType = 'free' | 'free-50' | 'free-open-source' | 'student' | 'basic' | 'personal' | 'professional' | 'professional-new';
15
+ export declare type HoursPerMonthType = number | 'unlimited';
16
+ export interface Plan {
17
+ chargebeeId: string;
18
+ githubId?: number;
19
+ githubPlanNumber?: number;
20
+ name: string;
21
+ currency: Currency;
22
+ /** In full currencies (Euro, US Dollar, ...) */
23
+ pricePerMonth: number;
24
+ hoursPerMonth: HoursPerMonthType;
25
+ type: PlanType;
26
+ team?: boolean;
27
+ }
28
+ export declare namespace Plan {
29
+ const is: (o: any) => o is Plan;
30
+ }
31
+ export declare const MAX_PARALLEL_WORKSPACES = 16;
32
+ export interface Coupon {
33
+ id: string;
34
+ isGithubStudentCoupon?: boolean;
35
+ }
36
+ export declare namespace Coupon {
37
+ const is: (o: any) => o is Coupon;
38
+ }
39
+ export declare namespace Coupons {
40
+ const INTERNAL_GITPOD_GHSP: Coupon;
41
+ const INTERNAL_GITPOD_GHSP_2: Coupon;
42
+ const GITHUBSTUDENTPACKFORFACULTY: Coupon;
43
+ const isGithubStudentCoupon: (id: string) => boolean | undefined;
44
+ const getAllCoupons: () => Coupon[];
45
+ }
46
+ export declare const ABSOLUTE_MAX_USAGE: number;
47
+ /**
48
+ * Version history:
49
+ * - v1:
50
+ * - Free
51
+ * - Basic
52
+ * - Professional
53
+ * - Team Professional
54
+ * - v2:
55
+ * - Free
56
+ * - Personal
57
+ * - Unlimited: rebranded professional with unlimited hours
58
+ * - Team Unlimited: rebranded professional with unlimited hours
59
+ * - dropped: Basic
60
+ * - v2.5:
61
+ * + Student Unlimited
62
+ * + Team Unlimited Student
63
+ * - V3:
64
+ * - Free: reduced to 50h (stays default, but not advertised directly anymore)
65
+ * - Personal (8/9)
66
+ * - Professional (23/25)
67
+ * - Unlimited (35/39)
68
+ * - v4:
69
+ * - Professional Open Source (free)
70
+ * - v5:
71
+ * - Unleashed: rebranded Unlimited
72
+ */
73
+ export declare namespace Plans {
74
+ /**
75
+ * The old default plan (v1): 100h hours for public repos
76
+ */
77
+ const FREE: Plan;
78
+ /**
79
+ * The new default plan (v3): 50h hours for public repos
80
+ */
81
+ const FREE_50: Plan;
82
+ /**
83
+ * Users created after this date get the FREE_50 plan (v3) instead of the (old) FREE plan (v1)
84
+ */
85
+ const FREE_50_START_DATE = "2019-12-19T00:00:00.000Z";
86
+ /**
87
+ * The 'Professional Open Source' plan was introduced to offer professional open-souce developers unlimited hours.
88
+ */
89
+ const FREE_OPEN_SOURCE: Plan;
90
+ /**
91
+ * The 'Student Unleashed' plans were introduced to give students access to the highly-priced unlimited plans.
92
+ */
93
+ const PROFESSIONAL_STUDENT_EUR: Plan;
94
+ /**
95
+ * The 'Student Unleashed' plans were introduced to give students access to the highly-priced unlimited plans.
96
+ */
97
+ const PROFESSIONAL_STUDENT_USD: Plan;
98
+ /**
99
+ * The 'Student Unleashed' plans were introduced to give students access to the highly-priced unlimited plans.
100
+ */
101
+ const TEAM_PROFESSIONAL_STUDENT_EUR: Plan;
102
+ /**
103
+ * The 'Student Unleashed' plans were introduced to give students access to the highly-priced unlimited plans.
104
+ */
105
+ const TEAM_PROFESSIONAL_STUDENT_USD: Plan;
106
+ /**
107
+ * The 'basic' plan was the original differentiator between FREE and Professional (v1) but got discarded soon.
108
+ */
109
+ const BASIC_EUR: Plan;
110
+ /**
111
+ * The 'basic' plan was the original differentiator between FREE and Professional (v1) but got discarded soon.
112
+ */
113
+ const BASIC_USD: Plan;
114
+ /**
115
+ * The 'personal' plan was introduced to superseed the 'basic' plan (introduced with v2) to be more attractive to hobbyists.
116
+ */
117
+ const PERSONAL_EUR: Plan;
118
+ /**
119
+ * The 'personal' plan was introduced to superseed the 'basic' plan (introduced with v2) to be more attractive to hobbyists.
120
+ */
121
+ const PERSONAL_USD: Plan;
122
+ /**
123
+ * This is the 'new' Professional plan (v3), which is meant to fit well between Personal (9$/8€) on the left and
124
+ * Unleashed (39$/35€) on the right.
125
+ */
126
+ const PROFESSIONAL_NEW_EUR: Plan;
127
+ /**
128
+ * This is the 'new' Professional plan (v3), which is meant to fit well between Personal (9$/8€) on the left and
129
+ * Unleashed (39$/35€) on the right.
130
+ */
131
+ const PROFESSIONAL_NEW_USD: Plan;
132
+ /**
133
+ * This is the 'new' Team Professional plan (v3), which is meant to fit well between Personal (9$/8€) on the left and
134
+ * Unleashed (39$/35€) on the right.
135
+ */
136
+ const TEAM_PROFESSIONAL_NEW_EUR: Plan;
137
+ /**
138
+ * This is the 'new' Team Professional plan (v3), which is meant to fit well between Personal (9$/8€) on the left and
139
+ * Unleashed (39$/35€) on the right.
140
+ */
141
+ const TEAM_PROFESSIONAL_NEW_USD: Plan;
142
+ /**
143
+ * This is the 'Unleashed' plan (v1, rebranded v2, v5)
144
+ * It was originally introduced as 'Professional', and we cannot update the ids, so it stays that way in the code.
145
+ */
146
+ const PROFESSIONAL_EUR: Plan;
147
+ /**
148
+ * This is the 'Unleashed' plan (v1, rebranded v2, v5)
149
+ * It was originally introduced as 'Professional', and we cannot update the ids, so it stays that way in the code.
150
+ */
151
+ const PROFESSIONAL_USD: Plan;
152
+ /**
153
+ * This is the Team-'Unleashed' plan (v1, rebranded v2, v5)
154
+ * It was originally introduced as 'Professional', and we cannot update the ids, so it stays that way in the code.
155
+ */
156
+ const TEAM_PROFESSIONAL_USD: Plan;
157
+ /**
158
+ * This is the Team-'Unleashed' plan (v1, rebranded v2, v5)
159
+ * It was originally introduced as 'Professional', and we cannot update the ids, so it stays that way in the code.
160
+ */
161
+ const TEAM_PROFESSIONAL_EUR: Plan;
162
+ /**
163
+ * This function returns all individual plans that might be active (= we have subscriptions for) at the moment
164
+ */
165
+ function getAvailablePlans(currency: Currency): Plan[];
166
+ const getAvailableTeamPlans: (currency?: Currency | undefined) => Plan[];
167
+ function getById(id: string | undefined): Plan | undefined;
168
+ function getByTypeAndCurrency(type: PlanType, currency: Currency): Plan | undefined;
169
+ function getProPlan(currency: Currency): Plan;
170
+ function getNewProPlan(currency: Currency): Plan;
171
+ function getStudentProPlan(currency: Currency): Plan;
172
+ function getBasicPlan(currency: Currency): Plan;
173
+ function getPersonalPlan(currency: Currency): Plan;
174
+ function getFreePlan(userCreationDate: string): Plan;
175
+ function isFreePlan(chargebeeId: string | undefined): boolean;
176
+ function isFreeNonTransientPlan(chargebeeId: string | undefined): boolean;
177
+ function getHoursPerMonth(plan: Plan): number;
178
+ /**
179
+ * Returns the maximum number of parallel workspaces for the given plan
180
+ * @param plan
181
+ */
182
+ function getParallelWorkspacesById(planId: string | undefined): number;
183
+ /**
184
+ * Returns the maximum number of parallel workspaces for the given plan
185
+ * @param plan
186
+ */
187
+ function getParallelWorkspaces(plan: Plan | undefined): number;
188
+ /**
189
+ * Returns the preferred plan type with the next higher arity
190
+ * @param type
191
+ */
192
+ function getNextHigherPlanType(type: PlanType): PlanType;
193
+ /**
194
+ * This imposes a partial order on the plan types
195
+ * @param planTypeA
196
+ * @param planTypeB
197
+ */
198
+ function compareTypes(planTypeA: PlanType, planTypeB: PlanType): 0 | 1 | -1;
199
+ function subscriptionChange(fromType: PlanType, toType: PlanType): "upgrade" | "downgrade" | "none";
200
+ interface Feature {
201
+ title: string;
202
+ emph?: boolean;
203
+ link?: string;
204
+ tooltip?: string;
205
+ }
206
+ namespace Feature {
207
+ const getFeaturesFor: (p: Plan) => Feature[];
208
+ }
209
+ }
210
+ //# sourceMappingURL=plans.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plans.d.ts","sourceRoot":"","sources":["../src/plans.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,oBAAY,QAAQ,GAAG,KAAK,GAAG,KAAK,CAAC;AACrC,yBAAiB,QAAQ,CAAC;IACf,MAAM,MAAM,QAAO,QAAQ,EAEjC,CAAA;IACM,MAAM,SAAS,MAAO,QAAQ,cAEpC,CAAA;CACJ;AAED;;GAEG;AACH,oBAAY,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,kBAAkB,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,cAAc,GAAG,kBAAkB,CAAC;AACxI,oBAAY,iBAAiB,GAAG,MAAM,GAAG,WAAW,CAAC;AACrD,MAAM,WAAW,IAAI;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAEzB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,QAAQ,CAAA;IAClB,gDAAgD;IAChD,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,iBAAiB,CAAA;IAChC,IAAI,EAAE,QAAQ,CAAA;IACd,IAAI,CAAC,EAAE,OAAO,CAAA;CACjB;AACD,yBAAiB,IAA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