n8n-nodes-base 1.90.0 → 1.91.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/dist/credentials/GSuiteAdminOAuth2Api.credentials.js +3 -1
- package/dist/credentials/GSuiteAdminOAuth2Api.credentials.js.map +1 -1
- package/dist/methods/defined.json +2 -1
- package/dist/methods/referenced.json +1 -0
- package/dist/nodes/Calendly/CalendlyTrigger.node.js +11 -0
- package/dist/nodes/Calendly/CalendlyTrigger.node.js.map +1 -1
- package/dist/nodes/EmailReadImap/v1/EmailReadImapV1.node.js +2 -2
- package/dist/nodes/EmailReadImap/v1/EmailReadImapV1.node.js.map +1 -1
- package/dist/nodes/EmailReadImap/v2/EmailReadImapV2.node.js +2 -2
- package/dist/nodes/EmailReadImap/v2/EmailReadImapV2.node.js.map +1 -1
- package/dist/nodes/Files/ReadWriteFile/actions/read.operation.js +0 -1
- package/dist/nodes/Files/ReadWriteFile/actions/read.operation.js.map +1 -1
- package/dist/nodes/Form/utils.js.map +1 -1
- package/dist/nodes/Google/GSuiteAdmin/DeviceDescription.js +381 -0
- package/dist/nodes/Google/GSuiteAdmin/DeviceDescription.js.map +1 -0
- package/dist/nodes/Google/GSuiteAdmin/GSuiteAdmin.node.js +395 -88
- package/dist/nodes/Google/GSuiteAdmin/GSuiteAdmin.node.js.map +1 -1
- package/dist/nodes/Google/GSuiteAdmin/GenericFunctions.js +6 -2
- package/dist/nodes/Google/GSuiteAdmin/GenericFunctions.js.map +1 -1
- package/dist/nodes/Google/GSuiteAdmin/GroupDescripion.js +112 -88
- package/dist/nodes/Google/GSuiteAdmin/GroupDescripion.js.map +1 -1
- package/dist/nodes/Google/GSuiteAdmin/SearchFunctions.js +101 -0
- package/dist/nodes/Google/GSuiteAdmin/SearchFunctions.js.map +1 -0
- package/dist/nodes/Google/GSuiteAdmin/UserDescription.js +538 -195
- package/dist/nodes/Google/GSuiteAdmin/UserDescription.js.map +1 -1
- package/dist/nodes/Google/GSuiteAdmin/gSuiteAdmin.svg +1 -0
- package/dist/nodes/HttpRequest/V2/HttpRequestV2.node.js +11 -0
- package/dist/nodes/HttpRequest/V2/HttpRequestV2.node.js.map +1 -1
- package/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js +8 -0
- package/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js.map +1 -1
- package/dist/nodes/Jira/GenericFunctions.js +25 -12
- package/dist/nodes/Jira/GenericFunctions.js.map +1 -1
- package/dist/nodes/Jira/Jira.node.js +11 -7
- package/dist/nodes/Jira/Jira.node.js.map +1 -1
- package/dist/nodes/LocalFileTrigger/LocalFileTrigger.node.js +2 -2
- package/dist/nodes/LocalFileTrigger/LocalFileTrigger.node.js.map +1 -1
- package/dist/nodes/MQTT/MqttTrigger.node.js +2 -2
- package/dist/nodes/MQTT/MqttTrigger.node.js.map +1 -1
- package/dist/nodes/Postgres/PostgresTrigger.node.js +2 -2
- package/dist/nodes/Postgres/PostgresTrigger.node.js.map +1 -1
- package/dist/nodes/RabbitMQ/RabbitMQTrigger.node.js +2 -2
- package/dist/nodes/RabbitMQ/RabbitMQTrigger.node.js.map +1 -1
- package/dist/nodes/SeaTable/v2/actions/asset/upload.operation.js.map +1 -1
- package/dist/nodes/SeaTable/v2/actions/row/get.operation.js.map +1 -1
- package/dist/nodes/SeaTable/v2/actions/row/list.operation.js.map +1 -1
- package/dist/nodes/SeaTable/v2/actions/row/search.operation.js.map +1 -1
- package/dist/nodes/SseTrigger/SseTrigger.node.js +2 -2
- package/dist/nodes/SseTrigger/SseTrigger.node.js.map +1 -1
- package/dist/nodes/Transform/Summarize/utils.js +7 -7
- package/dist/nodes/Transform/Summarize/utils.js.map +1 -1
- package/dist/test/nodes/Helpers.d.ts +5 -0
- package/dist/test/nodes/Helpers.js +16 -170
- package/dist/test/nodes/Helpers.js.map +1 -1
- package/dist/types/credentials.json +1 -1
- package/dist/types/nodes.json +11 -11
- package/package.json +4 -4
- package/dist/nodes/Google/GSuiteAdmin/google-workspace-admin.png +0 -0
- package/dist/test/nodes/ExecuteWorkflow.js +0 -120
- package/dist/test/nodes/ExecuteWorkflow.js.map +0 -1
- package/dist/test/nodes/credential-types.js +0 -57
- package/dist/test/nodes/credential-types.js.map +0 -1
- package/dist/test/nodes/credentials-helper.js +0 -76
- package/dist/test/nodes/credentials-helper.js.map +0 -1
- package/dist/test/nodes/load-nodes-and-credentials.js +0 -68
- package/dist/test/nodes/load-nodes-and-credentials.js.map +0 -1
- package/dist/test/nodes/node-types.js +0 -56
- package/dist/test/nodes/node-types.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../nodes/Form/utils.ts"],"sourcesContent":["import type { Response } from 'express';\nimport isbot from 'isbot';\nimport { DateTime } from 'luxon';\nimport type {\n\tINodeExecutionData,\n\tMultiPartFormData,\n\tIDataObject,\n\tIWebhookFunctions,\n\tFormFieldsParameter,\n\tNodeTypeAndVersion,\n} from 'n8n-workflow';\nimport {\n\tFORM_NODE_TYPE,\n\tFORM_TRIGGER_NODE_TYPE,\n\tNodeOperationError,\n\tWAIT_NODE_TYPE,\n\tjsonParse,\n} from 'n8n-workflow';\nimport sanitize from 'sanitize-html';\n\nimport type { FormTriggerData, FormTriggerInput } from './interfaces';\nimport { FORM_TRIGGER_AUTHENTICATION_PROPERTY } from './interfaces';\nimport { getResolvables } from '../../utils/utilities';\nimport { WebhookAuthorizationError } from '../Webhook/error';\nimport { validateWebhookAuthentication } from '../Webhook/utils';\n\nexport function sanitizeHtml(text: string) {\n\treturn sanitize(text, {\n\t\tallowedTags: [\n\t\t\t'b',\n\t\t\t'div',\n\t\t\t'i',\n\t\t\t'iframe',\n\t\t\t'img',\n\t\t\t'video',\n\t\t\t'source',\n\t\t\t'em',\n\t\t\t'strong',\n\t\t\t'a',\n\t\t\t'h1',\n\t\t\t'h2',\n\t\t\t'h3',\n\t\t\t'h4',\n\t\t\t'h5',\n\t\t\t'h6',\n\t\t\t'u',\n\t\t\t'sub',\n\t\t\t'sup',\n\t\t\t'code',\n\t\t\t'pre',\n\t\t\t'span',\n\t\t\t'br',\n\t\t\t'ul',\n\t\t\t'ol',\n\t\t\t'li',\n\t\t\t'p',\n\t\t],\n\t\tallowedAttributes: {\n\t\t\ta: ['href', 'target', 'rel'],\n\t\t\timg: ['src', 'alt', 'width', 'height'],\n\t\t\tvideo: ['*'],\n\t\t\tiframe: ['*'],\n\t\t\tsource: ['*'],\n\t\t},\n\t\ttransformTags: {\n\t\t\tiframe: sanitize.simpleTransform('iframe', {\n\t\t\t\tsandbox: '',\n\t\t\t\treferrerpolicy: 'strict-origin-when-cross-origin',\n\t\t\t\tallow: 'fullscreen; autoplay; encrypted-media',\n\t\t\t}),\n\t\t},\n\t});\n}\n\nexport const prepareFormFields = (context: IWebhookFunctions, fields: FormFieldsParameter) => {\n\treturn fields.map((field) => {\n\t\tif (field.fieldType === 'html') {\n\t\t\tlet { html } = field;\n\n\t\t\tif (!html) return field;\n\n\t\t\tfor (const resolvable of getResolvables(html)) {\n\t\t\t\thtml = html.replace(resolvable, context.evaluateExpression(resolvable) as string);\n\t\t\t}\n\n\t\t\tfield.html = sanitizeHtml(html as string);\n\t\t}\n\n\t\tif (field.fieldType === 'hiddenField') {\n\t\t\tfield.fieldLabel = field.fieldName as string;\n\t\t}\n\n\t\treturn field;\n\t});\n};\n\nexport function sanitizeCustomCss(css: string | undefined): string | undefined {\n\tif (!css) return undefined;\n\n\t// Use sanitize-html with custom settings for CSS\n\treturn sanitize(css, {\n\t\tallowedTags: [], // No HTML tags allowed\n\t\tallowedAttributes: {}, // No attributes allowed\n\t\t// This ensures we're only keeping the text content\n\t\t// which should be the CSS, while removing any HTML/script tags\n\t});\n}\n\nexport function createDescriptionMetadata(description: string) {\n\treturn description === ''\n\t\t? 'n8n form'\n\t\t: description.replace(/^\\s*\\n+|<\\/?[^>]+(>|$)/g, '').slice(0, 150);\n}\n\nexport function prepareFormData({\n\tformTitle,\n\tformDescription,\n\tformSubmittedHeader,\n\tformSubmittedText,\n\tredirectUrl,\n\tformFields,\n\ttestRun,\n\tquery,\n\tinstanceId,\n\tuseResponseData,\n\tappendAttribution = true,\n\tbuttonLabel,\n\tcustomCss,\n}: {\n\tformTitle: string;\n\tformDescription: string;\n\tformSubmittedText: string | undefined;\n\tredirectUrl: string | undefined;\n\tformFields: FormFieldsParameter;\n\ttestRun: boolean;\n\tquery: IDataObject;\n\tinstanceId?: string;\n\tuseResponseData?: boolean;\n\tappendAttribution?: boolean;\n\tbuttonLabel?: string;\n\tformSubmittedHeader?: string;\n\tcustomCss?: string;\n}) {\n\tconst utm_campaign = instanceId ? `&utm_campaign=${instanceId}` : '';\n\tconst n8nWebsiteLink = `https://n8n.io/?utm_source=n8n-internal&utm_medium=form-trigger${utm_campaign}`;\n\n\tif (formSubmittedText === undefined) {\n\t\tformSubmittedText = 'Your response has been recorded';\n\t}\n\n\tconst formData: FormTriggerData = {\n\t\ttestRun,\n\t\tformTitle,\n\t\tformDescription,\n\t\tformDescriptionMetadata: createDescriptionMetadata(formDescription),\n\t\tformSubmittedHeader,\n\t\tformSubmittedText,\n\t\tn8nWebsiteLink,\n\t\tformFields: [],\n\t\tuseResponseData,\n\t\tappendAttribution,\n\t\tbuttonLabel,\n\t\tdangerousCustomCss: sanitizeCustomCss(customCss),\n\t};\n\n\tif (redirectUrl) {\n\t\tif (!redirectUrl.includes('://')) {\n\t\t\tredirectUrl = `http://${redirectUrl}`;\n\t\t}\n\t\tformData.redirectUrl = redirectUrl;\n\t}\n\n\tfor (const [index, field] of formFields.entries()) {\n\t\tconst { fieldType, requiredField, multiselect, placeholder } = field;\n\n\t\tconst input: IDataObject = {\n\t\t\tid: `field-${index}`,\n\t\t\terrorId: `error-field-${index}`,\n\t\t\tlabel: field.fieldLabel,\n\t\t\tinputRequired: requiredField ? 'form-required' : '',\n\t\t\tdefaultValue: query[field.fieldLabel] ?? '',\n\t\t\tplaceholder,\n\t\t};\n\n\t\tif (multiselect) {\n\t\t\tinput.isMultiSelect = true;\n\t\t\tinput.multiSelectOptions =\n\t\t\t\tfield.fieldOptions?.values.map((e, i) => ({\n\t\t\t\t\tid: `option${i}_${input.id}`,\n\t\t\t\t\tlabel: e.option,\n\t\t\t\t})) ?? [];\n\t\t} else if (fieldType === 'file') {\n\t\t\tinput.isFileInput = true;\n\t\t\tinput.acceptFileTypes = field.acceptFileTypes;\n\t\t\tinput.multipleFiles = field.multipleFiles ? 'multiple' : '';\n\t\t} else if (fieldType === 'dropdown') {\n\t\t\tinput.isSelect = true;\n\t\t\tconst fieldOptions = field.fieldOptions?.values ?? [];\n\t\t\tinput.selectOptions = fieldOptions.map((e) => e.option);\n\t\t} else if (fieldType === 'textarea') {\n\t\t\tinput.isTextarea = true;\n\t\t} else if (fieldType === 'html') {\n\t\t\tinput.isHtml = true;\n\t\t\tinput.html = field.html as string;\n\t\t} else if (fieldType === 'hiddenField') {\n\t\t\tinput.isHidden = true;\n\t\t\tinput.hiddenName = field.fieldName as string;\n\t\t\tinput.hiddenValue =\n\t\t\t\tinput.defaultValue === '' ? (field.fieldValue as string) : input.defaultValue;\n\t\t} else {\n\t\t\tinput.isInput = true;\n\t\t\tinput.type = fieldType as 'text' | 'number' | 'date' | 'email';\n\t\t}\n\n\t\tformData.formFields.push(input as FormTriggerInput);\n\t}\n\n\treturn formData;\n}\n\nexport const validateResponseModeConfiguration = (context: IWebhookFunctions) => {\n\tconst responseMode = context.getNodeParameter('responseMode', 'onReceived') as string;\n\tconst connectedNodes = context.getChildNodes(context.getNode().name);\n\tconst nodeVersion = context.getNode().typeVersion;\n\n\tconst isRespondToWebhookConnected = connectedNodes.some(\n\t\t(node) => node.type === 'n8n-nodes-base.respondToWebhook',\n\t);\n\n\tif (!isRespondToWebhookConnected && responseMode === 'responseNode') {\n\t\tthrow new NodeOperationError(\n\t\t\tcontext.getNode(),\n\t\t\tnew Error('No Respond to Webhook node found in the workflow'),\n\t\t\t{\n\t\t\t\tdescription:\n\t\t\t\t\t'Insert a Respond to Webhook node to your workflow to respond to the form submission or choose another option for the “Respond When” parameter',\n\t\t\t},\n\t\t);\n\t}\n\n\tif (isRespondToWebhookConnected && responseMode !== 'responseNode' && nodeVersion <= 2.1) {\n\t\tthrow new NodeOperationError(\n\t\t\tcontext.getNode(),\n\t\t\tnew Error(`${context.getNode().name} node not correctly configured`),\n\t\t\t{\n\t\t\t\tdescription:\n\t\t\t\t\t'Set the “Respond When” parameter to “Using Respond to Webhook Node” or remove the Respond to Webhook node',\n\t\t\t},\n\t\t);\n\t}\n\n\tif (isRespondToWebhookConnected && nodeVersion > 2.1) {\n\t\tthrow new NodeOperationError(\n\t\t\tcontext.getNode(),\n\t\t\tnew Error(\n\t\t\t\t'The \"Respond to Webhook\" node is not supported in workflows initiated by the \"n8n Form Trigger\"',\n\t\t\t),\n\t\t\t{\n\t\t\t\tdescription:\n\t\t\t\t\t'To configure your response, add an \"n8n Form\" node and set the \"Page Type\" to \"Form Ending\"',\n\t\t\t},\n\t\t);\n\t}\n};\n\nexport function addFormResponseDataToReturnItem(\n\treturnItem: INodeExecutionData,\n\tformFields: FormFieldsParameter,\n\tbodyData: IDataObject,\n) {\n\tfor (const [index, field] of formFields.entries()) {\n\t\tconst key = `field-${index}`;\n\t\tconst name = field.fieldLabel ?? field.fieldName;\n\t\tlet value = bodyData[key] ?? null;\n\n\t\tif (value === null) {\n\t\t\treturnItem.json[name] = null;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (field.fieldType === 'html') {\n\t\t\tif (field.elementName) {\n\t\t\t\treturnItem.json[field.elementName] = value;\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (field.fieldType === 'number') {\n\t\t\tvalue = Number(value);\n\t\t}\n\t\tif (field.fieldType === 'text') {\n\t\t\tvalue = String(value).trim();\n\t\t}\n\t\tif (field.multiselect && typeof value === 'string') {\n\t\t\tvalue = jsonParse(value);\n\t\t}\n\t\tif (field.fieldType === 'date' && value && field.formatDate !== '') {\n\t\t\tvalue = DateTime.fromFormat(String(value), 'yyyy-mm-dd').toFormat(field.formatDate as string);\n\t\t}\n\t\tif (field.fieldType === 'file' && field.multipleFiles && !Array.isArray(value)) {\n\t\t\tvalue = [value];\n\t\t}\n\n\t\treturnItem.json[name] = value;\n\t}\n}\n\nexport async function prepareFormReturnItem(\n\tcontext: IWebhookFunctions,\n\tformFields: FormFieldsParameter,\n\tmode: 'test' | 'production',\n\tuseWorkflowTimezone: boolean = false,\n) {\n\tconst bodyData = (context.getBodyData().data as IDataObject) ?? {};\n\tconst files = (context.getBodyData().files as IDataObject) ?? {};\n\n\tconst returnItem: INodeExecutionData = {\n\t\tjson: {},\n\t};\n\tif (files && Object.keys(files).length) {\n\t\treturnItem.binary = {};\n\t}\n\n\tfor (const key of Object.keys(files)) {\n\t\tconst processFiles: MultiPartFormData.File[] = [];\n\t\tlet multiFile = false;\n\t\tconst filesInput = files[key] as MultiPartFormData.File[] | MultiPartFormData.File;\n\n\t\tif (Array.isArray(filesInput)) {\n\t\t\tbodyData[key] = filesInput.map((file) => ({\n\t\t\t\tfilename: file.originalFilename,\n\t\t\t\tmimetype: file.mimetype,\n\t\t\t\tsize: file.size,\n\t\t\t}));\n\t\t\tprocessFiles.push(...filesInput);\n\t\t\tmultiFile = true;\n\t\t} else {\n\t\t\tbodyData[key] = {\n\t\t\t\tfilename: filesInput.originalFilename,\n\t\t\t\tmimetype: filesInput.mimetype,\n\t\t\t\tsize: filesInput.size,\n\t\t\t};\n\t\t\tprocessFiles.push(filesInput);\n\t\t}\n\n\t\tconst entryIndex = Number(key.replace(/field-/g, ''));\n\t\tconst fieldLabel = isNaN(entryIndex) ? key : formFields[entryIndex].fieldLabel;\n\n\t\tlet fileCount = 0;\n\t\tfor (const file of processFiles) {\n\t\t\tlet binaryPropertyName = fieldLabel.replace(/\\W/g, '_');\n\n\t\t\tif (multiFile) {\n\t\t\t\tbinaryPropertyName += `_${fileCount++}`;\n\t\t\t}\n\n\t\t\treturnItem.binary![binaryPropertyName] = await context.nodeHelpers.copyBinaryFile(\n\t\t\t\tfile.filepath,\n\t\t\t\tfile.originalFilename ?? file.newFilename,\n\t\t\t\tfile.mimetype,\n\t\t\t);\n\t\t}\n\t}\n\n\taddFormResponseDataToReturnItem(returnItem, formFields, bodyData);\n\n\tconst timezone = useWorkflowTimezone ? context.getTimezone() : 'UTC';\n\treturnItem.json.submittedAt = DateTime.now().setZone(timezone).toISO();\n\n\treturnItem.json.formMode = mode;\n\n\tif (\n\t\tcontext.getNode().type === FORM_TRIGGER_NODE_TYPE &&\n\t\tObject.keys(context.getRequestObject().query || {}).length\n\t) {\n\t\treturnItem.json.formQueryParameters = context.getRequestObject().query;\n\t}\n\n\treturn returnItem;\n}\n\nexport function renderForm({\n\tcontext,\n\tres,\n\tformTitle,\n\tformDescription,\n\tformFields,\n\tresponseMode,\n\tmode,\n\tformSubmittedText,\n\tredirectUrl,\n\tappendAttribution,\n\tbuttonLabel,\n\tcustomCss,\n}: {\n\tcontext: IWebhookFunctions;\n\tres: Response;\n\tformTitle: string;\n\tformDescription: string;\n\tformFields: FormFieldsParameter;\n\tresponseMode: string;\n\tmode: 'test' | 'production';\n\tformSubmittedText?: string;\n\tredirectUrl?: string;\n\tappendAttribution?: boolean;\n\tbuttonLabel?: string;\n\tcustomCss?: string;\n}) {\n\tformDescription = (formDescription || '').replace(/\\\\n/g, '\\n').replace(/<br>/g, '\\n');\n\tconst instanceId = context.getInstanceId();\n\n\tconst useResponseData = responseMode === 'responseNode';\n\n\tlet query: IDataObject = {};\n\n\tif (context.getNode().type === FORM_TRIGGER_NODE_TYPE) {\n\t\tquery = context.getRequestObject().query as IDataObject;\n\t} else if (context.getNode().type === FORM_NODE_TYPE) {\n\t\tconst parentNodes = context.getParentNodes(context.getNode().name);\n\t\tconst trigger = parentNodes.find(\n\t\t\t(node) => node.type === FORM_TRIGGER_NODE_TYPE,\n\t\t) as NodeTypeAndVersion;\n\t\ttry {\n\t\t\tconst triggerQueryParameters = context.evaluateExpression(\n\t\t\t\t`{{ $('${trigger?.name}').first().json.formQueryParameters }}`,\n\t\t\t) as IDataObject;\n\n\t\t\tif (triggerQueryParameters) {\n\t\t\t\tquery = triggerQueryParameters;\n\t\t\t}\n\t\t} catch (error) {}\n\t}\n\n\tformFields = prepareFormFields(context, formFields);\n\n\tconst data = prepareFormData({\n\t\tformTitle,\n\t\tformDescription,\n\t\tformSubmittedText,\n\t\tredirectUrl,\n\t\tformFields,\n\t\ttestRun: mode === 'test',\n\t\tquery,\n\t\tinstanceId,\n\t\tuseResponseData,\n\t\tappendAttribution,\n\t\tbuttonLabel,\n\t\tcustomCss,\n\t});\n\n\tres.render('form-trigger', data);\n}\n\nexport const isFormConnected = (nodes: NodeTypeAndVersion[]) => {\n\treturn nodes.some(\n\t\t(n) =>\n\t\t\tn.type === FORM_NODE_TYPE || (n.type === WAIT_NODE_TYPE && n.parameters?.resume === 'form'),\n\t);\n};\n\nexport async function formWebhook(\n\tcontext: IWebhookFunctions,\n\tauthProperty = FORM_TRIGGER_AUTHENTICATION_PROPERTY,\n) {\n\tconst node = context.getNode();\n\tconst options = context.getNodeParameter('options', {}) as {\n\t\tignoreBots?: boolean;\n\t\trespondWithOptions?: {\n\t\t\tvalues: {\n\t\t\t\trespondWith: 'text' | 'redirect';\n\t\t\t\tformSubmittedText: string;\n\t\t\t\tredirectUrl: string;\n\t\t\t};\n\t\t};\n\t\tformSubmittedText?: string;\n\t\tuseWorkflowTimezone?: boolean;\n\t\tappendAttribution?: boolean;\n\t\tbuttonLabel?: string;\n\t\tcustomCss?: string;\n\t};\n\tconst res = context.getResponseObject();\n\tconst req = context.getRequestObject();\n\n\ttry {\n\t\tif (options.ignoreBots && isbot(req.headers['user-agent'])) {\n\t\t\tthrow new WebhookAuthorizationError(403);\n\t\t}\n\t\tif (node.typeVersion > 1) {\n\t\t\tawait validateWebhookAuthentication(context, authProperty);\n\t\t}\n\t} catch (error) {\n\t\tif (error instanceof WebhookAuthorizationError) {\n\t\t\tres.setHeader('WWW-Authenticate', 'Basic realm=\"Enter credentials\"');\n\t\t\tres.status(401).send();\n\t\t\treturn { noWebhookResponse: true };\n\t\t}\n\t\tthrow error;\n\t}\n\n\tconst mode = context.getMode() === 'manual' ? 'test' : 'production';\n\tconst formFields = context.getNodeParameter('formFields.values', []) as FormFieldsParameter;\n\n\tconst method = context.getRequestObject().method;\n\n\tvalidateResponseModeConfiguration(context);\n\n\t//Show the form on GET request\n\tif (method === 'GET') {\n\t\tconst formTitle = context.getNodeParameter('formTitle', '') as string;\n\t\tconst formDescription = sanitizeHtml(context.getNodeParameter('formDescription', '') as string);\n\t\tlet responseMode = context.getNodeParameter('responseMode', '') as string;\n\n\t\tlet formSubmittedText;\n\t\tlet redirectUrl;\n\t\tlet appendAttribution = true;\n\n\t\tif (options.respondWithOptions) {\n\t\t\tconst values = (options.respondWithOptions as IDataObject).values as IDataObject;\n\t\t\tif (values.respondWith === 'text') {\n\t\t\t\tformSubmittedText = values.formSubmittedText as string;\n\t\t\t}\n\t\t\tif (values.respondWith === 'redirect') {\n\t\t\t\tredirectUrl = values.redirectUrl as string;\n\t\t\t}\n\t\t} else {\n\t\t\tformSubmittedText = options.formSubmittedText as string;\n\t\t}\n\n\t\tif (options.appendAttribution === false) {\n\t\t\tappendAttribution = false;\n\t\t}\n\n\t\tlet buttonLabel = 'Submit';\n\n\t\tif (options.buttonLabel) {\n\t\t\tbuttonLabel = options.buttonLabel;\n\t\t}\n\n\t\tconst connectedNodes = context.getChildNodes(context.getNode().name, {\n\t\t\tincludeNodeParameters: true,\n\t\t});\n\t\tconst hasNextPage = isFormConnected(connectedNodes);\n\n\t\tif (hasNextPage) {\n\t\t\tredirectUrl = undefined;\n\t\t\tresponseMode = 'responseNode';\n\t\t}\n\n\t\trenderForm({\n\t\t\tcontext,\n\t\t\tres,\n\t\t\tformTitle,\n\t\t\tformDescription,\n\t\t\tformFields,\n\t\t\tresponseMode,\n\t\t\tmode,\n\t\t\tformSubmittedText,\n\t\t\tredirectUrl,\n\t\t\tappendAttribution,\n\t\t\tbuttonLabel,\n\t\t\tcustomCss: options.customCss,\n\t\t});\n\n\t\treturn {\n\t\t\tnoWebhookResponse: true,\n\t\t};\n\t}\n\n\tlet { useWorkflowTimezone } = options;\n\n\tif (useWorkflowTimezone === undefined && node.typeVersion > 2) {\n\t\tuseWorkflowTimezone = true;\n\t}\n\n\tconst returnItem = await prepareFormReturnItem(context, formFields, mode, useWorkflowTimezone);\n\n\treturn {\n\t\twebhookResponse: { status: 200 },\n\t\tworkflowData: [[returnItem]],\n\t};\n}\n\nexport function resolveRawData(context: IWebhookFunctions, rawData: string) {\n\tconst resolvables = getResolvables(rawData);\n\tlet returnData: string = rawData;\n\n\tif (returnData.startsWith('=')) {\n\t\treturnData = returnData.replace(/^=+/, '');\n\t} else {\n\t\treturn returnData;\n\t}\n\n\tif (resolvables.length) {\n\t\tfor (const resolvable of resolvables) {\n\t\t\tconst resolvedValue = context.evaluateExpression(`${resolvable}`);\n\n\t\t\tif (typeof resolvedValue === 'object' && resolvedValue !== null) {\n\t\t\t\treturnData = returnData.replace(resolvable, JSON.stringify(resolvedValue));\n\t\t\t} else {\n\t\t\t\treturnData = returnData.replace(resolvable, resolvedValue as string);\n\t\t\t}\n\t\t}\n\t}\n\treturn returnData;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAClB,mBAAyB;AASzB,0BAMO;AACP,2BAAqB;AAGrB,wBAAqD;AACrD,uBAA+B;AAC/B,mBAA0C;AAC1C,mBAA8C;AAEvC,SAAS,aAAa,MAAc;AAC1C,aAAO,qBAAAA,SAAS,MAAM;AAAA,IACrB,aAAa;AAAA,MACZ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAC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R;AAEA,MAAI,YAAY,QAAQ;AACvB,eAAW,cAAc,aAAa;AACrC,YAAM,gBAAgB,QAAQ,mBAAmB,GAAG,UAAU,EAAE;AAEhE,UAAI,OAAO,kBAAkB,YAAY,kBAAkB,MAAM;AAChE,qBAAa,WAAW,QAAQ,YAAY,KAAK,UAAU,aAAa,CAAC;AAAA,MAC1E,OAAO;AACN,qBAAa,WAAW,QAAQ,YAAY,aAAuB;AAAA,MACpE;AAAA,IACD;AAAA,EACD;AACA,SAAO;AACR;","names":["sanitize","isbot"]}
|
|
1
|
+
{"version":3,"sources":["../../../nodes/Form/utils.ts"],"sourcesContent":["import type { Response } from 'express';\nimport isbot from 'isbot';\nimport { DateTime } from 'luxon';\nimport type {\n\tINodeExecutionData,\n\tMultiPartFormData,\n\tIDataObject,\n\tIWebhookFunctions,\n\tFormFieldsParameter,\n\tNodeTypeAndVersion,\n} from 'n8n-workflow';\nimport {\n\tFORM_NODE_TYPE,\n\tFORM_TRIGGER_NODE_TYPE,\n\tNodeOperationError,\n\tWAIT_NODE_TYPE,\n\tjsonParse,\n} from 'n8n-workflow';\nimport sanitize from 'sanitize-html';\n\nimport type { FormTriggerData, FormTriggerInput } from './interfaces';\nimport { FORM_TRIGGER_AUTHENTICATION_PROPERTY } from './interfaces';\nimport { getResolvables } from '../../utils/utilities';\nimport { WebhookAuthorizationError } from '../Webhook/error';\nimport { validateWebhookAuthentication } from '../Webhook/utils';\n\nexport function sanitizeHtml(text: string) {\n\treturn sanitize(text, {\n\t\tallowedTags: [\n\t\t\t'b',\n\t\t\t'div',\n\t\t\t'i',\n\t\t\t'iframe',\n\t\t\t'img',\n\t\t\t'video',\n\t\t\t'source',\n\t\t\t'em',\n\t\t\t'strong',\n\t\t\t'a',\n\t\t\t'h1',\n\t\t\t'h2',\n\t\t\t'h3',\n\t\t\t'h4',\n\t\t\t'h5',\n\t\t\t'h6',\n\t\t\t'u',\n\t\t\t'sub',\n\t\t\t'sup',\n\t\t\t'code',\n\t\t\t'pre',\n\t\t\t'span',\n\t\t\t'br',\n\t\t\t'ul',\n\t\t\t'ol',\n\t\t\t'li',\n\t\t\t'p',\n\t\t],\n\t\tallowedAttributes: {\n\t\t\ta: ['href', 'target', 'rel'],\n\t\t\timg: ['src', 'alt', 'width', 'height'],\n\t\t\tvideo: ['*'],\n\t\t\tiframe: ['*'],\n\t\t\tsource: ['*'],\n\t\t},\n\t\ttransformTags: {\n\t\t\tiframe: sanitize.simpleTransform('iframe', {\n\t\t\t\tsandbox: '',\n\t\t\t\treferrerpolicy: 'strict-origin-when-cross-origin',\n\t\t\t\tallow: 'fullscreen; autoplay; encrypted-media',\n\t\t\t}),\n\t\t},\n\t});\n}\n\nexport const prepareFormFields = (context: IWebhookFunctions, fields: FormFieldsParameter) => {\n\treturn fields.map((field) => {\n\t\tif (field.fieldType === 'html') {\n\t\t\tlet { html } = field;\n\n\t\t\tif (!html) return field;\n\n\t\t\tfor (const resolvable of getResolvables(html)) {\n\t\t\t\thtml = html.replace(resolvable, context.evaluateExpression(resolvable) as string);\n\t\t\t}\n\n\t\t\tfield.html = sanitizeHtml(html);\n\t\t}\n\n\t\tif (field.fieldType === 'hiddenField') {\n\t\t\tfield.fieldLabel = field.fieldName as string;\n\t\t}\n\n\t\treturn field;\n\t});\n};\n\nexport function sanitizeCustomCss(css: string | undefined): string | undefined {\n\tif (!css) return undefined;\n\n\t// Use sanitize-html with custom settings for CSS\n\treturn sanitize(css, {\n\t\tallowedTags: [], // No HTML tags allowed\n\t\tallowedAttributes: {}, // No attributes allowed\n\t\t// This ensures we're only keeping the text content\n\t\t// which should be the CSS, while removing any HTML/script tags\n\t});\n}\n\nexport function createDescriptionMetadata(description: string) {\n\treturn description === ''\n\t\t? 'n8n form'\n\t\t: description.replace(/^\\s*\\n+|<\\/?[^>]+(>|$)/g, '').slice(0, 150);\n}\n\nexport function prepareFormData({\n\tformTitle,\n\tformDescription,\n\tformSubmittedHeader,\n\tformSubmittedText,\n\tredirectUrl,\n\tformFields,\n\ttestRun,\n\tquery,\n\tinstanceId,\n\tuseResponseData,\n\tappendAttribution = true,\n\tbuttonLabel,\n\tcustomCss,\n}: {\n\tformTitle: string;\n\tformDescription: string;\n\tformSubmittedText: string | undefined;\n\tredirectUrl: string | undefined;\n\tformFields: FormFieldsParameter;\n\ttestRun: boolean;\n\tquery: IDataObject;\n\tinstanceId?: string;\n\tuseResponseData?: boolean;\n\tappendAttribution?: boolean;\n\tbuttonLabel?: string;\n\tformSubmittedHeader?: string;\n\tcustomCss?: string;\n}) {\n\tconst utm_campaign = instanceId ? `&utm_campaign=${instanceId}` : '';\n\tconst n8nWebsiteLink = `https://n8n.io/?utm_source=n8n-internal&utm_medium=form-trigger${utm_campaign}`;\n\n\tif (formSubmittedText === undefined) {\n\t\tformSubmittedText = 'Your response has been recorded';\n\t}\n\n\tconst formData: FormTriggerData = {\n\t\ttestRun,\n\t\tformTitle,\n\t\tformDescription,\n\t\tformDescriptionMetadata: createDescriptionMetadata(formDescription),\n\t\tformSubmittedHeader,\n\t\tformSubmittedText,\n\t\tn8nWebsiteLink,\n\t\tformFields: [],\n\t\tuseResponseData,\n\t\tappendAttribution,\n\t\tbuttonLabel,\n\t\tdangerousCustomCss: sanitizeCustomCss(customCss),\n\t};\n\n\tif (redirectUrl) {\n\t\tif (!redirectUrl.includes('://')) {\n\t\t\tredirectUrl = `http://${redirectUrl}`;\n\t\t}\n\t\tformData.redirectUrl = redirectUrl;\n\t}\n\n\tfor (const [index, field] of formFields.entries()) {\n\t\tconst { fieldType, requiredField, multiselect, placeholder } = field;\n\n\t\tconst input: IDataObject = {\n\t\t\tid: `field-${index}`,\n\t\t\terrorId: `error-field-${index}`,\n\t\t\tlabel: field.fieldLabel,\n\t\t\tinputRequired: requiredField ? 'form-required' : '',\n\t\t\tdefaultValue: query[field.fieldLabel] ?? '',\n\t\t\tplaceholder,\n\t\t};\n\n\t\tif (multiselect) {\n\t\t\tinput.isMultiSelect = true;\n\t\t\tinput.multiSelectOptions =\n\t\t\t\tfield.fieldOptions?.values.map((e, i) => ({\n\t\t\t\t\tid: `option${i}_${input.id}`,\n\t\t\t\t\tlabel: e.option,\n\t\t\t\t})) ?? [];\n\t\t} else if (fieldType === 'file') {\n\t\t\tinput.isFileInput = true;\n\t\t\tinput.acceptFileTypes = field.acceptFileTypes;\n\t\t\tinput.multipleFiles = field.multipleFiles ? 'multiple' : '';\n\t\t} else if (fieldType === 'dropdown') {\n\t\t\tinput.isSelect = true;\n\t\t\tconst fieldOptions = field.fieldOptions?.values ?? [];\n\t\t\tinput.selectOptions = fieldOptions.map((e) => e.option);\n\t\t} else if (fieldType === 'textarea') {\n\t\t\tinput.isTextarea = true;\n\t\t} else if (fieldType === 'html') {\n\t\t\tinput.isHtml = true;\n\t\t\tinput.html = field.html as string;\n\t\t} else if (fieldType === 'hiddenField') {\n\t\t\tinput.isHidden = true;\n\t\t\tinput.hiddenName = field.fieldName as string;\n\t\t\tinput.hiddenValue =\n\t\t\t\tinput.defaultValue === '' ? (field.fieldValue as string) : input.defaultValue;\n\t\t} else {\n\t\t\tinput.isInput = true;\n\t\t\tinput.type = fieldType as 'text' | 'number' | 'date' | 'email';\n\t\t}\n\n\t\tformData.formFields.push(input as FormTriggerInput);\n\t}\n\n\treturn formData;\n}\n\nexport const validateResponseModeConfiguration = (context: IWebhookFunctions) => {\n\tconst responseMode = context.getNodeParameter('responseMode', 'onReceived') as string;\n\tconst connectedNodes = context.getChildNodes(context.getNode().name);\n\tconst nodeVersion = context.getNode().typeVersion;\n\n\tconst isRespondToWebhookConnected = connectedNodes.some(\n\t\t(node) => node.type === 'n8n-nodes-base.respondToWebhook',\n\t);\n\n\tif (!isRespondToWebhookConnected && responseMode === 'responseNode') {\n\t\tthrow new NodeOperationError(\n\t\t\tcontext.getNode(),\n\t\t\tnew Error('No Respond to Webhook node found in the workflow'),\n\t\t\t{\n\t\t\t\tdescription:\n\t\t\t\t\t'Insert a Respond to Webhook node to your workflow to respond to the form submission or choose another option for the “Respond When” parameter',\n\t\t\t},\n\t\t);\n\t}\n\n\tif (isRespondToWebhookConnected && responseMode !== 'responseNode' && nodeVersion <= 2.1) {\n\t\tthrow new NodeOperationError(\n\t\t\tcontext.getNode(),\n\t\t\tnew Error(`${context.getNode().name} node not correctly configured`),\n\t\t\t{\n\t\t\t\tdescription:\n\t\t\t\t\t'Set the “Respond When” parameter to “Using Respond to Webhook Node” or remove the Respond to Webhook node',\n\t\t\t},\n\t\t);\n\t}\n\n\tif (isRespondToWebhookConnected && nodeVersion > 2.1) {\n\t\tthrow new NodeOperationError(\n\t\t\tcontext.getNode(),\n\t\t\tnew Error(\n\t\t\t\t'The \"Respond to Webhook\" node is not supported in workflows initiated by the \"n8n Form Trigger\"',\n\t\t\t),\n\t\t\t{\n\t\t\t\tdescription:\n\t\t\t\t\t'To configure your response, add an \"n8n Form\" node and set the \"Page Type\" to \"Form Ending\"',\n\t\t\t},\n\t\t);\n\t}\n};\n\nexport function addFormResponseDataToReturnItem(\n\treturnItem: INodeExecutionData,\n\tformFields: FormFieldsParameter,\n\tbodyData: IDataObject,\n) {\n\tfor (const [index, field] of formFields.entries()) {\n\t\tconst key = `field-${index}`;\n\t\tconst name = field.fieldLabel ?? field.fieldName;\n\t\tlet value = bodyData[key] ?? null;\n\n\t\tif (value === null) {\n\t\t\treturnItem.json[name] = null;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (field.fieldType === 'html') {\n\t\t\tif (field.elementName) {\n\t\t\t\treturnItem.json[field.elementName] = value;\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (field.fieldType === 'number') {\n\t\t\tvalue = Number(value);\n\t\t}\n\t\tif (field.fieldType === 'text') {\n\t\t\tvalue = String(value).trim();\n\t\t}\n\t\tif (field.multiselect && typeof value === 'string') {\n\t\t\tvalue = jsonParse(value);\n\t\t}\n\t\tif (field.fieldType === 'date' && value && field.formatDate !== '') {\n\t\t\tvalue = DateTime.fromFormat(String(value), 'yyyy-mm-dd').toFormat(field.formatDate as string);\n\t\t}\n\t\tif (field.fieldType === 'file' && field.multipleFiles && !Array.isArray(value)) {\n\t\t\tvalue = [value];\n\t\t}\n\n\t\treturnItem.json[name] = value;\n\t}\n}\n\nexport async function prepareFormReturnItem(\n\tcontext: IWebhookFunctions,\n\tformFields: FormFieldsParameter,\n\tmode: 'test' | 'production',\n\tuseWorkflowTimezone: boolean = false,\n) {\n\tconst bodyData = (context.getBodyData().data as IDataObject) ?? {};\n\tconst files = (context.getBodyData().files as IDataObject) ?? {};\n\n\tconst returnItem: INodeExecutionData = {\n\t\tjson: {},\n\t};\n\tif (files && Object.keys(files).length) {\n\t\treturnItem.binary = {};\n\t}\n\n\tfor (const key of Object.keys(files)) {\n\t\tconst processFiles: MultiPartFormData.File[] = [];\n\t\tlet multiFile = false;\n\t\tconst filesInput = files[key] as MultiPartFormData.File[] | MultiPartFormData.File;\n\n\t\tif (Array.isArray(filesInput)) {\n\t\t\tbodyData[key] = filesInput.map((file) => ({\n\t\t\t\tfilename: file.originalFilename,\n\t\t\t\tmimetype: file.mimetype,\n\t\t\t\tsize: file.size,\n\t\t\t}));\n\t\t\tprocessFiles.push(...filesInput);\n\t\t\tmultiFile = true;\n\t\t} else {\n\t\t\tbodyData[key] = {\n\t\t\t\tfilename: filesInput.originalFilename,\n\t\t\t\tmimetype: filesInput.mimetype,\n\t\t\t\tsize: filesInput.size,\n\t\t\t};\n\t\t\tprocessFiles.push(filesInput);\n\t\t}\n\n\t\tconst entryIndex = Number(key.replace(/field-/g, ''));\n\t\tconst fieldLabel = isNaN(entryIndex) ? key : formFields[entryIndex].fieldLabel;\n\n\t\tlet fileCount = 0;\n\t\tfor (const file of processFiles) {\n\t\t\tlet binaryPropertyName = fieldLabel.replace(/\\W/g, '_');\n\n\t\t\tif (multiFile) {\n\t\t\t\tbinaryPropertyName += `_${fileCount++}`;\n\t\t\t}\n\n\t\t\treturnItem.binary![binaryPropertyName] = await context.nodeHelpers.copyBinaryFile(\n\t\t\t\tfile.filepath,\n\t\t\t\tfile.originalFilename ?? file.newFilename,\n\t\t\t\tfile.mimetype,\n\t\t\t);\n\t\t}\n\t}\n\n\taddFormResponseDataToReturnItem(returnItem, formFields, bodyData);\n\n\tconst timezone = useWorkflowTimezone ? context.getTimezone() : 'UTC';\n\treturnItem.json.submittedAt = DateTime.now().setZone(timezone).toISO();\n\n\treturnItem.json.formMode = mode;\n\n\tif (\n\t\tcontext.getNode().type === FORM_TRIGGER_NODE_TYPE &&\n\t\tObject.keys(context.getRequestObject().query || {}).length\n\t) {\n\t\treturnItem.json.formQueryParameters = context.getRequestObject().query;\n\t}\n\n\treturn returnItem;\n}\n\nexport function renderForm({\n\tcontext,\n\tres,\n\tformTitle,\n\tformDescription,\n\tformFields,\n\tresponseMode,\n\tmode,\n\tformSubmittedText,\n\tredirectUrl,\n\tappendAttribution,\n\tbuttonLabel,\n\tcustomCss,\n}: {\n\tcontext: IWebhookFunctions;\n\tres: Response;\n\tformTitle: string;\n\tformDescription: string;\n\tformFields: FormFieldsParameter;\n\tresponseMode: string;\n\tmode: 'test' | 'production';\n\tformSubmittedText?: string;\n\tredirectUrl?: string;\n\tappendAttribution?: boolean;\n\tbuttonLabel?: string;\n\tcustomCss?: string;\n}) {\n\tformDescription = (formDescription || '').replace(/\\\\n/g, '\\n').replace(/<br>/g, '\\n');\n\tconst instanceId = context.getInstanceId();\n\n\tconst useResponseData = responseMode === 'responseNode';\n\n\tlet query: IDataObject = {};\n\n\tif (context.getNode().type === FORM_TRIGGER_NODE_TYPE) {\n\t\tquery = context.getRequestObject().query as IDataObject;\n\t} else if (context.getNode().type === FORM_NODE_TYPE) {\n\t\tconst parentNodes = context.getParentNodes(context.getNode().name);\n\t\tconst trigger = parentNodes.find(\n\t\t\t(node) => node.type === FORM_TRIGGER_NODE_TYPE,\n\t\t) as NodeTypeAndVersion;\n\t\ttry {\n\t\t\tconst triggerQueryParameters = context.evaluateExpression(\n\t\t\t\t`{{ $('${trigger?.name}').first().json.formQueryParameters }}`,\n\t\t\t) as IDataObject;\n\n\t\t\tif (triggerQueryParameters) {\n\t\t\t\tquery = triggerQueryParameters;\n\t\t\t}\n\t\t} catch (error) {}\n\t}\n\n\tformFields = prepareFormFields(context, formFields);\n\n\tconst data = prepareFormData({\n\t\tformTitle,\n\t\tformDescription,\n\t\tformSubmittedText,\n\t\tredirectUrl,\n\t\tformFields,\n\t\ttestRun: mode === 'test',\n\t\tquery,\n\t\tinstanceId,\n\t\tuseResponseData,\n\t\tappendAttribution,\n\t\tbuttonLabel,\n\t\tcustomCss,\n\t});\n\n\tres.render('form-trigger', data);\n}\n\nexport const isFormConnected = (nodes: NodeTypeAndVersion[]) => {\n\treturn nodes.some(\n\t\t(n) =>\n\t\t\tn.type === FORM_NODE_TYPE || (n.type === WAIT_NODE_TYPE && n.parameters?.resume === 'form'),\n\t);\n};\n\nexport async function formWebhook(\n\tcontext: IWebhookFunctions,\n\tauthProperty = FORM_TRIGGER_AUTHENTICATION_PROPERTY,\n) {\n\tconst node = context.getNode();\n\tconst options = context.getNodeParameter('options', {}) as {\n\t\tignoreBots?: boolean;\n\t\trespondWithOptions?: {\n\t\t\tvalues: {\n\t\t\t\trespondWith: 'text' | 'redirect';\n\t\t\t\tformSubmittedText: string;\n\t\t\t\tredirectUrl: string;\n\t\t\t};\n\t\t};\n\t\tformSubmittedText?: string;\n\t\tuseWorkflowTimezone?: boolean;\n\t\tappendAttribution?: boolean;\n\t\tbuttonLabel?: string;\n\t\tcustomCss?: string;\n\t};\n\tconst res = context.getResponseObject();\n\tconst req = context.getRequestObject();\n\n\ttry {\n\t\tif (options.ignoreBots && isbot(req.headers['user-agent'])) {\n\t\t\tthrow new WebhookAuthorizationError(403);\n\t\t}\n\t\tif (node.typeVersion > 1) {\n\t\t\tawait validateWebhookAuthentication(context, authProperty);\n\t\t}\n\t} catch (error) {\n\t\tif (error instanceof WebhookAuthorizationError) {\n\t\t\tres.setHeader('WWW-Authenticate', 'Basic realm=\"Enter credentials\"');\n\t\t\tres.status(401).send();\n\t\t\treturn { noWebhookResponse: true };\n\t\t}\n\t\tthrow error;\n\t}\n\n\tconst mode = context.getMode() === 'manual' ? 'test' : 'production';\n\tconst formFields = context.getNodeParameter('formFields.values', []) as FormFieldsParameter;\n\n\tconst method = context.getRequestObject().method;\n\n\tvalidateResponseModeConfiguration(context);\n\n\t//Show the form on GET request\n\tif (method === 'GET') {\n\t\tconst formTitle = context.getNodeParameter('formTitle', '') as string;\n\t\tconst formDescription = sanitizeHtml(context.getNodeParameter('formDescription', '') as string);\n\t\tlet responseMode = context.getNodeParameter('responseMode', '') as string;\n\n\t\tlet formSubmittedText;\n\t\tlet redirectUrl;\n\t\tlet appendAttribution = true;\n\n\t\tif (options.respondWithOptions) {\n\t\t\tconst values = (options.respondWithOptions as IDataObject).values as IDataObject;\n\t\t\tif (values.respondWith === 'text') {\n\t\t\t\tformSubmittedText = values.formSubmittedText as string;\n\t\t\t}\n\t\t\tif (values.respondWith === 'redirect') {\n\t\t\t\tredirectUrl = values.redirectUrl as string;\n\t\t\t}\n\t\t} else {\n\t\t\tformSubmittedText = options.formSubmittedText as string;\n\t\t}\n\n\t\tif (options.appendAttribution === false) {\n\t\t\tappendAttribution = false;\n\t\t}\n\n\t\tlet buttonLabel = 'Submit';\n\n\t\tif (options.buttonLabel) {\n\t\t\tbuttonLabel = options.buttonLabel;\n\t\t}\n\n\t\tconst connectedNodes = context.getChildNodes(context.getNode().name, {\n\t\t\tincludeNodeParameters: true,\n\t\t});\n\t\tconst hasNextPage = isFormConnected(connectedNodes);\n\n\t\tif (hasNextPage) {\n\t\t\tredirectUrl = undefined;\n\t\t\tresponseMode = 'responseNode';\n\t\t}\n\n\t\trenderForm({\n\t\t\tcontext,\n\t\t\tres,\n\t\t\tformTitle,\n\t\t\tformDescription,\n\t\t\tformFields,\n\t\t\tresponseMode,\n\t\t\tmode,\n\t\t\tformSubmittedText,\n\t\t\tredirectUrl,\n\t\t\tappendAttribution,\n\t\t\tbuttonLabel,\n\t\t\tcustomCss: options.customCss,\n\t\t});\n\n\t\treturn {\n\t\t\tnoWebhookResponse: true,\n\t\t};\n\t}\n\n\tlet { useWorkflowTimezone } = options;\n\n\tif (useWorkflowTimezone === undefined && node.typeVersion > 2) {\n\t\tuseWorkflowTimezone = true;\n\t}\n\n\tconst returnItem = await prepareFormReturnItem(context, formFields, mode, useWorkflowTimezone);\n\n\treturn {\n\t\twebhookResponse: { status: 200 },\n\t\tworkflowData: [[returnItem]],\n\t};\n}\n\nexport function resolveRawData(context: IWebhookFunctions, rawData: string) {\n\tconst resolvables = getResolvables(rawData);\n\tlet returnData: string = rawData;\n\n\tif (returnData.startsWith('=')) {\n\t\treturnData = returnData.replace(/^=+/, '');\n\t} else {\n\t\treturn returnData;\n\t}\n\n\tif (resolvables.length) {\n\t\tfor (const resolvable of resolvables) {\n\t\t\tconst resolvedValue = context.evaluateExpression(`${resolvable}`);\n\n\t\t\tif (typeof resolvedValue === 'object' && resolvedValue !== null) {\n\t\t\t\treturnData = returnData.replace(resolvable, JSON.stringify(resolvedValue));\n\t\t\t} else {\n\t\t\t\treturnData = returnData.replace(resolvable, resolvedValue as string);\n\t\t\t}\n\t\t}\n\t}\n\treturn returnData;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAkB;AAClB,mBAAyB;AASzB,0BAMO;AACP,2BAAqB;AAGrB,wBAAqD;AACrD,uBAA+B;AAC/B,mBAA0C;AAC1C,mBAA8C;AAEvC,SAAS,aAAa,MAAc;AAC1C,aAAO,qBAAAA,SAAS,MAAM;AAAA,IACrB,aAAa;AAAA,MACZ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAC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Ac,aAAa;AACrC,YAAM,gBAAgB,QAAQ,mBAAmB,GAAG,UAAU,EAAE;AAEhE,UAAI,OAAO,kBAAkB,YAAY,kBAAkB,MAAM;AAChE,qBAAa,WAAW,QAAQ,YAAY,KAAK,UAAU,aAAa,CAAC;AAAA,MAC1E,OAAO;AACN,qBAAa,WAAW,QAAQ,YAAY,aAAuB;AAAA,MACpE;AAAA,IACD;AAAA,EACD;AACA,SAAO;AACR;","names":["sanitize","isbot"]}
|
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var DeviceDescription_exports = {};
|
|
20
|
+
__export(DeviceDescription_exports, {
|
|
21
|
+
deviceFields: () => deviceFields,
|
|
22
|
+
deviceOperations: () => deviceOperations
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(DeviceDescription_exports);
|
|
25
|
+
const deviceOperations = [
|
|
26
|
+
{
|
|
27
|
+
displayName: "Operation",
|
|
28
|
+
name: "operation",
|
|
29
|
+
type: "options",
|
|
30
|
+
noDataExpression: true,
|
|
31
|
+
displayOptions: {
|
|
32
|
+
show: {
|
|
33
|
+
resource: ["device"]
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
options: [
|
|
37
|
+
{
|
|
38
|
+
name: "Get",
|
|
39
|
+
value: "get",
|
|
40
|
+
description: "Get a ChromeOS device",
|
|
41
|
+
action: "Get ChromeOS device"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "Get Many",
|
|
45
|
+
value: "getAll",
|
|
46
|
+
description: "Get many ChromeOS devices",
|
|
47
|
+
action: "Get many ChromeOS devices"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "Update",
|
|
51
|
+
value: "update",
|
|
52
|
+
description: "Update a ChromeOS device",
|
|
53
|
+
action: "Update ChromeOS device"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "Change Status",
|
|
57
|
+
value: "changeStatus",
|
|
58
|
+
description: "Change the status of a ChromeOS device",
|
|
59
|
+
action: "Change status of ChromeOS device"
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
default: "get"
|
|
63
|
+
}
|
|
64
|
+
];
|
|
65
|
+
const deviceFields = [
|
|
66
|
+
/* -------------------------------------------------------------------------- */
|
|
67
|
+
/* device */
|
|
68
|
+
/* -------------------------------------------------------------------------- */
|
|
69
|
+
{
|
|
70
|
+
displayName: "Device",
|
|
71
|
+
name: "deviceId",
|
|
72
|
+
type: "resourceLocator",
|
|
73
|
+
required: true,
|
|
74
|
+
displayOptions: {
|
|
75
|
+
show: {
|
|
76
|
+
operation: ["get", "update", "changeStatus"],
|
|
77
|
+
resource: ["device"]
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
default: {
|
|
81
|
+
mode: "list",
|
|
82
|
+
value: ""
|
|
83
|
+
},
|
|
84
|
+
description: "Select the device you want to retrieve",
|
|
85
|
+
modes: [
|
|
86
|
+
{
|
|
87
|
+
displayName: "From List",
|
|
88
|
+
name: "list",
|
|
89
|
+
type: "list",
|
|
90
|
+
typeOptions: {
|
|
91
|
+
searchListMethod: "searchDevices"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
displayName: "By ID",
|
|
96
|
+
name: "deviceId",
|
|
97
|
+
type: "string",
|
|
98
|
+
hint: "Enter the device id",
|
|
99
|
+
placeholder: "e.g. 123e4567-e89b-12d3-a456-426614174000"
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
/* -------------------------------------------------------------------------- */
|
|
104
|
+
/* device:get */
|
|
105
|
+
/* -------------------------------------------------------------------------- */
|
|
106
|
+
/* -------------------------------------------------------------------------- */
|
|
107
|
+
/* device:getAll */
|
|
108
|
+
/* -------------------------------------------------------------------------- */
|
|
109
|
+
{
|
|
110
|
+
displayName: "Return All",
|
|
111
|
+
name: "returnAll",
|
|
112
|
+
type: "boolean",
|
|
113
|
+
default: false,
|
|
114
|
+
description: "Whether to return all results or only up to a given limit",
|
|
115
|
+
displayOptions: {
|
|
116
|
+
show: {
|
|
117
|
+
operation: ["getAll"],
|
|
118
|
+
resource: ["device"]
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
displayName: "Limit",
|
|
124
|
+
name: "limit",
|
|
125
|
+
type: "number",
|
|
126
|
+
displayOptions: {
|
|
127
|
+
show: {
|
|
128
|
+
operation: ["getAll"],
|
|
129
|
+
resource: ["device"],
|
|
130
|
+
returnAll: [false]
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
typeOptions: {
|
|
134
|
+
minValue: 1,
|
|
135
|
+
maxValue: 500
|
|
136
|
+
},
|
|
137
|
+
default: 100,
|
|
138
|
+
description: "Max number of results to return"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
displayName: "Output",
|
|
142
|
+
name: "projection",
|
|
143
|
+
type: "options",
|
|
144
|
+
required: true,
|
|
145
|
+
options: [
|
|
146
|
+
{
|
|
147
|
+
name: "Basic",
|
|
148
|
+
value: "basic",
|
|
149
|
+
description: "Do not include any custom fields for the user"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
name: "Full",
|
|
153
|
+
value: "full",
|
|
154
|
+
description: "Include all fields associated with this user"
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
displayOptions: {
|
|
158
|
+
show: {
|
|
159
|
+
operation: ["get", "getAll"],
|
|
160
|
+
resource: ["device"]
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
default: "basic",
|
|
164
|
+
description: "What subset of fields to fetch for this device"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
displayName: "Include Children",
|
|
168
|
+
name: "includeChildOrgunits",
|
|
169
|
+
type: "boolean",
|
|
170
|
+
default: false,
|
|
171
|
+
description: "Whether to include devices from organizational units below your specified organizational unit",
|
|
172
|
+
displayOptions: {
|
|
173
|
+
show: {
|
|
174
|
+
operation: ["getAll"],
|
|
175
|
+
resource: ["device"]
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
displayName: "Filter",
|
|
181
|
+
name: "filter",
|
|
182
|
+
type: "collection",
|
|
183
|
+
placeholder: "Add Filter",
|
|
184
|
+
default: {},
|
|
185
|
+
displayOptions: {
|
|
186
|
+
show: {
|
|
187
|
+
operation: ["getAll"],
|
|
188
|
+
resource: ["device"]
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
options: [
|
|
192
|
+
{
|
|
193
|
+
displayName: "Organizational Unit Name or ID",
|
|
194
|
+
name: "orgUnitPath",
|
|
195
|
+
type: "options",
|
|
196
|
+
typeOptions: {
|
|
197
|
+
loadOptionsMethod: "getOrgUnits"
|
|
198
|
+
},
|
|
199
|
+
default: [],
|
|
200
|
+
description: 'Specify the organizational unit name or ID. Choose from the list or use an expression. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.'
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
displayName: "Query",
|
|
204
|
+
name: "query",
|
|
205
|
+
type: "string",
|
|
206
|
+
placeholder: "e.g. name:contact* email:contact*",
|
|
207
|
+
default: "",
|
|
208
|
+
description: "Use Google's querying syntax to filter results"
|
|
209
|
+
}
|
|
210
|
+
]
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
displayName: "Sort",
|
|
214
|
+
name: "sort",
|
|
215
|
+
type: "fixedCollection",
|
|
216
|
+
placeholder: "Add Sort Rule",
|
|
217
|
+
default: {},
|
|
218
|
+
displayOptions: {
|
|
219
|
+
show: {
|
|
220
|
+
operation: ["getAll"],
|
|
221
|
+
resource: ["device"]
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
options: [
|
|
225
|
+
{
|
|
226
|
+
name: "sortRules",
|
|
227
|
+
displayName: "Sort Rules",
|
|
228
|
+
values: [
|
|
229
|
+
{
|
|
230
|
+
displayName: "Order By",
|
|
231
|
+
name: "orderBy",
|
|
232
|
+
type: "options",
|
|
233
|
+
options: [
|
|
234
|
+
{
|
|
235
|
+
name: "Annotated Location",
|
|
236
|
+
value: "annotatedLocation"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
name: "Annotated User",
|
|
240
|
+
value: "annotatedUser"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
name: "Last Sync",
|
|
244
|
+
value: "lastSync"
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
name: "Notes",
|
|
248
|
+
value: "notes"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
name: "Serial Number",
|
|
252
|
+
value: "serialNumber"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
name: "Status",
|
|
256
|
+
value: "status"
|
|
257
|
+
}
|
|
258
|
+
],
|
|
259
|
+
default: "",
|
|
260
|
+
description: "Field to sort the results by"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
displayName: "Sort Order",
|
|
264
|
+
name: "sortBy",
|
|
265
|
+
type: "options",
|
|
266
|
+
options: [
|
|
267
|
+
{
|
|
268
|
+
name: "Ascending",
|
|
269
|
+
value: "ascending"
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
name: "Descending",
|
|
273
|
+
value: "descending"
|
|
274
|
+
}
|
|
275
|
+
],
|
|
276
|
+
default: "",
|
|
277
|
+
description: "Sort order direction"
|
|
278
|
+
}
|
|
279
|
+
]
|
|
280
|
+
}
|
|
281
|
+
],
|
|
282
|
+
description: "Define sorting rules for the results"
|
|
283
|
+
},
|
|
284
|
+
/* -------------------------------------------------------------------------- */
|
|
285
|
+
/* device:update */
|
|
286
|
+
/* -------------------------------------------------------------------------- */
|
|
287
|
+
{
|
|
288
|
+
displayName: "Update Fields",
|
|
289
|
+
name: "updateOptions",
|
|
290
|
+
type: "collection",
|
|
291
|
+
placeholder: "Add Option",
|
|
292
|
+
default: {},
|
|
293
|
+
displayOptions: {
|
|
294
|
+
show: {
|
|
295
|
+
operation: ["update"],
|
|
296
|
+
resource: ["device"]
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
options: [
|
|
300
|
+
{
|
|
301
|
+
displayName: "Move to Organizational Unit Name or ID",
|
|
302
|
+
name: "orgUnitPath",
|
|
303
|
+
type: "options",
|
|
304
|
+
typeOptions: {
|
|
305
|
+
loadOptionsMethod: "getOrgUnits"
|
|
306
|
+
},
|
|
307
|
+
default: [],
|
|
308
|
+
description: 'A comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when projection=custom. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.'
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
displayName: "Annotated User",
|
|
312
|
+
name: "annotatedUser",
|
|
313
|
+
type: "string",
|
|
314
|
+
default: "",
|
|
315
|
+
description: "The annotated user of the device",
|
|
316
|
+
placeholder: "e.g. help desk"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
displayName: "Annotated Location",
|
|
320
|
+
name: "annotatedLocation",
|
|
321
|
+
type: "string",
|
|
322
|
+
default: "",
|
|
323
|
+
description: "The annotated location of the device",
|
|
324
|
+
placeholder: "e.g. Mountain View help desk Chromebook"
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
displayName: "Annotated Asset ID",
|
|
328
|
+
name: "annotatedAssetId",
|
|
329
|
+
type: "string",
|
|
330
|
+
default: "",
|
|
331
|
+
description: "The annotated asset ID of a device",
|
|
332
|
+
placeholder: "e.g. 1234567890"
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
displayName: "Notes",
|
|
336
|
+
name: "notes",
|
|
337
|
+
type: "string",
|
|
338
|
+
default: "",
|
|
339
|
+
description: "Add notes to a device",
|
|
340
|
+
placeholder: "e.g. Loaned from support"
|
|
341
|
+
}
|
|
342
|
+
]
|
|
343
|
+
},
|
|
344
|
+
/* -------------------------------------------------------------------------- */
|
|
345
|
+
/* device:changeStatus */
|
|
346
|
+
/* -------------------------------------------------------------------------- */
|
|
347
|
+
{
|
|
348
|
+
displayName: "Status",
|
|
349
|
+
name: "action",
|
|
350
|
+
type: "options",
|
|
351
|
+
required: true,
|
|
352
|
+
options: [
|
|
353
|
+
{
|
|
354
|
+
name: "Enabled",
|
|
355
|
+
value: "reenable",
|
|
356
|
+
description: "Re-enable a disabled chromebook",
|
|
357
|
+
action: "Enable a device"
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
name: "Disabled",
|
|
361
|
+
value: "disable",
|
|
362
|
+
description: "Disable a chromebook",
|
|
363
|
+
action: "Disable a device"
|
|
364
|
+
}
|
|
365
|
+
],
|
|
366
|
+
displayOptions: {
|
|
367
|
+
show: {
|
|
368
|
+
operation: ["changeStatus"],
|
|
369
|
+
resource: ["device"]
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
default: "reenable",
|
|
373
|
+
description: "Set the status of a device"
|
|
374
|
+
}
|
|
375
|
+
];
|
|
376
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
377
|
+
0 && (module.exports = {
|
|
378
|
+
deviceFields,
|
|
379
|
+
deviceOperations
|
|
380
|
+
});
|
|
381
|
+
//# sourceMappingURL=DeviceDescription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../nodes/Google/GSuiteAdmin/DeviceDescription.ts"],"sourcesContent":["import type { INodeProperties } from 'n8n-workflow';\n\nexport const deviceOperations: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Operation',\n\t\tname: 'operation',\n\t\ttype: 'options',\n\t\tnoDataExpression: true,\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tresource: ['device'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'Get',\n\t\t\t\tvalue: 'get',\n\t\t\t\tdescription: 'Get a ChromeOS device',\n\t\t\t\taction: 'Get ChromeOS device',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Get Many',\n\t\t\t\tvalue: 'getAll',\n\t\t\t\tdescription: 'Get many ChromeOS devices',\n\t\t\t\taction: 'Get many ChromeOS devices',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Update',\n\t\t\t\tvalue: 'update',\n\t\t\t\tdescription: 'Update a ChromeOS device',\n\t\t\t\taction: 'Update ChromeOS device',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Change Status',\n\t\t\t\tvalue: 'changeStatus',\n\t\t\t\tdescription: 'Change the status of a ChromeOS device',\n\t\t\t\taction: 'Change status of ChromeOS device',\n\t\t\t},\n\t\t],\n\t\tdefault: 'get',\n\t},\n];\n\nexport const deviceFields: INodeProperties[] = [\n\t/* -------------------------------------------------------------------------- */\n\t/* device */\n\t/* -------------------------------------------------------------------------- */\n\t{\n\t\tdisplayName: 'Device',\n\t\tname: 'deviceId',\n\t\ttype: 'resourceLocator',\n\t\trequired: true,\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toperation: ['get', 'update', 'changeStatus'],\n\t\t\t\tresource: ['device'],\n\t\t\t},\n\t\t},\n\t\tdefault: {\n\t\t\tmode: 'list',\n\t\t\tvalue: '',\n\t\t},\n\t\tdescription: 'Select the device you want to retrieve',\n\t\tmodes: [\n\t\t\t{\n\t\t\t\tdisplayName: 'From List',\n\t\t\t\tname: 'list',\n\t\t\t\ttype: 'list',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tsearchListMethod: 'searchDevices',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'By ID',\n\t\t\t\tname: 'deviceId',\n\t\t\t\ttype: 'string',\n\t\t\t\thint: 'Enter the device id',\n\t\t\t\tplaceholder: 'e.g. 123e4567-e89b-12d3-a456-426614174000',\n\t\t\t},\n\t\t],\n\t},\n\n\t/* -------------------------------------------------------------------------- */\n\t/* device:get */\n\t/* -------------------------------------------------------------------------- */\n\n\t/* -------------------------------------------------------------------------- */\n\t/* device:getAll */\n\t/* -------------------------------------------------------------------------- */\n\t{\n\t\tdisplayName: 'Return All',\n\t\tname: 'returnAll',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdescription: 'Whether to return all results or only up to a given limit',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toperation: ['getAll'],\n\t\t\t\tresource: ['device'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Limit',\n\t\tname: 'limit',\n\t\ttype: 'number',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toperation: ['getAll'],\n\t\t\t\tresource: ['device'],\n\t\t\t\treturnAll: [false],\n\t\t\t},\n\t\t},\n\t\ttypeOptions: {\n\t\t\tminValue: 1,\n\t\t\tmaxValue: 500,\n\t\t},\n\t\tdefault: 100,\n\t\tdescription: 'Max number of results to return',\n\t},\n\t{\n\t\tdisplayName: 'Output',\n\t\tname: 'projection',\n\t\ttype: 'options',\n\t\trequired: true,\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'Basic',\n\t\t\t\tvalue: 'basic',\n\t\t\t\tdescription: 'Do not include any custom fields for the user',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Full',\n\t\t\t\tvalue: 'full',\n\t\t\t\tdescription: 'Include all fields associated with this user',\n\t\t\t},\n\t\t],\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toperation: ['get', 'getAll'],\n\t\t\t\tresource: ['device'],\n\t\t\t},\n\t\t},\n\t\tdefault: 'basic',\n\t\tdescription: 'What subset of fields to fetch for this device',\n\t},\n\t{\n\t\tdisplayName: 'Include Children',\n\t\tname: 'includeChildOrgunits',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdescription:\n\t\t\t'Whether to include devices from organizational units below your specified organizational unit',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toperation: ['getAll'],\n\t\t\t\tresource: ['device'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Filter',\n\t\tname: 'filter',\n\t\ttype: 'collection',\n\t\tplaceholder: 'Add Filter',\n\t\tdefault: {},\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toperation: ['getAll'],\n\t\t\t\tresource: ['device'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Organizational Unit Name or ID',\n\t\t\t\tname: 'orgUnitPath',\n\t\t\t\ttype: 'options',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tloadOptionsMethod: 'getOrgUnits',\n\t\t\t\t},\n\t\t\t\tdefault: [],\n\t\t\t\tdescription:\n\t\t\t\t\t'Specify the organizational unit name or ID. Choose from the list or use an expression. Choose from the list, or specify an ID using an <a href=\"https://docs.n8n.io/code/expressions/\">expression</a>.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Query',\n\t\t\t\tname: 'query',\n\t\t\t\ttype: 'string',\n\t\t\t\tplaceholder: 'e.g. name:contact* email:contact*',\n\t\t\t\tdefault: '',\n\t\t\t\tdescription: \"Use Google's querying syntax to filter results\",\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tdisplayName: 'Sort',\n\t\tname: 'sort',\n\t\ttype: 'fixedCollection',\n\t\tplaceholder: 'Add Sort Rule',\n\t\tdefault: {},\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toperation: ['getAll'],\n\t\t\t\tresource: ['device'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'sortRules',\n\t\t\t\tdisplayName: 'Sort Rules',\n\t\t\t\tvalues: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Order By',\n\t\t\t\t\t\tname: 'orderBy',\n\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Annotated Location',\n\t\t\t\t\t\t\t\tvalue: 'annotatedLocation',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Annotated User',\n\t\t\t\t\t\t\t\tvalue: 'annotatedUser',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Last Sync',\n\t\t\t\t\t\t\t\tvalue: 'lastSync',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Notes',\n\t\t\t\t\t\t\t\tvalue: 'notes',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Serial Number',\n\t\t\t\t\t\t\t\tvalue: 'serialNumber',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Status',\n\t\t\t\t\t\t\t\tvalue: 'status',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\tdescription: 'Field to sort the results by',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Sort Order',\n\t\t\t\t\t\tname: 'sortBy',\n\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Ascending',\n\t\t\t\t\t\t\t\tvalue: 'ascending',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Descending',\n\t\t\t\t\t\t\t\tvalue: 'descending',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\tdescription: 'Sort order direction',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t\tdescription: 'Define sorting rules for the results',\n\t},\n\n\t/* -------------------------------------------------------------------------- */\n\t/* device:update */\n\t/* -------------------------------------------------------------------------- */\n\t{\n\t\tdisplayName: 'Update Fields',\n\t\tname: 'updateOptions',\n\t\ttype: 'collection',\n\t\tplaceholder: 'Add Option',\n\t\tdefault: {},\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toperation: ['update'],\n\t\t\t\tresource: ['device'],\n\t\t\t},\n\t\t},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Move to Organizational Unit Name or ID',\n\t\t\t\tname: 'orgUnitPath',\n\t\t\t\ttype: 'options',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tloadOptionsMethod: 'getOrgUnits',\n\t\t\t\t},\n\t\t\t\tdefault: [],\n\t\t\t\tdescription:\n\t\t\t\t\t'A comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when projection=custom. Choose from the list, or specify IDs using an <a href=\"https://docs.n8n.io/code-examples/expressions/\">expression</a>. Choose from the list, or specify an ID using an <a href=\"https://docs.n8n.io/code-examples/expressions/\">expression</a>. Choose from the list, or specify an ID using an <a href=\"https://docs.n8n.io/code/expressions/\">expression</a>.',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Annotated User',\n\t\t\t\tname: 'annotatedUser',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tdescription: 'The annotated user of the device',\n\t\t\t\tplaceholder: 'e.g. help desk',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Annotated Location',\n\t\t\t\tname: 'annotatedLocation',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tdescription: 'The annotated location of the device',\n\t\t\t\tplaceholder: 'e.g. Mountain View help desk Chromebook',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Annotated Asset ID',\n\t\t\t\tname: 'annotatedAssetId',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tdescription: 'The annotated asset ID of a device',\n\t\t\t\tplaceholder: 'e.g. 1234567890',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Notes',\n\t\t\t\tname: 'notes',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '',\n\t\t\t\tdescription: 'Add notes to a device',\n\t\t\t\tplaceholder: 'e.g. Loaned from support',\n\t\t\t},\n\t\t],\n\t},\n\n\t/* -------------------------------------------------------------------------- */\n\t/* device:changeStatus */\n\t/* -------------------------------------------------------------------------- */\n\t{\n\t\tdisplayName: 'Status',\n\t\tname: 'action',\n\t\ttype: 'options',\n\t\trequired: true,\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'Enabled',\n\t\t\t\tvalue: 'reenable',\n\t\t\t\tdescription: 'Re-enable a disabled chromebook',\n\t\t\t\taction: 'Enable a device',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'Disabled',\n\t\t\t\tvalue: 'disable',\n\t\t\t\tdescription: 'Disable a chromebook',\n\t\t\t\taction: 'Disable a device',\n\t\t\t},\n\t\t],\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\toperation: ['changeStatus'],\n\t\t\t\tresource: ['device'],\n\t\t\t},\n\t\t},\n\t\tdefault: 'reenable',\n\t\tdescription: 'Set the status of a device',\n\t},\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,mBAAsC;AAAA,EAClD;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,UAAU,CAAC,QAAQ;AAAA,MACpB;AAAA,IACD;AAAA,IACA,SAAS;AAAA,MACR;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,QAAQ;AAAA,MACT;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,QAAQ;AAAA,MACT;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,QAAQ;AAAA,MACT;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,QAAQ;AAAA,MACT;AAAA,IACD;AAAA,IACA,SAAS;AAAA,EACV;AACD;AAEO,MAAM,eAAkC;AAAA;AAAA;AAAA;AAAA,EAI9C;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,UAAU;AAAA,IACV,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,WAAW,CAAC,OAAO,UAAU,cAAc;AAAA,QAC3C,UAAU,CAAC,QAAQ;AAAA,MACpB;AAAA,IACD;AAAA,IACA,SAAS;AAAA,MACR,MAAM;AAAA,MACN,OAAO;AAAA,IACR;AAAA,IACA,aAAa;AAAA,IACb,OAAO;AAAA,MACN;AAAA,Q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