@powersync/cli-schemas 0.9.2 → 0.9.3

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.
@@ -1,9 +1,18 @@
1
+ import * as managementTypes from '@powersync/management-types';
1
2
  import * as t from 'ts-codec';
3
+ export declare const AdditionalCloudConfigFields: t.ObjectCodec<{
4
+ /** Discriminator for Cloud config. */
5
+ _type: t.LiteralCodec<"cloud">;
6
+ /** Instance display name. */
7
+ name: t.IdentityCodec<t.CodecType.String>;
8
+ }>;
9
+ export type AdditionalCloudConfigFields = t.Encoded<typeof AdditionalCloudConfigFields>;
10
+ export type BasePowerSyncHostedConfigDecoded = managementTypes.BasePowerSyncHostedConfigDecoded;
2
11
  export declare const ServiceCloudConfig: t.Intersection<t.Codec<{
3
12
  region: string;
4
13
  replication?: {
5
14
  connections?: (({
6
- type: import("@powersync/management-types").ConnectionType;
15
+ type: managementTypes.ConnectionType;
7
16
  name?: string | undefined;
8
17
  id?: string | undefined;
9
18
  tag?: string | undefined;
@@ -15,12 +24,12 @@ export declare const ServiceCloudConfig: t.Intersection<t.Codec<{
15
24
  } | undefined;
16
25
  database?: string | undefined;
17
26
  } & {
18
- type: import("@powersync/management-types").ConnectionType.MONGODB;
27
+ type: managementTypes.ConnectionType.MONGODB;
19
28
  uri: string;
20
29
  post_images?: "off" | "auto_configure" | "read_only" | undefined;
21
30
  vpc_endpoint_hostname?: string | undefined;
22
31
  }) | ({
23
- type: import("@powersync/management-types").ConnectionType;
32
+ type: managementTypes.ConnectionType;
24
33
  name?: string | undefined;
25
34
  id?: string | undefined;
26
35
  tag?: string | undefined;
@@ -32,57 +41,33 @@ export declare const ServiceCloudConfig: t.Intersection<t.Codec<{
32
41
  } | undefined;
33
42
  database?: string | undefined;
34
43
  } & {
35
- type: import("@powersync/management-types").ConnectionType.MSSQL;
44
+ type: managementTypes.ConnectionType.MSSQL;
36
45
  uri?: string | undefined;
37
46
  hostname?: string | undefined;
38
47
  port?: number | undefined;
39
48
  schema?: string | undefined;
40
- authentication?: ({
49
+ authentication?: {
41
50
  type: "default";
42
- options: {
43
- password: string;
44
- userName: string;
45
- };
46
- } & {
47
51
  options: {
48
52
  password: {
49
53
  secret: string;
50
54
  } | {
51
55
  secret_ref: string;
52
56
  };
53
- };
54
- }) | ({
55
- type: "azure-active-directory-password";
56
- options: {
57
- password: string;
58
57
  userName: string;
59
- clientId: string;
60
- tenantId: string;
61
58
  };
62
- } & {
63
- options: {
64
- password: {
65
- secret: string;
66
- } | {
67
- secret_ref: string;
68
- };
69
- };
70
- }) | ({
59
+ } | {
71
60
  type: "azure-active-directory-service-principal-secret";
72
61
  options: {
73
62
  clientId: string;
74
- tenantId: string;
75
- clientSecret: string;
76
- };
77
- } & {
78
- options: {
79
63
  clientSecret: {
80
64
  secret: string;
81
65
  } | {
82
66
  secret_ref: string;
83
67
  };
68
+ tenantId: string;
84
69
  };
85
- }) | undefined;
70
+ } | undefined;
86
71
  additionalConfig?: {
87
72
  pollingIntervalMs?: number | undefined;
88
73
  pollingBatchSize?: number | undefined;
@@ -90,7 +75,7 @@ export declare const ServiceCloudConfig: t.Intersection<t.Codec<{
90
75
  } | undefined;
91
76
  debug_api?: boolean | undefined;
92
77
  }) | ({
93
- type: import("@powersync/management-types").ConnectionType;
78
+ type: managementTypes.ConnectionType;
94
79
  name?: string | undefined;
95
80
  id?: string | undefined;
96
81
  tag?: string | undefined;
@@ -102,7 +87,7 @@ export declare const ServiceCloudConfig: t.Intersection<t.Codec<{
102
87
  } | undefined;
103
88
  database?: string | undefined;
104
89
  } & {
105
- type: import("@powersync/management-types").ConnectionType.MYSQL;
90
+ type: managementTypes.ConnectionType.MYSQL;
106
91
  uri?: string | undefined;
107
92
  hostname?: string | undefined;
108
93
  port?: number | undefined;
@@ -114,7 +99,7 @@ export declare const ServiceCloudConfig: t.Intersection<t.Codec<{
114
99
  secret_ref: string;
115
100
  } | undefined;
116
101
  }) | ({
117
- type: import("@powersync/management-types").ConnectionType;
102
+ type: managementTypes.ConnectionType;
118
103
  name?: string | undefined;
119
104
  id?: string | undefined;
120
105
  tag?: string | undefined;
@@ -126,7 +111,7 @@ export declare const ServiceCloudConfig: t.Intersection<t.Codec<{
126
111
  } | undefined;
127
112
  database?: string | undefined;
128
113
  } & {
129
- type: import("@powersync/management-types").ConnectionType.POSTGRES;
114
+ type: managementTypes.ConnectionType.POSTGRES;
130
115
  uri?: string | undefined;
131
116
  vpc_endpoint_hostname?: string | undefined;
132
117
  hostname?: string | undefined;
@@ -192,7 +177,7 @@ export declare const ServiceCloudConfig: t.Intersection<t.Codec<{
192
177
  region: string;
193
178
  replication?: {
194
179
  connections?: (({
195
- type: import("@powersync/management-types").ConnectionType;
180
+ type: managementTypes.ConnectionType;
196
181
  name?: string | undefined;
197
182
  id?: string | undefined;
198
183
  tag?: string | undefined;
@@ -204,12 +189,12 @@ export declare const ServiceCloudConfig: t.Intersection<t.Codec<{
204
189
  } | undefined;
205
190
  database?: string | undefined;
206
191
  } & {
207
- type: import("@powersync/management-types").ConnectionType.MONGODB;
192
+ type: managementTypes.ConnectionType.MONGODB;
208
193
  uri: string;
209
194
  post_images?: "off" | "auto_configure" | "read_only" | undefined;
210
195
  vpc_endpoint_hostname?: string | undefined;
211
196
  }) | ({
212
- type: import("@powersync/management-types").ConnectionType;
197
+ type: managementTypes.ConnectionType;
213
198
  name?: string | undefined;
214
199
  id?: string | undefined;
215
200
  tag?: string | undefined;
@@ -221,57 +206,33 @@ export declare const ServiceCloudConfig: t.Intersection<t.Codec<{
221
206
  } | undefined;
222
207
  database?: string | undefined;
223
208
  } & {
224
- type: import("@powersync/management-types").ConnectionType.MSSQL;
209
+ type: managementTypes.ConnectionType.MSSQL;
225
210
  uri?: string | undefined;
226
211
  hostname?: string | undefined;
227
212
  port?: number | undefined;
228
213
  schema?: string | undefined;
229
- authentication?: ({
214
+ authentication?: {
230
215
  type: "default";
231
- options: {
232
- password: string;
233
- userName: string;
234
- };
235
- } & {
236
216
  options: {
237
217
  password: {
238
218
  secret: string;
239
219
  } | {
240
220
  secret_ref: string;
241
221
  };
242
- };
243
- }) | ({
244
- type: "azure-active-directory-password";
245
- options: {
246
- password: string;
247
222
  userName: string;
248
- clientId: string;
249
- tenantId: string;
250
- };
251
- } & {
252
- options: {
253
- password: {
254
- secret: string;
255
- } | {
256
- secret_ref: string;
257
- };
258
223
  };
259
- }) | ({
224
+ } | {
260
225
  type: "azure-active-directory-service-principal-secret";
261
226
  options: {
262
227
  clientId: string;
263
- tenantId: string;
264
- clientSecret: string;
265
- };
266
- } & {
267
- options: {
268
228
  clientSecret: {
269
229
  secret: string;
270
230
  } | {
271
231
  secret_ref: string;
272
232
  };
233
+ tenantId: string;
273
234
  };
274
- }) | undefined;
235
+ } | undefined;
275
236
  additionalConfig?: {
276
237
  pollingIntervalMs?: number | undefined;
277
238
  pollingBatchSize?: number | undefined;
@@ -279,7 +240,7 @@ export declare const ServiceCloudConfig: t.Intersection<t.Codec<{
279
240
  } | undefined;
280
241
  debug_api?: boolean | undefined;
281
242
  }) | ({
282
- type: import("@powersync/management-types").ConnectionType;
243
+ type: managementTypes.ConnectionType;
283
244
  name?: string | undefined;
284
245
  id?: string | undefined;
285
246
  tag?: string | undefined;
@@ -291,7 +252,7 @@ export declare const ServiceCloudConfig: t.Intersection<t.Codec<{
291
252
  } | undefined;
292
253
  database?: string | undefined;
293
254
  } & {
294
- type: import("@powersync/management-types").ConnectionType.MYSQL;
255
+ type: managementTypes.ConnectionType.MYSQL;
295
256
  uri?: string | undefined;
296
257
  hostname?: string | undefined;
297
258
  port?: number | undefined;
@@ -303,7 +264,7 @@ export declare const ServiceCloudConfig: t.Intersection<t.Codec<{
303
264
  secret_ref: string;
304
265
  } | undefined;
305
266
  }) | ({
306
- type: import("@powersync/management-types").ConnectionType;
267
+ type: managementTypes.ConnectionType;
307
268
  name?: string | undefined;
308
269
  id?: string | undefined;
309
270
  tag?: string | undefined;
@@ -315,7 +276,7 @@ export declare const ServiceCloudConfig: t.Intersection<t.Codec<{
315
276
  } | undefined;
316
277
  database?: string | undefined;
317
278
  } & {
318
- type: import("@powersync/management-types").ConnectionType.POSTGRES;
279
+ type: managementTypes.ConnectionType.POSTGRES;
319
280
  uri?: string | undefined;
320
281
  vpc_endpoint_hostname?: string | undefined;
321
282
  hostname?: string | undefined;
@@ -1,10 +1,11 @@
1
- import { BasePowerSyncHostedConfig } from '@powersync/management-types';
1
+ import * as managementTypes from '@powersync/management-types';
2
2
  import { configFile } from '@powersync/service-types';
3
3
  import * as t from 'ts-codec';
4
- export const ServiceCloudConfig = BasePowerSyncHostedConfig.and(t.object({
4
+ export const AdditionalCloudConfigFields = t.object({
5
5
  /** Discriminator for Cloud config. */
6
6
  _type: t.literal('cloud'),
7
7
  /** Instance display name. */
8
8
  name: t.string
9
- }));
9
+ });
10
+ export const ServiceCloudConfig = managementTypes.BasePowerSyncHostedConfig.and(AdditionalCloudConfigFields);
10
11
  export const ServiceCloudConfigSchema = t.generateJSONSchema(ServiceCloudConfig, { parsers: [configFile.portParser] });
@@ -385,6 +385,9 @@
385
385
  "options": {
386
386
  "type": "object",
387
387
  "properties": {
388
+ "userName": {
389
+ "type": "string"
390
+ },
388
391
  "password": {
389
392
  "anyOf": [
390
393
  {
@@ -416,57 +419,7 @@
416
419
  },
417
420
  "additionalProperties": false,
418
421
  "required": [
419
- "password"
420
- ]
421
- }
422
- },
423
- "additionalProperties": false,
424
- "required": [
425
- "type",
426
- "options"
427
- ]
428
- },
429
- {
430
- "type": "object",
431
- "properties": {
432
- "type": {
433
- "type": "string",
434
- "const": "azure-active-directory-password"
435
- },
436
- "options": {
437
- "type": "object",
438
- "properties": {
439
- "password": {
440
- "anyOf": [
441
- {
442
- "type": "object",
443
- "properties": {
444
- "secret_ref": {
445
- "type": "string"
446
- }
447
- },
448
- "additionalProperties": false,
449
- "required": [
450
- "secret_ref"
451
- ]
452
- },
453
- {
454
- "type": "object",
455
- "properties": {
456
- "secret": {
457
- "type": "string"
458
- }
459
- },
460
- "additionalProperties": false,
461
- "required": [
462
- "secret"
463
- ]
464
- }
465
- ]
466
- }
467
- },
468
- "additionalProperties": false,
469
- "required": [
422
+ "userName",
470
423
  "password"
471
424
  ]
472
425
  }
@@ -487,6 +440,9 @@
487
440
  "options": {
488
441
  "type": "object",
489
442
  "properties": {
443
+ "clientId": {
444
+ "type": "string"
445
+ },
490
446
  "clientSecret": {
491
447
  "anyOf": [
492
448
  {
@@ -514,11 +470,16 @@
514
470
  ]
515
471
  }
516
472
  ]
473
+ },
474
+ "tenantId": {
475
+ "type": "string"
517
476
  }
518
477
  },
519
478
  "additionalProperties": false,
520
479
  "required": [
521
- "clientSecret"
480
+ "clientId",
481
+ "clientSecret",
482
+ "tenantId"
522
483
  ]
523
484
  }
524
485
  },
@@ -1065,44 +1026,6 @@
1065
1026
  "options"
1066
1027
  ]
1067
1028
  },
1068
- {
1069
- "type": "object",
1070
- "properties": {
1071
- "type": {
1072
- "type": "string",
1073
- "const": "azure-active-directory-password"
1074
- },
1075
- "options": {
1076
- "type": "object",
1077
- "properties": {
1078
- "userName": {
1079
- "type": "string"
1080
- },
1081
- "password": {
1082
- "type": "string"
1083
- },
1084
- "clientId": {
1085
- "type": "string"
1086
- },
1087
- "tenantId": {
1088
- "type": "string"
1089
- }
1090
- },
1091
- "additionalProperties": true,
1092
- "required": [
1093
- "userName",
1094
- "password",
1095
- "clientId",
1096
- "tenantId"
1097
- ]
1098
- }
1099
- },
1100
- "additionalProperties": true,
1101
- "required": [
1102
- "type",
1103
- "options"
1104
- ]
1105
- },
1106
1029
  {
1107
1030
  "type": "object",
1108
1031
  "properties": {
@@ -61,6 +61,15 @@
61
61
  }
62
62
  }
63
63
  },
64
+ "with": {
65
+ "type": "object",
66
+ "description": "Common-table expressions available to all sync streams",
67
+ "patternProperties": {
68
+ ".*": {
69
+ "type": "string"
70
+ }
71
+ }
72
+ },
64
73
  "streams": {
65
74
  "type": "object",
66
75
  "description": "List of stream definitions",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@powersync/cli-schemas",
3
3
  "description": "PowerSync CLI schema definitions and JSON Schema generation",
4
- "version": "0.9.2",
4
+ "version": "0.9.3",
5
5
  "author": "POWERSYNC",
6
6
  "license": "FSL-1.1-ALv2",
7
7
  "type": "module",
@@ -32,15 +32,15 @@
32
32
  },
33
33
  "bugs": "https://github.com/powersync-ja/powersync-cli/issues",
34
34
  "dependencies": {
35
- "@powersync/management-types": "^0.0.3",
36
- "@powersync/service-schema": "^1.20.1",
35
+ "@powersync/management-types": "^0.0.5",
36
+ "@powersync/service-schema": "^1.20.2",
37
37
  "@powersync/service-types": "^0.15.0",
38
38
  "ajv": "^8.12.0",
39
39
  "better-ajv-errors": "^2.0.3",
40
40
  "ts-codec": "^1.3.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@powersync/service-sync-rules": "^0.32.0",
43
+ "@powersync/service-sync-rules": "^0.34.0",
44
44
  "@types/node": "^22",
45
45
  "shx": "^0.3.3",
46
46
  "tsx": "^4",