@selfcommunity/api-services 0.1.6 → 0.1.7

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 (188) hide show
  1. package/lib/cjs/index.js +36 -0
  2. package/lib/cjs/services/category/index.js +168 -286
  3. package/lib/cjs/services/comment/index.js +107 -186
  4. package/lib/cjs/services/custom_adv/index.js +31 -51
  5. package/lib/cjs/services/custom_page/index.js +32 -52
  6. package/lib/cjs/services/data_portability/index.js +18 -43
  7. package/lib/cjs/services/embed/index.js +90 -151
  8. package/lib/cjs/services/feature/index.js +8 -16
  9. package/lib/cjs/services/feed/index.js +46 -81
  10. package/lib/cjs/services/feed_object/index.js +339 -505
  11. package/lib/cjs/services/incubator/index.js +64 -116
  12. package/lib/cjs/services/insight/index.js +51 -94
  13. package/lib/cjs/services/legal_page/index.js +60 -101
  14. package/lib/cjs/services/locality/index.js +14 -30
  15. package/lib/cjs/services/loyalty/index.js +92 -154
  16. package/lib/cjs/services/media/index.js +80 -122
  17. package/lib/cjs/services/moderation/index.js +65 -103
  18. package/lib/cjs/services/notification/index.js +67 -136
  19. package/lib/cjs/services/preference/index.js +25 -51
  20. package/lib/cjs/services/private_message/index.js +98 -177
  21. package/lib/cjs/services/score/index.js +22 -46
  22. package/lib/cjs/services/sso/index.js +17 -32
  23. package/lib/cjs/services/suggestion/index.js +23 -57
  24. package/lib/cjs/services/tag/index.js +72 -119
  25. package/lib/cjs/services/user/index.js +420 -767
  26. package/lib/cjs/services/webhook/index.js +4 -7
  27. package/lib/cjs/types/baseParams.js +3 -0
  28. package/lib/cjs/types/category.js +3 -0
  29. package/lib/cjs/types/comment.js +3 -0
  30. package/lib/cjs/types/customAdv.js +3 -0
  31. package/lib/cjs/types/customPage.js +3 -0
  32. package/lib/cjs/types/embed.js +3 -0
  33. package/lib/cjs/types/feed.js +3 -0
  34. package/lib/cjs/types/feedObject.js +3 -0
  35. package/lib/cjs/types/incubator.js +3 -0
  36. package/lib/cjs/types/index.js +91 -1
  37. package/lib/cjs/types/legalPage.js +3 -0
  38. package/lib/cjs/types/media.js +29 -0
  39. package/lib/cjs/types/moderation.js +3 -0
  40. package/lib/cjs/types/notification.js +3 -0
  41. package/lib/cjs/types/privateMessage.js +3 -0
  42. package/lib/cjs/types/prize.js +3 -0
  43. package/lib/cjs/types/sso.js +3 -0
  44. package/lib/cjs/types/tag.js +3 -0
  45. package/lib/cjs/types/user.js +3 -0
  46. package/lib/cjs/utils/apiRequest.js +2 -1
  47. package/lib/esm/index.js +36 -0
  48. package/lib/esm/services/category/index.js +168 -286
  49. package/lib/esm/services/comment/index.js +107 -186
  50. package/lib/esm/services/custom_adv/index.js +31 -51
  51. package/lib/esm/services/custom_page/index.js +32 -52
  52. package/lib/esm/services/data_portability/index.js +18 -43
  53. package/lib/esm/services/embed/index.js +90 -151
  54. package/lib/esm/services/feature/index.js +8 -16
  55. package/lib/esm/services/feed/index.js +46 -81
  56. package/lib/esm/services/feed_object/index.js +339 -505
  57. package/lib/esm/services/incubator/index.js +64 -116
  58. package/lib/esm/services/insight/index.js +51 -94
  59. package/lib/esm/services/legal_page/index.js +60 -101
  60. package/lib/esm/services/locality/index.js +14 -30
  61. package/lib/esm/services/loyalty/index.js +92 -154
  62. package/lib/esm/services/media/index.js +80 -122
  63. package/lib/esm/services/moderation/index.js +65 -103
  64. package/lib/esm/services/notification/index.js +67 -136
  65. package/lib/esm/services/preference/index.js +25 -51
  66. package/lib/esm/services/private_message/index.js +98 -177
  67. package/lib/esm/services/score/index.js +22 -46
  68. package/lib/esm/services/sso/index.js +17 -32
  69. package/lib/esm/services/suggestion/index.js +23 -57
  70. package/lib/esm/services/tag/index.js +72 -119
  71. package/lib/esm/services/user/index.js +420 -767
  72. package/lib/esm/services/webhook/index.js +4 -7
  73. package/lib/esm/types/baseParams.js +3 -0
  74. package/lib/esm/types/category.js +3 -0
  75. package/lib/esm/types/comment.js +3 -0
  76. package/lib/esm/types/customAdv.js +3 -0
  77. package/lib/esm/types/customPage.js +3 -0
  78. package/lib/esm/types/embed.js +3 -0
  79. package/lib/esm/types/feed.js +3 -0
  80. package/lib/esm/types/feedObject.js +3 -0
  81. package/lib/esm/types/incubator.js +3 -0
  82. package/lib/esm/types/index.js +91 -1
  83. package/lib/esm/types/legalPage.js +3 -0
  84. package/lib/esm/types/media.js +29 -0
  85. package/lib/esm/types/moderation.js +3 -0
  86. package/lib/esm/types/notification.js +3 -0
  87. package/lib/esm/types/privateMessage.js +3 -0
  88. package/lib/esm/types/prize.js +3 -0
  89. package/lib/esm/types/sso.js +3 -0
  90. package/lib/esm/types/tag.js +3 -0
  91. package/lib/esm/types/user.js +3 -0
  92. package/lib/esm/utils/apiRequest.js +2 -1
  93. package/lib/types/index.d.ts +2 -2
  94. package/lib/types/index.d.ts.map +1 -1
  95. package/lib/types/services/category/index.d.ts +114 -42
  96. package/lib/types/services/category/index.d.ts.map +1 -1
  97. package/lib/types/services/comment/index.d.ts +74 -23
  98. package/lib/types/services/comment/index.d.ts.map +1 -1
  99. package/lib/types/services/custom_adv/index.d.ts +26 -9
  100. package/lib/types/services/custom_adv/index.d.ts.map +1 -1
  101. package/lib/types/services/custom_page/index.d.ts +26 -9
  102. package/lib/types/services/custom_page/index.d.ts.map +1 -1
  103. package/lib/types/services/data_portability/index.d.ts +19 -6
  104. package/lib/types/services/data_portability/index.d.ts.map +1 -1
  105. package/lib/types/services/embed/index.d.ts +62 -24
  106. package/lib/types/services/embed/index.d.ts.map +1 -1
  107. package/lib/types/services/feature/index.d.ts +11 -3
  108. package/lib/types/services/feature/index.d.ts.map +1 -1
  109. package/lib/types/services/feed/index.d.ts +37 -15
  110. package/lib/types/services/feed/index.d.ts.map +1 -1
  111. package/lib/types/services/feed_object/index.d.ts +229 -81
  112. package/lib/types/services/feed_object/index.d.ts.map +1 -1
  113. package/lib/types/services/incubator/index.d.ts +51 -18
  114. package/lib/types/services/incubator/index.d.ts.map +1 -1
  115. package/lib/types/services/insight/index.d.ts +44 -18
  116. package/lib/types/services/insight/index.d.ts.map +1 -1
  117. package/lib/types/services/legal_page/index.d.ts +46 -18
  118. package/lib/types/services/legal_page/index.d.ts.map +1 -1
  119. package/lib/types/services/locality/index.d.ts +17 -6
  120. package/lib/types/services/locality/index.d.ts.map +1 -1
  121. package/lib/types/services/loyalty/index.d.ts +70 -27
  122. package/lib/types/services/loyalty/index.d.ts.map +1 -1
  123. package/lib/types/services/media/index.d.ts +55 -18
  124. package/lib/types/services/media/index.d.ts.map +1 -1
  125. package/lib/types/services/moderation/index.d.ts +51 -18
  126. package/lib/types/services/moderation/index.d.ts.map +1 -1
  127. package/lib/types/services/notification/index.d.ts +63 -27
  128. package/lib/types/services/notification/index.d.ts.map +1 -1
  129. package/lib/types/services/preference/index.d.ts +28 -9
  130. package/lib/types/services/preference/index.d.ts.map +1 -1
  131. package/lib/types/services/private_message/index.d.ts +68 -24
  132. package/lib/types/services/private_message/index.d.ts.map +1 -1
  133. package/lib/types/services/score/index.d.ts +24 -9
  134. package/lib/types/services/score/index.d.ts.map +1 -1
  135. package/lib/types/services/sso/index.d.ts +18 -6
  136. package/lib/types/services/sso/index.d.ts.map +1 -1
  137. package/lib/types/services/suggestion/index.d.ts +29 -12
  138. package/lib/types/services/suggestion/index.d.ts.map +1 -1
  139. package/lib/types/services/tag/index.d.ts +57 -21
  140. package/lib/types/services/tag/index.d.ts.map +1 -1
  141. package/lib/types/services/user/index.d.ts +313 -114
  142. package/lib/types/services/user/index.d.ts.map +1 -1
  143. package/lib/types/services/webhook/index.d.ts +3 -4
  144. package/lib/types/services/webhook/index.d.ts.map +1 -1
  145. package/lib/types/tsconfig.build.tsbuildinfo +1 -1
  146. package/lib/types/types/baseParams.d.ts +23 -0
  147. package/lib/types/types/baseParams.d.ts.map +1 -0
  148. package/lib/types/types/category.d.ts +15 -0
  149. package/lib/types/types/category.d.ts.map +1 -0
  150. package/lib/types/types/comment.d.ts +51 -0
  151. package/lib/types/types/comment.d.ts.map +1 -0
  152. package/lib/types/types/customAdv.d.ts +19 -0
  153. package/lib/types/types/customAdv.d.ts.map +1 -0
  154. package/lib/types/types/customPage.d.ts +24 -0
  155. package/lib/types/types/customPage.d.ts.map +1 -0
  156. package/lib/types/types/embed.d.ts +26 -0
  157. package/lib/types/types/embed.d.ts.map +1 -0
  158. package/lib/types/types/feed.d.ts +11 -0
  159. package/lib/types/types/feed.d.ts.map +1 -0
  160. package/lib/types/types/feedObject.d.ts +56 -0
  161. package/lib/types/types/feedObject.d.ts.map +1 -0
  162. package/lib/types/types/incubator.d.ts +33 -0
  163. package/lib/types/types/incubator.d.ts.map +1 -0
  164. package/lib/types/types/index.d.ts +19 -1
  165. package/lib/types/types/index.d.ts.map +1 -1
  166. package/lib/types/types/legalPage.d.ts +19 -0
  167. package/lib/types/types/legalPage.d.ts.map +1 -0
  168. package/lib/types/types/media.d.ts +80 -0
  169. package/lib/types/types/media.d.ts.map +1 -0
  170. package/lib/types/types/moderation.d.ts +23 -0
  171. package/lib/types/types/moderation.d.ts.map +1 -0
  172. package/lib/types/types/notification.d.ts +31 -0
  173. package/lib/types/types/notification.d.ts.map +1 -0
  174. package/lib/types/types/privateMessage.d.ts +176 -0
  175. package/lib/types/types/privateMessage.d.ts.map +1 -0
  176. package/lib/types/types/prize.d.ts +47 -0
  177. package/lib/types/types/prize.d.ts.map +1 -0
  178. package/lib/types/types/sso.d.ts +12 -0
  179. package/lib/types/types/sso.d.ts.map +1 -0
  180. package/lib/types/types/tag.d.ts +39 -0
  181. package/lib/types/types/tag.d.ts.map +1 -0
  182. package/lib/types/types/user.d.ts +105 -0
  183. package/lib/types/types/user.d.ts.map +1 -0
  184. package/lib/types/utils/apiRequest.d.ts +1 -1
  185. package/lib/types/utils/apiRequest.d.ts.map +1 -1
  186. package/lib/umd/api-services.js +1 -1
  187. package/lib/umd/api-services.js.map +1 -1
  188. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/legal_page/index.ts"],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AM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC;IAI/F;;;OAGG;IACH,MAAM,CAAC,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAIlE;;OAEG;IACH,MAAM,CAAC,WAAW,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;CAGpD;AAED,MAAM,CAAC,OAAO,OAAO,gBAAgB;WACtB,aAAa,CAAC,MAAM,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC;WAI5F,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;WAI1D,gBAAgB,CAAC,MAAM,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC;WAI/F,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC;WAIxF,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;WAI3D,WAAW,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;CAG1D"}
