@attraccess/plugins-backend-sdk 1.11.0-beta.2 → 1.11.0-beta.3

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/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Prosperity Public License 3.0 – Modified Version
2
2
 
3
- Copyright (c) 2025 Jan Jaap (Github: JappyJan, E-Mail: mail@janjaap.de)
3
+ Copyright (c) 2025 Jan Jaap (Github: JappyJan, E-Mail: mail@janjaap.de)
4
4
  Project: Attraccess
5
5
 
6
6
  ## 1. Zweck
@@ -36,7 +36,13 @@ Ziel ist es, Privatpersonen und gemeinnützigen Organisationen volle Freiheit zu
36
36
 
37
37
  Diese Software enthält Komponenten, die unter der MIT-Lizenz stehen. Diese Teile bleiben unter ihren ursprünglichen Bedingungen lizenziert. Siehe [LICENSE-fabinfra.md](./LICENSE-fabinfra.md).
38
38
 
39
- ## 5. Keine Garantie
39
+ ## 5. Plugins
40
+
41
+ - Plugins können eigene Lizenzen haben. Maßgeblich ist die Datei `LICENSE.md` im jeweiligen Plugin-Ordner (`apps/plugins/<name>`) beziehungsweise im Plugin-Paket.
42
+ - Hat ein Plugin keine eigene Lizenz, gilt für das Plugin diese Lizenz (die des Kerns).
43
+ - Die Erlaubnis zur kostenlosen Nutzung durch Privatpersonen und gemeinnützige Organisationen (Abschnitt 2.1) und der Lizenzschlüssel für gemeinnützige Nutzung erstrecken sich **nicht automatisch** auf Plugins mit eigener, kommerzieller Lizenz. Solche Plugins erfordern die dort genannte Lizenz, zum Beispiel ein bezahltes Lizenzmodul.
44
+
45
+ ## 6. Keine Garantie
40
46
 
41
47
  DIE SOFTWARE WIRD OHNE JEGLICHE GARANTIE ZUR VERFÜGUNG GESTELLT. DER AUTOR ÜBERNIMMT KEINE HAFTUNG FÜR DIREKTE ODER INDIREKTE SCHÄDEN ODER FOLGEKOSTEN.
42
48
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@attraccess/plugins-backend-sdk",
3
- "version": "1.11.0-beta.2",
3
+ "version": "1.11.0-beta.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/Attraccess/Attraccess.git",
@@ -26,12 +26,12 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "tslib": "^2.8.1",
29
- "@attraccess/database-entities": "1.11.0-beta.2",
29
+ "@attraccess/database-entities": "1.11.0-beta.3",
30
30
  "@nestjs/common": "^12.0.0",
31
31
  "@nestjs/event-emitter": "^12.0.0",
32
32
  "rxjs": "^7.8.2",
33
33
  "@nestjs/core": "^12.0.0",
34
- "typeorm": "0.3.31",
34
+ "typeorm": "^1.1.3",
35
35
  "@nestjs/swagger": "^12.0.0",
36
36
  "express": "5.3.0",
37
37
  "@nestjs/passport": "^12.0.0",
package/src/index.d.ts CHANGED
@@ -12,9 +12,11 @@ export * from './lib/semver';
12
12
  export * from './lib/reader-ui';
13
13
  export * from './lib/plugin-notifications';
14
14
  export * from './lib/plugin-resource-access';
15
+ export * from './lib/plugin-license';
15
16
  export * from './lib/plugin-ble';
16
17
  export * from './lib/plugin-ble-validation';
17
18
  export * from './lib/plugin-ble-fake';
19
+ export * from './lib/plugin-cards';
18
20
  export * from './lib/auth-decorator';
19
21
  export * from '@attraccess/database-entities';
20
22
  export * as entities from '@attraccess/database-entities';
package/src/index.js CHANGED
@@ -16,9 +16,11 @@ tslib_1.__exportStar(require("./lib/semver"), exports);
16
16
  tslib_1.__exportStar(require("./lib/reader-ui"), exports);
17
17
  tslib_1.__exportStar(require("./lib/plugin-notifications"), exports);
18
18
  tslib_1.__exportStar(require("./lib/plugin-resource-access"), exports);
19
+ tslib_1.__exportStar(require("./lib/plugin-license"), exports);
19
20
  tslib_1.__exportStar(require("./lib/plugin-ble"), exports);
20
21
  tslib_1.__exportStar(require("./lib/plugin-ble-validation"), exports);
