@motionpicture/coa-service 9.6.0 → 9.7.0-alpha.1

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.
@@ -14,7 +14,7 @@ const service = new COA.service.Master(
14
14
  useFetch: true
15
15
  })
16
16
  },
17
- { timeout: 1000 }
17
+ { timeout: 5000 }
18
18
  );
19
19
 
20
20
  service.title({
@@ -47,9 +47,9 @@ export declare class RefreshTokenClient {
47
47
  /**
48
48
  * 認証情報が適切である前提でAPIリクエストを投げる
49
49
  */
50
- protected makeRequest(options: IRequestOptions, expectedStatusCodes: number[]): Promise<import("../transporters").IResponseBodyAsJson>;
50
+ private makeRequest;
51
51
  /**
52
52
  * 認証情報を更新する
53
53
  */
54
- protected refreshToken(__: string): Promise<ICredentials>;
54
+ private refreshToken;
55
55
  }
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.RefreshTokenClient = void 0;
13
13
  const createDebug = require("debug");
14
14
  const http_status_1 = require("http-status");
15
- const node_fetch_1 = require("node-fetch");
15
+ // import { default as fetch } from 'node-fetch';
16
16
  const transporters_1 = require("../transporters");
17
17
  const debug = createDebug('coa-service:auth:refreshTokenClient');
18
18
  const TIMEOUT = 10000;
@@ -33,7 +33,7 @@ class RefreshTokenClient {
33
33
  debug('requesting an access token...');
34
34
  try {
35
35
  const params = new URLSearchParams({ refresh_token: String(this.options.refreshToken) });
36
- const res = yield (0, node_fetch_1.default)(`${this.options.endpoint}/token/access_token`, {
36
+ const res = yield fetch(`${this.options.endpoint}/token/access_token`, {
37
37
  method: 'POST',
38
38
  headers: {
39
39
  'Content-Type': 'application/x-www-form-urlencoded'
@@ -16,7 +16,7 @@ exports.FetchTransporter = exports.Transporter = exports.COAServiceError = expor
16
16
  */
17
17
  const createDebug = require("debug");
18
18
  const http_status_1 = require("http-status");
19
- const node_fetch_1 = require("node-fetch");
19
+ // import { default as fetch, Response } from 'node-fetch';
20
20
  const querystring = require("querystring");
21
21
  const coaServiceError_1 = require("./transporter/coaServiceError");
22
22
  Object.defineProperty(exports, "COAServiceError", { enumerable: true, get: function () { return coaServiceError_1.COAServiceError; } });
@@ -169,7 +169,7 @@ class FetchTransporter {
169
169
  const input = `${requestOptions.baseUrl}${requestOptions.uri}?${querystring.stringify(requestOptions.qs)}`;
170
170
  const accessToken = (_a = requestOptions.auth) === null || _a === void 0 ? void 0 : _a.bearer;
171
171
  debug('fetching...', input, requestOptions);
172
- return (0, node_fetch_1.default)(input, Object.assign({ method: requestOptions.method, headers: Object.assign(Object.assign({}, requestOptions.headers), (typeof accessToken === 'string') ? { Authorization: `Bearer ${accessToken}` } /* istanbul ignore else */ : undefined) }, (typeof requestOptions.timeout === 'number') ? { signal: AbortSignal.timeout(requestOptions.timeout) } : undefined))
172
+ return fetch(input, Object.assign({ method: requestOptions.method, headers: Object.assign(Object.assign({}, requestOptions.headers), (typeof accessToken === 'string') ? { Authorization: `Bearer ${accessToken}` } /* istanbul ignore else */ : undefined) }, (typeof requestOptions.timeout === 'number') ? { signal: AbortSignal.timeout(requestOptions.timeout) } : undefined))
173
173
  .then((res) => __awaiter(this, void 0, void 0, function* () { return this.wrapCallback(res, requestOptions); }));
174
174
  });
175
175
  }
package/package.json CHANGED
@@ -13,9 +13,8 @@
13
13
  }
14
14
  ],
15
15
  "dependencies": {
16
- "debug": "^3.2.7",
17
- "http-status": "^1.5.2",
18
- "node-fetch": "2.7.0"
16
+ "debug": "3.2.7",
17
+ "http-status": "1.5.2"
19
18
  },
20
19
  "description": "COA client library for Node.js",
21
20
  "devDependencies": {
@@ -23,7 +22,6 @@
23
22
  "@types/http-status": "^0.2.30",
24
23
  "@types/mocha": "^5.2.0",
25
24
  "@types/node": "18.19.2",
26
- "@types/node-fetch": "2.6.11",
27
25
  "@types/sinon": "^4.3.3",
28
26
  "coveralls": "^3.0.1",
29
27
  "grunt-contrib-watch": "^1.1.0",
@@ -77,5 +75,5 @@
77
75
  "postversion": "git push origin --tags",
78
76
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
79
77
  },
80
- "version": "9.6.0"
78
+ "version": "9.7.0-alpha.1"
81
79
  }