n8n-nodes-gcp 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 +46 -0
- package/dist/credentials/GcpServiceAccountApi.credentials.d.ts +9 -0
- package/dist/credentials/GcpServiceAccountApi.credentials.js +45 -0
- package/dist/credentials/GcpServiceAccountApi.credentials.js.map +1 -0
- package/dist/credentials/GcpServiceAccountApi.dark.svg +23 -0
- package/dist/credentials/GcpServiceAccountApi.svg +23 -0
- package/dist/nodes/Gcp/Gcp.dark.svg +23 -0
- package/dist/nodes/Gcp/Gcp.node.d.ts +5 -0
- package/dist/nodes/Gcp/Gcp.node.js +90 -0
- package/dist/nodes/Gcp/Gcp.node.js.map +1 -0
- package/dist/nodes/Gcp/Gcp.node.json +18 -0
- package/dist/nodes/Gcp/Gcp.svg +23 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageBucket/common.d.ts +3 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageBucket/common.js +17 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageBucket/common.js.map +1 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageBucket/create.d.ts +5 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageBucket/create.js +85 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageBucket/create.js.map +1 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageBucket/delete.d.ts +5 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageBucket/delete.js +40 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageBucket/delete.js.map +1 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageBucket/get-metadata.d.ts +5 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageBucket/get-metadata.js +48 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageBucket/get-metadata.js.map +1 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageBucket/google-cloud-storage-bucket.d.ts +6 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageBucket/google-cloud-storage-bucket.js +65 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageBucket/google-cloud-storage-bucket.js.map +1 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageBucket/list.d.ts +5 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageBucket/list.js +59 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageBucket/list.js.map +1 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageBucket/set-metadata.d.ts +5 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageBucket/set-metadata.js +66 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageBucket/set-metadata.js.map +1 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/change-visibility.d.ts +5 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/change-visibility.js +100 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/change-visibility.js.map +1 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/common.d.ts +5 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/common.js +29 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/common.js.map +1 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/copy.d.ts +5 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/copy.js +71 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/copy.js.map +1 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/delete.d.ts +5 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/delete.js +47 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/delete.js.map +1 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/download.d.ts +5 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/download.js +97 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/download.js.map +1 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/exists.d.ts +5 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/exists.js +49 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/exists.js.map +1 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/get-metadata.d.ts +5 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/get-metadata.js +48 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/get-metadata.js.map +1 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/google-cloud-storage-object.d.ts +6 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/google-cloud-storage-object.js +98 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/google-cloud-storage-object.js.map +1 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/list.d.ts +5 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/list.js +64 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/list.js.map +1 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/move.d.ts +5 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/move.js +77 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/move.js.map +1 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/set-metadata.d.ts +5 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/set-metadata.js +64 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/set-metadata.js.map +1 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/sign-download-url.d.ts +5 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/sign-download-url.js +49 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/sign-download-url.js.map +1 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/sign-upload-url.d.ts +5 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/sign-upload-url.js +59 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/sign-upload-url.js.map +1 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/upload.d.ts +5 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/upload.js +94 -0
- package/dist/nodes/Gcp/resources/googleCloudStorageObject/upload.js.map +1 -0
- package/dist/nodes/shared/get-access-token.d.ts +7 -0
- package/dist/nodes/shared/get-access-token.js +94 -0
- package/dist/nodes/shared/get-access-token.js.map +1 -0
- package/dist/nodes/shared/operation-result.d.ts +5 -0
- package/dist/nodes/shared/operation-result.js +3 -0
- package/dist/nodes/shared/operation-result.js.map +1 -0
- package/dist/nodes/shared/signed-url.d.ts +2 -0
- package/dist/nodes/shared/signed-url.js +39 -0
- package/dist/nodes/shared/signed-url.js.map +1 -0
- package/dist/package.json +51 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +51 -0
package/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# n8n-nodes-gcp-storage
|
|
2
|
+
|
|
3
|
+
This is an n8n community node. It lets you use _app/service name_ in your n8n workflows.
|
|
4
|
+
|
|
5
|
+
_App/service name_ is _one or two sentences describing the service this node integrates with_.
|
|
6
|
+
|
|
7
|
+
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/sustainable-use-license/) workflow automation platform.
|
|
8
|
+
|
|
9
|
+
[Installation](#installation)
|
|
10
|
+
[Operations](#operations)
|
|
11
|
+
[Credentials](#credentials)
|
|
12
|
+
[Compatibility](#compatibility)
|
|
13
|
+
[Usage](#usage)
|
|
14
|
+
[Resources](#resources)
|
|
15
|
+
[Version history](#version-history)
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.
|
|
20
|
+
|
|
21
|
+
## Operations
|
|
22
|
+
|
|
23
|
+
_List the operations supported by your node._
|
|
24
|
+
|
|
25
|
+
## Credentials
|
|
26
|
+
|
|
27
|
+
_If users need to authenticate with the app/service, provide details here. You should include prerequisites (such as signing up with the service), available authentication methods, and how to set them up._
|
|
28
|
+
|
|
29
|
+
## Compatibility
|
|
30
|
+
|
|
31
|
+
_State the minimum n8n version, as well as which versions you test against. You can also include any known version incompatibility issues._
|
|
32
|
+
|
|
33
|
+
## Usage
|
|
34
|
+
|
|
35
|
+
_This is an optional section. Use it to help users with any difficult or confusing aspects of the node._
|
|
36
|
+
|
|
37
|
+
_By the time users are looking for community nodes, they probably already know n8n basics. But if you expect new users, you can link to the [Try it out](https://docs.n8n.io/try-it-out/) documentation to help them get started._
|
|
38
|
+
|
|
39
|
+
## Resources
|
|
40
|
+
|
|
41
|
+
* [n8n community nodes documentation](https://docs.n8n.io/integrations/#community-nodes)
|
|
42
|
+
* _Link to app/service documentation._
|
|
43
|
+
|
|
44
|
+
## Version history
|
|
45
|
+
|
|
46
|
+
_This is another optional section. If your node has multiple versions, include a short description of available versions and what changed, as well as any compatibility impact._
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ICredentialTestRequest, ICredentialType, INodeProperties, Icon } from 'n8n-workflow';
|
|
2
|
+
export declare class GcpServiceAccountApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
icon: Icon;
|
|
6
|
+
documentationUrl: string;
|
|
7
|
+
test: ICredentialTestRequest;
|
|
8
|
+
properties: INodeProperties[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GcpServiceAccountApi = void 0;
|
|
4
|
+
class GcpServiceAccountApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'gcpServiceAccountApi';
|
|
7
|
+
this.displayName = 'GCP Service Account API';
|
|
8
|
+
this.icon = {
|
|
9
|
+
light: 'file:GcpServiceAccountApi.svg',
|
|
10
|
+
dark: 'file:GcpServiceAccountApi.dark.svg',
|
|
11
|
+
};
|
|
12
|
+
this.documentationUrl = 'https://cloud.google.com/storage/docs/authentication';
|
|
13
|
+
this.test = {
|
|
14
|
+
request: {
|
|
15
|
+
baseURL: 'https://www.googleapis.com',
|
|
16
|
+
url: '/discovery/v1/apis',
|
|
17
|
+
method: 'GET',
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
this.properties = [
|
|
21
|
+
{
|
|
22
|
+
displayName: 'Client Email',
|
|
23
|
+
name: 'clientEmail',
|
|
24
|
+
type: 'string',
|
|
25
|
+
default: '',
|
|
26
|
+
required: true,
|
|
27
|
+
description: 'Service account client email',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
displayName: 'Private Key',
|
|
31
|
+
name: 'privateKey',
|
|
32
|
+
type: 'string',
|
|
33
|
+
typeOptions: {
|
|
34
|
+
password: true,
|
|
35
|
+
rows: 8,
|
|
36
|
+
},
|
|
37
|
+
default: '',
|
|
38
|
+
required: true,
|
|
39
|
+
description: 'Service account private key in PEM format',
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.GcpServiceAccountApi = GcpServiceAccountApi;
|
|
45
|
+
//# sourceMappingURL=GcpServiceAccountApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GcpServiceAccountApi.credentials.js","sourceRoot":"","sources":["../../credentials/GcpServiceAccountApi.credentials.ts"],"names":[],"mappings":";;;AAEA,MAAa,oBAAoB;IAAjC;QACC,SAAI,GAAG,sBAAsB,CAAC;QAE9B,gBAAW,GAAG,yBAAyB,CAAC;QAExC,SAAI,GAAS;YACZ,KAAK,EAAE,+BAA+B;YACtC,IAAI,EAAE,oCAAoC;SAC1C,CAAC;QAEF,qBAAgB,GAAG,sDAAsD,CAAC;QAE1E,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,4BAA4B;gBACrC,GAAG,EAAE,oBAAoB;gBACzB,MAAM,EAAE,KAAK;aACb;SACD,CAAC;QAEF,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,cAAc;gBAC3B,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,8BAA8B;aAC3C;YACD;gBACC,WAAW,EAAE,aAAa;gBAC1B,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACZ,QAAQ,EAAE,IAAI;oBACd,IAAI,EAAE,CAAC;iBACP;gBACD,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,2CAA2C;aACxD;SACD,CAAC;IACH,CAAC;CAAA;AA1CD,oDA0CC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
4
|
+
viewBox="0 0 2385.7 1919.9" style="enable-background:new 0 0 2385.7 1919.9;" xml:space="preserve">
|
|
5
|
+
<style type="text/css">
|
|
6
|
+
.st0{fill:#EA4335;}
|
|
7
|
+
.st1{fill:#4285F4;}
|
|
8
|
+
.st2{fill:#34A853;}
|
|
9
|
+
.st3{fill:#FBBC05;}
|
|
10
|
+
</style>
|
|
11
|
+
<g>
|
|
12
|
+
<path class="st0" d="M1513.8,528.7h72.8l207.4-207.4l10.2-88c-385.9-340.6-975-303.9-1315.6,82C393.9,422.5,325.2,550,287.8,688
|
|
13
|
+
c23.1-9.5,48.7-11,72.8-4.4l414.7-68.4c0,0,21.1-34.9,32-32.7c184.5-202.6,495-226.2,708-53.8H1513.8z"/>
|
|
14
|
+
<path class="st1" d="M2089.4,688c-47.7-175.5-145.5-333.3-281.6-454l-291,291c122.9,100.4,192.9,251.7,189.9,410.4v51.7
|
|
15
|
+
c143.1,0,259,116,259,259c0,143.1-116,259-259,259h-518.1l-51.7,52.4v310.7l51.7,51.7h518.1c297,2.3,560.5-190.2,648.7-473.8
|
|
16
|
+
C2443.4,1162.4,2335.4,854.4,2089.4,688L2089.4,688z"/>
|
|
17
|
+
<path class="st2" d="M669.8,1917h518.1v-414.7H669.8c-36.9,0-73.4-7.9-107-23.3l-72.8,22.5l-208.8,207.4l-18.2,72.8
|
|
18
|
+
C380.1,1870.1,523,1917.6,669.8,1917L669.8,1917z"/>
|
|
19
|
+
<path class="st3" d="M669.8,571.6c-287.8,1.7-542.7,186-634.5,458.7c-91.8,272.7-0.3,573.7,227.8,749.1l300.5-300.5
|
|
20
|
+
c-130.4-58.9-188.3-212.3-129.4-342.7c58.9-130.4,212.3-188.3,342.7-129.4c57.4,26,103.4,72,129.4,129.4l300.5-300.5
|
|
21
|
+
C1078.9,668.6,880.2,570.9,669.8,571.6L669.8,571.6z"/>
|
|
22
|
+
</g>
|
|
23
|
+
</svg>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
4
|
+
viewBox="0 0 2385.7 1919.9" style="enable-background:new 0 0 2385.7 1919.9;" xml:space="preserve">
|
|
5
|
+
<style type="text/css">
|
|
6
|
+
.st0{fill:#EA4335;}
|
|
7
|
+
.st1{fill:#4285F4;}
|
|
8
|
+
.st2{fill:#34A853;}
|
|
9
|
+
.st3{fill:#FBBC05;}
|
|
10
|
+
</style>
|
|
11
|
+
<g>
|
|
12
|
+
<path class="st0" d="M1513.8,528.7h72.8l207.4-207.4l10.2-88c-385.9-340.6-975-303.9-1315.6,82C393.9,422.5,325.2,550,287.8,688
|
|
13
|
+
c23.1-9.5,48.7-11,72.8-4.4l414.7-68.4c0,0,21.1-34.9,32-32.7c184.5-202.6,495-226.2,708-53.8H1513.8z"/>
|
|
14
|
+
<path class="st1" d="M2089.4,688c-47.7-175.5-145.5-333.3-281.6-454l-291,291c122.9,100.4,192.9,251.7,189.9,410.4v51.7
|
|
15
|
+
c143.1,0,259,116,259,259c0,143.1-116,259-259,259h-518.1l-51.7,52.4v310.7l51.7,51.7h518.1c297,2.3,560.5-190.2,648.7-473.8
|
|
16
|
+
C2443.4,1162.4,2335.4,854.4,2089.4,688L2089.4,688z"/>
|
|
17
|
+
<path class="st2" d="M669.8,1917h518.1v-414.7H669.8c-36.9,0-73.4-7.9-107-23.3l-72.8,22.5l-208.8,207.4l-18.2,72.8
|
|
18
|
+
C380.1,1870.1,523,1917.6,669.8,1917L669.8,1917z"/>
|
|
19
|
+
<path class="st3" d="M669.8,571.6c-287.8,1.7-542.7,186-634.5,458.7c-91.8,272.7-0.3,573.7,227.8,749.1l300.5-300.5
|
|
20
|
+
c-130.4-58.9-188.3-212.3-129.4-342.7c58.9-130.4,212.3-188.3,342.7-129.4c57.4,26,103.4,72,129.4,129.4l300.5-300.5
|
|
21
|
+
C1078.9,668.6,880.2,570.9,669.8,571.6L669.8,571.6z"/>
|
|
22
|
+
</g>
|
|
23
|
+
</svg>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
4
|
+
viewBox="0 0 2385.7 1919.9" style="enable-background:new 0 0 2385.7 1919.9;" xml:space="preserve">
|
|
5
|
+
<style type="text/css">
|
|
6
|
+
.st0{fill:#EA4335;}
|
|
7
|
+
.st1{fill:#4285F4;}
|
|
8
|
+
.st2{fill:#34A853;}
|
|
9
|
+
.st3{fill:#FBBC05;}
|
|
10
|
+
</style>
|
|
11
|
+
<g>
|
|
12
|
+
<path class="st0" d="M1513.8,528.7h72.8l207.4-207.4l10.2-88c-385.9-340.6-975-303.9-1315.6,82C393.9,422.5,325.2,550,287.8,688
|
|
13
|
+
c23.1-9.5,48.7-11,72.8-4.4l414.7-68.4c0,0,21.1-34.9,32-32.7c184.5-202.6,495-226.2,708-53.8H1513.8z"/>
|
|
14
|
+
<path class="st1" d="M2089.4,688c-47.7-175.5-145.5-333.3-281.6-454l-291,291c122.9,100.4,192.9,251.7,189.9,410.4v51.7
|
|
15
|
+
c143.1,0,259,116,259,259c0,143.1-116,259-259,259h-518.1l-51.7,52.4v310.7l51.7,51.7h518.1c297,2.3,560.5-190.2,648.7-473.8
|
|
16
|
+
C2443.4,1162.4,2335.4,854.4,2089.4,688L2089.4,688z"/>
|
|
17
|
+
<path class="st2" d="M669.8,1917h518.1v-414.7H669.8c-36.9,0-73.4-7.9-107-23.3l-72.8,22.5l-208.8,207.4l-18.2,72.8
|
|
18
|
+
C380.1,1870.1,523,1917.6,669.8,1917L669.8,1917z"/>
|
|
19
|
+
<path class="st3" d="M669.8,571.6c-287.8,1.7-542.7,186-634.5,458.7c-91.8,272.7-0.3,573.7,227.8,749.1l300.5-300.5
|
|
20
|
+
c-130.4-58.9-188.3-212.3-129.4-342.7c58.9-130.4,212.3-188.3,342.7-129.4c57.4,26,103.4,72,129.4,129.4l300.5-300.5
|
|
21
|
+
C1078.9,668.6,880.2,570.9,669.8,571.6L669.8,571.6z"/>
|
|
22
|
+
</g>
|
|
23
|
+
</svg>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Gcp = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const google_cloud_storage_bucket_1 = require("./resources/googleCloudStorageBucket/google-cloud-storage-bucket");
|
|
6
|
+
const google_cloud_storage_object_1 = require("./resources/googleCloudStorageObject/google-cloud-storage-object");
|
|
7
|
+
const resourceProperty = {
|
|
8
|
+
displayName: 'Resource',
|
|
9
|
+
name: 'resource',
|
|
10
|
+
type: 'options',
|
|
11
|
+
noDataExpression: true,
|
|
12
|
+
default: 'googleCloudStorageObject',
|
|
13
|
+
options: [
|
|
14
|
+
google_cloud_storage_object_1.googleCloudStorageObjectOption,
|
|
15
|
+
google_cloud_storage_bucket_1.googleCloudStorageBucketOption,
|
|
16
|
+
],
|
|
17
|
+
};
|
|
18
|
+
class Gcp {
|
|
19
|
+
constructor() {
|
|
20
|
+
this.description = {
|
|
21
|
+
displayName: 'GCP',
|
|
22
|
+
name: 'gcp',
|
|
23
|
+
icon: { light: 'file:Gcp.svg', dark: 'file:Gcp.dark.svg' },
|
|
24
|
+
group: ['input'],
|
|
25
|
+
version: 1,
|
|
26
|
+
description: 'Google Cloud Platform wrapper node',
|
|
27
|
+
defaults: {
|
|
28
|
+
name: 'GCP',
|
|
29
|
+
},
|
|
30
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
31
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
32
|
+
usableAsTool: true,
|
|
33
|
+
credentials: [
|
|
34
|
+
{
|
|
35
|
+
name: 'gcpServiceAccountApi',
|
|
36
|
+
required: true,
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
properties: [
|
|
40
|
+
resourceProperty,
|
|
41
|
+
...google_cloud_storage_object_1.googleCloudStorageObjectProperties,
|
|
42
|
+
...google_cloud_storage_bucket_1.googleCloudStorageBucketProperties,
|
|
43
|
+
],
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
async execute() {
|
|
47
|
+
var _a, _b;
|
|
48
|
+
const items = this.getInputData();
|
|
49
|
+
const outputItems = [];
|
|
50
|
+
const iterations = items.length > 0 ? items.length : 1;
|
|
51
|
+
for (let itemIndex = 0; itemIndex < iterations; itemIndex++) {
|
|
52
|
+
try {
|
|
53
|
+
const selectedModule = this.getNodeParameter(resourceProperty.name, itemIndex);
|
|
54
|
+
let result;
|
|
55
|
+
switch (selectedModule) {
|
|
56
|
+
case 'googleCloudStorageObject':
|
|
57
|
+
result = await (0, google_cloud_storage_object_1.executeGoogleCloudStorageObject)(this, items, itemIndex);
|
|
58
|
+
break;
|
|
59
|
+
case 'googleCloudStorageBucket':
|
|
60
|
+
result = await (0, google_cloud_storage_bucket_1.executeGoogleCloudStorageBucket)(this, items, itemIndex);
|
|
61
|
+
break;
|
|
62
|
+
default:
|
|
63
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unsupported GCP module: ${selectedModule}`, { itemIndex });
|
|
64
|
+
}
|
|
65
|
+
outputItems.push({
|
|
66
|
+
json: result.json,
|
|
67
|
+
binary: result.binary,
|
|
68
|
+
pairedItem: items.length > 0 ? { item: itemIndex } : undefined,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
if (this.continueOnFail()) {
|
|
73
|
+
outputItems.push({
|
|
74
|
+
json: (_b = (_a = items[itemIndex]) === null || _a === void 0 ? void 0 : _a.json) !== null && _b !== void 0 ? _b : {},
|
|
75
|
+
error,
|
|
76
|
+
pairedItem: items.length > 0 ? { item: itemIndex } : undefined,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, {
|
|
81
|
+
itemIndex,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return [outputItems];
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.Gcp = Gcp;
|
|
90
|
+
//# sourceMappingURL=Gcp.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Gcp.node.js","sourceRoot":"","sources":["../../../nodes/Gcp/Gcp.node.ts"],"names":[],"mappings":";;;AAOA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,EAAE;wBACnD,SAAS;qBACT,CAAC,CAAA;gBACH,CAAC;YACF,CAAC;QACF,CAAC;QAED,OAAO,CAAC,WAAW,CAAC,CAAA;IACrB,CAAC;CACD;AA1ED,kBA0EC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "n8n-nodes-gcp",
|
|
3
|
+
"nodeVersion": "1.0",
|
|
4
|
+
"codexVersion": "1.0",
|
|
5
|
+
"categories": ["Development", "Developer Tools"],
|
|
6
|
+
"resources": {
|
|
7
|
+
"credentialDocumentation": [
|
|
8
|
+
{
|
|
9
|
+
"url": "https://github.com/org/repo?tab=readme-ov-file#credentials"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"primaryDocumentation": [
|
|
13
|
+
{
|
|
14
|
+
"url": "https://github.com/org/repo?tab=readme-ov-file"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
4
|
+
viewBox="0 0 2385.7 1919.9" style="enable-background:new 0 0 2385.7 1919.9;" xml:space="preserve">
|
|
5
|
+
<style type="text/css">
|
|
6
|
+
.st0{fill:#EA4335;}
|
|
7
|
+
.st1{fill:#4285F4;}
|
|
8
|
+
.st2{fill:#34A853;}
|
|
9
|
+
.st3{fill:#FBBC05;}
|
|
10
|
+
</style>
|
|
11
|
+
<g>
|
|
12
|
+
<path class="st0" d="M1513.8,528.7h72.8l207.4-207.4l10.2-88c-385.9-340.6-975-303.9-1315.6,82C393.9,422.5,325.2,550,287.8,688
|
|
13
|
+
c23.1-9.5,48.7-11,72.8-4.4l414.7-68.4c0,0,21.1-34.9,32-32.7c184.5-202.6,495-226.2,708-53.8H1513.8z"/>
|
|
14
|
+
<path class="st1" d="M2089.4,688c-47.7-175.5-145.5-333.3-281.6-454l-291,291c122.9,100.4,192.9,251.7,189.9,410.4v51.7
|
|
15
|
+
c143.1,0,259,116,259,259c0,143.1-116,259-259,259h-518.1l-51.7,52.4v310.7l51.7,51.7h518.1c297,2.3,560.5-190.2,648.7-473.8
|
|
16
|
+
C2443.4,1162.4,2335.4,854.4,2089.4,688L2089.4,688z"/>
|
|
17
|
+
<path class="st2" d="M669.8,1917h518.1v-414.7H669.8c-36.9,0-73.4-7.9-107-23.3l-72.8,22.5l-208.8,207.4l-18.2,72.8
|
|
18
|
+
C380.1,1870.1,523,1917.6,669.8,1917L669.8,1917z"/>
|
|
19
|
+
<path class="st3" d="M669.8,571.6c-287.8,1.7-542.7,186-634.5,458.7c-91.8,272.7-0.3,573.7,227.8,749.1l300.5-300.5
|
|
20
|
+
c-130.4-58.9-188.3-212.3-129.4-342.7c58.9-130.4,212.3-188.3,342.7-129.4c57.4,26,103.4,72,129.4,129.4l300.5-300.5
|
|
21
|
+
C1078.9,668.6,880.2,570.9,669.8,571.6L669.8,571.6z"/>
|
|
22
|
+
</g>
|
|
23
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { IDataObject, IExecuteFunctions } from 'n8n-workflow';
|
|
2
|
+
export declare function getGcsAccessToken(context: IExecuteFunctions, itemIndex: number): Promise<string>;
|
|
3
|
+
export declare function ensureBucketMetadata(value: unknown, itemIndex: number, context: IExecuteFunctions): IDataObject;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getGcsAccessToken = getGcsAccessToken;
|
|
4
|
+
exports.ensureBucketMetadata = ensureBucketMetadata;
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
const get_access_token_1 = require("../../../shared/get-access-token");
|
|
7
|
+
const GCS_RW_SCOPE = 'https://www.googleapis.com/auth/devstorage.read_write';
|
|
8
|
+
async function getGcsAccessToken(context, itemIndex) {
|
|
9
|
+
return (0, get_access_token_1.getGoogleServiceAccountAccessToken)(context, itemIndex, GCS_RW_SCOPE);
|
|
10
|
+
}
|
|
11
|
+
function ensureBucketMetadata(value, itemIndex, context) {
|
|
12
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
13
|
+
throw new n8n_workflow_1.NodeOperationError(context.getNode(), 'Metadata must be a JSON object.', { itemIndex });
|
|
14
|
+
}
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../../nodes/Gcp/resources/googleCloudStorageBucket/common.ts"],"names":[],"mappings":";;AAMA,8CAEC;AAED,oDAMC;AAfD,+CAAkD;AAClD,uEAAsF;AAEtF,MAAM,YAAY,GAAG,uDAAuD,CAAC;AAEtE,KAAK,UAAU,iBAAiB,CAAC,OAA0B,EAAE,SAAiB;IACpF,OAAO,IAAA,qDAAkC,EAAC,OAAO,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;AAC7E,CAAC;AAED,SAAgB,oBAAoB,CAAC,KAAc,EAAE,SAAiB,EAAE,OAA0B;IACjG,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACjE,MAAM,IAAI,iCAAkB,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,iCAAiC,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;IACnG,CAAC;IAED,OAAO,KAAoB,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeProperties, INodePropertyOptions } from 'n8n-workflow';
|
|
2
|
+
import type { IOperationResult } from '../../../shared/operation-result';
|
|
3
|
+
export declare const googleCloudStorageBucketCreateOption: INodePropertyOptions;
|
|
4
|
+
export declare const googleCloudStorageBucketCreateProperties: INodeProperties[];
|
|
5
|
+
export declare function executeGoogleCloudStorageBucketCreate(context: IExecuteFunctions, itemIndex: number): Promise<IOperationResult>;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.googleCloudStorageBucketCreateProperties = exports.googleCloudStorageBucketCreateOption = void 0;
|
|
4
|
+
exports.executeGoogleCloudStorageBucketCreate = executeGoogleCloudStorageBucketCreate;
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
const common_1 = require("./common");
|
|
7
|
+
exports.googleCloudStorageBucketCreateOption = {
|
|
8
|
+
name: 'Create Bucket',
|
|
9
|
+
value: 'createBucket',
|
|
10
|
+
description: 'Create a new bucket',
|
|
11
|
+
action: 'Create bucket',
|
|
12
|
+
};
|
|
13
|
+
const createProjectIdProperty = {
|
|
14
|
+
displayName: 'Project ID',
|
|
15
|
+
name: 'googleCloudStorage_bucket_create_projectId',
|
|
16
|
+
type: 'string',
|
|
17
|
+
default: '',
|
|
18
|
+
required: true,
|
|
19
|
+
displayOptions: {
|
|
20
|
+
show: { resource: ['googleCloudStorageBucket'], operation: ['createBucket'] },
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
const createBucketNameProperty = {
|
|
24
|
+
displayName: 'Bucket Name',
|
|
25
|
+
name: 'googleCloudStorage_bucket_create_name',
|
|
26
|
+
type: 'string',
|
|
27
|
+
default: '',
|
|
28
|
+
required: true,
|
|
29
|
+
displayOptions: {
|
|
30
|
+
show: { resource: ['googleCloudStorageBucket'], operation: ['createBucket'] },
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
const createLocationProperty = {
|
|
34
|
+
displayName: 'Location',
|
|
35
|
+
name: 'googleCloudStorage_bucket_create_location',
|
|
36
|
+
type: 'string',
|
|
37
|
+
default: 'US',
|
|
38
|
+
displayOptions: {
|
|
39
|
+
show: { resource: ['googleCloudStorageBucket'], operation: ['createBucket'] },
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
const createStorageClassProperty = {
|
|
43
|
+
displayName: 'Storage Class',
|
|
44
|
+
name: 'googleCloudStorage_bucket_create_storageClass',
|
|
45
|
+
type: 'options',
|
|
46
|
+
default: 'STANDARD',
|
|
47
|
+
displayOptions: {
|
|
48
|
+
show: { resource: ['googleCloudStorageBucket'], operation: ['createBucket'] },
|
|
49
|
+
},
|
|
50
|
+
options: [
|
|
51
|
+
{ name: 'Standard', value: 'STANDARD' },
|
|
52
|
+
{ name: 'Nearline', value: 'NEARLINE' },
|
|
53
|
+
{ name: 'Coldline', value: 'COLDLINE' },
|
|
54
|
+
{ name: 'Archive', value: 'ARCHIVE' },
|
|
55
|
+
],
|
|
56
|
+
};
|
|
57
|
+
exports.googleCloudStorageBucketCreateProperties = [
|
|
58
|
+
createProjectIdProperty,
|
|
59
|
+
createBucketNameProperty,
|
|
60
|
+
createLocationProperty,
|
|
61
|
+
createStorageClassProperty,
|
|
62
|
+
];
|
|
63
|
+
async function executeGoogleCloudStorageBucketCreate(context, itemIndex) {
|
|
64
|
+
const projectId = context.getNodeParameter(createProjectIdProperty.name, itemIndex);
|
|
65
|
+
const bucketName = context.getNodeParameter(createBucketNameProperty.name, itemIndex);
|
|
66
|
+
const location = context.getNodeParameter(createLocationProperty.name, itemIndex);
|
|
67
|
+
const storageClass = context.getNodeParameter(createStorageClassProperty.name, itemIndex);
|
|
68
|
+
const accessToken = await (0, common_1.getGcsAccessToken)(context, itemIndex);
|
|
69
|
+
let bucket;
|
|
70
|
+
try {
|
|
71
|
+
bucket = (await context.helpers.httpRequest({
|
|
72
|
+
method: 'POST',
|
|
73
|
+
url: 'https://storage.googleapis.com/storage/v1/b',
|
|
74
|
+
headers: { Authorization: `Bearer ${accessToken}` },
|
|
75
|
+
qs: { project: projectId },
|
|
76
|
+
body: { name: bucketName, location, storageClass },
|
|
77
|
+
json: true,
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
throw new n8n_workflow_1.NodeOperationError(context.getNode(), `Failed to create bucket: ${String(error)}`, { itemIndex });
|
|
82
|
+
}
|
|
83
|
+
return { json: bucket };
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../../nodes/Gcp/resources/googleCloudStorageBucket/create.ts"],"names":[],"mappings":";;;AAmEA,sFAyBC;AA3FD,+CAAkD;AAElD,qCAA6C;AAEhC,QAAA,oCAAoC,GAAyB;IACzE,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE,qBAAqB;IAClC,MAAM,EAAE,eAAe;CACvB,CAAC;AAEF,MAAM,uBAAuB,GAAoB;IAChD,WAAW,EAAE,YAAY;IACzB,IAAI,EAAE,4CAA4C;IAClD,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,EAAE;IACX,QAAQ,EAAE,IAAI;IACd,cAAc,EAAE;QACf,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,0BAA0B,CAAC,EAAE,SAAS,EAAE,CAAC,cAAc,CAAC,EAAE;KAC7E;CACD,CAAC;AAEF,MAAM,wBAAwB,GAAoB;IACjD,WAAW,EAAE,aAAa;IAC1B,IAAI,EAAE,uCAAuC;IAC7C,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,EAAE;IACX,QAAQ,EAAE,IAAI;IACd,cAAc,EAAE;QACf,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,0BAA0B,CAAC,EAAE,SAAS,EAAE,CAAC,cAAc,CAAC,EAAE;KAC7E;CACD,CAAC;AAEF,MAAM,sBAAsB,GAAoB;IAC/C,WAAW,EAAE,UAAU;I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B,CAAC,IAAI,EAAE,SAAS,CAAW,CAAC;IACpG,MAAM,WAAW,GAAG,MAAM,IAAA,0BAAiB,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAEhE,IAAI,MAAmB,CAAC;IACxB,IAAI,CAAC;QACJ,MAAM,GAAG,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC;YAC3C,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,6CAA6C;YAClD,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,WAAW,EAAE,EAAE;YACnD,EAAE,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;YAC1B,IAAI,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE;YAClD,IAAI,EAAE,IAAI;SACV,CAAC,CAAgB,CAAC;IACpB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,IAAI,iCAAkB,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,4BAA4B,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;IAC7G,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeProperties, INodePropertyOptions } from 'n8n-workflow';
|
|
2
|
+
import type { IOperationResult } from '../../../shared/operation-result';
|
|
3
|
+
export declare const googleCloudStorageBucketDeleteOption: INodePropertyOptions;
|
|
4
|
+
export declare const googleCloudStorageBucketDeleteProperties: INodeProperties[];
|
|
5
|
+
export declare function executeGoogleCloudStorageBucketDelete(context: IExecuteFunctions, itemIndex: number): Promise<IOperationResult>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.googleCloudStorageBucketDeleteProperties = exports.googleCloudStorageBucketDeleteOption = void 0;
|
|
4
|
+
exports.executeGoogleCloudStorageBucketDelete = executeGoogleCloudStorageBucketDelete;
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
const common_1 = require("./common");
|
|
7
|
+
exports.googleCloudStorageBucketDeleteOption = {
|
|
8
|
+
name: 'Delete Bucket',
|
|
9
|
+
value: 'deleteBucket',
|
|
10
|
+
description: 'Delete a bucket',
|
|
11
|
+
action: 'Delete bucket',
|
|
12
|
+
};
|
|
13
|
+
const deleteBucketNameProperty = {
|
|
14
|
+
displayName: 'Bucket Name',
|
|
15
|
+
name: 'googleCloudStorage_bucket_delete_name',
|
|
16
|
+
type: 'string',
|
|
17
|
+
default: '',
|
|
18
|
+
required: true,
|
|
19
|
+
displayOptions: {
|
|
20
|
+
show: { resource: ['googleCloudStorageBucket'], operation: ['deleteBucket'] },
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
exports.googleCloudStorageBucketDeleteProperties = [deleteBucketNameProperty];
|
|
24
|
+
async function executeGoogleCloudStorageBucketDelete(context, itemIndex) {
|
|
25
|
+
const bucketName = context.getNodeParameter(deleteBucketNameProperty.name, itemIndex);
|
|
26
|
+
const accessToken = await (0, common_1.getGcsAccessToken)(context, itemIndex);
|
|
27
|
+
try {
|
|
28
|
+
await context.helpers.httpRequest({
|
|
29
|
+
method: 'DELETE',
|
|
30
|
+
url: `https://storage.googleapis.com/storage/v1/b/${encodeURIComponent(bucketName)}`,
|
|
31
|
+
headers: { Authorization: `Bearer ${accessToken}` },
|
|
32
|
+
json: true,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
throw new n8n_workflow_1.NodeOperationError(context.getNode(), `Failed to delete bucket: ${String(error)}`, { itemIndex });
|
|
37
|
+
}
|
|
38
|
+
return { json: { bucket: bucketName, deleted: true } };
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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C,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;IAC7G,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeProperties, INodePropertyOptions } from 'n8n-workflow';
|
|
2
|
+
import type { IOperationResult } from '../../../shared/operation-result';
|
|
3
|
+
export declare const googleCloudStorageBucketGetMetadataOption: INodePropertyOptions;
|
|
4
|
+
export declare const googleCloudStorageBucketGetMetadataProperties: INodeProperties[];
|
|
5
|
+
export declare function executeGoogleCloudStorageBucketGetMetadata(context: IExecuteFunctions, itemIndex: number): Promise<IOperationResult>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.googleCloudStorageBucketGetMetadataProperties = exports.googleCloudStorageBucketGetMetadataOption = void 0;
|
|
4
|
+
exports.executeGoogleCloudStorageBucketGetMetadata = executeGoogleCloudStorageBucketGetMetadata;
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
const common_1 = require("./common");
|
|
7
|
+
exports.googleCloudStorageBucketGetMetadataOption = {
|
|
8
|
+
name: 'Get Bucket Metadata',
|
|
9
|
+
value: 'getBucketMetadata',
|
|
10
|
+
description: 'Retrieve metadata for a bucket',
|
|
11
|
+
action: 'Get bucket metadata',
|
|
12
|
+
};
|
|
13
|
+
const getMetadataBucketNameProperty = {
|
|
14
|
+
displayName: 'Bucket Name',
|
|
15
|
+
name: 'googleCloudStorage_bucket_getMetadata_name',
|
|
16
|
+
type: 'string',
|
|
17
|
+
default: '',
|
|
18
|
+
required: true,
|
|
19
|
+
displayOptions: {
|
|
20
|
+
show: {
|
|
21
|
+
resource: ['googleCloudStorageBucket'],
|
|
22
|
+
operation: ['getBucketMetadata'],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
exports.googleCloudStorageBucketGetMetadataProperties = [
|
|
27
|
+
getMetadataBucketNameProperty,
|
|
28
|
+
];
|
|
29
|
+
async function executeGoogleCloudStorageBucketGetMetadata(context, itemIndex) {
|
|
30
|
+
const bucketName = context.getNodeParameter(getMetadataBucketNameProperty.name, itemIndex);
|
|
31
|
+
const accessToken = await (0, common_1.getGcsAccessToken)(context, itemIndex);
|
|
32
|
+
let metadata;
|
|
33
|
+
try {
|
|
34
|
+
metadata = (await context.helpers.httpRequest({
|
|
35
|
+
method: 'GET',
|
|
36
|
+
url: `https://storage.googleapis.com/storage/v1/b/${encodeURIComponent(bucketName)}`,
|
|
37
|
+
headers: { Authorization: `Bearer ${accessToken}` },
|
|
38
|
+
json: true,
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
throw new n8n_workflow_1.NodeOperationError(context.getNode(), `Failed to get bucket metadata: ${String(error)}`, {
|
|
43
|
+
itemIndex,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return { json: metadata };
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=get-metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-metadata.js","sourceRoot":"","sources":["../../../../../nodes/Gcp/resources/googleCloudStorageBucket/get-metadata.ts"],"names":[],"mappings":";;;AA8BA,gGAsBC;AAnDD,+CAAkD;AAElD,qCAA6C;AAEhC,QAAA,yCAAyC,GAAyB;IAC9E,IAAI,EAAE,qBAAqB;IAC3B,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EAAE,gCAAgC;IAC7C,MAAM,EAAE,qBAAqB;CAC7B,CAAC;AAEF,MAAM,6BAA6B,GAAoB;IACtD,WAAW,EAAE,aAAa;IAC1B,IAAI,EAAE,4CAA4C;IAClD,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,EAAE;IACX,QAAQ,EAAE,IAAI;IACd,cAAc,EAAE;QACf,IAAI,EAAE;YACL,QAAQ,EAAE,CAAC,0BAA0B,CAAC;YACtC,SAAS,EAAE,CAAC,mBAAmB,CAAC;SAChC;KACD;CACD,CAAC;AAEW,QAAA,6CAA6C,GAAsB;IAC/E,6BAA6B;CAC7B,CAAC;AAEK,KAAK,UAAU,0CAA0C,CAC/D,OAA0B,EAC1B,SAAiB;IAEjB,MAAM,UAAU,GAAG,OAAO,CAAC,gBAAgB,CAAC,6BAA6B,CAAC,IAAI,EAAE,SAAS,CAAW,CAAC;IACrG,MAAM,WAAW,GAAG,MAAM,IAAA,0BAAiB,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAEhE,IAAI,QAAqB,CAAC;IAC1B,IAAI,CAAC;QACJ,QAAQ,GAAG,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC;YAC7C,MAAM,EAAE,KAAK;YACb,GAAG,EAAE,+CAA+C,kBAAkB,CAAC,UAAU,CAAC,EAAE;YACpF,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,WAAW,EAAE,EAAE;YACnD,IAAI,EAAE,IAAI;SACV,CAAC,CAAgB,CAAC;IACpB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,IAAI,iCAAkB,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,kCAAkC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE;YAClG,SAAS;SACT,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeProperties, INodePropertyOptions } from 'n8n-workflow';
|
|
2
|
+
import type { IOperationResult } from '../../../shared/operation-result';
|
|
3
|
+
export declare const googleCloudStorageBucketOption: INodePropertyOptions;
|
|
4
|
+
export declare const googleCloudStorageBucketEntityOption: INodePropertyOptions;
|
|
5
|
+
export declare const googleCloudStorageBucketProperties: INodeProperties[];
|
|
6
|
+
export declare function executeGoogleCloudStorageBucket(context: IExecuteFunctions, items: INodeExecutionData[], itemIndex: number): Promise<IOperationResult>;
|