21
22
  tslib_1.__exportStar(require("./lib/plugin-ble-fake"), exports);
23
+ tslib_1.__exportStar(require("./lib/plugin-cards"), exports);
22
24
  tslib_1.__exportStar(require("./lib/auth-decorator"), exports);
23
25
  tslib_1.__exportStar(require("@attraccess/database-entities"), exports);
24
26
  exports.entities = tslib_1.__importStar(require("@attraccess/database-entities"));
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/plugins-backend-sdk/src/index.ts"],"names":[],"mappings":";;;;AAAA,iEAAuC;AACvC,iEAAuC;AACvC,+DAAqC;AACrC,oEAA0C;AAC1C,oEAA0C;AAC1C,6DAAmC;AACnC,mEAAyC;AACzC,6EAAmD;AACnD,kEAAwC;AACxC,uDAA6B;AAC7B,uDAA6B;AAC7B,0DAAgC;AAChC,qEAA2C;AAC3C,uEAA6C;AAC7C,2DAAiC;AACjC,sEAA4C;AAC5C,gEAAsC;AAEtC,+DAAqC;AACrC,wEAA8C;AAC9C,kFAA0D;AAC1D,2DAAiC;AACjC,gEAAsC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/plugins-backend-sdk/src/index.ts"],"names":[],"mappings":";;;;AAAA,iEAAuC;AACvC,iEAAuC;AACvC,+DAAqC;AACrC,oEAA0C;AAC1C,oEAA0C;AAC1C,6DAAmC;AACnC,mEAAyC;AACzC,6EAAmD;AACnD,kEAAwC;AACxC,uDAA6B;AAC7B,uDAA6B;AAC7B,0DAAgC;AAChC,qEAA2C;AAC3C,uEAA6C;AAC7C,+DAAqC;AACrC,2DAAiC;AACjC,sEAA4C;AAC5C,gEAAsC;AACtC,6DAAmC;AAEnC,+DAAqC;AACrC,wEAA8C;AAC9C,kFAA0D;AAC1D,2DAAiC;AACjC,gEAAsC"}
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Card authentication over a plugin's own NFC device (permission `CARD_AUTHENTICATION`).
3
+ *
4
+ * A plugin that owns an NFC-capable device hands the host the UID of the card held to it and a card channel: a
5
+ * function that relays one APDU to the card and returns the card's answer. The host runs the same check as a tap
6
+ * on an Attractap reader over that channel: it detects the card type and authenticates the card with the key
7
+ * stored for its UID. Card keys, session keys and secure messaging never leave the host; the plugin only relays
8
+ * bytes and receives the card's id, UID and owner, or a failure reason.
9
+ */
10
+ /** Stable failure reasons. Never renamed or removed. */
11
+ export declare const PluginCardFailureReason: {
12
+ /** The server is at its limit of concurrent card conversations (readers and plugins together). Retry later. */
13
+ readonly BUSY: "BUSY";
14
+ /** The plugin aborted `signal`, or a newer `authenticate` for the same device took over. */
15
+ readonly CARD_REMOVED: "CARD_REMOVED";
16
+ /** One exchange took longer than 3 s, or the whole conversation longer than 15 s. */
17
+ readonly TIMEOUT: "TIMEOUT";
18
+ /** The conversation needed more than 32 exchanges. */
19
+ readonly TOO_MANY_EXCHANGES: "TOO_MANY_EXCHANGES";
20
+ /** `exchange` rejected, or resolved with something that is not a `Uint8Array` or is longer than 64 bytes. */
21
+ readonly DEVICE_ERROR: "DEVICE_ERROR";
22
+ /** The host is shutting down, or the plugin is being disabled, uninstalled or restarted. */
23
+ readonly CANCELLED: "CANCELLED";
24
+ /** The UID is not 4 to 32 hex characters. */
25
+ readonly INVALID_UID: "INVALID_UID";
26
+ /** No card is enrolled for this UID. */
27
+ readonly CARD_NOT_FOUND: "CARD_NOT_FOUND";
28
+ /** The card is enrolled but not active. */
29
+ readonly CARD_NOT_ACTIVE: "CARD_NOT_ACTIVE";
30
+ /** The card type is not supported (for example a DESFire EV1). */
31
+ readonly CARD_NOT_SUPPORTED: "CARD_NOT_SUPPORTED";
32
+ /** The card did not prove the key stored for its UID (a copied UID, a foreign card, a tampered answer). */
33
+ readonly CARD_AUTHENTICATION_FAILED: "CARD_AUTHENTICATION_FAILED";
34
+ };
35
+ export type PluginCardFailureReason = (typeof PluginCardFailureReason)[keyof typeof PluginCardFailureReason];
36
+ /** Host caps of one card conversation. They are the same as for Attractap readers. */
37
+ export declare const PLUGIN_CARD_LIMITS: {
38
+ readonly exchangeTimeoutMs: 3000;
39
+ readonly conversationTimeoutMs: 15000;
40
+ readonly maxExchanges: 32;
41
+ /** Longest card answer, status bytes included. */
42
+ readonly maxResponseBytes: 64;
43
+ /** Longest APDU the host sends. */
44
+ readonly maxCommandBytes: 62;
45
+ };
46
+ /** The plugin's link to the card held to its device. */
47
+ export interface PluginCardChannel {
48
+ /**
49
+ * Relay one complete APDU to the card and resolve with the card's full answer, status bytes included. The host
50
+ * sends one APDU at a time. `signal` is aborted when the host no longer waits for the answer (timeout, abort,
51
+ * end of the conversation); stop relaying then. A late answer is ignored.
52
+ */
53
+ exchange(apdu: Uint8Array, options: {
54
+ signal: AbortSignal;
55
+ }): Promise<Uint8Array>;
56
+ }
57
+ export interface PluginCardAuthenticationRequest {
58
+ /**
59
+ * Card UID as reported by the device, hex (4 to 32 characters). It is compared exactly with the UID stored at
60
+ * enrollment, which Attractap readers report in lowercase.
61
+ */
62
+ uid: string;
63
+ /**
64
+ * Plugin-chosen id of the device that holds the card (1 to 200 characters). One conversation runs per plugin
65
+ * and device: a new `authenticate` for the same device ends the running one with `CARD_REMOVED`.
66
+ */
67
+ device: string;
68
+ channel: PluginCardChannel;
69
+ /** Abort it when the card left the field or the plugin gives up: the conversation ends with `CARD_REMOVED`. */
70
+ signal?: AbortSignal;
71
+ }
72
+ /** The authenticated card. It never carries key material. */
73
+ export interface PluginAuthenticatedCard {
74
+ id: number;
75
+ uid: string;
76
+ /** Owner of the card. Access decisions stay with the plugin (for example through `context.resourceAccess`). */
77
+ userId: number;
78
+ }
79
+ export type PluginCardAuthenticationResult = {
80
+ ok: true;
81
+ card: PluginAuthenticatedCard;
82
+ } | {
83
+ ok: false;
84
+ reason: PluginCardFailureReason;
85
+ };
86
+ /** `context.cards`. Requires the `CARD_AUTHENTICATION` permission. */
87
+ export interface PluginCardsContext {
88
+ /**
89
+ * Authenticates the card held to the plugin's device over its channel. Resolves for every card or conversation
90
+ * outcome. Rejects with a `TypeError` for an invalid request (no `channel.exchange`, a `device` that is empty or
91
+ * longer than 200 characters, a `signal` that is not an `AbortSignal`), and with a generic `Error` when the host
92
+ * fails (database unavailable, host still starting); retry later then.
93
+ */
94
+ authenticate(request: PluginCardAuthenticationRequest): Promise<PluginCardAuthenticationResult>;
95
+ }
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ /**
3
+ * Card authentication over a plugin's own NFC device (permission `CARD_AUTHENTICATION`).
4
+ *
5
+ * A plugin that owns an NFC-capable device hands the host the UID of the card held to it and a card channel: a
6
+ * function that relays one APDU to the card and returns the card's answer. The host runs the same check as a tap
7
+ * on an Attractap reader over that channel: it detects the card type and authenticates the card with the key
8
+ * stored for its UID. Card keys, session keys and secure messaging never leave the host; the plugin only relays
9
+ * bytes and receives the card's id, UID and owner, or a failure reason.
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.PLUGIN_CARD_LIMITS = exports.PluginCardFailureReason = void 0;
13
+ /** Stable failure reasons. Never renamed or removed. */
14
+ exports.PluginCardFailureReason = {
15
+ /** The server is at its limit of concurrent card conversations (readers and plugins together). Retry later. */
16
+ BUSY: 'BUSY',
17
+ /** The plugin aborted `signal`, or a newer `authenticate` for the same device took over. */
18
+ CARD_REMOVED: 'CARD_REMOVED',
19
+ /** One exchange took longer than 3 s, or the whole conversation longer than 15 s. */
20
+ TIMEOUT: 'TIMEOUT',
21
+ /** The conversation needed more than 32 exchanges. */
22
+ TOO_MANY_EXCHANGES: 'TOO_MANY_EXCHANGES',
23
+ /** `exchange` rejected, or resolved with something that is not a `Uint8Array` or is longer than 64 bytes. */
24
+ DEVICE_ERROR: 'DEVICE_ERROR',
25
+ /** The host is shutting down, or the plugin is being disabled, uninstalled or restarted. */
26
+ CANCELLED: 'CANCELLED',
27
+ /** The UID is not 4 to 32 hex characters. */
28
+ INVALID_UID: 'INVALID_UID',
29
+ /** No card is enrolled for this UID. */
30
+ CARD_NOT_FOUND: 'CARD_NOT_FOUND',
31
+ /** The card is enrolled but not active. */
32
+ CARD_NOT_ACTIVE: 'CARD_NOT_ACTIVE',
33
+ /** The card type is not supported (for example a DESFire EV1). */
34
+ CARD_NOT_SUPPORTED: 'CARD_NOT_SUPPORTED',
35
+ /** The card did not prove the key stored for its UID (a copied UID, a foreign card, a tampered answer). */
36
+ CARD_AUTHENTICATION_FAILED: 'CARD_AUTHENTICATION_FAILED',
37
+ };
38
+ /** Host caps of one card conversation. They are the same as for Attractap readers. */
39
+ exports.PLUGIN_CARD_LIMITS = {
40
+ exchangeTimeoutMs: 3000,
41
+ conversationTimeoutMs: 15000,
42
+ maxExchanges: 32,
43
+ /** Longest card answer, status bytes included. */
44
+ maxResponseBytes: 64,
45
+ /** Longest APDU the host sends. */
46
+ maxCommandBytes: 62,
47
+ };
48
+ //# sourceMappingURL=plugin-cards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-cards.js","sourceRoot":"","sources":["../../../../../libs/plugins-backend-sdk/src/lib/plugin-cards.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAEH,wDAAwD;AAC3C,QAAA,uBAAuB,GAAG;IACrC,+GAA+G;IAC/G,IAAI,EAAE,MAAM;IACZ,4FAA4F;IAC5F,YAAY,EAAE,cAAc;IAC5B,qFAAqF;IACrF,OAAO,EAAE,SAAS;IAClB,sDAAsD;IACtD,kBAAkB,EAAE,oBAAoB;IACxC,6GAA6G;IAC7G,YAAY,EAAE,cAAc;IAC5B,4FAA4F;IAC5F,SAAS,EAAE,WAAW;IACtB,6CAA6C;IAC7C,WAAW,EAAE,aAAa;IAC1B,wCAAwC;IACxC,cAAc,EAAE,gBAAgB;IAChC,2CAA2C;IAC3C,eAAe,EAAE,iBAAiB;IAClC,kEAAkE;IAClE,kBAAkB,EAAE,oBAAoB;IACxC,2GAA2G;IAC3G,0BAA0B,EAAE,4BAA4B;CAChD,CAAC;AAGX,sFAAsF;AACzE,QAAA,kBAAkB,GAAG;IAChC,iBAAiB,EAAE,IAAK;IACxB,qBAAqB,EAAE,KAAM;IAC7B,YAAY,EAAE,EAAE;IAChB,kDAAkD;IAClD,gBAAgB,EAAE,EAAE;IACpB,mCAAmC;IACnC,eAAe,EAAE,EAAE;CACX,CAAC"}
@@ -7,7 +7,9 @@ import type { PluginReaderUiApi, PluginStartBlockedApi } from './reader-ui';
7
7
  import type { PluginNotificationsContext } from './plugin-notifications';
