@powersync/management-types 0.0.0-dev.85b697f3

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 (64) hide show
  1. package/LICENSE +67 -0
  2. package/README.md +88 -0
  3. package/dist/config/HostedConfig.d.ts +1318 -0
  4. package/dist/config/HostedConfig.js +101 -0
  5. package/dist/config/HostedConfig.js.map +1 -0
  6. package/dist/config/HostedSecret.d.ts +18 -0
  7. package/dist/config/HostedSecret.js +12 -0
  8. package/dist/config/HostedSecret.js.map +1 -0
  9. package/dist/config/connections/ConnectionType.d.ts +6 -0
  10. package/dist/config/connections/ConnectionType.js +8 -0
  11. package/dist/config/connections/ConnectionType.js.map +1 -0
  12. package/dist/config/connections/HostedDatabaseSourceConfig.d.ts +23 -0
  13. package/dist/config/connections/HostedDatabaseSourceConfig.js +18 -0
  14. package/dist/config/connections/HostedDatabaseSourceConfig.js.map +1 -0
  15. package/dist/config/connections/HostedMSSQLConnection.d.ts +308 -0
  16. package/dist/config/connections/HostedMSSQLConnection.js +41 -0
  17. package/dist/config/connections/HostedMSSQLConnection.js.map +1 -0
  18. package/dist/config/connections/HostedMongoConnection.d.ts +33 -0
  19. package/dist/config/connections/HostedMongoConnection.js +10 -0
  20. package/dist/config/connections/HostedMongoConnection.js.map +1 -0
  21. package/dist/config/connections/HostedMySQLConnection.d.ts +46 -0
  22. package/dist/config/connections/HostedMySQLConnection.js +16 -0
  23. package/dist/config/connections/HostedMySQLConnection.js.map +1 -0
  24. package/dist/config/connections/HostedPostgresConnection.d.ts +52 -0
  25. package/dist/config/connections/HostedPostgresConnection.js +21 -0
  26. package/dist/config/connections/HostedPostgresConnection.js.map +1 -0
  27. package/dist/errors.d.ts +10 -0
  28. package/dist/errors.js +13 -0
  29. package/dist/errors.js.map +1 -0
  30. package/dist/index.d.ts +13 -0
  31. package/dist/index.js +14 -0
  32. package/dist/index.js.map +1 -0
  33. package/dist/routes/dashboard-routes.d.ts +13 -0
  34. package/dist/routes/dashboard-routes.js +16 -0
  35. package/dist/routes/dashboard-routes.js.map +1 -0
  36. package/dist/routes/dev-routes.d.ts +588 -0
  37. package/dist/routes/dev-routes.js +97 -0
  38. package/dist/routes/dev-routes.js.map +1 -0
  39. package/dist/routes/general-routes.d.ts +78 -0
  40. package/dist/routes/general-routes.js +57 -0
  41. package/dist/routes/general-routes.js.map +1 -0
  42. package/dist/routes/index.d.ts +6 -0
  43. package/dist/routes/index.js +7 -0
  44. package/dist/routes/index.js.map +1 -0
  45. package/dist/routes/manage-routes.d.ts +1055 -0
  46. package/dist/routes/manage-routes.js +109 -0
  47. package/dist/routes/manage-routes.js.map +1 -0
  48. package/dist/routes/reporting-routes.d.ts +112 -0
  49. package/dist/routes/reporting-routes.js +61 -0
  50. package/dist/routes/reporting-routes.js.map +1 -0
  51. package/dist/routes/schema.d.ts +131 -0
  52. package/dist/routes/schema.js +71 -0
  53. package/dist/routes/schema.js.map +1 -0
  54. package/dist/scripts/compile-json-schema.d.ts +1 -0
  55. package/dist/scripts/compile-json-schema.js +15 -0
  56. package/dist/scripts/compile-json-schema.js.map +1 -0
  57. package/dist/shared.d.ts +17 -0
  58. package/dist/shared.js +17 -0
  59. package/dist/shared.js.map +1 -0
  60. package/dist/utils/pagination.d.ts +12 -0
  61. package/dist/utils/pagination.js +13 -0
  62. package/dist/utils/pagination.js.map +1 -0
  63. package/json-schema/powersync-config.json +880 -0
  64. package/package.json +44 -0
