@semiont/core 0.1.0-build.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 +265 -0
- package/dist/annotation-history-utils.d.ts +42 -0
- package/dist/annotation-history-utils.d.ts.map +1 -0
- package/dist/annotation-history-utils.js +258 -0
- package/dist/annotation-history-utils.js.map +1 -0
- package/dist/annotation-types.d.ts +15 -0
- package/dist/annotation-types.d.ts.map +1 -0
- package/dist/annotation-types.js +6 -0
- package/dist/annotation-types.js.map +1 -0
- package/dist/annotation-utils.d.ts +18 -0
- package/dist/annotation-utils.d.ts.map +1 -0
- package/dist/annotation-utils.js +70 -0
- package/dist/annotation-utils.js.map +1 -0
- package/dist/auth-types.d.ts +8 -0
- package/dist/auth-types.d.ts.map +1 -0
- package/dist/auth-types.js +6 -0
- package/dist/auth-types.js.map +1 -0
- package/dist/config/config-validator.d.ts +25 -0
- package/dist/config/config-validator.d.ts.map +1 -0
- package/dist/config/config-validator.js +112 -0
- package/dist/config/config-validator.js.map +1 -0
- package/dist/config/config.schema.json +678 -0
- package/dist/config/config.types.d.ts +574 -0
- package/dist/config/config.types.d.ts.map +1 -0
- package/dist/config/config.types.js +4 -0
- package/dist/config/config.types.js.map +1 -0
- package/dist/config/configuration-error.d.ts +17 -0
- package/dist/config/configuration-error.d.ts.map +1 -0
- package/dist/config/configuration-error.js +36 -0
- package/dist/config/configuration-error.js.map +1 -0
- package/dist/config/environment-loader.d.ts +98 -0
- package/dist/config/environment-loader.d.ts.map +1 -0
- package/dist/config/environment-loader.js +229 -0
- package/dist/config/environment-loader.js.map +1 -0
- package/dist/config/environment-validator.d.ts +22 -0
- package/dist/config/environment-validator.d.ts.map +1 -0
- package/dist/config/environment-validator.js +50 -0
- package/dist/config/environment-validator.js.map +1 -0
- package/dist/config/platform-types.d.ts +26 -0
- package/dist/config/platform-types.d.ts.map +1 -0
- package/dist/config/platform-types.js +28 -0
- package/dist/config/platform-types.js.map +1 -0
- package/dist/config/project-discovery.d.ts +35 -0
- package/dist/config/project-discovery.d.ts.map +1 -0
- package/dist/config/project-discovery.js +99 -0
- package/dist/config/project-discovery.js.map +1 -0
- package/dist/creation-methods.d.ts +19 -0
- package/dist/creation-methods.d.ts.map +1 -0
- package/dist/creation-methods.js +18 -0
- package/dist/creation-methods.js.map +1 -0
- package/dist/crypto.d.ts +32 -0
- package/dist/crypto.d.ts.map +1 -0
- package/dist/crypto.js +52 -0
- package/dist/crypto.js.map +1 -0
- package/dist/did-utils.d.ts +51 -0
- package/dist/did-utils.d.ts.map +1 -0
- package/dist/did-utils.js +62 -0
- package/dist/did-utils.js.map +1 -0
- package/dist/errors.d.ts +51 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +89 -0
- package/dist/errors.js.map +1 -0
- package/dist/events.d.ts +223 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +45 -0
- package/dist/events.js.map +1 -0
- package/dist/graph.d.ts +31 -0
- package/dist/graph.d.ts.map +1 -0
- package/dist/graph.js +6 -0
- package/dist/graph.js.map +1 -0
- package/dist/http-client.d.ts +32 -0
- package/dist/http-client.d.ts.map +1 -0
- package/dist/http-client.js +56 -0
- package/dist/http-client.js.map +1 -0
- package/dist/identifiers.d.ts +24 -0
- package/dist/identifiers.d.ts.map +1 -0
- package/dist/identifiers.js +40 -0
- package/dist/identifiers.js.map +1 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +80 -0
- package/dist/index.js.map +1 -0
- package/dist/resource-types.d.ts +15 -0
- package/dist/resource-types.d.ts.map +1 -0
- package/dist/resource-types.js +6 -0
- package/dist/resource-types.js.map +1 -0
- package/dist/type-guards.d.ts +44 -0
- package/dist/type-guards.d.ts.map +1 -0
- package/dist/type-guards.js +76 -0
- package/dist/type-guards.js.map +1 -0
- package/package.json +49 -0
package/dist/graph.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Graph types - Models for graph connections and relationships
|
|
3
|
+
*/
|
|
4
|
+
import type { components } from '@semiont/api-client';
|
|
5
|
+
type ResourceDescriptor = components['schemas']['ResourceDescriptor'];
|
|
6
|
+
type Annotation = components['schemas']['Annotation'];
|
|
7
|
+
/**
|
|
8
|
+
* Represents a connection between resources through annotations
|
|
9
|
+
*/
|
|
10
|
+
export interface GraphConnection {
|
|
11
|
+
targetResource: ResourceDescriptor;
|
|
12
|
+
annotations: Annotation[];
|
|
13
|
+
relationshipType?: string;
|
|
14
|
+
bidirectional: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Represents a path through the graph
|
|
18
|
+
*/
|
|
19
|
+
export interface GraphPath {
|
|
20
|
+
resources: ResourceDescriptor[];
|
|
21
|
+
annotations: Annotation[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Statistics about entity types in the graph
|
|
25
|
+
*/
|
|
26
|
+
export interface EntityTypeStats {
|
|
27
|
+
type: string;
|
|
28
|
+
count: number;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=graph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../src/graph.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtD,KAAK,kBAAkB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,oBAAoB,CAAC,CAAC;AACtE,KAAK,UAAU,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,cAAc,EAAE,kBAAkB,CAAC;IACnC,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,kBAAkB,EAAE,CAAC;IAChC,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf"}
|
package/dist/graph.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph.js","sourceRoot":"","sources":["../src/graph.ts"],"names":[],"mappings":";AAAA;;GAEG"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP Client Utilities
|
|
3
|
+
*
|
|
4
|
+
* Reusable fetch wrapper for making authenticated HTTP requests.
|
|
5
|
+
* Used by both frontend (via TanStack Query) and backend (direct calls).
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Configuration for HTTP client
|
|
9
|
+
*/
|
|
10
|
+
export interface HttpClientConfig {
|
|
11
|
+
baseUrl: string;
|
|
12
|
+
token?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Fetch helper with authentication and error handling
|
|
16
|
+
*
|
|
17
|
+
* @param endpoint - API endpoint (e.g., '/api/resources')
|
|
18
|
+
* @param options - Standard fetch options
|
|
19
|
+
* @param token - Optional authentication token
|
|
20
|
+
* @returns Typed response data
|
|
21
|
+
* @throws APIError on HTTP errors
|
|
22
|
+
*/
|
|
23
|
+
export declare function fetchAPI<T>(endpoint: string, options?: RequestInit, token?: string, baseUrl?: string): Promise<T>;
|
|
24
|
+
/**
|
|
25
|
+
* Create a configured fetch function with a base URL
|
|
26
|
+
* Useful for creating client-specific fetch instances
|
|
27
|
+
*
|
|
28
|
+
* @param baseUrl - Base URL for all requests (e.g., 'http://localhost:4000')
|
|
29
|
+
* @returns Configured fetch function
|
|
30
|
+
*/
|
|
31
|
+
export declare function createFetchAPI(baseUrl: string): <T>(endpoint: string, options?: RequestInit, token?: string) => Promise<T>;
|
|
32
|
+
//# sourceMappingURL=http-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-client.d.ts","sourceRoot":"","sources":["../src/http-client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,wBAAsB,QAAQ,CAAC,CAAC,EAC9B,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,WAAgB,EACzB,KAAK,CAAC,EAAE,MAAM,EACd,OAAO,GAAE,MAAW,GACnB,OAAO,CAAC,CAAC,CAAC,CA4BZ;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,IAC3B,CAAC,EAChB,UAAU,MAAM,EAChB,UAAS,WAAgB,EACzB,QAAQ,MAAM,KACb,OAAO,CAAC,CAAC,CAAC,CAGd"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* HTTP Client Utilities
|
|
4
|
+
*
|
|
5
|
+
* Reusable fetch wrapper for making authenticated HTTP requests.
|
|
6
|
+
* Used by both frontend (via TanStack Query) and backend (direct calls).
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.fetchAPI = fetchAPI;
|
|
10
|
+
exports.createFetchAPI = createFetchAPI;
|
|
11
|
+
const errors_1 = require("./errors");
|
|
12
|
+
/**
|
|
13
|
+
* Fetch helper with authentication and error handling
|
|
14
|
+
*
|
|
15
|
+
* @param endpoint - API endpoint (e.g., '/api/resources')
|
|
16
|
+
* @param options - Standard fetch options
|
|
17
|
+
* @param token - Optional authentication token
|
|
18
|
+
* @returns Typed response data
|
|
19
|
+
* @throws APIError on HTTP errors
|
|
20
|
+
*/
|
|
21
|
+
async function fetchAPI(endpoint, options = {}, token, baseUrl = '') {
|
|
22
|
+
const headers = {
|
|
23
|
+
'Content-Type': 'application/json',
|
|
24
|
+
...(options.headers || {}),
|
|
25
|
+
};
|
|
26
|
+
if (token) {
|
|
27
|
+
headers['Authorization'] = `Bearer ${token}`;
|
|
28
|
+
}
|
|
29
|
+
const url = baseUrl ? `${baseUrl}${endpoint}` : endpoint;
|
|
30
|
+
const response = await fetch(url, {
|
|
31
|
+
...options,
|
|
32
|
+
headers,
|
|
33
|
+
});
|
|
34
|
+
if (!response.ok) {
|
|
35
|
+
const errorData = await response.json().catch(() => ({}));
|
|
36
|
+
throw new errors_1.APIError(response.status, errorData, errorData.message);
|
|
37
|
+
}
|
|
38
|
+
// Handle 204 No Content responses
|
|
39
|
+
if (response.status === 204 || response.headers.get('content-length') === '0') {
|
|
40
|
+
return {};
|
|
41
|
+
}
|
|
42
|
+
return response.json();
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Create a configured fetch function with a base URL
|
|
46
|
+
* Useful for creating client-specific fetch instances
|
|
47
|
+
*
|
|
48
|
+
* @param baseUrl - Base URL for all requests (e.g., 'http://localhost:4000')
|
|
49
|
+
* @returns Configured fetch function
|
|
50
|
+
*/
|
|
51
|
+
function createFetchAPI(baseUrl) {
|
|
52
|
+
return function (endpoint, options = {}, token) {
|
|
53
|
+
return fetchAPI(endpoint, options, token, baseUrl);
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=http-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-client.js","sourceRoot":"","sources":["../src/http-client.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAqBH,4BAiCC;AASD,wCAQC;AArED,qCAAoC;AAUpC;;;;;;;;GAQG;AACI,KAAK,UAAU,QAAQ,CAC5B,QAAgB,EAChB,UAAuB,EAAE,EACzB,KAAc,EACd,UAAkB,EAAE;IAEpB,MAAM,OAAO,GAA2B;QACtC,cAAc,EAAE,kBAAkB;QAClC,GAAI,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAA4B;KACvD,CAAC;IAEF,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,KAAK,EAAE,CAAC;IAC/C,CAAC;IAED,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,GAAG,QAAQ,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;IAEzD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;QAChC,GAAG,OAAO;QACV,OAAO;KACR,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,SAAS,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAQ,CAAC;QACjE,MAAM,IAAI,iBAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACpE,CAAC;IAED,kCAAkC;IAClC,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,IAAI,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,KAAK,GAAG,EAAE,CAAC;QAC9E,OAAO,EAAO,CAAC;IACjB,CAAC;IAED,OAAO,QAAQ,CAAC,IAAI,EAAgB,CAAC;AACvC,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,cAAc,CAAC,OAAe;IAC5C,OAAO,UACL,QAAgB,EAChB,UAAuB,EAAE,EACzB,KAAc;QAEd,OAAO,QAAQ,CAAI,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Branded identifier types for compile-time type safety.
|
|
3
|
+
*
|
|
4
|
+
* These types prevent mixing up resource IDs, annotation IDs, and user IDs
|
|
5
|
+
* at compile time while having zero runtime overhead.
|
|
6
|
+
*
|
|
7
|
+
* URI types (ResourceUri, AnnotationUri) are in @semiont/api-client
|
|
8
|
+
* since they deal with HTTP URIs returned by the API.
|
|
9
|
+
*/
|
|
10
|
+
export type ResourceId = string & {
|
|
11
|
+
readonly __brand: 'ResourceId';
|
|
12
|
+
};
|
|
13
|
+
export type AnnotationId = string & {
|
|
14
|
+
readonly __brand: 'AnnotationId';
|
|
15
|
+
};
|
|
16
|
+
export type UserId = string & {
|
|
17
|
+
readonly __brand: 'UserId';
|
|
18
|
+
};
|
|
19
|
+
export declare function isResourceId(value: string): value is ResourceId;
|
|
20
|
+
export declare function isAnnotationId(value: string): value is AnnotationId;
|
|
21
|
+
export declare function resourceId(id: string): ResourceId;
|
|
22
|
+
export declare function annotationId(id: string): AnnotationId;
|
|
23
|
+
export declare function userId(id: string): UserId;
|
|
24
|
+
//# sourceMappingURL=identifiers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identifiers.d.ts","sourceRoot":"","sources":["../src/identifiers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAA;CAAE,CAAC;AACrE,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAA;CAAE,CAAC;AACzE,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAA;CAAE,CAAC;AAG7D,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,UAAU,CAE/D;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,YAAY,CAEnE;AAGD,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU,CAKjD;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,YAAY,CAKrD;AAED,wBAAgB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAEzC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Branded identifier types for compile-time type safety.
|
|
4
|
+
*
|
|
5
|
+
* These types prevent mixing up resource IDs, annotation IDs, and user IDs
|
|
6
|
+
* at compile time while having zero runtime overhead.
|
|
7
|
+
*
|
|
8
|
+
* URI types (ResourceUri, AnnotationUri) are in @semiont/api-client
|
|
9
|
+
* since they deal with HTTP URIs returned by the API.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.isResourceId = isResourceId;
|
|
13
|
+
exports.isAnnotationId = isAnnotationId;
|
|
14
|
+
exports.resourceId = resourceId;
|
|
15
|
+
exports.annotationId = annotationId;
|
|
16
|
+
exports.userId = userId;
|
|
17
|
+
// Type guards with runtime validation
|
|
18
|
+
function isResourceId(value) {
|
|
19
|
+
return !value.includes('/');
|
|
20
|
+
}
|
|
21
|
+
function isAnnotationId(value) {
|
|
22
|
+
return !value.includes('/');
|
|
23
|
+
}
|
|
24
|
+
// Factory functions with runtime validation
|
|
25
|
+
function resourceId(id) {
|
|
26
|
+
if (id.includes('/')) {
|
|
27
|
+
throw new TypeError(`Expected ResourceId, got URI: ${id}`);
|
|
28
|
+
}
|
|
29
|
+
return id;
|
|
30
|
+
}
|
|
31
|
+
function annotationId(id) {
|
|
32
|
+
if (id.includes('/')) {
|
|
33
|
+
throw new TypeError(`Expected AnnotationId, got URI: ${id}`);
|
|
34
|
+
}
|
|
35
|
+
return id;
|
|
36
|
+
}
|
|
37
|
+
function userId(id) {
|
|
38
|
+
return id;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=identifiers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identifiers.js","sourceRoot":"","sources":["../src/identifiers.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AAQH,oCAEC;AAED,wCAEC;AAGD,gCAKC;AAED,oCAKC;AAED,wBAEC;AA1BD,sCAAsC;AACtC,SAAgB,YAAY,CAAC,KAAa;IACxC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC9B,CAAC;AAED,SAAgB,cAAc,CAAC,KAAa;IAC1C,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC9B,CAAC;AAED,4CAA4C;AAC5C,SAAgB,UAAU,CAAC,EAAU;IACnC,IAAI,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACrB,MAAM,IAAI,SAAS,CAAC,iCAAiC,EAAE,EAAE,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO,EAAgB,CAAC;AAC1B,CAAC;AAED,SAAgB,YAAY,CAAC,EAAU;IACrC,IAAI,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACrB,MAAM,IAAI,SAAS,CAAC,mCAAmC,EAAE,EAAE,CAAC,CAAC;IAC/D,CAAC;IACD,OAAO,EAAkB,CAAC;AAC5B,CAAC;AAED,SAAgB,MAAM,CAAC,EAAU;IAC/B,OAAO,EAAY,CAAC;AACtB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @semiont/core
|
|
3
|
+
*
|
|
4
|
+
* Core domain logic and utilities for the Semiont semantic knowledge platform.
|
|
5
|
+
* For OpenAPI types, import directly from @semiont/api-client.
|
|
6
|
+
*/
|
|
7
|
+
export { CREATION_METHODS } from './creation-methods';
|
|
8
|
+
export type { CreationMethod } from './creation-methods';
|
|
9
|
+
export type { ResourceId, AnnotationId, UserId } from './identifiers';
|
|
10
|
+
export { resourceId, annotationId, userId, isResourceId, isAnnotationId, } from './identifiers';
|
|
11
|
+
export type { GraphConnection, GraphPath, EntityTypeStats, } from './graph';
|
|
12
|
+
export type { BaseEvent, ResourceEvent, ResourceEventType, SystemEvent, ResourceScopedEvent, ResourceCreatedEvent, ResourceClonedEvent, ResourceArchivedEvent, ResourceUnarchivedEvent, AnnotationAddedEvent, AnnotationRemovedEvent, AnnotationBodyUpdatedEvent, JobStartedEvent, JobProgressEvent, JobCompletedEvent, JobFailedEvent, BodyOperation, BodyItem, EntityTagAddedEvent, EntityTagRemovedEvent, EventMetadata, EventSignature, StoredEvent, EventQuery, ResourceAnnotations, } from './events';
|
|
13
|
+
export { isResourceEvent, isSystemEvent, isResourceScopedEvent, getEventType, } from './events';
|
|
14
|
+
export { bodyItemsMatch, findBodyItem } from './annotation-utils';
|
|
15
|
+
export type { UpdateResourceInput, ResourceFilter } from './resource-types';
|
|
16
|
+
export type { AnnotationCategory, CreateAnnotationInternal } from './annotation-types';
|
|
17
|
+
export type { GoogleAuthRequest } from './auth-types';
|
|
18
|
+
export * from './type-guards';
|
|
19
|
+
export * from './crypto';
|
|
20
|
+
export * from './errors';
|
|
21
|
+
export * from './http-client';
|
|
22
|
+
export * from './annotation-history-utils';
|
|
23
|
+
export * from './did-utils';
|
|
24
|
+
export { loadEnvironmentConfig, getAvailableEnvironments, getNodeEnvForEnvironment, type EnvironmentConfig, type ServiceConfig, type AWSConfig, type SiteConfig, type AppConfig, } from './config/environment-loader';
|
|
25
|
+
export { isValidEnvironment, parseEnvironment, validateEnvironment, type Environment, } from './config/environment-validator';
|
|
26
|
+
export { ConfigurationError } from './config/configuration-error';
|
|
27
|
+
export { findProjectRoot, isProjectRoot, getEnvironmentsPath, getSemiontConfigPath, } from './config/project-discovery';
|
|
28
|
+
export { type PlatformType, isValidPlatformType, getAllPlatformTypes, } from './config/platform-types';
|
|
29
|
+
export type { BackendServiceConfig, FrontendServiceConfig, DatabaseServiceConfig, GraphServiceConfig, FilesystemServiceConfig, InferenceServiceConfig, McpServiceConfig, ServicesConfig, SemiontConfig, GraphDatabaseType, ServicePlatformConfig } from './config/config.types';
|
|
30
|
+
export { validateSemiontConfig, validateEnvironmentConfig, validateSiteConfig, type ValidationResult, } from './config/config-validator';
|
|
31
|
+
export declare const CORE_TYPES_VERSION = "0.1.0";
|
|
32
|
+
export declare const SDK_VERSION = "0.1.0";
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGzD,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EACL,UAAU,EACV,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,cAAc,GACf,MAAM,eAAe,CAAC;AAGvB,YAAY,EACV,eAAe,EACf,SAAS,EACT,eAAe,GAChB,MAAM,SAAS,CAAC;AAGjB,YAAY,EACV,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,sBAAsB,EACtB,0BAA0B,EAC1B,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,QAAQ,EACR,mBAAmB,EACnB,qBAAqB,EACrB,aAAa,EACb,cAAc,EACd,WAAW,EACX,UAAU,EACV,mBAAmB,GACpB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,eAAe,EACf,aAAa,EACb,qBAAqB,EACrB,YAAY,GACb,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlE,YAAY,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAG5E,YAAY,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAGvF,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGtD,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,aAAa,CAAC;AAG5B,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,wBAAwB,EACxB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,SAAS,GACf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,KAAK,WAAW,GACjB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EACL,eAAe,EACf,aAAa,EACb,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,KAAK,YAAY,EACjB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AAGjC,YAAY,EACV,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,uBAAuB,EACvB,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,kBAAkB,EAClB,KAAK,gBAAgB,GACtB,MAAM,2BAA2B,CAAC;AAGnC,eAAO,MAAM,kBAAkB,UAAU,CAAC;AAC1C,eAAO,MAAM,WAAW,UAAU,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @semiont/core
|
|
4
|
+
*
|
|
5
|
+
* Core domain logic and utilities for the Semiont semantic knowledge platform.
|
|
6
|
+
* For OpenAPI types, import directly from @semiont/api-client.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.SDK_VERSION = exports.CORE_TYPES_VERSION = exports.validateSiteConfig = exports.validateEnvironmentConfig = exports.validateSemiontConfig = exports.getAllPlatformTypes = exports.isValidPlatformType = exports.getSemiontConfigPath = exports.getEnvironmentsPath = exports.isProjectRoot = exports.findProjectRoot = exports.ConfigurationError = exports.validateEnvironment = exports.parseEnvironment = exports.isValidEnvironment = exports.getNodeEnvForEnvironment = exports.getAvailableEnvironments = exports.loadEnvironmentConfig = exports.findBodyItem = exports.bodyItemsMatch = exports.getEventType = exports.isResourceScopedEvent = exports.isSystemEvent = exports.isResourceEvent = exports.isAnnotationId = exports.isResourceId = exports.userId = exports.annotationId = exports.resourceId = exports.CREATION_METHODS = void 0;
|
|
24
|
+
// NOTE: OpenAPI types are NOT re-exported from @semiont/core.
|
|
25
|
+
// Import types directly from @semiont/api-client where needed:
|
|
26
|
+
// import type { components } from '@semiont/api-client';
|
|
27
|
+
// type Annotation = components['schemas']['Annotation'];
|
|
28
|
+
// Creation methods
|
|
29
|
+
var creation_methods_1 = require("./creation-methods");
|
|
30
|
+
Object.defineProperty(exports, "CREATION_METHODS", { enumerable: true, get: function () { return creation_methods_1.CREATION_METHODS; } });
|
|
31
|
+
var identifiers_1 = require("./identifiers");
|
|
32
|
+
Object.defineProperty(exports, "resourceId", { enumerable: true, get: function () { return identifiers_1.resourceId; } });
|
|
33
|
+
Object.defineProperty(exports, "annotationId", { enumerable: true, get: function () { return identifiers_1.annotationId; } });
|
|
34
|
+
Object.defineProperty(exports, "userId", { enumerable: true, get: function () { return identifiers_1.userId; } });
|
|
35
|
+
Object.defineProperty(exports, "isResourceId", { enumerable: true, get: function () { return identifiers_1.isResourceId; } });
|
|
36
|
+
Object.defineProperty(exports, "isAnnotationId", { enumerable: true, get: function () { return identifiers_1.isAnnotationId; } });
|
|
37
|
+
var events_1 = require("./events");
|
|
38
|
+
Object.defineProperty(exports, "isResourceEvent", { enumerable: true, get: function () { return events_1.isResourceEvent; } });
|
|
39
|
+
Object.defineProperty(exports, "isSystemEvent", { enumerable: true, get: function () { return events_1.isSystemEvent; } });
|
|
40
|
+
Object.defineProperty(exports, "isResourceScopedEvent", { enumerable: true, get: function () { return events_1.isResourceScopedEvent; } });
|
|
41
|
+
Object.defineProperty(exports, "getEventType", { enumerable: true, get: function () { return events_1.getEventType; } });
|
|
42
|
+
// Backend-specific annotation utilities
|
|
43
|
+
var annotation_utils_1 = require("./annotation-utils");
|
|
44
|
+
Object.defineProperty(exports, "bodyItemsMatch", { enumerable: true, get: function () { return annotation_utils_1.bodyItemsMatch; } });
|
|
45
|
+
Object.defineProperty(exports, "findBodyItem", { enumerable: true, get: function () { return annotation_utils_1.findBodyItem; } });
|
|
46
|
+
// Utility functions
|
|
47
|
+
__exportStar(require("./type-guards"), exports);
|
|
48
|
+
__exportStar(require("./crypto"), exports);
|
|
49
|
+
__exportStar(require("./errors"), exports);
|
|
50
|
+
__exportStar(require("./http-client"), exports);
|
|
51
|
+
__exportStar(require("./annotation-history-utils"), exports);
|
|
52
|
+
__exportStar(require("./did-utils"), exports);
|
|
53
|
+
// Configuration loading
|
|
54
|
+
var environment_loader_1 = require("./config/environment-loader");
|
|
55
|
+
Object.defineProperty(exports, "loadEnvironmentConfig", { enumerable: true, get: function () { return environment_loader_1.loadEnvironmentConfig; } });
|
|
56
|
+
Object.defineProperty(exports, "getAvailableEnvironments", { enumerable: true, get: function () { return environment_loader_1.getAvailableEnvironments; } });
|
|
57
|
+
Object.defineProperty(exports, "getNodeEnvForEnvironment", { enumerable: true, get: function () { return environment_loader_1.getNodeEnvForEnvironment; } });
|
|
58
|
+
var environment_validator_1 = require("./config/environment-validator");
|
|
59
|
+
Object.defineProperty(exports, "isValidEnvironment", { enumerable: true, get: function () { return environment_validator_1.isValidEnvironment; } });
|
|
60
|
+
Object.defineProperty(exports, "parseEnvironment", { enumerable: true, get: function () { return environment_validator_1.parseEnvironment; } });
|
|
61
|
+
Object.defineProperty(exports, "validateEnvironment", { enumerable: true, get: function () { return environment_validator_1.validateEnvironment; } });
|
|
62
|
+
var configuration_error_1 = require("./config/configuration-error");
|
|
63
|
+
Object.defineProperty(exports, "ConfigurationError", { enumerable: true, get: function () { return configuration_error_1.ConfigurationError; } });
|
|
64
|
+
var project_discovery_1 = require("./config/project-discovery");
|
|
65
|
+
Object.defineProperty(exports, "findProjectRoot", { enumerable: true, get: function () { return project_discovery_1.findProjectRoot; } });
|
|
66
|
+
Object.defineProperty(exports, "isProjectRoot", { enumerable: true, get: function () { return project_discovery_1.isProjectRoot; } });
|
|
67
|
+
Object.defineProperty(exports, "getEnvironmentsPath", { enumerable: true, get: function () { return project_discovery_1.getEnvironmentsPath; } });
|
|
68
|
+
Object.defineProperty(exports, "getSemiontConfigPath", { enumerable: true, get: function () { return project_discovery_1.getSemiontConfigPath; } });
|
|
69
|
+
var platform_types_1 = require("./config/platform-types");
|
|
70
|
+
Object.defineProperty(exports, "isValidPlatformType", { enumerable: true, get: function () { return platform_types_1.isValidPlatformType; } });
|
|
71
|
+
Object.defineProperty(exports, "getAllPlatformTypes", { enumerable: true, get: function () { return platform_types_1.getAllPlatformTypes; } });
|
|
72
|
+
// Configuration validation
|
|
73
|
+
var config_validator_1 = require("./config/config-validator");
|
|
74
|
+
Object.defineProperty(exports, "validateSemiontConfig", { enumerable: true, get: function () { return config_validator_1.validateSemiontConfig; } });
|
|
75
|
+
Object.defineProperty(exports, "validateEnvironmentConfig", { enumerable: true, get: function () { return config_validator_1.validateEnvironmentConfig; } });
|
|
76
|
+
Object.defineProperty(exports, "validateSiteConfig", { enumerable: true, get: function () { return config_validator_1.validateSiteConfig; } });
|
|
77
|
+
// Version information
|
|
78
|
+
exports.CORE_TYPES_VERSION = '0.1.0';
|
|
79
|
+
exports.SDK_VERSION = '0.1.0';
|
|
80
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;AAEH,8DAA8D;AAC9D,+DAA+D;AAC/D,2DAA2D;AAC3D,2DAA2D;AAE3D,mBAAmB;AACnB,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AAKzB,6CAMuB;AALrB,yGAAA,UAAU,OAAA;AACV,2GAAA,YAAY,OAAA;AACZ,qGAAA,MAAM,OAAA;AACN,2GAAA,YAAY,OAAA;AACZ,6GAAA,cAAc,OAAA;AAsChB,mCAKkB;AAJhB,yGAAA,eAAe,OAAA;AACf,uGAAA,aAAa,OAAA;AACb,+GAAA,qBAAqB,OAAA;AACrB,sGAAA,YAAY,OAAA;AAGd,wCAAwC;AACxC,uDAAkE;AAAzD,kHAAA,cAAc,OAAA;AAAE,gHAAA,YAAY,OAAA;AAWrC,oBAAoB;AACpB,gDAA8B;AAC9B,2CAAyB;AACzB,2CAAyB;AACzB,gDAA8B;AAC9B,6DAA2C;AAC3C,8CAA4B;AAE5B,wBAAwB;AACxB,kEASqC;AARnC,2HAAA,qBAAqB,OAAA;AACrB,8HAAA,wBAAwB,OAAA;AACxB,8HAAA,wBAAwB,OAAA;AAO1B,wEAKwC;AAJtC,2HAAA,kBAAkB,OAAA;AAClB,yHAAA,gBAAgB,OAAA;AAChB,4HAAA,mBAAmB,OAAA;AAGrB,oEAAkE;AAAzD,yHAAA,kBAAkB,OAAA;AAC3B,gEAKoC;AAJlC,oHAAA,eAAe,OAAA;AACf,kHAAA,aAAa,OAAA;AACb,wHAAA,mBAAmB,OAAA;AACnB,yHAAA,oBAAoB,OAAA;AAEtB,0DAIiC;AAF/B,qHAAA,mBAAmB,OAAA;AACnB,qHAAA,mBAAmB,OAAA;AAkBrB,2BAA2B;AAC3B,8DAKmC;AAJjC,yHAAA,qBAAqB,OAAA;AACrB,6HAAA,yBAAyB,OAAA;AACzB,sHAAA,kBAAkB,OAAA;AAIpB,sBAAsB;AACT,QAAA,kBAAkB,GAAG,OAAO,CAAC;AAC7B,QAAA,WAAW,GAAG,OAAO,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resource input/output types
|
|
3
|
+
*/
|
|
4
|
+
export interface UpdateResourceInput {
|
|
5
|
+
name?: string;
|
|
6
|
+
entityTypes?: string[];
|
|
7
|
+
archived?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface ResourceFilter {
|
|
10
|
+
entityTypes?: string[];
|
|
11
|
+
search?: string;
|
|
12
|
+
limit?: number;
|
|
13
|
+
offset?: number;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=resource-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-types.d.ts","sourceRoot":"","sources":["../src/resource-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-types.js","sourceRoot":"","sources":["../src/resource-types.ts"],"names":[],"mappings":";AAAA;;GAEG"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Common type guard utilities
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Check if value is a string
|
|
6
|
+
*/
|
|
7
|
+
export declare function isString(value: unknown): value is string;
|
|
8
|
+
/**
|
|
9
|
+
* Check if value is a number (not NaN)
|
|
10
|
+
*/
|
|
11
|
+
export declare function isNumber(value: unknown): value is number;
|
|
12
|
+
/**
|
|
13
|
+
* Check if value is an object (not null, not array)
|
|
14
|
+
*/
|
|
15
|
+
export declare function isObject(value: unknown): value is Record<string, unknown>;
|
|
16
|
+
/**
|
|
17
|
+
* Check if value is an array
|
|
18
|
+
*/
|
|
19
|
+
export declare function isArray(value: unknown): value is unknown[];
|
|
20
|
+
/**
|
|
21
|
+
* Check if value is a boolean
|
|
22
|
+
*/
|
|
23
|
+
export declare function isBoolean(value: unknown): value is boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Check if value is a function
|
|
26
|
+
*/
|
|
27
|
+
export declare function isFunction(value: unknown): value is Function;
|
|
28
|
+
/**
|
|
29
|
+
* Check if value is null
|
|
30
|
+
*/
|
|
31
|
+
export declare function isNull(value: unknown): value is null;
|
|
32
|
+
/**
|
|
33
|
+
* Check if value is undefined
|
|
34
|
+
*/
|
|
35
|
+
export declare function isUndefined(value: unknown): value is undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Check if value is null or undefined
|
|
38
|
+
*/
|
|
39
|
+
export declare function isNullish(value: unknown): value is null | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Check if value is defined (not null or undefined)
|
|
42
|
+
*/
|
|
43
|
+
export declare function isDefined<T>(value: T | null | undefined): value is T;
|
|
44
|
+
//# sourceMappingURL=type-guards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-guards.d.ts","sourceRoot":"","sources":["../src/type-guards.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAExD;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAExD;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,OAAO,EAAE,CAE1D;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,OAAO,CAE1D;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAE5D;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,IAAI,CAEpD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAE9D;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,IAAI,GAAG,SAAS,CAEnE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,IAAI,CAAC,CAEpE"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Common type guard utilities
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.isString = isString;
|
|
7
|
+
exports.isNumber = isNumber;
|
|
8
|
+
exports.isObject = isObject;
|
|
9
|
+
exports.isArray = isArray;
|
|
10
|
+
exports.isBoolean = isBoolean;
|
|
11
|
+
exports.isFunction = isFunction;
|
|
12
|
+
exports.isNull = isNull;
|
|
13
|
+
exports.isUndefined = isUndefined;
|
|
14
|
+
exports.isNullish = isNullish;
|
|
15
|
+
exports.isDefined = isDefined;
|
|
16
|
+
/**
|
|
17
|
+
* Check if value is a string
|
|
18
|
+
*/
|
|
19
|
+
function isString(value) {
|
|
20
|
+
return typeof value === 'string';
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Check if value is a number (not NaN)
|
|
24
|
+
*/
|
|
25
|
+
function isNumber(value) {
|
|
26
|
+
return typeof value === 'number' && !isNaN(value);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Check if value is an object (not null, not array)
|
|
30
|
+
*/
|
|
31
|
+
function isObject(value) {
|
|
32
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Check if value is an array
|
|
36
|
+
*/
|
|
37
|
+
function isArray(value) {
|
|
38
|
+
return Array.isArray(value);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Check if value is a boolean
|
|
42
|
+
*/
|
|
43
|
+
function isBoolean(value) {
|
|
44
|
+
return typeof value === 'boolean';
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Check if value is a function
|
|
48
|
+
*/
|
|
49
|
+
function isFunction(value) {
|
|
50
|
+
return typeof value === 'function';
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Check if value is null
|
|
54
|
+
*/
|
|
55
|
+
function isNull(value) {
|
|
56
|
+
return value === null;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Check if value is undefined
|
|
60
|
+
*/
|
|
61
|
+
function isUndefined(value) {
|
|
62
|
+
return value === undefined;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Check if value is null or undefined
|
|
66
|
+
*/
|
|
67
|
+
function isNullish(value) {
|
|
68
|
+
return value === null || value === undefined;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Check if value is defined (not null or undefined)
|
|
72
|
+
*/
|
|
73
|
+
function isDefined(value) {
|
|
74
|
+
return value !== null && value !== undefined;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=type-guards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-guards.js","sourceRoot":"","sources":["../src/type-guards.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAKH,4BAEC;AAKD,4BAEC;AAKD,4BAEC;AAKD,0BAEC;AAKD,8BAEC;AAKD,gCAEC;AAKD,wBAEC;AAKD,kCAEC;AAKD,8BAEC;AAKD,8BAEC;AApED;;GAEG;AACH,SAAgB,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;AACnC,CAAC;AAED;;GAEG;AACH,SAAgB,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACpD,CAAC;AAED;;GAEG;AACH,SAAgB,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED;;GAEG;AACH,SAAgB,OAAO,CAAC,KAAc;IACpC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC;AAED;;GAEG;AACH,SAAgB,SAAS,CAAC,KAAc;IACtC,OAAO,OAAO,KAAK,KAAK,SAAS,CAAC;AACpC,CAAC;AAED;;GAEG;AACH,SAAgB,UAAU,CAAC,KAAc;IACvC,OAAO,OAAO,KAAK,KAAK,UAAU,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,SAAgB,MAAM,CAAC,KAAc;IACnC,OAAO,KAAK,KAAK,IAAI,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,SAAgB,WAAW,CAAC,KAAc;IACxC,OAAO,KAAK,KAAK,SAAS,CAAC;AAC7B,CAAC;AAED;;GAEG;AACH,SAAgB,SAAS,CAAC,KAAc;IACtC,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC;AAC/C,CAAC;AAED;;GAEG;AACH,SAAgB,SAAS,CAAI,KAA2B;IACtD,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC;AAC/C,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@semiont/core",
|
|
3
|
+
"version": "0.1.0-build.2",
|
|
4
|
+
"description": "Core domain types for Semiont - Document, Annotation, and Graph models",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"README.md",
|
|
10
|
+
"LICENSE"
|
|
11
|
+
],
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/The-AI-Alliance/semiont.git",
|
|
18
|
+
"directory": "packages/core"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"generate:types": "tsx scripts/generate-types.ts",
|
|
22
|
+
"prebuild": "npm run generate:types",
|
|
23
|
+
"build": "tsc",
|
|
24
|
+
"build:clean": "rm -rf dist *.tsbuildinfo && tsc",
|
|
25
|
+
"watch": "tsc --watch",
|
|
26
|
+
"clean": "rm -rf dist *.tsbuildinfo",
|
|
27
|
+
"type-check": "tsc --noEmit"
|
|
28
|
+
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"types",
|
|
31
|
+
"domain",
|
|
32
|
+
"document",
|
|
33
|
+
"selection",
|
|
34
|
+
"graph",
|
|
35
|
+
"semiont"
|
|
36
|
+
],
|
|
37
|
+
"author": "Semiont Team",
|
|
38
|
+
"license": "Apache-2.0",
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"typescript": "^5.6.3",
|
|
41
|
+
"json-schema-to-typescript": "^15.0.2",
|
|
42
|
+
"tsx": "^4.19.2"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@semiont/api-client": "*",
|
|
46
|
+
"ajv": "^8.17.1",
|
|
47
|
+
"ajv-formats": "^2.1.1"
|
|
48
|
+
}
|
|
49
|
+
}
|