@palbase/backend 25.1.0 → 27.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.
Files changed (104) hide show
  1. package/dist/bin/palbase-backend.cjs +2401 -1039
  2. package/dist/bin/palbase-backend.cjs.map +1 -1
  3. package/dist/bin/palbase-backend.js +87 -51
  4. package/dist/bin/palbase-backend.js.map +1 -1
  5. package/dist/chunk-CGNN2PUH.js +213 -0
  6. package/dist/chunk-CGNN2PUH.js.map +1 -0
  7. package/dist/chunk-DRZFQRJI.js +370 -0
  8. package/dist/chunk-DRZFQRJI.js.map +1 -0
  9. package/dist/chunk-GYK6QYS4.js +708 -0
  10. package/dist/chunk-GYK6QYS4.js.map +1 -0
  11. package/dist/chunk-I3C4PFIW.js +930 -0
  12. package/dist/chunk-I3C4PFIW.js.map +1 -0
  13. package/dist/{chunk-VDF2T4AS.js → chunk-OO7R25AI.js} +1213 -591
  14. package/dist/chunk-OO7R25AI.js.map +1 -0
  15. package/dist/chunk-TS4U7NBD.js +885 -0
  16. package/dist/chunk-TS4U7NBD.js.map +1 -0
  17. package/dist/{chunk-YOY5DFQS.js → chunk-TWX6JTGJ.js} +76 -34
  18. package/dist/{chunk-YOY5DFQS.js.map → chunk-TWX6JTGJ.js.map} +1 -1
  19. package/dist/{chunk-35PNTIRN.js → chunk-VVMJEVQP.js} +63 -162
  20. package/dist/chunk-VVMJEVQP.js.map +1 -0
  21. package/dist/{chunk-7D4SUZUM.js → chunk-VXPNPVAG.js} +3 -1
  22. package/dist/db/env.cjs.map +1 -1
  23. package/dist/db/env.d.cts +2 -2
  24. package/dist/db/env.d.ts +2 -2
  25. package/dist/db/index.cjs +754 -344
  26. package/dist/db/index.cjs.map +1 -1
  27. package/dist/db/index.d.cts +2 -2
  28. package/dist/db/index.d.ts +2 -2
  29. package/dist/db/index.js +7 -4
  30. package/dist/engine/index.cjs +2339 -1006
  31. package/dist/engine/index.cjs.map +1 -1
  32. package/dist/engine/index.d.cts +6 -6
  33. package/dist/engine/index.d.ts +6 -6
  34. package/dist/engine/index.js +7 -6
  35. package/dist/index-BrvvxSpn.d.ts +4844 -0
  36. package/dist/index-Bve7BBTL.d.cts +4844 -0
  37. package/dist/{index-CUomTA3e.d.ts → index-NuzRCuxe.d.ts} +171 -296
  38. package/dist/{index-ClpDeSos.d.cts → index-VtToZmUm.d.cts} +171 -296
  39. package/dist/index.cjs +2694 -1169
  40. package/dist/index.cjs.map +1 -1
  41. package/dist/index.d.cts +165 -19
  42. package/dist/index.d.ts +165 -19
  43. package/dist/index.js +738 -477
  44. package/dist/index.js.map +1 -1
  45. package/dist/module-Dl1KFVtc.d.cts +54 -0
  46. package/dist/module-Dl1KFVtc.d.ts +54 -0
  47. package/dist/openapi/index.cjs +1330 -484
  48. package/dist/openapi/index.cjs.map +1 -1
  49. package/dist/openapi/index.d.cts +4 -2
  50. package/dist/openapi/index.d.ts +4 -2
  51. package/dist/openapi/index.js +1264 -474
  52. package/dist/openapi/index.js.map +1 -1
  53. package/dist/{registry-dZZ5JKYg.d.ts → registry-B0eyOF9x.d.ts} +1 -1
  54. package/dist/{registry-CC0WBQq6.d.cts → registry-Bk9_rbNd.d.cts} +1 -1
  55. package/dist/stack.cjs.map +1 -1
  56. package/dist/test/index.cjs +705 -141
  57. package/dist/test/index.cjs.map +1 -1
  58. package/dist/test/index.d.cts +30 -4
  59. package/dist/test/index.d.ts +30 -4
  60. package/dist/test/index.js +472 -124
  61. package/dist/test/index.js.map +1 -1
  62. package/docs/README.md +33 -18
  63. package/docs/auth.md +1 -1
  64. package/docs/background.md +2 -2
  65. package/docs/database.md +221 -50
  66. package/docs/endpoints.md +3 -4
  67. package/docs/events.md +3 -3
  68. package/docs/getting-started.md +1 -1
  69. package/docs/llms-full.txt +401 -117
  70. package/docs/migrations.md +2 -2
  71. package/docs/schema.md +19 -10
  72. package/docs/services.md +116 -26
  73. package/package.json +8 -4
  74. package/stager/generics.js +205 -0
  75. package/stager/stage.js +39 -3
  76. package/template/AGENTS.md +110 -72
  77. package/template/db/public.ts +1 -1
  78. package/template/{controllers → modules/health}/health.controller.ts +1 -1
  79. package/template/modules/health/health.module.ts +24 -0
  80. package/template/modules/notes/note.service.test.ts +49 -0
  81. package/template/modules/notes/note.service.ts +108 -0
  82. package/template/{controllers → modules/notes}/notes.controller.ts +17 -11
  83. package/template/modules/notes/notes.module.ts +37 -0
  84. package/template/package.json +5 -3
  85. package/template/scripts/test.sh +33 -0
  86. package/template/tsconfig.json +29 -30
  87. package/dist/chunk-35PNTIRN.js.map +0 -1
  88. package/dist/chunk-CJSKYY76.js +0 -627
  89. package/dist/chunk-CJSKYY76.js.map +0 -1
  90. package/dist/chunk-CRQKCRGF.js +0 -276
  91. package/dist/chunk-CRQKCRGF.js.map +0 -1
  92. package/dist/chunk-G4R6BTLV.js +0 -662
  93. package/dist/chunk-G4R6BTLV.js.map +0 -1
  94. package/dist/chunk-VDF2T4AS.js.map +0 -1
  95. package/dist/chunk-XABBC7JP.js +0 -55
  96. package/dist/chunk-XABBC7JP.js.map +0 -1
  97. package/dist/endpoint-CTEHhb7A.d.ts +0 -2386
  98. package/dist/endpoint-DYHMo6cC.d.cts +0 -2386
  99. package/dist/index-CW21M9Z3.d.ts +0 -1222
  100. package/dist/index-CmBK76nx.d.cts +0 -1222
  101. package/template/services/note.service.test.ts +0 -45
  102. package/template/services/note.service.ts +0 -76
  103. /package/dist/{chunk-7D4SUZUM.js.map → chunk-VXPNPVAG.js.map} +0 -0
  104. /package/template/{models/notes → modules/notes/dto}/create.ts +0 -0
