@great-detail/support-sdk 0.0.4 → 0.0.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-BFO7RVLV.js +1 -0
- package/dist/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +163 -26
- package/dist/index.d.ts +163 -26
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/Client/index.ts +8 -0
- package/src/Contact/GetContact.ts +51 -0
- package/src/Label/GetLabel.ts +50 -0
- package/src/Model/GetModel.ts +50 -0
- package/src/Source/GetSource.ts +50 -0
- package/src/cli/contacts.ts +14 -0
- package/src/cli/labels.ts +14 -0
- package/src/cli/models.ts +14 -0
- package/src/cli/sources.ts +14 -0
- package/dist/chunk-WCSPJBPY.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var k="https://api.support.greatdetail.com",J={"X-Powered-By":"GDSupport/JavaScript"},K="api-key";var _=class{async filter(e){return e}};var o=class{constructor(e){this._client=e}async send({request:e={},...s}={}){return this._client.send("/v1/actions",{...e,method:"GET"},s).then(n=>new E(n))}},E=class{constructor(e){this.response=e}async result(){return this.response.json()}};var i=class{constructor(e){this._client=e}async send({request:e={},...s}={}){return this._client.send("/v1/channels",{...e,method:"GET"},s).then(n=>new q(n))}},q=class{constructor(e){this.response=e}async result(){return this.response.json()}};var p=class{constructor(e){this._client=e}async send({request:e={},...s}={}){return this._client.send("/v1/contacts",{...e,method:"GET"},s).then(n=>new w(n))}},w=class{constructor(e){this.response=e}async result(){return this.response.json()}};var c=class{constructor(e){this._client=e}async send({id:e,request:s={},...n}){return this._client.send("/v1/conversations/"+encodeURIComponent(e),{...s,method:"GET"},n).then(r=>new T(r))}},T=class{constructor(e){this.response=e}async result(){return this.response.json()}};var a=class{constructor(e){this._client=e}async send({request:e={},...s}={}){return this._client.send("/v1/conversations",{...e,method:"GET"},s).then(n=>new I(n))}},I=class{constructor(e){this.response=e}async result(){return this.response.json()}};import{z as l}from"zod";var d=class t{constructor(e){this._client=e}static SCHEMA=l.object({title:l.string(),description:l.optional(l.string()),account:l.string()});async send({body:e,request:s={},...n}){return this._client.send("/v1/labels",{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(t.SCHEMA.parse(e))},n).then(r=>new L(r))}},L=class{constructor(e){this.response=e}async result(){return this.response.json()}};var u=class{constructor(e){this._client=e}async send({request:e={},...s}={}){return this._client.send("/v1/labels",{...e,method:"GET"},s).then(n=>new v(n))}},v=class{constructor(e){this.response=e}async result(){return this.response.json()}};var m=class{constructor(e){this._client=e}async send({request:e={},...s}={}){return this._client.send("/v1/messages",{...e,method:"GET"},s).then(n=>new U(n))}},U=class{constructor(e){this.response=e}async result(){return this.response.json()}};import{z as C}from"zod";var g=class t{constructor(e){this._client=e}static SCHEMA=C.object({input:C.string().max(65536),original:C.string().max(65536),correction:C.string().max(65536)});async send({id:e,body:s,request:n={},...r}){return this._client.send("/v1/models/"+encodeURIComponent(e)+"/correction",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},body:JSON.stringify(t.SCHEMA.parse(s))},r).then(P=>new j(P))}},j=class{constructor(e){this.response=e}async result(){return this.response.json()}};var h=class{constructor(e){this._client=e}async send({request:e={},...s}={}){return this._client.send("/v1/models",{...e,method:"GET"},s).then(n=>new D(n))}},D=class{constructor(e){this.response=e}async result(){return this.response.json()}};import{z as A}from"zod";var b=class t{constructor(e){this._client=e}static SCHEMA=A.array(A.object({role:A.enum(["user","assistant"]),content:A.string().max(65536).nullable()})).min(1);async send({id:e,body:s,request:n={},...r}){return this._client.send("/v1/models/"+encodeURIComponent(e)+"/response",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},body:JSON.stringify(t.SCHEMA.parse(s))},r).then(P=>new G(P))}},G=class{constructor(e){this.response=e}async result(){return this.response.json()}};var y=class{constructor(e){this._client=e}async send({request:e={},...s}={}){return this._client.send("/v1/sources",{...e,method:"GET"},s).then(n=>new H(n))}},H=class{constructor(e){this.response=e}async result(){return this.response.json()}};var f=class{constructor(e){this._client=e}async send({id:e,request:s={},...n}){return this._client.send("/v1/contacts/"+encodeURIComponent(e),{...s,method:"GET"},n).then(r=>new M(r))}},M=class{constructor(e){this.response=e}async result(){return this.response.json()}};var R=class{constructor(e){this._client=e}async send({id:e,request:s={},...n}){return this._client.send("/v1/labels/"+encodeURIComponent(e),{...s,method:"GET"},n).then(r=>new F(r))}},F=class{constructor(e){this.response=e}async result(){return this.response.json()}};var x=class{constructor(e){this._client=e}async send({id:e,request:s={},...n}){return this._client.send("/v1/models/"+encodeURIComponent(e),{...s,method:"GET"},n).then(r=>new N(r))}},N=class{constructor(e){this.response=e}async result(){return this.response.json()}};var O=class t{constructor(e=t.STANDARD_HEADERS){this._standardHeaders=e}static STANDARD_HEADERS=J;async filter(e){return{...e,headers:{...e.headers,...this._standardHeaders}}}};var S=class{constructor(e){this._client=e}async send({id:e,request:s={},...n}){return this._client.send("/v1/sources/"+encodeURIComponent(e),{...s,method:"GET"},n).then(r=>new z(r))}},z=class{constructor(e){this.response=e}async result(){return this.response.json()}};var B=class t{static DEFAULT_BASE_URL=k;options;constructor(e,s={}){this.options={requestFilterables:[new O,e],baseURL:process.env.SUPPORT_BASE_URL??t.DEFAULT_BASE_URL,...s}}action={list:new o(this)};channel={list:new i(this)};contact={get:new f(this),list:new p(this)};conversation={get:new c(this),list:new a(this)};label={create:new d(this),get:new R(this),list:new u(this)};message={list:new m(this)};model={get:new x(this),list:new h(this),response:{create:new b(this)},correction:{create:new g(this)}};source={get:new S(this),list:new y(this)};async _filterRequest(e){for(let s of this.options.requestFilterables)e=await s.filter(e);return e}async send(e,s,{fetch:n=fetch}={}){return await n(new Request(new URL(e,this.options.baseURL),await this._filterRequest(s)))}};export{k as a,K as b,_ as c,B as d};
|
package/dist/cli.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var ct=require("commander");var a=class{async filter(t){return t}};var p=class{constructor(t){this._client=t}async send({request:t={},...e}={}){return this._client.send("/v1/actions",{...t,method:"GET"},e).then(s=>new P(s))}},P=class{constructor(t){this.response=t}async result(){return this.response.json()}};var c=class{constructor(t){this._client=t}async send({request:t={},...e}={}){return this._client.send("/v1/channels",{...t,method:"GET"},e).then(s=>new _(s))}},_=class{constructor(t){this.response=t}async result(){return this.response.json()}};var tt="https://api.support.greatdetail.com",et={"X-Powered-By":"GDSupport/JavaScript"};var d=class{constructor(t){this._client=t}async send({request:t={},...e}={}){return this._client.send("/v1/contacts",{...t,method:"GET"},e).then(s=>new E(s))}},E=class{constructor(t){this.response=t}async result(){return this.response.json()}};var l=class{constructor(t){this._client=t}async send({id:t,request:e={},...s}){return this._client.send("/v1/conversations/"+encodeURIComponent(t),{...e,method:"GET"},s).then(o=>new v(o))}},v=class{constructor(t){this.response=t}async result(){return this.response.json()}};var m=class{constructor(t){this._client=t}async send({request:t={},...e}={}){return this._client.send("/v1/conversations",{...t,method:"GET"},e).then(s=>new q(s))}},q=class{constructor(t){this.response=t}async result(){return this.response.json()}};var r=require("zod"),u=class n{constructor(t){this._client=t}static SCHEMA=r.z.object({title:r.z.string(),description:r.z.optional(r.z.string()),account:r.z.string()});async send({body:t,request:e={},...s}){return this._client.send("/v1/labels",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},body:JSON.stringify(n.SCHEMA.parse(t))},s).then(o=>new L(o))}},L=class{constructor(t){this.response=t}async result(){return this.response.json()}};var f=class{constructor(t){this._client=t}async send({request:t={},...e}={}){return this._client.send("/v1/labels",{...t,method:"GET"},e).then(s=>new T(s))}},T=class{constructor(t){this.response=t}async result(){return this.response.json()}};var g=class{constructor(t){this._client=t}async send({request:t={},...e}={}){return this._client.send("/v1/messages",{...t,method:"GET"},e).then(s=>new j(s))}},j=class{constructor(t){this.response=t}async result(){return this.response.json()}};var x=require("zod"),O=class n{constructor(t){this._client=t}static SCHEMA=x.z.object({input:x.z.string().max(65536),original:x.z.string().max(65536),correction:x.z.string().max(65536)});async send({id:t,body:e,request:s={},...o}){return this._client.send("/v1/models/"+encodeURIComponent(t)+"/correction",{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(n.SCHEMA.parse(e))},o).then(A=>new I(A))}},I=class{constructor(t){this.response=t}async result(){return this.response.json()}};var C=class{constructor(t){this._client=t}async send({request:t={},...e}={}){return this._client.send("/v1/models",{...t,method:"GET"},e).then(s=>new D(s))}},D=class{constructor(t){this.response=t}async result(){return this.response.json()}};var y=require("zod"),h=class n{constructor(t){this._client=t}static SCHEMA=y.z.array(y.z.object({role:y.z.enum(["user","assistant"]),content:y.z.string().max(65536).nullable()})).min(1);async send({id:t,body:e,request:s={},...o}){return this._client.send("/v1/models/"+encodeURIComponent(t)+"/response",{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(n.SCHEMA.parse(e))},o).then(A=>new U(A))}},U=class{constructor(t){this.response=t}async result(){return this.response.json()}};var b=class n{constructor(t=n.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=et;async filter(t){return{...t,headers:{...t.headers,...this._standardHeaders}}}};var R=class{constructor(t){this._client=t}async send({request:t={},...e}={}){return this._client.send("/v1/sources",{...t,method:"GET"},e).then(s=>new F(s))}},F=class{constructor(t){this.response=t}async result(){return this.response.json()}};var w=class n{static DEFAULT_BASE_URL=tt;options;constructor(t,e={}){this.options={requestFilterables:[new b,t],baseURL:process.env.SUPPORT_BASE_URL??n.DEFAULT_BASE_URL,...e}}action={list:new p(this)};channel={list:new c(this)};contact={list:new d(this)};conversation={get:new l(this),list:new m(this)};label={create:new u(this),list:new f(this)};message={list:new g(this)};model={list:new C(this),response:{create:new h(this)},correction:{create:new O(this)}};source={list:new R(this)};async _filterRequest(t){for(let e of this.options.requestFilterables)t=await e.filter(t);return t}async send(t,e,{fetch:s=fetch}={}){return await s(new Request(new URL(t,this.options.baseURL),await this._filterRequest(e)))}};var H=require("commander"),nt=require("ora");function M({client:n,ora:t}){let e=new H.Command("actions").description("Actions");return e.addCommand(new H.Command("list").description("List actions").action(async()=>{let s=await(0,nt.oraPromise)(()=>n.action.list.send(),{...t,text:"Finding actions"});console.log(await s.result())})),e}var G=require("commander"),st=require("ora");function N({client:n,ora:t}){let e=new G.Command("channels").description("Channels");return e.addCommand(new G.Command("list").description("List channels").action(async()=>{let s=await(0,st.oraPromise)(()=>n.channel.list.send(),{...t,text:"Finding channels"});console.log(await s.result())})),e}var z=require("commander"),ot=require("ora");function B({client:n,ora:t}){let e=new z.Command("contacts").description("Contacts");return e.addCommand(new z.Command("list").description("List contacts").action(async()=>{let s=await(0,ot.oraPromise)(()=>n.contact.list.send(),{...t,text:"Finding contacts"});console.log(await s.result())})),e}var S=require("commander"),k=require("ora");function J({client:n,ora:t}){let e=new S.Command("conversations").description("Conversations");return e.addCommand(new S.Command("get").description("Find conversation").argument("<conversation>","Conversation ID").action(async s=>{let o=await(0,k.oraPromise)(()=>n.conversation.get.send({id:s}),{...t,text:"Finding conversation"});console.log(await o.result())})),e.addCommand(new S.Command("list").description("List conversations").action(async()=>{let s=await(0,k.oraPromise)(()=>n.conversation.list.send(),{...t,text:"Finding conversations"});console.log(await s.result())})),e}var K=require("commander"),it=require("ora");function X({client:n,ora:t}){let e=new K.Command("labels").description("Labels");return e.addCommand(new K.Command("list").description("List labels").action(async()=>{let s=await(0,it.oraPromise)(()=>n.label.list.send(),{...t,text:"Finding labels"});console.log(await s.result())})),e}var Y=require("commander"),rt=require("ora");function Q({client:n,ora:t}){let e=new Y.Command("messages").description("Messages");return e.addCommand(new Y.Command("list").description("List messages").action(async()=>{let s=await(0,rt.oraPromise)(()=>n.message.list.send(),{...t,text:"Finding messages"});console.log(await s.result())})),e}var V=require("commander"),at=require("ora");function W({client:n,ora:t}){let e=new V.Command("models").description("Models");return e.addCommand(new V.Command("list").description("List models").action(async()=>{let s=await(0,at.oraPromise)(()=>n.model.list.send(),{...t,text:"Finding models"});console.log(await s.result())})),e}var Z=require("commander"),pt=require("ora");function $({client:n,ora:t}){let e=new Z.Command("sources").description("Sources");return e.addCommand(new Z.Command("list").description("List sources").action(async()=>{let s=await(0,pt.oraPromise)(()=>n.source.list.send(),{...t,text:"Finding sources"});console.log(await s.result())})),e}var i={ora:{spinner:"simpleDotsScrolling"},client:new w(new a)},lt=new ct.Command("gds").description("Great Detail Support System").addCommand(M(i)).addCommand(N(i)).addCommand(B(i)).addCommand(J(i)).addCommand(X(i)).addCommand(Q(i)).addCommand(W(i)).addCommand($(i)),dt=lt;dt.parseAsync(process.argv);
|
|
2
|
+
"use strict";var yt=require("commander");var a=class{async filter(t){return t}};var c=class{constructor(t){this._client=t}async send({request:t={},...e}={}){return this._client.send("/v1/actions",{...t,method:"GET"},e).then(n=>new j(n))}},j=class{constructor(t){this.response=t}async result(){return this.response.json()}};var p=class{constructor(t){this._client=t}async send({request:t={},...e}={}){return this._client.send("/v1/channels",{...t,method:"GET"},e).then(n=>new F(n))}},F=class{constructor(t){this.response=t}async result(){return this.response.json()}};var mt="https://api.support.greatdetail.com",ut={"X-Powered-By":"GDSupport/JavaScript"};var d=class{constructor(t){this._client=t}async send({id:t,request:e={},...n}){return this._client.send("/v1/contacts/"+encodeURIComponent(t),{...e,method:"GET"},n).then(o=>new D(o))}},D=class{constructor(t){this.response=t}async result(){return this.response.json()}};var l=class{constructor(t){this._client=t}async send({request:t={},...e}={}){return this._client.send("/v1/contacts",{...t,method:"GET"},e).then(n=>new U(n))}},U=class{constructor(t){this.response=t}async result(){return this.response.json()}};var m=class{constructor(t){this._client=t}async send({id:t,request:e={},...n}){return this._client.send("/v1/conversations/"+encodeURIComponent(t),{...e,method:"GET"},n).then(o=>new G(o))}},G=class{constructor(t){this.response=t}async result(){return this.response.json()}};var u=class{constructor(t){this._client=t}async send({request:t={},...e}={}){return this._client.send("/v1/conversations",{...t,method:"GET"},e).then(n=>new H(n))}},H=class{constructor(t){this.response=t}async result(){return this.response.json()}};var r=require("zod"),g=class s{constructor(t){this._client=t}static SCHEMA=r.z.object({title:r.z.string(),description:r.z.optional(r.z.string()),account:r.z.string()});async send({body:t,request:e={},...n}){return this._client.send("/v1/labels",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},body:JSON.stringify(s.SCHEMA.parse(t))},n).then(o=>new M(o))}},M=class{constructor(t){this.response=t}async result(){return this.response.json()}};var f=class{constructor(t){this._client=t}async send({id:t,request:e={},...n}){return this._client.send("/v1/labels/"+encodeURIComponent(t),{...e,method:"GET"},n).then(o=>new N(o))}},N=class{constructor(t){this.response=t}async result(){return this.response.json()}};var x=class{constructor(t){this._client=t}async send({request:t={},...e}={}){return this._client.send("/v1/labels",{...t,method:"GET"},e).then(n=>new z(n))}},z=class{constructor(t){this.response=t}async result(){return this.response.json()}};var y=class{constructor(t){this._client=t}async send({request:t={},...e}={}){return this._client.send("/v1/messages",{...t,method:"GET"},e).then(n=>new B(n))}},B=class{constructor(t){this.response=t}async result(){return this.response.json()}};var O=require("zod"),C=class s{constructor(t){this._client=t}static SCHEMA=O.z.object({input:O.z.string().max(65536),original:O.z.string().max(65536),correction:O.z.string().max(65536)});async send({id:t,body:e,request:n={},...o}){return this._client.send("/v1/models/"+encodeURIComponent(t)+"/correction",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},body:JSON.stringify(s.SCHEMA.parse(e))},o).then(T=>new k(T))}},k=class{constructor(t){this.response=t}async result(){return this.response.json()}};var h=class{constructor(t){this._client=t}async send({id:t,request:e={},...n}){return this._client.send("/v1/models/"+encodeURIComponent(t),{...e,method:"GET"},n).then(o=>new J(o))}},J=class{constructor(t){this.response=t}async result(){return this.response.json()}};var b=class{constructor(t){this._client=t}async send({request:t={},...e}={}){return this._client.send("/v1/models",{...t,method:"GET"},e).then(n=>new K(n))}},K=class{constructor(t){this.response=t}async result(){return this.response.json()}};var R=require("zod"),w=class s{constructor(t){this._client=t}static SCHEMA=R.z.array(R.z.object({role:R.z.enum(["user","assistant"]),content:R.z.string().max(65536).nullable()})).min(1);async send({id:t,body:e,request:n={},...o}){return this._client.send("/v1/models/"+encodeURIComponent(t)+"/response",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},body:JSON.stringify(s.SCHEMA.parse(e))},o).then(T=>new X(T))}},X=class{constructor(t){this.response=t}async result(){return this.response.json()}};var S=class s{constructor(t=s.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=ut;async filter(t){return{...t,headers:{...t.headers,...this._standardHeaders}}}};var P=class{constructor(t){this._client=t}async send({id:t,request:e={},...n}){return this._client.send("/v1/sources/"+encodeURIComponent(t),{...e,method:"GET"},n).then(o=>new Y(o))}},Y=class{constructor(t){this.response=t}async result(){return this.response.json()}};var A=class{constructor(t){this._client=t}async send({request:t={},...e}={}){return this._client.send("/v1/sources",{...t,method:"GET"},e).then(n=>new Q(n))}},Q=class{constructor(t){this.response=t}async result(){return this.response.json()}};var _=class s{static DEFAULT_BASE_URL=mt;options;constructor(t,e={}){this.options={requestFilterables:[new S,t],baseURL:process.env.SUPPORT_BASE_URL??s.DEFAULT_BASE_URL,...e}}action={list:new c(this)};channel={list:new p(this)};contact={get:new d(this),list:new l(this)};conversation={get:new m(this),list:new u(this)};label={create:new g(this),get:new f(this),list:new x(this)};message={list:new y(this)};model={get:new h(this),list:new b(this),response:{create:new w(this)},correction:{create:new C(this)}};source={get:new P(this),list:new A(this)};async _filterRequest(t){for(let e of this.options.requestFilterables)t=await e.filter(t);return t}async send(t,e,{fetch:n=fetch}={}){return await n(new Request(new URL(t,this.options.baseURL),await this._filterRequest(e)))}};var V=require("commander"),gt=require("ora");function W({client:s,ora:t}){let e=new V.Command("actions").description("Actions");return e.addCommand(new V.Command("list").description("List actions").action(async()=>{let n=await(0,gt.oraPromise)(()=>s.action.list.send(),{...t,text:"Finding actions"});console.log(await n.result())})),e}var Z=require("commander"),ft=require("ora");function $({client:s,ora:t}){let e=new Z.Command("channels").description("Channels");return e.addCommand(new Z.Command("list").description("List channels").action(async()=>{let n=await(0,ft.oraPromise)(()=>s.channel.list.send(),{...t,text:"Finding channels"});console.log(await n.result())})),e}var E=require("commander"),tt=require("ora");function et({client:s,ora:t}){let e=new E.Command("contacts").description("Contacts");return e.addCommand(new E.Command("get").description("Find contact").argument("<contact>","Contact ID").action(async n=>{let o=await(0,tt.oraPromise)(()=>s.contact.get.send({id:n}),{...t,text:"Finding contact"});console.log(await o.result())})),e.addCommand(new E.Command("list").description("List contacts").action(async()=>{let n=await(0,tt.oraPromise)(()=>s.contact.list.send(),{...t,text:"Finding contacts"});console.log(await n.result())})),e}var q=require("commander"),nt=require("ora");function st({client:s,ora:t}){let e=new q.Command("conversations").description("Conversations");return e.addCommand(new q.Command("get").description("Find conversation").argument("<conversation>","Conversation ID").action(async n=>{let o=await(0,nt.oraPromise)(()=>s.conversation.get.send({id:n}),{...t,text:"Finding conversation"});console.log(await o.result())})),e.addCommand(new q.Command("list").description("List conversations").action(async()=>{let n=await(0,nt.oraPromise)(()=>s.conversation.list.send(),{...t,text:"Finding conversations"});console.log(await n.result())})),e}var v=require("commander"),ot=require("ora");function it({client:s,ora:t}){let e=new v.Command("labels").description("Labels");return e.addCommand(new v.Command("get").description("Find label").argument("<label>","Label ID").action(async n=>{let o=await(0,ot.oraPromise)(()=>s.label.get.send({id:n}),{...t,text:"Finding label"});console.log(await o.result())})),e.addCommand(new v.Command("list").description("List labels").action(async()=>{let n=await(0,ot.oraPromise)(()=>s.label.list.send(),{...t,text:"Finding labels"});console.log(await n.result())})),e}var rt=require("commander"),xt=require("ora");function at({client:s,ora:t}){let e=new rt.Command("messages").description("Messages");return e.addCommand(new rt.Command("list").description("List messages").action(async()=>{let n=await(0,xt.oraPromise)(()=>s.message.list.send(),{...t,text:"Finding messages"});console.log(await n.result())})),e}var I=require("commander"),ct=require("ora");function pt({client:s,ora:t}){let e=new I.Command("models").description("Models");return e.addCommand(new I.Command("get").description("Find model").argument("<model>","Model ID").action(async n=>{let o=await(0,ct.oraPromise)(()=>s.model.get.send({id:n}),{...t,text:"Finding model"});console.log(await o.result())})),e.addCommand(new I.Command("list").description("List models").action(async()=>{let n=await(0,ct.oraPromise)(()=>s.model.list.send(),{...t,text:"Finding models"});console.log(await n.result())})),e}var L=require("commander"),dt=require("ora");function lt({client:s,ora:t}){let e=new L.Command("sources").description("Sources");return e.addCommand(new L.Command("get").description("Find source").argument("<source>","Source ID").action(async n=>{let o=await(0,dt.oraPromise)(()=>s.source.get.send({id:n}),{...t,text:"Finding source"});console.log(await o.result())})),e.addCommand(new L.Command("list").description("List sources").action(async()=>{let n=await(0,dt.oraPromise)(()=>s.source.list.send(),{...t,text:"Finding sources"});console.log(await n.result())})),e}var i={ora:{spinner:"simpleDotsScrolling"},client:new _(new a)},Ct=new yt.Command("gds").description("Great Detail Support System").addCommand(W(i)).addCommand($(i)).addCommand(et(i)).addCommand(st(i)).addCommand(it(i)).addCommand(at(i)).addCommand(pt(i)).addCommand(lt(i)),Ot=Ct;Ot.parseAsync(process.argv);
|
package/dist/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{c as
|
|
2
|
+
import{c as O,d as y}from"./chunk-BFO7RVLV.js";import{Command as G}from"commander";import{Command as F}from"commander";import{oraPromise as S}from"ora";function a({client:n,ora:s}){let o=new F("actions").description("Actions");return o.addCommand(new F("list").description("List actions").action(async()=>{let t=await S(()=>n.action.list.send(),{...s,text:"Finding actions"});console.log(await t.result())})),o}import{Command as b}from"commander";import{oraPromise as A}from"ora";function r({client:n,ora:s}){let o=new b("channels").description("Channels");return o.addCommand(new b("list").description("List channels").action(async()=>{let t=await A(()=>n.channel.list.send(),{...s,text:"Finding channels"});console.log(await t.result())})),o}import{Command as m}from"commander";import{oraPromise as v}from"ora";function d({client:n,ora:s}){let o=new m("contacts").description("Contacts");return o.addCommand(new m("get").description("Find contact").argument("<contact>","Contact ID").action(async t=>{let e=await v(()=>n.contact.get.send({id:t}),{...s,text:"Finding contact"});console.log(await e.result())})),o.addCommand(new m("list").description("List contacts").action(async()=>{let t=await v(()=>n.contact.list.send(),{...s,text:"Finding contacts"});console.log(await t.result())})),o}import{Command as c}from"commander";import{oraPromise as L}from"ora";function p({client:n,ora:s}){let o=new c("conversations").description("Conversations");return o.addCommand(new c("get").description("Find conversation").argument("<conversation>","Conversation ID").action(async t=>{let e=await L(()=>n.conversation.get.send({id:t}),{...s,text:"Finding conversation"});console.log(await e.result())})),o.addCommand(new c("list").description("List conversations").action(async()=>{let t=await L(()=>n.conversation.list.send(),{...s,text:"Finding conversations"});console.log(await t.result())})),o}import{Command as l}from"commander";import{oraPromise as P}from"ora";function u({client:n,ora:s}){let o=new l("labels").description("Labels");return o.addCommand(new l("get").description("Find label").argument("<label>","Label ID").action(async t=>{let e=await P(()=>n.label.get.send({id:t}),{...s,text:"Finding label"});console.log(await e.result())})),o.addCommand(new l("list").description("List labels").action(async()=>{let t=await P(()=>n.label.list.send(),{...s,text:"Finding labels"});console.log(await t.result())})),o}import{Command as h}from"commander";import{oraPromise as M}from"ora";function f({client:n,ora:s}){let o=new h("messages").description("Messages");return o.addCommand(new h("list").description("List messages").action(async()=>{let t=await M(()=>n.message.list.send(),{...s,text:"Finding messages"});console.log(await t.result())})),o}import{Command as C}from"commander";import{oraPromise as j}from"ora";function g({client:n,ora:s}){let o=new C("models").description("Models");return o.addCommand(new C("get").description("Find model").argument("<model>","Model ID").action(async t=>{let e=await j(()=>n.model.get.send({id:t}),{...s,text:"Finding model"});console.log(await e.result())})),o.addCommand(new C("list").description("List models").action(async()=>{let t=await j(()=>n.model.list.send(),{...s,text:"Finding models"});console.log(await t.result())})),o}import{Command as w}from"commander";import{oraPromise as D}from"ora";function x({client:n,ora:s}){let o=new w("sources").description("Sources");return o.addCommand(new w("get").description("Find source").argument("<source>","Source ID").action(async t=>{let e=await D(()=>n.source.get.send({id:t}),{...s,text:"Finding source"});console.log(await e.result())})),o.addCommand(new w("list").description("List sources").action(async()=>{let t=await D(()=>n.source.list.send(),{...s,text:"Finding sources"});console.log(await t.result())})),o}var i={ora:{spinner:"simpleDotsScrolling"},client:new y(new O)},k=new G("gds").description("Great Detail Support System").addCommand(a(i)).addCommand(r(i)).addCommand(d(i)).addCommand(p(i)).addCommand(u(i)).addCommand(f(i)).addCommand(g(i)).addCommand(x(i)),I=k;I.parseAsync(process.argv);
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var L=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var W=Object.prototype.hasOwnProperty;var Z=(t,e)=>{for(var s in e)L(t,s,{get:e[s],enumerable:!0})},ee=(t,e,s,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of V(e))!W.call(t,o)&&o!==s&&L(t,o,{get:()=>e[o],enumerable:!(n=Q(e,o))||n.enumerable});return t};var te=t=>ee(L({},"__esModule",{value:!0}),t);var se={};Z(se,{Client:()=>i,DEFAULT_SUPPORT_BASE_URL:()=>T,KeyAuthentication:()=>p,PublicAuthentication:()=>c,TokenAuthentication:()=>a,default:()=>i});module.exports=te(se);var T="https://api.support.greatdetail.com",$={"X-Powered-By":"GDSupport/JavaScript"},X="api-key";var p=class t{static DEFAULT_NAME=X;name;#e;constructor({name:e=process.env.SUPPORT_KEY_NAME??t.DEFAULT_NAME,key:s=process.env.SUPPORT_API_KEY}={}){if(!s)throw new Error("API Key option must be specified when using Key Authentication");this.name=e,this.#e=s}async filter(e){return{...e,headers:{...e.headers,Authorization:`Basic ${btoa(this.name+":"+this.#e)}`}}}};var a=class{#e;constructor({token:e=process.env.SUPPORT_ACCESS_TOKEN}={}){if(!e)throw new Error("Access Token option must be specified when using Token Authentication");this.#e=e}async filter(e){return{...e,headers:{...e.headers,Authorization:`Bearer ${this.#e}`}}}};var c=class{async filter(e){return e}};var l=class{constructor(e){this._client=e}async send({request:e={},...s}={}){return this._client.send("/v1/actions",{...e,method:"GET"},s).then(n=>new I(n))}},I=class{constructor(e){this.response=e}async result(){return this.response.json()}};var d=class{constructor(e){this._client=e}async send({request:e={},...s}={}){return this._client.send("/v1/channels",{...e,method:"GET"},s).then(n=>new U(n))}},U=class{constructor(e){this.response=e}async result(){return this.response.json()}};var u=class{constructor(e){this._client=e}async send({id:e,request:s={},...n}){return this._client.send("/v1/contacts/"+encodeURIComponent(e),{...s,method:"GET"},n).then(o=>new v(o))}},v=class{constructor(e){this.response=e}async result(){return this.response.json()}};var m=class{constructor(e){this._client=e}async send({request:e={},...s}={}){return this._client.send("/v1/contacts",{...e,method:"GET"},s).then(n=>new D(n))}},D=class{constructor(e){this.response=e}async result(){return this.response.json()}};var f=class{constructor(e){this._client=e}async send({id:e,request:s={},...n}){return this._client.send("/v1/conversations/"+encodeURIComponent(e),{...s,method:"GET"},n).then(o=>new j(o))}},j=class{constructor(e){this.response=e}async result(){return this.response.json()}};var h=class{constructor(e){this._client=e}async send({request:e={},...s}={}){return this._client.send("/v1/conversations",{...e,method:"GET"},s).then(n=>new G(n))}},G=class{constructor(e){this.response=e}async result(){return this.response.json()}};var r=require("zod"),y=class t{constructor(e){this._client=e}static SCHEMA=r.z.object({title:r.z.string(),description:r.z.optional(r.z.string()),account:r.z.string()});async send({body:e,request:s={},...n}){return this._client.send("/v1/labels",{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(t.SCHEMA.parse(e))},n).then(o=>new M(o))}},M=class{constructor(e){this.response=e}async result(){return this.response.json()}};var g=class{constructor(e){this._client=e}async send({id:e,request:s={},...n}){return this._client.send("/v1/labels/"+encodeURIComponent(e),{...s,method:"GET"},n).then(o=>new N(o))}},N=class{constructor(e){this.response=e}async result(){return this.response.json()}};var b=class{constructor(e){this._client=e}async send({request:e={},...s}={}){return this._client.send("/v1/labels",{...e,method:"GET"},s).then(n=>new F(n))}},F=class{constructor(e){this.response=e}async result(){return this.response.json()}};var R=class{constructor(e){this._client=e}async send({request:e={},...s}={}){return this._client.send("/v1/messages",{...e,method:"GET"},s).then(n=>new H(n))}},H=class{constructor(e){this.response=e}async result(){return this.response.json()}};var x=require("zod"),O=class t{constructor(e){this._client=e}static SCHEMA=x.z.object({input:x.z.string().max(65536),original:x.z.string().max(65536),correction:x.z.string().max(65536)});async send({id:e,body:s,request:n={},...o}){return this._client.send("/v1/models/"+encodeURIComponent(e)+"/correction",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},body:JSON.stringify(t.SCHEMA.parse(s))},o).then(q=>new B(q))}},B=class{constructor(e){this.response=e}async result(){return this.response.json()}};var A=class{constructor(e){this._client=e}async send({id:e,request:s={},...n}){return this._client.send("/v1/models/"+encodeURIComponent(e),{...s,method:"GET"},n).then(o=>new k(o))}},k=class{constructor(e){this.response=e}async result(){return this.response.json()}};var C=class{constructor(e){this._client=e}async send({request:e={},...s}={}){return this._client.send("/v1/models",{...e,method:"GET"},s).then(n=>new z(n))}},z=class{constructor(e){this.response=e}async result(){return this.response.json()}};var P=require("zod"),S=class t{constructor(e){this._client=e}static SCHEMA=P.z.array(P.z.object({role:P.z.enum(["user","assistant"]),content:P.z.string().max(65536).nullable()})).min(1);async send({id:e,body:s,request:n={},...o}){return this._client.send("/v1/models/"+encodeURIComponent(e)+"/response",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},body:JSON.stringify(t.SCHEMA.parse(s))},o).then(q=>new K(q))}},K=class{constructor(e){this.response=e}async result(){return this.response.json()}};var _=class t{constructor(e=t.STANDARD_HEADERS){this._standardHeaders=e}static STANDARD_HEADERS=$;async filter(e){return{...e,headers:{...e.headers,...this._standardHeaders}}}};var E=class{constructor(e){this._client=e}async send({id:e,request:s={},...n}){return this._client.send("/v1/sources/"+encodeURIComponent(e),{...s,method:"GET"},n).then(o=>new J(o))}},J=class{constructor(e){this.response=e}async result(){return this.response.json()}};var w=class{constructor(e){this._client=e}async send({request:e={},...s}={}){return this._client.send("/v1/sources",{...e,method:"GET"},s).then(n=>new Y(n))}},Y=class{constructor(e){this.response=e}async result(){return this.response.json()}};var i=class t{static DEFAULT_BASE_URL=T;options;constructor(e,s={}){this.options={requestFilterables:[new _,e],baseURL:process.env.SUPPORT_BASE_URL??t.DEFAULT_BASE_URL,...s}}action={list:new l(this)};channel={list:new d(this)};contact={get:new u(this),list:new m(this)};conversation={get:new f(this),list:new h(this)};label={create:new y(this),get:new g(this),list:new b(this)};message={list:new R(this)};model={get:new A(this),list:new C(this),response:{create:new S(this)},correction:{create:new O(this)}};source={get:new E(this),list:new w(this)};async _filterRequest(e){for(let s of this.options.requestFilterables)e=await s.filter(e);return e}async send(e,s,{fetch:n=fetch}={}){return await n(new Request(new URL(e,this.options.baseURL),await this._filterRequest(s)))}};0&&(module.exports={Client,DEFAULT_SUPPORT_BASE_URL,KeyAuthentication,PublicAuthentication,TokenAuthentication});
|
package/dist/index.d.cts
CHANGED
|
@@ -48,7 +48,7 @@ interface Authentication extends RequestFilterable {
|
|
|
48
48
|
* @see https://greatdetail.com
|
|
49
49
|
*/
|
|
50
50
|
|
|
51
|
-
interface Options$
|
|
51
|
+
interface Options$h {
|
|
52
52
|
name?: string;
|
|
53
53
|
key?: string;
|
|
54
54
|
}
|
|
@@ -56,7 +56,7 @@ declare class KeyAuthentication implements Authentication {
|
|
|
56
56
|
#private;
|
|
57
57
|
static DEFAULT_NAME: string;
|
|
58
58
|
name: string;
|
|
59
|
-
constructor({ name, key, }?: Options$
|
|
59
|
+
constructor({ name, key, }?: Options$h);
|
|
60
60
|
filter(request: RequestInit): Promise<RequestInit>;
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -69,12 +69,12 @@ declare class KeyAuthentication implements Authentication {
|
|
|
69
69
|
* @see https://greatdetail.com
|
|
70
70
|
*/
|
|
71
71
|
|
|
72
|
-
interface Options$
|
|
72
|
+
interface Options$g {
|
|
73
73
|
token?: string;
|
|
74
74
|
}
|
|
75
75
|
declare class TokenAuthentication implements Authentication {
|
|
76
76
|
#private;
|
|
77
|
-
constructor({ token }?: Options$
|
|
77
|
+
constructor({ token }?: Options$g);
|
|
78
78
|
filter(request: RequestInit): Promise<RequestInit>;
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -106,13 +106,13 @@ declare class PublicAuthentication implements Authentication {
|
|
|
106
106
|
* @see https://greatdetail.com
|
|
107
107
|
*/
|
|
108
108
|
|
|
109
|
-
interface Options$
|
|
109
|
+
interface Options$f extends SendOptions {
|
|
110
110
|
request?: RequestInit;
|
|
111
111
|
}
|
|
112
112
|
declare class ListActionsRequest {
|
|
113
113
|
protected _client: Client;
|
|
114
114
|
constructor(_client: Client);
|
|
115
|
-
send({ request, ...options }?: Options$
|
|
115
|
+
send({ request, ...options }?: Options$f): Promise<ListActionsResponse>;
|
|
116
116
|
}
|
|
117
117
|
type ListActionsResponsePayload = {
|
|
118
118
|
actions: {
|
|
@@ -139,13 +139,13 @@ declare class ListActionsResponse {
|
|
|
139
139
|
* @see https://greatdetail.com
|
|
140
140
|
*/
|
|
141
141
|
|
|
142
|
-
interface Options$
|
|
142
|
+
interface Options$e extends SendOptions {
|
|
143
143
|
request?: RequestInit;
|
|
144
144
|
}
|
|
145
145
|
declare class ListChannelsRequest {
|
|
146
146
|
protected _client: Client;
|
|
147
147
|
constructor(_client: Client);
|
|
148
|
-
send({ request, ...options }?: Options$
|
|
148
|
+
send({ request, ...options }?: Options$e): Promise<ListChannelsResponse>;
|
|
149
149
|
}
|
|
150
150
|
type ListChannelsResponsePayload = {
|
|
151
151
|
channels: {
|
|
@@ -172,13 +172,47 @@ declare class ListChannelsResponse {
|
|
|
172
172
|
* @see https://greatdetail.com
|
|
173
173
|
*/
|
|
174
174
|
|
|
175
|
-
interface Options$
|
|
175
|
+
interface Options$d extends SendOptions {
|
|
176
|
+
id: string;
|
|
177
|
+
request?: RequestInit;
|
|
178
|
+
}
|
|
179
|
+
declare class GetContactRequest {
|
|
180
|
+
protected _client: Client;
|
|
181
|
+
constructor(_client: Client);
|
|
182
|
+
send({ id, request, ...options }: Options$d): Promise<GetContactResponse>;
|
|
183
|
+
}
|
|
184
|
+
type GetContactResponsePayload = {
|
|
185
|
+
contact: {
|
|
186
|
+
id: string;
|
|
187
|
+
name?: string;
|
|
188
|
+
emailAddress?: string;
|
|
189
|
+
telephoneNumber?: string;
|
|
190
|
+
createdAt: string;
|
|
191
|
+
updatedAt?: string;
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
declare class GetContactResponse {
|
|
195
|
+
response: Response;
|
|
196
|
+
constructor(response: Response);
|
|
197
|
+
result(): Promise<GetContactResponsePayload>;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Great Detail Support System.
|
|
202
|
+
*
|
|
203
|
+
* @copyright 2024 Great Detail Ltd
|
|
204
|
+
* @author Great Detail Ltd <info@greatdetail.com>
|
|
205
|
+
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
206
|
+
* @see https://greatdetail.com
|
|
207
|
+
*/
|
|
208
|
+
|
|
209
|
+
interface Options$c extends SendOptions {
|
|
176
210
|
request?: RequestInit;
|
|
177
211
|
}
|
|
178
212
|
declare class ListContactsRequest {
|
|
179
213
|
protected _client: Client;
|
|
180
214
|
constructor(_client: Client);
|
|
181
|
-
send({ request, ...options }?: Options$
|
|
215
|
+
send({ request, ...options }?: Options$c): Promise<ListContactsResponse>;
|
|
182
216
|
}
|
|
183
217
|
type ListContactsResponsePayload = {
|
|
184
218
|
contacts: {
|
|
@@ -205,14 +239,14 @@ declare class ListContactsResponse {
|
|
|
205
239
|
* @see https://greatdetail.com
|
|
206
240
|
*/
|
|
207
241
|
|
|
208
|
-
interface Options$
|
|
242
|
+
interface Options$b extends SendOptions {
|
|
209
243
|
id: string;
|
|
210
244
|
request?: RequestInit;
|
|
211
245
|
}
|
|
212
246
|
declare class GetConversationRequest {
|
|
213
247
|
protected _client: Client;
|
|
214
248
|
constructor(_client: Client);
|
|
215
|
-
send({ id, request, ...options }: Options$
|
|
249
|
+
send({ id, request, ...options }: Options$b): Promise<GetConversationResponse>;
|
|
216
250
|
}
|
|
217
251
|
type GetConversationResponsePayload = {
|
|
218
252
|
conversation: {
|
|
@@ -238,13 +272,13 @@ declare class GetConversationResponse {
|
|
|
238
272
|
* @see https://greatdetail.com
|
|
239
273
|
*/
|
|
240
274
|
|
|
241
|
-
interface Options$
|
|
275
|
+
interface Options$a extends SendOptions {
|
|
242
276
|
request?: RequestInit;
|
|
243
277
|
}
|
|
244
278
|
declare class ListConversationsRequest {
|
|
245
279
|
protected _client: Client;
|
|
246
280
|
constructor(_client: Client);
|
|
247
|
-
send({ request, ...options }?: Options$
|
|
281
|
+
send({ request, ...options }?: Options$a): Promise<ListConversationsResponse>;
|
|
248
282
|
}
|
|
249
283
|
type ListConversationsResponsePayload = {
|
|
250
284
|
conversations: {
|
|
@@ -270,7 +304,7 @@ declare class ListConversationsResponse {
|
|
|
270
304
|
* @see https://greatdetail.com
|
|
271
305
|
*/
|
|
272
306
|
|
|
273
|
-
interface Options$
|
|
307
|
+
interface Options$9 extends SendOptions {
|
|
274
308
|
body: z.infer<typeof CreateLabelRequest.SCHEMA>;
|
|
275
309
|
request?: RequestInit;
|
|
276
310
|
}
|
|
@@ -290,7 +324,7 @@ declare class CreateLabelRequest {
|
|
|
290
324
|
description?: string | undefined;
|
|
291
325
|
}>;
|
|
292
326
|
constructor(_client: Client);
|
|
293
|
-
send({ body, request, ...options }: Options$
|
|
327
|
+
send({ body, request, ...options }: Options$9): Promise<CreateLabelResponse>;
|
|
294
328
|
}
|
|
295
329
|
type CreateLabelResponsePayload = {
|
|
296
330
|
label: {
|
|
@@ -316,13 +350,46 @@ declare class CreateLabelResponse {
|
|
|
316
350
|
* @see https://greatdetail.com
|
|
317
351
|
*/
|
|
318
352
|
|
|
319
|
-
interface Options$
|
|
353
|
+
interface Options$8 extends SendOptions {
|
|
354
|
+
id: string;
|
|
355
|
+
request?: RequestInit;
|
|
356
|
+
}
|
|
357
|
+
declare class GetLabelRequest {
|
|
358
|
+
protected _client: Client;
|
|
359
|
+
constructor(_client: Client);
|
|
360
|
+
send({ id, request, ...options }: Options$8): Promise<GetLabelResponse>;
|
|
361
|
+
}
|
|
362
|
+
type GetLabelResponsePayload = {
|
|
363
|
+
label: {
|
|
364
|
+
id: string;
|
|
365
|
+
title: string;
|
|
366
|
+
description?: string;
|
|
367
|
+
createdAt: string;
|
|
368
|
+
updatedAt?: string;
|
|
369
|
+
};
|
|
370
|
+
};
|
|
371
|
+
declare class GetLabelResponse {
|
|
372
|
+
response: Response;
|
|
373
|
+
constructor(response: Response);
|
|
374
|
+
result(): Promise<GetLabelResponsePayload>;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Great Detail Support System.
|
|
379
|
+
*
|
|
380
|
+
* @copyright 2024 Great Detail Ltd
|
|
381
|
+
* @author Great Detail Ltd <info@greatdetail.com>
|
|
382
|
+
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
383
|
+
* @see https://greatdetail.com
|
|
384
|
+
*/
|
|
385
|
+
|
|
386
|
+
interface Options$7 extends SendOptions {
|
|
320
387
|
request?: RequestInit;
|
|
321
388
|
}
|
|
322
389
|
declare class ListLabelsRequest {
|
|
323
390
|
protected _client: Client;
|
|
324
391
|
constructor(_client: Client);
|
|
325
|
-
send({ request, ...options }?: Options$
|
|
392
|
+
send({ request, ...options }?: Options$7): Promise<ListLabelsResponse>;
|
|
326
393
|
}
|
|
327
394
|
type ListLabelsResponsePayload = {
|
|
328
395
|
labels: {
|
|
@@ -348,13 +415,13 @@ declare class ListLabelsResponse {
|
|
|
348
415
|
* @see https://greatdetail.com
|
|
349
416
|
*/
|
|
350
417
|
|
|
351
|
-
interface Options$
|
|
418
|
+
interface Options$6 extends SendOptions {
|
|
352
419
|
request?: RequestInit;
|
|
353
420
|
}
|
|
354
421
|
declare class ListMessagesRequest {
|
|
355
422
|
protected _client: Client;
|
|
356
423
|
constructor(_client: Client);
|
|
357
|
-
send({ request, ...options }?: Options$
|
|
424
|
+
send({ request, ...options }?: Options$6): Promise<ListMessagesResponse>;
|
|
358
425
|
}
|
|
359
426
|
type ListMessagesResponsePayload = {
|
|
360
427
|
messages: {
|
|
@@ -383,7 +450,7 @@ declare class ListMessagesResponse {
|
|
|
383
450
|
* @see https://greatdetail.com
|
|
384
451
|
*/
|
|
385
452
|
|
|
386
|
-
interface Options$
|
|
453
|
+
interface Options$5 extends SendOptions {
|
|
387
454
|
id: string;
|
|
388
455
|
body: z.infer<typeof CreateCorrectionModelRequest.SCHEMA>;
|
|
389
456
|
request?: RequestInit;
|
|
@@ -404,7 +471,7 @@ declare class CreateCorrectionModelRequest {
|
|
|
404
471
|
correction: string;
|
|
405
472
|
}>;
|
|
406
473
|
constructor(_client: Client);
|
|
407
|
-
send({ id, body, request, ...options }: Options$
|
|
474
|
+
send({ id, body, request, ...options }: Options$5): Promise<CreateCorrectionModelResponse>;
|
|
408
475
|
}
|
|
409
476
|
type CreateCorrectionResponsePayload = unknown;
|
|
410
477
|
declare class CreateCorrectionModelResponse {
|
|
@@ -422,13 +489,46 @@ declare class CreateCorrectionModelResponse {
|
|
|
422
489
|
* @see https://greatdetail.com
|
|
423
490
|
*/
|
|
424
491
|
|
|
425
|
-
interface Options$
|
|
492
|
+
interface Options$4 extends SendOptions {
|
|
493
|
+
id: string;
|
|
494
|
+
request?: RequestInit;
|
|
495
|
+
}
|
|
496
|
+
declare class GetModelRequest {
|
|
497
|
+
protected _client: Client;
|
|
498
|
+
constructor(_client: Client);
|
|
499
|
+
send({ id, request, ...options }: Options$4): Promise<GetModelResponse>;
|
|
500
|
+
}
|
|
501
|
+
type GetModelResponsePayload = {
|
|
502
|
+
model: {
|
|
503
|
+
id: string;
|
|
504
|
+
name: string;
|
|
505
|
+
url: string;
|
|
506
|
+
icon: string;
|
|
507
|
+
disambiguatingDescription: string;
|
|
508
|
+
};
|
|
509
|
+
};
|
|
510
|
+
declare class GetModelResponse {
|
|
511
|
+
response: Response;
|
|
512
|
+
constructor(response: Response);
|
|
513
|
+
result(): Promise<GetModelResponsePayload>;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Great Detail Support System.
|
|
518
|
+
*
|
|
519
|
+
* @copyright 2024 Great Detail Ltd
|
|
520
|
+
* @author Great Detail Ltd <info@greatdetail.com>
|
|
521
|
+
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
522
|
+
* @see https://greatdetail.com
|
|
523
|
+
*/
|
|
524
|
+
|
|
525
|
+
interface Options$3 extends SendOptions {
|
|
426
526
|
request?: RequestInit;
|
|
427
527
|
}
|
|
428
528
|
declare class ListModelsRequest {
|
|
429
529
|
protected _client: Client;
|
|
430
530
|
constructor(_client: Client);
|
|
431
|
-
send({ request, ...options }?: Options$
|
|
531
|
+
send({ request, ...options }?: Options$3): Promise<ListModelsResponse>;
|
|
432
532
|
}
|
|
433
533
|
type ListModelsResponsePayload = {
|
|
434
534
|
models: {
|
|
@@ -454,7 +554,7 @@ declare class ListModelsResponse {
|
|
|
454
554
|
* @see https://greatdetail.com
|
|
455
555
|
*/
|
|
456
556
|
|
|
457
|
-
interface Options$
|
|
557
|
+
interface Options$2 extends SendOptions {
|
|
458
558
|
id: string;
|
|
459
559
|
body: z.infer<typeof CreateResponseModelRequest.SCHEMA>;
|
|
460
560
|
request?: RequestInit;
|
|
@@ -472,7 +572,7 @@ declare class CreateResponseModelRequest {
|
|
|
472
572
|
content: string | null;
|
|
473
573
|
}>, "many">;
|
|
474
574
|
constructor(_client: Client);
|
|
475
|
-
send({ id, body, request, ...options }: Options$
|
|
575
|
+
send({ id, body, request, ...options }: Options$2): Promise<CreateResponseModelResponse>;
|
|
476
576
|
}
|
|
477
577
|
type CreateResponseResponsePayload = {
|
|
478
578
|
message: string | null;
|
|
@@ -487,6 +587,39 @@ declare class CreateResponseModelResponse {
|
|
|
487
587
|
result(): Promise<CreateResponseResponsePayload>;
|
|
488
588
|
}
|
|
489
589
|
|
|
590
|
+
/**
|
|
591
|
+
* Great Detail Support System.
|
|
592
|
+
*
|
|
593
|
+
* @copyright 2024 Great Detail Ltd
|
|
594
|
+
* @author Great Detail Ltd <info@greatdetail.com>
|
|
595
|
+
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
596
|
+
* @see https://greatdetail.com
|
|
597
|
+
*/
|
|
598
|
+
|
|
599
|
+
interface Options$1 extends SendOptions {
|
|
600
|
+
id: string;
|
|
601
|
+
request?: RequestInit;
|
|
602
|
+
}
|
|
603
|
+
declare class GetSourceRequest {
|
|
604
|
+
protected _client: Client;
|
|
605
|
+
constructor(_client: Client);
|
|
606
|
+
send({ id, request, ...options }: Options$1): Promise<GetSourceResponse>;
|
|
607
|
+
}
|
|
608
|
+
type GetSourceResponsePayload = {
|
|
609
|
+
source: {
|
|
610
|
+
id: string;
|
|
611
|
+
name: string;
|
|
612
|
+
category: string;
|
|
613
|
+
url: string;
|
|
614
|
+
disambiguatingDescription: string;
|
|
615
|
+
};
|
|
616
|
+
};
|
|
617
|
+
declare class GetSourceResponse {
|
|
618
|
+
response: Response;
|
|
619
|
+
constructor(response: Response);
|
|
620
|
+
result(): Promise<GetSourceResponsePayload>;
|
|
621
|
+
}
|
|
622
|
+
|
|
490
623
|
/**
|
|
491
624
|
* Great Detail Support System.
|
|
492
625
|
*
|
|
@@ -556,6 +689,7 @@ declare class Client {
|
|
|
556
689
|
list: ListChannelsRequest;
|
|
557
690
|
};
|
|
558
691
|
contact: {
|
|
692
|
+
get: GetContactRequest;
|
|
559
693
|
list: ListContactsRequest;
|
|
560
694
|
};
|
|
561
695
|
conversation: {
|
|
@@ -564,12 +698,14 @@ declare class Client {
|
|
|
564
698
|
};
|
|
565
699
|
label: {
|
|
566
700
|
create: CreateLabelRequest;
|
|
701
|
+
get: GetLabelRequest;
|
|
567
702
|
list: ListLabelsRequest;
|
|
568
703
|
};
|
|
569
704
|
message: {
|
|
570
705
|
list: ListMessagesRequest;
|
|
571
706
|
};
|
|
572
707
|
model: {
|
|
708
|
+
get: GetModelRequest;
|
|
573
709
|
list: ListModelsRequest;
|
|
574
710
|
response: {
|
|
575
711
|
create: CreateResponseModelRequest;
|
|
@@ -579,6 +715,7 @@ declare class Client {
|
|
|
579
715
|
};
|
|
580
716
|
};
|
|
581
717
|
source: {
|
|
718
|
+
get: GetSourceRequest;
|
|
582
719
|
list: ListSourcesRequest;
|
|
583
720
|
};
|
|
584
721
|
protected _filterRequest(request: RequestInit): Promise<RequestInit>;
|
package/dist/index.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ interface Authentication extends RequestFilterable {
|
|
|
48
48
|
* @see https://greatdetail.com
|
|
49
49
|
*/
|
|
50
50
|
|
|
51
|
-
interface Options$
|
|
51
|
+
interface Options$h {
|
|
52
52
|
name?: string;
|
|
53
53
|
key?: string;
|
|
54
54
|
}
|
|
@@ -56,7 +56,7 @@ declare class KeyAuthentication implements Authentication {
|
|
|
56
56
|
#private;
|
|
57
57
|
static DEFAULT_NAME: string;
|
|
58
58
|
name: string;
|
|
59
|
-
constructor({ name, key, }?: Options$
|
|
59
|
+
constructor({ name, key, }?: Options$h);
|
|
60
60
|
filter(request: RequestInit): Promise<RequestInit>;
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -69,12 +69,12 @@ declare class KeyAuthentication implements Authentication {
|
|
|
69
69
|
* @see https://greatdetail.com
|
|
70
70
|
*/
|
|
71
71
|
|
|
72
|
-
interface Options$
|
|
72
|
+
interface Options$g {
|
|
73
73
|
token?: string;
|
|
74
74
|
}
|
|
75
75
|
declare class TokenAuthentication implements Authentication {
|
|
76
76
|
#private;
|
|
77
|
-
constructor({ token }?: Options$
|
|
77
|
+
constructor({ token }?: Options$g);
|
|
78
78
|
filter(request: RequestInit): Promise<RequestInit>;
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -106,13 +106,13 @@ declare class PublicAuthentication implements Authentication {
|
|
|
106
106
|
* @see https://greatdetail.com
|
|
107
107
|
*/
|
|
108
108
|
|
|
109
|
-
interface Options$
|
|
109
|
+
interface Options$f extends SendOptions {
|
|
110
110
|
request?: RequestInit;
|
|
111
111
|
}
|
|
112
112
|
declare class ListActionsRequest {
|
|
113
113
|
protected _client: Client;
|
|
114
114
|
constructor(_client: Client);
|
|
115
|
-
send({ request, ...options }?: Options$
|
|
115
|
+
send({ request, ...options }?: Options$f): Promise<ListActionsResponse>;
|
|
116
116
|
}
|
|
117
117
|
type ListActionsResponsePayload = {
|
|
118
118
|
actions: {
|
|
@@ -139,13 +139,13 @@ declare class ListActionsResponse {
|
|
|
139
139
|
* @see https://greatdetail.com
|
|
140
140
|
*/
|
|
141
141
|
|
|
142
|
-
interface Options$
|
|
142
|
+
interface Options$e extends SendOptions {
|
|
143
143
|
request?: RequestInit;
|
|
144
144
|
}
|
|
145
145
|
declare class ListChannelsRequest {
|
|
146
146
|
protected _client: Client;
|
|
147
147
|
constructor(_client: Client);
|
|
148
|
-
send({ request, ...options }?: Options$
|
|
148
|
+
send({ request, ...options }?: Options$e): Promise<ListChannelsResponse>;
|
|
149
149
|
}
|
|
150
150
|
type ListChannelsResponsePayload = {
|
|
151
151
|
channels: {
|
|
@@ -172,13 +172,47 @@ declare class ListChannelsResponse {
|
|
|
172
172
|
* @see https://greatdetail.com
|
|
173
173
|
*/
|
|
174
174
|
|
|
175
|
-
interface Options$
|
|
175
|
+
interface Options$d extends SendOptions {
|
|
176
|
+
id: string;
|
|
177
|
+
request?: RequestInit;
|
|
178
|
+
}
|
|
179
|
+
declare class GetContactRequest {
|
|
180
|
+
protected _client: Client;
|
|
181
|
+
constructor(_client: Client);
|
|
182
|
+
send({ id, request, ...options }: Options$d): Promise<GetContactResponse>;
|
|
183
|
+
}
|
|
184
|
+
type GetContactResponsePayload = {
|
|
185
|
+
contact: {
|
|
186
|
+
id: string;
|
|
187
|
+
name?: string;
|
|
188
|
+
emailAddress?: string;
|
|
189
|
+
telephoneNumber?: string;
|
|
190
|
+
createdAt: string;
|
|
191
|
+
updatedAt?: string;
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
declare class GetContactResponse {
|
|
195
|
+
response: Response;
|
|
196
|
+
constructor(response: Response);
|
|
197
|
+
result(): Promise<GetContactResponsePayload>;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Great Detail Support System.
|
|
202
|
+
*
|
|
203
|
+
* @copyright 2024 Great Detail Ltd
|
|
204
|
+
* @author Great Detail Ltd <info@greatdetail.com>
|
|
205
|
+
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
206
|
+
* @see https://greatdetail.com
|
|
207
|
+
*/
|
|
208
|
+
|
|
209
|
+
interface Options$c extends SendOptions {
|
|
176
210
|
request?: RequestInit;
|
|
177
211
|
}
|
|
178
212
|
declare class ListContactsRequest {
|
|
179
213
|
protected _client: Client;
|
|
180
214
|
constructor(_client: Client);
|
|
181
|
-
send({ request, ...options }?: Options$
|
|
215
|
+
send({ request, ...options }?: Options$c): Promise<ListContactsResponse>;
|
|
182
216
|
}
|
|
183
217
|
type ListContactsResponsePayload = {
|
|
184
218
|
contacts: {
|
|
@@ -205,14 +239,14 @@ declare class ListContactsResponse {
|
|
|
205
239
|
* @see https://greatdetail.com
|
|
206
240
|
*/
|
|
207
241
|
|
|
208
|
-
interface Options$
|
|
242
|
+
interface Options$b extends SendOptions {
|
|
209
243
|
id: string;
|
|
210
244
|
request?: RequestInit;
|
|
211
245
|
}
|
|
212
246
|
declare class GetConversationRequest {
|
|
213
247
|
protected _client: Client;
|
|
214
248
|
constructor(_client: Client);
|
|
215
|
-
send({ id, request, ...options }: Options$
|
|
249
|
+
send({ id, request, ...options }: Options$b): Promise<GetConversationResponse>;
|
|
216
250
|
}
|
|
217
251
|
type GetConversationResponsePayload = {
|
|
218
252
|
conversation: {
|
|
@@ -238,13 +272,13 @@ declare class GetConversationResponse {
|
|
|
238
272
|
* @see https://greatdetail.com
|
|
239
273
|
*/
|
|
240
274
|
|
|
241
|
-
interface Options$
|
|
275
|
+
interface Options$a extends SendOptions {
|
|
242
276
|
request?: RequestInit;
|
|
243
277
|
}
|
|
244
278
|
declare class ListConversationsRequest {
|
|
245
279
|
protected _client: Client;
|
|
246
280
|
constructor(_client: Client);
|
|
247
|
-
send({ request, ...options }?: Options$
|
|
281
|
+
send({ request, ...options }?: Options$a): Promise<ListConversationsResponse>;
|
|
248
282
|
}
|
|
249
283
|
type ListConversationsResponsePayload = {
|
|
250
284
|
conversations: {
|
|
@@ -270,7 +304,7 @@ declare class ListConversationsResponse {
|
|
|
270
304
|
* @see https://greatdetail.com
|
|
271
305
|
*/
|
|
272
306
|
|
|
273
|
-
interface Options$
|
|
307
|
+
interface Options$9 extends SendOptions {
|
|
274
308
|
body: z.infer<typeof CreateLabelRequest.SCHEMA>;
|
|
275
309
|
request?: RequestInit;
|
|
276
310
|
}
|
|
@@ -290,7 +324,7 @@ declare class CreateLabelRequest {
|
|
|
290
324
|
description?: string | undefined;
|
|
291
325
|
}>;
|
|
292
326
|
constructor(_client: Client);
|
|
293
|
-
send({ body, request, ...options }: Options$
|
|
327
|
+
send({ body, request, ...options }: Options$9): Promise<CreateLabelResponse>;
|
|
294
328
|
}
|
|
295
329
|
type CreateLabelResponsePayload = {
|
|
296
330
|
label: {
|
|
@@ -316,13 +350,46 @@ declare class CreateLabelResponse {
|
|
|
316
350
|
* @see https://greatdetail.com
|
|
317
351
|
*/
|
|
318
352
|
|
|
319
|
-
interface Options$
|
|
353
|
+
interface Options$8 extends SendOptions {
|
|
354
|
+
id: string;
|
|
355
|
+
request?: RequestInit;
|
|
356
|
+
}
|
|
357
|
+
declare class GetLabelRequest {
|
|
358
|
+
protected _client: Client;
|
|
359
|
+
constructor(_client: Client);
|
|
360
|
+
send({ id, request, ...options }: Options$8): Promise<GetLabelResponse>;
|
|
361
|
+
}
|
|
362
|
+
type GetLabelResponsePayload = {
|
|
363
|
+
label: {
|
|
364
|
+
id: string;
|
|
365
|
+
title: string;
|
|
366
|
+
description?: string;
|
|
367
|
+
createdAt: string;
|
|
368
|
+
updatedAt?: string;
|
|
369
|
+
};
|
|
370
|
+
};
|
|
371
|
+
declare class GetLabelResponse {
|
|
372
|
+
response: Response;
|
|
373
|
+
constructor(response: Response);
|
|
374
|
+
result(): Promise<GetLabelResponsePayload>;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Great Detail Support System.
|
|
379
|
+
*
|
|
380
|
+
* @copyright 2024 Great Detail Ltd
|
|
381
|
+
* @author Great Detail Ltd <info@greatdetail.com>
|
|
382
|
+
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
383
|
+
* @see https://greatdetail.com
|
|
384
|
+
*/
|
|
385
|
+
|
|
386
|
+
interface Options$7 extends SendOptions {
|
|
320
387
|
request?: RequestInit;
|
|
321
388
|
}
|
|
322
389
|
declare class ListLabelsRequest {
|
|
323
390
|
protected _client: Client;
|
|
324
391
|
constructor(_client: Client);
|
|
325
|
-
send({ request, ...options }?: Options$
|
|
392
|
+
send({ request, ...options }?: Options$7): Promise<ListLabelsResponse>;
|
|
326
393
|
}
|
|
327
394
|
type ListLabelsResponsePayload = {
|
|
328
395
|
labels: {
|
|
@@ -348,13 +415,13 @@ declare class ListLabelsResponse {
|
|
|
348
415
|
* @see https://greatdetail.com
|
|
349
416
|
*/
|
|
350
417
|
|
|
351
|
-
interface Options$
|
|
418
|
+
interface Options$6 extends SendOptions {
|
|
352
419
|
request?: RequestInit;
|
|
353
420
|
}
|
|
354
421
|
declare class ListMessagesRequest {
|
|
355
422
|
protected _client: Client;
|
|
356
423
|
constructor(_client: Client);
|
|
357
|
-
send({ request, ...options }?: Options$
|
|
424
|
+
send({ request, ...options }?: Options$6): Promise<ListMessagesResponse>;
|
|
358
425
|
}
|
|
359
426
|
type ListMessagesResponsePayload = {
|
|
360
427
|
messages: {
|
|
@@ -383,7 +450,7 @@ declare class ListMessagesResponse {
|
|
|
383
450
|
* @see https://greatdetail.com
|
|
384
451
|
*/
|
|
385
452
|
|
|
386
|
-
interface Options$
|
|
453
|
+
interface Options$5 extends SendOptions {
|
|
387
454
|
id: string;
|
|
388
455
|
body: z.infer<typeof CreateCorrectionModelRequest.SCHEMA>;
|
|
389
456
|
request?: RequestInit;
|
|
@@ -404,7 +471,7 @@ declare class CreateCorrectionModelRequest {
|
|
|
404
471
|
correction: string;
|
|
405
472
|
}>;
|
|
406
473
|
constructor(_client: Client);
|
|
407
|
-
send({ id, body, request, ...options }: Options$
|
|
474
|
+
send({ id, body, request, ...options }: Options$5): Promise<CreateCorrectionModelResponse>;
|
|
408
475
|
}
|
|
409
476
|
type CreateCorrectionResponsePayload = unknown;
|
|
410
477
|
declare class CreateCorrectionModelResponse {
|
|
@@ -422,13 +489,46 @@ declare class CreateCorrectionModelResponse {
|
|
|
422
489
|
* @see https://greatdetail.com
|
|
423
490
|
*/
|
|
424
491
|
|
|
425
|
-
interface Options$
|
|
492
|
+
interface Options$4 extends SendOptions {
|
|
493
|
+
id: string;
|
|
494
|
+
request?: RequestInit;
|
|
495
|
+
}
|
|
496
|
+
declare class GetModelRequest {
|
|
497
|
+
protected _client: Client;
|
|
498
|
+
constructor(_client: Client);
|
|
499
|
+
send({ id, request, ...options }: Options$4): Promise<GetModelResponse>;
|
|
500
|
+
}
|
|
501
|
+
type GetModelResponsePayload = {
|
|
502
|
+
model: {
|
|
503
|
+
id: string;
|
|
504
|
+
name: string;
|
|
505
|
+
url: string;
|
|
506
|
+
icon: string;
|
|
507
|
+
disambiguatingDescription: string;
|
|
508
|
+
};
|
|
509
|
+
};
|
|
510
|
+
declare class GetModelResponse {
|
|
511
|
+
response: Response;
|
|
512
|
+
constructor(response: Response);
|
|
513
|
+
result(): Promise<GetModelResponsePayload>;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Great Detail Support System.
|
|
518
|
+
*
|
|
519
|
+
* @copyright 2024 Great Detail Ltd
|
|
520
|
+
* @author Great Detail Ltd <info@greatdetail.com>
|
|
521
|
+
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
522
|
+
* @see https://greatdetail.com
|
|
523
|
+
*/
|
|
524
|
+
|
|
525
|
+
interface Options$3 extends SendOptions {
|
|
426
526
|
request?: RequestInit;
|
|
427
527
|
}
|
|
428
528
|
declare class ListModelsRequest {
|
|
429
529
|
protected _client: Client;
|
|
430
530
|
constructor(_client: Client);
|
|
431
|
-
send({ request, ...options }?: Options$
|
|
531
|
+
send({ request, ...options }?: Options$3): Promise<ListModelsResponse>;
|
|
432
532
|
}
|
|
433
533
|
type ListModelsResponsePayload = {
|
|
434
534
|
models: {
|
|
@@ -454,7 +554,7 @@ declare class ListModelsResponse {
|
|
|
454
554
|
* @see https://greatdetail.com
|
|
455
555
|
*/
|
|
456
556
|
|
|
457
|
-
interface Options$
|
|
557
|
+
interface Options$2 extends SendOptions {
|
|
458
558
|
id: string;
|
|
459
559
|
body: z.infer<typeof CreateResponseModelRequest.SCHEMA>;
|
|
460
560
|
request?: RequestInit;
|
|
@@ -472,7 +572,7 @@ declare class CreateResponseModelRequest {
|
|
|
472
572
|
content: string | null;
|
|
473
573
|
}>, "many">;
|
|
474
574
|
constructor(_client: Client);
|
|
475
|
-
send({ id, body, request, ...options }: Options$
|
|
575
|
+
send({ id, body, request, ...options }: Options$2): Promise<CreateResponseModelResponse>;
|
|
476
576
|
}
|
|
477
577
|
type CreateResponseResponsePayload = {
|
|
478
578
|
message: string | null;
|
|
@@ -487,6 +587,39 @@ declare class CreateResponseModelResponse {
|
|
|
487
587
|
result(): Promise<CreateResponseResponsePayload>;
|
|
488
588
|
}
|
|
489
589
|
|
|
590
|
+
/**
|
|
591
|
+
* Great Detail Support System.
|
|
592
|
+
*
|
|
593
|
+
* @copyright 2024 Great Detail Ltd
|
|
594
|
+
* @author Great Detail Ltd <info@greatdetail.com>
|
|
595
|
+
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
596
|
+
* @see https://greatdetail.com
|
|
597
|
+
*/
|
|
598
|
+
|
|
599
|
+
interface Options$1 extends SendOptions {
|
|
600
|
+
id: string;
|
|
601
|
+
request?: RequestInit;
|
|
602
|
+
}
|
|
603
|
+
declare class GetSourceRequest {
|
|
604
|
+
protected _client: Client;
|
|
605
|
+
constructor(_client: Client);
|
|
606
|
+
send({ id, request, ...options }: Options$1): Promise<GetSourceResponse>;
|
|
607
|
+
}
|
|
608
|
+
type GetSourceResponsePayload = {
|
|
609
|
+
source: {
|
|
610
|
+
id: string;
|
|
611
|
+
name: string;
|
|
612
|
+
category: string;
|
|
613
|
+
url: string;
|
|
614
|
+
disambiguatingDescription: string;
|
|
615
|
+
};
|
|
616
|
+
};
|
|
617
|
+
declare class GetSourceResponse {
|
|
618
|
+
response: Response;
|
|
619
|
+
constructor(response: Response);
|
|
620
|
+
result(): Promise<GetSourceResponsePayload>;
|
|
621
|
+
}
|
|
622
|
+
|
|
490
623
|
/**
|
|
491
624
|
* Great Detail Support System.
|
|
492
625
|
*
|
|
@@ -556,6 +689,7 @@ declare class Client {
|
|
|
556
689
|
list: ListChannelsRequest;
|
|
557
690
|
};
|
|
558
691
|
contact: {
|
|
692
|
+
get: GetContactRequest;
|
|
559
693
|
list: ListContactsRequest;
|
|
560
694
|
};
|
|
561
695
|
conversation: {
|
|
@@ -564,12 +698,14 @@ declare class Client {
|
|
|
564
698
|
};
|
|
565
699
|
label: {
|
|
566
700
|
create: CreateLabelRequest;
|
|
701
|
+
get: GetLabelRequest;
|
|
567
702
|
list: ListLabelsRequest;
|
|
568
703
|
};
|
|
569
704
|
message: {
|
|
570
705
|
list: ListMessagesRequest;
|
|
571
706
|
};
|
|
572
707
|
model: {
|
|
708
|
+
get: GetModelRequest;
|
|
573
709
|
list: ListModelsRequest;
|
|
574
710
|
response: {
|
|
575
711
|
create: CreateResponseModelRequest;
|
|
@@ -579,6 +715,7 @@ declare class Client {
|
|
|
579
715
|
};
|
|
580
716
|
};
|
|
581
717
|
source: {
|
|
718
|
+
get: GetSourceRequest;
|
|
582
719
|
list: ListSourcesRequest;
|
|
583
720
|
};
|
|
584
721
|
protected _filterRequest(request: RequestInit): Promise<RequestInit>;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b as n,c as p,d as i}from"./chunk-
|
|
1
|
+
import{a,b as n,c as p,d as i}from"./chunk-BFO7RVLV.js";var t=class s{static DEFAULT_NAME=n;name;#e;constructor({name:e=process.env.SUPPORT_KEY_NAME??s.DEFAULT_NAME,key:r=process.env.SUPPORT_API_KEY}={}){if(!r)throw new Error("API Key option must be specified when using Key Authentication");this.name=e,this.#e=r}async filter(e){return{...e,headers:{...e.headers,Authorization:`Basic ${btoa(this.name+":"+this.#e)}`}}}};var o=class{#e;constructor({token:e=process.env.SUPPORT_ACCESS_TOKEN}={}){if(!e)throw new Error("Access Token option must be specified when using Token Authentication");this.#e=e}async filter(e){return{...e,headers:{...e.headers,Authorization:`Bearer ${this.#e}`}}}};export{i as Client,a as DEFAULT_SUPPORT_BASE_URL,t as KeyAuthentication,p as PublicAuthentication,o as TokenAuthentication,i as default};
|
package/package.json
CHANGED
package/src/Client/index.ts
CHANGED
|
@@ -11,17 +11,21 @@ import ListActionsRequest from "../Action/ListActions.js";
|
|
|
11
11
|
import Authentication from "../Authentication/index.js";
|
|
12
12
|
import ListChannelsRequest from "../Channel/ListChannels.js";
|
|
13
13
|
import { DEFAULT_SUPPORT_BASE_URL } from "../constants/index.js";
|
|
14
|
+
import GetContactRequest from "../Contact/GetContact.js";
|
|
14
15
|
import ListContactsRequest from "../Contact/ListContacts.js";
|
|
15
16
|
import GetConversationRequest from "../Conversation/GetConversation.js";
|
|
16
17
|
import ListConversationsRequest from "../Conversation/ListConversations.js";
|
|
17
18
|
import CreateLabelRequest from "../Label/CreateLabel.js";
|
|
19
|
+
import GetLabelRequest from "../Label/GetLabel.js";
|
|
18
20
|
import ListLabelsRequest from "../Label/ListLabels.js";
|
|
19
21
|
import ListMessagesRequest from "../Message/ListMessages.js";
|
|
20
22
|
import CreateCorrectionModelRequest from "../Model/Correction/CreateCorrectionModel.js";
|
|
23
|
+
import GetModelRequest from "../Model/GetModel.js";
|
|
21
24
|
import ListModelsRequest from "../Model/ListModels.js";
|
|
22
25
|
import CreateResponseModelRequest from "../Model/Response/CreateResponseModel.js";
|
|
23
26
|
import RequestFilterable from "../Request/RequestFilterable.js";
|
|
24
27
|
import RequestStandardHeaders from "../Request/RequestStandardHeaders.js";
|
|
28
|
+
import GetSourceRequest from "../Source/GetSource.js";
|
|
25
29
|
import ListSourcesRequest from "../Source/ListSources.js";
|
|
26
30
|
|
|
27
31
|
export interface ClientOptions {
|
|
@@ -69,6 +73,7 @@ export default class Client {
|
|
|
69
73
|
};
|
|
70
74
|
|
|
71
75
|
public contact = {
|
|
76
|
+
get: new GetContactRequest(this),
|
|
72
77
|
list: new ListContactsRequest(this),
|
|
73
78
|
};
|
|
74
79
|
|
|
@@ -79,6 +84,7 @@ export default class Client {
|
|
|
79
84
|
|
|
80
85
|
public label = {
|
|
81
86
|
create: new CreateLabelRequest(this),
|
|
87
|
+
get: new GetLabelRequest(this),
|
|
82
88
|
list: new ListLabelsRequest(this),
|
|
83
89
|
};
|
|
84
90
|
|
|
@@ -87,6 +93,7 @@ export default class Client {
|
|
|
87
93
|
};
|
|
88
94
|
|
|
89
95
|
public model = {
|
|
96
|
+
get: new GetModelRequest(this),
|
|
90
97
|
list: new ListModelsRequest(this),
|
|
91
98
|
response: {
|
|
92
99
|
create: new CreateResponseModelRequest(this),
|
|
@@ -97,6 +104,7 @@ export default class Client {
|
|
|
97
104
|
};
|
|
98
105
|
|
|
99
106
|
public source = {
|
|
107
|
+
get: new GetSourceRequest(this),
|
|
100
108
|
list: new ListSourcesRequest(this),
|
|
101
109
|
};
|
|
102
110
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Great Detail Support System.
|
|
3
|
+
*
|
|
4
|
+
* @copyright 2024 Great Detail Ltd
|
|
5
|
+
* @author Great Detail Ltd <info@greatdetail.com>
|
|
6
|
+
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
7
|
+
* @see https://greatdetail.com
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import Client, { SendOptions } from "../Client/index.js";
|
|
11
|
+
|
|
12
|
+
export interface Options extends SendOptions {
|
|
13
|
+
id: string;
|
|
14
|
+
request?: RequestInit;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default class GetContactRequest {
|
|
18
|
+
constructor(protected _client: Client) {}
|
|
19
|
+
|
|
20
|
+
public async send({ id, request = {}, ...options }: Options) {
|
|
21
|
+
return this._client
|
|
22
|
+
.send(
|
|
23
|
+
"/v1/contacts/" + encodeURIComponent(id),
|
|
24
|
+
{
|
|
25
|
+
...request,
|
|
26
|
+
method: "GET",
|
|
27
|
+
},
|
|
28
|
+
options,
|
|
29
|
+
)
|
|
30
|
+
.then((response) => new GetContactResponse(response));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type GetContactResponsePayload = {
|
|
35
|
+
contact: {
|
|
36
|
+
id: string;
|
|
37
|
+
name?: string;
|
|
38
|
+
emailAddress?: string;
|
|
39
|
+
telephoneNumber?: string;
|
|
40
|
+
createdAt: string;
|
|
41
|
+
updatedAt?: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export class GetContactResponse {
|
|
46
|
+
constructor(public response: Response) {}
|
|
47
|
+
|
|
48
|
+
public async result(): Promise<GetContactResponsePayload> {
|
|
49
|
+
return this.response.json();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Great Detail Support System.
|
|
3
|
+
*
|
|
4
|
+
* @copyright 2024 Great Detail Ltd
|
|
5
|
+
* @author Great Detail Ltd <info@greatdetail.com>
|
|
6
|
+
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
7
|
+
* @see https://greatdetail.com
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import Client, { SendOptions } from "../Client/index.js";
|
|
11
|
+
|
|
12
|
+
export interface Options extends SendOptions {
|
|
13
|
+
id: string;
|
|
14
|
+
request?: RequestInit;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default class GetLabelRequest {
|
|
18
|
+
constructor(protected _client: Client) {}
|
|
19
|
+
|
|
20
|
+
public async send({ id, request = {}, ...options }: Options) {
|
|
21
|
+
return this._client
|
|
22
|
+
.send(
|
|
23
|
+
"/v1/labels/" + encodeURIComponent(id),
|
|
24
|
+
{
|
|
25
|
+
...request,
|
|
26
|
+
method: "GET",
|
|
27
|
+
},
|
|
28
|
+
options,
|
|
29
|
+
)
|
|
30
|
+
.then((response) => new GetLabelResponse(response));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type GetLabelResponsePayload = {
|
|
35
|
+
label: {
|
|
36
|
+
id: string;
|
|
37
|
+
title: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
createdAt: string;
|
|
40
|
+
updatedAt?: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export class GetLabelResponse {
|
|
45
|
+
constructor(public response: Response) {}
|
|
46
|
+
|
|
47
|
+
public async result(): Promise<GetLabelResponsePayload> {
|
|
48
|
+
return this.response.json();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Great Detail Support System.
|
|
3
|
+
*
|
|
4
|
+
* @copyright 2024 Great Detail Ltd
|
|
5
|
+
* @author Great Detail Ltd <info@greatdetail.com>
|
|
6
|
+
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
7
|
+
* @see https://greatdetail.com
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import Client, { SendOptions } from "../Client/index.js";
|
|
11
|
+
|
|
12
|
+
export interface Options extends SendOptions {
|
|
13
|
+
id: string;
|
|
14
|
+
request?: RequestInit;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default class GetModelRequest {
|
|
18
|
+
constructor(protected _client: Client) {}
|
|
19
|
+
|
|
20
|
+
public async send({ id, request = {}, ...options }: Options) {
|
|
21
|
+
return this._client
|
|
22
|
+
.send(
|
|
23
|
+
"/v1/models/" + encodeURIComponent(id),
|
|
24
|
+
{
|
|
25
|
+
...request,
|
|
26
|
+
method: "GET",
|
|
27
|
+
},
|
|
28
|
+
options,
|
|
29
|
+
)
|
|
30
|
+
.then((response) => new GetModelResponse(response));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type GetModelResponsePayload = {
|
|
35
|
+
model: {
|
|
36
|
+
id: string;
|
|
37
|
+
name: string;
|
|
38
|
+
url: string;
|
|
39
|
+
icon: string;
|
|
40
|
+
disambiguatingDescription: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export class GetModelResponse {
|
|
45
|
+
constructor(public response: Response) {}
|
|
46
|
+
|
|
47
|
+
public async result(): Promise<GetModelResponsePayload> {
|
|
48
|
+
return this.response.json();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Great Detail Support System.
|
|
3
|
+
*
|
|
4
|
+
* @copyright 2024 Great Detail Ltd
|
|
5
|
+
* @author Great Detail Ltd <info@greatdetail.com>
|
|
6
|
+
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
7
|
+
* @see https://greatdetail.com
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import Client, { SendOptions } from "../Client/index.js";
|
|
11
|
+
|
|
12
|
+
export interface Options extends SendOptions {
|
|
13
|
+
id: string;
|
|
14
|
+
request?: RequestInit;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default class GetSourceRequest {
|
|
18
|
+
constructor(protected _client: Client) {}
|
|
19
|
+
|
|
20
|
+
public async send({ id, request = {}, ...options }: Options) {
|
|
21
|
+
return this._client
|
|
22
|
+
.send(
|
|
23
|
+
"/v1/sources/" + encodeURIComponent(id),
|
|
24
|
+
{
|
|
25
|
+
...request,
|
|
26
|
+
method: "GET",
|
|
27
|
+
},
|
|
28
|
+
options,
|
|
29
|
+
)
|
|
30
|
+
.then((response) => new GetSourceResponse(response));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type GetSourceResponsePayload = {
|
|
35
|
+
source: {
|
|
36
|
+
id: string;
|
|
37
|
+
name: string;
|
|
38
|
+
category: string;
|
|
39
|
+
url: string;
|
|
40
|
+
disambiguatingDescription: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export class GetSourceResponse {
|
|
45
|
+
constructor(public response: Response) {}
|
|
46
|
+
|
|
47
|
+
public async result(): Promise<GetSourceResponsePayload> {
|
|
48
|
+
return this.response.json();
|
|
49
|
+
}
|
|
50
|
+
}
|
package/src/cli/contacts.ts
CHANGED
|
@@ -16,6 +16,20 @@ export interface Options extends CommandOptions {}
|
|
|
16
16
|
export default function contacts({ client, ora }: Options) {
|
|
17
17
|
const command = new Command("contacts").description("Contacts");
|
|
18
18
|
|
|
19
|
+
command.addCommand(
|
|
20
|
+
new Command("get")
|
|
21
|
+
.description("Find contact")
|
|
22
|
+
.argument("<contact>", "Contact ID")
|
|
23
|
+
.action(async (id) => {
|
|
24
|
+
const result = await oraPromise(() => client.contact.get.send({ id }), {
|
|
25
|
+
...ora,
|
|
26
|
+
text: "Finding contact",
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
console.log(await result.result());
|
|
30
|
+
}),
|
|
31
|
+
);
|
|
32
|
+
|
|
19
33
|
command.addCommand(
|
|
20
34
|
new Command("list").description("List contacts").action(async () => {
|
|
21
35
|
const result = await oraPromise(() => client.contact.list.send(), {
|
package/src/cli/labels.ts
CHANGED
|
@@ -16,6 +16,20 @@ export interface Options extends CommandOptions {}
|
|
|
16
16
|
export default function labels({ client, ora }: Options) {
|
|
17
17
|
const command = new Command("labels").description("Labels");
|
|
18
18
|
|
|
19
|
+
command.addCommand(
|
|
20
|
+
new Command("get")
|
|
21
|
+
.description("Find label")
|
|
22
|
+
.argument("<label>", "Label ID")
|
|
23
|
+
.action(async (id) => {
|
|
24
|
+
const result = await oraPromise(() => client.label.get.send({ id }), {
|
|
25
|
+
...ora,
|
|
26
|
+
text: "Finding label",
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
console.log(await result.result());
|
|
30
|
+
}),
|
|
31
|
+
);
|
|
32
|
+
|
|
19
33
|
command.addCommand(
|
|
20
34
|
new Command("list").description("List labels").action(async () => {
|
|
21
35
|
const result = await oraPromise(() => client.label.list.send(), {
|
package/src/cli/models.ts
CHANGED
|
@@ -16,6 +16,20 @@ export interface Options extends CommandOptions {}
|
|
|
16
16
|
export default function models({ client, ora }: Options) {
|
|
17
17
|
const command = new Command("models").description("Models");
|
|
18
18
|
|
|
19
|
+
command.addCommand(
|
|
20
|
+
new Command("get")
|
|
21
|
+
.description("Find model")
|
|
22
|
+
.argument("<model>", "Model ID")
|
|
23
|
+
.action(async (id) => {
|
|
24
|
+
const result = await oraPromise(() => client.model.get.send({ id }), {
|
|
25
|
+
...ora,
|
|
26
|
+
text: "Finding model",
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
console.log(await result.result());
|
|
30
|
+
}),
|
|
31
|
+
);
|
|
32
|
+
|
|
19
33
|
command.addCommand(
|
|
20
34
|
new Command("list").description("List models").action(async () => {
|
|
21
35
|
const result = await oraPromise(() => client.model.list.send(), {
|
package/src/cli/sources.ts
CHANGED
|
@@ -16,6 +16,20 @@ export interface Options extends CommandOptions {}
|
|
|
16
16
|
export default function sources({ client, ora }: Options) {
|
|
17
17
|
const command = new Command("sources").description("Sources");
|
|
18
18
|
|
|
19
|
+
command.addCommand(
|
|
20
|
+
new Command("get")
|
|
21
|
+
.description("Find source")
|
|
22
|
+
.argument("<source>", "Source ID")
|
|
23
|
+
.action(async (id) => {
|
|
24
|
+
const result = await oraPromise(() => client.source.get.send({ id }), {
|
|
25
|
+
...ora,
|
|
26
|
+
text: "Finding source",
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
console.log(await result.result());
|
|
30
|
+
}),
|
|
31
|
+
);
|
|
32
|
+
|
|
19
33
|
command.addCommand(
|
|
20
34
|
new Command("list").description("List sources").action(async () => {
|
|
21
35
|
const result = await oraPromise(() => client.source.list.send(), {
|
package/dist/chunk-WCSPJBPY.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var j="https://api.support.greatdetail.com",H={"X-Powered-By":"GDSupport/JavaScript"},F="api-key";var O=class{async filter(e){return e}};var o=class{constructor(e){this._client=e}async send({request:e={},...s}={}){return this._client.send("/v1/actions",{...e,method:"GET"},s).then(n=>new C(n))}},C=class{constructor(e){this.response=e}async result(){return this.response.json()}};var i=class{constructor(e){this._client=e}async send({request:e={},...s}={}){return this._client.send("/v1/channels",{...e,method:"GET"},s).then(n=>new A(n))}},A=class{constructor(e){this.response=e}async result(){return this.response.json()}};var p=class{constructor(e){this._client=e}async send({request:e={},...s}={}){return this._client.send("/v1/contacts",{...e,method:"GET"},s).then(n=>new P(n))}},P=class{constructor(e){this.response=e}async result(){return this.response.json()}};var c=class{constructor(e){this._client=e}async send({id:e,request:s={},...n}){return this._client.send("/v1/conversations/"+encodeURIComponent(e),{...s,method:"GET"},n).then(r=>new _(r))}},_=class{constructor(e){this.response=e}async result(){return this.response.json()}};var a=class{constructor(e){this._client=e}async send({request:e={},...s}={}){return this._client.send("/v1/conversations",{...e,method:"GET"},s).then(n=>new E(n))}},E=class{constructor(e){this.response=e}async result(){return this.response.json()}};import{z as l}from"zod";var d=class t{constructor(e){this._client=e}static SCHEMA=l.object({title:l.string(),description:l.optional(l.string()),account:l.string()});async send({body:e,request:s={},...n}){return this._client.send("/v1/labels",{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(t.SCHEMA.parse(e))},n).then(r=>new q(r))}},q=class{constructor(e){this.response=e}async result(){return this.response.json()}};var u=class{constructor(e){this._client=e}async send({request:e={},...s}={}){return this._client.send("/v1/labels",{...e,method:"GET"},s).then(n=>new w(n))}},w=class{constructor(e){this.response=e}async result(){return this.response.json()}};var m=class{constructor(e){this._client=e}async send({request:e={},...s}={}){return this._client.send("/v1/messages",{...e,method:"GET"},s).then(n=>new T(n))}},T=class{constructor(e){this.response=e}async result(){return this.response.json()}};import{z as R}from"zod";var h=class t{constructor(e){this._client=e}static SCHEMA=R.object({input:R.string().max(65536),original:R.string().max(65536),correction:R.string().max(65536)});async send({id:e,body:s,request:n={},...r}){return this._client.send("/v1/models/"+encodeURIComponent(e)+"/correction",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},body:JSON.stringify(t.SCHEMA.parse(s))},r).then(S=>new L(S))}},L=class{constructor(e){this.response=e}async result(){return this.response.json()}};var b=class{constructor(e){this._client=e}async send({request:e={},...s}={}){return this._client.send("/v1/models",{...e,method:"GET"},s).then(n=>new I(n))}},I=class{constructor(e){this.response=e}async result(){return this.response.json()}};import{z as x}from"zod";var f=class t{constructor(e){this._client=e}static SCHEMA=x.array(x.object({role:x.enum(["user","assistant"]),content:x.string().max(65536).nullable()})).min(1);async send({id:e,body:s,request:n={},...r}){return this._client.send("/v1/models/"+encodeURIComponent(e)+"/response",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},body:JSON.stringify(t.SCHEMA.parse(s))},r).then(S=>new v(S))}},v=class{constructor(e){this.response=e}async result(){return this.response.json()}};var g=class{constructor(e){this._client=e}async send({request:e={},...s}={}){return this._client.send("/v1/sources",{...e,method:"GET"},s).then(n=>new U(n))}},U=class{constructor(e){this.response=e}async result(){return this.response.json()}};var y=class t{constructor(e=t.STANDARD_HEADERS){this._standardHeaders=e}static STANDARD_HEADERS=H;async filter(e){return{...e,headers:{...e.headers,...this._standardHeaders}}}};var D=class t{static DEFAULT_BASE_URL=j;options;constructor(e,s={}){this.options={requestFilterables:[new y,e],baseURL:process.env.SUPPORT_BASE_URL??t.DEFAULT_BASE_URL,...s}}action={list:new o(this)};channel={list:new i(this)};contact={list:new p(this)};conversation={get:new c(this),list:new a(this)};label={create:new d(this),list:new u(this)};message={list:new m(this)};model={list:new b(this),response:{create:new f(this)},correction:{create:new h(this)}};source={list:new g(this)};async _filterRequest(e){for(let s of this.options.requestFilterables)e=await s.filter(e);return e}async send(e,s,{fetch:n=fetch}={}){return await n(new Request(new URL(e,this.options.baseURL),await this._filterRequest(s)))}};export{j as a,F as b,O as c,D as d};
|