@carlonicora/nextjs-jsonapi 6.13.1 → 6.14.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 (153) hide show
  1. package/dist/{BlockNoteEditor-VXMDSQAA.mjs → BlockNoteEditor-I3J6YYXK.mjs} +10 -10
  2. package/dist/{BlockNoteEditor-UBVEUFNR.js → BlockNoteEditor-UIAX72XW.js} +25 -25
  3. package/dist/{BlockNoteEditor-UBVEUFNR.js.map → BlockNoteEditor-UIAX72XW.js.map} +1 -1
  4. package/dist/{BlockNoteViewer-2XYASA5Y.js → BlockNoteViewer-APBOPT4B.js} +8 -8
  5. package/dist/{BlockNoteViewer-2XYASA5Y.js.map → BlockNoteViewer-APBOPT4B.js.map} +1 -1
  6. package/dist/{BlockNoteViewer-NBW2H6LC.mjs → BlockNoteViewer-HIUAJQRI.mjs} +7 -7
  7. package/dist/JsonApiRequest-G4J2WTSU.js +26 -0
  8. package/dist/{JsonApiRequest-WISJZSDE.js.map → JsonApiRequest-G4J2WTSU.js.map} +1 -1
  9. package/dist/{JsonApiRequest-F6TMJ42G.mjs → JsonApiRequest-IKKHWCPB.mjs} +2 -2
  10. package/dist/billing/index.js +497 -497
  11. package/dist/billing/index.mjs +9 -9
  12. package/dist/{chunk-7DBJTNSU.mjs → chunk-4RPGFQBA.mjs} +2 -2
  13. package/dist/{chunk-BZ5J2FIV.js → chunk-4XLDBOSE.js} +11 -11
  14. package/dist/{chunk-BZ5J2FIV.js.map → chunk-4XLDBOSE.js.map} +1 -1
  15. package/dist/{chunk-27LQDGNP.mjs → chunk-4ZJIUTIV.mjs} +6 -1
  16. package/dist/chunk-4ZJIUTIV.mjs.map +1 -0
  17. package/dist/{chunk-PXDUJ47N.js → chunk-6RCZ64BQ.js} +18 -18
  18. package/dist/{chunk-PXDUJ47N.js.map → chunk-6RCZ64BQ.js.map} +1 -1
  19. package/dist/{chunk-7JZHPMGW.mjs → chunk-A3RB47X4.mjs} +44 -20
  20. package/dist/chunk-A3RB47X4.mjs.map +1 -0
  21. package/dist/{chunk-DOCIFE6A.mjs → chunk-AUD6ZLBB.mjs} +3 -3
  22. package/dist/{chunk-GB6DBFYY.js → chunk-DGN3PR2F.js} +3 -3
  23. package/dist/{chunk-GB6DBFYY.js.map → chunk-DGN3PR2F.js.map} +1 -1
  24. package/dist/{chunk-7ZHTPFFT.js → chunk-DJXSCARG.js} +15 -15
  25. package/dist/{chunk-7ZHTPFFT.js.map → chunk-DJXSCARG.js.map} +1 -1
  26. package/dist/{chunk-QKNGZDSQ.js → chunk-GM4VZTWL.js} +2 -2
  27. package/dist/{chunk-QKNGZDSQ.js.map → chunk-GM4VZTWL.js.map} +1 -1
  28. package/dist/{chunk-47BBY5KA.mjs → chunk-HAW5PNJG.mjs} +4 -4
  29. package/dist/{chunk-YRKIFYOE.mjs → chunk-KTGKW72G.mjs} +27 -8
  30. package/dist/chunk-KTGKW72G.mjs.map +1 -0
  31. package/dist/{chunk-PV4Z5W6V.js → chunk-KV4N7DEG.js} +19 -19
  32. package/dist/{chunk-PV4Z5W6V.js.map → chunk-KV4N7DEG.js.map} +1 -1
  33. package/dist/{chunk-ZLTOUZN2.mjs → chunk-M3N7LPHX.mjs} +4 -4
  34. package/dist/{chunk-DGWOVYEC.mjs → chunk-MQ7TXALH.mjs} +2 -2
  35. package/dist/{chunk-W62MHDWM.js → chunk-N5ZE2Z6I.js} +58 -34
  36. package/dist/chunk-N5ZE2Z6I.js.map +1 -0
  37. package/dist/{chunk-2SV4SS6N.js → chunk-OQQ7CZWT.js} +12 -12
  38. package/dist/{chunk-2SV4SS6N.js.map → chunk-OQQ7CZWT.js.map} +1 -1
  39. package/dist/{chunk-JJMMT24D.mjs → chunk-OUEYZOLB.mjs} +2 -2
  40. package/dist/{chunk-XXP3TQHF.mjs → chunk-OY65RYD3.mjs} +2 -2
  41. package/dist/{chunk-MOGEGWXW.js → chunk-PMESKNKL.js} +868 -868
  42. package/dist/{chunk-MOGEGWXW.js.map → chunk-PMESKNKL.js.map} +1 -1
  43. package/dist/{chunk-B6JGKDP2.js → chunk-QGVVF77L.js} +48 -29
  44. package/dist/chunk-QGVVF77L.js.map +1 -0
  45. package/dist/{chunk-BH6JWIKI.mjs → chunk-QIEF7HIL.mjs} +2 -2
  46. package/dist/{chunk-P445QGOC.mjs → chunk-RFKSJIQB.mjs} +7 -7
  47. package/dist/{chunk-PYRZCKC2.js → chunk-RT7XFGIN.js} +1141 -1137
  48. package/dist/chunk-RT7XFGIN.js.map +1 -0
  49. package/dist/{chunk-N4RZZKL5.mjs → chunk-RYY7USSW.mjs} +19 -15
  50. package/dist/chunk-RYY7USSW.mjs.map +1 -0
  51. package/dist/{chunk-6JUCIWDC.mjs → chunk-UOTHRJD2.mjs} +2 -2
  52. package/dist/{chunk-KMW7UNL2.js → chunk-WCEYT3GG.js} +8 -8
  53. package/dist/{chunk-KMW7UNL2.js.map → chunk-WCEYT3GG.js.map} +1 -1
  54. package/dist/{chunk-MHB36MYE.js → chunk-WUNSG3IN.js} +7 -2
  55. package/dist/chunk-WUNSG3IN.js.map +1 -0
  56. package/dist/{chunk-Z4POQWFG.js → chunk-ZYSNJKOP.js} +4 -4
  57. package/dist/{chunk-Z4POQWFG.js.map → chunk-ZYSNJKOP.js.map} +1 -1
  58. package/dist/client/index.js +10 -10
  59. package/dist/client/index.mjs +9 -9
  60. package/dist/components/index.js +10 -10
  61. package/dist/components/index.mjs +9 -9
  62. package/dist/contexts/index.js +10 -10
  63. package/dist/contexts/index.mjs +9 -9
  64. package/dist/core/index.js +7 -7
  65. package/dist/core/index.mjs +6 -6
  66. package/dist/email-automations/index.js +99 -99
  67. package/dist/email-automations/index.mjs +9 -9
  68. package/dist/features/analytics/index.js +126 -126
  69. package/dist/features/analytics/index.mjs +9 -9
  70. package/dist/features/analytics/server.js +10 -10
  71. package/dist/features/analytics/server.mjs +8 -8
  72. package/dist/features/blog/index.js +156 -156
  73. package/dist/features/blog/index.mjs +9 -9
  74. package/dist/features/blog/server.js +28 -28
  75. package/dist/features/blog/server.mjs +7 -7
  76. package/dist/features/help/index.js +43 -43
  77. package/dist/features/help/index.mjs +9 -9
  78. package/dist/features/tokenusage/index.js +132 -132
  79. package/dist/features/tokenusage/index.mjs +9 -9
  80. package/dist/index.js +8 -8
  81. package/dist/index.mjs +7 -7
  82. package/dist/{lifecycle-LKGPRBS7.mjs → lifecycle-KI3PCJSE.mjs} +3 -3
  83. package/dist/lifecycle-TO65I7TO.js +23 -0
  84. package/dist/{lifecycle-4GUOTB46.js.map → lifecycle-TO65I7TO.js.map} +1 -1
  85. package/dist/local-transport-4YDJ6FQG.js +15 -0
  86. package/dist/{local-transport-7H3SPZSA.js.map → local-transport-4YDJ6FQG.js.map} +1 -1
  87. package/dist/local-transport-C7YTA4I7.mjs +15 -0
  88. package/dist/offline/index.d.mts +160 -4
  89. package/dist/offline/index.d.ts +160 -4
  90. package/dist/offline/index.js +210 -163
  91. package/dist/offline/index.js.map +1 -1
  92. package/dist/offline/index.mjs +76 -29
  93. package/dist/offline/index.mjs.map +1 -1
  94. package/dist/request-66FGJIHB.mjs +10 -0
  95. package/dist/request-6W6UGKJV.js +10 -0
  96. package/dist/{request-KTBV6HHH.js.map → request-6W6UGKJV.js.map} +1 -1
  97. package/dist/server/index.js +9 -9
  98. package/dist/server/index.mjs +8 -8
  99. package/dist/write-through-BAPS24GL.js +15 -0
  100. package/dist/{write-through-FDQ7N4YI.js.map → write-through-BAPS24GL.js.map} +1 -1
  101. package/dist/write-through-IWQKXYHE.mjs +15 -0
  102. package/package.json +1 -1
  103. package/src/hooks/__tests__/usePageTracker.spec.tsx +61 -0
  104. package/src/hooks/usePageTracker.ts +17 -7
  105. package/src/offline/__tests__/generic-answers.spec.ts +146 -3
  106. package/src/offline/__tests__/local-transport.spec.ts +15 -1
  107. package/src/offline/__tests__/offline-fixtures.ts +29 -2
  108. package/src/offline/__tests__/write-through.spec.ts +27 -1
  109. package/src/offline/config.ts +9 -0
  110. package/src/offline/generic-answers.ts +44 -17
  111. package/src/offline/index.ts +2 -0
  112. package/src/offline/local-transport.ts +5 -3
  113. package/src/offline/sync/__tests__/runtime.spec.ts +30 -1
  114. package/src/offline/sync/__tests__/sync-fixtures.ts +22 -0
  115. package/src/offline/sync/__tests__/sync-root.spec.ts +184 -1
  116. package/src/offline/sync/known-roots.ts +29 -7
  117. package/src/offline/sync/runtime.ts +3 -2
  118. package/src/offline/sync/sync-root.ts +70 -19
  119. package/src/offline/types.ts +39 -1
  120. package/src/offline/write-through.ts +6 -3
  121. package/dist/JsonApiRequest-WISJZSDE.js +0 -26
  122. package/dist/chunk-27LQDGNP.mjs.map +0 -1
  123. package/dist/chunk-7JZHPMGW.mjs.map +0 -1
  124. package/dist/chunk-B6JGKDP2.js.map +0 -1
  125. package/dist/chunk-MHB36MYE.js.map +0 -1
  126. package/dist/chunk-N4RZZKL5.mjs.map +0 -1
  127. package/dist/chunk-PYRZCKC2.js.map +0 -1
  128. package/dist/chunk-W62MHDWM.js.map +0 -1
  129. package/dist/chunk-YRKIFYOE.mjs.map +0 -1
  130. package/dist/lifecycle-4GUOTB46.js +0 -23
  131. package/dist/local-transport-7H3SPZSA.js +0 -15
  132. package/dist/local-transport-QYFKA6AN.mjs +0 -15
  133. package/dist/request-KTBV6HHH.js +0 -10
  134. package/dist/request-SQOUNWZ4.mjs +0 -10
  135. package/dist/write-through-FDQ7N4YI.js +0 -15
  136. package/dist/write-through-R25VQMH6.mjs +0 -15
  137. /package/dist/{BlockNoteEditor-VXMDSQAA.mjs.map → BlockNoteEditor-I3J6YYXK.mjs.map} +0 -0
  138. /package/dist/{BlockNoteViewer-NBW2H6LC.mjs.map → BlockNoteViewer-HIUAJQRI.mjs.map} +0 -0
  139. /package/dist/{JsonApiRequest-F6TMJ42G.mjs.map → JsonApiRequest-IKKHWCPB.mjs.map} +0 -0
  140. /package/dist/{chunk-7DBJTNSU.mjs.map → chunk-4RPGFQBA.mjs.map} +0 -0
  141. /package/dist/{chunk-DOCIFE6A.mjs.map → chunk-AUD6ZLBB.mjs.map} +0 -0
  142. /package/dist/{chunk-47BBY5KA.mjs.map → chunk-HAW5PNJG.mjs.map} +0 -0
  143. /package/dist/{chunk-ZLTOUZN2.mjs.map → chunk-M3N7LPHX.mjs.map} +0 -0
  144. /package/dist/{chunk-DGWOVYEC.mjs.map → chunk-MQ7TXALH.mjs.map} +0 -0
  145. /package/dist/{chunk-JJMMT24D.mjs.map → chunk-OUEYZOLB.mjs.map} +0 -0
  146. /package/dist/{chunk-XXP3TQHF.mjs.map → chunk-OY65RYD3.mjs.map} +0 -0
  147. /package/dist/{chunk-BH6JWIKI.mjs.map → chunk-QIEF7HIL.mjs.map} +0 -0
  148. /package/dist/{chunk-P445QGOC.mjs.map → chunk-RFKSJIQB.mjs.map} +0 -0
  149. /package/dist/{chunk-6JUCIWDC.mjs.map → chunk-UOTHRJD2.mjs.map} +0 -0
  150. /package/dist/{lifecycle-LKGPRBS7.mjs.map → lifecycle-KI3PCJSE.mjs.map} +0 -0
  151. /package/dist/{local-transport-QYFKA6AN.mjs.map → local-transport-C7YTA4I7.mjs.map} +0 -0
  152. /package/dist/{request-SQOUNWZ4.mjs.map → request-66FGJIHB.mjs.map} +0 -0
  153. /package/dist/{write-through-R25VQMH6.mjs.map → write-through-IWQKXYHE.mjs.map} +0 -0
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkPXDUJ47Njs = require('./chunk-PXDUJ47N.js');
5
+ var _chunk6RCZ64BQjs = require('./chunk-6RCZ64BQ.js');
6
6
 
