powersync 0.1.0 → 0.1.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.
- package/README.md +14 -14
- package/dist/commands/init.d.ts +0 -1
- package/dist/commands/init.js +11 -8
- package/dist/commands/instance/sync-rules/generate-schema.js +6 -6
- package/dist/constants.d.ts +2 -5
- package/dist/constants.js +4 -2
- package/dist/service/accounts.client.js +11129 -25
- package/dist/service/powersync.client.js +37453 -113
- package/dist/service/types.js +1 -1
- package/dist/service/utils.js +6 -6
- package/dist/utils.js +5 -7
- package/oclif.manifest.json +1 -1
- package/package.json +28 -20
- package/dist/powersync-sdk/accounts/api.d.ts +0 -717
- package/dist/powersync-sdk/accounts/api.js +0 -182
- package/dist/powersync-sdk/accounts/client.d.ts +0 -1096
- package/dist/powersync-sdk/accounts/client.js +0 -124
- package/dist/powersync-sdk/accounts/codecs.d.ts +0 -32
- package/dist/powersync-sdk/accounts/codecs.js +0 -93
- package/dist/powersync-sdk/accounts/index.d.ts +0 -4
- package/dist/powersync-sdk/accounts/index.js +0 -4
- package/dist/powersync-sdk/accounts/models.d.ts +0 -260
- package/dist/powersync-sdk/accounts/models.js +0 -96
- package/dist/powersync-sdk/accounts/routes.d.ts +0 -44
- package/dist/powersync-sdk/accounts/routes.js +0 -45
- package/dist/powersync-sdk/accounts/source.d.ts +0 -76
- package/dist/powersync-sdk/accounts/source.js +0 -32
- package/dist/powersync-sdk/errors/errors.d.ts +0 -62
- package/dist/powersync-sdk/errors/errors.js +0 -115
- package/dist/powersync-sdk/errors/index.d.ts +0 -2
- package/dist/powersync-sdk/errors/index.js +0 -2
- package/dist/powersync-sdk/errors/utils.d.ts +0 -4
- package/dist/powersync-sdk/errors/utils.js +0 -18
- package/dist/powersync-sdk/fetch-clients/codecs.d.ts +0 -4
- package/dist/powersync-sdk/fetch-clients/codecs.js +0 -34
- package/dist/powersync-sdk/fetch-clients/decoders.d.ts +0 -3
- package/dist/powersync-sdk/fetch-clients/decoders.js +0 -35
- package/dist/powersync-sdk/fetch-clients/definitions.d.ts +0 -97
- package/dist/powersync-sdk/fetch-clients/definitions.js +0 -22
- package/dist/powersync-sdk/fetch-clients/errors.d.ts +0 -7
- package/dist/powersync-sdk/fetch-clients/errors.js +0 -19
- package/dist/powersync-sdk/fetch-clients/index.d.ts +0 -5
- package/dist/powersync-sdk/fetch-clients/index.js +0 -5
- package/dist/powersync-sdk/fetch-clients/node-client.d.ts +0 -9
- package/dist/powersync-sdk/fetch-clients/node-client.js +0 -107
- package/dist/powersync-sdk/fetch-clients/request.d.ts +0 -11
- package/dist/powersync-sdk/fetch-clients/request.js +0 -138
- package/dist/powersync-sdk/fetch-clients/streaming.d.ts +0 -65
- package/dist/powersync-sdk/fetch-clients/streaming.js +0 -99
- package/dist/powersync-sdk/fetch-clients/utils.d.ts +0 -13
- package/dist/powersync-sdk/fetch-clients/utils.js +0 -43
- package/dist/powersync-sdk/fetch-clients/web-client.d.ts +0 -14
- package/dist/powersync-sdk/fetch-clients/web-client.js +0 -56
- package/dist/powersync-sdk/json/index.d.ts +0 -4
- package/dist/powersync-sdk/json/index.js +0 -3
- package/dist/powersync-sdk/json/json.d.ts +0 -5
- package/dist/powersync-sdk/json/json.js +0 -35
- package/dist/powersync-sdk/json/json_container.d.ts +0 -18
- package/dist/powersync-sdk/json/json_container.js +0 -28
- package/dist/powersync-sdk/json/json_stringify.d.ts +0 -36
- package/dist/powersync-sdk/json/json_stringify.js +0 -162
- package/dist/powersync-sdk/powersync/client.d.ts +0 -449
- package/dist/powersync-sdk/powersync/client.js +0 -53
- package/dist/powersync-sdk/powersync/config/HostedConfig.d.ts +0 -327
- package/dist/powersync-sdk/powersync/config/HostedConfig.js +0 -92
- package/dist/powersync-sdk/powersync/config/PowerSyncConfig.d.ts +0 -211
- package/dist/powersync-sdk/powersync/config/PowerSyncConfig.js +0 -97
- package/dist/powersync-sdk/powersync/config/normalize.d.ts +0 -32
- package/dist/powersync-sdk/powersync/config/normalize.js +0 -85
- package/dist/powersync-sdk/powersync/definitions.d.ts +0 -149
- package/dist/powersync-sdk/powersync/definitions.js +0 -97
- package/dist/powersync-sdk/powersync/index.d.ts +0 -8
- package/dist/powersync-sdk/powersync/index.js +0 -8
- package/dist/powersync-sdk/powersync/internal_routes.d.ts +0 -247
- package/dist/powersync-sdk/powersync/internal_routes.js +0 -69
- package/dist/powersync-sdk/powersync/routes.d.ts +0 -779
- package/dist/powersync-sdk/powersync/routes.js +0 -191
- package/dist/powersync-sdk/sdk-clients/endpoints.d.ts +0 -31
- package/dist/powersync-sdk/sdk-clients/endpoints.js +0 -48
- package/dist/powersync-sdk/sdk-clients/index.d.ts +0 -3
- package/dist/powersync-sdk/sdk-clients/index.js +0 -3
- package/dist/powersync-sdk/sdk-clients/pagination.d.ts +0 -14
- package/dist/powersync-sdk/sdk-clients/pagination.js +0 -21
- package/dist/powersync-sdk/sdk-clients/sdk-client.d.ts +0 -17
- package/dist/powersync-sdk/sdk-clients/sdk-client.js +0 -30
- package/dist/powersync-sdk/streaming/bson/buffer-array.d.ts +0 -31
- package/dist/powersync-sdk/streaming/bson/buffer-array.js +0 -79
- package/dist/powersync-sdk/streaming/bson/constants.d.ts +0 -2
- package/dist/powersync-sdk/streaming/bson/constants.js +0 -1
- package/dist/powersync-sdk/streaming/bson/decoder.d.ts +0 -10
- package/dist/powersync-sdk/streaming/bson/decoder.js +0 -62
- package/dist/powersync-sdk/streaming/bson/encoder.d.ts +0 -10
- package/dist/powersync-sdk/streaming/bson/encoder.js +0 -23
- package/dist/powersync-sdk/streaming/bson/header.d.ts +0 -11
- package/dist/powersync-sdk/streaming/bson/header.js +0 -52
- package/dist/powersync-sdk/streaming/bson/index.d.ts +0 -5
- package/dist/powersync-sdk/streaming/bson/index.js +0 -5
- package/dist/powersync-sdk/streaming/core/backpressure.d.ts +0 -15
- package/dist/powersync-sdk/streaming/core/backpressure.js +0 -34
- package/dist/powersync-sdk/streaming/core/cross-stream.d.ts +0 -6
- package/dist/powersync-sdk/streaming/core/cross-stream.js +0 -17
- package/dist/powersync-sdk/streaming/core/index.d.ts +0 -4
- package/dist/powersync-sdk/streaming/core/index.js +0 -4
- package/dist/powersync-sdk/streaming/core/node-utils.d.ts +0 -7
- package/dist/powersync-sdk/streaming/core/node-utils.js +0 -11
- package/dist/powersync-sdk/streaming/core/transformers.d.ts +0 -41
- package/dist/powersync-sdk/streaming/core/transformers.js +0 -70
- package/dist/powersync-sdk/streaming/core/utils.d.ts +0 -36
- package/dist/powersync-sdk/streaming/core/utils.js +0 -66
- package/dist/powersync-sdk/streaming/index.d.ts +0 -3
- package/dist/powersync-sdk/streaming/index.js +0 -3
- package/dist/powersync-sdk/streaming/web.d.ts +0 -4
- package/dist/powersync-sdk/streaming/web.js +0 -4
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/binaryreader.d.ts +0 -2
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/binaryreader.js +0 -36
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/binarywriter.d.ts +0 -2
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/binarywriter.js +0 -58
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/geometry.d.ts +0 -18
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/geometry.js +0 -348
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/geometrycollection.d.ts +0 -11
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/geometrycollection.js +0 -118
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/linestring.d.ts +0 -11
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/linestring.js +0 -131
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/multilinestring.d.ts +0 -11
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/multilinestring.js +0 -134
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/multipoint.d.ts +0 -11
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/multipoint.js +0 -122
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/multipolygon.d.ts +0 -11
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/multipolygon.js +0 -158
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/point.d.ts +0 -14
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/point.js +0 -165
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/polygon.d.ts +0 -11
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/polygon.js +0 -207
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/types.d.ts +0 -30
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/types.js +0 -29
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/wktparser.d.ts +0 -2
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/wktparser.js +0 -111
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/wkx.d.ts +0 -9
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/wkx.js +0 -9
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/zigzag.d.ts +0 -5
- package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/zigzag.js +0 -9
- package/dist/powersync-sdk/sync-rules/DartSchemaGenerator.d.ts +0 -12
- package/dist/powersync-sdk/sync-rules/DartSchemaGenerator.js +0 -35
- package/dist/powersync-sdk/sync-rules/ExpressionType.d.ts +0 -33
- package/dist/powersync-sdk/sync-rules/ExpressionType.js +0 -62
- package/dist/powersync-sdk/sync-rules/IdSequence.d.ts +0 -4
- package/dist/powersync-sdk/sync-rules/IdSequence.js +0 -7
- package/dist/powersync-sdk/sync-rules/JsSchemaGenerator.d.ts +0 -12
- package/dist/powersync-sdk/sync-rules/JsSchemaGenerator.js +0 -38
- package/dist/powersync-sdk/sync-rules/SchemaGenerator.d.ts +0 -14
- package/dist/powersync-sdk/sync-rules/SchemaGenerator.js +0 -24
- package/dist/powersync-sdk/sync-rules/SourceTableInterface.d.ts +0 -5
- package/dist/powersync-sdk/sync-rules/SourceTableInterface.js +0 -1
- package/dist/powersync-sdk/sync-rules/SqlBucketDescriptor.d.ts +0 -37
- package/dist/powersync-sdk/sync-rules/SqlBucketDescriptor.js +0 -116
- package/dist/powersync-sdk/sync-rules/SqlDataQuery.d.ts +0 -39
- package/dist/powersync-sdk/sync-rules/SqlDataQuery.js +0 -245
- package/dist/powersync-sdk/sync-rules/SqlParameterQuery.d.ts +0 -43
- package/dist/powersync-sdk/sync-rules/SqlParameterQuery.js +0 -254
- package/dist/powersync-sdk/sync-rules/SqlSyncRules.d.ts +0 -52
- package/dist/powersync-sdk/sync-rules/SqlSyncRules.js +0 -252
- package/dist/powersync-sdk/sync-rules/StaticSchema.d.ts +0 -26
- package/dist/powersync-sdk/sync-rules/StaticSchema.js +0 -71
- package/dist/powersync-sdk/sync-rules/StaticSqlParameterQuery.d.ts +0 -24
- package/dist/powersync-sdk/sync-rules/StaticSqlParameterQuery.js +0 -71
- package/dist/powersync-sdk/sync-rules/TablePattern.d.ts +0 -17
- package/dist/powersync-sdk/sync-rules/TablePattern.js +0 -56
- package/dist/powersync-sdk/sync-rules/TableQuerySchema.d.ts +0 -9
- package/dist/powersync-sdk/sync-rules/TableQuerySchema.js +0 -41
- package/dist/powersync-sdk/sync-rules/errors.d.ts +0 -22
- package/dist/powersync-sdk/sync-rules/errors.js +0 -60
- package/dist/powersync-sdk/sync-rules/generators.d.ts +0 -6
- package/dist/powersync-sdk/sync-rules/generators.js +0 -6
- package/dist/powersync-sdk/sync-rules/index.d.ts +0 -17
- package/dist/powersync-sdk/sync-rules/index.js +0 -17
- package/dist/powersync-sdk/sync-rules/json_schema.d.ts +0 -3
- package/dist/powersync-sdk/sync-rules/json_schema.js +0 -50
- package/dist/powersync-sdk/sync-rules/sql_filters.d.ts +0 -91
- package/dist/powersync-sdk/sync-rules/sql_filters.js +0 -491
- package/dist/powersync-sdk/sync-rules/sql_functions.d.ts +0 -53
- package/dist/powersync-sdk/sync-rules/sql_functions.js +0 -755
- package/dist/powersync-sdk/sync-rules/sql_support.d.ts +0 -22
- package/dist/powersync-sdk/sync-rules/sql_support.js +0 -208
- package/dist/powersync-sdk/sync-rules/types.d.ts +0 -174
- package/dist/powersync-sdk/sync-rules/types.js +0 -9
- package/dist/powersync-sdk/sync-rules/utils.d.ts +0 -45
- package/dist/powersync-sdk/sync-rules/utils.js +0 -163
- package/dist/service/accounts.client.d.ts +0 -26
- package/dist/service/powersync.client.d.ts +0 -269
- package/dist/service/types.d.ts +0 -69
- package/dist/service/utils.d.ts +0 -5
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
import * as t from 'ts-codec';
|
|
2
|
-
export declare const ExecuteSqlRequest: t.ObjectCodec<{
|
|
3
|
-
connection_id: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
4
|
-
sql: t.ObjectCodec<{
|
|
5
|
-
args: t.ArrayCodec<t.Union<t.Codec<string | number, string | number, string, t.CodecProps>, t.IdentityCodec<t.CodecType.Boolean>>>;
|
|
6
|
-
query: t.IdentityCodec<t.CodecType.String>;
|
|
7
|
-
}>;
|
|
8
|
-
}>;
|
|
9
|
-
export type ExecuteSqlRequest = t.Encoded<typeof ExecuteSqlRequest>;
|
|
10
|
-
export declare const ExecuteSqlResponse: t.ObjectCodec<{
|
|
11
|
-
/** Set if success = false */
|
|
12
|
-
error: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
13
|
-
results: t.ObjectCodec<{
|
|
14
|
-
columns: t.ArrayCodec<t.IdentityCodec<t.CodecType.String>>;
|
|
15
|
-
rows: t.ArrayCodec<t.ArrayCodec<t.Union<t.Codec<string | number | boolean, string | number | boolean, string, t.CodecProps>, t.Codec<null, null, t.CodecType.Null, t.CodecProps>>>>;
|
|
16
|
-
}>;
|
|
17
|
-
success: t.IdentityCodec<t.CodecType.Boolean>;
|
|
18
|
-
}>;
|
|
19
|
-
export type ExecuteSqlResponse = t.Encoded<typeof ExecuteSqlResponse>;
|
|
20
|
-
export declare const DemoCredentialsRequest: t.ObjectCodec<{
|
|
21
|
-
connection_id: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
22
|
-
}>;
|
|
23
|
-
export type DemoCredentialsRequest = t.Encoded<typeof DemoCredentialsRequest>;
|
|
24
|
-
export declare const DemoCredentialsResponse: t.ObjectCodec<{
|
|
25
|
-
/** If this instance has a demo database, this contains the credentials. */
|
|
26
|
-
credentials: t.OptionalCodec<t.Codec<{
|
|
27
|
-
postgres_uri: string;
|
|
28
|
-
}, {
|
|
29
|
-
postgres_uri: string;
|
|
30
|
-
}, string, t.CodecProps>>;
|
|
31
|
-
}>;
|
|
32
|
-
export type DemoCredentialsResponse = t.Encoded<typeof DemoCredentialsResponse>;
|
|
33
|
-
export declare const DiagnosticsRequest: t.ObjectCodec<{
|
|
34
|
-
sync_rules_content: t.OptionalCodec<t.Codec<boolean, boolean, string, t.CodecProps>>;
|
|
35
|
-
}>;
|
|
36
|
-
export type DiagnosticsRequest = t.Encoded<typeof DiagnosticsRequest>;
|
|
37
|
-
export declare const DiagnosticsResponse: t.ObjectCodec<{
|
|
38
|
-
/**
|
|
39
|
-
* Present if there are fully-deployed sync rules.
|
|
40
|
-
*
|
|
41
|
-
* Sync-rule-level errors are listed here.
|
|
42
|
-
*/
|
|
43
|
-
active_sync_rules: t.OptionalCodec<t.Codec<{
|
|
44
|
-
connections: {
|
|
45
|
-
id: string;
|
|
46
|
-
tag: string;
|
|
47
|
-
initial_replication_done: boolean;
|
|
48
|
-
slot_name: string;
|
|
49
|
-
tables: {
|
|
50
|
-
name: string;
|
|
51
|
-
data_queries: boolean;
|
|
52
|
-
errors: {
|
|
53
|
-
message: string;
|
|
54
|
-
level: "warning" | "fatal";
|
|
55
|
-
}[];
|
|
56
|
-
parameter_queries: boolean;
|
|
57
|
-
replication_id: string[];
|
|
58
|
-
schema: string;
|
|
59
|
-
pattern?: string | undefined;
|
|
60
|
-
}[];
|
|
61
|
-
last_checkpoint_ts?: string | undefined;
|
|
62
|
-
last_keepalive_ts?: string | undefined;
|
|
63
|
-
last_lsn?: string | undefined;
|
|
64
|
-
replication_lag_bytes?: number | undefined;
|
|
65
|
-
}[];
|
|
66
|
-
errors: {
|
|
67
|
-
message: string;
|
|
68
|
-
level: "warning" | "fatal";
|
|
69
|
-
}[];
|
|
70
|
-
content?: string | undefined;
|
|
71
|
-
}, {
|
|
72
|
-
connections: {
|
|
73
|
-
id: string;
|
|
74
|
-
tag: string;
|
|
75
|
-
initial_replication_done: boolean;
|
|
76
|
-
slot_name: string;
|
|
77
|
-
tables: {
|
|
78
|
-
name: string;
|
|
79
|
-
data_queries: boolean;
|
|
80
|
-
errors: {
|
|
81
|
-
message: string;
|
|
82
|
-
level: "warning" | "fatal";
|
|
83
|
-
}[];
|
|
84
|
-
parameter_queries: boolean;
|
|
85
|
-
replication_id: string[];
|
|
86
|
-
schema: string;
|
|
87
|
-
pattern?: string | undefined;
|
|
88
|
-
}[];
|
|
89
|
-
last_checkpoint_ts?: string | undefined;
|
|
90
|
-
last_keepalive_ts?: string | undefined;
|
|
91
|
-
last_lsn?: string | undefined;
|
|
92
|
-
replication_lag_bytes?: number | undefined;
|
|
93
|
-
}[];
|
|
94
|
-
errors: {
|
|
95
|
-
message: string;
|
|
96
|
-
level: "warning" | "fatal";
|
|
97
|
-
}[];
|
|
98
|
-
content?: string | undefined;
|
|
99
|
-
}, string, t.CodecProps>>;
|
|
100
|
-
/**
|
|
101
|
-
* Connection-level errors are listed here.
|
|
102
|
-
*/
|
|
103
|
-
connections: t.ArrayCodec<t.ObjectCodec<{
|
|
104
|
-
connected: t.IdentityCodec<t.CodecType.Boolean>;
|
|
105
|
-
errors: t.ArrayCodec<t.ObjectCodec<{
|
|
106
|
-
level: t.Union<t.Codec<"warning", "warning", string, t.CodecProps>, t.LiteralCodec<"fatal">>;
|
|
107
|
-
message: t.IdentityCodec<t.CodecType.String>;
|
|
108
|
-
}>>;
|
|
109
|
-
id: t.IdentityCodec<t.CodecType.String>;
|
|
110
|
-
postgres_uri: t.IdentityCodec<t.CodecType.String>;
|
|
111
|
-
}>>;
|
|
112
|
-
/**
|
|
113
|
-
* Present if there are sync rules in the process of being deployed / initial replication.
|
|
114
|
-
*
|
|
115
|
-
* Once initial replication is done, this will be placed in `active_sync_rules`.
|
|
116
|
-
*
|
|
117
|
-
* Sync-rule-level errors are listed here.
|
|
118
|
-
*/
|
|
119
|
-
deploying_sync_rules: t.OptionalCodec<t.Codec<{
|
|
120
|
-
connections: {
|
|
121
|
-
id: string;
|
|
122
|
-
tag: string;
|
|
123
|
-
initial_replication_done: boolean;
|
|
124
|
-
slot_name: string;
|
|
125
|
-
tables: {
|
|
126
|
-
name: string;
|
|
127
|
-
data_queries: boolean;
|
|
128
|
-
errors: {
|
|
129
|
-
message: string;
|
|
130
|
-
level: "warning" | "fatal";
|
|
131
|
-
}[];
|
|
132
|
-
parameter_queries: boolean;
|
|
133
|
-
replication_id: string[];
|
|
134
|
-
schema: string;
|
|
135
|
-
pattern?: string | undefined;
|
|
136
|
-
}[];
|
|
137
|
-
last_checkpoint_ts?: string | undefined;
|
|
138
|
-
last_keepalive_ts?: string | undefined;
|
|
139
|
-
last_lsn?: string | undefined;
|
|
140
|
-
replication_lag_bytes?: number | undefined;
|
|
141
|
-
}[];
|
|
142
|
-
errors: {
|
|
143
|
-
message: string;
|
|
144
|
-
level: "warning" | "fatal";
|
|
145
|
-
}[];
|
|
146
|
-
content?: string | undefined;
|
|
147
|
-
}, {
|
|
148
|
-
connections: {
|
|
149
|
-
id: string;
|
|
150
|
-
tag: string;
|
|
151
|
-
initial_replication_done: boolean;
|
|
152
|
-
slot_name: string;
|
|
153
|
-
tables: {
|
|
154
|
-
name: string;
|
|
155
|
-
data_queries: boolean;
|
|
156
|
-
errors: {
|
|
157
|
-
message: string;
|
|
158
|
-
level: "warning" | "fatal";
|
|
159
|
-
}[];
|
|
160
|
-
parameter_queries: boolean;
|
|
161
|
-
replication_id: string[];
|
|
162
|
-
schema: string;
|
|
163
|
-
pattern?: string | undefined;
|
|
164
|
-
}[];
|
|
165
|
-
last_checkpoint_ts?: string | undefined;
|
|
166
|
-
last_keepalive_ts?: string | undefined;
|
|
167
|
-
last_lsn?: string | undefined;
|
|
168
|
-
replication_lag_bytes?: number | undefined;
|
|
169
|
-
}[];
|
|
170
|
-
errors: {
|
|
171
|
-
message: string;
|
|
172
|
-
level: "warning" | "fatal";
|
|
173
|
-
}[];
|
|
174
|
-
content?: string | undefined;
|
|
175
|
-
}, string, t.CodecProps>>;
|
|
176
|
-
}>;
|
|
177
|
-
export type DiagnosticsResponse = t.Encoded<typeof DiagnosticsResponse>;
|
|
178
|
-
export declare const GetSchemaRequest: t.ObjectCodec<{}>;
|
|
179
|
-
export type GetSchemaRequest = t.Encoded<typeof GetSchemaRequest>;
|
|
180
|
-
export declare const GetSchemaResponse: t.ObjectCodec<{
|
|
181
|
-
connections: t.ArrayCodec<t.ObjectCodec<{
|
|
182
|
-
id: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
183
|
-
schemas: t.ArrayCodec<t.ObjectCodec<{
|
|
184
|
-
name: t.IdentityCodec<t.CodecType.String>;
|
|
185
|
-
tables: t.ArrayCodec<t.ObjectCodec<{
|
|
186
|
-
columns: t.ArrayCodec<t.ObjectCodec<{
|
|
187
|
-
name: t.IdentityCodec<t.CodecType.String>;
|
|
188
|
-
pg_type: t.IdentityCodec<t.CodecType.String>;
|
|
189
|
-
type: t.IdentityCodec<t.CodecType.String>;
|
|
190
|
-
}>>;
|
|
191
|
-
name: t.IdentityCodec<t.CodecType.String>;
|
|
192
|
-
}>>;
|
|
193
|
-
}>>;
|
|
194
|
-
tag: t.IdentityCodec<t.CodecType.String>;
|
|
195
|
-
}>>;
|
|
196
|
-
}>;
|
|
197
|
-
export type GetSchemaResponse = t.Encoded<typeof GetSchemaResponse>;
|
|
198
|
-
export declare const ReprocessRequest: t.ObjectCodec<{}>;
|
|
199
|
-
export type ReprocessRequest = t.Encoded<typeof ReprocessRequest>;
|
|
200
|
-
export declare const ReprocessResponse: t.ObjectCodec<{
|
|
201
|
-
connections: t.ArrayCodec<t.ObjectCodec<{
|
|
202
|
-
id: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
203
|
-
slot_name: t.IdentityCodec<t.CodecType.String>;
|
|
204
|
-
tag: t.IdentityCodec<t.CodecType.String>;
|
|
205
|
-
}>>;
|
|
206
|
-
}>;
|
|
207
|
-
export type ReprocessResponse = t.Encoded<typeof ReprocessResponse>;
|
|
208
|
-
export declare const ValidateRequest: t.ObjectCodec<{
|
|
209
|
-
sync_rules: t.IdentityCodec<t.CodecType.String>;
|
|
210
|
-
}>;
|
|
211
|
-
export type ValidateRequest = t.Encoded<typeof ValidateRequest>;
|
|
212
|
-
export declare const ValidateResponse: t.ObjectCodec<{
|
|
213
|
-
connections: t.ArrayCodec<t.ObjectCodec<{
|
|
214
|
-
id: t.IdentityCodec<t.CodecType.String>;
|
|
215
|
-
initial_replication_done: t.IdentityCodec<t.CodecType.Boolean>;
|
|
216
|
-
last_checkpoint_ts: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
217
|
-
last_keepalive_ts: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>; /**
|
|
218
|
-
* Present if there are sync rules in the process of being deployed / initial replication.
|
|
219
|
-
*
|
|
220
|
-
* Once initial replication is done, this will be placed in `active_sync_rules`.
|
|
221
|
-
*
|
|
222
|
-
* Sync-rule-level errors are listed here.
|
|
223
|
-
*/
|
|
224
|
-
last_lsn: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
225
|
-
replication_lag_bytes: t.OptionalCodec<t.Codec<number, number, string, t.CodecProps>>;
|
|
226
|
-
slot_name: t.IdentityCodec<t.CodecType.String>;
|
|
227
|
-
tables: t.ArrayCodec<t.ObjectCodec<{
|
|
228
|
-
data_queries: t.IdentityCodec<t.CodecType.Boolean>;
|
|
229
|
-
errors: t.ArrayCodec<t.ObjectCodec<{
|
|
230
|
-
level: t.Union<t.Codec<"warning", "warning", string, t.CodecProps>, t.LiteralCodec<"fatal">>;
|
|
231
|
-
message: t.IdentityCodec<t.CodecType.String>;
|
|
232
|
-
}>>;
|
|
233
|
-
name: t.IdentityCodec<t.CodecType.String>;
|
|
234
|
-
parameter_queries: t.IdentityCodec<t.CodecType.Boolean>;
|
|
235
|
-
pattern: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
236
|
-
replication_id: t.ArrayCodec<t.IdentityCodec<t.CodecType.String>>;
|
|
237
|
-
schema: t.IdentityCodec<t.CodecType.String>;
|
|
238
|
-
}>>;
|
|
239
|
-
tag: t.IdentityCodec<t.CodecType.String>;
|
|
240
|
-
}>>;
|
|
241
|
-
content: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
242
|
-
errors: t.ArrayCodec<t.ObjectCodec<{
|
|
243
|
-
level: t.Union<t.Codec<"warning", "warning", string, t.CodecProps>, t.LiteralCodec<"fatal">>;
|
|
244
|
-
message: t.IdentityCodec<t.CodecType.String>;
|
|
245
|
-
}>>;
|
|
246
|
-
}>;
|
|
247
|
-
export type ValidateResponse = t.Encoded<typeof ValidateResponse>;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/* eslint-disable unicorn/filename-case */
|
|
2
|
-
/* eslint-disable camelcase */
|
|
3
|
-
// Routes for management service -> instance
|
|
4
|
-
import * as t from 'ts-codec';
|
|
5
|
-
import { ConnectionStatus, InstanceSchema, SyncRulesStatus } from './definitions.js';
|
|
6
|
-
export const ExecuteSqlRequest = t.object({
|
|
7
|
-
connection_id: t.string.optional(),
|
|
8
|
-
sql: t.object({
|
|
9
|
-
args: t.array(t.string.or(t.number).or(t.boolean)),
|
|
10
|
-
query: t.string
|
|
11
|
-
})
|
|
12
|
-
});
|
|
13
|
-
export const ExecuteSqlResponse = t.object({
|
|
14
|
-
/** Set if success = false */
|
|
15
|
-
error: t.string.optional(),
|
|
16
|
-
results: t.object({
|
|
17
|
-
columns: t.array(t.string),
|
|
18
|
-
rows: t.array(t.array(t.string.or(t.number).or(t.boolean).or(t.Null)))
|
|
19
|
-
}),
|
|
20
|
-
success: t.boolean
|
|
21
|
-
});
|
|
22
|
-
export const DemoCredentialsRequest = t.object({
|
|
23
|
-
connection_id: t.string.optional()
|
|
24
|
-
});
|
|
25
|
-
export const DemoCredentialsResponse = t.object({
|
|
26
|
-
/** If this instance has a demo database, this contains the credentials. */
|
|
27
|
-
credentials: t
|
|
28
|
-
.object({
|
|
29
|
-
postgres_uri: t.string
|
|
30
|
-
})
|
|
31
|
-
.optional()
|
|
32
|
-
});
|
|
33
|
-
export const DiagnosticsRequest = t.object({
|
|
34
|
-
sync_rules_content: t.boolean.optional()
|
|
35
|
-
});
|
|
36
|
-
export const DiagnosticsResponse = t.object({
|
|
37
|
-
/**
|
|
38
|
-
* Present if there are fully-deployed sync rules.
|
|
39
|
-
*
|
|
40
|
-
* Sync-rule-level errors are listed here.
|
|
41
|
-
*/
|
|
42
|
-
active_sync_rules: SyncRulesStatus.optional(),
|
|
43
|
-
/**
|
|
44
|
-
* Connection-level errors are listed here.
|
|
45
|
-
*/
|
|
46
|
-
connections: t.array(ConnectionStatus),
|
|
47
|
-
/**
|
|
48
|
-
* Present if there are sync rules in the process of being deployed / initial replication.
|
|
49
|
-
*
|
|
50
|
-
* Once initial replication is done, this will be placed in `active_sync_rules`.
|
|
51
|
-
*
|
|
52
|
-
* Sync-rule-level errors are listed here.
|
|
53
|
-
*/
|
|
54
|
-
deploying_sync_rules: SyncRulesStatus.optional()
|
|
55
|
-
});
|
|
56
|
-
export const GetSchemaRequest = t.object({});
|
|
57
|
-
export const GetSchemaResponse = InstanceSchema;
|
|
58
|
-
export const ReprocessRequest = t.object({});
|
|
59
|
-
export const ReprocessResponse = t.object({
|
|
60
|
-
connections: t.array(t.object({
|
|
61
|
-
id: t.string.optional(),
|
|
62
|
-
slot_name: t.string,
|
|
63
|
-
tag: t.string
|
|
64
|
-
}))
|
|
65
|
-
});
|
|
66
|
-
export const ValidateRequest = t.object({
|
|
67
|
-
sync_rules: t.string
|
|
68
|
-
});
|
|
69
|
-
export const ValidateResponse = SyncRulesStatus;
|