@arcote.tech/arc 0.1.11 → 0.3.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.
- package/dist/adapters/auth-adapter.d.ts +47 -0
- package/dist/adapters/command-wire.d.ts +28 -0
- package/dist/adapters/event-publisher.d.ts +106 -0
- package/dist/adapters/event-wire.d.ts +79 -0
- package/dist/adapters/index.d.ts +18 -0
- package/dist/adapters/wire.d.ts +20 -0
- package/dist/context/context.d.ts +49 -52
- package/dist/context/index.d.ts +1 -9
- package/dist/context-element/command/command-context.d.ts +71 -0
- package/dist/context-element/command/command-data.d.ts +33 -0
- package/dist/context-element/command/command-handler.d.ts +6 -0
- package/dist/context-element/command/command.d.ts +198 -0
- package/dist/context-element/command/index.d.ts +6 -0
- package/dist/context-element/context-element.d.ts +75 -0
- package/dist/context-element/event/event-data.d.ts +35 -0
- package/dist/context-element/event/event.d.ts +158 -0
- package/dist/context-element/event/index.d.ts +5 -0
- package/dist/context-element/event/instance.d.ts +26 -0
- package/dist/context-element/index.d.ts +10 -0
- package/dist/context-element/view/index.d.ts +5 -0
- package/dist/context-element/view/view-context.d.ts +51 -0
- package/dist/context-element/view/view-data.d.ts +40 -0
- package/dist/context-element/view/view.d.ts +194 -0
- package/dist/data-storage/data-storage-forked.d.ts +1 -1
- package/dist/data-storage/data-storage-master.d.ts +7 -10
- package/dist/data-storage/data-storage-observable.d.ts +61 -0
- package/dist/data-storage/data-storage.abstract.d.ts +1 -1
- package/dist/{db/interface.d.ts → data-storage/database-adapter.d.ts} +8 -3
- package/dist/{database → data-storage}/database-store.d.ts +45 -0
- package/dist/data-storage/{types.d.ts → find-options.d.ts} +1 -1
- package/dist/data-storage/index.d.ts +6 -2
- package/dist/{db/postgresAdapter.d.ts → data-storage/postgresql-adapter.d.ts} +7 -33
- package/dist/data-storage/query-result-resolver.d.ts +18 -0
- package/dist/data-storage/query-result-resolver.test.d.ts +2 -0
- package/dist/{db/sqliteAdapter.d.ts → data-storage/sqlite-adapter.d.ts} +5 -31
- package/dist/data-storage/store-state-fork.d.ts +1 -1
- package/dist/data-storage/store-state-master.d.ts +6 -2
- package/dist/data-storage/store-state.abstract.d.ts +1 -1
- package/dist/elements/abstract.d.ts +1 -1
- package/dist/elements/any.d.ts +1 -1
- package/dist/elements/array.d.ts +5 -5
- package/dist/elements/blob.d.ts +1 -1
- package/dist/elements/boolean.d.ts +1 -1
- package/dist/elements/branded.d.ts +5 -5
- package/dist/elements/date.d.ts +1 -1
- package/dist/elements/default.d.ts +5 -5
- package/dist/elements/file.d.ts +1 -1
- package/dist/elements/id.d.ts +3 -3
- package/dist/elements/index.d.ts +1 -0
- package/dist/elements/number.d.ts +1 -1
- package/dist/elements/object.d.ts +11 -10
- package/dist/elements/optional.d.ts +5 -5
- package/dist/elements/or.d.ts +5 -5
- package/dist/elements/record.d.ts +3 -3
- package/dist/elements/string-enum.d.ts +1 -1
- package/dist/elements/string.d.ts +1 -1
- package/dist/index.d.ts +8 -7
- package/dist/index.js +2355 -3371
- package/dist/model/index.d.ts +2 -0
- package/dist/model/live-query/index.d.ts +2 -0
- package/dist/model/live-query/live-query.d.ts +31 -0
- package/dist/model/live-query/query-cache.d.ts +60 -0
- package/dist/model/model-adapters.d.ts +13 -0
- package/dist/model/model.d.ts +17 -66
- package/dist/model/mutation-executor/index.d.ts +2 -0
- package/dist/model/mutation-executor/mutation-executor.d.ts +29 -0
- package/dist/token/index.d.ts +41 -0
- package/dist/token/secured-data-storage.d.ts +125 -0
- package/dist/token/token-cache.d.ts +100 -0
- package/dist/token/token-data.d.ts +38 -0
- package/dist/token/token-instance.d.ts +71 -0
- package/dist/token/token.d.ts +127 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/types/add-question-marks.d.ts +9 -0
- package/dist/utils/types/first-argument.d.ts +5 -0
- package/dist/utils/types/get-type.d.ts +13 -0
- package/dist/utils/types/index.d.ts +6 -0
- package/dist/utils/types/merge.d.ts +7 -0
- package/dist/utils/types/object-util.d.ts +6 -0
- package/dist/utils/types/simplify.d.ts +7 -0
- package/package.json +10 -6
- package/dist/command/command.d.ts +0 -45
- package/dist/command/index.d.ts +0 -2
- package/dist/context/commands.d.ts +0 -12
- package/dist/context/element.d.ts +0 -80
- package/dist/context/event.d.ts +0 -44
- package/dist/context/query-builder-context.d.ts +0 -15
- package/dist/context/query-builders.d.ts +0 -17
- package/dist/context/query-cache.d.ts +0 -9
- package/dist/context/query.d.ts +0 -12
- package/dist/context/reactive-query.d.ts +0 -23
- package/dist/context/serializable-query.d.ts +0 -11
- package/dist/database/database-mappers.d.ts +0 -39
- package/dist/database/index.d.ts +0 -3
- package/dist/db/index.d.ts +0 -4
- package/dist/listener/index.d.ts +0 -2
- package/dist/listener/listener.d.ts +0 -23
- package/dist/route/index.d.ts +0 -2
- package/dist/route/route.d.ts +0 -35
- package/dist/rtc/client.d.ts +0 -3
- package/dist/rtc/index.d.ts +0 -4
- package/dist/rtc/messages.d.ts +0 -20
- package/dist/rtc/rtc.d.ts +0 -11
- package/dist/state/index.d.ts +0 -2
- package/dist/state/query-builder.d.ts +0 -2
- package/dist/state/query.d.ts +0 -2
- package/dist/state/state.d.ts +0 -2
- package/dist/telemetry/context.d.ts +0 -65
- package/dist/telemetry/index.d.ts +0 -47
- package/dist/telemetry/interfaces.d.ts +0 -84
- package/dist/telemetry/logger.d.ts +0 -67
- package/dist/telemetry/no-op.d.ts +0 -54
- package/dist/telemetry/tracer.d.ts +0 -85
- package/dist/tests/context/context.test.d.ts +0 -2
- package/dist/tests/pipe.d.ts +0 -2
- package/dist/tests/query/advance-query.test.d.ts +0 -2
- package/dist/tests/query/collection-all.test.d.ts +0 -2
- package/dist/tests/utils/expect-not-false.d.ts +0 -2
- package/dist/tests/utils/sqlite-adapter.d.ts +0 -3
- package/dist/tests/utils/test-model.d.ts +0 -25
- package/dist/tests/validations/array.test.d.ts +0 -2
- package/dist/tests/validations/date.test.d.ts +0 -2
- package/dist/tests/validations/number.test.d.ts +0 -2
- package/dist/tests/validations/object.test.d.ts +0 -2
- package/dist/tests/validations/record.test.d.ts +0 -2
- package/dist/tests/validations/string-enum.test.d.ts +0 -2
- package/dist/tests/validations/string.test.d.ts +0 -2
- package/dist/utils.d.ts +0 -56
- package/dist/view/index.d.ts +0 -6
- package/dist/view/queries/abstract-view-query.d.ts +0 -19
- package/dist/view/queries/find-one.d.ts +0 -13
- package/dist/view/queries/find.d.ts +0 -21
- package/dist/view/queries/index.d.ts +0 -3
- package/dist/view/query-builders/find-one.d.ts +0 -14
- package/dist/view/query-builders/find.d.ts +0 -14
- package/dist/view/query-builders/index.d.ts +0 -2
- package/dist/view/record.d.ts +0 -4
- package/dist/view/static-view.d.ts +0 -43
- package/dist/view/view.d.ts +0 -68
- /package/dist/{database → data-storage}/schema-extraction.d.ts +0 -0
- /package/dist/{data-storage → utils}/deep-merge.d.ts +0 -0
package/dist/rtc/index.d.ts
DELETED
package/dist/rtc/messages.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { DataStorageChanges } from "../data-storage/data-storage.abstract";
|
|
2
|
-
export type MessageClientToHost = {
|
|
3
|
-
type: "sync";
|
|
4
|
-
lastDate: string | null;
|
|
5
|
-
} | {
|
|
6
|
-
type: "changes-executed";
|
|
7
|
-
changes: DataStorageChanges[];
|
|
8
|
-
};
|
|
9
|
-
export type MessageHostToClient = {
|
|
10
|
-
type: "sync-result";
|
|
11
|
-
store: string;
|
|
12
|
-
items: any[];
|
|
13
|
-
} | {
|
|
14
|
-
type: "state-changes";
|
|
15
|
-
changes: DataStorageChanges[];
|
|
16
|
-
} | {
|
|
17
|
-
type: "sync-done";
|
|
18
|
-
date: string;
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=messages.d.ts.map
|
package/dist/rtc/rtc.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { MasterDataStorage } from "../data-storage";
|
|
2
|
-
import type { DataStorageChanges } from "../data-storage/data-storage.abstract";
|
|
3
|
-
export interface RealTimeCommunicationAdapter {
|
|
4
|
-
commitChanges(changes: DataStorageChanges[]): void;
|
|
5
|
-
sync(progressCallback: ({ store, size }: {
|
|
6
|
-
store: string;
|
|
7
|
-
size: number;
|
|
8
|
-
}) => void): Promise<void>;
|
|
9
|
-
}
|
|
10
|
-
export type RealTimeCommunicationAdapterFactory = (storage: MasterDataStorage) => RealTimeCommunicationAdapter;
|
|
11
|
-
//# sourceMappingURL=rtc.d.ts.map
|
package/dist/state/index.d.ts
DELETED
package/dist/state/query.d.ts
DELETED
package/dist/state/state.d.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { Span } from '@opentelemetry/api';
|
|
2
|
-
import type { AuthContext } from '../context/element';
|
|
3
|
-
import { ArcLogger } from './logger';
|
|
4
|
-
/**
|
|
5
|
-
* Extended context that includes telemetry capabilities
|
|
6
|
-
*/
|
|
7
|
-
export interface ArcTelemetryContext {
|
|
8
|
-
/**
|
|
9
|
-
* Log a message with automatic trace context
|
|
10
|
-
*/
|
|
11
|
-
log: ArcLogger;
|
|
12
|
-
/**
|
|
13
|
-
* Create a child span for a specific operation
|
|
14
|
-
*/
|
|
15
|
-
startSpan(name: string, attributes?: Record<string, string | number | boolean>): Span;
|
|
16
|
-
/**
|
|
17
|
-
* Execute a function within a new span
|
|
18
|
-
*/
|
|
19
|
-
withSpan<T>(name: string, fn: (span: Span) => Promise<T> | T, attributes?: Record<string, string | number | boolean>): Promise<T>;
|
|
20
|
-
/**
|
|
21
|
-
* Add attributes to the current span
|
|
22
|
-
*/
|
|
23
|
-
addSpanAttributes(attributes: Record<string, string | number | boolean>): void;
|
|
24
|
-
/**
|
|
25
|
-
* Add an event to the current span
|
|
26
|
-
*/
|
|
27
|
-
addSpanEvent(name: string, attributes?: Record<string, string | number | boolean>): void;
|
|
28
|
-
/**
|
|
29
|
-
* Record an exception in the current span
|
|
30
|
-
*/
|
|
31
|
-
recordException(error: Error | string): void;
|
|
32
|
-
/**
|
|
33
|
-
* Get the current trace ID
|
|
34
|
-
*/
|
|
35
|
-
getTraceId(): string | undefined;
|
|
36
|
-
/**
|
|
37
|
-
* Get the current span ID
|
|
38
|
-
*/
|
|
39
|
-
getSpanId(): string | undefined;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Create telemetry context for command/event handlers
|
|
43
|
-
*/
|
|
44
|
-
export declare function createTelemetryContext(authContext: AuthContext, operationType: 'command' | 'event' | 'listener' | 'view', operationName: string): ArcTelemetryContext;
|
|
45
|
-
/**
|
|
46
|
-
* Extract trace context from headers (for HTTP requests)
|
|
47
|
-
*/
|
|
48
|
-
export declare function extractTraceContext(headers: Record<string, string | string[] | undefined>): import("@opentelemetry/api").Context;
|
|
49
|
-
/**
|
|
50
|
-
* Inject trace context into headers (for outgoing HTTP requests)
|
|
51
|
-
*/
|
|
52
|
-
export declare function injectTraceContext(headers?: Record<string, string>): Record<string, string>;
|
|
53
|
-
/**
|
|
54
|
-
* Run a function with extracted trace context
|
|
55
|
-
*/
|
|
56
|
-
export declare function withExtractedContext<T>(headers: Record<string, string | string[] | undefined>, fn: () => T): T;
|
|
57
|
-
/**
|
|
58
|
-
* Get telemetry information from current context
|
|
59
|
-
*/
|
|
60
|
-
export declare function getCurrentTelemetryInfo(): {
|
|
61
|
-
traceId: string | undefined;
|
|
62
|
-
spanId: string | undefined;
|
|
63
|
-
isRecording: boolean;
|
|
64
|
-
};
|
|
65
|
-
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
export type { TelemetryProvider, TelemetryContext, Logger, SpanOptions, DatabaseTelemetry } from './interfaces';
|
|
2
|
-
export { NoOpLogger, NoOpTelemetryContext, NoOpTelemetryProvider, NoOpDatabaseTelemetry, noOpTelemetryProvider, noOpDatabaseTelemetry, } from './no-op';
|
|
3
|
-
export declare const initializeTelemetry: (...args: any[]) => never;
|
|
4
|
-
export declare const getTelemetry: () => null;
|
|
5
|
-
export declare const startSpan: (...args: any[]) => never;
|
|
6
|
-
export declare const withSpan: (...args: any[]) => never;
|
|
7
|
-
export declare const ArcTelemetry: {
|
|
8
|
-
new (): {};
|
|
9
|
-
};
|
|
10
|
-
export declare const initializeLogger: (...args: any[]) => never;
|
|
11
|
-
export declare const getLogger: () => never;
|
|
12
|
-
export declare const ArcLogger: {
|
|
13
|
-
new (): {};
|
|
14
|
-
};
|
|
15
|
-
export declare const createTelemetryContext: (...args: any[]) => never;
|
|
16
|
-
export declare const extractTraceContext: (...args: any[]) => never;
|
|
17
|
-
export declare const injectTraceContext: (...args: any[]) => never;
|
|
18
|
-
export declare const withExtractedContext: (...args: any[]) => never;
|
|
19
|
-
export declare const getCurrentTelemetryInfo: () => {
|
|
20
|
-
traceId: undefined;
|
|
21
|
-
spanId: undefined;
|
|
22
|
-
isRecording: boolean;
|
|
23
|
-
};
|
|
24
|
-
export type TelemetryConfig = any;
|
|
25
|
-
export type LogContext = Record<string, any>;
|
|
26
|
-
export type LogEntry = any;
|
|
27
|
-
export type ArcTelemetryContext = any;
|
|
28
|
-
export declare const SpanKind: {
|
|
29
|
-
readonly INTERNAL: "internal";
|
|
30
|
-
readonly SERVER: "server";
|
|
31
|
-
readonly CLIENT: "client";
|
|
32
|
-
readonly PRODUCER: "producer";
|
|
33
|
-
readonly CONSUMER: "consumer";
|
|
34
|
-
};
|
|
35
|
-
export declare const SpanStatusCode: {
|
|
36
|
-
readonly UNSET: 0;
|
|
37
|
-
readonly OK: 1;
|
|
38
|
-
readonly ERROR: 2;
|
|
39
|
-
};
|
|
40
|
-
export declare const LogLevel: {
|
|
41
|
-
readonly ERROR: "error";
|
|
42
|
-
readonly WARN: "warn";
|
|
43
|
-
readonly INFO: "info";
|
|
44
|
-
readonly DEBUG: "debug";
|
|
45
|
-
readonly TRACE: "trace";
|
|
46
|
-
};
|
|
47
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import type { AuthContext } from '../context/element';
|
|
2
|
-
/**
|
|
3
|
-
* Environment-agnostic telemetry context that handlers receive
|
|
4
|
-
* Automatically correlates logs with trace IDs
|
|
5
|
-
*/
|
|
6
|
-
export interface TelemetryContext {
|
|
7
|
-
/**
|
|
8
|
-
* Logging methods that auto-correlate with trace ID
|
|
9
|
-
*/
|
|
10
|
-
log: {
|
|
11
|
-
info(message: string, context?: Record<string, any>): void;
|
|
12
|
-
error(message: string, context?: Record<string, any>, error?: Error): void;
|
|
13
|
-
debug(message: string, context?: Record<string, any>): void;
|
|
14
|
-
warn(message: string, context?: Record<string, any>): void;
|
|
15
|
-
command(name: string, message: string, context?: Record<string, any>): void;
|
|
16
|
-
event(type: string, message: string, context?: Record<string, any>): void;
|
|
17
|
-
database(operation: string, message: string, context?: Record<string, any>): void;
|
|
18
|
-
http(method: string, path: string, statusCode: number, duration: number, context?: Record<string, any>): void;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Span management (automatically correlates logs with traces)
|
|
22
|
-
*/
|
|
23
|
-
startSpan(name: string, attributes?: Record<string, string | number | boolean>): void;
|
|
24
|
-
addAttributes(attributes: Record<string, string | number | boolean>): void;
|
|
25
|
-
addEvent(name: string, attributes?: Record<string, string | number | boolean>): void;
|
|
26
|
-
recordException(error: Error | string): void;
|
|
27
|
-
/**
|
|
28
|
-
* Trace correlation info
|
|
29
|
-
*/
|
|
30
|
-
getTraceId(): string | undefined;
|
|
31
|
-
getSpanId(): string | undefined;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Span options for creating new spans
|
|
35
|
-
*/
|
|
36
|
-
export interface SpanOptions {
|
|
37
|
-
kind?: 'client' | 'server' | 'internal' | 'producer' | 'consumer';
|
|
38
|
-
attributes?: Record<string, string | number | boolean>;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Main telemetry provider interface that environments must implement
|
|
42
|
-
*/
|
|
43
|
-
export interface TelemetryProvider {
|
|
44
|
-
/**
|
|
45
|
-
* Create a logger instance
|
|
46
|
-
*/
|
|
47
|
-
createLogger(name: string): Logger;
|
|
48
|
-
/**
|
|
49
|
-
* Execute function within a span context
|
|
50
|
-
*/
|
|
51
|
-
withSpan<T>(name: string, fn: (context: TelemetryContext) => Promise<T> | T, options?: SpanOptions): Promise<T>;
|
|
52
|
-
/**
|
|
53
|
-
* Create telemetry context for command/route handlers
|
|
54
|
-
*/
|
|
55
|
-
createTelemetryContext(authContext: AuthContext, operationType: 'command' | 'event' | 'listener' | 'view' | 'route', operationName: string): TelemetryContext;
|
|
56
|
-
/**
|
|
57
|
-
* Check if telemetry is enabled
|
|
58
|
-
*/
|
|
59
|
-
isEnabled(): boolean;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Basic logger interface
|
|
63
|
-
*/
|
|
64
|
-
export interface Logger {
|
|
65
|
-
info(message: string, context?: Record<string, any>): void;
|
|
66
|
-
error(message: string, context?: Record<string, any>, error?: Error): void;
|
|
67
|
-
debug(message: string, context?: Record<string, any>): void;
|
|
68
|
-
warn(message: string, context?: Record<string, any>): void;
|
|
69
|
-
command(name: string, message: string, context?: Record<string, any>): void;
|
|
70
|
-
event(type: string, message: string, context?: Record<string, any>): void;
|
|
71
|
-
database(operation: string, message: string, context?: Record<string, any>): void;
|
|
72
|
-
http(method: string, path: string, statusCode: number, duration: number, context?: Record<string, any>): void;
|
|
73
|
-
child(context: Record<string, any>): Logger;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Database telemetry interface for adapters
|
|
77
|
-
*/
|
|
78
|
-
export interface DatabaseTelemetry {
|
|
79
|
-
/**
|
|
80
|
-
* Execute a database operation with telemetry
|
|
81
|
-
*/
|
|
82
|
-
withDatabaseOperation<T>(operation: string, sql: string, params: any[] | undefined, tableName: string | undefined, fn: () => Promise<T>): Promise<T>;
|
|
83
|
-
}
|
|
84
|
-
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
export declare enum LogLevel {
|
|
2
|
-
ERROR = "error",
|
|
3
|
-
WARN = "warn",
|
|
4
|
-
INFO = "info",
|
|
5
|
-
DEBUG = "debug",
|
|
6
|
-
TRACE = "trace"
|
|
7
|
-
}
|
|
8
|
-
interface LogContext {
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
}
|
|
11
|
-
interface LogEntry {
|
|
12
|
-
level: LogLevel;
|
|
13
|
-
message: string;
|
|
14
|
-
context?: LogContext;
|
|
15
|
-
timestamp?: string;
|
|
16
|
-
traceId?: string;
|
|
17
|
-
spanId?: string;
|
|
18
|
-
userId?: string;
|
|
19
|
-
requestId?: string;
|
|
20
|
-
command?: string;
|
|
21
|
-
event?: string;
|
|
22
|
-
error?: Error;
|
|
23
|
-
}
|
|
24
|
-
declare class ArcLogger {
|
|
25
|
-
private serviceName;
|
|
26
|
-
constructor(serviceName?: string);
|
|
27
|
-
private createLogEntry;
|
|
28
|
-
private formatForConsole;
|
|
29
|
-
private output;
|
|
30
|
-
private getSeverityNumber;
|
|
31
|
-
error(message: string, context?: LogContext, error?: Error): void;
|
|
32
|
-
warn(message: string, context?: LogContext): void;
|
|
33
|
-
info(message: string, context?: LogContext): void;
|
|
34
|
-
debug(message: string, context?: LogContext): void;
|
|
35
|
-
trace(message: string, context?: LogContext): void;
|
|
36
|
-
/**
|
|
37
|
-
* Log command execution
|
|
38
|
-
*/
|
|
39
|
-
command(commandName: string, message: string, context?: LogContext): void;
|
|
40
|
-
/**
|
|
41
|
-
* Log event processing
|
|
42
|
-
*/
|
|
43
|
-
event(eventType: string, message: string, context?: LogContext): void;
|
|
44
|
-
/**
|
|
45
|
-
* Log database operations
|
|
46
|
-
*/
|
|
47
|
-
database(operation: string, message: string, context?: LogContext): void;
|
|
48
|
-
/**
|
|
49
|
-
* Log HTTP requests
|
|
50
|
-
*/
|
|
51
|
-
http(method: string, path: string, statusCode: number, duration: number, context?: LogContext): void;
|
|
52
|
-
/**
|
|
53
|
-
* Create a child logger with additional context
|
|
54
|
-
*/
|
|
55
|
-
child(context: LogContext): ArcLogger;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Initialize global logger
|
|
59
|
-
*/
|
|
60
|
-
export declare function initializeLogger(serviceName?: string): ArcLogger;
|
|
61
|
-
/**
|
|
62
|
-
* Get the global logger instance
|
|
63
|
-
*/
|
|
64
|
-
export declare function getLogger(): ArcLogger;
|
|
65
|
-
export { ArcLogger };
|
|
66
|
-
export type { LogContext, LogEntry };
|
|
67
|
-
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import type { TelemetryProvider, TelemetryContext, Logger, DatabaseTelemetry } from './interfaces';
|
|
2
|
-
/**
|
|
3
|
-
* No-op logger implementation for when telemetry is disabled
|
|
4
|
-
*/
|
|
5
|
-
export declare class NoOpLogger implements Logger {
|
|
6
|
-
info(): void;
|
|
7
|
-
error(): void;
|
|
8
|
-
debug(): void;
|
|
9
|
-
warn(): void;
|
|
10
|
-
command(): void;
|
|
11
|
-
event(): void;
|
|
12
|
-
database(): void;
|
|
13
|
-
http(): void;
|
|
14
|
-
child(): Logger;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* No-op telemetry context for when telemetry is disabled
|
|
18
|
-
*/
|
|
19
|
-
export declare class NoOpTelemetryContext implements TelemetryContext {
|
|
20
|
-
private logger;
|
|
21
|
-
log: NoOpLogger;
|
|
22
|
-
startSpan(): void;
|
|
23
|
-
addAttributes(): void;
|
|
24
|
-
addEvent(): void;
|
|
25
|
-
recordException(): void;
|
|
26
|
-
getTraceId(): undefined;
|
|
27
|
-
getSpanId(): undefined;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* No-op telemetry provider for when telemetry is disabled
|
|
31
|
-
*/
|
|
32
|
-
export declare class NoOpTelemetryProvider implements TelemetryProvider {
|
|
33
|
-
private logger;
|
|
34
|
-
private context;
|
|
35
|
-
createLogger(): Logger;
|
|
36
|
-
withSpan<T>(name: string, fn: (context: TelemetryContext) => Promise<T> | T): Promise<T>;
|
|
37
|
-
createTelemetryContext(): TelemetryContext;
|
|
38
|
-
isEnabled(): boolean;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* No-op database telemetry for when telemetry is disabled
|
|
42
|
-
*/
|
|
43
|
-
export declare class NoOpDatabaseTelemetry implements DatabaseTelemetry {
|
|
44
|
-
withDatabaseOperation<T>(operation: string, sql: string, params: any[] | undefined, tableName: string | undefined, fn: () => Promise<T>): Promise<T>;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Default no-op telemetry provider instance
|
|
48
|
-
*/
|
|
49
|
-
export declare const noOpTelemetryProvider: NoOpTelemetryProvider;
|
|
50
|
-
/**
|
|
51
|
-
* Default no-op database telemetry instance
|
|
52
|
-
*/
|
|
53
|
-
export declare const noOpDatabaseTelemetry: NoOpDatabaseTelemetry;
|
|
54
|
-
//# sourceMappingURL=no-op.d.ts.map
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { SpanKind, SpanStatusCode } from "@opentelemetry/api";
|
|
2
|
-
import type { Span } from "@opentelemetry/api";
|
|
3
|
-
interface TelemetryConfig {
|
|
4
|
-
serviceName: string;
|
|
5
|
-
serviceVersion: string;
|
|
6
|
-
environment: string;
|
|
7
|
-
otlpEndpoint?: string;
|
|
8
|
-
enabled?: boolean;
|
|
9
|
-
}
|
|
10
|
-
declare class ArcTelemetry {
|
|
11
|
-
private sdk?;
|
|
12
|
-
private tracer;
|
|
13
|
-
private logger;
|
|
14
|
-
private config;
|
|
15
|
-
constructor(config: TelemetryConfig);
|
|
16
|
-
private initialize;
|
|
17
|
-
/**
|
|
18
|
-
* Create a new span for tracing operations
|
|
19
|
-
*/
|
|
20
|
-
startSpan(name: string, options?: {
|
|
21
|
-
kind?: SpanKind;
|
|
22
|
-
attributes?: Record<string, string | number | boolean>;
|
|
23
|
-
parent?: Span;
|
|
24
|
-
}): Span;
|
|
25
|
-
/**
|
|
26
|
-
* Execute a function within a span context
|
|
27
|
-
*/
|
|
28
|
-
withSpan<T>(name: string, fn: (span: Span) => Promise<T> | T, options?: {
|
|
29
|
-
kind?: SpanKind;
|
|
30
|
-
attributes?: Record<string, string | number | boolean>;
|
|
31
|
-
}): Promise<T>;
|
|
32
|
-
/**
|
|
33
|
-
* Add attributes to the current active span
|
|
34
|
-
*/
|
|
35
|
-
addSpanAttributes(attributes: Record<string, string | number | boolean>): void;
|
|
36
|
-
/**
|
|
37
|
-
* Add an event to the current active span
|
|
38
|
-
*/
|
|
39
|
-
addSpanEvent(name: string, attributes?: Record<string, string | number | boolean>): void;
|
|
40
|
-
/**
|
|
41
|
-
* Record an exception in the current span
|
|
42
|
-
*/
|
|
43
|
-
recordException(error: Error | string): void;
|
|
44
|
-
/**
|
|
45
|
-
* Shutdown telemetry (call on app shutdown)
|
|
46
|
-
*/
|
|
47
|
-
shutdown(): Promise<void>;
|
|
48
|
-
/**
|
|
49
|
-
* Check if telemetry is enabled
|
|
50
|
-
*/
|
|
51
|
-
get isEnabled(): boolean;
|
|
52
|
-
/**
|
|
53
|
-
* Get the current tracer instance
|
|
54
|
-
*/
|
|
55
|
-
getTracer(): any;
|
|
56
|
-
/**
|
|
57
|
-
* Get the current logger instance
|
|
58
|
-
*/
|
|
59
|
-
getLogger(): any;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Initialize global telemetry
|
|
63
|
-
*/
|
|
64
|
-
export declare function initializeTelemetry(config: TelemetryConfig): ArcTelemetry;
|
|
65
|
-
/**
|
|
66
|
-
* Get the global telemetry instance
|
|
67
|
-
*/
|
|
68
|
-
export declare function getTelemetry(): ArcTelemetry | null;
|
|
69
|
-
/**
|
|
70
|
-
* Helper function to create a span
|
|
71
|
-
*/
|
|
72
|
-
export declare function startSpan(name: string, options?: {
|
|
73
|
-
kind?: SpanKind;
|
|
74
|
-
attributes?: Record<string, string | number | boolean>;
|
|
75
|
-
}): Span;
|
|
76
|
-
/**
|
|
77
|
-
* Helper function to execute code within a span
|
|
78
|
-
*/
|
|
79
|
-
export declare function withSpan<T>(name: string, fn: (span: Span) => Promise<T> | T, options?: {
|
|
80
|
-
kind?: SpanKind;
|
|
81
|
-
attributes?: Record<string, string | number | boolean>;
|
|
82
|
-
}): Promise<T>;
|
|
83
|
-
export { ArcTelemetry, SpanKind, SpanStatusCode };
|
|
84
|
-
export type { TelemetryConfig };
|
|
85
|
-
//# sourceMappingURL=tracer.d.ts.map
|
package/dist/tests/pipe.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ArcContextAny } from "../../context/context";
|
|
2
|
-
import { type DataStorageChanges } from "../../data-storage";
|
|
3
|
-
import { Model } from "../../model";
|
|
4
|
-
import type { RealTimeCommunicationAdapter } from "../../rtc";
|
|
5
|
-
export declare class TestRTCAdapter implements RealTimeCommunicationAdapter {
|
|
6
|
-
private syncCalls;
|
|
7
|
-
private commitCalls;
|
|
8
|
-
commitChanges(changes: DataStorageChanges[]): void;
|
|
9
|
-
sync(progressCallback: ({ store, size, }: {
|
|
10
|
-
store: string;
|
|
11
|
-
size: number;
|
|
12
|
-
}) => void): Promise<void>;
|
|
13
|
-
getSyncCalls(): {
|
|
14
|
-
store: string;
|
|
15
|
-
size: number;
|
|
16
|
-
}[];
|
|
17
|
-
getCommitCalls(): DataStorageChanges[][];
|
|
18
|
-
clearHistory(): void;
|
|
19
|
-
}
|
|
20
|
-
export declare function testModel<C extends ArcContextAny>(arcContext: C): {
|
|
21
|
-
model: Model<C>;
|
|
22
|
-
getRTCAdapter(): TestRTCAdapter;
|
|
23
|
-
clearRTCHistory(): void;
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=test-model.d.ts.map
|
package/dist/utils.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { ArcElement } from "./elements/element";
|
|
2
|
-
export declare namespace objectUtil {
|
|
3
|
-
export type MergeShapes<U, V> = {
|
|
4
|
-
[k in Exclude<keyof U, keyof V>]: U[k];
|
|
5
|
-
} & V;
|
|
6
|
-
type optionalKeys<T extends any> = {
|
|
7
|
-
[k in keyof T]: undefined extends T[k] ? k : never;
|
|
8
|
-
}[keyof T];
|
|
9
|
-
type requiredKeys<T extends any> = {
|
|
10
|
-
[k in keyof T]: undefined extends T[k] ? never : k;
|
|
11
|
-
}[keyof T];
|
|
12
|
-
export type addQuestionMarks<T extends any> = simplify<{
|
|
13
|
-
[K in requiredKeys<T>]: T[K];
|
|
14
|
-
} & {
|
|
15
|
-
[K in optionalKeys<T>]?: T[K];
|
|
16
|
-
} & {
|
|
17
|
-
[k in keyof T]?: unknown;
|
|
18
|
-
}>;
|
|
19
|
-
export type identity<T> = T;
|
|
20
|
-
export type flatten<T> = identity<{
|
|
21
|
-
[k in keyof T]: T[k];
|
|
22
|
-
}>;
|
|
23
|
-
export type noNeverKeys<T> = {
|
|
24
|
-
[k in keyof T]: [T[k]] extends [never] ? never : k;
|
|
25
|
-
}[keyof T];
|
|
26
|
-
export type noNever<T> = identity<{
|
|
27
|
-
[k in noNeverKeys<T>]: k extends keyof T ? T[k] : never;
|
|
28
|
-
}>;
|
|
29
|
-
export const mergeShapes: <U, T>(first: U, second: T) => T & U;
|
|
30
|
-
export type extendShape<A extends object, B extends object> = {
|
|
31
|
-
[K in keyof A as K extends keyof B ? never : K]: A[K];
|
|
32
|
-
} & {
|
|
33
|
-
[K in keyof B]: B[K];
|
|
34
|
-
};
|
|
35
|
-
export type simplify<T> = {
|
|
36
|
-
[KeyType in keyof T]: T[KeyType];
|
|
37
|
-
} & {};
|
|
38
|
-
export {};
|
|
39
|
-
}
|
|
40
|
-
export declare namespace util {
|
|
41
|
-
type FirstArgument<T> = T extends (arg: infer U, ...args: any[]) => any ? U : never;
|
|
42
|
-
type GetType<Element extends ArcElement> = ReturnType<Element["deserialize"]>;
|
|
43
|
-
}
|
|
44
|
-
export type DeepPartial<T> = {
|
|
45
|
-
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
46
|
-
};
|
|
47
|
-
export type $type<E extends {
|
|
48
|
-
deserialize: (...args: any) => any;
|
|
49
|
-
}> = ReturnType<E["deserialize"]>;
|
|
50
|
-
export type $omit<E extends {
|
|
51
|
-
deserialize: (...args: any) => any;
|
|
52
|
-
}, K extends keyof ReturnType<E["deserialize"]>> = objectUtil.addQuestionMarks<Omit<objectUtil.simplify<ReturnType<E["deserialize"]>>, K>>;
|
|
53
|
-
export type $partial<E extends {
|
|
54
|
-
deserialize: (...args: any) => any;
|
|
55
|
-
}, K extends keyof ReturnType<E["deserialize"]> = never> = DeepPartial<objectUtil.addQuestionMarks<Omit<objectUtil.simplify<ReturnType<E["deserialize"]>>, K>>>;
|
|
56
|
-
//# sourceMappingURL=utils.d.ts.map
|
package/dist/view/index.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ArcSerializableQuery } from "../../context/serializable-query";
|
|
2
|
-
import type { DataStorage, ListenerEvent, StoreState } from "../../data-storage";
|
|
3
|
-
import type { ArcIdAny, ArcObjectAny } from "../../elements";
|
|
4
|
-
import type { $type } from "../../utils";
|
|
5
|
-
import type { ArcViewAny } from "../view";
|
|
6
|
-
export type ArcViewItem<Id extends ArcIdAny, Schema extends ArcObjectAny> = {
|
|
7
|
-
_id: $type<Id>;
|
|
8
|
-
} & $type<Schema>;
|
|
9
|
-
export declare abstract class ArcViewQuery<View extends ArcViewAny, Result, Params> extends ArcSerializableQuery<Result, Params> {
|
|
10
|
-
protected view: View;
|
|
11
|
-
protected bindedChangeHandler: (changes: ListenerEvent<ArcViewItem<View["id"], View["schema"]>>[]) => void;
|
|
12
|
-
private store;
|
|
13
|
-
constructor(view: View, params: Params);
|
|
14
|
-
run(dataStorage: DataStorage): Promise<Result>;
|
|
15
|
-
protected abstract onChange(change: ListenerEvent<ArcViewItem<View["id"], View["schema"]>>): Result | false;
|
|
16
|
-
protected abstract fetch(store: StoreState<ArcViewItem<View["id"], View["schema"]>>): Promise<Result>;
|
|
17
|
-
protected changeHandler(changes: ListenerEvent<ArcViewItem<View["id"], View["schema"]>>[]): void;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=abstract-view-query.d.ts.map
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ListenerEvent, StoreState } from "../../data-storage";
|
|
2
|
-
import type { FindOptions } from "../../data-storage/types";
|
|
3
|
-
import type { ArcViewAny } from "../view";
|
|
4
|
-
import { ArcViewQuery, type ArcViewItem } from "./abstract-view-query";
|
|
5
|
-
export declare class ArcViewFindOneQuery<View extends ArcViewAny> extends ArcViewQuery<View, ArcViewItem<View["id"], View["schema"]> | undefined, FindOptions<ArcViewItem<View["id"], View["schema"]>>> {
|
|
6
|
-
protected params: FindOptions<ArcViewItem<View["id"], View["schema"]>>;
|
|
7
|
-
constructor(view: View, params: FindOptions<ArcViewItem<View["id"], View["schema"]>>);
|
|
8
|
-
protected fetch(store: StoreState<ArcViewItem<View["id"], View["schema"]>>): Promise<ArcViewItem<View["id"], View["schema"]> | undefined>;
|
|
9
|
-
protected checkItem(item: ArcViewItem<View["id"], View["schema"]>): boolean;
|
|
10
|
-
protected onChange(change: ListenerEvent<ArcViewItem<View["id"], View["schema"]>>): false | ArcViewItem<View["id"], View["schema"]> | undefined;
|
|
11
|
-
protected createResult(result: ArcViewItem<View["id"], View["schema"]> | undefined): ArcViewItem<View["id"], View["schema"]> | undefined;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=find-one.d.ts.map
|