@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.
- package/lib/cjs/services/category/index.d.ts +76 -49
- package/lib/cjs/services/category/index.d.ts.map +1 -1
- package/lib/cjs/services/category/index.js +91 -65
- package/lib/cjs/services/category/index.js.map +1 -1
- package/lib/cjs/services/comment/index.d.ts +55 -34
- package/lib/cjs/services/comment/index.d.ts.map +1 -1
- package/lib/cjs/services/comment/index.js +65 -45
- package/lib/cjs/services/comment/index.js.map +1 -1
- package/lib/cjs/services/custom_adv/index.d.ts +23 -10
- package/lib/cjs/services/custom_adv/index.d.ts.map +1 -1
- package/lib/cjs/services/custom_adv/index.js +25 -13
- package/lib/cjs/services/custom_adv/index.js.map +1 -1
- package/lib/cjs/services/custom_page/index.d.ts +23 -10
- package/lib/cjs/services/custom_page/index.d.ts.map +1 -1
- package/lib/cjs/services/custom_page/index.js +25 -13
- package/lib/cjs/services/custom_page/index.js.map +1 -1
- package/lib/cjs/services/data_portability/index.d.ts +22 -9
- package/lib/cjs/services/data_portability/index.d.ts.map +1 -1
- package/lib/cjs/services/data_portability/index.js +24 -12
- package/lib/cjs/services/data_portability/index.js.map +1 -1
- package/lib/cjs/services/embed/index.d.ts +43 -25
- package/lib/cjs/services/embed/index.d.ts.map +1 -1
- package/lib/cjs/services/embed/index.js +50 -33
- package/lib/cjs/services/embed/index.js.map +1 -1
- package/lib/cjs/services/feature/index.d.ts +14 -3
- package/lib/cjs/services/feature/index.d.ts.map +1 -1
- package/lib/cjs/services/feature/index.js +14 -4
- package/lib/cjs/services/feature/index.js.map +1 -1
- package/lib/cjs/services/feed/index.d.ts +32 -17
- package/lib/cjs/services/feed/index.d.ts.map +1 -1
- package/lib/cjs/services/feed/index.js +36 -22
- package/lib/cjs/services/feed/index.js.map +1 -1
- package/lib/cjs/services/feed_object/index.d.ts +118 -81
- package/lib/cjs/services/feed_object/index.d.ts.map +1 -1
- package/lib/cjs/services/feed_object/index.js +143 -107
- package/lib/cjs/services/feed_object/index.js.map +1 -1
- package/lib/cjs/services/incubator/index.d.ts +39 -22
- package/lib/cjs/services/incubator/index.d.ts.map +1 -1
- package/lib/cjs/services/incubator/index.js +45 -29
- package/lib/cjs/services/incubator/index.js.map +1 -1
- package/lib/cjs/services/insight/index.d.ts +35 -19
- package/lib/cjs/services/insight/index.d.ts.map +1 -1
- package/lib/cjs/services/insight/index.js +40 -25
- package/lib/cjs/services/insight/index.js.map +1 -1
- package/lib/cjs/services/legal_page/index.d.ts +35 -19
- package/lib/cjs/services/legal_page/index.d.ts.map +1 -1
- package/lib/cjs/services/legal_page/index.js +40 -25
- package/lib/cjs/services/legal_page/index.js.map +1 -1
- package/lib/cjs/services/locality/index.d.ts +18 -6
- package/lib/cjs/services/locality/index.d.ts.map +1 -1
- package/lib/cjs/services/locality/index.js +19 -8
- package/lib/cjs/services/locality/index.js.map +1 -1
- package/lib/cjs/services/loyalty/index.d.ts +48 -29
- package/lib/cjs/services/loyalty/index.d.ts.map +1 -1
- package/lib/cjs/services/loyalty/index.js +56 -38
- package/lib/cjs/services/loyalty/index.js.map +1 -1
- package/lib/cjs/services/media/index.d.ts +42 -22
- package/lib/cjs/services/media/index.d.ts.map +1 -1
- package/lib/cjs/services/media/index.js +48 -29
- package/lib/cjs/services/media/index.js.map +1 -1
- package/lib/cjs/services/moderation/index.d.ts +33 -19
- package/lib/cjs/services/moderation/index.d.ts.map +1 -1
- package/lib/cjs/services/moderation/index.js +40 -27
- package/lib/cjs/services/moderation/index.js.map +1 -1
- package/lib/cjs/services/notification/index.d.ts +47 -28
- package/lib/cjs/services/notification/index.d.ts.map +1 -1
- package/lib/cjs/services/notification/index.js +55 -37
- package/lib/cjs/services/notification/index.js.map +1 -1
- package/lib/cjs/services/preference/index.d.ts +23 -10
- package/lib/cjs/services/preference/index.d.ts.map +1 -1
- package/lib/cjs/services/preference/index.js +25 -13
- package/lib/cjs/services/preference/index.js.map +1 -1
- package/lib/cjs/services/private_message/index.d.ts +51 -31
- package/lib/cjs/services/private_message/index.d.ts.map +1 -1
- package/lib/cjs/services/private_message/index.js +60 -41
- package/lib/cjs/services/private_message/index.js.map +1 -1
- package/lib/cjs/services/score/index.d.ts +22 -9
- package/lib/cjs/services/score/index.d.ts.map +1 -1
- package/lib/cjs/services/score/index.js +24 -12
- package/lib/cjs/services/score/index.js.map +1 -1
- package/lib/cjs/services/sso/index.d.ts +18 -6
- package/lib/cjs/services/sso/index.d.ts.map +1 -1
- package/lib/cjs/services/sso/index.js +19 -8
- package/lib/cjs/services/sso/index.js.map +1 -1
- package/lib/cjs/services/suggestion/index.d.ts +26 -12
- package/lib/cjs/services/suggestion/index.d.ts.map +1 -1
- package/lib/cjs/services/suggestion/index.js +29 -16
- package/lib/cjs/services/suggestion/index.js.map +1 -1
- package/lib/cjs/services/tag/index.d.ts +39 -22
- package/lib/cjs/services/tag/index.d.ts.map +1 -1
- package/lib/cjs/services/tag/index.js +45 -29
- package/lib/cjs/services/tag/index.js.map +1 -1
- package/lib/cjs/services/user/index.d.ts +204 -145
- package/lib/cjs/services/user/index.d.ts.map +1 -1
- package/lib/cjs/services/user/index.js +259 -201
- package/lib/cjs/services/user/index.js.map +1 -1
- package/lib/cjs/services/webhook/index.d.ts +59 -37
- package/lib/cjs/services/webhook/index.d.ts.map +1 -1
- package/lib/cjs/services/webhook/index.js +70 -49
- package/lib/cjs/services/webhook/index.js.map +1 -1
- package/lib/cjs/utils/apiRequest.d.ts +2 -1
- package/lib/cjs/utils/apiRequest.d.ts.map +1 -1
- package/lib/cjs/utils/apiRequest.js +4 -8
- package/lib/cjs/utils/apiRequest.js.map +1 -1
- package/lib/esm/services/category/index.d.ts +76 -49
- package/lib/esm/services/category/index.d.ts.map +1 -1
- package/lib/esm/services/category/index.js +91 -65
- package/lib/esm/services/category/index.js.map +1 -1
- package/lib/esm/services/comment/index.d.ts +55 -34
- package/lib/esm/services/comment/index.d.ts.map +1 -1
- package/lib/esm/services/comment/index.js +65 -45
- package/lib/esm/services/comment/index.js.map +1 -1
- package/lib/esm/services/custom_adv/index.d.ts +23 -10
- package/lib/esm/services/custom_adv/index.d.ts.map +1 -1
- package/lib/esm/services/custom_adv/index.js +25 -13
- package/lib/esm/services/custom_adv/index.js.map +1 -1
- package/lib/esm/services/custom_page/index.d.ts +23 -10
- package/lib/esm/services/custom_page/index.d.ts.map +1 -1
- package/lib/esm/services/custom_page/index.js +25 -13
- package/lib/esm/services/custom_page/index.js.map +1 -1
- package/lib/esm/services/data_portability/index.d.ts +22 -9
- package/lib/esm/services/data_portability/index.d.ts.map +1 -1
- package/lib/esm/services/data_portability/index.js +24 -12
- package/lib/esm/services/data_portability/index.js.map +1 -1
- package/lib/esm/services/embed/index.d.ts +43 -25
- package/lib/esm/services/embed/index.d.ts.map +1 -1
- package/lib/esm/services/embed/index.js +50 -33
- package/lib/esm/services/embed/index.js.map +1 -1
- package/lib/esm/services/feature/index.d.ts +14 -3
- package/lib/esm/services/feature/index.d.ts.map +1 -1
- package/lib/esm/services/feature/index.js +14 -4
- package/lib/esm/services/feature/index.js.map +1 -1
- package/lib/esm/services/feed/index.d.ts +32 -17
- package/lib/esm/services/feed/index.d.ts.map +1 -1
- package/lib/esm/services/feed/index.js +36 -22
- package/lib/esm/services/feed/index.js.map +1 -1
- package/lib/esm/services/feed_object/index.d.ts +118 -81
- package/lib/esm/services/feed_object/index.d.ts.map +1 -1
- package/lib/esm/services/feed_object/index.js +143 -107
- package/lib/esm/services/feed_object/index.js.map +1 -1
- package/lib/esm/services/incubator/index.d.ts +39 -22
- package/lib/esm/services/incubator/index.d.ts.map +1 -1
- package/lib/esm/services/incubator/index.js +45 -29
- package/lib/esm/services/incubator/index.js.map +1 -1
- package/lib/esm/services/insight/index.d.ts +35 -19
- package/lib/esm/services/insight/index.d.ts.map +1 -1
- package/lib/esm/services/insight/index.js +40 -25
- package/lib/esm/services/insight/index.js.map +1 -1
- package/lib/esm/services/legal_page/index.d.ts +35 -19
- package/lib/esm/services/legal_page/index.d.ts.map +1 -1
- package/lib/esm/services/legal_page/index.js +40 -25
- package/lib/esm/services/legal_page/index.js.map +1 -1
- package/lib/esm/services/locality/index.d.ts +18 -6
- package/lib/esm/services/locality/index.d.ts.map +1 -1
- package/lib/esm/services/locality/index.js +19 -8
- package/lib/esm/services/locality/index.js.map +1 -1
- package/lib/esm/services/loyalty/index.d.ts +48 -29
- package/lib/esm/services/loyalty/index.d.ts.map +1 -1
- package/lib/esm/services/loyalty/index.js +56 -38
- package/lib/esm/services/loyalty/index.js.map +1 -1
- package/lib/esm/services/media/index.d.ts +42 -22
- package/lib/esm/services/media/index.d.ts.map +1 -1
- package/lib/esm/services/media/index.js +48 -29
- package/lib/esm/services/media/index.js.map +1 -1
- package/lib/esm/services/moderation/index.d.ts +33 -19
- package/lib/esm/services/moderation/index.d.ts.map +1 -1
- package/lib/esm/services/moderation/index.js +40 -27
- package/lib/esm/services/moderation/index.js.map +1 -1
- package/lib/esm/services/notification/index.d.ts +47 -28
- package/lib/esm/services/notification/index.d.ts.map +1 -1
- package/lib/esm/services/notification/index.js +55 -37
- package/lib/esm/services/notification/index.js.map +1 -1
- package/lib/esm/services/preference/index.d.ts +23 -10
- package/lib/esm/services/preference/index.d.ts.map +1 -1
- package/lib/esm/services/preference/index.js +25 -13
- package/lib/esm/services/preference/index.js.map +1 -1
- package/lib/esm/services/private_message/index.d.ts +51 -31
- package/lib/esm/services/private_message/index.d.ts.map +1 -1
- package/lib/esm/services/private_message/index.js +60 -41
- package/lib/esm/services/private_message/index.js.map +1 -1
- package/lib/esm/services/score/index.d.ts +22 -9
- package/lib/esm/services/score/index.d.ts.map +1 -1
- package/lib/esm/services/score/index.js +24 -12
- package/lib/esm/services/score/index.js.map +1 -1
- package/lib/esm/services/sso/index.d.ts +18 -6
- package/lib/esm/services/sso/index.d.ts.map +1 -1
- package/lib/esm/services/sso/index.js +19 -8
- package/lib/esm/services/sso/index.js.map +1 -1
- package/lib/esm/services/suggestion/index.d.ts +26 -12
- package/lib/esm/services/suggestion/index.d.ts.map +1 -1
- package/lib/esm/services/suggestion/index.js +29 -16
- package/lib/esm/services/suggestion/index.js.map +1 -1
- package/lib/esm/services/tag/index.d.ts +39 -22
- package/lib/esm/services/tag/index.d.ts.map +1 -1
- package/lib/esm/services/tag/index.js +45 -29
- package/lib/esm/services/tag/index.js.map +1 -1
- package/lib/esm/services/user/index.d.ts +204 -145
- package/lib/esm/services/user/index.d.ts.map +1 -1
- package/lib/esm/services/user/index.js +259 -201
- package/lib/esm/services/user/index.js.map +1 -1
- package/lib/esm/services/webhook/index.d.ts +59 -37
- package/lib/esm/services/webhook/index.d.ts.map +1 -1
- package/lib/esm/services/webhook/index.js +70 -49
- package/lib/esm/services/webhook/index.js.map +1 -1
- package/lib/esm/utils/apiRequest.d.ts +2 -1
- package/lib/esm/utils/apiRequest.d.ts.map +1 -1
- package/lib/esm/utils/apiRequest.js +4 -8
- package/lib/esm/utils/apiRequest.js.map +1 -1
- package/lib/umd/api-services.js +1 -1
- package/lib/umd/api-services.js.map +1 -1
- package/package.json +4 -4
|
@@ -15,9 +15,10 @@ import Endpoints from '../../constants/Endpoints';
|
|
|
15
15
|
export class PreferenceApiClient {
|
|
16
16
|
/**
|
|
17
17
|
* This endpoint retrieves all available dynamic preferences.
|
|
18
|
+
* @param config
|
|
18
19
|
*/
|
|
19
|
-
static getAllPreferences() {
|
|
20
|
-
return apiRequest(Endpoints.Preferences.url({}), Endpoints.Preferences.method);
|
|
20
|
+
static getAllPreferences(config) {
|
|
21
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.Preferences.url({}), method: Endpoints.Preferences.method }));
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
23
24
|
* This endpoint searches dynamic preferences.
|
|
@@ -25,22 +26,24 @@ export class PreferenceApiClient {
|
|
|
25
26
|
* @param section
|
|
26
27
|
* @param keys
|
|
27
28
|
* @param ordering
|
|
29
|
+
* @param config
|
|
28
30
|
*/
|
|
29
|
-
static searchPreferences(search, section, keys, ordering) {
|
|
31
|
+
static searchPreferences(search, section, keys, ordering, config) {
|
|
30
32
|
const params = new URLSearchParams(Object.assign(Object.assign(Object.assign(Object.assign({}, (search && { search: search })), (section && { section: section })), (keys && { keys: keys })), (ordering && { ordering: ordering })));
|
|
31
|
-
return apiRequest(`${Endpoints.Preferences.url({})}?${params.toString()}`, Endpoints.Preferences.method);
|
|
33
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: `${Endpoints.Preferences.url({})}?${params.toString()}`, method: Endpoints.Preferences.method }));
|
|
32
34
|
}
|
|
33
35
|
/**
|
|
34
36
|
* This endpoint retrieves a specific dynamic preference.
|
|
35
37
|
* @param id
|
|
38
|
+
* @param config
|
|
36
39
|
*/
|
|
37
|
-
static getSpecificPreference(id) {
|
|
38
|
-
return apiRequest(Endpoints.GetPreference.url({ id }), Endpoints.Preferences.method);
|
|
40
|
+
static getSpecificPreference(id, config) {
|
|
41
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.GetPreference.url({ id }), method: Endpoints.Preferences.method }));
|
|
39
42
|
}
|
|
40
43
|
}
|
|
41
44
|
/**
|
|
42
45
|
*
|
|
43
|
-
:::tipPreference service can be used in the following
|
|
46
|
+
:::tipPreference service can be used in the following way:
|
|
44
47
|
|
|
45
48
|
```jsx
|
|
46
49
|
1. Import the service from our library:
|
|
@@ -62,22 +65,31 @@ export class PreferenceApiClient {
|
|
|
62
65
|
return await PreferenceService.getSpecificPreference(preferenceId);
|
|
63
66
|
}
|
|
64
67
|
```
|
|
68
|
+
```jsx
|
|
69
|
+
If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
|
|
70
|
+
|
|
71
|
+
1. Declare it(or declare them, it is possible to add multiple params)
|
|
72
|
+
|
|
73
|
+
const headers = headers: {Authorization: `Bearer ${yourToken}`}
|
|
74
|
+
|
|
75
|
+
2. Add it inside the brackets and pass it to the function, as shown in the previous example!
|
|
76
|
+
```
|
|
65
77
|
:::
|
|
66
78
|
*/
|
|
67
79
|
export default class PreferenceService {
|
|
68
|
-
static getAllPreferences() {
|
|
80
|
+
static getAllPreferences(config) {
|
|
69
81
|
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
-
return PreferenceApiClient.getAllPreferences();
|
|
82
|
+
return PreferenceApiClient.getAllPreferences(config);
|
|
71
83
|
});
|
|
72
84
|
}
|
|
73
|
-
static searchPreferences(search, section, keys, ordering) {
|
|
85
|
+
static searchPreferences(search, section, keys, ordering, config) {
|
|
74
86
|
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
-
return PreferenceApiClient.searchPreferences(search, section, keys, ordering);
|
|
87
|
+
return PreferenceApiClient.searchPreferences(search, section, keys, ordering, config);
|
|
76
88
|
});
|
|
77
89
|
}
|
|
78
|
-
static getSpecificPreference(id) {
|
|
90
|
+
static getSpecificPreference(id, config) {
|
|
79
91
|
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
-
return PreferenceApiClient.getSpecificPreference(id);
|
|
92
|
+
return PreferenceApiClient.getSpecificPreference(id, config);
|
|
81
93
|
});
|
|
82
94
|
}
|
|
83
95
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/services/preference/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAClD,OAAO,SAAS,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/services/preference/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAClD,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAgBlD;;GAEG;AAEH,MAAM,OAAO,mBAAmB;IAC9B;;;OAGG;IACH,MAAM,CAAC,iBAAiB,CAAC,MAA2B;QAClD,OAAO,UAAU,iCAAK,MAAM,KAAE,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,CAC5B,MAAe,EACf,OAAgB,EAChB,IAAa,EACb,QAAiB,EACjB,MAA2B;;YAE3B,OAAO,mBAAmB,CAAC,iBAAiB,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QACxF,CAAC;KAAA;IAED,MAAM,CAAO,qBAAqB,CAAC,EAAU,EAAE,MAA2B;;YACxE,OAAO,mBAAmB,CAAC,qBAAqB,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QAC/D,CAAC;KAAA;CACF"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { MessageChunkUploadDoneParams, MessageCreateParams, MessageMediaChunksParams, MessageMediaUploadParams, MessageThumbnailUploadParams, SCPaginatedResponse, ThreadParams } from '../../types';
|
|
2
2
|
import { SCPrivateMessageType, SCPrivateMessageUploadMediaChunkType, SCPrivateMessageUploadMediaType, SCPrivateMessageUploadThumbnailType } from '@selfcommunity/types';
|
|
3
|
+
import { AxiosRequestConfig } from 'axios';
|
|
3
4
|
export interface PrivateMessageApiClientInterface {
|
|
4
|
-
getAllSnippets(): Promise<SCPaginatedResponse<SCPrivateMessageType>>;
|
|
5
|
-
getAThread(data: ThreadParams): Promise<SCPaginatedResponse<SCPrivateMessageType>>;
|
|
6
|
-
getASingleMessage(id: number): Promise<SCPrivateMessageType>;
|
|
7
|
-
sendAMessage(data: MessageCreateParams): Promise<SCPrivateMessageType>;
|
|
8
|
-
deleteAMessage(id: number): Promise<any>;
|
|
9
|
-
deleteAThread(id: number): Promise<any>;
|
|
10
|
-
uploadMedia(data: MessageMediaUploadParams): Promise<SCPrivateMessageUploadMediaType>;
|
|
11
|
-
uploadThumbnail(data: MessageThumbnailUploadParams): Promise<SCPrivateMessageUploadThumbnailType>;
|
|
12
|
-
uploadMediaInChunks(data: MessageMediaChunksParams): Promise<SCPrivateMessageUploadMediaChunkType>;
|
|
13
|
-
chunkUploadDone(data: MessageChunkUploadDoneParams): Promise<SCPrivateMessageUploadMediaType>;
|
|
5
|
+
getAllSnippets(config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPrivateMessageType>>;
|
|
6
|
+
getAThread(data: ThreadParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPrivateMessageType>>;
|
|
7
|
+
getASingleMessage(id: number, config?: AxiosRequestConfig): Promise<SCPrivateMessageType>;
|
|
8
|
+
sendAMessage(data: MessageCreateParams, config?: AxiosRequestConfig): Promise<SCPrivateMessageType>;
|
|
9
|
+
deleteAMessage(id: number, config?: AxiosRequestConfig): Promise<any>;
|
|
10
|
+
deleteAThread(id: number, config?: AxiosRequestConfig): Promise<any>;
|
|
11
|
+
uploadMedia(data: MessageMediaUploadParams, config?: AxiosRequestConfig): Promise<SCPrivateMessageUploadMediaType>;
|
|
12
|
+
uploadThumbnail(data: MessageThumbnailUploadParams, config?: AxiosRequestConfig): Promise<SCPrivateMessageUploadThumbnailType>;
|
|
13
|
+
uploadMediaInChunks(data: MessageMediaChunksParams, config?: AxiosRequestConfig): Promise<SCPrivateMessageUploadMediaChunkType>;
|
|
14
|
+
chunkUploadDone(data: MessageChunkUploadDoneParams, config?: AxiosRequestConfig): Promise<SCPrivateMessageUploadMediaType>;
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
17
|
* Contains all the endpoints needed to manage private messages.
|
|
@@ -18,57 +19,67 @@ export interface PrivateMessageApiClientInterface {
|
|
|
18
19
|
export declare class PrivateMessageApiClient {
|
|
19
20
|
/**
|
|
20
21
|
* This endpoint retrieves all snippets.
|
|
22
|
+
* @param config
|
|
21
23
|
*/
|
|
22
|
-
static getAllSnippets(): Promise<SCPaginatedResponse<SCPrivateMessageType>>;
|
|
24
|
+
static getAllSnippets(config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPrivateMessageType>>;
|
|
23
25
|
/**
|
|
24
26
|
* This endpoint retrieves all messages in a thread.
|
|
25
27
|
* @param data
|
|
28
|
+
* @param config
|
|
26
29
|
*/
|
|
27
|
-
static getAThread(data: ThreadParams): Promise<SCPaginatedResponse<SCPrivateMessageType>>;
|
|
30
|
+
static getAThread(data: ThreadParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPrivateMessageType>>;
|
|
28
31
|
/**
|
|
29
32
|
* This endpoint retrieves a single message using ID.
|
|
30
33
|
* @param id
|
|
34
|
+
* @param config
|
|
31
35
|
*/
|
|
32
|
-
static getASingleMessage(id: number): Promise<SCPrivateMessageType>;
|
|
36
|
+
static getASingleMessage(id: number, config?: AxiosRequestConfig): Promise<SCPrivateMessageType>;
|
|
33
37
|
/**
|
|
34
38
|
* This endpoint sends a message.
|
|
35
39
|
* @param data
|
|
40
|
+
* @param config
|
|
36
41
|
*/
|
|
37
|
-
static sendAMessage(data: MessageCreateParams): Promise<SCPrivateMessageType>;
|
|
42
|
+
static sendAMessage(data: MessageCreateParams, config?: AxiosRequestConfig): Promise<SCPrivateMessageType>;
|
|
38
43
|
/**
|
|
39
44
|
* This endpoint deletes a single message.
|
|
40
45
|
* @param id
|
|
46
|
+
* @param config
|
|
41
47
|
*/
|
|
42
|
-
static deleteAMessage(id: number): Promise<any>;
|
|
48
|
+
static deleteAMessage(id: number, config?: AxiosRequestConfig): Promise<any>;
|
|
43
49
|
/**
|
|
44
50
|
* This endpoint deletes a thread.
|
|
45
51
|
* @param id
|
|
52
|
+
* @param config
|
|
46
53
|
*/
|
|
47
|
-
static deleteAThread(id: number): Promise<any>;
|
|
54
|
+
static deleteAThread(id: number, config?: AxiosRequestConfig): Promise<any>;
|
|
48
55
|
/**
|
|
49
56
|
* This endpoint uploads a media.
|
|
50
57
|
* @param data
|
|
58
|
+
* @param config
|
|
51
59
|
*/
|
|
52
|
-
static uploadMedia(data: MessageMediaUploadParams): Promise<SCPrivateMessageUploadMediaType>;
|
|
60
|
+
static uploadMedia(data: MessageMediaUploadParams, config?: AxiosRequestConfig): Promise<SCPrivateMessageUploadMediaType>;
|
|
53
61
|
/**
|
|
54
62
|
* This endpoint uploads a thumbnail.
|
|
55
63
|
* @param data
|
|
64
|
+
* @param config
|
|
56
65
|
*/
|
|
57
|
-
static uploadThumbnail(data: MessageThumbnailUploadParams): Promise<SCPrivateMessageUploadThumbnailType>;
|
|
66
|
+
static uploadThumbnail(data: MessageThumbnailUploadParams, config?: AxiosRequestConfig): Promise<SCPrivateMessageUploadThumbnailType>;
|
|
58
67
|
/**
|
|
59
68
|
* This endpoint performs the chunk upload of a file.
|
|
60
69
|
* @param data
|
|
70
|
+
* @param config
|
|
61
71
|
*/
|
|
62
|
-
static uploadMediaInChunks(data: MessageMediaChunksParams): Promise<SCPrivateMessageUploadMediaChunkType>;
|
|
72
|
+
static uploadMediaInChunks(data: MessageMediaChunksParams, config?: AxiosRequestConfig): Promise<SCPrivateMessageUploadMediaChunkType>;
|
|
63
73
|
/**
|
|
64
74
|
* This endpoint finalizes the chunk upload and creates the file.
|
|
65
75
|
* @param data
|
|
76
|
+
* @param config
|
|
66
77
|
*/
|
|
67
|
-
static chunkUploadDone(data: MessageChunkUploadDoneParams): Promise<SCPrivateMessageUploadMediaType>;
|
|
78
|
+
static chunkUploadDone(data: MessageChunkUploadDoneParams, config?: AxiosRequestConfig): Promise<SCPrivateMessageUploadMediaType>;
|
|
68
79
|
}
|
|
69
80
|
/**
|
|
70
81
|
*
|
|
71
|
-
:::tipPrivate Message service can be used in the following
|
|
82
|
+
:::tipPrivate Message service can be used in the following way:
|
|
72
83
|
|
|
73
84
|
```jsx
|
|
74
85
|
1. Import the service from our library:
|
|
@@ -90,18 +101,27 @@ export declare class PrivateMessageApiClient {
|
|
|
90
101
|
return await PrivateMessageService.getASingleMessage(messageId);
|
|
91
102
|
}
|
|
92
103
|
```
|
|
104
|
+
```jsx
|
|
105
|
+
If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
|
|
106
|
+
|
|
107
|
+
1. Declare it(or declare them, it is possible to add multiple params)
|
|
108
|
+
|
|
109
|
+
const headers = headers: {Authorization: `Bearer ${yourToken}`}
|
|
110
|
+
|
|
111
|
+
2. Add it inside the brackets and pass it to the function, as shown in the previous example!
|
|
112
|
+
```
|
|
93
113
|
:::
|
|
94
114
|
*/
|
|
95
115
|
export default class PrivateMessageService {
|
|
96
|
-
static getAllSnippets(): Promise<SCPaginatedResponse<SCPrivateMessageType>>;
|
|
97
|
-
static getAThread(data: ThreadParams): Promise<SCPaginatedResponse<SCPrivateMessageType>>;
|
|
98
|
-
static getASingleMessage(id: number): Promise<SCPrivateMessageType>;
|
|
99
|
-
static sendAMessage(data: MessageCreateParams): Promise<SCPrivateMessageType>;
|
|
100
|
-
static deleteAMessage(id: number): Promise<any>;
|
|
101
|
-
static deleteAThread(id: number): Promise<any>;
|
|
102
|
-
static uploadMedia(data: MessageMediaUploadParams): Promise<SCPrivateMessageUploadMediaType>;
|
|
103
|
-
static uploadThumbnail(data: MessageThumbnailUploadParams): Promise<SCPrivateMessageUploadThumbnailType>;
|
|
104
|
-
static uploadMediaInChunks(data: MessageMediaChunksParams): Promise<SCPrivateMessageUploadMediaChunkType>;
|
|
105
|
-
static chunkUploadDone(data: MessageChunkUploadDoneParams): Promise<SCPrivateMessageUploadMediaType>;
|
|
116
|
+
static getAllSnippets(config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPrivateMessageType>>;
|
|
117
|
+
static getAThread(data: ThreadParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCPrivateMessageType>>;
|
|
118
|
+
static getASingleMessage(id: number, config?: AxiosRequestConfig): Promise<SCPrivateMessageType>;
|
|
119
|
+
static sendAMessage(data: MessageCreateParams, config?: AxiosRequestConfig): Promise<SCPrivateMessageType>;
|
|
120
|
+
static deleteAMessage(id: number, config?: AxiosRequestConfig): Promise<any>;
|
|
121
|
+
static deleteAThread(id: number, config?: AxiosRequestConfig): Promise<any>;
|
|
122
|
+
static uploadMedia(data: MessageMediaUploadParams, config?: AxiosRequestConfig): Promise<SCPrivateMessageUploadMediaType>;
|
|
123
|
+
static uploadThumbnail(data: MessageThumbnailUploadParams, config?: AxiosRequestConfig): Promise<SCPrivateMessageUploadThumbnailType>;
|
|
124
|
+
static uploadMediaInChunks(data: MessageMediaChunksParams, config?: AxiosRequestConfig): Promise<SCPrivateMessageUploadMediaChunkType>;
|
|
125
|
+
static chunkUploadDone(data: MessageChunkUploadDoneParams, config?: AxiosRequestConfig): Promise<SCPrivateMessageUploadMediaType>;
|
|
106
126
|
}
|
|
107
127
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/private_message/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,4BAA4B,EAC5B,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EACxB,4BAA4B,EAC5B,mBAAmB,EACnB,YAAY,EACb,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,oBAAoB,EACpB,oCAAoC,EACpC,+BAA+B,EAC/B,mCAAmC,EACpC,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/private_message/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,4BAA4B,EAC5B,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EACxB,4BAA4B,EAC5B,mBAAmB,EACnB,YAAY,EACb,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,oBAAoB,EACpB,oCAAoC,EACpC,+BAA+B,EAC/B,mCAAmC,EACpC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAC,kBAAkB,EAAC,MAAM,OAAO,CAAC;AAEzC,MAAM,WAAW,gCAAgC;IAC/C,cAAc,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAChG,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,C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EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;WAG/G,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC;WAGzF,YAAY,CAAC,IAAI,EAAE,mBAAmB,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC;WAGnG,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,GAAG,CAAC;WAGrE,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,GAAG,CAAC;WAGpE,WAAW,CAAC,IAAI,EAAE,wBAAwB,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,+BAA+B,CAAC;WAGlH,eAAe,CAAC,IAAI,EAAE,4BAA4B,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,mCAAmC,CAAC;WAG9H,mBAAmB,CAAC,IAAI,EAAE,wBAAwB,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,oCAAoC,CAAC;WAG/H,eAAe,CAAC,IAAI,EAAE,4BAA4B,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,+BAA+B,CAAC;CAGxI"}
|
|
@@ -15,77 +15,87 @@ import Endpoints from '../../constants/Endpoints';
|
|
|
15
15
|
export class PrivateMessageApiClient {
|
|
16
16
|
/**
|
|
17
17
|
* This endpoint retrieves all snippets.
|
|
18
|
+
* @param config
|
|
18
19
|
*/
|
|
19
|
-
static getAllSnippets() {
|
|
20
|
-
return apiRequest(Endpoints.GetSnippets.url({}), Endpoints.GetSnippets.method);
|
|
20
|
+
static getAllSnippets(config) {
|
|
21
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.GetSnippets.url({}), method: Endpoints.GetSnippets.method }));
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
23
24
|
* This endpoint retrieves all messages in a thread.
|
|
24
25
|
* @param data
|
|
26
|
+
* @param config
|
|
25
27
|
*/
|
|
26
|
-
static getAThread(data) {
|
|
27
|
-
return apiRequest(Endpoints.GetAThread.url({}), Endpoints.GetAThread.method, data);
|
|
28
|
+
static getAThread(data, config) {
|
|
29
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.GetAThread.url({}), method: Endpoints.GetAThread.method, data: data }));
|
|
28
30
|
}
|
|
29
31
|
/**
|
|
30
32
|
* This endpoint retrieves a single message using ID.
|
|
31
33
|
* @param id
|
|
34
|
+
* @param config
|
|
32
35
|
*/
|
|
33
|
-
static getASingleMessage(id) {
|
|
34
|
-
return apiRequest(Endpoints.GetASingleMessage.url({ id }), Endpoints.GetASingleMessage.method);
|
|
36
|
+
static getASingleMessage(id, config) {
|
|
37
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.GetASingleMessage.url({ id }), method: Endpoints.GetASingleMessage.method }));
|
|
35
38
|
}
|
|
36
39
|
/**
|
|
37
40
|
* This endpoint sends a message.
|
|
38
41
|
* @param data
|
|
42
|
+
* @param config
|
|
39
43
|
*/
|
|
40
|
-
static sendAMessage(data) {
|
|
41
|
-
return apiRequest(Endpoints.SendMessage.url({}), Endpoints.SendMessage.method, data);
|
|
44
|
+
static sendAMessage(data, config) {
|
|
45
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.SendMessage.url({}), method: Endpoints.SendMessage.method, data: data }));
|
|
42
46
|
}
|
|
43
47
|
/**
|
|
44
48
|
* This endpoint deletes a single message.
|
|
45
49
|
* @param id
|
|
50
|
+
* @param config
|
|
46
51
|
*/
|
|
47
|
-
static deleteAMessage(id) {
|
|
48
|
-
return apiRequest(Endpoints.DeleteASingleMessage.url({ id }), Endpoints.DeleteASingleMessage.method);
|
|
52
|
+
static deleteAMessage(id, config) {
|
|
53
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.DeleteASingleMessage.url({ id }), method: Endpoints.DeleteASingleMessage.method }));
|
|
49
54
|
}
|
|
50
55
|
/**
|
|
51
56
|
* This endpoint deletes a thread.
|
|
52
57
|
* @param id
|
|
58
|
+
* @param config
|
|
53
59
|
*/
|
|
54
|
-
static deleteAThread(id) {
|
|
55
|
-
return apiRequest(Endpoints.DeleteAThread.url({ id }), Endpoints.DeleteAThread.method);
|
|
60
|
+
static deleteAThread(id, config) {
|
|
61
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.DeleteAThread.url({ id }), method: Endpoints.DeleteAThread.method }));
|
|
56
62
|
}
|
|
57
63
|
/**
|
|
58
64
|
* This endpoint uploads a media.
|
|
59
65
|
* @param data
|
|
66
|
+
* @param config
|
|
60
67
|
*/
|
|
61
|
-
static uploadMedia(data) {
|
|
62
|
-
return apiRequest(Endpoints.PrivateMessageUploadMedia.url({}), Endpoints.PrivateMessageUploadMedia.method, data);
|
|
68
|
+
static uploadMedia(data, config) {
|
|
69
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.PrivateMessageUploadMedia.url({}), method: Endpoints.PrivateMessageUploadMedia.method, data: data }));
|
|
63
70
|
}
|
|
64
71
|
/**
|
|
65
72
|
* This endpoint uploads a thumbnail.
|
|
66
73
|
* @param data
|
|
74
|
+
* @param config
|
|
67
75
|
*/
|
|
68
|
-
static uploadThumbnail(data) {
|
|
69
|
-
return apiRequest(Endpoints.PrivateMessageUploadThumbnail.url({}), Endpoints.PrivateMessageUploadThumbnail.method, data);
|
|
76
|
+
static uploadThumbnail(data, config) {
|
|
77
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.PrivateMessageUploadThumbnail.url({}), method: Endpoints.PrivateMessageUploadThumbnail.method, data: data }));
|
|
70
78
|
}
|
|
71
79
|
/**
|
|
72
80
|
* This endpoint performs the chunk upload of a file.
|
|
73
81
|
* @param data
|
|
82
|
+
* @param config
|
|
74
83
|
*/
|
|
75
|
-
static uploadMediaInChunks(data) {
|
|
76
|
-
return apiRequest(Endpoints.PrivateMessageUploadMediaInChunks.url({}), Endpoints.PrivateMessageUploadMediaInChunks.method, data);
|
|
84
|
+
static uploadMediaInChunks(data, config) {
|
|
85
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.PrivateMessageUploadMediaInChunks.url({}), method: Endpoints.PrivateMessageUploadMediaInChunks.method, data: data }));
|
|
77
86
|
}
|
|
78
87
|
/**
|
|
79
88
|
* This endpoint finalizes the chunk upload and creates the file.
|
|
80
89
|
* @param data
|
|
90
|
+
* @param config
|
|
81
91
|
*/
|
|
82
|
-
static chunkUploadDone(data) {
|
|
83
|
-
return apiRequest(Endpoints.PrivateMessageChunkUploadDone.url({}), Endpoints.PrivateMessageChunkUploadDone.method, data);
|
|
92
|
+
static chunkUploadDone(data, config) {
|
|
93
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.PrivateMessageChunkUploadDone.url({}), method: Endpoints.PrivateMessageChunkUploadDone.method, data: data }));
|
|
84
94
|
}
|
|
85
95
|
}
|
|
86
96
|
/**
|
|
87
97
|
*
|
|
88
|
-
:::tipPrivate Message service can be used in the following
|
|
98
|
+
:::tipPrivate Message service can be used in the following way:
|
|
89
99
|
|
|
90
100
|
```jsx
|
|
91
101
|
1. Import the service from our library:
|
|
@@ -107,57 +117,66 @@ export class PrivateMessageApiClient {
|
|
|
107
117
|
return await PrivateMessageService.getASingleMessage(messageId);
|
|
108
118
|
}
|
|
109
119
|
```
|
|
120
|
+
```jsx
|
|
121
|
+
If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
|
|
122
|
+
|
|
123
|
+
1. Declare it(or declare them, it is possible to add multiple params)
|
|
124
|
+
|
|
125
|
+
const headers = headers: {Authorization: `Bearer ${yourToken}`}
|
|
126
|
+
|
|
127
|
+
2. Add it inside the brackets and pass it to the function, as shown in the previous example!
|
|
128
|
+
```
|
|
110
129
|
:::
|
|
111
130
|
*/
|
|
112
131
|
export default class PrivateMessageService {
|
|
113
|
-
static getAllSnippets() {
|
|
132
|
+
static getAllSnippets(config) {
|
|
114
133
|
return __awaiter(this, void 0, void 0, function* () {
|
|
115
|
-
return PrivateMessageApiClient.getAllSnippets();
|
|
134
|
+
return PrivateMessageApiClient.getAllSnippets(config);
|
|
116
135
|
});
|
|
117
136
|
}
|
|
118
|
-
static getAThread(data) {
|
|
137
|
+
static getAThread(data, config) {
|
|
119
138
|
return __awaiter(this, void 0, void 0, function* () {
|
|
120
|
-
return PrivateMessageApiClient.getAThread(data);
|
|
139
|
+
return PrivateMessageApiClient.getAThread(data, config);
|
|
121
140
|
});
|
|
122
141
|
}
|
|
123
|
-
static getASingleMessage(id) {
|
|
142
|
+
static getASingleMessage(id, config) {
|
|
124
143
|
return __awaiter(this, void 0, void 0, function* () {
|
|
125
|
-
return PrivateMessageApiClient.getASingleMessage(id);
|
|
144
|
+
return PrivateMessageApiClient.getASingleMessage(id, config);
|
|
126
145
|
});
|
|
127
146
|
}
|
|
128
|
-
static sendAMessage(data) {
|
|
147
|
+
static sendAMessage(data, config) {
|
|
129
148
|
return __awaiter(this, void 0, void 0, function* () {
|
|
130
|
-
return PrivateMessageApiClient.sendAMessage(data);
|
|
149
|
+
return PrivateMessageApiClient.sendAMessage(data, config);
|
|
131
150
|
});
|
|
132
151
|
}
|
|
133
|
-
static deleteAMessage(id) {
|
|
152
|
+
static deleteAMessage(id, config) {
|
|
134
153
|
return __awaiter(this, void 0, void 0, function* () {
|
|
135
|
-
return PrivateMessageApiClient.deleteAMessage(id);
|
|
154
|
+
return PrivateMessageApiClient.deleteAMessage(id, config);
|
|
136
155
|
});
|
|
137
156
|
}
|
|
138
|
-
static deleteAThread(id) {
|
|
157
|
+
static deleteAThread(id, config) {
|
|
139
158
|
return __awaiter(this, void 0, void 0, function* () {
|
|
140
|
-
return PrivateMessageApiClient.deleteAThread(id);
|
|
159
|
+
return PrivateMessageApiClient.deleteAThread(id, config);
|
|
141
160
|
});
|
|
142
161
|
}
|
|
143
|
-
static uploadMedia(data) {
|
|
162
|
+
static uploadMedia(data, config) {
|
|
144
163
|
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
-
return PrivateMessageApiClient.uploadMedia(data);
|
|
164
|
+
return PrivateMessageApiClient.uploadMedia(data, config);
|
|
146
165
|
});
|
|
147
166
|
}
|
|
148
|
-
static uploadThumbnail(data) {
|
|
167
|
+
static uploadThumbnail(data, config) {
|
|
149
168
|
return __awaiter(this, void 0, void 0, function* () {
|
|
150
|
-
return PrivateMessageApiClient.uploadThumbnail(data);
|
|
169
|
+
return PrivateMessageApiClient.uploadThumbnail(data, config);
|
|
151
170
|
});
|
|
152
171
|
}
|
|
153
|
-
static uploadMediaInChunks(data) {
|
|
172
|
+
static uploadMediaInChunks(data, config) {
|
|
154
173
|
return __awaiter(this, void 0, void 0, function* () {
|
|
155
|
-
return PrivateMessageApiClient.uploadMediaInChunks(data);
|
|
174
|
+
return PrivateMessageApiClient.uploadMediaInChunks(data, config);
|
|
156
175
|
});
|
|
157
176
|
}
|
|
158
|
-
static chunkUploadDone(data) {
|
|
177
|
+
static chunkUploadDone(data, config) {
|
|
159
178
|
return __awaiter(this, void 0, void 0, function* () {
|
|
160
|
-
return PrivateMessageApiClient.chunkUploadDone(data);
|
|
179
|
+
return PrivateMessageApiClient.chunkUploadDone(data, config);
|
|
161
180
|
});
|
|
162
181
|
}
|
|
163
182
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/services/private_message/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAClD,OAAO,SAAS,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/services/private_message/index.ts"],"names":[],"mappings":";;;;;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CAAC;KAAA;IACD,MAAM,CAAO,eAAe,CAAC,IAAkC,EAAE,MAA2B;;YAC1F,OAAO,uBAAuB,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC/D,CAAC;KAAA;IACD,MAAM,CAAO,mBAAmB,CAAC,IAA8B,EAAE,MAA2B;;YAC1F,OAAO,uBAAuB,CAAC,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACnE,CAAC;KAAA;IACD,MAAM,CAAO,eAAe,CAAC,IAAkC,EAAE,MAA2B;;YAC1F,OAAO,uBAAuB,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC/D,CAAC;KAAA;CACF"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { SCUserScoreType } from '@selfcommunity/types/src/types';
|
|
2
2
|
import { ScoreParams, SCPaginatedResponse, UserScoreParams } from '../../types';
|
|
3
|
+
import { AxiosRequestConfig } from 'axios';
|
|
3
4
|
export interface ScoreApiClientInterface {
|
|
4
|
-
getAllScores(params?: ScoreParams): Promise<SCPaginatedResponse<SCUserScoreType>>;
|
|
5
|
-
searchScore(params?: ScoreParams): Promise<SCPaginatedResponse<SCUserScoreType>>;
|
|
6
|
-
addScore(data: UserScoreParams): Promise<SCUserScoreType>;
|
|
5
|
+
getAllScores(params?: ScoreParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserScoreType>>;
|
|
6
|
+
searchScore(params?: ScoreParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserScoreType>>;
|
|
7
|
+
addScore(data: UserScoreParams, config?: AxiosRequestConfig): Promise<SCUserScoreType>;
|
|
7
8
|
}
|
|
8
9
|
/**
|
|
9
10
|
* Contains all the endpoints needed to manage user scores.
|
|
@@ -12,18 +13,21 @@ export declare class ScoreApiClient {
|
|
|
12
13
|
/**
|
|
13
14
|
* This endpoint retrieves all users scores.
|
|
14
15
|
* @param params
|
|
16
|
+
* @param config
|
|
15
17
|
*/
|
|
16
|
-
static getAllScores(params?: ScoreParams): Promise<SCPaginatedResponse<SCUserScoreType>>;
|
|
18
|
+
static getAllScores(params?: ScoreParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserScoreType>>;
|
|
17
19
|
/**
|
|
18
20
|
* This endpoint performs search to user scores.
|
|
19
21
|
* @param params
|
|
22
|
+
* @param config
|
|
20
23
|
*/
|
|
21
|
-
static searchScore(params?: ScoreParams): Promise<SCPaginatedResponse<SCUserScoreType>>;
|
|
24
|
+
static searchScore(params?: ScoreParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserScoreType>>;
|
|
22
25
|
/**
|
|
23
26
|
* This endpoint adds/removes score to a user.
|
|
24
27
|
* @param data
|
|
28
|
+
* @param config
|
|
25
29
|
*/
|
|
26
|
-
static addScore(data: UserScoreParams): Promise<SCUserScoreType>;
|
|
30
|
+
static addScore(data: UserScoreParams, config?: AxiosRequestConfig): Promise<SCUserScoreType>;
|
|
27
31
|
}
|
|
28
32
|
/**
|
|
29
33
|
*
|
|
@@ -42,11 +46,20 @@ export declare class ScoreApiClient {
|
|
|
42
46
|
return await ScoreService.getAllScores();
|
|
43
47
|
}
|
|
44
48
|
```
|
|
49
|
+
```jsx
|
|
50
|
+
If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
|
|
51
|
+
|
|
52
|
+
1. Declare it(or declare them, it is possible to add multiple params)
|
|
53
|
+
|
|
54
|
+
const headers = headers: {Authorization: `Bearer ${yourToken}`}
|
|
55
|
+
|
|
56
|
+
2. Add it inside the brackets and pass it to the function, as shown in the previous example!
|
|
57
|
+
```
|
|
45
58
|
:::
|
|
46
59
|
*/
|
|
47
60
|
export default class ScoreService {
|
|
48
|
-
static getAllScores(params?: ScoreParams): Promise<SCPaginatedResponse<SCUserScoreType>>;
|
|
49
|
-
static searchScore(params?: ScoreParams): Promise<SCPaginatedResponse<SCUserScoreType>>;
|
|
50
|
-
static addScore(data: UserScoreParams): Promise<SCUserScoreType>;
|
|
61
|
+
static getAllScores(params?: ScoreParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserScoreType>>;
|
|
62
|
+
static searchScore(params?: ScoreParams, config?: AxiosRequestConfig): Promise<SCPaginatedResponse<SCUserScoreType>>;
|
|
63
|
+
static addScore(data: UserScoreParams, config?: AxiosRequestConfig): Promise<SCUserScoreType>;
|
|
51
64
|
}
|
|
52
65
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/score/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAC,WAAW,EAAE,mBAAmB,EAAE,eAAe,EAAC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/score/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAC,WAAW,EAAE,mBAAmB,EAAE,eAAe,EAAC,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAC,kBAAkB,EAAC,MAAM,OAAO,CAAC;AAEzC,MAAM,WAAW,uBAAuB;IACtC,YAAY,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC,CAAC;IAC/G,WAAW,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC,CAAC;IAC9G,QAAQ,CAAC,IAAI,EAAE,eAAe,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;CACxF;AACD;;GAEG;AAEH,qBAAa,cAAc;IACzB;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC;IAKrH;;;;OAIG;IACH,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC;IAKpH;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,eAAe,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,eAAe,CAAC;CAG9F;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,OAAO,OAAO,YAAY;WAClB,YAAY,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC;WAG9G,WAAW,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC;WAG7G,QAAQ,CAAC,IAAI,EAAE,eAAe,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,eAAe,CAAC;CAGpG"}
|
|
@@ -16,25 +16,28 @@ export class ScoreApiClient {
|
|
|
16
16
|
/**
|
|
17
17
|
* This endpoint retrieves all users scores.
|
|
18
18
|
* @param params
|
|
19
|
+
* @param config
|
|
19
20
|
*/
|
|
20
|
-
static getAllScores(params) {
|
|
21
|
+
static getAllScores(params, config) {
|
|
21
22
|
const p = new URLSearchParams(params);
|
|
22
|
-
return apiRequest(`${Endpoints.ScoresList.url({})}?${p.toString()}`, Endpoints.ScoresList.method);
|
|
23
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: `${Endpoints.ScoresList.url({})}?${p.toString()}`, method: Endpoints.ScoresList.method }));
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
26
|
* This endpoint performs search to user scores.
|
|
26
27
|
* @param params
|
|
28
|
+
* @param config
|
|
27
29
|
*/
|
|
28
|
-
static searchScore(params) {
|
|
30
|
+
static searchScore(params, config) {
|
|
29
31
|
const p = new URLSearchParams(params);
|
|
30
|
-
return apiRequest(`${Endpoints.SearchScore.url({})}?${p.toString()}`, Endpoints.SearchScore.method);
|
|
32
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: `${Endpoints.SearchScore.url({})}?${p.toString()}`, method: Endpoints.SearchScore.method }));
|
|
31
33
|
}
|
|
32
34
|
/**
|
|
33
35
|
* This endpoint adds/removes score to a user.
|
|
34
36
|
* @param data
|
|
37
|
+
* @param config
|
|
35
38
|
*/
|
|
36
|
-
static addScore(data) {
|
|
37
|
-
return apiRequest(Endpoints.AddScore.url({}), Endpoints.AddScore.method, data);
|
|
39
|
+
static addScore(data, config) {
|
|
40
|
+
return apiRequest(Object.assign(Object.assign({}, config), { url: Endpoints.AddScore.url({}), method: Endpoints.AddScore.method, data: data }));
|
|
38
41
|
}
|
|
39
42
|
}
|
|
40
43
|
/**
|
|
@@ -54,22 +57,31 @@ export class ScoreApiClient {
|
|
|
54
57
|
return await ScoreService.getAllScores();
|
|
55
58
|
}
|
|
56
59
|
```
|
|
60
|
+
```jsx
|
|
61
|
+
If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
|
|
62
|
+
|
|
63
|
+
1. Declare it(or declare them, it is possible to add multiple params)
|
|
64
|
+
|
|
65
|
+
const headers = headers: {Authorization: `Bearer ${yourToken}`}
|
|
66
|
+
|
|
67
|
+
2. Add it inside the brackets and pass it to the function, as shown in the previous example!
|
|
68
|
+
```
|
|
57
69
|
:::
|
|
58
70
|
*/
|
|
59
71
|
export default class ScoreService {
|
|
60
|
-
static getAllScores(params) {
|
|
72
|
+
static getAllScores(params, config) {
|
|
61
73
|
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
-
return ScoreApiClient.getAllScores(params);
|
|
74
|
+
return ScoreApiClient.getAllScores(params, config);
|
|
63
75
|
});
|
|
64
76
|
}
|
|
65
|
-
static searchScore(params) {
|
|
77
|
+
static searchScore(params, config) {
|
|
66
78
|
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
-
return ScoreApiClient.searchScore(params);
|
|
79
|
+
return ScoreApiClient.searchScore(params, config);
|
|
68
80
|
});
|
|
69
81
|
}
|
|
70
|
-
static addScore(data) {
|
|
82
|
+
static addScore(data, config) {
|
|
71
83
|
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
-
return ScoreApiClient.addScore(data);
|
|
84
|
+
return ScoreApiClient.addScore(data, config);
|
|
73
85
|
});
|
|
74
86
|
}
|
|
75
87
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/services/score/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAClD,OAAO,SAAS,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/services/score/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAClD,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAUlD;;GAEG;AAEH,MAAM,OAAO,cAAc;IACzB;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,MAAoB,EAAE,MAA2B;QACnE,MAAM,CAAC,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;QACtC,OAAO,UAAU,iCAAK,MAAM,KAAE,GAAG,EAAE,GAAG,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,UAAU,CAAC,MAAM,IAAE,CAAC;IAC9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