@xyo-network/react-sentinel 4.4.10 → 5.0.0-rc.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/browser/index.mjs +1 -1
- package/dist/browser/index.mjs.map +1 -1
- package/dist/types/components/Card/Card.d.ts +10 -0
- package/dist/types/components/Card/Card.d.ts.map +1 -0
- package/dist/types/components/Card/CardActions.d.ts +9 -0
- package/dist/types/components/Card/CardActions.d.ts.map +1 -0
- package/dist/types/components/Card/CardContent.d.ts +10 -0
- package/dist/types/components/Card/CardContent.d.ts.map +1 -0
- package/dist/types/components/Card/CardHeader.d.ts +6 -0
- package/dist/types/components/Card/CardHeader.d.ts.map +1 -0
- package/dist/types/components/Card/index.d.ts +4 -0
- package/dist/types/components/Card/index.d.ts.map +1 -0
- package/dist/types/components/Card/manifest.d.ts +2 -0
- package/dist/types/components/Card/manifest.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/index.d.ts.map +1 -0
- package/dist/types/contexts/Context.d.ts +3 -0
- package/dist/types/contexts/Context.d.ts.map +1 -0
- package/dist/types/contexts/Provider.d.ts +18 -0
- package/dist/types/contexts/Provider.d.ts.map +1 -0
- package/dist/types/contexts/State.d.ts +34 -0
- package/dist/types/contexts/State.d.ts.map +1 -0
- package/dist/types/contexts/index.d.ts +5 -0
- package/dist/types/contexts/index.d.ts.map +1 -0
- package/dist/types/contexts/use.d.ts +28 -0
- package/dist/types/contexts/use.d.ts.map +1 -0
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/index.d.ts.map +1 -0
- package/dist/types/hooks/node/index.d.ts +5 -0
- package/dist/types/hooks/node/index.d.ts.map +1 -0
- package/dist/types/hooks/node/useSentinelFromNode.d.ts +4 -0
- package/dist/types/hooks/node/useSentinelFromNode.d.ts.map +1 -0
- package/dist/types/hooks/node/useSentinelsFromNode.d.ts +5 -0
- package/dist/types/hooks/node/useSentinelsFromNode.d.ts.map +1 -0
- package/dist/types/hooks/node/useWeakSentinelFromNode.d.ts +4 -0
- package/dist/types/hooks/node/useWeakSentinelFromNode.d.ts.map +1 -0
- package/dist/types/hooks/node/useWeakSentinelsFromNode.d.ts +5 -0
- package/dist/types/hooks/node/useWeakSentinelsFromNode.d.ts.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +41 -39
- package/src/contexts/Provider.tsx +2 -2
- package/dist/browser/index.d.ts +0 -110
package/dist/browser/index.mjs
CHANGED
|
@@ -198,7 +198,7 @@ var SentinelProvider = /* @__PURE__ */ __name(({ account, archivist, children, i
|
|
|
198
198
|
sentinel,
|
|
199
199
|
status
|
|
200
200
|
]);
|
|
201
|
-
return !required || sentinel ? /* @__PURE__ */ React5.createElement(SentinelContext
|
|
201
|
+
return !required || sentinel ? /* @__PURE__ */ React5.createElement(SentinelContext, {
|
|
202
202
|
value
|
|
203
203
|
}, children) : null;
|
|
204
204
|
}, "SentinelProvider");
|
|
@@ -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 { 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;KAC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IAAEG,UAAUC;IAAoB,GAAGH;EAAO,CAAA;AACpH,GALuC;;;ACLvC,SAASI,cAAc;AAGvB,SAASC,8BAA8B;AAEvC,SAASC,sBAAAA,2BAA0B;AAE5B,IAAMC,2BAA2B,wBACtCC,KACAC,WAAAA;AAEA,QAAM,CAACC,SAASC,KAAAA,IAASC,uBAAuBJ,KAAKC,MAAAA;AACrD,MAAIE,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 value={value}>\n {children}\n </SentinelContext>\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,IAAM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tCC,KACAC,WAAAA;AAEA,QAAM,CAACC,SAASC,KAAAA,IAASC,uBAAuBJ,KAAKC,MAAAA;AACrD,MAAIE,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","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"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,6 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { EnumValue } from '@xylabs/enum';
|
|
2
|
+
import { Enum } from '@xylabs/enum';
|
|
3
|
+
import type { ArchivistModuleInstance } 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: ArchivistModuleInstance;
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,uBAAuB,EAAE,MAAM,8BAA8B,CAAA;AAC3E,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,uBAAuB,CAAA;IAClC,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"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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("@xyo-network/module-model").AnyConfigSchema<import("@xyo-network/sentinel-model").SentinelConfig>;
|
|
11
|
+
ephemeralQueryAccountEnabled?: boolean;
|
|
12
|
+
moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
|
|
13
|
+
privateChildren?: import("@xyo-network/module-model").ModuleInstance[];
|
|
14
|
+
publicChildren?: import("@xyo-network/module-model").ModuleInstance[];
|
|
15
|
+
}, import("@xyo-network/sentinel-model").SentinelModuleEventData<import("@xyo-network/module-model").Module<import("@xylabs/object").BaseParamsFields & {
|
|
16
|
+
account?: import("@xyo-network/account-model").AccountInstance | "random";
|
|
17
|
+
addToResolvers?: boolean;
|
|
18
|
+
additionalSigners?: import("@xyo-network/account-model").AccountInstance[];
|
|
19
|
+
allowNameResolution?: boolean;
|
|
20
|
+
config: import("@xyo-network/module-model").AnyConfigSchema<import("@xyo-network/module-model").ModuleConfig>;
|
|
21
|
+
ephemeralQueryAccountEnabled?: boolean;
|
|
22
|
+
moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
|
|
23
|
+
privateChildren?: import("@xyo-network/module-model").ModuleInstance[];
|
|
24
|
+
publicChildren?: import("@xyo-network/module-model").ModuleInstance[];
|
|
25
|
+
}, import("@xyo-network/module-model").ModuleEventData<object>>>> | undefined;
|
|
26
|
+
status: import("./State.ts").SentinelReportStatus | undefined;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=use.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use.d.ts","sourceRoot":"","sources":["../../../src/contexts/use.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;CAO9B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,4 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,GAC9B,0BAA0B,MAAM,GAAG,gBAAgB,EACnD,SAAS,oBAAoB,KAC5B,CAAC,gBAAgB,GAAG,SAAS,EAAE,KAAK,GAAG,SAAS,CASlD,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,GAC/B,MAAM,gBAAgB,EAAE,EACxB,SAAS,oBAAoB,KAC5B,CAAC,gBAAgB,EAAE,GAAG,IAAI,GAAG,SAAS,EAAE,KAAK,GAAG,SAAS,CAiB3D,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,GAClC,0BAA0B,MAAM,GAAG,gBAAgB,EACnD,SAAS,wBAAwB,KAChC,CAAC,OAAO,CAAC,gBAAgB,CAAC,GAAG,SAAS,EAAE,KAAK,GAAG,SAAS,CAE3D,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,GACnC,MAAM,gBAAgB,EAAE,EACxB,SAAS,oBAAoB,KAC5B,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,GAAG,IAAI,GAAG,SAAS,EAAE,KAAK,GAAG,SAAS,CAgBpE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/react-sentinel",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-rc.1",
|
|
4
4
|
"description": "Common React library for all XYO projects that use React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"xyo",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"exports": {
|
|
29
29
|
".": {
|
|
30
30
|
"browser": {
|
|
31
|
-
"types": "./dist/
|
|
31
|
+
"types": "./dist/types/index.d.ts",
|
|
32
32
|
"default": "./dist/browser/index.mjs"
|
|
33
33
|
},
|
|
34
|
-
"types": "./dist/
|
|
34
|
+
"types": "./dist/types/index.d.ts",
|
|
35
35
|
"default": "./dist/browser/index.mjs"
|
|
36
36
|
},
|
|
37
37
|
"./package.json": "./package.json"
|
|
@@ -43,44 +43,45 @@
|
|
|
43
43
|
"lint-pkg": "npmPkgJsonLint ."
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@xylabs/enum": "^4.5.
|
|
47
|
-
"@xylabs/exists": "^4.5.
|
|
48
|
-
"@xylabs/react-async-effect": "^
|
|
49
|
-
"@xylabs/react-button": "^
|
|
50
|
-
"@xylabs/react-flexbox": "^
|
|
51
|
-
"@xylabs/react-promise": "^
|
|
52
|
-
"@xyo-network/account-model": "^3.9.
|
|
53
|
-
"@xyo-network/archivist-model": "^3.9.
|
|
54
|
-
"@xyo-network/boundwitness-model": "^3.9.
|
|
55
|
-
"@xyo-network/module-model": "^3.9.
|
|
56
|
-
"@xyo-network/payload-model": "^3.9.
|
|
57
|
-
"@xyo-network/react-module": "^
|
|
58
|
-
"@xyo-network/react-node": "^
|
|
59
|
-
"@xyo-network/react-payload-raw-info": "^
|
|
60
|
-
"@xyo-network/react-shared": "^
|
|
61
|
-
"@xyo-network/react-witness": "^
|
|
62
|
-
"@xyo-network/sentinel-memory": "^3.9.
|
|
63
|
-
"@xyo-network/sentinel-model": "^3.9.
|
|
64
|
-
"@xyo-network/witness-model": "^3.9.
|
|
46
|
+
"@xylabs/enum": "^4.5.10",
|
|
47
|
+
"@xylabs/exists": "^4.5.10",
|
|
48
|
+
"@xylabs/react-async-effect": "^6.0.0-rc.1",
|
|
49
|
+
"@xylabs/react-button": "^6.0.0-rc.1",
|
|
50
|
+
"@xylabs/react-flexbox": "^6.0.0-rc.1",
|
|
51
|
+
"@xylabs/react-promise": "^6.0.0-rc.1",
|
|
52
|
+
"@xyo-network/account-model": "^3.9.35",
|
|
53
|
+
"@xyo-network/archivist-model": "^3.9.35",
|
|
54
|
+
"@xyo-network/boundwitness-model": "^3.9.35",
|
|
55
|
+
"@xyo-network/module-model": "^3.9.35",
|
|
56
|
+
"@xyo-network/payload-model": "^3.9.35",
|
|
57
|
+
"@xyo-network/react-module": "^5.0.0-rc.1",
|
|
58
|
+
"@xyo-network/react-node": "^5.0.0-rc.1",
|
|
59
|
+
"@xyo-network/react-payload-raw-info": "^5.0.0-rc.1",
|
|
60
|
+
"@xyo-network/react-shared": "^5.0.0-rc.1",
|
|
61
|
+
"@xyo-network/react-witness": "^5.0.0-rc.1",
|
|
62
|
+
"@xyo-network/sentinel-memory": "^3.9.35",
|
|
63
|
+
"@xyo-network/sentinel-model": "^3.9.35",
|
|
64
|
+
"@xyo-network/witness-model": "^3.9.35"
|
|
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.
|
|
70
|
-
"@mui/material": "^6.4.
|
|
71
|
-
"@mui/styles": "^6.4.
|
|
72
|
-
"@storybook/react": "^8.6.
|
|
73
|
-
"@
|
|
74
|
-
"@xylabs/
|
|
75
|
-
"@
|
|
76
|
-
"@xyo-network/
|
|
77
|
-
"@xyo-network/
|
|
78
|
-
"@xyo-network/
|
|
69
|
+
"@mui/icons-material": "^6.4.7",
|
|
70
|
+
"@mui/material": "^6.4.7",
|
|
71
|
+
"@mui/styles": "^6.4.7",
|
|
72
|
+
"@storybook/react": "^8.6.4",
|
|
73
|
+
"@types/react": "^19.0.10",
|
|
74
|
+
"@xylabs/ts-scripts-yarn3": "^6.0.3",
|
|
75
|
+
"@xylabs/tsconfig-react": "^6.0.3",
|
|
76
|
+
"@xyo-network/account": "^3.9.35",
|
|
77
|
+
"@xyo-network/evm-call-witness": "^3.4.3",
|
|
78
|
+
"@xyo-network/manifest": "^3.9.35",
|
|
79
|
+
"@xyo-network/module-factory-locator": "^3.9.35",
|
|
79
80
|
"ethers": "^6.13.5",
|
|
80
|
-
"react": "^
|
|
81
|
-
"react-dom": "^
|
|
82
|
-
"storybook": "^8.6.
|
|
83
|
-
"typescript": "^5.
|
|
81
|
+
"react": "^19.0.0",
|
|
82
|
+
"react-dom": "^19.0.0",
|
|
83
|
+
"storybook": "^8.6.4",
|
|
84
|
+
"typescript": "^5.8.2"
|
|
84
85
|
},
|
|
85
86
|
"peerDependencies": {
|
|
86
87
|
"@emotion/react": "^11",
|
|
@@ -89,8 +90,8 @@
|
|
|
89
90
|
"@mui/material": "^6",
|
|
90
91
|
"@mui/styles": "^6",
|
|
91
92
|
"ethers": "^6",
|
|
92
|
-
"react": "^
|
|
93
|
-
"react-dom": "^
|
|
93
|
+
"react": "^19",
|
|
94
|
+
"react-dom": "^19"
|
|
94
95
|
},
|
|
95
96
|
"peerDependenciesMeta": {
|
|
96
97
|
"ethers": {
|
|
@@ -100,5 +101,6 @@
|
|
|
100
101
|
"publishConfig": {
|
|
101
102
|
"access": "public"
|
|
102
103
|
},
|
|
103
|
-
"docs": "dist/docs.json"
|
|
104
|
+
"docs": "dist/docs.json",
|
|
105
|
+
"stableVersion": "4.4.11"
|
|
104
106
|
}
|
|
@@ -133,9 +133,9 @@ export const SentinelProvider: React.FC<PropsWithChildren<SentinelProviderProps>
|
|
|
133
133
|
return !required || sentinel
|
|
134
134
|
|
|
135
135
|
? (
|
|
136
|
-
<SentinelContext
|
|
136
|
+
<SentinelContext value={value}>
|
|
137
137
|
{children}
|
|
138
|
-
</SentinelContext
|
|
138
|
+
</SentinelContext>
|
|
139
139
|
)
|
|
140
140
|
: null
|
|
141
141
|
}
|
package/dist/browser/index.d.ts
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { CardProps, CardContentProps, CardHeaderProps } from '@mui/material';
|
|
2
|
-
import { Payload } from '@xyo-network/payload-model';
|
|
3
|
-
import { ModuleRenderProps } from '@xyo-network/react-module';
|
|
4
|
-
import * as _xyo_network_sentinel_model from '@xyo-network/sentinel-model';
|
|
5
|
-
import { SentinelInstance, SentinelModule } from '@xyo-network/sentinel-model';
|
|
6
|
-
import * as React from 'react';
|
|
7
|
-
import React__default, { PropsWithChildren } from 'react';
|
|
8
|
-
import * as _xyo_network_react_shared from '@xyo-network/react-shared';
|
|
9
|
-
import { Enum, EnumValue } from '@xylabs/enum';
|
|
10
|
-
import { ArchivistModuleInstance } from '@xyo-network/archivist-model';
|
|
11
|
-
import * as _xyo_network_boundwitness_model from '@xyo-network/boundwitness-model';
|
|
12
|
-
import { BoundWitness } from '@xyo-network/boundwitness-model';
|
|
13
|
-
import { WitnessModule, WitnessInstance } from '@xyo-network/witness-model';
|
|
14
|
-
import * as _xyo_network_account_model from '@xyo-network/account-model';
|
|
15
|
-
import { AccountInstance } from '@xyo-network/account-model';
|
|
16
|
-
import * as _xyo_network_module_model from '@xyo-network/module-model';
|
|
17
|
-
import { ModuleIdentifier } from '@xyo-network/module-model';
|
|
18
|
-
import * as _xylabs_object from '@xylabs/object';
|
|
19
|
-
import { ModuleFromNodeConfig, WeakModuleFromNodeConfig } from '@xyo-network/react-node';
|
|
20
|
-
|
|
21
|
-
type SentinelCardProps = CardProps & ModuleRenderProps<SentinelInstance> & {
|
|
22
|
-
inPayloads?: Payload[];
|
|
23
|
-
};
|
|
24
|
-
declare const SentinelCard: React__default.FC<SentinelCardProps>;
|
|
25
|
-
|
|
26
|
-
type SentinelCardContentProps = ModuleRenderProps<SentinelInstance> & CardContentProps & {
|
|
27
|
-
report?: Payload[];
|
|
28
|
-
};
|
|
29
|
-
declare const SentinelCardContent: React__default.FC<SentinelCardContentProps>;
|
|
30
|
-
|
|
31
|
-
declare const SentinelCardHeader: React__default.FC<ModuleRenderProps<SentinelInstance> & CardHeaderProps>;
|
|
32
|
-
|
|
33
|
-
declare const SentinelReportStatus: Enum<{
|
|
34
|
-
Idle: "idle";
|
|
35
|
-
Queued: "queued";
|
|
36
|
-
Started: "started";
|
|
37
|
-
Succeeded: "succeeded";
|
|
38
|
-
Failed: "failed";
|
|
39
|
-
}>;
|
|
40
|
-
type SentinelReportStatus = EnumValue<typeof SentinelReportStatus>;
|
|
41
|
-
interface SentinelWitnessReportProgress {
|
|
42
|
-
status: SentinelReportStatus;
|
|
43
|
-
witness: WitnessModule;
|
|
44
|
-
}
|
|
45
|
-
interface SentinelArchivistApiReportProgress {
|
|
46
|
-
archivist: ArchivistModuleInstance;
|
|
47
|
-
status: SentinelReportStatus;
|
|
48
|
-
}
|
|
49
|
-
interface SentinelReportProgress {
|
|
50
|
-
archivists?: Record<string, SentinelArchivistApiReportProgress>;
|
|
51
|
-
witnesses?: Record<string, SentinelWitnessReportProgress>;
|
|
52
|
-
}
|
|
53
|
-
interface SentinelContextState {
|
|
54
|
-
history?: BoundWitness[];
|
|
55
|
-
progress?: SentinelReportProgress;
|
|
56
|
-
reportingErrors?: Error[];
|
|
57
|
-
sentinel?: SentinelModule;
|
|
58
|
-
status?: SentinelReportStatus;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
declare const SentinelContext: React.Context<SentinelContextState & _xyo_network_react_shared.ContextExState>;
|
|
62
|
-
|
|
63
|
-
interface SentinelProviderProps {
|
|
64
|
-
account: AccountInstance;
|
|
65
|
-
archive?: string;
|
|
66
|
-
archivist?: string;
|
|
67
|
-
ids?: ModuleIdentifier[];
|
|
68
|
-
name?: string;
|
|
69
|
-
required?: boolean;
|
|
70
|
-
witnesses?: WitnessInstance[];
|
|
71
|
-
}
|
|
72
|
-
declare const SentinelProvider: React__default.FC<PropsWithChildren<SentinelProviderProps>>;
|
|
73
|
-
|
|
74
|
-
declare const useSentinelContext: () => {
|
|
75
|
-
history: _xyo_network_boundwitness_model.BoundWitness[] | undefined;
|
|
76
|
-
progress: SentinelReportProgress | undefined;
|
|
77
|
-
reportingErrors: Error[] | undefined;
|
|
78
|
-
sentinel: _xyo_network_sentinel_model.SentinelModule<_xylabs_object.BaseParamsFields & {
|
|
79
|
-
account?: _xyo_network_account_model.AccountInstance | "random";
|
|
80
|
-
addToResolvers?: boolean;
|
|
81
|
-
additionalSigners?: _xyo_network_account_model.AccountInstance[];
|
|
82
|
-
allowNameResolution?: boolean;
|
|
83
|
-
config: _xyo_network_module_model.AnyConfigSchema<_xyo_network_sentinel_model.SentinelConfig<void, void>>;
|
|
84
|
-
ephemeralQueryAccountEnabled?: boolean;
|
|
85
|
-
moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
|
|
86
|
-
privateChildren?: _xyo_network_module_model.ModuleInstance[];
|
|
87
|
-
publicChildren?: _xyo_network_module_model.ModuleInstance[];
|
|
88
|
-
}, _xyo_network_sentinel_model.SentinelModuleEventData<_xyo_network_module_model.Module<_xylabs_object.BaseParamsFields & {
|
|
89
|
-
account?: _xyo_network_account_model.AccountInstance | "random";
|
|
90
|
-
addToResolvers?: boolean;
|
|
91
|
-
additionalSigners?: _xyo_network_account_model.AccountInstance[];
|
|
92
|
-
allowNameResolution?: boolean;
|
|
93
|
-
config: _xyo_network_module_model.AnyConfigSchema<_xyo_network_module_model.ModuleConfig<void, void>>;
|
|
94
|
-
ephemeralQueryAccountEnabled?: boolean;
|
|
95
|
-
moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
|
|
96
|
-
privateChildren?: _xyo_network_module_model.ModuleInstance[];
|
|
97
|
-
publicChildren?: _xyo_network_module_model.ModuleInstance[];
|
|
98
|
-
}, _xyo_network_module_model.ModuleEventData<object>>>> | undefined;
|
|
99
|
-
status: SentinelReportStatus | undefined;
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
declare const useSentinelFromNode: (nameOrAddressOrInstance?: string | SentinelInstance, config?: ModuleFromNodeConfig) => [SentinelInstance | undefined, Error | undefined];
|
|
103
|
-
|
|
104
|
-
declare const useSentinelsFromNode: (ids?: ModuleIdentifier[], config?: ModuleFromNodeConfig) => [SentinelInstance[] | null | undefined, Error | undefined];
|
|
105
|
-
|
|
106
|
-
declare const useWeakSentinelFromNode: (nameOrAddressOrInstance?: string | SentinelInstance, config?: WeakModuleFromNodeConfig) => [WeakRef<SentinelInstance> | undefined, Error | undefined];
|
|
107
|
-
|
|
108
|
-
declare const useWeakSentinelsFromNode: (ids?: ModuleIdentifier[], config?: ModuleFromNodeConfig) => [WeakRef<SentinelInstance>[] | null | undefined, Error | undefined];
|
|
109
|
-
|
|
110
|
-
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 };
|