@aiquants/auth-react-router 0.45.0 → 0.47.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.
- package/README.md +57 -0
- package/dist/admin.d.mts +19 -0
- package/dist/admin.d.ts +19 -0
- package/dist/admin.js +1 -1
- package/dist/admin.mjs +1 -1
- package/package.json +10 -9
package/README.md
CHANGED
|
@@ -327,6 +327,30 @@ first from the loader's `url`. The guard's own check is reached only by a sessio
|
|
|
327
327
|
`directoryView.title`). `resolveUserAdminLabels` refuses a catalog in which two of one view's names are the same once
|
|
328
328
|
case and white space are set aside, the way axe-core's `landmark-unique` compares them. The groups view's cards and the
|
|
329
329
|
group members view's table are named after groups, which are data the catalog cannot check.
|
|
330
|
+
- **A synchronization failure is worded from its record**, never shown as stored. The synchronization records why a link
|
|
331
|
+
did not converge as a kind and its values in `AuthGroupExternalLink.syncError` (`@aiquants/auth-core`'s
|
|
332
|
+
`AuthDirectorySyncFailure`, encoded). The notice's errored groups and the last synchronization failure in a row's detail
|
|
333
|
+
(`directory-error-<group id>`) read it with `readAuthDirectorySyncFailure` and word it with the catalog's template of its
|
|
334
|
+
kind, so it reads in the console's language; the row's element carries the kind it was read as in `data-sync-failure`.
|
|
335
|
+
A value that is not a record (an earlier version's sentence, or a damaged value) is worded as
|
|
336
|
+
`directoryView.syncFailureUnreadable` and its text is never shown, since such a sentence may hold an upstream's error
|
|
337
|
+
text; the group still counts as errored. The removal ratio is a percentage in `formatLocale` (up to two decimals), user
|
|
338
|
+
IDs and causes are joined by `directoryView.listSeparator`, and when the record kept only the first of the refused
|
|
339
|
+
users' IDs, `syncFailureMoreUserIdsTemplate` adds how many it left out:
|
|
340
|
+
|
|
341
|
+
| Kind | Label (`directoryView.*`) | Values |
|
|
342
|
+
| --- | --- | --- |
|
|
343
|
+
| `upstreamUnreadable` | `syncFailureUpstreamUnreadableTemplate` | `{cause}`: one of the five `syncFailureCause*` phrases |
|
|
344
|
+
| `localWriteFailed` | `syncFailureLocalWriteFailed` | — |
|
|
345
|
+
| `resolverIncomplete` | `syncFailureResolverIncompleteTemplate` | `{upstreamCount}`, `{resolvedCount}` |
|
|
346
|
+
| `groupMissing` | `syncFailureGroupMissingTemplate` | `{externalKey}` (the link's), `{observations}`, `{threshold}` |
|
|
347
|
+
| `groupVanished` | `syncFailureGroupVanishedTemplate` | `{externalKey}` (the link's), `{observations}` |
|
|
348
|
+
| `upstreamDataRefused` | `syncFailureUpstreamDataRefusedTemplate` | `{offendingCount}` |
|
|
349
|
+
| `membershipRemovalsWithheld` | `syncFailureMembershipRemovalsWithheldTemplate` | `{removalCount}`, `{population}`, `{maxRemovalCount}`, `{maxRemovalRatio}` |
|
|
350
|
+
| `ledgerDeletesWithheld` | `syncFailureLedgerDeletesWithheldTemplate` | the same four |
|
|
351
|
+
| `removalsNotApplied` | `syncFailureRemovalsRefusedTemplate` (refused only), `syncFailureRemovalWritesFailedTemplate` (unwritten only) or `syncFailureRemovalsRefusedAndWritesFailedTemplate` (both) | `{refusedCount}`, `{userIds}`, `{failedCount}`, `{causes}` |
|
|
352
|
+
| `foreignProvider` | `syncFailureForeignProviderTemplate` | `{linkProvider}` (the link's `provider`), `{runnerProvider}` |
|
|
353
|
+
|
|
330
354
|
- **Upstream members not in a group are listed by reason**, never as one count under one label: someone who matches
|
|
331
355
|
more than one user, someone whose address belongs to a user linked to another upstream account, someone the next
|
|
332
356
|
synchronization adds, someone deactivated and someone not registered yet are different facts, cleared in different
|
|
@@ -562,6 +586,39 @@ domain with no groups.
|
|
|
562
586
|
- `createLinkedGroup` creates the group and links it in **one** intent, and therefore requires the union of the verbs both
|
|
563
587
|
halves need (`create` + `update` + `delete`). Splitting it in two would leave a state where only one half succeeded.
|
|
564
588
|
|
|
589
|
+
### Fuzzy search workers of the pickers
|
|
590
|
+
|
|
591
|
+
The two upstream-group pickers (the create-group dialog's and the directory view's external key) are
|
|
592
|
+
`@aiquants/select-box` boxes, and each runs its fuzzy search in the two Web Workers of `@aiquants/fuzzy-search` under a
|
|
593
|
+
fixed `workerId`. The ids follow the sets of options: pickers that always list the same options share an id (one index,
|
|
594
|
+
one pair of workers), pickers that list different options never do, and no id is made per mount. Both pickers list the
|
|
595
|
+
directory catalog's upstream groups, marked from the same links, so they share one id on their two screens:
|
|
596
|
+
|
|
597
|
+
| `workerId` | Options | Pickers |
|
|
598
|
+
| --- | --- | --- |
|
|
599
|
+
| `@aiquants/auth-react-router:upstream-groups` | the catalog's upstream groups | the create-group dialog's upstream picker and the directory view's external key picker |
|
|
600
|
+
|
|
601
|
+
- The engine starts the pair of workers when the first of the pickers mounts and keeps it for the rest of the page. Give
|
|
602
|
+
the host's own boxes other ids.
|
|
603
|
+
- The worker scripts come from the engine's rule ("The worker URL rule" in the `@aiquants/fuzzy-search` README). Its built-in
|
|
604
|
+
default loads in a production build from `@aiquants/fuzzy-search` 3.2.2 on — the peer floor of this package: the
|
|
605
|
+
bundler (Vite, for one) emits both scripts as assets and rewrites the URL. On the Vite dev server a pre-bundled copy of
|
|
606
|
+
the package cannot load it — keep `@aiquants/fuzzy-search` out of `optimizeDeps`, or give the URLs.
|
|
607
|
+
- Neither picker passes `workerUrls`, so a host gives the URLs page-wide through the static
|
|
608
|
+
`FuzzySearchManager.defaultWorkerUrls`, set before the first picker mounts:
|
|
609
|
+
|
|
610
|
+
```ts
|
|
611
|
+
import { FuzzySearchManager } from "@aiquants/fuzzy-search"
|
|
612
|
+
import indexWorkerUrl from "@aiquants/fuzzy-search/worker/indexWorker?url"
|
|
613
|
+
import levenshteinWorkerUrl from "@aiquants/fuzzy-search/worker/levenshteinWorker?url"
|
|
614
|
+
|
|
615
|
+
FuzzySearchManager.defaultWorkerUrls = { indexWorker: indexWorkerUrl, levenshteinWorker: levenshteinWorkerUrl }
|
|
616
|
+
```
|
|
617
|
+
|
|
618
|
+
- When a worker fails, both pickers list direct matches only (the index worker) or the index worker's fuzzy matches
|
|
619
|
+
without the Levenshtein stage (the Levenshtein worker) for the rest of the page, and select-box reports the failure
|
|
620
|
+
once, naming the `workerId`.
|
|
621
|
+
|
|
565
622
|
### Sync requests: queued on link, followed through on screen
|
|
566
623
|
|
|
567
624
|
The console never reaches the upstream itself. "Sync now" — and, since 0.15.0, **every link creation** — queues a request
|
package/dist/admin.d.mts
CHANGED
|
@@ -225,6 +225,25 @@ type UserAdminLabels = {
|
|
|
225
225
|
externalKeyDescription: string;
|
|
226
226
|
linkNeedsFields: string;
|
|
227
227
|
syncFailure: string;
|
|
228
|
+
syncFailureUnreadable: string;
|
|
229
|
+
syncFailureCauseDenied: string;
|
|
230
|
+
syncFailureCauseRateLimited: string;
|
|
231
|
+
syncFailureCauseUpstreamError: string;
|
|
232
|
+
syncFailureCauseTimeout: string;
|
|
233
|
+
syncFailureCauseUnknown: string;
|
|
234
|
+
syncFailureUpstreamUnreadableTemplate: string;
|
|
235
|
+
syncFailureLocalWriteFailed: string;
|
|
236
|
+
syncFailureResolverIncompleteTemplate: string;
|
|
237
|
+
syncFailureGroupMissingTemplate: string;
|
|
238
|
+
syncFailureGroupVanishedTemplate: string;
|
|
239
|
+
syncFailureUpstreamDataRefusedTemplate: string;
|
|
240
|
+
syncFailureMembershipRemovalsWithheldTemplate: string;
|
|
241
|
+
syncFailureLedgerDeletesWithheldTemplate: string;
|
|
242
|
+
syncFailureRemovalsRefusedTemplate: string;
|
|
243
|
+
syncFailureRemovalWritesFailedTemplate: string;
|
|
244
|
+
syncFailureRemovalsRefusedAndWritesFailedTemplate: string;
|
|
245
|
+
syncFailureMoreUserIdsTemplate: string;
|
|
246
|
+
syncFailureForeignProviderTemplate: string;
|
|
228
247
|
confirmLink: string;
|
|
229
248
|
confirmUnlink: string;
|
|
230
249
|
pause: string;
|
package/dist/admin.d.ts
CHANGED
|
@@ -225,6 +225,25 @@ type UserAdminLabels = {
|
|
|
225
225
|
externalKeyDescription: string;
|
|
226
226
|
linkNeedsFields: string;
|
|
227
227
|
syncFailure: string;
|
|
228
|
+
syncFailureUnreadable: string;
|
|
229
|
+
syncFailureCauseDenied: string;
|
|
230
|
+
syncFailureCauseRateLimited: string;
|
|
231
|
+
syncFailureCauseUpstreamError: string;
|
|
232
|
+
syncFailureCauseTimeout: string;
|
|
233
|
+
syncFailureCauseUnknown: string;
|
|
234
|
+
syncFailureUpstreamUnreadableTemplate: string;
|
|
235
|
+
syncFailureLocalWriteFailed: string;
|
|
236
|
+
syncFailureResolverIncompleteTemplate: string;
|
|
237
|
+
syncFailureGroupMissingTemplate: string;
|
|
238
|
+
syncFailureGroupVanishedTemplate: string;
|
|
239
|
+
syncFailureUpstreamDataRefusedTemplate: string;
|
|
240
|
+
syncFailureMembershipRemovalsWithheldTemplate: string;
|
|
241
|
+
syncFailureLedgerDeletesWithheldTemplate: string;
|
|
242
|
+
syncFailureRemovalsRefusedTemplate: string;
|
|
243
|
+
syncFailureRemovalWritesFailedTemplate: string;
|
|
244
|
+
syncFailureRemovalsRefusedAndWritesFailedTemplate: string;
|
|
245
|
+
syncFailureMoreUserIdsTemplate: string;
|
|
246
|
+
syncFailureForeignProviderTemplate: string;
|
|
228
247
|
confirmLink: string;
|
|
229
248
|
confirmUnlink: string;
|
|
230
249
|
pause: string;
|