@selfcommunity/api-services 0.1.28-alpha.3 → 0.1.28

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 (211) hide show
  1. package/lib/cjs/services/category/index.d.ts +76 -49
  2. package/lib/cjs/services/category/index.d.ts.map +1 -1
  3. package/lib/cjs/services/category/index.js +91 -65
  4. package/lib/cjs/services/category/index.js.map +1 -1
  5. package/lib/cjs/services/comment/index.d.ts +55 -34
  6. package/lib/cjs/services/comment/index.d.ts.map +1 -1
  7. package/lib/cjs/services/comment/index.js +65 -45
  8. package/lib/cjs/services/comment/index.js.map +1 -1
  9. package/lib/cjs/services/custom_adv/index.d.ts +23 -10
  10. package/lib/cjs/services/custom_adv/index.d.ts.map +1 -1
  11. package/lib/cjs/services/custom_adv/index.js +25 -13
  12. package/lib/cjs/services/custom_adv/index.js.map +1 -1
  13. package/lib/cjs/services/custom_page/index.d.ts +23 -10
  14. package/lib/cjs/services/custom_page/index.d.ts.map +1 -1
  15. package/lib/cjs/services/custom_page/index.js +25 -13
  16. package/lib/cjs/services/custom_page/index.js.map +1 -1
  17. package/lib/cjs/services/data_portability/index.d.ts +22 -9
  18. package/lib/cjs/services/data_portability/index.d.ts.map +1 -1
  19. package/lib/cjs/services/data_portability/index.js +24 -12
  20. package/lib/cjs/services/data_portability/index.js.map +1 -1
  21. package/lib/cjs/services/embed/index.d.ts +43 -25
  22. package/lib/cjs/services/embed/index.d.ts.map +1 -1
  23. package/lib/cjs/services/embed/index.js +50 -33
  24. package/lib/cjs/services/embed/index.js.map +1 -1
  25. package/lib/cjs/services/feature/index.d.ts +14 -3
  26. package/lib/cjs/services/feature/index.d.ts.map +1 -1
  27. package/lib/cjs/services/feature/index.js +14 -4
  28. package/lib/cjs/services/feature/index.js.map +1 -1
  29. package/lib/cjs/services/feed/index.d.ts +32 -17
  30. package/lib/cjs/services/feed/index.d.ts.map +1 -1
  31. package/lib/cjs/services/feed/index.js +36 -22
  32. package/lib/cjs/services/feed/index.js.map +1 -1
  33. package/lib/cjs/services/feed_object/index.d.ts +118 -81
  34. package/lib/cjs/services/feed_object/index.d.ts.map +1 -1
  35. package/lib/cjs/services/feed_object/index.js +143 -107
  36. package/lib/cjs/services/feed_object/index.js.map +1 -1
  37. package/lib/cjs/services/incubator/index.d.ts +39 -22
  38. package/lib/cjs/services/incubator/index.d.ts.map +1 -1
  39. package/lib/cjs/services/incubator/index.js +45 -29
  40. package/lib/cjs/services/incubator/index.js.map +1 -1
  41. package/lib/cjs/services/insight/index.d.ts +35 -19
  42. package/lib/cjs/services/insight/index.d.ts.map +1 -1
  43. package/lib/cjs/services/insight/index.js +40 -25
  44. package/lib/cjs/services/insight/index.js.map +1 -1
  45. package/lib/cjs/services/legal_page/index.d.ts +35 -19
  46. package/lib/cjs/services/legal_page/index.d.ts.map +1 -1
  47. package/lib/cjs/services/legal_page/index.js +40 -25
  48. package/lib/cjs/services/legal_page/index.js.map +1 -1
  49. package/lib/cjs/services/locality/index.d.ts +18 -6
  50. package/lib/cjs/services/locality/index.d.ts.map +1 -1
  51. package/lib/cjs/services/locality/index.js +19 -8
  52. package/lib/cjs/services/locality/index.js.map +1 -1
  53. package/lib/cjs/services/loyalty/index.d.ts +48 -29
  54. package/lib/cjs/services/loyalty/index.d.ts.map +1 -1
  55. package/lib/cjs/services/loyalty/index.js +56 -38
  56. package/lib/cjs/services/loyalty/index.js.map +1 -1
  57. package/lib/cjs/services/media/index.d.ts +42 -22
  58. package/lib/cjs/services/media/index.d.ts.map +1 -1
  59. package/lib/cjs/services/media/index.js +48 -29
  60. package/lib/cjs/services/media/index.js.map +1 -1
  61. package/lib/cjs/services/moderation/index.d.ts +33 -19
  62. package/lib/cjs/services/moderation/index.d.ts.map +1 -1
  63. package/lib/cjs/services/moderation/index.js +40 -27
  64. package/lib/cjs/services/moderation/index.js.map +1 -1
  65. package/lib/cjs/services/notification/index.d.ts +47 -28
  66. package/lib/cjs/services/notification/index.d.ts.map +1 -1
  67. package/lib/cjs/services/notification/index.js +55 -37
  68. package/lib/cjs/services/notification/index.js.map +1 -1
  69. package/lib/cjs/services/preference/index.d.ts +23 -10
  70. package/lib/cjs/services/preference/index.d.ts.map +1 -1
  71. package/lib/cjs/services/preference/index.js +25 -13
  72. package/lib/cjs/services/preference/index.js.map +1 -1
  73. package/lib/cjs/services/private_message/index.d.ts +51 -31
  74. package/lib/cjs/services/private_message/index.d.ts.map +1 -1
  75. package/lib/cjs/services/private_message/index.js +60 -41
  76. package/lib/cjs/services/private_message/index.js.map +1 -1
  77. package/lib/cjs/services/score/index.d.ts +22 -9
  78. package/lib/cjs/services/score/index.d.ts.map +1 -1
  79. package/lib/cjs/services/score/index.js +24 -12
  80. package/lib/cjs/services/score/index.js.map +1 -1
  81. package/lib/cjs/services/sso/index.d.ts +18 -6
  82. package/lib/cjs/services/sso/index.d.ts.map +1 -1
  83. package/lib/cjs/services/sso/index.js +19 -8
  84. package/lib/cjs/services/sso/index.js.map +1 -1
  85. package/lib/cjs/services/suggestion/index.d.ts +26 -12
  86. package/lib/cjs/services/suggestion/index.d.ts.map +1 -1
  87. package/lib/cjs/services/suggestion/index.js +29 -16
  88. package/lib/cjs/services/suggestion/index.js.map +1 -1
  89. package/lib/cjs/services/tag/index.d.ts +39 -22
  90. package/lib/cjs/services/tag/index.d.ts.map +1 -1
  91. package/lib/cjs/services/tag/index.js +45 -29
  92. package/lib/cjs/services/tag/index.js.map +1 -1
  93. package/lib/cjs/services/user/index.d.ts +204 -145
  94. package/lib/cjs/services/user/index.d.ts.map +1 -1
  95. package/lib/cjs/services/user/index.js +259 -201
  96. package/lib/cjs/services/user/index.js.map +1 -1
  97. package/lib/cjs/services/webhook/index.d.ts +59 -37
  98. package/lib/cjs/services/webhook/index.d.ts.map +1 -1
  99. package/lib/cjs/services/webhook/index.js +70 -49
  100. package/lib/cjs/services/webhook/index.js.map +1 -1
  101. package/lib/cjs/utils/apiRequest.d.ts +2 -1
  102. package/lib/cjs/utils/apiRequest.d.ts.map +1 -1
  103. package/lib/cjs/utils/apiRequest.js +4 -8
  104. package/lib/cjs/utils/apiRequest.js.map +1 -1
  105. package/lib/esm/services/category/index.d.ts +76 -49
  106. package/lib/esm/services/category/index.d.ts.map +1 -1
  107. package/lib/esm/services/category/index.js +91 -65
  108. package/lib/esm/services/category/index.js.map +1 -1
  109. package/lib/esm/services/comment/index.d.ts +55 -34
  110. package/lib/esm/services/comment/index.d.ts.map +1 -1
  111. package/lib/esm/services/comment/index.js +65 -45
  112. package/lib/esm/services/comment/index.js.map +1 -1
  113. package/lib/esm/services/custom_adv/index.d.ts +23 -10
  114. package/lib/esm/services/custom_adv/index.d.ts.map +1 -1
  115. package/lib/esm/services/custom_adv/index.js +25 -13
  116. package/lib/esm/services/custom_adv/index.js.map +1 -1
  117. package/lib/esm/services/custom_page/index.d.ts +23 -10
  118. package/lib/esm/services/custom_page/index.d.ts.map +1 -1
  119. package/lib/esm/services/custom_page/index.js +25 -13
  120. package/lib/esm/services/custom_page/index.js.map +1 -1
  121. package/lib/esm/services/data_portability/index.d.ts +22 -9
  122. package/lib/esm/services/data_portability/index.d.ts.map +1 -1
  123. package/lib/esm/services/data_portability/index.js +24 -12
  124. package/lib/esm/services/data_portability/index.js.map +1 -1
  125. package/lib/esm/services/embed/index.d.ts +43 -25
  126. package/lib/esm/services/embed/index.d.ts.map +1 -1
  127. package/lib/esm/services/embed/index.js +50 -33
  128. package/lib/esm/services/embed/index.js.map +1 -1
  129. package/lib/esm/services/feature/index.d.ts +14 -3
  130. package/lib/esm/services/feature/index.d.ts.map +1 -1
  131. package/lib/esm/services/feature/index.js +14 -4
  132. package/lib/esm/services/feature/index.js.map +1 -1
  133. package/lib/esm/services/feed/index.d.ts +32 -17
  134. package/lib/esm/services/feed/index.d.ts.map +1 -1
  135. package/lib/esm/services/feed/index.js +36 -22
  136. package/lib/esm/services/feed/index.js.map +1 -1
  137. package/lib/esm/services/feed_object/index.d.ts +118 -81
  138. package/lib/esm/services/feed_object/index.d.ts.map +1 -1
  139. package/lib/esm/services/feed_object/index.js +143 -107
  140. package/lib/esm/services/feed_object/index.js.map +1 -1
  141. package/lib/esm/services/incubator/index.d.ts +39 -22
  142. package/lib/esm/services/incubator/index.d.ts.map +1 -1
  143. package/lib/esm/services/incubator/index.js +45 -29
  144. package/lib/esm/services/incubator/index.js.map +1 -1
  145. package/lib/esm/services/insight/index.d.ts +35 -19
  146. package/lib/esm/services/insight/index.d.ts.map +1 -1
  147. package/lib/esm/services/insight/index.js +40 -25
  148. package/lib/esm/services/insight/index.js.map +1 -1
  149. package/lib/esm/services/legal_page/index.d.ts +35 -19
  150. package/lib/esm/services/legal_page/index.d.ts.map +1 -1
  151. package/lib/esm/services/legal_page/index.js +40 -25
  152. package/lib/esm/services/legal_page/index.js.map +1 -1
  153. package/lib/esm/services/locality/index.d.ts +18 -6
  154. package/lib/esm/services/locality/index.d.ts.map +1 -1
  155. package/lib/esm/services/locality/index.js +19 -8
  156. package/lib/esm/services/locality/index.js.map +1 -1
  157. package/lib/esm/services/loyalty/index.d.ts +48 -29
  158. package/lib/esm/services/loyalty/index.d.ts.map +1 -1
  159. package/lib/esm/services/loyalty/index.js +56 -38
  160. package/lib/esm/services/loyalty/index.js.map +1 -1
  161. package/lib/esm/services/media/index.d.ts +42 -22
  162. package/lib/esm/services/media/index.d.ts.map +1 -1
  163. package/lib/esm/services/media/index.js +48 -29
  164. package/lib/esm/services/media/index.js.map +1 -1
  165. package/lib/esm/services/moderation/index.d.ts +33 -19
  166. package/lib/esm/services/moderation/index.d.ts.map +1 -1
  167. package/lib/esm/services/moderation/index.js +40 -27
  168. package/lib/esm/services/moderation/index.js.map +1 -1
  169. package/lib/esm/services/notification/index.d.ts +47 -28
  170. package/lib/esm/services/notification/index.d.ts.map +1 -1
  171. package/lib/esm/services/notification/index.js +55 -37
  172. package/lib/esm/services/notification/index.js.map +1 -1
  173. package/lib/esm/services/preference/index.d.ts +23 -10
  174. package/lib/esm/services/preference/index.d.ts.map +1 -1
  175. package/lib/esm/services/preference/index.js +25 -13
  176. package/lib/esm/services/preference/index.js.map +1 -1
  177. package/lib/esm/services/private_message/index.d.ts +51 -31
  178. package/lib/esm/services/private_message/index.d.ts.map +1 -1
  179. package/lib/esm/services/private_message/index.js +60 -41
  180. package/lib/esm/services/private_message/index.js.map +1 -1
  181. package/lib/esm/services/score/index.d.ts +22 -9
  182. package/lib/esm/services/score/index.d.ts.map +1 -1
  183. package/lib/esm/services/score/index.js +24 -12
  184. package/lib/esm/services/score/index.js.map +1 -1
  185. package/lib/esm/services/sso/index.d.ts +18 -6
  186. package/lib/esm/services/sso/index.d.ts.map +1 -1
  187. package/lib/esm/services/sso/index.js +19 -8
  188. package/lib/esm/services/sso/index.js.map +1 -1
  189. package/lib/esm/services/suggestion/index.d.ts +26 -12
  190. package/lib/esm/services/suggestion/index.d.ts.map +1 -1
  191. package/lib/esm/services/suggestion/index.js +29 -16
  192. package/lib/esm/services/suggestion/index.js.map +1 -1
  193. package/lib/esm/services/tag/index.d.ts +39 -22
  194. package/lib/esm/services/tag/index.d.ts.map +1 -1
  195. package/lib/esm/services/tag/index.js +45 -29
  196. package/lib/esm/services/tag/index.js.map +1 -1
  197. package/lib/esm/services/user/index.d.ts +204 -145
  198. package/lib/esm/services/user/index.d.ts.map +1 -1
  199. package/lib/esm/services/user/index.js +259 -201
  200. package/lib/esm/services/user/index.js.map +1 -1
  201. package/lib/esm/services/webhook/index.d.ts +59 -37
  202. package/lib/esm/services/webhook/index.d.ts.map +1 -1
  203. package/lib/esm/services/webhook/index.js +70 -49
  204. package/lib/esm/services/webhook/index.js.map +1 -1
  205. package/lib/esm/utils/apiRequest.d.ts +2 -1
  206. package/lib/esm/utils/apiRequest.d.ts.map +1 -1
  207. package/lib/esm/utils/apiRequest.js +4 -8
  208. package/lib/esm/utils/apiRequest.js.map +1 -1
  209. package/lib/umd/api-services.js +1 -1
  210. package/lib/umd/api-services.js.map +1 -1
  211. package/package.json +4 -4
