n8n-nodes-base 0.163.0 → 0.164.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.
Files changed (38) hide show
  1. package/dist/credentials/OdooApi.credentials.d.ts +7 -0
  2. package/dist/credentials/OdooApi.credentials.js +46 -0
  3. package/dist/credentials/OdooApi.credentials.js.map +1 -0
  4. package/dist/credentials/WiseApi.credentials.js +10 -0
  5. package/dist/credentials/WiseApi.credentials.js.map +1 -1
  6. package/dist/nodes/Baserow/OperationDescription.js +1 -1
  7. package/dist/nodes/Function/Function.node.js +1 -0
  8. package/dist/nodes/Function/Function.node.js.map +1 -1
  9. package/dist/nodes/Odoo/GenericFunctions.d.ts +62 -0
  10. package/dist/nodes/Odoo/GenericFunctions.js +316 -0
  11. package/dist/nodes/Odoo/GenericFunctions.js.map +1 -0
  12. package/dist/nodes/Odoo/Odoo.node.d.ts +17 -0
  13. package/dist/nodes/Odoo/Odoo.node.js +440 -0
  14. package/dist/nodes/Odoo/Odoo.node.js.map +1 -0
  15. package/dist/nodes/Odoo/Odoo.node.json +20 -0
  16. package/dist/nodes/Odoo/descriptions/ContactDescription.d.ts +3 -0
  17. package/dist/nodes/Odoo/descriptions/ContactDescription.js +419 -0
  18. package/dist/nodes/Odoo/descriptions/ContactDescription.js.map +1 -0
  19. package/dist/nodes/Odoo/descriptions/CustomResourceDescription.d.ts +3 -0
  20. package/dist/nodes/Odoo/descriptions/CustomResourceDescription.js +359 -0
  21. package/dist/nodes/Odoo/descriptions/CustomResourceDescription.js.map +1 -0
  22. package/dist/nodes/Odoo/descriptions/NoteDescription.d.ts +3 -0
  23. package/dist/nodes/Odoo/descriptions/NoteDescription.js +188 -0
  24. package/dist/nodes/Odoo/descriptions/NoteDescription.js.map +1 -0
  25. package/dist/nodes/Odoo/descriptions/OpportunityDescription.d.ts +3 -0
  26. package/dist/nodes/Odoo/descriptions/OpportunityDescription.js +323 -0
  27. package/dist/nodes/Odoo/descriptions/OpportunityDescription.js.map +1 -0
  28. package/dist/nodes/Odoo/descriptions/index.d.ts +5 -0
  29. package/dist/nodes/Odoo/descriptions/index.js +16 -0
  30. package/dist/nodes/Odoo/descriptions/index.js.map +1 -0
  31. package/dist/nodes/Odoo/odoo.svg +1 -0
  32. package/dist/nodes/Wise/GenericFunctions.d.ts +5 -1
  33. package/dist/nodes/Wise/GenericFunctions.js +44 -3
  34. package/dist/nodes/Wise/GenericFunctions.js.map +1 -1
  35. package/dist/nodes/Wise/Wise.node.d.ts +2 -2
  36. package/dist/nodes/Wise/Wise.node.js +10 -4
  37. package/dist/nodes/Wise/Wise.node.js.map +1 -1
  38. package/package.json +5 -3
