alepha 0.13.2 → 0.13.4
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 +7 -7
- package/dist/api-files/index.browser.js +80 -0
- package/dist/api-files/index.browser.js.map +1 -0
- package/dist/api-files/index.d.ts +175 -175
- package/dist/api-jobs/index.browser.js +56 -0
- package/dist/api-jobs/index.browser.js.map +1 -0
- package/dist/api-jobs/index.d.ts +156 -156
- package/dist/api-notifications/index.browser.js +382 -0
- package/dist/api-notifications/index.browser.js.map +1 -0
- package/dist/api-notifications/index.d.ts +221 -166
- package/dist/api-notifications/index.js +107 -55
- package/dist/api-notifications/index.js.map +1 -1
- package/dist/api-parameters/index.browser.js +29 -0
- package/dist/api-parameters/index.browser.js.map +1 -0
- package/dist/api-users/index.d.ts +16 -3
- package/dist/api-users/index.js +75 -28
- package/dist/api-users/index.js.map +1 -1
- package/dist/api-verifications/index.browser.js +52 -0
- package/dist/api-verifications/index.browser.js.map +1 -0
- package/dist/api-verifications/index.d.ts +120 -98
- package/dist/api-verifications/index.js +1 -1
- package/dist/api-verifications/index.js.map +1 -1
- package/dist/batch/index.js +0 -5
- package/dist/batch/index.js.map +1 -1
- package/dist/bucket/index.js +7 -5
- package/dist/bucket/index.js.map +1 -1
- package/dist/cli/{dist-Dl9Vl7Ur.js → dist-lGnqsKpu.js} +11 -15
- package/dist/cli/dist-lGnqsKpu.js.map +1 -0
- package/dist/cli/index.d.ts +26 -45
- package/dist/cli/index.js +40 -58
- package/dist/cli/index.js.map +1 -1
- package/dist/command/index.d.ts +1 -0
- package/dist/command/index.js +9 -0
- package/dist/command/index.js.map +1 -1
- package/dist/core/index.browser.js +5 -1
- package/dist/core/index.browser.js.map +1 -1
- package/dist/core/index.d.ts +221 -219
- package/dist/core/index.js +5 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.native.js +5 -1
- package/dist/core/index.native.js.map +1 -1
- package/dist/email/index.d.ts +4 -4
- package/dist/email/index.js +5 -0
- package/dist/email/index.js.map +1 -1
- package/dist/orm/index.d.ts +19 -19
- package/dist/orm/index.js +3 -3
- package/dist/orm/index.js.map +1 -1
- package/dist/redis/index.d.ts +10 -10
- package/dist/security/index.d.ts +28 -28
- package/dist/security/index.js +3 -3
- package/dist/security/index.js.map +1 -1
- package/dist/server/index.d.ts +9 -9
- package/dist/server-auth/index.d.ts +152 -152
- package/dist/server-cookies/index.js +2 -2
- package/dist/server-cookies/index.js.map +1 -1
- package/dist/server-links/index.d.ts +33 -33
- package/dist/server-security/index.d.ts +9 -9
- package/dist/server-static/index.js +18 -2
- package/dist/server-static/index.js.map +1 -1
- package/package.json +16 -6
- package/src/api-files/index.browser.ts +17 -0
- package/src/api-jobs/index.browser.ts +15 -0
- package/src/api-notifications/controllers/NotificationController.ts +26 -1
- package/src/api-notifications/index.browser.ts +17 -0
- package/src/api-notifications/index.ts +1 -0
- package/src/api-notifications/schemas/notificationQuerySchema.ts +13 -0
- package/src/api-notifications/services/NotificationService.ts +45 -2
- package/src/api-parameters/index.browser.ts +12 -0
- package/src/api-users/atoms/realmAuthSettingsAtom.ts +3 -1
- package/src/api-users/controllers/UserController.ts +21 -1
- package/src/api-users/primitives/$userRealm.ts +33 -10
- package/src/api-users/providers/UserRealmProvider.ts +1 -0
- package/src/api-users/services/SessionService.ts +2 -0
- package/src/api-users/services/UserService.ts +56 -16
- package/src/api-verifications/index.browser.ts +15 -0
- package/src/api-verifications/index.ts +1 -0
- package/src/batch/providers/BatchProvider.ts +0 -7
- package/src/bucket/index.ts +7 -5
- package/src/cli/apps/AlephaCli.ts +27 -1
- package/src/cli/apps/AlephaPackageBuilderCli.ts +3 -0
- package/src/cli/commands/CoreCommands.ts +6 -2
- package/src/cli/commands/ViteCommands.ts +2 -1
- package/src/cli/services/ProjectUtils.ts +40 -75
- package/src/command/helpers/Asker.ts +10 -0
- package/src/core/Alepha.ts +14 -0
- package/src/core/primitives/$module.ts +1 -1
- package/src/email/index.ts +13 -5
- package/src/orm/providers/drivers/NodeSqliteProvider.ts +3 -3
- package/src/server-cookies/providers/ServerCookiesProvider.ts +2 -1
- package/src/server-static/providers/ServerStaticProvider.ts +18 -3
- package/dist/cli/dist-Dl9Vl7Ur.js.map +0 -1
package/dist/orm/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as alepha6 from "alepha";
|
|
2
2
|
import { Alepha, AlephaError, KIND, Page, Page as Page$1, PageQuery, PageQuery as PageQuery$1, Primitive, Service, Static, StaticEncode, TBigInt, TInteger, TNull, TNumber, TNumberOptions, TObject, TObjectOptions, TOptional, TPage, TSchema, TString, TStringOptions, TUnion, TUnsafe, pageQuerySchema, pageSchema } from "alepha";
|
|
3
3
|
import { DateTime, DateTimeProvider } from "alepha/datetime";
|
|
4
4
|
import * as drizzle_orm0 from "drizzle-orm";
|
|
@@ -1061,11 +1061,11 @@ declare class DrizzleKitProvider {
|
|
|
1061
1061
|
*/
|
|
1062
1062
|
importDrizzleKit(): typeof DrizzleKit;
|
|
1063
1063
|
}
|
|
1064
|
-
declare const devMigrationsSchema:
|
|
1065
|
-
id:
|
|
1066
|
-
name:
|
|
1067
|
-
snapshot:
|
|
1068
|
-
created_at:
|
|
1064
|
+
declare const devMigrationsSchema: alepha6.TObject<{
|
|
1065
|
+
id: alepha6.TNumber;
|
|
1066
|
+
name: alepha6.TString;
|
|
1067
|
+
snapshot: alepha6.TString;
|
|
1068
|
+
created_at: alepha6.TString;
|
|
1069
1069
|
}>;
|
|
1070
1070
|
type DevMigrations = Static<typeof devMigrationsSchema>;
|
|
1071
1071
|
//#endregion
|
|
@@ -1262,7 +1262,7 @@ declare class QueryManager {
|
|
|
1262
1262
|
createPagination<T>(entities: T[], limit?: number, offset?: number, sort?: Array<{
|
|
1263
1263
|
column: string;
|
|
1264
1264
|
direction: "asc" | "desc";
|
|
1265
|
-
}>):
|
|
1265
|
+
}>): alepha6.Page<T>;
|
|
1266
1266
|
}
|
|
1267
1267
|
interface PgJoin {
|
|
1268
1268
|
table: string;
|
|
@@ -1732,7 +1732,7 @@ declare class PostgresModelBuilder extends ModelBuilder {
|
|
|
1732
1732
|
declare module "alepha" {
|
|
1733
1733
|
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
1734
1734
|
}
|
|
1735
|
-
declare const envSchema:
|
|
1735
|
+
declare const envSchema: alepha6.TObject<{
|
|
1736
1736
|
/**
|
|
1737
1737
|
* Main configuration for database connection.
|
|
1738
1738
|
* Accept a string in the format of a Postgres connection URL.
|
|
@@ -1740,13 +1740,13 @@ declare const envSchema: alepha1.TObject<{
|
|
|
1740
1740
|
* or
|
|
1741
1741
|
* Example: postgres://user:password@localhost:5432/database?sslmode=require
|
|
1742
1742
|
*/
|
|
1743
|
-
DATABASE_URL:
|
|
1743
|
+
DATABASE_URL: alepha6.TOptional<alepha6.TString>;
|
|
1744
1744
|
/**
|
|
1745
1745
|
* In addition to the DATABASE_URL, you can specify the postgres schema name.
|
|
1746
1746
|
*
|
|
1747
1747
|
* It will monkey patch drizzle tables.
|
|
1748
1748
|
*/
|
|
1749
|
-
POSTGRES_SCHEMA:
|
|
1749
|
+
POSTGRES_SCHEMA: alepha6.TOptional<alepha6.TString>;
|
|
1750
1750
|
}>;
|
|
1751
1751
|
declare class NodePostgresProvider extends DatabaseProvider {
|
|
1752
1752
|
static readonly SSL_MODES: readonly ["require", "allow", "prefer", "verify-full"];
|
|
@@ -1779,8 +1779,8 @@ declare class NodePostgresProvider extends DatabaseProvider {
|
|
|
1779
1779
|
*/
|
|
1780
1780
|
get db(): PostgresJsDatabase;
|
|
1781
1781
|
protected executeMigrations(migrationsFolder: string): Promise<void>;
|
|
1782
|
-
protected readonly onStart:
|
|
1783
|
-
protected readonly onStop:
|
|
1782
|
+
protected readonly onStart: alepha6.HookPrimitive<"start">;
|
|
1783
|
+
protected readonly onStop: alepha6.HookPrimitive<"stop">;
|
|
1784
1784
|
connect(): Promise<void>;
|
|
1785
1785
|
close(): Promise<void>;
|
|
1786
1786
|
protected migrate: alepha_lock0.LockPrimitive<() => Promise<void>>;
|
|
@@ -1955,8 +1955,8 @@ type SchemaToSqliteBuilder<T extends TObject> = { [key in keyof T["properties"]]
|
|
|
1955
1955
|
/**
|
|
1956
1956
|
* Configuration options for the Node.js SQLite database provider.
|
|
1957
1957
|
*/
|
|
1958
|
-
declare const nodeSqliteOptions:
|
|
1959
|
-
path:
|
|
1958
|
+
declare const nodeSqliteOptions: alepha6.Atom<alepha6.TObject<{
|
|
1959
|
+
path: alepha6.TOptional<alepha6.TString>;
|
|
1960
1960
|
}>, "alepha.postgres.node-sqlite.options">;
|
|
1961
1961
|
type NodeSqliteProviderOptions = Static<typeof nodeSqliteOptions.schema>;
|
|
1962
1962
|
declare module "alepha" {
|
|
@@ -1986,7 +1986,7 @@ declare class NodeSqliteProvider extends DatabaseProvider {
|
|
|
1986
1986
|
get url(): string;
|
|
1987
1987
|
execute(query: SQLLike): Promise<Array<Record<string, unknown>>>;
|
|
1988
1988
|
readonly db: PgDatabase<any>;
|
|
1989
|
-
protected readonly onStart:
|
|
1989
|
+
protected readonly onStart: alepha6.HookPrimitive<"start">;
|
|
1990
1990
|
protected executeMigrations(migrationsFolder: string): Promise<void>;
|
|
1991
1991
|
}
|
|
1992
1992
|
//#endregion
|
|
@@ -2045,7 +2045,7 @@ declare class PostgresTypeProvider {
|
|
|
2045
2045
|
* This is used to mark rows as deleted without actually removing them from the database.
|
|
2046
2046
|
* The column is nullable - NULL means not deleted, timestamp means deleted.
|
|
2047
2047
|
*/
|
|
2048
|
-
readonly deletedAt: (options?: TStringOptions) => PgAttr<
|
|
2048
|
+
readonly deletedAt: (options?: TStringOptions) => PgAttr<alepha6.TOptional<TString>, typeof PG_DELETED_AT>;
|
|
2049
2049
|
/**
|
|
2050
2050
|
* Creates a Postgres ENUM type.
|
|
2051
2051
|
*
|
|
@@ -2077,7 +2077,7 @@ declare const pg: PostgresTypeProvider;
|
|
|
2077
2077
|
declare class RepositoryProvider {
|
|
2078
2078
|
protected readonly alepha: Alepha;
|
|
2079
2079
|
protected readonly registry: Map<EntityPrimitive<any>, Service<Repository<any>>>;
|
|
2080
|
-
getRepositories(provider?: DatabaseProvider): Repository<TObject<
|
|
2080
|
+
getRepositories(provider?: DatabaseProvider): Repository<TObject<alepha6.TProperties>>[];
|
|
2081
2081
|
getRepository<T extends TObject>(entity: EntityPrimitive<T>): Repository<T>;
|
|
2082
2082
|
createClassRepository<T extends TObject>(entity: EntityPrimitive<T>): Service<Repository<T>>;
|
|
2083
2083
|
}
|
|
@@ -2086,7 +2086,7 @@ declare class RepositoryProvider {
|
|
|
2086
2086
|
/**
|
|
2087
2087
|
* @deprecated Use `pg.primaryKey()` instead.
|
|
2088
2088
|
*/
|
|
2089
|
-
declare const legacyIdSchema: PgAttr<PgAttr<PgAttr<
|
|
2089
|
+
declare const legacyIdSchema: PgAttr<PgAttr<PgAttr<alepha6.TInteger, typeof PG_PRIMARY_KEY>, typeof PG_SERIAL>, typeof PG_DEFAULT>;
|
|
2090
2090
|
//#endregion
|
|
2091
2091
|
//#region src/orm/types/schema.d.ts
|
|
2092
2092
|
/**
|
|
@@ -2207,7 +2207,7 @@ declare module "alepha" {
|
|
|
2207
2207
|
* @see {@link $transaction}
|
|
2208
2208
|
* @module alepha.postgres
|
|
2209
2209
|
*/
|
|
2210
|
-
declare const AlephaPostgres:
|
|
2210
|
+
declare const AlephaPostgres: alepha6.Service<alepha6.Module>;
|
|
2211
2211
|
//#endregion
|
|
2212
2212
|
export { $entity, $repository, $sequence, $transaction, AlephaPostgres, DatabaseProvider, DbConflictError, DbEntityNotFoundError, DbError, DbMigrationError, DbVersionMismatchError, DrizzleKitProvider, EntityColumn, EntityColumns, EntityPrimitive, EntityPrimitiveOptions, FilterOperators, FromSchema, NodePostgresProvider, NodeSqliteProvider, NodeSqliteProviderOptions, OrderBy, OrderByClause, OrderDirection, PG_CREATED_AT, PG_DEFAULT, PG_DELETED_AT, PG_ENUM, PG_IDENTITY, PG_PRIMARY_KEY, PG_REF, PG_SERIAL, PG_UPDATED_AT, PG_VERSION, type Page, type PageQuery, PgAttr, PgAttrField, PgDefault, PgEnumOptions, PgIdentityOptions, PgPrimaryKey, PgQuery, PgQueryRelations, PgQueryWhere, PgQueryWhereOrSQL, PgRef, PgRefOptions, PgRelation, PgRelationMap, PgStatic, PgSymbolKeys, PgSymbols, PostgresTypeProvider, Repository, RepositoryProvider, SQLLike, SchemaToTableConfig, SequencePrimitive, SequencePrimitiveOptions, StatementOptions, TObjectInsert, TObjectUpdate, TransactionContext, TransactionPrimitiveOptions, buildQueryString, drizzle_orm0 as drizzle, getAttrFields, insertSchema, legacyIdSchema, nodeSqliteOptions, pageQuerySchema, pageSchema, parseQueryString, pg, pgAttr, schema, sql, updateSchema };
|
|
2213
2213
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/orm/index.js
CHANGED
|
@@ -2239,8 +2239,8 @@ var NodeSqliteProvider = class extends DatabaseProvider {
|
|
|
2239
2239
|
if (path.startsWith("postgres://")) throw new AlephaError("Postgres URL is not supported for SQLite provider.");
|
|
2240
2240
|
return path;
|
|
2241
2241
|
}
|
|
2242
|
-
if (this.alepha.isTest()) return ":memory:";
|
|
2243
|
-
else return "node_modules/sqlite.db";
|
|
2242
|
+
if (this.alepha.isTest() || this.alepha.isServerless()) return ":memory:";
|
|
2243
|
+
else return "node_modules/.alepha/sqlite.db";
|
|
2244
2244
|
}
|
|
2245
2245
|
async execute(query) {
|
|
2246
2246
|
const { sql: sql$2, params, method } = this.db.all(query).getQuery();
|
|
@@ -2278,7 +2278,7 @@ var NodeSqliteProvider = class extends DatabaseProvider {
|
|
|
2278
2278
|
const filepath = this.url.replace("sqlite://", "");
|
|
2279
2279
|
if (filepath !== ":memory:" && filepath !== "") {
|
|
2280
2280
|
const dirname = filepath.split("/").slice(0, -1).join("/");
|
|
2281
|
-
if (dirname) await mkdir(dirname, { recursive: true });
|
|
2281
|
+
if (dirname) await mkdir(dirname, { recursive: true }).catch(() => null);
|
|
2282
2282
|
}
|
|
2283
2283
|
this.sqlite = new DatabaseSync(filepath);
|
|
2284
2284
|
await this.migrateDatabase();
|