@powersync/management-types 0.0.0-dev.6cd95165 → 0.0.0-dev.6f42cb4c
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.
|
@@ -2,7 +2,13 @@ import * as t from 'ts-codec';
|
|
|
2
2
|
export declare enum REPORT_ROUTES {
|
|
3
3
|
GET_CONNECTIONS_SUMMARY = "/api/v1/connections/summary",
|
|
4
4
|
GET_CURRENT_CONNECTIONS = "/api/v1/connections/current",
|
|
5
|
-
GET_CLIENT_SESSIONS = "/api/v1/client/sessions"
|
|
5
|
+
GET_CLIENT_SESSIONS = "/api/v1/client/sessions",
|
|
6
|
+
/** @deprecated Use GET_CONNECTIONS_SUMMARY instead. */
|
|
7
|
+
DEPRECATED_GET_CLIENT_CONNECTION_DATA = "/api/admin/v1/connections/reports",
|
|
8
|
+
/** @deprecated Use GET_CURRENT_CONNECTIONS instead. */
|
|
9
|
+
DEPRECATED_GET_CONNECTED_CLIENTS = "/api/admin/v1/connections/current",
|
|
10
|
+
/** @deprecated Use GET_CLIENT_SESSIONS instead. */
|
|
11
|
+
DEPRECATED_GET_GENERAL_CLIENT_ANALYTICS = "/api/v1/report/connection/general/analytics"
|
|
6
12
|
}
|
|
7
13
|
export declare const ClientConnectionsReportRequest: t.ObjectCodec<{
|
|
8
14
|
start: t.IdentityCodec<t.CodecType.String>;
|
|
@@ -14,6 +20,11 @@ export declare const ClientConnectionsReportRequest: t.ObjectCodec<{
|
|
|
14
20
|
}, string, t.CodecProps>>;
|
|
15
21
|
}>;
|
|
16
22
|
export type ClientConnectionsReportRequest = t.Encoded<typeof ClientConnectionsReportRequest>;
|
|
23
|
+
export declare const HostedInstanceId: t.ObjectCodec<{
|
|
24
|
+
org_id: t.IdentityCodec<t.CodecType.String>;
|
|
25
|
+
app_id: t.IdentityCodec<t.CodecType.String>;
|
|
26
|
+
id: t.IdentityCodec<t.CodecType.String>;
|
|
27
|
+
}>;
|
|
17
28
|
export declare const CurrentConnectionsRequest: t.ObjectCodec<{
|
|
18
29
|
org_id: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
19
30
|
app_id: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
@@ -21,6 +32,39 @@ export declare const CurrentConnectionsRequest: t.ObjectCodec<{
|
|
|
21
32
|
}>;
|
|
22
33
|
export type CurrentConnectionsRequest = t.Encoded<typeof CurrentConnectionsRequest>;
|
|
23
34
|
export type CurrentConnectionsRequestDecoded = t.Decoded<typeof CurrentConnectionsRequest>;
|
|
35
|
+
export declare const HostedClientConnectionsReportRequest: t.Intersection<t.Codec<{
|
|
36
|
+
start: string;
|
|
37
|
+
end: string;
|
|
38
|
+
scrape_ttl?: {
|
|
39
|
+
date: string;
|
|
40
|
+
} | undefined;
|
|
41
|
+
}, {
|
|
42
|
+
start: string;
|
|
43
|
+
end: string;
|
|
44
|
+
scrape_ttl?: {
|
|
45
|
+
date: string;
|
|
46
|
+
} | undefined;
|
|
47
|
+
}, string, t.CodecProps>, t.ObjectCodec<{
|
|
48
|
+
org_id: t.IdentityCodec<t.CodecType.String>;
|
|
49
|
+
app_id: t.IdentityCodec<t.CodecType.String>;
|
|
50
|
+
id: t.IdentityCodec<t.CodecType.String>;
|
|
51
|
+
}>>;
|
|
52
|
+
export type HostedClientConnectionsReportRequest = t.Encoded<typeof HostedClientConnectionsReportRequest>;
|
|
53
|
+
export declare const HostedCurrentConnectionsRequest: t.Intersection<t.Codec<{
|
|
54
|
+
id?: string | undefined;
|
|
55
|
+
org_id?: string | undefined;
|
|
56
|
+
app_id?: string | undefined;
|
|
57
|
+
}, {
|
|
58
|
+
id?: string | undefined;
|
|
59
|
+
org_id?: string | undefined;
|
|
60
|
+
app_id?: string | undefined;
|
|
61
|
+
}, string, t.CodecProps>, t.ObjectCodec<{
|
|
62
|
+
org_id: t.IdentityCodec<t.CodecType.String>;
|
|
63
|
+
app_id: t.IdentityCodec<t.CodecType.String>;
|
|
64
|
+
id: t.IdentityCodec<t.CodecType.String>;
|
|
65
|
+
}>>;
|
|
66
|
+
export type HostedCurrentConnectionsRequest = t.Encoded<typeof HostedCurrentConnectionsRequest>;
|
|
67
|
+
export type HostedInstanceId = t.Encoded<typeof HostedInstanceId>;
|
|
24
68
|
export declare const SDKConnectionBreakdown: t.ObjectCodec<{
|
|
25
69
|
sdk: t.IdentityCodec<t.CodecType.String>;
|
|
26
70
|
users: t.IdentityCodec<t.CodecType.Number>;
|
|
@@ -36,6 +80,19 @@ export declare const ClientConnectionsSummary: t.ObjectCodec<{
|
|
|
36
80
|
}>;
|
|
37
81
|
export type ClientConnectionsSummaryResponse = t.Encoded<typeof ClientConnectionsSummary>;
|
|
38
82
|
export type ClientConnectionsSummaryResponseDecoded = t.Decoded<typeof ClientConnectionsSummary>;
|
|
83
|
+
/** @deprecated Use ClientConnectionsSummaryResponse instead. */
|
|
84
|
+
export declare const DeprecatedClientConnectionsReport: t.ObjectCodec<{
|
|
85
|
+
users: t.IdentityCodec<t.CodecType.Number>;
|
|
86
|
+
sdks: t.ArrayCodec<t.ObjectCodec<{
|
|
87
|
+
sdk: t.IdentityCodec<t.CodecType.String>;
|
|
88
|
+
users: t.IdentityCodec<t.CodecType.Number>;
|
|
89
|
+
clients: t.IdentityCodec<t.CodecType.Number>;
|
|
90
|
+
}>>;
|
|
91
|
+
}>;
|
|
92
|
+
/** @deprecated Use ClientConnectionsSummaryResponse instead. */
|
|
93
|
+
export type DeprecatedClientConnectionsReportResponse = t.Encoded<typeof DeprecatedClientConnectionsReport>;
|
|
94
|
+
/** @deprecated Use ClientConnectionsSummaryResponseDecoded instead. */
|
|
95
|
+
export type DeprecatedClientConnectionsReportResponseDecoded = t.Decoded<typeof DeprecatedClientConnectionsReport>;
|
|
39
96
|
export declare const AnalyticsRequestData: t.ObjectCodec<{
|
|
40
97
|
org_id: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
41
98
|
app_id: t.OptionalCodec<t.Codec<string, string, string, t.CodecProps>>;
|
|
@@ -76,6 +133,38 @@ export declare const ClientConnectionAnalyticsRequest: t.Intersection<t.Codec<{
|
|
|
76
133
|
}>>;
|
|
77
134
|
export type ClientConnectionAnalyticsRequest = t.Encoded<typeof ClientConnectionAnalyticsRequest>;
|
|
78
135
|
export type ClientConnectionAnalyticsRequestDecoded = t.Decoded<typeof ClientConnectionAnalyticsRequest>;
|
|
136
|
+
export declare const HostedClientConnectionAnalyticsRequest: t.Intersection<t.Codec<{
|
|
137
|
+
id?: string | undefined;
|
|
138
|
+
org_id?: string | undefined;
|
|
139
|
+
app_id?: string | undefined;
|
|
140
|
+
user_id?: string | undefined;
|
|
141
|
+
client_id?: string | undefined;
|
|
142
|
+
date_range?: {
|
|
143
|
+
start: string;
|
|
144
|
+
end: string;
|
|
145
|
+
} | undefined;
|
|
146
|
+
} & {
|
|
147
|
+
cursor?: string | undefined;
|
|
148
|
+
limit?: number | undefined;
|
|
149
|
+
}, {
|
|
150
|
+
id?: string | undefined;
|
|
151
|
+
org_id?: string | undefined;
|
|
152
|
+
app_id?: string | undefined;
|
|
153
|
+
user_id?: string | undefined;
|
|
154
|
+
client_id?: string | undefined;
|
|
155
|
+
date_range?: {
|
|
156
|
+
start: string;
|
|
157
|
+
end: string;
|
|
158
|
+
} | undefined;
|
|
159
|
+
} & {
|
|
160
|
+
cursor?: string | undefined;
|
|
161
|
+
limit?: number | undefined;
|
|
162
|
+
}, string, t.CodecProps>, t.ObjectCodec<{
|
|
163
|
+
org_id: t.IdentityCodec<t.CodecType.String>;
|
|
164
|
+
app_id: t.IdentityCodec<t.CodecType.String>;
|
|
165
|
+
id: t.IdentityCodec<t.CodecType.String>;
|
|
166
|
+
}>>;
|
|
167
|
+
export type HostedClientConnectionAnalyticsRequest = t.Encoded<typeof HostedClientConnectionAnalyticsRequest>;
|
|
79
168
|
export declare const ClientConnectionAnalyticsEvent: t.ObjectCodec<{
|
|
80
169
|
user_id: t.IdentityCodec<t.CodecType.String>;
|
|
81
170
|
client_id: t.IdentityCodec<t.CodecType.String>;
|
|
@@ -6,6 +6,13 @@ export var REPORT_ROUTES;
|
|
|
6
6
|
REPORT_ROUTES["GET_CONNECTIONS_SUMMARY"] = "/api/v1/connections/summary";
|
|
7
7
|
REPORT_ROUTES["GET_CURRENT_CONNECTIONS"] = "/api/v1/connections/current";
|
|
8
8
|
REPORT_ROUTES["GET_CLIENT_SESSIONS"] = "/api/v1/client/sessions";
|
|
9
|
+
// Deprecated routes kept temporarily for backwards compatibility.
|
|
10
|
+
/** @deprecated Use GET_CONNECTIONS_SUMMARY instead. */
|
|
11
|
+
REPORT_ROUTES["DEPRECATED_GET_CLIENT_CONNECTION_DATA"] = "/api/admin/v1/connections/reports";
|
|
12
|
+
/** @deprecated Use GET_CURRENT_CONNECTIONS instead. */
|
|
13
|
+
REPORT_ROUTES["DEPRECATED_GET_CONNECTED_CLIENTS"] = "/api/admin/v1/connections/current";
|
|
14
|
+
/** @deprecated Use GET_CLIENT_SESSIONS instead. */
|
|
15
|
+
REPORT_ROUTES["DEPRECATED_GET_GENERAL_CLIENT_ANALYTICS"] = "/api/v1/report/connection/general/analytics";
|
|
9
16
|
})(REPORT_ROUTES || (REPORT_ROUTES = {}));
|
|
10
17
|
// POST /api/v1/connections/summary
|
|
11
18
|
// Returns a summary of client connections for the requested time range
|
|
@@ -26,7 +33,14 @@ const OptionalInstanceId = t.object({
|
|
|
26
33
|
app_id: t.string.optional(),
|
|
27
34
|
id: t.string.optional()
|
|
28
35
|
});
|
|
36
|
+
export const HostedInstanceId = t.object({
|
|
37
|
+
org_id: t.string,
|
|
38
|
+
app_id: t.string,
|
|
39
|
+
id: t.string
|
|
40
|
+
});
|
|
29
41
|
export const CurrentConnectionsRequest = OptionalInstanceId;
|
|
42
|
+
export const HostedClientConnectionsReportRequest = ClientConnectionsReportRequest.and(HostedInstanceId);
|
|
43
|
+
export const HostedCurrentConnectionsRequest = CurrentConnectionsRequest.and(HostedInstanceId);
|
|
30
44
|
export const SDKConnectionBreakdown = t.object({
|
|
31
45
|
sdk: t.string,
|
|
32
46
|
users: t.number,
|
|
@@ -36,6 +50,12 @@ export const ClientConnectionsSummary = t.object({
|
|
|
36
50
|
total_users: t.number,
|
|
37
51
|
sdk_breakdown: t.array(SDKConnectionBreakdown)
|
|
38
52
|
});
|
|
53
|
+
// Deprecated response types kept temporarily for backwards compatibility.
|
|
54
|
+
/** @deprecated Use ClientConnectionsSummaryResponse instead. */
|
|
55
|
+
export const DeprecatedClientConnectionsReport = t.object({
|
|
56
|
+
users: t.number,
|
|
57
|
+
sdks: t.array(SDKConnectionBreakdown)
|
|
58
|
+
});
|
|
39
59
|
// POST /api/v1/client/sessions
|
|
40
60
|
// Returns paginated list of client session events
|
|
41
61
|
export const AnalyticsRequestData = t.object({
|
|
@@ -52,6 +72,7 @@ export const AnalyticsRequestData = t.object({
|
|
|
52
72
|
.optional()
|
|
53
73
|
});
|
|
54
74
|
export const ClientConnectionAnalyticsRequest = AnalyticsRequestData.and(PaginationRequest);
|
|
75
|
+
export const HostedClientConnectionAnalyticsRequest = ClientConnectionAnalyticsRequest.and(HostedInstanceId);
|
|
55
76
|
export const ClientConnectionAnalyticsEvent = t.object({
|
|
56
77
|
user_id: t.string,
|
|
57
78
|
client_id: t.string,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reporting-routes.js","sourceRoot":"","sources":["../../src/routes/reporting-routes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE/E,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"reporting-routes.js","sourceRoot":"","sources":["../../src/routes/reporting-routes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,KAAK,CAAC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