@@ -16,54 +16,58 @@ export class ModerationApiClient {
16
16
  /**
17
17
  * This endpoint retrieves all users for moderation purpose.
18
18
  */
19
- static getUsersForModeration() {
20
- return apiRequest(Endpoints.UsersForModeration.url({}), Endpoints.UsersForModeration.method);
19
+ static getUsersForModeration(config) {
20
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.UsersForModeration.url({}), method: Endpoints.UsersForModeration.method }));
21
21
  }
22
22
  /**
23
23
  * This endpoint performs users moderation.
24
24
  * @param id
25
25
  * @param status
26
+ * @param config
26
27
  */
27
- static moderateASpecificUser(id, status) {
28
- return apiRequest(Endpoints.ModerateUser.url({ id }), Endpoints.ModerateUser.method, { status: status });
28
+ static moderateASpecificUser(id, status, config) {
29
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.ModerateUser.url({ id }), method: Endpoints.ModerateUser.method, data: { status: status } }));
29
30
  }
30
31
  /**
31
32
  * This endpoint retrieves all flagged contributions.
32
33
  */
33
- static getAllFlaggedContributions() {
34
- return apiRequest(Endpoints.FlaggedContributions.url({}), Endpoints.FlaggedContributions.method);
34
+ static getAllFlaggedContributions(config) {
35
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.FlaggedContributions.url({}), method: Endpoints.FlaggedContributions.method }));
35
36
  }
