@devpad/api 2.2.11 → 2.2.12

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.
@@ -1,236 +1,49 @@
1
- // ../schema/dist/blog/corpus.js
2
- import { define_store, json_codec } from "@f0rbit/corpus";
3
- import { z } from "zod";
4
- var PostContentSchema = z.object({
5
- title: z.string().min(1),
6
- content: z.string(),
7
- description: z.string().optional(),
8
- format: z.enum(["md", "adoc"])
9
- });
10
- var postsStoreDefinition = define_store("posts", json_codec(PostContentSchema));
11
- var postStoreId = (userId, postUuid) => `posts/${userId}/${postUuid}`;
12
- var corpusPath = postStoreId;
13
- var VersionInfoSchema = z.object({
14
- hash: z.string(),
15
- parent: z.string().nullable(),
16
- created_at: z.date()
17
- });
18
- var mapCorpusError = (e) => {
19
- if (e.kind === "not_found") {
20
- return { kind: "not_found", path: e.store_id, version: e.version };
21
- }
22
- if (e.kind === "decode_error" || e.kind === "validation_error") {
23
- return { kind: "invalid_content", message: e.cause?.message ?? "Decode error" };
24
- }
25
- if (e.kind === "storage_error") {
26
- const drizzle_err = e.cause;
27
- const underlying = drizzle_err?.cause;
28
- const message = underlying?.message ?? drizzle_err?.message ?? "Storage error";
29
- return { kind: "io_error", message };
30
- }
31
- return { kind: "io_error", message: "Unknown corpus error" };
32
- };
33
- var parsePostContent = PostContentSchema.parse.bind(PostContentSchema);
34
- var serializePostContent = (content) => JSON.stringify(content);
35
-
36
- // ../schema/dist/blog/corpus-shim.js
37
- import { at, fetch_result, first, format_error, last, match, pipe, to_fallback, to_nullable, try_catch, try_catch_async, unwrap_or } from "@f0rbit/corpus";
38
-
39
- // ../schema/dist/blog/types.js
40
- import { z as z2 } from "zod";
41
- import { at as at2, err, fetch_result as fetch_result2, first as first2, format_error as format_error2, last as last2, match as match2, ok, pipe as pipe2, to_fallback as to_fallback2, to_nullable as to_nullable2, try_catch as try_catch2, try_catch_async as try_catch_async2, unwrap_or as unwrap_or2 } from "@f0rbit/corpus";
42
- var PostRowSchema = z2.object({
43
- id: z2.number(),
44
- uuid: z2.string(),
45
- author_id: z2.string(),
46
- slug: z2.string(),
47
- corpus_version: z2.string().nullable(),
48
- category: z2.string(),
49
- archived: z2.boolean(),
50
- publish_at: z2.coerce.date().nullable(),
51
- created_at: z2.coerce.date(),
52
- updated_at: z2.coerce.date()
53
- });
54
- var PostRowInsertSchema = z2.object({
55
- id: z2.number().optional(),
56
- uuid: z2.string(),
57
- author_id: z2.string(),
58
- slug: z2.string(),
59
- corpus_version: z2.string().nullable().optional(),
60
- category: z2.string().optional(),
61
- archived: z2.boolean().optional(),
62
- publish_at: z2.coerce.date().nullable().optional(),
63
- created_at: z2.coerce.date().optional(),
64
- updated_at: z2.coerce.date().optional()
65
- });
66
- var CategorySchema = z2.object({
67
- id: z2.number(),
68
- owner_id: z2.string(),
69
- name: z2.string(),
70
- parent: z2.string().nullable()
71
- });
72
- var CategoryInsertSchema = z2.object({
73
- id: z2.number().optional(),
74
- owner_id: z2.string(),
75
- name: z2.string(),
76
- parent: z2.string().nullable().optional()
77
- });
78
- var TagSchema = z2.object({
79
- post_id: z2.number(),
80
- tag: z2.string()
81
- });
82
- var TagInsertSchema = z2.object({
83
- post_id: z2.number(),
84
- tag: z2.string()
85
- });
86
- var AccessKeyRowSchema = z2.object({
87
- id: z2.number(),
88
- user_id: z2.string(),
89
- key_hash: z2.string(),
90
- name: z2.string(),
91
- note: z2.string().nullable(),
92
- enabled: z2.boolean(),
93
- created_at: z2.coerce.date()
94
- });
95
- var AccessKeySchema = AccessKeyRowSchema.omit({ key_hash: true });
96
- var AccessKeyInsertSchema = z2.object({
97
- id: z2.number().optional(),
98
- user_id: z2.string(),
99
- key_hash: z2.string(),
100
- name: z2.string(),
101
- note: z2.string().nullable().optional(),
102
- enabled: z2.boolean().optional(),
103
- created_at: z2.coerce.date().optional()
104
- });
105
- var IntegrationSchema = z2.object({
106
- id: z2.number(),
107
- user_id: z2.string(),
108
- source: z2.string(),
109
- location: z2.string(),
110
- data: z2.record(z2.unknown()).nullable(),
111
- last_fetch: z2.coerce.date().nullable(),
112
- status: z2.string().nullable(),
113
- created_at: z2.coerce.date()
114
- });
115
- var IntegrationInsertSchema = z2.object({
116
- id: z2.number().optional(),
117
- user_id: z2.string(),
118
- source: z2.string(),
119
- location: z2.string(),
120
- data: z2.record(z2.unknown()).nullable().optional(),
121
- last_fetch: z2.coerce.date().nullable().optional(),
122
- status: z2.string().nullable().optional(),
123
- created_at: z2.coerce.date().optional()
124
- });
125
- var FetchLinkSchema = z2.object({
126
- id: z2.number(),
127
- post_id: z2.number(),
128
- integration_id: z2.number(),
129
- identifier: z2.string()
130
- });
131
- var FetchLinkInsertSchema = z2.object({
132
- id: z2.number().optional(),
133
- post_id: z2.number(),
134
- integration_id: z2.number(),
135
- identifier: z2.string()
136
- });
137
- var PostSchema = z2.object({
138
- id: z2.number(),
139
- uuid: z2.string().uuid(),
140
- author_id: z2.string(),
141
- slug: z2.string(),
142
- title: z2.string(),
143
- content: z2.string(),
144
- description: z2.string().optional(),
145
- format: z2.enum(["md", "adoc"]),
146
- category: z2.string(),
147
- tags: z2.array(z2.string()),
148
- archived: z2.boolean(),
149
- publish_at: z2.coerce.date().nullable(),
150
- created_at: z2.coerce.date(),
151
- updated_at: z2.coerce.date(),
152
- project_ids: z2.array(z2.string()),
153
- corpus_version: z2.string().nullable()
154
- });
155
- var SlugPattern = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
156
- var PostCreateSchema = z2.object({
157
- slug: z2.string().regex(SlugPattern, "Slug must be lowercase alphanumeric with hyphens"),
158
- title: z2.string().min(1),
159
- content: z2.string(),
160
- description: z2.string().optional(),
161
- format: z2.enum(["md", "adoc"]).default("md"),
162
- category: z2.string().default("root"),
163
- tags: z2.array(z2.string()).default([]),
164
- publish_at: z2.coerce.date().nullable().optional(),
165
- project_ids: z2.array(z2.string()).optional()
166
- });
167
- var PostUpdateSchema = z2.object({
168
- slug: z2.string().regex(SlugPattern, "Slug must be lowercase alphanumeric with hyphens").optional(),
169
- title: z2.string().min(1).optional(),
170
- content: z2.string().optional(),
171
- description: z2.string().optional(),
172
- format: z2.enum(["md", "adoc"]).optional(),
173
- category: z2.string().optional(),
174
- tags: z2.array(z2.string()).optional(),
175
- archived: z2.boolean().optional(),
176
- publish_at: z2.coerce.date().nullable().optional(),
177
- project_ids: z2.array(z2.string()).optional()
178
- });
179
- var PostListParamsSchema = z2.object({
180
- category: z2.string().optional(),
181
- tag: z2.string().optional(),
182
- project: z2.string().optional(),
183
- status: z2.enum(["published", "scheduled", "draft", "all"]).default("all"),
184
- archived: z2.boolean().default(false),
185
- limit: z2.coerce.number().min(1).max(100).default(10),
186
- offset: z2.coerce.number().min(0).default(0),
187
- sort: z2.enum(["created", "updated", "published"]).default("updated")
188
- });
189
- var PostsResponseSchema = z2.object({
190
- posts: z2.array(PostSchema),
191
- total_posts: z2.number(),
192
- total_pages: z2.number(),
193
- per_page: z2.number(),
194
- current_page: z2.number()
195
- });
196
- var isPublished = (post) => post.publish_at !== null && post.publish_at <= /* @__PURE__ */ new Date();
197
- var isScheduled = (post) => post.publish_at !== null && post.publish_at > /* @__PURE__ */ new Date();
198
- var isDraft = (post) => post.publish_at === null;
199
- var postStatus = (post) => {
200
- if (isDraft(post))
201
- return "draft";
202
- if (isScheduled(post))
203
- return "scheduled";
204
- return "published";
205
- };
206
- var CategoryCreateSchema = z2.object({
207
- name: z2.string().min(1),
208
- parent: z2.string().default("root")
209
- });
210
- var AccessKeyCreateSchema = z2.object({
211
- name: z2.string().min(1),
212
- note: z2.string().optional()
213
- });
214
- var AccessKeyUpdateSchema = z2.object({
215
- name: z2.string().min(1).optional(),
216
- note: z2.string().optional(),
217
- enabled: z2.boolean().optional()
218
- });
219
- var IntegrationUpsertSchema = z2.object({
220
- source: z2.string().min(1),
221
- location: z2.string().min(1),
222
- data: z2.record(z2.unknown()).optional()
223
- });
1
+ import {
2
+ AccessKeyCreateSchema,
3
+ AccessKeyInsertSchema,
4
+ AccessKeyRowSchema,
5
+ AccessKeySchema,
6
+ AccessKeyUpdateSchema,
7
+ CategoryCreateSchema,
8
+ CategoryInsertSchema,
9
+ CategorySchema,
10
+ FetchLinkInsertSchema,
11
+ FetchLinkSchema,
12
+ IntegrationInsertSchema,
13
+ IntegrationSchema,
14
+ IntegrationUpsertSchema,
15
+ PostContentSchema,
16
+ PostCreateSchema,
17
+ PostListParamsSchema,
18
+ PostRowInsertSchema,
19
+ PostRowSchema,
20
+ PostSchema,
21
+ PostUpdateSchema,
22
+ PostsResponseSchema,
23
+ TagInsertSchema,
24
+ TagSchema,
25
+ VersionInfoSchema,
26
+ corpusPath,
27
+ isDraft,
28
+ isPublished,
29
+ isScheduled,
30
+ mapCorpusError,
31
+ parsePostContent,
32
+ postStatus,
33
+ postStoreId,
34
+ postsStoreDefinition,
35
+ serializePostContent
36
+ } from "../chunk-5L3AUVMM.js";
224
37
 
