@lowdefy/errors 0.0.0-experimental-20260717134857 → 0.0.0-experimental-20260720135014

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/dist/index.js CHANGED
@@ -47,18 +47,12 @@
47
47
  * - Caught: Caller of the action/resolver; signals "the called routine deliberately failed" as distinct from a system fault
48
48
  * - Format: [User Error] message
49
49
  *
50
- * 7. AuthenticationError - Unauthenticated request to a protected endpoint
51
- * - Thrown: API/request authorization when no caller resolved
52
- * - Caught: Server error handlers, before structured logging and Sentry (401)
53
- * - Format: [AuthenticationError] message
54
- *
55
50
  * Location Resolution Utilities:
56
51
  * resolveConfigLocation - Sync: configKey → {source, config} via keyMap/refMap
57
52
  * resolveErrorLocation - Sync: unified resolver (configKey or filePath/lineNumber)
58
53
  * loadAndResolveErrorLocation - Async: reads keyMap/refMap files at runtime
59
54
  * shouldSuppressBuildCheck - Check ~ignoreBuildChecks in parent chain
60
55
  */ import ActionError from './ActionError.js';
61
- import AuthenticationError from './AuthenticationError.js';
62
56
  import BlockError from './BlockError.js';
63
57
  import BuildError from './BuildError.js';
64
58
  import ConfigError from './ConfigError.js';
@@ -74,4 +68,4 @@ import resolveErrorLocation from './resolveErrorLocation.js';
74
68
  import ServiceError from './ServiceError.js';
75
69
  import shouldSuppressBuildCheck, { VALID_CHECK_SLUGS } from './shouldSuppressBuildCheck.js';
76
70
  import UserError from './UserError.js';
77
- export { ActionError, AuthenticationError, BlockError, BuildError, ConfigError, ConfigWarning, errorToDisplayString, LowdefyInternalError, OperatorError, PluginError, RequestError, resolveConfigLocation, loadAndResolveErrorLocation, resolveErrorLocation, ServiceError, shouldSuppressBuildCheck, UserError, VALID_CHECK_SLUGS };
71
+ export { ActionError, BlockError, BuildError, ConfigError, ConfigWarning, errorToDisplayString, LowdefyInternalError, OperatorError, PluginError, RequestError, resolveConfigLocation, loadAndResolveErrorLocation, resolveErrorLocation, ServiceError, shouldSuppressBuildCheck, UserError, VALID_CHECK_SLUGS };
@@ -34,34 +34,15 @@
34
34
  * // source: '/Users/dev/myapp/pages/home.yaml:5',
35
35
  * // config: 'root.pages[0:home].blocks[0:header]',
36
36
  * // }
37
- */ // Not every ref is a file — a module invocation's ref has no path of its own
38
- // (its content came from the invoking file's vars, and ~l line numbers point
39
- // into that file). Walk the refMap parent chain to the nearest ref that is a
40
- // real file; the root ref with no parent is lowdefy.yaml itself.
41
- function resolveRefPath({ refId, refMap }) {
42
- let currentId = refId;
43
- const seen = new Set();
44
- while(currentId && refMap?.[currentId] && !seen.has(currentId)){
45
- seen.add(currentId);
46
- const refEntry = refMap[currentId];
47
- if (refEntry.path) {
48
- return refEntry.path;
49
- }
50
- currentId = refEntry.parent;
51
- }
52
- return 'lowdefy.yaml';
53
- }
54
- function resolveConfigLocation({ configKey, keyMap, refMap, configDirectory }) {
37
+ */ function resolveConfigLocation({ configKey, keyMap, refMap, configDirectory }) {
55
38
  if (!configKey || !keyMap || !keyMap[configKey]) {
56
39
  return null;
57
40
  }
58
41
  const keyEntry = keyMap[configKey];
59
42
  const refId = keyEntry['~r'];
60
43
  const lineNumber = keyEntry['~l'];
61
- const filePath = resolveRefPath({
62
- refId,
63
- refMap
64
- });
44
+ const refEntry = refMap?.[refId];
45
+ const filePath = refEntry?.path || 'lowdefy.yaml';
65
46
  // config: the config path (e.g., "root.pages[0:home].blocks[0:header]")
66
47
  const config = keyEntry.key;
67
48
  // Use absolute path when configDirectory is available for clickable terminal links
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/errors",
3
- "version": "0.0.0-experimental-20260717134857",
3
+ "version": "0.0.0-experimental-20260720135014",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Lowdefy error classes for consistent error handling across build, server, and client",
6
6
  "homepage": "https://lowdefy.com",
@@ -35,8 +35,8 @@
35
35
  ],
36
36
  "devDependencies": {
37
37
  "@jest/globals": "28.1.3",
38
- "@swc/cli": "0.8.1",
39
- "@swc/core": "1.15.32",
38
+ "@swc/cli": "0.8.0",
39
+ "@swc/core": "1.15.18",
40
40
  "@swc/jest": "0.2.39",
41
41
  "jest": "28.1.3"
42
42
  },
@@ -1,28 +0,0 @@
1
- /*
2
- Copyright 2020-2026 Lowdefy, Inc
3
-
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
7
-
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
- */ // Thrown when a request to a protected endpoint carries no successful
16
- // authentication - the caller should fix its credentials (401). The server
17
- // error handlers branch on the name before the structured-log and Sentry
18
- // pipeline, so probing traffic produces a one-line warning, not error logs.
19
- let AuthenticationError = class AuthenticationError extends Error {
20
- constructor(message = 'Authentication required.', { cause } = {}){
21
- super(message, {
22
- cause
23
- });
24
- this.name = 'AuthenticationError';
25
- this.isLowdefyError = true;
26
- }
27
- };
28
- export default AuthenticationError;