@localess/js-client 0.6.1-next.20250402-201511.0 → 0.6.1-next.20250409-075652.0
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/dist/index.d.mts +9 -8
- package/dist/index.d.ts +9 -8
- package/dist/index.js +1 -22
- package/dist/index.mjs +1 -22
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -214,11 +214,7 @@ type ContentFetchParams = {
|
|
|
214
214
|
*/
|
|
215
215
|
locale?: string;
|
|
216
216
|
};
|
|
217
|
-
|
|
218
|
-
* Create a Localess API Client
|
|
219
|
-
* @param {LocalessClientOptions} options connection details
|
|
220
|
-
*/
|
|
221
|
-
declare function localessClient(options: LocalessClientOptions): {
|
|
217
|
+
interface LocalessClient {
|
|
222
218
|
/**
|
|
223
219
|
* Get all links
|
|
224
220
|
* @param params{LinksFetchParams} - Fetch parameters
|
|
@@ -238,7 +234,7 @@ declare function localessClient(options: LocalessClientOptions): {
|
|
|
238
234
|
* @param params{ContentFetchParams} - Fetch parameters
|
|
239
235
|
* @returns {Promise<Content>}
|
|
240
236
|
*/
|
|
241
|
-
getContentById<
|
|
237
|
+
getContentById<T extends ContentData = ContentData>(id: string, params?: ContentFetchParams): Promise<Content<T>>;
|
|
242
238
|
/**
|
|
243
239
|
* Get translations for the given locale
|
|
244
240
|
* @param locale{string} - Locale identifier (ISO 639-1)
|
|
@@ -246,7 +242,12 @@ declare function localessClient(options: LocalessClientOptions): {
|
|
|
246
242
|
getTranslations(locale: string): Promise<Translations>;
|
|
247
243
|
syncScriptUrl(): string;
|
|
248
244
|
assetLink(asset: ContentAsset | string): string;
|
|
249
|
-
}
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Create a Localess API Client
|
|
248
|
+
* @param {LocalessClientOptions} options connection details
|
|
249
|
+
*/
|
|
250
|
+
declare function localessClient(options: LocalessClientOptions): LocalessClient;
|
|
250
251
|
|
|
251
252
|
declare function llEditable(content: ContentDataSchema): {
|
|
252
253
|
'data-ll-id': string;
|
|
@@ -280,4 +281,4 @@ declare global {
|
|
|
280
281
|
}
|
|
281
282
|
}
|
|
282
283
|
|
|
283
|
-
export { type Content, type ContentAsset, type ContentData, type ContentDataField, type ContentDataSchema, type ContentFetchParams, type ContentLink, type ContentMetadata, type ContentReference, type ContentRichText, type EventCallback, type EventToApp, type EventToAppType, type Links, type LinksFetchParams, type LocalessClientOptions, type LocalessSync, type Translations, llEditable, loadLocalessSync, localessClient };
|
|
284
|
+
export { type Content, type ContentAsset, type ContentData, type ContentDataField, type ContentDataSchema, type ContentFetchParams, type ContentLink, type ContentMetadata, type ContentReference, type ContentRichText, type EventCallback, type EventToApp, type EventToAppType, type Links, type LinksFetchParams, type LocalessClient, type LocalessClientOptions, type LocalessSync, type Translations, llEditable, loadLocalessSync, localessClient };
|
package/dist/index.d.ts
CHANGED
|
@@ -214,11 +214,7 @@ type ContentFetchParams = {
|
|
|
214
214
|
*/
|
|
215
215
|
locale?: string;
|
|
216
216
|
};
|
|
217
|
-
|
|
218
|
-
* Create a Localess API Client
|
|
219
|
-
* @param {LocalessClientOptions} options connection details
|
|
220
|
-
*/
|
|
221
|
-
declare function localessClient(options: LocalessClientOptions): {
|
|
217
|
+
interface LocalessClient {
|
|
222
218
|
/**
|
|
223
219
|
* Get all links
|
|
224
220
|
* @param params{LinksFetchParams} - Fetch parameters
|
|
@@ -238,7 +234,7 @@ declare function localessClient(options: LocalessClientOptions): {
|
|
|
238
234
|
* @param params{ContentFetchParams} - Fetch parameters
|
|
239
235
|
* @returns {Promise<Content>}
|
|
240
236
|
*/
|
|
241
|
-
getContentById<
|
|
237
|
+
getContentById<T extends ContentData = ContentData>(id: string, params?: ContentFetchParams): Promise<Content<T>>;
|
|
242
238
|
/**
|
|
243
239
|
* Get translations for the given locale
|
|
244
240
|
* @param locale{string} - Locale identifier (ISO 639-1)
|
|
@@ -246,7 +242,12 @@ declare function localessClient(options: LocalessClientOptions): {
|
|
|
246
242
|
getTranslations(locale: string): Promise<Translations>;
|
|
247
243
|
syncScriptUrl(): string;
|
|
248
244
|
assetLink(asset: ContentAsset | string): string;
|
|
249
|
-
}
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Create a Localess API Client
|
|
248
|
+
* @param {LocalessClientOptions} options connection details
|
|
249
|
+
*/
|
|
250
|
+
declare function localessClient(options: LocalessClientOptions): LocalessClient;
|
|
250
251
|
|
|
251
252
|
declare function llEditable(content: ContentDataSchema): {
|
|
252
253
|
'data-ll-id': string;
|
|
@@ -280,4 +281,4 @@ declare global {
|
|
|
280
281
|
}
|
|
281
282
|
}
|
|
282
283
|
|
|
283
|
-
export { type Content, type ContentAsset, type ContentData, type ContentDataField, type ContentDataSchema, type ContentFetchParams, type ContentLink, type ContentMetadata, type ContentReference, type ContentRichText, type EventCallback, type EventToApp, type EventToAppType, type Links, type LinksFetchParams, type LocalessClientOptions, type LocalessSync, type Translations, llEditable, loadLocalessSync, localessClient };
|
|
284
|
+
export { type Content, type ContentAsset, type ContentData, type ContentDataField, type ContentDataSchema, type ContentFetchParams, type ContentLink, type ContentMetadata, type ContentReference, type ContentRichText, type EventCallback, type EventToApp, type EventToAppType, type Links, type LinksFetchParams, type LocalessClient, type LocalessClientOptions, type LocalessSync, type Translations, llEditable, loadLocalessSync, localessClient };
|
package/dist/index.js
CHANGED
|
@@ -42,15 +42,10 @@ function localessClient(options) {
|
|
|
42
42
|
"Content-Type": "application/json",
|
|
43
43
|
"Accept": "application/json",
|
|
44
44
|
"X-Localess-Agent": "Localess-JS-Client",
|
|
45
|
-
"X-Localess-Agent-Version": "0.
|
|
45
|
+
"X-Localess-Agent-Version": "0.6.0"
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
return {
|
|
49
|
-
/**
|
|
50
|
-
* Get all links
|
|
51
|
-
* @param params{LinksFetchParams} - Fetch parameters
|
|
52
|
-
* @returns {Promise<Links>}
|
|
53
|
-
*/
|
|
54
49
|
async getLinks(params) {
|
|
55
50
|
if (options.debug) {
|
|
56
51
|
console.log(LOG_GROUP, "getLinks() params : " + params);
|
|
@@ -83,12 +78,6 @@ function localessClient(options) {
|
|
|
83
78
|
return {};
|
|
84
79
|
}
|
|
85
80
|
},
|
|
86
|
-
/**
|
|
87
|
-
* Get content by SLUG
|
|
88
|
-
* @param slug{string} - Content SLUG
|
|
89
|
-
* @param params{ContentFetchParams} - Fetch parameters
|
|
90
|
-
* @returns {Promise<Content>}
|
|
91
|
-
*/
|
|
92
81
|
async getContentBySlug(slug, params) {
|
|
93
82
|
if (options.debug) {
|
|
94
83
|
console.log(LOG_GROUP, "getContentBySlug() slug : ", slug);
|
|
@@ -118,12 +107,6 @@ function localessClient(options) {
|
|
|
118
107
|
return {};
|
|
119
108
|
}
|
|
120
109
|
},
|
|
121
|
-
/**
|
|
122
|
-
* Get content by ID
|
|
123
|
-
* @param id{string} - Content ID
|
|
124
|
-
* @param params{ContentFetchParams} - Fetch parameters
|
|
125
|
-
* @returns {Promise<Content>}
|
|
126
|
-
*/
|
|
127
110
|
async getContentById(id, params) {
|
|
128
111
|
if (options.debug) {
|
|
129
112
|
console.log(LOG_GROUP, "getContentById() id : ", id);
|
|
@@ -148,10 +131,6 @@ function localessClient(options) {
|
|
|
148
131
|
const data = await response.json();
|
|
149
132
|
return data;
|
|
150
133
|
},
|
|
151
|
-
/**
|
|
152
|
-
* Get translations for the given locale
|
|
153
|
-
* @param locale{string} - Locale identifier (ISO 639-1)
|
|
154
|
-
*/
|
|
155
134
|
async getTranslations(locale) {
|
|
156
135
|
if (options.debug) {
|
|
157
136
|
console.log(LOG_GROUP, "getTranslations() locale : ", locale);
|
package/dist/index.mjs
CHANGED
|
@@ -14,15 +14,10 @@ function localessClient(options) {
|
|
|
14
14
|
"Content-Type": "application/json",
|
|
15
15
|
"Accept": "application/json",
|
|
16
16
|
"X-Localess-Agent": "Localess-JS-Client",
|
|
17
|
-
"X-Localess-Agent-Version": "0.
|
|
17
|
+
"X-Localess-Agent-Version": "0.6.0"
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
return {
|
|
21
|
-
/**
|
|
22
|
-
* Get all links
|
|
23
|
-
* @param params{LinksFetchParams} - Fetch parameters
|
|
24
|
-
* @returns {Promise<Links>}
|
|
25
|
-
*/
|
|
26
21
|
async getLinks(params) {
|
|
27
22
|
if (options.debug) {
|
|
28
23
|
console.log(LOG_GROUP, "getLinks() params : " + params);
|
|
@@ -55,12 +50,6 @@ function localessClient(options) {
|
|
|
55
50
|
return {};
|
|
56
51
|
}
|
|
57
52
|
},
|
|
58
|
-
/**
|
|
59
|
-
* Get content by SLUG
|
|
60
|
-
* @param slug{string} - Content SLUG
|
|
61
|
-
* @param params{ContentFetchParams} - Fetch parameters
|
|
62
|
-
* @returns {Promise<Content>}
|
|
63
|
-
*/
|
|
64
53
|
async getContentBySlug(slug, params) {
|
|
65
54
|
if (options.debug) {
|
|
66
55
|
console.log(LOG_GROUP, "getContentBySlug() slug : ", slug);
|
|
@@ -90,12 +79,6 @@ function localessClient(options) {
|
|
|
90
79
|
return {};
|
|
91
80
|
}
|
|
92
81
|
},
|
|
93
|
-
/**
|
|
94
|
-
* Get content by ID
|
|
95
|
-
* @param id{string} - Content ID
|
|
96
|
-
* @param params{ContentFetchParams} - Fetch parameters
|
|
97
|
-
* @returns {Promise<Content>}
|
|
98
|
-
*/
|
|
99
82
|
async getContentById(id, params) {
|
|
100
83
|
if (options.debug) {
|
|
101
84
|
console.log(LOG_GROUP, "getContentById() id : ", id);
|
|
@@ -120,10 +103,6 @@ function localessClient(options) {
|
|
|
120
103
|
const data = await response.json();
|
|
121
104
|
return data;
|
|
122
105
|
},
|
|
123
|
-
/**
|
|
124
|
-
* Get translations for the given locale
|
|
125
|
-
* @param locale{string} - Locale identifier (ISO 639-1)
|
|
126
|
-
*/
|
|
127
106
|
async getTranslations(locale) {
|
|
128
107
|
if (options.debug) {
|
|
129
108
|
console.log(LOG_GROUP, "getTranslations() locale : ", locale);
|