n8n-nodes-autotask 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +20 -0
  2. package/dist/nodes/Autotask/Autotask.node.js +80 -49
  3. package/dist/nodes/Autotask/Autotask.node.js.map +1 -1
  4. package/dist/nodes/Autotask/constants/entities.js +7 -1
  5. package/dist/nodes/Autotask/constants/entities.js.map +1 -1
  6. package/dist/nodes/Autotask/constants/field.constants.js +2 -0
  7. package/dist/nodes/Autotask/constants/field.constants.js.map +1 -1
  8. package/dist/nodes/Autotask/helpers/resource-operations.helper.js +6 -0
  9. package/dist/nodes/Autotask/helpers/resource-operations.helper.js.map +1 -1
  10. package/dist/nodes/Autotask/operations/base/field-processor.js +0 -16
  11. package/dist/nodes/Autotask/operations/base/field-processor.js.map +1 -1
  12. package/dist/nodes/Autotask/operations/common/get-many/description.js +1 -1
  13. package/dist/nodes/Autotask/operations/common/get-many/description.js.map +1 -1
  14. package/dist/nodes/Autotask/operations/common/get-many-advanced/description.js +1 -1
  15. package/dist/nodes/Autotask/operations/common/get-many-advanced/description.js.map +1 -1
  16. package/dist/nodes/Autotask/operations/common/picklist-labels/description.js +0 -1
  17. package/dist/nodes/Autotask/operations/common/picklist-labels/description.js.map +1 -1
  18. package/dist/nodes/Autotask/resources/billingCodes/description.js +1 -4
  19. package/dist/nodes/Autotask/resources/billingCodes/description.js.map +1 -1
  20. package/dist/nodes/Autotask/resources/companies/description.js +1 -4
  21. package/dist/nodes/Autotask/resources/companies/description.js.map +1 -1
  22. package/dist/nodes/Autotask/resources/companyAlerts/description.d.ts +2 -0
  23. package/dist/nodes/Autotask/resources/companyAlerts/description.js +104 -0
  24. package/dist/nodes/Autotask/resources/companyAlerts/description.js.map +1 -0
  25. package/dist/nodes/Autotask/resources/companyAlerts/execute.d.ts +2 -0
  26. package/dist/nodes/Autotask/resources/companyAlerts/execute.js +83 -0
  27. package/dist/nodes/Autotask/resources/companyAlerts/execute.js.map +1 -0
  28. package/dist/nodes/Autotask/resources/companyAlerts/index.d.ts +1 -0
  29. package/dist/nodes/Autotask/resources/companyAlerts/index.js +18 -0
  30. package/dist/nodes/Autotask/resources/companyAlerts/index.js.map +1 -0
  31. package/dist/nodes/Autotask/resources/companyLocations/description.d.ts +2 -0
  32. package/dist/nodes/Autotask/resources/companyLocations/description.js +102 -0
  33. package/dist/nodes/Autotask/resources/companyLocations/description.js.map +1 -0
  34. package/dist/nodes/Autotask/resources/companyLocations/execute.d.ts +2 -0
  35. package/dist/nodes/Autotask/resources/companyLocations/execute.js +83 -0
  36. package/dist/nodes/Autotask/resources/companyLocations/execute.js.map +1 -0
  37. package/dist/nodes/Autotask/resources/companyLocations/index.d.ts +2 -0
  38. package/dist/nodes/Autotask/resources/companyLocations/index.js +19 -0
  39. package/dist/nodes/Autotask/resources/companyLocations/index.js.map +1 -0
  40. package/dist/nodes/Autotask/resources/contacts/description.js +1 -7
  41. package/dist/nodes/Autotask/resources/contacts/description.js.map +1 -1
  42. package/dist/nodes/Autotask/resources/contacts/execute.js +0 -6
  43. package/dist/nodes/Autotask/resources/contacts/execute.js.map +1 -1
  44. package/dist/nodes/Autotask/resources/contracts/description.d.ts +9 -0
  45. package/dist/nodes/Autotask/resources/contracts/description.js +96 -0
  46. package/dist/nodes/Autotask/resources/contracts/description.js.map +1 -0
  47. package/dist/nodes/Autotask/resources/contracts/execute.d.ts +2 -0
  48. package/dist/nodes/Autotask/resources/contracts/execute.js +77 -0
  49. package/dist/nodes/Autotask/resources/contracts/execute.js.map +1 -0
  50. package/dist/nodes/Autotask/resources/contracts/index.d.ts +2 -0
  51. package/dist/nodes/Autotask/resources/contracts/index.js +19 -0
  52. package/dist/nodes/Autotask/resources/contracts/index.js.map +1 -0
  53. package/dist/nodes/Autotask/resources/definitions.js +30 -0
  54. package/dist/nodes/Autotask/resources/definitions.js.map +1 -1
  55. package/dist/nodes/Autotask/resources/holidaySets/description.d.ts +2 -0
  56. package/dist/nodes/Autotask/resources/holidaySets/description.js +104 -0
  57. package/dist/nodes/Autotask/resources/holidaySets/description.js.map +1 -0
  58. package/dist/nodes/Autotask/resources/holidaySets/execute.d.ts +2 -0
  59. package/dist/nodes/Autotask/resources/holidaySets/execute.js +83 -0
  60. package/dist/nodes/Autotask/resources/holidaySets/execute.js.map +1 -0
  61. package/dist/nodes/Autotask/resources/holidaySets/index.d.ts +2 -0
  62. package/dist/nodes/Autotask/resources/holidaySets/index.js +19 -0
  63. package/dist/nodes/Autotask/resources/holidaySets/index.js.map +1 -0
  64. package/dist/nodes/Autotask/resources/holidays/description.d.ts +2 -0
  65. package/dist/nodes/Autotask/resources/holidays/description.js +102 -0
  66. package/dist/nodes/Autotask/resources/holidays/description.js.map +1 -0
  67. package/dist/nodes/Autotask/resources/holidays/execute.d.ts +2 -0
  68. package/dist/nodes/Autotask/resources/holidays/execute.js +94 -0
  69. package/dist/nodes/Autotask/resources/holidays/execute.js.map +1 -0
  70. package/dist/nodes/Autotask/resources/holidays/index.d.ts +2 -0
  71. package/dist/nodes/Autotask/resources/holidays/index.js +19 -0
  72. package/dist/nodes/Autotask/resources/holidays/index.js.map +1 -0
  73. package/dist/nodes/Autotask/resources/serviceCalls/description.d.ts +2 -0
  74. package/dist/nodes/Autotask/resources/serviceCalls/description.js +104 -0
  75. package/dist/nodes/Autotask/resources/serviceCalls/description.js.map +1 -0
  76. package/dist/nodes/Autotask/resources/serviceCalls/execute.d.ts +2 -0
  77. package/dist/nodes/Autotask/resources/serviceCalls/execute.js +83 -0
  78. package/dist/nodes/Autotask/resources/serviceCalls/execute.js.map +1 -0
  79. package/dist/nodes/Autotask/resources/serviceCalls/index.d.ts +2 -0
  80. package/dist/nodes/Autotask/resources/serviceCalls/index.js +19 -0
  81. package/dist/nodes/Autotask/resources/serviceCalls/index.js.map +1 -0
  82. package/dist/package.json +2 -2
  83. package/dist/tsconfig.tsbuildinfo +1 -1
  84. package/package.json +2 -2
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.executeHolidayOperation = executeHolidayOperation;
4
+ const base_1 = require("../../operations/base");
5
+ const entityInfo_execute_1 = require("../../operations/common/entityInfo.execute");
6
+ const get_many_advanced_1 = require("../../operations/common/get-many-advanced");
7
+ const ENTITY_TYPE = 'holiday';
8
+ async function executeHolidayOperation() {
9
+ const items = this.getInputData();
10
+ const returnData = [];
11
+ const operation = this.getNodeParameter('operation', 0);
12
+ for (let i = 0; i < items.length; i++) {
13
+ try {
14
+ switch (operation) {
15
+ case 'create': {
16
+ console.log('Debug: Starting create operation');
17
+ const createOp = new base_1.CreateOperation(ENTITY_TYPE, this);
18
+ console.log('Debug: Created operation instance');
19
+ const response = await createOp.execute(i);
20
+ console.log('Debug: Operation response:', response);
21
+ returnData.push({ json: response });
22
+ break;
23
+ }
24
+ case 'update': {
25
+ const entityId = this.getNodeParameter('id', i);
26
+ const updateOp = new base_1.UpdateOperation(ENTITY_TYPE, this);
27
+ const response = await updateOp.execute(i, entityId);
28
+ returnData.push({ json: response });
29
+ break;
30
+ }
31
+ case 'get': {
32
+ const getOp = new base_1.GetOperation(ENTITY_TYPE, this, 'holidaySet');
33
+ const response = await getOp.execute(i);
34
+ returnData.push({ json: response });
35
+ break;
36
+ }
37
+ case 'getMany': {
38
+ const getManyOp = new base_1.GetManyOperation(ENTITY_TYPE, this, { parentType: 'holidaySet' });
39
+ const filters = getManyOp.buildFiltersFromResourceMapper(i);
40
+ const response = await getManyOp.execute({ filter: filters }, i);
41
+ returnData.push(...getManyOp.processReturnData(response));
42
+ break;
43
+ }
44
+ case 'getManyAdvanced': {
45
+ const results = await get_many_advanced_1.handleGetManyAdvancedOperation.call(this, ENTITY_TYPE, i, { parentType: 'holidaySet' });
46
+ returnData.push(...results);
47
+ break;
48
+ }
49
+ case 'count': {
50
+ const countOp = new base_1.CountOperation(ENTITY_TYPE, this);
51
+ const count = await countOp.execute(i);
52
+ returnData.push({
53
+ json: {
54
+ count,
55
+ entityType: ENTITY_TYPE,
56
+ },
57
+ });
58
+ break;
59
+ }
60
+ case 'delete': {
61
+ console.log('Debug: Starting delete operation');
62
+ const deleteOp = new base_1.DeleteOperation(ENTITY_TYPE, this);
63
+ console.log('Debug: Created DeleteOperation instance');
64
+ await deleteOp.execute(i);
65
+ console.log('Debug: Delete operation completed');
66
+ returnData.push({
67
+ json: {
68
+ success: true,
69
+ message: `Holiday with ID ${this.getNodeParameter('id', i)} was deleted successfully`,
70
+ }
71
+ });
72
+ break;
73
+ }
74
+ case 'getEntityInfo':
75
+ case 'getFieldInfo': {
76
+ const response = await (0, entityInfo_execute_1.executeEntityInfoOperations)(operation, ENTITY_TYPE, this, i, 'holidaySet');
77
+ returnData.push(response);
78
+ break;
79
+ }
80
+ default:
81
+ throw new Error(`Operation ${operation} is not supported`);
82
+ }
83
+ }
84
+ catch (error) {
85
+ if (this.continueOnFail()) {
86
+ returnData.push({ json: { error: error.message } });
87
+ continue;
88
+ }
89
+ throw error;
90
+ }
91
+ }
92
+ return [returnData];
93
+ }
94
+ //# sourceMappingURL=execute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../../nodes/Autotask/resources/holidays/execute.ts"],"names":[],"mappings":";;AAeA,0DAkGC;AA/GD,gDAO+B;AAC/B,mFAAyF;AACzF,iFAA2F;AAE3F,MAAM,WAAW,GAAG,SAAS,CAAC;AAEvB,KAAK,UAAU,uBAAuB;IAG5C,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;IAClC,MAAM,UAAU,GAAyB,EAAE,CAAC;IAC5C,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAW,CAAC;IAElE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,IAAI,CAAC;YACJ,Q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C;oBAC1B,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;oBACjD,UAAU,CAAC,IAAI,CAAC;wBACf,IAAI,EAAE;4BACL,OAAO,EAAE,IAAI;4BACb,OAAO,EAAE,mBAAmB,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAC,2BAA2B;yBACrF;qBACD,CAAC,CAAC;oBACH,MAAM;gBACP,CAAC;gBAED,KAAK,eAAe,CAAC;gBACrB,KAAK,cAAc,CAAC,CAAC,CAAC;oBACrB,MAAM,QAAQ,GAAG,MAAM,IAAA,gDAA2B,EAAC,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,EAAE,YAAY,CAAC,CAAC;oBAClG,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;oBAC1B,MAAM;gBACP,CAAC;gBAED;oBACC,MAAM,IAAI,KAAK,CAAC,aAAa,SAAS,mBAAmB,CAAC,CAAC;YAC7D,CAAC;QACF,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;gBAC3B,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBACpD,SAAS;YACV,CAAC;YACD,MAAM,KAAK,CAAC;QACb,CAAC;IACF,CAAC;IAED,OAAO,CAAC,UAAU,CAAC,CAAC;AACrB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './description';
2
+ export * from './execute';
@@ -0,0 +1,19 @@
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("./description"), exports);
18
+ __exportStar(require("./execute"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Autotask/resources/holidays/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,4CAA0B"}
@@ -0,0 +1,2 @@
1
+ import type { INodeProperties } from 'n8n-workflow';
2
+ export declare const serviceCallFields: INodeProperties[];
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.serviceCallFields = void 0;
4
+ const operationOptions = [
5
+ {
6
+ name: 'Create',
7
+ value: 'create',
8
+ description: 'Create a service call',
9
+ action: 'Create a service call',
10
+ },
11
+ {
12
+ name: 'Update',
13
+ value: 'update',
14
+ description: 'Update a service call',
15
+ action: 'Update a service call',
16
+ },
17
+ {
18
+ name: 'Get',
19
+ value: 'get',
20
+ description: 'Get a service call by ID',
21
+ action: 'Get a service call',
22
+ },
23
+ {
24
+ name: 'Get Many',
25
+ value: 'getMany',
26
+ description: 'Get multiple service calls using field filters',
27
+ action: 'Get multiple service calls',
28
+ },
29
+ {
30
+ name: 'Delete',
31
+ value: 'delete',
32
+ description: 'Delete a service call',
33
+ action: 'Delete a service call',
34
+ },
35
+ {
36
+ name: 'Count',
37
+ value: 'count',
38
+ description: 'Count number of service calls',
39
+ action: 'Count service calls',
40
+ },
41
+ ];
42
+ const baseFields = [
43
+ {
44
+ displayName: 'Operation',
45
+ name: 'operation',
46
+ type: 'options',
47
+ noDataExpression: true,
48
+ displayOptions: {
49
+ show: {
50
+ resource: [
51
+ 'serviceCall',
52
+ ],
53
+ },
54
+ },
55
+ options: operationOptions,
56
+ default: 'get',
57
+ },
58
+ {
59
+ displayName: 'Service Call ID',
60
+ name: 'id',
61
+ type: 'string',
62
+ required: true,
63
+ default: '',
64
+ displayOptions: {
65
+ show: {
66
+ resource: ['serviceCall'],
67
+ operation: ['update', 'get', 'delete'],
68
+ },
69
+ },
70
+ description: 'The ID of the service call to operate on',
71
+ },
72
+ {
73
+ displayName: 'Fields',
74
+ name: 'fieldsToMap',
75
+ type: 'resourceMapper',
76
+ default: {
77
+ mappingMode: 'defineBelow',
78
+ value: null,
79
+ },
80
+ required: true,
81
+ displayOptions: {
82
+ show: {
83
+ resource: ['serviceCall'],
84
+ operation: ['create', 'update', 'getMany', 'count'],
85
+ },
86
+ },
87
+ typeOptions: {
88
+ loadOptionsDependsOn: ['resource', 'operation'],
89
+ resourceMapper: {
90
+ resourceMapperMethod: 'getFields',
91
+ mode: 'add',
92
+ fieldWords: {
93
+ singular: 'field',
94
+ plural: 'fields',
95
+ },
96
+ addAllFields: false,
97
+ multiKeyMatch: true,
98
+ supportAutoMap: true,
99
+ },
100
+ },
101
+ },
102
+ ];
103
+ exports.serviceCallFields = baseFields;
104
+ //# sourceMappingURL=description.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"description.js","sourceRoot":"","sources":["../../../../../nodes/Autotask/resources/serviceCalls/description.ts"],"names":[],"mappings":";;;AAEA,MAAM,gBAAgB,GAAG;IACxB;QACC,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,QAAQ;QACf,WAAW,EAAE,uBAAuB;QACpC,MAAM,EAAE,uBAAuB;KAC/B;IACD;QACC,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,QAAQ;QACf,WAAW,EAAE,uBAAuB;QACpC,MAAM,EAAE,uBAAuB;KAC/B;IACD;QACC,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,KAAK;QACZ,WAAW,EAAE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,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC;aACnD;SACD;QACD,WAAW,EAAE;YACZ,oBAAoB,EAAE,CAAC,UAAU,EAAE,WAAW,CAAC;YAC/C,cAAc,EAAE;gBACf,oBAAoB,EAAE,WAAW;gBACjC,IAAI,EAAE,KAAK;gBACX,UAAU,EAAE;oBACX,QAAQ,EAAE,OAAO;oBACjB,MAAM,EAAE,QAAQ;iBAChB;gBACD,YAAY,EAAE,KAAK;gBACnB,aAAa,EAAE,IAAI;gBACnB,cAAc,EAAE,IAAI;aACpB;SACD;KACD;CACD,CAAC;AAEW,QAAA,iBAAiB,GAAG,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
2
+ export declare function executeServiceCallOperation(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.executeServiceCallOperation = executeServiceCallOperation;
4
+ const base_1 = require("../../operations/base");
5
+ const entityInfo_execute_1 = require("../../operations/common/entityInfo.execute");
6
+ const get_many_advanced_1 = require("../../operations/common/get-many-advanced");
7
+ const ENTITY_TYPE = 'servicecall';
8
+ async function executeServiceCallOperation() {
9
+ const items = this.getInputData();
10
+ const returnData = [];
11
+ const operation = this.getNodeParameter('operation', 0);
12
+ for (let i = 0; i < items.length; i++) {
13
+ try {
14
+ switch (operation) {
15
+ case 'create': {
16
+ const createOp = new base_1.CreateOperation(ENTITY_TYPE, this);
17
+ const response = await createOp.execute(i);
18
+ returnData.push({ json: response });
19
+ break;
20
+ }
21
+ case 'update': {
22
+ const serviceCallId = this.getNodeParameter('id', i);
23
+ const updateOp = new base_1.UpdateOperation(ENTITY_TYPE, this);
24
+ const response = await updateOp.execute(i, serviceCallId);
25
+ returnData.push({ json: response });
26
+ break;
27
+ }
28
+ case 'get': {
29
+ const getOp = new base_1.GetOperation(ENTITY_TYPE, this);
30
+ const response = await getOp.execute(i);
31
+ returnData.push({ json: response });
32
+ break;
33
+ }
34
+ case 'getMany': {
35
+ const getManyOp = new base_1.GetManyOperation(ENTITY_TYPE, this);
36
+ const filters = getManyOp.buildFiltersFromResourceMapper(i);
37
+ const response = await getManyOp.execute({ filter: filters }, i);
38
+ returnData.push(...getManyOp.processReturnData(response));
39
+ break;
40
+ }
41
+ case 'delete': {
42
+ const deleteOp = new base_1.DeleteOperation(ENTITY_TYPE, this);
43
+ await deleteOp.execute(i);
44
+ returnData.push({ json: { success: true } });
45
+ break;
46
+ }
47
+ case 'count': {
48
+ const countOp = new base_1.CountOperation(ENTITY_TYPE, this);
49
+ const count = await countOp.execute(i);
50
+ returnData.push({
51
+ json: {
52
+ count,
53
+ entityType: ENTITY_TYPE,
54
+ },
55
+ });
56
+ break;
57
+ }
58
+ case 'getManyAdvanced': {
59
+ const results = await get_many_advanced_1.handleGetManyAdvancedOperation.call(this, ENTITY_TYPE, i);
60
+ returnData.push(...results);
61
+ break;
62
+ }
63
+ case 'getEntityInfo':
64
+ case 'getFieldInfo': {
65
+ const response = await (0, entityInfo_execute_1.executeEntityInfoOperations)(operation, ENTITY_TYPE, this, i);
66
+ returnData.push(response);
67
+ break;
68
+ }
69
+ default:
70
+ throw new Error(`Operation ${operation} is not supported`);
71
+ }
72
+ }
73
+ catch (error) {
74
+ if (this.continueOnFail()) {
75
+ returnData.push({ json: { error: error.message } });
76
+ continue;
77
+ }
78
+ throw error;
79
+ }
80
+ }
81
+ return [returnData];
82
+ }
83
+ //# sourceMappingURL=execute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../../nodes/Autotask/resources/serviceCalls/execute.ts"],"names":[],"mappings":";;AAeA,kEAqFC;AAlGD,gDAO+B;AAC/B,mFAAyF;AACzF,iFAA2F;AAE3F,MAAM,WAAW,GAAG,aAAa,CAAC;AAE3B,KAAK,UAAU,2BAA2B;IAGhD,MAAM,KAAK,GAAG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,OAAO,CAAC,CAAC;oBAC5B,MAAM;gBACP,CAAC;gBAED,KAAK,eAAe,CAAC;gBACrB,KAAK,cAAc,CAAC,CAAC,CAAC;oBACrB,MAAM,QAAQ,GAAG,MAAM,IAAA,gDAA2B,EAAC,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;oBACpF,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;oBAC1B,MAAM;gBACP,CAAC;gBAED;oBACC,MAAM,IAAI,KAAK,CAAC,aAAa,SAAS,mBAAmB,CAAC,CAAC;YAC7D,CAAC;QACF,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;gBAC3B,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBACpD,SAAS;YACV,CAAC;YACD,MAAM,KAAK,CAAC;QACb,CAAC;IACF,CAAC;IAED,OAAO,CAAC,UAAU,CAAC,CAAC;AACrB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './description';
2
+ export * from './execute';
@@ -0,0 +1,19 @@
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("./description"), exports);
18
+ __exportStar(require("./execute"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Autotask/resources/serviceCalls/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,4CAA0B"}
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-autotask",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "n8n node for Autotask PSA integration",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "repository": {
19
19
  "type": "git",
20
- "url": "https://github.com/msoukhomlinov/n8n-nodes-autotask.git"
20
+ "url": "git+https://github.com/msoukhomlinov/n8n-nodes-autotask.git"
21
21
  },
22
22
  "engines": {
23
23
  "node": ">=18.10",