juisy 3.0.0-beta.3 β 3.0.0-beta.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.
- package/LICENSE +661 -661
- package/README.md +25 -12
- package/bin/cli/cli.js +28 -28
- package/bin/cli/cmds/index.js +11 -11
- package/bin/cli/cmds/public/print-globals.js +27 -27
- package/bin/cli/index.js +9 -9
- package/bin/scripts/prepare.js +22 -22
- package/dist/DataExporter.d.ts +133 -34
- package/dist/ReadmeTemplater-DobSI9Um.js +373 -0
- package/dist/bootstrap.d.ts +11 -3
- package/dist/bootstrap.js +15 -11
- package/dist/cli/Command.d.ts +4 -4
- package/dist/cli/OutputUtils.d.ts +1 -1
- package/dist/cli/cache-dir.d.ts +15 -0
- package/dist/cli/index.js +341 -148
- package/dist/cli/plugins/register-changelog-command/augment.d.ts +52 -34
- package/dist/cli/plugins/register-changelog-command/resolve-changelog-options.d.ts +19 -0
- package/dist/cli/plugins/register-release-command/build-temp-config.d.ts +13 -0
- package/dist/cli/plugins/register-release-command/release-args.d.ts +7 -0
- package/dist/cli/plugins/register-release-command/resolve-release-config.d.ts +40 -0
- package/dist/cli/serialize-cjs-module.d.ts +15 -0
- package/dist/cli/types.d.ts +1 -1
- package/dist/extensions.d.ts +33 -9
- package/dist/extensions.js +87 -20
- package/dist/get-package-info-CGDJsCsN.js +15 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +109 -23
- package/dist/project-globals.d.ts +8 -2
- package/dist/templater/Templater.d.ts +1 -1
- package/dist/templater/index.d.ts +2 -2
- package/dist/templater/index.js +2 -335
- package/dist/templater/markdown-templater/ReadmeTemplater.d.ts +31 -2
- package/dist/templater/markdown-templater/index.d.ts +12 -1
- package/package.json +24 -29
- package/skills/juisy/SKILL.md +97 -0
- package/skills/juisy/references/recipes.md +85 -0
package/README.md
CHANGED
|
@@ -4,14 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
<!-- markdownlint-disable line-length -->
|
|
6
6
|
|
|
7
|
-

|
|
7
|
+

