@hapl/api-queries 0.2.78--canary.205.e4542e3.0 → 0.2.78

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 (37) hide show
  1. package/dist/api-queries.cjs.development.js +1343 -1137
  2. package/dist/api-queries.cjs.development.js.map +1 -1
  3. package/dist/api-queries.cjs.production.min.js +1 -1
  4. package/dist/api-queries.cjs.production.min.js.map +1 -1
  5. package/dist/api-queries.esm.js +1343 -1137
  6. package/dist/api-queries.esm.js.map +1 -1
  7. package/dist/clients/v1/api/debt/findDebts.d.ts +39 -0
  8. package/dist/clients/v1/api/index.d.ts +2 -0
  9. package/dist/clients/v1/api/photoOrder/completePhotoOrder/index.d.ts +24 -0
  10. package/dist/clients/v1/api/photoOrder/createPhotoOrder/index.d.ts +4 -0
  11. package/dist/clients/v1/dictionaries/AvailableFunds.d.ts +2 -0
  12. package/dist/clients/v1/dictionaries/Debt.d.ts +2 -0
  13. package/dist/clients/v1/index.d.ts +2 -0
  14. package/dist/clients/v1/types/AvailableFunds.d.ts +3 -1
  15. package/dist/clients/v1/types/Debt.d.ts +8 -1
  16. package/dist/clients/v1/types/PhotoOrder.d.ts +9 -0
  17. package/dist/external/api/icons/findIconById.d.ts +33 -0
  18. package/dist/external/api/icons/findIconPlatforms.d.ts +29 -0
  19. package/dist/external/api/icons/searchIcons.d.ts +54 -0
  20. package/dist/external/api/index.d.ts +3 -0
  21. package/dist/external/index.d.ts +67 -0
  22. package/package.json +1 -1
  23. package/src/clients/v1/api/debt/findDebts.ts +61 -0
  24. package/src/clients/v1/api/index.ts +2 -0
  25. package/src/clients/v1/api/photoOrder/completePhotoOrder/index.ts +37 -0
  26. package/src/clients/v1/api/photoOrder/createPhotoOrder/index.ts +2 -0
  27. package/src/clients/v1/dictionaries/AvailableFunds.ts +2 -0
  28. package/src/clients/v1/dictionaries/Debt.ts +2 -0
  29. package/src/clients/v1/index.ts +8 -0
  30. package/src/clients/v1/types/AvailableFunds.ts +2 -0
  31. package/src/clients/v1/types/Debt.ts +7 -0
  32. package/src/clients/v1/types/PhotoOrder.ts +9 -0
  33. package/src/external/api/icons/findIconById.ts +41 -0
  34. package/src/external/api/icons/findIconPlatforms.ts +37 -0
  35. package/src/external/api/icons/searchIcons.ts +64 -0
  36. package/src/external/api/index.ts +4 -0
  37. package/src/external/index.ts +12 -0
