@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,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 };
|
|
@@ -0,0 +1,322 @@
|
|
|
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
|
+
function validateDIDKey(did) {
|
|
98
|
+
try {
|
|
99
|
+
didKeyToPublicKey(did);
|
|
100
|
+
return true;
|
|
101
|
+
} catch (e) {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// src/identity.ts
|
|
107
|
+
var _ed25519 = null;
|
|
108
|
+
async function getEd25519() {
|
|
109
|
+
if (_ed25519) return _ed25519;
|
|
110
|
+
const mod = await import("@noble/curves/ed25519.js");
|
|
111
|
+
_ed25519 = mod.ed25519;
|
|
112
|
+
return _ed25519;
|
|
113
|
+
}
|
|
114
|
+
var AIPIdentity = class _AIPIdentity {
|
|
115
|
+
constructor(priv, pub, did) {
|
|
116
|
+
this.privateKey = priv;
|
|
117
|
+
this.publicKey = pub;
|
|
118
|
+
this.did = did;
|
|
119
|
+
}
|
|
120
|
+
static async create() {
|
|
121
|
+
const ed = await getEd25519();
|
|
122
|
+
const priv = ed.utils.randomSecretKey();
|
|
123
|
+
const pub = ed.getPublicKey(priv);
|
|
124
|
+
return new _AIPIdentity(priv, pub, publicKeyToDIDKey(pub));
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* @deprecated Compatibility derivation for existing Prismer Cloud identities.
|
|
128
|
+
* New applications should create and persist a random identity with create().
|
|
129
|
+
* The deterministic output remains unchanged throughout the 2.x release line.
|
|
130
|
+
*/
|
|
131
|
+
static async fromApiKey(apiKey) {
|
|
132
|
+
const ed = await getEd25519();
|
|
133
|
+
const keyBytes = new TextEncoder().encode(apiKey);
|
|
134
|
+
const hashBuffer = await crypto.subtle.digest("SHA-256", keyBytes);
|
|
135
|
+
const seed = new Uint8Array(hashBuffer);
|
|
136
|
+
const pub = ed.getPublicKey(seed);
|
|
137
|
+
return new _AIPIdentity(seed, pub, publicKeyToDIDKey(pub));
|
|
138
|
+
}
|
|
139
|
+
static async fromPrivateKey(key) {
|
|
140
|
+
const ed = await getEd25519();
|
|
141
|
+
const pub = ed.getPublicKey(key);
|
|
142
|
+
return new _AIPIdentity(key, pub, publicKeyToDIDKey(pub));
|
|
143
|
+
}
|
|
144
|
+
get publicKeyBase64() {
|
|
145
|
+
return typeof Buffer !== "undefined" ? Buffer.from(this.publicKey).toString("base64") : btoa(String.fromCharCode(...this.publicKey));
|
|
146
|
+
}
|
|
147
|
+
async sign(data) {
|
|
148
|
+
const ed = await getEd25519();
|
|
149
|
+
const sig = ed.sign(data, this.privateKey);
|
|
150
|
+
return typeof Buffer !== "undefined" ? Buffer.from(sig).toString("base64") : btoa(String.fromCharCode(...sig));
|
|
151
|
+
}
|
|
152
|
+
static async verify(data, sigB64, signerDid) {
|
|
153
|
+
try {
|
|
154
|
+
const ed = await getEd25519();
|
|
155
|
+
const pub = didKeyToPublicKey(signerDid);
|
|
156
|
+
const sig = typeof Buffer !== "undefined" ? new Uint8Array(Buffer.from(sigB64, "base64")) : new Uint8Array(
|
|
157
|
+
atob(sigB64).split("").map((c) => c.charCodeAt(0))
|
|
158
|
+
);
|
|
159
|
+
return ed.verify(sig, data, pub);
|
|
160
|
+
} catch (e) {
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
getDIDDocument(params) {
|
|
165
|
+
var _a, _b;
|
|
166
|
+
const keyId = `${this.did}#keys-1`;
|
|
167
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
168
|
+
const doc = {
|
|
169
|
+
"@context": ["https://www.w3.org/ns/did/v1", "https://w3id.org/security/suites/ed25519-2020/v1"],
|
|
170
|
+
id: this.did,
|
|
171
|
+
controller: this.did,
|
|
172
|
+
verificationMethod: [
|
|
173
|
+
{ id: keyId, type: "Ed25519VerificationKey2020", controller: this.did, publicKeyMultibase: this.did.slice(8) }
|
|
174
|
+
],
|
|
175
|
+
authentication: [keyId],
|
|
176
|
+
assertionMethod: [keyId],
|
|
177
|
+
capabilityDelegation: [keyId],
|
|
178
|
+
capabilityInvocation: [keyId],
|
|
179
|
+
created: now,
|
|
180
|
+
updated: now
|
|
181
|
+
};
|
|
182
|
+
if ((_a = params == null ? void 0 : params.services) == null ? void 0 : _a.length) {
|
|
183
|
+
doc.service = params.services.map((s, i) => ({
|
|
184
|
+
id: `${this.did}#service-${i}`,
|
|
185
|
+
type: s.type,
|
|
186
|
+
serviceEndpoint: s.endpoint
|
|
187
|
+
}));
|
|
188
|
+
}
|
|
189
|
+
if ((_b = params == null ? void 0 : params.capabilities) == null ? void 0 : _b.length) doc["aip:capabilities"] = params.capabilities;
|
|
190
|
+
return doc;
|
|
191
|
+
}
|
|
192
|
+
exportPrivateKey() {
|
|
193
|
+
return typeof Buffer !== "undefined" ? Buffer.from(this.privateKey).toString("base64") : btoa(String.fromCharCode(...this.privateKey));
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
// src/credentials.ts
|
|
198
|
+
async function buildCredential(params) {
|
|
199
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
200
|
+
const body = {
|
|
201
|
+
"@context": ["https://www.w3.org/ns/credentials/v2"],
|
|
202
|
+
type: ["VerifiableCredential", params.type],
|
|
203
|
+
issuer: params.issuer.did,
|
|
204
|
+
validFrom: now,
|
|
205
|
+
credentialSubject: __spreadValues({ id: params.holderDid }, params.claims)
|
|
206
|
+
};
|
|
207
|
+
const data = new TextEncoder().encode(JSON.stringify(body));
|
|
208
|
+
const proofValue = await params.issuer.sign(data);
|
|
209
|
+
return __spreadProps(__spreadValues({}, body), { proof: { type: "Ed25519Signature2020", verificationMethod: `${params.issuer.did}#keys-1`, proofPurpose: "assertionMethod", created: now, proofValue } });
|
|
210
|
+
}
|
|
211
|
+
async function buildPresentation(params) {
|
|
212
|
+
const body = {
|
|
213
|
+
"@context": ["https://www.w3.org/ns/credentials/v2"],
|
|
214
|
+
type: ["VerifiablePresentation"],
|
|
215
|
+
holder: params.holder.did,
|
|
216
|
+
verifiableCredential: params.credentials
|
|
217
|
+
};
|
|
218
|
+
const data = new TextEncoder().encode(JSON.stringify(body) + params.challenge);
|
|
219
|
+
const proofValue = await params.holder.sign(data);
|
|
220
|
+
return __spreadProps(__spreadValues({}, body), { proof: { type: "Ed25519Signature2020", verificationMethod: `${params.holder.did}#keys-1`, challenge: params.challenge, proofValue } });
|
|
221
|
+
}
|
|
222
|
+
async function verifyCredential(vc) {
|
|
223
|
+
const _a = vc, { proof } = _a, body = __objRest(_a, ["proof"]);
|
|
224
|
+
const data = new TextEncoder().encode(JSON.stringify(body));
|
|
225
|
+
return AIPIdentity.verify(data, proof.proofValue, vc.issuer);
|
|
226
|
+
}
|
|
227
|
+
async function verifyPresentation(vp, expectedChallenge) {
|
|
228
|
+
if (vp.proof.challenge !== expectedChallenge) return false;
|
|
229
|
+
const _a = vp, { proof } = _a, body = __objRest(_a, ["proof"]);
|
|
230
|
+
const data = new TextEncoder().encode(JSON.stringify(body) + expectedChallenge);
|
|
231
|
+
const holderValid = await AIPIdentity.verify(data, proof.proofValue, vp.holder);
|
|
232
|
+
if (!holderValid) return false;
|
|
233
|
+
for (const vc of vp.verifiableCredential) {
|
|
234
|
+
if (!await verifyCredential(vc)) return false;
|
|
235
|
+
}
|
|
236
|
+
return true;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// src/delegation.ts
|
|
240
|
+
async function buildDelegation(params) {
|
|
241
|
+
const now = /* @__PURE__ */ new Date();
|
|
242
|
+
const validUntil = params.validDays ? new Date(now.getTime() + params.validDays * 864e5) : void 0;
|
|
243
|
+
const body = __spreadProps(__spreadValues({
|
|
244
|
+
"@context": ["https://www.w3.org/ns/credentials/v2"],
|
|
245
|
+
type: ["VerifiableCredential", "AgentDelegation"],
|
|
246
|
+
issuer: params.issuer.did,
|
|
247
|
+
validFrom: now.toISOString()
|
|
248
|
+
}, validUntil && { validUntil: validUntil.toISOString() }), {
|
|
249
|
+
credentialSubject: __spreadValues({
|
|
250
|
+
id: params.subjectDid,
|
|
251
|
+
"aip:scope": params.scope
|
|
252
|
+
}, params.role && { "aip:role": params.role })
|
|
253
|
+
});
|
|
254
|
+
const data = new TextEncoder().encode(JSON.stringify(body));
|
|
255
|
+
const proofValue = await params.issuer.sign(data);
|
|
256
|
+
return __spreadProps(__spreadValues({}, body), { proof: { type: "Ed25519Signature2020", verificationMethod: `${params.issuer.did}#keys-1`, proofPurpose: "assertionMethod", created: now.toISOString(), proofValue } });
|
|
257
|
+
}
|
|
258
|
+
async function buildEphemeralDelegation(params) {
|
|
259
|
+
const now = /* @__PURE__ */ new Date();
|
|
260
|
+
const validUntil = new Date(now.getTime() + params.ttlSeconds * 1e3);
|
|
261
|
+
const nonce = Array.from(crypto.getRandomValues(new Uint8Array(16)), (b) => b.toString(16).padStart(2, "0")).join("");
|
|
262
|
+
const body = {
|
|
263
|
+
type: "EphemeralDelegation",
|
|
264
|
+
parentDid: params.parent.did,
|
|
265
|
+
sessionId: `sub_${nonce.slice(0, 8)}`,
|
|
266
|
+
scope: params.scope,
|
|
267
|
+
validFrom: now.toISOString(),
|
|
268
|
+
validUntil: validUntil.toISOString(),
|
|
269
|
+
nonce
|
|
270
|
+
};
|
|
271
|
+
const data = new TextEncoder().encode(JSON.stringify(body));
|
|
272
|
+
const proofValue = await params.parent.sign(data);
|
|
273
|
+
return __spreadProps(__spreadValues({}, body), { proof: { type: "Ed25519Signature2020", verificationMethod: `${params.parent.did}#keys-1`, proofValue } });
|
|
274
|
+
}
|
|
275
|
+
async function verifyDelegation(delegation) {
|
|
276
|
+
if (new Date(delegation.validFrom) > /* @__PURE__ */ new Date()) return false;
|
|
277
|
+
if (delegation.validUntil && new Date(delegation.validUntil) < /* @__PURE__ */ new Date()) return false;
|
|
278
|
+
const _a = delegation, { proof } = _a, body = __objRest(_a, ["proof"]);
|
|
279
|
+
const data = new TextEncoder().encode(JSON.stringify(body));
|
|
280
|
+
return AIPIdentity.verify(data, proof.proofValue, delegation.issuer);
|
|
281
|
+
}
|
|
282
|
+
async function verifyEphemeralDelegation(token) {
|
|
283
|
+
if (new Date(token.validUntil) < /* @__PURE__ */ new Date()) return false;
|
|
284
|
+
const _a = token, { proof } = _a, body = __objRest(_a, ["proof"]);
|
|
285
|
+
const data = new TextEncoder().encode(JSON.stringify(body));
|
|
286
|
+
return AIPIdentity.verify(data, proof.proofValue, token.parentDid);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// src/resolver.ts
|
|
290
|
+
var KeyResolver = class {
|
|
291
|
+
async resolve(did) {
|
|
292
|
+
if (!did.startsWith("did:key:")) {
|
|
293
|
+
throw new Error(`KeyResolver only supports did:key, got: ${did}`);
|
|
294
|
+
}
|
|
295
|
+
const pubBytes = didKeyToPublicKey(did);
|
|
296
|
+
const keyId = `${did}#keys-1`;
|
|
297
|
+
const multibase = did.slice(8);
|
|
298
|
+
return {
|
|
299
|
+
"@context": ["https://www.w3.org/ns/did/v1"],
|
|
300
|
+
id: did,
|
|
301
|
+
controller: did,
|
|
302
|
+
verificationMethod: [{ id: keyId, type: "Ed25519VerificationKey2020", controller: did, publicKeyMultibase: multibase }],
|
|
303
|
+
authentication: [keyId],
|
|
304
|
+
assertionMethod: [keyId]
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
export {
|
|
309
|
+
AIPIdentity,
|
|
310
|
+
KeyResolver,
|
|
311
|
+
buildCredential,
|
|
312
|
+
buildDelegation,
|
|
313
|
+
buildEphemeralDelegation,
|
|
314
|
+
buildPresentation,
|
|
315
|
+
didKeyToPublicKey,
|
|
316
|
+
publicKeyToDIDKey,
|
|
317
|
+
validateDIDKey,
|
|
318
|
+
verifyCredential,
|
|
319
|
+
verifyDelegation,
|
|
320
|
+
verifyEphemeralDelegation,
|
|
321
|
+
verifyPresentation
|
|
322
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@prismer/aip-sdk",
|
|
3
|
+
"version": "2.2.55",
|
|
4
|
+
"description": "Agent Identity Protocol (AIP) — standalone DID-based identity for AI Agents",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.cjs",
|
|
7
|
+
"module": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"bin": {
|
|
10
|
+
"aip": "./dist/cli/index.js"
|
|
11
|
+
},
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js",
|
|
16
|
+
"require": "./dist/index.cjs"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsup src/index.ts --format cjs,esm --dts && tsup src/cli/index.ts --format esm --out-dir dist/cli",
|
|
24
|
+
"test": "tsx test/aip.test.ts && tsx test/conformance.test.ts"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"@noble/curves": ">=1.0.0"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@noble/curves": "^2.0.1",
|
|
31
|
+
"@types/node": "^20.0.0",
|
|
32
|
+
"tsup": "^8.5.1",
|
|
33
|
+
"tsx": "^4.20.6",
|
|
34
|
+
"typescript": "^5.9.2"
|
|
35
|
+
},
|
|
36
|
+
"keywords": [
|
|
37
|
+
"aip",
|
|
38
|
+
"did",
|
|
39
|
+
"agent",
|
|
40
|
+
"identity",
|
|
41
|
+
"ed25519",
|
|
42
|
+
"verifiable-credentials"
|
|
43
|
+
],
|
|
44
|
+
"license": "MIT",
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "https://github.com/nicepkg/prismer-aip-sdk"
|
|
48
|
+
},
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"registry": "https://registry.npmjs.org/",
|
|
51
|
+
"access": "public"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
declare namespace ansiRegex {
|
|
2
|
+
interface Options {
|
|
3
|
+
/**
|
|
4
|
+
Match only the first ANSI escape.
|
|
5
|
+
|
|
6
|
+
@default false
|
|
7
|
+
*/
|
|
8
|
+
onlyFirst: boolean;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
Regular expression for matching ANSI escape codes.
|
|
14
|
+
|
|
15
|
+
@example
|
|
16
|
+
```
|
|
17
|
+
import ansiRegex = require('ansi-regex');
|
|
18
|
+
|
|
19
|
+
ansiRegex().test('\u001B[4mcake\u001B[0m');
|
|
20
|
+
//=> true
|
|
21
|
+
|
|
22
|
+
ansiRegex().test('cake');
|
|
23
|
+
//=> false
|
|
24
|
+
|
|
25
|
+
'\u001B[4mcake\u001B[0m'.match(ansiRegex());
|
|
26
|
+
//=> ['\u001B[4m', '\u001B[0m']
|
|
27
|
+
|
|
28
|
+
'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true}));
|
|
29
|
+
//=> ['\u001B[4m']
|
|
30
|
+
|
|
31
|
+
'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex());
|
|
32
|
+
//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007']
|
|
33
|
+
```
|
|
34
|
+
*/
|
|
35
|
+
declare function ansiRegex(options?: ansiRegex.Options): RegExp;
|
|
36
|
+
|
|
37
|
+
export = ansiRegex;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = ({onlyFirst = false} = {}) => {
|
|
4
|
+
const pattern = [
|
|
5
|
+
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
|
|
6
|
+
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'
|
|
7
|
+
].join('|');
|
|
8
|
+
|
|
9
|
+
return new RegExp(pattern, onlyFirst ? undefined : 'g');
|
|
10
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ansi-regex",
|
|
3
|
+
"version": "5.0.1",
|
|
4
|
+
"description": "Regular expression for matching ANSI escape codes",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "chalk/ansi-regex",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "Sindre Sorhus",
|
|
9
|
+
"email": "sindresorhus@gmail.com",
|
|
10
|
+
"url": "sindresorhus.com"
|
|
11
|
+
},
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=8"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"test": "xo && ava && tsd",
|
|
17
|
+
"view-supported": "node fixtures/view-codes.js"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"index.js",
|
|
21
|
+
"index.d.ts"
|
|
22
|
+
],
|
|
23
|
+
"keywords": [
|
|
24
|
+
"ansi",
|
|
25
|
+
"styles",
|
|
26
|
+
"color",
|
|
27
|
+
"colour",
|
|
28
|
+
"colors",
|
|
29
|
+
"terminal",
|
|
30
|
+
"console",
|
|
31
|
+
"cli",
|
|
32
|
+
"string",
|
|
33
|
+
"tty",
|
|
34
|
+
"escape",
|
|
35
|
+
"formatting",
|
|
36
|
+
"rgb",
|
|
37
|
+
"256",
|
|
38
|
+
"shell",
|
|
39
|
+
"xterm",
|
|
40
|
+
"command-line",
|
|
41
|
+
"text",
|
|
42
|
+
"regex",
|
|
43
|
+
"regexp",
|
|
44
|
+
"re",
|
|
45
|
+
"match",
|
|
46
|
+
"test",
|
|
47
|
+
"find",
|
|
48
|
+
"pattern"
|
|
49
|
+
],
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"ava": "^2.4.0",
|
|
52
|
+
"tsd": "^0.9.0",
|
|
53
|
+
"xo": "^0.25.3"
|
|
54
|
+
}
|
|
55
|
+
}
|