@casual-simulation/aux-common 3.8.2-alpha.19511653187 → 3.10.3-alpha.20787554310
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/BlobPolyfill.js +1 -1
- package/BlobPolyfill.js.map +1 -1
- package/README.md +493 -26
- package/bots/BotCalculations.js +9 -17
- package/bots/BotCalculations.js.map +1 -1
- package/bots/BotEvents.d.ts +146 -3
- package/bots/BotEvents.js +19 -4
- package/bots/BotEvents.js.map +1 -1
- package/common/ConnectionInfo.d.ts +1 -9
- package/common/DenialReason.d.ts +1 -1
- package/common/PolicyPermissions.d.ts +866 -754
- package/common/PolicyPermissions.js +53 -0
- package/common/PolicyPermissions.js.map +1 -1
- package/common/RemoteActions.d.ts +33 -299
- package/common/Version.d.ts +35 -1
- package/common/Version.js +50 -2
- package/common/Version.js.map +1 -1
- package/common/WebConfig.d.ts +163 -69
- package/common/WebConfig.js +86 -23
- package/common/WebConfig.js.map +1 -1
- package/common/WebManifest.d.ts +27 -0
- package/common/WebManifest.js +110 -0
- package/common/WebManifest.js.map +1 -0
- package/documents/RemoteYjsSharedDocument.js +3 -5
- package/documents/RemoteYjsSharedDocument.js.map +1 -1
- package/documents/YjsSharedDocument.js +5 -10
- package/documents/YjsSharedDocument.js.map +1 -1
- package/forms/FormError.js +1 -2
- package/forms/FormError.js.map +1 -1
- package/http/GenericHttpInterface.d.ts +11 -20
- package/http/GenericHttpInterface.js.map +1 -1
- package/math/Rotation.js +3 -4
- package/math/Rotation.js.map +1 -1
- package/package.json +77 -78
- package/partitions/AuxPartitionConfig.d.ts +11 -1
- package/partitions/AuxPartitionFactories.js +3 -0
- package/partitions/AuxPartitionFactories.js.map +1 -1
- package/partitions/MemoryPartition.js +5 -7
- package/partitions/MemoryPartition.js.map +1 -1
- package/partitions/OtherPlayersPartition.js +4 -8
- package/partitions/OtherPlayersPartition.js.map +1 -1
- package/partitions/PartitionAuthSource.js +2 -4
- package/partitions/PartitionAuthSource.js.map +1 -1
- package/partitions/PartitionUtils.d.ts +12 -0
- package/partitions/PartitionUtils.js +65 -6
- package/partitions/PartitionUtils.js.map +1 -1
- package/partitions/RemoteYjsPartition.d.ts +1 -0
- package/partitions/RemoteYjsPartition.js +39 -6
- package/partitions/RemoteYjsPartition.js.map +1 -1
- package/partitions/YjsPartition.d.ts +2 -1
- package/partitions/YjsPartition.js +46 -28
- package/partitions/YjsPartition.js.map +1 -1
- package/records/AccountBalance.d.ts +82 -0
- package/records/AccountBalance.js +63 -0
- package/records/AccountBalance.js.map +1 -0
- package/records/AuthUtils.js +7 -7
- package/records/AuthUtils.js.map +1 -1
- package/records/RecordKeys.js +2 -3
- package/records/RecordKeys.js.map +1 -1
- package/records/index.d.ts +1 -0
- package/records/index.js +1 -0
- package/records/index.js.map +1 -1
- package/rpc/ErrorCodes.d.ts +1 -1
- package/rpc/ErrorCodes.js +3 -3
- package/rpc/ErrorCodes.js.map +1 -1
- package/rpc/GenericRPCInterface.d.ts +56 -13
- package/rpc/GenericRPCInterface.js +87 -55
- package/rpc/GenericRPCInterface.js.map +1 -1
- package/rpc/Result.d.ts +4 -1
- package/rpc/Result.js +21 -13
- package/rpc/Result.js.map +1 -1
- package/utils.d.ts +1 -1
- package/utils.js +6 -4
- package/utils.js.map +1 -1
- package/websockets/InstRecordsClient.js +6 -7
- package/websockets/InstRecordsClient.js.map +1 -1
- package/websockets/Utils.js +3 -3
- package/websockets/Utils.js.map +1 -1
- package/websockets/WebsocketEvents.d.ts +246 -997
- package/websockets/WebsocketEvents.js +3 -3
- package/websockets/WebsocketEvents.js.map +1 -1
- package/yjs/YjsHelpers.d.ts +9 -0
- package/yjs/YjsHelpers.js +28 -1
- package/yjs/YjsHelpers.js.map +1 -1
- package/yjs/YjsIndexedDBPersistence.js +2 -3
- package/yjs/YjsIndexedDBPersistence.js.map +1 -1
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { GenericHttpRequest, GenericHttpResponse } from '../http/GenericHttpInterface';
|
|
2
|
-
import z from 'zod';
|
|
2
|
+
import type z from 'zod';
|
|
3
|
+
import * as _z from 'zod/v4/core';
|
|
3
4
|
import type { KnownErrorCodes } from './ErrorCodes';
|
|
4
5
|
import type { Span } from '@opentelemetry/api';
|
|
5
6
|
import type { DenialReason } from '../common/DenialReason';
|
|
7
|
+
import type { IsAny } from 'zod/v4/core/util.cjs';
|
|
6
8
|
/**
|
|
7
9
|
* Defines an interface for the context that an RPC call is made with.
|
|
8
10
|
*/
|
|
@@ -23,6 +25,10 @@ export interface RPCContext {
|
|
|
23
25
|
* The HTTP origin that the request was made from.
|
|
24
26
|
*/
|
|
25
27
|
origin: string | null;
|
|
28
|
+
/**
|
|
29
|
+
* The URL that the request was made to.
|
|
30
|
+
*/
|
|
31
|
+
url: URL | null;
|
|
26
32
|
/**
|
|
27
33
|
* The span that the RPC call is being made in.
|
|
28
34
|
*/
|
|
@@ -43,15 +49,15 @@ export interface ProcedureOutputStream extends AsyncGenerator<any, ProcedureOutp
|
|
|
43
49
|
/**
|
|
44
50
|
* Defines a basic interface for a single RPC call.
|
|
45
51
|
*/
|
|
46
|
-
export interface Procedure<
|
|
52
|
+
export interface Procedure<TSchema extends z.ZodType | void, TOutput extends ProcedureOutput, TQuery extends z.ZodType | void> {
|
|
47
53
|
/**
|
|
48
54
|
* The schema that should be used for the input into the RPC.
|
|
49
55
|
*/
|
|
50
|
-
schema:
|
|
56
|
+
schema: TSchema;
|
|
51
57
|
/**
|
|
52
58
|
* The schema that should be used for the query parameters into the RPC.
|
|
53
59
|
*/
|
|
54
|
-
querySchema:
|
|
60
|
+
querySchema: TQuery;
|
|
55
61
|
/**
|
|
56
62
|
* The handler for the RPC.
|
|
57
63
|
* @param input The input that was parsed from the request.
|
|
@@ -59,7 +65,7 @@ export interface Procedure<TInput, TOutput extends ProcedureOutput, TQuery> {
|
|
|
59
65
|
* @param query The query parameters that were parsed from the request.
|
|
60
66
|
* @returns Returns a promise that resolves with the output of the RPC.
|
|
61
67
|
*/
|
|
62
|
-
handler: (input:
|
|
68
|
+
handler: (input: z.output<TSchema>, context: RPCContext, query?: z.output<TQuery>) => Promise<TOutput>;
|
|
63
69
|
/**
|
|
64
70
|
* The function that can map the output of the handler to an HTTP response.
|
|
65
71
|
* @param output The output of the handler.
|
|
@@ -86,6 +92,24 @@ export interface Procedure<TInput, TOutput extends ProcedureOutput, TQuery> {
|
|
|
86
92
|
* The path for the HTTP route.
|
|
87
93
|
*/
|
|
88
94
|
path: string;
|
|
95
|
+
/**
|
|
96
|
+
* The scope of the HTTP route.
|
|
97
|
+
*/
|
|
98
|
+
scope?: 'player' | 'auth';
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* The view-specific configuration for the procedure.
|
|
102
|
+
*/
|
|
103
|
+
view?: {
|
|
104
|
+
/**
|
|
105
|
+
* The scope of the view (e.g. player or auth).
|
|
106
|
+
*/
|
|
107
|
+
scope: 'player' | 'auth';
|
|
108
|
+
/**
|
|
109
|
+
* The path for the view.
|
|
110
|
+
* If true, then the path will be treated as a default path.
|
|
111
|
+
*/
|
|
112
|
+
path: string | true;
|
|
89
113
|
};
|
|
90
114
|
}
|
|
91
115
|
export interface Procedures {
|
|
@@ -107,13 +131,16 @@ export interface CallProcedureOptions {
|
|
|
107
131
|
}
|
|
108
132
|
export type OnlyFirstArg<T> = T extends (input: infer U, ...args: any[]) => any ? (input: U, options?: CallProcedureOptions) => ReturnType<T> : never;
|
|
109
133
|
export type RemoteProcedures<T extends Procedures> = {
|
|
110
|
-
[K in keyof T]:
|
|
134
|
+
[K in keyof T]: (input: ProcedureInputs<T>[K], options?: CallProcedureOptions) => Promise<ProcedureOutputs<T>[K]>;
|
|
111
135
|
};
|
|
136
|
+
type IsVoid<T> = T extends void ? true : false;
|
|
137
|
+
type IsUnknown<T> = IsAny<T> extends false ? unknown extends T ? true : false : false;
|
|
138
|
+
export type ProcedureInput<T extends z.ZodType | void> = IsVoid<T> extends true ? void : IsUnknown<z.input<T>> extends true ? z.input<T> | void : z.input<T>;
|
|
112
139
|
export type ProcedureInputs<T extends Procedures> = {
|
|
113
|
-
[K in keyof T]:
|
|
140
|
+
[K in keyof T]: ProcedureInput<T[K]['schema']>;
|
|
114
141
|
};
|
|
115
142
|
export type ProcedureQueries<T extends Procedures> = {
|
|
116
|
-
[K in keyof T]:
|
|
143
|
+
[K in keyof T]: ProcedureInput<T[K]['querySchema']>;
|
|
117
144
|
};
|
|
118
145
|
export type ProcedureActions<T extends Procedures> = {
|
|
119
146
|
[K in keyof T]: {
|
|
@@ -121,6 +148,14 @@ export type ProcedureActions<T extends Procedures> = {
|
|
|
121
148
|
query?: ProcedureQueries<T>[K];
|
|
122
149
|
};
|
|
123
150
|
};
|
|
151
|
+
export type ProcedureOutputs<T extends Procedures> = {
|
|
152
|
+
[K in keyof T]: T[K] extends Procedure<any, infer U, any> ? U : never;
|
|
153
|
+
};
|
|
154
|
+
export type SuccessfulOutputs<T extends Procedures> = {
|
|
155
|
+
[K in keyof T]: T[K] extends Procedure<any, infer U, any> ? U extends {
|
|
156
|
+
success: true;
|
|
157
|
+
} ? U : never : never;
|
|
158
|
+
};
|
|
124
159
|
export interface ProcedureBuilder {
|
|
125
160
|
/**
|
|
126
161
|
* Configures the origins that are allowed for the route.
|
|
@@ -130,15 +165,22 @@ export interface ProcedureBuilder {
|
|
|
130
165
|
/**
|
|
131
166
|
* Configures the HTTP method and path for this RPC.
|
|
132
167
|
* @param method The method that should be used for http requests to this RPC.
|
|
168
|
+
* @param scope The scope of the HTTP route.
|
|
169
|
+
*/
|
|
170
|
+
http(method: GenericHttpRequest['method'], path: string, scope?: 'player' | 'auth'): this;
|
|
171
|
+
/**
|
|
172
|
+
* Configures the view for this RPC.
|
|
173
|
+
* @param scope The scope of the view (e.g. player or auth).
|
|
174
|
+
* @param path The path for the view. If true, then the path will be treated as a default path.
|
|
133
175
|
*/
|
|
134
|
-
|
|
176
|
+
view(scope: 'player' | 'auth', path: string | true): this;
|
|
135
177
|
}
|
|
136
178
|
export interface InputlessProcedureBuilder extends ProcedureBuilder {
|
|
137
179
|
/**
|
|
138
180
|
* Configures the input schema for the RPC.
|
|
139
181
|
* @param schema The schema that inputs should conform to.
|
|
140
182
|
*/
|
|
141
|
-
inputs<TInput, TQuery
|
|
183
|
+
inputs<TInput extends z.ZodType, TQuery extends z.ZodType>(schema: TInput, query?: TQuery): OutputlessProcedureBuilder<TInput, TQuery>;
|
|
142
184
|
/**
|
|
143
185
|
* Configures the handler for the RPC.
|
|
144
186
|
* Because this is an inputless procedure, the input is void.
|
|
@@ -147,13 +189,13 @@ export interface InputlessProcedureBuilder extends ProcedureBuilder {
|
|
|
147
189
|
*/
|
|
148
190
|
handler<TOutput extends ProcedureOutput>(handler: (input: void, context: RPCContext) => Promise<TOutput>, mapToResponse?: (output: TOutput, context: RPCContext) => Promise<Partial<GenericHttpResponse>>): Procedure<void, TOutput, void>;
|
|
149
191
|
}
|
|
150
|
-
export interface OutputlessProcedureBuilder<TInput, TQuery> extends ProcedureBuilder {
|
|
192
|
+
export interface OutputlessProcedureBuilder<TInput extends z.ZodType | void, TQuery extends z.ZodType | void> extends ProcedureBuilder {
|
|
151
193
|
/**
|
|
152
194
|
* Configures the handler for the RPC.
|
|
153
195
|
* @param handler The handler.
|
|
154
196
|
* @param mapToResponse The function that should be used to map the handler output to an HTTP response.
|
|
155
197
|
*/
|
|
156
|
-
handler<TOutput extends ProcedureOutput>(handler: (input: TInput
|
|
198
|
+
handler<TOutput extends ProcedureOutput>(handler: (input: z.output<TInput>, context: RPCContext, query?: z.output<TQuery>) => Promise<TOutput>, mapToResponse?: (output: TOutput, context: RPCContext) => Promise<Partial<GenericHttpResponse>>): Procedure<TInput, TOutput, TQuery>;
|
|
157
199
|
}
|
|
158
200
|
/**
|
|
159
201
|
* Constructs a new procedure.
|
|
@@ -279,5 +321,6 @@ export type SchemaMetadata = StringSchemaMetadata | BooleanSchemaMetadata | Numb
|
|
|
279
321
|
* Gets a serializable version of the schema metdata.
|
|
280
322
|
* @param schema The schema to get metadata for.
|
|
281
323
|
*/
|
|
282
|
-
export declare function getSchemaMetadata(schema:
|
|
324
|
+
export declare function getSchemaMetadata(schema: _z.$ZodType): SchemaMetadata;
|
|
325
|
+
export {};
|
|
283
326
|
//# sourceMappingURL=GenericRPCInterface.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as _z from 'zod/v4/core';
|
|
2
2
|
/**
|
|
3
3
|
* Constructs a new procedure.
|
|
4
4
|
*/
|
|
@@ -10,10 +10,18 @@ class ProcBuilder {
|
|
|
10
10
|
this._allowedOrigins = allowedOrigins;
|
|
11
11
|
return this;
|
|
12
12
|
}
|
|
13
|
-
http(method, path) {
|
|
13
|
+
http(method, path, scope) {
|
|
14
14
|
this._http = {
|
|
15
15
|
method: method,
|
|
16
16
|
path: path,
|
|
17
|
+
scope: scope,
|
|
18
|
+
};
|
|
19
|
+
return this;
|
|
20
|
+
}
|
|
21
|
+
view(scope, path) {
|
|
22
|
+
this._view = {
|
|
23
|
+
scope,
|
|
24
|
+
path,
|
|
17
25
|
};
|
|
18
26
|
return this;
|
|
19
27
|
}
|
|
@@ -30,6 +38,7 @@ class ProcBuilder {
|
|
|
30
38
|
mapToResponse,
|
|
31
39
|
allowedOrigins: this._allowedOrigins,
|
|
32
40
|
http: this._http,
|
|
41
|
+
view: this._view,
|
|
33
42
|
};
|
|
34
43
|
}
|
|
35
44
|
}
|
|
@@ -60,107 +69,127 @@ export function getProcedureMetadata(procedures) {
|
|
|
60
69
|
* @param schema The schema to get metadata for.
|
|
61
70
|
*/
|
|
62
71
|
export function getSchemaMetadata(schema) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
72
|
+
if (schema instanceof _z.$ZodPipe) {
|
|
73
|
+
return getSchemaMetadata(schema._zod.def.out);
|
|
74
|
+
}
|
|
75
|
+
else if (schema instanceof _z.$ZodString ||
|
|
76
|
+
schema instanceof _z.$ZodBigInt) {
|
|
77
|
+
return { type: 'string', description: getDescription(schema) };
|
|
66
78
|
}
|
|
67
|
-
else if (schema instanceof
|
|
68
|
-
return { type: 'boolean', description: schema
|
|
79
|
+
else if (schema instanceof _z.$ZodBoolean) {
|
|
80
|
+
return { type: 'boolean', description: getDescription(schema) };
|
|
69
81
|
}
|
|
70
|
-
else if (schema instanceof
|
|
71
|
-
return { type: 'number', description: schema
|
|
82
|
+
else if (schema instanceof _z.$ZodNumber) {
|
|
83
|
+
return { type: 'number', description: getDescription(schema) };
|
|
72
84
|
}
|
|
73
|
-
else if (schema instanceof
|
|
74
|
-
|
|
85
|
+
else if (schema instanceof _z.$ZodAny ||
|
|
86
|
+
schema instanceof _z.$ZodUnknown) {
|
|
87
|
+
return { type: 'any', description: getDescription(schema) };
|
|
75
88
|
}
|
|
76
|
-
else if (schema instanceof
|
|
77
|
-
return { type: 'null', description: schema
|
|
89
|
+
else if (schema instanceof _z.$ZodNull) {
|
|
90
|
+
return { type: 'null', description: getDescription(schema) };
|
|
78
91
|
}
|
|
79
|
-
else if (schema instanceof
|
|
92
|
+
else if (schema instanceof _z.$ZodObject) {
|
|
80
93
|
const schemaMetadata = {};
|
|
81
|
-
for (let key in schema.shape) {
|
|
82
|
-
schemaMetadata[key] = getSchemaMetadata(schema.shape[key]);
|
|
94
|
+
for (let key in schema._zod.def.shape) {
|
|
95
|
+
schemaMetadata[key] = getSchemaMetadata(schema._zod.def.shape[key]);
|
|
83
96
|
}
|
|
84
97
|
return {
|
|
85
98
|
type: 'object',
|
|
86
99
|
schema: schemaMetadata,
|
|
87
|
-
catchall: schema.
|
|
88
|
-
? getSchemaMetadata(schema.
|
|
100
|
+
catchall: schema._zod.def.catchall
|
|
101
|
+
? getSchemaMetadata(schema._zod.def.catchall)
|
|
89
102
|
: undefined,
|
|
90
|
-
description: schema
|
|
103
|
+
description: getDescription(schema),
|
|
91
104
|
};
|
|
92
105
|
}
|
|
93
|
-
else if (schema instanceof
|
|
106
|
+
else if (schema instanceof _z.$ZodArray) {
|
|
94
107
|
return {
|
|
95
108
|
type: 'array',
|
|
96
|
-
schema: getSchemaMetadata(schema.
|
|
97
|
-
maxLength:
|
|
98
|
-
minLength:
|
|
99
|
-
exactLength:
|
|
100
|
-
description: schema
|
|
109
|
+
schema: getSchemaMetadata(schema._zod.def.element),
|
|
110
|
+
maxLength: schema._zod.def.checks?.find((c) => c instanceof _z.$ZodCheckMaxLength)?._zod.def.maximum,
|
|
111
|
+
minLength: schema._zod.def.checks?.find((c) => c instanceof _z.$ZodCheckMinLength)?._zod.def.minimum,
|
|
112
|
+
exactLength: schema._zod.def.checks?.find((c) => c instanceof _z.$ZodCheckLengthEquals)?._zod.def.length,
|
|
113
|
+
description: getDescription(schema),
|
|
101
114
|
};
|
|
102
115
|
}
|
|
103
|
-
else if (schema instanceof
|
|
116
|
+
else if (schema instanceof _z.$ZodEnum) {
|
|
104
117
|
return {
|
|
105
118
|
type: 'enum',
|
|
106
|
-
values: [...schema.
|
|
107
|
-
description: schema
|
|
119
|
+
values: [...schema._zod.values],
|
|
120
|
+
description: getDescription(schema),
|
|
108
121
|
};
|
|
109
122
|
}
|
|
110
|
-
else if (schema instanceof
|
|
111
|
-
return { type: 'date', description: schema
|
|
123
|
+
else if (schema instanceof _z.$ZodDate) {
|
|
124
|
+
return { type: 'date', description: getDescription(schema) };
|
|
112
125
|
}
|
|
113
|
-
else if (schema instanceof
|
|
126
|
+
else if (schema instanceof _z.$ZodLiteral) {
|
|
114
127
|
return {
|
|
115
128
|
type: 'literal',
|
|
116
|
-
value: schema.
|
|
117
|
-
description: schema
|
|
129
|
+
value: schema._zod.def.values[0],
|
|
130
|
+
description: getDescription(schema),
|
|
118
131
|
};
|
|
119
132
|
}
|
|
120
|
-
else if (schema instanceof
|
|
121
|
-
return {
|
|
133
|
+
else if (schema instanceof _z.$ZodOptional) {
|
|
134
|
+
return {
|
|
135
|
+
...getSchemaMetadata(schema._zod.def.innerType),
|
|
136
|
+
optional: true,
|
|
137
|
+
description: getDescription(schema),
|
|
138
|
+
};
|
|
122
139
|
}
|
|
123
|
-
else if (schema instanceof
|
|
124
|
-
return {
|
|
140
|
+
else if (schema instanceof _z.$ZodNonOptional) {
|
|
141
|
+
return {
|
|
142
|
+
...getSchemaMetadata(schema._zod.def.innerType),
|
|
143
|
+
optional: false,
|
|
144
|
+
description: getDescription(schema),
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
else if (schema instanceof _z.$ZodNullable) {
|
|
148
|
+
return {
|
|
149
|
+
...getSchemaMetadata(schema._zod.def.innerType),
|
|
150
|
+
nullable: true,
|
|
151
|
+
description: getDescription(schema),
|
|
152
|
+
};
|
|
125
153
|
}
|
|
126
|
-
else if (schema instanceof
|
|
154
|
+
else if (schema instanceof _z.$ZodPrefault ||
|
|
155
|
+
schema instanceof _z.$ZodDefault) {
|
|
127
156
|
return {
|
|
128
|
-
...getSchemaMetadata(schema.
|
|
157
|
+
...getSchemaMetadata(schema._zod.def.innerType),
|
|
129
158
|
hasDefault: true,
|
|
130
|
-
defaultValue: schema.
|
|
159
|
+
defaultValue: schema._zod.def.defaultValue,
|
|
160
|
+
description: getDescription(schema),
|
|
131
161
|
};
|
|
132
162
|
}
|
|
133
|
-
else if (schema instanceof
|
|
163
|
+
else if (schema instanceof _z.$ZodNever) {
|
|
134
164
|
return undefined;
|
|
135
165
|
}
|
|
136
|
-
else if (schema instanceof
|
|
137
|
-
return { ...getSchemaMetadata(schema._def.schema) };
|
|
138
|
-
}
|
|
139
|
-
else if (schema instanceof z.ZodUnion) {
|
|
166
|
+
else if (schema instanceof _z.$ZodDiscriminatedUnion) {
|
|
140
167
|
return {
|
|
141
168
|
type: 'union',
|
|
142
|
-
options: schema.
|
|
143
|
-
|
|
169
|
+
options: schema._zod.def.options.map((o) => getSchemaMetadata(o)),
|
|
170
|
+
discriminator: schema._zod.def.discriminator,
|
|
171
|
+
description: getDescription(schema),
|
|
144
172
|
};
|
|
145
173
|
}
|
|
146
|
-
else if (schema instanceof
|
|
174
|
+
else if (schema instanceof _z.$ZodUnion) {
|
|
147
175
|
return {
|
|
148
176
|
type: 'union',
|
|
149
|
-
options: schema.
|
|
150
|
-
|
|
151
|
-
description: schema._def.description,
|
|
177
|
+
options: schema._zod.def.options.map((o) => getSchemaMetadata(o)),
|
|
178
|
+
description: getDescription(schema),
|
|
152
179
|
};
|
|
153
180
|
}
|
|
154
|
-
else if (schema instanceof
|
|
181
|
+
else if (schema instanceof _z.$ZodRecord) {
|
|
155
182
|
return {
|
|
156
183
|
type: 'record',
|
|
157
|
-
valueSchema: getSchemaMetadata(schema.
|
|
184
|
+
valueSchema: getSchemaMetadata(schema._zod.def.valueType),
|
|
185
|
+
description: getDescription(schema),
|
|
158
186
|
};
|
|
159
187
|
}
|
|
160
|
-
else if (schema instanceof
|
|
188
|
+
else if (schema instanceof _z.$ZodTuple) {
|
|
161
189
|
return {
|
|
162
190
|
type: 'tuple',
|
|
163
|
-
items: schema.
|
|
191
|
+
items: schema._zod.def.items.map((o) => getSchemaMetadata(o)),
|
|
192
|
+
description: getDescription(schema),
|
|
164
193
|
};
|
|
165
194
|
}
|
|
166
195
|
else {
|
|
@@ -168,4 +197,7 @@ export function getSchemaMetadata(schema) {
|
|
|
168
197
|
throw new Error(`Unsupported schema type: ${schema}`);
|
|
169
198
|
}
|
|
170
199
|
}
|
|
200
|
+
function getDescription(schema) {
|
|
201
|
+
return _z.globalRegistry.get(schema)?.description;
|
|
202
|
+
}
|
|
171
203
|
//# sourceMappingURL=GenericRPCInterface.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenericRPCInterface.js","sourceRoot":"","sources":["GenericRPCInterface.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GenericRPCInterface.js","sourceRoot":"","sources":["GenericRPCInterface.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAyUlC;;GAEG;AACH,MAAM,UAAU,SAAS;IACrB,OAAO,IAAI,WA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CAAC,SAAS,EAAE,CAAC;QACxC,OAAO;YACH,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE,CAC5C,iBAAiB,CAAC,CAAC,CAAC,CACvB;YACD,WAAW,EAAE,cAAc,CAAC,MAAM,CAAC;SACtC,CAAC;IACN,CAAC;SAAM,IAAI,MAAM,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;QACzC,OAAO;YACH,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC;YACzD,WAAW,EAAE,cAAc,CAAC,MAAM,CAAC;SACtC,CAAC;IACN,CAAC;SAAM,IAAI,MAAM,YAAY,EAAE,CAAC,SAAS,EAAE,CAAC;QACxC,OAAO;YACH,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;YAClE,WAAW,EAAE,cAAc,CAAC,MAAM,CAAC;SACtC,CAAC;IACN,CAAC;SAAM,CAAC;QACJ,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,MAAM,CAAC,CAAC;QACjD,MAAM,IAAI,KAAK,CAAC,4BAA4B,MAAM,EAAE,CAAC,CAAC;IAC1D,CAAC;AACL,CAAC;AAED,SAAS,cAAc,CAAC,MAAmB;IACvC,OAAO,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;AACtD,CAAC"}
|
package/rpc/Result.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type z from 'zod';
|
|
1
2
|
import type { DenialReason } from '../common';
|
|
2
3
|
import type { KnownErrorCodes } from './ErrorCodes';
|
|
3
4
|
export type Result<T, E extends ErrorType> = Success<T> | Failure<E>;
|
|
@@ -43,7 +44,7 @@ export type SimpleError = {
|
|
|
43
44
|
errorCode: KnownErrorCodes;
|
|
44
45
|
errorMessage: string;
|
|
45
46
|
reason?: DenialReason;
|
|
46
|
-
issues?:
|
|
47
|
+
issues?: z.core.$ZodIssue[];
|
|
47
48
|
};
|
|
48
49
|
export type WrappedError = {
|
|
49
50
|
errorCode: 'wrapped_error';
|
|
@@ -78,6 +79,8 @@ export declare function unwrap<T, E extends ErrorType>(result: Result<T, E>): T;
|
|
|
78
79
|
export declare function logResult<T, E extends ErrorType>(result: Result<T, E>, message?: string): Result<T, E>;
|
|
79
80
|
export declare function wrap<T>(fn: () => Promise<T>): Promise<Result<T, WrappedError>>;
|
|
80
81
|
export declare function wrap<T>(fn: () => T): Result<T, WrappedError>;
|
|
82
|
+
export declare function wrap<T>(promise: Promise<T>): Promise<Result<T, WrappedError>>;
|
|
83
|
+
export declare function wrap<T>(value: T): Result<T, WrappedError>;
|
|
81
84
|
export declare class R<T, E extends ErrorType> implements SuccessOrError<T, E> {
|
|
82
85
|
readonly success: boolean;
|
|
83
86
|
private readonly _data;
|
package/rpc/Result.js
CHANGED
|
@@ -5,22 +5,21 @@ export function logErrors(multiError, prefix) {
|
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
7
|
export function logError(error, prefix, log = console.error) {
|
|
8
|
-
log(`${prefix
|
|
8
|
+
log(`${prefix ?? ''} Error: ${error.errorMessage} (${error.errorCode})`);
|
|
9
9
|
if (error.reason) {
|
|
10
|
-
log(` ${prefix
|
|
10
|
+
log(` ${prefix ?? ''} Reason:`, error.reason);
|
|
11
11
|
}
|
|
12
12
|
if (error.issues) {
|
|
13
|
-
log(` ${prefix
|
|
13
|
+
log(` ${prefix ?? ''} Issues:`, error.issues);
|
|
14
14
|
}
|
|
15
15
|
if (error.errors && Array.isArray(error.errors)) {
|
|
16
16
|
for (let i = 0; i < error.errors.length; i++) {
|
|
17
17
|
const err = error.errors[i];
|
|
18
|
-
logError(err, ` ${prefix
|
|
18
|
+
logError(err, ` ${prefix ?? ''} ${i + 1}:`, log);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
export function genericResult(result) {
|
|
23
|
-
var _a;
|
|
24
23
|
if (isSuccess(result)) {
|
|
25
24
|
if (Array.isArray(result.value)) {
|
|
26
25
|
return {
|
|
@@ -31,7 +30,7 @@ export function genericResult(result) {
|
|
|
31
30
|
if (typeof result.value === 'object') {
|
|
32
31
|
return {
|
|
33
32
|
success: true,
|
|
34
|
-
...(
|
|
33
|
+
...(result.value ?? {}),
|
|
35
34
|
};
|
|
36
35
|
}
|
|
37
36
|
else {
|
|
@@ -90,18 +89,27 @@ export function unwrap(result) {
|
|
|
90
89
|
}
|
|
91
90
|
export function logResult(result, message) {
|
|
92
91
|
if (isSuccess(result)) {
|
|
93
|
-
console.log(message
|
|
92
|
+
console.log(message ?? 'Result:', result.value);
|
|
94
93
|
}
|
|
95
94
|
else {
|
|
96
|
-
console.error(message
|
|
95
|
+
console.error(message ?? 'Error:', result.error);
|
|
97
96
|
}
|
|
98
97
|
return result;
|
|
99
98
|
}
|
|
100
|
-
export function wrap(
|
|
99
|
+
export function wrap(fnOrPromise) {
|
|
101
100
|
try {
|
|
102
|
-
|
|
103
|
-
if (
|
|
104
|
-
|
|
101
|
+
let p;
|
|
102
|
+
if (fnOrPromise instanceof Promise) {
|
|
103
|
+
p = fnOrPromise;
|
|
104
|
+
}
|
|
105
|
+
else if (typeof fnOrPromise !== 'function') {
|
|
106
|
+
return success(fnOrPromise);
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
p = fnOrPromise();
|
|
110
|
+
}
|
|
111
|
+
if (p instanceof Promise) {
|
|
112
|
+
return p
|
|
105
113
|
.then((value) => success(value))
|
|
106
114
|
.catch((error) => failure({
|
|
107
115
|
errorCode: 'wrapped_error',
|
|
@@ -110,7 +118,7 @@ export function wrap(fn) {
|
|
|
110
118
|
}));
|
|
111
119
|
}
|
|
112
120
|
else {
|
|
113
|
-
return success(
|
|
121
|
+
return success(p);
|
|
114
122
|
}
|
|
115
123
|
}
|
|
116
124
|
catch (error) {
|
package/rpc/Result.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Result.js","sourceRoot":"","sources":["Result.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Result.js","sourceRoot":"","sources":["Result.ts"],"names":[],"mappings":"AA0FA,MAAM,UAAU,SAAS,CAAC,UAAiC,EAAE,MAAe;IACxE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAC7B,KAAK,IAAI,KAAK,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC;QAClC,QAAQ,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,CAAC,CAAC;IACnC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,QAAQ,CACpB,KAAgB,EAChB,MAAe,EACf,MAAiD,OAAO,CAAC,KAAK;IAE9D,GAAG,CAAC,GAAG,MAAM,IAAI,EAAE,WAAW,KAAK,CAAC,YAAY,KAAK,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC;IACzE,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QACf,GAAG,CAAC,KAAK,MAAM,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACnD,CAAC;IACD,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QACf,GAAG,CAAC,KAAK,MAAM,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACnD,CAAC;IACD,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC3C,M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,OAAgB,EAAE,KAAY;QAChD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,SAAS,IAAI,KAAK,EAAE,CAAC;YAC9D,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,KAAK,EAAE,GAAG,KAAU,CAAC;YAC5C,IAAI,CAAC,KAAK,GAAG,KAAU,CAAC;QAC5B,CAAC;IACL,CAAC;IAED,MAAM,CAAC,OAAO,CAAI,KAAQ;QACtB,OAAO,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,CAAe,CAAC;IAC5C,CAAC;IAED,MAAM,CAAC,OAAO,CAAsB,KAAQ;QACxC,OAAO,IAAI,CAAC,CAAC,KAAK,EAAE,KAAK,CAAe,CAAC;IAC7C,CAAC;IAED,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,KAAU,CAAC;IAC3B,CAAC;IAED,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,KAAU,CAAC;IAC3B,CAAC;IAED,QAAQ;QACJ,OAAO,UAAU,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;IACpE,CAAC;IAED,MAAM;QACF,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED,CAAC,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;QACtC,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;IACzB,CAAC;CACJ"}
|
package/utils.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare function merge<T1, T2, T3, T4>(first: T1, second: T2, third: T3,
|
|
|
12
12
|
* @param value The object to map.
|
|
13
13
|
* @param callback The callback that transforms one value into another.
|
|
14
14
|
*/
|
|
15
|
-
export declare function mapValuesDeep(value: any, callback: (v: any) => any): any;
|
|
15
|
+
export declare function mapValuesDeep(value: any, callback: (v: any, k: string | number) => any, key?: string | number): any;
|
|
16
16
|
/**
|
|
17
17
|
* Splices the given string and returns the final result.
|
|
18
18
|
* @param str The string to splice.
|
package/utils.js
CHANGED
|
@@ -47,10 +47,12 @@ function decide(...vals) {
|
|
|
47
47
|
* @param value The object to map.
|
|
48
48
|
* @param callback The callback that transforms one value into another.
|
|
49
49
|
*/
|
|
50
|
-
export function mapValuesDeep(value, callback) {
|
|
51
|
-
return
|
|
52
|
-
?
|
|
53
|
-
:
|
|
50
|
+
export function mapValuesDeep(value, callback, key = null) {
|
|
51
|
+
return Array.isArray(value)
|
|
52
|
+
? value.map((v, i) => mapValuesDeep(v, callback, i))
|
|
53
|
+
: isObject(value)
|
|
54
|
+
? mapValues(value, (v, k) => mapValuesDeep(v, callback, k))
|
|
55
|
+
: callback(value, key);
|
|
54
56
|
}
|
|
55
57
|
/**
|
|
56
58
|
* Splices the given string and returns the final result.
|
package/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAoBlC,MAAM,UAAU,KAAK,CAAC,GAAG,IAAW;IAChC,IAAI,MAAM,GAAQ,EAAE,CAAC;IACrB,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAChD,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC;IAElC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EA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