@youjunhuang/entity-core 1.0.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.
Files changed (245) hide show
  1. package/dist/data_access/base/base.repository.d.ts +29 -0
  2. package/dist/data_access/base/base.repository.d.ts.map +1 -0
  3. package/dist/data_access/base/base.repository.js +7 -0
  4. package/dist/data_access/base/base.repository.js.map +1 -0
  5. package/dist/data_access/base/index.d.ts +4 -0
  6. package/dist/data_access/base/index.d.ts.map +1 -0
  7. package/dist/data_access/base/index.js +20 -0
  8. package/dist/data_access/base/index.js.map +1 -0
  9. package/dist/data_access/base/mongo-base.repository.d.ts +34 -0
  10. package/dist/data_access/base/mongo-base.repository.d.ts.map +1 -0
  11. package/dist/data_access/base/mongo-base.repository.js +229 -0
  12. package/dist/data_access/base/mongo-base.repository.js.map +1 -0
  13. package/dist/data_access/base/sql-base.repository.d.ts +20 -0
  14. package/dist/data_access/base/sql-base.repository.d.ts.map +1 -0
  15. package/dist/data_access/base/sql-base.repository.js +180 -0
  16. package/dist/data_access/base/sql-base.repository.js.map +1 -0
  17. package/dist/data_access/index.d.ts +3 -0
  18. package/dist/data_access/index.d.ts.map +1 -0
  19. package/dist/data_access/index.js +20 -0
  20. package/dist/data_access/index.js.map +1 -0
  21. package/dist/data_access/mongo/account-mongo.repository.d.ts +14 -0
  22. package/dist/data_access/mongo/account-mongo.repository.d.ts.map +1 -0
  23. package/dist/data_access/mongo/account-mongo.repository.js +43 -0
  24. package/dist/data_access/mongo/account-mongo.repository.js.map +1 -0
  25. package/dist/data_access/mongo/attachment-mongo.repository.d.ts +139 -0
  26. package/dist/data_access/mongo/attachment-mongo.repository.d.ts.map +1 -0
  27. package/dist/data_access/mongo/attachment-mongo.repository.js +355 -0
  28. package/dist/data_access/mongo/attachment-mongo.repository.js.map +1 -0
  29. package/dist/data_access/mongo/biometric-cred.repository.d.ts +8 -0
  30. package/dist/data_access/mongo/biometric-cred.repository.d.ts.map +1 -0
  31. package/dist/data_access/mongo/biometric-cred.repository.js +32 -0
  32. package/dist/data_access/mongo/biometric-cred.repository.js.map +1 -0
  33. package/dist/data_access/mongo/camera-mongo.repository.d.ts +9 -0
  34. package/dist/data_access/mongo/camera-mongo.repository.d.ts.map +1 -0
  35. package/dist/data_access/mongo/camera-mongo.repository.js +39 -0
  36. package/dist/data_access/mongo/camera-mongo.repository.js.map +1 -0
  37. package/dist/data_access/mongo/camera-recording-mongo.repository.d.ts +9 -0
  38. package/dist/data_access/mongo/camera-recording-mongo.repository.d.ts.map +1 -0
  39. package/dist/data_access/mongo/camera-recording-mongo.repository.js +39 -0
  40. package/dist/data_access/mongo/camera-recording-mongo.repository.js.map +1 -0
  41. package/dist/data_access/mongo/event-mongo.repository.d.ts +23 -0
  42. package/dist/data_access/mongo/event-mongo.repository.d.ts.map +1 -0
  43. package/dist/data_access/mongo/event-mongo.repository.js +175 -0
  44. package/dist/data_access/mongo/event-mongo.repository.js.map +1 -0
  45. package/dist/data_access/mongo/event-template-mongo.repository.d.ts +8 -0
  46. package/dist/data_access/mongo/event-template-mongo.repository.d.ts.map +1 -0
  47. package/dist/data_access/mongo/event-template-mongo.repository.js +36 -0
  48. package/dist/data_access/mongo/event-template-mongo.repository.js.map +1 -0
  49. package/dist/data_access/mongo/event-template-name-mongo.repository.d.ts +19 -0
  50. package/dist/data_access/mongo/event-template-name-mongo.repository.d.ts.map +1 -0
  51. package/dist/data_access/mongo/event-template-name-mongo.repository.js +47 -0
  52. package/dist/data_access/mongo/event-template-name-mongo.repository.js.map +1 -0
  53. package/dist/data_access/mongo/index.d.ts +17 -0
  54. package/dist/data_access/mongo/index.d.ts.map +1 -0
  55. package/dist/data_access/mongo/index.js +33 -0
  56. package/dist/data_access/mongo/index.js.map +1 -0
  57. package/dist/data_access/mongo/map-mongo.repository.d.ts +9 -0
  58. package/dist/data_access/mongo/map-mongo.repository.d.ts.map +1 -0
  59. package/dist/data_access/mongo/map-mongo.repository.js +46 -0
  60. package/dist/data_access/mongo/map-mongo.repository.js.map +1 -0
  61. package/dist/data_access/mongo/password-cred.repository.d.ts +8 -0
  62. package/dist/data_access/mongo/password-cred.repository.d.ts.map +1 -0
  63. package/dist/data_access/mongo/password-cred.repository.js +32 -0
  64. package/dist/data_access/mongo/password-cred.repository.js.map +1 -0
  65. package/dist/data_access/mongo/permission-mongo.repository.d.ts +8 -0
  66. package/dist/data_access/mongo/permission-mongo.repository.d.ts.map +1 -0
  67. package/dist/data_access/mongo/permission-mongo.repository.js +32 -0
  68. package/dist/data_access/mongo/permission-mongo.repository.js.map +1 -0
  69. package/dist/data_access/mongo/report.repository.d.ts +12 -0
  70. package/dist/data_access/mongo/report.repository.d.ts.map +1 -0
  71. package/dist/data_access/mongo/report.repository.js +52 -0
  72. package/dist/data_access/mongo/report.repository.js.map +1 -0
  73. package/dist/data_access/mongo/role-mongo.repository.d.ts +7 -0
  74. package/dist/data_access/mongo/role-mongo.repository.d.ts.map +1 -0
  75. package/dist/data_access/mongo/role-mongo.repository.js +35 -0
  76. package/dist/data_access/mongo/role-mongo.repository.js.map +1 -0
  77. package/dist/data_access/mongo/third-party-cred.repository.d.ts +8 -0
  78. package/dist/data_access/mongo/third-party-cred.repository.d.ts.map +1 -0
  79. package/dist/data_access/mongo/third-party-cred.repository.js +32 -0
  80. package/dist/data_access/mongo/third-party-cred.repository.js.map +1 -0
  81. package/dist/data_access/mongo/ui-item-mongo.repository.d.ts +7 -0
  82. package/dist/data_access/mongo/ui-item-mongo.repository.d.ts.map +1 -0
  83. package/dist/data_access/mongo/ui-item-mongo.repository.js +35 -0
  84. package/dist/data_access/mongo/ui-item-mongo.repository.js.map +1 -0
  85. package/dist/data_access/mongo/user-mongo.repository.d.ts +8 -0
  86. package/dist/data_access/mongo/user-mongo.repository.d.ts.map +1 -0
  87. package/dist/data_access/mongo/user-mongo.repository.js +39 -0
  88. package/dist/data_access/mongo/user-mongo.repository.js.map +1 -0
  89. package/dist/data_access/sql/index.d.ts +1 -0
  90. package/dist/data_access/sql/index.d.ts.map +1 -0
  91. package/dist/data_access/sql/index.js +3 -0
  92. package/dist/data_access/sql/index.js.map +1 -0
  93. package/dist/data_access/sql/user-profiles.repository.d.ts +1 -0
  94. package/dist/data_access/sql/user-profiles.repository.d.ts.map +1 -0
  95. package/dist/data_access/sql/user-profiles.repository.js +36 -0
  96. package/dist/data_access/sql/user-profiles.repository.js.map +1 -0
  97. package/dist/index.d.ts +4 -0
  98. package/dist/index.d.ts.map +1 -0
  99. package/dist/index.js +20 -0
  100. package/dist/index.js.map +1 -0
  101. package/dist/models/account.d.ts +27 -0
  102. package/dist/models/account.d.ts.map +1 -0
  103. package/dist/models/account.js +3 -0
  104. package/dist/models/account.js.map +1 -0
  105. package/dist/models/attachment.d.ts +147 -0
  106. package/dist/models/attachment.d.ts.map +1 -0
  107. package/dist/models/attachment.js +25 -0
  108. package/dist/models/attachment.js.map +1 -0
  109. package/dist/models/auth-credential.d.ts +46 -0
  110. package/dist/models/auth-credential.d.ts.map +1 -0
  111. package/dist/models/auth-credential.js +10 -0
  112. package/dist/models/auth-credential.js.map +1 -0
  113. package/dist/models/camera.d.ts +156 -0
  114. package/dist/models/camera.d.ts.map +1 -0
  115. package/dist/models/camera.js +34 -0
  116. package/dist/models/camera.js.map +1 -0
  117. package/dist/models/chatroom.d.ts +55 -0
  118. package/dist/models/chatroom.d.ts.map +1 -0
  119. package/dist/models/chatroom.js +3 -0
  120. package/dist/models/chatroom.js.map +1 -0
  121. package/dist/models/device.d.ts +50 -0
  122. package/dist/models/device.d.ts.map +1 -0
  123. package/dist/models/device.js +3 -0
  124. package/dist/models/device.js.map +1 -0
  125. package/dist/models/event.d.ts +170 -0
  126. package/dist/models/event.d.ts.map +1 -0
  127. package/dist/models/event.js +195 -0
  128. package/dist/models/event.js.map +1 -0
  129. package/dist/models/index.d.ts +19 -0
  130. package/dist/models/index.d.ts.map +1 -0
  131. package/dist/models/index.js +35 -0
  132. package/dist/models/index.js.map +1 -0
  133. package/dist/models/inform.d.ts +146 -0
  134. package/dist/models/inform.d.ts.map +1 -0
  135. package/dist/models/inform.js +61 -0
  136. package/dist/models/inform.js.map +1 -0
  137. package/dist/models/map.d.ts +26 -0
  138. package/dist/models/map.d.ts.map +1 -0
  139. package/dist/models/map.js +3 -0
  140. package/dist/models/map.js.map +1 -0
  141. package/dist/models/permission.d.ts +83 -0
  142. package/dist/models/permission.d.ts.map +1 -0
  143. package/dist/models/permission.js +78 -0
  144. package/dist/models/permission.js.map +1 -0
  145. package/dist/models/report.d.ts +167 -0
  146. package/dist/models/report.d.ts.map +1 -0
  147. package/dist/models/report.js +61 -0
  148. package/dist/models/report.js.map +1 -0
  149. package/dist/models/role.d.ts +84 -0
  150. package/dist/models/role.d.ts.map +1 -0
  151. package/dist/models/role.js +25 -0
  152. package/dist/models/role.js.map +1 -0
  153. package/dist/models/schedule.d.ts +39 -0
  154. package/dist/models/schedule.d.ts.map +1 -0
  155. package/dist/models/schedule.js +3 -0
  156. package/dist/models/schedule.js.map +1 -0
  157. package/dist/models/task.d.ts +97 -0
  158. package/dist/models/task.d.ts.map +1 -0
  159. package/dist/models/task.js +24 -0
  160. package/dist/models/task.js.map +1 -0
  161. package/dist/models/template.d.ts +197 -0
  162. package/dist/models/template.d.ts.map +1 -0
  163. package/dist/models/template.js +64 -0
  164. package/dist/models/template.js.map +1 -0
  165. package/dist/models/ui-item.d.ts +40 -0
  166. package/dist/models/ui-item.d.ts.map +1 -0
  167. package/dist/models/ui-item.js +17 -0
  168. package/dist/models/ui-item.js.map +1 -0
  169. package/dist/models/user.d.ts +125 -0
  170. package/dist/models/user.d.ts.map +1 -0
  171. package/dist/models/user.js +22 -0
  172. package/dist/models/user.js.map +1 -0
  173. package/dist/models/utils.d.ts +28 -0
  174. package/dist/models/utils.d.ts.map +1 -0
  175. package/dist/models/utils.js +3 -0
  176. package/dist/models/utils.js.map +1 -0
  177. package/dist/schemas/index.d.ts +2 -0
  178. package/dist/schemas/index.d.ts.map +1 -0
  179. package/dist/schemas/index.js +18 -0
  180. package/dist/schemas/index.js.map +1 -0
  181. package/dist/schemas/mongo/account-mongo.schema.d.ts +27 -0
  182. package/dist/schemas/mongo/account-mongo.schema.d.ts.map +1 -0
  183. package/dist/schemas/mongo/account-mongo.schema.js +22 -0
  184. package/dist/schemas/mongo/account-mongo.schema.js.map +1 -0
  185. package/dist/schemas/mongo/attachment-mongo.schema.d.ts +134 -0
  186. package/dist/schemas/mongo/attachment-mongo.schema.d.ts.map +1 -0
  187. package/dist/schemas/mongo/attachment-mongo.schema.js +182 -0
  188. package/dist/schemas/mongo/attachment-mongo.schema.js.map +1 -0
  189. package/dist/schemas/mongo/biometric-cred.schema.d.ts +27 -0
  190. package/dist/schemas/mongo/biometric-cred.schema.d.ts.map +1 -0
  191. package/dist/schemas/mongo/biometric-cred.schema.js +24 -0
  192. package/dist/schemas/mongo/biometric-cred.schema.js.map +1 -0
  193. package/dist/schemas/mongo/camera-mongo.schema.d.ts +21 -0
  194. package/dist/schemas/mongo/camera-mongo.schema.d.ts.map +1 -0
  195. package/dist/schemas/mongo/camera-mongo.schema.js +54 -0
  196. package/dist/schemas/mongo/camera-mongo.schema.js.map +1 -0
  197. package/dist/schemas/mongo/camera-recording-mongo.schema.d.ts +21 -0
  198. package/dist/schemas/mongo/camera-recording-mongo.schema.d.ts.map +1 -0
  199. package/dist/schemas/mongo/camera-recording-mongo.schema.js +24 -0
  200. package/dist/schemas/mongo/camera-recording-mongo.schema.js.map +1 -0
  201. package/dist/schemas/mongo/event-mongo.schema.d.ts +51 -0
  202. package/dist/schemas/mongo/event-mongo.schema.d.ts.map +1 -0
  203. package/dist/schemas/mongo/event-mongo.schema.js +63 -0
  204. package/dist/schemas/mongo/event-mongo.schema.js.map +1 -0
  205. package/dist/schemas/mongo/event-template-mongo.schema.d.ts +39 -0
  206. package/dist/schemas/mongo/event-template-mongo.schema.d.ts.map +1 -0
  207. package/dist/schemas/mongo/event-template-mongo.schema.js +33 -0
  208. package/dist/schemas/mongo/event-template-mongo.schema.js.map +1 -0
  209. package/dist/schemas/mongo/index.d.ts +16 -0
  210. package/dist/schemas/mongo/index.d.ts.map +1 -0
  211. package/dist/schemas/mongo/index.js +32 -0
  212. package/dist/schemas/mongo/index.js.map +1 -0
  213. package/dist/schemas/mongo/map-mongo.schema.d.ts +20 -0
  214. package/dist/schemas/mongo/map-mongo.schema.d.ts.map +1 -0
  215. package/dist/schemas/mongo/map-mongo.schema.js +16 -0
  216. package/dist/schemas/mongo/map-mongo.schema.js.map +1 -0
  217. package/dist/schemas/mongo/password-cred.schema.d.ts +27 -0
  218. package/dist/schemas/mongo/password-cred.schema.d.ts.map +1 -0
  219. package/dist/schemas/mongo/password-cred.schema.js +22 -0
  220. package/dist/schemas/mongo/password-cred.schema.js.map +1 -0
  221. package/dist/schemas/mongo/permission-mongo.schema.d.ts +21 -0
  222. package/dist/schemas/mongo/permission-mongo.schema.d.ts.map +1 -0
  223. package/dist/schemas/mongo/permission-mongo.schema.js +70 -0
  224. package/dist/schemas/mongo/permission-mongo.schema.js.map +1 -0
  225. package/dist/schemas/mongo/report-mongo.schema.d.ts +41 -0
  226. package/dist/schemas/mongo/report-mongo.schema.d.ts.map +1 -0
  227. package/dist/schemas/mongo/report-mongo.schema.js +71 -0
  228. package/dist/schemas/mongo/report-mongo.schema.js.map +1 -0
  229. package/dist/schemas/mongo/role-mongo.schema.d.ts +22 -0
  230. package/dist/schemas/mongo/role-mongo.schema.d.ts.map +1 -0
  231. package/dist/schemas/mongo/role-mongo.schema.js +73 -0
  232. package/dist/schemas/mongo/role-mongo.schema.js.map +1 -0
  233. package/dist/schemas/mongo/third-party-cred.schema.d.ts +27 -0
  234. package/dist/schemas/mongo/third-party-cred.schema.d.ts.map +1 -0
  235. package/dist/schemas/mongo/third-party-cred.schema.js +30 -0
  236. package/dist/schemas/mongo/third-party-cred.schema.js.map +1 -0
  237. package/dist/schemas/mongo/ui-item.schema.d.ts +23 -0
  238. package/dist/schemas/mongo/ui-item.schema.d.ts.map +1 -0
  239. package/dist/schemas/mongo/ui-item.schema.js +61 -0
  240. package/dist/schemas/mongo/ui-item.schema.js.map +1 -0
  241. package/dist/schemas/mongo/user-mongo.schema.d.ts +24 -0
  242. package/dist/schemas/mongo/user-mongo.schema.d.ts.map +1 -0
  243. package/dist/schemas/mongo/user-mongo.schema.js +34 -0
  244. package/dist/schemas/mongo/user-mongo.schema.js.map +1 -0
  245. package/package.json +34 -0
