@kinotic-ai/os-api 1.0.0-beta.0 → 1.0.0-beta.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/README.md +64 -0
- package/dist/index.cjs +607 -0
- package/dist/index.d.cts +793 -0
- package/dist/index.d.ts +793 -0
- package/dist/index.js +564 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# @kinotic-ai/os-api
|
|
2
|
+
|
|
3
|
+
The high-level TypeScript API for managing everything in your Kinotic cloud OS. `@kinotic-ai/os-api` puts the full power of the platform in your hands — create applications, define data schemas, run migrations, manage queries, and monitor your system, all from code. It is the control plane for teams that want to automate and programmatically manage their Kinotic environment end to end.
|
|
4
|
+
|
|
5
|
+
**[Get started at kinotic.ai/getting-started](https://kinotic.ai/getting-started)**
|
|
6
|
+
|
|
7
|
+
> **Who is this for?** `@kinotic-ai/os-api` is intended for teams **building or extending Kinotic OS itself** — platform engineers managing the control plane, provisioning tooling, or internal infrastructure. If you are building an application *on top of* Kinotic OS, you most likely want [`@kinotic-ai/persistence`](https://www.npmjs.com/package/@kinotic-ai/persistence) and [`@kinotic-ai/core`](https://www.npmjs.com/package/@kinotic-ai/core) instead.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Why @kinotic-ai/os-api?
|
|
12
|
+
|
|
13
|
+
- **Manage your whole cloud OS from code.** Applications, projects, schemas, migrations, and analytics are all first-class operations — no console required.
|
|
14
|
+
- **Ship data APIs in seconds.** Publish a schema at runtime and the platform creates storage, REST endpoints, and a GraphQL schema automatically.
|
|
15
|
+
- **Migrations as code.** Run and track schema migrations programmatically, not through ad-hoc scripts or manual steps.
|
|
16
|
+
- **One line to activate.** Plugs directly into your existing Kinotic connection — no additional setup, no separate configuration.
|
|
17
|
+
- **Full observability built in.** Structured logging and built-in analytics give you visibility into your applications without extra tooling.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Features
|
|
22
|
+
|
|
23
|
+
### Application and Project Management
|
|
24
|
+
Create, configure, and manage cloud applications and projects programmatically. Automate provisioning as part of your deployment pipeline rather than through manual console operations.
|
|
25
|
+
|
|
26
|
+
### Runtime Schema Publishing
|
|
27
|
+
Define and publish new data schemas at runtime. The moment a schema is published, the platform creates the backing storage, generates REST API endpoints, and builds the corresponding GraphQL schema — all automatically.
|
|
28
|
+
|
|
29
|
+
### Schema Migrations
|
|
30
|
+
Run and track schema migrations from your application code. Migration state is managed by the platform, so you always know what has been applied and what is pending.
|
|
31
|
+
|
|
32
|
+
### Named Query Management
|
|
33
|
+
Define, publish, and manage reusable parameterized queries across your platform. Queries are platform-level resources — shared, versioned, and callable by any service.
|
|
34
|
+
|
|
35
|
+
### Analytics and Data Insights
|
|
36
|
+
Built-in analytics give you operational visibility into your applications and data without instrumenting your own pipeline. Query usage, data trends, and system health are available directly through the API.
|
|
37
|
+
|
|
38
|
+
### Structured Application Logging
|
|
39
|
+
Emit structured, searchable logs from the client side using the same logging infrastructure the platform uses. No separate log aggregation setup required.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Part of the Kinotic Ecosystem
|
|
44
|
+
|
|
45
|
+
`@kinotic-ai/os-api` sits at the top of the Kinotic JavaScript/TypeScript stack:
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
@kinotic-ai/os-api ← cloud OS management (this package)
|
|
49
|
+
@kinotic-ai/persistence ← schema-driven data access
|
|
50
|
+
@kinotic-ai/idl ← cross-language type schemas
|
|
51
|
+
@kinotic-ai/core ← connection & transport
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
It builds on the full stack below it. Install `@kinotic-ai/core` for the connection, add `@kinotic-ai/idl` and `@kinotic-ai/persistence` for data access, and use `@kinotic-ai/os-api` when you need to manage the platform itself.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Installation
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npm install @kinotic-ai/os-api
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
For full documentation, guides, and API reference, visit **[kinotic.ai](https://kinotic.ai)**.
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,607 @@
|
|
|
1
|
+
var import_node_module = require("node:module");
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
function __accessProp(key) {
|
|
7
|
+
return this[key];
|
|
8
|
+
}
|
|
9
|
+
var __toCommonJS = (from) => {
|
|
10
|
+
var entry = (__moduleCache ??= new WeakMap).get(from), desc;
|
|
11
|
+
if (entry)
|
|
12
|
+
return entry;
|
|
13
|
+
entry = __defProp({}, "__esModule", { value: true });
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (var key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(entry, key))
|
|
17
|
+
__defProp(entry, key, {
|
|
18
|
+
get: __accessProp.bind(from, key),
|
|
19
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
__moduleCache.set(from, entry);
|
|
23
|
+
return entry;
|
|
24
|
+
};
|
|
25
|
+
var __moduleCache;
|
|
26
|
+
var __returnValue = (v) => v;
|
|
27
|
+
function __exportSetter(name, newValue) {
|
|
28
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
29
|
+
}
|
|
30
|
+
var __export = (target, all) => {
|
|
31
|
+
for (var name in all)
|
|
32
|
+
__defProp(target, name, {
|
|
33
|
+
get: all[name],
|
|
34
|
+
enumerable: true,
|
|
35
|
+
configurable: true,
|
|
36
|
+
set: __exportSetter.bind(all, name)
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// packages/os-api/src/index.ts
|
|
41
|
+
var exports_src = {};
|
|
42
|
+
__export(exports_src, {
|
|
43
|
+
VersionDecorator: () => VersionDecorator,
|
|
44
|
+
TypescriptProjectConfig: () => TypescriptProjectConfig,
|
|
45
|
+
TypescriptExternalProjectConfig: () => TypescriptExternalProjectConfig,
|
|
46
|
+
TransformConfiguration: () => TransformConfiguration,
|
|
47
|
+
TimeReferenceDecorator: () => TimeReferenceDecorator,
|
|
48
|
+
TextDecorator: () => TextDecorator,
|
|
49
|
+
TenantSelectionC3Type: () => TenantSelectionC3Type,
|
|
50
|
+
TenantIdDecorator: () => TenantIdDecorator,
|
|
51
|
+
StructuresProjectConfig: () => StructuresProjectConfig,
|
|
52
|
+
SingleLoggerLevelsDescriptor: () => SingleLoggerLevelsDescriptor,
|
|
53
|
+
RoleDecorator: () => RoleDecorator,
|
|
54
|
+
QueryOptionsC3Type: () => QueryOptionsC3Type,
|
|
55
|
+
QueryDecorator: () => QueryDecorator,
|
|
56
|
+
ProjectType: () => ProjectType,
|
|
57
|
+
ProjectService: () => ProjectService,
|
|
58
|
+
Project: () => Project,
|
|
59
|
+
ProgressType: () => ProgressType,
|
|
60
|
+
PolicyDecorator: () => PolicyDecorator,
|
|
61
|
+
PageableC3Type: () => PageableC3Type,
|
|
62
|
+
PageC3Type: () => PageC3Type,
|
|
63
|
+
OverrideConfiguration: () => OverrideConfiguration,
|
|
64
|
+
OsApiPlugin: () => OsApiPlugin,
|
|
65
|
+
NotIndexedDecorator: () => NotIndexedDecorator,
|
|
66
|
+
NestedDecorator: () => NestedDecorator,
|
|
67
|
+
NamedQueriesService: () => NamedQueriesService,
|
|
68
|
+
NamedQueriesDefinition: () => NamedQueriesDefinition,
|
|
69
|
+
MigrationService: () => MigrationService,
|
|
70
|
+
LoggersDescriptor: () => LoggersDescriptor,
|
|
71
|
+
LoggerLevelsDescriptor: () => LoggerLevelsDescriptor,
|
|
72
|
+
LogManager: () => LogManager,
|
|
73
|
+
LogLevel: () => LogLevel,
|
|
74
|
+
IdDecorator: () => IdDecorator,
|
|
75
|
+
GroupLoggerLevelsDescriptor: () => GroupLoggerLevelsDescriptor,
|
|
76
|
+
FlattenedDecorator: () => FlattenedDecorator,
|
|
77
|
+
EsIndexConfigurationDecorator: () => EsIndexConfigurationDecorator,
|
|
78
|
+
EntityDefinitionService: () => EntityDefinitionService,
|
|
79
|
+
EntityDefinition: () => EntityDefinition,
|
|
80
|
+
EntityDecorator: () => EntityDecorator,
|
|
81
|
+
EntityConfiguration: () => EntityConfiguration,
|
|
82
|
+
DiscriminatorDecorator: () => DiscriminatorDecorator,
|
|
83
|
+
DataInsightsService: () => DataInsightsService,
|
|
84
|
+
CalculatedPropertyConfiguration: () => CalculatedPropertyConfiguration,
|
|
85
|
+
AutoGeneratedIdDecorator: () => AutoGeneratedIdDecorator,
|
|
86
|
+
ApplicationService: () => ApplicationService,
|
|
87
|
+
Application: () => Application,
|
|
88
|
+
$Role: () => $Role,
|
|
89
|
+
$Policy: () => $Policy
|
|
90
|
+
});
|
|
91
|
+
module.exports = __toCommonJS(exports_src);
|
|
92
|
+
|
|
93
|
+
// packages/os-api/src/api/model/idl/decorators/AutoGeneratedIdDecorator.ts
|
|
94
|
+
var import_idl = require("@kinotic-ai/idl");
|
|
95
|
+
|
|
96
|
+
class AutoGeneratedIdDecorator extends import_idl.C3Decorator {
|
|
97
|
+
constructor() {
|
|
98
|
+
super();
|
|
99
|
+
this.type = "AutoGeneratedId";
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
// packages/os-api/src/api/model/idl/decorators/DiscriminatorDecorator.ts
|
|
103
|
+
var import_idl2 = require("@kinotic-ai/idl");
|
|
104
|
+
|
|
105
|
+
class DiscriminatorDecorator extends import_idl2.C3Decorator {
|
|
106
|
+
propertyName;
|
|
107
|
+
constructor() {
|
|
108
|
+
super();
|
|
109
|
+
this.type = "Discriminator";
|
|
110
|
+
}
|
|
111
|
+
withPropertyName(propertyName) {
|
|
112
|
+
this.propertyName = propertyName;
|
|
113
|
+
return this;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
// packages/os-api/src/api/model/idl/decorators/EntityDecorator.ts
|
|
117
|
+
var import_persistence = require("@kinotic-ai/persistence");
|
|
118
|
+
var import_idl3 = require("@kinotic-ai/idl");
|
|
119
|
+
|
|
120
|
+
class EntityDecorator extends import_idl3.C3Decorator {
|
|
121
|
+
multiTenancyType = import_persistence.MultiTenancyType.NONE;
|
|
122
|
+
entityType = import_persistence.EntityType.TABLE;
|
|
123
|
+
constructor() {
|
|
124
|
+
super();
|
|
125
|
+
this.type = "Entity";
|
|
126
|
+
}
|
|
127
|
+
withMultiTenancyType(type) {
|
|
128
|
+
this.multiTenancyType = type;
|
|
129
|
+
return this;
|
|
130
|
+
}
|
|
131
|
+
withEntityType(type) {
|
|
132
|
+
this.entityType = type;
|
|
133
|
+
return this;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
// packages/os-api/src/api/model/idl/decorators/EsIndexConfigurationDecorator.ts
|
|
137
|
+
var import_idl4 = require("@kinotic-ai/idl");
|
|
138
|
+
|
|
139
|
+
class EsIndexConfigurationDecorator extends import_idl4.C3Decorator {
|
|
140
|
+
value;
|
|
141
|
+
constructor() {
|
|
142
|
+
super();
|
|
143
|
+
this.type = "EsIndexConfigurationDecorator";
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
// packages/os-api/src/api/model/idl/decorators/FlattenedDecorator.ts
|
|
147
|
+
var import_idl5 = require("@kinotic-ai/idl");
|
|
148
|
+
|
|
149
|
+
class FlattenedDecorator extends import_idl5.C3Decorator {
|
|
150
|
+
constructor() {
|
|
151
|
+
super();
|
|
152
|
+
this.type = "Flattened";
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
// packages/os-api/src/api/model/idl/decorators/IdDecorator.ts
|
|
156
|
+
var import_idl6 = require("@kinotic-ai/idl");
|
|
157
|
+
|
|
158
|
+
class IdDecorator extends import_idl6.C3Decorator {
|
|
159
|
+
constructor() {
|
|
160
|
+
super();
|
|
161
|
+
this.type = "Id";
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
// packages/os-api/src/api/model/idl/decorators/NestedDecorator.ts
|
|
165
|
+
var import_idl7 = require("@kinotic-ai/idl");
|
|
166
|
+
|
|
167
|
+
class NestedDecorator extends import_idl7.C3Decorator {
|
|
168
|
+
constructor() {
|
|
169
|
+
super();
|
|
170
|
+
this.type = "Nested";
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
// packages/os-api/src/api/model/idl/decorators/NotIndexedDecorator.ts
|
|
174
|
+
var import_idl8 = require("@kinotic-ai/idl");
|
|
175
|
+
|
|
176
|
+
class NotIndexedDecorator extends import_idl8.C3Decorator {
|
|
177
|
+
constructor() {
|
|
178
|
+
super();
|
|
179
|
+
this.type = "NotIndexedDecorator";
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
// packages/os-api/src/api/model/idl/decorators/PolicyDecorator.ts
|
|
183
|
+
var import_persistence2 = require("@kinotic-ai/persistence");
|
|
184
|
+
|
|
185
|
+
class PolicyDecorator extends import_persistence2.EntityServiceDecorator {
|
|
186
|
+
policies;
|
|
187
|
+
constructor(policies) {
|
|
188
|
+
super();
|
|
189
|
+
this.type = "PolicyDecorator";
|
|
190
|
+
this.policies = policies;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
function $Policy(policies) {
|
|
194
|
+
return new PolicyDecorator(policies);
|
|
195
|
+
}
|
|
196
|
+
// packages/os-api/src/api/model/idl/decorators/QueryDecorator.ts
|
|
197
|
+
var import_idl9 = require("@kinotic-ai/idl");
|
|
198
|
+
|
|
199
|
+
class QueryDecorator extends import_idl9.C3Decorator {
|
|
200
|
+
statements;
|
|
201
|
+
constructor(statements) {
|
|
202
|
+
super();
|
|
203
|
+
this.type = "Query";
|
|
204
|
+
this.statements = statements;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
// packages/os-api/src/api/model/idl/decorators/RoleDecorator.ts
|
|
208
|
+
var import_persistence3 = require("@kinotic-ai/persistence");
|
|
209
|
+
|
|
210
|
+
class RoleDecorator extends import_persistence3.EntityServiceDecorator {
|
|
211
|
+
roles;
|
|
212
|
+
constructor(roles) {
|
|
213
|
+
super();
|
|
214
|
+
this.type = "RoleDecorator";
|
|
215
|
+
this.roles = roles;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
function $Role(roles) {
|
|
219
|
+
return new RoleDecorator(roles);
|
|
220
|
+
}
|
|
221
|
+
// packages/os-api/src/api/model/idl/decorators/TenantIdDecorator.ts
|
|
222
|
+
var import_idl10 = require("@kinotic-ai/idl");
|
|
223
|
+
|
|
224
|
+
class TenantIdDecorator extends import_idl10.C3Decorator {
|
|
225
|
+
constructor() {
|
|
226
|
+
super();
|
|
227
|
+
this.type = "TenantIdDecorator";
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
// packages/os-api/src/api/model/idl/decorators/TextDecorator.ts
|
|
231
|
+
var import_idl11 = require("@kinotic-ai/idl");
|
|
232
|
+
|
|
233
|
+
class TextDecorator extends import_idl11.C3Decorator {
|
|
234
|
+
constructor() {
|
|
235
|
+
super();
|
|
236
|
+
this.type = "Text";
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
// packages/os-api/src/api/model/idl/decorators/TimeReferenceDecorator.ts
|
|
240
|
+
var import_idl12 = require("@kinotic-ai/idl");
|
|
241
|
+
|
|
242
|
+
class TimeReferenceDecorator extends import_idl12.C3Decorator {
|
|
243
|
+
constructor() {
|
|
244
|
+
super();
|
|
245
|
+
this.type = "TimeReferenceDecorator";
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
// packages/os-api/src/api/model/idl/decorators/VersionDecorator.ts
|
|
249
|
+
var import_idl13 = require("@kinotic-ai/idl");
|
|
250
|
+
|
|
251
|
+
class VersionDecorator extends import_idl13.C3Decorator {
|
|
252
|
+
constructor() {
|
|
253
|
+
super();
|
|
254
|
+
this.type = "VersionDecorator";
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
// packages/os-api/src/api/model/idl/PageC3Type.ts
|
|
258
|
+
var import_idl14 = require("@kinotic-ai/idl");
|
|
259
|
+
|
|
260
|
+
class PageC3Type extends import_idl14.C3Type {
|
|
261
|
+
contentType;
|
|
262
|
+
constructor(contentType) {
|
|
263
|
+
super("page");
|
|
264
|
+
this.contentType = contentType;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
// packages/os-api/src/api/model/idl/PageableC3Type.ts
|
|
268
|
+
var import_idl15 = require("@kinotic-ai/idl");
|
|
269
|
+
|
|
270
|
+
class PageableC3Type extends import_idl15.C3Type {
|
|
271
|
+
constructor() {
|
|
272
|
+
super("pageable");
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
// packages/os-api/src/api/model/idl/QueryOptionsC3Type.ts
|
|
276
|
+
var import_idl16 = require("@kinotic-ai/idl");
|
|
277
|
+
|
|
278
|
+
class QueryOptionsC3Type extends import_idl16.ObjectC3Type {
|
|
279
|
+
type = "queryOptions";
|
|
280
|
+
constructor() {
|
|
281
|
+
super("QueryOptions", "org.kinotic.structures.domain");
|
|
282
|
+
this.addProperty("timeZone", new import_idl16.StringC3Type);
|
|
283
|
+
this.addProperty("requestTimeout", new import_idl16.IntC3Type);
|
|
284
|
+
this.addProperty("pageTimeout", new import_idl16.StringC3Type);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
// packages/os-api/src/api/model/idl/TenantSelectionC3Type.ts
|
|
288
|
+
var import_idl17 = require("@kinotic-ai/idl");
|
|
289
|
+
|
|
290
|
+
class TenantSelectionC3Type extends import_idl17.ArrayC3Type {
|
|
291
|
+
type = "tenantSelection";
|
|
292
|
+
constructor() {
|
|
293
|
+
super(new import_idl17.StringC3Type);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
// packages/os-api/src/api/model/Application.ts
|
|
297
|
+
class Application {
|
|
298
|
+
id;
|
|
299
|
+
description;
|
|
300
|
+
updated = null;
|
|
301
|
+
enableGraphQL = false;
|
|
302
|
+
enableOpenAPI = false;
|
|
303
|
+
constructor(id, description) {
|
|
304
|
+
this.id = id;
|
|
305
|
+
this.description = description;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
// packages/os-api/src/api/model/Project.ts
|
|
309
|
+
class Project {
|
|
310
|
+
id = null;
|
|
311
|
+
applicationId;
|
|
312
|
+
name;
|
|
313
|
+
description;
|
|
314
|
+
sourceOfTruth = null;
|
|
315
|
+
updated = null;
|
|
316
|
+
constructor(id, applicationId, name, description) {
|
|
317
|
+
this.id = id;
|
|
318
|
+
this.applicationId = applicationId;
|
|
319
|
+
this.name = name;
|
|
320
|
+
this.description = description;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
// packages/os-api/src/api/model/ProjectType.ts
|
|
324
|
+
var ProjectType;
|
|
325
|
+
((ProjectType2) => {
|
|
326
|
+
ProjectType2[ProjectType2["TYPESCRIPT"] = 0] = "TYPESCRIPT";
|
|
327
|
+
ProjectType2[ProjectType2["GRAPHQL"] = 1] = "GRAPHQL";
|
|
328
|
+
ProjectType2[ProjectType2["GRAPHICAL"] = 2] = "GRAPHICAL";
|
|
329
|
+
ProjectType2[ProjectType2["ELASTICSEARCH"] = 3] = "ELASTICSEARCH";
|
|
330
|
+
})(ProjectType ||= {});
|
|
331
|
+
// packages/os-api/src/api/model/EntityDefinition.ts
|
|
332
|
+
class EntityDefinition {
|
|
333
|
+
id;
|
|
334
|
+
applicationId;
|
|
335
|
+
projectId;
|
|
336
|
+
name;
|
|
337
|
+
entityDefinition;
|
|
338
|
+
description;
|
|
339
|
+
created;
|
|
340
|
+
updated;
|
|
341
|
+
published;
|
|
342
|
+
publishedTimestamp;
|
|
343
|
+
constructor(applicationId, projectId, name, entityDefinition, description) {
|
|
344
|
+
this.applicationId = applicationId;
|
|
345
|
+
this.projectId = projectId;
|
|
346
|
+
this.name = name;
|
|
347
|
+
this.entityDefinition = entityDefinition;
|
|
348
|
+
this.description = description;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
// packages/os-api/src/api/model/NamedQueriesDefinition.ts
|
|
352
|
+
class NamedQueriesDefinition {
|
|
353
|
+
id;
|
|
354
|
+
applicationId;
|
|
355
|
+
projectId;
|
|
356
|
+
structure;
|
|
357
|
+
namedQueries;
|
|
358
|
+
constructor(id, applicationId, projectId, structure, namedQueries) {
|
|
359
|
+
this.id = id;
|
|
360
|
+
this.applicationId = applicationId;
|
|
361
|
+
this.projectId = projectId;
|
|
362
|
+
this.structure = structure;
|
|
363
|
+
this.namedQueries = namedQueries;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
// packages/os-api/src/api/model/config/CalculatedPropertyConfiguration.ts
|
|
367
|
+
class CalculatedPropertyConfiguration {
|
|
368
|
+
entityJsonPath;
|
|
369
|
+
propertyName;
|
|
370
|
+
calculatedPropertyFunctionName;
|
|
371
|
+
decorators;
|
|
372
|
+
}
|
|
373
|
+
// packages/os-api/src/api/model/config/EntityConfiguration.ts
|
|
374
|
+
class EntityConfiguration {
|
|
375
|
+
entityName;
|
|
376
|
+
multiTenancyType;
|
|
377
|
+
excludeJsonPaths;
|
|
378
|
+
overrides;
|
|
379
|
+
transforms;
|
|
380
|
+
calculatedProperties;
|
|
381
|
+
}
|
|
382
|
+
// packages/os-api/src/api/model/config/OverrideConfiguration.ts
|
|
383
|
+
class OverrideConfiguration {
|
|
384
|
+
jsonPath;
|
|
385
|
+
propertyDefinition;
|
|
386
|
+
}
|
|
387
|
+
// packages/os-api/src/api/model/config/StructuresProjectConfig.ts
|
|
388
|
+
class StructuresProjectConfig {
|
|
389
|
+
mdl;
|
|
390
|
+
name;
|
|
391
|
+
description;
|
|
392
|
+
application;
|
|
393
|
+
entitiesPaths;
|
|
394
|
+
generatedPath;
|
|
395
|
+
fileExtensionForImports = ".js";
|
|
396
|
+
validate;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
class TypescriptProjectConfig extends StructuresProjectConfig {
|
|
400
|
+
mdl = "ts";
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
class TypescriptExternalProjectConfig extends StructuresProjectConfig {
|
|
404
|
+
mdl = "ts-external";
|
|
405
|
+
externalEntities;
|
|
406
|
+
utilFunctionsPaths;
|
|
407
|
+
}
|
|
408
|
+
// packages/os-api/src/api/model/config/TransformConfiguration.ts
|
|
409
|
+
class TransformConfiguration {
|
|
410
|
+
jsonPath;
|
|
411
|
+
transformerFunctionName;
|
|
412
|
+
}
|
|
413
|
+
// packages/os-api/src/api/model/insights/InsightProgress.ts
|
|
414
|
+
var ProgressType;
|
|
415
|
+
((ProgressType2) => {
|
|
416
|
+
ProgressType2["STARTED"] = "STARTED";
|
|
417
|
+
ProgressType2["ANALYZING"] = "ANALYZING";
|
|
418
|
+
ProgressType2["DISCOVERING_DATA"] = "DISCOVERING_DATA";
|
|
419
|
+
ProgressType2["GENERATING_CODE"] = "GENERATING_CODE";
|
|
420
|
+
ProgressType2["COMPONENTS_READY"] = "COMPONENTS_READY";
|
|
421
|
+
ProgressType2["COMPLETED"] = "COMPLETED";
|
|
422
|
+
ProgressType2["ERROR"] = "ERROR";
|
|
423
|
+
})(ProgressType ||= {});
|
|
424
|
+
// packages/os-api/src/api/services/IApplicationService.ts
|
|
425
|
+
var import_core = require("@kinotic-ai/core");
|
|
426
|
+
|
|
427
|
+
class ApplicationService extends import_core.CrudServiceProxy {
|
|
428
|
+
constructor(kinotic) {
|
|
429
|
+
super(kinotic.serviceProxy("org.kinotic.structures.api.services.ApplicationService"));
|
|
430
|
+
}
|
|
431
|
+
createApplicationIfNotExist(id, description) {
|
|
432
|
+
return this.serviceProxy.invoke("createApplicationIfNotExist", [id, description]);
|
|
433
|
+
}
|
|
434
|
+
syncIndex() {
|
|
435
|
+
return this.serviceProxy.invoke("syncIndex", []);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
// packages/os-api/src/api/services/ILogManager.ts
|
|
439
|
+
var LogLevel;
|
|
440
|
+
((LogLevel2) => {
|
|
441
|
+
LogLevel2["TRACE"] = "TRACE";
|
|
442
|
+
LogLevel2["DEBUG"] = "DEBUG";
|
|
443
|
+
LogLevel2["INFO"] = "INFO";
|
|
444
|
+
LogLevel2["WARN"] = "WARN";
|
|
445
|
+
LogLevel2["ERROR"] = "ERROR";
|
|
446
|
+
LogLevel2["FATAL"] = "FATAL";
|
|
447
|
+
LogLevel2["OFF"] = "OFF";
|
|
448
|
+
})(LogLevel ||= {});
|
|
449
|
+
|
|
450
|
+
class LoggerLevelsDescriptor {
|
|
451
|
+
configuredLevel;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
class GroupLoggerLevelsDescriptor extends LoggerLevelsDescriptor {
|
|
455
|
+
members = [];
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
class SingleLoggerLevelsDescriptor extends LoggerLevelsDescriptor {
|
|
459
|
+
effectiveLevel;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
class LoggersDescriptor {
|
|
463
|
+
levels = [];
|
|
464
|
+
loggerLevels = new Map;
|
|
465
|
+
groups = new Map;
|
|
466
|
+
}
|
|
467
|
+
// packages/os-api/src/api/services/IProjectService.ts
|
|
468
|
+
var import_core2 = require("@kinotic-ai/core");
|
|
469
|
+
|
|
470
|
+
class ProjectService extends import_core2.CrudServiceProxy {
|
|
471
|
+
constructor(kinotic) {
|
|
472
|
+
super(kinotic.serviceProxy("org.kinotic.structures.api.services.ProjectService"));
|
|
473
|
+
}
|
|
474
|
+
countForApplication(applicationId) {
|
|
475
|
+
return this.serviceProxy.invoke("countForApplication", [applicationId]);
|
|
476
|
+
}
|
|
477
|
+
createProjectIfNotExist(project) {
|
|
478
|
+
return this.serviceProxy.invoke("createProjectIfNotExist", [project]);
|
|
479
|
+
}
|
|
480
|
+
async findAllForApplication(applicationId, pageable) {
|
|
481
|
+
const page = await this.findAllForApplicationSinglePage(applicationId, pageable);
|
|
482
|
+
return new import_core2.FunctionalIterablePage(pageable, page, (pageable2) => this.findAllForApplicationSinglePage(applicationId, pageable2));
|
|
483
|
+
}
|
|
484
|
+
findAllForApplicationSinglePage(applicationId, pageable) {
|
|
485
|
+
return this.serviceProxy.invoke("findAllForApplication", [applicationId, pageable]);
|
|
486
|
+
}
|
|
487
|
+
syncIndex() {
|
|
488
|
+
return this.serviceProxy.invoke("syncIndex", []);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
// packages/os-api/src/api/services/LogManager.ts
|
|
492
|
+
class LogManager {
|
|
493
|
+
serviceProxy;
|
|
494
|
+
constructor(kinotic) {
|
|
495
|
+
this.serviceProxy = kinotic.serviceProxy("org.kinotic.os.api.services.LogManager");
|
|
496
|
+
}
|
|
497
|
+
loggers(nodeId) {
|
|
498
|
+
return this.serviceProxy.invoke("loggers", null, nodeId);
|
|
499
|
+
}
|
|
500
|
+
async loggerLevels(nodeId, name) {
|
|
501
|
+
const data = await this.serviceProxy.invoke("loggerLevels", [name], nodeId);
|
|
502
|
+
let ret = null;
|
|
503
|
+
if (data.hasOwnProperty("members")) {
|
|
504
|
+
ret = new GroupLoggerLevelsDescriptor;
|
|
505
|
+
} else if (data.hasOwnProperty("effectiveLevel")) {
|
|
506
|
+
ret = new SingleLoggerLevelsDescriptor;
|
|
507
|
+
} else {
|
|
508
|
+
ret = new LoggerLevelsDescriptor;
|
|
509
|
+
}
|
|
510
|
+
Object.assign(ret, data);
|
|
511
|
+
return ret;
|
|
512
|
+
}
|
|
513
|
+
configureLogLevel(nodeId, name, level) {
|
|
514
|
+
return this.serviceProxy.invoke("configureLogLevel", [name, level], nodeId);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
// packages/os-api/src/api/services/IEntityDefinitionService.ts
|
|
518
|
+
var import_core3 = require("@kinotic-ai/core");
|
|
519
|
+
|
|
520
|
+
class EntityDefinitionService extends import_core3.CrudServiceProxy {
|
|
521
|
+
constructor(kinotic) {
|
|
522
|
+
super(kinotic.serviceProxy("org.kinotic.persistence.api.services.EntityDefinitionService"));
|
|
523
|
+
}
|
|
524
|
+
countForApplication(applicationId) {
|
|
525
|
+
return this.serviceProxy.invoke("countForApplication", [applicationId]);
|
|
526
|
+
}
|
|
527
|
+
countForProject(projectId) {
|
|
528
|
+
return this.serviceProxy.invoke("countForProject", [projectId]);
|
|
529
|
+
}
|
|
530
|
+
findAllForApplicationSinglePage(applicationId, pageable) {
|
|
531
|
+
return this.serviceProxy.invoke("findAllForApplication", [applicationId, pageable]);
|
|
532
|
+
}
|
|
533
|
+
async findAllForApplication(applicationId, pageable) {
|
|
534
|
+
const page = await this.findAllForApplicationSinglePage(applicationId, pageable);
|
|
535
|
+
return new import_core3.FunctionalIterablePage(pageable, page, (pageable2) => this.findAllForApplicationSinglePage(applicationId, pageable2));
|
|
536
|
+
}
|
|
537
|
+
findAllPublishedForApplication(applicationId, pageable) {
|
|
538
|
+
return this.serviceProxy.invoke("findAllPublishedForApplication", [applicationId, pageable]);
|
|
539
|
+
}
|
|
540
|
+
async findAllForProject(projectId, pageable) {
|
|
541
|
+
const page = await this.findAllForProjectSinglePage(projectId, pageable);
|
|
542
|
+
return new import_core3.FunctionalIterablePage(pageable, page, (pageable2) => this.findAllForProjectSinglePage(projectId, pageable2));
|
|
543
|
+
}
|
|
544
|
+
findAllForProjectSinglePage(projectId, pageable) {
|
|
545
|
+
return this.serviceProxy.invoke("findAllForProject", [projectId, pageable]);
|
|
546
|
+
}
|
|
547
|
+
publish(entityDefinitionId) {
|
|
548
|
+
return this.serviceProxy.invoke("publish", [entityDefinitionId]);
|
|
549
|
+
}
|
|
550
|
+
unPublish(entityDefinitionId) {
|
|
551
|
+
return this.serviceProxy.invoke("unPublish", [entityDefinitionId]);
|
|
552
|
+
}
|
|
553
|
+
syncIndex() {
|
|
554
|
+
return this.serviceProxy.invoke("syncIndex", []);
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
// packages/os-api/src/api/services/INamedQueriesService.ts
|
|
558
|
+
var import_core4 = require("@kinotic-ai/core");
|
|
559
|
+
|
|
560
|
+
class NamedQueriesService extends import_core4.CrudServiceProxy {
|
|
561
|
+
constructor(kinotic) {
|
|
562
|
+
super(kinotic.serviceProxy("org.kinotic.persistence.api.services.NamedQueriesService"));
|
|
563
|
+
}
|
|
564
|
+
syncIndex() {
|
|
565
|
+
return this.serviceProxy.invoke("syncIndex", []);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
// packages/os-api/src/api/services/IMigrationService.ts
|
|
569
|
+
class MigrationService {
|
|
570
|
+
serviceProxy;
|
|
571
|
+
constructor(kinotic) {
|
|
572
|
+
this.serviceProxy = kinotic.serviceProxy("org.kinotic.persistence.api.services.MigrationService");
|
|
573
|
+
}
|
|
574
|
+
executeMigrations(migrationRequest) {
|
|
575
|
+
return this.serviceProxy.invoke("executeMigrations", [migrationRequest]);
|
|
576
|
+
}
|
|
577
|
+
getLastAppliedMigrationVersion(projectId) {
|
|
578
|
+
return this.serviceProxy.invoke("getLastAppliedMigrationVersion", [projectId]);
|
|
579
|
+
}
|
|
580
|
+
isMigrationApplied(projectId, version) {
|
|
581
|
+
return this.serviceProxy.invoke("isMigrationApplied", [projectId, version]);
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
// packages/os-api/src/api/services/IDataInsightsService.ts
|
|
585
|
+
class DataInsightsService {
|
|
586
|
+
serviceProxy;
|
|
587
|
+
constructor(kinotic) {
|
|
588
|
+
this.serviceProxy = kinotic.serviceProxy("org.kinotic.persistence.api.services.insights.DataInsightsService");
|
|
589
|
+
}
|
|
590
|
+
processRequest(request) {
|
|
591
|
+
return this.serviceProxy.invokeStream("processRequest", [request]);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
// packages/os-api/src/api/OsApiPlugin.ts
|
|
595
|
+
var OsApiPlugin = {
|
|
596
|
+
install(kinotic) {
|
|
597
|
+
return {
|
|
598
|
+
applications: new ApplicationService(kinotic),
|
|
599
|
+
projects: new ProjectService(kinotic),
|
|
600
|
+
logManager: new LogManager(kinotic),
|
|
601
|
+
entityDefinitions: new EntityDefinitionService(kinotic),
|
|
602
|
+
namedQueries: new NamedQueriesService(kinotic),
|
|
603
|
+
migrations: new MigrationService(kinotic),
|
|
604
|
+
dataInsights: new DataInsightsService(kinotic)
|
|
605
|
+
};
|
|
606
|
+
}
|
|
607
|
+
};
|