@lakutata/dbus 2.3.0 → 3.0.0-beta.0

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.
Files changed (81) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +253 -25
  3. package/dist/cjs/adapters/DBusEntrypoint.d.ts +89 -0
  4. package/dist/cjs/adapters/DBusEntrypoint.js +280 -0
  5. package/dist/cjs/channel/DBusChannel.d.ts +36 -0
  6. package/dist/cjs/channel/DBusChannel.js +70 -0
  7. package/dist/cjs/components/DBusClientComponent.d.ts +494 -0
  8. package/dist/cjs/components/DBusClientComponent.js +272 -0
  9. package/dist/cjs/components/DBusObjectManager.d.ts +164 -0
  10. package/dist/cjs/components/DBusObjectManager.js +200 -0
  11. package/dist/cjs/context/DBusContext.d.ts +52 -0
  12. package/dist/cjs/context/DBusContext.js +68 -0
  13. package/dist/cjs/decorators/DBusInterface.d.ts +74 -0
  14. package/dist/cjs/decorators/DBusInterface.js +63 -0
  15. package/dist/cjs/decorators/DBusMethod.d.ts +115 -0
  16. package/dist/cjs/decorators/DBusMethod.js +20 -0
  17. package/dist/cjs/exports/DBus.d.ts +11 -0
  18. package/dist/cjs/exports/DBus.js +42 -0
  19. package/dist/cjs/lib/DBusClientOptions.d.ts +30 -0
  20. package/dist/cjs/lib/Declarations.d.ts +187 -0
  21. package/dist/cjs/lib/Declarations.js +113 -0
  22. package/dist/cjs/lib/Names.d.ts +35 -0
  23. package/dist/cjs/lib/Names.js +80 -0
  24. package/dist/cjs/lib/Signature.d.ts +14 -0
  25. package/dist/cjs/lib/Signature.js +53 -0
  26. package/dist/cjs/package.json +1 -0
  27. package/dist/cjs/types/DBusContextParams.d.ts +22 -0
  28. package/dist/cjs/types/DBusContextParams.js +2 -0
  29. package/dist/esm/adapters/DBusEntrypoint.js +274 -0
  30. package/dist/esm/channel/DBusChannel.js +67 -0
  31. package/dist/esm/components/DBusClientComponent.js +267 -0
  32. package/dist/esm/components/DBusObjectManager.js +197 -0
  33. package/dist/esm/context/DBusContext.js +64 -0
  34. package/dist/esm/decorators/DBusInterface.js +60 -0
  35. package/dist/esm/decorators/DBusMethod.js +17 -0
  36. package/dist/esm/exports/DBus.js +12 -0
  37. package/dist/esm/lib/DBusClientOptions.js +1 -0
  38. package/dist/esm/lib/Declarations.js +107 -0
  39. package/dist/esm/lib/Names.js +73 -0
  40. package/dist/esm/lib/Signature.js +49 -0
  41. package/dist/esm/types/DBusContextParams.js +1 -0
  42. package/dist/types/adapters/DBusEntrypoint.d.ts +89 -0
  43. package/dist/types/channel/DBusChannel.d.ts +36 -0
  44. package/dist/types/components/DBusClientComponent.d.ts +494 -0
  45. package/dist/types/components/DBusObjectManager.d.ts +164 -0
  46. package/dist/types/context/DBusContext.d.ts +52 -0
  47. package/dist/types/decorators/DBusInterface.d.ts +74 -0
  48. package/dist/types/decorators/DBusMethod.d.ts +115 -0
  49. package/dist/types/exports/DBus.d.ts +11 -0
  50. package/dist/types/lib/DBusClientOptions.d.ts +30 -0
  51. package/dist/types/lib/Declarations.d.ts +187 -0
  52. package/dist/types/lib/Names.d.ts +35 -0
  53. package/dist/types/lib/Signature.d.ts +14 -0
  54. package/dist/types/types/DBusContextParams.d.ts +22 -0
  55. package/package.json +38 -39
  56. package/CHANGELOG.md +0 -145
  57. package/dist/CommonExports.d.ts +0 -2
  58. package/dist/CommonExports.d.ts.map +0 -1
  59. package/dist/CommonExports.js +0 -44
  60. package/dist/ComponentExports.d.ts +0 -2
  61. package/dist/ComponentExports.d.ts.map +0 -1
  62. package/dist/ComponentExports.js +0 -5
  63. package/dist/ProviderExports.d.ts +0 -2
  64. package/dist/ProviderExports.d.ts.map +0 -1
  65. package/dist/ProviderExports.js +0 -5
  66. package/dist/components/DBusClientComponent.d.ts +0 -75
  67. package/dist/components/DBusClientComponent.d.ts.map +0 -1
  68. package/dist/components/DBusClientComponent.js +0 -125
  69. package/dist/interfaces/DBusClientOptions.d.ts +0 -7
  70. package/dist/interfaces/DBusClientOptions.d.ts.map +0 -1
  71. package/dist/providers/DBusClientProvider.d.ts +0 -75
  72. package/dist/providers/DBusClientProvider.d.ts.map +0 -1
  73. package/dist/providers/DBusClientProvider.js +0 -125
  74. package/dist/tests/DBusTest.spec.d.ts +0 -2
  75. package/dist/tests/DBusTest.spec.d.ts.map +0 -1
  76. package/dist/tests/DBusTest.spec.js +0 -26
  77. package/dist/tests/Test.d.ts +0 -9
  78. package/dist/tests/Test.d.ts.map +0 -1
  79. package/dist/tests/Test.js +0 -80
  80. package/tsconfig.json +0 -7
  81. /package/dist/{interfaces → cjs/lib}/DBusClientOptions.js +0 -0
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Check the name of an interface
3
+ * @param name
4
+ */
5
+ export declare function checkInterfaceName(name: string): string;
6
+ /**
7
+ * Check the name of a member
8
+ * @param name
9
+ * @param kind
10
+ */
11
+ export declare function checkMemberName(name: string, kind: string): string;
12
+ /**
13
+ * Check an object path, or a template of object paths
14
+ * @param path
15
+ */
16
+ export declare function checkPathTemplate(path: string): string;
17
+ /**
18
+ * A template of object paths
19
+ */
20
+ export type PathTemplate = {
21
+ readonly template: string;
22
+ readonly variables: string[];
23
+ readonly static: boolean;
24
+ match(path: string): Record<string, string> | undefined;
25
+ };
26
+ /**
27
+ * Compile a template of object paths
28
+ * @param template
29
+ */
30
+ export declare function compilePathTemplate(template: string): PathTemplate;
31
+ /**
32
+ * The name of the DBus error of an exception: its errno, or its name
33
+ * @param error
34
+ */
35
+ export declare function errorName(error: unknown): string;
@@ -0,0 +1,14 @@
1
+ import { DTO, type Schema } from '@lakutata/core';
2
+ /**
3
+ * The DBus signature of the values of a schema: an object is a dictionary of variants,
4
+ * the scalars have their own types, the other values are variants
5
+ * @param schema
6
+ */
7
+ export declare function schemaSignature(schema: Schema | typeof DTO): string;
8
+ /**
9
+ * A value ready to be encoded: the dates are ISO strings, the undefined and null values are removed (a variant has no null);
10
+ * the typed values of dbus-sdk (`DBusUInt32`, `DBusVariant`…) are kept as they are, a Map keeps its entries (its keys
11
+ * keep their types)
12
+ * @param value
13
+ */
14
+ export declare function toEncodable(value: unknown): unknown;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The parameters of a {@link DBusContext}: the adapter builds them for each method call it receives. An application
3
+ * builds them only to create a context itself, in a test of a controller.
4
+ */
5
+ export type DBusContextParams = {
6
+ /**
7
+ * The object path of the method call (`'/com/example/Devices/A1'`), the variables of its template resolved.
8
+ */
9
+ readonly path: string;
10
+ /**
11
+ * The name of the interface called (`'com.example.Device'`).
12
+ */
13
+ readonly interface: string;
14
+ /**
15
+ * The name of the method called (`'Status'`).
16
+ */
17
+ readonly member: string;
18
+ /**
19
+ * The input of the call: the entries of its `a{sv}` dictionary, an empty object for a method without input.
20
+ */
21
+ readonly data: Record<string, any>;
22
+ };
package/package.json CHANGED
@@ -1,51 +1,50 @@
1
1
  {
2
2
  "name": "@lakutata/dbus",
3
- "version": "2.3.0",
4
- "description": "Lakutata DBus SDK",
5
- "keywords": [
6
- "lakutata",
7
- "dbus",
8
- "sdk"
9
- ],
10
- "author": "myq1991 <myq1991@gmail.com>",
11
- "homepage": "https://github.com/lakutata/lakutata-packages",
12
- "license": "MIT",
3
+ "version": "3.0.0-beta.0",
4
+ "description": "The DBus channel of the lakutata framework: controller actions served as the methods, properties and signals of DBus objects, and the DBus client component.",
5
+ "type": "module",
6
+ "main": "./dist/cjs/exports/DBus.js",
7
+ "types": "./dist/cjs/exports/DBus.d.ts",
13
8
  "exports": {
14
9
  ".": {
15
- "types": "./dist/CommonExports.d.ts",
16
- "require": "./dist/CommonExports.js"
17
- },
18
- "./com": {
19
- "types": "./dist/ComponentExports.d.ts",
20
- "require": "./dist/ComponentExports.js"
10
+ "import": {
11
+ "types": "./dist/types/exports/DBus.d.ts",
12
+ "default": "./dist/esm/exports/DBus.js"
13
+ },
14
+ "require": {
15
+ "types": "./dist/cjs/exports/DBus.d.ts",
16
+ "default": "./dist/cjs/exports/DBus.js"
17
+ }
21
18
  },
22
- "./provider": {
23
- "types": "./dist/ProviderExports.d.ts",
24
- "require": "./dist/ProviderExports.js"
25
- }
26
- },
27
- "publishConfig": {
28
- "access": "public"
29
- },
30
- "repository": {
31
- "type": "git",
32
- "url": "git+https://github.com/lakutata/lakutata-packages.git"
19
+ "./package.json": "./package.json"
33
20
  },
34
21
  "scripts": {
35
- "clean": "shx rm -rf ./dist",
36
- "build": "tsc",
37
- "rebuild": "npm run clean && npm run build",
38
- "test": "bun src/tests/DBusTest.spec.ts"
39
- },
40
- "bugs": {
41
- "url": "https://github.com/lakutata/lakutata-packages/issues"
22
+ "clean": "node -e \"require('node:fs').rmSync('dist', {recursive: true, force: true})\"",
23
+ "build:cjs": "tsc -p tsconfig.cjs.json",
24
+ "build:esm": "tsc -p tsconfig.esm.json",
25
+ "build:cjs-pkg": "node ../../scripts/package-build/cjs-package.mjs",
26
+ "build:js": "npm run build:cjs && npm run build:esm && npm run build:cjs-pkg",
27
+ "rebuild": "npm run clean && npm run build:js",
28
+ "compile": "npm run rebuild",
29
+ "test:unit": "npm run compile && node --test \"dist/esm/tests/*.spec.js\""
42
30
  },
43
31
  "dependencies": {
44
- "dbus-sdk": "^1.0.16",
45
- "lakutata": "^2.0.119"
32
+ "dbus-sdk": "^2.0.1"
33
+ },
34
+ "peerDependencies": {
35
+ "@lakutata/core": "3.0.0-beta.0",
36
+ "@lakutata/entrypoint": "3.0.0-beta.0"
46
37
  },
47
- "devDependencies": {
48
- "@types/degit": "^2.8.6"
38
+ "engines": {
39
+ "node": ">=22"
49
40
  },
50
- "gitHead": "1437a1996b23ce0459eb6468fa77b35bd0294acd"
41
+ "files": [
42
+ "dist",
43
+ "!dist/*/tests",
44
+ "*.md",
45
+ "LICENSE",
46
+ "package.json",
47
+ "THIRD_PARTY_NOTICES.md"
48
+ ],
49
+ "license": "MIT"
51
50
  }
package/CHANGELOG.md DELETED
@@ -1,145 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- # [2.3.0](https://github.com/lakutata/lakutata-packages/compare/@lakutata/dbus@2.2.0...@lakutata/dbus@2.3.0) (2026-01-16)
7
-
8
-
9
- ### Features
10
-
11
- * **nats:** add task provider and update NATS component ([3ec7114](https://github.com/lakutata/lakutata-packages/commit/3ec7114af0aed0e548728339b44d21bc42e0e210))
12
-
13
-
14
-
15
-
16
-
17
- # [2.2.0](https://github.com/lakutata/lakutata-packages/compare/@lakutata/dbus@2.1.13...@lakutata/dbus@2.2.0) (2025-12-27)
18
-
19
-
20
- ### Features
21
-
22
- * **nats:** add MessagePack codec and update dependencies ([9e229a9](https://github.com/lakutata/lakutata-packages/commit/9e229a98c74b77393c3dca26cc812564f49a326c))
23
-
24
-
25
-
26
-
27
-
28
- ## [2.1.13](https://github.com/lakutata/lakutata-packages/compare/@lakutata/dbus@2.1.12...@lakutata/dbus@2.1.13) (2025-12-13)
29
-
30
- **Note:** Version bump only for package @lakutata/dbus
31
-
32
-
33
-
34
-
35
-
36
- ## [2.1.12](https://github.com/lakutata/lakutata-packages/compare/@lakutata/dbus@2.1.11...@lakutata/dbus@2.1.12) (2025-12-13)
37
-
38
- **Note:** Version bump only for package @lakutata/dbus
39
-
40
-
41
-
42
-
43
-
44
- ## [2.1.11](https://github.com/lakutata/lakutata-packages/compare/@lakutata/dbus@2.1.10...@lakutata/dbus@2.1.11) (2025-12-13)
45
-
46
- **Note:** Version bump only for package @lakutata/dbus
47
-
48
-
49
-
50
-
51
-
52
- ## [2.1.10](https://github.com/lakutata/lakutata-packages/compare/@lakutata/dbus@2.1.9...@lakutata/dbus@2.1.10) (2025-12-13)
53
-
54
- **Note:** Version bump only for package @lakutata/dbus
55
-
56
-
57
-
58
-
59
-
60
- ## [2.1.9](https://github.com/lakutata/lakutata-packages/compare/@lakutata/dbus@2.1.8...@lakutata/dbus@2.1.9) (2025-12-13)
61
-
62
- **Note:** Version bump only for package @lakutata/dbus
63
-
64
-
65
-
66
-
67
-
68
- ## [2.1.8](https://github.com/lakutata/lakutata-packages/compare/@lakutata/dbus@2.1.7...@lakutata/dbus@2.1.8) (2025-12-13)
69
-
70
- **Note:** Version bump only for package @lakutata/dbus
71
-
72
-
73
-
74
-
75
-
76
- ## [2.1.7](https://github.com/lakutata/lakutata-packages/compare/@lakutata/dbus@2.1.6...@lakutata/dbus@2.1.7) (2025-12-13)
77
-
78
- **Note:** Version bump only for package @lakutata/dbus
79
-
80
-
81
-
82
-
83
-
84
- ## [2.1.6](https://github.com/lakutata/lakutata-packages/compare/@lakutata/dbus@2.1.5...@lakutata/dbus@2.1.6) (2025-12-13)
85
-
86
- **Note:** Version bump only for package @lakutata/dbus
87
-
88
-
89
-
90
-
91
-
92
- ## [2.1.5](https://github.com/lakutata/lakutata-packages/compare/@lakutata/dbus@2.1.4...@lakutata/dbus@2.1.5) (2025-12-13)
93
-
94
- **Note:** Version bump only for package @lakutata/dbus
95
-
96
-
97
-
98
-
99
-
100
- ## [2.1.4](https://github.com/lakutata/lakutata-packages/compare/@lakutata/dbus@2.1.4...@lakutata/dbus@2.1.4) (2025-12-13)
101
-
102
- **Note:** Version bump only for package @lakutata/dbus
103
-
104
-
105
-
106
-
107
-
108
- ## [2.1.4](https://github.com/lakutata/lakutata-packages/compare/@lakutata/dbus@2.1.3...@lakutata/dbus@2.1.4) (2025-12-13)
109
-
110
- **Note:** Version bump only for package @lakutata/dbus
111
-
112
-
113
-
114
-
115
-
116
- ## [2.1.3](https://github.com/lakutata/lakutata-packages/compare/@lakutata/dbus@2.1.2...@lakutata/dbus@2.1.3) (2025-11-23)
117
-
118
- **Note:** Version bump only for package @lakutata/dbus
119
-
120
-
121
-
122
-
123
-
124
- ## [2.1.2](https://github.com/lakutata/lakutata-packages/compare/@lakutata/dbus@2.1.1...@lakutata/dbus@2.1.2) (2025-11-21)
125
-
126
- **Note:** Version bump only for package @lakutata/dbus
127
-
128
-
129
-
130
-
131
-
132
- ## [2.1.1](https://github.com/lakutata/lakutata-packages/compare/@lakutata/dbus@2.1.0...@lakutata/dbus@2.1.1) (2025-08-06)
133
-
134
- **Note:** Version bump only for package @lakutata/dbus
135
-
136
-
137
-
138
-
139
-
140
- # 2.1.0 (2025-07-24)
141
-
142
-
143
- ### Features
144
-
145
- * **dbus:** add DBus SDK package with client provider and test setup ([0bc9cd9](https://github.com/lakutata/lakutata-packages/commit/0bc9cd9f99374a57f3250ee9f540ace18be67f9c))
@@ -1,2 +0,0 @@
1
- export { DBusInterface, DBusObject, DBusService, LocalInterface, LocalObject, LocalService, CreateDBusError, DBusBufferEncoder, DBusBufferDecoder, DBusMessage, DBusSignalEmitter, DBusSignedValue, Signature, DBusMessageEndianness, DBusMessageFlags, DBusMessageType, DBusPropertyAccess, RequestNameFlags, RequestNameResultCode, DBusArray, DBusBoolean, DBusByte, DBusDictEntry, DBusDouble, DBusInt16, DBusInt32, DBusInt64, DBusObjectPath, DBusSignature, DBusString, DBusStruct, DBusUint16, DBusUint32, DBusUint64, DBusUnixFD, DBusVariant, IntrospectableInterface, PeerInterface, ObjectManagerInterface, PropertiesInterface, type BusAddressConnectOpts, type BusNameBasicInfo, type ConnectOpts, type CreateConnectOpts, type CreateSignalEmitterOpts, type DataType, type Types, type DBusInterfaceOpts, type DBusMessageHeader, type DBusObjectOpts, type DBusServiceOpts, type DefineMethodArgumentOpts, type DefineMethodOpts, type DefinePropertyOpts, type emitPropertiesChangedOpts, type DefineSignalOpts, type EmitSignalOpts, type GetPropertyValueOpts, type HandshakeOpts, type IntrospectInterface, type IntrospectMethod, type IntrospectMethodArgument, type IntrospectNode, type IntrospectProperty, type IntrospectSignal, type IntrospectSignalArgument, type InvokeOpts, type NoReplyModeMethodCall, type PropertyOperation, type ReplyModeMethodCall, type ReplyOpts, type ServiceBasicInfo, type SetPropertyValueOpts, type SocketConnectOpts, type StreamConnectOpts, type TCPConnectOpts } from 'dbus-sdk';
2
- //# sourceMappingURL=CommonExports.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CommonExports.d.ts","sourceRoot":"","sources":["../src/CommonExports.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EACb,UAAU,EACV,WAAW,EACX,cAAc,EACd,WAAW,EACX,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,SAAS,EACT,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,SAAS,EACT,WAAW,EACX,QAAQ,EACR,aAAa,EACb,UAAU,EACV,SAAS,EACT,SAAS,EACT,SAAS,EACT,cAAc,EACd,aAAa,EACb,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,uBAAuB,EACvB,aAAa,EACb,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,QAAQ,EACb,KAAK,KAAK,EACV,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACtB,MAAM,UAAU,CAAA"}
@@ -1,44 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PropertiesInterface = exports.ObjectManagerInterface = exports.PeerInterface = exports.IntrospectableInterface = exports.DBusVariant = exports.DBusUnixFD = exports.DBusUint64 = exports.DBusUint32 = exports.DBusUint16 = exports.DBusStruct = exports.DBusString = exports.DBusSignature = exports.DBusObjectPath = exports.DBusInt64 = exports.DBusInt32 = exports.DBusInt16 = exports.DBusDouble = exports.DBusDictEntry = exports.DBusByte = exports.DBusBoolean = exports.DBusArray = exports.RequestNameResultCode = exports.RequestNameFlags = exports.DBusPropertyAccess = exports.DBusMessageType = exports.DBusMessageFlags = exports.DBusMessageEndianness = exports.Signature = exports.DBusSignedValue = exports.DBusSignalEmitter = exports.DBusMessage = exports.DBusBufferDecoder = exports.DBusBufferEncoder = exports.CreateDBusError = exports.LocalService = exports.LocalObject = exports.LocalInterface = exports.DBusService = exports.DBusObject = exports.DBusInterface = void 0;
4
- var dbus_sdk_1 = require("dbus-sdk");
5
- Object.defineProperty(exports, "DBusInterface", { enumerable: true, get: function () { return dbus_sdk_1.DBusInterface; } });
6
- Object.defineProperty(exports, "DBusObject", { enumerable: true, get: function () { return dbus_sdk_1.DBusObject; } });
7
- Object.defineProperty(exports, "DBusService", { enumerable: true, get: function () { return dbus_sdk_1.DBusService; } });
8
- Object.defineProperty(exports, "LocalInterface", { enumerable: true, get: function () { return dbus_sdk_1.LocalInterface; } });
9
- Object.defineProperty(exports, "LocalObject", { enumerable: true, get: function () { return dbus_sdk_1.LocalObject; } });
10
- Object.defineProperty(exports, "LocalService", { enumerable: true, get: function () { return dbus_sdk_1.LocalService; } });
11
- Object.defineProperty(exports, "CreateDBusError", { enumerable: true, get: function () { return dbus_sdk_1.CreateDBusError; } });
12
- Object.defineProperty(exports, "DBusBufferEncoder", { enumerable: true, get: function () { return dbus_sdk_1.DBusBufferEncoder; } });
13
- Object.defineProperty(exports, "DBusBufferDecoder", { enumerable: true, get: function () { return dbus_sdk_1.DBusBufferDecoder; } });
14
- Object.defineProperty(exports, "DBusMessage", { enumerable: true, get: function () { return dbus_sdk_1.DBusMessage; } });
15
- Object.defineProperty(exports, "DBusSignalEmitter", { enumerable: true, get: function () { return dbus_sdk_1.DBusSignalEmitter; } });
16
- Object.defineProperty(exports, "DBusSignedValue", { enumerable: true, get: function () { return dbus_sdk_1.DBusSignedValue; } });
17
- Object.defineProperty(exports, "Signature", { enumerable: true, get: function () { return dbus_sdk_1.Signature; } });
18
- Object.defineProperty(exports, "DBusMessageEndianness", { enumerable: true, get: function () { return dbus_sdk_1.DBusMessageEndianness; } });
19
- Object.defineProperty(exports, "DBusMessageFlags", { enumerable: true, get: function () { return dbus_sdk_1.DBusMessageFlags; } });
20
- Object.defineProperty(exports, "DBusMessageType", { enumerable: true, get: function () { return dbus_sdk_1.DBusMessageType; } });
21
- Object.defineProperty(exports, "DBusPropertyAccess", { enumerable: true, get: function () { return dbus_sdk_1.DBusPropertyAccess; } });
22
- Object.defineProperty(exports, "RequestNameFlags", { enumerable: true, get: function () { return dbus_sdk_1.RequestNameFlags; } });
23
- Object.defineProperty(exports, "RequestNameResultCode", { enumerable: true, get: function () { return dbus_sdk_1.RequestNameResultCode; } });
24
- Object.defineProperty(exports, "DBusArray", { enumerable: true, get: function () { return dbus_sdk_1.DBusArray; } });
25
- Object.defineProperty(exports, "DBusBoolean", { enumerable: true, get: function () { return dbus_sdk_1.DBusBoolean; } });
26
- Object.defineProperty(exports, "DBusByte", { enumerable: true, get: function () { return dbus_sdk_1.DBusByte; } });
27
- Object.defineProperty(exports, "DBusDictEntry", { enumerable: true, get: function () { return dbus_sdk_1.DBusDictEntry; } });
28
- Object.defineProperty(exports, "DBusDouble", { enumerable: true, get: function () { return dbus_sdk_1.DBusDouble; } });
29
- Object.defineProperty(exports, "DBusInt16", { enumerable: true, get: function () { return dbus_sdk_1.DBusInt16; } });
30
- Object.defineProperty(exports, "DBusInt32", { enumerable: true, get: function () { return dbus_sdk_1.DBusInt32; } });
31
- Object.defineProperty(exports, "DBusInt64", { enumerable: true, get: function () { return dbus_sdk_1.DBusInt64; } });
32
- Object.defineProperty(exports, "DBusObjectPath", { enumerable: true, get: function () { return dbus_sdk_1.DBusObjectPath; } });
33
- Object.defineProperty(exports, "DBusSignature", { enumerable: true, get: function () { return dbus_sdk_1.DBusSignature; } });
34
- Object.defineProperty(exports, "DBusString", { enumerable: true, get: function () { return dbus_sdk_1.DBusString; } });
35
- Object.defineProperty(exports, "DBusStruct", { enumerable: true, get: function () { return dbus_sdk_1.DBusStruct; } });
36
- Object.defineProperty(exports, "DBusUint16", { enumerable: true, get: function () { return dbus_sdk_1.DBusUint16; } });
37
- Object.defineProperty(exports, "DBusUint32", { enumerable: true, get: function () { return dbus_sdk_1.DBusUint32; } });
38
- Object.defineProperty(exports, "DBusUint64", { enumerable: true, get: function () { return dbus_sdk_1.DBusUint64; } });
39
- Object.defineProperty(exports, "DBusUnixFD", { enumerable: true, get: function () { return dbus_sdk_1.DBusUnixFD; } });
40
- Object.defineProperty(exports, "DBusVariant", { enumerable: true, get: function () { return dbus_sdk_1.DBusVariant; } });
41
- Object.defineProperty(exports, "IntrospectableInterface", { enumerable: true, get: function () { return dbus_sdk_1.IntrospectableInterface; } });
42
- Object.defineProperty(exports, "PeerInterface", { enumerable: true, get: function () { return dbus_sdk_1.PeerInterface; } });
43
- Object.defineProperty(exports, "ObjectManagerInterface", { enumerable: true, get: function () { return dbus_sdk_1.ObjectManagerInterface; } });
44
- Object.defineProperty(exports, "PropertiesInterface", { enumerable: true, get: function () { return dbus_sdk_1.PropertiesInterface; } });
@@ -1,2 +0,0 @@
1
- export { DBusClientComponent } from './components/DBusClientComponent';
2
- //# sourceMappingURL=ComponentExports.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ComponentExports.d.ts","sourceRoot":"","sources":["../src/ComponentExports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,kCAAkC,CAAA"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DBusClientComponent = void 0;
4
- var DBusClientComponent_1 = require("./components/DBusClientComponent");
5
- Object.defineProperty(exports, "DBusClientComponent", { enumerable: true, get: function () { return DBusClientComponent_1.DBusClientComponent; } });
@@ -1,2 +0,0 @@
1
- export { DBusClientProvider } from './providers/DBusClientProvider';
2
- //# sourceMappingURL=ProviderExports.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ProviderExports.d.ts","sourceRoot":"","sources":["../src/ProviderExports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAA"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DBusClientProvider = void 0;
4
- var DBusClientProvider_1 = require("./providers/DBusClientProvider");
5
- Object.defineProperty(exports, "DBusClientProvider", { enumerable: true, get: function () { return DBusClientProvider_1.DBusClientProvider; } });
@@ -1,75 +0,0 @@
1
- import { BusNameBasicInfo, DBus, DBusInterface, DBusMessage, DBusObject, DBusService, DBusSignalEmitter, InvokeOpts, ServiceBasicInfo } from 'dbus-sdk';
2
- import { Component, ProviderOptionsBuilder } from 'lakutata';
3
- import { DBusClientOptions } from '../interfaces/DBusClientOptions';
4
- export declare const buildDBusClientOptions: ProviderOptionsBuilder<DBusClientOptions>;
5
- export declare class DBusClientComponent extends Component {
6
- protected readonly busAddress: string;
7
- protected readonly timeout: number;
8
- protected readonly advancedResponse: boolean;
9
- protected readonly convertBigIntToNumber: boolean;
10
- protected dbus: DBus;
11
- get uniqueName(): string;
12
- /**
13
- * Initializer
14
- * @protected
15
- */
16
- protected init(): Promise<void>;
17
- /**
18
- * Destroyer
19
- * @protected
20
- */
21
- protected destroy(): Promise<void>;
22
- invoke(opts: InvokeOpts, noReply: true): void;
23
- invoke(opts: InvokeOpts, noReply: false): Promise<any[]>;
24
- invoke(opts: InvokeOpts): Promise<any[]>;
25
- on(eventName: 'online', listener: (name: string) => void): this;
26
- on(eventName: 'offline', listener: (name: string) => void): this;
27
- on(eventName: 'replaced', listener: (name: string) => void): this;
28
- on(eventName: 'methodCall', listener: (message: DBusMessage) => void): this;
29
- on(eventName: 'NameOwnerChanged', listener: (name: string, oldOwner: string, newOwner: string) => void): this;
30
- on(eventName: 'NameLost', listener: (name: string) => void): this;
31
- on(eventName: 'NameAcquired', listener: (name: string) => void): this;
32
- on(eventName: 'connectionClose', listener: () => void): this;
33
- on(eventName: 'connectionError', listener: (error: Error) => void): this;
34
- once(eventName: 'online', listener: (name: string) => void): this;
35
- once(eventName: 'offline', listener: (name: string) => void): this;
36
- once(eventName: 'replaced', listener: (name: string) => void): this;
37
- once(eventName: 'methodCall', listener: (message: DBusMessage) => void): this;
38
- once(eventName: 'NameOwnerChanged', listener: (name: string, oldOwner: string, newOwner: string) => void): this;
39
- once(eventName: 'NameLost', listener: (name: string) => void): this;
40
- once(eventName: 'NameAcquired', listener: (name: string) => void): this;
41
- once(eventName: 'connectionClose', listener: () => void): this;
42
- once(eventName: 'connectionError', listener: (error: Error) => void): this;
43
- off(eventName: 'online', listener: (name: string) => void): this;
44
- off(eventName: 'offline', listener: (name: string) => void): this;
45
- off(eventName: 'replaced', listener: (name: string) => void): this;
46
- off(eventName: 'methodCall', listener: (message: DBusMessage) => void): this;
47
- off(eventName: 'NameOwnerChanged', listener: (name: string, oldOwner: string, newOwner: string) => void): this;
48
- off(eventName: 'NameLost', listener: (name: string) => void): this;
49
- off(eventName: 'NameAcquired', listener: (name: string) => void): this;
50
- off(eventName: 'connectionClose', listener: () => void): this;
51
- off(eventName: 'connectionError', listener: (error: Error) => void): this;
52
- removeListener(eventName: 'online', listener: (name: string) => void): this;
53
- removeListener(eventName: 'offline', listener: (name: string) => void): this;
54
- removeListener(eventName: 'replaced', listener: (name: string) => void): this;
55
- removeListener(eventName: 'methodCall', listener: (message: DBusMessage) => void): this;
56
- removeListener(eventName: 'NameOwnerChanged', listener: (name: string, oldOwner: string, newOwner: string) => void): this;
57
- removeListener(eventName: 'NameLost', listener: (name: string) => void): this;
58
- removeListener(eventName: 'NameAcquired', listener: (name: string) => void): this;
59
- removeListener(eventName: 'connectionClose', listener: () => void): this;
60
- removeListener(eventName: 'connectionError', listener: (error: Error) => void): this;
61
- addMatch(rule: string): void;
62
- removeMatch(rule: string): void;
63
- getNameOwner(name: string): Promise<string | undefined>;
64
- listActivatableNames(): Promise<string[]>;
65
- listNames(): Promise<string[]>;
66
- nameHasOwner(name: string): Promise<boolean>;
67
- listBusNames(): Promise<BusNameBasicInfo[]>;
68
- listServices(): Promise<ServiceBasicInfo[]>;
69
- services(): Promise<DBusService[]>;
70
- service(service: string): Promise<DBusService>;
71
- object(service: string, objectPath: string): Promise<DBusObject>;
72
- interface(service: string, objectPath: string, iface: string): Promise<DBusInterface>;
73
- interfaceSignal(service: string, objectPath: string, iface: string): Promise<DBusSignalEmitter>;
74
- }
75
- //# sourceMappingURL=DBusClientComponent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DBusClientComponent.d.ts","sourceRoot":"","sources":["../../src/components/DBusClientComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,gBAAgB,EAChB,IAAI,EACJ,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EACnB,MAAM,UAAU,CAAA;AACjB,OAAO,EAAC,SAAS,EAAwB,sBAAsB,EAAC,MAAM,UAAU,CAAA;AAChF,OAAO,EAAC,iBAAiB,EAAC,MAAM,iCAAiC,CAAA;AAGjE,eAAO,MAAM,sBAAsB,EAAE,sBAAsB,CAAC,iBAAiB,CAM3E,CAAA;AAEF,qBAAa,mBAAoB,SAAQ,SAAS;IAG9C,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAGrC,SAAS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AAC;IAI3C,QAAQ,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAIlC,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAI9C,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAIhE,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAIrF,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAI/G"}
@@ -1,125 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.DBusClientComponent = exports.buildDBusClientOptions = void 0;
13
- const dbus_sdk_1 = require("dbus-sdk");
14
- const lakutata_1 = require("lakutata");
15
- const di_1 = require("lakutata/decorator/di");
16
- const buildDBusClientOptions = (options) => ({
17
- class: DBusClientComponent,
18
- busAddress: options.busAddress,
19
- timeout: options.timeout,
20
- advancedResponse: options.advancedResponse,
21
- convertBigIntToNumber: options.convertBigIntToNumber
22
- });
23
- exports.buildDBusClientOptions = buildDBusClientOptions;
24
- class DBusClientComponent extends lakutata_1.Component {
25
- get uniqueName() {
26
- return this.dbus.uniqueName;
27
- }
28
- /**
29
- * Initializer
30
- * @protected
31
- */
32
- async init() {
33
- this.dbus = await dbus_sdk_1.DBus.connect({
34
- busAddress: this.busAddress,
35
- timeout: this.timeout,
36
- advancedResponse: this.advancedResponse,
37
- convertBigIntToNumber: this.convertBigIntToNumber
38
- });
39
- }
40
- /**
41
- * Destroyer
42
- * @protected
43
- */
44
- async destroy() {
45
- await this.dbus.disconnect();
46
- }
47
- invoke(opts, noReply = false) {
48
- if (noReply)
49
- return this.dbus.invoke(opts, true);
50
- return this.dbus.invoke(opts, false);
51
- }
52
- on(eventName, listener) {
53
- this.dbus.on(eventName, listener);
54
- return this;
55
- }
56
- once(eventName, listener) {
57
- this.dbus.once(eventName, listener);
58
- return this;
59
- }
60
- off(eventName, listener) {
61
- this.dbus.off(eventName, listener);
62
- return this;
63
- }
64
- removeListener(eventName, listener) {
65
- this.dbus.removeListener(eventName, listener);
66
- return this;
67
- }
68
- addMatch(rule) {
69
- return this.dbus.addMatch(rule);
70
- }
71
- removeMatch(rule) {
72
- return this.dbus.removeMatch(rule);
73
- }
74
- async getNameOwner(name) {
75
- return this.dbus.getNameOwner(name);
76
- }
77
- async listActivatableNames() {
78
- return this.dbus.listActivatableNames();
79
- }
80
- async listNames() {
81
- return this.dbus.listNames();
82
- }
83
- async nameHasOwner(name) {
84
- return this.dbus.nameHasOwner(name);
85
- }
86
- async listBusNames() {
87
- return this.dbus.listBusNames();
88
- }
89
- async listServices() {
90
- return this.dbus.listServices();
91
- }
92
- async services() {
93
- return this.dbus.getServices();
94
- }
95
- async service(service) {
96
- return this.dbus.getService(service);
97
- }
98
- async object(service, objectPath) {
99
- return this.dbus.getObject(service, objectPath);
100
- }
101
- async interface(service, objectPath, iface) {
102
- return this.dbus.getInterface(service, objectPath, iface);
103
- }
104
- async interfaceSignal(service, objectPath, iface) {
105
- const dbusIface = await this.dbus.getInterface(service, objectPath, iface);
106
- return dbusIface.signal;
107
- }
108
- }
109
- exports.DBusClientComponent = DBusClientComponent;
110
- __decorate([
111
- (0, di_1.Configurable)(lakutata_1.DTO.String().required()),
112
- __metadata("design:type", String)
113
- ], DBusClientComponent.prototype, "busAddress", void 0);
114
- __decorate([
115
- (0, di_1.Configurable)(lakutata_1.DTO.Number().positive().integer().optional()),
116
- __metadata("design:type", Number)
117
- ], DBusClientComponent.prototype, "timeout", void 0);
118
- __decorate([
119
- (0, di_1.Configurable)(lakutata_1.DTO.Boolean().optional().default(false)),
120
- __metadata("design:type", Boolean)
121
- ], DBusClientComponent.prototype, "advancedResponse", void 0);
122
- __decorate([
123
- (0, di_1.Configurable)(lakutata_1.DTO.Boolean().optional().default(true)),
124
- __metadata("design:type", Boolean)
125
- ], DBusClientComponent.prototype, "convertBigIntToNumber", void 0);
@@ -1,7 +0,0 @@
1
- export interface DBusClientOptions {
2
- busAddress: string;
3
- timeout?: number;
4
- advancedResponse?: boolean;
5
- convertBigIntToNumber?: boolean;
6
- }
7
- //# sourceMappingURL=DBusClientOptions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DBusClientOptions.d.ts","sourceRoot":"","sources":["../../src/interfaces/DBusClientOptions.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAClC"}