n8n-nodes-autotask 0.1.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/LICENSE +21 -0
- package/README.md +241 -0
- package/dist/credentials/AutotaskApi.credentials.d.ts +10 -0
- package/dist/credentials/AutotaskApi.credentials.js +266 -0
- package/dist/credentials/AutotaskApi.credentials.js.map +1 -0
- package/dist/nodes/Autotask/Autotask.node.d.ts +11 -0
- package/dist/nodes/Autotask/Autotask.node.js +121 -0
- package/dist/nodes/Autotask/Autotask.node.js.map +1 -0
- package/dist/nodes/Autotask/autotask.svg +1 -0
- package/dist/nodes/Autotask/constants/api.d.ts +48 -0
- package/dist/nodes/Autotask/constants/api.js +52 -0
- package/dist/nodes/Autotask/constants/api.js.map +1 -0
- package/dist/nodes/Autotask/constants/date.constants.d.ts +20 -0
- package/dist/nodes/Autotask/constants/date.constants.js +35 -0
- package/dist/nodes/Autotask/constants/date.constants.js.map +1 -0
- package/dist/nodes/Autotask/constants/entities.d.ts +3 -0
- package/dist/nodes/Autotask/constants/entities.js +34 -0
- package/dist/nodes/Autotask/constants/entities.js.map +1 -0
- package/dist/nodes/Autotask/constants/error.constants.d.ts +60 -0
- package/dist/nodes/Autotask/constants/error.constants.js +64 -0
- package/dist/nodes/Autotask/constants/error.constants.js.map +1 -0
- package/dist/nodes/Autotask/constants/field.constants.d.ts +51 -0
- package/dist/nodes/Autotask/constants/field.constants.js +85 -0
- package/dist/nodes/Autotask/constants/field.constants.js.map +1 -0
- package/dist/nodes/Autotask/constants/filters.d.ts +4 -0
- package/dist/nodes/Autotask/constants/filters.js +20 -0
- package/dist/nodes/Autotask/constants/filters.js.map +1 -0
- package/dist/nodes/Autotask/constants/index.d.ts +6 -0
- package/dist/nodes/Autotask/constants/index.js +29 -0
- package/dist/nodes/Autotask/constants/index.js.map +1 -0
- package/dist/nodes/Autotask/constants/operations.d.ts +25 -0
- package/dist/nodes/Autotask/constants/operations.js +29 -0
- package/dist/nodes/Autotask/constants/operations.js.map +1 -0
- package/dist/nodes/Autotask/constants/ui.constants.d.ts +58 -0
- package/dist/nodes/Autotask/constants/ui.constants.js +79 -0
- package/dist/nodes/Autotask/constants/ui.constants.js.map +1 -0
- package/dist/nodes/Autotask/constants/ui.d.ts +117 -0
- package/dist/nodes/Autotask/constants/ui.js +68 -0
- package/dist/nodes/Autotask/constants/ui.js.map +1 -0
- package/dist/nodes/Autotask/helpers/cache/index.d.ts +2 -0
- package/dist/nodes/Autotask/helpers/cache/index.js +6 -0
- package/dist/nodes/Autotask/helpers/cache/index.js.map +1 -0
- package/dist/nodes/Autotask/helpers/cache/init.d.ts +3 -0
- package/dist/nodes/Autotask/helpers/cache/init.js +32 -0
- package/dist/nodes/Autotask/helpers/cache/init.js.map +1 -0
- package/dist/nodes/Autotask/helpers/cache/service.d.ts +45 -0
- package/dist/nodes/Autotask/helpers/cache/service.js +138 -0
- package/dist/nodes/Autotask/helpers/cache/service.js.map +1 -0
- package/dist/nodes/Autotask/helpers/date-time/errors.d.ts +12 -0
- package/dist/nodes/Autotask/helpers/date-time/errors.js +25 -0
- package/dist/nodes/Autotask/helpers/date-time/errors.js.map +1 -0
- package/dist/nodes/Autotask/helpers/date-time/index.d.ts +3 -0
- package/dist/nodes/Autotask/helpers/date-time/index.js +20 -0
- package/dist/nodes/Autotask/helpers/date-time/index.js.map +1 -0
- package/dist/nodes/Autotask/helpers/date-time/utils.d.ts +8 -0
- package/dist/nodes/Autotask/helpers/date-time/utils.js +146 -0
- package/dist/nodes/Autotask/helpers/date-time/utils.js.map +1 -0
- package/dist/nodes/Autotask/helpers/date-time/wrapper.d.ts +18 -0
- package/dist/nodes/Autotask/helpers/date-time/wrapper.js +68 -0
- package/dist/nodes/Autotask/helpers/date-time/wrapper.js.map +1 -0
- package/dist/nodes/Autotask/helpers/entity/api.d.ts +12 -0
- package/dist/nodes/Autotask/helpers/entity/api.js +165 -0
- package/dist/nodes/Autotask/helpers/entity/api.js.map +1 -0
- package/dist/nodes/Autotask/helpers/entity/core.d.ts +24 -0
- package/dist/nodes/Autotask/helpers/entity/core.js +34 -0
- package/dist/nodes/Autotask/helpers/entity/core.js.map +1 -0
- package/dist/nodes/Autotask/helpers/entity/index.d.ts +3 -0
- package/dist/nodes/Autotask/helpers/entity/index.js +11 -0
- package/dist/nodes/Autotask/helpers/entity/index.js.map +1 -0
- package/dist/nodes/Autotask/helpers/entity/picklist.d.ts +10 -0
- package/dist/nodes/Autotask/helpers/entity/picklist.js +23 -0
- package/dist/nodes/Autotask/helpers/entity/picklist.js.map +1 -0
- package/dist/nodes/Autotask/helpers/entity/utils.d.ts +2 -0
- package/dist/nodes/Autotask/helpers/entity/utils.js +21 -0
- package/dist/nodes/Autotask/helpers/entity/utils.js.map +1 -0
- package/dist/nodes/Autotask/helpers/entity-values/field-mapping.d.ts +19 -0
- package/dist/nodes/Autotask/helpers/entity-values/field-mapping.js +49 -0
- package/dist/nodes/Autotask/helpers/entity-values/field-mapping.js.map +1 -0
- package/dist/nodes/Autotask/helpers/entity-values/helpers.d.ts +6 -0
- package/dist/nodes/Autotask/helpers/entity-values/helpers.js +24 -0
- package/dist/nodes/Autotask/helpers/entity-values/helpers.js.map +1 -0
- package/dist/nodes/Autotask/helpers/entity-values/index.d.ts +24 -0
- package/dist/nodes/Autotask/helpers/entity-values/index.js +9 -0
- package/dist/nodes/Autotask/helpers/entity-values/index.js.map +1 -0
- package/dist/nodes/Autotask/helpers/entity-values/transformers.d.ts +10 -0
- package/dist/nodes/Autotask/helpers/entity-values/transformers.js +88 -0
- package/dist/nodes/Autotask/helpers/entity-values/transformers.js.map +1 -0
- package/dist/nodes/Autotask/helpers/entity-values/value-helper.d.ts +49 -0
- package/dist/nodes/Autotask/helpers/entity-values/value-helper.js +234 -0
- package/dist/nodes/Autotask/helpers/entity-values/value-helper.js.map +1 -0
- package/dist/nodes/Autotask/helpers/errorHandler.d.ts +21 -0
- package/dist/nodes/Autotask/helpers/errorHandler.js +152 -0
- package/dist/nodes/Autotask/helpers/errorHandler.js.map +1 -0
- package/dist/nodes/Autotask/helpers/field-conversion/index.d.ts +3 -0
- package/dist/nodes/Autotask/helpers/field-conversion/index.js +20 -0
- package/dist/nodes/Autotask/helpers/field-conversion/index.js.map +1 -0
- package/dist/nodes/Autotask/helpers/field-conversion/pipeline.d.ts +12 -0
- package/dist/nodes/Autotask/helpers/field-conversion/pipeline.js +59 -0
- package/dist/nodes/Autotask/helpers/field-conversion/pipeline.js.map +1 -0
- package/dist/nodes/Autotask/helpers/field-conversion/services/field-type.service.d.ts +16 -0
- package/dist/nodes/Autotask/helpers/field-conversion/services/field-type.service.js +77 -0
- package/dist/nodes/Autotask/helpers/field-conversion/services/field-type.service.js.map +1 -0
- package/dist/nodes/Autotask/helpers/field-conversion/steps.d.ts +2 -0
- package/dist/nodes/Autotask/helpers/field-conversion/steps.js +117 -0
- package/dist/nodes/Autotask/helpers/field-conversion/steps.js.map +1 -0
- package/dist/nodes/Autotask/helpers/field-conversion/types.d.ts +18 -0
- package/dist/nodes/Autotask/helpers/field-conversion/types.js +3 -0
- package/dist/nodes/Autotask/helpers/field-conversion/types.js.map +1 -0
- package/dist/nodes/Autotask/helpers/field-conversion/utils.d.ts +19 -0
- package/dist/nodes/Autotask/helpers/field-conversion/utils.js +131 -0
- package/dist/nodes/Autotask/helpers/field-conversion/utils.js.map +1 -0
- package/dist/nodes/Autotask/helpers/filter.d.ts +10 -0
- package/dist/nodes/Autotask/helpers/filter.js +51 -0
- package/dist/nodes/Autotask/helpers/filter.js.map +1 -0
- package/dist/nodes/Autotask/helpers/http/body-builder.d.ts +19 -0
- package/dist/nodes/Autotask/helpers/http/body-builder.js +61 -0
- package/dist/nodes/Autotask/helpers/http/body-builder.js.map +1 -0
- package/dist/nodes/Autotask/helpers/http/headers.d.ts +2 -0
- package/dist/nodes/Autotask/helpers/http/headers.js +16 -0
- package/dist/nodes/Autotask/helpers/http/headers.js.map +1 -0
- package/dist/nodes/Autotask/helpers/http/index.d.ts +2 -0
- package/dist/nodes/Autotask/helpers/http/index.js +19 -0
- package/dist/nodes/Autotask/helpers/http/index.js.map +1 -0
- package/dist/nodes/Autotask/helpers/http/request.d.ts +21 -0
- package/dist/nodes/Autotask/helpers/http/request.js +233 -0
- package/dist/nodes/Autotask/helpers/http/request.js.map +1 -0
- package/dist/nodes/Autotask/helpers/index.d.ts +8 -0
- package/dist/nodes/Autotask/helpers/index.js +25 -0
- package/dist/nodes/Autotask/helpers/index.js.map +1 -0
- package/dist/nodes/Autotask/helpers/options/entityOptions.d.ts +5 -0
- package/dist/nodes/Autotask/helpers/options/entityOptions.js +58 -0
- package/dist/nodes/Autotask/helpers/options/entityOptions.js.map +1 -0
- package/dist/nodes/Autotask/helpers/options/index.d.ts +5 -0
- package/dist/nodes/Autotask/helpers/options/index.js +8 -0
- package/dist/nodes/Autotask/helpers/options/index.js.map +1 -0
- package/dist/nodes/Autotask/helpers/options/utils.d.ts +9 -0
- package/dist/nodes/Autotask/helpers/options/utils.js +48 -0
- package/dist/nodes/Autotask/helpers/options/utils.js.map +1 -0
- package/dist/nodes/Autotask/helpers/pagination.d.ts +26 -0
- package/dist/nodes/Autotask/helpers/pagination.js +58 -0
- package/dist/nodes/Autotask/helpers/pagination.js.map +1 -0
- package/dist/nodes/Autotask/helpers/parameter.d.ts +4 -0
- package/dist/nodes/Autotask/helpers/parameter.js +35 -0
- package/dist/nodes/Autotask/helpers/parameter.js.map +1 -0
- package/dist/nodes/Autotask/helpers/resource-operations.helper.d.ts +16 -0
- package/dist/nodes/Autotask/helpers/resource-operations.helper.js +59 -0
- package/dist/nodes/Autotask/helpers/resource-operations.helper.js.map +1 -0
- package/dist/nodes/Autotask/helpers/resourceMapper.d.ts +2 -0
- package/dist/nodes/Autotask/helpers/resourceMapper.js +42 -0
- package/dist/nodes/Autotask/helpers/resourceMapper.js.map +1 -0
- package/dist/nodes/Autotask/helpers/searchFilterBuilder.d.ts +17 -0
- package/dist/nodes/Autotask/helpers/searchFilterBuilder.js +98 -0
- package/dist/nodes/Autotask/helpers/searchFilterBuilder.js.map +1 -0
- package/dist/nodes/Autotask/operations/base/base-operation.d.ts +43 -0
- package/dist/nodes/Autotask/operations/base/base-operation.js +333 -0
- package/dist/nodes/Autotask/operations/base/base-operation.js.map +1 -0
- package/dist/nodes/Autotask/operations/base/count-operation.d.ts +7 -0
- package/dist/nodes/Autotask/operations/base/count-operation.js +51 -0
- package/dist/nodes/Autotask/operations/base/count-operation.js.map +1 -0
- package/dist/nodes/Autotask/operations/base/create-operation.d.ts +8 -0
- package/dist/nodes/Autotask/operations/base/create-operation.js +71 -0
- package/dist/nodes/Autotask/operations/base/create-operation.js.map +1 -0
- package/dist/nodes/Autotask/operations/base/delete-operation.d.ts +7 -0
- package/dist/nodes/Autotask/operations/base/delete-operation.js +44 -0
- package/dist/nodes/Autotask/operations/base/delete-operation.js.map +1 -0
- package/dist/nodes/Autotask/operations/base/field-processor.d.ts +50 -0
- package/dist/nodes/Autotask/operations/base/field-processor.js +387 -0
- package/dist/nodes/Autotask/operations/base/field-processor.js.map +1 -0
- package/dist/nodes/Autotask/operations/base/field-validator.d.ts +23 -0
- package/dist/nodes/Autotask/operations/base/field-validator.js +210 -0
- package/dist/nodes/Autotask/operations/base/field-validator.js.map +1 -0
- package/dist/nodes/Autotask/operations/base/field-values.d.ts +3 -0
- package/dist/nodes/Autotask/operations/base/field-values.js +79 -0
- package/dist/nodes/Autotask/operations/base/field-values.js.map +1 -0
- package/dist/nodes/Autotask/operations/base/get-many-advanced.operation.d.ts +15 -0
- package/dist/nodes/Autotask/operations/base/get-many-advanced.operation.js +59 -0
- package/dist/nodes/Autotask/operations/base/get-many-advanced.operation.js.map +1 -0
- package/dist/nodes/Autotask/operations/base/get-many.d.ts +23 -0
- package/dist/nodes/Autotask/operations/base/get-many.js +126 -0
- package/dist/nodes/Autotask/operations/base/get-many.js.map +1 -0
- package/dist/nodes/Autotask/operations/base/get-operation.d.ts +7 -0
- package/dist/nodes/Autotask/operations/base/get-operation.js +23 -0
- package/dist/nodes/Autotask/operations/base/get-operation.js.map +1 -0
- package/dist/nodes/Autotask/operations/base/getEntityInfo.operation.d.ts +8 -0
- package/dist/nodes/Autotask/operations/base/getEntityInfo.operation.js +65 -0
- package/dist/nodes/Autotask/operations/base/getEntityInfo.operation.js.map +1 -0
- package/dist/nodes/Autotask/operations/base/getFieldInfo.operation.d.ts +9 -0
- package/dist/nodes/Autotask/operations/base/getFieldInfo.operation.js +81 -0
- package/dist/nodes/Autotask/operations/base/getFieldInfo.operation.js.map +1 -0
- package/dist/nodes/Autotask/operations/base/index.d.ts +12 -0
- package/dist/nodes/Autotask/operations/base/index.js +28 -0
- package/dist/nodes/Autotask/operations/base/index.js.map +1 -0
- package/dist/nodes/Autotask/operations/base/operation-type.d.ts +5 -0
- package/dist/nodes/Autotask/operations/base/operation-type.js +21 -0
- package/dist/nodes/Autotask/operations/base/operation-type.js.map +1 -0
- package/dist/nodes/Autotask/operations/base/types.d.ts +6 -0
- package/dist/nodes/Autotask/operations/base/types.js +18 -0
- package/dist/nodes/Autotask/operations/base/types.js.map +1 -0
- package/dist/nodes/Autotask/operations/base/update-operation.d.ts +8 -0
- package/dist/nodes/Autotask/operations/base/update-operation.js +74 -0
- package/dist/nodes/Autotask/operations/base/update-operation.js.map +1 -0
- package/dist/nodes/Autotask/operations/common/entityInfo.description.d.ts +8 -0
- package/dist/nodes/Autotask/operations/common/entityInfo.description.js +38 -0
- package/dist/nodes/Autotask/operations/common/entityInfo.description.js.map +1 -0
- package/dist/nodes/Autotask/operations/common/entityInfo.execute.d.ts +2 -0
- package/dist/nodes/Autotask/operations/common/entityInfo.execute.js +20 -0
- package/dist/nodes/Autotask/operations/common/entityInfo.execute.js.map +1 -0
- package/dist/nodes/Autotask/operations/common/get-many-advanced/description.d.ts +2 -0
- package/dist/nodes/Autotask/operations/common/get-many-advanced/description.js +23 -0
- package/dist/nodes/Autotask/operations/common/get-many-advanced/description.js.map +1 -0
- package/dist/nodes/Autotask/operations/common/get-many-advanced/execute.d.ts +15 -0
- package/dist/nodes/Autotask/operations/common/get-many-advanced/execute.js +14 -0
- package/dist/nodes/Autotask/operations/common/get-many-advanced/execute.js.map +1 -0
- package/dist/nodes/Autotask/operations/common/get-many-advanced/index.d.ts +2 -0
- package/dist/nodes/Autotask/operations/common/get-many-advanced/index.js +19 -0
- package/dist/nodes/Autotask/operations/common/get-many-advanced/index.js.map +1 -0
- package/dist/nodes/Autotask/resources/companies/description.d.ts +2 -0
- package/dist/nodes/Autotask/resources/companies/description.js +101 -0
- package/dist/nodes/Autotask/resources/companies/description.js.map +1 -0
- package/dist/nodes/Autotask/resources/companies/execute.d.ts +2 -0
- package/dist/nodes/Autotask/resources/companies/execute.js +77 -0
- package/dist/nodes/Autotask/resources/companies/execute.js.map +1 -0
- package/dist/nodes/Autotask/resources/companies/index.d.ts +2 -0
- package/dist/nodes/Autotask/resources/companies/index.js +19 -0
- package/dist/nodes/Autotask/resources/companies/index.js.map +1 -0
- package/dist/nodes/Autotask/resources/companyNotes/description.d.ts +2 -0
- package/dist/nodes/Autotask/resources/companyNotes/description.js +96 -0
- package/dist/nodes/Autotask/resources/companyNotes/description.js.map +1 -0
- package/dist/nodes/Autotask/resources/companyNotes/execute.d.ts +2 -0
- package/dist/nodes/Autotask/resources/companyNotes/execute.js +77 -0
- package/dist/nodes/Autotask/resources/companyNotes/execute.js.map +1 -0
- package/dist/nodes/Autotask/resources/companyNotes/index.d.ts +2 -0
- package/dist/nodes/Autotask/resources/companyNotes/index.js +19 -0
- package/dist/nodes/Autotask/resources/companyNotes/index.js.map +1 -0
- package/dist/nodes/Autotask/resources/contacts/description.d.ts +2 -0
- package/dist/nodes/Autotask/resources/contacts/description.js +100 -0
- package/dist/nodes/Autotask/resources/contacts/description.js.map +1 -0
- package/dist/nodes/Autotask/resources/contacts/execute.d.ts +2 -0
- package/dist/nodes/Autotask/resources/contacts/execute.js +83 -0
- package/dist/nodes/Autotask/resources/contacts/execute.js.map +1 -0
- package/dist/nodes/Autotask/resources/contacts/index.d.ts +2 -0
- package/dist/nodes/Autotask/resources/contacts/index.js +19 -0
- package/dist/nodes/Autotask/resources/contacts/index.js.map +1 -0
- package/dist/nodes/Autotask/resources/definitions.d.ts +3 -0
- package/dist/nodes/Autotask/resources/definitions.js +79 -0
- package/dist/nodes/Autotask/resources/definitions.js.map +1 -0
- package/dist/nodes/Autotask/resources/products/description.d.ts +2 -0
- package/dist/nodes/Autotask/resources/products/description.js +96 -0
- package/dist/nodes/Autotask/resources/products/description.js.map +1 -0
- package/dist/nodes/Autotask/resources/products/execute.d.ts +2 -0
- package/dist/nodes/Autotask/resources/products/execute.js +77 -0
- package/dist/nodes/Autotask/resources/products/execute.js.map +1 -0
- package/dist/nodes/Autotask/resources/products/index.d.ts +2 -0
- package/dist/nodes/Autotask/resources/products/index.js +8 -0
- package/dist/nodes/Autotask/resources/products/index.js.map +1 -0
- package/dist/nodes/Autotask/resources/projectCharges/description.d.ts +2 -0
- package/dist/nodes/Autotask/resources/projectCharges/description.js +102 -0
- package/dist/nodes/Autotask/resources/projectCharges/description.js.map +1 -0
- package/dist/nodes/Autotask/resources/projectCharges/execute.d.ts +2 -0
- package/dist/nodes/Autotask/resources/projectCharges/execute.js +83 -0
- package/dist/nodes/Autotask/resources/projectCharges/execute.js.map +1 -0
- package/dist/nodes/Autotask/resources/projectCharges/index.d.ts +2 -0
- package/dist/nodes/Autotask/resources/projectCharges/index.js +19 -0
- package/dist/nodes/Autotask/resources/projectCharges/index.js.map +1 -0
- package/dist/nodes/Autotask/resources/projectNotes/description.d.ts +2 -0
- package/dist/nodes/Autotask/resources/projectNotes/description.js +96 -0
- package/dist/nodes/Autotask/resources/projectNotes/description.js.map +1 -0
- package/dist/nodes/Autotask/resources/projectNotes/execute.d.ts +2 -0
- package/dist/nodes/Autotask/resources/projectNotes/execute.js +77 -0
- package/dist/nodes/Autotask/resources/projectNotes/execute.js.map +1 -0
- package/dist/nodes/Autotask/resources/projectNotes/index.d.ts +2 -0
- package/dist/nodes/Autotask/resources/projectNotes/index.js +19 -0
- package/dist/nodes/Autotask/resources/projectNotes/index.js.map +1 -0
- package/dist/nodes/Autotask/resources/projectPhases/description.d.ts +2 -0
- package/dist/nodes/Autotask/resources/projectPhases/description.js +110 -0
- package/dist/nodes/Autotask/resources/projectPhases/description.js.map +1 -0
- package/dist/nodes/Autotask/resources/projectPhases/execute.d.ts +2 -0
- package/dist/nodes/Autotask/resources/projectPhases/execute.js +93 -0
- package/dist/nodes/Autotask/resources/projectPhases/execute.js.map +1 -0
- package/dist/nodes/Autotask/resources/projectPhases/index.d.ts +2 -0
- package/dist/nodes/Autotask/resources/projectPhases/index.js +8 -0
- package/dist/nodes/Autotask/resources/projectPhases/index.js.map +1 -0
- package/dist/nodes/Autotask/resources/projectTasks/description.d.ts +2 -0
- package/dist/nodes/Autotask/resources/projectTasks/description.js +110 -0
- package/dist/nodes/Autotask/resources/projectTasks/description.js.map +1 -0
- package/dist/nodes/Autotask/resources/projectTasks/execute.d.ts +2 -0
- package/dist/nodes/Autotask/resources/projectTasks/execute.js +77 -0
- package/dist/nodes/Autotask/resources/projectTasks/execute.js.map +1 -0
- package/dist/nodes/Autotask/resources/projectTasks/index.d.ts +2 -0
- package/dist/nodes/Autotask/resources/projectTasks/index.js +8 -0
- package/dist/nodes/Autotask/resources/projectTasks/index.js.map +1 -0
- package/dist/nodes/Autotask/resources/projects/description.d.ts +2 -0
- package/dist/nodes/Autotask/resources/projects/description.js +96 -0
- package/dist/nodes/Autotask/resources/projects/description.js.map +1 -0
- package/dist/nodes/Autotask/resources/projects/execute.d.ts +2 -0
- package/dist/nodes/Autotask/resources/projects/execute.js +77 -0
- package/dist/nodes/Autotask/resources/projects/execute.js.map +1 -0
- package/dist/nodes/Autotask/resources/projects/index.d.ts +2 -0
- package/dist/nodes/Autotask/resources/projects/index.js +19 -0
- package/dist/nodes/Autotask/resources/projects/index.js.map +1 -0
- package/dist/nodes/Autotask/resources/resources/description.d.ts +2 -0
- package/dist/nodes/Autotask/resources/resources/description.js +89 -0
- package/dist/nodes/Autotask/resources/resources/description.js.map +1 -0
- package/dist/nodes/Autotask/resources/resources/execute.d.ts +2 -0
- package/dist/nodes/Autotask/resources/resources/execute.js +71 -0
- package/dist/nodes/Autotask/resources/resources/execute.js.map +1 -0
- package/dist/nodes/Autotask/resources/resources/index.d.ts +2 -0
- package/dist/nodes/Autotask/resources/resources/index.js +19 -0
- package/dist/nodes/Autotask/resources/resources/index.js.map +1 -0
- package/dist/nodes/Autotask/resources/searchFilter/description.d.ts +3 -0
- package/dist/nodes/Autotask/resources/searchFilter/description.js +136 -0
- package/dist/nodes/Autotask/resources/searchFilter/description.js.map +1 -0
- package/dist/nodes/Autotask/resources/searchFilter/execute.d.ts +2 -0
- package/dist/nodes/Autotask/resources/searchFilter/execute.js +34 -0
- package/dist/nodes/Autotask/resources/searchFilter/execute.js.map +1 -0
- package/dist/nodes/Autotask/resources/searchFilter/index.d.ts +3 -0
- package/dist/nodes/Autotask/resources/searchFilter/index.js +9 -0
- package/dist/nodes/Autotask/resources/searchFilter/index.js.map +1 -0
- package/dist/nodes/Autotask/resources/tickets/description.d.ts +2 -0
- package/dist/nodes/Autotask/resources/tickets/description.js +94 -0
- package/dist/nodes/Autotask/resources/tickets/description.js.map +1 -0
- package/dist/nodes/Autotask/resources/tickets/execute.d.ts +2 -0
- package/dist/nodes/Autotask/resources/tickets/execute.js +77 -0
- package/dist/nodes/Autotask/resources/tickets/execute.js.map +1 -0
- package/dist/nodes/Autotask/resources/tickets/index.d.ts +2 -0
- package/dist/nodes/Autotask/resources/tickets/index.js +8 -0
- package/dist/nodes/Autotask/resources/tickets/index.js.map +1 -0
- package/dist/nodes/Autotask/resources/timeEntries/description.d.ts +2 -0
- package/dist/nodes/Autotask/resources/timeEntries/description.js +115 -0
- package/dist/nodes/Autotask/resources/timeEntries/description.js.map +1 -0
- package/dist/nodes/Autotask/resources/timeEntries/execute.d.ts +2 -0
- package/dist/nodes/Autotask/resources/timeEntries/execute.js +83 -0
- package/dist/nodes/Autotask/resources/timeEntries/execute.js.map +1 -0
- package/dist/nodes/Autotask/resources/timeEntries/index.d.ts +2 -0
- package/dist/nodes/Autotask/resources/timeEntries/index.js +19 -0
- package/dist/nodes/Autotask/resources/timeEntries/index.js.map +1 -0
- package/dist/nodes/Autotask/types/SearchFilter.d.ts +27 -0
- package/dist/nodes/Autotask/types/SearchFilter.js +3 -0
- package/dist/nodes/Autotask/types/SearchFilter.js.map +1 -0
- package/dist/nodes/Autotask/types/base/api.d.ts +44 -0
- package/dist/nodes/Autotask/types/base/api.js +3 -0
- package/dist/nodes/Autotask/types/base/api.js.map +1 -0
- package/dist/nodes/Autotask/types/base/auth.d.ts +19 -0
- package/dist/nodes/Autotask/types/base/auth.js +3 -0
- package/dist/nodes/Autotask/types/base/auth.js.map +1 -0
- package/dist/nodes/Autotask/types/base/common.d.ts +66 -0
- package/dist/nodes/Autotask/types/base/common.js +3 -0
- package/dist/nodes/Autotask/types/base/common.js.map +1 -0
- package/dist/nodes/Autotask/types/base/core-types.d.ts +11 -0
- package/dist/nodes/Autotask/types/base/core-types.js +12 -0
- package/dist/nodes/Autotask/types/base/core-types.js.map +1 -0
- package/dist/nodes/Autotask/types/base/entities.d.ts +67 -0
- package/dist/nodes/Autotask/types/base/entities.js +3 -0
- package/dist/nodes/Autotask/types/base/entities.js.map +1 -0
- package/dist/nodes/Autotask/types/base/entity-types.d.ts +94 -0
- package/dist/nodes/Autotask/types/base/entity-types.js +17 -0
- package/dist/nodes/Autotask/types/base/entity-types.js.map +1 -0
- package/dist/nodes/Autotask/types/base/entity-values.d.ts +9 -0
- package/dist/nodes/Autotask/types/base/entity-values.js +3 -0
- package/dist/nodes/Autotask/types/base/entity-values.js.map +1 -0
- package/dist/nodes/Autotask/types/base/errors.d.ts +4 -0
- package/dist/nodes/Autotask/types/base/errors.js +12 -0
- package/dist/nodes/Autotask/types/base/errors.js.map +1 -0
- package/dist/nodes/Autotask/types/base/field-base.d.ts +82 -0
- package/dist/nodes/Autotask/types/base/field-base.js +67 -0
- package/dist/nodes/Autotask/types/base/field-base.js.map +1 -0
- package/dist/nodes/Autotask/types/base/http.d.ts +34 -0
- package/dist/nodes/Autotask/types/base/http.js +3 -0
- package/dist/nodes/Autotask/types/base/http.js.map +1 -0
- package/dist/nodes/Autotask/types/base/picklists.d.ts +16 -0
- package/dist/nodes/Autotask/types/base/picklists.js +3 -0
- package/dist/nodes/Autotask/types/base/picklists.js.map +1 -0
- package/dist/nodes/Autotask/types/base/udf-types.d.ts +64 -0
- package/dist/nodes/Autotask/types/base/udf-types.js +24 -0
- package/dist/nodes/Autotask/types/base/udf-types.js.map +1 -0
- package/dist/nodes/Autotask/types/index.d.ts +18 -0
- package/dist/nodes/Autotask/types/index.js +6 -0
- package/dist/nodes/Autotask/types/index.js.map +1 -0
- package/dist/package.json +80 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +80 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildEntityUrl = buildEntityUrl;
|
|
4
|
+
exports.buildChildEntityUrl = buildChildEntityUrl;
|
|
5
|
+
exports.autotaskApiRequest = autotaskApiRequest;
|
|
6
|
+
const operations_1 = require("../../constants/operations");
|
|
7
|
+
const headers_1 = require("./headers");
|
|
8
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
9
|
+
const pluralize_1 = require("pluralize");
|
|
10
|
+
const entities_1 = require("../../constants/entities");
|
|
11
|
+
function isQueryEndpoint(endpoint) {
|
|
12
|
+
return endpoint.includes('/query/') || endpoint.endsWith('/query');
|
|
13
|
+
}
|
|
14
|
+
function isModificationOperation(method, endpoint) {
|
|
15
|
+
if (isQueryEndpoint(endpoint)) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
const isModification = ['POST', 'PUT', 'PATCH', 'DELETE'].includes(method.toUpperCase());
|
|
19
|
+
return isModification;
|
|
20
|
+
}
|
|
21
|
+
function getErrorMessage(error) {
|
|
22
|
+
var _a, _b, _c, _d, _e;
|
|
23
|
+
if (((_a = error.response) === null || _a === void 0 ? void 0 : _a.status) === 401) {
|
|
24
|
+
return 'Authentication failed: Invalid credentials';
|
|
25
|
+
}
|
|
26
|
+
if (((_b = error.response) === null || _b === void 0 ? void 0 : _b.status) === 404) {
|
|
27
|
+
return 'Resource not found';
|
|
28
|
+
}
|
|
29
|
+
const errorData = (_c = error.response) === null || _c === void 0 ? void 0 : _c.data;
|
|
30
|
+
if ((_d = errorData === null || errorData === void 0 ? void 0 : errorData.errors) === null || _d === void 0 ? void 0 : _d.length) {
|
|
31
|
+
return JSON.stringify(errorData);
|
|
32
|
+
}
|
|
33
|
+
if (((_e = error.response) === null || _e === void 0 ? void 0 : _e.status) && error.response.status !== 200) {
|
|
34
|
+
return `Operation failed with status ${error.response.status}`;
|
|
35
|
+
}
|
|
36
|
+
return error.message || 'Unknown error occurred';
|
|
37
|
+
}
|
|
38
|
+
function processEndpointPath(endpoint, options = {}) {
|
|
39
|
+
if (endpoint.startsWith('http')) {
|
|
40
|
+
return endpoint;
|
|
41
|
+
}
|
|
42
|
+
const parts = endpoint.replace(/^\/+/, '').split('/');
|
|
43
|
+
const processedParts = parts.map((part, index) => {
|
|
44
|
+
if (part.match(/^\d+$/)) {
|
|
45
|
+
return part;
|
|
46
|
+
}
|
|
47
|
+
const singularPart = (0, pluralize_1.singular)(part);
|
|
48
|
+
const metadata = (0, entities_1.getEntityMetadata)(singularPart);
|
|
49
|
+
if (metadata) {
|
|
50
|
+
return (0, pluralize_1.plural)(singularPart);
|
|
51
|
+
}
|
|
52
|
+
return part;
|
|
53
|
+
});
|
|
54
|
+
if (options.isQuery && !processedParts.includes('query')) {
|
|
55
|
+
processedParts.push('query');
|
|
56
|
+
}
|
|
57
|
+
if (options.isCount && !processedParts.includes('count')) {
|
|
58
|
+
processedParts.push('count');
|
|
59
|
+
}
|
|
60
|
+
else if (options.isUdf && !processedParts.includes('entityInformation')) {
|
|
61
|
+
processedParts.push('entityInformation', 'userDefinedFields');
|
|
62
|
+
}
|
|
63
|
+
else if (options.isAttachment && options.entityId) {
|
|
64
|
+
processedParts.push('data');
|
|
65
|
+
}
|
|
66
|
+
return `${processedParts.join('/')}/`;
|
|
67
|
+
}
|
|
68
|
+
function validateParentChain(chain) {
|
|
69
|
+
if (!(chain === null || chain === void 0 ? void 0 : chain.length)) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
for (const link of chain) {
|
|
73
|
+
if (!link.type || (typeof link.id !== 'string' && typeof link.id !== 'number')) {
|
|
74
|
+
throw new Error('Invalid parent chain structure. Each chain link must have a type and id.');
|
|
75
|
+
}
|
|
76
|
+
const metadata = (0, entities_1.getEntityMetadata)(link.type);
|
|
77
|
+
if (!metadata) {
|
|
78
|
+
throw new Error(`Invalid parent type in chain: ${link.type}. Entity type not found in metadata.`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function buildEntityUrl(entity, options = {}) {
|
|
83
|
+
var _a;
|
|
84
|
+
const metadata = (0, entities_1.getEntityMetadata)(entity);
|
|
85
|
+
if (!metadata) {
|
|
86
|
+
throw new Error(`Invalid entity type: ${entity}. Entity type not found in metadata.`);
|
|
87
|
+
}
|
|
88
|
+
validateParentChain(options.parentChain);
|
|
89
|
+
if (metadata.isAttachment && options.entityId) {
|
|
90
|
+
return processEndpointPath(`${entity}/${options.entityId}`, { ...options, isAttachment: true });
|
|
91
|
+
}
|
|
92
|
+
if ((_a = options.parentChain) === null || _a === void 0 ? void 0 : _a.length) {
|
|
93
|
+
const chain = options.parentChain.map(p => `${p.type}/${p.id}`).join('/');
|
|
94
|
+
const endpoint = `${chain}/${entity}${options.entityId ? `/${options.entityId}` : ''}`;
|
|
95
|
+
return processEndpointPath(endpoint, options);
|
|
96
|
+
}
|
|
97
|
+
const endpoint = options.entityId ? `${entity}/${options.entityId}` : entity;
|
|
98
|
+
return processEndpointPath(endpoint, options);
|
|
99
|
+
}
|
|
100
|
+
function buildChildEntityUrl(parent, child, parentId, options = {}) {
|
|
101
|
+
var _a;
|
|
102
|
+
const parentMetadata = (0, entities_1.getEntityMetadata)(parent);
|
|
103
|
+
if (!parentMetadata) {
|
|
104
|
+
throw new Error(`Invalid parent entity type: ${parent}. Entity type not found in metadata.`);
|
|
105
|
+
}
|
|
106
|
+
const childMetadata = (0, entities_1.getEntityMetadata)(child);
|
|
107
|
+
if (!childMetadata) {
|
|
108
|
+
throw new Error(`Invalid child entity type: ${child}. Entity type not found in metadata.`);
|
|
109
|
+
}
|
|
110
|
+
validateParentChain(options.parentChain);
|
|
111
|
+
const subname = childMetadata.subname || child;
|
|
112
|
+
if ((_a = options.parentChain) === null || _a === void 0 ? void 0 : _a.length) {
|
|
113
|
+
const chain = options.parentChain.map(p => `${p.type}/${p.id}`).join('/');
|
|
114
|
+
const endpoint = `${chain}/${subname}${options.entityId ? `/${options.entityId}` : ''}`;
|
|
115
|
+
return processEndpointPath(endpoint, options);
|
|
116
|
+
}
|
|
117
|
+
if (childMetadata.isAttachment && options.entityId) {
|
|
118
|
+
const endpoint = `${parent}/${parentId}/${subname}/${options.entityId}`;
|
|
119
|
+
return processEndpointPath(endpoint, { ...options, isAttachment: true });
|
|
120
|
+
}
|
|
121
|
+
const endpoint = `${parent}/${parentId}/${subname}${options.entityId ? `/${options.entityId}` : ''}`;
|
|
122
|
+
return processEndpointPath(endpoint, options);
|
|
123
|
+
}
|
|
124
|
+
async function autotaskApiRequest(method, endpoint, body = {}, query = {}) {
|
|
125
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
126
|
+
console.debug('\nDebug: Starting API request:', { method, endpoint });
|
|
127
|
+
const credentials = await this.getCredentials('autotaskApi');
|
|
128
|
+
const baseUrl = credentials.zone;
|
|
129
|
+
const options = {
|
|
130
|
+
method,
|
|
131
|
+
headers: (0, headers_1.getAutotaskHeaders)(credentials),
|
|
132
|
+
qs: query,
|
|
133
|
+
json: true,
|
|
134
|
+
};
|
|
135
|
+
if (endpoint.startsWith('http') && endpoint.includes('/query/')) {
|
|
136
|
+
options.url = endpoint;
|
|
137
|
+
if (body && typeof body === 'object') {
|
|
138
|
+
options.body = {
|
|
139
|
+
filter: body.filter || [],
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
const apiPath = `${baseUrl.replace(/\/+$/, '')}/${operations_1.API_VERSION.VERSION}/`;
|
|
145
|
+
const isQueryOp = isQueryEndpoint(endpoint);
|
|
146
|
+
const processedEndpoint = processEndpointPath(endpoint, { isQuery: isQueryOp });
|
|
147
|
+
options.url = `${apiPath}${processedEndpoint}`;
|
|
148
|
+
options.body = body;
|
|
149
|
+
}
|
|
150
|
+
console.debug(`API ${method} ${options.url}`);
|
|
151
|
+
if (method === 'POST' || method === 'PUT' || method === 'PATCH') {
|
|
152
|
+
console.debug('Request Body:', JSON.stringify(options.body, null, 2));
|
|
153
|
+
}
|
|
154
|
+
try {
|
|
155
|
+
const response = await this.helpers.request(options);
|
|
156
|
+
if (endpoint.includes('entityInformation')) {
|
|
157
|
+
if (endpoint.endsWith('fields') || endpoint.endsWith('userDefinedFields')) {
|
|
158
|
+
const fieldsResponse = response;
|
|
159
|
+
if (!(fieldsResponse === null || fieldsResponse === void 0 ? void 0 : fieldsResponse.fields) || !Array.isArray(fieldsResponse.fields)) {
|
|
160
|
+
throw new Error(`Invalid fields response: missing or invalid fields array for ${endpoint}`);
|
|
161
|
+
}
|
|
162
|
+
return response;
|
|
163
|
+
}
|
|
164
|
+
const infoResponse = response;
|
|
165
|
+
if (!(infoResponse === null || infoResponse === void 0 ? void 0 : infoResponse.info) || typeof infoResponse.info !== 'object') {
|
|
166
|
+
throw new Error('Invalid entity information response: missing or invalid info object');
|
|
167
|
+
}
|
|
168
|
+
return response;
|
|
169
|
+
}
|
|
170
|
+
if (isModificationOperation(method, endpoint)) {
|
|
171
|
+
console.debug('Debug: Processing modification response:', JSON.stringify(response, null, 2));
|
|
172
|
+
const modResponse = response;
|
|
173
|
+
console.debug('Debug: Parsed modResponse:', JSON.stringify(modResponse, null, 2));
|
|
174
|
+
if (endpoint.includes('/') && endpoint.split('/').length > 2) {
|
|
175
|
+
console.debug('Debug: Handling child entity operation');
|
|
176
|
+
const modResponse = response;
|
|
177
|
+
if ('itemId' in modResponse) {
|
|
178
|
+
return { item: { itemId: modResponse.itemId } };
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
if ('id' in modResponse || 'itemId' in modResponse) {
|
|
182
|
+
const idField = 'id' in modResponse ? 'id' : 'itemId';
|
|
183
|
+
console.debug(`Debug: Found ${idField} in response with value:`, modResponse[idField]);
|
|
184
|
+
return { item: { [idField]: modResponse[idField] } };
|
|
185
|
+
}
|
|
186
|
+
console.debug('Debug: No id/itemId property found in response');
|
|
187
|
+
throw new Error(`Invalid modification response: missing id/itemId for ${method} ${endpoint}`);
|
|
188
|
+
}
|
|
189
|
+
if (endpoint.includes('/query/count')) {
|
|
190
|
+
const countResponse = response;
|
|
191
|
+
if (typeof (countResponse === null || countResponse === void 0 ? void 0 : countResponse.queryCount) === 'number') {
|
|
192
|
+
return response;
|
|
193
|
+
}
|
|
194
|
+
throw new Error(`Invalid count response: missing or invalid queryCount value. Response: ${JSON.stringify(response)}`);
|
|
195
|
+
}
|
|
196
|
+
if (isQueryEndpoint(endpoint)) {
|
|
197
|
+
const queryResponse = response;
|
|
198
|
+
if ((queryResponse === null || queryResponse === void 0 ? void 0 : queryResponse.items) && Array.isArray(queryResponse.items) && (queryResponse === null || queryResponse === void 0 ? void 0 : queryResponse.pageDetails)) {
|
|
199
|
+
return response;
|
|
200
|
+
}
|
|
201
|
+
throw new Error('Invalid query response: missing items array or pageDetails');
|
|
202
|
+
}
|
|
203
|
+
if (method === 'GET' && (response === null || response === void 0 ? void 0 : response.item)) {
|
|
204
|
+
return response;
|
|
205
|
+
}
|
|
206
|
+
throw new Error(`Invalid API response format for ${method} ${endpoint}: ${JSON.stringify(response)}`);
|
|
207
|
+
}
|
|
208
|
+
catch (error) {
|
|
209
|
+
console.error('API Error:', error);
|
|
210
|
+
console.error('Error Response:', (_a = error.response) === null || _a === void 0 ? void 0 : _a.data);
|
|
211
|
+
console.error('Error Status:', (_b = error.response) === null || _b === void 0 ? void 0 : _b.status);
|
|
212
|
+
const status = (_c = error.response) === null || _c === void 0 ? void 0 : _c.status;
|
|
213
|
+
const url = options.url;
|
|
214
|
+
console.warn(`API ${method} ${url} failed (${status}): ${getErrorMessage(error)}`);
|
|
215
|
+
const errorData = (_d = error.response) === null || _d === void 0 ? void 0 : _d.data;
|
|
216
|
+
if ((_e = errorData === null || errorData === void 0 ? void 0 : errorData.errors) === null || _e === void 0 ? void 0 : _e.length) {
|
|
217
|
+
const messages = errorData.errors.map(e => e.message || '').filter(Boolean);
|
|
218
|
+
error.error = {
|
|
219
|
+
message: messages.join('\n'),
|
|
220
|
+
status: (_f = error.response) === null || _f === void 0 ? void 0 : _f.status,
|
|
221
|
+
};
|
|
222
|
+
error.statusCode = (_g = error.response) === null || _g === void 0 ? void 0 : _g.status;
|
|
223
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
|
|
224
|
+
}
|
|
225
|
+
error.error = {
|
|
226
|
+
message: `Operation failed with status ${status}`,
|
|
227
|
+
status: (_h = error.response) === null || _h === void 0 ? void 0 : _h.status,
|
|
228
|
+
};
|
|
229
|
+
error.statusCode = (_j = error.response) === null || _j === void 0 ? void 0 : _j.status;
|
|
230
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
//# sourceMappingURL=request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../../nodes/Autotask/helpers/http/request.ts"],"names":[],"mappings":";;AAsPS,wCAAc;AAAE,kDAAmB;AAM5C,gDA+IC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AAM,SAAS,GAAG,MAAA,KAAK,CAAC,QAAQ,0CAAE,IAAiB,CAAC;QACpD,IAAI,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,MAAM,0CAAE,MAAM,EAAE,CAAC;YAC/B,MAAM,QAAQ,GAAG,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAC5E,KAAK,CAAC,KAAK,GAAG;gBACb,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;gBAC5B,MAAM,EAAE,MAAA,KAAK,CAAC,QAAQ,0CAAE,MAAM;aAC9B,CAAC;YACF,KAAK,CAAC,UAAU,GAAG,MAAA,KAAK,CAAC,QAAQ,0CAAE,MAAM,CAAC;YAC1C,MAAM,IAAI,2BAAY,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,CAAC;QAC/C,CAAC;QAGD,KAAK,CAAC,KAAK,GAAG;YACb,OAAO,EAAE,gCAAgC,MAAM,EAAE;YACjD,MAAM,EAAE,MAAA,KAAK,CAAC,QAAQ,0CAAE,MAAM;SAC9B,CAAC;QACF,KAAK,CAAC,UAAU,GAAG,MAAA,KAAK,CAAC,QAAQ,0CAAE,MAAM,CAAC;QAC1C,MAAM,IAAI,2BAAY,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,CAAC;IAC/C,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./errorHandler"), exports);
|
|
18
|
+
__exportStar(require("./http"), exports);
|
|
19
|
+
__exportStar(require("./options"), exports);
|
|
20
|
+
__exportStar(require("./field-conversion"), exports);
|
|
21
|
+
__exportStar(require("./resourceMapper"), exports);
|
|
22
|
+
__exportStar(require("./entity"), exports);
|
|
23
|
+
__exportStar(require("./entity-values"), exports);
|
|
24
|
+
__exportStar(require("./pagination"), exports);
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../nodes/Autotask/helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,iDAA+B;AAC/B,yCAAuB;AAGvB,4CAA0B;AAG1B,qDAAmC;AAGnC,mDAAiC;AAGjC,2CAAyB;AACzB,kDAAgC;AAGhC,+CAA6B"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { INodePropertyOptions } from 'n8n-workflow';
|
|
2
|
+
import type { IAutotaskField } from '../../types';
|
|
3
|
+
export declare function getFieldOptions(fields: IAutotaskField[]): INodePropertyOptions[];
|
|
4
|
+
export declare function getFilterFieldOptions(fields: IAutotaskField[]): INodePropertyOptions[];
|
|
5
|
+
export declare function getSortFieldOptions(fields: IAutotaskField[]): INodePropertyOptions[];
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFieldOptions = getFieldOptions;
|
|
4
|
+
exports.getFilterFieldOptions = getFilterFieldOptions;
|
|
5
|
+
exports.getSortFieldOptions = getSortFieldOptions;
|
|
6
|
+
function formatFieldDescription(field) {
|
|
7
|
+
const parts = [];
|
|
8
|
+
if (field.description)
|
|
9
|
+
parts.push(field.description);
|
|
10
|
+
if (field.isRequired)
|
|
11
|
+
parts.push('Required');
|
|
12
|
+
if (field.isReadOnly)
|
|
13
|
+
parts.push('Read-only');
|
|
14
|
+
return parts.join(' | ');
|
|
15
|
+
}
|
|
16
|
+
function getFieldOptions(fields) {
|
|
17
|
+
try {
|
|
18
|
+
return fields
|
|
19
|
+
.filter(field => field.isActive)
|
|
20
|
+
.map(field => ({
|
|
21
|
+
name: field.label || field.name,
|
|
22
|
+
value: field.name,
|
|
23
|
+
description: formatFieldDescription(field),
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
throw new Error(`Failed to get field options: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function getFilterFieldOptions(fields) {
|
|
31
|
+
try {
|
|
32
|
+
return fields
|
|
33
|
+
.filter(field => field.isActive && field.isQueryable)
|
|
34
|
+
.map(field => ({
|
|
35
|
+
name: field.label || field.name,
|
|
36
|
+
value: field.name,
|
|
37
|
+
description: formatFieldDescription(field),
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
throw new Error(`Failed to get filter field options: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function getSortFieldOptions(fields) {
|
|
45
|
+
try {
|
|
46
|
+
return fields
|
|
47
|
+
.filter(field => field.isActive && field.isQueryable)
|
|
48
|
+
.map(field => ({
|
|
49
|
+
name: field.label || field.name,
|
|
50
|
+
value: field.name,
|
|
51
|
+
description: formatFieldDescription(field),
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
throw new Error(`Failed to get sort field options: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=entityOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entityOptions.js","sourceRoot":"","sources":["../../../../../nodes/Autotask/helpers/options/entityOptions.ts"],"names":[],"mappings":";;AAiBA,0CAYC;AAKD,sDAYC;AAKD,kDAYC;AAzDD,SAAS,sBAAsB,CAAC,KAAqB;IACpD,MAAM,KAAK,GAAG,EAAE,CAAC;IACjB,IAAI,KAAK,CAAC,WAAW;QAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IACrD,IAAI,KAAK,CAAC,UAAU;QAAE,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC7C,IAAI,KAAK,CAAC,UAAU;QAAE,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC9C,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC1B,CAAC;AAKD,SAAgB,eAAe,CAAC,MAAwB;IACvD,IAAI,CAAC;QACJ,OAAO,MAAM;aACX,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC;aAC/B,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACd,IAAI,EAAE,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI;YAC/B,KAAK,EAAE,KAAK,CAAC,IAAI;YACjB,WAAW,EAAE,sBAAsB,CAAC,KAAK,CAAC;SAC1C,CAAC,CAAC,CAAC;IACN,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,gCAAgC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,C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+1,5 @@
|
|
|
1
|
+
import type { ILoadOptionsFunctions, INodePropertyOptions } from 'n8n-workflow';
|
|
2
|
+
import { getFieldOptions, getFilterFieldOptions, getSortFieldOptions } from './entityOptions';
|
|
3
|
+
export { getFieldOptions, getFilterFieldOptions, getSortFieldOptions, };
|
|
4
|
+
export type LoadOptionsFunction = (this: ILoadOptionsFunctions) => Promise<INodePropertyOptions[]>;
|
|
5
|
+
export type EntityOptionsFunction = (entityType: string) => LoadOptionsFunction;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSortFieldOptions = exports.getFilterFieldOptions = exports.getFieldOptions = void 0;
|
|
4
|
+
const entityOptions_1 = require("./entityOptions");
|
|
5
|
+
Object.defineProperty(exports, "getFieldOptions", { enumerable: true, get: function () { return entityOptions_1.getFieldOptions; } });
|
|
6
|
+
Object.defineProperty(exports, "getFilterFieldOptions", { enumerable: true, get: function () { return entityOptions_1.getFilterFieldOptions; } });
|
|
7
|
+
Object.defineProperty(exports, "getSortFieldOptions", { enumerable: true, get: function () { return entityOptions_1.getSortFieldOptions; } });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Autotask/helpers/options/index.ts"],"names":[],"mappings":";;;AACA,mDAA8F;AAG7F,gGAHQ,+BAAe,OAGR;AACf,sGAJyB,qCAAqB,OAIzB;AACrB,oGALgD,mCAAmB,OAKhD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { INodePropertyOptions } from 'n8n-workflow';
|
|
2
|
+
import type { IAutotaskField, IFieldValidationRules } from '../../types';
|
|
3
|
+
type FieldWithValidation = IAutotaskField & {
|
|
4
|
+
validation: IFieldValidationRules;
|
|
5
|
+
id: number | string;
|
|
6
|
+
};
|
|
7
|
+
export declare function sortFieldsByRequiredAndName(fields: FieldWithValidation[]): INodePropertyOptions[];
|
|
8
|
+
export declare function formatFieldDescription(field: FieldWithValidation): string;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sortFieldsByRequiredAndName = sortFieldsByRequiredAndName;
|
|
4
|
+
exports.formatFieldDescription = formatFieldDescription;
|
|
5
|
+
function sortFieldsByRequiredAndName(fields) {
|
|
6
|
+
try {
|
|
7
|
+
return fields.sort((a, b) => {
|
|
8
|
+
if (a.validation.isRequired && !b.validation.isRequired) {
|
|
9
|
+
return -1;
|
|
10
|
+
}
|
|
11
|
+
if (!a.validation.isRequired && b.validation.isRequired) {
|
|
12
|
+
return 1;
|
|
13
|
+
}
|
|
14
|
+
const nameA = a.name.toLowerCase();
|
|
15
|
+
const nameB = b.name.toLowerCase();
|
|
16
|
+
if (nameA < nameB) {
|
|
17
|
+
return -1;
|
|
18
|
+
}
|
|
19
|
+
if (nameA > nameB) {
|
|
20
|
+
return 1;
|
|
21
|
+
}
|
|
22
|
+
return 0;
|
|
23
|
+
}).map(field => ({
|
|
24
|
+
name: field.name,
|
|
25
|
+
value: field.id.toString(),
|
|
26
|
+
description: formatFieldDescription(field),
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
console.error('Failed to sort fields:', error);
|
|
31
|
+
throw error;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function formatFieldDescription(field) {
|
|
35
|
+
const parts = [];
|
|
36
|
+
parts.push(`Type: ${field.dataType}`);
|
|
37
|
+
if (field.validation.isRequired) {
|
|
38
|
+
parts.push('Required');
|
|
39
|
+
}
|
|
40
|
+
if (field.validation.isReadOnly) {
|
|
41
|
+
parts.push('Read-only');
|
|
42
|
+
}
|
|
43
|
+
if (field.description) {
|
|
44
|
+
parts.push(field.description);
|
|
45
|
+
}
|
|
46
|
+
return parts.join(' | ');
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../nodes/Autotask/helpers/options/utils.ts"],"names":[],"mappings":";;AAWA,kEA8BC;AAKD,wDAsBC;AAzDD,SAAgB,2BAA2B,CAAC,MAA6B;IACxE,IAAI,CAAC;QACJ,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YAE3B,IAAI,CAAC,CAAC,UAAU,CAAC,UAAU,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC;gBACzD,OAAO,CAAC,CAAC,CAAC;YACX,CAAC;YACD,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,UAAU,IAAI,CAAC,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC;gBACzD,OAAO,CAAC,CAAC;YACV,CAAC;YAGD,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACnC,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACnC,IAAI,KAAK,GAAG,KAAK,EAAE,CAAC;gBACnB,OAAO,CAAC,CAAC,CAAC;YACX,CAAC;YACD,IAAI,KAAK,GAAG,KAAK,EAAE,CAAC;gBACnB,OAAO,CAAC,CAAC;YACV,CAAC;YACD,OAAO,CAAC,CAAC;QACV,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAChB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE;YAC1B,WAAW,EAAE,sBAAsB,CAAC,KAAK,CAAC;SAC1C,CAAC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;QAC/C,MAAM,KAAK,CAAC;IACb,CAAC;AACF,CAAC;AAKD,SAAgB,sBAAsB,CAAC,KAA0B;IAChE,MAAM,KAAK,GAAG,EAAE,CAAC;IAGjB,KAAK,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;IAGtC,IAAI,KAAK,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC;QACjC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACxB,CAAC;IAGD,IAAI,KAAK,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC;QACjC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACzB,CAAC;IAGD,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;QACvB,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IAC/B,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { IExecuteFunctions, ILoadOptionsFunctions, IHookFunctions } from 'n8n-workflow';
|
|
2
|
+
import type { IPageDetails } from '../types/base/entity-types';
|
|
3
|
+
import type { IQueryResponse } from '../types/base/entity-types';
|
|
4
|
+
export declare class PaginationHandler {
|
|
5
|
+
private readonly entityType;
|
|
6
|
+
private state;
|
|
7
|
+
private readonly context;
|
|
8
|
+
constructor(entityType: string, context: IExecuteFunctions | ILoadOptionsFunctions | IHookFunctions, options?: {
|
|
9
|
+
pageSize?: number;
|
|
10
|
+
maxPages?: number;
|
|
11
|
+
});
|
|
12
|
+
updateState(pageDetails: IPageDetails): void;
|
|
13
|
+
processResponse<T>(response: IQueryResponse<T>): Promise<T[]>;
|
|
14
|
+
getState(): IPaginationState;
|
|
15
|
+
hasNextPage(): boolean;
|
|
16
|
+
getNextPageUrl(): string | null;
|
|
17
|
+
reset(): void;
|
|
18
|
+
}
|
|
19
|
+
interface IPaginationState {
|
|
20
|
+
currentPage: number;
|
|
21
|
+
totalPages: number;
|
|
22
|
+
pageSize: number;
|
|
23
|
+
hasNextPage: boolean;
|
|
24
|
+
nextPageUrl: string | null;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PaginationHandler = void 0;
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
|
+
const errorHandler_1 = require("./errorHandler");
|
|
6
|
+
class PaginationHandler {
|
|
7
|
+
constructor(entityType, context, options) {
|
|
8
|
+
this.entityType = entityType;
|
|
9
|
+
this.context = context;
|
|
10
|
+
this.state = {
|
|
11
|
+
currentPage: 0,
|
|
12
|
+
totalPages: 0,
|
|
13
|
+
pageSize: (options === null || options === void 0 ? void 0 : options.pageSize) || constants_1.PAGINATION.DEFAULT_PAGE_SIZE,
|
|
14
|
+
hasNextPage: false,
|
|
15
|
+
nextPageUrl: null,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
updateState(pageDetails) {
|
|
19
|
+
this.state = {
|
|
20
|
+
...this.state,
|
|
21
|
+
currentPage: this.state.currentPage + 1,
|
|
22
|
+
totalPages: Math.ceil(pageDetails.requestCount / this.state.pageSize),
|
|
23
|
+
hasNextPage: !!pageDetails.nextPageUrl,
|
|
24
|
+
nextPageUrl: pageDetails.nextPageUrl || null,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
async processResponse(response) {
|
|
28
|
+
return await (0, errorHandler_1.handleErrors)(this.context, async () => {
|
|
29
|
+
if (!response.items || !Array.isArray(response.items)) {
|
|
30
|
+
throw new Error(`Invalid response format for ${this.entityType}: Missing or invalid items array`);
|
|
31
|
+
}
|
|
32
|
+
if (response.pageDetails) {
|
|
33
|
+
this.updateState(response.pageDetails);
|
|
34
|
+
}
|
|
35
|
+
return response.items;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
getState() {
|
|
39
|
+
return { ...this.state };
|
|
40
|
+
}
|
|
41
|
+
hasNextPage() {
|
|
42
|
+
return this.state.hasNextPage && this.state.currentPage < constants_1.PAGINATION.MAX_PAGES;
|
|
43
|
+
}
|
|
44
|
+
getNextPageUrl() {
|
|
45
|
+
return this.hasNextPage() ? this.state.nextPageUrl : null;
|
|
46
|
+
}
|
|
47
|
+
reset() {
|
|
48
|
+
this.state = {
|
|
49
|
+
currentPage: 0,
|
|
50
|
+
totalPages: 0,
|
|
51
|
+
pageSize: this.state.pageSize,
|
|
52
|
+
hasNextPage: false,
|
|
53
|
+
nextPageUrl: null,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.PaginationHandler = PaginationHandler;
|
|
58
|
+
//# sourceMappingURL=pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../../../nodes/Autotask/helpers/pagination.ts"],"names":[],"mappings":";;;AAGA,4CAA0C;AAC1C,iDAA8C;AAM9C,MAAa,iBAAiB;IAI7B,YACkB,UAAkB,EACnC,OAAmE,EACnE,OAGC;QALgB,eAAU,GAAV,UAAU,CAAQ;QAOnC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG;YACZ,WAAW,EAAE,CAAC;YACd,UAAU,EAAE,CAAC;YACb,QAAQ,EAAE,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,KAAI,sBAAU,CAAC,iBAAiB;YAC3D,WAAW,EAAE,KAAK;YAClB,WAAW,EAAE,IAAI;SACjB,CAAC;IACH,CAAC;IAKM,WAAW,CAAC,WAAyB;QAC3C,IAAI,CAAC,KAAK,GAAG;YACZ,GAAG,IAAI,CAAC,KAAK;YACb,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,CAAC;YACvC,UAAU,EAAE,IAAI,CAAC,IAAI,CAA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;SACjB,CAAC;IACH,CAAC;CACD;AArFD,8CAqFC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IExecuteFunctions } from 'n8n-workflow';
|
|
2
|
+
export declare function normalizeParameterName(name: string): string;
|
|
3
|
+
export declare function getParameterVariations(baseName: string): string[];
|
|
4
|
+
export declare function getParameterInsensitive(context: IExecuteFunctions, parameterName: string, itemIndex: number): unknown;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeParameterName = normalizeParameterName;
|
|
4
|
+
exports.getParameterVariations = getParameterVariations;
|
|
5
|
+
exports.getParameterInsensitive = getParameterInsensitive;
|
|
6
|
+
function normalizeParameterName(name) {
|
|
7
|
+
if (/id$/i.test(name)) {
|
|
8
|
+
const baseName = name.slice(0, -2);
|
|
9
|
+
return `${baseName}id`;
|
|
10
|
+
}
|
|
11
|
+
return name;
|
|
12
|
+
}
|
|
13
|
+
function getParameterVariations(baseName) {
|
|
14
|
+
const variations = [baseName];
|
|
15
|
+
if (/id$/i.test(baseName)) {
|
|
16
|
+
const nameWithoutId = baseName.slice(0, -2);
|
|
17
|
+
variations.push(`${nameWithoutId}ID`, `${nameWithoutId}Id`, `${nameWithoutId}id`);
|
|
18
|
+
}
|
|
19
|
+
return [...new Set(variations)];
|
|
20
|
+
}
|
|
21
|
+
function getParameterInsensitive(context, parameterName, itemIndex) {
|
|
22
|
+
const normalizedName = normalizeParameterName(parameterName);
|
|
23
|
+
const variations = getParameterVariations(normalizedName);
|
|
24
|
+
const triedVariations = [];
|
|
25
|
+
for (const variation of variations) {
|
|
26
|
+
triedVariations.push(variation);
|
|
27
|
+
try {
|
|
28
|
+
return context.getNodeParameter(variation, itemIndex);
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
throw new Error(`Could not find parameter. Tried variations: ${triedVariations.join(', ')}`);
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=parameter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameter.js","sourceRoot":"","sources":["../../../../nodes/Autotask/helpers/parameter.ts"],"names":[],"mappings":";;AAMA,wDASC;AAOD,wDAcC;AAUD,0DAuBC;AA/DD,SAAgB,sBAAsB,CAAC,IAAY;IAElD,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACvB,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACnC,OAAO,GAAG,QAAQ,IAAI,CAAC;IACxB,CAAC;IAGD,OAAO,IAAI,CAAC;AACb,CAAC;AAOD,SAAgB,sBAAsB,CAAC,QAAgB;IACtD,MAAM,UAAU,GAAa,CAAC,QAAQ,CAAC,CAAC;IAGxC,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC3B,MAAM,aAAa,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC5C,UAAU,CAAC,IAAI,CACd,GAAG,aAAa,IAAI,EACpB,GAAG,aAAa,IAAI,EACpB,GAAG,aAAa,IAAI,CACpB,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;AACjC,CAAC;AAUD,SAAgB,uBAAuB,CACtC,OAA0B,EAC1B,aAAqB,EACrB,SAAiB;IAEjB,MAAM,cAAc,GAAG,sBAAsB,CAAC,aAAa,CAAC,CAAC;IAC7D,MAAM,UAAU,GAAG,sBAAsB,CAAC,cAAc,CAAC,CAAC;IAC1D,MAAM,eAAe,GAAa,EAAE,CAAC;IAGrC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACpC,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAChC,IAAI,CAAC;YACJ,OAAO,OAAO,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QACvD,CAAC;QAAC,MAAM,CAAC;QAET,CAAC;IACF,CAAC;IAGD,MAAM,IAAI,KAAK,CACd,+CAA+C,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC3E,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare enum OperationGroup {
|
|
3
|
+
ENTITY_INFO = "entityInfo",
|
|
4
|
+
ADVANCED_QUERY = "advancedQuery"
|
|
5
|
+
}
|
|
6
|
+
export interface IOperationDependency {
|
|
7
|
+
group: OperationGroup;
|
|
8
|
+
requires?: OperationGroup[];
|
|
9
|
+
}
|
|
10
|
+
export interface IOperationAdditionConfig {
|
|
11
|
+
resourceName: string;
|
|
12
|
+
excludeOperations?: string[];
|
|
13
|
+
dependencies?: IOperationDependency[];
|
|
14
|
+
}
|
|
15
|
+
export declare function addOperationsToResource(baseFields: INodeProperties[], config: IOperationAdditionConfig): INodeProperties[];
|
|
16
|
+
export declare function validateOperationDependencies(dependencies: IOperationDependency[]): boolean;
|