@jayfong/x-server 1.33.0 → 1.33.1

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/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.33.1](https://github.com/jfWorks/x-server/compare/v1.33.0...v1.33.1) (2022-06-12)
6
+
5
7
  ## [1.33.0](https://github.com/jfWorks/x-server/compare/v1.32.1...v1.33.0) (2022-06-11)
6
8
 
7
9
 
@@ -1,11 +1,11 @@
1
1
  import { x, HttpError } from '@jayfong/x-server'
2
2
  import { PrismaClient } from '@prisma/client'
3
3
 
4
- const prisma = new PrismaClient({
4
+ export const prismaClient = new PrismaClient({
5
5
  rejectOnNotFound: err => new HttpError.NotFound(err.message),
6
6
  })
7
7
 
8
- x.dispose.add(() => prisma.$disconnect())
8
+ x.dispose.add(() => prismaClient.$disconnect())
9
9
 
10
10
  type ModelName =
11
11
  // @index('../.prisma/client/index.d.ts', /(?<=const ModelName:).+?(?=\})/s, /(\S+?):/g, (m, _) => `| '${_.camel(m[1])}'`)
@@ -14,7 +14,7 @@ type ModelName =
14
14
 
15
15
  function makeBaseModel<TModelName extends ModelName>(name: TModelName) {
16
16
  return class BaseModel {
17
- public query = prisma[name]
17
+ public query = prismaClient[name]
18
18
  }
19
19
  }
20
20
 
@@ -1,11 +1,11 @@
1
1
  import { x, HttpError } from '@jayfong/x-server'
2
2
  import { PrismaClient } from '@prisma/client'
3
3
 
4
- const prisma = new PrismaClient({
4
+ export const prismaClient = new PrismaClient({
5
5
  rejectOnNotFound: err => new HttpError.NotFound(err.message),
6
6
  })
7
7
 
8
- x.dispose.add(() => prisma.$disconnect())
8
+ x.dispose.add(() => prismaClient.$disconnect())
9
9
 
10
10
  type ModelName =
11
11
  // @index('../.prisma/client/index.d.ts', /(?<=const ModelName:).+?(?=\})/s, /(\S+?):/g, (m, _) => `| '${_.camel(m[1])}'`)
@@ -14,7 +14,7 @@ type ModelName =
14
14
 
15
15
  function makeBaseModel<TModelName extends ModelName>(name: TModelName) {
16
16
  return class BaseModel {
17
- public query = prisma[name]
17
+ public query = prismaClient[name]
18
18
  }
19
19
  }
20
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jayfong/x-server",
3
- "version": "1.33.0",
3
+ "version": "1.33.1",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "lib/_cjs/index.js",