@prisma/studio-core 0.0.0-dev.202504222316 → 0.0.0-dev.202504230012
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-buCr9KV9.d.cts → adapter-BznP3lED.d.cts} +1 -31
- package/dist/{adapter-BLZ7FUth.d.ts → adapter-On90Gtqe.d.ts} +1 -31
- package/dist/{chunk-5XMLGQEU.js → chunk-WXLUXBTU.js} +1 -1
- package/dist/data/accelerate/index.cjs +1 -1
- package/dist/data/accelerate/index.d.cts +17 -1
- package/dist/data/accelerate/index.d.ts +17 -1
- package/dist/data/accelerate/index.js +1 -1
- package/dist/data/bff/index.cjs +1 -1
- package/dist/data/bff/index.d.cts +6 -0
- package/dist/data/bff/index.d.ts +6 -0
- package/dist/data/bff/index.js +1 -1
- package/dist/data/index.d.cts +1 -1
- package/dist/data/index.d.ts +1 -1
- package/dist/data/pglite/index.cjs +1 -1
- package/dist/data/pglite/index.d.cts +1 -1
- package/dist/data/pglite/index.d.ts +1 -1
- package/dist/data/pglite/index.js +1 -1
- package/dist/data/postgres-core/index.cjs +1 -1
- package/dist/data/postgres-core/index.d.cts +3 -8
- package/dist/data/postgres-core/index.d.ts +3 -8
- package/dist/data/postgres-core/index.js +1 -1
- package/dist/ui/index.d.cts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var E=Object.create;var u=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var P=(e,t)=>{for(var r in t)u(e,r,{get:t[r],enumerable:!0})},d=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of f(t))!A.call(e,a)&&a!==r&&u(e,a,{get:()=>t[a],enumerable:!(n=g(t,a))||n.enumerable});return e};var x=(e,t,r)=>(r=e!=null?E(h(e)):{},d(t||!e||!e.__esModule?u(r,"default",{value:e,enumerable:!0}):r,e)),S=e=>d(u({},"__esModule",{value:!0}),e);var z={};P(z,{createAccelerateHttpClient:()=>m,deserializeRawResult:()=>p,deserializeValue:()=>o});module.exports=S(z);var l={postgres:{encoded:"ZGF0YXNvdXJjZSBkYiB7CiAgICBwcm92aWRlciA9ICJwb3N0Z3JlcyIKICAgIHVybCAgICAgID0gZW52KCJEQVRBQkFTRV9VUkwiKQp9CiAgICAKZ2VuZXJhdG9yIGNsaWVudCB7CiAgICBwcm92aWRlciA9ICJwcmlzbWEtY2xpZW50LWpzIgp9",hash:"54195896aeafa3318ca33f5a8bb44c6b4d89c368cb15288f3bd5ace35a3f9227"}};function p(e,t=o){let r=[],n=C(e);for(let a=0;a<e.rows.length;a++){let c=e.rows[a],i={...n};for(let s=0;s<c.length;s++)i[e.columns[s]]=t(e.types[s],c[s]);r.push(i)}return r}function o(e,t){if(t===null)return t;switch(e){case"bigint":return BigInt(t);case"bigint-array":return t.map(r=>o("bigint",r));case"bytes-array":return t.map(r=>o("bytes",r));case"decimal-array":return t.map(r=>o("decimal",r));case"datetime-array":return t.map(r=>o("datetime",r));case"date-array":return t.map(r=>o("date",r));case"time-array":return t.map(r=>o("time",r));default:return t}}function C(e){let t={};for(let r=0;r<e.columns.length;r++)t[e.columns[r]]=null;return t}var y=x(require("@prisma/client/package.json"),1);var q=["postgres"],k="accelerate.prisma-data.net",_=y.default.devDependencies["@prisma/engines-version"],I=y.default.version,O=_.split("-")[1].split(".")[1],R=l;function m(e){let{provider:t}=e;if(t!=="postgresql"&&!q.includes(t))throw new Error(`Invalid provider: ${t}`);let r=T(e);return{execute:D(e,r)}}function T(e){let t=`https://${e.host||k}/${I}/${w(e.provider).hash}`,r=e.fetch||fetch,n={Authorization:`Bearer ${e.apiKey}`,"Prisma-Engine-Hash":O};return a=>r(`${t}/${a.path}`,{body:a.body,headers:n,method:a.method,signal:a.signal})}async function H(e,t,r){let n=await r({body:w(e.provider).encoded,method:"PUT",path:"schema",signal:t?.abortSignal});if(!n.ok){try{console.error(await n.text())}catch{}throw new Error(`Failed to upload schema to query engine: ${n.statusText}`)}}function w(e){return e==="postgresql"?R.postgres:R[e]}async function Q(e,t,r){let n=await r({body:JSON.stringify(e),method:"POST",path:"graphql",signal:t?.abortSignal});if(!n.ok){try{console.error(await n.text())}catch{}throw new Error(`Failed to execute query: ${n.statusText}`)}return await n.json()}function D(e,t){let{resultDeserializerFn:r=p}=e,n=null;return async(a,c)=>{try{await(n||=H(e,c,t));let{data:i,errors:s}=await Q({action:"queryRaw",query:{arguments:{parameters:a.parameters,query:a.sql},selection:{}}},c,t);return s?[new AggregateError(s,"Errors occurred while executing the query")]:[null,r(i.queryRaw)]}catch(i){return[i]}}}0&&(module.exports={createAccelerateHttpClient,deserializeRawResult,deserializeValue});
|
|
@@ -2,6 +2,16 @@ import { E as Executor, Q as Query, b as ExecuteOptions, a as QueryResult } from
|
|
|
2
2
|
import { E as Either } from '../../type-utils-u92OZz8n.cjs';
|
|
3
3
|
import 'kysely';
|
|
4
4
|
|
|
5
|
+
declare function deserializeRawResult(response: RawResponse, valueDeserializerFn?: typeof deserializeValue): DeserializedResponse;
|
|
6
|
+
declare function deserializeValue(type: QueryIntrospectionBuiltinType, value: unknown): unknown;
|
|
7
|
+
type DeserializedResponse = Array<Record<string, unknown>>;
|
|
8
|
+
interface RawResponse {
|
|
9
|
+
columns: string[];
|
|
10
|
+
types: QueryIntrospectionBuiltinType[];
|
|
11
|
+
rows: unknown[][];
|
|
12
|
+
}
|
|
13
|
+
type QueryIntrospectionBuiltinType = "int" | "bigint" | "float" | "double" | "string" | "enum" | "bytes" | "bool" | "char" | "decimal" | "json" | "xml" | "uuid" | "datetime" | "date" | "time" | "int-array" | "bigint-array" | "float-array" | "double-array" | "string-array" | "char-array" | "bytes-array" | "bool-array" | "decimal-array" | "json-array" | "xml-array" | "uuid-array" | "datetime-array" | "date-array" | "time-array" | "null" | "unknown";
|
|
14
|
+
|
|
5
15
|
declare const SUPPORTED_ACCELERATE_PROVIDERS: readonly ["postgres"];
|
|
6
16
|
type SupportedAccelerateProvider = (typeof SUPPORTED_ACCELERATE_PROVIDERS)[number];
|
|
7
17
|
interface AccelerateHttpClientParams {
|
|
@@ -23,10 +33,16 @@ interface AccelerateHttpClientParams {
|
|
|
23
33
|
* Database provider.
|
|
24
34
|
*/
|
|
25
35
|
provider: SupportedAccelerateProvider | "postgresql";
|
|
36
|
+
/**
|
|
37
|
+
* Function used to deserialize the results of queries.
|
|
38
|
+
*
|
|
39
|
+
* By default, the results are passed to `deserializeRawResult`.
|
|
40
|
+
*/
|
|
41
|
+
resultDeserializerFn?: (this: void, response: RawResponse) => unknown[];
|
|
26
42
|
}
|
|
27
43
|
interface AccelerateHttpClient extends Executor {
|
|
28
44
|
execute<Q extends Query>(this: void, query: Q, options?: ExecuteOptions): Promise<Either<Error, QueryResult<Q>>>;
|
|
29
45
|
}
|
|
30
46
|
declare function createAccelerateHttpClient(props: AccelerateHttpClientParams): AccelerateHttpClient;
|
|
31
47
|
|
|
32
|
-
export { type AccelerateHttpClient, type AccelerateHttpClientParams, type SupportedAccelerateProvider, createAccelerateHttpClient };
|
|
48
|
+
export { type AccelerateHttpClient, type AccelerateHttpClientParams, type DeserializedResponse, type QueryIntrospectionBuiltinType, type RawResponse, type SupportedAccelerateProvider, createAccelerateHttpClient, deserializeRawResult, deserializeValue };
|
|
@@ -2,6 +2,16 @@ import { E as Executor, Q as Query, b as ExecuteOptions, a as QueryResult } from
|
|
|
2
2
|
import { E as Either } from '../../type-utils-u92OZz8n.js';
|
|
3
3
|
import 'kysely';
|
|
4
4
|
|
|
5
|
+
declare function deserializeRawResult(response: RawResponse, valueDeserializerFn?: typeof deserializeValue): DeserializedResponse;
|
|
6
|
+
declare function deserializeValue(type: QueryIntrospectionBuiltinType, value: unknown): unknown;
|
|
7
|
+
type DeserializedResponse = Array<Record<string, unknown>>;
|
|
8
|
+
interface RawResponse {
|
|
9
|
+
columns: string[];
|
|
10
|
+
types: QueryIntrospectionBuiltinType[];
|
|
11
|
+
rows: unknown[][];
|
|
12
|
+
}
|
|
13
|
+
type QueryIntrospectionBuiltinType = "int" | "bigint" | "float" | "double" | "string" | "enum" | "bytes" | "bool" | "char" | "decimal" | "json" | "xml" | "uuid" | "datetime" | "date" | "time" | "int-array" | "bigint-array" | "float-array" | "double-array" | "string-array" | "char-array" | "bytes-array" | "bool-array" | "decimal-array" | "json-array" | "xml-array" | "uuid-array" | "datetime-array" | "date-array" | "time-array" | "null" | "unknown";
|
|
14
|
+
|
|
5
15
|
declare const SUPPORTED_ACCELERATE_PROVIDERS: readonly ["postgres"];
|
|
6
16
|
type SupportedAccelerateProvider = (typeof SUPPORTED_ACCELERATE_PROVIDERS)[number];
|
|
7
17
|
interface AccelerateHttpClientParams {
|
|
@@ -23,10 +33,16 @@ interface AccelerateHttpClientParams {
|
|
|
23
33
|
* Database provider.
|
|
24
34
|
*/
|
|
25
35
|
provider: SupportedAccelerateProvider | "postgresql";
|
|
36
|
+
/**
|
|
37
|
+
* Function used to deserialize the results of queries.
|
|
38
|
+
*
|
|
39
|
+
* By default, the results are passed to `deserializeRawResult`.
|
|
40
|
+
*/
|
|
41
|
+
resultDeserializerFn?: (this: void, response: RawResponse) => unknown[];
|
|
26
42
|
}
|
|
27
43
|
interface AccelerateHttpClient extends Executor {
|
|
28
44
|
execute<Q extends Query>(this: void, query: Q, options?: ExecuteOptions): Promise<Either<Error, QueryResult<Q>>>;
|
|
29
45
|
}
|
|
30
46
|
declare function createAccelerateHttpClient(props: AccelerateHttpClientParams): AccelerateHttpClient;
|
|
31
47
|
|
|
32
|
-
export { type AccelerateHttpClient, type AccelerateHttpClientParams, type SupportedAccelerateProvider, createAccelerateHttpClient };
|
|
48
|
+
export { type AccelerateHttpClient, type AccelerateHttpClientParams, type DeserializedResponse, type QueryIntrospectionBuiltinType, type RawResponse, type SupportedAccelerateProvider, createAccelerateHttpClient, deserializeRawResult, deserializeValue };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as u}from"../../chunk-2FW6TKD6.js";function l(e,t=s){let r=[],n=R(e);for(let a=0;a<e.rows.length;a++){let c=e.rows[a],i={...n};for(let o=0;o<c.length;o++)i[e.columns[o]]=t(e.types[o],c[o]);r.push(i)}return r}function s(e,t){if(t===null)return t;switch(e){case"bigint":return BigInt(t);case"bigint-array":return t.map(r=>s("bigint",r));case"bytes-array":return t.map(r=>s("bytes",r));case"decimal-array":return t.map(r=>s("decimal",r));case"datetime-array":return t.map(r=>s("datetime",r));case"date-array":return t.map(r=>s("date",r));case"time-array":return t.map(r=>s("time",r));default:return t}}function R(e){let t={};for(let r=0;r<e.columns.length;r++)t[e.columns[r]]=null;return t}import y from"@prisma/client/package.json";var m=["postgres"],w="accelerate.prisma-data.net",E=y.devDependencies["@prisma/engines-version"],g=y.version,f=E.split("-")[1].split(".")[1],p=u;function h(e){let{provider:t}=e;if(t!=="postgresql"&&!m.includes(t))throw new Error(`Invalid provider: ${t}`);let r=A(e);return{execute:S(e,r)}}function A(e){let t=`https://${e.host||w}/${g}/${d(e.provider).hash}`,r=e.fetch||fetch,n={Authorization:`Bearer ${e.apiKey}`,"Prisma-Engine-Hash":f};return a=>r(`${t}/${a.path}`,{body:a.body,headers:n,method:a.method,signal:a.signal})}async function P(e,t,r){let n=await r({body:d(e.provider).encoded,method:"PUT",path:"schema",signal:t?.abortSignal});if(!n.ok){try{console.error(await n.text())}catch{}throw new Error(`Failed to upload schema to query engine: ${n.statusText}`)}}function d(e){return e==="postgresql"?p.postgres:p[e]}async function x(e,t,r){let n=await r({body:JSON.stringify(e),method:"POST",path:"graphql",signal:t?.abortSignal});if(!n.ok){try{console.error(await n.text())}catch{}throw new Error(`Failed to execute query: ${n.statusText}`)}return await n.json()}function S(e,t){let{resultDeserializerFn:r=l}=e,n=null;return async(a,c)=>{try{await(n||=P(e,c,t));let{data:i,errors:o}=await x({action:"queryRaw",query:{arguments:{parameters:a.parameters,query:a.sql},selection:{}}},c,t);return o?[new AggregateError(o,"Errors occurred while executing the query")]:[null,r(i.queryRaw)]}catch(i){return[i]}}}export{h as createAccelerateHttpClient,l as deserializeRawResult,s as deserializeValue};
|
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 p=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var f=(t,e)=>{for(var o in e)i(t,o,{get:e[o],enumerable:!0})},F=(t,e,o,u)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of d(e))!x.call(t,r)&&r!==o&&i(t,r,{get:()=>e[r],enumerable:!(u=p(e,r))||u.enumerable});return t};var h=t=>F(i({},"__esModule",{value:!0}),t);var w={};f(w,{createStudioBFFClient:()=>Q});module.exports=h(w);function Q(t){let{customHeaders:e,customPayload:o,resultDeserializerFn:u,url:r}=t,a=t.fetch||fetch;return{async execute(l,y){try{let n=await a(r,{body:JSON.stringify({customPayload:o,procedure:"query",query:l}),headers:{Accept:"application/json","Content-Type":"application/json",...e},method:"POST",signal:y?.abortSignal});if(!n.ok){let s;try{s=await n.text()}catch{s="unknown error"}return[new Error(s)]}let c=await n.json();return[null,u?.(c)||c]}catch(n){return[n]}}}}0&&(module.exports={createStudioBFFClient});
|
|
@@ -21,6 +21,12 @@ interface StudioBFFClientProps {
|
|
|
21
21
|
* e.g. for testing, or older Node.js versions.
|
|
22
22
|
*/
|
|
23
23
|
fetch?: typeof globalThis.fetch;
|
|
24
|
+
/**
|
|
25
|
+
* Function used to deserialize the results of queries.
|
|
26
|
+
*
|
|
27
|
+
* By default, the results are returned as is without any additional processing.
|
|
28
|
+
*/
|
|
29
|
+
resultDeserializerFn?(this: void, results: unknown): unknown[];
|
|
24
30
|
/**
|
|
25
31
|
* BFF endpoint URL.
|
|
26
32
|
*
|
package/dist/data/bff/index.d.ts
CHANGED
|
@@ -21,6 +21,12 @@ interface StudioBFFClientProps {
|
|
|
21
21
|
* e.g. for testing, or older Node.js versions.
|
|
22
22
|
*/
|
|
23
23
|
fetch?: typeof globalThis.fetch;
|
|
24
|
+
/**
|
|
25
|
+
* Function used to deserialize the results of queries.
|
|
26
|
+
*
|
|
27
|
+
* By default, the results are returned as is without any additional processing.
|
|
28
|
+
*/
|
|
29
|
+
resultDeserializerFn?(this: void, results: unknown): unknown[];
|
|
24
30
|
/**
|
|
25
31
|
* BFF endpoint URL.
|
|
26
32
|
*
|
package/dist/data/bff/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../chunk-2FW6TKD6.js";function
|
|
1
|
+
import"../../chunk-2FW6TKD6.js";function p(r){let{customHeaders:n,customPayload:u,resultDeserializerFn:s,url:i}=r,c=r.fetch||fetch;return{async execute(a,l){try{let e=await c(i,{body:JSON.stringify({customPayload:u,procedure:"query",query:a}),headers:{Accept:"application/json","Content-Type":"application/json",...n},method:"POST",signal:l?.abortSignal});if(!e.ok){let t;try{t=await e.text()}catch{t="unknown error"}return[new Error(t)]}let o=await e.json();return[null,s?.(o)||o]}catch(e){return[e]}}}}export{p as createStudioBFFClient};
|
package/dist/data/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as Adapter,
|
|
1
|
+
export { A as Adapter, c as AdapterQueryDetails, f as AdapterQueryResult, B as BaseOptions, C as Column, D as DataType, b as DataTypeGroup, I as IntrospectOptions, a as Introspection, Q as QueryOptions, S as Schema, e as SortDirection, d as SortOrderItem, T as Table } from '../adapter-BznP3lED.cjs';
|
|
2
2
|
export { b as ExecuteOptions, E as Executor, Q as Query, a as QueryResult } from '../executor-DbZM00RR.cjs';
|
|
3
3
|
export { E as Either, N as NumericString } from '../type-utils-u92OZz8n.cjs';
|
|
4
4
|
import 'kysely';
|
package/dist/data/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as Adapter,
|
|
1
|
+
export { A as Adapter, c as AdapterQueryDetails, f as AdapterQueryResult, B as BaseOptions, C as Column, D as DataType, b as DataTypeGroup, I as IntrospectOptions, a as Introspection, Q as QueryOptions, S as Schema, e as SortDirection, d as SortOrderItem, T as Table } from '../adapter-On90Gtqe.js';
|
|
2
2
|
export { b as ExecuteOptions, E as Executor, Q as Query, a as QueryResult } from '../executor-DI7JTcqO.js';
|
|
3
3
|
export { E as Either, N as NumericString } from '../type-utils-u92OZz8n.js';
|
|
4
4
|
import 'kysely';
|