@matter/protocol 0.12.4-alpha.0-20250211-56b2c53a0 → 0.12.4-alpha.0-20250212-b2729c9eb
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/cjs/action/Interactable.d.ts +36 -0
- package/dist/cjs/action/Interactable.d.ts.map +1 -0
- package/dist/cjs/action/Interactable.js +22 -0
- package/dist/cjs/action/Interactable.js.map +6 -0
- package/dist/cjs/action/Val.d.ts +94 -0
- package/dist/cjs/action/Val.d.ts.map +1 -0
- package/dist/cjs/action/Val.js +33 -0
- package/dist/cjs/action/Val.js.map +6 -0
- package/dist/cjs/action/errors.d.ts +69 -0
- package/dist/cjs/action/errors.d.ts.map +1 -0
- package/dist/cjs/action/errors.js +108 -0
- package/dist/cjs/action/errors.js.map +6 -0
- package/dist/cjs/action/index.d.ts +13 -0
- package/dist/cjs/action/index.d.ts.map +1 -0
- package/dist/cjs/action/index.js +30 -0
- package/dist/cjs/action/index.js.map +6 -0
- package/dist/cjs/action/protocols.d.ts +118 -0
- package/dist/cjs/action/protocols.d.ts.map +1 -0
- package/dist/cjs/action/protocols.js +22 -0
- package/dist/cjs/action/protocols.js.map +6 -0
- package/dist/cjs/action/request/Invoke.d.ts +35 -0
- package/dist/cjs/action/request/Invoke.d.ts.map +1 -0
- package/dist/cjs/action/request/Invoke.js +80 -0
- package/dist/cjs/action/request/Invoke.js.map +6 -0
- package/dist/cjs/action/request/MalformedRequestError.d.ts +14 -0
- package/dist/cjs/action/request/MalformedRequestError.d.ts.map +1 -0
- package/dist/cjs/action/request/MalformedRequestError.js +32 -0
- package/dist/cjs/action/request/MalformedRequestError.js.map +6 -0
- package/dist/cjs/action/request/Read.d.ts +141 -0
- package/dist/cjs/action/request/Read.d.ts.map +1 -0
- package/dist/cjs/action/request/Read.js +173 -0
- package/dist/cjs/action/request/Read.js.map +6 -0
- package/dist/cjs/action/request/Specifier.d.ts +82 -0
- package/dist/cjs/action/request/Specifier.d.ts.map +1 -0
- package/dist/cjs/action/request/Specifier.js +88 -0
- package/dist/cjs/action/request/Specifier.js.map +6 -0
- package/dist/cjs/action/request/Subscribe.d.ts +26 -0
- package/dist/cjs/action/request/Subscribe.d.ts.map +1 -0
- package/dist/cjs/action/request/Subscribe.js +50 -0
- package/dist/cjs/action/request/Subscribe.js.map +6 -0
- package/dist/cjs/action/request/Write.d.ts +10 -0
- package/dist/cjs/action/request/Write.d.ts.map +1 -0
- package/dist/cjs/action/request/Write.js +22 -0
- package/dist/cjs/action/request/Write.js.map +6 -0
- package/dist/cjs/action/request/index.d.ts +11 -0
- package/dist/cjs/action/request/index.d.ts.map +1 -0
- package/dist/cjs/action/request/index.js +28 -0
- package/dist/cjs/action/request/index.js.map +6 -0
- package/dist/cjs/action/response/InvokeResult.d.ts +15 -0
- package/dist/cjs/action/response/InvokeResult.d.ts.map +1 -0
- package/dist/cjs/action/response/InvokeResult.js +22 -0
- package/dist/cjs/action/response/InvokeResult.js.map +6 -0
- package/dist/cjs/action/response/ReadResult.d.ts +63 -0
- package/dist/cjs/action/response/ReadResult.d.ts.map +1 -0
- package/dist/cjs/action/response/ReadResult.js +22 -0
- package/dist/cjs/action/response/ReadResult.js.map +6 -0
- package/dist/cjs/action/response/SubscribeResult.d.ts +13 -0
- package/dist/cjs/action/response/SubscribeResult.d.ts.map +1 -0
- package/dist/cjs/action/response/SubscribeResult.js +22 -0
- package/dist/cjs/action/response/SubscribeResult.js.map +6 -0
- package/dist/cjs/action/response/WriteResult.d.ts +12 -0
- package/dist/cjs/action/response/WriteResult.d.ts.map +1 -0
- package/dist/cjs/action/response/WriteResult.js +22 -0
- package/dist/cjs/action/response/WriteResult.js.map +6 -0
- package/dist/cjs/action/response/index.d.ts +10 -0
- package/dist/cjs/action/response/index.d.ts.map +1 -0
- package/dist/cjs/action/response/index.js +27 -0
- package/dist/cjs/action/response/index.js.map +6 -0
- package/dist/cjs/action/server/AccessControl.d.ts +152 -0
- package/dist/cjs/action/server/AccessControl.d.ts.map +1 -0
- package/dist/cjs/action/server/AccessControl.js +287 -0
- package/dist/cjs/action/server/AccessControl.js.map +6 -0
- package/dist/cjs/action/server/AttributeResponse.d.ts +36 -0
- package/dist/cjs/action/server/AttributeResponse.d.ts.map +1 -0
- package/dist/cjs/action/server/AttributeResponse.js +352 -0
- package/dist/cjs/action/server/AttributeResponse.js.map +6 -0
- package/dist/cjs/action/server/ServerInteraction.d.ts +35 -0
- package/dist/cjs/action/server/ServerInteraction.d.ts.map +1 -0
- package/dist/cjs/action/server/ServerInteraction.js +52 -0
- package/dist/cjs/action/server/ServerInteraction.js.map +6 -0
- package/dist/cjs/action/server/index.d.ts +9 -0
- package/dist/cjs/action/server/index.d.ts.map +1 -0
- package/dist/cjs/action/server/index.js +26 -0
- package/dist/cjs/action/server/index.js.map +6 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/interaction/AccessControlManager.d.ts +1 -1
- package/dist/cjs/interaction/AccessControlManager.d.ts.map +1 -1
- package/dist/cjs/interaction/AccessControlManager.js +2 -2
- package/dist/cjs/interaction/AccessControlManager.js.map +1 -1
- package/dist/cjs/interaction/AttributeDataEncoder.d.ts +1 -3
- package/dist/cjs/interaction/AttributeDataEncoder.d.ts.map +1 -1
- package/dist/cjs/interaction/InteractionMessenger.d.ts +5 -5
- package/dist/cjs/interaction/InteractionMessenger.d.ts.map +1 -1
- package/dist/cjs/interaction/InteractionServer.d.ts +1 -1
- package/dist/cjs/interaction/InteractionServer.d.ts.map +1 -1
- package/dist/cjs/interaction/InteractionServer.js +2 -2
- package/dist/cjs/interaction/InteractionServer.js.map +1 -1
- package/dist/cjs/interaction/ServerSubscription.d.ts +2 -2
- package/dist/cjs/interaction/ServerSubscription.d.ts.map +1 -1
- package/dist/cjs/interaction/ServerSubscription.js +0 -1
- package/dist/cjs/interaction/ServerSubscription.js.map +1 -1
- package/dist/cjs/mdns/MdnsScanner.d.ts +2 -2
- package/dist/esm/action/Interactable.d.ts +36 -0
- package/dist/esm/action/Interactable.d.ts.map +1 -0
- package/dist/esm/action/Interactable.js +6 -0
- package/dist/esm/action/Interactable.js.map +6 -0
- package/dist/esm/action/Val.d.ts +94 -0
- package/dist/esm/action/Val.d.ts.map +1 -0
- package/dist/esm/action/Val.js +13 -0
- package/dist/esm/action/Val.js.map +6 -0
- package/dist/esm/action/errors.d.ts +69 -0
- package/dist/esm/action/errors.d.ts.map +1 -0
- package/dist/esm/action/errors.js +88 -0
- package/dist/esm/action/errors.js.map +6 -0
- package/dist/esm/action/index.d.ts +13 -0
- package/dist/esm/action/index.d.ts.map +1 -0
- package/dist/esm/action/index.js +13 -0
- package/dist/esm/action/index.js.map +6 -0
- package/dist/esm/action/protocols.d.ts +118 -0
- package/dist/esm/action/protocols.d.ts.map +1 -0
- package/dist/esm/action/protocols.js +6 -0
- package/dist/esm/action/protocols.js.map +6 -0
- package/dist/esm/action/request/Invoke.d.ts +35 -0
- package/dist/esm/action/request/Invoke.d.ts.map +1 -0
- package/dist/esm/action/request/Invoke.js +60 -0
- package/dist/esm/action/request/Invoke.js.map +6 -0
- package/dist/esm/action/request/MalformedRequestError.d.ts +14 -0
- package/dist/esm/action/request/MalformedRequestError.d.ts.map +1 -0
- package/dist/esm/action/request/MalformedRequestError.js +12 -0
- package/dist/esm/action/request/MalformedRequestError.js.map +6 -0
- package/dist/esm/action/request/Read.d.ts +141 -0
- package/dist/esm/action/request/Read.d.ts.map +1 -0
- package/dist/esm/action/request/Read.js +153 -0
- package/dist/esm/action/request/Read.js.map +6 -0
- package/dist/esm/action/request/Specifier.d.ts +82 -0
- package/dist/esm/action/request/Specifier.d.ts.map +1 -0
- package/dist/esm/action/request/Specifier.js +68 -0
- package/dist/esm/action/request/Specifier.js.map +6 -0
- package/dist/esm/action/request/Subscribe.d.ts +26 -0
- package/dist/esm/action/request/Subscribe.d.ts.map +1 -0
- package/dist/esm/action/request/Subscribe.js +30 -0
- package/dist/esm/action/request/Subscribe.js.map +6 -0
- package/dist/esm/action/request/Write.d.ts +10 -0
- package/dist/esm/action/request/Write.d.ts.map +1 -0
- package/dist/esm/action/request/Write.js +6 -0
- package/dist/esm/action/request/Write.js.map +6 -0
- package/dist/esm/action/request/index.d.ts +11 -0
- package/dist/esm/action/request/index.d.ts.map +1 -0
- package/dist/esm/action/request/index.js +11 -0
- package/dist/esm/action/request/index.js.map +6 -0
- package/dist/esm/action/response/InvokeResult.d.ts +15 -0
- package/dist/esm/action/response/InvokeResult.d.ts.map +1 -0
- package/dist/esm/action/response/InvokeResult.js +6 -0
- package/dist/esm/action/response/InvokeResult.js.map +6 -0
- package/dist/esm/action/response/ReadResult.d.ts +63 -0
- package/dist/esm/action/response/ReadResult.d.ts.map +1 -0
- package/dist/esm/action/response/ReadResult.js +6 -0
- package/dist/esm/action/response/ReadResult.js.map +6 -0
- package/dist/esm/action/response/SubscribeResult.d.ts +13 -0
- package/dist/esm/action/response/SubscribeResult.d.ts.map +1 -0
- package/dist/esm/action/response/SubscribeResult.js +6 -0
- package/dist/esm/action/response/SubscribeResult.js.map +6 -0
- package/dist/esm/action/response/WriteResult.d.ts +12 -0
- package/dist/esm/action/response/WriteResult.d.ts.map +1 -0
- package/dist/esm/action/response/WriteResult.js +6 -0
- package/dist/esm/action/response/WriteResult.js.map +6 -0
- package/dist/esm/action/response/index.d.ts +10 -0
- package/dist/esm/action/response/index.d.ts.map +1 -0
- package/dist/esm/action/response/index.js +10 -0
- package/dist/esm/action/response/index.js.map +6 -0
- package/dist/esm/action/server/AccessControl.d.ts +152 -0
- package/dist/esm/action/server/AccessControl.d.ts.map +1 -0
- package/dist/esm/action/server/AccessControl.js +267 -0
- package/dist/esm/action/server/AccessControl.js.map +6 -0
- package/dist/esm/action/server/AttributeResponse.d.ts +36 -0
- package/dist/esm/action/server/AttributeResponse.d.ts.map +1 -0
- package/dist/esm/action/server/AttributeResponse.js +339 -0
- package/dist/esm/action/server/AttributeResponse.js.map +6 -0
- package/dist/esm/action/server/ServerInteraction.d.ts +35 -0
- package/dist/esm/action/server/ServerInteraction.d.ts.map +1 -0
- package/dist/esm/action/server/ServerInteraction.js +32 -0
- package/dist/esm/action/server/ServerInteraction.js.map +6 -0
- package/dist/esm/action/server/index.d.ts +9 -0
- package/dist/esm/action/server/index.d.ts.map +1 -0
- package/dist/esm/action/server/index.js +9 -0
- package/dist/esm/action/server/index.js.map +6 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/interaction/AccessControlManager.d.ts +1 -1
- package/dist/esm/interaction/AccessControlManager.d.ts.map +1 -1
- package/dist/esm/interaction/AccessControlManager.js +2 -2
- package/dist/esm/interaction/AccessControlManager.js.map +1 -1
- package/dist/esm/interaction/AttributeDataEncoder.d.ts +1 -3
- package/dist/esm/interaction/AttributeDataEncoder.d.ts.map +1 -1
- package/dist/esm/interaction/InteractionMessenger.d.ts +5 -5
- package/dist/esm/interaction/InteractionMessenger.d.ts.map +1 -1
- package/dist/esm/interaction/InteractionServer.d.ts +1 -1
- package/dist/esm/interaction/InteractionServer.d.ts.map +1 -1
- package/dist/esm/interaction/InteractionServer.js +2 -2
- package/dist/esm/interaction/InteractionServer.js.map +1 -1
- package/dist/esm/interaction/ServerSubscription.d.ts +2 -2
- package/dist/esm/interaction/ServerSubscription.d.ts.map +1 -1
- package/dist/esm/interaction/ServerSubscription.js +0 -1
- package/dist/esm/interaction/ServerSubscription.js.map +1 -1
- package/dist/esm/mdns/MdnsScanner.d.ts +2 -2
- package/package.json +6 -6
- package/src/action/Interactable.ts +40 -0
- package/src/action/Val.ts +111 -0
- package/src/action/errors.ts +119 -0
- package/src/action/index.ts +13 -0
- package/src/action/protocols.ts +134 -0
- package/src/action/request/Invoke.ts +93 -0
- package/src/action/request/MalformedRequestError.ts +14 -0
- package/src/action/request/Read.ts +356 -0
- package/src/action/request/Specifier.ts +146 -0
- package/src/action/request/Subscribe.ts +54 -0
- package/src/action/request/Write.ts +13 -0
- package/src/action/request/index.ts +11 -0
- package/src/action/response/InvokeResult.ts +17 -0
- package/src/action/response/ReadResult.ts +89 -0
- package/src/action/response/SubscribeResult.ts +14 -0
- package/src/action/response/WriteResult.ts +13 -0
- package/src/action/response/index.ts +10 -0
- package/src/action/server/AccessControl.ts +494 -0
- package/src/action/server/AttributeResponse.ts +413 -0
- package/src/action/server/ServerInteraction.ts +64 -0
- package/src/action/server/index.ts +9 -0
- package/src/index.ts +1 -0
- package/src/interaction/AccessControlManager.ts +3 -3
- package/src/interaction/InteractionServer.ts +2 -3
- package/src/interaction/ServerSubscription.ts +0 -2
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022-2025 Matter.js Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { Read } from "./Read.js";
|
|
7
|
+
/**
|
|
8
|
+
* Defines a subscription.
|
|
9
|
+
*
|
|
10
|
+
* The subscription interval fields are optional as matter.js will set them to appropriate defaults based on physical
|
|
11
|
+
* attributes of the target device. If you are unsure of appropriate values do not set them.
|
|
12
|
+
*/
|
|
13
|
+
export interface Subscribe extends Read {
|
|
14
|
+
keepSubscriptions: boolean;
|
|
15
|
+
minIntervalFloorSeconds?: number;
|
|
16
|
+
maxIntervalCeilingSeconds?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare function Subscribe(options: Subscribe.Options): Subscribe;
|
|
19
|
+
export declare namespace Subscribe {
|
|
20
|
+
interface Options extends Read.Options {
|
|
21
|
+
keepSubscriptions?: boolean;
|
|
22
|
+
minIntervalFloorSeconds?: number;
|
|
23
|
+
maxIntervalCeilingSeconds?: number;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=Subscribe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Subscribe.d.ts","sourceRoot":"","sources":["../../../../src/action/request/Subscribe.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;;;GAKG;AACH,MAAM,WAAW,SAAU,SAAQ,IAAI;IACnC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACtC;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,OAAO,GAAG,SAAS,CAqB/D;AAED,yBAAiB,SAAS,CAAC;IACvB,UAAiB,OAAQ,SAAQ,IAAI,CAAC,OAAO;QACzC,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,uBAAuB,CAAC,EAAE,MAAM,CAAC;QACjC,yBAAyB,CAAC,EAAE,MAAM,CAAC;KACtC;CACJ"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var Subscribe_exports = {};
|
|
20
|
+
__export(Subscribe_exports, {
|
|
21
|
+
Subscribe: () => Subscribe
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(Subscribe_exports);
|
|
24
|
+
var import_general = require("#general");
|
|
25
|
+
var import_MalformedRequestError = require("./MalformedRequestError.js");
|
|
26
|
+
var import_Read = require("./Read.js");
|
|
27
|
+
/**
|
|
28
|
+
* @license
|
|
29
|
+
* Copyright 2022-2025 Matter.js Authors
|
|
30
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
31
|
+
*/
|
|
32
|
+
function Subscribe(options) {
|
|
33
|
+
const subscribe = (0, import_Read.Read)(options);
|
|
34
|
+
const { keepSubscriptions, minIntervalFloorSeconds, maxIntervalCeilingSeconds } = options;
|
|
35
|
+
subscribe.keepSubscriptions = keepSubscriptions ?? true;
|
|
36
|
+
if (minIntervalFloorSeconds !== void 0) {
|
|
37
|
+
if (minIntervalFloorSeconds < 0 || minIntervalFloorSeconds > import_general.UINT16_MAX) {
|
|
38
|
+
throw new import_MalformedRequestError.MalformedRequestError(`Minimum interval floor ${minIntervalFloorSeconds} is out of range`);
|
|
39
|
+
}
|
|
40
|
+
subscribe.minIntervalFloorSeconds = minIntervalFloorSeconds;
|
|
41
|
+
}
|
|
42
|
+
if (maxIntervalCeilingSeconds !== void 0) {
|
|
43
|
+
if (maxIntervalCeilingSeconds < 0 || maxIntervalCeilingSeconds > import_general.UINT16_MAX) {
|
|
44
|
+
throw new import_MalformedRequestError.MalformedRequestError(`Maximum interval ceiling ${maxIntervalCeilingSeconds} is out of range`);
|
|
45
|
+
}
|
|
46
|
+
subscribe.maxIntervalCeilingSeconds = maxIntervalCeilingSeconds;
|
|
47
|
+
}
|
|
48
|
+
return subscribe;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=Subscribe.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/action/request/Subscribe.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,qBAA2B;AAC3B,mCAAsC;AACtC,kBAAqB;AARrB;AAAA;AAAA;AAAA;AAAA;AAsBO,SAAS,UAAU,SAAuC;AAC7D,QAAM,gBAAY,kBAAK,OAAO;AAE9B,QAAM,EAAE,mBAAmB,yBAAyB,0BAA0B,IAAI;AAClF,YAAU,oBAAoB,qBAAqB;AAEnD,MAAI,4BAA4B,QAAW;AACvC,QAAI,0BAA0B,KAAK,0BAA0B,2BAAY;AACrE,YAAM,IAAI,mDAAsB,0BAA0B,uBAAuB,kBAAkB;AAAA,IACvG;AACA,cAAU,0BAA0B;AAAA,EACxC;AAEA,MAAI,8BAA8B,QAAW;AACzC,QAAI,4BAA4B,KAAK,4BAA4B,2BAAY;AACzE,YAAM,IAAI,mDAAsB,4BAA4B,yBAAyB,kBAAkB;AAAA,IAC3G;AACA,cAAU,4BAA4B;AAAA,EAC1C;AAEA,SAAO;AACX;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Write.d.ts","sourceRoot":"","sources":["../../../../src/action/request/Write.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,MAAM,WAAW,KAAM,SAAQ,YAAY;IACvC,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var Write_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(Write_exports);
|
|
17
|
+
/**
|
|
18
|
+
* @license
|
|
19
|
+
* Copyright 2022-2025 Matter.js Authors
|
|
20
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
21
|
+
*/
|
|
22
|
+
//# sourceMappingURL=Write.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022-2025 Matter.js Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export * from "./Invoke.js";
|
|
7
|
+
export * from "./Read.js";
|
|
8
|
+
export * from "./Specifier.js";
|
|
9
|
+
export * from "./Subscribe.js";
|
|
10
|
+
export * from "./Write.js";
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/action/request/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var request_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(request_exports);
|
|
18
|
+
__reExport(request_exports, require("./Invoke.js"), module.exports);
|
|
19
|
+
__reExport(request_exports, require("./Read.js"), module.exports);
|
|
20
|
+
__reExport(request_exports, require("./Specifier.js"), module.exports);
|
|
21
|
+
__reExport(request_exports, require("./Subscribe.js"), module.exports);
|
|
22
|
+
__reExport(request_exports, require("./Write.js"), module.exports);
|
|
23
|
+
/**
|
|
24
|
+
* @license
|
|
25
|
+
* Copyright 2022-2025 Matter.js Authors
|
|
26
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
27
|
+
*/
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022-2025 Matter.js Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { Invoke } from "#action/request/Invoke.js";
|
|
7
|
+
import type { CommandData } from "#types";
|
|
8
|
+
import { CancelablePromise } from "@matter/general";
|
|
9
|
+
export type InvokeResult<T extends Invoke> = T extends {
|
|
10
|
+
suppressResponse: true;
|
|
11
|
+
} ? CancelablePromise<void> : AsyncIterable<InvokeResult.Chunk>;
|
|
12
|
+
export declare namespace InvokeResult {
|
|
13
|
+
type Chunk = CommandData[];
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=InvokeResult.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InvokeResult.d.ts","sourceRoot":"","sources":["../../../../src/action/response/InvokeResult.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS;IAAE,gBAAgB,EAAE,IAAI,CAAA;CAAE,GAC3E,iBAAiB,CAAC,IAAI,CAAC,GACvB,aAAa,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;AAExC,yBAAiB,YAAY,CAAC;IAC1B,KAAY,KAAK,GAAG,WAAW,EAAE,CAAC;CACrC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var InvokeResult_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(InvokeResult_exports);
|
|
17
|
+
/**
|
|
18
|
+
* @license
|
|
19
|
+
* Copyright 2022-2025 Matter.js Authors
|
|
20
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
21
|
+
*/
|
|
22
|
+
//# sourceMappingURL=InvokeResult.js.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022-2025 Matter.js Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { AttributeId, AttributePath, ClusterId, EndpointNumber, EventId, EventPath, NodeId, Status, StatusCode } from "#types";
|
|
7
|
+
/**
|
|
8
|
+
* Streaming result for a Matter protocol-level read.
|
|
9
|
+
*
|
|
10
|
+
* These structures contain data for AttributeReportIB and EventReportIB. We don't use the deeply-nested native TLV
|
|
11
|
+
* structure directly for reasons of performance and developer convenience.
|
|
12
|
+
*
|
|
13
|
+
* Iteration occurs in chunks for performance reasons. A chunk is an iterable of reports, one per output attribute or
|
|
14
|
+
* event.
|
|
15
|
+
*/
|
|
16
|
+
export interface ReadResult<Chunk = ReadResult.Chunk> extends AsyncIterable<ReadResult.Chunk> {
|
|
17
|
+
}
|
|
18
|
+
export declare namespace ReadResult {
|
|
19
|
+
type Chunk = Iterable<Report>;
|
|
20
|
+
type Report = AttributeValue | GlobalAttributeStatus | ClusterAttributeStatus | EventValue | GlobalEventStatus | ClusterEventStatus;
|
|
21
|
+
interface ConcreteAttributePath extends AttributePath {
|
|
22
|
+
nodeId?: NodeId;
|
|
23
|
+
endpointId: EndpointNumber;
|
|
24
|
+
clusterId: ClusterId;
|
|
25
|
+
attributeId: AttributeId;
|
|
26
|
+
}
|
|
27
|
+
interface AttributeValue {
|
|
28
|
+
kind: "attr-value";
|
|
29
|
+
path: ConcreteAttributePath;
|
|
30
|
+
value: unknown;
|
|
31
|
+
}
|
|
32
|
+
interface GlobalAttributeStatus {
|
|
33
|
+
kind: "attr-status";
|
|
34
|
+
path: ConcreteAttributePath;
|
|
35
|
+
status: StatusCode;
|
|
36
|
+
}
|
|
37
|
+
interface ClusterAttributeStatus {
|
|
38
|
+
kind: "attr-cluster-status";
|
|
39
|
+
path: ConcreteAttributePath;
|
|
40
|
+
clusterStatus: number;
|
|
41
|
+
}
|
|
42
|
+
interface ConcreteEventPath extends EventPath {
|
|
43
|
+
nodeId?: NodeId;
|
|
44
|
+
endpointId: EndpointNumber;
|
|
45
|
+
clusterId: ClusterId;
|
|
46
|
+
eventId: EventId;
|
|
47
|
+
}
|
|
48
|
+
interface EventValue {
|
|
49
|
+
kind: "event-value";
|
|
50
|
+
path: ConcreteEventPath;
|
|
51
|
+
}
|
|
52
|
+
interface GlobalEventStatus {
|
|
53
|
+
kind: "event-status";
|
|
54
|
+
path: ConcreteEventPath;
|
|
55
|
+
status: Status;
|
|
56
|
+
}
|
|
57
|
+
interface ClusterEventStatus {
|
|
58
|
+
kind: "event-cluster-status";
|
|
59
|
+
path: ConcreteEventPath;
|
|
60
|
+
clusterStatus: number;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=ReadResult.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReadResult.d.ts","sourceRoot":"","sources":["../../../../src/action/response/ReadResult.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACR,WAAW,EACX,aAAa,EACb,SAAS,EACT,cAAc,EACd,OAAO,EACP,SAAS,EACT,MAAM,EACN,MAAM,EACN,UAAU,EACb,MAAM,QAAQ,CAAC;AAEhB;;;;;;;;GAQG;AACH,MAAM,WAAW,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAE,SAAQ,aAAa,CAAC,UAAU,CAAC,KAAK,CAAC;CAAG;AAEhG,yBAAiB,UAAU,CAAC;IACxB,KAAY,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;IAErC,KAAY,MAAM,GACZ,cAAc,GACd,qBAAqB,GACrB,sBAAsB,GACtB,UAAU,GACV,iBAAiB,GACjB,kBAAkB,CAAC;IAEzB,UAAiB,qBAAsB,SAAQ,aAAa;QACxD,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,cAAc,CAAC;QAC3B,SAAS,EAAE,SAAS,CAAC;QACrB,WAAW,EAAE,WAAW,CAAC;KAC5B;IAED,UAAiB,cAAc;QAC3B,IAAI,EAAE,YAAY,CAAC;QACnB,IAAI,EAAE,qBAAqB,CAAC;QAC5B,KAAK,EAAE,OAAO,CAAC;KAClB;IAED,UAAiB,qBAAqB;QAClC,IAAI,EAAE,aAAa,CAAC;QACpB,IAAI,EAAE,qBAAqB,CAAC;QAC5B,MAAM,EAAE,UAAU,CAAC;KACtB;IAED,UAAiB,sBAAsB;QACnC,IAAI,EAAE,qBAAqB,CAAC;QAC5B,IAAI,EAAE,qBAAqB,CAAC;QAC5B,aAAa,EAAE,MAAM,CAAC;KACzB;IAED,UAAiB,iBAAkB,SAAQ,SAAS;QAChD,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,cAAc,CAAC;QAC3B,SAAS,EAAE,SAAS,CAAC;QACrB,OAAO,EAAE,OAAO,CAAC;KACpB;IAED,UAAiB,UAAU;QACvB,IAAI,EAAE,aAAa,CAAC;QACpB,IAAI,EAAE,iBAAiB,CAAC;KAC3B;IAED,UAAiB,iBAAiB;QAC9B,IAAI,EAAE,cAAc,CAAC;QACrB,IAAI,EAAE,iBAAiB,CAAC;QACxB,MAAM,EAAE,MAAM,CAAC;KAClB;IAED,UAAiB,kBAAkB;QAC/B,IAAI,EAAE,sBAAsB,CAAC;QAC7B,IAAI,EAAE,iBAAiB,CAAC;QACxB,aAAa,EAAE,MAAM,CAAC;KACzB;CACJ"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var ReadResult_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(ReadResult_exports);
|
|
17
|
+
/**
|
|
18
|
+
* @license
|
|
19
|
+
* Copyright 2022-2025 Matter.js Authors
|
|
20
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
21
|
+
*/
|
|
22
|
+
//# sourceMappingURL=ReadResult.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022-2025 Matter.js Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { SubscribeResponse } from "#types";
|
|
7
|
+
import { ReadResult } from "./ReadResult.js";
|
|
8
|
+
export interface SubscribeResult extends AsyncIterator<SubscribeResult.Chunk> {
|
|
9
|
+
}
|
|
10
|
+
export declare namespace SubscribeResult {
|
|
11
|
+
type Chunk = ReadResult.Chunk | SubscribeResponse;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=SubscribeResult.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubscribeResult.d.ts","sourceRoot":"","sources":["../../../../src/action/response/SubscribeResult.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,WAAW,eAAgB,SAAQ,aAAa,CAAC,eAAe,CAAC,KAAK,CAAC;CAAG;AAEhF,yBAAiB,eAAe,CAAC;IAC7B,KAAY,KAAK,GAAG,UAAU,CAAC,KAAK,GAAG,iBAAiB,CAAC;CAC5D"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var SubscribeResult_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(SubscribeResult_exports);
|
|
17
|
+
/**
|
|
18
|
+
* @license
|
|
19
|
+
* Copyright 2022-2025 Matter.js Authors
|
|
20
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
21
|
+
*/
|
|
22
|
+
//# sourceMappingURL=SubscribeResult.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022-2025 Matter.js Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { Write } from "#action/request/Write.js";
|
|
7
|
+
import type { CancelablePromise } from "#general";
|
|
8
|
+
import type { WriteResponse } from "#types";
|
|
9
|
+
export type WriteResult<T extends Write> = CancelablePromise<T extends {
|
|
10
|
+
suppressResponse: true;
|
|
11
|
+
} ? void : WriteResponse>;
|
|
12
|
+
//# sourceMappingURL=WriteResult.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WriteResult.d.ts","sourceRoot":"","sources":["../../../../src/action/response/WriteResult.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,KAAK,IAAI,iBAAiB,CACxD,CAAC,SAAS;IAAE,gBAAgB,EAAE,IAAI,CAAA;CAAE,GAAG,IAAI,GAAG,aAAa,CAC9D,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var WriteResult_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(WriteResult_exports);
|
|
17
|
+
/**
|
|
18
|
+
* @license
|
|
19
|
+
* Copyright 2022-2025 Matter.js Authors
|
|
20
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
21
|
+
*/
|
|
22
|
+
//# sourceMappingURL=WriteResult.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022-2025 Matter.js Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export * from "./InvokeResult.js";
|
|
7
|
+
export * from "./ReadResult.js";
|
|
8
|
+
export * from "./SubscribeResult.js";
|
|
9
|
+
export * from "./WriteResult.js";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/action/response/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var response_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(response_exports);
|
|
18
|
+
__reExport(response_exports, require("./InvokeResult.js"), module.exports);
|
|
19
|
+
__reExport(response_exports, require("./ReadResult.js"), module.exports);
|
|
20
|
+
__reExport(response_exports, require("./SubscribeResult.js"), module.exports);
|
|
21
|
+
__reExport(response_exports, require("./WriteResult.js"), module.exports);
|
|
22
|
+
/**
|
|
23
|
+
* @license
|
|
24
|
+
* Copyright 2022-2025 Matter.js Authors
|
|
25
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
26
|
+
*/
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022-2025 Matter.js Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { AccessLevel, DataModelPath, Schema } from "#model";
|
|
7
|
+
import { ClusterId, EndpointNumber, FabricIndex, SubjectId } from "#types";
|
|
8
|
+
/**
|
|
9
|
+
* Enforces access control for a specific schema.
|
|
10
|
+
*/
|
|
11
|
+
export interface AccessControl {
|
|
12
|
+
/**
|
|
13
|
+
* Operational access control metadata.
|
|
14
|
+
*/
|
|
15
|
+
limits: AccessControl.Limits;
|
|
16
|
+
/**
|
|
17
|
+
* Assert read is authorized.
|
|
18
|
+
*/
|
|
19
|
+
authorizeRead: AccessControl.Assertion;
|
|
20
|
+
/**
|
|
21
|
+
* Determine if read is authorized.
|
|
22
|
+
*/
|
|
23
|
+
mayRead: AccessControl.Verification;
|
|
24
|
+
/**
|
|
25
|
+
* Assert write is authorized.
|
|
26
|
+
*/
|
|
27
|
+
authorizeWrite: AccessControl.Assertion;
|
|
28
|
+
/**
|
|
29
|
+
* Determine if write is authorized.
|
|
30
|
+
*/
|
|
31
|
+
mayWrite: AccessControl.Verification;
|
|
32
|
+
/**
|
|
33
|
+
* Assert invoke is authorized.
|
|
34
|
+
*/
|
|
35
|
+
authorizeInvoke: AccessControl.Assertion;
|
|
36
|
+
/**
|
|
37
|
+
* Determine if invoke is authorized.
|
|
38
|
+
*/
|
|
39
|
+
mayInvoke: AccessControl.Verification;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Obtain an enforcer for specific schema.
|
|
43
|
+
*
|
|
44
|
+
* This is central to security. Implementation is explicit, all objects are involved are frozen and cache is stored as
|
|
45
|
+
* module-private.
|
|
46
|
+
*
|
|
47
|
+
* Pure function; returned value is cached.
|
|
48
|
+
*/
|
|
49
|
+
export declare function AccessControl(schema: Schema): AccessControl;
|
|
50
|
+
export declare namespace AccessControl {
|
|
51
|
+
/**
|
|
52
|
+
* Operational access control metadata for a schema.
|
|
53
|
+
*/
|
|
54
|
+
interface Limits {
|
|
55
|
+
readonly readable: boolean;
|
|
56
|
+
readonly readLevel: AccessLevel;
|
|
57
|
+
readonly writable: boolean;
|
|
58
|
+
readonly writeLevel: AccessLevel;
|
|
59
|
+
readonly fabricScoped: boolean;
|
|
60
|
+
readonly fabricSensitive: boolean;
|
|
61
|
+
readonly timed: boolean;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* A function that asserts access control requirements are met.
|
|
65
|
+
*/
|
|
66
|
+
type Assertion = (session: Session, location: Location) => void;
|
|
67
|
+
/**
|
|
68
|
+
* A function that returns true if access control requirements are met.
|
|
69
|
+
*/
|
|
70
|
+
type Verification = (session: Session, location: Location) => boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Metadata that varies with position in the data model.
|
|
73
|
+
*/
|
|
74
|
+
interface Location {
|
|
75
|
+
/**
|
|
76
|
+
* The diagnostic path to the location.
|
|
77
|
+
*/
|
|
78
|
+
path: DataModelPath;
|
|
79
|
+
/**
|
|
80
|
+
* The owning endpoint.
|
|
81
|
+
*/
|
|
82
|
+
endpoint?: EndpointNumber;
|
|
83
|
+
/**
|
|
84
|
+
* The owning behavior.
|
|
85
|
+
*/
|
|
86
|
+
cluster?: ClusterId;
|
|
87
|
+
/**
|
|
88
|
+
* The fabric that owns the data subtree. Undefined or {@link FabricIndex.NO_FABRIC} disables fabric
|
|
89
|
+
* enforcement.
|
|
90
|
+
*/
|
|
91
|
+
owningFabric?: FabricIndex;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Authorization metadata that varies with session.
|
|
95
|
+
*/
|
|
96
|
+
interface Session {
|
|
97
|
+
/**
|
|
98
|
+
* Determine whether authorized client has authority at a specific location.
|
|
99
|
+
*/
|
|
100
|
+
authorityAt(desiredAccessLevel: AccessLevel, location?: Location): Authority;
|
|
101
|
+
/**
|
|
102
|
+
* The fabric of the authorized client.
|
|
103
|
+
*/
|
|
104
|
+
readonly fabric?: FabricIndex;
|
|
105
|
+
/**
|
|
106
|
+
* The authenticated {@link SubjectId} for online sessions.
|
|
107
|
+
*/
|
|
108
|
+
readonly subject?: SubjectId;
|
|
109
|
+
/**
|
|
110
|
+
* Flag subject as a group rather than a peer.
|
|
111
|
+
*/
|
|
112
|
+
readonly isGroupSubject?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* If this is true, fabric-scoped lists are filtered to the accessing fabric.
|
|
115
|
+
*/
|
|
116
|
+
readonly fabricFiltered?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* If this is true a timed transaction is in effect.
|
|
119
|
+
*/
|
|
120
|
+
readonly timed?: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* If this is true then data access levels are not enforced. Datatypes and command-related access controls are
|
|
123
|
+
* active.
|
|
124
|
+
*/
|
|
125
|
+
readonly command?: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* If this is true then access levels are not enforced and all values are read/write. Datatypes are still
|
|
128
|
+
* enforced.
|
|
129
|
+
*
|
|
130
|
+
* Tracks "offline" rather than "online" because this makes the safer mode (full enforcement) the default.
|
|
131
|
+
*/
|
|
132
|
+
offline?: boolean;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Authority status.
|
|
136
|
+
*/
|
|
137
|
+
enum Authority {
|
|
138
|
+
/**
|
|
139
|
+
* Authority is granted.
|
|
140
|
+
*/
|
|
141
|
+
Granted = 1,
|
|
142
|
+
/**
|
|
143
|
+
* Insufficient privileges.
|
|
144
|
+
*/
|
|
145
|
+
Unauthorized = 2,
|
|
146
|
+
/**
|
|
147
|
+
* Feature is restricted.
|
|
148
|
+
*/
|
|
149
|
+
Restricted = 3
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=AccessControl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccessControl.d.ts","sourceRoot":"","sources":["../../../../src/action/server/AccessControl.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAU,WAAW,EAAE,aAAa,EAAc,MAAM,EAAc,MAAM,QAAQ,CAAC;AAC5F,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAc,SAAS,EAAE,MAAM,QAAQ,CAAC;AAKvF;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B;;OAEG;IACH,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC;IAE7B;;OAEG;IACH,aAAa,EAAE,aAAa,CAAC,SAAS,CAAC;IAEvC;;OAEG;IACH,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC;IAEpC;;OAEG;IACH,cAAc,EAAE,aAAa,CAAC,SAAS,CAAC;IAExC;;OAEG;IACH,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC;IAErC;;OAEG;IACH,eAAe,EAAE,aAAa,CAAC,SAAS,CAAC;IAEzC;;OAEG;IACH,SAAS,EAAE,aAAa,CAAC,YAAY,CAAC;CACzC;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,iBAM3C;AAED,yBAAiB,aAAa,CAAC;IAC3B;;OAEG;IACH,UAAiB,MAAM;QACnB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;QAC3B,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;QAEhC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;QAC3B,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC;QAEjC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;QAC/B,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;QAElC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;KAC3B;IAED;;OAEG;IACH,KAAY,SAAS,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;IAEvE;;OAEG;IACH,KAAY,YAAY,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAC;IAE7E;;OAEG;IACH,UAAiB,QAAQ;QACrB;;WAEG;QACH,IAAI,EAAE,aAAa,CAAC;QAEpB;;WAEG;QACH,QAAQ,CAAC,EAAE,cAAc,CAAC;QAE1B;;WAEG;QACH,OAAO,CAAC,EAAE,SAAS,CAAC;QAEpB;;;WAGG;QACH,YAAY,CAAC,EAAE,WAAW,CAAC;KAC9B;IAED;;OAEG;IACH,UAAiB,OAAO;QACpB;;WAEG;QACH,WAAW,CAAC,kBAAkB,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;QAE7E;;WAEG;QACH,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;QAE9B;;WAEG;QACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;QAE7B;;WAEG;QACH,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;QAElC;;WAEG;QACH,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;QAElC;;WAEG;QACH,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;QAEzB;;;WAGG;QACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;QAE3B;;;;;WAKG;QACH,OAAO,CAAC,EAAE,OAAO,CAAC;KACrB;IAED;;OAEG;IACH,KAAY,SAAS;QACjB;;WAEG;QACH,OAAO,IAAI;QAEX;;WAEG;QACH,YAAY,IAAI;QAEhB;;WAEG;QACH,UAAU,IAAI;KACjB;CACJ"}
|