36
37
  /**
37
38
  * This endpoint retrieves all flags for a specific contribution.
38
39
  * @param id
39
40
  * @param contribution_type
40
41
  * @param flag_type
42
+ * @param config
41
43
  */
42
- static getAllFlagsForSpecificContribution(id, contribution_type, flag_type) {
43
- return apiRequest(Endpoints.FlagsForSpecificContribution.url({ id, contribution_type }), Endpoints.FlagsForSpecificContribution.method, {
44
- flag_type: flag_type !== null && flag_type !== void 0 ? flag_type : null
45
- });
44
+ static getAllFlagsForSpecificContribution(id, contribution_type, flag_type, config) {
45
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.FlagsForSpecificContribution.url({ id, contribution_type }), method: Endpoints.FlagsForSpecificContribution.method, data: {
46
+ flag_type: flag_type !== null && flag_type !== void 0 ? flag_type : null
47
+ } }));
46
48
  }
47
49
  /**
48
50
  * This endpoint provides actions for flagged contributions moderation.
49
51
  * @param id
50
52
  * @param data
53
+ * @param config
51
54
  */
52
- static moderateAContribution(id, data) {
53
- return apiRequest(Endpoints.ModerateContribution.url({ id }), Endpoints.ModerateContribution.method, data);
55
+ static moderateAContribution(id, data, config) {
56
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.ModerateContribution.url({ id }), method: Endpoints.ModerateContribution.method, data: data }));
54
57
  }
