alepha 0.14.4 → 0.15.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/README.md +1 -4
- package/dist/api/audits/index.d.ts +619 -731
- package/dist/api/audits/index.d.ts.map +1 -1
- package/dist/api/files/index.d.ts +185 -298
- package/dist/api/files/index.d.ts.map +1 -1
- package/dist/api/files/index.js +0 -1
- package/dist/api/files/index.js.map +1 -1
- package/dist/api/jobs/index.d.ts +245 -356
- package/dist/api/jobs/index.d.ts.map +1 -1
- package/dist/api/notifications/index.d.ts +238 -350
- package/dist/api/notifications/index.d.ts.map +1 -1
- package/dist/api/parameters/index.d.ts +499 -611
- package/dist/api/parameters/index.d.ts.map +1 -1
- package/dist/api/users/index.browser.js +1 -2
- package/dist/api/users/index.browser.js.map +1 -1
- package/dist/api/users/index.d.ts +1697 -1804
- package/dist/api/users/index.d.ts.map +1 -1
- package/dist/api/users/index.js +178 -151
- package/dist/api/users/index.js.map +1 -1
- package/dist/api/verifications/index.d.ts +132 -132
- package/dist/api/verifications/index.d.ts.map +1 -1
- package/dist/batch/index.d.ts +122 -122
- package/dist/batch/index.d.ts.map +1 -1
- package/dist/batch/index.js +1 -2
- package/dist/batch/index.js.map +1 -1
- package/dist/bucket/index.d.ts +163 -163
- package/dist/bucket/index.d.ts.map +1 -1
- package/dist/cache/core/index.d.ts +46 -46
- package/dist/cache/core/index.d.ts.map +1 -1
- package/dist/cache/redis/index.d.ts.map +1 -1
- package/dist/cli/index.d.ts +302 -299
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +966 -564
- package/dist/cli/index.js.map +1 -1
- package/dist/command/index.d.ts +303 -299
- package/dist/command/index.d.ts.map +1 -1
- package/dist/command/index.js +11 -7
- package/dist/command/index.js.map +1 -1
- package/dist/core/index.browser.js +419 -99
- package/dist/core/index.browser.js.map +1 -1
- package/dist/core/index.d.ts +718 -625
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +420 -99
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.native.js +419 -99
- package/dist/core/index.native.js.map +1 -1
- package/dist/datetime/index.d.ts +44 -44
- package/dist/datetime/index.d.ts.map +1 -1
- package/dist/datetime/index.js +4 -4
- package/dist/datetime/index.js.map +1 -1
- package/dist/email/index.d.ts +97 -50
- package/dist/email/index.d.ts.map +1 -1
- package/dist/email/index.js +129 -33
- package/dist/email/index.js.map +1 -1
- package/dist/fake/index.d.ts +7981 -14
- package/dist/fake/index.d.ts.map +1 -1
- package/dist/file/index.d.ts +523 -390
- package/dist/file/index.d.ts.map +1 -1
- package/dist/file/index.js +253 -1
- package/dist/file/index.js.map +1 -1
- package/dist/lock/core/index.d.ts +208 -208
- package/dist/lock/core/index.d.ts.map +1 -1
- package/dist/lock/redis/index.d.ts.map +1 -1
- package/dist/logger/index.d.ts +25 -26
- package/dist/logger/index.d.ts.map +1 -1
- package/dist/mcp/index.d.ts +197 -197
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/orm/chunk-DtkW-qnP.js +38 -0
- package/dist/orm/index.browser.js.map +1 -1
- package/dist/orm/index.bun.js +2814 -0
- package/dist/orm/index.bun.js.map +1 -0
- package/dist/orm/index.d.ts +1205 -1057
- package/dist/orm/index.d.ts.map +1 -1
- package/dist/orm/index.js +2056 -1753
- package/dist/orm/index.js.map +1 -1
- package/dist/queue/core/index.d.ts +248 -248
- package/dist/queue/core/index.d.ts.map +1 -1
- package/dist/queue/redis/index.d.ts.map +1 -1
- package/dist/redis/index.bun.js +285 -0
- package/dist/redis/index.bun.js.map +1 -0
- package/dist/redis/index.d.ts +118 -136
- package/dist/redis/index.d.ts.map +1 -1
- package/dist/redis/index.js +18 -38
- package/dist/redis/index.js.map +1 -1
- package/dist/retry/index.d.ts +69 -69
- package/dist/retry/index.d.ts.map +1 -1
- package/dist/router/index.d.ts +6 -6
- package/dist/router/index.d.ts.map +1 -1
- package/dist/scheduler/index.d.ts +25 -25
- package/dist/scheduler/index.d.ts.map +1 -1
- package/dist/security/index.browser.js +5 -1
- package/dist/security/index.browser.js.map +1 -1
- package/dist/security/index.d.ts +417 -254
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/index.js +386 -86
- package/dist/security/index.js.map +1 -1
- package/dist/server/auth/index.d.ts +277 -277
- package/dist/server/auth/index.d.ts.map +1 -1
- package/dist/server/auth/index.js +20 -20
- package/dist/server/auth/index.js.map +1 -1
- package/dist/server/cache/index.d.ts +60 -57
- package/dist/server/cache/index.d.ts.map +1 -1
- package/dist/server/cache/index.js +1 -1
- package/dist/server/cache/index.js.map +1 -1
- package/dist/server/compress/index.d.ts +3 -3
- package/dist/server/compress/index.d.ts.map +1 -1
- package/dist/server/cookies/index.d.ts +6 -6
- package/dist/server/cookies/index.d.ts.map +1 -1
- package/dist/server/cookies/index.js +3 -3
- package/dist/server/cookies/index.js.map +1 -1
- package/dist/server/core/index.d.ts +242 -150
- package/dist/server/core/index.d.ts.map +1 -1
- package/dist/server/core/index.js +288 -122
- package/dist/server/core/index.js.map +1 -1
- package/dist/server/cors/index.d.ts +11 -12
- package/dist/server/cors/index.d.ts.map +1 -1
- package/dist/server/health/index.d.ts +0 -1
- package/dist/server/health/index.d.ts.map +1 -1
- package/dist/server/helmet/index.d.ts +2 -2
- package/dist/server/helmet/index.d.ts.map +1 -1
- package/dist/server/links/index.browser.js.map +1 -1
- package/dist/server/links/index.d.ts +84 -85
- package/dist/server/links/index.d.ts.map +1 -1
- package/dist/server/links/index.js +1 -2
- package/dist/server/links/index.js.map +1 -1
- package/dist/server/metrics/index.d.ts.map +1 -1
- package/dist/server/multipart/index.d.ts +6 -6
- package/dist/server/multipart/index.d.ts.map +1 -1
- package/dist/server/proxy/index.d.ts +102 -103
- package/dist/server/proxy/index.d.ts.map +1 -1
- package/dist/server/rate-limit/index.d.ts +16 -16
- package/dist/server/rate-limit/index.d.ts.map +1 -1
- package/dist/server/static/index.d.ts +44 -44
- package/dist/server/static/index.d.ts.map +1 -1
- package/dist/server/swagger/index.d.ts +48 -49
- package/dist/server/swagger/index.d.ts.map +1 -1
- package/dist/server/swagger/index.js +1 -2
- package/dist/server/swagger/index.js.map +1 -1
- package/dist/sms/index.d.ts +13 -11
- package/dist/sms/index.d.ts.map +1 -1
- package/dist/sms/index.js +7 -7
- package/dist/sms/index.js.map +1 -1
- package/dist/thread/index.d.ts +71 -72
- package/dist/thread/index.d.ts.map +1 -1
- package/dist/topic/core/index.d.ts +318 -318
- package/dist/topic/core/index.d.ts.map +1 -1
- package/dist/topic/redis/index.d.ts +6 -6
- package/dist/topic/redis/index.d.ts.map +1 -1
- package/dist/vite/index.d.ts +5720 -159
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +41 -18
- package/dist/vite/index.js.map +1 -1
- package/dist/websocket/index.browser.js +6 -6
- package/dist/websocket/index.browser.js.map +1 -1
- package/dist/websocket/index.d.ts +247 -247
- package/dist/websocket/index.d.ts.map +1 -1
- package/dist/websocket/index.js +6 -6
- package/dist/websocket/index.js.map +1 -1
- package/package.json +9 -14
- package/src/api/files/controllers/AdminFileStatsController.ts +0 -1
- package/src/api/users/atoms/realmAuthSettingsAtom.ts +5 -0
- package/src/api/users/controllers/{UserRealmController.ts → RealmController.ts} +11 -11
- package/src/api/users/entities/users.ts +1 -1
- package/src/api/users/index.ts +8 -8
- package/src/api/users/primitives/{$userRealm.ts → $realm.ts} +17 -19
- package/src/api/users/providers/{UserRealmProvider.ts → RealmProvider.ts} +26 -30
- package/src/api/users/schemas/{userRealmConfigSchema.ts → realmConfigSchema.ts} +2 -2
- package/src/api/users/services/CredentialService.ts +7 -7
- package/src/api/users/services/IdentityService.ts +4 -4
- package/src/api/users/services/RegistrationService.spec.ts +25 -27
- package/src/api/users/services/RegistrationService.ts +38 -27
- package/src/api/users/services/SessionCrudService.ts +3 -3
- package/src/api/users/services/SessionService.spec.ts +3 -3
- package/src/api/users/services/SessionService.ts +28 -9
- package/src/api/users/services/UserService.ts +7 -7
- package/src/batch/providers/BatchProvider.ts +1 -2
- package/src/cli/apps/AlephaPackageBuilderCli.ts +38 -19
- package/src/cli/assets/apiHelloControllerTs.ts +18 -0
- package/src/cli/assets/apiIndexTs.ts +16 -0
- package/src/cli/assets/claudeMd.ts +303 -0
- package/src/cli/assets/mainBrowserTs.ts +2 -2
- package/src/cli/assets/mainServerTs.ts +24 -0
- package/src/cli/assets/webAppRouterTs.ts +15 -0
- package/src/cli/assets/webHelloComponentTsx.ts +16 -0
- package/src/cli/assets/webIndexTs.ts +16 -0
- package/src/cli/commands/build.ts +41 -21
- package/src/cli/commands/db.ts +21 -18
- package/src/cli/commands/deploy.ts +17 -5
- package/src/cli/commands/dev.ts +13 -17
- package/src/cli/commands/format.ts +8 -2
- package/src/cli/commands/init.ts +74 -29
- package/src/cli/commands/lint.ts +8 -2
- package/src/cli/commands/test.ts +8 -2
- package/src/cli/commands/typecheck.ts +5 -1
- package/src/cli/commands/verify.ts +4 -2
- package/src/cli/services/AlephaCliUtils.ts +39 -600
- package/src/cli/services/PackageManagerUtils.ts +301 -0
- package/src/cli/services/ProjectScaffolder.ts +306 -0
- package/src/command/helpers/Runner.ts +15 -3
- package/src/core/__tests__/Alepha-graph.spec.ts +4 -0
- package/src/core/index.shared.ts +1 -0
- package/src/core/index.ts +2 -0
- package/src/core/primitives/$hook.ts +6 -2
- package/src/core/primitives/$module.spec.ts +4 -0
- package/src/core/providers/AlsProvider.ts +1 -1
- package/src/core/providers/CodecManager.spec.ts +12 -6
- package/src/core/providers/CodecManager.ts +26 -6
- package/src/core/providers/EventManager.ts +169 -13
- package/src/core/providers/KeylessJsonSchemaCodec.spec.ts +621 -0
- package/src/core/providers/KeylessJsonSchemaCodec.ts +407 -0
- package/src/core/providers/StateManager.spec.ts +27 -16
- package/src/email/providers/LocalEmailProvider.spec.ts +111 -87
- package/src/email/providers/LocalEmailProvider.ts +52 -15
- package/src/email/providers/NodemailerEmailProvider.ts +167 -56
- package/src/file/errors/FileError.ts +7 -0
- package/src/file/index.ts +9 -1
- package/src/file/providers/MemoryFileSystemProvider.ts +393 -0
- package/src/orm/index.browser.ts +1 -19
- package/src/orm/index.bun.ts +77 -0
- package/src/orm/index.shared-server.ts +22 -0
- package/src/orm/index.shared.ts +15 -0
- package/src/orm/index.ts +19 -39
- package/src/orm/providers/drivers/BunPostgresProvider.ts +3 -5
- package/src/orm/providers/drivers/BunSqliteProvider.ts +1 -1
- package/src/orm/providers/drivers/CloudflareD1Provider.ts +4 -0
- package/src/orm/providers/drivers/DatabaseProvider.ts +4 -0
- package/src/orm/providers/drivers/PglitePostgresProvider.ts +4 -0
- package/src/orm/services/Repository.ts +8 -0
- package/src/redis/index.bun.ts +35 -0
- package/src/redis/providers/BunRedisProvider.ts +12 -43
- package/src/redis/providers/BunRedisSubscriberProvider.ts +2 -3
- package/src/redis/providers/NodeRedisProvider.ts +16 -34
- package/src/{server/security → security}/__tests__/BasicAuth.spec.ts +11 -11
- package/src/{server/security → security}/__tests__/ServerSecurityProvider-realm.spec.ts +21 -16
- package/src/{server/security/providers → security/__tests__}/ServerSecurityProvider.spec.ts +5 -5
- package/src/security/index.browser.ts +5 -0
- package/src/security/index.ts +90 -7
- package/src/security/primitives/{$realm.spec.ts → $issuer.spec.ts} +11 -11
- package/src/security/primitives/{$realm.ts → $issuer.ts} +20 -17
- package/src/security/primitives/$role.ts +5 -5
- package/src/security/primitives/$serviceAccount.spec.ts +5 -5
- package/src/security/primitives/$serviceAccount.ts +3 -3
- package/src/{server/security → security}/providers/ServerSecurityProvider.ts +5 -7
- package/src/server/auth/primitives/$auth.ts +10 -10
- package/src/server/auth/primitives/$authCredentials.ts +3 -3
- package/src/server/auth/primitives/$authGithub.ts +3 -3
- package/src/server/auth/primitives/$authGoogle.ts +3 -3
- package/src/server/auth/providers/ServerAuthProvider.ts +13 -13
- package/src/server/cache/providers/ServerCacheProvider.ts +1 -1
- package/src/server/cookies/providers/ServerCookiesProvider.ts +3 -3
- package/src/server/core/providers/NodeHttpServerProvider.ts +25 -6
- package/src/server/core/providers/ServerBodyParserProvider.ts +19 -23
- package/src/server/core/providers/ServerLoggerProvider.ts +23 -19
- package/src/server/core/providers/ServerProvider.ts +144 -21
- package/src/server/core/providers/ServerRouterProvider.ts +259 -115
- package/src/server/core/providers/ServerTimingProvider.ts +2 -2
- package/src/server/links/index.ts +1 -1
- package/src/server/links/providers/LinkProvider.ts +1 -1
- package/src/server/swagger/index.ts +1 -1
- package/src/sms/providers/LocalSmsProvider.spec.ts +153 -111
- package/src/sms/providers/LocalSmsProvider.ts +8 -7
- package/src/vite/helpers/boot.ts +28 -17
- package/src/vite/tasks/buildServer.ts +12 -1
- package/src/vite/tasks/devServer.ts +3 -1
- package/src/vite/tasks/generateCloudflare.ts +7 -0
- package/dist/server/security/index.browser.js +0 -13
- package/dist/server/security/index.browser.js.map +0 -1
- package/dist/server/security/index.d.ts +0 -173
- package/dist/server/security/index.d.ts.map +0 -1
- package/dist/server/security/index.js +0 -311
- package/dist/server/security/index.js.map +0 -1
- package/src/cli/assets/appRouterTs.ts +0 -9
- package/src/cli/assets/mainTs.ts +0 -13
- package/src/server/security/index.browser.ts +0 -10
- package/src/server/security/index.ts +0 -94
- /package/src/{server/security → security}/primitives/$basicAuth.ts +0 -0
- /package/src/{server/security → security}/providers/ServerBasicAuthProvider.ts +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as alepha624 from "alepha";
|
|
2
2
|
import { KIND, Primitive, Static, TNull, TObject, TOptional, TSchema, TUnion } from "alepha";
|
|
3
3
|
import * as alepha_server0 from "alepha/server";
|
|
4
4
|
import { DateTimeProvider } from "alepha/datetime";
|
|
5
5
|
import * as alepha_logger0 from "alepha/logger";
|
|
6
|
-
import * as
|
|
6
|
+
import * as alepha_orm0 from "alepha/orm";
|
|
7
7
|
import * as alepha_topic0 from "alepha/topic";
|
|
8
8
|
import * as alepha_scheduler0 from "alepha/scheduler";
|
|
9
9
|
import "drizzle-orm/d1";
|
|
@@ -12,16 +12,13 @@ import { PgColumnBuilderBase, PgSequenceOptions, PgTableExtraConfigValue, Update
|
|
|
12
12
|
import "alepha/retry";
|
|
13
13
|
import * as typebox0 from "typebox";
|
|
14
14
|
import "drizzle-orm/sqlite-core";
|
|
15
|
-
import "alepha/lock";
|
|
16
|
-
import "drizzle-orm/postgres-js";
|
|
17
|
-
import "postgres";
|
|
18
15
|
import { UserAccount } from "alepha/security";
|
|
19
16
|
|
|
20
17
|
//#region ../../src/api/parameters/schemas/parameterStatusSchema.d.ts
|
|
21
18
|
/**
|
|
22
19
|
* Parameter status enum schema.
|
|
23
20
|
*/
|
|
24
|
-
declare const parameterStatusSchema:
|
|
21
|
+
declare const parameterStatusSchema: alepha624.TUnsafe<"expired" | "current" | "next" | "future">;
|
|
25
22
|
type ParameterStatus = Static<typeof parameterStatusSchema>;
|
|
26
23
|
//#endregion
|
|
27
24
|
//#region ../../src/api/parameters/entities/parameters.d.ts
|
|
@@ -34,67 +31,67 @@ type ParameterStatus = Static<typeof parameterStatusSchema>;
|
|
|
34
31
|
* - Activation scheduling
|
|
35
32
|
* - Audit trail (creator info)
|
|
36
33
|
*/
|
|
37
|
-
declare const parameters:
|
|
38
|
-
id:
|
|
39
|
-
createdAt:
|
|
40
|
-
updatedAt:
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
name:
|
|
46
|
-
/**
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
content:
|
|
50
|
-
/**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
schemaHash:
|
|
55
|
-
/**
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
status:
|
|
59
|
-
/**
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
activationDate:
|
|
64
|
-
/**
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
expiredAt:
|
|
69
|
-
/**
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
version:
|
|
74
|
-
/**
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
changeDescription:
|
|
78
|
-
/**
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
tags:
|
|
82
|
-
/**
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
creatorId:
|
|
86
|
-
/**
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
creatorName:
|
|
90
|
-
/**
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
previousContent:
|
|
94
|
-
/**
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
migrationLog:
|
|
34
|
+
declare const parameters: alepha_orm0.EntityPrimitive<alepha624.TObject<{
|
|
35
|
+
id: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha624.TString, typeof alepha_orm0.PG_PRIMARY_KEY>, typeof alepha_orm0.PG_DEFAULT>;
|
|
36
|
+
createdAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha624.TString, typeof alepha_orm0.PG_CREATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
|
|
37
|
+
updatedAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha624.TString, typeof alepha_orm0.PG_UPDATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
|
|
38
|
+
/**
|
|
39
|
+
* Configuration name using dot notation for tree hierarchy.
|
|
40
|
+
* Examples: "app.features", "app.pricing.tiers", "system.limits"
|
|
41
|
+
*/
|
|
42
|
+
name: alepha624.TString;
|
|
43
|
+
/**
|
|
44
|
+
* The configuration content as JSON.
|
|
45
|
+
*/
|
|
46
|
+
content: alepha624.TRecord<string, alepha624.TAny>;
|
|
47
|
+
/**
|
|
48
|
+
* Schema version hash for detecting schema changes.
|
|
49
|
+
* Used for auto-migration when schema evolves.
|
|
50
|
+
*/
|
|
51
|
+
schemaHash: alepha624.TString;
|
|
52
|
+
/**
|
|
53
|
+
* Current status of this parameter version.
|
|
54
|
+
*/
|
|
55
|
+
status: alepha_orm0.PgAttr<alepha624.TUnsafe<"expired" | "current" | "next" | "future">, typeof alepha_orm0.PG_DEFAULT>;
|
|
56
|
+
/**
|
|
57
|
+
* When this version should become active.
|
|
58
|
+
* Default is immediate (now).
|
|
59
|
+
*/
|
|
60
|
+
activationDate: alepha624.TString;
|
|
61
|
+
/**
|
|
62
|
+
* When this version was deactivated (became expired).
|
|
63
|
+
* Null if still active or scheduled.
|
|
64
|
+
*/
|
|
65
|
+
expiredAt: alepha624.TOptional<alepha624.TString>;
|
|
66
|
+
/**
|
|
67
|
+
* Version number for this configuration.
|
|
68
|
+
* Auto-incremented per config name.
|
|
69
|
+
*/
|
|
70
|
+
version: alepha624.TInteger;
|
|
71
|
+
/**
|
|
72
|
+
* Optional description of changes in this version.
|
|
73
|
+
*/
|
|
74
|
+
changeDescription: alepha624.TOptional<alepha624.TString>;
|
|
75
|
+
/**
|
|
76
|
+
* Optional tags for filtering/categorization.
|
|
77
|
+
*/
|
|
78
|
+
tags: alepha624.TOptional<alepha624.TArray<alepha624.TString>>;
|
|
79
|
+
/**
|
|
80
|
+
* Creator user ID (if available).
|
|
81
|
+
*/
|
|
82
|
+
creatorId: alepha624.TOptional<alepha624.TString>;
|
|
83
|
+
/**
|
|
84
|
+
* Creator display name for audit trail.
|
|
85
|
+
*/
|
|
86
|
+
creatorName: alepha624.TOptional<alepha624.TString>;
|
|
87
|
+
/**
|
|
88
|
+
* Previous content before this change (for rollback reference).
|
|
89
|
+
*/
|
|
90
|
+
previousContent: alepha624.TOptional<alepha624.TRecord<string, alepha624.TAny>>;
|
|
91
|
+
/**
|
|
92
|
+
* Migration log if schema changed.
|
|
93
|
+
*/
|
|
94
|
+
migrationLog: alepha624.TOptional<alepha624.TString>;
|
|
98
95
|
}>>;
|
|
99
96
|
type Parameter = Static<typeof parameters.schema>;
|
|
100
97
|
type ParameterInsert = Omit<Parameter, "id" | "createdAt" | "updatedAt">;
|
|
@@ -129,114 +126,114 @@ type TObjectUpdate<T extends TObject> = TObject<{ [K in keyof T["properties"]]:
|
|
|
129
126
|
//#region ../../src/orm/primitives/$entity.d.ts
|
|
130
127
|
interface EntityPrimitiveOptions<T extends TObject, Keys = keyof Static<T>> {
|
|
131
128
|
/**
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
129
|
+
* The database table name that will be created for this entity.
|
|
130
|
+
* If not provided, name will be inferred from the $repository variable name.
|
|
131
|
+
*/
|
|
135
132
|
name: string;
|
|
136
133
|
/**
|
|
137
|
-
|
|
138
|
-
|
|
134
|
+
* TypeBox schema defining the table structure and column types.
|
|
135
|
+
*/
|
|
139
136
|
schema: T;
|
|
140
137
|
/**
|
|
141
|
-
|
|
142
|
-
|
|
138
|
+
* Database indexes to create for query optimization.
|
|
139
|
+
*/
|
|
143
140
|
indexes?: (Keys | {
|
|
144
141
|
/**
|
|
145
|
-
|
|
146
|
-
|
|
142
|
+
* Single column to index.
|
|
143
|
+
*/
|
|
147
144
|
column: Keys;
|
|
148
145
|
/**
|
|
149
|
-
|
|
150
|
-
|
|
146
|
+
* Whether this should be a unique index (enforces uniqueness constraint).
|
|
147
|
+
*/
|
|
151
148
|
unique?: boolean;
|
|
152
149
|
/**
|
|
153
|
-
|
|
154
|
-
|
|
150
|
+
* Custom name for the index. If not provided, generates name automatically.
|
|
151
|
+
*/
|
|
155
152
|
name?: string;
|
|
156
153
|
} | {
|
|
157
154
|
/**
|
|
158
|
-
|
|
159
|
-
|
|
155
|
+
* Multiple columns for composite index (order matters for query optimization).
|
|
156
|
+
*/
|
|
160
157
|
columns: Keys[];
|
|
161
158
|
/**
|
|
162
|
-
|
|
163
|
-
|
|
159
|
+
* Whether this should be a unique index (enforces uniqueness constraint).
|
|
160
|
+
*/
|
|
164
161
|
unique?: boolean;
|
|
165
162
|
/**
|
|
166
|
-
|
|
167
|
-
|
|
163
|
+
* Custom name for the index. If not provided, generates name automatically.
|
|
164
|
+
*/
|
|
168
165
|
name?: string;
|
|
169
166
|
})[];
|
|
170
167
|
/**
|
|
171
|
-
|
|
172
|
-
|
|
168
|
+
* Foreign key constraints to maintain referential integrity.
|
|
169
|
+
*/
|
|
173
170
|
foreignKeys?: Array<{
|
|
174
171
|
/**
|
|
175
|
-
|
|
176
|
-
|
|
172
|
+
* Optional name for the foreign key constraint.
|
|
173
|
+
*/
|
|
177
174
|
name?: string;
|
|
178
175
|
/**
|
|
179
|
-
|
|
180
|
-
|
|
176
|
+
* Local columns that reference the foreign table.
|
|
177
|
+
*/
|
|
181
178
|
columns: Array<keyof Static<T>>;
|
|
182
179
|
/**
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
180
|
+
* Referenced columns in the foreign table.
|
|
181
|
+
* Must be EntityColumn references from other entities.
|
|
182
|
+
*/
|
|
186
183
|
foreignColumns: Array<() => EntityColumn<any>>;
|
|
187
184
|
}>;
|
|
188
185
|
/**
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
186
|
+
* Additional table constraints for data validation.
|
|
187
|
+
*
|
|
188
|
+
* Constraints enforce business rules at the database level, providing
|
|
189
|
+
* an additional layer of data integrity beyond application validation.
|
|
190
|
+
*
|
|
191
|
+
* **Constraint Types**:
|
|
192
|
+
* - **Unique constraints**: Prevent duplicate values across columns
|
|
193
|
+
* - **Check constraints**: Enforce custom validation rules with SQL expressions
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* ```ts
|
|
197
|
+
* constraints: [
|
|
198
|
+
* {
|
|
199
|
+
* name: "unique_user_email",
|
|
200
|
+
* columns: ["email"],
|
|
201
|
+
* unique: true
|
|
202
|
+
* },
|
|
203
|
+
* {
|
|
204
|
+
* name: "valid_age_range",
|
|
205
|
+
* columns: ["age"],
|
|
206
|
+
* check: sql`age >= 0 AND age <= 150`
|
|
207
|
+
* },
|
|
208
|
+
* {
|
|
209
|
+
* name: "unique_user_username_per_tenant",
|
|
210
|
+
* columns: ["tenantId", "username"],
|
|
211
|
+
* unique: true
|
|
212
|
+
* }
|
|
213
|
+
* ]
|
|
214
|
+
* ```
|
|
215
|
+
*/
|
|
219
216
|
constraints?: Array<{
|
|
220
217
|
/**
|
|
221
|
-
|
|
222
|
-
|
|
218
|
+
* Columns involved in this constraint.
|
|
219
|
+
*/
|
|
223
220
|
columns: Array<keyof Static<T>>;
|
|
224
221
|
/**
|
|
225
|
-
|
|
226
|
-
|
|
222
|
+
* Optional name for the constraint.
|
|
223
|
+
*/
|
|
227
224
|
name?: string;
|
|
228
225
|
/**
|
|
229
|
-
|
|
230
|
-
|
|
226
|
+
* Whether this is a unique constraint.
|
|
227
|
+
*/
|
|
231
228
|
unique?: boolean | {};
|
|
232
229
|
/**
|
|
233
|
-
|
|
234
|
-
|
|
230
|
+
* SQL expression for check constraint validation.
|
|
231
|
+
*/
|
|
235
232
|
check?: SQL;
|
|
236
233
|
}>;
|
|
237
234
|
/**
|
|
238
|
-
|
|
239
|
-
|
|
235
|
+
* Advanced Drizzle ORM configuration for complex table setups.
|
|
236
|
+
*/
|
|
240
237
|
config?: (self: BuildExtraConfigColumns<string, FromSchema<T>, "pg">) => PgTableExtraConfigValue[];
|
|
241
238
|
}
|
|
242
239
|
declare class EntityPrimitive<T extends TObject = TObject> {
|
|
@@ -284,8 +281,8 @@ type PgSymbols = {
|
|
|
284
281
|
[PG_REF]: PgRefOptions;
|
|
285
282
|
[PG_ENUM]: PgEnumOptions;
|
|
286
283
|
/**
|
|
287
|
-
|
|
288
|
-
|
|
284
|
+
* @deprecated Use `PG_IDENTITY` instead.
|
|
285
|
+
*/
|
|
289
286
|
[PG_SERIAL]: {};
|
|
290
287
|
};
|
|
291
288
|
type PgSymbolKeys = keyof PgSymbols;
|
|
@@ -315,115 +312,6 @@ interface PgRefOptions {
|
|
|
315
312
|
*/
|
|
316
313
|
type PgAttr<T extends TSchema, TAttr extends PgSymbolKeys> = T & { [K in TAttr]: PgSymbols[K] };
|
|
317
314
|
//#endregion
|
|
318
|
-
//#region ../../src/orm/providers/drivers/NodePostgresProvider.d.ts
|
|
319
|
-
declare module "alepha" {
|
|
320
|
-
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
321
|
-
}
|
|
322
|
-
declare const envSchema: alepha588.TObject<{
|
|
323
|
-
/**
|
|
324
|
-
* Main configuration for database connection.
|
|
325
|
-
* Accept a string in the format of a Postgres connection URL.
|
|
326
|
-
* Example: postgres://user:password@localhost:5432/database
|
|
327
|
-
* or
|
|
328
|
-
* Example: postgres://user:password@localhost:5432/database?sslmode=require
|
|
329
|
-
*/
|
|
330
|
-
DATABASE_URL: alepha588.TOptional<alepha588.TString>;
|
|
331
|
-
/**
|
|
332
|
-
* In addition to the DATABASE_URL, you can specify the postgres schema name.
|
|
333
|
-
*
|
|
334
|
-
* It will monkey patch drizzle tables.
|
|
335
|
-
*/
|
|
336
|
-
POSTGRES_SCHEMA: alepha588.TOptional<alepha588.TString>;
|
|
337
|
-
}>;
|
|
338
|
-
//#endregion
|
|
339
|
-
//#region ../../src/orm/providers/drivers/NodeSqliteProvider.d.ts
|
|
340
|
-
/**
|
|
341
|
-
* Configuration options for the Node.js SQLite database provider.
|
|
342
|
-
*/
|
|
343
|
-
declare const nodeSqliteOptions: alepha588.Atom<alepha588.TObject<{
|
|
344
|
-
path: alepha588.TOptional<alepha588.TString>;
|
|
345
|
-
}>, "alepha.postgres.node-sqlite.options">;
|
|
346
|
-
type NodeSqliteProviderOptions = Static<typeof nodeSqliteOptions.schema>;
|
|
347
|
-
declare module "alepha" {
|
|
348
|
-
interface State {
|
|
349
|
-
[nodeSqliteOptions.key]: NodeSqliteProviderOptions;
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
/**
|
|
353
|
-
* Add a fake support for SQLite in Node.js based on Postgres interfaces.
|
|
354
|
-
*
|
|
355
|
-
* This is NOT a real SQLite provider, it's a workaround to use SQLite with Drizzle ORM.
|
|
356
|
-
* This is NOT recommended for production use.
|
|
357
|
-
*/
|
|
358
|
-
//#endregion
|
|
359
|
-
//#region ../../src/orm/index.d.ts
|
|
360
|
-
declare module "alepha" {
|
|
361
|
-
interface Hooks {
|
|
362
|
-
/**
|
|
363
|
-
* Fires before creating an entity in the repository.
|
|
364
|
-
*/
|
|
365
|
-
"repository:create:before": {
|
|
366
|
-
tableName: string;
|
|
367
|
-
data: any;
|
|
368
|
-
};
|
|
369
|
-
/**
|
|
370
|
-
* Fires after creating an entity in the repository.
|
|
371
|
-
*/
|
|
372
|
-
"repository:create:after": {
|
|
373
|
-
tableName: string;
|
|
374
|
-
data: any;
|
|
375
|
-
entity: any;
|
|
376
|
-
};
|
|
377
|
-
/**
|
|
378
|
-
* Fires before updating entities in the repository.
|
|
379
|
-
*/
|
|
380
|
-
"repository:update:before": {
|
|
381
|
-
tableName: string;
|
|
382
|
-
where: any;
|
|
383
|
-
data: any;
|
|
384
|
-
};
|
|
385
|
-
/**
|
|
386
|
-
* Fires after updating entities in the repository.
|
|
387
|
-
*/
|
|
388
|
-
"repository:update:after": {
|
|
389
|
-
tableName: string;
|
|
390
|
-
where: any;
|
|
391
|
-
data: any;
|
|
392
|
-
entities: any[];
|
|
393
|
-
};
|
|
394
|
-
/**
|
|
395
|
-
* Fires before deleting entities from the repository.
|
|
396
|
-
*/
|
|
397
|
-
"repository:delete:before": {
|
|
398
|
-
tableName: string;
|
|
399
|
-
where: any;
|
|
400
|
-
};
|
|
401
|
-
/**
|
|
402
|
-
* Fires after deleting entities from the repository.
|
|
403
|
-
*/
|
|
404
|
-
"repository:delete:after": {
|
|
405
|
-
tableName: string;
|
|
406
|
-
where: any;
|
|
407
|
-
ids: Array<string | number>;
|
|
408
|
-
};
|
|
409
|
-
/**
|
|
410
|
-
* Fires before reading entities from the repository.
|
|
411
|
-
*/
|
|
412
|
-
"repository:read:before": {
|
|
413
|
-
tableName: string;
|
|
414
|
-
query: any;
|
|
415
|
-
};
|
|
416
|
-
/**
|
|
417
|
-
* Fires after reading entities from the repository.
|
|
418
|
-
*/
|
|
419
|
-
"repository:read:after": {
|
|
420
|
-
tableName: string;
|
|
421
|
-
query: any;
|
|
422
|
-
entities: any[];
|
|
423
|
-
};
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
//#endregion
|
|
427
315
|
//#region ../../src/api/parameters/primitives/$config.d.ts
|
|
428
316
|
/**
|
|
429
317
|
* Creates a versioned configuration primitive for managing application settings.
|
|
@@ -471,21 +359,21 @@ declare module "alepha" {
|
|
|
471
359
|
*/
|
|
472
360
|
interface ConfigPrimitiveOptions<T extends TObject> {
|
|
473
361
|
/**
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
362
|
+
* Configuration name using dot notation for tree hierarchy.
|
|
363
|
+
* Examples: "app.features", "app.pricing.tiers", "system.limits"
|
|
364
|
+
*/
|
|
477
365
|
name?: string;
|
|
478
366
|
/**
|
|
479
|
-
|
|
480
|
-
|
|
367
|
+
* Human-readable description of the configuration.
|
|
368
|
+
*/
|
|
481
369
|
description?: string;
|
|
482
370
|
/**
|
|
483
|
-
|
|
484
|
-
|
|
371
|
+
* TypeBox schema defining the configuration structure.
|
|
372
|
+
*/
|
|
485
373
|
schema: T;
|
|
486
374
|
/**
|
|
487
|
-
|
|
488
|
-
|
|
375
|
+
* Default value used when no configuration exists in database.
|
|
376
|
+
*/
|
|
489
377
|
default: Static<T>;
|
|
490
378
|
}
|
|
491
379
|
declare class ConfigPrimitive<T extends TObject> extends Primitive<ConfigPrimitiveOptions<T>> {
|
|
@@ -500,45 +388,45 @@ declare class ConfigPrimitive<T extends TObject> extends Primitive<ConfigPrimiti
|
|
|
500
388
|
/** Whether initial load has completed */
|
|
501
389
|
protected loaded: boolean;
|
|
502
390
|
/**
|
|
503
|
-
|
|
504
|
-
|
|
391
|
+
* Configuration name (uses property key if not specified).
|
|
392
|
+
*/
|
|
505
393
|
get name(): string;
|
|
506
394
|
/**
|
|
507
|
-
|
|
508
|
-
|
|
395
|
+
* The TypeBox schema for this configuration.
|
|
396
|
+
*/
|
|
509
397
|
get schema(): T;
|
|
510
398
|
/**
|
|
511
|
-
|
|
512
|
-
|
|
399
|
+
* Get the current configuration value.
|
|
400
|
+
*/
|
|
513
401
|
get current(): Static<T>;
|
|
514
402
|
/**
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
get<Key
|
|
403
|
+
* Get a specific field from the current configuration.
|
|
404
|
+
*/
|
|
405
|
+
get<Key extends keyof Static<T>>(key: Key): Static<T>[Key];
|
|
518
406
|
/**
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
407
|
+
* Set a new configuration value.
|
|
408
|
+
*
|
|
409
|
+
* @param value - The new configuration value
|
|
410
|
+
* @param options - Optional settings (activation date, creator info, etc.)
|
|
411
|
+
*/
|
|
524
412
|
set(value: Static<T>, options?: SetConfigOptions): Promise<void>;
|
|
525
413
|
/**
|
|
526
|
-
|
|
527
|
-
|
|
414
|
+
* Subscribe to configuration changes.
|
|
415
|
+
*/
|
|
528
416
|
sub(fn: (curr: Static<T>) => void): () => void;
|
|
529
417
|
/**
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
418
|
+
* Reload configuration from database.
|
|
419
|
+
* Called when scheduled config activates or sync message received.
|
|
420
|
+
*/
|
|
533
421
|
reload(): Promise<void>;
|
|
534
422
|
/**
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
423
|
+
* Update from sync message (called by ConfigStore).
|
|
424
|
+
* Uses skipEvents to avoid infinite loops.
|
|
425
|
+
*/
|
|
538
426
|
updateFromSync(content: unknown): Promise<void>;
|
|
539
427
|
/**
|
|
540
|
-
|
|
541
|
-
|
|
428
|
+
* Get version history for this configuration.
|
|
429
|
+
*/
|
|
542
430
|
getHistory(): Promise<{
|
|
543
431
|
expiredAt?: string | undefined;
|
|
544
432
|
changeDescription?: string | undefined;
|
|
@@ -546,70 +434,70 @@ declare class ConfigPrimitive<T extends TObject> extends Primitive<ConfigPrimiti
|
|
|
546
434
|
creatorId?: string | undefined;
|
|
547
435
|
creatorName?: string | undefined;
|
|
548
436
|
previousContent?: typebox0.StaticRecord<[], "Decode", {}, {
|
|
549
|
-
id: PgAttr<PgAttr<
|
|
550
|
-
createdAt: PgAttr<PgAttr<
|
|
551
|
-
updatedAt: PgAttr<PgAttr<
|
|
552
|
-
name:
|
|
553
|
-
content:
|
|
554
|
-
schemaHash:
|
|
555
|
-
status: PgAttr<
|
|
556
|
-
activationDate:
|
|
557
|
-
expiredAt:
|
|
558
|
-
version:
|
|
559
|
-
changeDescription:
|
|
560
|
-
tags:
|
|
561
|
-
creatorId:
|
|
562
|
-
creatorName:
|
|
563
|
-
previousContent:
|
|
564
|
-
migrationLog:
|
|
565
|
-
}, string,
|
|
437
|
+
id: PgAttr<PgAttr<alepha624.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
438
|
+
createdAt: PgAttr<PgAttr<alepha624.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
439
|
+
updatedAt: PgAttr<PgAttr<alepha624.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
440
|
+
name: alepha624.TString;
|
|
441
|
+
content: alepha624.TRecord<string, alepha624.TAny>;
|
|
442
|
+
schemaHash: alepha624.TString;
|
|
443
|
+
status: PgAttr<alepha624.TUnsafe<"expired" | "current" | "next" | "future">, typeof PG_DEFAULT>;
|
|
444
|
+
activationDate: alepha624.TString;
|
|
445
|
+
expiredAt: alepha624.TOptional<alepha624.TString>;
|
|
446
|
+
version: alepha624.TInteger;
|
|
447
|
+
changeDescription: alepha624.TOptional<alepha624.TString>;
|
|
448
|
+
tags: alepha624.TOptional<alepha624.TArray<alepha624.TString>>;
|
|
449
|
+
creatorId: alepha624.TOptional<alepha624.TString>;
|
|
450
|
+
creatorName: alepha624.TOptional<alepha624.TString>;
|
|
451
|
+
previousContent: alepha624.TOptional<alepha624.TRecord<string, alepha624.TAny>>;
|
|
452
|
+
migrationLog: alepha624.TOptional<alepha624.TString>;
|
|
453
|
+
}, string, alepha624.TAny> | undefined;
|
|
566
454
|
migrationLog?: string | undefined;
|
|
455
|
+
name: string;
|
|
456
|
+
status: "expired" | "current" | "next" | "future";
|
|
567
457
|
id: string;
|
|
568
458
|
createdAt: string;
|
|
569
459
|
updatedAt: string;
|
|
570
|
-
name: string;
|
|
571
460
|
content: typebox0.StaticRecord<[], "Decode", {}, {
|
|
572
|
-
id: PgAttr<PgAttr<
|
|
573
|
-
createdAt: PgAttr<PgAttr<
|
|
574
|
-
updatedAt: PgAttr<PgAttr<
|
|
575
|
-
name:
|
|
576
|
-
content:
|
|
577
|
-
schemaHash:
|
|
578
|
-
status: PgAttr<
|
|
579
|
-
activationDate:
|
|
580
|
-
expiredAt:
|
|
581
|
-
version:
|
|
582
|
-
changeDescription:
|
|
583
|
-
tags:
|
|
584
|
-
creatorId:
|
|
585
|
-
creatorName:
|
|
586
|
-
previousContent:
|
|
587
|
-
migrationLog:
|
|
588
|
-
}, string,
|
|
461
|
+
id: PgAttr<PgAttr<alepha624.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
462
|
+
createdAt: PgAttr<PgAttr<alepha624.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
463
|
+
updatedAt: PgAttr<PgAttr<alepha624.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
464
|
+
name: alepha624.TString;
|
|
465
|
+
content: alepha624.TRecord<string, alepha624.TAny>;
|
|
466
|
+
schemaHash: alepha624.TString;
|
|
467
|
+
status: PgAttr<alepha624.TUnsafe<"expired" | "current" | "next" | "future">, typeof PG_DEFAULT>;
|
|
468
|
+
activationDate: alepha624.TString;
|
|
469
|
+
expiredAt: alepha624.TOptional<alepha624.TString>;
|
|
470
|
+
version: alepha624.TInteger;
|
|
471
|
+
changeDescription: alepha624.TOptional<alepha624.TString>;
|
|
472
|
+
tags: alepha624.TOptional<alepha624.TArray<alepha624.TString>>;
|
|
473
|
+
creatorId: alepha624.TOptional<alepha624.TString>;
|
|
474
|
+
creatorName: alepha624.TOptional<alepha624.TString>;
|
|
475
|
+
previousContent: alepha624.TOptional<alepha624.TRecord<string, alepha624.TAny>>;
|
|
476
|
+
migrationLog: alepha624.TOptional<alepha624.TString>;
|
|
477
|
+
}, string, alepha624.TAny>;
|
|
589
478
|
schemaHash: string;
|
|
590
|
-
status: "expired" | "current" | "next" | "future";
|
|
591
479
|
activationDate: string;
|
|
592
480
|
version: number;
|
|
593
481
|
}[]>;
|
|
594
482
|
/**
|
|
595
|
-
|
|
596
|
-
|
|
483
|
+
* Rollback to a specific version.
|
|
484
|
+
*/
|
|
597
485
|
rollback(version: number, options?: SetConfigOptions): Promise<void>;
|
|
598
486
|
/**
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
protected readonly onStart:
|
|
487
|
+
* Hook to load initial value from database on start.
|
|
488
|
+
*/
|
|
489
|
+
protected readonly onStart: alepha624.HookPrimitive<"start">;
|
|
602
490
|
/**
|
|
603
|
-
|
|
604
|
-
|
|
491
|
+
* Called after primitive creation to initialize.
|
|
492
|
+
*/
|
|
605
493
|
protected onInit(): void;
|
|
606
494
|
/**
|
|
607
|
-
|
|
608
|
-
|
|
495
|
+
* Load initial value from database.
|
|
496
|
+
*/
|
|
609
497
|
protected loadInitial(): Promise<void>;
|
|
610
498
|
/**
|
|
611
|
-
|
|
612
|
-
|
|
499
|
+
* Calculate a hash of the schema for migration detection.
|
|
500
|
+
*/
|
|
613
501
|
protected calculateSchemaHash(): string;
|
|
614
502
|
}
|
|
615
503
|
declare const $config: {
|
|
@@ -618,21 +506,21 @@ declare const $config: {
|
|
|
618
506
|
};
|
|
619
507
|
interface SetConfigOptions {
|
|
620
508
|
/**
|
|
621
|
-
|
|
622
|
-
|
|
509
|
+
* User making the change (for audit trail).
|
|
510
|
+
*/
|
|
623
511
|
user?: Pick<UserAccount, "id" | "email" | "name">;
|
|
624
512
|
/**
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
513
|
+
* When this configuration should become active.
|
|
514
|
+
* Default is immediate (now).
|
|
515
|
+
*/
|
|
628
516
|
activationDate?: Date;
|
|
629
517
|
/**
|
|
630
|
-
|
|
631
|
-
|
|
518
|
+
* Description of the change.
|
|
519
|
+
*/
|
|
632
520
|
changeDescription?: string;
|
|
633
521
|
/**
|
|
634
|
-
|
|
635
|
-
|
|
522
|
+
* Tags for filtering/categorization.
|
|
523
|
+
*/
|
|
636
524
|
tags?: string[];
|
|
637
525
|
}
|
|
638
526
|
//#endregion
|
|
@@ -660,23 +548,23 @@ interface ConfigSyncPayload {
|
|
|
660
548
|
declare class ConfigStore {
|
|
661
549
|
protected readonly log: alepha_logger0.Logger;
|
|
662
550
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
663
|
-
protected readonly repo:
|
|
664
|
-
id:
|
|
665
|
-
createdAt:
|
|
666
|
-
updatedAt:
|
|
667
|
-
name:
|
|
668
|
-
content:
|
|
669
|
-
schemaHash:
|
|
670
|
-
status:
|
|
671
|
-
activationDate:
|
|
672
|
-
expiredAt:
|
|
673
|
-
version:
|
|
674
|
-
changeDescription:
|
|
675
|
-
tags:
|
|
676
|
-
creatorId:
|
|
677
|
-
creatorName:
|
|
678
|
-
previousContent:
|
|
679
|
-
migrationLog:
|
|
551
|
+
protected readonly repo: alepha_orm0.Repository<TObject<{
|
|
552
|
+
id: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha624.TString, typeof alepha_orm0.PG_PRIMARY_KEY>, typeof alepha_orm0.PG_DEFAULT>;
|
|
553
|
+
createdAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha624.TString, typeof alepha_orm0.PG_CREATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
|
|
554
|
+
updatedAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha624.TString, typeof alepha_orm0.PG_UPDATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
|
|
555
|
+
name: alepha624.TString;
|
|
556
|
+
content: alepha624.TRecord<string, alepha624.TAny>;
|
|
557
|
+
schemaHash: alepha624.TString;
|
|
558
|
+
status: alepha_orm0.PgAttr<alepha624.TUnsafe<"expired" | "current" | "next" | "future">, typeof alepha_orm0.PG_DEFAULT>;
|
|
559
|
+
activationDate: alepha624.TString;
|
|
560
|
+
expiredAt: alepha624.TOptional<alepha624.TString>;
|
|
561
|
+
version: alepha624.TInteger;
|
|
562
|
+
changeDescription: alepha624.TOptional<alepha624.TString>;
|
|
563
|
+
tags: alepha624.TOptional<alepha624.TArray<alepha624.TString>>;
|
|
564
|
+
creatorId: alepha624.TOptional<alepha624.TString>;
|
|
565
|
+
creatorName: alepha624.TOptional<alepha624.TString>;
|
|
566
|
+
previousContent: alepha624.TOptional<alepha624.TRecord<string, alepha624.TAny>>;
|
|
567
|
+
migrationLog: alepha624.TOptional<alepha624.TString>;
|
|
680
568
|
}>>;
|
|
681
569
|
/** Unique identifier for this instance (to avoid self-updates) */
|
|
682
570
|
protected readonly instanceId: `${string}-${string}-${string}-${string}-${string}`;
|
|
@@ -685,58 +573,58 @@ declare class ConfigStore {
|
|
|
685
573
|
/** Topic for cross-instance synchronization */
|
|
686
574
|
readonly syncTopic: alepha_topic0.TopicPrimitive<{
|
|
687
575
|
payload: TObject<{
|
|
688
|
-
name:
|
|
689
|
-
version:
|
|
690
|
-
content:
|
|
691
|
-
status:
|
|
692
|
-
instanceId:
|
|
576
|
+
name: alepha624.TString;
|
|
577
|
+
version: alepha624.TInteger;
|
|
578
|
+
content: alepha624.TRecord<string, alepha624.TAny>;
|
|
579
|
+
status: alepha624.TUnsafe<"expired" | "current" | "next" | "future">;
|
|
580
|
+
instanceId: alepha624.TString;
|
|
693
581
|
}>;
|
|
694
582
|
}>;
|
|
695
583
|
/**
|
|
696
|
-
|
|
697
|
-
|
|
584
|
+
* Register a config primitive with the store.
|
|
585
|
+
*/
|
|
698
586
|
register(config: ConfigPrimitive<any>): void;
|
|
699
587
|
/**
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
588
|
+
* Load the current config value from database.
|
|
589
|
+
* Returns the current or next version if no current exists.
|
|
590
|
+
*/
|
|
703
591
|
load<T extends TObject>(name: string): Promise<Static<T> | null>;
|
|
704
592
|
/**
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
593
|
+
* Save a new config version.
|
|
594
|
+
*
|
|
595
|
+
* @param name - Config name (e.g., "app.features.flags")
|
|
596
|
+
* @param content - New config content
|
|
597
|
+
* @param schemaHash - Hash of the schema for migration detection
|
|
598
|
+
* @param options - Additional options (activation date, creator info, etc.)
|
|
599
|
+
*/
|
|
712
600
|
save<T extends TObject>(name: string, content: Static<T>, schemaHash: string, options?: SaveConfigOptions): Promise<Parameter>;
|
|
713
601
|
/**
|
|
714
|
-
|
|
715
|
-
|
|
602
|
+
* Get all versions of a config.
|
|
603
|
+
*/
|
|
716
604
|
getHistory(name: string): Promise<Parameter[]>;
|
|
717
605
|
/**
|
|
718
|
-
|
|
719
|
-
|
|
606
|
+
* Get a specific version of a config.
|
|
607
|
+
*/
|
|
720
608
|
getVersion(name: string, version: number): Promise<Parameter | null>;
|
|
721
609
|
/**
|
|
722
|
-
|
|
723
|
-
|
|
610
|
+
* Rollback to a previous version by creating a new version with old content.
|
|
611
|
+
*/
|
|
724
612
|
rollback(name: string, targetVersion: number, options?: SaveConfigOptions): Promise<Parameter>;
|
|
725
613
|
/**
|
|
726
|
-
|
|
727
|
-
|
|
614
|
+
* Get all configs by status.
|
|
615
|
+
*/
|
|
728
616
|
getByStatus(status: ParameterStatus): Promise<Parameter[]>;
|
|
729
617
|
/**
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
618
|
+
* Get current config value with fallback to default from registered primitive.
|
|
619
|
+
* Returns the in-memory current value which may be the default if never saved.
|
|
620
|
+
*/
|
|
733
621
|
getCurrentValue(name: string): {
|
|
734
622
|
content: unknown;
|
|
735
623
|
isDefault: boolean;
|
|
736
624
|
} | null;
|
|
737
625
|
/**
|
|
738
|
-
|
|
739
|
-
|
|
626
|
+
* Get config info including current value with default fallback.
|
|
627
|
+
*/
|
|
740
628
|
getCurrentWithDefault(name: string): Promise<{
|
|
741
629
|
current: Parameter | null;
|
|
742
630
|
next: Parameter | null;
|
|
@@ -745,38 +633,38 @@ declare class ConfigStore {
|
|
|
745
633
|
schema: TObject | null;
|
|
746
634
|
}>;
|
|
747
635
|
/**
|
|
748
|
-
|
|
749
|
-
|
|
636
|
+
* Get all unique config names (for tree view).
|
|
637
|
+
*/
|
|
750
638
|
getConfigNames(): Promise<string[]>;
|
|
751
639
|
/**
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
640
|
+
* Build a tree structure from config names for UI.
|
|
641
|
+
* Includes both database configs and registered (but not yet saved) configs.
|
|
642
|
+
*/
|
|
755
643
|
getConfigTree(): Promise<ConfigTreeNode[]>;
|
|
756
644
|
/**
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
645
|
+
* Check and activate scheduled configs that are due.
|
|
646
|
+
* Should be called periodically (e.g., via scheduler).
|
|
647
|
+
*/
|
|
760
648
|
activateScheduledConfigs(): Promise<void>;
|
|
761
649
|
/**
|
|
762
|
-
|
|
763
|
-
|
|
650
|
+
* Transition config statuses when a new current is activated.
|
|
651
|
+
*/
|
|
764
652
|
protected transitionStatuses(name: string, now: Date): Promise<void>;
|
|
765
653
|
/**
|
|
766
|
-
|
|
767
|
-
|
|
654
|
+
* Recalculate statuses based on activation dates.
|
|
655
|
+
*/
|
|
768
656
|
protected recalculateStatuses(name: string): Promise<void>;
|
|
769
657
|
/**
|
|
770
|
-
|
|
771
|
-
|
|
658
|
+
* Publish sync event to other instances.
|
|
659
|
+
*/
|
|
772
660
|
protected publishSync(name: string, version: number, content: unknown, status: ParameterStatus): Promise<void>;
|
|
773
661
|
/**
|
|
774
|
-
|
|
775
|
-
|
|
662
|
+
* Handle incoming sync message from other instances.
|
|
663
|
+
*/
|
|
776
664
|
protected handleSyncMessage(payload: ConfigSyncPayload): Promise<void>;
|
|
777
665
|
/**
|
|
778
|
-
|
|
779
|
-
|
|
666
|
+
* Build tree structure from dot-notation names.
|
|
667
|
+
*/
|
|
780
668
|
protected buildTree(names: string[]): ConfigTreeNode[];
|
|
781
669
|
}
|
|
782
670
|
interface SaveConfigOptions {
|
|
@@ -810,266 +698,266 @@ declare class AdminConfigController {
|
|
|
810
698
|
protected readonly group = "admin:configs";
|
|
811
699
|
protected readonly store: ConfigStore;
|
|
812
700
|
/**
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
701
|
+
* Get tree structure of all configuration names.
|
|
702
|
+
* Useful for admin UI navigation.
|
|
703
|
+
*/
|
|
816
704
|
getConfigTree: alepha_server0.ActionPrimitiveFn<{
|
|
817
|
-
response:
|
|
818
|
-
name:
|
|
819
|
-
path:
|
|
820
|
-
isLeaf:
|
|
821
|
-
children:
|
|
705
|
+
response: alepha624.TArray<alepha624.TObject<{
|
|
706
|
+
name: alepha624.TString;
|
|
707
|
+
path: alepha624.TString;
|
|
708
|
+
isLeaf: alepha624.TBoolean;
|
|
709
|
+
children: alepha624.TArray<alepha624.TAny>;
|
|
822
710
|
}>>;
|
|
823
711
|
}>;
|
|
824
712
|
/**
|
|
825
|
-
|
|
826
|
-
|
|
713
|
+
* List all unique configuration names.
|
|
714
|
+
*/
|
|
827
715
|
listConfigNames: alepha_server0.ActionPrimitiveFn<{
|
|
828
|
-
response:
|
|
829
|
-
names:
|
|
716
|
+
response: alepha624.TObject<{
|
|
717
|
+
names: alepha624.TArray<alepha624.TString>;
|
|
830
718
|
}>;
|
|
831
719
|
}>;
|
|
832
720
|
/**
|
|
833
|
-
|
|
834
|
-
|
|
721
|
+
* Get configurations by status.
|
|
722
|
+
*/
|
|
835
723
|
getByStatus: alepha_server0.ActionPrimitiveFn<{
|
|
836
|
-
params:
|
|
837
|
-
status:
|
|
724
|
+
params: alepha624.TObject<{
|
|
725
|
+
status: alepha624.TUnsafe<"expired" | "current" | "next" | "future">;
|
|
838
726
|
}>;
|
|
839
|
-
response:
|
|
840
|
-
configs:
|
|
841
|
-
id:
|
|
842
|
-
createdAt:
|
|
843
|
-
updatedAt:
|
|
844
|
-
name:
|
|
845
|
-
content:
|
|
846
|
-
schemaHash:
|
|
847
|
-
status:
|
|
848
|
-
activationDate:
|
|
849
|
-
expiredAt:
|
|
850
|
-
version:
|
|
851
|
-
changeDescription:
|
|
852
|
-
tags:
|
|
853
|
-
creatorId:
|
|
854
|
-
creatorName:
|
|
855
|
-
previousContent:
|
|
856
|
-
migrationLog:
|
|
727
|
+
response: alepha624.TObject<{
|
|
728
|
+
configs: alepha624.TArray<alepha624.TObject<{
|
|
729
|
+
id: alepha624.TString;
|
|
730
|
+
createdAt: alepha624.TString;
|
|
731
|
+
updatedAt: alepha624.TString;
|
|
732
|
+
name: alepha624.TString;
|
|
733
|
+
content: alepha624.TRecord<string, alepha624.TAny>;
|
|
734
|
+
schemaHash: alepha624.TString;
|
|
735
|
+
status: alepha624.TUnsafe<"expired" | "current" | "next" | "future">;
|
|
736
|
+
activationDate: alepha624.TString;
|
|
737
|
+
expiredAt: alepha624.TOptional<alepha624.TString>;
|
|
738
|
+
version: alepha624.TInteger;
|
|
739
|
+
changeDescription: alepha624.TOptional<alepha624.TString>;
|
|
740
|
+
tags: alepha624.TOptional<alepha624.TArray<alepha624.TString>>;
|
|
741
|
+
creatorId: alepha624.TOptional<alepha624.TString>;
|
|
742
|
+
creatorName: alepha624.TOptional<alepha624.TString>;
|
|
743
|
+
previousContent: alepha624.TOptional<alepha624.TRecord<string, alepha624.TAny>>;
|
|
744
|
+
migrationLog: alepha624.TOptional<alepha624.TString>;
|
|
857
745
|
}>>;
|
|
858
746
|
}>;
|
|
859
747
|
}>;
|
|
860
748
|
/**
|
|
861
|
-
|
|
862
|
-
|
|
749
|
+
* Get version history for a specific configuration.
|
|
750
|
+
*/
|
|
863
751
|
getHistory: alepha_server0.ActionPrimitiveFn<{
|
|
864
|
-
params:
|
|
865
|
-
name:
|
|
752
|
+
params: alepha624.TObject<{
|
|
753
|
+
name: alepha624.TString;
|
|
866
754
|
}>;
|
|
867
|
-
response:
|
|
868
|
-
versions:
|
|
869
|
-
id:
|
|
870
|
-
createdAt:
|
|
871
|
-
updatedAt:
|
|
872
|
-
name:
|
|
873
|
-
content:
|
|
874
|
-
schemaHash:
|
|
875
|
-
status:
|
|
876
|
-
activationDate:
|
|
877
|
-
expiredAt:
|
|
878
|
-
version:
|
|
879
|
-
changeDescription:
|
|
880
|
-
tags:
|
|
881
|
-
creatorId:
|
|
882
|
-
creatorName:
|
|
883
|
-
previousContent:
|
|
884
|
-
migrationLog:
|
|
755
|
+
response: alepha624.TObject<{
|
|
756
|
+
versions: alepha624.TArray<alepha624.TObject<{
|
|
757
|
+
id: alepha624.TString;
|
|
758
|
+
createdAt: alepha624.TString;
|
|
759
|
+
updatedAt: alepha624.TString;
|
|
760
|
+
name: alepha624.TString;
|
|
761
|
+
content: alepha624.TRecord<string, alepha624.TAny>;
|
|
762
|
+
schemaHash: alepha624.TString;
|
|
763
|
+
status: alepha624.TUnsafe<"expired" | "current" | "next" | "future">;
|
|
764
|
+
activationDate: alepha624.TString;
|
|
765
|
+
expiredAt: alepha624.TOptional<alepha624.TString>;
|
|
766
|
+
version: alepha624.TInteger;
|
|
767
|
+
changeDescription: alepha624.TOptional<alepha624.TString>;
|
|
768
|
+
tags: alepha624.TOptional<alepha624.TArray<alepha624.TString>>;
|
|
769
|
+
creatorId: alepha624.TOptional<alepha624.TString>;
|
|
770
|
+
creatorName: alepha624.TOptional<alepha624.TString>;
|
|
771
|
+
previousContent: alepha624.TOptional<alepha624.TRecord<string, alepha624.TAny>>;
|
|
772
|
+
migrationLog: alepha624.TOptional<alepha624.TString>;
|
|
885
773
|
}>>;
|
|
886
774
|
}>;
|
|
887
775
|
}>;
|
|
888
776
|
/**
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
777
|
+
* Get current and next values for a configuration.
|
|
778
|
+
* Includes defaultValue and currentValue from the registered primitive
|
|
779
|
+
* even if no versions exist in the database yet.
|
|
780
|
+
*/
|
|
893
781
|
getCurrent: alepha_server0.ActionPrimitiveFn<{
|
|
894
|
-
params:
|
|
895
|
-
name:
|
|
782
|
+
params: alepha624.TObject<{
|
|
783
|
+
name: alepha624.TString;
|
|
896
784
|
}>;
|
|
897
|
-
response:
|
|
898
|
-
current:
|
|
899
|
-
id:
|
|
900
|
-
createdAt:
|
|
901
|
-
updatedAt:
|
|
902
|
-
name:
|
|
903
|
-
content:
|
|
904
|
-
schemaHash:
|
|
905
|
-
status:
|
|
906
|
-
activationDate:
|
|
907
|
-
expiredAt:
|
|
908
|
-
version:
|
|
909
|
-
changeDescription:
|
|
910
|
-
tags:
|
|
911
|
-
creatorId:
|
|
912
|
-
creatorName:
|
|
913
|
-
previousContent:
|
|
914
|
-
migrationLog:
|
|
785
|
+
response: alepha624.TObject<{
|
|
786
|
+
current: alepha624.TOptional<alepha624.TObject<{
|
|
787
|
+
id: alepha624.TString;
|
|
788
|
+
createdAt: alepha624.TString;
|
|
789
|
+
updatedAt: alepha624.TString;
|
|
790
|
+
name: alepha624.TString;
|
|
791
|
+
content: alepha624.TRecord<string, alepha624.TAny>;
|
|
792
|
+
schemaHash: alepha624.TString;
|
|
793
|
+
status: alepha624.TUnsafe<"expired" | "current" | "next" | "future">;
|
|
794
|
+
activationDate: alepha624.TString;
|
|
795
|
+
expiredAt: alepha624.TOptional<alepha624.TString>;
|
|
796
|
+
version: alepha624.TInteger;
|
|
797
|
+
changeDescription: alepha624.TOptional<alepha624.TString>;
|
|
798
|
+
tags: alepha624.TOptional<alepha624.TArray<alepha624.TString>>;
|
|
799
|
+
creatorId: alepha624.TOptional<alepha624.TString>;
|
|
800
|
+
creatorName: alepha624.TOptional<alepha624.TString>;
|
|
801
|
+
previousContent: alepha624.TOptional<alepha624.TRecord<string, alepha624.TAny>>;
|
|
802
|
+
migrationLog: alepha624.TOptional<alepha624.TString>;
|
|
915
803
|
}>>;
|
|
916
|
-
next:
|
|
917
|
-
id:
|
|
918
|
-
createdAt:
|
|
919
|
-
updatedAt:
|
|
920
|
-
name:
|
|
921
|
-
content:
|
|
922
|
-
schemaHash:
|
|
923
|
-
status:
|
|
924
|
-
activationDate:
|
|
925
|
-
expiredAt:
|
|
926
|
-
version:
|
|
927
|
-
changeDescription:
|
|
928
|
-
tags:
|
|
929
|
-
creatorId:
|
|
930
|
-
creatorName:
|
|
931
|
-
previousContent:
|
|
932
|
-
migrationLog:
|
|
804
|
+
next: alepha624.TOptional<alepha624.TObject<{
|
|
805
|
+
id: alepha624.TString;
|
|
806
|
+
createdAt: alepha624.TString;
|
|
807
|
+
updatedAt: alepha624.TString;
|
|
808
|
+
name: alepha624.TString;
|
|
809
|
+
content: alepha624.TRecord<string, alepha624.TAny>;
|
|
810
|
+
schemaHash: alepha624.TString;
|
|
811
|
+
status: alepha624.TUnsafe<"expired" | "current" | "next" | "future">;
|
|
812
|
+
activationDate: alepha624.TString;
|
|
813
|
+
expiredAt: alepha624.TOptional<alepha624.TString>;
|
|
814
|
+
version: alepha624.TInteger;
|
|
815
|
+
changeDescription: alepha624.TOptional<alepha624.TString>;
|
|
816
|
+
tags: alepha624.TOptional<alepha624.TArray<alepha624.TString>>;
|
|
817
|
+
creatorId: alepha624.TOptional<alepha624.TString>;
|
|
818
|
+
creatorName: alepha624.TOptional<alepha624.TString>;
|
|
819
|
+
previousContent: alepha624.TOptional<alepha624.TRecord<string, alepha624.TAny>>;
|
|
820
|
+
migrationLog: alepha624.TOptional<alepha624.TString>;
|
|
933
821
|
}>>;
|
|
934
|
-
defaultValue:
|
|
935
|
-
currentValue:
|
|
936
|
-
schema:
|
|
822
|
+
defaultValue: alepha624.TOptional<alepha624.TRecord<string, alepha624.TAny>>;
|
|
823
|
+
currentValue: alepha624.TOptional<alepha624.TRecord<string, alepha624.TAny>>;
|
|
824
|
+
schema: alepha624.TOptional<alepha624.TRecord<string, alepha624.TAny>>;
|
|
937
825
|
}>;
|
|
938
826
|
}>;
|
|
939
827
|
/**
|
|
940
|
-
|
|
941
|
-
|
|
828
|
+
* Get a specific version of a configuration.
|
|
829
|
+
*/
|
|
942
830
|
getVersion: alepha_server0.ActionPrimitiveFn<{
|
|
943
|
-
params:
|
|
944
|
-
name:
|
|
945
|
-
version:
|
|
831
|
+
params: alepha624.TObject<{
|
|
832
|
+
name: alepha624.TString;
|
|
833
|
+
version: alepha624.TInteger;
|
|
946
834
|
}>;
|
|
947
|
-
response:
|
|
948
|
-
config:
|
|
949
|
-
id:
|
|
950
|
-
createdAt:
|
|
951
|
-
updatedAt:
|
|
952
|
-
name:
|
|
953
|
-
content:
|
|
954
|
-
schemaHash:
|
|
955
|
-
status:
|
|
956
|
-
activationDate:
|
|
957
|
-
expiredAt:
|
|
958
|
-
version:
|
|
959
|
-
changeDescription:
|
|
960
|
-
tags:
|
|
961
|
-
creatorId:
|
|
962
|
-
creatorName:
|
|
963
|
-
previousContent:
|
|
964
|
-
migrationLog:
|
|
835
|
+
response: alepha624.TObject<{
|
|
836
|
+
config: alepha624.TOptional<alepha624.TObject<{
|
|
837
|
+
id: alepha624.TString;
|
|
838
|
+
createdAt: alepha624.TString;
|
|
839
|
+
updatedAt: alepha624.TString;
|
|
840
|
+
name: alepha624.TString;
|
|
841
|
+
content: alepha624.TRecord<string, alepha624.TAny>;
|
|
842
|
+
schemaHash: alepha624.TString;
|
|
843
|
+
status: alepha624.TUnsafe<"expired" | "current" | "next" | "future">;
|
|
844
|
+
activationDate: alepha624.TString;
|
|
845
|
+
expiredAt: alepha624.TOptional<alepha624.TString>;
|
|
846
|
+
version: alepha624.TInteger;
|
|
847
|
+
changeDescription: alepha624.TOptional<alepha624.TString>;
|
|
848
|
+
tags: alepha624.TOptional<alepha624.TArray<alepha624.TString>>;
|
|
849
|
+
creatorId: alepha624.TOptional<alepha624.TString>;
|
|
850
|
+
creatorName: alepha624.TOptional<alepha624.TString>;
|
|
851
|
+
previousContent: alepha624.TOptional<alepha624.TRecord<string, alepha624.TAny>>;
|
|
852
|
+
migrationLog: alepha624.TOptional<alepha624.TString>;
|
|
965
853
|
}>>;
|
|
966
854
|
}>;
|
|
967
855
|
}>;
|
|
968
856
|
/**
|
|
969
|
-
|
|
970
|
-
|
|
857
|
+
* Create a new configuration version.
|
|
858
|
+
*/
|
|
971
859
|
createVersion: alepha_server0.ActionPrimitiveFn<{
|
|
972
|
-
params:
|
|
973
|
-
name:
|
|
860
|
+
params: alepha624.TObject<{
|
|
861
|
+
name: alepha624.TString;
|
|
974
862
|
}>;
|
|
975
|
-
body:
|
|
976
|
-
content:
|
|
977
|
-
schemaHash:
|
|
978
|
-
activationDate:
|
|
979
|
-
changeDescription:
|
|
980
|
-
tags:
|
|
981
|
-
creatorId:
|
|
982
|
-
creatorName:
|
|
863
|
+
body: alepha624.TObject<{
|
|
864
|
+
content: alepha624.TRecord<string, alepha624.TAny>;
|
|
865
|
+
schemaHash: alepha624.TString;
|
|
866
|
+
activationDate: alepha624.TOptional<alepha624.TString>;
|
|
867
|
+
changeDescription: alepha624.TOptional<alepha624.TString>;
|
|
868
|
+
tags: alepha624.TOptional<alepha624.TArray<alepha624.TString>>;
|
|
869
|
+
creatorId: alepha624.TOptional<alepha624.TString>;
|
|
870
|
+
creatorName: alepha624.TOptional<alepha624.TString>;
|
|
983
871
|
}>;
|
|
984
|
-
response:
|
|
985
|
-
id:
|
|
986
|
-
createdAt:
|
|
987
|
-
updatedAt:
|
|
988
|
-
name:
|
|
989
|
-
content:
|
|
990
|
-
schemaHash:
|
|
991
|
-
status:
|
|
992
|
-
activationDate:
|
|
993
|
-
expiredAt:
|
|
994
|
-
version:
|
|
995
|
-
changeDescription:
|
|
996
|
-
tags:
|
|
997
|
-
creatorId:
|
|
998
|
-
creatorName:
|
|
999
|
-
previousContent:
|
|
1000
|
-
migrationLog:
|
|
872
|
+
response: alepha624.TObject<{
|
|
873
|
+
id: alepha624.TString;
|
|
874
|
+
createdAt: alepha624.TString;
|
|
875
|
+
updatedAt: alepha624.TString;
|
|
876
|
+
name: alepha624.TString;
|
|
877
|
+
content: alepha624.TRecord<string, alepha624.TAny>;
|
|
878
|
+
schemaHash: alepha624.TString;
|
|
879
|
+
status: alepha624.TUnsafe<"expired" | "current" | "next" | "future">;
|
|
880
|
+
activationDate: alepha624.TString;
|
|
881
|
+
expiredAt: alepha624.TOptional<alepha624.TString>;
|
|
882
|
+
version: alepha624.TInteger;
|
|
883
|
+
changeDescription: alepha624.TOptional<alepha624.TString>;
|
|
884
|
+
tags: alepha624.TOptional<alepha624.TArray<alepha624.TString>>;
|
|
885
|
+
creatorId: alepha624.TOptional<alepha624.TString>;
|
|
886
|
+
creatorName: alepha624.TOptional<alepha624.TString>;
|
|
887
|
+
previousContent: alepha624.TOptional<alepha624.TRecord<string, alepha624.TAny>>;
|
|
888
|
+
migrationLog: alepha624.TOptional<alepha624.TString>;
|
|
1001
889
|
}>;
|
|
1002
890
|
}>;
|
|
1003
891
|
/**
|
|
1004
|
-
|
|
1005
|
-
|
|
892
|
+
* Rollback to a previous version.
|
|
893
|
+
*/
|
|
1006
894
|
rollback: alepha_server0.ActionPrimitiveFn<{
|
|
1007
|
-
params:
|
|
1008
|
-
name:
|
|
895
|
+
params: alepha624.TObject<{
|
|
896
|
+
name: alepha624.TString;
|
|
1009
897
|
}>;
|
|
1010
|
-
body:
|
|
1011
|
-
targetVersion:
|
|
1012
|
-
changeDescription:
|
|
1013
|
-
creatorId:
|
|
1014
|
-
creatorName:
|
|
898
|
+
body: alepha624.TObject<{
|
|
899
|
+
targetVersion: alepha624.TInteger;
|
|
900
|
+
changeDescription: alepha624.TOptional<alepha624.TString>;
|
|
901
|
+
creatorId: alepha624.TOptional<alepha624.TString>;
|
|
902
|
+
creatorName: alepha624.TOptional<alepha624.TString>;
|
|
1015
903
|
}>;
|
|
1016
|
-
response:
|
|
1017
|
-
id:
|
|
1018
|
-
createdAt:
|
|
1019
|
-
updatedAt:
|
|
1020
|
-
name:
|
|
1021
|
-
content:
|
|
1022
|
-
schemaHash:
|
|
1023
|
-
status:
|
|
1024
|
-
activationDate:
|
|
1025
|
-
expiredAt:
|
|
1026
|
-
version:
|
|
1027
|
-
changeDescription:
|
|
1028
|
-
tags:
|
|
1029
|
-
creatorId:
|
|
1030
|
-
creatorName:
|
|
1031
|
-
previousContent:
|
|
1032
|
-
migrationLog:
|
|
904
|
+
response: alepha624.TObject<{
|
|
905
|
+
id: alepha624.TString;
|
|
906
|
+
createdAt: alepha624.TString;
|
|
907
|
+
updatedAt: alepha624.TString;
|
|
908
|
+
name: alepha624.TString;
|
|
909
|
+
content: alepha624.TRecord<string, alepha624.TAny>;
|
|
910
|
+
schemaHash: alepha624.TString;
|
|
911
|
+
status: alepha624.TUnsafe<"expired" | "current" | "next" | "future">;
|
|
912
|
+
activationDate: alepha624.TString;
|
|
913
|
+
expiredAt: alepha624.TOptional<alepha624.TString>;
|
|
914
|
+
version: alepha624.TInteger;
|
|
915
|
+
changeDescription: alepha624.TOptional<alepha624.TString>;
|
|
916
|
+
tags: alepha624.TOptional<alepha624.TArray<alepha624.TString>>;
|
|
917
|
+
creatorId: alepha624.TOptional<alepha624.TString>;
|
|
918
|
+
creatorName: alepha624.TOptional<alepha624.TString>;
|
|
919
|
+
previousContent: alepha624.TOptional<alepha624.TRecord<string, alepha624.TAny>>;
|
|
920
|
+
migrationLog: alepha624.TOptional<alepha624.TString>;
|
|
1033
921
|
}>;
|
|
1034
922
|
}>;
|
|
1035
923
|
/**
|
|
1036
|
-
|
|
1037
|
-
|
|
924
|
+
* Activate a scheduled version immediately.
|
|
925
|
+
*/
|
|
1038
926
|
activateNow: alepha_server0.ActionPrimitiveFn<{
|
|
1039
|
-
params:
|
|
1040
|
-
name:
|
|
927
|
+
params: alepha624.TObject<{
|
|
928
|
+
name: alepha624.TString;
|
|
1041
929
|
}>;
|
|
1042
|
-
body:
|
|
1043
|
-
version:
|
|
1044
|
-
creatorId:
|
|
1045
|
-
creatorName:
|
|
930
|
+
body: alepha624.TObject<{
|
|
931
|
+
version: alepha624.TInteger;
|
|
932
|
+
creatorId: alepha624.TOptional<alepha624.TString>;
|
|
933
|
+
creatorName: alepha624.TOptional<alepha624.TString>;
|
|
1046
934
|
}>;
|
|
1047
|
-
response:
|
|
1048
|
-
id:
|
|
1049
|
-
createdAt:
|
|
1050
|
-
updatedAt:
|
|
1051
|
-
name:
|
|
1052
|
-
content:
|
|
1053
|
-
schemaHash:
|
|
1054
|
-
status:
|
|
1055
|
-
activationDate:
|
|
1056
|
-
expiredAt:
|
|
1057
|
-
version:
|
|
1058
|
-
changeDescription:
|
|
1059
|
-
tags:
|
|
1060
|
-
creatorId:
|
|
1061
|
-
creatorName:
|
|
1062
|
-
previousContent:
|
|
1063
|
-
migrationLog:
|
|
935
|
+
response: alepha624.TObject<{
|
|
936
|
+
id: alepha624.TString;
|
|
937
|
+
createdAt: alepha624.TString;
|
|
938
|
+
updatedAt: alepha624.TString;
|
|
939
|
+
name: alepha624.TString;
|
|
940
|
+
content: alepha624.TRecord<string, alepha624.TAny>;
|
|
941
|
+
schemaHash: alepha624.TString;
|
|
942
|
+
status: alepha624.TUnsafe<"expired" | "current" | "next" | "future">;
|
|
943
|
+
activationDate: alepha624.TString;
|
|
944
|
+
expiredAt: alepha624.TOptional<alepha624.TString>;
|
|
945
|
+
version: alepha624.TInteger;
|
|
946
|
+
changeDescription: alepha624.TOptional<alepha624.TString>;
|
|
947
|
+
tags: alepha624.TOptional<alepha624.TArray<alepha624.TString>>;
|
|
948
|
+
creatorId: alepha624.TOptional<alepha624.TString>;
|
|
949
|
+
creatorName: alepha624.TOptional<alepha624.TString>;
|
|
950
|
+
previousContent: alepha624.TOptional<alepha624.TRecord<string, alepha624.TAny>>;
|
|
951
|
+
migrationLog: alepha624.TOptional<alepha624.TString>;
|
|
1064
952
|
}>;
|
|
1065
953
|
}>;
|
|
1066
954
|
/**
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
955
|
+
* Trigger activation check for all scheduled configs.
|
|
956
|
+
* Normally called by a scheduler, but exposed for manual triggering.
|
|
957
|
+
*/
|
|
1070
958
|
checkScheduled: alepha_server0.ActionPrimitiveFn<{
|
|
1071
|
-
response:
|
|
1072
|
-
message:
|
|
959
|
+
response: alepha624.TObject<{
|
|
960
|
+
message: alepha624.TString;
|
|
1073
961
|
}>;
|
|
1074
962
|
}>;
|
|
1075
963
|
}
|
|
@@ -1086,8 +974,8 @@ declare class ConfigActivationScheduler {
|
|
|
1086
974
|
protected readonly log: alepha_logger0.Logger;
|
|
1087
975
|
protected readonly store: ConfigStore;
|
|
1088
976
|
/**
|
|
1089
|
-
|
|
1090
|
-
|
|
977
|
+
* Check for scheduled configurations every minute.
|
|
978
|
+
*/
|
|
1091
979
|
checkActivations: alepha_scheduler0.SchedulerPrimitive;
|
|
1092
980
|
}
|
|
1093
981
|
//#endregion
|
|
@@ -1128,7 +1016,7 @@ declare class ConfigActivationScheduler {
|
|
|
1128
1016
|
*
|
|
1129
1017
|
* @module alepha.api.parameters
|
|
1130
1018
|
*/
|
|
1131
|
-
declare const AlephaApiParameters:
|
|
1019
|
+
declare const AlephaApiParameters: alepha624.Service<alepha624.Module>;
|
|
1132
1020
|
//#endregion
|
|
1133
1021
|
export { $config, AdminConfigController, AlephaApiParameters, ConfigActivationScheduler, ConfigPrimitive, ConfigPrimitiveOptions, ConfigStore, ConfigSyncPayload, ConfigTreeNode, Parameter, ParameterInsert, type ParameterStatus, SaveConfigOptions, SetConfigOptions, parameters };
|
|
1134
1022
|
//# sourceMappingURL=index.d.ts.map
|