@matter/protocol 0.15.2-alpha.0-20250717-3607eeac6 → 0.15.2-alpha.0-20250718-7e661c331
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/errors.d.ts +7 -7
- package/dist/cjs/action/errors.d.ts.map +1 -1
- package/dist/cjs/action/errors.js +9 -14
- package/dist/cjs/action/errors.js.map +1 -1
- package/dist/cjs/action/response/WriteResult.d.ts +4 -3
- package/dist/cjs/action/response/WriteResult.d.ts.map +1 -1
- package/dist/cjs/action/response/WriteResult.js +30 -0
- package/dist/cjs/action/response/WriteResult.js.map +2 -2
- package/dist/cjs/common/ExpandedPath.d.ts +25 -0
- package/dist/cjs/common/ExpandedPath.d.ts.map +1 -0
- package/dist/cjs/common/ExpandedPath.js +73 -0
- package/dist/cjs/common/ExpandedPath.js.map +6 -0
- package/dist/cjs/common/ExpandedStatus.d.ts +27 -0
- package/dist/cjs/common/ExpandedStatus.d.ts.map +1 -0
- package/dist/cjs/common/ExpandedStatus.js +73 -0
- package/dist/cjs/common/ExpandedStatus.js.map +6 -0
- package/dist/cjs/common/PathError.d.ts +28 -0
- package/dist/cjs/common/PathError.d.ts.map +1 -0
- package/dist/cjs/common/PathError.js +52 -0
- package/dist/cjs/common/PathError.js.map +6 -0
- package/dist/cjs/common/index.d.ts +1 -0
- package/dist/cjs/common/index.d.ts.map +1 -1
- package/dist/cjs/common/index.js +1 -0
- package/dist/cjs/common/index.js.map +1 -1
- package/dist/esm/action/errors.d.ts +7 -7
- package/dist/esm/action/errors.d.ts.map +1 -1
- package/dist/esm/action/errors.js +10 -15
- package/dist/esm/action/errors.js.map +1 -1
- package/dist/esm/action/response/WriteResult.d.ts +4 -3
- package/dist/esm/action/response/WriteResult.d.ts.map +1 -1
- package/dist/esm/action/response/WriteResult.js +26 -0
- package/dist/esm/action/response/WriteResult.js.map +2 -2
- package/dist/esm/common/ExpandedPath.d.ts +25 -0
- package/dist/esm/common/ExpandedPath.d.ts.map +1 -0
- package/dist/esm/common/ExpandedPath.js +60 -0
- package/dist/esm/common/ExpandedPath.js.map +6 -0
- package/dist/esm/common/ExpandedStatus.d.ts +27 -0
- package/dist/esm/common/ExpandedStatus.d.ts.map +1 -0
- package/dist/esm/common/ExpandedStatus.js +53 -0
- package/dist/esm/common/ExpandedStatus.js.map +6 -0
- package/dist/esm/common/PathError.d.ts +28 -0
- package/dist/esm/common/PathError.d.ts.map +1 -0
- package/dist/esm/common/PathError.js +32 -0
- package/dist/esm/common/PathError.js.map +6 -0
- package/dist/esm/common/index.d.ts +1 -0
- package/dist/esm/common/index.d.ts.map +1 -1
- package/dist/esm/common/index.js +1 -0
- package/dist/esm/common/index.js.map +1 -1
- package/package.json +6 -6
- package/src/action/errors.ts +16 -21
- package/src/action/response/WriteResult.ts +27 -3
- package/src/common/ExpandedPath.ts +87 -0
- package/src/common/ExpandedStatus.ts +71 -0
- package/src/common/PathError.ts +46 -0
- package/src/common/index.ts +1 -0
|
@@ -4,43 +4,43 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { Schema, SchemaErrorPath } from "#model";
|
|
7
|
-
import {
|
|
7
|
+
import { Status, StatusResponseError } from "#types";
|
|
8
8
|
export { SchemaImplementationError } from "#model";
|
|
9
9
|
/**
|
|
10
10
|
* Thrown due operational schema violations.
|
|
11
11
|
*/
|
|
12
12
|
export declare class SchemaViolationError extends StatusResponseError {
|
|
13
|
-
constructor(prefix: string, path: SchemaErrorPath, message: string, code:
|
|
13
|
+
constructor(prefix: string, path: SchemaErrorPath, message: string, code: Status);
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* Thrown for invalid reads.
|
|
17
17
|
*/
|
|
18
18
|
export declare class ReadError extends SchemaViolationError {
|
|
19
|
-
constructor(path: SchemaErrorPath, message: string, code?:
|
|
19
|
+
constructor(path: SchemaErrorPath, message: string, code?: Status);
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Thrown for invalid writes.
|
|
23
23
|
*/
|
|
24
24
|
export declare class WriteError extends SchemaViolationError {
|
|
25
|
-
constructor(path: SchemaErrorPath, message: string, code?:
|
|
25
|
+
constructor(path: SchemaErrorPath, message: string, code?: Status);
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* Thrown for invalid invokes.
|
|
29
29
|
*/
|
|
30
30
|
export declare class InvokeError extends SchemaViolationError {
|
|
31
|
-
constructor(path: SchemaErrorPath, message: string, code?:
|
|
31
|
+
constructor(path: SchemaErrorPath, message: string, code?: Status);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* Thrown when validation fails.
|
|
35
35
|
*/
|
|
36
36
|
export declare class ValidateError extends SchemaViolationError {
|
|
37
|
-
constructor(path: SchemaErrorPath, message: string, code?:
|
|
37
|
+
constructor(path: SchemaErrorPath, message: string, code?: Status);
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
40
|
* Thrown when a value is of the wrong datatype.
|
|
41
41
|
*/
|
|
42
42
|
export declare class DatatypeError extends ValidateError {
|
|
43
|
-
constructor(path: SchemaErrorPath, type: string, value: unknown, code?:
|
|
43
|
+
constructor(path: SchemaErrorPath, type: string, value: unknown, code?: Status);
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
46
|
* Thrown when constraint is violated.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/action/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAc,MAAM,QAAQ,CAAC;AAC7D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/action/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAc,MAAM,QAAQ,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,mBA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EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;CAStF;AAED;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,gBAAgB;gBAC/C,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM;CAGrE;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,oBAAoB;gBAC/C,IAAI,EAAE,eAAe;CAGpC;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,oBAAoB;gBAC/C,IAAI,EAAE,eAAe;CAGpC"}
|
|
@@ -49,22 +49,22 @@ class SchemaViolationError extends import_types.StatusResponseError {
|
|
|
49
49
|
}
|
|
50
50
|
class ReadError extends SchemaViolationError {
|
|
51
51
|
constructor(path, message, code) {
|
|
52
|
-
super("Reading", path, message, code ?? import_types.
|
|
52
|
+
super("Reading", path, message, code ?? import_types.Status.UnsupportedRead);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
class WriteError extends SchemaViolationError {
|
|
56
56
|
constructor(path, message, code) {
|
|
57
|
-
super("Writing", path, message, code ?? import_types.
|
|
57
|
+
super("Writing", path, message, code ?? import_types.Status.UnsupportedWrite);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
class InvokeError extends SchemaViolationError {
|
|
61
61
|
constructor(path, message, code) {
|
|
62
|
-
super("Invoking", path, message, code ?? import_types.
|
|
62
|
+
super("Invoking", path, message, code ?? import_types.Status.UnsupportedAccess);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
class ValidateError extends SchemaViolationError {
|
|
66
66
|
constructor(path, message, code) {
|
|
67
|
-
super("Validating", path, message, code ?? import_types.
|
|
67
|
+
super("Validating", path, message, code ?? import_types.Status.InvalidDataType);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
class DatatypeError extends ValidateError {
|
|
@@ -78,12 +78,12 @@ class DatatypeError extends ValidateError {
|
|
|
78
78
|
}
|
|
79
79
|
class ConstraintError extends ValidateError {
|
|
80
80
|
constructor(schema, path, message) {
|
|
81
|
-
super(path, `Constraint "${schema.constraint}": ${message}`, import_types.
|
|
81
|
+
super(path, `Constraint "${schema.constraint}": ${message}`, import_types.Status.ConstraintError);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
class UnknownEnumValueError extends ValidateError {
|
|
85
85
|
constructor(path, message) {
|
|
86
|
-
super(path, message, import_types.
|
|
86
|
+
super(path, message, import_types.Status.ConstraintError);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
class ConformanceError extends ValidateError {
|
|
@@ -94,7 +94,7 @@ class ConformanceError extends ValidateError {
|
|
|
94
94
|
} else {
|
|
95
95
|
prefix = `Conformance "${schema.conformance}"`;
|
|
96
96
|
}
|
|
97
|
-
super(path, `${prefix}: ${message}`, import_types.
|
|
97
|
+
super(path, `${prefix}: ${message}`, import_types.Status.ConstraintError);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
class EnumValueConformanceError extends ConformanceError {
|
|
@@ -104,17 +104,12 @@ class EnumValueConformanceError extends ConformanceError {
|
|
|
104
104
|
}
|
|
105
105
|
class ExpiredReferenceError extends SchemaViolationError {
|
|
106
106
|
constructor(path) {
|
|
107
|
-
super(
|
|
108
|
-
"Referencing",
|
|
109
|
-
path,
|
|
110
|
-
"This value is no longer available because its context has exited",
|
|
111
|
-
import_types.StatusCode.Failure
|
|
112
|
-
);
|
|
107
|
+
super("Referencing", path, "This value is no longer available because its context has exited", import_types.Status.Failure);
|
|
113
108
|
}
|
|
114
109
|
}
|
|
115
110
|
class PhantomReferenceError extends SchemaViolationError {
|
|
116
111
|
constructor(path) {
|
|
117
|
-
super("Referencing", path, "Container was removed", import_types.
|
|
112
|
+
super("Referencing", path, "Container was removed", import_types.Status.Failure);
|
|
118
113
|
}
|
|
119
114
|
}
|
|
120
115
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2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5
|
*/
|
|
6
6
|
import { Write } from "#action/request/Write.js";
|
|
7
|
-
import type
|
|
8
|
-
export type WriteResult<T extends Write> = Promise<T extends {
|
|
7
|
+
import { Status, type AttributeId, type AttributePath, type ClusterId, type EndpointNumber, type NodeId } from "#types";
|
|
8
|
+
export type WriteResult<T extends Write = Write> = Promise<T extends {
|
|
9
9
|
suppressResponse: true;
|
|
10
10
|
} ? void : WriteResult.AttributeStatus[]>;
|
|
11
11
|
export declare namespace WriteResult {
|
|
@@ -19,8 +19,9 @@ export declare namespace WriteResult {
|
|
|
19
19
|
interface AttributeStatus {
|
|
20
20
|
kind: "attr-status";
|
|
21
21
|
path: ConcreteAttributePath;
|
|
22
|
-
status:
|
|
22
|
+
status: Status;
|
|
23
23
|
clusterStatus?: number;
|
|
24
24
|
}
|
|
25
|
+
function assertSuccess(result: AttributeStatus[]): void;
|
|
25
26
|
}
|
|
26
27
|
//# sourceMappingURL=WriteResult.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WriteResult.d.ts","sourceRoot":"","sources":["../../../../src/action/response/WriteResult.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"WriteResult.d.ts","sourceRoot":"","sources":["../../../../src/action/response/WriteResult.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAKjD,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAExH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,IAAI,OAAO,CACtD,CAAC,SAAS;IAAE,gBAAgB,EAAE,IAAI,CAAA;CAAE,GAAG,IAAI,GAAG,WAAW,CAAC,eAAe,EAAE,CAC9E,CAAC;AAEF,yBAAiB,WAAW,CAAC;IACzB,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;QACzB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAC7B;IAED,UAAiB,eAAe;QAC5B,IAAI,EAAE,aAAa,CAAC;QACpB,IAAI,EAAE,qBAAqB,CAAC;QAC5B,MAAM,EAAE,MAAM,CAAC;QACf,aAAa,CAAC,EAAE,MAAM,CAAC;KAC1B;IAED,SAAgB,aAAa,CAAC,MAAM,EAAE,eAAe,EAAE,QAkBtD;CACJ"}
|
|
@@ -3,6 +3,10 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
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
|
+
};
|
|
6
10
|
var __copyProps = (to, from, except, desc) => {
|
|
7
11
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
12
|
for (let key of __getOwnPropNames(from))
|
|
@@ -13,10 +17,36 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
13
17
|
};
|
|
14
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
19
|
var WriteResult_exports = {};
|
|
20
|
+
__export(WriteResult_exports, {
|
|
21
|
+
WriteResult: () => WriteResult
|
|
22
|
+
});
|
|
16
23
|
module.exports = __toCommonJS(WriteResult_exports);
|
|
24
|
+
var import_ExpandedPath = require("#common/ExpandedPath.js");
|
|
25
|
+
var import_ExpandedStatus = require("#common/ExpandedStatus.js");
|
|
26
|
+
var import_PathError = require("#common/PathError.js");
|
|
27
|
+
var import_general = require("#general");
|
|
28
|
+
var import_types = require("#types");
|
|
17
29
|
/**
|
|
18
30
|
* @license
|
|
19
31
|
* Copyright 2022-2025 Matter.js Authors
|
|
20
32
|
* SPDX-License-Identifier: Apache-2.0
|
|
21
33
|
*/
|
|
34
|
+
var WriteResult;
|
|
35
|
+
((WriteResult2) => {
|
|
36
|
+
function assertSuccess(result) {
|
|
37
|
+
const errors = result.filter((attr) => attr.status !== import_types.Status.Success).map((attr) => {
|
|
38
|
+
const path = (0, import_ExpandedPath.ExpandedPath)({ ...attr, kind: "attribute" });
|
|
39
|
+
const status = new import_ExpandedStatus.ExpandedStatus(attr);
|
|
40
|
+
return new import_PathError.PathError({ path, status });
|
|
41
|
+
});
|
|
42
|
+
if (!errors.length) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (errors.length === 1) {
|
|
46
|
+
throw errors[0];
|
|
47
|
+
}
|
|
48
|
+
throw new import_general.MatterAggregateError(errors, "Multiple writes failed");
|
|
49
|
+
}
|
|
50
|
+
WriteResult2.assertSuccess = assertSuccess;
|
|
51
|
+
})(WriteResult || (WriteResult = {}));
|
|
22
52
|
//# sourceMappingURL=WriteResult.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/action/response/WriteResult.ts"],
|
|
4
|
-
"mappings": "
|
|
5
|
-
"names": []
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,0BAA6B;AAC7B,4BAA+B;AAC/B,uBAA0B;AAC1B,qBAAqC;AACrC,mBAA+G;AAX/G;AAAA;AAAA;AAAA;AAAA;AAiBO,IAAU;AAAA,CAAV,CAAUA,iBAAV;AAgBI,WAAS,cAAc,QAA2B;AACrD,UAAM,SAAS,OACV,OAAO,UAAQ,KAAK,WAAW,oBAAO,OAAO,EAC7C,IAAI,UAAQ;AACT,YAAM,WAAO,kCAAa,EAAE,GAAG,MAAM,MAAM,YAAY,CAAC;AACxD,YAAM,SAAS,IAAI,qCAAe,IAAI;AACtC,aAAO,IAAI,2BAAU,EAAE,MAAM,OAAO,CAAC;AAAA,IACzC,CAAC;AAEL,QAAI,CAAC,OAAO,QAAQ;AAChB;AAAA,IACJ;AAEA,QAAI,OAAO,WAAW,GAAG;AACrB,YAAM,OAAO,CAAC;AAAA,IAClB;AAEA,UAAM,IAAI,oCAAqB,QAAQ,wBAAwB;AAAA,EACnE;AAlBO,EAAAA,aAAS;AAAA,GAhBH;",
|
|
5
|
+
"names": ["WriteResult"]
|
|
6
6
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022-2025 Matter.js Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { DataModelPath, MatterModel } from "#model";
|
|
7
|
+
import { AttributePath, CommandPath, EventPath } from "#types";
|
|
8
|
+
/**
|
|
9
|
+
* Creates a {@link DataModelPath} from a Matter wire-format {@link AttributePath}, {@link EventPath}, or
|
|
10
|
+
* {@link CommandPath}.
|
|
11
|
+
*
|
|
12
|
+
* This is useful for creating human-readable diagnostics.
|
|
13
|
+
*/
|
|
14
|
+
export declare function ExpandedPath({ path, matter, base, kind }: ExpandedPath.Definition): DataModelPath;
|
|
15
|
+
export declare namespace ExpandedPath {
|
|
16
|
+
interface Definition {
|
|
17
|
+
path: AttributePath | EventPath | CommandPath;
|
|
18
|
+
matter?: MatterModel;
|
|
19
|
+
base?: DataModelPath | {
|
|
20
|
+
path: DataModelPath;
|
|
21
|
+
};
|
|
22
|
+
kind?: "attribute" | "command" | "event" | "entry";
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=ExpandedPath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpandedPath.d.ts","sourceRoot":"","sources":["../../../src/common/ExpandedPath.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAIH,aAAa,EAGb,WAAW,EAEd,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAE/D;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,YAAY,CAAC,UAAU,GAAG,aAAa,CAoDjG;AAED,yBAAiB,YAAY,CAAC;IAC1B,UAAiB,UAAU;QACvB,IAAI,EAAE,aAAa,GAAG,SAAS,GAAG,WAAW,CAAC;QAC9C,MAAM,CAAC,EAAE,WAAW,CAAC;QACrB,IAAI,CAAC,EAAE,aAAa,GAAG;YAAE,IAAI,EAAE,aAAa,CAAA;SAAE,CAAC;QAC/C,IAAI,CAAC,EAAE,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;KACtD;CACJ"}
|
|
@@ -0,0 +1,73 @@
|
|
|
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 ExpandedPath_exports = {};
|
|
20
|
+
__export(ExpandedPath_exports, {
|
|
21
|
+
ExpandedPath: () => ExpandedPath
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(ExpandedPath_exports);
|
|
24
|
+
var import_general = require("#general");
|
|
25
|
+
var import_model = require("#model");
|
|
26
|
+
/**
|
|
27
|
+
* @license
|
|
28
|
+
* Copyright 2022-2025 Matter.js Authors
|
|
29
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
30
|
+
*/
|
|
31
|
+
function ExpandedPath({ path, matter, base, kind }) {
|
|
32
|
+
if (matter === void 0) {
|
|
33
|
+
matter = import_model.Matter;
|
|
34
|
+
}
|
|
35
|
+
if (base && "path" in base) {
|
|
36
|
+
base = base.path;
|
|
37
|
+
}
|
|
38
|
+
const endpointIdent = path.endpointId ?? "*";
|
|
39
|
+
base = base ? base.at(endpointIdent, "endpoint") : (0, import_model.DataModelPath)(endpointIdent, "endpoint");
|
|
40
|
+
let cluster;
|
|
41
|
+
base = base.at(identityOf(matter, import_model.ClusterModel, path.clusterId), "cluster");
|
|
42
|
+
if ("attributeId" in path) {
|
|
43
|
+
base = base.at("state").at(identityOf(cluster, import_model.AttributeModel, path.attributeId));
|
|
44
|
+
if (path.listIndex) {
|
|
45
|
+
return base.at(path.listIndex, "entry");
|
|
46
|
+
}
|
|
47
|
+
return base;
|
|
48
|
+
}
|
|
49
|
+
if ("commandId" in path) {
|
|
50
|
+
return base.at(identityOf(cluster, import_model.CommandModel, path.commandId));
|
|
51
|
+
}
|
|
52
|
+
if ("eventId" in path) {
|
|
53
|
+
return base.at("events").at(identityOf(cluster, import_model.EventModel, path.eventId));
|
|
54
|
+
}
|
|
55
|
+
return base.at("*", kind ?? "element");
|
|
56
|
+
function identityOf(parent, type, id) {
|
|
57
|
+
if (id === void 0) {
|
|
58
|
+
return "*";
|
|
59
|
+
}
|
|
60
|
+
const instance = parent?.get(type, id);
|
|
61
|
+
if (instance === void 0) {
|
|
62
|
+
if (typeof id === "string") {
|
|
63
|
+
return (0, import_general.camelize)(id);
|
|
64
|
+
}
|
|
65
|
+
return id;
|
|
66
|
+
}
|
|
67
|
+
if (type === import_model.ClusterModel) {
|
|
68
|
+
cluster = instance;
|
|
69
|
+
}
|
|
70
|
+
return (0, import_general.camelize)(instance.name);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=ExpandedPath.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/common/ExpandedPath.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,qBAAyB;AACzB,mBASO;AAhBP;AAAA;AAAA;AAAA;AAAA;AAyBO,SAAS,aAAa,EAAE,MAAM,QAAQ,MAAM,KAAK,GAA2C;AAC/F,MAAI,WAAW,QAAW;AACtB,aAAS;AAAA,EACb;AAEA,MAAI,QAAQ,UAAU,MAAM;AACxB,WAAO,KAAK;AAAA,EAChB;AAEA,QAAM,gBAAgB,KAAK,cAAc;AACzC,SAAO,OAAO,KAAK,GAAG,eAAe,UAAU,QAAI,4BAAc,eAAe,UAAU;AAE1F,MAAI;AACJ,SAAO,KAAK,GAAG,WAAW,QAAQ,2BAAc,KAAK,SAAS,GAAG,SAAS;AAE1E,MAAI,iBAAiB,MAAM;AACvB,WAAO,KAAK,GAAG,OAAO,EAAE,GAAG,WAAW,SAAS,6BAAgB,KAAK,WAAW,CAAC;AAChF,QAAI,KAAK,WAAW;AAChB,aAAO,KAAK,GAAG,KAAK,WAAW,OAAO;AAAA,IAC1C;AACA,WAAO;AAAA,EACX;AAEA,MAAI,eAAe,MAAM;AACrB,WAAO,KAAK,GAAG,WAAW,SAAS,2BAAc,KAAK,SAAS,CAAC;AAAA,EACpE;AAEA,MAAI,aAAa,MAAM;AACnB,WAAO,KAAK,GAAG,QAAQ,EAAE,GAAG,WAAW,SAAS,yBAAY,KAAK,OAAO,CAAC;AAAA,EAC7E;AAEA,SAAO,KAAK,GAAG,KAAK,QAAQ,SAAS;AAErC,WAAS,WAAW,QAA2B,MAAkB,IAAiC;AAC9F,QAAI,OAAO,QAAW;AAClB,aAAO;AAAA,IACX;AAEA,UAAM,WAAW,QAAQ,IAAI,MAAM,EAAE;AACrC,QAAI,aAAa,QAAW;AACxB,UAAI,OAAO,OAAO,UAAU;AACxB,mBAAO,yBAAS,EAAE;AAAA,MACtB;AACA,aAAO;AAAA,IACX;AAEA,QAAI,SAAS,2BAAc;AACvB,gBAAU;AAAA,IACd;AAEA,eAAO,yBAAS,SAAS,IAAI;AAAA,EACjC;AACJ;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022-2025 Matter.js Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { ClusterModel, MatterModel } from "#model";
|
|
7
|
+
import { ClusterId, Status } from "#types";
|
|
8
|
+
/**
|
|
9
|
+
* Detailed status information expanded from status codes.
|
|
10
|
+
*
|
|
11
|
+
* TODO - maybe update codegen to include description in operational models so we can use as detailed error message
|
|
12
|
+
*/
|
|
13
|
+
export declare class ExpandedStatus {
|
|
14
|
+
id: string;
|
|
15
|
+
status: Status;
|
|
16
|
+
clusterStatus?: number;
|
|
17
|
+
constructor({ matter, status, cluster, clusterStatus }: ExpandedStatus.Definition);
|
|
18
|
+
}
|
|
19
|
+
export declare namespace ExpandedStatus {
|
|
20
|
+
interface Definition {
|
|
21
|
+
matter?: MatterModel;
|
|
22
|
+
status?: Status;
|
|
23
|
+
cluster?: ClusterModel | ClusterId;
|
|
24
|
+
clusterStatus?: number;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=ExpandedStatus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpandedStatus.d.ts","sourceRoot":"","sources":["../../../src/common/ExpandedStatus.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,YAAY,EAAU,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE3C;;;;GAIG;AACH,qBAAa,cAAc;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;gBAEX,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,EAAE,cAAc,CAAC,UAAU;CAyCpF;AAED,yBAAiB,cAAc,CAAC;IAC5B,UAAiB,UAAU;QACvB,MAAM,CAAC,EAAE,WAAW,CAAC;QACrB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;QACnC,aAAa,CAAC,EAAE,MAAM,CAAC;KAC1B;CACJ"}
|
|
@@ -0,0 +1,73 @@
|
|
|
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 ExpandedStatus_exports = {};
|
|
20
|
+
__export(ExpandedStatus_exports, {
|
|
21
|
+
ExpandedStatus: () => ExpandedStatus
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(ExpandedStatus_exports);
|
|
24
|
+
var import_general = require("#general");
|
|
25
|
+
var import_model = require("#model");
|
|
26
|
+
var import_types = require("#types");
|
|
27
|
+
/**
|
|
28
|
+
* @license
|
|
29
|
+
* Copyright 2022-2025 Matter.js Authors
|
|
30
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
31
|
+
*/
|
|
32
|
+
class ExpandedStatus {
|
|
33
|
+
id;
|
|
34
|
+
status;
|
|
35
|
+
clusterStatus;
|
|
36
|
+
constructor({ matter, status, cluster, clusterStatus }) {
|
|
37
|
+
this.status = status ?? import_types.Status.Failure;
|
|
38
|
+
this.clusterStatus = clusterStatus;
|
|
39
|
+
let statusStr;
|
|
40
|
+
if (status !== import_types.Status.Failure) {
|
|
41
|
+
const name = import_types.Status[this.status];
|
|
42
|
+
if (name === void 0) {
|
|
43
|
+
statusStr = `unknown-${this.status}`;
|
|
44
|
+
} else {
|
|
45
|
+
statusStr = (0, import_general.decamelize)(name);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (clusterStatus === void 0) {
|
|
49
|
+
this.id = statusStr ?? "failure";
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
let clusterStr;
|
|
53
|
+
if (typeof cluster === "number") {
|
|
54
|
+
matter ??= import_model.Matter;
|
|
55
|
+
const model = matter.get(import_model.ClusterModel, cluster);
|
|
56
|
+
if (model === void 0) {
|
|
57
|
+
clusterStr = `cluster-${cluster}`;
|
|
58
|
+
} else {
|
|
59
|
+
clusterStr = (0, import_general.decamelize)(model.name);
|
|
60
|
+
}
|
|
61
|
+
} else if (cluster) {
|
|
62
|
+
clusterStr = (0, import_general.decamelize)(cluster.name);
|
|
63
|
+
} else {
|
|
64
|
+
clusterStr = "unknown-cluster";
|
|
65
|
+
}
|
|
66
|
+
if (statusStr === void 0) {
|
|
67
|
+
this.id = clusterStr;
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
this.id = `${statusStr}+${clusterStr}`;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=ExpandedStatus.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/common/ExpandedStatus.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,qBAA2B;AAC3B,mBAAkD;AAClD,mBAAkC;AARlC;AAAA;AAAA;AAAA;AAAA;AAeO,MAAM,eAAe;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EAEA,YAAY,EAAE,QAAQ,QAAQ,SAAS,cAAc,GAA8B;AAC/E,SAAK,SAAS,UAAU,oBAAO;AAC/B,SAAK,gBAAgB;AAErB,QAAI;AACJ,QAAI,WAAW,oBAAO,SAAS;AAC3B,YAAM,OAAO,oBAAO,KAAK,MAAM;AAC/B,UAAI,SAAS,QAAW;AACpB,oBAAY,WAAW,KAAK,MAAM;AAAA,MACtC,OAAO;AACH,wBAAY,2BAAW,IAAI;AAAA,MAC/B;AAAA,IACJ;AAEA,QAAI,kBAAkB,QAAW;AAC7B,WAAK,KAAK,aAAa;AACvB;AAAA,IACJ;AAEA,QAAI;AACJ,QAAI,OAAO,YAAY,UAAU;AAC7B,iBAAW;AACX,YAAM,QAAQ,OAAO,IAAI,2BAAc,OAAO;AAC9C,UAAI,UAAU,QAAW;AACrB,qBAAa,WAAW,OAAO;AAAA,MACnC,OAAO;AACH,yBAAa,2BAAW,MAAM,IAAI;AAAA,MACtC;AAAA,IACJ,WAAW,SAAS;AAChB,uBAAa,2BAAW,QAAQ,IAAI;AAAA,IACxC,OAAO;AACH,mBAAa;AAAA,IACjB;AAEA,QAAI,cAAc,QAAW;AACzB,WAAK,KAAK;AACV;AAAA,IACJ;AAEA,SAAK,KAAK,GAAG,SAAS,IAAI,UAAU;AAAA,EACxC;AACJ;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022-2025 Matter.js Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { ExpandedStatus } from "#common/ExpandedStatus.js";
|
|
7
|
+
import { MatterAggregateError } from "#general";
|
|
8
|
+
import { DataModelPath } from "#model";
|
|
9
|
+
import { StatusResponseError } from "#types";
|
|
10
|
+
/**
|
|
11
|
+
* A protocol error associated with a specific data model path.
|
|
12
|
+
*/
|
|
13
|
+
export declare class PathError extends StatusResponseError {
|
|
14
|
+
#private;
|
|
15
|
+
constructor({ path, status: { id, status, clusterStatus }, message }: PathError.Definition);
|
|
16
|
+
get id(): string;
|
|
17
|
+
get path(): DataModelPath;
|
|
18
|
+
}
|
|
19
|
+
export declare namespace PathError {
|
|
20
|
+
interface Definition {
|
|
21
|
+
path: DataModelPath;
|
|
22
|
+
status: ExpandedStatus;
|
|
23
|
+
message?: string;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export declare class AggregatePathError extends MatterAggregateError {
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=PathError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PathError.d.ts","sourceRoot":"","sources":["../../../src/common/PathError.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAoC,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAE7C;;GAEG;AACH,qBAAa,SAAU,SAAQ,mBAAmB;;gBAIlC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,OAAO,EAAE,EAAE,SAAS,CAAC,UAAU;IAU1F,IAAa,EAAE,WAEd;IAED,IAAI,IAAI,kBAEP;CACJ;AAED,yBAAiB,SAAS,CAAC;IACvB,UAAiB,UAAU;QACvB,IAAI,EAAE,aAAa,CAAC;QACpB,MAAM,EAAE,cAAc,CAAC;QACvB,OAAO,CAAC,EAAE,MAAM,CAAC;KACpB;CACJ;AAED,qBAAa,kBAAmB,SAAQ,oBAAoB;CAAG"}
|
|
@@ -0,0 +1,52 @@
|
|
|
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 PathError_exports = {};
|
|
20
|
+
__export(PathError_exports, {
|
|
21
|
+
AggregatePathError: () => AggregatePathError,
|
|
22
|
+
PathError: () => PathError
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(PathError_exports);
|
|
25
|
+
var import_general = require("#general");
|
|
26
|
+
var import_types = require("#types");
|
|
27
|
+
/**
|
|
28
|
+
* @license
|
|
29
|
+
* Copyright 2022-2025 Matter.js Authors
|
|
30
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
31
|
+
*/
|
|
32
|
+
class PathError extends import_types.StatusResponseError {
|
|
33
|
+
#id;
|
|
34
|
+
#path;
|
|
35
|
+
constructor({ path, status: { id, status, clusterStatus }, message }) {
|
|
36
|
+
if (message === void 0) {
|
|
37
|
+
message = (0, import_general.capitalize)((0, import_general.decamelize)((0, import_general.camelize)(id), " "));
|
|
38
|
+
}
|
|
39
|
+
super(message, status, clusterStatus);
|
|
40
|
+
this.#id = id;
|
|
41
|
+
this.#path = path;
|
|
42
|
+
}
|
|
43
|
+
get id() {
|
|
44
|
+
return this.#id;
|
|
45
|
+
}
|
|
46
|
+
get path() {
|
|
47
|
+
return this.#path;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
class AggregatePathError extends import_general.MatterAggregateError {
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=PathError.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/common/PathError.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,qBAAuE;AAEvE,mBAAoC;AATpC;AAAA;AAAA;AAAA;AAAA;AAcO,MAAM,kBAAkB,iCAAoB;AAAA,EAC/C;AAAA,EACA;AAAA,EAEA,YAAY,EAAE,MAAM,QAAQ,EAAE,IAAI,QAAQ,cAAc,GAAG,QAAQ,GAAyB;AACxF,QAAI,YAAY,QAAW;AACvB,oBAAU,+BAAW,+BAAW,yBAAS,EAAE,GAAG,GAAG,CAAC;AAAA,IACtD;AAEA,UAAM,SAAS,QAAQ,aAAa;AACpC,SAAK,MAAM;AACX,SAAK,QAAQ;AAAA,EACjB;AAAA,EAEA,IAAa,KAAK;AACd,WAAO,KAAK;AAAA,EAChB;AAAA,EAEA,IAAI,OAAO;AACP,WAAO,KAAK;AAAA,EAChB;AACJ;AAUO,MAAM,2BAA2B,oCAAqB;AAAC;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,cAAc,CAAC"}
|
package/dist/cjs/common/index.js
CHANGED
|
@@ -16,6 +16,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
16
16
|
var common_exports = {};
|
|
17
17
|
module.exports = __toCommonJS(common_exports);
|
|
18
18
|
__reExport(common_exports, require("../peer/PeerAddress.js"), module.exports);
|
|
19
|
+
__reExport(common_exports, require("./ExpandedPath.js"), module.exports);
|
|
19
20
|
__reExport(common_exports, require("./FailsafeContext.js"), module.exports);
|
|
20
21
|
__reExport(common_exports, require("./FailsafeTimer.js"), module.exports);
|
|
21
22
|
__reExport(common_exports, require("./InstanceBroadcaster.js"), module.exports);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/common/index.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAMA,2BAAc,mCANd;AAOA,2BAAc,
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAMA,2BAAc,mCANd;AAOA,2BAAc,8BAPd;AAQA,2BAAc,iCARd;AASA,2BAAc,+BATd;AAUA,2BAAc,qCAVd;AAWA,2BAAc,6CAXd;AAYA,2BAAc,yBAZd;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -4,43 +4,43 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { Schema, SchemaErrorPath } from "#model";
|
|
7
|
-
import {
|
|
7
|
+
import { Status, StatusResponseError } from "#types";
|
|
8
8
|
export { SchemaImplementationError } from "#model";
|
|
9
9
|
/**
|
|
10
10
|
* Thrown due operational schema violations.
|
|
11
11
|
*/
|
|
12
12
|
export declare class SchemaViolationError extends StatusResponseError {
|
|
13
|
-
constructor(prefix: string, path: SchemaErrorPath, message: string, code:
|
|
13
|
+
constructor(prefix: string, path: SchemaErrorPath, message: string, code: Status);
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* Thrown for invalid reads.
|
|
17
17
|
*/
|
|
18
18
|
export declare class ReadError extends SchemaViolationError {
|
|
19
|
-
constructor(path: SchemaErrorPath, message: string, code?:
|
|
19
|
+
constructor(path: SchemaErrorPath, message: string, code?: Status);
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Thrown for invalid writes.
|
|
23
23
|
*/
|
|
24
24
|
export declare class WriteError extends SchemaViolationError {
|
|
25
|
-
constructor(path: SchemaErrorPath, message: string, code?:
|
|
25
|
+
constructor(path: SchemaErrorPath, message: string, code?: Status);
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* Thrown for invalid invokes.
|
|
29
29
|
*/
|
|
30
30
|
export declare class InvokeError extends SchemaViolationError {
|
|
31
|
-
constructor(path: SchemaErrorPath, message: string, code?:
|
|
31
|
+
constructor(path: SchemaErrorPath, message: string, code?: Status);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* Thrown when validation fails.
|
|
35
35
|
*/
|
|
36
36
|
export declare class ValidateError extends SchemaViolationError {
|
|
37
|
-
constructor(path: SchemaErrorPath, message: string, code?:
|
|
37
|
+
constructor(path: SchemaErrorPath, message: string, code?: Status);
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
40
|
* Thrown when a value is of the wrong datatype.
|
|
41
41
|
*/
|
|
42
42
|
export declare class DatatypeError extends ValidateError {
|
|
43
|
-
constructor(path: SchemaErrorPath, type: string, value: unknown, code?:
|
|
43
|
+
constructor(path: SchemaErrorPath, type: string, value: unknown, code?: Status);
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
46
|
* Thrown when constraint is violated.
|