@xyo-network/diviner-schema-list 6.0.4 → 6.1.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/README.md +3 -1
- package/dist/neutral/Config.d.ts.map +1 -1
- package/dist/neutral/Query.d.ts.map +1 -1
- package/dist/neutral/Schema.d.ts +1 -1
- package/dist/neutral/Schema.d.ts.map +1 -1
- package/dist/neutral/index.mjs.map +2 -2
- package/dist/neutral/memory.mjs.map +2 -2
- package/dist/neutral/model.mjs.map +2 -2
- package/package.json +14 -15
package/README.md
CHANGED
|
@@ -38,10 +38,12 @@ bun add {{name}}
|
|
|
38
38
|
|
|
39
39
|
See the [LICENSE](LICENSE) file for license rights and limitations (LGPL-3.0-only).
|
|
40
40
|
|
|
41
|
+
## Credits
|
|
41
42
|
|
|
43
|
+
[Made with 🔥 and ❄️ by XYO Foundation](https://xyo.network)
|
|
42
44
|
|
|
43
|
-
[logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
|
|
44
45
|
[npm-badge]: https://img.shields.io/npm/v/@xyo-network/diviner-schema-list.svg
|
|
45
46
|
[npm-link]: https://www.npmjs.com/package/@xyo-network/diviner-schema-list
|
|
46
47
|
[license-badge]: https://img.shields.io/npm/l/@xyo-network/diviner-schema-list.svg
|
|
47
48
|
[license-link]: https://github.com/xylabs/sdk-js/blob/main/LICENSE
|
|
49
|
+
[logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAY,KAAK,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAIrE,eAAO,MAAM,6BAA6B
|
|
1
|
+
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAY,KAAK,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAIrE,eAAO,MAAM,6BAA6B,EAAE,MAAM,GAAG;IACnD,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAA;CAC8B,CAAA;AACvD,MAAM,MAAM,6BAA6B,GAAG,OAAO,6BAA6B,CAAA;AAEhF,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,IAAI,aAAa,CAC9E,CAAC,GAAG;IACF,MAAM,EAAE,6BAA6B,CAAA;CACtC,CACF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Query.d.ts","sourceRoot":"","sources":["../../src/Query.ts"],"names":[],"mappings":"AAAA,OAAO,EACK,KAAK,OAAO,EAAE,KAAK,KAAK,EACnC,MAAM,8BAA8B,CAAA;AAIrC,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"Query.d.ts","sourceRoot":"","sources":["../../src/Query.ts"],"names":[],"mappings":"AAAA,OAAO,EACK,KAAK,OAAO,EAAE,KAAK,KAAK,EACnC,MAAM,8BAA8B,CAAA;AAIrC,eAAO,MAAM,qBAAqB,EAAE,MAAM,GAAG;IAC3C,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAA;CAC6B,CAAA;AACtD,MAAM,MAAM,qBAAqB,GAAG,OAAO,qBAAqB,CAAA;AAEhE,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC;IAAE,MAAM,EAAE,qBAAqB,CAAA;CAAE,CAAC,CAAA;AAC7E,eAAO,MAAM,wBAAwB,GAAI,IAAI,OAAO,GAAG,IAAI,KAAG,CAAC,IAAI,sBAA6D,CAAA"}
|
package/dist/neutral/Schema.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const SchemaListDivinerSchema:
|
|
1
|
+
export declare const SchemaListDivinerSchema: 'network.xyo.diviner.schema.list' & {
|
|
2
2
|
readonly __schema: true;
|
|
3
3
|
};
|
|
4
4
|
export type SchemaListDivinerSchema = typeof SchemaListDivinerSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../src/Schema.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../src/Schema.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB,EAAE,iCAAiC,GAAG;IACxE,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAA;CAC4B,CAAA;AACrD,MAAM,MAAM,uBAAuB,GAAG,OAAO,uBAAuB,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/SchemaListDiviner.ts", "../../src/MemorySchemaListDiviner.ts", "../../src/Config.ts", "../../src/Schema.ts", "../../src/Query.ts", "../../src/Payload.ts"],
|
|
4
|
-
"sourcesContent": ["import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport type { DivinerInstance, DivinerModuleEventData } from '@xyo-network/diviner-model'\nimport type { Payload } from '@xyo-network/sdk-protocol-js'\n\nimport type { SchemaListDivinerParams } from './Params.ts'\n\nexport abstract class SchemaListDiviner<\n TParams extends SchemaListDivinerParams = SchemaListDivinerParams,\n TIn extends Payload = Payload,\n TOut extends Payload = Payload,\n TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<\n DivinerInstance<TParams, TIn, TOut>,\n TIn,\n TOut\n >,\n> extends AbstractDiviner<TParams, TIn, TOut, TEventData> {}\n", "import { assertEx, distinct } from '@xylabs/sdk-js'\nimport { isBoundWitness, PayloadBuilder } from '@xyo-network/sdk-protocol-js'\nimport {\n isStorageMeta, type Payload, type Schema, type XyoAddress,\n} from '@xyo-network/sdk-protocol-js'\n\nimport { SchemaListDivinerConfigSchema } from './Config.ts'\nimport type { SchemaListDivinerParams } from './Params.ts'\nimport type { SchemaListPayload } from './Payload.ts'\nimport type { SchemaListQueryPayload } from './Query.ts'\nimport { isSchemaListQueryPayload } from './Query.ts'\nimport { SchemaListDivinerSchema } from './Schema.ts'\nimport { SchemaListDiviner } from './SchemaListDiviner.ts'\n\nexport class MemorySchemaListDiviner<TParams extends SchemaListDivinerParams = SchemaListDivinerParams> extends SchemaListDiviner<TParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, SchemaListDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = SchemaListDivinerConfigSchema\n\n protected async divineAddress(address: XyoAddress): Promise<string[]> {\n const archivist = assertEx(await this.archivistInstance(), () => 'Unable to resolve archivist')\n const filtered = (await archivist.next({ limit: 20_000 }))\n .filter(x => isBoundWitness(x) && isStorageMeta(x))\n .filter(bw => bw.addresses.includes(address))\n return filtered.flatMap(bw => bw.payload_schemas).filter(distinct)\n }\n\n protected async divineAllAddresses(): Promise<string[]> {\n const archivist = assertEx(await this.archivistInstance(), () => 'Unable to resolve archivist')\n const all = await archivist.next({ limit: 20_000 })\n return all.map(payload => payload.schema).filter(distinct)\n }\n\n protected override async divineHandler(payloads?: Payload[]): Promise<Payload[]> {\n const query = payloads?.find<SchemaListQueryPayload>(isSchemaListQueryPayload)\n if (!query) return []\n const addresses\n = query?.address\n ? Array.isArray(query?.address)\n ? query.address\n : [query.address]\n : undefined\n const results = addresses ? await Promise.all(addresses.map(address => this.divineAddress(address))) : [await this.divineAllAddresses()]\n return results.map(schemas => new PayloadBuilder<SchemaListPayload>({ schema: SchemaListDivinerSchema }).fields({ schemas }).build())\n }\n}\n", "import type { DivinerConfig } from '@xyo-network/diviner-model'\nimport { asSchema, type Payload } from '@xyo-network/sdk-protocol-js'\n\nimport { SchemaListDivinerSchema } from './Schema.ts'\n\nexport const SchemaListDivinerConfigSchema = asSchema(`${SchemaListDivinerSchema}.config`, true)\nexport type SchemaListDivinerConfigSchema = typeof SchemaListDivinerConfigSchema\n\nexport type SchemaListDivinerConfig<T extends Payload = Payload> = DivinerConfig<\n T & {\n schema: SchemaListDivinerConfigSchema\n }\n>\n", "import { asSchema } from '@xyo-network/sdk-protocol-js'\n\nexport const SchemaListDivinerSchema = asSchema('network.xyo.diviner.schema.list', true)\nexport type SchemaListDivinerSchema = typeof SchemaListDivinerSchema\n", "import {\n asSchema, type Payload, type Query,\n} from '@xyo-network/sdk-protocol-js'\n\nimport { SchemaListDivinerSchema } from './Schema.ts'\n\nexport const SchemaListQuerySchema = asSchema(`${SchemaListDivinerSchema}.query`, true)\nexport type SchemaListQuerySchema = typeof SchemaListQuerySchema\n\nexport type SchemaListQueryPayload = Query<{ schema: SchemaListQuerySchema }>\nexport const isSchemaListQueryPayload = (x?: Payload | null): x is SchemaListQueryPayload => x?.schema === SchemaListQuerySchema\n", "import type { Payload } from '@xyo-network/sdk-protocol-js'\n\nimport { SchemaListDivinerSchema } from './Schema.ts'\n\nexport type SchemaListPayload = Payload<{\n schema: SchemaListDivinerSchema\n schemas: string[]\n}>\n\nexport const isSchemaListPayload = (x?: Payload | null): x is SchemaListPayload => x?.schema === SchemaListDivinerSchema\n"],
|
|
5
|
-
"mappings": ";AAAA,SAAS,uBAAuB;AAMzB,IAAe,oBAAf,cASG,gBAAgD;AAAC;;;ACf3D,SAAS,UAAU,gBAAgB;AACnC,SAAS,gBAAgB,sBAAsB;AAC/C;AAAA,EACE;AAAA,OACK;;;ACHP,SAAS,YAAAA,iBAA8B;;;ACDvC,SAAS,gBAAgB;AAElB,IAAM,
|
|
4
|
+
"sourcesContent": ["import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport type { DivinerInstance, DivinerModuleEventData } from '@xyo-network/diviner-model'\nimport type { Payload } from '@xyo-network/sdk-protocol-js'\n\nimport type { SchemaListDivinerParams } from './Params.ts'\n\nexport abstract class SchemaListDiviner<\n TParams extends SchemaListDivinerParams = SchemaListDivinerParams,\n TIn extends Payload = Payload,\n TOut extends Payload = Payload,\n TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<\n DivinerInstance<TParams, TIn, TOut>,\n TIn,\n TOut\n >,\n> extends AbstractDiviner<TParams, TIn, TOut, TEventData> {}\n", "import { assertEx, distinct } from '@xylabs/sdk-js'\nimport { isBoundWitness, PayloadBuilder } from '@xyo-network/sdk-protocol-js'\nimport {\n isStorageMeta, type Payload, type Schema, type XyoAddress,\n} from '@xyo-network/sdk-protocol-js'\n\nimport { SchemaListDivinerConfigSchema } from './Config.ts'\nimport type { SchemaListDivinerParams } from './Params.ts'\nimport type { SchemaListPayload } from './Payload.ts'\nimport type { SchemaListQueryPayload } from './Query.ts'\nimport { isSchemaListQueryPayload } from './Query.ts'\nimport { SchemaListDivinerSchema } from './Schema.ts'\nimport { SchemaListDiviner } from './SchemaListDiviner.ts'\n\nexport class MemorySchemaListDiviner<TParams extends SchemaListDivinerParams = SchemaListDivinerParams> extends SchemaListDiviner<TParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, SchemaListDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = SchemaListDivinerConfigSchema\n\n protected async divineAddress(address: XyoAddress): Promise<string[]> {\n const archivist = assertEx(await this.archivistInstance(), () => 'Unable to resolve archivist')\n const filtered = (await archivist.next({ limit: 20_000 }))\n .filter(x => isBoundWitness(x) && isStorageMeta(x))\n .filter(bw => bw.addresses.includes(address))\n return filtered.flatMap(bw => bw.payload_schemas).filter(distinct)\n }\n\n protected async divineAllAddresses(): Promise<string[]> {\n const archivist = assertEx(await this.archivistInstance(), () => 'Unable to resolve archivist')\n const all = await archivist.next({ limit: 20_000 })\n return all.map(payload => payload.schema).filter(distinct)\n }\n\n protected override async divineHandler(payloads?: Payload[]): Promise<Payload[]> {\n const query = payloads?.find<SchemaListQueryPayload>(isSchemaListQueryPayload)\n if (!query) return []\n const addresses\n = query?.address\n ? Array.isArray(query?.address)\n ? query.address\n : [query.address]\n : undefined\n const results = addresses ? await Promise.all(addresses.map(address => this.divineAddress(address))) : [await this.divineAllAddresses()]\n return results.map(schemas => new PayloadBuilder<SchemaListPayload>({ schema: SchemaListDivinerSchema }).fields({ schemas }).build())\n }\n}\n", "import type { DivinerConfig } from '@xyo-network/diviner-model'\nimport { asSchema, type Payload } from '@xyo-network/sdk-protocol-js'\n\nimport { SchemaListDivinerSchema } from './Schema.ts'\n\nexport const SchemaListDivinerConfigSchema: string & {\n readonly __schema: true\n} = asSchema(`${SchemaListDivinerSchema}.config`, true)\nexport type SchemaListDivinerConfigSchema = typeof SchemaListDivinerConfigSchema\n\nexport type SchemaListDivinerConfig<T extends Payload = Payload> = DivinerConfig<\n T & {\n schema: SchemaListDivinerConfigSchema\n }\n>\n", "import { asSchema } from '@xyo-network/sdk-protocol-js'\n\nexport const SchemaListDivinerSchema: 'network.xyo.diviner.schema.list' & {\n readonly __schema: true\n} = asSchema('network.xyo.diviner.schema.list', true)\nexport type SchemaListDivinerSchema = typeof SchemaListDivinerSchema\n", "import {\n asSchema, type Payload, type Query,\n} from '@xyo-network/sdk-protocol-js'\n\nimport { SchemaListDivinerSchema } from './Schema.ts'\n\nexport const SchemaListQuerySchema: string & {\n readonly __schema: true\n} = asSchema(`${SchemaListDivinerSchema}.query`, true)\nexport type SchemaListQuerySchema = typeof SchemaListQuerySchema\n\nexport type SchemaListQueryPayload = Query<{ schema: SchemaListQuerySchema }>\nexport const isSchemaListQueryPayload = (x?: Payload | null): x is SchemaListQueryPayload => x?.schema === SchemaListQuerySchema\n", "import type { Payload } from '@xyo-network/sdk-protocol-js'\n\nimport { SchemaListDivinerSchema } from './Schema.ts'\n\nexport type SchemaListPayload = Payload<{\n schema: SchemaListDivinerSchema\n schemas: string[]\n}>\n\nexport const isSchemaListPayload = (x?: Payload | null): x is SchemaListPayload => x?.schema === SchemaListDivinerSchema\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,uBAAuB;AAMzB,I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,UACL,MAAM,QAAQ,OAAO,OAAO,IAC1B,MAAM,UACN,CAAC,MAAM,OAAO,IAChB;AACN,UAAM,UAAU,YAAY,MAAM,QAAQ,IAAI,UAAU,IAAI,aAAW,KAAK,cAAc,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,KAAK,mBAAmB,CAAC;AACvI,WAAO,QAAQ,IAAI,aAAW,IAAI,eAAkC,EAAE,QAAQ,wBAAwB,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;AAAA,EACtI;AACF;;;AInCO,IAAM,sBAAsB,CAAC,MAA+C,GAAG,WAAW;",
|
|
6
6
|
"names": ["asSchema", "asSchema", "asSchema", "asSchema"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/MemorySchemaListDiviner.ts", "../../src/Config.ts", "../../src/Schema.ts", "../../src/Query.ts", "../../src/SchemaListDiviner.ts"],
|
|
4
|
-
"sourcesContent": ["import { assertEx, distinct } from '@xylabs/sdk-js'\nimport { isBoundWitness, PayloadBuilder } from '@xyo-network/sdk-protocol-js'\nimport {\n isStorageMeta, type Payload, type Schema, type XyoAddress,\n} from '@xyo-network/sdk-protocol-js'\n\nimport { SchemaListDivinerConfigSchema } from './Config.ts'\nimport type { SchemaListDivinerParams } from './Params.ts'\nimport type { SchemaListPayload } from './Payload.ts'\nimport type { SchemaListQueryPayload } from './Query.ts'\nimport { isSchemaListQueryPayload } from './Query.ts'\nimport { SchemaListDivinerSchema } from './Schema.ts'\nimport { SchemaListDiviner } from './SchemaListDiviner.ts'\n\nexport class MemorySchemaListDiviner<TParams extends SchemaListDivinerParams = SchemaListDivinerParams> extends SchemaListDiviner<TParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, SchemaListDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = SchemaListDivinerConfigSchema\n\n protected async divineAddress(address: XyoAddress): Promise<string[]> {\n const archivist = assertEx(await this.archivistInstance(), () => 'Unable to resolve archivist')\n const filtered = (await archivist.next({ limit: 20_000 }))\n .filter(x => isBoundWitness(x) && isStorageMeta(x))\n .filter(bw => bw.addresses.includes(address))\n return filtered.flatMap(bw => bw.payload_schemas).filter(distinct)\n }\n\n protected async divineAllAddresses(): Promise<string[]> {\n const archivist = assertEx(await this.archivistInstance(), () => 'Unable to resolve archivist')\n const all = await archivist.next({ limit: 20_000 })\n return all.map(payload => payload.schema).filter(distinct)\n }\n\n protected override async divineHandler(payloads?: Payload[]): Promise<Payload[]> {\n const query = payloads?.find<SchemaListQueryPayload>(isSchemaListQueryPayload)\n if (!query) return []\n const addresses\n = query?.address\n ? Array.isArray(query?.address)\n ? query.address\n : [query.address]\n : undefined\n const results = addresses ? await Promise.all(addresses.map(address => this.divineAddress(address))) : [await this.divineAllAddresses()]\n return results.map(schemas => new PayloadBuilder<SchemaListPayload>({ schema: SchemaListDivinerSchema }).fields({ schemas }).build())\n }\n}\n", "import type { DivinerConfig } from '@xyo-network/diviner-model'\nimport { asSchema, type Payload } from '@xyo-network/sdk-protocol-js'\n\nimport { SchemaListDivinerSchema } from './Schema.ts'\n\nexport const SchemaListDivinerConfigSchema = asSchema(`${SchemaListDivinerSchema}.config`, true)\nexport type SchemaListDivinerConfigSchema = typeof SchemaListDivinerConfigSchema\n\nexport type SchemaListDivinerConfig<T extends Payload = Payload> = DivinerConfig<\n T & {\n schema: SchemaListDivinerConfigSchema\n }\n>\n", "import { asSchema } from '@xyo-network/sdk-protocol-js'\n\nexport const SchemaListDivinerSchema = asSchema('network.xyo.diviner.schema.list', true)\nexport type SchemaListDivinerSchema = typeof SchemaListDivinerSchema\n", "import {\n asSchema, type Payload, type Query,\n} from '@xyo-network/sdk-protocol-js'\n\nimport { SchemaListDivinerSchema } from './Schema.ts'\n\nexport const SchemaListQuerySchema = asSchema(`${SchemaListDivinerSchema}.query`, true)\nexport type SchemaListQuerySchema = typeof SchemaListQuerySchema\n\nexport type SchemaListQueryPayload = Query<{ schema: SchemaListQuerySchema }>\nexport const isSchemaListQueryPayload = (x?: Payload | null): x is SchemaListQueryPayload => x?.schema === SchemaListQuerySchema\n", "import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport type { DivinerInstance, DivinerModuleEventData } from '@xyo-network/diviner-model'\nimport type { Payload } from '@xyo-network/sdk-protocol-js'\n\nimport type { SchemaListDivinerParams } from './Params.ts'\n\nexport abstract class SchemaListDiviner<\n TParams extends SchemaListDivinerParams = SchemaListDivinerParams,\n TIn extends Payload = Payload,\n TOut extends Payload = Payload,\n TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<\n DivinerInstance<TParams, TIn, TOut>,\n TIn,\n TOut\n >,\n> extends AbstractDiviner<TParams, TIn, TOut, TEventData> {}\n"],
|
|
5
|
-
"mappings": ";AAAA,SAAS,UAAU,gBAAgB;AACnC,SAAS,gBAAgB,sBAAsB;AAC/C;AAAA,EACE;AAAA,OACK;;;ACHP,SAAS,YAAAA,iBAA8B;;;ACDvC,SAAS,gBAAgB;AAElB,IAAM,
|
|
4
|
+
"sourcesContent": ["import { assertEx, distinct } from '@xylabs/sdk-js'\nimport { isBoundWitness, PayloadBuilder } from '@xyo-network/sdk-protocol-js'\nimport {\n isStorageMeta, type Payload, type Schema, type XyoAddress,\n} from '@xyo-network/sdk-protocol-js'\n\nimport { SchemaListDivinerConfigSchema } from './Config.ts'\nimport type { SchemaListDivinerParams } from './Params.ts'\nimport type { SchemaListPayload } from './Payload.ts'\nimport type { SchemaListQueryPayload } from './Query.ts'\nimport { isSchemaListQueryPayload } from './Query.ts'\nimport { SchemaListDivinerSchema } from './Schema.ts'\nimport { SchemaListDiviner } from './SchemaListDiviner.ts'\n\nexport class MemorySchemaListDiviner<TParams extends SchemaListDivinerParams = SchemaListDivinerParams> extends SchemaListDiviner<TParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, SchemaListDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = SchemaListDivinerConfigSchema\n\n protected async divineAddress(address: XyoAddress): Promise<string[]> {\n const archivist = assertEx(await this.archivistInstance(), () => 'Unable to resolve archivist')\n const filtered = (await archivist.next({ limit: 20_000 }))\n .filter(x => isBoundWitness(x) && isStorageMeta(x))\n .filter(bw => bw.addresses.includes(address))\n return filtered.flatMap(bw => bw.payload_schemas).filter(distinct)\n }\n\n protected async divineAllAddresses(): Promise<string[]> {\n const archivist = assertEx(await this.archivistInstance(), () => 'Unable to resolve archivist')\n const all = await archivist.next({ limit: 20_000 })\n return all.map(payload => payload.schema).filter(distinct)\n }\n\n protected override async divineHandler(payloads?: Payload[]): Promise<Payload[]> {\n const query = payloads?.find<SchemaListQueryPayload>(isSchemaListQueryPayload)\n if (!query) return []\n const addresses\n = query?.address\n ? Array.isArray(query?.address)\n ? query.address\n : [query.address]\n : undefined\n const results = addresses ? await Promise.all(addresses.map(address => this.divineAddress(address))) : [await this.divineAllAddresses()]\n return results.map(schemas => new PayloadBuilder<SchemaListPayload>({ schema: SchemaListDivinerSchema }).fields({ schemas }).build())\n }\n}\n", "import type { DivinerConfig } from '@xyo-network/diviner-model'\nimport { asSchema, type Payload } from '@xyo-network/sdk-protocol-js'\n\nimport { SchemaListDivinerSchema } from './Schema.ts'\n\nexport const SchemaListDivinerConfigSchema: string & {\n readonly __schema: true\n} = asSchema(`${SchemaListDivinerSchema}.config`, true)\nexport type SchemaListDivinerConfigSchema = typeof SchemaListDivinerConfigSchema\n\nexport type SchemaListDivinerConfig<T extends Payload = Payload> = DivinerConfig<\n T & {\n schema: SchemaListDivinerConfigSchema\n }\n>\n", "import { asSchema } from '@xyo-network/sdk-protocol-js'\n\nexport const SchemaListDivinerSchema: 'network.xyo.diviner.schema.list' & {\n readonly __schema: true\n} = asSchema('network.xyo.diviner.schema.list', true)\nexport type SchemaListDivinerSchema = typeof SchemaListDivinerSchema\n", "import {\n asSchema, type Payload, type Query,\n} from '@xyo-network/sdk-protocol-js'\n\nimport { SchemaListDivinerSchema } from './Schema.ts'\n\nexport const SchemaListQuerySchema: string & {\n readonly __schema: true\n} = asSchema(`${SchemaListDivinerSchema}.query`, true)\nexport type SchemaListQuerySchema = typeof SchemaListQuerySchema\n\nexport type SchemaListQueryPayload = Query<{ schema: SchemaListQuerySchema }>\nexport const isSchemaListQueryPayload = (x?: Payload | null): x is SchemaListQueryPayload => x?.schema === SchemaListQuerySchema\n", "import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport type { DivinerInstance, DivinerModuleEventData } from '@xyo-network/diviner-model'\nimport type { Payload } from '@xyo-network/sdk-protocol-js'\n\nimport type { SchemaListDivinerParams } from './Params.ts'\n\nexport abstract class SchemaListDiviner<\n TParams extends SchemaListDivinerParams = SchemaListDivinerParams,\n TIn extends Payload = Payload,\n TOut extends Payload = Payload,\n TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<\n DivinerInstance<TParams, TIn, TOut>,\n TIn,\n TOut\n >,\n> extends AbstractDiviner<TParams, TIn, TOut, TEventData> {}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,UAAU,gBAAgB;AACnC,SAAS,gBAAgB,sBAAsB;AAC/C;AAAA,EACE;AAAA,OACK;;;ACHP,SAAS,YAAAA,iBAA8B;;;ACDvC,SAAS,gBAAgB;AAElB,IAAM,0BAET,SAAS,mCAAmC,IAAI;;;ADC7C,IAAM,gCAETC,UAAS,GAAG,uBAAuB,WAAW,IAAI;;;AEPtD;AAAA,EACE,YAAAC;AAAA,OACK;AAIA,IAAM,wBAETC,UAAS,GAAG,uBAAuB,UAAU,IAAI;AAI9C,IAAM,2BAA2B,CAAC,MAAoD,GAAG,WAAW;;;ACZ3G,SAAS,uBAAuB;AAMzB,IAAe,oBAAf,cASG,gBAAgD;AAAC;;;AJDpD,IAAM,0BAAN,cAAyG,kBAA2B;AAAA,EACzI,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eA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Config.ts", "../../src/Schema.ts", "../../src/Payload.ts", "../../src/Query.ts"],
|
|
4
|
-
"sourcesContent": ["import type { DivinerConfig } from '@xyo-network/diviner-model'\nimport { asSchema, type Payload } from '@xyo-network/sdk-protocol-js'\n\nimport { SchemaListDivinerSchema } from './Schema.ts'\n\nexport const SchemaListDivinerConfigSchema = asSchema(`${SchemaListDivinerSchema}.config`, true)\nexport type SchemaListDivinerConfigSchema = typeof SchemaListDivinerConfigSchema\n\nexport type SchemaListDivinerConfig<T extends Payload = Payload> = DivinerConfig<\n T & {\n schema: SchemaListDivinerConfigSchema\n }\n>\n", "import { asSchema } from '@xyo-network/sdk-protocol-js'\n\nexport const SchemaListDivinerSchema = asSchema('network.xyo.diviner.schema.list', true)\nexport type SchemaListDivinerSchema = typeof SchemaListDivinerSchema\n", "import type { Payload } from '@xyo-network/sdk-protocol-js'\n\nimport { SchemaListDivinerSchema } from './Schema.ts'\n\nexport type SchemaListPayload = Payload<{\n schema: SchemaListDivinerSchema\n schemas: string[]\n}>\n\nexport const isSchemaListPayload = (x?: Payload | null): x is SchemaListPayload => x?.schema === SchemaListDivinerSchema\n", "import {\n asSchema, type Payload, type Query,\n} from '@xyo-network/sdk-protocol-js'\n\nimport { SchemaListDivinerSchema } from './Schema.ts'\n\nexport const SchemaListQuerySchema = asSchema(`${SchemaListDivinerSchema}.query`, true)\nexport type SchemaListQuerySchema = typeof SchemaListQuerySchema\n\nexport type SchemaListQueryPayload = Query<{ schema: SchemaListQuerySchema }>\nexport const isSchemaListQueryPayload = (x?: Payload | null): x is SchemaListQueryPayload => x?.schema === SchemaListQuerySchema\n"],
|
|
5
|
-
"mappings": ";AACA,SAAS,YAAAA,iBAA8B;;;ACDvC,SAAS,gBAAgB;AAElB,IAAM,
|
|
4
|
+
"sourcesContent": ["import type { DivinerConfig } from '@xyo-network/diviner-model'\nimport { asSchema, type Payload } from '@xyo-network/sdk-protocol-js'\n\nimport { SchemaListDivinerSchema } from './Schema.ts'\n\nexport const SchemaListDivinerConfigSchema: string & {\n readonly __schema: true\n} = asSchema(`${SchemaListDivinerSchema}.config`, true)\nexport type SchemaListDivinerConfigSchema = typeof SchemaListDivinerConfigSchema\n\nexport type SchemaListDivinerConfig<T extends Payload = Payload> = DivinerConfig<\n T & {\n schema: SchemaListDivinerConfigSchema\n }\n>\n", "import { asSchema } from '@xyo-network/sdk-protocol-js'\n\nexport const SchemaListDivinerSchema: 'network.xyo.diviner.schema.list' & {\n readonly __schema: true\n} = asSchema('network.xyo.diviner.schema.list', true)\nexport type SchemaListDivinerSchema = typeof SchemaListDivinerSchema\n", "import type { Payload } from '@xyo-network/sdk-protocol-js'\n\nimport { SchemaListDivinerSchema } from './Schema.ts'\n\nexport type SchemaListPayload = Payload<{\n schema: SchemaListDivinerSchema\n schemas: string[]\n}>\n\nexport const isSchemaListPayload = (x?: Payload | null): x is SchemaListPayload => x?.schema === SchemaListDivinerSchema\n", "import {\n asSchema, type Payload, type Query,\n} from '@xyo-network/sdk-protocol-js'\n\nimport { SchemaListDivinerSchema } from './Schema.ts'\n\nexport const SchemaListQuerySchema: string & {\n readonly __schema: true\n} = asSchema(`${SchemaListDivinerSchema}.query`, true)\nexport type SchemaListQuerySchema = typeof SchemaListQuerySchema\n\nexport type SchemaListQueryPayload = Query<{ schema: SchemaListQuerySchema }>\nexport const isSchemaListQueryPayload = (x?: Payload | null): x is SchemaListQueryPayload => x?.schema === SchemaListQuerySchema\n"],
|
|
5
|
+
"mappings": ";AACA,SAAS,YAAAA,iBAA8B;;;ACDvC,SAAS,gBAAgB;AAElB,IAAM,0BAET,SAAS,mCAAmC,IAAI;;;ADC7C,IAAM,gCAETC,UAAS,GAAG,uBAAuB,WAAW,IAAI;;;AEE/C,IAAM,sBAAsB,CAAC,MAA+C,GAAG,WAAW;;;ACTjG;AAAA,EACE,YAAAC;AAAA,OACK;AAIA,IAAM,wBAETC,UAAS,GAAG,uBAAuB,UAAU,IAAI;AAI9C,IAAM,2BAA2B,CAAC,MAAoD,GAAG,WAAW;",
|
|
6
6
|
"names": ["asSchema", "asSchema", "asSchema", "asSchema"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/diviner-schema-list",
|
|
3
|
-
"version": "6.0
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"README.md"
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@xyo-network/diviner-abstract": "~6.0
|
|
50
|
-
"@xyo-network/diviner-model": "~6.0
|
|
51
|
-
"@xyo-network/module-model": "~6.0
|
|
49
|
+
"@xyo-network/diviner-abstract": "~6.1.0",
|
|
50
|
+
"@xyo-network/diviner-model": "~6.1.0",
|
|
51
|
+
"@xyo-network/module-model": "~6.1.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@bitauth/libauth": "~3.0.0",
|
|
@@ -58,16 +58,14 @@
|
|
|
58
58
|
"@opentelemetry/sdk-trace-base": "^2.7.1",
|
|
59
59
|
"@scure/base": "~2.2.0",
|
|
60
60
|
"@scure/bip39": "~2.2.0",
|
|
61
|
-
"@xylabs/geo": "^6.0
|
|
62
|
-
"@xylabs/sdk-js": "^6.0
|
|
63
|
-
"@xylabs/threads": "^6.0
|
|
64
|
-
"@xylabs/toolchain": "
|
|
65
|
-
"@xylabs/tsconfig": "
|
|
66
|
-
"@xyo-network/sdk-protocol-js": "
|
|
61
|
+
"@xylabs/geo": "^6.1.0",
|
|
62
|
+
"@xylabs/sdk-js": "^6.1.0",
|
|
63
|
+
"@xylabs/threads": "^6.1.0",
|
|
64
|
+
"@xylabs/toolchain": "^8.1.20",
|
|
65
|
+
"@xylabs/tsconfig": "^8.1.20",
|
|
66
|
+
"@xyo-network/sdk-protocol-js": "^6.1.0",
|
|
67
67
|
"ajv": "^8.20.0",
|
|
68
68
|
"async-mutex": "^0.5.0",
|
|
69
|
-
"bn.js": "^5.2.3",
|
|
70
|
-
"buffer": "^6.0.3",
|
|
71
69
|
"debug": "~4.4.3",
|
|
72
70
|
"eslint": "^10.4.1",
|
|
73
71
|
"ethers": "^6.16.0",
|
|
@@ -90,11 +88,9 @@
|
|
|
90
88
|
"@xylabs/geo": "^6.0",
|
|
91
89
|
"@xylabs/sdk-js": "^6.0",
|
|
92
90
|
"@xylabs/threads": "^6.0",
|
|
93
|
-
"@xyo-network/sdk-protocol-js": "
|
|
91
|
+
"@xyo-network/sdk-protocol-js": "^6.1",
|
|
94
92
|
"ajv": "^8.20",
|
|
95
93
|
"async-mutex": "^0.5",
|
|
96
|
-
"bn.js": "^5.2",
|
|
97
|
-
"buffer": "^6.0",
|
|
98
94
|
"debug": "~4.4",
|
|
99
95
|
"ethers": "^6.16",
|
|
100
96
|
"hash-wasm": "~4.12",
|
|
@@ -104,6 +100,9 @@
|
|
|
104
100
|
"webextension-polyfill": "^0.12",
|
|
105
101
|
"zod": "^4.4"
|
|
106
102
|
},
|
|
103
|
+
"engines": {
|
|
104
|
+
"node": "^24"
|
|
105
|
+
},
|
|
107
106
|
"publishConfig": {
|
|
108
107
|
"access": "public"
|
|
109
108
|
}
|