diff --git a/dist/base/BaseClient.js b/dist/base/BaseClient.js index f0cd869..3ddc73b 100644 --- a/dist/base/BaseClient.js +++ b/dist/base/BaseClient.js @@ -8,13 +8,8 @@ const getSignedParams = require('../lib/sign.js').getSignedParams; const fetch = require('../lib/fetch.js'); -const dayjs = require('dayjs'); - -const utc = require('dayjs/plugin/utc.js'); - const qs = require('qs'); -dayjs.extend(utc); module.exports = class BaseClient { constructor(clientConfig) { _defineProperty(this, "_baseConfig", {}); @@ -43,7 +38,7 @@ module.exports = class BaseClient { Service: this._baseConfig.config.credentials.service, Action: apiAction, Version: apiConfig.config.query.Version, - Timestamp: dayjs().utc().format('YYYY-MM-DDThh:mm:ss') + 'Z', + Timestamp: new Date().toISOString().replace(/\.\d{3}Z$/, 'Z'), SignatureVersion: '1.0', SignatureMethod: 'HMAC-SHA256', Region: this.region || this._baseConfig.config.credentials.region diff --git a/package-lock.json b/package-lock.json index be68f40..691b9a1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,6 @@ "abort-controller": "^3.0.0", "core-js": "^3.6.5", "crypto-js": "^4.1.1", - "dayjs": "^1.10.7", "node-fetch": "^2.6.7", "qs": "^6.10.3" }, @@ -2223,11 +2222,6 @@ "resolved": "https://registry.npmmirror.com/crypto-js/-/crypto-js-4.1.1.tgz", "integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw==" }, - "node_modules/dayjs": { - "version": "1.10.8", - "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.10.8.tgz", - "integrity": "sha512-wbNwDfBHHur9UOzNUjeKUOJ0fCb0a52Wx0xInmQ7Y8FstyajiV1NmK1e00cxsr9YrE9r7yAChE0VvpuY5Rnlow==" - }, "node_modules/debug": { "version": "4.3.3", "resolved": "https://registry.npmmirror.com/debug/-/debug-4.3.3.tgz", @@ -5478,11 +5472,6 @@ "resolved": "https://registry.npmmirror.com/crypto-js/-/crypto-js-4.1.1.tgz", "integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw==" }, - "dayjs": { - "version": "1.10.8", - "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.10.8.tgz", - "integrity": "sha512-wbNwDfBHHur9UOzNUjeKUOJ0fCb0a52Wx0xInmQ7Y8FstyajiV1NmK1e00cxsr9YrE9r7yAChE0VvpuY5Rnlow==" - }, "debug": { "version": "4.3.3", "resolved": "https://registry.npmmirror.com/debug/-/debug-4.3.3.tgz", diff --git a/package.json b/package.json index eee2b71..255de76 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,6 @@ "abort-controller": "^3.0.0", "core-js": "^3.6.5", "crypto-js": "^4.1.1", - "dayjs": "^1.10.7", "node-fetch": "^2.6.7", "qs": "^6.10.3" }, diff --git a/src/base/BaseClient.js b/src/base/BaseClient.js index bccf3ab..f856de1 100644 --- a/src/base/BaseClient.js +++ b/src/base/BaseClient.js @@ -1,11 +1,7 @@ const getSignedParams = require('../lib/sign.js').getSignedParams const fetch = require('../lib/fetch.js') -const dayjs = require('dayjs') -const utc = require('dayjs/plugin/utc.js') const qs = require('qs') -dayjs.extend(utc) - module.exports = class BaseClient { _baseConfig = {} _apiList = {} @@ -32,7 +28,7 @@ module.exports = class BaseClient { Service: this._baseConfig.config.credentials.service, Action: apiAction, Version: apiConfig.config.query.Version, - Timestamp: dayjs().utc().format('YYYY-MM-DDThh:mm:ss')+'Z', + Timestamp: (new Date()).toISOString().replace(/\.\d{3}Z$/, 'Z'), SignatureVersion: '1.0', SignatureMethod: 'HMAC-SHA256', Region: this.region || this._baseConfig.config.credentials.region, @@ -89,4 +85,4 @@ module.exports = class BaseClient { } return JSON.stringify(signedParams) } -} \ No newline at end of file +}