palbase 0.44.2 → 0.45.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 (47) hide show
  1. package/dist/ai/index.js +2 -2
  2. package/dist/backend/engine.js +2 -2
  3. package/dist/backend/env.js +1 -1
  4. package/dist/backend/index.js +3 -3
  5. package/dist/backend/stack.js +1 -1
  6. package/dist/backend/test.js +2 -2
  7. package/dist/chunks/{32PKOO2G.js → 46RDJQ7Z.js} +2 -2
  8. package/dist/chunks/{MPGER2LF.js → 4YWROGXE.js} +2 -2
  9. package/dist/chunks/{X6MEWYA7.js → 5QUX45OF.js} +1 -1
  10. package/dist/chunks/{XCAG4JHP.js → A2DBBW6I.js} +1 -1
  11. package/dist/chunks/{2UKXPD55.js → D2O7FP4Z.js} +2 -2
  12. package/dist/chunks/{UVZ4TGRO.js → DLQW3KGQ.js} +2 -2
  13. package/dist/chunks/{GC7EQ7RE.js → F6IZFYXE.js} +2 -2
  14. package/dist/chunks/{P6VBZ22Z.js → F6VBM3I5.js} +2 -2
  15. package/dist/chunks/{2O456SJP.js → FYZDRZ4J.js} +7 -7
  16. package/dist/chunks/{Z27XP2BK.js → GLHJ3MIB.js} +1 -1
  17. package/dist/chunks/{ZETXRBPI.js → IL6DK7HN.js} +2 -2
  18. package/dist/chunks/{D5LMTC2J.js → J6F6MSZM.js} +2 -2
  19. package/dist/chunks/{DRJWUA4S.js → N35KDL6X.js} +1 -1
  20. package/dist/chunks/{GTUHGUQW.js → P4YE64Q3.js} +2 -2
  21. package/dist/chunks/{HKI7EIZ2.js → QEE3UYFB.js} +1 -1
  22. package/dist/chunks/{FDYCE744.js → QSGYQNNM.js} +2 -2
  23. package/dist/chunks/{CS7ORNIL.js → T5NWLVNS.js} +1 -1
  24. package/dist/chunks/{R2QYK4S4.js → TCJ4HHXC.js} +2 -2
  25. package/dist/chunks/{BNMW5GTM.js → TSGQB4OT.js} +2 -2
  26. package/dist/chunks/{SLJRNJ5W.js → WN2QJN5Z.js} +1 -1
  27. package/dist/chunks/{HJUNO2BJ.js → XP3VGN24.js} +2 -2
  28. package/dist/chunks/{HOGYHGSL.js → Z3MV6757.js} +2 -2
  29. package/dist/chunks/{EHNXPFMW.js → Z4OXYSYQ.js} +2 -2
  30. package/dist/cli.js +111 -111
  31. package/dist/cloud/index.js +2 -2
  32. package/dist/refuse/ai.js +1 -1
  33. package/dist/refuse/backend.js +1 -1
  34. package/dist/refuse/cloud.js +1 -1
  35. package/dist/refuse/server.js +1 -1
  36. package/dist/server/index.js +2 -2
  37. package/dist/server/testing.js +2 -2
  38. package/dist/web/index.js +2 -2
  39. package/dist/web/message.js +2 -2
  40. package/dist/web/palbe.js +2 -2
  41. package/dist/web/paywall.js +2 -2
  42. package/dist/web/push-sw.js +1 -1
  43. package/dist/web/ssr.js +2 -2
  44. package/dist/web/vite.js +2 -2
  45. package/package.json +2 -2
  46. package/types/backend/src/test-user-templates.d.ts +5 -0
  47. package/types/internal/src/modules/machines.d.ts +87 -8
@@ -1512,7 +1512,7 @@ export type TaskTypeList = {
1512
1512
  types: TaskType[];
1513
1513
  };
1514
1514
  /**
1515
- * A template written for a test user — its rows by table, as the machine's program said — or why it was not (error: no_template, not_a_test_user, template_failed, template_timeout, machine_unavailable, then a colon and why). again: answered from what was kept when it was written before; the machine was not asked again.
1515
+ * A template written for a test user — its rows by table, as the machine's program said — or why it was not (error: no_template, not_a_test_user, template_failed, template_timeout, machine_unavailable, then a colon and why: no_template names the build that answered and the templates its program has). again: answered from what was kept when it was written before; the machine was not asked again.
1516
1516
  */
1517
1517
  export type TemplateOutcome = {
1518
1518
  name: string;
@@ -1521,22 +1521,42 @@ export type TemplateOutcome = {
1521
1521
  };
1522
1522
  error?: string;
1523
1523
  again?: boolean;
1524
+ /**
1525
+ * The machine's build whose program answered: wrote the template, or said why not. None on a template kept before builds were.
1526
+ */
1527
+ build?: string;
1528
+ /**
1529
+ * That build's commit.
1530
+ */
1531
+ commit?: string;
1532
+ /**
1533
+ * With again: the commit the machine serves now.
1534
+ */
1535
+ serving_commit?: string;
1536
+ /**
1537
+ * With again, when the commit serving now is not the one that wrote it: a template is written once for a user — its rows are that commit's — and a new test user has the serving code's data.
1538
+ */
1539
+ note?: string;
1524
1540
  };
