@xyo-network/id-payload-plugin 3.8.0 → 3.8.2

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,5 +1,47 @@
1
- export * from './Payload.ts';
2
- export { IdPayloadPlugin as default, IdPayloadPlugin } from './Plugin.ts';
3
- export * from './Schema.ts';
4
- export * from './Template.ts';
5
- //# sourceMappingURL=index.d.ts.map
1
+ import * as _xylabs_promise from '@xylabs/promise';
2
+ import * as _xylabs_object from '@xylabs/object';
3
+ import { Payload, WithSources } from '@xyo-network/payload-model';
4
+ import * as _xyo_network_payload_plugin from '@xyo-network/payload-plugin';
5
+
6
+ declare const IdSchema: "network.xyo.id";
7
+ type IdSchema = typeof IdSchema;
8
+
9
+ type IdFields = {
10
+ salt: string;
11
+ };
12
+ type Id = Payload<IdFields, IdSchema>;
13
+ type IdPayload = Id;
14
+ declare const isId: (x?: unknown | null) => x is _xylabs_object.DeepRestrictToStringKeys<{
15
+ schema: "network.xyo.id";
16
+ salt: string;
17
+ }>;
18
+ declare const asId: {
19
+ <TType extends _xylabs_object.DeepRestrictToStringKeys<{
20
+ schema: "network.xyo.id";
21
+ salt: string;
22
+ }>>(value: _xylabs_promise.AnyNonPromise, config?: _xylabs_object.TypeCheckConfig): TType | undefined;
23
+ <TType extends _xylabs_object.DeepRestrictToStringKeys<{
24
+ schema: "network.xyo.id";
25
+ salt: string;
26
+ }>>(value: _xylabs_promise.AnyNonPromise, assert: _xylabs_object.StringOrAlertFunction<_xylabs_object.DeepRestrictToStringKeys<{
27
+ schema: "network.xyo.id";
28
+ salt: string;
29
+ }>>, config?: _xylabs_object.TypeCheckConfig): TType;
30
+ };
31
+ declare const asOptionalId: <TType extends _xylabs_object.DeepRestrictToStringKeys<{
32
+ schema: "network.xyo.id";
33
+ salt: string;
34
+ }>>(value: _xylabs_promise.AnyNonPromise) => TType | undefined;
35
+ declare const isIdWithSources: (x?: unknown | null) => x is WithSources<WithSources<_xylabs_object.DeepRestrictToStringKeys<{
36
+ schema: "network.xyo.id";
37
+ salt: string;
38
+ }>>>;
39
+
40
+ declare const IdPayloadPlugin: () => _xyo_network_payload_plugin.PayloadPlugin<_xylabs_object.DeepRestrictToStringKeys<{
41
+ schema: "network.xyo.id";
42
+ salt: string;
43
+ }>>;
44
+
45
+ declare const idPayloadTemplate: () => Id;
46
+
47
+ export { type Id, type IdFields, type IdPayload, IdPayloadPlugin, IdSchema, asId, asOptionalId, IdPayloadPlugin as default, idPayloadTemplate, isId, isIdWithSources };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Payload.ts","../../src/Schema.ts","../../src/Plugin.ts","../../src/Template.ts"],"sourcesContent":["import { AsObjectFactory } from '@xylabs/object'\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 */\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 { IdPayload } from './Payload.ts'\nimport { IdSchema } from './Schema.ts'\nimport { idPayloadTemplate } from './Template.ts'\n\nexport const IdPayloadPlugin = () =>\n createPayloadPlugin<IdPayload>({\n schema: IdSchema,\n template: idPayloadTemplate,\n })\n","import type { IdPayload } from './Payload.ts'\nimport { IdSchema } from './Schema.ts'\n\nexport const idPayloadTemplate = (): IdPayload => ({\n salt: '',\n schema: IdSchema,\n})\n"],"mappings":";AAAA,SAAS,uBAAuB;AAKhC;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACRA,IAAM,WAAW;;;ADgCjB,IAAM,OAAO,sBAA0B,QAAQ;AAC/C,IAAM,OAAO,gBAAgB,OAAO,IAAI;AACxC,IAAM,eAAe,gBAAgB,eAAe,IAAI;AAKxD,IAAM,kBAAkB,iCAAkD,QAAQ;;;AEvCzF,SAAS,2BAA2B;;;ACG7B,IAAM,oBAAoB,OAAkB;AAAA,EACjD,MAAM;AAAA,EACN,QAAQ;AACV;;;ADAO,IAAM,kBAAkB,MAC7B,oBAA+B;AAAA,EAC7B,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/object'\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\n// eslint-disable-next-line sonarjs/redundant-type-aliases\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;;;ADkCjB,IAAM,OAAO,sBAA0B,QAAQ;AAC/C,IAAM,OAAO,gBAAgB,OAAO,IAAI;AACxC,IAAM,eAAe,gBAAgB,eAAe,IAAI;AAKxD,IAAM,kBAAkB,iCAAkD,QAAQ;;;AEzCzF,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": "3.8.0",
3
+ "version": "3.8.2",
4
4
  "description": "Typescript/Javascript Plugins for XYO Platform",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -30,15 +30,15 @@
