@powersync/cli-schemas 0.0.0-dev-20260305082615
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +67 -0
- package/README.md +5 -0
- package/dist/CLIConfig.d.ts +49 -0
- package/dist/CLIConfig.js +28 -0
- package/dist/ServiceCloudConfig.d.ts +388 -0
- package/dist/ServiceCloudConfig.js +10 -0
- package/dist/ServiceConfig.d.ts +4 -0
- package/dist/ServiceConfig.js +6 -0
- package/dist/ServiceSelfHostedConfig.d.ts +395 -0
- package/dist/ServiceSelfHostedConfig.js +27 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/scripts/create-schemas.d.ts +1 -0
- package/dist/scripts/create-schemas.js +12 -0
- package/dist/validators.d.ts +93 -0
- package/dist/validators.js +55 -0
- package/json-schema/cli-config.json +52 -0
- package/json-schema/service-config.json +2042 -0
- package/json-schema/sync-config.json +214 -0
- package/package.json +57 -0
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "object",
|
|
3
|
+
"properties": {
|
|
4
|
+
"bucket_definitions": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"description": "List of bucket definitions",
|
|
7
|
+
"examples": [
|
|
8
|
+
{
|
|
9
|
+
"global": {
|
|
10
|
+
"data": "select * from mytable"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"patternProperties": {
|
|
15
|
+
".*": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"required": [
|
|
18
|
+
"data"
|
|
19
|
+
],
|
|
20
|
+
"examples": [
|
|
21
|
+
{
|
|
22
|
+
"data": [
|
|
23
|
+
"select * from mytable"
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"properties": {
|
|
28
|
+
"accept_potentially_dangerous_queries": {
|
|
29
|
+
"description": "If true, disables warnings on potentially dangerous queries",
|
|
30
|
+
"type": "boolean"
|
|
31
|
+
},
|
|
32
|
+
"priority": {
|
|
33
|
+
"description": "Priority for the bucket (lower values indicate higher priority).",
|
|
34
|
+
"type": "integer"
|
|
35
|
+
},
|
|
36
|
+
"parameters": {
|
|
37
|
+
"description": "Parameter query(ies)",
|
|
38
|
+
"anyOf": [
|
|
39
|
+
{
|
|
40
|
+
"type": "string",
|
|
41
|
+
"description": "Parameter query"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"type": "array",
|
|
45
|
+
"description": "Parameter queries",
|
|
46
|
+
"items": {
|
|
47
|
+
"type": "string"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
"data": {
|
|
53
|
+
"type": "array",
|
|
54
|
+
"description": "Data queries",
|
|
55
|
+
"items": {
|
|
56
|
+
"type": "string"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"additionalProperties": false
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"streams": {
|
|
65
|
+
"type": "object",
|
|
66
|
+
"description": "List of stream definitions",
|
|
67
|
+
"examples": [
|
|
68
|
+
{
|
|
69
|
+
"user_details": {
|
|
70
|
+
"query": "select * from users where id = auth.user_id()"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"patternProperties": {
|
|
75
|
+
".*": {
|
|
76
|
+
"type": "object",
|
|
77
|
+
"examples": [
|
|
78
|
+
{
|
|
79
|
+
"query": [
|
|
80
|
+
"select * from mytable"
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
"properties": {
|
|
85
|
+
"accept_potentially_dangerous_queries": {
|
|
86
|
+
"description": "If true, disables warnings on potentially dangerous queries",
|
|
87
|
+
"type": "boolean"
|
|
88
|
+
},
|
|
89
|
+
"auto_subscribe": {
|
|
90
|
+
"description": "Whether clients will subscribe to this stream by default.",
|
|
91
|
+
"type": "boolean"
|
|
92
|
+
},
|
|
93
|
+
"priority": {
|
|
94
|
+
"description": "Priority for the bucket (lower values indicate higher priority).",
|
|
95
|
+
"type": "integer"
|
|
96
|
+
},
|
|
97
|
+
"query": {
|
|
98
|
+
"description": "The SQL query defining content to sync in this stream.",
|
|
99
|
+
"type": "string"
|
|
100
|
+
},
|
|
101
|
+
"queries": {
|
|
102
|
+
"description": "SQL queries defining content to sync in this stream.",
|
|
103
|
+
"type": "array",
|
|
104
|
+
"items": {
|
|
105
|
+
"type": "string"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"with": {
|
|
109
|
+
"type": "object",
|
|
110
|
+
"description": "Common table expressions defining subqueries available in queries.",
|
|
111
|
+
"patternProperties": {
|
|
112
|
+
".*": {
|
|
113
|
+
"type": "string"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"event_definitions": {
|
|
122
|
+
"type": "object",
|
|
123
|
+
"description": "Record of sync replication event definitions",
|
|
124
|
+
"examples": [
|
|
125
|
+
{
|
|
126
|
+
"write_checkpoints": {
|
|
127
|
+
"payloads": [
|
|
128
|
+
"select user_id, client_id, checkpoint from checkpoints"
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
],
|
|
133
|
+
"patternProperties": {
|
|
134
|
+
".*": {
|
|
135
|
+
"type": [
|
|
136
|
+
"object"
|
|
137
|
+
],
|
|
138
|
+
"required": [
|
|
139
|
+
"payloads"
|
|
140
|
+
],
|
|
141
|
+
"examples": [
|
|
142
|
+
{
|
|
143
|
+
"payloads": [
|
|
144
|
+
"select user_id, client_id, checkpoint from checkpoints"
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
"properties": {
|
|
149
|
+
"payloads": {
|
|
150
|
+
"description": "Queries which extract event payload fields from replicated table rows.",
|
|
151
|
+
"type": "array",
|
|
152
|
+
"items": {
|
|
153
|
+
"type": "string"
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"additionalProperties": false,
|
|
157
|
+
"uniqueItems": true
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
"config": {
|
|
163
|
+
"type": "object",
|
|
164
|
+
"description": "Config declaring the compatibility level used to parse these definitions.",
|
|
165
|
+
"properties": {
|
|
166
|
+
"edition": {
|
|
167
|
+
"type": "integer",
|
|
168
|
+
"default": 1,
|
|
169
|
+
"minimum": 1,
|
|
170
|
+
"exclusiveMaximum": 4
|
|
171
|
+
},
|
|
172
|
+
"timestamp_max_precision": {
|
|
173
|
+
"type": "string",
|
|
174
|
+
"enum": [
|
|
175
|
+
"seconds",
|
|
176
|
+
"milliseconds",
|
|
177
|
+
"microseconds",
|
|
178
|
+
"nanoseconds"
|
|
179
|
+
]
|
|
180
|
+
},
|
|
181
|
+
"timestamps_iso8601": {
|
|
182
|
+
"type": "boolean",
|
|
183
|
+
"description": "Enabled by default starting from edition 2: Consistently renders timestamps with an ISO 8601-compatible format (previous versions used a space instead of a T to separate date and time)."
|
|
184
|
+
},
|
|
185
|
+
"versioned_bucket_ids": {
|
|
186
|
+
"type": "boolean",
|
|
187
|
+
"description": "Enabled by default starting from edition 2: Encode the version of sync rules in generated bucket ids, which avoids clients downloading data twice and improves client-side progress estimates."
|
|
188
|
+
},
|
|
189
|
+
"fixed_json_extract": {
|
|
190
|
+
"type": "boolean",
|
|
191
|
+
"description": "Enabled by default starting from edition 2: Old versions of the sync service used to treat `->> 'foo.bar'` as a two-element JSON path. With this compatibility option enabled, it follows modern SQLite and treats it as a single key. The `$.` prefix would be required to split on `.`."
|
|
192
|
+
},
|
|
193
|
+
"custom_postgres_types": {
|
|
194
|
+
"type": "boolean",
|
|
195
|
+
"description": "Enabled by default starting from edition 2: Map custom Postgres types into appropriate structures instead of syncing the raw string."
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
"additionalProperties": false
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
"anyOf": [
|
|
202
|
+
{
|
|
203
|
+
"required": [
|
|
204
|
+
"bucket_definitions"
|
|
205
|
+
]
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"required": [
|
|
209
|
+
"streams"
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
],
|
|
213
|
+
"additionalProperties": false
|
|
214
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@powersync/cli-schemas",
|
|
3
|
+
"description": "PowerSync CLI schema definitions and JSON Schema generation",
|
|
4
|
+
"version": "0.0.0-dev-20260305082615",
|
|
5
|
+
"author": "POWERSYNC",
|
|
6
|
+
"license": "FSL-1.1-ALv2",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"json-schema"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"import": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"default": "./dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./cli-config-schema.json": "./json-schema/cli-config.json",
|
|
21
|
+
"./link-config-schema.json": "./json-schema/cli-config.json",
|
|
22
|
+
"./service-config-schema.json": "./json-schema/service-config.json",
|
|
23
|
+
"./sync-config-schema.json": "./json-schema/sync-config.json"
|
|
24
|
+
},
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "https://github.com/powersync-ja/powersync-cli"
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public",
|
|
31
|
+
"registry": "https://registry.npmjs.org/"
|
|
32
|
+
},
|
|
33
|
+
"bugs": "https://github.com/powersync-ja/powersync-cli/issues",
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"ajv": "^8.12.0",
|
|
36
|
+
"better-ajv-errors": "^2.0.3",
|
|
37
|
+
"ts-codec": "^1.3.0",
|
|
38
|
+
"@powersync/service-types": "^0.15.0",
|
|
39
|
+
"@powersync/service-schema": "^1.20.0",
|
|
40
|
+
"@powersync/management-types": "^0.0.3"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@powersync/service-sync-rules": "^0.32.0",
|
|
44
|
+
"@types/node": "^22",
|
|
45
|
+
"shx": "^0.3.3",
|
|
46
|
+
"tsx": "^4",
|
|
47
|
+
"typescript": "^5"
|
|
48
|
+
},
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">=18.0.0"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "tsc -b && node dist/scripts/create-schemas.js",
|
|
54
|
+
"clean": "rm -rf dist tsconfig.tsbuildinfo",
|
|
55
|
+
"lint": "eslint ."
|
|
56
|
+
}
|
|
57
|
+
}
|