@xyo-network/payload-model 6.1.0 → 7.0.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/neutral/Error.d.ts +60 -10
- package/dist/neutral/Error.d.ts.map +1 -1
- package/dist/neutral/PayloadSet/PayloadSetPayload.d.ts +53 -7
- package/dist/neutral/PayloadSet/PayloadSetPayload.d.ts.map +1 -1
- package/dist/neutral/Query.d.ts +16 -11
- package/dist/neutral/Query.d.ts.map +1 -1
- package/dist/neutral/index.mjs +85 -18
- package/dist/neutral/index.mjs.map +4 -4
- package/package.json +5 -5
package/dist/neutral/Error.d.ts
CHANGED
|
@@ -1,15 +1,65 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { Payload } from './Payload.ts';
|
|
3
|
-
import { type Schema } from './Schema.ts';
|
|
1
|
+
import * as z from 'zod/mini';
|
|
4
2
|
export declare const ModuleErrorSchema: "network.xyo.error.module" & {
|
|
5
3
|
readonly __schema: true;
|
|
6
4
|
};
|
|
7
5
|
export type ModuleErrorSchema = typeof ModuleErrorSchema;
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
export declare const ModuleErrorZod: z.ZodMiniObject<{
|
|
7
|
+
schema: z.ZodMiniLiteral<"network.xyo.error.module" & {
|
|
8
|
+
readonly __schema: true;
|
|
9
|
+
}>;
|
|
10
|
+
details: z.ZodMiniOptional<z.ZodMiniCustom<unknown, unknown>>;
|
|
11
|
+
message: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
12
|
+
name: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
13
|
+
query: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@xylabs/sdk-js").BrandedHash, string>>, z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("./Schema.ts").BrandedSchema<string>, string>>]>>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export type ModuleError = z.infer<typeof ModuleErrorZod>;
|
|
16
|
+
export declare const isModuleError: <T>(value: T) => value is T & {
|
|
17
|
+
schema: "network.xyo.error.module" & {
|
|
18
|
+
readonly __schema: true;
|
|
19
|
+
};
|
|
20
|
+
details?: unknown;
|
|
21
|
+
message?: string | undefined;
|
|
22
|
+
name?: string | undefined;
|
|
23
|
+
query?: import("./Schema.ts").BrandedSchema<string> | import("@xylabs/sdk-js").BrandedHash | undefined;
|
|
24
|
+
};
|
|
25
|
+
export declare const asModuleError: {
|
|
26
|
+
<T>(value: T): (T & {
|
|
27
|
+
schema: "network.xyo.error.module" & {
|
|
28
|
+
readonly __schema: true;
|
|
29
|
+
};
|
|
30
|
+
details?: unknown;
|
|
31
|
+
message?: string | undefined;
|
|
32
|
+
name?: string | undefined;
|
|
33
|
+
query?: import("./Schema.ts").BrandedSchema<string> | import("@xylabs/sdk-js").BrandedHash | undefined;
|
|
34
|
+
}) | undefined;
|
|
35
|
+
<T>(value: T, assert: import("@xylabs/sdk-js").ZodFactoryConfig): T & {
|
|
36
|
+
schema: "network.xyo.error.module" & {
|
|
37
|
+
readonly __schema: true;
|
|
38
|
+
};
|
|
39
|
+
details?: unknown;
|
|
40
|
+
message?: string | undefined;
|
|
41
|
+
name?: string | undefined;
|
|
42
|
+
query?: import("./Schema.ts").BrandedSchema<string> | import("@xylabs/sdk-js").BrandedHash | undefined;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export declare const toModuleError: {
|
|
46
|
+
<T>(value: T): (T & {
|
|
47
|
+
schema: "network.xyo.error.module" & {
|
|
48
|
+
readonly __schema: true;
|
|
49
|
+
};
|
|
50
|
+
details?: unknown;
|
|
51
|
+
message?: string | undefined;
|
|
52
|
+
name?: string | undefined;
|
|
53
|
+
query?: import("./Schema.ts").BrandedSchema<string> | import("@xylabs/sdk-js").BrandedHash | undefined;
|
|
54
|
+
}) | undefined;
|
|
55
|
+
<T>(value: T, assert: import("@xylabs/sdk-js").ZodFactoryConfig): T & {
|
|
56
|
+
schema: "network.xyo.error.module" & {
|
|
57
|
+
readonly __schema: true;
|
|
58
|
+
};
|
|
59
|
+
details?: unknown;
|
|
60
|
+
message?: string | undefined;
|
|
61
|
+
name?: string | undefined;
|
|
62
|
+
query?: import("./Schema.ts").BrandedSchema<string> | import("@xylabs/sdk-js").BrandedHash | undefined;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
15
65
|
//# sourceMappingURL=Error.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Error.d.ts","sourceRoot":"","sources":["../../src/Error.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Error.d.ts","sourceRoot":"","sources":["../../src/Error.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAK7B,eAAO,MAAM,iBAAiB;;CAA6C,CAAA;AAC3E,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAA;AAExD,eAAO,MAAM,cAAc;;;;;;;;iBAKzB,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAExD,eAAO,MAAM,aAAa;;;;;;;;CAA+B,CAAA;AACzD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;CAAgD,CAAA;AAC1E,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;CAAgD,CAAA"}
|
|
@@ -1,8 +1,54 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
1
|
+
import * as z from 'zod/mini';
|
|
2
|
+
export declare const PayloadSetZod: z.ZodMiniObject<{
|
|
3
|
+
optional: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniNumber<number>>>;
|
|
4
|
+
required: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniNumber<number>>>;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export type PayloadSet = z.infer<typeof PayloadSetZod>;
|
|
7
|
+
export declare const PayloadSetPayloadZod: z.ZodMiniObject<{
|
|
8
|
+
schema: z.ZodMiniLiteral<"network.xyo.payload.set" & {
|
|
9
|
+
readonly __schema: true;
|
|
10
|
+
}>;
|
|
11
|
+
optional: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniNumber<number>>>;
|
|
12
|
+
required: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniNumber<number>>>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export type PayloadSetPayload = z.infer<typeof PayloadSetPayloadZod>;
|
|
15
|
+
export declare const isPayloadSetPayload: <T>(value: T) => value is T & {
|
|
16
|
+
schema: "network.xyo.payload.set" & {
|
|
17
|
+
readonly __schema: true;
|
|
18
|
+
};
|
|
19
|
+
optional?: Record<string, number> | undefined;
|
|
20
|
+
required?: Record<string, number> | undefined;
|
|
21
|
+
};
|
|
22
|
+
export declare const asPayloadSetPayload: {
|
|
23
|
+
<T>(value: T): (T & {
|
|
24
|
+
schema: "network.xyo.payload.set" & {
|
|
25
|
+
readonly __schema: true;
|
|
26
|
+
};
|
|
27
|
+
optional?: Record<string, number> | undefined;
|
|
28
|
+
required?: Record<string, number> | undefined;
|
|
29
|
+
}) | undefined;
|
|
30
|
+
<T>(value: T, assert: import("@xylabs/sdk-js").ZodFactoryConfig): T & {
|
|
31
|
+
schema: "network.xyo.payload.set" & {
|
|
32
|
+
readonly __schema: true;
|
|
33
|
+
};
|
|
34
|
+
optional?: Record<string, number> | undefined;
|
|
35
|
+
required?: Record<string, number> | undefined;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export declare const toPayloadSetPayload: {
|
|
39
|
+
<T>(value: T): (T & {
|
|
40
|
+
schema: "network.xyo.payload.set" & {
|
|
41
|
+
readonly __schema: true;
|
|
42
|
+
};
|
|
43
|
+
optional?: Record<string, number> | undefined;
|
|
44
|
+
required?: Record<string, number> | undefined;
|
|
45
|
+
}) | undefined;
|
|
46
|
+
<T>(value: T, assert: import("@xylabs/sdk-js").ZodFactoryConfig): T & {
|
|
47
|
+
schema: "network.xyo.payload.set" & {
|
|
48
|
+
readonly __schema: true;
|
|
49
|
+
};
|
|
50
|
+
optional?: Record<string, number> | undefined;
|
|
51
|
+
required?: Record<string, number> | undefined;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
8
54
|
//# sourceMappingURL=PayloadSetPayload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayloadSetPayload.d.ts","sourceRoot":"","sources":["../../../src/PayloadSet/PayloadSetPayload.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PayloadSetPayload.d.ts","sourceRoot":"","sources":["../../../src/PayloadSet/PayloadSetPayload.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAK7B,eAAO,MAAM,aAAa;;;iBAGxB,CAAA;AAEF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAEtD,eAAO,MAAM,oBAAoB;;;;;;iBAAsE,CAAA;AAEvG,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEpE,eAAO,MAAM,mBAAmB;;;;;;CAAqC,CAAA;AACrE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;CAA4D,CAAA;AAC5F,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;CAA4D,CAAA"}
|
package/dist/neutral/Query.d.ts
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import type { EmptyObject } from '@xylabs/sdk-js';
|
|
2
|
-
import
|
|
2
|
+
import * as z from 'zod/mini';
|
|
3
3
|
import type { Payload, SchemaField } from './Payload.ts';
|
|
4
4
|
import type { Schema } from './Schema.ts';
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
5
|
+
export declare const QueryFieldsZod: z.ZodMiniObject<{
|
|
6
|
+
address: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniUnion<readonly [z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<Lowercase<string> & {
|
|
7
|
+
readonly __hex: true;
|
|
8
|
+
} & {
|
|
9
|
+
readonly __address: true;
|
|
10
|
+
}, string>>, z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@xyo-network/address").XyoQuantAddress, string>>]>, z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<Lowercase<string> & {
|
|
11
|
+
readonly __hex: true;
|
|
12
|
+
} & {
|
|
13
|
+
readonly __address: true;
|
|
14
|
+
}, string>>, z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("@xyo-network/address").XyoQuantAddress, string>>]>>]>>;
|
|
15
|
+
budget: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
16
|
+
maxFrequency: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<"once">, z.ZodMiniLiteral<"second">, z.ZodMiniLiteral<"minute">, z.ZodMiniLiteral<"hour">, z.ZodMiniLiteral<"day">, z.ZodMiniLiteral<"week">, z.ZodMiniLiteral<"month">, z.ZodMiniLiteral<"year">]>>;
|
|
17
|
+
minBid: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export type QueryFields = z.infer<typeof QueryFieldsZod>;
|
|
15
20
|
export type Query<T extends void | EmptyObject | SchemaField = void, S extends Schema | void = void> = Payload<T extends void ? QueryFields : T & QueryFields, S extends void ? T extends SchemaField ? T['schema'] : T extends void ? Schema : void : S>;
|
|
16
21
|
//# sourceMappingURL=Query.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Query.d.ts","sourceRoot":"","sources":["../../src/Query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"Query.d.ts","sourceRoot":"","sources":["../../src/Query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAEjD,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAE7B,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzC,eAAO,MAAM,cAAc;;;;;;;;;;;;;iBAkBzB,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAExD,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,IAAI,GAAG,WAAW,GAAG,WAAW,GAAG,IAAI,EAAE,CAAC,SAAS,MAAM,GAAG,IAAI,GAAG,IAAI,IAAI,OAAO,CAC5G,CAAC,SAAS,IAAI,GAAG,WAAW,GAAG,CAAC,GAAG,WAAW,EAC9C,CAAC,SAAS,IAAI,GACV,CAAC,SAAS,WAAW,GAAG,CAAC,CAAC,QAAQ,CAAC,GACjC,CAAC,SAAS,IAAI,GAAG,MAAM,GACrB,IAAI,GACR,CAAC,CACN,CAAA"}
|
package/dist/neutral/index.mjs
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
// src/Error.ts
|
|
2
|
+
import {
|
|
3
|
+
HashZod as HashZod2,
|
|
4
|
+
zodAsFactory as zodAsFactory3,
|
|
5
|
+
zodIsFactory as zodIsFactory3,
|
|
6
|
+
zodToFactory as zodToFactory2
|
|
7
|
+
} from "@xylabs/sdk-js";
|
|
8
|
+
import * as z4 from "zod/mini";
|
|
9
|
+
|
|
1
10
|
// src/PayloadZod.ts
|
|
2
11
|
import {
|
|
3
12
|
HashZod,
|
|
@@ -254,6 +263,18 @@ var PayloadZodOfSchema = (schema) => z3.extend(PayloadZod, { schema: z3.literal(
|
|
|
254
263
|
var PayloadZodStrictOfSchema = (schema) => z3.extend(PayloadZodStrict, { schema: z3.literal(schema) });
|
|
255
264
|
var PayloadZodLooseOfSchema = (schema) => z3.extend(PayloadZodLoose, { schema: z3.literal(schema) });
|
|
256
265
|
|
|
266
|
+
// src/Error.ts
|
|
267
|
+
var ModuleErrorSchema = asSchema("network.xyo.error.module", true);
|
|
268
|
+
var ModuleErrorZod = z4.extend(PayloadZodOfSchema(ModuleErrorSchema), {
|
|
269
|
+
details: z4.optional(z4.custom()),
|
|
270
|
+
message: z4.optional(z4.string()),
|
|
271
|
+
name: z4.optional(z4.string()),
|
|
272
|
+
query: z4.optional(z4.union([HashZod2, SchemaZod]))
|
|
273
|
+
});
|
|
274
|
+
var isModuleError = zodIsFactory3(ModuleErrorZod);
|
|
275
|
+
var asModuleError = zodAsFactory3(ModuleErrorZod, "asModuleError");
|
|
276
|
+
var toModuleError = zodToFactory2(ModuleErrorZod, "toModuleError");
|
|
277
|
+
|
|
257
278
|
// src/isPayloadOfSchemaType.ts
|
|
258
279
|
function isPayloadOfSchemaType(schema) {
|
|
259
280
|
return (x) => isAnyPayload(x) && x?.schema === schema;
|
|
@@ -265,42 +286,79 @@ var notPayloadOfSchemaType = (schema) => {
|
|
|
265
286
|
return (x) => !isAnyPayload(x) || x?.schema !== schema;
|
|
266
287
|
};
|
|
267
288
|
|
|
268
|
-
// src/Error.ts
|
|
269
|
-
var ModuleErrorSchema = asSchema("network.xyo.error.module", true);
|
|
270
|
-
var isModuleError = isPayloadOfSchemaType(ModuleErrorSchema);
|
|
271
|
-
|
|
272
289
|
// src/isPayloadOfZodType.ts
|
|
273
290
|
import { isDefined } from "@xylabs/sdk-js";
|
|
274
|
-
import * as
|
|
291
|
+
import * as z5 from "zod/mini";
|
|
275
292
|
function isPayloadOfZodType(zodSchema, schema) {
|
|
276
293
|
return (x) => {
|
|
277
294
|
if (!isAnyPayload(x)) return false;
|
|
278
295
|
if (isDefined(schema) && x.schema !== schema) return false;
|
|
279
296
|
const { schema: _, ...data } = x;
|
|
280
|
-
return
|
|
297
|
+
return z5.safeParse(zodSchema, data).success;
|
|
281
298
|
};
|
|
282
299
|
}
|
|
283
300
|
|
|
284
301
|
// src/PayloadBundle.ts
|
|
285
302
|
import {
|
|
286
|
-
HashZod as
|
|
287
|
-
zodAsFactory as
|
|
288
|
-
zodIsFactory as
|
|
289
|
-
zodToFactory as
|
|
303
|
+
HashZod as HashZod3,
|
|
304
|
+
zodAsFactory as zodAsFactory4,
|
|
305
|
+
zodIsFactory as zodIsFactory4,
|
|
306
|
+
zodToFactory as zodToFactory3
|
|
290
307
|
} from "@xylabs/sdk-js";
|
|
291
|
-
import * as
|
|
308
|
+
import * as z6 from "zod/mini";
|
|
292
309
|
var PayloadBundleSchema = asSchema("network.xyo.payload.bundle", true);
|
|
293
|
-
var PayloadBundleFieldsZod =
|
|
294
|
-
payloads:
|
|
295
|
-
root:
|
|
310
|
+
var PayloadBundleFieldsZod = z6.object({
|
|
311
|
+
payloads: z6.array(PayloadZodLoose),
|
|
312
|
+
root: HashZod3
|
|
296
313
|
});
|
|
297
|
-
var PayloadBundleZod =
|
|
298
|
-
var isPayloadBundle =
|
|
299
|
-
var asPayloadBundle =
|
|
300
|
-
var asOptionalPayloadBundle =
|
|
314
|
+
var PayloadBundleZod = z6.extend(PayloadZodOfSchema(PayloadBundleSchema), PayloadBundleFieldsZod.shape);
|
|
315
|
+
var isPayloadBundle = zodIsFactory4(PayloadBundleZod);
|
|
316
|
+
var asPayloadBundle = zodAsFactory4(PayloadBundleZod, "asPayloadBundle");
|
|
317
|
+
var asOptionalPayloadBundle = zodToFactory3(PayloadBundleZod, "asPayloadBundle");
|
|
318
|
+
|
|
319
|
+
// src/PayloadSet/PayloadSetPayload.ts
|
|
320
|
+
import {
|
|
321
|
+
zodAsFactory as zodAsFactory5,
|
|
322
|
+
zodIsFactory as zodIsFactory5,
|
|
323
|
+
zodToFactory as zodToFactory4
|
|
324
|
+
} from "@xylabs/sdk-js";
|
|
325
|
+
import * as z7 from "zod/mini";
|
|
301
326
|
|
|
302
327
|
// src/PayloadSet/PayloadSetSchema.ts
|
|
303
328
|
var PayloadSetSchema = asSchema("network.xyo.payload.set", true);
|
|
329
|
+
|
|
330
|
+
// src/PayloadSet/PayloadSetPayload.ts
|
|
331
|
+
var PayloadSetZod = z7.object({
|
|
332
|
+
optional: z7.optional(z7.record(z7.string(), z7.number())),
|
|
333
|
+
required: z7.optional(z7.record(z7.string(), z7.number()))
|
|
334
|
+
});
|
|
335
|
+
var PayloadSetPayloadZod = z7.extend(PayloadZodOfSchema(PayloadSetSchema), PayloadSetZod.shape);
|
|
336
|
+
var isPayloadSetPayload = zodIsFactory5(PayloadSetPayloadZod);
|
|
337
|
+
var asPayloadSetPayload = zodAsFactory5(PayloadSetPayloadZod, "asPayloadSetPayload");
|
|
338
|
+
var toPayloadSetPayload = zodToFactory4(PayloadSetPayloadZod, "toPayloadSetPayload");
|
|
339
|
+
|
|
340
|
+
// src/Query.ts
|
|
341
|
+
import { XyoAddressZod } from "@xyo-network/address";
|
|
342
|
+
import * as z8 from "zod/mini";
|
|
343
|
+
var QueryFieldsZod = z8.object({
|
|
344
|
+
/** @field The addresses of the intended handlers */
|
|
345
|
+
address: z8.optional(z8.union([XyoAddressZod, z8.array(XyoAddressZod)])),
|
|
346
|
+
/** @field The maximum XYO that can be spent executing the query */
|
|
347
|
+
budget: z8.optional(z8.number()),
|
|
348
|
+
/** @field The frequency on which this query can be rerun */
|
|
349
|
+
maxFrequency: z8.optional(z8.union([
|
|
350
|
+
z8.literal("once"),
|
|
351
|
+
z8.literal("second"),
|
|
352
|
+
z8.literal("minute"),
|
|
353
|
+
z8.literal("hour"),
|
|
354
|
+
z8.literal("day"),
|
|
355
|
+
z8.literal("week"),
|
|
356
|
+
z8.literal("month"),
|
|
357
|
+
z8.literal("year")
|
|
358
|
+
])),
|
|
359
|
+
/** @field The starting point for the bidding on the query */
|
|
360
|
+
minBid: z8.optional(z8.number())
|
|
361
|
+
});
|
|
304
362
|
export {
|
|
305
363
|
AnyPayloadZod,
|
|
306
364
|
HashMetaZod,
|
|
@@ -308,12 +366,15 @@ export {
|
|
|
308
366
|
LocalSequenceFromStringZod,
|
|
309
367
|
LocalSequenceToStringZod,
|
|
310
368
|
ModuleErrorSchema,
|
|
369
|
+
ModuleErrorZod,
|
|
311
370
|
PayloadBundleFieldsZod,
|
|
312
371
|
PayloadBundleSchema,
|
|
313
372
|
PayloadBundleZod,
|
|
314
373
|
PayloadSchema,
|
|
315
374
|
PayloadSchemaZod,
|
|
375
|
+
PayloadSetPayloadZod,
|
|
316
376
|
PayloadSetSchema,
|
|
377
|
+
PayloadSetZod,
|
|
317
378
|
PayloadZod,
|
|
318
379
|
PayloadZodLoose,
|
|
319
380
|
PayloadZodLooseOfSchema,
|
|
@@ -323,6 +384,7 @@ export {
|
|
|
323
384
|
QualifiedSequenceConstants,
|
|
324
385
|
QualifiedSequenceFromStringZod,
|
|
325
386
|
QualifiedSequenceToStringZod,
|
|
387
|
+
QueryFieldsZod,
|
|
326
388
|
SchemaRegEx,
|
|
327
389
|
SchemaZod,
|
|
328
390
|
SequenceComparer,
|
|
@@ -339,10 +401,12 @@ export {
|
|
|
339
401
|
WithStorageMetaZod,
|
|
340
402
|
asAnyPayload,
|
|
341
403
|
asHashMeta,
|
|
404
|
+
asModuleError,
|
|
342
405
|
asOptionalPayloadBundle,
|
|
343
406
|
asOptionalSequenceStorageMeta,
|
|
344
407
|
asPayload,
|
|
345
408
|
asPayloadBundle,
|
|
409
|
+
asPayloadSetPayload,
|
|
346
410
|
asSchema,
|
|
347
411
|
asSequenceMeta,
|
|
348
412
|
asSequenceStorageMeta,
|
|
@@ -358,6 +422,7 @@ export {
|
|
|
358
422
|
isPayloadOfSchemaType,
|
|
359
423
|
isPayloadOfSchemaTypeWithSources,
|
|
360
424
|
isPayloadOfZodType,
|
|
425
|
+
isPayloadSetPayload,
|
|
361
426
|
isQualifiedSequence,
|
|
362
427
|
isSchema,
|
|
363
428
|
isSequence,
|
|
@@ -368,7 +433,9 @@ export {
|
|
|
368
433
|
notPayloadOfSchemaType,
|
|
369
434
|
toAnyPayload,
|
|
370
435
|
toHashMeta,
|
|
436
|
+
toModuleError,
|
|
371
437
|
toPayload,
|
|
438
|
+
toPayloadSetPayload,
|
|
372
439
|
toSchema,
|
|
373
440
|
toSequenceMeta,
|
|
374
441
|
toStorageMeta
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/PayloadZod.ts", "../../src/Schema.ts", "../../src/StorageMeta/Sequence.ts", "../../src/StorageMeta/sequence/Parser.ts", "../../src/StorageMeta/sequence/Sequence.ts", "../../src/StorageMeta/sequence/Comparer.ts", "../../src/StorageMeta/sequence/SequenceZod.ts", "../../src/isPayloadOfSchemaType.ts", "../../src/
|
|
4
|
-
"sourcesContent": ["import {\n HashZod,\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport * as z from 'zod/mini'\n\nimport type { Payload } from './Payload.ts'\nimport type { Schema } from './Schema.ts'\nimport { SchemaZod } from './Schema.ts'\nimport { SequenceFromStringZod } from './StorageMeta/index.ts'\n\nexport const HashMetaZod = z.object({\n _hash: HashZod,\n _dataHash: HashZod,\n})\n\nexport type HashMeta = z.infer<typeof HashMetaZod>\n\nexport type WithHashMeta<T extends Payload> = T & HashMeta\n\nexport const isHashMeta = zodIsFactory(HashMetaZod)\nexport const asHashMeta = zodAsFactory(HashMetaZod, 'asHashMeta')\nexport const toHashMeta = zodToFactory(HashMetaZod, 'toHashMeta')\n\nexport const SequenceMetaZod = z.object({ _sequence: SequenceFromStringZod })\n\nexport type SequenceMeta = z.infer<typeof SequenceMetaZod>\n\nexport const isSequenceMeta = zodIsFactory(SequenceMetaZod)\nexport const asSequenceMeta = zodAsFactory(SequenceMetaZod, 'asSequenceMeta')\nexport const toSequenceMeta = zodToFactory(SequenceMetaZod, 'toSequenceMeta')\n\nexport const StorageMetaZod = z.object({\n _hash: HashZod,\n _dataHash: HashZod,\n _sequence: SequenceFromStringZod,\n})\n\nexport type StorageMeta = z.infer<typeof StorageMetaZod>\n\nexport type WithStorageMeta<T extends Payload = Payload> = T & StorageMeta\n\nexport const isStorageMeta = zodIsFactory(StorageMetaZod)\nexport const asStorageMeta = zodAsFactory(StorageMetaZod, 'asStorageMeta')\nexport const toStorageMeta = zodToFactory(StorageMetaZod, 'toStorageMeta')\n\nexport const PayloadZod = z.object({ schema: SchemaZod })\n\nexport const isPayload = zodIsFactory(PayloadZod)\nexport const asPayload = zodAsFactory(PayloadZod, 'asPayload')\nexport const toPayload = zodToFactory(PayloadZod, 'toPayload')\n\nexport const AnyPayloadZod = z.looseObject({ schema: SchemaZod })\n\nexport const isAnyPayload = zodIsFactory(AnyPayloadZod)\nexport const asAnyPayload = zodAsFactory(AnyPayloadZod, 'asAnyPayload')\nexport const toAnyPayload = zodToFactory(AnyPayloadZod, 'toAnyPayload')\n\nexport type AnyPayload = z.infer<typeof AnyPayloadZod>\n\nexport function WithStorageMetaZod<T extends z.core.$ZodLooseShape>(valueZod: z.ZodMiniObject<T>) {\n return z.object({ ...valueZod.shape, ...StorageMetaZod.shape })\n}\n\nexport function WithHashMetaZod<T extends z.core.$ZodLooseShape>(valueZod: z.ZodMiniObject<T>) {\n return z.object({ ...valueZod.shape, ...HashMetaZod.shape })\n}\n\nexport const PayloadZodStrict = z.strictObject({ schema: SchemaZod })\nexport type PayloadZodStrict = typeof PayloadZodStrict\n\nexport const PayloadZodLoose: PayloadZodStrict = z.looseObject({ schema: SchemaZod })\nexport type PayloadZodLoose = typeof PayloadZodLoose\n\nexport const PayloadZodOfSchema = <S extends Schema>(schema: S) => z.extend(PayloadZod, { schema: z.literal(schema) })\nexport const PayloadZodStrictOfSchema = <S extends Schema>(schema: S) => z.extend(PayloadZodStrict, { schema: z.literal(schema) })\nexport const PayloadZodLooseOfSchema = <S extends Schema>(schema: S) => z.extend(PayloadZodLoose, { schema: z.literal(schema) })\n", "import type { Brand } from '@xylabs/sdk-js'\nimport { zodAsFactory, zodIsFactory } from '@xylabs/sdk-js'\nimport * as z from 'zod/mini'\n\nexport type BrandedSchema<T extends string = string> = Brand<T, { readonly __schema: true }>\nexport const SchemaRegEx = /^(?:[a-z0-9]+\\.)*[a-z0-9]+$/\n\nexport const SchemaZod = z.pipe(z.string().check(z.regex(SchemaRegEx)), z.transform((v: string): BrandedSchema => v as BrandedSchema))\nexport type Schema<T extends string = string> = z.infer<typeof SchemaZod> & BrandedSchema<T>\n\nexport const makeSchema = <T extends string>(value: T) => {\n return z.pipe(z.literal(value), z.transform((x: T): T & { __schema: true } => x as T & { __schema: true }))\n}\n\nexport const isSchema = zodIsFactory(SchemaZod)\nexport const asSchema = zodAsFactory(SchemaZod, 'asSchema')\nexport const toSchema = zodAsFactory(SchemaZod, 'toSchema')\n\nexport const PayloadSchema = asSchema('network.xyo.payload', true)\nexport const PayloadSchemaZod = z.literal(PayloadSchema)\nexport type PayloadSchema = z.infer<typeof PayloadSchemaZod>\n", "import { AsObjectFactory } from '@xylabs/sdk-js'\n\nimport type { Payload } from '../Payload.ts'\nimport type { Sequence } from './sequence/index.ts'\n\nexport interface SequenceStorageMeta {\n _sequence: Sequence\n}\n\nexport type WithSequenceStorageMeta<T extends Payload = Payload> = T & SequenceStorageMeta\nexport type WithPartialSequenceStorageMeta<T extends Payload = Payload> = Partial<WithSequenceStorageMeta<T>>\n\nexport const isSequenceStorageMeta = (value: unknown): value is SequenceStorageMeta => {\n return (value as WithSequenceStorageMeta)?._sequence != undefined\n}\n\nexport const asSequenceStorageMeta = AsObjectFactory.create(isSequenceStorageMeta)\nexport const asOptionalSequenceStorageMeta = AsObjectFactory.createOptional(isSequenceStorageMeta)\n", "import type { Hash, Hex } from '@xylabs/sdk-js'\nimport {\n assertEx, isAddress, toAddress, toHex, toUint8Array,\n} from '@xylabs/sdk-js'\nimport type { XyoLegacyAddress } from '@xyo-network/address'\n\nimport type {\n Epoch, LocalSequence, Nonce, QualifiedSequence,\n Sequence,\n} from './Sequence.ts'\nimport {\n isQualifiedSequence, isSequence,\n SequenceConstants,\n} from './Sequence.ts'\n\nexport class SequenceParser {\n protected static privateConstructorKey = Date.now().toString()\n\n private readonly data: Readonly<Uint8Array>\n\n protected constructor(privateConstructorKey: string, hex: Hex) {\n assertEx(SequenceParser.privateConstructorKey === privateConstructorKey, () => 'Use create function instead of constructor')\n const paddedHex = toHex(hex, {\n prefix: false,\n bitLength: (hex.length <= SequenceConstants.localSequenceBytes * 2)\n ? SequenceConstants.localSequenceBytes * 8\n : SequenceConstants.qualifiedSequenceBytes * 8,\n })\n this.data = toUint8Array(paddedHex)\n }\n\n get address(): XyoLegacyAddress {\n const start = SequenceConstants.localSequenceBytes\n const end = SequenceConstants.qualifiedSequenceBytes\n return toAddress(this.data.slice(start, end).buffer, { prefix: false })\n }\n\n get epoch(): Epoch {\n const start = 0\n const end = SequenceConstants.epochBytes\n return toHex(this.data.slice(start, end).buffer, { prefix: false }) as Epoch\n }\n\n get localSequence(): LocalSequence {\n const start = 0\n const end = SequenceConstants.localSequenceBytes\n return toHex(this.data.slice(start, end).buffer, { prefix: false }) as LocalSequence\n }\n\n get nonce(): Nonce {\n const start = SequenceConstants.epochBytes\n const end = SequenceConstants.localSequenceBytes\n return toHex(this.data.slice(start, end).buffer, { prefix: false }) as Nonce\n }\n\n get qualifiedSequence(): QualifiedSequence {\n const start = 0\n const end = SequenceConstants.qualifiedSequenceBytes\n return toHex(this.data.slice(start, end).buffer, { prefix: false }) as QualifiedSequence\n }\n\n static from(sequence: Sequence, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: Hex, hash: Hash, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: Hex, hash: Hex, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: Hex, nonce: Nonce, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: Hex, hash: Hash, index?: number, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: Hex, hash: Hex, index?: number, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: Hex, nonce: Nonce, index?: number, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: number, hash: Hash, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: number, hash: Hex, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: number, nonce: Nonce, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: number, hash: Hash, index?: number, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: number, hash: Hex, index?: number, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: number, nonce: Nonce, index?: number, address?: XyoLegacyAddress): SequenceParser\n static from(\n timestampOrSequence: Hex | number,\n nonceOrAddress?: Hex,\n addressOrIndex?: XyoLegacyAddress | number,\n addressOnly?: XyoLegacyAddress,\n ): SequenceParser {\n const address = typeof addressOrIndex === 'number' ? addressOnly : addressOrIndex\n const index = typeof addressOrIndex === 'number' ? addressOrIndex : undefined\n if (isSequence(timestampOrSequence)) {\n if (nonceOrAddress) {\n assertEx(!isQualifiedSequence(timestampOrSequence), () => 'Providing both a qualified sequence and a address is not allowed')\n assertEx(isAddress(nonceOrAddress), () => 'Invalid address provided')\n return new this(SequenceParser.privateConstructorKey, (timestampOrSequence + address) as Hex)\n }\n return new this(SequenceParser.privateConstructorKey, timestampOrSequence)\n }\n const epoch = SequenceParser.toEpoch(timestampOrSequence)\n const nonce = nonceOrAddress === undefined ? undefined : SequenceParser.toNonce(nonceOrAddress, index)\n const addressHex: Hex = address ? toHex(address, { bitLength: SequenceConstants.addressBytes * 8 }) : SequenceConstants.minAddress\n const hexString = (epoch + nonce + addressHex) as Hex\n assertEx(isSequence(hexString), () => `Invalid sequence [${hexString}] [${epoch}, ${nonce}, ${addressHex}]`)\n return new this(SequenceParser.privateConstructorKey, hexString)\n }\n\n static parse(value: Hex | string | ArrayBufferLike): SequenceParser {\n const hex = toHex(value)\n if (isSequence(hex)) {\n return new this(SequenceParser.privateConstructorKey, hex)\n }\n throw new Error(`Invalid sequence [${hex}]`)\n }\n\n // can convert a short number/hex to an epoch (treats it as the whole value) or extract an epoch from a sequence\n static toEpoch(value: number | Hex | Epoch): Epoch {\n assertEx(\n typeof value !== 'number' || Number.isInteger(value),\n () => 'Value must be in integer',\n )\n const hex = toHex(value, { prefix: false })\n if (hex.length <= SequenceConstants.epochBytes * 2) {\n return toHex(value, { prefix: false, bitLength: SequenceConstants.epochBytes * 8 }) as Epoch\n }\n if (isSequence(hex)) {\n return hex.slice(0, SequenceConstants.epochBytes * 2) as Epoch\n }\n throw new Error(`Value could not be converted to epoch [${hex}]`)\n }\n\n // can convert a short number/hex to a nonce (treats it as the whole value) or extract an nonce from a sequence\n static toNonce(value: Hash | Hex, index = 0): Nonce {\n assertEx(\n typeof value !== 'number' || Number.isInteger(value),\n () => 'Value must be in integer',\n )\n const hex = toHex(value, { prefix: false })\n if (isSequence(hex)) {\n return hex.slice(SequenceConstants.epochBytes * 2, SequenceConstants.localSequenceBytes * 2) as Nonce\n }\n const hashHex = toHex(hex, { prefix: false, bitLength: SequenceConstants.nonceHashBytes * 8 }).slice(-SequenceConstants.nonceHashBytes * 2)\n const indexHex = toHex(index, { prefix: false, bitLength: SequenceConstants.nonceIndexBytes * 8 }).slice(-SequenceConstants.nonceIndexBytes * 2)\n return (indexHex + hashHex).slice(-SequenceConstants.nonceBytes * 2) as Nonce\n }\n}\n", "import type { Brand, Hex } from '@xylabs/sdk-js'\nimport { isHex } from '@xylabs/sdk-js'\nimport type { XyoLegacyAddress } from '@xyo-network/address'\n\n// we use Exclude to intentionally make the type not equal to string\nexport type LocalSequence = Brand<Hex, { __localSequence: true }>\nexport type QualifiedSequence = Brand<Hex, { __qualifiedSequence: true }>\nexport type Sequence = LocalSequence | QualifiedSequence\n\nexport type Epoch = Brand<Hex, { __epoch: true }>\n\nexport const isEpoch = (value: unknown): value is Epoch => {\n return isHex(value) && (value as string).length === SequenceConstants.epochBytes * 2\n}\n\nexport type Nonce = Brand<Hex, { __nonce: true }>\n\nexport const isNonce = (value: unknown): value is Nonce => {\n return isHex(value) && (value as string).length === SequenceConstants.nonceBytes * 2\n}\n\nexport const isLocalSequence = (value: unknown): value is LocalSequence => {\n return isHex(value) && (value as string).length === SequenceConstants.localSequenceBytes * 2\n}\n\nexport const isQualifiedSequence = (value: unknown): value is QualifiedSequence => {\n return isHex(value) && (value as string).length === SequenceConstants.qualifiedSequenceBytes * 2\n}\n\nexport const isSequence = (value: unknown): value is Sequence => {\n return isLocalSequence(value) || isQualifiedSequence(value)\n}\n\nexport const SequenceNonceComponentLengths = {\n nonceIndexBytes: 4,\n nonceHashBytes: 4,\n}\n\nexport const SequenceComponentLengths = {\n ...SequenceNonceComponentLengths,\n epochBytes: 8,\n nonceBytes: SequenceNonceComponentLengths.nonceIndexBytes + SequenceNonceComponentLengths.nonceHashBytes,\n addressBytes: 20,\n}\n\nexport const SequenceComponentMinMax = {\n minEpoch: '0'.repeat(SequenceComponentLengths.epochBytes * 2) as Epoch,\n maxEpoch: 'f'.repeat(SequenceComponentLengths.epochBytes * 2) as Epoch,\n minNonce: '0'.repeat(SequenceComponentLengths.nonceBytes * 2) as Nonce,\n maxNonce: 'f'.repeat(SequenceComponentLengths.nonceBytes * 2) as Nonce,\n minAddress: '0'.repeat(SequenceComponentLengths.addressBytes * 2) as XyoLegacyAddress,\n maxAddress: 'f'.repeat(SequenceComponentLengths.addressBytes * 2) as XyoLegacyAddress,\n}\n\nexport const LocalSequenceConstants = {\n ...SequenceComponentLengths,\n ...SequenceComponentMinMax,\n localSequenceBytes: SequenceComponentLengths.epochBytes + SequenceComponentLengths.nonceBytes,\n minLocalSequence: SequenceComponentMinMax.minEpoch + SequenceComponentMinMax.minNonce as LocalSequence,\n maxLocalSequence: SequenceComponentMinMax.maxEpoch + SequenceComponentMinMax.maxNonce as LocalSequence,\n}\n\nexport const QualifiedSequenceConstants = {\n qualifiedSequenceBytes: LocalSequenceConstants.localSequenceBytes + SequenceComponentLengths.addressBytes,\n minQualifiedSequence: LocalSequenceConstants.minLocalSequence + SequenceComponentMinMax.minAddress as QualifiedSequence,\n maxQualifiedSequence: LocalSequenceConstants.maxLocalSequence + SequenceComponentMinMax.maxAddress as QualifiedSequence,\n}\n\nexport const SequenceConstants = {\n ...LocalSequenceConstants,\n ...QualifiedSequenceConstants,\n}\n\n// \"11111111111111112222222222222222\" is and example of a local sequence string\n\n// \"111111111111111122222222222222223333333333333333333333333333333333333333\" is and example of a local sequence string\n// epoch = \"1111111111111111\"\n// nonce = \"2222222222222222\"\n// address = \"3333333333333333333333333333333333333333\"\n", "import type { Compare } from '@xylabs/sdk-js'\n\nimport { SequenceParser } from './Parser.ts'\nimport type { Sequence } from './Sequence.ts'\n\nconst local: Compare<Sequence> = (a, b) => {\n const aa = SequenceParser.from(a)\n const bb = SequenceParser.from(b)\n return aa.localSequence > bb.localSequence ? 1 : aa.localSequence < bb.localSequence ? -1 : 0\n}\n\nconst qualified: Compare<Sequence> = (a, b) => {\n const aa = SequenceParser.from(a)\n const bb = SequenceParser.from(b)\n return aa.qualifiedSequence > bb.qualifiedSequence ? 1 : aa.qualifiedSequence < bb.qualifiedSequence ? -1 : 0\n}\n\nexport const SequenceComparer = { local, qualified }\n", "import { HexRegExMinMax, toHex } from '@xylabs/sdk-js'\nimport * as z from 'zod/mini'\n\nimport type { LocalSequence, QualifiedSequence } from './Sequence.ts'\nimport { SequenceConstants } from './Sequence.ts'\n\nconst LocalSequenceRegex = new RegExp(HexRegExMinMax(SequenceConstants.localSequenceBytes, SequenceConstants.localSequenceBytes))\nexport const LocalSequenceToStringZod = z.string().check(z.regex(LocalSequenceRegex))\nexport const LocalSequenceFromStringZod = z.pipe(\n z.string().check(z.regex(LocalSequenceRegex)),\n z.transform((v: string): LocalSequence => toHex(v) as LocalSequence),\n)\n\nconst QualifiedSequenceRegex = new RegExp(HexRegExMinMax(SequenceConstants.qualifiedSequenceBytes, SequenceConstants.qualifiedSequenceBytes))\nexport const QualifiedSequenceToStringZod = z.string().check(z.regex(QualifiedSequenceRegex))\nexport const QualifiedSequenceFromStringZod = z.pipe(\n z.string().check(z.regex(QualifiedSequenceRegex)),\n z.transform((v: string): QualifiedSequence => toHex(v) as QualifiedSequence),\n)\n\nexport const SequenceToStringZod = z.union([LocalSequenceToStringZod, QualifiedSequenceToStringZod])\nexport const SequenceFromStringZod = z.union([LocalSequenceFromStringZod, QualifiedSequenceFromStringZod])\n", "import type { Payload, WithSources } from './Payload.ts'\nimport { isAnyPayload } from './PayloadZod.ts'\n\nexport function isPayloadOfSchemaType<T extends Payload = never>(schema: T['schema']) {\n return (x?: unknown): x is T => isAnyPayload(x) && x?.schema === schema\n}\n\nexport const isPayloadOfSchemaTypeWithSources = <T extends Payload = never>(schema: T['schema']) => {\n return (x?: unknown): x is WithSources<T> =>\n isPayloadOfSchemaType<WithSources<T>>(schema)(x) && x.$sources != undefined && Array.isArray(x.$sources)\n}\n\nexport const notPayloadOfSchemaType = <T extends Payload = never>(schema: T['schema']) => {\n return (x?: unknown): x is T => !isAnyPayload(x) || x?.schema !== schema\n}\n\n// test types -- keep for future validation, but comment out\n\n/*\ntype TestSchema = 'network.xyo.test'\nconst TestSchema: TestSchema = 'network.xyo.test'\n\ntype Test = Payload<{ field: string }, TestSchema>\n\nconst testPayload: Test = { field: 'test', schema: TestSchema }\n\nconst testPayloads: Payload[] = [testPayload]\n\nconst isTest: Test[] = testPayloads.filter(isPayloadOfSchemaType<Payload>(TestSchema))\n\nconst isTestFromMetaTyped = testMetaPayloads.filter(isPayloadOfSchemaType<Test>(TestSchema))\n*/\n", "import type { Hash, JsonValue } from '@xylabs/sdk-js'\n\nimport { isPayloadOfSchemaType } from './isPayloadOfSchemaType.ts'\nimport type { Payload } from './Payload.ts'\nimport { asSchema, type Schema } from './Schema.ts'\n\nexport const ModuleErrorSchema = asSchema('network.xyo.error.module', true)\nexport type ModuleErrorSchema = typeof ModuleErrorSchema\n\nexport type ModuleError = Payload<{\n details?: JsonValue\n message?: string\n name?: string\n query?: Hash | Schema\n}, ModuleErrorSchema>\n\nexport const isModuleError = isPayloadOfSchemaType<ModuleError>(ModuleErrorSchema)\n", "import { isDefined } from '@xylabs/sdk-js'\nimport * as z from 'zod/mini'\n\nimport type { Payload } from './Payload.ts'\nimport { isAnyPayload } from './PayloadZod.ts'\n\n/**\n * Checks if a value is a payload of a specific Zod type.\n * @param zodSchema The Zod schema to validate against\n * @param schema The schema string to match against the payload. Optional in\n * case you want to validate any payload matching the Zod schema or in case\n * schema is part of the Zod schema.\n * @returns A function that checks if a value is a payload of the specified Zod type\n */\nexport function isPayloadOfZodType<\n T extends Payload = never,\n S extends z.core.$ZodObject = z.core.$ZodObject,\n>(zodSchema: S, schema?: T['schema']) {\n return (x?: unknown): x is T => {\n if (!isAnyPayload(x)) return false\n if (isDefined(schema) && x.schema !== schema) return false\n const { schema: _, ...data } = x\n return z.safeParse(zodSchema, data).success\n }\n}\n", "import {\n HashZod,\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport * as z from 'zod/mini'\n\nimport { PayloadZodLoose, PayloadZodOfSchema } from './PayloadZod.ts'\nimport { asSchema } from './Schema.ts'\n\n// payload that wraps a complete boundwitness with its payloads for use in systems such as submission queues\nexport const PayloadBundleSchema = asSchema('network.xyo.payload.bundle', true)\nexport type PayloadBundleSchema = typeof PayloadBundleSchema\n\nexport const PayloadBundleFieldsZod = z.object({\n payloads: z.array(PayloadZodLoose),\n root: HashZod,\n})\n\nexport type PayloadBundleFields = z.infer<typeof PayloadBundleFieldsZod>\n\nexport const PayloadBundleZod = z.extend(PayloadZodOfSchema(PayloadBundleSchema), PayloadBundleFieldsZod.shape)\n\nexport type PayloadBundle = z.infer<typeof PayloadBundleZod>\n\nexport const isPayloadBundle = zodIsFactory(PayloadBundleZod)\nexport const asPayloadBundle = zodAsFactory(PayloadBundleZod, 'asPayloadBundle')\nexport const asOptionalPayloadBundle = zodToFactory(PayloadBundleZod, 'asPayloadBundle')\n", "import { asSchema } from '../Schema.ts'\n\nexport const PayloadSetSchema = asSchema('network.xyo.payload.set', true)\nexport type PayloadSetSchema = typeof PayloadSetSchema\n"],
|
|
5
|
-
"mappings": ";AAAA;AAAA,EACE;AAAA,EACA,
|
|
6
|
-
"names": ["zodAsFactory", "zodIsFactory", "z", "toHex", "z", "toHex", "zodIsFactory", "zodAsFactory", "z", "HashZod", "zodAsFactory", "zodIsFactory", "zodToFactory", "z", "HashZod", "zodIsFactory", "zodAsFactory", "zodToFactory"]
|
|
3
|
+
"sources": ["../../src/Error.ts", "../../src/PayloadZod.ts", "../../src/Schema.ts", "../../src/StorageMeta/Sequence.ts", "../../src/StorageMeta/sequence/Parser.ts", "../../src/StorageMeta/sequence/Sequence.ts", "../../src/StorageMeta/sequence/Comparer.ts", "../../src/StorageMeta/sequence/SequenceZod.ts", "../../src/isPayloadOfSchemaType.ts", "../../src/isPayloadOfZodType.ts", "../../src/PayloadBundle.ts", "../../src/PayloadSet/PayloadSetPayload.ts", "../../src/PayloadSet/PayloadSetSchema.ts", "../../src/Query.ts"],
|
|
4
|
+
"sourcesContent": ["import type { JsonValue } from '@xylabs/sdk-js'\nimport {\n HashZod, zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport * as z from 'zod/mini'\n\nimport { PayloadZodOfSchema } from './PayloadZod.ts'\nimport { asSchema, SchemaZod } from './Schema.ts'\n\nexport const ModuleErrorSchema = asSchema('network.xyo.error.module', true)\nexport type ModuleErrorSchema = typeof ModuleErrorSchema\n\nexport const ModuleErrorZod = z.extend(PayloadZodOfSchema(ModuleErrorSchema), {\n details: z.optional(z.custom<JsonValue>()),\n message: z.optional(z.string()),\n name: z.optional(z.string()),\n query: z.optional(z.union([HashZod, SchemaZod])),\n})\n\nexport type ModuleError = z.infer<typeof ModuleErrorZod>\n\nexport const isModuleError = zodIsFactory(ModuleErrorZod)\nexport const asModuleError = zodAsFactory(ModuleErrorZod, 'asModuleError')\nexport const toModuleError = zodToFactory(ModuleErrorZod, 'toModuleError')\n", "import {\n HashZod,\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport * as z from 'zod/mini'\n\nimport type { Payload } from './Payload.ts'\nimport type { Schema } from './Schema.ts'\nimport { SchemaZod } from './Schema.ts'\nimport { SequenceFromStringZod } from './StorageMeta/index.ts'\n\nexport const HashMetaZod = z.object({\n _hash: HashZod,\n _dataHash: HashZod,\n})\n\nexport type HashMeta = z.infer<typeof HashMetaZod>\n\nexport type WithHashMeta<T extends Payload> = T & HashMeta\n\nexport const isHashMeta = zodIsFactory(HashMetaZod)\nexport const asHashMeta = zodAsFactory(HashMetaZod, 'asHashMeta')\nexport const toHashMeta = zodToFactory(HashMetaZod, 'toHashMeta')\n\nexport const SequenceMetaZod = z.object({ _sequence: SequenceFromStringZod })\n\nexport type SequenceMeta = z.infer<typeof SequenceMetaZod>\n\nexport const isSequenceMeta = zodIsFactory(SequenceMetaZod)\nexport const asSequenceMeta = zodAsFactory(SequenceMetaZod, 'asSequenceMeta')\nexport const toSequenceMeta = zodToFactory(SequenceMetaZod, 'toSequenceMeta')\n\nexport const StorageMetaZod = z.object({\n _hash: HashZod,\n _dataHash: HashZod,\n _sequence: SequenceFromStringZod,\n})\n\nexport type StorageMeta = z.infer<typeof StorageMetaZod>\n\nexport type WithStorageMeta<T extends Payload = Payload> = T & StorageMeta\n\nexport const isStorageMeta = zodIsFactory(StorageMetaZod)\nexport const asStorageMeta = zodAsFactory(StorageMetaZod, 'asStorageMeta')\nexport const toStorageMeta = zodToFactory(StorageMetaZod, 'toStorageMeta')\n\nexport const PayloadZod = z.object({ schema: SchemaZod })\n\nexport const isPayload = zodIsFactory(PayloadZod)\nexport const asPayload = zodAsFactory(PayloadZod, 'asPayload')\nexport const toPayload = zodToFactory(PayloadZod, 'toPayload')\n\nexport const AnyPayloadZod = z.looseObject({ schema: SchemaZod })\n\nexport const isAnyPayload = zodIsFactory(AnyPayloadZod)\nexport const asAnyPayload = zodAsFactory(AnyPayloadZod, 'asAnyPayload')\nexport const toAnyPayload = zodToFactory(AnyPayloadZod, 'toAnyPayload')\n\nexport type AnyPayload = z.infer<typeof AnyPayloadZod>\n\nexport function WithStorageMetaZod<T extends z.core.$ZodLooseShape>(valueZod: z.ZodMiniObject<T>) {\n return z.object({ ...valueZod.shape, ...StorageMetaZod.shape })\n}\n\nexport function WithHashMetaZod<T extends z.core.$ZodLooseShape>(valueZod: z.ZodMiniObject<T>) {\n return z.object({ ...valueZod.shape, ...HashMetaZod.shape })\n}\n\nexport const PayloadZodStrict = z.strictObject({ schema: SchemaZod })\nexport type PayloadZodStrict = typeof PayloadZodStrict\n\nexport const PayloadZodLoose: PayloadZodStrict = z.looseObject({ schema: SchemaZod })\nexport type PayloadZodLoose = typeof PayloadZodLoose\n\nexport const PayloadZodOfSchema = <S extends Schema>(schema: S) => z.extend(PayloadZod, { schema: z.literal(schema) })\nexport const PayloadZodStrictOfSchema = <S extends Schema>(schema: S) => z.extend(PayloadZodStrict, { schema: z.literal(schema) })\nexport const PayloadZodLooseOfSchema = <S extends Schema>(schema: S) => z.extend(PayloadZodLoose, { schema: z.literal(schema) })\n", "import type { Brand } from '@xylabs/sdk-js'\nimport { zodAsFactory, zodIsFactory } from '@xylabs/sdk-js'\nimport * as z from 'zod/mini'\n\nexport type BrandedSchema<T extends string = string> = Brand<T, { readonly __schema: true }>\nexport const SchemaRegEx = /^(?:[a-z0-9]+\\.)*[a-z0-9]+$/\n\nexport const SchemaZod = z.pipe(z.string().check(z.regex(SchemaRegEx)), z.transform((v: string): BrandedSchema => v as BrandedSchema))\nexport type Schema<T extends string = string> = z.infer<typeof SchemaZod> & BrandedSchema<T>\n\nexport const makeSchema = <T extends string>(value: T) => {\n return z.pipe(z.literal(value), z.transform((x: T): T & { __schema: true } => x as T & { __schema: true }))\n}\n\nexport const isSchema = zodIsFactory(SchemaZod)\nexport const asSchema = zodAsFactory(SchemaZod, 'asSchema')\nexport const toSchema = zodAsFactory(SchemaZod, 'toSchema')\n\nexport const PayloadSchema = asSchema('network.xyo.payload', true)\nexport const PayloadSchemaZod = z.literal(PayloadSchema)\nexport type PayloadSchema = z.infer<typeof PayloadSchemaZod>\n", "import { AsObjectFactory } from '@xylabs/sdk-js'\n\nimport type { Payload } from '../Payload.ts'\nimport type { Sequence } from './sequence/index.ts'\n\nexport interface SequenceStorageMeta {\n _sequence: Sequence\n}\n\nexport type WithSequenceStorageMeta<T extends Payload = Payload> = T & SequenceStorageMeta\nexport type WithPartialSequenceStorageMeta<T extends Payload = Payload> = Partial<WithSequenceStorageMeta<T>>\n\nexport const isSequenceStorageMeta = (value: unknown): value is SequenceStorageMeta => {\n return (value as WithSequenceStorageMeta)?._sequence != undefined\n}\n\nexport const asSequenceStorageMeta = AsObjectFactory.create(isSequenceStorageMeta)\nexport const asOptionalSequenceStorageMeta = AsObjectFactory.createOptional(isSequenceStorageMeta)\n", "import type { Hash, Hex } from '@xylabs/sdk-js'\nimport {\n assertEx, isAddress, toAddress, toHex, toUint8Array,\n} from '@xylabs/sdk-js'\nimport type { XyoLegacyAddress } from '@xyo-network/address'\n\nimport type {\n Epoch, LocalSequence, Nonce, QualifiedSequence,\n Sequence,\n} from './Sequence.ts'\nimport {\n isQualifiedSequence, isSequence,\n SequenceConstants,\n} from './Sequence.ts'\n\nexport class SequenceParser {\n protected static privateConstructorKey = Date.now().toString()\n\n private readonly data: Readonly<Uint8Array>\n\n protected constructor(privateConstructorKey: string, hex: Hex) {\n assertEx(SequenceParser.privateConstructorKey === privateConstructorKey, () => 'Use create function instead of constructor')\n const paddedHex = toHex(hex, {\n prefix: false,\n bitLength: (hex.length <= SequenceConstants.localSequenceBytes * 2)\n ? SequenceConstants.localSequenceBytes * 8\n : SequenceConstants.qualifiedSequenceBytes * 8,\n })\n this.data = toUint8Array(paddedHex)\n }\n\n get address(): XyoLegacyAddress {\n const start = SequenceConstants.localSequenceBytes\n const end = SequenceConstants.qualifiedSequenceBytes\n return toAddress(this.data.slice(start, end).buffer, { prefix: false })\n }\n\n get epoch(): Epoch {\n const start = 0\n const end = SequenceConstants.epochBytes\n return toHex(this.data.slice(start, end).buffer, { prefix: false }) as Epoch\n }\n\n get localSequence(): LocalSequence {\n const start = 0\n const end = SequenceConstants.localSequenceBytes\n return toHex(this.data.slice(start, end).buffer, { prefix: false }) as LocalSequence\n }\n\n get nonce(): Nonce {\n const start = SequenceConstants.epochBytes\n const end = SequenceConstants.localSequenceBytes\n return toHex(this.data.slice(start, end).buffer, { prefix: false }) as Nonce\n }\n\n get qualifiedSequence(): QualifiedSequence {\n const start = 0\n const end = SequenceConstants.qualifiedSequenceBytes\n return toHex(this.data.slice(start, end).buffer, { prefix: false }) as QualifiedSequence\n }\n\n static from(sequence: Sequence, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: Hex, hash: Hash, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: Hex, hash: Hex, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: Hex, nonce: Nonce, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: Hex, hash: Hash, index?: number, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: Hex, hash: Hex, index?: number, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: Hex, nonce: Nonce, index?: number, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: number, hash: Hash, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: number, hash: Hex, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: number, nonce: Nonce, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: number, hash: Hash, index?: number, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: number, hash: Hex, index?: number, address?: XyoLegacyAddress): SequenceParser\n static from(timestamp: number, nonce: Nonce, index?: number, address?: XyoLegacyAddress): SequenceParser\n static from(\n timestampOrSequence: Hex | number,\n nonceOrAddress?: Hex,\n addressOrIndex?: XyoLegacyAddress | number,\n addressOnly?: XyoLegacyAddress,\n ): SequenceParser {\n const address = typeof addressOrIndex === 'number' ? addressOnly : addressOrIndex\n const index = typeof addressOrIndex === 'number' ? addressOrIndex : undefined\n if (isSequence(timestampOrSequence)) {\n if (nonceOrAddress) {\n assertEx(!isQualifiedSequence(timestampOrSequence), () => 'Providing both a qualified sequence and a address is not allowed')\n assertEx(isAddress(nonceOrAddress), () => 'Invalid address provided')\n return new this(SequenceParser.privateConstructorKey, (timestampOrSequence + address) as Hex)\n }\n return new this(SequenceParser.privateConstructorKey, timestampOrSequence)\n }\n const epoch = SequenceParser.toEpoch(timestampOrSequence)\n const nonce = nonceOrAddress === undefined ? undefined : SequenceParser.toNonce(nonceOrAddress, index)\n const addressHex: Hex = address ? toHex(address, { bitLength: SequenceConstants.addressBytes * 8 }) : SequenceConstants.minAddress\n const hexString = (epoch + nonce + addressHex) as Hex\n assertEx(isSequence(hexString), () => `Invalid sequence [${hexString}] [${epoch}, ${nonce}, ${addressHex}]`)\n return new this(SequenceParser.privateConstructorKey, hexString)\n }\n\n static parse(value: Hex | string | ArrayBufferLike): SequenceParser {\n const hex = toHex(value)\n if (isSequence(hex)) {\n return new this(SequenceParser.privateConstructorKey, hex)\n }\n throw new Error(`Invalid sequence [${hex}]`)\n }\n\n // can convert a short number/hex to an epoch (treats it as the whole value) or extract an epoch from a sequence\n static toEpoch(value: number | Hex | Epoch): Epoch {\n assertEx(\n typeof value !== 'number' || Number.isInteger(value),\n () => 'Value must be in integer',\n )\n const hex = toHex(value, { prefix: false })\n if (hex.length <= SequenceConstants.epochBytes * 2) {\n return toHex(value, { prefix: false, bitLength: SequenceConstants.epochBytes * 8 }) as Epoch\n }\n if (isSequence(hex)) {\n return hex.slice(0, SequenceConstants.epochBytes * 2) as Epoch\n }\n throw new Error(`Value could not be converted to epoch [${hex}]`)\n }\n\n // can convert a short number/hex to a nonce (treats it as the whole value) or extract an nonce from a sequence\n static toNonce(value: Hash | Hex, index = 0): Nonce {\n assertEx(\n typeof value !== 'number' || Number.isInteger(value),\n () => 'Value must be in integer',\n )\n const hex = toHex(value, { prefix: false })\n if (isSequence(hex)) {\n return hex.slice(SequenceConstants.epochBytes * 2, SequenceConstants.localSequenceBytes * 2) as Nonce\n }\n const hashHex = toHex(hex, { prefix: false, bitLength: SequenceConstants.nonceHashBytes * 8 }).slice(-SequenceConstants.nonceHashBytes * 2)\n const indexHex = toHex(index, { prefix: false, bitLength: SequenceConstants.nonceIndexBytes * 8 }).slice(-SequenceConstants.nonceIndexBytes * 2)\n return (indexHex + hashHex).slice(-SequenceConstants.nonceBytes * 2) as Nonce\n }\n}\n", "import type { Brand, Hex } from '@xylabs/sdk-js'\nimport { isHex } from '@xylabs/sdk-js'\nimport type { XyoLegacyAddress } from '@xyo-network/address'\n\n// we use Exclude to intentionally make the type not equal to string\nexport type LocalSequence = Brand<Hex, { __localSequence: true }>\nexport type QualifiedSequence = Brand<Hex, { __qualifiedSequence: true }>\nexport type Sequence = LocalSequence | QualifiedSequence\n\nexport type Epoch = Brand<Hex, { __epoch: true }>\n\nexport const isEpoch = (value: unknown): value is Epoch => {\n return isHex(value) && (value as string).length === SequenceConstants.epochBytes * 2\n}\n\nexport type Nonce = Brand<Hex, { __nonce: true }>\n\nexport const isNonce = (value: unknown): value is Nonce => {\n return isHex(value) && (value as string).length === SequenceConstants.nonceBytes * 2\n}\n\nexport const isLocalSequence = (value: unknown): value is LocalSequence => {\n return isHex(value) && (value as string).length === SequenceConstants.localSequenceBytes * 2\n}\n\nexport const isQualifiedSequence = (value: unknown): value is QualifiedSequence => {\n return isHex(value) && (value as string).length === SequenceConstants.qualifiedSequenceBytes * 2\n}\n\nexport const isSequence = (value: unknown): value is Sequence => {\n return isLocalSequence(value) || isQualifiedSequence(value)\n}\n\nexport const SequenceNonceComponentLengths = {\n nonceIndexBytes: 4,\n nonceHashBytes: 4,\n}\n\nexport const SequenceComponentLengths = {\n ...SequenceNonceComponentLengths,\n epochBytes: 8,\n nonceBytes: SequenceNonceComponentLengths.nonceIndexBytes + SequenceNonceComponentLengths.nonceHashBytes,\n addressBytes: 20,\n}\n\nexport const SequenceComponentMinMax = {\n minEpoch: '0'.repeat(SequenceComponentLengths.epochBytes * 2) as Epoch,\n maxEpoch: 'f'.repeat(SequenceComponentLengths.epochBytes * 2) as Epoch,\n minNonce: '0'.repeat(SequenceComponentLengths.nonceBytes * 2) as Nonce,\n maxNonce: 'f'.repeat(SequenceComponentLengths.nonceBytes * 2) as Nonce,\n minAddress: '0'.repeat(SequenceComponentLengths.addressBytes * 2) as XyoLegacyAddress,\n maxAddress: 'f'.repeat(SequenceComponentLengths.addressBytes * 2) as XyoLegacyAddress,\n}\n\nexport const LocalSequenceConstants = {\n ...SequenceComponentLengths,\n ...SequenceComponentMinMax,\n localSequenceBytes: SequenceComponentLengths.epochBytes + SequenceComponentLengths.nonceBytes,\n minLocalSequence: SequenceComponentMinMax.minEpoch + SequenceComponentMinMax.minNonce as LocalSequence,\n maxLocalSequence: SequenceComponentMinMax.maxEpoch + SequenceComponentMinMax.maxNonce as LocalSequence,\n}\n\nexport const QualifiedSequenceConstants = {\n qualifiedSequenceBytes: LocalSequenceConstants.localSequenceBytes + SequenceComponentLengths.addressBytes,\n minQualifiedSequence: LocalSequenceConstants.minLocalSequence + SequenceComponentMinMax.minAddress as QualifiedSequence,\n maxQualifiedSequence: LocalSequenceConstants.maxLocalSequence + SequenceComponentMinMax.maxAddress as QualifiedSequence,\n}\n\nexport const SequenceConstants = {\n ...LocalSequenceConstants,\n ...QualifiedSequenceConstants,\n}\n\n// \"11111111111111112222222222222222\" is and example of a local sequence string\n\n// \"111111111111111122222222222222223333333333333333333333333333333333333333\" is and example of a local sequence string\n// epoch = \"1111111111111111\"\n// nonce = \"2222222222222222\"\n// address = \"3333333333333333333333333333333333333333\"\n", "import type { Compare } from '@xylabs/sdk-js'\n\nimport { SequenceParser } from './Parser.ts'\nimport type { Sequence } from './Sequence.ts'\n\nconst local: Compare<Sequence> = (a, b) => {\n const aa = SequenceParser.from(a)\n const bb = SequenceParser.from(b)\n return aa.localSequence > bb.localSequence ? 1 : aa.localSequence < bb.localSequence ? -1 : 0\n}\n\nconst qualified: Compare<Sequence> = (a, b) => {\n const aa = SequenceParser.from(a)\n const bb = SequenceParser.from(b)\n return aa.qualifiedSequence > bb.qualifiedSequence ? 1 : aa.qualifiedSequence < bb.qualifiedSequence ? -1 : 0\n}\n\nexport const SequenceComparer = { local, qualified }\n", "import { HexRegExMinMax, toHex } from '@xylabs/sdk-js'\nimport * as z from 'zod/mini'\n\nimport type { LocalSequence, QualifiedSequence } from './Sequence.ts'\nimport { SequenceConstants } from './Sequence.ts'\n\nconst LocalSequenceRegex = new RegExp(HexRegExMinMax(SequenceConstants.localSequenceBytes, SequenceConstants.localSequenceBytes))\nexport const LocalSequenceToStringZod = z.string().check(z.regex(LocalSequenceRegex))\nexport const LocalSequenceFromStringZod = z.pipe(\n z.string().check(z.regex(LocalSequenceRegex)),\n z.transform((v: string): LocalSequence => toHex(v) as LocalSequence),\n)\n\nconst QualifiedSequenceRegex = new RegExp(HexRegExMinMax(SequenceConstants.qualifiedSequenceBytes, SequenceConstants.qualifiedSequenceBytes))\nexport const QualifiedSequenceToStringZod = z.string().check(z.regex(QualifiedSequenceRegex))\nexport const QualifiedSequenceFromStringZod = z.pipe(\n z.string().check(z.regex(QualifiedSequenceRegex)),\n z.transform((v: string): QualifiedSequence => toHex(v) as QualifiedSequence),\n)\n\nexport const SequenceToStringZod = z.union([LocalSequenceToStringZod, QualifiedSequenceToStringZod])\nexport const SequenceFromStringZod = z.union([LocalSequenceFromStringZod, QualifiedSequenceFromStringZod])\n", "import type { Payload, WithSources } from './Payload.ts'\nimport { isAnyPayload } from './PayloadZod.ts'\n\nexport function isPayloadOfSchemaType<T extends Payload = never>(schema: T['schema']) {\n return (x?: unknown): x is T => isAnyPayload(x) && x?.schema === schema\n}\n\nexport const isPayloadOfSchemaTypeWithSources = <T extends Payload = never>(schema: T['schema']) => {\n return (x?: unknown): x is WithSources<T> =>\n isPayloadOfSchemaType<WithSources<T>>(schema)(x) && x.$sources != undefined && Array.isArray(x.$sources)\n}\n\nexport const notPayloadOfSchemaType = <T extends Payload = never>(schema: T['schema']) => {\n return (x?: unknown): x is T => !isAnyPayload(x) || x?.schema !== schema\n}\n\n// test types -- keep for future validation, but comment out\n\n/*\ntype TestSchema = 'network.xyo.test'\nconst TestSchema: TestSchema = 'network.xyo.test'\n\ntype Test = Payload<{ field: string }, TestSchema>\n\nconst testPayload: Test = { field: 'test', schema: TestSchema }\n\nconst testPayloads: Payload[] = [testPayload]\n\nconst isTest: Test[] = testPayloads.filter(isPayloadOfSchemaType<Payload>(TestSchema))\n\nconst isTestFromMetaTyped = testMetaPayloads.filter(isPayloadOfSchemaType<Test>(TestSchema))\n*/\n", "import { isDefined } from '@xylabs/sdk-js'\nimport * as z from 'zod/mini'\n\nimport type { Payload } from './Payload.ts'\nimport { isAnyPayload } from './PayloadZod.ts'\n\n/**\n * Checks if a value is a payload of a specific Zod type.\n * @param zodSchema The Zod schema to validate against\n * @param schema The schema string to match against the payload. Optional in\n * case you want to validate any payload matching the Zod schema or in case\n * schema is part of the Zod schema.\n * @returns A function that checks if a value is a payload of the specified Zod type\n */\nexport function isPayloadOfZodType<\n T extends Payload = never,\n S extends z.core.$ZodObject = z.core.$ZodObject,\n>(zodSchema: S, schema?: T['schema']) {\n return (x?: unknown): x is T => {\n if (!isAnyPayload(x)) return false\n if (isDefined(schema) && x.schema !== schema) return false\n const { schema: _, ...data } = x\n return z.safeParse(zodSchema, data).success\n }\n}\n", "import {\n HashZod,\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport * as z from 'zod/mini'\n\nimport { PayloadZodLoose, PayloadZodOfSchema } from './PayloadZod.ts'\nimport { asSchema } from './Schema.ts'\n\n// payload that wraps a complete boundwitness with its payloads for use in systems such as submission queues\nexport const PayloadBundleSchema = asSchema('network.xyo.payload.bundle', true)\nexport type PayloadBundleSchema = typeof PayloadBundleSchema\n\nexport const PayloadBundleFieldsZod = z.object({\n payloads: z.array(PayloadZodLoose),\n root: HashZod,\n})\n\nexport type PayloadBundleFields = z.infer<typeof PayloadBundleFieldsZod>\n\nexport const PayloadBundleZod = z.extend(PayloadZodOfSchema(PayloadBundleSchema), PayloadBundleFieldsZod.shape)\n\nexport type PayloadBundle = z.infer<typeof PayloadBundleZod>\n\nexport const isPayloadBundle = zodIsFactory(PayloadBundleZod)\nexport const asPayloadBundle = zodAsFactory(PayloadBundleZod, 'asPayloadBundle')\nexport const asOptionalPayloadBundle = zodToFactory(PayloadBundleZod, 'asPayloadBundle')\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport * as z from 'zod/mini'\n\nimport { PayloadZodOfSchema } from '../PayloadZod.ts'\nimport { PayloadSetSchema } from './PayloadSetSchema.ts'\n\nexport const PayloadSetZod = z.object({\n optional: z.optional(z.record(z.string(), z.number())),\n required: z.optional(z.record(z.string(), z.number())),\n})\n\nexport type PayloadSet = z.infer<typeof PayloadSetZod>\n\nexport const PayloadSetPayloadZod = z.extend(PayloadZodOfSchema(PayloadSetSchema), PayloadSetZod.shape)\n\nexport type PayloadSetPayload = z.infer<typeof PayloadSetPayloadZod>\n\nexport const isPayloadSetPayload = zodIsFactory(PayloadSetPayloadZod)\nexport const asPayloadSetPayload = zodAsFactory(PayloadSetPayloadZod, 'asPayloadSetPayload')\nexport const toPayloadSetPayload = zodToFactory(PayloadSetPayloadZod, 'toPayloadSetPayload')\n", "import { asSchema } from '../Schema.ts'\n\nexport const PayloadSetSchema = asSchema('network.xyo.payload.set', true)\nexport type PayloadSetSchema = typeof PayloadSetSchema\n", "import type { EmptyObject } from '@xylabs/sdk-js'\nimport { XyoAddressZod } from '@xyo-network/address'\nimport * as z from 'zod/mini'\n\nimport type { Payload, SchemaField } from './Payload.ts'\nimport type { Schema } from './Schema.ts'\n\nexport const QueryFieldsZod = z.object({\n /** @field The addresses of the intended handlers */\n address: z.optional(z.union([XyoAddressZod, z.array(XyoAddressZod)])),\n /** @field The maximum XYO that can be spent executing the query */\n budget: z.optional(z.number()),\n /** @field The frequency on which this query can be rerun */\n maxFrequency: z.optional(z.union([\n z.literal('once'),\n z.literal('second'),\n z.literal('minute'),\n z.literal('hour'),\n z.literal('day'),\n z.literal('week'),\n z.literal('month'),\n z.literal('year'),\n ])),\n /** @field The starting point for the bidding on the query */\n minBid: z.optional(z.number()),\n})\n\nexport type QueryFields = z.infer<typeof QueryFieldsZod>\n\nexport type Query<T extends void | EmptyObject | SchemaField = void, S extends Schema | void = void> = Payload<\n T extends void ? QueryFields : T & QueryFields,\n S extends void\n ? T extends SchemaField ? T['schema']\n : T extends void ? Schema\n : void\n : S\n>\n"],
|
|
5
|
+
"mappings": ";AACA;AAAA,EACE,WAAAA;AAAA,EAAS,gBAAAC;AAAA,EAAc,gBAAAC;AAAA,EAAc,gBAAAC;AAAA,OAChC;AACP,YAAYC,QAAO;;;ACJnB;AAAA,EACE;AAAA,EACA,gBAAAC;AAAA,EAAc,gBAAAC;AAAA,EAAc;AAAA,OACvB;AACP,YAAYC,QAAO;;;ACHnB,SAAS,cAAc,oBAAoB;AAC3C,YAAY,OAAO;AAGZ,IAAM,cAAc;AAEpB,IAAM,YAAc,OAAO,SAAO,EAAE,MAAQ,QAAM,WAAW,CAAC,GAAK,YAAU,CAAC,MAA6B,CAAkB,CAAC;AAG9H,IAAM,aAAa,CAAmB,UAAa;AACxD,SAAS,OAAO,UAAQ,KAAK,GAAK,YAAU,CAAC,MAAiC,CAA2B,CAAC;AAC5G;AAEO,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QAAO;AAKZ,IAAM,iBAAmB,UAAO;AAAA;AAAA,EAErC,SAAW,YAAW,SAAM,CAAC,eAAiB,SAAM,aAAa,CAAC,CAAC,CAAC;AAAA;AAAA,EAEpE,QAAU,YAAW,UAAO,CAAC;AAAA;AAAA,EAE7B,cAAgB,YAAW,SAAM;AAAA,IAC7B,WAAQ,MAAM;AAAA,IACd,WAAQ,QAAQ;AAAA,IAChB,WAAQ,QAAQ;AAAA,IAChB,WAAQ,MAAM;AAAA,IACd,WAAQ,KAAK;AAAA,IACb,WAAQ,MAAM;AAAA,IACd,WAAQ,OAAO;AAAA,IACf,WAAQ,MAAM;AAAA,EAClB,CAAC,CAAC;AAAA;AAAA,EAEF,QAAU,YAAW,UAAO,CAAC;AAC/B,CAAC;",
|
|
6
|
+
"names": ["HashZod", "zodAsFactory", "zodIsFactory", "zodToFactory", "z", "zodAsFactory", "zodIsFactory", "z", "toHex", "z", "toHex", "zodIsFactory", "zodAsFactory", "HashZod", "zodIsFactory", "zodAsFactory", "zodToFactory", "z", "HashZod", "zodAsFactory", "zodIsFactory", "zodToFactory", "z", "HashZod", "zodIsFactory", "zodAsFactory", "zodToFactory", "zodAsFactory", "zodIsFactory", "zodToFactory", "z", "zodIsFactory", "zodAsFactory", "zodToFactory", "z"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/payload-model",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -34,16 +34,16 @@
|
|
|
34
34
|
"README.md"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@xyo-network/address": "~
|
|
37
|
+
"@xyo-network/address": "~7.0.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@opentelemetry/api": "^1.9.1",
|
|
41
|
-
"@opentelemetry/sdk-trace-base": "^2.
|
|
41
|
+
"@opentelemetry/sdk-trace-base": "^2.8.0",
|
|
42
42
|
"@scure/base": "~2.2.0",
|
|
43
|
-
"@xylabs/sdk-js": "^6.1.
|
|
43
|
+
"@xylabs/sdk-js": "^6.1.1",
|
|
44
44
|
"@xylabs/toolchain": "~8.1.20",
|
|
45
45
|
"@xylabs/tsconfig": "~8.1.20",
|
|
46
|
-
"@xylabs/vitest-extended": "^6.1.
|
|
46
|
+
"@xylabs/vitest-extended": "^6.1.1",
|
|
47
47
|
"async-mutex": "^0.5.0",
|
|
48
48
|
"eslint": "^10.4.1",
|
|
49
49
|
"typescript": "~6.0.3",
|