@beechcms/api 0.6.3 → 0.6.5
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/assets/dashboard/assets/{chart-pTKbc60T.js → chart-IiMhdPtU.js} +2 -2
- package/assets/dashboard/assets/index-Culul_0c.js +745 -0
- package/assets/dashboard/assets/index-DWm-ERoT.css +1 -0
- package/assets/dashboard/assets/{pie-chart-recharts-BHRffVvU.js → pie-chart-recharts-BZAzxTy0.js} +1 -1
- package/assets/dashboard/assets/{timeseries-chart-recharts-BL2OaRk_.js → timeseries-chart-recharts-BFQVPxPT.js} +1 -1
- package/assets/dashboard/index.html +2 -2
- package/dist/factory.d.ts +3 -1
- package/dist/features/automations/api/automations.schema.d.ts +6 -6
- package/dist/index.js +1895 -2365
- package/dist/shared/db/repositories/content.repository.d1.d.ts +5 -2
- package/dist/shared/db/repositories/demo-data.repository.d1.d.ts +9 -4
- package/dist/shared/policies/apply-policies.d.ts +17 -4
- package/dist/shared/services/queue/cloudflare-queue-service.d.ts +5 -2
- package/dist/shared/services/queue/in-memory-queue-service.d.ts +1 -1
- package/dist/types.d.ts +7 -1
- package/package.json +3 -3
- package/assets/dashboard/assets/index-DQ68KtLl.js +0 -644
- package/assets/dashboard/assets/index-Dve7eEqA.css +0 -1
- package/dist/auth/constants.d.ts +0 -10
- package/dist/auth/utils/refresh-token.d.ts +0 -1
- package/dist/features/automations/engine/cron-runner.utils.d.ts +0 -1
- package/dist/features/content/constants.d.ts +0 -12
- package/dist/features/rotate-field/rotate-field.schema.d.ts +0 -11
- package/dist/public/api-key-middleware.d.ts +0 -6
- package/dist/public/cache-utils.d.ts +0 -10
- package/dist/public/problem-details.d.ts +0 -32
- package/dist/public/public-errors.d.ts +0 -13
- package/dist/public/response-builder.d.ts +0 -22
- package/dist/shared/cloudflare-queue-service.d.ts +0 -11
- package/dist/shared/db/migrations/demo-data-sql.d.ts +0 -1
- package/dist/shared/db/repositories/d1-setup-checklist.repository.d.ts +0 -12
- package/dist/shared/email/email.types.d.ts +0 -79
- package/dist/shared/email/templates/automation-mail.d.ts +0 -7
- package/dist/shared/email/templates/password-changed.d.ts +0 -15
- package/dist/shared/email/templates/password-reset.d.ts +0 -18
- package/dist/shared/email/templates/shell.d.ts +0 -58
- package/dist/shared/in-memory-queue-service.d.ts +0 -16
- package/dist/shared/jobs/fts-sync.d.ts +0 -1
- package/dist/shared/queue-consumer.d.ts +0 -9
- package/dist/shared/storage/upload.d.ts +0 -7
- package/dist/shared/utils/request-utils.d.ts +0 -13
- package/dist/shared/utils/storage-utils.d.ts +0 -7
package/dist/auth/constants.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/** API auth error messages - used by handlers and tests */
|
|
2
|
-
export declare const AUTH_ERRORS: {
|
|
3
|
-
readonly INVALID_REQUEST: 'Invalid request';
|
|
4
|
-
readonly INVALID_CREDENTIALS: 'Invalid credentials';
|
|
5
|
-
readonly DATABASE_ERROR: 'Database error';
|
|
6
|
-
/** Generic message for 500 errors - does not reveal system details */
|
|
7
|
-
readonly GENERIC_ERROR: 'An error occurred';
|
|
8
|
-
/** Rate limit exceeded */
|
|
9
|
-
readonly RATE_LIMIT_EXCEEDED: 'Too many requests';
|
|
10
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function generateRefreshToken(): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function cronMatches(expression: string | null, scheduledTime: number): boolean;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const CONTENT_ERRORS: {
|
|
2
|
-
readonly INVALID_SLUG: 'Invalid slug';
|
|
3
|
-
readonly INVALID_SLUG_OR_ID: 'Invalid slug or id';
|
|
4
|
-
readonly INVALID_JSON_BODY: 'Invalid JSON body';
|
|
5
|
-
readonly NOT_FOUND: 'Not found';
|
|
6
|
-
readonly SEED_NOT_FOUND: 'Seed not found';
|
|
7
|
-
readonly DATABASE_ERROR: 'Database error';
|
|
8
|
-
readonly SLUG_CONFLICT: 'Slug already exists for this schema';
|
|
9
|
-
readonly SENSITIVE_FIELD_EDIT: 'Cannot edit sensitive fields';
|
|
10
|
-
readonly BULK_SIZE_EXCEEDED: 'Cannot edit more than 500 entries at once';
|
|
11
|
-
readonly FIELD_NOT_BULK_EDITABLE: 'Field cannot be bulk-edited';
|
|
12
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* Schema for rotating a hashed field value.
|
|
4
|
-
* Used to update fields that have 'hash' privacy (e.g., passwords, PINs).
|
|
5
|
-
*/
|
|
6
|
-
export declare const rotateFieldRequestSchema: z.ZodObject<{
|
|
7
|
-
fieldAlias: z.ZodString;
|
|
8
|
-
currentValue: z.ZodString;
|
|
9
|
-
nextValue: z.ZodString;
|
|
10
|
-
}, z.core.$strip>;
|
|
11
|
-
export type RotateFieldRequest = z.infer<typeof rotateFieldRequestSchema>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Context } from 'hono';
|
|
2
|
-
type EdgeCache = {
|
|
3
|
-
cache: Cache;
|
|
4
|
-
executionCtx: {
|
|
5
|
-
waitUntil: (p: Promise<unknown>) => void;
|
|
6
|
-
};
|
|
7
|
-
} | null;
|
|
8
|
-
export declare function resolveEdgeCache(c: Context): EdgeCache;
|
|
9
|
-
export declare function withCachedResponse(edgeCache: EdgeCache, cacheKey: Request, response: Response): Response;
|
|
10
|
-
export {};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { Context } from 'hono';
|
|
2
|
-
/**
|
|
3
|
-
* Returns a Problem+JSON response when the error is a SQLite FK violation,
|
|
4
|
-
* or null when the error is unrelated (let the caller handle it).
|
|
5
|
-
*
|
|
6
|
-
* @param c Hono context
|
|
7
|
-
* @param error The caught error
|
|
8
|
-
* @param method HTTP method of the current request (e.g. 'DELETE', 'POST')
|
|
9
|
-
*/
|
|
10
|
-
export declare function fkProblemOrNull(c: Context, error: unknown, method: string): Response | null;
|
|
11
|
-
export interface PublicProblemDetailItem {
|
|
12
|
-
field: string;
|
|
13
|
-
expected: string;
|
|
14
|
-
received: string;
|
|
15
|
-
message: string;
|
|
16
|
-
}
|
|
17
|
-
type PublicProblemInput = {
|
|
18
|
-
type: string;
|
|
19
|
-
title: string;
|
|
20
|
-
status: 400 | 401 | 403 | 404 | 405 | 409 | 422 | 429 | 500 | 501;
|
|
21
|
-
detail: string;
|
|
22
|
-
errors?: PublicProblemDetailItem[];
|
|
23
|
-
headers?: Record<string, string>;
|
|
24
|
-
};
|
|
25
|
-
export declare function internalErrorDetail(env: {
|
|
26
|
-
ENV?: string;
|
|
27
|
-
}, error: unknown): string;
|
|
28
|
-
/**
|
|
29
|
-
* Restituisce errori API in formato Problem Details (RFC 9457).
|
|
30
|
-
*/
|
|
31
|
-
export declare function publicProblem(c: Context, input: PublicProblemInput): Response;
|
|
32
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Error constants for Public API responses.
|
|
3
|
-
*/
|
|
4
|
-
export declare const PUBLIC_ERRORS: {
|
|
5
|
-
readonly API_KEY_UNAUTHORIZED: {
|
|
6
|
-
readonly error: 'Unauthorized';
|
|
7
|
-
readonly message: 'Missing or invalid API key. Provide a valid key via X-API-Key header.';
|
|
8
|
-
};
|
|
9
|
-
readonly API_KEY_FORBIDDEN: {
|
|
10
|
-
readonly error: 'Forbidden';
|
|
11
|
-
readonly message: 'Public API access is not configured for this instance.';
|
|
12
|
-
};
|
|
13
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Helper meta per risposta lista Public API.
|
|
3
|
-
*/
|
|
4
|
-
export declare function buildPublicListMeta(input: {
|
|
5
|
-
total: number;
|
|
6
|
-
page: number;
|
|
7
|
-
limit: number;
|
|
8
|
-
returned: number;
|
|
9
|
-
seed: string;
|
|
10
|
-
}): {
|
|
11
|
-
total: number;
|
|
12
|
-
page: number;
|
|
13
|
-
limit: number;
|
|
14
|
-
returned: number;
|
|
15
|
-
seed: string;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Helper meta per risposta singolo elemento Public API.
|
|
19
|
-
*/
|
|
20
|
-
export declare function buildPublicSingleMeta(seed: string): {
|
|
21
|
-
seed: string;
|
|
22
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { IQueueService, QueueMessage } from '@beechcms/core';
|
|
2
|
-
/**
|
|
3
|
-
* Production producer. Sends a QueueMessage envelope onto the Cloudflare Queue
|
|
4
|
-
* binding. Cloudflare guarantees at-least-once delivery + retries on the
|
|
5
|
-
* consumer side, so enqueue only needs to hand off the message.
|
|
6
|
-
*/
|
|
7
|
-
export declare class CloudflareQueueService implements IQueueService {
|
|
8
|
-
private readonly queue;
|
|
9
|
-
constructor(queue: Queue<QueueMessage>);
|
|
10
|
-
enqueue<T>(name: string, payload: T): Promise<void>;
|
|
11
|
-
}
|