{"_id":"@ddc391565320/openapiv2","_rev":"1-689fb9277c5e2dd0441750b5fef3cf3d","name":"@ddc391565320/openapiv2","dist-tags":{"latest":"1.14.1"},"versions":{"1.14.0":{"name":"@ddc391565320/openapiv2","version":"1.14.0","description":"火山引擎OpenAPI SDK nodejs版","main":"lib/index.js","engines":{"node":">=12"},"scripts":{"cp:tls-proto":"cp src/services/tls/tls.proto lib/services/tls/tls.proto","cp:tls-lz4":"cp src/services/tls/lz4.js lib/services/tls/lz4.js","build":"rm -rf lib && tsc && yarn cp:tls-proto && yarn cp:tls-lz4","lint":"eslint . --ext ts --fix --quiet","dev":"tsc --watch","dev:proxy":"VOLC_PROXY_PORT=8888 yarn dev","test":"yarn build && jest --env=node","test-mq":"jest ./test/rocketmq.test.js --env=node","test-maas":"jest ./test/maas.test.js --env=node"},"repository":{"type":"git","url":"git+ssh://git@github.com/volcengine/volc-sdk-nodejs.git"},"author":"","license":"Apache-2.0","devDependencies":{"@babel/preset-env":"^7.16.4","@babel/preset-typescript":"^7.12.7","@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@types/ajv":"^1.0.0","@types/crypto-js":"^4.0.1","@types/debug":"^4.1.5","@types/jest":"^26.0.19","@types/node-fetch":"^2.5.7","@typescript-eslint/eslint-plugin":"^4.10.0","@typescript-eslint/parser":"^4.10.0","ajv":"^7.0.2","eslint":"^7.16.0","eslint-config-prettier":"^4.3.0","eslint-plugin-babel":"^5.3.1","eslint-plugin-jest":"^22.6.4","eslint-plugin-prettier":"^3.1.0","eslint-plugin-react":"^7.18.3","husky":"^4.3.6","jest":"^26.6.3","lodash.merge":"^4.6.2","prettier":"^2.2.1","typescript":"^4.1.3"},"dependencies":{"axios":"^0.21.1","crc":"^4.1.0","crypto-js":"^4.0.0","dayjs":"^1.11.5","debug":"^4.3.1","form-data":"^3.0.0","lodash.get":"^4.4.2","p-limit":"^3.0.0","protobufjs":"7.2.4","uuid":"^8.3.2"},"husky":{"hooks":{"commit-msg":"commitlint -e $GIT_PARAMS","pre-commit":"yarn lint"}},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"gitHead":"21cf54a17cfe2cd5acc79dd0d5353604bc15a7f3","bugs":{"url":"https://github.com/volcengine/volc-sdk-nodejs/issues"},"homepage":"https://github.com/volcengine/volc-sdk-nodejs#readme","_id":"@ddc391565320/openapiv2@1.14.0","_nodeVersion":"20.3.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-vP9Fi4TUcI2p9dqnhsHuR65rLgBw/dX5UQ6yiOIoRgBET+j9TOyg4Vakk0WFrufanAvwlY16YrHObEtxCc5gFw==","shasum":"4e79fe4cad625ba426fb6669e36b62d0d02fad88","tarball":"https://registry.npmjs.org/@ddc391565320/openapiv2/-/openapiv2-1.14.0.tgz","fileCount":8,"unpackedSize":272198,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDh2MO5tE92TAlZBW4xP8aFoNEHR6TNMCXiH0qPBuj4DAiA5xf73k8dW844kksL5DhCBPD7sLI3fD1lxAiIHxTIQGw=="}]},"_npmUser":{"name":"ddc391565320","email":"ddc007@126.com"},"directories":{},"maintainers":[{"name":"ddc391565320","email":"ddc007@126.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openapiv2_1.14.0_1709029007287_0.7381404746380142"},"_hasShrinkwrap":false},"1.14.1":{"name":"@ddc391565320/openapiv2","version":"1.14.1","description":"火山引擎OpenAPI SDK nodejs版","main":"lib/index.js","engines":{"node":">=12"},"scripts":{"cp:tls-proto":"cp src/services/tls/tls.proto lib/services/tls/tls.proto","cp:tls-lz4":"cp src/services/tls/lz4.js lib/services/tls/lz4.js","build":"rm -rf lib && tsc && yarn cp:tls-proto && yarn cp:tls-lz4","lint":"eslint . --ext ts --fix --quiet","dev":"tsc --watch","dev:proxy":"VOLC_PROXY_PORT=8888 yarn dev","test":"yarn build && jest --env=node","test-mq":"jest ./test/rocketmq.test.js --env=node","test-maas":"jest ./test/maas.test.js --env=node"},"repository":{"type":"git","url":"git+ssh://git@github.com/ddviper/openaiv2.git"},"author":"","license":"Apache-2.0","devDependencies":{"@babel/preset-env":"^7.16.4","@babel/preset-typescript":"^7.12.7","@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@types/ajv":"^1.0.0","@types/crypto-js":"^4.0.1","@types/debug":"^4.1.5","@types/jest":"^26.0.19","@types/node-fetch":"^2.5.7","@typescript-eslint/eslint-plugin":"^4.10.0","@typescript-eslint/parser":"^4.10.0","ajv":"^7.0.2","eslint":"^7.16.0","eslint-config-prettier":"^4.3.0","eslint-plugin-babel":"^5.3.1","eslint-plugin-jest":"^22.6.4","eslint-plugin-prettier":"^3.1.0","eslint-plugin-react":"^7.18.3","husky":"^4.3.6","jest":"^26.6.3","lodash.merge":"^4.6.2","prettier":"^2.2.1","typescript":"^4.1.3"},"dependencies":{"axios":"^0.21.1","crc":"^4.1.0","crypto-js":"^4.0.0","dayjs":"^1.11.5","debug":"^4.3.1","form-data":"^3.0.0","lodash.get":"^4.4.2","p-limit":"^3.0.0","protobufjs":"7.2.4","uuid":"^8.3.2"},"husky":{"hooks":{"commit-msg":"commitlint -e $GIT_PARAMS","pre-commit":"yarn lint"}},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"gitHead":"c52e826985bad251783a347d9e571b6bd450ac73","bugs":{"url":"https://github.com/ddviper/openaiv2/issues"},"homepage":"https://github.com/ddviper/openaiv2#readme","_id":"@ddc391565320/openapiv2@1.14.1","_nodeVersion":"20.3.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-Woqr92EDjRWFa0W0Hj1R+9xYzFbpQ+2RdCWAFz1qHdfB5Vq+zkiI0KDyBxJrVua69LqA1KGtT7YBjIcbqIV6SQ==","shasum":"5880669be8964d4071b0f4f4b3d9eea760fafbf3","tarball":"https://registry.npmjs.org/@ddc391565320/openapiv2/-/openapiv2-1.14.1.tgz","fileCount":8,"unpackedSize":272188,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGt3eUjDqFB9DFi2LPyzLrQN4Mnj1QwSVOhmFQKaIxqxAiBwrPaUYSRj6xchA6DsUMxQA6p40l39N8AfB4M7buH7Yw=="}]},"_npmUser":{"name":"ddc391565320","email":"ddc007@126.com"},"directories":{},"maintainers":[{"name":"ddc391565320","email":"ddc007@126.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openapiv2_1.14.1_1709031807136_0.3815028799362097"},"_hasShrinkwrap":false}},"time":{"created":"2024-02-27T10:16:47.202Z","1.14.0":"2024-02-27T10:16:47.471Z","modified":"2024-02-27T11:03:27.775Z","1.14.1":"2024-02-27T11:03:27.364Z"},"maintainers":[{"name":"ddc391565320","email":"ddc007@126.com"}],"description":"火山引擎OpenAPI SDK nodejs版","homepage":"https://github.com/ddviper/openaiv2#readme","repository":{"type":"git","url":"git+ssh://git@github.com/ddviper/openaiv2.git"},"bugs":{"url":"https://github.com/ddviper/openaiv2/issues"},"license":"Apache-2.0","readme":"# Volcano Engine OpenAPI node sdk\n\n[中文文档](./README_zh.md)\n\n## Requirements:\n\n- Node.js >= 12\n\n## Installation\n```shell\nnpm install -S @volcengine/openapi\n```\n\n## Basic Usage\n\n### 1. Setting OpenAPI service's AK&SK\n\nAvailable in three settings\n\n#### 1. Use API to set AK&SK\n```ts\n// Use the default service instance. You can also create a new instance.\n// `const iamService = new iam.IamService();`\nconst iamService = iam.defaultService;\n\n// set aksk\niamService.setAccessKeyId(AccessKeyId);\niamService.setSecretKey(SecretKey);\n// If you use sts to request, you need to set up `SessionToken` after aksk is set\niamService.setSessionToken(SessionToken);\n```\n\n#### 2. Use environment variables to set AK & SK\n```shell\nVOLC_ACCESSKEY=\"your ak\" VOLC_SECRETKEY=\"your sk\"\n```\n\n#### 3. Use configuration file\nPut it in `~/.volc/config` in json format, the format is:\n```\n{\"VOLC_ACCESSKEY\":\"your ak\",\"VOLC_SECRETKEY\":\"your sk\"}\n```\n\n## Request OpenAPI\n\nTake the ListUsers API of the iam service as an example\n\n```ts\nimport { iam } from'@volcengine/openapi';\n\nasync function main(AccessKeyId, SecretKey) {\n   // Use the default service instance. You can also create a new instance.\n   // `const iamService = new iam.IamService();`\n   const iamService = iam.defaultService;\n\n   // set aksk\n   iamService.setAccessKeyId(AccessKeyId);\n   iamService.setSecretKey(SecretKey);\n  \n   // Request OpenAPI\n   const usersResponse = await iamService.ListUsers({\n     Limit: 10,\n     Offset: 0,\n   });\n}\n```\n\n## OpenAPI signature method\n\n### By HTTP Header\n\n```ts\nimport {Signer} from '@volcengine/openapi';\n\n// http request data\nconst openApiRequestData: RequestObj = {\n    region: 'cn-north-1',\n    method: 'GET',\n    // [optional] http request url query\n    params: {},\n    // http request headers\n    headers: {},\n    // [optional] http request body\n    body: \"\",\n}\n\nconst signer = new Signer(openApiRequestData, \"iam\");\n\n// sign\nsigner.addAuthorization({accessKeyId, secretKey, sessionToken});\n\n// Print signed headers\nconsole.log(openApiRequestData.headers);\n```\n\n### By HTTP Query \n\n```ts\nconst openApiRequestData: RequestObj = {\n    method: \"POST\",\n    region: \"cn-north-1\",\n    params: {\n        Action: \"AssumeRole\",\n        Version: \"2018-01-01\",\n        RoleTrn: \"trn:iam::200:role/STSRole\",\n        RoleSessionName: \"test\",\n    },\n}\n\nconst credentials: Credentials = {\n    accessKeyId: VOLC_ACCESSKEY,\n    secretKey: VOLC_SECRETKEY,\n    sessionToken: \"\",\n}\n\nconst signer = new Signer(openApiRequestData, \"sts\");\n\nconst signedQueryString = signer.getSignUrl(credentials);\n```","readmeFilename":"README.md"}