1525
1541
  /**
1526
- * A test user made with a template: its sign-in, shown this once, and what became of the template. The user is made whatever came of the template.
1542
+ * A test user made with a template: its sign-in, shown this once, and what became of the template. A user is made with its template or not at all: one whose template was not written is answered deleted, with no sign-in.
1527
1543
  */
1528
1544
  export type TemplatedUser = {
1529
1545
  user_id: string;
1530
1546
  email: string;
1531
1547
  /**
1532
- * Its password, shown this once (a test fixture).
1548
+ * Its password, shown this once (a test fixture); none when the user was deleted again.
1533
1549
  */
1534
- password: string;
1550
+ password?: string;
1535
1551
  /**
1536
1552
  * With with_tokens: an access token for it (a test fixture).
1537
1553
  */
1538
1554
  access_token?: string;
1539
1555
  template: TemplateOutcome;
1556
+ /**
1557
+ * Its template was not written, and the user was deleted again: it has no sign-in.
1558
+ */
1559
+ deleted?: boolean;
1540
1560
  };
1541
1561
  export type TemplatedUserList = {
1542
1562
  users: TemplatedUser[];
@@ -2200,6 +2220,62 @@ export type PreviewLinkListed = {
2200
2220
  expires_at: string;
2201
2221
  created_at: string;
2202
2222
  };
2223
+ /**
2224
+ * What became of one template's undo as its user was deleted: run, or why not — the template has no undo, or the version serving has no such template any more; what it wrote is then left to the user's user.deleted.
2225
+ */
2226
+ export type UndoOutcome = {
2227
+ template: string;
2228
+ ran: boolean;
2229
+ /**
2230
+ * Why it did not run, when it did not.
2231
+ */
2232
+ note?: string;
2233
+ };
2234
+ /**
2235
+ * A test user made with a template, deleted: what became of each template's undo.
2236
+ */
2237
+ export type TemplatedUserDeleted = {
2238
+ user_id: string;
2239
+ deleted: boolean;
2240
+ undo: UndoOutcome[];
2241
+ };
2242
+ /**
2243
+ * A refusal of test users with a template: the error envelope, with the build on its way when it is build_in_progress.
2244
+ */
2245
+ export type TestUsersConflict = {
2246
+ /**
2247
+ * Machine-readable error code (snake_case)
2248
+ */
2249
+ error: string;
2250
+ /**
2251
+ * Human-readable explanation
2252
+ */
2253
+ error_description: string;
2254
+ /**
2255
+ * Correlation ID for log/audit lookup
2256
+ */
2257
+ request_id: string;
2258
+ /**
2259
+ * Seconds to wait before retrying; present on a refusal that ends with time.
2260
+ */
2261
+ retry_after?: number;
2262
+ /**
2263
+ * HTTP status code (mirrors the response status)
2264
+ */
2265
+ status: number;
2266
+ build?: BuildOnItsWay;
2267
+ };
2268
+ /**
2269
+ * With build_in_progress: the machine's newest build on its way.
2270
+ */
2271
+ export type BuildOnItsWay = {
2272
+ id?: string;
2273
+ commit?: string;
2274
+ /**
2275
+ * requested (a build of the head is asked for; no build yet), waiting_checks, queued, building, testing, waiting_config, rolling out (built; the version before serves), or waking (built, the machine asleep: woken on the version it served, it rolls the new one out — the call woke it)
2276
+ */
2277
+ state: string;
2278
+ };
2203
2279
  /** Palbase Machines */
2204
2280
  export declare function client(t: Transport): {
2205
2281
  /**
@@ -2826,7 +2902,7 @@ export declare function client(t: Transport): {
2826
2902
  /**
2827
2903
  * Make test users with a template's data
2828
2904
  *
2829
- * Makes 1 to 10 test users (auth's: their tokens say test: true) and has the machine's own program write a template's data for each — the backend's seed for one account (palbase/backend's @TestUserTemplate), for a person or an agent to sign in and see a screen with its data. The platform calls the program for each user — POST /_palbase/test-user-templates/<template> on the machine's own port, with {"user": {"id", "email"}, "template"}, signed as a cron's call is, waking the machine for it; the program writes the template in one transaction and answers {"rows": {table: count}}, or refuses a user auth does not say is a test user (403). A user is made whatever came of its template: its template answers its error by name. The same user and template asked again (POST …/test-users/{user}/templates/{template}) answers what was kept, the machine not asked again. The users' passwords (and with with_tokens their access tokens) are test fixtures, shown this once, as auth's test users' are. 409 when auth makes no more test users for the project; 429 quota_exceeded, and no user made, when the project's machines are not run now (its machine time for the period used up, or the project deleted).
2905
+ * Makes 1 to 10 test users (auth's: their tokens say test: true) and has the machine's own program write a template's data for each — the backend's seed for one account (palbase/backend's @TestUserTemplate), for a person or an agent to sign in and see a screen with its data. The platform calls the program for each user — POST /_palbase/test-user-templates/<template> on the machine's own port, with {"user": {"id", "email"}, "template"}, signed as a cron's call is, waking the machine for it; the program writes the template in one transaction and answers {"rows": {table: count}}, or refuses a user auth does not say is a test user (403). A user is made with its template or not at all: one whose template was not written is deleted again (deleted: true, no sign-in), its template answering its error by name — one the program may have written for all the same (it did not answer in time, its connection ended once made, or it answered what a template does not) has the template's undo asked first. One whose undo did not run, or that auth would not delete, is kept for now, its error saying so: the platform asks the undo again and deletes it within the hour. The work for the users made goes on to its end when the request is gone. Each template says the build whose program answered (build, commit). None is made while the machine's newest build is on its way — a build of its head asked for, queued, building, testing, or rolling out while the version before serves: 409 build_in_progress, naming the build, its commit and where it is; ask again once it serves. The same user and template asked again (POST …/test-users/{user}/templates/{template}) answers what was kept, the machine not asked again. The users' passwords (and with with_tokens their access tokens) are test fixtures, shown this once, as auth's test users' are. 409 test_users_refused when auth makes no more test users for the project; 429 quota_exceeded, and no user made, when the project's machines are not run now (its machine time for the period used up, or the project deleted).
2830
2906
  */
2831
2907
  makeTemplatedTestUsers(input: {
2832
2908
  path: {
@@ -2838,7 +2914,7 @@ export declare function client(t: Transport): {
2838
2914
  /**
2839
2915
  * Write a template for a test user
2840
2916
  *
2841
- * Has the machine's program write a template for a test user this machine made with one (POST /machines/{name}/test-users) — answered from what was kept when it wrote that template for that user before, the machine not asked again (again: true). 429 quota_exceeded when the project's machines are not run now and the template was not written before. 404 when the user is no test user this machine made with a template: a test user is the machine's that made it, another machine of the project neither writes for it nor deletes it.
2917
+ * Has the machine's program write a template for a test user this machine made with one (POST /machines/{name}/test-users) — answered from what was kept when it wrote that template for that user before, the machine not asked again (again: true). That answer says the commit whose program wrote it (commit), the commit the machine serves now (serving_commit), and when they differ what that means (note): a template is written once for a user, a new test user has the serving code's data. 409 build_in_progress, nothing written, while the machine's newest build is on its way and the template was not written before. 429 quota_exceeded when the project's machines are not run now and the template was not written before. 404 when the user is no test user this machine made with a template: a test user is the machine's that made it, another machine of the project neither writes for it nor deletes it.
2842
2918
  */
2843
2919
  templateTestUser(input: {
2844
2920
  path: {
@@ -2851,15 +2927,18 @@ export declare function client(t: Transport): {
2851
2927
  /**
2852
2928
  * Delete a test user made with a template
2853
2929
  *
2854
- * Has the machine's program undo each template the user was written with — POST /_palbase/test-user-templates/<template>/undo, signed as the template's call; a program with no undo (404) leaves it to its user.deleted — then deletes the user. 502 undo_failed when the program did not undo one: the user is kept, for the delete to be asked again. 429 quota_exceeded, the user kept, when the project's machines are not run now. 404 when the user is no test user this machine made with a template: a test user is the machine's that made it, another machine of the project neither writes for it nor deletes it.
2930
+ * Has the machine's program undo each template the user was written with — POST /_palbase/test-user-templates/<template>/undo, signed as the template's call; a program with no undo for it, or whose serving version has no such template any more (404), leaves it to its user.deleted — then deletes the user — answering, to a request with Prefer: return=representation, what became of each undo: run (ran: true), or why not (note); 204 otherwise. 502 undo_failed when the program did not undo one: the user is kept, for the delete to be asked again. 429 quota_exceeded, the user kept, when the project's machines are not run now. 404 when the user is no test user this machine made with a template: a test user is the machine's that made it, another machine of the project neither writes for it nor deletes it.
2855
2931
  */
2856
2932
  deleteTemplatedTestUser(input: {
2857
2933
  path: {
2858
2934
  name: string; /** The test user's id, as the users made with a template were answered. */
2859
2935
  user: string;
2936
+ };
2937
+ headers?: {
2938
+ Prefer?: string;
2860
2939
  }; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
2861
2940
  signal?: AbortSignal;
2862
- }): Promise<Reply<204, undefined>>;
2941
+ }): Promise<Reply<200, TemplatedUserDeleted> | Reply<204, undefined>>;
2863
2942
  /**
2864
2943
  * List sites
2865
2944
  *