@creator.co/analytics-kysely-types 1.0.0
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/index.d.ts +32 -0
- package/kyselyJson.d.ts +13 -0
- package/package.json +13 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Json } from './kyselyJson'
|
|
2
|
+
import type { ColumnType, GeneratedAlways } from "kysely";
|
|
3
|
+
export type Generated<T> = T extends ColumnType<infer S, infer I, infer U>
|
|
4
|
+
? ColumnType<S, I | undefined, U>
|
|
5
|
+
: ColumnType<T, T | undefined, T>;
|
|
6
|
+
export type Timestamp = ColumnType<Date, Date | string, Date | string>;
|
|
7
|
+
|
|
8
|
+
export type AnalyticsView = {
|
|
9
|
+
id: GeneratedAlways<number>;
|
|
10
|
+
title: string;
|
|
11
|
+
filters: Json;
|
|
12
|
+
brand_id: number;
|
|
13
|
+
created_at: Generated<Timestamp>;
|
|
14
|
+
updated_at: Timestamp | null;
|
|
15
|
+
};
|
|
16
|
+
export type AnalyticsWidget = {
|
|
17
|
+
id: GeneratedAlways<number>;
|
|
18
|
+
default_title: string;
|
|
19
|
+
title: string;
|
|
20
|
+
filters: Json;
|
|
21
|
+
visible: boolean;
|
|
22
|
+
widget_order: number;
|
|
23
|
+
component_id: string;
|
|
24
|
+
view_id: number;
|
|
25
|
+
created_at: Generated<Timestamp>;
|
|
26
|
+
updated_at: Timestamp | null;
|
|
27
|
+
analyticsViewId: number;
|
|
28
|
+
};
|
|
29
|
+
export type DB = {
|
|
30
|
+
analytics_view: AnalyticsView;
|
|
31
|
+
analytics_widget: AnalyticsWidget;
|
|
32
|
+
};
|
package/kyselyJson.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ColumnType } from 'kysely'
|
|
2
|
+
|
|
3
|
+
export type Json = ColumnType<JsonValue, string, string>;
|
|
4
|
+
|
|
5
|
+
export type JsonArray = JsonValue[];
|
|
6
|
+
|
|
7
|
+
export type JsonObject = {
|
|
8
|
+
[K in string]?: JsonValue;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type JsonPrimitive = boolean | number | string | null;
|
|
12
|
+
|
|
13
|
+
export type JsonValue = JsonArray | JsonObject | JsonPrimitive;
|
package/package.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@creator.co/analytics-kysely-types",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"types": "./index.d.ts",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"devDependencies": {
|
|
7
|
+
"typescript": "^5.2.2"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"kysely": "^0.26.3"
|
|
11
|
+
},
|
|
12
|
+
"description": "Kysely types for analytics Database"
|
|
13
|
+
}
|