@statezero/core 0.1.12 → 0.1.15
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/LICENSE +5 -5
- package/dist/flavours/django/model.d.ts +0 -1
- package/dist/flavours/django/model.js +3 -12
- package/dist/syncEngine/stores/querysetStore.js +1 -13
- package/package.json +123 -123
package/LICENSE
CHANGED
|
@@ -20,7 +20,7 @@ _Last Updated: 2025-06-29_
|
|
|
20
20
|
|
|
21
21
|
2.2. **License Philosophy**: If SaaS is like renting and open-source is like owning, our license is like a **999-year leasehold on fixed rent**. It provides the security you need to build and grow your company around StateZero, while allowing us to maintain and develop StateZero to a high standard.
|
|
22
22
|
|
|
23
|
-
2.3. **Rate Lock Guarantee**: You lock in the **full rate card for all tiers** at the time you sign up, meaning your fees remain predictable no matter how much your revenue or our pricing changes. To lock in your rates, simply contact us at **robert@
|
|
23
|
+
2.3. **Rate Lock Guarantee**: You lock in the **full rate card for all tiers** at the time you sign up, meaning your fees remain predictable no matter how much your revenue or our pricing changes. To lock in your rates, simply contact us at **robert.herring@resipilot.com**.
|
|
24
24
|
|
|
25
25
|
## **3. Pricing Structure**
|
|
26
26
|
|
|
@@ -55,7 +55,7 @@ _Last Updated: 2025-06-29_
|
|
|
55
55
|
|
|
56
56
|
5.2. **LLM Training License Fee**: The annual license fee for LLM training usage is **$250,000 per year**.
|
|
57
57
|
|
|
58
|
-
5.3. **Contact for LLM License**: Organizations requiring LLM training rights must contact **Airhome Sp Zoo** at **robert@
|
|
58
|
+
5.3. **Contact for LLM License**: Organizations requiring LLM training rights must contact **Airhome Sp Zoo** at **robert.herring@resipilot.com** to arrange a separate licensing agreement.
|
|
59
59
|
|
|
60
60
|
## **6. Restrictions**
|
|
61
61
|
|
|
@@ -75,7 +75,7 @@ _Last Updated: 2025-06-29_
|
|
|
75
75
|
|
|
76
76
|
7.2. **Revenue Tier Reporting**: You are responsible for accurately reporting your revenue tier and upgrading to the appropriate pricing tier when revenue thresholds are exceeded.
|
|
77
77
|
|
|
78
|
-
7.3. **Rate Lock Process**: To lock in current pricing for all tiers, contact us at **robert@
|
|
78
|
+
7.3. **Rate Lock Process**: To lock in current pricing for all tiers, contact us at **robert.herring@resipilot.com**.
|
|
79
79
|
|
|
80
80
|
## **8. Disclaimer of Warranty**
|
|
81
81
|
|
|
@@ -109,8 +109,8 @@ _Last Updated: 2025-06-29_
|
|
|
109
109
|
|
|
110
110
|
## **12. Contact Information**
|
|
111
111
|
|
|
112
|
-
12.1. For general inquiries and rate lock requests, contact **Airhome Sp Zoo** at **robert@
|
|
113
|
-
12.2. For LLM training license inquiries, contact **Airhome Sp Zoo** at **robert@
|
|
112
|
+
12.1. For general inquiries and rate lock requests, contact **Airhome Sp Zoo** at **robert.herring@resipilot.com**.
|
|
113
|
+
12.2. For LLM training license inquiries, contact **Airhome Sp Zoo** at **robert.herring@resipilot.com**.
|
|
114
114
|
|
|
115
115
|
---
|
|
116
116
|
|
|
@@ -33,7 +33,6 @@ export class Model {
|
|
|
33
33
|
this._data = data;
|
|
34
34
|
this._pk = data[this.constructor.primaryKeyField] || undefined;
|
|
35
35
|
this.__version = 0;
|
|
36
|
-
this._isDirty = false;
|
|
37
36
|
return wrapReactiveModel(this);
|
|
38
37
|
}
|
|
39
38
|
touch() {
|
|
@@ -67,14 +66,7 @@ export class Model {
|
|
|
67
66
|
instance.pk = pk;
|
|
68
67
|
this.instanceCache.set(key, instance);
|
|
69
68
|
}
|
|
70
|
-
|
|
71
|
-
// If cached instance is dirty, return a fresh instance instead
|
|
72
|
-
if (cachedInstance._isDirty) {
|
|
73
|
-
const freshInstance = new this();
|
|
74
|
-
freshInstance.pk = pk;
|
|
75
|
-
return freshInstance;
|
|
76
|
-
}
|
|
77
|
-
return cachedInstance;
|
|
69
|
+
return this.instanceCache.get(key);
|
|
78
70
|
}
|
|
79
71
|
/**
|
|
80
72
|
* Gets a field value from the internal data store
|
|
@@ -92,7 +84,7 @@ export class Model {
|
|
|
92
84
|
// check local overrides
|
|
93
85
|
let value = this._data[field];
|
|
94
86
|
// if its not been overridden, get it from the store
|
|
95
|
-
if (value
|
|
87
|
+
if (isNil(value) && !isNil(this._pk)) {
|
|
96
88
|
let storedValue = modelStoreRegistry.getEntity(ModelClass, this._pk);
|
|
97
89
|
if (storedValue)
|
|
98
90
|
value = storedValue[field]; // if stops null -> undefined
|
|
@@ -153,7 +145,6 @@ export class Model {
|
|
|
153
145
|
this._pk = value;
|
|
154
146
|
}
|
|
155
147
|
else {
|
|
156
|
-
this._isDirty = true;
|
|
157
148
|
this._data[field] = value;
|
|
158
149
|
}
|
|
159
150
|
}
|
|
@@ -195,7 +186,7 @@ export class Model {
|
|
|
195
186
|
// check local overrides
|
|
196
187
|
let value = this._data[field];
|
|
197
188
|
// if it's not been overridden, get it from the store
|
|
198
|
-
if (value
|
|
189
|
+
if (isNil(value) && !isNil(this._pk)) {
|
|
199
190
|
let storedValue = modelStoreRegistry.getEntity(ModelClass, this._pk);
|
|
200
191
|
if (storedValue)
|
|
201
192
|
value = storedValue[field];
|
|
@@ -68,7 +68,7 @@ export class QuerysetStore {
|
|
|
68
68
|
}
|
|
69
69
|
async addOperation(operation) {
|
|
70
70
|
this.operationsMap.set(operation.operationId, operation);
|
|
71
|
-
if (this.operationsMap.size > this.pruneThreshold
|
|
71
|
+
if (this.operationsMap.size > this.pruneThreshold) {
|
|
72
72
|
this.prune();
|
|
73
73
|
}
|
|
74
74
|
this._emitRenderEvent();
|
|
@@ -116,10 +116,6 @@ export class QuerysetStore {
|
|
|
116
116
|
operation.status != Status.REJECTED);
|
|
117
117
|
}
|
|
118
118
|
prune() {
|
|
119
|
-
if (this.isSyncing) {
|
|
120
|
-
console.log(`[ModelStore ${this.modelClass.modelName}] Skipping prune - sync in progress`);
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
119
|
const renderedPks = this.render(false);
|
|
124
120
|
this.setGroundTruth(renderedPks);
|
|
125
121
|
this.setOperations(this.getInflightOperations());
|
|
@@ -186,16 +182,8 @@ export class QuerysetStore {
|
|
|
186
182
|
ast: this.queryset.build(),
|
|
187
183
|
modelClass: this.modelClass
|
|
188
184
|
});
|
|
189
|
-
if (!response || typeof response !== "object") {
|
|
190
|
-
throw new Error(`Invalid response structure from fetchFn`);
|
|
191
|
-
}
|
|
192
185
|
const { data, included } = response;
|
|
193
186
|
console.log(`[${id}] Sync fetch completed. Received: ${JSON.stringify(data)}.`);
|
|
194
|
-
if (!Array.isArray(data)) {
|
|
195
|
-
console.warn(`[${id}] fetchFn returned non-array data:`, typeof data);
|
|
196
|
-
// Don't update ground truth with invalid data
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
187
|
// Persists all the instances (including nested instances) to the model store
|
|
200
188
|
processIncludedEntities(modelStoreRegistry, included, this.modelClass);
|
|
201
189
|
this.setGroundTruth(data);
|
package/package.json
CHANGED
|
@@ -1,123 +1,123 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@statezero/core",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"module": "ESNext",
|
|
6
|
-
"description": "The type-safe frontend client for StateZero - connect directly to your backend models with zero boilerplate",
|
|
7
|
-
"main": "dist/index.js",
|
|
8
|
-
"types": "dist/index.d.ts",
|
|
9
|
-
"bin": {
|
|
10
|
-
"statezero": "dist/cli/index.js"
|
|
11
|
-
},
|
|
12
|
-
"exports": {
|
|
13
|
-
".": {
|
|
14
|
-
"import": "./dist/index.js",
|
|
15
|
-
"require": "./dist/index.js"
|
|
16
|
-
},
|
|
17
|
-
"./cli": {
|
|
18
|
-
"import": "./dist/cli/index.js",
|
|
19
|
-
"require": "./dist/cli/index.js"
|
|
20
|
-
},
|
|
21
|
-
"./react": {
|
|
22
|
-
"import": "./dist/react-entry.js",
|
|
23
|
-
"require": "./dist/react-entry.js"
|
|
24
|
-
},
|
|
25
|
-
"./vue": {
|
|
26
|
-
"import": "./dist/vue-entry.js",
|
|
27
|
-
"require": "./dist/vue-entry.js"
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
"scripts": {
|
|
31
|
-
"test": "vitest run --config=vitest.base.config.ts",
|
|
32
|
-
"test:e2e": "vitest run --config=vitest.sequential.config.ts tests/e2e",
|
|
33
|
-
"generate:test-apps": "ts-node scripts/generate-test-apps.js",
|
|
34
|
-
"test:adaptors": "playwright test tests/adaptors",
|
|
35
|
-
"test:coverage": "vitest run --coverage",
|
|
36
|
-
"build": "tsc",
|
|
37
|
-
"parse-queries": "node scripts/perfect-query-parser.js",
|
|
38
|
-
"sync-models": "node src/cli/index.js sync-models",
|
|
39
|
-
"sync-models:dev": "npx cross-env NODE_ENV=test npm run sync-models",
|
|
40
|
-
"clean": "npx rimraf dist",
|
|
41
|
-
"prepare": "npm run clean && npm run build",
|
|
42
|
-
"prepublishOnly": "npm run clean && npm run build"
|
|
43
|
-
},
|
|
44
|
-
"keywords": [
|
|
45
|
-
"typescript",
|
|
46
|
-
"orm",
|
|
47
|
-
"backend",
|
|
48
|
-
"frontend",
|
|
49
|
-
"database",
|
|
50
|
-
"sql",
|
|
51
|
-
"django",
|
|
52
|
-
"sqlalchemy",
|
|
53
|
-
"react",
|
|
54
|
-
"vue",
|
|
55
|
-
"svelte"
|
|
56
|
-
],
|
|
57
|
-
"author": "Robert Herring <robert.herring@resipilot.com>",
|
|
58
|
-
"license": "SEE LICENSE IN LICENSE",
|
|
59
|
-
"repository": {
|
|
60
|
-
"type": "git",
|
|
61
|
-
"url": "git+https://github.com/state-zero/statezero-client.git"
|
|
62
|
-
},
|
|
63
|
-
"files": [
|
|
64
|
-
"dist",
|
|
65
|
-
"LICENSE",
|
|
66
|
-
"README.md"
|
|
67
|
-
],
|
|
68
|
-
"homepage": "https://www.statezero.dev",
|
|
69
|
-
"dependencies": {
|
|
70
|
-
"axios": "^1.7.9",
|
|
71
|
-
"cli-progress": "^3.12.0",
|
|
72
|
-
"cosmiconfig": "^9.0.0",
|
|
73
|
-
"cosmiconfig-typescript-loader": "^6.1.0",
|
|
74
|
-
"date-fns": "^4.1.0",
|
|
75
|
-
"dotenv": "^16.4.7",
|
|
76
|
-
"fs-extra": "^11.3.0",
|
|
77
|
-
"handlebars": "^4.7.8",
|
|
78
|
-
"idb": "^8.0.2",
|
|
79
|
-
"inquirer": "^12.4.2",
|
|
80
|
-
"lodash-es": "^4.17.21",
|
|
81
|
-
"luxon": "^3.6.1",
|
|
82
|
-
"mathjs": "^14.4.0",
|
|
83
|
-
"mitt": "^3.0.1",
|
|
84
|
-
"mobx": "^6.13.7",
|
|
85
|
-
"mobx-utils": "^6.1.0",
|
|
86
|
-
"object-hash": "^3.0.0",
|
|
87
|
-
"openapi-typescript": "^6.7.1",
|
|
88
|
-
"p-queue": "^8.1.0",
|
|
89
|
-
"pusher-js": "^8.4.0",
|
|
90
|
-
"rfdc": "^1.4.1",
|
|
91
|
-
"sift": "^17.1.3",
|
|
92
|
-
"superjson": "^2.2.2",
|
|
93
|
-
"uuid": "^11.1.0",
|
|
94
|
-
"yargs": "^17.7.2",
|
|
95
|
-
"zod": "^3.24.2"
|
|
96
|
-
},
|
|
97
|
-
"devDependencies": {
|
|
98
|
-
"@playwright/test": "^1.50.1",
|
|
99
|
-
"@types/cli-progress": "^3.11.6",
|
|
100
|
-
"@types/lodash-es": "^4.17.12",
|
|
101
|
-
"@types/node": "^22.13.1",
|
|
102
|
-
"@types/react": "^18.3.18",
|
|
103
|
-
"@types/yargs": "^17.0.32",
|
|
104
|
-
"@vitest/coverage-v8": "^3.0.5",
|
|
105
|
-
"fake-indexeddb": "^6.0.0",
|
|
106
|
-
"fast-glob": "^3.3.3",
|
|
107
|
-
"react": "^18.2.0",
|
|
108
|
-
"rimraf": "^5.0.5",
|
|
109
|
-
"ts-node": "^10.9.2",
|
|
110
|
-
"typescript": "^5.7.3",
|
|
111
|
-
"vitest": "^3.0.5",
|
|
112
|
-
"vue": "^3.2.0"
|
|
113
|
-
},
|
|
114
|
-
"publishConfig": {
|
|
115
|
-
"access": "restricted"
|
|
116
|
-
},
|
|
117
|
-
"bugs": {
|
|
118
|
-
"url": "https://github.com/state-zero/statezero-client/issues"
|
|
119
|
-
},
|
|
120
|
-
"directories": {
|
|
121
|
-
"test": "tests"
|
|
122
|
-
}
|
|
123
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@statezero/core",
|
|
3
|
+
"version": "0.1.15",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"description": "The type-safe frontend client for StateZero - connect directly to your backend models with zero boilerplate",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"bin": {
|
|
10
|
+
"statezero": "dist/cli/index.js"
|
|
11
|
+
},
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": "./dist/index.js",
|
|
15
|
+
"require": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./cli": {
|
|
18
|
+
"import": "./dist/cli/index.js",
|
|
19
|
+
"require": "./dist/cli/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./react": {
|
|
22
|
+
"import": "./dist/react-entry.js",
|
|
23
|
+
"require": "./dist/react-entry.js"
|
|
24
|
+
},
|
|
25
|
+
"./vue": {
|
|
26
|
+
"import": "./dist/vue-entry.js",
|
|
27
|
+
"require": "./dist/vue-entry.js"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"test": "vitest run --config=vitest.base.config.ts",
|
|
32
|
+
"test:e2e": "vitest run --config=vitest.sequential.config.ts tests/e2e",
|
|
33
|
+
"generate:test-apps": "ts-node scripts/generate-test-apps.js",
|
|
34
|
+
"test:adaptors": "playwright test tests/adaptors",
|
|
35
|
+
"test:coverage": "vitest run --coverage",
|
|
36
|
+
"build": "tsc",
|
|
37
|
+
"parse-queries": "node scripts/perfect-query-parser.js",
|
|
38
|
+
"sync-models": "node src/cli/index.js sync-models",
|
|
39
|
+
"sync-models:dev": "npx cross-env NODE_ENV=test npm run sync-models",
|
|
40
|
+
"clean": "npx rimraf dist",
|
|
41
|
+
"prepare": "npm run clean && npm run build",
|
|
42
|
+
"prepublishOnly": "npm run clean && npm run build"
|
|
43
|
+
},
|
|
44
|
+
"keywords": [
|
|
45
|
+
"typescript",
|
|
46
|
+
"orm",
|
|
47
|
+
"backend",
|
|
48
|
+
"frontend",
|
|
49
|
+
"database",
|
|
50
|
+
"sql",
|
|
51
|
+
"django",
|
|
52
|
+
"sqlalchemy",
|
|
53
|
+
"react",
|
|
54
|
+
"vue",
|
|
55
|
+
"svelte"
|
|
56
|
+
],
|
|
57
|
+
"author": "Robert Herring <robert.herring@resipilot.com>",
|
|
58
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
59
|
+
"repository": {
|
|
60
|
+
"type": "git",
|
|
61
|
+
"url": "git+https://github.com/state-zero/statezero-client.git"
|
|
62
|
+
},
|
|
63
|
+
"files": [
|
|
64
|
+
"dist",
|
|
65
|
+
"LICENSE",
|
|
66
|
+
"README.md"
|
|
67
|
+
],
|
|
68
|
+
"homepage": "https://www.statezero.dev",
|
|
69
|
+
"dependencies": {
|
|
70
|
+
"axios": "^1.7.9",
|
|
71
|
+
"cli-progress": "^3.12.0",
|
|
72
|
+
"cosmiconfig": "^9.0.0",
|
|
73
|
+
"cosmiconfig-typescript-loader": "^6.1.0",
|
|
74
|
+
"date-fns": "^4.1.0",
|
|
75
|
+
"dotenv": "^16.4.7",
|
|
76
|
+
"fs-extra": "^11.3.0",
|
|
77
|
+
"handlebars": "^4.7.8",
|
|
78
|
+
"idb": "^8.0.2",
|
|
79
|
+
"inquirer": "^12.4.2",
|
|
80
|
+
"lodash-es": "^4.17.21",
|
|
81
|
+
"luxon": "^3.6.1",
|
|
82
|
+
"mathjs": "^14.4.0",
|
|
83
|
+
"mitt": "^3.0.1",
|
|
84
|
+
"mobx": "^6.13.7",
|
|
85
|
+
"mobx-utils": "^6.1.0",
|
|
86
|
+
"object-hash": "^3.0.0",
|
|
87
|
+
"openapi-typescript": "^6.7.1",
|
|
88
|
+
"p-queue": "^8.1.0",
|
|
89
|
+
"pusher-js": "^8.4.0",
|
|
90
|
+
"rfdc": "^1.4.1",
|
|
91
|
+
"sift": "^17.1.3",
|
|
92
|
+
"superjson": "^2.2.2",
|
|
93
|
+
"uuid": "^11.1.0",
|
|
94
|
+
"yargs": "^17.7.2",
|
|
95
|
+
"zod": "^3.24.2"
|
|
96
|
+
},
|
|
97
|
+
"devDependencies": {
|
|
98
|
+
"@playwright/test": "^1.50.1",
|
|
99
|
+
"@types/cli-progress": "^3.11.6",
|
|
100
|
+
"@types/lodash-es": "^4.17.12",
|
|
101
|
+
"@types/node": "^22.13.1",
|
|
102
|
+
"@types/react": "^18.3.18",
|
|
103
|
+
"@types/yargs": "^17.0.32",
|
|
104
|
+
"@vitest/coverage-v8": "^3.0.5",
|
|
105
|
+
"fake-indexeddb": "^6.0.0",
|
|
106
|
+
"fast-glob": "^3.3.3",
|
|
107
|
+
"react": "^18.2.0",
|
|
108
|
+
"rimraf": "^5.0.5",
|
|
109
|
+
"ts-node": "^10.9.2",
|
|
110
|
+
"typescript": "^5.7.3",
|
|
111
|
+
"vitest": "^3.0.5",
|
|
112
|
+
"vue": "^3.2.0"
|
|
113
|
+
},
|
|
114
|
+
"publishConfig": {
|
|
115
|
+
"access": "restricted"
|
|
116
|
+
},
|
|
117
|
+
"bugs": {
|
|
118
|
+
"url": "https://github.com/state-zero/statezero-client/issues"
|
|
119
|
+
},
|
|
120
|
+
"directories": {
|
|
121
|
+
"test": "tests"
|
|
122
|
+
}
|
|
123
|
+
}
|