@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
@@ -1,9 +1,10 @@
1
1
  import { CustomPageParams, CustomPageSearchParams, SCPaginatedResponse } from '../../types';
2
2
  import { SCCustomPageType } from '@selfcommunity/types';
3
+ import { AxiosRequestConfig } from 'axios';
3
4
  export interface CustomPageApiClientInterface {
4
- getASpecificCustomPage(id: number): Promise<SCCustomPageType>;
5
- getAllCustomPages(params?: CustomPageParams): Promise<SCPaginatedResponse<SCCustomPageType>>;
6
- searchCustomPages(params?: CustomPageSearchParams): Promise<SCPaginatedResponse<SCCustomPageType>>;
5
+ getASpecificCustomPage(id: number, config?: AxiosRequestConfig): Promise<SCCustomPageType>;
6
+ getAllCustomPages(params?: CustomPageParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCustomPageType>>;
7
+ searchCustomPages(params?: CustomPageSearchParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCustomPageType>>;
7
8
  }
8
9
  /**
9
10
  * Contains all the endpoints needed to manage custom pages.
@@ -12,22 +13,25 @@ export declare class CustomPageApiClient {
12
13
  /**
13
14
  * This endpoint retrieves a specific custom page.
14
15
  * @param id
16
+ * @param config
15
17
  */
16
- static getASpecificCustomPage(id: number): Promise<SCCustomPageType>;
18
+ static getASpecificCustomPage(id: number, config?: AxiosRequestConfig): Promise<SCCustomPageType>;
17
19
  /**
18
20
  * This endpoint retrieves all custom pages.
19
21
  * @param params
22
+ * @param config
20
23
  */
21
- static getAllCustomPages(params?: CustomPageParams): Promise<SCPaginatedResponse<SCCustomPageType>>;
24
+ static getAllCustomPages(params?: CustomPageParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCustomPageType>>;
22
25
  /**
23
26
  * This endpoint performs search of a Custom Page
24
27
  * @param params
28
+ * @param config
25
29
  */
26
- static searchCustomPages(params?: CustomPageSearchParams): Promise<SCPaginatedResponse<SCCustomPageType>>;
30
+ static searchCustomPages(params?: CustomPageSearchParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCustomPageType>>;
27
31
  }
28
32
  /**
29
33
  *
30
- :::tipCustom Page service can be used in the following ways:
34
+ :::tipCustom Page service can be used in the following way:
31
35
 
32
36
  ```jsx
33
37
  1. Import the service from our library:
@@ -49,11 +53,20 @@ export declare class CustomPageApiClient {
49
53
  return await CustomPageService.getASpecificCustomPage(customPageId);
50
54
  }
51
55
  ```
56
+ ```jsx
57
+ If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
58
+
59
+ 1. Declare it(or declare them, it is possible to add multiple params)
60
+
61
+ const headers = headers: {Authorization: `Bearer ${yourToken}`}
62
+
63
+ 2. Add it inside the brackets and pass it to the function, as shown in the previous example!
64
+ ```
52
65
  :::
53
66
  */
54
67
  export default class CustomPageService {
55
- static getASpecificCustomPage(id: number): Promise<SCCustomPageType>;
56
- static getAllCustomPages(params?: CustomPageParams): Promise<SCPaginatedResponse<SCCustomPageType>>;
57
- static searchCustomPages(params?: CustomPageSearchParams): Promise<SCPaginatedResponse<SCCustomPageType>>;
68
+ static getASpecificCustomPage(id: number, config?: AxiosRequestConfig): Promise<SCCustomPageType>;
69
+ static getAllCustomPages(params?: CustomPageParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCustomPageType>>;
70
+ static searchCustomPages(params?: CustomPageSearchParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCCustomPageType>>;
58
71
  }
59
72
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/custom_page/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,gBAAgB,EAAE,sBAAsB,EAAE,mBAAmB,EAAC,MAAM,aAAa,CAAC;AAC1F,OAAO,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AAGtD,MAAM,WAAW,4BAA4B;IAC3C,sBAAsB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC9D,iBAAiB,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAA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,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;CAG7I"}
@@ -16,30 +16,33 @@ export class CustomPageApiClient {
16
16
  /**
17
17
  * This endpoint retrieves a specific custom page.
18
18
  * @param id
19
+ * @param config
19
20
  */
20
- static getASpecificCustomPage(id) {
21
- return apiRequest(Endpoints.CustomPage.url({ id }), Endpoints.CustomPage.method);
21
+ static getASpecificCustomPage(id, config) {
22
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.CustomPage.url({ id }), method: Endpoints.CustomPage.method }));
22
23
  }
23
24
  /**
24
25
  * This endpoint retrieves all custom pages.
25
26
  * @param params
27
+ * @param config
26
28
  */
27
- static getAllCustomPages(params) {
29
+ static getAllCustomPages(params, config) {
28
30
  const p = new URLSearchParams(params);
29
- return apiRequest(`${Endpoints.GetCustomPages.url({})}?${p.toString()}`, Endpoints.GetCustomPages.method);
31
+ return apiRequest(Object.assign(Object.assign({}, config), { url: `${Endpoints.GetCustomPages.url({})}?${p.toString()}`, method: Endpoints.GetCustomPages.method }));
30
32
  }
31
33
  /**
32
34
  * This endpoint performs search of a Custom Page
33
35
  * @param params
36
+ * @param config
34
37
  */
35
- static searchCustomPages(params) {
38
+ static searchCustomPages(params, config) {
36
39
  const p = new URLSearchParams(params);
37
- return apiRequest(`${Endpoints.CustomPageSearch.url({})}?${p.toString()}`, Endpoints.CustomPageSearch.method);
40
+ return apiRequest(Object.assign(Object.assign({}, config), { url: `${Endpoints.CustomPageSearch.url({})}?${p.toString()}`, method: Endpoints.CustomPageSearch.method }));
38
41
  }
39
42
  }
40
43
  /**
41
44
  *
42
- :::tipCustom Page service can be used in the following ways:
45
+ :::tipCustom Page service can be used in the following way:
43
46
 
44
47
  ```jsx
45
48
  1. Import the service from our library:
@@ -61,22 +64,31 @@ export class CustomPageApiClient {
61
64
  return await CustomPageService.getASpecificCustomPage(customPageId);
62
65
  }
63
66
  ```
67
+ ```jsx
68
+ If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
69
+
70
+ 1. Declare it(or declare them, it is possible to add multiple params)
71
+
72
+ const headers = headers: {Authorization: `Bearer ${yourToken}`}
73
+
74
+ 2. Add it inside the brackets and pass it to the function, as shown in the previous example!
75
+ ```
64
76
  :::
65
77
  */
66
78
  export default class CustomPageService {
67
- static getASpecificCustomPage(id) {
79
+ static getASpecificCustomPage(id, config) {
68
80
  return __awaiter(this, void 0, void 0, function* () {
69
- return CustomPageApiClient.getASpecificCustomPage(id);
81
+ return CustomPageApiClient.getASpecificCustomPage(id, config);
70
82
  });
71
83
  }
72
- static getAllCustomPages(params) {
84
+ static getAllCustomPages(params, config) {
73
85
  return __awaiter(this, void 0, void 0, function* () {
74
- return CustomPageApiClient.getAllCustomPages(params);
86
+ return CustomPageApiClient.getAllCustomPages(params, config);
75
87
  });
76
88
  }
77
- static searchCustomPages(params) {
89
+ static searchCustomPages(params, config) {
78
90
  return __awaiter(this, void 0, void 0, function* () {
79
- return CustomPageApiClient.searchCustomPages(params);
91
+ return CustomPageApiClient.searchCustomPages(params, config);
80
92
  });
81
93
  }
82
94
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/services/custom_page/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAGlD,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAOlD;;GAEG;AAEH,MAAM,OAAO,mBAAmB;IAC9B;;;OAGG;IACH,MAAM,CAAC,sBAAsB,CAAC,EAAU;QACtC,OAAO,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,EAAC,EAAE,EAAC,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IACjF,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,iBAAiB,CAAC,MAAyB;QAChD,MAAM,CAAC,GAAG,IAAI,eAAe,CAAC,MAAM,C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AAO,iBAAiB,CAAC,MAA+B,EAAE,MAA2B;;YACzF,OAAO,mBAAmB,CAAC,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC/D,CAAC;KAAA;CACF"}
@@ -1,8 +1,9 @@
1
1
  import { SCDataPortabilityType } from '@selfcommunity/types';
2
+ import { AxiosRequestConfig } from 'axios';
2
3
  export interface DataPortabilityApiClientInterface {
3
- generateDataPortability(): Promise<SCDataPortabilityType>;
4
- downloadDataPortability(): Promise<any>;
5
- dataPortabilityStatus(): Promise<SCDataPortabilityType>;
4
+ generateDataPortability(config?: AxiosRequestConfig): Promise<SCDataPortabilityType>;
5
+ downloadDataPortability(config?: AxiosRequestConfig): Promise<any>;
6
+ dataPortabilityStatus(config?: AxiosRequestConfig): Promise<SCDataPortabilityType>;
6
7
  }
7
8
  /**
8
9
  * Contains all the endpoints needed to manage data portability.
@@ -10,16 +11,19 @@ export interface DataPortabilityApiClientInterface {
10
11
  export declare class DataPortabilityApiClient {
11
12
  /**
12
13
  * This endpoint generates data portability.
14
+ * @param config
13
15
  */
14
- static generateDataPortability(): Promise<SCDataPortabilityType>;
16
+ static generateDataPortability(config?: AxiosRequestConfig): Promise<SCDataPortabilityType>;
15
17
  /**
16
18
  * This endpoint downloads data portability.
19
+ * @param config
17
20
  */
18
- static downloadDataPortability(): Promise<any>;
21
+ static downloadDataPortability(config?: AxiosRequestConfig): Promise<any>;
19
22
  /**
20
23
  * This endpoint retrieves data portability status.
24
+ * @param config
21
25
  */
22
- static dataPortabilityStatus(): Promise<SCDataPortabilityType>;
26
+ static dataPortabilityStatus(config?: AxiosRequestConfig): Promise<SCDataPortabilityType>;
23
27
  }
24
28
  /**
25
29
  *
@@ -38,11 +42,20 @@ export declare class DataPortabilityApiClient {
38
42
  return await DataPortabilityService.generateDataPortability();
39
43
  }
40
44
  ```
45
+ ```jsx
46
+ If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
47
+
48
+ 1. Declare it(or declare them, it is possible to add multiple params)
49
+
50
+ const headers = headers: {Authorization: `Bearer ${yourToken}`}
51
+
52
+ 2. Add it inside the brackets and pass it to the function, as shown in the previous example!
53
+ ```
41
54
  :::
42
55
  */
43
56
  export default class DataPortabilityService {
44
- static generateDataPortability(): Promise<SCDataPortabilityType>;
45
- static downloadDataPortability(): Promise<any>;
46
- static dataPortabilityStatus(): Promise<SCDataPortabilityType>;
57
+ static generateDataPortability(config?: AxiosRequestConfig): Promise<SCDataPortabilityType>;
58
+ static downloadDataPortability(config?: AxiosRequestConfig): Promise<any>;
59
+ static dataPortabilityStatus(config?: AxiosRequestConfig): Promise<SCDataPortabilityType>;
47
60
  }
48
61
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/data_portability/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,qBAAqB,EAAC,MAAM,sBAAsB,CAAC;AAE3D,MAAM,WAAW,iCAAiC;IAChD,uBAAuB,IAAI,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC1D,uBAAuB,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IACxC,qBAAqB,IAAI,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACzD;AACD;;GAEG;AAEH,qBAAa,wBAAwB;IACnC;;OAEG;IACH,MAAM,CAAC,uBAAuB,IAAI,OAAO,CAAC,qBAAqB,CAAC;IAIhE;;OAEG;IACH,MAAM,CAAC,uBAAuB,IAAI,OAAO,CAAC,GAAG,CAAC;IAI9C;;OAEG;IACH,MAAM,CAAC,qBAAqB,IAAI,OAAO,CAAC,qBAAqB,CAAC;CAG/D;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAsB;WAC5B,uBAAuB,IAAI,OAAO,CAAC,qBAAqB,CAAC;WAGzD,uBAAuB,IAAI,OAAO,CAAC,GAAG,CAAC;WAGvC,qBAAqB,IAAI,OAAO,CAAC,qBAAqB,CAAC;CAGrE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/data_portability/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,qBAAqB,EAAC,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAC,kBAAkB,EAAC,MAAM,OAAO,CAAC;AAEzC,MAAM,WAAW,iCAAiC;IAChD,uBAAuB,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACrF,uBAAuB,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACnE,qBAAqB,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACpF;AACD;;GAEG;AAEH,qBAAa,wBAAwB;IACnC;;;OAGG;IACH,MAAM,CAAC,uBAAuB,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAI3F;;;OAGG;IACH,MAAM,CAAC,uBAAuB,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,GAAG,CAAC;IAIzE;;;OAGG;IACH,MAAM,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAG1F;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAsB;WAC5B,uBAAuB,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,qBAAqB,CAAC;WAGpF,uBAAuB,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,GAAG,CAAC;WAGlE,qBAAqB,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAGhG"}
@@ -15,21 +15,24 @@ import Endpoints from '../../constants/Endpoints';
15
15
  export class DataPortabilityApiClient {
16
16
  /**
17
17
  * This endpoint generates data portability.
18
+ * @param config
18
19
  */
19
- static generateDataPortability() {
20
- return apiRequest(Endpoints.GenerateDataPortability.url({}), Endpoints.GenerateDataPortability.method);
20
+ static generateDataPortability(config) {
21
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.GenerateDataPortability.url({}), method: Endpoints.GenerateDataPortability.method }));
21
22
  }
22
23
  /**
23
24
  * This endpoint downloads data portability.
25
+ * @param config
24
26
  */
25
- static downloadDataPortability() {
26
- return apiRequest(Endpoints.DataPortabilityDownload.url({}), Endpoints.DataPortabilityDownload.method);
27
+ static downloadDataPortability(config) {
28
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.DataPortabilityDownload.url({}), method: Endpoints.DataPortabilityDownload.method }));
27
29
  }
28
30
  /**
29
31
  * This endpoint retrieves data portability status.
32
+ * @param config
30
33
  */
31
- static dataPortabilityStatus() {
32
- return apiRequest(Endpoints.DataPortabilityStatus.url({}), Endpoints.DataPortabilityStatus.method);
34
+ static dataPortabilityStatus(config) {
35
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.DataPortabilityStatus.url({}), method: Endpoints.DataPortabilityStatus.method }));
33
36
  }
34
37
  }
35
38
  /**
@@ -49,22 +52,31 @@ export class DataPortabilityApiClient {
49
52
  return await DataPortabilityService.generateDataPortability();
50
53
  }
51
54
  ```
55
+ ```jsx
56
+ If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
57
+
58
+ 1. Declare it(or declare them, it is possible to add multiple params)
59
+
60
+ const headers = headers: {Authorization: `Bearer ${yourToken}`}
61
+
62
+ 2. Add it inside the brackets and pass it to the function, as shown in the previous example!
63
+ ```
52
64
  :::
53
65
  */
54
66
  export default class DataPortabilityService {
55
- static generateDataPortability() {
67
+ static generateDataPortability(config) {
56
68
  return __awaiter(this, void 0, void 0, function* () {
57
- return DataPortabilityApiClient.generateDataPortability();
69
+ return DataPortabilityApiClient.generateDataPortability(config);
58
70
  });
59
71
  }
60
- static downloadDataPortability() {
72
+ static downloadDataPortability(config) {
61
73
  return __awaiter(this, void 0, void 0, function* () {
62
- return DataPortabilityApiClient.downloadDataPortability();
74
+ return DataPortabilityApiClient.downloadDataPortability(config);
63
75
  });
64
76
  }
65
- static dataPortabilityStatus() {
77
+ static dataPortabilityStatus(config) {
66
78
  return __awaiter(this, void 0, void 0, function* () {
67
- return DataPortabilityApiClient.dataPortabilityStatus();
79
+ return DataPortabilityApiClient.dataPortabilityStatus(config);
68
80
  });
69
81
  }
70
82
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/services/data_portability/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAClD,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAQlD;;GAEG;AAEH,MAAM,OAAO,wBAAwB;IACnC;;OAEG;IACH,MAAM,CAAC,uBAAuB;QAC5B,OAAO,UAAU,CAAC,SAAS,CAAC,uBAAuB,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC;IACzG,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,uBAAuB;QAC5B,OAAO,UAAU,CAAC,SAAS,CAAC,uBAAuB,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC;IACzG,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,qBAAqB;QAC1B,OAAO,UAAU,CAAC,SAAS,CAAC,qBAAqB,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACrG,CAAC;CACF;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAsB;IACzC,MAAM,CAAO,uBAAuB;;YAClC,OAAO,wBAAwB,CAAC,uBAAuB,EAAE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A2B;;YAC9D,OAAO,wBAAwB,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC;QAClE,CAAC;KAAA;IACD,MAAM,CAAO,uBAAuB,CAAC,MAA2B;;YAC9D,OAAO,wBAAwB,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC;QAClE,CAAC;KAAA;IACD,MAAM,CAAO,qBAAqB,CAAC,MAA2B;;YAC5D,OAAO,wBAAwB,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;QAChE,CAAC;KAAA;CACF"}
@@ -1,14 +1,15 @@
1
1
  import { BaseGetParams, EmbedSearchParams, EmbedUpdateParams, SCPaginatedResponse } from '../../types';
2
2
  import { SCEmbedType, SCFeedUnitType } from '@selfcommunity/types';
3
+ import { AxiosRequestConfig } from 'axios';
3
4
  export interface EmbedApiClientInterface {
4
- getAllEmbeds(params?: BaseGetParams): Promise<SCPaginatedResponse<SCEmbedType>>;
5
- createEmbed(data: SCEmbedType): Promise<SCEmbedType>;
6
- searchEmbed(params?: EmbedSearchParams): Promise<SCPaginatedResponse<SCEmbedType>>;
7
- getSpecificEmbed(id: number): Promise<SCEmbedType>;
8
- updateASpecificEmbed(id: number, data?: EmbedUpdateParams): Promise<SCEmbedType>;
9
- patchASpecificEmbed(id: number, data?: EmbedUpdateParams): Promise<SCEmbedType>;
10
- getEmbedFeed(embed_type?: string, embed_id?: string): Promise<SCPaginatedResponse<SCFeedUnitType>>;
11
- getSpecificEmbedFeed(id: number): Promise<SCPaginatedResponse<SCFeedUnitType>>;
5
+ getAllEmbeds(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCEmbedType>>;
6
+ createEmbed(data: SCEmbedType, config?: AxiosRequestConfig): Promise<SCEmbedType>;
7
+ searchEmbed(params?: EmbedSearchParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCEmbedType>>;
8
+ getSpecificEmbed(id: number, config?: AxiosRequestConfig): Promise<SCEmbedType>;
9
+ updateASpecificEmbed(id: number, data?: EmbedUpdateParams, config?: AxiosRequestConfig): Promise<SCEmbedType>;
10
+ patchASpecificEmbed(id: number, data?: EmbedUpdateParams, config?: AxiosRequestConfig): Promise<SCEmbedType>;
11
+ getEmbedFeed(embed_type?: string, embed_id?: string, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCFeedUnitType>>;
12
+ getSpecificEmbedFeed(id: number, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCFeedUnitType>>;
12
13
  }
13
14
  /**
14
15
  * Contains all the endpoints needed to manage embeds.
@@ -17,50 +18,58 @@ export declare class EmbedApiClient {
17
18
  /**
18
19
  * This endpoint retrieves all embeds.
19
20
  * @param params
21
+ * @param config
20
22
  */
21
- static getAllEmbeds(params?: BaseGetParams): Promise<SCPaginatedResponse<SCEmbedType>>;
23
+ static getAllEmbeds(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCEmbedType>>;
22
24
  /**
23
25
  * This endpoint creates an embed. This operation requires admin role.
24
26
  * @param data
27
+ * @param config
25
28
  */
26
- static createEmbed(data: SCEmbedType): Promise<SCEmbedType>;
29
+ static createEmbed(data: SCEmbedType, config?: AxiosRequestConfig): Promise<SCEmbedType>;
27
30
  /**
28
31
  * This endpoint performs embed search.
29
32
  * @param params
33
+ * @param config
30
34
  */
31
- static searchEmbed(params?: EmbedSearchParams): Promise<SCPaginatedResponse<SCEmbedType>>;
35
+ static searchEmbed(params?: EmbedSearchParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCEmbedType>>;
32
36
  /**
33
37
  * This endpoint retrieves a specific embed using ID.
34
38
  * @param id
39
+ * @param config
35
40
  */
36
- static getSpecificEmbed(id: number): Promise<SCEmbedType>;
41
+ static getSpecificEmbed(id: number, config?: AxiosRequestConfig): Promise<SCEmbedType>;
37
42
  /**
38
43
  * This endpoint updates a specific embed. This operation requires admin role.
39
44
  * @param id
40
45
  * @param data
46
+ * @param config
41
47
  */
42
- static updateASpecificEmbed(id: number, data?: EmbedUpdateParams): Promise<SCEmbedType>;
48
+ static updateASpecificEmbed(id: number, data?: EmbedUpdateParams, config?: AxiosRequestConfig): Promise<SCEmbedType>;
43
49
  /**
44
50
  * This endpoint patches a specific embed. This operation requires admin role.
45
51
  * @param id
46
52
  * @param data
53
+ * @param config
47
54
  */
48
- static patchASpecificEmbed(id: number, data?: EmbedUpdateParams): Promise<SCEmbedType>;
55
+ static patchASpecificEmbed(id: number, data?: EmbedUpdateParams, config?: AxiosRequestConfig): Promise<SCEmbedType>;
49
56
  /**
50
57
  * This endpoint retrieves the embed's feed which contains Feed that has the Embed as associated media.
51
58
  * @param embed_type
52
59
  * @param embed_id
60
+ * @param config
53
61
  */
54
- static getEmbedFeed(embed_type?: string, embed_id?: string): Promise<SCPaginatedResponse<SCFeedUnitType>>;
62
+ static getEmbedFeed(embed_type?: string, embed_id?: string, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCFeedUnitType>>;
55
63
  /**
56
64
  * This endpoint retrieves the embed's feed which contains Feed that has an Embed as associated media.
57
65
  * @param id
66
+ * @param config
58
67
  */
59
- static getSpecificEmbedFeed(id: number): Promise<SCPaginatedResponse<SCFeedUnitType>>;
68
+ static getSpecificEmbedFeed(id: number, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCFeedUnitType>>;
60
69
  }
61
70
  /**
62
71
  *
63
- :::tipEmbed service can be used in the following ways:
72
+ :::tipEmbed service can be used in the following way:
64
73
 
65
74
  ```jsx
66
75
  1. Import the service from our library:
@@ -82,16 +91,25 @@ export declare class EmbedApiClient {
82
91
  return await EmbedService.getSpecificEmbed(embedId);
83
92
  }
84
93
  ```
94
+ ```jsx
95
+ If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
96
+
97
+ 1. Declare it(or declare them, it is possible to add multiple params)
98
+
99
+ const headers = headers: {Authorization: `Bearer ${yourToken}`}
100
+
101
+ 2. Add it inside the brackets and pass it to the function, as shown in the previous example!
102
+ ```
85
103
  :::
86
104
  */
87
105
  export default class EmbedService {
88
- static getAllEmbeds(params?: BaseGetParams): Promise<SCPaginatedResponse<SCEmbedType>>;
89
- static searchEmbed(params?: EmbedSearchParams): Promise<SCPaginatedResponse<SCEmbedType>>;
90
- static createEmbed(data: SCEmbedType): Promise<SCEmbedType>;
91
- static getSpecificEmbed(id: number): Promise<SCEmbedType>;
92
- static updateASpecificEmbed(id: number, data?: EmbedUpdateParams): Promise<SCEmbedType>;
93
- static patchASpecificEmbed(id: number, data?: EmbedUpdateParams): Promise<SCEmbedType>;
94
- static getEmbedFeed(embed_type?: string, embed_id?: string): Promise<SCPaginatedResponse<SCFeedUnitType>>;
95
- static getSpecificEmbedFeed(id: number): Promise<SCPaginatedResponse<SCFeedUnitType>>;
106
+ static getAllEmbeds(params?: BaseGetParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCEmbedType>>;
107
+ static searchEmbed(params?: EmbedSearchParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCEmbedType>>;
108
+ static createEmbed(data: SCEmbedType, config?: AxiosRequestConfig): Promise<SCEmbedType>;
109
+ static getSpecificEmbed(id: number, config?: AxiosRequestConfig): Promise<SCEmbedType>;
110
+ static updateASpecificEmbed(id: number, data?: EmbedUpdateParams, config?: AxiosRequestConfig): Promise<SCEmbedType>;
111
+ static patchASpecificEmbed(id: number, data?: EmbedUpdateParams, config?: AxiosRequestConfig): Promise<SCEmbedType>;
112
+ static getEmbedFeed(embed_type?: string, embed_id?: string, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCFeedUnitType>>;
113
+ static getSpecificEmbedFeed(id: number, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCFeedUnitType>>;
96
114
  }
97
115
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/embed/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,mBAAmB,EAA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I5G,YAAY,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;WAI/H,oBAAoB,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;CAGzH"}
@@ -16,69 +16,77 @@ export class EmbedApiClient {
16
16
  /**
17
17
  * This endpoint retrieves all embeds.
18
18
  * @param params
19
+ * @param config
19
20
  */
20
- static getAllEmbeds(params) {
21
+ static getAllEmbeds(params, config) {
21
22
  const p = new URLSearchParams(params);
22
- return apiRequest(`${Endpoints.EmbedList.url({})}?${p.toString()}`, Endpoints.EmbedList.method);
23
+ return apiRequest(Object.assign(Object.assign({}, config), { url: `${Endpoints.EmbedList.url({})}?${p.toString()}`, method: Endpoints.EmbedList.method }));
23
24
  }
24
25
  /**
25
26
  * This endpoint creates an embed. This operation requires admin role.
26
27
  * @param data
28
+ * @param config
27
29
  */
28
- static createEmbed(data) {
29
- return apiRequest(Endpoints.EmbedCreate.url({}), Endpoints.EmbedCreate.method, data);
30
+ static createEmbed(data, config) {
31
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.EmbedCreate.url({}), method: Endpoints.EmbedCreate.method, data }));
30
32
  }
31
33
  /**
32
34
  * This endpoint performs embed search.
33
35
  * @param params
36
+ * @param config
34
37
  */
35
- static searchEmbed(params) {
38
+ static searchEmbed(params, config) {
36
39
  const p = new URLSearchParams(params);
37
- return apiRequest(`${Endpoints.EmbedSearch.url({})}?${p.toString()}`, Endpoints.EmbedSearch.method);
40
+ return apiRequest(Object.assign(Object.assign({}, config), { url: `${Endpoints.EmbedSearch.url({})}?${p.toString()}`, method: Endpoints.EmbedSearch.method }));
38
41
  }
39
42
  /**
40
43
  * This endpoint retrieves a specific embed using ID.
41
44
  * @param id
45
+ * @param config
42
46
  */
43
- static getSpecificEmbed(id) {
44
- return apiRequest(Endpoints.Embed.url({ id }), Endpoints.Embed.method);
47
+ static getSpecificEmbed(id, config) {
48
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.Embed.url({ id }), method: Endpoints.Embed.method }));
45
49
  }
46
50
  /**
47
51
  * This endpoint updates a specific embed. This operation requires admin role.
48
52
  * @param id
49
53
  * @param data
54
+ * @param config
50
55
  */
51
- static updateASpecificEmbed(id, data) {
52
- return apiRequest(Endpoints.UpdateEmbed.url({ id }), Endpoints.UpdateEmbed.method, data);
56
+ static updateASpecificEmbed(id, data, config) {
57
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.UpdateEmbed.url({ id }), method: Endpoints.UpdateEmbed.method, data: data }));
53
58
  }
54
59
  /**
55
60
  * This endpoint patches a specific embed. This operation requires admin role.
56
61
  * @param id
57
62
  * @param data
63
+ * @param config
58
64
  */
59
- static patchASpecificEmbed(id, data) {
60
- return apiRequest(Endpoints.PatchEmbed.url({ id }), Endpoints.PatchEmbed.method, data);
65
+ static patchASpecificEmbed(id, data, config) {
66
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.PatchEmbed.url({ id }), method: Endpoints.PatchEmbed.method, data: data }));
61
67
  }
62
68
  /**
63
69
  * This endpoint retrieves the embed's feed which contains Feed that has the Embed as associated media.
64
70
  * @param embed_type
65
71
  * @param embed_id
72
+ * @param config
66
73
  */
67
- static getEmbedFeed(embed_type, embed_id) {
74
+ static getEmbedFeed(embed_type, embed_id, config) {
68
75
  const p = new URLSearchParams({ embed_type: embed_type, embed_id: embed_id });
69
- return apiRequest(`${Endpoints.EmbedFeed.url({})}?${p.toString()}`, Endpoints.EmbedFeed.method);
76
+ return apiRequest(Object.assign(Object.assign({}, config), { url: `${Endpoints.EmbedFeed.url({})}?${p.toString()}`, method: Endpoints.EmbedFeed.method }));
70
77
  }
71
78
  /**
72
79
  * This endpoint retrieves the embed's feed which contains Feed that has an Embed as associated media.
73
80
  * @param id
81
+ * @param config
74
82
  */
75
- static getSpecificEmbedFeed(id) {
76
- return apiRequest(Endpoints.SpecificEmbedFeed.url({ id }), Endpoints.SpecificEmbedFeed.method);
83
+ static getSpecificEmbedFeed(id, config) {
84
+ return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.SpecificEmbedFeed.url({ id }), method: Endpoints.SpecificEmbedFeed.method }));
77
85
  }
78
86
  }
79
87
  /**
80
88
  *
81
- :::tipEmbed service can be used in the following ways:
89
+ :::tipEmbed service can be used in the following way:
82
90
 
83
91
  ```jsx
84
92
  1. Import the service from our library:
@@ -100,47 +108,56 @@ export class EmbedApiClient {
100
108
  return await EmbedService.getSpecificEmbed(embedId);
101
109
  }
102
110
  ```
111
+ ```jsx
112
+ If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
113
+
114
+ 1. Declare it(or declare them, it is possible to add multiple params)
115
+
116
+ const headers = headers: {Authorization: `Bearer ${yourToken}`}
117
+
118
+ 2. Add it inside the brackets and pass it to the function, as shown in the previous example!
119
+ ```
103
120
  :::
104
121
  */
105
122
  export default class EmbedService {
106
- static getAllEmbeds(params) {
123
+ static getAllEmbeds(params, config) {
107
124
  return __awaiter(this, void 0, void 0, function* () {
108
- return EmbedApiClient.getAllEmbeds(params);
125
+ return EmbedApiClient.getAllEmbeds(params, config);
109
126
  });
110
127
  }
111
- static searchEmbed(params) {
128
+ static searchEmbed(params, config) {
112
129
  return __awaiter(this, void 0, void 0, function* () {
113
- return EmbedApiClient.searchEmbed(params);
130
+ return EmbedApiClient.searchEmbed(params, config);
114
131
  });
115
132
  }
116
- static createEmbed(data) {
133
+ static createEmbed(data, config) {
117
134
  return __awaiter(this, void 0, void 0, function* () {
118
- return EmbedApiClient.createEmbed(data);
135
+ return EmbedApiClient.createEmbed(data, config);
119
136
  });
120
137
  }
121
- static getSpecificEmbed(id) {
138
+ static getSpecificEmbed(id, config) {
122
139
  return __awaiter(this, void 0, void 0, function* () {
123
- return EmbedApiClient.getSpecificEmbed(id);
140
+ return EmbedApiClient.getSpecificEmbed(id, config);
124
141
  });
125
142
  }
126
- static updateASpecificEmbed(id, data) {
143
+ static updateASpecificEmbed(id, data, config) {
127
144
  return __awaiter(this, void 0, void 0, function* () {
128
- return EmbedApiClient.updateASpecificEmbed(id, data);
145
+ return EmbedApiClient.updateASpecificEmbed(id, data, config);
129
146
  });
130
147
  }
131
- static patchASpecificEmbed(id, data) {
148
+ static patchASpecificEmbed(id, data, config) {
132
149
  return __awaiter(this, void 0, void 0, function* () {
133
- return EmbedApiClient.patchASpecificEmbed(id, data);
150
+ return EmbedApiClient.patchASpecificEmbed(id, data, config);
134
151
  });
135
152
  }
136
- static getEmbedFeed(embed_type, embed_id) {
153
+ static getEmbedFeed(embed_type, embed_id, config) {
137
154
  return __awaiter(this, void 0, void 0, function* () {
138
- return EmbedApiClient.getEmbedFeed(embed_type, embed_id);
155
+ return EmbedApiClient.getEmbedFeed(embed_type, embed_id, config);
139
156
  });
140
157
  }
141
- static getSpecificEmbedFeed(id) {
158
+ static getSpecificEmbedFeed(id, config) {
142
159
  return __awaiter(this, void 0, void 0, function* () {
143
- return EmbedApiClient.getSpecificEmbedFeed(id);
160
+ return EmbedApiClient.getSpecificEmbedFeed(id, config);
144
161
  });
145
162
  }
146
163
  }