@@ -1,13 +1,24 @@
1
+ import { SCPaginatedResponse } from '../../types';
2
+ import { SCLocalityType } from '@selfcommunity/types';
1
3
  export interface LocalityApiClientInterface {
2
- getLocalities(): Promise<any>;
3
- searchLocalities(): Promise<any>;
4
+ getLocalities(): Promise<SCPaginatedResponse<SCLocalityType>>;
5
+ searchLocalities(): Promise<SCPaginatedResponse<SCLocalityType>>;
4
6
  }
7
+ /**
8
+ * Contains all the endpoints needed to manage localities.
9
+ */
5
10
  export declare class LocalityApiClient {
6
- static getLocalities(): Promise<any>;
7
- static searchLocalities(): Promise<any>;
11
+ /**
12
+ * This endpoint retrieves the list of available localities.
13
+ */
14
+ static getLocalities(): Promise<SCPaginatedResponse<SCLocalityType>>;
15
+ /**
16
+ * This endpoint searches localities
17
+ */
18
+ static searchLocalities(): Promise<SCPaginatedResponse<SCLocalityType>>;
8
19
  }
9
20
  export default class LocalityService {
10
- static getLocalities(): Promise<any>;
11
- static searchLocalities(): Promise<any>;
21
+ static getLocalities(): Promise<SCPaginatedResponse<SCLocalityType>>;
22
+ static searchLocalities(): Promise<SCPaginatedResponse<SCLocalityType>>;
12
23
  }
