@palbase/backend 10.2.0 → 11.0.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 (41) hide show
  1. package/dist/chunk-7LAXRLPG.js +418 -0
  2. package/dist/chunk-7LAXRLPG.js.map +1 -0
  3. package/dist/{chunk-4WOQWFUP.js → chunk-LUV36KQU.js} +26 -11
  4. package/dist/{chunk-4WOQWFUP.js.map → chunk-LUV36KQU.js.map} +1 -1
  5. package/dist/{chunk-RGQUB66H.js → chunk-XATG7BRC.js} +22 -2
  6. package/dist/chunk-XATG7BRC.js.map +1 -0
  7. package/dist/db/index.cjs +438 -10
  8. package/dist/db/index.cjs.map +1 -1
  9. package/dist/db/index.d.cts +2 -2
  10. package/dist/db/index.d.ts +2 -2
  11. package/dist/db/index.js +13 -1
  12. package/dist/{endpoint-Cn3ICGTf.d.cts → endpoint-Ck4hER_7.d.cts} +397 -11
  13. package/dist/{endpoint-Cn3ICGTf.d.ts → endpoint-Ck4hER_7.d.ts} +397 -11
  14. package/dist/{index-Bt7UHkAM.d.cts → index-BJAf1uPC.d.cts} +64 -34
  15. package/dist/{index-V0ealeY-.d.ts → index-l7DhBDtn.d.ts} +64 -34
  16. package/dist/index.cjs +776 -108
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.cts +203 -9
  19. package/dist/index.d.ts +203 -9
  20. package/dist/index.js +325 -94
  21. package/dist/index.js.map +1 -1
  22. package/dist/purchases/keys.cjs +19 -0
  23. package/dist/purchases/keys.cjs.map +1 -0
  24. package/dist/purchases/keys.d.cts +42 -0
  25. package/dist/purchases/keys.d.ts +42 -0
  26. package/dist/purchases/keys.js +1 -0
  27. package/dist/purchases/keys.js.map +1 -0
  28. package/dist/test/index.cjs +559 -13
  29. package/dist/test/index.cjs.map +1 -1
  30. package/dist/test/index.d.cts +1 -1
  31. package/dist/test/index.d.ts +1 -1
  32. package/dist/test/index.js +166 -13
  33. package/dist/test/index.js.map +1 -1
  34. package/docs/README.md +7 -6
  35. package/docs/database.md +106 -16
  36. package/docs/getting-started.md +14 -12
  37. package/docs/llms-full.txt +140 -45
  38. package/docs/migrations.md +8 -8
  39. package/docs/schema.md +6 -4
  40. package/package.json +11 -1
  41. package/dist/chunk-RGQUB66H.js.map +0 -1
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/purchases/keys.ts
17
+ var keys_exports = {};
18
+ module.exports = __toCommonJS(keys_exports);
19
+ //# sourceMappingURL=keys.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/purchases/keys.ts"],"sourcesContent":["/**\n * `@palbase/backend/purchases` — the controlled global augmentation target for\n * the project's purchases catalog.\n *\n * `@RequireEntitlement(...)` and `@Spend(...)` take these unions, never a raw\n * string, so a typo is a COMPILE error rather than a 500 in production or —\n * worse — a spend against a limit key that silently does not exist. This is the\n * TypeScript half of what swiftgen already does for iOS: one catalog, two\n * languages, neither of them hand-maintained.\n *\n * Both interfaces are EMPTY by default; the generated `palbase-purchases.d.ts`\n * augments them with one member per catalog entry:\n *\n * // palbase-purchases.d.ts (generated — do not edit)\n * declare module \"@palbase/backend/purchases\" {\n * interface Entitlements { pro: true }\n * interface Limits { bookCreate: true }\n * }\n *\n * A project with no catalog therefore has NO valid keys, and every decorator\n * call fails to compile until its catalog is generated. That is the intended\n * behaviour, not a rough edge: it is the same single-project augmentation model\n * `@palbase/backend/env` uses for `Database.tables`.\n */\n\n/**\n * The project's entitlement keys. EMPTY by default; filled by the generated\n * `palbase-purchases.d.ts`.\n */\n// biome-ignore lint/suspicious/noEmptyInterface: augmentation target — filled by generated palbase-purchases.d.ts.\nexport interface Entitlements {}\n\n/**\n * The project's limit and credit keys — everything `@Spend` can consume. EMPTY\n * by default; filled by the generated `palbase-purchases.d.ts`.\n */\n// biome-ignore lint/suspicious/noEmptyInterface: augmentation target — filled by generated palbase-purchases.d.ts.\nexport interface Limits {}\n\n/** Every entitlement key the project's catalog declares. */\nexport type EntitlementKey = keyof Entitlements & string;\n\n/** Every limit/credit key the project's catalog declares. */\nexport type LimitKey = keyof Limits & string;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * `@palbase/backend/purchases` — the controlled global augmentation target for
3
+ * the project's purchases catalog.
4
+ *
5
+ * `@RequireEntitlement(...)` and `@Spend(...)` take these unions, never a raw
6
+ * string, so a typo is a COMPILE error rather than a 500 in production or —
7
+ * worse — a spend against a limit key that silently does not exist. This is the
8
+ * TypeScript half of what swiftgen already does for iOS: one catalog, two
9
+ * languages, neither of them hand-maintained.
10
+ *
11
+ * Both interfaces are EMPTY by default; the generated `palbase-purchases.d.ts`
12
+ * augments them with one member per catalog entry:
13
+ *
14
+ * // palbase-purchases.d.ts (generated — do not edit)
15
+ * declare module "@palbase/backend/purchases" {
16
+ * interface Entitlements { pro: true }
17
+ * interface Limits { bookCreate: true }
18
+ * }
19
+ *
20
+ * A project with no catalog therefore has NO valid keys, and every decorator
21
+ * call fails to compile until its catalog is generated. That is the intended
22
+ * behaviour, not a rough edge: it is the same single-project augmentation model
23
+ * `@palbase/backend/env` uses for `Database.tables`.
24
+ */
25
+ /**
26
+ * The project's entitlement keys. EMPTY by default; filled by the generated
27
+ * `palbase-purchases.d.ts`.
28
+ */
29
+ interface Entitlements {
30
+ }
31
+ /**
32
+ * The project's limit and credit keys — everything `@Spend` can consume. EMPTY
33
+ * by default; filled by the generated `palbase-purchases.d.ts`.
34
+ */
35
+ interface Limits {
36
+ }
37
+ /** Every entitlement key the project's catalog declares. */
38
+ type EntitlementKey = keyof Entitlements & string;
39
+ /** Every limit/credit key the project's catalog declares. */
40
+ type LimitKey = keyof Limits & string;
41
+
42
+ export type { EntitlementKey, Entitlements, LimitKey, Limits };
@@ -0,0 +1,42 @@
1
+ /**
2
+ * `@palbase/backend/purchases` — the controlled global augmentation target for
3
+ * the project's purchases catalog.
4
+ *
5
+ * `@RequireEntitlement(...)` and `@Spend(...)` take these unions, never a raw
6
+ * string, so a typo is a COMPILE error rather than a 500 in production or —
7
+ * worse — a spend against a limit key that silently does not exist. This is the
8
+ * TypeScript half of what swiftgen already does for iOS: one catalog, two
9
+ * languages, neither of them hand-maintained.
10
+ *
11
+ * Both interfaces are EMPTY by default; the generated `palbase-purchases.d.ts`
12
+ * augments them with one member per catalog entry:
13
+ *
14
+ * // palbase-purchases.d.ts (generated — do not edit)
15
+ * declare module "@palbase/backend/purchases" {
16
+ * interface Entitlements { pro: true }
17
+ * interface Limits { bookCreate: true }
18
+ * }
19
+ *
20
+ * A project with no catalog therefore has NO valid keys, and every decorator
21
+ * call fails to compile until its catalog is generated. That is the intended
22
+ * behaviour, not a rough edge: it is the same single-project augmentation model
23
+ * `@palbase/backend/env` uses for `Database.tables`.
24
+ */
25
+ /**
26
+ * The project's entitlement keys. EMPTY by default; filled by the generated
27
+ * `palbase-purchases.d.ts`.
28
+ */
29
+ interface Entitlements {
30
+ }
31
+ /**
32
+ * The project's limit and credit keys — everything `@Spend` can consume. EMPTY
33
+ * by default; filled by the generated `palbase-purchases.d.ts`.
34
+ */
35
+ interface Limits {
36
+ }
37
+ /** Every entitlement key the project's catalog declares. */
38
+ type EntitlementKey = keyof Entitlements & string;
39
+ /** Every limit/credit key the project's catalog declares. */
40
+ type LimitKey = keyof Limits & string;
41
+
42
+ export type { EntitlementKey, Entitlements, LimitKey, Limits };
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=keys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}