@pipedream/linkedin 1.0.1 → 1.1.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/actions/get-member-organization-access-control/get-member-organization-access-control.mjs +8 -19
- package/actions/get-organization-access-control/get-organization-access-control.mjs +12 -8
- package/actions/get-organization-administrators/get-organization-administrators.mjs +9 -11
- package/actions/get-profile-picture-fields/get-profile-picture-fields.mjs +52 -0
- package/linkedin.app.mjs +7 -2
- package/package.json +1 -1
package/actions/get-member-organization-access-control/get-member-organization-access-control.mjs
CHANGED
|
@@ -3,8 +3,8 @@ import linkedin from "../../linkedin.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "linkedin-get-member-organization-access-control",
|
|
5
5
|
name: "Get Member's Organization Access Control Information",
|
|
6
|
-
description: "Gets the organization access control information of the current authenticated member. [See the
|
|
7
|
-
version: "0.
|
|
6
|
+
description: "Gets the organization access control information of the current authenticated member. [See the documentation](https://learn.microsoft.com/en-us/linkedin/marketing/community-management/organizations/organization-access-control-by-role?view=li-lms-2025-01&tabs=http#find-a-members-organization-access-control-information)",
|
|
7
|
+
version: "1.0.0",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
linkedin,
|
|
@@ -28,32 +28,21 @@ export default {
|
|
|
28
28
|
},
|
|
29
29
|
},
|
|
30
30
|
async run({ $ }) {
|
|
31
|
-
const count = 50;
|
|
32
|
-
const results = [];
|
|
33
|
-
|
|
34
31
|
const params = {
|
|
35
32
|
q: "roleAssignee",
|
|
36
33
|
role: this.role,
|
|
37
34
|
state: this.state,
|
|
38
35
|
start: 0,
|
|
39
|
-
count,
|
|
36
|
+
count: 1,
|
|
40
37
|
};
|
|
41
38
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
params,
|
|
47
|
-
});
|
|
48
|
-
results.push(...elements);
|
|
49
|
-
params.start += count;
|
|
50
|
-
if (elements?.length < count) {
|
|
51
|
-
done = true;
|
|
52
|
-
}
|
|
53
|
-
} while (results.length < this.max && !done);
|
|
39
|
+
const { data: { elements } } = await this.linkedin.getAccessControl({
|
|
40
|
+
$,
|
|
41
|
+
params,
|
|
42
|
+
});
|
|
54
43
|
|
|
55
44
|
$.export("$summary", "Successfully retrieved access control information");
|
|
56
45
|
|
|
57
|
-
return
|
|
46
|
+
return elements[0];
|
|
58
47
|
},
|
|
59
48
|
};
|
|
@@ -3,15 +3,17 @@ import linkedin from "../../linkedin.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "linkedin-get-organization-access-control",
|
|
5
5
|
name: "Gets Organization Access Control",
|
|
6
|
-
description: "Gets
|
|
7
|
-
version: "0.
|
|
6
|
+
description: "Gets a selected organization's access control information. [See the documentation](https://learn.microsoft.com/en-us/linkedin/marketing/community-management/organizations/organization-access-control-by-role?view=li-lms-2025-01&tabs=http#find-organization-access-control)",
|
|
7
|
+
version: "0.2.0",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
linkedin,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
organizationId: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
linkedin,
|
|
14
|
+
"organizationId",
|
|
15
|
+
],
|
|
16
|
+
description: "The ID of the organization for which the access control information is being retrieved",
|
|
15
17
|
},
|
|
16
18
|
max: {
|
|
17
19
|
propDefinition: [
|
|
@@ -25,12 +27,14 @@ export default {
|
|
|
25
27
|
const count = 50;
|
|
26
28
|
const results = [];
|
|
27
29
|
|
|
28
|
-
const
|
|
30
|
+
const organizationUrn = `urn:li:organization:${this.organizationId}`;
|
|
31
|
+
|
|
32
|
+
const params = `q=organization&organization=${organizationUrn.replace(/:/g, "%3A")}&count=${count}`;
|
|
29
33
|
|
|
30
34
|
let done = false;
|
|
31
35
|
do {
|
|
32
36
|
const { data: { elements } } = await this.linkedin.getAccessControl({
|
|
33
|
-
|
|
37
|
+
strParams: params + `&start=${start}`,
|
|
34
38
|
});
|
|
35
39
|
|
|
36
40
|
results.push(...elements);
|
|
@@ -3,21 +3,17 @@ import linkedin from "../../linkedin.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
key: "linkedin-get-organization-administrators",
|
|
5
5
|
name: "Get Organization Administrators",
|
|
6
|
-
description: "Gets the
|
|
7
|
-
version: "0.
|
|
6
|
+
description: "Gets the administrator members of a selected organization. [See the documentation](https://learn.microsoft.com/en-us/linkedin/marketing/community-management/organizations/organization-access-control-by-role?view=li-lms-2025-01&tabs=http#find-organization-administrators)",
|
|
7
|
+
version: "0.3.0",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
linkedin,
|
|
11
|
-
|
|
12
|
-
type: "string",
|
|
13
|
-
label: "Organization",
|
|
14
|
-
description: "The organizational entity for which administrators are being retrieved. Must be in URN format urn:li:organization:{id}.",
|
|
15
|
-
},
|
|
16
|
-
max: {
|
|
11
|
+
organizationId: {
|
|
17
12
|
propDefinition: [
|
|
18
13
|
linkedin,
|
|
19
|
-
"
|
|
14
|
+
"organizationId",
|
|
20
15
|
],
|
|
16
|
+
description: "The ID of the organization for which administrators are being retrieved",
|
|
21
17
|
},
|
|
22
18
|
},
|
|
23
19
|
async run({ $ }) {
|
|
@@ -25,12 +21,14 @@ export default {
|
|
|
25
21
|
const count = 50;
|
|
26
22
|
const results = [];
|
|
27
23
|
|
|
28
|
-
const
|
|
24
|
+
const organizationUrn = `urn:li:organization:${this.organizationId}`;
|
|
25
|
+
|
|
26
|
+
const params = `q=organization&organization=${organizationUrn.replace(/:/g, "%3A")}&role=ADMINISTRATOR&state=APPROVED&count=${count}`;
|
|
29
27
|
|
|
30
28
|
let done = false;
|
|
31
29
|
do {
|
|
32
30
|
const { data: { elements } } = await this.linkedin.getAccessControl({
|
|
33
|
-
|
|
31
|
+
strParams: params + `&start=${start}`,
|
|
34
32
|
});
|
|
35
33
|
|
|
36
34
|
results.push(...elements);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import linkedin from "../../linkedin.app.mjs";
|
|
2
|
+
import constants from "../../common/constants.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "linkedin-get-profile-picture-fields",
|
|
6
|
+
name: "Get Profile Picture Fields",
|
|
7
|
+
description: "Gets the authenticated user's profile picture data including display image and metadata. [See the documentation](https://learn.microsoft.com/en-us/linkedin/shared/references/v2/profile/profile-picture)",
|
|
8
|
+
version: "0.0.1",
|
|
9
|
+
type: "action",
|
|
10
|
+
props: {
|
|
11
|
+
linkedin,
|
|
12
|
+
includeOriginalImage: {
|
|
13
|
+
type: "boolean",
|
|
14
|
+
label: "Include Original Image",
|
|
15
|
+
description: "Whether to include the original image data in the response (requires special permissions)",
|
|
16
|
+
optional: true,
|
|
17
|
+
default: false,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
methods: {
|
|
21
|
+
getProfilePictureFields(args) {
|
|
22
|
+
return this.linkedin._makeRequest({
|
|
23
|
+
url: `${constants.BASE_URL}v2/me`,
|
|
24
|
+
...args,
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
async run({ $ }) {
|
|
29
|
+
let projection = "id,profilePicture(displayImage~digitalmediaAsset:playableStreams";
|
|
30
|
+
|
|
31
|
+
if (this.includeOriginalImage) {
|
|
32
|
+
projection += ",originalImage~digitalmediaAsset:playableStreams";
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
projection += ")";
|
|
36
|
+
|
|
37
|
+
const response = await this.getProfilePictureFields({
|
|
38
|
+
$,
|
|
39
|
+
params: {
|
|
40
|
+
projection: `(${projection})`,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
if (response.profilePicture) {
|
|
45
|
+
$.export("$summary", "Successfully retrieved profile picture fields");
|
|
46
|
+
} else {
|
|
47
|
+
$.export("$summary", "Profile retrieved, but no profile picture found for this account");
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return response;
|
|
51
|
+
},
|
|
52
|
+
};
|
package/linkedin.app.mjs
CHANGED
|
@@ -234,9 +234,14 @@ export default {
|
|
|
234
234
|
...args,
|
|
235
235
|
});
|
|
236
236
|
},
|
|
237
|
-
async getAccessControl({
|
|
237
|
+
async getAccessControl({
|
|
238
|
+
strParams, ...args
|
|
239
|
+
}) {
|
|
238
240
|
return this._makeRequestAxios({
|
|
239
|
-
path: `/organizationAcls
|
|
241
|
+
path: `/organizationAcls${strParams
|
|
242
|
+
? `?${strParams}`
|
|
243
|
+
: ""}`,
|
|
244
|
+
...args,
|
|
240
245
|
});
|
|
241
246
|
},
|
|
242
247
|
async queryAnaltyics(query, args = {} ) {
|