@danceroutine/tango-core 1.11.0 → 1.11.2

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 (83) hide show
  1. package/dist/{TangoError-DdQVQNZU.js → TangoError-Cvgnm026.js} +8 -4
  2. package/dist/TangoError-Cvgnm026.js.map +1 -0
  3. package/dist/TangoError-ptR2iApz.d.ts +45 -0
  4. package/dist/chunk-D7D4PA-g.js +13 -0
  5. package/dist/errors/index.d.ts +3 -15
  6. package/dist/errors/index.js +3 -5
  7. package/dist/{errors-VacGsSaj.js → errors-DpI5Dxmr.js} +45 -36
  8. package/dist/errors-DpI5Dxmr.js.map +1 -0
  9. package/dist/http/index.d.ts +2 -10
  10. package/dist/http/index.js +2 -5
  11. package/dist/{http-63cMANMG.js → http-6e0y_vd6.js} +95 -79
  12. package/dist/{http-63cMANMG.js.map → http-6e0y_vd6.js.map} +1 -1
  13. package/dist/index-B5PoK4LH.d.ts +86 -0
  14. package/dist/index-D8o4DOOG.d.ts +824 -0
  15. package/dist/index-DFWodYLS.d.ts +161 -0
  16. package/dist/index-DPABSINz.d.ts +114 -0
  17. package/dist/index-MZzjIxgD.d.ts +59 -0
  18. package/dist/index.d.ts +7 -20
  19. package/dist/index.js +13 -7
  20. package/dist/index.js.map +1 -0
  21. package/dist/logging/index.d.ts +2 -3
  22. package/dist/logging/index.js +2 -3
  23. package/dist/logging-UC5uXHET.js +68 -0
  24. package/dist/logging-UC5uXHET.js.map +1 -0
  25. package/dist/runtime/index.d.ts +2 -14
  26. package/dist/runtime/index.js +2 -3
  27. package/dist/{runtime-B8KkgD3R.js → runtime-BAG_EKuM.js} +44 -35
  28. package/dist/runtime-BAG_EKuM.js.map +1 -0
  29. package/dist/sql/index.d.ts +2 -13
  30. package/dist/sql/index.js +2 -3
  31. package/dist/{sql-BI3ptL9-.js → sql-CIPnuTYO.js} +21 -16
  32. package/dist/{sql-BI3ptL9-.js.map → sql-CIPnuTYO.js.map} +1 -1
  33. package/package.json +3 -3
  34. package/dist/TangoError-DdQVQNZU.js.map +0 -1
  35. package/dist/chunk-BkvOhyD0.js +0 -12
  36. package/dist/errors/AuthenticationError.d.ts +0 -15
  37. package/dist/errors/ConflictError.d.ts +0 -15
  38. package/dist/errors/HttpError.d.ts +0 -7
  39. package/dist/errors/MultipleObjectsReturned.d.ts +0 -11
  40. package/dist/errors/NotFoundError.d.ts +0 -15
  41. package/dist/errors/PermissionDenied.d.ts +0 -15
  42. package/dist/errors/TangoError.d.ts +0 -33
  43. package/dist/errors/ValidationError.d.ts +0 -14
  44. package/dist/errors/factories/HttpErrorFactory.d.ts +0 -59
  45. package/dist/errors/factories/index.d.ts +0 -4
  46. package/dist/errors-VacGsSaj.js.map +0 -1
  47. package/dist/http/TangoBody.d.ts +0 -110
  48. package/dist/http/TangoHeaders.d.ts +0 -191
  49. package/dist/http/TangoQueryParams.d.ts +0 -81
  50. package/dist/http/TangoRequest.d.ts +0 -130
  51. package/dist/http/TangoResponse.d.ts +0 -305
  52. package/dist/logging/ConsoleLogger.d.ts +0 -15
  53. package/dist/logging/Logger.d.ts +0 -13
  54. package/dist/logging/getLogger.d.ts +0 -23
  55. package/dist/logging-BWeD4HOO.js +0 -48
  56. package/dist/logging-BWeD4HOO.js.map +0 -1
  57. package/dist/runtime/binary/index.d.ts +0 -6
  58. package/dist/runtime/binary/isArrayBuffer.d.ts +0 -4
  59. package/dist/runtime/binary/isBlob.d.ts +0 -4
  60. package/dist/runtime/binary/isUint8Array.d.ts +0 -4
  61. package/dist/runtime/date/index.d.ts +0 -4
  62. package/dist/runtime/date/isDate.d.ts +0 -4
  63. package/dist/runtime/error/index.d.ts +0 -4
  64. package/dist/runtime/error/isError.d.ts +0 -4
  65. package/dist/runtime/internal/hasTag.d.ts +0 -1
  66. package/dist/runtime/object/index.d.ts +0 -5
  67. package/dist/runtime/object/isNil.d.ts +0 -4
  68. package/dist/runtime/object/isObject.d.ts +0 -4
  69. package/dist/runtime/web/index.d.ts +0 -7
  70. package/dist/runtime/web/isFile.d.ts +0 -4
  71. package/dist/runtime/web/isFormData.d.ts +0 -4
  72. package/dist/runtime/web/isReadableStream.d.ts +0 -4
  73. package/dist/runtime/web/isURLSearchParams.d.ts +0 -4
  74. package/dist/runtime-B8KkgD3R.js.map +0 -1
  75. package/dist/sql/SqlDialect.d.ts +0 -5
  76. package/dist/sql/SqlIdentifierRole.d.ts +0 -13
  77. package/dist/sql/SqlSafetyEngine.d.ts +0 -50
  78. package/dist/sql/TrustedSqlFragment.d.ts +0 -5
  79. package/dist/sql/ValidatedSqlIdentifier.d.ts +0 -7
  80. package/dist/sql/isTrustedSqlFragment.d.ts +0 -5
  81. package/dist/sql/quoteSqlIdentifier.d.ts +0 -6
  82. package/dist/sql/trustedSql.d.ts +0 -5
  83. package/dist/sql/validateSqlIdentifier.d.ts +0 -6
