@tailor-platform/create-sdk 1.11.0 → 1.12.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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # @tailor-platform/create-sdk
2
2
 
3
+ ## 1.12.0
4
+
5
+ ## 1.11.1
6
+
3
7
  ## 1.11.0
4
8
 
5
9
  ## 1.10.1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailor-platform/create-sdk",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "description": "A CLI tool to quickly create a new Tailor Platform SDK project",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "devDependencies": {
19
19
  "@eslint/js": "9.39.2",
20
- "@tailor-platform/sdk": "1.11.0",
20
+ "@tailor-platform/sdk": "1.12.0",
21
21
  "@types/node": "24.10.9",
22
22
  "eslint": "9.39.2",
23
23
  "eslint-plugin-oxlint": "1.39.0",
@@ -1,18 +1,15 @@
1
1
  import {
2
- type ColumnType,
3
- Kysely,
4
- type KyselyConfig,
5
- type Transaction as KyselyTransaction,
6
- type Insertable as KyselyInsertable,
7
- type Selectable as KyselySelectable,
8
- type Updateable as KyselyUpdateable,
9
- } from "kysely";
10
- import { TailordbDialect } from "@tailor-platform/function-kysely-tailordb";
11
-
12
- type Timestamp = ColumnType<Date, Date | string, Date | string>;
13
- type Generated<T> = T extends ColumnType<infer S, infer I, infer U>
14
- ? ColumnType<S, I | undefined, U>
15
- : ColumnType<T, T | undefined, T>;
2
+ createGetDB,
3
+ type Generated,
4
+ type Timestamp,
5
+ type NamespaceDB,
6
+ type NamespaceInsertable,
7
+ type NamespaceSelectable,
8
+ type NamespaceTable,
9
+ type NamespaceTableName,
10
+ type NamespaceTransaction,
11
+ type NamespaceUpdateable,
12
+ } from "@tailor-platform/sdk/kysely";
16
13
 
