@digipair/skill-linkedin 0.113.1 → 0.114.2

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/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # skill-test
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Building
6
+
7
+ Run `nx build skill-linkedin` to build the library.
@@ -1,67 +1,48 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- function _extends() {
6
- _extends = Object.assign || function assign(target) {
7
- for(var i = 1; i < arguments.length; i++){
8
- var source = arguments[i];
9
- for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
10
- }
11
- return target;
12
- };
13
- return _extends.apply(this, arguments);
14
- }
15
-
16
- const API_ENDPOINT = 'https://api.linkedin.com';
3
+ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-unused-vars */ const API_ENDPOINT = 'https://api.linkedin.com';
17
4
  let LinkedInService = class LinkedInService {
5
+ constructor(context, params){
6
+ this.TOKEN = context.privates.LINKEDIN_TOKEN ?? params?.LINKEDIN_TOKEN ?? process.env['LINKEDIN_TOKEN'];
7
+ }
18
8
  async call(url, method, version, data, headers, signal) {
19
9
  const response = await fetch(`${API_ENDPOINT}/${version}/${url}`, {
20
10
  signal,
21
11
  method,
22
- headers: _extends({
12
+ headers: {
23
13
  Authorization: `Bearer ${this.TOKEN}`,
24
14
  Accept: 'application/json',
25
- 'Content-Type': 'application/json'
26
- }, headers),
15
+ 'Content-Type': 'application/json',
16
+ ...headers
17
+ },
27
18
  body: data ? JSON.stringify(data) : undefined
28
19
  });
29
20
  if (!response.ok) throw new Error('[SKILL-LINKEDIN] REQUEST FAILED: ' + response.status);
30
21
  return await response.json();
31
22
  }
32
23
  async create(params, _pinsSettingsList, context) {
33
- var _context_protected;
34
24
  const { path, body = {}, version = 'v2', headers = {} } = params;
35
- return await this.call(path, 'POST', version, body, headers, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
25
+ return await this.call(path, 'POST', version, body, headers, context.protected?.signal);
36
26
  }
37
27
  async read(params, _pinsSettingsList, context) {
38
- var _context_protected;
39
28
  const { path, version = 'v2', headers = {} } = params;
40
- return await this.call(path, 'GET', version, null, headers, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
29
+ return await this.call(path, 'GET', version, null, headers, context.protected?.signal);
41
30
  }
42
31
  async update(params, _pinsSettingsList, context) {
43
- var _context_protected;
44
32
  const { path, body = {}, version = 'v2', headers = {} } = params;
45
- return await this.call(path, 'PUT', version, body, headers, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
33
+ return await this.call(path, 'PUT', version, body, headers, context.protected?.signal);
46
34
  }
47
35
  async partialUpdate(params, _pinsSettingsList, context) {
48
- var _context_protected;
49
36
  const { path, body = {}, version = 'v2', headers = {} } = params;
50
- return await this.call(path, 'PATCH', version, body, headers, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
37
+ return await this.call(path, 'PATCH', version, body, headers, context.protected?.signal);
51
38
  }
52
39
  async remove(params, _pinsSettingsList, context) {
53
- var _context_protected;
54
40
  const { path, version = 'v2', headers = {} } = params;
55
- return await this.call(path, 'DELETE', version, null, headers, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
41
+ return await this.call(path, 'DELETE', version, null, headers, context.protected?.signal);
56
42
  }
57
43
  async request(params, _pinsSettingsList, context) {
58
- var _context_protected;
59
44
  const { path, method = 'GET', body = null, version = 'v2', headers = {} } = params;
60
- return await this.call(path, method, version, body, headers, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
61
- }
62
- constructor(context, params){
63
- var _context_privates_LINKEDIN_TOKEN, _ref;
64
- this.TOKEN = (_ref = (_context_privates_LINKEDIN_TOKEN = context.privates.LINKEDIN_TOKEN) != null ? _context_privates_LINKEDIN_TOKEN : params == null ? void 0 : params.LINKEDIN_TOKEN) != null ? _ref : process.env['LINKEDIN_TOKEN'];
45
+ return await this.call(path, method, version, body, headers, context.protected?.signal);
65
46
  }
66
47
  };
67
48
  const create = (params, pinsSettingsList, context)=>new LinkedInService(context, params).create(params, pinsSettingsList, context);
@@ -1,63 +1,46 @@
1
- function _extends() {
2
- _extends = Object.assign || function assign(target) {
3
- for(var i = 1; i < arguments.length; i++){
4
- var source = arguments[i];
5
- for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
6
- }
7
- return target;
8
- };
9
- return _extends.apply(this, arguments);
10
- }
11
-
12
- const API_ENDPOINT = 'https://api.linkedin.com';
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-unused-vars */ const API_ENDPOINT = 'https://api.linkedin.com';
13
2
  let LinkedInService = class LinkedInService {
3
+ constructor(context, params){
4
+ this.TOKEN = context.privates.LINKEDIN_TOKEN ?? params?.LINKEDIN_TOKEN ?? process.env['LINKEDIN_TOKEN'];
5
+ }
14
6
  async call(url, method, version, data, headers, signal) {
15
7
  const response = await fetch(`${API_ENDPOINT}/${version}/${url}`, {
16
8
  signal,
17
9
  method,
18
- headers: _extends({
10
+ headers: {
19
11
  Authorization: `Bearer ${this.TOKEN}`,
20
12
  Accept: 'application/json',
21
- 'Content-Type': 'application/json'
22
- }, headers),
13
+ 'Content-Type': 'application/json',
14
+ ...headers
15
+ },
23
16
  body: data ? JSON.stringify(data) : undefined
24
17
  });
25
18
  if (!response.ok) throw new Error('[SKILL-LINKEDIN] REQUEST FAILED: ' + response.status);
26
19
  return await response.json();
27
20
  }
28
21
  async create(params, _pinsSettingsList, context) {
29
- var _context_protected;
30
22
  const { path, body = {}, version = 'v2', headers = {} } = params;
31
- return await this.call(path, 'POST', version, body, headers, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
23
+ return await this.call(path, 'POST', version, body, headers, context.protected?.signal);
32
24
  }
33
25
  async read(params, _pinsSettingsList, context) {
34
- var _context_protected;
35
26
  const { path, version = 'v2', headers = {} } = params;
36
- return await this.call(path, 'GET', version, null, headers, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
27
+ return await this.call(path, 'GET', version, null, headers, context.protected?.signal);
37
28
  }
38
29
  async update(params, _pinsSettingsList, context) {
39
- var _context_protected;
40
30
  const { path, body = {}, version = 'v2', headers = {} } = params;
41
- return await this.call(path, 'PUT', version, body, headers, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
31
+ return await this.call(path, 'PUT', version, body, headers, context.protected?.signal);
42
32
  }
43
33
  async partialUpdate(params, _pinsSettingsList, context) {
44
- var _context_protected;
45
34
  const { path, body = {}, version = 'v2', headers = {} } = params;
46
- return await this.call(path, 'PATCH', version, body, headers, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
35
+ return await this.call(path, 'PATCH', version, body, headers, context.protected?.signal);
47
36
  }
48
37
  async remove(params, _pinsSettingsList, context) {
49
- var _context_protected;
50
38
  const { path, version = 'v2', headers = {} } = params;
51
- return await this.call(path, 'DELETE', version, null, headers, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
39
+ return await this.call(path, 'DELETE', version, null, headers, context.protected?.signal);
52
40
  }
53
41
  async request(params, _pinsSettingsList, context) {
54
- var _context_protected;
55
42
  const { path, method = 'GET', body = null, version = 'v2', headers = {} } = params;
56
- return await this.call(path, method, version, body, headers, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
57
- }
58
- constructor(context, params){
59
- var _context_privates_LINKEDIN_TOKEN, _ref;
60
- this.TOKEN = (_ref = (_context_privates_LINKEDIN_TOKEN = context.privates.LINKEDIN_TOKEN) != null ? _context_privates_LINKEDIN_TOKEN : params == null ? void 0 : params.LINKEDIN_TOKEN) != null ? _ref : process.env['LINKEDIN_TOKEN'];
43
+ return await this.call(path, method, version, body, headers, context.protected?.signal);
61
44
  }
62
45
  };
63
46
  const create = (params, pinsSettingsList, context)=>new LinkedInService(context, params).create(params, pinsSettingsList, context);
@@ -1 +1,2 @@
1
1
  export * from './lib/skill-linkedin';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
@@ -5,3 +5,4 @@ export declare const update: (params: any, pinsSettingsList: PinsSettings[], con
5
5
  export declare const partialUpdate: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
6
6
  export declare const remove: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
7
7
  export declare const request: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
8
+ //# sourceMappingURL=skill-linkedin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-linkedin.d.ts","sourceRoot":"","sources":["../../../src/lib/skill-linkedin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AA4DhD,eAAO,MAAM,MAAM,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBACF,CAAC;AAEjF,eAAO,MAAM,IAAI,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBACF,CAAC;AAE/E,eAAO,MAAM,MAAM,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBACF,CAAC;AAEjF,eAAO,MAAM,aAAa,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBACT,CAAC;AAEjF,eAAO,MAAM,MAAM,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBACF,CAAC;AAEjF,eAAO,MAAM,OAAO,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBACF,CAAC"}
package/package.json CHANGED
@@ -1,12 +1,33 @@
1
1
  {
2
2
  "name": "@digipair/skill-linkedin",
3
- "version": "0.113.1",
3
+ "version": "0.114.2",
4
+ "main": "./dist/index.cjs.js",
5
+ "module": "./dist/index.esm.js",
6
+ "types": "./dist/index.d.ts",
4
7
  "keywords": [
5
8
  "digipair",
6
9
  "service",
7
10
  "tool"
8
11
  ],
9
- "dependencies": {},
10
- "main": "./index.cjs.js",
11
- "module": "./index.esm.js"
12
- }
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "import": "./dist/index.esm.js",
16
+ "default": "./dist/index.cjs.js"
17
+ },
18
+ "./index.esm.js": "./dist/index.esm.js",
19
+ "./index.cjs.js": "./dist/index.cjs.js",
20
+ "./package.json": "./package.json",
21
+ "./schema.json": "./dist/schema.json",
22
+ "./schema.fr.json": "./dist/schema.fr.json"
23
+ },
24
+ "files": [
25
+ "dist",
26
+ "README.md",
27
+ "package.json"
28
+ ],
29
+ "nx": {
30
+ "name": "skill-linkedin"
31
+ },
32
+ "dependencies": {}
33
+ }
package/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './libs/skill-linkedin/src/index';
File without changes
File without changes
File without changes