@m5kdev/backend 0.8.3 → 0.8.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.
@@ -1,7 +1,7 @@
1
1
  import { ServerResultAsync } from "../base/base.dto.mjs";
2
2
  import { BaseTableRepository } from "../base/base.repository.mjs";
3
- import { InferInsertModel, InferSelectModel } from "drizzle-orm";
4
3
  import * as _$drizzle_orm_sqlite_core0 from "drizzle-orm/sqlite-core";
4
+ import { InferInsertModel, InferSelectModel } from "drizzle-orm";
5
5
  import { LibSQLDatabase } from "drizzle-orm/libsql";
6
6
 
7
7
  //#region src/modules/ai/ai.repository.d.ts
@@ -1,5 +1,5 @@
1
- import { BaseTableRepository } from "../base/base.repository.mjs";
2
1
  import { ai_db_exports } from "./ai.db.mjs";
2
+ import { BaseTableRepository } from "../base/base.repository.mjs";
3
3
  import { eq, sql } from "drizzle-orm";
4
4
  import { ok } from "neverthrow";
5
5
  //#region src/modules/ai/ai.repository.ts
@@ -1,5 +1,5 @@
1
- import { BaseService } from "../base/base.service.mjs";
2
1
  import { repairJsonPrompt } from "./ai.prompts.mjs";
2
+ import { BaseService } from "../base/base.service.mjs";
3
3
  import { err, ok } from "neverthrow";
4
4
  import { OPENAI_TEXT_EMBEDDING_3_SMALL } from "@m5kdev/commons/modules/ai/ai.constants";
5
5
  import { arrayToPseudoXML } from "@m5kdev/commons/modules/ai/ai.utils";
@@ -2,8 +2,8 @@ import { LiteralUnion } from "../../../node_modules/.pnpm/@better-auth_core@1.4.
2
2
  import { BillingService } from "../billing/billing.service.mjs";
3
3
  import { EmailService } from "../email/email.service.mjs";
4
4
  import { sessions, users } from "./auth.db.mjs";
5
- import { InferSelectModel } from "drizzle-orm";
6
5
  import * as _$drizzle_orm_sqlite_core0 from "drizzle-orm/sqlite-core";
6
+ import { InferSelectModel } from "drizzle-orm";
7
7
  import * as _$better_auth0 from "better-auth";
8
8
  import { BetterAuthOptions, betterAuth } from "better-auth";
9
9
  import * as _$better_auth_api0 from "better-auth/api";