225
38
  // src/schema/blog.ts
226
39
  import {
227
40
  create_cloudflare_backend,
228
41
  create_corpus,
229
42
  create_memory_backend,
230
- define_store as define_store2,
231
- err as err2,
232
- json_codec as json_codec2,
233
- ok as ok2
43
+ define_store,
44
+ err,
45
+ json_codec,
46
+ ok
234
47
  } from "@f0rbit/corpus";
235
48
  export {
236
49
  AccessKeyCreateSchema,
@@ -261,14 +74,14 @@ export {
261
74
  create_cloudflare_backend,
262
75
  create_corpus,
263
76
  create_memory_backend,
264
- define_store2 as define_store,
265
- err2 as err,
77
+ define_store,
78
+ err,
266
79
  isDraft,
267
80
  isPublished,
268
81
  isScheduled,
269
- json_codec2 as json_codec,
82
+ json_codec,
270
83
  mapCorpusError,
271
- ok2 as ok,
84
+ ok,
272
85
  parsePostContent,
273
86
  postStatus,
274
87
  postStoreId,
@@ -1,5 +1,5 @@
1
1
  export { A as ApiError, a as AuthExpiredError, B as BadRequestError, b as BaseError, C as ConflictError, c as CronError, D as DatabaseError, E as EncryptionError, d as ErrorContext, e as ErrorLogEntry, F as ForbiddenError, G as GithubError, N as NetworkError, f as NotFoundError, P as ParseError, g as ProtectedError, h as ProviderError, R as RateLimitedError, S as ScanError, i as ServiceError, j as StoreError, U as UnauthorizedError, V as ValidationError, k as ValidationFieldError, l as apiError, m as authExpired, n as badRequest, o as configureErrorLogging, p as conflict, q as dbError, r as encryptionError, s as errors, t as forbidden, u as githubError, v as isApiError, w as isAuthExpiredError, x as isBadRequestError, y as isConflictError, z as isDatabaseError, H as isEncryptionError, I as isForbiddenError, J as isGithubError, K as isNetworkError, L as isNotFoundError, M as isParseError, O as isProtectedError, Q as isRateLimitedError, T as isRetryableError, W as isScanError, X as isServiceError, Y as isStoreError, Z as isUnauthorizedError, _ as isValidationError, $ as isValidationFieldError, a0 as networkError, a1 as notFound, a2 as parseError, a3 as protectedEntity, a4 as rateLimited, a5 as scanError, a6 as storeError, a7 as unauthorized, a8 as validation, a9 as validationFieldError } from '../errors.d-CNYqUDaJ.js';
2
- export { A as Action, a as ApiKey, C as CodebaseTask, b as ConfigSchemaType, D as DashboardResponse, c as DashboardWindowQuery, G as GetConfigResult, d as Goal, H as HistoryAction, I as IgnorePath, e as InsertPipelineStageEvent, M as Milestone, N as Nullable, P as PipelineAnalysisTemplate, f as PipelineApproval, g as PipelineGrant, h as PipelineOidcTrust, i as PipelinePackage, j as PipelineRun, k as PipelineStageEvent, l as Project, m as ProjectConfig, n as ProjectWithTasks, R as RolloutShapeZ, o as RunKindZ, S as SaveConfigRequest, p as ScanStatus, q as Session, T as TAG_COLOURS, r as Tag, s as TagColor, t as TagConfig, u as TagWithColor, v as TagWithTypedColor, w as Task, x as TaskTag, y as TaskView, z as TaskWithDetails, B as TodoUpdate, E as TrackerResult, U as UpdateAction, F as UpdateData, J as UpdateUser, K as UpsertGoal, L as UpsertMilestone, O as UpsertPipelineAnalysisTemplate, Q as UpsertPipelineApproval, V as UpsertPipelineGrant, W as UpsertPipelineOidcTrust, X as UpsertPipelinePackage, Y as UpsertPipelineRun, Z as UpsertProject, _ as UpsertTag, $ as UpsertTodo, a0 as User, a1 as WebhookEventBody, a2 as approval_decision, a3 as config_schema, a4 as dashboard_response, a5 as dashboard_window_query, a6 as forced_atomic_reason, a7 as gate_descriptor, a8 as grant_scope, a9 as insert_pipeline_stage_event, aa as pipeline_oidc_provider, ab as project_config, ac as resolved_gates, ad as resolved_rollout, ae as rollout_shape, af as rollout_stage, ag as run_kind, ah as run_status, ai as save_config_request, aj as save_tags_request, ak as stage_event_kind, al as update_action, am as update_user, an as upsert_goal, ao as upsert_milestone, ap as upsert_pipeline_analysis_template, aq as upsert_pipeline_approval, ar as upsert_pipeline_grant, as as upsert_pipeline_oidc_trust, at as upsert_pipeline_package, au as upsert_pipeline_run, av as upsert_project, aw as upsert_tag, ax as upsert_todo, ay as webhook_event_body } from '../types.d-BvfRohlZ.js';
2
+ export { A as Action, a as ApiKey, C as CodebaseTask, b as ConfigSchemaType, D as DashboardResponse, c as DashboardWindowQuery, G as GetConfigResult, d as Goal, H as HistoryAction, I as IgnorePath, e as InsertPipelineStageEvent, M as Milestone, N as Nullable, P as PipelineAnalysisTemplate, f as PipelineApproval, g as PipelineGrant, h as PipelineOidcTrust, i as PipelinePackage, j as PipelineRun, k as PipelineStageEvent, l as Project, m as ProjectConfig, n as ProjectWithTasks, R as RolloutShapeZ, o as RunKindZ, S as SaveConfigRequest, p as ScanStatus, q as Session, T as TAG_COLOURS, r as Tag, s as TagColor, t as TagConfig, u as TagWithColor, v as TagWithTypedColor, w as Task, x as TaskTag, y as TaskView, z as TaskWithDetails, B as TodoUpdate, E as TrackerResult, U as UpdateAction, F as UpdateData, J as UpdateUser, K as UpsertGoal, L as UpsertMilestone, O as UpsertPipelineAnalysisTemplate, Q as UpsertPipelineApproval, V as UpsertPipelineGrant, W as UpsertPipelineOidcTrust, X as UpsertPipelinePackage, Y as UpsertPipelineRun, Z as UpsertProject, _ as UpsertTag, $ as UpsertTodo, a0 as User, a1 as WebhookEventBody, a2 as approval_decision, a3 as config_schema, a4 as dashboard_response, a5 as dashboard_window_query, a6 as forced_atomic_reason, a7 as gate_descriptor, a8 as grant_scope, a9 as insert_pipeline_stage_event, aa as pipeline_oidc_provider, ab as project_config, ac as resolved_gates, ad as resolved_rollout, ae as rollout_shape, af as rollout_stage, ag as run_kind, ah as run_status, ai as save_config_request, aj as save_tags_request, ak as stage_event_kind, al as update_action, am as update_user, an as upsert_goal, ao as upsert_milestone, ap as upsert_pipeline_analysis_template, aq as upsert_pipeline_approval, ar as upsert_pipeline_grant, as as upsert_pipeline_oidc_trust, at as upsert_pipeline_package, au as upsert_pipeline_run, av as upsert_project, aw as upsert_tag, ax as upsert_todo, ay as webhook_event_body } from '../types.d-yIorr_SU.js';
3
3
  export { a as ApprovalDecision, F as ForcedAtomicReason, P as PipelineOidcProvider, R as RolloutShape, b as RunStatus, S as StageEventKind } from '../schema.d-BeVFWenc.js';
4
4
  import '@f0rbit/corpus';
5
5
  import 'drizzle-orm';
@@ -32,7 +32,7 @@ import {
32
32
  upsert_tag,
33
33
  upsert_todo,
34
34
  webhook_event_body
35
- } from "../chunk-UIFZ5MOM.js";
35
+ } from "../chunk-DIX4XVUQ.js";
36
36
  import {
37
37
  apiError,
38
38
  authExpired,
@@ -1,6 +1,6 @@
1
1
  import { InferSelectModel } from 'drizzle-orm';
2
2
  import { z } from 'zod';
3
- import { d as api_keys, o as project, m as milestone, g as goal, r as task, e as codebase_tasks, c as action, A as ActionType, t as tag, l as pipeline_run, n as pipeline_stage_event, h as pipeline_grant, k as pipeline_package, p as pipeline_analysis_template, j as pipeline_oidc_trust, i as ignore_path, f as pipeline_approval, s as session, q as tag_config, u as task_tag, v as todo_updates, w as tracker_result, x as user } from './schema.d-BeVFWenc.js';
3
+ import { d as api_keys, o as project, v as todo_updates, c as action, A as ActionType, m as milestone, g as goal, r as task, e as codebase_tasks, t as tag, l as pipeline_run, n as pipeline_stage_event, h as pipeline_grant, k as pipeline_package, p as pipeline_analysis_template, j as pipeline_oidc_trust, i as ignore_path, f as pipeline_approval, s as session, q as tag_config, u as task_tag, w as tracker_result, x as user } from './schema.d-BeVFWenc.js';
4
4
 
5
5
  declare const upsert_project: z.ZodObject<{
6
6
  id: z.ZodNullable<z.ZodOptional<z.ZodString>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devpad/api",
3
- "version": "2.2.11",
3
+ "version": "2.2.12",
4
4
  "description": "TypeScript client library for the devpad API - project and task management made simple",
5
5
  "keywords": [
6
6
  "api",
@@ -68,7 +68,7 @@
68
68
  "zod": "^3.22.4"
69
69
  },
70
70
  "devDependencies": {
71
- "@devpad/schema": "^2.2.11",
71
+ "@devpad/schema": "^2.2.12",
72
72
  "@types/node": "^20.11.24",
73
73
  "bun-types": "latest",
74
74
  "tsup": "^8.0.0",