@qite/tide-client 1.1.43 → 1.1.44
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/build/index.js +7 -0
- package/build/index.js.map +1 -1
- package/build/types/cms/translation-dictionary-item-localized.model.d.ts +5 -0
- package/build/types/cms/translation-dictionary-item.model.d.ts +6 -0
- package/build/types/cms/translation-dictionary-segment.model.d.ts +7 -0
- package/build/types/cms/translation-dictionary.model.d.ts +4 -0
- package/build/types/offer/dossier-view-result.d.ts +1 -1
- package/build/utils/web-client.d.ts +2 -0
- package/package.json +1 -1
- package/src/utils/web-client.ts +13 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CrmContactRequest, TideClientConfig } from "../types";
|
|
2
|
+
import { TranslationDictionary } from "../types/cms/translation-dictionary.model";
|
|
2
3
|
import { Affiliate } from "../types/offer/affiliate";
|
|
3
4
|
/**
|
|
4
5
|
* api/web/crmcontact
|
|
@@ -17,3 +18,4 @@ export declare const createCrmContact: (config: TideClientConfig, request: CrmCo
|
|
|
17
18
|
* @returns OK if succeeded.
|
|
18
19
|
*/
|
|
19
20
|
export declare const getAffiliates: (config: TideClientConfig, signal?: AbortSignal | undefined) => Promise<[Affiliate]>;
|
|
21
|
+
export declare const getTranslationDictionary: (config: TideClientConfig, segmentKey: string, signal?: AbortSignal | undefined) => Promise<TranslationDictionary>;
|
package/package.json
CHANGED
package/src/utils/web-client.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CrmContactRequest, TideClientConfig } from "../types";
|
|
2
|
+
import { TranslationDictionary } from "../types/cms/translation-dictionary.model";
|
|
2
3
|
import { Affiliate } from "../types/offer/affiliate";
|
|
3
4
|
|
|
4
5
|
import { post } from "./api";
|
|
@@ -7,6 +8,7 @@ import { get } from "./common-client";
|
|
|
7
8
|
const ENDPOINT = "/api/web";
|
|
8
9
|
const ENDPOINT_CREATE_CRM_CONTACT = `${ENDPOINT}/crmcontact`;
|
|
9
10
|
const ENDPOINT_CREATE_AFFILIATES = `${ENDPOINT}/affiliates`;
|
|
11
|
+
const ENDPOINT_TRANSLATION_DICTIONARY = `${ENDPOINT}/translation-dictionary`;
|
|
10
12
|
|
|
11
13
|
/**
|
|
12
14
|
* api/web/crmcontact
|
|
@@ -44,3 +46,14 @@ export const getAffiliates = (
|
|
|
44
46
|
|
|
45
47
|
return get(url, apiKey, config.token, signal, true);
|
|
46
48
|
};
|
|
49
|
+
|
|
50
|
+
export const getTranslationDictionary = (
|
|
51
|
+
config: TideClientConfig,
|
|
52
|
+
segmentKey: string,
|
|
53
|
+
signal?: AbortSignal
|
|
54
|
+
): Promise<{[key: string]: object}> => {
|
|
55
|
+
const url = `${config.host}${ENDPOINT_TRANSLATION_DICTIONARY}/${segmentKey}`;
|
|
56
|
+
const apiKey = config.apiKey;
|
|
57
|
+
|
|
58
|
+
return get(url, apiKey, undefined, signal);
|
|
59
|
+
}
|