@xyo-network/payload-model 3.6.0-rc.4 → 3.6.0-rc.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/Error.d.ts +32 -8
- package/dist/browser/Error.d.ts.map +1 -1
- package/dist/browser/Payload.d.ts +21 -13
- package/dist/browser/Payload.d.ts.map +1 -1
- package/dist/browser/Query.d.ts +1 -1
- package/dist/browser/Schema.d.ts +2 -2
- package/dist/browser/StorageMeta/Sequence.d.ts +59 -0
- package/dist/browser/StorageMeta/Sequence.d.ts.map +1 -0
- package/dist/browser/StorageMeta/SequenceParser.d.ts +23 -0
- package/dist/browser/StorageMeta/SequenceParser.d.ts.map +1 -0
- package/dist/browser/{StorageMeta.d.ts → StorageMeta/StorageMeta.d.ts} +4 -15
- package/dist/browser/StorageMeta/StorageMeta.d.ts.map +1 -0
- package/dist/browser/StorageMeta/index.d.ts +4 -0
- package/dist/browser/StorageMeta/index.d.ts.map +1 -0
- package/dist/browser/index.d.ts +1 -1
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.mjs +150 -17
- package/dist/browser/index.mjs.map +1 -1
- package/dist/browser/isPayload.d.ts +10 -10
- package/dist/browser/isPayload.d.ts.map +1 -1
- package/dist/neutral/Error.d.ts +32 -8
- package/dist/neutral/Error.d.ts.map +1 -1
- package/dist/neutral/Payload.d.ts +21 -13
- package/dist/neutral/Payload.d.ts.map +1 -1
- package/dist/neutral/Query.d.ts +1 -1
- package/dist/neutral/Schema.d.ts +2 -2
- package/dist/neutral/StorageMeta/Sequence.d.ts +59 -0
- package/dist/neutral/StorageMeta/Sequence.d.ts.map +1 -0
- package/dist/neutral/StorageMeta/SequenceParser.d.ts +23 -0
- package/dist/neutral/StorageMeta/SequenceParser.d.ts.map +1 -0
- package/dist/{node → neutral/StorageMeta}/StorageMeta.d.ts +4 -15
- package/dist/neutral/StorageMeta/StorageMeta.d.ts.map +1 -0
- package/dist/neutral/StorageMeta/index.d.ts +4 -0
- package/dist/neutral/StorageMeta/index.d.ts.map +1 -0
- package/dist/neutral/index.d.ts +1 -1
- package/dist/neutral/index.d.ts.map +1 -1
- package/dist/neutral/index.mjs +150 -17
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/isPayload.d.ts +10 -10
- package/dist/neutral/isPayload.d.ts.map +1 -1
- package/dist/node/Error.d.ts +32 -8
- package/dist/node/Error.d.ts.map +1 -1
- package/dist/node/Payload.d.ts +21 -13
- package/dist/node/Payload.d.ts.map +1 -1
- package/dist/node/Query.d.ts +1 -1
- package/dist/node/Schema.d.ts +2 -2
- package/dist/node/StorageMeta/Sequence.d.ts +59 -0
- package/dist/node/StorageMeta/Sequence.d.ts.map +1 -0
- package/dist/node/StorageMeta/SequenceParser.d.ts +23 -0
- package/dist/node/StorageMeta/SequenceParser.d.ts.map +1 -0
- package/dist/{neutral → node/StorageMeta}/StorageMeta.d.ts +4 -15
- package/dist/node/StorageMeta/StorageMeta.d.ts.map +1 -0
- package/dist/node/StorageMeta/index.d.ts +4 -0
- package/dist/node/StorageMeta/index.d.ts.map +1 -0
- package/dist/node/index.d.ts +1 -1
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.mjs +150 -17
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/isPayload.d.ts +10 -10
- package/dist/node/isPayload.d.ts.map +1 -1
- package/package.json +6 -4
- package/src/Payload.ts +44 -12
- package/src/Query.ts +1 -1
- package/src/StorageMeta/Sequence.ts +72 -0
- package/src/StorageMeta/SequenceParser.ts +125 -0
- package/src/{StorageMeta.ts → StorageMeta/StorageMeta.ts} +4 -26
- package/src/StorageMeta/index.ts +3 -0
- package/src/index.ts +1 -1
- package/dist/browser/StorageMeta.d.ts.map +0 -1
- package/dist/neutral/StorageMeta.d.ts.map +0 -1
- package/dist/node/StorageMeta.d.ts.map +0 -1
package/dist/browser/Error.d.ts
CHANGED
|
@@ -11,12 +11,36 @@ export type ModuleError = Payload<{
|
|
|
11
11
|
schema: ModuleErrorSchema;
|
|
12
12
|
sources?: Hash[];
|
|
13
13
|
}>;
|
|
14
|
-
export declare const isModuleError: (x?: unknown | null) => x is import("./
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
export declare const isModuleError: (x?: unknown | null) => x is import("./Payload.ts").DeepRestrictToStringKeys<{
|
|
15
|
+
schema: "network.xyo.error.module";
|
|
16
|
+
details?: string | number | boolean | {
|
|
17
|
+
[x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
|
|
18
|
+
} | (string | number | boolean | {
|
|
19
|
+
[x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
|
|
20
|
+
} | (string | number | boolean | {
|
|
21
|
+
[x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
|
|
22
|
+
} | (string | number | boolean | {
|
|
23
|
+
[x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
|
|
24
|
+
} | (string | number | boolean | {
|
|
25
|
+
[x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
|
|
26
|
+
} | (string | number | boolean | {
|
|
27
|
+
[x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
|
|
28
|
+
} | (string | number | boolean | {
|
|
29
|
+
[x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null;
|
|
30
|
+
} | (string | number | boolean | {
|
|
31
|
+
[x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null;
|
|
32
|
+
} | (string | number | boolean | {
|
|
33
|
+
[x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null)[] | null;
|
|
34
|
+
} | (string | number | boolean | {
|
|
35
|
+
[x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null)[] | null;
|
|
36
|
+
} | (string | number | boolean | {
|
|
37
|
+
[x: string]: string | number | boolean | /*elided*/ any | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | null;
|
|
38
|
+
} | (string | number | boolean | {
|
|
39
|
+
[x: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
|
|
40
|
+
} | /*elided*/ any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null | undefined;
|
|
41
|
+
message?: string | undefined;
|
|
42
|
+
name?: string | undefined;
|
|
43
|
+
query?: Hash | undefined;
|
|
44
|
+
sources?: Lowercase<string>[] | undefined;
|
|
45
|
+
}>;
|
|
22
46
|
//# sourceMappingURL=Error.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Error.d.ts","sourceRoot":"","sources":["../../src/Error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAG/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C,MAAM,MAAM,iBAAiB,GAAG,0BAA0B,CAAA;AAC1D,eAAO,MAAM,iBAAiB,EAAE,iBAA8C,CAAA;AAE9E,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC;IAChC,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,IAAI,CAAA;IACZ,MAAM,EAAE,iBAAiB,CAAA;IACzB,OAAO,CAAC,EAAE,IAAI,EAAE,CAAA;CACjB,CAAC,CAAA;AAEF,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"Error.d.ts","sourceRoot":"","sources":["../../src/Error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAG/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C,MAAM,MAAM,iBAAiB,GAAG,0BAA0B,CAAA;AAC1D,eAAO,MAAM,iBAAiB,EAAE,iBAA8C,CAAA;AAE9E,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC;IAChC,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,IAAI,CAAA;IACZ,MAAM,EAAE,iBAAiB,CAAA;IACzB,OAAO,CAAC,EAAE,IAAI,EAAE,CAAA;CACjB,CAAC,CAAA;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;cAPd,MAAM;WACT,MAAM;YACL,IAAI;;EAKoE,CAAA"}
|
|
@@ -1,29 +1,37 @@
|
|
|
1
1
|
import type { Hash } from '@xylabs/hex';
|
|
2
2
|
import type { EmptyObject } from '@xylabs/object';
|
|
3
3
|
import type { Schema, WithSchema } from './Schema.ts';
|
|
4
|
+
export interface SchemaField<T extends Schema = Schema> {
|
|
5
|
+
schema: T;
|
|
6
|
+
}
|
|
4
7
|
/** Additional fields for a payload */
|
|
5
|
-
export interface PayloadFields extends
|
|
6
|
-
schema: Schema;
|
|
8
|
+
export interface PayloadFields extends SchemaField {
|
|
7
9
|
}
|
|
8
|
-
export type WithPayload<T extends EmptyObject | void = void> = WithSchema<T extends EmptyObject ? PayloadFields & T : PayloadFields
|
|
10
|
+
export type WithPayload<T extends EmptyObject | void = void> = DeepRestrictToStringKeys<WithoutMeta<WithSchema<T extends EmptyObject ? PayloadFields & T : PayloadFields>>>;
|
|
9
11
|
/** Base Type for Payloads */
|
|
10
12
|
export type Payload<T extends void | EmptyObject | WithSchema = void, S extends Schema | void = void> = T extends WithSchema ? S extends Schema ? WithPayload<Omit<T, 'schema'> & {
|
|
11
13
|
schema: S;
|
|
12
|
-
}
|
|
14
|
+
}> : WithPayload<T> : T extends object ? S extends Schema ? WithPayload<T & {
|
|
13
15
|
schema: S;
|
|
14
|
-
} & PayloadFields> : WithPayload<
|
|
15
|
-
schema: Schema;
|
|
16
|
-
} & PayloadFields> : /* Either just S or neither S or T provided */ {
|
|
16
|
+
}> : WithPayload<T & PayloadFields> : WithPayload<{
|
|
17
17
|
schema: S extends Schema ? S : Schema;
|
|
18
|
-
}
|
|
19
|
-
export type OverridablePayload<T extends Payload> = Omit<T, 'schema'> &
|
|
20
|
-
schema: string;
|
|
21
|
-
};
|
|
18
|
+
}>;
|
|
19
|
+
export type OverridablePayload<T extends Payload> = WithoutMeta<Omit<T, 'schema'> & PayloadFields>;
|
|
22
20
|
export type WithSources<T extends EmptyObject> = T & {
|
|
23
21
|
sources?: Hash[];
|
|
24
22
|
};
|
|
25
23
|
export type PayloadWithSources<T extends void | EmptyObject | WithSchema = void, S extends Schema | void = void> = WithSources<Payload<T, S>>;
|
|
26
|
-
export type WithAnySchema<T extends Payload> =
|
|
27
|
-
|
|
24
|
+
export type WithAnySchema<T extends Payload> = OverridablePayload<T>;
|
|
25
|
+
export type DeepOmitStartsWith<T, Prefix extends string> = T extends (infer U)[] ? DeepOmitStartsWith<U, Prefix>[] : T extends object ? {
|
|
26
|
+
[K in keyof T as K extends string ? K extends `${Prefix}${string}` ? never : K : K]: DeepOmitStartsWith<T[K], Prefix>;
|
|
27
|
+
} : T;
|
|
28
|
+
export type DeepRestrictToStringKeys<T> = {
|
|
29
|
+
[K in keyof T as K extends string ? K : never]: T[K] extends (infer U)[] ? DeepRestrictToStringKeys<U>[] : T[K] extends object ? DeepRestrictToStringKeys<T[K]> : T[K];
|
|
28
30
|
};
|
|
31
|
+
export type WithoutClientMeta<T extends EmptyObject> = DeepOmitStartsWith<T, '$'>;
|
|
32
|
+
export type WithoutStorageMeta<T extends EmptyObject> = DeepOmitStartsWith<T, '_'>;
|
|
33
|
+
export type WithoutPrivateStorageMeta<T extends EmptyObject> = DeepOmitStartsWith<T, '__'>;
|
|
34
|
+
export type WithoutMeta<T extends EmptyObject> = WithoutClientMeta<WithoutStorageMeta<T>>;
|
|
35
|
+
export type WithoutSchema<T extends WithOptionalSchema<Payload>> = Omit<T, 'schema'>;
|
|
36
|
+
export type WithOptionalSchema<T extends EmptyObject = EmptyObject> = WithoutSchema<T> & Partial<T & SchemaField>;
|
|
29
37
|
//# sourceMappingURL=Payload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../src/Payload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAEjD,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAErD,
|
|
1
|
+
{"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../src/Payload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,EAAE,WAAW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AAM,kBAAkB,CAAC,CAAC,SAAS,WAAW,IAAI,kBAAkB,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;AAClF,MAAM,MAAM,yBAAyB,CAAC,CAAC,SAAS,WAAW,IAAI,kBAAkB,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;AAC1F,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,WAAW,IAAI,iBAAiB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAA;AAEzF,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,kBAAkB,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAA;AAEpF,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAAI,aAAa,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,WAAW,CAAC,CAAA"}
|
package/dist/browser/Query.d.ts
CHANGED
|
@@ -12,5 +12,5 @@ export interface QueryFields {
|
|
|
12
12
|
/** @field The starting point for the bidding on the query */
|
|
13
13
|
minBid?: number;
|
|
14
14
|
}
|
|
15
|
-
export type Query<T extends void | EmptyObject | WithSchema = void, S extends Schema | void = void> = Payload<T extends void ? QueryFields : T & QueryFields, S extends void ? T extends WithSchema ? T['schema'] : T extends void ?
|
|
15
|
+
export type Query<T extends void | EmptyObject | WithSchema = void, S extends Schema | void = void> = Payload<T extends void ? QueryFields : T & QueryFields, S extends void ? T extends WithSchema ? T['schema'] : T extends void ? Schema : void : S>;
|
|
16
16
|
//# sourceMappingURL=Query.d.ts.map
|
package/dist/browser/Schema.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export declare const PayloadSchema: "network.xyo.payload";
|
|
|
5
5
|
export type PayloadSchema = typeof PayloadSchema;
|
|
6
6
|
export declare const isSchema: (value: unknown) => value is Schema;
|
|
7
7
|
export declare const asSchema: {
|
|
8
|
-
<TType extends string>(value: import(".store/@xylabs-promise-npm-4.4.
|
|
9
|
-
<TType extends string>(value: import(".store/@xylabs-promise-npm-4.4.
|
|
8
|
+
<TType extends string>(value: import(".store/@xylabs-promise-npm-4.4.15-6ab7463903/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
|
|
9
|
+
<TType extends string>(value: import(".store/@xylabs-promise-npm-4.4.15-6ab7463903/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<string>, config?: import("@xylabs/object").TypeCheckConfig): TType;
|
|
10
10
|
};
|
|
11
11
|
/** Schema fields for a Payload */
|
|
12
12
|
export interface SchemaFields extends EmptyObject {
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { Address, Hex } from '@xylabs/hex';
|
|
2
|
+
export type LocalSequence = Hex & Exclude<string, 'reserved-local-sequence-value'>;
|
|
3
|
+
export type QualifiedSequence = Hex & Exclude<string, 'reserved-qualified-sequence-value'>;
|
|
4
|
+
export type Sequence = LocalSequence | QualifiedSequence;
|
|
5
|
+
export type Epoch = Hex & Exclude<string, 'reserved-epoch-sequence-value'>;
|
|
6
|
+
export declare const isEpoch: (value: unknown) => value is Epoch;
|
|
7
|
+
export type Nonce = Hex & Exclude<string, 'reserved-nonce-sequence-value'>;
|
|
8
|
+
export declare const isNonce: (value: unknown) => value is Epoch;
|
|
9
|
+
export declare const isLocalSequence: (value: unknown) => value is Sequence;
|
|
10
|
+
export declare const isQualifiedSequence: (value: unknown) => value is Sequence;
|
|
11
|
+
export declare const isSequence: (value: unknown) => value is Sequence;
|
|
12
|
+
export declare const SequenceComponentLengths: {
|
|
13
|
+
epochBytes: number;
|
|
14
|
+
nonceBytes: number;
|
|
15
|
+
addressBytes: number;
|
|
16
|
+
};
|
|
17
|
+
export declare const SequenceComponentMinMax: {
|
|
18
|
+
minEpoch: Epoch;
|
|
19
|
+
maxEpoch: Epoch;
|
|
20
|
+
minNonce: Nonce;
|
|
21
|
+
maxNonce: Nonce;
|
|
22
|
+
minAddress: Address;
|
|
23
|
+
maxAddress: Address;
|
|
24
|
+
};
|
|
25
|
+
export declare const LocalSequenceConstants: {
|
|
26
|
+
localSequenceBytes: number;
|
|
27
|
+
minLocalSequence: LocalSequence;
|
|
28
|
+
maxLocalSequence: LocalSequence;
|
|
29
|
+
minEpoch: Epoch;
|
|
30
|
+
maxEpoch: Epoch;
|
|
31
|
+
minNonce: Nonce;
|
|
32
|
+
maxNonce: Nonce;
|
|
33
|
+
minAddress: Address;
|
|
34
|
+
maxAddress: Address;
|
|
35
|
+
epochBytes: number;
|
|
36
|
+
nonceBytes: number;
|
|
37
|
+
addressBytes: number;
|
|
38
|
+
};
|
|
39
|
+
export declare const QualifiedSequenceConstants: {
|
|
40
|
+
qualifiedSequenceBytes: number;
|
|
41
|
+
minLocalSequence: QualifiedSequence;
|
|
42
|
+
maxLocalSequence: QualifiedSequence;
|
|
43
|
+
};
|
|
44
|
+
export declare const SequenceConstants: {
|
|
45
|
+
qualifiedSequenceBytes: number;
|
|
46
|
+
minLocalSequence: QualifiedSequence;
|
|
47
|
+
maxLocalSequence: QualifiedSequence;
|
|
48
|
+
localSequenceBytes: number;
|
|
49
|
+
minEpoch: Epoch;
|
|
50
|
+
maxEpoch: Epoch;
|
|
51
|
+
minNonce: Nonce;
|
|
52
|
+
maxNonce: Nonce;
|
|
53
|
+
minAddress: Address;
|
|
54
|
+
maxAddress: Address;
|
|
55
|
+
epochBytes: number;
|
|
56
|
+
nonceBytes: number;
|
|
57
|
+
addressBytes: number;
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=Sequence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sequence.d.ts","sourceRoot":"","sources":["../../../src/StorageMeta/Sequence.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAI/C,MAAM,MAAM,aAAa,GAAG,GAAG,GAAG,OAAO,CAAC,MAAM,EAAE,+BAA+B,CAAC,CAAA;AAClF,MAA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
|
|
2
|
+
import type { Epoch, LocalSequence, Nonce, QualifiedSequence, Sequence } from './Sequence.ts';
|
|
3
|
+
export declare class SequenceParser {
|
|
4
|
+
protected static privateConstructorKey: string;
|
|
5
|
+
private readonly data;
|
|
6
|
+
protected constructor(privateConstructorKey: string, hex: Hex);
|
|
7
|
+
get address(): Address;
|
|
8
|
+
get epoch(): Epoch;
|
|
9
|
+
get localSequence(): LocalSequence;
|
|
10
|
+
get nonce(): Nonce;
|
|
11
|
+
get qualifiedSequence(): QualifiedSequence;
|
|
12
|
+
static from(sequence: Sequence, address?: Address): SequenceParser;
|
|
13
|
+
static from(timestamp: Hex, hash: Hash, address?: Address): SequenceParser;
|
|
14
|
+
static from(timestamp: Hex, hash: Hex, address?: Address): SequenceParser;
|
|
15
|
+
static from(timestamp: Hex, nonce: Nonce, address?: Address): SequenceParser;
|
|
16
|
+
static from(timestamp: number, hash: Hash, address?: Address): SequenceParser;
|
|
17
|
+
static from(timestamp: number, hash: Hex, address?: Address): SequenceParser;
|
|
18
|
+
static from(timestamp: number, nonce: Nonce, address?: Address): SequenceParser;
|
|
19
|
+
static parse(value: Hex | string | ArrayBufferLike): SequenceParser;
|
|
20
|
+
static toEpoch(value: number | Hex | Epoch): Epoch;
|
|
21
|
+
static toNonce(value: Hash | Hex): Nonce;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=SequenceParser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SequenceParser.d.ts","sourceRoot":"","sources":["../../../src/StorageMeta/SequenceParser.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,IAAI,EAAE,KAAK,GAAG,EAGpB,MAAM,aAAa,CAAA;AAEpB,OAAO,KAAK,EACV,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,iBAAiB,EAC9C,QAAQ,EACT,MAAM,eAAe,CAAA;AAKtB,qBAAa,cAAc;IACzB,SAAS,CAAC,MAAM,CAAC,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AG,GAAG,GAAG,KAAK,GAAG,KAAK;IAgBlD,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,GAAG,GAAG,GAAG,KAAK;CAYzC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { type Hash
|
|
2
|
-
import type { Payload } from '
|
|
1
|
+
import { type Hash } from '@xylabs/hex';
|
|
2
|
+
import type { Payload } from '../Payload.ts';
|
|
3
|
+
import type { Sequence } from './Sequence.ts';
|
|
3
4
|
export interface SequenceMeta {
|
|
4
|
-
_sequence:
|
|
5
|
+
_sequence: Sequence;
|
|
5
6
|
}
|
|
6
7
|
export type WithPartialSequenceMeta<T extends Payload = Payload> = Partial<WithSequenceMeta<T>>;
|
|
7
8
|
export type WithSequenceMeta<T extends Payload = Payload> = T & SequenceMeta;
|
|
@@ -15,18 +16,6 @@ export interface StorageMeta extends SequenceMeta, HashMeta {
|
|
|
15
16
|
}
|
|
16
17
|
export type WithPartialStorageMeta<T extends Payload = Payload> = Partial<WithStorageMeta<T>>;
|
|
17
18
|
export type WithStorageMeta<T extends Payload = Payload> = T & StorageMeta;
|
|
18
|
-
export declare const StorageMetaConstants: {
|
|
19
|
-
epochBytes: number;
|
|
20
|
-
nonceBytes: number;
|
|
21
|
-
addressBytes: number;
|
|
22
|
-
maxEpoch: number;
|
|
23
|
-
localSequenceBytes: number;
|
|
24
|
-
minLocalSequence: Hex;
|
|
25
|
-
maxLocalSequence: Hex;
|
|
26
|
-
qualifiedSequenceBytes: number;
|
|
27
|
-
minSequence: Hex;
|
|
28
|
-
maxSequence: Hex;
|
|
29
|
-
};
|
|
30
19
|
export declare const isSequenceMeta: (value: unknown) => value is SequenceMeta;
|
|
31
20
|
export declare const isHashMeta: (value: unknown) => value is HashMeta;
|
|
32
21
|
export declare const isStorageMeta: (value: unknown) => value is StorageMeta;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StorageMeta.d.ts","sourceRoot":"","sources":["../../../src/StorageMeta/Storage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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/StorageMeta/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA"}
|
package/dist/browser/index.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ export * from './PayloadValidationFunction.ts';
|
|
|
8
8
|
export * from './PayloadValueExpression.ts';
|
|
9
9
|
export * from './Query.ts';
|
|
10
10
|
export * from './Schema.ts';
|
|
11
|
-
export * from './StorageMeta.ts';
|
|
11
|
+
export * from './StorageMeta/index.ts';
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,4BAA4B,CAAA;AAC1C,cAAc,cAAc,CAAA;AAC5B,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,4BAA4B,CAAA;AAC1C,cAAc,cAAc,CAAA;AAC5B,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,wBAAwB,CAAA"}
|
package/dist/browser/index.mjs
CHANGED
|
@@ -41,28 +41,151 @@ var isSchema = (value) => {
|
|
|
41
41
|
};
|
|
42
42
|
var asSchema = AsTypeFactory.create(isSchema);
|
|
43
43
|
|
|
44
|
-
// src/StorageMeta.ts
|
|
45
|
-
import {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
// src/StorageMeta/Sequence.ts
|
|
45
|
+
import { isHex } from "@xylabs/hex";
|
|
46
|
+
var isEpoch = (value) => {
|
|
47
|
+
return isHex(value) && value.length === SequenceConstants.epochBytes * 2;
|
|
48
|
+
};
|
|
49
|
+
var isNonce = (value) => {
|
|
50
|
+
return isHex(value) && value.length === SequenceConstants.nonceBytes * 2;
|
|
51
|
+
};
|
|
52
|
+
var isLocalSequence = (value) => {
|
|
53
|
+
return isHex(value) && value.length === SequenceConstants.localSequenceBytes * 2;
|
|
54
|
+
};
|
|
55
|
+
var isQualifiedSequence = (value) => {
|
|
56
|
+
return isHex(value) && value.length === SequenceConstants.qualifiedSequenceBytes * 2;
|
|
57
|
+
};
|
|
58
|
+
var isSequence = (value) => {
|
|
59
|
+
return isLocalSequence(value) || isQualifiedSequence(value);
|
|
60
|
+
};
|
|
61
|
+
var SequenceComponentLengths = {
|
|
49
62
|
epochBytes: 8,
|
|
50
63
|
nonceBytes: 8,
|
|
51
64
|
addressBytes: 20
|
|
52
65
|
};
|
|
53
|
-
var
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
66
|
+
var SequenceComponentMinMax = {
|
|
67
|
+
minEpoch: "0".repeat(SequenceComponentLengths.epochBytes * 2),
|
|
68
|
+
maxEpoch: "f".repeat(SequenceComponentLengths.epochBytes * 2),
|
|
69
|
+
minNonce: "0".repeat(SequenceComponentLengths.nonceBytes * 2),
|
|
70
|
+
maxNonce: "f".repeat(SequenceComponentLengths.nonceBytes * 2),
|
|
71
|
+
minAddress: "0".repeat(SequenceComponentLengths.addressBytes * 2),
|
|
72
|
+
maxAddress: "f".repeat(SequenceComponentLengths.addressBytes * 2)
|
|
73
|
+
};
|
|
74
|
+
var LocalSequenceConstants = {
|
|
75
|
+
...SequenceComponentLengths,
|
|
76
|
+
...SequenceComponentMinMax,
|
|
77
|
+
localSequenceBytes: SequenceComponentLengths.epochBytes + SequenceComponentLengths.nonceBytes,
|
|
78
|
+
minLocalSequence: SequenceComponentMinMax.minEpoch + SequenceComponentMinMax.minNonce,
|
|
79
|
+
maxLocalSequence: SequenceComponentMinMax.maxEpoch + SequenceComponentMinMax.maxNonce
|
|
80
|
+
};
|
|
81
|
+
var QualifiedSequenceConstants = {
|
|
82
|
+
qualifiedSequenceBytes: LocalSequenceConstants.localSequenceBytes + SequenceComponentLengths.addressBytes,
|
|
83
|
+
minLocalSequence: LocalSequenceConstants.minLocalSequence + SequenceComponentMinMax.minAddress,
|
|
84
|
+
maxLocalSequence: LocalSequenceConstants.maxLocalSequence + SequenceComponentMinMax.maxAddress
|
|
59
85
|
};
|
|
60
|
-
var
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
86
|
+
var SequenceConstants = {
|
|
87
|
+
...LocalSequenceConstants,
|
|
88
|
+
...QualifiedSequenceConstants
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
// src/StorageMeta/SequenceParser.ts
|
|
92
|
+
import { toUint8Array } from "@xylabs/arraybuffer";
|
|
93
|
+
import { assertEx } from "@xylabs/assert";
|
|
94
|
+
import {
|
|
95
|
+
isAddress,
|
|
96
|
+
toHex
|
|
97
|
+
} from "@xylabs/hex";
|
|
98
|
+
var SequenceParser = class _SequenceParser {
|
|
99
|
+
static privateConstructorKey = Date.now().toString();
|
|
100
|
+
data;
|
|
101
|
+
constructor(privateConstructorKey, hex) {
|
|
102
|
+
assertEx(_SequenceParser.privateConstructorKey === privateConstructorKey, () => "Use create function instead of constructor");
|
|
103
|
+
const paddedHex = toHex(hex, {
|
|
104
|
+
prefix: false,
|
|
105
|
+
bitLength: hex.length <= SequenceConstants.localSequenceBytes * 2 ? SequenceConstants.localSequenceBytes * 8 : SequenceConstants.qualifiedSequenceBytes * 8
|
|
106
|
+
});
|
|
107
|
+
this.data = toUint8Array(paddedHex);
|
|
108
|
+
}
|
|
109
|
+
get address() {
|
|
110
|
+
const start = SequenceConstants.localSequenceBytes;
|
|
111
|
+
const end = SequenceConstants.qualifiedSequenceBytes;
|
|
112
|
+
return toHex(this.data.slice(start, end).buffer, { prefix: false });
|
|
113
|
+
}
|
|
114
|
+
get epoch() {
|
|
115
|
+
const start = 0;
|
|
116
|
+
const end = SequenceConstants.epochBytes;
|
|
117
|
+
return toHex(this.data.slice(start, end).buffer, { prefix: false });
|
|
118
|
+
}
|
|
119
|
+
get localSequence() {
|
|
120
|
+
const start = 0;
|
|
121
|
+
const end = SequenceConstants.localSequenceBytes;
|
|
122
|
+
return toHex(this.data.slice(start, end).buffer, { prefix: false });
|
|
123
|
+
}
|
|
124
|
+
get nonce() {
|
|
125
|
+
const start = SequenceConstants.epochBytes;
|
|
126
|
+
const end = SequenceConstants.localSequenceBytes;
|
|
127
|
+
return toHex(this.data.slice(start, end).buffer, { prefix: false });
|
|
128
|
+
}
|
|
129
|
+
get qualifiedSequence() {
|
|
130
|
+
const start = 0;
|
|
131
|
+
const end = SequenceConstants.qualifiedSequenceBytes;
|
|
132
|
+
return toHex(this.data.slice(start, end).buffer, { prefix: false });
|
|
133
|
+
}
|
|
134
|
+
static from(timestampOrSequence, nonceOrAddress, address) {
|
|
135
|
+
if (isSequence(timestampOrSequence)) {
|
|
136
|
+
if (nonceOrAddress) {
|
|
137
|
+
assertEx(!isQualifiedSequence(timestampOrSequence), () => "Providing both a qualified sequence and a address is not allowed");
|
|
138
|
+
assertEx(isAddress(nonceOrAddress), () => "Invalid address provided");
|
|
139
|
+
return new this(_SequenceParser.privateConstructorKey, timestampOrSequence + address);
|
|
140
|
+
}
|
|
141
|
+
return new this(_SequenceParser.privateConstructorKey, timestampOrSequence);
|
|
142
|
+
}
|
|
143
|
+
const epoch = _SequenceParser.toEpoch(timestampOrSequence);
|
|
144
|
+
const nonce = _SequenceParser.toNonce(nonceOrAddress);
|
|
145
|
+
const addressHex = address ? toHex(address, { bitLength: SequenceConstants.addressBytes * 8 }) : "";
|
|
146
|
+
const hexString = epoch + nonce + addressHex;
|
|
147
|
+
assertEx(isSequence(hexString), () => `Invalid sequence [${hexString}] [${epoch}, ${nonce}, ${addressHex}]`);
|
|
148
|
+
return new this(_SequenceParser.privateConstructorKey, hexString);
|
|
149
|
+
}
|
|
150
|
+
static parse(value) {
|
|
151
|
+
const hex = toHex(value);
|
|
152
|
+
if (isSequence(hex)) {
|
|
153
|
+
return new this(_SequenceParser.privateConstructorKey, hex);
|
|
154
|
+
}
|
|
155
|
+
throw new Error(`Invalid sequence [${value}]`);
|
|
156
|
+
}
|
|
157
|
+
// can convert a short number/hex to an epoch (treats it as the whole value) or extract an epoch from a sequence
|
|
158
|
+
static toEpoch(value) {
|
|
159
|
+
assertEx(
|
|
160
|
+
typeof value !== "number" || Number.isInteger(value),
|
|
161
|
+
() => "Value must be in integer"
|
|
162
|
+
);
|
|
163
|
+
const hex = toHex(value, { prefix: false });
|
|
164
|
+
if (hex.length <= SequenceConstants.epochBytes * 2) {
|
|
165
|
+
return toHex(value, { prefix: false, bitLength: SequenceConstants.epochBytes * 8 });
|
|
166
|
+
}
|
|
167
|
+
if (isSequence(hex)) {
|
|
168
|
+
return hex.slice(0, SequenceConstants.epochBytes * 2);
|
|
169
|
+
}
|
|
170
|
+
throw new Error(`Value could not be converted to epoch [${hex}]`);
|
|
171
|
+
}
|
|
172
|
+
// can convert a short number/hex to a nonce (treats it as the whole value) or extract an nonce from a sequence
|
|
173
|
+
static toNonce(value) {
|
|
174
|
+
assertEx(
|
|
175
|
+
typeof value !== "number" || Number.isInteger(value),
|
|
176
|
+
() => "Value must be in integer"
|
|
177
|
+
);
|
|
178
|
+
const hex = toHex(value, { prefix: false });
|
|
179
|
+
if (isSequence(hex)) {
|
|
180
|
+
return hex.slice(SequenceConstants.epochBytes * 2, SequenceConstants.localSequenceBytes * 2);
|
|
181
|
+
}
|
|
182
|
+
const hash = toHex(hex, { prefix: false, bitLength: SequenceConstants.nonceBytes * 8 });
|
|
183
|
+
return hash.slice(-SequenceConstants.nonceBytes * 2);
|
|
184
|
+
}
|
|
65
185
|
};
|
|
186
|
+
|
|
187
|
+
// src/StorageMeta/StorageMeta.ts
|
|
188
|
+
import { isHash } from "@xylabs/hex";
|
|
66
189
|
var isSequenceMeta = (value) => {
|
|
67
190
|
return value?._sequence !== void 0;
|
|
68
191
|
};
|
|
@@ -73,20 +196,30 @@ var isStorageMeta = (value) => {
|
|
|
73
196
|
return isSequenceMeta(value) && isHashMeta(value);
|
|
74
197
|
};
|
|
75
198
|
export {
|
|
199
|
+
LocalSequenceConstants,
|
|
76
200
|
ModuleErrorSchema,
|
|
77
201
|
PayloadSchema,
|
|
78
202
|
PayloadSetSchema,
|
|
79
|
-
|
|
203
|
+
QualifiedSequenceConstants,
|
|
204
|
+
SequenceComponentLengths,
|
|
205
|
+
SequenceComponentMinMax,
|
|
206
|
+
SequenceConstants,
|
|
207
|
+
SequenceParser,
|
|
80
208
|
asAnyPayload,
|
|
81
209
|
asPayload,
|
|
82
210
|
asSchema,
|
|
83
211
|
isAnyPayload,
|
|
212
|
+
isEpoch,
|
|
84
213
|
isHashMeta,
|
|
214
|
+
isLocalSequence,
|
|
85
215
|
isModuleError,
|
|
216
|
+
isNonce,
|
|
86
217
|
isPayload,
|
|
87
218
|
isPayloadOfSchemaType,
|
|
88
219
|
isPayloadOfSchemaTypeWithSources,
|
|
220
|
+
isQualifiedSequence,
|
|
89
221
|
isSchema,
|
|
222
|
+
isSequence,
|
|
90
223
|
isSequenceMeta,
|
|
91
224
|
isStorageMeta,
|
|
92
225
|
notPayloadOfSchemaType
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/isPayload.ts","../../src/isPayloadOfSchemaType.ts","../../src/Error.ts","../../src/PayloadSet/PayloadSetSchema.ts","../../src/Schema.ts","../../src/StorageMeta.ts"],"sourcesContent":["import { AsObjectFactory, isObject } from '@xylabs/object'\n\nimport type { Payload } from './Payload.ts'\n\nexport const isAnyPayload = (value: unknown): value is Payload => {\n if (isObject(value)) {\n return typeof value.schema === 'string'\n }\n return false\n}\n\nexport const asAnyPayload = AsObjectFactory.create(isAnyPayload)\n\nexport const isPayload\n = <T extends Payload>(schema: string[]) =>\n (value: unknown): value is T => {\n if (isAnyPayload(value)) {\n return schema.includes(value.schema)\n }\n return false\n }\n\nexport const asPayload = <T extends Payload>(schema: string[]) => AsObjectFactory.create((value: unknown): value is T => isPayload(schema)(value))\n","import { isAnyPayload } from './isPayload.ts'\nimport type { Payload, WithSources } from './Payload.ts'\n\nexport const isPayloadOfSchemaType = <T extends Payload>(schema: string) => {\n return (x?: unknown | null): x is T => isAnyPayload(x) && x?.schema === schema\n}\n\nexport const isPayloadOfSchemaTypeWithSources = <T extends Payload>(schema: string) => {\n return (x?: unknown | null): 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>(schema: string) => {\n return (x?: unknown | null): 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(TestSchema))\n\nconst isTestFromMetaTyped = testMetaPayloads.filter(isPayloadOfSchemaType<Test>(TestSchema))\n*/\n","import type { Hash } from '@xylabs/hex'\nimport type { JsonValue } from '@xylabs/object'\n\nimport { isPayloadOfSchemaType } from './isPayloadOfSchemaType.ts'\nimport type { Payload } from './Payload.ts'\n\nexport type ModuleErrorSchema = 'network.xyo.error.module'\nexport const ModuleErrorSchema: ModuleErrorSchema = 'network.xyo.error.module'\n\nexport type ModuleError = Payload<{\n details?: JsonValue\n message?: string\n name?: string\n query?: Hash\n schema: ModuleErrorSchema\n sources?: Hash[]\n}>\n\nexport const isModuleError = isPayloadOfSchemaType<ModuleError>(ModuleErrorSchema)\n","export type PayloadSetSchema = 'network.xyo.payload.set'\nexport const PayloadSetSchema: PayloadSetSchema = 'network.xyo.payload.set'\n","import type { EmptyObject } from '@xylabs/object'\nimport { AsTypeFactory } from '@xylabs/object'\n\n/** Schema type in Javascript is a string */\nexport type Schema = string\n\nexport const PayloadSchema = 'network.xyo.payload' as const\nexport type PayloadSchema = typeof PayloadSchema\n\nexport const isSchema = (value: unknown): value is Schema => {\n return typeof value === 'string'\n}\n\nexport const asSchema = AsTypeFactory.create<Schema>(isSchema)\n\n/** Schema fields for a Payload */\nexport interface SchemaFields extends EmptyObject {\n /** Schema of the object */\n schema: Schema\n}\n\n/** Add the Schema Fields to an object */\nexport type WithSchema<T extends EmptyObject | void = void> = T extends EmptyObject ? SchemaFields & T : SchemaFields\n","import {\n type Hash, type Hex, isHash,\n} from '@xylabs/hex'\n\nimport type { Payload } from './Payload.ts'\n\nexport interface SequenceMeta {\n _sequence: Hex\n}\n\nexport type WithPartialSequenceMeta<T extends Payload = Payload> = Partial<WithSequenceMeta<T>>\n\nexport type WithSequenceMeta<T extends Payload = Payload> = T & SequenceMeta\n\nexport interface HashMeta {\n _dataHash: Hash\n _hash: Hash\n}\n\nexport type WithPartialHashMeta<T extends Payload = Payload> = Partial<WithHashMeta<T>>\n\nexport type WithHashMeta<T extends Payload = Payload> = T & HashMeta\n\nexport interface StorageMeta extends SequenceMeta, HashMeta {}\n\nexport type WithPartialStorageMeta<T extends Payload = Payload> = Partial<WithStorageMeta<T>>\n\nexport type WithStorageMeta<T extends Payload = Payload> = T & StorageMeta\n\nconst StorageMetaComponentConstants = {\n epochBytes: 8,\n nonceBytes: 8,\n addressBytes: 20,\n}\n\nconst StorageMetaLocalConstants = {\n maxEpoch: Math.pow(256, StorageMetaComponentConstants.epochBytes) - 1,\n localSequenceBytes: StorageMetaComponentConstants.epochBytes + StorageMetaComponentConstants.nonceBytes,\n minLocalSequence: '00000000000000000000000000000000' as Hex,\n maxLocalSequence: 'ffffffffffffffffffffffffffffffff' as Hex,\n ...StorageMetaComponentConstants,\n}\n\nexport const StorageMetaConstants = {\n qualifiedSequenceBytes: StorageMetaLocalConstants.localSequenceBytes + StorageMetaComponentConstants.addressBytes,\n minSequence: `${StorageMetaLocalConstants}0000000000000000000000000000000000000000` as Hex,\n maxSequence: `${StorageMetaLocalConstants}ffffffffffffffffffffffffffffffffffffffff` as Hex,\n ...StorageMetaLocalConstants,\n}\n\nexport const isSequenceMeta = (value: unknown): value is SequenceMeta => {\n return (value as WithSequenceMeta)?._sequence !== undefined\n}\n\nexport const isHashMeta = (value: unknown): value is HashMeta => {\n return isHash((value as WithHashMeta)?._hash) && isHash((value as WithHashMeta)?._dataHash)\n}\n\nexport const isStorageMeta = (value: unknown): value is StorageMeta => {\n return isSequenceMeta(value) && isHashMeta(value)\n}\n\n// \"00005a7f354762f3ac1bc5ddc6cfd08d14\" is and example of a local sequence string\n\n// \"00005a7f354762f3ac1bc5ddc6cfd08d14a123456789abcdef0123\" is and example of a local sequence string\n// epoch = \"00005a7f354762f3ac\"\n// nonce = \"1bc5ddc6cfd08d14\"\n// address = \"a123456789abcdef0123\"\n"],"mappings":";AAAA,SAAS,iBAAiB,gBAAgB;AAInC,IAAM,eAAe,CAAC,UAAqC;AAChE,MAAI,SAAS,KAAK,GAAG;AACnB,WAAO,OAAO,MAAM,WAAW;AAAA,EACjC;AACA,SAAO;AACT;AAEO,IAAM,eAAe,gBAAgB,OAAO,YAAY;AAExD,IAAM,YACT,CAAoB,WACpB,CAAC,UAA+B;AAC9B,MAAI,aAAa,KAAK,GAAG;AACvB,WAAO,OAAO,SAAS,MAAM,MAAM;AAAA,EACrC;AACA,SAAO;AACT;AAE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AO,OAAQ,OAAwB,KAAK,KAAK,OAAQ,OAAwB,SAAS;AAC5F;AAEO,IAAM,gBAAgB,CAAC,UAAyC;AACrE,SAAO,eAAe,KAAK,KAAK,WAAW,KAAK;AAClD;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/isPayload.ts","../../src/isPayloadOfSchemaType.ts","../../src/Error.ts","../../src/PayloadSet/PayloadSetSchema.ts","../../src/Schema.ts","../../src/StorageMeta/Sequence.ts","../../src/StorageMeta/SequenceParser.ts","../../src/StorageMeta/StorageMeta.ts"],"sourcesContent":["import { AsObjectFactory, isObject } from '@xylabs/object'\n\nimport type { Payload } from './Payload.ts'\n\nexport const isAnyPayload = (value: unknown): value is Payload => {\n if (isObject(value)) {\n return typeof value.schema === 'string'\n }\n return false\n}\n\nexport const asAnyPayload = AsObjectFactory.create(isAnyPayload)\n\nexport const isPayload\n = <T extends Payload>(schema: string[]) =>\n (value: unknown): value is T => {\n if (isAnyPayload(value)) {\n return schema.includes(value.schema)\n }\n return false\n }\n\nexport const asPayload = <T extends Payload>(schema: string[]) => AsObjectFactory.create((value: unknown): value is T => isPayload(schema)(value))\n","import { isAnyPayload } from './isPayload.ts'\nimport type { Payload, WithSources } from './Payload.ts'\n\nexport const isPayloadOfSchemaType = <T extends Payload>(schema: string) => {\n return (x?: unknown | null): x is T => isAnyPayload(x) && x?.schema === schema\n}\n\nexport const isPayloadOfSchemaTypeWithSources = <T extends Payload>(schema: string) => {\n return (x?: unknown | null): 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>(schema: string) => {\n return (x?: unknown | null): 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(TestSchema))\n\nconst isTestFromMetaTyped = testMetaPayloads.filter(isPayloadOfSchemaType<Test>(TestSchema))\n*/\n","import type { Hash } from '@xylabs/hex'\nimport type { JsonValue } from '@xylabs/object'\n\nimport { isPayloadOfSchemaType } from './isPayloadOfSchemaType.ts'\nimport type { Payload } from './Payload.ts'\n\nexport type ModuleErrorSchema = 'network.xyo.error.module'\nexport const ModuleErrorSchema: ModuleErrorSchema = 'network.xyo.error.module'\n\nexport type ModuleError = Payload<{\n details?: JsonValue\n message?: string\n name?: string\n query?: Hash\n schema: ModuleErrorSchema\n sources?: Hash[]\n}>\n\nexport const isModuleError = isPayloadOfSchemaType<ModuleError>(ModuleErrorSchema)\n","export type PayloadSetSchema = 'network.xyo.payload.set'\nexport const PayloadSetSchema: PayloadSetSchema = 'network.xyo.payload.set'\n","import type { EmptyObject } from '@xylabs/object'\nimport { AsTypeFactory } from '@xylabs/object'\n\n/** Schema type in Javascript is a string */\nexport type Schema = string\n\nexport const PayloadSchema = 'network.xyo.payload' as const\nexport type PayloadSchema = typeof PayloadSchema\n\nexport const isSchema = (value: unknown): value is Schema => {\n return typeof value === 'string'\n}\n\nexport const asSchema = AsTypeFactory.create<Schema>(isSchema)\n\n/** Schema fields for a Payload */\nexport interface SchemaFields extends EmptyObject {\n /** Schema of the object */\n schema: Schema\n}\n\n/** Add the Schema Fields to an object */\nexport type WithSchema<T extends EmptyObject | void = void> = T extends EmptyObject ? SchemaFields & T : SchemaFields\n","import type { Address, Hex } from '@xylabs/hex'\nimport { isHex } from '@xylabs/hex'\n\n// we use Exclude to intentionally make the type not equal to string\nexport type LocalSequence = Hex & Exclude<string, 'reserved-local-sequence-value'>\nexport type QualifiedSequence = Hex & Exclude<string, 'reserved-qualified-sequence-value'>\nexport type Sequence = LocalSequence | QualifiedSequence\n\nexport type Epoch = Hex & Exclude<string, 'reserved-epoch-sequence-value'>\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 = Hex & Exclude<string, 'reserved-nonce-sequence-value'>\n\nexport const isNonce = (value: unknown): value is Epoch => {\n return isHex(value) && (value as string).length === SequenceConstants.nonceBytes * 2\n}\n\nexport const isLocalSequence = (value: unknown): value is Sequence => {\n return isHex(value) && (value as string).length === SequenceConstants.localSequenceBytes * 2\n}\n\nexport const isQualifiedSequence = (value: unknown): value is Sequence => {\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 SequenceComponentLengths = {\n epochBytes: 8,\n nonceBytes: 8,\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 Address,\n maxAddress: 'f'.repeat(SequenceComponentLengths.addressBytes * 2) as Address,\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 minLocalSequence: LocalSequenceConstants.minLocalSequence + SequenceComponentMinMax.minAddress as QualifiedSequence,\n maxLocalSequence: 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 { toUint8Array } from '@xylabs/arraybuffer'\nimport { assertEx } from '@xylabs/assert'\nimport {\n type Address,\n type Hash, type Hex,\n isAddress,\n toHex,\n} from '@xylabs/hex'\n\nimport type {\n Epoch, LocalSequence, Nonce, QualifiedSequence,\n Sequence,\n} from './Sequence.ts'\nimport {\n isQualifiedSequence, isSequence, 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(): Address {\n const start = SequenceConstants.localSequenceBytes\n const end = SequenceConstants.qualifiedSequenceBytes\n return toHex(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 })\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 })\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 })\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 })\n }\n\n static from(sequence: Sequence, address?: Address): SequenceParser\n static from(timestamp: Hex, hash: Hash, address?: Address): SequenceParser\n static from(timestamp: Hex, hash: Hex, address?: Address): SequenceParser\n static from(timestamp: Hex, nonce: Nonce, address?: Address): SequenceParser\n static from(timestamp: number, hash: Hash, address?: Address): SequenceParser\n static from(timestamp: number, hash: Hex, address?: Address): SequenceParser\n static from(timestamp: number, nonce: Nonce, address?: Address): SequenceParser\n static from(timestampOrSequence: Sequence | Hex | number, nonceOrAddress: Hash | Nonce, address?: Address): SequenceParser {\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 = SequenceParser.toNonce(nonceOrAddress)\n const addressHex: Hex = address ? toHex(address, { bitLength: SequenceConstants.addressBytes * 8 }) : '' as Hex\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 [${value}]`)\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): 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 hash = toHex((hex as string), { prefix: false, bitLength: SequenceConstants.nonceBytes * 8 })\n return hash.slice(-SequenceConstants.nonceBytes * 2) as Nonce\n }\n}\n","import { type Hash, isHash } from '@xylabs/hex'\n\nimport type { Payload } from '../Payload.ts'\nimport type { Sequence } from './Sequence.ts'\n\nexport interface SequenceMeta {\n _sequence: Sequence\n}\n\nexport type WithPartialSequenceMeta<T extends Payload = Payload> = Partial<WithSequenceMeta<T>>\n\nexport type WithSequenceMeta<T extends Payload = Payload> = T & SequenceMeta\n\nexport interface HashMeta {\n _dataHash: Hash\n _hash: Hash\n}\n\nexport type WithPartialHashMeta<T extends Payload = Payload> = Partial<WithHashMeta<T>>\n\nexport type WithHashMeta<T extends Payload = Payload> = T & HashMeta\n\nexport interface StorageMeta extends SequenceMeta, HashMeta {}\n\nexport type WithPartialStorageMeta<T extends Payload = Payload> = Partial<WithStorageMeta<T>>\n\nexport type WithStorageMeta<T extends Payload = Payload> = T & StorageMeta\n\nexport const isSequenceMeta = (value: unknown): value is SequenceMeta => {\n return (value as WithSequenceMeta)?._sequence !== undefined\n}\n\nexport const isHashMeta = (value: unknown): value is HashMeta => {\n return isHash((value as WithHashMeta)?._hash) && isHash((value as WithHashMeta)?._dataHash)\n}\n\nexport const isStorageMeta = (value: unknown): value is StorageMeta => {\n return isSequenceMeta(value) && isHashMeta(value)\n}\n\n// \"00005a7f354762f3ac1bc5ddc6cfd08d14\" is and example of a local sequence string\n\n// \"00005a7f354762f3ac1bc5ddc6cfd08d14a123456789abcdef0123\" is and example of a local sequence string\n// epoch = \"00005a7f354762f3ac\"\n// nonce = \"1bc5ddc6cfd08d14\"\n// address = \"a123456789abcdef0123\"\n"],"mappings":";AAAA,SAAS,iBAAiB,gBAAgB;AAInC,IAAM,eAAe,CAAC,UAAqC;AAChE,MAAI,SAAS,KAAK,GAAG;AACnB,WAAO,OAAO,MAAM,WAAW;AAAA,EACjC;AACA,SAAO;AACT;AAEO,IAAM,eAAe,gBAAgB,OAAO,YAAY;AAExD,IAAM,YACT,CAAoB,WACpB,CAAC,UAA+B;AAC9B,MAAI,aAAa,KAAK,GAAG;AACvB,WAAO,OAAO,SAAS,MAAM,MAAM;AAAA,EACrC;AACA,SAAO;AACT;AAEG,IAAM,YAAY,CAAoB,WAAqB,gBAAgB,OAAO,CAAC,UAA+B,UAAU,MAAM,EAAE,KAAK,CAAC;;;ACnB1I,IAAM,wBAAwB,CAAoB,WAAmB;AAC1E,SAAO,CAAC,MAA+B,aAAa,CAAC,KAAK,GAAG,WAAW;AAC1E;AAEO,IAAM,mCAAmC,CAAoB,WAAmB;AACrF,SAAO,CAAC,MACN,sBAAsC,MAAM,EAAE,CAAC,KAAK,EAAE,YAAY,UAAa,MAAM,QAAQ,EAAE,OAAO;AAC1G;AAEO,IAAM,yBAAyB,CAAoB,WAAmB;AAC3E,SAAO,CAAC,MAA+B,CAAC,aAAa,CAAC,KAAK,GAAG,WAAW;AAC3E;;;ACPO,IAAM,oBAAuC;AAW7C,IAAM,gBAAgB,sBAAmC,iBAAiB;;;ACjB1E,IAAM,mBAAqC;;;ACAlD,SAAS,qBAAqB;AAKvB,IAAM,gBAAgB;AAGtB,IAAM,WAAW,CAAC,UAAoC;AAC3D,SAAO,OA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AAK;AAAA,MACnD,MAAM;AAAA,IACR;AACA,UAAM,MAAM,MAAM,OAAO,EAAE,QAAQ,MAAM,CAAC;AAC1C,QAAI,IAAI,UAAU,kBAAkB,aAAa,GAAG;AAClD,aAAO,MAAM,OAAO,EAAE,QAAQ,OAAO,WAAW,kBAAkB,aAAa,EAAE,CAAC;AAAA,IACpF;AACA,QAAI,WAAW,GAAG,GAAG;AACnB,aAAO,IAAI,MAAM,GAAG,kBAAkB,aAAa,CAAC;AAAA,IACtD;AACA,UAAM,IAAI,MAAM,0CAA0C,GAAG,GAAG;AAAA,EAClE;AAAA;AAAA,EAGA,OAAO,QAAQ,OAA0B;AACvC;AAAA,MACE,OAAO,UAAU,YAAY,OAAO,UAAU,KAAK;AAAA,MACnD,MAAM;AAAA,IACR;AACA,UAAM,MAAM,MAAM,OAAO,EAAE,QAAQ,MAAM,CAAC;AAC1C,QAAI,WAAW,GAAG,GAAG;AACnB,aAAO,IAAI,MAAM,kBAAkB,aAAa,GAAG,kBAAkB,qBAAqB,CAAC;AAAA,IAC7F;AACA,UAAM,OAAO,MAAO,KAAgB,EAAE,QAAQ,OAAO,WAAW,kBAAkB,aAAa,EAAE,CAAC;AAClG,WAAO,KAAK,MAAM,CAAC,kBAAkB,aAAa,CAAC;AAAA,EACrD;AACF;;;AC5HA,SAAoB,cAAc;AA4B3B,IAAM,iBAAiB,CAAC,UAA0C;AACvE,SAAQ,OAA4B,cAAc;AACpD;AAEO,IAAM,aAAa,CAAC,UAAsC;AAC/D,SAAO,OAAQ,OAAwB,KAAK,KAAK,OAAQ,OAAwB,SAAS;AAC5F;AAEO,IAAM,gBAAgB,CAAC,UAAyC;AACrE,SAAO,eAAe,KAAK,KAAK,WAAW,KAAK;AAClD;","names":[]}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import type { Payload } from './Payload.ts';
|
|
2
2
|
export declare const isAnyPayload: (value: unknown) => value is Payload;
|
|
3
3
|
export declare const asAnyPayload: {
|
|
4
|
-
<TType extends {
|
|
5
|
-
schema:
|
|
6
|
-
}
|
|
7
|
-
<TType extends {
|
|
8
|
-
schema:
|
|
9
|
-
}
|
|
10
|
-
schema:
|
|
11
|
-
}
|
|
4
|
+
<TType extends import("./Payload.ts").DeepRestrictToStringKeys<{
|
|
5
|
+
schema: import("./Schema.ts").Schema;
|
|
6
|
+
}>>(value: import(".store/@xylabs-promise-npm-4.4.15-6ab7463903/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
|
|
7
|
+
<TType extends import("./Payload.ts").DeepRestrictToStringKeys<{
|
|
8
|
+
schema: import("./Schema.ts").Schema;
|
|
9
|
+
}>>(value: import(".store/@xylabs-promise-npm-4.4.15-6ab7463903/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<import("./Payload.ts").DeepRestrictToStringKeys<{
|
|
10
|
+
schema: import("./Schema.ts").Schema;
|
|
11
|
+
}>>, config?: import("@xylabs/object").TypeCheckConfig): TType;
|
|
12
12
|
};
|
|
13
13
|
export declare const isPayload: <T extends Payload>(schema: string[]) => (value: unknown) => value is T;
|
|
14
14
|
export declare const asPayload: <T extends Payload>(schema: string[]) => {
|
|
15
|
-
<TType extends T>(value: import(".store/@xylabs-promise-npm-4.4.
|
|
16
|
-
<TType extends T>(value: import(".store/@xylabs-promise-npm-4.4.
|
|
15
|
+
<TType extends T>(value: import(".store/@xylabs-promise-npm-4.4.15-6ab7463903/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
|
|
16
|
+
<TType extends T>(value: import(".store/@xylabs-promise-npm-4.4.15-6ab7463903/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<T>, config?: import("@xylabs/object").TypeCheckConfig): TType;
|
|
17
17
|
};
|
|
18
18
|
//# sourceMappingURL=isPayload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isPayload.d.ts","sourceRoot":"","sources":["../../src/isPayload.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C,eAAO,MAAM,YAAY,UAAW,OAAO,KAAG,KAAK,IAAI,OAKtD,CAAA;AAED,eAAO,MAAM,YAAY;;;
|
|
1
|
+
{"version":3,"file":"isPayload.d.ts","sourceRoot":"","sources":["../../src/isPayload.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C,eAAO,MAAM,YAAY,UAAW,OAAO,KAAG,KAAK,IAAI,OAKtD,CAAA;AAED,eAAO,MAAM,YAAY;;;sBAHpB,sDAGD,iCAAiC,gBAAoB;;;sBAIrD,sDAAe;;yBAGb,gBACK;CARqD,CAAA;AAEhE,eAAO,MAAM,SAAS,GACjB,CAAC,SAAS,OAAO,UAAU,MAAM,EAAE,aAC5B,OAAO,KAAG,KAAK,IAAI,CAK1B,CAAA;AAEL,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,OAAO,UAAU,MAAM,EAAE;oCAdxD,sDAGD,iCAAiC,gBAAoB;oCAIrD,sDAAe,4FAGb,gBACK;CAGuI,CAAA"}
|