@digipair/skill-linkedin 0.89.0 → 0.91.0-0

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/.swcrc ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "jsc": {
3
+ "target": "es2017",
4
+ "parser": {
5
+ "syntax": "typescript",
6
+ "decorators": true,
7
+ "dynamicImport": true
8
+ },
9
+ "transform": {
10
+ "decoratorMetadata": true,
11
+ "legacyDecorator": true
12
+ },
13
+ "keepClassNames": true,
14
+ "externalHelpers": true,
15
+ "loose": true
16
+ },
17
+ "module": {
18
+ "type": "es6"
19
+ },
20
+ "sourceMaps": true,
21
+ "exclude": [
22
+ "jest.config.ts",
23
+ ".*\\.spec.tsx?$",
24
+ ".*\\.test.tsx?$",
25
+ "./src/jest-setup.ts$",
26
+ "./**/jest-setup.ts$"
27
+ ]
28
+ }
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # mylib
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Building
6
+
7
+ Run `nx build mylib` to build the library.
@@ -0,0 +1,22 @@
1
+ import baseConfig from '../../eslint.config.mjs';
2
+
3
+ export default [
4
+ ...baseConfig,
5
+ {
6
+ files: ['**/*.json'],
7
+ rules: {
8
+ '@nx/dependency-checks': [
9
+ 'error',
10
+ {
11
+ ignoredFiles: [
12
+ '{projectRoot}/eslint.config.{js,cjs,mjs}',
13
+ '{projectRoot}/rollup.config.{js,ts,mjs,mts,cjs,cts}',
14
+ ],
15
+ },
16
+ ],
17
+ },
18
+ languageOptions: {
19
+ parser: await import('jsonc-eslint-parser'),
20
+ },
21
+ },
22
+ ];
package/package.json CHANGED
@@ -1,12 +1,28 @@
1
1
  {
2
2
  "name": "@digipair/skill-linkedin",
3
- "version": "0.89.0",
3
+ "version": "0.91.0-0",
4
+ "type": "module",
5
+ "main": "dist/libs/skill-linkedin/index.cjs.js",
6
+ "module": "dist/libs/skill-linkedin/index.esm.js",
7
+ "types": "dist/libs/skill-linkedin/index.esm.d.ts",
8
+ "exports": {
9
+ "./package.json": "./libs/skill-linkedin/package.json",
10
+ ".": {
11
+ "development": "./dist/libs/skill-linkedin/src/index.ts",
12
+ "types": "./dist/libs/skill-linkedin/index.esm.d.ts",
13
+ "import": "./dist/libs/skill-linkedin/index.esm.js",
14
+ "default": "./dist/libs/skill-linkedin/index.cjs.js"
15
+ }
16
+ },
4
17
  "keywords": [
5
18
  "digipair",
6
- "service",
7
- "tool"
19
+ "tool",
20
+ "service"
8
21
  ],
9
- "dependencies": {},
10
- "main": "./index.cjs.js",
11
- "module": "./index.esm.js"
12
- }
22
+ "nx": {
23
+ "name": "skill-linkedin"
24
+ },
25
+ "dependencies": {
26
+ "@digipair/engine": "0.91.0-0"
27
+ }
28
+ }
@@ -0,0 +1,28 @@
1
+ const { withNx } = require('@nx/rollup/with-nx');
2
+
3
+ module.exports = withNx(
4
+ {
5
+ main: 'libs/skill-linkedin/src/index.ts',
6
+ outputPath: 'dist/libs/skill-linkedin',
7
+ tsConfig: 'libs/skill-linkedin/tsconfig.lib.json',
8
+ compiler: 'swc',
9
+ format: ['esm', "cjs"],
10
+ assets: [
11
+ {
12
+ input: 'libs/skill-linkedin/',
13
+ glob: 'package.json',
14
+ output: '.'
15
+ },
16
+ {
17
+ input: 'libs/skill-linkedin/src/',
18
+ glob: '*.json',
19
+ output: '.'
20
+ }
21
+ ]
22
+ },
23
+ {
24
+ // Provide additional rollup configuration here. See: https://rollupjs.org/configuration-options
25
+ // e.g.
26
+ // output: { sourcemap: true },
27
+ }
28
+ );
@@ -0,0 +1,7 @@
1
+ import { skillLinkedin } from './skill-linkedin';
2
+
3
+ describe('skillLinkedin', () => {
4
+ it('should work', () => {
5
+ expect(skillLinkedin()).toEqual('skill-linkedin');
6
+ });
7
+ });
@@ -0,0 +1,79 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ /* eslint-disable @typescript-eslint/no-unused-vars */
3
+ import { PinsSettings } from '@digipair/engine';
4
+
5
+ const API_ENDPOINT = 'https://api.linkedin.com';
6
+
7
+ class LinkedInService {
8
+ private TOKEN: string;
9
+
10
+ constructor(context: any, params: any) {
11
+ this.TOKEN =
12
+ context.privates.LINKEDIN_TOKEN ?? params?.LINKEDIN_TOKEN ?? process.env['LINKEDIN_TOKEN'];
13
+ }
14
+
15
+ async call(url: string, method: string, version: string, data: any, headers: any, signal: AbortSignal): Promise<any> {
16
+ const response = await fetch(`${API_ENDPOINT}/${version}/${url}`, {
17
+ signal,
18
+ method,
19
+ headers: {
20
+ Authorization: `Bearer ${this.TOKEN}`,
21
+ Accept: 'application/json',
22
+ 'Content-Type': 'application/json',
23
+ ...headers,
24
+ },
25
+ body: data ? JSON.stringify(data) : undefined,
26
+ });
27
+ if (!response.ok) throw new Error('[SKILL-LINKEDIN] REQUEST FAILED: ' + response.status);
28
+ return await response.json();
29
+ }
30
+
31
+ async create(params: any, _pinsSettingsList: PinsSettings[], context: any): Promise<any> {
32
+ const { path, body = {}, version = 'v2', headers = {} } = params;
33
+ return await this.call(path, 'POST', version, body, headers, context.protected?.signal);
34
+ }
35
+
36
+ async read(params: any, _pinsSettingsList: PinsSettings[], context: any): Promise<any> {
37
+ const { path, version = 'v2', headers = {} } = params;
38
+ return await this.call(path, 'GET', version, null, headers, context.protected?.signal);
39
+ }
40
+
41
+ async update(params: any, _pinsSettingsList: PinsSettings[], context: any): Promise<any> {
42
+ const { path, body = {}, version = 'v2', headers = {} } = params;
43
+ return await this.call(path, 'PUT', version, body, headers, context.protected?.signal);
44
+ }
45
+
46
+ async partialUpdate(params: any, _pinsSettingsList: PinsSettings[], context: any): Promise<any> {
47
+ const { path, body = {}, version = 'v2', headers = {} } = params;
48
+ return await this.call(path, 'PATCH', version, body, headers, context.protected?.signal);
49
+ }
50
+
51
+
52
+ async remove(params: any, _pinsSettingsList: PinsSettings[], context: any): Promise<any> {
53
+ const { path, version = 'v2', headers = {} } = params;
54
+ return await this.call(path, 'DELETE', version, null, headers, context.protected?.signal);
55
+ }
56
+
57
+ async request(params: any, _pinsSettingsList: PinsSettings[], context: any): Promise<any> {
58
+ const { path, method = 'GET', body = null, version = 'v2', headers = {} } = params;
59
+ return await this.call(path, method, version, body, headers, context.protected?.signal);
60
+ }
61
+ }
62
+
63
+ export const create = (params: any, pinsSettingsList: PinsSettings[], context: any) =>
64
+ new LinkedInService(context, params).create(params, pinsSettingsList, context);
65
+
66
+ export const read = (params: any, pinsSettingsList: PinsSettings[], context: any) =>
67
+ new LinkedInService(context, params).read(params, pinsSettingsList, context);
68
+
69
+ export const update = (params: any, pinsSettingsList: PinsSettings[], context: any) =>
70
+ new LinkedInService(context, params).update(params, pinsSettingsList, context);
71
+
72
+ export const partialUpdate = (params: any, pinsSettingsList: PinsSettings[], context: any) =>
73
+ new LinkedInService(context, params).update(params, pinsSettingsList, context);
74
+
75
+ export const remove = (params: any, pinsSettingsList: PinsSettings[], context: any) =>
76
+ new LinkedInService(context, params).remove(params, pinsSettingsList, context);
77
+
78
+ export const request = (params: any, pinsSettingsList: PinsSettings[], context: any) =>
79
+ new LinkedInService(context, params).request(params, pinsSettingsList, context);
package/tsconfig.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "files": [],
4
+ "include": [],
5
+ "references": [
6
+ {
7
+ "path": "../engine"
8
+ },
9
+ {
10
+ "path": "./tsconfig.lib.json"
11
+ }
12
+ ]
13
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "rootDir": "src",
5
+ "outDir": "dist",
6
+ "tsBuildInfoFile": "dist/tsconfig.lib.tsbuildinfo",
7
+ "emitDeclarationOnly": true,
8
+ "module": "esnext",
9
+ "moduleResolution": "node",
10
+ "forceConsistentCasingInFileNames": true,
11
+ "types": ["node"]
12
+ },
13
+ "include": ["src/**/*.ts"],
14
+ "references": [
15
+ {
16
+ "path": "../engine/tsconfig.lib.json"
17
+ }
18
+ ]
19
+ }
package/index.cjs.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./src/index";
package/index.cjs.js DELETED
@@ -1,79 +0,0 @@
1
- 'use strict';
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';
17
- let LinkedInService = class LinkedInService {
18
- async call(url, method, version, data, headers, signal) {
19
- const response = await fetch(`${API_ENDPOINT}/${version}/${url}`, {
20
- signal,
21
- method,
22
- headers: _extends({
23
- Authorization: `Bearer ${this.TOKEN}`,
24
- Accept: 'application/json',
25
- 'Content-Type': 'application/json'
26
- }, headers),
27
- body: data ? JSON.stringify(data) : undefined
28
- });
29
- if (!response.ok) throw new Error('[SKILL-LINKEDIN] REQUEST FAILED: ' + response.status);
30
- return await response.json();
31
- }
32
- async create(params, _pinsSettingsList, context) {
33
- var _context_protected;
34
- 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);
36
- }
37
- async read(params, _pinsSettingsList, context) {
38
- var _context_protected;
39
- 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);
41
- }
42
- async update(params, _pinsSettingsList, context) {
43
- var _context_protected;
44
- 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);
46
- }
47
- async partialUpdate(params, _pinsSettingsList, context) {
48
- var _context_protected;
49
- 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);
51
- }
52
- async remove(params, _pinsSettingsList, context) {
53
- var _context_protected;
54
- 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);
56
- }
57
- async request(params, _pinsSettingsList, context) {
58
- var _context_protected;
59
- 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'];
65
- }
66
- };
67
- const create = (params, pinsSettingsList, context)=>new LinkedInService(context, params).create(params, pinsSettingsList, context);
68
- const read = (params, pinsSettingsList, context)=>new LinkedInService(context, params).read(params, pinsSettingsList, context);
69
- const update = (params, pinsSettingsList, context)=>new LinkedInService(context, params).update(params, pinsSettingsList, context);
70
- const partialUpdate = (params, pinsSettingsList, context)=>new LinkedInService(context, params).update(params, pinsSettingsList, context);
71
- const remove = (params, pinsSettingsList, context)=>new LinkedInService(context, params).remove(params, pinsSettingsList, context);
72
- const request = (params, pinsSettingsList, context)=>new LinkedInService(context, params).request(params, pinsSettingsList, context);
73
-
74
- exports.create = create;
75
- exports.partialUpdate = partialUpdate;
76
- exports.read = read;
77
- exports.remove = remove;
78
- exports.request = request;
79
- exports.update = update;
package/index.esm.js DELETED
@@ -1,70 +0,0 @@
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';
13
- let LinkedInService = class LinkedInService {
14
- async call(url, method, version, data, headers, signal) {
15
- const response = await fetch(`${API_ENDPOINT}/${version}/${url}`, {
16
- signal,
17
- method,
18
- headers: _extends({
19
- Authorization: `Bearer ${this.TOKEN}`,
20
- Accept: 'application/json',
21
- 'Content-Type': 'application/json'
22
- }, headers),
23
- body: data ? JSON.stringify(data) : undefined
24
- });
25
- if (!response.ok) throw new Error('[SKILL-LINKEDIN] REQUEST FAILED: ' + response.status);
26
- return await response.json();
27
- }
28
- async create(params, _pinsSettingsList, context) {
29
- var _context_protected;
30
- 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);
32
- }
33
- async read(params, _pinsSettingsList, context) {
34
- var _context_protected;
35
- 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);
37
- }
38
- async update(params, _pinsSettingsList, context) {
39
- var _context_protected;
40
- 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);
42
- }
43
- async partialUpdate(params, _pinsSettingsList, context) {
44
- var _context_protected;
45
- 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);
47
- }
48
- async remove(params, _pinsSettingsList, context) {
49
- var _context_protected;
50
- 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);
52
- }
53
- async request(params, _pinsSettingsList, context) {
54
- var _context_protected;
55
- 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'];
61
- }
62
- };
63
- const create = (params, pinsSettingsList, context)=>new LinkedInService(context, params).create(params, pinsSettingsList, context);
64
- const read = (params, pinsSettingsList, context)=>new LinkedInService(context, params).read(params, pinsSettingsList, context);
65
- const update = (params, pinsSettingsList, context)=>new LinkedInService(context, params).update(params, pinsSettingsList, context);
66
- const partialUpdate = (params, pinsSettingsList, context)=>new LinkedInService(context, params).update(params, pinsSettingsList, context);
67
- const remove = (params, pinsSettingsList, context)=>new LinkedInService(context, params).remove(params, pinsSettingsList, context);
68
- const request = (params, pinsSettingsList, context)=>new LinkedInService(context, params).request(params, pinsSettingsList, context);
69
-
70
- export { create, partialUpdate, read, remove, request, update };
@@ -1,7 +0,0 @@
1
- import { PinsSettings } from '@digipair/engine';
2
- export declare const create: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
3
- export declare const read: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
4
- export declare const update: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
5
- export declare const partialUpdate: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
6
- export declare const remove: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
7
- export declare const request: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
File without changes
File without changes
File without changes