@@ -0,0 +1,161 @@
1
+ import { a as HttpError, i as TangoError, n as ErrorEnvelope, r as ProblemDetails, t as ErrorDetails } from "./TangoError-ptR2iApz.js";
2
+
3
+ //#region src/errors/factories/HttpErrorFactory.d.ts
4
+ interface HttpErrorFactoryConfig {
5
+ /**
6
+ * When true, raw error messages are included in HTTP responses.
7
+ * When false, generic messages are returned for non-TangoError exceptions.
8
+ * Defaults to true (dev-friendly). Set to false in production.
9
+ */
10
+ exposeErrors?: boolean;
11
+ }
12
+ /**
13
+ * Converts errors into structured HTTP error responses.
14
+ * Supports TangoError subclasses out of the box, and custom error handlers
15
+ * can be registered for third-party or application-specific error types.
16
+ *
17
+ * @example
18
+ * ```typescript
19
+ * // Development (default) — exposes real error messages
20
+ * const devFactory = new HttpErrorFactory();
21
+ *
22
+ * // Production — hides internal error details
23
+ * const prodFactory = new HttpErrorFactory({ exposeErrors: false });
24
+ *
25
+ * // Register a custom handler for a third-party error
26
+ * prodFactory.registerHandler(ZodError, (err) => ({
27
+ * status: 400,
28
+ * body: { error: 'Validation failed', details: err.flatten().fieldErrors },
29
+ * }));
30
+ *
31
+ * // Quick one-shot conversion with dev defaults
32
+ * const httpError = HttpErrorFactory.toHttpError(new NotFoundError('missing'));
33
+ * ```
34
+ */
35
+ declare class HttpErrorFactory {
36
+ static readonly BRAND: "tango.error_factory.http";
37
+ readonly __tangoBrand: typeof HttpErrorFactory.BRAND;
38
+ private handlers;
39
+ private exposeErrors;
40
+ constructor(config?: HttpErrorFactoryConfig);
41
+ /**
42
+ * Narrow an unknown value to `HttpErrorFactory`.
43
+ */
44
+ static isHttpErrorFactory(value: unknown): value is HttpErrorFactory;
45
+ /**
46
+ * Convert an unknown error into an `HttpError` using dev-friendly defaults.
47
+ * Shorthand for `new HttpErrorFactory().create(error)`.
48
+ */
49
+ static toHttpError(error: unknown): HttpError;
50
+ private static isZodLikeValidationError;
51
+ private static zodLikeErrorDetails;
52
+ /**
53
+ * Register a custom mapper for an application or third-party error type.
54
+ */
55
+ registerHandler<T extends Error>(errorClass: new (...args: any[]) => T, handler: (error: T) => HttpError): this;
56
+ /**
57
+ * Convert an unknown error into the normalized HTTP error shape Tango uses.
58
+ */
59
+ create(error: unknown): HttpError;
60
+ private isErrorClassInstance;
61
+ }
62
+ declare namespace index_d_exports$1 {
63
+ export { HttpErrorFactory, HttpErrorFactoryConfig };
64
+ }
65
+ //#endregion
66
+ //#region src/errors/ConflictError.d.ts
67
+ /** Error for conflicting resource state (HTTP 409). */
68
+ declare class ConflictError extends TangoError {
69
+ static readonly BRAND: "tango.error.conflict";
70
+ readonly __tangoBrand: typeof ConflictError.BRAND;
71
+ status: number;
72
+ /** Create a conflict error with optional custom message. */
73
+ constructor(message?: string);
74
+ /**
75
+ * Narrow an unknown value to `ConflictError`.
76
+ */
77
+ static isConflictError(value: unknown): value is ConflictError;
78
+ protected getErrorName(): string;
79
+ protected getDetails(): ErrorDetails;
80
+ }
81
+ //#endregion
82
+ //#region src/errors/ValidationError.d.ts
83
+ /** Error for request validation failures (HTTP 400). */
84
+ declare class ValidationError extends TangoError {
85
+ details?: ErrorDetails;
86
+ readonly __tangoValidationErrorBrand: "tango.error.validation";
87
+ status: number;
88
+ constructor(message: string, details?: ErrorDetails);
89
+ /**
90
+ * Narrow an unknown value to `ValidationError`, including common legacy shapes.
91
+ */
92
+ static isValidationError(err: unknown): err is ValidationError;
93
+ protected getErrorName(): string;
94
+ protected getDetails(): ErrorDetails;
95
+ }
96
+ //#endregion
97
+ //#region src/errors/MultipleObjectsReturned.d.ts
98
+ /** Error when a queryset lookup returns more than one row (HTTP 409). */
99
+ declare class MultipleObjectsReturned extends TangoError {
100
+ static readonly BRAND: "tango.error.multiple_objects_returned";
101
+ readonly __tangoBrand: typeof MultipleObjectsReturned.BRAND;
102
+ status: number;
103
+ constructor(message?: string);
104
+ static isMultipleObjectsReturned(value: unknown): value is MultipleObjectsReturned;
105
+ protected getErrorName(): string;
106
+ protected getDetails(): ErrorDetails;
107
+ }
108
+ //#endregion
109
+ //#region src/errors/NotFoundError.d.ts
110
+ /** Error for missing resources (HTTP 404). */
111
+ declare class NotFoundError extends TangoError {
112
+ static readonly BRAND: "tango.error.not_found";
113
+ readonly __tangoBrand: typeof NotFoundError.BRAND;
114
+ status: number;
115
+ /** Create a not-found error with optional custom message. */
116
+ constructor(message?: string);
117
+ /**
118
+ * Narrow an unknown value to `NotFoundError`.
119
+ */
120
+ static isNotFoundError(value: unknown): value is NotFoundError;
121
+ protected getErrorName(): string;
122
+ protected getDetails(): ErrorDetails;
123
+ }
124
+ //#endregion
125
+ //#region src/errors/PermissionDenied.d.ts
126
+ /** Error for authorization failures (HTTP 403). */
127
+ declare class PermissionDenied extends TangoError {
128
+ static readonly BRAND: "tango.error.permission_denied";
129
+ readonly __tangoBrand: typeof PermissionDenied.BRAND;
130
+ status: number;
131
+ /** Create a permission-denied error with optional custom message. */
132
+ constructor(message?: string);
133
+ /**
134
+ * Narrow an unknown value to `PermissionDenied`.
135
+ */
136
+ static isPermissionDenied(value: unknown): value is PermissionDenied;
137
+ protected getErrorName(): string;
138
+ protected getDetails(): ErrorDetails;
139
+ }
140
+ //#endregion
141
+ //#region src/errors/AuthenticationError.d.ts
142
+ /** Error for missing/invalid authentication (HTTP 401). */
143
+ declare class AuthenticationError extends TangoError {
144
+ static readonly BRAND: "tango.error.authentication";
145
+ readonly __tangoBrand: typeof AuthenticationError.BRAND;
146
+ status: number;
147
+ /** Create an authentication error with optional custom message. */
148
+ constructor(message?: string);
149
+ /**
150
+ * Narrow an unknown value to `AuthenticationError`.
151
+ */
152
+ static isAuthenticationError(value: unknown): value is AuthenticationError;
153
+ protected getErrorName(): string;
154
+ protected getDetails(): ErrorDetails;
155
+ }
156
+ declare namespace index_d_exports {
157
+ export { AuthenticationError, ConflictError, ErrorDetails, ErrorEnvelope, HttpError, HttpErrorFactory, HttpErrorFactoryConfig, MultipleObjectsReturned, NotFoundError, PermissionDenied, ProblemDetails, TangoError, ValidationError, index_d_exports$1 as factories };
158
+ }
159
+ //#endregion
160
+ export { MultipleObjectsReturned as a, index_d_exports$1 as c, NotFoundError as i, HttpErrorFactory as l, AuthenticationError as n, ValidationError as o, PermissionDenied as r, ConflictError as s, index_d_exports as t, HttpErrorFactoryConfig as u };
161
+ //# sourceMappingURL=index-DFWodYLS.d.ts.map
@@ -0,0 +1,114 @@
1
+ //#region src/sql/SqlDialect.d.ts
2
+ declare const InternalSqlDialect: {
3
+ readonly POSTGRES: "postgres";
4
+ readonly SQLITE: "sqlite";
5
+ };
6
+ type SqlDialect = (typeof InternalSqlDialect)[keyof typeof InternalSqlDialect];
7
+ //#endregion
8
+ //#region src/sql/SqlIdentifierRole.d.ts
9
+ declare const InternalSqlIdentifierRole: {
10
+ readonly TABLE: "table";
11
+ readonly COLUMN: "column";
12
+ readonly PRIMARY_KEY: "primaryKey";
13
+ readonly INDEX: "index";
14
+ readonly ALIAS: "alias";
15
+ readonly CONSTRAINT: "constraint";
16
+ readonly SCHEMA: "schema";
17
+ readonly RELATION_TABLE: "relationTable";
18
+ readonly RELATION_FOREIGN_KEY: "relationForeignKey";
19
+ readonly RELATION_TARGET_PRIMARY_KEY: "relationTargetPrimaryKey";
20
+ };
21
+ type SqlIdentifierRole = (typeof InternalSqlIdentifierRole)[keyof typeof InternalSqlIdentifierRole];
22
+ //#endregion
23
+ //#region src/sql/TrustedSqlFragment.d.ts
24
+ declare const TRUSTED_SQL_FRAGMENT_BRAND: "tango.core.trusted_sql_fragment";
25
+ type TrustedSqlFragment = {
26
+ readonly __tangoBrand: typeof TRUSTED_SQL_FRAGMENT_BRAND;
27
+ readonly sql: string;
28
+ };
29
+ //#endregion
30
+ //#region src/sql/ValidatedSqlIdentifier.d.ts
31
+ declare const VALIDATED_SQL_IDENTIFIER_BRAND: "tango.core.validated_sql_identifier";
32
+ type ValidatedSqlIdentifier = {
33
+ readonly __tangoBrand: typeof VALIDATED_SQL_IDENTIFIER_BRAND;
34
+ readonly role: SqlIdentifierRole;
35
+ readonly value: string;
36
+ };
37
+ //#endregion
38
+ //#region src/sql/SqlSafetyEngine.d.ts
39
+ type SqlIdentifierRequest = {
40
+ key: string;
41
+ role: SqlIdentifierRole;
42
+ value: string;
43
+ allowlist?: readonly string[];
44
+ };
45
+ type SqlLookupTokenRequest = {
46
+ key: string;
47
+ lookup: string;
48
+ allowed: readonly string[];
49
+ };
50
+ type SqlRawFragmentRequest = {
51
+ key: string;
52
+ value: TrustedSqlFragment;
53
+ };
54
+ type SqlSafetyRequest = {
55
+ dialect?: SqlDialect;
56
+ identifiers?: readonly SqlIdentifierRequest[];
57
+ lookupTokens?: readonly SqlLookupTokenRequest[];
58
+ rawFragments?: readonly SqlRawFragmentRequest[];
59
+ };
60
+ type ValidatedSqlLookupToken = {
61
+ lookup: string;
62
+ };
63
+ type ValidatedSqlSafetyResult = {
64
+ identifiers: Record<string, ValidatedSqlIdentifier>;
65
+ lookupTokens: Record<string, ValidatedSqlLookupToken>;
66
+ rawFragments: Record<string, TrustedSqlFragment>;
67
+ };
68
+ /**
69
+ * Canonical SQL safety policy engine shared across Tango packages.
70
+ */
71
+ declare class SqlSafetyEngine {
72
+ static readonly BRAND: "tango.core.sql_safety_engine";
73
+ readonly __tangoBrand: typeof SqlSafetyEngine.BRAND;
74
+ /**
75
+ * Narrow an unknown value to `SqlSafetyEngine`.
76
+ */
77
+ static isSqlSafetyEngine(value: unknown): value is SqlSafetyEngine;
78
+ /**
79
+ * Validate a canonical SQL safety request and return trusted tokens.
80
+ */
81
+ validate(request: SqlSafetyRequest): ValidatedSqlSafetyResult;
82
+ private validateLookupToken;
83
+ private validateRawFragment;
84
+ }
85
+ //#endregion
86
+ //#region src/sql/trustedSql.d.ts
87
+ /**
88
+ * Explicitly opt into embedding a reviewed raw SQL fragment.
89
+ */
90
+ declare function trustedSql(sql: string): TrustedSqlFragment;
91
+ //#endregion
92
+ //#region src/sql/isTrustedSqlFragment.d.ts
93
+ /**
94
+ * Narrow an unknown value to a trusted raw SQL fragment.
95
+ */
96
+ declare function isTrustedSqlFragment(value: unknown): value is TrustedSqlFragment;
97
+ //#endregion
98
+ //#region src/sql/validateSqlIdentifier.d.ts
99
+ /**
100
+ * Validate an identifier against Tango's SQL safety policy.
101
+ */
102
+ declare function validateSqlIdentifier(value: string, role: SqlIdentifierRole, allowlist?: readonly string[]): ValidatedSqlIdentifier;
103
+ //#endregion
104
+ //#region src/sql/quoteSqlIdentifier.d.ts
105
+ /**
106
+ * Quote a validated identifier for the target SQL dialect.
107
+ */
108
+ declare function quoteSqlIdentifier(identifier: ValidatedSqlIdentifier, _dialect: SqlDialect): string;
109
+ declare namespace index_d_exports {
110
+ export { SqlDialect, SqlIdentifierRequest, SqlIdentifierRole, SqlLookupTokenRequest, SqlRawFragmentRequest, SqlSafetyEngine, SqlSafetyRequest, TrustedSqlFragment, ValidatedSqlIdentifier, ValidatedSqlLookupToken, ValidatedSqlSafetyResult, isTrustedSqlFragment, quoteSqlIdentifier, trustedSql, validateSqlIdentifier };
111
+ }
112
+ //#endregion
113
+ export { trustedSql as a, SqlRawFragmentRequest as c, ValidatedSqlLookupToken as d, ValidatedSqlSafetyResult as f, SqlDialect as g, SqlIdentifierRole as h, isTrustedSqlFragment as i, SqlSafetyEngine as l, TrustedSqlFragment as m, quoteSqlIdentifier as n, SqlIdentifierRequest as o, ValidatedSqlIdentifier as p, validateSqlIdentifier as r, SqlLookupTokenRequest as s, index_d_exports as t, SqlSafetyRequest as u };
114
+ //# sourceMappingURL=index-DPABSINz.d.ts.map
@@ -0,0 +1,59 @@
1
+ //#region src/logging/Logger.d.ts
2
+ /**
3
+ * Minimal logging interface for the Tango framework.
4
+ *
5
+ * Consumers may provide their own implementation (Pino, Winston, etc.)
6
+ * via `TangoConfig.logger`. The framework never makes assumptions about
7
+ * transports, formatting, or log levels beyond these four methods.
8
+ */
9
+ interface Logger {
10
+ error(message: string, ...args: unknown[]): void;
11
+ warn(message: string, ...args: unknown[]): void;
12
+ info(message: string, ...args: unknown[]): void;
13
+ debug(message: string, ...args: unknown[]): void;
14
+ }
15
+ //#endregion
16
+ //#region src/logging/ConsoleLogger.d.ts
17
+ /**
18
+ * Default `Logger` implementation that delegates to `console.*`.
19
+ *
20
+ * Each message is prefixed with the scope string so log output is
21
+ * filterable by origin (e.g. `[tango.adapter.next] Adapter error: …`).
22
+ */
23
+ declare class ConsoleLogger implements Logger {
24
+ private readonly scope;
25
+ constructor(scope: string);
26
+ error(message: string, ...args: unknown[]): void;
27
+ warn(message: string, ...args: unknown[]): void;
28
+ info(message: string, ...args: unknown[]): void;
29
+ debug(message: string, ...args: unknown[]): void;
30
+ }
31
+ //#endregion
32
+ //#region src/logging/getLogger.d.ts
33
+ type LoggerFactory = (scope: string) => Logger;
34
+ /**
35
+ * Return a `Logger` bound to the given scope name.
36
+ *
37
+ * By default loggers are `ConsoleLogger` instances. Call
38
+ * `setLoggerFactory` to redirect all framework logging
39
+ * to a custom implementation (Pino, Winston, etc.).
40
+ */
41
+ declare function getLogger(scope: string): Logger;
42
+ /**
43
+ * Replace the global logger factory used by `getLogger`.
44
+ *
45
+ * Typically called once during application bootstrap from
46
+ * the resolved `TangoConfig.logger` value.
47
+ */
48
+ declare function setLoggerFactory(custom: LoggerFactory | Logger): void;
49
+ /**
50
+ * Reset the logger factory to the default `ConsoleLogger`.
51
+ * Primarily useful in tests.
52
+ */
53
+ declare function resetLoggerFactory(): void;
54
+ declare namespace index_d_exports {
55
+ export { ConsoleLogger, Logger, getLogger, resetLoggerFactory, setLoggerFactory };
56
+ }
57
+ //#endregion
58
+ export { ConsoleLogger as a, setLoggerFactory as i, getLogger as n, Logger as o, resetLoggerFactory as r, index_d_exports as t };
59
+ //# sourceMappingURL=index-MZzjIxgD.d.ts.map
package/dist/index.d.ts CHANGED
@@ -1,20 +1,7 @@
1
- /**
2
- * Domain boundary barrel: centralizes this subdomain's public contract.
3
- */
4
- import * as errors from './errors/index';
5
- import * as http from './http/index';
6
- import * as logging from './logging/index';
7
- import * as runtime from './runtime/index';
8
- import * as sql from './sql/index';
9
- import { AuthenticationError, ConflictError, HttpErrorFactory, MultipleObjectsReturned, NotFoundError, PermissionDenied, TangoError, ValidationError, type ErrorDetails, type ErrorEnvelope, type HttpError, type HttpErrorFactoryConfig, type ProblemDetails } from './errors/index';
10
- import { TangoBody, type JsonValue, TangoHeaders, TangoQueryParams, TangoRequest, TangoResponse } from './http/index';
11
- import { ConsoleLogger, getLogger, setLoggerFactory, resetLoggerFactory, type Logger } from './logging/index';
12
- import { SqlSafetyEngine, isTrustedSqlFragment, quoteSqlIdentifier, trustedSql, validateSqlIdentifier, type SqlDialect, type SqlIdentifierRequest, type SqlIdentifierRole, type SqlLookupTokenRequest, type SqlRawFragmentRequest, type SqlSafetyRequest, type TrustedSqlFragment, type ValidatedSqlIdentifier, type ValidatedSqlLookupToken, type ValidatedSqlSafetyResult } from './sql/index';
13
- import { isArrayBuffer, isBlob, isDate, isError, isFile, isFormData, isObject, isReadableStream, isUint8Array, isURLSearchParams } from './runtime/index';
14
- /**
15
- * Bundled exports for Django-style domain drill-down imports, plus curated
16
- * top-level symbols for TS-native ergonomic imports.
17
- */
18
- export { errors, http, logging, runtime, sql };
19
- export { AuthenticationError, ConflictError, HttpErrorFactory, MultipleObjectsReturned, NotFoundError, PermissionDenied, TangoBody, TangoError, TangoHeaders, TangoQueryParams, TangoRequest, TangoResponse, ValidationError, ConsoleLogger, getLogger, setLoggerFactory, resetLoggerFactory, SqlSafetyEngine, trustedSql, isTrustedSqlFragment, validateSqlIdentifier, quoteSqlIdentifier, isArrayBuffer, isBlob, isDate, isError, isFile, isFormData, isObject, isReadableStream, isUint8Array, isURLSearchParams, };
20
- export type { ErrorDetails, ErrorEnvelope, HttpError, HttpErrorFactoryConfig, JsonValue, Logger, ProblemDetails, SqlDialect, SqlIdentifierRequest, SqlIdentifierRole, SqlLookupTokenRequest, SqlRawFragmentRequest, SqlSafetyRequest, TrustedSqlFragment, ValidatedSqlIdentifier, ValidatedSqlLookupToken, ValidatedSqlSafetyResult, };
1
+ import { a as HttpError, i as TangoError, n as ErrorEnvelope, r as ProblemDetails, t as ErrorDetails } from "./TangoError-ptR2iApz.js";
2
+ import { a as MultipleObjectsReturned, i as NotFoundError, l as HttpErrorFactory, n as AuthenticationError, o as ValidationError, r as PermissionDenied, s as ConflictError, t as index_d_exports, u as HttpErrorFactoryConfig } from "./index-DFWodYLS.js";
3
+ import { a as TangoHeaders, i as TangoRequest, n as TangoResponse, o as JsonValue, r as TangoQueryParams, s as TangoBody, t as index_d_exports$1 } from "./index-D8o4DOOG.js";
4
+ import { a as ConsoleLogger, i as setLoggerFactory, n as getLogger, o as Logger, r as resetLoggerFactory, t as index_d_exports$2 } from "./index-MZzjIxgD.js";
5
+ import { _ as isArrayBuffer, a as isError, c as isObject, d as isReadableStream, f as isURLSearchParams, g as isUint8Array, h as isBlob, p as isFormData, r as isDate, t as index_d_exports$3, u as isFile } from "./index-B5PoK4LH.js";
6
+ import { a as trustedSql, c as SqlRawFragmentRequest, d as ValidatedSqlLookupToken, f as ValidatedSqlSafetyResult, g as SqlDialect, h as SqlIdentifierRole, i as isTrustedSqlFragment, l as SqlSafetyEngine, m as TrustedSqlFragment, n as quoteSqlIdentifier, o as SqlIdentifierRequest, p as ValidatedSqlIdentifier, r as validateSqlIdentifier, s as SqlLookupTokenRequest, t as index_d_exports$4, u as SqlSafetyRequest } from "./index-DPABSINz.js";
7
+ export { AuthenticationError, ConflictError, ConsoleLogger, type ErrorDetails, type ErrorEnvelope, type HttpError, HttpErrorFactory, type HttpErrorFactoryConfig, type JsonValue, type Logger, MultipleObjectsReturned, NotFoundError, PermissionDenied, type ProblemDetails, type SqlDialect, type SqlIdentifierRequest, type SqlIdentifierRole, type SqlLookupTokenRequest, type SqlRawFragmentRequest, SqlSafetyEngine, type SqlSafetyRequest, TangoBody, TangoError, TangoHeaders, TangoQueryParams, TangoRequest, TangoResponse, type TrustedSqlFragment, type ValidatedSqlIdentifier, type ValidatedSqlLookupToken, type ValidatedSqlSafetyResult, ValidationError, index_d_exports as errors, getLogger, index_d_exports$1 as http, isArrayBuffer, isBlob, isDate, isError, isFile, isFormData, isObject, isReadableStream, isTrustedSqlFragment, isURLSearchParams, isUint8Array, index_d_exports$2 as logging, quoteSqlIdentifier, resetLoggerFactory, index_d_exports$3 as runtime, setLoggerFactory, index_d_exports$4 as sql, trustedSql, validateSqlIdentifier };
package/dist/index.js CHANGED
@@ -1,8 +1,14 @@
1
- import { TangoError } from "./TangoError-DdQVQNZU.js";
2
- import { isArrayBuffer, isBlob, isDate, isError, isFile, isFormData, isObject, isReadableStream, isURLSearchParams, isUint8Array, runtime_exports } from "./runtime-B8KkgD3R.js";
3
- import { AuthenticationError, ConflictError, HttpErrorFactory, MultipleObjectsReturned, NotFoundError, PermissionDenied, ValidationError, errors_exports } from "./errors-VacGsSaj.js";
4
- import { TangoBody, TangoHeaders, TangoQueryParams, TangoRequest, TangoResponse, http_exports } from "./http-63cMANMG.js";
5
- import { ConsoleLogger, getLogger, logging_exports, resetLoggerFactory, setLoggerFactory } from "./logging-BWeD4HOO.js";
6
- import { SqlSafetyEngine, isTrustedSqlFragment, quoteSqlIdentifier, sql_exports, trustedSql, validateSqlIdentifier } from "./sql-BI3ptL9-.js";
1
+ import { t as TangoError } from "./TangoError-Cvgnm026.js";
2
+ import { a as isError, d as isURLSearchParams, f as isFormData, g as isArrayBuffer, h as isUint8Array, l as isFile, m as isBlob, r as isDate, s as isObject, t as runtime_exports, u as isReadableStream } from "./runtime-BAG_EKuM.js";
3
+ import { a as MultipleObjectsReturned, i as NotFoundError, l as HttpErrorFactory, n as AuthenticationError, o as ValidationError, r as PermissionDenied, s as ConflictError, t as errors_exports } from "./errors-DpI5Dxmr.js";
4
+ import { a as TangoHeaders, i as TangoQueryParams, n as TangoResponse, o as TangoBody, r as TangoRequest, t as http_exports } from "./http-6e0y_vd6.js";
5
+ import { a as ConsoleLogger, i as setLoggerFactory, n as getLogger, r as resetLoggerFactory, t as logging_exports } from "./logging-UC5uXHET.js";
6
+ import { a as validateSqlIdentifier, i as SqlSafetyEngine, n as quoteSqlIdentifier, o as isTrustedSqlFragment, r as trustedSql, t as sql_exports } from "./sql-CIPnuTYO.js";
7
+ //#region src/index.ts
8
+ /**
9
+ * Domain boundary barrel: centralizes this subdomain's public contract.
10
+ */
11
+ //#endregion
12
+ export { AuthenticationError, ConflictError, ConsoleLogger, HttpErrorFactory, MultipleObjectsReturned, NotFoundError, PermissionDenied, SqlSafetyEngine, TangoBody, TangoError, TangoHeaders, TangoQueryParams, TangoRequest, TangoResponse, ValidationError, errors_exports as errors, getLogger, http_exports as http, isArrayBuffer, isBlob, isDate, isError, isFile, isFormData, isObject, isReadableStream, isTrustedSqlFragment, isURLSearchParams, isUint8Array, logging_exports as logging, quoteSqlIdentifier, resetLoggerFactory, runtime_exports as runtime, setLoggerFactory, sql_exports as sql, trustedSql, validateSqlIdentifier };
7
13
 
