@checkstack/script-packages-backend 0.2.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 (66) hide show
  1. package/CHANGELOG.md +273 -0
  2. package/drizzle/0000_flashy_squadron_supreme.sql +63 -0
  3. package/drizzle/0001_flawless_drax.sql +15 -0
  4. package/drizzle/meta/0000_snapshot.json +395 -0
  5. package/drizzle/meta/0001_snapshot.json +491 -0
  6. package/drizzle/meta/_journal.json +20 -0
  7. package/drizzle.config.ts +7 -0
  8. package/package.json +32 -0
  9. package/src/atomic-symlink.test.ts +47 -0
  10. package/src/atomic-symlink.ts +66 -0
  11. package/src/blob-gc-runner.test.ts +120 -0
  12. package/src/blob-gc-runner.ts +139 -0
  13. package/src/blob-gc.test.ts +182 -0
  14. package/src/blob-gc.ts +161 -0
  15. package/src/blob-hash.test.ts +70 -0
  16. package/src/blob-hash.ts +56 -0
  17. package/src/blob-store-registry.test.ts +78 -0
  18. package/src/blob-store-registry.ts +75 -0
  19. package/src/blob-store.ts +51 -0
  20. package/src/cache-archive.test.ts +164 -0
  21. package/src/cache-archive.ts +192 -0
  22. package/src/cache-layout.ts +64 -0
  23. package/src/data-dir.test.ts +41 -0
  24. package/src/data-dir.ts +42 -0
  25. package/src/e2e-install-reconcile.test.ts +121 -0
  26. package/src/hooks.ts +20 -0
  27. package/src/index.ts +594 -0
  28. package/src/install-controller.test.ts +257 -0
  29. package/src/install-controller.ts +144 -0
  30. package/src/install-service.test.ts +104 -0
  31. package/src/install-service.ts +116 -0
  32. package/src/install-state-store.ts +131 -0
  33. package/src/lockfile.test.ts +60 -0
  34. package/src/lockfile.ts +0 -0
  35. package/src/npmrc.test.ts +48 -0
  36. package/src/npmrc.ts +42 -0
  37. package/src/package-types.test.ts +293 -0
  38. package/src/package-types.ts +408 -0
  39. package/src/parse-bun-lock.test.ts +62 -0
  40. package/src/parse-bun-lock.ts +59 -0
  41. package/src/reconcile-diff.test.ts +41 -0
  42. package/src/reconcile-diff.ts +26 -0
  43. package/src/reconcile-fs.ts +199 -0
  44. package/src/reconciler.test.ts +289 -0
  45. package/src/reconciler.ts +81 -0
  46. package/src/registry-client.test.ts +314 -0
  47. package/src/registry-client.ts +0 -0
  48. package/src/registry-request-config.ts +63 -0
  49. package/src/registry-token.test.ts +124 -0
  50. package/src/registry-token.ts +104 -0
  51. package/src/resolution-root.test.ts +82 -0
  52. package/src/resolution-root.ts +127 -0
  53. package/src/resolver.test.ts +133 -0
  54. package/src/resolver.ts +132 -0
  55. package/src/router.ts +273 -0
  56. package/src/schema.ts +166 -0
  57. package/src/size-cap.test.ts +32 -0
  58. package/src/size-cap.ts +40 -0
  59. package/src/storage-migration.test.ts +318 -0
  60. package/src/storage-migration.ts +213 -0
  61. package/src/stores.ts +533 -0
  62. package/src/tree-gc.test.ts +184 -0
  63. package/src/tree-gc.ts +160 -0
  64. package/src/tree-retirement.ts +81 -0
  65. package/src/type-acquisition-route.ts +178 -0
  66. package/tsconfig.json +23 -0
