ali-skills 0.0.21 → 0.0.23
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/node_modules/@ali/cli-skills/dist/cli.mjs +1410 -316
- package/node_modules/@ali/cli-skills/package.json +5 -2
- package/node_modules/@ali/o2-open-client/.editorconfig +11 -0
- package/node_modules/@ali/o2-open-client/README.md +80 -0
- package/node_modules/@ali/o2-open-client/abc.json +8 -0
- package/node_modules/@ali/o2-open-client/es/browser/ee.d.ts +23 -0
- package/node_modules/@ali/o2-open-client/es/browser/ee.js +82 -0
- package/node_modules/@ali/o2-open-client/es/browser/entry.d.ts +32 -0
- package/node_modules/@ali/o2-open-client/es/browser/entry.js +306 -0
- package/node_modules/@ali/o2-open-client/es/browser/escape.d.ts +12 -0
- package/node_modules/@ali/o2-open-client/es/browser/escape.js +178 -0
- package/node_modules/@ali/o2-open-client/es/browser/fetch.d.ts +1 -0
- package/node_modules/@ali/o2-open-client/es/browser/fetch.js +14 -0
- package/node_modules/@ali/o2-open-client/es/browser/index.d.ts +1 -0
- package/node_modules/@ali/o2-open-client/es/browser/index.js +1 -0
- package/node_modules/@ali/o2-open-client/es/common/constant.d.ts +42 -0
- package/node_modules/@ali/o2-open-client/es/common/constant.js +53 -0
- package/node_modules/@ali/o2-open-client/es/common/format.d.ts +14 -0
- package/node_modules/@ali/o2-open-client/es/common/format.js +43 -0
- package/node_modules/@ali/o2-open-client/es/common/service-meta.d.ts +33 -0
- package/node_modules/@ali/o2-open-client/es/common/service-meta.js +33 -0
- package/node_modules/@ali/o2-open-client/es/index.d.ts +1 -0
- package/node_modules/@ali/o2-open-client/es/index.js +8 -0
- package/node_modules/@ali/o2-open-client/es/node/config.d.ts +47 -0
- package/node_modules/@ali/o2-open-client/es/node/config.js +188 -0
- package/node_modules/@ali/o2-open-client/es/node/escape.d.ts +22 -0
- package/node_modules/@ali/o2-open-client/es/node/escape.js +131 -0
- package/node_modules/@ali/o2-open-client/es/node/help.d.ts +10 -0
- package/node_modules/@ali/o2-open-client/es/node/help.js +96 -0
- package/node_modules/@ali/o2-open-client/es/node/index.d.ts +48 -0
- package/node_modules/@ali/o2-open-client/es/node/index.js +247 -0
- package/node_modules/@ali/o2-open-client/es/node/token-handler.d.ts +1 -0
- package/node_modules/@ali/o2-open-client/es/node/token-handler.js +21 -0
- package/node_modules/@ali/o2-open-client/lib/browser/ee.d.ts +23 -0
- package/node_modules/@ali/o2-open-client/lib/browser/ee.js +86 -0
- package/node_modules/@ali/o2-open-client/lib/browser/entry.d.ts +32 -0
- package/node_modules/@ali/o2-open-client/lib/browser/entry.js +310 -0
- package/node_modules/@ali/o2-open-client/lib/browser/escape.d.ts +12 -0
- package/node_modules/@ali/o2-open-client/lib/browser/escape.js +185 -0
- package/node_modules/@ali/o2-open-client/lib/browser/fetch.d.ts +1 -0
- package/node_modules/@ali/o2-open-client/lib/browser/fetch.js +18 -0
- package/node_modules/@ali/o2-open-client/lib/common/constant.d.ts +42 -0
- package/node_modules/@ali/o2-open-client/lib/common/constant.js +56 -0
- package/node_modules/@ali/o2-open-client/lib/common/format.d.ts +14 -0
- package/node_modules/@ali/o2-open-client/lib/common/format.js +48 -0
- package/node_modules/@ali/o2-open-client/lib/common/service-meta.d.ts +33 -0
- package/node_modules/@ali/o2-open-client/lib/common/service-meta.js +36 -0
- package/node_modules/@ali/o2-open-client/lib/index.d.ts +1 -0
- package/node_modules/@ali/o2-open-client/lib/index.js +20 -0
- package/node_modules/@ali/o2-open-client/lib/node/config.d.ts +47 -0
- package/node_modules/@ali/o2-open-client/lib/node/config.js +192 -0
- package/node_modules/@ali/o2-open-client/lib/node/escape.d.ts +22 -0
- package/node_modules/@ali/o2-open-client/lib/node/escape.js +137 -0
- package/node_modules/@ali/o2-open-client/lib/node/help.d.ts +10 -0
- package/node_modules/@ali/o2-open-client/lib/node/help.js +100 -0
- package/node_modules/@ali/o2-open-client/lib/node/index.d.ts +48 -0
- package/node_modules/@ali/o2-open-client/lib/node/index.js +250 -0
- package/node_modules/@ali/o2-open-client/lib/node/token-handler.d.ts +1 -0
- package/node_modules/@ali/o2-open-client/lib/node/token-handler.js +25 -0
- package/node_modules/@ali/o2-open-client/package.json +46 -0
- package/node_modules/@ali/o2-open-client/playwright.config.ts +54 -0
- package/node_modules/@ali/o2-open-client/tsconfig.es.json +31 -0
- package/node_modules/@ali/o2-open-client/tsconfig.json +31 -0
- package/node_modules/@ali/o2-open-client/tsx2doc.config.js +5 -0
- package/node_modules/@ali/o2-open-client/typings/index.d.ts +36 -0
- package/node_modules/@types/node/LICENSE +21 -0
- package/node_modules/@types/node/README.md +15 -0
- package/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/node_modules/@types/node/assert.d.ts +1062 -0
- package/node_modules/@types/node/async_hooks.d.ts +605 -0
- package/node_modules/@types/node/buffer.buffer.d.ts +471 -0
- package/node_modules/@types/node/buffer.d.ts +1936 -0
- package/node_modules/@types/node/child_process.d.ts +1475 -0
- package/node_modules/@types/node/cluster.d.ts +577 -0
- package/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
- package/node_modules/@types/node/compatibility/index.d.ts +9 -0
- package/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
- package/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
- package/node_modules/@types/node/console.d.ts +452 -0
- package/node_modules/@types/node/constants.d.ts +21 -0
- package/node_modules/@types/node/crypto.d.ts +4590 -0
- package/node_modules/@types/node/dgram.d.ts +597 -0
- package/node_modules/@types/node/diagnostics_channel.d.ts +578 -0
- package/node_modules/@types/node/dns/promises.d.ts +479 -0
- package/node_modules/@types/node/dns.d.ts +871 -0
- package/node_modules/@types/node/domain.d.ts +170 -0
- package/node_modules/@types/node/events.d.ts +977 -0
- package/node_modules/@types/node/fs/promises.d.ts +1270 -0
- package/node_modules/@types/node/fs.d.ts +4375 -0
- package/node_modules/@types/node/globals.d.ts +172 -0
- package/node_modules/@types/node/globals.typedarray.d.ts +38 -0
- package/node_modules/@types/node/http.d.ts +2049 -0
- package/node_modules/@types/node/http2.d.ts +2631 -0
- package/node_modules/@types/node/https.d.ts +578 -0
- package/node_modules/@types/node/index.d.ts +93 -0
- package/node_modules/@types/node/inspector.generated.d.ts +3966 -0
- package/node_modules/@types/node/module.d.ts +539 -0
- package/node_modules/@types/node/net.d.ts +1031 -0
- package/node_modules/@types/node/os.d.ts +506 -0
- package/node_modules/@types/node/package.json +140 -0
- package/node_modules/@types/node/path.d.ts +200 -0
- package/node_modules/@types/node/perf_hooks.d.ts +961 -0
- package/node_modules/@types/node/process.d.ts +1961 -0
- package/node_modules/@types/node/punycode.d.ts +117 -0
- package/node_modules/@types/node/querystring.d.ts +152 -0
- package/node_modules/@types/node/readline/promises.d.ts +162 -0
- package/node_modules/@types/node/readline.d.ts +589 -0
- package/node_modules/@types/node/repl.d.ts +430 -0
- package/node_modules/@types/node/sea.d.ts +153 -0
- package/node_modules/@types/node/stream/consumers.d.ts +38 -0
- package/node_modules/@types/node/stream/promises.d.ts +90 -0
- package/node_modules/@types/node/stream/web.d.ts +533 -0
- package/node_modules/@types/node/stream.d.ts +1698 -0
- package/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/node_modules/@types/node/test.d.ts +1787 -0
- package/node_modules/@types/node/timers/promises.d.ts +108 -0
- package/node_modules/@types/node/timers.d.ts +286 -0
- package/node_modules/@types/node/tls.d.ts +1259 -0
- package/node_modules/@types/node/trace_events.d.ts +197 -0
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +468 -0
- package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +34 -0
- package/node_modules/@types/node/ts5.6/index.d.ts +93 -0
- package/node_modules/@types/node/tty.d.ts +208 -0
- package/node_modules/@types/node/url.d.ts +964 -0
- package/node_modules/@types/node/util.d.ts +2331 -0
- package/node_modules/@types/node/v8.d.ts +809 -0
- package/node_modules/@types/node/vm.d.ts +1001 -0
- package/node_modules/@types/node/wasi.d.ts +181 -0
- package/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
- package/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/node_modules/@types/node/web-globals/events.d.ts +97 -0
- package/node_modules/@types/node/web-globals/fetch.d.ts +55 -0
- package/node_modules/@types/node/worker_threads.d.ts +715 -0
- package/node_modules/@types/node/zlib.d.ts +598 -0
- package/node_modules/ansi-styles/index.d.ts +345 -0
- package/node_modules/ansi-styles/index.js +163 -0
- package/node_modules/ansi-styles/license +9 -0
- package/node_modules/ansi-styles/package.json +56 -0
- package/node_modules/ansi-styles/readme.md +152 -0
- package/node_modules/await-event/LICENSE +22 -0
- package/node_modules/await-event/README.md +48 -0
- package/node_modules/await-event/index.js +13 -0
- package/node_modules/await-event/package.json +33 -0
- package/node_modules/await-first/LICENSE +21 -0
- package/node_modules/await-first/README.md +80 -0
- package/node_modules/await-first/lib/index.js +21 -0
- package/node_modules/await-first/package.json +49 -0
- package/node_modules/byte/LICENSE.txt +21 -0
- package/node_modules/byte/README.md +207 -0
- package/node_modules/byte/lib/byte.js +635 -0
- package/node_modules/byte/lib/number.js +82 -0
- package/node_modules/byte/package.json +61 -0
- package/node_modules/chalk/index.d.ts +415 -0
- package/node_modules/chalk/license +9 -0
- package/node_modules/chalk/package.json +68 -0
- package/node_modules/chalk/readme.md +341 -0
- package/node_modules/chalk/source/index.js +229 -0
- package/node_modules/chalk/source/templates.js +134 -0
- package/node_modules/chalk/source/util.js +39 -0
- package/node_modules/circular-json-for-egg/LICENSE.txt +19 -0
- package/node_modules/circular-json-for-egg/README.md +148 -0
- package/node_modules/circular-json-for-egg/build/circular-json.amd.js +2 -0
- package/node_modules/circular-json-for-egg/build/circular-json.js +2 -0
- package/node_modules/circular-json-for-egg/build/circular-json.max.amd.js +210 -0
- package/node_modules/circular-json-for-egg/build/circular-json.max.js +210 -0
- package/node_modules/circular-json-for-egg/build/circular-json.node.js +207 -0
- package/node_modules/circular-json-for-egg/package.json +42 -0
- package/node_modules/cluster-client/LICENSE +21 -0
- package/node_modules/cluster-client/README.md +319 -0
- package/node_modules/cluster-client/index.js +66 -0
- package/node_modules/cluster-client/lib/api_client.js +74 -0
- package/node_modules/cluster-client/lib/connection.js +180 -0
- package/node_modules/cluster-client/lib/const.js +5 -0
- package/node_modules/cluster-client/lib/default_logger.js +11 -0
- package/node_modules/cluster-client/lib/default_transcode.js +6 -0
- package/node_modules/cluster-client/lib/follower.js +331 -0
- package/node_modules/cluster-client/lib/index.js +213 -0
- package/node_modules/cluster-client/lib/leader.js +437 -0
- package/node_modules/cluster-client/lib/protocol/byte_buffer.js +8 -0
- package/node_modules/cluster-client/lib/protocol/packet.js +103 -0
- package/node_modules/cluster-client/lib/protocol/request.js +17 -0
- package/node_modules/cluster-client/lib/protocol/response.js +14 -0
- package/node_modules/cluster-client/lib/server.js +256 -0
- package/node_modules/cluster-client/lib/symbol.js +20 -0
- package/node_modules/cluster-client/lib/utils.js +103 -0
- package/node_modules/cluster-client/lib/wrapper/base.js +210 -0
- package/node_modules/cluster-client/lib/wrapper/cluster.js +57 -0
- package/node_modules/cluster-client/lib/wrapper/single.js +192 -0
- package/node_modules/cluster-client/package.json +60 -0
- package/node_modules/co/LICENSE +22 -0
- package/node_modules/co/Readme.md +212 -0
- package/node_modules/co/index.js +237 -0
- package/node_modules/co/package.json +34 -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/core-util-is/LICENSE +19 -0
- package/node_modules/core-util-is/README.md +3 -0
- package/node_modules/core-util-is/lib/util.js +107 -0
- package/node_modules/core-util-is/package.json +38 -0
- package/node_modules/debug/LICENSE +20 -0
- package/node_modules/debug/README.md +481 -0
- package/node_modules/debug/package.json +64 -0
- package/node_modules/debug/src/browser.js +272 -0
- package/node_modules/debug/src/common.js +292 -0
- package/node_modules/debug/src/index.js +10 -0
- package/node_modules/debug/src/node.js +263 -0
- package/node_modules/depd/History.md +103 -0
- package/node_modules/depd/LICENSE +22 -0
- package/node_modules/depd/Readme.md +280 -0
- package/node_modules/depd/index.js +538 -0
- package/node_modules/depd/lib/browser/index.js +77 -0
- package/node_modules/depd/package.json +45 -0
- package/node_modules/ee-first/LICENSE +22 -0
- package/node_modules/ee-first/README.md +80 -0
- package/node_modules/ee-first/index.js +95 -0
- package/node_modules/ee-first/package.json +29 -0
- package/node_modules/egg-errors/LICENSE +21 -0
- package/node_modules/egg-errors/README.md +259 -0
- package/node_modules/egg-errors/lib/base.d.ts +10 -0
- package/node_modules/egg-errors/lib/base.js +28 -0
- package/node_modules/egg-errors/lib/base_error.d.ts +6 -0
- package/node_modules/egg-errors/lib/base_error.js +13 -0
- package/node_modules/egg-errors/lib/base_exception.d.ts +6 -0
- package/node_modules/egg-errors/lib/base_exception.js +13 -0
- package/node_modules/egg-errors/lib/error.d.ts +6 -0
- package/node_modules/egg-errors/lib/error.js +13 -0
- package/node_modules/egg-errors/lib/error_options.d.ts +5 -0
- package/node_modules/egg-errors/lib/error_options.js +6 -0
- package/node_modules/egg-errors/lib/error_type.d.ts +6 -0
- package/node_modules/egg-errors/lib/error_type.js +10 -0
- package/node_modules/egg-errors/lib/exception.d.ts +6 -0
- package/node_modules/egg-errors/lib/exception.js +13 -0
- package/node_modules/egg-errors/lib/framework/formatter.d.ts +6 -0
- package/node_modules/egg-errors/lib/framework/formatter.js +29 -0
- package/node_modules/egg-errors/lib/framework/framework_base_error.d.ts +10 -0
- package/node_modules/egg-errors/lib/framework/framework_base_error.js +32 -0
- package/node_modules/egg-errors/lib/http/400.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/400.js +13 -0
- package/node_modules/egg-errors/lib/http/401.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/401.js +13 -0
- package/node_modules/egg-errors/lib/http/402.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/402.js +13 -0
- package/node_modules/egg-errors/lib/http/403.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/403.js +13 -0
- package/node_modules/egg-errors/lib/http/404.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/404.js +13 -0
- package/node_modules/egg-errors/lib/http/405.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/405.js +13 -0
- package/node_modules/egg-errors/lib/http/406.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/406.js +13 -0
- package/node_modules/egg-errors/lib/http/407.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/407.js +13 -0
- package/node_modules/egg-errors/lib/http/408.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/408.js +13 -0
- package/node_modules/egg-errors/lib/http/409.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/409.js +13 -0
- package/node_modules/egg-errors/lib/http/410.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/410.js +13 -0
- package/node_modules/egg-errors/lib/http/411.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/411.js +13 -0
- package/node_modules/egg-errors/lib/http/412.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/412.js +13 -0
- package/node_modules/egg-errors/lib/http/413.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/413.js +13 -0
- package/node_modules/egg-errors/lib/http/414.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/414.js +13 -0
- package/node_modules/egg-errors/lib/http/415.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/415.js +13 -0
- package/node_modules/egg-errors/lib/http/416.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/416.js +13 -0
- package/node_modules/egg-errors/lib/http/417.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/417.js +13 -0
- package/node_modules/egg-errors/lib/http/418.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/418.js +13 -0
- package/node_modules/egg-errors/lib/http/421.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/421.js +13 -0
- package/node_modules/egg-errors/lib/http/422.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/422.js +13 -0
- package/node_modules/egg-errors/lib/http/423.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/423.js +13 -0
- package/node_modules/egg-errors/lib/http/424.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/424.js +13 -0
- package/node_modules/egg-errors/lib/http/425.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/425.js +13 -0
- package/node_modules/egg-errors/lib/http/426.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/426.js +13 -0
- package/node_modules/egg-errors/lib/http/428.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/428.js +13 -0
- package/node_modules/egg-errors/lib/http/429.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/429.js +13 -0
- package/node_modules/egg-errors/lib/http/431.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/431.js +13 -0
- package/node_modules/egg-errors/lib/http/451.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/451.js +13 -0
- package/node_modules/egg-errors/lib/http/500.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/500.js +13 -0
- package/node_modules/egg-errors/lib/http/501.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/501.js +13 -0
- package/node_modules/egg-errors/lib/http/502.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/502.js +13 -0
- package/node_modules/egg-errors/lib/http/503.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/503.js +13 -0
- package/node_modules/egg-errors/lib/http/504.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/504.js +13 -0
- package/node_modules/egg-errors/lib/http/505.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/505.js +13 -0
- package/node_modules/egg-errors/lib/http/506.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/506.js +13 -0
- package/node_modules/egg-errors/lib/http/507.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/507.js +13 -0
- package/node_modules/egg-errors/lib/http/508.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/508.js +13 -0
- package/node_modules/egg-errors/lib/http/509.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/509.js +13 -0
- package/node_modules/egg-errors/lib/http/510.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/510.js +13 -0
- package/node_modules/egg-errors/lib/http/511.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/511.js +13 -0
- package/node_modules/egg-errors/lib/http/http_error.d.ts +10 -0
- package/node_modules/egg-errors/lib/http/http_error.js +13 -0
- package/node_modules/egg-errors/lib/http/http_error_options.d.ts +6 -0
- package/node_modules/egg-errors/lib/http/http_error_options.js +7 -0
- package/node_modules/egg-errors/lib/http/http_header.d.ts +3 -0
- package/node_modules/egg-errors/lib/http/http_header.js +3 -0
- package/node_modules/egg-errors/lib/index.d.ts +50 -0
- package/node_modules/egg-errors/lib/index.js +149 -0
- package/node_modules/egg-errors/package.json +49 -0
- package/node_modules/egg-logger/LICENSE +21 -0
- package/node_modules/egg-logger/README.md +128 -0
- package/node_modules/egg-logger/README.zh-CN.md +125 -0
- package/node_modules/egg-logger/index.d.ts +233 -0
- package/node_modules/egg-logger/index.js +18 -0
- package/node_modules/egg-logger/lib/egg/console_logger.js +36 -0
- package/node_modules/egg-logger/lib/egg/context_logger.js +43 -0
- package/node_modules/egg-logger/lib/egg/custom_logger.js +10 -0
- package/node_modules/egg-logger/lib/egg/error_logger.js +31 -0
- package/node_modules/egg-logger/lib/egg/logger.js +128 -0
- package/node_modules/egg-logger/lib/egg/loggers.js +163 -0
- package/node_modules/egg-logger/lib/level.js +34 -0
- package/node_modules/egg-logger/lib/logger.js +170 -0
- package/node_modules/egg-logger/lib/transports/console.js +52 -0
- package/node_modules/egg-logger/lib/transports/file.js +134 -0
- package/node_modules/egg-logger/lib/transports/file_buffer.js +113 -0
- package/node_modules/egg-logger/lib/transports/transport.js +129 -0
- package/node_modules/egg-logger/lib/utils.js +296 -0
- package/node_modules/egg-logger/package.json +54 -0
- package/node_modules/escape-html/LICENSE +24 -0
- package/node_modules/escape-html/Readme.md +43 -0
- package/node_modules/escape-html/index.js +78 -0
- package/node_modules/escape-html/package.json +24 -0
- package/node_modules/extend-shallow/LICENSE +21 -0
- package/node_modules/extend-shallow/README.md +61 -0
- package/node_modules/extend-shallow/index.js +33 -0
- package/node_modules/extend-shallow/package.json +56 -0
- package/node_modules/has-flag/index.d.ts +39 -0
- package/node_modules/has-flag/index.js +8 -0
- package/node_modules/has-flag/license +9 -0
- package/node_modules/has-flag/package.json +46 -0
- package/node_modules/has-flag/readme.md +89 -0
- package/node_modules/heartbeats/.eslintrc +151 -0
- package/node_modules/heartbeats/.npmignore +28 -0
- package/node_modules/heartbeats/.travis.yml +10 -0
- package/node_modules/heartbeats/LICENSE +21 -0
- package/node_modules/heartbeats/README.md +323 -0
- package/node_modules/heartbeats/lib/beatevent.js +35 -0
- package/node_modules/heartbeats/lib/heart.js +178 -0
- package/node_modules/heartbeats/lib/pulse.js +39 -0
- package/node_modules/heartbeats/main.js +34 -0
- package/node_modules/heartbeats/package.json +39 -0
- package/node_modules/heartbeats/test/benchmark.js +138 -0
- package/node_modules/heartbeats/test/spawn.js +16 -0
- package/node_modules/heartbeats/test/test.js +158 -0
- package/node_modules/httpx/README.md +96 -0
- package/node_modules/httpx/lib/index.d.ts +31 -0
- package/node_modules/httpx/lib/index.js +396 -0
- package/node_modules/httpx/package.json +36 -0
- package/node_modules/iconv-lite/.github/dependabot.yml +11 -0
- package/node_modules/iconv-lite/.idea/codeStyles/Project.xml +47 -0
- package/node_modules/iconv-lite/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/node_modules/iconv-lite/.idea/iconv-lite.iml +12 -0
- package/node_modules/iconv-lite/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/node_modules/iconv-lite/.idea/modules.xml +8 -0
- package/node_modules/iconv-lite/.idea/vcs.xml +6 -0
- package/node_modules/iconv-lite/Changelog.md +212 -0
- package/node_modules/iconv-lite/LICENSE +21 -0
- package/node_modules/iconv-lite/README.md +130 -0
- package/node_modules/iconv-lite/encodings/dbcs-codec.js +597 -0
- package/node_modules/iconv-lite/encodings/dbcs-data.js +188 -0
- package/node_modules/iconv-lite/encodings/index.js +23 -0
- package/node_modules/iconv-lite/encodings/internal.js +198 -0
- package/node_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
- package/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
- package/node_modules/iconv-lite/encodings/sbcs-data.js +179 -0
- package/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
- package/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
- package/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
- package/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
- package/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
- package/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
- package/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
- package/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
- package/node_modules/iconv-lite/encodings/utf16.js +197 -0
- package/node_modules/iconv-lite/encodings/utf32.js +319 -0
- package/node_modules/iconv-lite/encodings/utf7.js +290 -0
- package/node_modules/iconv-lite/lib/bom-handling.js +52 -0
- package/node_modules/iconv-lite/lib/index.d.ts +41 -0
- package/node_modules/iconv-lite/lib/index.js +180 -0
- package/node_modules/iconv-lite/lib/streams.js +109 -0
- package/node_modules/iconv-lite/package.json +44 -0
- package/node_modules/ip/README.md +90 -0
- package/node_modules/ip/lib/ip.js +496 -0
- package/node_modules/ip/package.json +25 -0
- package/node_modules/is-class-hotfix/.editorconfig +23 -0
- package/node_modules/is-class-hotfix/.gitattributes +2 -0
- package/node_modules/is-class-hotfix/CHANGELOG.md +7 -0
- package/node_modules/is-class-hotfix/LICENSE.md +21 -0
- package/node_modules/is-class-hotfix/README.md +35 -0
- package/node_modules/is-class-hotfix/bower.json +24 -0
- package/node_modules/is-class-hotfix/is-class.js +28 -0
- package/node_modules/is-class-hotfix/package.json +31 -0
- package/node_modules/is-class-hotfix/test/babel-class.js +27 -0
- package/node_modules/is-class-hotfix/test/is-class.js +31 -0
- package/node_modules/is-extendable/LICENSE +21 -0
- package/node_modules/is-extendable/README.md +72 -0
- package/node_modules/is-extendable/index.js +13 -0
- package/node_modules/is-extendable/package.json +51 -0
- package/node_modules/is-type-of/LICENSE +21 -0
- package/node_modules/is-type-of/README.md +105 -0
- package/node_modules/is-type-of/index.d.ts +65 -0
- package/node_modules/is-type-of/index.js +125 -0
- package/node_modules/is-type-of/package.json +45 -0
- package/node_modules/isstream/.jshintrc +59 -0
- package/node_modules/isstream/.npmignore +1 -0
- package/node_modules/isstream/.travis.yml +12 -0
- package/node_modules/isstream/LICENSE.md +11 -0
- package/node_modules/isstream/README.md +66 -0
- package/node_modules/isstream/isstream.js +27 -0
- package/node_modules/isstream/package.json +33 -0
- package/node_modules/isstream/test.js +168 -0
- package/node_modules/json-stringify-safe/.npmignore +1 -0
- package/node_modules/json-stringify-safe/CHANGELOG.md +14 -0
- package/node_modules/json-stringify-safe/LICENSE +15 -0
- package/node_modules/json-stringify-safe/Makefile +35 -0
- package/node_modules/json-stringify-safe/README.md +52 -0
- package/node_modules/json-stringify-safe/package.json +31 -0
- package/node_modules/json-stringify-safe/stringify.js +27 -0
- package/node_modules/json-stringify-safe/test/mocha.opts +2 -0
- package/node_modules/json-stringify-safe/test/stringify_test.js +246 -0
- package/node_modules/kitx/LICENSE +21 -0
- package/node_modules/kitx/README.md +35 -0
- package/node_modules/kitx/lib/index.d.ts +45 -0
- package/node_modules/kitx/lib/index.js +289 -0
- package/node_modules/kitx/package.json +41 -0
- package/node_modules/long/LICENSE +202 -0
- package/node_modules/long/README.md +246 -0
- package/node_modules/long/dist/long.js +2 -0
- package/node_modules/long/dist/long.js.map +1 -0
- package/node_modules/long/index.js +1 -0
- package/node_modules/long/package.json +34 -0
- package/node_modules/long/src/long.js +1323 -0
- package/node_modules/ms/index.js +162 -0
- package/node_modules/ms/license.md +21 -0
- package/node_modules/ms/package.json +38 -0
- package/node_modules/ms/readme.md +59 -0
- package/node_modules/p-timeout/index.d.ts +113 -0
- package/node_modules/p-timeout/index.js +71 -0
- package/node_modules/p-timeout/license +9 -0
- package/node_modules/p-timeout/package.json +44 -0
- package/node_modules/p-timeout/readme.md +117 -0
- package/node_modules/safer-buffer/LICENSE +21 -0
- package/node_modules/safer-buffer/Porting-Buffer.md +268 -0
- package/node_modules/safer-buffer/Readme.md +156 -0
- package/node_modules/safer-buffer/dangerous.js +58 -0
- package/node_modules/safer-buffer/package.json +34 -0
- package/node_modules/safer-buffer/safer.js +77 -0
- package/node_modules/safer-buffer/tests.js +406 -0
- package/node_modules/sdk-base/LICENSE +21 -0
- package/node_modules/sdk-base/README.md +165 -0
- package/node_modules/sdk-base/index.d.ts +29 -0
- package/node_modules/sdk-base/index.js +251 -0
- package/node_modules/sdk-base/package.json +54 -0
- package/node_modules/serialize-json/LICENSE +21 -0
- package/node_modules/serialize-json/README.md +74 -0
- package/node_modules/serialize-json/lib/decoder.js +190 -0
- package/node_modules/serialize-json/lib/encoder.js +200 -0
- package/node_modules/serialize-json/lib/index.js +15 -0
- package/node_modules/serialize-json/package.json +53 -0
- package/node_modules/supports-color/browser.js +5 -0
- package/node_modules/supports-color/index.js +135 -0
- package/node_modules/supports-color/license +9 -0
- package/node_modules/supports-color/package.json +53 -0
- package/node_modules/supports-color/readme.md +76 -0
- package/node_modules/tcp-base/LICENSE +21 -0
- package/node_modules/tcp-base/README.md +134 -0
- package/node_modules/tcp-base/lib/base.js +456 -0
- package/node_modules/tcp-base/package.json +44 -0
- package/node_modules/undici-types/LICENSE +21 -0
- package/node_modules/undici-types/README.md +6 -0
- package/node_modules/undici-types/agent.d.ts +31 -0
- package/node_modules/undici-types/api.d.ts +43 -0
- package/node_modules/undici-types/balanced-pool.d.ts +29 -0
- package/node_modules/undici-types/cache.d.ts +36 -0
- package/node_modules/undici-types/client.d.ts +108 -0
- package/node_modules/undici-types/connector.d.ts +34 -0
- package/node_modules/undici-types/content-type.d.ts +21 -0
- package/node_modules/undici-types/cookies.d.ts +28 -0
- package/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
- package/node_modules/undici-types/dispatcher.d.ts +256 -0
- package/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
- package/node_modules/undici-types/errors.d.ts +149 -0
- package/node_modules/undici-types/eventsource.d.ts +61 -0
- package/node_modules/undici-types/fetch.d.ts +209 -0
- package/node_modules/undici-types/file.d.ts +39 -0
- package/node_modules/undici-types/filereader.d.ts +54 -0
- package/node_modules/undici-types/formdata.d.ts +108 -0
- package/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/node_modules/undici-types/global-origin.d.ts +7 -0
- package/node_modules/undici-types/handlers.d.ts +15 -0
- package/node_modules/undici-types/header.d.ts +4 -0
- package/node_modules/undici-types/index.d.ts +71 -0
- package/node_modules/undici-types/interceptors.d.ts +17 -0
- package/node_modules/undici-types/mock-agent.d.ts +50 -0
- package/node_modules/undici-types/mock-client.d.ts +25 -0
- package/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/node_modules/undici-types/mock-interceptor.d.ts +93 -0
- package/node_modules/undici-types/mock-pool.d.ts +25 -0
- package/node_modules/undici-types/package.json +55 -0
- package/node_modules/undici-types/patch.d.ts +33 -0
- package/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/node_modules/undici-types/pool.d.ts +39 -0
- package/node_modules/undici-types/proxy-agent.d.ts +28 -0
- package/node_modules/undici-types/readable.d.ts +65 -0
- package/node_modules/undici-types/retry-agent.d.ts +8 -0
- package/node_modules/undici-types/retry-handler.d.ts +116 -0
- package/node_modules/undici-types/util.d.ts +18 -0
- package/node_modules/undici-types/webidl.d.ts +228 -0
- package/node_modules/undici-types/websocket.d.ts +150 -0
- package/node_modules/unescape/LICENSE +21 -0
- package/node_modules/unescape/README.md +134 -0
- package/node_modules/unescape/index.js +103 -0
- package/node_modules/unescape/package.json +67 -0
- package/node_modules/utility/LICENSE.txt +21 -0
- package/node_modules/utility/README.md +370 -0
- package/node_modules/utility/dist/commonjs/array.d.ts +11 -0
- package/node_modules/utility/dist/commonjs/array.js +46 -0
- package/node_modules/utility/dist/commonjs/crypto.d.ts +86 -0
- package/node_modules/utility/dist/commonjs/crypto.js +159 -0
- package/node_modules/utility/dist/commonjs/date.d.ts +63 -0
- package/node_modules/utility/dist/commonjs/date.js +219 -0
- package/node_modules/utility/dist/commonjs/fs.d.ts +6 -0
- package/node_modules/utility/dist/commonjs/fs.js +20 -0
- package/node_modules/utility/dist/commonjs/function.d.ts +12 -0
- package/node_modules/utility/dist/commonjs/function.js +35 -0
- package/node_modules/utility/dist/commonjs/index.d.ts +12 -0
- package/node_modules/utility/dist/commonjs/index.js +29 -0
- package/node_modules/utility/dist/commonjs/json.d.ts +14 -0
- package/node_modules/utility/dist/commonjs/json.js +41 -0
- package/node_modules/utility/dist/commonjs/number.d.ts +24 -0
- package/node_modules/utility/dist/commonjs/number.js +66 -0
- package/node_modules/utility/dist/commonjs/object.d.ts +20 -0
- package/node_modules/utility/dist/commonjs/object.js +73 -0
- package/node_modules/utility/dist/commonjs/optimize.d.ts +21 -0
- package/node_modules/utility/dist/commonjs/optimize.js +60 -0
- package/node_modules/utility/dist/commonjs/package.json +3 -0
- package/node_modules/utility/dist/commonjs/string.d.ts +29 -0
- package/node_modules/utility/dist/commonjs/string.js +126 -0
- package/node_modules/utility/dist/commonjs/timeout.d.ts +6 -0
- package/node_modules/utility/dist/commonjs/timeout.js +34 -0
- package/node_modules/utility/dist/commonjs/web.d.ts +29 -0
- package/node_modules/utility/dist/commonjs/web.js +61 -0
- package/node_modules/utility/dist/esm/array.d.ts +11 -0
- package/node_modules/utility/dist/esm/array.js +42 -0
- package/node_modules/utility/dist/esm/crypto.d.ts +86 -0
- package/node_modules/utility/dist/esm/crypto.js +146 -0
- package/node_modules/utility/dist/esm/date.d.ts +63 -0
- package/node_modules/utility/dist/esm/date.js +204 -0
- package/node_modules/utility/dist/esm/fs.d.ts +6 -0
- package/node_modules/utility/dist/esm/fs.js +17 -0
- package/node_modules/utility/dist/esm/function.d.ts +12 -0
- package/node_modules/utility/dist/esm/function.js +28 -0
- package/node_modules/utility/dist/esm/index.d.ts +12 -0
- package/node_modules/utility/dist/esm/index.js +13 -0
- package/node_modules/utility/dist/esm/json.d.ts +14 -0
- package/node_modules/utility/dist/esm/json.js +34 -0
- package/node_modules/utility/dist/esm/number.d.ts +24 -0
- package/node_modules/utility/dist/esm/number.js +60 -0
- package/node_modules/utility/dist/esm/object.d.ts +20 -0
- package/node_modules/utility/dist/esm/object.js +67 -0
- package/node_modules/utility/dist/esm/optimize.d.ts +21 -0
- package/node_modules/utility/dist/esm/optimize.js +54 -0
- package/node_modules/utility/dist/esm/package.json +3 -0
- package/node_modules/utility/dist/esm/string.d.ts +29 -0
- package/node_modules/utility/dist/esm/string.js +118 -0
- package/node_modules/utility/dist/esm/timeout.d.ts +6 -0
- package/node_modules/utility/dist/esm/timeout.js +28 -0
- package/node_modules/utility/dist/esm/web.d.ts +29 -0
- package/node_modules/utility/dist/esm/web.js +52 -0
- package/node_modules/utility/dist/package.json +4 -0
- package/node_modules/utility/package.json +85 -0
- package/node_modules/utility/src/array.ts +44 -0
- package/node_modules/utility/src/crypto.ts +160 -0
- package/node_modules/utility/src/date.ts +232 -0
- package/node_modules/utility/src/fs.ts +17 -0
- package/node_modules/utility/src/function.ts +30 -0
- package/node_modules/utility/src/index.ts +12 -0
- package/node_modules/utility/src/json.ts +48 -0
- package/node_modules/utility/src/number.ts +63 -0
- package/node_modules/utility/src/object.ts +72 -0
- package/node_modules/utility/src/optimize.ts +62 -0
- package/node_modules/utility/src/string.ts +132 -0
- package/node_modules/utility/src/timeout.ts +37 -0
- package/node_modules/utility/src/web.ts +53 -0
- package/node_modules/ylru/LICENSE +25 -0
- package/node_modules/ylru/README.md +120 -0
- package/node_modules/ylru/dist/commonjs/index.d.ts +21 -0
- package/node_modules/ylru/dist/commonjs/index.js +112 -0
- package/node_modules/ylru/dist/commonjs/package.json +3 -0
- package/node_modules/ylru/dist/esm/index.d.ts +21 -0
- package/node_modules/ylru/dist/esm/index.js +108 -0
- package/node_modules/ylru/dist/esm/package.json +3 -0
- package/node_modules/ylru/package.json +71 -0
- package/node_modules/ylru/src/index.ts +124 -0
- package/package.json +2 -2
- package/node_modules/@ali/cli-skills/dist/_chunks/libs/abort-controller.mjs +0 -424
- package/node_modules/@ali/cli-skills/dist/_chunks/libs/archiver.mjs +0 -19586
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.logger = exports.extractEagleEyeTraceHeader = exports.handleResponse = exports.DEFAULT_CLIENT = exports.DEFAULT_UA = void 0;
|
|
4
|
+
const os = require("os");
|
|
5
|
+
const constant_1 = require("../common/constant");
|
|
6
|
+
const format_1 = require("../common/format");
|
|
7
|
+
exports.DEFAULT_UA = `O2 (${os.platform()}; ${os.arch()}) ` +
|
|
8
|
+
`Node.js/${process.version} Core`;
|
|
9
|
+
exports.DEFAULT_CLIENT = `Node.js(${process.version}), @ali/o2-open-client`;
|
|
10
|
+
function handleResponse(response, body, ctx, isEscape) {
|
|
11
|
+
const contentType = response.headers['content-type'] || '';
|
|
12
|
+
const statusCode = response.statusCode;
|
|
13
|
+
const headers = response.headers;
|
|
14
|
+
const requestId = isEscape ? 'escape' : headers && headers[constant_1.H_REQ_ID];
|
|
15
|
+
// JSON
|
|
16
|
+
if (contentType.startsWith('application/json')) {
|
|
17
|
+
// No Content
|
|
18
|
+
if (statusCode === 204) {
|
|
19
|
+
return format_1.format204(body);
|
|
20
|
+
}
|
|
21
|
+
let result;
|
|
22
|
+
let res_format;
|
|
23
|
+
try {
|
|
24
|
+
result = JSON.parse(body.toString());
|
|
25
|
+
if (typeof ctx.resultFormatCallback == 'function') {
|
|
26
|
+
res_format = ctx.resultFormatCallback(result);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
res_format = format_1.format(result);
|
|
30
|
+
}
|
|
31
|
+
// result = format(result);
|
|
32
|
+
res_format.requestId = requestId;
|
|
33
|
+
res_format.httpCode = statusCode;
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
36
|
+
err.name = 'FormatError';
|
|
37
|
+
err.message = 'parse response to json error';
|
|
38
|
+
err.body = body;
|
|
39
|
+
throw err;
|
|
40
|
+
}
|
|
41
|
+
return res_format;
|
|
42
|
+
}
|
|
43
|
+
else if (contentType.startsWith('text/html')) {
|
|
44
|
+
let res_format = format_1.format({
|
|
45
|
+
error: 'upstream service error',
|
|
46
|
+
code: 'upstream.error'
|
|
47
|
+
});
|
|
48
|
+
res_format.requestId = requestId;
|
|
49
|
+
res_format.httpCode = statusCode;
|
|
50
|
+
return res_format;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
let res_format = format_1.format({
|
|
54
|
+
error: `unknown error: ${body}`,
|
|
55
|
+
code: 'unknown.error'
|
|
56
|
+
});
|
|
57
|
+
res_format.requestId = requestId;
|
|
58
|
+
res_format.httpCode = statusCode;
|
|
59
|
+
return res_format;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.handleResponse = handleResponse;
|
|
63
|
+
// 提取请求上下文中trace header
|
|
64
|
+
function extractEagleEyeTraceHeader() {
|
|
65
|
+
const H_TRACEID = 'eagleeye-traceid';
|
|
66
|
+
const H_RPCID = 'eagleeye-rpcid';
|
|
67
|
+
const defaultHeader = {
|
|
68
|
+
[H_TRACEID]: '',
|
|
69
|
+
[H_RPCID]: ''
|
|
70
|
+
};
|
|
71
|
+
try {
|
|
72
|
+
// 默认需接入@ali/db-tracer
|
|
73
|
+
const ctx = global.asyncLocalStorage && (typeof global.asyncLocalStorage.getStore === 'function') && global.asyncLocalStorage.getStore() || null;
|
|
74
|
+
if (!ctx) {
|
|
75
|
+
return defaultHeader;
|
|
76
|
+
}
|
|
77
|
+
const opts = {
|
|
78
|
+
childOf: null
|
|
79
|
+
};
|
|
80
|
+
if (ctx && ctx.tracer) {
|
|
81
|
+
opts.childOf = ctx.tracer.context;
|
|
82
|
+
}
|
|
83
|
+
const span = ctx.app.eagleeye.tracer.startSpan('http-client', opts);
|
|
84
|
+
const traceCtx = span && span.context();
|
|
85
|
+
const rpcid = traceCtx && traceCtx.rpcId || '0';
|
|
86
|
+
return {
|
|
87
|
+
[H_TRACEID]: ctx.get(H_TRACEID),
|
|
88
|
+
[H_RPCID]: rpcid
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
catch (e) {
|
|
92
|
+
return defaultHeader;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
exports.extractEagleEyeTraceHeader = extractEagleEyeTraceHeader;
|
|
96
|
+
exports.logger = {
|
|
97
|
+
error: (msg, err) => {
|
|
98
|
+
console.error(`[o2-open-client] ${msg}`, err);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { IResponse_DTO } from '../common/format';
|
|
2
|
+
export interface ITokenConfig {
|
|
3
|
+
env: 'pre' | 'prod' | 'daily';
|
|
4
|
+
token: string;
|
|
5
|
+
opts?: {
|
|
6
|
+
fromOXS: boolean;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
};
|
|
9
|
+
resultFormatCallback?: Function;
|
|
10
|
+
}
|
|
11
|
+
export interface IEscapeConfig {
|
|
12
|
+
/** 强制关闭逃逸能力,关闭后不再初始化 configClient,也不再拉取逃逸相关配置 */
|
|
13
|
+
disableEscape?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface IAKConfig {
|
|
16
|
+
env: 'pre' | 'prod' | 'daily';
|
|
17
|
+
accessKeyId: string;
|
|
18
|
+
accessKeySecret: string;
|
|
19
|
+
opts?: {
|
|
20
|
+
fromOXS: boolean;
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
};
|
|
23
|
+
resultFormatCallback?: Function;
|
|
24
|
+
}
|
|
25
|
+
export declare class O2Client {
|
|
26
|
+
env: string;
|
|
27
|
+
accessKeyId: string;
|
|
28
|
+
accessKeySecret: string;
|
|
29
|
+
token: string;
|
|
30
|
+
opts: any;
|
|
31
|
+
resultFormatCallback: Function;
|
|
32
|
+
private endpoint;
|
|
33
|
+
private host;
|
|
34
|
+
private keepAliveAgent;
|
|
35
|
+
private defaultQuery;
|
|
36
|
+
private configClient;
|
|
37
|
+
private serviceMeta;
|
|
38
|
+
private disableEscape;
|
|
39
|
+
constructor(config: Partial<ITokenConfig & IAKConfig & IEscapeConfig>);
|
|
40
|
+
private buildHeaders;
|
|
41
|
+
private signature;
|
|
42
|
+
private buildAuthorization;
|
|
43
|
+
private request;
|
|
44
|
+
put<T>(path: string, query: object, body: object | string, headers?: object, options?: object): Promise<IResponse_DTO<T>>;
|
|
45
|
+
post<T>(path: string, query: object, body: object | string, headers?: object, options?: object): Promise<IResponse_DTO<T>>;
|
|
46
|
+
get<T>(path: string, query?: object, headers?: object, options?: object): Promise<IResponse_DTO<T>>;
|
|
47
|
+
delete<T>(path: string, query: object, headers?: object, options?: object): Promise<IResponse_DTO<T>>;
|
|
48
|
+
}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.O2Client = void 0;
|
|
13
|
+
const assert = require("assert");
|
|
14
|
+
const url = require("url");
|
|
15
|
+
const querystring = require("querystring");
|
|
16
|
+
const debug = require("debug");
|
|
17
|
+
const kitx = require("kitx");
|
|
18
|
+
const httpx = require("httpx");
|
|
19
|
+
const help_1 = require("./help");
|
|
20
|
+
const constant_1 = require("../common/constant");
|
|
21
|
+
const token_handler_1 = require("./token-handler");
|
|
22
|
+
const escape_1 = require("./escape");
|
|
23
|
+
const config_1 = require("./config");
|
|
24
|
+
const nodeDeb = debug('sdk:node:index');
|
|
25
|
+
function keyLowerify(headers) {
|
|
26
|
+
const keys = Object.keys(headers);
|
|
27
|
+
const newHeaders = {};
|
|
28
|
+
for (let i = 0; i < keys.length; i++) {
|
|
29
|
+
const key = keys[i];
|
|
30
|
+
newHeaders[key.toLowerCase()] = headers[key];
|
|
31
|
+
}
|
|
32
|
+
return newHeaders;
|
|
33
|
+
}
|
|
34
|
+
function buildStringToSign(method, uriPattern, headers) {
|
|
35
|
+
const nonce = headers['x-sdk-nonce'] || '';
|
|
36
|
+
const date = headers['Date'] || '';
|
|
37
|
+
const header = `${method}\n${nonce}\n${date}\n${uriPattern}`;
|
|
38
|
+
return header;
|
|
39
|
+
}
|
|
40
|
+
;
|
|
41
|
+
;
|
|
42
|
+
;
|
|
43
|
+
class O2Client {
|
|
44
|
+
constructor(config) {
|
|
45
|
+
var _a;
|
|
46
|
+
const configName = config.accessKeyId || config.token;
|
|
47
|
+
this.disableEscape = Boolean(config.disableEscape);
|
|
48
|
+
const fromOXS = (_a = config.opts) === null || _a === void 0 ? void 0 : _a.fromOXS;
|
|
49
|
+
if (config.env == 'pre') {
|
|
50
|
+
this.env = config.env;
|
|
51
|
+
// 支持来自 OXS 区的请求
|
|
52
|
+
this.endpoint = fromOXS ? 'https://pre-oapi-o2.aliyun-inc.com' : 'https://pre-oapi.o2.alibaba-inc.com';
|
|
53
|
+
if (!this.disableEscape) {
|
|
54
|
+
this.configClient = new config_1.ConfigClient({
|
|
55
|
+
name: configName,
|
|
56
|
+
endpoint: fromOXS ? 'https://open-o2.aliyun-inc.com' : 'https://pre-open.o2.alibaba-inc.com'
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
else if (config.env == 'daily') {
|
|
61
|
+
this.env = config.env;
|
|
62
|
+
this.endpoint = 'https://oapi-def.taobao.net';
|
|
63
|
+
if (!this.disableEscape) {
|
|
64
|
+
this.configClient = new config_1.ConfigClient({
|
|
65
|
+
name: configName,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
this.env = 'prod';
|
|
71
|
+
this.endpoint = fromOXS ? 'https://oapi-o2.aliyun-inc.com' : 'https://oapi.o2.alibaba-inc.com';
|
|
72
|
+
if (!this.disableEscape) {
|
|
73
|
+
this.configClient = new config_1.ConfigClient({
|
|
74
|
+
name: configName,
|
|
75
|
+
endpoint: fromOXS ? 'https://open-o2.aliyun-inc.com' : 'https://open.o2.alibaba-inc.com'
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (config.accessKeyId && config.accessKeySecret) {
|
|
80
|
+
this.accessKeyId = config.accessKeyId;
|
|
81
|
+
this.accessKeySecret = config.accessKeySecret;
|
|
82
|
+
}
|
|
83
|
+
else if (config.token) {
|
|
84
|
+
this.token = config.token;
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
assert(null, 'must pass "config.accessKeyId and config.accessKeyId or config.token"');
|
|
88
|
+
}
|
|
89
|
+
this.opts = config.opts || {
|
|
90
|
+
timeout: 10000 // 默认超时10s
|
|
91
|
+
};
|
|
92
|
+
this.resultFormatCallback = config.resultFormatCallback;
|
|
93
|
+
this.host = url.parse(this.endpoint).hostname;
|
|
94
|
+
this.defaultQuery = {
|
|
95
|
+
Format: 'json',
|
|
96
|
+
};
|
|
97
|
+
const httpModule = this.endpoint.startsWith('https://') ? require('https') : require('http');
|
|
98
|
+
this.keepAliveAgent = new httpModule.Agent({
|
|
99
|
+
keepAlive: true,
|
|
100
|
+
keepAliveMsecs: 5000,
|
|
101
|
+
// 日常域名的证书不被系统信任
|
|
102
|
+
rejectUnauthorized: false
|
|
103
|
+
});
|
|
104
|
+
if (!this.disableEscape) {
|
|
105
|
+
this.configClient.getServiceMeta().then((meta) => {
|
|
106
|
+
this.serviceMeta = meta;
|
|
107
|
+
}).catch((e) => {
|
|
108
|
+
help_1.logger.error('getServiceMeta error', e);
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
buildHeaders() {
|
|
113
|
+
const now = new Date();
|
|
114
|
+
const defaultHeaders = {
|
|
115
|
+
accept: 'application/json',
|
|
116
|
+
Date: now.toGMTString(),
|
|
117
|
+
host: this.host,
|
|
118
|
+
'user-agent': help_1.DEFAULT_UA,
|
|
119
|
+
'x-sdk-client': help_1.DEFAULT_CLIENT,
|
|
120
|
+
'x-sdk-nonce': kitx.makeNonce(),
|
|
121
|
+
'content-type': 'application/json'
|
|
122
|
+
};
|
|
123
|
+
return defaultHeaders;
|
|
124
|
+
}
|
|
125
|
+
signature(stringToSign) {
|
|
126
|
+
const utf8Buff = Buffer.from(stringToSign, 'utf8');
|
|
127
|
+
return kitx.sha1(utf8Buff, this.accessKeySecret, 'base64');
|
|
128
|
+
}
|
|
129
|
+
buildAuthorization(stringToSign) {
|
|
130
|
+
return encodeURIComponent(`${this.accessKeyId}:${this.signature(stringToSign)}`);
|
|
131
|
+
}
|
|
132
|
+
request(method, uriPattern, query = {}, body = '', headers = {}, opts = {}) {
|
|
133
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
134
|
+
query = Object.assign({}, this.defaultQuery, query);
|
|
135
|
+
const traceHeader = help_1.extractEagleEyeTraceHeader();
|
|
136
|
+
let mixHeaders = Object.assign({}, this.buildHeaders(), keyLowerify(headers), traceHeader);
|
|
137
|
+
if (typeof body == 'object') {
|
|
138
|
+
body = JSON.stringify(body);
|
|
139
|
+
}
|
|
140
|
+
const postBody = Buffer.from(body, 'utf8');
|
|
141
|
+
mixHeaders['content-length'] = postBody.length;
|
|
142
|
+
// 必须是application/json
|
|
143
|
+
// mixHeaders['content-type'] = 'application/json';
|
|
144
|
+
mixHeaders['x-sdk-path'] = uriPattern;
|
|
145
|
+
mixHeaders['x-sdk-method'] = method.toUpperCase();
|
|
146
|
+
// header中有ticket而query中没有ticket,热切换时需保障query中存在ticket,在业务服务侧验证身份
|
|
147
|
+
if (mixHeaders['sso_ticket'] && !query['SSO_TICKET']) {
|
|
148
|
+
query['SSO_TICKET'] = mixHeaders['sso_ticket'];
|
|
149
|
+
}
|
|
150
|
+
// 开放接口,走ak认证鉴权
|
|
151
|
+
if (!query['SSO_TICKET'] && !mixHeaders['sso_ticket']) {
|
|
152
|
+
mixHeaders[constant_1.OPEN_API] = 'true';
|
|
153
|
+
}
|
|
154
|
+
// client_token认证
|
|
155
|
+
if (this.token) {
|
|
156
|
+
mixHeaders[constant_1.CLIENT_TOKEN] = this.token;
|
|
157
|
+
token_handler_1.processToken(this.token, uriPattern, mixHeaders, query);
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
// AK认证
|
|
161
|
+
query.AccessKeyId = encodeURIComponent(this.accessKeyId);
|
|
162
|
+
const stringToSign = buildStringToSign(method, uriPattern, mixHeaders);
|
|
163
|
+
mixHeaders['x-sdk-authorization'] = this.buildAuthorization(stringToSign);
|
|
164
|
+
}
|
|
165
|
+
let url = `${this.endpoint}${uriPattern}`;
|
|
166
|
+
if (Object.keys(query).length) {
|
|
167
|
+
url += `?${querystring.stringify(query)}`;
|
|
168
|
+
}
|
|
169
|
+
const options = Object.assign({
|
|
170
|
+
method,
|
|
171
|
+
agent: this.keepAliveAgent,
|
|
172
|
+
headers: mixHeaders,
|
|
173
|
+
data: postBody
|
|
174
|
+
}, this.opts, opts);
|
|
175
|
+
let rawData = null;
|
|
176
|
+
let result = null;
|
|
177
|
+
// 热切换判断
|
|
178
|
+
const switchCheck = this.disableEscape ? false : yield escape_1.hotSwitchCheck(this.configClient);
|
|
179
|
+
// 非热切换的正常场景
|
|
180
|
+
if (!switchCheck) {
|
|
181
|
+
result = yield httpx.request(url, options).then((response) => {
|
|
182
|
+
return httpx.read(response, 'utf8').then((body) => {
|
|
183
|
+
rawData = body;
|
|
184
|
+
// Return raw body
|
|
185
|
+
if (opts.rawBody) {
|
|
186
|
+
return body;
|
|
187
|
+
}
|
|
188
|
+
return help_1.handleResponse(response, body, this);
|
|
189
|
+
});
|
|
190
|
+
}).catch((e) => {
|
|
191
|
+
help_1.logger.error('request error', e);
|
|
192
|
+
});
|
|
193
|
+
// 请求被catch时,result为空
|
|
194
|
+
if (result) {
|
|
195
|
+
result.rawData = rawData;
|
|
196
|
+
}
|
|
197
|
+
nodeDeb('origin result', result, rawData);
|
|
198
|
+
}
|
|
199
|
+
// 热切换或者满足逃逸特殊条件的逃逸
|
|
200
|
+
const escapeReason = {
|
|
201
|
+
code: escape_1.ESCAPE_ERR_CODE.HOT_SWITCH
|
|
202
|
+
};
|
|
203
|
+
if (switchCheck || (!this.disableEscape && escape_1.maybeEscape(result, rawData, escapeReason))) {
|
|
204
|
+
const preResult = escape_1.preEscapeWork(this.serviceMeta, this.env, uriPattern, escapeReason);
|
|
205
|
+
// 不满足逃逸前提,返回原错误
|
|
206
|
+
if (preResult && preResult.resultNo == 1) {
|
|
207
|
+
return result;
|
|
208
|
+
}
|
|
209
|
+
nodeDeb(`启动逃逸...`);
|
|
210
|
+
// host头会替换url的host
|
|
211
|
+
delete mixHeaders.host;
|
|
212
|
+
const escapeOptions = Object.assign({}, {
|
|
213
|
+
method,
|
|
214
|
+
agent: this.keepAliveAgent,
|
|
215
|
+
headers: Object.assign({}, mixHeaders, keyLowerify(headers), {
|
|
216
|
+
[constant_1.H_CREADENTIAL]: this.accessKeyId || this.token,
|
|
217
|
+
[constant_1.H_POP_VER]: preResult.data.popVer,
|
|
218
|
+
// 逃逸流量标识,authPlugin认证需要
|
|
219
|
+
[constant_1.H_ESCAPE_STATE]: 'true',
|
|
220
|
+
// 兼容
|
|
221
|
+
'is-open': query['SSO_TICKET'] ? '' : 'true',
|
|
222
|
+
'pop-open-sess': this.accessKeyId || this.token,
|
|
223
|
+
'content-type': 'application/json',
|
|
224
|
+
}),
|
|
225
|
+
data: postBody
|
|
226
|
+
}, this.opts, opts);
|
|
227
|
+
let escapeUrl = `${preResult.data.uri}`;
|
|
228
|
+
if (Object.keys(query).length) {
|
|
229
|
+
escapeUrl += `?${querystring.stringify(query)}`;
|
|
230
|
+
}
|
|
231
|
+
const escapeResult = yield escape_1.doExc.bind(this, this.env, escapeUrl, escapeOptions)();
|
|
232
|
+
return escapeResult;
|
|
233
|
+
}
|
|
234
|
+
return result;
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
put(path, query, body, headers, options) {
|
|
238
|
+
return this.request('PUT', path, query, body, headers || {}, options);
|
|
239
|
+
}
|
|
240
|
+
post(path, query, body, headers, options) {
|
|
241
|
+
return this.request('POST', path, query, body, headers || {}, options);
|
|
242
|
+
}
|
|
243
|
+
get(path, query, headers, options) {
|
|
244
|
+
return this.request('GET', path, query, '', headers || {}, options);
|
|
245
|
+
}
|
|
246
|
+
delete(path, query, headers, options) {
|
|
247
|
+
return this.request('DELETE', path, query, '', headers || {}, options);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
exports.O2Client = O2Client;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function processToken(token: any, path: any, header: any, query: any): void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processToken = void 0;
|
|
4
|
+
const constant_1 = require("../common/constant");
|
|
5
|
+
function processToken(token, path, header, query) {
|
|
6
|
+
let ms = path && path.match(constant_1.ESCAPE_REG);
|
|
7
|
+
let appName = ms && ms.length && ms[2];
|
|
8
|
+
if (!appName) {
|
|
9
|
+
ms = path && path.match(constant_1.ESCAPE_NONSTANDARD_REG);
|
|
10
|
+
appName = ms && ms.length && ms[1];
|
|
11
|
+
if (!appName) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
const item = constant_1.TOKEN_MAP[appName];
|
|
16
|
+
if (item) {
|
|
17
|
+
if (item.type == 'header') {
|
|
18
|
+
header[item.name] = token;
|
|
19
|
+
}
|
|
20
|
+
else if (item.type == 'query') {
|
|
21
|
+
query[item.name] = token;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.processToken = processToken;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ali/o2-open-client",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "O2开放平台SDK",
|
|
5
|
+
"main": "./lib/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "tsc && tsc -p tsconfig.es.json",
|
|
8
|
+
"build:b": "browserify devs/b.js > devs/b.bundle.js",
|
|
9
|
+
"clean": "rm -rf ./node_modules build",
|
|
10
|
+
"pretest": "tsc",
|
|
11
|
+
"test": "playwright test"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"def-gw",
|
|
15
|
+
"sdk"
|
|
16
|
+
],
|
|
17
|
+
"author": "yuxiu",
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"registry": "https://registry.anpm.alibaba-inc.com"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@playwright/test": "^1.32.0",
|
|
23
|
+
"@types/node": "^16.9.1",
|
|
24
|
+
"browserify": "^17.0.0",
|
|
25
|
+
"mini-types": "^0.1.4",
|
|
26
|
+
"playwright": "^1.32.0",
|
|
27
|
+
"should": "^13.2.3",
|
|
28
|
+
"ts-node": "^10.3.0",
|
|
29
|
+
"typescript": "^3.9.7"
|
|
30
|
+
},
|
|
31
|
+
"husky": {
|
|
32
|
+
"hooks": {
|
|
33
|
+
"pre-commit": "npm run lint"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"cluster-client": "^3.4.0",
|
|
38
|
+
"debug": "^4.3.3",
|
|
39
|
+
"heartbeats": "^5.0.1",
|
|
40
|
+
"httpx": "^2.2.7",
|
|
41
|
+
"ip": "^1.1.5",
|
|
42
|
+
"kitx": "^2.1.0",
|
|
43
|
+
"sdk-base": "^4.2.1"
|
|
44
|
+
},
|
|
45
|
+
"repository": "git@gitlab.alibaba-inc.com:def-open/o2-open-sdk.git"
|
|
46
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { PlaywrightTestConfig } from '@playwright/test';
|
|
2
|
+
import { devices } from '@playwright/test';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* See https://playwright.dev/docs/test-configuration.
|
|
6
|
+
*/
|
|
7
|
+
const config: PlaywrightTestConfig = {
|
|
8
|
+
// testIgnore: '*node.spec.ts',
|
|
9
|
+
testDir: './test',
|
|
10
|
+
/* Maximum time one test can run for. */
|
|
11
|
+
timeout: 30 * 1000,
|
|
12
|
+
expect: {
|
|
13
|
+
/**
|
|
14
|
+
* Maximum time expect() should wait for the condition to be met.
|
|
15
|
+
* For example in `await expect(locator).toHaveText();`
|
|
16
|
+
*/
|
|
17
|
+
timeout: 5000,
|
|
18
|
+
},
|
|
19
|
+
/* Run tests in files in parallel */
|
|
20
|
+
fullyParallel: true,
|
|
21
|
+
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
|
22
|
+
// forbidOnly: !!process.env.CI,
|
|
23
|
+
// /* Retry on CI only */
|
|
24
|
+
// retries: process.env.CI ? 2 : 0,
|
|
25
|
+
// /* Opt out of parallel tests on CI. */
|
|
26
|
+
// workers: process.env.CI ? 1 : undefined,
|
|
27
|
+
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
|
28
|
+
reporter: [
|
|
29
|
+
['html', { open: 'never' }],
|
|
30
|
+
],
|
|
31
|
+
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
|
|
32
|
+
use: {
|
|
33
|
+
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
|
|
34
|
+
actionTimeout: 30000,
|
|
35
|
+
/* Base URL to use in actions like `await page.goto('/')`. */
|
|
36
|
+
// baseURL: 'http://localhost:3000',
|
|
37
|
+
|
|
38
|
+
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
|
39
|
+
trace: 'on',
|
|
40
|
+
// video: 'on',
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
/* Configure projects for major browsers */
|
|
44
|
+
projects: [
|
|
45
|
+
{
|
|
46
|
+
name: 'chromium',
|
|
47
|
+
use: {
|
|
48
|
+
...devices['Desktop Chrome'],
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default config;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"baseUrl": ".",
|
|
4
|
+
"outDir": "./es/",
|
|
5
|
+
"declaration": true,
|
|
6
|
+
"module": "ES6",
|
|
7
|
+
"target": "es2015",
|
|
8
|
+
"jsx": "preserve",
|
|
9
|
+
"jsxFactory": "createElement",
|
|
10
|
+
"moduleResolution": "node",
|
|
11
|
+
"alwaysStrict": true,
|
|
12
|
+
"sourceMap": false,
|
|
13
|
+
"allowSyntheticDefaultImports": true,
|
|
14
|
+
"suppressImplicitAnyIndexErrors": true,
|
|
15
|
+
"removeComments": false,
|
|
16
|
+
"preserveConstEnums": true,
|
|
17
|
+
"experimentalDecorators": true,
|
|
18
|
+
"noImplicitReturns": true,
|
|
19
|
+
"noUnusedLocals": true,
|
|
20
|
+
"noUnusedParameters": false,
|
|
21
|
+
"noImplicitAny": false,
|
|
22
|
+
"noImplicitThis": false,
|
|
23
|
+
// "resolveJsonModule": true,
|
|
24
|
+
"paths": {
|
|
25
|
+
"src": ["./src"],
|
|
26
|
+
},
|
|
27
|
+
"types": ["node", "./typings"]
|
|
28
|
+
},
|
|
29
|
+
"include": ["src/**/*"],
|
|
30
|
+
"exclude": ["node_modules", "lib"]
|
|
31
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"baseUrl": ".",
|
|
4
|
+
"outDir": "./lib/",
|
|
5
|
+
"declaration": true,
|
|
6
|
+
"module": "commonjs",
|
|
7
|
+
"target": "es2015",
|
|
8
|
+
"jsx": "preserve",
|
|
9
|
+
"jsxFactory": "createElement",
|
|
10
|
+
"moduleResolution": "node",
|
|
11
|
+
"alwaysStrict": true,
|
|
12
|
+
"sourceMap": false,
|
|
13
|
+
"allowSyntheticDefaultImports": true,
|
|
14
|
+
"suppressImplicitAnyIndexErrors": true,
|
|
15
|
+
"removeComments": false,
|
|
16
|
+
"preserveConstEnums": true,
|
|
17
|
+
"experimentalDecorators": true,
|
|
18
|
+
"noImplicitReturns": true,
|
|
19
|
+
"noUnusedLocals": true,
|
|
20
|
+
"noUnusedParameters": false,
|
|
21
|
+
"noImplicitAny": false,
|
|
22
|
+
"noImplicitThis": false,
|
|
23
|
+
// "resolveJsonModule": true,
|
|
24
|
+
"paths": {
|
|
25
|
+
"src": ["./src"],
|
|
26
|
+
},
|
|
27
|
+
"types": ["node", "./typings"]
|
|
28
|
+
},
|
|
29
|
+
"include": ["src/**/*"],
|
|
30
|
+
"exclude": ["node_modules", "lib", "src/browser/index.ts"]
|
|
31
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
declare namespace O2Open {
|
|
2
|
+
type Options = {
|
|
3
|
+
version?: string,
|
|
4
|
+
timeout?: number
|
|
5
|
+
// ignoreBucAuth?: boolean
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
type RequestParams = {
|
|
9
|
+
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD',
|
|
10
|
+
path: string,
|
|
11
|
+
data?: object,
|
|
12
|
+
headers?: object,
|
|
13
|
+
opts?: Options,
|
|
14
|
+
body?: any,
|
|
15
|
+
query?: any
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
interface IO2ClientConfig {
|
|
19
|
+
env?: string;
|
|
20
|
+
timeout?: number;
|
|
21
|
+
resultFormatCallback?: Function;
|
|
22
|
+
opts?: {
|
|
23
|
+
fromOXS: boolean;
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface O2ClientParams {
|
|
29
|
+
// ticket: string;
|
|
30
|
+
env?: string;
|
|
31
|
+
version?: string;
|
|
32
|
+
endpoint?: string;
|
|
33
|
+
timeout?: number;
|
|
34
|
+
resultFormatCallback?: Function;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Installation
|
|
2
|
+
> `npm install --save @types/node`
|
|
3
|
+
|
|
4
|
+
# Summary
|
|
5
|
+
This package contains type definitions for node (https://nodejs.org/).
|
|
6
|
+
|
|
7
|
+
# Details
|
|
8
|
+
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v20.
|
|
9
|
+
|
|
10
|
+
### Additional Details
|
|
11
|
+
* Last updated: Fri, 03 Apr 2026 11:14:41 GMT
|
|
12
|
+
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
|
13
|
+
|
|
14
|
+
# Credits
|
|
15
|
+
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [David Junger](https://github.com/touffy), [Mohsen Azimi](https://github.com/mohsen1), [Nikita Galkin](https://github.com/galkin), [Sebastian Silbermann](https://github.com/eps1lon), [Wilco Bakker](https://github.com/WilcoBakker), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), and [Dmitry Semigradsky](https://github.com/Semigradsky).
|