@xyo-network/react-sentinel 4.4.2 → 4.4.4

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 (41) hide show
  1. package/dist/browser/index.d.ts +235 -4
  2. package/dist/browser/index.mjs.map +1 -1
  3. package/package.json +29 -29
  4. package/src/contexts/State.ts +2 -2
  5. package/dist/browser/components/Card/Card.d.ts +0 -10
  6. package/dist/browser/components/Card/Card.d.ts.map +0 -1
  7. package/dist/browser/components/Card/CardActions.d.ts +0 -9
  8. package/dist/browser/components/Card/CardActions.d.ts.map +0 -1
  9. package/dist/browser/components/Card/CardContent.d.ts +0 -10
  10. package/dist/browser/components/Card/CardContent.d.ts.map +0 -1
  11. package/dist/browser/components/Card/CardHeader.d.ts +0 -6
  12. package/dist/browser/components/Card/CardHeader.d.ts.map +0 -1
  13. package/dist/browser/components/Card/index.d.ts +0 -4
  14. package/dist/browser/components/Card/index.d.ts.map +0 -1
  15. package/dist/browser/components/Card/manifest.d.ts +0 -2
  16. package/dist/browser/components/Card/manifest.d.ts.map +0 -1
  17. package/dist/browser/components/index.d.ts +0 -2
  18. package/dist/browser/components/index.d.ts.map +0 -1
  19. package/dist/browser/contexts/Context.d.ts +0 -3
  20. package/dist/browser/contexts/Context.d.ts.map +0 -1
  21. package/dist/browser/contexts/Provider.d.ts +0 -18
  22. package/dist/browser/contexts/Provider.d.ts.map +0 -1
  23. package/dist/browser/contexts/State.d.ts +0 -34
  24. package/dist/browser/contexts/State.d.ts.map +0 -1
  25. package/dist/browser/contexts/index.d.ts +0 -5
  26. package/dist/browser/contexts/index.d.ts.map +0 -1
  27. package/dist/browser/contexts/use.d.ts +0 -151
  28. package/dist/browser/contexts/use.d.ts.map +0 -1
  29. package/dist/browser/hooks/index.d.ts +0 -2
  30. package/dist/browser/hooks/index.d.ts.map +0 -1
  31. package/dist/browser/hooks/node/index.d.ts +0 -5
  32. package/dist/browser/hooks/node/index.d.ts.map +0 -1
  33. package/dist/browser/hooks/node/useSentinelFromNode.d.ts +0 -4
  34. package/dist/browser/hooks/node/useSentinelFromNode.d.ts.map +0 -1
  35. package/dist/browser/hooks/node/useSentinelsFromNode.d.ts +0 -5
  36. package/dist/browser/hooks/node/useSentinelsFromNode.d.ts.map +0 -1
  37. package/dist/browser/hooks/node/useWeakSentinelFromNode.d.ts +0 -4
  38. package/dist/browser/hooks/node/useWeakSentinelFromNode.d.ts.map +0 -1
  39. package/dist/browser/hooks/node/useWeakSentinelsFromNode.d.ts +0 -5
  40. package/dist/browser/hooks/node/useWeakSentinelsFromNode.d.ts.map +0 -1
  41. package/dist/browser/index.d.ts.map +0 -1