13
24
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/locality/index.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,0BAA0B;IACzC,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IAC9B,gBAAgB,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;CAClC;AAED,qBAAa,iBAAiB;IAC5B,MAAM,CAAC,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC;IAmBpC,MAAM,CAAC,gBAAgB,IAAI,OAAO,CAAC,GAAG,CAAC;CAkBxC;AAED,MAAM,CAAC,OAAO,OAAO,eAAe;WACrB,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC;WAG7B,gBAAgB,IAAI,OAAO,CAAC,GAAG,CAAC;CAG9C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/locality/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,mBAAmB,EAAC,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAC;AAEpD,MAAM,WAAW,0BAA0B;IACzC,aAAa,IAAI,OAAO,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC,CAAC;IAC9D,gBAAgB,IAAI,OAAO,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC,CAAC;CAClE;AACD;;GAEG;AAEH,qBAAa,iBAAiB;IAC5B;;OAEG;IACH,MAAM,CAAC,aAAa,IAAI,OAAO,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;IAIpE;;OAEG;IACH,MAAM,CAAC,gBAAgB,IAAI,OAAO,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;CAGxE;AAED,MAAM,CAAC,OAAO,OAAO,eAAe;WACrB,aAAa,IAAI,OAAO,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;WAG7D,gBAAgB,IAAI,OAAO,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;CAG9E"}
@@ -1,34 +1,77 @@
1
+ import { SCPrizeType, SCPrizeUserStatusType, SCPrizeUserType } from '@selfcommunity/types';
2
+ import { SCPaginatedResponse, LoyaltyPrizeParams } from '../../types';
1
3
  export interface LoyaltyApiClientInterface {
2
- getPrizes(): Promise<any>;
3
- createPrize(): Promise<any>;
4
- getSpecificPrize(id: number): Promise<any>;
5
- updatePrize(id: number): Promise<any>;
6
- patchPrize(id: number): Promise<any>;
7
- getPrizeRequests(): Promise<any>;
8
- createPrizeRequest(): Promise<any>;
9
- getSpecificPrizeRequest(id: number): Promise<any>;
10
- patchPrizeRequest(id: number): Promise<any>;
4
+ getPrizes(): Promise<SCPaginatedResponse<SCPrizeType>>;
5
+ createPrize(data: LoyaltyPrizeParams): Promise<SCPrizeType>;
6
+ getSpecificPrize(id: number): Promise<SCPrizeType>;
7
+ updatePrize(id: number, data?: LoyaltyPrizeParams): Promise<SCPrizeType>;
8
+ patchPrize(id: number, data?: LoyaltyPrizeParams): Promise<SCPrizeType>;
9
+ getAllPrizeRequests(): Promise<SCPaginatedResponse<SCPrizeUserType>>;
10
+ createPrizeRequest(prize: number): Promise<SCPrizeUserType>;
11
+ getSpecificPrizeRequest(id: number): Promise<SCPrizeUserType>;
12
+ patchPrizeRequest(id: number, status?: SCPrizeUserStatusType): Promise<SCPrizeUserType>;
11
13
  }
