@powersync/service-types 0.0.0-dev-20260313100403 → 0.0.0-dev-20260803144812
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/CHANGELOG.md +29 -2
- package/dist/config/PowerSyncConfig.d.ts +23 -15
- package/dist/config/PowerSyncConfig.js +57 -78
- package/dist/config/PowerSyncConfig.js.map +1 -1
- package/dist/definitions.d.ts +16 -0
- package/dist/definitions.js +36 -56
- package/dist/definitions.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -45
- package/dist/index.js.map +1 -1
- package/dist/metrics.js +6 -9
- package/dist/metrics.js.map +1 -1
- package/dist/reports.d.ts +2 -2
- package/dist/reports.js +2 -5
- package/dist/reports.js.map +1 -1
- package/dist/routes.d.ts +21 -6
- package/dist/routes.js +20 -56
- package/dist/routes.js.map +1 -1
- package/package.json +3 -3
- package/src/config/PowerSyncConfig.ts +25 -5
- package/src/definitions.ts +19 -0
- package/src/index.ts +2 -2
- package/src/reports.ts +2 -2
- package/src/routes.ts +6 -6
- package/tsconfig.json +1 -3
- package/tsconfig.tsbuildinfo +1 -1
package/dist/definitions.js
CHANGED
|
@@ -1,52 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.InstanceSchema = exports.DatabaseSchema = exports.TableSchema = exports.SqliteSchemaTypeText = exports.ConnectionStatusV2 = exports.ConnectionStatus = exports.SyncRulesStatus = exports.TableInfo = exports.ReplicationError = exports.SourceSpan = void 0;
|
|
37
|
-
const t = __importStar(require("ts-codec"));
|
|
38
|
-
exports.SourceSpan = t.object({
|
|
1
|
+
import * as t from 'ts-codec';
|
|
2
|
+
export const SourceSpan = t.object({
|
|
39
3
|
start_offset: t.number,
|
|
40
4
|
end_offset: t.number
|
|
41
5
|
});
|
|
42
|
-
|
|
6
|
+
export const ReplicationError = t.object({
|
|
43
7
|
/** Warning: Could indicate an issue. Fatal: Prevents replicating. */
|
|
44
8
|
level: t.literal('warning').or(t.literal('fatal')),
|
|
45
9
|
message: t.string,
|
|
46
|
-
location:
|
|
10
|
+
location: SourceSpan.optional(),
|
|
47
11
|
ts: t.string.optional()
|
|
48
12
|
});
|
|
49
|
-
|
|
13
|
+
export const TableInfo = t.object({
|
|
50
14
|
schema: t.string,
|
|
51
15
|
name: t.string,
|
|
52
16
|
/** Specified if this table is part of a wildcard pattern. */
|
|
@@ -58,9 +22,9 @@ exports.TableInfo = t.object({
|
|
|
58
22
|
/** Used for parameter query replication */
|
|
59
23
|
parameter_queries: t.boolean,
|
|
60
24
|
/** Also included in the global errors array. */
|
|
61
|
-
errors: t.array(
|
|
25
|
+
errors: t.array(ReplicationError)
|
|
62
26
|
});
|
|
63
|
-
|
|
27
|
+
export const SyncRulesStatus = t.object({
|
|
64
28
|
content: t.string.optional(),
|
|
65
29
|
connections: t.array(t.object({
|
|
66
30
|
id: t.string,
|
|
@@ -91,26 +55,42 @@ exports.SyncRulesStatus = t.object({
|
|
|
91
55
|
last_checkpoint_ts: t.string.optional(),
|
|
92
56
|
/** Replication lag in bytes. undefined if we cannot calculate this. */
|
|
93
57
|
replication_lag_bytes: t.number.optional(),
|
|
94
|
-
|
|
58
|
+
/**
|
|
59
|
+
* Replication slot WAL status (PG 13+).
|
|
60
|
+
* Values: 'reserved', 'extended', 'unreserved', 'lost'.
|
|
61
|
+
* Undefined for non-Postgres sources or PG < 13.
|
|
62
|
+
*/
|
|
63
|
+
wal_status: t.string.optional(),
|
|
64
|
+
/**
|
|
65
|
+
* WAL budget remaining in bytes before potential slot invalidation
|
|
66
|
+
* (PG 13+, only when max_slot_wal_keep_size is set).
|
|
67
|
+
*/
|
|
68
|
+
safe_wal_size: t.number.optional(),
|
|
69
|
+
/**
|
|
70
|
+
* Configured max_slot_wal_keep_size in bytes (PG 13+).
|
|
71
|
+
* Undefined when unlimited (-1) or not available.
|
|
72
|
+
*/
|
|
73
|
+
max_slot_wal_keep_size: t.number.optional(),
|
|
74
|
+
tables: t.array(TableInfo)
|
|
95
75
|
})),
|
|
96
76
|
/** Sync-rule-level errors */
|
|
97
|
-
errors: t.array(
|
|
77
|
+
errors: t.array(ReplicationError)
|
|
98
78
|
});
|
|
99
|
-
|
|
79
|
+
export const ConnectionStatus = t.object({
|
|
100
80
|
id: t.string,
|
|
101
81
|
postgres_uri: t.string,
|
|
102
82
|
connected: t.boolean,
|
|
103
83
|
/** Connection-level errors */
|
|
104
|
-
errors: t.array(
|
|
84
|
+
errors: t.array(ReplicationError)
|
|
105
85
|
});
|
|
106
|
-
|
|
86
|
+
export const ConnectionStatusV2 = t.object({
|
|
107
87
|
id: t.string,
|
|
108
88
|
uri: t.string,
|
|
109
89
|
connected: t.boolean,
|
|
110
90
|
/** Connection-level errors */
|
|
111
|
-
errors: t.array(
|
|
91
|
+
errors: t.array(ReplicationError)
|
|
112
92
|
});
|
|
113
|
-
var SqliteSchemaTypeText;
|
|
93
|
+
export var SqliteSchemaTypeText;
|
|
114
94
|
(function (SqliteSchemaTypeText) {
|
|
115
95
|
SqliteSchemaTypeText["null"] = "null";
|
|
116
96
|
SqliteSchemaTypeText["blob"] = "blob";
|
|
@@ -118,8 +98,8 @@ var SqliteSchemaTypeText;
|
|
|
118
98
|
SqliteSchemaTypeText["integer"] = "integer";
|
|
119
99
|
SqliteSchemaTypeText["real"] = "real";
|
|
120
100
|
SqliteSchemaTypeText["numeric"] = "numeric";
|
|
121
|
-
})(SqliteSchemaTypeText || (
|
|
122
|
-
|
|
101
|
+
})(SqliteSchemaTypeText || (SqliteSchemaTypeText = {}));
|
|
102
|
+
export const TableSchema = t.object({
|
|
123
103
|
name: t.string,
|
|
124
104
|
columns: t.array(t.object({
|
|
125
105
|
name: t.string,
|
|
@@ -148,15 +128,15 @@ exports.TableSchema = t.object({
|
|
|
148
128
|
pg_type: t.string
|
|
149
129
|
}))
|
|
150
130
|
});
|
|
151
|
-
|
|
131
|
+
export const DatabaseSchema = t.object({
|
|
152
132
|
name: t.string,
|
|
153
|
-
tables: t.array(
|
|
133
|
+
tables: t.array(TableSchema)
|
|
154
134
|
});
|
|
155
|
-
|
|
135
|
+
export const InstanceSchema = t.object({
|
|
156
136
|
connections: t.array(t.object({
|
|
157
137
|
id: t.string.optional(),
|
|
158
138
|
tag: t.string,
|
|
159
|
-
schemas: t.array(
|
|
139
|
+
schemas: t.array(DatabaseSchema)
|
|
160
140
|
})),
|
|
161
141
|
defaultConnectionTag: t.string,
|
|
162
142
|
defaultSchema: t.string
|
package/dist/definitions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../src/definitions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../src/definitions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,YAAY,EAAE,CAAC,CAAC,MAAM;IACtB,UAAU,EAAE,CAAC,CAAC,MAAM;CACrB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,qEAAqE;IACrE,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAClD,OAAO,EAAE,CAAC,CAAC,MAAM;IACjB,QAAQ,EAAE,UAAU,CAAC,QAAQ,EAAE;IAC/B,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE;CACxB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,MAAM,EAAE,CAAC,CAAC,MAAM;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM;IAEd,6DAA6D;IAC7D,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE;IAE5B,0BAA0B;IAC1B,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;IACjC,+BAA+B;IAC/B,YAAY,EAAE,CAAC,CAAC,OAAO;IACvB,2CAA2C;IAC3C,iBAAiB,EAAE,CAAC,CAAC,OAAO;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C,IAAI,EAAE,CAAC,CAAC,MAAM;IACd,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC;CAC7B,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,WAAW,EAAE,CAAC,CAAC,KAAK,CAClB,CAAC,CAAC,MAAM,CAAC;QACP,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE;QACvB,GAAG,EAAE,CAAC,CAAC,MAAM;QACb,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC;KACjC,CAAC,CACH;IACD,oBAAoB,EAAE,CAAC,CAAC,MAAM;IAC9B,aAAa,EAAE,CAAC,CAAC,MAAM;CACxB,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * as configFile from './config/PowerSyncConfig.js';
|
|
2
2
|
export * from './definitions.js';
|
|
3
|
-
export * as internal_routes from './routes.js';
|
|
4
3
|
export * from './metrics.js';
|
|
5
4
|
export * as metric_types from './metrics.js';
|
|
6
|
-
export * as event_types from './reports';
|
|
5
|
+
export * as event_types from './reports.js';
|
|
6
|
+
export * as internal_routes from './routes.js';
|
package/dist/index.js
CHANGED
|
@@ -1,46 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
36
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.event_types = exports.metric_types = exports.internal_routes = exports.configFile = void 0;
|
|
40
|
-
exports.configFile = __importStar(require("./config/PowerSyncConfig.js"));
|
|
41
|
-
__exportStar(require("./definitions.js"), exports);
|
|
42
|
-
exports.internal_routes = __importStar(require("./routes.js"));
|
|
43
|
-
__exportStar(require("./metrics.js"), exports);
|
|
44
|
-
exports.metric_types = __importStar(require("./metrics.js"));
|
|
45
|
-
exports.event_types = __importStar(require("./reports"));
|
|
1
|
+
export * as configFile from './config/PowerSyncConfig.js';
|
|
2
|
+
export * from './definitions.js';
|
|
3
|
+
export * from './metrics.js';
|
|
4
|
+
export * as metric_types from './metrics.js';
|
|
5
|
+
export * as event_types from './reports.js';
|
|
6
|
+
export * as internal_routes from './routes.js';
|
|
46
7
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,6BAA6B,CAAC;AAE1D,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,OAAO,KAAK,YAAY,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,WAAW,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,eAAe,MAAM,aAAa,CAAC"}
|
package/dist/metrics.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StorageMetric = exports.ReplicationMetric = exports.APIMetric = void 0;
|
|
4
|
-
var APIMetric;
|
|
1
|
+
export var APIMetric;
|
|
5
2
|
(function (APIMetric) {
|
|
6
3
|
// Uncompressed size of synced data from PowerSync to Clients
|
|
7
4
|
APIMetric["DATA_SYNCED_BYTES"] = "powersync_data_synced_bytes_total";
|
|
@@ -11,8 +8,8 @@ var APIMetric;
|
|
|
11
8
|
APIMetric["OPERATIONS_SYNCED"] = "powersync_operations_synced_total";
|
|
12
9
|
// Number of concurrent sync connections
|
|
13
10
|
APIMetric["CONCURRENT_CONNECTIONS"] = "powersync_concurrent_connections";
|
|
14
|
-
})(APIMetric || (
|
|
15
|
-
var ReplicationMetric;
|
|
11
|
+
})(APIMetric || (APIMetric = {}));
|
|
12
|
+
export var ReplicationMetric;
|
|
16
13
|
(function (ReplicationMetric) {
|
|
17
14
|
// Uncompressed size of replicated data from data source to PowerSync
|
|
18
15
|
ReplicationMetric["DATA_REPLICATED_BYTES"] = "powersync_data_replicated_bytes_total";
|
|
@@ -25,8 +22,8 @@ var ReplicationMetric;
|
|
|
25
22
|
// Replication lag between the source database and PowerSync instance (estimated).
|
|
26
23
|
// This is estimated, and may have delays in reporting.
|
|
27
24
|
ReplicationMetric["REPLICATION_LAG_SECONDS"] = "powersync_replication_lag_seconds";
|
|
28
|
-
})(ReplicationMetric || (
|
|
29
|
-
var StorageMetric;
|
|
25
|
+
})(ReplicationMetric || (ReplicationMetric = {}));
|
|
26
|
+
export var StorageMetric;
|
|
30
27
|
(function (StorageMetric) {
|
|
31
28
|
// Size of current replication data stored in PowerSync
|
|
32
29
|
StorageMetric["REPLICATION_SIZE_BYTES"] = "powersync_replication_storage_size_bytes";
|
|
@@ -34,5 +31,5 @@ var StorageMetric;
|
|
|
34
31
|
StorageMetric["OPERATION_SIZE_BYTES"] = "powersync_operation_storage_size_bytes";
|
|
35
32
|
// Size of parameter data stored in PowerSync
|
|
36
33
|
StorageMetric["PARAMETER_SIZE_BYTES"] = "powersync_parameter_storage_size_bytes";
|
|
37
|
-
})(StorageMetric || (
|
|
34
|
+
})(StorageMetric || (StorageMetric = {}));
|
|
38
35
|
//# sourceMappingURL=metrics.js.map
|
package/dist/metrics.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metrics.js","sourceRoot":"","sources":["../src/metrics.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"metrics.js","sourceRoot":"","sources":["../src/metrics.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,SASX;AATD,WAAY,SAAS;IACnB,6DAA6D;IAC7D,oEAAuD,CAAA;IACvD,qEAAqE;IACrE,gEAAmD,CAAA;IACnD,8BAA8B;IAC9B,oEAAuD,CAAA;IACvD,wCAAwC;IACxC,wEAA2D,CAAA;AAC7D,CAAC,EATW,SAAS,KAAT,SAAS,QASpB;AAED,MAAM,CAAN,IAAY,iBAYX;AAZD,WAAY,iBAAiB;IAC3B,qEAAqE;IACrE,oFAA+D,CAAA;IAC/D,yDAAyD;IACzD,wEAAmD,CAAA;IACnD,iEAAiE;IACjE,wFAAmE,CAAA;IACnE,4DAA4D;IAC5D,4EAAuD,CAAA;IACvD,kFAAkF;IAClF,uDAAuD;IACvD,kFAA6D,CAAA;AAC/D,CAAC,EAZW,iBAAiB,KAAjB,iBAAiB,QAY5B;AAED,MAAM,CAAN,IAAY,aAOX;AAPD,WAAY,aAAa;IACvB,uDAAuD;IACvD,oFAAmE,CAAA;IACnE,8CAA8C;IAC9C,gFAA+D,CAAA;IAC/D,6CAA6C;IAC7C,gFAA+D,CAAA;AACjE,CAAC,EAPW,aAAa,KAAb,aAAa,QAOxB"}
|
package/dist/reports.d.ts
CHANGED
package/dist/reports.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EventsEngineEventType = void 0;
|
|
4
|
-
var EventsEngineEventType;
|
|
1
|
+
export var EventsEngineEventType;
|
|
5
2
|
(function (EventsEngineEventType) {
|
|
6
3
|
EventsEngineEventType["SDK_CONNECT_EVENT"] = "sdk-connect-event";
|
|
7
4
|
EventsEngineEventType["SDK_DISCONNECT_EVENT"] = "sdk-disconnect-event";
|
|
8
5
|
EventsEngineEventType["SDK_DELETE_OLD"] = "sdk-delete-old";
|
|
9
|
-
})(EventsEngineEventType || (
|
|
6
|
+
})(EventsEngineEventType || (EventsEngineEventType = {}));
|
|
10
7
|
//# sourceMappingURL=reports.js.map
|
package/dist/reports.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reports.js","sourceRoot":"","sources":["../src/reports.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"reports.js","sourceRoot":"","sources":["../src/reports.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,qBAIX;AAJD,WAAY,qBAAqB;IAC/B,gEAAuC,CAAA;IACvC,sEAA6C,CAAA;IAC7C,0DAAiC,CAAA;AACnC,CAAC,EAJW,qBAAqB,KAArB,qBAAqB,QAIhC"}
|
package/dist/routes.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare const GetSchemaResponse: t.ObjectCodec<{
|
|
|
11
11
|
name: t.IdentityCodec<t.CodecType.String>;
|
|
12
12
|
columns: t.ArrayCodec<t.ObjectCodec<{
|
|
13
13
|
name: t.IdentityCodec<t.CodecType.String>;
|
|
14
|
-
sqlite_type: t.Union<t.Codec<number, number, string, t.CodecProps>, t.EnumCodec<typeof import("./definitions").SqliteSchemaTypeText>>;
|
|
14
|
+
sqlite_type: t.Union<t.Codec<number, number, string, t.CodecProps>, t.EnumCodec<typeof import("./definitions.js").SqliteSchemaTypeText>>;
|
|
15
15
|
internal_type: t.IdentityCodec<t.CodecType.String>;
|
|
16
16
|
description: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
17
17
|
type: t.IdentityCodec<t.CodecType.String>;
|
|
@@ -68,9 +68,9 @@ export declare const DiagnosticsResponse: t.ObjectCodec<{
|
|
|
68
68
|
}>>;
|
|
69
69
|
}>>;
|
|
70
70
|
/**
|
|
71
|
-
* Present if there
|
|
71
|
+
* Present if there is a fully deployed sync config.
|
|
72
72
|
*
|
|
73
|
-
* Sync-
|
|
73
|
+
* Sync-config-level errors are listed here.
|
|
74
74
|
*/
|
|
75
75
|
active_sync_rules: t.OptionalCodec<t.Codec<{
|
|
76
76
|
errors: {
|
|
@@ -108,6 +108,9 @@ export declare const DiagnosticsResponse: t.ObjectCodec<{
|
|
|
108
108
|
last_keepalive_ts?: string | undefined;
|
|
109
109
|
last_checkpoint_ts?: string | undefined;
|
|
110
110
|
replication_lag_bytes?: number | undefined;
|
|
111
|
+
wal_status?: string | undefined;
|
|
112
|
+
safe_wal_size?: number | undefined;
|
|
113
|
+
max_slot_wal_keep_size?: number | undefined;
|
|
111
114
|
}[];
|
|
112
115
|
content?: string | undefined;
|
|
113
116
|
}, {
|
|
@@ -146,15 +149,18 @@ export declare const DiagnosticsResponse: t.ObjectCodec<{
|
|
|
146
149
|
last_keepalive_ts?: string | undefined;
|
|
147
150
|
last_checkpoint_ts?: string | undefined;
|
|
148
151
|
replication_lag_bytes?: number | undefined;
|
|
152
|
+
wal_status?: string | undefined;
|
|
153
|
+
safe_wal_size?: number | undefined;
|
|
154
|
+
max_slot_wal_keep_size?: number | undefined;
|
|
149
155
|
}[];
|
|
150
156
|
content?: string | undefined;
|
|
151
157
|
}, string, t.CodecProps>>;
|
|
152
158
|
/**
|
|
153
|
-
* Present if there
|
|
159
|
+
* Present if there is sync config in the process of being deployed / initial replication.
|
|
154
160
|
*
|
|
155
|
-
* Once initial replication is done, this will
|
|
161
|
+
* Once initial replication is done, this will be placed in `active_sync_rules`.
|
|
156
162
|
*
|
|
157
|
-
* Sync-
|
|
163
|
+
* Sync-config-level errors are listed here.
|
|
158
164
|
*/
|
|
159
165
|
deploying_sync_rules: t.OptionalCodec<t.Codec<{
|
|
160
166
|
errors: {
|
|
@@ -192,6 +198,9 @@ export declare const DiagnosticsResponse: t.ObjectCodec<{
|
|
|
192
198
|
last_keepalive_ts?: string | undefined;
|
|
193
199
|
last_checkpoint_ts?: string | undefined;
|
|
194
200
|
replication_lag_bytes?: number | undefined;
|
|
201
|
+
wal_status?: string | undefined;
|
|
202
|
+
safe_wal_size?: number | undefined;
|
|
203
|
+
max_slot_wal_keep_size?: number | undefined;
|
|
195
204
|
}[];
|
|
196
205
|
content?: string | undefined;
|
|
197
206
|
}, {
|
|
@@ -230,6 +239,9 @@ export declare const DiagnosticsResponse: t.ObjectCodec<{
|
|
|
230
239
|
last_keepalive_ts?: string | undefined;
|
|
231
240
|
last_checkpoint_ts?: string | undefined;
|
|
232
241
|
replication_lag_bytes?: number | undefined;
|
|
242
|
+
wal_status?: string | undefined;
|
|
243
|
+
safe_wal_size?: number | undefined;
|
|
244
|
+
max_slot_wal_keep_size?: number | undefined;
|
|
233
245
|
}[];
|
|
234
246
|
content?: string | undefined;
|
|
235
247
|
}, string, t.CodecProps>>;
|
|
@@ -260,6 +272,9 @@ export declare const ValidateResponse: t.ObjectCodec<{
|
|
|
260
272
|
last_keepalive_ts: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
261
273
|
last_checkpoint_ts: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
262
274
|
replication_lag_bytes: t.OptionalCodec<t.Codec<number, number, string, t.CodecProps>>;
|
|
275
|
+
wal_status: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
276
|
+
safe_wal_size: t.OptionalCodec<t.Codec<number, number, string, t.CodecProps>>;
|
|
277
|
+
max_slot_wal_keep_size: t.OptionalCodec<t.Codec<number, number, string, t.CodecProps>>;
|
|
263
278
|
tables: t.ArrayCodec<t.ObjectCodec<{
|
|
264
279
|
schema: t.IdentityCodec<t.CodecType.String>;
|
|
265
280
|
name: t.IdentityCodec<t.CodecType.String>;
|
package/dist/routes.js
CHANGED
|
@@ -1,51 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.ValidateResponse = exports.ValidateRequest = exports.ReprocessResponse = exports.ReprocessRequest = exports.DiagnosticsResponse = exports.DiagnosticsRequest = exports.ExecuteSqlResponse = exports.ExecuteSqlRequest = exports.GetSchemaResponse = exports.GetSchemaRequest = void 0;
|
|
37
|
-
const t = __importStar(require("ts-codec"));
|
|
38
|
-
const definitions_1 = require("./definitions");
|
|
39
|
-
exports.GetSchemaRequest = t.object({});
|
|
40
|
-
exports.GetSchemaResponse = definitions_1.InstanceSchema;
|
|
41
|
-
exports.ExecuteSqlRequest = t.object({
|
|
1
|
+
import * as t from 'ts-codec';
|
|
2
|
+
import { ConnectionStatus, InstanceSchema, SyncRulesStatus } from './definitions.js';
|
|
3
|
+
export const GetSchemaRequest = t.object({});
|
|
4
|
+
export const GetSchemaResponse = InstanceSchema;
|
|
5
|
+
export const ExecuteSqlRequest = t.object({
|
|
42
6
|
connection_id: t.string.optional(),
|
|
43
7
|
sql: t.object({
|
|
44
8
|
query: t.string,
|
|
45
9
|
args: t.array(t.string.or(t.number).or(t.boolean))
|
|
46
10
|
})
|
|
47
11
|
});
|
|
48
|
-
|
|
12
|
+
export const ExecuteSqlResponse = t.object({
|
|
49
13
|
success: t.boolean,
|
|
50
14
|
results: t.object({
|
|
51
15
|
columns: t.array(t.string),
|
|
@@ -54,39 +18,39 @@ exports.ExecuteSqlResponse = t.object({
|
|
|
54
18
|
/** Set if success = false */
|
|
55
19
|
error: t.string.optional()
|
|
56
20
|
});
|
|
57
|
-
|
|
21
|
+
export const DiagnosticsRequest = t.object({
|
|
58
22
|
sync_rules_content: t.boolean.optional()
|
|
59
23
|
});
|
|
60
|
-
|
|
24
|
+
export const DiagnosticsResponse = t.object({
|
|
61
25
|
/**
|
|
62
26
|
* Connection-level errors are listed here.
|
|
63
27
|
*/
|
|
64
|
-
connections: t.array(
|
|
28
|
+
connections: t.array(ConnectionStatus),
|
|
65
29
|
/**
|
|
66
|
-
* Present if there
|
|
30
|
+
* Present if there is a fully deployed sync config.
|
|
67
31
|
*
|
|
68
|
-
* Sync-
|
|
32
|
+
* Sync-config-level errors are listed here.
|
|
69
33
|
*/
|
|
70
|
-
active_sync_rules:
|
|
34
|
+
active_sync_rules: SyncRulesStatus.optional(),
|
|
71
35
|
/**
|
|
72
|
-
* Present if there
|
|
36
|
+
* Present if there is sync config in the process of being deployed / initial replication.
|
|
73
37
|
*
|
|
74
|
-
* Once initial replication is done, this will
|
|
38
|
+
* Once initial replication is done, this will be placed in `active_sync_rules`.
|
|
75
39
|
*
|
|
76
|
-
* Sync-
|
|
40
|
+
* Sync-config-level errors are listed here.
|
|
77
41
|
*/
|
|
78
|
-
deploying_sync_rules:
|
|
42
|
+
deploying_sync_rules: SyncRulesStatus.optional()
|
|
79
43
|
});
|
|
80
|
-
|
|
81
|
-
|
|
44
|
+
export const ReprocessRequest = t.object({});
|
|
45
|
+
export const ReprocessResponse = t.object({
|
|
82
46
|
connections: t.array(t.object({
|
|
83
47
|
id: t.string.optional(),
|
|
84
48
|
tag: t.string,
|
|
85
49
|
slot_name: t.string
|
|
86
50
|
}))
|
|
87
51
|
});
|
|
88
|
-
|
|
52
|
+
export const ValidateRequest = t.object({
|
|
89
53
|
sync_rules: t.string
|
|
90
54
|
});
|
|
91
|
-
|
|
55
|
+
export const ValidateResponse = SyncRulesStatus;
|
|
92
56
|
//# sourceMappingURL=routes.js.map
|
package/dist/routes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"routes.js","sourceRoot":"","sources":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AAC,MAAM,CAAC;IACzC,kBAAkB,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE;CACzC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C;;OAEG;IACH,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC;IAEtC;;;;OAIG;IACH,iBAAiB,EAAE,eAAe,CAAC,QAAQ,EAAE;IAE7C;;;;;;OAMG;IACH,oBAAoB,EAAE,eAAe,CAAC,QAAQ,EAAE;CACjD,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAG7C,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,WAAW,EAAE,CAAC,CAAC,KAAK,CAClB,CAAC,CAAC,MAAM,CAAC;QACP,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE;QACvB,GAAG,EAAE,CAAC,CAAC,MAAM;QACb,SAAS,EAAE,CAAC,CAAC,MAAM;KACpB,CAAC,CACH;CACF,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,gBAAgB,GAAG,eAAe,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powersync/service-types",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
4
|
-
"
|
|
5
|
-
"types": "dist/index.d.ts",
|
|
3
|
+
"version": "0.0.0-dev-20260803144812",
|
|
4
|
+
"exports": "./dist/index.js",
|
|
6
5
|
"license": "FSL-1.1-ALv2",
|
|
6
|
+
"type": "module",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -182,8 +182,8 @@ export const jwkEC = t
|
|
|
182
182
|
description: 'Key ID, a unique identifier for the key.'
|
|
183
183
|
})
|
|
184
184
|
.optional(),
|
|
185
|
-
crv: t.literal('P-256').or(t.literal('P-384')).or(t.literal('P-
|
|
186
|
-
description: 'The cryptographic curve used with this key (P-256, P-384, or P-
|
|
185
|
+
crv: t.literal('P-256').or(t.literal('P-384')).or(t.literal('P-521')).meta({
|
|
186
|
+
description: 'The cryptographic curve used with this key (P-256, P-384, or P-521).'
|
|
187
187
|
}),
|
|
188
188
|
x: t.string.meta({
|
|
189
189
|
description: 'The x coordinate for the Elliptic Curve point, Base64 URL encoded.'
|
|
@@ -392,8 +392,8 @@ export const powerSyncConfig = t
|
|
|
392
392
|
.meta({
|
|
393
393
|
description: dedent`
|
|
394
394
|
Maximum number of buckets for each connection.
|
|
395
|
-
More buckets increase latency and memory usage. While the actual number is controlled by sync
|
|
396
|
-
having a hard limit ensures that the service errors instead of crashing when
|
|
395
|
+
More buckets increase latency and memory usage. While the actual number is controlled by sync config,
|
|
396
|
+
having a hard limit ensures that the service errors instead of crashing when the sync config is misconfigured.
|
|
397
397
|
Default of 1000.
|
|
398
398
|
`
|
|
399
399
|
})
|
|
@@ -405,6 +405,26 @@ export const powerSyncConfig = t
|
|
|
405
405
|
Related to max_buckets_per_connection, but this limit applies directly on the parameter
|
|
406
406
|
query results, _before_ we convert it into an unique set.
|
|
407
407
|
Default of 1000.
|
|
408
|
+
`
|
|
409
|
+
})
|
|
410
|
+
.optional(),
|
|
411
|
+
|
|
412
|
+
checkpoint_request_retention_minutes: t.number
|
|
413
|
+
.meta({
|
|
414
|
+
description: dedent`
|
|
415
|
+
Number of minutes to keep client-requested write checkpoint records.
|
|
416
|
+
Expired records are removed by the compact job.
|
|
417
|
+
Must be a positive integer. Default of 60.
|
|
418
|
+
`
|
|
419
|
+
})
|
|
420
|
+
.optional(),
|
|
421
|
+
|
|
422
|
+
bucket_count_cache_ttl_minutes: t.number
|
|
423
|
+
.meta({
|
|
424
|
+
description: dedent`
|
|
425
|
+
How long to keep cached bucket counts before refreshing them, in minutes.
|
|
426
|
+
Bucket counts may be affected by compacting.
|
|
427
|
+
Default of 60 (1 hour).
|
|
408
428
|
`
|
|
409
429
|
})
|
|
410
430
|
.optional()
|
|
@@ -520,7 +540,7 @@ export const powerSyncConfig = t
|
|
|
520
540
|
parameters: t
|
|
521
541
|
.record(t.number.or(t.string).or(t.boolean).or(t.Null))
|
|
522
542
|
.meta({
|
|
523
|
-
description: 'Global parameters that can be referenced in sync
|
|
543
|
+
description: 'Global parameters that can be referenced in sync config and other configurations.'
|
|
524
544
|
})
|
|
525
545
|
.optional()
|
|
526
546
|
})
|
package/src/definitions.ts
CHANGED
|
@@ -73,6 +73,25 @@ export const SyncRulesStatus = t.object({
|
|
|
73
73
|
/** Replication lag in bytes. undefined if we cannot calculate this. */
|
|
74
74
|
replication_lag_bytes: t.number.optional(),
|
|
75
75
|
|
|
76
|
+
/**
|
|
77
|
+
* Replication slot WAL status (PG 13+).
|
|
78
|
+
* Values: 'reserved', 'extended', 'unreserved', 'lost'.
|
|
79
|
+
* Undefined for non-Postgres sources or PG < 13.
|
|
80
|
+
*/
|
|
81
|
+
wal_status: t.string.optional(),
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* WAL budget remaining in bytes before potential slot invalidation
|
|
85
|
+
* (PG 13+, only when max_slot_wal_keep_size is set).
|
|
86
|
+
*/
|
|
87
|
+
safe_wal_size: t.number.optional(),
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Configured max_slot_wal_keep_size in bytes (PG 13+).
|
|
91
|
+
* Undefined when unlimited (-1) or not available.
|
|
92
|
+
*/
|
|
93
|
+
max_slot_wal_keep_size: t.number.optional(),
|
|
94
|
+
|
|
76
95
|
tables: t.array(TableInfo)
|
|
77
96
|
})
|
|
78
97
|
),
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * as configFile from './config/PowerSyncConfig.js';
|
|
2
2
|
|
|
3
3
|
export * from './definitions.js';
|
|
4
|
-
export * as internal_routes from './routes.js';
|
|
5
4
|
export * from './metrics.js';
|
|
6
5
|
export * as metric_types from './metrics.js';
|
|
7
|
-
export * as event_types from './reports';
|
|
6
|
+
export * as event_types from './reports.js';
|
|
7
|
+
export * as internal_routes from './routes.js';
|
package/src/reports.ts
CHANGED