Skip to content

Commit c5e8d97

Browse files
authored
Merging pull request #15576
* Added actions * Done requests changes
1 parent 5d177d5 commit c5e8d97

File tree

6 files changed

+155
-20
lines changed

6 files changed

+155
-20
lines changed

components/lessonspace/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import app from "../../lessonspace.app.mjs";
2+
3+
export default {
4+
key: "lessonspace-launch-space",
5+
name: "Launch Space",
6+
description: "Launch a unified space on Lessonspace. [See the documentation](https://api.thelessonspace.com/v2/docs/#tag/Spaces-greater-Launch)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
spaceId: {
12+
propDefinition: [
13+
app,
14+
"spaceId",
15+
],
16+
},
17+
name: {
18+
propDefinition: [
19+
app,
20+
"name",
21+
],
22+
},
23+
allowGuests: {
24+
propDefinition: [
25+
app,
26+
"allowGuests",
27+
],
28+
},
29+
recordContent: {
30+
propDefinition: [
31+
app,
32+
"recordContent",
33+
],
34+
},
35+
transcribe: {
36+
propDefinition: [
37+
app,
38+
"transcribe",
39+
],
40+
},
41+
recordAv: {
42+
propDefinition: [
43+
app,
44+
"recordAv",
45+
],
46+
},
47+
userName: {
48+
propDefinition: [
49+
app,
50+
"userName",
51+
],
52+
},
53+
},
54+
55+
async run({ $ }) {
56+
const response = await this.app.launchSpace({
57+
$,
58+
data: {
59+
id: this.spaceId,
60+
name: this.name,
61+
allow_guests: this.allowGuests,
62+
record_content: this.recordContent,
63+
transcribe: this.transcribe,
64+
record_av: this.recordAv,
65+
user: {
66+
name: this.userName,
67+
},
68+
},
69+
});
70+
$.export("$summary", `Successfully launched space named ${this.name}`);
71+
return response;
72+
},
73+
};

components/lessonspace/app/lessonspace.app.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
import { axios } from "@pipedream/platform";
2+
3+
export default {
4+
type: "app",
5+
app: "lessonspace",
6+
propDefinitions: {
7+
spaceId: {
8+
type: "string",
9+
label: "Space ID",
10+
description: "The ID of the Space",
11+
},
12+
name: {
13+
type: "string",
14+
label: "Name",
15+
description: "The name of the Space",
16+
},
17+
allowGuests: {
18+
type: "boolean",
19+
label: "Allow Guests",
20+
description: "Whether to allow guests or not in the Space",
21+
},
22+
recordContent: {
23+
type: "boolean",
24+
label: "Record Content",
25+
description: "Whether or not the space content will be recorded for this session",
26+
},
27+
transcribe: {
28+
type: "boolean",
29+
label: "Transcribe",
30+
description: "Whether or not a transcription will be generated for this session",
31+
},
32+
recordAv: {
33+
type: "boolean",
34+
label: "Record AV",
35+
description: "Whether or not audio and video will be recorded in this session",
36+
},
37+
userName: {
38+
type: "string",
39+
label: "User Name",
40+
description: "Full name of the person joining this space",
41+
},
42+
},
43+
methods: {
44+
_baseUrl() {
45+
return "https://api.thelessonspace.com/v2";
46+
},
47+
async _makeRequest(opts = {}) {
48+
const {
49+
$ = this,
50+
path,
51+
headers,
52+
...otherOpts
53+
} = opts;
54+
return axios($, {
55+
...otherOpts,
56+
url: this._baseUrl() + path,
57+
headers: {
58+
"Authorization": `Organisation ${this.$auth.api_key}`,
59+
...headers,
60+
},
61+
});
62+
},
63+
64+
async launchSpace(args = {}) {
65+
return this._makeRequest({
66+
path: "/spaces/launch/",
67+
method: "post",
68+
...args,
69+
});
70+
},
71+
},
72+
};
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
{
22
"name": "@pipedream/lessonspace",
3-
"version": "0.0.2",
3+
"version": "0.1.0",
44
"description": "Pipedream Lessonspace Components",
5-
"main": "dist/app/lessonspace.app.mjs",
5+
"main": "lessonspace.app.mjs",
66
"keywords": [
77
"pipedream",
88
"lessonspace"
99
],
10-
"files": ["dist"],
1110
"homepage": "https://pipedream.com/apps/lessonspace",
1211
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
1312
"publishConfig": {
1413
"access": "public"
14+
},
15+
"dependencies": {
16+
"@pipedream/platform": "^3.0.3"
1517
}
1618
}

pnpm-lock.yaml

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)