mnfst 0.5.253 → 0.5.255

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  (function () {
4
4
 
5
- const MANIFEST_BUILD_VERSION = '0.5.253';
5
+ const MANIFEST_BUILD_VERSION = '0.5.255';
6
6
 
7
7
  /* Manifest Data Sources - Appwrite Integration */
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  (function () {
4
4
 
5
- const MANIFEST_BUILD_VERSION = '0.5.253';
5
+ const MANIFEST_BUILD_VERSION = '0.5.255';
6
6
 
7
7
  /* Manifest Data Sources - Configuration */
8
8
 
@@ -15,6 +15,11 @@ function manifestNativePlugin(name) {
15
15
  const cap = window.Capacitor;
16
16
  return (cap && cap.Plugins && cap.Plugins[name]) || null;
17
17
  }
18
+ // Whether a plugin is in the native header list (no list: assume installed)
19
+ function manifestNativeInstalled(name) {
20
+ const headers = window.Capacitor && window.Capacitor.PluginHeaders;
21
+ return !Array.isArray(headers) || headers.some(h => h && h.name === name);
22
+ }
18
23
  // Whether a plugin exposes a native method. Bundled apps get a registerPlugin
19
24
  // Proxy where every property is a function, so prefer the native header; a
20
25
  // header list without this plugin means it isn't installed natively.
@@ -158,6 +163,7 @@ function initManifestNativeNetwork() {
158
163
  // namespaced localStorage fallback on the web. Intended for session tokens etc.
159
164
  // Native: a plugin registered as SecureStorage (@aparajita/capacitor-secure-storage,
160
165
  // or any getItem/setItem or get/set shape); $secure.use(adapter) overrides.
166
+ // Native without a plugin rejects; never localStorage.
161
167
  // The web fallback is NOT encrypted — it degrades honestly, not securely.
162
168
 
163
169
  const MANIFEST_SECURE_NS = 'mnfst:';
@@ -228,12 +234,32 @@ function manifestSecureNativeBackend(plugin, name) {
228
234
  };
229
235
  }
230
236
 
237
+ const MANIFEST_SECURE_NONE = 'No secure-storage plugin is installed; install @aparajita/capacitor-secure-storage and run npx cap sync, or provide one with $secure.use(adapter)';
238
+ const MANIFEST_SECURE_UNSYNCED = 'SecureStorage plugin is not installed natively; run npx cap sync';
239
+
240
+ // Rejects every call, logs once; never falls back to unencrypted web storage
241
+ let _manifestSecureMissingLogged = false;
242
+ function manifestSecureMissingBackend(msg) {
243
+ const fail = (op) => async () => {
244
+ const e = new Error(msg);
245
+ if (!_manifestSecureMissingLogged) {
246
+ _manifestSecureMissingLogged = true;
247
+ try { console.error('[Manifest] $secure.' + op + ' failed', e); } catch (_) {}
248
+ }
249
+ throw e;
250
+ };
251
+ return { get: fail('get'), set: fail('set'), remove: fail('remove'), keys: fail('keys'), clear: fail('clear') };
252
+ }
253
+
254
+ // Missing backends aren't cached, so a later-registered plugin is picked up
231
255
  let _manifestSecureBackend = null;
232
256
  function manifestSecureBackend() {
233
257
  if (_manifestSecureBackend) return _manifestSecureBackend;
234
- const plugin = manifestNativeIsNative() ? manifestNativePlugin('SecureStorage') : null;
235
- _manifestSecureBackend = plugin ? manifestSecureNativeBackend(plugin, 'SecureStorage') : manifestSecureWebBackend();
236
- return _manifestSecureBackend;
258
+ if (!manifestNativeIsNative()) return (_manifestSecureBackend = manifestSecureWebBackend());
259
+ const plugin = manifestNativePlugin('SecureStorage');
260
+ if (!plugin) return manifestSecureMissingBackend(MANIFEST_SECURE_NONE);
261
+ if (!manifestNativeInstalled('SecureStorage')) return manifestSecureMissingBackend(MANIFEST_SECURE_UNSYNCED);
262
+ return (_manifestSecureBackend = manifestSecureNativeBackend(plugin, 'SecureStorage'));
237
263
  }
238
264
 
239
265
  function initManifestSecure() {
@@ -456,6 +482,7 @@ function manifestBiometricPlugin() {
456
482
  const plugin = manifestNativePlugin(name);
457
483
  if (plugin && headers.some(h => h && h.name === name)) return { name, plugin };
458
484
  }
485
+ manifestBiometricWarnNotNative();
459
486
  return null;
460
487
  }
461
488
  for (const name of MANIFEST_BIOMETRIC_PLUGINS) {
@@ -469,6 +496,16 @@ function manifestBiometricWarn(msg, e) {
469
496
  try { console.warn('[Manifest] $biometric: ' + msg, e || ''); } catch (_) {}
470
497
  }
471
498
 
499
+ // Registered in JS but missing from the native build: warn once
500
+ let manifestBiometricNotNativeWarned = false;
501
+ function manifestBiometricWarnNotNative() {
502
+ if (manifestBiometricNotNativeWarned) return;
503
+ const missing = MANIFEST_BIOMETRIC_PLUGINS.filter(n => manifestNativePlugin(n));
504
+ if (!missing.length) return;
505
+ manifestBiometricNotNativeWarned = true;
506
+ manifestBiometricWarn(missing.join(', ') + ' registered but not installed natively; run npx cap sync');
507
+ }
508
+
472
509
  async function manifestBiometricAvailable() {
473
510
  const found = manifestBiometricPlugin();
474
511
  if (!found) return false;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest.appwrite.auth.js": "sha384-dsIWnH0qCAGSzAXMGrd8fvOrVl4tOIE6j5tC35JPTrQXZ56qLD36ARyvhR7vi3Id",
3
- "manifest.appwrite.data.js": "sha384-xxVLbIAAzMs+ksXTzRGtu0GxALohKKkFRXsvLyp6BvZesTk/JsS0lscvkIcOyGO1",
3
+ "manifest.appwrite.data.js": "sha384-yrebKnrOCvLdXPLHxIVM+y6rKpj9Wz9Jj3m+vhiRm9t8WHxZ4a2I82Qm6dS4wEbd",
4
4
  "manifest.appwrite.presences.js": "sha384-JyVDWFT69b7Svq8J8p9tNWe2v9PZNQBY5UyhtOl1vnuHFAX0CRQ3MA9SiKq5wzNh",
5
5
  "manifest.bindings.js": "sha384-lPtMf8Ykaic9gNVZKq8Scia1881ZeMAyxer3WCIkUNwwrgzGBWto1OXADUwjvORF",
6
6
  "manifest.charts.js": "sha384-G+huD7UvjF9zDovdVVlh4I5X1Mq4oNnJfoFg4NnGdP3R/4Skq9hy5cGuHNYLxDYm",
@@ -11,24 +11,24 @@
11
11
  "manifest.combobox.js": "sha384-MILTkrgsTzsYUjGo4ZuADqV85Xs4GmfB4xexfe9vbJMIoQTZ42W4zs+DTaVSPEsx",
12
12
  "manifest.components.js": "sha384-BUFA8h+G5Plr82sV7bKzO42pPoiRZwRQcKj1lt2ROFiKjjlkayU/vmkAFqEsdBA+",
13
13
  "manifest.computed.js": "sha384-GYML/e81gQfN+iDbqhPUgny8bINCyL+SrbTofoGk4hlCnLLjv51mCv42JMqq+ku5",
14
- "manifest.data.js": "sha384-apX4l/k05t8snFyKYLbMbN+kG6xjHHI8gbs32376S3WruzynLOaF+uq43cCGfifp",
14
+ "manifest.data.js": "sha384-5nHLnVnm5kj2/Z3chAJ2bAwuNsfzJ8O3qtI7ctAQE7v0CW0rl3q4IwFVQ7btoSoT",
15
15
  "manifest.datepicker.js": "sha384-2XwFFnS4Bg5FDvG/v8x6KUvrjcBQEOYyTxynX2K/D/Qb3PI6+Y04lEwCnVDJLzwL",
16
16
  "manifest.defer.js": "sha384-GK9qJkYtchtyzSQ+3zmDQUJE3+au4qthT2M8JnFjXxgfwCH5IVKc2r3tackgMryU",
17
- "manifest.device.js": "sha384-jY+Xjt/v4I7SWTFzIGdPRJRTl634i6pj5T6jQaEn9keNTccPGD9lAIbYWq4J8oc7",
17
+ "manifest.device.js": "sha384-AWismZl/UjR/NqH7z4Sfg0DZLPpySDuS0tL34ZsbHdNYDD14JzBW9xp/ScmQKilQ",
18
18
  "manifest.dropdowns.js": "sha384-acufUps7R9WjqB4XXW5JLACqniuHJGM4CNTb2rF4B2Q/jv7ZRmsAwfr2McanOz3s",
19
19
  "manifest.edit.js": "sha384-MOgQNdNLeHijhR0u2W6ntoOulKFglsATCFDqkinesOU15tHoILk/JNzHKkGi5dUG",
20
20
  "manifest.export.js": "sha384-Rx6XvqBZc4apzP/FwcDr6yIln4/zNa08Q4ZqBZcEqUz1aNZQfl4h0+Ae7mqCQyuG",
21
21
  "manifest.icons.js": "sha384-kKOINpX70YzNO3FvkV6umrmO3f0KIu0DNbwB+ej55a7y/lhU7v/myQtXL0bwCTbt",
22
22
  "manifest.localization.js": "sha384-EImsIw8Z3l13V5eH9ZJF/yfsOfIvR1oPRNSArANkPji7V8O3IRf6zMwsNiAGj3Hk",
23
23
  "manifest.markdown.js": "sha384-heyDR40LXHaAmAuA+fa381uFwShk1oAqpFFY6E2Qq4T3VN0TQfRqyc++MF40K5Hj",
24
- "manifest.native.js": "sha384-jY+Xjt/v4I7SWTFzIGdPRJRTl634i6pj5T6jQaEn9keNTccPGD9lAIbYWq4J8oc7",
24
+ "manifest.native.js": "sha384-AWismZl/UjR/NqH7z4Sfg0DZLPpySDuS0tL34ZsbHdNYDD14JzBW9xp/ScmQKilQ",
25
25
  "manifest.payments.js": "sha384-8pofk2zhxtapPMpwnFyTelPMrYhShNhDCE722uQh/EYFvZFuPLmSdgunqsarVQjv",
26
26
  "manifest.rich.text.js": "sha384-ZBV9jXmu2nmprEHicddRE/m7nR4RPZtVc969Jte0+EJYBcVph7itkjcgN/61PyeC",
27
27
  "manifest.router.js": "sha384-9LMIkwrgnxmmFDv70TND2MRJF1z6Nl4yqG7fH5DbJ8oUIhdu/u4yUPSime1/EYhP",
28
28
  "manifest.slides.js": "sha384-3uRTkyK9XPLmnxI2+igZlpi4EyPlU/7IHj5j3BZJJ2KN455vXyk99fiXV3feO/XY",
29
29
  "manifest.status.js": "sha384-MBO345ab7H6Uq1X2dZLt4Ge1Gcra+Z2qYApvlAeIV8CJhDDJrz2FPXpp+Kcp8zcM",
30
30
  "manifest.svg.js": "sha384-qr/8H9+2cIhSXNbRWRtIdrDlTOxKlNJqwEefHvCYoiBNW/kKhPTFa109Orv/EBnb",
31
- "manifest.sw.js": "sha384-9Kcczuh7GSCImjjTu09aZ0C/EaVHItZ0McwTdNqv1ZCWZe0UfUn9+IYX3ISYE0kk",
31
+ "manifest.sw.js": "sha384-IqZgkKzUzqXEsiCpqYTUCm3ETLkB8eAVkEN8vMnHXTXxmMLvKk7cwixxZ9WkUzP2",
32
32
  "manifest.tabs.js": "sha384-otU09H7jnawVKQdLAYpMCd3jx00tgyPVr42D2hLIBzN5dG4se505YesavdnMqEi1",
33
33
  "manifest.tailwind.js": "sha384-r/Jvqb+Piz21jUts10BbVAJoKkShOdJRVFpywyi4HPIi/OfOJq5CtPyWAPbdkMgt",
34
34
  "manifest.toasts.js": "sha384-3zkWxzw693pxg3QDFsoYCA3CqYaLKmBaMArULXODD66Utolpewl0OAeTB92aWUVv",
@@ -15,6 +15,11 @@ function manifestNativePlugin(name) {
15
15
  const cap = window.Capacitor;
16
16
  return (cap && cap.Plugins && cap.Plugins[name]) || null;
17
17
  }
18
+ // Whether a plugin is in the native header list (no list: assume installed)
19
+ function manifestNativeInstalled(name) {
20
+ const headers = window.Capacitor && window.Capacitor.PluginHeaders;
21
+ return !Array.isArray(headers) || headers.some(h => h && h.name === name);
22
+ }
18
23
  // Whether a plugin exposes a native method. Bundled apps get a registerPlugin
19
24
  // Proxy where every property is a function, so prefer the native header; a
20
25
  // header list without this plugin means it isn't installed natively.
@@ -158,6 +163,7 @@ function initManifestNativeNetwork() {
158
163
  // namespaced localStorage fallback on the web. Intended for session tokens etc.
159
164
  // Native: a plugin registered as SecureStorage (@aparajita/capacitor-secure-storage,
160
165
  // or any getItem/setItem or get/set shape); $secure.use(adapter) overrides.
166
+ // Native without a plugin rejects; never localStorage.
161
167
  // The web fallback is NOT encrypted — it degrades honestly, not securely.
162
168
 
163
169
  const MANIFEST_SECURE_NS = 'mnfst:';
@@ -228,12 +234,32 @@ function manifestSecureNativeBackend(plugin, name) {
228
234
  };
229
235
  }
230
236
 
237
+ const MANIFEST_SECURE_NONE = 'No secure-storage plugin is installed; install @aparajita/capacitor-secure-storage and run npx cap sync, or provide one with $secure.use(adapter)';
238
+ const MANIFEST_SECURE_UNSYNCED = 'SecureStorage plugin is not installed natively; run npx cap sync';
239
+
240
+ // Rejects every call, logs once; never falls back to unencrypted web storage
241
+ let _manifestSecureMissingLogged = false;
242
+ function manifestSecureMissingBackend(msg) {
243
+ const fail = (op) => async () => {
244
+ const e = new Error(msg);
245
+ if (!_manifestSecureMissingLogged) {
246
+ _manifestSecureMissingLogged = true;
247
+ try { console.error('[Manifest] $secure.' + op + ' failed', e); } catch (_) {}
248
+ }
249
+ throw e;
250
+ };
251
+ return { get: fail('get'), set: fail('set'), remove: fail('remove'), keys: fail('keys'), clear: fail('clear') };
252
+ }
253
+
254
+ // Missing backends aren't cached, so a later-registered plugin is picked up
231
255
  let _manifestSecureBackend = null;
232
256
  function manifestSecureBackend() {
233
257
  if (_manifestSecureBackend) return _manifestSecureBackend;
234
- const plugin = manifestNativeIsNative() ? manifestNativePlugin('SecureStorage') : null;
235
- _manifestSecureBackend = plugin ? manifestSecureNativeBackend(plugin, 'SecureStorage') : manifestSecureWebBackend();
236
- return _manifestSecureBackend;
258
+ if (!manifestNativeIsNative()) return (_manifestSecureBackend = manifestSecureWebBackend());
259
+ const plugin = manifestNativePlugin('SecureStorage');
260
+ if (!plugin) return manifestSecureMissingBackend(MANIFEST_SECURE_NONE);
261
+ if (!manifestNativeInstalled('SecureStorage')) return manifestSecureMissingBackend(MANIFEST_SECURE_UNSYNCED);
262
+ return (_manifestSecureBackend = manifestSecureNativeBackend(plugin, 'SecureStorage'));
237
263
  }
238
264
 
239
265
  function initManifestSecure() {
@@ -456,6 +482,7 @@ function manifestBiometricPlugin() {
456
482
  const plugin = manifestNativePlugin(name);
457
483
  if (plugin && headers.some(h => h && h.name === name)) return { name, plugin };
458
484
  }
485
+ manifestBiometricWarnNotNative();
459
486
  return null;
460
487
  }
461
488
  for (const name of MANIFEST_BIOMETRIC_PLUGINS) {
@@ -469,6 +496,16 @@ function manifestBiometricWarn(msg, e) {
469
496
  try { console.warn('[Manifest] $biometric: ' + msg, e || ''); } catch (_) {}
470
497
  }
471
498
 
499
+ // Registered in JS but missing from the native build: warn once
500
+ let manifestBiometricNotNativeWarned = false;
501
+ function manifestBiometricWarnNotNative() {
502
+ if (manifestBiometricNotNativeWarned) return;
503
+ const missing = MANIFEST_BIOMETRIC_PLUGINS.filter(n => manifestNativePlugin(n));
504
+ if (!missing.length) return;
505
+ manifestBiometricNotNativeWarned = true;
506
+ manifestBiometricWarn(missing.join(', ') + ' registered but not installed natively; run npx cap sync');
507
+ }
508
+
472
509
  async function manifestBiometricAvailable() {
473
510
  const found = manifestBiometricPlugin();
474
511
  if (!found) return false;
@@ -16,7 +16,7 @@
16
16
 
17
17
  // Build stamps the published version here; unstamped (dev) falls back to the
18
18
  // registration URL's `v`, then 'dev'.
19
- const BUILD_VERSION = '0.5.253';
19
+ const BUILD_VERSION = '0.5.255';
20
20
  const CACHE_PREFIX = 'mnfst-sw:';
21
21
  const META_CACHE = CACHE_PREFIX + 'meta';
22
22
  // Sized to hold a full precache.json warm-up (PRECACHE_MAX_ENTRIES server-side)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mnfst",
3
- "version": "0.5.253",
3
+ "version": "0.5.255",
4
4
  "private": false,
5
5
  "workspaces": [
6
6
  "templates/starter",