30
30
  "types": "dist/neutral/index.d.ts",
31
31
  "dependencies": {
32
32
  "@xylabs/object": "^4.5.1",
33
- "@xyo-network/payload-model": "^3.8.0",
34
- "@xyo-network/payload-plugin": "^3.8.0"
33
+ "@xyo-network/payload-model": "^3.8.2",
34
+ "@xyo-network/payload-plugin": "^3.8.2"
35
35
  },
36
36
  "devDependencies": {
37
- "@xylabs/ts-scripts-yarn3": "^4.2.6",
38
- "@xylabs/tsconfig": "^4.2.6",
37
+ "@xylabs/ts-scripts-yarn3": "^5.0.22",
38
+ "@xylabs/tsconfig": "^5.0.22",
39
39
  "@xylabs/vitest-extended": "^4.5.1",
40
40
  "typescript": "^5.7.3",
41
- "vitest": "^3.0.4"
41
+ "vitest": "^3.0.5"
42
42
  },
43
43
  "publishConfig": {
44
44
  "access": "public"
package/src/Payload.ts CHANGED
@@ -25,6 +25,8 @@ export type Id = Payload<IdFields, IdSchema>
25
25
  /**
26
26
  * @deprecated Use `Id` instead
27
27
  */
28
+
29
+ // eslint-disable-next-line sonarjs/redundant-type-aliases
28
30
  export type IdPayload = Id
29
31
 
30
32
  /**
package/src/Plugin.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { createPayloadPlugin } from '@xyo-network/payload-plugin'
2
2
 
3
- import type { IdPayload } from './Payload.ts'
3
+ import type { Id } from './Payload.ts'
4
4
  import { IdSchema } from './Schema.ts'
5
5
  import { idPayloadTemplate } from './Template.ts'
6
6
 
7
7
  export const IdPayloadPlugin = () =>
8
- createPayloadPlugin<IdPayload>({
8
+ createPayloadPlugin<Id>({
9
9
  schema: IdSchema,
10
10
  template: idPayloadTemplate,
11
11
  })
package/src/Template.ts CHANGED
@@ -1,7 +1,7 @@
1
- import type { IdPayload } from './Payload.ts'
1
+ import type { Id } from './Payload.ts'
2
2
  import { IdSchema } from './Schema.ts'
3
3
 
4
- export const idPayloadTemplate = (): IdPayload => ({
4
+ export const idPayloadTemplate = (): Id => ({
5
5
  salt: '',
6
6
  schema: IdSchema,
7
7
  })
@@ -1,48 +0,0 @@
1
- import type { Payload, WithSources } from '@xyo-network/payload-model';
2
- import { IdSchema } from './Schema.ts';
3
- /**
4
- * The fields of an ID Payload
5
- */
6
- export type IdFields = {
7
- salt: string;
8
- };
9
- /**
10
- * The ID Payload
11
- */
12
- export type Id = Payload<IdFields, IdSchema>;
13
- /**
14
- * @deprecated Use `Id` instead
15
- */
16
- export type IdPayload = Id;
17
- /**
18
- * Identity helper for ID Payload
19
- */
20
- export declare const isId: (x?: unknown | null) => x is import("@xylabs/object").DeepRestrictToStringKeys<{
21
- schema: "network.xyo.id";
22
- salt: string;
23
- }>;
24
- export declare const asId: {
25
- <TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
26
- schema: "network.xyo.id";
27
- salt: string;
28
- }>>(value: import("@xylabs/promise").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
29
- <TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
30
- schema: "network.xyo.id";
31
- salt: string;
32
- }>>(value: import("@xylabs/promise").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<import("@xylabs/object").DeepRestrictToStringKeys<{
33
- schema: "network.xyo.id";
34
- salt: string;
35
- }>>, config?: import("@xylabs/object").TypeCheckConfig): TType;
36
- };
37
- export declare const asOptionalId: <TType extends import("@xylabs/object").DeepRestrictToStringKeys<{
38
- schema: "network.xyo.id";
39
- salt: string;
40
- }>>(value: import("@xylabs/promise").AnyNonPromise) => TType | undefined;
41
- /**
42
- * Identity helper for ID Payload with sources
43
- */
44
- export declare const isIdWithSources: (x?: unknown | null) => x is WithSources<WithSources<import("@xylabs/object").DeepRestrictToStringKeys<{
45
- schema: "network.xyo.id";
46
- salt: string;
47
- }>>>;
48
- //# sourceMappingURL=Payload.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../src/Payload.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,OAAO,EACP,WAAW,EACZ,MAAM,4BAA4B,CAAA;AAMnC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,EAAE,GAAG,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;AAE5C;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,EAAE,CAAA;AAE1B;;GAEG;AACH,eAAO,MAAM,IAAI;;UAhBT,MAAM;EAgByC,CAAA;AACvD,eAAO,MAAM,IAAI;;;cAjBT,MAAM;sBANI,iBAAiB,iCAGX,gBAEf;;;cACD,MAAM;sBAMK,iBAAiB;;cAN5B,MAAM;yBAcA,gBACd;CAEgD,CAAA;AAChD,eAAO,MAAM,YAAY;;UAlBjB,MAAM;kBAkBe,iBAAiB,qCAAkB,CAAA;AAEhE;;GAEG;AACH,eAAO,MAAM,eAAe;;UAvBpB,MAAM;IAuB4E,CAAA"}
@@ -1,5 +0,0 @@
1
- export declare const IdPayloadPlugin: () => import("@xyo-network/payload-plugin").PayloadPlugin<import("@xylabs/object").DeepRestrictToStringKeys<{
2
- schema: "network.xyo.id";
3
- salt: string;
4
- }>>;
5
- //# sourceMappingURL=Plugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,eAAe;;;GAIxB,CAAA"}
@@ -1,3 +0,0 @@
1
- export declare const IdSchema: "network.xyo.id";
2
- export type IdSchema = typeof IdSchema;
3
- //# sourceMappingURL=Schema.d.ts.map
@@ -1 +0,0 @@
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,3 +0,0 @@
1
- import type { IdPayload } from './Payload.ts';
2
- export declare const idPayloadTemplate: () => IdPayload;
3
- //# sourceMappingURL=Template.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Template.d.ts","sourceRoot":"","sources":["../../src/Template.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAG7C,eAAO,MAAM,iBAAiB,QAAO,SAGnC,CAAA"}
@@ -1 +0,0 @@
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"}