dsqlbase 0.1.0 → 0.1.1

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.
Files changed (162) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/client/create.d.ts +73 -0
  3. package/dist/client/create.d.ts.map +1 -0
  4. package/dist/client/create.js +82 -0
  5. package/dist/client/create.js.map +1 -0
  6. package/dist/client/database/base.d.ts +8 -0
  7. package/dist/client/database/base.d.ts.map +1 -0
  8. package/dist/client/database/base.js +13 -0
  9. package/dist/client/database/base.js.map +1 -0
  10. package/dist/client/database/client.d.ts +5 -0
  11. package/dist/client/database/client.d.ts.map +1 -0
  12. package/dist/client/database/client.js +4 -0
  13. package/dist/client/database/client.js.map +1 -0
  14. package/dist/client/database/index.d.ts +9 -0
  15. package/dist/client/database/index.d.ts.map +1 -0
  16. package/dist/client/database/index.js +3 -0
  17. package/dist/client/database/index.js.map +1 -0
  18. package/dist/client/index.d.ts +6 -0
  19. package/dist/client/index.d.ts.map +1 -0
  20. package/dist/client/index.js +5 -0
  21. package/dist/client/index.js.map +1 -0
  22. package/dist/client/model/base.d.ts +330 -0
  23. package/dist/client/model/base.d.ts.map +1 -0
  24. package/dist/client/model/base.js +7 -0
  25. package/dist/client/model/base.js.map +1 -0
  26. package/dist/client/model/client.d.ts +102 -0
  27. package/dist/client/model/client.d.ts.map +1 -0
  28. package/dist/client/model/client.js +123 -0
  29. package/dist/client/model/client.js.map +1 -0
  30. package/dist/client/model/normalizer.d.ts +19 -0
  31. package/dist/client/model/normalizer.d.ts.map +1 -0
  32. package/dist/client/model/normalizer.js +221 -0
  33. package/dist/client/model/normalizer.js.map +1 -0
  34. package/dist/index.d.ts +1 -1
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +1 -1
  37. package/dist/index.js.map +1 -1
  38. package/dist/pg/index.d.ts +9 -0
  39. package/dist/pg/index.d.ts.map +1 -0
  40. package/dist/pg/index.js +14 -0
  41. package/dist/pg/index.js.map +1 -0
  42. package/dist/pglite/index.d.ts +9 -0
  43. package/dist/pglite/index.d.ts.map +1 -0
  44. package/dist/pglite/index.js +14 -0
  45. package/dist/pglite/index.js.map +1 -0
  46. package/dist/schema/columns/array.d.ts +16 -0
  47. package/dist/schema/columns/array.d.ts.map +1 -0
  48. package/dist/schema/columns/array.js +24 -0
  49. package/dist/schema/columns/array.js.map +1 -0
  50. package/dist/schema/columns/bigint.d.ts +11 -0
  51. package/dist/schema/columns/bigint.d.ts.map +1 -0
  52. package/dist/schema/columns/bigint.js +19 -0
  53. package/dist/schema/columns/bigint.js.map +1 -0
  54. package/dist/schema/columns/boolean.d.ts +10 -0
  55. package/dist/schema/columns/boolean.d.ts.map +1 -0
  56. package/dist/schema/columns/boolean.js +18 -0
  57. package/dist/schema/columns/boolean.js.map +1 -0
  58. package/dist/schema/columns/bytea.d.ts +8 -0
  59. package/dist/schema/columns/bytea.d.ts.map +1 -0
  60. package/dist/schema/columns/bytea.js +16 -0
  61. package/dist/schema/columns/bytea.js.map +1 -0
  62. package/dist/schema/columns/char.d.ts +10 -0
  63. package/dist/schema/columns/char.d.ts.map +1 -0
  64. package/dist/schema/columns/char.js +18 -0
  65. package/dist/schema/columns/char.js.map +1 -0
  66. package/dist/schema/columns/date.d.ts +23 -0
  67. package/dist/schema/columns/date.d.ts.map +1 -0
  68. package/dist/schema/columns/date.js +29 -0
  69. package/dist/schema/columns/date.js.map +1 -0
  70. package/dist/schema/columns/double.d.ts +13 -0
  71. package/dist/schema/columns/double.d.ts.map +1 -0
  72. package/dist/schema/columns/double.js +21 -0
  73. package/dist/schema/columns/double.js.map +1 -0
  74. package/dist/schema/columns/identity.d.ts +56 -0
  75. package/dist/schema/columns/identity.d.ts.map +1 -0
  76. package/dist/schema/columns/identity.js +65 -0
  77. package/dist/schema/columns/identity.js.map +1 -0
  78. package/dist/schema/columns/int.d.ts +11 -0
  79. package/dist/schema/columns/int.d.ts.map +1 -0
  80. package/dist/schema/columns/int.js +19 -0
  81. package/dist/schema/columns/int.js.map +1 -0
  82. package/dist/schema/columns/interval.d.ts +23 -0
  83. package/dist/schema/columns/interval.d.ts.map +1 -0
  84. package/dist/schema/columns/interval.js +40 -0
  85. package/dist/schema/columns/interval.js.map +1 -0
  86. package/dist/schema/columns/json.d.ts +9 -0
  87. package/dist/schema/columns/json.d.ts.map +1 -0
  88. package/dist/schema/columns/json.js +18 -0
  89. package/dist/schema/columns/json.js.map +1 -0
  90. package/dist/schema/columns/numeric.d.ts +11 -0
  91. package/dist/schema/columns/numeric.d.ts.map +1 -0
  92. package/dist/schema/columns/numeric.js +19 -0
  93. package/dist/schema/columns/numeric.js.map +1 -0
  94. package/dist/schema/columns/real.d.ts +13 -0
  95. package/dist/schema/columns/real.d.ts.map +1 -0
  96. package/dist/schema/columns/real.js +21 -0
  97. package/dist/schema/columns/real.js.map +1 -0
  98. package/dist/schema/columns/smallint.d.ts +11 -0
  99. package/dist/schema/columns/smallint.d.ts.map +1 -0
  100. package/dist/schema/columns/smallint.js +19 -0
  101. package/dist/schema/columns/smallint.js.map +1 -0
  102. package/dist/schema/columns/text.d.ts +9 -0
  103. package/dist/schema/columns/text.d.ts.map +1 -0
  104. package/dist/schema/columns/text.js +17 -0
  105. package/dist/schema/columns/text.js.map +1 -0
  106. package/dist/schema/columns/time.d.ts +20 -0
  107. package/dist/schema/columns/time.d.ts.map +1 -0
  108. package/dist/schema/columns/time.js +19 -0
  109. package/dist/schema/columns/time.js.map +1 -0
  110. package/dist/schema/columns/timestamp.d.ts +40 -0
  111. package/dist/schema/columns/timestamp.d.ts.map +1 -0
  112. package/dist/schema/columns/timestamp.js +48 -0
  113. package/dist/schema/columns/timestamp.js.map +1 -0
  114. package/dist/schema/columns/uuid.d.ts +17 -0
  115. package/dist/schema/columns/uuid.d.ts.map +1 -0
  116. package/dist/schema/columns/uuid.js +27 -0
  117. package/dist/schema/columns/uuid.js.map +1 -0
  118. package/dist/schema/columns/varchar.d.ts +9 -0
  119. package/dist/schema/columns/varchar.d.ts.map +1 -0
  120. package/dist/schema/columns/varchar.js +17 -0
  121. package/dist/schema/columns/varchar.js.map +1 -0
  122. package/dist/schema/domain.d.ts +19 -0
  123. package/dist/schema/domain.d.ts.map +1 -0
  124. package/dist/schema/domain.js +37 -0
  125. package/dist/schema/domain.js.map +1 -0
  126. package/dist/schema/index.d.ts +27 -0
  127. package/dist/schema/index.d.ts.map +1 -0
  128. package/dist/schema/index.js +25 -0
  129. package/dist/schema/index.js.map +1 -0
  130. package/dist/schema/namespace.d.ts +22 -0
  131. package/dist/schema/namespace.d.ts.map +1 -0
  132. package/dist/schema/namespace.js +24 -0
  133. package/dist/schema/namespace.js.map +1 -0
  134. package/dist/schema/relations.d.ts +12 -0
  135. package/dist/schema/relations.d.ts.map +1 -0
  136. package/dist/schema/relations.js +29 -0
  137. package/dist/schema/relations.js.map +1 -0
  138. package/dist/schema/sequence.d.ts +14 -0
  139. package/dist/schema/sequence.d.ts.map +1 -0
  140. package/dist/schema/sequence.js +16 -0
  141. package/dist/schema/sequence.js.map +1 -0
  142. package/dist/schema/table.d.ts +20 -0
  143. package/dist/schema/table.d.ts.map +1 -0
  144. package/dist/schema/table.js +22 -0
  145. package/dist/schema/table.js.map +1 -0
  146. package/dist/schema/utils/date.d.ts +33 -0
  147. package/dist/schema/utils/date.d.ts.map +1 -0
  148. package/dist/schema/utils/date.js +62 -0
  149. package/dist/schema/utils/date.js.map +1 -0
  150. package/dist/schema/utils/duration.d.ts +66 -0
  151. package/dist/schema/utils/duration.d.ts.map +1 -0
  152. package/dist/schema/utils/duration.js +167 -0
  153. package/dist/schema/utils/duration.js.map +1 -0
  154. package/dist/schema/utils/json.d.ts +2 -0
  155. package/dist/schema/utils/json.d.ts.map +1 -0
  156. package/dist/schema/utils/json.js +12 -0
  157. package/dist/schema/utils/json.js.map +1 -0
  158. package/package.json +33 -7
  159. package/dist/schema.d.ts +0 -2
  160. package/dist/schema.d.ts.map +0 -1
  161. package/dist/schema.js +0 -8
  162. package/dist/schema.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # dsqlbase
