n8n-nodes-base
Version:
Base nodes of n8n
50 lines • 1.86 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.description = void 0;
exports.execute = execute;
const utilities_1 = require("../../../../../../utils/utilities");
const transport_1 = require("../../transport");
const common_descriptions_1 = require("../common.descriptions");
const properties = [
{
...common_descriptions_1.sharedDriveRLC,
description: 'The shared drive to get',
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add option',
default: {},
options: [
{
displayName: 'Use Domain Admin Access',
name: 'useDomainAdminAccess',
type: 'boolean',
default: false,
description: 'Whether to issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the shared drive belongs',
},
],
},
];
const displayOptions = {
show: {
resource: ['drive'],
operation: ['get'],
},
};
exports.description = (0, utilities_1.updateDisplayOptions)(displayOptions, properties);
async function execute(i) {
const returnData = [];
const options = this.getNodeParameter('options', i);
const driveId = this.getNodeParameter('driveId', i, undefined, {
extractValue: true,
});
const qs = {};
Object.assign(qs, options);
const response = await transport_1.googleApiRequest.call(this, 'GET', `/drive/v3/drives/${driveId}`, {}, qs);
const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(response), { itemData: { item: i } });
returnData.push(...executionData);
return returnData;
}
//# sourceMappingURL=get.operation.js.map