8
8
  import type { PluginResourceAccessContext } from './plugin-resource-access';
9
9
  import type { PluginLiveUpdatesContext } from './plugin-live-updates';
10
+ import type { PluginLicenseContext } from './plugin-license';
10
11
  import type { PluginBleContext } from './plugin-ble';
12
+ import type { PluginCardsContext } from './plugin-cards';
11
13
  import { SystemEvent, SystemEventHandler, SystemEventPayload, SystemEventSubscription } from './plugin.interface';
12
14
  /**
13
15
  * DI token under which the host registers its MqttServerHostProvider
@@ -126,6 +128,11 @@ export interface PluginContext {
126
128
  * without BLE_TRANSPORT. Optional so plugins still type-check against hosts predating it.
127
129
  */
128
130
  readonly ble?: PluginBleContext;
131
+ /**
132
+ * Card authentication over the plugin's own NFC devices. Guarded getter: throws PluginPermissionError without
133
+ * CARD_AUTHENTICATION. Optional so plugins still type-check against hosts predating it.
134
+ */
135
+ readonly cards?: PluginCardsContext;
129
136
  /** This plugin's own manifest (name, version, directory, id). */
130
137
  readonly manifest: PluginManifestInfo;
131
138
  /** Shared application event bus — the same EventEmitter2 instance the host uses. */
