@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"}
@@ -22,31 +22,34 @@ class CustomPageApiClient {
22
22
  /**
23
23
  * This endpoint retrieves a specific custom page.
24
24
  * @param id
25
+ * @param config
25
26
  */
26
- static getASpecificCustomPage(id) {
27
- return (0, apiRequest_1.apiRequest)(Endpoints_1.default.CustomPage.url({ id }), Endpoints_1.default.CustomPage.method);
27
+ static getASpecificCustomPage(id, config) {
28
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.CustomPage.url({ id }), method: Endpoints_1.default.CustomPage.method }));
28
29
  }
29
30
  /**
30
31
  * This endpoint retrieves all custom pages.
31
32
  * @param params
33
+ * @param config
32
34
  */
33
- static getAllCustomPages(params) {
35
+ static getAllCustomPages(params, config) {
34
36
  const p = new URLSearchParams(params);
35
- return (0, apiRequest_1.apiRequest)(`${Endpoints_1.default.GetCustomPages.url({})}?${p.toString()}`, Endpoints_1.default.GetCustomPages.method);
37
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: `${Endpoints_1.default.GetCustomPages.url({})}?${p.toString()}`, method: Endpoints_1.default.GetCustomPages.method }));
36
38
  }
37
39
  /**
38
40
  * This endpoint performs search of a Custom Page
39
41
  * @param params
42
+ * @param config
40
43
  */
41
- static searchCustomPages(params) {
44
+ static searchCustomPages(params, config) {
42
45
  const p = new URLSearchParams(params);
43
- return (0, apiRequest_1.apiRequest)(`${Endpoints_1.default.CustomPageSearch.url({})}?${p.toString()}`, Endpoints_1.default.CustomPageSearch.method);
46
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: `${Endpoints_1.default.CustomPageSearch.url({})}?${p.toString()}`, method: Endpoints_1.default.CustomPageSearch.method }));
44
47
  }
45
48
  }
46
49
  exports.CustomPageApiClient = CustomPageApiClient;
47
50
  /**
48
51
  *
49
- :::tipCustom Page service can be used in the following ways:
52
+ :::tipCustom Page service can be used in the following way:
50
53
 
51
54
  ```jsx
52
55
  1. Import the service from our library:
@@ -68,22 +71,31 @@ exports.CustomPageApiClient = CustomPageApiClient;
68
71
  return await CustomPageService.getASpecificCustomPage(customPageId);
69
72
  }
70
73
  ```
74
+ ```jsx
75
+ If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
76
+
77
+ 1. Declare it(or declare them, it is possible to add multiple params)
78
+
79
+ const headers = headers: {Authorization: `Bearer ${yourToken}`}
80
+
81
+ 2. Add it inside the brackets and pass it to the function, as shown in the previous example!
82
+ ```
71
83
  :::
72
84
  */
