@lucaapp/service-utils 5.27.0 → 5.29.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.
@@ -1,3 +1,3 @@
1
1
  import type { SecuritySchemeObject } from 'openapi3-ts/oas30';
2
- export type SecurityScheme = 'jwt_operator' | 'jwt_support' | 'jwt_operator_device' | 'jwt_consumer' | 'api_key';
2
+ export type SecurityScheme = 'jwt_operator' | 'jwt_support' | 'jwt_operator_device' | 'jwt_consumer' | 'api_key_operator_device' | 'api_key_atworld' | 'api_key_at_support' | 'basic_adyen_webhook' | 'hmac_adyen_webhook';
3
3
  export declare const SECURITY_SCHEMES: Record<SecurityScheme, SecuritySchemeObject>;
@@ -1,15 +1,37 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SECURITY_SCHEMES = void 0;
4
- const X_AUTH_HEADER = {
4
+ const xAuth = (description) => ({
5
5
  type: 'apiKey',
6
6
  in: 'header',
7
7
  name: 'X-Auth',
8
- };
8
+ description,
9
+ });
10
+ const xApiKey = (description) => ({
11
+ type: 'apiKey',
12
+ in: 'header',
13
+ name: 'X-Api-Key',
14
+ description,
15
+ });
16
+ const basicAuth = (description) => ({
17
+ type: 'http',
18
+ scheme: 'basic',
19
+ description,
20
+ });
21
+ const hmacHeader = (description) => ({
22
+ type: 'apiKey',
23
+ in: 'header',
24
+ name: 'hmacsignature',
25
+ description,
26
+ });
9
27
  exports.SECURITY_SCHEMES = {
10
- jwt_operator: X_AUTH_HEADER,
11
- jwt_support: X_AUTH_HEADER,
12
- jwt_operator_device: X_AUTH_HEADER,
13
- jwt_consumer: X_AUTH_HEADER,
14
- api_key: { type: 'apiKey', in: 'header', name: 'X-Api-Key' },
28
+ jwt_operator: xAuth('Operator session JWT issued by the luca backend'),
29
+ jwt_support: xAuth('Support session JWT issued by the luca backend'),
30
+ jwt_operator_device: xAuth('Operator device JWT issued by the luca backend (kiosk, terminal, link)'),
31
+ jwt_consumer: xAuth('Consumer JWT'),
32
+ api_key_operator_device: xApiKey('Operator device API key (sk_...) created by the operator for an external device'),
33
+ api_key_atworld: xApiKey('ATworld partner API key'),
34
+ api_key_at_support: xApiKey('AT support API key (partner or luca)'),
35
+ basic_adyen_webhook: basicAuth('Basic auth credential luca configures on the Adyen webhook endpoint'),
36
+ hmac_adyen_webhook: hmacHeader('Adyen HMAC-SHA256 signature over the raw request body, verified against the configured balance platform HMAC keys'),
15
37
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lucaapp/service-utils",
3
- "version": "5.27.0",
3
+ "version": "5.29.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -11,7 +11,7 @@
11
11
  "scripts": {
12
12
  "build": "tsc -p tsconfig.build.json",
13
13
  "ts:check": "tsc -p . --noEmit",
14
- "lint": "eslint .",
14
+ "lint": "eslint --quiet .",
15
15
  "test": "vitest run",
16
16
  "test:coverage": "vitest run --coverage",
17
17
  "test:ci": "VITEST_JUNIT_SUITE_NAME=service-utils CI=true vitest run --coverage",