@prisma/studio-core 0.0.0-dev.202503182320 → 0.0.0-dev.202503190336

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.
@@ -16,18 +16,18 @@ export type SchemaName = string;
16
16
  export type InstrospectResult = {
17
17
  schemas: Record<SchemaName, InstrospectSchemaMeta>;
18
18
  filters: Record<QueryFilterOperator, boolean>;
19
- }
19
+ };
20
20
 
21
21
  export type InstrospectSchemaMeta = {
22
22
  tables: Record<TableName, InstrospectTableMeta>;
23
- enums: Record<EnumName, EnumMeta>
24
- }
23
+ enums: Record<EnumName, EnumMeta>;
24
+ };
25
25
 
26
26
  export type InstrospectTableMeta = {
27
27
  schema: SchemaName;
28
28
  name: TableName;
29
29
  columns: Record<ColumnName, InstrospectColumnMeta>;
30
- }
30
+ };
31
31
 
32
32
  export type InstrospectColumnMeta = {
33
33
  schema: SchemaName;
@@ -39,60 +39,60 @@ export type InstrospectColumnMeta = {
39
39
  nullable: boolean;
40
40
  partOfPk: boolean;
41
41
  reference: InstrospectTableMeta | null;
42
- }
42
+ };
43
43
 
44
44
  export type IntrospectDataType = {
45
45
  name: string;
46
46
  args: (string | number)[];
47
- }
47
+ };
48
48
 
49
49
  export type IntrospectUiType =
50
50
  | {
51
- kind: 'string'
52
- isList: boolean;
53
- max: number;
54
- min: number;
55
- }
51
+ kind: "string";
52
+ isList: boolean;
53
+ max: number;
54
+ min: number;
55
+ }
56
56
  | {
57
- kind: 'number'
58
- isList: boolean;
59
- max: number;
60
- min: number;
61
- }
57
+ kind: "number";
58
+ isList: boolean;
59
+ max: number;
60
+ min: number;
61
+ }
62
62
  | {
63
- kind: 'decimal'
64
- isList: boolean;
65
- max: number;
66
- min: number;
67
- decimalPlaces: number;
68
- }
63
+ kind: "decimal";
64
+ isList: boolean;
65
+ max: number;
66
+ min: number;
67
+ decimalPlaces: number;
68
+ }
69
69
  | {
70
- kind: 'boolean'
71
- isList: boolean;
72
- }
70
+ kind: "boolean";
71
+ isList: boolean;
72
+ }
73
73
  | {
74
- kind: 'datetime'
75
- isList: boolean;
76
- }
74
+ kind: "datetime";
75
+ isList: boolean;
76
+ }
77
77
  | {
78
- kind: 'json'
79
- isList: boolean;
80
- }
78
+ kind: "json";
79
+ isList: boolean;
80
+ }
81
81
  | {
82
- kind: 'blob'
83
- isList: boolean;
84
- }
82
+ kind: "blob";
83
+ isList: boolean;
84
+ }
85
85
  | {
86
- kind: 'enum'
87
- isList: boolean;
88
- name: EnumName;
89
- values: string[];
90
- }
86
+ kind: "enum";
87
+ isList: boolean;
88
+ name: EnumName;
89
+ values: string[];
90
+ };
91
91
 
92
92
  export type EnumMeta = {
93
93
  name: EnumName;
94
94
  values: string[];
95
- }
95
+ };
96
96
 
97
97
  export type QueryInput = {
98
98
  schema: SchemaName;
@@ -101,45 +101,51 @@ export type QueryInput = {
101
101
  sortings: QuerySorting[];
102
102
  limit?: number;
103
103
  offset?: number;
104
- }
104
+ };
105
105
 
106
106
  export type QueryFilter = {
107
107
  column: ColumnName;
108
108
  operator: QueryFilterOperator;
109
109
  value: unknown[] | InstrospectColumnMeta[];
110
110
  not?: boolean;
111
- }
111
+ };
112
112
 
113
113
  export type QuerySorting = {
114
114
  column: ColumnName;
115
- order: 'asc' | 'desc';
116
- }
115
+ order: "asc" | "desc";
116
+ };
117
117
 
118
- export type QueryFilterOperator = '=' | '>=' | '>' | '<=' | '<' | 'like' | 'ilike' | 'is null' | (string & {})
118
+ export type QueryFilterOperator = "=" | ">=" | ">" | "<=" | "<" | "like" | "ilike" | "is null" | (string & {});
119
119
 
120
120
  export type QueryResult = {
121
121
  schema: SchemaName;
122
122
  table: TableName;
123
123
  fetchedAt: number;
124
124
  duration: number;
125
- rows: Record<ColumnName, QueryResultColumn>[]
125
+ rows: Record<ColumnName, QueryResultColumn>[];
126
126
  count: number;
127
- }
127
+ };
128
128
 
129
129
  export type QueryResultColumn = {
130
130
  column: ColumnName;
131
131
  value: unknown;
132
132
  dataType?: IntrospectDataType;
133
133
  uiType?: IntrospectUiType;
134
- }
134
+ };
135
135
 
136
136
  // TODO: Implement the following types
137
137
 
138
- export type MutateInput = {}
139
- export type MutateResult = {}
138
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
139
+ export type MutateInput = {};
140
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
141
+ export type MutateResult = {};
140
142
 
141
- export type AlterInput = {}
142
- export type AlterResult = {}
143
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
144
+ export type AlterInput = {};
145
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
146
+ export type AlterResult = {};
143
147
 
144
- export type RawQueryInput = {}
145
- export type RawQueryResult = {}
148
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
149
+ export type RawQueryInput = {};
150
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
151
+ export type RawQueryResult = {};
@@ -1,130 +1,147 @@
1
- import { Adapter, AlterInput, AlterResult, Either, InstrospectResult, MutateInput, MutateResult, QueryInput, QueryResult, RawQueryInput, RawQueryResult } from "./Adapter";
1
+ import {
2
+ Adapter,
3
+ AlterInput,
4
+ AlterResult,
5
+ Either,
6
+ InstrospectResult,
7
+ MutateInput,
8
+ MutateResult,
9
+ QueryInput,
10
+ QueryResult,
11
+ RawQueryInput,
12
+ RawQueryResult,
13
+ } from "./Adapter";
2
14
 
