@forgeroute/ui 0.4.99 → 0.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgeroute/ui",
3
- "version": "0.4.99",
3
+ "version": "0.5.1",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=22.0.0",
6
6
  "@angular/core": ">=22.0.0",
@@ -73,6 +73,14 @@
73
73
  "types": "./types/forgeroute-ui-pdf.d.ts",
74
74
  "default": "./fesm2022/forgeroute-ui-pdf.mjs"
75
75
  },
76
+ "./quickbooks": {
77
+ "types": "./types/forgeroute-ui-quickbooks.d.ts",
78
+ "default": "./fesm2022/forgeroute-ui-quickbooks.mjs"
79
+ },
80
+ "./square": {
81
+ "types": "./types/forgeroute-ui-square.d.ts",
82
+ "default": "./fesm2022/forgeroute-ui-square.mjs"
83
+ },
76
84
  "./stripe": {
77
85
  "types": "./types/forgeroute-ui-stripe.d.ts",
78
86
  "default": "./fesm2022/forgeroute-ui-stripe.mjs"
@@ -338,6 +338,19 @@ export declare function deriveEntity(url: string): {
338
338
  export declare function invalidationPrefix(url: string): string;
339
339
  /** `resolveConfig` memoised per config object (interceptors run on every request). */
340
340
  export declare function resolveConfigCached(cfg: OfflineSupportConfig): ResolvedOfflineConfig;
341
+ /**
342
+ * Payment routes must NEVER be queued, retried in the background or replayed (a replay after reconnect is a second charge). This builds the entries of the config's EXISTING `blockOffline`
343
+ * list from the app's payment URL patterns, so a payment POST fails fast with `OfflineBlockedError` while offline / unreachable and nothing is stored:
344
+ *
345
+ * provideOfflineSupport({ getUserId, blockOffline: [...blockPaymentsOffline([/\/api\/payments(\/|$)/, '/api/portal/pay'], 'Payments need an internet connection.')] })
346
+ *
347
+ * Also add the same patterns to `neverCache`. The payment forms of `@forgeroute/ui/stripe|square|quickbooks` do not use this layer themselves (the QuickBooks tokenizer is a plain `fetch` with its own
348
+ * AbortController); the host's own payment calls (create payment, status check) go through the host's HttpClient and are the ones to exclude.
349
+ */
350
+ export declare function blockPaymentsOffline(patterns: readonly UrlMatcher[], message?: string): {
351
+ pattern: UrlMatcher;
352
+ message?: string;
353
+ }[];
341
354
  /** True when the request is one the offline layer looks at: under `apiPrefix` and not matched by `skip`. */
342
355
  export declare function isInScope(url: string, cfg: ResolvedOfflineConfig): boolean;
343
356
  export declare function lastSegmentIsId(url: string): boolean;
@@ -653,6 +666,13 @@ export declare const connectionInterceptor: HttpInterceptorFn;
653
666
  * never queued automatically.
654
667
  */
655
668
  export declare const offlineInterceptor: HttpInterceptorFn;
669
+ /**
670
+ * Development help: a request whose path has a payment segment (`/pay`, `/payments`, `/charge`, `/refund`) is about to be SAVED for replay. A replay after reconnecting is a second charge, so such routes belong in
671
+ * `blockOffline` (see `blockPaymentsOffline`). Warns once per path, in development mode only.
672
+ */
673
+ declare function warnIfPaymentQueued(url: string): void;
674
+ /** @internal Specs only (not part of the public entry): forget which payment paths were already warned about. */
675
+ declare function resetPaymentQueueWarnings(): void;
656
676
  /**
657
677
  * Register LAST in `withInterceptors([... ,...offlineHttpInterceptors])` (after errorContext and the app's own auth interceptor; replays carry
658
678
  * `X-Offline-Replay`, so an app whose auth interceptor sits after these still gets the live token on replays).