8
- export { AuthenticationError, ConflictError, ConsoleLogger, HttpErrorFactory, MultipleObjectsReturned, NotFoundError, PermissionDenied, SqlSafetyEngine, TangoBody, TangoError, TangoHeaders, TangoQueryParams, TangoRequest, TangoResponse, ValidationError, errors_exports as errors, getLogger, http_exports as http, isArrayBuffer, isBlob, isDate, isError, isFile, isFormData, isObject, isReadableStream, isTrustedSqlFragment, isURLSearchParams, isUint8Array, logging_exports as logging, quoteSqlIdentifier, resetLoggerFactory, runtime_exports as runtime, setLoggerFactory, sql_exports as sql, trustedSql, validateSqlIdentifier };
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * Domain boundary barrel: centralizes this subdomain's public contract.\n */\n\nimport * as errors from './errors/index';\nimport * as http from './http/index';\nimport * as logging from './logging/index';\nimport * as runtime from './runtime/index';\nimport * as sql from './sql/index';\nimport {\n AuthenticationError,\n ConflictError,\n HttpErrorFactory,\n MultipleObjectsReturned,\n NotFoundError,\n PermissionDenied,\n TangoError,\n ValidationError,\n type ErrorDetails,\n type ErrorEnvelope,\n type HttpError,\n type HttpErrorFactoryConfig,\n type ProblemDetails,\n} from './errors/index';\nimport { TangoBody, type JsonValue, TangoHeaders, TangoQueryParams, TangoRequest, TangoResponse } from './http/index';\nimport { ConsoleLogger, getLogger, setLoggerFactory, resetLoggerFactory, type Logger } from './logging/index';\nimport {\n SqlSafetyEngine,\n isTrustedSqlFragment,\n quoteSqlIdentifier,\n trustedSql,\n validateSqlIdentifier,\n type SqlDialect,\n type SqlIdentifierRequest,\n type SqlIdentifierRole,\n type SqlLookupTokenRequest,\n type SqlRawFragmentRequest,\n type SqlSafetyRequest,\n type TrustedSqlFragment,\n type ValidatedSqlIdentifier,\n type ValidatedSqlLookupToken,\n type ValidatedSqlSafetyResult,\n} from './sql/index';\nimport {\n isArrayBuffer,\n isBlob,\n isDate,\n isError,\n isFile,\n isFormData,\n isObject,\n isReadableStream,\n isUint8Array,\n isURLSearchParams,\n} from './runtime/index';\n\n/**\n * Bundled exports for Django-style domain drill-down imports, plus curated\n * top-level symbols for TS-native ergonomic imports.\n */\nexport { errors, http, logging, runtime, sql };\n\nexport {\n AuthenticationError,\n ConflictError,\n HttpErrorFactory,\n MultipleObjectsReturned,\n NotFoundError,\n PermissionDenied,\n TangoBody,\n TangoError,\n TangoHeaders,\n TangoQueryParams,\n TangoRequest,\n TangoResponse,\n ValidationError,\n ConsoleLogger,\n getLogger,\n setLoggerFactory,\n resetLoggerFactory,\n SqlSafetyEngine,\n trustedSql,\n isTrustedSqlFragment,\n validateSqlIdentifier,\n quoteSqlIdentifier,\n isArrayBuffer,\n isBlob,\n isDate,\n isError,\n isFile,\n isFormData,\n isObject,\n isReadableStream,\n isUint8Array,\n isURLSearchParams,\n};\n\nexport type {\n ErrorDetails,\n ErrorEnvelope,\n HttpError,\n HttpErrorFactoryConfig,\n JsonValue,\n Logger,\n ProblemDetails,\n SqlDialect,\n SqlIdentifierRequest,\n SqlIdentifierRole,\n SqlLookupTokenRequest,\n SqlRawFragmentRequest,\n SqlSafetyRequest,\n TrustedSqlFragment,\n ValidatedSqlIdentifier,\n ValidatedSqlLookupToken,\n ValidatedSqlSafetyResult,\n};\n"],"mappings":""}
@@ -1,3 +1,2 @@
1
- export type { Logger } from './Logger';
2
- export { ConsoleLogger } from './ConsoleLogger';
3
- export { getLogger, setLoggerFactory, resetLoggerFactory } from './getLogger';
1
+ import { a as ConsoleLogger, i as setLoggerFactory, n as getLogger, o as Logger, r as resetLoggerFactory } from "../index-MZzjIxgD.js";
2
+ export { ConsoleLogger, type Logger, getLogger, resetLoggerFactory, setLoggerFactory };
@@ -1,3 +1,2 @@
1
- import { ConsoleLogger, getLogger, resetLoggerFactory, setLoggerFactory } from "../logging-BWeD4HOO.js";
2
-
3
- export { ConsoleLogger, getLogger, resetLoggerFactory, setLoggerFactory };
1
+ import { a as ConsoleLogger, i as setLoggerFactory, n as getLogger, r as resetLoggerFactory } from "../logging-UC5uXHET.js";
2
+ export { ConsoleLogger, getLogger, resetLoggerFactory, setLoggerFactory };
@@ -0,0 +1,68 @@
1
+ import { t as __exportAll } from "./chunk-D7D4PA-g.js";
2
+ //#region src/logging/ConsoleLogger.ts
3
+ /**
4
+ * Default `Logger` implementation that delegates to `console.*`.
5
+ *
6
+ * Each message is prefixed with the scope string so log output is
7
+ * filterable by origin (e.g. `[tango.adapter.next] Adapter error: …`).
8
+ */
9
+ var ConsoleLogger = class {
10
+ scope;
11
+ constructor(scope) {
12
+ this.scope = scope;
13
+ }
14
+ error(message, ...args) {
15
+ console.error(`[${this.scope}]`, message, ...args);
16
+ }
17
+ warn(message, ...args) {
18
+ console.warn(`[${this.scope}]`, message, ...args);
19
+ }
20
+ info(message, ...args) {
21
+ console.info(`[${this.scope}]`, message, ...args);
22
+ }
23
+ debug(message, ...args) {
24
+ console.debug(`[${this.scope}]`, message, ...args);
25
+ }
26
+ };
27
+ //#endregion
28
+ //#region src/logging/getLogger.ts
29
+ let factory = (scope) => new ConsoleLogger(scope);
30
+ /**
31
+ * Return a `Logger` bound to the given scope name.
32
+ *
33
+ * By default loggers are `ConsoleLogger` instances. Call
34
+ * `setLoggerFactory` to redirect all framework logging
35
+ * to a custom implementation (Pino, Winston, etc.).
36
+ */
37
+ function getLogger(scope) {
38
+ return factory(scope);
39
+ }
40
+ /**
41
+ * Replace the global logger factory used by `getLogger`.
42
+ *
43
+ * Typically called once during application bootstrap from
44
+ * the resolved `TangoConfig.logger` value.
45
+ */
46
+ function setLoggerFactory(custom) {
47
+ if (typeof custom === "function") factory = custom;
48
+ else factory = () => custom;
49
+ }
50
+ /**
51
+ * Reset the logger factory to the default `ConsoleLogger`.
52
+ * Primarily useful in tests.
53
+ */
54
+ function resetLoggerFactory() {
55
+ factory = (scope) => new ConsoleLogger(scope);
56
+ }
57
+ //#endregion
58
+ //#region src/logging/index.ts
59
+ var logging_exports = /* @__PURE__ */ __exportAll({
60
+ ConsoleLogger: () => ConsoleLogger,
61
+ getLogger: () => getLogger,
62
+ resetLoggerFactory: () => resetLoggerFactory,
63
+ setLoggerFactory: () => setLoggerFactory
64
+ });
65
+ //#endregion
66
+ export { ConsoleLogger as a, setLoggerFactory as i, getLogger as n, resetLoggerFactory as r, logging_exports as t };
67
+
68
+ //# sourceMappingURL=logging-UC5uXHET.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging-UC5uXHET.js","names":[],"sources":["../src/logging/ConsoleLogger.ts","../src/logging/getLogger.ts","../src/logging/index.ts"],"sourcesContent":["import type { Logger } from './Logger';\n\n/**\n * Default `Logger` implementation that delegates to `console.*`.\n *\n * Each message is prefixed with the scope string so log output is\n * filterable by origin (e.g. `[tango.adapter.next] Adapter error: …`).\n */\nexport class ConsoleLogger implements Logger {\n constructor(private readonly scope: string) {}\n\n error(message: string, ...args: unknown[]): void {\n console.error(`[${this.scope}]`, message, ...args);\n }\n\n warn(message: string, ...args: unknown[]): void {\n console.warn(`[${this.scope}]`, message, ...args);\n }\n\n info(message: string, ...args: unknown[]): void {\n console.info(`[${this.scope}]`, message, ...args);\n }\n\n debug(message: string, ...args: unknown[]): void {\n console.debug(`[${this.scope}]`, message, ...args);\n }\n}\n","import type { Logger } from './Logger';\nimport { ConsoleLogger } from './ConsoleLogger';\n\ntype LoggerFactory = (scope: string) => Logger;\n\nlet factory: LoggerFactory = (scope) => new ConsoleLogger(scope);\n\n/**\n * Return a `Logger` bound to the given scope name.\n *\n * By default loggers are `ConsoleLogger` instances. Call\n * `setLoggerFactory` to redirect all framework logging\n * to a custom implementation (Pino, Winston, etc.).\n */\nexport function getLogger(scope: string): Logger {\n return factory(scope);\n}\n\n/**\n * Replace the global logger factory used by `getLogger`.\n *\n * Typically called once during application bootstrap from\n * the resolved `TangoConfig.logger` value.\n */\nexport function setLoggerFactory(custom: LoggerFactory | Logger): void {\n if (typeof custom === 'function') {\n factory = custom;\n } else {\n factory = () => custom;\n }\n}\n\n/**\n * Reset the logger factory to the default `ConsoleLogger`.\n * Primarily useful in tests.\n */\nexport function resetLoggerFactory(): void {\n factory = (scope) => new ConsoleLogger(scope);\n}\n","export type { Logger } from './Logger';\nexport { ConsoleLogger } from './ConsoleLogger';\nexport { getLogger, setLoggerFactory, resetLoggerFactory } from './getLogger';\n"],"mappings":";;;;;;;;AAQA,IAAa,gBAAb,MAA6C;CACZ;CAA7B,YAAY,OAAgC;EAAf,KAAA,QAAA;CAAgB;CAE7C,MAAM,SAAiB,GAAG,MAAuB;EAC7C,QAAQ,MAAM,IAAI,KAAK,MAAM,IAAI,SAAS,GAAG,IAAI;CACrD;CAEA,KAAK,SAAiB,GAAG,MAAuB;EAC5C,QAAQ,KAAK,IAAI,KAAK,MAAM,IAAI,SAAS,GAAG,IAAI;CACpD;CAEA,KAAK,SAAiB,GAAG,MAAuB;EAC5C,QAAQ,KAAK,IAAI,KAAK,MAAM,IAAI,SAAS,GAAG,IAAI;CACpD;CAEA,MAAM,SAAiB,GAAG,MAAuB;EAC7C,QAAQ,MAAM,IAAI,KAAK,MAAM,IAAI,SAAS,GAAG,IAAI;CACrD;AACJ;;;ACrBA,IAAI,WAA0B,UAAU,IAAI,cAAc,KAAK;;;;;;;;AAS/D,SAAgB,UAAU,OAAuB;CAC7C,OAAO,QAAQ,KAAK;AACxB;;;;;;;AAQA,SAAgB,iBAAiB,QAAsC;CACnE,IAAI,OAAO,WAAW,YAClB,UAAU;MAEV,gBAAgB;AAExB;;;;;AAMA,SAAgB,qBAA2B;CACvC,WAAW,UAAU,IAAI,cAAc,KAAK;AAChD"}
@@ -1,14 +1,2 @@
1
- /**
2
- * Domain boundary barrel: exposes namespaced exports for Django-style drill-down
3
- * imports and curated flat exports for TS-native ergonomics.
4
- */
5
- export * as binary from './binary/index';
6
- export * as web from './web/index';
7
- export * as object from './object/index';
8
- export * as error from './error/index';
9
- export * as date from './date/index';
10
- export { isArrayBuffer, isBlob, isUint8Array } from './binary/index';
11
- export { isFile, isFormData, isReadableStream, isURLSearchParams } from './web/index';
12
- export { isNil, isObject } from './object/index';
13
- export { isError } from './error/index';
14
- export { isDate } from './date/index';
1
+ import { _ as isArrayBuffer, a as isError, c as isObject, d as isReadableStream, f as isURLSearchParams, g as isUint8Array, h as isBlob, i as index_d_exports$2, l as index_d_exports$4, m as index_d_exports, n as index_d_exports$1, o as index_d_exports$3, p as isFormData, r as isDate, s as isNil, u as isFile } from "../index-B5PoK4LH.js";
2
+ export { index_d_exports as binary, index_d_exports$1 as date, index_d_exports$2 as error, isArrayBuffer, isBlob, isDate, isError, isFile, isFormData, isNil, isObject, isReadableStream, isURLSearchParams, isUint8Array, index_d_exports$3 as object, index_d_exports$4 as web };
@@ -1,3 +1,2 @@
1
- import { binary_exports, date_exports, error_exports, isArrayBuffer, isBlob, isDate, isError, isFile, isFormData, isNil, isObject, isReadableStream, isURLSearchParams, isUint8Array, object_exports, web_exports } from "../runtime-B8KkgD3R.js";
2
-
3
- export { binary_exports as binary, date_exports as date, error_exports as error, isArrayBuffer, isBlob, isDate, isError, isFile, isFormData, isNil, isObject, isReadableStream, isURLSearchParams, isUint8Array, object_exports as object, web_exports as web };
1
+ import { _ as isNil, a as isError, c as web_exports, d as isURLSearchParams, f as isFormData, g as isArrayBuffer, h as isUint8Array, i as error_exports, l as isFile, m as isBlob, n as date_exports, o as object_exports, p as binary_exports, r as isDate, s as isObject, u as isReadableStream } from "../runtime-BAG_EKuM.js";
2
+ export { binary_exports as binary, date_exports as date, error_exports as error, isArrayBuffer, isBlob, isDate, isError, isFile, isFormData, isNil, isObject, isReadableStream, isURLSearchParams, isUint8Array, object_exports as object, web_exports as web };