55
58
  /**
56
59
  * This endpoint retrieves moderation status for a specific contribution.
57
60
  * @param id
58
61
  * @param contribution_type
62
+ * @param config
59
63
  */
60
- static getContributionModerationStatus(id, contribution_type) {
61
- return apiRequest(Endpoints.ModerateContributionStatus.url({ id, contribution_type }), Endpoints.ModerateContributionStatus.method);
64
+ static getContributionModerationStatus(id, contribution_type, config) {
65
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.ModerateContributionStatus.url({ id, contribution_type }), method: Endpoints.ModerateContributionStatus.method }));
62
66
  }
63
67
  }
64
68
  /**
65
69
  *
66
- :::tipModeration service can be used in the following ways:
70
+ :::tipModeration service can be used in the following way:
67
71
 
68
72
  ```jsx
69
73
  1. Import the service from our library:
@@ -85,37 +89,46 @@ export class ModerationApiClient {
85
89
  return await ModerationService.moderateASpecificUser(userId, userStatus);
86
90
  }
87
91
  ```
92
+ ```jsx
93
+ If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
94
+
95
+ 1. Declare it(or declare them, it is possible to add multiple params)
96
+
97
+ const headers = headers: {Authorization: `Bearer ${yourToken}`}
98
+
99
+ 2. Add it inside the brackets and pass it to the function, as shown in the previous example!
100
+ ```
88
101
  :::
89
102
  */
