@ic-reactor/candid 3.0.8-beta.2 → 3.0.10-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/metadata-display-reactor.d.ts +4 -4
- package/dist/metadata-display-reactor.d.ts.map +1 -1
- package/dist/metadata-display-reactor.js +1 -1
- package/dist/metadata-display-reactor.js.map +1 -1
- package/dist/visitor/returns/index.d.ts +23 -71
- package/dist/visitor/returns/index.d.ts.map +1 -1
- package/dist/visitor/returns/index.js +156 -306
- package/dist/visitor/returns/index.js.map +1 -1
- package/dist/visitor/returns/types.d.ts +77 -120
- package/dist/visitor/returns/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +1 -0
- package/src/metadata-display-reactor.ts +8 -8
- package/src/visitor/returns/index.test.ts +323 -390
- package/src/visitor/returns/index.ts +239 -385
- package/src/visitor/returns/types.ts +96 -200
|
@@ -1,143 +1,100 @@
|
|
|
1
|
-
import type { BaseActor, FunctionName,
|
|
2
|
-
export type
|
|
1
|
+
import type { BaseActor, FunctionName, FunctionType, ActorMethodReturnType } from "@ic-reactor/core";
|
|
2
|
+
export type NodeType = "record" | "variant" | "tuple" | "optional" | "vector" | "blob" | "recursive" | "principal" | "number" | "text" | "boolean" | "null" | "unknown";
|
|
3
3
|
export type DisplayType = "string" | "number" | "boolean" | "null" | "object" | "array" | "variant" | "result" | "nullable" | "recursive" | "unknown";
|
|
4
|
-
/**
|
|
5
|
-
* Number-specific formatting hints derived from field names.
|
|
6
|
-
*/
|
|
7
4
|
export type NumberFormat = "timestamp" | "cycle" | "value" | "token" | "normal";
|
|
8
|
-
/**
|
|
9
|
-
* Text-specific formatting hints derived from field names.
|
|
10
|
-
*/
|
|
11
5
|
export type TextFormat = "plain" | "timestamp" | "uuid" | "url" | "email" | "phone" | "btc" | "eth" | "account-id" | "principal";
|
|
12
6
|
/**
|
|
13
|
-
*
|
|
7
|
+
* Base properties shared by all result nodes.
|
|
14
8
|
*/
|
|
15
|
-
|
|
16
|
-
export interface ResultFieldBase {
|
|
9
|
+
interface ResultNodeBase<T extends NodeType = NodeType> {
|
|
17
10
|
/** The Candid type category */
|
|
18
|
-
type:
|
|
19
|
-
/** Human-readable label
|
|
11
|
+
type: T;
|
|
12
|
+
/** Human-readable label */
|
|
20
13
|
label: string;
|
|
21
14
|
/** Original Candid type name */
|
|
22
15
|
candidType: string;
|
|
23
16
|
/** What it becomes after display transformation */
|
|
24
17
|
displayType: DisplayType;
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
displayType: "array";
|
|
55
|
-
itemField: ResultField;
|
|
56
|
-
}
|
|
57
|
-
export interface BlobResultField extends ResultFieldBase {
|
|
58
|
-
type: "blob";
|
|
59
|
-
displayType: "string";
|
|
60
|
-
displayHint: "hex";
|
|
61
|
-
}
|
|
62
|
-
export interface RecursiveResultField extends ResultFieldBase {
|
|
63
|
-
type: "recursive";
|
|
64
|
-
displayType: "recursive";
|
|
65
|
-
typeName: string;
|
|
66
|
-
/** Lazily extract the inner field to prevent infinite loops */
|
|
67
|
-
extract: () => ResultField;
|
|
68
|
-
}
|
|
69
|
-
export interface PrincipalResultField extends ResultFieldBase {
|
|
70
|
-
type: "principal";
|
|
71
|
-
displayType: "string";
|
|
72
|
-
textFormat: TextFormat;
|
|
73
|
-
}
|
|
74
|
-
export interface NumberResultField extends ResultFieldBase {
|
|
75
|
-
type: "number";
|
|
76
|
-
displayType: "string" | "number";
|
|
77
|
-
numberFormat: NumberFormat;
|
|
78
|
-
}
|
|
79
|
-
export interface TextResultField extends ResultFieldBase {
|
|
80
|
-
type: "text";
|
|
81
|
-
displayType: "string";
|
|
82
|
-
textFormat: TextFormat;
|
|
83
|
-
}
|
|
84
|
-
export interface BooleanResultField extends ResultFieldBase {
|
|
85
|
-
type: "boolean";
|
|
86
|
-
displayType: "boolean";
|
|
87
|
-
}
|
|
88
|
-
export interface NullResultField extends ResultFieldBase {
|
|
89
|
-
type: "null";
|
|
90
|
-
displayType: "null";
|
|
91
|
-
}
|
|
92
|
-
export interface UnknownResultField extends ResultFieldBase {
|
|
93
|
-
type: "unknown";
|
|
94
|
-
displayType: "unknown";
|
|
95
|
-
}
|
|
96
|
-
export type ResultField = RecordResultField | VariantResultField | TupleResultField | OptionalResultField | VectorResultField | BlobResultField | RecursiveResultField | PrincipalResultField | NumberResultField | TextResultField | BooleanResultField | NullResultField | UnknownResultField;
|
|
18
|
+
/** Original raw value before transformation (present after resolution) */
|
|
19
|
+
raw?: unknown;
|
|
20
|
+
}
|
|
21
|
+
type NodeTypeExtras<T extends NodeType> = T extends "record" ? {
|
|
22
|
+
fields: Record<string, ResultNode>;
|
|
23
|
+
} : T extends "variant" ? {
|
|
24
|
+
selectedOption: ResultNode;
|
|
25
|
+
selected?: string;
|
|
26
|
+
} : T extends "tuple" | "vector" ? {
|
|
27
|
+
items: ResultNode[];
|
|
28
|
+
} : T extends "optional" ? {
|
|
29
|
+
value: ResultNode | null;
|
|
30
|
+
} : T extends "recursive" ? {
|
|
31
|
+
inner: ResultNode;
|
|
32
|
+
} : T extends "blob" ? {
|
|
33
|
+
value: string;
|
|
34
|
+
} : T extends "number" ? {
|
|
35
|
+
format: NumberFormat;
|
|
36
|
+
value: string | number;
|
|
37
|
+
} : T extends "text" | "principal" ? {
|
|
38
|
+
format: TextFormat;
|
|
39
|
+
value: string;
|
|
40
|
+
} : T extends "boolean" ? {
|
|
41
|
+
value: boolean;
|
|
42
|
+
} : T extends "null" ? {
|
|
43
|
+
value: null;
|
|
44
|
+
} : {
|
|
45
|
+
value: unknown;
|
|
46
|
+
};
|
|
97
47
|
/**
|
|
98
|
-
* A result
|
|
99
|
-
*
|
|
48
|
+
* A unified result node that contains both schema and resolved value.
|
|
49
|
+
* When used as schema only, `raw` is undefined.
|
|
50
|
+
* When resolved, `raw` contains the original data.
|
|
51
|
+
*
|
|
52
|
+
* Compound types (record, variant, tuple, optional, vector) store
|
|
53
|
+
* resolved children directly in their structure fields.
|
|
54
|
+
* Primitive types store the display value in `value`.
|
|
100
55
|
*/
|
|
101
|
-
export
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
56
|
+
export type ResultNode<T extends NodeType = NodeType> = ResultNodeBase<T> & NodeTypeExtras<T> & {
|
|
57
|
+
/** Resolve this node with a value, returning a new resolved node */
|
|
58
|
+
resolve(data: unknown): ResolvedNode<T>;
|
|
59
|
+
value?: unknown;
|
|
60
|
+
};
|
|
106
61
|
/**
|
|
107
|
-
*
|
|
108
|
-
* This is the output of `generateMetadata()`.
|
|
62
|
+
* A resolved node has `raw` populated and children resolved.
|
|
109
63
|
*/
|
|
110
|
-
export
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
export
|
|
64
|
+
export type ResolvedNode<T extends NodeType = NodeType> = ResultNode<T> & {
|
|
65
|
+
raw: unknown;
|
|
66
|
+
};
|
|
67
|
+
export type RecordNode = ResultNode<"record">;
|
|
68
|
+
export type VariantNode = ResultNode<"variant">;
|
|
69
|
+
export type TupleNode = ResultNode<"tuple">;
|
|
70
|
+
export type OptionalNode = ResultNode<"optional">;
|
|
71
|
+
export type VectorNode = ResultNode<"vector">;
|
|
72
|
+
export type BlobNode = ResultNode<"blob">;
|
|
73
|
+
export type RecursiveNode = ResultNode<"recursive">;
|
|
74
|
+
export type PrincipalNode = ResultNode<"principal">;
|
|
75
|
+
export type NumberNode = ResultNode<"number">;
|
|
76
|
+
export type TextNode = ResultNode<"text">;
|
|
77
|
+
export type BooleanNode = ResultNode<"boolean">;
|
|
78
|
+
export type NullNode = ResultNode<"null">;
|
|
79
|
+
export type UnknownNode = ResultNode<"unknown">;
|
|
80
|
+
export interface MethodMeta<A = BaseActor, Name extends FunctionName<A> = FunctionName<A>> {
|
|
117
81
|
functionType: FunctionType;
|
|
118
82
|
functionName: Name;
|
|
119
|
-
|
|
83
|
+
returns: ResultNode[];
|
|
120
84
|
returnCount: number;
|
|
121
85
|
/**
|
|
122
|
-
*
|
|
123
|
-
* This "zips" the static schema with dynamic runtime data for easy rendering.
|
|
124
|
-
*
|
|
125
|
-
* @param data - Array of display-transformed return values from the canister method call
|
|
126
|
-
* @returns Resolved method result with metadata attached to each value
|
|
127
|
-
*
|
|
128
|
-
* @example
|
|
129
|
-
* ```ts
|
|
130
|
-
* const result = await reactor.callMethod({ functionName: "myMethod", args: [] })
|
|
131
|
-
* const resolved = methodMeta.generateMetadata(result)
|
|
132
|
-
* // resolved.results contains fields with their display values for rendering
|
|
133
|
-
* ```
|
|
86
|
+
* Resolve the method result schema with actual return data.
|
|
134
87
|
*/
|
|
135
|
-
|
|
88
|
+
resolve(data: ActorMethodReturnType<A[Name]>): ResolvedMethodResult<A>;
|
|
136
89
|
}
|
|
137
|
-
export
|
|
138
|
-
|
|
90
|
+
export interface ResolvedMethodResult<A = BaseActor> {
|
|
91
|
+
functionType: FunctionType;
|
|
92
|
+
functionName: FunctionName<A>;
|
|
93
|
+
results: ResolvedNode[];
|
|
94
|
+
raw: ActorMethodReturnType<A[FunctionName<A>]>;
|
|
95
|
+
}
|
|
96
|
+
export type ServiceMeta<A = BaseActor> = {
|
|
97
|
+
[K in FunctionName<A>]: MethodMeta<A, K>;
|
|
139
98
|
};
|
|
140
|
-
export
|
|
141
|
-
type: T;
|
|
142
|
-
}>;
|
|
99
|
+
export {};
|
|
143
100
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/visitor/returns/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,YAAY,EACZ,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/visitor/returns/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,qBAAqB,EACtB,MAAM,kBAAkB,CAAA;AAMzB,MAAM,MAAM,QAAQ,GAChB,QAAQ,GACR,SAAS,GACT,OAAO,GACP,UAAU,GACV,QAAQ,GACR,MAAM,GACN,WAAW,GACX,WAAW,GACX,QAAQ,GACR,MAAM,GACN,SAAS,GACT,MAAM,GACN,SAAS,CAAA;AAEb,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,MAAM,GACN,QAAQ,GACR,OAAO,GACP,SAAS,GACT,QAAQ,GACR,UAAU,GACV,WAAW,GACX,SAAS,CAAA;AAEb,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAA;AAC/E,MAAM,MAAM,UAAU,GAClB,OAAO,GACP,WAAW,GACX,MAAM,GACN,KAAK,GACL,OAAO,GACP,OAAO,GACP,KAAK,GACL,KAAK,GACL,YAAY,GACZ,WAAW,CAAA;AAMf;;GAEG;AACH,UAAU,cAAc,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ;IACpD,+BAA+B;IAC/B,IAAI,EAAE,CAAC,CAAA;IACP,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,gCAAgC;IAChC,UAAU,EAAE,MAAM,CAAA;IAClB,mDAAmD;IACnD,WAAW,EAAE,WAAW,CAAA;IACxB,0EAA0E;IAC1E,GAAG,CAAC,EAA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AC,IAAI,EAAE,qBAAqB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAA;CACvE;AAED,MAAM,WAAW,oBAAoB,CAAC,CAAC,GAAG,SAAS;IACjD,YAAY,EAAE,YAAY,CAAA;IAC1B,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,CAAA;IAC7B,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,GAAG,EAAE,qBAAqB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;CAC/C;AAED,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG,SAAS,IAAI;KACtC,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC;CACzC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ic-reactor/candid",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.10-beta.0",
|
|
4
4
|
"description": "IC Reactor Candid Adapter - Fetch and parse Candid definitions from Internet Computer canisters",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"license": "MIT",
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@noble/hashes": "^1.8.0",
|
|
46
|
-
"@ic-reactor/core": "^3.0.
|
|
46
|
+
"@ic-reactor/core": "^3.0.10-beta.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@icp-sdk/core": "^5.0.0"
|
package/src/index.ts
CHANGED
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
ServiceArgumentsMeta,
|
|
15
15
|
} from "./visitor/arguments"
|
|
16
16
|
import {
|
|
17
|
-
|
|
17
|
+
MethodMeta,
|
|
18
18
|
ResolvedMethodResult,
|
|
19
19
|
ResultFieldVisitor,
|
|
20
|
-
|
|
20
|
+
ServiceMeta,
|
|
21
21
|
} from "./visitor/returns"
|
|
22
22
|
|
|
23
23
|
// ============================================================================
|
|
@@ -51,7 +51,7 @@ export class MetadataDisplayReactor<A = BaseActor> extends CandidDisplayReactor<
|
|
|
51
51
|
|
|
52
52
|
// Metadata storage
|
|
53
53
|
private argumentMeta: ServiceArgumentsMeta<A> | null = null
|
|
54
|
-
private resultMeta:
|
|
54
|
+
private resultMeta: ServiceMeta<A> | null = null
|
|
55
55
|
|
|
56
56
|
// Visitors (stateless, can be reused)
|
|
57
57
|
private static argVisitor = new ArgumentFieldVisitor()
|
|
@@ -92,7 +92,7 @@ export class MetadataDisplayReactor<A = BaseActor> extends CandidDisplayReactor<
|
|
|
92
92
|
this.resultMeta = service.accept(
|
|
93
93
|
MetadataDisplayReactor.resultVisitor,
|
|
94
94
|
null as any
|
|
95
|
-
) as
|
|
95
|
+
) as ServiceMeta<A>
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
// ══════════════════════════════════════════════════════════════════════════
|
|
@@ -114,7 +114,7 @@ export class MetadataDisplayReactor<A = BaseActor> extends CandidDisplayReactor<
|
|
|
114
114
|
*/
|
|
115
115
|
public getResultMeta<M extends FunctionName<A>>(
|
|
116
116
|
methodName: M
|
|
117
|
-
):
|
|
117
|
+
): MethodMeta<A, M> | undefined {
|
|
118
118
|
return this.resultMeta?.[methodName]
|
|
119
119
|
}
|
|
120
120
|
|
|
@@ -128,7 +128,7 @@ export class MetadataDisplayReactor<A = BaseActor> extends CandidDisplayReactor<
|
|
|
128
128
|
/**
|
|
129
129
|
* Get all result metadata.
|
|
130
130
|
*/
|
|
131
|
-
public getAllResultMeta():
|
|
131
|
+
public getAllResultMeta(): ServiceMeta<A> | null {
|
|
132
132
|
return this.resultMeta
|
|
133
133
|
}
|
|
134
134
|
|
|
@@ -161,7 +161,7 @@ export class MetadataDisplayReactor<A = BaseActor> extends CandidDisplayReactor<
|
|
|
161
161
|
throw new Error(`No metadata found for method "${methodName}"`)
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
return meta.
|
|
164
|
+
return meta.resolve(result)
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
/**
|
|
@@ -169,7 +169,7 @@ export class MetadataDisplayReactor<A = BaseActor> extends CandidDisplayReactor<
|
|
|
169
169
|
*/
|
|
170
170
|
public async callDynamicWithMeta<T = unknown>(
|
|
171
171
|
options: DynamicMethodOptions & { args?: unknown[] }
|
|
172
|
-
): Promise<{ result: T; meta:
|
|
172
|
+
): Promise<{ result: T; meta: MethodMeta<A> }> {
|
|
173
173
|
await this.registerMethod(options)
|
|
174
174
|
|
|
175
175
|
const result = (await this.callMethod({
|