@xyo-network/id-payload-plugin 7.0.11 → 7.0.13

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 CHANGED
@@ -1,3 +1,49 @@
1
+ [![logo][]](https://xyo.network)
2
+
1
3
  # @xyo-network/id-payload-plugin
2
4
 
3
- Deprecated compatibility stub. Use `@xyo-network/sdk-protocol/id-payload-plugin` instead.
5
+ [![npm][npm-badge]][npm-link]
6
+ [![license][license-badge]][license-link]
7
+
8
+ > Typescript/Javascript Plugins for XYO Platform
9
+
10
+ ## Install
11
+
12
+ Using npm:
13
+
14
+ ```sh
15
+ npm install {{name}}
16
+ ```
17
+
18
+ Using yarn:
19
+
20
+ ```sh
21
+ yarn add {{name}}
22
+ ```
23
+
24
+ Using pnpm:
25
+
26
+ ```sh
27
+ pnpm add {{name}}
28
+ ```
29
+
30
+ Using bun:
31
+
32
+ ```sh
33
+ bun add {{name}}
34
+ ```
35
+
36
+
37
+ ## License
38
+
39
+ See the [LICENSE](LICENSE) file for license rights and limitations (LGPL-3.0-only).
40
+
41
+ ## Credits
42
+
43
+ [Made with 🔥 and ❄️ by XYO Foundation](https://xyo.network)
44
+
45
+ [npm-badge]: https://img.shields.io/npm/v/@xyo-network/id-payload-plugin.svg
46
+ [npm-link]: https://www.npmjs.com/package/@xyo-network/id-payload-plugin
47
+ [license-badge]: https://img.shields.io/npm/l/@xyo-network/id-payload-plugin.svg
48
+ [license-link]: https://github.com/xylabs/sdk-js/blob/main/LICENSE
49
+ [logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
@@ -0,0 +1,86 @@
1
+ import type { WithSources } from '@xyo-network/payload-model';
2
+ import * as z from 'zod/mini';
3
+ /**
4
+ * The fields of an ID Payload
5
+ */
6
+ export interface IdFields {
7
+ salt: string;
8
+ }
9
+ export declare const IdPayloadZod: z.ZodMiniObject<{
10
+ schema: z.ZodMiniLiteral<"network.xyo.id" & {
11
+ readonly __schema: true;
12
+ }>;
13
+ salt: z.ZodMiniString<string>;
14
+ }, z.core.$strip>;
15
+ /**
16
+ * The ID Payload
17
+ */
18
+ export type Id = z.infer<typeof IdPayloadZod>;
19
+ /**
20
+ * @deprecated Use `Id` instead
21
+ */
22
+ export type IdPayload = Id;
23
+ /**
24
+ * Identity helpers for ID Payload
25
+ */
26
+ export declare const isId: <T>(value: T) => value is T & {
27
+ schema: "network.xyo.id" & {
28
+ readonly __schema: true;
29
+ };
30
+ salt: string;
31
+ };
32
+ export declare const asId: {
33
+ <T>(value: T): (T & {
34
+ schema: "network.xyo.id" & {
35
+ readonly __schema: true;
36
+ };
37
+ salt: string;
38
+ }) | undefined;
39
+ <T>(value: T, assert: import("@ariestools/sdk").ZodFactoryConfig): T & {
40
+ schema: "network.xyo.id" & {
41
+ readonly __schema: true;
42
+ };
43
+ salt: string;
44
+ };
45
+ };
46
+ export declare const toId: {
47
+ <T>(value: T): (T & {
48
+ schema: "network.xyo.id" & {
49
+ readonly __schema: true;
50
+ };
51
+ salt: string;
52
+ }) | undefined;
53
+ <T>(value: T, assert: import("@ariestools/sdk").ZodFactoryConfig): T & {
54
+ schema: "network.xyo.id" & {
55
+ readonly __schema: true;
56
+ };
57
+ salt: string;
58
+ };
59
+ };
60
+ /**
61
+ * @deprecated Use `asId` instead (returns undefined on failure when called without an assert config)
62
+ */
63
+ export declare const asOptionalId: {
64
+ <T>(value: T): (T & {
65
+ schema: "network.xyo.id" & {
66
+ readonly __schema: true;
67
+ };
68
+ salt: string;
69
+ }) | undefined;
70
+ <T>(value: T, assert: import("@ariestools/sdk").ZodFactoryConfig): T & {
71
+ schema: "network.xyo.id" & {
72
+ readonly __schema: true;
73
+ };
74
+ salt: string;
75
+ };
76
+ };
77
+ /**
78
+ * Identity helper for ID Payload with sources
79
+ */
80
+ export declare const isIdWithSources: (x?: unknown) => x is WithSources<WithSources<{
81
+ schema: "network.xyo.id" & {
82
+ readonly __schema: true;
83
+ };
84
+ salt: string;
85
+ }>>;
86
+ //# sourceMappingURL=Payload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../src/Payload.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAE7D,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAI7B;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAA;CACb;AAED,eAAO,MAAM,YAAY;;;;;iBAA+D,CAAA;AAExF;;GAEG;AACH,MAAM,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;AAE7C;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,EAAE,CAAA;AAE1B;;GAEG;AACH,eAAO,MAAM,IAAI;;;;;CAA6B,CAAA;AAC9C,eAAO,MAAM,IAAI;;;;;;;;;;;;;CAAqC,CAAA;AACtD,eAAO,MAAM,IAAI;;;;;;;;;;;;;CAAqC,CAAA;AAEtD;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;CAAO,CAAA;AAEhC;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;GAA8D,CAAA"}
@@ -0,0 +1,7 @@
1
+ export declare const IdPayloadPlugin: () => import("@xyo-network/payload-plugin").PayloadPlugin<{
2
+ schema: "network.xyo.id" & {
3
+ readonly __schema: true;
4
+ };
5
+ salt: string;
6
+ }>;
7
+ //# sourceMappingURL=Plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,eAAe;;;;;EAIxB,CAAA"}
@@ -0,0 +1,5 @@
1
+ export declare const IdSchema: "network.xyo.id" & {
2
+ readonly __schema: true;
3
+ };
4
+ export type IdSchema = typeof IdSchema;
5
+ //# sourceMappingURL=Schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../src/Schema.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ;;CAAmC,CAAA;AACxD,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { Id } from './Payload.ts';
2
+ export declare const idPayloadTemplate: () => Id;
3
+ //# sourceMappingURL=Template.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Template.d.ts","sourceRoot":"","sources":["../../src/Template.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AAGtC,eAAO,MAAM,iBAAiB,QAAO,EAGnC,CAAA"}
@@ -1,6 +1,5 @@
1
- /**
2
- * @deprecated Use `@xyo-network/sdk-protocol/id-payload-plugin` instead.
3
- * `@xyo-network/id-payload-plugin` is a backward-compatibility re-export stub.
4
- */
5
- export * from '@xyo-network/sdk-protocol/id-payload-plugin';
1
+ export * from './Payload.ts';
2
+ export { IdPayloadPlugin as default, IdPayloadPlugin } from './Plugin.ts';
3
+ export * from './Schema.ts';
4
+ export * from './Template.ts';
6
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,6CAA6C,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,eAAe,IAAI,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AACzE,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA"}
@@ -1,3 +1,48 @@
1
- // src/index.ts
2
- export * from "@xyo-network/sdk-protocol/id-payload-plugin";
1
+ // src/Payload.ts
2
+ import {
3
+ zodAsFactory,
4
+ zodIsFactory,
5
+ zodToFactory
6
+ } from "@ariestools/sdk";
7
+ import { isPayloadOfSchemaTypeWithSources, PayloadZodOfSchema } from "@xyo-network/payload-model";
8
+ import * as z from "zod/mini";
9
+
10
+ // src/Schema.ts
11
+ import { asSchema } from "@xyo-network/payload-model";
12
+ var IdSchema = asSchema("network.xyo.id", true);
13
+
14
+ // src/Payload.ts
15
+ var IdPayloadZod = z.extend(PayloadZodOfSchema(IdSchema), { salt: z.string() });
16
+ var isId = zodIsFactory(IdPayloadZod);
17
+ var asId = zodAsFactory(IdPayloadZod, "asId");
18
+ var toId = zodToFactory(IdPayloadZod, "toId");
19
+ var asOptionalId = asId;
20
+ var isIdWithSources = isPayloadOfSchemaTypeWithSources(IdSchema);
21
+
22
+ // src/Plugin.ts
23
+ import { createPayloadPlugin } from "@xyo-network/payload-plugin";
24
+
25
+ // src/Template.ts
26
+ var idPayloadTemplate = () => ({
27
+ salt: "",
28
+ schema: IdSchema
29
+ });
30
+
31
+ // src/Plugin.ts
32
+ var IdPayloadPlugin = () => createPayloadPlugin({
33
+ schema: IdSchema,
34
+ template: idPayloadTemplate
35
+ });
36
+ export {
37
+ IdPayloadPlugin,
38
+ IdPayloadZod,
39
+ IdSchema,
40
+ asId,
41
+ asOptionalId,
42
+ IdPayloadPlugin as default,
43
+ idPayloadTemplate,
44
+ isId,
45
+ isIdWithSources,
46
+ toId
47
+ };
3
48
  //# sourceMappingURL=index.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "sourcesContent": ["/**\n * @deprecated Use `@xyo-network/sdk-protocol/id-payload-plugin` instead.\n * `@xyo-network/id-payload-plugin` is a backward-compatibility re-export stub.\n */\nexport * from '@xyo-network/sdk-protocol/id-payload-plugin'\n"],
5
- "mappings": ";AAIA,cAAc;",
3
+ "sources": ["../../src/Payload.ts", "../../src/Schema.ts", "../../src/Plugin.ts", "../../src/Template.ts"],
4
+ "sourcesContent": ["import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@ariestools/sdk'\nimport type { WithSources } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaTypeWithSources, PayloadZodOfSchema } from '@xyo-network/payload-model'\nimport * as z from 'zod/mini'\n\nimport { IdSchema } from './Schema.ts'\n\n/**\n * The fields of an ID Payload\n */\nexport interface IdFields {\n salt: string\n}\n\nexport const IdPayloadZod = z.extend(PayloadZodOfSchema(IdSchema), { salt: z.string() })\n\n/**\n * The ID Payload\n */\nexport type Id = z.infer<typeof IdPayloadZod>\n\n/**\n * @deprecated Use `Id` instead\n */\nexport type IdPayload = Id\n\n/**\n * Identity helpers for ID Payload\n */\nexport const isId = zodIsFactory(IdPayloadZod)\nexport const asId = zodAsFactory(IdPayloadZod, 'asId')\nexport const toId = zodToFactory(IdPayloadZod, 'toId')\n\n/**\n * @deprecated Use `asId` instead (returns undefined on failure when called without an assert config)\n */\nexport const asOptionalId = asId\n\n/**\n * Identity helper for ID Payload with sources\n */\nexport const isIdWithSources = isPayloadOfSchemaTypeWithSources<WithSources<Id>>(IdSchema)\n", "import { asSchema } from '@xyo-network/payload-model'\n\nexport const IdSchema = asSchema('network.xyo.id', true)\nexport type IdSchema = typeof IdSchema\n", "import { createPayloadPlugin } from '@xyo-network/payload-plugin'\n\nimport type { Id } from './Payload.ts'\nimport { IdSchema } from './Schema.ts'\nimport { idPayloadTemplate } from './Template.ts'\n\nexport const IdPayloadPlugin = () =>\n createPayloadPlugin<Id>({\n schema: IdSchema,\n template: idPayloadTemplate,\n })\n", "import type { Id } from './Payload.ts'\nimport { IdSchema } from './Schema.ts'\n\nexport const idPayloadTemplate = (): Id => ({\n salt: '',\n schema: IdSchema,\n})\n"],
5
+ "mappings": ";AAAA;AAAA,EACE;AAAA,EAAc;AAAA,EAAc;AAAA,OACvB;AAEP,SAAS,kCAAkC,0BAA0B;AACrE,YAAY,OAAO;;;ACLnB,SAAS,gBAAgB;AAElB,IAAM,WAAW,SAAS,kBAAkB,IAAI;;;ADchD,IAAM,eAAiB,SAAO,mBAAmB,QAAQ,GAAG,EAAE,MAAQ,SAAO,EAAE,CAAC;AAehF,IAAM,OAAO,aAAa,YAAY;AACtC,IAAM,OAAO,aAAa,cAAc,MAAM;AAC9C,IAAM,OAAO,aAAa,cAAc,MAAM;AAK9C,IAAM,eAAe;AAKrB,IAAM,kBAAkB,iCAAkD,QAAQ;;;AE3CzF,SAAS,2BAA2B;;;ACG7B,IAAM,oBAAoB,OAAW;AAAA,EAC1C,MAAM;AAAA,EACN,QAAQ;AACV;;;ADAO,IAAM,kBAAkB,MAC7B,oBAAwB;AAAA,EACtB,QAAQ;AAAA,EACR,UAAU;AACZ,CAAC;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "@xyo-network/id-payload-plugin",
3
- "version": "7.0.11",
4
- "description": "DEPRECATED - use @xyo-network/sdk-protocol/id-payload-plugin. Backward-compatibility re-export stub for @xyo-network/id-payload-plugin.",
5
- "deprecated": "Use @xyo-network/sdk-protocol/id-payload-plugin instead. @xyo-network/id-payload-plugin is a backward-compatibility re-export stub and will not receive further updates.",
3
+ "version": "7.0.13",
4
+ "description": "Typescript/Javascript Plugins for XYO Platform",
6
5
  "homepage": "https://xyo.network",
7
6
  "bugs": {
8
7
  "url": "git+https://github.com/XYOracleNetwork/plugins/issues",
@@ -35,34 +34,41 @@
35
34
  "README.md"
36
35
  ],
37
36
  "dependencies": {
38
- "@xyo-network/sdk-protocol": "~7.0.11"
37
+ "@xyo-network/payload-model": "~7.0.13",
38
+ "@xyo-network/payload-plugin": "~7.0.13"
39
39
  },
40
40
  "devDependencies": {
41
- "@xylabs/toolchain": "~8.5.15",
42
- "@xylabs/tsconfig": "~8.5.15",
43
- "browserslist": "4.28.4",
44
- "eslint": "^10.6.0",
45
- "eslint-import-resolver-typescript": "^4.4.5",
46
- "typescript": "~6.0.3"
41
+ "@ariestools/sdk": "~7.0.8",
42
+ "@opentelemetry/api": "~1.9.1",
43
+ "@opentelemetry/sdk-trace-base": "~2.9.0",
44
+ "@scure/base": "~2.2.0",
45
+ "@xylabs/threads": "~7.0.8",
46
+ "@xylabs/toolchain": "~8.6.2",
47
+ "@xylabs/tsconfig": "~8.6.2",
48
+ "@xylabs/vitest-extended": "~7.0.8",
49
+ "async-mutex": "~0.5.0",
50
+ "browserslist": "~4.28.4",
51
+ "debug": "~4.4.3",
52
+ "eslint": "~10.6.0",
53
+ "eslint-import-resolver-typescript": "~4.4.5",
54
+ "hash-wasm": "~4.12.0",
55
+ "observable-fns": "~0.6.1",
56
+ "typescript": "~6.0.3",
57
+ "vite": "~8.1.3",
58
+ "vitest": "~4.1.9",
59
+ "zod": "~4.4.3"
47
60
  },
48
61
  "peerDependencies": {
49
- "@ariestools/sdk": "^7.0.4",
50
- "@bitauth/libauth": "~3.0",
51
- "@noble/post-quantum": "~0.6.1",
52
- "@opentelemetry/api": "^1.9",
53
- "@opentelemetry/sdk-trace-base": "^2.7",
54
- "@scure/base": "~2.2",
55
- "@scure/bip39": "~2.2",
56
- "@xylabs/geo": "^7.0",
57
- "@xylabs/threads": "^7.0",
58
- "ajv": "^8.20",
59
- "async-mutex": "^0.5",
60
- "debug": "^4.4",
61
- "ethers": "^6.16",
62
- "hash-wasm": "~4.12",
63
- "idb": "^8.0",
64
- "observable-fns": "^0.6",
65
- "zod": "^4.4"
62
+ "@ariestools/sdk": "^7.0.8",
63
+ "@opentelemetry/api": "^1.9.1",
64
+ "@opentelemetry/sdk-trace-base": "^2.9.0",
65
+ "@scure/base": "^2.2.0",
66
+ "@xylabs/threads": "^7.0.8",
67
+ "async-mutex": "^0.5.0",
68
+ "debug": "^4.4.3",
69
+ "hash-wasm": "^4.12.0",
70
+ "observable-fns": "^0.6.1",
71
+ "zod": "^4.4.3"
66
72
  },
67
73
  "engines": {
68
74
  "node": "^24"