14
+ /**
15
+ * Contains all the endpoints needed to manage loyalty program.
16
+ */
12
17
  export declare class LoyaltyApiClient {
13
- static getPrizes(): Promise<any>;
14
- static createPrize(): Promise<any>;
15
- static getSpecificPrize(id: number): Promise<any>;
16
- static updatePrize(id: number): Promise<any>;
17
- static patchPrize(id: number): Promise<any>;
18
- static getPrizeRequests(): Promise<any>;
19
- static createPrizeRequest(): Promise<any>;
20
- static getSpecificPrizeRequest(id: number): Promise<any>;
21
- static patchPrizeRequest(id: number): Promise<any>;
18
+ /**
19
+ * This endpoint retrieves all prizes.
20
+ */
21
+ static getPrizes(): Promise<SCPaginatedResponse<SCPrizeType>>;
22
+ /**
23
+ * This endpoint creates a prize.
24
+ * @param data
25
+ */
26
+ static createPrize(data: LoyaltyPrizeParams): Promise<SCPrizeType>;
27
+ /**
28
+ * This endpoint retrieves a specific prize
29
+ * @param id
30
+ */
31
+ static getSpecificPrize(id: number): Promise<SCPrizeType>;
32
+ /**
33
+ * This endpoint updates a specific prize.
34
+ * @param id
35
+ * @param data
36
+ */
37
+ static updatePrize(id: number, data?: LoyaltyPrizeParams): Promise<SCPrizeType>;
38
+ /**
39
+ * This endpoint patches a specific prize.
40
+ * @param id
41
+ * @param data
42
+ */
43
+ static patchPrize(id: number, data?: LoyaltyPrizeParams): Promise<SCPrizeType>;
44
+ /**
45
+ * This endpoint retrieves all requests of loyalty prizes.
46
+ */
47
+ static getAllPrizeRequests(): Promise<SCPaginatedResponse<SCPrizeUserType>>;
48
+ /**
49
+ * This endpoint creates a request for a loyalty prize
50
+ * @param prize
51
+ */
52
+ static createPrizeRequest(prize: number): Promise<SCPrizeUserType>;
53
+ /**
54
+ * This endpoint retrieves a specific request for a loyalty prize.
55
+ * @param id
56
+ */
57
+ static getSpecificPrizeRequest(id: number): Promise<SCPrizeUserType>;
58
+ /**
59
+ * This endpoint patches a specific request for a loyalty prize.
60
+ * You can use this endpoint to to change status in an admin list/table interface.
61
+ * @param id
62
+ * @param status
63
+ */
64
+ static patchPrizeRequest(id: number, status?: SCPrizeUserStatusType): Promise<SCPrizeUserType>;
22
65
  }
23
66
  export default class LoyaltyService {
24
- static getPrizes(): Promise<any>;
25
- static createPrize(): Promise<any>;
26
- static getSpecificPrize(id: number): Promise<any>;
27
- static updatePrize(id: number): Promise<any>;
28
- static patchPrize(id: number): Promise<any>;
29
- static getPrizeRequests(): Promise<any>;
30
- static createPrizeRequest(): Promise<any>;
31
- static getSpecificPrizeRequest(id: number): Promise<any>;
32
- static patchPrizeRequest(id: number): Promise<any>;
67
+ static getPrizes(): Promise<SCPaginatedResponse<SCPrizeType>>;
68
+ static createPrize(data: LoyaltyPrizeParams): Promise<SCPrizeType>;
69
+ static getSpecificPrize(id: number): Promise<SCPrizeType>;
70
+ static updatePrize(id: number, data?: LoyaltyPrizeParams): Promise<SCPrizeType>;
71
+ static patchPrize(id: number, data?: LoyaltyPrizeParams): Promise<SCPrizeType>;
72
+ static getAllPrizeRequests(): Promise<SCPaginatedResponse<SCPrizeUserType>>;
73
+ static createPrizeRequest(prize: number): Promise<SCPrizeUserType>;
74
+ static getSpecificPrizeRequest(id: number): Promise<SCPrizeUserType>;
75
+ static patchPrizeRequest(id: number, status?: SCPrizeUserStatusType): Promise<SCPrizeUserType>;
33
76
  }