73
85
  class CustomPageService {
74
- static getASpecificCustomPage(id) {
86
+ static getASpecificCustomPage(id, config) {
75
87
  return __awaiter(this, void 0, void 0, function* () {
76
- return CustomPageApiClient.getASpecificCustomPage(id);
88
+ return CustomPageApiClient.getASpecificCustomPage(id, config);
77
89
  });
78
90
  }
79
- static getAllCustomPages(params) {
91
+ static getAllCustomPages(params, config) {
80
92
  return __awaiter(this, void 0, void 0, function* () {
81
- return CustomPageApiClient.getAllCustomPages(params);
93
+ return CustomPageApiClient.getAllCustomPages(params, config);
82
94
  });
83
95
  }
84
- static searchCustomPages(params) {
96
+ static searchCustomPages(params, config) {
85
97
  return __awaiter(this, void 0, void 0, function* () {
86
- return CustomPageApiClient.searchCustomPages(params);
98
+ return CustomPageApiClient.searchCustomPages(params, config);
87
99
  });
88
100
  }
89
101
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/services/custom_page/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,0EAAkD;AAGlD,uDAAkD;AAOlD;;GAEG;AAEH,MAAa,mBAAmB;IAC9B;;;OAGG;IACH,MAAM,CAAC,sBAAsB,CAAC,EAAU;QACtC,OAAO,IAAA,uBAAU,EAAC,mBAAS,CAAC,UAAU,CAAC,GAAG,CAAC,EAAC,EAAE,EAAC,CAAC,EAAE,mBAAS,CAAC,UAA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,iBAAiB,CAAC,MAAyB,EAAE,MAA2B;;YACnF,OAAO,mBAAmB,CAAC,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC/D,CAAC;KAAA;IACD,MAAM,CAAO,iBAAiB,CAAC,MAA+B,EAAE,MAA2B;;YACzF,OAAO,mBAAmB,CAAC,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC/D,CAAC;KAAA;CACF;AAVD,oCAUC"}
@@ -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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AGlE,qBAAqB,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAGhG"}
@@ -21,21 +21,24 @@ const Endpoints_1 = __importDefault(require("../../constants/Endpoints"));
21
21
  class DataPortabilityApiClient {
22
22
  /**
23
23
  * This endpoint generates data portability.
24
+ * @param config
24
25
  */
25
- static generateDataPortability() {
26
- return (0, apiRequest_1.apiRequest)(Endpoints_1.default.GenerateDataPortability.url({}), Endpoints_1.default.GenerateDataPortability.method);
26
+ static generateDataPortability(config) {
27
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.GenerateDataPortability.url({}), method: Endpoints_1.default.GenerateDataPortability.method }));
27
28
  }
28
29
  /**
29
30
  * This endpoint downloads data portability.
31
+ * @param config
30
32
  */
31
- static downloadDataPortability() {
32
- return (0, apiRequest_1.apiRequest)(Endpoints_1.default.DataPortabilityDownload.url({}), Endpoints_1.default.DataPortabilityDownload.method);
33
+ static downloadDataPortability(config) {
34
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.DataPortabilityDownload.url({}), method: Endpoints_1.default.DataPortabilityDownload.method }));
33
35
  }
34
36
  /**
35
37
  * This endpoint retrieves data portability status.
38
+ * @param config
36
39
  */
37
- static dataPortabilityStatus() {
38
- return (0, apiRequest_1.apiRequest)(Endpoints_1.default.DataPortabilityStatus.url({}), Endpoints_1.default.DataPortabilityStatus.method);
40
+ static dataPortabilityStatus(config) {
41
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.DataPortabilityStatus.url({}), method: Endpoints_1.default.DataPortabilityStatus.method }));
39
42
  }
40
43
  }
41
44
  exports.DataPortabilityApiClient = DataPortabilityApiClient;
@@ -56,22 +59,31 @@ exports.DataPortabilityApiClient = DataPortabilityApiClient;
56
59
  return await DataPortabilityService.generateDataPortability();
57
60
  }