7
7
 
8
8
 
@@ -10,41 +10,59 @@ var _chunkPXDUJ47Njs = require('./chunk-PXDUJ47N.js');
10
10
 
11
11
 
12
12
 
13
- var _chunkW62MHDWMjs = require('./chunk-W62MHDWM.js');
13
+ var _chunkN5ZE2Z6Ijs = require('./chunk-N5ZE2Z6I.js');
14
14
 
15
15
 
16
16
 
17
17
 
18
18
 
19
- var _chunkMHB36MYEjs = require('./chunk-MHB36MYE.js');
19
+
20
+ var _chunkWUNSG3INjs = require('./chunk-WUNSG3IN.js');
20
21
 
21
22
 
22
23
  var _chunk7QVYU63Ejs = require('./chunk-7QVYU63E.js');
23
24
 
24
25
  // src/offline/sync/known-roots.ts
25
26
  var _lastSyncRoots = [];
26
- function rememberSyncRoots(ids) {
27
+ var _lastExtraSyncRoots = [];
28
+ function rememberSyncRoots(ids, extraIds = []) {
27
29
  _lastSyncRoots = [...ids];
30
+ _lastExtraSyncRoots = [...extraIds];
28
31
  }
29
32
  _chunk7QVYU63Ejs.__name.call(void 0, rememberSyncRoots, "rememberSyncRoots");
30
33
  async function knownRootIds(store) {
31
- const config = _chunkMHB36MYEjs.getOfflineConfig.call(void 0, );
34
+ const config = _chunkWUNSG3INjs.getOfflineConfig.call(void 0, );
32
35
  const ids = new Set(_lastSyncRoots);
33
- for (const record of await store.listRecords({ type: config.rootModule.name })) ids.add(record.id);
36
+ for (const kind of _chunkWUNSG3INjs.rootKinds.call(void 0, config)) {
37
+ for (const record of await store.listRecords({ type: kind.module.name })) ids.add(record.id);
38
+ }
34
39
  for (const entry of await store.queue()) ids.add(entry.rootId);
35
40
  return [...ids].sort();
36
41
  }
37
42
  _chunk7QVYU63Ejs.__name.call(void 0, knownRootIds, "knownRootIds");
43
+ async function extraRootIds(store) {
44
+ const ids = new Set(_lastExtraSyncRoots);
45
+ for (const kind of _nullishCoalesce(_chunkWUNSG3INjs.getOfflineConfig.call(void 0, ).extraRootKinds, () => ( []))) {
46
+ for (const record of await store.listRecords({ type: kind.module.name })) ids.add(record.id);
47
+ }
48
+ return ids;
49
+ }
50
+ _chunk7QVYU63Ejs.__name.call(void 0, extraRootIds, "extraRootIds");
51
+ async function knownPrimaryRootIds(store) {
52
+ const extra = await extraRootIds(store);
53
+ return (await knownRootIds(store)).filter((id) => !extra.has(id));
54
+ }
55
+ _chunk7QVYU63Ejs.__name.call(void 0, knownPrimaryRootIds, "knownPrimaryRootIds");
38
56
  async function refreshLockedRoots() {
39
- const config = _chunkMHB36MYEjs.getOfflineConfig.call(void 0, );
57
+ const config = _chunkWUNSG3INjs.getOfflineConfig.call(void 0, );
40
58
  if (!config.getUserId()) return;
41
- const store = await _chunkMHB36MYEjs.getOfflineStore.call(void 0, );
59
+ const store = await _chunkWUNSG3INjs.getOfflineStore.call(void 0, );
42
60
  const now = /* @__PURE__ */ new Date();
43
61
  const locked = [];
44
62
  for (const id of await knownRootIds(store)) {
45
- if (_chunkPXDUJ47Njs.isRootLocked.call(void 0, await store.getSyncState(id), now)) locked.push(id);
63
+ if (_chunk6RCZ64BQjs.isRootLocked.call(void 0, await store.getSyncState(id), now)) locked.push(id);
46
64
  }
47
- _chunkMHB36MYEjs.setOfflineState.call(void 0, { lockedRootIds: locked });
65
+ _chunkWUNSG3INjs.setOfflineState.call(void 0, { lockedRootIds: locked });
48
66
  }
49
67
  _chunk7QVYU63Ejs.__name.call(void 0, refreshLockedRoots, "refreshLockedRoots");
50
68
 
@@ -97,9 +115,9 @@ async function updateLinks(store, typeConfig, record, before, after) {
97
115
  if (!relationship || !("data" in relationship)) continue;
98
116
  const next = new Map(identifiersOf(relationship).map((identifier) => [identifier.id, identifier]));
99
117
  const previous = new Set(identifiersOf(_optionalChain([before, 'optionalAccess', _6 => _6[name]])).map((identifier) => identifier.id));
100
- const kinds = _nullishCoalesce(_chunkW62MHDWMjs.linkKindsOf.call(void 0, typeConfig, name), () => ( [name]));
101
- const ofRelationship = await _chunkW62MHDWMjs.linksOfKind.call(void 0, store, record.id, kinds, "both");
102
- const mapped = _chunkW62MHDWMjs.linkKindsOf.call(void 0, typeConfig, name) !== void 0;
118
+ const kinds = _nullishCoalesce(_chunkN5ZE2Z6Ijs.linkKindsOf.call(void 0, typeConfig, name), () => ( [name]));
119
+ const ofRelationship = await _chunkN5ZE2Z6Ijs.linksOfKind.call(void 0, store, record.id, kinds, "both");
120
+ const mapped = _chunkN5ZE2Z6Ijs.linkKindsOf.call(void 0, typeConfig, name) !== void 0;
103
121
  const stale = [
104
122
  ...ofRelationship.filter((link) => !next.has(otherEnd(link))),
105
123
  // Unmapped: the link to an identifier the record held before may carry any kind.
@@ -107,7 +125,7 @@ async function updateLinks(store, typeConfig, record, before, after) {
107
125
  ];
108
126
  for (const link of stale) await store.deleteLink({ fromId: link.fromId, toId: link.toId, kind: link.kind });
109
127
  const linked = new Set(
110
- (mapped ? await _chunkW62MHDWMjs.linksOfKind.call(void 0, store, record.id, kinds, "both") : await allLinks()).map(otherEnd)
128
+ (mapped ? await _chunkN5ZE2Z6Ijs.linksOfKind.call(void 0, store, record.id, kinds, "both") : await allLinks()).map(otherEnd)
111
129
  );
112
130
  for (const [id, identifier] of next) {
113
131
  if (linked.has(id)) continue;
@@ -116,7 +134,7 @@ async function updateLinks(store, typeConfig, record, before, after) {
116
134
  fromId: record.id,
117
135
  toType: identifier.type,
118
136
  toId: id,
119
- kind: _chunkW62MHDWMjs.linkKindFor.call(void 0, typeConfig, name),
137
+ kind: _chunkN5ZE2Z6Ijs.linkKindFor.call(void 0, typeConfig, name),
120
138
  props: {}
121
139
  });
122
140
  }
@@ -124,13 +142,13 @@ async function updateLinks(store, typeConfig, record, before, after) {
124
142
  }
125
143
  _chunk7QVYU63Ejs.__name.call(void 0, updateLinks, "updateLinks");
126
144
  async function storeResource(store, resource, pathRootId, waiting, kept, primary, images) {
127
- const config = _chunkMHB36MYEjs.getOfflineConfig.call(void 0, );
145
+ const config = _chunkWUNSG3INjs.getOfflineConfig.call(void 0, );
128
146
  if (!_optionalChain([resource, 'optionalAccess', _7 => _7.type]) || !_optionalChain([resource, 'optionalAccess', _8 => _8.id])) return;
129
147
  if (!config.types.some((typeConfig) => typeConfig.module.name === resource.type)) return;
130
148
  if (waiting.has(recordKeyOf(resource.type, resource.id))) return;
131
149
  const existing = await store.getRecord(resource.type, resource.id);
132
150
  if (existing && existing.base !== null) return;
133
- const rootId = await _asyncNullishCoalesce(await _asyncNullishCoalesce(await _asyncOptionalChain([existing, 'optionalAccess', async _9 => _9.rootId]), async () => ( await _chunkW62MHDWMjs.rootIdForResource.call(void 0, store, config, resource))), async () => ( pathRootId));
151
+ const rootId = await _asyncNullishCoalesce(await _asyncNullishCoalesce(await _asyncOptionalChain([existing, 'optionalAccess', async _9 => _9.rootId]), async () => ( await _chunkN5ZE2Z6Ijs.rootIdForResource.call(void 0, store, config, resource))), async () => ( pathRootId));
134
152
  if (!rootId) return;
135
153
  if (!kept.has(rootId)) return;
136
154
  const before = _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _10 => _10.resource]), () => ( {}));