|
|
8
8
|
[](http://herve-perchec.com/)
|
|
9
9
|
|
|
10
|
-
[](https://gitlab.com/hperchec/juisy/-/releases)
|
|
11
|
-
[](https://gitlab.com/hperchec/juisy/-/releases)
|
|
11
|
+
[](https://gitlab.com/hperchec/juisy/commits/v3.0.0-beta.4)
|
|
12
|
+
[](https://publint.dev/juisy)
|
|
13
|
+
[](https://arethetypeswrong.github.io/?p=juisy)
|
|
14
|
+
[](https://www.npmjs.com/package/juisy)
|
|
15
|
+
[](https://www.npmjs.com/package/juisy)
|
|
16
|
+
[](https://gitlab.com/hperchec/juisy/issues)
|
|
15
17
|

|
|
16
18
|
|
|
17
19
|
<!-- markdownlint-enable line-length -->
|
|
@@ -43,8 +45,8 @@ It runs on [NodeJS](https://nodejs.org/en) ([ESM](https://nodejs.org/api/esm.htm
|
|
|
43
45
|
|
|
44
46
|
## β Requirements
|
|
45
47
|
|
|
46
|
-
* Node `>=
|
|
47
|
-
* npm
|
|
48
|
+
* Node `>=20`
|
|
49
|
+
* pnpm (`packageManager` in the monorepo; consumers may use npm/pnpm/yarn as documented)
|
|
48
50
|
|
|
49
51
|
## π Get started
|
|
50
52
|
|
|
@@ -56,11 +58,22 @@ npm create juisy
|
|
|
56
58
|
|
|
57
59
|
## π Documentation
|
|
58
60
|
|
|
59
|
-
See [online documentation](https://gitlab.
|
|
61
|
+
See [online documentation](https://hperchec.gitlab.io/juisy/) to learn more!
|
|
62
|
+
|
|
63
|
+
For coding agents: npm **skills** under each published package, plus
|
|
64
|
+
[llms.txt](https://hperchec.gitlab.io/juisy/llms.txt) /
|
|
65
|
+
[llms-full.txt](https://hperchec.gitlab.io/juisy/llms-full.txt) on the guide
|
|
66
|
+
([For AI tools](https://hperchec.gitlab.io/juisy/guide/for-ai.html)).
|
|
60
67
|
|
|
61
68
|
## π€ Contribute
|
|
62
69
|
|
|
63
|
-
|
|
70
|
+
You would like to contribute to this project? You are welcome!
|
|
71
|
+
|
|
72
|
+
First, please check:
|
|
73
|
+
|
|
74
|
+
* the [contribution guide](./CONTRIBUTING.md)
|
|
75
|
+
* the [code of conduct](./CODE_OF_CONDUCT.md)
|
|
76
|
+
* the [security policy](./SECURITY.md) (for vulnerability reports)
|
|
64
77
|
|
|
65
78
|
## β Author
|
|
66
79
|
|
|
@@ -78,8 +91,8 @@ See all changes to this project in the [CHANGELOG.md](./CHANGELOG.md) file.
|
|
|
78
91
|
|
|
79
92
|
Made with β€ by [HervΓ© Perchec](https://gitlab.com/herveperchec)
|
|
80
93
|
|
|
81
|
-
|
|
94
|
+
<!-- markdownlint-disable line-length -->
|
|
82
95
|
|
|
83
|
-
|
|
96
|
+
***
|
|
84
97
|
|
|
85
98
|
*README.md - this file was auto generated with [juisy](https://www.npmjs.com/package/juisy) README templater. Don't edit it.*
|
package/bin/cli/cli.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { CLIFactory } from '
|
|
2
|
-
import bootstrap from '../../dist/bootstrap.js'
|
|
3
|
-
|
|
4
|
-
import { commands } from './cmds/index.js'
|
|
5
|
-
|
|
6
|
-
await bootstrap()
|
|
7
|
-
|
|
8
|
-
const { $style } = CLI.OutputUtils
|
|
9
|
-
|
|
10
|
-
function getBanner () {
|
|
11
|
-
let str = ''
|
|
12
|
-
const title = 'juisy'
|
|
13
|
-
const length = title.length
|
|
14
|
-
str += $style.cyan('-'.repeat(length) + '\n')
|
|
15
|
-
str += $style.cyan(title + '\n')
|
|
16
|
-
str += $style.cyan('-'.repeat(length) + '\n')
|
|
17
|
-
str += $style.italic('Made with') + ' ' + $style.red('β€') + ' ' + $style.italic('by ') + $style.bold('HervΓ© Perchec <contact@herve-perchec.com>') + '\n'
|
|
18
|
-
return str
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export default await CLIFactory(cli => cli
|
|
22
|
-
.scriptName('juisy')
|
|
23
|
-
.usage(`${getBanner()}\nUsage: $0 <command> [<options>]`)
|
|
24
|
-
.disableDefaultCommand('docs generate:api')
|
|
25
|
-
.globalCommandVisitorOptions('private-command-visitor', { envKey: '__JUISY_CLI_ENV__' })
|
|
26
|
-
.command(commands)
|
|
27
|
-
// .demandCommand(1, ('Command is missing. See help to learn more.').red)
|
|
28
|
-
)
|
|
1
|
+
import { CLIFactory } from 'juisy/cli'
|
|
2
|
+
import bootstrap from '../../dist/bootstrap.js'
|
|
3
|
+
|
|
4
|
+
import { commands } from './cmds/index.js'
|
|
5
|
+
|
|
6
|
+
await bootstrap()
|
|
7
|
+
|
|
8
|
+
const { $style } = CLI.OutputUtils
|
|
9
|
+
|
|
10
|
+
function getBanner () {
|
|
11
|
+
let str = ''
|
|
12
|
+
const title = 'juisy'
|
|
13
|
+
const length = title.length
|
|
14
|
+
str += $style.cyan('-'.repeat(length) + '\n')
|
|
15
|
+
str += $style.cyan(title + '\n')
|
|
16
|
+
str += $style.cyan('-'.repeat(length) + '\n')
|
|
17
|
+
str += $style.italic('Made with') + ' ' + $style.red('β€') + ' ' + $style.italic('by ') + $style.bold('HervΓ© Perchec <contact@herve-perchec.com>') + '\n'
|
|
18
|
+
return str
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default await CLIFactory(cli => cli
|
|
22
|
+
.scriptName('juisy')
|
|
23
|
+
.usage(`${getBanner()}\nUsage: $0 <command> [<options>]`)
|
|
24
|
+
.disableDefaultCommand('docs generate:api')
|
|
25
|
+
.globalCommandVisitorOptions('private-command-visitor', { envKey: '__JUISY_CLI_ENV__' })
|
|
26
|
+
.command(commands)
|
|
27
|
+
// .demandCommand(1, ('Command is missing. See help to learn more.').red)
|
|
28
|
+
)
|
package/bin/cli/cmds/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// Private commands
|
|
2
|
-
// ...
|
|
3
|
-
// Public commands
|
|
4
|
-
import printGlobals from './public/print-globals.js'
|
|
5
|
-
|
|
6
|
-
export const commands = [
|
|
7
|
-
// Private
|
|
8
|
-
// ...
|
|
9
|
-
// Public
|
|
10
|
-
printGlobals
|
|
11
|
-
]
|
|
1
|
+
// Private commands
|
|
2
|
+
// ...
|
|
3
|
+
// Public commands
|
|
4
|
+
import printGlobals from './public/print-globals.js'
|
|
5
|
+
|
|
6
|
+
export const commands = [
|
|
7
|
+
// Private
|
|
8
|
+
// ...
|
|
9
|
+
// Public
|
|
10
|
+
printGlobals
|
|
11
|
+
]
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { getProjectGlobals, DataExporter } from '
|
|
2
|
-
|
|
3
|
-
/** @type {import('
|
|
4
|
-
export default new CLI.Command({
|
|
5
|
-
command: 'print:globals',
|
|
6
|
-
describe: 'Print the computed project globals as JSON',
|
|
7
|
-
builder (cli) {
|
|
8
|
-
cli.option('f', {
|
|
9
|
-
alias: 'format',
|
|
10
|
-
describe: 'The export format',
|
|
11
|
-
default: 'json',
|
|
12
|
-
choices: [ 'json', 'yaml' ]
|
|
13
|
-
})
|
|
14
|
-
cli.option('t', {
|
|
15
|
-
alias: 'target',
|
|
16
|
-
type: 'string',
|
|
17
|
-
describe: 'The target file exporting project globals (fallback to ./project.globals.js)'
|
|
18
|
-
})
|
|
19
|
-
return cli
|
|
20
|
-
},
|
|
21
|
-
async handler (args) {
|
|
22
|
-
// Use getProjectGlobals API
|
|
23
|
-
const projectGlobals = await getProjectGlobals(args.target)
|
|
24
|
-
// Just console.log the globals as JSON
|
|
25
|
-
this.log(new DataExporter(args.format).exportSync(projectGlobals, { space: 2 }))
|
|
26
|
-
}
|
|
27
|
-
})
|
|
1
|
+
import { getProjectGlobals, DataExporter } from 'juisy'
|
|
2
|
+
|
|
3
|
+
/** @type {import('juisy/cli').Command} */
|
|
4
|
+
export default new CLI.Command({
|
|
5
|
+
command: 'print:globals',
|
|
6
|
+
describe: 'Print the computed project globals as JSON',
|
|
7
|
+
builder (cli) {
|
|
8
|
+
cli.option('f', {
|
|
9
|
+
alias: 'format',
|
|
10
|
+
describe: 'The export format',
|
|
11
|
+
default: 'json',
|
|
12
|
+
choices: [ 'json', 'yaml' ]
|
|
13
|
+
})
|
|
14
|
+
cli.option('t', {
|
|
15
|
+
alias: 'target',
|
|
16
|
+
type: 'string',
|
|
17
|
+
describe: 'The target file exporting project globals (fallback to ./project.globals.js)'
|
|
18
|
+
})
|
|
19
|
+
return cli
|
|
20
|
+
},
|
|
21
|
+
async handler (args) {
|
|
22
|
+
// Use getProjectGlobals API
|
|
23
|
+
const projectGlobals = await getProjectGlobals(args.target)
|
|
24
|
+
// Just console.log the globals as JSON
|
|
25
|
+
this.log(new DataExporter(args.format).exportSync(projectGlobals, { space: 2 }))
|
|
26
|
+
}
|
|
27
|
+
})
|
package/bin/cli/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
'use strict'
|
|
4
|
-
|
|
5
|
-
import cli from './cli.js'
|
|
6
|
-
|
|
7
|
-
const argv = CLI.helpers.hideBin(process.argv)
|
|
8
|
-
|
|
9
|
-
cli().parse(argv)
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
'use strict'
|
|
4
|
+
|
|
5
|
+
import cli from './cli.js'
|
|
6
|
+
|
|
7
|
+
const argv = CLI.helpers.hideBin(process.argv)
|
|
8
|
+
|
|
9
|
+
cli().parse(argv)
|
package/bin/scripts/prepare.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import run from 'execa'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Prepare script
|
|
5
|
-
*/
|
|
6
|
-
;(async function () {
|
|
7
|
-
console.log('Prepare packages/juisy')
|
|
8
|
-
|
|
9
|
-
// Copy env file
|
|
10
|
-
try {
|
|
11
|
-
await run('npx', [ 'cpy', '.env.example', '.', '--rename', '.env', '--no-overwrite' ], { stdio: 'inherit' })
|
|
12
|
-
} catch (e) { // eslint-disable-line no-unused-vars
|
|
13
|
-
console.error('β env file already exists. Ignoring step...')
|
|
14
|
-
console.log() // blank line
|
|
15
|
-
}
|
|
16
|
-
// Build juisy because we depend on CLI tools
|
|
17
|
-
await run('pnpm', [ 'build' ], { stdio: 'inherit' })
|
|
18
|
-
|
|
19
|
-
// Everything is okay
|
|
20
|
-
console.log('β Prepare script passed')
|
|
21
|
-
console.log() // blank line
|
|
22
|
-
})()
|
|
1
|
+
import run from 'execa'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Prepare script
|
|
5
|
+
*/
|
|
6
|
+
;(async function () {
|
|
7
|
+
console.log('Prepare packages/juisy')
|
|
8
|
+
|
|
9
|
+
// Copy env file
|
|
10
|
+
try {
|
|
11
|
+
await run('npx', [ 'cpy', '.env.example', '.', '--rename', '.env', '--no-overwrite' ], { stdio: 'inherit' })
|
|
12
|
+
} catch (e) { // eslint-disable-line no-unused-vars
|
|
13
|
+
console.error('β env file already exists. Ignoring step...')
|
|
14
|
+
console.log() // blank line
|
|
15
|
+
}
|
|
16
|
+
// Build juisy because we depend on CLI tools
|
|
17
|
+
await run('pnpm', [ 'build' ], { stdio: 'inherit' })
|
|
18
|
+
|
|
19
|
+
// Everything is okay
|
|
20
|
+
console.log('β Prepare script passed')
|
|
21
|
+
console.log() // blank line
|
|
22
|
+
})()
|
package/dist/DataExporter.d.ts
CHANGED
|
@@ -1,60 +1,140 @@
|
|
|
1
1
|
import { default as yaml } from 'yaml';
|
|
2
2
|
import { Json2CsvOptions } from 'json-2-csv';
|
|
3
|
-
import { Options as
|
|
4
|
-
|
|
3
|
+
import { Options as XmlOptions } from 'jstoxml';
|
|
4
|
+
import { SerializeOptions as BsonSerializeOptions } from 'bson';
|
|
5
|
+
import { EncoderOptions as MsgpackEncodeOptions } from '@msgpack/msgpack';
|
|
6
|
+
import { Type as ProtobufType } from 'protobufjs';
|
|
7
|
+
import { default as avro, Type as AvroType } from 'avsc';
|
|
8
|
+
type AvroSchema = Parameters<typeof avro.Type.forSchema>[0];
|
|
9
|
+
declare const SUPPORTED_FORMATS: readonly ["json", "jsonl", "yaml", "toml", "csv", "tsv", "xml", "bson", "msgpack", "cbor", "protobuf", "avro"];
|
|
5
10
|
/**
|
|
6
11
|
* @group Types
|
|
7
12
|
*/
|
|
8
13
|
export type DataExporterFormat = typeof SUPPORTED_FORMATS[number];
|
|
9
14
|
/**
|
|
15
|
+
* How binary exporters return their payload.
|
|
10
16
|
* @group Types
|
|
11
17
|
*/
|
|
12
|
-
export type
|
|
18
|
+
export type BinaryOutputEncoding = 'uint8array' | 'base64' | 'hex';
|
|
19
|
+
/**
|
|
20
|
+
* Shared options for binary formats.
|
|
21
|
+
* @group Types
|
|
22
|
+
*/
|
|
23
|
+
export type BinaryExportOptions = {
|
|
24
|
+
/**
|
|
25
|
+
* Output encoding. Defaults to `'uint8array'`.
|
|
26
|
+
*/
|
|
27
|
+
output?: BinaryOutputEncoding;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* CSV / TSV options (`json-2-csv` + juisy helpers).
|
|
31
|
+
* @group Types
|
|
32
|
+
*/
|
|
33
|
+
export type CsvExportOptions = Json2CsvOptions & {
|
|
34
|
+
/**
|
|
35
|
+
* When true, use a tab field delimiter (TSV). Ignored for format `'tsv'`
|
|
36
|
+
* (always tab-separated).
|
|
37
|
+
*/
|
|
38
|
+
tsv?: boolean;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* @group Types
|
|
42
|
+
*/
|
|
43
|
+
export type ProtobufExportOptions = BinaryExportOptions & {
|
|
44
|
+
/**
|
|
45
|
+
* A `protobufjs` message type (e.g. `root.lookupType('MyMessage')`).
|
|
46
|
+
*/
|
|
47
|
+
type: ProtobufType;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* @group Types
|
|
51
|
+
*/
|
|
52
|
+
export type AvroExportOptions = BinaryExportOptions & ({
|
|
53
|
+
/**
|
|
54
|
+
* Pre-built `avsc` type.
|
|
55
|
+
*/
|
|
56
|
+
type: AvroType;
|
|
57
|
+
schema?: never;
|
|
58
|
+
} | {
|
|
59
|
+
/**
|
|
60
|
+
* Avro schema (JSON object or JSON string). Used when `type` is omitted.
|
|
61
|
+
*/
|
|
62
|
+
schema: AvroSchema | string;
|
|
63
|
+
type?: never;
|
|
64
|
+
});
|
|
65
|
+
/**
|
|
66
|
+
* @group Types
|
|
67
|
+
*/
|
|
68
|
+
export type ExportOptions<F extends DataExporterFormat> = F extends 'json' ? Parameters<typeof jsonExporter>[1] : F extends 'jsonl' ? Parameters<typeof jsonlExporter>[1] : F extends 'yaml' ? Parameters<typeof yamlExporter>[1] : F extends 'toml' ? Parameters<typeof tomlExporter>[1] : F extends 'csv' | 'tsv' ? Parameters<typeof csvExporter>[1] : F extends 'xml' ? Parameters<typeof xmlExporter>[1] : F extends 'bson' ? Parameters<typeof bsonExporter>[1] : F extends 'msgpack' ? Parameters<typeof msgpackExporter>[1] : F extends 'cbor' ? Parameters<typeof cborExporter>[1] : F extends 'protobuf' ? Parameters<typeof protobufExporter>[1] : F extends 'avro' ? Parameters<typeof avroExporter>[1] : never;
|
|
69
|
+
/**
|
|
70
|
+
* @group Types
|
|
71
|
+
*/
|
|
72
|
+
export type ExportResult<F extends DataExporterFormat> = F extends 'json' | 'jsonl' | 'yaml' | 'toml' | 'csv' | 'tsv' | 'xml' ? string : F extends 'bson' | 'msgpack' | 'cbor' | 'protobuf' | 'avro' ? string | Uint8Array : never;
|
|
13
73
|
/**
|
|
14
74
|
* JSON exporter
|
|
15
|
-
* @param data - The data object
|
|
16
|
-
* @param options - Specific JSON exporter options
|
|
17
|
-
* @returns The data as JSON string
|
|
18
75
|
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
|
|
19
76
|
*/
|
|
20
|
-
declare const jsonExporter: (data:
|
|
21
|
-
|
|
77
|
+
declare const jsonExporter: (data: unknown, options?: {
|
|
78
|
+
replacer?: Parameters<typeof JSON.stringify>[1];
|
|
79
|
+
space?: Parameters<typeof JSON.stringify>[2];
|
|
80
|
+
}) => string;
|
|
81
|
+
/**
|
|
82
|
+
* JSON Lines / NDJSON exporter (one JSON value per line).
|
|
83
|
+
* Arrays emit one line per element; a non-array value emits a single line.
|
|
84
|
+
* @see https://jsonlines.org/
|
|
85
|
+
*/
|
|
86
|
+
declare const jsonlExporter: (data: unknown, options?: {
|
|
22
87
|
replacer?: Parameters<typeof JSON.stringify>[1];
|
|
23
88
|
space?: Parameters<typeof JSON.stringify>[2];
|
|
24
89
|
}) => string;
|
|
25
90
|
/**
|
|
26
91
|
* YAML exporter
|
|
27
|
-
* @param data - The data object
|
|
28
|
-
* @param options - Specific YAML exporter options
|
|
29
|
-
* @returns The data as YAML string
|
|
30
92
|
* @see https://www.npmjs.com/package/yaml
|
|
31
|
-
* @see https://eemeli.org/yaml/#yaml
|
|
32
93
|
*/
|
|
33
|
-
declare const yamlExporter: (data:
|
|
34
|
-
options?: {
|
|
94
|
+
declare const yamlExporter: (data: unknown, options?: {
|
|
35
95
|
replacer?: Parameters<typeof yaml.stringify>[1];
|
|
36
96
|
exporter?: Parameters<typeof yaml.stringify>[2];
|
|
37
97
|
}) => string;
|
|
38
98
|
/**
|
|
39
|
-
*
|
|
40
|
-
* @
|
|
41
|
-
|
|
42
|
-
|
|
99
|
+
* TOML exporter
|
|
100
|
+
* @see https://www.npmjs.com/package/smol-toml
|
|
101
|
+
*/
|
|
102
|
+
declare const tomlExporter: (data: unknown, _options?: Record<string, never>) => string;
|
|
103
|
+
/**
|
|
104
|
+
* CSV / TSV exporter
|
|
43
105
|
* @see https://www.npmjs.com/package/json-2-csv
|
|
44
|
-
* @see https://mrodrig.github.io/json-2-csv/
|
|
45
106
|
*/
|
|
46
|
-
declare const csvExporter: (data:
|
|
47
|
-
options: Json2CsvOptions) => string;
|
|
107
|
+
declare const csvExporter: (data: unknown, options?: CsvExportOptions, forceTsv?: boolean) => string;
|
|
48
108
|
/**
|
|
49
109
|
* XML exporter
|
|
50
|
-
* @param data - The data object
|
|
51
|
-
* @param options - Specific XML exporter options
|
|
52
|
-
* @returns The data as XML string
|
|
53
110
|
* @see https://www.npmjs.com/package/jstoxml
|
|
54
|
-
* @see https://github.com/davidcalhoun/jstoxml
|
|
55
111
|
*/
|
|
56
|
-
declare const xmlExporter: (data:
|
|
57
|
-
|
|
112
|
+
declare const xmlExporter: (data: unknown, options?: XmlOptions) => string;
|
|
113
|
+
/**
|
|
114
|
+
* BSON exporter
|
|
115
|
+
* @see https://www.npmjs.com/package/bson
|
|
116
|
+
*/
|
|
117
|
+
declare const bsonExporter: (data: unknown, options?: BinaryExportOptions & BsonSerializeOptions) => string | Uint8Array<ArrayBufferLike>;
|
|
118
|
+
/**
|
|
119
|
+
* MessagePack exporter
|
|
120
|
+
* @see https://www.npmjs.com/package/@msgpack/msgpack
|
|
121
|
+
*/
|
|
122
|
+
declare const msgpackExporter: (data: unknown, options?: BinaryExportOptions & MsgpackEncodeOptions) => string | Uint8Array<ArrayBufferLike>;
|
|
123
|
+
/**
|
|
124
|
+
* CBOR exporter
|
|
125
|
+
* @see https://www.npmjs.com/package/cbor-x
|
|
126
|
+
*/
|
|
127
|
+
declare const cborExporter: (data: unknown, options?: BinaryExportOptions) => string | Uint8Array<ArrayBufferLike>;
|
|
128
|
+
/**
|
|
129
|
+
* Protocol Buffers exporter
|
|
130
|
+
* @see https://www.npmjs.com/package/protobufjs
|
|
131
|
+
*/
|
|
132
|
+
declare const protobufExporter: (data: unknown, options: ProtobufExportOptions) => string | Uint8Array<ArrayBufferLike>;
|
|
133
|
+
/**
|
|
134
|
+
* Apache Avro exporter
|
|
135
|
+
* @see https://www.npmjs.com/package/avsc
|
|
136
|
+
*/
|
|
137
|
+
declare const avroExporter: (data: unknown, options: AvroExportOptions) => string | Uint8Array<ArrayBufferLike>;
|
|
58
138
|
/**
|
|
59
139
|
* Universal data exporter
|
|
60
140
|
* @group None
|
|
@@ -65,14 +145,33 @@ export declare class DataExporter {
|
|
|
65
145
|
*/
|
|
66
146
|
private format;
|
|
67
147
|
/**
|
|
68
|
-
* Creates new instance of
|
|
69
|
-
* @param
|
|
148
|
+
* Creates new instance of DataExporter
|
|
149
|
+
* @param format - DataExporter format
|
|
70
150
|
*/
|
|
71
151
|
constructor(format: DataExporterFormat);
|
|
72
|
-
exportSync(data:
|
|
73
|
-
exportSync(data:
|
|
74
|
-
exportSync(data:
|
|
75
|
-
exportSync(data:
|
|
76
|
-
|
|
152
|
+
exportSync(data: unknown, options?: ExportOptions<'json'>): string;
|
|
153
|
+
exportSync(data: unknown, options?: ExportOptions<'jsonl'>): string;
|
|
154
|
+
exportSync(data: unknown, options?: ExportOptions<'yaml'>): string;
|
|
155
|
+
exportSync(data: unknown, options?: ExportOptions<'toml'>): string;
|
|
156
|
+
exportSync(data: unknown, options?: ExportOptions<'csv'>): string;
|
|
157
|
+
exportSync(data: unknown, options?: ExportOptions<'tsv'>): string;
|
|
158
|
+
exportSync(data: unknown, options?: ExportOptions<'xml'>): string;
|
|
159
|
+
exportSync(data: unknown, options?: ExportOptions<'bson'>): string | Uint8Array;
|
|
160
|
+
exportSync(data: unknown, options?: ExportOptions<'msgpack'>): string | Uint8Array;
|
|
161
|
+
exportSync(data: unknown, options?: ExportOptions<'cbor'>): string | Uint8Array;
|
|
162
|
+
exportSync(data: unknown, options: ExportOptions<'protobuf'>): string | Uint8Array;
|
|
163
|
+
exportSync(data: unknown, options: ExportOptions<'avro'>): string | Uint8Array;
|
|
164
|
+
export(data: unknown, options?: ExportOptions<'json'>): Promise<string>;
|
|
165
|
+
export(data: unknown, options?: ExportOptions<'jsonl'>): Promise<string>;
|
|
166
|
+
export(data: unknown, options?: ExportOptions<'yaml'>): Promise<string>;
|
|
167
|
+
export(data: unknown, options?: ExportOptions<'toml'>): Promise<string>;
|
|
168
|
+
export(data: unknown, options?: ExportOptions<'csv'>): Promise<string>;
|
|
169
|
+
export(data: unknown, options?: ExportOptions<'tsv'>): Promise<string>;
|
|
170
|
+
export(data: unknown, options?: ExportOptions<'xml'>): Promise<string>;
|
|
171
|
+
export(data: unknown, options?: ExportOptions<'bson'>): Promise<string | Uint8Array>;
|
|
172
|
+
export(data: unknown, options?: ExportOptions<'msgpack'>): Promise<string | Uint8Array>;
|
|
173
|
+
export(data: unknown, options?: ExportOptions<'cbor'>): Promise<string | Uint8Array>;
|
|
174
|
+
export(data: unknown, options: ExportOptions<'protobuf'>): Promise<string | Uint8Array>;
|
|
175
|
+
export(data: unknown, options: ExportOptions<'avro'>): Promise<string | Uint8Array>;
|
|
77
176
|
}
|
|
78
177
|
export {};
|