58
61
  ```
62
+ ```jsx
63
+ If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
64
+
65
+ 1. Declare it(or declare them, it is possible to add multiple params)
66
+
67
+ const headers = headers: {Authorization: `Bearer ${yourToken}`}
68
+
69
+ 2. Add it inside the brackets and pass it to the function, as shown in the previous example!
70
+ ```
59
71
  :::
60
72
  */
61
73
  class DataPortabilityService {
62
- static generateDataPortability() {
74
+ static generateDataPortability(config) {
63
75
  return __awaiter(this, void 0, void 0, function* () {
64
- return DataPortabilityApiClient.generateDataPortability();
76
+ return DataPortabilityApiClient.generateDataPortability(config);
65
77
  });
66
78
  }
67
- static downloadDataPortability() {
79
+ static downloadDataPortability(config) {
68
80
  return __awaiter(this, void 0, void 0, function* () {
69
- return DataPortabilityApiClient.downloadDataPortability();
81
+ return DataPortabilityApiClient.downloadDataPortability(config);
70
82
  });
71
83
  }
72
- static dataPortabilityStatus() {
84
+ static dataPortabilityStatus(config) {
73
85
  return __awaiter(this, void 0, void 0, function* () {
74
- return DataPortabilityApiClient.dataPortabilityStatus();
86
+ return DataPortabilityApiClient.dataPortabilityStatus(config);
75
87
  });
76
88
  }
77
89
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/services/data_portability/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uDAAkD;AAClD,0EAAkD;AAQlD;;GAEG;AAEH,MAAa,wBAAwB;IACnC;;OAEG;IACH,MAAM,CAAC,uBAAuB;QAC5B,OAAO,IAAA,uBAAU,EAAC,mBAAS,CAAC,uBAAuB,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,mBAAS,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC;IACzG,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,uBAAuB;QAC5B,OAAO,IAAA,uBAAU,EAAC,mBAAS,CAAC,uBAAuB,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,mBAAS,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC;IACzG,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,qBAAqB;QAC1B,OAAO,IAAA,uBAAU,EAAC,mBAAS,CAAC,qBAAqB,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,mBAAS,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACrG,CAAC;CACF;AArBD,4DAqBC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAqB,sBAAsB;IACzC,MAAM,CAAO,uBAAuB;;YAClC,OAAO,wBAAwB,CAAC,uBAAuB,EAAE,CAAC;QAC5D,CAAC;KAAA;IACD,MAAM,CAAO,uBAAuB;;YAClC,OAAO,wBAAwB,CAAC,uBAAuB,EAAE,CAAC;QAC5D,CAAC;KAAA;IACD,MAAM,CAAO,qBAAqB;;YAChC,OAAO,wBAAwB,CAAC,qBAAqB,EAAE,CAAC;QAC1D,CAAC;KAAA;CACF;AAVD,yCAUC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/services/data_portability/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uDAAkD;AAClD,0EAAkD;AASlD;;GAEG;AAEH,MAAa,wBAAwB;IACnC;;;OAGG;IACH,MAAM,CAAC,uBAAuB,CAAC,MAA2B;QACxD,OAAO,IAAA,uBAAU,kCAAK,MAAM,KAAE,GAAG,EAAE,mBAAS,CAAC,uBAAuB,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,mBAAS,CAAC,uBAAuB,CAAC,MAAM,IAAE,CAAC;IACnI,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,uBAAuB,CAAC,MAA2B;QACxD,OAAO,IAAA,uBAAU,kCAAK,MAAM,KAAE,GAAG,EAAE,mBAAS,CAAC,uBAAuB,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,mBAAS,CAAC,uBAAuB,CAAC,MAAM,IAAE,CAAC;IACnI,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,qBAAqB,CAAC,MAA2B;QACtD,OAAO,IAAA,uBAAU,kCAAK,MAAM,KAAE,GAAG,EAAE,mBAAS,CAAC,qBAAqB,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,mBAAS,CAAC,qBAAqB,CAAC,MAAM,IAAE,CAAC;IAC/H,CAAC;CACF;AAxBD,4DAwBC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAqB,sBAAsB;IACzC,MAAM,CAAO,uBAAuB,CAAC,MAA2B;;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;AAVD,yCAUC"}
@@ -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,EAAC,MAAM,aAAa,CAAC;AAGrG,OAAO,EAAC,WAAW,EAAE,cAAc,EAAC,MAAM,sBAAsB,CAAC;AAEjE,MAAM,WAAW,uBAAuB;IACtC,YAAY,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC,CAAC;IAChF,WAAW,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACrD,WAAW,CAAC,MAAM,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC,CAAC;IACnF,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACnD,oBAAoB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACjF,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAChF,YAAY,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC,CAAC;IACnG,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC,CAAC;CAChF;AACD;;GAEG;A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AAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC;WAI/E,oBAAoB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,iBAAiB,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC;WAI7G,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,iBAAiB,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC;WAI5G,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"}
@@ -22,70 +22,78 @@ class EmbedApiClient {
22
22
  /**
23
23
  * This endpoint retrieves all embeds.
24
24
  * @param params
25
+ * @param config
25
26
  */
26
- static getAllEmbeds(params) {
27
+ static getAllEmbeds(params, config) {
27
28
  const p = new URLSearchParams(params);
28
- return (0, apiRequest_1.apiRequest)(`${Endpoints_1.default.EmbedList.url({})}?${p.toString()}`, Endpoints_1.default.EmbedList.method);
29
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: `${Endpoints_1.default.EmbedList.url({})}?${p.toString()}`, method: Endpoints_1.default.EmbedList.method }));
29
30
  }
30
31
  /**
31
32
  * This endpoint creates an embed. This operation requires admin role.
32
33
  * @param data
34
+ * @param config
33
35
  */
34
- static createEmbed(data) {
35
- return (0, apiRequest_1.apiRequest)(Endpoints_1.default.EmbedCreate.url({}), Endpoints_1.default.EmbedCreate.method, data);
36
+ static createEmbed(data, config) {
37
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.EmbedCreate.url({}), method: Endpoints_1.default.EmbedCreate.method, data }));
36
38
  }
37
39
  /**
38
40
  * This endpoint performs embed search.
39
41
  * @param params
42
+ * @param config
40
43
  */
41
- static searchEmbed(params) {
44
+ static searchEmbed(params, config) {
42
45
  const p = new URLSearchParams(params);
43
- return (0, apiRequest_1.apiRequest)(`${Endpoints_1.default.EmbedSearch.url({})}?${p.toString()}`, Endpoints_1.default.EmbedSearch.method);
46
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: `${Endpoints_1.default.EmbedSearch.url({})}?${p.toString()}`, method: Endpoints_1.default.EmbedSearch.method }));
44
47
  }
45
48
  /**
46
49
  * This endpoint retrieves a specific embed using ID.
47
50
  * @param id
51
+ * @param config
48
52
  */
49
- static getSpecificEmbed(id) {
50
- return (0, apiRequest_1.apiRequest)(Endpoints_1.default.Embed.url({ id }), Endpoints_1.default.Embed.method);
53
+ static getSpecificEmbed(id, config) {
54
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.Embed.url({ id }), method: Endpoints_1.default.Embed.method }));
51
55
  }
52
56
  /**
53
57
  * This endpoint updates a specific embed. This operation requires admin role.
54
58
  * @param id
55
59
  * @param data
60
+ * @param config
56
61
  */
57
- static updateASpecificEmbed(id, data) {
58
- return (0, apiRequest_1.apiRequest)(Endpoints_1.default.UpdateEmbed.url({ id }), Endpoints_1.default.UpdateEmbed.method, data);
62
+ static updateASpecificEmbed(id, data, config) {
63
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.UpdateEmbed.url({ id }), method: Endpoints_1.default.UpdateEmbed.method, data: data }));
59
64
  }
60
65
  /**
61
66
  * This endpoint patches a specific embed. This operation requires admin role.
62
67
  * @param id
63
68
  * @param data
69
+ * @param config
64
70
  */
65
- static patchASpecificEmbed(id, data) {
66
- return (0, apiRequest_1.apiRequest)(Endpoints_1.default.PatchEmbed.url({ id }), Endpoints_1.default.PatchEmbed.method, data);
71
+ static patchASpecificEmbed(id, data, config) {
72
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.PatchEmbed.url({ id }), method: Endpoints_1.default.PatchEmbed.method, data: data }));
67
73
  }
68
74
  /**
69
75
  * This endpoint retrieves the embed's feed which contains Feed that has the Embed as associated media.
70
76
  * @param embed_type
71
77
  * @param embed_id
78
+ * @param config
72
79
  */
73
- static getEmbedFeed(embed_type, embed_id) {
80
+ static getEmbedFeed(embed_type, embed_id, config) {
74
81
  const p = new URLSearchParams({ embed_type: embed_type, embed_id: embed_id });
75
- return (0, apiRequest_1.apiRequest)(`${Endpoints_1.default.EmbedFeed.url({})}?${p.toString()}`, Endpoints_1.default.EmbedFeed.method);
82
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: `${Endpoints_1.default.EmbedFeed.url({})}?${p.toString()}`, method: Endpoints_1.default.EmbedFeed.method }));
76
83
  }
77
84
  /**
78
85
  * This endpoint retrieves the embed's feed which contains Feed that has an Embed as associated media.
79
86
  * @param id
87
+ * @param config
80
88
  */
81
- static getSpecificEmbedFeed(id) {
82
- return (0, apiRequest_1.apiRequest)(Endpoints_1.default.SpecificEmbedFeed.url({ id }), Endpoints_1.default.SpecificEmbedFeed.method);
89
+ static getSpecificEmbedFeed(id, config) {
90
+ return (0, apiRequest_1.apiRequest)(Object.assign(Object.assign({}, config), { url: Endpoints_1.default.SpecificEmbedFeed.url({ id }), method: Endpoints_1.default.SpecificEmbedFeed.method }));
83
91
  }
84
92
  }
85
93
  exports.EmbedApiClient = EmbedApiClient;
86
94
  /**
87
95
  *
88
- :::tipEmbed service can be used in the following ways:
96
+ :::tipEmbed service can be used in the following way:
89
97
 
90
98
  ```jsx