@@ -153,8 +171,8 @@ async function storeResource(store, resource, pathRootId, waiting, kept, primary
153
171
  const typeConfig = config.types.find((candidate) => candidate.module.name === resource.type);
154
172
  await updateLinks(store, typeConfig, resource, before.relationships, resource.relationships);
155
173
  }
156
- const url = _chunkPXDUJ47Njs.imageUrlOf.call(void 0, merged);
157
- const previousUrl = _chunkPXDUJ47Njs.imageUrlOf.call(void 0, _optionalChain([existing, 'optionalAccess', _12 => _12.resource]));
174
+ const url = _chunk6RCZ64BQjs.imageUrlOf.call(void 0, merged);
175
+ const previousUrl = _chunk6RCZ64BQjs.imageUrlOf.call(void 0, _optionalChain([existing, 'optionalAccess', _12 => _12.resource]));
158
176
  if (url && url !== previousUrl) images.push({ url, previousUrl });
159
177
  }
160
178
  _chunk7QVYU63Ejs.__name.call(void 0, storeResource, "storeResource");
@@ -162,13 +180,13 @@ async function writeThrough(request, response) {
162
180
  const method = request.method.toUpperCase();
163
181
  if (method === "GET" || !response.ok) return;
164
182
  try {
165
- const config = _chunkMHB36MYEjs.getOfflineConfig.call(void 0, );
183
+ const config = _chunkWUNSG3INjs.getOfflineConfig.call(void 0, );
166
184
  if (!config.getUserId()) return;
167
- const { path } = _chunkW62MHDWMjs.splitApiUrl.call(void 0, request.url);
168
- const store = await _chunkMHB36MYEjs.getOfflineStore.call(void 0, );
185
+ const { path } = _chunkN5ZE2Z6Ijs.splitApiUrl.call(void 0, request.url);
186
+ const store = await _chunkWUNSG3INjs.getOfflineStore.call(void 0, );
169
187
  if (method === "DELETE") {
170
188
  for (const typeConfig of config.types) {
171
- const params = _chunkW62MHDWMjs.matchPattern.call(void 0, [typeConfig.module, ":id"], path);
189
+ const params = _chunkN5ZE2Z6Ijs.matchPattern.call(void 0, [typeConfig.module, ":id"], path);
172
190
  if (params) {
173
191
  await store.deleteRecord(typeConfig.module.name, params.id);
174
192
  return;
@@ -176,8 +194,8 @@ async function writeThrough(request, response) {
176
194
  }
177
195
  return;
178
196
  }
179
- const rootParams = _chunkW62MHDWMjs.matchPattern.call(void 0, [config.rootModule, ":rootId"], path.split("/").slice(0, 2).join("/"));
180
- const pathRootId = _optionalChain([rootParams, 'optionalAccess', _13 => _13.rootId]);
197
+ const rootSegments = path.split("/").slice(0, 2).join("/");
198
+ const pathRootId = _chunkWUNSG3INjs.rootKinds.call(void 0, config).map((kind) => _optionalChain([_chunkN5ZE2Z6Ijs.matchPattern.call(void 0, [kind.module, ":rootId"], rootSegments), 'optionalAccess', _13 => _13.rootId])).find((rootId) => rootId !== void 0);
181
199
  const document = response.data;
182
200
  const primary = Array.isArray(_optionalChain([document, 'optionalAccess', _14 => _14.data])) ? document.data : _optionalChain([document, 'optionalAccess', _15 => _15.data]) ? [document.data] : [];
183
201
  const waiting = waitingRecordKeys(
@@ -194,9 +212,9 @@ async function writeThrough(request, response) {
194
212
  await storeResource(transactionStore, resource, pathRootId, waiting, kept, false, images);
195
213
  }
196
214
  });
197
- for (const image of images) await _chunkPXDUJ47Njs.cacheArtworkImage.call(void 0, image.url, image.previousUrl);
215
+ for (const image of images) await _chunk6RCZ64BQjs.cacheArtworkImage.call(void 0, image.url, image.previousUrl);
198
216
  } catch (error) {
199
- if (error instanceof _chunkMHB36MYEjs.OfflineUnavailableError) return;
217
+ if (error instanceof _chunkWUNSG3INjs.OfflineUnavailableError) return;
200
218
  console.warn("[offline] could not copy the answer to the device", error);
201
219
  }
202
220
  }
@@ -210,5 +228,6 @@ _chunk7QVYU63Ejs.__name.call(void 0, writeThrough, "writeThrough");
210
228
 
211
229
 
212
230
 
213
- exports.rememberSyncRoots = rememberSyncRoots; exports.knownRootIds = knownRootIds; exports.refreshLockedRoots = refreshLockedRoots; exports.recordKeyOf = recordKeyOf; exports.recordKeysOfEntry = recordKeysOfEntry; exports.waitingRecordKeys = waitingRecordKeys; exports.writeThrough = writeThrough;
214
- //# sourceMappingURL=chunk-B6JGKDP2.js.map
231
+
232
+ exports.rememberSyncRoots = rememberSyncRoots; exports.knownRootIds = knownRootIds; exports.knownPrimaryRootIds = knownPrimaryRootIds; exports.refreshLockedRoots = refreshLockedRoots; exports.recordKeyOf = recordKeyOf; exports.recordKeysOfEntry = recordKeysOfEntry; exports.waitingRecordKeys = waitingRecordKeys; exports.writeThrough = writeThrough;
233
+ //# sourceMappingURL=chunk-QGVVF77L.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/nextjs-jsonapi/nextjs-jsonapi/dist/chunk-QGVVF77L.js","../src/offline/sync/known-roots.ts","../src/offline/sync/waiting.ts","../src/offline/write-through.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACF,sDAA4B;AAC5B;AACE;AACA;AACA;AACA;AACA;AACA;AACF,sDAA4B;AAC5B;AACE;AACA;AACA;AACA;AACA;AACF,sDAA4B;AAC5B;AACE;AACF,sDAA4B;AAC5B;AACA;ACnBA,IAAI,eAAA,EAA2B,CAAC,CAAA;AAChC,IAAI,oBAAA,EAAgC,CAAC,CAAA;AAM9B,SAAS,iBAAA,CAAkB,GAAA,EAAe,SAAA,EAAqB,CAAC,CAAA,EAAS;AAC9E,EAAA,eAAA,EAAiB,CAAC,GAAG,GAAG,CAAA;AACxB,EAAA,oBAAA,EAAsB,CAAC,GAAG,QAAQ,CAAA;AACpC;AAHgB,qCAAA,iBAAA,EAAA,mBAAA,CAAA;AAUhB,MAAA,SAAsB,YAAA,CAAa,KAAA,EAAuC;AACxE,EAAA,MAAM,OAAA,EAAS,+CAAA,CAAi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AA;AAEgC,IAAA;AACjC,IAAA;AACf,EAAA;AACF;AApDsB;AHkFkC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/nextjs-jsonapi/nextjs-jsonapi/dist/chunk-QGVVF77L.js","sourcesContent":[null,"import { getOfflineConfig, getOfflineStore, rootKinds } from \"../config\";\nimport { setOfflineState } from \"../state\";\nimport type { DeviceStore } from \"../store/DeviceStore\";\nimport { isRootLocked } from \"../store/lifecycle\";\n\nlet _lastSyncRoots: string[] = [];\nlet _lastExtraSyncRoots: string[] = [];\n\n/**\n * Remembers the root records the last online sync listed: `ids` of every kind, `extraIds` those\n * of the `extraRootKinds` among them.\n */\nexport function rememberSyncRoots(ids: string[], extraIds: string[] = []): void {\n _lastSyncRoots = [...ids];\n _lastExtraSyncRoots = [...extraIds];\n}\n\n/**\n * Every root record the device knows of, of every kind: its stored root records, the root records\n * with waiting changes, and the last sync roots (a locked root record is never downloaded, so it\n * may have no stored record).\n */\nexport async function knownRootIds(store: DeviceStore): Promise<string[]> {\n const config = getOfflineConfig();\n const ids = new Set<string>(_lastSyncRoots);\n for (const kind of rootKinds(config)) {\n for (const record of await store.listRecords({ type: kind.module.name })) ids.add(record.id);\n }\n for (const entry of await store.queue()) ids.add(entry.rootId);\n return [...ids].sort();\n}\n\n/** The known root records of the `extraRootKinds`: stored, or listed by the last sync. */\nasync function extraRootIds(store: DeviceStore): Promise<Set<string>> {\n const ids = new Set<string>(_lastExtraSyncRoots);\n for (const kind of getOfflineConfig().extraRootKinds ?? []) {\n for (const record of await store.listRecords({ type: kind.module.name })) ids.add(record.id);\n }\n return ids;\n}\n\n/** `knownRootIds` without the root records of the `extraRootKinds` (the primary kind only). */\nexport async function knownPrimaryRootIds(store: DeviceStore): Promise<string[]> {\n const extra = await extraRootIds(store);\n return (await knownRootIds(store)).filter((id) => !extra.has(id));\n}\n\n/** Recomputes `lockedRootIds` from the stored sync states, now. */\nexport async function refreshLockedRoots(): Promise<void> {\n const config = getOfflineConfig();\n if (!config.getUserId()) return;\n const store = await getOfflineStore();\n const now = new Date();\n const locked: string[] = [];\n for (const id of await knownRootIds(store)) {\n if (isRootLocked(await store.getSyncState(id), now)) locked.push(id);\n }\n setOfflineState({ lockedRootIds: locked });\n}\n","import type { QueueEntry } from \"../store/DeviceStore\";\n\nexport const recordKeyOf = (type: string, id: string) => `${type}:${id}`;\n\n/**\n * The records a queue entry targets: its `recordType`/`recordId`, the `data.type`/`data.id` of\n * its body (a record created on this device), and the `<type>/<id>` of its path (the last\n * segment naming a synced type, when an id follows it: `npcs/n1`, `npcs/n1/merge`; a collection\n * path such as `roots/C/npcs` targets no record).\n */\nexport function recordKeysOfEntry(entry: QueueEntry, typeNames: Set<string>): string[] {\n const keys: string[] = [];\n if (entry.recordType && entry.recordId) keys.push(recordKeyOf(entry.recordType, entry.recordId));\n\n const data = entry.body?.data;\n if (data && !Array.isArray(data) && typeof data.type === \"string\" && typeof data.id === \"string\") {\n keys.push(recordKeyOf(data.type, data.id));\n }\n\n const segments = String(entry.path ?? \"\")\n .split(\"?\")[0]\n .split(\"/\")\n .filter(Boolean);\n for (let index = segments.length - 1; index >= 0; index--) {\n if (!typeNames.has(segments[index])) continue;\n if (index + 1 < segments.length) keys.push(recordKeyOf(segments[index], segments[index + 1]));\n break;\n }\n return keys;\n}\n\n/**\n * Every record with a waiting change: targeted by a queue entry that is pending, sending, in\n * conflict or failed. Such a record is never overwritten or deleted by a sync or a write-through.\n */\nexport function waitingRecordKeys(queue: QueueEntry[], typeNames: Set<string>): Set<string> {\n const keys = new Set<string>();\n for (const entry of queue) for (const key of recordKeysOfEntry(entry, typeNames)) keys.add(key);\n return keys;\n}\n","import type { ApiData } from \"../core/interfaces/ApiData\";\nimport { getOfflineConfig, getOfflineStore, OfflineUnavailableError, rootKinds } from \"./config\";\nimport { rootIdForResource, linkKindFor, linkKindsOf, linksOfKind } from \"./generic-answers\";\nimport { splitApiUrl } from \"./local-transport\";\nimport { matchPattern } from \"./router\";\nimport type { DeviceStore, StoredLink } from \"./store/DeviceStore\";\nimport type { OfflineTypeConfig } from \"./types\";\nimport { cacheArtworkImage, imageUrlOf } from \"./sync/artwork-cache\";\nimport { knownRootIds } from \"./sync/known-roots\";\nimport { recordKeyOf, waitingRecordKeys } from \"./sync/waiting\";\n\nexport type WriteThroughRequest = { method: string; url: string };\n\nfunction updatedAtOf(resource: any): Date | null {\n const value = resource?.attributes?.updatedAt;\n if (!value) return null;\n const date = new Date(value);\n return Number.isNaN(date.getTime()) ? null : date;\n}\n\ntype Identifier = { type: string; id: string };\n\nfunction identifiersOf(relationship: any): Identifier[] {\n const data = relationship?.data;\n if (!data) return [];\n return (Array.isArray(data) ? data : [data]).filter((item: any) => item && item.type && item.id);\n}\n\n/**\n * Brings the stored links of the written record in line with the relationships the answer\n * carries (only those whose `data` it holds), as the local answers do: a link of the\n * relationship (its name or mapped Neo4j type; any kind when the type is not mapped, for an\n * identifier the record held before) to an identifier no longer there is removed, and a new\n * identifier gets a link of `linkKindFor` the relationship.\n */\nasync function updateLinks(\n store: DeviceStore,\n typeConfig: OfflineTypeConfig | undefined,\n record: Identifier,\n before: any,\n after: any,\n): Promise<void> {\n const otherEnd = (link: StoredLink) => (link.fromId === record.id ? link.toId : link.fromId);\n const allLinks = async (): Promise<StoredLink[]> => [\n ...(await store.linksFrom(record.id)),\n ...(await store.linksTo(record.id)),\n ];\n\n for (const [name, relationship] of Object.entries<any>(after ?? {})) {\n if (!relationship || !(\"data\" in relationship)) continue;\n const next = new Map(identifiersOf(relationship).map((identifier) => [identifier.id, identifier]));\n const previous = new Set(identifiersOf(before?.[name]).map((identifier) => identifier.id));\n const kinds = linkKindsOf(typeConfig, name) ?? [name];\n const ofRelationship = await linksOfKind(store, record.id, kinds, \"both\");\n const mapped = linkKindsOf(typeConfig, name) !== undefined;\n\n const stale = [\n ...ofRelationship.filter((link) => !next.has(otherEnd(link))),\n // Unmapped: the link to an identifier the record held before may carry any kind.\n ...(mapped ? [] : (await allLinks()).filter((link) => previous.has(otherEnd(link)) && !next.has(otherEnd(link)))),\n ];\n for (const link of stale) await store.deleteLink({ fromId: link.fromId, toId: link.toId, kind: link.kind });\n\n const linked = new Set(\n (mapped ? await linksOfKind(store, record.id, kinds, \"both\") : await allLinks()).map(otherEnd),\n );\n for (const [id, identifier] of next) {\n if (linked.has(id)) continue;\n await store.putLink({\n fromType: record.type,\n fromId: record.id,\n toType: identifier.type,\n toId: id,\n kind: linkKindFor(typeConfig, name),\n props: {},\n });\n }\n }\n}\n\ntype ImageChange = { url: string; previousUrl?: string };\n\nasync function storeResource(\n store: DeviceStore,\n resource: any,\n pathRootId: string | undefined,\n waiting: Set<string>,\n kept: Set<string>,\n primary: boolean,\n images: ImageChange[],\n): Promise<void> {\n const config = getOfflineConfig();\n if (!resource?.type || !resource?.id) return;\n if (!config.types.some((typeConfig) => typeConfig.module.name === resource.type)) return;\n // A record with unsent local changes keeps them: the next sync, once they are sent, brings\n // the server's version.\n if (waiting.has(recordKeyOf(resource.type, resource.id))) return;\n\n const existing = await store.getRecord(resource.type, resource.id);\n if (existing && existing.base !== null) return;\n const rootId = existing?.rootId ?? (await rootIdForResource(store, config, resource)) ?? pathRootId;\n // A record that belongs to no root record on this device waits for the next sync.\n if (!rootId) return;\n // Only the root records the device keeps are written through (never a player's root record).\n if (!kept.has(rootId)) return;\n\n // An answer can carry a sparse resource (fields limited): it is merged onto what is stored.\n const before = existing?.resource ?? {};\n const merged = {\n ...before,\n ...resource,\n attributes: { ...(before.attributes ?? {}), ...(resource.attributes ?? {}) },\n relationships: { ...(before.relationships ?? {}), ...(resource.relationships ?? {}) },\n };\n\n await store.putRecord({\n type: resource.type,\n id: resource.id,\n rootId,\n resource: merged,\n updatedAt: updatedAtOf(resource) ?? existing?.updatedAt ?? null,\n base: null,\n localOnly: false,\n });\n if (primary) {\n const typeConfig = config.types.find((candidate) => candidate.module.name === resource.type);\n await updateLinks(store, typeConfig, resource, before.relationships, resource.relationships);\n }\n\n const url = imageUrlOf(merged);\n const previousUrl = imageUrlOf(existing?.resource);\n if (url && url !== previousUrl) images.push({ url, previousUrl });\n}\n\n/**\n * After a successful online write, copies the answer into the device copy so it is never behind\n * the GM's own work: the resource and its `included` for POST/PUT/PATCH, the record removed for a\n * DELETE. It never fails the request: a problem is logged and the next sync repairs the copy.\n */\nexport async function writeThrough(request: WriteThroughRequest, response: ApiData): Promise<void> {\n const method = request.method.toUpperCase();\n if (method === \"GET\" || !response.ok) return;\n\n try {\n const config = getOfflineConfig();\n if (!config.getUserId()) return;\n const { path } = splitApiUrl(request.url);\n const store = await getOfflineStore();\n\n if (method === \"DELETE\") {\n for (const typeConfig of config.types) {\n const params = matchPattern([typeConfig.module, \":id\"], path);\n if (params) {\n await store.deleteRecord(typeConfig.module.name, params.id);\n return;\n }\n }\n return;\n }\n\n // A path under a root record of any kind (`<root module>/:rootId/...`).\n const rootSegments = path.split(\"/\").slice(0, 2).join(\"/\");\n const pathRootId = rootKinds(config)\n .map((kind) => matchPattern([kind.module, \":rootId\"], rootSegments)?.rootId)\n .find((rootId) => rootId !== undefined);\n\n const document = response.data;\n const primary = Array.isArray(document?.data) ? document.data : document?.data ? [document.data] : [];\n const waiting = waitingRecordKeys(\n await store.queue(),\n new Set(config.types.map((typeConfig) => typeConfig.module.name)),\n );\n // The root records this device keeps for the signed-in user (stored roots, waiting changes, last\n // sync roots): a write in any other root record (a player's) stores nothing.\n const kept = new Set(await knownRootIds(store));\n const images: ImageChange[] = [];\n await store.transaction(async (transactionStore) => {\n for (const resource of primary) {\n await storeResource(transactionStore, resource, pathRootId, waiting, kept, true, images);\n }\n for (const resource of document?.included ?? []) {\n await storeResource(transactionStore, resource, pathRootId, waiting, kept, false, images);\n }\n });\n // A new image URL of an artwork: downloaded, the old cached image removed (as the sync does).\n for (const image of images) await cacheArtworkImage(image.url, image.previousUrl);\n } catch (error) {\n // A browser that cannot keep the device copy was already warned about once.\n if (error instanceof OfflineUnavailableError) return;\n console.warn(\"[offline] could not copy the answer to the device\", error);\n }\n}\n"]}
@@ -8,7 +8,7 @@ import {
8
8
  ENV,
9
9
  JsonApiDataFactory,
10
10
  translateResponse
11
- } from "./chunk-DGWOVYEC.mjs";
11
+ } from "./chunk-MQ7TXALH.mjs";
12
12
  import {
13
13
  __name
14
14
  } from "./chunk-PAWJFY3S.mjs";
