@attraccess/plugins-backend-sdk 1.10.0 → 1.11.0-beta.1

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 (56) hide show
  1. package/package.json +13 -8
  2. package/src/index.d.ts +8 -0
  3. package/src/index.js +8 -0
  4. package/src/index.js.map +1 -1
  5. package/src/internal.d.ts +6 -0
  6. package/src/internal.js +11 -0
  7. package/src/internal.js.map +1 -0
  8. package/src/lib/auth.types.d.ts +3 -1
  9. package/src/lib/dual-auth.guard.js +4 -0
  10. package/src/lib/dual-auth.guard.js.map +1 -1
  11. package/src/lib/plugin-audit.d.ts +34 -33
  12. package/src/lib/plugin-audit.js +9 -9
  13. package/src/lib/plugin-audit.js.map +1 -1
  14. package/src/lib/plugin-backend-module.d.ts +71 -0
  15. package/src/lib/plugin-backend-module.js +3 -0
  16. package/src/lib/plugin-backend-module.js.map +1 -0
  17. package/src/lib/plugin-ble-fake-clock.d.ts +15 -0
  18. package/src/lib/plugin-ble-fake-clock.js +52 -0
  19. package/src/lib/plugin-ble-fake-clock.js.map +1 -0
  20. package/src/lib/plugin-ble-fake.d.ts +94 -0
  21. package/src/lib/plugin-ble-fake.js +406 -0
  22. package/src/lib/plugin-ble-fake.js.map +1 -0
  23. package/src/lib/plugin-ble-notification-stream.d.ts +28 -0
  24. package/src/lib/plugin-ble-notification-stream.js +119 -0
  25. package/src/lib/plugin-ble-notification-stream.js.map +1 -0
  26. package/src/lib/plugin-ble-session-engine.d.ts +119 -0
  27. package/src/lib/plugin-ble-session-engine.js +410 -0
  28. package/src/lib/plugin-ble-session-engine.js.map +1 -0
  29. package/src/lib/plugin-ble-validation.d.ts +71 -0
  30. package/src/lib/plugin-ble-validation.js +453 -0
  31. package/src/lib/plugin-ble-validation.js.map +1 -0
  32. package/src/lib/plugin-ble.d.ts +249 -0
  33. package/src/lib/plugin-ble.js +85 -0
  34. package/src/lib/plugin-ble.js.map +1 -0
  35. package/src/lib/plugin-context.d.ts +58 -54
  36. package/src/lib/plugin-context.js +6 -6
  37. package/src/lib/plugin-context.js.map +1 -1
  38. package/src/lib/plugin-flow-node.d.ts +52 -3
  39. package/src/lib/plugin-live-updates.d.ts +21 -0
  40. package/src/lib/plugin-live-updates.js +3 -0
  41. package/src/lib/plugin-live-updates.js.map +1 -0
  42. package/src/lib/plugin-notifications.d.ts +83 -0
  43. package/src/lib/plugin-notifications.js +3 -0
  44. package/src/lib/plugin-notifications.js.map +1 -0
  45. package/src/lib/plugin-resource-access.d.ts +89 -0
  46. package/src/lib/plugin-resource-access.js +3 -0
  47. package/src/lib/plugin-resource-access.js.map +1 -0
  48. package/src/lib/plugin.interface.d.ts +92 -5
  49. package/src/lib/plugin.interface.js +28 -1
  50. package/src/lib/plugin.interface.js.map +1 -1
  51. package/src/lib/reader-ui.d.ts +359 -0
  52. package/src/lib/reader-ui.js +115 -0
  53. package/src/lib/reader-ui.js.map +1 -0
  54. package/src/lib/shared-live-sampler.d.ts +11 -0
  55. package/src/lib/shared-live-sampler.js +33 -0
  56. package/src/lib/shared-live-sampler.js.map +1 -0
