@kosdev-code/kos-ui-sdk 3.0.35 → 3.0.37
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/core/core/model/kos-subscription-manager.d.ts.map +1 -1
- package/core/core/transport/mock/future-simulator.d.ts +5 -1
- package/core/core/transport/mock/future-simulator.d.ts.map +1 -1
- package/core/core/transport/mock/mock-config.d.ts.map +1 -1
- package/core/core/transport/mock/mock-interceptor.d.ts.map +1 -1
- package/core/core/transport/mock/mock-registry.d.ts +14 -5
- package/core/core/transport/mock/mock-registry.d.ts.map +1 -1
- package/core/core/transport/mock/mock-types.d.ts +63 -0
- package/core/core/transport/mock/mock-types.d.ts.map +1 -1
- package/core/util/index.d.ts +2 -0
- package/core/util/index.d.ts.map +1 -1
- package/core/util/kos-local-topic.d.ts +73 -0
- package/core/util/kos-local-topic.d.ts.map +1 -0
- package/core/util/kos-topic-client.d.ts +79 -0
- package/core/util/kos-topic-client.d.ts.map +1 -0
- package/index.cjs +77 -7
- package/index.cjs.map +1 -1
- package/index.js +286 -216
- package/index.js.map +1 -1
- package/models/models/storage-device/storage-device-container-model.d.ts +4 -3
- package/models/models/storage-device/storage-device-container-model.d.ts.map +1 -1
- package/models/utils/index.d.ts +1 -0
- package/models/utils/index.d.ts.map +1 -1
- package/models/utils/topics/kos/daily/topic.d.ts +74 -0
- package/models/utils/topics/kos/daily/topic.d.ts.map +1 -0
- package/models/utils/topics/kos/daily/topics.d.ts +1026 -0
- package/models/utils/topics-index.d.ts +8 -0
- package/models/utils/topics-index.d.ts.map +1 -0
- package/package.json +2 -2
- package/{software-info-registration-Co9Wq_-n.js → software-info-registration-BqhJP3ww.js} +457 -328
- package/software-info-registration-BqhJP3ww.js.map +1 -0
- package/{software-info-registration-C-fplY8u.cjs → software-info-registration-DTbgaSeR.cjs} +156 -27
- package/software-info-registration-DTbgaSeR.cjs.map +1 -0
- package/testing.cjs +1 -1
- package/testing.js +1 -1
- package/software-info-registration-C-fplY8u.cjs.map +0 -1
- package/software-info-registration-Co9Wq_-n.js.map +0 -1
|
@@ -7,8 +7,9 @@ import { StorageDeviceContainerOptions } from './types';
|
|
|
7
7
|
export declare const MODEL_TYPE = "storage-device-container-model";
|
|
8
8
|
export declare const TOPIC_STORAGE_AVAILABILITY = "/kos/storage";
|
|
9
9
|
/**
|
|
10
|
-
* Holds a {@link StorageDeviceModel} for each storage device (partition)
|
|
11
|
-
* device reports
|
|
10
|
+
* Holds a {@link StorageDeviceModel} for each inserted storage device (partition)
|
|
11
|
+
* the device reports; the node's own `local` devices are left out. The
|
|
12
|
+
* container loads the devices on load and reconciles them
|
|
12
13
|
* on each `/kos/storage` topic: models for devices missing from the payload are
|
|
13
14
|
* removed, existing ones are updated in place and new ones are added.
|
|
14
15
|
*
|
|
@@ -45,7 +46,7 @@ export declare class StorageDeviceContainerModelImpl implements IKosIdentifiable
|
|
|
45
46
|
init(): Promise<void>;
|
|
46
47
|
get isStorageInserted(): boolean;
|
|
47
48
|
get volumes(): StorageDeviceModel[];
|
|
48
|
-
handleStorageAvailability(
|
|
49
|
+
handleStorageAvailability(payload: StorageDeviceResponse[]): void;
|
|
49
50
|
load(): Promise<void>;
|
|
50
51
|
}
|
|
51
52
|
//# sourceMappingURL=storage-device-container-model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage-device-container-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/storage-device/storage-device-container-model.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EAIpB,KAAK,oBAAoB,EAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,kBAAkB,EACxB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAqB,KAAK,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,KAAK,EACV,6BAA6B,EAE9B,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,UAAU,mCAAmC,CAAC;AAE3D,eAAO,MAAM,0BAA0B,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"storage-device-container-model.d.ts","sourceRoot":"","sources":["../../../../../../packages/kos-ui-sdk/src/models/models/storage-device/storage-device-container-model.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EAIpB,KAAK,oBAAoB,EAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,kBAAkB,EACxB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAqB,KAAK,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,KAAK,EACV,6BAA6B,EAE9B,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,UAAU,mCAAmC,CAAC;AAE3D,eAAO,MAAM,0BAA0B,iBAAiB,CAAC;AAKzD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,sBAAsB,GAChC,oBAAoB,CAAC,+BAA+B,CAAC,CAAC;AAExD,MAAM,MAAM,2BAA2B,GACrC,oBAAoB,CAAC,+BAA+B,CAAC,CAAC;AAExD;;;GAGG;AACH,qBACa,+BACX,YACE,gBAAgB,EAChB,eAAe,CAAC,kBAAkB,CAAC,EACnC,aAAa;IAEf,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,MAAM,CAAmB;IACvB,OAAO,CAAC,OAAO,CAAyC;gBAEhE,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,6BAA6B,EACtC,OAAO,EAAE,kBAAkB;IAY7B,QAAQ,CAAC,EAAE,EAAE,MAAM;IAGnB,IAAI,MAAM,2CAET;IACD,IAAI,IAAI,yBAEP;IAED,QAAQ,CAAC,KAAK,EAAE,kBAAkB;IAIlC,WAAW,CAAC,EAAE,EAAE,MAAM;IAKhB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAK3B,IAAI,iBAAiB,YAEpB;IAED,IAAI,OAAO,yBAEV;IAMD,yBAAyB,CAAC,OAAO,EAAE,qBAAqB,EAAE;IA8BpD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAiB5B"}
|
package/models/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/models/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/kos-ui-sdk/src/models/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { IKosTopicHandlerParams } from '../../../../../core/core/decorators/kosTopicHandler';
|
|
2
|
+
import { ClientResponse } from '../../../../../core/util/kos-service-request';
|
|
3
|
+
import { paths } from './topics';
|
|
4
|
+
/**
|
|
5
|
+
* Type aliases for the topics kos declares
|
|
6
|
+
*/
|
|
7
|
+
export type Topics = paths;
|
|
8
|
+
export type TopicPath = keyof paths;
|
|
9
|
+
/** Names of the `{variable}` segments of a declared topic. */
|
|
10
|
+
export type TopicVars<Path extends TopicPath> = paths[Path]["get"] extends {
|
|
11
|
+
parameters: {
|
|
12
|
+
path: infer Vars;
|
|
13
|
+
};
|
|
14
|
+
} ? keyof Vars & string : never;
|
|
15
|
+
type TopicVarArgs<Path extends TopicPath> = [TopicVars<Path>] extends [never] ? [] : [vars: Record<TopicVars<Path>, string>];
|
|
16
|
+
/**
|
|
17
|
+
* One declared topic of kos: the declaration it is typed by and the
|
|
18
|
+
* topic string a model subscribes to.
|
|
19
|
+
*/
|
|
20
|
+
export interface Topic<Path extends TopicPath = TopicPath> {
|
|
21
|
+
/** The topic as declared, with its `{variable}` segments. */
|
|
22
|
+
readonly path: Path;
|
|
23
|
+
/** The topic to subscribe to: `path` with its variables filled in. */
|
|
24
|
+
readonly topic: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Declare a topic once. The handler config and the payload type are both
|
|
28
|
+
* derived from the result, so the topic string is written in one place.
|
|
29
|
+
*
|
|
30
|
+
* A topic with `{variable}` segments takes a value for each: a literal, a
|
|
31
|
+
* model placeholder (`"{MODEL_ID}"`, a `createPropKey`) or `"*"`.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* export const BoardTopics = {
|
|
36
|
+
* linked: topic("/kos/hardware/board/linked"),
|
|
37
|
+
* state: topic("/kos/state/{handlePath}", { handlePath: "{MODEL_ID}" }),
|
|
38
|
+
* } as const;
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function topic<Path extends TopicPath>(path: Path, ...vars: TopicVarArgs<Path>): Topic<Path>;
|
|
42
|
+
/**
|
|
43
|
+
* Message body type for a declared topic. `unknown` when the declaration
|
|
44
|
+
* names no message type: type the handler parameter by hand in that case.
|
|
45
|
+
*/
|
|
46
|
+
export type TopicPayload<T extends Topic> = ClientResponse<paths, T["path"], "get">;
|
|
47
|
+
/**
|
|
48
|
+
* @kosTopicHandler preconfigured from a declared topic and subscribed over the
|
|
49
|
+
* websocket. Pass overrides (lifecycle, transform, condition, …) as the second
|
|
50
|
+
* argument.
|
|
51
|
+
*
|
|
52
|
+
* A `transform` narrows what the model receives: its return type becomes the
|
|
53
|
+
* handler's payload type, so the raw message shape stops at the mapper.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```typescript
|
|
57
|
+
* @topicHandler(BoardTopics.linked, { lifecycle: DependencyLifecycle.INIT })
|
|
58
|
+
* handleBoardLinked(event: TopicPayload<typeof BoardTopics.linked>) {}
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export declare function topicHandler<T extends Topic, Transformed = TopicPayload<T>>(declared: T, opts?: Omit<IKosTopicHandlerParams<TopicPayload<T>, any, Transformed>, "topic">): (target: any, _propertyKey: string, descriptor: PropertyDescriptor) => void;
|
|
62
|
+
/**
|
|
63
|
+
* Subscribe to a declared topic of kos from code that is not a model.
|
|
64
|
+
* A model uses `topicHandler`, which follows the model's lifecycle.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```typescript
|
|
68
|
+
* const stop = topics.subscribe(BoardTopics.linked, (event) => {});
|
|
69
|
+
* stop();
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
export declare const topics: import('../../../../../core/util/kos-topic-client').TopicClient<paths>;
|
|
73
|
+
export default topics;
|
|
74
|
+
//# sourceMappingURL=topic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topic.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/kos-ui-sdk/src/models/utils/topics/kos/daily/topic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAElG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAEnF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,KAAK,CAAC;AAC3B,MAAM,MAAM,SAAS,GAAG,MAAM,KAAK,CAAC;AAEpC,8DAA8D;AAC9D,MAAM,MAAM,SAAS,CAAC,IAAI,SAAS,SAAS,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,SAAS;IACzE,UAAU,EAAE;QAAE,IAAI,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC;CAClC,GACG,MAAM,IAAI,GAAG,MAAM,GACnB,KAAK,CAAC;AAEV,KAAK,YAAY,CAAC,IAAI,SAAS,SAAS,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GACzE,EAAE,GACF,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AAE5C;;;GAGG;AACH,MAAM,WAAW,KAAK,CAAC,IAAI,SAAS,SAAS,GAAG,SAAS;IACvD,6DAA6D;IAC7D,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,sEAAsE;IACtE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,KAAK,CAAC,IAAI,SAAS,SAAS,EAC1C,IAAI,EAAE,IAAI,EACV,GAAG,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,GAC1B,KAAK,CAAC,IAAI,CAAC,CAOb;AAED;;;GAGG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,KAAK,IAAI,cAAc,CACxD,KAAK,EACL,CAAC,CAAC,MAAM,CAAC,EACT,KAAK,CACN,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,KAAK,EAAE,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,EACzE,QAAQ,EAAE,CAAC,EACX,IAAI,CAAC,EAAE,IAAI,CACT,sBAAsB,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,CAAC,EACzD,OAAO,CACR,+EAOF;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,MAAM,wEAA6B,CAAC;AAEjD,eAAe,MAAM,CAAC"}
|