3
15
  export class AdapterMock implements Adapter {
16
+ // eslint-disable-next-line @typescript-eslint/require-await, @typescript-eslint/no-unused-vars
4
17
  async introspect(): Promise<Either<Error, InstrospectResult>> {
5
- return [null, {
6
- schemas: {
7
- public: {
8
- tables: {
9
- users: {
10
- schema: "public",
11
- name: "users",
12
- columns: {
13
- id: {
14
- schema: "public",
15
- table: "users",
16
- name: "id",
17
- dataType: { name: "integer", args: [] },
18
- uiType: { kind: "number", isList: false, max: 10000, min: 0 },
19
- defaults: null,
20
- nullable: false,
21
- partOfPk: true,
22
- reference: null,
23
- },
24
- name: {
25
- schema: "public",
26
- table: "users",
27
- name: "name",
28
- dataType: { name: "varchar", args: [255] },
29
- uiType: { kind: "string", isList: false, max: 255, min: 0 },
30
- defaults: null,
31
- nullable: false,
32
- partOfPk: false,
33
- reference: null,
34
- },
35
- role: {
36
- schema: "public",
37
- table: "users",
38
- name: "role",
39
- dataType: { name: "enum", args: [] },
40
- uiType: {
41
- kind: "enum",
42
- isList: false,
43
- name: "UserRole",
44
- values: ["admin", "user", "guest"],
18
+ return [
19
+ null,
20
+ {
21
+ schemas: {
22
+ public: {
23
+ tables: {
24
+ users: {
25
+ schema: "public",
26
+ name: "users",
27
+ columns: {
28
+ id: {
29
+ schema: "public",
30
+ table: "users",
31
+ name: "id",
32
+ dataType: { name: "integer", args: [] },
33
+ uiType: { kind: "number", isList: false, max: 10000, min: 0 },
34
+ defaults: null,
35
+ nullable: false,
36
+ partOfPk: true,
37
+ reference: null,
38
+ },
39
+ name: {
40
+ schema: "public",
41
+ table: "users",
42
+ name: "name",
43
+ dataType: { name: "varchar", args: [255] },
44
+ uiType: { kind: "string", isList: false, max: 255, min: 0 },
45
+ defaults: null,
46
+ nullable: false,
47
+ partOfPk: false,
48
+ reference: null,
49
+ },
50
+ role: {
51
+ schema: "public",
52
+ table: "users",
53
+ name: "role",
54
+ dataType: { name: "enum", args: [] },
55
+ uiType: {
56
+ kind: "enum",
57
+ isList: false,
58
+ name: "UserRole",
59
+ values: ["admin", "user", "guest"],
60
+ },
61
+ defaults: "user",
62
+ nullable: false,
63
+ partOfPk: false,
64
+ reference: null,
45
65
  },
46
- defaults: "user",
47
- nullable: false,
48
- partOfPk: false,
49
- reference: null,
50
66
  },
51
67
  },
52
- },
53
- posts: {
54
- schema: "public",
55
- name: "posts",
56
- columns: {
57
- id: {
58
- schema: "public",
59
- table: "posts",
60
- name: "id",
61
- dataType: { name: "integer", args: [] },
62
- uiType: { kind: "number", isList: false, max: 10000, min: 0 },
63
- defaults: null,
64
- nullable: false,
65
- partOfPk: true,
66
- reference: null,
67
- },
68
- title: {
69
- schema: "public",
70
- table: "posts",
71
- name: "title",
72
- dataType: { name: "varchar", args: [255] },
73
- uiType: { kind: "string", isList: false, max: 255, min: 0 },
74
- defaults: null,
75
- nullable: false,
76
- partOfPk: false,
77
- reference: null,
78
- },
79
- content: {
80
- schema: "public",
81
- table: "posts",
82
- name: "content",
83
- dataType: { name: "text", args: [] },
84
- uiType: { kind: "string", isList: false, max: 10000, min: 0 },
85
- defaults: null,
86
- nullable: true,
87
- partOfPk: false,
88
- reference: null,
89
- },
90
- userId: {
91
- schema: "public",
92
- table: "posts",
93
- name: "userId",
94
- dataType: { name: "integer", args: [] },
95
- uiType: { kind: "number", isList: false, max: 10000, min: 0 },
96
- defaults: null,
97
- nullable: false,
98
- partOfPk: false,
99
- reference: {
68
+ posts: {
69
+ schema: "public",
70
+ name: "posts",
71
+ columns: {
72
+ id: {
73
+ schema: "public",
74
+ table: "posts",
75
+ name: "id",
76
+ dataType: { name: "integer", args: [] },
77
+ uiType: { kind: "number", isList: false, max: 10000, min: 0 },
78
+ defaults: null,
79
+ nullable: false,
80
+ partOfPk: true,
81
+ reference: null,
82
+ },
83
+ title: {
84
+ schema: "public",
85
+ table: "posts",
86
+ name: "title",
87
+ dataType: { name: "varchar", args: [255] },
88
+ uiType: { kind: "string", isList: false, max: 255, min: 0 },
89
+ defaults: null,
90
+ nullable: false,
91
+ partOfPk: false,
92
+ reference: null,
93
+ },
94
+ content: {
95
+ schema: "public",
96
+ table: "posts",
97
+ name: "content",
98
+ dataType: { name: "text", args: [] },
99
+ uiType: { kind: "string", isList: false, max: 10000, min: 0 },
100
+ defaults: null,
101
+ nullable: true,
102
+ partOfPk: false,
103
+ reference: null,
104
+ },
105
+ userId: {
100
106
  schema: "public",
101
- name: "users",
102
- columns: {}, // This can be expanded if needed.
107
+ table: "posts",
108
+ name: "userId",
109
+ dataType: { name: "integer", args: [] },
110
+ uiType: { kind: "number", isList: false, max: 10000, min: 0 },
111
+ defaults: null,
112
+ nullable: false,
113
+ partOfPk: false,
114
+ reference: {
115
+ schema: "public",
116
+ name: "users",
117
+ columns: {}, // This can be expanded if needed.
118
+ },
103
119
  },
104
120
  },
105
121
  },
106
122
  },
107
- },
108
- enums: {
109
- UserRole: {
110
- name: "UserRole",
111
- values: ["admin", "user", "guest"],
123
+ enums: {
124
+ UserRole: {
125
+ name: "UserRole",
126
+ values: ["admin", "user", "guest"],
127
+ },
112
128
  },
113
129
  },
114
130
  },
131
+ filters: {
132
+ "=": true,
133
+ ">=": true,
134
+ ">": true,
135
+ "<=": true,
136
+ "<": true,
137
+ like: true,
138
+ ilike: false,
139
+ "is null": true,
140
+ },
115
141
  },
116
- filters: {
117
- "=": true,
118
- ">=": true,
119
- ">": true,
120
- "<=": true,
121
- "<": true,
122
- "like": true,
123
- "ilike": false,
124
- "is null": true,
125
- },
126
- }]
142
+ ];
127
143
  }
144
+ // eslint-disable-next-line @typescript-eslint/require-await, @typescript-eslint/no-unused-vars
128
145
  async query(input: QueryInput): Promise<Either<Error, QueryResult>> {
129
146
  return [
130
147
  null,
@@ -187,15 +204,18 @@ export class AdapterMock implements Adapter {
187
204
  },
188
205
  ],
189
206
  },
190
- ]
207
+ ];
191
208
  }
209
+ // eslint-disable-next-line @typescript-eslint/require-await, @typescript-eslint/no-unused-vars
192
210
  async mutate(inputs: MutateInput[]): Promise<Either<Error, MutateResult>> {
193
211
  throw new Error("Method not implemented.");
194
212
  }
213
+ // eslint-disable-next-line @typescript-eslint/require-await, @typescript-eslint/no-unused-vars
195
214
  async alter(inputs: AlterInput[]): Promise<Either<Error, AlterResult>> {
196
215
  throw new Error("Method not implemented.");
197
216
  }
217
+ // eslint-disable-next-line @typescript-eslint/require-await, @typescript-eslint/no-unused-vars
198
218
  async rawQuery(input: RawQueryInput): Promise<Either<Error, RawQueryResult>> {
199
219
  throw new Error("Method not implemented.");
200
220
  }
201
- }
221
+ }
package/data/index.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { type Adapter } from './adapter/Adapter';
2
- export { AdapterMock } from './adapter/AdapterMock';
1
+ export { type Adapter } from "./adapter/Adapter";
2
+ export { AdapterMock } from "./adapter/AdapterMock";
@@ -39,35 +39,35 @@ type IntrospectDataType = {
39
39
  args: (string | number)[];
40
40
  };
41
41
  type IntrospectUiType = {
42
- kind: 'string';
42
+ kind: "string";
43
43
  isList: boolean;
44
44
  max: number;
45
45
  min: number;
46
46
  } | {
47
- kind: 'number';
47
+ kind: "number";
48
48
  isList: boolean;
49
49
  max: number;
50
50
  min: number;
51
51
  } | {
52
- kind: 'decimal';
52
+ kind: "decimal";
53
53
  isList: boolean;
54
54
  max: number;
55
55
  min: number;
56
56
  decimalPlaces: number;
57
57
  } | {
58
- kind: 'boolean';
58
+ kind: "boolean";
59
59
  isList: boolean;
60
60
  } | {
61
- kind: 'datetime';
61
+ kind: "datetime";
62
62
  isList: boolean;
63
63
  } | {
64
- kind: 'json';
64
+ kind: "json";
65
65
  isList: boolean;
66
66
  } | {
67
- kind: 'blob';
67
+ kind: "blob";
68
68
  isList: boolean;
69
69
  } | {
70
- kind: 'enum';
70
+ kind: "enum";
71
71
  isList: boolean;
72
72
  name: EnumName;
73
73
  values: string[];
@@ -92,9 +92,9 @@ type QueryFilter = {
92
92
  };
93
93
  type QuerySorting = {
94
94
  column: ColumnName;
95
- order: 'asc' | 'desc';
95
+ order: "asc" | "desc";
96
96
  };
97
- type QueryFilterOperator = '=' | '>=' | '>' | '<=' | '<' | 'like' | 'ilike' | 'is null' | (string & {});
97
+ type QueryFilterOperator = "=" | ">=" | ">" | "<=" | "<" | "like" | "ilike" | "is null" | (string & {});
98
98
  type QueryResult = {
99
99
  schema: SchemaName;
100
100
  table: TableName;
@@ -0,0 +1,3 @@
1
+ import baseConfig from "../../eslint.config.base.mjs";
2
+
3
+ export default baseConfig({ metaUrl: import.meta.url });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/studio-core",
3
- "version": "0.0.0-dev.202503182320",
3
+ "version": "0.0.0-dev.202503190336",
4
4
  "description": "Modular Prisma Studio components",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/data/index.js",