@@ -0,0 +1,83 @@
1
+ /** A user-facing label in every supported UI language. */
2
+ export interface PluginLocalizedLabel {
3
+ en: string;
4
+ de: string;
5
+ }
6
+ /**
7
+ * Notification category a plugin declares through
8
+ * {@link PluginBackendModule.notificationCategories}. The host namespaces it as
9
+ * `plugin.<pluginName>.<id>`, lists it in each user's notification preferences
10
+ * under the plugin's name and respects the user's per-channel choice (email, push,
11
+ * in-app toast) whenever the plugin dispatches under it.
12
+ */
13
+ export interface PluginNotificationCategory {
14
+ /** Short id, unique within the plugin. Lowercase letters, digits, `-`, `_`. */
15
+ id: string;
16
+ label: PluginLocalizedLabel;
17
+ }
18
+ /**
19
+ * Email template a plugin declares through {@link PluginBackendModule.emailTemplates}. It works like a core
20
+ * template: the host stores it per installation (key `plugin.<pluginName>.<id>`), lists it in the admin email
21
+ * template editor under the plugin's name, renders it inside the global layout, and admins can edit subject,
22
+ * body and translations. The declaration only seeds it, with its shipped translations: an installed template is
23
+ * never overwritten ("reset to default" restores the declared version). A malformed declaration, including a
24
+ * Handlebars syntax error, an unknown helper or a partial, quarantines the plugin.
25
+ *
26
+ * Texts use the template translation helper, `{{t "key" "English default" name=user.username}}`; the English
27
+ * default is inline and `translations.de` carries the German texts (every key used must be present).
28
+ */
29
+ export interface PluginEmailTemplate {
30
+ /** Short id, unique within the plugin. Lowercase letters, digits, `-`, `_`. */
31
+ id: string;
32
+ /** Name in the template list. */
33
+ label: PluginLocalizedLabel;
34
+ /** Variables the editor offers, e.g. `reservation.startTime`. `user.*`, `host.*` and `url` are always set. */
35
+ variables: string[];
36
+ /** Subject: a Handlebars string, usually one `t` call. */
37
+ subject: string;
38
+ /** Body: an MJML fragment without an `<mjml>` root (the host wraps it in the global layout). */
39
+ body: string;
40
+ /** Shipped translations per locale. `de` is required and must cover every `t` key of subject and body. */
41
+ translations: {
42
+ de: Record<string, string>;
43
+ } & Record<string, Record<string, string>>;
44
+ }
45
+ /** Sends one of the plugin's {@link PluginEmailTemplate}s with these variables (merged under `user`/`host`/`url`). */
46
+ export interface PluginNotificationEmailTemplate {
47
+ /** Short id of a template declared by this plugin via `emailTemplates`. */
48
+ template: string;
49
+ variables: Record<string, unknown>;
50
+ }
51
+ /** Custom email content. The host renders it inside the global email layout. */
52
+ export interface PluginNotificationRawEmail {
53
+ subject: string;
54
+ /** Trusted HTML fragment placed in the layout body. Takes precedence over text. */
55
+ html?: string;
56
+ /** Plain text. Used as the body (HTML-escaped) when html is omitted. */
57
+ text: string;
58
+ }
59
+ /** Prefer a template: admins cannot edit raw content. */
60
+ export type PluginNotificationEmail = PluginNotificationRawEmail | PluginNotificationEmailTemplate;
61
+ export interface PluginNotificationRequest {
62
+ /** Short id of a category declared by this plugin via `notificationCategories`. */
63
+ category: string;
64
+ /** User ids to notify. Unknown ids are skipped; duplicates are collapsed. */
65
+ recipients: number[];
66
+ title: string;
67
+ body: string;
68
+ /** In-app link target (relative to the application URL, e.g. `/resources/3`). */
69
+ url?: string;
70
+ severity?: 'info' | 'warning';
71
+ /** Collapses repeated push notifications that share the key. */
72
+ dedupeKey?: string;
73
+ /** When set, an email is sent to recipients whose preferences allow email for the category. A template is rendered in each recipient's language. */
74
+ email?: PluginNotificationEmail;
75
+ }
76
+ /** Notification dispatch for plugins. Requires the SEND_NOTIFICATIONS permission. */
77
+ export interface PluginNotificationsContext {
78
+ /**
79
+ * Dispatch a notification to users, honouring each user's channel preferences for the category.
80
+ * Rejects when the category was not declared by this plugin.
81
+ */
82
+ dispatch(request: PluginNotificationRequest): Promise<void>;
83
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=plugin-notifications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-notifications.js","sourceRoot":"","sources":["../../../../../libs/plugins-backend-sdk/src/lib/plugin-notifications.ts"],"names":[],"mappings":""}
@@ -0,0 +1,89 @@
1
+ /** Result of {@link PluginResourceAccessContext.canStart}. */
2
+ export interface PluginCanStartResult {
3
+ /** The user may start a session on their own right now (introduction valid, no mandatory supervision). */
4
+ allowed: boolean;
5
+ /** The user may only start a session under a supervisor (mandatory, or not introduced yet). */
6
+ requiresSupervision: boolean;
7
+ /** The resource supports supervised sessions at all (supervision allowed or required). */
8
+ supervisionAllowed: boolean;
9
+ }
10
+ export interface PluginMaintenanceWindow {
11
+ maintenanceId: number;
12
+ resourceId: number;
13
+ startTime: Date;
14
+ /** Null for open-ended maintenance that is still running or announced without an end. */
15
+ endTime: Date | null;
16
+ reason: string | null;
17
+ }
18
+ export interface PluginActiveSession {
19
+ usageId: number;
20
+ userId: number;
21
+ startTime: Date;
22
+ }
23
+ /**
24
+ * A request-bound user: the authenticated principal of an HTTP request. `request.user` of an `@Auth()`
25
+ * route (`AuthenticatedUser`) fits as is.
26
+ */
27
+ export interface PluginAccessPrincipalUser {
28
+ id: number;
29
+ /**
30
+ * Permissions this request may use. For API-token requests core narrows them to the token's scope. When set,
31
+ * permission-based grants are limited to these permissions (intersected with the user's current RBAC
32
+ * permissions). Introducer/maintainer roles and introductions still apply, exactly as core applies them to an
33
+ * API-token request.
34
+ */
35
+ effectivePermissions?: Iterable<string>;
36
+ }
37
+ /**
38
+ * Whom an access query is about. Pass `request.user` for request-driven checks so API-token scopes apply. A plain
39
+ * user id resolves the user's full RBAC permissions; use it for background work such as schedulers.
40
+ */
41
+ export type PluginAccessPrincipal = number | PluginAccessPrincipalUser;
42
+ /**
43
+ * Read-only access and state queries over core authorization data. Requires the
44
+ * ACCESS_RESOURCES permission. All answers reuse the logic core uses to authorise
45
+ * session starts, so they never drift from what a start would actually allow.
46
+ *
47
+ * Methods that take a {@link PluginAccessPrincipal} accept either a user id or the request's user. Unknown users
48
+ * and unknown resources yield negative answers (`false`, all-false results, empty lists) rather than errors.
49
+ */
50
+ export interface PluginResourceAccessContext {
51
+ /**
52
+ * Whether the user may start a session on the resource. Covers direct and group
53
+ * introductions, retraining blocks, introducers/maintainers and `resources.update`,
54
+ * plus the resource's supervision mode. It does not look at live maintenance or health
55
+ * state; use getMaintenanceWindows for that. Returns all-false for an unknown user or resource.
56
+ */
57
+ canStart(principal: PluginAccessPrincipal, resourceId: number): Promise<PluginCanStartResult>;
58
+ /**
59
+ * Whether the user can manage maintenance of the resource: `resources.maintenance.manage`, or an
60
+ * introducer/maintainer role on the resource or one of its groups. Same check core's maintenance API uses.
61
+ */
62
+ canMaintain(principal: PluginAccessPrincipal, resourceId: number): Promise<boolean>;
63
+ /**
64
+ * Whether the user may see WHO is using the resource: the same rule core applies to the current user's name in
65
+ * the resource UI and API (`full` activity access). `resources.update` and `resources.access.manage` holders,
66
+ * people introduced to the machine (or its introducers/maintainers) and, when the instance shows activity to
67
+ * everyone, every reader qualify. Machines whose activity is hidden from the user, and unknown users or
68
+ * resources, answer `false`. A plugin that shows a person's name next to a machine (for example who holds a
69
+ * reservation) should follow this answer instead of keeping its own rule. Like core's rule it does not look at
70
+ * hidden resource groups or account state: check that the user may see the resource at all first.
71
+ */
72
+ canSeeUsageAttribution(principal: PluginAccessPrincipal, resourceId: number): Promise<boolean>;
73
+ /** Whether the user holds the RBAC permission (e.g. `resources.update`), limited to a request's scope. */
74
+ hasPermission(principal: PluginAccessPrincipal, permission: string): Promise<boolean>;
75
+ /**
76
+ * Ids of resources the user is introduced to in the sense of canStart's introduction rule:
77
+ * valid, not retraining-blocked direct or group introduction, introducer/maintainer role, or `resources.update`.
78
+ */
79
+ listResourceIdsIntroduced(principal: PluginAccessPrincipal): Promise<number[]>;
80
+ /** Ids of resources whose maintenance the user can manage. */
81
+ listResourceIdsMaintained(principal: PluginAccessPrincipal): Promise<number[]>;
82
+ /**
83
+ * Maintenance windows overlapping [from, to). A window covers [startTime, endTime ?? infinity), so
84
+ * open-ended maintenance counts from its start until it is finished.
85
+ */
86
+ getMaintenanceWindows(resourceId: number, from: Date, to: Date): Promise<PluginMaintenanceWindow[]>;
87
+ /** Currently running sessions on the resource, earliest first. */
88
+ getActiveSessions(resourceId: number): Promise<PluginActiveSession[]>;
89
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=plugin-resource-access.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-resource-access.js","sourceRoot":"","sources":["../../../../../libs/plugins-backend-sdk/src/lib/plugin-resource-access.ts"],"names":[],"mappings":""}
@@ -1,7 +1,81 @@
1
- import { Resource, User } from '@attraccess/database-entities';
1
+ import { Resource, ResourceHealthStatus, User } from '@attraccess/database-entities';
2
2
  export declare enum SystemEvent {
3
3
  RESOURCE_USAGE_STARTED = "RESOURCE_USAGE_STARTED",
4
- RESOURCE_USAGE_ENDED = "RESOURCE_USAGE_ENDED"
4
+ RESOURCE_USAGE_ENDED = "RESOURCE_USAGE_ENDED",
5
+ /** A maintenance window was created, updated or finished. See {@link MaintenanceChangedPayload}. */
6
+ MAINTENANCE_CHANGED = "MAINTENANCE_CHANGED",
7
+ /** A resource health entry changed status. See {@link ResourceHealthChangedPayload}. */
8
+ RESOURCE_HEALTH_CHANGED = "RESOURCE_HEALTH_CHANGED",
9
+ /** A user started a session on an idle resource (not a takeover). */
10
+ RESOURCE_USAGE_SESSION_STARTED = "RESOURCE_USAGE_SESSION_STARTED",
11
+ /** A user took over a running session. Fires for the NEW user. */
12
+ RESOURCE_USAGE_SESSION_TAKEN_OVER = "RESOURCE_USAGE_SESSION_TAKEN_OVER",
13
+ /** A session ended, either explicitly or because it was taken over. */
14
+ RESOURCE_USAGE_SESSION_ENDED = "RESOURCE_USAGE_SESSION_ENDED",
15
+ /**
16
+ * The effective session limit of a resource changed (`maxParallelSessions`, or a type change that changes the
17
+ * limit). Fires after commit. See {@link ResourceSessionLimitChangedPayload}.
18
+ */
19
+ RESOURCE_SESSION_LIMIT_CHANGED = "RESOURCE_SESSION_LIMIT_CHANGED"
20
+ }
21
+ /** Emitted after the effective session limit of a resource changed (committed to the database). */
22
+ export interface ResourceSessionLimitChangedPayload {
23
+ resourceId: number;
24
+ /** Effective limit before the change (1 for doors and other non-machine types). */
25
+ previousLimit: number;
26
+ /** Effective limit after the change. */
27
+ newLimit: number;
28
+ /** The user who made the change, or null when the change was not made by a user. */
29
+ actorUserId: number | null;
30
+ }
31
+ /** Emitted after a maintenance window was created, updated or finished (committed to the database). */
32
+ export interface MaintenanceChangedPayload {
33
+ resourceId: number;
34
+ maintenanceId: number;
35
+ /**
36
+ * Core currently emits only `created` and `finished`; maintenance windows have no edit path yet.
37
+ * `updated` is reserved for forward compatibility, so handle it like `created` (re-read the window).
38
+ */
39
+ action: 'created' | 'updated' | 'finished';
40
+ startTime: Date;
41
+ /** Null while the maintenance is open-ended (no end set, not finished). */
42
+ endTime: Date | null;
43
+ }
44
+ /** Emitted after a resource health entry changed status. Only real status transitions fire. */
45
+ export interface ResourceHealthChangedPayload {
46
+ resourceId: number;
47
+ status: ResourceHealthStatus;
48
+ previousStatus: ResourceHealthStatus | null;
49
+ reason: string | null;
50
+ /** Identifier of the health entry (resources can carry several independent entries). */
51
+ identifier: string;
52
+ }
53
+ export interface ResourceUsageSessionStartedPayload {
54
+ resourceId: number;
55
+ usageId: number;
56
+ userId: number;
57
+ startTime: Date;
58
+ /** Set when the session was started under supervision. */
59
+ supervisorUserId: number | null;
60
+ }
61
+ export interface ResourceUsageSessionTakenOverPayload {
62
+ resourceId: number;
63
+ /** The new session. */
64
+ usageId: number;
65
+ /** The user who took over (the new session owner). */
66
+ userId: number;
67
+ startTime: Date;
68
+ previousUsageId: number;
69
+ previousUserId: number;
70
+ }
71
+ export interface ResourceUsageSessionEndedPayload {
72
+ resourceId: number;
73
+ usageId: number;
74
+ userId: number;
75
+ startTime: Date;
76
+ endTime: Date | null;
77
+ /** 'taken_over' when the session ended because another user took it over. */
78
+ reason: 'ended' | 'taken_over';
5
79
  }
6
80
  export type SystemEventPayload = {
7
81
  [SystemEvent.RESOURCE_USAGE_STARTED]: {
@@ -12,10 +86,15 @@ export type SystemEventPayload = {
12
86
  resource: Resource;
13
87
  user: User;
14
88
  };
89
+ [SystemEvent.MAINTENANCE_CHANGED]: MaintenanceChangedPayload;
90
+ [SystemEvent.RESOURCE_HEALTH_CHANGED]: ResourceHealthChangedPayload;
91
+ [SystemEvent.RESOURCE_USAGE_SESSION_STARTED]: ResourceUsageSessionStartedPayload;
92
+ [SystemEvent.RESOURCE_USAGE_SESSION_TAKEN_OVER]: ResourceUsageSessionTakenOverPayload;
93
+ [SystemEvent.RESOURCE_USAGE_SESSION_ENDED]: ResourceUsageSessionEndedPayload;
94
+ [SystemEvent.RESOURCE_SESSION_LIMIT_CHANGED]: ResourceSessionLimitChangedPayload;
15
95
  };
16
96
  export type SystemEventResponse = {
17
- [SystemEvent.RESOURCE_USAGE_STARTED]: null;
18
- [SystemEvent.RESOURCE_USAGE_ENDED]: null;
97
+ [E in SystemEvent]: null;
19
98
  };
20
99
  /**
21
100
  * Typed handler a plugin registers for a given SystemEvent. It receives the
@@ -55,7 +134,15 @@ export declare enum PluginPermission {
55
134
  /** Start flows from plugin-declared trigger nodes via flows.trigger(). */
56
135
  TRIGGER_FLOWS = "TRIGGER_FLOWS",
57
136
  /** Encrypt and decrypt plugin-owned secret material through the host key service. */
58
- MANAGE_SECRETS = "MANAGE_SECRETS"
137
+ MANAGE_SECRETS = "MANAGE_SECRETS",
138
+ /** Contribute reader UI slots and call readerUi.invalidate(). */
139
+ READER_UI = "READER_UI",
140
+ /** Register pre-start and session-end hooks that can confirm or block session starts. */
141
+ ACCESS_HOOKS = "ACCESS_HOOKS",
142
+ /** Send in-app, push and email notifications to users via notifications.dispatch(). */
143
+ SEND_NOTIFICATIONS = "SEND_NOTIFICATIONS",
144
+ /** Use the Bluetooth radio of administrator-approved Attractap readers through context.ble, limited to the plugin's own BLE profiles. */
145
+ BLE_TRANSPORT = "BLE_TRANSPORT"
59
146
  }
60
147
  /**
61
148
  * Human-readable description of each permission, surfaced to admins and plugin
@@ -6,6 +6,21 @@ var SystemEvent;
6
6
  (function (SystemEvent) {
7
7
  SystemEvent["RESOURCE_USAGE_STARTED"] = "RESOURCE_USAGE_STARTED";
8
8
  SystemEvent["RESOURCE_USAGE_ENDED"] = "RESOURCE_USAGE_ENDED";
9
+ /** A maintenance window was created, updated or finished. See {@link MaintenanceChangedPayload}. */
10
+ SystemEvent["MAINTENANCE_CHANGED"] = "MAINTENANCE_CHANGED";
11
+ /** A resource health entry changed status. See {@link ResourceHealthChangedPayload}. */
12
+ SystemEvent["RESOURCE_HEALTH_CHANGED"] = "RESOURCE_HEALTH_CHANGED";
13
+ /** A user started a session on an idle resource (not a takeover). */
14
+ SystemEvent["RESOURCE_USAGE_SESSION_STARTED"] = "RESOURCE_USAGE_SESSION_STARTED";
15
+ /** A user took over a running session. Fires for the NEW user. */
16
+ SystemEvent["RESOURCE_USAGE_SESSION_TAKEN_OVER"] = "RESOURCE_USAGE_SESSION_TAKEN_OVER";
17
+ /** A session ended, either explicitly or because it was taken over. */
18
+ SystemEvent["RESOURCE_USAGE_SESSION_ENDED"] = "RESOURCE_USAGE_SESSION_ENDED";
19
+ /**
20
+ * The effective session limit of a resource changed (`maxParallelSessions`, or a type change that changes the
21
+ * limit). Fires after commit. See {@link ResourceSessionLimitChangedPayload}.
22
+ */
23
+ SystemEvent["RESOURCE_SESSION_LIMIT_CHANGED"] = "RESOURCE_SESSION_LIMIT_CHANGED";
9
24
  })(SystemEvent || (exports.SystemEvent = SystemEvent = {}));