@@ -201,4 +201,4 @@ export {
201
201
  ServerJsonApiPatch,
202
202
  ServerJsonApiDelete
203
203
  };
204
- //# sourceMappingURL=chunk-BH6JWIKI.mjs.map
204
+ //# sourceMappingURL=chunk-QIEF7HIL.mjs.map
@@ -8,20 +8,20 @@ import {
8
8
  getI18nDefaultLocale,
9
9
  getI18nServerLocale,
10
10
  getI18nSupportedLocales
11
- } from "./chunk-6JUCIWDC.mjs";
11
+ } from "./chunk-UOTHRJD2.mjs";
12
12
  import {
13
13
  ClientJsonApiDelete,
14
14
  ClientJsonApiGet,
15
15
  ClientJsonApiPatch,
16
16
  ClientJsonApiPost,
17
17
  ClientJsonApiPut
18
- } from "./chunk-DOCIFE6A.mjs";
18
+ } from "./chunk-AUD6ZLBB.mjs";
19
19
  import {
20
20
  DataClassRegistry,
21
21
  JsonApiDelete,
22
22
  JsonApiGet,
23
23
  JsonApiPost
24
- } from "./chunk-DGWOVYEC.mjs";
24
+ } from "./chunk-MQ7TXALH.mjs";
25
25
  import {
26
26
  __name
27
27
  } from "./chunk-PAWJFY3S.mjs";