@@ -3279,14 +3279,14 @@ declare function createBetterAuth<O extends Orm, S extends Schema, E extends Ema
3279
3279
  $Infer: {
3280
3280
  body: ({
3281
3281
  permission: {
3282
- readonly user?: ("set-role" | "create" | "update" | "delete" | "list" | "get" | "ban" | "impersonate" | "set-password")[] | undefined;
3283
- readonly session?: ("delete" | "list" | "revoke")[] | undefined;
3282
+ readonly user?: ("update" | "list" | "delete" | "get" | "set-role" | "create" | "ban" | "impersonate" | "set-password")[] | undefined;
3283
+ readonly session?: ("list" | "delete" | "revoke")[] | undefined;
3284
3284
  };
3285
3285
  permissions?: never | undefined;
3286
3286
  } | {
3287
3287
  permissions: {
3288
- readonly user?: ("set-role" | "create" | "update" | "delete" | "list" | "get" | "ban" | "impersonate" | "set-password")[] | undefined;
3289
- readonly session?: ("delete" | "list" | "revoke")[] | undefined;
3288
+ readonly user?: ("update" | "list" | "delete" | "get" | "set-role" | "create" | "ban" | "impersonate" | "set-password")[] | undefined;
3289
+ readonly session?: ("list" | "delete" | "revoke")[] | undefined;
3290
3290
  };
3291
3291
  permission?: never | undefined;
3292
3292
  }) & {
@@ -1,6 +1,6 @@
1
1
  import { BetterAuth } from "./auth.lib.mjs";
2
- import { InferSelectModel } from "drizzle-orm";
3
2
  import * as _$drizzle_orm_sqlite_core0 from "drizzle-orm/sqlite-core";
3
+ import { InferSelectModel } from "drizzle-orm";
4
4
  import { NextFunction, Request, Response } from "express";
5
5
 
6
6
  //#region src/modules/auth/auth.middleware.d.ts
@@ -1,8 +1,8 @@
1
1
  import { auth_db_exports } from "./auth.db.mjs";
2
2
  import { BaseRepository } from "../base/base.repository.mjs";
3
+ import { v4 } from "uuid";
3
4
  import { and, count, desc, eq, gte, ne } from "drizzle-orm";
4
5
  import { ok } from "neverthrow";
5
- import { v4 } from "uuid";
6
6
  //#region src/modules/auth/auth.repository.ts
7
7
  ({ ...auth_db_exports });
8
8
  function parseOrganizationMetadata(metadata) {
@@ -1,6 +1,6 @@
1
1
  import { auth_db_exports } from "./auth.db.mjs";
2
- import { desc, eq } from "drizzle-orm";
3
2
  import { v4 } from "uuid";
3
+ import { desc, eq } from "drizzle-orm";
4
4
  //#region src/modules/auth/auth.utils.ts
5
5
  ({ ...auth_db_exports });
6
6
  async function getActiveOrganizationAndTeam(orm, schema, userId) {
@@ -1,7 +1,7 @@
1
1
  import { ServerResultAsync, pickColumns } from "./base.dto.mjs";
2
2
  import { Base } from "./base.abstract.mjs";
3
- import { InferInsertModel, InferSelectModel, SQL, SelectedFields } from "drizzle-orm";
4
3
  import { SQLiteColumn, SQLiteTableWithColumns } from "drizzle-orm/sqlite-core";
4
+ import { InferInsertModel, InferSelectModel, SQL, SelectedFields } from "drizzle-orm";
5
5
  import { QueryFilters, QueryInput } from "@m5kdev/commons/modules/schemas/query.schema";
6
6
  import { LibSQLDatabase } from "drizzle-orm/libsql";
7
7
 
@@ -1,8 +1,8 @@
1
1
  import { ServerResult, ServerResultAsync } from "../base/base.dto.mjs";
2
2
  import { BaseTableRepository } from "../base/base.repository.mjs";
3
3
  import { BillingSchema } from "@m5kdev/commons/modules/billing/billing.schema";
4
- import { InferSelectModel } from "drizzle-orm";
5
4
  import * as _$drizzle_orm_sqlite_core0 from "drizzle-orm/sqlite-core";
5
+ import { InferSelectModel } from "drizzle-orm";
6
6
  import { LibSQLDatabase } from "drizzle-orm/libsql";
7
7
  import { Stripe } from "stripe";
8
8
  import { StripePlan } from "@m5kdev/commons/modules/billing/billing.types";
@@ -29,15 +29,15 @@ declare const connectSelectOutputSchema: z.ZodObject<{
29
29
  updatedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
30
30
  expiresAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
31
31
  userId: z.ZodString;
32
- scope: z.ZodOptional<z.ZodNullable<z.ZodString>>;
33
32
  provider: z.ZodString;
34
- parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
33
+ scope: z.ZodOptional<z.ZodNullable<z.ZodString>>;
35
34
  accountType: z.ZodString;
36
35
  providerAccountId: z.ZodString;
37
36
  handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
38
37
  displayName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
39
38
  avatarUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
40
39
  tokenType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
40
+ parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
41
41
  metadataJson: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
42
42
  revokedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
43
43
  lastRefreshedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
@@ -53,15 +53,15 @@ declare const connectListOutputSchema: z.ZodArray<z.ZodObject<{
53
53
  updatedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
54
54
  expiresAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
55
55
  userId: z.ZodString;
56
- scope: z.ZodOptional<z.ZodNullable<z.ZodString>>;
57
56
  provider: z.ZodString;
58
- parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
57
+ scope: z.ZodOptional<z.ZodNullable<z.ZodString>>;
59
58
  accountType: z.ZodString;
60
59
  providerAccountId: z.ZodString;
61
60
  handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
62
61
  displayName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
63
62
  avatarUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
64
63
  tokenType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
64
+ parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
65
65
  metadataJson: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
66
66
  revokedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
67
67
  lastRefreshedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
@@ -1,8 +1,8 @@
1
1
  import { ServerResult } from "../base/base.dto.mjs";
2
2
  import { BaseTableRepository } from "../base/base.repository.mjs";
3
3
  import { ConnectListInputSchema } from "./connect.dto.mjs";
4
- import { InferInsertModel, InferSelectModel } from "drizzle-orm";
5
4
  import * as _$drizzle_orm_sqlite_core0 from "drizzle-orm/sqlite-core";
5
+ import { InferInsertModel, InferSelectModel } from "drizzle-orm";
6
6
  import { LibSQLDatabase } from "drizzle-orm/libsql";
7
7
 
8
8
  //#region src/modules/connect/connect.repository.d.ts
@@ -398,17 +398,17 @@ declare class ConnectRepository extends BaseTableRepository<Orm, Schema, Record<
398
398
  updatedAt: Date | null;
399
399
  expiresAt: Date | null;
400
400
  userId: string;
401
+ provider: string;
401
402
  accessToken: string;
402
403
  refreshToken: string | null;
403
404
  scope: string | null;
404
- provider: string;
405
- parentId: string | null;
406
405
  accountType: string;
407
406
  providerAccountId: string;
408
407
  handle: string | null;
409
408
  displayName: string | null;
410
409
  avatarUrl: string | null;
411
410
  tokenType: string | null;
411
+ parentId: string | null;
412
412
  metadataJson: unknown;
413
413
  revokedAt: Date | null;
414
414
  lastRefreshedAt: Date | null;
@@ -24,17 +24,17 @@ declare class ConnectService extends BaseService<{
24
24
  updatedAt: Date | null;
25
25
  expiresAt: Date | null;
26
26
  userId: string;
27
+ provider: string;
27
28
  accessToken: string;
28
29
  refreshToken: string | null;
29
30
  scope: string | null;
30
- provider: string;
31
- parentId: string | null;
32
31
  accountType: string;
33
32
  providerAccountId: string;
34
33
  handle: string | null;
35
34
  displayName: string | null;
36
35
  avatarUrl: string | null;
37
36
  tokenType: string | null;
37
+ parentId: string | null;
38
38
  metadataJson: unknown;
39
39
  revokedAt: Date | null;
40
40
  lastRefreshedAt: Date | null;
@@ -45,17 +45,17 @@ declare class ConnectService extends BaseService<{
45
45
  updatedAt: Date | null;
46
46
  expiresAt: Date | null;
47
47
  userId: string;
48
+ provider: string;
48
49
  accessToken: string;
49
50
  refreshToken: string | null;
50
51
  scope: string | null;
51
- provider: string;
52
- parentId: string | null;
53
52
  accountType: string;
54
53
  providerAccountId: string;
55
54
  handle: string | null;
56
55
  displayName: string | null;
57
56
  avatarUrl: string | null;
58
57
  tokenType: string | null;
58
+ parentId: string | null;
59
59
  metadataJson: unknown;
60
60
  revokedAt: Date | null;
61
61
  lastRefreshedAt: Date | null;
@@ -27,11 +27,11 @@ declare function createConnectTRPC({
27
27
  updatedAt?: Date | null | undefined;
28
28
  expiresAt?: Date | null | undefined;
29
29
  scope?: string | null | undefined;
30
- parentId?: string | null | undefined;
31
30
  handle?: string | null | undefined;
32
31
  displayName?: string | null | undefined;
33
32
  avatarUrl?: string | null | undefined;
34
33
  tokenType?: string | null | undefined;
34
+ parentId?: string | null | undefined;
35
35
  metadataJson?: unknown;
36
36
  revokedAt?: Date | null | undefined;
37
37
  lastRefreshedAt?: Date | null | undefined;
@@ -1,6 +1,6 @@
1
1
  import { BaseService } from "../base/base.service.mjs";
2
- import { err, ok } from "neverthrow";
3
2
  import { v4 } from "uuid";
3
+ import { err, ok } from "neverthrow";
4
4
  import path, { dirname } from "node:path";
5
5
  import { fileTypes } from "@m5kdev/commons/modules/file/file.constants";
6
6
  import { createWriteStream } from "node:fs";
@@ -1,7 +1,7 @@
1
1
  import { ServerResultAsync } from "../base/base.dto.mjs";
2
2
  import { BaseTableRepository } from "../base/base.repository.mjs";
3
- import { InferInsertModel, InferSelectModel } from "drizzle-orm";
4
3
  import * as _$drizzle_orm_sqlite_core0 from "drizzle-orm/sqlite-core";
4
+ import { InferInsertModel, InferSelectModel } from "drizzle-orm";
5
5
  import { LibSQLDatabase } from "drizzle-orm/libsql";
6
6
 
7
7
  //#region src/modules/recurrence/recurrence.repository.d.ts
@@ -18,7 +18,7 @@ declare class RecurrenceService extends BaseService<{
18
18
  filters?: {
19
19
  columnId: string;
20
20
  type: "string" | "number" | "boolean" | "date" | "enum";
21
- method: "contains" | "starts_with" | "ends_with" | "equals" | "greater_than" | "less_than" | "on" | "between" | "before" | "after" | "oneOf" | "intersect" | "isEmpty" | "isNotEmpty" | "is_null" | "is_not_null";
21
+ method: "intersect" | "on" | "contains" | "starts_with" | "ends_with" | "equals" | "greater_than" | "less_than" | "between" | "before" | "after" | "oneOf" | "isEmpty" | "isNotEmpty" | "is_null" | "is_not_null";
22
22
  value: string | number | boolean | string[];
23
23
  valueTo?: string | undefined;
24
24
  endColumnId?: string | undefined;
@@ -47,8 +47,8 @@ declare class RecurrenceService extends BaseService<{
47
47
  kind: string;
48
48
  enabled: boolean;
49
49
  recurrenceRules: {
50
- freq: number;
51
50
  interval: number;
51
+ freq: number;
52
52
  bysetpos?: number | number[] | null | undefined;
53
53
  bymonth?: number | number[] | null | undefined;
54
54
  bymonthday?: number | number[] | null | undefined;
@@ -21,7 +21,7 @@ declare function createRecurrenceTRPC({
21
21
  filters?: {
22
22
  columnId: string;
23
23
  type: "string" | "number" | "boolean" | "date" | "enum";
24
- method: "contains" | "starts_with" | "ends_with" | "equals" | "greater_than" | "less_than" | "on" | "between" | "before" | "after" | "oneOf" | "intersect" | "isEmpty" | "isNotEmpty" | "is_null" | "is_not_null";
24
+ method: "intersect" | "on" | "contains" | "starts_with" | "ends_with" | "equals" | "greater_than" | "less_than" | "between" | "before" | "after" | "oneOf" | "isEmpty" | "isNotEmpty" | "is_null" | "is_not_null";
25
25
  value: string | number | boolean | string[];
26
26
  valueTo?: string | undefined;
27
27
  endColumnId?: string | undefined;
@@ -50,8 +50,8 @@ declare function createRecurrenceTRPC({
50
50
  kind: string;
51
51
  enabled: boolean;
52
52
  recurrenceRules: {
53
- freq: number;
54
53
  interval: number;
54
+ freq: number;
55
55
  bysetpos?: number | number[] | null | undefined;
56
56
  bymonth?: number | number[] | null | undefined;
57
57
  bymonthday?: number | number[] | null | undefined;
@@ -150,8 +150,8 @@ declare function createRecurrenceTRPC({
150
150
  updateRule: _$_trpc_server0.TRPCMutationProcedure<{
151
151
  input: {
152
152
  id: string;
153
- freq: number;
154
153
  interval: number;
154
+ freq: number;
155
155
  bysetpos?: number | number[] | null | undefined;
156
156
  bymonth?: number | number[] | null | undefined;
157
157
  bymonthday?: number | number[] | null | undefined;
@@ -1,7 +1,7 @@
1
1
  import { ServerError } from "../../utils/errors.mjs";
2
2
  import { z } from "zod";
3
- import { Result } from "neverthrow";
4
3
  import * as _$drizzle_orm_sqlite_core0 from "drizzle-orm/sqlite-core";
4
+ import { Result } from "neverthrow";
5
5
  import * as _$drizzle_zod0 from "drizzle-zod";
6
6
 
7
7
  //#region src/modules/tag/tag.dto.d.ts
@@ -21,7 +21,7 @@ declare function createTagTRPC({
21
21
  filters?: {
22
22
  columnId: string;
23
23
  type: "string" | "number" | "boolean" | "date" | "enum";
24
- method: "contains" | "starts_with" | "ends_with" | "equals" | "greater_than" | "less_than" | "on" | "between" | "before" | "after" | "oneOf" | "intersect" | "isEmpty" | "isNotEmpty" | "is_null" | "is_not_null";
24
+ method: "intersect" | "on" | "contains" | "starts_with" | "ends_with" | "equals" | "greater_than" | "less_than" | "between" | "before" | "after" | "oneOf" | "isEmpty" | "isNotEmpty" | "is_null" | "is_not_null";
25
25
  value: string | number | boolean | string[];
26
26
  valueTo?: string | undefined;
27
27
  endColumnId?: string | undefined;
@@ -54,7 +54,7 @@ declare function createTagTRPC({
54
54
  resourceIds?: {
55
55
  columnId: string;
56
56
  type: "string" | "number" | "boolean" | "date" | "enum";
57
- method: "contains" | "starts_with" | "ends_with" | "equals" | "greater_than" | "less_than" | "on" | "between" | "before" | "after" | "oneOf" | "intersect" | "isEmpty" | "isNotEmpty" | "is_null" | "is_not_null";
57
+ method: "intersect" | "on" | "contains" | "starts_with" | "ends_with" | "equals" | "greater_than" | "less_than" | "between" | "before" | "after" | "oneOf" | "isEmpty" | "isNotEmpty" | "is_null" | "is_not_null";
58
58
  value: string | number | boolean | string[];
59
59
  valueTo?: string | undefined;
60
60
  endColumnId?: string | undefined;
@@ -1,6 +1,6 @@
1
1
  import { BaseService } from "../base/base.service.mjs";
2
- import { err, ok } from "neverthrow";
3
2
  import { v4 } from "uuid";
3
+ import { err, ok } from "neverthrow";
4
4
  import path from "node:path";
5
5
  import { closeSync, existsSync, mkdirSync, openSync } from "node:fs";
6
6
  import ffbin from "ffmpeg-ffprobe-static";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m5kdev/backend",
3
- "version": "0.8.3",
3
+ "version": "0.8.4",
4
4
  "description": "Composable Express server stack with Drizzle ORM and tRPC.",
5
5
  "license": "GPL-3.0-only",
6
6
  "repository": {
@@ -59,8 +59,8 @@
59
59
  "trpc-to-openapi": "2.3.0",
60
60
  "uuid": "11.0.5",
61
61
  "zod": "4.2.1",
62
- "@m5kdev/commons": "0.8.3",
63
- "@m5kdev/config": "0.8.3"
62
+ "@m5kdev/commons": "0.8.4",
63
+ "@m5kdev/config": "0.8.4"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@jest/globals": "30.2.0",