@chaibuilder/pages 0.1.0-beta.6 → 0.1.0-beta.7

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/server.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n="https://api.chaibuilder.com",o=async(s,e)=>{try{const a=new Headers;a.append("x-chai-api-key",e);const r={headers:a,method:"POST",body:JSON.stringify(s)},t=await fetch(n+"/v1/api/chai",r);if(t.ok)return{data:await t.json()};throw new Error("Failed to handle request: "+t.statusText)}catch(a){return{error:a}}},i="https://api.chaibuilder.com";class c{constructor(e){this.apiKey=e}async handle(e){return await o(e,this.apiKey)}async getPageId(e){return(await fetch(`${i}/v1/api/chai`,{method:"POST",body:JSON.stringify({action:"GET_PAGE_ID",data:{slug:e,published:!0}}),headers:{"x-chai-api-key":this.apiKey}})).json()}async getPage(e){return(await fetch(`${i}/v1/api/chai`,{method:"POST",body:JSON.stringify({action:"GET_PAGE",data:{id:e,published:!0,mergeGlobal:!0}}),headers:{"x-chai-api-key":this.apiKey}})).json()}}exports.ChaiBuilderPages=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n="https://api.chaibuilder.com",o=async(s,e)=>{try{const a=new Headers;a.append("x-chai-api-key",e);const r={headers:a,method:"POST",body:JSON.stringify(s)},t=await fetch(n+"/v1/api/chai",r);if(t.ok)return{data:await t.json()};throw new Error("Failed to handle request: "+t.statusText)}catch(a){return{error:a}}},i="https://api.chaibuilder.com";class c{constructor(e){this.apiKey=e}async handle(e){return await o(e,this.apiKey)}async getPageMeta(e){return(await fetch(`${i}/v1/api/chai`,{method:"POST",body:JSON.stringify({action:"GET_PAGE_META",data:{slug:e,published:!0}}),headers:{"x-chai-api-key":this.apiKey}})).json()}async getPage(e){return(await fetch(`${i}/v1/api/chai`,{method:"POST",body:JSON.stringify({action:"GET_PAGE",data:{id:e,published:!0,mergeGlobal:!0}}),headers:{"x-chai-api-key":this.apiKey}})).json()}}exports.ChaiBuilderPages=c;
package/dist/server.d.ts CHANGED
@@ -2,7 +2,7 @@ export declare class ChaiBuilderPages {
2
2
  private apiKey;
3
3
  constructor(apiKey: string);
4
4
  handle(body: any): Promise<any>;
5
- getPageId(slug: string): Promise<any>;
5
+ getPageMeta(slug: string): Promise<any>;
6
6
  getPage(id: string): Promise<any>;
7
7
  }
8
8
 
package/dist/server.js CHANGED
@@ -24,11 +24,11 @@ class h {
24
24
  async handle(e) {
25
25
  return await o(e, this.apiKey);
26
26
  }
27
- async getPageId(e) {
27
+ async getPageMeta(e) {
28
28
  return (await fetch(`${i}/v1/api/chai`, {
29
29
  method: "POST",
30
30
  body: JSON.stringify({
31
- action: "GET_PAGE_ID",
31
+ action: "GET_PAGE_META",
32
32
  data: { slug: e, published: !0 }
33
33
  }),
34
34
  headers: { "x-chai-api-key": this.apiKey }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "author": "Suraj Air",
4
4
  "license": "Private",
5
5
  "homepage": "https://chaibuilder.com",
6
- "version": "0.1.0-beta.6",
6
+ "version": "0.1.0-beta.7",
7
7
  "type": "module",
8
8
  "files": [
9
9
  "dist"