@volontariapp/domain-social 0.1.0-snap-b34a5a8

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 (210) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/entities/index.d.ts +5 -0
  3. package/dist/entities/index.d.ts.map +1 -0
  4. package/dist/entities/index.js +5 -0
  5. package/dist/entities/index.js.map +1 -0
  6. package/dist/entities/paginated-ids.entity.d.ts +6 -0
  7. package/dist/entities/paginated-ids.entity.d.ts.map +1 -0
  8. package/dist/entities/paginated-ids.entity.js +2 -0
  9. package/dist/entities/paginated-ids.entity.js.map +1 -0
  10. package/dist/entities/social-event.entity.d.ts +4 -0
  11. package/dist/entities/social-event.entity.d.ts.map +1 -0
  12. package/dist/entities/social-event.entity.js +4 -0
  13. package/dist/entities/social-event.entity.js.map +1 -0
  14. package/dist/entities/social-post.entity.d.ts +4 -0
  15. package/dist/entities/social-post.entity.d.ts.map +1 -0
  16. package/dist/entities/social-post.entity.js +4 -0
  17. package/dist/entities/social-post.entity.js.map +1 -0
  18. package/dist/entities/social-user.entity.d.ts +4 -0
  19. package/dist/entities/social-user.entity.d.ts.map +1 -0
  20. package/dist/entities/social-user.entity.js +4 -0
  21. package/dist/entities/social-user.entity.js.map +1 -0
  22. package/dist/index.d.ts +4 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +4 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/repositories/base/neo4j-base.repository.d.ts +16 -0
  27. package/dist/repositories/base/neo4j-base.repository.d.ts.map +1 -0
  28. package/dist/repositories/base/neo4j-base.repository.js +82 -0
  29. package/dist/repositories/base/neo4j-base.repository.js.map +1 -0
  30. package/dist/repositories/index.d.ts +9 -0
  31. package/dist/repositories/index.d.ts.map +1 -0
  32. package/dist/repositories/index.js +9 -0
  33. package/dist/repositories/index.js.map +1 -0
  34. package/dist/repositories/interfaces/event-post-link.repository.d.ts +9 -0
  35. package/dist/repositories/interfaces/event-post-link.repository.d.ts.map +1 -0
  36. package/dist/repositories/interfaces/event-post-link.repository.js +2 -0
  37. package/dist/repositories/interfaces/event-post-link.repository.js.map +1 -0
  38. package/dist/repositories/interfaces/index.d.ts +7 -0
  39. package/dist/repositories/interfaces/index.d.ts.map +1 -0
  40. package/dist/repositories/interfaces/index.js +7 -0
  41. package/dist/repositories/interfaces/index.js.map +1 -0
  42. package/dist/repositories/interfaces/interaction.repository.d.ts +9 -0
  43. package/dist/repositories/interfaces/interaction.repository.d.ts.map +1 -0
  44. package/dist/repositories/interfaces/interaction.repository.js +2 -0
  45. package/dist/repositories/interfaces/interaction.repository.js.map +1 -0
  46. package/dist/repositories/interfaces/participation.repository.d.ts +15 -0
  47. package/dist/repositories/interfaces/participation.repository.d.ts.map +1 -0
  48. package/dist/repositories/interfaces/participation.repository.js +2 -0
  49. package/dist/repositories/interfaces/participation.repository.js.map +1 -0
  50. package/dist/repositories/interfaces/publication.repository.d.ts +12 -0
  51. package/dist/repositories/interfaces/publication.repository.d.ts.map +1 -0
  52. package/dist/repositories/interfaces/publication.repository.js +2 -0
  53. package/dist/repositories/interfaces/publication.repository.js.map +1 -0
  54. package/dist/repositories/interfaces/relationship.repository.d.ts +13 -0
  55. package/dist/repositories/interfaces/relationship.repository.d.ts.map +1 -0
  56. package/dist/repositories/interfaces/relationship.repository.js +2 -0
  57. package/dist/repositories/interfaces/relationship.repository.js.map +1 -0
  58. package/dist/repositories/interfaces/social-user.repository.d.ts +6 -0
  59. package/dist/repositories/interfaces/social-user.repository.d.ts.map +1 -0
  60. package/dist/repositories/interfaces/social-user.repository.js +2 -0
  61. package/dist/repositories/interfaces/social-user.repository.js.map +1 -0
  62. package/dist/repositories/neo4j-event-post-link.repository.d.ts +13 -0
  63. package/dist/repositories/neo4j-event-post-link.repository.d.ts.map +1 -0
  64. package/dist/repositories/neo4j-event-post-link.repository.js +46 -0
  65. package/dist/repositories/neo4j-event-post-link.repository.js.map +1 -0
  66. package/dist/repositories/neo4j-interaction.repository.d.ts +13 -0
  67. package/dist/repositories/neo4j-interaction.repository.d.ts.map +1 -0
  68. package/dist/repositories/neo4j-interaction.repository.js +48 -0
  69. package/dist/repositories/neo4j-interaction.repository.js.map +1 -0
  70. package/dist/repositories/neo4j-participation.repository.d.ts +19 -0
  71. package/dist/repositories/neo4j-participation.repository.d.ts.map +1 -0
  72. package/dist/repositories/neo4j-participation.repository.js +73 -0
  73. package/dist/repositories/neo4j-participation.repository.js.map +1 -0
  74. package/dist/repositories/neo4j-publication.repository.d.ts +16 -0
  75. package/dist/repositories/neo4j-publication.repository.d.ts.map +1 -0
  76. package/dist/repositories/neo4j-publication.repository.js +58 -0
  77. package/dist/repositories/neo4j-publication.repository.js.map +1 -0
  78. package/dist/repositories/neo4j-relationship.repository.d.ts +17 -0
  79. package/dist/repositories/neo4j-relationship.repository.d.ts.map +1 -0
  80. package/dist/repositories/neo4j-relationship.repository.js +69 -0
  81. package/dist/repositories/neo4j-relationship.repository.js.map +1 -0
  82. package/dist/repositories/neo4j-social-user.repository.d.ts +10 -0
  83. package/dist/repositories/neo4j-social-user.repository.d.ts.map +1 -0
  84. package/dist/repositories/neo4j-social-user.repository.js +37 -0
  85. package/dist/repositories/neo4j-social-user.repository.js.map +1 -0
  86. package/dist/services/event-post-link.service.d.ts +13 -0
  87. package/dist/services/event-post-link.service.d.ts.map +1 -0
  88. package/dist/services/event-post-link.service.js +78 -0
  89. package/dist/services/event-post-link.service.js.map +1 -0
  90. package/dist/services/index.d.ts +7 -0
  91. package/dist/services/index.d.ts.map +1 -0
  92. package/dist/services/index.js +7 -0
  93. package/dist/services/index.js.map +1 -0
  94. package/dist/services/interaction.service.d.ts +13 -0
  95. package/dist/services/interaction.service.d.ts.map +1 -0
  96. package/dist/services/interaction.service.js +78 -0
  97. package/dist/services/interaction.service.js.map +1 -0
  98. package/dist/services/participation.service.d.ts +19 -0
  99. package/dist/services/participation.service.d.ts.map +1 -0
  100. package/dist/services/participation.service.js +148 -0
  101. package/dist/services/participation.service.js.map +1 -0
  102. package/dist/services/publication.service.d.ts +16 -0
  103. package/dist/services/publication.service.d.ts.map +1 -0
  104. package/dist/services/publication.service.js +113 -0
  105. package/dist/services/publication.service.js.map +1 -0
  106. package/dist/services/relationship.service.d.ts +17 -0
  107. package/dist/services/relationship.service.d.ts.map +1 -0
  108. package/dist/services/relationship.service.js +124 -0
  109. package/dist/services/relationship.service.js.map +1 -0
  110. package/dist/services/social-user.service.d.ts +10 -0
  111. package/dist/services/social-user.service.d.ts.map +1 -0
  112. package/dist/services/social-user.service.js +67 -0
  113. package/dist/services/social-user.service.js.map +1 -0
  114. package/dist/test/__test-utils__/factories/paginated-ids.factory.d.ts +7 -0
  115. package/dist/test/__test-utils__/factories/paginated-ids.factory.d.ts.map +1 -0
  116. package/dist/test/__test-utils__/factories/paginated-ids.factory.js +24 -0
  117. package/dist/test/__test-utils__/factories/paginated-ids.factory.js.map +1 -0
  118. package/dist/test/__test-utils__/factories/social-event.factory.d.ts +6 -0
  119. package/dist/test/__test-utils__/factories/social-event.factory.d.ts.map +1 -0
  120. package/dist/test/__test-utils__/factories/social-event.factory.js +14 -0
  121. package/dist/test/__test-utils__/factories/social-event.factory.js.map +1 -0
  122. package/dist/test/__test-utils__/factories/social-post.factory.d.ts +6 -0
  123. package/dist/test/__test-utils__/factories/social-post.factory.d.ts.map +1 -0
  124. package/dist/test/__test-utils__/factories/social-post.factory.js +14 -0
  125. package/dist/test/__test-utils__/factories/social-post.factory.js.map +1 -0
  126. package/dist/test/__test-utils__/factories/social-user.factory.d.ts +6 -0
  127. package/dist/test/__test-utils__/factories/social-user.factory.d.ts.map +1 -0
  128. package/dist/test/__test-utils__/factories/social-user.factory.js +14 -0
  129. package/dist/test/__test-utils__/factories/social-user.factory.js.map +1 -0
  130. package/dist/test/__test-utils__/mocks/event-post-link.repository.mock.d.ts +4 -0
  131. package/dist/test/__test-utils__/mocks/event-post-link.repository.mock.d.ts.map +1 -0
  132. package/dist/test/__test-utils__/mocks/event-post-link.repository.mock.js +8 -0
  133. package/dist/test/__test-utils__/mocks/event-post-link.repository.mock.js.map +1 -0
  134. package/dist/test/__test-utils__/mocks/interaction.repository.mock.d.ts +4 -0
  135. package/dist/test/__test-utils__/mocks/interaction.repository.mock.d.ts.map +1 -0
  136. package/dist/test/__test-utils__/mocks/interaction.repository.mock.js +8 -0
  137. package/dist/test/__test-utils__/mocks/interaction.repository.mock.js.map +1 -0
  138. package/dist/test/__test-utils__/mocks/participation.repository.mock.d.ts +4 -0
  139. package/dist/test/__test-utils__/mocks/participation.repository.mock.d.ts.map +1 -0
  140. package/dist/test/__test-utils__/mocks/participation.repository.mock.js +14 -0
  141. package/dist/test/__test-utils__/mocks/participation.repository.mock.js.map +1 -0
  142. package/dist/test/__test-utils__/mocks/publication.repository.mock.d.ts +4 -0
  143. package/dist/test/__test-utils__/mocks/publication.repository.mock.d.ts.map +1 -0
  144. package/dist/test/__test-utils__/mocks/publication.repository.mock.js +11 -0
  145. package/dist/test/__test-utils__/mocks/publication.repository.mock.js.map +1 -0
  146. package/dist/test/__test-utils__/mocks/relationship.repository.mock.d.ts +4 -0
  147. package/dist/test/__test-utils__/mocks/relationship.repository.mock.d.ts.map +1 -0
  148. package/dist/test/__test-utils__/mocks/relationship.repository.mock.js +12 -0
  149. package/dist/test/__test-utils__/mocks/relationship.repository.mock.js.map +1 -0
  150. package/dist/test/__test-utils__/mocks/social-user.repository.mock.d.ts +4 -0
  151. package/dist/test/__test-utils__/mocks/social-user.repository.mock.d.ts.map +1 -0
  152. package/dist/test/__test-utils__/mocks/social-user.repository.mock.js +7 -0
  153. package/dist/test/__test-utils__/mocks/social-user.repository.mock.js.map +1 -0
  154. package/dist/test/integration/event-post-link.repository.int.spec.d.ts +2 -0
  155. package/dist/test/integration/event-post-link.repository.int.spec.d.ts.map +1 -0
  156. package/dist/test/integration/event-post-link.repository.int.spec.js +123 -0
  157. package/dist/test/integration/event-post-link.repository.int.spec.js.map +1 -0
  158. package/dist/test/integration/interaction.repository.int.spec.d.ts +2 -0
  159. package/dist/test/integration/interaction.repository.int.spec.d.ts.map +1 -0
  160. package/dist/test/integration/interaction.repository.int.spec.js +114 -0
  161. package/dist/test/integration/interaction.repository.int.spec.js.map +1 -0
  162. package/dist/test/integration/participation.repository.int.spec.d.ts +2 -0
  163. package/dist/test/integration/participation.repository.int.spec.d.ts.map +1 -0
  164. package/dist/test/integration/participation.repository.int.spec.js +162 -0
  165. package/dist/test/integration/participation.repository.int.spec.js.map +1 -0
  166. package/dist/test/integration/publication.repository.int.spec.d.ts +2 -0
  167. package/dist/test/integration/publication.repository.int.spec.d.ts.map +1 -0
  168. package/dist/test/integration/publication.repository.int.spec.js +165 -0
  169. package/dist/test/integration/publication.repository.int.spec.js.map +1 -0
  170. package/dist/test/integration/relationship.repository.int.spec.d.ts +2 -0
  171. package/dist/test/integration/relationship.repository.int.spec.d.ts.map +1 -0
  172. package/dist/test/integration/relationship.repository.int.spec.js +132 -0
  173. package/dist/test/integration/relationship.repository.int.spec.js.map +1 -0
  174. package/dist/test/integration/social-user.repository.int.spec.d.ts +2 -0
  175. package/dist/test/integration/social-user.repository.int.spec.d.ts.map +1 -0
  176. package/dist/test/integration/social-user.repository.int.spec.js +55 -0
  177. package/dist/test/integration/social-user.repository.int.spec.js.map +1 -0
  178. package/dist/test/neo4j-driver.d.ts +6 -0
  179. package/dist/test/neo4j-driver.d.ts.map +1 -0
  180. package/dist/test/neo4j-driver.js +28 -0
  181. package/dist/test/neo4j-driver.js.map +1 -0
  182. package/dist/test/setup.d.ts +2 -0
  183. package/dist/test/setup.d.ts.map +1 -0
  184. package/dist/test/setup.js +2 -0
  185. package/dist/test/setup.js.map +1 -0
  186. package/dist/test/unit/event-post-link.service.unit.spec.d.ts +2 -0
  187. package/dist/test/unit/event-post-link.service.unit.spec.d.ts.map +1 -0
  188. package/dist/test/unit/event-post-link.service.unit.spec.js +88 -0
  189. package/dist/test/unit/event-post-link.service.unit.spec.js.map +1 -0
  190. package/dist/test/unit/interaction.service.unit.spec.d.ts +2 -0
  191. package/dist/test/unit/interaction.service.unit.spec.d.ts.map +1 -0
  192. package/dist/test/unit/interaction.service.unit.spec.js +89 -0
  193. package/dist/test/unit/interaction.service.unit.spec.js.map +1 -0
  194. package/dist/test/unit/participation.service.unit.spec.d.ts +2 -0
  195. package/dist/test/unit/participation.service.unit.spec.d.ts.map +1 -0
  196. package/dist/test/unit/participation.service.unit.spec.js +171 -0
  197. package/dist/test/unit/participation.service.unit.spec.js.map +1 -0
  198. package/dist/test/unit/publication.service.unit.spec.d.ts +2 -0
  199. package/dist/test/unit/publication.service.unit.spec.d.ts.map +1 -0
  200. package/dist/test/unit/publication.service.unit.spec.js +129 -0
  201. package/dist/test/unit/publication.service.unit.spec.js.map +1 -0
  202. package/dist/test/unit/relationship.service.unit.spec.d.ts +2 -0
  203. package/dist/test/unit/relationship.service.unit.spec.d.ts.map +1 -0
  204. package/dist/test/unit/relationship.service.unit.spec.js +135 -0
  205. package/dist/test/unit/relationship.service.unit.spec.js.map +1 -0
  206. package/dist/test/unit/social-user.service.unit.spec.d.ts +2 -0
  207. package/dist/test/unit/social-user.service.unit.spec.d.ts.map +1 -0
  208. package/dist/test/unit/social-user.service.unit.spec.js +73 -0
  209. package/dist/test/unit/social-user.service.unit.spec.js.map +1 -0
  210. package/package.json +57 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,10 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## 0.1.0
