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.
Files changed (191) hide show
  1. package/README.md +14 -14
  2. package/dist/commands/init.d.ts +0 -1
  3. package/dist/commands/init.js +11 -8
  4. package/dist/commands/instance/sync-rules/generate-schema.js +6 -6
  5. package/dist/constants.d.ts +2 -5
  6. package/dist/constants.js +4 -2
  7. package/dist/service/accounts.client.js +11129 -25
  8. package/dist/service/powersync.client.js +37453 -113
  9. package/dist/service/types.js +1 -1
  10. package/dist/service/utils.js +6 -6
  11. package/dist/utils.js +5 -7
  12. package/oclif.manifest.json +1 -1
  13. package/package.json +28 -20
  14. package/dist/powersync-sdk/accounts/api.d.ts +0 -717
  15. package/dist/powersync-sdk/accounts/api.js +0 -182
  16. package/dist/powersync-sdk/accounts/client.d.ts +0 -1096
  17. package/dist/powersync-sdk/accounts/client.js +0 -124
  18. package/dist/powersync-sdk/accounts/codecs.d.ts +0 -32
  19. package/dist/powersync-sdk/accounts/codecs.js +0 -93
  20. package/dist/powersync-sdk/accounts/index.d.ts +0 -4
  21. package/dist/powersync-sdk/accounts/index.js +0 -4
  22. package/dist/powersync-sdk/accounts/models.d.ts +0 -260
  23. package/dist/powersync-sdk/accounts/models.js +0 -96
  24. package/dist/powersync-sdk/accounts/routes.d.ts +0 -44
  25. package/dist/powersync-sdk/accounts/routes.js +0 -45
  26. package/dist/powersync-sdk/accounts/source.d.ts +0 -76
  27. package/dist/powersync-sdk/accounts/source.js +0 -32
  28. package/dist/powersync-sdk/errors/errors.d.ts +0 -62
  29. package/dist/powersync-sdk/errors/errors.js +0 -115
  30. package/dist/powersync-sdk/errors/index.d.ts +0 -2
  31. package/dist/powersync-sdk/errors/index.js +0 -2
  32. package/dist/powersync-sdk/errors/utils.d.ts +0 -4
  33. package/dist/powersync-sdk/errors/utils.js +0 -18
  34. package/dist/powersync-sdk/fetch-clients/codecs.d.ts +0 -4
  35. package/dist/powersync-sdk/fetch-clients/codecs.js +0 -34
  36. package/dist/powersync-sdk/fetch-clients/decoders.d.ts +0 -3
  37. package/dist/powersync-sdk/fetch-clients/decoders.js +0 -35
  38. package/dist/powersync-sdk/fetch-clients/definitions.d.ts +0 -97
  39. package/dist/powersync-sdk/fetch-clients/definitions.js +0 -22
  40. package/dist/powersync-sdk/fetch-clients/errors.d.ts +0 -7
  41. package/dist/powersync-sdk/fetch-clients/errors.js +0 -19
  42. package/dist/powersync-sdk/fetch-clients/index.d.ts +0 -5
  43. package/dist/powersync-sdk/fetch-clients/index.js +0 -5
  44. package/dist/powersync-sdk/fetch-clients/node-client.d.ts +0 -9
  45. package/dist/powersync-sdk/fetch-clients/node-client.js +0 -107
  46. package/dist/powersync-sdk/fetch-clients/request.d.ts +0 -11
  47. package/dist/powersync-sdk/fetch-clients/request.js +0 -138
  48. package/dist/powersync-sdk/fetch-clients/streaming.d.ts +0 -65
  49. package/dist/powersync-sdk/fetch-clients/streaming.js +0 -99
  50. package/dist/powersync-sdk/fetch-clients/utils.d.ts +0 -13
  51. package/dist/powersync-sdk/fetch-clients/utils.js +0 -43
  52. package/dist/powersync-sdk/fetch-clients/web-client.d.ts +0 -14
  53. package/dist/powersync-sdk/fetch-clients/web-client.js +0 -56
  54. package/dist/powersync-sdk/json/index.d.ts +0 -4
  55. package/dist/powersync-sdk/json/index.js +0 -3
  56. package/dist/powersync-sdk/json/json.d.ts +0 -5
  57. package/dist/powersync-sdk/json/json.js +0 -35
  58. package/dist/powersync-sdk/json/json_container.d.ts +0 -18
  59. package/dist/powersync-sdk/json/json_container.js +0 -28
  60. package/dist/powersync-sdk/json/json_stringify.d.ts +0 -36
  61. package/dist/powersync-sdk/json/json_stringify.js +0 -162
  62. package/dist/powersync-sdk/powersync/client.d.ts +0 -449
  63. package/dist/powersync-sdk/powersync/client.js +0 -53
  64. package/dist/powersync-sdk/powersync/config/HostedConfig.d.ts +0 -327
  65. package/dist/powersync-sdk/powersync/config/HostedConfig.js +0 -92
  66. package/dist/powersync-sdk/powersync/config/PowerSyncConfig.d.ts +0 -211
  67. package/dist/powersync-sdk/powersync/config/PowerSyncConfig.js +0 -97
  68. package/dist/powersync-sdk/powersync/config/normalize.d.ts +0 -32
  69. package/dist/powersync-sdk/powersync/config/normalize.js +0 -85
  70. package/dist/powersync-sdk/powersync/definitions.d.ts +0 -149
  71. package/dist/powersync-sdk/powersync/definitions.js +0 -97
  72. package/dist/powersync-sdk/powersync/index.d.ts +0 -8
  73. package/dist/powersync-sdk/powersync/index.js +0 -8
  74. package/dist/powersync-sdk/powersync/internal_routes.d.ts +0 -247
  75. package/dist/powersync-sdk/powersync/internal_routes.js +0 -69
  76. package/dist/powersync-sdk/powersync/routes.d.ts +0 -779
  77. package/dist/powersync-sdk/powersync/routes.js +0 -191
  78. package/dist/powersync-sdk/sdk-clients/endpoints.d.ts +0 -31
  79. package/dist/powersync-sdk/sdk-clients/endpoints.js +0 -48
  80. package/dist/powersync-sdk/sdk-clients/index.d.ts +0 -3
  81. package/dist/powersync-sdk/sdk-clients/index.js +0 -3
  82. package/dist/powersync-sdk/sdk-clients/pagination.d.ts +0 -14
  83. package/dist/powersync-sdk/sdk-clients/pagination.js +0 -21
  84. package/dist/powersync-sdk/sdk-clients/sdk-client.d.ts +0 -17
  85. package/dist/powersync-sdk/sdk-clients/sdk-client.js +0 -30
  86. package/dist/powersync-sdk/streaming/bson/buffer-array.d.ts +0 -31
  87. package/dist/powersync-sdk/streaming/bson/buffer-array.js +0 -79
  88. package/dist/powersync-sdk/streaming/bson/constants.d.ts +0 -2
  89. package/dist/powersync-sdk/streaming/bson/constants.js +0 -1
  90. package/dist/powersync-sdk/streaming/bson/decoder.d.ts +0 -10
  91. package/dist/powersync-sdk/streaming/bson/decoder.js +0 -62
  92. package/dist/powersync-sdk/streaming/bson/encoder.d.ts +0 -10
  93. package/dist/powersync-sdk/streaming/bson/encoder.js +0 -23
  94. package/dist/powersync-sdk/streaming/bson/header.d.ts +0 -11
  95. package/dist/powersync-sdk/streaming/bson/header.js +0 -52
  96. package/dist/powersync-sdk/streaming/bson/index.d.ts +0 -5
  97. package/dist/powersync-sdk/streaming/bson/index.js +0 -5
  98. package/dist/powersync-sdk/streaming/core/backpressure.d.ts +0 -15
  99. package/dist/powersync-sdk/streaming/core/backpressure.js +0 -34
  100. package/dist/powersync-sdk/streaming/core/cross-stream.d.ts +0 -6
  101. package/dist/powersync-sdk/streaming/core/cross-stream.js +0 -17
  102. package/dist/powersync-sdk/streaming/core/index.d.ts +0 -4
  103. package/dist/powersync-sdk/streaming/core/index.js +0 -4
  104. package/dist/powersync-sdk/streaming/core/node-utils.d.ts +0 -7
  105. package/dist/powersync-sdk/streaming/core/node-utils.js +0 -11
  106. package/dist/powersync-sdk/streaming/core/transformers.d.ts +0 -41
  107. package/dist/powersync-sdk/streaming/core/transformers.js +0 -70
  108. package/dist/powersync-sdk/streaming/core/utils.d.ts +0 -36
  109. package/dist/powersync-sdk/streaming/core/utils.js +0 -66
  110. package/dist/powersync-sdk/streaming/index.d.ts +0 -3
  111. package/dist/powersync-sdk/streaming/index.js +0 -3
  112. package/dist/powersync-sdk/streaming/web.d.ts +0 -4
  113. package/dist/powersync-sdk/streaming/web.js +0 -4
  114. package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/binaryreader.d.ts +0 -2
  115. package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/binaryreader.js +0 -36
  116. package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/binarywriter.d.ts +0 -2
  117. package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/binarywriter.js +0 -58
  118. package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/geometry.d.ts +0 -18
  119. package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/geometry.js +0 -348
  120. package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/geometrycollection.d.ts +0 -11
  121. package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/geometrycollection.js +0 -118
  122. package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/linestring.d.ts +0 -11
  123. package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/linestring.js +0 -131
  124. package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/multilinestring.d.ts +0 -11
  125. package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/multilinestring.js +0 -134
  126. package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/multipoint.d.ts +0 -11
  127. package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/multipoint.js +0 -122
  128. package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/multipolygon.d.ts +0 -11
  129. package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/multipolygon.js +0 -158
  130. package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/point.d.ts +0 -14
  131. package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/point.js +0 -165
  132. package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/polygon.d.ts +0 -11
  133. package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/polygon.js +0 -207
  134. package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/types.d.ts +0 -30
  135. package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/types.js +0 -29
  136. package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/wktparser.d.ts +0 -2
  137. package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/wktparser.js +0 -111
  138. package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/wkx.d.ts +0 -9
  139. package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/wkx.js +0 -9
  140. package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/zigzag.d.ts +0 -5
  141. package/dist/powersync-sdk/sync-rules/@syncpoint/wkx/zigzag.js +0 -9
  142. package/dist/powersync-sdk/sync-rules/DartSchemaGenerator.d.ts +0 -12
  143. package/dist/powersync-sdk/sync-rules/DartSchemaGenerator.js +0 -35
  144. package/dist/powersync-sdk/sync-rules/ExpressionType.d.ts +0 -33
  145. package/dist/powersync-sdk/sync-rules/ExpressionType.js +0 -62
  146. package/dist/powersync-sdk/sync-rules/IdSequence.d.ts +0 -4
  147. package/dist/powersync-sdk/sync-rules/IdSequence.js +0 -7
  148. package/dist/powersync-sdk/sync-rules/JsSchemaGenerator.d.ts +0 -12
  149. package/dist/powersync-sdk/sync-rules/JsSchemaGenerator.js +0 -38
  150. package/dist/powersync-sdk/sync-rules/SchemaGenerator.d.ts +0 -14
  151. package/dist/powersync-sdk/sync-rules/SchemaGenerator.js +0 -24
  152. package/dist/powersync-sdk/sync-rules/SourceTableInterface.d.ts +0 -5
  153. package/dist/powersync-sdk/sync-rules/SourceTableInterface.js +0 -1
  154. package/dist/powersync-sdk/sync-rules/SqlBucketDescriptor.d.ts +0 -37
  155. package/dist/powersync-sdk/sync-rules/SqlBucketDescriptor.js +0 -116
  156. package/dist/powersync-sdk/sync-rules/SqlDataQuery.d.ts +0 -39
  157. package/dist/powersync-sdk/sync-rules/SqlDataQuery.js +0 -245
  158. package/dist/powersync-sdk/sync-rules/SqlParameterQuery.d.ts +0 -43
  159. package/dist/powersync-sdk/sync-rules/SqlParameterQuery.js +0 -254
  160. package/dist/powersync-sdk/sync-rules/SqlSyncRules.d.ts +0 -52
  161. package/dist/powersync-sdk/sync-rules/SqlSyncRules.js +0 -252
  162. package/dist/powersync-sdk/sync-rules/StaticSchema.d.ts +0 -26
  163. package/dist/powersync-sdk/sync-rules/StaticSchema.js +0 -71
  164. package/dist/powersync-sdk/sync-rules/StaticSqlParameterQuery.d.ts +0 -24
  165. package/dist/powersync-sdk/sync-rules/StaticSqlParameterQuery.js +0 -71
  166. package/dist/powersync-sdk/sync-rules/TablePattern.d.ts +0 -17
  167. package/dist/powersync-sdk/sync-rules/TablePattern.js +0 -56
  168. package/dist/powersync-sdk/sync-rules/TableQuerySchema.d.ts +0 -9
  169. package/dist/powersync-sdk/sync-rules/TableQuerySchema.js +0 -41
  170. package/dist/powersync-sdk/sync-rules/errors.d.ts +0 -22
  171. package/dist/powersync-sdk/sync-rules/errors.js +0 -60
  172. package/dist/powersync-sdk/sync-rules/generators.d.ts +0 -6
  173. package/dist/powersync-sdk/sync-rules/generators.js +0 -6
  174. package/dist/powersync-sdk/sync-rules/index.d.ts +0 -17
  175. package/dist/powersync-sdk/sync-rules/index.js +0 -17
  176. package/dist/powersync-sdk/sync-rules/json_schema.d.ts +0 -3
  177. package/dist/powersync-sdk/sync-rules/json_schema.js +0 -50
  178. package/dist/powersync-sdk/sync-rules/sql_filters.d.ts +0 -91
  179. package/dist/powersync-sdk/sync-rules/sql_filters.js +0 -491
  180. package/dist/powersync-sdk/sync-rules/sql_functions.d.ts +0 -53
  181. package/dist/powersync-sdk/sync-rules/sql_functions.js +0 -755
  182. package/dist/powersync-sdk/sync-rules/sql_support.d.ts +0 -22
  183. package/dist/powersync-sdk/sync-rules/sql_support.js +0 -208
  184. package/dist/powersync-sdk/sync-rules/types.d.ts +0 -174
  185. package/dist/powersync-sdk/sync-rules/types.js +0 -9
  186. package/dist/powersync-sdk/sync-rules/utils.d.ts +0 -45
  187. package/dist/powersync-sdk/sync-rules/utils.js +0 -163
  188. package/dist/service/accounts.client.d.ts +0 -26
  189. package/dist/service/powersync.client.d.ts +0 -269
  190. package/dist/service/types.d.ts +0 -69
  191. 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;