@xylabs/creatable 5.0.75 → 5.0.78
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/dist/neutral/AbstractCreatable.d.ts +1 -3
- package/dist/neutral/AbstractCreatable.d.ts.map +1 -1
- package/dist/neutral/Creatable.d.ts +0 -5
- package/dist/neutral/Creatable.d.ts.map +1 -1
- package/dist/neutral/index.d.ts +0 -3
- package/dist/neutral/index.d.ts.map +1 -1
- package/dist/neutral/index.mjs +0 -294
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/model/CreatableInstance.d.ts +1 -2
- package/dist/neutral/model/CreatableInstance.d.ts.map +1 -1
- package/dist/neutral/model/CreatableParams.d.ts +2 -1
- package/dist/neutral/model/CreatableParams.d.ts.map +1 -1
- package/dist/neutral/model/CreatableStatusReporter.d.ts +4 -7
- package/dist/neutral/model/CreatableStatusReporter.d.ts.map +1 -1
- package/dist/neutral/model/index.d.ts +0 -5
- package/dist/neutral/model/index.d.ts.map +1 -1
- package/package.json +9 -15
- package/src/AbstractCreatable.ts +1 -3
- package/src/Creatable.ts +0 -5
- package/src/index.ts +0 -3
- package/src/model/CreatableInstance.ts +1 -2
- package/src/model/CreatableParams.ts +3 -1
- package/src/model/CreatableStatusReporter.ts +4 -8
- package/src/model/index.ts +0 -5
- package/dist/neutral/AbstractCreatableV2.d.ts +0 -62
- package/dist/neutral/AbstractCreatableV2.d.ts.map +0 -1
- package/dist/neutral/CreatableV2.d.ts +0 -31
- package/dist/neutral/CreatableV2.d.ts.map +0 -1
- package/dist/neutral/FactoryV2.d.ts +0 -11
- package/dist/neutral/FactoryV2.d.ts.map +0 -1
- package/dist/neutral/model/CreatableInstanceV2.d.ts +0 -13
- package/dist/neutral/model/CreatableInstanceV2.d.ts.map +0 -1
- package/dist/neutral/model/CreatableName.d.ts +0 -5
- package/dist/neutral/model/CreatableName.d.ts.map +0 -1
- package/dist/neutral/model/CreatableParamsV2.d.ts +0 -62
- package/dist/neutral/model/CreatableParamsV2.d.ts.map +0 -1
- package/dist/neutral/model/CreatableStatusReporter.zod.d.ts +0 -44
- package/dist/neutral/model/CreatableStatusReporter.zod.d.ts.map +0 -1
- package/dist/neutral/model/CreatableStatusReporterV2.d.ts +0 -7
- package/dist/neutral/model/CreatableStatusReporterV2.d.ts.map +0 -1
- package/src/AbstractCreatableV2.ts +0 -270
- package/src/CreatableV2.ts +0 -67
- package/src/FactoryV2.ts +0 -38
- package/src/model/CreatableInstanceV2.ts +0 -15
- package/src/model/CreatableName.ts +0 -3
- package/src/model/CreatableParamsV2.ts +0 -11
- package/src/model/CreatableStatusReporter.zod.ts +0 -31
- package/src/model/CreatableStatusReporterV2.ts +0 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xylabs/creatable",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.78",
|
|
4
4
|
"description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -38,27 +38,21 @@
|
|
|
38
38
|
"!**/*.test.*"
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@xylabs/assert": "~5.0.
|
|
42
|
-
"@xylabs/base": "~5.0.
|
|
43
|
-
"@xylabs/events": "~5.0.
|
|
44
|
-
"@xylabs/logger": "~5.0.
|
|
45
|
-
"@xylabs/promise": "~5.0.
|
|
46
|
-
"@xylabs/telemetry": "~5.0.
|
|
47
|
-
"@xylabs/typeof": "~5.0.
|
|
41
|
+
"@xylabs/assert": "~5.0.78",
|
|
42
|
+
"@xylabs/base": "~5.0.78",
|
|
43
|
+
"@xylabs/events": "~5.0.78",
|
|
44
|
+
"@xylabs/logger": "~5.0.78",
|
|
45
|
+
"@xylabs/promise": "~5.0.78",
|
|
46
|
+
"@xylabs/telemetry": "~5.0.78",
|
|
47
|
+
"@xylabs/typeof": "~5.0.78",
|
|
48
48
|
"async-mutex": "~0.5.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@opentelemetry/api": "^1.9.0",
|
|
52
51
|
"@xylabs/ts-scripts-yarn3": "~7.3.2",
|
|
53
52
|
"@xylabs/tsconfig": "~7.3.2",
|
|
54
53
|
"tslib": "~2.8.1",
|
|
55
54
|
"typescript": "~5.9.3",
|
|
56
|
-
"vitest": "~4.0.18"
|
|
57
|
-
"zod": "^4.3.6"
|
|
58
|
-
},
|
|
59
|
-
"peerDependencies": {
|
|
60
|
-
"@opentelemetry/api": "^1",
|
|
61
|
-
"zod": "^4"
|
|
55
|
+
"vitest": "~4.0.18"
|
|
62
56
|
},
|
|
63
57
|
"publishConfig": {
|
|
64
58
|
"access": "public"
|
package/src/AbstractCreatable.ts
CHANGED
|
@@ -17,9 +17,8 @@ import {
|
|
|
17
17
|
} from './Creatable.ts'
|
|
18
18
|
import { Factory } from './Factory.ts'
|
|
19
19
|
import { getFunctionName, getRootFunction } from './lib/index.ts'
|
|
20
|
-
import { CreatableName } from './model/CreatableName.ts'
|
|
21
20
|
import type {
|
|
22
|
-
CreatableInstance, CreatableParams,
|
|
21
|
+
CreatableInstance, CreatableName, CreatableParams,
|
|
23
22
|
CreatableStatus,
|
|
24
23
|
Labels,
|
|
25
24
|
RequiredCreatableParams,
|
|
@@ -28,7 +27,6 @@ import type {
|
|
|
28
27
|
const AbstractCreatableConstructorKey = Symbol.for('AbstractCreatableConstructor')
|
|
29
28
|
const CREATABLE_NOT_STARTED = 'Creatable not Started' as const
|
|
30
29
|
|
|
31
|
-
/** @deprecated use AbstractCreatableV2 instead */
|
|
32
30
|
@creatable()
|
|
33
31
|
export class AbstractCreatable<TParams extends CreatableParams = CreatableParams,
|
|
34
32
|
TEventData extends EventData = EventData> extends BaseEmitter<Partial<TParams & RequiredCreatableParams>, TEventData> {
|
package/src/Creatable.ts
CHANGED
|
@@ -7,7 +7,6 @@ import type {
|
|
|
7
7
|
RequiredCreatableParams,
|
|
8
8
|
} from './model/index.ts'
|
|
9
9
|
|
|
10
|
-
/** @deprecated use CreatableFactoryV2 instead */
|
|
11
10
|
export interface CreatableFactory<T extends CreatableInstance = CreatableInstance>
|
|
12
11
|
extends Omit<Creatable<T>, 'create' | 'createHandler' | 'paramsHandler' | 'defaultLogger' | 'factory'> {
|
|
13
12
|
|
|
@@ -16,7 +15,6 @@ export interface CreatableFactory<T extends CreatableInstance = CreatableInstanc
|
|
|
16
15
|
params?: Partial<T['params']>): Promise<T>
|
|
17
16
|
}
|
|
18
17
|
|
|
19
|
-
/** @deprecated use CreatableV2 instead */
|
|
20
18
|
export interface Creatable<T extends CreatableInstance = CreatableInstance> {
|
|
21
19
|
|
|
22
20
|
defaultLogger?: Logger
|
|
@@ -36,7 +34,6 @@ export interface Creatable<T extends CreatableInstance = CreatableInstance> {
|
|
|
36
34
|
this: Creatable<T>, params?: Partial<T['params']>): Promisable<T['params'] & RequiredCreatableParams>
|
|
37
35
|
}
|
|
38
36
|
|
|
39
|
-
/** @deprecated use CreatableWithFactoryV2 instead */
|
|
40
37
|
export interface CreatableWithFactory<T extends CreatableInstance = CreatableInstance> extends Creatable<T> {
|
|
41
38
|
factory<T extends CreatableInstance>(
|
|
42
39
|
this: Creatable<T>,
|
|
@@ -50,7 +47,6 @@ export interface CreatableWithFactory<T extends CreatableInstance = CreatableIns
|
|
|
50
47
|
* @returns The decorated Module requiring it implement the members
|
|
51
48
|
* of the CreatableModule as statics properties/methods
|
|
52
49
|
*/
|
|
53
|
-
/** @deprecated use creatableV2 instead */
|
|
54
50
|
export function creatable<T extends CreatableInstance>() {
|
|
55
51
|
return <U extends Creatable<T>>(constructor: U) => {
|
|
56
52
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
@@ -65,7 +61,6 @@ export function creatable<T extends CreatableInstance>() {
|
|
|
65
61
|
* of the CreatableModule as statics properties/methods
|
|
66
62
|
*/
|
|
67
63
|
|
|
68
|
-
/** @deprecated use creatableFactoryV2 instead */
|
|
69
64
|
export function creatableFactory() {
|
|
70
65
|
return <U extends CreatableFactory>(constructor: U) => {
|
|
71
66
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { EventData, EventEmitter } from '@xylabs/events'
|
|
2
2
|
|
|
3
|
-
import type { CreatableName } from './
|
|
4
|
-
import type { CreatableParams } from './CreatableParams.ts'
|
|
3
|
+
import type { CreatableName, CreatableParams } from './CreatableParams.ts'
|
|
5
4
|
|
|
6
5
|
export interface CreatableInstance<TParams extends CreatableParams = CreatableParams,
|
|
7
6
|
TEventData extends EventData = EventData> extends EventEmitter<TEventData> {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import type { BaseClassName } from '@xylabs/base'
|
|
1
2
|
import type { BaseEmitterParams } from '@xylabs/events'
|
|
2
3
|
|
|
3
|
-
import type { CreatableName } from './CreatableName.ts'
|
|
4
4
|
import type { CreatableStatus, CreatableStatusReporter } from './CreatableStatusReporter.ts'
|
|
5
5
|
|
|
6
|
+
export type CreatableName = Exclude<string, 'creatable-name-reserved-32546239486'> & BaseClassName
|
|
7
|
+
|
|
6
8
|
export interface RequiredCreatableParams<TAdditionalStatus extends CreatableStatus | void = void> extends BaseEmitterParams {
|
|
7
9
|
name?: CreatableName
|
|
8
10
|
statusReporter?: CreatableStatusReporter<TAdditionalStatus>
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BaseClassName } from '@xylabs/base'
|
|
2
2
|
|
|
3
|
-
/** @deprecated use CreatableStatusReporterV2 instead */
|
|
4
3
|
export type StandardCreatableStatus = 'creating' | 'created' | 'starting' | 'started' | 'stopping' | 'stopped' | 'error'
|
|
5
|
-
|
|
6
|
-
/** @deprecated use CreatableStatusReporterV2 instead */
|
|
7
4
|
export type CreatableStatus<TAdditionalStatus extends void | string = void>
|
|
8
5
|
= StandardCreatableStatus | (TAdditionalStatus extends void ? StandardCreatableStatus : TAdditionalStatus)
|
|
9
6
|
|
|
10
|
-
/** @deprecated use CreatableStatusReporterV2 instead */
|
|
11
7
|
export interface CreatableStatusReporter<TAdditionalStatus extends void | string = void> {
|
|
12
|
-
report(name:
|
|
13
|
-
report(name:
|
|
14
|
-
report(name:
|
|
8
|
+
report(name: BaseClassName, status: Exclude<CreatableStatus<TAdditionalStatus>, 'error'>, progress: number): void
|
|
9
|
+
report(name: BaseClassName, status: Extract<CreatableStatus<TAdditionalStatus>, 'error'>, error: Error): void
|
|
10
|
+
report(name: BaseClassName, status: CreatableStatus<TAdditionalStatus>): void
|
|
15
11
|
}
|
package/src/model/index.ts
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
export * from './CreatableInstance.ts'
|
|
2
|
-
export * from './CreatableInstanceV2.ts'
|
|
3
|
-
export * from './CreatableName.ts'
|
|
4
2
|
export * from './CreatableParams.ts'
|
|
5
|
-
export * from './CreatableParamsV2.ts'
|
|
6
3
|
export * from './CreatableStatusReporter.ts'
|
|
7
|
-
export * from './CreatableStatusReporter.zod.ts'
|
|
8
|
-
export * from './CreatableStatusReporterV2.ts'
|
|
9
4
|
export * from './Labels.ts'
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import type { EventData } from '@xylabs/events';
|
|
2
|
-
import { BaseEmitterV2 } from '@xylabs/events';
|
|
3
|
-
import { type Logger } from '@xylabs/logger';
|
|
4
|
-
import type { Promisable } from '@xylabs/promise';
|
|
5
|
-
import type { SpanConfig } from '@xylabs/telemetry';
|
|
6
|
-
import type { CreatableFactoryV2, CreatableV2 } from './CreatableV2.ts';
|
|
7
|
-
import type { CreatableInstanceV2, CreatableName, CreatableParamsV2, CreatableStatusV2, Labels } from './model/index.ts';
|
|
8
|
-
export declare abstract class AbstractCreatableV2<TParams extends CreatableParamsV2 = CreatableParamsV2, TEventData extends EventData = EventData> extends BaseEmitterV2<TParams, TEventData> implements CreatableInstanceV2<TParams, TEventData> {
|
|
9
|
-
defaultLogger?: Logger;
|
|
10
|
-
protected _startPromise: Promisable<boolean> | undefined;
|
|
11
|
-
private _status;
|
|
12
|
-
private _statusMutex;
|
|
13
|
-
private _validatedParams?;
|
|
14
|
-
constructor(key: unknown, params: TParams);
|
|
15
|
-
get context(): TParams['context'];
|
|
16
|
-
get name(): CreatableName;
|
|
17
|
-
get params(): TParams;
|
|
18
|
-
get startable(): boolean;
|
|
19
|
-
get status(): CreatableStatusV2 | null;
|
|
20
|
-
get statusReporter(): {
|
|
21
|
-
report: import("zod/v4/core").$InferOuterFunctionType<import("zod").ZodUnion<readonly [import("zod").ZodTuple<[import("zod").ZodString, import("zod").ZodEnum<{
|
|
22
|
-
creating: "creating";
|
|
23
|
-
created: "created";
|
|
24
|
-
starting: "starting";
|
|
25
|
-
started: "started";
|
|
26
|
-
stopping: "stopping";
|
|
27
|
-
stopped: "stopped";
|
|
28
|
-
}>, import("zod").ZodOptional<import("zod").ZodNumber>], null>, import("zod").ZodTuple<[import("zod").ZodString, import("zod").ZodEnum<{
|
|
29
|
-
error: "error";
|
|
30
|
-
}>, import("zod").ZodCustom<Error, Error>], null>, import("zod").ZodTuple<[import("zod").ZodString, import("zod").ZodUnion<readonly [import("zod").ZodEnum<{
|
|
31
|
-
creating: "creating";
|
|
32
|
-
created: "created";
|
|
33
|
-
starting: "starting";
|
|
34
|
-
started: "started";
|
|
35
|
-
stopping: "stopping";
|
|
36
|
-
stopped: "stopped";
|
|
37
|
-
}>, import("zod").ZodEnum<{
|
|
38
|
-
error: "error";
|
|
39
|
-
}>]>], null>]>, import("zod").ZodVoid>;
|
|
40
|
-
} | undefined;
|
|
41
|
-
abstract get className(): CreatableName;
|
|
42
|
-
static create<T extends CreatableInstanceV2>(this: CreatableV2<T>, inParams: T['params']): Promise<T>;
|
|
43
|
-
static createHandler<T extends CreatableInstanceV2>(this: CreatableV2<T>, instance: T): Promisable<T>;
|
|
44
|
-
static paramsHandler<T extends CreatableInstanceV2>(this: CreatableV2<T>, params?: Partial<T['params']>): Promisable<T['params']>;
|
|
45
|
-
createHandler(): Promisable<void>;
|
|
46
|
-
paramsValidator(params: Partial<TParams>): TParams;
|
|
47
|
-
span<T>(name: string, fn: () => T): T;
|
|
48
|
-
spanAsync<T>(name: string, fn: () => Promise<T>, config?: SpanConfig): Promise<T>;
|
|
49
|
-
start(): Promise<boolean>;
|
|
50
|
-
started(notStartedAction?: 'error' | 'throw' | 'warn' | 'log' | 'none'): boolean;
|
|
51
|
-
startedAsync(notStartedAction?: 'error' | 'throw' | 'warn' | 'log' | 'none', tryStart?: boolean): Promise<boolean>;
|
|
52
|
-
stop(): Promise<boolean>;
|
|
53
|
-
protected _noOverride(functionName?: string): void;
|
|
54
|
-
protected setStatus(value: Exclude<CreatableStatusV2, 'error'>, progress?: number): void;
|
|
55
|
-
protected setStatus(value: Extract<CreatableStatusV2, 'error'>, error?: Error): void;
|
|
56
|
-
protected startHandler(): Promisable<void>;
|
|
57
|
-
protected stopHandler(): Promisable<void>;
|
|
58
|
-
}
|
|
59
|
-
export declare abstract class AbstractCreatableWithFactoryV2<TParams extends CreatableParamsV2 = CreatableParamsV2, TEventData extends EventData = EventData> extends AbstractCreatableV2<TParams, TEventData> {
|
|
60
|
-
static factory<T extends CreatableInstanceV2>(this: CreatableV2<T>, params: T['params'], labels?: Labels): CreatableFactoryV2<T>;
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=AbstractCreatableV2.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractCreatableV2.d.ts","sourceRoot":"","sources":["../../src/AbstractCreatableV2.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,KAAK,EAAE,UAAU,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C,EAAE,KAAK,GAAG,IAAI;IAmBpF,SAAS,CAAC,YAAY,IAAI,UAAU,CAAC,IAAI,CAAC;IAI1C,SAAS,CAAC,WAAW,IAAI,UAAU,CAAC,IAAI,CAAC;CAG1C;AAED,8BAAsB,8BAA8B,CAAC,OAAO,SAAS,iBAAiB,GAAG,iBAAiB,EACxG,UAAU,SAAS,SAAS,GAAG,SAAS,CAAE,SAAQ,mBAAmB,CAAC,OAAO,EAAE,UAAU,CAAC;IAC1F,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,mBAAmB,EAC1C,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,EACpB,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,EACnB,MAAM,CAAC,EAAE,MAAM,GACd,kBAAkB,CAAC,CAAC,CAAC;CAGzB"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { Logger } from '@xylabs/logger';
|
|
2
|
-
import type { Promisable } from '@xylabs/promise';
|
|
3
|
-
import type { CreatableInstanceV2, CreatableParamsV2, Labels } from './model/index.ts';
|
|
4
|
-
export interface CreatableFactoryV2<T extends CreatableInstanceV2 = CreatableInstanceV2> extends Omit<CreatableV2<T>, 'create' | 'createHandler' | 'paramsHandler' | 'defaultLogger' | 'factory'> {
|
|
5
|
-
create(this: CreatableFactoryV2<T>, params: T['params']): Promise<T>;
|
|
6
|
-
}
|
|
7
|
-
export interface CreatableV2<T extends CreatableInstanceV2 = CreatableInstanceV2> {
|
|
8
|
-
defaultLogger?: Logger;
|
|
9
|
-
new (key: unknown, params: CreatableParamsV2): T;
|
|
10
|
-
create<T extends CreatableInstanceV2>(this: CreatableV2<T>, params: T['params']): Promise<T>;
|
|
11
|
-
createHandler<T extends CreatableInstanceV2>(this: CreatableV2<T>, instance: T): Promisable<T>;
|
|
12
|
-
paramsHandler<T extends CreatableInstanceV2>(this: CreatableV2<T>, params: Partial<T['params']>): Promisable<T['params']>;
|
|
13
|
-
}
|
|
14
|
-
export interface CreatableWithFactoryV2<T extends CreatableInstanceV2 = CreatableInstanceV2> extends CreatableV2<T> {
|
|
15
|
-
factory<T extends CreatableInstanceV2>(this: CreatableV2<T>, params: T['params'], labels?: Labels): CreatableFactoryV2<T>;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Class annotation to be used to decorate Modules which support
|
|
19
|
-
* an asynchronous creation pattern
|
|
20
|
-
* @returns The decorated Module requiring it implement the members
|
|
21
|
-
* of the CreatableModule as statics properties/methods
|
|
22
|
-
*/
|
|
23
|
-
export declare function creatableV2<T extends CreatableInstanceV2>(): <U extends CreatableV2<T>>(constructor: U) => void;
|
|
24
|
-
/**
|
|
25
|
-
* Class annotation to be used to decorate Modules which support
|
|
26
|
-
* an asynchronous creation factory pattern
|
|
27
|
-
* @returns The decorated Module requiring it implement the members
|
|
28
|
-
* of the CreatableModule as statics properties/methods
|
|
29
|
-
*/
|
|
30
|
-
export declare function creatableFactoryV2(): <U extends CreatableFactoryV2>(constructor: U) => void;
|
|
31
|
-
//# sourceMappingURL=CreatableV2.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CreatableV2.d.ts","sourceRoot":"","sources":["../../src/CreatableV2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,KAAK,EACV,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,EAC/C,MAAM,kBAAkB,CAAA;AAEzB,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,mBAAmB,GAAG,mBAAmB,CACrF,SAAQ,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,QAAQ,GAAG,eAAe,GAAG,eAAe,GAAG,eAAe,GAAG,SAAS,CAAC;IAExG,MAAM,CACJ,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC,EAC3B,MAAM,EAAE,CA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,SAAS,kBAAkB,EAAE,aAAa,CAAC,UAIrD"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { CreatableFactoryV2, CreatableV2 } from './CreatableV2.ts';
|
|
2
|
-
import type { CreatableInstanceV2, Labels } from './model/index.ts';
|
|
3
|
-
export declare class FactoryV2<T extends CreatableInstanceV2 = CreatableInstanceV2> implements CreatableFactoryV2<T> {
|
|
4
|
-
creatable: CreatableV2<T>;
|
|
5
|
-
defaultParams?: Partial<T['params']>;
|
|
6
|
-
labels?: Labels;
|
|
7
|
-
constructor(creatable: CreatableV2<T>, params: T['params'], labels?: Labels);
|
|
8
|
-
static withParams<T extends CreatableInstanceV2>(creatableModule: CreatableV2<T>, params: T['params'], labels?: Labels): FactoryV2<T>;
|
|
9
|
-
create(params: Partial<T['params']>): Promise<T>;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=FactoryV2.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FactoryV2.d.ts","sourceRoot":"","sources":["../../src/FactoryV2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACvE,OAAO,KAAK,EACV,mBAAmB,EAAE,MAAM,EAC5B,MAAM,kBAAkB,CAAA;AAEzB,qBAAa,SAAS,CAAC,CAAC,SAAS,mBAAmB,GAAG,mBAAmB,CAAE,YAAW,kBAAkB,CAAC,CAAC,CAAC;IAC1G,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,CAAA;IAEzB,aAAa,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAA;IAEpC,MAAM,CAAC,EAAE,MAAM,CAAA;gBAGb,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,EACzB,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,EACnB,MAAM,GAAE,MAAW;IAOrB,MAAM,CAAC,UAAU,CAAC,CAAC,SAAS,mBAAmB,EAC7C,eAAe,EAAE,WAAW,CAAC,CAAC,CAAC,EAC/B,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,EACnB,MAAM,GAAE,MAAW;IAKrB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;CAOjD"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { EventData, EventEmitter } from '@xylabs/events';
|
|
2
|
-
import type { Promisable } from '@xylabs/promise';
|
|
3
|
-
import type { CreatableName } from './CreatableName.ts';
|
|
4
|
-
import type { CreatableParamsV2 } from './CreatableParamsV2.ts';
|
|
5
|
-
export interface CreatableInstanceV2<TParams extends CreatableParamsV2 = CreatableParamsV2, TEventData extends EventData = EventData> extends EventEmitter<TEventData> {
|
|
6
|
-
createHandler: () => Promisable<void>;
|
|
7
|
-
eventData: TEventData;
|
|
8
|
-
name: CreatableName;
|
|
9
|
-
params: TParams;
|
|
10
|
-
start: () => Promise<boolean>;
|
|
11
|
-
stop: () => Promise<boolean>;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=CreatableInstanceV2.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CreatableInstanceV2.d.ts","sourceRoot":"","sources":["../../../src/model/CreatableInstanceV2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE/D,MAAM,WAAW,mBAAmB,CAAC,OAAO,SAAS,iBAAiB,GAAG,iBAAiB,EACxF,UAAU,SAAS,SAAS,GAAG,SAAS,CAAE,SAAQ,YAAY,CAAC,UAAU,CAAC;IAC1E,aAAa,EAAE,MAAM,UAAU,CAAC,IAAI,CAAC,CAAA;IACrC,SAAS,EAAE,UAAU,CAAA;IACrB,IAAI,EAAE,aAAa,CAAA;IACnB,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;IAC7B,IAAI,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;CAC7B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CreatableName.d.ts","sourceRoot":"","sources":["../../../src/model/CreatableName.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAEjD,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG;IAAE,eAAe,EAAE,IAAI,CAAA;CAAE,CAAA"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import z from 'zod';
|
|
2
|
-
export declare const CreatableContextZod: z.ZodObject<{
|
|
3
|
-
logger: z.ZodOptional<z.ZodCustom<import("@xylabs/logger").Logger, import("@xylabs/logger").Logger>>;
|
|
4
|
-
meterProvider: z.ZodOptional<z.ZodCustom<import("@opentelemetry/api").MeterProvider, import("@opentelemetry/api").MeterProvider>>;
|
|
5
|
-
singletons: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
6
|
-
timeBudgetLimit: z.ZodOptional<z.ZodNumber>;
|
|
7
|
-
traceProvider: z.ZodOptional<z.ZodCustom<import("@opentelemetry/api").TracerProvider, import("@opentelemetry/api").TracerProvider>>;
|
|
8
|
-
statusReporter: z.ZodOptional<z.ZodObject<{
|
|
9
|
-
report: z.ZodUnion<readonly [z.ZodFunction<z.ZodUnion<readonly [z.ZodTuple<[z.ZodString, z.ZodEnum<{
|
|
10
|
-
creating: "creating";
|
|
11
|
-
created: "created";
|
|
12
|
-
starting: "starting";
|
|
13
|
-
started: "started";
|
|
14
|
-
stopping: "stopping";
|
|
15
|
-
stopped: "stopped";
|
|
16
|
-
}>, z.ZodOptional<z.ZodNumber>], null>, z.ZodTuple<[z.ZodString, z.ZodEnum<{
|
|
17
|
-
error: "error";
|
|
18
|
-
}>, z.ZodCustom<Error, Error>], null>, z.ZodTuple<[z.ZodString, z.ZodUnion<readonly [z.ZodEnum<{
|
|
19
|
-
creating: "creating";
|
|
20
|
-
created: "created";
|
|
21
|
-
starting: "starting";
|
|
22
|
-
started: "started";
|
|
23
|
-
stopping: "stopping";
|
|
24
|
-
stopped: "stopped";
|
|
25
|
-
}>, z.ZodEnum<{
|
|
26
|
-
error: "error";
|
|
27
|
-
}>]>], null>]>, z.ZodVoid>]>;
|
|
28
|
-
}, z.z.core.$strip>>;
|
|
29
|
-
}, z.z.core.$strip>;
|
|
30
|
-
export declare const CreatableParamsV2Zod: z.ZodObject<{
|
|
31
|
-
context: z.ZodObject<{
|
|
32
|
-
logger: z.ZodOptional<z.ZodCustom<import("@xylabs/logger").Logger, import("@xylabs/logger").Logger>>;
|
|
33
|
-
meterProvider: z.ZodOptional<z.ZodCustom<import("@opentelemetry/api").MeterProvider, import("@opentelemetry/api").MeterProvider>>;
|
|
34
|
-
singletons: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
35
|
-
timeBudgetLimit: z.ZodOptional<z.ZodNumber>;
|
|
36
|
-
traceProvider: z.ZodOptional<z.ZodCustom<import("@opentelemetry/api").TracerProvider, import("@opentelemetry/api").TracerProvider>>;
|
|
37
|
-
statusReporter: z.ZodOptional<z.ZodObject<{
|
|
38
|
-
report: z.ZodUnion<readonly [z.ZodFunction<z.ZodUnion<readonly [z.ZodTuple<[z.ZodString, z.ZodEnum<{
|
|
39
|
-
creating: "creating";
|
|
40
|
-
created: "created";
|
|
41
|
-
starting: "starting";
|
|
42
|
-
started: "started";
|
|
43
|
-
stopping: "stopping";
|
|
44
|
-
stopped: "stopped";
|
|
45
|
-
}>, z.ZodOptional<z.ZodNumber>], null>, z.ZodTuple<[z.ZodString, z.ZodEnum<{
|
|
46
|
-
error: "error";
|
|
47
|
-
}>, z.ZodCustom<Error, Error>], null>, z.ZodTuple<[z.ZodString, z.ZodUnion<readonly [z.ZodEnum<{
|
|
48
|
-
creating: "creating";
|
|
49
|
-
created: "created";
|
|
50
|
-
starting: "starting";
|
|
51
|
-
started: "started";
|
|
52
|
-
stopping: "stopping";
|
|
53
|
-
stopped: "stopped";
|
|
54
|
-
}>, z.ZodEnum<{
|
|
55
|
-
error: "error";
|
|
56
|
-
}>]>], null>]>, z.ZodVoid>]>;
|
|
57
|
-
}, z.z.core.$strip>>;
|
|
58
|
-
}, z.z.core.$strip>;
|
|
59
|
-
name: z.ZodString;
|
|
60
|
-
}, z.z.core.$strip>;
|
|
61
|
-
export type CreatableParamsV2 = z.infer<typeof CreatableParamsV2Zod>;
|
|
62
|
-
//# sourceMappingURL=CreatableParamsV2.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CreatableParamsV2.d.ts","sourceRoot":"","sources":["../../../src/model/CreatableParamsV2.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,KAAK,CAAA;AAInB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAqF,CAAA;AAErH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAoF,CAAA;AAErH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const CreatableStatusSuccessZod: z.ZodEnum<{
|
|
3
|
-
creating: "creating";
|
|
4
|
-
created: "created";
|
|
5
|
-
starting: "starting";
|
|
6
|
-
started: "started";
|
|
7
|
-
stopping: "stopping";
|
|
8
|
-
stopped: "stopped";
|
|
9
|
-
}>;
|
|
10
|
-
export declare const CreatableStatusErrorZod: z.ZodEnum<{
|
|
11
|
-
error: "error";
|
|
12
|
-
}>;
|
|
13
|
-
export declare const CreatableStatusZod: z.ZodUnion<readonly [z.ZodEnum<{
|
|
14
|
-
creating: "creating";
|
|
15
|
-
created: "created";
|
|
16
|
-
starting: "starting";
|
|
17
|
-
started: "started";
|
|
18
|
-
stopping: "stopping";
|
|
19
|
-
stopped: "stopped";
|
|
20
|
-
}>, z.ZodEnum<{
|
|
21
|
-
error: "error";
|
|
22
|
-
}>]>;
|
|
23
|
-
export declare const CreatableStatusReporterV2Zod: z.ZodObject<{
|
|
24
|
-
report: z.ZodUnion<readonly [z.ZodFunction<z.ZodUnion<readonly [z.ZodTuple<[z.ZodString, z.ZodEnum<{
|
|
25
|
-
creating: "creating";
|
|
26
|
-
created: "created";
|
|
27
|
-
starting: "starting";
|
|
28
|
-
started: "started";
|
|
29
|
-
stopping: "stopping";
|
|
30
|
-
stopped: "stopped";
|
|
31
|
-
}>, z.ZodOptional<z.ZodNumber>], null>, z.ZodTuple<[z.ZodString, z.ZodEnum<{
|
|
32
|
-
error: "error";
|
|
33
|
-
}>, z.ZodCustom<Error, Error>], null>, z.ZodTuple<[z.ZodString, z.ZodUnion<readonly [z.ZodEnum<{
|
|
34
|
-
creating: "creating";
|
|
35
|
-
created: "created";
|
|
36
|
-
starting: "starting";
|
|
37
|
-
started: "started";
|
|
38
|
-
stopping: "stopping";
|
|
39
|
-
stopped: "stopped";
|
|
40
|
-
}>, z.ZodEnum<{
|
|
41
|
-
error: "error";
|
|
42
|
-
}>]>], null>]>, z.ZodVoid>]>;
|
|
43
|
-
}, z.core.$strip>;
|
|
44
|
-
//# sourceMappingURL=CreatableStatusReporter.zod.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CreatableStatusReporter.zod.d.ts","sourceRoot":"","sources":["../../../src/model/CreatableStatusReporter.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,yBAAyB;;;;;;;EAAgF,CAAA;AAEtH,eAAO,MAAM,uBAAuB;;EAAoB,CAAA;AAExD,eAAO,MAAM,kBAAkB;;;;;;;;;IAAgE,CAAA;AAE/F,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;iBAsBvC,CAAA"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type z from 'zod';
|
|
2
|
-
import type { CreatableStatusReporterV2Zod, CreatableStatusSuccessZod, CreatableStatusZod } from './CreatableStatusReporter.zod.ts';
|
|
3
|
-
export type CreatableStatusSuccessV2 = z.infer<typeof CreatableStatusSuccessZod>;
|
|
4
|
-
export type CreatableStatusErrorV2 = Extract<CreatableStatusV2, 'error'>;
|
|
5
|
-
export type CreatableStatusV2 = z.infer<typeof CreatableStatusZod>;
|
|
6
|
-
export type CreatableStatusReporterV2 = z.infer<typeof CreatableStatusReporterV2Zod>;
|
|
7
|
-
//# sourceMappingURL=CreatableStatusReporterV2.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CreatableStatusReporterV2.d.ts","sourceRoot":"","sources":["../../../src/model/CreatableStatusReporterV2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,OAAO,KAAK,EACV,4BAA4B,EAAE,yBAAyB,EAAE,kBAAkB,EAC5E,MAAM,kCAAkC,CAAA;AAEzC,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAChF,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAA;AACxE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAElE,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA"}
|