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.
- package/.prettierrc +6 -0
- package/README.md +24 -1
- package/dist/abstract.d.ts +23 -0
- package/dist/abstract.js +210 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +18 -0
- package/dist/remote.d.ts +9 -0
- package/dist/remote.js +80 -0
- package/dist/resources/_template_/index.d.ts +18 -0
- package/dist/resources/_template_/index.js +34 -0
- package/dist/resources/_template_/types.d.ts +25 -0
- package/dist/resources/_template_/types.js +2 -0
- package/dist/resources/bookings/index.d.ts +18 -0
- package/dist/resources/bookings/index.js +49 -0
- package/dist/resources/bookings/types.d.ts +49 -0
- package/dist/resources/bookings/types.js +2 -0
- package/dist/resources/clientcontacts/index.d.ts +18 -0
- package/dist/resources/clientcontacts/index.js +34 -0
- package/dist/resources/clientcontacts/types.d.ts +59 -0
- package/dist/resources/clientcontacts/types.js +2 -0
- package/dist/resources/clients/index.d.ts +18 -0
- package/dist/resources/clients/index.js +34 -0
- package/dist/resources/clients/types.d.ts +71 -0
- package/dist/resources/clients/types.js +2 -0
- package/dist/resources/comments/Comments.d.ts +18 -0
- package/dist/resources/comments/Comments.js +34 -0
- package/dist/resources/comments/Threads.d.ts +28 -0
- package/dist/resources/comments/Threads.js +25 -0
- package/dist/resources/comments/index.d.ts +2 -0
- package/dist/resources/comments/index.js +7 -0
- package/dist/resources/comments/types.d.ts +77 -0
- package/dist/resources/comments/types.js +2 -0
- package/dist/resources/company/index.d.ts +12 -0
- package/dist/resources/company/index.js +25 -0
- package/dist/resources/company/types.d.ts +44 -0
- package/dist/resources/company/types.js +2 -0
- package/dist/resources/discussions/index.d.ts +18 -0
- package/dist/resources/discussions/index.js +34 -0
- package/dist/resources/discussions/types.d.ts +43 -0
- package/dist/resources/discussions/types.js +2 -0
- package/dist/resources/entries/index.d.ts +18 -0
- package/dist/resources/entries/index.js +47 -0
- package/dist/resources/entries/types.d.ts +53 -0
- package/dist/resources/entries/types.js +2 -0
- package/dist/resources/estimates/EstimateItem.d.ts +3 -0
- package/dist/resources/estimates/EstimateItem.js +5 -0
- package/dist/resources/estimates/Estimates.d.ts +18 -0
- package/dist/resources/estimates/Estimates.js +34 -0
- package/dist/resources/estimates/index.d.ts +2 -0
- package/dist/resources/estimates/index.js +7 -0
- package/dist/resources/estimates/types.d.ts +76 -0
- package/dist/resources/estimates/types.js +2 -0
- package/dist/resources/estimatetemplates/index.d.ts +18 -0
- package/dist/resources/estimatetemplates/index.js +34 -0
- package/dist/resources/estimatetemplates/types.d.ts +34 -0
- package/dist/resources/estimatetemplates/types.js +2 -0
- package/dist/resources/expenses/index.d.ts +18 -0
- package/dist/resources/expenses/index.js +34 -0
- package/dist/resources/expenses/types.d.ts +46 -0
- package/dist/resources/expenses/types.js +2 -0
- package/dist/resources/files/index.d.ts +18 -0
- package/dist/resources/files/index.js +45 -0
- package/dist/resources/files/types.d.ts +44 -0
- package/dist/resources/files/types.js +2 -0
- package/dist/resources/index.d.ts +117 -0
- package/dist/resources/index.js +200 -0
- package/dist/resources/invoices/InvoiceItem.d.ts +3 -0
- package/dist/resources/invoices/InvoiceItem.js +5 -0
- package/dist/resources/invoices/Invoices.d.ts +18 -0
- package/dist/resources/invoices/Invoices.js +34 -0
- package/dist/resources/invoices/index.d.ts +2 -0
- package/dist/resources/invoices/index.js +7 -0
- package/dist/resources/invoices/types.d.ts +87 -0
- package/dist/resources/invoices/types.js +2 -0
- package/dist/resources/invoicetemplates/index.d.ts +18 -0
- package/dist/resources/invoicetemplates/index.js +34 -0
- package/dist/resources/invoicetemplates/types.d.ts +34 -0
- package/dist/resources/invoicetemplates/types.js +2 -0
- package/dist/resources/milestones/index.d.ts +18 -0
- package/dist/resources/milestones/index.js +34 -0
- package/dist/resources/milestones/types.d.ts +40 -0
- package/dist/resources/milestones/types.js +2 -0
- package/dist/resources/projects/index.d.ts +20 -0
- package/dist/resources/projects/index.js +39 -0
- package/dist/resources/projects/types.d.ts +86 -0
- package/dist/resources/projects/types.js +14 -0
- package/dist/resources/projectstatuses/index.d.ts +18 -0
- package/dist/resources/projectstatuses/index.js +34 -0
- package/dist/resources/projectstatuses/types.d.ts +32 -0
- package/dist/resources/projectstatuses/types.js +2 -0
- package/dist/resources/projecttemplates/index.d.ts +18 -0
- package/dist/resources/projecttemplates/index.js +34 -0
- package/dist/resources/projecttemplates/types.d.ts +29 -0
- package/dist/resources/projecttemplates/types.js +2 -0
- package/dist/resources/reports/index.d.ts +18 -0
- package/dist/resources/reports/index.js +34 -0
- package/dist/resources/reports/types.d.ts +90 -0
- package/dist/resources/reports/types.js +2 -0
- package/dist/resources/sessions/index.d.ts +18 -0
- package/dist/resources/sessions/index.js +35 -0
- package/dist/resources/sessions/types.d.ts +28 -0
- package/dist/resources/sessions/types.js +2 -0
- package/dist/resources/tasklists/index.d.ts +18 -0
- package/dist/resources/tasklists/index.js +34 -0
- package/dist/resources/tasklists/types.d.ts +35 -0
- package/dist/resources/tasklists/types.js +2 -0
- package/dist/resources/tasks/index.d.ts +18 -0
- package/dist/resources/tasks/index.js +34 -0
- package/dist/resources/tasks/types.d.ts +64 -0
- package/dist/resources/tasks/types.js +2 -0
- package/dist/resources/users/index.d.ts +22 -0
- package/dist/resources/users/index.js +40 -0
- package/dist/resources/users/types.d.ts +86 -0
- package/dist/resources/users/types.js +2 -0
- package/dist/resources/usertasks/index.d.ts +18 -0
- package/dist/resources/usertasks/index.js +41 -0
- package/dist/resources/usertasks/types.d.ts +31 -0
- package/dist/resources/usertasks/types.js +2 -0
- package/dist/resources/workflows/index.d.ts +18 -0
- package/dist/resources/workflows/index.js +34 -0
- package/dist/resources/workflows/types.d.ts +31 -0
- package/dist/resources/workflows/types.js +2 -0
- package/dist/resources/workflowstatuses/index.d.ts +18 -0
- package/dist/resources/workflowstatuses/index.js +34 -0
- package/dist/resources/workflowstatuses/types.d.ts +35 -0
- package/dist/resources/workflowstatuses/types.js +2 -0
- package/dist/types.d.ts +25 -0
- package/dist/types.js +2 -0
- package/package.json +13 -3
- package/src/abstract.ts +220 -0
- package/src/index.ts +23 -0
- package/src/remote.ts +77 -0
- package/src/resources/_template_/index.ts +38 -0
- package/src/resources/_template_/types.ts +40 -0
- package/src/resources/bookings/index.ts +61 -0
- package/src/resources/bookings/types.ts +60 -0
- package/src/resources/clientcontacts/index.ts +38 -0
- package/src/resources/clientcontacts/types.ts +69 -0
- package/src/resources/clients/index.ts +38 -0
- package/src/resources/clients/types.ts +100 -0
- package/src/resources/comments/Comments.ts +38 -0
- package/src/resources/comments/Threads.ts +28 -0
- package/src/resources/comments/index.ts +2 -0
- package/src/resources/comments/types.ts +105 -0
- package/src/resources/company/index.ts +23 -0
- package/src/resources/company/types.ts +52 -0
- package/src/resources/discussions/index.ts +38 -0
- package/src/resources/discussions/types.ts +53 -0
- package/src/resources/entries/index.ts +52 -0
- package/src/resources/entries/types.ts +67 -0
- package/src/resources/estimates/EstimateItem.ts +6 -0
- package/src/resources/estimates/Estimates.ts +38 -0
- package/src/resources/estimates/index.ts +2 -0
- package/src/resources/estimates/types.ts +89 -0
- package/src/resources/estimatetemplates/index.ts +38 -0
- package/src/resources/estimatetemplates/types.ts +46 -0
- package/src/resources/expenses/index.ts +38 -0
- package/src/resources/expenses/types.ts +58 -0
- package/src/resources/files/index.ts +50 -0
- package/src/resources/files/types.ts +58 -0
- package/src/resources/index.ts +289 -0
- package/src/resources/invoices/InvoiceItem.ts +6 -0
- package/src/resources/invoices/Invoices.ts +38 -0
- package/src/resources/invoices/index.ts +2 -0
- package/src/resources/invoices/types.ts +102 -0
- package/src/resources/invoicetemplates/index.ts +38 -0
- package/src/resources/invoicetemplates/types.ts +46 -0
- package/src/resources/milestones/index.ts +38 -0
- package/src/resources/milestones/types.ts +52 -0
- package/src/resources/projects/index.ts +47 -0
- package/src/resources/projects/types.ts +134 -0
- package/src/resources/projectstatuses/index.ts +38 -0
- package/src/resources/projectstatuses/types.ts +44 -0
- package/src/resources/projecttemplates/index.ts +40 -0
- package/src/resources/projecttemplates/types.ts +43 -0
- package/src/resources/reports/index.ts +38 -0
- package/src/resources/reports/types.ts +104 -0
- package/src/resources/sessions/index.ts +39 -0
- package/src/resources/sessions/types.ts +43 -0
- package/src/resources/tasklists/index.ts +38 -0
- package/src/resources/tasklists/types.ts +48 -0
- package/src/resources/tasks/index.ts +38 -0
- package/src/resources/tasks/types.ts +76 -0
- package/src/resources/users/index.ts +48 -0
- package/src/resources/users/types.ts +124 -0
- package/src/resources/usertasks/index.ts +46 -0
- package/src/resources/usertasks/types.ts +43 -0
- package/src/resources/workflows/index.ts +38 -0
- package/src/resources/workflows/types.ts +43 -0
- package/src/resources/workflowstatuses/index.ts +38 -0
- package/src/resources/workflowstatuses/types.ts +47 -0
- package/src/types.ts +40 -0
- package/tsconfig.json +12 -0
- package/lib/index.ts +0 -6
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { AbstractResource, AbstractResourceInterface } from '../../abstract'
|
|
2
|
+
import { AuthInterface } from "../../types"
|
|
3
|
+
import { WorkflowsListConfig, WorkflowsTypeCreate, WorkflowsTypeResponse, WorkflowsTypeUpdate } from "./types"
|
|
4
|
+
|
|
5
|
+
export interface WorkflowsHandler extends AbstractResourceInterface {
|
|
6
|
+
get: (id: number) => Promise<WorkflowsTypeResponse | null>
|
|
7
|
+
list: (config?: WorkflowsListConfig) => Promise<WorkflowsTypeResponse[]>
|
|
8
|
+
create: (d: WorkflowsTypeCreate) => Promise<WorkflowsTypeResponse | null>
|
|
9
|
+
update: (id: number, data: WorkflowsTypeUpdate) => Promise<WorkflowsTypeResponse | null>
|
|
10
|
+
delete: (id: number) => Promise<boolean>
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export class Workflows extends AbstractResource implements WorkflowsHandler {
|
|
14
|
+
constructor(auth: AuthInterface) {
|
|
15
|
+
super(auth, 'workflows')
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
get = async (id: number) => {
|
|
19
|
+
return (await this.baseGet(id)) as WorkflowsTypeResponse | null
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
list = async (config: WorkflowsListConfig = {}) => {
|
|
23
|
+
return (await this.baseList(config)) as WorkflowsTypeResponse[]
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
create = async (data: WorkflowsTypeCreate) => {
|
|
27
|
+
return (await this.baseCreate(data)) as WorkflowsTypeResponse | null
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
update = async (id: number, data: WorkflowsTypeUpdate) => {
|
|
31
|
+
return (await this.baseUpdate(id, data)) as WorkflowsTypeResponse | null
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
delete = async (id: number) => {
|
|
35
|
+
return await this.baseDelete(id)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { FilterOperator, GenericListConfig, Merge } from "../../types"
|
|
2
|
+
|
|
3
|
+
// PAYMO API DOCS - 2019-12-11 /workflows /workflows/####
|
|
4
|
+
// =================================================================================================
|
|
5
|
+
|
|
6
|
+
export interface WorkflowsTypeRead {
|
|
7
|
+
readonly id: number
|
|
8
|
+
readonly created_on: string
|
|
9
|
+
readonly updated_on: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface WorkflowsTypeUpdate {
|
|
13
|
+
name?:string
|
|
14
|
+
is_default?:boolean
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export type WorkflowsTypeResponse = Merge<WorkflowsTypeUpdate, Merge<WorkflowsTypeRead, {
|
|
18
|
+
|
|
19
|
+
}>>
|
|
20
|
+
|
|
21
|
+
export interface WorkflowsTypeCreate extends WorkflowsTypeUpdate {
|
|
22
|
+
name:string
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface WorkflowsTypeFilter {
|
|
26
|
+
id?:number
|
|
27
|
+
name?:string
|
|
28
|
+
is_default?:boolean
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface WorkflowsFilterCondition extends WorkflowsTypeFilter {
|
|
32
|
+
_custom?: {
|
|
33
|
+
[k: string]: {
|
|
34
|
+
key?: Extract<keyof WorkflowsTypeFilter, string>
|
|
35
|
+
operator?:FilterOperator
|
|
36
|
+
value: string | number | boolean | null | number[]
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface WorkflowsListConfig extends GenericListConfig {
|
|
42
|
+
filter?:WorkflowsFilterCondition
|
|
43
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { AbstractResource, AbstractResourceInterface } from '../../abstract'
|
|
2
|
+
import { AuthInterface } from "../../types"
|
|
3
|
+
import { WorkflowStatusesListConfig, WorkflowStatusesTypeCreate, WorkflowStatusesTypeResponse, WorkflowStatusesTypeUpdate } from "./types"
|
|
4
|
+
|
|
5
|
+
export interface WorkflowStatusesHandler extends AbstractResourceInterface {
|
|
6
|
+
get: (id: number) => Promise<WorkflowStatusesTypeResponse | null>
|
|
7
|
+
list: (config?: WorkflowStatusesListConfig) => Promise<WorkflowStatusesTypeResponse[]>
|
|
8
|
+
create: (d: WorkflowStatusesTypeCreate) => Promise<WorkflowStatusesTypeResponse | null>
|
|
9
|
+
update: (id: number, data: WorkflowStatusesTypeUpdate) => Promise<WorkflowStatusesTypeResponse | null>
|
|
10
|
+
delete: (id: number) => Promise<boolean>
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export class WorkflowStatuses extends AbstractResource implements WorkflowStatusesHandler {
|
|
14
|
+
constructor(auth: AuthInterface) {
|
|
15
|
+
super(auth, 'workflowstatuses')
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
get = async (id: number) => {
|
|
19
|
+
return (await this.baseGet(id)) as WorkflowStatusesTypeResponse | null
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
list = async (config: WorkflowStatusesListConfig = {}) => {
|
|
23
|
+
return (await this.baseList(config)) as WorkflowStatusesTypeResponse[]
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
create = async (data: WorkflowStatusesTypeCreate) => {
|
|
27
|
+
return (await this.baseCreate(data)) as WorkflowStatusesTypeResponse | null
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
update = async (id: number, data: WorkflowStatusesTypeUpdate) => {
|
|
31
|
+
return (await this.baseUpdate(id, data)) as WorkflowStatusesTypeResponse | null
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
delete = async (id: number) => {
|
|
35
|
+
return await this.baseDelete(id)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { FilterOperator, GenericListConfig, Merge } from "../../types"
|
|
2
|
+
|
|
3
|
+
// PAYMO API DOCS - 2019-12-11 /workflowstatuses /workflowstatuses/####
|
|
4
|
+
// =================================================================================================
|
|
5
|
+
|
|
6
|
+
export interface WorkflowStatusesTypeRead {
|
|
7
|
+
readonly id: number
|
|
8
|
+
readonly created_on: string
|
|
9
|
+
readonly updated_on: string
|
|
10
|
+
readonly seq: number
|
|
11
|
+
readonly action: '' | 'complete' |'backlog'
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface WorkflowStatusesTypeUpdate {
|
|
15
|
+
name?:string
|
|
16
|
+
workflow_id?:number
|
|
17
|
+
color?:string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type WorkflowStatusesTypeResponse = Merge<WorkflowStatusesTypeUpdate, Merge<WorkflowStatusesTypeRead, {
|
|
21
|
+
|
|
22
|
+
}>>
|
|
23
|
+
|
|
24
|
+
export interface WorkflowStatusesTypeCreate extends WorkflowStatusesTypeUpdate {
|
|
25
|
+
name:string
|
|
26
|
+
color:string
|
|
27
|
+
workflow_id:number
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface WorkflowStatusesTypeFilter {
|
|
31
|
+
name?:string
|
|
32
|
+
workflow_id?:number
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface WorkflowStatusesFilterCondition extends WorkflowStatusesTypeFilter {
|
|
36
|
+
_custom?: {
|
|
37
|
+
[k: string]: {
|
|
38
|
+
key?: Extract<keyof WorkflowStatusesTypeFilter, string>
|
|
39
|
+
operator?:FilterOperator
|
|
40
|
+
value: string | number | boolean | null | number[]
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface WorkflowStatusesListConfig extends GenericListConfig {
|
|
46
|
+
filter?:WorkflowStatusesFilterCondition
|
|
47
|
+
}
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface AuthInterface {
|
|
2
|
+
userApi: string
|
|
3
|
+
password: string
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export type FilterOperator =
|
|
7
|
+
| '='
|
|
8
|
+
| '<='
|
|
9
|
+
| '>='
|
|
10
|
+
| '>'
|
|
11
|
+
| '<'
|
|
12
|
+
| '!='
|
|
13
|
+
| 'like'
|
|
14
|
+
| 'not like'
|
|
15
|
+
| 'in'
|
|
16
|
+
| 'not in'
|
|
17
|
+
|
|
18
|
+
export type GenericCustomFilterType = {
|
|
19
|
+
[k: string]: {
|
|
20
|
+
key?: string
|
|
21
|
+
operator?: FilterOperator
|
|
22
|
+
value: string | number | boolean | null | number[]
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type GenericFilterType = {
|
|
27
|
+
[key: string]: any
|
|
28
|
+
} & {
|
|
29
|
+
_custom?: GenericCustomFilterType
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface GenericListConfig {
|
|
33
|
+
filter?: GenericFilterType
|
|
34
|
+
include?: string[]
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>
|
|
38
|
+
export type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;
|
|
39
|
+
|
|
40
|
+
export type PaymoCurrency = 'AED' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'BAM' | 'BDT' | 'BGN' | 'BRL' | 'BWP' | 'CAD' | 'CFP' | 'CHF' | 'CLF' | 'CLP' | 'CNY' | 'COP' | 'CRC' | 'CZK' | 'DKK' | 'DOP' | 'DZD' | 'EEK' | 'EGP' | 'EUR' | 'GBP' | 'GTQ' | 'HKD' | 'HRK' | 'HUF' | 'IDR' | 'ILS' | 'INR' | 'IRR' | 'ISK' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LKR' | 'LTL' | 'LVL' | 'MAD' | 'MDL' | 'MUR' | 'MXN' | 'MYR' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NZD' | 'OMR' | 'PEN' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RMB' | 'RON' | 'RSD' | 'RUB' | 'SAR' | 'SEK' | 'SGD' | 'SKK' | 'TBH' | 'TND' | 'TRY' | 'TTD' | 'TWD' | 'U$S' | 'UAH' | 'US$' | 'USD' | 'UYU' | 'VEF' | 'VND' | 'ZAR'
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"outDir": "dist",
|
|
4
|
+
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
|
|
5
|
+
"module": "commonjs",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"strictNullChecks": true,
|
|
8
|
+
"esModuleInterop": true,
|
|
9
|
+
"declaration": true,
|
|
10
|
+
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
|
|
11
|
+
}
|
|
12
|
+
}
|