@powersync/management-types 0.0.0-dev.ccbd04ad → 0.0.0-dev.ec9d802b

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.
@@ -165,97 +165,73 @@ export declare const AnyHostedConnection: t.Union<t.Codec<({
165
165
  hostname: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
166
166
  port: t.OptionalCodec<t.Codec<number, number, string, t.CodecProps>>;
167
167
  schema: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
168
- authentication: t.OptionalCodec<t.Codec<({
168
+ authentication: t.OptionalCodec<t.Codec<{
169
169
  type: "default";
170
- options: {
171
- password: string;
172
- userName: string;
173
- };
174
- } & {
175
170
  options: {
176
171
  password: {
177
172
  secret: string;
178
173
  } | {
179
174
  secret_ref: string;
180
175
  };
181
- };
182
- }) | ({
183
- type: "azure-active-directory-password";
184
- options: {
185
- password: string;
186
176
  userName: string;
187
- clientId: string;
188
- tenantId: string;
189
177
  };
190
- } & {
178
+ } | {
179
+ type: "azure-active-directory-password";
191
180
  options: {
192
181
  password: {
193
182
  secret: string;
194
183
  } | {
195
184
  secret_ref: string;
196
185
  };
186
+ userName: string;
187
+ clientId: string;
188
+ tenantId: string;
197
189
  };
198
- }) | ({
190
+ } | {
199
191
  type: "azure-active-directory-service-principal-secret";
200
192
  options: {
201
193
  clientId: string;
202
194
  tenantId: string;
203
- clientSecret: string;
204
- };
205
- } & {
206
- options: {
207
195
  clientSecret: {
208
196
  secret: string;
209
197
  } | {
210
198
  secret_ref: string;
211
199
  };
212
200
  };
213
- }), ({
201
+ }, {
214
202
  type: "default";
215
- options: {
216
- password: string;
217
- userName: string;
218
- };
219
- } & {
220
203
  options: {
221
204
  password: {
222
205
  secret: string;
223
206
  } | {
224
207
  secret_ref: string;
225
208
  };
226
- };
227
- }) | ({
228
- type: "azure-active-directory-password";
229
- options: {
230
- password: string;
231
209
  userName: string;
232
- clientId: string;
233
- tenantId: string;
234
210
  };
235
- } & {
211
+ } | {
212
+ type: "azure-active-directory-password";
236
213
  options: {
237
214
  password: {
238
215
  secret: string;
239
216
  } | {
240
217
  secret_ref: string;
241
218
  };
219
+ userName: string;
220
+ clientId: string;
221
+ tenantId: string;
242
222
  };
243
- }) | ({
223
+ } | {
244
224
  type: "azure-active-directory-service-principal-secret";
245
225
  options: {
246
226
  clientId: string;
247
227
  tenantId: string;
248
- clientSecret: string;
249
- };
250
- } & {
251
- options: {
252
228
  clientSecret: {
253
229
  secret: string;
254
230
  } | {
255
231
  secret_ref: string;
256
232
  };
257
233
  };
258
- }), string, t.CodecProps>>;
234
+ }, string, t.CodecProps>>;
259
235
  additionalConfig: t.OptionalCodec<t.Codec<{
260
236
  pollingIntervalMs?: number | undefined;
261
237
  pollingBatchSize?: number | undefined;
@@ -610,52 +586,40 @@ declare const ReplicationConfig: t.ObjectCodec<{
610
586
  hostname?: string | undefined;
611
587
  port?: number | undefined;
612
588
  schema?: string | undefined;
613
- authentication?: ({
589
+ authentication?: {
614
590
  type: "default";
615
- options: {
616
- password: string;
617
- userName: string;
618
- };
619
- } & {
620
591
  options: {
621
592
  password: {
622
593
  secret: string;
623
594
  } | {
624
595
  secret_ref: string;
625
596
  };
626
- };
627
- }) | ({
628
- type: "azure-active-directory-password";
629
- options: {
630
- password: string;
631
597
  userName: string;
632
- clientId: string;
633
- tenantId: string;
634
598
  };
635
- } & {
599
+ } | {
600
+ type: "azure-active-directory-password";
636
601
  options: {
637
602
  password: {
638
603
  secret: string;
639
604
  } | {
640
605
  secret_ref: string;
641
606
  };
607
+ userName: string;
608
+ clientId: string;
609
+ tenantId: string;
642
610
  };
643
- }) | ({
611
+ } | {
644
612
  type: "azure-active-directory-service-principal-secret";
645
613
  options: {
646
614
  clientId: string;
647
615
  tenantId: string;
648
- clientSecret: string;
649
- };
650
- } & {
651
- options: {
652
616
  clientSecret: {
653
617
  secret: string;
654
618
  } | {
655
619
  secret_ref: string;
656
620
  };
657
621
  };
658
- }) | undefined;
622
+ } | undefined;
659
623
  additionalConfig?: {
660
624
  pollingIntervalMs?: number | undefined;
661
625
  pollingBatchSize?: number | undefined;
@@ -748,52 +712,40 @@ declare const ReplicationConfig: t.ObjectCodec<{
748
712
  hostname?: string | undefined;
749
713
  port?: number | undefined;
750
714
  schema?: string | undefined;
751
- authentication?: ({
715
+ authentication?: {
752
716
  type: "default";
753
- options: {
754
- password: string;
755
- userName: string;
756
- };
757
- } & {
758
717
  options: {
759
718
  password: {
760
719
  secret: string;
761
720
  } | {
762
721
  secret_ref: string;
763
722
  };
764
- };
765
- }) | ({
766
- type: "azure-active-directory-password";
767
- options: {
768
- password: string;
769
723
  userName: string;
770
- clientId: string;
771
- tenantId: string;
772
724
  };
773
- } & {
725
+ } | {
726
+ type: "azure-active-directory-password";
774
727
  options: {
775
728
  password: {
776
729
  secret: string;
777
730
  } | {
778
731
  secret_ref: string;
779
732
  };
733
+ userName: string;
734
+ clientId: string;
735
+ tenantId: string;
780
736
  };
781
- }) | ({
737
+ } | {
782
738
  type: "azure-active-directory-service-principal-secret";
783
739
  options: {
784
740
  clientId: string;
785
741
  tenantId: string;
786
- clientSecret: string;
787
- };
788
- } & {
789
- options: {
790
742
  clientSecret: {
791
743
  secret: string;
792
744
  } | {
793
745
  secret_ref: string;
794
746
  };
795
747
  };
796
- }) | undefined;
748
+ } | undefined;
797
749
  additionalConfig?: {
798
750
  pollingIntervalMs?: number | undefined;
799
751
  pollingBatchSize?: number | undefined;
@@ -977,52 +929,40 @@ export declare const BasePowerSyncHostedConfig: t.ObjectCodec<{
977
929
  hostname?: string | undefined;
978
930
  port?: number | undefined;
979
931
  schema?: string | undefined;
980
- authentication?: ({
932
+ authentication?: {
981
933
  type: "default";
982
- options: {
983
- password: string;
984
- userName: string;
985
- };
986
- } & {
987
934
  options: {
988
935
  password: {
989
936
  secret: string;
990
937
  } | {
991
938
  secret_ref: string;
992
939
  };
993
- };
994
- }) | ({
995
- type: "azure-active-directory-password";
996
- options: {
997
- password: string;
998
940
  userName: string;
999
- clientId: string;
1000
- tenantId: string;
1001
941
  };
1002
- } & {
942
+ } | {
943
+ type: "azure-active-directory-password";
1003
944
  options: {
1004
945
  password: {
1005
946
  secret: string;
1006
947
  } | {
1007
948
  secret_ref: string;
1008
949
  };
950
+ userName: string;
951
+ clientId: string;
952
+ tenantId: string;
1009
953
  };
1010
- }) | ({
954
+ } | {
1011
955
  type: "azure-active-directory-service-principal-secret";
1012
956
  options: {
1013
957
  clientId: string;
1014
958
  tenantId: string;
1015
- clientSecret: string;
1016
- };
1017
- } & {
1018
- options: {
1019
959
  clientSecret: {
1020
960
  secret: string;
1021
961
  } | {
1022
962
  secret_ref: string;
1023
963
  };
1024
964
  };
1025
- }) | undefined;
965
+ } | undefined;
1026
966
  additionalConfig?: {
1027
967
  pollingIntervalMs?: number | undefined;
1028
968
  pollingBatchSize?: number | undefined;
@@ -1117,52 +1057,40 @@ export declare const BasePowerSyncHostedConfig: t.ObjectCodec<{
1117
1057
  hostname?: string | undefined;
1118
1058
  port?: number | undefined;
1119
1059
  schema?: string | undefined;
1120
- authentication?: ({
1060
+ authentication?: {
1121
1061
  type: "default";
1122
- options: {
1123
- password: string;
1124
- userName: string;
1125
- };
1126
- } & {
1127
1062
  options: {
1128
1063
  password: {
1129
1064
  secret: string;
1130
1065
  } | {
1131
1066
  secret_ref: string;
1132
1067
  };
1133
- };
1134
- }) | ({
1135
- type: "azure-active-directory-password";
1136
- options: {
1137
- password: string;
1138
1068
  userName: string;
1139
- clientId: string;
1140
- tenantId: string;
1141
1069
  };
1142
- } & {
1070
+ } | {
1071
+ type: "azure-active-directory-password";
1143
1072
  options: {
1144
1073
  password: {
1145
1074
  secret: string;
1146
1075
  } | {
1147
1076
  secret_ref: string;
1148
1077
  };
1078
+ userName: string;
1079
+ clientId: string;
1080
+ tenantId: string;
1149
1081
  };
1150
- }) | ({
1082
+ } | {
1151
1083
  type: "azure-active-directory-service-principal-secret";
1152
1084
  options: {
1153
1085
  clientId: string;
1154
1086
  tenantId: string;
1155
- clientSecret: string;
1156
- };
1157
- } & {
1158
- options: {
1159
1087
  clientSecret: {
1160
1088
  secret: string;
1161
1089
  } | {
1162
1090
  secret_ref: string;
1163
1091
  };
1164
1092
  };
1165
- }) | undefined;
1093
+ } | undefined;
1166
1094
  additionalConfig?: {
1167
1095
  pollingIntervalMs?: number | undefined;
1168
1096
  pollingBatchSize?: number | undefined;
@@ -1,19 +1,12 @@
1
1
  import * as t from 'ts-codec';
2
2
  import { ConnectionType } from './ConnectionType.js';
3
- export declare const DefaultAuthenticationHosted: t.Intersection<t.Codec<{
4
- type: "default";
5
- options: {
6
- password: string;
7
- userName: string;
8
- };
9
- }, {
10
- type: "default";
11
- options: {
12
- password: string;
13
- userName: string;
14
- };
15
- }, string, t.CodecProps>, t.ObjectCodec<{
3
+ export declare const DefaultAuthenticationHosted: t.ObjectCodec<{
4
+ type: t.LiteralCodec<"default">;
16
5
  options: t.ObjectCodec<{
6
+ /**
7
+ * User name to use for sql server login.
8
+ */
9
+ userName: t.IdentityCodec<t.CodecType.String>;
17
10
  password: t.Union<t.Codec<{
18
11
  secret_ref: string;
19
12
  }, {
@@ -22,26 +15,18 @@ export declare const DefaultAuthenticationHosted: t.Intersection<t.Codec<{
22
15
  secret: t.IdentityCodec<t.CodecType.String>;
23
16
  }>>;
24
17
  }>;
25
- }>>;
18
+ }>;
26
19
  export type DefaultAuthenticationHosted = t.Encoded<typeof DefaultAuthenticationHosted>;
27
- export declare const AzureActiveDirectoryPasswordAuthenticationHosted: t.Intersection<t.Codec<{
28
- type: "azure-active-directory-password";
29
- options: {
30
- password: string;
31
- userName: string;
32
- clientId: string;
33
- tenantId: string;
34
- };
35
- }, {
36
- type: "azure-active-directory-password";
37
- options: {
38
- password: string;
39
- userName: string;
40
- clientId: string;
41
- tenantId: string;
42
- };
43
- }, string, t.CodecProps>, t.ObjectCodec<{
20
+ export declare const AzureActiveDirectoryPasswordAuthenticationHosted: t.ObjectCodec<{
21
+ type: t.LiteralCodec<"azure-active-directory-password">;
44
22
  options: t.ObjectCodec<{
23
+ /**
24
+ * A user need to provide `userName` associate to their account.
25
+ */
26
+ userName: t.IdentityCodec<t.CodecType.String>;
27
+ /**
28
+ * A user need to provide `password` associate to their account.
29
+ */
45
30
  password: t.Union<t.Codec<{
46
31
  secret_ref: string;
47
32
  }, {
@@ -49,25 +34,27 @@ export declare const AzureActiveDirectoryPasswordAuthenticationHosted: t.Interse
49
34
  }, string, t.CodecProps>, t.ObjectCodec<{
50
35
  secret: t.IdentityCodec<t.CodecType.String>;
51
36
  }>>;
37
+ /**
38
+ * A client id to use.
39
+ */
40
+ clientId: t.IdentityCodec<t.CodecType.String>;
41
+ /**
42
+ * Azure tenant ID
43
+ */
44
+ tenantId: t.IdentityCodec<t.CodecType.String>;
52
45
  }>;
53
- }>>;
46
+ }>;
54
47
  export type AzureActiveDirectoryPasswordAuthenticationHosted = t.Encoded<typeof AzureActiveDirectoryPasswordAuthenticationHosted>;
55
- export declare const AzureActiveDirectoryServicePrincipalSecretHosted: t.Intersection<t.Codec<{
56
- type: "azure-active-directory-service-principal-secret";
57
- options: {
58
- clientId: string;
59
- tenantId: string;
60
- clientSecret: string;
61
- };
62
- }, {
63
- type: "azure-active-directory-service-principal-secret";
64
- options: {
65
- clientId: string;
66
- tenantId: string;
67
- clientSecret: string;
68
- };
69
- }, string, t.CodecProps>, t.ObjectCodec<{
48
+ export declare const AzureActiveDirectoryServicePrincipalSecretHosted: t.ObjectCodec<{
49
+ type: t.LiteralCodec<"azure-active-directory-service-principal-secret">;
70
50
  options: t.ObjectCodec<{
51
+ /**
52
+ * Application (`client`) ID from your registered Azure application
53
+ */
54
+ clientId: t.IdentityCodec<t.CodecType.String>;
55
+ /**
56
+ * The created `client secret` for this registered Azure application
57
+ */
71
58
  clientSecret: t.Union<t.Codec<{
72
59
  secret_ref: string;
73
60
  }, {
@@ -75,85 +62,67 @@ export declare const AzureActiveDirectoryServicePrincipalSecretHosted: t.Interse
75
62
  }, string, t.CodecProps>, t.ObjectCodec<{
76
63
  secret: t.IdentityCodec<t.CodecType.String>;
77
64
  }>>;
65
+ /**
66
+ * Directory (`tenant`) ID from your registered Azure application
67
+ */
68
+ tenantId: t.IdentityCodec<t.CodecType.String>;
78
69
  }>;
79
- }>>;
70
+ }>;
80
71
  export type AzureActiveDirectoryServicePrincipalSecretHosted = t.Encoded<typeof AzureActiveDirectoryServicePrincipalSecretHosted>;
81
- export declare const AuthenticationHosted: t.Union<t.Codec<({
72
+ export declare const AuthenticationHosted: t.Union<t.Codec<{
82
73
  type: "default";
83
- options: {
84
- password: string;
85
- userName: string;
86
- };
87
- } & {
88
74
  options: {
89
75
  password: {
90
76
  secret: string;
91
77
  } | {
92
78
  secret_ref: string;
93
79
  };
94
- };
95
- }) | ({
96
- type: "azure-active-directory-password";
97
- options: {
98
- password: string;
99
80
  userName: string;
100
- clientId: string;
101
- tenantId: string;
102
81
  };
103
- } & {
82
+ } | {
83
+ type: "azure-active-directory-password";
104
84
  options: {
105
85
  password: {
106
86
  secret: string;
107
87
  } | {
108
88
  secret_ref: string;
109
89
  };
110
- };
111
- }), ({
112
- type: "default";
113
- options: {
114
- password: string;
115
90
  userName: string;
91
+ clientId: string;
92
+ tenantId: string;
116
93
  };
117
- } & {
94
+ }, {
95
+ type: "default";
118
96
  options: {
119
97
  password: {
120
98
  secret: string;
121
99
  } | {
122
100
  secret_ref: string;
123
101
  };
124
- };
125
- }) | ({
126
- type: "azure-active-directory-password";
127
- options: {
128
- password: string;
129
102
  userName: string;
130
- clientId: string;
131
- tenantId: string;
132
103
  };
133
- } & {
104
+ } | {
105
+ type: "azure-active-directory-password";
134
106
  options: {
135
107
  password: {
136
108
  secret: string;
137
109
  } | {
138
110
  secret_ref: string;
139
111
  };
140
- };
141
- }), string, t.CodecProps>, t.Intersection<t.Codec<{
142
- type: "azure-active-directory-service-principal-secret";
143
- options: {
144
- clientId: string;
145
- tenantId: string;
146
- clientSecret: string;
147
- };
148
- }, {
149
- type: "azure-active-directory-service-principal-secret";
150
- options: {
112
+ userName: string;
151
113
  clientId: string;
152
114
  tenantId: string;
153
- clientSecret: string;
154
115
  };
155
116
  }, string, t.CodecProps>, t.ObjectCodec<{
117
+ type: t.LiteralCodec<"azure-active-directory-service-principal-secret">;
156
118
  options: t.ObjectCodec<{
119
+ /**
120
+ * Application (`client`) ID from your registered Azure application
121
+ */
122
+ clientId: t.IdentityCodec<t.CodecType.String>;
123
+ /**
124
+ * The created `client secret` for this registered Azure application
125
+ */
157
126
  clientSecret: t.Union<t.Codec<{
158
127
  secret_ref: string;
159
128
  }, {
@@ -161,9 +130,28 @@ export declare const AuthenticationHosted: t.Union<t.Codec<({
161
130
  }, string, t.CodecProps>, t.ObjectCodec<{
162
131
  secret: t.IdentityCodec<t.CodecType.String>;
163
132
  }>>;
133
+ /**
134
+ * Directory (`tenant`) ID from your registered Azure application
135
+ */
136
+ tenantId: t.IdentityCodec<t.CodecType.String>;
164
137
  }>;
165
- }>>>;
138
+ }>>;
166
139
  export type AuthenticationHosted = t.Encoded<typeof AuthenticationHosted>;
140
+ export declare const AdditionalConfig: t.ObjectCodec<{
141
+ /**
142
+ * Interval in milliseconds to wait between polling cycles. Defaults to 1000 milliseconds.
143
+ */
144
+ pollingIntervalMs: t.OptionalCodec<t.Codec<number, number, string, t.CodecProps>>;
145
+ /**
146
+ * Maximum number of transactions to poll per polling cycle. Defaults to 10.
147
+ */
148
+ pollingBatchSize: t.OptionalCodec<t.Codec<number, number, string, t.CodecProps>>;
149
+ /**
150
+ * Whether to trust the server certificate. Set to true for local development and self-signed certificates.
151
+ * Default is false.
152
+ */
153
+ trustServerCertificate: t.OptionalCodec<t.Codec<boolean, boolean, string, t.CodecProps>>;
154
+ }>;
167
155
  export declare const HostedMSSQLConnection: t.Intersection<t.Codec<{
168
156
  type: ConnectionType;
169
157
  name?: string | undefined;
@@ -198,97 +186,73 @@ export declare const HostedMSSQLConnection: t.Intersection<t.Codec<{
198
186
  * Authentication method to use when connecting to the database.
199
187
  * When not specified, 'default' username & password authentication is used.
200
188
  */
201
- authentication: t.OptionalCodec<t.Codec<({
189
+ authentication: t.OptionalCodec<t.Codec<{
202
190
  type: "default";
203
- options: {
204
- password: string;
205
- userName: string;
206
- };
207
- } & {
208
191
  options: {
209
192
  password: {
210
193
  secret: string;
211
194
  } | {
212
195
  secret_ref: string;
213
196
  };
214
- };
215
- }) | ({
216
- type: "azure-active-directory-password";
217
- options: {
218
- password: string;
219
197
  userName: string;
220
- clientId: string;
221
- tenantId: string;
222
198
  };
223
- } & {
199
+ } | {
200
+ type: "azure-active-directory-password";
224
201
  options: {
225
202
  password: {
226
203
  secret: string;
227
204
  } | {
228
205
  secret_ref: string;
229
206
  };
207
+ userName: string;
208
+ clientId: string;
209
+ tenantId: string;
230
210
  };
231
- }) | ({
211
+ } | {
232
212
  type: "azure-active-directory-service-principal-secret";
233
213
  options: {
234
214
  clientId: string;
235
215
  tenantId: string;
236
- clientSecret: string;
237
- };
238
- } & {
239
- options: {
240
216
  clientSecret: {
241
217
  secret: string;
242
218
  } | {
243
219
  secret_ref: string;
244
220
  };
245
221
  };
246
- }), ({
222
+ }, {
247
223
  type: "default";
248
- options: {
249
- password: string;
250
- userName: string;
251
- };
252
- } & {
253
224
  options: {
254
225
  password: {
255
226
  secret: string;
256
227
  } | {
257
228
  secret_ref: string;
258
229
  };
259
- };
260
- }) | ({
261
- type: "azure-active-directory-password";
262
- options: {
263
- password: string;
264
230
  userName: string;
265
- clientId: string;
266
- tenantId: string;
267
231
  };
268
- } & {
232
+ } | {
233
+ type: "azure-active-directory-password";
269
234
  options: {
270
235
  password: {
271
236
  secret: string;
272
237
  } | {
273
238
  secret_ref: string;
274
239
  };
240
+ userName: string;
241
+ clientId: string;
242
+ tenantId: string;
275
243
  };
276
- }) | ({
244
+ } | {
277
245
  type: "azure-active-directory-service-principal-secret";
278
246
  options: {
279
247
  clientId: string;
280
248
  tenantId: string;
281
- clientSecret: string;
282
- };
283
- } & {
284
- options: {
285
249
  clientSecret: {
286
250
  secret: string;
287
251
  } | {
288
252
  secret_ref: string;
289
253
  };
290
254
  };
291
- }), string, t.CodecProps>>;
255
+ }, string, t.CodecProps>>;
292
256
  /**
293
257
  * Additional configuration options for tweaking replicator and connection behavior.
294
258
  */
@@ -1,25 +1,71 @@
1
- import * as mssql_types from '@powersync/service-module-mssql/types';
2
1
  import * as t from 'ts-codec';
3
2
  import { HostedSecret } from '../HostedSecret.js';
4
3
  import { ConnectionType } from './ConnectionType.js';
5
4
  import { DataSourceConfig } from './HostedDatabaseSourceConfig.js';
6
- // Replace confidential fields with HostedSecret
7
- export const DefaultAuthenticationHosted = mssql_types.DefaultAuthentication.and(t.object({
5
+ export const DefaultAuthenticationHosted = t.object({
6
+ type: t.literal('default'),
8
7
  options: t.object({
8
+ /**
9
+ * User name to use for sql server login.
10
+ */
11
+ userName: t.string,
9
12
  password: HostedSecret
10
13
  })
11
- }));
12
- export const AzureActiveDirectoryPasswordAuthenticationHosted = mssql_types.AzureActiveDirectoryPasswordAuthentication.and(t.object({
14
+ });
15
+ export const AzureActiveDirectoryPasswordAuthenticationHosted = t.object({
16
+ type: t.literal('azure-active-directory-password'),
13
17
  options: t.object({
14
- password: HostedSecret
18
+ /**
19
+ * A user need to provide `userName` associate to their account.
20
+ */
21
+ userName: t.string,
22
+ /**
23
+ * A user need to provide `password` associate to their account.
24
+ */
25
+ password: HostedSecret,
26
+ /**
27
+ * A client id to use.
28
+ */
29
+ clientId: t.string,
30
+ /**
31
+ * Azure tenant ID
32
+ */
33
+ tenantId: t.string
15
34
  })
16
- }));
17
- export const AzureActiveDirectoryServicePrincipalSecretHosted = mssql_types.AzureActiveDirectoryServicePrincipalSecret.and(t.object({
35
+ });
36
+ export const AzureActiveDirectoryServicePrincipalSecretHosted = t.object({
37
+ type: t.literal('azure-active-directory-service-principal-secret'),
18
38
  options: t.object({
19
- clientSecret: HostedSecret
39
+ /**
40
+ * Application (`client`) ID from your registered Azure application
41
+ */
42
+ clientId: t.string,
43
+ /**
44
+ * The created `client secret` for this registered Azure application
45
+ */
46
+ clientSecret: HostedSecret,
47
+ /**
48
+ * Directory (`tenant`) ID from your registered Azure application
49
+ */
50
+ tenantId: t.string
20
51
  })
21
- }));
52
+ });
22
53
  export const AuthenticationHosted = DefaultAuthenticationHosted.or(AzureActiveDirectoryPasswordAuthenticationHosted).or(AzureActiveDirectoryServicePrincipalSecretHosted);
54
+ export const AdditionalConfig = t.object({
55
+ /**
56
+ * Interval in milliseconds to wait between polling cycles. Defaults to 1000 milliseconds.
57
+ */
58
+ pollingIntervalMs: t.number.optional(),
59
+ /**
60
+ * Maximum number of transactions to poll per polling cycle. Defaults to 10.
61
+ */
62
+ pollingBatchSize: t.number.optional(),
63
+ /**
64
+ * Whether to trust the server certificate. Set to true for local development and self-signed certificates.
65
+ * Default is false.
66
+ */
67
+ trustServerCertificate: t.boolean.optional()
68
+ });
23
69
  export const HostedMSSQLConnection = DataSourceConfig.and(t.object({
24
70
  type: t.literal(ConnectionType.MSSQL),
25
71
  uri: t.string.optional(),
@@ -34,7 +80,7 @@ export const HostedMSSQLConnection = DataSourceConfig.and(t.object({
34
80
  /**
35
81
  * Additional configuration options for tweaking replicator and connection behavior.
36
82
  */
37
- additionalConfig: mssql_types.AdditionalConfig.optional(),
83
+ additionalConfig: AdditionalConfig.optional(),
38
84
  /** Expose execute-sql */
39
85
  debug_api: t.boolean.optional()
40
86
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"HostedMSSQLConnection.js","sourceRoot":"","sources":["../../../src/config/connections/HostedMSSQLConnection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,uCAAuC,CAAC;AACrE,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;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string, string, t.CodecProps>>;
181
181
  port: t.OptionalCodec<t.Codec<number, number, string, t.CodecProps>>;
182
182
  schema: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
183
- authentication: t.OptionalCodec<t.Codec<({
183
+ authentication: t.OptionalCodec<t.Codec<{
184
184
  type: "default";
185
- options: {
186
- password: string;
187
- userName: string;
188
- };
189
- } & {
190
185
  options: {
191
186
  password: {
192
187
  secret: string;
193
188
  } | {
194
189
  secret_ref: string;
195
190
  };
196
- };
197
- }) | ({
198
- type: "azure-active-directory-password";
199
- options: {
200
- password: string;
201
191
  userName: string;
202
- clientId: string;
203
- tenantId: string;
204
192
  };
205
- } & {
193
+ } | {
194
+ type: "azure-active-directory-password";
206
195
  options: {
207
196
  password: {
208
197
  secret: string;
209
198
  } | {
210
199
  secret_ref: string;
211
200
  };
201
+ userName: string;
202
+ clientId: string;
203
+ tenantId: string;
212
204
  };
213
- }) | ({
205
+ } | {
214
206
  type: "azure-active-directory-service-principal-secret";
215
207
  options: {
216
208
  clientId: string;
217
209
  tenantId: string;
218
- clientSecret: string;
219
- };
220
- } & {
221
- options: {
222
210
  clientSecret: {
223
211
  secret: string;
224
212
  } | {
225
213
  secret_ref: string;
226
214
  };
227
215
  };
228
- }), ({
216
+ }, {
229
217
  type: "default";
230
- options: {
231
- password: string;
232
- userName: string;
233
- };
234
- } & {
235
218
  options: {
236
219
  password: {
237
220
  secret: string;
238
221
  } | {
239
222
  secret_ref: string;
240
223
  };
241
- };
242
- }) | ({
243
- type: "azure-active-directory-password";
244
- options: {
245
- password: string;
246
224
  userName: string;
247
- clientId: string;
248
- tenantId: string;
249
225
  };
250
- } & {
226
+ } | {
227
+ type: "azure-active-directory-password";
251
228
  options: {
252
229
  password: {
253
230
  secret: string;
254
231
  } | {
255
232
  secret_ref: string;
256
233
  };
234
+ userName: string;
235
+ clientId: string;
236
+ tenantId: string;
257
237
  };
258
- }) | ({
238
+ } | {
259
239
  type: "azure-active-directory-service-principal-secret";
260
240
  options: {
261
241
  clientId: string;
262
242
  tenantId: string;
263
- clientSecret: string;
264
- };
265
- } & {
266
- options: {
267
243
  clientSecret: {
268
244
  secret: string;
269
245
  } | {
270
246
  secret_ref: string;
271
247
  };
272
248
  };
273
- }), string, t.CodecProps>>;
249
+ }, string, t.CodecProps>>;
274
250
  additionalConfig: t.OptionalCodec<t.Codec<{
275
251
  pollingIntervalMs?: number | undefined;
276
252
  pollingBatchSize?: number | undefined;
@@ -84,52 +84,40 @@ export declare const DeployInstanceRequest: t.Intersection<t.Codec<{
84
84
  hostname?: string | undefined;
85
85
  port?: number | undefined;
86
86
  schema?: string | undefined;
87
- authentication?: ({
87
+ authentication?: {
88
88
  type: "default";
89
- options: {
90
- password: string;
91
- userName: string;
92
- };
93
- } & {
94
89
  options: {
95
90
  password: {
96
91
  secret: string;
97
92
  } | {
98
93
  secret_ref: string;
99
94
  };
100
- };
101
- }) | ({
102
- type: "azure-active-directory-password";
103
- options: {
104
- password: string;
105
95
  userName: string;
106
- clientId: string;
107
- tenantId: string;
108
96
  };
109
- } & {
97
+ } | {
98
+ type: "azure-active-directory-password";
110
99
  options: {
111
100
  password: {
112
101
  secret: string;
113
102
  } | {
114
103
  secret_ref: string;
115
104
  };
105
+ userName: string;
106
+ clientId: string;
107
+ tenantId: string;
116
108
  };
117
- }) | ({
109
+ } | {
118
110
  type: "azure-active-directory-service-principal-secret";
119
111
  options: {
120
112
  clientId: string;
121
113
  tenantId: string;
122
- clientSecret: string;
123
- };
124
- } & {
125
- options: {
126
114
  clientSecret: {
127
115
  secret: string;
128
116
  } | {
129
117
  secret_ref: string;
130
118
  };
131
119
  };
132
- }) | undefined;
120
+ } | undefined;
133
121
  additionalConfig?: {
134
122
  pollingIntervalMs?: number | undefined;
135
123
  pollingBatchSize?: number | undefined;
@@ -224,52 +212,40 @@ export declare const DeployInstanceRequest: t.Intersection<t.Codec<{
224
212
  hostname?: string | undefined;
225
213
  port?: number | undefined;
226
214
  schema?: string | undefined;
227
- authentication?: ({
215
+ authentication?: {
228
216
  type: "default";
229
- options: {
230
- password: string;
231
- userName: string;
232
- };
233
- } & {
234
217
  options: {
235
218
  password: {
236
219
  secret: string;
237
220
  } | {
238
221
  secret_ref: string;
239
222
  };
240
- };
241
- }) | ({
242
- type: "azure-active-directory-password";
243
- options: {
244
- password: string;
245
223
  userName: string;
246
- clientId: string;
247
- tenantId: string;
248
224
  };
249
- } & {
225
+ } | {
226
+ type: "azure-active-directory-password";
250
227
  options: {
251
228
  password: {
252
229
  secret: string;
253
230
  } | {
254
231
  secret_ref: string;
255
232
  };
233
+ userName: string;
234
+ clientId: string;
235
+ tenantId: string;
256
236
  };
257
- }) | ({
237
+ } | {
258
238
  type: "azure-active-directory-service-principal-secret";
259
239
  options: {
260
240
  clientId: string;
261
241
  tenantId: string;
262
- clientSecret: string;
263
- };
264
- } & {
265
- options: {
266
242
  clientSecret: {
267
243
  secret: string;
268
244
  } | {
269
245
  secret_ref: string;
270
246
  };
271
247
  };
272
- }) | undefined;
248
+ } | undefined;
273
249
  additionalConfig?: {
274
250
  pollingIntervalMs?: number | undefined;
275
251
  pollingBatchSize?: number | undefined;
@@ -485,52 +461,40 @@ export declare const InstanceConfigResponse: t.ObjectCodec<{
485
461
  hostname?: string | undefined;
486
462
  port?: number | undefined;
487
463
  schema?: string | undefined;
488
- authentication?: ({
464
+ authentication?: {
489
465
  type: "default";
490
- options: {
491
- password: string;
492
- userName: string;
493
- };
494
- } & {
495
466
  options: {
496
467
  password: {
497
468
  secret: string;
498
469
  } | {
499
470
  secret_ref: string;
500
471
  };
501
- };
502
- }) | ({
503
- type: "azure-active-directory-password";
504
- options: {
505
- password: string;
506
472
  userName: string;
507
- clientId: string;
508
- tenantId: string;
509
473
  };
510
- } & {
474
+ } | {
475
+ type: "azure-active-directory-password";
511
476
  options: {
512
477
  password: {
513
478
  secret: string;
514
479
  } | {
515
480
  secret_ref: string;
516
481
  };
482
+ userName: string;
483
+ clientId: string;
484
+ tenantId: string;
517
485
  };
518
- }) | ({
486
+ } | {
519
487
  type: "azure-active-directory-service-principal-secret";
520
488
  options: {
521
489
  clientId: string;
522
490
  tenantId: string;
523
- clientSecret: string;
524
- };
525
- } & {
526
- options: {
527
491
  clientSecret: {
528
492
  secret: string;
529
493
  } | {
530
494
  secret_ref: string;
531
495
  };
532
496
  };
533
- }) | undefined;
497
+ } | undefined;
534
498
  additionalConfig?: {
535
499
  pollingIntervalMs?: number | undefined;
536
500
  pollingBatchSize?: number | undefined;
@@ -674,52 +638,40 @@ export declare const InstanceConfigResponse: t.ObjectCodec<{
674
638
  hostname?: string | undefined;
675
639
  port?: number | undefined;
676
640
  schema?: string | undefined;
677
- authentication?: ({
641
+ authentication?: {
678
642
  type: "default";
679
- options: {
680
- password: string;
681
- userName: string;
682
- };
683
- } & {
684
643
  options: {
685
644
  password: {
686
645
  secret: string;
687
646
  } | {
688
647
  secret_ref: string;
689
648
  };
690
- };
691
- }) | ({
692
- type: "azure-active-directory-password";
693
- options: {
694
- password: string;
695
649
  userName: string;
696
- clientId: string;
697
- tenantId: string;
698
650
  };
699
- } & {
651
+ } | {
652
+ type: "azure-active-directory-password";
700
653
  options: {
701
654
  password: {
702
655
  secret: string;
703
656
  } | {
704
657
  secret_ref: string;
705
658
  };
659
+ userName: string;
660
+ clientId: string;
661
+ tenantId: string;
706
662
  };
707
- }) | ({
663
+ } | {
708
664
  type: "azure-active-directory-service-principal-secret";
709
665
  options: {
710
666
  clientId: string;
711
667
  tenantId: string;
712
- clientSecret: string;
713
- };
714
- } & {
715
- options: {
716
668
  clientSecret: {
717
669
  secret: string;
718
670
  } | {
719
671
  secret_ref: string;
720
672
  };
721
673
  };
722
- }) | undefined;
674
+ } | undefined;
723
675
  additionalConfig?: {
724
676
  pollingIntervalMs?: number | undefined;
725
677
  pollingBatchSize?: number | undefined;
@@ -383,6 +383,9 @@
383
383
  "options": {
384
384
  "type": "object",
385
385
  "properties": {
386
+ "userName": {
387
+ "type": "string"
388
+ },
386
389
  "password": {
387
390
  "anyOf": [
388
391
  {
@@ -414,6 +417,7 @@
414
417
  },
415
418
  "additionalProperties": true,
416
419
  "required": [
420
+ "userName",
417
421
  "password"
418
422
  ]
419
423
  }
@@ -434,6 +438,9 @@
434
438
  "options": {
435
439
  "type": "object",
436
440
  "properties": {
441
+ "userName": {
442
+ "type": "string"
443
+ },
437
444
  "password": {
438
445
  "anyOf": [
439
446
  {
@@ -461,11 +468,20 @@
461
468
  ]
462
469
  }
463
470
  ]
471
+ },
472
+ "clientId": {
473
+ "type": "string"
474
+ },
475
+ "tenantId": {
476
+ "type": "string"
464
477
  }
465
478
  },
466
479
  "additionalProperties": true,
467
480
  "required": [
468
- "password"
481
+ "userName",
482
+ "password",
483
+ "clientId",
484
+ "tenantId"
469
485
  ]
470
486
  }
471
487
  },
@@ -485,6 +501,9 @@
485
501
  "options": {
486
502
  "type": "object",
487
503
  "properties": {
504
+ "clientId": {
505
+ "type": "string"
506
+ },
488
507
  "clientSecret": {
489
508
  "anyOf": [
490
509
  {
@@ -512,11 +531,16 @@
512
531
  ]
513
532
  }
514
533
  ]
534
+ },
535
+ "tenantId": {
536
+ "type": "string"
515
537
  }
516
538
  },
517
539
  "additionalProperties": true,
518
540
  "required": [
519
- "clientSecret"
541
+ "clientId",
542
+ "clientSecret",
543
+ "tenantId"
520
544
  ]
521
545
  }
522
546
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powersync/management-types",
3
- "version": "0.0.0-dev.ccbd04ad",
3
+ "version": "0.0.0-dev.ec9d802b",
4
4
  "description": "Common TypeScript types for PowerSync Management Service API requests",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -29,8 +29,7 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@journeyapps-labs/micro-codecs": "^1.0.1",
32
- "@powersync/service-module-mssql": "0.0.0-dev-20260225093637",
33
- "@powersync/service-types": "0.0.0-dev-20260225093637",
32
+ "@powersync/service-types": "0.15.0",
34
33
  "bson": "^6.10.4",
35
34
  "ts-codec": "^1.3.0"
36
35
  },