@@ -0,0 +1,101 @@
1
+ import * as t from 'ts-codec';
2
+ import { configFile } from '@powersync/service-types';
3
+ import { HostedSecret } from './HostedSecret.js';
4
+ import { HostedMSSQLConnection } from './connections/HostedMSSQLConnection.js';
5
+ import { HostedMongoConnection } from './connections/HostedMongoConnection.js';
6
+ import { HostedMySQLConnection } from './connections/HostedMySQLConnection.js';
7
+ import { HostedPostgresConnection } from './connections/HostedPostgresConnection.js';
8
+ export const AnyHostedConnection = HostedPostgresConnection.or(HostedMongoConnection)
9
+ .or(HostedMySQLConnection)
10
+ .or(HostedMSSQLConnection);
11
+ AnyHostedConnection.meta({
12
+ description: 'Any hosted connection type.'
13
+ });
14
+ export const JwkHmac = t.object({
15
+ kty: t.literal('oct').meta({
16
+ description: 'Key type identifier, must be "oct" for HMAC keys.'
17
+ }),
18
+ kid: t.string.meta({
19
+ description: 'Key ID. Undefined kid indicates it can match any JWT, with or without a kid. Use a kid wherever possible.'
20
+ }),
21
+ k: HostedSecret.meta({
22
+ description: 'The HMAC key value, Base64 URL encoded (may be a secret reference).'
23
+ }),
24
+ alg: t.literal('HS256').or(t.literal('HS384')).or(t.literal('HS512')).meta({
25
+ description: 'The algorithm intended for use with this key (HS256, HS384, or HS512).'
26
+ }),
27
+ use: t.string
28
+ .meta({
29
+ description: 'The intended use of the key (e.g., "sig" for signature).'
30
+ })
31
+ .optional()
32
+ });
33
+ JwkHmac.meta({
34
+ description: 'JSON Web Key (JWK) representation of an HMAC key.'
35
+ });
36
+ export const Jwk = t.union(t.union(t.union(configFile.jwkRSA, JwkHmac), configFile.jwkOKP), configFile.jwkEC);
37
+ Jwk.meta({
38
+ description: 'A JSON Web Key (JWK) representing a cryptographic key. Can be RSA, HMAC, OKP, or EC key types.'
39
+ });
40
+ export const Jwks = t.object({
41
+ keys: t.array(Jwk).meta({
42
+ description: 'An array of JSON Web Keys (JWKs).'
43
+ })
44
+ });
45
+ Jwks.meta({
46
+ description: 'A JSON Web Key Set (JWKS) containing a collection of JWKs.'
47
+ });
48
+ const ReplicationConfig = t.object({
49
+ connections: t
50
+ .array(AnyHostedConnection)
51
+ .meta({
52
+ description: 'Array of data source connections used for replication.'
53
+ })
54
+ .optional()
55
+ });
56
+ ReplicationConfig.meta({
57
+ description: 'Configuration for data replication services.'
58
+ });
59
+ const ClientAuthConfig = t.object({
60
+ jwks_uri: t.string
61
+ .meta({
62
+ description: 'URI pointing to a JWKS endpoint for client authentication.'
63
+ })
64
+ .optional(),
65
+ jwks: Jwks.meta({
66
+ description: 'Inline JWKS configuration for client authentication.'
67
+ }).optional(),
68
+ supabase: t.boolean
69
+ .meta({
70
+ description: 'Enables Supabase authentication integration.'
71
+ })
72
+ .optional(),
73
+ supabase_jwt_secret: HostedSecret.meta({
74
+ description: 'JWT secret for Supabase authentication (may be a secret reference).'
75
+ }).optional(),
76
+ additional_audiences: t
77
+ .array(t.string)
78
+ .meta({
79
+ description: 'Additional valid audiences for JWT validation.'
80
+ })
81
+ .optional(),
82
+ allow_temporary_tokens: t.boolean
83
+ .meta({
84
+ description: 'When true, allows temporary tokens for development or testing.'
85
+ })
86
+ .optional()
87
+ });
88
+ ClientAuthConfig.meta({
89
+ description: 'Configuration for client authentication mechanisms.'
90
+ });
91
+ export const BasePowerSyncHostedConfig = t.object({
92
+ region: t.string.meta({
93
+ description: 'Deployment region for the hosted service (e.g., "us" or "eu").'
94
+ }),
95
+ replication: ReplicationConfig.optional(),
96
+ client_auth: ClientAuthConfig.optional()
97
+ });
98
+ BasePowerSyncHostedConfig.meta({
99
+ description: 'Base configuration for PowerSync hosted service.'
100
+ });
101
+ //# sourceMappingURL=HostedConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HostedConfig.js","sourceRoot":"","sources":["../../src/config/HostedConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAErF,MAAM,CAAC,MAAM,mBAAmB,GAAG,wBAAwB,CAAC,EAAE,CAAC,qBAAqB,CAAC;KAClF,EAAE,CAAC,qBAAq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CACd,CAAC,CAAC;AAEH,gBAAgB,CAAC,IAAI,CAAC;IACpB,WAAW,EAAE,qDAAqD;CACnE,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;QACpB,WAAW,EAAE,gEAAgE;KAC9E,CAAC;IAEF,WAAW,EAAE,iBAAiB,CAAC,QAAQ,EAAE;IAEzC,WAAW,EAAE,gBAAgB,CAAC,QAAQ,EAAE;CACzC,CAAC,CAAC;AAEH,yBAAyB,CAAC,IAAI,CAAC;IAC7B,WAAW,EAAE,kDAAkD;CAChE,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ import * as t from 'ts-codec';
2
+ export declare const HostedSecretValue: t.ObjectCodec<{
3
+ secret: t.IdentityCodec<t.CodecType.String>;
4
+ }>;
5
+ export type HostedSecretValue = t.Encoded<typeof HostedSecretValue>;
6
+ export declare const HostedSecretRef: t.ObjectCodec<{
7
+ secret_ref: t.IdentityCodec<t.CodecType.String>;
8
+ }>;
9
+ export type HostedSecretRef = t.Encoded<typeof HostedSecretRef>;
10
+ export declare const HostedSecret: t.Union<t.Codec<{
11
+ secret_ref: string;
12
+ }, {
13
+ secret_ref: string;
14
+ }, string, t.CodecProps>, t.ObjectCodec<{
15
+ secret: t.IdentityCodec<t.CodecType.String>;
16
+ }>>;
17
+ export type HostedSecret = t.Encoded<typeof HostedSecret>;
18
+ export declare function isHostedSecretValue(v: HostedSecret): v is HostedSecretValue;
@@ -0,0 +1,12 @@
1
+ import * as t from 'ts-codec';
2
+ export const HostedSecretValue = t.object({
3
+ secret: t.string
4
+ });
5
+ export const HostedSecretRef = t.object({
6
+ secret_ref: t.string
7
+ });
8
+ export const HostedSecret = HostedSecretRef.or(HostedSecretValue);
9
+ export function isHostedSecretValue(v) {
10
+ return typeof v.secret == 'string';
11
+ }
12
+ //# sourceMappingURL=HostedSecret.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HostedSecret.js","sourceRoot":"","sources":["../../src/config/HostedSecret.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,MAAM,EAAE,CAAC,CAAC,MAAM;CACjB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,UAAU,EAAE,CAAC,CAAC,MAAM;CACrB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,YAAY,GAAG,eAAe,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC;AAGlE,MAAM,UAAU,mBAAmB,CAAC,CAAe;IACjD,OAAO,OAAQ,CAAuB,CAAC,MAAM,IAAI,QAAQ,CAAC;AAC5D,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare enum ConnectionType {
2
+ POSTGRES = "postgresql",
3
+ MONGODB = "mongodb",
4
+ MYSQL = "mysql",
5
+ MSSQL = "mssql"
6
+ }
@@ -0,0 +1,8 @@
1
+ export var ConnectionType;
2
+ (function (ConnectionType) {
3
+ ConnectionType["POSTGRES"] = "postgresql";
4
+ ConnectionType["MONGODB"] = "mongodb";
5
+ ConnectionType["MYSQL"] = "mysql";
6
+ ConnectionType["MSSQL"] = "mssql";
7
+ })(ConnectionType || (ConnectionType = {}));
8
+ //# sourceMappingURL=ConnectionType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConnectionType.js","sourceRoot":"","sources":["../../../src/config/connections/ConnectionType.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,yCAAuB,CAAA;IACvB,qCAAmB,CAAA;IACnB,iCAAe,CAAA;IACf,iCAAe,CAAA;AACjB,CAAC,EALW,cAAc,KAAd,cAAc,QAKzB"}
@@ -0,0 +1,23 @@
1
+ import * as t from 'ts-codec';
2
+ import { ConnectionType } from './ConnectionType.js';
3
+ export declare const DataSourceConfig: t.ObjectCodec<{
4
+ type: t.EnumCodec<typeof ConnectionType>;
5
+ /** Descriptive name */
6
+ name: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
7
+ /** Unique identifier for the connection - optional when a single connection is present. */
8
+ id: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
9
+ /** Tag used as reference in sync rules. Defaults to "default". Does not have to be unique. */
10
+ tag: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
11
+ username: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
12
+ password: t.OptionalCodec<t.Codec<{
13
+ secret: string;
14
+ } | {
15
+ secret_ref: string;
16
+ }, {
17
+ secret: string;
18
+ } | {
19
+ secret_ref: string;
20
+ }, string, t.CodecProps>>;
21
+ database: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
22
+ }>;
23
+ export type DataSourceConfigDecoded = t.Decoded<typeof DataSourceConfig>;
@@ -0,0 +1,18 @@
1
+ import * as t from 'ts-codec';
2
+ import { ConnectionType } from './ConnectionType.js';
3
+ import { HostedSecret } from '../HostedSecret.js';
4
+ // This will be imported from the core module package once module packages are used
5
+ export const DataSourceConfig = t.object({
6
+ // Unique string identifier for the data source
7
+ type: t.Enum(ConnectionType),
8
+ /** Descriptive name */
9
+ name: t.string.optional(),
10
+ /** Unique identifier for the connection - optional when a single connection is present. */
11
+ id: t.string.optional(),
12
+ /** Tag used as reference in sync rules. Defaults to "default". Does not have to be unique. */
13
+ tag: t.string.optional(),
14
+ username: t.string.optional(),
15
+ password: HostedSecret.optional(),
16
+ database: t.string.optional()
17
+ });
18
+ //# sourceMappingURL=HostedDatabaseSourceConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HostedDatabaseSourceConfig.js","sourceRoot":"","sources":["../../../src/config/connections/HostedDatabaseSourceConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,mFAAmF;AACnF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,+CAA+C;IAC/C,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC;IAC5B,uBAAuB;IACvB,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE;IACzB,2FAA2F;IAC3F,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE;IACvB,8FAA8F;IAC9F,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE;IAExB,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE;IAC7B,QAAQ,EAAE,YAAY,CAAC,QAAQ,EAAE;IACjC,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC"}
@@ -0,0 +1,308 @@
1
+ import * as t from 'ts-codec';
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<{
16
+ options: t.ObjectCodec<{
17
+ password: t.Union<t.Codec<{
18
+ secret_ref: string;
19
+ }, {
20
+ secret_ref: string;
21
+ }, string, t.CodecProps>, t.ObjectCodec<{
22
+ secret: t.IdentityCodec<t.CodecType.String>;
23
+ }>>;
24
+ }>;
25
+ }>>;
26
+ 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<{
44
+ options: t.ObjectCodec<{
45
+ password: t.Union<t.Codec<{
46
+ secret_ref: string;
47
+ }, {
48
+ secret_ref: string;
49
+ }, string, t.CodecProps>, t.ObjectCodec<{
50
+ secret: t.IdentityCodec<t.CodecType.String>;
51
+ }>>;
52
+ }>;
53
+ }>>;
54
+ 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<{
70
+ options: t.ObjectCodec<{
71
+ clientSecret: t.Union<t.Codec<{
72
+ secret_ref: string;
73
+ }, {
74
+ secret_ref: string;
75
+ }, string, t.CodecProps>, t.ObjectCodec<{
76
+ secret: t.IdentityCodec<t.CodecType.String>;
77
+ }>>;
78
+ }>;
79
+ }>>;
80
+ export type AzureActiveDirectoryServicePrincipalSecretHosted = t.Encoded<typeof AzureActiveDirectoryServicePrincipalSecretHosted>;
81
+ export declare const AuthenticationHosted: t.Union<t.Codec<({
82
+ type: "default";
83
+ options: {
84
+ password: string;
85
+ userName: string;
86
+ };
87
+ } & {
88
+ options: {
89
+ password: {
90
+ secret: string;
91
+ } | {
92
+ secret_ref: string;
93
+ };
94
+ };
95
+ }) | ({
96
+ type: "azure-active-directory-password";
97
+ options: {
98
+ password: string;
99
+ userName: string;
100
+ clientId: string;
101
+ tenantId: string;
102
+ };
103
+ } & {
104
+ options: {
105
+ password: {
106
+ secret: string;
107
+ } | {
108
+ secret_ref: string;
109
+ };
110
+ };
111
+ }), ({
112
+ type: "default";
113
+ options: {
114
+ password: string;
115
+ userName: string;
116
+ };
117
+ } & {
118
+ options: {
119
+ password: {
120
+ secret: string;
121
+ } | {
122
+ secret_ref: string;
123
+ };
124
+ };
125
+ }) | ({
126
+ type: "azure-active-directory-password";
127
+ options: {
128
+ password: string;
129
+ userName: string;
130
+ clientId: string;
131
+ tenantId: string;
132
+ };
133
+ } & {
134
+ options: {
135
+ password: {
136
+ secret: string;
137
+ } | {
138
+ secret_ref: string;
139
+ };
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: {
151
+ clientId: string;
152
+ tenantId: string;
153
+ clientSecret: string;
154
+ };
155
+ }, string, t.CodecProps>, t.ObjectCodec<{
156
+ options: t.ObjectCodec<{
157
+ clientSecret: t.Union<t.Codec<{
158
+ secret_ref: string;
159
+ }, {
160
+ secret_ref: string;
161
+ }, string, t.CodecProps>, t.ObjectCodec<{
162
+ secret: t.IdentityCodec<t.CodecType.String>;
163
+ }>>;
164
+ }>;
165
+ }>>>;
166
+ export type AuthenticationHosted = t.Encoded<typeof AuthenticationHosted>;
167
+ export declare const HostedMSSQLConnection: t.Intersection<t.Codec<{
168
+ type: ConnectionType;
169
+ name?: string | undefined;
170
+ id?: string | undefined;
171
+ tag?: string | undefined;
172
+ username?: string | undefined;
173
+ password?: {
174
+ secret: string;
175
+ } | {
176
+ secret_ref: string;
177
+ } | undefined;
178
+ database?: string | undefined;
179
+ }, {
180
+ type: ConnectionType;
181
+ name?: string | undefined;
182
+ id?: string | undefined;
183
+ tag?: string | undefined;
184
+ username?: string | undefined;
185
+ password?: {
186
+ secret: string;
187
+ } | {
188
+ secret_ref: string;
189
+ } | undefined;
190
+ database?: string | undefined;
191
+ }, string, t.CodecProps>, t.ObjectCodec<{
192
+ type: t.LiteralCodec<ConnectionType.MSSQL>;
193
+ uri: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
194
+ hostname: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
195
+ port: t.OptionalCodec<t.Codec<number, number, string, t.CodecProps>>;
196
+ schema: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
197
+ /**
198
+ * Authentication method to use when connecting to the database.
199
+ * When not specified, 'default' username & password authentication is used.
200
+ */
201
+ authentication: t.OptionalCodec<t.Codec<({
202
+ type: "default";
203
+ options: {
204
+ password: string;
205
+ userName: string;
206
+ };
207
+ } & {
208
+ options: {
209
+ password: {
210
+ secret: string;
211
+ } | {
212
+ secret_ref: string;
213
+ };
214
+ };
215
+ }) | ({
216
+ type: "azure-active-directory-password";
217
+ options: {
218
+ password: string;
219
+ userName: string;
220
+ clientId: string;
221
+ tenantId: string;
222
+ };
223
+ } & {
224
+ options: {
225
+ password: {
226
+ secret: string;
227
+ } | {
228
+ secret_ref: string;
229
+ };
230
+ };
231
+ }) | ({
232
+ type: "azure-active-directory-service-principal-secret";
233
+ options: {
234
+ clientId: string;
235
+ tenantId: string;
236
+ clientSecret: string;
237
+ };
238
+ } & {
239
+ options: {
240
+ clientSecret: {
241
+ secret: string;
242
+ } | {
243
+ secret_ref: string;
244
+ };
245
+ };
246
+ }), ({
247
+ type: "default";
248
+ options: {
249
+ password: string;
250
+ userName: string;
251
+ };
252
+ } & {
253
+ options: {
254
+ password: {
255
+ secret: string;
256
+ } | {
257
+ secret_ref: string;
258
+ };
259
+ };
260
+ }) | ({
261
+ type: "azure-active-directory-password";
262
+ options: {
263
+ password: string;
264
+ userName: string;
265
+ clientId: string;
266
+ tenantId: string;
267
+ };
268
+ } & {
269
+ options: {
270
+ password: {
271
+ secret: string;
272
+ } | {
273
+ secret_ref: string;
274
+ };
275
+ };
276
+ }) | ({
277
+ type: "azure-active-directory-service-principal-secret";
278
+ options: {
279
+ clientId: string;
280
+ tenantId: string;
281
+ clientSecret: string;
282
+ };
283
+ } & {
284
+ options: {
285
+ clientSecret: {
286
+ secret: string;
287
+ } | {
288
+ secret_ref: string;
289
+ };
290
+ };
291
+ }), string, t.CodecProps>>;
292
+ /**
293
+ * Additional configuration options for tweaking replicator and connection behavior.
294
+ */
295
+ additionalConfig: t.OptionalCodec<t.Codec<{
296
+ pollingIntervalMs?: number | undefined;
297
+ pollingBatchSize?: number | undefined;
298
+ trustServerCertificate?: boolean | undefined;
299
+ }, {
300
+ pollingIntervalMs?: number | undefined;
301
+ pollingBatchSize?: number | undefined;
302
+ trustServerCertificate?: boolean | undefined;
303
+ }, string, t.CodecProps>>;
304
+ /** Expose execute-sql */
305
+ debug_api: t.OptionalCodec<t.Codec<boolean, boolean, string, t.CodecProps>>;
306
+ }>>;
307
+ export type HostedMSSQLConnection = t.Encoded<typeof HostedMSSQLConnection>;
308
+ export type HostedMSSQLConnectionDecoded = t.Decoded<typeof HostedMSSQLConnection>;
@@ -0,0 +1,41 @@
1
+ import * as mssql_types from '@powersync/service-module-mssql/types';
2
+ import * as t from 'ts-codec';
3
+ import { HostedSecret } from '../HostedSecret.js';
4
+ import { ConnectionType } from './ConnectionType.js';
5
+ import { DataSourceConfig } from './HostedDatabaseSourceConfig.js';
6
+ // Replace confidential fields with HostedSecret
7
+ export const DefaultAuthenticationHosted = mssql_types.DefaultAuthentication.and(t.object({
8
+ options: t.object({
9
+ password: HostedSecret
10
+ })
11
+ }));
12
+ export const AzureActiveDirectoryPasswordAuthenticationHosted = mssql_types.AzureActiveDirectoryPasswordAuthentication.and(t.object({
13
+ options: t.object({
14
+ password: HostedSecret
15
+ })
16
+ }));
17
+ export const AzureActiveDirectoryServicePrincipalSecretHosted = mssql_types.AzureActiveDirectoryServicePrincipalSecret.and(t.object({
18
+ options: t.object({
19
+ clientSecret: HostedSecret
20
+ })
21
+ }));
22
+ export const AuthenticationHosted = DefaultAuthenticationHosted.or(AzureActiveDirectoryPasswordAuthenticationHosted).or(AzureActiveDirectoryServicePrincipalSecretHosted);
23
+ export const HostedMSSQLConnection = DataSourceConfig.and(t.object({
24
+ type: t.literal(ConnectionType.MSSQL),
25
+ uri: t.string.optional(),
26
+ hostname: t.string.optional(),
27
+ port: t.number.optional(),
28
+ schema: t.string.optional(),
29
+ /**
30
+ * Authentication method to use when connecting to the database.
31
+ * When not specified, 'default' username & password authentication is used.
32
+ */
33
+ authentication: AuthenticationHosted.optional(),
34
+ /**
35
+ * Additional configuration options for tweaking replicator and connection behavior.
36
+ */
37
+ additionalConfig: mssql_types.AdditionalConfig.optional(),
38
+ /** Expose execute-sql */
39
+ debug_api: t.boolean.optional()
40
+ }));
41
+ //# sourceMappingURL=HostedMSSQLConnection.js.map
@@ -0,0 +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;AAEnE,gDAAgD;AAChD,MAAM,CAAC,MAAM,2BAA2B,GAAG,WAAW,CAAC,qBAAqB,CAAC,GAAG,CAC9E,CAAC,CAAC,MAAM,CAAC;IACP,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC;QAChB,QAAQ,EAAE,YAAY;KACvB,CAAC;CACH,CAAC,CACH,CAAC;AAIF,MAAM,CAAC,MAAM,gDAAgD,GAC3D,WAAW,CAAC,0CAA0C,CAAC,GAAG,CACxD,CAAC,CAAC,MAAM,CAAC;IACP,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC;QAChB,QAAQ,EAAE,YAAY;KACvB,CAAC;CACH,CAAC,CACH,CAAC;AAKJ,MAAM,CAAC,MAAM,gDAAgD,GAC3D,WAAW,CAAC,0CAA0C,CAAC,GAAG,CACxD,CAAC,CAAC,MAAM,CAAC;IACP,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC;QAChB,YAAY,EAAE,YAAY;KAC3B,CAAC;CACH,CAAC,CACH,CAAC;AAKJ,MAAM,CAAC,MAAM,oBAAoB,GAAG,2BAA2B,CAAC,EAAE,CAAC,gDAAgD,CAAC,CAAC,EAAE,CACrH,gDAAgD,CACjD,CAAC;AAGF,MAAM,CAAC,MAAM,qBAAqB,GAAG,gBAAgB,CAAC,GAAG,CACvD,CAAC,CAAC,MAAM,CAAC;IACP,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC;IACrC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE;IACxB,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE;IAC7B,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE;IACzB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE;IAE3B;;;OAGG;IACH,cAAc,EAAE,oBAAoB,CAAC,QAAQ,EAAE;IAE/C;;OAEG;IACH,gBAAgB,EAAE,WAAW,CAAC,gBAAgB,CAAC,QAAQ,EAAE;IAEzD,yBAAyB;IACzB,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE;CAChC,CAAC,CACH,CAAC"}
@@ -0,0 +1,33 @@
1
+ import * as t from 'ts-codec';
2
+ import { ConnectionType } from './ConnectionType.js';
3
+ export declare const HostedMongoConnection: t.Intersection<t.Codec<{
4
+ type: ConnectionType;
5
+ name?: string | undefined;
6
+ id?: string | undefined;
7
+ tag?: string | undefined;
8
+ username?: string | undefined;
9
+ password?: {
10
+ secret: string;
11
+ } | {
12
+ secret_ref: string;
13
+ } | undefined;
14
+ database?: string | undefined;
15
+ }, {
16
+ type: ConnectionType;
17
+ name?: string | undefined;
18
+ id?: string | undefined;
19
+ tag?: string | undefined;
20
+ username?: string | undefined;
21
+ password?: {
22
+ secret: string;
23
+ } | {
24
+ secret_ref: string;
25
+ } | undefined;
26
+ database?: string | undefined;
27
+ }, string, t.CodecProps>, t.ObjectCodec<{
28
+ type: t.LiteralCodec<ConnectionType.MONGODB>;
29
+ uri: t.IdentityCodec<t.CodecType.String>;
30
+ post_images: t.OptionalCodec<t.Codec<"off" | "auto_configure" | "read_only", "off" | "auto_configure" | "read_only", string, t.CodecProps>>;
31
+ vpc_endpoint_hostname: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
32
+ }>>;
33
+ export type HostedMongoConnection = t.Encoded<typeof HostedMongoConnection>;
@@ -0,0 +1,10 @@
1
+ import * as t from 'ts-codec';
2
+ import { DataSourceConfig } from './HostedDatabaseSourceConfig.js';
3
+ import { ConnectionType } from './ConnectionType.js';
4
+ export const HostedMongoConnection = DataSourceConfig.and(t.object({
5
+ type: t.literal(ConnectionType.MONGODB),
6
+ uri: t.string,
7
+ post_images: t.literal('off').or(t.literal('auto_configure')).or(t.literal('read_only')).optional(),
8
+ vpc_endpoint_hostname: t.string.optional()
9
+ }));
10
+ //# sourceMappingURL=HostedMongoConnection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HostedMongoConnection.js","sourceRoot":"","sources":["../../../src/config/connections/HostedMongoConnection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,CAAC,MAAM,qBAAqB,GAAG,gBAAgB,CAAC,GAAG,CACvD,CAAC,CAAC,MAAM,CAAC;IACP,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC;IACvC,GAAG,EAAE,CAAC,CAAC,MAAM;IAEb,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,EAAE;IAEnG,qBAAqB,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE;CAC3C,CAAC,CACH,CAAC"}
@@ -0,0 +1,46 @@
1
+ import * as t from 'ts-codec';
2
+ import { ConnectionType } from './ConnectionType.js';
3
+ export declare const HostedMySQLConnection: t.Intersection<t.Codec<{
4
+ type: ConnectionType;
5
+ name?: string | undefined;
6
+ id?: string | undefined;
7
+ tag?: string | undefined;
8
+ username?: string | undefined;
9
+ password?: {
10
+ secret: string;
11
+ } | {
12
+ secret_ref: string;
13
+ } | undefined;
14
+ database?: string | undefined;
15
+ }, {
16
+ type: ConnectionType;
17
+ name?: string | undefined;
18
+ id?: string | undefined;
19
+ tag?: string | undefined;
20
+ username?: string | undefined;
21
+ password?: {
22
+ secret: string;
23
+ } | {
24
+ secret_ref: string;
25
+ } | undefined;
26
+ database?: string | undefined;
27
+ }, string, t.CodecProps>, t.ObjectCodec<{
28
+ type: t.LiteralCodec<ConnectionType.MYSQL>;
29
+ uri: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
30
+ hostname: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
31
+ port: t.OptionalCodec<t.Codec<number, number, string, t.CodecProps>>;
32
+ /** For mutual TLS */
33
+ client_certificate: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
34
+ client_private_key: t.OptionalCodec<t.Codec<{
35
+ secret: string;
36
+ } | {
37
+ secret_ref: string;
38
+ }, {
39
+ secret: string;
40
+ } | {
41
+ secret_ref: string;
42
+ }, string, t.CodecProps>>;
43
+ /** Expose execute-sql */
44
+ debug_api: t.OptionalCodec<t.Codec<boolean, boolean, string, t.CodecProps>>;
45
+ }>>;
46
+ export type HostedMySQLConnection = t.Encoded<typeof HostedMySQLConnection>;