@todesktop/shared 7.188.66 → 7.188.68

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/lib/base.d.ts CHANGED
@@ -83,6 +83,7 @@ export interface IAppMeta {
83
83
  electron?: string;
84
84
  version?: string;
85
85
  };
86
+ previousInstallLockSha?: string;
86
87
  releaseRedirections?: ReleaseRedirectionRule[];
87
88
  windowsEVOnboarding?: {
88
89
  provider: WindowsEVOnboardingProvider;
@@ -157,6 +158,7 @@ export interface ToDesktopJson {
157
158
  schemaVersion: number;
158
159
  snap?: IAppBuilderLib['config']['snap'];
159
160
  uploadSizeLimit?: number;
161
+ useCachedDependencies?: boolean;
160
162
  windows?: {
161
163
  icon?: FilePath;
162
164
  nsisCustomBinary?: {
package/lib/plans.d.ts CHANGED
@@ -3,6 +3,8 @@ export type PriceKey = `${'monthly' | 'yearly'}_${string}`;
3
3
  export type Price = {
4
4
  id: string;
5
5
  status: 'active' | 'inactive';
6
+ period: 'monthly' | 'yearly';
7
+ amount: number;
6
8
  };
7
9
  export type Product<T extends PriceKey = any> = {
8
10
  id: string;
package/lib/plans.js CHANGED
@@ -13,8 +13,8 @@ var PortalConfigKey;
13
13
  PortalConfigKey["BuilderUpgradeProd"] = "builder_upgrade_prod";
14
14
  })(PortalConfigKey || (exports.PortalConfigKey = PortalConfigKey = {}));
15
15
  // --- factory functions ---
16
- const createPrice = (id, status) => {
17
- return { id, status };
16
+ const createPrice = (id, price) => {
17
+ return Object.assign({ id }, price);
18
18
  };
19
19
  const createProduct = (id, prices) => ({ id, prices });
20
20
  const createPlan = (tier, products) => {
@@ -64,132 +64,372 @@ exports.products = {
64
64
  dev: {
65
65
  builder: {
66
66
  essential: createProduct('prod_MoR1S4o0nLv00y', {
67
- monthly_99: createPrice('price_1M4o9XIewCKA2h0IVfGrid8E', 'inactive'),
68
- monthly_125: createPrice('price_1PuuAqIewCKA2h0Iw4judQNj', 'active'),
69
- yearly_1200: createPrice('price_1PuvdgIewCKA2h0IisTKqjFN', 'active'),
67
+ monthly_99: createPrice('price_1M4o9XIewCKA2h0IVfGrid8E', {
68
+ status: 'inactive',
69
+ amount: 99,
70
+ period: 'monthly',
71
+ }),
72
+ monthly_125: createPrice('price_1PuuAqIewCKA2h0Iw4judQNj', {
73
+ status: 'active',
74
+ amount: 125,
75
+ period: 'monthly',
76
+ }),
77
+ yearly_1200: createPrice('price_1PuvdgIewCKA2h0IisTKqjFN', {
78
+ status: 'active',
79
+ amount: 1200,
80
+ period: 'yearly',
81
+ }),
70
82
  }),
71
83
  professional: createProduct('prod_MoR1SchsRDAIgY', {
72
- monthly_199: createPrice('price_1M4o9vIewCKA2h0IHREokdD8', 'inactive'),
73
- monthly_240: createPrice('price_1M4o9vIewCKA2h0IHREokdD8', 'inactive'),
74
- monthly_300: createPrice('price_1PuuHrIewCKA2h0IQfEZ4Wog', 'active'),
75
- yearly_2880: createPrice('price_1PuuJAIewCKA2h0IibpUIhf9', 'active'),
84
+ monthly_199: createPrice('price_1M4o9vIewCKA2h0IHREokdD8', {
85
+ status: 'inactive',
86
+ amount: 199,
87
+ period: 'monthly',
88
+ }),
89
+ monthly_240: createPrice('price_1M4o9vIewCKA2h0IHREokdD8', {
90
+ status: 'inactive',
91
+ amount: 240,
92
+ period: 'monthly',
93
+ }),
94
+ monthly_300: createPrice('price_1PuuHrIewCKA2h0IQfEZ4Wog', {
95
+ status: 'active',
96
+ amount: 300,
97
+ period: 'monthly',
98
+ }),
99
+ yearly_2880: createPrice('price_1PuuJAIewCKA2h0IibpUIhf9', {
100
+ status: 'active',
101
+ amount: 2880,
102
+ period: 'yearly',
103
+ }),
76
104
  }),
77
105
  },
78
106
  cli: {
79
107
  founder30: createProduct('prod_GsL6LaRo4NFD5n', {
80
- monthly_30: createPrice('plan_GsL7NZskOY0TC9', 'active'),
108
+ monthly_30: createPrice('plan_GsL7NZskOY0TC9', {
109
+ status: 'active',
110
+ amount: 30,
111
+ period: 'monthly',
112
+ }),
81
113
  }),
82
114
  founder50: createProduct('prod_GsL5O1PdbxOrxJ', {
83
- monthly_50: createPrice('plan_GsL6VYAshfh7c4', 'active'),
84
- monthly_90: createPrice('plan_GsL6VYAshfh7c4', 'inactive'),
115
+ monthly_50: createPrice('plan_GsL6VYAshfh7c4', {
116
+ status: 'active',
117
+ amount: 50,
118
+ period: 'monthly',
119
+ }),
120
+ monthly_90: createPrice('plan_GsL6VYAshfh7c4', {
121
+ status: 'inactive',
122
+ amount: 90,
123
+ period: 'monthly',
124
+ }),
85
125
  }),
86
126
  founder: createProduct('prod_Gq0E8nbTYHtkPl', {
87
- monthly_100: createPrice('plan_Gq0FzdmoTJshQL', 'inactive'),
88
- monthly_125: createPrice('price_1PuuMRIewCKA2h0IrggfwCwA', 'active'),
89
- yearly_1200: createPrice('price_1PuuMkIewCKA2h0IRxhkDpmk', 'active'),
127
+ monthly_100: createPrice('plan_Gq0FzdmoTJshQL', {
128
+ status: 'inactive',
129
+ amount: 100,
130
+ period: 'monthly',
131
+ }),
132
+ monthly_125: createPrice('price_1PuuMRIewCKA2h0IrggfwCwA', {
133
+ status: 'active',
134
+ amount: 125,
135
+ period: 'monthly',
136
+ }),
137
+ yearly_1200: createPrice('price_1PuuMkIewCKA2h0IRxhkDpmk', {
138
+ status: 'active',
139
+ amount: 1200,
140
+ period: 'yearly',
141
+ }),
90
142
  }),
91
143
  performance: createProduct('prod_LphQku6BNkzCga', {
92
- monthly_300: createPrice('price_1L821UIewCKA2h0IUwRhicyo', 'inactive'),
93
- monthly_375: createPrice('price_1PuuO7IewCKA2h0IOK9ivzS0', 'active'),
94
- yearly_3600: createPrice('price_1PuuOKIewCKA2h0IrcVvJkgG', 'active'),
144
+ monthly_300: createPrice('price_1L821UIewCKA2h0IUwRhicyo', {
145
+ status: 'inactive',
146
+ amount: 300,
147
+ period: 'monthly',
148
+ }),
149
+ monthly_375: createPrice('price_1PuuO7IewCKA2h0IOK9ivzS0', {
150
+ status: 'active',
151
+ amount: 375,
152
+ period: 'monthly',
153
+ }),
154
+ yearly_3600: createPrice('price_1PuuOKIewCKA2h0IrcVvJkgG', {
155
+ status: 'active',
156
+ amount: 3600,
157
+ period: 'yearly',
158
+ }),
95
159
  }),
96
160
  scale: createProduct('prod_LphQxNgfUIxVfA', {
97
- monthly_1200: createPrice('price_1L821wIewCKA2h0IMLUmjulL', 'inactive'),
98
- monthly_1500: createPrice('price_1PuuPFIewCKA2h0IbPmKdsJr', 'active'),
99
- yearly_14400: createPrice('price_1PuuPaIewCKA2h0IhLfSlRFj', 'active'),
161
+ monthly_1200: createPrice('price_1L821wIewCKA2h0IMLUmjulL', {
162
+ status: 'inactive',
163
+ amount: 1200,
164
+ period: 'monthly',
165
+ }),
166
+ monthly_1500: createPrice('price_1PuuPFIewCKA2h0IbPmKdsJr', {
167
+ status: 'active',
168
+ amount: 1500,
169
+ period: 'monthly',
170
+ }),
171
+ yearly_14400: createPrice('price_1PuuPaIewCKA2h0IhLfSlRFj', {
172
+ status: 'active',
173
+ amount: 14400,
174
+ period: 'yearly',
175
+ }),
100
176
  }),
101
177
  },
102
178
  legacy: {
103
179
  essential: createProduct('prod_FplN7CkqFRH0ye', {
104
- monthly_58: createPrice('plan_FpljxNuZtNFFbm', 'active'),
180
+ monthly_58: createPrice('plan_FpljxNuZtNFFbm', {
181
+ status: 'active',
182
+ amount: 58,
183
+ period: 'monthly',
184
+ }),
105
185
  }),
106
186
  essentialNew: createProduct('prod_GYXm5X66hM1Ywj', {
107
- monthly_58: createPrice('plan_GYXmTA3EdfCv4q', 'active'),
108
- yearly_580: createPrice('plan_GYXmTA3EdfCv4q', 'active'),
187
+ monthly_58: createPrice('plan_GYXmTA3EdfCv4q', {
188
+ status: 'active',
189
+ amount: 58,
190
+ period: 'monthly',
191
+ }),
192
+ yearly_580: createPrice('plan_GYXmTA3EdfCv4q', {
193
+ status: 'active',
194
+ amount: 580,
195
+ period: 'yearly',
196
+ }),
109
197
  }),
110
198
  professional: createProduct('prod_GYXo54YK5kga12', {
111
- monthly_199: createPrice('plan_GYXoIkvwVKyfF2', 'active'),
112
- yearly_1990: createPrice('price_1KHU70IewCKA2h0IR87yXOQ2', 'inactive'),
113
- yearly_2388: createPrice('price_1KHU70IewCKA2h0IR87yXOQ2', 'active'),
199
+ monthly_199: createPrice('plan_GYXoIkvwVKyfF2', {
200
+ status: 'active',
201
+ amount: 199,
202
+ period: 'monthly',
203
+ }),
204
+ yearly_1990: createPrice('price_1KHU70IewCKA2h0IR87yXOQ2', {
205
+ status: 'inactive',
206
+ amount: 1990,
207
+ period: 'yearly',
208
+ }),
209
+ yearly_2388: createPrice('price_1KHU70IewCKA2h0IR87yXOQ2', {
210
+ status: 'active',
211
+ amount: 2388,
212
+ period: 'yearly',
213
+ }),
114
214
  }),
115
215
  startup: createProduct('prod_Fe8BTslXbdylxV', {
116
- monthly_49: createPrice('plan_Fe8BzLp7k71eGD', 'active'),
117
- yearly_200: createPrice('plan_Fe8BzLp7k71eGD', 'active'),
216
+ monthly_49: createPrice('plan_Fe8BzLp7k71eGD', {
217
+ status: 'active',
218
+ amount: 49,
219
+ period: 'monthly',
220
+ }),
221
+ yearly_200: createPrice('plan_Fe8BzLp7k71eGD', {
222
+ status: 'active',
223
+ amount: 200,
224
+ period: 'yearly',
225
+ }),
118
226
  }),
119
227
  growth: createProduct('prod_FplOSDbBmxba94', {
120
- monthly_199: createPrice('plan_FplOshrr1w3Mvu', 'active'),
228
+ monthly_199: createPrice('plan_FplOshrr1w3Mvu', {
229
+ status: 'active',
230
+ amount: 199,
231
+ period: 'monthly',
232
+ }),
121
233
  }),
122
234
  business: createProduct('prod_Fe8CbCE2wGJIWr', {
123
- monthly_199: createPrice('plan_Fe8CUkZfXasFtB', 'active'),
235
+ monthly_199: createPrice('plan_Fe8CUkZfXasFtB', {
236
+ status: 'active',
237
+ amount: 199,
238
+ period: 'monthly',
239
+ }),
124
240
  }),
125
241
  enterprise: createProduct('prod_Hc9PMnHUmHvOlw', {
126
- monthly_700: createPrice('price_1H2v6JIewCKA2h0IgUwsuctb', 'active'),
242
+ monthly_700: createPrice('price_1H2v6JIewCKA2h0IgUwsuctb', {
243
+ status: 'active',
244
+ amount: 700,
245
+ period: 'monthly',
246
+ }),
127
247
  }),
128
248
  },
129
249
  },
130
250
  prod: {
131
251
  builder: {
132
252
  essential: createProduct('prod_MoR2Ldm5PJpJZJ', {
133
- monthly_99: createPrice('price_1M4oA4IewCKA2h0IWgfbSJBe', 'inactive'),
134
- monthly_125: createPrice('price_1PuuU1IewCKA2h0IUSAcuUUb', 'active'),
135
- yearly_1200: createPrice('price_1PuuUZIewCKA2h0IDMNwNqQl', 'active'),
253
+ monthly_99: createPrice('price_1M4oA4IewCKA2h0IWgfbSJBe', {
254
+ status: 'inactive',
255
+ amount: 99,
256
+ period: 'monthly',
257
+ }),
258
+ monthly_125: createPrice('price_1PuuU1IewCKA2h0IUSAcuUUb', {
259
+ status: 'active',
260
+ amount: 125,
261
+ period: 'monthly',
262
+ }),
263
+ yearly_1200: createPrice('price_1PuuUZIewCKA2h0IDMNwNqQl', {
264
+ status: 'active',
265
+ amount: 1200,
266
+ period: 'yearly',
267
+ }),
136
268
  }),
137
269
  professional: createProduct('prod_MoR2h0Nf16hhgb', {
138
- monthly_199: createPrice('price_1M4oABIewCKA2h0INkbaCbIS', 'inactive'),
139
- monthly_240: createPrice('price_1MIDxtIewCKA2h0IvWi5weJL', 'inactive'),
140
- monthly_300: createPrice('price_1PuuVSIewCKA2h0IETsLUwF9', 'active'),
141
- yearly_2880: createPrice('price_1PuuVmIewCKA2h0I37dMpqI5', 'active'),
270
+ monthly_199: createPrice('price_1M4oABIewCKA2h0INkbaCbIS', {
271
+ status: 'inactive',
272
+ amount: 199,
273
+ period: 'monthly',
274
+ }),
275
+ monthly_240: createPrice('price_1MIDxtIewCKA2h0IvWi5weJL', {
276
+ status: 'inactive',
277
+ amount: 240,
278
+ period: 'monthly',
279
+ }),
280
+ monthly_300: createPrice('price_1PuuVSIewCKA2h0IETsLUwF9', {
281
+ status: 'active',
282
+ amount: 300,
283
+ period: 'monthly',
284
+ }),
285
+ yearly_2880: createPrice('price_1PuuVmIewCKA2h0I37dMpqI5', {
286
+ status: 'active',
287
+ amount: 2880,
288
+ period: 'yearly',
289
+ }),
142
290
  }),
143
291
  },
144
292
  cli: {
145
293
  founder30: createProduct('prod_GrHtZKuUDvLZOF', {
146
- monthly_30: createPrice('plan_GrHuyGjzYN0XN2', 'active'),
294
+ monthly_30: createPrice('plan_GrHuyGjzYN0XN2', {
295
+ status: 'active',
296
+ amount: 30,
297
+ period: 'monthly',
298
+ }),
147
299
  }),
148
300
  founder50: createProduct('prod_GsL0ntimYpTTwD', {
149
- monthly_50: createPrice('plan_GsL1IRUwpj5CIF', 'active'),
150
- monthly_90: createPrice('price_1JMHNnIewCKA2h0II5RGjVtk', 'inactive'),
301
+ monthly_50: createPrice('plan_GsL1IRUwpj5CIF', {
302
+ status: 'active',
303
+ amount: 50,
304
+ period: 'monthly',
305
+ }),
306
+ monthly_90: createPrice('price_1JMHNnIewCKA2h0II5RGjVtk', {
307
+ status: 'inactive',
308
+ amount: 90,
309
+ period: 'monthly',
310
+ }),
151
311
  }),
152
312
  founder: createProduct('prod_GpzVRVsBgluoef', {
153
- monthly_100: createPrice('plan_GpzWZLfsOzjrvI', 'inactive'),
154
- monthly_125: createPrice('price_1PuuXFIewCKA2h0IVHSyfFsd', 'active'),
155
- yearly_1200: createPrice('price_1PuuXYIewCKA2h0IAsygBajd', 'active'),
313
+ monthly_100: createPrice('plan_GpzWZLfsOzjrvI', {
314
+ status: 'inactive',
315
+ amount: 100,
316
+ period: 'monthly',
317
+ }),
318
+ monthly_125: createPrice('price_1PuuXFIewCKA2h0IVHSyfFsd', {
319
+ status: 'active',
320
+ amount: 125,
321
+ period: 'monthly',
322
+ }),
323
+ yearly_1200: createPrice('price_1PuuXYIewCKA2h0IAsygBajd', {
324
+ status: 'active',
325
+ amount: 1200,
326
+ period: 'yearly',
327
+ }),
156
328
  }),
157
329
  performance: createProduct('prod_LphRn5Rfuq3CMh', {
158
- monthly_300: createPrice('price_1L822LIewCKA2h0I5JYyOG1p', 'inactive'),
159
- monthly_375: createPrice('price_1PuuYKIewCKA2h0IWBJ4cyRQ', 'active'),
160
- yearly_3600: createPrice('price_1PuuYcIewCKA2h0IzeU1xWbQ', 'active'),
330
+ monthly_300: createPrice('price_1L822LIewCKA2h0I5JYyOG1p', {
331
+ status: 'inactive',
332
+ amount: 300,
333
+ period: 'monthly',
334
+ }),
335
+ monthly_375: createPrice('price_1PuuYKIewCKA2h0IWBJ4cyRQ', {
336
+ status: 'active',
337
+ amount: 375,
338
+ period: 'monthly',
339
+ }),
340
+ yearly_3600: createPrice('price_1PuuYcIewCKA2h0IzeU1xWbQ', {
341
+ status: 'active',
342
+ amount: 3600,
343
+ period: 'yearly',
344
+ }),
161
345
  }),
162
346
  scale: createProduct('prod_LphRKSuMLjQriP', {
163
- monthly_1200: createPrice('price_1L822RIewCKA2h0IPt9f2nZM', 'inactive'),
164
- monthly_1500: createPrice('price_1PuuarIewCKA2h0IEONPcFU5', 'active'),
165
- yearly_14400: createPrice('price_1Puub5IewCKA2h0IMJ3CQ58r', 'active'),
347
+ monthly_1200: createPrice('price_1L822RIewCKA2h0IPt9f2nZM', {
348
+ status: 'inactive',
349
+ amount: 1200,
350
+ period: 'monthly',
351
+ }),
352
+ monthly_1500: createPrice('price_1PuuarIewCKA2h0IEONPcFU5', {
353
+ status: 'active',
354
+ amount: 1500,
355
+ period: 'monthly',
356
+ }),
357
+ yearly_14400: createPrice('price_1Puub5IewCKA2h0IMJ3CQ58r', {
358
+ status: 'active',
359
+ amount: 14400,
360
+ period: 'yearly',
361
+ }),
166
362
  }),
167
363
  },
168
364
  legacy: {
169
365
  essential: createProduct('prod_FohIP5aSMWWGyY', {
170
- monthly_58: createPrice('plan_FohJzCujA6vvt4', 'active'),
366
+ monthly_58: createPrice('plan_FohJzCujA6vvt4', {
367
+ status: 'active',
368
+ amount: 58,
369
+ period: 'monthly',
370
+ }),
171
371
  }),
172
372
  essentialNew: createProduct('prod_GYXn73zcoJKsF8', {
173
- monthly_58: createPrice('plan_GYXn2cnPl5dy7j', 'active'),
174
- yearly_580: createPrice('price_1Gqb24IewCKA2h0ILP5rxTnT', 'active'),
373
+ monthly_58: createPrice('plan_GYXn2cnPl5dy7j', {
374
+ status: 'active',
375
+ amount: 58,
376
+ period: 'monthly',
377
+ }),
378
+ yearly_580: createPrice('price_1Gqb24IewCKA2h0ILP5rxTnT', {
379
+ status: 'active',
380
+ amount: 580,
381
+ period: 'yearly',
382
+ }),
175
383
  }),
176
384
  professional: createProduct('prod_GYXouE5K7vuitU', {
177
- monthly_199: createPrice('plan_GYXoKsa2j0yURg', 'active'),
178
- yearly_1990: createPrice('price_1KHTgaIewCKA2h0I81TVg85r', 'inactive'),
179
- yearly_2388: createPrice('price_1KLT32IewCKA2h0IFeJOAgG5', 'active'),
385
+ monthly_199: createPrice('plan_GYXoKsa2j0yURg', {
386
+ status: 'active',
387
+ amount: 199,
388
+ period: 'monthly',
389
+ }),
390
+ yearly_1990: createPrice('price_1KHTgaIewCKA2h0I81TVg85r', {
391
+ status: 'inactive',
392
+ amount: 1990,
393
+ period: 'yearly',
394
+ }),
395
+ yearly_2388: createPrice('price_1KLT32IewCKA2h0IFeJOAgG5', {
396
+ status: 'active',
397
+ amount: 2388,
398
+ period: 'yearly',
399
+ }),
180
400
  }),
181
401
  startup: createProduct('prod_FdmCGcrX2IETUH', {
182
- monthly_49: createPrice('plan_FdmDAUN7JGD8pR', 'active'),
183
- yearly_200: createPrice('plan_Ft8qvk401twwrW', 'active'),
402
+ monthly_49: createPrice('plan_FdmDAUN7JGD8pR', {
403
+ status: 'active',
404
+ amount: 49,
405
+ period: 'monthly',
406
+ }),
407
+ yearly_200: createPrice('plan_Ft8qvk401twwrW', {
408
+ status: 'active',
409
+ amount: 200,
410
+ period: 'yearly',
411
+ }),
184
412
  }),
185
413
  growth: createProduct('prod_FohKfjLOlJNm1W', {
186
- monthly_199: createPrice('plan_FohKGuWis5ocsi', 'active'),
414
+ monthly_199: createPrice('plan_FohKGuWis5ocsi', {
415
+ status: 'active',
416
+ amount: 199,
417
+ period: 'monthly',
418
+ }),
187
419
  }),
188
420
  business: createProduct('prod_FdmEvAgT7ZtVEw', {
189
- monthly_199: createPrice('plan_FdmE8akq9ukxiY', 'active'),
421
+ monthly_199: createPrice('plan_FdmE8akq9ukxiY', {
422
+ status: 'active',
423
+ amount: 199,
424
+ period: 'monthly',
425
+ }),
190
426
  }),
191
427
  enterprise: createProduct('prod_GuGGWeMQ3SCuE9', {
192
- monthly_700: createPrice('plan_GuGICX6nRtDthN', 'active'),
428
+ monthly_700: createPrice('plan_GuGICX6nRtDthN', {
429
+ status: 'active',
430
+ amount: 700,
431
+ period: 'monthly',
432
+ }),
193
433
  }),
194
434
  },
195
435
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@todesktop/shared",
3
- "version": "7.188.66",
3
+ "version": "7.188.68",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
package/src/base.ts CHANGED
@@ -96,6 +96,7 @@ export interface IAppMeta {
96
96
  electron?: string;
97
97
  version?: string;
98
98
  };
99
+ previousInstallLockSha?: string;
99
100
  releaseRedirections?: ReleaseRedirectionRule[];
100
101
  windowsEVOnboarding?: {
101
102
  provider: WindowsEVOnboardingProvider;
@@ -171,6 +172,7 @@ export interface ToDesktopJson {
171
172
  schemaVersion: number;
172
173
  snap?: IAppBuilderLib['config']['snap'];
173
174
  uploadSizeLimit?: number;
175
+ useCachedDependencies?: boolean;
174
176
  windows?: {
175
177
  icon?: FilePath;
176
178
  nsisCustomBinary?: {
package/src/plans.ts CHANGED
@@ -1,7 +1,12 @@
1
1
  import { Subscription } from './base';
2
2
 
3
3
  export type PriceKey = `${'monthly' | 'yearly'}_${string}`;
4
- export type Price = { id: string; status: 'active' | 'inactive' };
4
+ export type Price = {
5
+ id: string;
6
+ status: 'active' | 'inactive';
7
+ period: 'monthly' | 'yearly';
8
+ amount: number;
9
+ };
5
10
 
6
11
  export type Product<T extends PriceKey = any> = {
7
12
  id: string;
@@ -48,8 +53,8 @@ export enum PortalConfigKey {
48
53
  }
49
54
 
50
55
  // --- factory functions ---
51
- const createPrice = (id: string, status: Price['status']): Price => {
52
- return { id, status };
56
+ const createPrice = (id: string, price: Omit<Price, 'id'>): Price => {
57
+ return { id, ...price };
53
58
  };
54
59
 
55
60
  const createProduct = <T extends PriceKey>(
@@ -113,132 +118,372 @@ export const products = {
113
118
  dev: {
114
119
  builder: {
115
120
  essential: createProduct('prod_MoR1S4o0nLv00y', {
116
- monthly_99: createPrice('price_1M4o9XIewCKA2h0IVfGrid8E', 'inactive'),
117
- monthly_125: createPrice('price_1PuuAqIewCKA2h0Iw4judQNj', 'active'),
118
- yearly_1200: createPrice('price_1PuvdgIewCKA2h0IisTKqjFN', 'active'),
121
+ monthly_99: createPrice('price_1M4o9XIewCKA2h0IVfGrid8E', {
122
+ status: 'inactive',
123
+ amount: 99,
124
+ period: 'monthly',
125
+ }),
126
+ monthly_125: createPrice('price_1PuuAqIewCKA2h0Iw4judQNj', {
127
+ status: 'active',
128
+ amount: 125,
129
+ period: 'monthly',
130
+ }),
131
+ yearly_1200: createPrice('price_1PuvdgIewCKA2h0IisTKqjFN', {
132
+ status: 'active',
133
+ amount: 1200,
134
+ period: 'yearly',
135
+ }),
119
136
  }),
120
137
  professional: createProduct('prod_MoR1SchsRDAIgY', {
121
- monthly_199: createPrice('price_1M4o9vIewCKA2h0IHREokdD8', 'inactive'),
122
- monthly_240: createPrice('price_1M4o9vIewCKA2h0IHREokdD8', 'inactive'),
123
- monthly_300: createPrice('price_1PuuHrIewCKA2h0IQfEZ4Wog', 'active'),
124
- yearly_2880: createPrice('price_1PuuJAIewCKA2h0IibpUIhf9', 'active'),
138
+ monthly_199: createPrice('price_1M4o9vIewCKA2h0IHREokdD8', {
139
+ status: 'inactive',
140
+ amount: 199,
141
+ period: 'monthly',
142
+ }),
143
+ monthly_240: createPrice('price_1M4o9vIewCKA2h0IHREokdD8', {
144
+ status: 'inactive',
145
+ amount: 240,
146
+ period: 'monthly',
147
+ }),
148
+ monthly_300: createPrice('price_1PuuHrIewCKA2h0IQfEZ4Wog', {
149
+ status: 'active',
150
+ amount: 300,
151
+ period: 'monthly',
152
+ }),
153
+ yearly_2880: createPrice('price_1PuuJAIewCKA2h0IibpUIhf9', {
154
+ status: 'active',
155
+ amount: 2880,
156
+ period: 'yearly',
157
+ }),
125
158
  }),
126
159
  },
127
160
  cli: {
128
161
  founder30: createProduct('prod_GsL6LaRo4NFD5n', {
129
- monthly_30: createPrice('plan_GsL7NZskOY0TC9', 'active'),
162
+ monthly_30: createPrice('plan_GsL7NZskOY0TC9', {
163
+ status: 'active',
164
+ amount: 30,
165
+ period: 'monthly',
166
+ }),
130
167
  }),
131
168
  founder50: createProduct('prod_GsL5O1PdbxOrxJ', {
132
- monthly_50: createPrice('plan_GsL6VYAshfh7c4', 'active'),
133
- monthly_90: createPrice('plan_GsL6VYAshfh7c4', 'inactive'),
169
+ monthly_50: createPrice('plan_GsL6VYAshfh7c4', {
170
+ status: 'active',
171
+ amount: 50,
172
+ period: 'monthly',
173
+ }),
174
+ monthly_90: createPrice('plan_GsL6VYAshfh7c4', {
175
+ status: 'inactive',
176
+ amount: 90,
177
+ period: 'monthly',
178
+ }),
134
179
  }),
135
180
  founder: createProduct('prod_Gq0E8nbTYHtkPl', {
136
- monthly_100: createPrice('plan_Gq0FzdmoTJshQL', 'inactive'),
137
- monthly_125: createPrice('price_1PuuMRIewCKA2h0IrggfwCwA', 'active'),
138
- yearly_1200: createPrice('price_1PuuMkIewCKA2h0IRxhkDpmk', 'active'),
181
+ monthly_100: createPrice('plan_Gq0FzdmoTJshQL', {
182
+ status: 'inactive',
183
+ amount: 100,
184
+ period: 'monthly',
185
+ }),
186
+ monthly_125: createPrice('price_1PuuMRIewCKA2h0IrggfwCwA', {
187
+ status: 'active',
188
+ amount: 125,
189
+ period: 'monthly',
190
+ }),
191
+ yearly_1200: createPrice('price_1PuuMkIewCKA2h0IRxhkDpmk', {
192
+ status: 'active',
193
+ amount: 1200,
194
+ period: 'yearly',
195
+ }),
139
196
  }),
140
197
  performance: createProduct('prod_LphQku6BNkzCga', {
141
- monthly_300: createPrice('price_1L821UIewCKA2h0IUwRhicyo', 'inactive'),
142
- monthly_375: createPrice('price_1PuuO7IewCKA2h0IOK9ivzS0', 'active'),
143
- yearly_3600: createPrice('price_1PuuOKIewCKA2h0IrcVvJkgG', 'active'),
198
+ monthly_300: createPrice('price_1L821UIewCKA2h0IUwRhicyo', {
199
+ status: 'inactive',
200
+ amount: 300,
201
+ period: 'monthly',
202
+ }),
203
+ monthly_375: createPrice('price_1PuuO7IewCKA2h0IOK9ivzS0', {
204
+ status: 'active',
205
+ amount: 375,
206
+ period: 'monthly',
207
+ }),
208
+ yearly_3600: createPrice('price_1PuuOKIewCKA2h0IrcVvJkgG', {
209
+ status: 'active',
210
+ amount: 3600,
211
+ period: 'yearly',
212
+ }),
144
213
  }),
145
214
  scale: createProduct('prod_LphQxNgfUIxVfA', {
146
- monthly_1200: createPrice('price_1L821wIewCKA2h0IMLUmjulL', 'inactive'),
147
- monthly_1500: createPrice('price_1PuuPFIewCKA2h0IbPmKdsJr', 'active'),
148
- yearly_14400: createPrice('price_1PuuPaIewCKA2h0IhLfSlRFj', 'active'),
215
+ monthly_1200: createPrice('price_1L821wIewCKA2h0IMLUmjulL', {
216
+ status: 'inactive',
217
+ amount: 1200,
218
+ period: 'monthly',
219
+ }),
220
+ monthly_1500: createPrice('price_1PuuPFIewCKA2h0IbPmKdsJr', {
221
+ status: 'active',
222
+ amount: 1500,
223
+ period: 'monthly',
224
+ }),
225
+ yearly_14400: createPrice('price_1PuuPaIewCKA2h0IhLfSlRFj', {
226
+ status: 'active',
227
+ amount: 14400,
228
+ period: 'yearly',
229
+ }),
149
230
  }),
150
231
  },
151
232
  legacy: {
152
233
  essential: createProduct('prod_FplN7CkqFRH0ye', {
153
- monthly_58: createPrice('plan_FpljxNuZtNFFbm', 'active'),
234
+ monthly_58: createPrice('plan_FpljxNuZtNFFbm', {
235
+ status: 'active',
236
+ amount: 58,
237
+ period: 'monthly',
238
+ }),
154
239
  }),
155
240
  essentialNew: createProduct('prod_GYXm5X66hM1Ywj', {
156
- monthly_58: createPrice('plan_GYXmTA3EdfCv4q', 'active'),
157
- yearly_580: createPrice('plan_GYXmTA3EdfCv4q', 'active'),
241
+ monthly_58: createPrice('plan_GYXmTA3EdfCv4q', {
242
+ status: 'active',
243
+ amount: 58,
244
+ period: 'monthly',
245
+ }),
246
+ yearly_580: createPrice('plan_GYXmTA3EdfCv4q', {
247
+ status: 'active',
248
+ amount: 580,
249
+ period: 'yearly',
250
+ }),
158
251
  }),
159
252
  professional: createProduct('prod_GYXo54YK5kga12', {
160
- monthly_199: createPrice('plan_GYXoIkvwVKyfF2', 'active'),
161
- yearly_1990: createPrice('price_1KHU70IewCKA2h0IR87yXOQ2', 'inactive'),
162
- yearly_2388: createPrice('price_1KHU70IewCKA2h0IR87yXOQ2', 'active'),
253
+ monthly_199: createPrice('plan_GYXoIkvwVKyfF2', {
254
+ status: 'active',
255
+ amount: 199,
256
+ period: 'monthly',
257
+ }),
258
+ yearly_1990: createPrice('price_1KHU70IewCKA2h0IR87yXOQ2', {
259
+ status: 'inactive',
260
+ amount: 1990,
261
+ period: 'yearly',
262
+ }),
263
+ yearly_2388: createPrice('price_1KHU70IewCKA2h0IR87yXOQ2', {
264
+ status: 'active',
265
+ amount: 2388,
266
+ period: 'yearly',
267
+ }),
163
268
  }),
164
269
  startup: createProduct('prod_Fe8BTslXbdylxV', {
165
- monthly_49: createPrice('plan_Fe8BzLp7k71eGD', 'active'),
166
- yearly_200: createPrice('plan_Fe8BzLp7k71eGD', 'active'),
270
+ monthly_49: createPrice('plan_Fe8BzLp7k71eGD', {
271
+ status: 'active',
272
+ amount: 49,
273
+ period: 'monthly',
274
+ }),
275
+ yearly_200: createPrice('plan_Fe8BzLp7k71eGD', {
276
+ status: 'active',
277
+ amount: 200,
278
+ period: 'yearly',
279
+ }),
167
280
  }),
168
281
  growth: createProduct('prod_FplOSDbBmxba94', {
169
- monthly_199: createPrice('plan_FplOshrr1w3Mvu', 'active'),
282
+ monthly_199: createPrice('plan_FplOshrr1w3Mvu', {
283
+ status: 'active',
284
+ amount: 199,
285
+ period: 'monthly',
286
+ }),
170
287
  }),
171
288
  business: createProduct('prod_Fe8CbCE2wGJIWr', {
172
- monthly_199: createPrice('plan_Fe8CUkZfXasFtB', 'active'),
289
+ monthly_199: createPrice('plan_Fe8CUkZfXasFtB', {
290
+ status: 'active',
291
+ amount: 199,
292
+ period: 'monthly',
293
+ }),
173
294
  }),
174
295
  enterprise: createProduct('prod_Hc9PMnHUmHvOlw', {
175
- monthly_700: createPrice('price_1H2v6JIewCKA2h0IgUwsuctb', 'active'),
296
+ monthly_700: createPrice('price_1H2v6JIewCKA2h0IgUwsuctb', {
297
+ status: 'active',
298
+ amount: 700,
299
+ period: 'monthly',
300
+ }),
176
301
  }),
177
302
  },
178
303
  },
179
304
  prod: {
180
305
  builder: {
181
306
  essential: createProduct('prod_MoR2Ldm5PJpJZJ', {
182
- monthly_99: createPrice('price_1M4oA4IewCKA2h0IWgfbSJBe', 'inactive'),
183
- monthly_125: createPrice('price_1PuuU1IewCKA2h0IUSAcuUUb', 'active'),
184
- yearly_1200: createPrice('price_1PuuUZIewCKA2h0IDMNwNqQl', 'active'),
307
+ monthly_99: createPrice('price_1M4oA4IewCKA2h0IWgfbSJBe', {
308
+ status: 'inactive',
309
+ amount: 99,
310
+ period: 'monthly',
311
+ }),
312
+ monthly_125: createPrice('price_1PuuU1IewCKA2h0IUSAcuUUb', {
313
+ status: 'active',
314
+ amount: 125,
315
+ period: 'monthly',
316
+ }),
317
+ yearly_1200: createPrice('price_1PuuUZIewCKA2h0IDMNwNqQl', {
318
+ status: 'active',
319
+ amount: 1200,
320
+ period: 'yearly',
321
+ }),
185
322
  }),
186
323
  professional: createProduct('prod_MoR2h0Nf16hhgb', {
187
- monthly_199: createPrice('price_1M4oABIewCKA2h0INkbaCbIS', 'inactive'),
188
- monthly_240: createPrice('price_1MIDxtIewCKA2h0IvWi5weJL', 'inactive'),
189
- monthly_300: createPrice('price_1PuuVSIewCKA2h0IETsLUwF9', 'active'),
190
- yearly_2880: createPrice('price_1PuuVmIewCKA2h0I37dMpqI5', 'active'),
324
+ monthly_199: createPrice('price_1M4oABIewCKA2h0INkbaCbIS', {
325
+ status: 'inactive',
326
+ amount: 199,
327
+ period: 'monthly',
328
+ }),
329
+ monthly_240: createPrice('price_1MIDxtIewCKA2h0IvWi5weJL', {
330
+ status: 'inactive',
331
+ amount: 240,
332
+ period: 'monthly',
333
+ }),
334
+ monthly_300: createPrice('price_1PuuVSIewCKA2h0IETsLUwF9', {
335
+ status: 'active',
336
+ amount: 300,
337
+ period: 'monthly',
338
+ }),
339
+ yearly_2880: createPrice('price_1PuuVmIewCKA2h0I37dMpqI5', {
340
+ status: 'active',
341
+ amount: 2880,
342
+ period: 'yearly',
343
+ }),
191
344
  }),
192
345
  },
193
346
  cli: {
194
347
  founder30: createProduct('prod_GrHtZKuUDvLZOF', {
195
- monthly_30: createPrice('plan_GrHuyGjzYN0XN2', 'active'),
348
+ monthly_30: createPrice('plan_GrHuyGjzYN0XN2', {
349
+ status: 'active',
350
+ amount: 30,
351
+ period: 'monthly',
352
+ }),
196
353
  }),
197
354
  founder50: createProduct('prod_GsL0ntimYpTTwD', {
198
- monthly_50: createPrice('plan_GsL1IRUwpj5CIF', 'active'),
199
- monthly_90: createPrice('price_1JMHNnIewCKA2h0II5RGjVtk', 'inactive'),
355
+ monthly_50: createPrice('plan_GsL1IRUwpj5CIF', {
356
+ status: 'active',
357
+ amount: 50,
358
+ period: 'monthly',
359
+ }),
360
+ monthly_90: createPrice('price_1JMHNnIewCKA2h0II5RGjVtk', {
361
+ status: 'inactive',
362
+ amount: 90,
363
+ period: 'monthly',
364
+ }),
200
365
  }),
201
366
  founder: createProduct('prod_GpzVRVsBgluoef', {
202
- monthly_100: createPrice('plan_GpzWZLfsOzjrvI', 'inactive'),
203
- monthly_125: createPrice('price_1PuuXFIewCKA2h0IVHSyfFsd', 'active'),
204
- yearly_1200: createPrice('price_1PuuXYIewCKA2h0IAsygBajd', 'active'),
367
+ monthly_100: createPrice('plan_GpzWZLfsOzjrvI', {
368
+ status: 'inactive',
369
+ amount: 100,
370
+ period: 'monthly',
371
+ }),
372
+ monthly_125: createPrice('price_1PuuXFIewCKA2h0IVHSyfFsd', {
373
+ status: 'active',
374
+ amount: 125,
375
+ period: 'monthly',
376
+ }),
377
+ yearly_1200: createPrice('price_1PuuXYIewCKA2h0IAsygBajd', {
378
+ status: 'active',
379
+ amount: 1200,
380
+ period: 'yearly',
381
+ }),
205
382
  }),
206
383
  performance: createProduct('prod_LphRn5Rfuq3CMh', {
207
- monthly_300: createPrice('price_1L822LIewCKA2h0I5JYyOG1p', 'inactive'),
208
- monthly_375: createPrice('price_1PuuYKIewCKA2h0IWBJ4cyRQ', 'active'),
209
- yearly_3600: createPrice('price_1PuuYcIewCKA2h0IzeU1xWbQ', 'active'),
384
+ monthly_300: createPrice('price_1L822LIewCKA2h0I5JYyOG1p', {
385
+ status: 'inactive',
386
+ amount: 300,
387
+ period: 'monthly',
388
+ }),
389
+ monthly_375: createPrice('price_1PuuYKIewCKA2h0IWBJ4cyRQ', {
390
+ status: 'active',
391
+ amount: 375,
392
+ period: 'monthly',
393
+ }),
394
+ yearly_3600: createPrice('price_1PuuYcIewCKA2h0IzeU1xWbQ', {
395
+ status: 'active',
396
+ amount: 3600,
397
+ period: 'yearly',
398
+ }),
210
399
  }),
211
400
  scale: createProduct('prod_LphRKSuMLjQriP', {
212
- monthly_1200: createPrice('price_1L822RIewCKA2h0IPt9f2nZM', 'inactive'),
213
- monthly_1500: createPrice('price_1PuuarIewCKA2h0IEONPcFU5', 'active'),
214
- yearly_14400: createPrice('price_1Puub5IewCKA2h0IMJ3CQ58r', 'active'),
401
+ monthly_1200: createPrice('price_1L822RIewCKA2h0IPt9f2nZM', {
402
+ status: 'inactive',
403
+ amount: 1200,
404
+ period: 'monthly',
405
+ }),
406
+ monthly_1500: createPrice('price_1PuuarIewCKA2h0IEONPcFU5', {
407
+ status: 'active',
408
+ amount: 1500,
409
+ period: 'monthly',
410
+ }),
411
+ yearly_14400: createPrice('price_1Puub5IewCKA2h0IMJ3CQ58r', {
412
+ status: 'active',
413
+ amount: 14400,
414
+ period: 'yearly',
415
+ }),
215
416
  }),
216
417
  },
217
418
  legacy: {
218
419
  essential: createProduct('prod_FohIP5aSMWWGyY', {
219
- monthly_58: createPrice('plan_FohJzCujA6vvt4', 'active'),
420
+ monthly_58: createPrice('plan_FohJzCujA6vvt4', {
421
+ status: 'active',
422
+ amount: 58,
423
+ period: 'monthly',
424
+ }),
220
425
  }),
221
426
  essentialNew: createProduct('prod_GYXn73zcoJKsF8', {
222
- monthly_58: createPrice('plan_GYXn2cnPl5dy7j', 'active'),
223
- yearly_580: createPrice('price_1Gqb24IewCKA2h0ILP5rxTnT', 'active'),
427
+ monthly_58: createPrice('plan_GYXn2cnPl5dy7j', {
428
+ status: 'active',
429
+ amount: 58,
430
+ period: 'monthly',
431
+ }),
432
+ yearly_580: createPrice('price_1Gqb24IewCKA2h0ILP5rxTnT', {
433
+ status: 'active',
434
+ amount: 580,
435
+ period: 'yearly',
436
+ }),
224
437
  }),
225
438
  professional: createProduct('prod_GYXouE5K7vuitU', {
226
- monthly_199: createPrice('plan_GYXoKsa2j0yURg', 'active'),
227
- yearly_1990: createPrice('price_1KHTgaIewCKA2h0I81TVg85r', 'inactive'),
228
- yearly_2388: createPrice('price_1KLT32IewCKA2h0IFeJOAgG5', 'active'),
439
+ monthly_199: createPrice('plan_GYXoKsa2j0yURg', {
440
+ status: 'active',
441
+ amount: 199,
442
+ period: 'monthly',
443
+ }),
444
+ yearly_1990: createPrice('price_1KHTgaIewCKA2h0I81TVg85r', {
445
+ status: 'inactive',
446
+ amount: 1990,
447
+ period: 'yearly',
448
+ }),
449
+ yearly_2388: createPrice('price_1KLT32IewCKA2h0IFeJOAgG5', {
450
+ status: 'active',
451
+ amount: 2388,
452
+ period: 'yearly',
453
+ }),
229
454
  }),
230
455
  startup: createProduct('prod_FdmCGcrX2IETUH', {
231
- monthly_49: createPrice('plan_FdmDAUN7JGD8pR', 'active'),
232
- yearly_200: createPrice('plan_Ft8qvk401twwrW', 'active'),
456
+ monthly_49: createPrice('plan_FdmDAUN7JGD8pR', {
457
+ status: 'active',
458
+ amount: 49,
459
+ period: 'monthly',
460
+ }),
461
+ yearly_200: createPrice('plan_Ft8qvk401twwrW', {
462
+ status: 'active',
463
+ amount: 200,
464
+ period: 'yearly',
465
+ }),
233
466
  }),
234
467
  growth: createProduct('prod_FohKfjLOlJNm1W', {
235
- monthly_199: createPrice('plan_FohKGuWis5ocsi', 'active'),
468
+ monthly_199: createPrice('plan_FohKGuWis5ocsi', {
469
+ status: 'active',
470
+ amount: 199,
471
+ period: 'monthly',
472
+ }),
236
473
  }),
237
474
  business: createProduct('prod_FdmEvAgT7ZtVEw', {
238
- monthly_199: createPrice('plan_FdmE8akq9ukxiY', 'active'),
475
+ monthly_199: createPrice('plan_FdmE8akq9ukxiY', {
476
+ status: 'active',
477
+ amount: 199,
478
+ period: 'monthly',
479
+ }),
239
480
  }),
240
481
  enterprise: createProduct('prod_GuGGWeMQ3SCuE9', {
241
- monthly_700: createPrice('plan_GuGICX6nRtDthN', 'active'),
482
+ monthly_700: createPrice('plan_GuGICX6nRtDthN', {
483
+ status: 'active',
484
+ amount: 700,
485
+ period: 'monthly',
486
+ }),
242
487
  }),
243
488
  },
244
489
  },