2
2
 
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 57c5e9e: connector session factories
8
+ - 4f4ecdd: internal packages restructure
9
+ - @dsqlbase/core@0.1.1
10
+
3
11
  ## 0.1.0
4
12
 
5
13
  ### Minor Changes
@@ -0,0 +1,73 @@
1
+ import { DefinitionSchema, Session } from "@dsqlbase/core";
2
+ import { QueryClient } from "./database/index.js";
3
+ export interface ClientOptions<TSchema extends DefinitionSchema> {
4
+ /**
5
+ * Definition schema for the database, including relations configuration.
6
+ */
7
+ schema: TSchema;
8
+ /**
9
+ * Session object for managing database connections and transactions.
10
+ */
11
+ session: Session;
12
+ }
13
+ /**
14
+ * Creates a new client instance for interacting with the database using the provided schema definition.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * // schema.ts
19
+ * import { table, text, uuid } from "@dsqlbase/schema";
20
+ *
21
+ * export const users = table("users", {
22
+ * id: uuid("id").primaryKey().defaultRandom(),
23
+ * firstName: text("first_name").notNull(),
24
+ * lastName: text("last_name").notNull(),
25
+ * emailAddress: text("email_address").notNull().unique(),
26
+ * });
27
+ *
28
+ * export const posts = table("posts", {
29
+ * id: uuid("id").primaryKey().defaultRandom(),
30
+ * title: text("title").notNull(),
31
+ * description: text("description"),
32
+ * content: text("content").notNull(),
33
+ * });
34
+ *
35
+ * export const userRelations = relations(users, {
36
+ * posts: hasMany(posts, {
37
+ * from: [users.columns.id],
38
+ * to: [posts.columns.userId],
39
+ * }),
40
+ * });
41
+ *
42
+ * export const postRelations = relations(posts, {
43
+ * owner: belongsTo(users, {
44
+ * from: [posts.columns.userId],
45
+ * to: [users.columns.id],
46
+ * }),
47
+ * });
48
+ *
49
+ * // client.ts
50
+ * import { createClient } from "dsqlbase";
51
+ * import * as schema from "./schema";
52
+ *
53
+ * export const dsql = createClient({ schema });
54
+ *
55
+ * // Example usage
56
+ * import { dsql } from "./client";
57
+ *
58
+ * const newUser = await dsql.users.create({
59
+ * data: {
60
+ * firstName: "John",
61
+ * lastName: "Doe",
62
+ * emailAddress: "john.doe@example.com",
63
+ * },
64
+ * });
65
+ * ```
66
+ * @param options - Configuration options for the client, including the schema definition.
67
+ * @returns A new instance of the DSQL client configured with the provided schema.
68
+ * @throws Will throw an error if the schema definition is invalid or if there are issues initializing the client.
69
+ * @see {@link ClientOptions} for more details on the configuration options.
70
+ * @see {@link ModelClient} for information on the methods available for interacting with the database tables.
71
+ */
72
+ export declare function createClient<TSchema extends DefinitionSchema>(options: ClientOptions<TSchema>): QueryClient<TSchema>;
73
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/client/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAIhB,OAAO,EACR,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAkB,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElE,MAAM,WAAW,aAAa,CAAC,OAAO,SAAS,gBAAgB;IAC7D;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AAEH,wBAAgB,YAAY,CAAC,OAAO,SAAS,gBAAgB,EAC3D,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,GAC9B,WAAW,CAAC,OAAO,CAAC,CAuBtB"}
@@ -0,0 +1,82 @@
1
+ import { ExecutionContext, QueryBuilder, SchemaRegistry, } from "@dsqlbase/core";
2
+ import { ModelClient } from "./model/client.js";
3
+ import { DatabaseClient } from "./database/index.js";
4
+ /**
5
+ * Creates a new client instance for interacting with the database using the provided schema definition.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * // schema.ts
10
+ * import { table, text, uuid } from "@dsqlbase/schema";
11
+ *
12
+ * export const users = table("users", {
13
+ * id: uuid("id").primaryKey().defaultRandom(),
14
+ * firstName: text("first_name").notNull(),
15
+ * lastName: text("last_name").notNull(),
16
+ * emailAddress: text("email_address").notNull().unique(),
17
+ * });
18
+ *
19
+ * export const posts = table("posts", {
20
+ * id: uuid("id").primaryKey().defaultRandom(),
21
+ * title: text("title").notNull(),
22
+ * description: text("description"),
23
+ * content: text("content").notNull(),
24
+ * });
25
+ *
26
+ * export const userRelations = relations(users, {
27
+ * posts: hasMany(posts, {
28
+ * from: [users.columns.id],
29
+ * to: [posts.columns.userId],
30
+ * }),
31
+ * });
32
+ *
33
+ * export const postRelations = relations(posts, {
34
+ * owner: belongsTo(users, {
35
+ * from: [posts.columns.userId],
36
+ * to: [users.columns.id],
37
+ * }),
38
+ * });
39
+ *
40
+ * // client.ts
41
+ * import { createClient } from "dsqlbase";
42
+ * import * as schema from "./schema";
43
+ *
44
+ * export const dsql = createClient({ schema });
45
+ *
46
+ * // Example usage
47
+ * import { dsql } from "./client";
48
+ *
49
+ * const newUser = await dsql.users.create({
50
+ * data: {
51
+ * firstName: "John",
52
+ * lastName: "Doe",
53
+ * emailAddress: "john.doe@example.com",
54
+ * },
55
+ * });
56
+ * ```
57
+ * @param options - Configuration options for the client, including the schema definition.
58
+ * @returns A new instance of the DSQL client configured with the provided schema.
59
+ * @throws Will throw an error if the schema definition is invalid or if there are issues initializing the client.
60
+ * @see {@link ClientOptions} for more details on the configuration options.
61
+ * @see {@link ModelClient} for information on the methods available for interacting with the database tables.
62
+ */
63
+ export function createClient(options) {
64
+ const schema = new SchemaRegistry(options.schema);
65
+ const dialect = new QueryBuilder();
66
+ const context = new ExecutionContext({
67
+ schema,
68
+ dialect,
69
+ session: options.session,
70
+ });
71
+ const dbClient = new DatabaseClient(context);
72
+ for (const [tableName, table] of Object.entries(schema.getTables())) {
73
+ const modelClient = new ModelClient(context, table);
74
+ Object.defineProperty(dbClient, tableName, {
75
+ value: modelClient,
76
+ writable: false,
77
+ enumerable: true,
78
+ });
79
+ }
80
+ return dbClient;
81
+ }
82
+ //# sourceMappingURL=create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/client/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,gBAAgB,EAChB,YAAY,EACZ,cAAc,GAEf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAe,MAAM,qBAAqB,CAAC;AAclE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AAEH,MAAM,UAAU,YAAY,CAC1B,OAA+B;IAE/B,MAAM,MAAM,GAAG,IAAI,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAClD,MAAM,OAAO,GAAG,IAAI,YAAY,EAAE,CAAC;IAEnC,MAAM,OAAO,GAAG,IAAI,gBAAgB,CAAC;QACnC,MAAM;QACN,OAAO;QACP,OAAO,EAAE,OAAO,CAAC,OAAO;KACzB,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;IAE7C,KAAK,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAW,MAAM,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC;QAC9E,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAEpD,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,SAAS,EAAE;YACzC,KAAK,EAAE,WAAW;YAClB,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;IACL,CAAC;IAED,OAAO,QAAgC,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { DefinitionSchema, ExecutionContext, SQLQuery, SQLStatement } from "@dsqlbase/core";
2
+ export declare abstract class BaseClient<T extends DefinitionSchema> {
3
+ private readonly _ctx;
4
+ constructor(ctx: ExecutionContext<T>);
5
+ $query<T = unknown>(sql: SQLQuery): Promise<T[]>;
6
+ $execute<T = unknown>(query: SQLStatement): Promise<T[]>;
7
+ }
8
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/client/database/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE5F,8BAAsB,UAAU,CAAC,CAAC,SAAS,gBAAgB;IACzD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAsB;gBAE/B,GAAG,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAI9B,MAAM,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC;IAIhD,QAAQ,CAAC,CAAC,GAAG,OAAO,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC;CAG/D"}
@@ -0,0 +1,13 @@
1
+ export class BaseClient {
2
+ _ctx;
3
+ constructor(ctx) {
4
+ this._ctx = ctx;
5
+ }
6
+ async $query(sql) {
7
+ return this.$execute(sql.toQuery());
8
+ }
9
+ async $execute(query) {
10
+ return this._ctx.session.execute(query);
11
+ }
12
+ }
13
+ //# sourceMappingURL=base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/client/database/base.ts"],"names":[],"mappings":"AAEA,MAAM,OAAgB,UAAU;IACb,IAAI,CAAsB;IAE3C,YAAY,GAAwB;QAClC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,MAAM,CAAc,GAAa;QACrC,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,QAAQ,CAAc,KAAmB;QAC7C,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAI,KAAK,CAAC,CAAC;IAC7C,CAAC;CACF"}
@@ -0,0 +1,5 @@
1
+ import { DefinitionSchema } from "@dsqlbase/core";
2
+ import { BaseClient } from "./base.js";
3
+ export declare class DatabaseClient<TDefinition extends DefinitionSchema> extends BaseClient<TDefinition> {
4
+ }
5
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/client/database/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,qBAAa,cAAc,CAAC,WAAW,SAAS,gBAAgB,CAAE,SAAQ,UAAU,CAAC,WAAW,CAAC;CAAG"}
@@ -0,0 +1,4 @@
1
+ import { BaseClient } from "./base.js";
2
+ export class DatabaseClient extends BaseClient {
3
+ }
4
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/client/database/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,MAAM,OAAO,cAAqD,SAAQ,UAAuB;CAAG"}
@@ -0,0 +1,9 @@
1
+ import { AnyTable, DefinitionSchema, RuntimeTables, Schema } from "@dsqlbase/core";
2
+ import { ModelClient } from "../model/client.js";
3
+ import { DatabaseClient } from "./client.js";
4
+ export type Models<T extends DefinitionSchema> = {
5
+ readonly [K in keyof RuntimeTables<Schema<T>>]: RuntimeTables<Schema<T>>[K] extends infer TTable ? TTable extends AnyTable ? ModelClient<TTable, T> : never : never;
6
+ };
7
+ export type QueryClient<T extends DefinitionSchema> = DatabaseClient<T> & Models<T>;
8
+ export { DatabaseClient };
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/database/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,gBAAgB,IAAI;IAC/C,QAAQ,EAAE,CAAC,IAAI,MAAM,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,MAAM,GAC5F,MAAM,SAAS,QAAQ,GACrB,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,GACtB,KAAK,GACP,KAAK;CACV,CAAC;AAEF,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,gBAAgB,IAAI,cAAc,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAEpF,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { DatabaseClient } from "./client.js";
2
+ export { DatabaseClient };
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/database/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAY7C,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -0,0 +1,6 @@
1
+ export type * from "./model/base.js";
2
+ export { isFilterType } from "./model/base.js";
3
+ export { ModelClient } from "./model/client.js";
4
+ export { DatabaseClient, type QueryClient, type Models } from "./database/index.js";
5
+ export { createClient, type ClientOptions } from "./create.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,iBAAiB,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,KAAK,WAAW,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { isFilterType } from "./model/base.js";
2
+ export { ModelClient } from "./model/client.js";
3
+ export { DatabaseClient } from "./database/index.js";
4
+ export { createClient } from "./create.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAiC,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAE,YAAY,EAAsB,MAAM,aAAa,CAAC"}
@@ -0,0 +1,330 @@
1
+ import { SQLValue } from "@dsqlbase/core";
2
+ import { AnyColumnDefinition, AnyNamespaceDefinition, AnyFieldRelation, AnyTableRelations, ColumnConfig, TableDefinition } from "@dsqlbase/core/definition";
3
+ import { AnySchema, AnyTable, SchemaTableRelations, Table } from "@dsqlbase/core/runtime";
4
+ import { Prettify } from "@dsqlbase/core/utils";
5
+ export type FieldNamesOf<T extends AnyTable> = keyof T["__type"]["columns"] extends infer K ? K extends string ? T["__type"]["columns"][K] extends AnyColumnDefinition ? K : never : never : never;
6
+ export type RelationFieldNamesOf<T extends AnyTable> = T["__type"]["relations"] extends AnyTableRelations ? keyof T["__type"]["relations"] extends infer K ? K extends string ? T["__type"]["relations"][K] extends AnyFieldRelation ? K : never : never : never : never;
7
+ export type ColumnTypeOf<T extends AnyTable, K extends FieldNamesOf<T>> = T["__type"]["columns"] extends Record<K, infer TColumn> ? TColumn extends AnyColumnDefinition ? TColumn["__type"] : never : never;
8
+ export type FieldRelationOf<T extends AnyTable, K extends RelationFieldNamesOf<T>> = T["__type"]["relations"] extends Record<K, infer R> ? R extends AnyFieldRelation ? R : never : never;
9
+ export type ValueTypeOf<T extends ColumnConfig> = T extends ColumnConfig ? T["notNull"] extends true ? T["valueType"] : T["valueType"] | null : never;
10
+ export type FieldSelectionOf<T extends AnyTable> = Partial<Record<FieldNamesOf<T>, boolean>>;
11
+ export type SelectedFieldsOf<TTable extends AnyTable, TSelection extends FieldSelectionOf<TTable>> = {
12
+ [K in keyof TSelection]: TSelection[K] extends true ? K : never;
13
+ }[keyof TSelection];
14
+ export type RequiredFieldsOf<T extends AnyTable> = {
15
+ [K in FieldNamesOf<T>]: ColumnTypeOf<T, K> extends {
16
+ notNull: true;
17
+ } ? ColumnTypeOf<T, K> extends {
18
+ hasDefault: true;
19
+ } ? never : K : never;
20
+ }[FieldNamesOf<T>];
21
+ export type RelationTypeOf<T extends AnyTable, K extends RelationFieldNamesOf<T>> = FieldRelationOf<T, K>["type"];
22
+ export type RelationTargetOf<T extends AnyTable, K extends RelationFieldNamesOf<T>> = FieldRelationOf<T, K>["target"];
23
+ export type OptionalFieldsOf<T extends AnyTable> = {
24
+ [K in FieldNamesOf<T>]: ColumnTypeOf<T, K> extends {
25
+ notNull: true;
26
+ } ? ColumnTypeOf<T, K> extends {
27
+ hasDefault: true;
28
+ } ? K : never : K;
29
+ }[FieldNamesOf<T>];
30
+ export type CreateValuesOf<T extends AnyTable> = {
31
+ [K in RequiredFieldsOf<T>]: ValueTypeOf<ColumnTypeOf<T, K>>;
32
+ } & {
33
+ [K in OptionalFieldsOf<T>]?: ValueTypeOf<ColumnTypeOf<T, K>>;
34
+ };
35
+ export type ReturningResultOf<T extends AnyTable, TArgs> = TArgs extends {
36
+ return?: infer R;
37
+ } ? R extends FieldSelectionOf<T> ? {
38
+ [K in SelectedFieldsOf<T, R>]: K extends FieldNamesOf<T> ? ValueTypeOf<ColumnTypeOf<T, K>> : never;
39
+ } : R extends true ? {
40
+ [K in FieldNamesOf<T>]: ValueTypeOf<ColumnTypeOf<T, K>>;
41
+ } : Record<string, never> : never;
42
+ export type CreateArgs<TTable extends AnyTable> = Prettify<{
43
+ data: CreateValuesOf<TTable>;
44
+ return?: FieldSelectionOf<TTable> | boolean | null | undefined;
45
+ }>;
46
+ export type UpdateValuesOf<T extends AnyTable> = {
47
+ [K in FieldNamesOf<T>]?: ValueTypeOf<ColumnTypeOf<T, K>>;
48
+ };
49
+ export type UpdateArgs<TTable extends AnyTable> = Prettify<{
50
+ set: UpdateValuesOf<TTable>;
51
+ where: WhereExpressionOf<TTable>;
52
+ return?: FieldSelectionOf<TTable> | boolean | null | undefined;
53
+ }>;
54
+ export type DeleteArgs<TTable extends AnyTable> = Prettify<{
55
+ where: WhereExpressionOf<TTable>;
56
+ return?: FieldSelectionOf<TTable> | boolean | null | undefined;
57
+ }>;
58
+ export interface QueryArgs<TTable extends AnyTable, TSchema extends AnySchema> {
59
+ /**
60
+ * Select specific fields to return in the query result. If not provided, all fields will be returned.
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * client.findOne({
65
+ * where: { id: { eq: "123" } },
66
+ * select: {
67
+ * id: true,
68
+ * firstName: true,
69
+ * },
70
+ * })
71
+ * ```
72
+ * @notes
73
+ * * The `select` clause allows you to specify which fields to retrieve, if not provided, all fields will be selected by default.
74
+ * * You can only select fields that exist on the table, attempting to select a non-existent field will result in a TypeScript error.
75
+ *
76
+ * @typeParam TTable - The table being queried, used for type inference of selectable fields.
77
+ * @typeParam TSchema - The overall schema, used for type inference of relations in join expressions.
78
+ */
79
+ select?: FieldSelectionOf<TTable>;
80
+ /**
81
+ * A filter expression to specify which records to retrieve. This is optional for `findMany`, if not provided, all records will be returned.
82
+ *
83
+ * @example
84
+ * ```ts
85
+ * client.findMany({
86
+ * where: { published: true },
87
+ * });
88
+ * ```
89
+ * @notes
90
+ * * The `where` clause is optional for `findMany`, if not provided, all records will be returned.
91
+ * * The `where` clause supports various filter conditions such as equality, inequality, range queries, and more.
92
+ * * You can combine multiple conditions using logical operators like `and`, `or`, and `not`.
93
+ * * The fields used in the `where` clause must exist on the table, attempting to filter by a non-existent field will result in a TypeScript error.
94
+ *
95
+ * @typeParam TTable - The table being queried, used for type inference of filterable fields.
96
+ */
97
+ where?: WhereExpressionOf<TTable>;
98
+ /**
99
+ * Specify the order in which to return the records. The keys must be field names of the table, and the values must be either "asc" for ascending order or "desc" for descending order.
100
+ *
101
+ * @example
102
+ * ```ts
103
+ * client.findMany({
104
+ * orderBy: { createdAt: "desc" },
105
+ * });
106
+ * ```
107
+ * @notes
108
+ * * The `orderBy` clause allows you to specify the order in which to return the records. The keys must be field names of the table, and the values must be either "asc" for ascending order or "desc" for descending order.
109
+ * * You can specify multiple fields to order by, in which case the records will be ordered by the first field, and then by the second field in case of ties, and so on.
110
+ * * The fields used in the `orderBy` clause must exist on the table, attempting to order by a non-existent field will result in a TypeScript error.
111
+ *
112
+ * @typeParam TTable - The table being queried, used for type inference of orderable fields.
113
+ */
114
+ orderBy?: OrderByExpressionOf<TTable>;
115
+ /**
116
+ * Specify that the query should return only distinct records based on the selected fields. This is useful when you want to eliminate duplicate records from the result set.
117
+ *
118
+ * @example
119
+ * ```ts
120
+ * client.findMany({
121
+ * where: { published: true },
122
+ * distinct: true,
123
+ * });
124
+ * ```
125
+ * @notes
126
+ * * The `distinct` flag indicates that the query should return only distinct records based on the selected fields. This is useful when you want to eliminate duplicate records from the result set.
127
+ * * When `distinct` is true, the database will ensure that the returned records are unique based on the fields specified in the `select` clause. If no `select` clause is provided, all fields will be considered for determining uniqueness.
128
+ * * The `distinct` flag is typically used in conjunction with the `select` clause to specify which fields should be considered when determining uniqueness. If you want to return distinct records based on specific fields, make sure to include those fields in the `select` clause.
129
+ * * The behavior of the `distinct` flag may vary depending on the underlying database and how it handles distinct queries, especially when combined with joins and other query features.
130
+ */
131
+ distinct?: boolean;
132
+ /**
133
+ * Specify the maximum number of records to return and the number of records to skip. This is useful for implementing pagination in your queries.
134
+ *
135
+ * @example
136
+ * ```ts
137
+ * client.findMany({
138
+ * where: { published: true },
139
+ * limit: 10,
140
+ * offset: 20,
141
+ * });
142
+ * ```
143
+ * @notes
144
+ * * The `limit` parameter specifies the maximum number of records to return. If not provided, the default limit _(100)_ will be applied.
145
+ * * The `offset` parameter specifies the number of records to skip before starting to return records. This is useful for implementing pagination in your queries. If not provided, no records will be skipped.
146
+ * * When using `limit` and `offset` together, the query will return records starting from the `offset` position up to the number specified by `limit`. For example, if `offset` is 20 and `limit` is 10, the query will return records 21 through 30.
147
+ */
148
+ limit?: number;
149
+ /**
150
+ * The `offset` parameter specifies the number of records to skip before starting to return records. This is useful for implementing pagination in your queries. If not provided, no records will be skipped.
151
+ *
152
+ * @example
153
+ * ```ts
154
+ * client.findMany({
155
+ * where: { published: true },
156
+ * offset: 20,
157
+ * });
158
+ * ```
159
+ * @notes
160
+ * * The `offset` parameter specifies the number of records to skip before starting to return records. This is useful for implementing pagination in your queries. If not provided, no records will be skipped.
161
+ * * When using `limit` and `offset` together, the query will return records starting from the `offset` position up to the number specified by `limit`. For example, if `offset` is 20 and `limit` is 10, the query will return records 21 through 30.
162
+ */
163
+ offset?: number;
164
+ /**
165
+ * Join related records based on the relations defined in the schema. The value can be a boolean or a nested query object for more complex queries.
166
+ *
167
+ * @example
168
+ * ```ts
169
+ * client.findOne({
170
+ * where: { id: "123" },
171
+ * select: {
172
+ * id: true,
173
+ * firstName: true,
174
+ * },
175
+ * join: {
176
+ * posts: {
177
+ * where: { published: true },
178
+ * select: {
179
+ * title: true,
180
+ * },
181
+ * },
182
+ * profile: true,
183
+ * },
184
+ * })
185
+ * ```
186
+ */
187
+ join?: Prettify<JoinExpressionOf<TTable, TSchema>>;
188
+ }
189
+ export interface FindOneArgs<TTable extends AnyTable, TSchema extends AnySchema> extends Pick<QueryArgs<TTable, TSchema>, "select" | "join"> {
190
+ /**
191
+ * A filter expression to specify which record to retrieve. This is required for `findOne` to ensure that the operation is deterministic and does not accidentally return an unintended record.
192
+ *
193
+ * @example
194
+ * ```ts
195
+ * client.findOne({
196
+ * where: { id: { eq: "123" } },
197
+ * });
198
+ * ```
199
+ * @notes
200
+ * * The `where` clause is required for `findOne` to ensure that the operation is deterministic and does not accidentally return an unintended record.
201
+ * * The `where` clause supports various filter conditions such as equality, inequality, range queries, and more.
202
+ * * You can combine multiple conditions using logical operators like `and`, `or`, and `not`.
203
+ * * The fields used in the `where` clause must exist on the table, attempting to filter by a non-existent field will result in a TypeScript error.
204
+ *
205
+ * @typeParam TTable - The table being queried, used for type inference of filterable fields.
206
+ */
207
+ where: WhereExpressionOf<TTable>;
208
+ }
209
+ export type RelationQueryOf<T extends AnyTable, S extends AnySchema, K extends RelationFieldNamesOf<T>> = RelationTargetOf<T, K> extends TableDefinition<infer TName, infer TCols, infer TSchema> ? RelationTypeOf<T, K> extends "has_many" ? QueryArgs<Table<TName, TCols, TSchema, SchemaTableRelations<S, TName>>, S> : Pick<QueryArgs<Table<TName, TCols, TSchema, SchemaTableRelations<S, TName>>, S>, "select" | "join"> : never;
210
+ export type SelectionResultOf<TTable extends AnyTable, TSchema extends AnySchema, TArgs extends QueryArgs<TTable, TSchema>> = TArgs["select"] extends FieldSelectionOf<TTable> ? {
211
+ [K in SelectedFieldsOf<TTable, TArgs["select"]>]: K extends FieldNamesOf<TTable> ? ValueTypeOf<ColumnTypeOf<TTable, K>> : never;
212
+ } : {
213
+ [K in FieldNamesOf<TTable>]: ValueTypeOf<ColumnTypeOf<TTable, K>>;
214
+ };
215
+ export type RelationJoinResultOf<TTable extends AnyTable, TSchema extends AnySchema, TArgs extends QueryArgs<TTable, TSchema>, TRelationField extends RelationFieldNamesOf<TTable>, TTargetName extends string, TTargetCols extends Record<string, AnyColumnDefinition>, TTargetSchema extends AnyNamespaceDefinition> = RelationTypeOf<TTable, TRelationField> extends "has_many" ? QueryResultOf<Table<TTargetName, TTargetCols, TTargetSchema, SchemaTableRelations<TSchema, TTargetName>>, TSchema, TArgs>[] : QueryResultOf<Table<TTargetName, TTargetCols, TTargetSchema, SchemaTableRelations<TSchema, TTargetName>>, TSchema, TArgs> | null;
216
+ export type QueryResultOf<TTable extends AnyTable, TSchema extends AnySchema, TArgs extends QueryArgs<TTable, TSchema>> = Prettify<SelectionResultOf<TTable, TSchema, TArgs> & {
217
+ [K in keyof TArgs["join"]]: K extends RelationFieldNamesOf<TTable> ? RelationTargetOf<TTable, K> extends TableDefinition<infer TName, infer TCols, infer TNamespace> ? TArgs["join"][K] extends QueryArgs<Table<TName, TCols, TNamespace, SchemaTableRelations<TSchema, TName>>, TSchema> ? RelationJoinResultOf<TTable, TSchema, TArgs["join"][K], K, TName, TCols, TNamespace> : TArgs["join"][K] extends boolean ? TArgs["join"][K] extends true ? RelationJoinResultOf<TTable, TSchema, QueryArgs<Table<TName, TCols, TNamespace, SchemaTableRelations<TSchema, TName>>, TSchema>, K, TName, TCols, TNamespace> : never : never : never : never;
218
+ }>;
219
+ export interface FilterCondition<Value = unknown> {
220
+ /**
221
+ * Equality condition - matches records where the field is equal to the specified value.
222
+ *
223
+ * ```sql
224
+ * "table"."column" = value
225
+ * ```
226
+ */
227
+ eq?: Value;
228
+ /**
229
+ * Inequality condition - matches records where the field is not equal to the specified value.
230
+ *
231
+ * ```sql
232
+ * "table"."column" <> value
233
+ * ```
234
+ */
235
+ neq?: Value;
236
+ /**
237
+ * Greater than condition - matches records where the field is greater than the specified value.
238
+ *
239
+ * ```sql
240
+ * "table"."column" > value
241
+ * ```
242
+ */
243
+ gt?: Value;
244
+ /**
245
+ * Greater than or equal condition - matches records where the field is greater than or equal to the specified value.
246
+ *
247
+ * ```sql
248
+ * "table"."column" >= value
249
+ * ```
250
+ */
251
+ gte?: Value;
252
+ /**
253
+ * Less than condition - matches records where the field is less than the specified value.
254
+ *
255
+ * ```sql
256
+ * "table"."column" < value
257
+ * ```
258
+ */
259
+ lt?: Value;
260
+ /**
261
+ * Less than or equal condition - matches records where the field is less than or equal to the specified value.
262
+ *
263
+ * ```sql
264
+ * "table"."column" <= value
265
+ * ```
266
+ */
267
+ lte?: Value;
268
+ /**
269
+ * In condition - matches records where the field is equal to any of the values in the specified array.
270
+ *
271
+ * ```sql
272
+ * "table"."column" IN (value1, value2, ...)
273
+ * ```
274
+ */
275
+ in?: Value[];
276
+ /**
277
+ * Between condition - matches records where the field is between the two specified values (inclusive).
278
+ *
279
+ * ```sql
280
+ * "table"."column" BETWEEN value1 AND value2
281
+ * ```
282
+ */
283
+ between?: [Value, Value];
284
+ /**
285
+ * Exists condition - matches records where the field exists (is not null).
286
+ *
287
+ * ```sql
288
+ * "table"."column" IS NOT NULL
289
+ * ```
290
+ */
291
+ exists?: boolean;
292
+ /**
293
+ * Begins with condition - matches records where the field starts with the specified string.
294
+ *
295
+ * ```sql
296
+ * "table"."column" LIKE 'value%'
297
+ * ```
298
+ */
299
+ beginsWith?: string;
300
+ /**
301
+ * Ends with condition - matches records where the field ends with the specified string.
302
+ *
303
+ * ```sql
304
+ * "table"."column" LIKE '%value'
305
+ * ```
306
+ */
307
+ endsWith?: string;
308
+ /**
309
+ * Contains condition - matches records where the field contains the specified string.
310
+ *
311
+ * ```sql
312
+ * "table"."column" LIKE '%value%'
313
+ * ```
314
+ */
315
+ contains?: string;
316
+ }
317
+ export type WhereExpressionOf<T extends AnyTable> = {
318
+ [K in FieldNamesOf<T>]?: T["__type"]["columns"][K] extends AnyColumnDefinition ? FilterCondition<ValueTypeOf<ColumnTypeOf<T, K>>> | ValueTypeOf<ColumnTypeOf<T, K>> : never;
319
+ } & {
320
+ and?: WhereExpressionOf<T>[];
321
+ or?: WhereExpressionOf<T>[];
322
+ not?: WhereExpressionOf<T>;
323
+ };
324
+ export type OrderByExpressionOf<T extends AnyTable> = Partial<Record<FieldNamesOf<T>, "asc" | "desc">>;
325
+ export type JoinExpressionOf<T extends AnyTable, S extends AnySchema> = {
326
+ [K in RelationFieldNamesOf<T>]?: RelationQueryOf<T, S, K> | boolean | null | undefined;
327
+ };
328
+ export type AnyRelationQuery = RelationQueryOf<AnyTable, AnySchema, RelationFieldNamesOf<AnyTable>> | boolean;
329
+ export declare function isFilterType<T extends keyof FilterCondition>(value: unknown, type: T): value is Required<Pick<FilterCondition<SQLValue>, T>>;
330
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/client/model/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,eAAe,EAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,QAAQ,IAAI,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,SAAS,MAAM,CAAC,GACvF,CAAC,SAAS,MAAM,GACd,CAAC,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,mBAAmB,GACnD,CAAC,GACD,KAAK,GACP,KAAK,GACP,KAAK,CAAC;AAEV,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,QAAQ,IACjD,CAAC,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,SAAS,iBAAiB,GAC9C,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,WAA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,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAOvD"}
@@ -0,0 +1,7 @@
1
+ export function isFilterType(value, type) {
2
+ return (typeof value === "object" &&
3
+ value !== null &&
4
+ type in value &&
5
+ value[type] !== undefined);
6
+ }
7
+ //# sourceMappingURL=base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/client/model/base.ts"],"names":[],"mappings":"AA0fA,MAAM,UAAU,YAAY,CAC1B,KAAc,EACd,IAAO;IAEP,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,IAAI,IAAI,KAAK;QACb,KAAK,CAAC,IAA0B,CAAC,KAAK,SAAS,CAChD,CAAC;AACJ,CAAC"}