@lucaapp/service-utils 5.33.0 → 5.34.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.
@@ -110,6 +110,12 @@ const sendErrorResponse = (response, error, knownErrors, debug) => {
110
110
  sendKnownErrorResponse(response, statusCode, error, debug);
111
111
  return;
112
112
  }
113
+ if (isTypedError(error)) {
114
+ // The service knew what went wrong and named it; the route just never said
115
+ // what to answer. Without this line that is a silent 500, and the only way
116
+ // anyone finds one is a 5xx alert days later.
117
+ response.log?.warn({ errorType: error.type, url: response.req?.originalUrl }, 'Typed error is not declared on this route, answering 500');
118
+ }
113
119
  sendUnknownErrorResponse(response, error, debug);
114
120
  return;
115
121
  };
@@ -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_operator_device' | 'api_key_atworld' | 'api_key_at_support' | 'basic_adyen_webhook' | 'hmac_adyen_webhook';
2
+ export type SecurityScheme = 'jwt_operator' | 'jwt_support' | 'jwt_operator_device' | 'jwt_consumer' | 'jwt_atworld_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>;
@@ -29,6 +29,7 @@ exports.SECURITY_SCHEMES = {
29
29
  jwt_support: xAuth('Support session JWT issued by the luca backend'),
30
30
  jwt_operator_device: xAuth('Operator device JWT issued by the luca backend (kiosk, terminal, link)'),
31
31
  jwt_consumer: xAuth('Consumer JWT'),
32
+ jwt_atworld_consumer: xAuth('ATworld consumer app JWT issued by backend-pay (aud: atworld-consumer)'),
32
33
  api_key_operator_device: xApiKey('Operator device API key (sk_...) created by the operator for an external device'),
33
34
  api_key_atworld: xApiKey('ATworld partner API key'),
34
35
  api_key_at_support: xApiKey('AT support API key (partner or luca)'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lucaapp/service-utils",
3
- "version": "5.33.0",
3
+ "version": "5.34.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [