@capgo/capacitor-updater 8.46.3 → 8.47.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.
package/dist/docs.json CHANGED
@@ -226,6 +226,37 @@
226
226
  ],
227
227
  "slug": "set"
228
228
  },
229
+ {
230
+ "name": "startPreviewSession",
231
+ "signature": "(options?: StartPreviewSessionOptions | undefined) => Promise<void>",
232
+ "parameters": [
233
+ {
234
+ "name": "options",
235
+ "docs": "Optional preview session options.",
236
+ "type": "StartPreviewSessionOptions | undefined"
237
+ }
238
+ ],
239
+ "returns": "Promise<void>",
240
+ "tags": [
241
+ {
242
+ "name": "param",
243
+ "text": "options Optional preview session options."
244
+ },
245
+ {
246
+ "name": "returns",
247
+ "text": "Resolves when preview session state is prepared."
248
+ },
249
+ {
250
+ "name": "since",
251
+ "text": "8.47.0"
252
+ }
253
+ ],
254
+ "docs": "Start a temporary preview/testing session.\n\nThis stores the currently active bundle as the pending fallback, enables the\nnative shake menu, and makes the next applied bundle show a native notice\nexplaining that shaking the device can reload or leave the preview.\nRequires {@link PluginsConfig.CapacitorUpdater.allowPreview} to be `true`.\nWhen `appId` is provided, the preview session temporarily uses that app id\nfor update checks until the user leaves the preview. Native updater stats are\nskipped while the preview session is active.\n\nUse this before calling {@link set} for Expo Go-style preview flows.",
255
+ "complexTypes": [
256
+ "StartPreviewSessionOptions"
257
+ ],
258
+ "slug": "startpreviewsession"
259
+ },
229
260
  {
230
261
  "name": "delete",
231
262
  "signature": "(options: BundleId) => Promise<void>",
@@ -523,6 +554,78 @@
523
554
  ],
524
555
  "slug": "getlatest"
525
556
  },
557
+ {
558
+ "name": "getMissingBundleFiles",
559
+ "signature": "(options: GetMissingBundleFilesOptions) => Promise<GetMissingBundleFilesResult>",
560
+ "parameters": [
561
+ {
562
+ "name": "options",
563
+ "docs": "A {@link GetMissingBundleFilesOptions} object, or a {@link LatestVersion} response containing `manifest`.",
564
+ "type": "GetMissingBundleFilesOptions"
565
+ }
566
+ ],
567
+ "returns": "Promise<GetMissingBundleFilesResult>",
568
+ "tags": [
569
+ {
570
+ "name": "param",
571
+ "text": "options A {@link GetMissingBundleFilesOptions} object, or a {@link LatestVersion} response containing `manifest`."
572
+ },
573
+ {
574
+ "name": "returns",
575
+ "text": "The manifest entries that require network download."
576
+ },
577
+ {
578
+ "name": "throws",
579
+ "text": "{Error} If the manifest is missing or invalid."
580
+ },
581
+ {
582
+ "name": "since",
583
+ "text": "8.47.0"
584
+ }
585
+ ],
586
+ "docs": "Return the manifest entries that still need to be downloaded for a partial update.\n\nPass the result from {@link getLatest} directly when it includes a `manifest`.\nThe native plugin compares each manifest entry with the files already available\nin the builtin bundle and the local delta cache. Entries that can be reused are\nomitted from the returned `missing` list.\n\nFor encrypted manifests, pass the `sessionKey` returned by {@link getLatest} so\nencrypted file hashes can be checked against local files.\n\n```typescript\nconst latest = await CapacitorUpdater.getLatest();\nconst missing = await CapacitorUpdater.getMissingBundleFiles(latest);\n```",
587
+ "complexTypes": [
588
+ "GetMissingBundleFilesResult",
589
+ "GetMissingBundleFilesOptions"
590
+ ],
591
+ "slug": "getmissingbundlefiles"
592
+ },
593
+ {
594
+ "name": "getBundleDownloadSize",
595
+ "signature": "(options: GetBundleDownloadSizeOptions) => Promise<GetBundleDownloadSizeResult>",
596
+ "parameters": [
597
+ {
598
+ "name": "options",
599
+ "docs": "A {@link GetBundleDownloadSizeOptions} object containing manifest entries.",
600
+ "type": "GetBundleDownloadSizeOptions"
601
+ }
602
+ ],
603
+ "returns": "Promise<GetBundleDownloadSizeResult>",
604
+ "tags": [
605
+ {
606
+ "name": "param",
607
+ "text": "options A {@link GetBundleDownloadSizeOptions} object containing manifest entries."
608
+ },
609
+ {
610
+ "name": "returns",
611
+ "text": "Known byte totals and per-file size results."
612
+ },
613
+ {
614
+ "name": "throws",
615
+ "text": "{Error} If the manifest is missing or invalid."
616
+ },
617
+ {
618
+ "name": "since",
619
+ "text": "8.47.0"
620
+ }
621
+ ],
622
+ "docs": "Estimate the download size for manifest entries before downloading them.\n\nThis method sends the provided manifest entries to the Capgo update endpoint\nonce and reads the stored manifest `file_size` metadata. It does not perform\nper-file `HEAD` requests from the app.\n\nUse this after {@link getMissingBundleFiles} to estimate only the files this\ndevice still needs:\n\n```typescript\nconst latest = await CapacitorUpdater.getLatest();\nconst missing = await CapacitorUpdater.getMissingBundleFiles(latest);\nconst size = await CapacitorUpdater.getBundleDownloadSize({\n version: latest.version,\n manifest: missing.missing,\n});\n```",
623
+ "complexTypes": [
624
+ "GetBundleDownloadSizeResult",
625
+ "GetBundleDownloadSizeOptions"
626
+ ],
627
+ "slug": "getbundledownloadsize"
628
+ },
526
629
  {
527
630
  "name": "setChannel",
528
631
  "signature": "(options: SetChannelOptions) => Promise<ChannelRes>",
@@ -1866,6 +1969,31 @@
1866
1969
  }
1867
1970
  ]
1868
1971
  },
1972
+ {
1973
+ "name": "StartPreviewSessionOptions",
1974
+ "slug": "startpreviewsessionoptions",
1975
+ "docs": "",
1976
+ "tags": [],
1977
+ "methods": [],
1978
+ "properties": [
1979
+ {
1980
+ "name": "appId",
1981
+ "tags": [
1982
+ {
1983
+ "text": "8.47.0",
1984
+ "name": "since"
1985
+ },
1986
+ {
1987
+ "text": "undefined",
1988
+ "name": "default"
1989
+ }
1990
+ ],
1991
+ "docs": "App id to use while the preview session is active.\nThe previous app id is restored when leaving the preview session.\nRequires {@link PluginsConfig.CapacitorUpdater.allowPreview} to be `true`.",
1992
+ "complexTypes": [],
1993
+ "type": "string | undefined"
1994
+ }
1995
+ ]
1996
+ },
1869
1997
  {
1870
1998
  "name": "BundleListResult",
1871
1999
  "slug": "bundlelistresult",
@@ -2181,6 +2309,34 @@
2181
2309
  ],
2182
2310
  "type": "ManifestEntry[] | undefined"
2183
2311
  },
2312
+ {
2313
+ "name": "missing",
2314
+ "tags": [
2315
+ {
2316
+ "text": "8.47.0",
2317
+ "name": "since"
2318
+ }
2319
+ ],
2320
+ "docs": "Missing manifest entries for this device when {@link GetLatestOptions.includeBundleSize}\nis enabled.",
2321
+ "complexTypes": [
2322
+ "GetMissingBundleFilesResult"
2323
+ ],
2324
+ "type": "GetMissingBundleFilesResult"
2325
+ },
2326
+ {
2327
+ "name": "downloadSize",
2328
+ "tags": [
2329
+ {
2330
+ "text": "8.47.0",
2331
+ "name": "since"
2332
+ }
2333
+ ],
2334
+ "docs": "Estimated download size for missing manifest entries when\n{@link GetLatestOptions.includeBundleSize} is enabled.",
2335
+ "complexTypes": [
2336
+ "GetBundleDownloadSizeResult"
2337
+ ],
2338
+ "type": "GetBundleDownloadSizeResult"
2339
+ },
2184
2340
  {
2185
2341
  "name": "link",
2186
2342
  "tags": [
@@ -2207,6 +2363,193 @@
2207
2363
  }
2208
2364
  ]
2209
2365
  },
2366
+ {
2367
+ "name": "GetMissingBundleFilesResult",
2368
+ "slug": "getmissingbundlefilesresult",
2369
+ "docs": "",
2370
+ "tags": [],
2371
+ "methods": [],
2372
+ "properties": [
2373
+ {
2374
+ "name": "missing",
2375
+ "tags": [
2376
+ {
2377
+ "text": "8.47.0",
2378
+ "name": "since"
2379
+ }
2380
+ ],
2381
+ "docs": "Entries that are not available locally and need to be downloaded.",
2382
+ "complexTypes": [
2383
+ "ManifestEntry"
2384
+ ],
2385
+ "type": "ManifestEntry[]"
2386
+ },
2387
+ {
2388
+ "name": "total",
2389
+ "tags": [
2390
+ {
2391
+ "text": "8.47.0",
2392
+ "name": "since"
2393
+ }
2394
+ ],
2395
+ "docs": "Total entries in the provided manifest.",
2396
+ "complexTypes": [],
2397
+ "type": "number"
2398
+ },
2399
+ {
2400
+ "name": "missingCount",
2401
+ "tags": [
2402
+ {
2403
+ "text": "8.47.0",
2404
+ "name": "since"
2405
+ }
2406
+ ],
2407
+ "docs": "Number of entries that need to be downloaded.",
2408
+ "complexTypes": [],
2409
+ "type": "number"
2410
+ },
2411
+ {
2412
+ "name": "reusableCount",
2413
+ "tags": [
2414
+ {
2415
+ "text": "8.47.0",
2416
+ "name": "since"
2417
+ }
2418
+ ],
2419
+ "docs": "Number of entries that can be reused from builtin files or local cache.",
2420
+ "complexTypes": [],
2421
+ "type": "number"
2422
+ }
2423
+ ]
2424
+ },
2425
+ {
2426
+ "name": "GetBundleDownloadSizeResult",
2427
+ "slug": "getbundledownloadsizeresult",
2428
+ "docs": "",
2429
+ "tags": [],
2430
+ "methods": [],
2431
+ "properties": [
2432
+ {
2433
+ "name": "totalSize",
2434
+ "tags": [
2435
+ {
2436
+ "text": "8.47.0",
2437
+ "name": "since"
2438
+ }
2439
+ ],
2440
+ "docs": "Sum of all known file sizes in bytes.",
2441
+ "complexTypes": [],
2442
+ "type": "number"
2443
+ },
2444
+ {
2445
+ "name": "knownFiles",
2446
+ "tags": [
2447
+ {
2448
+ "text": "8.47.0",
2449
+ "name": "since"
2450
+ }
2451
+ ],
2452
+ "docs": "Number of files with a known size.",
2453
+ "complexTypes": [],
2454
+ "type": "number"
2455
+ },
2456
+ {
2457
+ "name": "unknownFiles",
2458
+ "tags": [
2459
+ {
2460
+ "text": "8.47.0",
2461
+ "name": "since"
2462
+ }
2463
+ ],
2464
+ "docs": "Number of files whose size could not be determined.",
2465
+ "complexTypes": [],
2466
+ "type": "number"
2467
+ },
2468
+ {
2469
+ "name": "files",
2470
+ "tags": [
2471
+ {
2472
+ "text": "8.47.0",
2473
+ "name": "since"
2474
+ }
2475
+ ],
2476
+ "docs": "Per-file size results.",
2477
+ "complexTypes": [
2478
+ "BundleFileSize"
2479
+ ],
2480
+ "type": "BundleFileSize[]"
2481
+ }
2482
+ ]
2483
+ },
2484
+ {
2485
+ "name": "BundleFileSize",
2486
+ "slug": "bundlefilesize",
2487
+ "docs": "",
2488
+ "tags": [],
2489
+ "methods": [],
2490
+ "properties": [
2491
+ {
2492
+ "name": "file_name",
2493
+ "tags": [
2494
+ {
2495
+ "text": "8.47.0",
2496
+ "name": "since"
2497
+ }
2498
+ ],
2499
+ "docs": "File name from the manifest entry.",
2500
+ "complexTypes": [],
2501
+ "type": "string | null"
2502
+ },
2503
+ {
2504
+ "name": "file_hash",
2505
+ "tags": [
2506
+ {
2507
+ "text": "8.47.0",
2508
+ "name": "since"
2509
+ }
2510
+ ],
2511
+ "docs": "File hash from the manifest entry.",
2512
+ "complexTypes": [],
2513
+ "type": "string | null"
2514
+ },
2515
+ {
2516
+ "name": "download_url",
2517
+ "tags": [
2518
+ {
2519
+ "text": "8.47.0",
2520
+ "name": "since"
2521
+ }
2522
+ ],
2523
+ "docs": "Download URL from the manifest entry.",
2524
+ "complexTypes": [],
2525
+ "type": "string | null"
2526
+ },
2527
+ {
2528
+ "name": "size",
2529
+ "tags": [
2530
+ {
2531
+ "text": "8.47.0",
2532
+ "name": "since"
2533
+ }
2534
+ ],
2535
+ "docs": "Estimated bytes to download when the server exposes a size.",
2536
+ "complexTypes": [],
2537
+ "type": "number | undefined"
2538
+ },
2539
+ {
2540
+ "name": "error",
2541
+ "tags": [
2542
+ {
2543
+ "text": "8.47.0",
2544
+ "name": "since"
2545
+ }
2546
+ ],
2547
+ "docs": "Error for this entry when the size could not be determined.",
2548
+ "complexTypes": [],
2549
+ "type": "string | undefined"
2550
+ }
2551
+ ]
2552
+ },
2210
2553
  {
2211
2554
  "name": "GetLatestOptions",
2212
2555
  "slug": "getlatestoptions",
@@ -2229,6 +2572,120 @@
2229
2572
  "docs": "The channel to get the latest version for\nThe channel must allow 'self_assign' for this to work",
2230
2573
  "complexTypes": [],
2231
2574
  "type": "string | undefined"
2575
+ },
2576
+ {
2577
+ "name": "appId",
2578
+ "tags": [
2579
+ {
2580
+ "text": "8.47.0",
2581
+ "name": "since"
2582
+ },
2583
+ {
2584
+ "text": "undefined",
2585
+ "name": "default"
2586
+ }
2587
+ ],
2588
+ "docs": "Temporarily use another app id for this update check while using a trusted preview container.\nThis only changes the app id sent by this request; it does not persist a preview session.\nRequires {@link PluginsConfig.CapacitorUpdater.allowPreview} to be `true`.",
2589
+ "complexTypes": [],
2590
+ "type": "string | undefined"
2591
+ },
2592
+ {
2593
+ "name": "includeBundleSize",
2594
+ "tags": [
2595
+ {
2596
+ "text": "8.47.0",
2597
+ "name": "since"
2598
+ },
2599
+ {
2600
+ "text": "false",
2601
+ "name": "default"
2602
+ }
2603
+ ],
2604
+ "docs": "When true, the native plugin computes which manifest files are missing on\nthis device and asks the Capgo update endpoint for their stored sizes before\nresolving {@link getLatest}.\n\nThis adds one backend request only when the update response contains a\nmanifest. It does not perform per-file network checks.",
2605
+ "complexTypes": [],
2606
+ "type": "boolean | undefined"
2607
+ }
2608
+ ]
2609
+ },
2610
+ {
2611
+ "name": "GetMissingBundleFilesOptions",
2612
+ "slug": "getmissingbundlefilesoptions",
2613
+ "docs": "",
2614
+ "tags": [],
2615
+ "methods": [],
2616
+ "properties": [
2617
+ {
2618
+ "name": "manifest",
2619
+ "tags": [
2620
+ {
2621
+ "text": "8.47.0",
2622
+ "name": "since"
2623
+ }
2624
+ ],
2625
+ "docs": "Manifest returned by {@link getLatest}. Passing the full {@link LatestVersion}\nresponse is supported because it contains this field.",
2626
+ "complexTypes": [
2627
+ "ManifestEntry"
2628
+ ],
2629
+ "type": "ManifestEntry[] | undefined"
2630
+ },
2631
+ {
2632
+ "name": "version",
2633
+ "tags": [
2634
+ {
2635
+ "text": "8.47.0",
2636
+ "name": "since"
2637
+ }
2638
+ ],
2639
+ "docs": "Target bundle version. Passing the full {@link LatestVersion} response is\nsupported because it contains this field.",
2640
+ "complexTypes": [],
2641
+ "type": "string | undefined"
2642
+ },
2643
+ {
2644
+ "name": "sessionKey",
2645
+ "tags": [
2646
+ {
2647
+ "text": "8.47.0",
2648
+ "name": "since"
2649
+ }
2650
+ ],
2651
+ "docs": "Session key returned by {@link getLatest}, required only when file hashes are encrypted.",
2652
+ "complexTypes": [],
2653
+ "type": "string | undefined"
2654
+ }
2655
+ ]
2656
+ },
2657
+ {
2658
+ "name": "GetBundleDownloadSizeOptions",
2659
+ "slug": "getbundledownloadsizeoptions",
2660
+ "docs": "",
2661
+ "tags": [],
2662
+ "methods": [],
2663
+ "properties": [
2664
+ {
2665
+ "name": "manifest",
2666
+ "tags": [
2667
+ {
2668
+ "text": "8.47.0",
2669
+ "name": "since"
2670
+ }
2671
+ ],
2672
+ "docs": "Manifest entries to estimate. Pass `missing.missing` from {@link getMissingBundleFiles}\nto estimate only the bytes this device still needs to download.",
2673
+ "complexTypes": [
2674
+ "ManifestEntry"
2675
+ ],
2676
+ "type": "ManifestEntry[] | undefined"
2677
+ },
2678
+ {
2679
+ "name": "version",
2680
+ "tags": [
2681
+ {
2682
+ "text": "8.47.0",
2683
+ "name": "since"
2684
+ }
2685
+ ],
2686
+ "docs": "Target bundle version. Pass `latest.version` when estimating files returned\nby {@link getLatest}.",
2687
+ "complexTypes": [],
2688
+ "type": "string | undefined"
2232
2689
  }
2233
2690
  ]
2234
2691
  },
@@ -3940,6 +4397,22 @@
3940
4397
  "complexTypes": [],
3941
4398
  "type": "boolean | undefined"
3942
4399
  },
4400
+ {
4401
+ "name": "allowPreview",
4402
+ "tags": [
4403
+ {
4404
+ "text": "false",
4405
+ "name": "default"
4406
+ },
4407
+ {
4408
+ "text": "8.47.0",
4409
+ "name": "since"
4410
+ }
4411
+ ],
4412
+ "docs": "Allow JavaScript to start a native preview session and temporarily request updates for another app id.\nThis is intended for trusted container apps that implement Expo Go-style preview flows.\n\nOnly available for Android and iOS.",
4413
+ "complexTypes": [],
4414
+ "type": "boolean | undefined"
4415
+ },
3943
4416
  {
3944
4417
  "name": "persistCustomId",
3945
4418
  "tags": [