@igstack/app-catalog-backend-core 0.1.1-alpha-20260304050203 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +11282 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5507 -117
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/prisma/schema.prisma +2 -2
- package/src/db/client.ts +20 -2
- package/src/db/prisma.ts +3 -0
- package/src/db/syncAppCatalog.ts +1 -1
- package/src/db/tableSyncMagazine.ts +1 -1
- package/src/db/tableSyncPrismaAdapter.ts +2 -3
- package/src/generated/prisma/browser.ts +59 -0
- package/src/generated/prisma/client.ts +83 -0
- package/src/generated/prisma/commonInputTypes.ts +658 -0
- package/src/generated/prisma/enums.ts +26 -0
- package/src/generated/prisma/internal/class.ts +274 -0
- package/src/generated/prisma/internal/prismaNamespace.ts +1506 -0
- package/src/generated/prisma/internal/prismaNamespaceBrowser.ts +250 -0
- package/src/generated/prisma/models/DbAppForCatalog.ts +1490 -0
- package/src/generated/prisma/models/DbAppTagDefinition.ts +1199 -0
- package/src/generated/prisma/models/DbApprovalMethod.ts +1181 -0
- package/src/generated/prisma/models/DbAsset.ts +1394 -0
- package/src/generated/prisma/models/account.ts +1632 -0
- package/src/generated/prisma/models/session.ts +1447 -0
- package/src/generated/prisma/models/user.ts +1562 -0
- package/src/generated/prisma/models/verification.ts +1180 -0
- package/src/generated/prisma/models.ts +19 -0
- package/src/generated/prisma/pjtg.ts +183 -0
- package/src/index.ts +3 -0
- package/src/middleware/database.ts +13 -2
- package/src/modules/approvalMethod/approvalMethodRouter.ts +1 -1
- package/src/modules/approvalMethod/syncApprovalMethods.ts +1 -1
- package/src/modules/assets/upsertAsset.ts +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
// biome-ignore-all lint: generated file
|
|
5
|
+
// @ts-nocheck
|
|
6
|
+
/*
|
|
7
|
+
* This is a barrel export file for all models and their related types.
|
|
8
|
+
*
|
|
9
|
+
* 🟢 You can import this file directly.
|
|
10
|
+
*/
|
|
11
|
+
export type * from './models/user'
|
|
12
|
+
export type * from './models/session'
|
|
13
|
+
export type * from './models/account'
|
|
14
|
+
export type * from './models/verification'
|
|
15
|
+
export type * from './models/DbApprovalMethod'
|
|
16
|
+
export type * from './models/DbAppForCatalog'
|
|
17
|
+
export type * from './models/DbAppTagDefinition'
|
|
18
|
+
export type * from './models/DbAsset'
|
|
19
|
+
export type * from './commonInputTypes'
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import * as Prisma from './internal/prismaNamespace';
|
|
2
|
+
declare global {
|
|
3
|
+
namespace PrismaJson {
|
|
4
|
+
// This namespace will always be empty. Definitions should be done by
|
|
5
|
+
// you manually, and merged automatically by typescript. Make sure that
|
|
6
|
+
// your declaration merging file is included in your tsconfig.json
|
|
7
|
+
//
|
|
8
|
+
// Learn more: https://github.com/arthurfiorette/prisma-json-types-generator/issues/143
|
|
9
|
+
// Declaration Merging: https://www.typescriptlang.org/docs/handbook/declaration-merging.html
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** A filter to be used against nullable List types. */
|
|
14
|
+
export type NullableListFilter<T> = {
|
|
15
|
+
equals?: T | T[] | null;
|
|
16
|
+
has?: T | null;
|
|
17
|
+
hasEvery?: T[];
|
|
18
|
+
hasSome?: T[];
|
|
19
|
+
isEmpty?: boolean;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** A type to determine how to update a json field */
|
|
23
|
+
export type UpdateInput<T> = T extends object ? { [P in keyof T]?: UpdateInput<T[P]> } : T;
|
|
24
|
+
|
|
25
|
+
/** A type to determine how to update a json[] field */
|
|
26
|
+
export type UpdateManyInput<T> = T | T[] | { set?: T[]; push?: T | T[] };
|
|
27
|
+
|
|
28
|
+
/** A type to determine how to create a json[] input */
|
|
29
|
+
export type CreateManyInput<T> = T | T[] | { set?: T[] };
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* A typed version of NestedStringFilter, allowing narrowing of string types to
|
|
33
|
+
* discriminated unions.
|
|
34
|
+
*/
|
|
35
|
+
export type TypedNestedStringFilter<S extends string> =
|
|
36
|
+
//@ts-ignore - When Prisma.StringFilter is not present, this type is not used
|
|
37
|
+
Prisma.StringFilter & {
|
|
38
|
+
equals?: S;
|
|
39
|
+
in?: S[];
|
|
40
|
+
notIn?: S[];
|
|
41
|
+
not?: TypedNestedStringFilter<S> | S;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* A typed version of StringFilter, allowing narrowing of string types to discriminated
|
|
46
|
+
* unions.
|
|
47
|
+
*/
|
|
48
|
+
export type TypedStringFilter<S extends string> =
|
|
49
|
+
//@ts-ignore - When Prisma.StringFilter is not present, this type is not used
|
|
50
|
+
Prisma.StringFilter & {
|
|
51
|
+
equals?: S;
|
|
52
|
+
in?: S[];
|
|
53
|
+
notIn?: S[];
|
|
54
|
+
not?: TypedNestedStringFilter<S> | S;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* A typed version of NestedStringNullableFilter, allowing narrowing of string types to
|
|
59
|
+
* discriminated unions.
|
|
60
|
+
*/
|
|
61
|
+
export type TypedNestedStringNullableFilter<S extends string> =
|
|
62
|
+
//@ts-ignore - When Prisma.StringNullableFilter is not present, this type is not used
|
|
63
|
+
Prisma.StringNullableFilter & {
|
|
64
|
+
equals?: S | null;
|
|
65
|
+
in?: S[] | null;
|
|
66
|
+
notIn?: S[] | null;
|
|
67
|
+
not?: TypedNestedStringNullableFilter<S> | S | null;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* A typed version of StringNullableFilter, allowing narrowing of string types to
|
|
72
|
+
* discriminated unions.
|
|
73
|
+
*/
|
|
74
|
+
export type TypedStringNullableFilter<S extends string> =
|
|
75
|
+
//@ts-ignore - When Prisma.StringNullableFilter is not present, this type is not used
|
|
76
|
+
Prisma.StringNullableFilter & {
|
|
77
|
+
equals?: S | null;
|
|
78
|
+
in?: S[] | null;
|
|
79
|
+
notIn?: S[] | null;
|
|
80
|
+
not?: TypedNestedStringNullableFilter<S> | S | null;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* A typed version of NestedStringWithAggregatesFilter, allowing narrowing of string types
|
|
85
|
+
* to discriminated unions.
|
|
86
|
+
*/
|
|
87
|
+
export type TypedNestedStringWithAggregatesFilter<S extends string> =
|
|
88
|
+
//@ts-ignore - When Prisma.NestedStringWithAggregatesFilter is not present, this type is not used
|
|
89
|
+
Prisma.NestedStringWithAggregatesFilter & {
|
|
90
|
+
equals?: S;
|
|
91
|
+
in?: S[];
|
|
92
|
+
notIn?: S[];
|
|
93
|
+
not?: TypedNestedStringWithAggregatesFilter<S> | S;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* A typed version of StringWithAggregatesFilter, allowing narrowing of string types to
|
|
98
|
+
* discriminated unions.
|
|
99
|
+
*/
|
|
100
|
+
export type TypedStringWithAggregatesFilter<S extends string> =
|
|
101
|
+
//@ts-ignore - When Prisma.StringWithAggregatesFilter is not present, this type is not used
|
|
102
|
+
Prisma.StringWithAggregatesFilter & {
|
|
103
|
+
equals?: S;
|
|
104
|
+
in?: S[];
|
|
105
|
+
notIn?: S[];
|
|
106
|
+
not?: TypedNestedStringWithAggregatesFilter<S> | S;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* A typed version of NestedStringNullableWithAggregatesFilter, allowing narrowing of
|
|
111
|
+
* string types to discriminated unions.
|
|
112
|
+
*/
|
|
113
|
+
export type TypedNestedStringNullableWithAggregatesFilter<S extends string> =
|
|
114
|
+
//@ts-ignore - When Prisma.NestedStringNullableWithAggregatesFilter is not present, this type is not used
|
|
115
|
+
Prisma.NestedStringNullableWithAggregatesFilter & {
|
|
116
|
+
equals?: S | null;
|
|
117
|
+
in?: S[] | null;
|
|
118
|
+
notIn?: S[] | null;
|
|
119
|
+
not?: TypedNestedStringNullableWithAggregatesFilter<S> | S | null;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* A typed version of StringNullableWithAggregatesFilter, allowing narrowing of string
|
|
124
|
+
* types to discriminated unions.
|
|
125
|
+
*/
|
|
126
|
+
export type TypedStringNullableWithAggregatesFilter<S extends string> =
|
|
127
|
+
//@ts-ignore - When Prisma.StringNullableWithAggregatesFilter is not present, this type is not used
|
|
128
|
+
Prisma.StringNullableWithAggregatesFilter & {
|
|
129
|
+
equals?: S | null;
|
|
130
|
+
in?: S[] | null;
|
|
131
|
+
notIn?: S[] | null;
|
|
132
|
+
not?: TypedNestedStringNullableWithAggregatesFilter<S> | S | null;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* A typed version of StringFieldUpdateOperationsInput, allowing narrowing of string types
|
|
137
|
+
* to discriminated unions.
|
|
138
|
+
*/
|
|
139
|
+
export type TypedStringFieldUpdateOperationsInput<S extends string> =
|
|
140
|
+
//@ts-ignore - When Prisma.StringFieldUpdateOperationsInput is not present, this type is not used
|
|
141
|
+
Prisma.StringFieldUpdateOperationsInput & {
|
|
142
|
+
set?: S;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* A typed version of NullableStringFieldUpdateOperationsInput, allowing narrowing of
|
|
147
|
+
* string types to discriminated unions.
|
|
148
|
+
*/
|
|
149
|
+
export type TypedNullableStringFieldUpdateOperationsInput<S extends string> =
|
|
150
|
+
//@ts-ignore - When Prisma.NullableStringFieldUpdateOperationsInput is not present, this type is not used
|
|
151
|
+
Prisma.NullableStringFieldUpdateOperationsInput & {
|
|
152
|
+
set?: S | null;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* A typed version of StringNullableListFilter, allowing narrowing of string types to
|
|
157
|
+
* discriminated unions.
|
|
158
|
+
*/
|
|
159
|
+
export type TypedStringNullableListFilter<S extends string> =
|
|
160
|
+
//@ts-ignore - When Prisma.StringNullableListFilter is not present, this type is not used
|
|
161
|
+
Prisma.StringNullableListFilter & {
|
|
162
|
+
equals?: S[] | null;
|
|
163
|
+
has?: S | null;
|
|
164
|
+
hasEvery?: S[];
|
|
165
|
+
hasSome?: S[];
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* A typed version of the input type to update a string[] field, allowing narrowing of
|
|
170
|
+
* string types to discriminated unions.
|
|
171
|
+
*/
|
|
172
|
+
export type UpdateStringArrayInput<S extends string> = {
|
|
173
|
+
set?: S[];
|
|
174
|
+
push?: S | S[];
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* A typed version of the input type to create a string[] field, allowing narrowing of
|
|
179
|
+
* string types to discriminated unions.
|
|
180
|
+
*/
|
|
181
|
+
export type CreateStringArrayInput<S extends string> = {
|
|
182
|
+
set?: S[];
|
|
183
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -116,6 +116,9 @@ export {
|
|
|
116
116
|
type TableSyncParamsPrisma,
|
|
117
117
|
} from './db'
|
|
118
118
|
|
|
119
|
+
// Prisma types (re-export from generated client for external packages)
|
|
120
|
+
export type { Prisma, PrismaClient } from './db/prisma'
|
|
121
|
+
|
|
119
122
|
// Middleware (batteries-included backend setup)
|
|
120
123
|
export {
|
|
121
124
|
createEhMiddleware,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { PrismaClient } from '
|
|
1
|
+
import { PrismaClient } from '../db/prisma'
|
|
2
|
+
import { PrismaPg } from '@prisma/adapter-pg'
|
|
3
|
+
import pg from 'pg'
|
|
2
4
|
import type { EhDatabaseConfig } from './types'
|
|
3
5
|
import { setDbClient } from '../db/client'
|
|
4
6
|
|
|
@@ -20,6 +22,7 @@ function formatConnectionUrl(config: EhDatabaseConfig): string {
|
|
|
20
22
|
*/
|
|
21
23
|
export class EhDatabaseManager {
|
|
22
24
|
private client: PrismaClient | null = null
|
|
25
|
+
private pool: pg.Pool | null = null
|
|
23
26
|
private config: EhDatabaseConfig
|
|
24
27
|
|
|
25
28
|
constructor(config: EhDatabaseConfig) {
|
|
@@ -34,8 +37,12 @@ export class EhDatabaseManager {
|
|
|
34
37
|
if (!this.client) {
|
|
35
38
|
const datasourceUrl = formatConnectionUrl(this.config)
|
|
36
39
|
|
|
40
|
+
// Prisma 7 with adapter: Create pg pool and wrap with adapter
|
|
41
|
+
this.pool = new pg.Pool({ connectionString: datasourceUrl })
|
|
42
|
+
const adapter = new PrismaPg(this.pool)
|
|
43
|
+
|
|
37
44
|
this.client = new PrismaClient({
|
|
38
|
-
|
|
45
|
+
adapter,
|
|
39
46
|
log:
|
|
40
47
|
process.env.NODE_ENV === 'development'
|
|
41
48
|
? ['warn', 'error']
|
|
@@ -58,5 +65,9 @@ export class EhDatabaseManager {
|
|
|
58
65
|
await this.client.$disconnect()
|
|
59
66
|
this.client = null
|
|
60
67
|
}
|
|
68
|
+
if (this.pool) {
|
|
69
|
+
await this.pool.end()
|
|
70
|
+
this.pool = null
|
|
71
|
+
}
|
|
61
72
|
}
|
|
62
73
|
}
|