10
25
  /**
11
26
  * Discrete host capabilities a plugin may request in its manifest. A plugin can
@@ -34,6 +49,14 @@ var PluginPermission;
34
49
  PluginPermission["TRIGGER_FLOWS"] = "TRIGGER_FLOWS";
35
50
  /** Encrypt and decrypt plugin-owned secret material through the host key service. */
36
51
  PluginPermission["MANAGE_SECRETS"] = "MANAGE_SECRETS";
52
+ /** Contribute reader UI slots and call readerUi.invalidate(). */
53
+ PluginPermission["READER_UI"] = "READER_UI";
54
+ /** Register pre-start and session-end hooks that can confirm or block session starts. */
55
+ PluginPermission["ACCESS_HOOKS"] = "ACCESS_HOOKS";
56
+ /** Send in-app, push and email notifications to users via notifications.dispatch(). */
57
+ PluginPermission["SEND_NOTIFICATIONS"] = "SEND_NOTIFICATIONS";
58
+ /** Use the Bluetooth radio of administrator-approved Attractap readers through context.ble, limited to the plugin's own BLE profiles. */
59
+ PluginPermission["BLE_TRANSPORT"] = "BLE_TRANSPORT";
37
60
  })(PluginPermission || (exports.PluginPermission = PluginPermission = {}));
