@xyo-network/diviner-transform-model 2.74.1
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/LICENSE +165 -0
- package/README.md +13 -0
- package/dist/Config/Config.d.mts +11 -0
- package/dist/Config/Config.d.mts.map +1 -0
- package/dist/Config/Config.d.ts +11 -0
- package/dist/Config/Config.d.ts.map +1 -0
- package/dist/Config/TransformSettings.d.mts +4 -0
- package/dist/Config/TransformSettings.d.mts.map +1 -0
- package/dist/Config/TransformSettings.d.ts +4 -0
- package/dist/Config/TransformSettings.d.ts.map +1 -0
- package/dist/Config/TransformerSettings.d.mts +4 -0
- package/dist/Config/TransformerSettings.d.mts.map +1 -0
- package/dist/Config/TransformerSettings.d.ts +4 -0
- package/dist/Config/TransformerSettings.d.ts.map +1 -0
- package/dist/Config/index.d.mts +4 -0
- package/dist/Config/index.d.mts.map +1 -0
- package/dist/Config/index.d.ts +4 -0
- package/dist/Config/index.d.ts.map +1 -0
- package/dist/Payload/Transform.d.mts +9 -0
- package/dist/Payload/Transform.d.mts.map +1 -0
- package/dist/Payload/Transform.d.ts +9 -0
- package/dist/Payload/Transform.d.ts.map +1 -0
- package/dist/Payload/index.d.mts +2 -0
- package/dist/Payload/index.d.mts.map +1 -0
- package/dist/Payload/index.d.ts +2 -0
- package/dist/Payload/index.d.ts.map +1 -0
- package/dist/PayloadValueTransformer.d.mts +5 -0
- package/dist/PayloadValueTransformer.d.mts.map +1 -0
- package/dist/PayloadValueTransformer.d.ts +5 -0
- package/dist/PayloadValueTransformer.d.ts.map +1 -0
- package/dist/Query.d.mts +12 -0
- package/dist/Query.d.mts.map +1 -0
- package/dist/Query.d.ts +12 -0
- package/dist/Query.d.ts.map +1 -0
- package/dist/Schema.d.mts +3 -0
- package/dist/Schema.d.mts.map +1 -0
- package/dist/Schema.d.ts +3 -0
- package/dist/Schema.d.ts.map +1 -0
- package/dist/docs.json +1271 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +46 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +16 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +63 -0
- package/src/Config/Config.ts +9 -0
- package/src/Config/TransformSettings.ts +3 -0
- package/src/Config/TransformerSettings.ts +3 -0
- package/src/Config/index.ts +3 -0
- package/src/Payload/Transform.ts +15 -0
- package/src/Payload/index.ts +1 -0
- package/src/PayloadValueTransformer.ts +6 -0
- package/src/Query.ts +10 -0
- package/src/Schema.ts +2 -0
- package/src/index.ts +5 -0
- package/typedoc.json +5 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,2BAA2B,CAAA;AACzC,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,2BAA2B,CAAA;AACzC,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
TransformDivinerConfigSchema: () => TransformDivinerConfigSchema,
|
|
24
|
+
TransformDivinerQuerySchema: () => TransformDivinerQuerySchema,
|
|
25
|
+
TransformDivinerSchema: () => TransformDivinerSchema,
|
|
26
|
+
isTransformDivinerQueryPayload: () => isTransformDivinerQueryPayload
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(src_exports);
|
|
29
|
+
|
|
30
|
+
// src/Schema.ts
|
|
31
|
+
var TransformDivinerSchema = "network.xyo.diviner.transform";
|
|
32
|
+
|
|
33
|
+
// src/Config/Config.ts
|
|
34
|
+
var TransformDivinerConfigSchema = `${TransformDivinerSchema}.config`;
|
|
35
|
+
|
|
36
|
+
// src/Query.ts
|
|
37
|
+
var TransformDivinerQuerySchema = `${TransformDivinerSchema}.query`;
|
|
38
|
+
var isTransformDivinerQueryPayload = (x) => x?.schema === TransformDivinerQuerySchema;
|
|
39
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
+
0 && (module.exports = {
|
|
41
|
+
TransformDivinerConfigSchema,
|
|
42
|
+
TransformDivinerQuerySchema,
|
|
43
|
+
TransformDivinerSchema,
|
|
44
|
+
isTransformDivinerQueryPayload
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/Schema.ts","../src/Config/Config.ts","../src/Query.ts"],"sourcesContent":["export * from './Config'\nexport * from './Payload'\nexport * from './PayloadValueTransformer'\nexport * from './Query'\nexport * from './Schema'\n","export type TransformDivinerSchema = 'network.xyo.diviner.transform'\nexport const TransformDivinerSchema: TransformDivinerSchema = 'network.xyo.diviner.transform'\n","import { DivinerConfig } from '@xyo-network/diviner-model'\n\nimport { TransformDictionary } from '../Payload'\nimport { TransformDivinerSchema } from '../Schema'\n\nexport type TransformDivinerConfigSchema = `${TransformDivinerSchema}.config`\nexport const TransformDivinerConfigSchema: TransformDivinerConfigSchema = `${TransformDivinerSchema}.config`\n\nexport type TransformDivinerConfig = DivinerConfig<{ transform?: TransformDictionary } & { schema: TransformDivinerConfigSchema }>\n","import { Payload, Query } from '@xyo-network/payload-model'\n\nimport { TransformSettings } from './Config'\nimport { TransformDivinerSchema } from './Schema'\n\nexport type TransformDivinerQuerySchema = `${TransformDivinerSchema}.query`\nexport const TransformDivinerQuerySchema: TransformDivinerQuerySchema = `${TransformDivinerSchema}.query`\n\nexport type TransformDivinerQueryPayload = Query<{ schema: TransformDivinerQuerySchema } & Partial<TransformSettings>>\nexport const isTransformDivinerQueryPayload = (x?: Payload | null): x is TransformDivinerQueryPayload => x?.schema === TransformDivinerQuerySchema\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCO,IAAM,yBAAiD;;;ACKvD,IAAM,+BAA6D,GAAG,sBAAsB;;;ACA5F,IAAM,8BAA2D,GAAG,sBAAsB;AAG1F,IAAM,iCAAiC,CAAC,MAA0D,GAAG,WAAW;","names":[]}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// src/Schema.ts
|
|
2
|
+
var TransformDivinerSchema = "network.xyo.diviner.transform";
|
|
3
|
+
|
|
4
|
+
// src/Config/Config.ts
|
|
5
|
+
var TransformDivinerConfigSchema = `${TransformDivinerSchema}.config`;
|
|
6
|
+
|
|
7
|
+
// src/Query.ts
|
|
8
|
+
var TransformDivinerQuerySchema = `${TransformDivinerSchema}.query`;
|
|
9
|
+
var isTransformDivinerQueryPayload = (x) => x?.schema === TransformDivinerQuerySchema;
|
|
10
|
+
export {
|
|
11
|
+
TransformDivinerConfigSchema,
|
|
12
|
+
TransformDivinerQuerySchema,
|
|
13
|
+
TransformDivinerSchema,
|
|
14
|
+
isTransformDivinerQueryPayload
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Schema.ts","../src/Config/Config.ts","../src/Query.ts"],"sourcesContent":["export type TransformDivinerSchema = 'network.xyo.diviner.transform'\nexport const TransformDivinerSchema: TransformDivinerSchema = 'network.xyo.diviner.transform'\n","import { DivinerConfig } from '@xyo-network/diviner-model'\n\nimport { TransformDictionary } from '../Payload'\nimport { TransformDivinerSchema } from '../Schema'\n\nexport type TransformDivinerConfigSchema = `${TransformDivinerSchema}.config`\nexport const TransformDivinerConfigSchema: TransformDivinerConfigSchema = `${TransformDivinerSchema}.config`\n\nexport type TransformDivinerConfig = DivinerConfig<{ transform?: TransformDictionary } & { schema: TransformDivinerConfigSchema }>\n","import { Payload, Query } from '@xyo-network/payload-model'\n\nimport { TransformSettings } from './Config'\nimport { TransformDivinerSchema } from './Schema'\n\nexport type TransformDivinerQuerySchema = `${TransformDivinerSchema}.query`\nexport const TransformDivinerQuerySchema: TransformDivinerQuerySchema = `${TransformDivinerSchema}.query`\n\nexport type TransformDivinerQueryPayload = Query<{ schema: TransformDivinerQuerySchema } & Partial<TransformSettings>>\nexport const isTransformDivinerQueryPayload = (x?: Payload | null): x is TransformDivinerQueryPayload => x?.schema === TransformDivinerQuerySchema\n"],"mappings":";AACO,IAAM,yBAAiD;;;ACKvD,IAAM,+BAA6D,GAAG,sBAAsB;;;ACA5F,IAAM,8BAA2D,GAAG,sBAAsB;AAG1F,IAAM,iCAAiC,CAAC,MAA0D,GAAG,WAAW;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xyo-network/diviner-transform-model",
|
|
3
|
+
"author": {
|
|
4
|
+
"email": "support@xyo.network",
|
|
5
|
+
"name": "XYO Development Team",
|
|
6
|
+
"url": "https://xyo.network"
|
|
7
|
+
},
|
|
8
|
+
"bugs": {
|
|
9
|
+
"email": "support@xyo.network",
|
|
10
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@xyo-network/diviner-model": "~2.74.2",
|
|
14
|
+
"@xyo-network/payload-model": "~2.74.2",
|
|
15
|
+
"@xyo-network/value-payload-plugin": "~2.74.2"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@xylabs/ts-scripts-yarn3": "^3.0.28",
|
|
19
|
+
"@xylabs/tsconfig": "^3.0.28",
|
|
20
|
+
"typescript": "^5.2.2"
|
|
21
|
+
},
|
|
22
|
+
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
23
|
+
"docs": "dist/docs.json",
|
|
24
|
+
"types": "dist/index.d.ts",
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"require": {
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"default": "./dist/index.js"
|
|
30
|
+
},
|
|
31
|
+
"import": {
|
|
32
|
+
"types": "./dist/index.d.mts",
|
|
33
|
+
"default": "./dist/index.mjs"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"./dist/docs.json": {
|
|
37
|
+
"default": "./dist/docs.json"
|
|
38
|
+
},
|
|
39
|
+
"./cjs": {
|
|
40
|
+
"default": "./dist/index.js"
|
|
41
|
+
},
|
|
42
|
+
"./docs": {
|
|
43
|
+
"default": "./dist/docs.json"
|
|
44
|
+
},
|
|
45
|
+
"./esm": {
|
|
46
|
+
"default": "./dist/index.mjs"
|
|
47
|
+
},
|
|
48
|
+
"./package.json": "./package.json"
|
|
49
|
+
},
|
|
50
|
+
"main": "dist/index.js",
|
|
51
|
+
"module": "dist/index.mjs",
|
|
52
|
+
"homepage": "https://xyo.network",
|
|
53
|
+
"license": "LGPL-3.0",
|
|
54
|
+
"publishConfig": {
|
|
55
|
+
"access": "public"
|
|
56
|
+
},
|
|
57
|
+
"repository": {
|
|
58
|
+
"type": "git",
|
|
59
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
60
|
+
},
|
|
61
|
+
"sideEffects": false,
|
|
62
|
+
"version": "2.74.1"
|
|
63
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DivinerConfig } from '@xyo-network/diviner-model'
|
|
2
|
+
|
|
3
|
+
import { TransformDictionary } from '../Payload'
|
|
4
|
+
import { TransformDivinerSchema } from '../Schema'
|
|
5
|
+
|
|
6
|
+
export type TransformDivinerConfigSchema = `${TransformDivinerSchema}.config`
|
|
7
|
+
export const TransformDivinerConfigSchema: TransformDivinerConfigSchema = `${TransformDivinerSchema}.config`
|
|
8
|
+
|
|
9
|
+
export type TransformDivinerConfig = DivinerConfig<{ transform?: TransformDictionary } & { schema: TransformDivinerConfigSchema }>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Payload } from '@xyo-network/payload-model'
|
|
2
|
+
|
|
3
|
+
import { TransformDivinerSchema } from '../Schema'
|
|
4
|
+
|
|
5
|
+
export type TransformDictionary = { [key: string]: string }
|
|
6
|
+
|
|
7
|
+
export type Transform = Payload<
|
|
8
|
+
{
|
|
9
|
+
// TODO: Allow dest schema?
|
|
10
|
+
// destinationSchema: string
|
|
11
|
+
// TODO: Make Plural?
|
|
12
|
+
transform: TransformDictionary
|
|
13
|
+
},
|
|
14
|
+
TransformDivinerSchema
|
|
15
|
+
>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Transform'
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Payload } from '@xyo-network/payload-model'
|
|
2
|
+
import { JsonValue } from '@xyo-network/value-payload-plugin'
|
|
3
|
+
|
|
4
|
+
export type PayloadValueTransformer<TSource extends Payload = Payload> = (payload: TSource) => JsonValue
|
|
5
|
+
|
|
6
|
+
export type PayloadTransformer<TSource extends Payload = Payload, TDestination extends Payload = Payload> = (payload: TSource) => TDestination
|
package/src/Query.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Payload, Query } from '@xyo-network/payload-model'
|
|
2
|
+
|
|
3
|
+
import { TransformSettings } from './Config'
|
|
4
|
+
import { TransformDivinerSchema } from './Schema'
|
|
5
|
+
|
|
6
|
+
export type TransformDivinerQuerySchema = `${TransformDivinerSchema}.query`
|
|
7
|
+
export const TransformDivinerQuerySchema: TransformDivinerQuerySchema = `${TransformDivinerSchema}.query`
|
|
8
|
+
|
|
9
|
+
export type TransformDivinerQueryPayload = Query<{ schema: TransformDivinerQuerySchema } & Partial<TransformSettings>>
|
|
10
|
+
export const isTransformDivinerQueryPayload = (x?: Payload | null): x is TransformDivinerQueryPayload => x?.schema === TransformDivinerQuerySchema
|
package/src/Schema.ts
ADDED
package/src/index.ts
ADDED