@walde.ai/walde-sdk 0.1.0 → 0.1.1
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 +28 -6
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ performant online content.
|
|
|
5
5
|
|
|
6
6
|
## Installation
|
|
7
7
|
```bash
|
|
8
|
-
npm
|
|
8
|
+
npm i @walde.ai/walde-sdk
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Quick Start
|
|
@@ -28,19 +28,41 @@ const walde = MakeWalde({
|
|
|
28
28
|
Once you have your instance defined, you can chain methods to fetch the content you want.
|
|
29
29
|
```ts
|
|
30
30
|
// Get one content
|
|
31
|
-
const byKey = await walde
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
const byKey = await walde
|
|
32
|
+
.contents()
|
|
33
|
+
.key('my/content/key')
|
|
34
|
+
.locale('en-us')
|
|
35
|
+
.resolve();
|
|
36
|
+
```
|
|
37
|
+
Other ways to get content.
|
|
38
|
+
```ts
|
|
39
|
+
const byId = await walde
|
|
40
|
+
.contents()
|
|
41
|
+
.id('my-content-id')
|
|
42
|
+
.locale('en-us')
|
|
43
|
+
.resolve();
|
|
44
|
+
|
|
45
|
+
const byName = await walde
|
|
46
|
+
.contents()
|
|
47
|
+
.name('My Content Name')
|
|
48
|
+
.locale('en-us')
|
|
49
|
+
.resolve();
|
|
34
50
|
|
|
35
51
|
// List all content in the site
|
|
36
|
-
const all = await walde
|
|
52
|
+
const all = await walde
|
|
53
|
+
.contents()
|
|
54
|
+
.list()
|
|
55
|
+
.resolve();
|
|
37
56
|
```
|
|
38
57
|
|
|
39
58
|
Note that you can chain all the methods you want inexpensively. The asynchronous backend calls
|
|
40
59
|
happens only when you run the `resolve()` method.
|
|
41
60
|
```ts
|
|
42
61
|
// This is not loading anything yet
|
|
43
|
-
const query = walde
|
|
62
|
+
const query = walde
|
|
63
|
+
.contents()
|
|
64
|
+
.key('my/content/key')
|
|
65
|
+
.locale('en-us');
|
|
44
66
|
|
|
45
67
|
// This actually performs the backend call
|
|
46
68
|
const result = await query.resolve();
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './sdk';
|
|
2
|
-
export * from './std';
|
|
1
|
+
export * from './sdk/index.js';
|
|
2
|
+
export * from './std/index.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAG/B,cAAc,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,cAAc,gBAAgB,CAAC;AAE/B,0BAA0B;AAC1B,cAAc,gBAAgB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walde.ai/walde-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "TypeScript SDK for Walde platform",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"amazon-cognito-identity-js": "^6.3.12",
|
|
28
|
-
"aws-sdk": "^2.1691.0",
|
|
29
28
|
"@aws-sdk/client-s3": "^3.0.0",
|
|
30
29
|
"@aws-sdk/client-cognito-identity-provider": "^3.0.0",
|
|
31
30
|
"gray-matter": "^4.0.3"
|