34
77
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/loyalty/index.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,yBAAyB;IACxC,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IAC1B,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5B,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAC3C,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACrC,gBAAgB,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IACjC,kBAAkB,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E,IAAI,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC;WAIxE,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC;WAIvE,mBAAmB,IAAI,OAAO,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC;WAIpE,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;WAI3D,uBAAuB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;WAG7D,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC;CAGrG"}
@@ -1,28 +1,65 @@
1
+ import { SCChunkMediaType, SCMediaType } from '@selfcommunity/types';
2
+ import { ChunkUploadCompleteParams, ChunkUploadParams, MediaCreateParams } from '../../types';
1
3
  export interface MediaApiClientInterface {
2
- chunkUploadMedia(): Promise<any>;
3
- chunkUploadMediaComplete(): Promise<any>;
4
- createMedia(): Promise<any>;
5
- clickMedia(id: number): Promise<any>;
6
- getSpecificMedia(id: number): Promise<any>;
7
- updateMedia(id: number): Promise<any>;
4
+ chunkUploadMedia(data: ChunkUploadParams): Promise<SCChunkMediaType>;
5
+ chunkUploadMediaComplete(data: ChunkUploadCompleteParams): Promise<SCMediaType>;
6
+ createMedia(data: MediaCreateParams): Promise<SCMediaType>;
7
+ clickMedia(id: number, ip?: string): Promise<any>;
8
+ getSpecificMedia(id: number): Promise<SCMediaType>;
9
+ updateMedia(id: number, image: string): Promise<SCMediaType>;
8
10
  deleteMedia(id: number): Promise<any>;
9
11
  }
12
+ /**
13
+ * Contains all the endpoints needed to manage medias.
14
+ */
10
15
  export declare class MediaApiClient {
11
- static chunkUploadMedia(): Promise<any>;
12
- static chunkUploadMediaComplete(): Promise<any>;
13
- static createMedia(): Promise<any>;
14
- static clickMedia(id: number): Promise<any>;
15
- static getSpecificMedia(id: number): Promise<any>;
16
- static updateMedia(id: number): Promise<any>;
16
+ /**
17
+ * This endpoint performs the chunk upload of a media with type image or document.
18
+ * The client must split the file into chunks and send to the server in series. After all the chunks have been uploaded the client must call the Chunk Upload Complete endpoint with the given upload_id parameter to finalize the upload and retrieve the Media.
19
+ * To perform chunk upload the request must contain Content-Range header with the information about the chunk.
20
+ * @param data
21
+ */
22
+ static chunkUploadMedia(data: ChunkUploadParams): Promise<SCChunkMediaType>;
23
+ /**
24
+ * This endpoint completes the chunk upload and create the media.
25
+ * @param data
26
+ */
27
+ static chunkUploadMediaComplete(data: ChunkUploadCompleteParams): Promise<SCMediaType>;
28
+ /**
29
+ * This endpoint creates a media.
30
+ * @param data
31
+ */
32
+ static createMedia(data: MediaCreateParams): Promise<SCMediaType>;
33
+ /**
34
+ * This endpoint saves a click on a specific media using ID.
35
+ * @param id
36
+ * @param ip
37
+ */
38
+ static clickMedia(id: number, ip?: string): Promise<any>;
39
+ /**
40
+ * This endpoint retrieves a specific media using ID.
41
+ * @param id
42
+ */
43
+ static getSpecificMedia(id: number): Promise<SCMediaType>;
44
+ /**
45
+ * This endpoint updates a media.
46
+ * @param id
47
+ * @param image
48
+ */
49
+ static updateMedia(id: number, image: string): Promise<SCMediaType>;
50
+ /**
51
+ * This endpoint deletes a media.
52
+ * @param id
53
+ */
17
54
  static deleteMedia(id: number): Promise<any>;
18
55
  }
19
56
  export default class MediaService {
20
- static chunkUploadMedia(): Promise<any>;
21
- static chunkUploadMediaComplete(): Promise<any>;
22
- static createMedia(): Promise<any>;
23
- static clickMedia(id: number): Promise<any>;
24
- static getSpecificMedia(id: number): Promise<any>;
25
- static updateMedia(id: number): Promise<any>;
57
+ static chunkUploadMedia(data: ChunkUploadParams): Promise<SCChunkMediaType>;
58
+ static chunkUploadMediaComplete(data: ChunkUploadCompleteParams): Promise<SCMediaType>;
59
+ static createMedia(data: MediaCreateParams): Promise<SCMediaType>;
60
+ static clickMedia(id: number, ip?: string): Promise<any>;
61
+ static getSpecificMedia(id: number): Promise<SCMediaType>;
62
+ static updateMedia(id: number, image: string): Promise<SCMediaType>;
26
63
  static deleteMedia(id: number): Promise<any>;
27
64
  }
