@prisma/studio-core 0.0.0-dev.202504222204 → 0.0.0-dev.202504222316
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-On90Gtqe.d.ts → adapter-BLZ7FUth.d.ts} +31 -1
- package/dist/{adapter-BznP3lED.d.cts → adapter-buCr9KV9.d.cts} +31 -1
- package/dist/{chunk-WXLUXBTU.js → chunk-5XMLGQEU.js} +1 -1
- package/dist/data/accelerate/index.cjs +1 -1
- package/dist/data/accelerate/index.d.cts +1 -17
- package/dist/data/accelerate/index.d.ts +1 -17
- package/dist/data/accelerate/index.js +1 -1
- package/dist/data/bff/index.cjs +1 -1
- package/dist/data/bff/index.d.cts +0 -6
- package/dist/data/bff/index.d.ts +0 -6
- 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 +8 -3
- package/dist/data/postgres-core/index.d.ts +8 -3
- 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 m=Object.create;var c=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var w=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var f=(e,t)=>{for(var r in t)c(e,r,{get:t[r],enumerable:!0})},p=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of g(t))!h.call(e,o)&&o!==r&&c(e,o,{get:()=>t[o],enumerable:!(n=E(t,o))||n.enumerable});return e};var A=(e,t,r)=>(r=e!=null?m(w(e)):{},p(t||!e||!e.__esModule?c(r,"default",{value:e,enumerable:!0}):r,e)),P=e=>p(c({},"__esModule",{value:!0}),e);var D={};f(D,{createAccelerateHttpClient:()=>y});module.exports=P(D);var u={postgres:{encoded:"ZGF0YXNvdXJjZSBkYiB7CiAgICBwcm92aWRlciA9ICJwb3N0Z3JlcyIKICAgIHVybCAgICAgID0gZW52KCJEQVRBQkFTRV9VUkwiKQp9CiAgICAKZ2VuZXJhdG9yIGNsaWVudCB7CiAgICBwcm92aWRlciA9ICJwcmlzbWEtY2xpZW50LWpzIgp9",hash:"54195896aeafa3318ca33f5a8bb44c6b4d89c368cb15288f3bd5ace35a3f9227"}};var l=A(require("@prisma/client/package.json"),1),x=["postgres"],C="accelerate.prisma-data.net",q=l.default.devDependencies["@prisma/engines-version"],_=l.default.version,k=q.split("-")[1].split(".")[1],R=u;function y(e){let{provider:t}=e;if(t!=="postgresql"&&!x.includes(t))throw new Error(`Invalid provider: ${t}`);let r=O(e);return{execute:I(e,r)}}function O(e){let t=`https://${e.host||C}/${_}/${d(e.provider).hash}`,r=e.fetch||fetch,n={Authorization:`Bearer ${e.apiKey}`,"Prisma-Engine-Hash":k};return o=>r(`${t}/${o.path}`,{body:o.body,headers:n,method:o.method,signal:o.signal})}async function b(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"?R.postgres:R[e]}async function H(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 I(e,t){let r=null;return async(n,o)=>{try{await(r||=b(e,o,t));let{data:i,errors:s}=await H({action:"queryRaw",query:{arguments:{parameters:n.parameters,query:n.sql},selection:{}}},o,t);return s?[new AggregateError(s,"Errors occurred while executing the query")]:[null,T(i.queryRaw)]}catch(i){return[i]}}}function T(e){let t=[],r=Q(e);for(let n=0;n<e.rows.length;n++){let o=e.rows[n],i={...r};for(let s=0;s<o.length;s++)i[e.columns[s]]=a(e.types[s],o[s]);t.push(i)}return t}function a(e,t){if(t===null)return t;switch(e){case"bigint":return BigInt(t);case"bigint-array":return t.map(r=>a("bigint",r));case"bytes-array":return t.map(r=>a("bytes",r));case"decimal-array":return t.map(r=>a("decimal",r));case"datetime-array":return t.map(r=>a("datetime",r));case"date-array":return t.map(r=>a("date",r));case"time-array":return t.map(r=>a("time",r));default:return t}}function Q(e){let t={};for(let r=0;r<e.columns.length;r++)t[e.columns[r]]=null;return t}0&&(module.exports={createAccelerateHttpClient});
|
|
@@ -2,16 +2,6 @@ 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): 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
|
-
|
|
15
5
|
declare const SUPPORTED_ACCELERATE_PROVIDERS: readonly ["postgres"];
|
|
16
6
|
type SupportedAccelerateProvider = (typeof SUPPORTED_ACCELERATE_PROVIDERS)[number];
|
|
17
7
|
interface AccelerateHttpClientParams {
|
|
@@ -33,16 +23,10 @@ interface AccelerateHttpClientParams {
|
|
|
33
23
|
* Database provider.
|
|
34
24
|
*/
|
|
35
25
|
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[];
|
|
42
26
|
}
|
|
43
27
|
interface AccelerateHttpClient extends Executor {
|
|
44
28
|
execute<Q extends Query>(this: void, query: Q, options?: ExecuteOptions): Promise<Either<Error, QueryResult<Q>>>;
|
|
45
29
|
}
|
|
46
30
|
declare function createAccelerateHttpClient(props: AccelerateHttpClientParams): AccelerateHttpClient;
|
|
47
31
|
|
|
48
|
-
export { type AccelerateHttpClient, type AccelerateHttpClientParams, type
|
|
32
|
+
export { type AccelerateHttpClient, type AccelerateHttpClientParams, type SupportedAccelerateProvider, createAccelerateHttpClient };
|
|
@@ -2,16 +2,6 @@ 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): 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
|
-
|
|
15
5
|
declare const SUPPORTED_ACCELERATE_PROVIDERS: readonly ["postgres"];
|
|
16
6
|
type SupportedAccelerateProvider = (typeof SUPPORTED_ACCELERATE_PROVIDERS)[number];
|
|
17
7
|
interface AccelerateHttpClientParams {
|
|
@@ -33,16 +23,10 @@ interface AccelerateHttpClientParams {
|
|
|
33
23
|
* Database provider.
|
|
34
24
|
*/
|
|
35
25
|
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[];
|
|
42
26
|
}
|
|
43
27
|
interface AccelerateHttpClient extends Executor {
|
|
44
28
|
execute<Q extends Query>(this: void, query: Q, options?: ExecuteOptions): Promise<Either<Error, QueryResult<Q>>>;
|
|
45
29
|
}
|
|
46
30
|
declare function createAccelerateHttpClient(props: AccelerateHttpClientParams): AccelerateHttpClient;
|
|
47
31
|
|
|
48
|
-
export { type AccelerateHttpClient, type AccelerateHttpClientParams, type
|
|
32
|
+
export { type AccelerateHttpClient, type AccelerateHttpClientParams, type SupportedAccelerateProvider, createAccelerateHttpClient };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c}from"../../chunk-2FW6TKD6.js";
|
|
1
|
+
import{a as c}from"../../chunk-2FW6TKD6.js";import l from"@prisma/client/package.json";var R=["postgres"],y="accelerate.prisma-data.net",d=l.devDependencies["@prisma/engines-version"],m=l.version,E=d.split("-")[1].split(".")[1],u=c;function g(t){let{provider:e}=t;if(e!=="postgresql"&&!R.includes(e))throw new Error(`Invalid provider: ${e}`);let r=w(t);return{execute:A(t,r)}}function w(t){let e=`https://${t.host||y}/${m}/${p(t.provider).hash}`,r=t.fetch||fetch,n={Authorization:`Bearer ${t.apiKey}`,"Prisma-Engine-Hash":E};return o=>r(`${e}/${o.path}`,{body:o.body,headers:n,method:o.method,signal:o.signal})}async function h(t,e,r){let n=await r({body:p(t.provider).encoded,method:"PUT",path:"schema",signal:e?.abortSignal});if(!n.ok){try{console.error(await n.text())}catch{}throw new Error(`Failed to upload schema to query engine: ${n.statusText}`)}}function p(t){return t==="postgresql"?u.postgres:u[t]}async function f(t,e,r){let n=await r({body:JSON.stringify(t),method:"POST",path:"graphql",signal:e?.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 A(t,e){let r=null;return async(n,o)=>{try{await(r||=h(t,o,e));let{data:i,errors:s}=await f({action:"queryRaw",query:{arguments:{parameters:n.parameters,query:n.sql},selection:{}}},o,e);return s?[new AggregateError(s,"Errors occurred while executing the query")]:[null,P(i.queryRaw)]}catch(i){return[i]}}}function P(t){let e=[],r=S(t);for(let n=0;n<t.rows.length;n++){let o=t.rows[n],i={...r};for(let s=0;s<o.length;s++)i[t.columns[s]]=a(t.types[s],o[s]);e.push(i)}return e}function a(t,e){if(e===null)return e;switch(t){case"bigint":return BigInt(e);case"bigint-array":return e.map(r=>a("bigint",r));case"bytes-array":return e.map(r=>a("bytes",r));case"decimal-array":return e.map(r=>a("decimal",r));case"datetime-array":return e.map(r=>a("datetime",r));case"date-array":return e.map(r=>a("date",r));case"time-array":return e.map(r=>a("time",r));default:return e}}function S(t){let e={};for(let r=0;r<t.columns.length;r++)e[t.columns[r]]=null;return e}export{g as createAccelerateHttpClient};
|
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 y=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var d=(t,e)=>{for(var o in e)i(t,o,{get:e[o],enumerable:!0})},x=(t,e,o,u)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of l(e))!p.call(t,r)&&r!==o&&i(t,r,{get:()=>e[r],enumerable:!(u=y(e,r))||u.enumerable});return t};var f=t=>x(i({},"__esModule",{value:!0}),t);var F={};d(F,{createStudioBFFClient:()=>m});module.exports=f(F);function m(t){let{customHeaders:e,customPayload:o,url:u}=t,r=t.fetch||fetch;return{async execute(c,a){try{let n=await r(u,{body:JSON.stringify({customPayload:o,procedure:"query",query:c}),headers:{Accept:"application/json","Content-Type":"application/json",...e},method:"POST",signal:a?.abortSignal});if(!n.ok){let s;try{s=await n.text()}catch{s="unknown error"}return[new Error(s)]}return[null,await n.json()]}catch(n){return[n]}}}}0&&(module.exports={createStudioBFFClient});
|
|
@@ -21,12 +21,6 @@ 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[];
|
|
30
24
|
/**
|
|
31
25
|
* BFF endpoint URL.
|
|
32
26
|
*
|
package/dist/data/bff/index.d.ts
CHANGED
|
@@ -21,12 +21,6 @@ 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[];
|
|
30
24
|
/**
|
|
31
25
|
* BFF endpoint URL.
|
|
32
26
|
*
|
package/dist/data/bff/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../chunk-2FW6TKD6.js";function
|
|
1
|
+
import"../../chunk-2FW6TKD6.js";function l(r){let{customHeaders:o,customPayload:n,url:u}=r,s=r.fetch||fetch;return{async execute(i,c){try{let e=await s(u,{body:JSON.stringify({customPayload:n,procedure:"query",query:i}),headers:{Accept:"application/json","Content-Type":"application/json",...o},method:"POST",signal:c?.abortSignal});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{l as createStudioBFFClient};
|
package/dist/data/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
1
|
+
export { A as Adapter, g as AdapterInsertDetails, h as AdapterInsertResult, 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-buCr9KV9.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, 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-
|
|
1
|
+
export { A as Adapter, g as AdapterInsertDetails, h as AdapterInsertResult, 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-BLZ7FUth.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';
|