Skip to content

Commit d1df610

Browse files
committed
autodesk init
1 parent ac79b00 commit d1df610

File tree

8 files changed

+750
-3
lines changed

8 files changed

+750
-3
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import autodesk from "../../autodesk.app.mjs";
2+
3+
export default {
4+
key: "autodesk-create-project",
5+
name: "Create Project",
6+
description: "Creates a new project in Autodesk. [See the documentation](https://aps.autodesk.com/developer/documentation)",
7+
version: "0.0.{{ts}}",
8+
type: "action",
9+
props: {
10+
autodesk,
11+
projectName: {
12+
propDefinition: [
13+
autodesk,
14+
"projectName",
15+
],
16+
},
17+
projectDescription: {
18+
propDefinition: [
19+
autodesk,
20+
"projectDescription",
21+
],
22+
},
23+
targetWorkspaceId: {
24+
propDefinition: [
25+
autodesk,
26+
"targetWorkspaceId",
27+
],
28+
optional: true,
29+
},
30+
},
31+
async run({ $ }) {
32+
const project = await this.autodesk.createProject();
33+
$.export("$summary", `Created project ${project.name} (ID: ${project.id})`);
34+
return project;
35+
},
36+
};
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import autodesk from "../../autodesk.app.mjs";
2+
import { axios } from "@pipedream/platform";
3+
4+
export default {
5+
key: "autodesk-update-file-metadata",
6+
name: "Update File Metadata",
7+
description: "Updates metadata for an existing file in Autodesk. [See the documentation](https://aps.autodesk.com/developer/documentation)",
8+
version: "0.0.{{ts}}",
9+
type: "action",
10+
props: {
11+
autodesk,
12+
fileId: {
13+
propDefinition: [
14+
autodesk,
15+
"fileId",
16+
],
17+
},
18+
metadata: {
19+
propDefinition: [
20+
autodesk,
21+
"metadata",
22+
],
23+
},
24+
},
25+
async run({ $ }) {
26+
const response = await this.autodesk.updateMetadata();
27+
$.export("$summary", `Updated metadata for file ${this.fileId}`);
28+
return response;
29+
},
30+
};
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import autodesk from "../../autodesk.app.mjs";
2+
import { axios } from "@pipedream/platform";
3+
4+
export default {
5+
key: "autodesk-upload-file",
6+
name: "Upload File to Autodesk Project or Folder",
7+
description: "Uploads a new file to a specified project or folder in Autodesk. [See the documentation]().",
8+
version: "0.0.{{ts}}",
9+
type: "action",
10+
props: {
11+
autodesk,
12+
projectId: {
13+
propDefinition: [
14+
autodesk,
15+
"projectId",
16+
],
17+
},
18+
fileName: {
19+
type: "string",
20+
label: "File Name",
21+
description: "The name of the file to upload",
22+
},
23+
fileContent: {
24+
type: "string",
25+
label: "File Content",
26+
description: "The content of the file to upload",
27+
},
28+
folderId: {
29+
propDefinition: [
30+
autodesk,
31+
"folderId",
32+
],
33+
optional: true,
34+
},
35+
},
36+
async run({ $ }) {
37+
this.autodesk.projectId = this.projectId;
38+
this.autodesk.fileName = this.fileName;
39+
this.autodesk.fileContent = this.fileContent;
40+
if (this.folderId) {
41+
this.autodesk.folderId = this.folderId;
42+
}
43+
44+
const response = await this.autodesk.uploadFile();
45+
46+
$.export("$summary", `Uploaded file "${this.fileName}" to project "${this.projectId}"${this.folderId
47+
? ` and folder "${this.folderId}"`
48+
: ""}.`);
49+
return response;
50+
},
51+
};

0 commit comments

Comments
 (0)