@parrel/ledger 0.0.0-stage → 5.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 (239) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +793 -2
  3. package/dist/cli/commands.d.ts +51 -0
  4. package/dist/cli/commands.d.ts.map +1 -0
  5. package/dist/cli/commands.js +968 -0
  6. package/dist/cli/commands.js.map +1 -0
  7. package/dist/cli/index.d.ts +24 -0
  8. package/dist/cli/index.d.ts.map +1 -0
  9. package/dist/cli/index.js +35 -0
  10. package/dist/cli/index.js.map +1 -0
  11. package/dist/cli/parrel.d.ts +3 -0
  12. package/dist/cli/parrel.d.ts.map +1 -0
  13. package/dist/cli/parrel.js +5 -0
  14. package/dist/cli/parrel.js.map +1 -0
  15. package/dist/cli/utils/angular-setup.d.ts +14 -0
  16. package/dist/cli/utils/angular-setup.d.ts.map +1 -0
  17. package/dist/cli/utils/angular-setup.js +96 -0
  18. package/dist/cli/utils/angular-setup.js.map +1 -0
  19. package/dist/cli/utils/api-tree-builder.d.ts +24 -0
  20. package/dist/cli/utils/api-tree-builder.d.ts.map +1 -0
  21. package/dist/cli/utils/api-tree-builder.js +146 -0
  22. package/dist/cli/utils/api-tree-builder.js.map +1 -0
  23. package/dist/cli/utils/bundle-reader.d.ts +185 -0
  24. package/dist/cli/utils/bundle-reader.d.ts.map +1 -0
  25. package/dist/cli/utils/bundle-reader.js +518 -0
  26. package/dist/cli/utils/bundle-reader.js.map +1 -0
  27. package/dist/cli/utils/collision-detector.d.ts +21 -0
  28. package/dist/cli/utils/collision-detector.d.ts.map +1 -0
  29. package/dist/cli/utils/collision-detector.js +53 -0
  30. package/dist/cli/utils/collision-detector.js.map +1 -0
  31. package/dist/cli/utils/map-fields.d.ts +42 -0
  32. package/dist/cli/utils/map-fields.d.ts.map +1 -0
  33. package/dist/cli/utils/map-fields.js +90 -0
  34. package/dist/cli/utils/map-fields.js.map +1 -0
  35. package/dist/cli/utils/map-validator.d.ts +42 -0
  36. package/dist/cli/utils/map-validator.d.ts.map +1 -0
  37. package/dist/cli/utils/map-validator.js +119 -0
  38. package/dist/cli/utils/map-validator.js.map +1 -0
  39. package/dist/cli/utils/media-file.d.ts +41 -0
  40. package/dist/cli/utils/media-file.d.ts.map +1 -0
  41. package/dist/cli/utils/media-file.js +72 -0
  42. package/dist/cli/utils/media-file.js.map +1 -0
  43. package/dist/cli/utils/media-validator.d.ts +10 -0
  44. package/dist/cli/utils/media-validator.d.ts.map +1 -0
  45. package/dist/cli/utils/media-validator.js +85 -0
  46. package/dist/cli/utils/media-validator.js.map +1 -0
  47. package/dist/cli/utils/mock-augmenter.d.ts +19 -0
  48. package/dist/cli/utils/mock-augmenter.d.ts.map +1 -0
  49. package/dist/cli/utils/mock-augmenter.js +102 -0
  50. package/dist/cli/utils/mock-augmenter.js.map +1 -0
  51. package/dist/cli/utils/mock-validator.d.ts +27 -0
  52. package/dist/cli/utils/mock-validator.d.ts.map +1 -0
  53. package/dist/cli/utils/mock-validator.js +214 -0
  54. package/dist/cli/utils/mock-validator.js.map +1 -0
  55. package/dist/cli/utils/project-dir.d.ts +24 -0
  56. package/dist/cli/utils/project-dir.d.ts.map +1 -0
  57. package/dist/cli/utils/project-dir.js +32 -0
  58. package/dist/cli/utils/project-dir.js.map +1 -0
  59. package/dist/cli/utils/schema-loader.d.ts +19 -0
  60. package/dist/cli/utils/schema-loader.d.ts.map +1 -0
  61. package/dist/cli/utils/schema-loader.js +101 -0
  62. package/dist/cli/utils/schema-loader.js.map +1 -0
  63. package/dist/cli/utils/server-entry.d.ts +34 -0
  64. package/dist/cli/utils/server-entry.d.ts.map +1 -0
  65. package/dist/cli/utils/server-entry.js +111 -0
  66. package/dist/cli/utils/server-entry.js.map +1 -0
  67. package/dist/cli/utils/sync.d.ts +116 -0
  68. package/dist/cli/utils/sync.d.ts.map +1 -0
  69. package/dist/cli/utils/sync.js +134 -0
  70. package/dist/cli/utils/sync.js.map +1 -0
  71. package/dist/client/index.d.ts +39 -0
  72. package/dist/client/index.d.ts.map +1 -0
  73. package/dist/client/index.js +88 -0
  74. package/dist/client/index.js.map +1 -0
  75. package/dist/core/browser-session.d.ts +5 -0
  76. package/dist/core/browser-session.d.ts.map +1 -0
  77. package/dist/core/browser-session.js +12 -0
  78. package/dist/core/browser-session.js.map +1 -0
  79. package/dist/core/cache.d.ts +80 -0
  80. package/dist/core/cache.d.ts.map +1 -0
  81. package/dist/core/cache.js +95 -0
  82. package/dist/core/cache.js.map +1 -0
  83. package/dist/core/client.d.ts +64 -0
  84. package/dist/core/client.d.ts.map +1 -0
  85. package/dist/core/client.js +281 -0
  86. package/dist/core/client.js.map +1 -0
  87. package/dist/core/config.d.ts +20 -0
  88. package/dist/core/config.d.ts.map +1 -0
  89. package/dist/core/config.js +32 -0
  90. package/dist/core/config.js.map +1 -0
  91. package/dist/core/copy-read.d.ts +25 -0
  92. package/dist/core/copy-read.d.ts.map +1 -0
  93. package/dist/core/copy-read.js +123 -0
  94. package/dist/core/copy-read.js.map +1 -0
  95. package/dist/core/define-ledger.d.ts +38 -0
  96. package/dist/core/define-ledger.d.ts.map +1 -0
  97. package/dist/core/define-ledger.js +65 -0
  98. package/dist/core/define-ledger.js.map +1 -0
  99. package/dist/core/deprecated.d.ts +16 -0
  100. package/dist/core/deprecated.d.ts.map +1 -0
  101. package/dist/core/deprecated.js +14 -0
  102. package/dist/core/deprecated.js.map +1 -0
  103. package/dist/core/env.d.ts +103 -0
  104. package/dist/core/env.d.ts.map +1 -0
  105. package/dist/core/env.js +208 -0
  106. package/dist/core/env.js.map +1 -0
  107. package/dist/core/error-codes.generated.d.ts +12 -0
  108. package/dist/core/error-codes.generated.d.ts.map +1 -0
  109. package/dist/core/error-codes.generated.js +3 -0
  110. package/dist/core/error-codes.generated.js.map +1 -0
  111. package/dist/core/get-content.d.ts +62 -0
  112. package/dist/core/get-content.d.ts.map +1 -0
  113. package/dist/core/get-content.js +86 -0
  114. package/dist/core/get-content.js.map +1 -0
  115. package/dist/core/get-media.d.ts +58 -0
  116. package/dist/core/get-media.d.ts.map +1 -0
  117. package/dist/core/get-media.js +89 -0
  118. package/dist/core/get-media.js.map +1 -0
  119. package/dist/core/manifest.d.ts +38 -0
  120. package/dist/core/manifest.d.ts.map +1 -0
  121. package/dist/core/manifest.js +93 -0
  122. package/dist/core/manifest.js.map +1 -0
  123. package/dist/core/media-proxy.d.ts +41 -0
  124. package/dist/core/media-proxy.d.ts.map +1 -0
  125. package/dist/core/media-proxy.js +219 -0
  126. package/dist/core/media-proxy.js.map +1 -0
  127. package/dist/core/package-info.d.ts +34 -0
  128. package/dist/core/package-info.d.ts.map +1 -0
  129. package/dist/core/package-info.js +39 -0
  130. package/dist/core/package-info.js.map +1 -0
  131. package/dist/core/parrel-error.d.ts +160 -0
  132. package/dist/core/parrel-error.d.ts.map +1 -0
  133. package/dist/core/parrel-error.js +198 -0
  134. package/dist/core/parrel-error.js.map +1 -0
  135. package/dist/core/transform-content.d.ts +42 -0
  136. package/dist/core/transform-content.d.ts.map +1 -0
  137. package/dist/core/transform-content.js +185 -0
  138. package/dist/core/transform-content.js.map +1 -0
  139. package/dist/core/types.d.ts +406 -0
  140. package/dist/core/types.d.ts.map +1 -0
  141. package/dist/core/types.js +11 -0
  142. package/dist/core/types.js.map +1 -0
  143. package/dist/errors/error-messages.generated.d.ts +5 -0
  144. package/dist/errors/error-messages.generated.d.ts.map +1 -0
  145. package/dist/errors/error-messages.generated.js +971 -0
  146. package/dist/errors/error-messages.generated.js.map +1 -0
  147. package/dist/errors/get-error-info.d.ts +29 -0
  148. package/dist/errors/get-error-info.d.ts.map +1 -0
  149. package/dist/errors/get-error-info.js +43 -0
  150. package/dist/errors/get-error-info.js.map +1 -0
  151. package/dist/errors/index.d.ts +4 -0
  152. package/dist/errors/index.d.ts.map +1 -0
  153. package/dist/errors/index.js +4 -0
  154. package/dist/errors/index.js.map +1 -0
  155. package/dist/errors/types.d.ts +19 -0
  156. package/dist/errors/types.d.ts.map +1 -0
  157. package/dist/errors/types.js +2 -0
  158. package/dist/errors/types.js.map +1 -0
  159. package/dist/generated.d.ts +29 -0
  160. package/dist/generated.d.ts.map +1 -0
  161. package/dist/generated.js +29 -0
  162. package/dist/generated.js.map +1 -0
  163. package/dist/index.d.ts +19 -0
  164. package/dist/index.d.ts.map +1 -0
  165. package/dist/index.js +16 -0
  166. package/dist/index.js.map +1 -0
  167. package/dist/mock/dev-media.d.ts +15 -0
  168. package/dist/mock/dev-media.d.ts.map +1 -0
  169. package/dist/mock/dev-media.js +52 -0
  170. package/dist/mock/dev-media.js.map +1 -0
  171. package/dist/mock/file-store.d.ts +44 -0
  172. package/dist/mock/file-store.d.ts.map +1 -0
  173. package/dist/mock/file-store.js +170 -0
  174. package/dist/mock/file-store.js.map +1 -0
  175. package/dist/mock/index.d.ts +4 -0
  176. package/dist/mock/index.d.ts.map +1 -0
  177. package/dist/mock/index.js +3 -0
  178. package/dist/mock/index.js.map +1 -0
  179. package/dist/mock/media-fields.d.ts +25 -0
  180. package/dist/mock/media-fields.d.ts.map +1 -0
  181. package/dist/mock/media-fields.js +54 -0
  182. package/dist/mock/media-fields.js.map +1 -0
  183. package/dist/mock/mock-adapter.d.ts +65 -0
  184. package/dist/mock/mock-adapter.d.ts.map +1 -0
  185. package/dist/mock/mock-adapter.js +431 -0
  186. package/dist/mock/mock-adapter.js.map +1 -0
  187. package/dist/mock/mock-errors.d.ts +18 -0
  188. package/dist/mock/mock-errors.d.ts.map +1 -0
  189. package/dist/mock/mock-errors.js +56 -0
  190. package/dist/mock/mock-errors.js.map +1 -0
  191. package/dist/mock/node-import.d.ts +13 -0
  192. package/dist/mock/node-import.d.ts.map +1 -0
  193. package/dist/mock/node-import.js +16 -0
  194. package/dist/mock/node-import.js.map +1 -0
  195. package/dist/mock/seed-mock-store.d.ts +14 -0
  196. package/dist/mock/seed-mock-store.d.ts.map +1 -0
  197. package/dist/mock/seed-mock-store.js +106 -0
  198. package/dist/mock/seed-mock-store.js.map +1 -0
  199. package/dist/mock/shared-memory-store.d.ts +35 -0
  200. package/dist/mock/shared-memory-store.d.ts.map +1 -0
  201. package/dist/mock/shared-memory-store.js +46 -0
  202. package/dist/mock/shared-memory-store.js.map +1 -0
  203. package/dist/next/dev-rendering-helpers.d.ts +78 -0
  204. package/dist/next/dev-rendering-helpers.d.ts.map +1 -0
  205. package/dist/next/dev-rendering-helpers.js +103 -0
  206. package/dist/next/dev-rendering-helpers.js.map +1 -0
  207. package/dist/next/index.d.ts +35 -0
  208. package/dist/next/index.d.ts.map +1 -0
  209. package/dist/next/index.js +33 -0
  210. package/dist/next/index.js.map +1 -0
  211. package/dist/next/next-cache-adapter.d.ts +11 -0
  212. package/dist/next/next-cache-adapter.d.ts.map +1 -0
  213. package/dist/next/next-cache-adapter.js +12 -0
  214. package/dist/next/next-cache-adapter.js.map +1 -0
  215. package/dist/nuxt/index.d.ts +22 -0
  216. package/dist/nuxt/index.d.ts.map +1 -0
  217. package/dist/nuxt/index.js +57 -0
  218. package/dist/nuxt/index.js.map +1 -0
  219. package/dist/sveltekit/index.d.ts +35 -0
  220. package/dist/sveltekit/index.d.ts.map +1 -0
  221. package/dist/sveltekit/index.js +56 -0
  222. package/dist/sveltekit/index.js.map +1 -0
  223. package/dist/ui/content-editor.d.ts +9 -0
  224. package/dist/ui/content-editor.d.ts.map +1 -0
  225. package/dist/ui/content-editor.js +27 -0
  226. package/dist/ui/content-editor.js.map +1 -0
  227. package/dist/ui/index.d.ts +8 -0
  228. package/dist/ui/index.d.ts.map +1 -0
  229. package/dist/ui/index.js +8 -0
  230. package/dist/ui/index.js.map +1 -0
  231. package/dist/ui/ledger-overlay.d.ts +10 -0
  232. package/dist/ui/ledger-overlay.d.ts.map +1 -0
  233. package/dist/ui/ledger-overlay.js +27 -0
  234. package/dist/ui/ledger-overlay.js.map +1 -0
  235. package/dist/ui/media-uploader.d.ts +9 -0
  236. package/dist/ui/media-uploader.d.ts.map +1 -0
  237. package/dist/ui/media-uploader.js +27 -0
  238. package/dist/ui/media-uploader.js.map +1 -0
  239. package/package.json +134 -6
