@devpad/api 2.2.9 → 2.2.11
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/README.md +37 -42
- package/dist/{chunk-NQZIDUBQ.js → chunk-BMT7GORG.js} +18 -3
- package/dist/{chunk-TEOIDOOX.js → chunk-UIFZ5MOM.js} +46 -5
- package/dist/index.js +82 -20
- package/dist/schema/index.js +2 -2
- package/dist/schema/media.js +9 -2
- package/package.json +44 -46
package/README.md
CHANGED
|
@@ -14,8 +14,8 @@ bun add @devpad/api
|
|
|
14
14
|
import ApiClient from "@devpad/api";
|
|
15
15
|
|
|
16
16
|
const client = new ApiClient({
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
base_url: "https://devpad.tools/api/v1",
|
|
18
|
+
api_key: "your-api-key",
|
|
19
19
|
});
|
|
20
20
|
```
|
|
21
21
|
|
|
@@ -31,8 +31,8 @@ import ApiClient, { type ApiResult } from "@devpad/api";
|
|
|
31
31
|
const result = await client.projects.list();
|
|
32
32
|
|
|
33
33
|
if (!result.ok) {
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
console.error(result.error.message, result.error.status_code);
|
|
35
|
+
return;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
const projects = result.value;
|
|
@@ -45,18 +45,18 @@ The `ok()` and `err()` constructors are re-exported for building your own Result
|
|
|
45
45
|
### Projects
|
|
46
46
|
|
|
47
47
|
```typescript
|
|
48
|
-
client.projects.list()
|
|
49
|
-
client.projects.find(id)
|
|
50
|
-
client.projects.getByName(name)
|
|
51
|
-
client.projects.create(data)
|
|
52
|
-
client.projects.upsert(data)
|
|
53
|
-
client.projects.config.load(id)
|
|
54
|
-
client.projects.config.save(id, config)
|
|
55
|
-
client.projects.history(id)
|
|
56
|
-
client.projects.specification(id)
|
|
57
|
-
client.projects.scan.initiate(name)
|
|
58
|
-
client.projects.scan.updates(id)
|
|
59
|
-
client.projects.map()
|
|
48
|
+
client.projects.list();
|
|
49
|
+
client.projects.find(id);
|
|
50
|
+
client.projects.getByName(name);
|
|
51
|
+
client.projects.create(data);
|
|
52
|
+
client.projects.upsert(data);
|
|
53
|
+
client.projects.config.load(id);
|
|
54
|
+
client.projects.config.save(id, config);
|
|
55
|
+
client.projects.history(id);
|
|
56
|
+
client.projects.specification(id);
|
|
57
|
+
client.projects.scan.initiate(name);
|
|
58
|
+
client.projects.scan.updates(id);
|
|
59
|
+
client.projects.map();
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
### Tasks
|
|
@@ -86,43 +86,43 @@ client.milestones.goals(id)
|
|
|
86
86
|
### Goals
|
|
87
87
|
|
|
88
88
|
```typescript
|
|
89
|
-
client.goals.list()
|
|
90
|
-
client.goals.find(id)
|
|
91
|
-
client.goals.create(data)
|
|
92
|
-
client.goals.update(id, data)
|
|
93
|
-
client.goals.delete(id)
|
|
89
|
+
client.goals.list();
|
|
90
|
+
client.goals.find(id);
|
|
91
|
+
client.goals.create(data);
|
|
92
|
+
client.goals.update(id, data);
|
|
93
|
+
client.goals.delete(id);
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
### Tags
|
|
97
97
|
|
|
98
98
|
```typescript
|
|
99
|
-
client.tags.list()
|
|
100
|
-
client.tags.save(tags)
|
|
99
|
+
client.tags.list();
|
|
100
|
+
client.tags.save(tags);
|
|
101
101
|
```
|
|
102
102
|
|
|
103
103
|
### Auth
|
|
104
104
|
|
|
105
105
|
```typescript
|
|
106
|
-
client.auth.keys.list()
|
|
107
|
-
client.auth.keys.create(data)
|
|
108
|
-
client.auth.keys.update(id, data)
|
|
109
|
-
client.auth.keys.delete(id)
|
|
110
|
-
client.auth.user()
|
|
111
|
-
client.auth.login(code)
|
|
112
|
-
client.auth.loginUrl()
|
|
106
|
+
client.auth.keys.list();
|
|
107
|
+
client.auth.keys.create(data);
|
|
108
|
+
client.auth.keys.update(id, data);
|
|
109
|
+
client.auth.keys.delete(id);
|
|
110
|
+
client.auth.user();
|
|
111
|
+
client.auth.login(code);
|
|
112
|
+
client.auth.loginUrl();
|
|
113
113
|
```
|
|
114
114
|
|
|
115
115
|
### User
|
|
116
116
|
|
|
117
117
|
```typescript
|
|
118
|
-
client.user.history()
|
|
118
|
+
client.user.history();
|
|
119
119
|
```
|
|
120
120
|
|
|
121
121
|
### GitHub
|
|
122
122
|
|
|
123
123
|
```typescript
|
|
124
|
-
client.github.repos()
|
|
125
|
-
client.github.branches(owner, repo)
|
|
124
|
+
client.github.repos();
|
|
125
|
+
client.github.branches(owner, repo);
|
|
126
126
|
```
|
|
127
127
|
|
|
128
128
|
Blog and media namespaces also exist but are documented separately.
|
|
@@ -131,18 +131,13 @@ Blog and media namespaces also exist but are documented separately.
|
|
|
131
131
|
|
|
132
132
|
```typescript
|
|
133
133
|
import ApiClient, {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
134
|
+
type ApiResult,
|
|
135
|
+
type ApiResultError,
|
|
136
|
+
type AuthMode, // "session" | "key" | "cookie"
|
|
137
137
|
} from "@devpad/api";
|
|
138
138
|
|
|
139
139
|
// Schema types re-exported for convenience
|
|
140
|
-
import type {
|
|
141
|
-
Project,
|
|
142
|
-
TaskWithDetails,
|
|
143
|
-
UpsertProject,
|
|
144
|
-
UpsertTodo,
|
|
145
|
-
} from "@devpad/api";
|
|
140
|
+
import type { Project, TaskWithDetails, UpsertProject, UpsertTodo } from "@devpad/api";
|
|
146
141
|
```
|
|
147
142
|
|
|
148
143
|
Result utilities `ok` and `err` are also exported from the main entry point.
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
// ../schema/dist/errors.js
|
|
2
2
|
import { err } from "@f0rbit/corpus";
|
|
3
3
|
var defaultLogger = ({ error, context }) => {
|
|
4
|
-
console.error(`[${context.timestamp}] [${error.kind}]`, error.message || error.kind, {
|
|
4
|
+
console.error(`[${context.timestamp}] [${error.kind}]`, error.message || error.kind, {
|
|
5
|
+
...error,
|
|
6
|
+
stack: context.stack?.split("\n").slice(2, 5).join("\n"),
|
|
7
|
+
...context
|
|
8
|
+
});
|
|
5
9
|
};
|
|
6
10
|
var errorLogger = defaultLogger;
|
|
7
11
|
var contextProvider = null;
|
|
@@ -12,7 +16,12 @@ var configureErrorLogging = (config) => {
|
|
|
12
16
|
contextProvider = config.contextProvider;
|
|
13
17
|
};
|
|
14
18
|
var logAndReturn = (error, ctx) => {
|
|
15
|
-
const context = {
|
|
19
|
+
const context = {
|
|
20
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
21
|
+
stack: new Error().stack,
|
|
22
|
+
...contextProvider?.(),
|
|
23
|
+
...ctx
|
|
24
|
+
};
|
|
16
25
|
errorLogger({ error, context });
|
|
17
26
|
return err(error);
|
|
18
27
|
};
|
|
@@ -49,7 +58,13 @@ var parseError = (message, ctx) => logAndReturn({ kind: "parse_error", ...messag
|
|
|
49
58
|
var encryptionError = (operation, message, ctx) => logAndReturn({ kind: "encryption_error", operation, ...message && { message } }, ctx);
|
|
50
59
|
var dbError = (message, ctx) => logAndReturn({ kind: "db_error", ...message && { message } }, ctx);
|
|
51
60
|
var conflict = (resource, message, ctx) => logAndReturn({ kind: "conflict", ...resource && { resource }, ...message && { message } }, ctx);
|
|
52
|
-
var protectedEntity = (entity_id, message, modified_by, modified_at, ctx) => logAndReturn({
|
|
61
|
+
var protectedEntity = (entity_id, message, modified_by, modified_at, ctx) => logAndReturn({
|
|
62
|
+
kind: "protected",
|
|
63
|
+
...entity_id && { entity_id },
|
|
64
|
+
...message && { message },
|
|
65
|
+
...modified_by && { modified_by },
|
|
66
|
+
...modified_at && { modified_at }
|
|
67
|
+
}, ctx);
|
|
53
68
|
var badRequest = (message, details, ctx) => logAndReturn({ kind: "bad_request", ...message && { message }, ...details !== void 0 && { details } }, ctx);
|
|
54
69
|
var unauthorized = (message, ctx) => logAndReturn({ kind: "unauthorized", ...message && { message } }, ctx);
|
|
55
70
|
var scanError = (message, ctx) => logAndReturn({ kind: "scan_error", ...message && { message } }, ctx);
|
|
@@ -401,11 +401,26 @@ var upsert_project = z.object({
|
|
|
401
401
|
repo_url: z.string().nullable(),
|
|
402
402
|
repo_id: z.number().nullable(),
|
|
403
403
|
icon_url: z.string().nullable(),
|
|
404
|
-
status: z.union([
|
|
404
|
+
status: z.union([
|
|
405
|
+
z.literal("DEVELOPMENT"),
|
|
406
|
+
z.literal("PAUSED"),
|
|
407
|
+
z.literal("RELEASED"),
|
|
408
|
+
z.literal("LIVE"),
|
|
409
|
+
z.literal("FINISHED"),
|
|
410
|
+
z.literal("ABANDONED"),
|
|
411
|
+
z.literal("STOPPED")
|
|
412
|
+
]).optional(),
|
|
405
413
|
deleted: z.boolean().optional().default(false),
|
|
406
414
|
link_url: z.string().nullable(),
|
|
407
415
|
link_text: z.string().nullable(),
|
|
408
|
-
visibility: z.union([
|
|
416
|
+
visibility: z.union([
|
|
417
|
+
z.literal("PUBLIC"),
|
|
418
|
+
z.literal("PRIVATE"),
|
|
419
|
+
z.literal("HIDDEN"),
|
|
420
|
+
z.literal("ARCHIVED"),
|
|
421
|
+
z.literal("DRAFT"),
|
|
422
|
+
z.literal("DELETED")
|
|
423
|
+
]).optional(),
|
|
409
424
|
current_version: z.string().nullable(),
|
|
410
425
|
force: z.boolean().optional().describe("Override protection on user-modified entities")
|
|
411
426
|
});
|
|
@@ -415,7 +430,14 @@ var upsert_todo = z.object({
|
|
|
415
430
|
summary: z.string().optional().nullable(),
|
|
416
431
|
description: z.string().optional().nullable(),
|
|
417
432
|
progress: z.union([z.literal("UNSTARTED"), z.literal("IN_PROGRESS"), z.literal("COMPLETED")]).optional(),
|
|
418
|
-
visibility: z.union([
|
|
433
|
+
visibility: z.union([
|
|
434
|
+
z.literal("PUBLIC"),
|
|
435
|
+
z.literal("PRIVATE"),
|
|
436
|
+
z.literal("HIDDEN"),
|
|
437
|
+
z.literal("ARCHIVED"),
|
|
438
|
+
z.literal("DRAFT"),
|
|
439
|
+
z.literal("DELETED")
|
|
440
|
+
]).optional(),
|
|
419
441
|
start_time: z.string().optional().nullable(),
|
|
420
442
|
end_time: z.string().optional().nullable(),
|
|
421
443
|
priority: z.union([z.literal("LOW"), z.literal("MEDIUM"), z.literal("HIGH")]).optional(),
|
|
@@ -424,11 +446,30 @@ var upsert_todo = z.object({
|
|
|
424
446
|
goal_id: z.string().optional().nullable(),
|
|
425
447
|
force: z.boolean().optional().describe("Override protection on user-modified entities")
|
|
426
448
|
});
|
|
427
|
-
var update_action = z.union([
|
|
449
|
+
var update_action = z.union([
|
|
450
|
+
z.literal("CONFIRM"),
|
|
451
|
+
z.literal("UNLINK"),
|
|
452
|
+
z.literal("CREATE"),
|
|
453
|
+
z.literal("IGNORE"),
|
|
454
|
+
z.literal("DELETE"),
|
|
455
|
+
z.literal("COMPLETE")
|
|
456
|
+
]);
|
|
428
457
|
var upsert_tag = z.object({
|
|
429
458
|
id: z.string().optional(),
|
|
430
459
|
title: z.string(),
|
|
431
|
-
color: z.union([
|
|
460
|
+
color: z.union([
|
|
461
|
+
z.literal("red"),
|
|
462
|
+
z.literal("green"),
|
|
463
|
+
z.literal("blue"),
|
|
464
|
+
z.literal("yellow"),
|
|
465
|
+
z.literal("purple"),
|
|
466
|
+
z.literal("orange"),
|
|
467
|
+
z.literal("teal"),
|
|
468
|
+
z.literal("pink"),
|
|
469
|
+
z.literal("gray"),
|
|
470
|
+
z.literal("cyan"),
|
|
471
|
+
z.literal("lime")
|
|
472
|
+
]).nullable().optional(),
|
|
432
473
|
deleted: z.boolean().optional().default(false),
|
|
433
474
|
render: z.boolean().optional().default(true),
|
|
434
475
|
owner_id: z.string()
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
upsert_milestone,
|
|
8
8
|
upsert_project,
|
|
9
9
|
upsert_todo
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-UIFZ5MOM.js";
|
|
11
11
|
|
|
12
12
|
// src/errors.ts
|
|
13
13
|
var ApiError = class _ApiError extends Error {
|
|
@@ -425,7 +425,9 @@ var ApiClient2 = class {
|
|
|
425
425
|
list: () => wrap(() => this.clients.auth.get("/keys")),
|
|
426
426
|
create: (input) => {
|
|
427
427
|
const body = typeof input === "string" ? { name: input } : input ?? {};
|
|
428
|
-
return wrap(
|
|
428
|
+
return wrap(
|
|
429
|
+
() => this.clients.auth.post("/keys", { body })
|
|
430
|
+
);
|
|
429
431
|
},
|
|
430
432
|
revoke: (key_id) => wrap(() => this.clients.auth.delete(`/keys/${key_id}`)),
|
|
431
433
|
remove: (key_id) => wrap(() => this.clients.auth.delete(`/keys/${key_id}`))
|
|
@@ -860,7 +862,10 @@ var ApiClient2 = class {
|
|
|
860
862
|
const query = {};
|
|
861
863
|
if (params?.limit) query.limit = String(params.limit);
|
|
862
864
|
if (params?.before) query.before = params.before;
|
|
863
|
-
return this.clients.media.get(
|
|
865
|
+
return this.clients.media.get(
|
|
866
|
+
`/profiles/${slug}/timeline`,
|
|
867
|
+
Object.keys(query).length ? { query } : {}
|
|
868
|
+
);
|
|
864
869
|
})
|
|
865
870
|
},
|
|
866
871
|
connections: {
|
|
@@ -900,8 +905,12 @@ var ApiClient2 = class {
|
|
|
900
905
|
check: (platform, profile_id) => wrap(
|
|
901
906
|
() => this.clients.media.get(`/credentials/${platform}`, { query: { profile_id } })
|
|
902
907
|
),
|
|
903
|
-
save: (platform, data) => wrap(
|
|
904
|
-
|
|
908
|
+
save: (platform, data) => wrap(
|
|
909
|
+
() => this.clients.media.post(`/credentials/${platform}`, { body: data })
|
|
910
|
+
),
|
|
911
|
+
delete: (platform, profile_id) => wrap(
|
|
912
|
+
() => this.clients.media.delete(`/credentials/${platform}`, { query: { profile_id } })
|
|
913
|
+
)
|
|
905
914
|
},
|
|
906
915
|
timeline: {
|
|
907
916
|
get: (user_id, params) => wrap(() => {
|
|
@@ -925,7 +934,10 @@ var ApiClient2 = class {
|
|
|
925
934
|
const query = {};
|
|
926
935
|
if (options?.limit) query.limit = String(options.limit);
|
|
927
936
|
if (options?.since) query.since = options.since;
|
|
928
|
-
return this.clients.projects.get(
|
|
937
|
+
return this.clients.projects.get(
|
|
938
|
+
"/activity/ai",
|
|
939
|
+
Object.keys(query).length ? { query } : {}
|
|
940
|
+
);
|
|
929
941
|
})
|
|
930
942
|
};
|
|
931
943
|
this.user = {
|
|
@@ -1066,7 +1078,11 @@ var ApiClient2 = class {
|
|
|
1066
1078
|
/**
|
|
1067
1079
|
* Delete an ingest key
|
|
1068
1080
|
*/
|
|
1069
|
-
delete: (id, input) => wrap(
|
|
1081
|
+
delete: (id, input) => wrap(
|
|
1082
|
+
() => this.clients.pulse.delete(`/admin/keys/${id}`, {
|
|
1083
|
+
query: { project_id: input.project_id }
|
|
1084
|
+
})
|
|
1085
|
+
)
|
|
1070
1086
|
}
|
|
1071
1087
|
};
|
|
1072
1088
|
/**
|
|
@@ -1088,7 +1104,12 @@ var ApiClient2 = class {
|
|
|
1088
1104
|
get: (input) => {
|
|
1089
1105
|
const query = { project_id: input.project_id };
|
|
1090
1106
|
if (input.window_ms !== void 0) query.window_ms = String(input.window_ms);
|
|
1091
|
-
return wrap(
|
|
1107
|
+
return wrap(
|
|
1108
|
+
() => this.clients.pipelines.get(
|
|
1109
|
+
"/pipelines/dashboard",
|
|
1110
|
+
{ query }
|
|
1111
|
+
)
|
|
1112
|
+
);
|
|
1092
1113
|
}
|
|
1093
1114
|
},
|
|
1094
1115
|
/**
|
|
@@ -1101,7 +1122,9 @@ var ApiClient2 = class {
|
|
|
1101
1122
|
if (filter?.package_id !== void 0) query.package_id = filter.package_id;
|
|
1102
1123
|
if (filter?.status !== void 0) query.status = filter.status;
|
|
1103
1124
|
if (filter?.limit !== void 0) query.limit = String(filter.limit);
|
|
1104
|
-
return wrap(
|
|
1125
|
+
return wrap(
|
|
1126
|
+
() => this.clients.pipelines.get("/runs", Object.keys(query).length > 0 ? { query } : void 0)
|
|
1127
|
+
);
|
|
1105
1128
|
},
|
|
1106
1129
|
/**
|
|
1107
1130
|
* Get a pipeline run by ID
|
|
@@ -1144,7 +1167,11 @@ var ApiClient2 = class {
|
|
|
1144
1167
|
* `list` is read-only and returns the run's events newest-first.
|
|
1145
1168
|
*/
|
|
1146
1169
|
events: {
|
|
1147
|
-
ingest: (run_id, input) => wrap(
|
|
1170
|
+
ingest: (run_id, input) => wrap(
|
|
1171
|
+
() => this.clients.pipelines.post(`/runs/${run_id}/events`, {
|
|
1172
|
+
body: input
|
|
1173
|
+
})
|
|
1174
|
+
),
|
|
1148
1175
|
list: (run_id) => wrap(() => this.clients.pipelines.get(`/runs/${run_id}/events`))
|
|
1149
1176
|
},
|
|
1150
1177
|
/**
|
|
@@ -1189,7 +1216,12 @@ var ApiClient2 = class {
|
|
|
1189
1216
|
list: (filter) => {
|
|
1190
1217
|
const query = {};
|
|
1191
1218
|
if (filter?.project_id !== void 0) query.project_id = filter.project_id;
|
|
1192
|
-
return wrap(
|
|
1219
|
+
return wrap(
|
|
1220
|
+
() => this.clients.pipelines.get(
|
|
1221
|
+
"/packages",
|
|
1222
|
+
Object.keys(query).length > 0 ? { query } : void 0
|
|
1223
|
+
)
|
|
1224
|
+
);
|
|
1193
1225
|
},
|
|
1194
1226
|
/**
|
|
1195
1227
|
* Get a single package by id
|
|
@@ -1224,12 +1256,20 @@ var ApiClient2 = class {
|
|
|
1224
1256
|
/**
|
|
1225
1257
|
* List templates for an owner.
|
|
1226
1258
|
*/
|
|
1227
|
-
list: (input) => wrap(
|
|
1259
|
+
list: (input) => wrap(
|
|
1260
|
+
() => this.clients.pipelines.get("/analysis-templates", {
|
|
1261
|
+
query: { owner_id: input.owner_id }
|
|
1262
|
+
})
|
|
1263
|
+
),
|
|
1228
1264
|
/**
|
|
1229
1265
|
* Get a single template by id, scoped to its owner. 404 when
|
|
1230
1266
|
* unknown or owned by a different user.
|
|
1231
1267
|
*/
|
|
1232
|
-
get: (id, input) => wrap(
|
|
1268
|
+
get: (id, input) => wrap(
|
|
1269
|
+
() => this.clients.pipelines.get(`/analysis-templates/${id}`, {
|
|
1270
|
+
query: { owner_id: input.owner_id }
|
|
1271
|
+
})
|
|
1272
|
+
),
|
|
1233
1273
|
/**
|
|
1234
1274
|
* Create a new analysis template. `threshold_dsl` is parsed
|
|
1235
1275
|
* server-side; parse failure returns 400 `validation_error`
|
|
@@ -1242,14 +1282,20 @@ var ApiClient2 = class {
|
|
|
1242
1282
|
* Re-validates `threshold_dsl` when supplied; same
|
|
1243
1283
|
* `validation_error` shape as create on parse failure.
|
|
1244
1284
|
*/
|
|
1245
|
-
update: (id, input) => wrap(
|
|
1285
|
+
update: (id, input) => wrap(
|
|
1286
|
+
() => this.clients.pipelines.patch(`/analysis-templates/${id}`, { body: input })
|
|
1287
|
+
),
|
|
1246
1288
|
/**
|
|
1247
1289
|
* Hard-delete the template. Does NOT consult
|
|
1248
1290
|
* `pipeline_run.resolved_gates` — runs snapshot their gate
|
|
1249
1291
|
* template at resolve-time, so deletion never orphans
|
|
1250
1292
|
* in-flight runs.
|
|
1251
1293
|
*/
|
|
1252
|
-
delete: (id, input) => wrap(
|
|
1294
|
+
delete: (id, input) => wrap(
|
|
1295
|
+
() => this.clients.pipelines.delete(`/analysis-templates/${id}`, {
|
|
1296
|
+
query: { owner_id: input.owner_id }
|
|
1297
|
+
})
|
|
1298
|
+
)
|
|
1253
1299
|
},
|
|
1254
1300
|
/**
|
|
1255
1301
|
* OIDC trust-policy namespace — admin-gated CRUD for the
|
|
@@ -1264,12 +1310,16 @@ var ApiClient2 = class {
|
|
|
1264
1310
|
* matches the trust-matcher resolution order so the management UI
|
|
1265
1311
|
* shows the policy that would be picked first.
|
|
1266
1312
|
*/
|
|
1267
|
-
list: (input) => wrap(
|
|
1313
|
+
list: (input) => wrap(
|
|
1314
|
+
() => this.clients.pipelines.get("/oidc-trust", { query: { owner_id: input.owner_id } })
|
|
1315
|
+
),
|
|
1268
1316
|
/**
|
|
1269
1317
|
* Get a single policy by id, scoped to its owner. 404 when
|
|
1270
1318
|
* unknown, soft-deleted, or owned by a different user.
|
|
1271
1319
|
*/
|
|
1272
|
-
get: (id, input) => wrap(
|
|
1320
|
+
get: (id, input) => wrap(
|
|
1321
|
+
() => this.clients.pipelines.get(`/oidc-trust/${id}`, { query: { owner_id: input.owner_id } })
|
|
1322
|
+
),
|
|
1273
1323
|
/**
|
|
1274
1324
|
* Create a new policy. Defaults per plan §I.5: `repo_pattern: "*"`,
|
|
1275
1325
|
* `allowed_actions: ["artifacts:upload","runs:start"]`,
|
|
@@ -1286,7 +1336,11 @@ var ApiClient2 = class {
|
|
|
1286
1336
|
* audit). The matcher and management list both skip soft-deleted
|
|
1287
1337
|
* rows.
|
|
1288
1338
|
*/
|
|
1289
|
-
delete: (id, input) => wrap(
|
|
1339
|
+
delete: (id, input) => wrap(
|
|
1340
|
+
() => this.clients.pipelines.delete(`/oidc-trust/${id}`, {
|
|
1341
|
+
query: { owner_id: input.owner_id }
|
|
1342
|
+
})
|
|
1343
|
+
)
|
|
1290
1344
|
}
|
|
1291
1345
|
};
|
|
1292
1346
|
const base_url = options.base_url || "http://localhost:4321/api/v1";
|
|
@@ -1438,7 +1492,9 @@ var tools = {
|
|
|
1438
1492
|
name: "devpad_milestones_list",
|
|
1439
1493
|
description: "List milestones for authenticated user or by project",
|
|
1440
1494
|
inputSchema: milestone_filters,
|
|
1441
|
-
execute: async (client, input) => unwrap(
|
|
1495
|
+
execute: async (client, input) => unwrap(
|
|
1496
|
+
input.project_id ? await client.milestones.getByProject(input.project_id) : await client.milestones.list()
|
|
1497
|
+
)
|
|
1442
1498
|
},
|
|
1443
1499
|
devpad_milestones_get: {
|
|
1444
1500
|
name: "devpad_milestones_get",
|
|
@@ -1841,7 +1897,13 @@ var tools = {
|
|
|
1841
1897
|
range: z.enum(["24h", "7d", "30d", "90d"]).describe("Time range"),
|
|
1842
1898
|
group_by_fingerprint: z.boolean().optional().describe("Group by error fingerprint (true) or list all (false)")
|
|
1843
1899
|
}),
|
|
1844
|
-
execute: async (client, input) => unwrap(
|
|
1900
|
+
execute: async (client, input) => unwrap(
|
|
1901
|
+
await client.pulse.errors({
|
|
1902
|
+
project_id: input.project_id,
|
|
1903
|
+
range: input.range,
|
|
1904
|
+
group_by_fingerprint: input.group_by_fingerprint
|
|
1905
|
+
})
|
|
1906
|
+
)
|
|
1845
1907
|
},
|
|
1846
1908
|
devpad_pulse_logs: {
|
|
1847
1909
|
name: "devpad_pulse_logs",
|
package/dist/schema/index.js
CHANGED
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
upsert_tag,
|
|
33
33
|
upsert_todo,
|
|
34
34
|
webhook_event_body
|
|
35
|
-
} from "../chunk-
|
|
35
|
+
} from "../chunk-UIFZ5MOM.js";
|
|
36
36
|
import {
|
|
37
37
|
apiError,
|
|
38
38
|
authExpired,
|
|
@@ -74,7 +74,7 @@ import {
|
|
|
74
74
|
unauthorized,
|
|
75
75
|
validation,
|
|
76
76
|
validationFieldError
|
|
77
|
-
} from "../chunk-
|
|
77
|
+
} from "../chunk-BMT7GORG.js";
|
|
78
78
|
|
|
79
79
|
// ../schema/dist/types.js
|
|
80
80
|
var TAG_COLOURS = {
|
package/dist/schema/media.js
CHANGED
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
unauthorized,
|
|
40
40
|
validation,
|
|
41
41
|
validationFieldError
|
|
42
|
-
} from "../chunk-
|
|
42
|
+
} from "../chunk-BMT7GORG.js";
|
|
43
43
|
|
|
44
44
|
// ../schema/dist/media/branded.js
|
|
45
45
|
var userId = (id) => id;
|
|
@@ -549,7 +549,14 @@ var CommentPayloadSchema = z7.object({
|
|
|
549
549
|
score: z7.number(),
|
|
550
550
|
is_op: z7.boolean().default(false)
|
|
551
551
|
});
|
|
552
|
-
var PayloadSchema = z7.discriminatedUnion("type", [
|
|
552
|
+
var PayloadSchema = z7.discriminatedUnion("type", [
|
|
553
|
+
CommitPayloadSchema,
|
|
554
|
+
PostPayloadSchema,
|
|
555
|
+
VideoPayloadSchema,
|
|
556
|
+
TaskPayloadSchema,
|
|
557
|
+
PullRequestPayloadSchema,
|
|
558
|
+
CommentPayloadSchema
|
|
559
|
+
]);
|
|
553
560
|
var TimelineItemSchema = z7.object({
|
|
554
561
|
id: z7.string(),
|
|
555
562
|
platform: PlatformSchema,
|
package/package.json
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devpad/api",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.11",
|
|
4
|
+
"description": "TypeScript client library for the devpad API - project and task management made simple",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"api",
|
|
7
|
+
"client",
|
|
8
|
+
"devpad",
|
|
9
|
+
"project-management",
|
|
10
|
+
"task-management",
|
|
11
|
+
"typescript"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://devpad.tools",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/f0rbit/devpad/issues"
|
|
16
|
+
},
|
|
17
|
+
"license": "MIT",
|
|
4
18
|
"author": {
|
|
5
19
|
"name": "f0rbit",
|
|
6
20
|
"url": "https://github.com/f0rbit"
|
|
@@ -10,7 +24,34 @@
|
|
|
10
24
|
"url": "https://github.com/f0rbit/devpad.git",
|
|
11
25
|
"directory": "packages/api"
|
|
12
26
|
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist"
|
|
29
|
+
],
|
|
30
|
+
"type": "module",
|
|
13
31
|
"main": "dist/index.js",
|
|
32
|
+
"types": "dist/index.d.ts",
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"import": "./dist/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./schema": {
|
|
39
|
+
"types": "./dist/schema/index.d.ts",
|
|
40
|
+
"import": "./dist/schema/index.js"
|
|
41
|
+
},
|
|
42
|
+
"./schema/blog": {
|
|
43
|
+
"types": "./dist/schema/blog.d.ts",
|
|
44
|
+
"import": "./dist/schema/blog.js"
|
|
45
|
+
},
|
|
46
|
+
"./schema/media": {
|
|
47
|
+
"types": "./dist/schema/media.d.ts",
|
|
48
|
+
"import": "./dist/schema/media.js"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"publishConfig": {
|
|
52
|
+
"access": "public",
|
|
53
|
+
"registry": "https://registry.npmjs.org/"
|
|
54
|
+
},
|
|
14
55
|
"scripts": {
|
|
15
56
|
"build": "bunx tsup",
|
|
16
57
|
"build:watch": "bunx tsup --watch",
|
|
@@ -18,7 +59,6 @@
|
|
|
18
59
|
"test:unit": "bun test tests/unit/",
|
|
19
60
|
"test:integration": "bun test tests/integration/",
|
|
20
61
|
"test:coverage": "bun test --coverage",
|
|
21
|
-
"lint": "bun run eslint",
|
|
22
62
|
"prepublishOnly": "bun run build",
|
|
23
63
|
"clean": "rm -rf dist"
|
|
24
64
|
},
|
|
@@ -28,55 +68,13 @@
|
|
|
28
68
|
"zod": "^3.22.4"
|
|
29
69
|
},
|
|
30
70
|
"devDependencies": {
|
|
31
|
-
"@devpad/schema": "^2.2.
|
|
71
|
+
"@devpad/schema": "^2.2.11",
|
|
32
72
|
"@types/node": "^20.11.24",
|
|
33
73
|
"bun-types": "latest",
|
|
34
|
-
"eslint": "^8.57.0",
|
|
35
74
|
"tsup": "^8.0.0",
|
|
36
75
|
"typescript": "^5.9.2"
|
|
37
76
|
},
|
|
38
|
-
"exports": {
|
|
39
|
-
".": {
|
|
40
|
-
"types": "./dist/index.d.ts",
|
|
41
|
-
"import": "./dist/index.js"
|
|
42
|
-
},
|
|
43
|
-
"./schema": {
|
|
44
|
-
"types": "./dist/schema/index.d.ts",
|
|
45
|
-
"import": "./dist/schema/index.js"
|
|
46
|
-
},
|
|
47
|
-
"./schema/blog": {
|
|
48
|
-
"types": "./dist/schema/blog.d.ts",
|
|
49
|
-
"import": "./dist/schema/blog.js"
|
|
50
|
-
},
|
|
51
|
-
"./schema/media": {
|
|
52
|
-
"types": "./dist/schema/media.d.ts",
|
|
53
|
-
"import": "./dist/schema/media.js"
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"bugs": {
|
|
57
|
-
"url": "https://github.com/f0rbit/devpad/issues"
|
|
58
|
-
},
|
|
59
|
-
"description": "TypeScript client library for the devpad API - project and task management made simple",
|
|
60
77
|
"engines": {
|
|
61
78
|
"node": ">=18.0.0"
|
|
62
|
-
}
|
|
63
|
-
"files": [
|
|
64
|
-
"dist"
|
|
65
|
-
],
|
|
66
|
-
"homepage": "https://devpad.tools",
|
|
67
|
-
"keywords": [
|
|
68
|
-
"devpad",
|
|
69
|
-
"api",
|
|
70
|
-
"client",
|
|
71
|
-
"typescript",
|
|
72
|
-
"project-management",
|
|
73
|
-
"task-management"
|
|
74
|
-
],
|
|
75
|
-
"license": "MIT",
|
|
76
|
-
"publishConfig": {
|
|
77
|
-
"access": "public",
|
|
78
|
-
"registry": "https://registry.npmjs.org/"
|
|
79
|
-
},
|
|
80
|
-
"type": "module",
|
|
81
|
-
"types": "dist/index.d.ts"
|
|
79
|
+
}
|
|
82
80
|
}
|