@palbase/backend 25.1.0 → 27.1.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 +2432 -1039
- package/dist/bin/palbase-backend.cjs.map +1 -1
- package/dist/bin/palbase-backend.js +87 -51
- package/dist/bin/palbase-backend.js.map +1 -1
- package/dist/chunk-BQN723PL.js +930 -0
- package/dist/chunk-BQN723PL.js.map +1 -0
- package/dist/chunk-CGNN2PUH.js +213 -0
- package/dist/chunk-CGNN2PUH.js.map +1 -0
- package/dist/{chunk-VDF2T4AS.js → chunk-EB3TUX5J.js} +1228 -591
- package/dist/chunk-EB3TUX5J.js.map +1 -0
- package/dist/chunk-JVZQCC77.js +728 -0
- package/dist/chunk-JVZQCC77.js.map +1 -0
- package/dist/chunk-OZKSM3JW.js +370 -0
- package/dist/chunk-OZKSM3JW.js.map +1 -0
- package/dist/{chunk-YOY5DFQS.js → chunk-TWX6JTGJ.js} +76 -34
- package/dist/{chunk-YOY5DFQS.js.map → chunk-TWX6JTGJ.js.map} +1 -1
- package/dist/{chunk-35PNTIRN.js → chunk-VVMJEVQP.js} +63 -162
- package/dist/chunk-VVMJEVQP.js.map +1 -0
- package/dist/{chunk-7D4SUZUM.js → chunk-VXPNPVAG.js} +3 -1
- package/dist/chunk-XABHGMUT.js +885 -0
- package/dist/chunk-XABHGMUT.js.map +1 -0
- package/dist/db/env.cjs.map +1 -1
- package/dist/db/env.d.cts +2 -2
- package/dist/db/env.d.ts +2 -2
- package/dist/db/index.cjs +780 -344
- 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 +7 -4
- package/dist/engine/index.cjs +2366 -1002
- package/dist/engine/index.cjs.map +1 -1
- package/dist/engine/index.d.cts +6 -6
- package/dist/engine/index.d.ts +6 -6
- package/dist/engine/index.js +7 -6
- package/dist/{index-CUomTA3e.d.ts → index-CAKOgAlP.d.ts} +171 -296
- package/dist/index-CgE4sVhg.d.cts +4864 -0
- package/dist/{index-ClpDeSos.d.cts → index-H-0qv5d4.d.cts} +171 -296
- package/dist/index-V7QRh1wg.d.ts +4864 -0
- package/dist/index.cjs +2720 -1169
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +165 -19
- package/dist/index.d.ts +165 -19
- package/dist/index.js +738 -477
- package/dist/index.js.map +1 -1
- package/dist/module-Dl1KFVtc.d.cts +54 -0
- package/dist/module-Dl1KFVtc.d.ts +54 -0
- package/dist/openapi/index.cjs +1330 -484
- package/dist/openapi/index.cjs.map +1 -1
- package/dist/openapi/index.d.cts +4 -2
- package/dist/openapi/index.d.ts +4 -2
- package/dist/openapi/index.js +1264 -474
- package/dist/openapi/index.js.map +1 -1
- package/dist/{registry-dZZ5JKYg.d.ts → registry-4EI8aaFs.d.ts} +1 -1
- package/dist/{registry-CC0WBQq6.d.cts → registry-DHsPDY0_.d.cts} +1 -1
- package/dist/stack.cjs.map +1 -1
- package/dist/test/index.cjs +732 -141
- package/dist/test/index.cjs.map +1 -1
- package/dist/test/index.d.cts +30 -4
- package/dist/test/index.d.ts +30 -4
- package/dist/test/index.js +490 -124
- package/dist/test/index.js.map +1 -1
- package/docs/README.md +33 -18
- package/docs/auth.md +1 -1
- package/docs/background.md +2 -2
- package/docs/database.md +255 -50
- package/docs/endpoints.md +3 -4
- package/docs/events.md +3 -3
- package/docs/getting-started.md +1 -1
- package/docs/llms-full.txt +435 -117
- package/docs/migrations.md +2 -2
- package/docs/schema.md +19 -10
- package/docs/services.md +116 -26
- package/package.json +8 -4
- package/stager/generics.js +205 -0
- package/stager/stage.js +39 -3
- package/template/AGENTS.md +110 -72
- package/template/db/public.ts +1 -1
- package/template/{controllers → modules/health}/health.controller.ts +1 -1
- package/template/modules/health/health.module.ts +24 -0
- package/template/modules/notes/note.service.test.ts +49 -0
- package/template/modules/notes/note.service.ts +108 -0
- package/template/{controllers → modules/notes}/notes.controller.ts +17 -11
- package/template/modules/notes/notes.module.ts +37 -0
- package/template/package.json +5 -3
- package/template/scripts/test.sh +33 -0
- package/template/tsconfig.json +29 -30
- package/dist/chunk-35PNTIRN.js.map +0 -1
- package/dist/chunk-CJSKYY76.js +0 -627
- package/dist/chunk-CJSKYY76.js.map +0 -1
- package/dist/chunk-CRQKCRGF.js +0 -276
- package/dist/chunk-CRQKCRGF.js.map +0 -1
- package/dist/chunk-G4R6BTLV.js +0 -662
- package/dist/chunk-G4R6BTLV.js.map +0 -1
- package/dist/chunk-VDF2T4AS.js.map +0 -1
- package/dist/chunk-XABBC7JP.js +0 -55
- package/dist/chunk-XABBC7JP.js.map +0 -1
- package/dist/endpoint-CTEHhb7A.d.ts +0 -2386
- package/dist/endpoint-DYHMo6cC.d.cts +0 -2386
- package/dist/index-CW21M9Z3.d.ts +0 -1222
- package/dist/index-CmBK76nx.d.cts +0 -1222
- package/template/services/note.service.test.ts +0 -45
- package/template/services/note.service.ts +0 -76
- /package/dist/{chunk-7D4SUZUM.js.map → chunk-VXPNPVAG.js.map} +0 -0
- /package/template/{models/notes → modules/notes/dto}/create.ts +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { M as ModuleClients } from './index-
|
|
4
|
-
export {
|
|
5
|
-
import { S as SchemaDef } from './index-CmBK76nx.cjs';
|
|
6
|
-
export { A as AnyColumn, C as ColumnBuilder, a as ColumnDef, b as ColumnMap, c as ColumnType, d as EXTENSION_DEPENDENCIES, e as EmbeddingModelRef, f as EnvSchemas, g as EnvServiceDatabase, h as EnvTables, E as EnvTypedDatabase, i as EnvTypedTable, I as InsertShape, O as OnDeleteAction, P as PALBASE_EXTENSIONS, j as PalbaseExtension, k as PolicyBuilder, l as PolicyCommand, m as PolicyDef, n as PolicyMode, R as RawConstraintDef, o as RowShape, T as TABLE_META, p as TableDef, q as TableHandle, r as TableInput, s as TxPlan, t as TxTables, u as TypedDB, v as TypedTable, w as TypedTx, x as bigint, y as boolean, z as defineSchema, B as defineTable, D as enumType, F as installationRef, G as integer, H as isPalbaseExtension, J as jsonb, K as makeTypedDB, L as numeric, M as openai, N as ownedByUser, Q as policy, U as raw, V as text, W as timestamp, X as userRef, Y as uuid, Z as vector } from './index-CmBK76nx.cjs';
|
|
1
|
+
import { P as PalbaseResult, e as PolicyExpr, S as SchemaDef, A as AuthSpec, H as HttpError } from './index-CgE4sVhg.cjs';
|
|
2
|
+
export { f as AnyColumn, g as AuthConfig, B as BadRequest, h as Cache, C as CacheClient, i as ClientInfo, j as ColRef, k as ColumnBuilder, l as ColumnDef, m as ColumnMap, n as ColumnType, o as Conflict, D as DBClient, a as DBOps, p as Database, q as DeadlockDetected, r as Documents, E as EXTENSION_DEPENDENCIES, s as EmbeddingModelRef, t as EnvSchemas, u as EnvServiceDatabase, v as EnvTables, w as EnvTypedDatabase, x as EnvTypedTable, y as ErrorDef, z as ErrorMap, F as ErrorThrowers, G as FileContext, I as Flags, J as Forbidden, K as HttpMethod, L as IndexBuilder, M as IndexDef, N as InsertShape, O as LifecycleHook, Q as Log, U as Logger, V as Materialized, W as Middleware, X as MiddlewareContext, Y as MiddlewareHandler, Z as NotFound, $ as Notifications, a0 as OnDeleteAction, a1 as PALBASE_EXTENSIONS, a2 as PBRequest, a3 as PalError, a4 as PalbaseAnalyticsClient, a5 as PalbaseAnalyticsManagementNamespace, a6 as PalbaseAnalyticsProperties, a7 as PalbaseAnalyticsQueryNamespace, a8 as PalbaseAttestAndroidParams, a9 as PalbaseAttestAndroidResult, aa as PalbaseAttestiOSParams, ab as PalbaseAttestiOSResult, ac as PalbaseAuthClient, ad as PalbaseBatchOverrideOperation, ae as PalbaseBatchSetOverridesResult, af as PalbaseBindDeviceParams, ag as PalbaseBucketClient, ah as PalbaseClearAllOverridesResult, ai as PalbaseClearOverrideResult, aj as PalbaseCohortQueryInput, ak as PalbaseCohortResult, al as PalbaseCollectionRef, am as PalbaseCountQueryInput, an as PalbaseCountResult, ao as PalbaseCreateLinkParams, ap as PalbaseDeviceInfo, aq as PalbaseDeviceTokenView, ar as PalbaseDocsClient, as as PalbaseDocumentRef, at as PalbaseDocumentSnapshot, au as PalbaseEmailClient, av as PalbaseEmailSendParams, aw as PalbaseEmailSendResponse, ax as PalbaseEventNamesResult, ay as PalbaseEventsQueryInput, az as PalbaseEventsResult, aA as PalbaseExtension, aB as PalbaseFileObject, aC as PalbaseFlag, aD as PalbaseFlagContext, aE as PalbaseFlagSource, aF as PalbaseFlagValue, aG as PalbaseFlagVariant, aH as PalbaseFlagsClient, aI as PalbaseFlagsServiceClient, aJ as PalbaseFunctionsClient, aK as PalbaseFunnelQueryInput, aL as PalbaseFunnelResult, aM as PalbaseIdentifyTraits, aN as PalbaseInboxClient, aO as PalbaseInboxListOptions, aP as PalbaseInboxListResult, aQ as PalbaseInboxMessage, aR as PalbaseInboxSendParams, aS as PalbaseInboxSendResponse, aT as PalbaseInitialLink, aU as PalbaseInvokeOptions, aV as PalbaseLink, aW as PalbaseLinkAnalytics, aX as PalbaseLinkDetails, aY as PalbaseLinksClient, aZ as PalbaseListLinksOptions, a_ as PalbaseListLinksResult, a$ as PalbaseListOptions, b0 as PalbaseMatchParams, b1 as PalbaseMultiChannelResponse, b2 as PalbaseNotificationsClient, b3 as PalbaseOverviewResult, b4 as PalbasePreferences, b5 as PalbasePreferencesClient, b6 as PalbasePushClient, b7 as PalbasePushSendParams, b8 as PalbasePushSendResponse, b9 as PalbaseQrCodeOptions, ba as PalbaseQuerySnapshot, bb as PalbaseRealtimeClient, bc as PalbaseRegisterDeviceParams, bd as PalbaseRetentionQueryInput, be as PalbaseRetentionResult, bf as PalbaseSession, bg as PalbaseSetOverrideResult, bh as PalbaseSetOverridesResult, bi as PalbaseSignedUrlResponse, bj as PalbaseSmsClient, bk as PalbaseSmsSendParams, bl as PalbaseSmsSendResponse, bm as PalbaseStorageClient, bn as PalbaseTransformOptions, bo as PalbaseUpdateLinkParams, bp as PalbaseUploadOptions, bq as PalbaseUser, br as PalbaseUserDetailResult, bs as PalbaseUsersQueryInput, bt as PalbaseUsersResult, bu as PalbaseVerifyRequestSignatureParams, bv as PalbaseWhereOperator, bw as PolicyBinOp, bx as PolicyBuilder, by as PolicyCommand, bz as PolicyDef, bA as PolicyExprCtx, bB as PolicyExprRef, bC as PolicyMode, bD as PolicyOperand, R as RateLimitConfig, bE as RawConstraintDef, bF as Realtime, bG as Ref, bH as RequestStore, bI as RowShape, c as RuntimeServices, bJ as Secrets, bK as SecretsService, bL as SerializationFailure, bM as SetShape, bN as SetValue, bO as ShutdownRunner, bP as SqlFragment, bQ as Storage, bR as TABLE_META, bS as TableDef, bT as TableHandle, bU as TableInput, bV as TooManyRequests, bW as TxColumnExpr, bX as TxInsertShape, bY as TxInsertValue, bZ as TxNow, b_ as TxPlan, T as TxPlanBody, b$ as TxPlanError, c0 as TxPlanHandle, c1 as TxPlanOpResult, c2 as TxPlanRejection, b as TxPlanResponse, c3 as TxRefError, c4 as TxRow, c5 as TxRows, c6 as TxSelectOptions, c7 as TxSetShape, c8 as TxSetValue, c9 as TxTable, ca as TxTables, cb as TxWhere, cc as TxWireExpr, cd as TxWireGuard, ce as TxWireOp, cf as TxWireRef, cg as TxWireValue, ch as TypedDB, ci as TypedTable, cj as TypedTx, ck as Unauthorized, cl as UniqueViolation, cm as UserT, cn as VerifiedDevice, co as __getRuntime, d as __requestALS, cp as __resetLifecycleHooks, cq as __runStartHooks, _ as __runWithRuntime, cr as __setRuntime, cs as bigint, ct as boolean, cu as col, cv as dec, cw as decrement, cx as defineMiddleware, cy as defineSchema, cz as defineTable, cA as enumType, cB as exprCtx, cC as inc, cD as increment, cE as index, cF as installationRef, cG as integer, cH as isPalbaseExtension, cI as isRetryable, cJ as jsonb, cK as makeTypedDB, cL as now, cM as numeric, cN as onShutdown, cO as onStart, cP as openai, cQ as ownedByUser, cR as policy, cS as raw, cT as sqlFragment, cU as text, cV as timestamp, cW as userRef, cX as uuid, cY as vector, cZ as withRetry } from './index-CgE4sVhg.cjs';
|
|
3
|
+
import { M as ModuleClients, C as Container } from './index-H-0qv5d4.cjs';
|
|
4
|
+
export { D as DiError, a as DiKind, b as ModulePressure, c as assertNoOrphanEntryPoints, d as buildContainer } from './index-H-0qv5d4.cjs';
|
|
7
5
|
export { TableTypes, Tables } from './db/env.cjs';
|
|
8
6
|
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-
|
|
7
|
+
import { a as RouteOptions } from './registry-DHsPDY0_.cjs';
|
|
8
|
+
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-DHsPDY0_.cjs';
|
|
11
9
|
import { ZodTypeAny, z } from 'zod';
|
|
12
10
|
export { z } from 'zod';
|
|
11
|
+
import { T as Token } from './module-Dl1KFVtc.cjs';
|
|
12
|
+
export { M as Module, a as ModuleDef, _ as __claimModules } from './module-Dl1KFVtc.cjs';
|
|
13
13
|
import 'node:async_hooks';
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -145,6 +145,10 @@ interface ColumnJSON {
|
|
|
145
145
|
column: string;
|
|
146
146
|
};
|
|
147
147
|
onDeleteAction?: string;
|
|
148
|
+
/** FR-044: türev FK index'i kapatılmışsa `false`. Bildirilmemişse alan YOK. */
|
|
149
|
+
index?: boolean;
|
|
150
|
+
/** FR-049: kolon increment() ile güncelleniyorsa `true`. Aksi hâlde alan YOK. */
|
|
151
|
+
counter?: boolean;
|
|
148
152
|
enumName?: string;
|
|
149
153
|
enumValues?: string[];
|
|
150
154
|
unique?: boolean;
|
|
@@ -155,8 +159,16 @@ interface PolicyJSON {
|
|
|
155
159
|
name: string;
|
|
156
160
|
command: string;
|
|
157
161
|
roles: string[];
|
|
158
|
-
|
|
159
|
-
|
|
162
|
+
/**
|
|
163
|
+
* `USING (...)` — ham string (kaçış kapağı, FR-028) ya da YAPI (FR-022).
|
|
164
|
+
*
|
|
165
|
+
* Go tarafı ikisini de okur: string olan verbatim emit edilir, yapı olan
|
|
166
|
+
* `generator.go`'da SQL'e çevrilir (C-6). Yapı hâli InitPlan sarmalamasını
|
|
167
|
+
* ve `TO <rol>` daraltmasını GÜVENLE yapılabilir kılan şey — string üstünde
|
|
168
|
+
* regex'le denemek yorum içindeki bir `auth.uid()`'yi de sarmalardı.
|
|
169
|
+
*/
|
|
170
|
+
using: string | PolicyExpr | null;
|
|
171
|
+
withCheck: string | PolicyExpr | null;
|
|
160
172
|
permissive: boolean;
|
|
161
173
|
}
|
|
162
174
|
/** One table. Mirrors Go's `schema.TableJSON`. */
|
|
@@ -187,13 +199,36 @@ interface TableJSON {
|
|
|
187
199
|
name: string;
|
|
188
200
|
expr: string;
|
|
189
201
|
}[];
|
|
190
|
-
indexes?:
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
202
|
+
indexes?: IndexJSON[];
|
|
203
|
+
/**
|
|
204
|
+
* appendOnly (FR-030): tablo yalnız INSERT kabul eder. Sıfır değerde OMIT —
|
|
205
|
+
* bildirmeyen tablolar wire'da bayt-aynı kalır.
|
|
206
|
+
*/
|
|
207
|
+
appendOnly?: boolean;
|
|
194
208
|
search?: SearchJSON;
|
|
195
209
|
memory?: MemoryJSON;
|
|
196
210
|
}
|
|
211
|
+
/**
|
|
212
|
+
* Bir index'in wire şekli — Go'nun `IndexJSON`'ıyla ALAN-ADI SÖZLEŞMESİ.
|
|
213
|
+
*
|
|
214
|
+
* `name` + `columns` bugünkü hâl; kalanı FR-041…043'ün taşıyıcısı. Hepsi sıfır
|
|
215
|
+
* değerde OMIT edilir: bildirmeyen bir index wire'da eskisiyle bayt-aynı kalır,
|
|
216
|
+
* yoksa dokunulmamış her şema diff'te değişmiş görünür ve her deploy churn üretir.
|
|
217
|
+
*/
|
|
218
|
+
interface IndexJSON {
|
|
219
|
+
name: string;
|
|
220
|
+
columns: string[];
|
|
221
|
+
/** Partial index koşulu (FR-042) — filtre şekli `WhereFilter` ile aynı. */
|
|
222
|
+
where?: unknown;
|
|
223
|
+
/** İfade index'i (FR-043), ör. `lower(email)`. `columns` ile birlikte kullanılmaz. */
|
|
224
|
+
expression?: string;
|
|
225
|
+
/** Kolon sırası (FR-043). */
|
|
226
|
+
sort?: "asc" | "desc";
|
|
227
|
+
/** NULL sırası (FR-043). */
|
|
228
|
+
nulls?: "first" | "last";
|
|
229
|
+
/** Covering index — `INCLUDE (...)` (FR-043). */
|
|
230
|
+
include?: string[];
|
|
231
|
+
}
|
|
197
232
|
/** C-11 wire şekli — Go'nun MemoryJSON'ıyla alan-adı sözleşmesi (D-019).
|
|
198
233
|
* Beyansız tablolarda alan OMIT — eski şemalar bayt-aynı (NFR-B1). */
|
|
199
234
|
interface MemoryJSON {
|
|
@@ -364,7 +399,7 @@ declare function defineChannels(map: ChannelsInput): ChannelsDef;
|
|
|
364
399
|
* {@link makeEnvDts} with the project's schema and write the returned string to
|
|
365
400
|
* `palbase-env.d.ts` at the project root. That file AUGMENTS the
|
|
366
401
|
* `@palbase/backend/env` `Tables` interface (controlled global augmentation,
|
|
367
|
-
* C5) so `Database.
|
|
402
|
+
* C5) so `Database.public.<name>` is typed with no import and no generic.
|
|
368
403
|
*
|
|
369
404
|
* The output is FLAT: each table gets a `{ row: {...}; insert: {...} }` entry
|
|
370
405
|
* with plain TypeScript object types. The phantom `ColumnBuilder<...>` type
|
|
@@ -677,7 +712,17 @@ declare function Hook(event: string): (target: object, fnName: string | symbol)
|
|
|
677
712
|
*
|
|
678
713
|
* @throws when the class declares constructor parameters (FR-011) — nothing
|
|
679
714
|
* here supplies them, so the field would be `undefined` on every event. */
|
|
680
|
-
declare function getHookConfig(ctor: object): ResolvedHookClass;
|
|
715
|
+
declare function getHookConfig(ctor: object, container: Container): ResolvedHookClass;
|
|
716
|
+
/**
|
|
717
|
+
* Which events a hook class declares, and which of them BLOCK.
|
|
718
|
+
*
|
|
719
|
+
* Metadata only — the class is not constructed. Deploy's `hooks.manifest.json`
|
|
720
|
+
* needs exactly this and has no container to build with.
|
|
721
|
+
*/
|
|
722
|
+
declare function getHookManifest(ctor: object): {
|
|
723
|
+
blocking: string[];
|
|
724
|
+
listeners: string[];
|
|
725
|
+
};
|
|
681
726
|
|
|
682
727
|
interface RoomOptions {
|
|
683
728
|
/**
|
|
@@ -866,6 +911,14 @@ interface SignatureSpec {
|
|
|
866
911
|
timestampHeader?: string;
|
|
867
912
|
}
|
|
868
913
|
interface WebhookOptions {
|
|
914
|
+
/**
|
|
915
|
+
* The path segment this webhook is served at: `/webhooks/<name>`.
|
|
916
|
+
*
|
|
917
|
+
* DECLARED, not derived. It used to be the file's name, which put a PUBLIC
|
|
918
|
+
* URL — the one a sender is configured with — in the file system rather than
|
|
919
|
+
* beside the provider and the secret, where a reader looks for it.
|
|
920
|
+
*/
|
|
921
|
+
name: string;
|
|
869
922
|
provider?: WebhookProvider;
|
|
870
923
|
signature?: SignatureSpec;
|
|
871
924
|
/** Env-var REFERENCE for the signing secret — the platform never holds it. */
|
|
@@ -894,9 +947,74 @@ declare function On(event: string): (target: object, fnName: string | symbol) =>
|
|
|
894
947
|
*
|
|
895
948
|
* @throws when the class declares constructor parameters (FR-011) — nothing
|
|
896
949
|
* here supplies them, so the field would be `undefined` on every delivery. */
|
|
897
|
-
|
|
950
|
+
/**
|
|
951
|
+
* Everything a webhook DECLARES — provider or signature template, the secret's
|
|
952
|
+
* env var, and the event names — validated, without constructing the class.
|
|
953
|
+
*
|
|
954
|
+
* Same split as jobs and hooks: reading a declaration should not build an
|
|
955
|
+
* object. `getWebhookConfig` is what needs an instance, and it needs a
|
|
956
|
+
* container to get one.
|
|
957
|
+
*/
|
|
958
|
+
declare function getWebhookManifest(ctor: object): {
|
|
959
|
+
name: string;
|
|
960
|
+
provider: string | undefined;
|
|
961
|
+
secretEnv: string;
|
|
962
|
+
events: string[];
|
|
963
|
+
};
|
|
964
|
+
declare function getWebhookConfig(ctor: object, container: Container): ResolvedWebhook;
|
|
965
|
+
|
|
966
|
+
/**
|
|
967
|
+
* Marks a class the container can resolve.
|
|
968
|
+
*
|
|
969
|
+
* TWO JOBS, and the first one is why the decorator has to exist at all:
|
|
970
|
+
* TypeScript under `emitDecoratorMetadata` emits `design:paramtypes` for
|
|
971
|
+
* DECORATED classes only. Measured — an undecorated class with the same
|
|
972
|
+
* constructor carries no metadata, and `Reflect.getMetadata` answers
|
|
973
|
+
* `undefined`.
|
|
974
|
+
*
|
|
975
|
+
* The second is being COUNTABLE. Ownership, visibility and permission are still
|
|
976
|
+
* read from a single `@Module` and never from this decorator — recording the
|
|
977
|
+
* class here decides nothing. It only makes "carries `@Injectable()` and
|
|
978
|
+
* appears in no module" a question the build can ask, which FR-010 requires it
|
|
979
|
+
* to answer by name. The body was empty until 2026-09-02, and the consequence
|
|
980
|
+
* was measured through the CLI: an `@Injectable()` service in no module built
|
|
981
|
+
* clean, while this file's own comment claimed the build named it.
|
|
982
|
+
*/
|
|
983
|
+
declare function Injectable(): ClassDecorator;
|
|
984
|
+
/**
|
|
985
|
+
* TAKES the accumulated declarations — it does not read them.
|
|
986
|
+
*
|
|
987
|
+
* Same claim semantics as `__claimModules`, and for the same reason: a
|
|
988
|
+
* candidate bundle is imported into the SAME process as the live app it might
|
|
989
|
+
* replace, so reading would let a candidate be judged against the live app's
|
|
990
|
+
* classes and a discarded candidate would leave its own behind.
|
|
991
|
+
*/
|
|
992
|
+
declare function __claimInjectables(): Token[];
|
|
993
|
+
|
|
994
|
+
declare const jobsOf: (container: Container) => Token[];
|
|
995
|
+
declare const webhooksOf: (container: Container) => Token[];
|
|
996
|
+
/**
|
|
997
|
+
* A hook class carries handler entries and NO class-level marker, so it is
|
|
998
|
+
* recognised by having handlers while being neither a webhook nor a controller.
|
|
999
|
+
* `@On` is shared with `@Webhook`, which is why the webhook marker is what
|
|
1000
|
+
* separates them.
|
|
1001
|
+
*/
|
|
1002
|
+
declare const hooksOf: (container: Container) => Token[];
|
|
1003
|
+
declare const roomsOf: (container: Container) => Token[];
|
|
1004
|
+
declare const controllersOf: (container: Container) => Token[];
|
|
898
1005
|
|
|
899
1006
|
interface JobOptions {
|
|
1007
|
+
/**
|
|
1008
|
+
* The job's identity, and the name the scheduler holds its rows under.
|
|
1009
|
+
*
|
|
1010
|
+
* DECLARED, not derived. It used to be the file's name, which made the
|
|
1011
|
+
* identity a property of where the class sat — rename the file and the
|
|
1012
|
+
* scheduler starts a different job. Ownership and identity both come from a
|
|
1013
|
+
* declaration now, and this is where a reader looks for it.
|
|
1014
|
+
*
|
|
1015
|
+
* Lowercase, digits and dashes: it reaches a scheduler row and a log line.
|
|
1016
|
+
*/
|
|
1017
|
+
name: string;
|
|
900
1018
|
/** Cron expression, five fields (e.g. "0 3 * * *"). */
|
|
901
1019
|
schedule: string;
|
|
902
1020
|
/** Execution timeout in seconds. Defaults to 30, ceiling 300 (sandbox limit). */
|
|
@@ -913,12 +1031,40 @@ interface JobOptions {
|
|
|
913
1031
|
retry?: number;
|
|
914
1032
|
}
|
|
915
1033
|
interface ResolvedJob {
|
|
1034
|
+
/** The declared identity — the scheduler's row name. */
|
|
1035
|
+
name: string;
|
|
916
1036
|
schedule: string;
|
|
917
1037
|
timeout: number;
|
|
918
1038
|
retry: number;
|
|
919
1039
|
handler: (meta: JobMeta) => Promise<void>;
|
|
920
1040
|
}
|
|
921
1041
|
declare function Job(options: JobOptions): <T extends abstract new (...args: never[]) => object>(ctor: T) => T;
|
|
922
|
-
|
|
1042
|
+
/**
|
|
1043
|
+
* What a job DECLARES — schedule, timeout, retry. Reads metadata and nothing
|
|
1044
|
+
* else: the class is NOT constructed.
|
|
1045
|
+
*
|
|
1046
|
+
* Deploy's manifest script needs exactly this and no instance (stack_bundle.go
|
|
1047
|
+
* writes `jobs.manifest.json` from it, with no runtime and therefore no
|
|
1048
|
+
* container). Constructing a class to read a cron string was a side effect, and
|
|
1049
|
+
* it is the side effect that made the container look optional — which in turn
|
|
1050
|
+
* let a caller that never passes one compile quietly.
|
|
1051
|
+
*/
|
|
1052
|
+
interface JobManifest {
|
|
1053
|
+
name: string;
|
|
1054
|
+
schedule: string;
|
|
1055
|
+
timeout: number;
|
|
1056
|
+
retry: number;
|
|
1057
|
+
}
|
|
1058
|
+
declare function getJobManifest(ctor: object): JobManifest;
|
|
1059
|
+
/**
|
|
1060
|
+
* The job, ready to run — manifest plus a bound `run`.
|
|
1061
|
+
*
|
|
1062
|
+
* `container` is REQUIRED. It used to be absent (the class was built with
|
|
1063
|
+
* `new`), and then briefly optional, which is worse: an optional parameter lets
|
|
1064
|
+
* a caller that forgot it compile, and the job would receive `undefined` for
|
|
1065
|
+
* every dependency at its first scheduled run, hours after deploy, in a process
|
|
1066
|
+
* nobody is watching. Required makes the two runtime call sites a TYPE error.
|
|
1067
|
+
*/
|
|
1068
|
+
declare function getJobConfig(ctor: object, container: Container): ResolvedJob;
|
|
923
1069
|
|
|
924
|
-
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, OnAuthorize, OnEmpty, OnFirst, OnJoin, OnLeave, OnMessage, OptionalUser, PalbaseModuleError, PalbaseResult, Param, Patch, type PolicyJSON, Post, Put, Query, QueryParams, type RegisteredError, Req, RequestId, type RequestOptions, type ResolvedHookClass, type ResolvedJob, type ResolvedWebhook, Room, type RoomOptions, 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, resolveEffectiveAuth, toSchemaJSON };
|
|
1070
|
+
export { type AuthHookEvent, Body, type ChannelAuthorizeCtx, type ChannelEntry, type ChannelGrant, type ChannelsDef, type ChannelsInput, Client, type ColumnJSON, Container, Controller, type ControllerOptions, type DefinedError, type DefinedErrorWithData, Delete, Deny, type DocumentHookEvent, type FileDeletedEvent, type FileUploadedEvent, Get, Headers, Hook, type HookFn, type HookMeta, HttpError, Injectable, Job, type JobMeta, type JobOptions, type ModuleClientsConfig, type ModuleTransport, On, OnAuthorize, OnEmpty, OnFirst, OnJoin, OnLeave, OnMessage, OptionalUser, PalbaseModuleError, PalbaseResult, Param, Patch, PolicyExpr, type PolicyJSON, Post, Put, Query, QueryParams, type RegisteredError, Req, RequestId, type RequestOptions, type ResolvedHookClass, type ResolvedJob, type ResolvedWebhook, Room, type RoomOptions, RouteOptions, SchemaDef, type SchemaJSON, type SignatureSpec, type StackNames, type TableJSON, Token, TraceId, type TransportConfig, User, Webhook, type WebhookEventHandler, type WebhookMeta, type WebhookOptions, type WebhookProvider, type WebhookRequest, __claimInjectables, __resetDefaultAuth, __resetRegisteredControllers, assertZeroArgConstructor, buildModuleClients, controllersOf, defineChannels, defineDefaultAuth, defineError, getErrorRegistry, getHookConfig, getHookManifest, getJobConfig, getJobManifest, getRegisteredControllers, getWebhookConfig, getWebhookManifest, hooksOf, jobsOf, makeEnvDts, makeHttpClient, makeStackDts, ownerOnly, publicChannel, resolveEffectiveAuth, roomsOf, toSchemaJSON, webhooksOf };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { M as ModuleClients } from './index-
|
|
4
|
-
export {
|
|
5
|
-
import { S as SchemaDef } from './index-CW21M9Z3.js';
|
|
6
|
-
export { A as AnyColumn, C as ColumnBuilder, a as ColumnDef, b as ColumnMap, c as ColumnType, d as EXTENSION_DEPENDENCIES, e as EmbeddingModelRef, f as EnvSchemas, g as EnvServiceDatabase, h as EnvTables, E as EnvTypedDatabase, i as EnvTypedTable, I as InsertShape, O as OnDeleteAction, P as PALBASE_EXTENSIONS, j as PalbaseExtension, k as PolicyBuilder, l as PolicyCommand, m as PolicyDef, n as PolicyMode, R as RawConstraintDef, o as RowShape, T as TABLE_META, p as TableDef, q as TableHandle, r as TableInput, s as TxPlan, t as TxTables, u as TypedDB, v as TypedTable, w as TypedTx, x as bigint, y as boolean, z as defineSchema, B as defineTable, D as enumType, F as installationRef, G as integer, H as isPalbaseExtension, J as jsonb, K as makeTypedDB, L as numeric, M as openai, N as ownedByUser, Q as policy, U as raw, V as text, W as timestamp, X as userRef, Y as uuid, Z as vector } from './index-CW21M9Z3.js';
|
|
1
|
+
import { P as PalbaseResult, e as PolicyExpr, S as SchemaDef, A as AuthSpec, H as HttpError } from './index-V7QRh1wg.js';
|
|
2
|
+
export { f as AnyColumn, g as AuthConfig, B as BadRequest, h as Cache, C as CacheClient, i as ClientInfo, j as ColRef, k as ColumnBuilder, l as ColumnDef, m as ColumnMap, n as ColumnType, o as Conflict, D as DBClient, a as DBOps, p as Database, q as DeadlockDetected, r as Documents, E as EXTENSION_DEPENDENCIES, s as EmbeddingModelRef, t as EnvSchemas, u as EnvServiceDatabase, v as EnvTables, w as EnvTypedDatabase, x as EnvTypedTable, y as ErrorDef, z as ErrorMap, F as ErrorThrowers, G as FileContext, I as Flags, J as Forbidden, K as HttpMethod, L as IndexBuilder, M as IndexDef, N as InsertShape, O as LifecycleHook, Q as Log, U as Logger, V as Materialized, W as Middleware, X as MiddlewareContext, Y as MiddlewareHandler, Z as NotFound, $ as Notifications, a0 as OnDeleteAction, a1 as PALBASE_EXTENSIONS, a2 as PBRequest, a3 as PalError, a4 as PalbaseAnalyticsClient, a5 as PalbaseAnalyticsManagementNamespace, a6 as PalbaseAnalyticsProperties, a7 as PalbaseAnalyticsQueryNamespace, a8 as PalbaseAttestAndroidParams, a9 as PalbaseAttestAndroidResult, aa as PalbaseAttestiOSParams, ab as PalbaseAttestiOSResult, ac as PalbaseAuthClient, ad as PalbaseBatchOverrideOperation, ae as PalbaseBatchSetOverridesResult, af as PalbaseBindDeviceParams, ag as PalbaseBucketClient, ah as PalbaseClearAllOverridesResult, ai as PalbaseClearOverrideResult, aj as PalbaseCohortQueryInput, ak as PalbaseCohortResult, al as PalbaseCollectionRef, am as PalbaseCountQueryInput, an as PalbaseCountResult, ao as PalbaseCreateLinkParams, ap as PalbaseDeviceInfo, aq as PalbaseDeviceTokenView, ar as PalbaseDocsClient, as as PalbaseDocumentRef, at as PalbaseDocumentSnapshot, au as PalbaseEmailClient, av as PalbaseEmailSendParams, aw as PalbaseEmailSendResponse, ax as PalbaseEventNamesResult, ay as PalbaseEventsQueryInput, az as PalbaseEventsResult, aA as PalbaseExtension, aB as PalbaseFileObject, aC as PalbaseFlag, aD as PalbaseFlagContext, aE as PalbaseFlagSource, aF as PalbaseFlagValue, aG as PalbaseFlagVariant, aH as PalbaseFlagsClient, aI as PalbaseFlagsServiceClient, aJ as PalbaseFunctionsClient, aK as PalbaseFunnelQueryInput, aL as PalbaseFunnelResult, aM as PalbaseIdentifyTraits, aN as PalbaseInboxClient, aO as PalbaseInboxListOptions, aP as PalbaseInboxListResult, aQ as PalbaseInboxMessage, aR as PalbaseInboxSendParams, aS as PalbaseInboxSendResponse, aT as PalbaseInitialLink, aU as PalbaseInvokeOptions, aV as PalbaseLink, aW as PalbaseLinkAnalytics, aX as PalbaseLinkDetails, aY as PalbaseLinksClient, aZ as PalbaseListLinksOptions, a_ as PalbaseListLinksResult, a$ as PalbaseListOptions, b0 as PalbaseMatchParams, b1 as PalbaseMultiChannelResponse, b2 as PalbaseNotificationsClient, b3 as PalbaseOverviewResult, b4 as PalbasePreferences, b5 as PalbasePreferencesClient, b6 as PalbasePushClient, b7 as PalbasePushSendParams, b8 as PalbasePushSendResponse, b9 as PalbaseQrCodeOptions, ba as PalbaseQuerySnapshot, bb as PalbaseRealtimeClient, bc as PalbaseRegisterDeviceParams, bd as PalbaseRetentionQueryInput, be as PalbaseRetentionResult, bf as PalbaseSession, bg as PalbaseSetOverrideResult, bh as PalbaseSetOverridesResult, bi as PalbaseSignedUrlResponse, bj as PalbaseSmsClient, bk as PalbaseSmsSendParams, bl as PalbaseSmsSendResponse, bm as PalbaseStorageClient, bn as PalbaseTransformOptions, bo as PalbaseUpdateLinkParams, bp as PalbaseUploadOptions, bq as PalbaseUser, br as PalbaseUserDetailResult, bs as PalbaseUsersQueryInput, bt as PalbaseUsersResult, bu as PalbaseVerifyRequestSignatureParams, bv as PalbaseWhereOperator, bw as PolicyBinOp, bx as PolicyBuilder, by as PolicyCommand, bz as PolicyDef, bA as PolicyExprCtx, bB as PolicyExprRef, bC as PolicyMode, bD as PolicyOperand, R as RateLimitConfig, bE as RawConstraintDef, bF as Realtime, bG as Ref, bH as RequestStore, bI as RowShape, c as RuntimeServices, bJ as Secrets, bK as SecretsService, bL as SerializationFailure, bM as SetShape, bN as SetValue, bO as ShutdownRunner, bP as SqlFragment, bQ as Storage, bR as TABLE_META, bS as TableDef, bT as TableHandle, bU as TableInput, bV as TooManyRequests, bW as TxColumnExpr, bX as TxInsertShape, bY as TxInsertValue, bZ as TxNow, b_ as TxPlan, T as TxPlanBody, b$ as TxPlanError, c0 as TxPlanHandle, c1 as TxPlanOpResult, c2 as TxPlanRejection, b as TxPlanResponse, c3 as TxRefError, c4 as TxRow, c5 as TxRows, c6 as TxSelectOptions, c7 as TxSetShape, c8 as TxSetValue, c9 as TxTable, ca as TxTables, cb as TxWhere, cc as TxWireExpr, cd as TxWireGuard, ce as TxWireOp, cf as TxWireRef, cg as TxWireValue, ch as TypedDB, ci as TypedTable, cj as TypedTx, ck as Unauthorized, cl as UniqueViolation, cm as UserT, cn as VerifiedDevice, co as __getRuntime, d as __requestALS, cp as __resetLifecycleHooks, cq as __runStartHooks, _ as __runWithRuntime, cr as __setRuntime, cs as bigint, ct as boolean, cu as col, cv as dec, cw as decrement, cx as defineMiddleware, cy as defineSchema, cz as defineTable, cA as enumType, cB as exprCtx, cC as inc, cD as increment, cE as index, cF as installationRef, cG as integer, cH as isPalbaseExtension, cI as isRetryable, cJ as jsonb, cK as makeTypedDB, cL as now, cM as numeric, cN as onShutdown, cO as onStart, cP as openai, cQ as ownedByUser, cR as policy, cS as raw, cT as sqlFragment, cU as text, cV as timestamp, cW as userRef, cX as uuid, cY as vector, cZ as withRetry } from './index-V7QRh1wg.js';
|
|
3
|
+
import { M as ModuleClients, C as Container } from './index-CAKOgAlP.js';
|
|
4
|
+
export { D as DiError, a as DiKind, b as ModulePressure, c as assertNoOrphanEntryPoints, d as buildContainer } from './index-CAKOgAlP.js';
|
|
7
5
|
export { TableTypes, Tables } from './db/env.js';
|
|
8
6
|
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-
|
|
7
|
+
import { a as RouteOptions } from './registry-4EI8aaFs.js';
|
|
8
|
+
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-4EI8aaFs.js';
|
|
11
9
|
import { ZodTypeAny, z } from 'zod';
|
|
12
10
|
export { z } from 'zod';
|
|
11
|
+
import { T as Token } from './module-Dl1KFVtc.js';
|
|
12
|
+
export { M as Module, a as ModuleDef, _ as __claimModules } from './module-Dl1KFVtc.js';
|
|
13
13
|
import 'node:async_hooks';
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -145,6 +145,10 @@ interface ColumnJSON {
|
|
|
145
145
|
column: string;
|
|
146
146
|
};
|
|
147
147
|
onDeleteAction?: string;
|
|
148
|
+
/** FR-044: türev FK index'i kapatılmışsa `false`. Bildirilmemişse alan YOK. */
|
|
149
|
+
index?: boolean;
|
|
150
|
+
/** FR-049: kolon increment() ile güncelleniyorsa `true`. Aksi hâlde alan YOK. */
|
|
151
|
+
counter?: boolean;
|
|
148
152
|
enumName?: string;
|
|
149
153
|
enumValues?: string[];
|
|
150
154
|
unique?: boolean;
|
|
@@ -155,8 +159,16 @@ interface PolicyJSON {
|
|
|
155
159
|
name: string;
|
|
156
160
|
command: string;
|
|
157
161
|
roles: string[];
|
|
158
|
-
|
|
159
|
-
|
|
162
|
+
/**
|
|
163
|
+
* `USING (...)` — ham string (kaçış kapağı, FR-028) ya da YAPI (FR-022).
|
|
164
|
+
*
|
|
165
|
+
* Go tarafı ikisini de okur: string olan verbatim emit edilir, yapı olan
|
|
166
|
+
* `generator.go`'da SQL'e çevrilir (C-6). Yapı hâli InitPlan sarmalamasını
|
|
167
|
+
* ve `TO <rol>` daraltmasını GÜVENLE yapılabilir kılan şey — string üstünde
|
|
168
|
+
* regex'le denemek yorum içindeki bir `auth.uid()`'yi de sarmalardı.
|
|
169
|
+
*/
|
|
170
|
+
using: string | PolicyExpr | null;
|
|
171
|
+
withCheck: string | PolicyExpr | null;
|
|
160
172
|
permissive: boolean;
|
|
161
173
|
}
|
|
162
174
|
/** One table. Mirrors Go's `schema.TableJSON`. */
|
|
@@ -187,13 +199,36 @@ interface TableJSON {
|
|
|
187
199
|
name: string;
|
|
188
200
|
expr: string;
|
|
189
201
|
}[];
|
|
190
|
-
indexes?:
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
202
|
+
indexes?: IndexJSON[];
|
|
203
|
+
/**
|
|
204
|
+
* appendOnly (FR-030): tablo yalnız INSERT kabul eder. Sıfır değerde OMIT —
|
|
205
|
+
* bildirmeyen tablolar wire'da bayt-aynı kalır.
|
|
206
|
+
*/
|
|
207
|
+
appendOnly?: boolean;
|
|
194
208
|
search?: SearchJSON;
|
|
195
209
|
memory?: MemoryJSON;
|
|
196
210
|
}
|
|
211
|
+
/**
|
|
212
|
+
* Bir index'in wire şekli — Go'nun `IndexJSON`'ıyla ALAN-ADI SÖZLEŞMESİ.
|
|
213
|
+
*
|
|
214
|
+
* `name` + `columns` bugünkü hâl; kalanı FR-041…043'ün taşıyıcısı. Hepsi sıfır
|
|
215
|
+
* değerde OMIT edilir: bildirmeyen bir index wire'da eskisiyle bayt-aynı kalır,
|
|
216
|
+
* yoksa dokunulmamış her şema diff'te değişmiş görünür ve her deploy churn üretir.
|
|
217
|
+
*/
|
|
218
|
+
interface IndexJSON {
|
|
219
|
+
name: string;
|
|
220
|
+
columns: string[];
|
|
221
|
+
/** Partial index koşulu (FR-042) — filtre şekli `WhereFilter` ile aynı. */
|
|
222
|
+
where?: unknown;
|
|
223
|
+
/** İfade index'i (FR-043), ör. `lower(email)`. `columns` ile birlikte kullanılmaz. */
|
|
224
|
+
expression?: string;
|
|
225
|
+
/** Kolon sırası (FR-043). */
|
|
226
|
+
sort?: "asc" | "desc";
|
|
227
|
+
/** NULL sırası (FR-043). */
|
|
228
|
+
nulls?: "first" | "last";
|
|
229
|
+
/** Covering index — `INCLUDE (...)` (FR-043). */
|
|
230
|
+
include?: string[];
|
|
231
|
+
}
|
|
197
232
|
/** C-11 wire şekli — Go'nun MemoryJSON'ıyla alan-adı sözleşmesi (D-019).
|
|
198
233
|
* Beyansız tablolarda alan OMIT — eski şemalar bayt-aynı (NFR-B1). */
|
|
199
234
|
interface MemoryJSON {
|
|
@@ -364,7 +399,7 @@ declare function defineChannels(map: ChannelsInput): ChannelsDef;
|
|
|
364
399
|
* {@link makeEnvDts} with the project's schema and write the returned string to
|
|
365
400
|
* `palbase-env.d.ts` at the project root. That file AUGMENTS the
|
|
366
401
|
* `@palbase/backend/env` `Tables` interface (controlled global augmentation,
|
|
367
|
-
* C5) so `Database.
|
|
402
|
+
* C5) so `Database.public.<name>` is typed with no import and no generic.
|
|
368
403
|
*
|
|
369
404
|
* The output is FLAT: each table gets a `{ row: {...}; insert: {...} }` entry
|
|
370
405
|
* with plain TypeScript object types. The phantom `ColumnBuilder<...>` type
|
|
@@ -677,7 +712,17 @@ declare function Hook(event: string): (target: object, fnName: string | symbol)
|
|
|
677
712
|
*
|
|
678
713
|
* @throws when the class declares constructor parameters (FR-011) — nothing
|
|
679
714
|
* here supplies them, so the field would be `undefined` on every event. */
|
|
680
|
-
declare function getHookConfig(ctor: object): ResolvedHookClass;
|
|
715
|
+
declare function getHookConfig(ctor: object, container: Container): ResolvedHookClass;
|
|
716
|
+
/**
|
|
717
|
+
* Which events a hook class declares, and which of them BLOCK.
|
|
718
|
+
*
|
|
719
|
+
* Metadata only — the class is not constructed. Deploy's `hooks.manifest.json`
|
|
720
|
+
* needs exactly this and has no container to build with.
|
|
721
|
+
*/
|
|
722
|
+
declare function getHookManifest(ctor: object): {
|
|
723
|
+
blocking: string[];
|
|
724
|
+
listeners: string[];
|
|
725
|
+
};
|
|
681
726
|
|
|
682
727
|
interface RoomOptions {
|
|
683
728
|
/**
|
|
@@ -866,6 +911,14 @@ interface SignatureSpec {
|
|
|
866
911
|
timestampHeader?: string;
|
|
867
912
|
}
|
|
868
913
|
interface WebhookOptions {
|
|
914
|
+
/**
|
|
915
|
+
* The path segment this webhook is served at: `/webhooks/<name>`.
|
|
916
|
+
*
|
|
917
|
+
* DECLARED, not derived. It used to be the file's name, which put a PUBLIC
|
|
918
|
+
* URL — the one a sender is configured with — in the file system rather than
|
|
919
|
+
* beside the provider and the secret, where a reader looks for it.
|
|
920
|
+
*/
|
|
921
|
+
name: string;
|
|
869
922
|
provider?: WebhookProvider;
|
|
870
923
|
signature?: SignatureSpec;
|
|
871
924
|
/** Env-var REFERENCE for the signing secret — the platform never holds it. */
|
|
@@ -894,9 +947,74 @@ declare function On(event: string): (target: object, fnName: string | symbol) =>
|
|
|
894
947
|
*
|
|
895
948
|
* @throws when the class declares constructor parameters (FR-011) — nothing
|
|
896
949
|
* here supplies them, so the field would be `undefined` on every delivery. */
|
|
897
|
-
|
|
950
|
+
/**
|
|
951
|
+
* Everything a webhook DECLARES — provider or signature template, the secret's
|
|
952
|
+
* env var, and the event names — validated, without constructing the class.
|
|
953
|
+
*
|
|
954
|
+
* Same split as jobs and hooks: reading a declaration should not build an
|
|
955
|
+
* object. `getWebhookConfig` is what needs an instance, and it needs a
|
|
956
|
+
* container to get one.
|
|
957
|
+
*/
|
|
958
|
+
declare function getWebhookManifest(ctor: object): {
|
|
959
|
+
name: string;
|
|
960
|
+
provider: string | undefined;
|
|
961
|
+
secretEnv: string;
|
|
962
|
+
events: string[];
|
|
963
|
+
};
|
|
964
|
+
declare function getWebhookConfig(ctor: object, container: Container): ResolvedWebhook;
|
|
965
|
+
|
|
966
|
+
/**
|
|
967
|
+
* Marks a class the container can resolve.
|
|
968
|
+
*
|
|
969
|
+
* TWO JOBS, and the first one is why the decorator has to exist at all:
|
|
970
|
+
* TypeScript under `emitDecoratorMetadata` emits `design:paramtypes` for
|
|
971
|
+
* DECORATED classes only. Measured — an undecorated class with the same
|
|
972
|
+
* constructor carries no metadata, and `Reflect.getMetadata` answers
|
|
973
|
+
* `undefined`.
|
|
974
|
+
*
|
|
975
|
+
* The second is being COUNTABLE. Ownership, visibility and permission are still
|
|
976
|
+
* read from a single `@Module` and never from this decorator — recording the
|
|
977
|
+
* class here decides nothing. It only makes "carries `@Injectable()` and
|
|
978
|
+
* appears in no module" a question the build can ask, which FR-010 requires it
|
|
979
|
+
* to answer by name. The body was empty until 2026-09-02, and the consequence
|
|
980
|
+
* was measured through the CLI: an `@Injectable()` service in no module built
|
|
981
|
+
* clean, while this file's own comment claimed the build named it.
|
|
982
|
+
*/
|
|
983
|
+
declare function Injectable(): ClassDecorator;
|
|
984
|
+
/**
|
|
985
|
+
* TAKES the accumulated declarations — it does not read them.
|
|
986
|
+
*
|
|
987
|
+
* Same claim semantics as `__claimModules`, and for the same reason: a
|
|
988
|
+
* candidate bundle is imported into the SAME process as the live app it might
|
|
989
|
+
* replace, so reading would let a candidate be judged against the live app's
|
|
990
|
+
* classes and a discarded candidate would leave its own behind.
|
|
991
|
+
*/
|
|
992
|
+
declare function __claimInjectables(): Token[];
|
|
993
|
+
|
|
994
|
+
declare const jobsOf: (container: Container) => Token[];
|
|
995
|
+
declare const webhooksOf: (container: Container) => Token[];
|
|
996
|
+
/**
|
|
997
|
+
* A hook class carries handler entries and NO class-level marker, so it is
|
|
998
|
+
* recognised by having handlers while being neither a webhook nor a controller.
|
|
999
|
+
* `@On` is shared with `@Webhook`, which is why the webhook marker is what
|
|
1000
|
+
* separates them.
|
|
1001
|
+
*/
|
|
1002
|
+
declare const hooksOf: (container: Container) => Token[];
|
|
1003
|
+
declare const roomsOf: (container: Container) => Token[];
|
|
1004
|
+
declare const controllersOf: (container: Container) => Token[];
|
|
898
1005
|
|
|
899
1006
|
interface JobOptions {
|
|
1007
|
+
/**
|
|
1008
|
+
* The job's identity, and the name the scheduler holds its rows under.
|
|
1009
|
+
*
|
|
1010
|
+
* DECLARED, not derived. It used to be the file's name, which made the
|
|
1011
|
+
* identity a property of where the class sat — rename the file and the
|
|
1012
|
+
* scheduler starts a different job. Ownership and identity both come from a
|
|
1013
|
+
* declaration now, and this is where a reader looks for it.
|
|
1014
|
+
*
|
|
1015
|
+
* Lowercase, digits and dashes: it reaches a scheduler row and a log line.
|
|
1016
|
+
*/
|
|
1017
|
+
name: string;
|
|
900
1018
|
/** Cron expression, five fields (e.g. "0 3 * * *"). */
|
|
901
1019
|
schedule: string;
|
|
902
1020
|
/** Execution timeout in seconds. Defaults to 30, ceiling 300 (sandbox limit). */
|
|
@@ -913,12 +1031,40 @@ interface JobOptions {
|
|
|
913
1031
|
retry?: number;
|
|
914
1032
|
}
|
|
915
1033
|
interface ResolvedJob {
|
|
1034
|
+
/** The declared identity — the scheduler's row name. */
|
|
1035
|
+
name: string;
|
|
916
1036
|
schedule: string;
|
|
917
1037
|
timeout: number;
|
|
918
1038
|
retry: number;
|
|
919
1039
|
handler: (meta: JobMeta) => Promise<void>;
|
|
920
1040
|
}
|
|
921
1041
|
declare function Job(options: JobOptions): <T extends abstract new (...args: never[]) => object>(ctor: T) => T;
|
|
922
|
-
|
|
1042
|
+
/**
|
|
1043
|
+
* What a job DECLARES — schedule, timeout, retry. Reads metadata and nothing
|
|
1044
|
+
* else: the class is NOT constructed.
|
|
1045
|
+
*
|
|
1046
|
+
* Deploy's manifest script needs exactly this and no instance (stack_bundle.go
|
|
1047
|
+
* writes `jobs.manifest.json` from it, with no runtime and therefore no
|
|
1048
|
+
* container). Constructing a class to read a cron string was a side effect, and
|
|
1049
|
+
* it is the side effect that made the container look optional — which in turn
|
|
1050
|
+
* let a caller that never passes one compile quietly.
|
|
1051
|
+
*/
|
|
1052
|
+
interface JobManifest {
|
|
1053
|
+
name: string;
|
|
1054
|
+
schedule: string;
|
|
1055
|
+
timeout: number;
|
|
1056
|
+
retry: number;
|
|
1057
|
+
}
|
|
1058
|
+
declare function getJobManifest(ctor: object): JobManifest;
|
|
1059
|
+
/**
|
|
1060
|
+
* The job, ready to run — manifest plus a bound `run`.
|
|
1061
|
+
*
|
|
1062
|
+
* `container` is REQUIRED. It used to be absent (the class was built with
|
|
1063
|
+
* `new`), and then briefly optional, which is worse: an optional parameter lets
|
|
1064
|
+
* a caller that forgot it compile, and the job would receive `undefined` for
|
|
1065
|
+
* every dependency at its first scheduled run, hours after deploy, in a process
|
|
1066
|
+
* nobody is watching. Required makes the two runtime call sites a TYPE error.
|
|
1067
|
+
*/
|
|
1068
|
+
declare function getJobConfig(ctor: object, container: Container): ResolvedJob;
|
|
923
1069
|
|
|
924
|
-
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, OnAuthorize, OnEmpty, OnFirst, OnJoin, OnLeave, OnMessage, OptionalUser, PalbaseModuleError, PalbaseResult, Param, Patch, type PolicyJSON, Post, Put, Query, QueryParams, type RegisteredError, Req, RequestId, type RequestOptions, type ResolvedHookClass, type ResolvedJob, type ResolvedWebhook, Room, type RoomOptions, 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, resolveEffectiveAuth, toSchemaJSON };
|
|
1070
|
+
export { type AuthHookEvent, Body, type ChannelAuthorizeCtx, type ChannelEntry, type ChannelGrant, type ChannelsDef, type ChannelsInput, Client, type ColumnJSON, Container, Controller, type ControllerOptions, type DefinedError, type DefinedErrorWithData, Delete, Deny, type DocumentHookEvent, type FileDeletedEvent, type FileUploadedEvent, Get, Headers, Hook, type HookFn, type HookMeta, HttpError, Injectable, Job, type JobMeta, type JobOptions, type ModuleClientsConfig, type ModuleTransport, On, OnAuthorize, OnEmpty, OnFirst, OnJoin, OnLeave, OnMessage, OptionalUser, PalbaseModuleError, PalbaseResult, Param, Patch, PolicyExpr, type PolicyJSON, Post, Put, Query, QueryParams, type RegisteredError, Req, RequestId, type RequestOptions, type ResolvedHookClass, type ResolvedJob, type ResolvedWebhook, Room, type RoomOptions, RouteOptions, SchemaDef, type SchemaJSON, type SignatureSpec, type StackNames, type TableJSON, Token, TraceId, type TransportConfig, User, Webhook, type WebhookEventHandler, type WebhookMeta, type WebhookOptions, type WebhookProvider, type WebhookRequest, __claimInjectables, __resetDefaultAuth, __resetRegisteredControllers, assertZeroArgConstructor, buildModuleClients, controllersOf, defineChannels, defineDefaultAuth, defineError, getErrorRegistry, getHookConfig, getHookManifest, getJobConfig, getJobManifest, getRegisteredControllers, getWebhookConfig, getWebhookManifest, hooksOf, jobsOf, makeEnvDts, makeHttpClient, makeStackDts, ownerOnly, publicChannel, resolveEffectiveAuth, roomsOf, toSchemaJSON, webhooksOf };
|