@marcfargas/odoo-client 0.0.1 → 0.2.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 +165 -165
- package/README.md +115 -3
- package/dist/client/config.d.ts +49 -0
- package/dist/client/config.d.ts.map +1 -0
- package/dist/client/config.js +75 -0
- package/dist/client/config.js.map +1 -0
- package/dist/client/index.d.ts +3 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +10 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/odoo-client.d.ts +227 -0
- package/dist/client/odoo-client.d.ts.map +1 -0
- package/dist/client/odoo-client.js +298 -0
- package/dist/client/odoo-client.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/rpc/index.d.ts +2 -0
- package/dist/rpc/index.d.ts.map +1 -0
- package/dist/rpc/index.js +7 -0
- package/dist/rpc/index.js.map +1 -0
- package/dist/rpc/transport.d.ts +77 -0
- package/dist/rpc/transport.d.ts.map +1 -0
- package/dist/rpc/transport.js +207 -0
- package/dist/rpc/transport.js.map +1 -0
- package/dist/rpc/types.d.ts +25 -0
- package/dist/rpc/types.d.ts.map +1 -0
- package/dist/rpc/types.js +6 -0
- package/dist/rpc/types.js.map +1 -0
- package/dist/safety/index.d.ts +68 -0
- package/dist/safety/index.d.ts.map +1 -0
- package/dist/safety/index.js +86 -0
- package/dist/safety/index.js.map +1 -0
- package/dist/services/attendance/attendance-service.d.ts +100 -0
- package/dist/services/attendance/attendance-service.d.ts.map +1 -0
- package/dist/services/attendance/attendance-service.js +113 -0
- package/dist/services/attendance/attendance-service.js.map +1 -0
- package/dist/services/attendance/functions.d.ts +72 -0
- package/dist/services/attendance/functions.d.ts.map +1 -0
- package/dist/services/attendance/functions.js +169 -0
- package/dist/services/attendance/functions.js.map +1 -0
- package/dist/services/attendance/index.d.ts +4 -0
- package/dist/services/attendance/index.d.ts.map +1 -0
- package/dist/services/attendance/index.js +12 -0
- package/dist/services/attendance/index.js.map +1 -0
- package/dist/services/attendance/types.d.ts +53 -0
- package/dist/services/attendance/types.d.ts.map +1 -0
- package/dist/services/attendance/types.js +8 -0
- package/dist/services/attendance/types.js.map +1 -0
- package/dist/services/index.d.ts +24 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +40 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/mail/functions.d.ts +69 -0
- package/dist/services/mail/functions.d.ts.map +1 -0
- package/dist/services/mail/functions.js +124 -0
- package/dist/services/mail/functions.js.map +1 -0
- package/dist/services/mail/index.d.ts +4 -0
- package/dist/services/mail/index.d.ts.map +1 -0
- package/dist/services/mail/index.js +10 -0
- package/dist/services/mail/index.js.map +1 -0
- package/dist/services/mail/mail-service.d.ts +57 -0
- package/dist/services/mail/mail-service.d.ts.map +1 -0
- package/dist/services/mail/mail-service.js +66 -0
- package/dist/services/mail/mail-service.js.map +1 -0
- package/dist/services/mail/types.d.ts +23 -0
- package/dist/services/mail/types.d.ts.map +1 -0
- package/dist/services/mail/types.js +6 -0
- package/dist/services/mail/types.js.map +1 -0
- package/dist/services/modules/index.d.ts +2 -0
- package/dist/services/modules/index.d.ts.map +1 -0
- package/dist/services/modules/index.js +6 -0
- package/dist/services/modules/index.js.map +1 -0
- package/dist/services/modules/module-manager.d.ts +136 -0
- package/dist/services/modules/module-manager.d.ts.map +1 -0
- package/dist/services/modules/module-manager.js +255 -0
- package/dist/services/modules/module-manager.js.map +1 -0
- package/dist/services/timesheets/functions.d.ts +75 -0
- package/dist/services/timesheets/functions.d.ts.map +1 -0
- package/dist/services/timesheets/functions.js +220 -0
- package/dist/services/timesheets/functions.js.map +1 -0
- package/dist/services/timesheets/index.d.ts +4 -0
- package/dist/services/timesheets/index.d.ts.map +1 -0
- package/dist/services/timesheets/index.js +12 -0
- package/dist/services/timesheets/index.js.map +1 -0
- package/dist/services/timesheets/timesheets-service.d.ts +121 -0
- package/dist/services/timesheets/timesheets-service.d.ts.map +1 -0
- package/dist/services/timesheets/timesheets-service.js +136 -0
- package/dist/services/timesheets/timesheets-service.js.map +1 -0
- package/dist/services/timesheets/types.d.ts +81 -0
- package/dist/services/timesheets/types.d.ts.map +1 -0
- package/dist/services/timesheets/types.js +10 -0
- package/dist/services/timesheets/types.js.map +1 -0
- package/dist/types/errors.d.ts +122 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +195 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +31 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/properties.d.ts +246 -0
- package/dist/types/properties.d.ts.map +1 -0
- package/dist/types/properties.js +56 -0
- package/dist/types/properties.js.map +1 -0
- package/package.json +28 -6
- package/index.js +0 -3
package/LICENSE
CHANGED
|
@@ -1,165 +1,165 @@
|
|
|
1
|
-
GNU LESSER GENERAL PUBLIC LICENSE
|
|
2
|
-
Version 3, 29 June 2007
|
|
3
|
-
|
|
4
|
-
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
5
|
-
Everyone is permitted to copy and distribute verbatim copies
|
|
6
|
-
of this license document, but changing it is not allowed.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
This version of the GNU Lesser General Public License incorporates
|
|
10
|
-
the terms and conditions of version 3 of the GNU General Public
|
|
11
|
-
License, supplemented by the additional permissions listed below.
|
|
12
|
-
|
|
13
|
-
0. Additional Definitions.
|
|
14
|
-
|
|
15
|
-
As used herein, "this License" refers to version 3 of the GNU Lesser
|
|
16
|
-
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
|
17
|
-
General Public License.
|
|
18
|
-
|
|
19
|
-
"The Library" refers to a covered work governed by this License,
|
|
20
|
-
other than an Application or a Combined Work as defined below.
|
|
21
|
-
|
|
22
|
-
An "Application" is any work that makes use of an interface provided
|
|
23
|
-
by the Library, but which is not otherwise based on the Library.
|
|
24
|
-
Defining a subclass of a class defined by the Library is deemed a mode
|
|
25
|
-
of using an interface provided by the Library.
|
|
26
|
-
|
|
27
|
-
A "Combined Work" is a work produced by combining or linking an
|
|
28
|
-
Application with the Library. The particular version of the Library
|
|
29
|
-
with which the Combined Work was made is also called the "Linked
|
|
30
|
-
Version".
|
|
31
|
-
|
|
32
|
-
The "Minimal Corresponding Source" for a Combined Work means the
|
|
33
|
-
Corresponding Source for the Combined Work, excluding any source code
|
|
34
|
-
for portions of the Combined Work that, considered in isolation, are
|
|
35
|
-
based on the Application, and not on the Linked Version.
|
|
36
|
-
|
|
37
|
-
The "Corresponding Application Code" for a Combined Work means the
|
|
38
|
-
object code and/or source code for the Application, including any data
|
|
39
|
-
and utility programs needed for reproducing the Combined Work from the
|
|
40
|
-
Application, but excluding the System Libraries of the Combined Work.
|
|
41
|
-
|
|
42
|
-
1. Exception to Section 3 of the GNU GPL.
|
|
43
|
-
|
|
44
|
-
You may convey a covered work under sections 3 and 4 of this License
|
|
45
|
-
without being bound by section 3 of the GNU GPL.
|
|
46
|
-
|
|
47
|
-
2. Conveying Modified Versions.
|
|
48
|
-
|
|
49
|
-
If you modify a copy of the Library, and, in your modifications, a
|
|
50
|
-
facility refers to a function or data to be supplied by an Application
|
|
51
|
-
that uses the facility (other than as an argument passed when the
|
|
52
|
-
facility is invoked), then you may convey a copy of the modified
|
|
53
|
-
version:
|
|
54
|
-
|
|
55
|
-
a) under this License, provided that you make a good faith effort to
|
|
56
|
-
ensure that, in the event an Application does not supply the
|
|
57
|
-
function or data, the facility still operates, and performs
|
|
58
|
-
whatever part of its purpose remains meaningful, or
|
|
59
|
-
|
|
60
|
-
b) under the GNU GPL, with none of the additional permissions of
|
|
61
|
-
this License applicable to that copy.
|
|
62
|
-
|
|
63
|
-
3. Object Code Incorporating Material from Library Header Files.
|
|
64
|
-
|
|
65
|
-
The object code form of an Application may incorporate material from
|
|
66
|
-
a header file that is part of the Library. You may convey such object
|
|
67
|
-
code under terms of your choice, provided that, if the incorporated
|
|
68
|
-
material is not limited to numerical parameters, data structure
|
|
69
|
-
layouts and accessors, or small macros, inline functions and templates
|
|
70
|
-
(ten or fewer lines in length), you do both of the following:
|
|
71
|
-
|
|
72
|
-
a) Give prominent notice with each copy of the object code that the
|
|
73
|
-
Library is used in it and that the Library and its use are
|
|
74
|
-
covered by this License.
|
|
75
|
-
|
|
76
|
-
b) Accompany the object code with a copy of the GNU GPL and this license
|
|
77
|
-
document.
|
|
78
|
-
|
|
79
|
-
4. Combined Works.
|
|
80
|
-
|
|
81
|
-
You may convey a Combined Work under terms of your choice that,
|
|
82
|
-
taken together, effectively do not restrict modification of the
|
|
83
|
-
portions of the Library contained in the Combined Work and reverse
|
|
84
|
-
engineering for debugging such modifications, if you also do each of
|
|
85
|
-
the following:
|
|
86
|
-
|
|
87
|
-
a) Give prominent notice with each copy of the Combined Work that
|
|
88
|
-
the Library is used in it and that the Library and its use are
|
|
89
|
-
covered by this License.
|
|
90
|
-
|
|
91
|
-
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
|
92
|
-
document.
|
|
93
|
-
|
|
94
|
-
c) For a Combined Work that displays copyright notices during
|
|
95
|
-
execution, include the copyright notice for the Library among
|
|
96
|
-
these notices, as well as a reference directing the user to the
|
|
97
|
-
copies of the GNU GPL and this license document.
|
|
98
|
-
|
|
99
|
-
d) Do one of the following:
|
|
100
|
-
|
|
101
|
-
0) Convey the Minimal Corresponding Source under the terms of this
|
|
102
|
-
License, and the Corresponding Application Code in a form
|
|
103
|
-
suitable for, and under terms that permit, the user to
|
|
104
|
-
recombine or relink the Application with a modified version of
|
|
105
|
-
the Linked Version to produce a modified Combined Work, in the
|
|
106
|
-
manner specified by section 6 of the GNU GPL for conveying
|
|
107
|
-
Corresponding Source.
|
|
108
|
-
|
|
109
|
-
1) Use a suitable shared library mechanism for linking with the
|
|
110
|
-
Library. A suitable mechanism is one that (a) uses at run time
|
|
111
|
-
a copy of the Library already present on the user's computer
|
|
112
|
-
system, and (b) will operate properly with a modified version
|
|
113
|
-
of the Library that is interface-compatible with the Linked
|
|
114
|
-
Version.
|
|
115
|
-
|
|
116
|
-
e) Provide Installation Information, but only if you would otherwise
|
|
117
|
-
be required to provide such information under section 6 of the
|
|
118
|
-
GNU GPL, and only to the extent that such information is
|
|
119
|
-
necessary to install and execute a modified version of the
|
|
120
|
-
Combined Work produced by recombining or relinking the
|
|
121
|
-
Application with a modified version of the Linked Version. (If
|
|
122
|
-
you use option 4d0, the Installation Information must accompany
|
|
123
|
-
the Minimal Corresponding Source and Corresponding Application
|
|
124
|
-
Code. If you use option 4d1, you must provide the Installation
|
|
125
|
-
Information in the manner specified by section 6 of the GNU GPL
|
|
126
|
-
for conveying Corresponding Source.)
|
|
127
|
-
|
|
128
|
-
5. Combined Libraries.
|
|
129
|
-
|
|
130
|
-
You may place library facilities that are a work based on the
|
|
131
|
-
Library side by side in a single library together with other library
|
|
132
|
-
facilities that are not Applications and are not covered by this
|
|
133
|
-
License, and convey such a combined library under terms of your
|
|
134
|
-
choice, if you do both of the following:
|
|
135
|
-
|
|
136
|
-
a) Accompany the combined library with a copy of the same work based
|
|
137
|
-
on the Library, uncombined with any other library facilities,
|
|
138
|
-
conveyed under the terms of this License.
|
|
139
|
-
|
|
140
|
-
b) Give prominent notice with the combined library that part of it
|
|
141
|
-
is a work based on the Library, and explaining where to find the
|
|
142
|
-
accompanying uncombined form of the same work.
|
|
143
|
-
|
|
144
|
-
6. Revised Versions of the GNU Lesser General Public License.
|
|
145
|
-
|
|
146
|
-
The Free Software Foundation may publish revised and/or new versions
|
|
147
|
-
of the GNU Lesser General Public License from time to time. Such new
|
|
148
|
-
versions will be similar in spirit to the present version, but may
|
|
149
|
-
differ in detail to address new problems or concerns.
|
|
150
|
-
|
|
151
|
-
Each version is given a distinguishing version number. If the
|
|
152
|
-
Library as you received it specifies that a certain numbered version
|
|
153
|
-
of the GNU Lesser General Public License "or any later version"
|
|
154
|
-
applies to it, you have the option of following the terms and
|
|
155
|
-
conditions either of that published version or of any later version
|
|
156
|
-
published by the Free Software Foundation. If the Library as you
|
|
157
|
-
received it does not specify a version number of the GNU Lesser
|
|
158
|
-
General Public License, you may choose any version of the GNU Lesser
|
|
159
|
-
General Public License ever published by the Free Software Foundation.
|
|
160
|
-
|
|
161
|
-
If the Library as you received it specifies that a proxy can decide
|
|
162
|
-
whether future versions of the GNU Lesser General Public License shall
|
|
163
|
-
apply, that proxy's public statement of acceptance of any version is
|
|
164
|
-
permanent authorization for you to choose that version for the
|
|
165
|
-
Library.
|
|
1
|
+
GNU LESSER GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 3, 29 June 2007
|
|
3
|
+
|
|
4
|
+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
5
|
+
Everyone is permitted to copy and distribute verbatim copies
|
|
6
|
+
of this license document, but changing it is not allowed.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
This version of the GNU Lesser General Public License incorporates
|
|
10
|
+
the terms and conditions of version 3 of the GNU General Public
|
|
11
|
+
License, supplemented by the additional permissions listed below.
|
|
12
|
+
|
|
13
|
+
0. Additional Definitions.
|
|
14
|
+
|
|
15
|
+
As used herein, "this License" refers to version 3 of the GNU Lesser
|
|
16
|
+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
|
17
|
+
General Public License.
|
|
18
|
+
|
|
19
|
+
"The Library" refers to a covered work governed by this License,
|
|
20
|
+
other than an Application or a Combined Work as defined below.
|
|
21
|
+
|
|
22
|
+
An "Application" is any work that makes use of an interface provided
|
|
23
|
+
by the Library, but which is not otherwise based on the Library.
|
|
24
|
+
Defining a subclass of a class defined by the Library is deemed a mode
|
|
25
|
+
of using an interface provided by the Library.
|
|
26
|
+
|
|
27
|
+
A "Combined Work" is a work produced by combining or linking an
|
|
28
|
+
Application with the Library. The particular version of the Library
|
|
29
|
+
with which the Combined Work was made is also called the "Linked
|
|
30
|
+
Version".
|
|
31
|
+
|
|
32
|
+
The "Minimal Corresponding Source" for a Combined Work means the
|
|
33
|
+
Corresponding Source for the Combined Work, excluding any source code
|
|
34
|
+
for portions of the Combined Work that, considered in isolation, are
|
|
35
|
+
based on the Application, and not on the Linked Version.
|
|
36
|
+
|
|
37
|
+
The "Corresponding Application Code" for a Combined Work means the
|
|
38
|
+
object code and/or source code for the Application, including any data
|
|
39
|
+
and utility programs needed for reproducing the Combined Work from the
|
|
40
|
+
Application, but excluding the System Libraries of the Combined Work.
|
|
41
|
+
|
|
42
|
+
1. Exception to Section 3 of the GNU GPL.
|
|
43
|
+
|
|
44
|
+
You may convey a covered work under sections 3 and 4 of this License
|
|
45
|
+
without being bound by section 3 of the GNU GPL.
|
|
46
|
+
|
|
47
|
+
2. Conveying Modified Versions.
|
|
48
|
+
|
|
49
|
+
If you modify a copy of the Library, and, in your modifications, a
|
|
50
|
+
facility refers to a function or data to be supplied by an Application
|
|
51
|
+
that uses the facility (other than as an argument passed when the
|
|
52
|
+
facility is invoked), then you may convey a copy of the modified
|
|
53
|
+
version:
|
|
54
|
+
|
|
55
|
+
a) under this License, provided that you make a good faith effort to
|
|
56
|
+
ensure that, in the event an Application does not supply the
|
|
57
|
+
function or data, the facility still operates, and performs
|
|
58
|
+
whatever part of its purpose remains meaningful, or
|
|
59
|
+
|
|
60
|
+
b) under the GNU GPL, with none of the additional permissions of
|
|
61
|
+
this License applicable to that copy.
|
|
62
|
+
|
|
63
|
+
3. Object Code Incorporating Material from Library Header Files.
|
|
64
|
+
|
|
65
|
+
The object code form of an Application may incorporate material from
|
|
66
|
+
a header file that is part of the Library. You may convey such object
|
|
67
|
+
code under terms of your choice, provided that, if the incorporated
|
|
68
|
+
material is not limited to numerical parameters, data structure
|
|
69
|
+
layouts and accessors, or small macros, inline functions and templates
|
|
70
|
+
(ten or fewer lines in length), you do both of the following:
|
|
71
|
+
|
|
72
|
+
a) Give prominent notice with each copy of the object code that the
|
|
73
|
+
Library is used in it and that the Library and its use are
|
|
74
|
+
covered by this License.
|
|
75
|
+
|
|
76
|
+
b) Accompany the object code with a copy of the GNU GPL and this license
|
|
77
|
+
document.
|
|
78
|
+
|
|
79
|
+
4. Combined Works.
|
|
80
|
+
|
|
81
|
+
You may convey a Combined Work under terms of your choice that,
|
|
82
|
+
taken together, effectively do not restrict modification of the
|
|
83
|
+
portions of the Library contained in the Combined Work and reverse
|
|
84
|
+
engineering for debugging such modifications, if you also do each of
|
|
85
|
+
the following:
|
|
86
|
+
|
|
87
|
+
a) Give prominent notice with each copy of the Combined Work that
|
|
88
|
+
the Library is used in it and that the Library and its use are
|
|
89
|
+
covered by this License.
|
|
90
|
+
|
|
91
|
+
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
|
92
|
+
document.
|
|
93
|
+
|
|
94
|
+
c) For a Combined Work that displays copyright notices during
|
|
95
|
+
execution, include the copyright notice for the Library among
|
|
96
|
+
these notices, as well as a reference directing the user to the
|
|
97
|
+
copies of the GNU GPL and this license document.
|
|
98
|
+
|
|
99
|
+
d) Do one of the following:
|
|
100
|
+
|
|
101
|
+
0) Convey the Minimal Corresponding Source under the terms of this
|
|
102
|
+
License, and the Corresponding Application Code in a form
|
|
103
|
+
suitable for, and under terms that permit, the user to
|
|
104
|
+
recombine or relink the Application with a modified version of
|
|
105
|
+
the Linked Version to produce a modified Combined Work, in the
|
|
106
|
+
manner specified by section 6 of the GNU GPL for conveying
|
|
107
|
+
Corresponding Source.
|
|
108
|
+
|
|
109
|
+
1) Use a suitable shared library mechanism for linking with the
|
|
110
|
+
Library. A suitable mechanism is one that (a) uses at run time
|
|
111
|
+
a copy of the Library already present on the user's computer
|
|
112
|
+
system, and (b) will operate properly with a modified version
|
|
113
|
+
of the Library that is interface-compatible with the Linked
|
|
114
|
+
Version.
|
|
115
|
+
|
|
116
|
+
e) Provide Installation Information, but only if you would otherwise
|
|
117
|
+
be required to provide such information under section 6 of the
|
|
118
|
+
GNU GPL, and only to the extent that such information is
|
|
119
|
+
necessary to install and execute a modified version of the
|
|
120
|
+
Combined Work produced by recombining or relinking the
|
|
121
|
+
Application with a modified version of the Linked Version. (If
|
|
122
|
+
you use option 4d0, the Installation Information must accompany
|
|
123
|
+
the Minimal Corresponding Source and Corresponding Application
|
|
124
|
+
Code. If you use option 4d1, you must provide the Installation
|
|
125
|
+
Information in the manner specified by section 6 of the GNU GPL
|
|
126
|
+
for conveying Corresponding Source.)
|
|
127
|
+
|
|
128
|
+
5. Combined Libraries.
|
|
129
|
+
|
|
130
|
+
You may place library facilities that are a work based on the
|
|
131
|
+
Library side by side in a single library together with other library
|
|
132
|
+
facilities that are not Applications and are not covered by this
|
|
133
|
+
License, and convey such a combined library under terms of your
|
|
134
|
+
choice, if you do both of the following:
|
|
135
|
+
|
|
136
|
+
a) Accompany the combined library with a copy of the same work based
|
|
137
|
+
on the Library, uncombined with any other library facilities,
|
|
138
|
+
conveyed under the terms of this License.
|
|
139
|
+
|
|
140
|
+
b) Give prominent notice with the combined library that part of it
|
|
141
|
+
is a work based on the Library, and explaining where to find the
|
|
142
|
+
accompanying uncombined form of the same work.
|
|
143
|
+
|
|
144
|
+
6. Revised Versions of the GNU Lesser General Public License.
|
|
145
|
+
|
|
146
|
+
The Free Software Foundation may publish revised and/or new versions
|
|
147
|
+
of the GNU Lesser General Public License from time to time. Such new
|
|
148
|
+
versions will be similar in spirit to the present version, but may
|
|
149
|
+
differ in detail to address new problems or concerns.
|
|
150
|
+
|
|
151
|
+
Each version is given a distinguishing version number. If the
|
|
152
|
+
Library as you received it specifies that a certain numbered version
|
|
153
|
+
of the GNU Lesser General Public License "or any later version"
|
|
154
|
+
applies to it, you have the option of following the terms and
|
|
155
|
+
conditions either of that published version or of any later version
|
|
156
|
+
published by the Free Software Foundation. If the Library as you
|
|
157
|
+
received it does not specify a version number of the GNU Lesser
|
|
158
|
+
General Public License, you may choose any version of the GNU Lesser
|
|
159
|
+
General Public License ever published by the Free Software Foundation.
|
|
160
|
+
|
|
161
|
+
If the Library as you received it specifies that a proxy can decide
|
|
162
|
+
whether future versions of the GNU Lesser General Public License shall
|
|
163
|
+
apply, that proxy's public statement of acceptance of any version is
|
|
164
|
+
permanent authorization for you to choose that version for the
|
|
165
|
+
Library.
|
package/README.md
CHANGED
|
@@ -1,9 +1,121 @@
|
|
|
1
1
|
# @marcfargas/odoo-client
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Lightweight TypeScript client for Odoo RPC operations.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- `createClient()` one-liner: reads env vars, authenticates, ready to use
|
|
8
|
+
- CRUD operations: `searchRead`, `search`, `create`, `write`, `unlink`, `read`, `searchCount`
|
|
9
|
+
- Service accessors: `client.mail.*` (chatter), `client.modules.*` (module management)
|
|
10
|
+
- Safety guards for dangerous operations
|
|
11
|
+
- JSON-RPC transport with session management
|
|
12
|
+
- Comprehensive error types: `OdooAuthError`, `OdooNetworkError`, `OdooValidationError`
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install @marcfargas/odoo-client
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
**Prerequisites**: Node.js ≥ 18, a running Odoo v17 instance.
|
|
21
|
+
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { createClient } from '@marcfargas/odoo-client';
|
|
26
|
+
|
|
27
|
+
// Reads ODOO_URL, ODOO_DB, ODOO_USER, ODOO_PASSWORD from environment
|
|
28
|
+
const client = await createClient();
|
|
29
|
+
|
|
30
|
+
// Search
|
|
31
|
+
const partners = await client.searchRead('res.partner',
|
|
32
|
+
[['name', 'ilike', 'John']],
|
|
33
|
+
['name', 'email']
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
// Create
|
|
37
|
+
const newId = await client.create('res.partner', { name: 'Acme Corp' });
|
|
38
|
+
|
|
39
|
+
// Update
|
|
40
|
+
await client.write('res.partner', [newId], { email: 'info@acme.com' });
|
|
41
|
+
|
|
42
|
+
// Delete (requires safety context)
|
|
43
|
+
await client.unlink('res.partner', [newId]);
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Environment variables** (required for `createClient()`):
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
export ODOO_URL=http://localhost:8069
|
|
50
|
+
export ODOO_DB=odoo_dev
|
|
51
|
+
export ODOO_USER=admin
|
|
52
|
+
export ODOO_PASSWORD=admin
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Service Accessors
|
|
56
|
+
|
|
57
|
+
### Mail (Chatter)
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
// Internal note (visible only to internal users)
|
|
61
|
+
await client.mail.postInternalNote('res.partner', partnerId, {
|
|
62
|
+
body: '<p>Customer called about invoice</p>',
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// Public message (visible to followers including portal users)
|
|
66
|
+
await client.mail.postOpenMessage('res.partner', partnerId, {
|
|
67
|
+
body: '<p>Your order has been shipped</p>',
|
|
68
|
+
});
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Module Management
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
// Check if a module is installed
|
|
75
|
+
const hasCRM = await client.modules.isModuleInstalled('crm');
|
|
76
|
+
|
|
77
|
+
// List installed modules
|
|
78
|
+
const installed = await client.modules.listModules({ state: 'installed' });
|
|
79
|
+
|
|
80
|
+
// Get module info
|
|
81
|
+
const info = await client.modules.getModuleInfo('sale');
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
> ⚠️ `installModule()` and `uninstallModule()` are admin-only, irreversible operations.
|
|
85
|
+
> Never call them without explicit user confirmation.
|
|
86
|
+
|
|
87
|
+
## Advanced: Manual Client Construction
|
|
88
|
+
|
|
89
|
+
For custom configurations, use `OdooClient` directly:
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
import { OdooClient } from '@marcfargas/odoo-client';
|
|
93
|
+
|
|
94
|
+
const client = new OdooClient({
|
|
95
|
+
url: 'http://localhost:8069',
|
|
96
|
+
database: 'odoo_dev',
|
|
97
|
+
username: 'admin',
|
|
98
|
+
password: 'admin',
|
|
99
|
+
context: { lang: 'en_US' },
|
|
100
|
+
timeoutMs: 30000,
|
|
101
|
+
});
|
|
102
|
+
await client.authenticate();
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Tested Examples
|
|
106
|
+
|
|
107
|
+
For comprehensive, tested examples of Odoo patterns — CRUD, search, domains, field types, and more — see the [knowledge modules](../../skills/odoo/SKILL.md).
|
|
108
|
+
|
|
109
|
+
## Related Packages
|
|
110
|
+
|
|
111
|
+
- [@marcfargas/odoo-introspection](../odoo-introspection) — Schema introspection and code generation
|
|
112
|
+
- [@marcfargas/odoo-state-manager](../odoo-state-manager) — State management and drift detection
|
|
113
|
+
- [@marcfargas/create-odoo-skills](../create-skills) — CLI for scaffolding AI agent skill projects
|
|
114
|
+
|
|
115
|
+
## Bugs & Support
|
|
116
|
+
|
|
117
|
+
[GitHub Issues](https://github.com/marcfargas/odoo-toolbox/issues)
|
|
6
118
|
|
|
7
119
|
## License
|
|
8
120
|
|
|
9
|
-
LGPL-3.0
|
|
121
|
+
LGPL-3.0 — see [LICENSE](./LICENSE)
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration and factory helpers for OdooClient.
|
|
3
|
+
*
|
|
4
|
+
* Quick start:
|
|
5
|
+
* const client = await createClient(); // reads ODOO_* env vars
|
|
6
|
+
* const client = await createClient('ODOO_PROD'); // reads ODOO_PROD_* env vars
|
|
7
|
+
*/
|
|
8
|
+
import type { OdooClientConfig } from './odoo-client';
|
|
9
|
+
import { OdooClient } from './odoo-client';
|
|
10
|
+
/**
|
|
11
|
+
* Create an OdooClientConfig from environment variables.
|
|
12
|
+
*
|
|
13
|
+
* Reads: {prefix}_URL, {prefix}_DB (or {prefix}_DATABASE),
|
|
14
|
+
* {prefix}_USER (or {prefix}_USERNAME), {prefix}_PASSWORD
|
|
15
|
+
*
|
|
16
|
+
* @param prefix - Environment variable prefix (default: 'ODOO')
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* const config = configFromEnv(); // ODOO_URL, ODOO_DB, ...
|
|
20
|
+
* const config = configFromEnv('ODOO_PROD'); // ODOO_PROD_URL, ODOO_PROD_DB, ...
|
|
21
|
+
*/
|
|
22
|
+
export declare function configFromEnv(prefix?: string): OdooClientConfig;
|
|
23
|
+
/**
|
|
24
|
+
* Create an authenticated OdooClient from environment variables.
|
|
25
|
+
*
|
|
26
|
+
* This is the recommended one-liner for scripts and agents:
|
|
27
|
+
*
|
|
28
|
+
* ```typescript
|
|
29
|
+
* import { createClient } from '@marcfargas/odoo-client';
|
|
30
|
+
*
|
|
31
|
+
* const client = await createClient();
|
|
32
|
+
* await client.mail.postInternalNote('crm.lead', 42, '<p>Done.</p>');
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* Reads ODOO_URL, ODOO_DB, ODOO_USER, ODOO_PASSWORD from environment.
|
|
36
|
+
* Use a prefix for multi-instance setups:
|
|
37
|
+
*
|
|
38
|
+
* ```typescript
|
|
39
|
+
* const prod = await createClient('ODOO_PROD'); // ODOO_PROD_URL, ...
|
|
40
|
+
* const staging = await createClient('ODOO_STG'); // ODOO_STG_URL, ...
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @param prefix - Environment variable prefix (default: 'ODOO')
|
|
44
|
+
* @returns Authenticated OdooClient, ready to use
|
|
45
|
+
* @throws OdooError if env vars are missing
|
|
46
|
+
* @throws OdooAuthError if credentials are invalid
|
|
47
|
+
*/
|
|
48
|
+
export declare function createClient(prefix?: string): Promise<OdooClient>;
|
|
49
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/client/config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,MAAM,GAAE,MAAe,GAAG,gBAAgB,CAiBvE;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,YAAY,CAAC,MAAM,GAAE,MAAe,GAAG,OAAO,CAAC,UAAU,CAAC,CAI/E"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Configuration and factory helpers for OdooClient.
|
|
4
|
+
*
|
|
5
|
+
* Quick start:
|
|
6
|
+
* const client = await createClient(); // reads ODOO_* env vars
|
|
7
|
+
* const client = await createClient('ODOO_PROD'); // reads ODOO_PROD_* env vars
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.configFromEnv = configFromEnv;
|
|
11
|
+
exports.createClient = createClient;
|
|
12
|
+
const errors_1 = require("../types/errors");
|
|
13
|
+
const odoo_client_1 = require("./odoo-client");
|
|
14
|
+
/**
|
|
15
|
+
* Create an OdooClientConfig from environment variables.
|
|
16
|
+
*
|
|
17
|
+
* Reads: {prefix}_URL, {prefix}_DB (or {prefix}_DATABASE),
|
|
18
|
+
* {prefix}_USER (or {prefix}_USERNAME), {prefix}_PASSWORD
|
|
19
|
+
*
|
|
20
|
+
* @param prefix - Environment variable prefix (default: 'ODOO')
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* const config = configFromEnv(); // ODOO_URL, ODOO_DB, ...
|
|
24
|
+
* const config = configFromEnv('ODOO_PROD'); // ODOO_PROD_URL, ODOO_PROD_DB, ...
|
|
25
|
+
*/
|
|
26
|
+
function configFromEnv(prefix = 'ODOO') {
|
|
27
|
+
const url = process.env[`${prefix}_URL`] || '';
|
|
28
|
+
const database = process.env[`${prefix}_DB`] || process.env[`${prefix}_DATABASE`] || '';
|
|
29
|
+
const username = process.env[`${prefix}_USER`] || process.env[`${prefix}_USERNAME`] || '';
|
|
30
|
+
const password = process.env[`${prefix}_PASSWORD`] || '';
|
|
31
|
+
const missing = [];
|
|
32
|
+
if (!url)
|
|
33
|
+
missing.push(`${prefix}_URL`);
|
|
34
|
+
if (!database)
|
|
35
|
+
missing.push(`${prefix}_DB`);
|
|
36
|
+
if (!username)
|
|
37
|
+
missing.push(`${prefix}_USER`);
|
|
38
|
+
if (!password)
|
|
39
|
+
missing.push(`${prefix}_PASSWORD`);
|
|
40
|
+
if (missing.length > 0) {
|
|
41
|
+
throw new errors_1.OdooError(`Missing environment variables: ${missing.join(', ')}`);
|
|
42
|
+
}
|
|
43
|
+
return { url, database, username, password };
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Create an authenticated OdooClient from environment variables.
|
|
47
|
+
*
|
|
48
|
+
* This is the recommended one-liner for scripts and agents:
|
|
49
|
+
*
|
|
50
|
+
* ```typescript
|
|
51
|
+
* import { createClient } from '@marcfargas/odoo-client';
|
|
52
|
+
*
|
|
53
|
+
* const client = await createClient();
|
|
54
|
+
* await client.mail.postInternalNote('crm.lead', 42, '<p>Done.</p>');
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* Reads ODOO_URL, ODOO_DB, ODOO_USER, ODOO_PASSWORD from environment.
|
|
58
|
+
* Use a prefix for multi-instance setups:
|
|
59
|
+
*
|
|
60
|
+
* ```typescript
|
|
61
|
+
* const prod = await createClient('ODOO_PROD'); // ODOO_PROD_URL, ...
|
|
62
|
+
* const staging = await createClient('ODOO_STG'); // ODOO_STG_URL, ...
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* @param prefix - Environment variable prefix (default: 'ODOO')
|
|
66
|
+
* @returns Authenticated OdooClient, ready to use
|
|
67
|
+
* @throws OdooError if env vars are missing
|
|
68
|
+
* @throws OdooAuthError if credentials are invalid
|
|
69
|
+
*/
|
|
70
|
+
async function createClient(prefix = 'ODOO') {
|
|
71
|
+
const client = new odoo_client_1.OdooClient(configFromEnv(prefix));
|
|
72
|
+
await client.authenticate();
|
|
73
|
+
return client;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/client/config.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAkBH,sCAiBC;AA2BD,oCAIC;AAhED,4CAA4C;AAE5C,+CAA2C;AAE3C;;;;;;;;;;;GAWG;AACH,SAAgB,aAAa,CAAC,SAAiB,MAAM;IACnD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;IAC/C,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;IACxF,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,OAAO,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;IAC1F,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;IAEzD,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,IAAI,CAAC,GAAG;QAAE,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,MAAM,CAAC,CAAC;IACxC,IAAI,CAAC,QAAQ;QAAE,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,KAAK,CAAC,CAAC;IAC5C,IAAI,CAAC,QAAQ;QAAE,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,OAAO,CAAC,CAAC;IAC9C,IAAI,CAAC,QAAQ;QAAE,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,WAAW,CAAC,CAAC;IAElD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,kBAAS,CAAC,kCAAkC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;AAC/C,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACI,KAAK,UAAU,YAAY,CAAC,SAAiB,MAAM;IACxD,MAAM,MAAM,GAAG,IAAI,wBAAU,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;IACrD,MAAM,MAAM,CAAC,YAAY,EAAE,CAAC;IAC5B,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createClient = exports.configFromEnv = exports.OdooClient = void 0;
|
|
4
|
+
// Core client
|
|
5
|
+
var odoo_client_1 = require("./odoo-client");
|
|
6
|
+
Object.defineProperty(exports, "OdooClient", { enumerable: true, get: function () { return odoo_client_1.OdooClient; } });
|
|
7
|
+
var config_1 = require("./config");
|
|
8
|
+
Object.defineProperty(exports, "configFromEnv", { enumerable: true, get: function () { return config_1.configFromEnv; } });
|
|
9
|
+
Object.defineProperty(exports, "createClient", { enumerable: true, get: function () { return config_1.createClient; } });
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":";;;AAAA,cAAc;AACd,6CAAkE;AAAzD,yGAAA,UAAU,OAAA;AACnB,mCAAuD;AAA9C,uGAAA,aAAa,OAAA;AAAE,sGAAA,YAAY,OAAA"}
|