@canva/n8n-nodes-canva 0.1.8 → 0.2.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/README.md +151 -142
- package/dist/nodes/Canva/Canva.node.js +150 -148
- package/dist/nodes/Canva/Canva.node.js.map +1 -1
- package/dist/nodes/Canva/GenericFunctions.js +44 -4
- package/dist/nodes/Canva/GenericFunctions.js.map +1 -1
- package/dist/nodes/Canva/resources/asset/index.js +1 -1
- package/dist/nodes/Canva/resources/asset/index.js.map +1 -1
- package/dist/nodes/Canva/resources/design/index.js +2 -4
- package/dist/nodes/Canva/resources/design/index.js.map +1 -1
- package/dist/nodes/Canva/resources/designImport/createImageImport.js +43 -0
- package/dist/nodes/Canva/resources/designImport/createImageImport.js.map +1 -0
- package/dist/nodes/Canva/resources/designImport/createImageImportCreditsNotice.js +13 -0
- package/dist/nodes/Canva/resources/designImport/createImageImportCreditsNotice.js.map +1 -0
- package/dist/nodes/Canva/resources/designImport/createImageImportPreviewNotice.js +13 -0
- package/dist/nodes/Canva/resources/designImport/createImageImportPreviewNotice.js.map +1 -0
- package/dist/nodes/Canva/resources/designImport/index.js +12 -0
- package/dist/nodes/Canva/resources/designImport/index.js.map +1 -1
- package/dist/nodes/Canva/resources/generation/creditsNotice.js +13 -0
- package/dist/nodes/Canva/resources/generation/creditsNotice.js.map +1 -0
- package/dist/nodes/Canva/resources/generation/generateDesign.js +63 -0
- package/dist/nodes/Canva/resources/generation/generateDesign.js.map +1 -0
- package/dist/nodes/Canva/resources/generation/generateImage.js +92 -0
- package/dist/nodes/Canva/resources/generation/generateImage.js.map +1 -0
- package/dist/nodes/Canva/resources/generation/index.js +39 -0
- package/dist/nodes/Canva/resources/generation/index.js.map +1 -0
- package/dist/nodes/Canva/resources/generation/previewNotice.js +13 -0
- package/dist/nodes/Canva/resources/generation/previewNotice.js.map +1 -0
- package/dist/nodes/Canva/resources/imageTransformation/creditsNotice.js +13 -0
- package/dist/nodes/Canva/resources/imageTransformation/creditsNotice.js.map +1 -0
- package/dist/nodes/Canva/resources/imageTransformation/index.js +33 -0
- package/dist/nodes/Canva/resources/imageTransformation/index.js.map +1 -0
- package/dist/nodes/Canva/resources/imageTransformation/premiumNotice.js +13 -0
- package/dist/nodes/Canva/resources/imageTransformation/premiumNotice.js.map +1 -0
- package/dist/nodes/Canva/resources/imageTransformation/previewNotice.js +13 -0
- package/dist/nodes/Canva/resources/imageTransformation/previewNotice.js.map +1 -0
- package/dist/nodes/Canva/resources/imageTransformation/removeBackground.js +51 -0
- package/dist/nodes/Canva/resources/imageTransformation/removeBackground.js.map +1 -0
- package/dist/package.json +10 -2
- package/package.json +10 -2
- package/dist/nodes/Canva/resources/design/getDatasetPreviewNotice.js +0 -13
- package/dist/nodes/Canva/resources/design/getDatasetPreviewNotice.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -4,7 +4,6 @@ exports.designDescription = exports.designOperations = void 0;
|
|
|
4
4
|
const create_1 = require("./create");
|
|
5
5
|
const get_1 = require("./get");
|
|
6
6
|
const getDataset_1 = require("./getDataset");
|
|
7
|
-
const getDatasetPreviewNotice_1 = require("./getDatasetPreviewNotice");
|
|
8
7
|
const getAll_1 = require("./getAll");
|
|
9
8
|
const getExportFormats_1 = require("./getExportFormats");
|
|
10
9
|
const getPages_1 = require("./getPages");
|
|
@@ -30,7 +29,7 @@ exports.designOperations = [
|
|
|
30
29
|
action: 'Get a design',
|
|
31
30
|
},
|
|
32
31
|
{
|
|
33
|
-
name: 'Get Dataset
|
|
32
|
+
name: 'Get Dataset',
|
|
34
33
|
value: 'getDataset',
|
|
35
34
|
description: 'Get the autofill dataset for a design',
|
|
36
35
|
action: 'Get design dataset',
|
|
@@ -48,7 +47,7 @@ exports.designOperations = [
|
|
|
48
47
|
action: 'Get many designs',
|
|
49
48
|
},
|
|
50
49
|
{
|
|
51
|
-
name: 'Get Pages',
|
|
50
|
+
name: 'Get Pages (Preview)',
|
|
52
51
|
value: 'getPages',
|
|
53
52
|
description: 'Get metadata for pages in a design',
|
|
54
53
|
action: 'Get design pages',
|
|
@@ -61,7 +60,6 @@ exports.designDescription = [
|
|
|
61
60
|
...exports.designOperations,
|
|
62
61
|
...create_1.designCreateDescription,
|
|
63
62
|
...get_1.designGetDescription,
|
|
64
|
-
...getDatasetPreviewNotice_1.designGetDatasetPreviewNoticeDescription,
|
|
65
63
|
...getDataset_1.designGetDatasetDescription,
|
|
66
64
|
...getExportFormats_1.designGetExportFormatsDescription,
|
|
67
65
|
...getPagesPreviewNotice_1.designGetPagesPreviewNoticeDescription,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Canva/resources/design/index.ts"],"names":[],"mappings":";;;AACA,qCAAmD;AACnD,+BAA6C;AAC7C,6CAA2D;AAC3D,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Canva/resources/design/index.ts"],"names":[],"mappings":";;;AACA,qCAAmD;AACnD,+BAA6C;AAC7C,6CAA2D;AAC3D,qCAAmD;AACnD,yDAAuE;AACvE,yCAAuD;AACvD,mEAAiF;AAEpE,QAAA,gBAAgB,GAAsB;IAClD;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE;QAClD,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,qBAAqB;gBAClC,MAAM,EAAE,iBAAiB;aACzB;YACD;gBACC,IAAI,EAAE,KAAK;gBACX,KAAK,EAAE,KAAK;gBACZ,WAAW,EAAE,2BAA2B;gBACxC,MAAM,EAAE,cAAc;aACtB;YACD;gBACC,IAAI,EAAE,aAAa;gBACnB,KAAK,EAAE,YAAY;gBACnB,WAAW,EAAE,uCAAuC;gBACpD,MAAM,EAAE,oBAAoB;aAC5B;YACD;gBACC,IAAI,EAAE,oBAAoB;gBAC1B,KAAK,EAAE,kBAAkB;gBACzB,WAAW,EAAE,+CAA+C;gBAC5D,MAAM,EAAE,2BAA2B;aACnC;YACD;gBACC,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,2CAA2C;gBACxD,MAAM,EAAE,kBAAkB;aAC1B;YACD;gBACC,IAAI,EAAE,qBAAqB;gBAC3B,KAAK,EAAE,UAAU;gBACjB,WAAW,EAAE,oCAAoC;gBACjD,MAAM,EAAE,kBAAkB;aAC1B;SACD;QACD,OAAO,EAAE,QAAQ;KACjB;CACD,CAAC;AAEW,QAAA,iBAAiB,GAAsB;IACnD,GAAG,wBAAgB;IACnB,GAAG,gCAAuB;IAC1B,GAAG,0BAAoB;IACvB,GAAG,wCAA2B;IAC9B,GAAG,oDAAiC;IACpC,GAAG,8DAAsC;IACzC,GAAG,oCAAyB;IAC5B,GAAG,gCAAuB;CAC1B,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.designImportCreateImageImportDescription = void 0;
|
|
4
|
+
exports.designImportCreateImageImportDescription = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Asset ID',
|
|
7
|
+
name: 'assetId',
|
|
8
|
+
type: 'string',
|
|
9
|
+
default: '',
|
|
10
|
+
required: true,
|
|
11
|
+
displayOptions: { show: { resource: ['designImport'], operation: ['createImageImport'] } },
|
|
12
|
+
description: 'ID of the image asset to turn into an editable design. Works best with flat graphics such as posters, flyers, and banners. Vector images (SVG, EPS, AI) and videos are not supported.',
|
|
13
|
+
placeholder: 'Msd59349ff',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
displayName: 'Title',
|
|
17
|
+
name: 'title',
|
|
18
|
+
type: 'string',
|
|
19
|
+
default: '',
|
|
20
|
+
displayOptions: { show: { resource: ['designImport'], operation: ['createImageImport'] } },
|
|
21
|
+
description: 'Title for the new design (max 255 characters). If left empty, Canva generates one.',
|
|
22
|
+
placeholder: 'Summer Sale Poster',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
displayName: 'Poll Interval (Ms)',
|
|
26
|
+
name: 'pollInterval',
|
|
27
|
+
type: 'number',
|
|
28
|
+
typeOptions: { minValue: 500, maxValue: 30000 },
|
|
29
|
+
default: 3000,
|
|
30
|
+
displayOptions: { show: { resource: ['designImport'], operation: ['createImageImport'] } },
|
|
31
|
+
description: 'How often to check if the import job is complete (milliseconds)',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
displayName: 'Max Wait Time (Seconds)',
|
|
35
|
+
name: 'maxWait',
|
|
36
|
+
type: 'number',
|
|
37
|
+
typeOptions: { minValue: 10, maxValue: 600 },
|
|
38
|
+
default: 120,
|
|
39
|
+
displayOptions: { show: { resource: ['designImport'], operation: ['createImageImport'] } },
|
|
40
|
+
description: 'Maximum time to wait for the import to complete before timing out',
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
//# sourceMappingURL=createImageImport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createImageImport.js","sourceRoot":"","sources":["../../../../../nodes/Canva/resources/designImport/createImageImport.ts"],"names":[],"mappings":";;;AAEa,QAAA,wCAAwC,GAAsB;IAC1E;QACC,WAAW,EAAE,UAAU;QACvB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,cAAc,CAAC,EAAE,SAAS,EAAE,CAAC,mBAAmB,CAAC,EAAE,EAAE;QAC1F,WAAW,EACV,uLAAuL;QACxL,WAAW,EAAE,YAAY;KACzB;IACD;QACC,WAAW,EAAE,OAAO;QACpB,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,cAAc,CAAC,EAAE,SAAS,EAAE,CAAC,mBAAmB,CAAC,EAAE,EAAE;QAC1F,WAAW,EACV,oFAAoF;QACrF,WAAW,EAAE,oBAAoB;KACjC;IACD;QACC,WAAW,EAAE,oBAAoB;QACjC,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE;QAC/C,OAAO,EAAE,IAAI;QACb,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,cAAc,CAAC,EAAE,SAAS,EAAE,CAAC,mBAAmB,CAAC,EAAE,EAAE;QAC1F,WAAW,EAAE,iEAAiE;KAC9E;IACD;QACC,WAAW,EAAE,yBAAyB;QACtC,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE;QAC5C,OAAO,EAAE,GAAG;QACZ,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,cAAc,CAAC,EAAE,SAAS,EAAE,CAAC,mBAAmB,CAAC,EAAE,EAAE;QAC1F,WAAW,EAAE,mEAAmE;KAChF;CACD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.designImportCreateImageImportCreditsNoticeDescription = void 0;
|
|
4
|
+
exports.designImportCreateImageImportCreditsNoticeDescription = [
|
|
5
|
+
{
|
|
6
|
+
displayName: "✨ Uses AI credits: Each Magic Layers import uses the user's Canva AI credits, and Magic Layers must be allowed in the user's team permissions.",
|
|
7
|
+
name: 'designImportCreateImageImportCreditsNotice',
|
|
8
|
+
type: 'notice',
|
|
9
|
+
default: '',
|
|
10
|
+
displayOptions: { show: { resource: ['designImport'], operation: ['createImageImport'] } },
|
|
11
|
+
},
|
|
12
|
+
];
|
|
13
|
+
//# sourceMappingURL=createImageImportCreditsNotice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createImageImportCreditsNotice.js","sourceRoot":"","sources":["../../../../../nodes/Canva/resources/designImport/createImageImportCreditsNotice.ts"],"names":[],"mappings":";;;AAEa,QAAA,qDAAqD,GAAsB;IACvF;QACC,WAAW,EACV,gJAAgJ;QACjJ,IAAI,EAAE,4CAA4C;QAClD,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,cAAc,CAAC,EAAE,SAAS,EAAE,CAAC,mBAAmB,CAAC,EAAE,EAAE;KAC1F;CACD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.designImportCreateImageImportPreviewNoticeDescription = void 0;
|
|
4
|
+
exports.designImportCreateImageImportPreviewNoticeDescription = [
|
|
5
|
+
{
|
|
6
|
+
displayName: '⚠️ Preview API: This operation may have unannounced breaking changes and cannot be used in public integrations submitted for Canva review.',
|
|
7
|
+
name: 'designImportCreateImageImportPreviewNotice',
|
|
8
|
+
type: 'notice',
|
|
9
|
+
default: '',
|
|
10
|
+
displayOptions: { show: { resource: ['designImport'], operation: ['createImageImport'] } },
|
|
11
|
+
},
|
|
12
|
+
];
|
|
13
|
+
//# sourceMappingURL=createImageImportPreviewNotice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createImageImportPreviewNotice.js","sourceRoot":"","sources":["../../../../../nodes/Canva/resources/designImport/createImageImportPreviewNotice.ts"],"names":[],"mappings":";;;AAEa,QAAA,qDAAqD,GAAsB;IACvF;QACC,WAAW,EACV,4IAA4I;QAC7I,IAAI,EAAE,4CAA4C;QAClD,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,cAAc,CAAC,EAAE,SAAS,EAAE,CAAC,mBAAmB,CAAC,EAAE,EAAE;KAC1F;CACD,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.designImportDescription = exports.designImportOperations = void 0;
|
|
4
|
+
const createImageImport_1 = require("./createImageImport");
|
|
5
|
+
const createImageImportCreditsNotice_1 = require("./createImageImportCreditsNotice");
|
|
6
|
+
const createImageImportPreviewNotice_1 = require("./createImageImportPreviewNotice");
|
|
4
7
|
const createImport_1 = require("./createImport");
|
|
5
8
|
exports.designImportOperations = [
|
|
6
9
|
{
|
|
@@ -10,6 +13,12 @@ exports.designImportOperations = [
|
|
|
10
13
|
noDataExpression: true,
|
|
11
14
|
displayOptions: { show: { resource: ['designImport'] } },
|
|
12
15
|
options: [
|
|
16
|
+
{
|
|
17
|
+
name: 'Import From Image (Preview)',
|
|
18
|
+
value: 'createImageImport',
|
|
19
|
+
description: 'Turn a flat image asset into an editable design using Magic Layers (waits for the job to complete)',
|
|
20
|
+
action: 'Import a design from an image',
|
|
21
|
+
},
|
|
13
22
|
{
|
|
14
23
|
name: 'Import From URL',
|
|
15
24
|
value: 'createImport',
|
|
@@ -22,6 +31,9 @@ exports.designImportOperations = [
|
|
|
22
31
|
];
|
|
23
32
|
exports.designImportDescription = [
|
|
24
33
|
...exports.designImportOperations,
|
|
34
|
+
...createImageImportPreviewNotice_1.designImportCreateImageImportPreviewNoticeDescription,
|
|
35
|
+
...createImageImportCreditsNotice_1.designImportCreateImageImportCreditsNoticeDescription,
|
|
36
|
+
...createImageImport_1.designImportCreateImageImportDescription,
|
|
25
37
|
...createImport_1.designImportCreateImportDescription,
|
|
26
38
|
];
|
|
27
39
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Canva/resources/designImport/index.ts"],"names":[],"mappings":";;;AACA,iDAAqE;AAExD,QAAA,sBAAsB,GAAsB;IACxD;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,cAAc,CAAC,EAAE,EAAE;QACxD,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,iBAAiB;gBACvB,KAAK,EAAE,cAAc;gBACrB,WAAW,EACV,wGAAwG;gBACzG,MAAM,EAAE,0BAA0B;aAClC;SACD;QACD,OAAO,EAAE,cAAc;KACvB;CACD,CAAC;AAEW,QAAA,uBAAuB,GAAsB;IACzD,GAAG,8BAAsB;IACzB,GAAG,kDAAmC;CACtC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Canva/resources/designImport/index.ts"],"names":[],"mappings":";;;AACA,2DAA+E;AAC/E,qFAAyG;AACzG,qFAAyG;AACzG,iDAAqE;AAExD,QAAA,sBAAsB,GAAsB;IACxD;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,cAAc,CAAC,EAAE,EAAE;QACxD,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,6BAA6B;gBACnC,KAAK,EAAE,mBAAmB;gBAC1B,WAAW,EACV,oGAAoG;gBACrG,MAAM,EAAE,+BAA+B;aACvC;YACD;gBACC,IAAI,EAAE,iBAAiB;gBACvB,KAAK,EAAE,cAAc;gBACrB,WAAW,EACV,wGAAwG;gBACzG,MAAM,EAAE,0BAA0B;aAClC;SACD;QACD,OAAO,EAAE,cAAc;KACvB;CACD,CAAC;AAEW,QAAA,uBAAuB,GAAsB;IACzD,GAAG,8BAAsB;IACzB,GAAG,sFAAqD;IACxD,GAAG,sFAAqD;IACxD,GAAG,4DAAwC;IAC3C,GAAG,kDAAmC;CACtC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generationCreditsNoticeDescription = void 0;
|
|
4
|
+
exports.generationCreditsNoticeDescription = [
|
|
5
|
+
{
|
|
6
|
+
displayName: "✨ Uses AI credits: Each generation job uses the user's Canva AI credits.",
|
|
7
|
+
name: 'generationCreditsNotice',
|
|
8
|
+
type: 'notice',
|
|
9
|
+
default: '',
|
|
10
|
+
displayOptions: { show: { resource: ['generation'] } },
|
|
11
|
+
},
|
|
12
|
+
];
|
|
13
|
+
//# sourceMappingURL=creditsNotice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"creditsNotice.js","sourceRoot":"","sources":["../../../../../nodes/Canva/resources/generation/creditsNotice.ts"],"names":[],"mappings":";;;AAEa,QAAA,kCAAkC,GAAsB;IACpE;QACC,WAAW,EAAE,0EAA0E;QACvF,IAAI,EAAE,yBAAyB;QAC/B,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE;KACtD;CACD,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generationGenerateDesignDescription = void 0;
|
|
4
|
+
exports.generationGenerateDesignDescription = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Brief',
|
|
7
|
+
name: 'brief',
|
|
8
|
+
type: 'string',
|
|
9
|
+
typeOptions: { rows: 4 },
|
|
10
|
+
default: '',
|
|
11
|
+
required: true,
|
|
12
|
+
displayOptions: { show: { resource: ['generation'], operation: ['generateDesign'] } },
|
|
13
|
+
description: 'Description of the design to generate: its subject, purpose, required wording, tone, and visual direction (max 5000 characters)',
|
|
14
|
+
placeholder: 'A 3-slide pitch deck for a solar-panel startup, with an energetic, modern, blue-and-white look',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
displayName: 'Design Type',
|
|
18
|
+
name: 'designTypeName',
|
|
19
|
+
type: 'options',
|
|
20
|
+
options: [
|
|
21
|
+
{ name: 'Doc', value: 'doc', description: 'A Canva doc' },
|
|
22
|
+
{ name: 'Presentation', value: 'presentation', description: 'A slide presentation' },
|
|
23
|
+
],
|
|
24
|
+
default: 'presentation',
|
|
25
|
+
required: true,
|
|
26
|
+
displayOptions: { show: { resource: ['generation'], operation: ['generateDesign'] } },
|
|
27
|
+
description: 'The type of design to generate',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
displayName: 'Outline',
|
|
31
|
+
name: 'outline',
|
|
32
|
+
type: 'json',
|
|
33
|
+
typeOptions: { rows: 6 },
|
|
34
|
+
default: '{"sections": []}',
|
|
35
|
+
displayOptions: {
|
|
36
|
+
show: {
|
|
37
|
+
resource: ['generation'],
|
|
38
|
+
operation: ['generateDesign'],
|
|
39
|
+
designTypeName: ['presentation'],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
description: 'Optional slide-by-slide structure to follow, in Canva\'s outline format: up to 100 <code>sections</code>, each with a <code>title</code> and an optional <code>description</code> and <code>points</code> (up to 50). Example: <code>{"sections":[{"title":"The problem","points":["Energy bills are up 30%"]},{"title":"Our solution"}]}</code>. Leave <code>sections</code> empty to let Canva plan the slides.',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
displayName: 'Poll Interval (Ms)',
|
|
46
|
+
name: 'pollInterval',
|
|
47
|
+
type: 'number',
|
|
48
|
+
typeOptions: { minValue: 500, maxValue: 30000 },
|
|
49
|
+
default: 3000,
|
|
50
|
+
displayOptions: { show: { resource: ['generation'], operation: ['generateDesign'] } },
|
|
51
|
+
description: 'How often to check if the design generation job is complete (milliseconds)',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
displayName: 'Max Wait Time (Seconds)',
|
|
55
|
+
name: 'maxWait',
|
|
56
|
+
type: 'number',
|
|
57
|
+
typeOptions: { minValue: 10, maxValue: 600 },
|
|
58
|
+
default: 300,
|
|
59
|
+
displayOptions: { show: { resource: ['generation'], operation: ['generateDesign'] } },
|
|
60
|
+
description: 'Maximum time to wait for the design generation to complete before timing out',
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
//# sourceMappingURL=generateDesign.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateDesign.js","sourceRoot":"","sources":["../../../../../nodes/Canva/resources/generation/generateDesign.ts"],"names":[],"mappings":";;;AAEa,QAAA,mCAAmC,GAAsB;IACrE;QACC,WAAW,EAAE,OAAO;QACpB,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;QACxB,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,SAAS,EAAE,CAAC,gBAAgB,CAAC,EAAE,EAAE;QACrF,WAAW,EACV,iIAAiI;QAClI,WAAW,EACV,gGAAgG;KACjG;IACD;QAGC,WAAW,EAAE,aAAa;QAC1B,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE;YACR,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE;YACzD,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,sBAAsB,EAAE;SACpF;QACD,OAAO,EAAE,cAAc;QACvB,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,SAAS,EAAE,CAAC,gBAAgB,CAAC,EAAE,EAAE;QACrF,WAAW,EAAE,gCAAgC;KAC7C;IACD;QACC,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;QAGxB,OAAO,EAAE,kBAAkB;QAC3B,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,YAAY,CAAC;gBACxB,SAAS,EAAE,CAAC,gBAAgB,CAAC;gBAC7B,cAAc,EAAE,CAAC,cAAc,CAAC;aAChC;SACD;QACD,WAAW,EACV,mZAAmZ;KACpZ;IACD;QACC,WAAW,EAAE,oBAAoB;QACjC,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE;QAC/C,OAAO,EAAE,IAAI;QACb,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,SAAS,EAAE,CAAC,gBAAgB,CAAC,EAAE,EAAE;QACrF,WAAW,EAAE,4EAA4E;KACzF;IACD;QACC,WAAW,EAAE,yBAAyB;QACtC,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE;QAC5C,OAAO,EAAE,GAAG;QACZ,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,SAAS,EAAE,CAAC,gBAAgB,CAAC,EAAE,EAAE;QACrF,WAAW,EAAE,8EAA8E;KAC3F;CACD,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generationGenerateImageDescription = void 0;
|
|
4
|
+
exports.generationGenerateImageDescription = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Prompt',
|
|
7
|
+
name: 'prompt',
|
|
8
|
+
type: 'string',
|
|
9
|
+
typeOptions: { rows: 4 },
|
|
10
|
+
default: '',
|
|
11
|
+
required: true,
|
|
12
|
+
displayOptions: { show: { resource: ['generation'], operation: ['generateImage'] } },
|
|
13
|
+
description: 'Description of the image to generate (max 2000 characters)',
|
|
14
|
+
placeholder: 'A watercolor poster of a lighthouse at dawn',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
displayName: 'Aspect Ratio',
|
|
18
|
+
name: 'aspectRatio',
|
|
19
|
+
type: 'options',
|
|
20
|
+
options: [
|
|
21
|
+
{ name: 'Landscape (16:9)', value: 'landscape' },
|
|
22
|
+
{ name: 'Portrait (9:16)', value: 'portrait' },
|
|
23
|
+
{ name: 'Square (1:1)', value: 'square' },
|
|
24
|
+
],
|
|
25
|
+
default: 'square',
|
|
26
|
+
displayOptions: { show: { resource: ['generation'], operation: ['generateImage'] } },
|
|
27
|
+
description: 'The shape of the generated image',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
displayName: 'Model',
|
|
31
|
+
name: 'model',
|
|
32
|
+
type: 'options',
|
|
33
|
+
options: [
|
|
34
|
+
{
|
|
35
|
+
name: 'Auto',
|
|
36
|
+
value: 'auto',
|
|
37
|
+
description: 'Canva picks the best model, and falls back to another if one is unavailable',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'Lucid Origin',
|
|
41
|
+
value: 'lucid_origin',
|
|
42
|
+
description: 'Suited to architecture, logos, posters, and sci-fi or fantasy scenes',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'Z-Image Turbo',
|
|
46
|
+
value: 'z_image_turbo',
|
|
47
|
+
description: 'Suited to images with text, food and drink, and general-purpose imagery',
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
default: 'auto',
|
|
51
|
+
displayOptions: { show: { resource: ['generation'], operation: ['generateImage'] } },
|
|
52
|
+
description: 'The AI model to generate the image with. If you pick a specific model and it is unavailable, the job fails instead of falling back.',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
displayName: 'Save to Uploads',
|
|
56
|
+
name: 'saveToUploads',
|
|
57
|
+
type: 'boolean',
|
|
58
|
+
default: true,
|
|
59
|
+
displayOptions: { show: { resource: ['generation'], operation: ['generateImage'] } },
|
|
60
|
+
description: "Whether to also save the image to the user's Canva Uploads, so its asset ID can be used in other Canva operations",
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
displayName: 'Asset Name',
|
|
64
|
+
name: 'assetName',
|
|
65
|
+
type: 'string',
|
|
66
|
+
default: '',
|
|
67
|
+
displayOptions: {
|
|
68
|
+
show: { resource: ['generation'], operation: ['generateImage'], saveToUploads: [true] },
|
|
69
|
+
},
|
|
70
|
+
description: 'Name for the saved asset (max 255 characters). If left empty, Canva generates one.',
|
|
71
|
+
placeholder: 'Lighthouse Poster',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
displayName: 'Poll Interval (Ms)',
|
|
75
|
+
name: 'pollInterval',
|
|
76
|
+
type: 'number',
|
|
77
|
+
typeOptions: { minValue: 500, maxValue: 30000 },
|
|
78
|
+
default: 2000,
|
|
79
|
+
displayOptions: { show: { resource: ['generation'], operation: ['generateImage'] } },
|
|
80
|
+
description: 'How often to check if the image generation job is complete (milliseconds)',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
displayName: 'Max Wait Time (Seconds)',
|
|
84
|
+
name: 'maxWait',
|
|
85
|
+
type: 'number',
|
|
86
|
+
typeOptions: { minValue: 10, maxValue: 600 },
|
|
87
|
+
default: 120,
|
|
88
|
+
displayOptions: { show: { resource: ['generation'], operation: ['generateImage'] } },
|
|
89
|
+
description: 'Maximum time to wait for the image generation to complete before timing out',
|
|
90
|
+
},
|
|
91
|
+
];
|
|
92
|
+
//# sourceMappingURL=generateImage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateImage.js","sourceRoot":"","sources":["../../../../../nodes/Canva/resources/generation/generateImage.ts"],"names":[],"mappings":";;;AAEa,QAAA,kCAAkC,GAAsB;IACpE;QACC,WAAW,EAAE,QAAQ;QACrB,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;QACxB,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,SAAS,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;QACpF,WAAW,EAAE,4DAA4D;QACzE,WAAW,EAAE,6CAA6C;KAC1D;IACD;QACC,WAAW,EAAE,cAAc;QAC3B,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE;YACR,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,WAAW,EAAE;YAChD,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,UAAU,EAAE;YAC9C,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,QAAQ,EAAE;SACzC;QACD,OAAO,EAAE,QAAQ;QACjB,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,SAAS,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;QACpF,WAAW,EAAE,kCAAkC;KAC/C;IACD;QACC,WAAW,EAAE,OAAO;QACpB,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,SAAS;QACf,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE,MAAM;gBACb,WAAW,EAAE,6EAA6E;aAC1F;YACD;gBACC,IAAI,EAAE,cAAc;gBACpB,KAAK,EAAE,cAAc;gBACrB,WAAW,EAAE,sEAAsE;aACnF;YACD;gBACC,IAAI,EAAE,eAAe;gBACrB,KAAK,EAAE,eAAe;gBACtB,WAAW,EAAE,yEAAyE;aACtF;SACD;QACD,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,SAAS,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;QACpF,WAAW,EACV,qIAAqI;KACtI;IACD;QACC,WAAW,EAAE,iBAAiB;QAC9B,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,IAAI;QACb,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,SAAS,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;QACpF,WAAW,EACV,mHAAmH;KACpH;IACD;QACC,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,cAAc,EAAE;YACf,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,SAAS,EAAE,CAAC,eAAe,CAAC,EAAE,aAAa,EAAE,CAAC,IAAI,CAAC,EAAE;SACvF;QACD,WAAW,EACV,oFAAoF;QACrF,WAAW,EAAE,mBAAmB;KAChC;IACD;QACC,WAAW,EAAE,oBAAoB;QACjC,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE;QAC/C,OAAO,EAAE,IAAI;QACb,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,SAAS,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;QACpF,WAAW,EAAE,2EAA2E;KACxF;IACD;QACC,WAAW,EAAE,yBAAyB;QACtC,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE;QAC5C,OAAO,EAAE,GAAG;QACZ,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,SAAS,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;QACpF,WAAW,EAAE,6EAA6E;KAC1F;CACD,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generationDescription = exports.generationOperations = void 0;
|
|
4
|
+
const creditsNotice_1 = require("./creditsNotice");
|
|
5
|
+
const generateDesign_1 = require("./generateDesign");
|
|
6
|
+
const generateImage_1 = require("./generateImage");
|
|
7
|
+
const previewNotice_1 = require("./previewNotice");
|
|
8
|
+
exports.generationOperations = [
|
|
9
|
+
{
|
|
10
|
+
displayName: 'Operation',
|
|
11
|
+
name: 'operation',
|
|
12
|
+
type: 'options',
|
|
13
|
+
noDataExpression: true,
|
|
14
|
+
displayOptions: { show: { resource: ['generation'] } },
|
|
15
|
+
options: [
|
|
16
|
+
{
|
|
17
|
+
name: 'Generate Design (Preview)',
|
|
18
|
+
value: 'generateDesign',
|
|
19
|
+
description: 'Generate a presentation or Canva doc from a brief using AI (waits for the job to complete)',
|
|
20
|
+
action: 'Generate a design',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'Generate Image (Preview)',
|
|
24
|
+
value: 'generateImage',
|
|
25
|
+
description: 'Generate an image from a text prompt using AI (waits for the job to complete)',
|
|
26
|
+
action: 'Generate an image',
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
default: 'generateDesign',
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
exports.generationDescription = [
|
|
33
|
+
...exports.generationOperations,
|
|
34
|
+
...previewNotice_1.generationPreviewNoticeDescription,
|
|
35
|
+
...creditsNotice_1.generationCreditsNoticeDescription,
|
|
36
|
+
...generateDesign_1.generationGenerateDesignDescription,
|
|
37
|
+
...generateImage_1.generationGenerateImageDescription,
|
|
38
|
+
];
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Canva/resources/generation/index.ts"],"names":[],"mappings":";;;AACA,mDAAqE;AACrE,qDAAuE;AACvE,mDAAqE;AACrE,mDAAqE;AAExD,QAAA,oBAAoB,GAAsB;IACtD;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE;QACtD,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,2BAA2B;gBACjC,KAAK,EAAE,gBAAgB;gBACvB,WAAW,EACV,4FAA4F;gBAC7F,MAAM,EAAE,mBAAmB;aAC3B;YACD;gBACC,IAAI,EAAE,0BAA0B;gBAChC,KAAK,EAAE,eAAe;gBACtB,WAAW,EACV,+EAA+E;gBAChF,MAAM,EAAE,mBAAmB;aAC3B;SACD;QACD,OAAO,EAAE,gBAAgB;KACzB;CACD,CAAC;AAEW,QAAA,qBAAqB,GAAsB;IACvD,GAAG,4BAAoB;IACvB,GAAG,kDAAkC;IACrC,GAAG,kDAAkC;IACrC,GAAG,oDAAmC;IACtC,GAAG,kDAAkC;CACrC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generationPreviewNoticeDescription = void 0;
|
|
4
|
+
exports.generationPreviewNoticeDescription = [
|
|
5
|
+
{
|
|
6
|
+
displayName: '⚠️ Preview API: These operations may have unannounced breaking changes and cannot be used in public integrations submitted for Canva review.',
|
|
7
|
+
name: 'generationPreviewNotice',
|
|
8
|
+
type: 'notice',
|
|
9
|
+
default: '',
|
|
10
|
+
displayOptions: { show: { resource: ['generation'] } },
|
|
11
|
+
},
|
|
12
|
+
];
|
|
13
|
+
//# sourceMappingURL=previewNotice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"previewNotice.js","sourceRoot":"","sources":["../../../../../nodes/Canva/resources/generation/previewNotice.ts"],"names":[],"mappings":";;;AAEa,QAAA,kCAAkC,GAAsB;IACpE;QACC,WAAW,EACV,8IAA8I;QAC/I,IAAI,EAAE,yBAAyB;QAC/B,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE;KACtD;CACD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.imageTransformationCreditsNoticeDescription = void 0;
|
|
4
|
+
exports.imageTransformationCreditsNoticeDescription = [
|
|
5
|
+
{
|
|
6
|
+
displayName: "✨ Uses AI credits: Each image transformation job uses the user's Canva AI credits.",
|
|
7
|
+
name: 'imageTransformationCreditsNotice',
|
|
8
|
+
type: 'notice',
|
|
9
|
+
default: '',
|
|
10
|
+
displayOptions: { show: { resource: ['imageTransformation'] } },
|
|
11
|
+
},
|
|
12
|
+
];
|
|
13
|
+
//# sourceMappingURL=creditsNotice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"creditsNotice.js","sourceRoot":"","sources":["../../../../../nodes/Canva/resources/imageTransformation/creditsNotice.ts"],"names":[],"mappings":";;;AAEa,QAAA,2CAA2C,GAAsB;IAC7E;QACC,WAAW,EACV,oFAAoF;QACrF,IAAI,EAAE,kCAAkC;QACxC,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,qBAAqB,CAAC,EAAE,EAAE;KAC/D;CACD,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.imageTransformationDescription = exports.imageTransformationOperations = void 0;
|
|
4
|
+
const creditsNotice_1 = require("./creditsNotice");
|
|
5
|
+
const premiumNotice_1 = require("./premiumNotice");
|
|
6
|
+
const previewNotice_1 = require("./previewNotice");
|
|
7
|
+
const removeBackground_1 = require("./removeBackground");
|
|
8
|
+
exports.imageTransformationOperations = [
|
|
9
|
+
{
|
|
10
|
+
displayName: 'Operation',
|
|
11
|
+
name: 'operation',
|
|
12
|
+
type: 'options',
|
|
13
|
+
noDataExpression: true,
|
|
14
|
+
displayOptions: { show: { resource: ['imageTransformation'] } },
|
|
15
|
+
options: [
|
|
16
|
+
{
|
|
17
|
+
name: 'Remove Background (Preview)',
|
|
18
|
+
value: 'removeBackground',
|
|
19
|
+
description: 'Remove the background from an image asset and save the result as a new asset (waits for the job to complete)',
|
|
20
|
+
action: 'Remove the background from an image',
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
default: 'removeBackground',
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
exports.imageTransformationDescription = [
|
|
27
|
+
...exports.imageTransformationOperations,
|
|
28
|
+
...previewNotice_1.imageTransformationPreviewNoticeDescription,
|
|
29
|
+
...premiumNotice_1.imageTransformationPremiumNoticeDescription,
|
|
30
|
+
...creditsNotice_1.imageTransformationCreditsNoticeDescription,
|
|
31
|
+
...removeBackground_1.imageTransformationRemoveBackgroundDescription,
|
|
32
|
+
];
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Canva/resources/imageTransformation/index.ts"],"names":[],"mappings":";;;AACA,mDAA8E;AAC9E,mDAA8E;AAC9E,mDAA8E;AAC9E,yDAAoF;AAEvE,QAAA,6BAA6B,GAAsB;IAC/D;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,qBAAqB,CAAC,EAAE,EAAE;QAC/D,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,6BAA6B;gBACnC,KAAK,EAAE,kBAAkB;gBACzB,WAAW,EACV,8GAA8G;gBAC/G,MAAM,EAAE,qCAAqC;aAC7C;SACD;QACD,OAAO,EAAE,kBAAkB;KAC3B;CACD,CAAC;AAEW,QAAA,8BAA8B,GAAsB;IAChE,GAAG,qCAA6B;IAChC,GAAG,2DAA2C;IAC9C,GAAG,2DAA2C;IAC9C,GAAG,2DAA2C;IAC9C,GAAG,iEAA8C;CACjD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.imageTransformationPremiumNoticeDescription = void 0;
|
|
4
|
+
exports.imageTransformationPremiumNoticeDescription = [
|
|
5
|
+
{
|
|
6
|
+
displayName: '💎 Canva Pro required: Background removal requires a Canva plan with premium features (such as Canva Pro).',
|
|
7
|
+
name: 'imageTransformationPremiumNotice',
|
|
8
|
+
type: 'notice',
|
|
9
|
+
default: '',
|
|
10
|
+
displayOptions: { show: { resource: ['imageTransformation'] } },
|
|
11
|
+
},
|
|
12
|
+
];
|
|
13
|
+
//# sourceMappingURL=premiumNotice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"premiumNotice.js","sourceRoot":"","sources":["../../../../../nodes/Canva/resources/imageTransformation/premiumNotice.ts"],"names":[],"mappings":";;;AAEa,QAAA,2CAA2C,GAAsB;IAC7E;QACC,WAAW,EACV,4GAA4G;QAC7G,IAAI,EAAE,kCAAkC;QACxC,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,qBAAqB,CAAC,EAAE,EAAE;KAC/D;CACD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.imageTransformationPreviewNoticeDescription = void 0;
|
|
4
|
+
exports.imageTransformationPreviewNoticeDescription = [
|
|
5
|
+
{
|
|
6
|
+
displayName: '⚠️ Preview API: These operations may have unannounced breaking changes and cannot be used in public integrations submitted for Canva review.',
|
|
7
|
+
name: 'imageTransformationPreviewNotice',
|
|
8
|
+
type: 'notice',
|
|
9
|
+
default: '',
|
|
10
|
+
displayOptions: { show: { resource: ['imageTransformation'] } },
|
|
11
|
+
},
|
|
12
|
+
];
|
|
13
|
+
//# sourceMappingURL=previewNotice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"previewNotice.js","sourceRoot":"","sources":["../../../../../nodes/Canva/resources/imageTransformation/previewNotice.ts"],"names":[],"mappings":";;;AAEa,QAAA,2CAA2C,GAAsB;IAC7E;QACC,WAAW,EACV,8IAA8I;QAC/I,IAAI,EAAE,kCAAkC;QACxC,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,qBAAqB,CAAC,EAAE,EAAE;KAC/D;CACD,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.imageTransformationRemoveBackgroundDescription = void 0;
|
|
4
|
+
exports.imageTransformationRemoveBackgroundDescription = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Asset ID',
|
|
7
|
+
name: 'assetId',
|
|
8
|
+
type: 'string',
|
|
9
|
+
default: '',
|
|
10
|
+
required: true,
|
|
11
|
+
displayOptions: {
|
|
12
|
+
show: { resource: ['imageTransformation'], operation: ['removeBackground'] },
|
|
13
|
+
},
|
|
14
|
+
description: 'ID of the image asset to remove the background from. The asset must have finished uploading. Images larger than 10 megapixels are scaled down.',
|
|
15
|
+
placeholder: 'Msd59349ff',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
displayName: 'Name',
|
|
19
|
+
name: 'name',
|
|
20
|
+
type: 'string',
|
|
21
|
+
default: '',
|
|
22
|
+
displayOptions: {
|
|
23
|
+
show: { resource: ['imageTransformation'], operation: ['removeBackground'] },
|
|
24
|
+
},
|
|
25
|
+
description: "Name for the new asset (max 255 characters). If left empty, the original asset's name is used.",
|
|
26
|
+
placeholder: 'Product Photo (No Background)',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
displayName: 'Poll Interval (Ms)',
|
|
30
|
+
name: 'pollInterval',
|
|
31
|
+
type: 'number',
|
|
32
|
+
typeOptions: { minValue: 500, maxValue: 30000 },
|
|
33
|
+
default: 2000,
|
|
34
|
+
displayOptions: {
|
|
35
|
+
show: { resource: ['imageTransformation'], operation: ['removeBackground'] },
|
|
36
|
+
},
|
|
37
|
+
description: 'How often to check if the background removal job is complete (milliseconds)',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
displayName: 'Max Wait Time (Seconds)',
|
|
41
|
+
name: 'maxWait',
|
|
42
|
+
type: 'number',
|
|
43
|
+
typeOptions: { minValue: 10, maxValue: 300 },
|
|
44
|
+
default: 60,
|
|
45
|
+
displayOptions: {
|
|
46
|
+
show: { resource: ['imageTransformation'], operation: ['removeBackground'] },
|
|
47
|
+
},
|
|
48
|
+
description: 'Maximum time to wait for the background removal to complete before timing out',
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
//# sourceMappingURL=removeBackground.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"removeBackground.js","sourceRoot":"","sources":["../../../../../nodes/Canva/resources/imageTransformation/removeBackground.ts"],"names":[],"mappings":";;;AAEa,QAAA,8CAA8C,GAAsB;IAChF;QACC,WAAW,EAAE,UAAU;QACvB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE;YACf,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,qBAAqB,CAAC,EAAE,SAAS,EAAE,CAAC,kBAAkB,CAAC,EAAE;SAC5E;QACD,WAAW,EACV,gJAAgJ;QACjJ,WAAW,EAAE,YAAY;KACzB;IACD;QACC,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,cAAc,EAAE;YACf,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,qBAAqB,CAAC,EAAE,SAAS,EAAE,CAAC,kBAAkB,CAAC,EAAE;SAC5E;QACD,WAAW,EACV,gGAAgG;QACjG,WAAW,EAAE,+BAA+B;KAC5C;IACD;QACC,WAAW,EAAE,oBAAoB;QACjC,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE;QAC/C,OAAO,EAAE,IAAI;QACb,cAAc,EAAE;YACf,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,qBAAqB,CAAC,EAAE,SAAS,EAAE,CAAC,kBAAkB,CAAC,EAAE;SAC5E;QACD,WAAW,EAAE,6EAA6E;KAC1F;IACD;QACC,WAAW,EAAE,yBAAyB;QACtC,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE;QAC5C,OAAO,EAAE,EAAE;QACX,cAAc,EAAE;YACf,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,qBAAqB,CAAC,EAAE,SAAS,EAAE,CAAC,kBAAkB,CAAC,EAAE;SAC5E;QACD,WAAW,EAAE,+EAA+E;KAC5F;CACD,CAAC"}
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canva/n8n-nodes-canva",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Canva API integration for n8n. Create, edit, and export designs, folders, and more.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/canva-sdks/n8n-nodes-canva#readme",
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"prepublishOnly": "n8n-node prerelease"
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
|
-
"dist"
|
|
32
|
+
"dist",
|
|
33
|
+
"!dist/tsconfig.tsbuildinfo"
|
|
33
34
|
],
|
|
34
35
|
"publishConfig": {
|
|
35
36
|
"access": "public"
|
|
@@ -56,5 +57,12 @@
|
|
|
56
57
|
},
|
|
57
58
|
"engines": {
|
|
58
59
|
"node": ">=24"
|
|
60
|
+
},
|
|
61
|
+
"devEngines": {
|
|
62
|
+
"runtime": {
|
|
63
|
+
"name": "node",
|
|
64
|
+
"version": ">=24.15.0",
|
|
65
|
+
"onFail": "warn"
|
|
66
|
+
}
|
|
59
67
|
}
|
|
60
68
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canva/n8n-nodes-canva",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Canva API integration for n8n. Create, edit, and export designs, folders, and more.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/canva-sdks/n8n-nodes-canva#readme",
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"prepublishOnly": "n8n-node prerelease"
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
|
-
"dist"
|
|
32
|
+
"dist",
|
|
33
|
+
"!dist/tsconfig.tsbuildinfo"
|
|
33
34
|
],
|
|
34
35
|
"publishConfig": {
|
|
35
36
|
"access": "public"
|
|
@@ -56,5 +57,12 @@
|
|
|
56
57
|
},
|
|
57
58
|
"engines": {
|
|
58
59
|
"node": ">=24"
|
|
60
|
+
},
|
|
61
|
+
"devEngines": {
|
|
62
|
+
"runtime": {
|
|
63
|
+
"name": "node",
|
|
64
|
+
"version": ">=24.15.0",
|
|
65
|
+
"onFail": "warn"
|
|
66
|
+
}
|
|
59
67
|
}
|
|
60
68
|
}
|