@@ -186,5 +193,10 @@ export interface PluginContext {
186
193
  * must not be awaited inside `fn` either.
187
194
  */
188
195
  runSerialized<T>(fn: (manager: EntityManager) => Promise<T>): Promise<T>;
196
+ /**
197
+ * Query the license at runtime (see {@link PluginLicenseContext}). Needs no permission. Optional because hosts
198
+ * older than the plugin license support do not provide it; check before use when the plugin supports them.
199
+ */
200
+ readonly license?: PluginLicenseContext;
189
201
  }
190
202
  export { PluginBackendModule } from './plugin-backend-module';
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-context.js","sourceRoot":"","sources":["../../../../../libs/plugins-backend-sdk/src/lib/plugin-context.ts"],"names":[],"mappings":";;;AAWA;;;;GAIG;AACU,QAAA,yBAAyB,GAAG,MAAM,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAC;AA4EhG;;;GAGG;AACU,QAAA,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC"}
1
+ {"version":3,"file":"plugin-context.js","sourceRoot":"","sources":["../../../../../libs/plugins-backend-sdk/src/lib/plugin-context.ts"],"names":[],"mappings":";;;AAaA;;;;GAIG;AACU,QAAA,yBAAyB,GAAG,MAAM,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAC;AA4EhG;;;GAGG;AACU,QAAA,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC"}
@@ -0,0 +1,39 @@
1
+ /** The license of the Attraccess installation, as the host sees it right now. */
2
+ export interface PluginLicenseInfo {
3
+ /** Whether the license is valid. `false` also when no key is configured or the license could not be checked. */
4
+ valid: boolean;
5
+ /** Why the license is not valid. */
6
+ reason?: string;
7
+ /** Modules the license grants. The non-profit key grants core modules only, never plugin modules. */
8
+ modules: string[];
9
+ /** Usage limits by name (e.g. `users`, `resources`). A missing entry means no limit. */
10
+ usageLimits: Record<string, number>;
11
+ /** The installation uses the free non-profit key. */
12
+ isNonProfit: boolean;
13
+ }
14
+ export interface PluginLicenseRequirements {
15
+ /** License modules that must all be granted. */
16
+ modules?: string[];
17
+ /** Current usage by limit name; `verify` fails when a count has reached its limit. */
18
+ usageLimits?: Record<string, number>;
19
+ }
20
+ /** Thrown by {@link PluginLicenseContext.verify} when the license does not satisfy the requirements. */
21
+ export declare class PluginLicenseError extends Error {
22
+ readonly reason: string;
23
+ constructor(reason: string);
24
+ }
25
+ /**
26
+ * Lets a plugin ask the host about the license, so it can decide itself how much it offers. Backed by the same
27
+ * logic as the core's license checks. It needs no permission. Every call checks the license anew.
28
+ *
29
+ * What a plugin cannot work without belongs in the manifest (`license` in plugin.json): the host then does not load
30
+ * the plugin at all. Use this API for everything that should degrade gracefully instead.
31
+ */
32
+ export interface PluginLicenseContext {
33
+ /** Never throws: when the license cannot be determined, `valid` is false and `reason` says why. */
34
+ getLicense(): Promise<PluginLicenseInfo>;
35
+ /** True only when the license is valid and grants the module. False when it cannot be determined. */
36
+ hasModule(module: string): Promise<boolean>;
37
+ /** Resolves when the license is valid and satisfies the requirements, otherwise throws {@link PluginLicenseError}. */
38
+ verify(requirements?: PluginLicenseRequirements): Promise<void>;
39
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PluginLicenseError = void 0;
4
+ /** Thrown by {@link PluginLicenseContext.verify} when the license does not satisfy the requirements. */
5
+ class PluginLicenseError extends Error {
6
+ constructor(reason) {
7
+ super(`PLUGIN_LICENSE_ERROR: ${reason}`);
8
+ this.reason = reason;
9
+ this.name = 'PluginLicenseError';
10
+ }
11
+ }
12
+ exports.PluginLicenseError = PluginLicenseError;
13
+ //# sourceMappingURL=plugin-license.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-license.js","sourceRoot":"","sources":["../../../../../libs/plugins-backend-sdk/src/lib/plugin-license.ts"],"names":[],"mappings":";;;AAqBA,wGAAwG;AACxG,MAAa,kBAAmB,SAAQ,KAAK;IAC3C,YAA4B,MAAc;QACxC,KAAK,CAAC,yBAAyB,MAAM,EAAE,CAAC,CAAC;QADf,WAAM,GAAN,MAAM,CAAQ;QAExC,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF;AALD,gDAKC"}
@@ -142,7 +142,9 @@ export declare enum PluginPermission {
142
142
  /** Send in-app, push and email notifications to users via notifications.dispatch(). */
143
143
  SEND_NOTIFICATIONS = "SEND_NOTIFICATIONS",
144
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"
145
+ BLE_TRANSPORT = "BLE_TRANSPORT",
146
+ /** Authenticate NFC cards held to the plugin's own devices through context.cards. The plugin never sees card keys. */
147
+ CARD_AUTHENTICATION = "CARD_AUTHENTICATION"
146
148
  }
147
149
  /**
148
150
  * Human-readable description of each permission, surfaced to admins and plugin
@@ -57,6 +57,8 @@ var PluginPermission;
57
57
  PluginPermission["SEND_NOTIFICATIONS"] = "SEND_NOTIFICATIONS";
58
58
  /** Use the Bluetooth radio of administrator-approved Attractap readers through context.ble, limited to the plugin's own BLE profiles. */
59
59
  PluginPermission["BLE_TRANSPORT"] = "BLE_TRANSPORT";
60
+ /** Authenticate NFC cards held to the plugin's own devices through context.cards. The plugin never sees card keys. */
61
+ PluginPermission["CARD_AUTHENTICATION"] = "CARD_AUTHENTICATION";
60
62
  })(PluginPermission || (exports.PluginPermission = PluginPermission = {}));