90
103
  export default class ModerationService {
91
- static getUsersForModeration() {
104
+ static getUsersForModeration(config) {
92
105
  return __awaiter(this, void 0, void 0, function* () {
93
- return ModerationApiClient.getUsersForModeration();
106
+ return ModerationApiClient.getUsersForModeration(config);
94
107
  });
95
108
  }
96
- static moderateASpecificUser(id, status) {
109
+ static moderateASpecificUser(id, status, config) {
97
110
  return __awaiter(this, void 0, void 0, function* () {
98
- return ModerationApiClient.moderateASpecificUser(id, status);
111
+ return ModerationApiClient.moderateASpecificUser(id, status, config);
99
112
  });
100
113
  }
101
- static getAllFlaggedContributions() {
114
+ static getAllFlaggedContributions(config) {
102
115
  return __awaiter(this, void 0, void 0, function* () {
103
- return ModerationApiClient.getAllFlaggedContributions();
116
+ return ModerationApiClient.getAllFlaggedContributions(config);
104
117
  });
105
118
  }
106
- static getAllFlagsForSpecificContribution(id, contribution_type, flag_type) {
119
+ static getAllFlagsForSpecificContribution(id, contribution_type, flag_type, config) {
107
120
  return __awaiter(this, void 0, void 0, function* () {
108
- return ModerationApiClient.getAllFlagsForSpecificContribution(id, contribution_type, flag_type);
121
+ return ModerationApiClient.getAllFlagsForSpecificContribution(id, contribution_type, flag_type, config);
109
122
  });
110
123
  }
111
- static moderateAContribution(id, data) {
124
+ static moderateAContribution(id, data, config) {
112
125
  return __awaiter(this, void 0, void 0, function* () {
113
- return ModerationApiClient.moderateAContribution(id, data);
126
+ return ModerationApiClient.moderateAContribution(id, data, config);
114
127
  });
115
128
  }
116
- static getContributionModerationStatus(id, contribution_type) {
129
+ static getContributionModerationStatus(id, contribution_type, config) {
117
130
  return __awaiter(this, void 0, void 0, function* () {
118
- return ModerationApiClient.getContributionModerationStatus(id, contribution_type);
131
+ return ModerationApiClient.getContributionModerationStatus(id, contribution_type, config);
119
132
  });
120
133
  }
121
134
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/services/moderation/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAClD,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAiBlD;;GAEG;AAEH,MAAM,OAAO,mBAAmB;IAC9B;;OAEG;IACH,MAAM,CAAC,qBAAqB;QAC1B,OA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CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QACrE,CAAC;KAAA;IACD,MAAM,CAAO,+BAA+B,CAC1C,EAAU,EACV,iBAAqC,EACrC,MAA2B;;YAE3B,OAAO,mBAAmB,CAAC,+BAA+B,CAAC,EAAE,EAAE,iBAAiB,EAAE,MAAM,CAAC,CAAC;QAC5F,CAAC;KAAA;CACF"}
@@ -1,15 +1,16 @@
1
1
  import { SCBroadcastMessageType, SCNotificationAggregatedType, SCNotificationUnseenCountType } from '@selfcommunity/types';
2
2
  import { CustomNotificationParams, SCPaginatedResponse } from '../../types';
3
+ import { AxiosRequestConfig } from 'axios';
3
4
  export interface NotificationApiClientInterface {
4
- listUserNotification(): Promise<SCPaginatedResponse<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>;
5
+ listUserNotification(config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCNotificationAggregatedType>>;
6
+ markReadNotification(sids: string[], config?: AxiosRequestConfig): Promise<any>;
7
+ getUnseenNotification(config?: AxiosRequestConfig): Promise<SCNotificationUnseenCountType>;
8
+ createCustomNotification(data: CustomNotificationParams, config?: AxiosRequestConfig): Promise<any>;
9
+ listBroadcastMessages(config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCBroadcastMessageType>>;
10
+ listBroadcastMessagesUnseenCount(config?: AxiosRequestConfig): Promise<SCNotificationUnseenCountType>;
11
+ listBroadcastMessagesUndisposedCount(config?: AxiosRequestConfig): Promise<SCNotificationUnseenCountType>;
12
+ markReadBroadcastMessages(banner_ids: number[], config?: AxiosRequestConfig): Promise<any>;
13
+ disposeBroadcastMessages(banner_ids: number[], config?: AxiosRequestConfig): Promise<any>;
13
14
  }
14
15
  /**
15
16
  * Contains all the endpoints needed to manage notifications.
@@ -17,48 +18,57 @@ export interface NotificationApiClientInterface {
17
18
  export declare class NotificationApiClient {
18
19
  /**
19
20
  * List all user notifications (in aggregate form) related to the community.
21
+ * @param config
20
22
  */
21
- static listUserNotification(): Promise<SCPaginatedResponse<SCNotificationAggregatedType>>;
23
+ static listUserNotification(config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCNotificationAggregatedType>>;
22
24
  /**
23
25
  * This endpoint marks as read a list of notifications identified by serialization_ids (sids).
24
26
  * @param sids
27
+ * @param config
25
28
  */
26
- static markReadNotification(sids: string[]): Promise<any>;
29
+ static markReadNotification(sids: string[], config?: AxiosRequestConfig): Promise<any>;
27
30
  /**
28
31
  * This endpoint retrieves the number of unseen/unread notifications.
32
+ * @param config
29
33
  */
30
- static getUnseenNotification(): Promise<SCNotificationUnseenCountType>;
34
+ static getUnseenNotification(config?: AxiosRequestConfig): Promise<SCNotificationUnseenCountType>;
31
35
  /**
32
36
  * 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
37
  * @param data
38
+ * @param config
34
39
  */
35
- static createCustomNotification(data: CustomNotificationParams): Promise<any>;
40
+ static createCustomNotification(data: CustomNotificationParams, config?: AxiosRequestConfig): Promise<any>;
36
41
  /**
37
42
  * 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.
43
+ * @param config
38
44
  */
39
- static listBroadcastMessages(): Promise<SCPaginatedResponse<SCBroadcastMessageType>>;
45
+ static listBroadcastMessages(config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCBroadcastMessageType>>;
40
46
  /**
41
47
  * This endpoint retrieves the total number of broadcast messages not yet seen by the user.
48
+ * @param config
42
49
  */
43
- static listBroadcastMessagesUnseenCount(): Promise<SCNotificationUnseenCountType>;
50
+ static listBroadcastMessagesUnseenCount(config?: AxiosRequestConfig): Promise<SCNotificationUnseenCountType>;
44
51
  /**
45
52
  * This endpoint retrieves the total number of broadcast messages not yet disposed by the user.
53
+ * @param config
46
54
  */
47
- static listBroadcastMessagesUndisposedCount(): Promise<SCNotificationUnseenCountType>;
55
+ static listBroadcastMessagesUndisposedCount(config?: AxiosRequestConfig): Promise<SCNotificationUnseenCountType>;
48
56
  /**
49
57
  * This endpoint marks as viewed/read a broadcast message for a user.
50
58
  * @param banner_ids
59
+ * @param config
51
60
  */
52
- static markReadBroadcastMessages(banner_ids: number[]): Promise<any>;
61
+ static markReadBroadcastMessages(banner_ids: number[], config?: AxiosRequestConfig): Promise<any>;
53
62
  /**
54
63
  * This endpoint disposes a broadcast message for a user.
55
64
  * @param banner_ids
65
+ * @param config
56
66
  */
57
- static disposeBroadcastMessages(banner_ids: number[]): Promise<any>;
67
+ static disposeBroadcastMessages(banner_ids: number[], config?: AxiosRequestConfig): Promise<any>;
58
68
  }
59
69
  /**
60
70
  *
61
- :::tipNotification service can be used in the following ways:
71
+ :::tipNotification service can be used in the following way:
62
72
 
63
73
  ```jsx
64
74
  1. Import the service from our library:
@@ -80,17 +90,26 @@ export declare class NotificationApiClient {
80
90
  return await NotificationService.disposeBroadcastMessages(banner_ids);
81
91
  }
82
92
  ```
93
+ ```jsx
94
+ If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
95
+
96
+ 1. Declare it(or declare them, it is possible to add multiple params)
97
+
98
+ const headers = headers: {Authorization: `Bearer ${yourToken}`}
99
+
100
+ 2. Add it inside the brackets and pass it to the function, as shown in the previous example!
101
+ ```
83
102
  :::
84
103
  */
85
104
  export default class NotificationService {
86
- static listUserNotification(): Promise<SCPaginatedResponse<SCNotificationAggregatedType>>;
87
- static markReadNotification(sids: string[]): Promise<any>;
88
- static getUnseenNotification(): Promise<SCNotificationUnseenCountType>;
89
- static createCustomNotification(data: CustomNotificationParams): Promise<any>;
90
- static listBroadcastMessages(): Promise<SCPaginatedResponse<SCBroadcastMessageType>>;
91
- static listBroadcastMessagesUnseenCount(): Promise<SCNotificationUnseenCountType>;
92
- static listBroadcastMessagesUndisposedCount(): Promise<SCNotificationUnseenCountType>;
93
- static disposeBroadcastMessages(banner_ids: number[]): Promise<any>;
94
- static markReadBroadcastMessages(banner_ids: number[]): Promise<any>;
105
+ static listUserNotification(config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCNotificationAggregatedType>>;
106
+ static markReadNotification(sids: string[], config?: AxiosRequestConfig): Promise<any>;
107
+ static getUnseenNotification(config?: AxiosRequestConfig): Promise<SCNotificationUnseenCountType>;
108
+ static createCustomNotification(data: CustomNotificationParams, config?: AxiosRequestConfig): Promise<any>;
109
+ static listBroadcastMessages(config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCBroadcastMessageType>>;
110
+ static listBroadcastMessagesUnseenCount(config?: AxiosRequestConfig): Promise<SCNotificationUnseenCountType>;
111
+ static listBroadcastMessagesUndisposedCount(config?: AxiosRequestConfig): Promise<SCNotificationUnseenCountType>;
112
+ static disposeBroadcastMessages(banner_ids: number[], config?: AxiosRequestConfig): Promise<any>;
113
+ static markReadBroadcastMessages(banner_ids: number[], config?: AxiosRequestConfig): Promise<any>;
95
114
  }
96
115
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/notification/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,sBAAsB,EAAE,4BAA4B,EAAE,6BAA6B,EAAC,MAAM,sBAAsB,CAAC;AACzH,OAAO,EAAC,wBAAwB,EAAE,mBAAmB,EAAC,MAAM,aAAa,CAAC;AAE1E,MAAM,WAAW,8BAA8B;IAC7C,oBAAoB,IAAI,OAAO,CAAC,mBAAmB,CAAC,4BAA4B,CAAC,CA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AG,CAAC;WAGnG,qBAAqB,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,sBAAsB,CAAC,CAAC;WAGxG,gCAAgC,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,6BAA6B,CAAC;WAGrG,oCAAoC,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,6BAA6B,CAAC;WAGzG,wBAAwB,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,GAAG,CAAC;WAGzF,yBAAyB,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,GAAG,CAAC;CAGxG"}
@@ -15,66 +15,75 @@ import Endpoints from '../../constants/Endpoints';
15
15
  export class NotificationApiClient {
16
16
  /**
17
17
  * List all user notifications (in aggregate form) related to the community.
18
+ * @param config
18
19
  */
19
- static listUserNotification() {
20
- return apiRequest(Endpoints.UserNotificationList.url({}), Endpoints.UserNotificationList.method);
20
+ static listUserNotification(config) {
21
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.UserNotificationList.url({}), method: Endpoints.UserNotificationList.method }));
21
22
  }
22
23
  /**
23
24
  * This endpoint marks as read a list of notifications identified by serialization_ids (sids).
24
25
  * @param sids
26
+ * @param config
25
27
  */
26
- static markReadNotification(sids) {
27
- return apiRequest(Endpoints.UserMarkReadNotification.url({}), Endpoints.UserMarkReadNotification.method, { sids: sids });
28
+ static markReadNotification(sids, config) {
29
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.UserMarkReadNotification.url({}), method: Endpoints.UserMarkReadNotification.method, data: { sids: sids } }));
28
30
  }
29
31
  /**
30
32
  * This endpoint retrieves the number of unseen/unread notifications.
33
+ * @param config
31
34
  */
32
- static getUnseenNotification() {
33
- return apiRequest(Endpoints.UserUnseenNotificationCount.url({}), Endpoints.UserUnseenNotificationCount.method);
35
+ static getUnseenNotification(config) {
36
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.UserUnseenNotificationCount.url({}), method: Endpoints.UserUnseenNotificationCount.method }));
34
37
  }
35
38
  /**
36
39
  * 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.
37
40
  * @param data
41
+ * @param config
38
42
  */
39
- static createCustomNotification(data) {
40
- return apiRequest(Endpoints.CreateCustomNotification.url({}), Endpoints.CreateCustomNotification.method, data);
43
+ static createCustomNotification(data, config) {
44
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.CreateCustomNotification.url({}), method: Endpoints.CreateCustomNotification.method, data: data }));
41
45
  }
42
46
  /**
43
47
  * 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.
48
+ * @param config
44
49
  */
45
- static listBroadcastMessages() {
46
- return apiRequest(Endpoints.BroadcastMessagesList.url({}), Endpoints.BroadcastMessagesList.method);
50
+ static listBroadcastMessages(config) {
51
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.BroadcastMessagesList.url({}), method: Endpoints.BroadcastMessagesList.method }));
47
52
  }
48
53
  /**
49
54
  * This endpoint retrieves the total number of broadcast messages not yet seen by the user.
55
+ * @param config
50
56
  */
51
- static listBroadcastMessagesUnseenCount() {
52
- return apiRequest(Endpoints.BroadcastMessagesUnseenCount.url({}), Endpoints.BroadcastMessagesUnseenCount.method);
57
+ static listBroadcastMessagesUnseenCount(config) {
58
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.BroadcastMessagesUnseenCount.url({}), method: Endpoints.BroadcastMessagesUnseenCount.method }));
53
59
  }
54
60
  /**
55
61
  * This endpoint retrieves the total number of broadcast messages not yet disposed by the user.
62
+ * @param config
56
63
  */
57
- static listBroadcastMessagesUndisposedCount() {
58
- return apiRequest(Endpoints.BroadcastMessagesUndisposedCount.url({}), Endpoints.BroadcastMessagesUndisposedCount.method);
64
+ static listBroadcastMessagesUndisposedCount(config) {
65
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.BroadcastMessagesUndisposedCount.url({}), method: Endpoints.BroadcastMessagesUndisposedCount.method }));
59
66
  }