@@ -1,4 +1,235 @@
1
- export * from './components/index.ts';
2
- export * from './contexts/index.ts';
3
- export * from './hooks/index.ts';
4
- //# sourceMappingURL=index.d.ts.map
1
+ import { CardProps, CardContentProps, CardHeaderProps } from '@mui/material';
2
+ import * as _xyo_network_payload_model from '@xyo-network/payload-model';
3
+ import { Payload } from '@xyo-network/payload-model';
4
+ import { ModuleRenderProps } from '@xyo-network/react-module';
5
+ import * as _xyo_network_sentinel_model from '@xyo-network/sentinel-model';
6
+ import { SentinelInstance, SentinelModule } from '@xyo-network/sentinel-model';
7
+ import * as React from 'react';
8
+ import React__default, { PropsWithChildren } from 'react';
9
+ import * as _xyo_network_react_shared from '@xyo-network/react-shared';
10
+ import { Enum, EnumValue } from '@xylabs/enum';
11
+ import { ArchivistModuleInstance } from '@xyo-network/archivist-model';
12
+ import * as _xyo_network_boundwitness_model from '@xyo-network/boundwitness-model';
13
+ import { BoundWitness } from '@xyo-network/boundwitness-model';
14
+ import { WitnessModule, WitnessInstance } from '@xyo-network/witness-model';
15
+ import * as _xyo_network_account_model from '@xyo-network/account-model';
16
+ import { AccountInstance } from '@xyo-network/account-model';
17
+ import * as _xyo_network_module_model from '@xyo-network/module-model';
18
+ import { ModuleIdentifier } from '@xyo-network/module-model';
19
+ import * as _xylabs_logger from '@xylabs/logger';
20
+ import * as _xylabs_object from '@xylabs/object';
21
+ import { ModuleFromNodeConfig, WeakModuleFromNodeConfig } from '@xyo-network/react-node';
22
+
23
+ type SentinelCardProps = CardProps & ModuleRenderProps<SentinelInstance> & {
24
+ inPayloads?: Payload[];
25
+ };
26
+ declare const SentinelCard: React__default.FC<SentinelCardProps>;
27
+
28
+ type SentinelCardContentProps = ModuleRenderProps<SentinelInstance> & CardContentProps & {
29
+ report?: Payload[];
30
+ };
31
+ declare const SentinelCardContent: React__default.FC<SentinelCardContentProps>;
32
+
33
+ declare const SentinelCardHeader: React__default.FC<ModuleRenderProps<SentinelInstance> & CardHeaderProps>;
34
+
35
+ declare const SentinelReportStatus: Enum<{
36
+ Idle: "idle";
37
+ Queued: "queued";
38
+ Started: "started";
39
+ Succeeded: "succeeded";
40
+ Failed: "failed";
41
+ }>;
42
+ type SentinelReportStatus = EnumValue<typeof SentinelReportStatus>;
43
+ interface SentinelWitnessReportProgress {
44
+ status: SentinelReportStatus;
45
+ witness: WitnessModule;
46
+ }
47
+ interface SentinelArchivistApiReportProgress {
48
+ archivist: ArchivistModuleInstance;
49
+ status: SentinelReportStatus;
50
+ }
51
+ interface SentinelReportProgress {
52
+ archivists?: Record<string, SentinelArchivistApiReportProgress>;
53
+ witnesses?: Record<string, SentinelWitnessReportProgress>;
54
+ }
55
+ interface SentinelContextState {
56
+ history?: BoundWitness[];
57
+ progress?: SentinelReportProgress;
58
+ reportingErrors?: Error[];
59
+ sentinel?: SentinelModule;
60
+ status?: SentinelReportStatus;
61
+ }
62
+
63
+ declare const SentinelContext: React.Context<SentinelContextState & _xyo_network_react_shared.ContextExState>;
64
+
65
+ interface SentinelProviderProps {
66
+ account: AccountInstance;
67
+ archive?: string;
68
+ archivist?: string;
69
+ ids?: ModuleIdentifier[];
70
+ name?: string;
71
+ required?: boolean;
72
+ witnesses?: WitnessInstance[];
73
+ }
74
+ declare const SentinelProvider: React__default.FC<PropsWithChildren<SentinelProviderProps>>;
75
+
76
+ declare const useSentinelContext: () => {
77
+ history: _xyo_network_boundwitness_model.BoundWitness[] | undefined;
78
+ progress: SentinelReportProgress | undefined;
79
+ reportingErrors: Error[] | undefined;
80
+ sentinel: _xyo_network_sentinel_model.SentinelModule<_xylabs_object.BaseParamsFields & {
81
+ account?: _xyo_network_account_model.AccountInstance | "random";
82
+ addToResolvers?: boolean;
83
+ additionalSigners?: _xyo_network_account_model.AccountInstance[];
84
+ allowNameResolution?: boolean;
85
+ config: _xylabs_object.DeepRestrictToStringKeys<{
86
+ schema: _xyo_network_payload_model.Schema;
87
+ readonly archiving?: {
88
+ readonly archivists?: string[] | undefined;
89
+ readonly queries?: string[] | undefined;
90
+ } | undefined;
91
+ readonly allowedQueries?: string[] | undefined;
92
+ readonly archivist?: _xyo_network_module_model.ModuleIdentifier | undefined;
93
+ readonly consoleLogger?: _xylabs_logger.LogLevel | undefined;
94
+ readonly labels?: {
95
+ [x: string]: string | undefined;
96
+ } | undefined;
97
+ readonly name?: _xyo_network_module_model.ModuleName | undefined;
98
+ readonly paging?: {
99
+ [x: string]: {
100
+ size?: number | undefined;
101
+ };
102
+ } | undefined;
103
+ readonly retry?: {
104
+ backoff?: number | undefined;
105
+ interval?: number | undefined;
106
+ retries?: number | undefined;
107
+ } | undefined;
108
+ readonly security?: {
109
+ readonly allowAnonymous?: boolean | undefined;
110
+ readonly allowed?: {
111
+ [x: string]: (Lowercase<string> | Lowercase<string>[])[];
112
+ } | undefined;
113
+ readonly disallowed?: {
114
+ [x: string]: Lowercase<string>[];
115
+ } | undefined;
116
+ } | undefined;
117
+ readonly sign?: boolean | undefined;
118
+ readonly storeQueries?: boolean | undefined;
119
+ readonly timestamp?: boolean | undefined;
120
+ automations?: ({
121
+ schema: "network.xyo.automation.interval";
122
+ type: "interval";
123
+ end?: number | undefined;
124
+ frequency?: number | undefined;
125
+ frequencyUnits?: "second" | "minute" | "hour" | "day" | "millis" | undefined;
126
+ remaining?: number | undefined;
127
+ start: number;
128
+ } | {
129
+ schema: "network.xyo.automation.event";
130
+ type: "interval";
131
+ end?: number | undefined;
132
+ frequency?: number | undefined;
133
+ frequencyUnits?: "second" | "minute" | "hour" | "day" | "millis" | undefined;
134
+ remaining?: number | undefined;
135
+ start: number;
136
+ } | {
137
+ schema: "network.xyo.automation";
138
+ type: "interval";
139
+ end?: number | undefined;
140
+ frequency?: number | undefined;
141
+ frequencyUnits?: "second" | "minute" | "hour" | "day" | "millis" | undefined;
142
+ remaining?: number | undefined;
143
+ start: number;
144
+ } | {
145
+ schema: "network.xyo.automation.interval";
146
+ type: "event";
147
+ } | {
148
+ schema: "network.xyo.automation.event";
149
+ type: "event";
150
+ } | {
151
+ schema: "network.xyo.automation";
152
+ type: "event";
153
+ })[] | undefined;
154
+ synchronous?: boolean | undefined;
155
+ tasks: ({
156
+ endPoint?: "observe" | undefined;
157
+ input?: string | boolean | string[] | undefined;
158
+ mod: _xyo_network_module_model.ModuleIdentifier;
159
+ required?: boolean | undefined;
160
+ } | {
161
+ endPoint?: "divine" | undefined;
162
+ input?: string | boolean | string[] | undefined;
163
+ mod: _xyo_network_module_model.ModuleIdentifier;
164
+ required?: boolean | undefined;
165
+ } | {
166
+ endPoint?: "clear" | "all" | "commit" | "delete" | "get" | "insert" | undefined;
167
+ input?: string | boolean | string[] | undefined;
168
+ mod: _xyo_network_module_model.ModuleIdentifier;
169
+ required?: boolean | undefined;
170
+ } | {
171
+ endPoint?: string | undefined;
172
+ input?: string | boolean | string[] | undefined;
173
+ mod: _xyo_network_module_model.ModuleIdentifier;
174
+ required?: boolean | undefined;
175
+ })[];
176
+ throwErrors?: boolean | undefined;
177
+ }>;
178
+ ephemeralQueryAccountEnabled?: boolean;
179
+ moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
180
+ }, _xyo_network_sentinel_model.SentinelModuleEventData<_xyo_network_module_model.Module<_xylabs_object.BaseParamsFields & {
181
+ account?: _xyo_network_account_model.AccountInstance | "random";
182
+ addToResolvers?: boolean;
183
+ additionalSigners?: _xyo_network_account_model.AccountInstance[];
184
+ allowNameResolution?: boolean;
185
+ config: _xylabs_object.DeepRestrictToStringKeys<{
186
+ schema: _xyo_network_payload_model.Schema;
187
+ readonly archiving?: {
188
+ readonly archivists?: string[] | undefined;
189
+ readonly queries?: string[] | undefined;
190
+ } | undefined;
191
+ readonly allowedQueries?: string[] | undefined;
192
+ readonly archivist?: _xyo_network_module_model.ModuleIdentifier | undefined;
193
+ readonly consoleLogger?: _xylabs_logger.LogLevel | undefined;
194
+ readonly labels?: {
195
+ [x: string]: string | undefined;
196
+ } | undefined;
197
+ readonly name?: _xyo_network_module_model.ModuleName | undefined;
198
+ readonly paging?: {
199
+ [x: string]: {
200
+ size?: number | undefined;
201
+ };
202
+ } | undefined;
203
+ readonly retry?: {
204
+ backoff?: number | undefined;
205
+ interval?: number | undefined;
206
+ retries?: number | undefined;
207
+ } | undefined;
208
+ readonly security?: {
209
+ readonly allowAnonymous?: boolean | undefined;
210
+ readonly allowed?: {
211
+ [x: string]: (Lowercase<string> | Lowercase<string>[])[];
212
+ } | undefined;
213
+ readonly disallowed?: {
214
+ [x: string]: Lowercase<string>[];
215
+ } | undefined;
216
+ } | undefined;
217
+ readonly sign?: boolean | undefined;
218
+ readonly storeQueries?: boolean | undefined;
219
+ readonly timestamp?: boolean | undefined;
220
+ }>;
221
+ ephemeralQueryAccountEnabled?: boolean;
222
+ moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
223
+ }, _xyo_network_module_model.ModuleEventData<object>>>> | undefined;
224
+ status: SentinelReportStatus | undefined;
225
+ };
226
+
227
+ declare const useSentinelFromNode: (nameOrAddressOrInstance?: string | SentinelInstance, config?: ModuleFromNodeConfig) => [SentinelInstance | undefined, Error | undefined];
228
+
229
+ declare const useSentinelsFromNode: (ids?: ModuleIdentifier[], config?: ModuleFromNodeConfig) => [SentinelInstance[] | null | undefined, Error | undefined];
230
+
231
+ declare const useWeakSentinelFromNode: (nameOrAddressOrInstance?: string | SentinelInstance, config?: WeakModuleFromNodeConfig) => [WeakRef<SentinelInstance> | undefined, Error | undefined];
232
+
233
+ declare const useWeakSentinelsFromNode: (ids?: ModuleIdentifier[], config?: ModuleFromNodeConfig) => [WeakRef<SentinelInstance>[] | null | undefined, Error | undefined];
234
+
235
+ export { type SentinelArchivistApiReportProgress, SentinelCard, SentinelCardContent, type SentinelCardContentProps, SentinelCardHeader, type SentinelCardProps, SentinelContext, type SentinelContextState, SentinelProvider, type SentinelProviderProps, type SentinelReportProgress, SentinelReportStatus, type SentinelWitnessReportProgress, useSentinelContext, useSentinelFromNode, useSentinelsFromNode, useWeakSentinelFromNode, useWeakSentinelsFromNode };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/Card/Card.tsx","../../src/components/Card/CardActions.tsx","../../src/components/Card/CardContent.tsx","../../src/components/Card/CardHeader.tsx","../../src/contexts/Context.ts","../../src/contexts/Provider.tsx","../../src/contexts/State.ts","../../src/contexts/use.ts","../../src/hooks/node/useSentinelFromNode.tsx","../../src/hooks/node/useSentinelsFromNode.tsx","../../src/hooks/node/useWeakSentinelFromNode.tsx","../../src/hooks/node/useWeakSentinelsFromNode.tsx"],"sourcesContent":["import type { CardProps } from '@mui/material'\nimport { Card } from '@mui/material'\nimport { usePromise } from '@xylabs/react-promise'\nimport type { Payload } from '@xyo-network/payload-model'\nimport type { ModuleRenderProps } from '@xyo-network/react-module'\nimport type { SentinelInstance } from '@xyo-network/sentinel-model'\nimport React, { useState } from 'react'\n\nimport { SentinelCardActions } from './CardActions.tsx'\nimport { SentinelCardContent } from './CardContent.tsx'\nimport { SentinelCardHeader } from './CardHeader.tsx'\n\nexport type SentinelCardProps = CardProps &\n ModuleRenderProps<SentinelInstance> & {\n inPayloads?: Payload[]\n }\n\nexport const SentinelCard: React.FC<SentinelCardProps> = ({\n children, inPayloads, mod, ...props\n}) => {\n const [retry, setRetry] = useState(-1)\n const [report] = usePromise(async () => {\n if (retry >= 0) {\n return await mod?.report(inPayloads)\n }\n }, [mod, retry, inPayloads])\n return (\n <Card {...props}>\n <SentinelCardHeader mod={mod} />\n <SentinelCardContent mod={mod} report={report} />\n {children}\n <SentinelCardActions mod={mod} onReport={() => setRetry(retry + 1)} />\n </Card>\n )\n}\n","import type { CardActionsProps } from '@mui/material'\nimport { ButtonEx } from '@xylabs/react-button'\nimport type { ModuleRenderProps } from '@xyo-network/react-module'\nimport { ModuleCardActions } from '@xyo-network/react-module'\nimport type { SentinelInstance } from '@xyo-network/sentinel-model'\nimport React from 'react'\n\nexport type SentinelCardActionsProps = ModuleRenderProps<SentinelInstance> &\n CardActionsProps & {\n onReport?: (mod?: SentinelInstance) => void\n }\n\nexport const SentinelCardActions: React.FC<SentinelCardActionsProps> = ({\n onReport, mod, ...props\n}) => {\n return (\n <ModuleCardActions mod={mod} {...props}>\n <ButtonEx onClick={() => onReport?.(mod)} size=\"small\" variant=\"outlined\">\n Report\n </ButtonEx>\n </ModuleCardActions>\n )\n}\n","import type { CardContentProps } from '@mui/material'\nimport { FlexGrowRow } from '@xylabs/react-flexbox'\nimport type { Payload } from '@xyo-network/payload-model'\nimport type { ModuleRenderProps } from '@xyo-network/react-module'\nimport { ModuleCardContent } from '@xyo-network/react-module'\nimport { JsonViewerEx } from '@xyo-network/react-payload-raw-info'\nimport type { SentinelInstance } from '@xyo-network/sentinel-model'\nimport React from 'react'\n\nexport type SentinelCardContentProps = ModuleRenderProps<SentinelInstance> &\n CardContentProps & {\n report?: Payload[]\n }\n\nexport const SentinelCardContent: React.FC<SentinelCardContentProps> = ({\n children, report, mod, ...props\n}) => {\n return (\n <ModuleCardContent mod={mod} {...props}>\n <FlexGrowRow flexWrap=\"wrap\" justifyContent=\"start\" gap={2}>\n {report\n ? <JsonViewerEx value={report} />\n : null}\n {children}\n </FlexGrowRow>\n </ModuleCardContent>\n )\n}\n","import type { CardHeaderProps } from '@mui/material'\nimport type { ModuleRenderProps } from '@xyo-network/react-module'\nimport { ModuleCardHeader } from '@xyo-network/react-module'\nimport type { SentinelInstance } from '@xyo-network/sentinel-model'\nimport React from 'react'\n\nexport const SentinelCardHeader: React.FC<ModuleRenderProps<SentinelInstance> & CardHeaderProps> = ({\n title, mod, ...props\n}) => {\n return <ModuleCardHeader mod={mod} title={title ?? mod?.config.name ?? 'Sentinel'} {...props} />\n}\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport type { SentinelContextState } from './State.ts'\n\nexport const SentinelContext = createContextEx<SentinelContextState>()\n","/* eslint-disable unicorn/no-array-push-push */\nimport { useAsyncEffect } from '@xylabs/react-async-effect'\nimport type { AccountInstance } from '@xyo-network/account-model'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport type { ModuleIdentifier } from '@xyo-network/module-model'\nimport { useWitnessesFromNode } from '@xyo-network/react-witness'\nimport { MemorySentinel } from '@xyo-network/sentinel-memory'\nimport type { SentinelConfig } from '@xyo-network/sentinel-model'\nimport { SentinelConfigSchema } from '@xyo-network/sentinel-model'\nimport type { WitnessInstance } from '@xyo-network/witness-model'\nimport { asWitnessInstance } from '@xyo-network/witness-model'\nimport type { PropsWithChildren } from 'react'\nimport React, {\n useEffect, useMemo, useState,\n} from 'react'\n\nimport { SentinelContext } from './Context.ts'\nimport type { SentinelReportProgress } from './State.ts'\nimport { SentinelReportStatus } from './State.ts'\n\nexport interface SentinelProviderProps {\n /** Account used by the sentinel for signing */\n account: AccountInstance\n /** @deprecated - sentinel no longer uses archive but relies on an archivist */\n archive?: string\n archivist?: string\n ids?: ModuleIdentifier[]\n name?: string\n required?: boolean\n witnesses?: WitnessInstance[]\n}\n\nexport const SentinelProvider: React.FC<PropsWithChildren<SentinelProviderProps>> = ({\n account, archivist, children, ids, name, required = false,\n}) => {\n const [sentinel, setSentinel] = useState<MemorySentinel>()\n const [history, setHistory] = useState<BoundWitness[]>()\n const [progress, setProgress] = useState<SentinelReportProgress>({})\n const [status, setStatus] = useState<SentinelReportStatus>(SentinelReportStatus.Idle)\n const [reportingErrors, setReportingErrors] = useState<Error[]>()\n const [witnesses] = useWitnessesFromNode(ids)\n\n useAsyncEffect(\n\n async (mounted) => {\n const sentinel = await MemorySentinel.create({\n account,\n config: {\n archivists: archivist ? [archivist] : undefined,\n name,\n\n schema: SentinelConfigSchema,\n synchronous: true,\n\n tasks: witnesses?.map(mod => ({ mod: mod.address })),\n } as SentinelConfig,\n })\n const offCallbacks: (() => void)[] = []\n offCallbacks.push(\n sentinel.on('reportEnd', ({ mod, outPayloads }) => {\n if (mounted()) {\n setProgress({\n archivists: progress.archivists,\n witnesses: progress.witnesses,\n })\n setStatus(outPayloads?.length ? SentinelReportStatus.Succeeded : SentinelReportStatus.Failed)\n setReportingErrors([new Error(`Witness failed [${mod?.config?.name ?? mod.address}]`)])\n }\n }),\n )\n offCallbacks.push(\n sentinel.on('reportStart', () => {\n if (mounted()) {\n setProgress({ archivists: {}, witnesses: {} })\n setStatus(SentinelReportStatus.Started)\n }\n }),\n )\n if (witnesses)\n for (const witness of witnesses) {\n offCallbacks.push(\n witness.on('observeEnd', ({ mod, outPayloads }) => {\n const witnesses = progress.witnesses ?? {}\n witnesses[witness.address] = {\n status: outPayloads?.length ? SentinelReportStatus.Succeeded : SentinelReportStatus.Failed,\n witness: asWitnessInstance(mod, () => `Module is not a witness [${mod.id}]`),\n }\n if (mounted()) {\n setProgress({\n archivists: progress.archivists,\n witnesses,\n })\n }\n }),\n )\n offCallbacks.push(\n witness.on('observeStart', ({ mod }) => {\n const witnesses = progress.witnesses ?? {}\n witnesses[witness.address] = {\n status: SentinelReportStatus.Started,\n witness: asWitnessInstance(mod, () => `Module is not a witness [${mod.id}]`),\n }\n if (mounted()) {\n setProgress({\n archivists: progress.archivists,\n witnesses,\n })\n }\n }),\n )\n }\n setSentinel(sentinel as MemorySentinel)\n return () => {\n // unsubscribe from events\n for (const callback of offCallbacks) {\n callback()\n }\n }\n },\n\n [account, archivist, witnesses],\n )\n\n useEffect(() => {\n // eslint-disable-next-line @eslint-react/hooks-extra/no-direct-set-state-in-use-effect\n setHistory(sentinel?.history as BoundWitness[])\n }, [sentinel])\n\n const value = useMemo(() => ({\n history, progress, provided: true, reportingErrors, sentinel, status,\n }), [history, progress, reportingErrors, sentinel, status])\n\n return !required || sentinel\n\n ? (\n <SentinelContext.Provider value={value}>\n {children}\n </SentinelContext.Provider>\n )\n : null\n}\n","import type { EnumValue } from '@xylabs/enum'\nimport { Enum } from '@xylabs/enum'\nimport type { ArchivistModule } from '@xyo-network/archivist-model'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport type { SentinelModule } from '@xyo-network/sentinel-model'\nimport type { WitnessModule } from '@xyo-network/witness-model'\n\nexport const SentinelReportStatus = Enum({\n Idle: 'idle',\n Queued: 'queued',\n Started: 'started',\n Succeeded: 'succeeded',\n Failed: 'failed',\n})\n\nexport type SentinelReportStatus = EnumValue<typeof SentinelReportStatus>\n\nexport interface SentinelWitnessReportProgress {\n status: SentinelReportStatus\n witness: WitnessModule\n}\n\nexport interface SentinelArchivistApiReportProgress {\n archivist: ArchivistModule\n status: SentinelReportStatus\n}\n\nexport interface SentinelReportProgress {\n archivists?: Record<string, SentinelArchivistApiReportProgress>\n witnesses?: Record<string, SentinelWitnessReportProgress>\n}\n\nexport interface SentinelContextState {\n history?: BoundWitness[]\n progress?: SentinelReportProgress\n reportingErrors?: Error[]\n sentinel?: SentinelModule\n status?: SentinelReportStatus\n}\n","import { useContextEx } from '@xyo-network/react-shared'\n\nimport { SentinelContext } from './Context.ts'\n\nexport const useSentinelContext = () => {\n const {\n sentinel, history, progress, reportingErrors, status,\n } = useContextEx(SentinelContext, 'Sentinel')\n return {\n history, progress, reportingErrors, sentinel, status,\n }\n}\n","import type { ModuleFromNodeConfig } from '@xyo-network/react-node'\nimport { useModuleFromNode } from '@xyo-network/react-node'\nimport type { SentinelInstance } from '@xyo-network/sentinel-model'\nimport { asSentinelInstance } from '@xyo-network/sentinel-model'\n\nexport const useSentinelFromNode = (\n nameOrAddressOrInstance?: string | SentinelInstance,\n config?: ModuleFromNodeConfig,\n): [SentinelInstance | undefined, Error | undefined] => {\n const [mod, error] = useModuleFromNode(nameOrAddressOrInstance, config)\n const instance = asSentinelInstance(mod)\n if (mod && !instance) {\n const error = new Error(`Resolved module is not a SentinelInstance [${mod.config?.schema}:${mod.config?.name}:${mod.address}]`)\n console.error(error.message)\n return [undefined, error]\n }\n return [instance, error]\n}\n","import type { ModuleIdentifier } from '@xyo-network/module-model'\nimport type { ModuleFromNodeConfig } from '@xyo-network/react-node'\nimport { useModulesFromNode } from '@xyo-network/react-node'\nimport type { SentinelInstance } from '@xyo-network/sentinel-model'\nimport { isSentinelInstance } from '@xyo-network/sentinel-model'\n\nexport const useSentinelsFromNode = (\n ids?: ModuleIdentifier[],\n config?: ModuleFromNodeConfig,\n): [SentinelInstance[] | null | undefined, Error | undefined] => {\n const [modules, error] = useModulesFromNode(ids, config)\n if (error) {\n return [null, error]\n }\n return modules\n ? [\n // eslint-disable-next-line unicorn/no-array-reduce\n modules.reduce<SentinelInstance[]>((prev, mod) => {\n if (isSentinelInstance(mod)) {\n prev.push(mod)\n }\n return prev\n }, []),\n undefined,\n ]\n : [modules, error]\n}\n","import type { WeakModuleFromNodeConfig } from '@xyo-network/react-node'\nimport { useWeakModuleFromNode } from '@xyo-network/react-node'\nimport type { SentinelInstance } from '@xyo-network/sentinel-model'\nimport { isSentinelInstance } from '@xyo-network/sentinel-model'\n\nexport const useWeakSentinelFromNode = (\n nameOrAddressOrInstance?: string | SentinelInstance,\n config?: WeakModuleFromNodeConfig,\n): [WeakRef<SentinelInstance> | undefined, Error | undefined] => {\n return useWeakModuleFromNode<SentinelInstance>(nameOrAddressOrInstance, { identity: isSentinelInstance, ...config })\n}\n","import { exists } from '@xylabs/exists'\nimport type { ModuleIdentifier } from '@xyo-network/module-model'\nimport type { ModuleFromNodeConfig } from '@xyo-network/react-node'\nimport { useWeakModulesFromNode } from '@xyo-network/react-node'\nimport type { SentinelInstance } from '@xyo-network/sentinel-model'\nimport { asSentinelInstance } from '@xyo-network/sentinel-model'\n\nexport const useWeakSentinelsFromNode = (\n ids?: ModuleIdentifier[],\n config?: ModuleFromNodeConfig,\n): [WeakRef<SentinelInstance>[] | null | undefined, Error | undefined] => {\n const [modules, error] = useWeakModulesFromNode(ids, config)\n if (error) {\n return [null, error]\n }\n return [\n modules\n ?.map((mod) => {\n const instance = asSentinelInstance(mod?.deref())\n if (instance) {\n return new WeakRef(instance)\n }\n })\n .filter(exists) ?? [],\n undefined,\n ]\n}\n"],"mappings":";;;;AACA,SAASA,YAAY;AACrB,SAASC,kBAAkB;AAI3B,OAAOC,UAASC,gBAAgB;;;ACLhC,SAASC,gBAAgB;AAEzB,SAASC,yBAAyB;AAElC,OAAOC,WAAW;AAOX,IAAMC,sBAA0D,wBAAC,EACtEC,UAAUC,KAAK,GAAGC,MAAAA,MACnB;AACC,SACE,sBAAA,cAACC,mBAAAA;IAAkBF;IAAW,GAAGC;KAC/B,sBAAA,cAACE,UAAAA;IAASC,SAAS,6BAAML,WAAWC,GAAAA,GAAjB;IAAuBK,MAAK;IAAQC,SAAQ;KAAW,QAAA,CAAA;AAKhF,GAVuE;;;ACXvE,SAASC,mBAAmB;AAG5B,SAASC,yBAAyB;AAClC,SAASC,oBAAoB;AAE7B,OAAOC,YAAW;AAOX,IAAMC,sBAA0D,wBAAC,EACtEC,UAAUC,QAAQC,KAAK,GAAGC,MAAAA,MAC3B;AACC,SACE,gBAAAC,OAAA,cAACC,mBAAAA;IAAkBH;IAAW,GAAGC;KAC/B,gBAAAC,OAAA,cAACE,aAAAA;IAAYC,UAAS;IAAOC,gBAAe;IAAQC,KAAK;KACtDR,SACG,gBAAAG,OAAA,cAACM,cAAAA;IAAaC,OAAOV;OACrB,MACHD,QAAAA,CAAAA;AAIT,GAbuE;;;ACZvE,SAASY,wBAAwB;AAEjC,OAAOC,YAAW;AAEX,IAAMC,qBAAsF,wBAAC,EAClGC,OAAOC,KAAK,GAAGC,MAAAA,MAChB;AACC,SAAO,gBAAAC,OAAA,cAACC,kBAAA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IE,OAAO;AACT,WAAO;MAAC;MAAMA;;EAChB;AACA,SAAO;IACLD,SACIG,IAAI,CAACC,QAAAA;AACL,YAAMC,WAAWC,oBAAmBF,KAAKG,MAAAA,CAAAA;AACzC,UAAIF,UAAU;AACZ,eAAO,IAAIG,QAAQH,QAAAA;MACrB;IACF,CAAA,EACCI,OAAOC,MAAAA,KAAW,CAAA;IACrBC;;AAEJ,GAnBwC;","names":["Card","usePromise","React","useState","ButtonEx","ModuleCardActions","React","SentinelCardActions","onReport","mod","props","ModuleCardActions","ButtonEx","onClick","size","variant","FlexGrowRow","ModuleCardContent","JsonViewerEx","React","SentinelCardContent","children","report","mod","props","React","ModuleCardContent","FlexGrowRow","flexWrap","justifyContent","gap","JsonViewerEx","value","ModuleCardHeader","React","SentinelCardHeader","title","mod","props","React","ModuleCardHeader","config","name","SentinelCard","children","inPayloads","mod","props","retry","setRetry","useState","report","usePromise","React","Card","SentinelCardHeader","SentinelCardContent","SentinelCardActions","onReport","createContextEx","SentinelContext","useAsyncEffect","useWitnessesFromNode","MemorySentinel","SentinelConfigSchema","asWitnessInstance","React","useEffect","useMemo","useState","Enum","SentinelReportStatus","Idle","Queued","Started","Succeeded","Failed","SentinelProvider","account","archivist","children","ids","name","required","sentinel","setSentinel","useState","history","setHistory","progress","setProgress","status","setStatus","SentinelReportStatus","Idle","reportingErrors","setReportingErrors","witnesses","useWitnessesFromNode","useAsyncEffect","mounted","MemorySentinel","create","config","archivists","undefined","schema","SentinelConfigSchema","synchronous","tasks","map","mod","address","offCallbacks","push","on","outPayloads","length","Succeeded","Failed","Error","Started","witness","asWitnessInstance","id","callback","useEffect","value","useMemo","provided","React","SentinelContext","Provider","useContextEx","useSentinelContext","sentinel","history","progress","reportingErrors","status","useContextEx","SentinelContext","useModuleFromNode","asSentinelInstance","useSentinelFromNode","nameOrAddressOrInstance","config","mod","error","useModuleFromNode","instance","asSentinelInstance","Error","schema","name","address","console","message","undefined","useModulesFromNode","isSentinelInstance","useSentinelsFromNode","ids","config","modules","error","useModulesFromNode","reduce","prev","mod","isSentinelInstance","push","undefined","useWeakModuleFromNode","isSentinelInstance","useWeakSentinelFromNode","nameOrAddressOrInstance","config","useWeakModuleFromNode","identity","isSentinelInstance","exists","useWeakModulesFromNode","asSentinelInstance","useWeakSentinelsFromNode","ids","config","modules","error","useWeakModulesFromNode","map","mod","instance","asSentinelInstance","deref","WeakRef","filter","exists","undefined"]}
1
+ {"version":3,"sources":["../../src/components/Card/Card.tsx","../../src/components/Card/CardActions.tsx","../../src/components/Card/CardContent.tsx","../../src/components/Card/CardHeader.tsx","../../src/contexts/Context.ts","../../src/contexts/Provider.tsx","../../src/contexts/State.ts","../../src/contexts/use.ts","../../src/hooks/node/useSentinelFromNode.tsx","../../src/hooks/node/useSentinelsFromNode.tsx","../../src/hooks/node/useWeakSentinelFromNode.tsx","../../src/hooks/node/useWeakSentinelsFromNode.tsx"],"sourcesContent":["import type { CardProps } from '@mui/material'\nimport { Card } from '@mui/material'\nimport { usePromise } from '@xylabs/react-promise'\nimport type { Payload } from '@xyo-network/payload-model'\nimport type { ModuleRenderProps } from '@xyo-network/react-module'\nimport type { SentinelInstance } from '@xyo-network/sentinel-model'\nimport React, { useState } from 'react'\n\nimport { SentinelCardActions } from './CardActions.tsx'\nimport { SentinelCardContent } from './CardContent.tsx'\nimport { SentinelCardHeader } from './CardHeader.tsx'\n\nexport type SentinelCardProps = CardProps &\n ModuleRenderProps<SentinelInstance> & {\n inPayloads?: Payload[]\n }\n\nexport const SentinelCard: React.FC<SentinelCardProps> = ({\n children, inPayloads, mod, ...props\n}) => {\n const [retry, setRetry] = useState(-1)\n const [report] = usePromise(async () => {\n if (retry >= 0) {\n return await mod?.report(inPayloads)\n }\n }, [mod, retry, inPayloads])\n return (\n <Card {...props}>\n <SentinelCardHeader mod={mod} />\n <SentinelCardContent mod={mod} report={report} />\n {children}\n <SentinelCardActions mod={mod} onReport={() => setRetry(retry + 1)} />\n </Card>\n )\n}\n","import type { CardActionsProps } from '@mui/material'\nimport { ButtonEx } from '@xylabs/react-button'\nimport type { ModuleRenderProps } from '@xyo-network/react-module'\nimport { ModuleCardActions } from '@xyo-network/react-module'\nimport type { SentinelInstance } from '@xyo-network/sentinel-model'\nimport React from 'react'\n\nexport type SentinelCardActionsProps = ModuleRenderProps<SentinelInstance> &\n CardActionsProps & {\n onReport?: (mod?: SentinelInstance) => void\n }\n\nexport const SentinelCardActions: React.FC<SentinelCardActionsProps> = ({\n onReport, mod, ...props\n}) => {\n return (\n <ModuleCardActions mod={mod} {...props}>\n <ButtonEx onClick={() => onReport?.(mod)} size=\"small\" variant=\"outlined\">\n Report\n </ButtonEx>\n </ModuleCardActions>\n )\n}\n","import type { CardContentProps } from '@mui/material'\nimport { FlexGrowRow } from '@xylabs/react-flexbox'\nimport type { Payload } from '@xyo-network/payload-model'\nimport type { ModuleRenderProps } from '@xyo-network/react-module'\nimport { ModuleCardContent } from '@xyo-network/react-module'\nimport { JsonViewerEx } from '@xyo-network/react-payload-raw-info'\nimport type { SentinelInstance } from '@xyo-network/sentinel-model'\nimport React from 'react'\n\nexport type SentinelCardContentProps = ModuleRenderProps<SentinelInstance> &\n CardContentProps & {\n report?: Payload[]\n }\n\nexport const SentinelCardContent: React.FC<SentinelCardContentProps> = ({\n children, report, mod, ...props\n}) => {\n return (\n <ModuleCardContent mod={mod} {...props}>\n <FlexGrowRow flexWrap=\"wrap\" justifyContent=\"start\" gap={2}>\n {report\n ? <JsonViewerEx value={report} />\n : null}\n {children}\n </FlexGrowRow>\n </ModuleCardContent>\n )\n}\n","import type { CardHeaderProps } from '@mui/material'\nimport type { ModuleRenderProps } from '@xyo-network/react-module'\nimport { ModuleCardHeader } from '@xyo-network/react-module'\nimport type { SentinelInstance } from '@xyo-network/sentinel-model'\nimport React from 'react'\n\nexport const SentinelCardHeader: React.FC<ModuleRenderProps<SentinelInstance> & CardHeaderProps> = ({\n title, mod, ...props\n}) => {\n return <ModuleCardHeader mod={mod} title={title ?? mod?.config.name ?? 'Sentinel'} {...props} />\n}\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport type { SentinelContextState } from './State.ts'\n\nexport const SentinelContext = createContextEx<SentinelContextState>()\n","/* eslint-disable unicorn/no-array-push-push */\nimport { useAsyncEffect } from '@xylabs/react-async-effect'\nimport type { AccountInstance } from '@xyo-network/account-model'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport type { ModuleIdentifier } from '@xyo-network/module-model'\nimport { useWitnessesFromNode } from '@xyo-network/react-witness'\nimport { MemorySentinel } from '@xyo-network/sentinel-memory'\nimport type { SentinelConfig } from '@xyo-network/sentinel-model'\nimport { SentinelConfigSchema } from '@xyo-network/sentinel-model'\nimport type { WitnessInstance } from '@xyo-network/witness-model'\nimport { asWitnessInstance } from '@xyo-network/witness-model'\nimport type { PropsWithChildren } from 'react'\nimport React, {\n useEffect, useMemo, useState,\n} from 'react'\n\nimport { SentinelContext } from './Context.ts'\nimport type { SentinelReportProgress } from './State.ts'\nimport { SentinelReportStatus } from './State.ts'\n\nexport interface SentinelProviderProps {\n /** Account used by the sentinel for signing */\n account: AccountInstance\n /** @deprecated - sentinel no longer uses archive but relies on an archivist */\n archive?: string\n archivist?: string\n ids?: ModuleIdentifier[]\n name?: string\n required?: boolean\n witnesses?: WitnessInstance[]\n}\n\nexport const SentinelProvider: React.FC<PropsWithChildren<SentinelProviderProps>> = ({\n account, archivist, children, ids, name, required = false,\n}) => {\n const [sentinel, setSentinel] = useState<MemorySentinel>()\n const [history, setHistory] = useState<BoundWitness[]>()\n const [progress, setProgress] = useState<SentinelReportProgress>({})\n const [status, setStatus] = useState<SentinelReportStatus>(SentinelReportStatus.Idle)\n const [reportingErrors, setReportingErrors] = useState<Error[]>()\n const [witnesses] = useWitnessesFromNode(ids)\n\n useAsyncEffect(\n\n async (mounted) => {\n const sentinel = await MemorySentinel.create({\n account,\n config: {\n archivists: archivist ? [archivist] : undefined,\n name,\n\n schema: SentinelConfigSchema,\n synchronous: true,\n\n tasks: witnesses?.map(mod => ({ mod: mod.address })),\n } as SentinelConfig,\n })\n const offCallbacks: (() => void)[] = []\n offCallbacks.push(\n sentinel.on('reportEnd', ({ mod, outPayloads }) => {\n if (mounted()) {\n setProgress({\n archivists: progress.archivists,\n witnesses: progress.witnesses,\n })\n setStatus(outPayloads?.length ? SentinelReportStatus.Succeeded : SentinelReportStatus.Failed)\n setReportingErrors([new Error(`Witness failed [${mod?.config?.name ?? mod.address}]`)])\n }\n }),\n )\n offCallbacks.push(\n sentinel.on('reportStart', () => {\n if (mounted()) {\n setProgress({ archivists: {}, witnesses: {} })\n setStatus(SentinelReportStatus.Started)\n }\n }),\n )\n if (witnesses)\n for (const witness of witnesses) {\n offCallbacks.push(\n witness.on('observeEnd', ({ mod, outPayloads }) => {\n const witnesses = progress.witnesses ?? {}\n witnesses[witness.address] = {\n status: outPayloads?.length ? SentinelReportStatus.Succeeded : SentinelReportStatus.Failed,\n witness: asWitnessInstance(mod, () => `Module is not a witness [${mod.id}]`),\n }\n if (mounted()) {\n setProgress({\n archivists: progress.archivists,\n witnesses,\n })\n }\n }),\n )\n offCallbacks.push(\n witness.on('observeStart', ({ mod }) => {\n const witnesses = progress.witnesses ?? {}\n witnesses[witness.address] = {\n status: SentinelReportStatus.Started,\n witness: asWitnessInstance(mod, () => `Module is not a witness [${mod.id}]`),\n }\n if (mounted()) {\n setProgress({\n archivists: progress.archivists,\n witnesses,\n })\n }\n }),\n )\n }\n setSentinel(sentinel as MemorySentinel)\n return () => {\n // unsubscribe from events\n for (const callback of offCallbacks) {\n callback()\n }\n }\n },\n\n [account, archivist, witnesses],\n )\n\n useEffect(() => {\n // eslint-disable-next-line @eslint-react/hooks-extra/no-direct-set-state-in-use-effect\n setHistory(sentinel?.history as BoundWitness[])\n }, [sentinel])\n\n const value = useMemo(() => ({\n history, progress, provided: true, reportingErrors, sentinel, status,\n }), [history, progress, reportingErrors, sentinel, status])\n\n return !required || sentinel\n\n ? (\n <SentinelContext.Provider value={value}>\n {children}\n </SentinelContext.Provider>\n )\n : null\n}\n","import type { EnumValue } from '@xylabs/enum'\nimport { Enum } from '@xylabs/enum'\nimport type { ArchivistModuleInstance } from '@xyo-network/archivist-model'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport type { SentinelModule } from '@xyo-network/sentinel-model'\nimport type { WitnessModule } from '@xyo-network/witness-model'\n\nexport const SentinelReportStatus = Enum({\n Idle: 'idle',\n Queued: 'queued',\n Started: 'started',\n Succeeded: 'succeeded',\n Failed: 'failed',\n})\n\nexport type SentinelReportStatus = EnumValue<typeof SentinelReportStatus>\n\nexport interface SentinelWitnessReportProgress {\n status: SentinelReportStatus\n witness: WitnessModule\n}\n\nexport interface SentinelArchivistApiReportProgress {\n archivist: ArchivistModuleInstance\n status: SentinelReportStatus\n}\n\nexport interface SentinelReportProgress {\n archivists?: Record<string, SentinelArchivistApiReportProgress>\n witnesses?: Record<string, SentinelWitnessReportProgress>\n}\n\nexport interface SentinelContextState {\n history?: BoundWitness[]\n progress?: SentinelReportProgress\n reportingErrors?: Error[]\n sentinel?: SentinelModule\n status?: SentinelReportStatus\n}\n","import { useContextEx } from '@xyo-network/react-shared'\n\nimport { SentinelContext } from './Context.ts'\n\nexport const useSentinelContext = () => {\n const {\n sentinel, history, progress, reportingErrors, status,\n } = useContextEx(SentinelContext, 'Sentinel')\n return {\n history, progress, reportingErrors, sentinel, status,\n }\n}\n","import type { ModuleFromNodeConfig } from '@xyo-network/react-node'\nimport { useModuleFromNode } from '@xyo-network/react-node'\nimport type { SentinelInstance } from '@xyo-network/sentinel-model'\nimport { asSentinelInstance } from '@xyo-network/sentinel-model'\n\nexport const useSentinelFromNode = (\n nameOrAddressOrInstance?: string | SentinelInstance,\n config?: ModuleFromNodeConfig,\n): [SentinelInstance | undefined, Error | undefined] => {\n const [mod, error] = useModuleFromNode(nameOrAddressOrInstance, config)\n const instance = asSentinelInstance(mod)\n if (mod && !instance) {\n const error = new Error(`Resolved module is not a SentinelInstance [${mod.config?.schema}:${mod.config?.name}:${mod.address}]`)\n console.error(error.message)\n return [undefined, error]\n }\n return [instance, error]\n}\n","import type { ModuleIdentifier } from '@xyo-network/module-model'\nimport type { ModuleFromNodeConfig } from '@xyo-network/react-node'\nimport { useModulesFromNode } from '@xyo-network/react-node'\nimport type { SentinelInstance } from '@xyo-network/sentinel-model'\nimport { isSentinelInstance } from '@xyo-network/sentinel-model'\n\nexport const useSentinelsFromNode = (\n ids?: ModuleIdentifier[],\n config?: ModuleFromNodeConfig,\n): [SentinelInstance[] | null | undefined, Error | undefined] => {\n const [modules, error] = useModulesFromNode(ids, config)\n if (error) {\n return [null, error]\n }\n return modules\n ? [\n // eslint-disable-next-line unicorn/no-array-reduce\n modules.reduce<SentinelInstance[]>((prev, mod) => {\n if (isSentinelInstance(mod)) {\n prev.push(mod)\n }\n return prev\n }, []),\n undefined,\n ]\n : [modules, error]\n}\n","import type { WeakModuleFromNodeConfig } from '@xyo-network/react-node'\nimport { useWeakModuleFromNode } from '@xyo-network/react-node'\nimport type { SentinelInstance } from '@xyo-network/sentinel-model'\nimport { isSentinelInstance } from '@xyo-network/sentinel-model'\n\nexport const useWeakSentinelFromNode = (\n nameOrAddressOrInstance?: string | SentinelInstance,\n config?: WeakModuleFromNodeConfig,\n): [WeakRef<SentinelInstance> | undefined, Error | undefined] => {\n return useWeakModuleFromNode<SentinelInstance>(nameOrAddressOrInstance, { identity: isSentinelInstance, ...config })\n}\n","import { exists } from '@xylabs/exists'\nimport type { ModuleIdentifier } from '@xyo-network/module-model'\nimport type { ModuleFromNodeConfig } from '@xyo-network/react-node'\nimport { useWeakModulesFromNode } from '@xyo-network/react-node'\nimport type { SentinelInstance } from '@xyo-network/sentinel-model'\nimport { asSentinelInstance } from '@xyo-network/sentinel-model'\n\nexport const useWeakSentinelsFromNode = (\n ids?: ModuleIdentifier[],\n config?: ModuleFromNodeConfig,\n): [WeakRef<SentinelInstance>[] | null | undefined, Error | undefined] => {\n const [modules, error] = useWeakModulesFromNode(ids, config)\n if (error) {\n return [null, error]\n }\n return [\n modules\n ?.map((mod) => {\n const instance = asSentinelInstance(mod?.deref())\n if (instance) {\n return new WeakRef(instance)\n }\n })\n .filter(exists) ?? [],\n undefined,\n ]\n}\n"],"mappings":";;;;AACA,SAASA,YAAY;AACrB,SAASC,kBAAkB;AAI3B,OAAOC,UAASC,gBAAgB;;;ACLhC,SAASC,gBAAgB;AAEzB,SAASC,yBAAyB;AAElC,OAAOC,WAAW;AAOX,IAAMC,sBAA0D,wBAAC,EACtEC,UAAUC,KAAK,GAAGC,MAAAA,MACnB;AACC,SACE,sBAAA,cAACC,mBAAAA;IAAkBF;IAAW,GAAGC;KAC/B,sBAAA,cAACE,UAAAA;IAASC,SAAS,6BAAML,WAAWC,GAAAA,GAAjB;IAAuBK,MAAK;IAAQC,SAAQ;KAAW,QAAA,CAAA;AAKhF,GAVuE;;;ACXvE,SAASC,mBAAmB;AAG5B,SAASC,yBAAyB;AAClC,SAASC,oBAAoB;AAE7B,OAAOC,YAAW;AAOX,IAAMC,sBAA0D,wBAAC,EACtEC,UAAUC,QAAQC,KAAK,GAAGC,MAAAA,MAC3B;AACC,SACE,gBAAAC,OAAA,cAACC,mBAAAA;IAAkBH;IAAW,GAAGC;KAC/B,gBAAAC,OAAA,cAACE,aAAAA;IAAYC,UAAS;IAAOC,gBAAe;IAAQC,KAAK;KACtDR,SACG,gBAAAG,OAAA,cAACM,cAAAA;IAAaC,OAAOV;OACrB,MACHD,QAAAA,CAAAA;AAIT,GAbuE;;;ACZvE,SAASY,wBAAwB;AAEjC,OAAOC,YAAW;AAEX,IAAMC,qBAAsF,wBAAC,EAClGC,OAAOC,KAAK,GAAGC,MAAAA,MAChB;AACC,SAAO,gBAAAC,OAAA,cAACC,kBAAAA;IAAiBH;IAAUD,OAAOA,SAASC,KAAKI,OAAOC,QAAQ;IAAa,GAAGJ;;AACzF,GAJmG;;;AHW5F,IAAMK,eAA4C,wBAAC,EACxDC,UAAUC,YAAYC,KAAK,GAA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F,UAAU;AACZ,eAAO,IAAIG,QAAQH,QAAAA;MACrB;IACF,CAAA,EACCI,OAAOC,MAAAA,KAAW,CAAA;IACrBC;;AAEJ,GAnBwC;","names":["Card","usePromise","React","useState","ButtonEx","ModuleCardActions","React","SentinelCardActions","onReport","mod","props","ModuleCardActions","ButtonEx","onClick","size","variant","FlexGrowRow","ModuleCardContent","JsonViewerEx","React","SentinelCardContent","children","report","mod","props","React","ModuleCardContent","FlexGrowRow","flexWrap","justifyContent","gap","JsonViewerEx","value","ModuleCardHeader","React","SentinelCardHeader","title","mod","props","React","ModuleCardHeader","config","name","SentinelCard","children","inPayloads","mod","props","retry","setRetry","useState","report","usePromise","React","Card","SentinelCardHeader","SentinelCardContent","SentinelCardActions","onReport","createContextEx","SentinelContext","useAsyncEffect","useWitnessesFromNode","MemorySentinel","SentinelConfigSchema","asWitnessInstance","React","useEffect","useMemo","useState","Enum","SentinelReportStatus","Idle","Queued","Started","Succeeded","Failed","SentinelProvider","account","archivist","children","ids","name","required","sentinel","setSentinel","useState","history","setHistory","progress","setProgress","status","setStatus","SentinelReportStatus","Idle","reportingErrors","setReportingErrors","witnesses","useWitnessesFromNode","useAsyncEffect","mounted","MemorySentinel","create","config","archivists","undefined","schema","SentinelConfigSchema","synchronous","tasks","map","mod","address","offCallbacks","push","on","outPayloads","length","Succeeded","Failed","Error","Started","witness","asWitnessInstance","id","callback","useEffect","value","useMemo","provided","React","SentinelContext","Provider","useContextEx","useSentinelContext","sentinel","history","progress","reportingErrors","status","useContextEx","SentinelContext","useModuleFromNode","asSentinelInstance","useSentinelFromNode","nameOrAddressOrInstance","config","mod","error","useModuleFromNode","instance","asSentinelInstance","Error","schema","name","address","console","message","undefined","useModulesFromNode","isSentinelInstance","useSentinelsFromNode","ids","config","modules","error","useModulesFromNode","reduce","prev","mod","isSentinelInstance","push","undefined","useWeakModuleFromNode","isSentinelInstance","useWeakSentinelFromNode","nameOrAddressOrInstance","config","useWeakModuleFromNode","identity","isSentinelInstance","exists","useWeakModulesFromNode","asSentinelInstance","useWeakSentinelsFromNode","ids","config","modules","error","useWeakModulesFromNode","map","mod","instance","asSentinelInstance","deref","WeakRef","filter","exists","undefined"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/react-sentinel",
3
- "version": "4.4.2",
3
+ "version": "4.4.4",
4
4
  "description": "Common React library for all XYO projects that use React",
5
5
  "keywords": [
6
6
  "xyo",
@@ -45,41 +45,41 @@
45
45
  "dependencies": {
46
46
  "@xylabs/enum": "^4.5.1",
47
47
  "@xylabs/exists": "^4.5.1",
48
- "@xylabs/react-async-effect": "^5.3.22",
49
- "@xylabs/react-button": "^5.3.22",
50
- "@xylabs/react-flexbox": "^5.3.22",
51
- "@xylabs/react-promise": "^5.3.22",
52
- "@xyo-network/account-model": "^3.7.1",
53
- "@xyo-network/archivist-model": "^3.7.1",
54
- "@xyo-network/boundwitness-model": "^3.7.1",
55
- "@xyo-network/module-model": "^3.7.1",
56
- "@xyo-network/payload-model": "^3.7.1",
57
- "@xyo-network/react-module": "^4.4.2",
58
- "@xyo-network/react-node": "^4.4.2",
59
- "@xyo-network/react-payload-raw-info": "^4.4.2",
60
- "@xyo-network/react-shared": "^4.4.2",
61
- "@xyo-network/react-witness": "^4.4.2",
62
- "@xyo-network/sentinel-memory": "^3.7.1",
63
- "@xyo-network/sentinel-model": "^3.7.1",
64
- "@xyo-network/witness-model": "^3.7.1"
48
+ "@xylabs/react-async-effect": "^5.3.23",
49
+ "@xylabs/react-button": "^5.3.23",
50
+ "@xylabs/react-flexbox": "^5.3.23",
51
+ "@xylabs/react-promise": "^5.3.23",
52
+ "@xyo-network/account-model": "^3.9.2",
53
+ "@xyo-network/archivist-model": "^3.9.2",
54
+ "@xyo-network/boundwitness-model": "^3.9.2",
55
+ "@xyo-network/module-model": "^3.9.2",
56
+ "@xyo-network/payload-model": "^3.9.2",
57
+ "@xyo-network/react-module": "^4.4.4",
58
+ "@xyo-network/react-node": "^4.4.4",
59
+ "@xyo-network/react-payload-raw-info": "^4.4.4",
60
+ "@xyo-network/react-shared": "^4.4.4",
61
+ "@xyo-network/react-witness": "^4.4.4",
62
+ "@xyo-network/sentinel-memory": "^3.9.2",
63
+ "@xyo-network/sentinel-model": "^3.9.2",
64
+ "@xyo-network/witness-model": "^3.9.2"
65
65
  },
66
66
  "devDependencies": {
67
67
  "@emotion/react": "^11.14.0",
68
68
  "@emotion/styled": "^11.14.0",
69
- "@mui/icons-material": "^6.4.1",
70
- "@mui/material": "^6.4.1",
71
- "@mui/styles": "^6.4.1",
72
- "@storybook/react": "^8.5.2",
73
- "@xylabs/ts-scripts-yarn3": "^4.2.6",
74
- "@xylabs/tsconfig-react": "^4.2.6",
75
- "@xyo-network/account": "^3.7.1",
76
- "@xyo-network/evm-call-witness": "^3.3.0",
77
- "@xyo-network/manifest": "^3.7.1",
78
- "@xyo-network/module-factory-locator": "^3.7.1",
69
+ "@mui/icons-material": "^6.4.4",
70
+ "@mui/material": "^6.4.4",
71
+ "@mui/styles": "^6.4.4",
72
+ "@storybook/react": "^8.5.5",
73
+ "@xylabs/ts-scripts-yarn3": "^5.0.24",
74
+ "@xylabs/tsconfig-react": "^5.0.24",
75
+ "@xyo-network/account": "^3.9.2",
76
+ "@xyo-network/evm-call-witness": "^3.4.1",
77
+ "@xyo-network/manifest": "^3.9.2",
78
+ "@xyo-network/module-factory-locator": "^3.9.2",
79
79
  "ethers": "^6.13.5",
80
80
  "react": "^18.3.1",
81
81
  "react-dom": "^18.3.1",
82
- "storybook": "^8.5.2",
82
+ "storybook": "^8.5.5",
83
83
  "typescript": "^5.7.3"
84
84
  },
85
85
  "peerDependencies": {
@@ -1,6 +1,6 @@
1
1
  import type { EnumValue } from '@xylabs/enum'
2
2
  import { Enum } from '@xylabs/enum'
3
- import type { ArchivistModule } from '@xyo-network/archivist-model'
3
+ import type { ArchivistModuleInstance } from '@xyo-network/archivist-model'
4
4
  import type { BoundWitness } from '@xyo-network/boundwitness-model'
5
5
  import type { SentinelModule } from '@xyo-network/sentinel-model'
6
6
  import type { WitnessModule } from '@xyo-network/witness-model'
@@ -21,7 +21,7 @@ export interface SentinelWitnessReportProgress {
21
21
  }
22
22
 
23
23
  export interface SentinelArchivistApiReportProgress {
24
- archivist: ArchivistModule
24
+ archivist: ArchivistModuleInstance
25
25
  status: SentinelReportStatus
26
26
  }
27
27
 
@@ -1,10 +0,0 @@
1
- import type { CardProps } from '@mui/material';
2
- import type { Payload } from '@xyo-network/payload-model';
3
- import type { ModuleRenderProps } from '@xyo-network/react-module';
4
- import type { SentinelInstance } from '@xyo-network/sentinel-model';
5
- import React from 'react';
6
- export type SentinelCardProps = CardProps & ModuleRenderProps<SentinelInstance> & {
7
- inPayloads?: Payload[];
8
- };
9
- export declare const SentinelCard: React.FC<SentinelCardProps>;
10
- //# sourceMappingURL=Card.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,KAAmB,MAAM,OAAO,CAAA;AAMvC,MAAM,MAAM,iBAAiB,GAAG,SAAS,GACvC,iBAAiB,CAAC,gBAAgB,CAAC,GAAG;IACpC,UAAU,CAAC,EAAE,OAAO,EAAE,CAAA;CACvB,CAAA;AAEH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAiBpD,CAAA"}
@@ -1,9 +0,0 @@
1
- import type { CardActionsProps } from '@mui/material';
2
- import type { ModuleRenderProps } from '@xyo-network/react-module';
3
- import type { SentinelInstance } from '@xyo-network/sentinel-model';
4
- import React from 'react';
5
- export type SentinelCardActionsProps = ModuleRenderProps<SentinelInstance> & CardActionsProps & {
6
- onReport?: (mod?: SentinelInstance) => void;
7
- };
8
- export declare const SentinelCardActions: React.FC<SentinelCardActionsProps>;
9
- //# sourceMappingURL=CardActions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CardActions.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/CardActions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAErD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAElE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,MAAM,wBAAwB,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,GACxE,gBAAgB,GAAG;IACjB,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAA;CAC5C,CAAA;AAEH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAUlE,CAAA"}
@@ -1,10 +0,0 @@
1
- import type { CardContentProps } from '@mui/material';
2
- import type { Payload } from '@xyo-network/payload-model';
3
- import type { ModuleRenderProps } from '@xyo-network/react-module';
4
- import type { SentinelInstance } from '@xyo-network/sentinel-model';
5
- import React from 'react';
6
- export type SentinelCardContentProps = ModuleRenderProps<SentinelInstance> & CardContentProps & {
7
- report?: Payload[];
8
- };
9
- export declare const SentinelCardContent: React.FC<SentinelCardContentProps>;
10
- //# sourceMappingURL=CardContent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CardContent.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/CardContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAErD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAGlE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,MAAM,wBAAwB,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,GACxE,gBAAgB,GAAG;IACjB,MAAM,CAAC,EAAE,OAAO,EAAE,CAAA;CACnB,CAAA;AAEH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAalE,CAAA"}
@@ -1,6 +0,0 @@
1
- import type { CardHeaderProps } from '@mui/material';
2
- import type { ModuleRenderProps } from '@xyo-network/react-module';
3
- import type { SentinelInstance } from '@xyo-network/sentinel-model';
4
- import React from 'react';
5
- export declare const SentinelCardHeader: React.FC<ModuleRenderProps<SentinelInstance> & CardHeaderProps>;
6
- //# sourceMappingURL=CardHeader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CardHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/CardHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAElE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,GAAG,eAAe,CAI9F,CAAA"}
@@ -1,4 +0,0 @@
1
- export * from './Card.tsx';
2
- export * from './CardContent.tsx';
3
- export * from './CardHeader.tsx';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA"}
@@ -1,2 +0,0 @@
1
- export { default as NftSentinelManifest } from './NftSentinel.json';
2
- //# sourceMappingURL=manifest.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,oBAAoB,CAAwB"}
@@ -1,2 +0,0 @@
1
- export * from './Card/index.ts';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
@@ -1,3 +0,0 @@
1
- import type { SentinelContextState } from './State.ts';
2
- export declare const SentinelContext: import("react").Context<SentinelContextState & import("@xyo-network/react-shared").ContextExState>;
3
- //# sourceMappingURL=Context.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../src/contexts/Context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEtD,eAAO,MAAM,eAAe,oGAA0C,CAAA"}
@@ -1,18 +0,0 @@
1
- import type { AccountInstance } from '@xyo-network/account-model';
2
- import type { ModuleIdentifier } from '@xyo-network/module-model';
3
- import type { WitnessInstance } from '@xyo-network/witness-model';
4
- import type { PropsWithChildren } from 'react';
5
- import React from 'react';
6
- export interface SentinelProviderProps {
7
- /** Account used by the sentinel for signing */
8
- account: AccountInstance;
9
- /** @deprecated - sentinel no longer uses archive but relies on an archivist */
10
- archive?: string;
11
- archivist?: string;
12
- ids?: ModuleIdentifier[];
13
- name?: string;
14
- required?: boolean;
15
- witnesses?: WitnessInstance[];
16
- }
17
- export declare const SentinelProvider: React.FC<PropsWithChildren<SentinelProviderProps>>;
18
- //# sourceMappingURL=Provider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../src/contexts/Provider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAEjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAKjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAEjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,KAEN,MAAM,OAAO,CAAA;AAMd,MAAM,WAAW,qBAAqB;IACpC,+CAA+C;IAC/C,OAAO,EAAE,eAAe,CAAA;IACxB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,GAAG,CAAC,EAAE,gBAAgB,EAAE,CAAA;IACxB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,eAAe,EAAE,CAAA;CAC9B;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,qBAAqB,CAAC,CA4G/E,CAAA"}
@@ -1,34 +0,0 @@
1
- import type { EnumValue } from '@xylabs/enum';
2
- import { Enum } from '@xylabs/enum';
3
- import type { ArchivistModule } from '@xyo-network/archivist-model';
4
- import type { BoundWitness } from '@xyo-network/boundwitness-model';
5
- import type { SentinelModule } from '@xyo-network/sentinel-model';
6
- import type { WitnessModule } from '@xyo-network/witness-model';
7
- export declare const SentinelReportStatus: Enum<{
8
- Idle: "idle";
9
- Queued: "queued";
10
- Started: "started";
11
- Succeeded: "succeeded";
12
- Failed: "failed";
13
- }>;
14
- export type SentinelReportStatus = EnumValue<typeof SentinelReportStatus>;
15
- export interface SentinelWitnessReportProgress {
16
- status: SentinelReportStatus;
17
- witness: WitnessModule;
18
- }
19
- export interface SentinelArchivistApiReportProgress {
20
- archivist: ArchivistModule;
21
- status: SentinelReportStatus;
22
- }
23
- export interface SentinelReportProgress {
24
- archivists?: Record<string, SentinelArchivistApiReportProgress>;
25
- witnesses?: Record<string, SentinelWitnessReportProgress>;
26
- }
27
- export interface SentinelContextState {
28
- history?: BoundWitness[];
29
- progress?: SentinelReportProgress;
30
- reportingErrors?: Error[];
31
- sentinel?: SentinelModule;
32
- status?: SentinelReportStatus;
33
- }
34
- //# sourceMappingURL=State.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"State.d.ts","sourceRoot":"","sources":["../../../src/contexts/State.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE/D,eAAO,MAAM,oBAAoB;;;;;;EAM/B,CAAA;AAEF,MAAM,MAAM,oBAAoB,GAAG,SAAS,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEzE,MAAM,WAAW,6BAA6B;IAC5C,MAAM,EAAE,oBAAoB,CAAA;IAC5B,OAAO,EAAE,aAAa,CAAA;CACvB;AAED,MAAM,WAAW,kCAAkC;IACjD,SAAS,EAAE,eAAe,CAAA;IAC1B,MAAM,EAAE,oBAAoB,CAAA;CAC7B;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,kCAAkC,CAAC,CAAA;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,6BAA6B,CAAC,CAAA;CAC1D;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;IACxB,QAAQ,CAAC,EAAE,sBAAsB,CAAA;IACjC,eAAe,CAAC,EAAE,KAAK,EAAE,CAAA;IACzB,QAAQ,CAAC,EAAE,cAAc,CAAA;IACzB,MAAM,CAAC,EAAE,oBAAoB,CAAA;CAC9B"}
@@ -1,5 +0,0 @@
1
- export * from './Context.ts';
2
- export * from './Provider.tsx';
3
- export * from './State.ts';
4
- export * from './use.ts';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA"}
@@ -1,151 +0,0 @@
1
- export declare const useSentinelContext: () => {
2
- history: import("@xyo-network/boundwitness-model").BoundWitness[] | undefined;
3
- progress: import("./State.ts").SentinelReportProgress | undefined;
4
- reportingErrors: Error[] | undefined;
5
- sentinel: import("@xyo-network/sentinel-model").SentinelModule<import("@xylabs/object").BaseParamsFields & {
6
- account?: import("@xyo-network/account-model").AccountInstance | "random";
7
- addToResolvers?: boolean;
8
- additionalSigners?: import("@xyo-network/account-model").AccountInstance[];
9
- allowNameResolution?: boolean;
10
- config: import("@xylabs/object").DeepRestrictToStringKeys<{
11
- schema: import("@xyo-network/payload-model").Schema;
12
- readonly archiving?: {
13
- readonly archivists?: string[] | undefined;
14
- readonly queries?: string[] | undefined;
15
- } | undefined;
16
- readonly allowedQueries?: string[] | undefined;
17
- readonly archivist?: import("@xyo-network/module-model").ModuleIdentifier | undefined;
18
- readonly consoleLogger?: import("@xylabs/logger").LogLevel | undefined;
19
- readonly labels?: {
20
- [x: string]: string | undefined;
21
- } | undefined;
22
- readonly name?: import("@xyo-network/module-model").ModuleName | undefined;
23
- readonly paging?: {
24
- [x: string]: {
25
- size?: number | undefined;
26
- };
27
- } | undefined;
28
- readonly retry?: {
29
- backoff?: number | undefined;
30
- interval?: number | undefined;
31
- retries?: number | undefined;
32
- } | undefined;
33
- readonly security?: {
34
- readonly allowAnonymous?: boolean | undefined;
35
- readonly allowed?: {
36
- [x: string]: (Lowercase<string> | Lowercase<string>[])[];
37
- } | undefined;
38
- readonly disallowed?: {
39
- [x: string]: Lowercase<string>[];
40
- } | undefined;
41
- } | undefined;
42
- readonly sign?: boolean | undefined;
43
- readonly storeQueries?: boolean | undefined;
44
- readonly timestamp?: boolean | undefined;
45
- automations?: ({
46
- schema: "network.xyo.automation.interval";
47
- type: "interval";
48
- end?: number | undefined;
49
- frequency?: number | undefined;
50
- frequencyUnits?: "second" | "minute" | "hour" | "day" | "millis" | undefined;
51
- remaining?: number | undefined;
52
- start: number;
53
- } | {
54
- schema: "network.xyo.automation.event";
55
- type: "interval";
56
- end?: number | undefined;
57
- frequency?: number | undefined;
58
- frequencyUnits?: "second" | "minute" | "hour" | "day" | "millis" | undefined;
59
- remaining?: number | undefined;
60
- start: number;
61
- } | {
62
- schema: "network.xyo.automation";
63
- type: "interval";
64
- end?: number | undefined;
65
- frequency?: number | undefined;
66
- frequencyUnits?: "second" | "minute" | "hour" | "day" | "millis" | undefined;
67
- remaining?: number | undefined;
68
- start: number;
69
- } | {
70
- schema: "network.xyo.automation.interval";
71
- type: "event";
72
- } | {
73
- schema: "network.xyo.automation.event";
74
- type: "event";
75
- } | {
76
- schema: "network.xyo.automation";
77
- type: "event";
78
- })[] | undefined;
79
- synchronous?: boolean | undefined;
80
- tasks: ({
81
- endPoint?: "observe" | undefined;
82
- input?: string | boolean | string[] | undefined;
83
- mod: import("@xyo-network/module-model").ModuleIdentifier;
84
- required?: boolean | undefined;
85
- } | {
86
- endPoint?: "divine" | undefined;
87
- input?: string | boolean | string[] | undefined;
88
- mod: import("@xyo-network/module-model").ModuleIdentifier;
89
- required?: boolean | undefined;
90
- } | {
91
- endPoint?: "clear" | "all" | "commit" | "delete" | "get" | "insert" | undefined;
92
- input?: string | boolean | string[] | undefined;
93
- mod: import("@xyo-network/module-model").ModuleIdentifier;
94
- required?: boolean | undefined;
95
- } | {
96
- endPoint?: string | undefined;
97
- input?: string | boolean | string[] | undefined;
98
- mod: import("@xyo-network/module-model").ModuleIdentifier;
99
- required?: boolean | undefined;
100
- })[];
101
- throwErrors?: boolean | undefined;
102
- }>;
103
- ephemeralQueryAccountEnabled?: boolean;
104
- moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
105
- }, import("@xyo-network/sentinel-model").SentinelModuleEventData<import("@xyo-network/module-model").Module<import("@xylabs/object").BaseParamsFields & {
106
- account?: import("@xyo-network/account-model").AccountInstance | "random";
107
- addToResolvers?: boolean;
108
- additionalSigners?: import("@xyo-network/account-model").AccountInstance[];
109
- allowNameResolution?: boolean;
110
- config: import("@xylabs/object").DeepRestrictToStringKeys<{
111
- schema: import("@xyo-network/payload-model").Schema;
112
- readonly archiving?: {
113
- readonly archivists?: string[] | undefined;
114
- readonly queries?: string[] | undefined;
115
- } | undefined;
116
- readonly allowedQueries?: string[] | undefined;
117
- readonly archivist?: import("@xyo-network/module-model").ModuleIdentifier | undefined;
118
- readonly consoleLogger?: import("@xylabs/logger").LogLevel | undefined;
119
- readonly labels?: {
120
- [x: string]: string | undefined;
121
- } | undefined;
122
- readonly name?: import("@xyo-network/module-model").ModuleName | undefined;
123
- readonly paging?: {
124
- [x: string]: {
125
- size?: number | undefined;
126
- };
127
- } | undefined;
128
- readonly retry?: {
129
- backoff?: number | undefined;
130
- interval?: number | undefined;
131
- retries?: number | undefined;
132
- } | undefined;
133
- readonly security?: {
134
- readonly allowAnonymous?: boolean | undefined;
135
- readonly allowed?: {
136
- [x: string]: (Lowercase<string> | Lowercase<string>[])[];
137
- } | undefined;
138
- readonly disallowed?: {
139
- [x: string]: Lowercase<string>[];
140
- } | undefined;
141
- } | undefined;
142
- readonly sign?: boolean | undefined;
143
- readonly storeQueries?: boolean | undefined;
144
- readonly timestamp?: boolean | undefined;
145
- }>;
146
- ephemeralQueryAccountEnabled?: boolean;
147
- moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
148
- }, import("@xyo-network/module-model").ModuleEventData<object>>>> | undefined;
149
- status: import("./State.ts").SentinelReportStatus | undefined;
150
- };
151
- //# sourceMappingURL=use.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use.d.ts","sourceRoot":"","sources":["../../../src/contexts/use.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAO9B,CAAA"}
@@ -1,2 +0,0 @@
1
- export * from './node/index.ts';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
@@ -1,5 +0,0 @@
1
- export * from './useSentinelFromNode.tsx';
2
- export * from './useSentinelsFromNode.tsx';
3
- export * from './useWeakSentinelFromNode.tsx';
4
- export * from './useWeakSentinelsFromNode.tsx';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/node/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA;AACzC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,gCAAgC,CAAA"}
@@ -1,4 +0,0 @@
1
- import type { ModuleFromNodeConfig } from '@xyo-network/react-node';
2
- import type { SentinelInstance } from '@xyo-network/sentinel-model';
3
- export declare const useSentinelFromNode: (nameOrAddressOrInstance?: string | SentinelInstance, config?: ModuleFromNodeConfig) => [SentinelInstance | undefined, Error | undefined];
4
- //# sourceMappingURL=useSentinelFromNode.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useSentinelFromNode.d.ts","sourceRoot":"","sources":["../../../../src/hooks/node/useSentinelFromNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAEnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAGnE,eAAO,MAAM,mBAAmB,6BACJ,MAAM,GAAG,gBAAgB,WAC1C,oBAAoB,KAC5B,CAAC,gBAAgB,GAAG,SAAS,EAAE,KAAK,GAAG,SAAS,CASlD,CAAA"}
@@ -1,5 +0,0 @@
1
- import type { ModuleIdentifier } from '@xyo-network/module-model';
2
- import type { ModuleFromNodeConfig } from '@xyo-network/react-node';
3
- import type { SentinelInstance } from '@xyo-network/sentinel-model';
4
- export declare const useSentinelsFromNode: (ids?: ModuleIdentifier[], config?: ModuleFromNodeConfig) => [SentinelInstance[] | null | undefined, Error | undefined];
5
- //# sourceMappingURL=useSentinelsFromNode.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useSentinelsFromNode.d.ts","sourceRoot":"","sources":["../../../../src/hooks/node/useSentinelsFromNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAEnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAGnE,eAAO,MAAM,oBAAoB,SACzB,gBAAgB,EAAE,WACf,oBAAoB,KAC5B,CAAC,gBAAgB,EAAE,GAAG,IAAI,GAAG,SAAS,EAAE,KAAK,GAAG,SAAS,CAiB3D,CAAA"}
@@ -1,4 +0,0 @@
1
- import type { WeakModuleFromNodeConfig } from '@xyo-network/react-node';
2
- import type { SentinelInstance } from '@xyo-network/sentinel-model';
3
- export declare const useWeakSentinelFromNode: (nameOrAddressOrInstance?: string | SentinelInstance, config?: WeakModuleFromNodeConfig) => [WeakRef<SentinelInstance> | undefined, Error | undefined];
4
- //# sourceMappingURL=useWeakSentinelFromNode.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useWeakSentinelFromNode.d.ts","sourceRoot":"","sources":["../../../../src/hooks/node/useWeakSentinelFromNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AAEvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAGnE,eAAO,MAAM,uBAAuB,6BACR,MAAM,GAAG,gBAAgB,WAC1C,wBAAwB,KAChC,CAAC,OAAO,CAAC,gBAAgB,CAAC,GAAG,SAAS,EAAE,KAAK,GAAG,SAAS,CAE3D,CAAA"}
@@ -1,5 +0,0 @@
1
- import type { ModuleIdentifier } from '@xyo-network/module-model';
2
- import type { ModuleFromNodeConfig } from '@xyo-network/react-node';
3
- import type { SentinelInstance } from '@xyo-network/sentinel-model';
4
- export declare const useWeakSentinelsFromNode: (ids?: ModuleIdentifier[], config?: ModuleFromNodeConfig) => [WeakRef<SentinelInstance>[] | null | undefined, Error | undefined];
5
- //# sourceMappingURL=useWeakSentinelsFromNode.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useWeakSentinelsFromNode.d.ts","sourceRoot":"","sources":["../../../../src/hooks/node/useWeakSentinelsFromNode.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAEnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAGnE,eAAO,MAAM,wBAAwB,SAC7B,gBAAgB,EAAE,WACf,oBAAoB,KAC5B,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,GAAG,IAAI,GAAG,SAAS,EAAE,KAAK,GAAG,SAAS,CAgBpE,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA"}