@absolutejs/sync 2.3.0 → 2.5.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.
@@ -0,0 +1,139 @@
1
+ import { type Static } from '@sinclair/typebox';
2
+ import { Elysia } from 'elysia';
3
+ import { type SyncEngine, type SyncEngineOptions } from './engine/syncEngine';
4
+ import { type SyncSocketOptions } from './engine/socket';
5
+ import { type SyncPluginOptions } from './plugin';
6
+ import { type ReactiveHub } from './reactiveHub';
7
+ export declare const PLATFORM_SYNC_ENVIRONMENT_KEY = "ABSOLUTE_SYNC_RUNTIME";
8
+ export declare const PLATFORM_SYNC_HEALTH_PATH = "/.well-known/absolute/sync";
9
+ export declare const PlatformSyncConfigurationSchema: import("@sinclair/typebox").TObject<{
10
+ changeLogRetainMs: import("@sinclair/typebox").TInteger;
11
+ changeLogSize: import("@sinclair/typebox").TInteger;
12
+ closeOnSlow: import("@sinclair/typebox").TBoolean;
13
+ heartbeatMs: import("@sinclair/typebox").TInteger;
14
+ instanceId: import("@sinclair/typebox").TString;
15
+ maxBufferedBytes: import("@sinclair/typebox").TInteger;
16
+ mutationConcurrency: import("@sinclair/typebox").TInteger;
17
+ mutationQueueLimit: import("@sinclair/typebox").TInteger;
18
+ pushPath: import("@sinclair/typebox").TString;
19
+ socketPath: import("@sinclair/typebox").TString;
20
+ tier: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"push">, import("@sinclair/typebox").TLiteral<"engine">, import("@sinclair/typebox").TLiteral<"both">]>;
21
+ version: import("@sinclair/typebox").TLiteral<1>;
22
+ }>;
23
+ export type PlatformSyncConfiguration = Static<typeof PlatformSyncConfigurationSchema>;
24
+ export declare class PlatformSyncConfigurationError extends Error {
25
+ }
26
+ export declare const readPlatformSyncConfiguration: (environment?: Record<string, string | undefined>) => PlatformSyncConfiguration | null;
27
+ export type PlatformSyncRuntimeOptions = {
28
+ configuration?: PlatformSyncConfiguration;
29
+ engineOptions?: SyncEngineOptions;
30
+ hub?: ReactiveHub;
31
+ onSlow?: SyncSocketOptions['onSlow'];
32
+ resolveContext?: SyncSocketOptions['resolveContext'];
33
+ resolveTopics?: SyncPluginOptions['resolveTopics'];
34
+ };
35
+ export declare const createPlatformSyncRuntime: (options?: PlatformSyncRuntimeOptions) => {
36
+ app: Elysia<"", {
37
+ decorator: {};
38
+ store: {};
39
+ derive: {};
40
+ resolve: {};
41
+ }, {
42
+ typebox: {};
43
+ error: {};
44
+ }, {
45
+ schema: {};
46
+ standaloneSchema: {};
47
+ macro: {};
48
+ macroFn: {};
49
+ parser: {};
50
+ response: {};
51
+ }, {
52
+ ".well-known": {
53
+ absolute: {
54
+ sync: {
55
+ get: {
56
+ body: unknown;
57
+ params: {};
58
+ query: unknown;
59
+ headers: unknown;
60
+ response: {
61
+ 200: {
62
+ contract: 1;
63
+ instanceId: string;
64
+ ready: true;
65
+ tier: "push" | "engine" | "both";
66
+ };
67
+ };
68
+ };
69
+ };
70
+ };
71
+ };
72
+ } | ({
73
+ [x: string]: {
74
+ subscribe: {
75
+ body: {};
76
+ params: {};
77
+ query: {};
78
+ headers: {};
79
+ response: {};
80
+ };
81
+ };
82
+ } & {
83
+ ".well-known": {
84
+ absolute: {
85
+ sync: {
86
+ get: {
87
+ body: unknown;
88
+ params: {};
89
+ query: unknown;
90
+ headers: unknown;
91
+ response: {
92
+ 200: {
93
+ contract: 1;
94
+ instanceId: string;
95
+ ready: true;
96
+ tier: "push" | "engine" | "both";
97
+ };
98
+ };
99
+ };
100
+ };
101
+ };
102
+ };
103
+ }), {
104
+ derive: {};
105
+ resolve: {};
106
+ schema: {};
107
+ standaloneSchema: {};
108
+ response: {};
109
+ }, {
110
+ derive: {};
111
+ resolve: {};
112
+ schema: {};
113
+ standaloneSchema: {};
114
+ response: {};
115
+ } & {
116
+ derive: {};
117
+ resolve: {};
118
+ schema: {};
119
+ standaloneSchema: {};
120
+ response: {};
121
+ }>;
122
+ configuration: {
123
+ version: 1;
124
+ heartbeatMs: number;
125
+ maxBufferedBytes: number;
126
+ closeOnSlow: boolean;
127
+ changeLogRetainMs: number;
128
+ changeLogSize: number;
129
+ instanceId: string;
130
+ mutationConcurrency: number;
131
+ mutationQueueLimit: number;
132
+ pushPath: string;
133
+ socketPath: string;
134
+ tier: "push" | "engine" | "both";
135
+ };
136
+ engine: SyncEngine | undefined;
137
+ hub: ReactiveHub | undefined;
138
+ metrics: () => import("./engine").EngineMetrics | null;
139
+ };