@ixo/editor 3.0.0-beta.2 → 3.0.0-beta.21
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/capabilityValidation-B3NRVwYZ.d.ts +406 -0
- package/dist/chunk-3RYZSIC2.mjs +3020 -0
- package/dist/chunk-3RYZSIC2.mjs.map +1 -0
- package/dist/{chunk-HHEGZUQF.mjs → chunk-4344EQ47.mjs} +13331 -12621
- package/dist/chunk-4344EQ47.mjs.map +1 -0
- package/dist/chunk-VU34HOXM.mjs +36 -0
- package/dist/chunk-VU34HOXM.mjs.map +1 -0
- package/dist/cid-6O646X2I.mjs +9 -0
- package/dist/cid-6O646X2I.mjs.map +1 -0
- package/dist/core/index.d.ts +201 -0
- package/dist/core/index.mjs +59 -0
- package/dist/core/index.mjs.map +1 -0
- package/dist/graphql-client-b82luVYe.d.ts +2857 -0
- package/dist/index-CnqA4qDa.d.ts +2592 -0
- package/dist/index.d.ts +5 -149
- package/dist/index.mjs +14 -8
- package/dist/index.mjs.map +1 -1
- package/dist/mantine/index.d.ts +9 -3
- package/dist/mantine/index.mjs +10 -3
- package/package.json +9 -1
- package/style-core.css +47 -1
- package/style-mantine.css +47 -1
- package/style.css +47 -1
- package/dist/chunk-HHEGZUQF.mjs.map +0 -1
- package/dist/graphql-client-Dv0q3wZe.d.ts +0 -5302
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// src/core/lib/cid.ts
|
|
2
|
+
async function computeCID(content) {
|
|
3
|
+
const { MemoryBlockstore } = await import("blockstore-core/memory");
|
|
4
|
+
const { importer } = await import("ipfs-unixfs-importer");
|
|
5
|
+
let blockstore = new MemoryBlockstore();
|
|
6
|
+
try {
|
|
7
|
+
function* singleFile() {
|
|
8
|
+
yield { path: "file", content };
|
|
9
|
+
}
|
|
10
|
+
let fileCid = null;
|
|
11
|
+
for await (const entry of importer(singleFile(), blockstore, {
|
|
12
|
+
cidVersion: 0,
|
|
13
|
+
rawLeaves: false,
|
|
14
|
+
wrapWithDirectory: false
|
|
15
|
+
})) {
|
|
16
|
+
fileCid = entry.cid.toString();
|
|
17
|
+
}
|
|
18
|
+
if (!fileCid) {
|
|
19
|
+
throw new Error("Failed to compute CID");
|
|
20
|
+
}
|
|
21
|
+
return fileCid;
|
|
22
|
+
} finally {
|
|
23
|
+
blockstore = null;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
async function computeJsonCID(obj) {
|
|
27
|
+
const json = JSON.stringify(obj);
|
|
28
|
+
const encoder = new TextEncoder();
|
|
29
|
+
return computeCID(encoder.encode(json));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export {
|
|
33
|
+
computeCID,
|
|
34
|
+
computeJsonCID
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=chunk-VU34HOXM.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/lib/cid.ts"],"sourcesContent":["/**\n * Compute an IPFS-compatible CID for arbitrary content.\n * Dependencies are lazy-loaded to avoid bundling IPFS libraries\n * into the main entry point.\n *\n * Uses CIDv0 with raw leaves disabled to match ixo ecosystem conventions.\n */\nexport async function computeCID(content: Uint8Array): Promise<string> {\n const { MemoryBlockstore } = await import('blockstore-core/memory');\n const { importer } = await import('ipfs-unixfs-importer');\n\n let blockstore: InstanceType<typeof MemoryBlockstore> | null = new MemoryBlockstore();\n\n try {\n function* singleFile() {\n yield { path: 'file', content };\n }\n\n let fileCid: string | null = null;\n for await (const entry of importer(singleFile(), blockstore, {\n cidVersion: 0,\n rawLeaves: false,\n wrapWithDirectory: false,\n })) {\n fileCid = entry.cid.toString();\n }\n\n if (!fileCid) {\n throw new Error('Failed to compute CID');\n }\n return fileCid;\n } finally {\n blockstore = null;\n }\n}\n\n/**\n * Compute CID for a JSON object by stringifying and encoding to UTF-8.\n */\nexport async function computeJsonCID(obj: Record<string, any>): Promise<string> {\n const json = JSON.stringify(obj);\n const encoder = new TextEncoder();\n return computeCID(encoder.encode(json));\n}\n"],"mappings":";AAOA,eAAsB,WAAW,SAAsC;AACrE,QAAM,EAAE,iBAAiB,IAAI,MAAM,OAAO,wBAAwB;AAClE,QAAM,EAAE,SAAS,IAAI,MAAM,OAAO,sBAAsB;AAExD,MAAI,aAA2D,IAAI,iBAAiB;AAEpF,MAAI;AACF,cAAU,aAAa;AACrB,YAAM,EAAE,MAAM,QAAQ,QAAQ;AAAA,IAChC;AAEA,QAAI,UAAyB;AAC7B,qBAAiB,SAAS,SAAS,WAAW,GAAG,YAAY;AAAA,MAC3D,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,mBAAmB;AAAA,IACrB,CAAC,GAAG;AACF,gBAAU,MAAM,IAAI,SAAS;AAAA,IAC/B;AAEA,QAAI,CAAC,SAAS;AACZ,YAAM,IAAI,MAAM,uBAAuB;AAAA,IACzC;AACA,WAAO;AAAA,EACT,UAAE;AACA,iBAAa;AAAA,EACf;AACF;AAKA,eAAsB,eAAe,KAA2C;AAC9E,QAAM,OAAO,KAAK,UAAU,GAAG;AAC/B,QAAM,UAAU,IAAI,YAAY;AAChC,SAAO,WAAW,QAAQ,OAAO,IAAI,CAAC;AACxC;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
export { m as ActivationResult, l as AuthorizationContext, s as AuthorizationContextV2, A as AuthorizationResult, C as CapabilityGrant, D as DelegationStore, y as DerivedCapability, E as ExecuteNodeParams, p as ExecuteNodeParamsV2, k as ExecutionContext, q as ExecutionContextV2, j as ExecutionOutcome, F as FlowRuntimeStateManager, N as NodeActionResult, S as SimpleUCANManager, x as UCANManager, U as UcanService, u as UcanServiceConfig, w as UcanServiceHandlers, h as buildAuthzFromProps, g as buildFlowNodeFromBlock, n as clearRuntimeForTemplateClone, c as createDelegationStore, b as createMemoryDelegationStore, d as createRuntimeStateManager, t as createUcanService, e as executeNode, o as executeNodeWithInvocation, f as findValidCapability, i as isActorAuthorized, r as isActorAuthorizedV2, a as isNodeActive, v as validateCapabilityChain } from '../capabilityValidation-B3NRVwYZ.mjs';
|
|
2
|
+
export { A as ActivationCondition, C as Capability, m as CapabilityURI, a as CapabilityValidationResult, o as ClaimCollectionURI, G as CreateDelegationParams, H as CreateInvocationParams, B as CreateRootDelegationParams, n as DID, y as DelegationChainValidationResult, D as DelegationGrant, E as EvaluationStatus, x as ExecutionWithInvocationResult, z as FindProofsResult, r as FlowNode, F as FlowNodeAuthzExtension, q as FlowNodeBase, p as FlowNodeRuntimeState, v as InvocationRequest, w as InvocationResult, l as InvocationStore, L as LinkedClaim, M as MigrationReport, N as NodeState, S as SignedCapability, t as StoredDelegation, u as StoredInvocation, s as UcanCapability, U as UcanDelegationStore, j as createInvocationStore, k as createMemoryInvocationStore, i as createMemoryUcanDelegationStore, h as createUcanDelegationStore } from '../index-CnqA4qDa.mjs';
|
|
3
|
+
import '@ixo/ucan';
|
|
4
|
+
import 'yjs';
|
|
5
|
+
import '@blocknote/core';
|
|
6
|
+
import 'matrix-js-sdk';
|
|
7
|
+
|
|
8
|
+
interface ActionContext {
|
|
9
|
+
actorDid: string;
|
|
10
|
+
flowId: string;
|
|
11
|
+
nodeId: string;
|
|
12
|
+
services: ActionServices;
|
|
13
|
+
flowNode?: any;
|
|
14
|
+
runtime?: any;
|
|
15
|
+
delegationStore?: any;
|
|
16
|
+
verifySignature?: (capabilityRaw: string, issuerDid: string) => Promise<{
|
|
17
|
+
valid: boolean;
|
|
18
|
+
error?: string;
|
|
19
|
+
}>;
|
|
20
|
+
rootIssuer?: string;
|
|
21
|
+
flowUri?: string;
|
|
22
|
+
handlers?: any;
|
|
23
|
+
editor?: any;
|
|
24
|
+
}
|
|
25
|
+
interface ActionServices {
|
|
26
|
+
http?: {
|
|
27
|
+
request: (params: {
|
|
28
|
+
url: string;
|
|
29
|
+
method: string;
|
|
30
|
+
headers?: Record<string, string>;
|
|
31
|
+
body?: any;
|
|
32
|
+
}) => Promise<{
|
|
33
|
+
status: number;
|
|
34
|
+
headers: Record<string, string>;
|
|
35
|
+
data: any;
|
|
36
|
+
}>;
|
|
37
|
+
};
|
|
38
|
+
email?: {
|
|
39
|
+
send: (params: {
|
|
40
|
+
to: string;
|
|
41
|
+
subject: string;
|
|
42
|
+
template: string;
|
|
43
|
+
templateVersion?: string;
|
|
44
|
+
variables?: Record<string, any>;
|
|
45
|
+
cc?: string;
|
|
46
|
+
bcc?: string;
|
|
47
|
+
replyTo?: string;
|
|
48
|
+
}) => Promise<{
|
|
49
|
+
messageId: string;
|
|
50
|
+
sentAt: string;
|
|
51
|
+
}>;
|
|
52
|
+
};
|
|
53
|
+
notify?: {
|
|
54
|
+
send: (params: {
|
|
55
|
+
channel: string;
|
|
56
|
+
to: string[];
|
|
57
|
+
cc?: string[];
|
|
58
|
+
bcc?: string[];
|
|
59
|
+
subject?: string;
|
|
60
|
+
body?: string;
|
|
61
|
+
bodyType?: 'text' | 'html';
|
|
62
|
+
from?: string;
|
|
63
|
+
replyTo?: string;
|
|
64
|
+
}) => Promise<{
|
|
65
|
+
messageId: string;
|
|
66
|
+
sentAt: string;
|
|
67
|
+
}>;
|
|
68
|
+
};
|
|
69
|
+
bid?: {
|
|
70
|
+
submitBid: (params: {
|
|
71
|
+
collectionId: string;
|
|
72
|
+
role: string;
|
|
73
|
+
surveyAnswers: Record<string, any>;
|
|
74
|
+
}) => Promise<any>;
|
|
75
|
+
approveBid: (params: {
|
|
76
|
+
bidId: string;
|
|
77
|
+
collectionId: string;
|
|
78
|
+
did: string;
|
|
79
|
+
}) => Promise<any>;
|
|
80
|
+
rejectBid: (params: {
|
|
81
|
+
bidId: string;
|
|
82
|
+
collectionId: string;
|
|
83
|
+
did: string;
|
|
84
|
+
reason: string;
|
|
85
|
+
}) => Promise<any>;
|
|
86
|
+
approveServiceAgentApplication: (params: {
|
|
87
|
+
adminAddress: string;
|
|
88
|
+
collectionId: string;
|
|
89
|
+
agentQuota: number;
|
|
90
|
+
deedDid: string;
|
|
91
|
+
currentUserAddress: string;
|
|
92
|
+
}) => Promise<void>;
|
|
93
|
+
approveEvaluatorApplication: (params: {
|
|
94
|
+
adminAddress: string;
|
|
95
|
+
collectionId: string;
|
|
96
|
+
deedDid: string;
|
|
97
|
+
evaluatorAddress: string;
|
|
98
|
+
agentQuota?: number;
|
|
99
|
+
claimIds?: string[];
|
|
100
|
+
maxAmounts?: Array<{
|
|
101
|
+
denom: string;
|
|
102
|
+
amount: string;
|
|
103
|
+
}>;
|
|
104
|
+
}) => Promise<void>;
|
|
105
|
+
};
|
|
106
|
+
claim?: {
|
|
107
|
+
requestPin: (config?: {
|
|
108
|
+
title?: string;
|
|
109
|
+
description?: string;
|
|
110
|
+
submitText?: string;
|
|
111
|
+
}) => Promise<string>;
|
|
112
|
+
submitClaim: (params: {
|
|
113
|
+
surveyData: any;
|
|
114
|
+
deedDid: string;
|
|
115
|
+
collectionId: string;
|
|
116
|
+
adminAddress: string;
|
|
117
|
+
pin: string;
|
|
118
|
+
}) => Promise<{
|
|
119
|
+
transactionHash: string;
|
|
120
|
+
claimId: string;
|
|
121
|
+
}>;
|
|
122
|
+
evaluateClaim: (granteeAddress: string, did: string, payload: {
|
|
123
|
+
claimId: string;
|
|
124
|
+
collectionId: string;
|
|
125
|
+
adminAddress: string;
|
|
126
|
+
status?: number;
|
|
127
|
+
verificationProof: string;
|
|
128
|
+
amount?: {
|
|
129
|
+
denom: string;
|
|
130
|
+
amount: string;
|
|
131
|
+
} | Array<{
|
|
132
|
+
denom: string;
|
|
133
|
+
amount: string;
|
|
134
|
+
}>;
|
|
135
|
+
}) => Promise<void>;
|
|
136
|
+
getCurrentUser: () => {
|
|
137
|
+
address: string;
|
|
138
|
+
};
|
|
139
|
+
createUdid?: (params: any) => Promise<any>;
|
|
140
|
+
};
|
|
141
|
+
matrix?: {
|
|
142
|
+
storeCredential: (params: {
|
|
143
|
+
roomId: string;
|
|
144
|
+
credentialKey: string;
|
|
145
|
+
credential: Record<string, any>;
|
|
146
|
+
cid: string;
|
|
147
|
+
}) => Promise<{
|
|
148
|
+
storedAt: string;
|
|
149
|
+
duplicate: boolean;
|
|
150
|
+
}>;
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
interface OutputSchemaField {
|
|
154
|
+
path: string;
|
|
155
|
+
displayName: string;
|
|
156
|
+
type: 'string' | 'number' | 'boolean' | 'object' | 'array';
|
|
157
|
+
description?: string;
|
|
158
|
+
}
|
|
159
|
+
interface ActionDefinition {
|
|
160
|
+
type: string;
|
|
161
|
+
sideEffect: boolean;
|
|
162
|
+
defaultRequiresConfirmation: boolean;
|
|
163
|
+
requiredCapability?: string;
|
|
164
|
+
inputSchema?: object;
|
|
165
|
+
/** Static output schema for action types with predictable output (e.g. email.send).
|
|
166
|
+
* For action types with dynamic output (e.g. http.request), the schema is user-defined in inputs. */
|
|
167
|
+
outputSchema?: OutputSchemaField[];
|
|
168
|
+
run: (inputs: Record<string, any>, ctx: ActionContext) => Promise<ActionResult>;
|
|
169
|
+
}
|
|
170
|
+
interface ActionResult {
|
|
171
|
+
output: Record<string, any>;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
declare function registerAction(definition: ActionDefinition): void;
|
|
175
|
+
declare function getAction(type: string): ActionDefinition | undefined;
|
|
176
|
+
declare function getAllActions(): ActionDefinition[];
|
|
177
|
+
declare function hasAction(type: string): boolean;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Builds an ActionServices map from BlocknoteHandlers.
|
|
181
|
+
* Used by block components to bridge existing DI into registry calls.
|
|
182
|
+
*
|
|
183
|
+
* The handlers parameter is typed as `any` to avoid a circular dependency
|
|
184
|
+
* between core and mantine layers — BlocknoteHandlers is defined in mantine/context.
|
|
185
|
+
*/
|
|
186
|
+
declare function buildServicesFromHandlers(handlers: any): ActionServices;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Compute an IPFS-compatible CID for arbitrary content.
|
|
190
|
+
* Dependencies are lazy-loaded to avoid bundling IPFS libraries
|
|
191
|
+
* into the main entry point.
|
|
192
|
+
*
|
|
193
|
+
* Uses CIDv0 with raw leaves disabled to match ixo ecosystem conventions.
|
|
194
|
+
*/
|
|
195
|
+
declare function computeCID(content: Uint8Array): Promise<string>;
|
|
196
|
+
/**
|
|
197
|
+
* Compute CID for a JSON object by stringifying and encoding to UTF-8.
|
|
198
|
+
*/
|
|
199
|
+
declare function computeJsonCID(obj: Record<string, any>): Promise<string>;
|
|
200
|
+
|
|
201
|
+
export { type ActionContext, type ActionDefinition, type ActionResult, type ActionServices, type OutputSchemaField, buildServicesFromHandlers, computeCID, computeJsonCID, getAction, getAllActions, hasAction, registerAction };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SimpleUCANManager,
|
|
3
|
+
buildAuthzFromProps,
|
|
4
|
+
buildFlowNodeFromBlock,
|
|
5
|
+
buildServicesFromHandlers,
|
|
6
|
+
clearRuntimeForTemplateClone,
|
|
7
|
+
createDelegationStore,
|
|
8
|
+
createInvocationStore,
|
|
9
|
+
createMemoryDelegationStore,
|
|
10
|
+
createMemoryInvocationStore,
|
|
11
|
+
createMemoryUcanDelegationStore,
|
|
12
|
+
createRuntimeStateManager,
|
|
13
|
+
createUcanDelegationStore,
|
|
14
|
+
createUcanService,
|
|
15
|
+
executeNode,
|
|
16
|
+
executeNodeWithInvocation,
|
|
17
|
+
findValidCapability,
|
|
18
|
+
getAction,
|
|
19
|
+
getAllActions,
|
|
20
|
+
hasAction,
|
|
21
|
+
isActorAuthorized,
|
|
22
|
+
isActorAuthorizedV2,
|
|
23
|
+
isNodeActive,
|
|
24
|
+
registerAction,
|
|
25
|
+
validateCapabilityChain
|
|
26
|
+
} from "../chunk-3RYZSIC2.mjs";
|
|
27
|
+
import {
|
|
28
|
+
computeCID,
|
|
29
|
+
computeJsonCID
|
|
30
|
+
} from "../chunk-VU34HOXM.mjs";
|
|
31
|
+
export {
|
|
32
|
+
SimpleUCANManager,
|
|
33
|
+
buildAuthzFromProps,
|
|
34
|
+
buildFlowNodeFromBlock,
|
|
35
|
+
buildServicesFromHandlers,
|
|
36
|
+
clearRuntimeForTemplateClone,
|
|
37
|
+
computeCID,
|
|
38
|
+
computeJsonCID,
|
|
39
|
+
createDelegationStore,
|
|
40
|
+
createInvocationStore,
|
|
41
|
+
createMemoryDelegationStore,
|
|
42
|
+
createMemoryInvocationStore,
|
|
43
|
+
createMemoryUcanDelegationStore,
|
|
44
|
+
createRuntimeStateManager,
|
|
45
|
+
createUcanDelegationStore,
|
|
46
|
+
createUcanService,
|
|
47
|
+
executeNode,
|
|
48
|
+
executeNodeWithInvocation,
|
|
49
|
+
findValidCapability,
|
|
50
|
+
getAction,
|
|
51
|
+
getAllActions,
|
|
52
|
+
hasAction,
|
|
53
|
+
isActorAuthorized,
|
|
54
|
+
isActorAuthorizedV2,
|
|
55
|
+
isNodeActive,
|
|
56
|
+
registerAction,
|
|
57
|
+
validateCapabilityChain
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|