38
61
  /**
39
62
  * Human-readable description of each permission, surfaced to admins and plugin
@@ -41,7 +64,7 @@ var PluginPermission;
41
64
  */
42
65
  exports.PLUGIN_PERMISSION_DESCRIPTIONS = {
43
66
  [PluginPermission.READ_USERS]: 'Read user accounts from the database.',
44
- [PluginPermission.ACCESS_RESOURCES]: 'Read and write resources from the database.',
67
+ [PluginPermission.ACCESS_RESOURCES]: 'Read and write resources from the database and query resource access, maintenance windows and active sessions.',
45
68
  [PluginPermission.READ_SETTINGS]: 'Read application settings from the database.',
46
69
  [PluginPermission.DATABASE_ACCESS]: 'Access the raw database connection and any other entity repository.',
47
70
  [PluginPermission.EMIT_EVENTS]: 'Publish events on the shared application event bus.',
@@ -50,6 +73,10 @@ exports.PLUGIN_PERMISSION_DESCRIPTIONS = {
50
73
  [PluginPermission.ACCESS_MQTT_SERVERS]: "Read an MQTT server's connection configuration and resolved credentials.",
51
74
  [PluginPermission.TRIGGER_FLOWS]: 'Start flows from plugin-declared trigger nodes.',
52
75
  [PluginPermission.MANAGE_SECRETS]: 'Encrypt and decrypt plugin-owned secret material through the host key service.',
76
+ [PluginPermission.READER_UI]: 'Show widgets on Attractap reader screens.',
77
+ [PluginPermission.ACCESS_HOOKS]: 'Ask users for confirmation or block resource session starts through pre-start hooks.',
78
+ [PluginPermission.SEND_NOTIFICATIONS]: 'Send notifications to users (in-app, push and email) under plugin-declared notification categories.',
79
+ [PluginPermission.BLE_TRANSPORT]: 'Use the Bluetooth radio of Attractap readers that an administrator opened for plugins, limited to the BLE profiles this plugin registers.',
53
80
  };
54
81
  /**
55
82
  * Returns true when the given string is a known PluginPermission value.
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.interface.js","sourceRoot":"","sources":["../../../../../libs/plugins-backend-sdk/src/lib/plugin.interface.ts"],"names":[],"mappings":";;;AAkFA,gDAEC;AAlFD,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,gEAAiD,CAAA;IACjD,4DAA6C,CAAA;AAC/C,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB;AA6BD;;;;GAIG;AACH,IAAY,gBAqBX;AArBD,WAAY,gBAAgB;IAC1B,wDAAwD;IACxD,6CAAyB,CAAA;IACzB,sEAAsE;IACtE,yDAAqC,CAAA;IACrC,8DAA8D;IAC9D,mDAA+B,CAAA;IAC/B,0DAA0D;IAC1D,uDAAmC,CAAA;IACnC,wEAAwE;IACxE,+CAA2B,CAAA;IAC3B,4EAA4E;IAC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AC7B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;IAC/C,CAAC;CACF;AAfD,sDAeC"}
1
+ {"version":3,"file":"plugin.interface.js","sourceRoot":"","sources":["../../../../../libs/plugins-backend-sdk/src/lib/plugin.interface.ts"],"names":[],"mappings":";;;AAuLA,gDAEC;AAvLD,IAAY,WAkBX;AAlBD,WAAY,WAAW;IACrB,gEAAiD,CAAA;IACjD,4DAA6C,CAAA;IAC7C,oGAAoG;IACpG,0DAA2C,CAAA;IAC3C,wFAAwF;IACxF,kEAAmD,CAAA;IACnD,qEAAqE;IACrE,gFAAiE,CAAA;IACjE,kEAAkE;IAClE,sFAAuE,CAAA;IACvE,uEAAuE;IACvE,4EAA6D,CAAA;IAC7D;;;OAGG;IACH,gFAAiE,CAAA;AACnE,CAAC,EAlBW,WAAW,2BAAX,WAAW,QAkBtB;AAmGD;;;;GAIG;AACH,IAAY,gBA6BX;AA7BD,WAAY,gBAAgB;IAC1B,wDAAwD;IACxD,6CAAyB,CAAA;IACzB,sEAAsE;IACtE,yDAAqC,CAAA;IACrC,8DAA8D;IAC9D,mDAA+B,CAAA;IAC/B,0DAA0D;IAC1D,uDAAmC,CAAA;IACnC,wEAAwE;IACxE,+CAA2B,CAAA;IAC3B,4EAA4E;IAC5E,mDAA+B,CAAA;IAC/B,mEAAmE;IACnE,qEAAiD,CAAA;IACjD,gGAAgG;IAChG,+DAA2C,CAAA;IAC3C,0EAA0E;IAC1E,mDAA+B,CAAA;IAC/B,qFAAqF;IACrF,qDAAiC,CAAA;IACjC,iEAAiE;IACjE,2CAAuB,CAAA;IACvB,yFAAyF;IACzF,iDAA6B,CAAA;IAC7B,uFAAuF;IACvF,6DAAyC,CAAA;IACzC,yIAAyI;IACzI,mDAA+B,CAAA;AACjC,CAAC,EA7BW,gBAAgB,gCAAhB,gBAAgB,QA6B3B;AAED;;;GAGG;AACU,QAAA,8BAA8B,GAAqC;I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