61
63
  /**
62
64
  * Human-readable description of each permission, surfaced to admins and plugin
@@ -77,6 +79,7 @@ exports.PLUGIN_PERMISSION_DESCRIPTIONS = {
77
79
  [PluginPermission.ACCESS_HOOKS]: 'Ask users for confirmation or block resource session starts through pre-start hooks.',
78
80
  [PluginPermission.SEND_NOTIFICATIONS]: 'Send notifications to users (in-app, push and email) under plugin-declared notification categories.',
79
81
  [PluginPermission.BLE_TRANSPORT]: 'Use the Bluetooth radio of Attractap readers that an administrator opened for plugins, limited to the BLE profiles this plugin registers.',
82
+ [PluginPermission.CARD_AUTHENTICATION]: "Authenticate NFC cards held to the plugin's own devices with the Attraccess card keys. The plugin receives the card and its owner, never the keys.",
80
83
  };
81
84
  /**
82
85
  * 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":";;;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;IACj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;IAClH,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,iDAAiD;IACnF,CAAC,gBAAgB,CAAC,cAAc,CAAC,EAAE,gFAAgF;IACnH,CAAC,gBAAgB,CAAC,SAAS,CAAC,EAAE,2CAA2C;IACzE,CAAC,gBAAgB,CAAC,YAAY,CAAC,EAC7B,sFAAsF;IACxF,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,EACnC,qGAAqG;IACvG,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAC9B,2IAA2I;CAC9I,CAAC;AAEF;;GAEG;AACH,SAAgB,kBAAkB,CAAC,KAAa;IAC9C,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,sCAA8B,EAAE,KAAK,CAAC,CAAC;AACrF,CAAC;AAED;;;;GAIG;AACH,MAAa,qBAAsB,SAAQ,KAAK;IAK9C,YAAY,UAAkB,EAAE,UAAkB,EAAE,kBAAoC;QACtF,KAAK,CACH,WAAW,UAAU,uBAAuB,UAAU,wBAAwB;YAC5E,IAAI,kBAAkB,6EAA6E,CACtG,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACpC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,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":";;;AA2LA,gDAEC;AA3LD,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,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