@@ -0,0 +1,95 @@
1
+ /** How long, in seconds, a copy is fresh: within this time it is returned without any request (rulebook LIM-13). */
2
+ export const DEFAULT_COPY_TTL_SECONDS = 300;
3
+ /** How long, in seconds, a copy is kept at most after it was downloaded, also when its hash did not change. */
4
+ export const DEFAULT_COPY_MAX_AGE_SECONDS = 86_400;
5
+ /**
6
+ * The cache times of `config`: `cache.ttlSeconds` (default 300), `cache.manifestTtlSeconds` (default 300) and
7
+ * `cache.maxAgeSeconds` (default 86400).
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * copyTimes({ cache: { ttlSeconds: 60 } }); // { ttlSeconds: 60, manifestTtlSeconds: 300, maxAgeSeconds: 86400 }
12
+ * ```
13
+ */
14
+ export function copyTimes(config) {
15
+ return {
16
+ ttlSeconds: config.cache?.ttlSeconds ?? DEFAULT_COPY_TTL_SECONDS,
17
+ manifestTtlSeconds: config.cache?.manifestTtlSeconds ?? DEFAULT_COPY_TTL_SECONDS,
18
+ maxAgeSeconds: config.cache?.maxAgeSeconds ?? DEFAULT_COPY_MAX_AGE_SECONDS,
19
+ };
20
+ }
21
+ const cache = new Map();
22
+ /**
23
+ * The copies of content and media URLs that `getContent` and `getMedia` keep in the memory of the process (rulebook
24
+ * LIM-13). Each copy has its value, the manifest hash it was read under, when it was downloaded and when it was last
25
+ * checked: it is fresh for `cache.ttlSeconds` after that check, then checked against the manifest, and downloaded again
26
+ * at the latest `cache.maxAgeSeconds` after the download. Call `LedgerCache.clear()` to drop everything, for example
27
+ * in tests.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * LedgerCache.invalidatePrefix("cms-content:my-site:");
32
+ * ```
33
+ */
34
+ export class LedgerCache {
35
+ /** The value of `key`, or `null` when there is none or its time is over. */
36
+ static get(key) {
37
+ const entry = cache.get(key);
38
+ if (!entry)
39
+ return null;
40
+ if (Date.now() > entry.expiresAt) {
41
+ cache.delete(key);
42
+ return null;
43
+ }
44
+ return entry.value;
45
+ }
46
+ /** Keeps `value` for `ttlSeconds` (default 300), as a copy without a hash that is downloaded now. */
47
+ static set(key, value, ttlSeconds = DEFAULT_COPY_TTL_SECONDS) {
48
+ const now = Date.now();
49
+ cache.set(key, { value, hash: undefined, downloadedAt: now, checkedAt: now, expiresAt: now + ttlSeconds * 1000 });
50
+ }
51
+ /** The copy of `key` with its hash and times, whatever its age, or `null` when there is none. */
52
+ static getCopy(key) {
53
+ const entry = cache.get(key);
54
+ if (!entry)
55
+ return null;
56
+ const { value, hash, downloadedAt, checkedAt } = entry;
57
+ return { value: value, hash, downloadedAt, checkedAt };
58
+ }
59
+ /** Stores a copy that was downloaded now under `hash`, kept at most `maxAgeSeconds` (default 86400). */
60
+ static setCopy(key, value, hash, maxAgeSeconds = DEFAULT_COPY_MAX_AGE_SECONDS) {
61
+ const now = Date.now();
62
+ cache.set(key, { value, hash, downloadedAt: now, checkedAt: now, expiresAt: now + maxAgeSeconds * 1000 });
63
+ }
64
+ /** Records that the copy of `key` was found unchanged now, so it is fresh again. */
65
+ static markChecked(key) {
66
+ const entry = cache.get(key);
67
+ if (entry)
68
+ entry.checkedAt = Date.now();
69
+ }
70
+ static invalidate(key) {
71
+ cache.delete(key);
72
+ }
73
+ static invalidatePrefix(prefix) {
74
+ for (const key of cache.keys()) {
75
+ if (key.startsWith(prefix)) {
76
+ cache.delete(key);
77
+ }
78
+ }
79
+ }
80
+ /** Drops every copy whose key matches `test`. */
81
+ static invalidateWhere(test) {
82
+ for (const key of cache.keys()) {
83
+ if (test(key)) {
84
+ cache.delete(key);
85
+ }
86
+ }
87
+ }
88
+ static clear() {
89
+ cache.clear();
90
+ }
91
+ static size() {
92
+ return cache.size;
93
+ }
94
+ }
95
+ //# sourceMappingURL=cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.js","sourceRoot":"","sources":["../../src/core/cache.ts"],"names":[],"mappings":"AAEA,oHAAoH;AACpH,MAAM,CAA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AM,CAAC,eAAe,CAAC,IAA8B;QACpD,KAAK,MAAM,GAAG,IAAI,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;YAChC,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;gBACf,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACnB,CAAC;QACF,CAAC;IACF,CAAC;IAED,MAAM,CAAC,KAAK;QACX,KAAK,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IAED,MAAM,CAAC,IAAI;QACV,OAAO,KAAK,CAAC,IAAI,CAAC;IACnB,CAAC;CACD"}
@@ -0,0 +1,64 @@
1
+ import type { ParrelLedgerAdapter, ParrelLedgerServerAdapterOptions } from "./types.js";
2
+ /**
3
+ * The production Ledger endpoint.
4
+ *
5
+ * @deprecated The endpoint depends on `apiOrigin` and `PARREL_API_ORIGIN` now. Build the URL from
6
+ * `resolveParrelApiOrigin()` instead. This constant keeps the production value.
7
+ */
8
+ export declare const PARREL_LEDGER_SERVER_BASE_URL = "https://api.parrel.dev/cms/v1";
9
+ /**
10
+ * HTTP-based Ledger adapter that communicates with the Ledger backend.
11
+ *
12
+ * Endpoints, relative to the base URL `{apiOrigin}/cms/v1` (in the Ledger OpenAPI spec they are `/v1/...`, behind the
13
+ * product prefix `/cms`):
14
+ * - GET /read/{slug}/manifest
15
+ * - GET /read/{slug}/resource/{resource}?path={nested.path}: a resource, or the value at a path. `getMedia` reads the
16
+ * media value of a field this way, with the path `{field}.url`.
17
+ * - POST /write/{slug}/resource/{resource}?path={nested.path}
18
+ * - POST /write/{slug}/media/{resource}?path={nested.path}: a multipart request with the file in the part `file`
19
+ *
20
+ * Reads are public: no request of a read carries a token, and there is no read token. A write (`uploadContent`,
21
+ * `uploadMedia`) runs in the browser only and sends the access token of the browser session of `@parrel/sentinel` as
22
+ * `Authorization: Bearer`. On a server there is no session, so a write throws `SD02000008` before it sends anything.
23
+ *
24
+ * After a `401` on a write the adapter renews the access token once with `refreshCurrentAccessToken()` of
25
+ * `@parrel/sentinel` and tries again. If Sentinel refuses the refresh token, the session is cleared and the `401` answer
26
+ * of Ledger is thrown.
27
+ *
28
+ * `uploadMedia` checks the file before it sends it (see `assertLedgerMediaFile`): an empty file (`LE02500009`), a file
29
+ * over 50 MB (`LE02500010`) and an extension that is not allowed (`LE02500007`) are refused locally.
30
+ *
31
+ * The `url` of a media value is `/read/{slug}/media/{mediaName}`, relative to the base URL. `getMedia` returns it as an
32
+ * absolute URL (or through the media proxy), and the browser or the proxy fetches the file from there.
33
+ *
34
+ * The base URL is `{apiOrigin}/cms/v1`, by default `https://api.parrel.dev/cms/v1`. You rarely need this:
35
+ * `defineParrelLedger` picks it automatically in production.
36
+ *
37
+ * In production, paths are translated to resource + optional query path.
38
+ * In non-production, legacy direct-name behavior is kept for local compatibility, unless `mode` is `"live"`
39
+ * or `PARREL_FORCE_LIVE=1` is set.
40
+ *
41
+ * Every method that gets an answer other than 2xx throws the {@link ParrelError} that Ledger returned, with its
42
+ * own code, status and trace id (for example `LE02000003` for a resource that does not exist). A request that gets
43
+ * no answer throws `SD01000001` (read content), `SD01000002` (save content), `SD01000003` (read media),
44
+ * `SD01000004` (upload media) or `SD01000005` (read the manifest), with the original error as `cause`. A write on a
45
+ * server throws `SD02000008`. An answer
46
+ * that is not a Parrel error body throws `SD01000012` with the HTTP status.
47
+ *
48
+ * On a server, every read (the manifest, a resource and the URL of a media field) sends the origin of your site as
49
+ * `Origin`: set `siteOrigin` or the environment variable `PARREL_SITE_ORIGIN` to an origin of your Ledger service.
50
+ * A browser sends its own `Origin`; writes, the media proxy and `parrel ledger sync` send none.
51
+ *
52
+ * @throws {ParrelError} `SD00100008` when `apiOrigin` or `PARREL_API_ORIGIN` is not an allowed origin
53
+ * @throws {ParrelError} `SD00100018` when `siteOrigin` or `PARREL_SITE_ORIGIN` is not an origin in the accepted form
54
+ * @throws {ParrelError} `SD00100019` on a read from a server in production or live mode when neither `siteOrigin` nor
55
+ * `PARREL_SITE_ORIGIN` is set
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * // On a server
60
+ * const adapter = createParrelLedgerServerAdapter({ siteOrigin: "https://shop.be" });
61
+ * ```
62
+ */
63
+ export declare function createParrelLedgerServerAdapter(options?: ParrelLedgerServerAdapterOptions): ParrelLedgerAdapter;
64
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/core/client.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACX,mBAAmB,EACnB,gCAAgC,EAKhC,MAAM,YAAY,CAAC;AAepB;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,kCAAmD,CAAC;AAE9F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,wBAAgB,+BAA+B,CAAC,OAAO,GAAE,gCAAqC,GAAG,mBAAmB,CAsQnH"}
@@ -0,0 +1,281 @@
1
+ import { isParrelProduction, readCurrentTokenPair, refreshCurrentAccessToken } from "@parrel/sentinel";
2
+ import { ledgerMediaFileProblem } from "../cli/utils/media-file.js";
3
+ import { assertBrowserSession } from "./browser-session.js";
4
+ import { requireParrelLedgerConfig } from "./config.js";
5
+ import { assertParrelSiteOrigin, isParrelForceLive, PARREL_DEFAULT_API_ORIGIN, requireParrelSiteOrigin, resolveParrelApiOrigin, resolveParrelSiteOrigin, } from "./env.js";
6
+ import { DEFAULT_COPY_TTL_SECONDS } from "./cache.js";
7
+ import { DEFAULT_MANIFEST_TTL_SECONDS } from "./manifest.js";
8
+ import { handshakeHeaders, runsInBrowser } from "./package-info.js";
9
+ import { ParrelError, parseApiError } from "./parrel-error.js";
10
+ /** Path of the Ledger API on the Parrel API origin. */
11
+ const LEDGER_API_PATH = "/cms/v1";
12
+ /** The error for a request that got no answer at all: offline, DNS, connection refused or, in a browser, CORS. */
13
+ function unreachable(code, what, cause) {
14
+ return new ParrelError(code, `Ledger could not be reached to ${what}. Check your internet connection and the \`apiOrigin\` setting (or PARREL_API_ORIGIN), then try again. ` +
15
+ "In a browser, a request from an origin that is not allowed fails the same way: check the allowed origins of your Ledger service in the Parrel portal.", { cause });
16
+ }
17
+ /**
18
+ * The production Ledger endpoint.
19
+ *
20
+ * @deprecated The endpoint depends on `apiOrigin` and `PARREL_API_ORIGIN` now. Build the URL from
21
+ * `resolveParrelApiOrigin()` instead. This constant keeps the production value.
22
+ */
23
+ export const PARREL_LEDGER_SERVER_BASE_URL = `${PARREL_DEFAULT_API_ORIGIN}${LEDGER_API_PATH}`;
24
+ /**
25
+ * HTTP-based Ledger adapter that communicates with the Ledger backend.
26
+ *
27
+ * Endpoints, relative to the base URL `{apiOrigin}/cms/v1` (in the Ledger OpenAPI spec they are `/v1/...`, behind the
28
+ * product prefix `/cms`):
29
+ * - GET /read/{slug}/manifest
30
+ * - GET /read/{slug}/resource/{resource}?path={nested.path}: a resource, or the value at a path. `getMedia` reads the
31
+ * media value of a field this way, with the path `{field}.url`.
32
+ * - POST /write/{slug}/resource/{resource}?path={nested.path}
33
+ * - POST /write/{slug}/media/{resource}?path={nested.path}: a multipart request with the file in the part `file`
34
+ *
35
+ * Reads are public: no request of a read carries a token, and there is no read token. A write (`uploadContent`,
36
+ * `uploadMedia`) runs in the browser only and sends the access token of the browser session of `@parrel/sentinel` as
37
+ * `Authorization: Bearer`. On a server there is no session, so a write throws `SD02000008` before it sends anything.
38
+ *
39
+ * After a `401` on a write the adapter renews the access token once with `refreshCurrentAccessToken()` of
40
+ * `@parrel/sentinel` and tries again. If Sentinel refuses the refresh token, the session is cleared and the `401` answer
41
+ * of Ledger is thrown.
42
+ *
43
+ * `uploadMedia` checks the file before it sends it (see `assertLedgerMediaFile`): an empty file (`LE02500009`), a file
44
+ * over 50 MB (`LE02500010`) and an extension that is not allowed (`LE02500007`) are refused locally.
45
+ *
46
+ * The `url` of a media value is `/read/{slug}/media/{mediaName}`, relative to the base URL. `getMedia` returns it as an
47
+ * absolute URL (or through the media proxy), and the browser or the proxy fetches the file from there.
48
+ *
49
+ * The base URL is `{apiOrigin}/cms/v1`, by default `https://api.parrel.dev/cms/v1`. You rarely need this:
50
+ * `defineParrelLedger` picks it automatically in production.
51
+ *
52
+ * In production, paths are translated to resource + optional query path.
53
+ * In non-production, legacy direct-name behavior is kept for local compatibility, unless `mode` is `"live"`
54
+ * or `PARREL_FORCE_LIVE=1` is set.
55
+ *
56
+ * Every method that gets an answer other than 2xx throws the {@link ParrelError} that Ledger returned, with its
57
+ * own code, status and trace id (for example `LE02000003` for a resource that does not exist). A request that gets
58
+ * no answer throws `SD01000001` (read content), `SD01000002` (save content), `SD01000003` (read media),
59
+ * `SD01000004` (upload media) or `SD01000005` (read the manifest), with the original error as `cause`. A write on a
60
+ * server throws `SD02000008`. An answer
61
+ * that is not a Parrel error body throws `SD01000012` with the HTTP status.
62
+ *
63
+ * On a server, every read (the manifest, a resource and the URL of a media field) sends the origin of your site as
64
+ * `Origin`: set `siteOrigin` or the environment variable `PARREL_SITE_ORIGIN` to an origin of your Ledger service.
65
+ * A browser sends its own `Origin`; writes, the media proxy and `parrel ledger sync` send none.
66
+ *
67
+ * @throws {ParrelError} `SD00100008` when `apiOrigin` or `PARREL_API_ORIGIN` is not an allowed origin
68
+ * @throws {ParrelError} `SD00100018` when `siteOrigin` or `PARREL_SITE_ORIGIN` is not an origin in the accepted form
69
+ * @throws {ParrelError} `SD00100019` on a read from a server in production or live mode when neither `siteOrigin` nor
70
+ * `PARREL_SITE_ORIGIN` is set
71
+ *
72
+ * @example
73
+ * ```ts
74
+ * // On a server
75
+ * const adapter = createParrelLedgerServerAdapter({ siteOrigin: "https://shop.be" });
76
+ * ```
77
+ */
78
+ export function createParrelLedgerServerAdapter(options = {}) {
79
+ // The paths are fixed. The origin is the production API unless apiOrigin or PARREL_API_ORIGIN says otherwise.
80
+ const origin = resolveParrelApiOrigin(options.apiOrigin);
81
+ const baseUrl = `${origin}${LEDGER_API_PATH}`;
82
+ const encodeSegment = (value) => encodeURIComponent(value);
83
+ const encodeQuery = (value) => encodeURIComponent(value);
84
+ // A live-mode app in development talks to the service exactly like a production build.
85
+ const isProduction = isParrelProduction() || isParrelForceLive(options.mode);
86
+ /** The `X-Parrel-Package` header: always on a server, in a browser unless `sendHandshakeFromBrowser` is `false`. */
87
+ const handshake = () => handshakeHeaders(options.sendHandshakeFromBrowser);
88
+ // A wrong siteOrigin option fails here; a wrong or missing PARREL_SITE_ORIGIN fails at the first read from a server.
89
+ assertParrelSiteOrigin(options.siteOrigin);
90
+ /**
91
+ * The `Origin` header of a read from a server: Ledger refuses a read from a public server without an allowed origin
92
+ * (rulebook LED-11, SEC-33). A browser sets its own. In production or live mode a missing site origin throws
93
+ * `SD00100019` before anything is sent; outside them a read without one goes out without the header.
94
+ */
95
+ function siteOriginHeader() {
96
+ if (runsInBrowser()) {
97
+ return {};
98
+ }
99
+ const siteOrigin = isProduction
100
+ ? requireParrelSiteOrigin(options.siteOrigin)
101
+ : resolveParrelSiteOrigin(options.siteOrigin);
102
+ return siteOrigin ? { Origin: siteOrigin } : {};
103
+ }
104
+ // ─── Requests ────────────────────────────────────────────────────────────────
105
+ /** The write headers: the access token of the browser session. No token means no header, and Ledger answers 401. */
106
+ async function writeAuthHeaders() {
107
+ const tokens = await readCurrentTokenPair();
108
+ return tokens?.accessToken ? { Authorization: `Bearer ${tokens.accessToken}` } : {};
109
+ }
110
+ /**
111
+ * Sends a write with the Bearer token of the browser session. After a 401 it renews the token once with
112
+ * `refreshCurrentAccessToken()` and sends the write again.
113
+ */
114
+ async function fetchWrite(url, init) {
115
+ const send = (auth) => fetch(url, { ...init, headers: { ...handshake(), ...init.headers, ...auth } });
116
+ const response = await send(await writeAuthHeaders());
117
+ if (response.status !== 401 || !isProduction) {
118
+ return response;
119
+ }
120
+ const accessToken = await refreshCurrentAccessToken();
121
+ return accessToken ? send({ Authorization: `Bearer ${accessToken}` }) : response;
122
+ }
123
+ /**
124
+ * Sends a read. A read is public: no `Authorization` header, and no token to renew. On a server it carries the
125
+ * `Origin` of the site, which `send` resolves before the request.
126
+ */
127
+ function fetchRead(url, init, origin) {
128
+ return fetch(url, { ...init, headers: { ...handshake(), ...init.headers, ...origin } });
129
+ }
130
+ /**
131
+ * Sends a call to Ledger. A request without an answer becomes `code`, an answer that is not OK becomes the
132
+ * error that Ledger returned.
133
+ */
134
+ async function send(url, init, code, what, write = false) {
135
+ // A missing or wrong site origin is a mistake in the setup, not a network error: it throws before the try.
136
+ const origin = write ? {} : siteOriginHeader();
137
+ let response;
138
+ try {
139
+ response = write ? await fetchWrite(url, init) : await fetchRead(url, init, origin);
140
+ }
141
+ catch (error) {
142
+ throw unreachable(code, what, error);
143
+ }
144
+ if (!response.ok) {
145
+ throw await parseApiError(response);
146
+ }
147
+ return response;
148
+ }
149
+ // ─── Path parsing ────────────────────────────────────────────────────────────
150
+ const parseResourcePath = (path) => {
151
+ const firstDot = path.indexOf(".");
152
+ const firstBracket = path.indexOf("[");
153
+ let splitAt = -1;
154
+ if (firstDot >= 0 && firstBracket >= 0) {
155
+ splitAt = Math.min(firstDot, firstBracket);
156
+ }
157
+ else if (firstDot >= 0) {
158
+ splitAt = firstDot;
159
+ }
160
+ else if (firstBracket >= 0) {
161
+ splitAt = firstBracket;
162
+ }
163
+ if (splitAt < 0) {
164
+ return { resource: path };
165
+ }
166
+ const resource = path.slice(0, splitAt);
167
+ const nestedPath = path.slice(splitAt).replace(/^\./, "");
168
+ return nestedPath ? { resource, nestedPath } : { resource };
169
+ };
170
+ const parseMediaPath = (path) => {
171
+ const parsed = parseResourcePath(path);
172
+ if (parsed.nestedPath) {
173
+ return parsed;
174
+ }
175
+ const dashIndex = path.lastIndexOf("-");
176
+ if (dashIndex > 0 && dashIndex < path.length - 1) {
177
+ return {
178
+ resource: path.slice(0, dashIndex),
179
+ nestedPath: path.slice(dashIndex + 1),
180
+ };
181
+ }
182
+ return parsed;
183
+ };
184
+ const maybePathQuery = (nestedPath) => nestedPath && nestedPath.trim() !== "" ? `?path=${encodeQuery(nestedPath)}` : "";
185
+ // Maps Ledger cache mode → Next.js fetch-level cache hints so that Next.js
186
+ // ISR and the Data Cache respect the same semantics as LedgerCache.
187
+ function buildNextFetchInit(options) {
188
+ const config = requireParrelLedgerConfig();
189
+ const ttl = config.cache?.ttlSeconds ?? DEFAULT_COPY_TTL_SECONDS;
190
+ const mode = options?.cache ?? "default";
191
+ if (mode === "force" || mode === "no-store") {
192
+ return { cache: "no-store" };
193
+ }
194
+ // "default": tell Next.js to revalidate after TTL (ISR-style)
195
+ return { next: { revalidate: ttl } };
196
+ }
197
+ return {
198
+ async getContent(path, options) {
199
+ const config = requireParrelLedgerConfig();
200
+ const slug = config.slug;
201
+ const parsed = parseResourcePath(path);
202
+ const endpoint = isProduction
203
+ ? `${baseUrl}/read/${encodeSegment(slug)}/resource/${encodeSegment(parsed.resource)}${maybePathQuery(parsed.nestedPath)}`
204
+ : `${baseUrl}/read/${encodeSegment(slug)}/resource/${encodeSegment(path)}`;
205
+ const response = await send(endpoint, buildNextFetchInit(options), "SD01000001", "read content");
206
+ return response.json();
207
+ },
208
+ async getMedia(path, options) {
209
+ const config = requireParrelLedgerConfig();
210
+ const slug = config.slug;
211
+ // Fetch the URL from the resource JSON — the backend stores the public
212
+ // media URL there at upload time.
213
+ const parsed = parseMediaPath(path);
214
+ const mediaPath = parsed.nestedPath ? `${parsed.nestedPath}.url` : "url";
215
+ const response = await send(`${baseUrl}/read/${encodeSegment(slug)}/resource/${encodeSegment(parsed.resource)}${maybePathQuery(mediaPath)}`, buildNextFetchInit(options), "SD01000003", "read media");
216
+ const raw = (await response.json());
217
+ if (typeof raw !== "string" || raw.trim() === "") {
218
+ throw new ParrelError("SD02000006", `Ledger answered the request for the media "${path}" without a usable URL. Check that the media field has a file in the Parrel portal, or try again later.`);
219
+ }
220
+ // Build the absolute Ledger URL (handles relative "/read/..." and absolute URLs)
221
+ const absoluteUrl = /^https?:\/\//i.test(raw)
222
+ ? raw
223
+ : raw.startsWith("/")
224
+ ? `${baseUrl}${raw}`
225
+ : `${baseUrl}/${raw}`;
226
+ // If a same-origin proxy is configured, rewrite to proxy URL so the
227
+ // browser fetches media without hitting X-Frame-Options / CORS headers
228
+ // from the Ledger backend.
229
+ if (config.mediaProxyPath) {
230
+ try {
231
+ const parsed = new URL(absoluteUrl);
232
+ return `${config.mediaProxyPath}${parsed.pathname}`;
233
+ }
234
+ catch {
235
+ // Malformed URL — fall through and return absolute URL
236
+ }
237
+ }
238
+ return absoluteUrl;
239
+ },
240
+ async uploadContent(path, value) {
241
+ assertBrowserSession();
242
+ const config = requireParrelLedgerConfig();
243
+ const slug = config.slug;
244
+ const parsed = parseResourcePath(path);
245
+ const endpoint = isProduction
246
+ ? `${baseUrl}/write/${encodeSegment(slug)}/resource/${encodeSegment(parsed.resource)}${maybePathQuery(parsed.nestedPath)}`
247
+ : `${baseUrl}/write/${encodeSegment(slug)}/resource/${encodeSegment(path)}`;
248
+ await send(endpoint, {
249
+ method: "POST",
250
+ headers: { "Content-Type": "application/json" },
251
+ body: JSON.stringify({ content: value }),
252
+ }, "SD01000002", "save content", true);
253
+ },
254
+ async uploadMedia(path, file) {
255
+ assertBrowserSession();
256
+ const config = requireParrelLedgerConfig();
257
+ const slug = config.slug;
258
+ // The service decides, but it gives the same answer for these three, so the visitor gets it before the upload.
259
+ const problem = ledgerMediaFileProblem(file);
260
+ if (problem) {
261
+ throw problem;
262
+ }
263
+ const parsed = parseMediaPath(path);
264
+ const formData = new FormData();
265
+ formData.append("file", file);
266
+ const endpoint = isProduction
267
+ ? `${baseUrl}/write/${encodeSegment(slug)}/media/${encodeSegment(parsed.resource)}${maybePathQuery(parsed.nestedPath)}`
268
+ : `${baseUrl}/write/${encodeSegment(slug)}/media/${encodeSegment(path)}`;
269
+ await send(endpoint, { method: "POST", body: formData }, "SD01000004", "upload media", true);
270
+ },
271
+ async getManifest() {
272
+ const config = requireParrelLedgerConfig();
273
+ const slug = config.slug;
274
+ const response = await send(`${baseUrl}/read/${encodeSegment(slug)}/manifest`,
275
+ // The manifest decides when content is read again, so Next.js keeps it no longer than the manifest TTL.
276
+ { next: { revalidate: config.cache?.manifestTtlSeconds ?? DEFAULT_MANIFEST_TTL_SECONDS } }, "SD01000005", "read the content manifest");
277
+ return response.json();
278
+ },
279
+ };
280
+ }
281
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/core/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AACvG,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EACN,sBAAsB,EACtB,iBAAiB,EACjB,yBAAyB,EACzB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,GACvB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAW/D,uDAAuD;AACvD,MAAM,eAAe,GAAG,SAAS,CAAC;AAElC,kHAAkH;AAClH,SAAS,WAAW,CAAC,IAAqB,EAAE,IAAY,EAAE,KAAc;IACvE,OAAO,IAAI,WAAW,CACrB,IAAI,EACJ,kCAAkC,IAAI,yGAAyG;QAC9I,uJAAuJ,EACxJ,EAAE,KAAK,EAAE,CACT,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,yBAAyB,GAAG,eAAe,EAAE,CAAC;AAE9F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AQ,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE;gBACvH,CAAC,CAAC,GAAG,OAAO,UAAU,aAAa,CAAC,IAAI,CAAC,UAAU,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;YAE1E,MAAM,IAAI,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,YAAY,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;QAC9F,CAAC;QAED,KAAK,CAAC,WAAW;YAChB,MAAM,MAAM,GAAG,yBAAyB,EAAE,CAAC;YAC3C,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;YAEzB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAC1B,GAAG,OAAO,SAAS,aAAa,CAAC,IAAI,CAAC,WAAW;YACjD,wGAAwG;YACxG,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,CAAC,KAAK,EAAE,kBAAkB,IAAI,4BAA4B,EAAE,EAAiB,EACzG,YAAY,EACZ,2BAA2B,CAC3B,CAAC;YAEF,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;QACxB,CAAC;KACD,CAAC;AACH,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { ParrelLedgerRuntimeConfig } from "./types.js";
2
+ /**
3
+ * Sets the global Ledger configuration (internal use)
4
+ */
5
+ export declare function setParrelLedgerConfig(config: ParrelLedgerRuntimeConfig): void;
6
+ /**
7
+ * Gets the global Ledger configuration or null if not configured
8
+ */
9
+ export declare function getParrelLedgerConfig(): ParrelLedgerRuntimeConfig | null;
10
+ /**
11
+ * Gets the global Ledger configuration, throwing if not configured
12
+ *
13
+ * @throws {ParrelError} `SD00100001` when `defineParrelLedger` has not been called
14
+ */
15
+ export declare function requireParrelLedgerConfig(): ParrelLedgerRuntimeConfig;
16
+ /**
17
+ * Resets the Ledger configuration (useful for testing)
18
+ */
19
+ export declare function resetParrelLedgerConfig(): void;
20
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAI5D;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,yBAAyB,GAAG,IAAI,CAE7E;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,yBAAyB,GAAG,IAAI,CAExE;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,IAAI,yBAAyB,CAQrE;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C"}
@@ -0,0 +1,32 @@
1
+ import { ParrelError } from "./parrel-error.js";
2
+ let ledgerConfig = null;
3
+ /**
4
+ * Sets the global Ledger configuration (internal use)
5
+ */
6
+ export function setParrelLedgerConfig(config) {
7
+ ledgerConfig = config;
8
+ }
9
+ /**
10
+ * Gets the global Ledger configuration or null if not configured
11
+ */
12
+ export function getParrelLedgerConfig() {
13
+ return ledgerConfig;
14
+ }
15
+ /**
16
+ * Gets the global Ledger configuration, throwing if not configured
17
+ *
18
+ * @throws {ParrelError} `SD00100001` when `defineParrelLedger` has not been called
19
+ */
20
+ export function requireParrelLedgerConfig() {
21
+ if (!ledgerConfig) {
22
+ throw new ParrelError("SD00100001", "Ledger is not configured. Call defineParrelLedger({ slug }) once at startup (for example in lib/ledger.ts) before you read or write content. On a server, the file must be loaded there: in SvelteKit import it in src/hooks.server.ts, in Nuxt use it in a server plugin; `npx parrel ledger init` writes both.");
23
+ }
24
+ return ledgerConfig;
25
+ }
26
+ /**
27
+ * Resets the Ledger configuration (useful for testing)
28
+ */
29
+ export function resetParrelLedgerConfig() {
30
+ ledgerConfig = null;
31
+ }
32
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,IAAI,YAAY,GAAqC,IAAI,CAAC;AAE1D;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAiC;IACtE,YAAY,GAAG,MAAM,CAAC;AACvB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB;IACpC,OAAO,YAAY,CAAC;AACrB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,yBAAyB;IACxC,IAAI,CAAC,YAAY,EAAE,CAAC;QACnB,MAAM,IAAI,WAAW,CACpB,YAAY,EACZ,kTAAkT,CAClT,CAAC;IACH,CAAC;IACD,OAAO,YAAY,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB;IACtC,YAAY,GAAG,IAAI,CAAC;AACrB,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { ContentAccessOptions, ParrelLedgerRuntimeConfig } from "./types.js";
2
+ /** The resource name of a content path: the text before the first `.` or `[`. */
3
+ export declare function resourceOf(path: string): string;
4
+ /**
5
+ * The resource that holds a media path, the way the server adapter splits it: `homepage.hero` and `homepage-hero` both
6
+ * belong to `homepage`. A media URL follows the hash of that resource, because the manifest lists media by file name.
7
+ */
8
+ export declare function mediaResourceOf(path: string): string;
9
+ /** What one read needs: the configuration, the key of the copy, its resource, and how to download it. */
10
+ export interface CopyRead<T> {
11
+ config: ParrelLedgerRuntimeConfig;
12
+ key: string;
13
+ resource: string;
14
+ options?: ContentAccessOptions;
15
+ /** Downloads the value. `options.cache` is `"force"` when a copy must not come from another cache (Next.js). */
16
+ download: (options?: ContentAccessOptions) => Promise<T>;
17
+ }
18
+ /** Reads `key` by the rule of rulebook LIM-13 and the cache mode of `options`. */
19
+ export declare function readWithCopy<T>({ config, key, resource, options, download }: CopyRead<T>): Promise<T>;
20
+ /**
21
+ * Drops the copies that a write to `path` makes old: every copy of content and every copy of a media URL of the same
22
+ * resource. The manifest stays.
23
+ */
24
+ export declare function dropCopiesOfResource(slug: string, resource: string): void;
25
+ //# sourceMappingURL=copy-read.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-read.d.ts","sourceRoot":"","sources":["../../src/core/copy-read.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAe,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAa/F,iFAAiF;AACjF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG/C;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIpD;AAyBD,yGAAyG;AACzG,MAAM,WAAW,QAAQ,CAAC,CAAC;IAC1B,MAAM,EAAE,yBAAyB,CAAC;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,gHAAgH;IAChH,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,oBAAoB,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;CACzD;AAED,kFAAkF;AAClF,wBAAsB,YAAY,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAsD3G;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAQzE"}