@devpad/api 2.0.3 → 2.0.4
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/dist/{chunk-5X36WMYQ.js → chunk-5ALH7B5B.js} +7 -1
- package/dist/{chunk-INGCIUMX.js → chunk-XGQQPYSB.js} +8 -4
- package/dist/{errors.d-C73AkrdX.d.ts → errors.d-DcjQAql-.d.ts} +12 -2
- package/dist/index.d.ts +12 -4
- package/dist/index.js +81 -221
- package/dist/schema/blog.d.ts +525 -0
- package/dist/schema/index.d.ts +3 -3
- package/dist/schema/index.js +6 -2
- package/dist/schema/media.d.ts +5 -5
- package/dist/schema/media.js +5 -1
- package/dist/{schema.d-DALWdx-o.d.ts → schema.d-DcPuyqgh.d.ts} +404 -0
- package/dist/{types.d-B1VbnHQT.d.ts → types.d-BgSkvLhS.d.ts} +4284 -4284
- package/dist/{types.d-Bj4FU9Op.d.ts → types.d-CeY2wsr4.d.ts} +13 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
upsert_milestone,
|
|
7
7
|
upsert_project,
|
|
8
8
|
upsert_todo
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-XGQQPYSB.js";
|
|
10
10
|
|
|
11
11
|
// src/errors.ts
|
|
12
12
|
var ApiError = class _ApiError extends Error {
|
|
@@ -403,16 +403,8 @@ var ApiClient2 = class {
|
|
|
403
403
|
body: name ? { name } : {}
|
|
404
404
|
})
|
|
405
405
|
),
|
|
406
|
-
revoke: (key_id) => wrap(
|
|
407
|
-
|
|
408
|
-
`/keys/${key_id}`
|
|
409
|
-
)
|
|
410
|
-
),
|
|
411
|
-
remove: (key_id) => wrap(
|
|
412
|
-
() => this.clients.auth.delete(
|
|
413
|
-
`/keys/${key_id}`
|
|
414
|
-
)
|
|
415
|
-
)
|
|
406
|
+
revoke: (key_id) => wrap(() => this.clients.auth.delete(`/keys/${key_id}`)),
|
|
407
|
+
remove: (key_id) => wrap(() => this.clients.auth.delete(`/keys/${key_id}`))
|
|
416
408
|
}
|
|
417
409
|
};
|
|
418
410
|
/**
|
|
@@ -422,11 +414,7 @@ var ApiClient2 = class {
|
|
|
422
414
|
/**
|
|
423
415
|
* List projects with optional filtering
|
|
424
416
|
*/
|
|
425
|
-
list: (filters) => wrap(
|
|
426
|
-
() => this.clients.projects.get(
|
|
427
|
-
filters?.private === false ? "/projects/public" : "/projects"
|
|
428
|
-
)
|
|
429
|
-
),
|
|
417
|
+
list: (filters) => wrap(() => this.clients.projects.get(filters?.private === false ? "/projects/public" : "/projects")),
|
|
430
418
|
/**
|
|
431
419
|
* Get project map
|
|
432
420
|
*/
|
|
@@ -444,27 +432,19 @@ var ApiClient2 = class {
|
|
|
444
432
|
/**
|
|
445
433
|
* Get project by ID
|
|
446
434
|
*/
|
|
447
|
-
find: (id) => wrap(
|
|
448
|
-
() => this.clients.projects.get("/projects", { query: { id } })
|
|
449
|
-
),
|
|
435
|
+
find: (id) => wrap(() => this.clients.projects.get("/projects", { query: { id } })),
|
|
450
436
|
/**
|
|
451
437
|
* Get project by name
|
|
452
438
|
*/
|
|
453
|
-
getByName: (name) => wrap(
|
|
454
|
-
() => this.clients.projects.get("/projects", { query: { name } })
|
|
455
|
-
),
|
|
439
|
+
getByName: (name) => wrap(() => this.clients.projects.get("/projects", { query: { name } })),
|
|
456
440
|
/**
|
|
457
441
|
* Get project by ID (throws if not found)
|
|
458
442
|
*/
|
|
459
|
-
getById: (id) => wrap(
|
|
460
|
-
() => this.clients.projects.get("/projects", { query: { id } })
|
|
461
|
-
),
|
|
443
|
+
getById: (id) => wrap(() => this.clients.projects.get("/projects", { query: { id } })),
|
|
462
444
|
/**
|
|
463
445
|
* Create a new project
|
|
464
446
|
*/
|
|
465
|
-
create: (data) => wrap(
|
|
466
|
-
() => this.clients.projects.patch("/projects", { body: data })
|
|
467
|
-
),
|
|
447
|
+
create: (data) => wrap(() => this.clients.projects.patch("/projects", { body: data })),
|
|
468
448
|
/**
|
|
469
449
|
* Update an existing project
|
|
470
450
|
*/
|
|
@@ -533,13 +513,10 @@ var ApiClient2 = class {
|
|
|
533
513
|
* Initiate a repository scan (returns stream)
|
|
534
514
|
*/
|
|
535
515
|
initiate: async (project_id) => {
|
|
536
|
-
const response = await fetch(
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
headers: this.clients.projects.headers()
|
|
541
|
-
}
|
|
542
|
-
);
|
|
516
|
+
const response = await fetch(`${this.clients.projects.url()}/projects/scan?project_id=${project_id}`, {
|
|
517
|
+
method: "POST",
|
|
518
|
+
headers: this.clients.projects.headers()
|
|
519
|
+
});
|
|
543
520
|
if (!response.body) {
|
|
544
521
|
throw new Error("No response body");
|
|
545
522
|
}
|
|
@@ -565,15 +542,11 @@ var ApiClient2 = class {
|
|
|
565
542
|
/**
|
|
566
543
|
* Get project history
|
|
567
544
|
*/
|
|
568
|
-
history: (project_id) => wrap(
|
|
569
|
-
() => this.clients.projects.get(`/projects/${project_id}/history`)
|
|
570
|
-
),
|
|
545
|
+
history: (project_id) => wrap(() => this.clients.projects.get(`/projects/${project_id}/history`)),
|
|
571
546
|
/**
|
|
572
547
|
* Legacy methods (keeping for compatibility)
|
|
573
548
|
*/
|
|
574
|
-
upsert: (data) => wrap(
|
|
575
|
-
() => this.clients.projects.patch("/projects", { body: data })
|
|
576
|
-
),
|
|
549
|
+
upsert: (data) => wrap(() => this.clients.projects.patch("/projects", { body: data })),
|
|
577
550
|
/**
|
|
578
551
|
* Fetch project specification from GitHub
|
|
579
552
|
*/
|
|
@@ -602,11 +575,7 @@ var ApiClient2 = class {
|
|
|
602
575
|
/**
|
|
603
576
|
* Get milestones by project ID
|
|
604
577
|
*/
|
|
605
|
-
getByProject: (project_id) => wrap(
|
|
606
|
-
() => this.clients.milestones.get(
|
|
607
|
-
`/projects/${project_id}/milestones`
|
|
608
|
-
)
|
|
609
|
-
),
|
|
578
|
+
getByProject: (project_id) => wrap(() => this.clients.milestones.get(`/projects/${project_id}/milestones`)),
|
|
610
579
|
/**
|
|
611
580
|
* Get milestone by ID
|
|
612
581
|
*/
|
|
@@ -620,9 +589,7 @@ var ApiClient2 = class {
|
|
|
620
589
|
/**
|
|
621
590
|
* Create new milestone
|
|
622
591
|
*/
|
|
623
|
-
create: (data) => wrap(
|
|
624
|
-
() => this.clients.milestones.post("/milestones", { body: data })
|
|
625
|
-
),
|
|
592
|
+
create: (data) => wrap(() => this.clients.milestones.post("/milestones", { body: data })),
|
|
626
593
|
/**
|
|
627
594
|
* Update milestone
|
|
628
595
|
*/
|
|
@@ -646,11 +613,7 @@ var ApiClient2 = class {
|
|
|
646
613
|
/**
|
|
647
614
|
* Delete milestone (soft delete)
|
|
648
615
|
*/
|
|
649
|
-
delete: (id) => wrap(
|
|
650
|
-
() => this.clients.milestones.delete(
|
|
651
|
-
`/milestones/${id}`
|
|
652
|
-
)
|
|
653
|
-
),
|
|
616
|
+
delete: (id) => wrap(() => this.clients.milestones.delete(`/milestones/${id}`)),
|
|
654
617
|
/**
|
|
655
618
|
* Get goals for a milestone
|
|
656
619
|
*/
|
|
@@ -694,11 +657,7 @@ var ApiClient2 = class {
|
|
|
694
657
|
/**
|
|
695
658
|
* Delete goal (soft delete)
|
|
696
659
|
*/
|
|
697
|
-
delete: (id) => wrap(
|
|
698
|
-
() => this.clients.goals.delete(
|
|
699
|
-
`/goals/${id}`
|
|
700
|
-
)
|
|
701
|
-
)
|
|
660
|
+
delete: (id) => wrap(() => this.clients.goals.delete(`/goals/${id}`))
|
|
702
661
|
};
|
|
703
662
|
/**
|
|
704
663
|
* Tasks namespace with Result-wrapped operations
|
|
@@ -711,10 +670,7 @@ var ApiClient2 = class {
|
|
|
711
670
|
const query = {};
|
|
712
671
|
if (filters?.project_id) query.project = filters.project_id;
|
|
713
672
|
if (filters?.tag_id) query.tag = filters.tag_id;
|
|
714
|
-
return this.clients.tasks.get(
|
|
715
|
-
"/tasks",
|
|
716
|
-
Object.keys(query).length > 0 ? { query } : {}
|
|
717
|
-
);
|
|
673
|
+
return this.clients.tasks.get("/tasks", Object.keys(query).length > 0 ? { query } : {});
|
|
718
674
|
}),
|
|
719
675
|
/**
|
|
720
676
|
* Get task by ID
|
|
@@ -731,9 +687,7 @@ var ApiClient2 = class {
|
|
|
731
687
|
/**
|
|
732
688
|
* Create a new task
|
|
733
689
|
*/
|
|
734
|
-
create: (data) => wrap(
|
|
735
|
-
() => this.clients.tasks.patch("/tasks", { body: data })
|
|
736
|
-
),
|
|
690
|
+
create: (data) => wrap(() => this.clients.tasks.patch("/tasks", { body: data })),
|
|
737
691
|
/**
|
|
738
692
|
* Update an existing task
|
|
739
693
|
*/
|
|
@@ -763,15 +717,11 @@ var ApiClient2 = class {
|
|
|
763
717
|
/**
|
|
764
718
|
* Upsert task (create or update)
|
|
765
719
|
*/
|
|
766
|
-
upsert: (data) => wrap(
|
|
767
|
-
() => this.clients.tasks.patch("/tasks", { body: data })
|
|
768
|
-
),
|
|
720
|
+
upsert: (data) => wrap(() => this.clients.tasks.patch("/tasks", { body: data })),
|
|
769
721
|
/**
|
|
770
722
|
* Save tags for tasks
|
|
771
723
|
*/
|
|
772
|
-
saveTags: (data) => wrap(
|
|
773
|
-
() => this.clients.tasks.patch("/tasks/save_tags", { body: data })
|
|
774
|
-
),
|
|
724
|
+
saveTags: (data) => wrap(() => this.clients.tasks.patch("/tasks/save_tags", { body: data })),
|
|
775
725
|
/**
|
|
776
726
|
* Delete task (soft delete)
|
|
777
727
|
*/
|
|
@@ -787,9 +737,7 @@ var ApiClient2 = class {
|
|
|
787
737
|
/**
|
|
788
738
|
* Get task history by task ID
|
|
789
739
|
*/
|
|
790
|
-
get: (task_id) => wrap(
|
|
791
|
-
() => this.clients.tasks.get(`/tasks/history/${task_id}`)
|
|
792
|
-
)
|
|
740
|
+
get: (task_id) => wrap(() => this.clients.tasks.get(`/tasks/history/${task_id}`))
|
|
793
741
|
}
|
|
794
742
|
};
|
|
795
743
|
/**
|
|
@@ -812,9 +760,7 @@ var ApiClient2 = class {
|
|
|
812
760
|
/**
|
|
813
761
|
* List branches for a GitHub repository
|
|
814
762
|
*/
|
|
815
|
-
branches: (owner, repo) => wrap(
|
|
816
|
-
() => this.clients.github.get(`/repos/${owner}/${repo}/branches`)
|
|
817
|
-
)
|
|
763
|
+
branches: (owner, repo) => wrap(() => this.clients.github.get(`/repos/${owner}/${repo}/branches`))
|
|
818
764
|
};
|
|
819
765
|
this.blog = {
|
|
820
766
|
posts: {
|
|
@@ -824,73 +770,30 @@ var ApiClient2 = class {
|
|
|
824
770
|
if (params?.tag) query.tag = params.tag;
|
|
825
771
|
if (params?.project) query.project = params.project;
|
|
826
772
|
if (params?.status) query.status = params.status;
|
|
827
|
-
if (params?.archived !== void 0)
|
|
828
|
-
query.archived = String(params.archived);
|
|
773
|
+
if (params?.archived !== void 0) query.archived = String(params.archived);
|
|
829
774
|
if (params?.limit) query.limit = String(params.limit);
|
|
830
|
-
if (params?.offset !== void 0)
|
|
831
|
-
query.offset = String(params.offset);
|
|
775
|
+
if (params?.offset !== void 0) query.offset = String(params.offset);
|
|
832
776
|
if (params?.sort) query.sort = params.sort;
|
|
833
|
-
return this.clients.blog.get(
|
|
834
|
-
"/blog/posts",
|
|
835
|
-
Object.keys(query).length ? { query } : {}
|
|
836
|
-
);
|
|
777
|
+
return this.clients.blog.get("/blog/posts", Object.keys(query).length ? { query } : {});
|
|
837
778
|
}),
|
|
838
779
|
getBySlug: (slug) => wrap(() => this.clients.blog.get(`/blog/posts/${slug}`)),
|
|
839
780
|
create: (data) => wrap(() => this.clients.blog.post("/blog/posts", { body: data })),
|
|
840
|
-
update: (uuid, data) => wrap(
|
|
841
|
-
|
|
842
|
-
),
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
),
|
|
846
|
-
versions: (uuid) => wrap(
|
|
847
|
-
() => this.clients.blog.get(
|
|
848
|
-
`/blog/posts/${uuid}/versions`
|
|
849
|
-
)
|
|
850
|
-
),
|
|
851
|
-
version: (uuid, hash) => wrap(
|
|
852
|
-
() => this.clients.blog.get(
|
|
853
|
-
`/blog/posts/${uuid}/version/${hash}`
|
|
854
|
-
)
|
|
855
|
-
),
|
|
856
|
-
restore: (uuid, hash) => wrap(
|
|
857
|
-
() => this.clients.blog.post(`/blog/posts/${uuid}/restore/${hash}`)
|
|
858
|
-
)
|
|
781
|
+
update: (uuid, data) => wrap(() => this.clients.blog.put(`/blog/posts/${uuid}`, { body: data })),
|
|
782
|
+
delete: (uuid) => wrap(() => this.clients.blog.delete(`/blog/posts/${uuid}`)),
|
|
783
|
+
versions: (uuid) => wrap(() => this.clients.blog.get(`/blog/posts/${uuid}/versions`)),
|
|
784
|
+
version: (uuid, hash) => wrap(() => this.clients.blog.get(`/blog/posts/${uuid}/version/${hash}`)),
|
|
785
|
+
restore: (uuid, hash) => wrap(() => this.clients.blog.post(`/blog/posts/${uuid}/restore/${hash}`))
|
|
859
786
|
},
|
|
860
787
|
tags: {
|
|
861
|
-
list: () => wrap(
|
|
862
|
-
|
|
863
|
-
),
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
`/blog/tags/posts/${uuid}/tags`
|
|
867
|
-
)
|
|
868
|
-
),
|
|
869
|
-
setForPost: (uuid, tags) => wrap(
|
|
870
|
-
() => this.clients.blog.put(
|
|
871
|
-
`/blog/tags/posts/${uuid}/tags`,
|
|
872
|
-
{ body: { tags } }
|
|
873
|
-
)
|
|
874
|
-
),
|
|
875
|
-
addToPost: (uuid, tags) => wrap(
|
|
876
|
-
() => this.clients.blog.post(
|
|
877
|
-
`/blog/tags/posts/${uuid}/tags`,
|
|
878
|
-
{ body: { tags } }
|
|
879
|
-
)
|
|
880
|
-
),
|
|
881
|
-
removeFromPost: (uuid, tag) => wrap(
|
|
882
|
-
() => this.clients.blog.delete(
|
|
883
|
-
`/blog/tags/posts/${uuid}/tags/${tag}`
|
|
884
|
-
)
|
|
885
|
-
)
|
|
788
|
+
list: () => wrap(() => this.clients.blog.get("/blog/tags")),
|
|
789
|
+
getForPost: (uuid) => wrap(() => this.clients.blog.get(`/blog/tags/posts/${uuid}/tags`)),
|
|
790
|
+
setForPost: (uuid, tags) => wrap(() => this.clients.blog.put(`/blog/tags/posts/${uuid}/tags`, { body: { tags } })),
|
|
791
|
+
addToPost: (uuid, tags) => wrap(() => this.clients.blog.post(`/blog/tags/posts/${uuid}/tags`, { body: { tags } })),
|
|
792
|
+
removeFromPost: (uuid, tag) => wrap(() => this.clients.blog.delete(`/blog/tags/posts/${uuid}/tags/${tag}`))
|
|
886
793
|
},
|
|
887
794
|
categories: {
|
|
888
|
-
tree: () => wrap(
|
|
889
|
-
|
|
890
|
-
),
|
|
891
|
-
create: (data) => wrap(
|
|
892
|
-
() => this.clients.blog.post("/blog/categories", { body: data })
|
|
893
|
-
),
|
|
795
|
+
tree: () => wrap(() => this.clients.blog.get("/blog/categories")),
|
|
796
|
+
create: (data) => wrap(() => this.clients.blog.post("/blog/categories", { body: data })),
|
|
894
797
|
update: (name, data) => wrap(
|
|
895
798
|
() => this.clients.blog.put(`/blog/categories/${name}`, {
|
|
896
799
|
body: data
|
|
@@ -899,12 +802,8 @@ var ApiClient2 = class {
|
|
|
899
802
|
delete: (name) => wrap(() => this.clients.blog.delete(`/blog/categories/${name}`))
|
|
900
803
|
},
|
|
901
804
|
tokens: {
|
|
902
|
-
list: () => wrap(
|
|
903
|
-
|
|
904
|
-
),
|
|
905
|
-
create: (data) => wrap(
|
|
906
|
-
() => this.clients.blog.post("/blog/tokens", { body: data })
|
|
907
|
-
),
|
|
805
|
+
list: () => wrap(() => this.clients.blog.get("/blog/tokens")),
|
|
806
|
+
create: (data) => wrap(() => this.clients.blog.post("/blog/tokens", { body: data })),
|
|
908
807
|
update: (id, data) => wrap(
|
|
909
808
|
() => this.clients.blog.put(`/blog/tokens/${id}`, {
|
|
910
809
|
body: data
|
|
@@ -916,69 +815,38 @@ var ApiClient2 = class {
|
|
|
916
815
|
this.media = {
|
|
917
816
|
profiles: {
|
|
918
817
|
list: () => wrap(async () => {
|
|
919
|
-
const res = await this.clients.media.get(
|
|
920
|
-
"/profiles"
|
|
921
|
-
);
|
|
818
|
+
const res = await this.clients.media.get("/profiles");
|
|
922
819
|
return res.profiles;
|
|
923
820
|
}),
|
|
924
|
-
create: (data) => wrap(
|
|
925
|
-
() => this.clients.media.post("/profiles", { body: data })
|
|
926
|
-
),
|
|
821
|
+
create: (data) => wrap(() => this.clients.media.post("/profiles", { body: data })),
|
|
927
822
|
get: (id) => wrap(() => this.clients.media.get(`/profiles/${id}`)),
|
|
928
|
-
update: (id, data) => wrap(
|
|
929
|
-
|
|
930
|
-
),
|
|
931
|
-
delete: (id) => wrap(
|
|
932
|
-
() => this.clients.media.delete(`/profiles/${id}`)
|
|
933
|
-
),
|
|
823
|
+
update: (id, data) => wrap(() => this.clients.media.patch(`/profiles/${id}`, { body: data })),
|
|
824
|
+
delete: (id) => wrap(() => this.clients.media.delete(`/profiles/${id}`)),
|
|
934
825
|
filters: {
|
|
935
826
|
list: (profile_id) => wrap(async () => {
|
|
936
827
|
const res = await this.clients.media.get(`/profiles/${profile_id}/filters`);
|
|
937
828
|
return res.filters;
|
|
938
829
|
}),
|
|
939
|
-
add: (profile_id, data) => wrap(
|
|
940
|
-
|
|
941
|
-
`/profiles/${profile_id}/filters`,
|
|
942
|
-
{ body: data }
|
|
943
|
-
)
|
|
944
|
-
),
|
|
945
|
-
remove: (profile_id, filter_id) => wrap(
|
|
946
|
-
() => this.clients.media.delete(
|
|
947
|
-
`/profiles/${profile_id}/filters/${filter_id}`
|
|
948
|
-
)
|
|
949
|
-
)
|
|
830
|
+
add: (profile_id, data) => wrap(() => this.clients.media.post(`/profiles/${profile_id}/filters`, { body: data })),
|
|
831
|
+
remove: (profile_id, filter_id) => wrap(() => this.clients.media.delete(`/profiles/${profile_id}/filters/${filter_id}`))
|
|
950
832
|
},
|
|
951
833
|
timeline: (slug, params) => wrap(() => {
|
|
952
834
|
const query = {};
|
|
953
835
|
if (params?.limit) query.limit = String(params.limit);
|
|
954
836
|
if (params?.before) query.before = params.before;
|
|
955
|
-
return this.clients.media.get(
|
|
956
|
-
`/profiles/${slug}/timeline`,
|
|
957
|
-
Object.keys(query).length ? { query } : {}
|
|
958
|
-
);
|
|
837
|
+
return this.clients.media.get(`/profiles/${slug}/timeline`, Object.keys(query).length ? { query } : {});
|
|
959
838
|
})
|
|
960
839
|
},
|
|
961
840
|
connections: {
|
|
962
841
|
list: (profile_id, options) => wrap(async () => {
|
|
963
842
|
const query = { profile_id };
|
|
964
843
|
if (options?.include_settings) query.include_settings = "true";
|
|
965
|
-
const res = await this.clients.media.get(
|
|
966
|
-
"/connections",
|
|
967
|
-
{ query }
|
|
968
|
-
);
|
|
844
|
+
const res = await this.clients.media.get("/connections", { query });
|
|
969
845
|
return res.accounts;
|
|
970
846
|
}),
|
|
971
|
-
create: (data) => wrap(
|
|
972
|
-
|
|
973
|
-
),
|
|
974
|
-
delete: (account_id) => wrap(
|
|
975
|
-
() => this.clients.media.delete(
|
|
976
|
-
`/connections/${account_id}`
|
|
977
|
-
)
|
|
978
|
-
),
|
|
979
|
-
refresh: (account_id) => wrap(
|
|
980
|
-
() => this.clients.media.post(`/connections/${account_id}/refresh`)
|
|
981
|
-
),
|
|
847
|
+
create: (data) => wrap(() => this.clients.media.post("/connections", { body: data })),
|
|
848
|
+
delete: (account_id) => wrap(() => this.clients.media.delete(`/connections/${account_id}`)),
|
|
849
|
+
refresh: (account_id) => wrap(() => this.clients.media.post(`/connections/${account_id}/refresh`)),
|
|
982
850
|
refreshAll: () => wrap(() => this.clients.media.post("/connections/refresh-all")),
|
|
983
851
|
updateStatus: (account_id, is_active) => wrap(
|
|
984
852
|
() => this.clients.media.patch(`/connections/${account_id}`, {
|
|
@@ -986,11 +854,7 @@ var ApiClient2 = class {
|
|
|
986
854
|
})
|
|
987
855
|
),
|
|
988
856
|
settings: {
|
|
989
|
-
get: (account_id) => wrap(
|
|
990
|
-
() => this.clients.media.get(
|
|
991
|
-
`/connections/${account_id}/settings`
|
|
992
|
-
)
|
|
993
|
-
),
|
|
857
|
+
get: (account_id) => wrap(() => this.clients.media.get(`/connections/${account_id}/settings`)),
|
|
994
858
|
update: (account_id, settings) => wrap(
|
|
995
859
|
() => this.clients.media.put(`/connections/${account_id}/settings`, {
|
|
996
860
|
body: { settings }
|
|
@@ -998,9 +862,7 @@ var ApiClient2 = class {
|
|
|
998
862
|
)
|
|
999
863
|
},
|
|
1000
864
|
repos: (account_id) => wrap(async () => {
|
|
1001
|
-
const res = await this.clients.media.get(
|
|
1002
|
-
`/connections/${account_id}/repos`
|
|
1003
|
-
);
|
|
865
|
+
const res = await this.clients.media.get(`/connections/${account_id}/repos`);
|
|
1004
866
|
return res.repos;
|
|
1005
867
|
}),
|
|
1006
868
|
subreddits: (account_id) => wrap(async () => {
|
|
@@ -1012,28 +874,15 @@ var ApiClient2 = class {
|
|
|
1012
874
|
check: (platform, profile_id) => wrap(
|
|
1013
875
|
() => this.clients.media.get(`/credentials/${platform}`, { query: { profile_id } })
|
|
1014
876
|
),
|
|
1015
|
-
save: (platform, data) => wrap(
|
|
1016
|
-
|
|
1017
|
-
`/credentials/${platform}`,
|
|
1018
|
-
{ body: data }
|
|
1019
|
-
)
|
|
1020
|
-
),
|
|
1021
|
-
delete: (platform, profile_id) => wrap(
|
|
1022
|
-
() => this.clients.media.delete(
|
|
1023
|
-
`/credentials/${platform}`,
|
|
1024
|
-
{ query: { profile_id } }
|
|
1025
|
-
)
|
|
1026
|
-
)
|
|
877
|
+
save: (platform, data) => wrap(() => this.clients.media.post(`/credentials/${platform}`, { body: data })),
|
|
878
|
+
delete: (platform, profile_id) => wrap(() => this.clients.media.delete(`/credentials/${platform}`, { query: { profile_id } }))
|
|
1027
879
|
},
|
|
1028
880
|
timeline: {
|
|
1029
881
|
get: (user_id, params) => wrap(() => {
|
|
1030
882
|
const query = {};
|
|
1031
883
|
if (params?.from) query.from = params.from;
|
|
1032
884
|
if (params?.to) query.to = params.to;
|
|
1033
|
-
return this.clients.media.get(
|
|
1034
|
-
`/timeline/${user_id}`,
|
|
1035
|
-
Object.keys(query).length ? { query } : {}
|
|
1036
|
-
);
|
|
885
|
+
return this.clients.media.get(`/timeline/${user_id}`, Object.keys(query).length ? { query } : {});
|
|
1037
886
|
}),
|
|
1038
887
|
getRaw: (user_id, platform, account_id) => wrap(
|
|
1039
888
|
() => this.clients.media.get(`/timeline/${user_id}/raw/${platform}`, {
|
|
@@ -1045,6 +894,14 @@ var ApiClient2 = class {
|
|
|
1045
894
|
/**
|
|
1046
895
|
* User namespace with Result-wrapped operations
|
|
1047
896
|
*/
|
|
897
|
+
this.activity = {
|
|
898
|
+
ai: (options) => wrap(() => {
|
|
899
|
+
const query = {};
|
|
900
|
+
if (options?.limit) query.limit = String(options.limit);
|
|
901
|
+
if (options?.since) query.since = options.since;
|
|
902
|
+
return this.clients.projects.get("/activity/ai", Object.keys(query).length ? { query } : {});
|
|
903
|
+
})
|
|
904
|
+
};
|
|
1048
905
|
this.user = {
|
|
1049
906
|
/**
|
|
1050
907
|
* Get user activity history
|
|
@@ -1053,9 +910,7 @@ var ApiClient2 = class {
|
|
|
1053
910
|
/**
|
|
1054
911
|
* Update user preferences
|
|
1055
912
|
*/
|
|
1056
|
-
preferences: (data) => wrap(
|
|
1057
|
-
() => this.clients.auth.patch("/user/preferences", { body: data })
|
|
1058
|
-
)
|
|
913
|
+
preferences: (data) => wrap(() => this.clients.auth.patch("/user/preferences", { body: data }))
|
|
1059
914
|
};
|
|
1060
915
|
const base_url = options.base_url || "http://localhost:4321/api/v1";
|
|
1061
916
|
this._api_key = options.api_key ?? "";
|
|
@@ -1154,13 +1009,11 @@ var tools = {
|
|
|
1154
1009
|
name: "devpad_projects_get",
|
|
1155
1010
|
description: "Get project by ID or name",
|
|
1156
1011
|
inputSchema: project_by_id_or_name,
|
|
1157
|
-
execute: async (client, input) => unwrap(
|
|
1158
|
-
input.id ? await client.projects.getById(input.id) : await client.projects.getByName(input.name)
|
|
1159
|
-
)
|
|
1012
|
+
execute: async (client, input) => unwrap(input.id ? await client.projects.getById(input.id) : await client.projects.getByName(input.name))
|
|
1160
1013
|
},
|
|
1161
1014
|
devpad_projects_upsert: {
|
|
1162
1015
|
name: "devpad_projects_upsert",
|
|
1163
|
-
description: "Create or update a project (set deleted=true to delete)",
|
|
1016
|
+
description: "Create or update a project (set deleted=true to delete). Returns 409 if entity is protected by user - pass force=true to override.",
|
|
1164
1017
|
inputSchema: upsert_project,
|
|
1165
1018
|
execute: async (client, input) => unwrap(await client.projects.upsert(input))
|
|
1166
1019
|
},
|
|
@@ -1188,7 +1041,7 @@ var tools = {
|
|
|
1188
1041
|
},
|
|
1189
1042
|
devpad_tasks_upsert: {
|
|
1190
1043
|
name: "devpad_tasks_upsert",
|
|
1191
|
-
description: "Create or update a task (set deleted=true to delete)",
|
|
1044
|
+
description: "Create or update a task (set deleted=true to delete). Returns 409 if entity is protected by user - pass force=true to override.",
|
|
1192
1045
|
inputSchema: upsert_todo,
|
|
1193
1046
|
execute: async (client, input) => unwrap(await client.tasks.upsert(input))
|
|
1194
1047
|
},
|
|
@@ -1206,9 +1059,7 @@ var tools = {
|
|
|
1206
1059
|
name: "devpad_milestones_list",
|
|
1207
1060
|
description: "List milestones for authenticated user or by project",
|
|
1208
1061
|
inputSchema: milestone_filters,
|
|
1209
|
-
execute: async (client, input) => unwrap(
|
|
1210
|
-
input.project_id ? await client.milestones.getByProject(input.project_id) : await client.milestones.list()
|
|
1211
|
-
)
|
|
1062
|
+
execute: async (client, input) => unwrap(input.project_id ? await client.milestones.getByProject(input.project_id) : await client.milestones.list())
|
|
1212
1063
|
},
|
|
1213
1064
|
devpad_milestones_get: {
|
|
1214
1065
|
name: "devpad_milestones_get",
|
|
@@ -1218,7 +1069,7 @@ var tools = {
|
|
|
1218
1069
|
},
|
|
1219
1070
|
devpad_milestones_upsert: {
|
|
1220
1071
|
name: "devpad_milestones_upsert",
|
|
1221
|
-
description: "Create or update a milestone",
|
|
1072
|
+
description: "Create or update a milestone. Returns 409 if entity is protected by user - pass force=true to override.",
|
|
1222
1073
|
inputSchema: upsert_milestone,
|
|
1223
1074
|
execute: async (client, input) => unwrap(
|
|
1224
1075
|
input.id ? await client.milestones.update(input.id, {
|
|
@@ -1250,7 +1101,7 @@ var tools = {
|
|
|
1250
1101
|
},
|
|
1251
1102
|
devpad_goals_upsert: {
|
|
1252
1103
|
name: "devpad_goals_upsert",
|
|
1253
|
-
description: "Create or update a goal",
|
|
1104
|
+
description: "Create or update a goal. Returns 409 if entity is protected by user - pass force=true to override.",
|
|
1254
1105
|
inputSchema: upsert_goal,
|
|
1255
1106
|
execute: async (client, input) => unwrap(
|
|
1256
1107
|
input.id ? await client.goals.update(input.id, {
|
|
@@ -1387,6 +1238,15 @@ var tools = {
|
|
|
1387
1238
|
}),
|
|
1388
1239
|
execute: async (client, input) => unwrap(await client.user.preferences(input))
|
|
1389
1240
|
},
|
|
1241
|
+
devpad_activity_ai: {
|
|
1242
|
+
name: "devpad_activity_ai",
|
|
1243
|
+
description: "Get AI activity feed - shows recent actions made via API/MCP grouped into sessions by time window",
|
|
1244
|
+
inputSchema: z.object({
|
|
1245
|
+
limit: z.number().optional().describe("Max sessions to return (default 20)"),
|
|
1246
|
+
since: z.string().optional().describe("Only show activity after this ISO date")
|
|
1247
|
+
}),
|
|
1248
|
+
execute: async (client, input) => unwrap(await client.activity.ai(input))
|
|
1249
|
+
},
|
|
1390
1250
|
devpad_blog_posts_list: {
|
|
1391
1251
|
name: "devpad_blog_posts_list",
|
|
1392
1252
|
description: "List blog posts with optional filters",
|