@@ -119,7 +119,7 @@ var AbstractService = class {
119
119
  * Make an API call with automatic environment detection and error handling.
120
120
  */
121
121
  static async callApi(params) {
122
- const { JsonApiGet: JsonApiGet2, JsonApiPost: JsonApiPost2, JsonApiPut, JsonApiPatch, JsonApiDelete: JsonApiDelete2 } = await import("./JsonApiRequest-F6TMJ42G.mjs");
122
+ const { JsonApiGet: JsonApiGet2, JsonApiPost: JsonApiPost2, JsonApiPut, JsonApiPatch, JsonApiDelete: JsonApiDelete2 } = await import("./JsonApiRequest-IKKHWCPB.mjs");
123
123
  let apiResponse;
124
124
  let language = "en";
125
125
  if (typeof window === "undefined") {
@@ -216,7 +216,7 @@ var AbstractService = class {
216
216
  * Make an API call and return both data and meta from the response.
217
217
  */
218
218
  static async callApiWithMeta(params) {
219
- const { JsonApiGet: JsonApiGet2, JsonApiPost: JsonApiPost2, JsonApiPut, JsonApiPatch, JsonApiDelete: JsonApiDelete2 } = await import("./JsonApiRequest-F6TMJ42G.mjs");
219
+ const { JsonApiGet: JsonApiGet2, JsonApiPost: JsonApiPost2, JsonApiPut, JsonApiPatch, JsonApiDelete: JsonApiDelete2 } = await import("./JsonApiRequest-IKKHWCPB.mjs");
220
220
  let apiResponse;
221
221
  let language = "en";
222
222
  if (typeof window === "undefined") {
@@ -301,7 +301,7 @@ var AbstractService = class {
301
301
  * Get raw JSON:API response data without deserialization.
302
302
  */
303
303
  static async getRawData(params) {
304
- const { JsonApiGet: JsonApiGet2 } = await import("./JsonApiRequest-F6TMJ42G.mjs");
304
+ const { JsonApiGet: JsonApiGet2 } = await import("./JsonApiRequest-IKKHWCPB.mjs");
305
305
  let language = "en";
306
306
  if (typeof window === "undefined") {
307
307
  language = await getI18nServerLocale();
@@ -12636,4 +12636,4 @@ export {
12636
12636
  AuditLogService,
12637
12637
  AuditLogModule
12638
12638
  };
12639
- //# sourceMappingURL=chunk-P445QGOC.mjs.map
12639
+ //# sourceMappingURL=chunk-RFKSJIQB.mjs.map