@xyo-network/id-payload-plugin 5.2.25 → 5.3.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.
@@ -1,3 +1,5 @@
1
- export declare const IdSchema: "network.xyo.id";
1
+ export declare const IdSchema: "network.xyo.id" & {
2
+ readonly __schema: true;
3
+ };
2
4
  export type IdSchema = typeof IdSchema;
3
5
  //# sourceMappingURL=Schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../src/Schema.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,EAAG,gBAAyB,CAAA;AACjD,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAA"}
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"}
@@ -6,7 +6,8 @@ import {
6
6
  } from "@xyo-network/payload-model";
7
7
 
8
8
  // src/Schema.ts
9
- var IdSchema = "network.xyo.id";
9
+ import { asSchema } from "@xyo-network/payload-model";
10
+ var IdSchema = asSchema("network.xyo.id", true);
10
11
 
11
12
  // src/Payload.ts
12
13
  var isId = isPayloadOfSchemaType(IdSchema);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Payload.ts","../../src/Schema.ts","../../src/Plugin.ts","../../src/Template.ts"],"sourcesContent":["import { AsObjectFactory } from '@xylabs/sdk-js'\nimport type {\n Payload,\n WithSources,\n} from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType,\n isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/payload-model'\n\nimport { IdSchema } from './Schema.ts'\n\n/**\n * The fields of an ID Payload\n */\nexport type IdFields = {\n salt: string\n}\n\n/**\n * The ID Payload\n */\nexport type Id = Payload<IdFields, IdSchema>\n\n/**\n * @deprecated Use `Id` instead\n */\n\nexport type IdPayload = Id\n\n/**\n * Identity helper for ID Payload\n */\nexport const isId = isPayloadOfSchemaType<Id>(IdSchema)\nexport const asId = AsObjectFactory.create(isId)\nexport const asOptionalId = AsObjectFactory.createOptional(isId)\n\n/**\n * Identity helper for ID Payload with sources\n */\nexport const isIdWithSources = isPayloadOfSchemaTypeWithSources<WithSources<Id>>(IdSchema)\n","export const IdSchema = 'network.xyo.id' as const\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"],"mappings":";AAAA,SAAS,uBAAuB;AAKhC;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACRA,IAAM,WAAW;;;ADiCjB,IAAM,OAAO,sBAA0B,QAAQ;AAC/C,IAAM,OAAO,gBAAgB,OAAO,IAAI;AACxC,IAAM,eAAe,gBAAgB,eAAe,IAAI;AAKxD,IAAM,kBAAkB,iCAAkD,QAAQ;;;AExCzF,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;","names":[]}
1
+ {"version":3,"sources":["../../src/Payload.ts","../../src/Schema.ts","../../src/Plugin.ts","../../src/Template.ts"],"sourcesContent":["import { AsObjectFactory } from '@xylabs/sdk-js'\nimport type {\n Payload,\n WithSources,\n} from '@xyo-network/payload-model'\nimport {\n isPayloadOfSchemaType,\n isPayloadOfSchemaTypeWithSources,\n} from '@xyo-network/payload-model'\n\nimport { IdSchema } from './Schema.ts'\n\n/**\n * The fields of an ID Payload\n */\nexport type IdFields = {\n salt: string\n}\n\n/**\n * The ID Payload\n */\nexport type Id = Payload<IdFields, IdSchema>\n\n/**\n * @deprecated Use `Id` instead\n */\n\nexport type IdPayload = Id\n\n/**\n * Identity helper for ID Payload\n */\nexport const isId = isPayloadOfSchemaType<Id>(IdSchema)\nexport const asId = AsObjectFactory.create(isId)\nexport const asOptionalId = AsObjectFactory.createOptional(isId)\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"],"mappings":";AAAA,SAAS,uBAAuB;AAKhC;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACRP,SAAS,gBAAgB;AAElB,IAAM,WAAW,SAAS,kBAAkB,IAAI;;;AD+BhD,IAAM,OAAO,sBAA0B,QAAQ;AAC/C,IAAM,OAAO,gBAAgB,OAAO,IAAI;AACxC,IAAM,eAAe,gBAAgB,eAAe,IAAI;AAKxD,IAAM,kBAAkB,iCAAkD,QAAQ;;;AExCzF,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;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/id-payload-plugin",
3
- "version": "5.2.25",
3
+ "version": "5.3.0",
4
4
  "description": "Typescript/Javascript Plugins for XYO Platform",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -36,16 +36,16 @@
36
36
  "!**/*.test.*"
37
37
  ],
38
38
  "dependencies": {
39
- "@xylabs/sdk-js": "~5.0.63",
40
- "@xyo-network/payload-model": "~5.2.25",
41
- "@xyo-network/payload-plugin": "~5.2.25"
39
+ "@xylabs/sdk-js": "~5.0.64",
40
+ "@xyo-network/payload-model": "~5.3.0",
41
+ "@xyo-network/payload-plugin": "~5.3.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@xylabs/ts-scripts-yarn3": "~7.2.32",
45
- "@xylabs/tsconfig": "~7.2.32",
46
- "@xylabs/vitest-extended": "~5.0.63",
44
+ "@xylabs/ts-scripts-yarn3": "~7.3.2",
45
+ "@xylabs/tsconfig": "~7.3.2",
46
+ "@xylabs/vitest-extended": "~5.0.64",
47
47
  "typescript": "~5.9.3",
48
- "vitest": "~4.0.17"
48
+ "vitest": "~4.0.18"
49
49
  },
50
50
  "publishConfig": {
51
51
  "access": "public"
package/src/Schema.ts CHANGED
@@ -1,2 +1,4 @@
1
- export const IdSchema = 'network.xyo.id' as const
1
+ import { asSchema } from '@xyo-network/payload-model'
2
+
3
+ export const IdSchema = asSchema('network.xyo.id', true)
2
4
  export type IdSchema = typeof IdSchema