@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,368 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __defProps = Object.defineProperties;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
+
var __spreadValues = (a, b) => {
|
|
14
|
+
for (var prop in b || (b = {}))
|
|
15
|
+
if (__hasOwnProp.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
if (__getOwnPropSymbols)
|
|
18
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
+
if (__propIsEnum.call(b, prop))
|
|
20
|
+
__defNormalProp(a, prop, b[prop]);
|
|
21
|
+
}
|
|
22
|
+
return a;
|
|
23
|
+
};
|
|
24
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
+
var __objRest = (source, exclude) => {
|
|
26
|
+
var target = {};
|
|
27
|
+
for (var prop in source)
|
|
28
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
if (source != null && __getOwnPropSymbols)
|
|
31
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
+
target[prop] = source[prop];
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
};
|
|
37
|
+
var __export = (target, all) => {
|
|
38
|
+
for (var name in all)
|
|
39
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
40
|
+
};
|
|
41
|
+
var __copyProps = (to, from, except, desc) => {
|
|
42
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
43
|
+
for (let key of __getOwnPropNames(from))
|
|
44
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
45
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
46
|
+
}
|
|
47
|
+
return to;
|
|
48
|
+
};
|
|
49
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
50
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
51
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
52
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
53
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
54
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
55
|
+
mod
|
|
56
|
+
));
|
|
57
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
58
|
+
|
|
59
|
+
// src/index.ts
|
|
60
|
+
var index_exports = {};
|
|
61
|
+
__export(index_exports, {
|
|
62
|
+
AIPIdentity: () => AIPIdentity,
|
|
63
|
+
KeyResolver: () => KeyResolver,
|
|
64
|
+
buildCredential: () => buildCredential,
|
|
65
|
+
buildDelegation: () => buildDelegation,
|
|
66
|
+
buildEphemeralDelegation: () => buildEphemeralDelegation,
|
|
67
|
+
buildPresentation: () => buildPresentation,
|
|
68
|
+
didKeyToPublicKey: () => didKeyToPublicKey,
|
|
69
|
+
publicKeyToDIDKey: () => publicKeyToDIDKey,
|
|
70
|
+
validateDIDKey: () => validateDIDKey,
|
|
71
|
+
verifyCredential: () => verifyCredential,
|
|
72
|
+
verifyDelegation: () => verifyDelegation,
|
|
73
|
+
verifyEphemeralDelegation: () => verifyEphemeralDelegation,
|
|
74
|
+
verifyPresentation: () => verifyPresentation
|
|
75
|
+
});
|
|
76
|
+
module.exports = __toCommonJS(index_exports);
|
|
77
|
+
|
|
78
|
+
// src/did.ts
|
|
79
|
+
var ED25519_MULTICODEC = new Uint8Array([237, 1]);
|
|
80
|
+
var B58_ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
|
|
81
|
+
function base58Encode(bytes) {
|
|
82
|
+
const digits = [0];
|
|
83
|
+
for (const byte of bytes) {
|
|
84
|
+
let carry = byte;
|
|
85
|
+
for (let j = 0; j < digits.length; j++) {
|
|
86
|
+
carry += digits[j] << 8;
|
|
87
|
+
digits[j] = carry % 58;
|
|
88
|
+
carry = carry / 58 | 0;
|
|
89
|
+
}
|
|
90
|
+
while (carry > 0) {
|
|
91
|
+
digits.push(carry % 58);
|
|
92
|
+
carry = carry / 58 | 0;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
let output = "";
|
|
96
|
+
for (const byte of bytes) {
|
|
97
|
+
if (byte === 0) output += "1";
|
|
98
|
+
else break;
|
|
99
|
+
}
|
|
100
|
+
for (let i = digits.length - 1; i >= 0; i--) {
|
|
101
|
+
output += B58_ALPHABET[digits[i]];
|
|
102
|
+
}
|
|
103
|
+
return output;
|
|
104
|
+
}
|
|
105
|
+
function base58Decode(str) {
|
|
106
|
+
const bytes = [0];
|
|
107
|
+
for (const char of str) {
|
|
108
|
+
const index = B58_ALPHABET.indexOf(char);
|
|
109
|
+
if (index < 0) throw new Error(`Invalid base58 character: ${char}`);
|
|
110
|
+
let carry = index;
|
|
111
|
+
for (let j = 0; j < bytes.length; j++) {
|
|
112
|
+
carry += bytes[j] * 58;
|
|
113
|
+
bytes[j] = carry & 255;
|
|
114
|
+
carry >>= 8;
|
|
115
|
+
}
|
|
116
|
+
while (carry > 0) {
|
|
117
|
+
bytes.push(carry & 255);
|
|
118
|
+
carry >>= 8;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
for (const char of str) {
|
|
122
|
+
if (char === "1") bytes.push(0);
|
|
123
|
+
else break;
|
|
124
|
+
}
|
|
125
|
+
return new Uint8Array(bytes.reverse());
|
|
126
|
+
}
|
|
127
|
+
function publicKeyToDIDKey(pubBytes) {
|
|
128
|
+
if (pubBytes.length !== 32) throw new Error(`Expected 32 bytes, got ${pubBytes.length}`);
|
|
129
|
+
const mc = new Uint8Array(34);
|
|
130
|
+
mc.set(ED25519_MULTICODEC, 0);
|
|
131
|
+
mc.set(pubBytes, 2);
|
|
132
|
+
return `did:key:z${base58Encode(mc)}`;
|
|
133
|
+
}
|
|
134
|
+
function didKeyToPublicKey(did) {
|
|
135
|
+
if (!did.startsWith("did:key:z")) throw new Error("Invalid did:key format");
|
|
136
|
+
const decoded = base58Decode(did.slice(9));
|
|
137
|
+
if (decoded.length !== 34 || decoded[0] !== 237 || decoded[1] !== 1) {
|
|
138
|
+
throw new Error("Invalid did:key: wrong prefix or length");
|
|
139
|
+
}
|
|
140
|
+
return decoded.slice(2);
|
|
141
|
+
}
|
|
142
|
+
function validateDIDKey(did) {
|
|
143
|
+
try {
|
|
144
|
+
didKeyToPublicKey(did);
|
|
145
|
+
return true;
|
|
146
|
+
} catch (e) {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// src/identity.ts
|
|
152
|
+
var _ed25519 = null;
|
|
153
|
+
async function getEd25519() {
|
|
154
|
+
if (_ed25519) return _ed25519;
|
|
155
|
+
const mod = await import("@noble/curves/ed25519.js");
|
|
156
|
+
_ed25519 = mod.ed25519;
|
|
157
|
+
return _ed25519;
|
|
158
|
+
}
|
|
159
|
+
var AIPIdentity = class _AIPIdentity {
|
|
160
|
+
constructor(priv, pub, did) {
|
|
161
|
+
this.privateKey = priv;
|
|
162
|
+
this.publicKey = pub;
|
|
163
|
+
this.did = did;
|
|
164
|
+
}
|
|
165
|
+
static async create() {
|
|
166
|
+
const ed = await getEd25519();
|
|
167
|
+
const priv = ed.utils.randomSecretKey();
|
|
168
|
+
const pub = ed.getPublicKey(priv);
|
|
169
|
+
return new _AIPIdentity(priv, pub, publicKeyToDIDKey(pub));
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* @deprecated Compatibility derivation for existing Prismer Cloud identities.
|
|
173
|
+
* New applications should create and persist a random identity with create().
|
|
174
|
+
* The deterministic output remains unchanged throughout the 2.x release line.
|
|
175
|
+
*/
|
|
176
|
+
static async fromApiKey(apiKey) {
|
|
177
|
+
const ed = await getEd25519();
|
|
178
|
+
const keyBytes = new TextEncoder().encode(apiKey);
|
|
179
|
+
const hashBuffer = await crypto.subtle.digest("SHA-256", keyBytes);
|
|
180
|
+
const seed = new Uint8Array(hashBuffer);
|
|
181
|
+
const pub = ed.getPublicKey(seed);
|
|
182
|
+
return new _AIPIdentity(seed, pub, publicKeyToDIDKey(pub));
|
|
183
|
+
}
|
|
184
|
+
static async fromPrivateKey(key) {
|
|
185
|
+
const ed = await getEd25519();
|
|
186
|
+
const pub = ed.getPublicKey(key);
|
|
187
|
+
return new _AIPIdentity(key, pub, publicKeyToDIDKey(pub));
|
|
188
|
+
}
|
|
189
|
+
get publicKeyBase64() {
|
|
190
|
+
return typeof Buffer !== "undefined" ? Buffer.from(this.publicKey).toString("base64") : btoa(String.fromCharCode(...this.publicKey));
|
|
191
|
+
}
|
|
192
|
+
async sign(data) {
|
|
193
|
+
const ed = await getEd25519();
|
|
194
|
+
const sig = ed.sign(data, this.privateKey);
|
|
195
|
+
return typeof Buffer !== "undefined" ? Buffer.from(sig).toString("base64") : btoa(String.fromCharCode(...sig));
|
|
196
|
+
}
|
|
197
|
+
static async verify(data, sigB64, signerDid) {
|
|
198
|
+
try {
|
|
199
|
+
const ed = await getEd25519();
|
|
200
|
+
const pub = didKeyToPublicKey(signerDid);
|
|
201
|
+
const sig = typeof Buffer !== "undefined" ? new Uint8Array(Buffer.from(sigB64, "base64")) : new Uint8Array(
|
|
202
|
+
atob(sigB64).split("").map((c) => c.charCodeAt(0))
|
|
203
|
+
);
|
|
204
|
+
return ed.verify(sig, data, pub);
|
|
205
|
+
} catch (e) {
|
|
206
|
+
return false;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
getDIDDocument(params) {
|
|
210
|
+
var _a, _b;
|
|
211
|
+
const keyId = `${this.did}#keys-1`;
|
|
212
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
213
|
+
const doc = {
|
|
214
|
+
"@context": ["https://www.w3.org/ns/did/v1", "https://w3id.org/security/suites/ed25519-2020/v1"],
|
|
215
|
+
id: this.did,
|
|
216
|
+
controller: this.did,
|
|
217
|
+
verificationMethod: [
|
|
218
|
+
{ id: keyId, type: "Ed25519VerificationKey2020", controller: this.did, publicKeyMultibase: this.did.slice(8) }
|
|
219
|
+
],
|
|
220
|
+
authentication: [keyId],
|
|
221
|
+
assertionMethod: [keyId],
|
|
222
|
+
capabilityDelegation: [keyId],
|
|
223
|
+
capabilityInvocation: [keyId],
|
|
224
|
+
created: now,
|
|
225
|
+
updated: now
|
|
226
|
+
};
|
|
227
|
+
if ((_a = params == null ? void 0 : params.services) == null ? void 0 : _a.length) {
|
|
228
|
+
doc.service = params.services.map((s, i) => ({
|
|
229
|
+
id: `${this.did}#service-${i}`,
|
|
230
|
+
type: s.type,
|
|
231
|
+
serviceEndpoint: s.endpoint
|
|
232
|
+
}));
|
|
233
|
+
}
|
|
234
|
+
if ((_b = params == null ? void 0 : params.capabilities) == null ? void 0 : _b.length) doc["aip:capabilities"] = params.capabilities;
|
|
235
|
+
return doc;
|
|
236
|
+
}
|
|
237
|
+
exportPrivateKey() {
|
|
238
|
+
return typeof Buffer !== "undefined" ? Buffer.from(this.privateKey).toString("base64") : btoa(String.fromCharCode(...this.privateKey));
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
// src/credentials.ts
|
|
243
|
+
async function buildCredential(params) {
|
|
244
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
245
|
+
const body = {
|
|
246
|
+
"@context": ["https://www.w3.org/ns/credentials/v2"],
|
|
247
|
+
type: ["VerifiableCredential", params.type],
|
|
248
|
+
issuer: params.issuer.did,
|
|
249
|
+
validFrom: now,
|
|
250
|
+
credentialSubject: __spreadValues({ id: params.holderDid }, params.claims)
|
|
251
|
+
};
|
|
252
|
+
const data = new TextEncoder().encode(JSON.stringify(body));
|
|
253
|
+
const proofValue = await params.issuer.sign(data);
|
|
254
|
+
return __spreadProps(__spreadValues({}, body), { proof: { type: "Ed25519Signature2020", verificationMethod: `${params.issuer.did}#keys-1`, proofPurpose: "assertionMethod", created: now, proofValue } });
|
|
255
|
+
}
|
|
256
|
+
async function buildPresentation(params) {
|
|
257
|
+
const body = {
|
|
258
|
+
"@context": ["https://www.w3.org/ns/credentials/v2"],
|
|
259
|
+
type: ["VerifiablePresentation"],
|
|
260
|
+
holder: params.holder.did,
|
|
261
|
+
verifiableCredential: params.credentials
|
|
262
|
+
};
|
|
263
|
+
const data = new TextEncoder().encode(JSON.stringify(body) + params.challenge);
|
|
264
|
+
const proofValue = await params.holder.sign(data);
|
|
265
|
+
return __spreadProps(__spreadValues({}, body), { proof: { type: "Ed25519Signature2020", verificationMethod: `${params.holder.did}#keys-1`, challenge: params.challenge, proofValue } });
|
|
266
|
+
}
|
|
267
|
+
async function verifyCredential(vc) {
|
|
268
|
+
const _a = vc, { proof } = _a, body = __objRest(_a, ["proof"]);
|
|
269
|
+
const data = new TextEncoder().encode(JSON.stringify(body));
|
|
270
|
+
return AIPIdentity.verify(data, proof.proofValue, vc.issuer);
|
|
271
|
+
}
|
|
272
|
+
async function verifyPresentation(vp, expectedChallenge) {
|
|
273
|
+
if (vp.proof.challenge !== expectedChallenge) return false;
|
|
274
|
+
const _a = vp, { proof } = _a, body = __objRest(_a, ["proof"]);
|
|
275
|
+
const data = new TextEncoder().encode(JSON.stringify(body) + expectedChallenge);
|
|
276
|
+
const holderValid = await AIPIdentity.verify(data, proof.proofValue, vp.holder);
|
|
277
|
+
if (!holderValid) return false;
|
|
278
|
+
for (const vc of vp.verifiableCredential) {
|
|
279
|
+
if (!await verifyCredential(vc)) return false;
|
|
280
|
+
}
|
|
281
|
+
return true;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// src/delegation.ts
|
|
285
|
+
async function buildDelegation(params) {
|
|
286
|
+
const now = /* @__PURE__ */ new Date();
|
|
287
|
+
const validUntil = params.validDays ? new Date(now.getTime() + params.validDays * 864e5) : void 0;
|
|
288
|
+
const body = __spreadProps(__spreadValues({
|
|
289
|
+
"@context": ["https://www.w3.org/ns/credentials/v2"],
|
|
290
|
+
type: ["VerifiableCredential", "AgentDelegation"],
|
|
291
|
+
issuer: params.issuer.did,
|
|
292
|
+
validFrom: now.toISOString()
|
|
293
|
+
}, validUntil && { validUntil: validUntil.toISOString() }), {
|
|
294
|
+
credentialSubject: __spreadValues({
|
|
295
|
+
id: params.subjectDid,
|
|
296
|
+
"aip:scope": params.scope
|
|
297
|
+
}, params.role && { "aip:role": params.role })
|
|
298
|
+
});
|
|
299
|
+
const data = new TextEncoder().encode(JSON.stringify(body));
|
|
300
|
+
const proofValue = await params.issuer.sign(data);
|
|
301
|
+
return __spreadProps(__spreadValues({}, body), { proof: { type: "Ed25519Signature2020", verificationMethod: `${params.issuer.did}#keys-1`, proofPurpose: "assertionMethod", created: now.toISOString(), proofValue } });
|
|
302
|
+
}
|
|
303
|
+
async function buildEphemeralDelegation(params) {
|
|
304
|
+
const now = /* @__PURE__ */ new Date();
|
|
305
|
+
const validUntil = new Date(now.getTime() + params.ttlSeconds * 1e3);
|
|
306
|
+
const nonce = Array.from(crypto.getRandomValues(new Uint8Array(16)), (b) => b.toString(16).padStart(2, "0")).join("");
|
|
307
|
+
const body = {
|
|
308
|
+
type: "EphemeralDelegation",
|
|
309
|
+
parentDid: params.parent.did,
|
|
310
|
+
sessionId: `sub_${nonce.slice(0, 8)}`,
|
|
311
|
+
scope: params.scope,
|
|
312
|
+
validFrom: now.toISOString(),
|
|
313
|
+
validUntil: validUntil.toISOString(),
|
|
314
|
+
nonce
|
|
315
|
+
};
|
|
316
|
+
const data = new TextEncoder().encode(JSON.stringify(body));
|
|
317
|
+
const proofValue = await params.parent.sign(data);
|
|
318
|
+
return __spreadProps(__spreadValues({}, body), { proof: { type: "Ed25519Signature2020", verificationMethod: `${params.parent.did}#keys-1`, proofValue } });
|
|
319
|
+
}
|
|
320
|
+
async function verifyDelegation(delegation) {
|
|
321
|
+
if (new Date(delegation.validFrom) > /* @__PURE__ */ new Date()) return false;
|
|
322
|
+
if (delegation.validUntil && new Date(delegation.validUntil) < /* @__PURE__ */ new Date()) return false;
|
|
323
|
+
const _a = delegation, { proof } = _a, body = __objRest(_a, ["proof"]);
|
|
324
|
+
const data = new TextEncoder().encode(JSON.stringify(body));
|
|
325
|
+
return AIPIdentity.verify(data, proof.proofValue, delegation.issuer);
|
|
326
|
+
}
|
|
327
|
+
async function verifyEphemeralDelegation(token) {
|
|
328
|
+
if (new Date(token.validUntil) < /* @__PURE__ */ new Date()) return false;
|
|
329
|
+
const _a = token, { proof } = _a, body = __objRest(_a, ["proof"]);
|
|
330
|
+
const data = new TextEncoder().encode(JSON.stringify(body));
|
|
331
|
+
return AIPIdentity.verify(data, proof.proofValue, token.parentDid);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
// src/resolver.ts
|
|
335
|
+
var KeyResolver = class {
|
|
336
|
+
async resolve(did) {
|
|
337
|
+
if (!did.startsWith("did:key:")) {
|
|
338
|
+
throw new Error(`KeyResolver only supports did:key, got: ${did}`);
|
|
339
|
+
}
|
|
340
|
+
const pubBytes = didKeyToPublicKey(did);
|
|
341
|
+
const keyId = `${did}#keys-1`;
|
|
342
|
+
const multibase = did.slice(8);
|
|
343
|
+
return {
|
|
344
|
+
"@context": ["https://www.w3.org/ns/did/v1"],
|
|
345
|
+
id: did,
|
|
346
|
+
controller: did,
|
|
347
|
+
verificationMethod: [{ id: keyId, type: "Ed25519VerificationKey2020", controller: did, publicKeyMultibase: multibase }],
|
|
348
|
+
authentication: [keyId],
|
|
349
|
+
assertionMethod: [keyId]
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
354
|
+
0 && (module.exports = {
|
|
355
|
+
AIPIdentity,
|
|
356
|
+
KeyResolver,
|
|
357
|
+
buildCredential,
|
|
358
|
+
buildDelegation,
|
|
359
|
+
buildEphemeralDelegation,
|
|
360
|
+
buildPresentation,
|
|
361
|
+
didKeyToPublicKey,
|
|
362
|
+
publicKeyToDIDKey,
|
|
363
|
+
validateDIDKey,
|
|
364
|
+
verifyCredential,
|
|
365
|
+
verifyDelegation,
|
|
366
|
+
verifyEphemeralDelegation,
|
|
367
|
+
verifyPresentation
|
|
368
|
+
});
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AIPIdentity — standalone DID identity class (no platform dependency)
|
|
3
|
+
*/
|
|
4
|
+
interface DIDDocument {
|
|
5
|
+
'@context': string[];
|
|
6
|
+
id: string;
|
|
7
|
+
controller: string;
|
|
8
|
+
verificationMethod: {
|
|
9
|
+
id: string;
|
|
10
|
+
type: string;
|
|
11
|
+
controller: string;
|
|
12
|
+
publicKeyMultibase: string;
|
|
13
|
+
}[];
|
|
14
|
+
authentication: string[];
|
|
15
|
+
assertionMethod: string[];
|
|
16
|
+
capabilityDelegation: string[];
|
|
17
|
+
capabilityInvocation: string[];
|
|
18
|
+
service?: {
|
|
19
|
+
id: string;
|
|
20
|
+
type: string;
|
|
21
|
+
serviceEndpoint: string;
|
|
22
|
+
}[];
|
|
23
|
+
'aip:capabilities'?: string[];
|
|
24
|
+
created: string;
|
|
25
|
+
updated: string;
|
|
26
|
+
}
|
|
27
|
+
interface SignedPayload {
|
|
28
|
+
senderDid: string;
|
|
29
|
+
signature: string;
|
|
30
|
+
payload: Uint8Array;
|
|
31
|
+
}
|
|
32
|
+
declare class AIPIdentity {
|
|
33
|
+
readonly did: string;
|
|
34
|
+
readonly publicKey: Uint8Array;
|
|
35
|
+
private readonly privateKey;
|
|
36
|
+
private constructor();
|
|
37
|
+
static create(): Promise<AIPIdentity>;
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Compatibility derivation for existing Prismer Cloud identities.
|
|
40
|
+
* New applications should create and persist a random identity with create().
|
|
41
|
+
* The deterministic output remains unchanged throughout the 2.x release line.
|
|
42
|
+
*/
|
|
43
|
+
static fromApiKey(apiKey: string): Promise<AIPIdentity>;
|
|
44
|
+
static fromPrivateKey(key: Uint8Array): Promise<AIPIdentity>;
|
|
45
|
+
get publicKeyBase64(): string;
|
|
46
|
+
sign(data: Uint8Array): Promise<string>;
|
|
47
|
+
static verify(data: Uint8Array, sigB64: string, signerDid: string): Promise<boolean>;
|
|
48
|
+
getDIDDocument(params?: {
|
|
49
|
+
services?: {
|
|
50
|
+
type: string;
|
|
51
|
+
endpoint: string;
|
|
52
|
+
}[];
|
|
53
|
+
capabilities?: string[];
|
|
54
|
+
}): DIDDocument;
|
|
55
|
+
exportPrivateKey(): string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Verifiable Credentials and Presentations (W3C VC Data Model v2)
|
|
60
|
+
*/
|
|
61
|
+
|
|
62
|
+
interface VerifiableCredential {
|
|
63
|
+
'@context': string[];
|
|
64
|
+
type: string[];
|
|
65
|
+
issuer: string;
|
|
66
|
+
validFrom: string;
|
|
67
|
+
credentialSubject: {
|
|
68
|
+
id: string;
|
|
69
|
+
[key: string]: any;
|
|
70
|
+
};
|
|
71
|
+
proof: {
|
|
72
|
+
type: string;
|
|
73
|
+
verificationMethod: string;
|
|
74
|
+
proofPurpose: string;
|
|
75
|
+
created: string;
|
|
76
|
+
proofValue: string;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
interface VerifiablePresentation {
|
|
80
|
+
'@context': string[];
|
|
81
|
+
type: string[];
|
|
82
|
+
holder: string;
|
|
83
|
+
verifiableCredential: VerifiableCredential[];
|
|
84
|
+
proof: {
|
|
85
|
+
type: string;
|
|
86
|
+
verificationMethod: string;
|
|
87
|
+
challenge: string;
|
|
88
|
+
proofValue: string;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
declare function buildCredential(params: {
|
|
92
|
+
issuer: AIPIdentity;
|
|
93
|
+
holderDid: string;
|
|
94
|
+
type: string;
|
|
95
|
+
claims: Record<string, any>;
|
|
96
|
+
}): Promise<VerifiableCredential>;
|
|
97
|
+
declare function buildPresentation(params: {
|
|
98
|
+
holder: AIPIdentity;
|
|
99
|
+
credentials: VerifiableCredential[];
|
|
100
|
+
challenge: string;
|
|
101
|
+
}): Promise<VerifiablePresentation>;
|
|
102
|
+
declare function verifyCredential(vc: VerifiableCredential): Promise<boolean>;
|
|
103
|
+
declare function verifyPresentation(vp: VerifiablePresentation, expectedChallenge: string): Promise<boolean>;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Verifiable and Ephemeral Delegations
|
|
107
|
+
*/
|
|
108
|
+
|
|
109
|
+
interface VerifiableDelegation {
|
|
110
|
+
'@context': string[];
|
|
111
|
+
type: string[];
|
|
112
|
+
issuer: string;
|
|
113
|
+
validFrom: string;
|
|
114
|
+
validUntil?: string;
|
|
115
|
+
credentialSubject: {
|
|
116
|
+
id: string;
|
|
117
|
+
'aip:scope': string[];
|
|
118
|
+
'aip:role'?: string;
|
|
119
|
+
};
|
|
120
|
+
proof: {
|
|
121
|
+
type: string;
|
|
122
|
+
verificationMethod: string;
|
|
123
|
+
proofPurpose: string;
|
|
124
|
+
created: string;
|
|
125
|
+
proofValue: string;
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
interface EphemeralDelegation {
|
|
129
|
+
type: 'EphemeralDelegation';
|
|
130
|
+
parentDid: string;
|
|
131
|
+
sessionId: string;
|
|
132
|
+
scope: string[];
|
|
133
|
+
validFrom: string;
|
|
134
|
+
validUntil: string;
|
|
135
|
+
nonce: string;
|
|
136
|
+
proof: {
|
|
137
|
+
type: string;
|
|
138
|
+
verificationMethod: string;
|
|
139
|
+
proofValue: string;
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
declare function buildDelegation(params: {
|
|
143
|
+
issuer: AIPIdentity;
|
|
144
|
+
subjectDid: string;
|
|
145
|
+
scope: string[];
|
|
146
|
+
role?: string;
|
|
147
|
+
validDays?: number;
|
|
148
|
+
}): Promise<VerifiableDelegation>;
|
|
149
|
+
declare function buildEphemeralDelegation(params: {
|
|
150
|
+
parent: AIPIdentity;
|
|
151
|
+
scope: string[];
|
|
152
|
+
ttlSeconds: number;
|
|
153
|
+
}): Promise<EphemeralDelegation>;
|
|
154
|
+
declare function verifyDelegation(delegation: VerifiableDelegation): Promise<boolean>;
|
|
155
|
+
declare function verifyEphemeralDelegation(token: EphemeralDelegation): Promise<boolean>;
|
|
156
|
+
|
|
157
|
+
declare function publicKeyToDIDKey(pubBytes: Uint8Array): string;
|
|
158
|
+
declare function didKeyToPublicKey(did: string): Uint8Array;
|
|
159
|
+
declare function validateDIDKey(did: string): boolean;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* DID Resolver — resolve did:key locally, did:web via HTTPS
|
|
163
|
+
*/
|
|
164
|
+
interface DIDResolver {
|
|
165
|
+
resolve(did: string): Promise<any>;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* KeyResolver — resolves did:key locally (no network).
|
|
169
|
+
*/
|
|
170
|
+
declare class KeyResolver implements DIDResolver {
|
|
171
|
+
resolve(did: string): Promise<any>;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export { AIPIdentity, type DIDDocument, type DIDResolver, type EphemeralDelegation, KeyResolver, type SignedPayload, type VerifiableCredential, type VerifiableDelegation, type VerifiablePresentation, buildCredential, buildDelegation, buildEphemeralDelegation, buildPresentation, didKeyToPublicKey, publicKeyToDIDKey, validateDIDKey, verifyCredential, verifyDelegation, verifyEphemeralDelegation, verifyPresentation };
|