@localess/js-client 0.8.6-next.20251222-145442.0 → 0.9.1-next.20260119-221431.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 +21 -2
- package/dist/index.d.ts +21 -2
- package/dist/index.js +7 -3
- package/dist/index.mjs +7 -3
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -139,6 +139,13 @@ interface Links {
|
|
|
139
139
|
[key: string]: ContentMetadata;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
+
/**
|
|
143
|
+
* Key-Value Object. Where Key is a Unique identifier for the Content object and Value is Content.
|
|
144
|
+
*/
|
|
145
|
+
interface References {
|
|
146
|
+
[key: string]: Content;
|
|
147
|
+
}
|
|
148
|
+
|
|
142
149
|
/**
|
|
143
150
|
* Content defines a shared object for all possible Content Types.
|
|
144
151
|
*/
|
|
@@ -148,9 +155,13 @@ interface Content<T extends ContentData = ContentData> extends ContentMetadata {
|
|
|
148
155
|
*/
|
|
149
156
|
data?: T;
|
|
150
157
|
/**
|
|
151
|
-
*
|
|
158
|
+
* All links used in the content.
|
|
152
159
|
*/
|
|
153
160
|
links?: Links;
|
|
161
|
+
/**
|
|
162
|
+
* All references used in the content.
|
|
163
|
+
*/
|
|
164
|
+
references?: References;
|
|
154
165
|
}
|
|
155
166
|
|
|
156
167
|
/**
|
|
@@ -213,6 +224,14 @@ type ContentFetchParams = {
|
|
|
213
224
|
* Example: en
|
|
214
225
|
*/
|
|
215
226
|
locale?: string;
|
|
227
|
+
/**
|
|
228
|
+
* Resolve references in the content data. Default is false.
|
|
229
|
+
*/
|
|
230
|
+
resolveReference?: boolean;
|
|
231
|
+
/**
|
|
232
|
+
* Resolve links in the content data. Default is false.
|
|
233
|
+
*/
|
|
234
|
+
resolveLink?: boolean;
|
|
216
235
|
};
|
|
217
236
|
interface LocalessClient {
|
|
218
237
|
/**
|
|
@@ -321,4 +340,4 @@ declare global {
|
|
|
321
340
|
}
|
|
322
341
|
}
|
|
323
342
|
|
|
324
|
-
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, isBrowser, isIframe, isServer, llEditable, llEditableField, loadLocalessSync, localessClient, localessEditable, localessEditableField };
|
|
343
|
+
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 References, type Translations, isBrowser, isIframe, isServer, llEditable, llEditableField, loadLocalessSync, localessClient, localessEditable, localessEditableField };
|
package/dist/index.d.ts
CHANGED
|
@@ -139,6 +139,13 @@ interface Links {
|
|
|
139
139
|
[key: string]: ContentMetadata;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
+
/**
|
|
143
|
+
* Key-Value Object. Where Key is a Unique identifier for the Content object and Value is Content.
|
|
144
|
+
*/
|
|
145
|
+
interface References {
|
|
146
|
+
[key: string]: Content;
|
|
147
|
+
}
|
|
148
|
+
|
|
142
149
|
/**
|
|
143
150
|
* Content defines a shared object for all possible Content Types.
|
|
144
151
|
*/
|
|
@@ -148,9 +155,13 @@ interface Content<T extends ContentData = ContentData> extends ContentMetadata {
|
|
|
148
155
|
*/
|
|
149
156
|
data?: T;
|
|
150
157
|
/**
|
|
151
|
-
*
|
|
158
|
+
* All links used in the content.
|
|
152
159
|
*/
|
|
153
160
|
links?: Links;
|
|
161
|
+
/**
|
|
162
|
+
* All references used in the content.
|
|
163
|
+
*/
|
|
164
|
+
references?: References;
|
|
154
165
|
}
|
|
155
166
|
|
|
156
167
|
/**
|
|
@@ -213,6 +224,14 @@ type ContentFetchParams = {
|
|
|
213
224
|
* Example: en
|
|
214
225
|
*/
|
|
215
226
|
locale?: string;
|
|
227
|
+
/**
|
|
228
|
+
* Resolve references in the content data. Default is false.
|
|
229
|
+
*/
|
|
230
|
+
resolveReference?: boolean;
|
|
231
|
+
/**
|
|
232
|
+
* Resolve links in the content data. Default is false.
|
|
233
|
+
*/
|
|
234
|
+
resolveLink?: boolean;
|
|
216
235
|
};
|
|
217
236
|
interface LocalessClient {
|
|
218
237
|
/**
|
|
@@ -321,4 +340,4 @@ declare global {
|
|
|
321
340
|
}
|
|
322
341
|
}
|
|
323
342
|
|
|
324
|
-
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, isBrowser, isIframe, isServer, llEditable, llEditableField, loadLocalessSync, localessClient, localessEditable, localessEditableField };
|
|
343
|
+
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 References, type Translations, isBrowser, isIframe, isServer, llEditable, llEditableField, loadLocalessSync, localessClient, localessEditable, localessEditableField };
|
package/dist/index.js
CHANGED
|
@@ -51,7 +51,7 @@ function localessClient(options) {
|
|
|
51
51
|
"Content-Type": "application/json",
|
|
52
52
|
"Accept": "application/json",
|
|
53
53
|
"X-Localess-Agent": "Localess-JS-Client",
|
|
54
|
-
"X-Localess-Agent-Version": "0.
|
|
54
|
+
"X-Localess-Agent-Version": "0.9.0"
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
const cache = /* @__PURE__ */ new Map();
|
|
@@ -108,7 +108,9 @@ function localessClient(options) {
|
|
|
108
108
|
version = `&version=${params.version}`;
|
|
109
109
|
}
|
|
110
110
|
const locale = params?.locale ? `&locale=${params.locale}` : "";
|
|
111
|
-
|
|
111
|
+
const resolveReference = params?.resolveReference ? `&resolveReference=${params.resolveReference}` : "";
|
|
112
|
+
const resolveLink = params?.resolveLink ? `&resolveLink=${params.resolveLink}` : "";
|
|
113
|
+
let url = `${options.origin}/api/v1/spaces/${options.spaceId}/contents/slugs/${slug}?token=${options.token}${version}${locale}${resolveReference}${resolveLink}`;
|
|
112
114
|
if (options.debug) {
|
|
113
115
|
console.log(LOG_GROUP, "getContentBySlug fetch url : ", url);
|
|
114
116
|
}
|
|
@@ -144,7 +146,9 @@ function localessClient(options) {
|
|
|
144
146
|
version = `&version=${params.version}`;
|
|
145
147
|
}
|
|
146
148
|
const locale = params?.locale ? `&locale=${params.locale}` : "";
|
|
147
|
-
|
|
149
|
+
const resolveReference = params?.resolveReference ? `&resolveReference=${params.resolveReference}` : "";
|
|
150
|
+
const resolveLink = params?.resolveLink ? `&resolveLink=${params.resolveLink}` : "";
|
|
151
|
+
let url = `${options.origin}/api/v1/spaces/${options.spaceId}/contents/${id}?token=${options.token}${version}${locale}${resolveReference}${resolveLink}`;
|
|
148
152
|
if (options.debug) {
|
|
149
153
|
console.log(LOG_GROUP, "getContentById fetch url : ", url);
|
|
150
154
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -17,7 +17,7 @@ function localessClient(options) {
|
|
|
17
17
|
"Content-Type": "application/json",
|
|
18
18
|
"Accept": "application/json",
|
|
19
19
|
"X-Localess-Agent": "Localess-JS-Client",
|
|
20
|
-
"X-Localess-Agent-Version": "0.
|
|
20
|
+
"X-Localess-Agent-Version": "0.9.0"
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
const cache = /* @__PURE__ */ new Map();
|
|
@@ -74,7 +74,9 @@ function localessClient(options) {
|
|
|
74
74
|
version = `&version=${params.version}`;
|
|
75
75
|
}
|
|
76
76
|
const locale = params?.locale ? `&locale=${params.locale}` : "";
|
|
77
|
-
|
|
77
|
+
const resolveReference = params?.resolveReference ? `&resolveReference=${params.resolveReference}` : "";
|
|
78
|
+
const resolveLink = params?.resolveLink ? `&resolveLink=${params.resolveLink}` : "";
|
|
79
|
+
let url = `${options.origin}/api/v1/spaces/${options.spaceId}/contents/slugs/${slug}?token=${options.token}${version}${locale}${resolveReference}${resolveLink}`;
|
|
78
80
|
if (options.debug) {
|
|
79
81
|
console.log(LOG_GROUP, "getContentBySlug fetch url : ", url);
|
|
80
82
|
}
|
|
@@ -110,7 +112,9 @@ function localessClient(options) {
|
|
|
110
112
|
version = `&version=${params.version}`;
|
|
111
113
|
}
|
|
112
114
|
const locale = params?.locale ? `&locale=${params.locale}` : "";
|
|
113
|
-
|
|
115
|
+
const resolveReference = params?.resolveReference ? `&resolveReference=${params.resolveReference}` : "";
|
|
116
|
+
const resolveLink = params?.resolveLink ? `&resolveLink=${params.resolveLink}` : "";
|
|
117
|
+
let url = `${options.origin}/api/v1/spaces/${options.spaceId}/contents/${id}?token=${options.token}${version}${locale}${resolveReference}${resolveLink}`;
|
|
114
118
|
if (options.debug) {
|
|
115
119
|
console.log(LOG_GROUP, "getContentById fetch url : ", url);
|
|
116
120
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@localess/js-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1-next.20260119-221431.0",
|
|
4
4
|
"description": "Universal JavaScript/TypeScript SDK for Localess's API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"localess",
|
|
@@ -43,6 +43,6 @@
|
|
|
43
43
|
"typescript": "^5.0.0"
|
|
44
44
|
},
|
|
45
45
|
"engines": {
|
|
46
|
-
"node": ">=
|
|
46
|
+
"node": ">= 20.0.0"
|
|
47
47
|
}
|
|
48
48
|
}
|