node-paymo-api 0.0.3 → 0.0.5

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 (194) hide show
  1. package/.prettierrc +6 -0
  2. package/README.md +24 -1
  3. package/dist/abstract.d.ts +23 -0
  4. package/dist/abstract.js +210 -0
  5. package/dist/index.d.ts +6 -0
  6. package/dist/index.js +18 -0
  7. package/dist/remote.d.ts +9 -0
  8. package/dist/remote.js +80 -0
  9. package/dist/resources/_template_/index.d.ts +18 -0
  10. package/dist/resources/_template_/index.js +34 -0
  11. package/dist/resources/_template_/types.d.ts +25 -0
  12. package/dist/resources/_template_/types.js +2 -0
  13. package/dist/resources/bookings/index.d.ts +18 -0
  14. package/dist/resources/bookings/index.js +49 -0
  15. package/dist/resources/bookings/types.d.ts +49 -0
  16. package/dist/resources/bookings/types.js +2 -0
  17. package/dist/resources/clientcontacts/index.d.ts +18 -0
  18. package/dist/resources/clientcontacts/index.js +34 -0
  19. package/dist/resources/clientcontacts/types.d.ts +59 -0
  20. package/dist/resources/clientcontacts/types.js +2 -0
  21. package/dist/resources/clients/index.d.ts +18 -0
  22. package/dist/resources/clients/index.js +34 -0
  23. package/dist/resources/clients/types.d.ts +71 -0
  24. package/dist/resources/clients/types.js +2 -0
  25. package/dist/resources/comments/Comments.d.ts +18 -0
  26. package/dist/resources/comments/Comments.js +34 -0
  27. package/dist/resources/comments/Threads.d.ts +28 -0
  28. package/dist/resources/comments/Threads.js +25 -0
  29. package/dist/resources/comments/index.d.ts +2 -0
  30. package/dist/resources/comments/index.js +7 -0
  31. package/dist/resources/comments/types.d.ts +77 -0
  32. package/dist/resources/comments/types.js +2 -0
  33. package/dist/resources/company/index.d.ts +12 -0
  34. package/dist/resources/company/index.js +25 -0
  35. package/dist/resources/company/types.d.ts +44 -0
  36. package/dist/resources/company/types.js +2 -0
  37. package/dist/resources/discussions/index.d.ts +18 -0
  38. package/dist/resources/discussions/index.js +34 -0
  39. package/dist/resources/discussions/types.d.ts +43 -0
  40. package/dist/resources/discussions/types.js +2 -0
  41. package/dist/resources/entries/index.d.ts +18 -0
  42. package/dist/resources/entries/index.js +47 -0
  43. package/dist/resources/entries/types.d.ts +53 -0
  44. package/dist/resources/entries/types.js +2 -0
  45. package/dist/resources/estimates/EstimateItem.d.ts +3 -0
  46. package/dist/resources/estimates/EstimateItem.js +5 -0
  47. package/dist/resources/estimates/Estimates.d.ts +18 -0
  48. package/dist/resources/estimates/Estimates.js +34 -0
  49. package/dist/resources/estimates/index.d.ts +2 -0
  50. package/dist/resources/estimates/index.js +7 -0
  51. package/dist/resources/estimates/types.d.ts +76 -0
  52. package/dist/resources/estimates/types.js +2 -0
  53. package/dist/resources/estimatetemplates/index.d.ts +18 -0
  54. package/dist/resources/estimatetemplates/index.js +34 -0
  55. package/dist/resources/estimatetemplates/types.d.ts +34 -0
  56. package/dist/resources/estimatetemplates/types.js +2 -0
  57. package/dist/resources/expenses/index.d.ts +18 -0
  58. package/dist/resources/expenses/index.js +34 -0
  59. package/dist/resources/expenses/types.d.ts +46 -0
  60. package/dist/resources/expenses/types.js +2 -0
  61. package/dist/resources/files/index.d.ts +18 -0
  62. package/dist/resources/files/index.js +45 -0
  63. package/dist/resources/files/types.d.ts +44 -0
  64. package/dist/resources/files/types.js +2 -0
  65. package/dist/resources/index.d.ts +117 -0
  66. package/dist/resources/index.js +200 -0
  67. package/dist/resources/invoices/InvoiceItem.d.ts +3 -0
  68. package/dist/resources/invoices/InvoiceItem.js +5 -0
  69. package/dist/resources/invoices/Invoices.d.ts +18 -0
  70. package/dist/resources/invoices/Invoices.js +34 -0
  71. package/dist/resources/invoices/index.d.ts +2 -0
  72. package/dist/resources/invoices/index.js +7 -0
  73. package/dist/resources/invoices/types.d.ts +87 -0
  74. package/dist/resources/invoices/types.js +2 -0
  75. package/dist/resources/invoicetemplates/index.d.ts +18 -0
  76. package/dist/resources/invoicetemplates/index.js +34 -0
  77. package/dist/resources/invoicetemplates/types.d.ts +34 -0
  78. package/dist/resources/invoicetemplates/types.js +2 -0
  79. package/dist/resources/milestones/index.d.ts +18 -0
  80. package/dist/resources/milestones/index.js +34 -0
  81. package/dist/resources/milestones/types.d.ts +40 -0
  82. package/dist/resources/milestones/types.js +2 -0
  83. package/dist/resources/projects/index.d.ts +20 -0
  84. package/dist/resources/projects/index.js +39 -0
  85. package/dist/resources/projects/types.d.ts +86 -0
  86. package/dist/resources/projects/types.js +14 -0
  87. package/dist/resources/projectstatuses/index.d.ts +18 -0
  88. package/dist/resources/projectstatuses/index.js +34 -0
  89. package/dist/resources/projectstatuses/types.d.ts +32 -0
  90. package/dist/resources/projectstatuses/types.js +2 -0
  91. package/dist/resources/projecttemplates/index.d.ts +18 -0
  92. package/dist/resources/projecttemplates/index.js +34 -0
  93. package/dist/resources/projecttemplates/types.d.ts +29 -0
  94. package/dist/resources/projecttemplates/types.js +2 -0
  95. package/dist/resources/reports/index.d.ts +18 -0
  96. package/dist/resources/reports/index.js +34 -0
  97. package/dist/resources/reports/types.d.ts +90 -0
  98. package/dist/resources/reports/types.js +2 -0
  99. package/dist/resources/sessions/index.d.ts +18 -0
  100. package/dist/resources/sessions/index.js +35 -0
  101. package/dist/resources/sessions/types.d.ts +28 -0
  102. package/dist/resources/sessions/types.js +2 -0
  103. package/dist/resources/tasklists/index.d.ts +18 -0
  104. package/dist/resources/tasklists/index.js +34 -0
  105. package/dist/resources/tasklists/types.d.ts +35 -0
  106. package/dist/resources/tasklists/types.js +2 -0
  107. package/dist/resources/tasks/index.d.ts +18 -0
  108. package/dist/resources/tasks/index.js +34 -0
  109. package/dist/resources/tasks/types.d.ts +64 -0
  110. package/dist/resources/tasks/types.js +2 -0
  111. package/dist/resources/users/index.d.ts +22 -0
  112. package/dist/resources/users/index.js +40 -0
  113. package/dist/resources/users/types.d.ts +86 -0
  114. package/dist/resources/users/types.js +2 -0
  115. package/dist/resources/usertasks/index.d.ts +18 -0
  116. package/dist/resources/usertasks/index.js +41 -0
  117. package/dist/resources/usertasks/types.d.ts +31 -0
  118. package/dist/resources/usertasks/types.js +2 -0
  119. package/dist/resources/workflows/index.d.ts +18 -0
  120. package/dist/resources/workflows/index.js +34 -0
  121. package/dist/resources/workflows/types.d.ts +31 -0
  122. package/dist/resources/workflows/types.js +2 -0
  123. package/dist/resources/workflowstatuses/index.d.ts +18 -0
  124. package/dist/resources/workflowstatuses/index.js +34 -0
  125. package/dist/resources/workflowstatuses/types.d.ts +35 -0
  126. package/dist/resources/workflowstatuses/types.js +2 -0
  127. package/dist/types.d.ts +25 -0
  128. package/dist/types.js +2 -0
  129. package/package.json +13 -3
  130. package/src/abstract.ts +220 -0
  131. package/src/index.ts +23 -0
  132. package/src/remote.ts +77 -0
  133. package/src/resources/_template_/index.ts +38 -0
  134. package/src/resources/_template_/types.ts +40 -0
  135. package/src/resources/bookings/index.ts +61 -0
  136. package/src/resources/bookings/types.ts +60 -0
  137. package/src/resources/clientcontacts/index.ts +38 -0
  138. package/src/resources/clientcontacts/types.ts +69 -0
  139. package/src/resources/clients/index.ts +38 -0
  140. package/src/resources/clients/types.ts +100 -0
  141. package/src/resources/comments/Comments.ts +38 -0
  142. package/src/resources/comments/Threads.ts +28 -0
  143. package/src/resources/comments/index.ts +2 -0
  144. package/src/resources/comments/types.ts +105 -0
  145. package/src/resources/company/index.ts +23 -0
  146. package/src/resources/company/types.ts +52 -0
  147. package/src/resources/discussions/index.ts +38 -0
  148. package/src/resources/discussions/types.ts +53 -0
  149. package/src/resources/entries/index.ts +52 -0
  150. package/src/resources/entries/types.ts +67 -0
  151. package/src/resources/estimates/EstimateItem.ts +6 -0
  152. package/src/resources/estimates/Estimates.ts +38 -0
  153. package/src/resources/estimates/index.ts +2 -0
  154. package/src/resources/estimates/types.ts +89 -0
  155. package/src/resources/estimatetemplates/index.ts +38 -0
  156. package/src/resources/estimatetemplates/types.ts +46 -0
  157. package/src/resources/expenses/index.ts +38 -0
  158. package/src/resources/expenses/types.ts +58 -0
  159. package/src/resources/files/index.ts +50 -0
  160. package/src/resources/files/types.ts +58 -0
  161. package/src/resources/index.ts +289 -0
  162. package/src/resources/invoices/InvoiceItem.ts +6 -0
  163. package/src/resources/invoices/Invoices.ts +38 -0
  164. package/src/resources/invoices/index.ts +2 -0
  165. package/src/resources/invoices/types.ts +102 -0
  166. package/src/resources/invoicetemplates/index.ts +38 -0
  167. package/src/resources/invoicetemplates/types.ts +46 -0
  168. package/src/resources/milestones/index.ts +38 -0
  169. package/src/resources/milestones/types.ts +52 -0
  170. package/src/resources/projects/index.ts +47 -0
  171. package/src/resources/projects/types.ts +134 -0
  172. package/src/resources/projectstatuses/index.ts +38 -0
  173. package/src/resources/projectstatuses/types.ts +44 -0
  174. package/src/resources/projecttemplates/index.ts +40 -0
  175. package/src/resources/projecttemplates/types.ts +43 -0
  176. package/src/resources/reports/index.ts +38 -0
  177. package/src/resources/reports/types.ts +104 -0
  178. package/src/resources/sessions/index.ts +39 -0
  179. package/src/resources/sessions/types.ts +43 -0
  180. package/src/resources/tasklists/index.ts +38 -0
  181. package/src/resources/tasklists/types.ts +48 -0
  182. package/src/resources/tasks/index.ts +38 -0
  183. package/src/resources/tasks/types.ts +76 -0
  184. package/src/resources/users/index.ts +48 -0
  185. package/src/resources/users/types.ts +124 -0
  186. package/src/resources/usertasks/index.ts +46 -0
  187. package/src/resources/usertasks/types.ts +43 -0
  188. package/src/resources/workflows/index.ts +38 -0
  189. package/src/resources/workflows/types.ts +43 -0
  190. package/src/resources/workflowstatuses/index.ts +38 -0
  191. package/src/resources/workflowstatuses/types.ts +47 -0
  192. package/src/types.ts +40 -0
  193. package/tsconfig.json +12 -0
  194. package/lib/index.ts +0 -6
