-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
5244 lines (4587 loc) · 220 KB
/
app.js
File metadata and controls
5244 lines (4587 loc) · 220 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
class AsanaAPIExplorer {
constructor() {
this.endpoints = [];
this.filteredEndpoints = [];
this.currentMethodFilter = 'all';
this.searchTerm = '';
this.personalAccessToken = '';
this.isTokenValid = false;
this.baseUrl = 'https://app.asana.com/api/1.0';
this.storageKey = 'asana-api-explorer-pat';
// Sequence management
this.apiSequence = [];
this.sequenceResults = new Map(); // Store results from previous calls
this.sequencePanelOpen = false;
this.currentSequenceItem = null; // Current item being executed
// Panel resize management
this.panelWidthStorageKey = 'asana-api-explorer-panel-width';
this.defaultPanelWidth = 400;
this.minPanelWidth = 300;
this.maxPanelWidth = window.innerWidth * 0.8;
this.currentPanelWidth = this.defaultPanelWidth;
this.isResizing = false;
// Data transformation management
this.dataTransformations = {
fieldMappings: [], // [{ sourceField: '', targetField: '', isUnified: false }]
unifiedColumns: [] // [{ name: '', formatTemplate: '', sourceFields: [] }]
};
this.transformedData = null;
this.loadPATFromStorage();
this.loadPanelWidth();
this.init();
}
async init() {
try {
await this.loadAsanaAPISpec();
this.setupEventListeners();
this.setupPanelResize();
this.restorePATToInput();
this.renderEndpoints();
this.updateStats();
// Apply panel width after everything is set up
setTimeout(() => {
this.applyPanelWidth();
}, 100);
} catch (error) {
this.showError('Failed to load Asana API specification: ' + error.message);
}
}
async loadAsanaAPISpec() {
try {
// Load the Asana OpenAPI specification
const response = await fetch('https://raw.githubusercontent.com/Asana/openapi/master/defs/asana_oas.yaml');
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const yamlText = await response.text();
// Parse YAML to extract endpoints
this.parseYAMLSpec(yamlText);
// If we didn't get enough endpoints, add comprehensive sample data
if (this.endpoints.length < 50) {
console.log(`Only found ${this.endpoints.length} endpoints from parsing, adding comprehensive sample data`);
this.createComprehensiveEndpoints();
}
} catch (error) {
console.warn('Failed to load OpenAPI spec:', error);
// Fallback: create comprehensive endpoints
this.createComprehensiveEndpoints();
}
}
parseYAMLSpec(yamlText) {
// Enhanced YAML parser for paths section
const lines = yamlText.split('\n');
let inPaths = false;
let currentPath = '';
let currentMethod = '';
let currentEndpoint = null;
let pathIndent = 0;
let methodIndent = 0;
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
const trimmed = line.trim();
const lineIndent = line.length - line.trimLeft().length;
// Find the paths section
if (trimmed === 'paths:') {
inPaths = true;
continue;
}
if (!inPaths) continue;
// Stop if we hit another top-level section (no indentation)
if (lineIndent === 0 && trimmed && !trimmed.startsWith('/')) {
inPaths = false;
break;
}
// Path definition (starts with / and ends with :)
if (trimmed.startsWith('/') && trimmed.endsWith(':') && lineIndent >= 2) {
// Save previous endpoint if exists
if (currentEndpoint && currentEndpoint.path && currentEndpoint.method) {
this.endpoints.push({ ...currentEndpoint });
}
currentPath = trimmed.slice(0, -1);
pathIndent = lineIndent;
currentEndpoint = null;
continue;
}
// HTTP method (must be under a path)
if (currentPath && ['get:', 'post:', 'put:', 'patch:', 'delete:', 'head:', 'options:'].includes(trimmed) && lineIndent > pathIndent) {
// Save previous endpoint if exists
if (currentEndpoint && currentEndpoint.path && currentEndpoint.method) {
this.endpoints.push({ ...currentEndpoint });
}
currentMethod = trimmed.slice(0, -1).toUpperCase();
methodIndent = lineIndent;
currentEndpoint = {
path: currentPath,
method: currentMethod,
summary: '',
description: '',
tags: [],
operationId: '',
security: []
};
continue;
}
// Extract endpoint details (must be under a method)
if (currentEndpoint && lineIndent > methodIndent) {
if (trimmed.startsWith('summary:')) {
const summary = trimmed.replace('summary:', '').trim();
if (summary.startsWith('"') && summary.endsWith('"')) {
currentEndpoint.summary = summary.slice(1, -1);
} else if (summary.startsWith("'") && summary.endsWith("'")) {
currentEndpoint.summary = summary.slice(1, -1);
} else {
currentEndpoint.summary = summary;
}
} else if (trimmed.startsWith('description:')) {
let desc = trimmed.replace('description:', '').trim();
// Handle quoted descriptions
if (desc.startsWith('"') || desc.startsWith("'")) {
const quote = desc[0];
desc = desc.slice(1);
if (desc.endsWith(quote)) {
desc = desc.slice(0, -1);
}
}
// Handle multi-line descriptions
if (desc === '|-' || desc === '|' || desc === '>-' || desc === '>') {
desc = '';
let j = i + 1;
while (j < lines.length && lines[j] && lines[j].length - lines[j].trimLeft().length > lineIndent) {
const descLine = lines[j].trim();
if (descLine) {
desc += (desc ? ' ' : '') + descLine;
}
j++;
}
i = j - 1; // Skip processed lines
}
currentEndpoint.description = desc;
} else if (trimmed.startsWith('operationId:')) {
currentEndpoint.operationId = trimmed.replace('operationId:', '').trim();
} else if (trimmed === 'tags:') {
// Handle tags array
let j = i + 1;
while (j < lines.length && lines[j] && lines[j].length - lines[j].trimLeft().length > lineIndent) {
const tagLine = lines[j].trim();
if (tagLine.startsWith('- ')) {
currentEndpoint.tags.push(tagLine.substring(2).trim());
}
j++;
}
i = j - 1; // Skip processed lines
}
}
}
// Add the last endpoint if exists
if (currentEndpoint && currentEndpoint.path && currentEndpoint.method) {
this.endpoints.push(currentEndpoint);
}
console.log(`Parsed ${this.endpoints.length} endpoints from OpenAPI spec`);
}
createComprehensiveEndpoints() {
// Create comprehensive sample endpoints based on the Asana API
this.endpoints = [
// Access Requests
{
path: '/access_requests',
method: 'GET',
summary: 'Get access requests',
description: 'Returns the pending access requests for a target object or a target object filtered by user.',
tags: ['Access requests'],
operationId: 'getAccessRequests',
security: ['oauth2']
},
{
path: '/access_requests',
method: 'POST',
summary: 'Create an access request',
description: 'Creates an access request for the specified target object.',
tags: ['Access requests'],
operationId: 'createAccessRequest',
security: ['oauth2']
},
{
path: '/access_requests/{access_request_gid}/approve',
method: 'POST',
summary: 'Approve an access request',
description: 'Approves the specified access request.',
tags: ['Access requests'],
operationId: 'approveAccessRequest',
security: ['oauth2']
},
{
path: '/access_requests/{access_request_gid}/reject',
method: 'POST',
summary: 'Reject an access request',
description: 'Rejects the specified access request.',
tags: ['Access requests'],
operationId: 'rejectAccessRequest',
security: ['oauth2']
},
// Allocations
{
path: '/allocations/{allocation_gid}',
method: 'GET',
summary: 'Get an allocation',
description: 'Returns the complete allocation record for a single allocation.',
tags: ['Allocations'],
operationId: 'getAllocation',
security: ['oauth2']
},
{
path: '/allocations/{allocation_gid}',
method: 'PUT',
summary: 'Update an allocation',
description: 'Updates the allocation and returns the updated allocation record.',
tags: ['Allocations'],
operationId: 'updateAllocation',
security: ['oauth2']
},
{
path: '/allocations/{allocation_gid}',
method: 'DELETE',
summary: 'Delete an allocation',
description: 'Deletes the allocation.',
tags: ['Allocations'],
operationId: 'deleteAllocation',
security: ['oauth2']
},
{
path: '/allocations',
method: 'GET',
summary: 'Get multiple allocations',
description: 'Returns the compact allocation records for some filtered set of allocations.',
tags: ['Allocations'],
operationId: 'getAllocations',
security: ['oauth2']
},
{
path: '/allocations',
method: 'POST',
summary: 'Create an allocation',
description: 'Creates a new allocation and returns the created allocation record.',
tags: ['Allocations'],
operationId: 'createAllocation',
security: ['oauth2']
},
// Attachments
{
path: '/attachments/{attachment_gid}',
method: 'GET',
summary: 'Get an attachment',
description: 'Returns the full record for a single attachment.',
tags: ['Attachments'],
operationId: 'getAttachment',
security: ['oauth2']
},
{
path: '/attachments/{attachment_gid}',
method: 'DELETE',
summary: 'Delete an attachment',
description: 'Deletes a specific, existing attachment.',
tags: ['Attachments'],
operationId: 'deleteAttachment',
security: ['oauth2']
},
{
path: '/attachments',
method: 'GET',
summary: 'Get attachments from an object',
description: 'Returns the compact records for attachments on an object.',
tags: ['Attachments'],
operationId: 'getAttachmentsForObject',
security: ['oauth2']
},
{
path: '/attachments',
method: 'POST',
summary: 'Create an attachment',
description: 'Creates an attachment by uploading a file and attaching it to the specified parent.',
tags: ['Attachments'],
operationId: 'createAttachmentForObject',
security: ['oauth2']
},
// Audit Log API
{
path: '/workspaces/{workspace_gid}/audit_log_events',
method: 'GET',
summary: 'Get audit log events',
description: 'Retrieve the audit log events that have been captured in your domain.',
tags: ['Audit log API'],
operationId: 'getAuditLogEvents',
security: ['oauth2']
},
// Batch API
{
path: '/batch',
method: 'POST',
summary: 'Submit parallel requests',
description: 'Make multiple API requests in parallel.',
tags: ['Batch API'],
operationId: 'createBatchRequest',
security: ['oauth2']
},
// Custom Fields
{
path: '/custom_fields/{custom_field_gid}',
method: 'GET',
summary: 'Get a custom field',
description: 'Returns the complete definition of a custom field\'s metadata.',
tags: ['Custom fields'],
operationId: 'getCustomField',
security: ['oauth2']
},
{
path: '/custom_fields/{custom_field_gid}',
method: 'PUT',
summary: 'Update a custom field',
description: 'Updates a custom field\'s metadata and returns the updated custom field.',
tags: ['Custom fields'],
operationId: 'updateCustomField',
security: ['oauth2']
},
{
path: '/custom_fields/{custom_field_gid}',
method: 'DELETE',
summary: 'Delete a custom field',
description: 'A specific, existing custom field can be deleted by making a DELETE request.',
tags: ['Custom fields'],
operationId: 'deleteCustomField',
security: ['oauth2']
},
{
path: '/custom_fields',
method: 'GET',
summary: 'Get multiple custom fields',
description: 'Returns a list of the compact representation of all of the custom fields in a workspace.',
tags: ['Custom fields'],
operationId: 'getCustomFields',
security: ['oauth2']
},
{
path: '/custom_fields',
method: 'POST',
summary: 'Create a custom field',
description: 'Creates a new custom field in a workspace.',
tags: ['Custom fields'],
operationId: 'createCustomField',
security: ['oauth2']
},
// Events
{
path: '/events',
method: 'GET',
summary: 'Get events on a resource',
description: 'Returns the full record for all events that have occurred since the sync token was created.',
tags: ['Events'],
operationId: 'getEvents',
security: ['oauth2']
},
// Goals
{
path: '/goals/{goal_gid}',
method: 'GET',
summary: 'Get a goal',
description: 'Returns the complete goal record for a single goal.',
tags: ['Goals'],
operationId: 'getGoal',
security: ['oauth2']
},
{
path: '/goals/{goal_gid}',
method: 'PUT',
summary: 'Update a goal',
description: 'Updates the goal and returns the updated goal record.',
tags: ['Goals'],
operationId: 'updateGoal',
security: ['oauth2']
},
{
path: '/goals/{goal_gid}',
method: 'DELETE',
summary: 'Delete a goal',
description: 'Deletes the goal.',
tags: ['Goals'],
operationId: 'deleteGoal',
security: ['oauth2']
},
// Jobs
{
path: '/jobs/{job_gid}',
method: 'GET',
summary: 'Get a job by id',
description: 'Returns the full record for a job.',
tags: ['Jobs'],
operationId: 'getJob',
security: ['oauth2']
},
// Memberships
{
path: '/memberships',
method: 'GET',
summary: 'Get multiple memberships',
description: 'Returns the compact membership records for the project or team.',
tags: ['Memberships'],
operationId: 'getMemberships',
security: ['oauth2']
},
{
path: '/memberships',
method: 'POST',
summary: 'Create a membership',
description: 'Creates a new membership and returns the membership record.',
tags: ['Memberships'],
operationId: 'createMembership',
security: ['oauth2']
},
{
path: '/memberships/{membership_gid}',
method: 'GET',
summary: 'Get a membership',
description: 'Returns the complete membership record for a single membership.',
tags: ['Memberships'],
operationId: 'getMembership',
security: ['oauth2']
},
{
path: '/memberships/{membership_gid}',
method: 'PUT',
summary: 'Update a membership',
description: 'Updates the membership and returns the updated membership record.',
tags: ['Memberships'],
operationId: 'updateMembership',
security: ['oauth2']
},
{
path: '/memberships/{membership_gid}',
method: 'DELETE',
summary: 'Delete a membership',
description: 'Deletes the membership.',
tags: ['Memberships'],
operationId: 'deleteMembership',
security: ['oauth2']
},
// Portfolios
{
path: '/portfolios',
method: 'GET',
summary: 'Get multiple portfolios',
description: 'Returns a list of the portfolios in compact representation that are owned by the current API user.',
tags: ['Portfolios'],
operationId: 'getPortfolios',
security: ['oauth2']
},
{
path: '/portfolios',
method: 'POST',
summary: 'Create a portfolio',
description: 'Creates a new portfolio and returns the created portfolio record.',
tags: ['Portfolios'],
operationId: 'createPortfolio',
security: ['oauth2']
},
{
path: '/portfolios/{portfolio_gid}',
method: 'GET',
summary: 'Get a portfolio',
description: 'Returns the complete portfolio record for a single portfolio.',
tags: ['Portfolios'],
operationId: 'getPortfolio',
security: ['oauth2']
},
{
path: '/portfolios/{portfolio_gid}',
method: 'PUT',
summary: 'Update a portfolio',
description: 'Updates the portfolio and returns the updated portfolio record.',
tags: ['Portfolios'],
operationId: 'updatePortfolio',
security: ['oauth2']
},
{
path: '/portfolios/{portfolio_gid}',
method: 'DELETE',
summary: 'Delete a portfolio',
description: 'Deletes the portfolio.',
tags: ['Portfolios'],
operationId: 'deletePortfolio',
security: ['oauth2']
},
// Projects
{
path: '/projects',
method: 'GET',
summary: 'Get multiple projects',
description: 'Returns the compact project records for some filtered set of projects.',
tags: ['Projects'],
operationId: 'getProjects',
security: ['oauth2']
},
{
path: '/projects',
method: 'POST',
summary: 'Create a project',
description: 'Creates a new project and returns the created project record.',
tags: ['Projects'],
operationId: 'createProject',
security: ['oauth2']
},
{
path: '/projects/{project_gid}',
method: 'GET',
summary: 'Get a project',
description: 'Returns the complete project record for a single project.',
tags: ['Projects'],
operationId: 'getProject',
security: ['oauth2']
},
{
path: '/projects/{project_gid}',
method: 'PUT',
summary: 'Update a project',
description: 'Updates the project and returns the updated project record.',
tags: ['Projects'],
operationId: 'updateProject',
security: ['oauth2']
},
{
path: '/projects/{project_gid}',
method: 'DELETE',
summary: 'Delete a project',
description: 'Deletes the project.',
tags: ['Projects'],
operationId: 'deleteProject',
security: ['oauth2']
},
// Tasks
{
path: '/tasks',
method: 'GET',
summary: 'Get multiple tasks',
description: 'Returns the compact task records for some filtered set of tasks.',
tags: ['Tasks'],
operationId: 'getTasks',
security: ['oauth2']
},
{
path: '/tasks',
method: 'POST',
summary: 'Create a task',
description: 'Creates a new task and returns the created task record.',
tags: ['Tasks'],
operationId: 'createTask',
security: ['oauth2']
},
{
path: '/tasks/{task_gid}',
method: 'GET',
summary: 'Get a task',
description: 'Returns the complete task record for a single task.',
tags: ['Tasks'],
operationId: 'getTask',
security: ['oauth2']
},
{
path: '/tasks/{task_gid}',
method: 'PUT',
summary: 'Update a task',
description: 'Updates the task and returns the updated task record.',
tags: ['Tasks'],
operationId: 'updateTask',
security: ['oauth2']
},
{
path: '/tasks/{task_gid}',
method: 'DELETE',
summary: 'Delete a task',
description: 'Deletes the task.',
tags: ['Tasks'],
operationId: 'deleteTask',
security: ['oauth2']
},
// Teams
{
path: '/teams',
method: 'GET',
summary: 'Get teams in an organization',
description: 'Returns the compact records for all teams in the organization visible to the requesting user.',
tags: ['Teams'],
operationId: 'getTeams',
security: ['oauth2']
},
{
path: '/teams/{team_gid}',
method: 'GET',
summary: 'Get a team',
description: 'Returns the complete team record for a single team.',
tags: ['Teams'],
operationId: 'getTeam',
security: ['oauth2']
},
// Users
{
path: '/users',
method: 'GET',
summary: 'Get multiple users',
description: 'Returns the user records for all users in all workspaces and organizations accessible to the authenticated user.',
tags: ['Users'],
operationId: 'getUsers',
security: ['oauth2']
},
{
path: '/users/{user_gid}',
method: 'GET',
summary: 'Get a user',
description: 'Returns the complete user record for a single user.',
tags: ['Users'],
operationId: 'getUser',
security: ['oauth2']
},
{
path: '/users/me',
method: 'GET',
summary: 'Get current user',
description: 'Returns the complete user record for the currently authenticated user.',
tags: ['Users'],
operationId: 'getMe',
security: ['oauth2']
},
// Workspaces
{
path: '/workspaces',
method: 'GET',
summary: 'Get multiple workspaces',
description: 'Returns the compact records for all workspaces visible to the authenticated user.',
tags: ['Workspaces'],
operationId: 'getWorkspaces',
security: ['oauth2']
},
{
path: '/workspaces/{workspace_gid}',
method: 'GET',
summary: 'Get a workspace',
description: 'Returns the complete workspace record for a single workspace.',
tags: ['Workspaces'],
operationId: 'getWorkspace',
security: ['oauth2']
},
{
path: '/workspaces/{workspace_gid}',
method: 'PUT',
summary: 'Update a workspace',
description: 'Updates the workspace and returns the updated workspace record.',
tags: ['Workspaces'],
operationId: 'updateWorkspace',
security: ['oauth2']
},
// Webhooks
{
path: '/webhooks',
method: 'GET',
summary: 'Get multiple webhooks',
description: 'Returns the compact representation of all webhooks your app has registered for the authenticated user.',
tags: ['Webhooks'],
operationId: 'getWebhooks',
security: ['oauth2']
},
{
path: '/webhooks',
method: 'POST',
summary: 'Establish a webhook',
description: 'Establishing a webhook is a two-part process.',
tags: ['Webhooks'],
operationId: 'createWebhook',
security: ['oauth2']
},
{
path: '/webhooks/{webhook_gid}',
method: 'GET',
summary: 'Get a webhook',
description: 'Returns the full record for the given webhook.',
tags: ['Webhooks'],
operationId: 'getWebhook',
security: ['oauth2']
},
{
path: '/webhooks/{webhook_gid}',
method: 'PUT',
summary: 'Update a webhook',
description: 'Updates the webhook and returns the updated webhook record.',
tags: ['Webhooks'],
operationId: 'updateWebhook',
security: ['oauth2']
},
{
path: '/webhooks/{webhook_gid}',
method: 'DELETE',
summary: 'Delete a webhook',
description: 'Deletes the webhook.',
tags: ['Webhooks'],
operationId: 'deleteWebhook',
security: ['oauth2']
},
// Additional comprehensive endpoints
// Stories
{
path: '/stories/{story_gid}',
method: 'GET',
summary: 'Get a story',
description: 'Returns the full record for a single story.',
tags: ['Stories'],
operationId: 'getStory',
security: ['oauth2']
},
{
path: '/stories/{story_gid}',
method: 'PUT',
summary: 'Update a story',
description: 'Updates the story and returns the complete updated story record.',
tags: ['Stories'],
operationId: 'updateStory',
security: ['oauth2']
},
{
path: '/stories/{story_gid}',
method: 'DELETE',
summary: 'Delete a story',
description: 'Deletes the story.',
tags: ['Stories'],
operationId: 'deleteStory',
security: ['oauth2']
},
// Sections
{
path: '/sections',
method: 'POST',
summary: 'Create a section',
description: 'Creates a new section and returns the created section record.',
tags: ['Sections'],
operationId: 'createSection',
security: ['oauth2']
},
{
path: '/sections/{section_gid}',
method: 'GET',
summary: 'Get a section',
description: 'Returns the complete section record for a single section.',
tags: ['Sections'],
operationId: 'getSection',
security: ['oauth2']
},
{
path: '/sections/{section_gid}',
method: 'PUT',
summary: 'Update a section',
description: 'Updates the section and returns the updated section record.',
tags: ['Sections'],
operationId: 'updateSection',
security: ['oauth2']
},
{
path: '/sections/{section_gid}',
method: 'DELETE',
summary: 'Delete a section',
description: 'Deletes the section.',
tags: ['Sections'],
operationId: 'deleteSection',
security: ['oauth2']
},
{
path: '/projects/{project_gid}/sections',
method: 'GET',
summary: 'Get sections in a project',
description: 'Returns the compact records for all sections in the specified project.',
tags: ['Sections'],
operationId: 'getSectionsForProject',
security: ['oauth2']
},
// Task Dependencies
{
path: '/tasks/{task_gid}/dependencies',
method: 'GET',
summary: 'Get dependencies from a task',
description: 'Returns the dependencies of a task.',
tags: ['Tasks', 'Dependencies'],
operationId: 'getDependenciesForTask',
security: ['oauth2']
},
{
path: '/tasks/{task_gid}/dependents',
method: 'GET',
summary: 'Get dependents from a task',
description: 'Returns the dependents of a task.',
tags: ['Tasks', 'Dependencies'],
operationId: 'getDependentsForTask',
security: ['oauth2']
},
{
path: '/tasks/{task_gid}/addDependencies',
method: 'POST',
summary: 'Set dependencies for a task',
description: 'Marks a set of tasks as dependencies of this task.',
tags: ['Tasks', 'Dependencies'],
operationId: 'addDependenciesForTask',
security: ['oauth2']
},
{
path: '/tasks/{task_gid}/removeDependencies',
method: 'POST',
summary: 'Unlink dependencies from a task',
description: 'Unlinks a set of dependencies from this task.',
tags: ['Tasks', 'Dependencies'],
operationId: 'removeDependenciesForTask',
security: ['oauth2']
},
// Task Followers
{
path: '/tasks/{task_gid}/addFollowers',
method: 'POST',
summary: 'Add followers to a task',
description: 'Adds followers to a task.',
tags: ['Tasks', 'Followers'],
operationId: 'addFollowersForTask',
security: ['oauth2']
},
{
path: '/tasks/{task_gid}/removeFollowers',
method: 'POST',
summary: 'Remove followers from a task',
description: 'Removes followers from a task.',
tags: ['Tasks', 'Followers'],
operationId: 'removeFollowersForTask',
security: ['oauth2']
},
// Task Projects
{
path: '/tasks/{task_gid}/addProject',
method: 'POST',
summary: 'Add a project to a task',
description: 'Adds the task to the specified project.',
tags: ['Tasks', 'Projects'],
operationId: 'addProjectForTask',
security: ['oauth2']
},
{
path: '/tasks/{task_gid}/removeProject',
method: 'POST',
summary: 'Remove a project from a task',
description: 'Removes the task from the specified project.',
tags: ['Tasks', 'Projects'],
operationId: 'removeProjectForTask',
security: ['oauth2']
},
// Subtasks
{
path: '/tasks/{task_gid}/subtasks',
method: 'GET',
summary: 'Get subtasks from a task',
description: 'Returns a compact representation of all the subtasks of a task.',
tags: ['Tasks', 'Subtasks'],
operationId: 'getSubtasksForTask',
security: ['oauth2']
},
{
path: '/tasks/{task_gid}/subtasks',
method: 'POST',
summary: 'Create a subtask',
description: 'Creates a new subtask and adds it to the parent task.',
tags: ['Tasks', 'Subtasks'],
operationId: 'createSubtaskForTask',
security: ['oauth2']
},
// Time Tracking
{
path: '/tasks/{task_gid}/time_tracking_entries',
method: 'GET',
summary: 'Get time tracking entries from a task',
description: 'Returns time tracking entries from a task.',
tags: ['Time tracking entries'],
operationId: 'getTimeTrackingEntriesForTask',
security: ['oauth2']
},
{
path: '/tasks/{task_gid}/time_tracking_entries',
method: 'POST',
summary: 'Create a time tracking entry',
description: 'Creates a time tracking entry on a task.',
tags: ['Time tracking entries'],
operationId: 'createTimeTrackingEntry',
security: ['oauth2']
},
{
path: '/time_tracking_entries/{time_tracking_entry_gid}',
method: 'GET',
summary: 'Get a time tracking entry',
description: 'Returns the complete time tracking entry record for a single time tracking entry.',
tags: ['Time tracking entries'],
operationId: 'getTimeTrackingEntry',
security: ['oauth2']
},
{
path: '/time_tracking_entries/{time_tracking_entry_gid}',
method: 'PUT',
summary: 'Update a time tracking entry',
description: 'Updates the time tracking entry and returns the updated record.',
tags: ['Time tracking entries'],
operationId: 'updateTimeTrackingEntry',
security: ['oauth2']
},
{
path: '/time_tracking_entries/{time_tracking_entry_gid}',
method: 'DELETE',
summary: 'Delete a time tracking entry',
description: 'Deletes the time tracking entry.',
tags: ['Time tracking entries'],
operationId: 'deleteTimeTrackingEntry',
security: ['oauth2']
},
// Status Updates
{
path: '/status_updates',
method: 'POST',
summary: 'Create a status update',
description: 'Creates a new status update and returns the created status update record.',
tags: ['Status updates'],
operationId: 'createStatusUpdate',
security: ['oauth2']
},
{
path: '/status_updates/{status_update_gid}',
method: 'GET',