6
+
7
+ ### Minor Changes
8
+
9
+ - Initial package scaffold.
10
+
@@ -0,0 +1,5 @@
1
+ export * from './social-user.entity.js';
2
+ export * from './social-post.entity.js';
3
+ export * from './social-event.entity.js';
4
+ export * from './paginated-ids.entity.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './social-user.entity.js';
2
+ export * from './social-post.entity.js';
3
+ export * from './social-event.entity.js';
4
+ export * from './paginated-ids.entity.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { PaginationResponse } from '@volontariapp/contracts';
2
+ export interface PaginatedIds {
3
+ ids: string[];
4
+ pagination: PaginationResponse;
5
+ }
6
+ //# sourceMappingURL=paginated-ids.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paginated-ids.entity.d.ts","sourceRoot":"","sources":["../../src/entities/paginated-ids.entity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,UAAU,EAAE,kBAAkB,CAAC;CAChC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=paginated-ids.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paginated-ids.entity.js","sourceRoot":"","sources":["../../src/entities/paginated-ids.entity.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export declare class SocialEventEntity {
2
+ eventId: string;
3
+ }
4
+ //# sourceMappingURL=social-event.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"social-event.entity.d.ts","sourceRoot":"","sources":["../../src/entities/social-event.entity.ts"],"names":[],"mappings":"AAAA,qBAAa,iBAAiB;IAC5B,OAAO,EAAG,MAAM,CAAC;CAClB"}
@@ -0,0 +1,4 @@
1
+ export class SocialEventEntity {
2
+ eventId;
3
+ }
4
+ //# sourceMappingURL=social-event.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"social-event.entity.js","sourceRoot":"","sources":["../../src/entities/social-event.entity.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,iBAAiB;IAC5B,OAAO,CAAU;CAClB"}
@@ -0,0 +1,4 @@
1
+ export declare class SocialPostEntity {
2
+ postId: string;
3
+ }
4
+ //# sourceMappingURL=social-post.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"social-post.entity.d.ts","sourceRoot":"","sources":["../../src/entities/social-post.entity.ts"],"names":[],"mappings":"AAAA,qBAAa,gBAAgB;IAC3B,MAAM,EAAG,MAAM,CAAC;CACjB"}
@@ -0,0 +1,4 @@
1
+ export class SocialPostEntity {
2
+ postId;
3
+ }
4
+ //# sourceMappingURL=social-post.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"social-post.entity.js","sourceRoot":"","sources":["../../src/entities/social-post.entity.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,gBAAgB;IAC3B,MAAM,CAAU;CACjB"}
@@ -0,0 +1,4 @@
1
+ export declare class SocialUserEntity {
2
+ userId: string;
3
+ }
4
+ //# sourceMappingURL=social-user.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"social-user.entity.d.ts","sourceRoot":"","sources":["../../src/entities/social-user.entity.ts"],"names":[],"mappings":"AAAA,qBAAa,gBAAgB;IAC3B,MAAM,EAAG,MAAM,CAAC;CACjB"}
@@ -0,0 +1,4 @@
1
+ export class SocialUserEntity {
2
+ userId;
3
+ }
4
+ //# sourceMappingURL=social-user.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"social-user.entity.js","sourceRoot":"","sources":["../../src/entities/social-user.entity.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,gBAAgB;IAC3B,MAAM,CAAU;CACjB"}
@@ -0,0 +1,4 @@
1
+ export * from './entities/index.js';
2
+ export * from './repositories/index.js';
3
+ export * from './services/index.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ export * from './entities/index.js';
2
+ export * from './repositories/index.js';
3
+ export * from './services/index.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { NestNeo4jProvider } from '@volontariapp/bridge-nest';
2
+ import type { PaginationRequest } from '@volontariapp/contracts';
3
+ import type { PaginatedIds } from '../../entities/paginated-ids.entity.js';
4
+ type Neo4jRecord = {
5
+ get(key: string): unknown;
6
+ };
7
+ export declare abstract class Neo4jBaseRepository {
8
+ protected readonly provider: NestNeo4jProvider;
9
+ constructor(provider: NestNeo4jProvider);
10
+ protected read<T>(cypher: string, params: Record<string, unknown>, mapper: (record: Neo4jRecord) => T): Promise<T[]>;
11
+ protected readOne<T>(cypher: string, params: Record<string, unknown>, mapper: (record: Neo4jRecord) => T): Promise<T | null>;
12
+ protected write(cypher: string, params?: Record<string, unknown>): Promise<void>;
13
+ protected readPaginated(dataCypher: string, countCypher: string, params: Record<string, unknown>, pagination: PaginationRequest, idKey?: string): Promise<PaginatedIds>;
14
+ }
15
+ export {};
16
+ //# sourceMappingURL=neo4j-base.repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"neo4j-base.repository.d.ts","sourceRoot":"","sources":["../../../src/repositories/base/neo4j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(value == null)
5
+ return 0;
6
+ if (typeof value === 'number')
7
+ return value;
8
+ if (typeof value === 'object' && 'toNumber' in value) {
9
+ return value.toNumber();
10
+ }
11
+ return Number(value);
12
+ }
13
+ export class Neo4jBaseRepository {
14
+ provider;
15
+ constructor(provider) {
16
+ this.provider = provider;
17
+ }
18
+ async read(cypher, params, mapper) {
19
+ const session = this.provider.getDriver().session();
20
+ try {
21
+ const result = await session.run(cypher, params);
22
+ return result.records.map((r) => mapper(r));
23
+ }
24
+ catch (error) {
25
+ throw DATABASE_QUERY_ERROR(error.message);
26
+ }
27
+ finally {
28
+ await session.close();
29
+ }
30
+ }
31
+ async readOne(cypher, params, mapper) {
32
+ const results = await this.read(cypher, params, mapper);
33
+ return results[0] ?? null;
34
+ }
35
+ async write(cypher, params = {}) {
36
+ const session = this.provider.getDriver().session();
37
+ try {
38
+ await session.run(cypher, params);
39
+ }
40
+ catch (error) {
41
+ throw DATABASE_QUERY_ERROR(error.message);
42
+ }
43
+ finally {
44
+ await session.close();
45
+ }
46
+ }
47
+ async readPaginated(dataCypher, countCypher, params, pagination, idKey = 'id') {
48
+ const safePage = pagination.page > 0 ? pagination.page : 1;
49
+ const safeLimit = pagination.limit > 0 ? pagination.limit : 10;
50
+ const skip = (safePage - 1) * safeLimit;
51
+ const driver = this.provider.getDriver();
52
+ const dataSession = driver.session();
53
+ const countSession = driver.session();
54
+ try {
55
+ const [dataResult, countResult] = await Promise.all([
56
+ dataSession.run(dataCypher, {
57
+ ...params,
58
+ skip: neo4j.int(skip),
59
+ limit: neo4j.int(safeLimit),
60
+ }),
61
+ countSession.run(countCypher, params),
62
+ ]);
63
+ const ids = dataResult.records.map((r) => r.get(idKey));
64
+ const total = toSafeInt(countResult.records[0]?.get('total'));
65
+ const totalPages = Math.ceil(total / safeLimit);
66
+ const paginationResponse = {
67
+ page: safePage,
68
+ limit: safeLimit,
69
+ total,
70
+ totalPages,
71
+ };
72
+ return { ids, pagination: paginationResponse };
73
+ }
74
+ catch (error) {
75
+ throw DATABASE_QUERY_ERROR(error.message);
76
+ }
77
+ finally {
78
+ await Promise.all([dataSession.close(), countSession.close()]);
79
+ }
80
+ }
81
+ }
82
+ //# sourceMappingURL=neo4j-base.repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"neo4j-base.repository.js","sourceRoot":"","sources":["../../../src/repositories/base/neo4j-base.repository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,cAAc,CAAC;AAGjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAKjE,SAAS,SAAS,CAAC,KAAc;IAC/B,IAAI,KAAK,IAAI,IAAI;QAAE,OAAO,CAAC,CAAC;IAC5B,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,UAAU,IAAI,KAAK,EAAE,CAAC;QACrD,OAAQ,KAAgC,CAAC,QAAQ,EAAE,CAAC;IACtD,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,MAAM,OAAgB,mBAAmB;IACR;IAA/B,YAA+B,QAA2B;QAA3B,aAAQ,GAAR,QAAQ,CAAmB;IAAG,CAAC;IAEpD,KAAK,CAAC,IAAI,CAClB,MAAc,EACd,MAA+B,EAC/B,MAAkC;QAElC,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,CAAC;QACpD,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YACjD,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAgB,CAAC,CAAC,CAAC;QAC7D,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,MAAM,oBAAoB,CAAE,KAAe,CAAC,OAAO,CAAC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@@ -0,0 +1,9 @@
1
+ export * from './base/neo4j-base.repository.js';
2
+ export * from './interfaces/index.js';
3
+ export * from './neo4j-social-user.repository.js';
4
+ export * from './neo4j-relationship.repository.js';
5
+ export * from './neo4j-publication.repository.js';
6
+ export * from './neo4j-interaction.repository.js';
7
+ export * from './neo4j-participation.repository.js';
8
+ export * from './neo4j-event-post-link.repository.js';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/repositories/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,uBAAuB,CAAC;AACtC,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC"}
@@ -0,0 +1,9 @@
1
+ export * from './base/neo4j-base.repository.js';
2
+ export * from './interfaces/index.js';
3
+ export * from './neo4j-social-user.repository.js';
4
+ export * from './neo4j-relationship.repository.js';
5
+ export * from './neo4j-publication.repository.js';
6
+ export * from './neo4j-interaction.repository.js';
7
+ export * from './neo4j-participation.repository.js';
8
+ export * from './neo4j-event-post-link.repository.js';
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/repositories/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,uBAAuB,CAAC;AACtC,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { PaginationRequest } from '@volontariapp/contracts';
2
+ import type { PaginatedIds } from '../../entities/paginated-ids.entity.js';
3
+ export interface IEventPostLinkRepository {
4
+ linkPostToEvent(postId: string, eventId: string): Promise<void>;
5
+ unlinkPostFromEvent(postId: string, eventId: string): Promise<void>;
6
+ getEventRelatedToPost(postId: string): Promise<string | null>;
7
+ getEventPosts(eventId: string, pagination: PaginationRequest): Promise<PaginatedIds>;
8
+ }
9
+ //# sourceMappingURL=event-post-link.repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-post-link.repository.d.ts","sourceRoot":"","sources":["../../../src/repositories/interfaces/event-post-link.repository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAE3E,MAAM,WAAW,wBAAwB;IACvC,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC9D,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CACtF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=event-post-link.repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-post-link.repository.js","sourceRoot":"","sources":["../../../src/repositories/interfaces/event-post-link.repository.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ export * from './social-user.repository.js';
2
+ export * from './relationship.repository.js';
3
+ export * from './publication.repository.js';
4
+ export * from './interaction.repository.js';
5
+ export * from './participation.repository.js';
6
+ export * from './event-post-link.repository.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/repositories/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export * from './social-user.repository.js';
2
+ export * from './relationship.repository.js';
3
+ export * from './publication.repository.js';
4
+ export * from './interaction.repository.js';
5
+ export * from './participation.repository.js';
6
+ export * from './event-post-link.repository.js';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/repositories/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { PaginationRequest } from '@volontariapp/contracts';
2
+ import type { PaginatedIds } from '../../entities/paginated-ids.entity.js';
3
+ export interface IInteractionRepository {
4
+ createLike(userId: string, postId: string): Promise<void>;
5
+ deleteLike(userId: string, postId: string): Promise<void>;
6
+ getUserLikes(userId: string, pagination: PaginationRequest): Promise<PaginatedIds>;
7
+ getPostLikers(postId: string, pagination: PaginationRequest): Promise<PaginatedIds>;
8
+ }
9
+ //# sourceMappingURL=interaction.repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interaction.repository.d.ts","sourceRoot":"","sources":["../../../src/repositories/interfaces/interaction.repository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAE3E,MAAM,WAAW,sBAAsB;IACrC,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACnF,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CACrF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=interaction.repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interaction.repository.js","sourceRoot":"","sources":["../../../src/repositories/interfaces/interaction.repository.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ import type { PaginationRequest } from '@volontariapp/contracts';
2
+ import type { PaginatedIds } from '../../entities/paginated-ids.entity.js';
3
+ export interface IParticipationRepository {
4
+ createEventNode(eventId: string): Promise<void>;
5
+ deleteEventNode(eventId: string): Promise<void>;
6
+ eventExists(eventId: string): Promise<boolean>;
7
+ createUserEvent(userId: string, eventId: string): Promise<void>;
8
+ deleteUserEvent(userId: string, eventId: string): Promise<void>;
9
+ createParticipation(userId: string, eventId: string): Promise<void>;
10
+ deleteParticipation(userId: string, eventId: string): Promise<void>;
11
+ getUserEvents(userId: string, pagination: PaginationRequest): Promise<PaginatedIds>;
12
+ getUserParticipations(userId: string, pagination: PaginationRequest): Promise<PaginatedIds>;
13
+ getEventParticipants(eventId: string, pagination: PaginationRequest): Promise<PaginatedIds>;
14
+ }
15
+ //# sourceMappingURL=participation.repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"participation.repository.d.ts","sourceRoot":"","sources":["../../../src/repositories/interfaces/participation.repository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAE3E,MAAM,WAAW,wBAAwB;IACvC,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/C,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACpF,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAC5F,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CAC7F"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=participation.repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"participation.repository.js","sourceRoot":"","sources":["../../../src/repositories/interfaces/participation.repository.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import type { PaginationRequest } from '@volontariapp/contracts';
2
+ import type { PaginatedIds } from '../../entities/paginated-ids.entity.js';
3
+ export interface IPublicationRepository {
4
+ createPostNode(postId: string): Promise<void>;
5
+ deletePostNode(postId: string): Promise<void>;
6
+ postExists(postId: string): Promise<boolean>;
7
+ createOwnership(userId: string, postId: string): Promise<void>;
8
+ deleteOwnership(userId: string, postId: string): Promise<void>;
9
+ getUserPosts(userId: string, pagination: PaginationRequest): Promise<PaginatedIds>;
10
+ getFeed(userId: string, pagination: PaginationRequest): Promise<PaginatedIds>;
11
+ }
12
+ //# sourceMappingURL=publication.repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publication.repository.d.ts","sourceRoot":"","sources":["../../../src/repositories/interfaces/publication.repository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAE3E,MAAM,WAAW,sBAAsB;IACrC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7C,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACnF,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CAC/E"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=publication.repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publication.repository.js","sourceRoot":"","sources":["../../../src/repositories/interfaces/publication.repository.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ import type { PaginationRequest } from '@volontariapp/contracts';
2
+ import type { PaginatedIds } from '../../entities/paginated-ids.entity.js';
3
+ export interface IRelationshipRepository {
4
+ createFollow(followerId: string, followedId: string): Promise<void>;
5
+ deleteFollow(followerId: string, followedId: string): Promise<void>;
6
+ createBlock(blockerId: string, blockedId: string): Promise<void>;
7
+ deleteBlock(blockerId: string, blockedId: string): Promise<void>;
8
+ getFollows(userId: string, pagination: PaginationRequest): Promise<PaginatedIds>;
9
+ getFollowers(userId: string, pagination: PaginationRequest): Promise<PaginatedIds>;
10
+ getBlocks(userId: string, pagination: PaginationRequest): Promise<PaginatedIds>;
11
+ getWhoBlockedMe(userId: string, pagination: PaginationRequest): Promise<PaginatedIds>;
12
+ }
13
+ //# sourceMappingURL=relationship.repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relationship.repository.d.ts","sourceRoot":"","sources":["../../../src/repositories/interfaces/relationship.repository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAE3E,MAAM,WAAW,uBAAuB;IACtC,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjE,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjE,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACjF,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACnF,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAChF,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CACvF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=relationship.repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relationship.repository.js","sourceRoot":"","sources":["../../../src/repositories/interfaces/relationship.repository.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ export interface ISocialUserRepository {
2
+ createNode(userId: string): Promise<void>;
3
+ deleteNode(userId: string): Promise<void>;
4
+ exists(userId: string): Promise<boolean>;
5
+ }
6
+ //# sourceMappingURL=social-user.repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"social-user.repository.d.ts","sourceRoot":"","sources":["../../../src/repositories/interfaces/social-user.repository.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=social-user.repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"social-user.repository.js","sourceRoot":"","sources":["../../../src/repositories/interfaces/social-user.repository.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ import { NestNeo4jProvider } from '@volontariapp/bridge-nest';
2
+ import type { PaginationRequest } from '@volontariapp/contracts';
3
+ import { Neo4jBaseRepository } from './base/neo4j-base.repository.js';
4
+ import type { IEventPostLinkRepository } from './interfaces/event-post-link.repository.js';
5
+ import type { PaginatedIds } from '../entities/paginated-ids.entity.js';
6
+ export declare class Neo4jEventPostLinkRepository extends Neo4jBaseRepository implements IEventPostLinkRepository {
7
+ constructor(provider: NestNeo4jProvider);
8
+ linkPostToEvent(postId: string, eventId: string): Promise<void>;
9
+ unlinkPostFromEvent(postId: string, eventId: string): Promise<void>;
10
+ getEventRelatedToPost(postId: string): Promise<string | null>;
11
+ getEventPosts(eventId: string, pagination: PaginationRequest): Promise<PaginatedIds>;
12
+ }
13
+ //# sourceMappingURL=neo4j-event-post-link.repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"neo4j-event-post-link.repository.d.ts","sourceRoot":"","sources":["../../src/repositories/neo4j-event-post-link.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AAC3F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAExE,qBACa,4BACX,SAAQ,mBACR,YAAW,wBAAwB;gBAIjC,QAAQ,EAAE,iBAAiB;IAKvB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAS/D,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQnE,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAS7D,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC;CAW3F"}
@@ -0,0 +1,46 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
11
+ return function (target, key) { decorator(target, key, paramIndex); }
12
+ };
13
+ import { Injectable, Inject } from '@nestjs/common';
14
+ import { NestNeo4jProvider } from '@volontariapp/bridge-nest';
15
+ import { Neo4jBaseRepository } from './base/neo4j-base.repository.js';
16
+ let Neo4jEventPostLinkRepository = class Neo4jEventPostLinkRepository extends Neo4jBaseRepository {
17
+ constructor(provider) {
18
+ super(provider);
19
+ }
20
+ async linkPostToEvent(postId, eventId) {
21
+ await this.write(`MATCH (p:SocialPost {postId: $postId})
22
+ MATCH (e:SocialEvent {eventId: $eventId})
23
+ MERGE (p)-[:LINK_TO_EVENT]->(e)`, { postId, eventId });
24
+ }
25
+ async unlinkPostFromEvent(postId, eventId) {
26
+ await this.write(`MATCH (:SocialPost {postId: $postId})-[r:LINK_TO_EVENT]->(:SocialEvent {eventId: $eventId})
27
+ DELETE r`, { postId, eventId });
28
+ }
29
+ async getEventRelatedToPost(postId) {
30
+ return this.readOne(`MATCH (:SocialPost {postId: $postId})-[:LINK_TO_EVENT]->(e:SocialEvent)
31
+ RETURN e.eventId AS eventId`, { postId }, (r) => r.get('eventId'));
32
+ }
33
+ async getEventPosts(eventId, pagination) {
34
+ return this.readPaginated(`MATCH (p:SocialPost)-[:LINK_TO_EVENT]->(:SocialEvent {eventId: $eventId})
35
+ RETURN p.postId AS id
36
+ SKIP $skip LIMIT $limit`, `MATCH (p:SocialPost)-[:LINK_TO_EVENT]->(:SocialEvent {eventId: $eventId})
37
+ RETURN count(p) AS total`, { eventId }, pagination);
38
+ }
39
+ };
40
+ Neo4jEventPostLinkRepository = __decorate([
41
+ Injectable(),
42
+ __param(0, Inject(NestNeo4jProvider)),
43
+ __metadata("design:paramtypes", [NestNeo4jProvider])
44
+ ], Neo4jEventPostLinkRepository);
45
+ export { Neo4jEventPostLinkRepository };
46
+ //# sourceMappingURL=neo4j-event-post-link.repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"neo4j-event-post-link.repository.js","sourceRoot":"","sources":["../../src/repositories/neo4j-event-post-link.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAK/D,IAAM,4BAA4B,GAAlC,MAAM,4BACX,SAAQ,mBAAmB;IAG3B,YAEE,QAA2B;QAE3B,KAAK,CAAC,QAAQ,CAAC,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,MAAc,EAAE,OAAe;QACnD,MAAM,IAAI,CAAC,KAAK,CACd;;uCAEiC,EACjC,EAAE,MAAM,EAAE,OAAO,EAAE,CACpB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,MAAc,EAAE,OAAe;QACvD,MAAM,IAAI,CAAC,KAAK,CACd;gBACU,EACV,EAAE,MAAM,EAAE,OAAO,EAAE,CACpB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,qBAAqB,CAAC,MAAc;QACxC,OAAO,IAAI,CAAC,OAAO,CACjB;mCAC6B,EAC7B,EAAE,MAAM,EAAE,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAW,CAClC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,OAAe,EAAE,UAA6B;QAChE,OAAO,IAAI,CAAC,aAAa,CACvB;;+BAEyB,EACzB;gCAC0B,EAC1B,EAAE,OAAO,EAAE,EACX,UAAU,CACX,CAAC;IACJ,CAAC;CACF,CAAA;AAhDY,4BAA4B;IADxC,UAAU,EAAE;IAMR,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;qCAChB,iBAAiB;GANlB,4BAA4B,CAgDxC"}
@@ -0,0 +1,13 @@
1
+ import { NestNeo4jProvider } from '@volontariapp/bridge-nest';
2
+ import type { PaginationRequest } from '@volontariapp/contracts';
3
+ import { Neo4jBaseRepository } from './base/neo4j-base.repository.js';
4
+ import type { IInteractionRepository } from './interfaces/interaction.repository.js';
5
+ import type { PaginatedIds } from '../entities/paginated-ids.entity.js';
6
+ export declare class Neo4jInteractionRepository extends Neo4jBaseRepository implements IInteractionRepository {
7
+ constructor(provider: NestNeo4jProvider);
8
+ createLike(userId: string, postId: string): Promise<void>;
9
+ deleteLike(userId: string, postId: string): Promise<void>;
10
+ getUserLikes(userId: string, pagination: PaginationRequest): Promise<PaginatedIds>;
11
+ getPostLikers(postId: string, pagination: PaginationRequest): Promise<PaginatedIds>;
12
+ }
13
+ //# sourceMappingURL=neo4j-interaction.repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"neo4j-interaction.repository.d.ts","sourceRoot":"","sources":["../../src/repositories/neo4j-interaction.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAExE,qBACa,0BACX,SAAQ,mBACR,YAAW,sBAAsB;gBAI/B,QAAQ,EAAE,iBAAiB;IAKvB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IASzD,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQzD,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC;IAYlF,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC;CAW1F"}
@@ -0,0 +1,48 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
11
+ return function (target, key) { decorator(target, key, paramIndex); }
12
+ };
13
+ import { Injectable, Inject } from '@nestjs/common';
14
+ import { NestNeo4jProvider } from '@volontariapp/bridge-nest';
15
+ import { Neo4jBaseRepository } from './base/neo4j-base.repository.js';
16
+ let Neo4jInteractionRepository = class Neo4jInteractionRepository extends Neo4jBaseRepository {
17
+ constructor(provider) {
18
+ super(provider);
19
+ }
20
+ async createLike(userId, postId) {
21
+ await this.write(`MATCH (u:SocialUser {userId: $userId})
22
+ MATCH (p:SocialPost {postId: $postId})
23
+ MERGE (u)-[:LIKE]->(p)`, { userId, postId });
24
+ }
25
+ async deleteLike(userId, postId) {
26
+ await this.write(`MATCH (:SocialUser {userId: $userId})-[r:LIKE]->(:SocialPost {postId: $postId})
27
+ DELETE r`, { userId, postId });
28
+ }
29
+ async getUserLikes(userId, pagination) {
30
+ return this.readPaginated(`MATCH (:SocialUser {userId: $userId})-[:LIKE]->(p:SocialPost)
31
+ RETURN p.postId AS id
32
+ SKIP $skip LIMIT $limit`, `MATCH (:SocialUser {userId: $userId})-[:LIKE]->(p:SocialPost)
33
+ RETURN count(p) AS total`, { userId }, pagination);
34
+ }
35
+ async getPostLikers(postId, pagination) {
36
+ return this.readPaginated(`MATCH (u:SocialUser)-[:LIKE]->(:SocialPost {postId: $postId})
37
+ RETURN u.userId AS id
38
+ SKIP $skip LIMIT $limit`, `MATCH (u:SocialUser)-[:LIKE]->(:SocialPost {postId: $postId})
39
+ RETURN count(u) AS total`, { postId }, pagination);
40
+ }
41
+ };
42
+ Neo4jInteractionRepository = __decorate([
43
+ Injectable(),
44
+ __param(0, Inject(NestNeo4jProvider)),
45
+ __metadata("design:paramtypes", [NestNeo4jProvider])
46
+ ], Neo4jInteractionRepository);
47
+ export { Neo4jInteractionRepository };
48
+ //# sourceMappingURL=neo4j-interaction.repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"neo4j-interaction.repository.js","sourceRoot":"","sources":["../../src/repositories/neo4j-interaction.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAK/D,IAAM,0BAA0B,GAAhC,MAAM,0BACX,SAAQ,mBAAmB;IAG3B,YAEE,QAA2B;QAE3B,KAAK,CAAC,QAAQ,CAAC,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,MAAc,EAAE,MAAc;QAC7C,MAAM,IAAI,CAAC,KAAK,CACd;;8BAEwB,EACxB,EAAE,MAAM,EAAE,MAAM,EAAE,CACnB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,MAAc,EAAE,MAAc;QAC7C,MAAM,IAAI,CAAC,KAAK,CACd;gBACU,EACV,EAAE,MAAM,EAAE,MAAM,EAAE,CACnB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,MAAc,EAAE,UAA6B;QAC9D,OAAO,IAAI,CAAC,aAAa,CACvB;;+BAEyB,EACzB;gCAC0B,EAC1B,EAAE,MAAM,EAAE,EACV,UAAU,CACX,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,MAAc,EAAE,UAA6B;QAC/D,OAAO,IAAI,CAAC,aAAa,CACvB;;+BAEyB,EACzB;gCAC0B,EAC1B,EAAE,MAAM,EAAE,EACV,UAAU,CACX,CAAC;IACJ,CAAC;CACF,CAAA;AAnDY,0BAA0B;IADtC,UAAU,EAAE;IAMR,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;qCAChB,iBAAiB;GANlB,0BAA0B,CAmDtC"}