pockethost 1.0.0-rc.1

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 (44) hide show
  1. package/LICENSE.md +16 -0
  2. package/dist/index.mjs +3156 -0
  3. package/dist/instance-app/migrations/1699198734_pockethost_defaults.js +39 -0
  4. package/dist/instance-app/pb_hooks/_ph_admin_sync.pb.js +71 -0
  5. package/dist/instance-app/pb_hooks/_ph_lib.js +19 -0
  6. package/dist/instance-app/tsconfig.json +8 -0
  7. package/dist/instance-app/types/goja.d.ts +58 -0
  8. package/dist/instance-app/types/lib.d.ts +5 -0
  9. package/dist/instance-app/types/types.d.ts +19573 -0
  10. package/dist/mothership-app/migrations/1705062576_collections_snapshot.js +1863 -0
  11. package/dist/mothership-app/migrations/1705083826_updated_stats.js +721 -0
  12. package/dist/mothership-app/migrations/1706060446_updated_instances.js +44 -0
  13. package/dist/mothership-app/pb_hooks/src/instances-create.pb.js +65 -0
  14. package/dist/mothership-app/pb_hooks/src/instances-delete.pb.js +69 -0
  15. package/dist/mothership-app/pb_hooks/src/instances-migrate-versions.pb.js +33 -0
  16. package/dist/mothership-app/pb_hooks/src/instances-notify-discord-after-create.pb.js +31 -0
  17. package/dist/mothership-app/pb_hooks/src/instances-notify-on-maintenance-mode.pb.js +52 -0
  18. package/dist/mothership-app/pb_hooks/src/instances-reset-idle.pb.js +7 -0
  19. package/dist/mothership-app/pb_hooks/src/instances-update.pb.js +121 -0
  20. package/dist/mothership-app/pb_hooks/src/instances-validate-before-create.pb.js +16 -0
  21. package/dist/mothership-app/pb_hooks/src/instances-validate-before-update.pb.js +43 -0
  22. package/dist/mothership-app/pb_hooks/src/lib.js +171 -0
  23. package/dist/mothership-app/pb_hooks/src/ls.pb.js +159 -0
  24. package/dist/mothership-app/pb_hooks/src/mail.pb.js +49 -0
  25. package/dist/mothership-app/pb_hooks/src/notifications.pb.js +62 -0
  26. package/dist/mothership-app/pb_hooks/src/random-words.js +2085 -0
  27. package/dist/mothership-app/pb_hooks/src/signup.pb.js +214 -0
  28. package/dist/mothership-app/pb_hooks/src/sns.pb.js +133 -0
  29. package/dist/mothership-app/pb_hooks/src/unsubscribe.pb.js +33 -0
  30. package/dist/mothership-app/pb_hooks/src/user-token.pb.js +33 -0
  31. package/dist/mothership-app/pb_hooks/src/user-welcome-msg.pb.js +32 -0
  32. package/dist/mothership-app/pb_hooks/src/versions-route.pb.js +12 -0
  33. package/dist/mothership-app/pb_hooks/src/versions.js +0 -0
  34. package/dist/mothership-app/pb_hooks/tsconfig.json +8 -0
  35. package/dist/mothership-app/pb_hooks/types/global.d.ts +1 -0
  36. package/dist/mothership-app/pb_hooks/types/goja.d.ts +58 -0
  37. package/dist/mothership-app/pb_hooks/types/lemon.d.ts +12 -0
  38. package/dist/mothership-app/pb_hooks/types/lib.d.ts +55 -0
  39. package/dist/mothership-app/pb_hooks/types/types.d.ts +19573 -0
  40. package/dist/mothership-app/ph_app/index.js +11 -0
  41. package/dist/mothership-app/ph_app/package-lock.json +657 -0
  42. package/dist/mothership-app/ph_app/package.json +14 -0
  43. package/package.json +144 -0
  44. package/readme.md +168 -0
