@prismer/sdk 2.0.7 → 2.2.55
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/README.md +13 -7
- package/dist/chunk-R7POPVJR.mjs +35 -0
- package/dist/cli.js +59723 -8280
- package/dist/index.d.mts +724 -229
- package/dist/index.d.ts +724 -229
- package/dist/index.js +325 -23
- package/dist/index.mjs +324 -23
- package/dist/katex-OIP2Q473.mjs +14515 -0
- package/dist/pkf-schema.json +35 -0
- package/dist/pkf.d.mts +1 -0
- package/dist/pkf.d.ts +1 -0
- package/dist/pkf.js +48370 -0
- package/dist/pkf.mjs +33683 -0
- package/node_modules/@clack/core/CHANGELOG.md +249 -0
- package/node_modules/@clack/core/LICENSE +9 -0
- package/node_modules/@clack/core/README.md +22 -0
- package/node_modules/@clack/core/dist/index.cjs +15 -0
- package/node_modules/@clack/core/dist/index.cjs.map +1 -0
- package/node_modules/@clack/core/dist/index.d.cts +209 -0
- package/node_modules/@clack/core/dist/index.d.mts +209 -0
- package/node_modules/@clack/core/dist/index.d.ts +209 -0
- package/node_modules/@clack/core/dist/index.mjs +15 -0
- package/node_modules/@clack/core/dist/index.mjs.map +1 -0
- package/node_modules/@clack/core/package.json +62 -0
- package/node_modules/@clack/prompts/CHANGELOG.md +374 -0
- package/node_modules/@clack/prompts/LICENSE +9 -0
- package/node_modules/@clack/prompts/README.md +191 -0
- package/node_modules/@clack/prompts/dist/index.cjs +80 -0
- package/node_modules/@clack/prompts/dist/index.cjs.map +1 -0
- package/node_modules/@clack/prompts/dist/index.d.cts +151 -0
- package/node_modules/@clack/prompts/dist/index.d.mts +151 -0
- package/node_modules/@clack/prompts/dist/index.d.ts +151 -0
- package/node_modules/@clack/prompts/dist/index.mjs +80 -0
- package/node_modules/@clack/prompts/dist/index.mjs.map +1 -0
- package/node_modules/@clack/prompts/package.json +61 -0
- package/node_modules/@iarna/toml/LICENSE +14 -0
- package/node_modules/@iarna/toml/README.md +301 -0
- package/node_modules/@iarna/toml/index.d.ts +57 -0
- package/node_modules/@iarna/toml/lib/create-date.js +23 -0
- package/node_modules/@iarna/toml/lib/create-datetime-float.js +24 -0
- package/node_modules/@iarna/toml/lib/create-datetime.js +10 -0
- package/node_modules/@iarna/toml/lib/create-time.js +22 -0
- package/node_modules/@iarna/toml/lib/format-num.js +6 -0
- package/node_modules/@iarna/toml/lib/parser-debug.js +60 -0
- package/node_modules/@iarna/toml/lib/parser.js +127 -0
- package/node_modules/@iarna/toml/lib/toml-parser.js +1379 -0
- package/node_modules/@iarna/toml/package.json +82 -0
- package/node_modules/@iarna/toml/parse-async.js +30 -0
- package/node_modules/@iarna/toml/parse-pretty-error.js +33 -0
- package/node_modules/@iarna/toml/parse-stream.js +80 -0
- package/node_modules/@iarna/toml/parse-string.js +18 -0
- package/node_modules/@iarna/toml/parse.js +5 -0
- package/node_modules/@iarna/toml/stringify.js +296 -0
- package/node_modules/@iarna/toml/toml.js +3 -0
- package/node_modules/@prismer/aip-sdk/README.md +36 -0
- package/node_modules/@prismer/aip-sdk/dist/cli/chunk-LIJDUCHB.js +104 -0
- package/node_modules/@prismer/aip-sdk/dist/cli/chunk-QUQXZ2LD.js +99 -0
- package/node_modules/@prismer/aip-sdk/dist/cli/credentials-5GGZEJFG.js +56 -0
- package/node_modules/@prismer/aip-sdk/dist/cli/delegation-3J35VGBZ.js +64 -0
- package/node_modules/@prismer/aip-sdk/dist/cli/identity-LXVWKSVB.js +7 -0
- package/node_modules/@prismer/aip-sdk/dist/cli/index.js +259 -0
- package/node_modules/@prismer/aip-sdk/dist/cli/resolver-TGOPKW52.js +26 -0
- package/node_modules/@prismer/aip-sdk/dist/index.cjs +368 -0
- package/node_modules/@prismer/aip-sdk/dist/index.d.cts +174 -0
- package/node_modules/@prismer/aip-sdk/dist/index.d.ts +174 -0
- package/node_modules/@prismer/aip-sdk/dist/index.js +322 -0
- package/node_modules/@prismer/aip-sdk/package.json +53 -0
- package/node_modules/ansi-regex/index.d.ts +37 -0
- package/node_modules/ansi-regex/index.js +10 -0
- package/node_modules/ansi-regex/license +9 -0
- package/node_modules/ansi-regex/package.json +55 -0
- package/node_modules/ansi-regex/readme.md +78 -0
- package/node_modules/camelcase/index.d.ts +63 -0
- package/node_modules/camelcase/index.js +76 -0
- package/node_modules/camelcase/license +9 -0
- package/node_modules/camelcase/package.json +43 -0
- package/node_modules/camelcase/readme.md +99 -0
- package/node_modules/cliui/LICENSE.txt +14 -0
- package/node_modules/cliui/README.md +115 -0
- package/node_modules/cliui/index.js +354 -0
- package/node_modules/cliui/package.json +65 -0
- package/node_modules/color-convert/LICENSE +21 -0
- package/node_modules/color-convert/README.md +68 -0
- package/node_modules/color-convert/conversions.js +839 -0
- package/node_modules/color-convert/index.js +81 -0
- package/node_modules/color-convert/package.json +48 -0
- package/node_modules/color-convert/route.js +97 -0
- package/node_modules/color-name/LICENSE +8 -0
- package/node_modules/color-name/README.md +11 -0
- package/node_modules/color-name/index.js +152 -0
- package/node_modules/color-name/package.json +28 -0
- package/node_modules/commander/LICENSE +22 -0
- package/node_modules/commander/Readme.md +1157 -0
- package/node_modules/commander/esm.mjs +16 -0
- package/node_modules/commander/index.js +24 -0
- package/node_modules/commander/lib/argument.js +149 -0
- package/node_modules/commander/lib/command.js +2509 -0
- package/node_modules/commander/lib/error.js +39 -0
- package/node_modules/commander/lib/help.js +520 -0
- package/node_modules/commander/lib/option.js +330 -0
- package/node_modules/commander/lib/suggestSimilar.js +101 -0
- package/node_modules/commander/package-support.json +16 -0
- package/node_modules/commander/package.json +84 -0
- package/node_modules/commander/typings/esm.d.mts +3 -0
- package/node_modules/commander/typings/index.d.ts +969 -0
- package/node_modules/decamelize/index.js +13 -0
- package/node_modules/decamelize/license +21 -0
- package/node_modules/decamelize/package.json +38 -0
- package/node_modules/decamelize/readme.md +48 -0
- package/node_modules/dijkstrajs/.travis.yml +4 -0
- package/node_modules/dijkstrajs/CONTRIBUTING.md +8 -0
- package/node_modules/dijkstrajs/LICENSE.md +19 -0
- package/node_modules/dijkstrajs/README.md +18 -0
- package/node_modules/dijkstrajs/dijkstra.js +165 -0
- package/node_modules/dijkstrajs/package.json +60 -0
- package/node_modules/dijkstrajs/test/dijkstra.test.js +96 -0
- package/node_modules/emoji-regex/LICENSE-MIT.txt +20 -0
- package/node_modules/emoji-regex/README.md +73 -0
- package/node_modules/emoji-regex/es2015/index.js +6 -0
- package/node_modules/emoji-regex/es2015/text.js +6 -0
- package/node_modules/emoji-regex/index.d.ts +23 -0
- package/node_modules/emoji-regex/index.js +6 -0
- package/node_modules/emoji-regex/package.json +50 -0
- package/node_modules/emoji-regex/text.js +6 -0
- package/node_modules/find-up/index.d.ts +137 -0
- package/node_modules/find-up/index.js +89 -0
- package/node_modules/find-up/license +9 -0
- package/node_modules/find-up/package.json +53 -0
- package/node_modules/find-up/readme.md +156 -0
- package/node_modules/get-caller-file/LICENSE.md +6 -0
- package/node_modules/get-caller-file/README.md +41 -0
- package/node_modules/get-caller-file/index.d.ts +2 -0
- package/node_modules/get-caller-file/index.js +22 -0
- package/node_modules/get-caller-file/index.js.map +1 -0
- package/node_modules/get-caller-file/package.json +42 -0
- package/node_modules/is-fullwidth-code-point/index.d.ts +17 -0
- package/node_modules/is-fullwidth-code-point/index.js +50 -0
- package/node_modules/is-fullwidth-code-point/license +9 -0
- package/node_modules/is-fullwidth-code-point/package.json +42 -0
- package/node_modules/is-fullwidth-code-point/readme.md +39 -0
- package/node_modules/locate-path/index.d.ts +83 -0
- package/node_modules/locate-path/index.js +65 -0
- package/node_modules/locate-path/license +9 -0
- package/node_modules/locate-path/package.json +45 -0
- package/node_modules/locate-path/readme.md +122 -0
- package/node_modules/p-locate/index.d.ts +64 -0
- package/node_modules/p-locate/index.js +52 -0
- package/node_modules/p-locate/license +9 -0
- package/node_modules/p-locate/node_modules/p-limit/index.d.ts +38 -0
- package/node_modules/p-locate/node_modules/p-limit/index.js +57 -0
- package/node_modules/p-locate/node_modules/p-limit/license +9 -0
- package/node_modules/p-locate/node_modules/p-limit/package.json +52 -0
- package/node_modules/p-locate/node_modules/p-limit/readme.md +101 -0
- package/node_modules/p-locate/package.json +53 -0
- package/node_modules/p-locate/readme.md +90 -0
- package/node_modules/p-try/index.d.ts +39 -0
- package/node_modules/p-try/index.js +9 -0
- package/node_modules/p-try/license +9 -0
- package/node_modules/p-try/package.json +42 -0
- package/node_modules/p-try/readme.md +58 -0
- package/node_modules/path-exists/index.d.ts +28 -0
- package/node_modules/path-exists/index.js +23 -0
- package/node_modules/path-exists/license +9 -0
- package/node_modules/path-exists/package.json +39 -0
- package/node_modules/path-exists/readme.md +52 -0
- package/node_modules/picocolors/LICENSE +15 -0
- package/node_modules/picocolors/README.md +21 -0
- package/node_modules/picocolors/package.json +25 -0
- package/node_modules/picocolors/picocolors.browser.js +4 -0
- package/node_modules/picocolors/picocolors.d.ts +5 -0
- package/node_modules/picocolors/picocolors.js +75 -0
- package/node_modules/picocolors/types.d.ts +51 -0
- package/node_modules/pngjs/.eslintignore +2 -0
- package/node_modules/pngjs/.eslintrc.json +19 -0
- package/node_modules/pngjs/.prettierignore +3 -0
- package/node_modules/pngjs/LICENSE +20 -0
- package/node_modules/pngjs/README.md +429 -0
- package/node_modules/pngjs/browser.js +16096 -0
- package/node_modules/pngjs/coverage/lcov-report/base.css +354 -0
- package/node_modules/pngjs/coverage/lcov-report/bitmapper.js.html +881 -0
- package/node_modules/pngjs/coverage/lcov-report/bitpacker.js.html +554 -0
- package/node_modules/pngjs/coverage/lcov-report/block-navigation.js +77 -0
- package/node_modules/pngjs/coverage/lcov-report/chunkstream.js.html +647 -0
- package/node_modules/pngjs/coverage/lcov-report/constants.js.html +176 -0
- package/node_modules/pngjs/coverage/lcov-report/crc.js.html +200 -0
- package/node_modules/pngjs/coverage/lcov-report/favicon.png +0 -0
- package/node_modules/pngjs/coverage/lcov-report/filter-pack.js.html +593 -0
- package/node_modules/pngjs/coverage/lcov-report/filter-parse-async.js.html +152 -0
- package/node_modules/pngjs/coverage/lcov-report/filter-parse-sync.js.html +143 -0
- package/node_modules/pngjs/coverage/lcov-report/filter-parse.js.html +611 -0
- package/node_modules/pngjs/coverage/lcov-report/format-normaliser.js.html +359 -0
- package/node_modules/pngjs/coverage/lcov-report/index.html +426 -0
- package/node_modules/pngjs/coverage/lcov-report/interlace.js.html +365 -0
- package/node_modules/pngjs/coverage/lcov-report/packer-async.js.html +230 -0
- package/node_modules/pngjs/coverage/lcov-report/packer-sync.js.html +248 -0
- package/node_modules/pngjs/coverage/lcov-report/packer.js.html +467 -0
- package/node_modules/pngjs/coverage/lcov-report/paeth-predictor.js.html +128 -0
- package/node_modules/pngjs/coverage/lcov-report/parser-async.js.html +575 -0
- package/node_modules/pngjs/coverage/lcov-report/parser-sync.js.html +404 -0
- package/node_modules/pngjs/coverage/lcov-report/parser.js.html +950 -0
- package/node_modules/pngjs/coverage/lcov-report/png-sync.js.html +116 -0
- package/node_modules/pngjs/coverage/lcov-report/png.js.html +662 -0
- package/node_modules/pngjs/coverage/lcov-report/prettify.css +101 -0
- package/node_modules/pngjs/coverage/lcov-report/prettify.js +1007 -0
- package/node_modules/pngjs/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/node_modules/pngjs/coverage/lcov-report/sorter.js +169 -0
- package/node_modules/pngjs/coverage/lcov-report/sync-inflate.js.html +584 -0
- package/node_modules/pngjs/coverage/lcov-report/sync-reader.js.html +215 -0
- package/node_modules/pngjs/coverage/lcov.info +2177 -0
- package/node_modules/pngjs/lib/bitmapper.js +267 -0
- package/node_modules/pngjs/lib/bitpacker.js +158 -0
- package/node_modules/pngjs/lib/chunkstream.js +189 -0
- package/node_modules/pngjs/lib/constants.js +32 -0
- package/node_modules/pngjs/lib/crc.js +40 -0
- package/node_modules/pngjs/lib/filter-pack.js +171 -0
- package/node_modules/pngjs/lib/filter-parse-async.js +24 -0
- package/node_modules/pngjs/lib/filter-parse-sync.js +21 -0
- package/node_modules/pngjs/lib/filter-parse.js +177 -0
- package/node_modules/pngjs/lib/format-normaliser.js +93 -0
- package/node_modules/pngjs/lib/interlace.js +95 -0
- package/node_modules/pngjs/lib/packer-async.js +50 -0
- package/node_modules/pngjs/lib/packer-sync.js +56 -0
- package/node_modules/pngjs/lib/packer.js +129 -0
- package/node_modules/pngjs/lib/paeth-predictor.js +16 -0
- package/node_modules/pngjs/lib/parser-async.js +165 -0
- package/node_modules/pngjs/lib/parser-sync.js +108 -0
- package/node_modules/pngjs/lib/parser.js +290 -0
- package/node_modules/pngjs/lib/png-sync.js +12 -0
- package/node_modules/pngjs/lib/png.js +194 -0
- package/node_modules/pngjs/lib/sync-inflate.js +168 -0
- package/node_modules/pngjs/lib/sync-reader.js +45 -0
- package/node_modules/pngjs/package.json +73 -0
- package/node_modules/qrcode/README.md +770 -0
- package/node_modules/qrcode/bin/qrcode +159 -0
- package/node_modules/qrcode/helper/to-sjis-browser.js +2 -0
- package/node_modules/qrcode/helper/to-sjis.js +105 -0
- package/node_modules/qrcode/lib/browser.js +76 -0
- package/node_modules/qrcode/lib/can-promise.js +7 -0
- package/node_modules/qrcode/lib/core/alignment-pattern.js +83 -0
- package/node_modules/qrcode/lib/core/alphanumeric-data.js +59 -0
- package/node_modules/qrcode/lib/core/bit-buffer.js +37 -0
- package/node_modules/qrcode/lib/core/bit-matrix.js +65 -0
- package/node_modules/qrcode/lib/core/byte-data.js +30 -0
- package/node_modules/qrcode/lib/core/error-correction-code.js +135 -0
- package/node_modules/qrcode/lib/core/error-correction-level.js +50 -0
- package/node_modules/qrcode/lib/core/finder-pattern.js +22 -0
- package/node_modules/qrcode/lib/core/format-info.js +29 -0
- package/node_modules/qrcode/lib/core/galois-field.js +69 -0
- package/node_modules/qrcode/lib/core/kanji-data.js +54 -0
- package/node_modules/qrcode/lib/core/mask-pattern.js +234 -0
- package/node_modules/qrcode/lib/core/mode.js +167 -0
- package/node_modules/qrcode/lib/core/numeric-data.js +43 -0
- package/node_modules/qrcode/lib/core/polynomial.js +62 -0
- package/node_modules/qrcode/lib/core/qrcode.js +495 -0
- package/node_modules/qrcode/lib/core/reed-solomon-encoder.js +56 -0
- package/node_modules/qrcode/lib/core/regex.js +31 -0
- package/node_modules/qrcode/lib/core/segments.js +330 -0
- package/node_modules/qrcode/lib/core/utils.js +63 -0
- package/node_modules/qrcode/lib/core/version-check.js +9 -0
- package/node_modules/qrcode/lib/core/version.js +163 -0
- package/node_modules/qrcode/lib/index.js +12 -0
- package/node_modules/qrcode/lib/renderer/canvas.js +63 -0
- package/node_modules/qrcode/lib/renderer/png.js +78 -0
- package/node_modules/qrcode/lib/renderer/svg-tag.js +81 -0
- package/node_modules/qrcode/lib/renderer/svg.js +19 -0
- package/node_modules/qrcode/lib/renderer/terminal/terminal-small.js +85 -0
- package/node_modules/qrcode/lib/renderer/terminal/terminal.js +49 -0
- package/node_modules/qrcode/lib/renderer/terminal.js +9 -0
- package/node_modules/qrcode/lib/renderer/utf8.js +71 -0
- package/node_modules/qrcode/lib/renderer/utils.js +99 -0
- package/node_modules/qrcode/lib/server.js +138 -0
- package/node_modules/qrcode/license +10 -0
- package/node_modules/qrcode/package.json +77 -0
- package/node_modules/require-directory/.jshintrc +67 -0
- package/node_modules/require-directory/.npmignore +1 -0
- package/node_modules/require-directory/.travis.yml +3 -0
- package/node_modules/require-directory/LICENSE +22 -0
- package/node_modules/require-directory/README.markdown +184 -0
- package/node_modules/require-directory/index.js +86 -0
- package/node_modules/require-directory/package.json +40 -0
- package/node_modules/require-main-filename/LICENSE.txt +14 -0
- package/node_modules/require-main-filename/README.md +26 -0
- package/node_modules/require-main-filename/index.js +18 -0
- package/node_modules/require-main-filename/package.json +35 -0
- package/node_modules/set-blocking/LICENSE.txt +14 -0
- package/node_modules/set-blocking/README.md +31 -0
- package/node_modules/set-blocking/index.js +7 -0
- package/node_modules/set-blocking/package.json +42 -0
- package/node_modules/sisteransi/license +21 -0
- package/node_modules/sisteransi/package.json +34 -0
- package/node_modules/sisteransi/readme.md +113 -0
- package/node_modules/sisteransi/src/index.js +58 -0
- package/node_modules/sisteransi/src/sisteransi.d.ts +35 -0
- package/node_modules/string-width/index.d.ts +29 -0
- package/node_modules/string-width/index.js +47 -0
- package/node_modules/string-width/license +9 -0
- package/node_modules/string-width/package.json +56 -0
- package/node_modules/string-width/readme.md +50 -0
- package/node_modules/strip-ansi/index.d.ts +17 -0
- package/node_modules/strip-ansi/index.js +4 -0
- package/node_modules/strip-ansi/license +9 -0
- package/node_modules/strip-ansi/package.json +54 -0
- package/node_modules/strip-ansi/readme.md +46 -0
- package/node_modules/which-module/LICENSE +13 -0
- package/node_modules/which-module/README.md +58 -0
- package/node_modules/which-module/index.js +9 -0
- package/node_modules/which-module/package.json +41 -0
- package/node_modules/wrap-ansi/index.js +186 -0
- package/node_modules/wrap-ansi/license +9 -0
- package/node_modules/wrap-ansi/node_modules/ansi-styles/index.d.ts +345 -0
- package/node_modules/wrap-ansi/node_modules/ansi-styles/index.js +163 -0
- package/node_modules/wrap-ansi/node_modules/ansi-styles/license +9 -0
- package/node_modules/wrap-ansi/node_modules/ansi-styles/package.json +56 -0
- package/node_modules/wrap-ansi/node_modules/ansi-styles/readme.md +152 -0
- package/node_modules/wrap-ansi/package.json +61 -0
- package/node_modules/wrap-ansi/readme.md +97 -0
- package/node_modules/y18n/LICENSE +13 -0
- package/node_modules/y18n/README.md +109 -0
- package/node_modules/y18n/index.js +188 -0
- package/node_modules/y18n/package.json +39 -0
- package/node_modules/yargs/LICENSE +21 -0
- package/node_modules/yargs/README.md +140 -0
- package/node_modules/yargs/build/lib/apply-extends.d.ts +2 -0
- package/node_modules/yargs/build/lib/apply-extends.js +65 -0
- package/node_modules/yargs/build/lib/argsert.d.ts +2 -0
- package/node_modules/yargs/build/lib/argsert.js +65 -0
- package/node_modules/yargs/build/lib/command.d.ts +64 -0
- package/node_modules/yargs/build/lib/command.js +416 -0
- package/node_modules/yargs/build/lib/common-types.d.ts +36 -0
- package/node_modules/yargs/build/lib/common-types.js +25 -0
- package/node_modules/yargs/build/lib/completion-templates.d.ts +2 -0
- package/node_modules/yargs/build/lib/completion-templates.js +50 -0
- package/node_modules/yargs/build/lib/completion.d.ts +21 -0
- package/node_modules/yargs/build/lib/completion.js +135 -0
- package/node_modules/yargs/build/lib/is-promise.d.ts +1 -0
- package/node_modules/yargs/build/lib/is-promise.js +9 -0
- package/node_modules/yargs/build/lib/levenshtein.d.ts +1 -0
- package/node_modules/yargs/build/lib/levenshtein.js +58 -0
- package/node_modules/yargs/build/lib/middleware.d.ts +10 -0
- package/node_modules/yargs/build/lib/middleware.js +57 -0
- package/node_modules/yargs/build/lib/obj-filter.d.ts +1 -0
- package/node_modules/yargs/build/lib/obj-filter.js +14 -0
- package/node_modules/yargs/build/lib/parse-command.d.ts +11 -0
- package/node_modules/yargs/build/lib/parse-command.js +36 -0
- package/node_modules/yargs/build/lib/process-argv.d.ts +2 -0
- package/node_modules/yargs/build/lib/process-argv.js +31 -0
- package/node_modules/yargs/build/lib/usage.d.ts +49 -0
- package/node_modules/yargs/build/lib/usage.js +540 -0
- package/node_modules/yargs/build/lib/validation.d.ts +34 -0
- package/node_modules/yargs/build/lib/validation.js +330 -0
- package/node_modules/yargs/build/lib/yargs.d.ts +274 -0
- package/node_modules/yargs/build/lib/yargs.js +1190 -0
- package/node_modules/yargs/build/lib/yerror.d.ts +4 -0
- package/node_modules/yargs/build/lib/yerror.js +11 -0
- package/node_modules/yargs/index.js +40 -0
- package/node_modules/yargs/locales/be.json +46 -0
- package/node_modules/yargs/locales/de.json +46 -0
- package/node_modules/yargs/locales/en.json +51 -0
- package/node_modules/yargs/locales/es.json +46 -0
- package/node_modules/yargs/locales/fi.json +49 -0
- package/node_modules/yargs/locales/fr.json +53 -0
- package/node_modules/yargs/locales/hi.json +49 -0
- package/node_modules/yargs/locales/hu.json +46 -0
- package/node_modules/yargs/locales/id.json +50 -0
- package/node_modules/yargs/locales/it.json +46 -0
- package/node_modules/yargs/locales/ja.json +51 -0
- package/node_modules/yargs/locales/ko.json +49 -0
- package/node_modules/yargs/locales/nb.json +44 -0
- package/node_modules/yargs/locales/nl.json +49 -0
- package/node_modules/yargs/locales/nn.json +44 -0
- package/node_modules/yargs/locales/pirate.json +13 -0
- package/node_modules/yargs/locales/pl.json +49 -0
- package/node_modules/yargs/locales/pt.json +45 -0
- package/node_modules/yargs/locales/pt_BR.json +48 -0
- package/node_modules/yargs/locales/ru.json +46 -0
- package/node_modules/yargs/locales/th.json +46 -0
- package/node_modules/yargs/locales/tr.json +48 -0
- package/node_modules/yargs/locales/zh_CN.json +48 -0
- package/node_modules/yargs/locales/zh_TW.json +47 -0
- package/node_modules/yargs/package.json +92 -0
- package/node_modules/yargs/yargs.js +14 -0
- package/node_modules/yargs-parser/LICENSE.txt +14 -0
- package/node_modules/yargs-parser/README.md +449 -0
- package/node_modules/yargs-parser/index.js +1032 -0
- package/node_modules/yargs-parser/lib/tokenize-arg-string.js +40 -0
- package/node_modules/yargs-parser/package.json +46 -0
- package/package.json +28 -5
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@iarna/toml",
|
|
3
|
+
"version": "2.2.5",
|
|
4
|
+
"main": "toml.js",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"test": "tap -J --100 test/*.js test/toml-stream/*.js",
|
|
7
|
+
"benchmark": "node benchmark.js && node benchmark-per-file.js && node results2table.js",
|
|
8
|
+
"prerelease": "npm t",
|
|
9
|
+
"prepack": "rm -f *~",
|
|
10
|
+
"postpublish": "git push --follow-tags",
|
|
11
|
+
"pretest": "iarna-standard",
|
|
12
|
+
"update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'",
|
|
13
|
+
"update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'",
|
|
14
|
+
"setup-burntsushi-toml-suite": "[ -d test/burntsushi-toml-test ] || (git clone https://github.com/BurntSushi/toml-test test/burntsushi-toml-test; rimraf test/burntsushi-toml-test/.git/hooks/*); cd test/burntsushi-toml-test; git pull",
|
|
15
|
+
"setup-iarna-toml-suite": "[ -d test/spec-test ] || (git clone https://github.com/iarna/toml-spec-tests -b 0.5.0 test/spec-test; rimraf test/spec-test/.git/hooks/*); cd test/spec-test; git pull",
|
|
16
|
+
"prepare": "npm run setup-burntsushi-toml-suite && npm run setup-iarna-toml-suite"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"toml",
|
|
20
|
+
"toml-parser",
|
|
21
|
+
"toml-stringifier",
|
|
22
|
+
"parser",
|
|
23
|
+
"stringifer",
|
|
24
|
+
"emitter",
|
|
25
|
+
"ini",
|
|
26
|
+
"tomlify",
|
|
27
|
+
"encoder",
|
|
28
|
+
"decoder"
|
|
29
|
+
],
|
|
30
|
+
"author": "Rebecca Turner <me@re-becca.org> (http://re-becca.org/)",
|
|
31
|
+
"license": "ISC",
|
|
32
|
+
"description": "Better TOML parsing and stringifying all in that familiar JSON interface.",
|
|
33
|
+
"dependencies": {},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@iarna/standard": "^2.0.2",
|
|
36
|
+
"@ltd/j-toml": "^0.5.107",
|
|
37
|
+
"@perl/qx": "^1.1.0",
|
|
38
|
+
"@sgarciac/bombadil": "^2.3.0",
|
|
39
|
+
"ansi": "^0.3.1",
|
|
40
|
+
"approximate-number": "^2.0.0",
|
|
41
|
+
"benchmark": "^2.1.4",
|
|
42
|
+
"fast-toml": "^0.5.4",
|
|
43
|
+
"funstream": "^4.2.0",
|
|
44
|
+
"glob": "^7.1.6",
|
|
45
|
+
"js-yaml": "^3.13.1",
|
|
46
|
+
"rimraf": "^3.0.2",
|
|
47
|
+
"tap": "^12.0.1",
|
|
48
|
+
"toml": "^3.0.0",
|
|
49
|
+
"toml-j0.4": "^1.1.1",
|
|
50
|
+
"weallbehave": "*",
|
|
51
|
+
"weallcontribute": "*"
|
|
52
|
+
},
|
|
53
|
+
"files": [
|
|
54
|
+
"toml.js",
|
|
55
|
+
"stringify.js",
|
|
56
|
+
"parse.js",
|
|
57
|
+
"parse-string.js",
|
|
58
|
+
"parse-stream.js",
|
|
59
|
+
"parse-async.js",
|
|
60
|
+
"parse-pretty-error.js",
|
|
61
|
+
"lib/parser.js",
|
|
62
|
+
"lib/parser-debug.js",
|
|
63
|
+
"lib/toml-parser.js",
|
|
64
|
+
"lib/create-datetime.js",
|
|
65
|
+
"lib/create-date.js",
|
|
66
|
+
"lib/create-datetime-float.js",
|
|
67
|
+
"lib/create-time.js",
|
|
68
|
+
"lib/format-num.js",
|
|
69
|
+
"index.d.ts"
|
|
70
|
+
],
|
|
71
|
+
"directories": {
|
|
72
|
+
"test": "test"
|
|
73
|
+
},
|
|
74
|
+
"repository": {
|
|
75
|
+
"type": "git",
|
|
76
|
+
"url": "git+https://github.com/iarna/iarna-toml.git"
|
|
77
|
+
},
|
|
78
|
+
"bugs": {
|
|
79
|
+
"url": "https://github.com/iarna/iarna-toml/issues"
|
|
80
|
+
},
|
|
81
|
+
"homepage": "https://github.com/iarna/iarna-toml#readme"
|
|
82
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
module.exports = parseAsync
|
|
3
|
+
|
|
4
|
+
const TOMLParser = require('./lib/toml-parser.js')
|
|
5
|
+
const prettyError = require('./parse-pretty-error.js')
|
|
6
|
+
|
|
7
|
+
function parseAsync (str, opts) {
|
|
8
|
+
if (!opts) opts = {}
|
|
9
|
+
const index = 0
|
|
10
|
+
const blocksize = opts.blocksize || 40960
|
|
11
|
+
const parser = new TOMLParser()
|
|
12
|
+
return new Promise((resolve, reject) => {
|
|
13
|
+
setImmediate(parseAsyncNext, index, blocksize, resolve, reject)
|
|
14
|
+
})
|
|
15
|
+
function parseAsyncNext (index, blocksize, resolve, reject) {
|
|
16
|
+
if (index >= str.length) {
|
|
17
|
+
try {
|
|
18
|
+
return resolve(parser.finish())
|
|
19
|
+
} catch (err) {
|
|
20
|
+
return reject(prettyError(err, str))
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
parser.parse(str.slice(index, index + blocksize))
|
|
25
|
+
setImmediate(parseAsyncNext, index + blocksize, blocksize, resolve, reject)
|
|
26
|
+
} catch (err) {
|
|
27
|
+
reject(prettyError(err, str))
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
module.exports = prettyError
|
|
3
|
+
|
|
4
|
+
function prettyError (err, buf) {
|
|
5
|
+
/* istanbul ignore if */
|
|
6
|
+
if (err.pos == null || err.line == null) return err
|
|
7
|
+
let msg = err.message
|
|
8
|
+
msg += ` at row ${err.line + 1}, col ${err.col + 1}, pos ${err.pos}:\n`
|
|
9
|
+
|
|
10
|
+
/* istanbul ignore else */
|
|
11
|
+
if (buf && buf.split) {
|
|
12
|
+
const lines = buf.split(/\n/)
|
|
13
|
+
const lineNumWidth = String(Math.min(lines.length, err.line + 3)).length
|
|
14
|
+
let linePadding = ' '
|
|
15
|
+
while (linePadding.length < lineNumWidth) linePadding += ' '
|
|
16
|
+
for (let ii = Math.max(0, err.line - 1); ii < Math.min(lines.length, err.line + 2); ++ii) {
|
|
17
|
+
let lineNum = String(ii + 1)
|
|
18
|
+
if (lineNum.length < lineNumWidth) lineNum = ' ' + lineNum
|
|
19
|
+
if (err.line === ii) {
|
|
20
|
+
msg += lineNum + '> ' + lines[ii] + '\n'
|
|
21
|
+
msg += linePadding + ' '
|
|
22
|
+
for (let hh = 0; hh < err.col; ++hh) {
|
|
23
|
+
msg += ' '
|
|
24
|
+
}
|
|
25
|
+
msg += '^\n'
|
|
26
|
+
} else {
|
|
27
|
+
msg += lineNum + ': ' + lines[ii] + '\n'
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
err.message = msg + '\n'
|
|
32
|
+
return err
|
|
33
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
module.exports = parseStream
|
|
3
|
+
|
|
4
|
+
const stream = require('stream')
|
|
5
|
+
const TOMLParser = require('./lib/toml-parser.js')
|
|
6
|
+
|
|
7
|
+
function parseStream (stm) {
|
|
8
|
+
if (stm) {
|
|
9
|
+
return parseReadable(stm)
|
|
10
|
+
} else {
|
|
11
|
+
return parseTransform(stm)
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function parseReadable (stm) {
|
|
16
|
+
const parser = new TOMLParser()
|
|
17
|
+
stm.setEncoding('utf8')
|
|
18
|
+
return new Promise((resolve, reject) => {
|
|
19
|
+
let readable
|
|
20
|
+
let ended = false
|
|
21
|
+
let errored = false
|
|
22
|
+
function finish () {
|
|
23
|
+
ended = true
|
|
24
|
+
if (readable) return
|
|
25
|
+
try {
|
|
26
|
+
resolve(parser.finish())
|
|
27
|
+
} catch (err) {
|
|
28
|
+
reject(err)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function error (err) {
|
|
32
|
+
errored = true
|
|
33
|
+
reject(err)
|
|
34
|
+
}
|
|
35
|
+
stm.once('end', finish)
|
|
36
|
+
stm.once('error', error)
|
|
37
|
+
readNext()
|
|
38
|
+
|
|
39
|
+
function readNext () {
|
|
40
|
+
readable = true
|
|
41
|
+
let data
|
|
42
|
+
while ((data = stm.read()) !== null) {
|
|
43
|
+
try {
|
|
44
|
+
parser.parse(data)
|
|
45
|
+
} catch (err) {
|
|
46
|
+
return error(err)
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
readable = false
|
|
50
|
+
/* istanbul ignore if */
|
|
51
|
+
if (ended) return finish()
|
|
52
|
+
/* istanbul ignore if */
|
|
53
|
+
if (errored) return
|
|
54
|
+
stm.once('readable', readNext)
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function parseTransform () {
|
|
60
|
+
const parser = new TOMLParser()
|
|
61
|
+
return new stream.Transform({
|
|
62
|
+
objectMode: true,
|
|
63
|
+
transform (chunk, encoding, cb) {
|
|
64
|
+
try {
|
|
65
|
+
parser.parse(chunk.toString(encoding))
|
|
66
|
+
} catch (err) {
|
|
67
|
+
this.emit('error', err)
|
|
68
|
+
}
|
|
69
|
+
cb()
|
|
70
|
+
},
|
|
71
|
+
flush (cb) {
|
|
72
|
+
try {
|
|
73
|
+
this.push(parser.finish())
|
|
74
|
+
} catch (err) {
|
|
75
|
+
this.emit('error', err)
|
|
76
|
+
}
|
|
77
|
+
cb()
|
|
78
|
+
}
|
|
79
|
+
})
|
|
80
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
module.exports = parseString
|
|
3
|
+
|
|
4
|
+
const TOMLParser = require('./lib/toml-parser.js')
|
|
5
|
+
const prettyError = require('./parse-pretty-error.js')
|
|
6
|
+
|
|
7
|
+
function parseString (str) {
|
|
8
|
+
if (global.Buffer && global.Buffer.isBuffer(str)) {
|
|
9
|
+
str = str.toString('utf8')
|
|
10
|
+
}
|
|
11
|
+
const parser = new TOMLParser()
|
|
12
|
+
try {
|
|
13
|
+
parser.parse(str)
|
|
14
|
+
return parser.finish()
|
|
15
|
+
} catch (err) {
|
|
16
|
+
throw prettyError(err, str)
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
module.exports = stringify
|
|
3
|
+
module.exports.value = stringifyInline
|
|
4
|
+
|
|
5
|
+
function stringify (obj) {
|
|
6
|
+
if (obj === null) throw typeError('null')
|
|
7
|
+
if (obj === void (0)) throw typeError('undefined')
|
|
8
|
+
if (typeof obj !== 'object') throw typeError(typeof obj)
|
|
9
|
+
|
|
10
|
+
if (typeof obj.toJSON === 'function') obj = obj.toJSON()
|
|
11
|
+
if (obj == null) return null
|
|
12
|
+
const type = tomlType(obj)
|
|
13
|
+
if (type !== 'table') throw typeError(type)
|
|
14
|
+
return stringifyObject('', '', obj)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function typeError (type) {
|
|
18
|
+
return new Error('Can only stringify objects, not ' + type)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function arrayOneTypeError () {
|
|
22
|
+
return new Error("Array values can't have mixed types")
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function getInlineKeys (obj) {
|
|
26
|
+
return Object.keys(obj).filter(key => isInline(obj[key]))
|
|
27
|
+
}
|
|
28
|
+
function getComplexKeys (obj) {
|
|
29
|
+
return Object.keys(obj).filter(key => !isInline(obj[key]))
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function toJSON (obj) {
|
|
33
|
+
let nobj = Array.isArray(obj) ? [] : Object.prototype.hasOwnProperty.call(obj, '__proto__') ? {['__proto__']: undefined} : {}
|
|
34
|
+
for (let prop of Object.keys(obj)) {
|
|
35
|
+
if (obj[prop] && typeof obj[prop].toJSON === 'function' && !('toISOString' in obj[prop])) {
|
|
36
|
+
nobj[prop] = obj[prop].toJSON()
|
|
37
|
+
} else {
|
|
38
|
+
nobj[prop] = obj[prop]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return nobj
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function stringifyObject (prefix, indent, obj) {
|
|
45
|
+
obj = toJSON(obj)
|
|
46
|
+
var inlineKeys
|
|
47
|
+
var complexKeys
|
|
48
|
+
inlineKeys = getInlineKeys(obj)
|
|
49
|
+
complexKeys = getComplexKeys(obj)
|
|
50
|
+
var result = []
|
|
51
|
+
var inlineIndent = indent || ''
|
|
52
|
+
inlineKeys.forEach(key => {
|
|
53
|
+
var type = tomlType(obj[key])
|
|
54
|
+
if (type !== 'undefined' && type !== 'null') {
|
|
55
|
+
result.push(inlineIndent + stringifyKey(key) + ' = ' + stringifyAnyInline(obj[key], true))
|
|
56
|
+
}
|
|
57
|
+
})
|
|
58
|
+
if (result.length > 0) result.push('')
|
|
59
|
+
var complexIndent = prefix && inlineKeys.length > 0 ? indent + ' ' : ''
|
|
60
|
+
complexKeys.forEach(key => {
|
|
61
|
+
result.push(stringifyComplex(prefix, complexIndent, key, obj[key]))
|
|
62
|
+
})
|
|
63
|
+
return result.join('\n')
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function isInline (value) {
|
|
67
|
+
switch (tomlType(value)) {
|
|
68
|
+
case 'undefined':
|
|
69
|
+
case 'null':
|
|
70
|
+
case 'integer':
|
|
71
|
+
case 'nan':
|
|
72
|
+
case 'float':
|
|
73
|
+
case 'boolean':
|
|
74
|
+
case 'string':
|
|
75
|
+
case 'datetime':
|
|
76
|
+
return true
|
|
77
|
+
case 'array':
|
|
78
|
+
return value.length === 0 || tomlType(value[0]) !== 'table'
|
|
79
|
+
case 'table':
|
|
80
|
+
return Object.keys(value).length === 0
|
|
81
|
+
/* istanbul ignore next */
|
|
82
|
+
default:
|
|
83
|
+
return false
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function tomlType (value) {
|
|
88
|
+
if (value === undefined) {
|
|
89
|
+
return 'undefined'
|
|
90
|
+
} else if (value === null) {
|
|
91
|
+
return 'null'
|
|
92
|
+
/* eslint-disable valid-typeof */
|
|
93
|
+
} else if (typeof value === 'bigint' || (Number.isInteger(value) && !Object.is(value, -0))) {
|
|
94
|
+
return 'integer'
|
|
95
|
+
} else if (typeof value === 'number') {
|
|
96
|
+
return 'float'
|
|
97
|
+
} else if (typeof value === 'boolean') {
|
|
98
|
+
return 'boolean'
|
|
99
|
+
} else if (typeof value === 'string') {
|
|
100
|
+
return 'string'
|
|
101
|
+
} else if ('toISOString' in value) {
|
|
102
|
+
return isNaN(value) ? 'undefined' : 'datetime'
|
|
103
|
+
} else if (Array.isArray(value)) {
|
|
104
|
+
return 'array'
|
|
105
|
+
} else {
|
|
106
|
+
return 'table'
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function stringifyKey (key) {
|
|
111
|
+
var keyStr = String(key)
|
|
112
|
+
if (/^[-A-Za-z0-9_]+$/.test(keyStr)) {
|
|
113
|
+
return keyStr
|
|
114
|
+
} else {
|
|
115
|
+
return stringifyBasicString(keyStr)
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function stringifyBasicString (str) {
|
|
120
|
+
return '"' + escapeString(str).replace(/"/g, '\\"') + '"'
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function stringifyLiteralString (str) {
|
|
124
|
+
return "'" + str + "'"
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function numpad (num, str) {
|
|
128
|
+
while (str.length < num) str = '0' + str
|
|
129
|
+
return str
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function escapeString (str) {
|
|
133
|
+
return str.replace(/\\/g, '\\\\')
|
|
134
|
+
.replace(/[\b]/g, '\\b')
|
|
135
|
+
.replace(/\t/g, '\\t')
|
|
136
|
+
.replace(/\n/g, '\\n')
|
|
137
|
+
.replace(/\f/g, '\\f')
|
|
138
|
+
.replace(/\r/g, '\\r')
|
|
139
|
+
/* eslint-disable no-control-regex */
|
|
140
|
+
.replace(/([\u0000-\u001f\u007f])/, c => '\\u' + numpad(4, c.codePointAt(0).toString(16)))
|
|
141
|
+
/* eslint-enable no-control-regex */
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function stringifyMultilineString (str) {
|
|
145
|
+
let escaped = str.split(/\n/).map(str => {
|
|
146
|
+
return escapeString(str).replace(/"(?="")/g, '\\"')
|
|
147
|
+
}).join('\n')
|
|
148
|
+
if (escaped.slice(-1) === '"') escaped += '\\\n'
|
|
149
|
+
return '"""\n' + escaped + '"""'
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function stringifyAnyInline (value, multilineOk) {
|
|
153
|
+
let type = tomlType(value)
|
|
154
|
+
if (type === 'string') {
|
|
155
|
+
if (multilineOk && /\n/.test(value)) {
|
|
156
|
+
type = 'string-multiline'
|
|
157
|
+
} else if (!/[\b\t\n\f\r']/.test(value) && /"/.test(value)) {
|
|
158
|
+
type = 'string-literal'
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return stringifyInline(value, type)
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function stringifyInline (value, type) {
|
|
165
|
+
/* istanbul ignore if */
|
|
166
|
+
if (!type) type = tomlType(value)
|
|
167
|
+
switch (type) {
|
|
168
|
+
case 'string-multiline':
|
|
169
|
+
return stringifyMultilineString(value)
|
|
170
|
+
case 'string':
|
|
171
|
+
return stringifyBasicString(value)
|
|
172
|
+
case 'string-literal':
|
|
173
|
+
return stringifyLiteralString(value)
|
|
174
|
+
case 'integer':
|
|
175
|
+
return stringifyInteger(value)
|
|
176
|
+
case 'float':
|
|
177
|
+
return stringifyFloat(value)
|
|
178
|
+
case 'boolean':
|
|
179
|
+
return stringifyBoolean(value)
|
|
180
|
+
case 'datetime':
|
|
181
|
+
return stringifyDatetime(value)
|
|
182
|
+
case 'array':
|
|
183
|
+
return stringifyInlineArray(value.filter(_ => tomlType(_) !== 'null' && tomlType(_) !== 'undefined' && tomlType(_) !== 'nan'))
|
|
184
|
+
case 'table':
|
|
185
|
+
return stringifyInlineTable(value)
|
|
186
|
+
/* istanbul ignore next */
|
|
187
|
+
default:
|
|
188
|
+
throw typeError(type)
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function stringifyInteger (value) {
|
|
193
|
+
/* eslint-disable security/detect-unsafe-regex */
|
|
194
|
+
return String(value).replace(/\B(?=(\d{3})+(?!\d))/g, '_')
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function stringifyFloat (value) {
|
|
198
|
+
if (value === Infinity) {
|
|
199
|
+
return 'inf'
|
|
200
|
+
} else if (value === -Infinity) {
|
|
201
|
+
return '-inf'
|
|
202
|
+
} else if (Object.is(value, NaN)) {
|
|
203
|
+
return 'nan'
|
|
204
|
+
} else if (Object.is(value, -0)) {
|
|
205
|
+
return '-0.0'
|
|
206
|
+
}
|
|
207
|
+
var chunks = String(value).split('.')
|
|
208
|
+
var int = chunks[0]
|
|
209
|
+
var dec = chunks[1] || 0
|
|
210
|
+
return stringifyInteger(int) + '.' + dec
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function stringifyBoolean (value) {
|
|
214
|
+
return String(value)
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function stringifyDatetime (value) {
|
|
218
|
+
return value.toISOString()
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function isNumber (type) {
|
|
222
|
+
return type === 'float' || type === 'integer'
|
|
223
|
+
}
|
|
224
|
+
function arrayType (values) {
|
|
225
|
+
var contentType = tomlType(values[0])
|
|
226
|
+
if (values.every(_ => tomlType(_) === contentType)) return contentType
|
|
227
|
+
// mixed integer/float, emit as floats
|
|
228
|
+
if (values.every(_ => isNumber(tomlType(_)))) return 'float'
|
|
229
|
+
return 'mixed'
|
|
230
|
+
}
|
|
231
|
+
function validateArray (values) {
|
|
232
|
+
const type = arrayType(values)
|
|
233
|
+
if (type === 'mixed') {
|
|
234
|
+
throw arrayOneTypeError()
|
|
235
|
+
}
|
|
236
|
+
return type
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
function stringifyInlineArray (values) {
|
|
240
|
+
values = toJSON(values)
|
|
241
|
+
const type = validateArray(values)
|
|
242
|
+
var result = '['
|
|
243
|
+
var stringified = values.map(_ => stringifyInline(_, type))
|
|
244
|
+
if (stringified.join(', ').length > 60 || /\n/.test(stringified)) {
|
|
245
|
+
result += '\n ' + stringified.join(',\n ') + '\n'
|
|
246
|
+
} else {
|
|
247
|
+
result += ' ' + stringified.join(', ') + (stringified.length > 0 ? ' ' : '')
|
|
248
|
+
}
|
|
249
|
+
return result + ']'
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function stringifyInlineTable (value) {
|
|
253
|
+
value = toJSON(value)
|
|
254
|
+
var result = []
|
|
255
|
+
Object.keys(value).forEach(key => {
|
|
256
|
+
result.push(stringifyKey(key) + ' = ' + stringifyAnyInline(value[key], false))
|
|
257
|
+
})
|
|
258
|
+
return '{ ' + result.join(', ') + (result.length > 0 ? ' ' : '') + '}'
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
function stringifyComplex (prefix, indent, key, value) {
|
|
262
|
+
var valueType = tomlType(value)
|
|
263
|
+
/* istanbul ignore else */
|
|
264
|
+
if (valueType === 'array') {
|
|
265
|
+
return stringifyArrayOfTables(prefix, indent, key, value)
|
|
266
|
+
} else if (valueType === 'table') {
|
|
267
|
+
return stringifyComplexTable(prefix, indent, key, value)
|
|
268
|
+
} else {
|
|
269
|
+
throw typeError(valueType)
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
function stringifyArrayOfTables (prefix, indent, key, values) {
|
|
274
|
+
values = toJSON(values)
|
|
275
|
+
validateArray(values)
|
|
276
|
+
var firstValueType = tomlType(values[0])
|
|
277
|
+
/* istanbul ignore if */
|
|
278
|
+
if (firstValueType !== 'table') throw typeError(firstValueType)
|
|
279
|
+
var fullKey = prefix + stringifyKey(key)
|
|
280
|
+
var result = ''
|
|
281
|
+
values.forEach(table => {
|
|
282
|
+
if (result.length > 0) result += '\n'
|
|
283
|
+
result += indent + '[[' + fullKey + ']]\n'
|
|
284
|
+
result += stringifyObject(fullKey + '.', indent, table)
|
|
285
|
+
})
|
|
286
|
+
return result
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
function stringifyComplexTable (prefix, indent, key, value) {
|
|
290
|
+
var fullKey = prefix + stringifyKey(key)
|
|
291
|
+
var result = ''
|
|
292
|
+
if (getInlineKeys(value).length > 0) {
|
|
293
|
+
result += indent + '[' + fullKey + ']\n'
|
|
294
|
+
}
|
|
295
|
+
return result + stringifyObject(fullKey + '.', indent, value)
|
|
296
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# @prismer/aip-sdk
|
|
2
|
+
|
|
3
|
+
TypeScript implementation of the standalone Agent Identity Protocol (AIP): Ed25519 `did:key` identity, byte signatures, direct delegation, and credential/presentation artifacts.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install @prismer/aip-sdk @noble/curves
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import { AIPIdentity } from '@prismer/aip-sdk';
|
|
11
|
+
|
|
12
|
+
const identity = await AIPIdentity.create();
|
|
13
|
+
const payload = new TextEncoder().encode('hello AIP');
|
|
14
|
+
const signature = await identity.sign(payload);
|
|
15
|
+
const valid = await AIPIdentity.verify(payload, signature, identity.did);
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Use `AIPIdentity.create()` for new identities and persist the exported private key securely. `fromApiKey()` remains deterministic for 2.x compatibility but is deprecated for new identity creation.
|
|
19
|
+
|
|
20
|
+
## CLI
|
|
21
|
+
|
|
22
|
+
The package publishes the `aip` binary:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npx --package @prismer/aip-sdk aip identity create
|
|
26
|
+
npx --package @prismer/aip-sdk aip resolve <did:key>
|
|
27
|
+
npx --package @prismer/aip-sdk aip verify <file> --sig <base64> --did <did:key>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Boundary
|
|
31
|
+
|
|
32
|
+
This package does not manage agent Runtime lifecycle, skills, memory, Cloud tasks, or Cloud transport. It does not currently implement `did:web`, zero-knowledge proofs, multi-hop chain policy, or StatusList processing.
|
|
33
|
+
|
|
34
|
+
TypeScript and Python (`prismer-aip`) are the supported implementations. Both consume the shared fixtures in `../fixtures` through `npm test` / Python pytest.
|
|
35
|
+
|
|
36
|
+
See the [protocol product README](../README.md) for delegation, credentials, conformance, and Prismer Cloud adoption details.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// src/did.ts
|
|
34
|
+
var ED25519_MULTICODEC = new Uint8Array([237, 1]);
|
|
35
|
+
var B58_ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
|
|
36
|
+
function base58Encode(bytes) {
|
|
37
|
+
const digits = [0];
|
|
38
|
+
for (const byte of bytes) {
|
|
39
|
+
let carry = byte;
|
|
40
|
+
for (let j = 0; j < digits.length; j++) {
|
|
41
|
+
carry += digits[j] << 8;
|
|
42
|
+
digits[j] = carry % 58;
|
|
43
|
+
carry = carry / 58 | 0;
|
|
44
|
+
}
|
|
45
|
+
while (carry > 0) {
|
|
46
|
+
digits.push(carry % 58);
|
|
47
|
+
carry = carry / 58 | 0;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
let output = "";
|
|
51
|
+
for (const byte of bytes) {
|
|
52
|
+
if (byte === 0) output += "1";
|
|
53
|
+
else break;
|
|
54
|
+
}
|
|
55
|
+
for (let i = digits.length - 1; i >= 0; i--) {
|
|
56
|
+
output += B58_ALPHABET[digits[i]];
|
|
57
|
+
}
|
|
58
|
+
return output;
|
|
59
|
+
}
|
|
60
|
+
function base58Decode(str) {
|
|
61
|
+
const bytes = [0];
|
|
62
|
+
for (const char of str) {
|
|
63
|
+
const index = B58_ALPHABET.indexOf(char);
|
|
64
|
+
if (index < 0) throw new Error(`Invalid base58 character: ${char}`);
|
|
65
|
+
let carry = index;
|
|
66
|
+
for (let j = 0; j < bytes.length; j++) {
|
|
67
|
+
carry += bytes[j] * 58;
|
|
68
|
+
bytes[j] = carry & 255;
|
|
69
|
+
carry >>= 8;
|
|
70
|
+
}
|
|
71
|
+
while (carry > 0) {
|
|
72
|
+
bytes.push(carry & 255);
|
|
73
|
+
carry >>= 8;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
for (const char of str) {
|
|
77
|
+
if (char === "1") bytes.push(0);
|
|
78
|
+
else break;
|
|
79
|
+
}
|
|
80
|
+
return new Uint8Array(bytes.reverse());
|
|
81
|
+
}
|
|
82
|
+
function publicKeyToDIDKey(pubBytes) {
|
|
83
|
+
if (pubBytes.length !== 32) throw new Error(`Expected 32 bytes, got ${pubBytes.length}`);
|
|
84
|
+
const mc = new Uint8Array(34);
|
|
85
|
+
mc.set(ED25519_MULTICODEC, 0);
|
|
86
|
+
mc.set(pubBytes, 2);
|
|
87
|
+
return `did:key:z${base58Encode(mc)}`;
|
|
88
|
+
}
|
|
89
|
+
function didKeyToPublicKey(did) {
|
|
90
|
+
if (!did.startsWith("did:key:z")) throw new Error("Invalid did:key format");
|
|
91
|
+
const decoded = base58Decode(did.slice(9));
|
|
92
|
+
if (decoded.length !== 34 || decoded[0] !== 237 || decoded[1] !== 1) {
|
|
93
|
+
throw new Error("Invalid did:key: wrong prefix or length");
|
|
94
|
+
}
|
|
95
|
+
return decoded.slice(2);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export {
|
|
99
|
+
__spreadValues,
|
|
100
|
+
__spreadProps,
|
|
101
|
+
__objRest,
|
|
102
|
+
publicKeyToDIDKey,
|
|
103
|
+
didKeyToPublicKey
|
|
104
|
+
};
|