@objectstack/client 1.0.0 → 1.0.2
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/CHANGELOG.md +26 -0
- package/README.md +6 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +14 -0
- package/package.json +3 -3
- package/src/index.ts +15 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @objectstack/client
|
|
2
2
|
|
|
3
|
+
## 1.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a0a6c85: Infrastructure and development tooling improvements
|
|
8
|
+
|
|
9
|
+
- Add changeset configuration for automated version management
|
|
10
|
+
- Add comprehensive GitHub Actions workflows (CI, CodeQL, linting, releases)
|
|
11
|
+
- Add development configuration files (.cursorrules, .github/prompts)
|
|
12
|
+
- Add documentation files (ARCHITECTURE.md, CONTRIBUTING.md, workflows docs)
|
|
13
|
+
- Update test script configuration in package.json
|
|
14
|
+
- Add @objectstack/cli to devDependencies for better development experience
|
|
15
|
+
|
|
16
|
+
- 109fc5b: Unified patch release to align all package versions.
|
|
17
|
+
- Updated dependencies [a0a6c85]
|
|
18
|
+
- Updated dependencies [109fc5b]
|
|
19
|
+
- @objectstack/spec@1.0.2
|
|
20
|
+
- @objectstack/core@1.0.2
|
|
21
|
+
|
|
22
|
+
## 1.0.1
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- @objectstack/spec@1.0.1
|
|
27
|
+
- @objectstack/core@1.0.1
|
|
28
|
+
|
|
3
29
|
## 1.0.0
|
|
4
30
|
|
|
5
31
|
### Major Changes
|
package/README.md
CHANGED
|
@@ -47,6 +47,12 @@ async function main() {
|
|
|
47
47
|
// 3. Metadata Access
|
|
48
48
|
const todoSchema = await client.meta.getObject('todo_task');
|
|
49
49
|
console.log('Fields:', todoSchema.fields);
|
|
50
|
+
|
|
51
|
+
// Save Metadata (New Feature)
|
|
52
|
+
await client.meta.saveItem('object', 'my_custom_object', {
|
|
53
|
+
label: 'My Object',
|
|
54
|
+
fields: { name: { type: 'text' } }
|
|
55
|
+
});
|
|
50
56
|
|
|
51
57
|
// 4. Advanced Query
|
|
52
58
|
const tasks = await client.data.find<{ subject: string; priority: number }>('todo_task', {
|
package/dist/index.d.ts
CHANGED
|
@@ -101,6 +101,13 @@ export declare class ObjectStackClient {
|
|
|
101
101
|
* @param name - Item name (snake_case identifier)
|
|
102
102
|
*/
|
|
103
103
|
getItem: (type: string, name: string) => Promise<any>;
|
|
104
|
+
/**
|
|
105
|
+
* Save a metadata item
|
|
106
|
+
* @param type - Metadata type (e.g., 'object', 'plugin')
|
|
107
|
+
* @param name - Item name
|
|
108
|
+
* @param item - The metadata content to save
|
|
109
|
+
*/
|
|
110
|
+
saveItem: (type: string, name: string, item: any) => Promise<any>;
|
|
104
111
|
/**
|
|
105
112
|
* Get object metadata with cache support
|
|
106
113
|
* Supports ETag-based conditional requests for efficient caching
|
package/dist/index.js
CHANGED
|
@@ -43,6 +43,20 @@ export class ObjectStackClient {
|
|
|
43
43
|
const res = await this.fetch(`${this.baseUrl}${route}/${type}/${name}`);
|
|
44
44
|
return res.json();
|
|
45
45
|
},
|
|
46
|
+
/**
|
|
47
|
+
* Save a metadata item
|
|
48
|
+
* @param type - Metadata type (e.g., 'object', 'plugin')
|
|
49
|
+
* @param name - Item name
|
|
50
|
+
* @param item - The metadata content to save
|
|
51
|
+
*/
|
|
52
|
+
saveItem: async (type, name, item) => {
|
|
53
|
+
const route = this.getRoute('metadata');
|
|
54
|
+
const res = await this.fetch(`${this.baseUrl}${route}/${type}/${name}`, {
|
|
55
|
+
method: 'PUT',
|
|
56
|
+
body: JSON.stringify(item)
|
|
57
|
+
});
|
|
58
|
+
return res.json();
|
|
59
|
+
},
|
|
46
60
|
/**
|
|
47
61
|
* Get object metadata with cache support
|
|
48
62
|
* Supports ETag-based conditional requests for efficient caching
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@objectstack/client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Official Client SDK for ObjectStack Protocol",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@objectstack/spec": "1.0.
|
|
10
|
-
"@objectstack/core": "1.0.
|
|
9
|
+
"@objectstack/spec": "1.0.2",
|
|
10
|
+
"@objectstack/core": "1.0.2"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"typescript": "^5.0.0",
|
package/src/index.ts
CHANGED
|
@@ -161,6 +161,21 @@ export class ObjectStackClient {
|
|
|
161
161
|
const res = await this.fetch(`${this.baseUrl}${route}/${type}/${name}`);
|
|
162
162
|
return res.json();
|
|
163
163
|
},
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Save a metadata item
|
|
167
|
+
* @param type - Metadata type (e.g., 'object', 'plugin')
|
|
168
|
+
* @param name - Item name
|
|
169
|
+
* @param item - The metadata content to save
|
|
170
|
+
*/
|
|
171
|
+
saveItem: async (type: string, name: string, item: any) => {
|
|
172
|
+
const route = this.getRoute('metadata');
|
|
173
|
+
const res = await this.fetch(`${this.baseUrl}${route}/${type}/${name}`, {
|
|
174
|
+
method: 'PUT',
|
|
175
|
+
body: JSON.stringify(item)
|
|
176
|
+
});
|
|
177
|
+
return res.json();
|
|
178
|
+
},
|
|
164
179
|
|
|
165
180
|
/**
|
|
166
181
|
* Get object metadata with cache support
|