@linkedapi/linkedin-cli 1.2.13 → 1.2.14

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.
@@ -0,0 +1,26 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ export default class PostSearch extends BaseCommand {
3
+ static description: string;
4
+ static flags: {
5
+ term: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
6
+ limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ sort: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ 'date-posted': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ 'content-type': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ 'posted-by': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ 'from-members': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ 'from-companies': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ 'mentioning-members': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
+ 'mentioning-companies': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
15
+ 'author-companies': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
16
+ 'author-industries': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
17
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
18
+ fields: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
19
+ quiet: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
20
+ 'no-color': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
21
+ account: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
22
+ };
23
+ static examples: string[];
24
+ run(): Promise<void>;
25
+ }
26
+ //# sourceMappingURL=search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/commands/post/search.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAI5C,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAAW;IACjD,OAAgB,WAAW,SAAkC;IAE7D,OAAgB,KAAK;;;;;;;;;;;;;;;;;;MA0CnB;IAEF,OAAgB,QAAQ,WAItB;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA2ClC"}
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const _base_command_1 = require("../../base-command");
5
+ const formatter_1 = require("../../core/output/formatter");
6
+ const workflow_runner_1 = require("../../core/workflow/workflow-runner");
7
+ class PostSearch extends _base_command_1.BaseCommand {
8
+ static description = 'Search for posts on LinkedIn';
9
+ static flags = {
10
+ ..._base_command_1.BaseCommand.baseFlags,
11
+ term: core_1.Flags.string({
12
+ description: 'Search keyword or phrase, up to 50 characters',
13
+ }),
14
+ limit: core_1.Flags.integer({
15
+ description: 'Max results to return, up to 100',
16
+ }),
17
+ sort: core_1.Flags.string({
18
+ description: 'Sort order of the results',
19
+ options: ['topMatch', 'latest'],
20
+ }),
21
+ 'date-posted': core_1.Flags.string({
22
+ description: 'Filter by how recently the post was published',
23
+ options: ['past24Hours', 'pastWeek', 'pastMonth'],
24
+ }),
25
+ 'content-type': core_1.Flags.string({
26
+ description: 'Filter by content type',
27
+ options: ['videos', 'images', 'jobPosts', 'liveVideos', 'documents'],
28
+ }),
29
+ 'posted-by': core_1.Flags.string({
30
+ description: 'Filter by author relationship (comma-separated: me, firstConnections, peopleYouFollow)',
31
+ }),
32
+ 'from-members': core_1.Flags.string({
33
+ description: 'Filter by names of people whose posts to keep (comma-separated)',
34
+ }),
35
+ 'from-companies': core_1.Flags.string({
36
+ description: 'Filter by names of companies whose posts to keep (comma-separated)',
37
+ }),
38
+ 'mentioning-members': core_1.Flags.string({
39
+ description: 'Filter by names of people the post must mention (comma-separated)',
40
+ }),
41
+ 'mentioning-companies': core_1.Flags.string({
42
+ description: 'Filter by names of companies the post must mention (comma-separated)',
43
+ }),
44
+ 'author-companies': core_1.Flags.string({
45
+ description: 'Filter by names of companies the author works at (comma-separated)',
46
+ }),
47
+ 'author-industries': core_1.Flags.string({
48
+ description: 'Filter by industries the author works in (comma-separated)',
49
+ }),
50
+ };
51
+ static examples = [
52
+ '<%= config.bin %> post search --term "climate tech" --date-posted pastWeek --json',
53
+ '<%= config.bin %> post search --term "product launch" --content-type images --sort latest --limit 20 --json',
54
+ '<%= config.bin %> post search --term "hiring" --from-companies "Linked API" --posted-by "peopleYouFollow" --json',
55
+ ];
56
+ async run() {
57
+ const { flags } = await this.parse(PostSearch);
58
+ const client = await this.buildAuthenticatedClient();
59
+ const params = {};
60
+ if (flags.term)
61
+ params.term = flags.term;
62
+ if (flags.limit)
63
+ params.limit = flags.limit;
64
+ const filter = {};
65
+ if (flags.sort)
66
+ filter.sort = flags.sort;
67
+ if (flags['date-posted'])
68
+ filter.datePosted = flags['date-posted'];
69
+ if (flags['content-type'])
70
+ filter.contentType = flags['content-type'];
71
+ if (flags['posted-by'])
72
+ filter.postedBy = splitCsv(flags['posted-by']);
73
+ if (flags['from-members'])
74
+ filter.fromMembers = splitCsv(flags['from-members']);
75
+ if (flags['from-companies'])
76
+ filter.fromCompanies = splitCsv(flags['from-companies']);
77
+ if (flags['mentioning-members'])
78
+ filter.mentioningMembers = splitCsv(flags['mentioning-members']);
79
+ if (flags['mentioning-companies'])
80
+ filter.mentioningCompanies = splitCsv(flags['mentioning-companies']);
81
+ if (flags['author-companies'])
82
+ filter.authorCompanies = splitCsv(flags['author-companies']);
83
+ if (flags['author-industries'])
84
+ filter.authorIndustries = splitCsv(flags['author-industries']);
85
+ if (Object.keys(filter).length > 0) {
86
+ params.filter = filter;
87
+ }
88
+ try {
89
+ const result = await (0, workflow_runner_1.runWorkflow)(client.searchPosts, params, {
90
+ isQuiet: flags.quiet,
91
+ });
92
+ (0, formatter_1.formatOutput)({
93
+ data: result.data,
94
+ errors: result.errors,
95
+ isJson: flags.json,
96
+ fields: flags.fields,
97
+ isQuiet: flags.quiet,
98
+ });
99
+ }
100
+ catch (error) {
101
+ this.handleError(error);
102
+ }
103
+ }
104
+ }
105
+ exports.default = PostSearch;
106
+ function splitCsv(value) {
107
+ return value.split(',').map((s) => s.trim());
108
+ }
109
+ //# sourceMappingURL=search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/commands/post/search.ts"],"names":[],"mappings":";;AAAA,sCAAoC;AAEpC,iDAA4C;AAC5C,sDAAsD;AACtD,oEAA6D;AAE7D,MAAqB,UAAW,SAAQ,2BAAW;IACjD,MAAM,CAAU,WAAW,GAAG,8BAA8B,CAAC;IAE7D,MAAM,CAAU,KAAK,GAAG;QACtB,GAAG,2BAAW,CAAC,SAAS;QACxB,IAAI,EAAE,YAAK,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE,+CAA+C;SAC7D,CAAC;QACF,KAAK,EAAE,YAAK,CAAC,OAAO,CAAC;YACnB,WAAW,EAAE,kCAAkC;SAChD,CAAC;QACF,IAAI,EAAE,YAAK,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE,2BAA2B;YACxC,OAAO,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC;SAChC,CAAC;QAC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