@xyo-network/payload-plugin 4.1.2 → 4.1.4

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,41 +1,4 @@
1
- import { Payload } from '@xyo-network/payload-model';
2
- import { Validator } from '@xylabs/object';
3
- import { PayloadBuilder } from '@xyo-network/payload-builder';
4
- import { PayloadWrapper } from '@xyo-network/payload-wrapper';
5
- import { SomeJSONSchema } from 'ajv/dist/types/json-schema.js';
6
-
7
- type PayloadPluginFunc<TPayload extends Payload = Payload> = () => PayloadPlugin<TPayload>;
8
- type PayloadPlugin<TPayload extends Payload = Payload> = {
9
- build?: () => PayloadBuilder<TPayload>;
10
- jsonSchema?: SomeJSONSchema;
11
- schema: TPayload['schema'];
12
- template?: () => Partial<TPayload>;
13
- validate?: (payload: Payload) => Validator<Payload>;
14
- wrap?: (payload: Payload) => PayloadWrapper;
15
- };
16
-
17
- declare const defaultPayloadPluginFunctions: <T extends Payload>(schema: string) => PayloadPlugin<T>;
18
- declare const createPayloadPlugin: <TPayload extends Payload = Payload>(plugin: PayloadPlugin<TPayload>) => PayloadPlugin<TPayload>;
19
-
20
- declare class PayloadPluginResolver {
21
- schema: "network.xyo.payload";
22
- protected _plugins: Record<string, PayloadPlugin>;
23
- protected defaultPlugin: PayloadPlugin;
24
- constructor(
25
- /** @param plugins The initial set of plugins */
26
- plugins?: PayloadPlugin<Payload>[],
27
- /** @param defaultPlugin Specifies the plugin to be used if no plugins resolve */
28
- defaultPlugin?: PayloadPlugin<Payload>);
29
- /** @description Create list of plugins, optionally filtered by ability to witness/divine */
30
- plugins(): PayloadPlugin[];
31
- register<TPlugin extends PayloadPlugin = PayloadPlugin>(plugin: TPlugin): this;
32
- resolve(schema?: string): PayloadPlugin;
33
- resolve(payload: Payload): PayloadPlugin;
34
- /** @description Create list of schema, optionally filtered by ability to witness/divine */
35
- schemas(): string[];
36
- validate(payload: Payload): Validator<Payload> | undefined;
37
- wrap(payload: Payload): PayloadWrapper<Payload> | undefined;
38
- }
39
-
40
- export { PayloadPluginResolver, createPayloadPlugin, defaultPayloadPluginFunctions };
41
- export type { PayloadPlugin, PayloadPluginFunc };
1
+ export * from './createPlugin.ts';
2
+ export * from './Plugin.ts';
3
+ export * from './Resolver.ts';
4
+ //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/payload-plugin",
3
- "version": "4.1.2",
3
+ "version": "4.1.4",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -29,17 +29,17 @@
29
29
  "module": "dist/neutral/index.mjs",
30
30
  "types": "dist/neutral/index.d.ts",
31
31
  "dependencies": {
32
- "@xylabs/assert": "^4.13.15",
33
- "@xylabs/object": "^4.13.15",
34
- "@xyo-network/payload-builder": "^4.1.2",
35
- "@xyo-network/payload-model": "^4.1.2",
36
- "@xyo-network/payload-validator": "^4.1.2",
37
- "@xyo-network/payload-wrapper": "^4.1.2",
32
+ "@xylabs/assert": "^4.13.16",
33
+ "@xylabs/object": "^4.13.16",
34
+ "@xyo-network/payload-builder": "^4.1.4",
35
+ "@xyo-network/payload-model": "^4.1.4",
36
+ "@xyo-network/payload-validator": "^4.1.4",
37
+ "@xyo-network/payload-wrapper": "^4.1.4",
38
38
  "ajv": "^8.17.1"
39
39
  },
40
40
  "devDependencies": {
41
- "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.23",
42
- "@xylabs/tsconfig": "^7.0.0-rc.23",
41
+ "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.27",
42
+ "@xylabs/tsconfig": "^7.0.0-rc.27",
43
43
  "typescript": "^5.8.3"
44
44
  },
45
45
  "publishConfig": {