@localess/js-client 0.0.5-next.20240528-193539.0 → 0.0.5-next.20240531-164126.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/README.md +14 -7
- package/dist/cjs/models/content-link.d.ts +21 -0
- package/dist/cjs/models/content-link.js +3 -0
- package/dist/cjs/models/content-link.js.map +1 -0
- package/dist/cjs/models/index.d.ts +1 -0
- package/dist/cjs/models/index.js +1 -0
- package/dist/cjs/models/index.js.map +1 -1
- package/dist/models/content-link.d.ts +21 -0
- package/dist/models/content-link.js +2 -0
- package/dist/models/content-link.js.map +1 -0
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +1 -0
- package/dist/models/index.js.map +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -32,13 +32,20 @@ yarn add @localess/js-client@latest
|
|
|
32
32
|
import {localessClient} from "@localess/js-client";
|
|
33
33
|
|
|
34
34
|
const llClient = localessClient({
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
// A fully qualified domain name with protocol (http/https) and port.
|
|
36
|
+
origin: 'https://my-localess.web.app',
|
|
37
|
+
// Localess space ID, cna be found in the Localess Space settings
|
|
38
|
+
spaceId: 'I1LoVe2LocaLess4Rever',
|
|
39
|
+
// Localess API token, can be found in the Localess Space settings
|
|
40
|
+
token: 'Baz00KaT0KeN8S3CureLL'
|
|
38
41
|
});
|
|
39
42
|
|
|
40
|
-
|
|
41
|
-
llClient.
|
|
42
|
-
|
|
43
|
-
llClient.
|
|
43
|
+
// Fetch all Content Links
|
|
44
|
+
llClient.getLinks()
|
|
45
|
+
// Fetch content by SLUG
|
|
46
|
+
llClient.getContentBySlug('docs/overview')
|
|
47
|
+
// Fetch content by ID
|
|
48
|
+
llClient.getContentById('FRnIT7CUABoRCdSVVGGs')
|
|
49
|
+
// Fetch translations by locale
|
|
50
|
+
llClient.getTranslations('en')
|
|
44
51
|
````
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content Link define reference to a Link.
|
|
3
|
+
*/
|
|
4
|
+
export interface ContentLink {
|
|
5
|
+
/**
|
|
6
|
+
* Define the type of Link
|
|
7
|
+
*/
|
|
8
|
+
kind: 'LINK';
|
|
9
|
+
/**
|
|
10
|
+
* Define the target of the link. _blank for new tab and _self for same tab.
|
|
11
|
+
*/
|
|
12
|
+
target: '_blank' | '_self';
|
|
13
|
+
/**
|
|
14
|
+
* Define the type of Link. URL for external links and Content for internal links.
|
|
15
|
+
*/
|
|
16
|
+
type: 'url' | 'content';
|
|
17
|
+
/**
|
|
18
|
+
* If type is content, then it will be Content ID. Otherwise it will be URL.
|
|
19
|
+
*/
|
|
20
|
+
uri: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-link.js","sourceRoot":"","sources":["../../../src/models/content-link.ts"],"names":[],"mappings":""}
|
package/dist/cjs/models/index.js
CHANGED
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./content"), exports);
|
|
18
18
|
__exportStar(require("./content-asset"), exports);
|
|
19
19
|
__exportStar(require("./content-data"), exports);
|
|
20
|
+
__exportStar(require("./content-link"), exports);
|
|
20
21
|
__exportStar(require("./content-metadata"), exports);
|
|
21
22
|
__exportStar(require("./links"), exports);
|
|
22
23
|
__exportStar(require("./translations"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,kDAAgC;AAChC,iDAA+B;AAC/B,qDAAmC;AACnC,0CAAwB;AACxB,iDAA+B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,kDAAgC;AAChC,iDAA+B;AAC/B,iDAA+B;AAC/B,qDAAmC;AACnC,0CAAwB;AACxB,iDAA+B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content Link define reference to a Link.
|
|
3
|
+
*/
|
|
4
|
+
export interface ContentLink {
|
|
5
|
+
/**
|
|
6
|
+
* Define the type of Link
|
|
7
|
+
*/
|
|
8
|
+
kind: 'LINK';
|
|
9
|
+
/**
|
|
10
|
+
* Define the target of the link. _blank for new tab and _self for same tab.
|
|
11
|
+
*/
|
|
12
|
+
target: '_blank' | '_self';
|
|
13
|
+
/**
|
|
14
|
+
* Define the type of Link. URL for external links and Content for internal links.
|
|
15
|
+
*/
|
|
16
|
+
type: 'url' | 'content';
|
|
17
|
+
/**
|
|
18
|
+
* If type is content, then it will be Content ID. Otherwise it will be URL.
|
|
19
|
+
*/
|
|
20
|
+
uri: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-link.js","sourceRoot":"","sources":["../../src/models/content-link.ts"],"names":[],"mappings":""}
|
package/dist/models/index.d.ts
CHANGED
package/dist/models/index.js
CHANGED
package/dist/models/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@localess/js-client",
|
|
3
|
-
"version": "0.0.5-next.
|
|
3
|
+
"version": "0.0.5-next.20240531-164126.0",
|
|
4
4
|
"description": "Universal JavaScript/TypeScript SDK for Localess's API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"localess",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"typescript"
|
|
12
12
|
],
|
|
13
13
|
"author": "Lessify",
|
|
14
|
-
"homepage": "https://localess
|
|
14
|
+
"homepage": "https://github.com/Lessify/localess-js-client",
|
|
15
15
|
"sideEffects": false,
|
|
16
16
|
"files": [
|
|
17
17
|
"dist"
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
"types": "./dist/index.d.ts",
|
|
27
27
|
"default": "./dist/index.js",
|
|
28
28
|
"node": "./dist/cjs/index.js"
|
|
29
|
-
}
|
|
29
|
+
},
|
|
30
|
+
"./models": "./dist/models/index.d.ts"
|
|
30
31
|
},
|
|
31
32
|
"repository": {
|
|
32
33
|
"type": "git",
|