@databricks/appkit 0.37.0 → 0.38.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.
- package/CLAUDE.md +3 -2
- package/NOTICE.md +1 -2
- package/dist/appkit/package.js +1 -1
- package/dist/cache/index.d.ts +27 -5
- package/dist/cache/index.d.ts.map +1 -1
- package/dist/cache/index.js +88 -16
- package/dist/cache/index.js.map +1 -1
- package/dist/cache/storage/persistent.js +1 -2
- package/dist/cache/storage/persistent.js.map +1 -1
- package/dist/cli/commands/plugin/add-resource/add-resource.js.map +1 -1
- package/dist/cli/commands/plugin/create/resource-defaults.js +2 -1
- package/dist/cli/commands/plugin/create/resource-defaults.js.map +1 -1
- package/dist/cli/commands/plugin/schema-resources.js +34 -51
- package/dist/cli/commands/plugin/schema-resources.js.map +1 -1
- package/dist/cli/commands/plugin/sync/sync.js +20 -6
- package/dist/cli/commands/plugin/sync/sync.js.map +1 -1
- package/dist/cli/commands/plugin/validate/validate-manifest.js +71 -157
- package/dist/cli/commands/plugin/validate/validate-manifest.js.map +1 -1
- package/dist/cli/commands/plugin/validate/validate.js +2 -2
- package/dist/cli/commands/plugin/validate/validate.js.map +1 -1
- package/dist/cli/commands/setup.js +2 -2
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/connectors/index.js +0 -1
- package/dist/connectors/jobs/client.js +1 -2
- package/dist/connectors/jobs/client.js.map +1 -1
- package/dist/connectors/lakebase/routing-pool.js +1 -2
- package/dist/connectors/lakebase/routing-pool.js.map +1 -1
- package/dist/connectors/sql-warehouse/client.js +1 -2
- package/dist/connectors/sql-warehouse/client.js.map +1 -1
- package/dist/context/execution-context.js +9 -13
- package/dist/context/execution-context.js.map +1 -1
- package/dist/context/index.js +3 -13
- package/dist/context/service-context.js +137 -136
- package/dist/context/service-context.js.map +1 -1
- package/dist/context/user-context.js +1 -5
- package/dist/context/user-context.js.map +1 -1
- package/dist/core/agent/create-agent.js +1 -2
- package/dist/core/agent/create-agent.js.map +1 -1
- package/dist/core/appkit.js +1 -2
- package/dist/core/appkit.js.map +1 -1
- package/dist/errors/authentication.js +44 -40
- package/dist/errors/authentication.js.map +1 -1
- package/dist/errors/base.js +86 -70
- package/dist/errors/base.js.map +1 -1
- package/dist/errors/configuration.js +70 -66
- package/dist/errors/configuration.js.map +1 -1
- package/dist/errors/connection.js +50 -46
- package/dist/errors/connection.js.map +1 -1
- package/dist/errors/execution.js +47 -43
- package/dist/errors/execution.js.map +1 -1
- package/dist/errors/index.js +10 -27
- package/dist/errors/initialization.js +38 -34
- package/dist/errors/initialization.js.map +1 -1
- package/dist/errors/server.js +34 -31
- package/dist/errors/server.js.map +1 -1
- package/dist/errors/tunnel.js +47 -43
- package/dist/errors/tunnel.js.map +1 -1
- package/dist/errors/validation.js +41 -37
- package/dist/errors/validation.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -9
- package/dist/plugin/dev-reader.js +1 -2
- package/dist/plugin/dev-reader.js.map +1 -1
- package/dist/plugin/interceptors/cache.js +13 -1
- package/dist/plugin/interceptors/cache.js.map +1 -1
- package/dist/plugin/interceptors/retry.js +1 -2
- package/dist/plugin/interceptors/retry.js.map +1 -1
- package/dist/plugin/interceptors/telemetry.js +1 -2
- package/dist/plugin/interceptors/telemetry.js.map +1 -1
- package/dist/plugin/plugin.js +2 -4
- package/dist/plugin/plugin.js.map +1 -1
- package/dist/plugins/analytics/analytics.js +1 -2
- package/dist/plugins/analytics/analytics.js.map +1 -1
- package/dist/plugins/analytics/manifest.js +9 -1
- package/dist/plugins/analytics/query.js +2 -4
- package/dist/plugins/analytics/query.js.map +1 -1
- package/dist/plugins/files/manifest.js +7 -1
- package/dist/plugins/files/plugin.js +3 -6
- package/dist/plugins/files/plugin.js.map +1 -1
- package/dist/plugins/genie/genie.js +1 -2
- package/dist/plugins/genie/genie.js.map +1 -1
- package/dist/plugins/genie/manifest.js +7 -1
- package/dist/plugins/jobs/plugin.js +2 -4
- package/dist/plugins/jobs/plugin.js.map +1 -1
- package/dist/plugins/lakebase/lakebase.js +1 -2
- package/dist/plugins/lakebase/lakebase.js.map +1 -1
- package/dist/plugins/lakebase/manifest.js +26 -4
- package/dist/plugins/server/index.js +1 -2
- package/dist/plugins/server/index.js.map +1 -1
- package/dist/plugins/server/vite-dev-server.js +1 -2
- package/dist/plugins/server/vite-dev-server.js.map +1 -1
- package/dist/plugins/serving/serving.js +1 -2
- package/dist/plugins/serving/serving.js.map +1 -1
- package/dist/registry/index.d.ts +1 -1
- package/dist/registry/manifest-loader.d.ts +4 -4
- package/dist/registry/manifest-loader.d.ts.map +1 -1
- package/dist/registry/manifest-loader.js +1 -2
- package/dist/registry/manifest-loader.js.map +1 -1
- package/dist/registry/resource-registry.js +1 -2
- package/dist/registry/resource-registry.js.map +1 -1
- package/dist/registry/types.d.ts +21 -7
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/registry/types.generated.d.ts +1 -1
- package/dist/registry/types.generated.js +1 -1
- package/dist/registry/types.generated.js.map +1 -1
- package/dist/registry/types.js +3 -3
- package/dist/registry/types.js.map +1 -1
- package/dist/schemas/manifest.d.ts +1139 -0
- package/dist/schemas/manifest.d.ts.map +1 -0
- package/dist/schemas/manifest.js +524 -0
- package/dist/schemas/manifest.js.map +1 -0
- package/dist/shared/src/index.d.ts +1 -1
- package/dist/shared/src/plugin.d.ts +38 -7
- package/dist/shared/src/plugin.d.ts.map +1 -1
- package/dist/shared/src/schemas/manifest.d.ts +1110 -0
- package/dist/shared/src/schemas/manifest.d.ts.map +1 -0
- package/dist/stream/arrow-stream-processor.js +1 -2
- package/dist/stream/arrow-stream-processor.js.map +1 -1
- package/dist/stream/buffers.js +1 -2
- package/dist/stream/buffers.js.map +1 -1
- package/dist/stream/stream-manager.d.ts.map +1 -1
- package/dist/stream/stream-manager.js +3 -3
- package/dist/stream/stream-manager.js.map +1 -1
- package/docs/api/appkit/Enumeration.ResourceType.md +1 -1
- package/docs/api/appkit/Interface.PluginManifest.md +57 -3
- package/docs/api/appkit/Interface.ResourceEntry.md +6 -4
- package/docs/api/appkit/Interface.ResourceRequirement.md +7 -61
- package/docs/api/appkit/TypeAlias.ResourceFieldEntry.md +6 -0
- package/docs/api/appkit.md +6 -6
- package/docs/app-management.md +1 -1
- package/docs/development/ai-assisted-development.md +2 -2
- package/docs/development/local-development.md +1 -1
- package/docs/development/remote-bridge.md +1 -1
- package/docs/development/templates.md +118 -12
- package/docs/development.md +1 -1
- package/docs/plugins/custom-plugins.md +33 -23
- package/docs/plugins/lakebase.md +1 -1
- package/docs/plugins/manifest.md +293 -0
- package/docs.md +2 -2
- package/llms.txt +3 -2
- package/package.json +3 -3
- package/sbom.cdx.json +1 -1
- package/dist/_virtual/_rolldown/runtime.js +0 -7
- package/dist/connectors/lakebase-v1/client.js +0 -15
- package/dist/connectors/lakebase-v1/client.js.map +0 -1
- package/dist/connectors/lakebase-v1/index.js +0 -3
- package/dist/context/index.js.map +0 -1
- package/dist/errors/index.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/schemas/plugin-manifest.generated.d.ts +0 -182
- package/dist/schemas/plugin-manifest.generated.d.ts.map +0 -1
- package/dist/schemas/plugin-manifest.schema.json +0 -489
- package/dist/schemas/template-plugins.schema.json +0 -113
- package/dist/shared/src/schemas/plugin-manifest.generated.d.ts +0 -182
- package/dist/shared/src/schemas/plugin-manifest.generated.d.ts.map +0 -1
- package/docs/api/appkit/Interface.ResourceFieldEntry.md +0 -82
|
@@ -1,51 +1,55 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AppKitError, init_base } from "./base.js";
|
|
1
|
+
import { AppKitError } from "./base.js";
|
|
3
2
|
|
|
4
3
|
//#region src/errors/connection.ts
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Error thrown when a connection or network operation fails.
|
|
6
|
+
* Use for database pool errors, API failures, timeouts, etc.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* throw new ConnectionError("Query failed", { cause: pgError });
|
|
11
|
+
* throw new ConnectionError("No response received from SQL Warehouse API");
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
var ConnectionError = class ConnectionError extends AppKitError {
|
|
15
|
+
code = "CONNECTION_ERROR";
|
|
16
|
+
statusCode = 503;
|
|
17
|
+
isRetryable = true;
|
|
18
|
+
/**
|
|
19
|
+
* Create a connection error for query failure
|
|
20
|
+
*/
|
|
21
|
+
static queryFailed(cause) {
|
|
22
|
+
return new ConnectionError("Query failed", { cause });
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Create a connection error for transaction failure
|
|
26
|
+
*/
|
|
27
|
+
static transactionFailed(cause) {
|
|
28
|
+
return new ConnectionError("Transaction failed", { cause });
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Create a connection error for pool errors
|
|
32
|
+
*/
|
|
33
|
+
static poolError(operation, cause) {
|
|
34
|
+
return new ConnectionError(`Connection pool error: ${operation}`, { cause });
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Create a connection error for API failures
|
|
38
|
+
*/
|
|
39
|
+
static apiFailure(service, cause) {
|
|
40
|
+
return new ConnectionError(`No response received from ${service} API`, {
|
|
41
|
+
cause,
|
|
42
|
+
context: { service }
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Create a connection error for client unavailable
|
|
47
|
+
*/
|
|
48
|
+
static clientUnavailable(clientType, hint) {
|
|
49
|
+
return new ConnectionError(hint ? `${clientType} not available. ${hint}` : `${clientType} not available`, { context: { clientType } });
|
|
50
|
+
}
|
|
51
|
+
};
|
|
47
52
|
|
|
48
53
|
//#endregion
|
|
49
|
-
|
|
50
|
-
export { ConnectionError, init_connection };
|
|
54
|
+
export { ConnectionError };
|
|
51
55
|
//# sourceMappingURL=connection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.js","names":[],"sources":["../../src/errors/connection.ts"],"sourcesContent":["import { AppKitError } from \"./base\";\n\n/**\n * Error thrown when a connection or network operation fails.\n * Use for database pool errors, API failures, timeouts, etc.\n *\n * @example\n * ```typescript\n * throw new ConnectionError(\"Query failed\", { cause: pgError });\n * throw new ConnectionError(\"No response received from SQL Warehouse API\");\n * ```\n */\nexport class ConnectionError extends AppKitError {\n readonly code = \"CONNECTION_ERROR\";\n readonly statusCode = 503;\n readonly isRetryable = true;\n\n /**\n * Create a connection error for query failure\n */\n static queryFailed(cause?: Error): ConnectionError {\n return new ConnectionError(\"Query failed\", { cause });\n }\n\n /**\n * Create a connection error for transaction failure\n */\n static transactionFailed(cause?: Error): ConnectionError {\n return new ConnectionError(\"Transaction failed\", { cause });\n }\n\n /**\n * Create a connection error for pool errors\n */\n static poolError(operation: string, cause?: Error): ConnectionError {\n return new ConnectionError(`Connection pool error: ${operation}`, {\n cause,\n });\n }\n\n /**\n * Create a connection error for API failures\n */\n static apiFailure(service: string, cause?: Error): ConnectionError {\n return new ConnectionError(`No response received from ${service} API`, {\n cause,\n context: { service },\n });\n }\n\n /**\n * Create a connection error for client unavailable\n */\n static clientUnavailable(clientType: string, hint?: string): ConnectionError {\n const message = hint\n ? `${clientType} not available. ${hint}`\n : `${clientType} not available`;\n return new ConnectionError(message, { context: { clientType } });\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"connection.js","names":[],"sources":["../../src/errors/connection.ts"],"sourcesContent":["import { AppKitError } from \"./base\";\n\n/**\n * Error thrown when a connection or network operation fails.\n * Use for database pool errors, API failures, timeouts, etc.\n *\n * @example\n * ```typescript\n * throw new ConnectionError(\"Query failed\", { cause: pgError });\n * throw new ConnectionError(\"No response received from SQL Warehouse API\");\n * ```\n */\nexport class ConnectionError extends AppKitError {\n readonly code = \"CONNECTION_ERROR\";\n readonly statusCode = 503;\n readonly isRetryable = true;\n\n /**\n * Create a connection error for query failure\n */\n static queryFailed(cause?: Error): ConnectionError {\n return new ConnectionError(\"Query failed\", { cause });\n }\n\n /**\n * Create a connection error for transaction failure\n */\n static transactionFailed(cause?: Error): ConnectionError {\n return new ConnectionError(\"Transaction failed\", { cause });\n }\n\n /**\n * Create a connection error for pool errors\n */\n static poolError(operation: string, cause?: Error): ConnectionError {\n return new ConnectionError(`Connection pool error: ${operation}`, {\n cause,\n });\n }\n\n /**\n * Create a connection error for API failures\n */\n static apiFailure(service: string, cause?: Error): ConnectionError {\n return new ConnectionError(`No response received from ${service} API`, {\n cause,\n context: { service },\n });\n }\n\n /**\n * Create a connection error for client unavailable\n */\n static clientUnavailable(clientType: string, hint?: string): ConnectionError {\n const message = hint\n ? `${clientType} not available. ${hint}`\n : `${clientType} not available`;\n return new ConnectionError(message, { context: { clientType } });\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAYA,IAAa,kBAAb,MAAa,wBAAwB,YAAY;CAC/C,AAAS,OAAO;CAChB,AAAS,aAAa;CACtB,AAAS,cAAc;;;;CAKvB,OAAO,YAAY,OAAgC;AACjD,SAAO,IAAI,gBAAgB,gBAAgB,EAAE,OAAO,CAAC;;;;;CAMvD,OAAO,kBAAkB,OAAgC;AACvD,SAAO,IAAI,gBAAgB,sBAAsB,EAAE,OAAO,CAAC;;;;;CAM7D,OAAO,UAAU,WAAmB,OAAgC;AAClE,SAAO,IAAI,gBAAgB,0BAA0B,aAAa,EAChE,OACD,CAAC;;;;;CAMJ,OAAO,WAAW,SAAiB,OAAgC;AACjE,SAAO,IAAI,gBAAgB,6BAA6B,QAAQ,OAAO;GACrE;GACA,SAAS,EAAE,SAAS;GACrB,CAAC;;;;;CAMJ,OAAO,kBAAkB,YAAoB,MAAgC;AAI3E,SAAO,IAAI,gBAHK,OACZ,GAAG,WAAW,kBAAkB,SAChC,GAAG,WAAW,iBACkB,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC"}
|
package/dist/errors/execution.js
CHANGED
|
@@ -1,48 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AppKitError, init_base } from "./base.js";
|
|
1
|
+
import { AppKitError } from "./base.js";
|
|
3
2
|
|
|
4
3
|
//#region src/errors/execution.ts
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Error thrown when an operation execution fails.
|
|
6
|
+
* Use for statement failures, canceled operations, or unexpected states.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* throw new ExecutionError("Statement failed: syntax error");
|
|
11
|
+
* throw new ExecutionError("Statement was canceled");
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
var ExecutionError = class ExecutionError extends AppKitError {
|
|
15
|
+
code = "EXECUTION_ERROR";
|
|
16
|
+
statusCode = 500;
|
|
17
|
+
isRetryable = false;
|
|
18
|
+
/**
|
|
19
|
+
* Create an execution error for statement failure
|
|
20
|
+
*/
|
|
21
|
+
static statementFailed(errorMessage) {
|
|
22
|
+
return new ExecutionError(errorMessage ? `Statement failed: ${errorMessage}` : "Statement failed: Unknown error");
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Create an execution error for canceled operation
|
|
26
|
+
*/
|
|
27
|
+
static canceled() {
|
|
28
|
+
return new ExecutionError("Statement was canceled");
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Create an execution error for closed/expired results
|
|
32
|
+
*/
|
|
33
|
+
static resultsClosed() {
|
|
34
|
+
return new ExecutionError("Statement execution completed but results are no longer available (CLOSED state)");
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Create an execution error for unknown state
|
|
38
|
+
*/
|
|
39
|
+
static unknownState(state) {
|
|
40
|
+
return new ExecutionError(`Unknown statement state: ${state}`, { context: { state } });
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Create an execution error for missing data
|
|
44
|
+
*/
|
|
45
|
+
static missingData(dataType) {
|
|
46
|
+
return new ExecutionError(`No ${dataType} found in response`, { context: { dataType } });
|
|
47
|
+
}
|
|
48
|
+
};
|
|
44
49
|
|
|
45
50
|
//#endregion
|
|
46
|
-
|
|
47
|
-
export { ExecutionError, init_execution };
|
|
51
|
+
export { ExecutionError };
|
|
48
52
|
//# sourceMappingURL=execution.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution.js","names":[],"sources":["../../src/errors/execution.ts"],"sourcesContent":["import { AppKitError } from \"./base\";\n\n/**\n * Error thrown when an operation execution fails.\n * Use for statement failures, canceled operations, or unexpected states.\n *\n * @example\n * ```typescript\n * throw new ExecutionError(\"Statement failed: syntax error\");\n * throw new ExecutionError(\"Statement was canceled\");\n * ```\n */\nexport class ExecutionError extends AppKitError {\n readonly code = \"EXECUTION_ERROR\";\n readonly statusCode = 500;\n readonly isRetryable = false;\n\n /**\n * Create an execution error for statement failure\n */\n static statementFailed(errorMessage?: string): ExecutionError {\n const message = errorMessage\n ? `Statement failed: ${errorMessage}`\n : \"Statement failed: Unknown error\";\n return new ExecutionError(message);\n }\n\n /**\n * Create an execution error for canceled operation\n */\n static canceled(): ExecutionError {\n return new ExecutionError(\"Statement was canceled\");\n }\n\n /**\n * Create an execution error for closed/expired results\n */\n static resultsClosed(): ExecutionError {\n return new ExecutionError(\n \"Statement execution completed but results are no longer available (CLOSED state)\",\n );\n }\n\n /**\n * Create an execution error for unknown state\n */\n static unknownState(state: string): ExecutionError {\n return new ExecutionError(`Unknown statement state: ${state}`, {\n context: { state },\n });\n }\n\n /**\n * Create an execution error for missing data\n */\n static missingData(dataType: string): ExecutionError {\n return new ExecutionError(`No ${dataType} found in response`, {\n context: { dataType },\n });\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"execution.js","names":[],"sources":["../../src/errors/execution.ts"],"sourcesContent":["import { AppKitError } from \"./base\";\n\n/**\n * Error thrown when an operation execution fails.\n * Use for statement failures, canceled operations, or unexpected states.\n *\n * @example\n * ```typescript\n * throw new ExecutionError(\"Statement failed: syntax error\");\n * throw new ExecutionError(\"Statement was canceled\");\n * ```\n */\nexport class ExecutionError extends AppKitError {\n readonly code = \"EXECUTION_ERROR\";\n readonly statusCode = 500;\n readonly isRetryable = false;\n\n /**\n * Create an execution error for statement failure\n */\n static statementFailed(errorMessage?: string): ExecutionError {\n const message = errorMessage\n ? `Statement failed: ${errorMessage}`\n : \"Statement failed: Unknown error\";\n return new ExecutionError(message);\n }\n\n /**\n * Create an execution error for canceled operation\n */\n static canceled(): ExecutionError {\n return new ExecutionError(\"Statement was canceled\");\n }\n\n /**\n * Create an execution error for closed/expired results\n */\n static resultsClosed(): ExecutionError {\n return new ExecutionError(\n \"Statement execution completed but results are no longer available (CLOSED state)\",\n );\n }\n\n /**\n * Create an execution error for unknown state\n */\n static unknownState(state: string): ExecutionError {\n return new ExecutionError(`Unknown statement state: ${state}`, {\n context: { state },\n });\n }\n\n /**\n * Create an execution error for missing data\n */\n static missingData(dataType: string): ExecutionError {\n return new ExecutionError(`No ${dataType} found in response`, {\n context: { dataType },\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAYA,IAAa,iBAAb,MAAa,uBAAuB,YAAY;CAC9C,AAAS,OAAO;CAChB,AAAS,aAAa;CACtB,AAAS,cAAc;;;;CAKvB,OAAO,gBAAgB,cAAuC;AAI5D,SAAO,IAAI,eAHK,eACZ,qBAAqB,iBACrB,kCAC8B;;;;;CAMpC,OAAO,WAA2B;AAChC,SAAO,IAAI,eAAe,yBAAyB;;;;;CAMrD,OAAO,gBAAgC;AACrC,SAAO,IAAI,eACT,mFACD;;;;;CAMH,OAAO,aAAa,OAA+B;AACjD,SAAO,IAAI,eAAe,4BAA4B,SAAS,EAC7D,SAAS,EAAE,OAAO,EACnB,CAAC;;;;;CAMJ,OAAO,YAAY,UAAkC;AACnD,SAAO,IAAI,eAAe,MAAM,SAAS,qBAAqB,EAC5D,SAAS,EAAE,UAAU,EACtB,CAAC"}
|
package/dist/errors/index.js
CHANGED
|
@@ -1,28 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { ValidationError, init_validation } from "./validation.js";
|
|
1
|
+
import { AppKitError } from "./base.js";
|
|
2
|
+
import { AuthenticationError } from "./authentication.js";
|
|
3
|
+
import { ConfigurationError } from "./configuration.js";
|
|
4
|
+
import { ConnectionError } from "./connection.js";
|
|
5
|
+
import { ExecutionError } from "./execution.js";
|
|
6
|
+
import { InitializationError } from "./initialization.js";
|
|
7
|
+
import { ServerError } from "./server.js";
|
|
8
|
+
import { TunnelError } from "./tunnel.js";
|
|
9
|
+
import { ValidationError } from "./validation.js";
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
var init_errors = __esmMin((() => {
|
|
14
|
-
init_authentication();
|
|
15
|
-
init_base();
|
|
16
|
-
init_configuration();
|
|
17
|
-
init_connection();
|
|
18
|
-
init_execution();
|
|
19
|
-
init_initialization();
|
|
20
|
-
init_server();
|
|
21
|
-
init_tunnel();
|
|
22
|
-
init_validation();
|
|
23
|
-
}));
|
|
24
|
-
|
|
25
|
-
//#endregion
|
|
26
|
-
init_errors();
|
|
27
|
-
export { init_errors };
|
|
28
|
-
//# sourceMappingURL=index.js.map
|
|
11
|
+
export { };
|
|
@@ -1,39 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AppKitError, init_base } from "./base.js";
|
|
1
|
+
import { AppKitError } from "./base.js";
|
|
3
2
|
|
|
4
3
|
//#region src/errors/initialization.ts
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Error thrown when a service or component is not properly initialized.
|
|
6
|
+
* Use when accessing services before they are ready.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* throw new InitializationError("CacheManager not initialized");
|
|
11
|
+
* throw new InitializationError("ServiceContext not initialized. Call ServiceContext.initialize() first.");
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
var InitializationError = class InitializationError extends AppKitError {
|
|
15
|
+
code = "INITIALIZATION_ERROR";
|
|
16
|
+
statusCode = 500;
|
|
17
|
+
isRetryable = true;
|
|
18
|
+
/**
|
|
19
|
+
* Create an initialization error for a service that is not ready
|
|
20
|
+
*/
|
|
21
|
+
static notInitialized(serviceName, hint) {
|
|
22
|
+
return new InitializationError(hint ? `${serviceName} not initialized. ${hint}` : `${serviceName} not initialized`, { context: { service: serviceName } });
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Create an initialization error for setup failure
|
|
26
|
+
*/
|
|
27
|
+
static setupFailed(component, cause) {
|
|
28
|
+
return new InitializationError(`Failed to initialize ${component}`, {
|
|
29
|
+
cause,
|
|
30
|
+
context: { component }
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Create an initialization error for migration failure
|
|
35
|
+
*/
|
|
36
|
+
static migrationFailed(cause) {
|
|
37
|
+
return new InitializationError("Error in running migrations for persistent storage", { cause });
|
|
38
|
+
}
|
|
39
|
+
};
|
|
35
40
|
|
|
36
41
|
//#endregion
|
|
37
|
-
|
|
38
|
-
export { InitializationError, init_initialization };
|
|
42
|
+
export { InitializationError };
|
|
39
43
|
//# sourceMappingURL=initialization.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialization.js","names":[],"sources":["../../src/errors/initialization.ts"],"sourcesContent":["import { AppKitError } from \"./base\";\n\n/**\n * Error thrown when a service or component is not properly initialized.\n * Use when accessing services before they are ready.\n *\n * @example\n * ```typescript\n * throw new InitializationError(\"CacheManager not initialized\");\n * throw new InitializationError(\"ServiceContext not initialized. Call ServiceContext.initialize() first.\");\n * ```\n */\nexport class InitializationError extends AppKitError {\n readonly code = \"INITIALIZATION_ERROR\";\n readonly statusCode = 500;\n readonly isRetryable = true;\n\n /**\n * Create an initialization error for a service that is not ready\n */\n static notInitialized(\n serviceName: string,\n hint?: string,\n ): InitializationError {\n const message = hint\n ? `${serviceName} not initialized. ${hint}`\n : `${serviceName} not initialized`;\n return new InitializationError(message, {\n context: { service: serviceName },\n });\n }\n\n /**\n * Create an initialization error for setup failure\n */\n static setupFailed(component: string, cause?: Error): InitializationError {\n return new InitializationError(`Failed to initialize ${component}`, {\n cause,\n context: { component },\n });\n }\n\n /**\n * Create an initialization error for migration failure\n */\n static migrationFailed(cause?: Error): InitializationError {\n return new InitializationError(\n \"Error in running migrations for persistent storage\",\n { cause },\n );\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"initialization.js","names":[],"sources":["../../src/errors/initialization.ts"],"sourcesContent":["import { AppKitError } from \"./base\";\n\n/**\n * Error thrown when a service or component is not properly initialized.\n * Use when accessing services before they are ready.\n *\n * @example\n * ```typescript\n * throw new InitializationError(\"CacheManager not initialized\");\n * throw new InitializationError(\"ServiceContext not initialized. Call ServiceContext.initialize() first.\");\n * ```\n */\nexport class InitializationError extends AppKitError {\n readonly code = \"INITIALIZATION_ERROR\";\n readonly statusCode = 500;\n readonly isRetryable = true;\n\n /**\n * Create an initialization error for a service that is not ready\n */\n static notInitialized(\n serviceName: string,\n hint?: string,\n ): InitializationError {\n const message = hint\n ? `${serviceName} not initialized. ${hint}`\n : `${serviceName} not initialized`;\n return new InitializationError(message, {\n context: { service: serviceName },\n });\n }\n\n /**\n * Create an initialization error for setup failure\n */\n static setupFailed(component: string, cause?: Error): InitializationError {\n return new InitializationError(`Failed to initialize ${component}`, {\n cause,\n context: { component },\n });\n }\n\n /**\n * Create an initialization error for migration failure\n */\n static migrationFailed(cause?: Error): InitializationError {\n return new InitializationError(\n \"Error in running migrations for persistent storage\",\n { cause },\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAYA,IAAa,sBAAb,MAAa,4BAA4B,YAAY;CACnD,AAAS,OAAO;CAChB,AAAS,aAAa;CACtB,AAAS,cAAc;;;;CAKvB,OAAO,eACL,aACA,MACqB;AAIrB,SAAO,IAAI,oBAHK,OACZ,GAAG,YAAY,oBAAoB,SACnC,GAAG,YAAY,mBACqB,EACtC,SAAS,EAAE,SAAS,aAAa,EAClC,CAAC;;;;;CAMJ,OAAO,YAAY,WAAmB,OAAoC;AACxE,SAAO,IAAI,oBAAoB,wBAAwB,aAAa;GAClE;GACA,SAAS,EAAE,WAAW;GACvB,CAAC;;;;;CAMJ,OAAO,gBAAgB,OAAoC;AACzD,SAAO,IAAI,oBACT,sDACA,EAAE,OAAO,CACV"}
|
package/dist/errors/server.js
CHANGED
|
@@ -1,36 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AppKitError, init_base } from "./base.js";
|
|
1
|
+
import { AppKitError } from "./base.js";
|
|
3
2
|
|
|
4
3
|
//#region src/errors/server.ts
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Error thrown when server lifecycle operations fail.
|
|
6
|
+
* Use for server start/stop issues, configuration conflicts, etc.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* throw new ServerError("Server not started");
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
var ServerError = class ServerError extends AppKitError {
|
|
14
|
+
code = "SERVER_ERROR";
|
|
15
|
+
statusCode = 500;
|
|
16
|
+
isRetryable = false;
|
|
17
|
+
/**
|
|
18
|
+
* Create a server error for server not started
|
|
19
|
+
*/
|
|
20
|
+
static notStarted() {
|
|
21
|
+
return new ServerError("Server not started. Please start the server first by calling the start() method");
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Create a server error for Vite dev server not initialized
|
|
25
|
+
*/
|
|
26
|
+
static viteNotInitialized() {
|
|
27
|
+
return new ServerError("Vite dev server not initialized");
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Create a server error for missing client directory
|
|
31
|
+
*/
|
|
32
|
+
static clientDirectoryNotFound(searchedPaths) {
|
|
33
|
+
return new ServerError(`Could not find client directory. Searched for vite.config.ts/js + index.html in: ${searchedPaths.join(", ")}`, { context: { searchedPaths } });
|
|
34
|
+
}
|
|
35
|
+
};
|
|
32
36
|
|
|
33
37
|
//#endregion
|
|
34
|
-
|
|
35
|
-
export { ServerError, init_server };
|
|
38
|
+
export { ServerError };
|
|
36
39
|
//# sourceMappingURL=server.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","names":[],"sources":["../../src/errors/server.ts"],"sourcesContent":["import { AppKitError } from \"./base\";\n\n/**\n * Error thrown when server lifecycle operations fail.\n * Use for server start/stop issues, configuration conflicts, etc.\n *\n * @example\n * ```typescript\n * throw new ServerError(\"Server not started\");\n * ```\n */\nexport class ServerError extends AppKitError {\n readonly code = \"SERVER_ERROR\";\n readonly statusCode = 500;\n readonly isRetryable = false;\n\n /**\n * Create a server error for server not started\n */\n static notStarted(): ServerError {\n return new ServerError(\n \"Server not started. Please start the server first by calling the start() method\",\n );\n }\n\n /**\n * Create a server error for Vite dev server not initialized\n */\n static viteNotInitialized(): ServerError {\n return new ServerError(\"Vite dev server not initialized\");\n }\n\n /**\n * Create a server error for missing client directory\n */\n static clientDirectoryNotFound(searchedPaths: string[]): ServerError {\n return new ServerError(\n `Could not find client directory. Searched for vite.config.ts/js + index.html in: ${searchedPaths.join(\", \")}`,\n { context: { searchedPaths } },\n );\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"server.js","names":[],"sources":["../../src/errors/server.ts"],"sourcesContent":["import { AppKitError } from \"./base\";\n\n/**\n * Error thrown when server lifecycle operations fail.\n * Use for server start/stop issues, configuration conflicts, etc.\n *\n * @example\n * ```typescript\n * throw new ServerError(\"Server not started\");\n * ```\n */\nexport class ServerError extends AppKitError {\n readonly code = \"SERVER_ERROR\";\n readonly statusCode = 500;\n readonly isRetryable = false;\n\n /**\n * Create a server error for server not started\n */\n static notStarted(): ServerError {\n return new ServerError(\n \"Server not started. Please start the server first by calling the start() method\",\n );\n }\n\n /**\n * Create a server error for Vite dev server not initialized\n */\n static viteNotInitialized(): ServerError {\n return new ServerError(\"Vite dev server not initialized\");\n }\n\n /**\n * Create a server error for missing client directory\n */\n static clientDirectoryNotFound(searchedPaths: string[]): ServerError {\n return new ServerError(\n `Could not find client directory. Searched for vite.config.ts/js + index.html in: ${searchedPaths.join(\", \")}`,\n { context: { searchedPaths } },\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;AAWA,IAAa,cAAb,MAAa,oBAAoB,YAAY;CAC3C,AAAS,OAAO;CAChB,AAAS,aAAa;CACtB,AAAS,cAAc;;;;CAKvB,OAAO,aAA0B;AAC/B,SAAO,IAAI,YACT,kFACD;;;;;CAMH,OAAO,qBAAkC;AACvC,SAAO,IAAI,YAAY,kCAAkC;;;;;CAM3D,OAAO,wBAAwB,eAAsC;AACnE,SAAO,IAAI,YACT,oFAAoF,cAAc,KAAK,KAAK,IAC5G,EAAE,SAAS,EAAE,eAAe,EAAE,CAC/B"}
|
package/dist/errors/tunnel.js
CHANGED
|
@@ -1,48 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AppKitError, init_base } from "./base.js";
|
|
1
|
+
import { AppKitError } from "./base.js";
|
|
3
2
|
|
|
4
3
|
//#region src/errors/tunnel.ts
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Error thrown when remote tunnel operations fail.
|
|
6
|
+
* Use for tunnel connection issues, message parsing failures, etc.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* throw new TunnelError("No tunnel connection available");
|
|
11
|
+
* throw new TunnelError("Failed to parse WebSocket message", { cause: parseError });
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
var TunnelError = class TunnelError extends AppKitError {
|
|
15
|
+
code = "TUNNEL_ERROR";
|
|
16
|
+
statusCode = 502;
|
|
17
|
+
isRetryable = true;
|
|
18
|
+
/**
|
|
19
|
+
* Create a tunnel error for missing tunnel getter
|
|
20
|
+
*/
|
|
21
|
+
static getterNotRegistered() {
|
|
22
|
+
return new TunnelError("Tunnel getter not registered for DevFileReader singleton");
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Create a tunnel error for no available connection
|
|
26
|
+
*/
|
|
27
|
+
static noConnection() {
|
|
28
|
+
return new TunnelError("No tunnel connection available for file read");
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Create a tunnel error for asset fetch failure
|
|
32
|
+
*/
|
|
33
|
+
static fetchFailed(path, cause) {
|
|
34
|
+
return new TunnelError("Failed to fetch asset", {
|
|
35
|
+
cause,
|
|
36
|
+
context: { path }
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Create a tunnel error for message parsing failure
|
|
41
|
+
*/
|
|
42
|
+
static parseError(messageType, cause) {
|
|
43
|
+
return new TunnelError(`Failed to parse ${messageType} message`, {
|
|
44
|
+
cause,
|
|
45
|
+
context: { messageType }
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
};
|
|
44
49
|
|
|
45
50
|
//#endregion
|
|
46
|
-
|
|
47
|
-
export { TunnelError, init_tunnel };
|
|
51
|
+
export { TunnelError };
|
|
48
52
|
//# sourceMappingURL=tunnel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tunnel.js","names":[],"sources":["../../src/errors/tunnel.ts"],"sourcesContent":["import { AppKitError } from \"./base\";\n\n/**\n * Error thrown when remote tunnel operations fail.\n * Use for tunnel connection issues, message parsing failures, etc.\n *\n * @example\n * ```typescript\n * throw new TunnelError(\"No tunnel connection available\");\n * throw new TunnelError(\"Failed to parse WebSocket message\", { cause: parseError });\n * ```\n */\nexport class TunnelError extends AppKitError {\n readonly code = \"TUNNEL_ERROR\";\n readonly statusCode = 502;\n readonly isRetryable = true;\n\n /**\n * Create a tunnel error for missing tunnel getter\n */\n static getterNotRegistered(): TunnelError {\n return new TunnelError(\n \"Tunnel getter not registered for DevFileReader singleton\",\n );\n }\n\n /**\n * Create a tunnel error for no available connection\n */\n static noConnection(): TunnelError {\n return new TunnelError(\"No tunnel connection available for file read\");\n }\n\n /**\n * Create a tunnel error for asset fetch failure\n */\n static fetchFailed(path: string, cause?: Error): TunnelError {\n return new TunnelError(\"Failed to fetch asset\", {\n cause,\n context: { path },\n });\n }\n\n /**\n * Create a tunnel error for message parsing failure\n */\n static parseError(messageType: string, cause?: Error): TunnelError {\n return new TunnelError(`Failed to parse ${messageType} message`, {\n cause,\n context: { messageType },\n });\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"tunnel.js","names":[],"sources":["../../src/errors/tunnel.ts"],"sourcesContent":["import { AppKitError } from \"./base\";\n\n/**\n * Error thrown when remote tunnel operations fail.\n * Use for tunnel connection issues, message parsing failures, etc.\n *\n * @example\n * ```typescript\n * throw new TunnelError(\"No tunnel connection available\");\n * throw new TunnelError(\"Failed to parse WebSocket message\", { cause: parseError });\n * ```\n */\nexport class TunnelError extends AppKitError {\n readonly code = \"TUNNEL_ERROR\";\n readonly statusCode = 502;\n readonly isRetryable = true;\n\n /**\n * Create a tunnel error for missing tunnel getter\n */\n static getterNotRegistered(): TunnelError {\n return new TunnelError(\n \"Tunnel getter not registered for DevFileReader singleton\",\n );\n }\n\n /**\n * Create a tunnel error for no available connection\n */\n static noConnection(): TunnelError {\n return new TunnelError(\"No tunnel connection available for file read\");\n }\n\n /**\n * Create a tunnel error for asset fetch failure\n */\n static fetchFailed(path: string, cause?: Error): TunnelError {\n return new TunnelError(\"Failed to fetch asset\", {\n cause,\n context: { path },\n });\n }\n\n /**\n * Create a tunnel error for message parsing failure\n */\n static parseError(messageType: string, cause?: Error): TunnelError {\n return new TunnelError(`Failed to parse ${messageType} message`, {\n cause,\n context: { messageType },\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAYA,IAAa,cAAb,MAAa,oBAAoB,YAAY;CAC3C,AAAS,OAAO;CAChB,AAAS,aAAa;CACtB,AAAS,cAAc;;;;CAKvB,OAAO,sBAAmC;AACxC,SAAO,IAAI,YACT,2DACD;;;;;CAMH,OAAO,eAA4B;AACjC,SAAO,IAAI,YAAY,+CAA+C;;;;;CAMxE,OAAO,YAAY,MAAc,OAA4B;AAC3D,SAAO,IAAI,YAAY,yBAAyB;GAC9C;GACA,SAAS,EAAE,MAAM;GAClB,CAAC;;;;;CAMJ,OAAO,WAAW,aAAqB,OAA4B;AACjE,SAAO,IAAI,YAAY,mBAAmB,YAAY,WAAW;GAC/D;GACA,SAAS,EAAE,aAAa;GACzB,CAAC"}
|