@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.
- package/LICENSE +67 -0
- package/README.md +88 -0
- package/dist/config/HostedConfig.d.ts +1318 -0
- package/dist/config/HostedConfig.js +101 -0
- package/dist/config/HostedConfig.js.map +1 -0
- package/dist/config/HostedSecret.d.ts +18 -0
- package/dist/config/HostedSecret.js +12 -0
- package/dist/config/HostedSecret.js.map +1 -0
- package/dist/config/connections/ConnectionType.d.ts +6 -0
- package/dist/config/connections/ConnectionType.js +8 -0
- package/dist/config/connections/ConnectionType.js.map +1 -0
- package/dist/config/connections/HostedDatabaseSourceConfig.d.ts +23 -0
- package/dist/config/connections/HostedDatabaseSourceConfig.js +18 -0
- package/dist/config/connections/HostedDatabaseSourceConfig.js.map +1 -0
- package/dist/config/connections/HostedMSSQLConnection.d.ts +308 -0
- package/dist/config/connections/HostedMSSQLConnection.js +41 -0
- package/dist/config/connections/HostedMSSQLConnection.js.map +1 -0
- package/dist/config/connections/HostedMongoConnection.d.ts +33 -0
- package/dist/config/connections/HostedMongoConnection.js +10 -0
- package/dist/config/connections/HostedMongoConnection.js.map +1 -0
- package/dist/config/connections/HostedMySQLConnection.d.ts +46 -0
- package/dist/config/connections/HostedMySQLConnection.js +16 -0
- package/dist/config/connections/HostedMySQLConnection.js.map +1 -0
- package/dist/config/connections/HostedPostgresConnection.d.ts +52 -0
- package/dist/config/connections/HostedPostgresConnection.js +21 -0
- package/dist/config/connections/HostedPostgresConnection.js.map +1 -0
- package/dist/errors.d.ts +10 -0
- package/dist/errors.js +13 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/routes/dashboard-routes.d.ts +13 -0
- package/dist/routes/dashboard-routes.js +16 -0
- package/dist/routes/dashboard-routes.js.map +1 -0
- package/dist/routes/dev-routes.d.ts +588 -0
- package/dist/routes/dev-routes.js +97 -0
- package/dist/routes/dev-routes.js.map +1 -0
- package/dist/routes/general-routes.d.ts +78 -0
- package/dist/routes/general-routes.js +57 -0
- package/dist/routes/general-routes.js.map +1 -0
- package/dist/routes/index.d.ts +6 -0
- package/dist/routes/index.js +7 -0
- package/dist/routes/index.js.map +1 -0
- package/dist/routes/manage-routes.d.ts +1055 -0
- package/dist/routes/manage-routes.js +109 -0
- package/dist/routes/manage-routes.js.map +1 -0
- package/dist/routes/reporting-routes.d.ts +112 -0
- package/dist/routes/reporting-routes.js +61 -0
- package/dist/routes/reporting-routes.js.map +1 -0
- package/dist/routes/schema.d.ts +131 -0
- package/dist/routes/schema.js +71 -0
- package/dist/routes/schema.js.map +1 -0
- package/dist/scripts/compile-json-schema.d.ts +1 -0
- package/dist/scripts/compile-json-schema.js +15 -0
- package/dist/scripts/compile-json-schema.js.map +1 -0
- package/dist/shared.d.ts +17 -0
- package/dist/shared.js +17 -0
- package/dist/shared.js.map +1 -0
- package/dist/utils/pagination.d.ts +12 -0
- package/dist/utils/pagination.js +13 -0
- package/dist/utils/pagination.js.map +1 -0
- package/json-schema/powersync-config.json +880 -0
- package/package.json +44 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as t from 'ts-codec';
|
|
2
|
+
import { DataSourceConfig } from './HostedDatabaseSourceConfig.js';
|
|
3
|
+
import { ConnectionType } from './ConnectionType.js';
|
|
4
|
+
import { HostedSecret } from '../HostedSecret.js';
|
|
5
|
+
export const HostedMySQLConnection = DataSourceConfig.and(t.object({
|
|
6
|
+
type: t.literal(ConnectionType.MYSQL),
|
|
7
|
+
uri: t.string.optional(),
|
|
8
|
+
hostname: t.string.optional(),
|
|
9
|
+
port: t.number.optional(),
|
|
10
|
+
/** For mutual TLS */
|
|
11
|
+
client_certificate: t.string.optional(),
|
|
12
|
+
client_private_key: HostedSecret.optional(),
|
|
13
|
+
/** Expose execute-sql */
|
|
14
|
+
debug_api: t.boolean.optional()
|
|
15
|
+
}));
|
|
16
|
+
//# sourceMappingURL=HostedMySQLConnection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HostedMySQLConnection.js","sourceRoot":"","sources":["../../../src/config/connections/HostedMySQLConnection.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;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,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,qBAAqB;IACrB,kBAAkB,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE;IACvC,kBAAkB,EAAE,YAAY,CAAC,QAAQ,EAAE;IAE3C,yBAAyB;IACzB,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE;CAChC,CAAC,CACH,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as t from 'ts-codec';
|
|
2
|
+
import { ConnectionType } from './ConnectionType.js';
|
|
3
|
+
export declare const HostedPostgresConnection: 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.POSTGRES>;
|
|
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
|
+
/** Defaults to verify-full */
|
|
33
|
+
sslmode: t.OptionalCodec<t.Codec<"verify-full" | "verify-ca", "verify-full" | "verify-ca", string, t.CodecProps>>;
|
|
34
|
+
/** Required for verify-ca, optional for verify-full */
|
|
35
|
+
cacert: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
36
|
+
/** For mutual TLS */
|
|
37
|
+
client_certificate: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
38
|
+
client_private_key: t.OptionalCodec<t.Codec<{
|
|
39
|
+
secret: string;
|
|
40
|
+
} | {
|
|
41
|
+
secret_ref: string;
|
|
42
|
+
}, {
|
|
43
|
+
secret: string;
|
|
44
|
+
} | {
|
|
45
|
+
secret_ref: string;
|
|
46
|
+
}, string, t.CodecProps>>;
|
|
47
|
+
vpc_endpoint_hostname: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
48
|
+
/** Expose execute-sql */
|
|
49
|
+
debug_api: t.OptionalCodec<t.Codec<boolean, boolean, string, t.CodecProps>>;
|
|
50
|
+
}>>;
|
|
51
|
+
export type HostedPostgresConnection = t.Encoded<typeof HostedPostgresConnection>;
|
|
52
|
+
export type HostedPostgresConnectionDecoded = t.Decoded<typeof HostedPostgresConnection>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as t from 'ts-codec';
|
|
2
|
+
import { ConnectionType } from './ConnectionType.js';
|
|
3
|
+
import { DataSourceConfig } from './HostedDatabaseSourceConfig.js';
|
|
4
|
+
import { HostedSecret } from '../HostedSecret.js';
|
|
5
|
+
export const HostedPostgresConnection = DataSourceConfig.and(t.object({
|
|
6
|
+
type: t.literal(ConnectionType.POSTGRES),
|
|
7
|
+
uri: t.string.optional(),
|
|
8
|
+
hostname: t.string.optional(),
|
|
9
|
+
port: t.number.optional(),
|
|
10
|
+
/** Defaults to verify-full */
|
|
11
|
+
sslmode: t.literal('verify-full').or(t.literal('verify-ca')).optional(),
|
|
12
|
+
/** Required for verify-ca, optional for verify-full */
|
|
13
|
+
cacert: t.string.optional(),
|
|
14
|
+
/** For mutual TLS */
|
|
15
|
+
client_certificate: t.string.optional(),
|
|
16
|
+
client_private_key: HostedSecret.optional(),
|
|
17
|
+
vpc_endpoint_hostname: t.string.optional(),
|
|
18
|
+
/** Expose execute-sql */
|
|
19
|
+
debug_api: t.boolean.optional()
|
|
20
|
+
}));
|
|
21
|
+
//# sourceMappingURL=HostedPostgresConnection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HostedPostgresConnection.js","sourceRoot":"","sources":["../../../src/config/connections/HostedPostgresConnection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,CAAC,MAAM,wBAAwB,GAAG,gBAAgB,CAAC,GAAG,CAC1D,CAAC,CAAC,MAAM,CAAC;IACP,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC;IACxC,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,8BAA8B;IAC9B,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,EAAE;IACvE,uDAAuD;IACvD,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE;IAC3B,qBAAqB;IACrB,kBAAkB,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE;IACvC,kBAAkB,EAAE,YAAY,CAAC,QAAQ,EAAE;IAE3C,qBAAqB,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE;IAE1C,yBAAyB;IACzB,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE;CAChC,CAAC,CACH,CAAC"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare enum PowerSyncErrorCodes {
|
|
2
|
+
REGION_CHANGED = "REGION_CHANGED",
|
|
3
|
+
PLAN_LIMIT_REACHED = "PLAN_LIMIT_REACHED",
|
|
4
|
+
SECRET_NOT_FOUND = "SECRET_NOT_FOUND",
|
|
5
|
+
INVALID_REGION = "INVALID_REGION",
|
|
6
|
+
INVALID_CONFIG = "INVALID_CONFIG",
|
|
7
|
+
PSYNC_M1202_CONNECTION_TEST_TIMEOUT = "PSYNC_M1202",
|
|
8
|
+
PSYNC_M1203_CONNECTION_TEST_FAILED = "PSYNC_M1203",
|
|
9
|
+
PSYNC_M1204_CONNECTION_TEST_BUSY = "PSYNC_M1204"
|
|
10
|
+
}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// TODO: Make this properly use the new PowerSync error code system.
|
|
2
|
+
export var PowerSyncErrorCodes;
|
|
3
|
+
(function (PowerSyncErrorCodes) {
|
|
4
|
+
PowerSyncErrorCodes["REGION_CHANGED"] = "REGION_CHANGED";
|
|
5
|
+
PowerSyncErrorCodes["PLAN_LIMIT_REACHED"] = "PLAN_LIMIT_REACHED";
|
|
6
|
+
PowerSyncErrorCodes["SECRET_NOT_FOUND"] = "SECRET_NOT_FOUND";
|
|
7
|
+
PowerSyncErrorCodes["INVALID_REGION"] = "INVALID_REGION";
|
|
8
|
+
PowerSyncErrorCodes["INVALID_CONFIG"] = "INVALID_CONFIG";
|
|
9
|
+
PowerSyncErrorCodes["PSYNC_M1202_CONNECTION_TEST_TIMEOUT"] = "PSYNC_M1202";
|
|
10
|
+
PowerSyncErrorCodes["PSYNC_M1203_CONNECTION_TEST_FAILED"] = "PSYNC_M1203";
|
|
11
|
+
PowerSyncErrorCodes["PSYNC_M1204_CONNECTION_TEST_BUSY"] = "PSYNC_M1204";
|
|
12
|
+
})(PowerSyncErrorCodes || (PowerSyncErrorCodes = {}));
|
|
13
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,MAAM,CAAN,IAAY,mBAUX;AAVD,WAAY,mBAAmB;IAC7B,wDAAiC,CAAA;IACjC,gEAAyC,CAAA;IACzC,4DAAqC,CAAA;IACrC,wDAAiC,CAAA;IACjC,wDAAiC,CAAA;IAEjC,0EAAmD,CAAA;IACnD,yEAAkD,CAAA;IAClD,uEAAgD,CAAA;AAClD,CAAC,EAVW,mBAAmB,KAAnB,mBAAmB,QAU9B"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './config/connections/ConnectionType.js';
|
|
2
|
+
export * from './config/connections/HostedDatabaseSourceConfig.js';
|
|
3
|
+
export * from './config/connections/HostedMongoConnection.js';
|
|
4
|
+
export * from './config/connections/HostedMSSQLConnection.js';
|
|
5
|
+
export * from './config/connections/HostedMySQLConnection.js';
|
|
6
|
+
export * from './config/connections/HostedPostgresConnection.js';
|
|
7
|
+
export * from './config/HostedConfig.js';
|
|
8
|
+
export * from './config/HostedSecret.js';
|
|
9
|
+
export * from './errors.js';
|
|
10
|
+
export * from './shared.js';
|
|
11
|
+
export * from './utils/pagination.js';
|
|
12
|
+
export { metric_types } from '@powersync/service-types';
|
|
13
|
+
export * as routes from './routes/index.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './config/connections/ConnectionType.js';
|
|
2
|
+
export * from './config/connections/HostedDatabaseSourceConfig.js';
|
|
3
|
+
export * from './config/connections/HostedMongoConnection.js';
|
|
4
|
+
export * from './config/connections/HostedMSSQLConnection.js';
|
|
5
|
+
export * from './config/connections/HostedMySQLConnection.js';
|
|
6
|
+
export * from './config/connections/HostedPostgresConnection.js';
|
|
7
|
+
export * from './config/HostedConfig.js';
|
|
8
|
+
export * from './config/HostedSecret.js';
|
|
9
|
+
export * from './errors.js';
|
|
10
|
+
export * from './shared.js';
|
|
11
|
+
export * from './utils/pagination.js';
|
|
12
|
+
export { metric_types } from '@powersync/service-types';
|
|
13
|
+
export * as routes from './routes/index.js';
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wCAAwC,CAAC;AACvD,cAAc,oDAAoD,CAAC;AACnE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,kDAAkD,CAAC;AACjE,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AAEtC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import 'bson';
|
|
2
|
+
import * as t from 'ts-codec';
|
|
3
|
+
export declare enum SYNC_DASHBOARD_ROUTES {
|
|
4
|
+
GET_TOKEN = "/api/v1/dashboard/token"
|
|
5
|
+
}
|
|
6
|
+
export declare const SyncDashboardTokenRequest: t.ObjectCodec<{
|
|
7
|
+
org_id: t.IdentityCodec<t.CodecType.String>;
|
|
8
|
+
}>;
|
|
9
|
+
export type SyncDashboardTokenRequest = t.Encoded<typeof SyncDashboardTokenRequest>;
|
|
10
|
+
export declare const SyncDashboardTokenResponse: t.ObjectCodec<{
|
|
11
|
+
token: t.IdentityCodec<t.CodecType.String>;
|
|
12
|
+
}>;
|
|
13
|
+
export type SyncDashboardTokenResponse = t.Encoded<typeof SyncDashboardTokenResponse>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Required for the ObjectId codec
|
|
2
|
+
import 'bson';
|
|
3
|
+
import * as t from 'ts-codec';
|
|
4
|
+
export var SYNC_DASHBOARD_ROUTES;
|
|
5
|
+
(function (SYNC_DASHBOARD_ROUTES) {
|
|
6
|
+
SYNC_DASHBOARD_ROUTES["GET_TOKEN"] = "/api/v1/dashboard/token";
|
|
7
|
+
})(SYNC_DASHBOARD_ROUTES || (SYNC_DASHBOARD_ROUTES = {}));
|
|
8
|
+
// POST /api/v1/dashboard/token
|
|
9
|
+
// Returns sync dashboard JWT token
|
|
10
|
+
export const SyncDashboardTokenRequest = t.object({
|
|
11
|
+
org_id: t.string
|
|
12
|
+
});
|
|
13
|
+
export const SyncDashboardTokenResponse = t.object({
|
|
14
|
+
token: t.string
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=dashboard-routes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard-routes.js","sourceRoot":"","sources":["../../src/routes/dashboard-routes.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,OAAO,MAAM,CAAC;AACd,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B,MAAM,CAAN,IAAY,qBAEX;AAFD,WAAY,qBAAqB;IAC/B,8DAAqC,CAAA;AACvC,CAAC,EAFW,qBAAqB,KAArB,qBAAqB,QAEhC;AAED,+BAA+B;AAC/B,mCAAmC;AACnC,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,MAAM,EAAE,CAAC,CAAC,MAAM;CACjB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,KAAK,EAAE,CAAC,CAAC,MAAM;CAChB,CAAC,CAAC"}
|