@optimatech88/titomeet-shared-lib 1.0.3 → 1.0.5
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/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/prisma/schema.prisma +51 -2
- package/src/index.ts +1 -1
|
@@ -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 test
|
|
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
|
|
33
|
+
env:
|
|
34
|
+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './auth/auth.guard';
|
|
2
|
-
export { PrismaClient, User, Account, UserRole, Event, EventAccess, EventVisibility, EventStatus, EventPrice } from '@prisma/client';
|
|
2
|
+
export { PrismaClient, User, Account, UserRole, Event, EventAccess, EventVisibility, EventStatus, EventPrice, Address, Participant, ParticipantStatus } from '@prisma/client';
|
|
3
3
|
export * from './auth/auth.guard';
|
|
4
4
|
export * from './auth/auth.module';
|
|
5
5
|
export * from './cache/cache.module';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAG9K,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AAExC,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.JwtService = exports.EventStatus = exports.EventVisibility = exports.EventAccess = exports.UserRole = exports.PrismaClient = void 0;
|
|
17
|
+
exports.JwtService = exports.ParticipantStatus = exports.EventStatus = exports.EventVisibility = exports.EventAccess = exports.UserRole = exports.PrismaClient = void 0;
|
|
18
18
|
__exportStar(require("./auth/auth.guard"), exports);
|
|
19
19
|
var client_1 = require("@prisma/client");
|
|
20
20
|
Object.defineProperty(exports, "PrismaClient", { enumerable: true, get: function () { return client_1.PrismaClient; } });
|
|
@@ -22,6 +22,7 @@ Object.defineProperty(exports, "UserRole", { enumerable: true, get: function ()
|
|
|
22
22
|
Object.defineProperty(exports, "EventAccess", { enumerable: true, get: function () { return client_1.EventAccess; } });
|
|
23
23
|
Object.defineProperty(exports, "EventVisibility", { enumerable: true, get: function () { return client_1.EventVisibility; } });
|
|
24
24
|
Object.defineProperty(exports, "EventStatus", { enumerable: true, get: function () { return client_1.EventStatus; } });
|
|
25
|
+
Object.defineProperty(exports, "ParticipantStatus", { enumerable: true, get: function () { return client_1.ParticipantStatus; } });
|
|
25
26
|
__exportStar(require("./auth/auth.guard"), exports);
|
|
26
27
|
__exportStar(require("./auth/auth.module"), exports);
|
|
27
28
|
__exportStar(require("./cache/cache.module"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,yCAA8K;AAArK,sGAAA,YAAY,OAAA;AAAiB,kGAAA,QAAQ,OAAA;AAAS,qGAAA,WAAW,OAAA;AAAE,yGAAA,eAAe,OAAA;AAAE,qGAAA,WAAW,OAAA;AAAoC,2GAAA,iBAAiB,OAAA;AAGrJ,oDAAkC;AAClC,qDAAmC;AAGnC,uDAAqC;AACrC,wDAAsC;AAGtC,yDAAuC;AACvC,0DAAwC;AAExC,0CAAwB;AACxB,0CAAwB;AACxB,wDAAsC;AACtC,iDAA+B;AAE/B,mCAAyC;AAAhC,iGAAA,UAAU,OAAA"}
|
package/package.json
CHANGED
package/prisma/schema.prisma
CHANGED
|
@@ -29,12 +29,17 @@ model User {
|
|
|
29
29
|
password String?
|
|
30
30
|
role UserRole @default(USER)
|
|
31
31
|
|
|
32
|
+
profilePicture String?
|
|
33
|
+
|
|
32
34
|
createdAt DateTime @default(now())
|
|
33
35
|
updatedAt DateTime @updatedAt
|
|
34
36
|
|
|
35
37
|
accounts Account[]
|
|
36
38
|
messages Message[]
|
|
37
|
-
events
|
|
39
|
+
events Event[]
|
|
40
|
+
participatedEvents Participant[]
|
|
41
|
+
notificationsReceived Notification[] @relation("NotificationRecipient")
|
|
42
|
+
notificationsSent Notification[] @relation("NotificationSender")
|
|
38
43
|
}
|
|
39
44
|
|
|
40
45
|
model Account {
|
|
@@ -48,6 +53,7 @@ model Account {
|
|
|
48
53
|
model Address {
|
|
49
54
|
id String @id @default(uuid())
|
|
50
55
|
name String
|
|
56
|
+
line2 String?
|
|
51
57
|
city String
|
|
52
58
|
state String
|
|
53
59
|
country String
|
|
@@ -98,6 +104,9 @@ model Event {
|
|
|
98
104
|
postedBy User @relation(fields: [postedById], references: [id])
|
|
99
105
|
postedById String
|
|
100
106
|
|
|
107
|
+
// Add participants relation
|
|
108
|
+
participants Participant[]
|
|
109
|
+
|
|
101
110
|
createdAt DateTime @default(now())
|
|
102
111
|
updatedAt DateTime @updatedAt
|
|
103
112
|
}
|
|
@@ -107,7 +116,6 @@ model EventPrice {
|
|
|
107
116
|
name String // e.g., "Early Bird", "VIP", "Regular"
|
|
108
117
|
amount Float
|
|
109
118
|
description String?
|
|
110
|
-
capacity Int? // Optional capacity per price tier
|
|
111
119
|
event Event @relation(fields: [eventId], references: [id])
|
|
112
120
|
eventId String
|
|
113
121
|
|
|
@@ -137,3 +145,44 @@ model Message {
|
|
|
137
145
|
createdAt DateTime @default(now())
|
|
138
146
|
updatedAt DateTime @updatedAt
|
|
139
147
|
}
|
|
148
|
+
|
|
149
|
+
// Add new Participant model
|
|
150
|
+
model Participant {
|
|
151
|
+
id String @id @default(cuid())
|
|
152
|
+
event Event @relation(fields: [eventId], references: [id])
|
|
153
|
+
eventId String
|
|
154
|
+
user User @relation(fields: [userId], references: [id])
|
|
155
|
+
userId String
|
|
156
|
+
status ParticipantStatus @default(PENDING)
|
|
157
|
+
|
|
158
|
+
createdAt DateTime @default(now())
|
|
159
|
+
updatedAt DateTime @updatedAt
|
|
160
|
+
|
|
161
|
+
@@unique([eventId, userId])
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
enum ParticipantStatus {
|
|
165
|
+
PENDING
|
|
166
|
+
CONFIRMED
|
|
167
|
+
CANCELLED
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
enum NotificationType {
|
|
171
|
+
NEW_MESSAGE
|
|
172
|
+
EVENT_REMINDER
|
|
173
|
+
EVENT_PARTICIPATION_CONFIRMATION
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
model Notification {
|
|
177
|
+
id String @id @default(cuid())
|
|
178
|
+
notifiedTo User @relation("NotificationRecipient", fields: [notifiedToId], references: [id])
|
|
179
|
+
notifiedToId String
|
|
180
|
+
user User? @relation("NotificationSender", fields: [userId], references: [id])
|
|
181
|
+
userId String?
|
|
182
|
+
type NotificationType
|
|
183
|
+
read Boolean @default(false)
|
|
184
|
+
data Json?
|
|
185
|
+
|
|
186
|
+
createdAt DateTime @default(now())
|
|
187
|
+
updatedAt DateTime @updatedAt
|
|
188
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './auth/auth.guard';
|
|
2
|
-
export { PrismaClient, User, Account, UserRole, Event, EventAccess, EventVisibility, EventStatus, EventPrice, Address } from '@prisma/client';
|
|
2
|
+
export { PrismaClient, User, Account, UserRole, Event, EventAccess, EventVisibility, EventStatus, EventPrice, Address, Participant, ParticipantStatus } from '@prisma/client';
|
|
3
3
|
|
|
4
4
|
//auth
|
|
5
5
|
export * from './auth/auth.guard';
|