@palbase/backend 23.1.0 → 24.0.1
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/bin/palbase-backend.cjs +400 -47
- package/dist/bin/palbase-backend.cjs.map +1 -1
- package/dist/bin/palbase-backend.js +4 -5
- package/dist/bin/palbase-backend.js.map +1 -1
- package/dist/{chunk-OHALWEOG.js → chunk-7Z6MGMXQ.js} +57 -2
- package/dist/chunk-7Z6MGMXQ.js.map +1 -0
- package/dist/{chunk-RCLNBJCM.js → chunk-H3JAISUY.js} +136 -1
- package/dist/chunk-H3JAISUY.js.map +1 -0
- package/dist/{chunk-PY7YJDCT.js → chunk-LCL7TUAI.js} +32 -3
- package/dist/chunk-LCL7TUAI.js.map +1 -0
- package/dist/{chunk-NS5V43YQ.js → chunk-P2Q27SGP.js} +19 -3
- package/dist/chunk-P2Q27SGP.js.map +1 -0
- package/dist/{chunk-R3KN6RHD.js → chunk-T5IOSOE5.js} +7 -2
- package/dist/chunk-T5IOSOE5.js.map +1 -0
- package/dist/{chunk-M5MCBWJI.js → chunk-YSQBC2VL.js} +275 -31
- package/dist/chunk-YSQBC2VL.js.map +1 -0
- package/dist/db/index.cjs +48 -3
- package/dist/db/index.cjs.map +1 -1
- package/dist/db/index.d.cts +2 -2
- package/dist/db/index.d.ts +2 -2
- package/dist/db/index.js +2 -2
- package/dist/{endpoint-CVWXh6oG.d.ts → endpoint-0_DGBajf.d.ts} +100 -3
- package/dist/{endpoint-c9h5jriX.d.cts → endpoint-CcQ1a36a.d.cts} +100 -3
- package/dist/engine/index.cjs +389 -34
- package/dist/engine/index.cjs.map +1 -1
- package/dist/engine/index.d.cts +4 -4
- package/dist/engine/index.d.ts +4 -4
- package/dist/engine/index.js +4 -4
- package/dist/{index-CwAJ7HEe.d.ts → index-BOS_rFBO.d.ts} +125 -21
- package/dist/{index-CxeQSfJP.d.cts → index-C84bLgeO.d.cts} +134 -9
- package/dist/{index-By8Dle5U.d.cts → index-MoQ31B6M.d.cts} +125 -21
- package/dist/{index-BZrJXnVh.d.ts → index-dJNhDZ7j.d.ts} +134 -9
- package/dist/index.cjs +166 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +54 -12
- package/dist/index.d.ts +54 -12
- package/dist/index.js +28 -11
- package/dist/index.js.map +1 -1
- package/dist/openapi/index.cjs +16 -1
- package/dist/openapi/index.cjs.map +1 -1
- package/dist/openapi/index.d.cts +6 -4
- package/dist/openapi/index.d.ts +6 -4
- package/dist/openapi/index.js +6 -7
- package/dist/openapi/index.js.map +1 -1
- package/dist/{registry-CqPK2Qby.d.cts → registry-1X-skBNu.d.cts} +1 -1
- package/dist/{registry-B3niOVYp.d.ts → registry-CEod_5sz.d.ts} +1 -1
- package/dist/test/index.cjs +27 -0
- package/dist/test/index.cjs.map +1 -1
- package/dist/test/index.d.cts +1 -1
- package/dist/test/index.d.ts +1 -1
- package/dist/test/index.js +27 -0
- package/dist/test/index.js.map +1 -1
- package/docs/README.md +4 -4
- package/docs/database.md +115 -11
- package/docs/getting-started.md +5 -4
- package/docs/llms-full.txt +385 -89
- package/docs/migrations.md +81 -59
- package/docs/schema.md +82 -2
- package/docs/services.md +98 -9
- package/package.json +2 -2
- package/template/AGENTS.md +121 -41
- package/template/controllers/notes.controller.ts +64 -0
- package/template/package.json +1 -1
- package/template/services/note.service.ts +74 -0
- package/template/tsconfig.json +11 -1
- package/dist/chunk-HQRJDARQ.js +0 -90
- package/dist/chunk-HQRJDARQ.js.map +0 -1
- package/dist/chunk-M5MCBWJI.js.map +0 -1
- package/dist/chunk-NS5V43YQ.js.map +0 -1
- package/dist/chunk-OHALWEOG.js.map +0 -1
- package/dist/chunk-PY7YJDCT.js.map +0 -1
- package/dist/chunk-R3KN6RHD.js.map +0 -1
- package/dist/chunk-RCLNBJCM.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { h as PalbaseResult, A as AuthSpec, H as HttpError } from './endpoint-
|
|
2
|
-
export { i as AuthConfig, B as BadRequest, C as CacheClient, j as ClientInfo, k as Conflict, D as DBClient, f as DBOps, E as ErrorDef, l as ErrorMap, m as ErrorThrowers, F as FileContext, n as Forbidden, o as HttpMethod, L as Logger, M as Materialized, p as Middleware, q as MiddlewareContext, r as MiddlewareHandler, N as NotFound, s as PBRequest, t as PalError, u as PalbaseAnalyticsClient, v as PalbaseAnalyticsManagementNamespace, w as PalbaseAnalyticsProperties, x as PalbaseAnalyticsQueryNamespace, y as PalbaseAttestAndroidParams, z as PalbaseAttestAndroidResult, G as PalbaseAttestiOSParams, I as PalbaseAttestiOSResult, J as PalbaseAuthClient, K as PalbaseBatchOverrideOperation, O as PalbaseBatchSetOverridesResult, Q as PalbaseBindDeviceParams, e as PalbaseBucketClient, U as PalbaseClearAllOverridesResult, V as PalbaseClearOverrideResult, W as PalbaseCohortQueryInput, X as PalbaseCohortResult, Y as PalbaseCollectionRef, Z as PalbaseCountQueryInput, _ as PalbaseCountResult, $ as PalbaseCreateLinkParams, a0 as PalbaseDeviceInfo, a1 as PalbaseDeviceTokenView, P as PalbaseDocsClient, a2 as PalbaseDocumentRef, a3 as PalbaseDocumentSnapshot, a4 as PalbaseEmailClient, a5 as PalbaseEmailSendParams, a6 as PalbaseEmailSendResponse, a7 as PalbaseEventNamesResult, a8 as PalbaseEventsQueryInput, a9 as PalbaseEventsResult, aa as PalbaseFileObject, ab as PalbaseFlag, ac as PalbaseFlagContext, ad as PalbaseFlagSource, ae as PalbaseFlagValue, af as PalbaseFlagVariant, a as PalbaseFlagsClient, ag as PalbaseFlagsServiceClient, ah as PalbaseFunctionsClient, ai as PalbaseFunnelQueryInput, aj as PalbaseFunnelResult, ak as PalbaseIdentifyTraits, al as PalbaseInboxClient, am as PalbaseInboxListOptions, an as PalbaseInboxListResult, ao as PalbaseInboxMessage, ap as PalbaseInboxSendParams, aq as PalbaseInboxSendResponse, ar as PalbaseInitialLink, as as PalbaseInvokeOptions, at as PalbaseLink, au as PalbaseLinkAnalytics, av as PalbaseLinkDetails, aw as PalbaseLinksClient, ax as PalbaseListLinksOptions, ay as PalbaseListLinksResult, az as PalbaseListOptions, aA as PalbaseMatchParams, aB as PalbaseMultiChannelResponse, b as PalbaseNotificationsClient, aC as PalbaseOverviewResult, aD as PalbasePreferences, aE as PalbasePreferencesClient, aF as PalbasePushClient, aG as PalbasePushSendParams, aH as PalbasePushSendResponse, aI as PalbaseQrCodeOptions, aJ as PalbaseQuerySnapshot, c as PalbaseRealtimeClient, aK as PalbaseRegisterDeviceParams, aL as PalbaseRetentionQueryInput, aM as PalbaseRetentionResult, aN as PalbaseSession, aO as PalbaseSetOverrideResult, aP as PalbaseSetOverridesResult, aQ as PalbaseSignedUrlResponse, aR as PalbaseSmsClient, aS as PalbaseSmsSendParams, aT as PalbaseSmsSendResponse, d as PalbaseStorageClient, aU as PalbaseTransformOptions, aV as PalbaseUpdateLinkParams, aW as PalbaseUploadOptions, aX as PalbaseUser, aY as PalbaseUserDetailResult, aZ as PalbaseUsersQueryInput, a_ as PalbaseUsersResult, a$ as PalbaseVerifyRequestSignatureParams, b0 as PalbaseWhereOperator, R as RateLimitConfig, b1 as Ref, S as SecretsService, b2 as TooManyRequests, b3 as TxColumnExpr, b4 as TxInsertShape, b5 as TxInsertValue, b6 as TxNow, T as TxPlanBody, b7 as TxPlanError, b8 as TxPlanHandle, b9 as TxPlanOpResult, ba as TxPlanRejection, g as TxPlanResponse, bb as TxRefError, bc as TxRow, bd as TxRows, be as TxSelectOptions, bf as TxSetShape, bg as TxSetValue, bh as TxTable, bi as TxWhere, bj as TxWireExpr, bk as TxWireGuard, bl as TxWireOp, bm as TxWireRef, bn as TxWireValue, bo as Unauthorized, bp as
|
|
3
|
-
import { M as ModuleClients } from './index-
|
|
4
|
-
export { C as Cache, D as Database, a as Documents, F as Flags, L as Log, N as Notifications, R as Realtime,
|
|
5
|
-
import { S as SchemaDef } from './index-
|
|
6
|
-
export { C as ColumnBuilder, a as ColumnDef, b as ColumnMap, c as ColumnType, d as EXTENSION_DEPENDENCIES, e as EmbeddingModelRef, f as EnvServiceDatabase, g as EnvTables, E as EnvTypedDatabase, h as EnvTypedTable, I as InsertShape, O as OnDeleteAction, P as PALBASE_EXTENSIONS, i as PalbaseExtension, j as PolicyBuilder, k as PolicyCommand, l as PolicyDef, m as PolicyMode, R as RawConstraintDef, n as RowShape, o as SchemaInput, T as TableDef, p as TableInput, q as TxPlan, r as TxTables, s as TypedDB, t as TypedTable, u as TypedTx, v as bigint, w as boolean, x as defineSchema, y as enumType, z as integer, A as isPalbaseExtension, B as jsonb, D as makeTypedDB, F as numeric, G as openai, H as policy, J as raw, K as text, L as timestamp, M as uuid, N as vector } from './index-
|
|
1
|
+
import { h as PalbaseResult, A as AuthSpec, H as HttpError } from './endpoint-CcQ1a36a.cjs';
|
|
2
|
+
export { i as AuthConfig, B as BadRequest, C as CacheClient, j as ClientInfo, k as Conflict, D as DBClient, f as DBOps, E as ErrorDef, l as ErrorMap, m as ErrorThrowers, F as FileContext, n as Forbidden, o as HttpMethod, L as Logger, M as Materialized, p as Middleware, q as MiddlewareContext, r as MiddlewareHandler, N as NotFound, s as PBRequest, t as PalError, u as PalbaseAnalyticsClient, v as PalbaseAnalyticsManagementNamespace, w as PalbaseAnalyticsProperties, x as PalbaseAnalyticsQueryNamespace, y as PalbaseAttestAndroidParams, z as PalbaseAttestAndroidResult, G as PalbaseAttestiOSParams, I as PalbaseAttestiOSResult, J as PalbaseAuthClient, K as PalbaseBatchOverrideOperation, O as PalbaseBatchSetOverridesResult, Q as PalbaseBindDeviceParams, e as PalbaseBucketClient, U as PalbaseClearAllOverridesResult, V as PalbaseClearOverrideResult, W as PalbaseCohortQueryInput, X as PalbaseCohortResult, Y as PalbaseCollectionRef, Z as PalbaseCountQueryInput, _ as PalbaseCountResult, $ as PalbaseCreateLinkParams, a0 as PalbaseDeviceInfo, a1 as PalbaseDeviceTokenView, P as PalbaseDocsClient, a2 as PalbaseDocumentRef, a3 as PalbaseDocumentSnapshot, a4 as PalbaseEmailClient, a5 as PalbaseEmailSendParams, a6 as PalbaseEmailSendResponse, a7 as PalbaseEventNamesResult, a8 as PalbaseEventsQueryInput, a9 as PalbaseEventsResult, aa as PalbaseFileObject, ab as PalbaseFlag, ac as PalbaseFlagContext, ad as PalbaseFlagSource, ae as PalbaseFlagValue, af as PalbaseFlagVariant, a as PalbaseFlagsClient, ag as PalbaseFlagsServiceClient, ah as PalbaseFunctionsClient, ai as PalbaseFunnelQueryInput, aj as PalbaseFunnelResult, ak as PalbaseIdentifyTraits, al as PalbaseInboxClient, am as PalbaseInboxListOptions, an as PalbaseInboxListResult, ao as PalbaseInboxMessage, ap as PalbaseInboxSendParams, aq as PalbaseInboxSendResponse, ar as PalbaseInitialLink, as as PalbaseInvokeOptions, at as PalbaseLink, au as PalbaseLinkAnalytics, av as PalbaseLinkDetails, aw as PalbaseLinksClient, ax as PalbaseListLinksOptions, ay as PalbaseListLinksResult, az as PalbaseListOptions, aA as PalbaseMatchParams, aB as PalbaseMultiChannelResponse, b as PalbaseNotificationsClient, aC as PalbaseOverviewResult, aD as PalbasePreferences, aE as PalbasePreferencesClient, aF as PalbasePushClient, aG as PalbasePushSendParams, aH as PalbasePushSendResponse, aI as PalbaseQrCodeOptions, aJ as PalbaseQuerySnapshot, c as PalbaseRealtimeClient, aK as PalbaseRegisterDeviceParams, aL as PalbaseRetentionQueryInput, aM as PalbaseRetentionResult, aN as PalbaseSession, aO as PalbaseSetOverrideResult, aP as PalbaseSetOverridesResult, aQ as PalbaseSignedUrlResponse, aR as PalbaseSmsClient, aS as PalbaseSmsSendParams, aT as PalbaseSmsSendResponse, d as PalbaseStorageClient, aU as PalbaseTransformOptions, aV as PalbaseUpdateLinkParams, aW as PalbaseUploadOptions, aX as PalbaseUser, aY as PalbaseUserDetailResult, aZ as PalbaseUsersQueryInput, a_ as PalbaseUsersResult, a$ as PalbaseVerifyRequestSignatureParams, b0 as PalbaseWhereOperator, R as RateLimitConfig, b1 as Ref, S as SecretsService, b2 as TooManyRequests, b3 as TxColumnExpr, b4 as TxInsertShape, b5 as TxInsertValue, b6 as TxNow, T as TxPlanBody, b7 as TxPlanError, b8 as TxPlanHandle, b9 as TxPlanOpResult, ba as TxPlanRejection, g as TxPlanResponse, bb as TxRefError, bc as TxRow, bd as TxRows, be as TxSelectOptions, bf as TxSetShape, bg as TxSetValue, bh as TxTable, bi as TxWhere, bj as TxWireExpr, bk as TxWireGuard, bl as TxWireOp, bm as TxWireRef, bn as TxWireValue, bo as Unauthorized, bp as UniqueViolation, bq as UserT, br as VerifiedDevice, bs as dec, bt as defineMiddleware, bu as inc, bv as now } from './endpoint-CcQ1a36a.cjs';
|
|
3
|
+
import { M as ModuleClients } from './index-C84bLgeO.cjs';
|
|
4
|
+
export { C as Cache, D as Database, a as Documents, F as Flags, L as LifecycleHook, b as Log, N as Notifications, R as Realtime, c as RequestStore, d as RuntimeServices, S as Secrets, e as ShutdownRunner, f as Storage, _ as __getRuntime, g as __requestALS, h as __resetLifecycleHooks, i as __runStartHooks, j as __runWithRuntime, k as __setRuntime, o as onShutdown, l as onStart } from './index-C84bLgeO.cjs';
|
|
5
|
+
import { S as SchemaDef } from './index-MoQ31B6M.cjs';
|
|
6
|
+
export { C as ColumnBuilder, a as ColumnDef, b as ColumnMap, c as ColumnType, d as EXTENSION_DEPENDENCIES, e as EmbeddingModelRef, f as EnvServiceDatabase, g as EnvTables, E as EnvTypedDatabase, h as EnvTypedTable, I as InsertShape, O as OnDeleteAction, P as PALBASE_EXTENSIONS, i as PalbaseExtension, j as PolicyBuilder, k as PolicyCommand, l as PolicyDef, m as PolicyMode, R as RawConstraintDef, n as RowShape, o as SchemaInput, T as TableDef, p as TableInput, q as TxPlan, r as TxTables, s as TypedDB, t as TypedTable, u as TypedTx, v as bigint, w as boolean, x as defineSchema, y as enumType, z as integer, A as isPalbaseExtension, B as jsonb, D as makeTypedDB, F as numeric, G as openai, H as policy, J as raw, K as text, L as timestamp, M as uuid, N as vector } from './index-MoQ31B6M.cjs';
|
|
7
7
|
export { TableTypes, Tables } from './db/env.cjs';
|
|
8
8
|
export { PalbaseBucketName, PalbaseFlagKey, PalbaseSecretName } from './stack.cjs';
|
|
9
|
-
import { a as RouteOptions } from './registry-
|
|
10
|
-
export { H as HttpMethodUpper, b as ParamKind, P as ParamMeta, R as RouteMeta, c as Signal, d as Sse, S as SseConfig, e as SseOut, f as SseWriter, T as ThrowDescriptor, g as Upload, U as UploadConfig, h as UploadedObject, i as getRoutes, r as recordThrows } from './registry-
|
|
9
|
+
import { a as RouteOptions } from './registry-1X-skBNu.cjs';
|
|
10
|
+
export { H as HttpMethodUpper, b as ParamKind, P as ParamMeta, R as RouteMeta, c as Signal, d as Sse, S as SseConfig, e as SseOut, f as SseWriter, T as ThrowDescriptor, g as Upload, U as UploadConfig, h as UploadedObject, i as getRoutes, r as recordThrows } from './registry-1X-skBNu.cjs';
|
|
11
11
|
import { ZodTypeAny, z } from 'zod';
|
|
12
12
|
export { z } from 'zod';
|
|
13
13
|
import 'node:async_hooks';
|
|
@@ -417,7 +417,9 @@ declare function makeStackDts(names: StackNames): string;
|
|
|
417
417
|
|
|
418
418
|
/** Options accepted by `@Controller`. */
|
|
419
419
|
interface ControllerOptions {
|
|
420
|
-
/** Default auth for ALL routes in this controller (route-level overrides
|
|
420
|
+
/** Default auth for ALL routes in this controller (route-level overrides;
|
|
421
|
+
* omitting it falls through to the application default declared with
|
|
422
|
+
* {@link defineDefaultAuth}). */
|
|
421
423
|
auth?: AuthSpec;
|
|
422
424
|
}
|
|
423
425
|
/**
|
|
@@ -431,6 +433,27 @@ interface ControllerOptions {
|
|
|
431
433
|
declare function getRegisteredControllers(): readonly unknown[];
|
|
432
434
|
/** Empty the registry. For tests, which load controllers repeatedly. */
|
|
433
435
|
declare function __resetRegisteredControllers(): void;
|
|
436
|
+
/**
|
|
437
|
+
* Declare the default auth for EVERY route in the application — the ring the
|
|
438
|
+
* cascade consults when neither the route nor its controller says anything.
|
|
439
|
+
*
|
|
440
|
+
* The measured problem it removes: `auth: { verifiedEmail: true }` repeated by
|
|
441
|
+
* hand on ten `@Controller`s. A security setting that must be repeated is a
|
|
442
|
+
* security setting that will be forgotten — the eleventh controller opens the
|
|
443
|
+
* door and nothing says so.
|
|
444
|
+
*
|
|
445
|
+
* Call it at MODULE SCOPE in a file the application imports (the controllers'
|
|
446
|
+
* own barrel, or a module a controller imports). The cascade reads this slot
|
|
447
|
+
* when the route table is built and when the spec is emitted — both of which
|
|
448
|
+
* run after module loading — so declaration order does not matter, but being
|
|
449
|
+
* imported at all does.
|
|
450
|
+
*
|
|
451
|
+
* @example
|
|
452
|
+
* defineDefaultAuth({ verifiedEmail: true }); // every route, unless it says otherwise
|
|
453
|
+
*/
|
|
454
|
+
declare function defineDefaultAuth(auth: AuthSpec): void;
|
|
455
|
+
/** Clear the application default. For tests, which declare it repeatedly. */
|
|
456
|
+
declare function __resetDefaultAuth(): void;
|
|
434
457
|
/**
|
|
435
458
|
* Mark a class as a Palbase backend controller. `basePath` is the mount path
|
|
436
459
|
* for every route the class declares; `options.auth` sets the controller-level
|
|
@@ -443,6 +466,19 @@ declare function __resetRegisteredControllers(): void;
|
|
|
443
466
|
* }
|
|
444
467
|
*/
|
|
445
468
|
declare function Controller(basePath: string, options?: ControllerOptions): <T extends abstract new (...args: never[]) => object>(ctor: T) => T;
|
|
469
|
+
/**
|
|
470
|
+
* A class the runtime constructs takes NO constructor parameters.
|
|
471
|
+
*
|
|
472
|
+
* ONE writer, four callers (controller, hook, job, webhook) and the build's own
|
|
473
|
+
* check. Four hand-written copies of this message is how the four come to
|
|
474
|
+
* disagree about what is refused — and the disagreement is silent, because a
|
|
475
|
+
* class that slips past one of them still ends up with `undefined` fields.
|
|
476
|
+
*
|
|
477
|
+
* Why it is refused rather than injected: there is no container. The parameter
|
|
478
|
+
* would arrive `undefined`, the code would compile, deploy, and fail at the
|
|
479
|
+
* first request that touches the field — the most expensive place to learn it.
|
|
480
|
+
*/
|
|
481
|
+
declare function assertZeroArgConstructor(Ctrl: unknown, kind: string): void;
|
|
446
482
|
|
|
447
483
|
/** A legacy method decorator. */
|
|
448
484
|
type MethodDecorator = (target: object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => void;
|
|
@@ -591,7 +627,10 @@ declare function Hook(event: string): (target: object, fnName: string | symbol)
|
|
|
591
627
|
/** Resolves a hook class into the two maps the runtime dispatches from.
|
|
592
628
|
*
|
|
593
629
|
* Every misuse throws HERE, at build time, rather than becoming a hook that is
|
|
594
|
-
* silently never called — the failure mode this whole change exists to end.
|
|
630
|
+
* silently never called — the failure mode this whole change exists to end.
|
|
631
|
+
*
|
|
632
|
+
* @throws when the class declares constructor parameters (FR-011) — nothing
|
|
633
|
+
* here supplies them, so the field would be `undefined` on every event. */
|
|
595
634
|
declare function getHookConfig(ctor: object): ResolvedHookClass;
|
|
596
635
|
|
|
597
636
|
/** A legacy parameter decorator. */
|
|
@@ -731,7 +770,10 @@ declare function Webhook(options: WebhookOptions): <T extends abstract new (...a
|
|
|
731
770
|
declare function On(event: string): (target: object, fnName: string | symbol) => void;
|
|
732
771
|
/** Read a decorated class back as the resolved config the runtime consumes.
|
|
733
772
|
* Every misuse throws HERE, at build time, rather than becoming a webhook that
|
|
734
|
-
* answers 200 and does nothing.
|
|
773
|
+
* answers 200 and does nothing.
|
|
774
|
+
*
|
|
775
|
+
* @throws when the class declares constructor parameters (FR-011) — nothing
|
|
776
|
+
* here supplies them, so the field would be `undefined` on every delivery. */
|
|
735
777
|
declare function getWebhookConfig(ctor: object): ResolvedWebhook;
|
|
736
778
|
|
|
737
779
|
interface JobOptions {
|
|
@@ -759,4 +801,4 @@ interface ResolvedJob {
|
|
|
759
801
|
declare function Job(options: JobOptions): <T extends abstract new (...args: never[]) => object>(ctor: T) => T;
|
|
760
802
|
declare function getJobConfig(ctor: object): ResolvedJob;
|
|
761
803
|
|
|
762
|
-
export { type AuthHookEvent, Body, type ChannelAuthorizeCtx, type ChannelEntry, type ChannelGrant, type ChannelsDef, type ChannelsInput, Client, type ColumnJSON, Controller, type ControllerOptions, type DefinedError, type DefinedErrorWithData, Delete, Deny, type DocumentHookEvent, type FileDeletedEvent, type FileUploadedEvent, Get, Headers, Hook, type HookFn, type HookMeta, HttpError, Job, type JobMeta, type JobOptions, type ModuleClientsConfig, type ModuleTransport, On, OptionalUser, PalbaseModuleError, PalbaseResult, Param, Patch, type PolicyJSON, Post, Put, Query, QueryParams, type RegisteredError, Req, RequestId, type RequestOptions, type ResolvedHookClass, type ResolvedJob, type ResolvedWebhook, RouteOptions, SchemaDef, type SchemaJSON, type SignatureSpec, type StackNames, type TableJSON, TraceId, type TransportConfig, User, Webhook, type WebhookEventHandler, type WebhookMeta, type WebhookOptions, type WebhookProvider, type WebhookRequest, __resetRegisteredControllers, buildModuleClients, defineChannels, defineError, getErrorRegistry, getHookConfig, getJobConfig, getRegisteredControllers, getWebhookConfig, makeEnvDts, makeHttpClient, makeStackDts, ownerOnly, publicChannel, toSchemaJSON };
|
|
804
|
+
export { type AuthHookEvent, Body, type ChannelAuthorizeCtx, type ChannelEntry, type ChannelGrant, type ChannelsDef, type ChannelsInput, Client, type ColumnJSON, Controller, type ControllerOptions, type DefinedError, type DefinedErrorWithData, Delete, Deny, type DocumentHookEvent, type FileDeletedEvent, type FileUploadedEvent, Get, Headers, Hook, type HookFn, type HookMeta, HttpError, Job, type JobMeta, type JobOptions, type ModuleClientsConfig, type ModuleTransport, On, OptionalUser, PalbaseModuleError, PalbaseResult, Param, Patch, type PolicyJSON, Post, Put, Query, QueryParams, type RegisteredError, Req, RequestId, type RequestOptions, type ResolvedHookClass, type ResolvedJob, type ResolvedWebhook, RouteOptions, SchemaDef, type SchemaJSON, type SignatureSpec, type StackNames, type TableJSON, TraceId, type TransportConfig, User, Webhook, type WebhookEventHandler, type WebhookMeta, type WebhookOptions, type WebhookProvider, type WebhookRequest, __resetDefaultAuth, __resetRegisteredControllers, assertZeroArgConstructor, buildModuleClients, defineChannels, defineDefaultAuth, defineError, getErrorRegistry, getHookConfig, getJobConfig, getRegisteredControllers, getWebhookConfig, makeEnvDts, makeHttpClient, makeStackDts, ownerOnly, publicChannel, toSchemaJSON };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { h as PalbaseResult, A as AuthSpec, H as HttpError } from './endpoint-
|
|
2
|
-
export { i as AuthConfig, B as BadRequest, C as CacheClient, j as ClientInfo, k as Conflict, D as DBClient, f as DBOps, E as ErrorDef, l as ErrorMap, m as ErrorThrowers, F as FileContext, n as Forbidden, o as HttpMethod, L as Logger, M as Materialized, p as Middleware, q as MiddlewareContext, r as MiddlewareHandler, N as NotFound, s as PBRequest, t as PalError, u as PalbaseAnalyticsClient, v as PalbaseAnalyticsManagementNamespace, w as PalbaseAnalyticsProperties, x as PalbaseAnalyticsQueryNamespace, y as PalbaseAttestAndroidParams, z as PalbaseAttestAndroidResult, G as PalbaseAttestiOSParams, I as PalbaseAttestiOSResult, J as PalbaseAuthClient, K as PalbaseBatchOverrideOperation, O as PalbaseBatchSetOverridesResult, Q as PalbaseBindDeviceParams, e as PalbaseBucketClient, U as PalbaseClearAllOverridesResult, V as PalbaseClearOverrideResult, W as PalbaseCohortQueryInput, X as PalbaseCohortResult, Y as PalbaseCollectionRef, Z as PalbaseCountQueryInput, _ as PalbaseCountResult, $ as PalbaseCreateLinkParams, a0 as PalbaseDeviceInfo, a1 as PalbaseDeviceTokenView, P as PalbaseDocsClient, a2 as PalbaseDocumentRef, a3 as PalbaseDocumentSnapshot, a4 as PalbaseEmailClient, a5 as PalbaseEmailSendParams, a6 as PalbaseEmailSendResponse, a7 as PalbaseEventNamesResult, a8 as PalbaseEventsQueryInput, a9 as PalbaseEventsResult, aa as PalbaseFileObject, ab as PalbaseFlag, ac as PalbaseFlagContext, ad as PalbaseFlagSource, ae as PalbaseFlagValue, af as PalbaseFlagVariant, a as PalbaseFlagsClient, ag as PalbaseFlagsServiceClient, ah as PalbaseFunctionsClient, ai as PalbaseFunnelQueryInput, aj as PalbaseFunnelResult, ak as PalbaseIdentifyTraits, al as PalbaseInboxClient, am as PalbaseInboxListOptions, an as PalbaseInboxListResult, ao as PalbaseInboxMessage, ap as PalbaseInboxSendParams, aq as PalbaseInboxSendResponse, ar as PalbaseInitialLink, as as PalbaseInvokeOptions, at as PalbaseLink, au as PalbaseLinkAnalytics, av as PalbaseLinkDetails, aw as PalbaseLinksClient, ax as PalbaseListLinksOptions, ay as PalbaseListLinksResult, az as PalbaseListOptions, aA as PalbaseMatchParams, aB as PalbaseMultiChannelResponse, b as PalbaseNotificationsClient, aC as PalbaseOverviewResult, aD as PalbasePreferences, aE as PalbasePreferencesClient, aF as PalbasePushClient, aG as PalbasePushSendParams, aH as PalbasePushSendResponse, aI as PalbaseQrCodeOptions, aJ as PalbaseQuerySnapshot, c as PalbaseRealtimeClient, aK as PalbaseRegisterDeviceParams, aL as PalbaseRetentionQueryInput, aM as PalbaseRetentionResult, aN as PalbaseSession, aO as PalbaseSetOverrideResult, aP as PalbaseSetOverridesResult, aQ as PalbaseSignedUrlResponse, aR as PalbaseSmsClient, aS as PalbaseSmsSendParams, aT as PalbaseSmsSendResponse, d as PalbaseStorageClient, aU as PalbaseTransformOptions, aV as PalbaseUpdateLinkParams, aW as PalbaseUploadOptions, aX as PalbaseUser, aY as PalbaseUserDetailResult, aZ as PalbaseUsersQueryInput, a_ as PalbaseUsersResult, a$ as PalbaseVerifyRequestSignatureParams, b0 as PalbaseWhereOperator, R as RateLimitConfig, b1 as Ref, S as SecretsService, b2 as TooManyRequests, b3 as TxColumnExpr, b4 as TxInsertShape, b5 as TxInsertValue, b6 as TxNow, T as TxPlanBody, b7 as TxPlanError, b8 as TxPlanHandle, b9 as TxPlanOpResult, ba as TxPlanRejection, g as TxPlanResponse, bb as TxRefError, bc as TxRow, bd as TxRows, be as TxSelectOptions, bf as TxSetShape, bg as TxSetValue, bh as TxTable, bi as TxWhere, bj as TxWireExpr, bk as TxWireGuard, bl as TxWireOp, bm as TxWireRef, bn as TxWireValue, bo as Unauthorized, bp as
|
|
3
|
-
import { M as ModuleClients } from './index-
|
|
4
|
-
export { C as Cache, D as Database, a as Documents, F as Flags, L as Log, N as Notifications, R as Realtime,
|
|
5
|
-
import { S as SchemaDef } from './index-
|
|
6
|
-
export { C as ColumnBuilder, a as ColumnDef, b as ColumnMap, c as ColumnType, d as EXTENSION_DEPENDENCIES, e as EmbeddingModelRef, f as EnvServiceDatabase, g as EnvTables, E as EnvTypedDatabase, h as EnvTypedTable, I as InsertShape, O as OnDeleteAction, P as PALBASE_EXTENSIONS, i as PalbaseExtension, j as PolicyBuilder, k as PolicyCommand, l as PolicyDef, m as PolicyMode, R as RawConstraintDef, n as RowShape, o as SchemaInput, T as TableDef, p as TableInput, q as TxPlan, r as TxTables, s as TypedDB, t as TypedTable, u as TypedTx, v as bigint, w as boolean, x as defineSchema, y as enumType, z as integer, A as isPalbaseExtension, B as jsonb, D as makeTypedDB, F as numeric, G as openai, H as policy, J as raw, K as text, L as timestamp, M as uuid, N as vector } from './index-
|
|
1
|
+
import { h as PalbaseResult, A as AuthSpec, H as HttpError } from './endpoint-0_DGBajf.js';
|
|
2
|
+
export { i as AuthConfig, B as BadRequest, C as CacheClient, j as ClientInfo, k as Conflict, D as DBClient, f as DBOps, E as ErrorDef, l as ErrorMap, m as ErrorThrowers, F as FileContext, n as Forbidden, o as HttpMethod, L as Logger, M as Materialized, p as Middleware, q as MiddlewareContext, r as MiddlewareHandler, N as NotFound, s as PBRequest, t as PalError, u as PalbaseAnalyticsClient, v as PalbaseAnalyticsManagementNamespace, w as PalbaseAnalyticsProperties, x as PalbaseAnalyticsQueryNamespace, y as PalbaseAttestAndroidParams, z as PalbaseAttestAndroidResult, G as PalbaseAttestiOSParams, I as PalbaseAttestiOSResult, J as PalbaseAuthClient, K as PalbaseBatchOverrideOperation, O as PalbaseBatchSetOverridesResult, Q as PalbaseBindDeviceParams, e as PalbaseBucketClient, U as PalbaseClearAllOverridesResult, V as PalbaseClearOverrideResult, W as PalbaseCohortQueryInput, X as PalbaseCohortResult, Y as PalbaseCollectionRef, Z as PalbaseCountQueryInput, _ as PalbaseCountResult, $ as PalbaseCreateLinkParams, a0 as PalbaseDeviceInfo, a1 as PalbaseDeviceTokenView, P as PalbaseDocsClient, a2 as PalbaseDocumentRef, a3 as PalbaseDocumentSnapshot, a4 as PalbaseEmailClient, a5 as PalbaseEmailSendParams, a6 as PalbaseEmailSendResponse, a7 as PalbaseEventNamesResult, a8 as PalbaseEventsQueryInput, a9 as PalbaseEventsResult, aa as PalbaseFileObject, ab as PalbaseFlag, ac as PalbaseFlagContext, ad as PalbaseFlagSource, ae as PalbaseFlagValue, af as PalbaseFlagVariant, a as PalbaseFlagsClient, ag as PalbaseFlagsServiceClient, ah as PalbaseFunctionsClient, ai as PalbaseFunnelQueryInput, aj as PalbaseFunnelResult, ak as PalbaseIdentifyTraits, al as PalbaseInboxClient, am as PalbaseInboxListOptions, an as PalbaseInboxListResult, ao as PalbaseInboxMessage, ap as PalbaseInboxSendParams, aq as PalbaseInboxSendResponse, ar as PalbaseInitialLink, as as PalbaseInvokeOptions, at as PalbaseLink, au as PalbaseLinkAnalytics, av as PalbaseLinkDetails, aw as PalbaseLinksClient, ax as PalbaseListLinksOptions, ay as PalbaseListLinksResult, az as PalbaseListOptions, aA as PalbaseMatchParams, aB as PalbaseMultiChannelResponse, b as PalbaseNotificationsClient, aC as PalbaseOverviewResult, aD as PalbasePreferences, aE as PalbasePreferencesClient, aF as PalbasePushClient, aG as PalbasePushSendParams, aH as PalbasePushSendResponse, aI as PalbaseQrCodeOptions, aJ as PalbaseQuerySnapshot, c as PalbaseRealtimeClient, aK as PalbaseRegisterDeviceParams, aL as PalbaseRetentionQueryInput, aM as PalbaseRetentionResult, aN as PalbaseSession, aO as PalbaseSetOverrideResult, aP as PalbaseSetOverridesResult, aQ as PalbaseSignedUrlResponse, aR as PalbaseSmsClient, aS as PalbaseSmsSendParams, aT as PalbaseSmsSendResponse, d as PalbaseStorageClient, aU as PalbaseTransformOptions, aV as PalbaseUpdateLinkParams, aW as PalbaseUploadOptions, aX as PalbaseUser, aY as PalbaseUserDetailResult, aZ as PalbaseUsersQueryInput, a_ as PalbaseUsersResult, a$ as PalbaseVerifyRequestSignatureParams, b0 as PalbaseWhereOperator, R as RateLimitConfig, b1 as Ref, S as SecretsService, b2 as TooManyRequests, b3 as TxColumnExpr, b4 as TxInsertShape, b5 as TxInsertValue, b6 as TxNow, T as TxPlanBody, b7 as TxPlanError, b8 as TxPlanHandle, b9 as TxPlanOpResult, ba as TxPlanRejection, g as TxPlanResponse, bb as TxRefError, bc as TxRow, bd as TxRows, be as TxSelectOptions, bf as TxSetShape, bg as TxSetValue, bh as TxTable, bi as TxWhere, bj as TxWireExpr, bk as TxWireGuard, bl as TxWireOp, bm as TxWireRef, bn as TxWireValue, bo as Unauthorized, bp as UniqueViolation, bq as UserT, br as VerifiedDevice, bs as dec, bt as defineMiddleware, bu as inc, bv as now } from './endpoint-0_DGBajf.js';
|
|
3
|
+
import { M as ModuleClients } from './index-dJNhDZ7j.js';
|
|
4
|
+
export { C as Cache, D as Database, a as Documents, F as Flags, L as LifecycleHook, b as Log, N as Notifications, R as Realtime, c as RequestStore, d as RuntimeServices, S as Secrets, e as ShutdownRunner, f as Storage, _ as __getRuntime, g as __requestALS, h as __resetLifecycleHooks, i as __runStartHooks, j as __runWithRuntime, k as __setRuntime, o as onShutdown, l as onStart } from './index-dJNhDZ7j.js';
|
|
5
|
+
import { S as SchemaDef } from './index-BOS_rFBO.js';
|
|
6
|
+
export { C as ColumnBuilder, a as ColumnDef, b as ColumnMap, c as ColumnType, d as EXTENSION_DEPENDENCIES, e as EmbeddingModelRef, f as EnvServiceDatabase, g as EnvTables, E as EnvTypedDatabase, h as EnvTypedTable, I as InsertShape, O as OnDeleteAction, P as PALBASE_EXTENSIONS, i as PalbaseExtension, j as PolicyBuilder, k as PolicyCommand, l as PolicyDef, m as PolicyMode, R as RawConstraintDef, n as RowShape, o as SchemaInput, T as TableDef, p as TableInput, q as TxPlan, r as TxTables, s as TypedDB, t as TypedTable, u as TypedTx, v as bigint, w as boolean, x as defineSchema, y as enumType, z as integer, A as isPalbaseExtension, B as jsonb, D as makeTypedDB, F as numeric, G as openai, H as policy, J as raw, K as text, L as timestamp, M as uuid, N as vector } from './index-BOS_rFBO.js';
|
|
7
7
|
export { TableTypes, Tables } from './db/env.js';
|
|
8
8
|
export { PalbaseBucketName, PalbaseFlagKey, PalbaseSecretName } from './stack.js';
|
|
9
|
-
import { a as RouteOptions } from './registry-
|
|
10
|
-
export { H as HttpMethodUpper, b as ParamKind, P as ParamMeta, R as RouteMeta, c as Signal, d as Sse, S as SseConfig, e as SseOut, f as SseWriter, T as ThrowDescriptor, g as Upload, U as UploadConfig, h as UploadedObject, i as getRoutes, r as recordThrows } from './registry-
|
|
9
|
+
import { a as RouteOptions } from './registry-CEod_5sz.js';
|
|
10
|
+
export { H as HttpMethodUpper, b as ParamKind, P as ParamMeta, R as RouteMeta, c as Signal, d as Sse, S as SseConfig, e as SseOut, f as SseWriter, T as ThrowDescriptor, g as Upload, U as UploadConfig, h as UploadedObject, i as getRoutes, r as recordThrows } from './registry-CEod_5sz.js';
|
|
11
11
|
import { ZodTypeAny, z } from 'zod';
|
|
12
12
|
export { z } from 'zod';
|
|
13
13
|
import 'node:async_hooks';
|
|
@@ -417,7 +417,9 @@ declare function makeStackDts(names: StackNames): string;
|
|
|
417
417
|
|
|
418
418
|
/** Options accepted by `@Controller`. */
|
|
419
419
|
interface ControllerOptions {
|
|
420
|
-
/** Default auth for ALL routes in this controller (route-level overrides
|
|
420
|
+
/** Default auth for ALL routes in this controller (route-level overrides;
|
|
421
|
+
* omitting it falls through to the application default declared with
|
|
422
|
+
* {@link defineDefaultAuth}). */
|
|
421
423
|
auth?: AuthSpec;
|
|
422
424
|
}
|
|
423
425
|
/**
|
|
@@ -431,6 +433,27 @@ interface ControllerOptions {
|
|
|
431
433
|
declare function getRegisteredControllers(): readonly unknown[];
|
|
432
434
|
/** Empty the registry. For tests, which load controllers repeatedly. */
|
|
433
435
|
declare function __resetRegisteredControllers(): void;
|
|
436
|
+
/**
|
|
437
|
+
* Declare the default auth for EVERY route in the application — the ring the
|
|
438
|
+
* cascade consults when neither the route nor its controller says anything.
|
|
439
|
+
*
|
|
440
|
+
* The measured problem it removes: `auth: { verifiedEmail: true }` repeated by
|
|
441
|
+
* hand on ten `@Controller`s. A security setting that must be repeated is a
|
|
442
|
+
* security setting that will be forgotten — the eleventh controller opens the
|
|
443
|
+
* door and nothing says so.
|
|
444
|
+
*
|
|
445
|
+
* Call it at MODULE SCOPE in a file the application imports (the controllers'
|
|
446
|
+
* own barrel, or a module a controller imports). The cascade reads this slot
|
|
447
|
+
* when the route table is built and when the spec is emitted — both of which
|
|
448
|
+
* run after module loading — so declaration order does not matter, but being
|
|
449
|
+
* imported at all does.
|
|
450
|
+
*
|
|
451
|
+
* @example
|
|
452
|
+
* defineDefaultAuth({ verifiedEmail: true }); // every route, unless it says otherwise
|
|
453
|
+
*/
|
|
454
|
+
declare function defineDefaultAuth(auth: AuthSpec): void;
|
|
455
|
+
/** Clear the application default. For tests, which declare it repeatedly. */
|
|
456
|
+
declare function __resetDefaultAuth(): void;
|
|
434
457
|
/**
|
|
435
458
|
* Mark a class as a Palbase backend controller. `basePath` is the mount path
|
|
436
459
|
* for every route the class declares; `options.auth` sets the controller-level
|
|
@@ -443,6 +466,19 @@ declare function __resetRegisteredControllers(): void;
|
|
|
443
466
|
* }
|
|
444
467
|
*/
|
|
445
468
|
declare function Controller(basePath: string, options?: ControllerOptions): <T extends abstract new (...args: never[]) => object>(ctor: T) => T;
|
|
469
|
+
/**
|
|
470
|
+
* A class the runtime constructs takes NO constructor parameters.
|
|
471
|
+
*
|
|
472
|
+
* ONE writer, four callers (controller, hook, job, webhook) and the build's own
|
|
473
|
+
* check. Four hand-written copies of this message is how the four come to
|
|
474
|
+
* disagree about what is refused — and the disagreement is silent, because a
|
|
475
|
+
* class that slips past one of them still ends up with `undefined` fields.
|
|
476
|
+
*
|
|
477
|
+
* Why it is refused rather than injected: there is no container. The parameter
|
|
478
|
+
* would arrive `undefined`, the code would compile, deploy, and fail at the
|
|
479
|
+
* first request that touches the field — the most expensive place to learn it.
|
|
480
|
+
*/
|
|
481
|
+
declare function assertZeroArgConstructor(Ctrl: unknown, kind: string): void;
|
|
446
482
|
|
|
447
483
|
/** A legacy method decorator. */
|
|
448
484
|
type MethodDecorator = (target: object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => void;
|
|
@@ -591,7 +627,10 @@ declare function Hook(event: string): (target: object, fnName: string | symbol)
|
|
|
591
627
|
/** Resolves a hook class into the two maps the runtime dispatches from.
|
|
592
628
|
*
|
|
593
629
|
* Every misuse throws HERE, at build time, rather than becoming a hook that is
|
|
594
|
-
* silently never called — the failure mode this whole change exists to end.
|
|
630
|
+
* silently never called — the failure mode this whole change exists to end.
|
|
631
|
+
*
|
|
632
|
+
* @throws when the class declares constructor parameters (FR-011) — nothing
|
|
633
|
+
* here supplies them, so the field would be `undefined` on every event. */
|
|
595
634
|
declare function getHookConfig(ctor: object): ResolvedHookClass;
|
|
596
635
|
|
|
597
636
|
/** A legacy parameter decorator. */
|
|
@@ -731,7 +770,10 @@ declare function Webhook(options: WebhookOptions): <T extends abstract new (...a
|
|
|
731
770
|
declare function On(event: string): (target: object, fnName: string | symbol) => void;
|
|
732
771
|
/** Read a decorated class back as the resolved config the runtime consumes.
|
|
733
772
|
* Every misuse throws HERE, at build time, rather than becoming a webhook that
|
|
734
|
-
* answers 200 and does nothing.
|
|
773
|
+
* answers 200 and does nothing.
|
|
774
|
+
*
|
|
775
|
+
* @throws when the class declares constructor parameters (FR-011) — nothing
|
|
776
|
+
* here supplies them, so the field would be `undefined` on every delivery. */
|
|
735
777
|
declare function getWebhookConfig(ctor: object): ResolvedWebhook;
|
|
736
778
|
|
|
737
779
|
interface JobOptions {
|
|
@@ -759,4 +801,4 @@ interface ResolvedJob {
|
|
|
759
801
|
declare function Job(options: JobOptions): <T extends abstract new (...args: never[]) => object>(ctor: T) => T;
|
|
760
802
|
declare function getJobConfig(ctor: object): ResolvedJob;
|
|
761
803
|
|
|
762
|
-
export { type AuthHookEvent, Body, type ChannelAuthorizeCtx, type ChannelEntry, type ChannelGrant, type ChannelsDef, type ChannelsInput, Client, type ColumnJSON, Controller, type ControllerOptions, type DefinedError, type DefinedErrorWithData, Delete, Deny, type DocumentHookEvent, type FileDeletedEvent, type FileUploadedEvent, Get, Headers, Hook, type HookFn, type HookMeta, HttpError, Job, type JobMeta, type JobOptions, type ModuleClientsConfig, type ModuleTransport, On, OptionalUser, PalbaseModuleError, PalbaseResult, Param, Patch, type PolicyJSON, Post, Put, Query, QueryParams, type RegisteredError, Req, RequestId, type RequestOptions, type ResolvedHookClass, type ResolvedJob, type ResolvedWebhook, RouteOptions, SchemaDef, type SchemaJSON, type SignatureSpec, type StackNames, type TableJSON, TraceId, type TransportConfig, User, Webhook, type WebhookEventHandler, type WebhookMeta, type WebhookOptions, type WebhookProvider, type WebhookRequest, __resetRegisteredControllers, buildModuleClients, defineChannels, defineError, getErrorRegistry, getHookConfig, getJobConfig, getRegisteredControllers, getWebhookConfig, makeEnvDts, makeHttpClient, makeStackDts, ownerOnly, publicChannel, toSchemaJSON };
|
|
804
|
+
export { type AuthHookEvent, Body, type ChannelAuthorizeCtx, type ChannelEntry, type ChannelGrant, type ChannelsDef, type ChannelsInput, Client, type ColumnJSON, Controller, type ControllerOptions, type DefinedError, type DefinedErrorWithData, Delete, Deny, type DocumentHookEvent, type FileDeletedEvent, type FileUploadedEvent, Get, Headers, Hook, type HookFn, type HookMeta, HttpError, Job, type JobMeta, type JobOptions, type ModuleClientsConfig, type ModuleTransport, On, OptionalUser, PalbaseModuleError, PalbaseResult, Param, Patch, type PolicyJSON, Post, Put, Query, QueryParams, type RegisteredError, Req, RequestId, type RequestOptions, type ResolvedHookClass, type ResolvedJob, type ResolvedWebhook, RouteOptions, SchemaDef, type SchemaJSON, type SignatureSpec, type StackNames, type TableJSON, TraceId, type TransportConfig, User, Webhook, type WebhookEventHandler, type WebhookMeta, type WebhookOptions, type WebhookProvider, type WebhookRequest, __resetDefaultAuth, __resetRegisteredControllers, assertZeroArgConstructor, buildModuleClients, defineChannels, defineDefaultAuth, defineError, getErrorRegistry, getHookConfig, getJobConfig, getRegisteredControllers, getWebhookConfig, makeEnvDts, makeHttpClient, makeStackDts, ownerOnly, publicChannel, toSchemaJSON };
|
package/dist/index.js
CHANGED
|
@@ -18,11 +18,11 @@ import {
|
|
|
18
18
|
timestamp,
|
|
19
19
|
uuid,
|
|
20
20
|
vector
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-LCL7TUAI.js";
|
|
22
22
|
import {
|
|
23
23
|
defineError,
|
|
24
24
|
getErrorRegistry
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-T5IOSOE5.js";
|
|
26
26
|
import {
|
|
27
27
|
Cache,
|
|
28
28
|
Database,
|
|
@@ -35,35 +35,41 @@ import {
|
|
|
35
35
|
Storage,
|
|
36
36
|
__getRuntime,
|
|
37
37
|
__requestALS,
|
|
38
|
+
__resetLifecycleHooks,
|
|
39
|
+
__runStartHooks,
|
|
38
40
|
__runWithRuntime,
|
|
39
|
-
__setRuntime
|
|
40
|
-
|
|
41
|
+
__setRuntime,
|
|
42
|
+
onShutdown,
|
|
43
|
+
onStart
|
|
44
|
+
} from "./chunk-7Z6MGMXQ.js";
|
|
41
45
|
import {
|
|
42
46
|
TxPlanError,
|
|
43
47
|
TxRefError,
|
|
44
48
|
dec,
|
|
45
49
|
inc,
|
|
46
50
|
now
|
|
47
|
-
} from "./chunk-
|
|
48
|
-
import {
|
|
49
|
-
Controller,
|
|
50
|
-
__resetRegisteredControllers,
|
|
51
|
-
getRegisteredControllers
|
|
52
|
-
} from "./chunk-HQRJDARQ.js";
|
|
51
|
+
} from "./chunk-P2Q27SGP.js";
|
|
53
52
|
import {
|
|
54
53
|
BadRequest,
|
|
55
54
|
Conflict,
|
|
55
|
+
Controller,
|
|
56
56
|
Forbidden,
|
|
57
57
|
HttpError,
|
|
58
58
|
NotFound,
|
|
59
59
|
PalError,
|
|
60
60
|
TooManyRequests,
|
|
61
61
|
Unauthorized,
|
|
62
|
+
UniqueViolation,
|
|
63
|
+
__resetDefaultAuth,
|
|
64
|
+
__resetRegisteredControllers,
|
|
65
|
+
assertZeroArgConstructor,
|
|
66
|
+
defineDefaultAuth,
|
|
67
|
+
getRegisteredControllers,
|
|
62
68
|
getRoutes,
|
|
63
69
|
recordParam,
|
|
64
70
|
recordRoute,
|
|
65
71
|
recordThrows
|
|
66
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-H3JAISUY.js";
|
|
67
73
|
import "./chunk-7D4SUZUM.js";
|
|
68
74
|
|
|
69
75
|
// src/clients/http.ts
|
|
@@ -1442,6 +1448,7 @@ function getWebhookConfig(ctor) {
|
|
|
1442
1448
|
if (entries.length === 0) {
|
|
1443
1449
|
throw new Error("@Webhook requires at least one @On handler");
|
|
1444
1450
|
}
|
|
1451
|
+
assertZeroArgConstructor(ctor, "webhook class");
|
|
1445
1452
|
const instance = new ctor();
|
|
1446
1453
|
const events = /* @__PURE__ */ Object.create(null);
|
|
1447
1454
|
for (const entry of entries) {
|
|
@@ -1503,6 +1510,7 @@ function getHookConfig(ctor) {
|
|
|
1503
1510
|
`${ctor.name ?? "a hook class"} carries no handler \u2014 a hook file must declare at least one @Hook (blocking) or @On (listener) method`
|
|
1504
1511
|
);
|
|
1505
1512
|
}
|
|
1513
|
+
assertZeroArgConstructor(ctor, "hook class");
|
|
1506
1514
|
const instance = new ctor();
|
|
1507
1515
|
return {
|
|
1508
1516
|
blocking: bind(instance, blockingEntries, "@Hook"),
|
|
@@ -1733,6 +1741,7 @@ function getJobConfig(ctor) {
|
|
|
1733
1741
|
if (retry > MAX_RETRY) {
|
|
1734
1742
|
throw new Error(`@Job \`retry\` exceeds the ceiling of ${MAX_RETRY}`);
|
|
1735
1743
|
}
|
|
1744
|
+
assertZeroArgConstructor(ctor, "job class");
|
|
1736
1745
|
const instance = new ctor();
|
|
1737
1746
|
if (typeof instance.run !== "function") {
|
|
1738
1747
|
throw new Error("@Job class must declare an async run() method");
|
|
@@ -1790,20 +1799,26 @@ export {
|
|
|
1790
1799
|
TxPlanError,
|
|
1791
1800
|
TxRefError,
|
|
1792
1801
|
Unauthorized,
|
|
1802
|
+
UniqueViolation,
|
|
1793
1803
|
Upload,
|
|
1794
1804
|
UploadedObject,
|
|
1795
1805
|
User,
|
|
1796
1806
|
Webhook,
|
|
1797
1807
|
__getRuntime,
|
|
1798
1808
|
__requestALS,
|
|
1809
|
+
__resetDefaultAuth,
|
|
1810
|
+
__resetLifecycleHooks,
|
|
1799
1811
|
__resetRegisteredControllers,
|
|
1812
|
+
__runStartHooks,
|
|
1800
1813
|
__runWithRuntime,
|
|
1801
1814
|
__setRuntime,
|
|
1815
|
+
assertZeroArgConstructor,
|
|
1802
1816
|
bigint,
|
|
1803
1817
|
boolean,
|
|
1804
1818
|
buildModuleClients,
|
|
1805
1819
|
dec,
|
|
1806
1820
|
defineChannels,
|
|
1821
|
+
defineDefaultAuth,
|
|
1807
1822
|
defineError,
|
|
1808
1823
|
defineMiddleware,
|
|
1809
1824
|
defineSchema,
|
|
@@ -1824,6 +1839,8 @@ export {
|
|
|
1824
1839
|
makeTypedDB,
|
|
1825
1840
|
now,
|
|
1826
1841
|
numeric,
|
|
1842
|
+
onShutdown,
|
|
1843
|
+
onStart,
|
|
1827
1844
|
openai,
|
|
1828
1845
|
ownerOnly,
|
|
1829
1846
|
policy,
|