@@ -0,0 +1,7 @@
1
+ import { ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class OdooApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ documentationUrl: string;
6
+ properties: INodeProperties[];
7
+ }
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OdooApi = void 0;
4
+ class OdooApi {
5
+ constructor() {
6
+ this.name = 'odooApi';
7
+ this.displayName = 'Odoo API';
8
+ this.documentationUrl = 'odoo';
9
+ this.properties = [
10
+ {
11
+ displayName: 'Site URL',
12
+ name: 'url',
13
+ type: 'string',
14
+ default: '',
15
+ placeholder: 'https://my-organization.odoo.com',
16
+ required: true,
17
+ },
18
+ {
19
+ displayName: 'Username',
20
+ name: 'username',
21
+ type: 'string',
22
+ default: '',
23
+ placeholder: 'user@email.com',
24
+ required: true,
25
+ },
26
+ {
27
+ displayName: 'Password or API Key',
28
+ name: 'password',
29
+ type: 'string',
30
+ default: '',
31
+ typeOptions: {
32
+ password: true,
33
+ },
34
+ required: true,
35
+ },
36
+ {
37
+ displayName: 'Database Name',
38
+ name: 'db',
39
+ type: 'string',
40
+ default: '',
41
+ },
42
+ ];
43
+ }
44
+ }
45
+ exports.OdooApi = OdooApi;
46
+ //# sourceMappingURL=OdooApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OdooApi.credentials.js","sourceRoot":"","sources":["../../credentials/OdooApi.credentials.ts"],"names":[],"mappings":";;;AAEA,MAAa,OAAO;IAApB;QACC,SAAI,GAAG,SAAS,CAAC;QACjB,gBAAW,GAAG,UAAU,CAAC;QACzB,qBAAgB,GAAG,MAAM,CAAC;QAC1B,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,QAA6B;gBACnC,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,kCAAkC;gBAC/C,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAA6B;gBACnC,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,gBAAgB;gBAC7B,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,qBAAqB;gBAClC,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAA6B;gBACnC,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE;oBACZ,QAAQ,EAAE,IAAI;iBACd;gBACD,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,eAAe;gBAC5B,IAAI,EAAE,IAAI;gBACV,IAAI,EAAE,QAA6B;gBACnC,OAAO,EAAE,EAAE;aACX;SACD,CAAC;IACH,CAAC;CAAA;AAtCD,0BAsCC"}
@@ -29,6 +29,16 @@ class WiseApi {
29
29
  },
30
30
  ],
31
31
  },
32
+ {
33
+ displayName: 'Private Key (Optional)',
34
+ name: 'privateKey',
35
+ type: 'string',
36
+ default: '',
37
+ description: 'Optional private key used for Strong Customer Authentication (SCA). Only needed to retrieve statements, and execute transfers.',
38
+ typeOptions: {
39
+ alwaysOpenEditWindow: true,
40
+ },
41
+ },
32
42
  ];
33
43
  }