28
65
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/media/index.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,uBAAuB;IACtC,gBAAgB,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IACjC,wBAAwB,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IACzC,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5B,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACrC,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAC3C,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CACvC;AAED,qBAAa,cAAc;IACzB,MAAM,CAAC,gBAAgB,IAAI,OAAO,CAAC,GAAG,CAAC;IAmBvC,MAAM,CAAC,wBAAwB,IAAI,OAAO,CAAC,GAAG,CAAC;IAmB/C,MAAM,CAAC,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC;IAmBlC,MAAM,CAAC,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAmB3C,MAAM,CAAC,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAmBjD,MAAM,CAAC,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAmB5C,MAAM,CAAC,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,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CAAC;WAIlD,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;WAI5D,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;CAGnD"}
@@ -1,25 +1,58 @@
1
+ import { SCUserModerationType, SCUserStatus, SCFlaggedContributionType, SCFlagType, SCFlagTypeEnum, SCContributionType } from '@selfcommunity/types';
2
+ import { ModerateContributionParams, SCPaginatedResponse } from '../../types';
3
+ import { SCContributionStatus } from '@selfcommunity/types';
1
4
  export interface ModerationApiClientInterface {
2
- getUsersForModeration(): Promise<any>;
3
- moderateASpecificUser(id: number): Promise<any>;
4
- getAllFlaggedContributions(): Promise<any>;
5
- getSpecificContributionFlag(id: number, contribution_type: string): Promise<any>;
6
- moderateAContribution(id: number): Promise<any>;
7
- getContributionModerationStatus(id: number, contribution_type: string): Promise<any>;
5
+ getUsersForModeration(): Promise<SCPaginatedResponse<SCUserModerationType>>;
6
+ moderateASpecificUser(id: number, status: SCUserStatus): Promise<any>;
7
+ getAllFlaggedContributions(): Promise<SCPaginatedResponse<SCFlaggedContributionType>>;
8
+ getAllFlagsForSpecificContribution(id: number, contribution_type: SCContributionType, flag_type?: SCFlagTypeEnum): Promise<SCPaginatedResponse<SCFlagType>>;
9
+ moderateAContribution(id: number, data: ModerateContributionParams): Promise<any>;
10
+ getContributionModerationStatus(id: number, contribution_type: SCContributionType): Promise<SCContributionStatus>;
8
11
  }
12
+ /**
13
+ * Contains all the endpoints needed to manage moderation.
14
+ */
9
15
  export declare class ModerationApiClient {
10
- static getUsersForModeration(): Promise<any>;
11
- static moderateASpecificUser(id: number): Promise<any>;
12
- static getAllFlaggedContributions(): Promise<any>;
13
- static getSpecificContributionFlag(id: number, contribution_type: string): Promise<any>;
14
- static moderateAContribution(id: number): Promise<any>;
15
- static getContributionModerationStatus(id: number, contribution_type: string): Promise<any>;
16
+ /**
17
+ * This endpoint retrieves all users for moderation purpose.
18
+ */
19
+ static getUsersForModeration(): Promise<SCPaginatedResponse<SCUserModerationType>>;
20
+ /**
21
+ * This endpoint performs users moderation.
22
+ * @param id
23
+ * @param status
24
+ */
25
+ static moderateASpecificUser(id: number, status: SCUserStatus): Promise<any>;
26
+ /**
27
+ * This endpoint retrieves all flagged contributions.
28
+ */
29
+ static getAllFlaggedContributions(): Promise<SCPaginatedResponse<SCFlaggedContributionType>>;
30
+ /**
31
+ * This endpoint retrieves all flags for a specific contribution.
32
+ * @param id
33
+ * @param contribution_type
34
+ * @param flag_type
35
+ */
36
+ static getAllFlagsForSpecificContribution(id: number, contribution_type: SCContributionType, flag_type?: SCFlagTypeEnum): Promise<SCPaginatedResponse<SCFlagType>>;
37
+ /**
38
+ * This endpoint provides actions for flagged contributions moderation.
39
+ * @param id
40
+ * @param data
41
+ */
42
+ static moderateAContribution(id: number, data: ModerateContributionParams): Promise<any>;
43
+ /**
44
+ * This endpoint retrieves moderation status for a specific contribution.
45
+ * @param id
46
+ * @param contribution_type
47
+ */
48
+ static getContributionModerationStatus(id: number, contribution_type: SCContributionType): Promise<SCContributionStatus>;
16
49
  }
17
50
  export default class ModerationService {
18
- static getUsersForModeration(): Promise<any>;
19
- static moderateASpecificUser(id: number): Promise<any>;
20
- static getAllFlaggedContributions(): Promise<any>;
21
- static getSpecificContributionFlag(id: number, contribution_type: string): Promise<any>;
22
- static moderateAContribution(id: number): Promise<any>;
23
- static getContributionModerationStatus(id: number, contribution_type: string): Promise<any>;
51
+ static getUsersForModeration(): Promise<SCPaginatedResponse<SCUserModerationType>>;
52
+ static moderateASpecificUser(id: number, status: SCUserStatus): Promise<any>;
53
+ static getAllFlaggedContributions(): Promise<SCPaginatedResponse<SCFlaggedContributionType>>;
54
+ static getAllFlagsForSpecificContribution(id: number, contribution_type: SCContributionType, flag_type?: SCFlagTypeEnum): Promise<SCPaginatedResponse<SCFlagType>>;
55
+ static moderateAContribution(id: number, data: ModerateContributionParams): Promise<any>;
56
+ static getContributionModerationStatus(id: number, contribution_type: SCContributionType): Promise<SCContributionStatus>;
24
57
  }
