@pipedream/excalidraw 0.0.1 → 0.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/create-collection/create-collection.mjs +38 -0
- package/actions/create-scene/create-scene.mjs +58 -0
- package/actions/delete-scene/delete-scene.mjs +37 -0
- package/actions/get-current-user/get-current-user.mjs +25 -0
- package/actions/get-scene/get-scene.mjs +52 -0
- package/actions/list-collections/list-collections.mjs +47 -0
- package/actions/list-scenes/list-scenes.mjs +85 -0
- package/actions/update-scene/update-scene.mjs +70 -0
- package/excalidraw.app.mjs +156 -5
- package/package.json +4 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import app from "../../excalidraw.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "excalidraw-create-collection",
|
|
5
|
+
name: "Create Collection",
|
|
6
|
+
description:
|
|
7
|
+
"Creates a new collection (folder) in the Excalidraw Plus workspace for organizing scenes."
|
|
8
|
+
+ " Returns the new collection's ID — pass it to **Create Scene** or **Update Scene** to add scenes to this collection."
|
|
9
|
+
+ " [See the documentation](https://plus.excalidraw.com/docs/api/collections/post)",
|
|
10
|
+
version: "0.0.1",
|
|
11
|
+
type: "action",
|
|
12
|
+
annotations: {
|
|
13
|
+
destructiveHint: false,
|
|
14
|
+
openWorldHint: true,
|
|
15
|
+
readOnlyHint: false,
|
|
16
|
+
},
|
|
17
|
+
props: {
|
|
18
|
+
app,
|
|
19
|
+
collectionName: {
|
|
20
|
+
propDefinition: [
|
|
21
|
+
app,
|
|
22
|
+
"collectionName",
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
async run({ $ }) {
|
|
27
|
+
const data = {
|
|
28
|
+
name: this.collectionName,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const collection = await this.app.createCollection({
|
|
32
|
+
$,
|
|
33
|
+
data,
|
|
34
|
+
});
|
|
35
|
+
$.export("$summary", `Created collection: ${collection.name || collection.id}`);
|
|
36
|
+
return collection;
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import app from "../../excalidraw.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "excalidraw-create-scene",
|
|
5
|
+
name: "Create Scene",
|
|
6
|
+
description:
|
|
7
|
+
"Creates a new scene (whiteboard) in the Excalidraw Plus workspace."
|
|
8
|
+
+ " The API requires a collection — if no `collectionId` is provided, the scene is placed in the default (Main) collection automatically."
|
|
9
|
+
+ " Use **List Collections** to find the collection ID if the user wants the scene in a specific folder."
|
|
10
|
+
+ " Returns the new scene's ID and metadata."
|
|
11
|
+
+ " [See the documentation](https://plus.excalidraw.com/docs/api/scenes/post)",
|
|
12
|
+
version: "0.0.1",
|
|
13
|
+
type: "action",
|
|
14
|
+
annotations: {
|
|
15
|
+
destructiveHint: false,
|
|
16
|
+
openWorldHint: true,
|
|
17
|
+
readOnlyHint: false,
|
|
18
|
+
},
|
|
19
|
+
props: {
|
|
20
|
+
app,
|
|
21
|
+
sceneName: {
|
|
22
|
+
propDefinition: [
|
|
23
|
+
app,
|
|
24
|
+
"sceneName",
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
collectionId: {
|
|
28
|
+
propDefinition: [
|
|
29
|
+
app,
|
|
30
|
+
"collectionId",
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
pinned: {
|
|
34
|
+
type: "boolean",
|
|
35
|
+
label: "Pinned",
|
|
36
|
+
description: "Whether to pin the scene to the top of the collection.",
|
|
37
|
+
optional: true,
|
|
38
|
+
default: false,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
async run({ $ }) {
|
|
42
|
+
const collectionId = this.collectionId
|
|
43
|
+
|| await this.app.getDefaultCollectionId($);
|
|
44
|
+
|
|
45
|
+
const data = {
|
|
46
|
+
name: this.sceneName,
|
|
47
|
+
pinned: this.pinned,
|
|
48
|
+
collectionId,
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const scene = await this.app.createScene({
|
|
52
|
+
$,
|
|
53
|
+
data,
|
|
54
|
+
});
|
|
55
|
+
$.export("$summary", `Created scene: ${scene.metadata?.name || scene.metadata?.id}`);
|
|
56
|
+
return scene;
|
|
57
|
+
},
|
|
58
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import app from "../../excalidraw.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "excalidraw-delete-scene",
|
|
5
|
+
name: "Delete Scene",
|
|
6
|
+
description:
|
|
7
|
+
"Permanently deletes an Excalidraw scene and all its drawing content. This action cannot be undone."
|
|
8
|
+
+ " Use **List Scenes** to find the scene ID before calling this tool."
|
|
9
|
+
+ " [See the documentation](https://plus.excalidraw.com/docs/api/scenes/sceneId-delete)",
|
|
10
|
+
version: "0.0.1",
|
|
11
|
+
type: "action",
|
|
12
|
+
annotations: {
|
|
13
|
+
destructiveHint: true,
|
|
14
|
+
openWorldHint: true,
|
|
15
|
+
readOnlyHint: false,
|
|
16
|
+
},
|
|
17
|
+
props: {
|
|
18
|
+
app,
|
|
19
|
+
sceneId: {
|
|
20
|
+
propDefinition: [
|
|
21
|
+
app,
|
|
22
|
+
"sceneId",
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
async run({ $ }) {
|
|
27
|
+
const response = await this.app.deleteScene({
|
|
28
|
+
$,
|
|
29
|
+
sceneId: this.sceneId,
|
|
30
|
+
});
|
|
31
|
+
$.export("$summary", `Deleted scene: ${this.sceneId}`);
|
|
32
|
+
return response ?? {
|
|
33
|
+
deleted: true,
|
|
34
|
+
id: this.sceneId,
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import app from "../../excalidraw.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "excalidraw-get-current-user",
|
|
5
|
+
name: "Get Current User",
|
|
6
|
+
description:
|
|
7
|
+
"Returns the current workspace context from Excalidraw Plus, including workspace ID, name, user IDs, and roles."
|
|
8
|
+
+ " Use this when the user asks 'who am I', 'what workspace am I in', or needs the workspace ID or user role."
|
|
9
|
+
+ " [See the documentation](https://plus.excalidraw.com/docs/api/workspace/workspaces-get)",
|
|
10
|
+
version: "0.0.1",
|
|
11
|
+
type: "action",
|
|
12
|
+
annotations: {
|
|
13
|
+
destructiveHint: false,
|
|
14
|
+
openWorldHint: true,
|
|
15
|
+
readOnlyHint: true,
|
|
16
|
+
},
|
|
17
|
+
props: {
|
|
18
|
+
app,
|
|
19
|
+
},
|
|
20
|
+
async run({ $ }) {
|
|
21
|
+
const workspace = await this.app.getWorkspace($);
|
|
22
|
+
$.export("$summary", `Workspace: ${workspace.name} (${workspace.id})`);
|
|
23
|
+
return workspace;
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import app from "../../excalidraw.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "excalidraw-get-scene",
|
|
5
|
+
name: "Get Scene",
|
|
6
|
+
description:
|
|
7
|
+
"Returns metadata for a specific Excalidraw scene, and optionally its full drawing content (elements JSON)."
|
|
8
|
+
+ " Use this when the user asks to view, inspect, or read a specific scene."
|
|
9
|
+
+ " Use **List Scenes** first to find the scene ID by name."
|
|
10
|
+
+ " Set `includeContent` to true only when the user explicitly asks for the drawing data — the content can be large."
|
|
11
|
+
+ " [See the documentation](https://plus.excalidraw.com/docs/api/scenes/sceneId-content-get)",
|
|
12
|
+
version: "0.0.1",
|
|
13
|
+
type: "action",
|
|
14
|
+
annotations: {
|
|
15
|
+
destructiveHint: false,
|
|
16
|
+
openWorldHint: true,
|
|
17
|
+
readOnlyHint: true,
|
|
18
|
+
},
|
|
19
|
+
props: {
|
|
20
|
+
app,
|
|
21
|
+
sceneId: {
|
|
22
|
+
propDefinition: [
|
|
23
|
+
app,
|
|
24
|
+
"sceneId",
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
includeContent: {
|
|
28
|
+
type: "boolean",
|
|
29
|
+
label: "Include Drawing Content",
|
|
30
|
+
description: "When true, also fetches the scene's drawing elements (the full canvas JSON). Only set this when the user explicitly asks for the drawing content.",
|
|
31
|
+
optional: true,
|
|
32
|
+
default: false,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
async run({ $ }) {
|
|
36
|
+
const scene = await this.app.getScene({
|
|
37
|
+
$,
|
|
38
|
+
sceneId: this.sceneId,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
if (this.includeContent) {
|
|
42
|
+
const content = await this.app.getSceneContent({
|
|
43
|
+
$,
|
|
44
|
+
sceneId: this.sceneId,
|
|
45
|
+
});
|
|
46
|
+
scene.content = content;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
$.export("$summary", `Retrieved scene: ${scene.metadata?.name || this.sceneId}`);
|
|
50
|
+
return scene;
|
|
51
|
+
},
|
|
52
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import app from "../../excalidraw.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "excalidraw-list-collections",
|
|
5
|
+
name: "List Collections",
|
|
6
|
+
description:
|
|
7
|
+
"Returns all collections (folders) in the Excalidraw Plus workspace."
|
|
8
|
+
+ " Use this to discover available collection IDs and names before filtering scenes by collection or creating a scene in a specific collection."
|
|
9
|
+
+ " Cross-reference: pass a collection ID from this result to **List Scenes** or **Create Scene**."
|
|
10
|
+
+ " [See the documentation](https://plus.excalidraw.com/docs/api/collections/get)",
|
|
11
|
+
version: "0.0.1",
|
|
12
|
+
type: "action",
|
|
13
|
+
annotations: {
|
|
14
|
+
destructiveHint: false,
|
|
15
|
+
openWorldHint: true,
|
|
16
|
+
readOnlyHint: true,
|
|
17
|
+
},
|
|
18
|
+
props: {
|
|
19
|
+
app,
|
|
20
|
+
limit: {
|
|
21
|
+
propDefinition: [
|
|
22
|
+
app,
|
|
23
|
+
"limit",
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
offset: {
|
|
27
|
+
propDefinition: [
|
|
28
|
+
app,
|
|
29
|
+
"offset",
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
async run({ $ }) {
|
|
34
|
+
const params = {
|
|
35
|
+
limit: this.limit,
|
|
36
|
+
offset: this.offset,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const response = await this.app.listCollections({
|
|
40
|
+
$,
|
|
41
|
+
params,
|
|
42
|
+
});
|
|
43
|
+
const collections = response.data ?? [];
|
|
44
|
+
$.export("$summary", `Retrieved ${collections.length} collection(s)`);
|
|
45
|
+
return response;
|
|
46
|
+
},
|
|
47
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import app from "../../excalidraw.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "excalidraw-list-scenes",
|
|
5
|
+
name: "List Scenes",
|
|
6
|
+
description:
|
|
7
|
+
"Returns scenes (whiteboards) in the Excalidraw Plus workspace."
|
|
8
|
+
+ " Optionally filter by collection ID or apply a name substring filter (applied client-side, since the API has no server-side search)."
|
|
9
|
+
+ " When the user says 'scenes in [collection]', use **List Collections** first to get the collection ID, then pass it as `collectionId` here."
|
|
10
|
+
+ " Use `nameFilter` (and `limit`) to narrow results when the user asks for a scene by name — the tool fetches up to `limit` scenes and returns only those whose name contains the filter string."
|
|
11
|
+
+ " [See the documentation](https://plus.excalidraw.com/docs/api/scenes/get)",
|
|
12
|
+
version: "0.0.1",
|
|
13
|
+
type: "action",
|
|
14
|
+
annotations: {
|
|
15
|
+
destructiveHint: false,
|
|
16
|
+
openWorldHint: true,
|
|
17
|
+
readOnlyHint: true,
|
|
18
|
+
},
|
|
19
|
+
props: {
|
|
20
|
+
app,
|
|
21
|
+
collectionId: {
|
|
22
|
+
propDefinition: [
|
|
23
|
+
app,
|
|
24
|
+
"collectionId",
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
nameFilter: {
|
|
28
|
+
type: "string",
|
|
29
|
+
label: "Name Filter",
|
|
30
|
+
description: "Filter scenes by name (case-insensitive substring match, applied client-side).",
|
|
31
|
+
optional: true,
|
|
32
|
+
},
|
|
33
|
+
limit: {
|
|
34
|
+
propDefinition: [
|
|
35
|
+
app,
|
|
36
|
+
"limit",
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
async run({ $ }) {
|
|
41
|
+
if (!this.nameFilter) {
|
|
42
|
+
const response = await this.app.listScenes({
|
|
43
|
+
$,
|
|
44
|
+
params: {
|
|
45
|
+
collectionId: this.collectionId,
|
|
46
|
+
limit: this.limit,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
const scenes = response.data ?? [];
|
|
50
|
+
$.export("$summary", `Retrieved ${scenes.length} scene(s)`);
|
|
51
|
+
return scenes;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// When nameFilter is active, paginate to collect enough matches.
|
|
55
|
+
// The user's limit caps how many matches to return (default 100).
|
|
56
|
+
const maxResults = this.limit ?? 100;
|
|
57
|
+
const filter = this.nameFilter.toLowerCase();
|
|
58
|
+
const matches = [];
|
|
59
|
+
let offset = 0;
|
|
60
|
+
let hasNextPage = true;
|
|
61
|
+
|
|
62
|
+
while (hasNextPage && matches.length < maxResults) {
|
|
63
|
+
const response = await this.app.listScenes({
|
|
64
|
+
$,
|
|
65
|
+
params: {
|
|
66
|
+
collectionId: this.collectionId,
|
|
67
|
+
limit: 100,
|
|
68
|
+
offset,
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
const chunk = response.data ?? [];
|
|
72
|
+
for (const scene of chunk) {
|
|
73
|
+
if (scene.metadata?.name?.toLowerCase().includes(filter)) {
|
|
74
|
+
matches.push(scene);
|
|
75
|
+
if (matches.length === maxResults) break;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
offset += chunk.length;
|
|
79
|
+
hasNextPage = response.hasNextPage && chunk.length > 0;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
$.export("$summary", `Retrieved ${matches.length} scene(s)`);
|
|
83
|
+
return matches;
|
|
84
|
+
},
|
|
85
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ConfigurationError } from "@pipedream/platform";
|
|
2
|
+
import app from "../../excalidraw.app.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "excalidraw-update-scene",
|
|
6
|
+
name: "Update Scene",
|
|
7
|
+
description:
|
|
8
|
+
"Updates an existing Excalidraw scene's name or collection membership."
|
|
9
|
+
+ " Use **List Scenes** to find the scene ID, and **List Collections** to find a collection ID if moving the scene."
|
|
10
|
+
+ " Only the fields you provide are updated — omitted fields remain unchanged."
|
|
11
|
+
+ " Note: the Excalidraw API does not support a description field on scenes."
|
|
12
|
+
+ " [See the documentation](https://plus.excalidraw.com/docs/api/scenes/sceneId-patch)",
|
|
13
|
+
version: "0.0.1",
|
|
14
|
+
type: "action",
|
|
15
|
+
annotations: {
|
|
16
|
+
destructiveHint: false,
|
|
17
|
+
openWorldHint: true,
|
|
18
|
+
readOnlyHint: false,
|
|
19
|
+
},
|
|
20
|
+
props: {
|
|
21
|
+
app,
|
|
22
|
+
sceneId: {
|
|
23
|
+
propDefinition: [
|
|
24
|
+
app,
|
|
25
|
+
"sceneId",
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
sceneName: {
|
|
29
|
+
propDefinition: [
|
|
30
|
+
app,
|
|
31
|
+
"sceneName",
|
|
32
|
+
],
|
|
33
|
+
optional: true,
|
|
34
|
+
},
|
|
35
|
+
collectionId: {
|
|
36
|
+
propDefinition: [
|
|
37
|
+
app,
|
|
38
|
+
"collectionId",
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
pinned: {
|
|
42
|
+
type: "boolean",
|
|
43
|
+
label: "Pinned",
|
|
44
|
+
description: "Whether to pin the scene to the top of the collection.",
|
|
45
|
+
optional: true,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
async run({ $ }) {
|
|
49
|
+
const nothingProvided = this.sceneName === undefined
|
|
50
|
+
&& this.collectionId === undefined
|
|
51
|
+
&& this.pinned === undefined;
|
|
52
|
+
if (nothingProvided) {
|
|
53
|
+
throw new ConfigurationError("Provide at least one of: sceneName, collectionId, pinned.");
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const data = {
|
|
57
|
+
name: this.sceneName,
|
|
58
|
+
collectionId: this.collectionId,
|
|
59
|
+
pinned: this.pinned,
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const scene = await this.app.updateScene({
|
|
63
|
+
$,
|
|
64
|
+
sceneId: this.sceneId,
|
|
65
|
+
data,
|
|
66
|
+
});
|
|
67
|
+
$.export("$summary", `Updated scene: ${scene.metadata?.name || this.sceneId}`);
|
|
68
|
+
return scene;
|
|
69
|
+
},
|
|
70
|
+
};
|
package/excalidraw.app.mjs
CHANGED
|
@@ -1,11 +1,162 @@
|
|
|
1
|
+
import { axios } from "@pipedream/platform";
|
|
2
|
+
|
|
1
3
|
export default {
|
|
2
4
|
type: "app",
|
|
3
5
|
app: "excalidraw",
|
|
4
|
-
propDefinitions: {
|
|
6
|
+
propDefinitions: {
|
|
7
|
+
sceneId: {
|
|
8
|
+
type: "string",
|
|
9
|
+
label: "Scene ID",
|
|
10
|
+
description: "The unique identifier of the scene. Use **List Scenes** to find scene IDs. Example: `4towcktqVl9`.",
|
|
11
|
+
},
|
|
12
|
+
collectionId: {
|
|
13
|
+
type: "string",
|
|
14
|
+
label: "Collection ID",
|
|
15
|
+
description: "The unique identifier of the collection. Use **List Collections** to find collection IDs. Example: `77i8dL6qc5t`.",
|
|
16
|
+
optional: true,
|
|
17
|
+
},
|
|
18
|
+
sceneName: {
|
|
19
|
+
type: "string",
|
|
20
|
+
label: "Name",
|
|
21
|
+
description: "The name of the scene.",
|
|
22
|
+
},
|
|
23
|
+
collectionName: {
|
|
24
|
+
type: "string",
|
|
25
|
+
label: "Name",
|
|
26
|
+
description: "The name of the collection.",
|
|
27
|
+
},
|
|
28
|
+
limit: {
|
|
29
|
+
type: "integer",
|
|
30
|
+
label: "Limit",
|
|
31
|
+
description: "Maximum number of results to return.",
|
|
32
|
+
optional: true,
|
|
33
|
+
default: 100,
|
|
34
|
+
},
|
|
35
|
+
offset: {
|
|
36
|
+
type: "integer",
|
|
37
|
+
label: "Offset",
|
|
38
|
+
description: "The number of items to skip before starting to collect the result set.",
|
|
39
|
+
optional: true,
|
|
40
|
+
min: 0,
|
|
41
|
+
max: 9007199254740991,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
5
44
|
methods: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
45
|
+
_baseUrl() {
|
|
46
|
+
return "https://api.excalidraw.com/api/v1";
|
|
47
|
+
},
|
|
48
|
+
_headers() {
|
|
49
|
+
return {
|
|
50
|
+
"Authorization": `Bearer ${this.$auth.api_key}`,
|
|
51
|
+
"Content-Type": "application/json",
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
_makeRequest({
|
|
55
|
+
$ = this,
|
|
56
|
+
method = "GET",
|
|
57
|
+
path,
|
|
58
|
+
params,
|
|
59
|
+
data,
|
|
60
|
+
...opts
|
|
61
|
+
}) {
|
|
62
|
+
return axios($, {
|
|
63
|
+
method,
|
|
64
|
+
url: `${this._baseUrl()}${path}`,
|
|
65
|
+
headers: this._headers(),
|
|
66
|
+
params,
|
|
67
|
+
data,
|
|
68
|
+
...opts,
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
getWorkspace($) {
|
|
72
|
+
return this._makeRequest({
|
|
73
|
+
$,
|
|
74
|
+
path: "/workspaces",
|
|
75
|
+
});
|
|
76
|
+
},
|
|
77
|
+
listScenes({
|
|
78
|
+
$, params,
|
|
79
|
+
}) {
|
|
80
|
+
return this._makeRequest({
|
|
81
|
+
$,
|
|
82
|
+
path: "/scenes",
|
|
83
|
+
params,
|
|
84
|
+
});
|
|
85
|
+
},
|
|
86
|
+
getScene({
|
|
87
|
+
$, sceneId,
|
|
88
|
+
}) {
|
|
89
|
+
return this._makeRequest({
|
|
90
|
+
$,
|
|
91
|
+
path: `/scenes/${sceneId}`,
|
|
92
|
+
});
|
|
93
|
+
},
|
|
94
|
+
getSceneContent({
|
|
95
|
+
$, sceneId,
|
|
96
|
+
}) {
|
|
97
|
+
return this._makeRequest({
|
|
98
|
+
$,
|
|
99
|
+
path: `/scenes/${sceneId}/content`,
|
|
100
|
+
});
|
|
101
|
+
},
|
|
102
|
+
listCollections({
|
|
103
|
+
$, params,
|
|
104
|
+
}) {
|
|
105
|
+
return this._makeRequest({
|
|
106
|
+
$,
|
|
107
|
+
path: "/collections",
|
|
108
|
+
params,
|
|
109
|
+
});
|
|
110
|
+
},
|
|
111
|
+
async getDefaultCollectionId($) {
|
|
112
|
+
const response = await this.listCollections({
|
|
113
|
+
$,
|
|
114
|
+
params: {
|
|
115
|
+
limit: 100,
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
const collections = response.data;
|
|
119
|
+
const defaultCol = collections.find((c) => c.isDefault) ?? collections[0];
|
|
120
|
+
return defaultCol?.id;
|
|
121
|
+
},
|
|
122
|
+
createScene({
|
|
123
|
+
$, data,
|
|
124
|
+
}) {
|
|
125
|
+
return this._makeRequest({
|
|
126
|
+
$,
|
|
127
|
+
method: "POST",
|
|
128
|
+
path: "/scenes",
|
|
129
|
+
data,
|
|
130
|
+
});
|
|
131
|
+
},
|
|
132
|
+
updateScene({
|
|
133
|
+
$, sceneId, data,
|
|
134
|
+
}) {
|
|
135
|
+
return this._makeRequest({
|
|
136
|
+
$,
|
|
137
|
+
method: "PATCH",
|
|
138
|
+
path: `/scenes/${sceneId}`,
|
|
139
|
+
data,
|
|
140
|
+
});
|
|
141
|
+
},
|
|
142
|
+
deleteScene({
|
|
143
|
+
$, sceneId,
|
|
144
|
+
}) {
|
|
145
|
+
return this._makeRequest({
|
|
146
|
+
$,
|
|
147
|
+
method: "DELETE",
|
|
148
|
+
path: `/scenes/${sceneId}`,
|
|
149
|
+
});
|
|
150
|
+
},
|
|
151
|
+
createCollection({
|
|
152
|
+
$, data,
|
|
153
|
+
}) {
|
|
154
|
+
return this._makeRequest({
|
|
155
|
+
$,
|
|
156
|
+
method: "POST",
|
|
157
|
+
path: "/collections",
|
|
158
|
+
data,
|
|
159
|
+
});
|
|
9
160
|
},
|
|
10
161
|
},
|
|
11
|
-
};
|
|
162
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipedream/excalidraw",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Pipedream Excalidraw Components",
|
|
5
5
|
"main": "excalidraw.app.mjs",
|
|
6
6
|
"keywords": [
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
],
|
|
10
10
|
"homepage": "https://pipedream.com/apps/excalidraw",
|
|
11
11
|
"author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@pipedream/platform": "^3.1.1"
|
|
14
|
+
},
|
|
12
15
|
"publishConfig": {
|
|
13
16
|
"access": "public"
|
|
14
17
|
}
|