34
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"WiseApi.credentials.js","sourceRoot":"","sources":["../../credentials/WiseApi.credentials.ts"],"names":[],"mappings":";;;AAKA,MAAa,OAAO;IAApB;QACC,SAAI,GAAG,SAAS,CAAC;QACjB,gBAAW,GAAG,UAAU,CAAC;QACzB,qBAAgB,GAAG,MAAM,CAAC;QAC1B,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,aAAa;gBAC1B,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,MAAM;gBACf,OAAO,EAAE;oBACR;wBACC,IAAI,EAAE,MAAM;wBACZ,KAAK,EAAE,MAAM;qBACb;oBACD;wBACC,IAAI,EAAE,MAAM;wBACZ,KAAK,EAAE,MAAM;qBACb;iBACD;aACD;SACD,CAAC;IACH,CAAC;CAAA;AA5BD,0BA4BC"}
1
+ {"version":3,"file":"WiseApi.credentials.js","sourceRoot":"","sources":["../../credentials/WiseApi.credentials.ts"],"names":[],"mappings":";;;AAKA,MAAa,OAAO;IAApB;QACC,SAAI,GAAG,SAAS,CAAC;QACjB,gBAAW,GAAG,UAAU,CAAC;QACzB,qBAAgB,GAAG,MAAM,CAAC;QAC1B,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,aAAa;gBAC1B,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,MAAM;gBACf,OAAO,EAAE;oBACR;wBACC,IAAI,EAAE,MAAM;wBACZ,KAAK,EAAE,MAAM;qBACb;oBACD;wBACC,IAAI,EAAE,MAAM;wBACZ,KAAK,EAAE,MAAM;qBACb;iBACD;aACD;YACD;gBACC,WAAW,EAAE,wBAAwB;gBACrC,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,gIAAgI;gBAC7I,WAAW,EAAE;oBACZ,oBAAoB,EAAE,IAAI;iBAC1B;aACD;SACD,CAAC;IACH,CAAC;CAAA;AAtCD,0BAsCC"}
@@ -407,7 +407,7 @@ exports.operationFields = [
407
407
  default: {},
408
408
  options: [
409
409
  {
410
- name: 'Fields',
410
+ name: 'fields',
411
411
  displayName: 'Field',
412
412
  values: [
413
413
  {
@@ -93,6 +93,7 @@ return items;`,
93
93
  const functionCode = this.getNodeParameter('functionCode', 0);
94
94
  try {
95
95
  items = (await vm.run(`module.exports = async function() {${functionCode}\n}()`, __dirname));
96
+ items = this.helpers.normalizeItems(items);
96
97
  if (items === undefined) {
97
98
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'No data got returned. Always return an Array of items!');
98
99
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Function.node.js","sourceRoot":"","sources":["../../../nodes/Function/Function.node.ts"],"names":[],"mappings":";;;AACA,+CAMsB;AAEtB,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAElC,MAAa,QAAQ;IAArB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,UAAU;YACvB,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,2GAA2G;YACxH,QAAQ,EAAE;gBACT,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,SAAS;aAChB;YACD,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,iBAAiB;oBAC9B,IAAI,EAAE,cAAc;oBACpB,WAAW,EAAE;wBACZ,oBAAoB,EAAE,IAAI;wB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AAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;oBAC3C,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;wBACzB,MAAM,UAAU,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;wBAC3C,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE;4BACvB,KAAK,CAAC,OAAO,GAAG,GAAG,KAAK,CAAC,OAAO,UAAU,UAAU,GAAG,CAAC;yBACxD;qBACD;iBACD;gBAED,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;aAC7B;SACD;QAED,OAAO,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;CACD;AA3JD,4BA2JC"}
1
+ {"version":3,"file":"Function.node.js","sourceRoot":"","sources":["../../../nodes/Function/Function.node.ts"],"names":[],"mappings":";;;AACA,+CAMsB;AAEtB,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAElC,MAAa,QAAQ;IAArB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,UAAU;YACvB,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,2GAA2G;YACxH,QAAQ,EAAE;gBACT,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,SAAS;aAChB;YACD,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,iBAAiB;oBAC9B,IAAI,EAAE,cAAc;oBACpB,WAAW,EAAE;wBACZ,oBAAoB,EAAE,IAAI;wBAC1B,gBAAgB,EAAE,UAAU;wBAC5B,MAAM,EAAE,MAAM;wBACd,IAAI,EAAE,EAAE;qBACR;oBACD,IAAI,EAAE,QAAQ;oBACd,OA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AC3C,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;wBACzB,MAAM,UAAU,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;wBAC3C,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE;4BACvB,KAAK,CAAC,OAAO,GAAG,GAAG,KAAK,CAAC,OAAO,UAAU,UAAU,GAAG,CAAC;yBACxD;qBACD;iBACD;gBAED,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;aAC7B;SACD;QAED,OAAO,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;CACD;AA7JD,4BA6JC"}
@@ -0,0 +1,62 @@
1
+ import { IExecuteFunctions, IExecuteSingleFunctions, IHookFunctions, ILoadOptionsFunctions } from 'n8n-core';
2
+ import { IDataObject } from 'n8n-workflow';
3
+ export declare const mapOperationToJSONRPC: {
4
+ create: string;
5
+ get: string;
6
+ getAll: string;
7
+ update: string;
8
+ delete: string;
9
+ };
10
+ export declare const mapOdooResources: {
11
+ [key: string]: string;
12
+ };
13
+ export declare const mapFilterOperationToJSONRPC: {
14
+ equal: string;
15
+ notEqual: string;
16
+ greaterThen: string;
17
+ lesserThen: string;
18
+ greaterOrEqual: string;
19
+ lesserOrEqual: string;
20
+ like: string;
21
+ in: string;
22
+ notIn: string;
23
+ childOf: string;
24
+ };
25
+ export interface IOdooFilterOperations {
26
+ filter: Array<{
27
+ fieldName: string;
28
+ operator: string;
29
+ value: string;
30
+ }>;
31
+ }
32
+ export interface IOdooNameValueFields {
33
+ fields: Array<{
34
+ fieldName: string;
35
+ fieldValue: string;
36
+ }>;
37
+ }
38
+ export interface IOdooResponceFields {
39
+ fields: Array<{
40
+ field: string;
41
+ fromList?: boolean;
42
+ }>;
43
+ }
44
+ declare type OdooCRUD = 'create' | 'update' | 'delete' | 'get' | 'getAll';
45
+ export declare function odooGetDBName(databaseName: string | undefined, url: string): string;
46
+ export declare function processNameValueFields(value: IDataObject): {};
47
+ export declare function odooJSONRPCRequest(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, body: IDataObject, url: string): Promise<IDataObject | IDataObject[]>;
48
+ export declare function odooGetModelFields(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, db: string, userID: number, password: string, resource: string, url: string): Promise<IDataObject | IDataObject[]>;
49
+ export declare function odooCreate(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, db: string, userID: number, password: string, resource: string, operation: OdooCRUD, url: string, newItem: IDataObject): Promise<{
50
+ id: IDataObject | IDataObject[];
51
+ }>;
52
+ export declare function odooGet(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, db: string, userID: number, password: string, resource: string, operation: OdooCRUD, url: string, itemsID: string, fieldsToReturn?: IDataObject[]): Promise<IDataObject | IDataObject[]>;
53
+ export declare function odooGetAll(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, db: string, userID: number, password: string, resource: string, operation: OdooCRUD, url: string, filters?: IOdooFilterOperations, fieldsToReturn?: IDataObject[], limit?: number): Promise<IDataObject | IDataObject[]>;
54
+ export declare function odooUpdate(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, db: string, userID: number, password: string, resource: string, operation: OdooCRUD, url: string, itemsID: string, fieldsToUpdate: IDataObject): Promise<{
55
+ id: string;
56
+ }>;
57
+ export declare function odooDelete(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, db: string, userID: number, password: string, resource: string, operation: OdooCRUD, url: string, itemsID: string): Promise<{
58
+ success: boolean;
59
+ }>;
60
+ export declare function odooGetUserID(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, db: string, username: string, password: string, url: string): Promise<number>;
61
+ export declare function odooGetServerVersion(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, url: string): Promise<IDataObject | IDataObject[]>;
62
+ export {};
@@ -0,0 +1,316 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.odooGetServerVersion = exports.odooGetUserID = exports.odooDelete = exports.odooUpdate = exports.odooGetAll = exports.odooGet = exports.odooCreate = exports.odooGetModelFields = exports.odooJSONRPCRequest = exports.processNameValueFields = exports.odooGetDBName = exports.mapFilterOperationToJSONRPC = exports.mapOdooResources = exports.mapOperationToJSONRPC = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const serviceJSONRPC = 'object';
6
+ const methodJSONRPC = 'execute';
7
+ exports.mapOperationToJSONRPC = {
8
+ create: 'create',
9
+ get: 'read',
10
+ getAll: 'search_read',
11
+ update: 'write',
12
+ delete: 'unlink',
13
+ };
14
+ exports.mapOdooResources = {
15
+ contact: 'res.partner',
16
+ opportunity: 'crm.lead',
17
+ note: 'note.note',
18
+ };
19
+ exports.mapFilterOperationToJSONRPC = {
20
+ equal: '=',
21
+ notEqual: '!=',
22
+ greaterThen: '>',
23
+ lesserThen: '<',
24
+ greaterOrEqual: '>=',
25
+ lesserOrEqual: '<=',
26
+ like: 'like',
27
+ in: 'in',
28
+ notIn: 'not in',
29
+ childOf: 'child_of',
30
+ };
31
+ function odooGetDBName(databaseName, url) {
32
+ if (databaseName)
33
+ return databaseName;
34
+ const odooURL = new URL(url);
35
+ const hostname = odooURL.hostname;
36
+ if (!hostname)
37
+ return '';
38
+ return odooURL.hostname.split('.')[0];
39
+ }
40
+ exports.odooGetDBName = odooGetDBName;
41
+ function processFilters(value) {
42
+ var _a;
43
+ return (_a = value.filter) === null || _a === void 0 ? void 0 : _a.map((item) => {
44
+ const operator = item.operator;
45
+ item.operator = exports.mapFilterOperationToJSONRPC[operator];
46
+ return Object.values(item);
47
+ });
48
+ }
49
+ function processNameValueFields(value) {
50
+ var _a;
51
+ const data = value;
52
+ return (_a = data === null || data === void 0 ? void 0 : data.fields) === null || _a === void 0 ? void 0 : _a.reduce((acc, record) => {
53
+ return Object.assign(acc, { [record.fieldName]: record.fieldValue });
54
+ }, {});
55
+ }
56
+ exports.processNameValueFields = processNameValueFields;
57
+ async function odooJSONRPCRequest(body, url) {
58
+ try {
59
+ const options = {
60
+ headers: {
61
+ 'User-Agent': 'n8n',
62
+ Connection: 'keep-alive',
63
+ Accept: '*/*',
64
+ 'Content-Type': 'application/json',
65
+ },
66
+ method: 'POST',
67
+ body,
68
+ uri: `${url}/jsonrpc`,
69
+ json: true,
70
+ };
71
+ const responce = await this.helpers.request(options);
72
+ if (responce.error) {
73
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), responce.error.data, {
74
+ message: responce.error.data.message,
75
+ });
76
+ }
77
+ return responce.result;
78
+ }
79
+ catch (error) {
80
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
81
+ }
82
+ }
83
+ exports.odooJSONRPCRequest = odooJSONRPCRequest;
84
+ async function odooGetModelFields(db, userID, password, resource, url) {
85
+ try {
86
+ const body = {
87
+ jsonrpc: '2.0',
88
+ method: 'call',
89
+ params: {
90
+ service: serviceJSONRPC,
91
+ method: methodJSONRPC,
92
+ args: [
93
+ db,
94
+ userID,
95
+ password,
96
+ exports.mapOdooResources[resource] || resource,
97
+ 'fields_get',
98
+ [],
99
+ ['string', 'type', 'help', 'required', 'name'],
100
+ ],
101
+ },
102
+ id: Math.floor(Math.random() * 100),
103
+ };
104
+ const result = await odooJSONRPCRequest.call(this, body, url);
105
+ return result;
106
+ }
107
+ catch (error) {
108
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
109
+ }
110
+ }
111
+ exports.odooGetModelFields = odooGetModelFields;
112
+ async function odooCreate(db, userID, password, resource, operation, url, newItem) {
113
+ try {
114
+ const body = {
115
+ jsonrpc: '2.0',
116
+ method: 'call',
117
+ params: {
118
+ service: serviceJSONRPC,
119
+ method: methodJSONRPC,
120
+ args: [
121
+ db,
122
+ userID,
123
+ password,
124
+ exports.mapOdooResources[resource] || resource,
125
+ exports.mapOperationToJSONRPC[operation],
126
+ newItem || {},
127
+ ],
128
+ },
129
+ id: Math.floor(Math.random() * 100),
130
+ };
131
+ const result = await odooJSONRPCRequest.call(this, body, url);
132
+ return { id: result };
133
+ }
134
+ catch (error) {
135
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
136
+ }
137
+ }
138
+ exports.odooCreate = odooCreate;
139
+ async function odooGet(db, userID, password, resource, operation, url, itemsID, fieldsToReturn) {
140
+ try {
141
+ if (!/^\d+$/.test(itemsID) || !parseInt(itemsID, 10)) {
142
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), {
143
+ status: 'Error',
144
+ message: `Please specify a valid ID: ${itemsID}`,
145
+ });
146
+ }
147
+ const body = {
148
+ jsonrpc: '2.0',
149
+ method: 'call',
150
+ params: {
151
+ service: serviceJSONRPC,
152
+ method: methodJSONRPC,
153
+ args: [
154
+ db,
155
+ userID,
156
+ password,
157
+ exports.mapOdooResources[resource] || resource,
158
+ exports.mapOperationToJSONRPC[operation],
159
+ [+itemsID] || [],
160
+ fieldsToReturn || [],
161
+ ],
162
+ },
163
+ id: Math.floor(Math.random() * 100),
164
+ };
165
+ const result = await odooJSONRPCRequest.call(this, body, url);
166
+ return result;
167
+ }
168
+ catch (error) {
169
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
170
+ }
171
+ }
172
+ exports.odooGet = odooGet;
173
+ async function odooGetAll(db, userID, password, resource, operation, url, filters, fieldsToReturn, limit = 0) {
174
+ try {
175
+ const body = {
176
+ jsonrpc: '2.0',
177
+ method: 'call',
178
+ params: {
179
+ service: serviceJSONRPC,
180
+ method: methodJSONRPC,
181
+ args: [
182
+ db,
183
+ userID,
184
+ password,
185
+ exports.mapOdooResources[resource] || resource,
186
+ exports.mapOperationToJSONRPC[operation],
187
+ (filters && processFilters(filters)) || [],
188
+ fieldsToReturn || [],
189
+ 0,
190
+ limit,
191
+ ],
192
+ },
193
+ id: Math.floor(Math.random() * 100),
194
+ };
195
+ const result = await odooJSONRPCRequest.call(this, body, url);
196
+ return result;
197
+ }
198
+ catch (error) {
199
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
200
+ }
201
+ }
202
+ exports.odooGetAll = odooGetAll;
203
+ async function odooUpdate(db, userID, password, resource, operation, url, itemsID, fieldsToUpdate) {
204
+ try {
205
+ if (!Object.keys(fieldsToUpdate).length) {
206
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), {
207
+ status: 'Error',
208
+ message: `Please specify at least one field to update`,
209
+ });
210
+ }
211
+ if (!/^\d+$/.test(itemsID) || !parseInt(itemsID, 10)) {
212
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), {
213
+ status: 'Error',
214
+ message: `Please specify a valid ID: ${itemsID}`,
215
+ });
216
+ }
217
+ const body = {
218
+ jsonrpc: '2.0',
219
+ method: 'call',
220
+ params: {
221
+ service: serviceJSONRPC,
222
+ method: methodJSONRPC,
223
+ args: [
224
+ db,
225
+ userID,
226
+ password,
227
+ exports.mapOdooResources[resource] || resource,
228
+ exports.mapOperationToJSONRPC[operation],
229
+ [+itemsID] || [],
230
+ fieldsToUpdate,
231
+ ],
232
+ },
233
+ id: Math.floor(Math.random() * 100),
234
+ };
235
+ await odooJSONRPCRequest.call(this, body, url);
236
+ return { id: itemsID };
237
+ }
238
+ catch (error) {
239
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
240
+ }
241
+ }
242
+ exports.odooUpdate = odooUpdate;
243
+ async function odooDelete(db, userID, password, resource, operation, url, itemsID) {
244
+ if (!/^\d+$/.test(itemsID) || !parseInt(itemsID, 10)) {
245
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), {
246
+ status: 'Error',
247
+ message: `Please specify a valid ID: ${itemsID}`,
248
+ });
249
+ }
250
+ try {
251
+ const body = {
252
+ jsonrpc: '2.0',
253
+ method: 'call',
254
+ params: {
255
+ service: serviceJSONRPC,
256
+ method: methodJSONRPC,
257
+ args: [
258
+ db,
259
+ userID,
260
+ password,
261
+ exports.mapOdooResources[resource] || resource,
262
+ exports.mapOperationToJSONRPC[operation],
263
+ [+itemsID] || [],
264
+ ],
265
+ },
266
+ id: Math.floor(Math.random() * 100),
267
+ };
268
+ await odooJSONRPCRequest.call(this, body, url);
269
+ return { success: true };
270
+ }
271
+ catch (error) {
272
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
273
+ }
274
+ }
275
+ exports.odooDelete = odooDelete;
276
+ async function odooGetUserID(db, username, password, url) {
277
+ try {
278
+ const body = {
279
+ jsonrpc: '2.0',
280
+ method: 'call',
281
+ params: {
282
+ service: 'common',
283
+ method: 'login',
284
+ args: [db, username, password],
285
+ },
286
+ id: Math.floor(Math.random() * 100),
287
+ };
288
+ const loginResult = await odooJSONRPCRequest.call(this, body, url);
289
+ return loginResult;
290
+ }
291
+ catch (error) {
292
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
293
+ }
294
+ }
295
+ exports.odooGetUserID = odooGetUserID;
296
+ async function odooGetServerVersion(url) {
297
+ try {
298
+ const body = {
299
+ jsonrpc: '2.0',
300
+ method: 'call',
301
+ params: {
302
+ service: 'common',
303
+ method: 'version',
304
+ args: [],
305
+ },
306
+ id: Math.floor(Math.random() * 100),
307
+ };
308
+ const result = await odooJSONRPCRequest.call(this, body, url);
309
+ return result;
310
+ }
311
+ catch (error) {
312
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
313
+ }
314
+ }
315
+ exports.odooGetServerVersion = odooGetServerVersion;
316
+ //# sourceMappingURL=GenericFunctions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenericFunctions.js","sourceRoot":"","sources":["../../../nodes/Odoo/GenericFunctions.ts"],"names":[],"mappings":";;;AAWA,+CAIsB;AAEtB,MAAM,cAAc,GAAG,QAAQ,CAAC;AAChC,MAAM,aAAa,GAAG,SAAS,CAAC;AAEnB,QAAA,qBAAqB,GAAG;I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gBACjB,MAAM,EAAE,OAAO;gBACf,IAAI,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC;aAC9B;YACD,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC;SACnC,CAAC;QACF,MAAM,WAAW,GAAG,MAAM,kBAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;QACnE,OAAO,WAAgC,CAAC;KACxC;IAAC,OAAO,KAAK,EAAE;QACf,MAAM,IAAI,2BAAY,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAmB,CAAC,CAAC;KAC5D;AACF,CAAC;AAvBD,sCAuBC;AAEM,KAAK,UAAU,oBAAoB,CAEzC,GAAW;IAEX,IAAI;QACH,MAAM,IAAI,GAAG;YACZ,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,MAAM;YACd,MAAM,EAAE;gBACP,OAAO,EAAE,QAAQ;gBACjB,MAAM,EAAE,SAAS;gBACjB,IAAI,EAAE,EAAE;aACR;YACD,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC;SACnC,CAAC;QACF,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;QAC9D,OAAO,MAAM,CAAC;KACd;IAAC,OAAO,KAAK,EAAE;QACf,MAAM,IAAI,2BAAY,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAmB,CAAC,CAAC;KAC5D;AACF,CAAC;AApBD,oDAoBC"}
@@ -0,0 +1,17 @@
1
+ import { IExecuteFunctions } from 'n8n-core';
2
+ import { ICredentialsDecrypted, ICredentialTestFunctions, ILoadOptionsFunctions, INodeCredentialTestResult, INodeExecutionData, INodePropertyOptions, INodeType, INodeTypeDescription } from 'n8n-workflow';
3
+ export declare class Odoo implements INodeType {
4
+ description: INodeTypeDescription;
5
+ methods: {
6
+ loadOptions: {
7
+ getModelFields(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
8
+ getModels(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
9
+ getStates(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
10
+ getCountries(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
11
+ };
12
+ credentialTest: {
13
+ odooApiTest(this: ICredentialTestFunctions, credential: ICredentialsDecrypted): Promise<INodeCredentialTestResult>;
14
+ };
15
+ };
16
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
17
+ }