25
58
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/moderation/index.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,4BAA4B;IAC3C,qBAAqB,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,qBAAqB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAChD,0BAA0B,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IAC3C,2BAA2B,CAAC,EAAE,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACjF,qBAAqB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAChD,+BAA+B,CAAC,EAAE,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CACtF;AAED,qBAAa,mBAAmB;IAC9B,MAAM,CAAC,qBAAqB,IAAI,OAAO,CAAC,GAAG,CAAC;IAkB5C,MAAM,CAAC,qBAAqB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAmBtD,MAAM,CAAC,0BAA0B,IAAI,OAAO,CAAC,GAAG,CAAC;IAmBjD,MAAM,CAAC,2BAA2B,CAAC,EAAE,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAmBvF,MAAM,CAAC,qBAAqB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAmBtD,MAAM,CAAC,+BAA+B,CAAC,EAAE,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;CAkB5F;AAED,MAAM,CAAC,OAAO,OAAO,iBAAiB;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AAM,EACV,iBAAiB,EAAE,kBAAkB,EACrC,SAAS,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC;WAG9B,qBAAqB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,0BAA0B,GAAG,OAAO,CAAC,GAAG,CAAC;WAGjF,+BAA+B,CAAC,EAAE,EAAE,MAAM,EAAE,iBAAiB,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAG/H"}
@@ -1,34 +1,70 @@
1
+ import { SCBroadcastMessageType, SCNotificationAggregatedType, SCNotificationUnseenCountType } from '@selfcommunity/types';
2
+ import { CustomNotificationParams, SCPaginatedResponse } from '../../types';
1
3
  export interface NotificationApiClientInterface {
2
- listUserNotification(): Promise<any>;
3
- markReadNotification(): Promise<any>;
4
- getUnseenNotification(): Promise<any>;
5
- createCustomNotification(): Promise<any>;
6
- listBroadcastMessages(): Promise<any>;
7
- listBroadcastMessagesUnseenCount(): Promise<any>;
8
- listBroadcastMessagesUndisposedCount(): Promise<any>;
9
- markReadBroadcastMessages(): Promise<any>;
10
- disposeBroadcastMessages(): Promise<any>;
4
+ listUserNotification(): Promise<SCNotificationAggregatedType>;
5
+ markReadNotification(sids: string[]): Promise<any>;
6
+ getUnseenNotification(): Promise<SCNotificationUnseenCountType>;
7
+ createCustomNotification(data: CustomNotificationParams): Promise<any>;
8
+ listBroadcastMessages(): Promise<SCPaginatedResponse<SCBroadcastMessageType>>;
9
+ listBroadcastMessagesUnseenCount(): Promise<SCNotificationUnseenCountType>;
10
+ listBroadcastMessagesUndisposedCount(): Promise<SCNotificationUnseenCountType>;
11
+ markReadBroadcastMessages(banner_ids: number[]): Promise<any>;
12
+ disposeBroadcastMessages(banner_ids: number[]): Promise<any>;
11
13
  }
14
+ /**
15
+ * Contains all the endpoints needed to manage notifications.
16
+ */
12
17
  export declare class NotificationApiClient {
13
- static listUserNotification(): Promise<any>;
14
- static markReadNotification(): Promise<any>;
15
- static getUnseenNotification(): Promise<any>;
16
- static createCustomNotification(): Promise<any>;
17
- static listBroadcastMessages(): Promise<any>;
18
- static listBroadcastMessagesUnseenCount(): Promise<any>;
19
- static listBroadcastMessagesUndisposedCount(): Promise<any>;
20
- static markReadBroadcastMessages(): Promise<any>;
21
- static disposeBroadcastMessages(): Promise<any>;
18
+ /**
19
+ * List all user notifications (in aggregate form) related to the community.
20
+ */
21
+ static listUserNotification(): Promise<SCNotificationAggregatedType>;
22
+ /**
23
+ * This endpoint marks as read a list of notifications identified by serialization_ids (sids).
24
+ * @param sids
25
+ */
26
+ static markReadNotification(sids: string[]): Promise<any>;
27
+ /**
28
+ * This endpoint retrieves the number of unseen/unread notifications.
29
+ */
30
+ static getUnseenNotification(): Promise<SCNotificationUnseenCountType>;
31
+ /**
32
+ * This endpoint generates a custom notification starting from the user. The recipients of the notification can be the user's friends/followers or the user himself (based on recipients_type value). Es. connections -> "user" added an item to the wishlist.
33
+ * @param data
34
+ */
35
+ static createCustomNotification(data: CustomNotificationParams): Promise<any>;
36
+ /**
37
+ * This endpoint lists all broadcast messages. Broadcast Message is a feature which allows a specific user to send messages and announcements to a larger group of users at once.
38
+ */
39
+ static listBroadcastMessages(): Promise<SCPaginatedResponse<SCBroadcastMessageType>>;
40
+ /**
41
+ * This endpoint retrieves the total number of broadcast messages not yet seen by the user.
42
+ */
43
+ static listBroadcastMessagesUnseenCount(): Promise<SCNotificationUnseenCountType>;
44
+ /**
45
+ * This endpoint retrieves the total number of broadcast messages not yet disposed by the user.
46
+ */
47
+ static listBroadcastMessagesUndisposedCount(): Promise<SCNotificationUnseenCountType>;
48
+ /**
49
+ * This endpoint marks as viewed/read a broadcast message for a user.
50
+ * @param banner_ids
51
+ */
52
+ static markReadBroadcastMessages(banner_ids: number[]): Promise<any>;
53
+ /**
54
+ * This endpoint disposes a broadcast message for a user.
55
+ * @param banner_ids
56
+ */
57
+ static disposeBroadcastMessages(banner_ids: number[]): Promise<any>;
22
58
  }