@@ -0,0 +1,41 @@
1
+ // документация https://developers.icons8.com/docs/icons#get-publicApi-icons-icon
2
+ import axios, { AxiosResponse } from 'axios';
3
+ import qs from 'qs';
4
+
5
+ type SuccessData = {
6
+ success: boolean;
7
+ icon: {
8
+ id: string;
9
+ name: string;
10
+ isFree: boolean;
11
+ isAnimated: boolean;
12
+ platform: string;
13
+ platformName: string;
14
+ publishedAt: number;
15
+ commonId: string;
16
+ commonName: string;
17
+ categoryName: string;
18
+ tags: string[];
19
+ subcategory: string;
20
+ subcategoryName: string;
21
+ description: string;
22
+ svg: string;
23
+ category?: string;
24
+ };
25
+ };
26
+
27
+ export type FindIconByIdParams = {
28
+ token: string;
29
+ id: string;
30
+ language?: string;
31
+ };
32
+
33
+ export type FindIconByIdData = AxiosResponse<SuccessData>;
34
+ export type FindIconByIdConfig = { params: FindIconByIdParams };
35
+
36
+ export function findIconByIdRequest({ params }: FindIconByIdConfig) {
37
+ return axios.get<SuccessData>('https://api-icons.icons8.com/publicApi/icons/icon', {
38
+ params,
39
+ paramsSerializer: params => qs.stringify(params, { arrayFormat: 'comma' }),
40
+ });
41
+ }
@@ -0,0 +1,37 @@
1
+ // документация https://developers.icons8.com/docs/icons#get-publicApi-platforms
2
+ import axios, { AxiosResponse } from 'axios';
3
+ import qs from 'qs';
4
+
5
+ type SuccessData = {
6
+ docs: Array<{
7
+ apiCode: string;
8
+ title: string;
9
+ fullTitle: string;
10
+ isColor: false;
11
+ size: number;
12
+ iconsCount: number;
13
+ mainPreviews: string[];
14
+ preview: string;
15
+ }>;
16
+ total: number;
17
+ limit: number;
18
+ page: number;
19
+ pages: number;
20
+ };
21
+
22
+ export type FindIconPlatformsParams = {
23
+ token: string;
24
+ limit?: number;
25
+ page?: number;
26
+ offset?: number;
27
+ };
28
+
29
+ export type FindIconPlatformsData = AxiosResponse<SuccessData>;
30
+ export type FindIconPlatformsConfig = { params: FindIconPlatformsParams };
31
+
32
+ export function findIconPlatformsRequest({ params }: FindIconPlatformsConfig) {
33
+ return axios.get<SuccessData>('https://api-icons.icons8.com/publicApi/platforms', {
34
+ params,
35
+ paramsSerializer: params => qs.stringify(params, { arrayFormat: 'comma' }),
36
+ });
37
+ }
@@ -0,0 +1,64 @@
1
+ // документация https://developers.icons8.com/docs/searchIcons#get-api-iconsets-v5-search
2
+ import axios, { AxiosResponse } from 'axios';
3
+ import qs from 'qs';
4
+
5
+ type SuccessData = {
6
+ success: boolean;
7
+ icons: Array<{
8
+ id: string;
9
+ name: string;
10
+ commonName: string;
11
+ platform: string;
12
+ isAnimated: boolean;
13
+ isFree: boolean;
14
+ isExternal: boolean;
15
+ isColor: boolean;
16
+ isExplicit: boolean;
17
+ authorId: string;
18
+ authorName: string;
19
+ sourceFormat: string;
20
+ category?: string;
21
+ }>;
22
+ message?: string;
23
+ suggestion?: string;
24
+ isSuggestionApplied?: string;
25
+ parameters?: {
26
+ amount?: number;
27
+ countAll?: number;
28
+ language?: string;
29
+ foundLanguage?: string;
30
+ offset?: number;
31
+ term?: string;
32
+ searchTranslations?: Partial<
33
+ Record<'en' | 'ru' | 'de' | 'es' | 'ja' | 'it' | 'hi' | 'fr' | 'pt' | 'pl' | 'ar' | 'ko' | 'zh', string>
34
+ >;
35
+ };
36
+ };
37
+
38
+ export type SearchIconsParams = {
39
+ token: string;
40
+ term: string;
41
+ platform?: string;
42
+ suggest?: boolean;
43
+ offset?: number;
44
+ category?: string;
45
+ authors?: string;
46
+ authorId?: string;
47
+ authorName?: string;
48
+ isAnimated?: boolean;
49
+ isOuch?: boolean;
50
+ isColor?: boolean;
51
+ spellcheck?: boolean;
52
+ allowExplicit?: boolean;
53
+ replaceNameWithSynonyms?: boolean;
54
+ };
55
+
56
+ export type SearchIconsData = AxiosResponse<SuccessData>;
57
+ export type SearchIconsConfig = { params: SearchIconsParams };
58
+
59
+ export function searchIconsRequest({ params }: SearchIconsConfig) {
60
+ return axios.get<SuccessData>('https://search.icons8.com/api/iconsets/v5/search', {
61
+ params,
62
+ paramsSerializer: params => qs.stringify(params, { arrayFormat: 'comma' }),
63
+ });
64
+ }
@@ -2,5 +2,9 @@ export * from './callTransfer/findCallTransferByExpertId';
2
2
 
3
3
  export * from './dadata/findDadataSuggestions';
4
4
 
5
+ export * from './icons/findIconById';
6
+ export * from './icons/findIconPlatforms';
7
+ export * from './icons/searchIcons';
8
+
5
9
  export * from './yandex/findYandexSuggestions';
6
10
  export * from './yandex/yandexGeocode';
@@ -9,6 +9,18 @@ export class Api {
9
9
  return api.findDadataSuggestionsRequest({ body, headers });
10
10
  };
11
11
 
12
+ findIconById = (params: api.FindIconByIdParams) => {
13
+ return api.findIconByIdRequest({ params });
14
+ };
15
+
16
+ findIconPlatforms = (params: api.FindIconPlatformsParams) => {
17
+ return api.findIconPlatformsRequest({ params });
18
+ };
19
+
20
+ searchIcons = (params: api.SearchIconsParams) => {
21
+ return api.searchIconsRequest({ params });
22
+ };
23
+
12
24
  findYandexSuggestions = (params: api.FindYandexSuggestionsParams) => {
13
25
  return api.findYandexSuggestionsRequest({ params });
14
26
  };