@semiont/core 0.2.28-build.38 → 0.2.28
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 +1 -0
- package/dist/index.d.ts +128 -66
- package/dist/index.js +1181 -313
- package/dist/index.js.map +1 -1
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# @semiont/core
|
|
2
2
|
|
|
3
|
+
[](https://github.com/The-AI-Alliance/semiont/actions/workflows/package-tests.yml?query=branch%3Amain+is%3Asuccess+job%3A%22Test+core%22)
|
|
3
4
|
[](https://www.npmjs.com/package/@semiont/core)
|
|
4
5
|
[](https://www.npmjs.com/package/@semiont/core)
|
|
5
6
|
[](https://github.com/The-AI-Alliance/semiont/blob/main/LICENSE)
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { components, JobId
|
|
1
|
+
import { ResourceUri, AnnotationUri, components, JobId } from '@semiont/api-client';
|
|
2
2
|
import { ErrorObject } from 'ajv';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -44,6 +44,62 @@ declare function resourceId(id: string): ResourceId;
|
|
|
44
44
|
declare function annotationId(id: string): AnnotationId;
|
|
45
45
|
declare function userId(id: string): UserId;
|
|
46
46
|
|
|
47
|
+
/**
|
|
48
|
+
* URI utilities for W3C annotations
|
|
49
|
+
*
|
|
50
|
+
* Converts between short resource/annotation IDs and full URIs.
|
|
51
|
+
* Full URIs are required by W3C Web Annotation Data Model.
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Convert resource ID to full URI
|
|
56
|
+
*
|
|
57
|
+
* @param id - Short resource ID (e.g., "doc-abc123")
|
|
58
|
+
* @param publicURL - Backend base URL
|
|
59
|
+
* @returns Full URI (e.g., "https://api.semiont.app/resources/doc-abc123")
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* resourceIdToURI("doc-abc123", "https://api.semiont.app")
|
|
63
|
+
* // => "https://api.semiont.app/resources/doc-abc123"
|
|
64
|
+
*/
|
|
65
|
+
declare function resourceIdToURI(id: ResourceId, publicURL: string): ResourceUri;
|
|
66
|
+
/**
|
|
67
|
+
* Extract resource ID from full URI
|
|
68
|
+
*
|
|
69
|
+
* @param uri - Full resource URI (e.g., "https://api.semiont.app/resources/doc-abc123")
|
|
70
|
+
* @returns Short resource ID (e.g., "doc-abc123")
|
|
71
|
+
* @throws Error if URI format is invalid
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* uriToResourceId("https://api.semiont.app/resources/doc-abc123")
|
|
75
|
+
* // => "doc-abc123"
|
|
76
|
+
*/
|
|
77
|
+
declare function uriToResourceId(uri: string): ResourceId;
|
|
78
|
+
/**
|
|
79
|
+
* Convert annotation ID to full URI
|
|
80
|
+
*
|
|
81
|
+
* @param id - Short annotation ID (e.g., "anno-xyz789")
|
|
82
|
+
* @param publicURL - Backend base URL
|
|
83
|
+
* @returns Full URI (e.g., "https://api.semiont.app/annotations/anno-xyz789")
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* annotationIdToURI("anno-xyz789", "https://api.semiont.app")
|
|
87
|
+
* // => "https://api.semiont.app/annotations/anno-xyz789"
|
|
88
|
+
*/
|
|
89
|
+
declare function annotationIdToURI(id: AnnotationId, publicURL: string): AnnotationUri;
|
|
90
|
+
/**
|
|
91
|
+
* Extract annotation ID from full URI
|
|
92
|
+
*
|
|
93
|
+
* @param uri - Full annotation URI (e.g., "https://api.semiont.app/annotations/anno-xyz789")
|
|
94
|
+
* @returns Short annotation ID (e.g., "anno-xyz789")
|
|
95
|
+
* @throws Error if URI format is invalid
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* uriToAnnotationId("https://api.semiont.app/annotations/anno-xyz789")
|
|
99
|
+
* // => "anno-xyz789"
|
|
100
|
+
*/
|
|
101
|
+
declare function uriToAnnotationId(uri: string): AnnotationId;
|
|
102
|
+
|
|
47
103
|
/**
|
|
48
104
|
* Graph types - Models for graph connections and relationships
|
|
49
105
|
*/
|
|
@@ -604,6 +660,72 @@ type PlatformType$1 = 'posix' | 'container' | 'aws' | 'external';
|
|
|
604
660
|
* via the `definition` "GraphDatabaseType".
|
|
605
661
|
*/
|
|
606
662
|
type GraphDatabaseType = 'neo4j' | 'janusgraph' | 'neptune' | 'memory';
|
|
663
|
+
/**
|
|
664
|
+
* This interface was referenced by `HttpsSemiontOrgSchemasConfigJson`'s JSON-Schema
|
|
665
|
+
* via the `definition` "GraphServiceConfig".
|
|
666
|
+
*/
|
|
667
|
+
type GraphServiceConfig = {
|
|
668
|
+
[k: string]: unknown;
|
|
669
|
+
} & {
|
|
670
|
+
platform: ServicePlatformConfig;
|
|
671
|
+
type: GraphDatabaseType;
|
|
672
|
+
name?: string;
|
|
673
|
+
uri?: string;
|
|
674
|
+
url?: string;
|
|
675
|
+
username?: string;
|
|
676
|
+
password?: string;
|
|
677
|
+
database?: string;
|
|
678
|
+
host?: string;
|
|
679
|
+
port?: number;
|
|
680
|
+
storage?: string;
|
|
681
|
+
index?: string;
|
|
682
|
+
endpoint?: string;
|
|
683
|
+
region?: string;
|
|
684
|
+
command?: string;
|
|
685
|
+
image?: string;
|
|
686
|
+
janusgraphVersion?: string;
|
|
687
|
+
javaOptions?: string;
|
|
688
|
+
heapSize?: string;
|
|
689
|
+
pageCacheSize?: string;
|
|
690
|
+
noAuth?: boolean;
|
|
691
|
+
dataPath?: string;
|
|
692
|
+
timeout?: number;
|
|
693
|
+
wait?: number;
|
|
694
|
+
logsEndpoint?: string;
|
|
695
|
+
tag?: string;
|
|
696
|
+
resources?: ResourceRequirements;
|
|
697
|
+
security?: SecurityRequirements;
|
|
698
|
+
build?: boolean | BuildRequirements;
|
|
699
|
+
dockerfile?: string;
|
|
700
|
+
buildContext?: string;
|
|
701
|
+
buildArgs?: {
|
|
702
|
+
[k: string]: string;
|
|
703
|
+
};
|
|
704
|
+
buildTarget?: string;
|
|
705
|
+
prebuilt?: boolean;
|
|
706
|
+
noCache?: boolean;
|
|
707
|
+
secrets?: string[];
|
|
708
|
+
labels?: {
|
|
709
|
+
[k: string]: string;
|
|
710
|
+
};
|
|
711
|
+
annotations?: {
|
|
712
|
+
[k: string]: string;
|
|
713
|
+
};
|
|
714
|
+
dependencies?: string[];
|
|
715
|
+
externalDependencies?: (string | {
|
|
716
|
+
name?: string;
|
|
717
|
+
url?: string;
|
|
718
|
+
required?: boolean;
|
|
719
|
+
healthCheck?: string;
|
|
720
|
+
[k: string]: unknown;
|
|
721
|
+
})[];
|
|
722
|
+
environment?: {
|
|
723
|
+
[k: string]: string;
|
|
724
|
+
};
|
|
725
|
+
env?: {
|
|
726
|
+
[k: string]: string;
|
|
727
|
+
};
|
|
728
|
+
};
|
|
607
729
|
/**
|
|
608
730
|
* This interface was referenced by `HttpsSemiontOrgSchemasConfigJson`'s JSON-Schema
|
|
609
731
|
* via the `definition` "ServicePlatformConfig".
|
|
@@ -820,70 +942,6 @@ interface DatabaseServiceConfig {
|
|
|
820
942
|
[k: string]: unknown;
|
|
821
943
|
})[];
|
|
822
944
|
}
|
|
823
|
-
/**
|
|
824
|
-
* This interface was referenced by `HttpsSemiontOrgSchemasConfigJson`'s JSON-Schema
|
|
825
|
-
* via the `definition` "GraphServiceConfig".
|
|
826
|
-
*/
|
|
827
|
-
interface GraphServiceConfig {
|
|
828
|
-
platform: ServicePlatformConfig;
|
|
829
|
-
type: GraphDatabaseType;
|
|
830
|
-
name?: string;
|
|
831
|
-
uri: string;
|
|
832
|
-
url?: string;
|
|
833
|
-
username: string;
|
|
834
|
-
password: string;
|
|
835
|
-
database: string;
|
|
836
|
-
host?: string;
|
|
837
|
-
port?: number;
|
|
838
|
-
storage?: string;
|
|
839
|
-
index?: string;
|
|
840
|
-
endpoint?: string;
|
|
841
|
-
region?: string;
|
|
842
|
-
command?: string;
|
|
843
|
-
image?: string;
|
|
844
|
-
janusgraphVersion?: string;
|
|
845
|
-
javaOptions?: string;
|
|
846
|
-
heapSize?: string;
|
|
847
|
-
pageCacheSize?: string;
|
|
848
|
-
noAuth?: boolean;
|
|
849
|
-
dataPath?: string;
|
|
850
|
-
timeout?: number;
|
|
851
|
-
wait?: number;
|
|
852
|
-
logsEndpoint?: string;
|
|
853
|
-
tag?: string;
|
|
854
|
-
resources?: ResourceRequirements;
|
|
855
|
-
security?: SecurityRequirements;
|
|
856
|
-
build?: boolean | BuildRequirements;
|
|
857
|
-
dockerfile?: string;
|
|
858
|
-
buildContext?: string;
|
|
859
|
-
buildArgs?: {
|
|
860
|
-
[k: string]: string;
|
|
861
|
-
};
|
|
862
|
-
buildTarget?: string;
|
|
863
|
-
prebuilt?: boolean;
|
|
864
|
-
noCache?: boolean;
|
|
865
|
-
secrets?: string[];
|
|
866
|
-
labels?: {
|
|
867
|
-
[k: string]: string;
|
|
868
|
-
};
|
|
869
|
-
annotations?: {
|
|
870
|
-
[k: string]: string;
|
|
871
|
-
};
|
|
872
|
-
dependencies?: string[];
|
|
873
|
-
externalDependencies?: (string | {
|
|
874
|
-
name?: string;
|
|
875
|
-
url?: string;
|
|
876
|
-
required?: boolean;
|
|
877
|
-
healthCheck?: string;
|
|
878
|
-
[k: string]: unknown;
|
|
879
|
-
})[];
|
|
880
|
-
environment?: {
|
|
881
|
-
[k: string]: string;
|
|
882
|
-
};
|
|
883
|
-
env?: {
|
|
884
|
-
[k: string]: string;
|
|
885
|
-
};
|
|
886
|
-
}
|
|
887
945
|
/**
|
|
888
946
|
* This interface was referenced by `HttpsSemiontOrgSchemasConfigJson`'s JSON-Schema
|
|
889
947
|
* via the `definition` "FilesystemServiceConfig".
|
|
@@ -1144,6 +1202,10 @@ interface EnvironmentConfig {
|
|
|
1144
1202
|
NODE_ENV?: 'development' | 'production' | 'test';
|
|
1145
1203
|
[k: string]: unknown;
|
|
1146
1204
|
};
|
|
1205
|
+
/**
|
|
1206
|
+
* Logging verbosity level
|
|
1207
|
+
*/
|
|
1208
|
+
logLevel?: 'error' | 'warn' | 'info' | 'http' | 'debug';
|
|
1147
1209
|
deployment?: {
|
|
1148
1210
|
imageTagStrategy?: 'mutable' | 'immutable' | 'git-hash';
|
|
1149
1211
|
[k: string]: unknown;
|
|
@@ -1372,4 +1434,4 @@ declare function validateSiteConfig(data: unknown): ValidationResult;
|
|
|
1372
1434
|
declare const CORE_TYPES_VERSION = "0.1.0";
|
|
1373
1435
|
declare const SDK_VERSION = "0.1.0";
|
|
1374
1436
|
|
|
1375
|
-
export { APIError, type AWSConfig, type AnnotationAddedEvent, type AnnotationBodyUpdatedEvent, type AnnotationCategory, type AnnotationId, type AnnotationRemovedEvent, type AppConfig, type BackendServiceConfig, type BaseEvent, type BodyItem, type BodyOperation, CORE_TYPES_VERSION, CREATION_METHODS, ConfigurationError, ConflictError, type CreateAnnotationInternal, type CreationMethod, type DatabaseServiceConfig, type EntityTagAddedEvent, type EntityTagRemovedEvent, type EntityTypeStats, type Environment, type EnvironmentConfig, type EventMetadata, type EventQuery, type EventSignature, type FilesystemServiceConfig, type FrontendServiceConfig, type GoogleAuthRequest, type GraphConnection, type GraphDatabaseType, type GraphPath, type GraphServiceConfig, type HttpClientConfig, type InferenceServiceConfig, type JobCompletedEvent, type JobFailedEvent, type JobProgressEvent, type JobStartedEvent, type McpServiceConfig, NotFoundError, type PlatformType, type ResourceAnnotations, type ResourceArchivedEvent, type ResourceClonedEvent, type ResourceCreatedEvent, type ResourceCreationDetails, type ResourceEvent, type ResourceEventType, type ResourceFilter, type ResourceId, type ResourceScopedEvent, type ResourceUnarchivedEvent, SDK_VERSION, ScriptError, type SemiontConfig, SemiontError, type ServiceConfig, type ServicePlatformConfig, type ServicesConfig, type SiteConfig, type StoredEvent, type SystemEvent, UnauthorizedError, type UpdateResourceInput, type UserId, ValidationError, type ValidationResult, annotationId, bodyItemsMatch, calculateChecksum, createFetchAPI, didToAgent, fetchAPI, findBodyItem, findProjectRoot, formatEventType, formatRelativeTime, generateId, generateToken, generateUuid, getAllPlatformTypes, getAnnotationIdFromEvent, getAvailableEnvironments, getEnvironmentsPath, getEventDisplayContent, getEventEmoji, getEventEntityTypes, getEventType, getNodeEnvForEnvironment, getResourceCreationDetails, getSemiontConfigPath, isAnnotationId, isArray, isBoolean, isDefined, isEventRelatedToAnnotation, isFunction, isNull, isNullish, isNumber, isObject, isProjectRoot, isResourceEvent, isResourceId, isResourceScopedEvent, isString, isSystemEvent, isUndefined, isValidEnvironment, isValidPlatformType, loadEnvironmentConfig, parseEnvironment, resourceId, userId, userToAgent, userToDid, validateEnvironment, validateEnvironmentConfig, validateSemiontConfig, validateSiteConfig, verifyChecksum };
|
|
1437
|
+
export { APIError, type AWSConfig, type AnnotationAddedEvent, type AnnotationBodyUpdatedEvent, type AnnotationCategory, type AnnotationId, type AnnotationRemovedEvent, type AppConfig, type BackendServiceConfig, type BaseEvent, type BodyItem, type BodyOperation, CORE_TYPES_VERSION, CREATION_METHODS, ConfigurationError, ConflictError, type CreateAnnotationInternal, type CreationMethod, type DatabaseServiceConfig, type EntityTagAddedEvent, type EntityTagRemovedEvent, type EntityTypeStats, type Environment, type EnvironmentConfig, type EventMetadata, type EventQuery, type EventSignature, type FilesystemServiceConfig, type FrontendServiceConfig, type GoogleAuthRequest, type GraphConnection, type GraphDatabaseType, type GraphPath, type GraphServiceConfig, type HttpClientConfig, type InferenceServiceConfig, type JobCompletedEvent, type JobFailedEvent, type JobProgressEvent, type JobStartedEvent, type McpServiceConfig, NotFoundError, type PlatformType, type ResourceAnnotations, type ResourceArchivedEvent, type ResourceClonedEvent, type ResourceCreatedEvent, type ResourceCreationDetails, type ResourceEvent, type ResourceEventType, type ResourceFilter, type ResourceId, type ResourceScopedEvent, type ResourceUnarchivedEvent, SDK_VERSION, ScriptError, type SemiontConfig, SemiontError, type ServiceConfig, type ServicePlatformConfig, type ServicesConfig, type SiteConfig, type StoredEvent, type SystemEvent, UnauthorizedError, type UpdateResourceInput, type UserId, ValidationError, type ValidationResult, annotationId, annotationIdToURI, bodyItemsMatch, calculateChecksum, createFetchAPI, didToAgent, fetchAPI, findBodyItem, findProjectRoot, formatEventType, formatRelativeTime, generateId, generateToken, generateUuid, getAllPlatformTypes, getAnnotationIdFromEvent, getAvailableEnvironments, getEnvironmentsPath, getEventDisplayContent, getEventEmoji, getEventEntityTypes, getEventType, getNodeEnvForEnvironment, getResourceCreationDetails, getSemiontConfigPath, isAnnotationId, isArray, isBoolean, isDefined, isEventRelatedToAnnotation, isFunction, isNull, isNullish, isNumber, isObject, isProjectRoot, isResourceEvent, isResourceId, isResourceScopedEvent, isString, isSystemEvent, isUndefined, isValidEnvironment, isValidPlatformType, loadEnvironmentConfig, parseEnvironment, resourceId, resourceIdToURI, uriToAnnotationId, uriToResourceId, userId, userToAgent, userToDid, validateEnvironment, validateEnvironmentConfig, validateSemiontConfig, validateSiteConfig, verifyChecksum };
|