@gravity-platform/cloudinary 1.1.1

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.
Files changed (62) hide show
  1. package/README.md +83 -0
  2. package/dist/CloudinaryFileContent/node/executor.d.ts +12 -0
  3. package/dist/CloudinaryFileContent/node/executor.d.ts.map +1 -0
  4. package/dist/CloudinaryFileContent/node/executor.js +53 -0
  5. package/dist/CloudinaryFileContent/node/executor.js.map +1 -0
  6. package/dist/CloudinaryFileContent/node/index.d.ts +10 -0
  7. package/dist/CloudinaryFileContent/node/index.d.ts.map +1 -0
  8. package/dist/CloudinaryFileContent/node/index.js +74 -0
  9. package/dist/CloudinaryFileContent/node/index.js.map +1 -0
  10. package/dist/CloudinaryFileContent/service/getFileContent.d.ts +10 -0
  11. package/dist/CloudinaryFileContent/service/getFileContent.d.ts.map +1 -0
  12. package/dist/CloudinaryFileContent/service/getFileContent.js +89 -0
  13. package/dist/CloudinaryFileContent/service/getFileContent.js.map +1 -0
  14. package/dist/CloudinaryFileContent/util/types.d.ts +29 -0
  15. package/dist/CloudinaryFileContent/util/types.d.ts.map +1 -0
  16. package/dist/CloudinaryFileContent/util/types.js +6 -0
  17. package/dist/CloudinaryFileContent/util/types.js.map +1 -0
  18. package/dist/CloudinaryFiles/node/executor.d.ts +12 -0
  19. package/dist/CloudinaryFiles/node/executor.d.ts.map +1 -0
  20. package/dist/CloudinaryFiles/node/executor.js +54 -0
  21. package/dist/CloudinaryFiles/node/executor.js.map +1 -0
  22. package/dist/CloudinaryFiles/node/index.d.ts +10 -0
  23. package/dist/CloudinaryFiles/node/index.d.ts.map +1 -0
  24. package/dist/CloudinaryFiles/node/index.js +94 -0
  25. package/dist/CloudinaryFiles/node/index.js.map +1 -0
  26. package/dist/CloudinaryFiles/service/listFiles.d.ts +14 -0
  27. package/dist/CloudinaryFiles/service/listFiles.d.ts.map +1 -0
  28. package/dist/CloudinaryFiles/service/listFiles.js +85 -0
  29. package/dist/CloudinaryFiles/service/listFiles.js.map +1 -0
  30. package/dist/CloudinaryFiles/util/types.d.ts +40 -0
  31. package/dist/CloudinaryFiles/util/types.d.ts.map +1 -0
  32. package/dist/CloudinaryFiles/util/types.js +6 -0
  33. package/dist/CloudinaryFiles/util/types.js.map +1 -0
  34. package/dist/CloudinaryUpload/node/executor.d.ts +18 -0
  35. package/dist/CloudinaryUpload/node/executor.d.ts.map +1 -0
  36. package/dist/CloudinaryUpload/node/executor.js +62 -0
  37. package/dist/CloudinaryUpload/node/executor.js.map +1 -0
  38. package/dist/CloudinaryUpload/node/index.d.ts +14 -0
  39. package/dist/CloudinaryUpload/node/index.d.ts.map +1 -0
  40. package/dist/CloudinaryUpload/node/index.js +118 -0
  41. package/dist/CloudinaryUpload/node/index.js.map +1 -0
  42. package/dist/CloudinaryUpload/service/uploadImage.d.ts +22 -0
  43. package/dist/CloudinaryUpload/service/uploadImage.d.ts.map +1 -0
  44. package/dist/CloudinaryUpload/service/uploadImage.js +86 -0
  45. package/dist/CloudinaryUpload/service/uploadImage.js.map +1 -0
  46. package/dist/CloudinaryUpload/util/types.d.ts +28 -0
  47. package/dist/CloudinaryUpload/util/types.d.ts.map +1 -0
  48. package/dist/CloudinaryUpload/util/types.js +6 -0
  49. package/dist/CloudinaryUpload/util/types.js.map +1 -0
  50. package/dist/credentials/index.d.ts +26 -0
  51. package/dist/credentials/index.d.ts.map +1 -0
  52. package/dist/credentials/index.js +39 -0
  53. package/dist/credentials/index.js.map +1 -0
  54. package/dist/index.d.ts +3 -0
  55. package/dist/index.d.ts.map +1 -0
  56. package/dist/index.js +64 -0
  57. package/dist/index.js.map +1 -0
  58. package/dist/shared/platform.d.ts +11 -0
  59. package/dist/shared/platform.d.ts.map +1 -0
  60. package/dist/shared/platform.js +21 -0
  61. package/dist/shared/platform.js.map +1 -0
  62. package/package.json +44 -0
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ /**
3
+ * Cloudinary file listing service
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.listCloudinaryFiles = listCloudinaryFiles;
7
+ const cloudinary_1 = require("cloudinary");
8
+ const crypto_1 = require("crypto");
9
+ /**
10
+ * Generate a unique ID for a Cloudinary resource
11
+ */
12
+ function generateUniversalId(resource) {
13
+ const resourceIdentifier = `${resource.public_id}|${resource.version}|${resource.created_at}`;
14
+ const fullHash = (0, crypto_1.createHash)('sha256').update(resourceIdentifier).digest('hex');
15
+ return fullHash.substring(0, 12);
16
+ }
17
+ /**
18
+ * List files from Cloudinary
19
+ */
20
+ async function listCloudinaryFiles(config, credentials, logger) {
21
+ if (!credentials || !credentials.cloud_name || !credentials.api_key || !credentials.api_secret) {
22
+ throw new Error('Invalid Cloudinary credentials: missing cloud_name, api_key, or api_secret');
23
+ }
24
+ // Configure Cloudinary
25
+ cloudinary_1.v2.config({
26
+ cloud_name: credentials.cloud_name,
27
+ api_key: credentials.api_key,
28
+ api_secret: credentials.api_secret,
29
+ secure: true
30
+ });
31
+ const options = {
32
+ max_results: config.maxFiles || 100,
33
+ resource_type: config.resourceType || 'image',
34
+ type: 'upload'
35
+ };
36
+ if (config.folder) {
37
+ options.prefix = config.folder;
38
+ }
39
+ if (config.tags) {
40
+ options.tags = config.tags;
41
+ }
42
+ try {
43
+ logger.info('Listing Cloudinary resources', { options });
44
+ const result = await cloudinary_1.v2.api.resources(options);
45
+ let resources = result.resources.map((resource) => ({
46
+ public_id: resource.public_id,
47
+ version: resource.version,
48
+ signature: resource.signature,
49
+ width: resource.width,
50
+ height: resource.height,
51
+ format: resource.format,
52
+ resource_type: resource.resource_type,
53
+ created_at: resource.created_at,
54
+ tags: resource.tags,
55
+ bytes: resource.bytes,
56
+ type: resource.type,
57
+ etag: resource.etag,
58
+ url: resource.url,
59
+ secure_url: resource.secure_url,
60
+ asset_id: resource.asset_id,
61
+ folder: resource.folder,
62
+ universalId: generateUniversalId(resource)
63
+ }));
64
+ // Apply random selection if requested and we have more files than maxFiles
65
+ if (config.randomSelection && resources.length > (config.maxFiles || 100)) {
66
+ const shuffled = resources.sort(() => 0.5 - Math.random());
67
+ resources = shuffled.slice(0, config.maxFiles || 100);
68
+ }
69
+ logger.info('Successfully listed Cloudinary resources', {
70
+ count: resources.length,
71
+ totalAvailable: result.resources.length
72
+ });
73
+ return {
74
+ files: resources,
75
+ count: resources.length
76
+ };
77
+ }
78
+ catch (error) {
79
+ logger.error('Failed to list Cloudinary resources', {
80
+ error: error instanceof Error ? error.message : String(error)
81
+ });
82
+ throw error;
83
+ }
84
+ }
85
+ //# sourceMappingURL=listFiles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listFiles.js","sourceRoot":"","sources":["../../../src/CloudinaryFiles/service/listFiles.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAwBH,kDA8EC;AApGD,2CAAoF;AAEpF,mCAAoC;AAQpC;;GAEG;AACH,SAAS,mBAAmB,CAAC,QAAa;IACxC,MAAM,kBAAkB,GAAG,GAAG,QAAQ,CAAC,SAAS,IAAI,QAAQ,CAAC,OAAO,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC;IAC9F,MAAM,QAAQ,GAAG,IAAA,mBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC/E,OAAO,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,mBAAmB,CACvC,MAA6B,EAC7B,WAAkC,EAClC,MAAW;IAGX,IAAI,CAAC,WAAW,IAAI,CAAC,WAAW,CAAC,UAAU,IAAI,CAAC,WAAW,CAAC,OAAO,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC;QAC/F,MAAM,IAAI,KAAK,CAAC,4EAA4E,CAAC,CAAC;IAChG,CAAC;IAED,uBAAuB;IACvB,eAAU,CAAC,MAAM,CAAC;QAChB,UAAU,EAAE,WAAW,CAAC,UAAU;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: string;
9
+ randomSelection?: boolean;
10
+ }
11
+ export interface CloudinaryResource {
12
+ public_id: string;
13
+ version: number;
14
+ signature: string;
15
+ width?: number;
16
+ height?: number;
17
+ format: string;
18
+ resource_type: string;
19
+ created_at: string;
20
+ tags?: string[];
21
+ bytes: number;
22
+ type: string;
23
+ etag?: string;
24
+ url: string;
25
+ secure_url: string;
26
+ asset_id?: string;
27
+ folder?: string;
28
+ universalId?: string;
29
+ }
30
+ export interface CloudinaryFilesServiceOutput {
31
+ files: CloudinaryResource[];
32
+ count: number;
33
+ }
34
+ export interface CloudinaryFilesOutput {
35
+ __outputs: {
36
+ files: CloudinaryResource[];
37
+ count: number;
38
+ };
39
+ }
40
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/CloudinaryFiles/util/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;IAClD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,4BAA4B;IAC3C,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE;QACT,KAAK,EAAE,kBAAkB,EAAE,CAAC;QAC5B,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;CACH"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ /**
3
+ * Type definitions for CloudinaryFiles node
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/CloudinaryFiles/util/types.ts"],"names":[],"mappings":";AAAA;;GAEG"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Cloudinary Upload Node Executor
3
+ * Handles uploading images to Cloudinary
4
+ */
5
+ import { type NodeExecutionContext, type ValidationResult } from "@gravity-platform/plugin-base";
6
+ import { CloudinaryUploadConfig, CloudinaryUploadOutput } from "../util/types";
7
+ declare const PromiseNode: any;
8
+ export declare class CloudinaryUploadExecutor extends PromiseNode<CloudinaryUploadConfig> {
9
+ constructor();
10
+ protected validateConfig(config: CloudinaryUploadConfig): Promise<ValidationResult>;
11
+ protected executeNode(inputs: Record<string, any>, config: CloudinaryUploadConfig, context: NodeExecutionContext): Promise<CloudinaryUploadOutput>;
12
+ /**
13
+ * Build credential context from execution context
14
+ */
15
+ private buildCredentialContext;
16
+ }
17
+ export {};
18
+ //# sourceMappingURL=executor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/CloudinaryUpload/node/executor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAA2B,KAAK,oBAAoB,EAAE,KAAK,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAE1H,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE/E,QAAA,MAAQ,WAAW,KAA8B,CAAC;AAElD,qBAAa,wBAAyB,SAAQ,WAAW,CAAC,sBAAsB,CAAC;;cAK/D,cAAc,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,gBAAgB,CAAC;cAWzE,WAAW,CACzB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,MAAM,EAAE,sBAAsB,EAC9B,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,sBAAsB,CAAC;IAyBlC;;OAEG;IACH,OAAO,CAAC,sBAAsB;CAY/B"}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ /**
3
+ * Cloudinary Upload Node Executor
4
+ * Handles uploading images to Cloudinary
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.CloudinaryUploadExecutor = void 0;
8
+ const plugin_base_1 = require("@gravity-platform/plugin-base");
9
+ const uploadImage_1 = require("../service/uploadImage");
10
+ const { PromiseNode } = (0, plugin_base_1.getPlatformDependencies)();
11
+ class CloudinaryUploadExecutor extends PromiseNode {
12
+ constructor() {
13
+ super("CloudinaryUpload");
14
+ }
15
+ async validateConfig(config) {
16
+ if (!config.imageData || config.imageData.trim() === "") {
17
+ return {
18
+ success: false,
19
+ error: "Image data is required (base64 or URL)",
20
+ };
21
+ }
22
+ return { success: true };
23
+ }
24
+ async executeNode(inputs, config, context) {
25
+ // Build credential context
26
+ const credentialContext = this.buildCredentialContext(context);
27
+ // Upload image
28
+ const result = await (0, uploadImage_1.uploadImage)(config, credentialContext, this.logger);
29
+ return {
30
+ __outputs: {
31
+ url: result.url,
32
+ secureUrl: result.secureUrl,
33
+ publicId: result.publicId,
34
+ format: result.format,
35
+ width: result.width,
36
+ height: result.height,
37
+ bytes: result.bytes,
38
+ metadata: {
39
+ uploadedAt: result.createdAt,
40
+ folder: config.folder,
41
+ tags: result.tags,
42
+ },
43
+ },
44
+ };
45
+ }
46
+ /**
47
+ * Build credential context from execution context
48
+ */
49
+ buildCredentialContext(context) {
50
+ const { workflowId, executionId, nodeId } = this.validateAndGetContext(context);
51
+ return {
52
+ workflowId,
53
+ executionId,
54
+ nodeId,
55
+ nodeType: this.nodeType,
56
+ config: context.config,
57
+ credentials: context.credentials || {},
58
+ };
59
+ }
60
+ }
61
+ exports.CloudinaryUploadExecutor = CloudinaryUploadExecutor;
62
+ //# sourceMappingURL=executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../src/CloudinaryUpload/node/executor.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA0H;AAC1H,wDAAqD;AAGrD,MAAM,EAAE,WAAW,EAAE,GAAG,IAAA,qCAAuB,GAAE,CAAC;AAElD,MAAa,wBAAyB,SAAQ,WAAmC;IAC/E;QACE,KAAK,CAAC,kBAAkB,CAAC,CAAC;IAC5B,CAAC;IAES,KAAK,CAAC,cAAc,CAAC,MAA8B;QAC3D,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YACxD,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,wCAAwC;aAChD,CAAC;QACJ,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;IAES,KAAK,CAAC,WAAW,CACzB,MAA2B,EAC3B,MAA8B,EAC9B,OAA6B;QAE7B,2BAA2B;QAC3B,MAAM,iBAAiB,GAAG,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;QAE/D,eAAe;QACf,MAAM,MAAM,GAAG,MAAM,IAAA,yBAAW,EAAC,MAAM,EAAE,iBAAiB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAEzE,OAAO;YACL,SAAS,EAAE;gBACT,GAAG,EAAE,MAAM,CAAC,GAAG;gBACf,SAAS,EAAE,MAAM,CAAC,SAAS;gBAC3B,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,QAAQ,EAAE;oBACR,UAAU,EAAE,MAAM,CAAC,SAAS;oBAC5B,MAAM,EAAE,MAAM,CAAC,MAAM;oBACrB,IAAI,EAAE,MAAM,CAAC,IAAI;iBAClB;aACF;SACF,CAAC;IACJ,CAAC;IAED;;OAEG;IACK,sBAAsB,CAAC,OAA6B;QAC1D,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC;QAEhF,OAAO;YACL,UAAU;YACV,WAAW;YACX,MAAM;YACN,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,EAAE;SACvC,CAAC;IACJ,CAAC;CACF;AA5DD,4DA4DC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Cloudinary Upload Node Definition
3
+ * Upload images (base64 or URL) to Cloudinary
4
+ */
5
+ import { type EnhancedNodeDefinition } from "@gravity-platform/plugin-base";
6
+ import { CloudinaryUploadExecutor } from "./executor";
7
+ export declare const NODE_TYPE = "CloudinaryUpload";
8
+ declare function createNodeDefinition(): EnhancedNodeDefinition;
9
+ export declare const CloudinaryUploadNode: {
10
+ definition: any;
11
+ executor: typeof CloudinaryUploadExecutor;
12
+ };
13
+ export { createNodeDefinition };
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/CloudinaryUpload/node/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAA2B,KAAK,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACrG,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAEtD,eAAO,MAAM,SAAS,qBAAqB,CAAC;AAE5C,iBAAS,oBAAoB,IAAI,sBAAsB,CAqGtD;AAID,eAAO,MAAM,oBAAoB;;;CAGhC,CAAC;AAEF,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ /**
3
+ * Cloudinary Upload Node Definition
4
+ * Upload images (base64 or URL) to Cloudinary
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.CloudinaryUploadNode = exports.NODE_TYPE = void 0;
8
+ exports.createNodeDefinition = createNodeDefinition;
9
+ const plugin_base_1 = require("@gravity-platform/plugin-base");
10
+ const executor_1 = require("./executor");
11
+ exports.NODE_TYPE = "CloudinaryUpload";
12
+ function createNodeDefinition() {
13
+ const { NodeInputType } = (0, plugin_base_1.getPlatformDependencies)();
14
+ return {
15
+ packageVersion: "1.1.0",
16
+ type: exports.NODE_TYPE,
17
+ name: "Cloudinary Upload",
18
+ description: "Upload images to Cloudinary from base64 data or URL",
19
+ category: "storage",
20
+ logoUrl: "https://res.cloudinary.com/sonik/image/upload/v1754502687/gravity/icons/cloudinary_logo.png",
21
+ color: "#3448C5", // Cloudinary Blue
22
+ inputs: [
23
+ {
24
+ name: "signal",
25
+ type: NodeInputType.OBJECT,
26
+ description: "Data from previous nodes (e.g., generated images)",
27
+ },
28
+ ],
29
+ outputs: [
30
+ {
31
+ name: "url",
32
+ type: NodeInputType.STRING,
33
+ description: "HTTP URL of uploaded image",
34
+ },
35
+ {
36
+ name: "secureUrl",
37
+ type: NodeInputType.STRING,
38
+ description: "HTTPS URL of uploaded image",
39
+ },
40
+ {
41
+ name: "publicId",
42
+ type: NodeInputType.STRING,
43
+ description: "Cloudinary public ID",
44
+ },
45
+ {
46
+ name: "format",
47
+ type: NodeInputType.STRING,
48
+ description: "Image format (png, jpg, etc.)",
49
+ },
50
+ {
51
+ name: "metadata",
52
+ type: NodeInputType.OBJECT,
53
+ description: "Upload metadata (dimensions, size, etc.)",
54
+ },
55
+ ],
56
+ configSchema: {
57
+ type: "object",
58
+ properties: {
59
+ imageData: {
60
+ type: "string",
61
+ title: "Image Data",
62
+ description: "Base64 image data or URL. Supports template syntax like {{input.images[0].data}}",
63
+ default: "",
64
+ "ui:field": "template",
65
+ },
66
+ folder: {
67
+ type: "string",
68
+ title: "Folder Path",
69
+ description: "Cloudinary folder to upload to (optional)",
70
+ default: "",
71
+ },
72
+ publicId: {
73
+ type: "string",
74
+ title: "Public ID",
75
+ description: "Custom public ID for the image (optional, auto-generated if empty)",
76
+ default: "",
77
+ "ui:field": "template",
78
+ },
79
+ tags: {
80
+ type: "string",
81
+ title: "Tags",
82
+ description: "Comma-separated tags for the image",
83
+ default: "",
84
+ },
85
+ resourceType: {
86
+ type: "string",
87
+ title: "Resource Type",
88
+ description: "Type of resource to upload",
89
+ default: "image",
90
+ enum: ["image", "video", "raw", "auto"],
91
+ enumNames: ["Image", "Video", "Raw File", "Auto-detect"],
92
+ },
93
+ overwrite: {
94
+ type: "boolean",
95
+ title: "Overwrite Existing",
96
+ description: "Overwrite if file with same public ID exists",
97
+ default: false,
98
+ "ui:widget": "toggle",
99
+ },
100
+ },
101
+ required: ["imageData"],
102
+ },
103
+ credentials: [
104
+ {
105
+ name: "cloudinaryCredential",
106
+ required: true,
107
+ displayName: "Cloudinary",
108
+ description: "Cloudinary credentials for upload access",
109
+ },
110
+ ],
111
+ };
112
+ }
113
+ const definition = createNodeDefinition();
114
+ exports.CloudinaryUploadNode = {
115
+ definition,
116
+ executor: executor_1.CloudinaryUploadExecutor,
117
+ };
118
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/CloudinaryUpload/node/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAqHM,oDAAoB;AAnH7B,+DAAqG;AACrG,yCAAsD;AAEzC,QAAA,SAAS,GAAG,kBAAkB,CAAC;AAE5C,SAAS,oBAAoB;IAC3B,MAAM,EAAE,aAAa,EAAE,GAAG,IAAA,qCAAuB,GAAE,CAAC;IAEpD,OAAO;QACL,cAAc,EAAE,OAAO;QACvB,IAAI,EAAE,iBAAS;QACf,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,qDAAqD;QAClE,QAAQ,EAAE,SAAS;QACnB,OAAO,EAAE,6FAA6F;QACtG,KAAK,EAAE,SAAS,EAAE,kBAAkB;QACpC,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,aAAa,CAAC,MAAM;gBAC1B,WAAW,EAAE,mDAAmD;aACjE;SACF;QACD,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,aAAa,CAAC,MAAM;gBAC1B,WAAW,EAAE,4BAA4B;aAC1C;YACD;gBACE,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,aAAa,CAAC,MAAM;gBAC1B,WAAW,EAAE,6BAA6B;aAC3C;YACD;gBACE,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,aAAa,CAAC,MAAM;gBAC1B,WAAW,EAAE,sBAAsB;aACpC;YACD;gBACE,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,aAAa,CAAC,MAAM;gBAC1B,WAAW,EAAE,+BAA+B;aAC7C;YACD;gBACE,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,aAAa,CAAC,MAAM;gBAC1B,WAAW,EAAE,0CAA0C;aACxD;SACF;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,SAAS,EAA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7B,QAAA,oBAAoB,GAAG;IAClC,UAAU;IACV,QAAQ,EAAE,mCAAwB;CACnC,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Cloudinary Upload Service
3
+ * Handles uploading base64 images or URLs to Cloudinary
4
+ */
5
+ import { CloudinaryUploadConfig } from '../util/types';
6
+ type CredentialContext = any;
7
+ /**
8
+ * Upload an image to Cloudinary
9
+ */
10
+ export declare function uploadImage(config: CloudinaryUploadConfig, context: CredentialContext, nodeLogger?: any): Promise<{
11
+ url: string;
12
+ secureUrl: string;
13
+ publicId: string;
14
+ format: string;
15
+ width: number;
16
+ height: number;
17
+ bytes: number;
18
+ createdAt: string;
19
+ tags: string[];
20
+ }>;
21
+ export {};
22
+ //# sourceMappingURL=uploadImage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uploadImage.d.ts","sourceRoot":"","sources":["../../../src/CloudinaryUpload/service/uploadImage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAGvD,KAAK,iBAAiB,GAAG,GAAG,CAAC;AAQ7B;;GAEG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,sBAAsB,EAC9B,OAAO,EAAE,iBAAiB,EAC1B,UAAU,CAAC,EAAE,GAAG;;;;;;;;;;GAsFjB"}
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ /**
3
+ * Cloudinary Upload Service
4
+ * Handles uploading base64 images or URLs to Cloudinary
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.uploadImage = uploadImage;
8
+ const cloudinary_1 = require("cloudinary");
9
+ const platform_1 = require("../../shared/platform");
10
+ /**
11
+ * Upload an image to Cloudinary
12
+ */
13
+ async function uploadImage(config, context, nodeLogger) {
14
+ const log = nodeLogger || platform_1.cloudinaryLogger;
15
+ try {
16
+ // Fetch credentials
17
+ const credentials = (await (0, platform_1.getNodeCredentials)(context, "cloudinaryCredential"));
18
+ if (!credentials?.cloud_name || !credentials?.api_key || !credentials?.api_secret) {
19
+ throw new Error("Cloudinary credentials are incomplete");
20
+ }
21
+ // Configure Cloudinary
22
+ cloudinary_1.v2.config({
23
+ cloud_name: credentials.cloud_name,
24
+ api_key: credentials.api_key,
25
+ api_secret: credentials.api_secret,
26
+ secure: true,
27
+ });
28
+ log.info("Uploading image to Cloudinary", {
29
+ folder: config.folder,
30
+ publicId: config.publicId,
31
+ resourceType: config.resourceType || 'image',
32
+ });
33
+ // Prepare upload options
34
+ const uploadOptions = {
35
+ resource_type: config.resourceType || 'image',
36
+ overwrite: config.overwrite ?? false,
37
+ };
38
+ if (config.folder) {
39
+ uploadOptions.folder = config.folder;
40
+ }
41
+ if (config.publicId) {
42
+ // Sanitize publicId: remove file extension, replace invalid characters
43
+ let sanitizedPublicId = config.publicId
44
+ .replace(/\.[^/.]+$/, '') // Remove file extension
45
+ .replace(/[^a-zA-Z0-9_\-\/]/g, '_') // Replace invalid chars with underscore
46
+ .replace(/_+/g, '_') // Replace multiple underscores with single
47
+ .replace(/^_|_$/g, ''); // Remove leading/trailing underscores
48
+ uploadOptions.public_id = sanitizedPublicId;
49
+ log.info("Sanitized publicId", { original: config.publicId, sanitized: sanitizedPublicId });
50
+ }
51
+ if (config.tags) {
52
+ uploadOptions.tags = config.tags.split(',').map(tag => tag.trim());
53
+ }
54
+ // Prepare image data
55
+ let imageToUpload = config.imageData;
56
+ // If it's base64 without data URI prefix, add it
57
+ if (!imageToUpload.startsWith('data:') && !imageToUpload.startsWith('http')) {
58
+ // Assume it's base64 PNG if no prefix
59
+ imageToUpload = `data:image/png;base64,${imageToUpload}`;
60
+ }
61
+ // Upload to Cloudinary
62
+ const result = await cloudinary_1.v2.uploader.upload(imageToUpload, uploadOptions);
63
+ log.info("Image uploaded successfully", {
64
+ publicId: result.public_id,
65
+ url: result.secure_url,
66
+ format: result.format,
67
+ bytes: result.bytes,
68
+ });
69
+ return {
70
+ url: result.url,
71
+ secureUrl: result.secure_url,
72
+ publicId: result.public_id,
73
+ format: result.format,
74
+ width: result.width,
75
+ height: result.height,
76
+ bytes: result.bytes,
77
+ createdAt: result.created_at,
78
+ tags: result.tags || [],
79
+ };
80
+ }
81
+ catch (error) {
82
+ log.error("Failed to upload image to Cloudinary", { error: error.message });
83
+ throw new Error(`Failed to upload image: ${error.message}`);
84
+ }
85
+ }
86
+ //# sourceMappingURL=uploadImage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uploadImage.js","sourceRoot":"","sources":["../../../src/CloudinaryUpload/service/uploadImage.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAiBH,kCAyFC;AAxGD,2CAA8C;AAE9C,oDAAuF;AAUvF;;GAEG;AACI,KAAK,UAAU,WAAW,CAC/B,MAA8B,EAC9B,OAA0B,EAC1B,UAAgB;IAEhB,MAAM,GAAG,GAAG,UAAU,IAAI,2BAAM,CAAC;IAEjC,IAAI,CAAC;QACH,oBAAoB;QACpB,MAAM,WAAW,GAAG,CAAC,MAAM,IAAA,6BAAkB,EAAC,OAAO,EAAE,sBAAsB,CAAC,CAA0B,CAAC;QAEzG,IAAI,CAAC,WAAW,EAAE,UAAU,IAAI,CAAC,WAAW,EAAE,OAAO,IAAI,CAAC,WAAW,EAAE,UAAU,EAAE,CAAC;YAClF,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC3D,CAAC;QAED,uBAAuB;QACvB,eAAU,CAAC,MAAM,CAAC;YAChB,UAAU,EAAE,WAAW,CAAC,UAAU;YAClC,OAAO,EAAE,WAAW,CAAC,OAAO;YAC5B,UAAU,EAAE,WAAW,CAAC,UAAU;YAClC,MAAM,EAAE,IAAI;SACb,CAAC,CAAC;QAEH,GAAG,CAAC,IAAI,CAAC,+BAA+B,EAAE;YACxC,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,YAAY,EAAE,MAAM,CAAC,YAAY,IAAI,OAAO;SAC7C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AAG,yBAAyB,aAAa,EAAE,CAAC;QAC3D,CAAC;QAED,uBAAuB;QACvB,MAAM,MAAM,GAAG,MAAM,eAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;QAE9E,GAAG,CAAC,IAAI,CAAC,6BAA6B,EAAE;YACtC,QAAQ,EAAE,MAAM,CAAC,SAAS;YAC1B,GAAG,EAAE,MAAM,CAAC,UAAU;YACtB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,KAAK,EAAE,MAAM,CAAC,KAAK;SACpB,CAAC,CAAC;QAEH,OAAO;YACL,GAAG,EAAE,MAAM,CAAC,GAAG;YACf,SAAS,EAAE,MAAM,CAAC,UAAU;YAC5B,QAAQ,EAAE,MAAM,CAAC,SAAS;YAC1B,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,SAAS,EAAE,MAAM,CAAC,UAAU;YAC5B,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,EAAE;SACxB,CAAC;IACJ,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,GAAG,CAAC,KAAK,CAAC,sCAAsC,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAC5E,MAAM,IAAI,KAAK,CAAC,2BAA2B,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Type definitions for Cloudinary Upload node
3
+ */
4
+ export interface CloudinaryUploadConfig {
5
+ folder?: string;
6
+ publicId?: string;
7
+ tags?: string;
8
+ overwrite?: boolean;
9
+ imageData: string;
10
+ resourceType?: 'image' | 'video' | 'raw' | 'auto';
11
+ }
12
+ export interface CloudinaryUploadOutput {
13
+ __outputs: {
14
+ url: string;
15
+ secureUrl: string;
16
+ publicId: string;
17
+ format: string;
18
+ width?: number;
19
+ height?: number;
20
+ bytes: number;
21
+ metadata: {
22
+ uploadedAt: string;
23
+ folder?: string;
24
+ tags?: string[];
25
+ };
26
+ };
27
+ }
28
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/CloudinaryUpload/util/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,sBAAsB;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;CACnD;AAED,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE;QACT,GAAG,EAAE,MAAM,CAAC;QACZ,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE;YACR,UAAU,EAAE,MAAM,CAAC;YACnB,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;SACjB,CAAC;KACH,CAAC;CACH"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ /**
3
+ * Type definitions for Cloudinary Upload node
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/CloudinaryUpload/util/types.ts"],"names":[],"mappings":";AAAA;;GAEG"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Cloudinary Credentials Definition
3
+ */
4
+ export declare const CloudinaryCredential: {
5
+ name: string;
6
+ displayName: string;
7
+ description: string;
8
+ properties: ({
9
+ name: string;
10
+ displayName: string;
11
+ type: "string";
12
+ required: boolean;
13
+ description: string;
14
+ placeholder: string;
15
+ secret?: undefined;
16
+ } | {
17
+ name: string;
18
+ displayName: string;
19
+ type: "string";
20
+ required: boolean;
21
+ secret: boolean;
22
+ description: string;
23
+ placeholder: string;
24
+ })[];
25
+ };
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/credentials/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;CA+BhC,CAAC"}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ /**
3
+ * Cloudinary Credentials Definition
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CloudinaryCredential = void 0;
7
+ exports.CloudinaryCredential = {
8
+ name: "cloudinaryCredential",
9
+ displayName: "Cloudinary",
10
+ description: "Cloudinary API credentials for media management",
11
+ properties: [
12
+ {
13
+ name: "cloud_name",
14
+ displayName: "Cloud Name",
15
+ type: "string",
16
+ required: true,
17
+ description: "Your Cloudinary cloud name",
18
+ placeholder: "Enter your Cloudinary cloud name"
19
+ },
20
+ {
21
+ name: "api_key",
22
+ displayName: "API Key",
23
+ type: "string",
24
+ required: true,
25
+ description: "Your Cloudinary API key",
26
+ placeholder: "Enter your Cloudinary API key"
27
+ },
28
+ {
29
+ name: "api_secret",
30
+ displayName: "API Secret",
31
+ type: "string",
32
+ required: true,
33
+ secret: true,
34
+ description: "Your Cloudinary API secret",
35
+ placeholder: "Enter your Cloudinary API secret"
36
+ }
37
+ ],
38
+ };
39
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/credentials/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEU,QAAA,oBAAoB,GAAG;IAClC,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE,iDAAiD;IAC9D,UAAU,EAAE;QACV;YACE,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,YAAY;YACzB,IAAI,EAAE,QAAiB;YACvB,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,4BAA4B;YACzC,WAAW,EAAE,kCAAkC;SAChD;QACD;YACE,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,SAAS;YACtB,IAAI,EAAE,QAAiB;YACvB,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,yBAAyB;YACtC,WAAW,EAAE,+BAA+B;SAC7C;QACD;YACE,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,YAAY;YACzB,IAAI,EAAE,QAAiB;YACvB,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,IAAI;YACZ,WAAW,EAAE,4BAA4B;YACzC,WAAW,EAAE,kCAAkC;SAChD;KACF;CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const plugin: import("@gravity-platform/plugin-base").GravityPlugin;
2
+ export default plugin;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,uDA0BV,CAAC;AAEH,eAAe,MAAM,CAAC"}