17
14
  export interface Namespace {
18
15
  "main-db": {
@@ -27,40 +24,16 @@ export interface Namespace {
27
24
  }
28
25
  }
29
26
 
30
- export function getDB<const N extends keyof Namespace>(
31
- namespace: N,
32
- kyselyConfig?: Omit<KyselyConfig, "dialect">,
33
- ): Kysely<Namespace[N]> {
34
- const client = new tailordb.Client({ namespace });
35
- return new Kysely<Namespace[N]>({
36
- dialect: new TailordbDialect(client),
37
- ...kyselyConfig,
38
- });
39
- }
27
+ export const getDB = createGetDB<Namespace>();
40
28
 
41
- export type DB<N extends keyof Namespace = keyof Namespace> = ReturnType<typeof getDB<N>>;
29
+ export type DB<N extends keyof Namespace = keyof Namespace> = NamespaceDB<Namespace, N>;
42
30
 
43
31
  export type Transaction<K extends keyof Namespace | DB = keyof Namespace> =
44
- K extends DB<infer N>
45
- ? KyselyTransaction<Namespace[N]>
46
- : K extends keyof Namespace
47
- ? KyselyTransaction<Namespace[K]>
48
- : never;
32
+ NamespaceTransaction<Namespace, K>;
49
33
 
50
- type TableName = {
51
- [N in keyof Namespace]: keyof Namespace[N];
52
- }[keyof Namespace];
53
- export type Table<T extends TableName> = {
54
- [N in keyof Namespace]: T extends keyof Namespace[N] ? Namespace[N][T]
55
- : never;
56
- }[keyof Namespace];
34
+ type TableName = NamespaceTableName<Namespace>;
35
+ export type Table<T extends TableName> = NamespaceTable<Namespace, T>;
57
36
 
58
- export type Insertable<T extends keyof Namespace[keyof Namespace]> = KyselyInsertable<
59
- Table<T>
60
- >;
61
- export type Selectable<T extends keyof Namespace[keyof Namespace]> = KyselySelectable<
62
- Table<T>
63
- >;
64
- export type Updateable<T extends keyof Namespace[keyof Namespace]> = KyselyUpdateable<
65
- Table<T>
66
- >;
37
+ export type Insertable<T extends TableName> = NamespaceInsertable<Namespace, T>;
38
+ export type Selectable<T extends TableName> = NamespaceSelectable<Namespace, T>;
39
+ export type Updateable<T extends TableName> = NamespaceUpdateable<Namespace, T>;
@@ -18,7 +18,7 @@
18
18
  "devDependencies": {
19
19
  "@eslint/js": "9.39.2",
20
20
  "@tailor-platform/function-types": "0.8.0",
21
- "@tailor-platform/sdk": "1.11.0",
21
+ "@tailor-platform/sdk": "1.12.0",
22
22
  "@types/node": "24.10.9",
23
23
  "eslint": "9.39.2",
24
24
  "eslint-plugin-oxlint": "1.39.0",
@@ -1,18 +1,15 @@
1
1
  import {
2
- type ColumnType,
3
- Kysely,
4
- type KyselyConfig,
5
- type Transaction as KyselyTransaction,
6
- type Insertable as KyselyInsertable,
7
- type Selectable as KyselySelectable,
8
- type Updateable as KyselyUpdateable,
9
- } from "kysely";
10
- import { TailordbDialect } from "@tailor-platform/function-kysely-tailordb";
11
-
12
- type Timestamp = ColumnType<Date, Date | string, Date | string>;
13
- type Generated<T> = T extends ColumnType<infer S, infer I, infer U>
14
- ? ColumnType<S, I | undefined, U>
15
- : ColumnType<T, T | undefined, T>;
2
+ createGetDB,
3
+ type Generated,
4
+ type Timestamp,
5
+ type NamespaceDB,
6
+ type NamespaceInsertable,
7
+ type NamespaceSelectable,
8
+ type NamespaceTable,
9
+ type NamespaceTableName,
10
+ type NamespaceTransaction,
11
+ type NamespaceUpdateable,
12
+ } from "@tailor-platform/sdk/kysely";
16
13
 
17
14
  export interface Namespace {
18
15
  "main-db": {
@@ -91,40 +88,16 @@ export interface Namespace {
91
88
  }
92
89
  }
93
90
 
94
- export function getDB<const N extends keyof Namespace>(
95
- namespace: N,
96
- kyselyConfig?: Omit<KyselyConfig, "dialect">,
97
- ): Kysely<Namespace[N]> {
98
- const client = new tailordb.Client({ namespace });
99
- return new Kysely<Namespace[N]>({
100
- dialect: new TailordbDialect(client),
101
- ...kyselyConfig,
102
- });
103
- }
91
+ export const getDB = createGetDB<Namespace>();
104
92
 
105
- export type DB<N extends keyof Namespace = keyof Namespace> = ReturnType<typeof getDB<N>>;
93
+ export type DB<N extends keyof Namespace = keyof Namespace> = NamespaceDB<Namespace, N>;
106
94
 
107
95
  export type Transaction<K extends keyof Namespace | DB = keyof Namespace> =
108
- K extends DB<infer N>
109
- ? KyselyTransaction<Namespace[N]>
110
- : K extends keyof Namespace
111
- ? KyselyTransaction<Namespace[K]>
112
- : never;
96
+ NamespaceTransaction<Namespace, K>;
113
97
 
114
- type TableName = {
115
- [N in keyof Namespace]: keyof Namespace[N];
116
- }[keyof Namespace];
117
- export type Table<T extends TableName> = {
118
- [N in keyof Namespace]: T extends keyof Namespace[N] ? Namespace[N][T]
119
- : never;
120
- }[keyof Namespace];
98
+ type TableName = NamespaceTableName<Namespace>;
99
+ export type Table<T extends TableName> = NamespaceTable<Namespace, T>;
121
100
 
122
- export type Insertable<T extends keyof Namespace[keyof Namespace]> = KyselyInsertable<
123
- Table<T>
124
- >;
125
- export type Selectable<T extends keyof Namespace[keyof Namespace]> = KyselySelectable<
126
- Table<T>
127
- >;
128
- export type Updateable<T extends keyof Namespace[keyof Namespace]> = KyselyUpdateable<
129
- Table<T>
130
- >;
101
+ export type Insertable<T extends TableName> = NamespaceInsertable<Namespace, T>;
102
+ export type Selectable<T extends TableName> = NamespaceSelectable<Namespace, T>;
103
+ export type Updateable<T extends TableName> = NamespaceUpdateable<Namespace, T>;
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "devDependencies": {
16
16
  "@eslint/js": "9.39.2",
17
- "@tailor-platform/sdk": "1.11.0",
17
+ "@tailor-platform/sdk": "1.12.0",
18
18
  "@types/node": "24.10.9",
19
19
  "eslint": "9.39.2",
20
20
  "eslint-plugin-oxlint": "1.39.0",
@@ -21,7 +21,7 @@
21
21
  "devDependencies": {
22
22
  "@eslint/js": "9.39.2",
23
23
  "@tailor-platform/function-types": "0.8.0",
24
- "@tailor-platform/sdk": "1.11.0",
24
+ "@tailor-platform/sdk": "1.12.0",
25
25
  "@types/node": "24.10.9",
26
26
  "eslint": "9.39.2",
27
27
  "eslint-plugin-oxlint": "1.39.0",
@@ -1,18 +1,15 @@
1
1
  import {
2
- type ColumnType,
3
- Kysely,
4
- type KyselyConfig,
5
- type Transaction as KyselyTransaction,
6
- type Insertable as KyselyInsertable,
7
- type Selectable as KyselySelectable,
8
- type Updateable as KyselyUpdateable,
9
- } from "kysely";
10
- import { TailordbDialect } from "@tailor-platform/function-kysely-tailordb";
11
-
12
- type Timestamp = ColumnType<Date, Date | string, Date | string>;
13
- type Generated<T> = T extends ColumnType<infer S, infer I, infer U>
14
- ? ColumnType<S, I | undefined, U>
15
- : ColumnType<T, T | undefined, T>;
2
+ createGetDB,
3
+ type Generated,
4
+ type Timestamp,
5
+ type NamespaceDB,
6
+ type NamespaceInsertable,
7
+ type NamespaceSelectable,
8
+ type NamespaceTable,
9
+ type NamespaceTableName,
10
+ type NamespaceTransaction,
11
+ type NamespaceUpdateable,
12
+ } from "@tailor-platform/sdk/kysely";
16
13
 
17
14
  export interface Namespace {
18
15
  "main-db": {
@@ -27,40 +24,16 @@ export interface Namespace {
27
24
  }
28
25
  }
29
26
 
30
- export function getDB<const N extends keyof Namespace>(
31
- namespace: N,
32
- kyselyConfig?: Omit<KyselyConfig, "dialect">,
33
- ): Kysely<Namespace[N]> {
34
- const client = new tailordb.Client({ namespace });
35
- return new Kysely<Namespace[N]>({
36
- dialect: new TailordbDialect(client),
37
- ...kyselyConfig,
38
- });
39
- }
27
+ export const getDB = createGetDB<Namespace>();
40
28
 
41
- export type DB<N extends keyof Namespace = keyof Namespace> = ReturnType<typeof getDB<N>>;
29
+ export type DB<N extends keyof Namespace = keyof Namespace> = NamespaceDB<Namespace, N>;
42
30
 
43
31
  export type Transaction<K extends keyof Namespace | DB = keyof Namespace> =
44
- K extends DB<infer N>
45
- ? KyselyTransaction<Namespace[N]>
46
- : K extends keyof Namespace
47
- ? KyselyTransaction<Namespace[K]>
48
- : never;
32
+ NamespaceTransaction<Namespace, K>;
49
33
 
50
- type TableName = {
51
- [N in keyof Namespace]: keyof Namespace[N];
52
- }[keyof Namespace];
53
- export type Table<T extends TableName> = {
54
- [N in keyof Namespace]: T extends keyof Namespace[N] ? Namespace[N][T]
55
- : never;
56
- }[keyof Namespace];
34
+ type TableName = NamespaceTableName<Namespace>;
35
+ export type Table<T extends TableName> = NamespaceTable<Namespace, T>;
57
36
 
58
- export type Insertable<T extends keyof Namespace[keyof Namespace]> = KyselyInsertable<
59
- Table<T>
60
- >;
61
- export type Selectable<T extends keyof Namespace[keyof Namespace]> = KyselySelectable<
62
- Table<T>
63
- >;
64
- export type Updateable<T extends keyof Namespace[keyof Namespace]> = KyselyUpdateable<
65
- Table<T>
66
- >;
37
+ export type Insertable<T extends TableName> = NamespaceInsertable<Namespace, T>;
38
+ export type Selectable<T extends TableName> = NamespaceSelectable<Namespace, T>;
39
+ export type Updateable<T extends TableName> = NamespaceUpdateable<Namespace, T>;