@@ -0,0 +1,721 @@
1
+ /// <reference path="../pb_data/types.d.ts" />
2
+ migrate((db) => {
3
+ const dao = new Dao(db)
4
+ const collection = dao.findCollectionByNameOrId("buq519uv711078p")
5
+
6
+ collection.options = {
7
+ "query": "SELECT\n (ROW_NUMBER() OVER()) as id,\n (select value from settings where name='founders-edition-count') as founder_slots_remaining, \n COUNT(DISTINCT users.id) AS total_users,\n COUNT(DISTINCT CASE WHEN users.subscription ='legacy' THEN users.id END) AS total_legacy_subscribers,\n COUNT(DISTINCT CASE WHEN users.subscription ='free' THEN users.id END) AS total_free_subscribers,\n COUNT(DISTINCT CASE WHEN users.subscription= 'premium' THEN users.id END) AS total_pro_subscribers,\n COUNT(DISTINCT CASE WHEN users.subscription= 'lifetime' THEN users.id END) AS total_lifetime_subscribers,\n \n COUNT(DISTINCT CASE WHEN users.created > DATETIME('now', '-1 hour') THEN users.id END) AS new_users_last_hour,\n COUNT(DISTINCT CASE WHEN users.created > DATETIME('now', '-24 hours') THEN users.id END) AS new_users_last_24_hours,\n COUNT(DISTINCT CASE WHEN users.created > DATETIME('now', '-7 days') THEN users.id END) AS new_users_last_7_days,\n COUNT(DISTINCT CASE WHEN users.created > DATETIME('now', '-30 days') THEN users.id END) AS new_users_last_30_days,\n \n COUNT(DISTINCT instances.id ) AS total_instances,\n COUNT(DISTINCT CASE WHEN instances.updated > DATETIME('now', '-1 hour') THEN instances.id END) AS total_instances_last_hour,\n COUNT(DISTINCT CASE WHEN instances.updated > DATETIME('now', '-24 hours') THEN instances.id END) AS total_instances_last_24_hours,\n COUNT(DISTINCT CASE WHEN instances.updated > DATETIME('now', '-7 days') THEN instances.id END) AS total_instances_last_7_days,\n COUNT(DISTINCT CASE WHEN instances.updated > DATETIME('now', '-30 days') THEN instances.id END) AS total_instances_last_30_days,\n \n COUNT(DISTINCT CASE WHEN instances.created > DATETIME('now', '-1 hour') THEN instances.id END) AS new_instances_last_hour,\n COUNT(DISTINCT CASE WHEN instances.created > DATETIME('now', '-24 hours') THEN instances.id END) AS new_instances_last_24_hours,\n COUNT(DISTINCT CASE WHEN instances.created > DATETIME('now', '-7 days') THEN instances.id END) AS new_instances_last_7_days,\n COUNT(DISTINCT CASE WHEN instances.created > DATETIME('now', '-30 days') THEN instances.id END) AS new_instances_last_30_days\n \nFROM\n verified_users users\nLEFT JOIN\n instances ON users.id = instances.uid;\n"
8
+ }
9
+
10
+ // remove
11
+ collection.schema.removeField("xbiqigok")
12
+
13
+ // remove
14
+ collection.schema.removeField("fosqlcua")
15
+
16
+ // remove
17
+ collection.schema.removeField("ftqc6spe")
18
+
19
+ // remove
20
+ collection.schema.removeField("ydugkynl")
21
+
22
+ // remove
23
+ collection.schema.removeField("mmymwfrd")
24
+
25
+ // remove
26
+ collection.schema.removeField("ywa8rx3o")
27
+
28
+ // remove
29
+ collection.schema.removeField("t2iznzwl")
30
+
31
+ // remove
32
+ collection.schema.removeField("fxerbgja")
33
+
34
+ // remove
35
+ collection.schema.removeField("swxvleu2")
36
+
37
+ // remove
38
+ collection.schema.removeField("eyna5hix")
39
+
40
+ // remove
41
+ collection.schema.removeField("evyuzkc1")
42
+
43
+ // remove
44
+ collection.schema.removeField("uvs67m8a")
45
+
46
+ // remove
47
+ collection.schema.removeField("0w4bl6a6")
48
+
49
+ // remove
50
+ collection.schema.removeField("mjdkfffa")
51
+
52
+ // remove
53
+ collection.schema.removeField("q5u6pftm")
54
+
55
+ // remove
56
+ collection.schema.removeField("t1gswvzg")
57
+
58
+ // remove
59
+ collection.schema.removeField("lcfg6e5e")
60
+
61
+ // remove
62
+ collection.schema.removeField("w01k2s4v")
63
+
64
+ // add
65
+ collection.schema.addField(new SchemaField({
66
+ "system": false,
67
+ "id": "hy7njiza",
68
+ "name": "founder_slots_remaining",
69
+ "type": "json",
70
+ "required": false,
71
+ "presentable": false,
72
+ "unique": false,
73
+ "options": {
74
+ "maxSize": 1
75
+ }
76
+ }))
77
+
78
+ // add
79
+ collection.schema.addField(new SchemaField({
80
+ "system": false,
81
+ "id": "qpbvc5ut",
82
+ "name": "total_users",
83
+ "type": "number",
84
+ "required": false,
85
+ "presentable": false,
86
+ "unique": false,
87
+ "options": {
88
+ "min": null,
89
+ "max": null,
90
+ "noDecimal": false
91
+ }
92
+ }))
93
+
94
+ // add
95
+ collection.schema.addField(new SchemaField({
96
+ "system": false,
97
+ "id": "qlnytqmj",
98
+ "name": "total_legacy_subscribers",
99
+ "type": "number",
100
+ "required": false,
101
+ "presentable": false,
102
+ "unique": false,
103
+ "options": {
104
+ "min": null,
105
+ "max": null,
106
+ "noDecimal": false
107
+ }
108
+ }))
109
+
110
+ // add
111
+ collection.schema.addField(new SchemaField({
112
+ "system": false,
113
+ "id": "zbaplkwv",
114
+ "name": "total_free_subscribers",
115
+ "type": "number",
116
+ "required": false,
117
+ "presentable": false,
118
+ "unique": false,
119
+ "options": {
120
+ "min": null,
121
+ "max": null,
122
+ "noDecimal": false
123
+ }
124
+ }))
125
+
126
+ // add
127
+ collection.schema.addField(new SchemaField({
128
+ "system": false,
129
+ "id": "exu5uwpy",
130
+ "name": "total_pro_subscribers",
131
+ "type": "number",
132
+ "required": false,
133
+ "presentable": false,
134
+ "unique": false,
135
+ "options": {
136
+ "min": null,
137
+ "max": null,
138
+ "noDecimal": false
139
+ }
140
+ }))
141
+
142
+ // add
143
+ collection.schema.addField(new SchemaField({
144
+ "system": false,
145
+ "id": "btak3el2",
146
+ "name": "total_lifetime_subscribers",
147
+ "type": "number",
148
+ "required": false,
149
+ "presentable": false,
150
+ "unique": false,
151
+ "options": {
152
+ "min": null,
153
+ "max": null,
154
+ "noDecimal": false
155
+ }
156
+ }))
157
+
158
+ // add
159
+ collection.schema.addField(new SchemaField({
160
+ "system": false,
161
+ "id": "enur9h6p",
162
+ "name": "new_users_last_hour",
163
+ "type": "number",
164
+ "required": false,
165
+ "presentable": false,
166
+ "unique": false,
167
+ "options": {
168
+ "min": null,
169
+ "max": null,
170
+ "noDecimal": false
171
+ }
172
+ }))
173
+
174
+ // add
175
+ collection.schema.addField(new SchemaField({
176
+ "system": false,
177
+ "id": "zypx3s5g",
178
+ "name": "new_users_last_24_hours",
179
+ "type": "number",
180
+ "required": false,
181
+ "presentable": false,
182
+ "unique": false,
183
+ "options": {
184
+ "min": null,
185
+ "max": null,
186
+ "noDecimal": false
187
+ }
188
+ }))
189
+
190
+ // add
191
+ collection.schema.addField(new SchemaField({
192
+ "system": false,
193
+ "id": "8o6qwwpk",
194
+ "name": "new_users_last_7_days",
195
+ "type": "number",
196
+ "required": false,
197
+ "presentable": false,
198
+ "unique": false,
199
+ "options": {
200
+ "min": null,
201
+ "max": null,
202
+ "noDecimal": false
203
+ }
204
+ }))
205
+
206
+ // add
207
+ collection.schema.addField(new SchemaField({
208
+ "system": false,
209
+ "id": "owppxkp1",
210
+ "name": "new_users_last_30_days",
211
+ "type": "number",
212
+ "required": false,
213
+ "presentable": false,
214
+ "unique": false,
215
+ "options": {
216
+ "min": null,
217
+ "max": null,
218
+ "noDecimal": false
219
+ }
220
+ }))
221
+
222
+ // add
223
+ collection.schema.addField(new SchemaField({
224
+ "system": false,
225
+ "id": "t5hfbuy0",
226
+ "name": "total_instances",
227
+ "type": "number",
228
+ "required": false,
229
+ "presentable": false,
230
+ "unique": false,
231
+ "options": {
232
+ "min": null,
233
+ "max": null,
234
+ "noDecimal": false
235
+ }
236
+ }))
237
+
238
+ // add
239
+ collection.schema.addField(new SchemaField({
240
+ "system": false,
241
+ "id": "hy6ksvwr",
242
+ "name": "total_instances_last_hour",
243
+ "type": "number",
244
+ "required": false,
245
+ "presentable": false,
246
+ "unique": false,
247
+ "options": {
248
+ "min": null,
249
+ "max": null,
250
+ "noDecimal": false
251
+ }
252
+ }))
253
+
254
+ // add
255
+ collection.schema.addField(new SchemaField({
256
+ "system": false,
257
+ "id": "esvqpfks",
258
+ "name": "total_instances_last_24_hours",
259
+ "type": "number",
260
+ "required": false,
261
+ "presentable": false,
262
+ "unique": false,
263
+ "options": {
264
+ "min": null,
265
+ "max": null,
266
+ "noDecimal": false
267
+ }
268
+ }))
269
+
270
+ // add
271
+ collection.schema.addField(new SchemaField({
272
+ "system": false,
273
+ "id": "yl9gsbnh",
274
+ "name": "total_instances_last_7_days",
275
+ "type": "number",
276
+ "required": false,
277
+ "presentable": false,
278
+ "unique": false,
279
+ "options": {
280
+ "min": null,
281
+ "max": null,
282
+ "noDecimal": false
283
+ }
284
+ }))
285
+
286
+ // add
287
+ collection.schema.addField(new SchemaField({
288
+ "system": false,
289
+ "id": "fob5xhbs",
290
+ "name": "total_instances_last_30_days",
291
+ "type": "number",
292
+ "required": false,
293
+ "presentable": false,
294
+ "unique": false,
295
+ "options": {
296
+ "min": null,
297
+ "max": null,
298
+ "noDecimal": false
299
+ }
300
+ }))
301
+
302
+ // add
303
+ collection.schema.addField(new SchemaField({
304
+ "system": false,
305
+ "id": "upjeewnx",
306
+ "name": "new_instances_last_hour",
307
+ "type": "number",
308
+ "required": false,
309
+ "presentable": false,
310
+ "unique": false,
311
+ "options": {
312
+ "min": null,
313
+ "max": null,
314
+ "noDecimal": false
315
+ }
316
+ }))
317
+
318
+ // add
319
+ collection.schema.addField(new SchemaField({
320
+ "system": false,
321
+ "id": "2quxsopb",
322
+ "name": "new_instances_last_24_hours",
323
+ "type": "number",
324
+ "required": false,
325
+ "presentable": false,
326
+ "unique": false,
327
+ "options": {
328
+ "min": null,
329
+ "max": null,
330
+ "noDecimal": false
331
+ }
332
+ }))
333
+
334
+ // add
335
+ collection.schema.addField(new SchemaField({
336
+ "system": false,
337
+ "id": "9u8mi3xv",
338
+ "name": "new_instances_last_7_days",
339
+ "type": "number",
340
+ "required": false,
341
+ "presentable": false,
342
+ "unique": false,
343
+ "options": {
344
+ "min": null,
345
+ "max": null,
346
+ "noDecimal": false
347
+ }
348
+ }))
349
+
350
+ // add
351
+ collection.schema.addField(new SchemaField({
352
+ "system": false,
353
+ "id": "crqnqirt",
354
+ "name": "new_instances_last_30_days",
355
+ "type": "number",
356
+ "required": false,
357
+ "presentable": false,
358
+ "unique": false,
359
+ "options": {
360
+ "min": null,
361
+ "max": null,
362
+ "noDecimal": false
363
+ }
364
+ }))
365
+
366
+ return dao.saveCollection(collection)
367
+ }, (db) => {
368
+ const dao = new Dao(db)
369
+ const collection = dao.findCollectionByNameOrId("buq519uv711078p")
370
+
371
+ collection.options = {
372
+ "query": "SELECT\n (ROW_NUMBER() OVER()) as id,\n \n COUNT(DISTINCT users.id) AS total_users,\n COUNT(DISTINCT CASE WHEN users.subscription ='legacy' THEN users.id END) AS total_legacy_subscribers,\n COUNT(DISTINCT CASE WHEN users.subscription ='free' THEN users.id END) AS total_free_subscribers,\n COUNT(DISTINCT CASE WHEN users.subscription= 'premium' THEN users.id END) AS total_pro_subscribers,\n COUNT(DISTINCT CASE WHEN users.subscription= 'lifetime' THEN users.id END) AS total_lifetime_subscribers,\n \n COUNT(DISTINCT CASE WHEN users.created > DATETIME('now', '-1 hour') THEN users.id END) AS new_users_last_hour,\n COUNT(DISTINCT CASE WHEN users.created > DATETIME('now', '-24 hours') THEN users.id END) AS new_users_last_24_hours,\n COUNT(DISTINCT CASE WHEN users.created > DATETIME('now', '-7 days') THEN users.id END) AS new_users_last_7_days,\n COUNT(DISTINCT CASE WHEN users.created > DATETIME('now', '-30 days') THEN users.id END) AS new_users_last_30_days,\n \n COUNT(DISTINCT instances.id ) AS total_instances,\n COUNT(DISTINCT CASE WHEN instances.updated > DATETIME('now', '-1 hour') THEN instances.id END) AS total_instances_last_hour,\n COUNT(DISTINCT CASE WHEN instances.updated > DATETIME('now', '-24 hours') THEN instances.id END) AS total_instances_last_24_hours,\n COUNT(DISTINCT CASE WHEN instances.updated > DATETIME('now', '-7 days') THEN instances.id END) AS total_instances_last_7_days,\n COUNT(DISTINCT CASE WHEN instances.updated > DATETIME('now', '-30 days') THEN instances.id END) AS total_instances_last_30_days,\n \n COUNT(DISTINCT CASE WHEN instances.created > DATETIME('now', '-1 hour') THEN instances.id END) AS new_instances_last_hour,\n COUNT(DISTINCT CASE WHEN instances.created > DATETIME('now', '-24 hours') THEN instances.id END) AS new_instances_last_24_hours,\n COUNT(DISTINCT CASE WHEN instances.created > DATETIME('now', '-7 days') THEN instances.id END) AS new_instances_last_7_days,\n COUNT(DISTINCT CASE WHEN instances.created > DATETIME('now', '-30 days') THEN instances.id END) AS new_instances_last_30_days\n \nFROM\n verified_users users\nLEFT JOIN\n instances ON users.id = instances.uid;\n"
373
+ }
374
+
375
+ // add
376
+ collection.schema.addField(new SchemaField({
377
+ "system": false,
378
+ "id": "xbiqigok",
379
+ "name": "total_users",
380
+ "type": "number",
381
+ "required": false,
382
+ "presentable": false,
383
+ "unique": false,
384
+ "options": {
385
+ "min": null,
386
+ "max": null,
387
+ "noDecimal": false
388
+ }
389
+ }))
390
+
391
+ // add
392
+ collection.schema.addField(new SchemaField({
393
+ "system": false,
394
+ "id": "fosqlcua",
395
+ "name": "total_legacy_subscribers",
396
+ "type": "number",
397
+ "required": false,
398
+ "presentable": false,
399
+ "unique": false,
400
+ "options": {
401
+ "min": null,
402
+ "max": null,
403
+ "noDecimal": false
404
+ }
405
+ }))
406
+
407
+ // add
408
+ collection.schema.addField(new SchemaField({
409
+ "system": false,
410
+ "id": "ftqc6spe",
411
+ "name": "total_free_subscribers",
412
+ "type": "number",
413
+ "required": false,
414
+ "presentable": false,
415
+ "unique": false,
416
+ "options": {
417
+ "min": null,
418
+ "max": null,
419
+ "noDecimal": false
420
+ }
421
+ }))
422
+
423
+ // add
424
+ collection.schema.addField(new SchemaField({
425
+ "system": false,
426
+ "id": "ydugkynl",
427
+ "name": "total_pro_subscribers",
428
+ "type": "number",
429
+ "required": false,
430
+ "presentable": false,
431
+ "unique": false,
432
+ "options": {
433
+ "min": null,
434
+ "max": null,
435
+ "noDecimal": false
436
+ }
437
+ }))
438
+
439
+ // add
440
+ collection.schema.addField(new SchemaField({
441
+ "system": false,
442
+ "id": "mmymwfrd",
443
+ "name": "total_lifetime_subscribers",
444
+ "type": "number",
445
+ "required": false,
446
+ "presentable": false,
447
+ "unique": false,
448
+ "options": {
449
+ "min": null,
450
+ "max": null,
451
+ "noDecimal": false
452
+ }
453
+ }))
454
+
455
+ // add
456
+ collection.schema.addField(new SchemaField({
457
+ "system": false,
458
+ "id": "ywa8rx3o",
459
+ "name": "new_users_last_hour",
460
+ "type": "number",
461
+ "required": false,
462
+ "presentable": false,
463
+ "unique": false,
464
+ "options": {
465
+ "min": null,
466
+ "max": null,
467
+ "noDecimal": false
468
+ }
469
+ }))
470
+
471
+ // add
472
+ collection.schema.addField(new SchemaField({
473
+ "system": false,
474
+ "id": "t2iznzwl",
475
+ "name": "new_users_last_24_hours",
476
+ "type": "number",
477
+ "required": false,
478
+ "presentable": false,
479
+ "unique": false,
480
+ "options": {
481
+ "min": null,
482
+ "max": null,
483
+ "noDecimal": false
484
+ }
485
+ }))
486
+
487
+ // add
488
+ collection.schema.addField(new SchemaField({
489
+ "system": false,
490
+ "id": "fxerbgja",
491
+ "name": "new_users_last_7_days",
492
+ "type": "number",
493
+ "required": false,
494
+ "presentable": false,
495
+ "unique": false,
496
+ "options": {
497
+ "min": null,
498
+ "max": null,
499
+ "noDecimal": false
500
+ }
501
+ }))
502
+
503
+ // add
504
+ collection.schema.addField(new SchemaField({
505
+ "system": false,
506
+ "id": "swxvleu2",
507
+ "name": "new_users_last_30_days",
508
+ "type": "number",
509
+ "required": false,
510
+ "presentable": false,
511
+ "unique": false,
512
+ "options": {
513
+ "min": null,
514
+ "max": null,
515
+ "noDecimal": false
516
+ }
517
+ }))
518
+
519
+ // add
520
+ collection.schema.addField(new SchemaField({
521
+ "system": false,
522
+ "id": "eyna5hix",
523
+ "name": "total_instances",
524
+ "type": "number",
525
+ "required": false,
526
+ "presentable": false,
527
+ "unique": false,
528
+ "options": {
529
+ "min": null,
530
+ "max": null,
531
+ "noDecimal": false
532
+ }
533
+ }))
534
+
535
+ // add
536
+ collection.schema.addField(new SchemaField({
537
+ "system": false,
538
+ "id": "evyuzkc1",
539
+ "name": "total_instances_last_hour",
540
+ "type": "number",
541
+ "required": false,
542
+ "presentable": false,
543
+ "unique": false,
544
+ "options": {
545
+ "min": null,
546
+ "max": null,
547
+ "noDecimal": false
548
+ }
549
+ }))
550
+
551
+ // add
552
+ collection.schema.addField(new SchemaField({
553
+ "system": false,
554
+ "id": "uvs67m8a",
555
+ "name": "total_instances_last_24_hours",
556
+ "type": "number",
557
+ "required": false,
558
+ "presentable": false,
559
+ "unique": false,
560
+ "options": {
561
+ "min": null,
562
+ "max": null,
563
+ "noDecimal": false
564
+ }
565
+ }))
566
+
567
+ // add
568
+ collection.schema.addField(new SchemaField({
569
+ "system": false,
570
+ "id": "0w4bl6a6",
571
+ "name": "total_instances_last_7_days",
572
+ "type": "number",
573
+ "required": false,
574
+ "presentable": false,
575
+ "unique": false,
576
+ "options": {
577
+ "min": null,
578
+ "max": null,
579
+ "noDecimal": false
580
+ }
581
+ }))
582
+
583
+ // add
584
+ collection.schema.addField(new SchemaField({
585
+ "system": false,
586
+ "id": "mjdkfffa",
587
+ "name": "total_instances_last_30_days",
588
+ "type": "number",
589
+ "required": false,
590
+ "presentable": false,
591
+ "unique": false,
592
+ "options": {
593
+ "min": null,
594
+ "max": null,
595
+ "noDecimal": false
596
+ }
597
+ }))
598
+
599
+ // add
600
+ collection.schema.addField(new SchemaField({
601
+ "system": false,
602
+ "id": "q5u6pftm",
603
+ "name": "new_instances_last_hour",
604
+ "type": "number",
605
+ "required": false,
606
+ "presentable": false,
607
+ "unique": false,
608
+ "options": {
609
+ "min": null,
610
+ "max": null,
611
+ "noDecimal": false
612
+ }
613
+ }))
614
+
615
+ // add
616
+ collection.schema.addField(new SchemaField({
617
+ "system": false,
618
+ "id": "t1gswvzg",
619
+ "name": "new_instances_last_24_hours",
620
+ "type": "number",
621
+ "required": false,
622
+ "presentable": false,
623
+ "unique": false,
624
+ "options": {
625
+ "min": null,
626
+ "max": null,
627
+ "noDecimal": false
628
+ }
629
+ }))
630
+
631
+ // add
632
+ collection.schema.addField(new SchemaField({
633
+ "system": false,
634
+ "id": "lcfg6e5e",
635
+ "name": "new_instances_last_7_days",
636
+ "type": "number",
637
+ "required": false,
638
+ "presentable": false,
639
+ "unique": false,
640
+ "options": {
641
+ "min": null,
642
+ "max": null,
643
+ "noDecimal": false
644
+ }
645
+ }))
646
+
647
+ // add
648
+ collection.schema.addField(new SchemaField({
649
+ "system": false,
650
+ "id": "w01k2s4v",
651
+ "name": "new_instances_last_30_days",
652
+ "type": "number",
653
+ "required": false,
654
+ "presentable": false,
655
+ "unique": false,
656
+ "options": {
657
+ "min": null,
658
+ "max": null,
659
+ "noDecimal": false
660
+ }
661
+ }))
662
+
663
+ // remove
664
+ collection.schema.removeField("hy7njiza")
665
+
666
+ // remove
667
+ collection.schema.removeField("qpbvc5ut")
668
+
669
+ // remove
670
+ collection.schema.removeField("qlnytqmj")
671
+
672
+ // remove
673
+ collection.schema.removeField("zbaplkwv")
674
+
675
+ // remove
676
+ collection.schema.removeField("exu5uwpy")
677
+
678
+ // remove
679
+ collection.schema.removeField("btak3el2")
680
+
681
+ // remove
682
+ collection.schema.removeField("enur9h6p")
683
+
684
+ // remove
685
+ collection.schema.removeField("zypx3s5g")
686
+
687
+ // remove
688
+ collection.schema.removeField("8o6qwwpk")
689
+
690
+ // remove
691
+ collection.schema.removeField("owppxkp1")
692
+
693
+ // remove
694
+ collection.schema.removeField("t5hfbuy0")
695
+
696
+ // remove
697
+ collection.schema.removeField("hy6ksvwr")
698
+
699
+ // remove
700
+ collection.schema.removeField("esvqpfks")
701
+
702
+ // remove
703
+ collection.schema.removeField("yl9gsbnh")
704
+
705
+ // remove
706
+ collection.schema.removeField("fob5xhbs")
707
+
708
+ // remove
709
+ collection.schema.removeField("upjeewnx")
710
+
711
+ // remove
712
+ collection.schema.removeField("2quxsopb")
713
+
714
+ // remove
715
+ collection.schema.removeField("9u8mi3xv")
716
+
717
+ // remove
718
+ collection.schema.removeField("crqnqirt")
719
+
720
+ return dao.saveCollection(collection)
721
+ })