60
67
  /**
61
68
  * This endpoint marks as viewed/read a broadcast message for a user.
62
69
  * @param banner_ids
70
+ * @param config
63
71
  */
64
- static markReadBroadcastMessages(banner_ids) {
65
- return apiRequest(Endpoints.BroadcastMessagesMarkRead.url({}), Endpoints.BroadcastMessagesMarkRead.method, { banner_ids: banner_ids });
72
+ static markReadBroadcastMessages(banner_ids, config) {
73
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.BroadcastMessagesMarkRead.url({}), method: Endpoints.BroadcastMessagesMarkRead.method, data: { banner_ids: banner_ids } }));
66
74
  }
67
75
  /**
68
76
  * This endpoint disposes a broadcast message for a user.
69
77
  * @param banner_ids
78
+ * @param config
70
79
  */
71
- static disposeBroadcastMessages(banner_ids) {
72
- return apiRequest(Endpoints.BroadcastMessagesDispose.url({}), Endpoints.BroadcastMessagesDispose.method, { banner_ids: banner_ids });
80
+ static disposeBroadcastMessages(banner_ids, config) {
81
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.BroadcastMessagesDispose.url({}), method: Endpoints.BroadcastMessagesDispose.method, data: { banner_ids: banner_ids } }));
73
82
  }
