@prisma/studio-core 0.0.0-dev.202503281209 → 0.0.0-dev.202503281245
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/dist/adapter-08vtHScw.d.ts +40 -0
- package/dist/adapter-CW2L6BRg.d.cts +40 -0
- package/dist/data/bff/index.cjs +1 -1
- package/dist/data/bff/index.d.cts +5 -7
- package/dist/data/bff/index.d.ts +5 -7
- package/dist/data/bff/index.js +1 -1
- package/dist/data/index.cjs +1 -1
- package/dist/data/index.d.cts +3 -11
- package/dist/data/index.d.ts +3 -11
- package/dist/data/index.js +1 -1
- package/dist/data/postgres-core/index.cjs +1 -1
- package/dist/data/postgres-core/index.d.cts +10 -11
- package/dist/data/postgres-core/index.d.ts +10 -11
- package/dist/data/postgres-core/index.js +1 -1
- package/dist/executor-BjkBF_Xv.d.ts +8 -0
- package/dist/executor-DVs9UVdS.d.cts +8 -0
- package/dist/type-utils-rTHUvEmt.d.cts +3 -0
- package/dist/type-utils-rTHUvEmt.d.ts +3 -0
- package/dist/ui/index.cjs +1 -1
- package/dist/ui/index.d.cts +2 -1
- package/dist/ui/index.d.ts +2 -1
- package/dist/ui/index.js +1 -1
- package/package.json +1 -1
- package/dist/Adapter-C2FVF4Hg.d.cts +0 -119
- package/dist/Adapter-C2FVF4Hg.d.ts +0 -119
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { E as Either } from './type-utils-rTHUvEmt.js';
|
|
2
|
+
|
|
3
|
+
interface Adapter {
|
|
4
|
+
introspect(): Promise<Either<Error, Introspection>>;
|
|
5
|
+
query(details: QueryDetails): Promise<Either<Error, QueryResult>>;
|
|
6
|
+
}
|
|
7
|
+
type SchemaName = string;
|
|
8
|
+
interface Introspection {
|
|
9
|
+
schemas: Record<SchemaName, Schema>;
|
|
10
|
+
}
|
|
11
|
+
type TableName = string;
|
|
12
|
+
interface Schema {
|
|
13
|
+
tables: Record<TableName, Table>;
|
|
14
|
+
}
|
|
15
|
+
type ColumnName = string;
|
|
16
|
+
interface Table {
|
|
17
|
+
schema: SchemaName;
|
|
18
|
+
name: TableName;
|
|
19
|
+
columns: Record<ColumnName, Column>;
|
|
20
|
+
}
|
|
21
|
+
interface Column {
|
|
22
|
+
schema: SchemaName;
|
|
23
|
+
table: TableName;
|
|
24
|
+
name: ColumnName;
|
|
25
|
+
}
|
|
26
|
+
interface QueryDetails {
|
|
27
|
+
/**
|
|
28
|
+
* The database schema where the table is located. Defaults to "public".
|
|
29
|
+
*/
|
|
30
|
+
schema?: string;
|
|
31
|
+
/**
|
|
32
|
+
* The name of the table to select from.
|
|
33
|
+
*/
|
|
34
|
+
table: string;
|
|
35
|
+
}
|
|
36
|
+
interface QueryResult {
|
|
37
|
+
rows: Record<ColumnName, unknown>[];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export type { Adapter as A, Column as C, Introspection as I, QueryDetails as Q, Schema as S, Table as T };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { E as Either } from './type-utils-rTHUvEmt.cjs';
|
|
2
|
+
|
|
3
|
+
interface Adapter {
|
|
4
|
+
introspect(): Promise<Either<Error, Introspection>>;
|
|
5
|
+
query(details: QueryDetails): Promise<Either<Error, QueryResult>>;
|
|
6
|
+
}
|
|
7
|
+
type SchemaName = string;
|
|
8
|
+
interface Introspection {
|
|
9
|
+
schemas: Record<SchemaName, Schema>;
|
|
10
|
+
}
|
|
11
|
+
type TableName = string;
|
|
12
|
+
interface Schema {
|
|
13
|
+
tables: Record<TableName, Table>;
|
|
14
|
+
}
|
|
15
|
+
type ColumnName = string;
|
|
16
|
+
interface Table {
|
|
17
|
+
schema: SchemaName;
|
|
18
|
+
name: TableName;
|
|
19
|
+
columns: Record<ColumnName, Column>;
|
|
20
|
+
}
|
|
21
|
+
interface Column {
|
|
22
|
+
schema: SchemaName;
|
|
23
|
+
table: TableName;
|
|
24
|
+
name: ColumnName;
|
|
25
|
+
}
|
|
26
|
+
interface QueryDetails {
|
|
27
|
+
/**
|
|
28
|
+
* The database schema where the table is located. Defaults to "public".
|
|
29
|
+
*/
|
|
30
|
+
schema?: string;
|
|
31
|
+
/**
|
|
32
|
+
* The name of the table to select from.
|
|
33
|
+
*/
|
|
34
|
+
table: string;
|
|
35
|
+
}
|
|
36
|
+
interface QueryResult {
|
|
37
|
+
rows: Record<ColumnName, unknown>[];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export type { Adapter as A, Column as C, Introspection as I, QueryDetails as Q, Schema as S, Table as T };
|
package/dist/data/bff/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var i=Object.defineProperty;var
|
|
1
|
+
"use strict";var i=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var l=(t,e)=>{for(var o in e)i(t,o,{get:e[o],enumerable:!0})},p=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of y(e))!d.call(t,r)&&r!==o&&i(t,r,{get:()=>e[r],enumerable:!(n=a(e,r))||n.enumerable});return t};var f=t=>p(i({},"__esModule",{value:!0}),t);var x={};l(x,{createStudioBFFClient:()=>m});module.exports=f(x);function m(t){let{customHeaders:e,customPayload:o,url:n}=t,r=t.fetch||fetch;return{async execute(c){try{let u=await r(n,{body:JSON.stringify({customPayload:o,procedure:"query",query:c}),headers:{Accept:"application/json","Content-Type":"application/json",...e},method:"POST"});if(!u.ok){let s;try{s=await u.text()}catch{s="unknown error"}return[new Error(s)]}return[null,await u.json()]}catch(u){return[u]}}}}0&&(module.exports={createStudioBFFClient});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { E as Executor } from '../../executor-DVs9UVdS.cjs';
|
|
1
2
|
import { Q as Query, a as QueryResult } from '../../query-L1_vLuFd.cjs';
|
|
3
|
+
import { E as Either } from '../../type-utils-rTHUvEmt.cjs';
|
|
2
4
|
import 'kysely';
|
|
3
5
|
|
|
4
6
|
interface StudioBFFClientProps {
|
|
@@ -27,26 +29,22 @@ interface StudioBFFClientProps {
|
|
|
27
29
|
*/
|
|
28
30
|
url: string | URL;
|
|
29
31
|
}
|
|
30
|
-
interface StudioBFFClient {
|
|
32
|
+
interface StudioBFFClient extends Executor {
|
|
31
33
|
/**
|
|
32
34
|
* Requests BFF to query the database.
|
|
33
35
|
*
|
|
34
36
|
* The query is sent as `body.query`.
|
|
35
37
|
*/
|
|
36
|
-
|
|
38
|
+
execute<Q extends Query>(this: void, query: Q): Promise<Either<Error, QueryResult<Q>>>;
|
|
37
39
|
}
|
|
38
40
|
interface StudioBFFQueryRequest {
|
|
39
41
|
customPayload?: Record<string, unknown>;
|
|
40
42
|
procedure: "query";
|
|
41
43
|
query: Query<unknown>;
|
|
42
44
|
}
|
|
43
|
-
interface StudioBFFQueryResponse<Q extends Query> {
|
|
44
|
-
error: unknown;
|
|
45
|
-
results: QueryResult<Q>;
|
|
46
|
-
}
|
|
47
45
|
/**
|
|
48
46
|
* Creates a Studio BFF client. BFF stands for "Backend For Frontend" btw.
|
|
49
47
|
*/
|
|
50
48
|
declare function createStudioBFFClient(props: StudioBFFClientProps): StudioBFFClient;
|
|
51
49
|
|
|
52
|
-
export { type StudioBFFClient, type StudioBFFClientProps, type StudioBFFQueryRequest,
|
|
50
|
+
export { type StudioBFFClient, type StudioBFFClientProps, type StudioBFFQueryRequest, createStudioBFFClient };
|
package/dist/data/bff/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { E as Executor } from '../../executor-BjkBF_Xv.js';
|
|
1
2
|
import { Q as Query, a as QueryResult } from '../../query-L1_vLuFd.js';
|
|
3
|
+
import { E as Either } from '../../type-utils-rTHUvEmt.js';
|
|
2
4
|
import 'kysely';
|
|
3
5
|
|
|
4
6
|
interface StudioBFFClientProps {
|
|
@@ -27,26 +29,22 @@ interface StudioBFFClientProps {
|
|
|
27
29
|
*/
|
|
28
30
|
url: string | URL;
|
|
29
31
|
}
|
|
30
|
-
interface StudioBFFClient {
|
|
32
|
+
interface StudioBFFClient extends Executor {
|
|
31
33
|
/**
|
|
32
34
|
* Requests BFF to query the database.
|
|
33
35
|
*
|
|
34
36
|
* The query is sent as `body.query`.
|
|
35
37
|
*/
|
|
36
|
-
|
|
38
|
+
execute<Q extends Query>(this: void, query: Q): Promise<Either<Error, QueryResult<Q>>>;
|
|
37
39
|
}
|
|
38
40
|
interface StudioBFFQueryRequest {
|
|
39
41
|
customPayload?: Record<string, unknown>;
|
|
40
42
|
procedure: "query";
|
|
41
43
|
query: Query<unknown>;
|
|
42
44
|
}
|
|
43
|
-
interface StudioBFFQueryResponse<Q extends Query> {
|
|
44
|
-
error: unknown;
|
|
45
|
-
results: QueryResult<Q>;
|
|
46
|
-
}
|
|
47
45
|
/**
|
|
48
46
|
* Creates a Studio BFF client. BFF stands for "Backend For Frontend" btw.
|
|
49
47
|
*/
|
|
50
48
|
declare function createStudioBFFClient(props: StudioBFFClientProps): StudioBFFClient;
|
|
51
49
|
|
|
52
|
-
export { type StudioBFFClient, type StudioBFFClientProps, type StudioBFFQueryRequest,
|
|
50
|
+
export { type StudioBFFClient, type StudioBFFClientProps, type StudioBFFQueryRequest, createStudioBFFClient };
|
package/dist/data/bff/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../chunk-2FW6TKD6.js";function y(
|
|
1
|
+
import"../../chunk-2FW6TKD6.js";function y(r){let{customHeaders:o,customPayload:u,url:n}=r,s=r.fetch||fetch;return{async execute(i){try{let e=await s(n,{body:JSON.stringify({customPayload:u,procedure:"query",query:i}),headers:{Accept:"application/json","Content-Type":"application/json",...o},method:"POST"});if(!e.ok){let t;try{t=await e.text()}catch{t="unknown error"}return[new Error(t)]}return[null,await e.json()]}catch(e){return[e]}}}}export{y as createStudioBFFClient};
|
package/dist/data/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var o=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var m=(r,e,y,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of x(e))!f.call(r,t)&&t!==y&&o(r,t,{get:()=>e[t],enumerable:!(p=u(e,t))||p.enumerable});return r};var a=r=>m(o({},"__esModule",{value:!0}),r);var l={};module.exports=a(l);
|
package/dist/data/index.d.cts
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
export { A as Adapter, C as Column, I as Introspection, Q as QueryDetails, S as Schema, T as Table } from '../adapter-CW2L6BRg.cjs';
|
|
2
|
+
export { E as Executor } from '../executor-DVs9UVdS.cjs';
|
|
2
3
|
export { Q as Query, a as QueryResult } from '../query-L1_vLuFd.cjs';
|
|
4
|
+
export { E as Either } from '../type-utils-rTHUvEmt.cjs';
|
|
3
5
|
import 'kysely';
|
|
4
|
-
|
|
5
|
-
declare class AdapterMock implements Adapter {
|
|
6
|
-
introspect(): Promise<Either<Error, InstrospectResult>>;
|
|
7
|
-
query(input: QueryInput): Promise<Either<Error, QueryResult>>;
|
|
8
|
-
mutate(inputs: MutateInput[]): Promise<Either<Error, MutateResult>>;
|
|
9
|
-
alter(inputs: AlterInput[]): Promise<Either<Error, AlterResult>>;
|
|
10
|
-
rawQuery(input: RawQueryInput): Promise<Either<Error, RawQueryResult>>;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export { Adapter, AdapterMock };
|
package/dist/data/index.d.ts
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
export { A as Adapter, C as Column, I as Introspection, Q as QueryDetails, S as Schema, T as Table } from '../adapter-08vtHScw.js';
|
|
2
|
+
export { E as Executor } from '../executor-BjkBF_Xv.js';
|
|
2
3
|
export { Q as Query, a as QueryResult } from '../query-L1_vLuFd.js';
|
|
4
|
+
export { E as Either } from '../type-utils-rTHUvEmt.js';
|
|
3
5
|
import 'kysely';
|
|
4
|
-
|
|
5
|
-
declare class AdapterMock implements Adapter {
|
|
6
|
-
introspect(): Promise<Either<Error, InstrospectResult>>;
|
|
7
|
-
query(input: QueryInput): Promise<Either<Error, QueryResult>>;
|
|
8
|
-
mutate(inputs: MutateInput[]): Promise<Either<Error, MutateResult>>;
|
|
9
|
-
alter(inputs: AlterInput[]): Promise<Either<Error, AlterResult>>;
|
|
10
|
-
rawQuery(input: RawQueryInput): Promise<Either<Error, RawQueryResult>>;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export { Adapter, AdapterMock };
|
package/dist/data/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunk-2FW6TKD6.js";
|
|
1
|
+
import"../chunk-2FW6TKD6.js";
|