23
59
  export default class NotificationService {
24
- static listUserNotification(): Promise<any>;
25
- static markReadNotification(): Promise<any>;
26
- static getUnseenNotification(): Promise<any>;
27
- static createCustomNotification(): Promise<any>;
28
- static listBroadcastMessages(): Promise<any>;
29
- static listBroadcastMessagesUnseenCount(): Promise<any>;
30
- static listBroadcastMessagesUndisposedCount(): Promise<any>;
31
- static disposeBroadcastMessages(): Promise<any>;
32
- static markReadBroadcastMessages(): Promise<any>;
60
+ static listUserNotification(): Promise<SCNotificationAggregatedType>;
61
+ static markReadNotification(sids: string[]): Promise<any>;
62
+ static getUnseenNotification(): Promise<SCNotificationUnseenCountType>;
63
+ static createCustomNotification(data: CustomNotificationParams): Promise<any>;
64
+ static listBroadcastMessages(): Promise<SCPaginatedResponse<SCBroadcastMessageType>>;
65
+ static listBroadcastMessagesUnseenCount(): Promise<SCNotificationUnseenCountType>;
66
+ static listBroadcastMessagesUndisposedCount(): Promise<SCNotificationUnseenCountType>;
67
+ static disposeBroadcastMessages(banner_ids: number[]): Promise<any>;
68
+ static markReadBroadcastMessages(banner_ids: number[]): Promise<any>;
33
69
  }
34
70
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/notification/index.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,8BAA8B;IAC7C,oBAAoB,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IACrC,oBAAoB,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IACrC,qBAAqB,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,wBAAwB,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IACzC,qBAAqB,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,gCAAgC,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IACjD,oCAAoC,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IACrD,yBAAyB,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;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,6BAA6B,CAAC;IAIjF;;OAEG;IACH,MAAM,CAAC,oCAAoC,IAAI,OAAO,CAAC,6BAA6B,CAAC;IAIrF;;;OAGG;IACH,MAAM,CAAC,yBAAyB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IAIpE;;;OAGG;IACH,MAAM,CAAC,wBAAwB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;CAGpE;AAED,MAAM,CAAC,OAAO,OAAO,mBAAmB;WACzB,oBAAoB,IAAI,OAAO,CAAC,4BAA4B,CAAC;WAG7D,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;WAGlD,qBAAqB,IAAI,OAAO,CAAC,6BAA6B,CAAC;WAG/D,wBAAwB,CAAC,IAAI,EAAE,wBAAwB,GAAG,OAAO,CAAC,GAAG,CAAC;WAGtE,qBAAqB,IAAI,OAAO,CAAC,mBAAmB,CAAC,sBAAsB,CAAC,CAAC;WAG7E,gCAAgC,IAAI,OAAO,CAAC,6BAA6B,CAAC;WAG1E,oCAAoC,IAAI,OAAO,CAAC,6BAA6B,CAAC;WAG9E,wBAAwB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;WAG5D,yBAAyB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;CAG3E"}
@@ -1,16 +1,35 @@
1
+ import { SCPreferenceType } from '@selfcommunity/types/src/types';
2
+ import { SCPaginatedResponse } from '../../types';
1
3
  export interface PreferenceApiClientInterface {
2
- getAllPreferences(): Promise<any>;
3
- searchPreferences(search?: string, section?: string, keys?: string, ordering?: string): Promise<any>;
4
- getSpecificPreference(id: number): Promise<any>;
4
+ getAllPreferences(): Promise<SCPaginatedResponse<SCPreferenceType[]>>;
5
+ searchPreferences(search?: string, section?: string, keys?: string, ordering?: string): Promise<SCPaginatedResponse<SCPreferenceType[]>>;
6
+ getSpecificPreference(id: number): Promise<SCPreferenceType>;
5
7
  }
8
+ /**
9
+ * Contains all the endpoints needed to manage dynamic preferences.
10
+ */
6
11
  export declare class PreferenceApiClient {
7
- static getAllPreferences(): Promise<any>;
8
- static searchPreferences(search?: string, section?: string, keys?: string, ordering?: string): Promise<any>;
9
- static getSpecificPreference(id: number): Promise<any>;
12
+ /**
13
+ * This endpoint retrieves all available dynamic preferences.
14
+ */
15
+ static getAllPreferences(): Promise<SCPaginatedResponse<SCPreferenceType[]>>;
16
+ /**
17
+ * This endpoint searches dynamic preferences.
18
+ * @param search
19
+ * @param section
20
+ * @param keys
21
+ * @param ordering
22
+ */
23
+ static searchPreferences(search?: string, section?: string, keys?: string, ordering?: string): Promise<SCPaginatedResponse<SCPreferenceType[]>>;
24
+ /**
25
+ * This endpoint retrieves a specific dynamic preference.
26
+ * @param id
27
+ */
28
+ static getSpecificPreference(id: number): Promise<SCPreferenceType>;
10
29
  }
11
30
  export default class PreferenceService {
12
- static getAllPreferences(): Promise<any>;
13
- static searchPreferences(search?: string, section?: string, keys?: string, ordering?: string): Promise<any>;
14
- static getSpecificPreference(id: number): Promise<any>;
31
+ static getAllPreferences(): Promise<SCPaginatedResponse<SCPreferenceType[]>>;
32
+ static searchPreferences(search?: string, section?: string, keys?: string, ordering?: string): Promise<SCPaginatedResponse<SCPreferenceType[]>>;
33
+ static getSpecificPreference(id: number): Promise<SCPreferenceType>;
15
34
  }
16
35
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/preference/index.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,4BAA4B;IAC3C,iBAAiB,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IAClC,iBAAiB,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAA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