@hackersheet/core 0.1.0-alpha.3 → 0.1.0-alpha.5
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/chunk-BKN3BXOH.mjs +1 -0
- package/dist/chunk-FHELDISY.mjs +1 -0
- package/dist/{chunk-WIUPPYM5.mjs → chunk-FJFYJPPP.mjs} +1 -1
- package/dist/{chunk-7R3CATQT.mjs → chunk-FWYDDQQO.mjs} +1 -1
- package/dist/{chunk-JGQBUURE.mjs → chunk-NQSHEVF2.mjs} +1 -1
- package/dist/chunk-OECI6NQ7.mjs +1 -0
- package/dist/chunk-S2VIMZSH.mjs +1 -0
- package/dist/{chunk-EXRG4APR.mjs → chunk-TQWLKI7M.mjs} +1 -1
- package/dist/chunk-U527I2CX.mjs +1 -0
- package/dist/chunk-XL6FY5JJ.mjs +1 -0
- package/dist/{chunk-SYHSU6VH.mjs → chunk-YFUDDF4U.mjs} +1 -1
- package/dist/client/client.d.mts +16 -1
- package/dist/client/client.d.ts +16 -1
- package/dist/client/client.js +1 -1
- package/dist/client/client.mjs +1 -1
- package/dist/client/create-client.d.mts +1 -0
- package/dist/client/create-client.d.ts +1 -0
- package/dist/client/create-client.js +1 -1
- package/dist/client/create-client.mjs +1 -1
- package/dist/client/operations/get-document.mjs +1 -1
- package/dist/client/operations/get-documents.mjs +1 -1
- package/dist/client/operations/get-tag.mjs +1 -1
- package/dist/client/operations/get-tags.mjs +1 -1
- package/dist/client/operations/get-tree-node-document.d.mts +15 -0
- package/dist/client/operations/get-tree-node-document.d.ts +15 -0
- package/dist/client/operations/get-tree-node-document.js +1 -0
- package/dist/client/operations/get-tree-node-document.mjs +1 -0
- package/dist/client/operations/get-tree.d.mts +15 -0
- package/dist/client/operations/get-tree.d.ts +15 -0
- package/dist/client/operations/get-tree.js +1 -0
- package/dist/client/operations/get-tree.mjs +1 -0
- package/dist/client/operations/get-websites.mjs +1 -1
- package/dist/client/operations/index.js +1 -1
- package/dist/client/operations/index.mjs +1 -1
- package/dist/gql/gql.d.mts +17 -1
- package/dist/gql/gql.d.ts +17 -1
- package/dist/gql/gql.js +1 -1
- package/dist/gql/gql.mjs +1 -1
- package/dist/gql/graphql.d.mts +292 -1
- package/dist/gql/graphql.d.ts +292 -1
- package/dist/gql/graphql.js +1 -1
- package/dist/gql/graphql.mjs +1 -1
- package/dist/gql/index.js +1 -1
- package/dist/gql/index.mjs +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/types/index.d.mts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/tree.d.mts +36 -0
- package/dist/types/tree.d.ts +36 -0
- package/dist/types/tree.js +1 -0
- package/dist/types/tree.mjs +0 -0
- package/package.json +21 -20
- package/dist/chunk-3GXIDS5H.mjs +0 -1
- package/dist/chunk-5X53IRLN.mjs +0 -1
- package/dist/chunk-TXCPBPKN.mjs +0 -1
- package/dist/chunk-ZZFAG7Y6.mjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{makeGetTreeNodeDocumentResponse as t}from"./chunk-FHELDISY.mjs";import{makeGetTreeResponse as r}from"./chunk-S2VIMZSH.mjs";import{makeGetDocumentResponse as e}from"./chunk-FWYDDQQO.mjs";import{makeGetDocumentsResponse as s}from"./chunk-NQSHEVF2.mjs";import{makeGetTagResponse as n}from"./chunk-YFUDDF4U.mjs";import{makeGetTagsResponse as i}from"./chunk-TQWLKI7M.mjs";import{makeGetWebsitesResponse as c}from"./chunk-FJFYJPPP.mjs";import{DocumentDocument as u,DocumentsDocument as a,TagDocument as o,TagsDocument as l,TreeDocument as m,TreeNodeDocumentDocument as h,WebsitesDocument as q}from"./chunk-XL6FY5JJ.mjs";import{createClient as y,cacheExchange as C,fetchExchange as p}from"@urql/core";var f=class{url;accessKey;urqlClient;constructor(t){this.url=t.url,this.accessKey=t.accessKey,this.urqlClient=t.urqlClient??this.createUrqlClient()}async getDocument(t){const r=await this.urqlClient.query(u,t);return e(r)}async getDocuments(t){const r=await this.urqlClient.query(a,t??{});return s(r)}async getTag(t){const r=await this.urqlClient.query(o,t);return n(r)}async getTags(t){const r=await this.urqlClient.query(l,t??{});return i(r)}async getWebsites(t){const r=await this.urqlClient.query(q,t??{});return c(r)}async getTree(t){const e=await this.urqlClient.query(m,t??{});return r(e)}async getTreeNodeDocument(r){const e=await this.urqlClient.query(h,r);return t(e)}createUrqlClient(){return y({url:this.url,exchanges:[C,p],fetchOptions:{headers:{Authorization:`bearer ${this.accessKey}`},cache:"no-store"}})}};export{f as Client};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{toArrayFromEdges as n}from"./chunk-C3G2CMRR.mjs";import{graphql as e}from"./chunk-U527I2CX.mjs";function t(e){if(!e.data?.tree?.node?.nodeDocument?.document)return{document:null,error:e.error};const t=e.data?.tree.node?.nodeDocument?.document;return{document:{...t,tags:n(t.tags?.edges),assets:n(t.assets?.edges),outboundLinkDocuments:n(t.outboundLinkDocuments?.edges).map((e=>({...e,tags:n(e.tags?.edges)}))),inboundLinkDocuments:n(t.inboundLinkDocuments?.edges).map((e=>({...e,tags:n(e.tags?.edges)}))),websites:n(t.websites?.edges)},error:e.error}}e("\n query treeNodeDocument($treeSlug: String, $nodeFullSlug: String!, $variant: String) {\n tree(slug: $treeSlug) {\n id\n node(fullSlug: $nodeFullSlug) {\n id\n nodeDocument(variant: $variant) {\n document {\n id\n slug\n emoji\n title\n draft\n content\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n assets {\n edges {\n node {\n id\n path\n name\n fileUrl\n height\n width\n }\n }\n }\n outboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n inboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n websites {\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n }\n }\n }\n }\n }\n }\n }\n }\n");export{t as makeGetTreeNodeDocumentResponse};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toArrayFromEdges as n}from"./chunk-C3G2CMRR.mjs";import{graphql as t}from"./chunk-
|
|
1
|
+
import{toArrayFromEdges as n}from"./chunk-C3G2CMRR.mjs";import{graphql as t}from"./chunk-U527I2CX.mjs";function e(t){const e=n(t.data?.websites?.edges).map((t=>({...t,documents:n(t.documents?.edges)}))),o=t.data?.websites?.totalCount||0;return{websites:e,totalCount:o,isEmpty:0===o,error:t.error}}t("\n query websites($after: String, $first: Int) {\n websites(after: $after, first: $first) {\n totalCount\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n documents {\n edges {\n node {\n id\n draft\n title\n slug\n }\n }\n }\n }\n }\n }\n }\n");export{e as makeGetWebsitesResponse};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toArrayFromEdges as n}from"./chunk-C3G2CMRR.mjs";import{graphql as e}from"./chunk-
|
|
1
|
+
import{toArrayFromEdges as n}from"./chunk-C3G2CMRR.mjs";import{graphql as e}from"./chunk-U527I2CX.mjs";function t(e){if(!e.data?.document)return{document:null,error:e.error};const t=e.data?.document;return{document:{...t,tags:n(t.tags?.edges),assets:n(t.assets?.edges),outboundLinkDocuments:n(t.outboundLinkDocuments?.edges).map((e=>({...e,tags:n(e.tags?.edges)}))),inboundLinkDocuments:n(t.inboundLinkDocuments?.edges).map((e=>({...e,tags:n(e.tags?.edges)}))),websites:n(t.websites?.edges)},error:e.error}}e("\n query document($slug: String) {\n document(slug: $slug) {\n id\n slug\n emoji\n title\n draft\n content\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n assets {\n edges {\n node {\n id\n path\n name\n fileUrl\n height\n width\n }\n }\n }\n outboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n inboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n websites {\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n }\n }\n }\n }\n }\n");export{t as makeGetDocumentResponse};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toArrayFromEdges as n}from"./chunk-C3G2CMRR.mjs";import{graphql as t}from"./chunk-
|
|
1
|
+
import{toArrayFromEdges as n}from"./chunk-C3G2CMRR.mjs";import{graphql as t}from"./chunk-U527I2CX.mjs";function e(t){if(!t.data||!t.data.documents)return{documents:[],totalCount:0,isEmpty:!0,error:t.error};const e=t.data.documents,r=n(e?.edges).map((t=>({...t,tags:n(t.tags?.edges)}))),o=t.data?.documents?.totalCount||0;return{documents:r,totalCount:o,isEmpty:0===o,error:t.error}}t("\n query documents($after: String, $first: Int, $filter: DocumentConnectionFilter, $sort: ConnectionSort) {\n documents(after: $after, first: $first, filter: $filter, sort: $sort) {\n totalCount\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n }\n }\n }\n }\n");export{e as makeGetDocumentsResponse};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Client as n}from"./chunk-BKN3BXOH.mjs";function r(r){return new n(r)}export{r as createClient};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{toArrayFromEdges as n}from"./chunk-C3G2CMRR.mjs";import{graphql as e}from"./chunk-U527I2CX.mjs";function t(e){if(!e.data?.tree)return{tree:null,error:e.error};const t=e.data?.tree,r=n(t.nodes?.edges).map((n=>{const e=new Map(n.names?.map((n=>[n.variant,n.content]))),t=new Map(n.nodeDocuments?.map((n=>[n.variant,n.document])));return{id:n.id,fullSlug:n.fullSlug,name:e.get("")??"",names:n.names??[],nameMap:e,document:t.get("")??null,documentMap:t,nodeDocuments:n.nodeDocuments??[],parentId:n.parent?.id??void 0,root:n.root,position:n.position}}));return{tree:{...t,nodes:o(r),flatNodes:r},error:e.error}}function o(n){const e=new Map,t=[];return n.forEach((n=>{e.set(n.id,{...n,children:[]})})),n.forEach((n=>{const o=e.get(n.id);if(n.parentId){const t=e.get(n.parentId);t?.children?.push(o)}else t.push(o)})),t}e("\n query tree($slug: String) {\n tree(slug: $slug) {\n id\n slug\n name\n nodes {\n edges {\n node {\n id\n fullSlug\n names {\n variant\n content\n }\n nodeDocuments {\n variant\n document {\n id\n title\n path\n }\n }\n parent {\n id\n }\n root\n position\n }\n }\n }\n }\n }\n");export{t as makeGetTreeResponse};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toArrayFromEdges as n}from"./chunk-C3G2CMRR.mjs";import{graphql as t}from"./chunk-
|
|
1
|
+
import{toArrayFromEdges as n}from"./chunk-C3G2CMRR.mjs";import{graphql as t}from"./chunk-U527I2CX.mjs";function o(t){const o=n(t.data?.tags?.edges),r=t.data?.tags?.totalCount||0;return{tags:o,totalCount:r,isEmpty:0===r,error:t.error}}t("\n query tags($sort: ConnectionSort) {\n tags(sort: $sort) {\n totalCount\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n");export{o as makeGetTagsResponse};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DocumentDocument as n,DocumentsDocument as e,TagDocument as t,TagsDocument as i,TreeDocument as d,TreeNodeDocumentDocument as o,WebsitesDocument as s}from"./chunk-XL6FY5JJ.mjs";var g={"\n query document($slug: String) {\n document(slug: $slug) {\n id\n slug\n emoji\n title\n draft\n content\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n assets {\n edges {\n node {\n id\n path\n name\n fileUrl\n height\n width\n }\n }\n }\n outboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n inboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n websites {\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n }\n }\n }\n }\n }\n":n,"\n query documents($after: String, $first: Int, $filter: DocumentConnectionFilter, $sort: ConnectionSort) {\n documents(after: $after, first: $first, filter: $filter, sort: $sort) {\n totalCount\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n }\n }\n }\n }\n":e,"\n query tag($name: String) {\n tag(name: $name) {\n id\n name\n documentCount\n documentCountInPublished\n relatedTags {\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n }\n":t,"\n query tags($sort: ConnectionSort) {\n tags(sort: $sort) {\n totalCount\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n":i,"\n query treeNodeDocument($treeSlug: String, $nodeFullSlug: String!, $variant: String) {\n tree(slug: $treeSlug) {\n id\n node(fullSlug: $nodeFullSlug) {\n id\n nodeDocument(variant: $variant) {\n document {\n id\n slug\n emoji\n title\n draft\n content\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n assets {\n edges {\n node {\n id\n path\n name\n fileUrl\n height\n width\n }\n }\n }\n outboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n inboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n websites {\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n }\n }\n }\n }\n }\n }\n }\n }\n":o,"\n query tree($slug: String) {\n tree(slug: $slug) {\n id\n slug\n name\n nodes {\n edges {\n node {\n id\n fullSlug\n names {\n variant\n content\n }\n nodeDocuments {\n variant\n document {\n id\n title\n path\n }\n }\n parent {\n id\n }\n root\n position\n }\n }\n }\n }\n }\n":d,"\n query websites($after: String, $first: Int) {\n websites(after: $after, first: $first) {\n totalCount\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n documents {\n edges {\n node {\n id\n draft\n title\n slug\n }\n }\n }\n }\n }\n }\n }\n":s};function r(n){return g[n]??{}}export{r as graphql};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"document"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"slug"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"document"},arguments:[{kind:"Argument",name:{kind:"Name",value:"slug"},value:{kind:"Variable",name:{kind:"Name",value:"slug"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"content"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"preview"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}},{kind:"Field",name:{kind:"Name",value:"assets"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}},{kind:"Field",name:{kind:"Name",value:"height"}},{kind:"Field",name:{kind:"Name",value:"width"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"outboundLinkDocuments"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"inboundLinkDocuments"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"websites"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"domain"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"ogSiteName"}},{kind:"Field",name:{kind:"Name",value:"ogTitle"}},{kind:"Field",name:{kind:"Name",value:"ogType"}},{kind:"Field",name:{kind:"Name",value:"ogUrl"}},{kind:"Field",name:{kind:"Name",value:"ogDescription"}},{kind:"Field",name:{kind:"Name",value:"ogLocale"}},{kind:"Field",name:{kind:"Name",value:"ogImage"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}}]}}]}}]}}]}}]},i={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"documents"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filter"}},type:{kind:"NamedType",name:{kind:"Name",value:"DocumentConnectionFilter"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sort"}},type:{kind:"NamedType",name:{kind:"Name",value:"ConnectionSort"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"documents"},arguments:[{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}},{kind:"Argument",name:{kind:"Name",value:"filter"},value:{kind:"Variable",name:{kind:"Name",value:"filter"}}},{kind:"Argument",name:{kind:"Name",value:"sort"},value:{kind:"Variable",name:{kind:"Name",value:"sort"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"preview"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}}]}}]}}]}}]}}]},n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"tag"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"tag"},arguments:[{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"documentCount"}},{kind:"Field",name:{kind:"Name",value:"documentCountInPublished"}},{kind:"Field",name:{kind:"Name",value:"relatedTags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"documentCount"}},{kind:"Field",name:{kind:"Name",value:"documentCountInPublished"}}]}}]}}]}}]}}]}}]},a={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"tags"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sort"}},type:{kind:"NamedType",name:{kind:"Name",value:"ConnectionSort"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"tags"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sort"},value:{kind:"Variable",name:{kind:"Name",value:"sort"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"documentCount"}},{kind:"Field",name:{kind:"Name",value:"documentCountInPublished"}}]}}]}}]}}]}}]},d={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"treeNodeDocument"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"treeSlug"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"nodeFullSlug"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"variant"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"tree"},arguments:[{kind:"Argument",name:{kind:"Name",value:"slug"},value:{kind:"Variable",name:{kind:"Name",value:"treeSlug"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"node"},arguments:[{kind:"Argument",name:{kind:"Name",value:"fullSlug"},value:{kind:"Variable",name:{kind:"Name",value:"nodeFullSlug"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"nodeDocument"},arguments:[{kind:"Argument",name:{kind:"Name",value:"variant"},value:{kind:"Variable",name:{kind:"Name",value:"variant"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"document"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"content"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"preview"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}},{kind:"Field",name:{kind:"Name",value:"assets"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}},{kind:"Field",name:{kind:"Name",value:"height"}},{kind:"Field",name:{kind:"Name",value:"width"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"outboundLinkDocuments"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"inboundLinkDocuments"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"websites"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"domain"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"ogSiteName"}},{kind:"Field",name:{kind:"Name",value:"ogTitle"}},{kind:"Field",name:{kind:"Name",value:"ogType"}},{kind:"Field",name:{kind:"Name",value:"ogUrl"}},{kind:"Field",name:{kind:"Name",value:"ogDescription"}},{kind:"Field",name:{kind:"Name",value:"ogLocale"}},{kind:"Field",name:{kind:"Name",value:"ogImage"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}}]}}]}}]}}]}}]}}]}}]}}]},l={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"tree"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"slug"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"tree"},arguments:[{kind:"Argument",name:{kind:"Name",value:"slug"},value:{kind:"Variable",name:{kind:"Name",value:"slug"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"fullSlug"}},{kind:"Field",name:{kind:"Name",value:"names"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"variant"}},{kind:"Field",name:{kind:"Name",value:"content"}}]}},{kind:"Field",name:{kind:"Name",value:"nodeDocuments"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"variant"}},{kind:"Field",name:{kind:"Name",value:"document"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"path"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"parent"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}},{kind:"Field",name:{kind:"Name",value:"root"}},{kind:"Field",name:{kind:"Name",value:"position"}}]}}]}}]}}]}}]}}]},k={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"websites"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"websites"},arguments:[{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"domain"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"ogSiteName"}},{kind:"Field",name:{kind:"Name",value:"ogTitle"}},{kind:"Field",name:{kind:"Name",value:"ogType"}},{kind:"Field",name:{kind:"Name",value:"ogUrl"}},{kind:"Field",name:{kind:"Name",value:"ogDescription"}},{kind:"Field",name:{kind:"Name",value:"ogLocale"}},{kind:"Field",name:{kind:"Name",value:"ogImage"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}},{kind:"Field",name:{kind:"Name",value:"documents"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"slug"}}]}}]}}]}}]}}]}}]}}]}}]};export{e as DocumentDocument,i as DocumentsDocument,n as TagDocument,a as TagsDocument,d as TreeNodeDocumentDocument,l as TreeDocument,k as WebsitesDocument};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toArrayFromEdges as n}from"./chunk-C3G2CMRR.mjs";import{graphql as e}from"./chunk-
|
|
1
|
+
import{toArrayFromEdges as n}from"./chunk-C3G2CMRR.mjs";import{graphql as e}from"./chunk-U527I2CX.mjs";function t(e){const t=e.data?.tag;return{tag:t?{...t,relatedTags:n(t.relatedTags?.edges)}:null,error:e.error}}e("\n query tag($name: String) {\n tag(name: $name) {\n id\n name\n documentCount\n documentCountInPublished\n relatedTags {\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n }\n");export{t as makeGetTagResponse};
|
package/dist/client/client.d.mts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Document, DocumentList } from '../types/document.mjs';
|
|
2
2
|
import { Tag, TagList } from '../types/tag.mjs';
|
|
3
|
+
import { Tree } from '../types/tree.mjs';
|
|
3
4
|
import { WebsiteListeItem } from '../types/website.mjs';
|
|
4
5
|
import * as _urql_core from '@urql/core';
|
|
5
6
|
import { Client as Client$1 } from '@urql/core';
|
|
6
|
-
import { QueryDocumentArgs, QueryDocumentsArgs, QueryTagArgs, QueryTagsArgs, QueryWebsitesArgs } from '../gql/graphql.mjs';
|
|
7
|
+
import { QueryDocumentArgs, QueryDocumentsArgs, QueryTagArgs, QueryTagsArgs, QueryWebsitesArgs, QueryTreeArgs, TreeNodeDocumentQueryVariables } from '../gql/graphql.mjs';
|
|
7
8
|
import '@graphql-typed-document-node/core';
|
|
8
9
|
|
|
9
10
|
type ClientOptions = {
|
|
@@ -45,6 +46,20 @@ declare class Client {
|
|
|
45
46
|
readonly isEmpty: boolean;
|
|
46
47
|
readonly error: _urql_core.CombinedError | undefined;
|
|
47
48
|
}>;
|
|
49
|
+
getTree(args?: QueryTreeArgs): Promise<{
|
|
50
|
+
tree: null;
|
|
51
|
+
error: _urql_core.CombinedError | undefined;
|
|
52
|
+
} | {
|
|
53
|
+
readonly tree: Tree;
|
|
54
|
+
readonly error: _urql_core.CombinedError | undefined;
|
|
55
|
+
}>;
|
|
56
|
+
getTreeNodeDocument(args: TreeNodeDocumentQueryVariables): Promise<{
|
|
57
|
+
document: null;
|
|
58
|
+
error: _urql_core.CombinedError | undefined;
|
|
59
|
+
} | {
|
|
60
|
+
readonly document: Document;
|
|
61
|
+
readonly error: _urql_core.CombinedError | undefined;
|
|
62
|
+
}>;
|
|
48
63
|
private createUrqlClient;
|
|
49
64
|
}
|
|
50
65
|
|
package/dist/client/client.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Document, DocumentList } from '../types/document.js';
|
|
2
2
|
import { Tag, TagList } from '../types/tag.js';
|
|
3
|
+
import { Tree } from '../types/tree.js';
|
|
3
4
|
import { WebsiteListeItem } from '../types/website.js';
|
|
4
5
|
import * as _urql_core from '@urql/core';
|
|
5
6
|
import { Client as Client$1 } from '@urql/core';
|
|
6
|
-
import { QueryDocumentArgs, QueryDocumentsArgs, QueryTagArgs, QueryTagsArgs, QueryWebsitesArgs } from '../gql/graphql.js';
|
|
7
|
+
import { QueryDocumentArgs, QueryDocumentsArgs, QueryTagArgs, QueryTagsArgs, QueryWebsitesArgs, QueryTreeArgs, TreeNodeDocumentQueryVariables } from '../gql/graphql.js';
|
|
7
8
|
import '@graphql-typed-document-node/core';
|
|
8
9
|
|
|
9
10
|
type ClientOptions = {
|
|
@@ -45,6 +46,20 @@ declare class Client {
|
|
|
45
46
|
readonly isEmpty: boolean;
|
|
46
47
|
readonly error: _urql_core.CombinedError | undefined;
|
|
47
48
|
}>;
|
|
49
|
+
getTree(args?: QueryTreeArgs): Promise<{
|
|
50
|
+
tree: null;
|
|
51
|
+
error: _urql_core.CombinedError | undefined;
|
|
52
|
+
} | {
|
|
53
|
+
readonly tree: Tree;
|
|
54
|
+
readonly error: _urql_core.CombinedError | undefined;
|
|
55
|
+
}>;
|
|
56
|
+
getTreeNodeDocument(args: TreeNodeDocumentQueryVariables): Promise<{
|
|
57
|
+
document: null;
|
|
58
|
+
error: _urql_core.CombinedError | undefined;
|
|
59
|
+
} | {
|
|
60
|
+
readonly document: Document;
|
|
61
|
+
readonly error: _urql_core.CombinedError | undefined;
|
|
62
|
+
}>;
|
|
48
63
|
private createUrqlClient;
|
|
49
64
|
}
|
|
50
65
|
|
package/dist/client/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,r={};((e,i)=>{for(var t in i)n(e,t,{get:i[t],enumerable:!0})})(r,{Client:()=>un}),module.exports=(e=r,((e,r,o,d)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let l of t(r))a.call(e,l)||l===o||n(e,l,{get:()=>r[l],enumerable:!(d=i(r,l))||d.enumerable});return e})(n({},"__esModule",{value:!0}),e));var o,d,l="Name",s="OperationDefinition",u="Field",c=class extends Error{constructor(e,n,i,t,a,r,o){super(e),this.name="GraphQLError",this.message=e,a&&(this.path=a),n&&(this.nodes=Array.isArray(n)?n:[n]),i&&(this.source=i),t&&(this.positions=t),r&&(this.originalError=r);var d=o;if(!d&&r){var l=r.extensions;l&&"object"==typeof l&&(d=l)}this.extensions=d||{}}toJSON(){return{...this,message:this.message}}toString(){return this.message}get[Symbol.toStringTag](){return"GraphQLError"}};function m(e){return new c(`Syntax Error: Unexpected token at ${d} in ${e}`)}function k(e){if(e.lastIndex=d,e.test(o))return o.slice(d,d=e.lastIndex)}var v=/ +(?=[^\s])/y;function f(e){for(var n=e.split("\n"),i="",t=0,a=0,r=n.length-1,o=0;o<n.length;o++)v.lastIndex=0,v.test(n[o])&&(o&&(!t||v.lastIndex<t)&&(t=v.lastIndex),a=a||o,r=o);for(var d=a;d<=r;d++)d!==a&&(i+="\n"),i+=n[d].slice(t).replace(/\\"""/g,'"""');return i}function g(){for(var e=0|o.charCodeAt(d++);9===e||10===e||13===e||32===e||35===e||44===e||65279===e;e=0|o.charCodeAt(d++))if(35===e)for(;10!==(e=o.charCodeAt(d++))&&13!==e;);d--}var h,p=/[_A-Za-z]\w*/y,y=new RegExp("(?:(null|true|false)|\\$("+p.source+')|(-?\\d+)((?:\\.\\d+)?[eE][+-]?\\d+|\\.\\d+)?|("""(?:"""|(?:[\\s\\S]*?[^\\\\])"""))|("(?:"|[^\\r\\n]*?[^\\\\]"))|('+p.source+"))","y"),N=((h=N||{})[h.Const=1]="Const",h[h.Var=2]="Var",h[h.Int=3]="Int",h[h.Float=4]="Float",h[h.BlockString=5]="BlockString",h[h.String=6]="String",h[h.Enum=7]="Enum",h),S=/\\/g;function b(e){var n,i;if(y.lastIndex=d,91===o.charCodeAt(d)){d++,g();for(var t=[];93!==o.charCodeAt(d);)t.push(b(e));return d++,g(),{kind:"ListValue",values:t}}if(123===o.charCodeAt(d)){d++,g();for(var a=[];125!==o.charCodeAt(d);){if(null==(n=k(p)))throw m("ObjectField");if(g(),58!==o.charCodeAt(d++))throw m("ObjectField");g(),a.push({kind:"ObjectField",name:{kind:"Name",value:n},value:b(e)})}return d++,g(),{kind:"ObjectValue",fields:a}}if(null!=(i=y.exec(o))){if(d=y.lastIndex,g(),null!=(n=i[N.Const]))return"null"===n?{kind:"NullValue"}:{kind:"BooleanValue",value:"true"===n};if(null!=(n=i[N.Var])){if(e)throw m("Variable");return{kind:"Variable",name:{kind:"Name",value:n}}}var r;if(null!=(n=i[N.Int]))return null!=(r=i[N.Float])?{kind:"FloatValue",value:n+r}:{kind:"IntValue",value:n};if(null!=(n=i[N.BlockString]))return{kind:"StringValue",value:f(n.slice(3,-3)),block:!0};if(null!=(n=i[N.String]))return{kind:"StringValue",value:S.test(n)?JSON.parse(n):n.slice(1,-1),block:!1};if(null!=(n=i[N.Enum]))return{kind:"EnumValue",value:n}}throw m("Value")}function F(e){if(40===o.charCodeAt(d)){var n,i=[];d++,g();do{if(null==(n=k(p)))throw m("Argument");if(g(),58!==o.charCodeAt(d++))throw m("Argument");g(),i.push({kind:"Argument",name:{kind:"Name",value:n},value:b(e)})}while(41!==o.charCodeAt(d));return d++,g(),i}}function w(e){if(64===o.charCodeAt(d)){var n,i=[];do{if(d++,null==(n=k(p)))throw m("Directive");g(),i.push({kind:"Directive",name:{kind:"Name",value:n},arguments:F(e)})}while(64===o.charCodeAt(d));return i}}function x(){for(var e,n=0;91===o.charCodeAt(d);)n++,d++,g();if(null==(e=k(p)))throw m("NamedType");g();var i={kind:"NamedType",name:{kind:"Name",value:e}};do{if(33===o.charCodeAt(d)&&(d++,g(),i={kind:"NonNullType",type:i}),n){if(93!==o.charCodeAt(d++))throw m("NamedType");g(),i={kind:"ListType",type:i}}}while(n--);return i}var D=new RegExp("(?:(\\.{3})|("+p.source+"))","y"),A=function(e){return e[e.Spread=1]="Spread",e[e.Name=2]="Name",e}(A||{});function C(){var e,n,i=[];do{if(D.lastIndex=d,null==(n=D.exec(o)))throw m("SelectionSet");if(d=D.lastIndex,null!=n[A.Spread]){g();var t=k(p);if(null!=t&&"on"!==t)g(),i.push({kind:"FragmentSpread",name:{kind:"Name",value:t},directives:w(!1)});else{if(g(),"on"===t){if(null==(t=k(p)))throw m("NamedType");g()}var a=w(!1);if(123!==o.charCodeAt(d++))throw m("InlineFragment");g(),i.push({kind:"InlineFragment",typeCondition:t?{kind:"NamedType",name:{kind:"Name",value:t}}:void 0,directives:a,selectionSet:C()})}}else if(null!=(e=n[A.Name])){var r=void 0;if(g(),58===o.charCodeAt(d)){if(d++,g(),r=e,null==(e=k(p)))throw m("Field");g()}var l=F(!1);g();var s=w(!1),u=void 0;123===o.charCodeAt(d)&&(d++,g(),u=C()),i.push({kind:"Field",alias:r?{kind:"Name",value:r}:void 0,name:{kind:"Name",value:e},arguments:l,directives:s,selectionSet:u})}}while(125!==o.charCodeAt(d));return d++,g(),{kind:"SelectionSet",selections:i}}function O(){var e,n;if(null==(e=k(p)))throw m("FragmentDefinition");if(g(),"on"!==k(p))throw m("FragmentDefinition");if(g(),null==(n=k(p)))throw m("FragmentDefinition");g();var i=w(!1);if(123!==o.charCodeAt(d++))throw m("FragmentDefinition");return g(),{kind:"FragmentDefinition",name:{kind:"Name",value:e},typeCondition:{kind:"NamedType",name:{kind:"Name",value:n}},directives:i,selectionSet:C()}}var q=/(?:query|mutation|subscription|fragment)/y;function E(e){var n,i,t;if(e&&(g(),n=k(p),i=function(){if(g(),40===o.charCodeAt(d)){var e,n=[];d++,g();do{if(36!==o.charCodeAt(d++))throw m("Variable");if(null==(e=k(p)))throw m("Variable");if(g(),58!==o.charCodeAt(d++))throw m("VariableDefinition");g();var i=x(),t=void 0;61===o.charCodeAt(d)&&(d++,g(),t=b(!0)),g(),n.push({kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:e}},type:i,defaultValue:t,directives:w(!0)})}while(41!==o.charCodeAt(d));return d++,g(),n}}(),t=w(!1)),123===o.charCodeAt(d))return d++,g(),{kind:"OperationDefinition",operation:e||"query",name:n?{kind:"Name",value:n}:void 0,variableDefinitions:i,directives:t,selectionSet:C()}}function V(e,n,i){for(var t="",a=0;a<e.length;a++)a&&(t+=n),t+=i(e[a]);return t}var $="\n",T={OperationDefinition(e){var n=e.operation;return e.name&&(n+=" "+e.name.value),e.variableDefinitions&&e.variableDefinitions.length&&(e.name||(n+=" "),n+="("+V(e.variableDefinitions,", ",T.VariableDefinition)+")"),e.directives&&e.directives.length&&(n+=" "+V(e.directives," ",T.Directive)),"query"!==n?n+" "+T.SelectionSet(e.selectionSet):T.SelectionSet(e.selectionSet)},VariableDefinition(e){var n=T.Variable(e.variable)+": "+I(e.type);return e.defaultValue&&(n+=" = "+I(e.defaultValue)),e.directives&&e.directives.length&&(n+=" "+V(e.directives," ",T.Directive)),n},Field(e){var n=e.alias?e.alias.value+": "+e.name.value:e.name.value;if(e.arguments&&e.arguments.length){var i=V(e.arguments,", ",T.Argument);n.length+i.length+2>80?n+="("+($+=" ")+V(e.arguments,$,T.Argument)+($=$.slice(0,-2))+")":n+="("+i+")"}return e.directives&&e.directives.length&&(n+=" "+V(e.directives," ",T.Directive)),e.selectionSet&&(n+=" "+T.SelectionSet(e.selectionSet)),n},StringValue:e=>e.block?function(e){return'"""\n'+e.replace(/"""/g,'\\"""')+'\n"""'}(e.value).replace(/\n/g,$):function(e){return JSON.stringify(e)}(e.value),BooleanValue:e=>""+e.value,NullValue:e=>"null",IntValue:e=>e.value,FloatValue:e=>e.value,EnumValue:e=>e.value,Name:e=>e.value,Variable:e=>"$"+e.name.value,ListValue:e=>"["+V(e.values,", ",I)+"]",ObjectValue:e=>"{"+V(e.fields,", ",T.ObjectField)+"}",ObjectField:e=>e.name.value+": "+I(e.value),Document:e=>e.definitions&&e.definitions.length?V(e.definitions,"\n\n",I):"",SelectionSet:e=>"{"+($+=" ")+V(e.selections,$,I)+($=$.slice(0,-2))+"}",Argument:e=>e.name.value+": "+I(e.value),FragmentSpread(e){var n="..."+e.name.value;return e.directives&&e.directives.length&&(n+=" "+V(e.directives," ",T.Directive)),n},InlineFragment(e){var n="...";return e.typeCondition&&(n+=" on "+e.typeCondition.name.value),e.directives&&e.directives.length&&(n+=" "+V(e.directives," ",T.Directive)),n+" "+T.SelectionSet(e.selectionSet)},FragmentDefinition(e){var n="fragment "+e.name.value;return n+=" on "+e.typeCondition.name.value,e.directives&&e.directives.length&&(n+=" "+V(e.directives," ",T.Directive)),n+" "+T.SelectionSet(e.selectionSet)},Directive(e){var n="@"+e.name.value;return e.arguments&&e.arguments.length&&(n+="("+V(e.arguments,", ",T.Argument)+")"),n},NamedType:e=>e.name.value,ListType:e=>"["+I(e.type)+"]",NonNullType:e=>I(e.type)+"!"},I=e=>T[e.kind](e);var _=()=>{},j=_;function P(e){return{tag:0,0:e}}function L(e){return{tag:1,0:e}}var U=()=>"function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator",M=e=>e;function R(e){return n=>i=>{var t=j;n((n=>{0===n?i(0):0===n.tag?(t=n[0],i(n)):e(n[0])?i(n):t(0)}))}}function Q(e){return n=>i=>n((n=>{0===n||0===n.tag?i(n):i(L(e(n[0])))}))}function J(e){return n=>i=>{var t=[],a=j,r=!1,o=!1;n((n=>{var d,l;o||(0===n?(o=!0,t.length||i(0)):0===n.tag?a=n[0]:(r=!1,d=e(n[0]),l=j,d((e=>{if(0===e){if(t.length){var n=t.indexOf(l);n>-1&&(t=t.slice()).splice(n,1),t.length||(o?i(0):r||(r=!0,a(0)))}}else 0===e.tag?(t.push(l=e[0]),l(0)):t.length&&(i(e),l(0))})),r||(r=!0,a(0))))})),i(P((e=>{if(1===e){o||(o=!0,a(1));for(var n=0,i=t,d=t.length;n<d;n++)i[n](1);t.length=0}else{o||r?r=!1:(r=!0,a(0));for(var l=0,s=t,u=t.length;l<u;l++)s[l](0)}})))}}function G(e){return function(e){return J(M)(e)}(ee(e))}function B(e){return n=>i=>{var t=!1;n((n=>{if(t);else if(0===n)t=!0,i(0),e();else if(0===n.tag){var a=n[0];i(P((n=>{1===n?(t=!0,a(1),e()):a(n)})))}else i(n)}))}}function K(e){return n=>i=>{var t=!1;n((n=>{if(t);else if(0===n)t=!0,i(0);else if(0===n.tag){var a=n[0];i(P((e=>{1===e&&(t=!0),a(e)})))}else e(n[0]),i(n)}))}}function z(e){return n=>i=>n((n=>{0===n?i(0):0===n.tag?(i(n),e()):i(n)}))}function W(e){var n=[],i=j,t=!1;return a=>{n.push(a),1===n.length&&e((e=>{if(0===e){for(var a=0,r=n,o=n.length;a<o;a++)r[a](0);n.length=0}else if(0===e.tag)i=e[0];else{t=!1;for(var d=0,l=n,s=n.length;d<s;d++)l[d](e)}})),a(P((e=>{if(1===e){var r=n.indexOf(a);r>-1&&(n=n.slice()).splice(r,1),n.length||i(1)}else t||(t=!0,i(0))})))}}function H(e){return n=>i=>{var t=j,a=j,r=!1,o=!1,d=!1,l=!1;n((n=>{l||(0===n?(l=!0,d||i(0)):0===n.tag?t=n[0]:(d&&(a(1),a=j),r?r=!1:(r=!0,t(0)),function(e){d=!0,e((e=>{d&&(0===e?(d=!1,l?i(0):r||(r=!0,t(0))):0===e.tag?(o=!1,(a=e[0])(0)):(i(e),o?o=!1:a(0)))}))}(e(n[0]))))})),i(P((e=>{1===e?(l||(l=!0,t(1)),d&&(d=!1,a(1))):(l||r||(r=!0,t(0)),d&&!o&&(o=!0,a(0)))})))}}function Y(e){return n=>i=>{var t=j,a=!1,r=0;n((n=>{a||(0===n?(a=!0,i(0)):0===n.tag?e<=0?(a=!0,i(0),n[0](1)):t=n[0]:r++<e?(i(n),!a&&r>=e&&(a=!0,i(0),t(1))):i(n))})),i(P((n=>{1!==n||a?0===n&&!a&&r<e&&t(0):(a=!0,t(1))})))}}function Z(e){return n=>i=>{var t=j,a=j,r=!1;n((n=>{r||(0===n?(r=!0,a(1),i(0)):0===n.tag?(t=n[0],e((e=>{0===e||(0===e.tag?(a=e[0])(0):(r=!0,a(1),t(1),i(0)))}))):i(n))})),i(P((e=>{1!==e||r?r||t(0):(r=!0,t(1),a(1))})))}}function X(e){return n=>{var i,t=e[U()]&&e[U()]()||e,a=!1,r=!1,o=!1;n(P((async e=>{if(1===e)a=!0,t.return&&t.return();else if(r)o=!0;else{for(o=r=!0;o&&!a;)if((i=await t.next()).done)a=!0,t.return&&await t.return(),n(0);else try{o=!1,n(L(i.value))}catch(e){if(!t.throw)throw e;(a=!!(await t.throw(e)).done)&&n(0)}r=!1}})))}}var ee=function(e){return e[Symbol.asyncIterator]?X(e):n=>{var i,t=e[Symbol.iterator](),a=!1,r=!1,o=!1;n(P((e=>{if(1===e)a=!0,t.return&&t.return();else if(r)o=!0;else{for(o=r=!0;o&&!a;)if((i=t.next()).done)a=!0,t.return&&t.return(),n(0);else try{o=!1,n(L(i.value))}catch(e){if(!t.throw)throw e;(a=!!t.throw(e).done)&&n(0)}r=!1}})))}};function ne(e){return n=>{var i=!1;n(P((t=>{1===t?i=!0:i||(i=!0,n(L(e)),n(0))})))}}function ie(e){return n=>{var i=!1,t=e({next(e){i||n(L(e))},complete(){i||(i=!0,n(0))}});n(P((e=>{1!==e||i||(i=!0,t())})))}}function te(){var e,n;return{source:W(ie((i=>(e=i.next,n=i.complete,_)))),next(n){e&&e(n)},complete(){n&&n()}}}function ae(e){return n=>{var i=j,t=!1;return n((n=>{0===n?t=!0:0===n.tag?(i=n[0])(0):t||(e(n[0]),i(0))})),{unsubscribe(){t||(t=!0,i(1))}}}}var re=e=>e&&e.message&&(e.extensions||"GraphQLError"===e.name)?e:"object"==typeof e&&e.message?new c(e.message,e.nodes,e.source,e.positions,e.path,e,e.extensions||{}):new c(e),oe=class extends Error{constructor(e){var n=(e.graphQLErrors||[]).map(re),i=((e,n)=>{var i="";if(e)return`[Network] ${e.message}`;if(n)for(var t of n)i&&(i+="\n"),i+=`[GraphQL] ${t.message}`;return i})(e.networkError,n);super(i),this.name="CombinedError",this.message=i,this.graphQLErrors=n,this.networkError=e.networkError,this.response=e.response}toString(){return this.message}},de=(e,n)=>{for(var i=0|(n||5381),t=0,a=0|e.length;t<a;t++)i=(i<<5)+i+e.charCodeAt(t);return i},le=new Set,se=new WeakMap,ue=(e,n)=>{if(null===e||le.has(e))return"null";if("object"!=typeof e)return JSON.stringify(e)||"";if(e.toJSON)return ue(e.toJSON(),n);if(Array.isArray(e)){var i="[";for(var t of e)i.length>1&&(i+=","),i+=ue(t,n)||"null";return i+"]"}if(!n&&(ve!==ke&&e instanceof ve||fe!==ke&&e instanceof fe))return"null";var a=Object.keys(e).sort();if(!a.length&&e.constructor&&Object.getPrototypeOf(e).constructor!==Object.prototype.constructor){var r=se.get(e)||Math.random().toString(36).slice(2);return se.set(e,r),ue({__key:r},n)}le.add(e);var o="{";for(var d of a){var l=ue(e[d],n);l&&(o.length>1&&(o+=","),o+=ue(d,n)+":"+l)}return le.delete(e),o+"}"},ce=(e,n,i)=>{if(null==i||"object"!=typeof i||i.toJSON||le.has(i));else if(Array.isArray(i))for(var t=0,a=i.length;t<a;t++)ce(e,`${n}.${t}`,i[t]);else if(i instanceof ve||i instanceof fe)e.set(n,i);else for(var r of(le.add(i),Object.keys(i)))ce(e,`${n}.${r}`,i[r])},me=(e,n)=>(le.clear(),ue(e,n||!1)),ke=class{},ve="undefined"!=typeof File?File:ke,fe="undefined"!=typeof Blob?Blob:ke,ge=/("{3}[\s\S]*"{3}|"(?:\\.|[^"])*")/g,he=/(?:#[^\n\r]+)?(?:[\r\n]+|$)/g,pe=(e,n)=>n%2==0?e.replace(he,"\n"):e,ye=e=>e.split(ge).map(pe).join("").trim(),Ne=new Map,Se=new Map,be=e=>{var n;return"string"==typeof e?n=ye(e):e.loc&&Se.get(e.__key)===e?n=e.loc.source.body:(n=Ne.get(e)||ye(function(e){return $="\n",T[e.kind]?T[e.kind](e):""}(e)),Ne.set(e,n)),"string"==typeof e||e.loc||(e.loc={start:0,end:n.length,source:{body:n,name:"gql",locationOffset:{line:1,column:1}}}),n},Fe=e=>{var n;if(e.documentId)n=de(e.documentId);else if(n=de(be(e)),e.definitions){var i=De(e);i&&(n=de(`\n# ${i}`,n))}return n},we=e=>{var n,i;return"string"==typeof e?(n=Fe(e),i=Se.get(n)||function(e,n){return o="string"==typeof e.body?e.body:e,d=0,function(){var e,n;g();var i=[];do{if("fragment"===(e=k(q)))g(),i.push(O());else{if(null==(n=E(e)))throw m("Document");i.push(n)}}while(d<o.length);return{kind:"Document",definitions:i}}()}(e)):(n=e.__key||Fe(e),i=Se.get(n)||e),i.loc||be(i),i.__key=n,Se.set(n,i),i},xe=(e,n,i)=>{var t=n||{},a=we(e),r=me(t,!0),o=a.__key;return"{}"!==r&&(o=de(r,o)),{key:o,query:a,variables:t,extensions:i}},De=e=>{for(var n of e.definitions)if(n.kind===s)return n.name?n.name.value:void 0},Ae=(e,n,i)=>{if(!("data"in n||"errors"in n&&Array.isArray(n.errors)))throw new Error("No Content");var t="subscription"===e.kind;return{operation:e,data:n.data,error:Array.isArray(n.errors)?new oe({graphQLErrors:n.errors,response:i}):void 0,extensions:n.extensions?{...n.extensions}:void 0,hasNext:null==n.hasNext?t:n.hasNext,stale:!1}},Ce=(e,n)=>{if("object"==typeof e&&null!=e&&(!e.constructor||e.constructor===Object||Array.isArray(e))){for(var i of(e=Array.isArray(e)?[...e]:{...e},Object.keys(n)))e[i]=Ce(e[i],n[i]);return e}return n},Oe=(e,n,i,t)=>{var a=e.error?e.error.graphQLErrors:[],r=!!e.extensions||!!(n.payload||n).extensions,o={...e.extensions,...(n.payload||n).extensions},d=n.incremental;"path"in n&&(d=[n]);var l={data:e.data};if(d){var s=function(e){Array.isArray(e.errors)&&a.push(...e.errors),e.extensions&&(Object.assign(o,e.extensions),r=!0);var n="data",i=l,d=[];if(e.path)d=e.path;else if(t){var s=t.find((n=>n.id===e.id));d=e.subPath?[...s.path,...e.subPath]:s.path}for(var u=0,c=d.length;u<c;n=d[u++])i=i[n]=Array.isArray(i[n])?[...i[n]]:{...i[n]};if(e.items)for(var m=+n>=0?n:0,k=0,v=e.items.length;k<v;k++)i[m+k]=Ce(i[m+k],e.items[k]);else void 0!==e.data&&(i[n]=Ce(i[n],e.data))};for(var u of d)s(u)}else l.data=(n.payload||n).data||e.data,a=n.errors||n.payload&&n.payload.errors||a;return{operation:e.operation,data:l.data,error:a.length?new oe({graphQLErrors:a,response:i}):void 0,extensions:r?o:void 0,hasNext:null!=n.hasNext?n.hasNext:e.hasNext,stale:!1}},qe=(e,n,i)=>({operation:e,data:void 0,error:new oe({networkError:n,response:i}),extensions:void 0,hasNext:!1,stale:!1});var Ee=e=>{var n=e.indexOf("?");return n>-1?[e.slice(0,n),new URLSearchParams(e.slice(n+1))]:[e,new URLSearchParams]},Ve=(e,n)=>{var i,t={accept:"subscription"===e.kind?"text/event-stream, multipart/mixed":"application/graphql-response+json, application/graphql+json, application/json, text/event-stream, multipart/mixed"},a=("function"==typeof e.context.fetchOptions?e.context.fetchOptions():e.context.fetchOptions)||{};if(a.headers)if("has"in(i=a.headers)&&!Object.keys(i).length)a.headers.forEach(((e,n)=>{t[n]=e}));else if(Array.isArray(a.headers))a.headers.forEach(((e,n)=>{Array.isArray(e)?t[e[0]]?t[e[0]]=`${t[e[0]]},${e[1]}`:t[e[0]]=e[1]:t[n]=e}));else for(var r in a.headers)t[r.toLowerCase()]=a.headers[r];var o=((e,n)=>{if(n&&("query"!==e.kind||!e.context.preferGetMethod)){var i=me(n),t=(d=n.variables,l=new Map,ve===ke&&fe===ke||(le.clear(),ce(l,"variables",d)),l);if(t.size){var a=new FormData;a.append("operations",i),a.append("map",me({...[...t.keys()].map((e=>[e]))}));var r=0;for(var o of t.values())a.append(""+r++,o);return a}return i}var d,l})(e,n);return"string"!=typeof o||t["content-type"]||(t["content-type"]="application/json"),{...a,method:o?"POST":"GET",body:o,headers:t}},$e="undefined"!=typeof TextDecoder?new TextDecoder:null,Te=/boundary="?([^=";]+)"?/i,Ie=/data: ?([^\n]+)/,_e=e=>"Buffer"===e.constructor.name?e.toString():$e.decode(e);async function*je(e){if(e.body[Symbol.asyncIterator])for await(var n of e.body)yield _e(n);else{var i,t=e.body.getReader();try{for(;!(i=await t.read()).done;)yield _e(i.value)}finally{t.cancel()}}}async function*Pe(e,n){var i,t="";for await(var a of e)for(t+=a;(i=t.indexOf(n))>-1;)yield t.slice(0,i),t=t.slice(i+n.length)}function Le(e,n,i){var t;return"undefined"!=typeof AbortController&&(i.signal=(t=new AbortController).signal),B((()=>{t&&t.abort()}))(R((e=>!!e))(X(async function*(e,n,i){var t,a=!0,r=null;try{yield await Promise.resolve();var o,d=(t=await(e.context.fetch||fetch)(n,i)).headers.get("Content-Type")||"";for await(var l of/multipart\/mixed/i.test(d)?async function*(e,n){var i,t=e.match(Te),a="--"+(t?t[1]:"-"),r=!0;for await(var o of Pe(je(n),"\r\n"+a)){if(r){r=!1;var d=o.indexOf(a);if(!(d>-1))continue;o=o.slice(d+a.length)}try{yield i=JSON.parse(o.slice(o.indexOf("\r\n\r\n")+4))}catch(e){if(!i)throw e}if(i&&!1===i.hasNext)break}i&&!1!==i.hasNext&&(yield{hasNext:!1})}(d,t):/text\/event-stream/i.test(d)?async function*(e){var n;for await(var i of Pe(je(e),"\n\n")){var t=i.match(Ie);if(t){var a=t[1];try{yield n=JSON.parse(a)}catch(e){if(!n)throw e}if(n&&!1===n.hasNext)break}}n&&!1!==n.hasNext&&(yield{hasNext:!1})}(t):/text\//i.test(d)?async function*(e){var n=await e.text();try{var i=JSON.parse(n);"production"!==process.env.NODE_ENV&&console.warn('Found response with content-type "text/plain" but it had a valid "application/json" response.'),yield i}catch(e){throw new Error(n)}}(t):async function*(e){yield JSON.parse(await e.text())}(t))l.pending&&!r?o=l.pending:l.pending&&(o=[...o,...l.pending]),r=r?Oe(r,l,t,o):Ae(e,l,t),a=!1,yield r,a=!0;r||(yield r=Ae(e,{},t))}catch(n){if(!a)throw n;yield qe(e,t&&(t.status<200||t.status>=300)&&t.statusText?new Error(t.statusText):n,t)}}(e,n,i))))}var Ue=(e,n)=>{if(Array.isArray(e))for(var i of e)Ue(i,n);else if("object"==typeof e&&null!==e)for(var t in e)"__typename"===t&&"string"==typeof e[t]?n.add(e[t]):Ue(e[t],n);return n},Me=e=>{if("definitions"in e){var n=[];for(var i of e.definitions){var t=Me(i);n.push(t)}return{...e,definitions:n}}if("directives"in e&&e.directives&&e.directives.length){var a=[],r={};for(var o of e.directives){var d=o.name.value;"_"!==d[0]?a.push(o):d=d.slice(1),r[d]=o}e={...e,directives:a,_directives:r}}if("selectionSet"in e){var c=[],m=e.kind===s;if(e.selectionSet){for(var k of e.selectionSet.selections||[]){m=m||k.kind===u&&"__typename"===k.name.value&&!k.alias;var v=Me(k);c.push(v)}return m||c.push({kind:u,name:{kind:l,value:"__typename"},_generated:!0}),{...e,selectionSet:{...e.selectionSet,selections:c}}}}return e},Re=new Map;function Qe(e){var n=n=>e(n);return n.toPromise=()=>{return e=Y(1)(R((e=>!e.stale&&!e.hasNext))(n)),new Promise((n=>{var i,t=j;e((e=>{0===e?Promise.resolve(i).then(n):0===e.tag?(t=e[0])(0):(i=e[0],t(0))}))}));var e},n.then=(e,i)=>n.toPromise().then(e,i),n.subscribe=e=>ae(e)(n),n}function Je(e,n,i){return{...n,kind:e,context:n.context?{...n.context,...i}:i||n.context}}var Ge=(e,n)=>Je(e.kind,e,{meta:{...e.context.meta,...n}}),Be=()=>{},Ke=({kind:e})=>"mutation"!==e&&"query"!==e,ze=e=>{var n=(e=>{var n=we(e),i=Re.get(n.__key);return i||(Re.set(n.__key,i=Me(n)),Object.defineProperty(i,"__key",{value:n.__key,enumerable:!1})),i})(e.query);if(n!==e.query){var i=Je(e.kind,e);return i.query=n,i}return e},We=({forward:e,client:n,dispatchDebug:i})=>{var t=new Map,a=new Map,r=e=>"query"===e.kind&&"network-only"!==e.context.requestPolicy&&("cache-only"===e.context.requestPolicy||t.has(e.key));return o=>{var d=Q((e=>{var a=t.get(e.key);"production"!==process.env.NODE_ENV&&i({operation:e,...a?{type:"cacheHit",message:"The result was successfully retried from the cache"}:{type:"cacheMiss",message:"The result could not be retrieved from the cache"},source:"cacheExchange"});var r=a||Ae(e,{data:null});return r={...r,operation:"production"!==process.env.NODE_ENV?Ge(e,{cacheOutcome:a?"hit":"miss"}):e},"cache-and-network"===e.context.requestPolicy&&(r.stale=!0,He(n,e)),r}))(R((e=>!Ke(e)&&r(e)))(o)),l=K((e=>{var{operation:r}=e;if(r){var o,d=r.context.additionalTypenames||[];if("subscription"!==e.operation.kind&&(d=(o=e.data,[...Ue(o,new Set)]).concat(d)),"mutation"===e.operation.kind||"subscription"===e.operation.kind){var l=new Set;"production"!==process.env.NODE_ENV&&i({type:"cacheInvalidation",message:`The following typenames have been invalidated: ${d}`,operation:r,data:{typenames:d,response:e},source:"cacheExchange"});for(var s=0;s<d.length;s++){var u=d[s],c=a.get(u);for(var m of(c||a.set(u,c=new Set),c.values()))l.add(m);c.clear()}for(var k of l.values())t.has(k)&&(r=t.get(k).operation,t.delete(k),He(n,r))}else if("query"===r.kind&&e.data){t.set(r.key,e);for(var v=0;v<d.length;v++){var f=d[v],g=a.get(f);g||a.set(f,g=new Set),g.add(r.key)}}}}))(e(R((e=>"query"!==e.kind||"cache-only"!==e.context.requestPolicy))(Q((e=>"production"!==process.env.NODE_ENV?Ge(e,{cacheOutcome:"miss"}):e))(G([Q(ze)(R((e=>!Ke(e)&&!r(e)))(o)),R((e=>Ke(e)))(o)])))));return G([d,l])}},He=(e,n)=>e.reexecuteOperation(Je(n.kind,n,{requestPolicy:"network-only"})),Ye=({forward:e,dispatchDebug:n})=>i=>{var t=J((e=>{var t=function(e){var n={query:void 0,documentId:void 0,operationName:De(e.query),variables:e.variables||void 0,extensions:e.extensions};return!("documentId"in e.query)||!e.query.documentId||e.query.definitions&&e.query.definitions.length?e.extensions&&e.extensions.persistedQuery&&!e.extensions.persistedQuery.miss||(n.query=be(e.query)):n.documentId=e.query.documentId,n}(e),a=((e,n)=>{var i="query"===e.kind&&e.context.preferGetMethod;if(!i||!n)return e.context.url;var t=Ee(e.context.url);for(var a in n){var r=n[a];r&&t[1].set(a,"object"==typeof r?me(r):r)}var o=t.join("?");return o.length>2047&&"force"!==i?(e.context.preferGetMethod=!1,e.context.url):o})(e,t),r=Ve(e,t);"production"!==process.env.NODE_ENV&&n({type:"fetchRequest",message:"A fetch request is being executed.",operation:e,data:{url:a,fetchOptions:r},source:"fetchExchange"});var o=Z(R((n=>"teardown"===n.kind&&n.key===e.key))(i))(Le(e,a,r));return"production"!==process.env.NODE_ENV?K((i=>{var t=i.data?void 0:i.error;"production"!==process.env.NODE_ENV&&n({type:t?"fetchError":"fetchSuccess",message:`A ${t?"failed":"successful"} fetch response has been returned.`,operation:e,data:{url:a,fetchOptions:r,value:t||i},source:"fetchExchange"})}))(o):o}))(R((e=>"teardown"!==e.kind&&("subscription"!==e.kind||!!e.context.fetchSubscriptions)))(i));return G([t,e(R((e=>"teardown"===e.kind||"subscription"===e.kind&&!e.context.fetchSubscriptions))(i))])},Ze=({dispatchDebug:e})=>n=>("production"!==process.env.NODE_ENV&&(n=K((n=>{if("teardown"!==n.kind&&"production"!==process.env.NODE_ENV){var i=`No exchange has handled operations of kind "${n.kind}". Check whether you've added an exchange responsible for these operations.`;"production"!==process.env.NODE_ENV&&e({type:"fallbackCatch",message:i,operation:n,source:"fallbackExchange"}),console.warn(i)}}))(n)),R((e=>!1))(n)),Xe=function e(n){if("production"!==process.env.NODE_ENV&&!n.url)throw new Error("You are creating an urql-client without a url.");var i=0,t=new Map,a=new Map,r=new Set,o=[],d={url:n.url,fetchSubscriptions:n.fetchSubscriptions,fetchOptions:n.fetchOptions,fetch:n.fetch,preferGetMethod:n.preferGetMethod,requestPolicy:n.requestPolicy||"cache-first"},l=te();function u(e){"mutation"!==e.kind&&"teardown"!==e.kind&&r.has(e.key)||("teardown"===e.kind?r.delete(e.key):"mutation"!==e.kind&&r.add(e.key),l.next(e))}var c=!1;function m(e){if(e&&u(e),!c){for(c=!0;c&&(e=o.shift());)u(e);c=!1}}var k=e=>{var n=Z(R((n=>"teardown"===n.kind&&n.key===e.key))(l.source))(R((n=>n.operation.kind===e.kind&&n.operation.key===e.key&&(!n.operation.context._instance||n.operation.context._instance===e.context._instance)))(N));return n="query"!==e.kind?function(e,n){return i=>t=>{var a=j,r=!1;i((i=>{r||(0===i?(r=!0,t(0)):0===i.tag?(a=i[0],t(i)):e(i[0])?t(i):(r=!0,n&&t(i),t(0),a(1)))}))}}((e=>!!e.hasNext),!0)(n):H((n=>{var i=ne(n);return n.stale||n.hasNext?i:G([i,Q((()=>(n.stale=!0,n)))(Y(1)(R((n=>n.key===e.key))(l.source)))])}))(n),W(n="mutation"!==e.kind?B((()=>{r.delete(e.key),t.delete(e.key),a.delete(e.key),c=!1;for(var n=o.length-1;n>=0;n--)o[n].key===e.key&&o.splice(n,1);u(Je("teardown",e,e.context))}))(K((n=>{if(n.stale)if(n.hasNext){for(var i of o)if(i.key===n.operation.key){r.delete(i.key);break}}else r.delete(e.key);else n.hasNext||r.delete(e.key);t.set(e.key,n)}))(n)):z((()=>{u(e)}))(n))},v=this instanceof e?this:Object.create(e.prototype),f=Object.assign(v,{suspense:!!n.suspense,operations$:l.source,reexecuteOperation(e){if("teardown"===e.kind)m(e);else if("mutation"===e.kind)o.push(e),Promise.resolve().then(m);else if(a.has(e.key)){for(var n=!1,i=0;i<o.length;i++)o[i].key===e.key&&(o[i]=e,n=!0);n||r.has(e.key)&&"network-only"!==e.context.requestPolicy?(r.delete(e.key),Promise.resolve().then(m)):(o.push(e),Promise.resolve().then(m))}},createRequestOperation(e,n,t){var a;if(t||(t={}),"production"!==process.env.NODE_ENV&&"teardown"!==e&&(a=(e=>{for(var n of e.definitions)if(n.kind===s)return n.operation})(n.query))!==e)throw new Error(`Expected operation of type "${e}" but found "${a}"`);return Je(e,n,{_instance:"mutation"===e?i=i+1|0:void 0,...d,...t,requestPolicy:t.requestPolicy||d.requestPolicy,suspense:t.suspense||!1!==t.suspense&&f.suspense})},executeRequestOperation:e=>"mutation"===e.kind?Qe(k(e)):Qe(function(e){return n=>e()(n)}((()=>{var n=a.get(e.key);n||a.set(e.key,n=k(e)),n=z((()=>{m(e)}))(n);var i=t.get(e.key);return"query"===e.kind&&i&&(i.stale||i.hasNext)?H(ne)(G([n,R((n=>n===t.get(e.key)))(ne(i))])):n}))),executeQuery(e,n){var i=f.createRequestOperation("query",e,n);return f.executeRequestOperation(i)},executeSubscription(e,n){var i=f.createRequestOperation("subscription",e,n);return f.executeRequestOperation(i)},executeMutation(e,n){var i=f.createRequestOperation("mutation",e,n);return f.executeRequestOperation(i)},readQuery(e,n,i){var t=null;return ae((e=>{t=e}))(f.query(e,n,i)).unsubscribe(),t},query:(e,n,i)=>f.executeQuery(xe(e,n),i),subscription:(e,n,i)=>f.executeSubscription(xe(e,n),i),mutation:(e,n,i)=>f.executeMutation(xe(e,n),i)}),g=Be;if("production"!==process.env.NODE_ENV){var{next:h,source:p}=te();f.subscribeToDebugTarget=e=>ae(e)(p),g=h}var y=(e=>({client:n,forward:i,dispatchDebug:t})=>e.reduceRight(((e,i)=>{var a=!1;return i({client:n,forward(n){if("production"!==process.env.NODE_ENV){if(a)throw new Error("forward() must only be called once in each Exchange.");a=!0}return W(e(W(n)))},dispatchDebug(e){"production"!==process.env.NODE_ENV&&t({timestamp:Date.now(),source:i.name,...e})}})}),i))(n.exchanges),N=W(y({client:f,dispatchDebug:g,forward:Ze({dispatchDebug:g})})(l.source));return function(e){ae((e=>{}))(e)}(N),f},en={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"document"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"slug"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"document"},arguments:[{kind:"Argument",name:{kind:"Name",value:"slug"},value:{kind:"Variable",name:{kind:"Name",value:"slug"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"content"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"preview"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}},{kind:"Field",name:{kind:"Name",value:"assets"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}},{kind:"Field",name:{kind:"Name",value:"height"}},{kind:"Field",name:{kind:"Name",value:"width"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"outboundLinkDocuments"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"inboundLinkDocuments"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"websites"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"domain"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"ogSiteName"}},{kind:"Field",name:{kind:"Name",value:"ogTitle"}},{kind:"Field",name:{kind:"Name",value:"ogType"}},{kind:"Field",name:{kind:"Name",value:"ogUrl"}},{kind:"Field",name:{kind:"Name",value:"ogDescription"}},{kind:"Field",name:{kind:"Name",value:"ogLocale"}},{kind:"Field",name:{kind:"Name",value:"ogImage"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}}]}}]}}]}}]}}]},nn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"documents"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filter"}},type:{kind:"NamedType",name:{kind:"Name",value:"DocumentConnectionFilter"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sort"}},type:{kind:"NamedType",name:{kind:"Name",value:"ConnectionSort"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"documents"},arguments:[{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}},{kind:"Argument",name:{kind:"Name",value:"filter"},value:{kind:"Variable",name:{kind:"Name",value:"filter"}}},{kind:"Argument",name:{kind:"Name",value:"sort"},value:{kind:"Variable",name:{kind:"Name",value:"sort"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"preview"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}}]}}]}}]}}]}}]},tn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"tag"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"tag"},arguments:[{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"documentCount"}},{kind:"Field",name:{kind:"Name",value:"documentCountInPublished"}},{kind:"Field",name:{kind:"Name",value:"relatedTags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"documentCount"}},{kind:"Field",name:{kind:"Name",value:"documentCountInPublished"}}]}}]}}]}}]}}]}}]},an={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"tags"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sort"}},type:{kind:"NamedType",name:{kind:"Name",value:"ConnectionSort"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"tags"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sort"},value:{kind:"Variable",name:{kind:"Name",value:"sort"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"documentCount"}},{kind:"Field",name:{kind:"Name",value:"documentCountInPublished"}}]}}]}}]}}]}}]},rn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"websites"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"websites"},arguments:[{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"domain"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"ogSiteName"}},{kind:"Field",name:{kind:"Name",value:"ogTitle"}},{kind:"Field",name:{kind:"Name",value:"ogType"}},{kind:"Field",name:{kind:"Name",value:"ogUrl"}},{kind:"Field",name:{kind:"Name",value:"ogDescription"}},{kind:"Field",name:{kind:"Name",value:"ogLocale"}},{kind:"Field",name:{kind:"Name",value:"ogImage"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}},{kind:"Field",name:{kind:"Name",value:"documents"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"slug"}}]}}]}}]}}]}}]}}]}}]}}]},on={"\n query document($slug: String) {\n document(slug: $slug) {\n id\n slug\n emoji\n title\n draft\n content\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n assets {\n edges {\n node {\n id\n path\n name\n fileUrl\n height\n width\n }\n }\n }\n outboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n inboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n websites {\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n }\n }\n }\n }\n }\n":en,"\n query documents($after: String, $first: Int, $filter: DocumentConnectionFilter, $sort: ConnectionSort) {\n documents(after: $after, first: $first, filter: $filter, sort: $sort) {\n totalCount\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n }\n }\n }\n }\n":nn,"\n query tag($name: String) {\n tag(name: $name) {\n id\n name\n documentCount\n documentCountInPublished\n relatedTags {\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n }\n":tn,"\n query tags($sort: ConnectionSort) {\n tags(sort: $sort) {\n totalCount\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n":an,"\n query websites($after: String, $first: Int) {\n websites(after: $after, first: $first) {\n totalCount\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n documents {\n edges {\n node {\n id\n draft\n title\n slug\n }\n }\n }\n }\n }\n }\n }\n":rn};function dn(e){return on[e]??{}}var ln=e=>null!=e;function sn(e){return e?e.map((e=>e?.node)).filter(ln)??[]:[]}dn("\n query document($slug: String) {\n document(slug: $slug) {\n id\n slug\n emoji\n title\n draft\n content\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n assets {\n edges {\n node {\n id\n path\n name\n fileUrl\n height\n width\n }\n }\n }\n outboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n inboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n websites {\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n }\n }\n }\n }\n }\n"),dn("\n query documents($after: String, $first: Int, $filter: DocumentConnectionFilter, $sort: ConnectionSort) {\n documents(after: $after, first: $first, filter: $filter, sort: $sort) {\n totalCount\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n }\n }\n }\n }\n"),dn("\n query tag($name: String) {\n tag(name: $name) {\n id\n name\n documentCount\n documentCountInPublished\n relatedTags {\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n }\n"),dn("\n query tags($sort: ConnectionSort) {\n tags(sort: $sort) {\n totalCount\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n"),dn("\n query websites($after: String, $first: Int) {\n websites(after: $after, first: $first) {\n totalCount\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n documents {\n edges {\n node {\n id\n draft\n title\n slug\n }\n }\n }\n }\n }\n }\n }\n");var un=class{url;accessKey;urqlClient;constructor(e){this.url=e.url,this.accessKey=e.accessKey,this.urqlClient=e.urqlClient??this.createUrqlClient()}async getDocument(e){return function(e){if(!e.data?.document)return{document:null,error:e.error};const n=e.data?.document;return{document:{...n,tags:sn(n.tags?.edges),assets:sn(n.assets?.edges),outboundLinkDocuments:sn(n.outboundLinkDocuments?.edges).map((e=>({...e,tags:sn(e.tags?.edges)}))),inboundLinkDocuments:sn(n.inboundLinkDocuments?.edges).map((e=>({...e,tags:sn(e.tags?.edges)}))),websites:sn(n.websites?.edges)},error:e.error}}(await this.urqlClient.query(en,e))}async getDocuments(e){return function(e){if(!e.data||!e.data.documents)return{documents:[],totalCount:0,isEmpty:!0,error:e.error};const n=e.data.documents,i=sn(n?.edges).map((e=>({...e,tags:sn(e.tags?.edges)}))),t=e.data?.documents?.totalCount||0;return{documents:i,totalCount:t,isEmpty:0===t,error:e.error}}(await this.urqlClient.query(nn,e??{}))}async getTag(e){return function(e){const n=e.data?.tag;return{tag:n?{...n,relatedTags:sn(n.relatedTags?.edges)}:null,error:e.error}}(await this.urqlClient.query(tn,e))}async getTags(e){return function(e){const n=sn(e.data?.tags?.edges),i=e.data?.tags?.totalCount||0;return{tags:n,totalCount:i,isEmpty:0===i,error:e.error}}(await this.urqlClient.query(an,e??{}))}async getWebsites(e){return function(e){const n=sn(e.data?.websites?.edges).map((e=>({...e,documents:sn(e.documents?.edges)}))),i=e.data?.websites?.totalCount||0;return{websites:n,totalCount:i,isEmpty:0===i,error:e.error}}(await this.urqlClient.query(rn,e??{}))}createUrqlClient(){return Xe({url:this.url,exchanges:[We,Ye],fetchOptions:{headers:{Authorization:`bearer ${this.accessKey}`},cache:"no-store"}})}};
|
|
1
|
+
"use strict";var e,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,t={};((e,i)=>{for(var d in i)n(e,d,{get:i[d],enumerable:!0})})(t,{Client:()=>f}),module.exports=(e=t,((e,t,l,m)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of d(t))a.call(e,o)||o===l||n(e,o,{get:()=>t[o],enumerable:!(m=i(t,o))||m.enumerable});return e})(n({},"__esModule",{value:!0}),e));var l=require("@urql/core"),m={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"document"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"slug"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"document"},arguments:[{kind:"Argument",name:{kind:"Name",value:"slug"},value:{kind:"Variable",name:{kind:"Name",value:"slug"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"content"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"preview"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}},{kind:"Field",name:{kind:"Name",value:"assets"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}},{kind:"Field",name:{kind:"Name",value:"height"}},{kind:"Field",name:{kind:"Name",value:"width"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"outboundLinkDocuments"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"inboundLinkDocuments"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"websites"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"domain"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"ogSiteName"}},{kind:"Field",name:{kind:"Name",value:"ogTitle"}},{kind:"Field",name:{kind:"Name",value:"ogType"}},{kind:"Field",name:{kind:"Name",value:"ogUrl"}},{kind:"Field",name:{kind:"Name",value:"ogDescription"}},{kind:"Field",name:{kind:"Name",value:"ogLocale"}},{kind:"Field",name:{kind:"Name",value:"ogImage"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}}]}}]}}]}}]}}]},o={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"documents"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filter"}},type:{kind:"NamedType",name:{kind:"Name",value:"DocumentConnectionFilter"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sort"}},type:{kind:"NamedType",name:{kind:"Name",value:"ConnectionSort"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"documents"},arguments:[{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}},{kind:"Argument",name:{kind:"Name",value:"filter"},value:{kind:"Variable",name:{kind:"Name",value:"filter"}}},{kind:"Argument",name:{kind:"Name",value:"sort"},value:{kind:"Variable",name:{kind:"Name",value:"sort"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"preview"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}}]}}]}}]}}]}}]},k={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"tag"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"tag"},arguments:[{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"documentCount"}},{kind:"Field",name:{kind:"Name",value:"documentCountInPublished"}},{kind:"Field",name:{kind:"Name",value:"relatedTags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"documentCount"}},{kind:"Field",name:{kind:"Name",value:"documentCountInPublished"}}]}}]}}]}}]}}]}}]},s={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"tags"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sort"}},type:{kind:"NamedType",name:{kind:"Name",value:"ConnectionSort"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"tags"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sort"},value:{kind:"Variable",name:{kind:"Name",value:"sort"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"documentCount"}},{kind:"Field",name:{kind:"Name",value:"documentCountInPublished"}}]}}]}}]}}]}}]},u={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"treeNodeDocument"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"treeSlug"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"nodeFullSlug"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"variant"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"tree"},arguments:[{kind:"Argument",name:{kind:"Name",value:"slug"},value:{kind:"Variable",name:{kind:"Name",value:"treeSlug"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"node"},arguments:[{kind:"Argument",name:{kind:"Name",value:"fullSlug"},value:{kind:"Variable",name:{kind:"Name",value:"nodeFullSlug"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"nodeDocument"},arguments:[{kind:"Argument",name:{kind:"Name",value:"variant"},value:{kind:"Variable",name:{kind:"Name",value:"variant"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"document"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"content"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"preview"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}},{kind:"Field",name:{kind:"Name",value:"assets"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}},{kind:"Field",name:{kind:"Name",value:"height"}},{kind:"Field",name:{kind:"Name",value:"width"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"outboundLinkDocuments"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"inboundLinkDocuments"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"emoji"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"path"}},{kind:"Field",name:{kind:"Name",value:"tags"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"publishedAt"}},{kind:"Field",name:{kind:"Name",value:"modifiedAt"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"websites"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"domain"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"ogSiteName"}},{kind:"Field",name:{kind:"Name",value:"ogTitle"}},{kind:"Field",name:{kind:"Name",value:"ogType"}},{kind:"Field",name:{kind:"Name",value:"ogUrl"}},{kind:"Field",name:{kind:"Name",value:"ogDescription"}},{kind:"Field",name:{kind:"Name",value:"ogLocale"}},{kind:"Field",name:{kind:"Name",value:"ogImage"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}}]}}]}}]}}]}}]}}]}}]}}]}}]},r={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"tree"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"slug"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"tree"},arguments:[{kind:"Argument",name:{kind:"Name",value:"slug"},value:{kind:"Variable",name:{kind:"Name",value:"slug"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"slug"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"fullSlug"}},{kind:"Field",name:{kind:"Name",value:"names"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"variant"}},{kind:"Field",name:{kind:"Name",value:"content"}}]}},{kind:"Field",name:{kind:"Name",value:"nodeDocuments"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"variant"}},{kind:"Field",name:{kind:"Name",value:"document"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"path"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"parent"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}},{kind:"Field",name:{kind:"Name",value:"root"}},{kind:"Field",name:{kind:"Name",value:"position"}}]}}]}}]}}]}}]}}]},c={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"websites"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"websites"},arguments:[{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"domain"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"ogSiteName"}},{kind:"Field",name:{kind:"Name",value:"ogTitle"}},{kind:"Field",name:{kind:"Name",value:"ogType"}},{kind:"Field",name:{kind:"Name",value:"ogUrl"}},{kind:"Field",name:{kind:"Name",value:"ogDescription"}},{kind:"Field",name:{kind:"Name",value:"ogLocale"}},{kind:"Field",name:{kind:"Name",value:"ogImage"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"fileUrl"}},{kind:"Field",name:{kind:"Name",value:"width"}},{kind:"Field",name:{kind:"Name",value:"height"}}]}},{kind:"Field",name:{kind:"Name",value:"documents"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"draft"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"slug"}}]}}]}}]}}]}}]}}]}}]}}]},v={"\n query document($slug: String) {\n document(slug: $slug) {\n id\n slug\n emoji\n title\n draft\n content\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n assets {\n edges {\n node {\n id\n path\n name\n fileUrl\n height\n width\n }\n }\n }\n outboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n inboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n websites {\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n }\n }\n }\n }\n }\n":m,"\n query documents($after: String, $first: Int, $filter: DocumentConnectionFilter, $sort: ConnectionSort) {\n documents(after: $after, first: $first, filter: $filter, sort: $sort) {\n totalCount\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n }\n }\n }\n }\n":o,"\n query tag($name: String) {\n tag(name: $name) {\n id\n name\n documentCount\n documentCountInPublished\n relatedTags {\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n }\n":k,"\n query tags($sort: ConnectionSort) {\n tags(sort: $sort) {\n totalCount\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n":s,"\n query treeNodeDocument($treeSlug: String, $nodeFullSlug: String!, $variant: String) {\n tree(slug: $treeSlug) {\n id\n node(fullSlug: $nodeFullSlug) {\n id\n nodeDocument(variant: $variant) {\n document {\n id\n slug\n emoji\n title\n draft\n content\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n assets {\n edges {\n node {\n id\n path\n name\n fileUrl\n height\n width\n }\n }\n }\n outboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n inboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n websites {\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n }\n }\n }\n }\n }\n }\n }\n }\n":u,"\n query tree($slug: String) {\n tree(slug: $slug) {\n id\n slug\n name\n nodes {\n edges {\n node {\n id\n fullSlug\n names {\n variant\n content\n }\n nodeDocuments {\n variant\n document {\n id\n title\n path\n }\n }\n parent {\n id\n }\n root\n position\n }\n }\n }\n }\n }\n":r,"\n query websites($after: String, $first: Int) {\n websites(after: $after, first: $first) {\n totalCount\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n documents {\n edges {\n node {\n id\n draft\n title\n slug\n }\n }\n }\n }\n }\n }\n }\n":c};function g(e){return v[e]??{}}var N=e=>null!=e;function S(e){return e?e.map((e=>e?.node)).filter(N)??[]:[]}function F(e){const n=new Map,i=[];return e.forEach((e=>{n.set(e.id,{...e,children:[]})})),e.forEach((e=>{const d=n.get(e.id);if(e.parentId){const i=n.get(e.parentId);i?.children?.push(d)}else i.push(d)})),i}g("\n query document($slug: String) {\n document(slug: $slug) {\n id\n slug\n emoji\n title\n draft\n content\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n assets {\n edges {\n node {\n id\n path\n name\n fileUrl\n height\n width\n }\n }\n }\n outboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n inboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n websites {\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n }\n }\n }\n }\n }\n"),g("\n query documents($after: String, $first: Int, $filter: DocumentConnectionFilter, $sort: ConnectionSort) {\n documents(after: $after, first: $first, filter: $filter, sort: $sort) {\n totalCount\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n }\n }\n }\n }\n"),g("\n query tag($name: String) {\n tag(name: $name) {\n id\n name\n documentCount\n documentCountInPublished\n relatedTags {\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n }\n"),g("\n query tags($sort: ConnectionSort) {\n tags(sort: $sort) {\n totalCount\n edges {\n node {\n id\n name\n documentCount\n documentCountInPublished\n }\n }\n }\n }\n"),g("\n query websites($after: String, $first: Int) {\n websites(after: $after, first: $first) {\n totalCount\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n documents {\n edges {\n node {\n id\n draft\n title\n slug\n }\n }\n }\n }\n }\n }\n }\n"),g("\n query tree($slug: String) {\n tree(slug: $slug) {\n id\n slug\n name\n nodes {\n edges {\n node {\n id\n fullSlug\n names {\n variant\n content\n }\n nodeDocuments {\n variant\n document {\n id\n title\n path\n }\n }\n parent {\n id\n }\n root\n position\n }\n }\n }\n }\n }\n"),g("\n query treeNodeDocument($treeSlug: String, $nodeFullSlug: String!, $variant: String) {\n tree(slug: $treeSlug) {\n id\n node(fullSlug: $nodeFullSlug) {\n id\n nodeDocument(variant: $variant) {\n document {\n id\n slug\n emoji\n title\n draft\n content\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n preview {\n id\n width\n height\n path\n fileUrl\n }\n publishedAt\n modifiedAt\n assets {\n edges {\n node {\n id\n path\n name\n fileUrl\n height\n width\n }\n }\n }\n outboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n inboundLinkDocuments {\n edges {\n node {\n id\n slug\n emoji\n title\n draft\n path\n tags {\n edges {\n node {\n id\n name\n }\n }\n }\n publishedAt\n modifiedAt\n }\n }\n }\n websites {\n edges {\n node {\n id\n url\n domain\n title\n description\n ogSiteName\n ogTitle\n ogType\n ogUrl\n ogDescription\n ogLocale\n ogImage {\n id\n fileUrl\n width\n height\n }\n }\n }\n }\n }\n }\n }\n }\n }\n");var f=class{url;accessKey;urqlClient;constructor(e){this.url=e.url,this.accessKey=e.accessKey,this.urqlClient=e.urqlClient??this.createUrqlClient()}async getDocument(e){return function(e){if(!e.data?.document)return{document:null,error:e.error};const n=e.data?.document;return{document:{...n,tags:S(n.tags?.edges),assets:S(n.assets?.edges),outboundLinkDocuments:S(n.outboundLinkDocuments?.edges).map((e=>({...e,tags:S(e.tags?.edges)}))),inboundLinkDocuments:S(n.inboundLinkDocuments?.edges).map((e=>({...e,tags:S(e.tags?.edges)}))),websites:S(n.websites?.edges)},error:e.error}}(await this.urqlClient.query(m,e))}async getDocuments(e){return function(e){if(!e.data||!e.data.documents)return{documents:[],totalCount:0,isEmpty:!0,error:e.error};const n=e.data.documents,i=S(n?.edges).map((e=>({...e,tags:S(e.tags?.edges)}))),d=e.data?.documents?.totalCount||0;return{documents:i,totalCount:d,isEmpty:0===d,error:e.error}}(await this.urqlClient.query(o,e??{}))}async getTag(e){return function(e){const n=e.data?.tag;return{tag:n?{...n,relatedTags:S(n.relatedTags?.edges)}:null,error:e.error}}(await this.urqlClient.query(k,e))}async getTags(e){return function(e){const n=S(e.data?.tags?.edges),i=e.data?.tags?.totalCount||0;return{tags:n,totalCount:i,isEmpty:0===i,error:e.error}}(await this.urqlClient.query(s,e??{}))}async getWebsites(e){return function(e){const n=S(e.data?.websites?.edges).map((e=>({...e,documents:S(e.documents?.edges)}))),i=e.data?.websites?.totalCount||0;return{websites:n,totalCount:i,isEmpty:0===i,error:e.error}}(await this.urqlClient.query(c,e??{}))}async getTree(e){return function(e){if(!e.data?.tree)return{tree:null,error:e.error};const n=e.data?.tree,i=S(n.nodes?.edges).map((e=>{const n=new Map(e.names?.map((e=>[e.variant,e.content]))),i=new Map(e.nodeDocuments?.map((e=>[e.variant,e.document])));return{id:e.id,fullSlug:e.fullSlug,name:n.get("")??"",names:e.names??[],nameMap:n,document:i.get("")??null,documentMap:i,nodeDocuments:e.nodeDocuments??[],parentId:e.parent?.id??void 0,root:e.root,position:e.position}}));return{tree:{...n,nodes:F(i),flatNodes:i},error:e.error}}(await this.urqlClient.query(r,e??{}))}async getTreeNodeDocument(e){return function(e){if(!e.data?.tree?.node?.nodeDocument?.document)return{document:null,error:e.error};const n=e.data?.tree.node?.nodeDocument?.document;return{document:{...n,tags:S(n.tags?.edges),assets:S(n.assets?.edges),outboundLinkDocuments:S(n.outboundLinkDocuments?.edges).map((e=>({...e,tags:S(e.tags?.edges)}))),inboundLinkDocuments:S(n.inboundLinkDocuments?.edges).map((e=>({...e,tags:S(e.tags?.edges)}))),websites:S(n.websites?.edges)},error:e.error}}(await this.urqlClient.query(u,e))}createUrqlClient(){return(0,l.createClient)({url:this.url,exchanges:[l.cacheExchange,l.fetchExchange],fetchOptions:{headers:{Authorization:`bearer ${this.accessKey}`},cache:"no-store"}})}};
|
package/dist/client/client.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Client as m}from"../chunk-
|
|
1
|
+
import{Client as m}from"../chunk-BKN3BXOH.mjs";import"../chunk-FHELDISY.mjs";import"../chunk-S2VIMZSH.mjs";import"../chunk-FRXB4F4I.mjs";import"../chunk-FWYDDQQO.mjs";import"../chunk-NQSHEVF2.mjs";import"../chunk-YFUDDF4U.mjs";import"../chunk-TQWLKI7M.mjs";import"../chunk-FJFYJPPP.mjs";import"../chunk-VKWT2GNZ.mjs";import"../chunk-PUTNZ4GU.mjs";import"../chunk-C3G2CMRR.mjs";import"../chunk-PA32N4A6.mjs";import"../chunk-RRJUH3D4.mjs";import"../chunk-FIFBNWMD.mjs";import"../chunk-U527I2CX.mjs";import"../chunk-XL6FY5JJ.mjs";export{m as Client};
|