74
83
  }
75
84
  /**
76
85
  *
77
- :::tipNotification service can be used in the following ways:
86
+ :::tipNotification service can be used in the following way:
78
87
 
79
88
  ```jsx
80
89
  1. Import the service from our library:
@@ -96,52 +105,61 @@ export class NotificationApiClient {
96
105
  return await NotificationService.disposeBroadcastMessages(banner_ids);
97
106
  }
98
107
  ```
108
+ ```jsx
109
+ If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
110
+
111
+ 1. Declare it(or declare them, it is possible to add multiple params)
112
+
113
+ const headers = headers: {Authorization: `Bearer ${yourToken}`}
114
+
115
+ 2. Add it inside the brackets and pass it to the function, as shown in the previous example!
116
+ ```
99
117
  :::
100
118
  */
101
119
  export default class NotificationService {
102
- static listUserNotification() {
120
+ static listUserNotification(config) {
103
121
  return __awaiter(this, void 0, void 0, function* () {
104
- return NotificationApiClient.listUserNotification();
122
+ return NotificationApiClient.listUserNotification(config);
105
123
  });
106
124
  }
107
- static markReadNotification(sids) {
125
+ static markReadNotification(sids, config) {
108
126
  return __awaiter(this, void 0, void 0, function* () {
109
- return NotificationApiClient.markReadNotification(sids);
127
+ return NotificationApiClient.markReadNotification(sids, config);
110
128
  });
111
129
  }
112
- static getUnseenNotification() {
130
+ static getUnseenNotification(config) {
113
131
  return __awaiter(this, void 0, void 0, function* () {
114
- return NotificationApiClient.getUnseenNotification();
132
+ return NotificationApiClient.getUnseenNotification(config);
115
133
  });
116
134
  }
117
- static createCustomNotification(data) {
135
+ static createCustomNotification(data, config) {
118
136
  return __awaiter(this, void 0, void 0, function* () {
119
- return NotificationApiClient.createCustomNotification(data);
137
+ return NotificationApiClient.createCustomNotification(data, config);
120
138
  });
121
139
  }
122
- static listBroadcastMessages() {
140
+ static listBroadcastMessages(config) {
123
141
  return __awaiter(this, void 0, void 0, function* () {
124
- return NotificationApiClient.listBroadcastMessages();
142
+ return NotificationApiClient.listBroadcastMessages(config);
125
143
  });
126
144
  }
127
- static listBroadcastMessagesUnseenCount() {
145
+ static listBroadcastMessagesUnseenCount(config) {
128
146
  return __awaiter(this, void 0, void 0, function* () {
129
- return NotificationApiClient.listBroadcastMessagesUnseenCount();
147
+ return NotificationApiClient.listBroadcastMessagesUnseenCount(config);
130
148
  });
131
149
  }
132
- static listBroadcastMessagesUndisposedCount() {
150
+ static listBroadcastMessagesUndisposedCount(config) {
133
151
  return __awaiter(this, void 0, void 0, function* () {
134
- return NotificationApiClient.listBroadcastMessagesUndisposedCount();
152
+ return NotificationApiClient.listBroadcastMessagesUndisposedCount(config);
135
153
  });
136
154
  }
137
- static disposeBroadcastMessages(banner_ids) {
155
+ static disposeBroadcastMessages(banner_ids, config) {
138
156
  return __awaiter(this, void 0, void 0, function* () {
139
- return NotificationApiClient.disposeBroadcastMessages(banner_ids);
157
+ return NotificationApiClient.disposeBroadcastMessages(banner_ids, config);
140
158
  });
141
159
  }
142
- static markReadBroadcastMessages(banner_ids) {
160
+ static markReadBroadcastMessages(banner_ids, config) {
143
161
  return __awaiter(this, void 0, void 0, function* () {
144
- return NotificationApiClient.markReadBroadcastMessages(banner_ids);
162
+ return NotificationApiClient.markReadBroadcastMessages(banner_ids, config);
145
163
  });
146
164
  }
147
165
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/services/notification/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAClD,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAelD;;GAEG;AAEH,MAAM,OAAO,qBAAqB;IAChC;;OAEG;IACH,MAAM,CAAC,oBAAoB;QACzB,OAAO,UAAU,CAAC,SAAS,CAAC,oBAAoB,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACnG,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,oBAAoB,CAAC,IAAc;QACxC,OAAO,UAAU,CAAC,SAAS,CAAC,wBAAwB,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC,wBAAwB,CAAC,MAAM,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;IACzH,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,qBAAqB;QAC1B,OAAO,UAAU,CAAC,SAAS,CAAC,2BAA2B,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAC;IACjH,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,wBAAwB,CAAC,IAA8B;QAC5D,OAAO,U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,MAAM,CAAC,CAAC;QAClE,CAAC;KAAA;IACD,MAAM,CAAO,qBAAqB,CAAC,MAA2B;;YAC5D,OAAO,qBAAqB,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;QAC7D,CAAC;KAAA;IACD,MAAM,CAAO,wBAAwB,CAAC,IAA8B,EAAE,MAA2B;;YAC/F,OAAO,qBAAqB,CAAC,wBAAwB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACtE,CAAC;KAAA;IACD,MAAM,CAAO,qBAAqB,CAAC,MAA2B;;YAC5D,OAAO,qBAAqB,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;QAC7D,CAAC;KAAA;IACD,MAAM,CAAO,gCAAgC,CAAC,MAA2B;;YACvE,OAAO,qBAAqB,CAAC,gCAAgC,CAAC,MAAM,CAAC,CAAC;QACxE,CAAC;KAAA;IACD,MAAM,CAAO,oCAAoC,CAAC,MAA2B;;YAC3E,OAAO,qBAAqB,CAAC,oCAAoC,CAAC,MAAM,CAAC,CAAC;QAC5E,CAAC;KAAA;IACD,MAAM,CAAO,wBAAwB,CAAC,UAAoB,EAAE,MAA2B;;YACrF,OAAO,qBAAqB,CAAC,wBAAwB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAC5E,CAAC;KAAA;IACD,MAAM,CAAO,yBAAyB,CAAC,UAAoB,EAAE,MAA2B;;YACtF,OAAO,qBAAqB,CAAC,yBAAyB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAC7E,CAAC;KAAA;CACF"}
@@ -1,9 +1,10 @@
1
1
  import { SCPreferenceType } from '@selfcommunity/types/src/types';
2
2
  import { SCPaginatedResponse } from '../../types';
3
+ import { AxiosRequestConfig } from 'axios';
3
4
  export interface PreferenceApiClientInterface {
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
+ getAllPreferences(config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPreferenceType[]>>;
6
+ searchPreferences(search?: string, section?: string, keys?: string, ordering?: string, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPreferenceType[]>>;
7
+ getSpecificPreference(id: number, config?: AxiosRequestConfig): Promise<SCPreferenceType>;
7
8
  }
8
9
  /**
9
10
  * Contains all the endpoints needed to manage dynamic preferences.
@@ -11,25 +12,28 @@ export interface PreferenceApiClientInterface {
11
12
  export declare class PreferenceApiClient {
12
13
  /**
13
14
  * This endpoint retrieves all available dynamic preferences.
15
+ * @param config
14
16
  */
15
- static getAllPreferences(): Promise<SCPaginatedResponse<SCPreferenceType[]>>;
17
+ static getAllPreferences(config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPreferenceType[]>>;
16
18
  /**
17
19
  * This endpoint searches dynamic preferences.
18
20
  * @param search
19
21
  * @param section
20
22
  * @param keys
21
23
  * @param ordering
24
+ * @param config
22
25
  */
23
- static searchPreferences(search?: string, section?: string, keys?: string, ordering?: string): Promise<SCPaginatedResponse<SCPreferenceType[]>>;
26
+ static searchPreferences(search?: string, section?: string, keys?: string, ordering?: string, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPreferenceType[]>>;
24
27
  /**
25
28
  * This endpoint retrieves a specific dynamic preference.
26
29
  * @param id
30
+ * @param config
27
31
  */
28
- static getSpecificPreference(id: number): Promise<SCPreferenceType>;
32
+ static getSpecificPreference(id: number, config?: AxiosRequestConfig): Promise<SCPreferenceType>;
29
33
  }
30
34
  /**
31
35
  *
32
- :::tipPreference service can be used in the following ways:
36
+ :::tipPreference service can be used in the following way:
33
37
 
34
38
  ```jsx
35
39
  1. Import the service from our library:
@@ -51,11 +55,20 @@ export declare class PreferenceApiClient {
51
55
  return await PreferenceService.getSpecificPreference(preferenceId);
52
56
  }
53
57
  ```
58
+ ```jsx
59
+ If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
60
+
61
+ 1. Declare it(or declare them, it is possible to add multiple params)
62
+
63
+ const headers = headers: {Authorization: `Bearer ${yourToken}`}
64
+
65
+ 2. Add it inside the brackets and pass it to the function, as shown in the previous example!
66
+ ```
54
67
  :::
55
68
  */
56
69
  export default class PreferenceService {
57
- static getAllPreferences(): Promise<SCPaginatedResponse<SCPreferenceType[]>>;
58
- static searchPreferences(search?: string, section?: string, keys?: string, ordering?: string): Promise<SCPaginatedResponse<SCPreferenceType[]>>;
59
- static getSpecificPreference(id: number): Promise<SCPreferenceType>;
70
+ static getAllPreferences(config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPreferenceType[]>>;
71
+ static searchPreferences(search?: string, section?: string, keys?: string, ordering?: string, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPreferenceType[]>>;
72
+ static getSpecificPreference(id: number, config?: AxiosRequestConfig): Promise<SCPreferenceType>;
60
73
  }
61
74
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/preference/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,gBAAgB,EAAC,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAC,mBAAmB,EAAC,MAAM,aAAa,CAAC;AAEhD,MAAM,WAAW,4BAA4B;IAC3C,iBAAiB,IAAI,OAAO,CAAC,mBAAmB,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC;IACtE,iBAAiB,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC;IACzI,qBAAqB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAC9D;AACD;;GAEG;AAEH,qBAAa,mBAAmB;IAC9B;;OAE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