@timesheet/sdk 1.0.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.
@@ -0,0 +1,1335 @@
1
+ import { AxiosRequestConfig, AxiosInstance } from 'axios';
2
+
3
+ interface Authentication {
4
+ applyAuth(config: AxiosRequestConfig): void;
5
+ needsRefresh(): boolean;
6
+ refresh(): Promise<void>;
7
+ getAuthHeaders(): Promise<Record<string, string>>;
8
+ }
9
+
10
+ declare class ApiKeyAuth implements Authentication {
11
+ private readonly apiKey;
12
+ constructor(apiKey: string);
13
+ private isValidFormat;
14
+ applyAuth(config: AxiosRequestConfig): void;
15
+ needsRefresh(): boolean;
16
+ refresh(): Promise<void>;
17
+ getAuthHeaders(): Promise<Record<string, string>>;
18
+ isValid(): boolean;
19
+ }
20
+
21
+ declare class OAuth2Auth implements Authentication {
22
+ private static readonly TOKEN_ENDPOINT;
23
+ private accessToken;
24
+ private refreshToken?;
25
+ private readonly clientId?;
26
+ private readonly clientSecret?;
27
+ private tokenExpiry?;
28
+ private refreshPromise?;
29
+ constructor(accessToken: string);
30
+ constructor(clientId: string, clientSecret: string, refreshToken: string);
31
+ applyAuth(config: AxiosRequestConfig): void;
32
+ needsRefresh(): boolean;
33
+ refresh(): Promise<void>;
34
+ private performRefresh;
35
+ getAuthHeaders(): Promise<Record<string, string>>;
36
+ static fromAuthorizationCode(clientId: string, clientSecret: string, authorizationCode: string, redirectUri: string): Promise<OAuth2Auth>;
37
+ static buildAuthorizationUrl(clientId: string, redirectUri: string, state?: string): string;
38
+ private parseTokenExpiry;
39
+ }
40
+
41
+ declare class RetryConfig {
42
+ readonly maxRetries: number;
43
+ readonly initialDelay: number;
44
+ readonly maxDelay: number;
45
+ readonly backoffMultiplier: number;
46
+ readonly retryableStatusCodes: number[];
47
+ constructor(options?: Partial<RetryConfigOptions>);
48
+ static default(): RetryConfig;
49
+ }
50
+ interface RetryConfigOptions {
51
+ maxRetries: number;
52
+ initialDelay: number;
53
+ maxDelay: number;
54
+ backoffMultiplier: number;
55
+ retryableStatusCodes: number[];
56
+ }
57
+
58
+ interface ClientConfig {
59
+ baseUrl: string;
60
+ authentication: Authentication;
61
+ retryConfig: RetryConfig;
62
+ httpClient?: AxiosInstance;
63
+ }
64
+
65
+ declare class ApiClient {
66
+ private readonly config;
67
+ private readonly httpClient;
68
+ constructor(config: ClientConfig);
69
+ request<T>(config: AxiosRequestConfig): Promise<T>;
70
+ get<T, P = Record<string, unknown>>(path: string, params?: P): Promise<T>;
71
+ post<T, P = Record<string, unknown>>(path: string, data?: unknown, params?: P): Promise<T>;
72
+ put<T, P = Record<string, unknown>>(path: string, data?: unknown, params?: P): Promise<T>;
73
+ delete<T, P = Record<string, unknown>>(path: string, params?: P): Promise<T>;
74
+ private sleep;
75
+ }
76
+
77
+ interface Member {
78
+ uid: string;
79
+ firstname?: string;
80
+ lastname?: string;
81
+ email?: string;
82
+ employeeId?: string;
83
+ imageUrl?: string;
84
+ deleted?: boolean;
85
+ activity?: Activity;
86
+ displayName?: string;
87
+ initials?: string;
88
+ }
89
+ interface Activity {
90
+ projectId?: string;
91
+ projectTitle?: string;
92
+ projectColor?: number;
93
+ taskId?: string;
94
+ startDateTime?: string;
95
+ endDateTime?: string;
96
+ location?: string;
97
+ running?: boolean;
98
+ }
99
+ interface ListParams {
100
+ count?: number;
101
+ page?: number;
102
+ limit?: number;
103
+ sort?: string;
104
+ order?: 'asc' | 'desc';
105
+ }
106
+ interface PageParams {
107
+ page?: number;
108
+ limit?: number;
109
+ }
110
+ interface SortablePageParams extends PageParams {
111
+ sort?: string;
112
+ order?: 'asc' | 'desc';
113
+ }
114
+
115
+ interface Page<T> {
116
+ items: T[];
117
+ params: ListParams;
118
+ }
119
+ declare class NavigablePage<T> implements Page<T> {
120
+ items: T[];
121
+ params: ListParams;
122
+ private readonly nextPageLoader?;
123
+ constructor(data: Page<T>, nextPageLoader?: (page: number) => Promise<NavigablePage<T>>);
124
+ get totalPages(): number;
125
+ get hasNextPage(): boolean;
126
+ nextPage(): Promise<NavigablePage<T>>;
127
+ [Symbol.asyncIterator](): AsyncIterator<T>;
128
+ toArray(): Promise<T[]>;
129
+ }
130
+
131
+ interface Team {
132
+ id: string;
133
+ organizationId?: string;
134
+ name: string;
135
+ description?: string;
136
+ image?: string;
137
+ color?: number;
138
+ projectSalaryVisibility?: number;
139
+ created?: number;
140
+ lastUpdate?: number;
141
+ }
142
+ interface TeamList {
143
+ items: Team[];
144
+ params: TeamListParams;
145
+ }
146
+ interface TeamMember {
147
+ uid: string;
148
+ email: string;
149
+ firstname?: string;
150
+ lastname?: string;
151
+ employeeId?: string;
152
+ imageUrl?: string;
153
+ permission?: string;
154
+ created?: number;
155
+ lastUpdate?: number;
156
+ }
157
+ interface TeamMemberList {
158
+ items: TeamMember[];
159
+ params: TeamMemberListParams;
160
+ }
161
+ interface TeamCreateRequest {
162
+ organizationId?: string;
163
+ name: string;
164
+ description?: string;
165
+ image?: string;
166
+ color?: number;
167
+ projectSalaryVisibility?: number;
168
+ }
169
+ interface TeamUpdateRequest {
170
+ organizationId?: string;
171
+ name?: string;
172
+ description?: string;
173
+ image?: string;
174
+ color?: number;
175
+ projectSalaryVisibility?: number;
176
+ }
177
+ interface TeamListParams extends ListParams {
178
+ statistics?: boolean;
179
+ sort?: 'alpha' | 'permission' | 'created';
180
+ order?: 'asc' | 'desc';
181
+ organizationId?: string;
182
+ }
183
+ interface TeamMemberListParams extends ListParams {
184
+ organizationId?: string;
185
+ status?: string;
186
+ teamId?: string;
187
+ projectId?: string;
188
+ withoutMe?: boolean;
189
+ lastActivity?: boolean;
190
+ deleted?: boolean;
191
+ }
192
+
193
+ interface Project {
194
+ id: string;
195
+ title: string;
196
+ description?: string;
197
+ color?: number;
198
+ employer?: string;
199
+ office?: string;
200
+ taskDefaultBillable?: boolean;
201
+ taskDefaultRateId?: string;
202
+ archived?: boolean;
203
+ salaryVisibility?: number;
204
+ salary?: number;
205
+ team?: Team;
206
+ permission?: {
207
+ role: string;
208
+ managerOrOwner: boolean;
209
+ member: boolean;
210
+ manager: boolean;
211
+ owner: boolean;
212
+ };
213
+ duration?: number;
214
+ durationBreak?: number;
215
+ salaryTotal?: number;
216
+ salaryBreak?: number;
217
+ expenses?: number;
218
+ expensesPaid?: number;
219
+ mileage?: number;
220
+ titleAndClient?: string;
221
+ salaryVisible?: boolean;
222
+ user?: string;
223
+ created?: number;
224
+ lastUpdate?: number;
225
+ deleted?: boolean;
226
+ }
227
+ interface ProjectList {
228
+ items: Project[];
229
+ params: ProjectListParams;
230
+ }
231
+ interface ProjectMember {
232
+ uid: string;
233
+ email: string;
234
+ firstname?: string;
235
+ lastname?: string;
236
+ employeeId?: string;
237
+ imageUrl?: string;
238
+ salaryActivated?: boolean;
239
+ salary?: number;
240
+ permission?: {
241
+ role: string;
242
+ managerOrOwner: boolean;
243
+ member: boolean;
244
+ manager: boolean;
245
+ owner: boolean;
246
+ };
247
+ lastUpdate?: number;
248
+ created?: number;
249
+ displayName?: string;
250
+ }
251
+ interface ProjectCreateRequest {
252
+ title: string;
253
+ description?: string;
254
+ color?: number;
255
+ employer?: string;
256
+ office?: string;
257
+ taskDefaultBillable?: boolean;
258
+ taskDefaultRateId?: string;
259
+ archived?: boolean;
260
+ salaryVisibility?: number;
261
+ salary?: number;
262
+ teamId?: string;
263
+ }
264
+ interface ProjectUpdateRequest {
265
+ title?: string;
266
+ description?: string;
267
+ color?: number;
268
+ employer?: string;
269
+ office?: string;
270
+ taskDefaultBillable?: boolean;
271
+ taskDefaultRateId?: string;
272
+ archived?: boolean;
273
+ salaryVisibility?: number;
274
+ salary?: number;
275
+ deleted?: boolean;
276
+ }
277
+ interface ProjectListParams extends ListParams {
278
+ teamId?: string;
279
+ status?: 'all' | 'active' | 'inactive';
280
+ statistics?: boolean;
281
+ sort?: 'alpha' | 'alphaNum' | 'client' | 'duration' | 'created' | 'status';
282
+ order?: 'asc' | 'desc';
283
+ teamIds?: string[];
284
+ projectIds?: string[];
285
+ taskStartDate?: string;
286
+ taskEndDate?: string;
287
+ taskRateId?: string;
288
+ taskType?: string;
289
+ taskFilter?: string;
290
+ taskUserIds?: string[];
291
+ }
292
+
293
+ interface Todo {
294
+ id: string;
295
+ name: string;
296
+ description?: string;
297
+ project?: Project;
298
+ status: 'open' | 'closed';
299
+ dueDate?: string;
300
+ assignedUsers?: string;
301
+ estimatedHours?: number;
302
+ estimatedMinutes?: number;
303
+ duration?: number;
304
+ durationBreak?: number;
305
+ salaryTotal?: number;
306
+ salaryBreak?: number;
307
+ expenses?: number;
308
+ expensesPaid?: number;
309
+ mileage?: number;
310
+ user?: string;
311
+ deleted?: boolean;
312
+ created?: number;
313
+ lastUpdate?: number;
314
+ }
315
+ interface TodoList {
316
+ items: Todo[];
317
+ params: TodoListParams;
318
+ todoStatistic?: {
319
+ open: number;
320
+ closed: number;
321
+ };
322
+ }
323
+ interface TodoCreateRequest {
324
+ name: string;
325
+ description?: string;
326
+ projectId: string;
327
+ dueDate?: string;
328
+ assignedUsers?: string;
329
+ estimatedHours?: number;
330
+ estimatedMinutes?: number;
331
+ }
332
+ interface TodoUpdateRequest {
333
+ name?: string;
334
+ description?: string;
335
+ status?: 'open' | 'closed';
336
+ dueDate?: string;
337
+ assignedUsers?: string;
338
+ estimatedHours?: number;
339
+ estimatedMinutes?: number;
340
+ deleted?: boolean;
341
+ }
342
+ interface TodoListParams extends ListParams {
343
+ projectId?: string;
344
+ status?: 'open' | 'closed';
345
+ assignedUsers?: string;
346
+ }
347
+
348
+ interface Rate {
349
+ id: string;
350
+ user?: string;
351
+ lastUpdate?: number;
352
+ created?: number;
353
+ deleted?: boolean;
354
+ title: string;
355
+ factor: number;
356
+ extra?: number;
357
+ enabled?: boolean;
358
+ archived?: boolean;
359
+ team?: Team;
360
+ }
361
+ interface RateList {
362
+ items: Rate[];
363
+ params: RateListParams;
364
+ }
365
+ interface RateCreateRequest {
366
+ title: string;
367
+ factor: number;
368
+ extra?: number;
369
+ enabled?: boolean;
370
+ archived?: boolean;
371
+ teamId?: string;
372
+ }
373
+ interface RateUpdateRequest {
374
+ title?: string;
375
+ factor?: number;
376
+ extra?: number;
377
+ enabled?: boolean;
378
+ archived?: boolean;
379
+ deleted?: boolean;
380
+ }
381
+ interface RateListParams extends ListParams {
382
+ teamId?: string;
383
+ projectId?: string;
384
+ status?: 'all' | 'active' | 'inactive';
385
+ sort?: 'alpha' | 'status' | 'created';
386
+ order?: 'asc' | 'desc';
387
+ }
388
+
389
+ interface Tag {
390
+ id: string;
391
+ name: string;
392
+ color?: number;
393
+ teamId?: string;
394
+ archived?: boolean;
395
+ created?: number;
396
+ lastUpdate?: number;
397
+ }
398
+ interface TagList {
399
+ items: Tag[];
400
+ params: TagListParams;
401
+ }
402
+ interface TagCreateRequest {
403
+ name: string;
404
+ color?: number;
405
+ teamId?: string;
406
+ }
407
+ interface TagUpdateRequest {
408
+ name?: string;
409
+ color?: number;
410
+ archived?: boolean;
411
+ }
412
+ interface TagListParams extends PageParams {
413
+ teamId?: string;
414
+ projectId?: string;
415
+ status?: 'all' | 'active' | 'inactive';
416
+ statistics?: boolean;
417
+ sort?: 'alpha' | 'status' | 'created';
418
+ order?: 'asc' | 'desc';
419
+ }
420
+
421
+ interface Pause {
422
+ id: string;
423
+ user?: string;
424
+ deleted?: boolean;
425
+ running?: boolean;
426
+ lastUpdate?: number;
427
+ created?: number;
428
+ description?: string;
429
+ startDateTime?: string;
430
+ endDateTime?: string;
431
+ task?: Task;
432
+ member?: Member;
433
+ }
434
+ interface PauseList {
435
+ items: Pause[];
436
+ params: PauseListParams;
437
+ }
438
+ interface PauseCreateRequest {
439
+ description?: string;
440
+ startDateTime: string;
441
+ endDateTime: string;
442
+ taskId: string;
443
+ }
444
+ interface PauseUpdateRequest {
445
+ description?: string;
446
+ startDateTime: string;
447
+ endDateTime: string;
448
+ deleted?: boolean;
449
+ }
450
+ interface PauseListParams extends ListParams {
451
+ taskId?: string;
452
+ }
453
+
454
+ interface Expense {
455
+ id: string;
456
+ user?: string;
457
+ deleted?: boolean;
458
+ lastUpdate?: number;
459
+ created?: number;
460
+ description?: string;
461
+ dateTime?: string;
462
+ amount?: number;
463
+ refunded?: boolean;
464
+ fileUri?: string;
465
+ fileName?: string;
466
+ task?: Task;
467
+ member?: Member;
468
+ invoiceId?: string;
469
+ }
470
+ interface ExpenseList {
471
+ items: Expense[];
472
+ params: ExpenseListParams;
473
+ }
474
+ interface ExpenseCreateRequest {
475
+ description?: string;
476
+ dateTime: string;
477
+ amount?: number;
478
+ refunded?: boolean;
479
+ fileUri?: string;
480
+ fileName?: string;
481
+ taskId: string;
482
+ }
483
+ interface ExpenseUpdateRequest {
484
+ description?: string;
485
+ dateTime?: string;
486
+ amount?: number;
487
+ refunded?: boolean;
488
+ deleted?: boolean;
489
+ fileUri?: string;
490
+ fileName?: string;
491
+ }
492
+ interface ExpenseStatus {
493
+ id: string;
494
+ refunded: boolean;
495
+ }
496
+ interface ExpenseListParams extends ListParams {
497
+ startDate?: string;
498
+ endDate?: string;
499
+ taskId?: string;
500
+ documentId?: string;
501
+ filter?: string;
502
+ projectIds?: string[];
503
+ taskIds?: string[];
504
+ }
505
+
506
+ interface Note {
507
+ id: string;
508
+ user?: string;
509
+ deleted?: boolean;
510
+ lastUpdate?: number;
511
+ created?: number;
512
+ text?: string;
513
+ dateTime?: string;
514
+ uri?: string;
515
+ driveId?: string;
516
+ task?: Task;
517
+ member?: Member;
518
+ }
519
+ interface NoteList {
520
+ items: Note[];
521
+ params: NoteListParams;
522
+ }
523
+ interface NoteCreateRequest {
524
+ text: string;
525
+ dateTime: string;
526
+ uri?: string;
527
+ driveId?: string;
528
+ taskId: string;
529
+ }
530
+ interface NoteUpdateRequest {
531
+ text: string;
532
+ dateTime: string;
533
+ uri?: string;
534
+ driveId?: string;
535
+ deleted?: boolean;
536
+ }
537
+ interface NoteListParams extends ListParams {
538
+ startDate?: string;
539
+ endDate?: string;
540
+ taskId?: string;
541
+ documentId?: string;
542
+ taskIds?: string[];
543
+ }
544
+
545
+ interface Task {
546
+ id: string;
547
+ projectId: string;
548
+ description?: string;
549
+ startDateTime?: string;
550
+ endDateTime?: string;
551
+ location?: string;
552
+ locationEnd?: string;
553
+ feeling?: number;
554
+ typeId?: number;
555
+ billable?: boolean;
556
+ paid?: boolean;
557
+ billed?: boolean;
558
+ phoneNumber?: string;
559
+ distance?: number;
560
+ signature?: string;
561
+ project?: Project;
562
+ todo?: Todo;
563
+ rate?: Rate;
564
+ member?: Member;
565
+ invoiceId?: string;
566
+ tags?: Tag[];
567
+ pauses?: Pause[];
568
+ expenses?: Expense[];
569
+ notes?: Note[];
570
+ duration?: number;
571
+ durationBreak?: number;
572
+ salaryTotal?: number;
573
+ salaryBreak?: number;
574
+ expensesTotal?: number;
575
+ expensesPaid?: number;
576
+ mileage?: number;
577
+ notesTotal?: number;
578
+ salaryVisible?: boolean;
579
+ user?: string;
580
+ deleted?: boolean;
581
+ running?: boolean;
582
+ created?: number;
583
+ lastUpdate?: number;
584
+ }
585
+ interface TaskList {
586
+ items: Task[];
587
+ params: TaskListParams;
588
+ taskStatistic?: TaskStatistic;
589
+ currentPerformance?: TaskPerformance;
590
+ lastPerformance?: TaskPerformance;
591
+ }
592
+ interface TaskStatistic {
593
+ duration: number;
594
+ durationBreak: number;
595
+ salaryTotal: number;
596
+ salaryBreak: number;
597
+ expensesTotal: number;
598
+ expensesPaid: number;
599
+ mileage: number;
600
+ }
601
+ interface TaskPerformance {
602
+ startDateTime: string;
603
+ endDateTime: string;
604
+ duration: number;
605
+ salaryTotal: number;
606
+ }
607
+ interface TaskCreateRequest {
608
+ projectId: string;
609
+ description?: string;
610
+ location?: string;
611
+ locationEnd?: string;
612
+ startDateTime: string;
613
+ endDateTime?: string;
614
+ feeling?: number;
615
+ typeId?: number;
616
+ paid?: boolean;
617
+ billed?: boolean;
618
+ billable?: boolean;
619
+ phoneNumber?: string;
620
+ distance?: number;
621
+ rateId?: string;
622
+ todoId?: string;
623
+ signature?: string;
624
+ userId?: string;
625
+ tagIds?: string[];
626
+ }
627
+ interface TaskUpdateRequest {
628
+ projectId?: string;
629
+ description?: string;
630
+ location?: string;
631
+ locationEnd?: string;
632
+ startDateTime?: string;
633
+ endDateTime?: string;
634
+ feeling?: number;
635
+ typeId?: number;
636
+ paid?: boolean;
637
+ billed?: boolean;
638
+ billable?: boolean;
639
+ phoneNumber?: string;
640
+ distance?: number;
641
+ rateId?: string;
642
+ todoId?: string;
643
+ signature?: string;
644
+ deleted?: boolean;
645
+ tagIds?: string[];
646
+ }
647
+ interface TaskStatusUpdateRequest {
648
+ id: string;
649
+ status?: number;
650
+ paid?: boolean;
651
+ notBillable?: boolean;
652
+ unpaid?: boolean;
653
+ notBilled?: boolean;
654
+ billed?: boolean;
655
+ }
656
+ interface TaskTimesUpdateRequest {
657
+ id: string;
658
+ startDateTime: string;
659
+ endDateTime: string;
660
+ }
661
+ interface TaskListParams extends PageParams {
662
+ sort?: 'dateTime' | 'time' | 'created';
663
+ order?: 'asc' | 'desc';
664
+ organizationId?: string;
665
+ teamId?: string;
666
+ projectId?: string;
667
+ todoId?: string;
668
+ rateId?: string;
669
+ documentId?: string;
670
+ type?: string;
671
+ filter?: string;
672
+ teamIds?: string[];
673
+ projectIds?: string[];
674
+ tagIds?: string[];
675
+ taskIds?: string[];
676
+ userIds?: string[];
677
+ feelings?: number[];
678
+ populatePauses?: boolean;
679
+ populateExpenses?: boolean;
680
+ populateNotes?: boolean;
681
+ populateTags?: boolean;
682
+ performance?: boolean;
683
+ startDate?: string;
684
+ endDate?: string;
685
+ }
686
+
687
+ interface Organization {
688
+ id: string;
689
+ name: string;
690
+ description?: string;
691
+ image?: string;
692
+ color?: number;
693
+ created?: number;
694
+ lastUpdate?: number;
695
+ }
696
+ interface OrganizationList {
697
+ items: Organization[];
698
+ params: OrganizationListParams;
699
+ }
700
+ interface OrganizationCreateRequest {
701
+ name: string;
702
+ description?: string;
703
+ image?: string;
704
+ color?: number;
705
+ }
706
+ interface OrganizationUpdateRequest {
707
+ name?: string;
708
+ description?: string;
709
+ image?: string;
710
+ color?: number;
711
+ }
712
+ interface OrganizationListParams extends ListParams {
713
+ status?: string;
714
+ deleted?: boolean;
715
+ }
716
+
717
+ interface Timer {
718
+ status: 'running' | 'paused' | 'stopped';
719
+ user?: string;
720
+ task?: Task;
721
+ pause?: Pause;
722
+ lastUpdate?: number;
723
+ created?: number;
724
+ }
725
+ interface TimerStartRequest {
726
+ projectId: string;
727
+ startDateTime?: string;
728
+ }
729
+ interface TimerStopRequest {
730
+ endDateTime?: string;
731
+ }
732
+ interface TimerPauseRequest {
733
+ startDateTime?: string;
734
+ }
735
+ interface TimerResumeRequest {
736
+ endDateTime?: string;
737
+ }
738
+ interface TimerUpdateRequest {
739
+ startDateTime?: string;
740
+ description?: string;
741
+ location?: string;
742
+ locationEnd?: string;
743
+ feeling?: number;
744
+ typeId?: number;
745
+ paid?: boolean;
746
+ billed?: boolean;
747
+ billable?: boolean;
748
+ phoneNumber?: string;
749
+ distance?: number;
750
+ }
751
+
752
+ interface Document {
753
+ id: string;
754
+ organizationId?: string;
755
+ user?: string;
756
+ deleted?: boolean;
757
+ lastUpdate?: number;
758
+ created?: number;
759
+ image?: string;
760
+ company?: string;
761
+ companyDescription?: string;
762
+ companyAddressLine1?: string;
763
+ companyAddressLine2?: string;
764
+ companyAddressLine3?: string;
765
+ companyAddressLine4?: string;
766
+ customer?: string;
767
+ customerId?: string;
768
+ customerAddressLine1?: string;
769
+ customerAddressLine2?: string;
770
+ customerAddressLine3?: string;
771
+ customerAddressLine4?: string;
772
+ name?: string;
773
+ date?: string;
774
+ invoiceId?: string;
775
+ category?: number;
776
+ headline?: string;
777
+ description?: string;
778
+ terms?: string;
779
+ signature?: string;
780
+ payment?: number;
781
+ paymentDate?: string;
782
+ paymentMethod?: string;
783
+ taskSubtotal?: number;
784
+ expenseSubtotal?: number;
785
+ subtotal?: number;
786
+ tax?: number;
787
+ taxValue?: number;
788
+ taxSecond?: number;
789
+ taxSecondValue?: number;
790
+ discount?: number;
791
+ discountValue?: number;
792
+ total?: number;
793
+ duration?: number;
794
+ templateId?: string;
795
+ templateName?: string;
796
+ template?: boolean;
797
+ paid?: boolean;
798
+ approved?: boolean;
799
+ includeExpenses?: boolean;
800
+ includeNotes?: boolean;
801
+ useRelatives?: boolean;
802
+ hideTaxes?: boolean;
803
+ hideSummation?: boolean;
804
+ showSecondTax?: boolean;
805
+ showDiscount?: boolean;
806
+ showMemberName?: boolean;
807
+ showProjectTitle?: boolean;
808
+ showTags?: boolean;
809
+ hideTaskTime?: boolean;
810
+ hideRate?: boolean;
811
+ hideExpenseDateTime?: boolean;
812
+ discountSecondValue?: number;
813
+ showDiscountSecond?: boolean;
814
+ fieldDiscountSecond?: string;
815
+ fieldTitle?: string;
816
+ fieldItem?: string;
817
+ fieldDescription?: string;
818
+ fieldRate?: string;
819
+ fieldQuantity?: string;
820
+ fieldTotal?: string;
821
+ fieldTotalSum?: string;
822
+ fieldSubTotal?: string;
823
+ fieldTax?: string;
824
+ fieldSecondTax?: string;
825
+ fieldDiscount?: string;
826
+ fieldExpenseTitle?: string;
827
+ fieldExpenseTotal?: string;
828
+ tasks?: Task[];
829
+ expenses?: Expense[];
830
+ notes?: Note[];
831
+ saveAsTemplate?: boolean;
832
+ refreshTemplate?: boolean;
833
+ status?: number;
834
+ fullyPaid?: boolean;
835
+ partiallyPaid?: boolean;
836
+ invoice?: boolean;
837
+ timesheet?: boolean;
838
+ workRecord?: boolean;
839
+ }
840
+ interface DocumentList {
841
+ items: Document[];
842
+ params: DocumentListParams;
843
+ }
844
+ interface DocumentCreateRequest {
845
+ organizationId?: string;
846
+ image?: string;
847
+ company?: string;
848
+ companyDescription?: string;
849
+ companyAddressLine1?: string;
850
+ companyAddressLine2?: string;
851
+ companyAddressLine3?: string;
852
+ companyAddressLine4?: string;
853
+ customer?: string;
854
+ customerId?: string;
855
+ customerAddressLine1?: string;
856
+ customerAddressLine2?: string;
857
+ customerAddressLine3?: string;
858
+ customerAddressLine4?: string;
859
+ name?: string;
860
+ date?: string;
861
+ invoiceId?: string;
862
+ category?: number;
863
+ headline?: string;
864
+ description?: string;
865
+ terms?: string;
866
+ signature?: string;
867
+ payment?: number;
868
+ paymentDate?: string;
869
+ paymentMethod?: string;
870
+ taskSubtotal?: number;
871
+ expenseSubtotal?: number;
872
+ subtotal?: number;
873
+ tax?: number;
874
+ taxValue?: number;
875
+ taxSecond?: number;
876
+ taxSecondValue?: number;
877
+ discount?: number;
878
+ discountValue?: number;
879
+ total?: number;
880
+ duration?: number;
881
+ templateId?: string;
882
+ templateName?: string;
883
+ template?: boolean;
884
+ paid?: boolean;
885
+ approved?: boolean;
886
+ includeExpenses?: boolean;
887
+ includeNotes?: boolean;
888
+ useRelatives?: boolean;
889
+ hideTaxes?: boolean;
890
+ hideSummation?: boolean;
891
+ showSecondTax?: boolean;
892
+ showDiscount?: boolean;
893
+ showMemberName?: boolean;
894
+ showProjectTitle?: boolean;
895
+ showTags?: boolean;
896
+ hideTaskTime?: boolean;
897
+ hideRate?: boolean;
898
+ hideExpenseDateTime?: boolean;
899
+ discountSecondValue?: number;
900
+ showDiscountSecond?: boolean;
901
+ fieldDiscountSecond?: string;
902
+ fieldTitle?: string;
903
+ fieldItem?: string;
904
+ fieldDescription?: string;
905
+ fieldRate?: string;
906
+ fieldQuantity?: string;
907
+ fieldTotal?: string;
908
+ fieldTotalSum?: string;
909
+ fieldSubTotal?: string;
910
+ fieldTax?: string;
911
+ fieldSecondTax?: string;
912
+ fieldDiscount?: string;
913
+ fieldExpenseTitle?: string;
914
+ fieldExpenseTotal?: string;
915
+ taskIds?: string[];
916
+ expenseIds?: string[];
917
+ noteIds?: string[];
918
+ saveAsTemplate?: boolean;
919
+ refreshTemplate?: boolean;
920
+ }
921
+ interface DocumentUpdateRequest {
922
+ deleted?: boolean;
923
+ image?: string;
924
+ company?: string;
925
+ companyDescription?: string;
926
+ companyAddressLine1?: string;
927
+ companyAddressLine2?: string;
928
+ companyAddressLine3?: string;
929
+ companyAddressLine4?: string;
930
+ customer?: string;
931
+ customerId?: string;
932
+ customerAddressLine1?: string;
933
+ customerAddressLine2?: string;
934
+ customerAddressLine3?: string;
935
+ customerAddressLine4?: string;
936
+ name?: string;
937
+ date?: string;
938
+ invoiceId?: string;
939
+ category?: number;
940
+ headline?: string;
941
+ description?: string;
942
+ terms?: string;
943
+ signature?: string;
944
+ payment?: number;
945
+ paymentDate?: string;
946
+ paymentMethod?: string;
947
+ taskSubtotal?: number;
948
+ expenseSubtotal?: number;
949
+ subtotal?: number;
950
+ tax?: number;
951
+ taxValue?: number;
952
+ taxSecond?: number;
953
+ taxSecondValue?: number;
954
+ discount?: number;
955
+ discountValue?: number;
956
+ hideTaskTime?: boolean;
957
+ hideRate?: boolean;
958
+ hideExpenseDateTime?: boolean;
959
+ discountSecondValue?: number;
960
+ showDiscountSecond?: boolean;
961
+ fieldDiscountSecond?: string;
962
+ total?: number;
963
+ duration?: number;
964
+ templateId?: string;
965
+ templateName?: string;
966
+ template?: boolean;
967
+ paid?: boolean;
968
+ approved?: boolean;
969
+ includeExpenses?: boolean;
970
+ includeNotes?: boolean;
971
+ useRelatives?: boolean;
972
+ hideTaxes?: boolean;
973
+ hideSummation?: boolean;
974
+ showSecondTax?: boolean;
975
+ showDiscount?: boolean;
976
+ showMemberName?: boolean;
977
+ showProjectTitle?: boolean;
978
+ showTags?: boolean;
979
+ fieldTitle?: string;
980
+ fieldItem?: string;
981
+ fieldDescription?: string;
982
+ fieldRate?: string;
983
+ fieldQuantity?: string;
984
+ fieldTotal?: string;
985
+ fieldTotalSum?: string;
986
+ fieldSubTotal?: string;
987
+ fieldTax?: string;
988
+ fieldSecondTax?: string;
989
+ fieldDiscount?: string;
990
+ fieldExpenseTitle?: string;
991
+ fieldExpenseTotal?: string;
992
+ taskIds?: string[];
993
+ expenseIds?: string[];
994
+ noteIds?: string[];
995
+ saveAsTemplate?: boolean;
996
+ refreshTemplate?: boolean;
997
+ }
998
+ interface DocumentPrint {
999
+ id: string;
1000
+ zugferd?: boolean;
1001
+ }
1002
+ interface DocumentListParams extends ListParams {
1003
+ organizationId?: string;
1004
+ category?: number;
1005
+ status?: string;
1006
+ template?: boolean;
1007
+ empty?: boolean;
1008
+ }
1009
+
1010
+ interface Webhook {
1011
+ id: string;
1012
+ target: string;
1013
+ event: string;
1014
+ created?: number;
1015
+ lastUpdate?: number;
1016
+ }
1017
+ interface WebhookList {
1018
+ items: Webhook[];
1019
+ params: WebhookListParams;
1020
+ }
1021
+ interface WebhookCreateRequest {
1022
+ target: string;
1023
+ event: string;
1024
+ }
1025
+ interface WebhookUpdateRequest {
1026
+ target?: string;
1027
+ event?: string;
1028
+ }
1029
+ interface WebhookListParams extends ListParams {
1030
+ sort?: 'created' | 'lastUpdate' | 'target' | 'event';
1031
+ order?: 'asc' | 'desc';
1032
+ event?: string;
1033
+ }
1034
+
1035
+ interface Automation {
1036
+ id: string;
1037
+ project: Project;
1038
+ typeId: 0 | 1 | 2;
1039
+ action: 0 | 1 | 2;
1040
+ enabled: boolean;
1041
+ shared: boolean;
1042
+ address?: string;
1043
+ latitude?: number;
1044
+ longitude?: number;
1045
+ radius?: number;
1046
+ ssid?: string;
1047
+ beaconUUID?: string;
1048
+ name?: string;
1049
+ created?: number;
1050
+ lastUpdate?: number;
1051
+ }
1052
+ interface AutomationList {
1053
+ items: Automation[];
1054
+ params: AutomationListParams;
1055
+ }
1056
+ interface AutomationCreateRequest {
1057
+ projectId: string;
1058
+ typeId: 0 | 1 | 2;
1059
+ action: 0 | 1 | 2;
1060
+ enabled?: boolean;
1061
+ shared?: boolean;
1062
+ address?: string;
1063
+ latitude?: number;
1064
+ longitude?: number;
1065
+ radius?: number;
1066
+ ssid?: string;
1067
+ beaconUUID?: string;
1068
+ }
1069
+ interface AutomationUpdateRequest {
1070
+ enabled?: boolean;
1071
+ shared?: boolean;
1072
+ action?: 0 | 1 | 2;
1073
+ address?: string;
1074
+ latitude?: number;
1075
+ longitude?: number;
1076
+ radius?: number;
1077
+ }
1078
+ interface AutomationListParams extends ListParams {
1079
+ projectId?: string;
1080
+ status?: 'enabled' | 'disabled';
1081
+ typeId?: 0 | 1 | 2;
1082
+ }
1083
+
1084
+ interface Settings {
1085
+ theme?: 'light' | 'dark' | 'system';
1086
+ timezone?: string;
1087
+ language?: string;
1088
+ currency?: string;
1089
+ dateFormat?: string;
1090
+ timeFormat?: '12h' | '24h';
1091
+ firstDay?: number;
1092
+ timerRounding?: number;
1093
+ timerRoundingType?: 'up' | 'down' | 'nearest';
1094
+ pauseRounding?: number;
1095
+ }
1096
+ interface SettingsUpdateRequest extends Settings {
1097
+ }
1098
+
1099
+ interface Profile {
1100
+ email?: string;
1101
+ imageUrl?: string;
1102
+ firstname?: string;
1103
+ lastname?: string;
1104
+ }
1105
+ interface ProfileUpdateRequest {
1106
+ email?: string;
1107
+ imageUrl?: string;
1108
+ firstname?: string;
1109
+ lastname?: string;
1110
+ }
1111
+
1112
+ interface ResourceConfig {
1113
+ basePath: string;
1114
+ }
1115
+ declare abstract class Resource {
1116
+ protected readonly http: ApiClient;
1117
+ protected readonly basePath: string;
1118
+ protected constructor(http: ApiClient, config: ResourceConfig | string);
1119
+ protected createNavigablePage<R>(page: Page<R>, nextPageLoader: (page: number) => Promise<NavigablePage<R>>): NavigablePage<R>;
1120
+ }
1121
+
1122
+ declare class OrganizationResource extends Resource {
1123
+ constructor(client: ApiClient);
1124
+ list(params?: OrganizationListParams): Promise<NavigablePage<Organization>>;
1125
+ create(data: OrganizationCreateRequest): Promise<Organization>;
1126
+ update(id: string, data: OrganizationUpdateRequest): Promise<Organization>;
1127
+ get(id: string): Promise<Organization>;
1128
+ delete(id: string): Promise<void>;
1129
+ search(params: OrganizationListParams): Promise<NavigablePage<Organization>>;
1130
+ }
1131
+
1132
+ declare class TeamResource extends Resource {
1133
+ constructor(client: ApiClient);
1134
+ list(params?: TeamListParams): Promise<NavigablePage<Team>>;
1135
+ create(data: TeamCreateRequest): Promise<Team>;
1136
+ update(id: string, data: TeamUpdateRequest): Promise<Team>;
1137
+ get(id: string): Promise<Team>;
1138
+ delete(id: string): Promise<void>;
1139
+ search(params: TeamListParams): Promise<NavigablePage<Team>>;
1140
+ listMembers(teamId: string, params: TeamMemberListParams): Promise<NavigablePage<TeamMember>>;
1141
+ getMember(teamId: string, memberId: string): Promise<TeamMember>;
1142
+ getColleagues(params?: TeamMemberListParams): Promise<NavigablePage<TeamMember>>;
1143
+ }
1144
+
1145
+ declare class ProjectResource extends Resource {
1146
+ constructor(client: ApiClient);
1147
+ list(params?: ProjectListParams): Promise<NavigablePage<Project>>;
1148
+ create(data: ProjectCreateRequest): Promise<Project>;
1149
+ update(id: string, data: ProjectUpdateRequest): Promise<Project>;
1150
+ get(id: string): Promise<Project>;
1151
+ delete(id: string): Promise<void>;
1152
+ search(params: ProjectListParams): Promise<NavigablePage<Project>>;
1153
+ }
1154
+
1155
+ declare class TaskResource extends Resource {
1156
+ constructor(client: ApiClient);
1157
+ create(data: TaskCreateRequest): Promise<Task>;
1158
+ update(id: string, data: TaskUpdateRequest): Promise<Task>;
1159
+ get(id: string): Promise<Task>;
1160
+ delete(id: string): Promise<void>;
1161
+ search(params: TaskListParams): Promise<NavigablePage<Task>>;
1162
+ updateStatus(data: TaskStatusUpdateRequest): Promise<Task>;
1163
+ updateTimes(data: TaskTimesUpdateRequest): Promise<Task>;
1164
+ }
1165
+
1166
+ declare class RateResource extends Resource {
1167
+ constructor(client: ApiClient);
1168
+ list(params?: RateListParams): Promise<NavigablePage<Rate>>;
1169
+ create(data: RateCreateRequest): Promise<Rate>;
1170
+ update(id: string, data: RateUpdateRequest): Promise<Rate>;
1171
+ get(id: string): Promise<Rate>;
1172
+ delete(id: string): Promise<void>;
1173
+ search(params: RateListParams): Promise<NavigablePage<Rate>>;
1174
+ }
1175
+
1176
+ declare class TagResource extends Resource {
1177
+ constructor(client: ApiClient);
1178
+ list(params?: TagListParams): Promise<NavigablePage<Tag>>;
1179
+ create(data: TagCreateRequest): Promise<Tag>;
1180
+ update(id: string, data: TagUpdateRequest): Promise<Tag>;
1181
+ get(id: string): Promise<Tag>;
1182
+ delete(id: string): Promise<void>;
1183
+ search(params: TagListParams): Promise<NavigablePage<Tag>>;
1184
+ }
1185
+
1186
+ declare class ExpenseResource extends Resource {
1187
+ constructor(client: ApiClient);
1188
+ list(params?: ExpenseListParams): Promise<NavigablePage<Expense>>;
1189
+ create(data: ExpenseCreateRequest): Promise<Expense>;
1190
+ update(id: string, data: ExpenseUpdateRequest): Promise<Expense>;
1191
+ get(id: string): Promise<Expense>;
1192
+ delete(id: string): Promise<void>;
1193
+ search(params: ExpenseListParams): Promise<NavigablePage<Expense>>;
1194
+ updateStatus(id: string, data: ExpenseStatus): Promise<Expense>;
1195
+ }
1196
+
1197
+ declare class NoteResource extends Resource {
1198
+ constructor(client: ApiClient);
1199
+ list(params?: NoteListParams): Promise<NavigablePage<Note>>;
1200
+ create(data: NoteCreateRequest): Promise<Note>;
1201
+ update(id: string, data: NoteUpdateRequest): Promise<Note>;
1202
+ get(id: string): Promise<Note>;
1203
+ delete(id: string): Promise<void>;
1204
+ search(params: NoteListParams): Promise<NavigablePage<Note>>;
1205
+ }
1206
+
1207
+ declare class PauseResource extends Resource {
1208
+ constructor(client: ApiClient);
1209
+ list(params?: PauseListParams): Promise<NavigablePage<Pause>>;
1210
+ create(data: PauseCreateRequest): Promise<Pause>;
1211
+ update(id: string, data: PauseUpdateRequest): Promise<Pause>;
1212
+ get(id: string): Promise<Pause>;
1213
+ delete(id: string): Promise<void>;
1214
+ search(params: PauseListParams): Promise<NavigablePage<Pause>>;
1215
+ }
1216
+
1217
+ declare class ProfileResource {
1218
+ private readonly http;
1219
+ constructor(http: ApiClient);
1220
+ getProfile(): Promise<Profile>;
1221
+ updateProfile(data: ProfileUpdateRequest): Promise<Profile>;
1222
+ }
1223
+
1224
+ declare class SettingsResource {
1225
+ private readonly http;
1226
+ constructor(http: ApiClient);
1227
+ get(): Promise<Settings>;
1228
+ update(data: SettingsUpdateRequest): Promise<Settings>;
1229
+ }
1230
+
1231
+ declare class AutomationResource extends Resource {
1232
+ constructor(client: ApiClient);
1233
+ list(params?: AutomationListParams): Promise<NavigablePage<Automation>>;
1234
+ create(data: AutomationCreateRequest): Promise<Automation>;
1235
+ update(id: string, data: AutomationUpdateRequest): Promise<Automation>;
1236
+ get(id: string): Promise<Automation>;
1237
+ delete(id: string): Promise<void>;
1238
+ search(params: AutomationListParams): Promise<NavigablePage<Automation>>;
1239
+ }
1240
+
1241
+ declare class DocumentResource extends Resource {
1242
+ constructor(client: ApiClient);
1243
+ list(params?: DocumentListParams): Promise<NavigablePage<Document>>;
1244
+ create(data: DocumentCreateRequest): Promise<Document>;
1245
+ update(id: string, data: DocumentUpdateRequest): Promise<Document>;
1246
+ get(id: string): Promise<Document>;
1247
+ delete(id: string): Promise<void>;
1248
+ search(params: DocumentListParams): Promise<NavigablePage<Document>>;
1249
+ }
1250
+
1251
+ declare class TimerResource {
1252
+ private readonly http;
1253
+ constructor(http: ApiClient);
1254
+ get(): Promise<Timer>;
1255
+ start(data: TimerStartRequest): Promise<Timer>;
1256
+ stop(data?: TimerStopRequest): Promise<Timer>;
1257
+ pause(data?: TimerPauseRequest): Promise<Timer>;
1258
+ resume(data?: TimerResumeRequest): Promise<Timer>;
1259
+ update(data: TimerUpdateRequest): Promise<Timer>;
1260
+ }
1261
+
1262
+ declare class TodoResource extends Resource {
1263
+ constructor(client: ApiClient);
1264
+ list(params?: TodoListParams): Promise<NavigablePage<Todo>>;
1265
+ create(data: TodoCreateRequest): Promise<Todo>;
1266
+ update(id: string, data: TodoUpdateRequest): Promise<Todo>;
1267
+ get(id: string): Promise<Todo>;
1268
+ delete(id: string): Promise<void>;
1269
+ search(params: TodoListParams): Promise<NavigablePage<Todo>>;
1270
+ }
1271
+
1272
+ declare class WebhookResource extends Resource {
1273
+ constructor(client: ApiClient);
1274
+ list(params?: WebhookListParams): Promise<NavigablePage<Webhook>>;
1275
+ create(data: WebhookCreateRequest): Promise<Webhook>;
1276
+ update(id: string, data: WebhookUpdateRequest): Promise<Webhook>;
1277
+ get(id: string): Promise<Webhook>;
1278
+ delete(id: string): Promise<void>;
1279
+ search(params: WebhookListParams): Promise<NavigablePage<Webhook>>;
1280
+ }
1281
+
1282
+ declare class TimesheetApiError extends Error {
1283
+ readonly statusCode?: number;
1284
+ readonly responseBody?: string;
1285
+ readonly errorCode?: string;
1286
+ constructor(message: string, statusCode?: number, responseBody?: string, errorCode?: string);
1287
+ }
1288
+
1289
+ declare class TimesheetAuthError extends TimesheetApiError {
1290
+ constructor(message: string, statusCode?: number, responseBody?: string);
1291
+ }
1292
+
1293
+ declare class TimesheetRateLimitError extends TimesheetApiError {
1294
+ readonly retryAfter?: string;
1295
+ constructor(message: string, retryAfter?: string);
1296
+ getRetryAfterDate(): Date | null;
1297
+ }
1298
+
1299
+ declare class TimesheetClient {
1300
+ private readonly apiClient;
1301
+ readonly organizations: OrganizationResource;
1302
+ readonly teams: TeamResource;
1303
+ readonly projects: ProjectResource;
1304
+ readonly tasks: TaskResource;
1305
+ readonly rates: RateResource;
1306
+ readonly tags: TagResource;
1307
+ readonly expenses: ExpenseResource;
1308
+ readonly notes: NoteResource;
1309
+ readonly pauses: PauseResource;
1310
+ readonly profile: ProfileResource;
1311
+ readonly settings: SettingsResource;
1312
+ readonly automations: AutomationResource;
1313
+ readonly documents: DocumentResource;
1314
+ readonly timer: TimerResource;
1315
+ readonly todos: TodoResource;
1316
+ readonly webhooks: WebhookResource;
1317
+ constructor(options: TimesheetClientOptions);
1318
+ private createAuthentication;
1319
+ }
1320
+ interface TimesheetClientOptions {
1321
+ apiKey?: string;
1322
+ oauth2Token?: string;
1323
+ oauth2?: {
1324
+ clientId: string;
1325
+ clientSecret: string;
1326
+ refreshToken: string;
1327
+ };
1328
+ authentication?: Authentication;
1329
+ baseUrl?: string;
1330
+ retryConfig?: RetryConfig;
1331
+ httpClient?: AxiosInstance;
1332
+ }
1333
+ declare function createClient(options: TimesheetClientOptions): TimesheetClient;
1334
+
1335
+ export { type Activity, ApiClient, ApiKeyAuth, type Authentication, type Automation, type AutomationCreateRequest, type AutomationList, type AutomationListParams, AutomationResource, type AutomationUpdateRequest, type ClientConfig, type Document, type DocumentCreateRequest, type DocumentList, type DocumentListParams, type DocumentPrint, DocumentResource, type DocumentUpdateRequest, type Expense, type ExpenseCreateRequest, type ExpenseList, type ExpenseListParams, ExpenseResource, type ExpenseStatus, type ExpenseUpdateRequest, type ListParams, type Member, NavigablePage, type Note, type NoteCreateRequest, type NoteList, type NoteListParams, NoteResource, type NoteUpdateRequest, OAuth2Auth, type Organization, type OrganizationCreateRequest, type OrganizationList, type OrganizationListParams, OrganizationResource, type OrganizationUpdateRequest, type Page, type PageParams, type Pause, type PauseCreateRequest, type PauseList, type PauseListParams, PauseResource, type PauseUpdateRequest, type Profile, ProfileResource, type ProfileUpdateRequest, type Project, type ProjectCreateRequest, type ProjectList, type ProjectListParams, type ProjectMember, ProjectResource, type ProjectUpdateRequest, type Rate, type RateCreateRequest, type RateList, type RateListParams, RateResource, type RateUpdateRequest, Resource, RetryConfig, type RetryConfigOptions, type Settings, SettingsResource, type SettingsUpdateRequest, type SortablePageParams, type Tag, type TagCreateRequest, type TagList, type TagListParams, TagResource, type TagUpdateRequest, type Task, type TaskCreateRequest, type TaskList, type TaskListParams, type TaskPerformance, TaskResource, type TaskStatistic, type TaskStatusUpdateRequest, type TaskTimesUpdateRequest, type TaskUpdateRequest, type Team, type TeamCreateRequest, type TeamList, type TeamListParams, type TeamMember, type TeamMemberList, type TeamMemberListParams, TeamResource, type TeamUpdateRequest, type Timer, type TimerPauseRequest, TimerResource, type TimerResumeRequest, type TimerStartRequest, type TimerStopRequest, type TimerUpdateRequest, TimesheetApiError, TimesheetAuthError, TimesheetClient, type TimesheetClientOptions, TimesheetRateLimitError, type Todo, type TodoCreateRequest, type TodoList, type TodoListParams, TodoResource, type TodoUpdateRequest, type Webhook, type WebhookCreateRequest, type WebhookList, type WebhookListParams, WebhookResource, type WebhookUpdateRequest, createClient };