@sharpee/core 5.5.1 → 5.6.1
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/events/event-factory.d.ts +11 -25
- package/events/event-factory.d.ts.map +1 -1
- package/events/event-factory.js +0 -34
- package/events/event-factory.js.map +1 -1
- package/events/event-registry.d.ts +13 -6
- package/events/event-registry.d.ts.map +1 -1
- package/events/event-registry.js +13 -2
- package/events/event-registry.js.map +1 -1
- package/events/game-events.d.ts +0 -67
- package/events/game-events.d.ts.map +1 -1
- package/events/game-events.js +0 -60
- package/events/game-events.js.map +1 -1
- package/events/index.d.ts +0 -2
- package/events/index.d.ts.map +1 -1
- package/events/index.js +0 -2
- package/events/index.js.map +1 -1
- package/events/platform-events.d.ts +0 -1
- package/events/platform-events.d.ts.map +1 -1
- package/events/platform-events.js +0 -14
- package/events/platform-events.js.map +1 -1
- package/events/system-event.d.ts +0 -5
- package/events/system-event.d.ts.map +1 -1
- package/events/system-event.js +0 -13
- package/events/system-event.js.map +1 -1
- package/index.d.ts +54 -9
- package/index.d.ts.map +1 -1
- package/index.js +103 -31
- package/index.js.map +1 -1
- package/metadata/index.d.ts +1 -1
- package/metadata/index.d.ts.map +1 -1
- package/metadata/story-metadata.d.ts +0 -8
- package/metadata/story-metadata.d.ts.map +1 -1
- package/package.json +1 -1
- package/query/query-manager.d.ts +1 -5
- package/query/query-manager.d.ts.map +1 -1
- package/query/query-manager.js +0 -7
- package/query/query-manager.js.map +1 -1
- package/types/entity.d.ts +0 -13
- package/types/entity.d.ts.map +1 -1
- package/types/index.d.ts +0 -2
- package/types/index.d.ts.map +1 -1
- package/types/index.js +0 -2
- package/types/index.js.map +1 -1
- package/types/result.d.ts +0 -22
- package/types/result.d.ts.map +1 -1
- package/constants/attributes.d.ts +0 -32
- package/constants/attributes.d.ts.map +0 -1
- package/constants/attributes.js +0 -53
- package/constants/attributes.js.map +0 -1
- package/constants/core-events.d.ts +0 -37
- package/constants/core-events.d.ts.map +0 -1
- package/constants/core-events.js +0 -50
- package/constants/core-events.js.map +0 -1
- package/constants/entity-types.d.ts +0 -15
- package/constants/entity-types.d.ts.map +0 -1
- package/constants/entity-types.js +0 -27
- package/constants/entity-types.js.map +0 -1
- package/constants/index.d.ts +0 -22
- package/constants/index.d.ts.map +0 -1
- package/constants/index.js +0 -41
- package/constants/index.js.map +0 -1
- package/constants/relationships.d.ts +0 -25
- package/constants/relationships.d.ts.map +0 -1
- package/constants/relationships.js +0 -55
- package/constants/relationships.js.map +0 -1
- package/debug/index.d.ts +0 -5
- package/debug/index.d.ts.map +0 -1
- package/debug/index.js +0 -21
- package/debug/index.js.map +0 -1
- package/debug/types.d.ts +0 -65
- package/debug/types.d.ts.map +0 -1
- package/debug/types.js +0 -39
- package/debug/types.js.map +0 -1
- package/events/standard-events.d.ts +0 -26
- package/events/standard-events.d.ts.map +0 -1
- package/events/standard-events.js +0 -27
- package/events/standard-events.js.map +0 -1
- package/events/typed-event.d.ts +0 -69
- package/events/typed-event.d.ts.map +0 -1
- package/events/typed-event.js +0 -20
- package/events/typed-event.js.map +0 -1
- package/execution/index.d.ts +0 -2
- package/execution/index.d.ts.map +0 -1
- package/execution/index.js +0 -23
- package/execution/index.js.map +0 -1
- package/execution/types.d.ts +0 -117
- package/execution/types.d.ts.map +0 -1
- package/execution/types.js +0 -4
- package/execution/types.js.map +0 -1
- package/extensions/index.d.ts +0 -3
- package/extensions/index.d.ts.map +0 -1
- package/extensions/index.js +0 -20
- package/extensions/index.js.map +0 -1
- package/extensions/registry.d.ts +0 -61
- package/extensions/registry.d.ts.map +0 -1
- package/extensions/registry.js +0 -153
- package/extensions/registry.js.map +0 -1
- package/extensions/types.d.ts +0 -84
- package/extensions/types.d.ts.map +0 -1
- package/extensions/types.js +0 -15
- package/extensions/types.js.map +0 -1
- package/types/attribute.d.ts +0 -40
- package/types/attribute.d.ts.map +0 -1
- package/types/attribute.js +0 -4
- package/types/attribute.js.map +0 -1
- package/types/relationship.d.ts +0 -44
- package/types/relationship.d.ts.map +0 -1
- package/types/relationship.js +0 -4
- package/types/relationship.js.map +0 -1
package/execution/index.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// packages/core/src/execution/index.ts
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
-
};
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
__exportStar(require("./types.js"), exports);
|
|
19
|
-
// command-router has been moved to stdlib as it depends on GameContext
|
|
20
|
-
// command-handler has been moved to stdlib as it depends on parser and GameContext
|
|
21
|
-
// game-context has been moved to stdlib as it depends on world-model
|
|
22
|
-
// actions have been moved to stdlib as they depend on parser and GameContext
|
|
23
|
-
//# sourceMappingURL=index.js.map
|
package/execution/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/execution/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;;;;;;;;;;;;;;;;AAEvC,6CAA2B;AAC3B,uEAAuE;AACvE,mFAAmF;AACnF,qEAAqE;AACrE,6EAA6E"}
|
package/execution/types.d.ts
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generic context interface for execution
|
|
3
|
-
* Domain-specific contexts should extend this interface
|
|
4
|
-
*/
|
|
5
|
-
export interface IExecutionContext {
|
|
6
|
-
/**
|
|
7
|
-
* Additional context data
|
|
8
|
-
*/
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Generic handler interface for any command-like system
|
|
13
|
-
* This is kept generic - specific implementations (IF, visual novel, etc)
|
|
14
|
-
* should define their own command and result types
|
|
15
|
-
*/
|
|
16
|
-
export interface ICommandHandler<TCommand = any, TResult = any> {
|
|
17
|
-
/**
|
|
18
|
-
* The verb or verbs that this handler can process
|
|
19
|
-
*/
|
|
20
|
-
verbs: string[];
|
|
21
|
-
/**
|
|
22
|
-
* Check if this handler can handle the given command
|
|
23
|
-
*/
|
|
24
|
-
canHandle: (command: TCommand, context: IExecutionContext) => boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Execute the command
|
|
27
|
-
*/
|
|
28
|
-
execute: (command: TCommand, context: IExecutionContext) => Promise<TResult> | TResult;
|
|
29
|
-
/**
|
|
30
|
-
* Validate the command before execution
|
|
31
|
-
*/
|
|
32
|
-
validate?: (command: TCommand, context: IExecutionContext) => {
|
|
33
|
-
valid: boolean;
|
|
34
|
-
error?: string;
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Generic action interface
|
|
39
|
-
* Actions are handlers with unique identifiers
|
|
40
|
-
*/
|
|
41
|
-
export interface IAction<TCommand = any, TResult = any> extends ICommandHandler<TCommand, TResult> {
|
|
42
|
-
/**
|
|
43
|
-
* Unique identifier for the action
|
|
44
|
-
*/
|
|
45
|
-
id: string;
|
|
46
|
-
/**
|
|
47
|
-
* Action metadata (if any)
|
|
48
|
-
*/
|
|
49
|
-
metadata?: any;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Generic router interface for command-like systems
|
|
53
|
-
*/
|
|
54
|
-
export interface ICommandRouter<TCommand = any, TResult = any> {
|
|
55
|
-
/**
|
|
56
|
-
* Register a command handler
|
|
57
|
-
*/
|
|
58
|
-
registerHandler: (handler: ICommandHandler<TCommand, TResult>) => void;
|
|
59
|
-
/**
|
|
60
|
-
* Unregister a command handler
|
|
61
|
-
*/
|
|
62
|
-
unregisterHandler: (handler: ICommandHandler<TCommand, TResult>) => void;
|
|
63
|
-
/**
|
|
64
|
-
* Get a handler for the command
|
|
65
|
-
*/
|
|
66
|
-
getHandler: (command: TCommand, context: IExecutionContext) => ICommandHandler<TCommand, TResult> | undefined;
|
|
67
|
-
/**
|
|
68
|
-
* Route and execute a command
|
|
69
|
-
*/
|
|
70
|
-
execute: (command: TCommand, context: IExecutionContext, options?: ICommandExecutionOptions<TCommand>) => Promise<TResult>;
|
|
71
|
-
/**
|
|
72
|
-
* Process the result of command execution and return text output
|
|
73
|
-
*/
|
|
74
|
-
processResult?: (result: TResult) => string;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Generic factory interface for creating handlers
|
|
78
|
-
*/
|
|
79
|
-
export interface ICommandHandlerFactory<TCommand = any, TResult = any> {
|
|
80
|
-
/**
|
|
81
|
-
* Create a standard command handler
|
|
82
|
-
*/
|
|
83
|
-
createHandler: (config: {
|
|
84
|
-
verbs: string[];
|
|
85
|
-
canHandle?: (command: TCommand, context: IExecutionContext) => boolean;
|
|
86
|
-
execute: (command: TCommand, context: IExecutionContext) => Promise<TResult> | TResult;
|
|
87
|
-
validate?: (command: TCommand, context: IExecutionContext) => {
|
|
88
|
-
valid: boolean;
|
|
89
|
-
error?: string;
|
|
90
|
-
};
|
|
91
|
-
}) => ICommandHandler<TCommand, TResult>;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Options for command execution
|
|
95
|
-
*/
|
|
96
|
-
export interface ICommandExecutionOptions<TCommand = any, TResult = any> {
|
|
97
|
-
/**
|
|
98
|
-
* Whether to skip validation
|
|
99
|
-
*/
|
|
100
|
-
skipValidation?: boolean;
|
|
101
|
-
/**
|
|
102
|
-
* Custom validation callback
|
|
103
|
-
*/
|
|
104
|
-
customValidation?: (command: TCommand, context: IExecutionContext) => {
|
|
105
|
-
valid: boolean;
|
|
106
|
-
error?: string;
|
|
107
|
-
};
|
|
108
|
-
/**
|
|
109
|
-
* Pre-execution hooks
|
|
110
|
-
*/
|
|
111
|
-
preExecute?: ((command: TCommand, context: IExecutionContext) => Promise<void> | void)[];
|
|
112
|
-
/**
|
|
113
|
-
* Post-execution hooks
|
|
114
|
-
*/
|
|
115
|
-
postExecute?: ((result: TResult, command: TCommand, context: IExecutionContext) => Promise<TResult> | TResult)[];
|
|
116
|
-
}
|
|
117
|
-
//# sourceMappingURL=types.d.ts.map
|
package/execution/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/execution/types.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe,CAAC,QAAQ,GAAG,GAAG,EAAE,OAAO,GAAG,GAAG;IAC5D;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;IAEhB;;OAEG;IACH,SAAS,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC;IAEtE;;OAEG;IACH,OAAO,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IAEvF;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,KAAK;QAAE,KAAK,EAAE,OAAO,CA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iB,KAAK,OAAO,CAAC;QACvE,OAAO,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;QACvF,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,KAAK;YAAE,KAAK,EAAE,OAAO,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KAClG,KAAK,eAAe,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB,CAAC,QAAQ,GAAG,GAAG,EAAE,OAAO,GAAG,GAAG;IACrE;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,KAAK;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAEzG;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;IAEzF;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,EAAE,CAAC;CAClH"}
|
package/execution/types.js
DELETED
package/execution/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/execution/types.ts"],"names":[],"mappings":";AAAA,uCAAuC"}
|
package/extensions/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/extensions/index.ts"],"names":[],"mappings":"AAEA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC"}
|
package/extensions/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// packages/core/src/extensions/index.ts
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
-
};
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
__exportStar(require("./types.js"), exports);
|
|
19
|
-
__exportStar(require("./registry.js"), exports);
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
package/extensions/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/extensions/index.ts"],"names":[],"mappings":";AAAA,wCAAwC;;;;;;;;;;;;;;;;AAExC,6CAA2B;AAC3B,gDAA8B"}
|
package/extensions/registry.d.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { AnyExtension, ExtensionType } from './types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Registry for extensions
|
|
4
|
-
*/
|
|
5
|
-
export declare class ExtensionRegistry {
|
|
6
|
-
private extensions;
|
|
7
|
-
private processingOrder;
|
|
8
|
-
/**
|
|
9
|
-
* Register an extension
|
|
10
|
-
* @param type Type of extension
|
|
11
|
-
* @param extension The extension to register
|
|
12
|
-
*/
|
|
13
|
-
register<T extends AnyExtension>(type: ExtensionType, extension: T): void;
|
|
14
|
-
/**
|
|
15
|
-
* Get an extension by type and id
|
|
16
|
-
* @param type Type of extension
|
|
17
|
-
* @param id Extension ID
|
|
18
|
-
*/
|
|
19
|
-
get<T extends AnyExtension>(type: ExtensionType, id: string): T | undefined;
|
|
20
|
-
/**
|
|
21
|
-
* Get all extensions of a specific type
|
|
22
|
-
* @param type Type of extension
|
|
23
|
-
*/
|
|
24
|
-
getAll<T extends AnyExtension>(type: ExtensionType): T[];
|
|
25
|
-
/**
|
|
26
|
-
* Set the processing order for a specific extension type
|
|
27
|
-
* @param type Type of extension
|
|
28
|
-
* @param orderedIds Ordered list of extension IDs
|
|
29
|
-
*/
|
|
30
|
-
setProcessingOrder(type: ExtensionType, orderedIds: string[]): void;
|
|
31
|
-
/**
|
|
32
|
-
* Check if an extension is registered
|
|
33
|
-
* @param type Type of extension
|
|
34
|
-
* @param id Extension ID
|
|
35
|
-
*/
|
|
36
|
-
has(type: ExtensionType, id: string): boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Remove an extension
|
|
39
|
-
* @param type Type of extension
|
|
40
|
-
* @param id Extension ID
|
|
41
|
-
*/
|
|
42
|
-
remove(type: ExtensionType, id: string): boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Get the number of registered extensions of a specific type
|
|
45
|
-
* @param type Type of extension
|
|
46
|
-
*/
|
|
47
|
-
count(type: ExtensionType): number;
|
|
48
|
-
/**
|
|
49
|
-
* Initialize an extension if needed
|
|
50
|
-
*/
|
|
51
|
-
private initializeExtension;
|
|
52
|
-
/**
|
|
53
|
-
* Clean up an extension if needed
|
|
54
|
-
*/
|
|
55
|
-
private cleanupExtension;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Create a new extension registry
|
|
59
|
-
*/
|
|
60
|
-
export declare function createExtensionRegistry(): ExtensionRegistry;
|
|
61
|
-
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/extensions/registry.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEzD;;GAEG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,UAAU,CAA4D;IAC9E,OAAO,CAAC,eAAe,CAA2C;IAElE;;;;OAIG;IACI,QAAQ,CAAC,CAAC,SAAS,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC,GAAG,IAAI;IAuBhF;;;;OAIG;IACI,GAAG,CAAC,CAAC,SAAS,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAOlF;;;OAGG;IACI,MAAM,CAAC,CAAC,SAAS,YAAY,EAAE,IAAI,EAAE,aAAa,GAAG,CAAC,EAAE;IAY/D;;;;OAIG;IACI,kBAAkB,CAAC,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI;IA0B1E;;;;OAIG;IACI,GAAG,CAAC,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO;IAOpD;;;;OAIG;IACI,MAAM,CAAC,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO;IAuBvD;;;OAGG;IACI,KAAK,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM;IAOzC;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAK3B;;OAEG;IACH,OAAO,CAAC,gBAAgB;CAIzB;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,iBAAiB,CAE3D"}
|
package/extensions/registry.js
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// packages/core/src/extensions/registry.ts
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.ExtensionRegistry = void 0;
|
|
5
|
-
exports.createExtensionRegistry = createExtensionRegistry;
|
|
6
|
-
/**
|
|
7
|
-
* Registry for extensions
|
|
8
|
-
*/
|
|
9
|
-
class ExtensionRegistry {
|
|
10
|
-
extensions = new Map();
|
|
11
|
-
processingOrder = new Map();
|
|
12
|
-
/**
|
|
13
|
-
* Register an extension
|
|
14
|
-
* @param type Type of extension
|
|
15
|
-
* @param extension The extension to register
|
|
16
|
-
*/
|
|
17
|
-
register(type, extension) {
|
|
18
|
-
// Initialize maps if they don't exist
|
|
19
|
-
if (!this.extensions.has(type)) {
|
|
20
|
-
this.extensions.set(type, new Map());
|
|
21
|
-
this.processingOrder.set(type, []);
|
|
22
|
-
}
|
|
23
|
-
const typeRegistry = this.extensions.get(type);
|
|
24
|
-
const orderList = this.processingOrder.get(type);
|
|
25
|
-
// Check for duplicate extensions
|
|
26
|
-
if (typeRegistry.has(extension.id)) {
|
|
27
|
-
throw new Error(`Extension with ID "${extension.id}" already registered for type "${type}"`);
|
|
28
|
-
}
|
|
29
|
-
// Register the extension
|
|
30
|
-
typeRegistry.set(extension.id, extension);
|
|
31
|
-
orderList.push(extension.id);
|
|
32
|
-
// Handle initialization for certain extension types
|
|
33
|
-
this.initializeExtension(type, extension);
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Get an extension by type and id
|
|
37
|
-
* @param type Type of extension
|
|
38
|
-
* @param id Extension ID
|
|
39
|
-
*/
|
|
40
|
-
get(type, id) {
|
|
41
|
-
const typeRegistry = this.extensions.get(type);
|
|
42
|
-
if (!typeRegistry)
|
|
43
|
-
return undefined;
|
|
44
|
-
return typeRegistry.get(id);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Get all extensions of a specific type
|
|
48
|
-
* @param type Type of extension
|
|
49
|
-
*/
|
|
50
|
-
getAll(type) {
|
|
51
|
-
const typeRegistry = this.extensions.get(type);
|
|
52
|
-
if (!typeRegistry)
|
|
53
|
-
return [];
|
|
54
|
-
const orderList = this.processingOrder.get(type) || [];
|
|
55
|
-
// Return extensions in the order they were registered
|
|
56
|
-
return orderList
|
|
57
|
-
.map(id => typeRegistry.get(id))
|
|
58
|
-
.filter((e) => e !== undefined);
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Set the processing order for a specific extension type
|
|
62
|
-
* @param type Type of extension
|
|
63
|
-
* @param orderedIds Ordered list of extension IDs
|
|
64
|
-
*/
|
|
65
|
-
setProcessingOrder(type, orderedIds) {
|
|
66
|
-
const typeRegistry = this.extensions.get(type);
|
|
67
|
-
if (!typeRegistry) {
|
|
68
|
-
throw new Error(`No extensions registered for type "${type}"`);
|
|
69
|
-
}
|
|
70
|
-
// Validate that all IDs exist
|
|
71
|
-
for (const id of orderedIds) {
|
|
72
|
-
if (!typeRegistry.has(id)) {
|
|
73
|
-
throw new Error(`Extension with ID "${id}" not found for type "${type}"`);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
// Validate that all extensions are included
|
|
77
|
-
const registeredIds = Array.from(typeRegistry.keys());
|
|
78
|
-
if (registeredIds.length !== orderedIds.length) {
|
|
79
|
-
throw new Error(`Processing order must include all registered extensions. ` +
|
|
80
|
-
`Missing: ${registeredIds.filter(id => !orderedIds.includes(id)).join(', ')}`);
|
|
81
|
-
}
|
|
82
|
-
// Set the processing order
|
|
83
|
-
this.processingOrder.set(type, [...orderedIds]);
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Check if an extension is registered
|
|
87
|
-
* @param type Type of extension
|
|
88
|
-
* @param id Extension ID
|
|
89
|
-
*/
|
|
90
|
-
has(type, id) {
|
|
91
|
-
const typeRegistry = this.extensions.get(type);
|
|
92
|
-
if (!typeRegistry)
|
|
93
|
-
return false;
|
|
94
|
-
return typeRegistry.has(id);
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Remove an extension
|
|
98
|
-
* @param type Type of extension
|
|
99
|
-
* @param id Extension ID
|
|
100
|
-
*/
|
|
101
|
-
remove(type, id) {
|
|
102
|
-
const typeRegistry = this.extensions.get(type);
|
|
103
|
-
if (!typeRegistry)
|
|
104
|
-
return false;
|
|
105
|
-
// Check if extension exists
|
|
106
|
-
if (!typeRegistry.has(id))
|
|
107
|
-
return false;
|
|
108
|
-
// Remove from processing order
|
|
109
|
-
const orderList = this.processingOrder.get(type);
|
|
110
|
-
if (orderList) {
|
|
111
|
-
const index = orderList.indexOf(id);
|
|
112
|
-
if (index !== -1) {
|
|
113
|
-
orderList.splice(index, 1);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
// Clean up extension if needed
|
|
117
|
-
this.cleanupExtension(type, typeRegistry.get(id));
|
|
118
|
-
// Remove from registry
|
|
119
|
-
return typeRegistry.delete(id);
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Get the number of registered extensions of a specific type
|
|
123
|
-
* @param type Type of extension
|
|
124
|
-
*/
|
|
125
|
-
count(type) {
|
|
126
|
-
const typeRegistry = this.extensions.get(type);
|
|
127
|
-
if (!typeRegistry)
|
|
128
|
-
return 0;
|
|
129
|
-
return typeRegistry.size;
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Initialize an extension if needed
|
|
133
|
-
*/
|
|
134
|
-
initializeExtension(type, extension) {
|
|
135
|
-
// Add any initialization logic here if needed
|
|
136
|
-
// For example, calling initialize() on WorldModelExtensions
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Clean up an extension if needed
|
|
140
|
-
*/
|
|
141
|
-
cleanupExtension(type, extension) {
|
|
142
|
-
// Add any cleanup logic here if needed
|
|
143
|
-
// For example, calling cleanup() on WorldModelExtensions
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
exports.ExtensionRegistry = ExtensionRegistry;
|
|
147
|
-
/**
|
|
148
|
-
* Create a new extension registry
|
|
149
|
-
*/
|
|
150
|
-
function createExtensionRegistry() {
|
|
151
|
-
return new ExtensionRegistry();
|
|
152
|
-
}
|
|
153
|
-
//# sourceMappingURL=registry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/extensions/registry.ts"],"names":[],"mappings":";AAAA,2CAA2C;;;AA4K3C,0DAEC;AAvKD;;GAEG;AACH,MAAa,iBAAiB;IACpB,UAAU,GAAkD,IAAI,GAAG,EAAE,CAAC;IACtE,eAAe,GAAiC,IAAI,GAAG,EAAE,CAAC;IAElE;;;;OAIG;IACI,QAAQ,CAAyB,IAAmB,EAAE,SAAY;QACvE,sCAAsC;QACtC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAC/B,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,GAAG,EAAwB,CAAC,CAAC;YAC3D,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACrC,CAAC;QAED,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC;QAChD,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC;QAElD,iCAAiC;QACjC,IAAI,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC;YACnC,MAAM,IAAI,KAAK,CAAC,sBAAsB,SAAS,CAAC,EAAE,kCAAkC,IAAI,GAAG,CAAC,CAAC;QAC/F,CAAC;QAED,yBAAyB;QACzB,YAAY,CAAC,GAAG,CAA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AAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACjD,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YACpC,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;gBACjB,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YAC7B,CAAC;QACH,CAAC;QAED,+BAA+B;QAC/B,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,YAAY,CAAC,GAAG,CAAC,EAAE,CAAE,CAAC,CAAC;QAEnD,uBAAuB;QACvB,OAAO,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACjC,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,IAAmB;QAC9B,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC/C,IAAI,CAAC,YAAY;YAAE,OAAO,CAAC,CAAC;QAE5B,OAAO,YAAY,CAAC,IAAI,CAAC;IAC3B,CAAC;IAED;;OAEG;IACK,mBAAmB,CAAC,IAAmB,EAAE,SAAuB;QACtE,8CAA8C;QAC9C,4DAA4D;IAC9D,CAAC;IAED;;OAEG;IACK,gBAAgB,CAAC,IAAmB,EAAE,SAAuB;QACnE,uCAAuC;QACvC,yDAAyD;IAC3D,CAAC;CACF;AA7JD,8CA6JC;AAED;;GAEG;AACH,SAAgB,uBAAuB;IACrC,OAAO,IAAI,iBAAiB,EAAE,CAAC;AACjC,CAAC"}
|
package/extensions/types.d.ts
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { ISemanticEvent } from '../events/types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Base interface for all extensions
|
|
4
|
-
*/
|
|
5
|
-
export interface IExtension {
|
|
6
|
-
/**
|
|
7
|
-
* Unique identifier for this extension
|
|
8
|
-
*/
|
|
9
|
-
id: string;
|
|
10
|
-
/**
|
|
11
|
-
* Human-readable name of the extension
|
|
12
|
-
*/
|
|
13
|
-
name: string;
|
|
14
|
-
/**
|
|
15
|
-
* Version of the extension
|
|
16
|
-
*/
|
|
17
|
-
version?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Extension dependencies
|
|
20
|
-
*/
|
|
21
|
-
dependencies?: string[];
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Extension for command handling (generic)
|
|
25
|
-
* The IF-specific version with ParsedCommand and GameContext is in stdlib
|
|
26
|
-
*/
|
|
27
|
-
export interface ICommandExtension extends IExtension {
|
|
28
|
-
/**
|
|
29
|
-
* Verbs that this extension can handle
|
|
30
|
-
*/
|
|
31
|
-
verbs: string[];
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Extension for abilities (generic)
|
|
35
|
-
* The IF-specific version with GameContext is in stdlib
|
|
36
|
-
*/
|
|
37
|
-
export interface IAbilityExtension extends IExtension {
|
|
38
|
-
/**
|
|
39
|
-
* Name of the ability
|
|
40
|
-
*/
|
|
41
|
-
abilityName: string;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Extension for event processing (generic)
|
|
45
|
-
* The IF-specific version with GameContext is in stdlib
|
|
46
|
-
*/
|
|
47
|
-
export interface IEventExtension extends IExtension {
|
|
48
|
-
/**
|
|
49
|
-
* Event types that this extension handles
|
|
50
|
-
*/
|
|
51
|
-
eventTypes: string[];
|
|
52
|
-
/**
|
|
53
|
-
* Process an event
|
|
54
|
-
*/
|
|
55
|
-
processEvent: (event: ISemanticEvent) => ISemanticEvent[];
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Extension for parser enhancements (generic)
|
|
59
|
-
* The IF-specific version with ParsedCommand is in stdlib
|
|
60
|
-
*/
|
|
61
|
-
export interface IParserExtension extends IExtension {
|
|
62
|
-
/**
|
|
63
|
-
* Grammar rules, dictionaries, etc.
|
|
64
|
-
*/
|
|
65
|
-
vocabulary?: Record<string, string[]>;
|
|
66
|
-
/**
|
|
67
|
-
* Pre-processing hook for input text
|
|
68
|
-
*/
|
|
69
|
-
preProcessInput?: (input: string) => string;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Extension types enum
|
|
73
|
-
*/
|
|
74
|
-
export declare enum ExtensionType {
|
|
75
|
-
COMMAND = "command",
|
|
76
|
-
ABILITY = "ability",
|
|
77
|
-
EVENT = "event",
|
|
78
|
-
PARSER = "parser"
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Union type for all extension types
|
|
82
|
-
*/
|
|
83
|
-
export type AnyExtension = ICommandExtension | IAbilityExtension | IEventExtension | IParserExtension;
|
|
84
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/extensions/types.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,UAAU;IACnD;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,UAAU;IACnD;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,eAAgB,SAAQ,UAAU;IACjD;;OAEG;IACH,UAAU,EAAE,MAAM,EAAE,CAAC;IAErB;;OAEG;IACH,YAAY,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,cAAc,EAAE,CAAC;CAC3D;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAiB,SAAQ,UAAU;IAClD;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAEtC;;OAEG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAC7C;AAED;;GAEG;AACH,oBAAY,aAAa;IACvB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,MAAM,WAAW;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GACpB,iBAAiB,GACjB,iBAAiB,GACjB,eAAe,GACf,gBAAgB,CAAC"}
|
package/extensions/types.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// packages/core/src/extensions/types.ts
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.ExtensionType = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* Extension types enum
|
|
7
|
-
*/
|
|
8
|
-
var ExtensionType;
|
|
9
|
-
(function (ExtensionType) {
|
|
10
|
-
ExtensionType["COMMAND"] = "command";
|
|
11
|
-
ExtensionType["ABILITY"] = "ability";
|
|
12
|
-
ExtensionType["EVENT"] = "event";
|
|
13
|
-
ExtensionType["PARSER"] = "parser";
|
|
14
|
-
})(ExtensionType || (exports.ExtensionType = ExtensionType = {}));
|
|
15
|
-
//# sourceMappingURL=types.js.map
|
package/extensions/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/extensions/types.ts"],"names":[],"mappings":";AAAA,wCAAwC;;;AAmFxC;;GAEG;AACH,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,oCAAmB,CAAA;IACnB,gCAAe,CAAA;IACf,kCAAiB,CAAA;AACnB,CAAC,EALW,aAAa,6BAAb,aAAa,QAKxB"}
|
package/types/attribute.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Possible types for attribute values
|
|
3
|
-
*/
|
|
4
|
-
export type AttributeValue = string | number | boolean | null | IAttributeObject | AttributeArray;
|
|
5
|
-
/**
|
|
6
|
-
* An object containing attribute values
|
|
7
|
-
*/
|
|
8
|
-
export interface IAttributeObject {
|
|
9
|
-
[key: string]: AttributeValue;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* An array of attribute values
|
|
13
|
-
*/
|
|
14
|
-
export type AttributeArray = AttributeValue[];
|
|
15
|
-
/**
|
|
16
|
-
* Configuration for an attribute
|
|
17
|
-
*/
|
|
18
|
-
export interface IAttributeConfig {
|
|
19
|
-
/**
|
|
20
|
-
* Type validation for this attribute
|
|
21
|
-
*/
|
|
22
|
-
type?: 'string' | 'number' | 'boolean' | 'object' | 'array';
|
|
23
|
-
/**
|
|
24
|
-
* Whether this attribute is required for the entity
|
|
25
|
-
*/
|
|
26
|
-
required?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Default value if none is provided
|
|
29
|
-
*/
|
|
30
|
-
default?: AttributeValue;
|
|
31
|
-
/**
|
|
32
|
-
* Custom validation function
|
|
33
|
-
*/
|
|
34
|
-
validate?: (value: AttributeValue) => boolean;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* A map of attribute configurations
|
|
38
|
-
*/
|
|
39
|
-
export type AttributeConfigMap = Record<string, IAttributeConfig>;
|
|
40
|
-
//# sourceMappingURL=attribute.d.ts.map
|
package/types/attribute.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"attribute.d.ts","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/types/attribute.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,cAAc,GACtB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,gBAAgB,GAChB,cAAc,CAAC;AAEnB;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,cAAc,EAAE,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;IAE5D;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC;IAEzB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,OAAO,CAAC;CAC/C;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC"}
|
package/types/attribute.js
DELETED
package/types/attribute.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"attribute.js","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/types/attribute.ts"],"names":[],"mappings":";AAAA,uCAAuC"}
|
package/types/relationship.d.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { EntityId } from './entity.js';
|
|
2
|
-
/**
|
|
3
|
-
* A generic relationship between two entities
|
|
4
|
-
*/
|
|
5
|
-
export interface IRelationship {
|
|
6
|
-
/**
|
|
7
|
-
* The source entity of the relationship
|
|
8
|
-
*/
|
|
9
|
-
sourceId: EntityId;
|
|
10
|
-
/**
|
|
11
|
-
* The type of relationship (can be any string)
|
|
12
|
-
*/
|
|
13
|
-
type: string;
|
|
14
|
-
/**
|
|
15
|
-
* The target entity of the relationship
|
|
16
|
-
*/
|
|
17
|
-
targetId: EntityId;
|
|
18
|
-
/**
|
|
19
|
-
* Optional metadata for the relationship
|
|
20
|
-
*/
|
|
21
|
-
metadata?: Record<string, unknown>;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Configuration for creating a relationship
|
|
25
|
-
*/
|
|
26
|
-
export interface IRelationshipConfig {
|
|
27
|
-
/**
|
|
28
|
-
* Whether this relationship creates an inverse relationship automatically
|
|
29
|
-
*/
|
|
30
|
-
bidirectional?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* If bidirectional, the name of the inverse relationship
|
|
33
|
-
*/
|
|
34
|
-
inverseType?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Whether this relationship is exclusive (replaces previous relationships of same type)
|
|
37
|
-
*/
|
|
38
|
-
exclusive?: boolean;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Map of relationship type configurations
|
|
42
|
-
*/
|
|
43
|
-
export type RelationshipConfigMap = Record<string, IRelationshipConfig>;
|
|
44
|
-
//# sourceMappingURL=relationship.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"relationship.d.ts","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/types/relationship.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,QAAQ,EAAE,QAAQ,CAAC;IAEnB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,EAAE,QAAQ,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC"}
|
package/types/relationship.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"relationship.js","sourceRoot":"","sources":["../../../../work/sharpee/sharpee/packages/core/src/types/relationship.ts"],"names":[],"mappings":";AAAA,0CAA0C"}
|