@digipair/skill-linkedin 0.48.3 → 0.49.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.
Files changed (3) hide show
  1. package/index.cjs.js +20 -13
  2. package/index.esm.js +20 -13
  3. package/package.json +1 -1
package/index.cjs.js CHANGED
@@ -15,8 +15,9 @@ function _extends() {
15
15
 
16
16
  const API_ENDPOINT = 'https://api.linkedin.com';
17
17
  let LinkedInService = class LinkedInService {
18
- async call(url, method, version, data = null, headers = {}) {
18
+ async call(url, method, version, data, headers, signal) {
19
19
  const response = await fetch(`${API_ENDPOINT}/${version}/${url}`, {
20
+ signal,
20
21
  method,
21
22
  headers: _extends({
22
23
  Authorization: `Bearer ${this.TOKEN}`,
@@ -28,29 +29,35 @@ let LinkedInService = class LinkedInService {
28
29
  if (!response.ok) throw new Error('[SKILL-LINKEDIN] REQUEST FAILED: ' + response.status);
29
30
  return await response.json();
30
31
  }
31
- async create(params, _pinsSettingsList, _context) {
32
+ async create(params, _pinsSettingsList, context) {
33
+ var _context_protected;
32
34
  const { path, body = {}, version = 'v2', headers = {} } = params;
33
- return await this.call(path, 'POST', version, body, headers);
35
+ return await this.call(path, 'POST', version, body, headers, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
34
36
  }
35
- async read(params, _pinsSettingsList, _context) {
37
+ async read(params, _pinsSettingsList, context) {
38
+ var _context_protected;
36
39
  const { path, version = 'v2', headers = {} } = params;
37
- return await this.call(path, 'GET', version, null, headers);
40
+ return await this.call(path, 'GET', version, null, headers, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
38
41
  }
39
- async update(params, _pinsSettingsList, _context) {
42
+ async update(params, _pinsSettingsList, context) {
43
+ var _context_protected;
40
44
  const { path, body = {}, version = 'v2', headers = {} } = params;
41
- return await this.call(path, 'PUT', version, body, headers);
45
+ return await this.call(path, 'PUT', version, body, headers, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
42
46
  }
43
- async partialUpdate(params, _pinsSettingsList, _context) {
47
+ async partialUpdate(params, _pinsSettingsList, context) {
48
+ var _context_protected;
44
49
  const { path, body = {}, version = 'v2', headers = {} } = params;
45
- return await this.call(path, 'PATCH', version, body, headers);
50
+ return await this.call(path, 'PATCH', version, body, headers, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
46
51
  }
47
- async remove(params, _pinsSettingsList, _context) {
52
+ async remove(params, _pinsSettingsList, context) {
53
+ var _context_protected;
48
54
  const { path, version = 'v2', headers = {} } = params;
49
- return await this.call(path, 'DELETE', version, null, headers);
55
+ return await this.call(path, 'DELETE', version, null, headers, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
50
56
  }
51
- async request(params, _pinsSettingsList, _context) {
57
+ async request(params, _pinsSettingsList, context) {
58
+ var _context_protected;
52
59
  const { path, method = 'GET', body = null, version = 'v2', headers = {} } = params;
53
- return await this.call(path, method, version, body, headers);
60
+ return await this.call(path, method, version, body, headers, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
54
61
  }
55
62
  constructor(context, params){
56
63
  var _context_privates_LINKEDIN_TOKEN, _ref;
package/index.esm.js CHANGED
@@ -11,8 +11,9 @@ function _extends() {
11
11
 
12
12
  const API_ENDPOINT = 'https://api.linkedin.com';
13
13
  let LinkedInService = class LinkedInService {
14
- async call(url, method, version, data = null, headers = {}) {
14
+ async call(url, method, version, data, headers, signal) {
15
15
  const response = await fetch(`${API_ENDPOINT}/${version}/${url}`, {
16
+ signal,
16
17
  method,
17
18
  headers: _extends({
18
19
  Authorization: `Bearer ${this.TOKEN}`,
@@ -24,29 +25,35 @@ let LinkedInService = class LinkedInService {
24
25
  if (!response.ok) throw new Error('[SKILL-LINKEDIN] REQUEST FAILED: ' + response.status);
25
26
  return await response.json();
26
27
  }
27
- async create(params, _pinsSettingsList, _context) {
28
+ async create(params, _pinsSettingsList, context) {
29
+ var _context_protected;
28
30
  const { path, body = {}, version = 'v2', headers = {} } = params;
29
- return await this.call(path, 'POST', version, body, headers);
31
+ return await this.call(path, 'POST', version, body, headers, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
30
32
  }
31
- async read(params, _pinsSettingsList, _context) {
33
+ async read(params, _pinsSettingsList, context) {
34
+ var _context_protected;
32
35
  const { path, version = 'v2', headers = {} } = params;
33
- return await this.call(path, 'GET', version, null, headers);
36
+ return await this.call(path, 'GET', version, null, headers, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
34
37
  }
35
- async update(params, _pinsSettingsList, _context) {
38
+ async update(params, _pinsSettingsList, context) {
39
+ var _context_protected;
36
40
  const { path, body = {}, version = 'v2', headers = {} } = params;
37
- return await this.call(path, 'PUT', version, body, headers);
41
+ return await this.call(path, 'PUT', version, body, headers, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
38
42
  }
39
- async partialUpdate(params, _pinsSettingsList, _context) {
43
+ async partialUpdate(params, _pinsSettingsList, context) {
44
+ var _context_protected;
40
45
  const { path, body = {}, version = 'v2', headers = {} } = params;
41
- return await this.call(path, 'PATCH', version, body, headers);
46
+ return await this.call(path, 'PATCH', version, body, headers, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
42
47
  }
43
- async remove(params, _pinsSettingsList, _context) {
48
+ async remove(params, _pinsSettingsList, context) {
49
+ var _context_protected;
44
50
  const { path, version = 'v2', headers = {} } = params;
45
- return await this.call(path, 'DELETE', version, null, headers);
51
+ return await this.call(path, 'DELETE', version, null, headers, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
46
52
  }
47
- async request(params, _pinsSettingsList, _context) {
53
+ async request(params, _pinsSettingsList, context) {
54
+ var _context_protected;
48
55
  const { path, method = 'GET', body = null, version = 'v2', headers = {} } = params;
49
- return await this.call(path, method, version, body, headers);
56
+ return await this.call(path, method, version, body, headers, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
50
57
  }
51
58
  constructor(context, params){
52
59
  var _context_privates_LINKEDIN_TOKEN, _ref;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-linkedin",
3
- "version": "0.48.3",
3
+ "version": "0.49.1",
4
4
  "dependencies": {},
5
5
  "main": "./index.cjs.js",
6
6
  "module": "./index.esm.js"