@optimatech88/titomeet-shared-lib 1.0.51 โ 1.0.53
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/.github/workflows/npm-publish.yml +34 -0
- package/Readme +142 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/prisma/schema.prisma +467 -466
- package/prisma/migrations/20250528182042_updated_user_model/migration.sql +0 -11
- package/prisma/migrations/20250530152731_updated_model/migration.sql +0 -1
- package/prisma/migrations/20250530152845_updated_model/migration.sql +0 -1
- package/prisma/migrations/20250604094431_added_user_interests/migration.sql +0 -16
- package/prisma/migrations/20250604105002_added_category_children/migration.sql +0 -31
- package/prisma/migrations/20250611180441_added_chat_files/migration.sql +0 -11
- package/prisma/migrations/20250617111807_updated_notification_type/migration.sql +0 -13
- package/prisma/migrations/20250716081532_added_newslettter/migration.sql +0 -13
- package/prisma/migrations/20250805002500_added_provider_on_event/migration.sql +0 -433
- package/prisma/migrations/20250805005727_added_status/migration.sql +0 -5
- package/prisma/migrations/20250805131004_added_pricing/migration.sql +0 -43
- package/prisma/migrations/20250805131431_added_expiration_time/migration.sql +0 -2
- package/prisma/migrations/20250805132756_added_ref/migration.sql +0 -2
- package/prisma/migrations/20250805145538_added_title/migration.sql +0 -12
- package/prisma/migrations/20250805145659_added_active/migration.sql +0 -2
- package/prisma/migrations/20250813221037_added_parent/migration.sql +0 -5
- package/prisma/migrations/20250814113100_added_ticker_seats/migration.sql +0 -2
- package/prisma/migrations/20250814113912_added_remaining_seats/migration.sql +0 -2
- package/prisma/migrations/20250822091756_updated_feedback/migration.sql +0 -16
- package/prisma/migrations/20250908103849_added_account_type/migration.sql +0 -6
- package/prisma/migrations/20251013165256_add_type_to_event_model/migration.sql +0 -7
- package/prisma/migrations/migration_lock.toml +0 -3
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
2
|
+
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
|
|
3
|
+
|
|
4
|
+
name: Node.js Package
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches:
|
|
9
|
+
- main # Or your main branch
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
- uses: actions/setup-node@v4
|
|
17
|
+
with:
|
|
18
|
+
node-version: 20
|
|
19
|
+
- run: npm ci
|
|
20
|
+
- run: npm run build
|
|
21
|
+
|
|
22
|
+
publish-npm:
|
|
23
|
+
needs: build
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/checkout@v4
|
|
27
|
+
- uses: actions/setup-node@v4
|
|
28
|
+
with:
|
|
29
|
+
node-version: 20
|
|
30
|
+
registry-url: https://registry.npmjs.org/
|
|
31
|
+
- run: npm ci
|
|
32
|
+
- run: npm publish --access public
|
|
33
|
+
env:
|
|
34
|
+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
package/Readme
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# @optimatech88/titomeet-shared-lib
|
|
2
|
+
|
|
3
|
+
A shared library designed to centralize the **Prisma schema**, **database models**, and **common NestJS utilities** used across microservices in the Titomeet ecosystem. This ensures consistent data structure and logic reuse between backend services.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## ๐ฆ Features
|
|
8
|
+
|
|
9
|
+
* Centralized **Prisma schema**
|
|
10
|
+
* Shared **NestJS modules & services** (e.g. auth utilities, helpers)
|
|
11
|
+
* Built-in **Seeder utilities** using `nestjs-seeder`
|
|
12
|
+
* Ships with TypeScript and supports Prisma generation
|
|
13
|
+
* Ready-to-integrate with any NestJS microservice
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## ๐ Installation
|
|
18
|
+
|
|
19
|
+
Install the shared library in your microservice project:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
yarn add @optimatech88/titomeet-shared-lib
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
*or*
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install @optimatech88/titomeet-shared-lib
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## โ๏ธ Usage
|
|
34
|
+
|
|
35
|
+
### 1. Configure Prisma to use the shared schema
|
|
36
|
+
|
|
37
|
+
In your consuming service's `package.json`, add:
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"prisma": {
|
|
42
|
+
"schema": "node_modules/@optimatech88/titomeet-shared-lib/prisma/schema.prisma"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
### 2. Generate Prisma Client
|
|
50
|
+
|
|
51
|
+
After installation or updates, run:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npx prisma generate
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
This will generate the Prisma Client in your consuming service's `node_modules/@prisma/client` based on the shared schema.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
### 3. Import Shared Services or Prisma Client
|
|
62
|
+
|
|
63
|
+
Example usage in a NestJS app:
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
import { PrismaService } from '@optimatech88/titomeet-shared-lib';
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
You can also import other shared services, modules, helpers, and types from this library.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## ๐งช Development
|
|
74
|
+
|
|
75
|
+
To contribute or update the library:
|
|
76
|
+
|
|
77
|
+
1. Install dependencies:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
yarn install
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
2. Make changes to the Prisma schema or NestJS modules.
|
|
84
|
+
|
|
85
|
+
3. To create a new migration and update your local dev database:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
npm run migrate:dev
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
4. Generate Prisma Client:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
npm run generate
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
5. Build the library:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
npm run build
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## ๐ฆ Publishing
|
|
106
|
+
|
|
107
|
+
Before publishing a new version:
|
|
108
|
+
|
|
109
|
+
1. Bump the package version:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
npm version patch # or minor/major
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
2. Publish to npm:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
npm publish
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
The `prepare` script will ensure Prisma and the build are up-to-date before publishing.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## โ ๏ธ Important Notes
|
|
126
|
+
|
|
127
|
+
* **Only one microservice should run migrations in production**. Others should sync using `prisma generate`.
|
|
128
|
+
* Avoid using `prisma db push` in production environments.
|
|
129
|
+
* Use `prisma migrate dev` for evolving your schema and developing locally.
|
|
130
|
+
* Always regenerate Prisma client in consuming services after package updates.
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## ๐ License
|
|
135
|
+
|
|
136
|
+
ISC
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## โจ Author
|
|
141
|
+
|
|
142
|
+
Built with โค๏ธ by the OptimaTech Team
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,eAAO,MAAM,iBAAiB,GAAI,OAAO,eAAe;;;;CAOvD,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,QAAQ,MAAM,WAA8B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@optimatech88/titomeet-shared-lib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.53",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
8
8
|
"build": "nest build",
|
|
9
9
|
"format": "prettier --write \"src/**/*.ts\"",
|
|
10
|
-
"generate": "
|
|
11
|
-
"
|
|
12
|
-
"
|
|
10
|
+
"generate": "prisma generate",
|
|
11
|
+
"migrate:dev": "prisma migrate dev",
|
|
12
|
+
"prepare": "npm run generate && npm run build"
|
|
13
13
|
},
|
|
14
14
|
"keywords": [],
|
|
15
15
|
"author": "",
|