@@ -0,0 +1,134 @@
1
+ import { Schema, Document, Types } from 'mongoose';
2
+ import { TextAttachment, ImageAttachment, VideoAttachment, AudioAttachment, FileAttachment, EventAttachment } from '../../models/attachment';
3
+ import { EventDocument } from './event-mongo.schema';
4
+ import { UserProfileDocument } from './user-mongo.schema';
5
+ export type TextAttachmentMongoose = Omit<TextAttachment, 'attachedId'> & {
6
+ attachedId: Types.ObjectId | string;
7
+ _attached?: EventDocument | null;
8
+ createdBy: Types.ObjectId | string;
9
+ _created_by_user?: UserProfileDocument | null;
10
+ };
11
+ export interface TextAttachmentDocument extends Document, TextAttachmentMongoose {
12
+ id: string;
13
+ }
14
+ export declare const TextAttachmentSchema: Schema<TextAttachmentDocument, import("mongoose").Model<TextAttachmentDocument, any, any, any, Document<unknown, any, TextAttachmentDocument, any, {}> & TextAttachmentDocument & Required<{
15
+ _id: Types.ObjectId;
16
+ }> & {
17
+ __v: number;
18
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, TextAttachmentDocument, Document<unknown, {}, import("mongoose").FlatRecord<TextAttachmentDocument>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<TextAttachmentDocument> & Required<{
19
+ _id: Types.ObjectId;
20
+ }> & {
21
+ __v: number;
22
+ }>;
23
+ export type IImageAttachmentMongoose = Omit<ImageAttachment, 'attachedId'> & {
24
+ attachedId: Types.ObjectId | string;
25
+ _attached?: EventDocument | null;
26
+ };
27
+ export interface ImageAttachmentDocument extends Document, IImageAttachmentMongoose {
28
+ id: string;
29
+ }
30
+ export declare const ImageAttachmentSchema: Schema<ImageAttachmentDocument, import("mongoose").Model<ImageAttachmentDocument, any, any, any, Document<unknown, any, ImageAttachmentDocument, any, {}> & ImageAttachmentDocument & Required<{
31
+ _id: Types.ObjectId;
32
+ }> & {
33
+ __v: number;
34
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ImageAttachmentDocument, Document<unknown, {}, import("mongoose").FlatRecord<ImageAttachmentDocument>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<ImageAttachmentDocument> & Required<{
35
+ _id: Types.ObjectId;
36
+ }> & {
37
+ __v: number;
38
+ }>;
39
+ export type IVideoAttachmentMongoose = Omit<VideoAttachment, 'attachedId'> & {
40
+ attachedId: Types.ObjectId | string;
41
+ _attached?: EventDocument | null;
42
+ };
43
+ export interface VideoAttachmentDocument extends Document, IVideoAttachmentMongoose {
44
+ id: string;
45
+ }
46
+ export declare const VideoAttachmentSchema: Schema<VideoAttachmentDocument, import("mongoose").Model<VideoAttachmentDocument, any, any, any, Document<unknown, any, VideoAttachmentDocument, any, {}> & VideoAttachmentDocument & Required<{
47
+ _id: Types.ObjectId;
48
+ }> & {
49
+ __v: number;
50
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, VideoAttachmentDocument, Document<unknown, {}, import("mongoose").FlatRecord<VideoAttachmentDocument>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<VideoAttachmentDocument> & Required<{
51
+ _id: Types.ObjectId;
52
+ }> & {
53
+ __v: number;
54
+ }>;
55
+ export type IAudioAttachmentMongoose = Omit<AudioAttachment, 'attachedId'> & {
56
+ attachedId: Types.ObjectId | string;
57
+ _attached?: EventDocument | null;
58
+ };
59
+ export interface AudioAttachmentDocument extends Document, IAudioAttachmentMongoose {
60
+ id: string;
61
+ }
62
+ export declare const AudioAttachmentSchema: Schema<AudioAttachmentDocument, import("mongoose").Model<AudioAttachmentDocument, any, any, any, Document<unknown, any, AudioAttachmentDocument, any, {}> & AudioAttachmentDocument & Required<{
63
+ _id: Types.ObjectId;
64
+ }> & {
65
+ __v: number;
66
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, AudioAttachmentDocument, Document<unknown, {}, import("mongoose").FlatRecord<AudioAttachmentDocument>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<AudioAttachmentDocument> & Required<{
67
+ _id: Types.ObjectId;
68
+ }> & {
69
+ __v: number;
70
+ }>;
71
+ export type IFileAttachmentMongoose = Omit<FileAttachment, 'attachedId'> & {
72
+ attachedId: Types.ObjectId | string;
73
+ _attached?: EventDocument | null;
74
+ };
75
+ export interface FileAttachmentDocument extends Document, IFileAttachmentMongoose {
76
+ id: string;
77
+ }
78
+ export declare const FileAttachmentSchema: Schema<FileAttachmentDocument, import("mongoose").Model<FileAttachmentDocument, any, any, any, Document<unknown, any, FileAttachmentDocument, any, {}> & FileAttachmentDocument & Required<{
79
+ _id: Types.ObjectId;
80
+ }> & {
81
+ __v: number;
82
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, FileAttachmentDocument, Document<unknown, {}, import("mongoose").FlatRecord<FileAttachmentDocument>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<FileAttachmentDocument> & Required<{
83
+ _id: Types.ObjectId;
84
+ }> & {
85
+ __v: number;
86
+ }>;
87
+ export type IEventAttachmentMongoose = Omit<EventAttachment, 'attachedId'> & {
88
+ attachedId: Types.ObjectId | string;
89
+ _attached?: EventDocument | null;
90
+ };
91
+ export interface EventAttachmentDocument extends Document, IEventAttachmentMongoose {
92
+ id: string;
93
+ }
94
+ export declare const EventAttachmentSchema: Schema<EventAttachmentDocument, import("mongoose").Model<EventAttachmentDocument, any, any, any, Document<unknown, any, EventAttachmentDocument, any, {}> & EventAttachmentDocument & Required<{
95
+ _id: Types.ObjectId;
96
+ }> & {
97
+ __v: number;
98
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, EventAttachmentDocument, Document<unknown, {}, import("mongoose").FlatRecord<EventAttachmentDocument>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<EventAttachmentDocument> & Required<{
99
+ _id: Types.ObjectId;
100
+ }> & {
101
+ __v: number;
102
+ }>;
103
+ export declare const TextAttachmentModel: import("mongoose").Model<TextAttachmentDocument, {}, {}, {}, Document<unknown, {}, TextAttachmentDocument, {}, {}> & TextAttachmentDocument & Required<{
104
+ _id: Types.ObjectId;
105
+ }> & {
106
+ __v: number;
107
+ }, any>;
108
+ export declare const ImageAttachmentModel: import("mongoose").Model<ImageAttachmentDocument, {}, {}, {}, Document<unknown, {}, ImageAttachmentDocument, {}, {}> & ImageAttachmentDocument & Required<{
109
+ _id: Types.ObjectId;
110
+ }> & {
111
+ __v: number;
112
+ }, any>;
113
+ export declare const VideoAttachmentModel: import("mongoose").Model<VideoAttachmentDocument, {}, {}, {}, Document<unknown, {}, VideoAttachmentDocument, {}, {}> & VideoAttachmentDocument & Required<{
114
+ _id: Types.ObjectId;
115
+ }> & {
116
+ __v: number;
117
+ }, any>;
118
+ export declare const AudioAttachmentModel: import("mongoose").Model<AudioAttachmentDocument, {}, {}, {}, Document<unknown, {}, AudioAttachmentDocument, {}, {}> & AudioAttachmentDocument & Required<{
119
+ _id: Types.ObjectId;
120
+ }> & {
121
+ __v: number;
122
+ }, any>;
123
+ export declare const FileAttachmentModel: import("mongoose").Model<FileAttachmentDocument, {}, {}, {}, Document<unknown, {}, FileAttachmentDocument, {}, {}> & FileAttachmentDocument & Required<{
124
+ _id: Types.ObjectId;
125
+ }> & {
126
+ __v: number;
127
+ }, any>;
128
+ export declare const EventAttachmentModel: import("mongoose").Model<EventAttachmentDocument, {}, {}, {}, Document<unknown, {}, EventAttachmentDocument, {}, {}> & EventAttachmentDocument & Required<{
129
+ _id: Types.ObjectId;
130
+ }> & {
131
+ __v: number;
132
+ }, any>;
133
+ export type AttachmentDocument = TextAttachmentDocument | ImageAttachmentDocument | VideoAttachmentDocument | AudioAttachmentDocument | FileAttachmentDocument | EventAttachmentDocument;
134
+ //# sourceMappingURL=attachment-mongo.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachment-mongo.schema.d.ts","sourceRoot":"","sources":["../../../schemas/mongo/attachment-mongo.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAS,QAAQ,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,EAGL,cAAc,EACd,eAAe,EACf,eAAe,EACf,eAAe,EACf,cAAc,EAGd,eAAe,EAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAM1D,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,cAAc,EAAE,YAAY,CAAC,GAAG;IACxE,UAAU,EAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC;IACpC,SAAS,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IACjC,SAAS,EAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC;IACnC,gBAAgB,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;CAC/C,CAAC;AAEF,MAAM,WAAW,sBAAuB,SAAQ,QAAQ,EAAE,sBAAsB;IAC9E,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,eAAO,MAAM,oBAAoB;;;;;;;;EAa/B,CAAC;AAqBH,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,GAAG;IAC3E,UAAU,EAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC;IACpC,SAAS,CAAC,E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AY,CAAC,GAAG;IAC3E,UAAU,EAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC;IACpC,SAAS,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;CAClC,CAAC;AAEF,MAAM,WAAW,uBAAwB,SAAQ,QAAQ,EAAE,wBAAwB;IACjF,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,eAAO,MAAM,qBAAqB;;;;;;;;EAmBhC,CAAC;AAkBH,eAAO,MAAM,mBAAmB;;;;OAAwE,CAAC;AACzG,eAAO,MAAM,oBAAoB;;;;OAA2E,CAAC;AAC7G,eAAO,MAAM,oBAAoB;;;;OAA2E,CAAC;AAC7G,eAAO,MAAM,oBAAoB;;;;OAA2E,CAAC;AAC7G,eAAO,MAAM,mBAAmB;;;;OAAwE,CAAC;AACzG,eAAO,MAAM,oBAAoB;;;;OAA2E,CAAC;AAG7G,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,GAAG,uBAAuB,GAAG,uBAAuB,GAAG,uBAAuB,GAAG,sBAAsB,GAAG,uBAAuB,CAAC"}
@@ -0,0 +1,182 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EventAttachmentModel = exports.FileAttachmentModel = exports.AudioAttachmentModel = exports.VideoAttachmentModel = exports.ImageAttachmentModel = exports.TextAttachmentModel = exports.EventAttachmentSchema = exports.FileAttachmentSchema = exports.AudioAttachmentSchema = exports.VideoAttachmentSchema = exports.ImageAttachmentSchema = exports.TextAttachmentSchema = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ const attachment_1 = require("../../models/attachment");
6
+ const models_1 = require("../../models");
7
+ exports.TextAttachmentSchema = new mongoose_1.Schema({
8
+ id: { type: String, required: true, immutable: true }, // 使用 UUID 作為 id
9
+ purpose: { type: String, enum: attachment_1.textPurposeArray, required: false, index: true },
10
+ content: {
11
+ type: String, required: true, index: 'text' // 支援文字搜尋
12
+ },
13
+ freeTags: { type: [String], index: 'text', required: false },
14
+ attachedTo: { type: String, required: false, index: true },
15
+ attachedId: { type: String, required: false },
16
+ createdBy: { type: String, required: false },
17
+ }, {
18
+ collection: 'text_attachments',
19
+ timestamps: true
20
+ });
21
+ // 虛擬關聯
22
+ exports.TextAttachmentSchema.virtual('_attached', {
23
+ refPath: 'attachedTo',
24
+ localField: 'attachedId',
25
+ foreignField: 'id',
26
+ justOne: true,
27
+ });
28
+ exports.TextAttachmentSchema.virtual('_created_by_user', {
29
+ ref: 'UserProfile',
30
+ localField: 'createdBy',
31
+ foreignField: 'id',
32
+ justOne: true,
33
+ });
34
+ exports.ImageAttachmentSchema = new mongoose_1.Schema({
35
+ id: { type: String, required: true, immutable: true }, // 使用 UUID 作為 id
36
+ url: { type: String, required: true },
37
+ mimeType: { type: String, required: false },
38
+ purpose: { type: String, enum: attachment_1.imagePurposeArray, required: false, index: true },
39
+ freeTags: { type: [String], index: 'text', required: false },
40
+ attachedTo: { type: String, required: false, index: true },
41
+ attachedId: { type: String, required: false },
42
+ width: {
43
+ type: Number,
44
+ required: false,
45
+ min: 0
46
+ },
47
+ height: {
48
+ type: Number,
49
+ required: false,
50
+ min: 0
51
+ },
52
+ }, {
53
+ collection: 'image_attachments',
54
+ timestamps: true
55
+ });
56
+ // 虛擬關聯
57
+ exports.ImageAttachmentSchema.virtual('_attached', {
58
+ refPath: 'attachedTo',
59
+ localField: 'attachedId',
60
+ foreignField: 'id',
61
+ justOne: true,
62
+ });
63
+ exports.VideoAttachmentSchema = new mongoose_1.Schema({
64
+ id: { type: String, required: true, immutable: true }, // 使用 UUID 作為 id
65
+ mimeType: { type: String, required: false },
66
+ freeTags: { type: [String], index: 'text', required: false },
67
+ url: {
68
+ type: String,
69
+ required: true
70
+ },
71
+ duration: {
72
+ type: Number,
73
+ required: false,
74
+ min: 0 // 時長以秒為單位
75
+ },
76
+ codec: { type: String, required: false },
77
+ frameRate: { type: Number, required: false, min: 0 },
78
+ attachedTo: { type: String, required: false, index: true },
79
+ attachedId: { type: String, required: false },
80
+ }, {
81
+ collection: 'video_attachments',
82
+ timestamps: true
83
+ });
84
+ // 虛擬關聯
85
+ exports.VideoAttachmentSchema.virtual('_attached', {
86
+ refPath: 'attachedTo',
87
+ localField: 'attachedId',
88
+ foreignField: 'id',
89
+ justOne: true,
90
+ });
91
+ exports.AudioAttachmentSchema = new mongoose_1.Schema({
92
+ id: { type: String, required: true, immutable: true }, // 使用 UUID 作為 id
93
+ mimeType: { type: String, required: false },
94
+ freeTags: { type: [String], index: 'text', required: false },
95
+ url: {
96
+ type: String,
97
+ required: true
98
+ },
99
+ duration: {
100
+ type: Number,
101
+ required: false,
102
+ min: 0 // 時長以秒為單位
103
+ },
104
+ attachedTo: { type: String, required: false, index: true },
105
+ attachedId: { type: String, required: false },
106
+ }, {
107
+ collection: 'audio_attachments',
108
+ timestamps: true
109
+ });
110
+ // 虛擬關聯
111
+ exports.AudioAttachmentSchema.virtual('_attached', {
112
+ refPath: 'attachedTo',
113
+ localField: 'attachedId',
114
+ foreignField: 'id',
115
+ justOne: true,
116
+ });
117
+ exports.FileAttachmentSchema = new mongoose_1.Schema({
118
+ id: { type: String, required: true, immutable: true }, // 使用 UUID 作為 id
119
+ mimeType: { type: String, required: false },
120
+ freeTags: { type: [String], default: [], index: 'text' },
121
+ url: {
122
+ type: String,
123
+ required: true
124
+ },
125
+ fileName: {
126
+ type: String,
127
+ required: true,
128
+ index: 'text' // 支援檔案名稱搜尋
129
+ },
130
+ attachedTo: { type: String, required: false, index: true },
131
+ attachedId: { type: String, required: false },
132
+ }, {
133
+ collection: 'file_attachments',
134
+ timestamps: true
135
+ });
136
+ // 虛擬關聯
137
+ exports.FileAttachmentSchema.virtual('_attached', {
138
+ refPath: 'attachedTo',
139
+ localField: 'attachedId',
140
+ foreignField: 'id',
141
+ justOne: true,
142
+ });
143
+ exports.EventAttachmentSchema = new mongoose_1.Schema({
144
+ id: { type: String, required: true, immutable: true },
145
+ status: {
146
+ type: String,
147
+ enum: Object.values(models_1.EventStatus),
148
+ required: false,
149
+ index: true
150
+ },
151
+ resolvedAt: {
152
+ type: Date,
153
+ required: false,
154
+ index: true
155
+ },
156
+ freeTags: { type: [String], default: [], index: 'text' },
157
+ attachedTo: { type: String, required: true, index: true },
158
+ attachedId: { type: String, required: true, index: true },
159
+ }, {
160
+ collection: 'event_attachments',
161
+ timestamps: true
162
+ });
163
+ // 虛擬關聯
164
+ exports.EventAttachmentSchema.virtual('_attached', {
165
+ refPath: 'attachedTo',
166
+ localField: 'attachedId',
167
+ foreignField: 'id',
168
+ justOne: true,
169
+ });
170
+ // 複合索引:提升查詢效率
171
+ exports.EventAttachmentSchema.index({ attachedTo: 1, attachedId: 1 });
172
+ exports.EventAttachmentSchema.index({ status: 1, created_at: -1 });
173
+ // =======================================================
174
+ // Models
175
+ // =======================================================
176
+ exports.TextAttachmentModel = (0, mongoose_1.model)('TextAttachment', exports.TextAttachmentSchema);
177
+ exports.ImageAttachmentModel = (0, mongoose_1.model)('ImageAttachment', exports.ImageAttachmentSchema);
178
+ exports.VideoAttachmentModel = (0, mongoose_1.model)('VideoAttachment', exports.VideoAttachmentSchema);
179
+ exports.AudioAttachmentModel = (0, mongoose_1.model)('AudioAttachment', exports.AudioAttachmentSchema);
180
+ exports.FileAttachmentModel = (0, mongoose_1.model)('FileAttachment', exports.FileAttachmentSchema);
181
+ exports.EventAttachmentModel = (0, mongoose_1.model)('EventAttachment', exports.EventAttachmentSchema);
182
+ //# sourceMappingURL=attachment-mongo.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachment-mongo.schema.js","sourceRoot":"","sources":["../../../schemas/mongo/attachment-mongo.schema.ts"],"names":[],"mappings":";;;AAAA,uCAA0D;AAC1D,wDAWiC;AAEjC,yCAA2C;AAkB9B,QAAA,oBAAoB,GAAG,IAAI,iBAAM,CAAyB;IACrE,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,gBAAgB;IACv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AAC,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;AAC9D,6BAAqB,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;AAE3D,0DAA0D;AAC1D,SAAS;AACT,0DAA0D;AAE7C,QAAA,mBAAmB,GAAG,IAAA,gBAAK,EAAyB,gBAAgB,EAAE,4BAAoB,CAAC,CAAC;AAC5F,QAAA,oBAAoB,GAAG,IAAA,gBAAK,EAA0B,iBAAiB,EAAE,6BAAqB,CAAC,CAAC;AAChG,QAAA,oBAAoB,GAAG,IAAA,gBAAK,EAA0B,iBAAiB,EAAE,6BAAqB,CAAC,CAAC;AAChG,QAAA,oBAAoB,GAAG,IAAA,gBAAK,EAA0B,iBAAiB,EAAE,6BAAqB,CAAC,CAAC;AAChG,QAAA,mBAAmB,GAAG,IAAA,gBAAK,EAAyB,gBAAgB,EAAE,4BAAoB,CAAC,CAAC;AAC5F,QAAA,oBAAoB,GAAG,IAAA,gBAAK,EAA0B,iBAAiB,EAAE,6BAAqB,CAAC,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { Schema, Document, Types } from 'mongoose';
2
+ import { BiometricCredential } from '../../models';
3
+ import { UserProfileDocument } from './user-mongo.schema';
4
+ export type BiometricCredentialMongoose = Omit<BiometricCredential, 'userId'> & {
5
+ userId: Types.ObjectId | string | UserProfileDocument;
6
+ _user?: UserProfileDocument;
7
+ };
8
+ export interface BiometricCredentialDocument extends Document, BiometricCredentialMongoose {
9
+ id: string;
10
+ userId: Types.ObjectId | string | UserProfileDocument;
11
+ _user?: UserProfileDocument;
12
+ }
13
+ export declare const BiometricCredentialSchema: Schema<BiometricCredentialDocument, import("mongoose").Model<BiometricCredentialDocument, any, any, any, Document<unknown, any, BiometricCredentialDocument, any, {}> & BiometricCredentialDocument & Required<{
14
+ _id: Types.ObjectId;
15
+ }> & {
16
+ __v: number;
17
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, BiometricCredentialDocument, Document<unknown, {}, import("mongoose").FlatRecord<BiometricCredentialDocument>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<BiometricCredentialDocument> & Required<{
18
+ _id: Types.ObjectId;
19
+ }> & {
20
+ __v: number;
21
+ }>;
22
+ export declare const BiometricCredentialModel: import("mongoose").Model<BiometricCredentialDocument, {}, {}, {}, Document<unknown, {}, BiometricCredentialDocument, {}, {}> & BiometricCredentialDocument & Required<{
23
+ _id: Types.ObjectId;
24
+ }> & {
25
+ __v: number;
26
+ }, any>;
27
+ //# sourceMappingURL=biometric-cred.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"biometric-cred.schema.d.ts","sourceRoot":"","sources":["../../../schemas/mongo/biometric-cred.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAS,QAAQ,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,EAAiB,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAI1D,MAAM,MAAM,2BAA2B,GAAG,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC,GAAG;IAC9E,MAAM,EAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,GAAG,mBAAmB,CAAC;IACtD,KAAK,CAAC,EAAE,mBAAmB,CAAC;CAC7B,CAAC;AAEF,MAAM,WAAW,2BAA4B,SAAQ,QAAQ,EAAE,2BAA2B;IACxF,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,GAAG,mBAAmB,CAAC;IACtD,KAAK,CAAC,EAAE,mBAAmB,CAAC;CAC7B;AAGD,eAAO,MAAM,yBAAyB;;;;;;;;EAWrC,CAAC;AAUF,eAAO,MAAM,wBAAwB;;;;OAAuF,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BiometricCredentialModel = exports.BiometricCredentialSchema = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ const models_1 = require("../../models");
6
+ // 定義 BiometricCredential 的 Schema
7
+ exports.BiometricCredentialSchema = new mongoose_1.Schema({
8
+ id: { type: String, required: true, immutable: true }, // 使用 UUID 作為 id
9
+ userId: { type: String, required: false, index: true }, // 使用者的唯一識別碼
10
+ biometricType: { type: String, enum: models_1.BiometricType, required: true }, // 生物識別憑證類型
11
+ embeddingFilePath: { type: String, required: true }, // 特徵檔案的儲存路徑
12
+ rawFilePath: { type: String, required: true }, // 原始檔案的儲存路徑
13
+ isActive: { type: Boolean, default: true }, // 是否啟用此生物識別憑證
14
+ description: { type: String, required: true }, // 描述此生物識別憑證 (例如: 右手食指)
15
+ }, { timestamps: true });
16
+ exports.BiometricCredentialSchema.virtual('_user', {
17
+ ref: 'UserProfile',
18
+ localField: 'userId',
19
+ foreignField: 'id',
20
+ justOne: true,
21
+ });
22
+ // // 創建 BiometricCredential 模型
23
+ exports.BiometricCredentialModel = (0, mongoose_1.model)('BiometricCredential', exports.BiometricCredentialSchema);
24
+ //# sourceMappingURL=biometric-cred.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"biometric-cred.schema.js","sourceRoot":"","sources":["../../../schemas/mongo/biometric-cred.schema.ts"],"names":[],"mappings":";;;AAAA,uCAA0D;AAC1D,yCAAkE;AAgBlE,kCAAkC;AACrB,QAAA,yBAAyB,GAAG,IAAI,iBAAM,CACjD;IACE,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,gBAAgB;IACvE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,YAAY;IACpE,aAAa,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,sBAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,WAAW;IACjF,iBAAiB,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,YAAY;IACjE,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,YAAY;IAC3D,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,cAAc;IAC1D,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,uBAAuB;CACvE,EACD,EAAE,UAAU,EAAE,IAAI,EAAE,CACrB,CAAC;AAEF,iCAAyB,CAAC,OAAO,CAAC,OAAO,EAAE;IACzC,GAAG,EAAE,aAAa;IAClB,UAAU,EAAE,QAAQ;IACpB,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,IAAI;CACd,CAAC,CAAC;AAEH,+BAA+B;AAClB,QAAA,wBAAwB,GAAG,IAAA,gBAAK,EAA8B,qBAAqB,EAAE,iCAAyB,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { Schema, Document, Types } from 'mongoose';
2
+ import { Camera } from '../../models';
3
+ export type CameraMongoose = Omit<Camera, 'model'> & {};
4
+ export interface CameraDocument extends Document, CameraMongoose {
5
+ id: string;
6
+ }
7
+ export declare const CameraSchema: Schema<CameraDocument, import("mongoose").Model<CameraDocument, any, any, any, Document<unknown, any, CameraDocument, any, {}> & CameraDocument & Required<{
8
+ _id: Types.ObjectId;
9
+ }> & {
10
+ __v: number;
11
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, CameraDocument, Document<unknown, {}, import("mongoose").FlatRecord<CameraDocument>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<CameraDocument> & Required<{
12
+ _id: Types.ObjectId;
13
+ }> & {
14
+ __v: number;
15
+ }>;
16
+ export declare const CameraModel: import("mongoose").Model<CameraDocument, {}, {}, {}, Document<unknown, {}, CameraDocument, {}, {}> & CameraDocument & Required<{
17
+ _id: Types.ObjectId;
18
+ }> & {
19
+ __v: number;
20
+ }, any>;
21
+ //# sourceMappingURL=camera-mongo.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"camera-mongo.schema.d.ts","sourceRoot":"","sources":["../../../schemas/mongo/camera-mongo.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAS,QAAQ,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,EAA4B,MAAM,EAAE,MAAM,cAAc,CAAC;AAEhE,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,EACpD,CAAC;AAEF,MAAM,WAAW,cAAe,SAAQ,QAAQ,EAAE,cAAc;IAC9D,EAAE,EAAE,MAAM,CAAC;CACZ;AAGD,eAAO,MAAM,YAAY;;;;;;;;EAwCD,CAAC;AAWzB,eAAO,MAAM,WAAW;;;;OAAgD,CAAC"}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CameraModel = exports.CameraSchema = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ const models_1 = require("../../models");
6
+ // 定義 Camera 的 Schema
7
+ exports.CameraSchema = new mongoose_1.Schema({
8
+ id: { type: String, required: true, immutable: true }, // 使用 UUID 作為 id
9
+ // deviceModel: { type: String, required: true, index: true }, // 攝影機的型號
10
+ type: { type: String, required: true, enum: models_1.CameraType }, // 攝影機類型 (SHOTGUN / PANORAMIC ...)
11
+ rtspUrl: { type: String, required: false }, // 攝影機串流 URL (若為 RTSP)
12
+ // status: { type: String, required: true, enum: CameraStatus }, // 攝影機狀態
13
+ // resolutionWidth: { type: Number, required: false }, // 解析度寬度 (px)
14
+ // resolutionHeight: { type: Number, required: false }, // 解析度高度 (px)
15
+ // fps: { type: Number, required: false }, // 每秒影格數 (Frames Per Second)
16
+ // encodingFormat: { type: String, required: false }, // 影像編碼格式
17
+ code: { type: String, required: true, unique: true, immutable: true }, // 攝影機代碼
18
+ name: { type: String, required: true }, // 攝影機名稱
19
+ description: { type: String, required: false }, // 描述
20
+ // 室外/已校正座標 (對 OSM)
21
+ location: {
22
+ type: {
23
+ coordinates: {
24
+ type: [Number], // [longitude, latitude]
25
+ validate: {
26
+ validator: function (v) {
27
+ return v.length === 2;
28
+ },
29
+ message: 'coordinates must have exactly 2 elements [lng, lat]'
30
+ }
31
+ },
32
+ area: { type: String, required: false } // 可選的區域描述 (如城市名稱)
33
+ },
34
+ required: false
35
+ },
36
+ // 室內/未校正座標 (樓層圖 local 座標)
37
+ mapId: { type: String, required: false }, // 對應的地圖 ID
38
+ localPosition: {
39
+ type: {
40
+ x: { type: Number, required: true },
41
+ y: { type: Number, required: true }
42
+ },
43
+ required: false
44
+ }
45
+ }, { timestamps: true });
46
+ exports.CameraSchema.virtual('_map', {
47
+ ref: 'Map',
48
+ localField: 'mapId',
49
+ foreignField: 'id',
50
+ justOne: true
51
+ });
52
+ // // 創建 Camera 模型
53
+ exports.CameraModel = (0, mongoose_1.model)('Camera', exports.CameraSchema);
54
+ //# sourceMappingURL=camera-mongo.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"camera-mongo.schema.js","sourceRoot":"","sources":["../../../schemas/mongo/camera-mongo.schema.ts"],"names":[],"mappings":";;;AAAA,uCAA0D;AAC1D,yCAAgE;AAShE,qBAAqB;AACR,QAAA,YAAY,GAAG,IAAI,iBAAM,CAAiB;IACrD,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,gBAAgB;IACvE,wEAAwE;IACxE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EA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,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;AAEzB,oBAAY,CAAC,OAAO,CAAC,MAAM,EAAE;IAC3B,GAAG,EAAE,KAAK;IACV,UAAU,EAAE,OAAO;IACnB,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,IAAI;CACd,CAAC,CAAA;AAGF,kBAAkB;AACL,QAAA,WAAW,GAAG,IAAA,gBAAK,EAAiB,QAAQ,EAAE,oBAAY,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { Schema, Document, Types } from 'mongoose';
2
+ import { CameraRecording } from '../../models';
3
+ export type CameraRecordingMongoose = Omit<CameraRecording, 'model'> & {};
4
+ export interface CameraRecordingDocument extends Document, CameraRecordingMongoose {
5
+ id: string;
6
+ }
7
+ export declare const CameraRecordingSchema: Schema<CameraRecordingDocument, import("mongoose").Model<CameraRecordingDocument, any, any, any, Document<unknown, any, CameraRecordingDocument, any, {}> & CameraRecordingDocument & Required<{
8
+ _id: Types.ObjectId;
9
+ }> & {
10
+ __v: number;
11
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, CameraRecordingDocument, Document<unknown, {}, import("mongoose").FlatRecord<CameraRecordingDocument>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<CameraRecordingDocument> & Required<{
12
+ _id: Types.ObjectId;
13
+ }> & {
14
+ __v: number;
15
+ }>;
16
+ export declare const CameraRecordingModel: import("mongoose").Model<CameraRecordingDocument, {}, {}, {}, Document<unknown, {}, CameraRecordingDocument, {}, {}> & CameraRecordingDocument & Required<{
17
+ _id: Types.ObjectId;
18
+ }> & {
19
+ __v: number;
20
+ }, any>;
21
+ //# sourceMappingURL=camera-recording-mongo.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"camera-recording-mongo.schema.d.ts","sourceRoot":"","sources":["../../../schemas/mongo/camera-recording-mongo.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAS,QAAQ,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,GAAG,EACtE,CAAC;AAEF,MAAM,WAAW,uBAAwB,SAAQ,QAAQ,EAAE,uBAAuB;IAChF,EAAE,EAAE,MAAM,CAAC;CACZ;AAGD,eAAO,MAAM,qBAAqB;;;;;;;;EASV,CAAC;AAWzB,eAAO,MAAM,oBAAoB;;;;OAA2E,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CameraRecordingModel = exports.CameraRecordingSchema = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ // 定義 CameraRecording 的 Schema
6
+ exports.CameraRecordingSchema = new mongoose_1.Schema({
7
+ id: { type: String, required: true, immutable: true }, // 使用 UUID 作為 id
8
+ cameraId: { type: String, required: true }, // 攝影機 ID
9
+ startTime: { type: Date, required: true }, // 開始時間
10
+ endTime: { type: Date, required: true }, // 結束時間
11
+ during: { type: Number, required: true }, // 持續時間 (秒)
12
+ videoUrl: { type: String, required: true }, // 影片檔案路徑
13
+ snapshotUrl: { type: String, required: true }, // 縮圖路徑
14
+ resolution: { type: String, required: true }, // 影片解析度
15
+ }, { timestamps: true });
16
+ exports.CameraRecordingSchema.virtual('_camera', {
17
+ ref: 'Camera',
18
+ localField: 'cameraId',
19
+ foreignField: 'id',
20
+ justOne: true
21
+ });
22
+ // // 創建 CameraRecording 模型
23
+ exports.CameraRecordingModel = (0, mongoose_1.model)('CameraRecording', exports.CameraRecordingSchema);
24
+ //# sourceMappingURL=camera-recording-mongo.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"camera-recording-mongo.schema.js","sourceRoot":"","sources":["../../../schemas/mongo/camera-recording-mongo.schema.ts"],"names":[],"mappings":";;;AAAA,uCAA0D;AAU1D,8BAA8B;AACjB,QAAA,qBAAqB,GAAG,IAAI,iBAAM,CAA0B;IACvE,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,gBAAgB;IACvE,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,SAAS;IACrD,SAAS,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,OAAO;IAClD,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,OAAO;IAChD,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,WAAW;IACrD,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,SAAS;IACrD,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,OAAO;IACtD,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,QAAQ;CACvD,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;AAEzB,6BAAqB,CAAC,OAAO,CAAC,SAAS,EAAE;IACvC,GAAG,EAAE,QAAQ;IACb,UAAU,EAAE,UAAU;IACtB,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,IAAI;CACd,CAAC,CAAA;AAGF,2BAA2B;AACd,QAAA,oBAAoB,GAAG,IAAA,gBAAK,EAA0B,iBAAiB,EAAE,6BAAqB,CAAC,CAAC"}
@@ -0,0 +1,51 @@
1
+ import { CameraDocument } from './camera-mongo.schema';
2
+ import { Schema, Document, Types } from 'mongoose';
3
+ import { Event, EventData } from '../../models';
4
+ import { EventTemplateDocument } from './event-template-mongo.schema';
5
+ import { UserProfileDocument } from './user-mongo.schema';
6
+ export type EventMongoose = Omit<Event, 'templateId' | 'subjectId'> & {
7
+ templateId: string;
8
+ _template?: EventTemplateDocument;
9
+ subjectId: Types.ObjectId | string;
10
+ _subject?: CameraDocument | UserProfileDocument;
11
+ pinned: boolean;
12
+ };
13
+ export interface EventDocument extends Document, EventMongoose {
14
+ id: string;
15
+ }
16
+ export declare const EventSchema: Schema<EventDocument, import("mongoose").Model<EventDocument, any, any, any, Document<unknown, any, EventDocument, any, {}> & EventDocument & Required<{
17
+ _id: Types.ObjectId;
18
+ }> & {
19
+ __v: number;
20
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, EventDocument, Document<unknown, {}, import("mongoose").FlatRecord<EventDocument>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<EventDocument> & Required<{
21
+ _id: Types.ObjectId;
22
+ }> & {
23
+ __v: number;
24
+ }>;
25
+ export declare const EventModel: import("mongoose").Model<EventDocument, {}, {}, {}, Document<unknown, {}, EventDocument, {}, {}> & EventDocument & Required<{
26
+ _id: Types.ObjectId;
27
+ }> & {
28
+ __v: number;
29
+ }, any>;
30
+ export type EventDataMongoose = Omit<EventData, 'eventId'> & {
31
+ eventId: Types.ObjectId | string;
32
+ _event?: EventDocument | null;
33
+ };
34
+ export interface EventDataDocument extends Document, EventDataMongoose {
35
+ id: string;
36
+ }
37
+ export declare const EventDataSchema: Schema<EventDataDocument, import("mongoose").Model<EventDataDocument, any, any, any, Document<unknown, any, EventDataDocument, any, {}> & EventDataDocument & Required<{
38
+ _id: Types.ObjectId;
39
+ }> & {
40
+ __v: number;
41
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, EventDataDocument, Document<unknown, {}, import("mongoose").FlatRecord<EventDataDocument>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<EventDataDocument> & Required<{
42
+ _id: Types.ObjectId;
43
+ }> & {
44
+ __v: number;
45
+ }>;
46
+ export declare const EventDataModel: import("mongoose").Model<EventDataDocument, {}, {}, {}, Document<unknown, {}, EventDataDocument, {}, {}> & EventDataDocument & Required<{
47
+ _id: Types.ObjectId;
48
+ }> & {
49
+ __v: number;
50
+ }, any>;
51
+ //# sourceMappingURL=event-mongo.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-mongo.schema.d.ts","sourceRoot":"","sources":["../../../schemas/mongo/event-mongo.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAS,QAAQ,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,EAA2D,KAAK,EAAE,SAAS,EAAe,MAAM,cAAc,CAAC;AACtH,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,WAAW,CAAC,GAAG;IACpE,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,qBAAqB,CAAC;IAClC,SAAS,EAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC;IACnC,QAAQ,CAAC,EAAE,cAAc,GAAG,mBAAmB,CAAC;IAChD,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,WAAW,aAAc,SAAQ,QAAQ,EAAE,aAAa;IAC5D,EAAE,EAAE,MAAM,CAAC;CACZ;AAGD,eAAO,MAAM,WAAW;;;;;;;;EAesB,CAAC;AA4B/C,eAAO,MAAM,UAAU;;;;OAA6C,CAAC;AAIrE,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,GAAG;IAC3D,OAAO,EAAE,KAAK,CAAC,QAAQ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