@@ -0,0 +1,395 @@
1
+ {
2
+ "id": "033f32d0-38fc-4775-b1e3-ef2930de7493",
3
+ "prevId": "00000000-0000-0000-0000-000000000000",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.script_package_blob": {
8
+ "name": "script_package_blob",
9
+ "schema": "",
10
+ "columns": {
11
+ "integrity": {
12
+ "name": "integrity",
13
+ "type": "text",
14
+ "primaryKey": true,
15
+ "notNull": true
16
+ },
17
+ "name": {
18
+ "name": "name",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "version": {
24
+ "name": "version",
25
+ "type": "text",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "backend": {
30
+ "name": "backend",
31
+ "type": "text",
32
+ "primaryKey": false,
33
+ "notNull": true
34
+ },
35
+ "size_bytes": {
36
+ "name": "size_bytes",
37
+ "type": "bigint",
38
+ "primaryKey": false,
39
+ "notNull": true
40
+ },
41
+ "created_at": {
42
+ "name": "created_at",
43
+ "type": "timestamp",
44
+ "primaryKey": false,
45
+ "notNull": true,
46
+ "default": "now()"
47
+ }
48
+ },
49
+ "indexes": {
50
+ "script_package_blob_backend_idx": {
51
+ "name": "script_package_blob_backend_idx",
52
+ "columns": [
53
+ {
54
+ "expression": "backend",
55
+ "isExpression": false,
56
+ "asc": true,
57
+ "nulls": "last"
58
+ }
59
+ ],
60
+ "isUnique": false,
61
+ "concurrently": false,
62
+ "method": "btree",
63
+ "with": {}
64
+ }
65
+ },
66
+ "foreignKeys": {},
67
+ "compositePrimaryKeys": {},
68
+ "uniqueConstraints": {},
69
+ "policies": {},
70
+ "checkConstraints": {},
71
+ "isRLSEnabled": false
72
+ },
73
+ "public.script_package_install_state": {
74
+ "name": "script_package_install_state",
75
+ "schema": "",
76
+ "columns": {
77
+ "id": {
78
+ "name": "id",
79
+ "type": "text",
80
+ "primaryKey": true,
81
+ "notNull": true,
82
+ "default": "'singleton'"
83
+ },
84
+ "status": {
85
+ "name": "status",
86
+ "type": "text",
87
+ "primaryKey": false,
88
+ "notNull": true,
89
+ "default": "'idle'"
90
+ },
91
+ "lockfile_hash": {
92
+ "name": "lockfile_hash",
93
+ "type": "text",
94
+ "primaryKey": false,
95
+ "notNull": false
96
+ },
97
+ "manifest": {
98
+ "name": "manifest",
99
+ "type": "jsonb",
100
+ "primaryKey": false,
101
+ "notNull": true,
102
+ "default": "'[]'::jsonb"
103
+ },
104
+ "total_size_bytes": {
105
+ "name": "total_size_bytes",
106
+ "type": "bigint",
107
+ "primaryKey": false,
108
+ "notNull": true,
109
+ "default": 0
110
+ },
111
+ "last_installed_at": {
112
+ "name": "last_installed_at",
113
+ "type": "timestamp",
114
+ "primaryKey": false,
115
+ "notNull": false
116
+ },
117
+ "error_message": {
118
+ "name": "error_message",
119
+ "type": "text",
120
+ "primaryKey": false,
121
+ "notNull": false
122
+ }
123
+ },
124
+ "indexes": {},
125
+ "foreignKeys": {},
126
+ "compositePrimaryKeys": {},
127
+ "uniqueConstraints": {},
128
+ "policies": {},
129
+ "checkConstraints": {},
130
+ "isRLSEnabled": false
131
+ },
132
+ "public.script_package_registry_config": {
133
+ "name": "script_package_registry_config",
134
+ "schema": "",
135
+ "columns": {
136
+ "id": {
137
+ "name": "id",
138
+ "type": "text",
139
+ "primaryKey": true,
140
+ "notNull": true,
141
+ "default": "'singleton'"
142
+ },
143
+ "registry_url": {
144
+ "name": "registry_url",
145
+ "type": "text",
146
+ "primaryKey": false,
147
+ "notNull": true,
148
+ "default": "'https://registry.npmjs.org/'"
149
+ },
150
+ "scoped_registries": {
151
+ "name": "scoped_registries",
152
+ "type": "jsonb",
153
+ "primaryKey": false,
154
+ "notNull": true,
155
+ "default": "'[]'::jsonb"
156
+ },
157
+ "auth_secret_ref": {
158
+ "name": "auth_secret_ref",
159
+ "type": "text",
160
+ "primaryKey": false,
161
+ "notNull": false
162
+ },
163
+ "ignore_scripts": {
164
+ "name": "ignore_scripts",
165
+ "type": "boolean",
166
+ "primaryKey": false,
167
+ "notNull": true,
168
+ "default": true
169
+ },
170
+ "updated_at": {
171
+ "name": "updated_at",
172
+ "type": "timestamp",
173
+ "primaryKey": false,
174
+ "notNull": true,
175
+ "default": "now()"
176
+ }
177
+ },
178
+ "indexes": {},
179
+ "foreignKeys": {},
180
+ "compositePrimaryKeys": {},
181
+ "uniqueConstraints": {},
182
+ "policies": {},
183
+ "checkConstraints": {},
184
+ "isRLSEnabled": false
185
+ },
186
+ "public.script_package_satellite_state": {
187
+ "name": "script_package_satellite_state",
188
+ "schema": "",
189
+ "columns": {
190
+ "satellite_id": {
191
+ "name": "satellite_id",
192
+ "type": "text",
193
+ "primaryKey": true,
194
+ "notNull": true
195
+ },
196
+ "lockfile_hash": {
197
+ "name": "lockfile_hash",
198
+ "type": "text",
199
+ "primaryKey": false,
200
+ "notNull": false
201
+ },
202
+ "status": {
203
+ "name": "status",
204
+ "type": "text",
205
+ "primaryKey": false,
206
+ "notNull": true,
207
+ "default": "'pending'"
208
+ },
209
+ "error_message": {
210
+ "name": "error_message",
211
+ "type": "text",
212
+ "primaryKey": false,
213
+ "notNull": false
214
+ },
215
+ "synced_at": {
216
+ "name": "synced_at",
217
+ "type": "timestamp",
218
+ "primaryKey": false,
219
+ "notNull": false
220
+ }
221
+ },
222
+ "indexes": {},
223
+ "foreignKeys": {},
224
+ "compositePrimaryKeys": {},
225
+ "uniqueConstraints": {},
226
+ "policies": {},
227
+ "checkConstraints": {},
228
+ "isRLSEnabled": false
229
+ },
230
+ "public.script_package_size_cap": {
231
+ "name": "script_package_size_cap",
232
+ "schema": "",
233
+ "columns": {
234
+ "id": {
235
+ "name": "id",
236
+ "type": "text",
237
+ "primaryKey": true,
238
+ "notNull": true,
239
+ "default": "'singleton'"
240
+ },
241
+ "warn_bytes": {
242
+ "name": "warn_bytes",
243
+ "type": "bigint",
244
+ "primaryKey": false,
245
+ "notNull": true,
246
+ "default": 157286400
247
+ },
248
+ "block_bytes": {
249
+ "name": "block_bytes",
250
+ "type": "bigint",
251
+ "primaryKey": false,
252
+ "notNull": true,
253
+ "default": 314572800
254
+ },
255
+ "updated_at": {
256
+ "name": "updated_at",
257
+ "type": "timestamp",
258
+ "primaryKey": false,
259
+ "notNull": true,
260
+ "default": "now()"
261
+ }
262
+ },
263
+ "indexes": {},
264
+ "foreignKeys": {},
265
+ "compositePrimaryKeys": {},
266
+ "uniqueConstraints": {},
267
+ "policies": {},
268
+ "checkConstraints": {},
269
+ "isRLSEnabled": false
270
+ },
271
+ "public.script_package_storage_config": {
272
+ "name": "script_package_storage_config",
273
+ "schema": "",
274
+ "columns": {
275
+ "id": {
276
+ "name": "id",
277
+ "type": "text",
278
+ "primaryKey": true,
279
+ "notNull": true,
280
+ "default": "'singleton'"
281
+ },
282
+ "active_backend": {
283
+ "name": "active_backend",
284
+ "type": "text",
285
+ "primaryKey": false,
286
+ "notNull": true,
287
+ "default": "'postgres'"
288
+ },
289
+ "migration_status": {
290
+ "name": "migration_status",
291
+ "type": "text",
292
+ "primaryKey": false,
293
+ "notNull": true,
294
+ "default": "'idle'"
295
+ },
296
+ "migration_target": {
297
+ "name": "migration_target",
298
+ "type": "text",
299
+ "primaryKey": false,
300
+ "notNull": false
301
+ },
302
+ "migrated_count": {
303
+ "name": "migrated_count",
304
+ "type": "integer",
305
+ "primaryKey": false,
306
+ "notNull": true,
307
+ "default": 0
308
+ },
309
+ "migration_error": {
310
+ "name": "migration_error",
311
+ "type": "text",
312
+ "primaryKey": false,
313
+ "notNull": false
314
+ },
315
+ "updated_at": {
316
+ "name": "updated_at",
317
+ "type": "timestamp",
318
+ "primaryKey": false,
319
+ "notNull": true,
320
+ "default": "now()"
321
+ }
322
+ },
323
+ "indexes": {},
324
+ "foreignKeys": {},
325
+ "compositePrimaryKeys": {},
326
+ "uniqueConstraints": {},
327
+ "policies": {},
328
+ "checkConstraints": {},
329
+ "isRLSEnabled": false
330
+ },
331
+ "public.script_packages": {
332
+ "name": "script_packages",
333
+ "schema": "",
334
+ "columns": {
335
+ "name": {
336
+ "name": "name",
337
+ "type": "text",
338
+ "primaryKey": true,
339
+ "notNull": true
340
+ },
341
+ "version": {
342
+ "name": "version",
343
+ "type": "text",
344
+ "primaryKey": false,
345
+ "notNull": true
346
+ },
347
+ "enabled": {
348
+ "name": "enabled",
349
+ "type": "boolean",
350
+ "primaryKey": false,
351
+ "notNull": true,
352
+ "default": true
353
+ },
354
+ "added_by": {
355
+ "name": "added_by",
356
+ "type": "text",
357
+ "primaryKey": false,
358
+ "notNull": false
359
+ },
360
+ "added_at": {
361
+ "name": "added_at",
362
+ "type": "timestamp",
363
+ "primaryKey": false,
364
+ "notNull": true,
365
+ "default": "now()"
366
+ },
367
+ "updated_at": {
368
+ "name": "updated_at",
369
+ "type": "timestamp",
370
+ "primaryKey": false,
371
+ "notNull": true,
372
+ "default": "now()"
373
+ }
374
+ },
375
+ "indexes": {},
376
+ "foreignKeys": {},
377
+ "compositePrimaryKeys": {},
378
+ "uniqueConstraints": {},
379
+ "policies": {},
380
+ "checkConstraints": {},
381
+ "isRLSEnabled": false
382
+ }
383
+ },
384
+ "enums": {},
385
+ "schemas": {},
386
+ "sequences": {},
387
+ "roles": {},
388
+ "policies": {},
389
+ "views": {},
390
+ "_meta": {
391
+ "columns": {},
392
+ "schemas": {},
393
+ "tables": {}
394
+ }
395
+ }