@palbase/backend 18.0.0 → 20.0.0
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 +36 -17
- package/dist/bin/palbase-backend.cjs.map +1 -1
- package/dist/bin/palbase-backend.js +1 -1
- package/dist/{chunk-VYH4U7ZQ.js → chunk-PFQJYW6C.js} +37 -18
- package/dist/chunk-PFQJYW6C.js.map +1 -0
- package/dist/engine/index.cjs +36 -17
- package/dist/engine/index.cjs.map +1 -1
- package/dist/engine/index.d.cts +1 -1
- package/dist/engine/index.d.ts +1 -1
- package/dist/engine/index.js +1 -1
- package/dist/{index-DZDUMth5.d.ts → index-BeHLq2i-.d.ts} +5 -0
- package/dist/{index-B46CGNvx.d.cts → index-Br9P7yRu.d.cts} +5 -0
- package/dist/index.cjs +189 -129
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +190 -121
- package/dist/index.d.ts +190 -121
- package/dist/index.js +178 -121
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/template/package.json +1 -1
- package/dist/chunk-VYH4U7ZQ.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { g as PalbaseResult, A as AuthSpec, H as HttpError } from './endpoint-B0LpZixz.js';
|
|
2
2
|
export { h as AuthConfig, B as BadRequest, C as CacheClient, i as ClientInfo, j as Conflict, D as DBClient, k 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, f 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 UserT, bq as VerifiedDevice, br as dec, bs as defineMiddleware, bt as inc, bu as now } from './endpoint-B0LpZixz.js';
|
|
3
|
-
import { M as ModuleClients } from './index-
|
|
4
|
-
export { C as Cache, D as Database, a as Documents, F as Flags, L as LimitState, b as Log, N as Notifications, P as Purchases, c as PurchasesService, R as Realtime, d as RequestStore, e as RuntimeServices, S as Secrets, f as SpendOptions, g as Storage, h as StoreEnv, _ as __getRuntime, i as __requestALS, j as __runWithRuntime, k as __setRuntime } from './index-
|
|
3
|
+
import { M as ModuleClients } from './index-BeHLq2i-.js';
|
|
4
|
+
export { C as Cache, D as Database, a as Documents, F as Flags, L as LimitState, b as Log, N as Notifications, P as Purchases, c as PurchasesService, R as Realtime, d as RequestStore, e as RuntimeServices, S as Secrets, f as SpendOptions, g as Storage, h as StoreEnv, _ as __getRuntime, i as __requestALS, j as __runWithRuntime, k as __setRuntime } from './index-BeHLq2i-.js';
|
|
5
5
|
import { EntitlementKey, LimitKey } from './purchases/keys.js';
|
|
6
6
|
import { S as SchemaDef } from './index-g-EzitI-.js';
|
|
7
7
|
export { C as ColumnBuilder, a as ColumnDef, b as ColumnMap, c as ColumnType, d as EXTENSION_DEPENDENCIES, e as EnvServiceDatabase, f as EnvTables, E as EnvTypedDatabase, g as EnvTypedTable, I as InsertShape, O as OnDeleteAction, P as PALBASE_EXTENSIONS, h as PalbaseExtension, i as PolicyBuilder, j as PolicyCommand, k as PolicyDef, l as PolicyMode, R as RawConstraintDef, m as RowShape, n as SchemaInput, T as TableDef, o as TableInput, p as TxPlan, q as TxTables, r as TypedDB, s as TypedTable, t as TypedTx, u as bigint, v as boolean, w as defineSchema, x as enumType, y as integer, z as isPalbaseExtension, A as jsonb, B as makeTypedDB, D as numeric, F as policy, G as raw, H as text, J as timestamp, K as uuid } from './index-g-EzitI-.js';
|
|
@@ -299,7 +299,7 @@ declare function toSchemaJSON(schema: SchemaDef): SchemaJSON;
|
|
|
299
299
|
* env-gen.ts — generate the `palbase-env.d.ts` text from a `defineSchema()`
|
|
300
300
|
* result.
|
|
301
301
|
*
|
|
302
|
-
* The CLI (`palbase
|
|
302
|
+
* The CLI (`palbase build`) and the deploy pipeline call
|
|
303
303
|
* {@link makeEnvDts} with the project's schema and write the returned string to
|
|
304
304
|
* `palbase-env.d.ts` at the project root. That file AUGMENTS the
|
|
305
305
|
* `@palbase/backend/env` `Tables` interface (controlled global augmentation,
|
|
@@ -1293,6 +1293,181 @@ declare const Delete: (subpath: string, options?: RouteOptions) => MethodDecorat
|
|
|
1293
1293
|
* safe + idempotent like GET, body-carrying like POST. Input rides `@Body`. */
|
|
1294
1294
|
declare const Query: (subpath: string, options?: RouteOptions) => MethodDecorator;
|
|
1295
1295
|
|
|
1296
|
+
/**
|
|
1297
|
+
* The payloads a hook handler receives, and nothing else.
|
|
1298
|
+
*
|
|
1299
|
+
* There is ONE way to declare a hook: `@Hook` (blocking) or `@On` (listener) on
|
|
1300
|
+
* a method of a default-exported class in `hooks/*.ts`. The bundler discovers
|
|
1301
|
+
* those, the deploy registers the events, and the stack calls them.
|
|
1302
|
+
*
|
|
1303
|
+
* This file used to also export `auth`, `storage` and `documents` helper
|
|
1304
|
+
* objects — `storage.onFileUploaded(handler)` and friends — which returned a
|
|
1305
|
+
* tidy `{module, event, handler}` record. Nothing in the runtime or the bundler
|
|
1306
|
+
* ever read that record (measured 2026-08-22: `grep -rn "ResolvedHook"` across
|
|
1307
|
+
* the runtime returned nothing). A project that wrote one got a handler that was
|
|
1308
|
+
* never called, and no error said so. They are gone, so that upgrading turns
|
|
1309
|
+
* that silence into a build failure.
|
|
1310
|
+
*
|
|
1311
|
+
* The event types they carried are gone with them, because they were wrong in
|
|
1312
|
+
* the same silent way: `UserCreatedEvent` promised `user.role`, `user.metadata`
|
|
1313
|
+
* and `user.createdAt`, and the auth engine sends none of the three. What is
|
|
1314
|
+
* here now is the wire, each type citing the struct it mirrors.
|
|
1315
|
+
*/
|
|
1316
|
+
/**
|
|
1317
|
+
* Per-invocation data for hook handlers.
|
|
1318
|
+
*
|
|
1319
|
+
* Services (Database, Log, …) are imported as singletons, not passed here.
|
|
1320
|
+
*
|
|
1321
|
+
* Mirrors `hookMeta()` in the runtime (v2/runtime/src/server.ts). `requestId`
|
|
1322
|
+
* was on the wire long before it was in this type, which made `meta.requestId`
|
|
1323
|
+
* in a handler an error the compiler should have caught and did not.
|
|
1324
|
+
*/
|
|
1325
|
+
interface HookMeta {
|
|
1326
|
+
/** Environment-scoped env vars, including every secret in your vault. */
|
|
1327
|
+
env: Record<string, string>;
|
|
1328
|
+
/** The globally unique Environment runtime identifier. */
|
|
1329
|
+
environmentId: string;
|
|
1330
|
+
/** Correlation id, so one signup's gate can be found in the log. */
|
|
1331
|
+
requestId: string;
|
|
1332
|
+
}
|
|
1333
|
+
/**
|
|
1334
|
+
* What an auth hook receives — `before.*` and `after.*` alike.
|
|
1335
|
+
*
|
|
1336
|
+
* Mirrors `hook.Payload` (internal/modules/auth/internal/hook/engine.go:183),
|
|
1337
|
+
* `hook.UserInfo` (:160) and `hook.ContextInfo` (:176). Everything but `event`
|
|
1338
|
+
* is `omitempty` on the Go side and therefore optional here: a `before.login`
|
|
1339
|
+
* for an unknown address really does arrive carrying only the event name.
|
|
1340
|
+
*/
|
|
1341
|
+
interface AuthHookEvent {
|
|
1342
|
+
/** The event this handler is registered for, e.g. `before.user.create`. */
|
|
1343
|
+
event: string;
|
|
1344
|
+
user?: {
|
|
1345
|
+
id: string;
|
|
1346
|
+
/** Absent for phone-only users, who never had one. */
|
|
1347
|
+
email?: string;
|
|
1348
|
+
email_verified?: boolean;
|
|
1349
|
+
};
|
|
1350
|
+
context?: {
|
|
1351
|
+
ip?: string;
|
|
1352
|
+
user_agent?: string;
|
|
1353
|
+
risk_score?: number;
|
|
1354
|
+
};
|
|
1355
|
+
client_metadata?: Record<string, unknown>;
|
|
1356
|
+
}
|
|
1357
|
+
/**
|
|
1358
|
+
* What a document listener receives.
|
|
1359
|
+
*
|
|
1360
|
+
* Mirrors `model.WebhookPayload`
|
|
1361
|
+
* (internal/modules/documents/internal/model/webhook.go:52). The field is
|
|
1362
|
+
* `documentId`, camelCase, because that is the JSON tag — `document_id` is the
|
|
1363
|
+
* guess that made this project's own verification fixture log `id=unknown` for
|
|
1364
|
+
* every document it ever saw.
|
|
1365
|
+
*
|
|
1366
|
+
* `event` is the name you registered for (`document.created`), not the database
|
|
1367
|
+
* trigger's word: the runtime resolves it before your handler is found, and
|
|
1368
|
+
* normalises the payload to match.
|
|
1369
|
+
*/
|
|
1370
|
+
interface DocumentHookEvent {
|
|
1371
|
+
event: string;
|
|
1372
|
+
collection: string;
|
|
1373
|
+
documentId: string;
|
|
1374
|
+
path: string;
|
|
1375
|
+
version: number;
|
|
1376
|
+
/** The document itself. Absent on a delete. */
|
|
1377
|
+
data?: Record<string, unknown>;
|
|
1378
|
+
timestamp: string;
|
|
1379
|
+
}
|
|
1380
|
+
/**
|
|
1381
|
+
* What `@On("file.uploaded")` receives.
|
|
1382
|
+
*
|
|
1383
|
+
* Mirrors the emit call in
|
|
1384
|
+
* internal/modules/storage/internal/handler/handler.go, which fires AFTER the
|
|
1385
|
+
* object is stored. To refuse an upload, use `@Upload` — this one cannot.
|
|
1386
|
+
*/
|
|
1387
|
+
interface FileUploadedEvent {
|
|
1388
|
+
bucket: string;
|
|
1389
|
+
path: string;
|
|
1390
|
+
size: number;
|
|
1391
|
+
contentType: string;
|
|
1392
|
+
}
|
|
1393
|
+
/**
|
|
1394
|
+
* What `@On("file.deleted")` receives.
|
|
1395
|
+
*
|
|
1396
|
+
* No size and no content type: the object is gone by the time this fires, and a
|
|
1397
|
+
* type that offered them would be inviting a read of something that is not
|
|
1398
|
+
* there.
|
|
1399
|
+
*/
|
|
1400
|
+
interface FileDeletedEvent {
|
|
1401
|
+
bucket: string;
|
|
1402
|
+
path: string;
|
|
1403
|
+
}
|
|
1404
|
+
/** The record the removed helpers returned. Nothing ever read it.
|
|
1405
|
+
* @deprecated Declare hooks with `@Hook` / `@On` in `hooks/*.ts`. Removed in the next major. */
|
|
1406
|
+
interface ResolvedHook<TEvent = unknown> {
|
|
1407
|
+
module: string;
|
|
1408
|
+
event: string;
|
|
1409
|
+
handler: (event: TEvent, meta: HookMeta) => Promise<void>;
|
|
1410
|
+
}
|
|
1411
|
+
/** @deprecated Declare hooks with `@Hook` / `@On` in `hooks/*.ts`. Removed in the next major. */
|
|
1412
|
+
type HookHandler<TEvent> = (event: TEvent, meta: HookMeta) => Promise<void>;
|
|
1413
|
+
/** @deprecated Use {@link AuthHookEvent} — this shape was never on the wire. */
|
|
1414
|
+
type UserCreatedEvent = AuthHookEvent;
|
|
1415
|
+
/** @deprecated Use {@link AuthHookEvent} — this shape was never on the wire. */
|
|
1416
|
+
type SignInEvent = AuthHookEvent;
|
|
1417
|
+
/** @deprecated Use {@link AuthHookEvent} — this shape was never on the wire. */
|
|
1418
|
+
type SignOutEvent = AuthHookEvent;
|
|
1419
|
+
/** @deprecated Use {@link AuthHookEvent} — this shape was never on the wire. */
|
|
1420
|
+
type PasswordResetEvent = AuthHookEvent;
|
|
1421
|
+
/** @deprecated Use {@link DocumentHookEvent} — this shape was never on the wire. */
|
|
1422
|
+
type DocumentCreatedEvent = DocumentHookEvent;
|
|
1423
|
+
/** @deprecated Use {@link DocumentHookEvent} — this shape was never on the wire. */
|
|
1424
|
+
type DocumentUpdatedEvent = DocumentHookEvent;
|
|
1425
|
+
/** @deprecated Use {@link DocumentHookEvent} — this shape was never on the wire. */
|
|
1426
|
+
type DocumentDeletedEvent = DocumentHookEvent;
|
|
1427
|
+
/** @deprecated Declare auth hooks with `@Hook("before.…")` or `@On("after.…")` in `hooks/*.ts`. */
|
|
1428
|
+
declare const auth: {
|
|
1429
|
+
onUserCreated: (_h: HookHandler<AuthHookEvent>) => ResolvedHook<AuthHookEvent>;
|
|
1430
|
+
onSignIn: (_h: HookHandler<AuthHookEvent>) => ResolvedHook<AuthHookEvent>;
|
|
1431
|
+
onSignOut: (_h: HookHandler<AuthHookEvent>) => ResolvedHook<AuthHookEvent>;
|
|
1432
|
+
onPasswordReset: (_h: HookHandler<AuthHookEvent>) => ResolvedHook<AuthHookEvent>;
|
|
1433
|
+
};
|
|
1434
|
+
/** @deprecated Declare file hooks with `@On("file.uploaded")` / `@On("file.deleted")` in `hooks/*.ts`. */
|
|
1435
|
+
declare const storage: {
|
|
1436
|
+
onFileUploaded: (_h: HookHandler<FileUploadedEvent>) => ResolvedHook<FileUploadedEvent>;
|
|
1437
|
+
onFileDeleted: (_h: HookHandler<FileDeletedEvent>) => ResolvedHook<FileDeletedEvent>;
|
|
1438
|
+
};
|
|
1439
|
+
/** @deprecated Declare document hooks with `@On("document.…")` in `hooks/*.ts`. */
|
|
1440
|
+
declare const documents: {
|
|
1441
|
+
onDocumentCreated: (_h: HookHandler<DocumentHookEvent>) => ResolvedHook<DocumentHookEvent>;
|
|
1442
|
+
onDocumentUpdated: (_h: HookHandler<DocumentHookEvent>) => ResolvedHook<DocumentHookEvent>;
|
|
1443
|
+
onDocumentDeleted: (_h: HookHandler<DocumentHookEvent>) => ResolvedHook<DocumentHookEvent>;
|
|
1444
|
+
};
|
|
1445
|
+
|
|
1446
|
+
/** A hook handler. Returning quietly ALLOWS; throwing DENIES (blocking hooks). */
|
|
1447
|
+
type HookFn = (event: unknown, meta: HookMeta) => Promise<unknown>;
|
|
1448
|
+
interface ResolvedHookClass {
|
|
1449
|
+
/** `@Hook` handlers, by event. A throw here cancels the operation. */
|
|
1450
|
+
blocking: Record<string, HookFn>;
|
|
1451
|
+
/** `@On` handlers, by event. A throw here reaches nobody but the log. */
|
|
1452
|
+
listeners: Record<string, HookFn>;
|
|
1453
|
+
}
|
|
1454
|
+
/** A hook's refusal, with the reason the caller will see.
|
|
1455
|
+
*
|
|
1456
|
+
* Any thrown error denies — this class exists so the REASON travels as a
|
|
1457
|
+
* deliberate message rather than as whatever a stray TypeError happened to say.
|
|
1458
|
+
* The engine is fail-closed by design (an unreachable hook denies), so a hook
|
|
1459
|
+
* body should stay narrow: an accidental throw refuses a real user. */
|
|
1460
|
+
declare class Deny extends Error {
|
|
1461
|
+
constructor(reason: string);
|
|
1462
|
+
}
|
|
1463
|
+
/** `@Hook("before.user.create")` — a blocking handler for one stack event. */
|
|
1464
|
+
declare function Hook(event: string): (target: object, fnName: string | symbol) => void;
|
|
1465
|
+
/** Resolves a hook class into the two maps the runtime dispatches from.
|
|
1466
|
+
*
|
|
1467
|
+
* Every misuse throws HERE, at build time, rather than becoming a hook that is
|
|
1468
|
+
* silently never called — the failure mode this whole change exists to end. */
|
|
1469
|
+
declare function getHookConfig(ctor: object): ResolvedHookClass;
|
|
1470
|
+
|
|
1296
1471
|
/** A legacy parameter decorator. */
|
|
1297
1472
|
type ParameterDecorator = (target: object, propertyKey: string | symbol, parameterIndex: number) => void;
|
|
1298
1473
|
/** `@Body(schema)` — inject the request body, validated against `schema`. The
|
|
@@ -1438,10 +1613,21 @@ interface JobOptions {
|
|
|
1438
1613
|
schedule: string;
|
|
1439
1614
|
/** Execution timeout in seconds. Defaults to 30, ceiling 300 (sandbox limit). */
|
|
1440
1615
|
timeout?: number;
|
|
1616
|
+
/**
|
|
1617
|
+
* How many times a FAILED run is retried before the run is recorded failed.
|
|
1618
|
+
* Defaults to 5, ceiling 10; 0 disables retrying entirely.
|
|
1619
|
+
*
|
|
1620
|
+
* Retries exist for the transient half of the failure space — the runtime
|
|
1621
|
+
* still waking, a network blip — not for a job that is wrong. A permanent
|
|
1622
|
+
* failure still lands in the run history, it just lands after the retries
|
|
1623
|
+
* are spent rather than instead of them.
|
|
1624
|
+
*/
|
|
1625
|
+
retry?: number;
|
|
1441
1626
|
}
|
|
1442
1627
|
interface ResolvedJob {
|
|
1443
1628
|
schedule: string;
|
|
1444
1629
|
timeout: number;
|
|
1630
|
+
retry: number;
|
|
1445
1631
|
handler: (meta: JobMeta) => Promise<void>;
|
|
1446
1632
|
}
|
|
1447
1633
|
declare function Job(options: JobOptions): <T extends abstract new (...args: never[]) => object>(ctor: T) => T;
|
|
@@ -1539,121 +1725,4 @@ declare function __runResourceBoot(envMap: Record<string, string>): Promise<void
|
|
|
1539
1725
|
*/
|
|
1540
1726
|
declare function __shutdownResources(): Promise<void>;
|
|
1541
1727
|
|
|
1542
|
-
|
|
1543
|
-
* Services (Database, Log, …) are imported as singletons, not passed here. */
|
|
1544
|
-
interface HookMeta {
|
|
1545
|
-
/** Environment-scoped env vars. */
|
|
1546
|
-
env: Record<string, string>;
|
|
1547
|
-
/** The globally unique Environment runtime identifier. */
|
|
1548
|
-
environmentId: string;
|
|
1549
|
-
}
|
|
1550
|
-
/** Payload for auth.onUserCreated hook. */
|
|
1551
|
-
interface UserCreatedEvent {
|
|
1552
|
-
user: {
|
|
1553
|
-
id: string;
|
|
1554
|
-
/** User's email, if they signed up with one (absent for phone-only users). */
|
|
1555
|
-
email?: string;
|
|
1556
|
-
role: string;
|
|
1557
|
-
metadata: Record<string, unknown>;
|
|
1558
|
-
createdAt: string;
|
|
1559
|
-
};
|
|
1560
|
-
}
|
|
1561
|
-
/** Payload for auth.onSignIn hook. */
|
|
1562
|
-
interface SignInEvent {
|
|
1563
|
-
user: {
|
|
1564
|
-
id: string;
|
|
1565
|
-
/** User's email, if they have one (absent for phone-only users). */
|
|
1566
|
-
email?: string;
|
|
1567
|
-
role: string;
|
|
1568
|
-
};
|
|
1569
|
-
provider: string;
|
|
1570
|
-
timestamp: string;
|
|
1571
|
-
}
|
|
1572
|
-
/** Payload for auth.onSignOut hook. */
|
|
1573
|
-
interface SignOutEvent {
|
|
1574
|
-
user: {
|
|
1575
|
-
id: string;
|
|
1576
|
-
/** User's email, if they have one (absent for phone-only users). */
|
|
1577
|
-
email?: string;
|
|
1578
|
-
};
|
|
1579
|
-
timestamp: string;
|
|
1580
|
-
}
|
|
1581
|
-
/** Payload for auth.onPasswordReset hook.
|
|
1582
|
-
* Password reset is inherently email-based, so `email` is always present here
|
|
1583
|
-
* (a phone-only passwordless user cannot trigger this event). */
|
|
1584
|
-
interface PasswordResetEvent {
|
|
1585
|
-
user: {
|
|
1586
|
-
id: string;
|
|
1587
|
-
email: string;
|
|
1588
|
-
};
|
|
1589
|
-
timestamp: string;
|
|
1590
|
-
}
|
|
1591
|
-
/** Payload for storage.onFileUploaded hook. */
|
|
1592
|
-
interface FileUploadedEvent {
|
|
1593
|
-
file: {
|
|
1594
|
-
id: string;
|
|
1595
|
-
name: string;
|
|
1596
|
-
bucket: string;
|
|
1597
|
-
path: string;
|
|
1598
|
-
size: number;
|
|
1599
|
-
contentType: string;
|
|
1600
|
-
};
|
|
1601
|
-
}
|
|
1602
|
-
/** Payload for storage.onFileDeleted hook. */
|
|
1603
|
-
interface FileDeletedEvent {
|
|
1604
|
-
file: {
|
|
1605
|
-
id: string;
|
|
1606
|
-
name: string;
|
|
1607
|
-
bucket: string;
|
|
1608
|
-
path: string;
|
|
1609
|
-
};
|
|
1610
|
-
}
|
|
1611
|
-
/** Payload for documents.onDocumentCreated hook. */
|
|
1612
|
-
interface DocumentCreatedEvent {
|
|
1613
|
-
document: {
|
|
1614
|
-
id: string;
|
|
1615
|
-
collection: string;
|
|
1616
|
-
data: Record<string, unknown>;
|
|
1617
|
-
};
|
|
1618
|
-
}
|
|
1619
|
-
/** Payload for documents.onDocumentUpdated hook. */
|
|
1620
|
-
interface DocumentUpdatedEvent {
|
|
1621
|
-
document: {
|
|
1622
|
-
id: string;
|
|
1623
|
-
collection: string;
|
|
1624
|
-
data: Record<string, unknown>;
|
|
1625
|
-
previousData: Record<string, unknown>;
|
|
1626
|
-
};
|
|
1627
|
-
}
|
|
1628
|
-
/** Payload for documents.onDocumentDeleted hook. */
|
|
1629
|
-
interface DocumentDeletedEvent {
|
|
1630
|
-
document: {
|
|
1631
|
-
id: string;
|
|
1632
|
-
collection: string;
|
|
1633
|
-
data: Record<string, unknown>;
|
|
1634
|
-
};
|
|
1635
|
-
}
|
|
1636
|
-
type HookHandler<TEvent> = (event: TEvent, meta: HookMeta) => Promise<void>;
|
|
1637
|
-
/** Resolved hook configuration (internal). */
|
|
1638
|
-
interface ResolvedHook<TEvent = unknown> {
|
|
1639
|
-
module: string;
|
|
1640
|
-
event: string;
|
|
1641
|
-
handler: HookHandler<TEvent>;
|
|
1642
|
-
}
|
|
1643
|
-
declare const auth: {
|
|
1644
|
-
onUserCreated(handler: HookHandler<UserCreatedEvent>): ResolvedHook<UserCreatedEvent>;
|
|
1645
|
-
onSignIn(handler: HookHandler<SignInEvent>): ResolvedHook<SignInEvent>;
|
|
1646
|
-
onSignOut(handler: HookHandler<SignOutEvent>): ResolvedHook<SignOutEvent>;
|
|
1647
|
-
onPasswordReset(handler: HookHandler<PasswordResetEvent>): ResolvedHook<PasswordResetEvent>;
|
|
1648
|
-
};
|
|
1649
|
-
declare const storage: {
|
|
1650
|
-
onFileUploaded(handler: HookHandler<FileUploadedEvent>): ResolvedHook<FileUploadedEvent>;
|
|
1651
|
-
onFileDeleted(handler: HookHandler<FileDeletedEvent>): ResolvedHook<FileDeletedEvent>;
|
|
1652
|
-
};
|
|
1653
|
-
declare const documents: {
|
|
1654
|
-
onDocumentCreated(handler: HookHandler<DocumentCreatedEvent>): ResolvedHook<DocumentCreatedEvent>;
|
|
1655
|
-
onDocumentUpdated(handler: HookHandler<DocumentUpdatedEvent>): ResolvedHook<DocumentUpdatedEvent>;
|
|
1656
|
-
onDocumentDeleted(handler: HookHandler<DocumentDeletedEvent>): ResolvedHook<DocumentDeletedEvent>;
|
|
1657
|
-
};
|
|
1658
|
-
|
|
1659
|
-
export { type AcsOptions, type ApnsOptions, Body, Client, type ColumnJSON, Controller, type ControllerOptions, DEFAULT_TEMPLATE_LOCALE, type DefinedError, type DefinedErrorWithData, Delete, type DocumentCreatedEvent, type DocumentDeletedEvent, type DocumentUpdatedEvent, EGRESS_CONFIG_KIND, EGRESS_TIMEOUT_DEFAULT_MS, EGRESS_TIMEOUT_MAX_MS, EGRESS_TIMEOUT_MIN_MS, type EgressConfig, type EgressInput, type EmailTemplateContent, type EmailTemplateDef, type EmailTemplateOptions, EntitlementKey, FLAGS_CONFIG_KIND, type FcmOptions, type FileDeletedEvent, type FileUploadedEvent, type FlagDef, type FlagJsonObject, type FlagJsonValue, type FlagOptions, type FlagType, type FlagValue, type FlagsConfig, type FlagsInput, Get, Headers, type HookHandler, type HookMeta, HttpError, Job, type JobMeta, type JobOptions, LimitKey, type ModuleClientsConfig, type ModuleTransport, NOTIFICATIONS_CONFIG_KIND, type NotificationsConfig, type NotificationsInput, On, OptionalUser, type OwnedTablesOf, PROVIDER_CATALOG, PalbaseModuleError, PalbaseResult, Param, type PasswordResetEvent, Patch, type PolicyJSON, Post, type ProviderCatalogEntry, type ProviderDef, type ProviderName, type ProviderOptions, type PurchasesManifest, Put, Query, QueryParams, RESERVED_SECRET_PREFIX, type RegisteredError, Req, RequestId, type RequestOptions, RequireEntitlement, type ResolvedHook, type ResolvedJob, type ResolvedWebhook, Resource, type ResourceEnv, RouteOptions, SECRETS_CONFIG_KIND, SchemaDef, type SchemaJSON, type SecretDef, type SecretOptions, type SecretsConfig, type SecretsInput, type Seed, type SeedFor, type SeedJson, type SeedRowFor, type SendgridOptions, type SesOptions, type SignInEvent, type SignOutEvent, type SignatureSpec, type SmsTemplateContent, type SmsTemplateDef, type SmsTemplateOptions, type SmtpOptions, Spend, type SpendMeta, TEST_USERS_CONFIG_KIND, type TableGraph, type TableJSON, TableTypes, Tables, type TemplatesConfig, type TemplatesInput, type TestUserDef, type TestUserOptions, type TestUsersConfig, type TestUsersInput, TraceId, type TransportConfig, type TwilioOptions, User, type UserCreatedEvent, Webhook, type WebhookEventHandler, type WebhookMeta, type WebhookOptions, type WebhookProvider, type WebhookRequest, __registerResource, __resetRegisteredControllers, __runResourceBoot, __shutdownResources, auth, buildModuleClients, buildProvider, defineEgress, defineError, defineFlags, defineNotifications, defineSecrets, defineTestUsers, documents, entitlementFor, extractVariables, flag, getErrorRegistry, getJobConfig, getRegisteredControllers, getWebhookConfig, makeEnvDts, makeHttpClient, makePurchasesDts, reservedSecretKey, secret, spendFor, storage, testUser, toSchemaJSON };
|
|
1728
|
+
export { type AcsOptions, type ApnsOptions, type AuthHookEvent, Body, Client, type ColumnJSON, Controller, type ControllerOptions, DEFAULT_TEMPLATE_LOCALE, type DefinedError, type DefinedErrorWithData, Delete, Deny, type DocumentCreatedEvent, type DocumentDeletedEvent, type DocumentHookEvent, type DocumentUpdatedEvent, EGRESS_CONFIG_KIND, EGRESS_TIMEOUT_DEFAULT_MS, EGRESS_TIMEOUT_MAX_MS, EGRESS_TIMEOUT_MIN_MS, type EgressConfig, type EgressInput, type EmailTemplateContent, type EmailTemplateDef, type EmailTemplateOptions, EntitlementKey, FLAGS_CONFIG_KIND, type FcmOptions, type FileDeletedEvent, type FileUploadedEvent, type FlagDef, type FlagJsonObject, type FlagJsonValue, type FlagOptions, type FlagType, type FlagValue, type FlagsConfig, type FlagsInput, Get, Headers, Hook, type HookFn, type HookHandler, type HookMeta, HttpError, Job, type JobMeta, type JobOptions, LimitKey, type ModuleClientsConfig, type ModuleTransport, NOTIFICATIONS_CONFIG_KIND, type NotificationsConfig, type NotificationsInput, On, OptionalUser, type OwnedTablesOf, PROVIDER_CATALOG, PalbaseModuleError, PalbaseResult, Param, type PasswordResetEvent, Patch, type PolicyJSON, Post, type ProviderCatalogEntry, type ProviderDef, type ProviderName, type ProviderOptions, type PurchasesManifest, Put, Query, QueryParams, RESERVED_SECRET_PREFIX, type RegisteredError, Req, RequestId, type RequestOptions, RequireEntitlement, type ResolvedHook, type ResolvedHookClass, type ResolvedJob, type ResolvedWebhook, Resource, type ResourceEnv, RouteOptions, SECRETS_CONFIG_KIND, SchemaDef, type SchemaJSON, type SecretDef, type SecretOptions, type SecretsConfig, type SecretsInput, type Seed, type SeedFor, type SeedJson, type SeedRowFor, type SendgridOptions, type SesOptions, type SignInEvent, type SignOutEvent, type SignatureSpec, type SmsTemplateContent, type SmsTemplateDef, type SmsTemplateOptions, type SmtpOptions, Spend, type SpendMeta, TEST_USERS_CONFIG_KIND, type TableGraph, type TableJSON, TableTypes, Tables, type TemplatesConfig, type TemplatesInput, type TestUserDef, type TestUserOptions, type TestUsersConfig, type TestUsersInput, TraceId, type TransportConfig, type TwilioOptions, User, type UserCreatedEvent, Webhook, type WebhookEventHandler, type WebhookMeta, type WebhookOptions, type WebhookProvider, type WebhookRequest, __registerResource, __resetRegisteredControllers, __runResourceBoot, __shutdownResources, auth, buildModuleClients, buildProvider, defineEgress, defineError, defineFlags, defineNotifications, defineSecrets, defineTestUsers, documents, entitlementFor, extractVariables, flag, getErrorRegistry, getHookConfig, getJobConfig, getRegisteredControllers, getWebhookConfig, makeEnvDts, makeHttpClient, makePurchasesDts, reservedSecretKey, secret, spendFor, storage, testUser, toSchemaJSON };
|