package/dist/index.d.cts CHANGED
@@ -1,15 +1,15 @@
1
- import { h as PalbaseResult, A as AuthSpec, H as HttpError } from './endpoint-DYHMo6cC.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-DYHMo6cC.cjs';
3
- import { M as ModuleClients } from './index-ClpDeSos.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-ClpDeSos.cjs';
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-Bve7BBTL.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-Bve7BBTL.cjs';
3
+ import { M as ModuleClients, C as Container } from './index-VtToZmUm.cjs';
4
+ export { D as DiError, a as DiKind, b as ModulePressure, c as assertNoOrphanEntryPoints, d as buildContainer } from './index-VtToZmUm.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-CC0WBQq6.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-CC0WBQq6.cjs';
7
+ import { a as RouteOptions } from './registry-Bk9_rbNd.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-Bk9_rbNd.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
- using: string | null;
159
- withCheck: string | null;
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
- name: string;
192
- columns: string[];
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.tables.<name>` is typed with no import and no generic.
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
- declare function getWebhookConfig(ctor: object): ResolvedWebhook;
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
- declare function getJobConfig(ctor: object): ResolvedJob;
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 { h as PalbaseResult, A as AuthSpec, H as HttpError } from './endpoint-CTEHhb7A.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-CTEHhb7A.js';
3
- import { M as ModuleClients } from './index-CUomTA3e.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-CUomTA3e.js';
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-BrvvxSpn.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-BrvvxSpn.js';
3
+ import { M as ModuleClients, C as Container } from './index-NuzRCuxe.js';
4
+ export { D as DiError, a as DiKind, b as ModulePressure, c as assertNoOrphanEntryPoints, d as buildContainer } from './index-NuzRCuxe.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-dZZ5JKYg.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-dZZ5JKYg.js';
7
+ import { a as RouteOptions } from './registry-B0eyOF9x.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-B0eyOF9x.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
- using: string | null;
159
- withCheck: string | null;
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
- name: string;
192
- columns: string[];
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.tables.<name>` is typed with no import and no generic.
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
- declare function getWebhookConfig(ctor: object): ResolvedWebhook;
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
- declare function getJobConfig(ctor: object): ResolvedJob;
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 };