@@ -0,0 +1,200 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const projects_1 = require("./projects");
4
+ const clients_1 = require("./clients");
5
+ const users_1 = require("./users");
6
+ const bookings_1 = require("./bookings");
7
+ const clientcontacts_1 = require("./clientcontacts");
8
+ const comments_1 = require("./comments");
9
+ const company_1 = require("./company");
10
+ const discussions_1 = require("./discussions");
11
+ const estimatetemplates_1 = require("./estimatetemplates");
12
+ const estimates_1 = require("./estimates");
13
+ const expenses_1 = require("./expenses");
14
+ const files_1 = require("./files");
15
+ const invoicetemplates_1 = require("./invoicetemplates");
16
+ const invoices_1 = require("./invoices");
17
+ const milestones_1 = require("./milestones");
18
+ const projecttemplates_1 = require("./projecttemplates");
19
+ const projectstatuses_1 = require("./projectstatuses");
20
+ const reports_1 = require("./reports");
21
+ const sessions_1 = require("./sessions");
22
+ const tasklists_1 = require("./tasklists");
23
+ const tasks_1 = require("./tasks");
24
+ const entries_1 = require("./entries");
25
+ const usertasks_1 = require("./usertasks");
26
+ const workflows_1 = require("./workflows");
27
+ const workflowstatuses_1 = require("./workflowstatuses");
28
+ const PaymoResourceHandler = class {
29
+ constructor(u, p) {
30
+ this.auth = {
31
+ userApi: '',
32
+ password: '',
33
+ };
34
+ this.handlers = {};
35
+ this.isApiUser = (apiUser) => {
36
+ return this.auth.userApi === apiUser;
37
+ };
38
+ this.projects = () => {
39
+ if (!this.handlers.projects) {
40
+ this.handlers.projects = new projects_1.Projects(this.auth);
41
+ }
42
+ return this.handlers.projects;
43
+ };
44
+ this.clients = () => {
45
+ if (!this.handlers.clients) {
46
+ this.handlers.clients = new clients_1.Clients(this.auth);
47
+ }
48
+ return this.handlers.clients;
49
+ };
50
+ this.users = () => {
51
+ if (!this.handlers.users) {
52
+ this.handlers.users = new users_1.Users(this.auth);
53
+ }
54
+ return this.handlers.users;
55
+ };
56
+ this.bookings = () => {
57
+ if (!this.handlers.bookings) {
58
+ this.handlers.bookings = new bookings_1.Bookings(this.auth);
59
+ }
60
+ return this.handlers.bookings;
61
+ };
62
+ this.clientcontacts = () => {
63
+ if (!this.handlers.clientcontacts) {
64
+ this.handlers.clientcontacts = new clientcontacts_1.ClientContacts(this.auth);
65
+ }
66
+ return this.handlers.clientcontacts;
67
+ };
68
+ this.comments = () => {
69
+ if (!this.handlers.comments) {
70
+ this.handlers.comments = new comments_1.Comments(this.auth);
71
+ }
72
+ return this.handlers.comments;
73
+ };
74
+ this.threads = () => {
75
+ if (!this.handlers.threads) {
76
+ this.handlers.threads = new comments_1.Threads(this.auth);
77
+ }
78
+ return this.handlers.threads;
79
+ };
80
+ this.company = () => {
81
+ if (!this.handlers.company) {
82
+ this.handlers.company = new company_1.Company(this.auth);
83
+ }
84
+ return this.handlers.company;
85
+ };
86
+ this.discussions = () => {
87
+ if (!this.handlers.discussions) {
88
+ this.handlers.discussions = new discussions_1.Discussions(this.auth);
89
+ }
90
+ return this.handlers.discussions;
91
+ };
92
+ this.estimatetemplates = () => {
93
+ if (!this.handlers.estimatetemplates) {
94
+ this.handlers.estimatetemplates = new estimatetemplates_1.EstimateTemplates(this.auth);
95
+ }
96
+ return this.handlers.estimatetemplates;
97
+ };
98
+ this.estimates = () => {
99
+ if (!this.handlers.estimates) {
100
+ this.handlers.estimates = new estimates_1.Estimates(this.auth);
101
+ }
102
+ return this.handlers.estimates;
103
+ };
104
+ this.expenses = () => {
105
+ if (!this.handlers.expenses) {
106
+ this.handlers.expenses = new expenses_1.Expenses(this.auth);
107
+ }
108
+ return this.handlers.expenses;
109
+ };
110
+ this.files = () => {
111
+ if (!this.handlers.files) {
112
+ this.handlers.files = new files_1.Files(this.auth);
113
+ }
114
+ return this.handlers.files;
115
+ };
116
+ this.invoicetemplates = () => {
117
+ if (!this.handlers.invoicetemplates) {
118
+ this.handlers.invoicetemplates = new invoicetemplates_1.InvoiceTemplates(this.auth);
119
+ }
120
+ return this.handlers.invoicetemplates;
121
+ };
122
+ this.invoices = () => {
123
+ if (!this.handlers.invoices) {
124
+ this.handlers.invoices = new invoices_1.Invoices(this.auth);
125
+ }
126
+ return this.handlers.invoices;
127
+ };
128
+ this.milestones = () => {
129
+ if (!this.handlers.milestones) {
130
+ this.handlers.milestones = new milestones_1.Milestones(this.auth);
131
+ }
132
+ return this.handlers.milestones;
133
+ };
134
+ this.projecttemplates = () => {
135
+ if (!this.handlers.projecttemplates) {
136
+ this.handlers.projecttemplates = new projecttemplates_1.ProjectTemplates(this.auth);
137
+ }
138
+ return this.handlers.projecttemplates;
139
+ };
140
+ this.projectstatuses = () => {
141
+ if (!this.handlers.projectstatuses) {
142
+ this.handlers.projectstatuses = new projectstatuses_1.ProjectStatuses(this.auth);
143
+ }
144
+ return this.handlers.projectstatuses;
145
+ };
146
+ this.reports = () => {
147
+ if (!this.handlers.reports) {
148
+ this.handlers.reports = new reports_1.Reports(this.auth);
149
+ }
150
+ return this.handlers.reports;
151
+ };
152
+ this.sessions = () => {
153
+ if (!this.handlers.sessions) {
154
+ this.handlers.sessions = new sessions_1.Sessions(this.auth);
155
+ }
156
+ return this.handlers.sessions;
157
+ };
158
+ this.tasklists = () => {
159
+ if (!this.handlers.tasklists) {
160
+ this.handlers.tasklists = new tasklists_1.TaskLists(this.auth);
161
+ }
162
+ return this.handlers.tasklists;
163
+ };
164
+ this.tasks = () => {
165
+ if (!this.handlers.tasks) {
166
+ this.handlers.tasks = new tasks_1.Tasks(this.auth);
167
+ }
168
+ return this.handlers.tasks;
169
+ };
170
+ this.entries = () => {
171
+ if (!this.handlers.entries) {
172
+ this.handlers.entries = new entries_1.TimeEntries(this.auth);
173
+ }
174
+ return this.handlers.entries;
175
+ };
176
+ this.usertasks = () => {
177
+ if (!this.handlers.usertasks) {
178
+ this.handlers.usertasks = new usertasks_1.UserTasks(this.auth);
179
+ }
180
+ return this.handlers.usertasks;
181
+ };
182
+ this.workflows = () => {
183
+ if (!this.handlers.workflows) {
184
+ this.handlers.workflows = new workflows_1.Workflows(this.auth);
185
+ }
186
+ return this.handlers.workflows;
187
+ };
188
+ this.workflowstatuses = () => {
189
+ if (!this.handlers.workflowstatuses) {
190
+ this.handlers.workflowstatuses = new workflowstatuses_1.WorkflowStatuses(this.auth);
191
+ }
192
+ return this.handlers.workflowstatuses;
193
+ };
194
+ this.auth = {
195
+ userApi: u,
196
+ password: p || 'paymoApi',
197
+ };
198
+ }
199
+ };
200
+ exports.default = PaymoResourceHandler;
@@ -0,0 +1,3 @@
1
+ export declare const InvoiceItem: {};
2
+ declare const _default: null;
3
+ export default _default;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InvoiceItem = void 0;
4
+ exports.InvoiceItem = {};
5
+ exports.default = null;
@@ -0,0 +1,18 @@
1
+ import { AbstractResource, AbstractResourceInterface } from '../../abstract';
2
+ import { AuthInterface } from "../../types";
3
+ import { InvoicesListConfig, InvoicesTypeCreate, InvoicesTypeResponse, InvoicesTypeUpdate } from "./types";
4
+ export interface InvoicesHandler extends AbstractResourceInterface {
5
+ get: (id: number) => Promise<InvoicesTypeResponse | null>;
6
+ list: (config?: InvoicesListConfig) => Promise<InvoicesTypeResponse[]>;
7
+ create: (d: InvoicesTypeCreate) => Promise<InvoicesTypeResponse | null>;
8
+ update: (id: number, data: InvoicesTypeUpdate) => Promise<InvoicesTypeResponse | null>;
9
+ delete: (id: number) => Promise<boolean>;
10
+ }
11
+ export declare class Invoices extends AbstractResource implements InvoicesHandler {
12
+ constructor(auth: AuthInterface);
13
+ get: (id: number) => Promise<InvoicesTypeResponse | null>;
14
+ list: (config?: InvoicesListConfig) => Promise<InvoicesTypeResponse[]>;
15
+ create: (data: InvoicesTypeCreate) => Promise<InvoicesTypeResponse | null>;
16
+ update: (id: number, data: InvoicesTypeUpdate) => Promise<InvoicesTypeResponse | null>;
17
+ delete: (id: number) => Promise<boolean>;
18
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.Invoices = void 0;
13
+ const abstract_1 = require("../../abstract");
14
+ class Invoices extends abstract_1.AbstractResource {
15
+ constructor(auth) {
16
+ super(auth, 'invoices');
17
+ this.get = (id) => __awaiter(this, void 0, void 0, function* () {
18
+ return (yield this.baseGet(id));
19
+ });
20
+ this.list = (...args_1) => __awaiter(this, [...args_1], void 0, function* (config = {}) {
21
+ return (yield this.baseList(config));
22
+ });
23
+ this.create = (data) => __awaiter(this, void 0, void 0, function* () {
24
+ return (yield this.baseCreate(data));
25
+ });
26
+ this.update = (id, data) => __awaiter(this, void 0, void 0, function* () {
27
+ return (yield this.baseUpdate(id, data));
28
+ });
29
+ this.delete = (id) => __awaiter(this, void 0, void 0, function* () {
30
+ return yield this.baseDelete(id);
31
+ });
32
+ }
33
+ }
34
+ exports.Invoices = Invoices;
@@ -0,0 +1,2 @@
1
+ export { Invoices, InvoicesHandler } from './Invoices';
2
+ export { InvoiceItem } from './InvoiceItem';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InvoiceItem = exports.Invoices = void 0;
4
+ var Invoices_1 = require("./Invoices");
5
+ Object.defineProperty(exports, "Invoices", { enumerable: true, get: function () { return Invoices_1.Invoices; } });
6
+ var InvoiceItem_1 = require("./InvoiceItem");
7
+ Object.defineProperty(exports, "InvoiceItem", { enumerable: true, get: function () { return InvoiceItem_1.InvoiceItem; } });
@@ -0,0 +1,87 @@
1
+ import { FilterOperator, GenericListConfig, Merge, PaymoCurrency } from "../../types";
2
+ export interface InvoicesTypeRead {
3
+ readonly id: number;
4
+ readonly created_on: string;
5
+ readonly updated_on: string;
6
+ readonly subtotal: number;
7
+ readonly total: number;
8
+ readonly tax_amount: number;
9
+ readonly tax2_amount: number;
10
+ readonly discount_amount: number;
11
+ readonly reminder_1_sent: boolean;
12
+ readonly reminder_2_sent: boolean;
13
+ readonly reminder_3_sent: boolean;
14
+ readonly permalink: string;
15
+ readonly pdf_link: string;
16
+ }
17
+ export interface InvoicesTypeUpdate {
18
+ number?: string;
19
+ client_id?: number;
20
+ template_id?: number;
21
+ status?: 'draft' | 'sent' | 'viewed' | 'paid' | 'void';
22
+ currency?: PaymoCurrency;
23
+ date?: string;
24
+ due_date?: string;
25
+ tax?: number;
26
+ tax2?: number;
27
+ discount?: number;
28
+ tax_on_tax?: boolean;
29
+ bill_to?: string;
30
+ company_info?: string;
31
+ footer?: string;
32
+ notes?: string;
33
+ outstanding?: number;
34
+ tax_text?: string;
35
+ tax2_text?: string;
36
+ discount_text?: string;
37
+ title?: string;
38
+ pay_online?: boolean;
39
+ invoiceitems?: InvoiceItemTypeCreate[];
40
+ }
41
+ export type InvoicesTypeResponse = Merge<InvoicesTypeUpdate, Merge<InvoicesTypeRead, {
42
+ invoiceitems?: InvoiceItemTypeRead[];
43
+ }>>;
44
+ export interface InvoicesTypeCreate extends InvoicesTypeUpdate {
45
+ client_id: number;
46
+ currency: PaymoCurrency;
47
+ items?: InvoiceItemTypeCreate[];
48
+ }
49
+ export interface InvoicesTypeFilter extends InvoicesTypeUpdate {
50
+ created_on?: string;
51
+ updated_on?: string;
52
+ subtotal?: number;
53
+ total?: number;
54
+ tax_amount?: number;
55
+ tax2_amount?: number;
56
+ }
57
+ export interface InvoicesFilterCondition extends InvoicesTypeFilter {
58
+ _custom?: {
59
+ [k: string]: {
60
+ key?: Extract<keyof InvoicesTypeFilter, string>;
61
+ operator?: FilterOperator;
62
+ value: string | number | boolean | null | number[];
63
+ };
64
+ };
65
+ }
66
+ export interface InvoicesListConfig extends GenericListConfig {
67
+ filter?: InvoicesFilterCondition;
68
+ }
69
+ export interface InvoiceItemTypeCommon {
70
+ item: string;
71
+ description: string;
72
+ price_unit: number;
73
+ quantity: number;
74
+ expense_id?: number;
75
+ apply_tax?: boolean;
76
+ seq?: number | null;
77
+ }
78
+ export interface InvoiceItemTypeCreate extends InvoiceItemTypeCommon {
79
+ entries?: number[];
80
+ }
81
+ export interface InvoiceItemTypeRead extends InvoiceItemTypeCommon {
82
+ readonly id: number;
83
+ apply_tax: boolean;
84
+ seq: number | null;
85
+ readonly created_on: string;
86
+ readonly updated_on: string;
87
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,18 @@
1
+ import { AbstractResource, AbstractResourceInterface } from '../../abstract';
2
+ import { AuthInterface } from "../../types";
3
+ import { InvoiceTemplatesListConfig, InvoiceTemplatesTypeCreate, InvoiceTemplatesTypeResponse, InvoiceTemplatesTypeUpdate } from "./types";
4
+ export interface InvoiceTemplatesHandler extends AbstractResourceInterface {
5
+ get: (id: number) => Promise<InvoiceTemplatesTypeResponse | null>;
6
+ list: (config?: InvoiceTemplatesListConfig) => Promise<InvoiceTemplatesTypeResponse[]>;
7
+ create: (d: InvoiceTemplatesTypeCreate) => Promise<InvoiceTemplatesTypeResponse | null>;
8
+ update: (id: number, data: InvoiceTemplatesTypeUpdate) => Promise<InvoiceTemplatesTypeResponse | null>;
9
+ delete: (id: number) => Promise<boolean>;
10
+ }
11
+ export declare class InvoiceTemplates extends AbstractResource implements InvoiceTemplatesHandler {
12
+ constructor(auth: AuthInterface);
13
+ get: (id: number) => Promise<InvoiceTemplatesTypeResponse | null>;
14
+ list: (config?: InvoiceTemplatesListConfig) => Promise<InvoiceTemplatesTypeResponse[]>;
15
+ create: (data: InvoiceTemplatesTypeCreate) => Promise<InvoiceTemplatesTypeResponse | null>;
16
+ update: (id: number, data: InvoiceTemplatesTypeUpdate) => Promise<InvoiceTemplatesTypeResponse | null>;
17
+ delete: (id: number) => Promise<boolean>;
18
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.InvoiceTemplates = void 0;
13
+ const abstract_1 = require("../../abstract");
14
+ class InvoiceTemplates extends abstract_1.AbstractResource {
15
+ constructor(auth) {
16
+ super(auth, 'invoicetemplates');
17
+ this.get = (id) => __awaiter(this, void 0, void 0, function* () {
18
+ return (yield this.baseGet(id));
19
+ });
20
+ this.list = (...args_1) => __awaiter(this, [...args_1], void 0, function* (config = {}) {
21
+ return (yield this.baseList(config));
22
+ });
23
+ this.create = (data) => __awaiter(this, void 0, void 0, function* () {
24
+ return (yield this.baseCreate(data));
25
+ });
26
+ this.update = (id, data) => __awaiter(this, void 0, void 0, function* () {
27
+ return (yield this.baseUpdate(id, data));
28
+ });
29
+ this.delete = (id) => __awaiter(this, void 0, void 0, function* () {
30
+ return yield this.baseDelete(id);
31
+ });
32
+ }
33
+ }
34
+ exports.InvoiceTemplates = InvoiceTemplates;
@@ -0,0 +1,34 @@
1
+ import { FilterOperator, GenericListConfig, Merge } from "../../types";
2
+ export interface InvoiceTemplatesTypeRead {
3
+ readonly id: number;
4
+ readonly created_on: string;
5
+ readonly updated_on: string;
6
+ }
7
+ export interface InvoiceTemplatesTypeUpdate {
8
+ name?: string;
9
+ title?: string;
10
+ html?: string;
11
+ css?: string;
12
+ is_default?: boolean;
13
+ }
14
+ export type InvoiceTemplatesTypeResponse = Merge<InvoiceTemplatesTypeUpdate, Merge<InvoiceTemplatesTypeRead, {}>>;
15
+ export interface InvoiceTemplatesTypeCreate extends InvoiceTemplatesTypeUpdate {
16
+ name: string;
17
+ }
18
+ export interface InvoiceTemplatesTypeFilter {
19
+ id?: number;
20
+ name?: string;
21
+ is_default?: boolean;
22
+ }
23
+ export interface InvoiceTemplatesFilterCondition extends InvoiceTemplatesTypeFilter {
24
+ _custom?: {
25
+ [k: string]: {
26
+ key?: Extract<keyof InvoiceTemplatesTypeFilter, string>;
27
+ operator?: FilterOperator;
28
+ value: string | number | boolean | null | number[];
29
+ };
30
+ };
31
+ }
32
+ export interface InvoiceTemplatesListConfig extends GenericListConfig {
33
+ filter?: InvoiceTemplatesFilterCondition;
34
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,18 @@
1
+ import { AbstractResource, AbstractResourceInterface } from '../../abstract';
2
+ import { AuthInterface } from "../../types";
3
+ import { MilestonesListConfig, MilestonesTypeCreate, MilestonesTypeResponse, MilestonesTypeUpdate } from "./types";
4
+ export interface MilestonesHandler extends AbstractResourceInterface {
5
+ get: (id: number) => Promise<MilestonesTypeResponse | null>;
6
+ list: (config?: MilestonesListConfig) => Promise<MilestonesTypeResponse[]>;
7
+ create: (d: MilestonesTypeCreate) => Promise<MilestonesTypeResponse | null>;
8
+ update: (id: number, data: MilestonesTypeUpdate) => Promise<MilestonesTypeResponse | null>;
9
+ delete: (id: number) => Promise<boolean>;
10
+ }
11
+ export declare class Milestones extends AbstractResource implements MilestonesHandler {
12
+ constructor(auth: AuthInterface);
13
+ get: (id: number) => Promise<MilestonesTypeResponse | null>;
14
+ list: (config?: MilestonesListConfig) => Promise<MilestonesTypeResponse[]>;
15
+ create: (data: MilestonesTypeCreate) => Promise<MilestonesTypeResponse | null>;
16
+ update: (id: number, data: MilestonesTypeUpdate) => Promise<MilestonesTypeResponse | null>;
17
+ delete: (id: number) => Promise<boolean>;
18
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.Milestones = void 0;
13
+ const abstract_1 = require("../../abstract");
14
+ class Milestones extends abstract_1.AbstractResource {
15
+ constructor(auth) {
16
+ super(auth, 'milestones');
17
+ this.get = (id) => __awaiter(this, void 0, void 0, function* () {
18
+ return (yield this.baseGet(id));
19
+ });
20
+ this.list = (...args_1) => __awaiter(this, [...args_1], void 0, function* (config = {}) {
21
+ return (yield this.baseList(config));
22
+ });
23
+ this.create = (data) => __awaiter(this, void 0, void 0, function* () {
24
+ return (yield this.baseCreate(data));
25
+ });
26
+ this.update = (id, data) => __awaiter(this, void 0, void 0, function* () {
27
+ return (yield this.baseUpdate(id, data));
28
+ });
29
+ this.delete = (id) => __awaiter(this, void 0, void 0, function* () {
30
+ return yield this.baseDelete(id);
31
+ });
32
+ }
33
+ }
34
+ exports.Milestones = Milestones;
@@ -0,0 +1,40 @@
1
+ import { FilterOperator, GenericListConfig, Merge } from "../../types";
2
+ export interface MilestonesTypeRead {
3
+ readonly id: number;
4
+ readonly created_on: string;
5
+ readonly updated_on: string;
6
+ readonly reminder_sent: boolean;
7
+ }
8
+ export interface MilestonesTypeUpdate {
9
+ name?: string;
10
+ project_id?: number;
11
+ user_id?: number;
12
+ due_date?: string;
13
+ send_reminder?: number;
14
+ complete?: boolean;
15
+ linked_tasklists?: number[];
16
+ }
17
+ export type MilestonesTypeResponse = Merge<MilestonesTypeUpdate, Merge<MilestonesTypeRead, {}>>;
18
+ export interface MilestonesTypeCreate extends MilestonesTypeUpdate {
19
+ name: string;
20
+ project_id: number;
21
+ due_date: string;
22
+ }
23
+ export interface MilestonesTypeFilter {
24
+ project_id?: number;
25
+ user_id?: number;
26
+ due_date?: string;
27
+ complete?: boolean;
28
+ }
29
+ export interface MilestonesFilterCondition extends MilestonesTypeFilter {
30
+ _custom?: {
31
+ [k: string]: {
32
+ key?: Extract<keyof MilestonesTypeFilter, string>;
33
+ operator?: FilterOperator;
34
+ value: string | number | boolean | null | number[];
35
+ };
36
+ };
37
+ }
38
+ export interface MilestonesListConfig extends GenericListConfig {
39
+ filter?: MilestonesFilterCondition;
40
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,20 @@
1
+ import { AbstractResource, AbstractResourceInterface } from '../../abstract';
2
+ import { AuthInterface } from "../../types";
3
+ import { ProjectsListConfig, ProjectTypeCreate, ProjectTypeResponse, ProjectTypeUpdate } from "./types";
4
+ export interface ProjectsHandler extends AbstractResourceInterface {
5
+ get: (id: number) => Promise<ProjectTypeResponse | null>;
6
+ list: (config?: ProjectsListConfig) => Promise<ProjectTypeResponse[]>;
7
+ create: (d: ProjectTypeCreate) => Promise<ProjectTypeResponse | null>;
8
+ update: (id: number, data: ProjectTypeUpdate) => Promise<ProjectTypeResponse | null>;
9
+ delete: (id: number) => Promise<boolean>;
10
+ reorderTaskLists: (id: number, tli: number[]) => Promise<ProjectTypeResponse | null>;
11
+ }
12
+ export declare class Projects extends AbstractResource implements ProjectsHandler {
13
+ constructor(auth: AuthInterface);
14
+ get: (id: number) => Promise<ProjectTypeResponse | null>;
15
+ list: (config?: ProjectsListConfig) => Promise<ProjectTypeResponse[]>;
16
+ create: (data: ProjectTypeCreate) => Promise<ProjectTypeResponse | null>;
17
+ update: (id: number, data: ProjectTypeUpdate) => Promise<ProjectTypeResponse | null>;
18
+ delete: (id: number) => Promise<boolean>;
19
+ reorderTaskLists: (id: number, taskListIds: number[]) => Promise<ProjectTypeResponse | null>;
20
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.Projects = void 0;
13
+ const abstract_1 = require("../../abstract");
14
+ class Projects extends abstract_1.AbstractResource {
15
+ constructor(auth) {
16
+ super(auth, 'projects');
17
+ this.get = (id) => __awaiter(this, void 0, void 0, function* () {
18
+ return (yield this.baseGet(id));
19
+ });
20
+ this.list = (...args_1) => __awaiter(this, [...args_1], void 0, function* (config = {}) {
21
+ return (yield this.baseList(config));
22
+ });
23
+ this.create = (data) => __awaiter(this, void 0, void 0, function* () {
24
+ return (yield this.baseCreate(data));
25
+ });
26
+ this.update = (id, data) => __awaiter(this, void 0, void 0, function* () {
27
+ return (yield this.baseUpdate(id, data));
28
+ });
29
+ this.delete = (id) => __awaiter(this, void 0, void 0, function* () {
30
+ return yield this.baseDelete(id);
31
+ });
32
+ this.reorderTaskLists = (id, taskListIds) => __awaiter(this, void 0, void 0, function* () {
33
+ return (yield this.baseUpdate(id, {
34
+ tasklists_order: taskListIds,
35
+ }));
36
+ });
37
+ }
38
+ }
39
+ exports.Projects = Projects;