@prisma/studio-core 0.0.0-dev.202503251749 → 0.0.0-dev.202503251845
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var d=Object.create;var a=Object.defineProperty;var
|
|
1
|
+
"use strict";var d=Object.create;var a=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var P=(e,t)=>{for(var r in t)a(e,r,{get:t[r],enumerable:!0})},p=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of E(t))!A.call(e,o)&&o!==r&&a(e,o,{get:()=>t[o],enumerable:!(s=m(t,o))||s.enumerable});return e};var f=(e,t,r)=>(r=e!=null?d(h(e)):{},p(t||!e||!e.__esModule?a(r,"default",{value:e,enumerable:!0}):r,e)),S=e=>p(a({},"__esModule",{value:!0}),e);var O={};P(O,{createAccelerateHttpClient:()=>R});module.exports=S(O);var n={postgres:{encoded:"ZGF0YXNvdXJjZSBkYiB7CiAgICBwcm92aWRlciA9ICJwb3N0Z3JlcyIKICAgIHVybCAgICAgID0gZW52KCJEQVRBQkFTRV9VUkwiKQp9CiAgICAKZ2VuZXJhdG9yIGNsaWVudCB7CiAgICBwcm92aWRlciA9ICJwcmlzbWEtY2xpZW50LWpzIgp9",hash:"54195896aeafa3318ca33f5a8bb44c6b4d89c368cb15288f3bd5ace35a3f9227"}};var c=f(require("@prisma/client/package.json"),1),l=require("@prisma/client/runtime/edge.js"),q=["postgres"],C="accelerate.prisma-data.net",w=c.default.devDependencies["@prisma/engines-version"],_=c.default.version,H=w.split("-")[1].split(".")[1],u=n;function R(e){let{provider:t}=e;if(t!=="postgresql"&&!q.includes(t))throw new Error(`Invalid provider: ${t}`);let r=v(e);return{sendQueryRequest:x(e,r)}}function v(e){let t=`https://${e.host||C}/${_}/${y(e.provider).hash}`,r=e.fetch||fetch,s={Authorization:`Bearer ${e.apiKey}`,"Prisma-Engine-Hash":H};return o=>r(`${t}/${o.path}`,{body:o.body,headers:s,method:o.method})}async function I(e,t){let r=await t({body:y(e.provider).encoded,method:"PUT",path:"schema"});if(!r.ok){try{console.error(await r.text())}catch{}throw new Error(`Failed to upload schema to query engine: ${r.statusText}`)}}function y(e){return e==="postgresql"?u.postgres:u[e]}async function T(e,t){let r=await t({body:JSON.stringify(e),method:"POST",path:"graphql"});if(!r.ok){try{console.error(await r.text())}catch{}throw new Error(`Failed to execute query: ${r.statusText}`)}return await r.json()}function x(e,t){let r=null;return async s=>{await(r||=I(e,t));let{data:o,errors:i}=await T({action:"queryRaw",query:{arguments:{parameters:s.parameters,query:s.sql},selection:{}}},t);if(i)throw new AggregateError(i,"Errors occurred while executing the query");return(0,l.deserializeRawResult)(o.queryRaw)}}0&&(module.exports={createAccelerateHttpClient});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-2FW6TKD6.js";import i from"@prisma/client/package.json";import{deserializeRawResult as u}from"@prisma/client/runtime/
|
|
1
|
+
import{a}from"../../chunk-2FW6TKD6.js";import i from"@prisma/client/package.json";import{deserializeRawResult as u}from"@prisma/client/runtime/edge.js";var l=["postgres"],R="accelerate.prisma-data.net",y=i.devDependencies["@prisma/engines-version"],d=i.version,m=y.split("-")[1].split(".")[1],c=a;function E(e){let{provider:r}=e;if(r!=="postgresql"&&!l.includes(r))throw new Error(`Invalid provider: ${r}`);let t=h(e);return{sendQueryRequest:f(e,t)}}function h(e){let r=`https://${e.host||R}/${d}/${p(e.provider).hash}`,t=e.fetch||fetch,s={Authorization:`Bearer ${e.apiKey}`,"Prisma-Engine-Hash":m};return o=>t(`${r}/${o.path}`,{body:o.body,headers:s,method:o.method})}async function A(e,r){let t=await r({body:p(e.provider).encoded,method:"PUT",path:"schema"});if(!t.ok){try{console.error(await t.text())}catch{}throw new Error(`Failed to upload schema to query engine: ${t.statusText}`)}}function p(e){return e==="postgresql"?c.postgres:c[e]}async function P(e,r){let t=await r({body:JSON.stringify(e),method:"POST",path:"graphql"});if(!t.ok){try{console.error(await t.text())}catch{}throw new Error(`Failed to execute query: ${t.statusText}`)}return await t.json()}function f(e,r){let t=null;return async s=>{await(t||=A(e,r));let{data:o,errors:n}=await P({action:"queryRaw",query:{arguments:{parameters:s.parameters,query:s.sql},selection:{}}},r);if(n)throw new AggregateError(n,"Errors occurred while executing the query");return u(o.queryRaw)}}export{E as createAccelerateHttpClient};
|
package/dist/data/bff/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var i=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var
|
|
1
|
+
"use strict";var i=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var d=(r,e)=>{for(var o in e)i(r,o,{get:e[o],enumerable:!0})},Q=(r,e,o,u)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of y(e))!l.call(r,t)&&t!==o&&i(r,t,{get:()=>e[t],enumerable:!(u=c(e,t))||u.enumerable});return r};var p=r=>Q(i({},"__esModule",{value:!0}),r);var R={};d(R,{createStudioBFFClient:()=>f});module.exports=p(R);function f(r){let{customHeaders:e,customPayload:o,url:u}=r,t=r.fetch||fetch;return{async query(a){try{let n=await t(u,{body:JSON.stringify({customPayload:o,procedure:"query",query:a}),headers:{Accept:"application/json","Content-Type":"application/json",...e},method:"POST"});if(!n.ok){let s;try{s=await n.text()}catch{s="unknown error"}return{error:new Error(s),results:[]}}return{error:null,results:await n.json()}}catch(n){return{error:n,results:[]}}}}}0&&(module.exports={createStudioBFFClient});
|
|
@@ -29,7 +29,7 @@ interface StudioBFFClientProps {
|
|
|
29
29
|
}
|
|
30
30
|
interface StudioBFFClient {
|
|
31
31
|
/**
|
|
32
|
-
* Requests BFF to query the database
|
|
32
|
+
* Requests BFF to query the database.
|
|
33
33
|
*
|
|
34
34
|
* The query is sent as `body.query`.
|
|
35
35
|
*/
|
|
@@ -37,6 +37,7 @@ interface StudioBFFClient {
|
|
|
37
37
|
}
|
|
38
38
|
interface StudioBFFQueryRequest {
|
|
39
39
|
customPayload?: Record<string, unknown>;
|
|
40
|
+
procedure: "query";
|
|
40
41
|
query: Query<unknown>;
|
|
41
42
|
}
|
|
42
43
|
interface StudioBFFQueryResponse<Q extends Query> {
|
package/dist/data/bff/index.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ interface StudioBFFClientProps {
|
|
|
29
29
|
}
|
|
30
30
|
interface StudioBFFClient {
|
|
31
31
|
/**
|
|
32
|
-
* Requests BFF to query the database
|
|
32
|
+
* Requests BFF to query the database.
|
|
33
33
|
*
|
|
34
34
|
* The query is sent as `body.query`.
|
|
35
35
|
*/
|
|
@@ -37,6 +37,7 @@ interface StudioBFFClient {
|
|
|
37
37
|
}
|
|
38
38
|
interface StudioBFFQueryRequest {
|
|
39
39
|
customPayload?: Record<string, unknown>;
|
|
40
|
+
procedure: "query";
|
|
40
41
|
query: Query<unknown>;
|
|
41
42
|
}
|
|
42
43
|
interface StudioBFFQueryResponse<Q extends Query> {
|
package/dist/data/bff/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../chunk-2FW6TKD6.js";function y(t){let{customHeaders:
|
|
1
|
+
import"../../chunk-2FW6TKD6.js";function y(t){let{customHeaders:o,customPayload:n,url:u}=t,s=t.fetch||fetch;return{async query(i){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"});if(!e.ok){let r;try{r=await e.text()}catch{r="unknown error"}return{error:new Error(r),results:[]}}return{error:null,results:await e.json()}}catch(e){return{error:e,results:[]}}}}}export{y as createStudioBFFClient};
|