91
99
  1. Import the service from our library:
@@ -107,47 +115,56 @@ exports.EmbedApiClient = EmbedApiClient;
107
115
  return await EmbedService.getSpecificEmbed(embedId);
108
116
  }
109
117
  ```
118
+ ```jsx
119
+ If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
120
+
121
+ 1. Declare it(or declare them, it is possible to add multiple params)
122
+
123
+ const headers = headers: {Authorization: `Bearer ${yourToken}`}
124
+
125
+ 2. Add it inside the brackets and pass it to the function, as shown in the previous example!
126
+ ```
110
127
  :::
111
128
  */
112
129
  class EmbedService {
113
- static getAllEmbeds(params) {
130
+ static getAllEmbeds(params, config) {
114
131
  return __awaiter(this, void 0, void 0, function* () {
115
- return EmbedApiClient.getAllEmbeds(params);
132
+ return EmbedApiClient.getAllEmbeds(params, config);
116
133
  });
117
134
  }
118
- static searchEmbed(params) {
135
+ static searchEmbed(params, config) {
119
136
  return __awaiter(this, void 0, void 0, function* () {
120
- return EmbedApiClient.searchEmbed(params);
137
+ return EmbedApiClient.searchEmbed(params, config);
121
138
  });
122
139
  }
123
- static createEmbed(data) {
140
+ static createEmbed(data, config) {
124
141
  return __awaiter(this, void 0, void 0, function* () {
125
- return EmbedApiClient.createEmbed(data);
142
+ return EmbedApiClient.createEmbed(data, config);
126
143
  });
127
144
  }
128
- static getSpecificEmbed(id) {
145
+ static getSpecificEmbed(id, config) {
129
146
  return __awaiter(this, void 0, void 0, function* () {
130
- return EmbedApiClient.getSpecificEmbed(id);
147
+ return EmbedApiClient.getSpecificEmbed(id, config);
131
148
  });
132
149
  }
133
- static updateASpecificEmbed(id, data) {
150
+ static updateASpecificEmbed(id, data, config) {
134
151
  return __awaiter(this, void 0, void 0, function* () {
135
- return EmbedApiClient.updateASpecificEmbed(id, data);
152
+ return EmbedApiClient.updateASpecificEmbed(id, data, config);
136
153
  });
137
154
  }
138
- static patchASpecificEmbed(id, data) {
155
+ static patchASpecificEmbed(id, data, config) {
139
156
  return __awaiter(this, void 0, void 0, function* () {
140
- return EmbedApiClient.patchASpecificEmbed(id, data);
157
+ return EmbedApiClient.patchASpecificEmbed(id, data, config);
141
158
  });
142
159
  }
143
- static getEmbedFeed(embed_type, embed_id) {
160
+ static getEmbedFeed(embed_type, embed_id, config) {
144
161
  return __awaiter(this, void 0, void 0, function* () {
145
- return EmbedApiClient.getEmbedFeed(embed_type, embed_id);
162
+ return EmbedApiClient.getEmbedFeed(embed_type, embed_id, config);
146
163
  });
147
164
  }
148
- static getSpecificEmbedFeed(id) {
165
+ static getSpecificEmbedFeed(id, config) {
149
166
  return __awaiter(this, void 0, void 0, function* () {
150
- return EmbedApiClient.getSpecificEmbedFeed(id);
167
+ return EmbedApiClient.getSpecificEmbedFeed(id, config);
151
168
  });
152
169
  }
153
170
  }