@great-detail/support-sdk 0.0.3 → 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/README.md +17 -0
- 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 +209 -25
- package/dist/index.d.ts +209 -25
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/Client/index.ts +10 -0
- package/src/Contact/GetContact.ts +51 -0
- package/src/Label/CreateLabel.ts +62 -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/src/index.ts +1 -0
- package/dist/chunk-LS7DRWDS.js +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Great Detail Support System SDK - JS
|
|
2
|
+
|
|
3
|
+
## Getting Started
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install @great-detail/support-sdk
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## License
|
|
10
|
+
|
|
11
|
+
Proprietary © 2024 Great Detail Ltd
|
|
12
|
+
|
|
13
|
+
### Contact
|
|
14
|
+
|
|
15
|
+
**Great Detail Ltd**: <<info@greatdetail.com>>
|
|
16
|
+
|
|
17
|
+
**Dom Webber**: <https://domwebber.dev> <<dom.webber@greatdetail.com>>
|
|
@@ -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 rt=require("commander");var r=class{async filter(t){return t}};var a=class{constructor(t){this._client=t}async send({request:t={},...e}={}){return this._client.send("/v1/actions",{...t,method:"GET"},e).then(s=>new S(s))}},S=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(s=>new A(s))}},A=class{constructor(t){this.response=t}async result(){return this.response.json()}};var W="https://api.support.greatdetail.com",Z={"X-Powered-By":"GDSupport/JavaScript"};var c=class{constructor(t){this._client=t}async send({request:t={},...e}={}){return this._client.send("/v1/contacts",{...t,method:"GET"},e).then(s=>new P(s))}},P=class{constructor(t){this.response=t}async result(){return this.response.json()}};var d=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(i=>new _(i))}},_=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/conversations",{...t,method:"GET"},e).then(s=>new E(s))}},E=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/labels",{...t,method:"GET"},e).then(s=>new v(s))}},v=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/messages",{...t,method:"GET"},e).then(s=>new q(s))}},q=class{constructor(t){this.response=t}async result(){return this.response.json()}};var f=require("zod"),x=class n{constructor(t){this._client=t}static SCHEMA=f.z.object({input:f.z.string().max(65536),original:f.z.string().max(65536),correction:f.z.string().max(65536)});async send({id:t,body:e,request:s={},...i}){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))},i).then(w=>new L(w))}},L=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/models",{...t,method:"GET"},e).then(s=>new T(s))}},T=class{constructor(t){this.response=t}async result(){return this.response.json()}};var O=require("zod"),C=class n{constructor(t){this._client=t}static SCHEMA=O.z.array(O.z.object({role:O.z.enum(["user","assistant"]),content:O.z.string().max(65536).nullable()})).min(1);async send({id:t,body:e,request:s={},...i}){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))},i).then(w=>new I(w))}},I=class{constructor(t){this.response=t}async result(){return this.response.json()}};var h=class n{constructor(t=n.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=Z;async filter(t){return{...t,headers:{...t.headers,...this._standardHeaders}}}};var y=class{constructor(t){this._client=t}async send({request:t={},...e}={}){return this._client.send("/v1/sources",{...t,method:"GET"},e).then(s=>new j(s))}},j=class{constructor(t){this.response=t}async result(){return this.response.json()}};var b=class n{static DEFAULT_BASE_URL=W;options;constructor(t,e={}){this.options={requestFilterables:[new h,t],baseURL:process.env.SUPPORT_BASE_URL??n.DEFAULT_BASE_URL,...e}}action={list:new a(this)};channel={list:new p(this)};contact={list:new c(this)};conversation={get:new d(this),list:new l(this)};label={list:new m(this)};message={list:new u(this)};model={list:new g(this),response:{create:new C(this)},correction:{create:new x(this)}};source={list:new y(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 D=require("commander"),$=require("ora");function U({client:n,ora:t}){let e=new D.Command("actions").description("Actions");return e.addCommand(new D.Command("list").description("List actions").action(async()=>{let s=await(0,$.oraPromise)(()=>n.action.list.send(),{...t,text:"Finding actions"});console.log(await s.result())})),e}var F=require("commander"),tt=require("ora");function H({client:n,ora:t}){let e=new F.Command("channels").description("Channels");return e.addCommand(new F.Command("list").description("List channels").action(async()=>{let s=await(0,tt.oraPromise)(()=>n.channel.list.send(),{...t,text:"Finding channels"});console.log(await s.result())})),e}var G=require("commander"),et=require("ora");function M({client:n,ora:t}){let e=new G.Command("contacts").description("Contacts");return e.addCommand(new G.Command("list").description("List contacts").action(async()=>{let s=await(0,et.oraPromise)(()=>n.contact.list.send(),{...t,text:"Finding contacts"});console.log(await s.result())})),e}var R=require("commander"),N=require("ora");function B({client:n,ora:t}){let e=new R.Command("conversations").description("Conversations");return e.addCommand(new R.Command("get").description("Find conversation").argument("<conversation>","Conversation ID").action(async s=>{let i=await(0,N.oraPromise)(()=>n.conversation.get.send({id:s}),{...t,text:"Finding conversation"});console.log(await i.result())})),e.addCommand(new R.Command("list").description("List conversations").action(async()=>{let s=await(0,N.oraPromise)(()=>n.conversation.list.send(),{...t,text:"Finding conversations"});console.log(await s.result())})),e}var k=require("commander"),nt=require("ora");function z({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,nt.oraPromise)(()=>n.label.list.send(),{...t,text:"Finding labels"});console.log(await s.result())})),e}var J=require("commander"),st=require("ora");function K({client:n,ora:t}){let e=new J.Command("messages").description("Messages");return e.addCommand(new J.Command("list").description("List messages").action(async()=>{let s=await(0,st.oraPromise)(()=>n.message.list.send(),{...t,text:"Finding messages"});console.log(await s.result())})),e}var X=require("commander"),ot=require("ora");function Y({client:n,ora:t}){let e=new X.Command("models").description("Models");return e.addCommand(new X.Command("list").description("List models").action(async()=>{let s=await(0,ot.oraPromise)(()=>n.model.list.send(),{...t,text:"Finding models"});console.log(await s.result())})),e}var Q=require("commander"),it=require("ora");function V({client:n,ora:t}){let e=new Q.Command("sources").description("Sources");return e.addCommand(new Q.Command("list").description("List sources").action(async()=>{let s=await(0,it.oraPromise)(()=>n.source.list.send(),{...t,text:"Finding sources"});console.log(await s.result())})),e}var o={ora:{spinner:"simpleDotsScrolling"},client:new b(new r)},pt=new rt.Command("gds").description("Great Detail Support System").addCommand(U(o)).addCommand(H(o)).addCommand(M(o)).addCommand(B(o)).addCommand(z(o)).addCommand(K(o)).addCommand(Y(o)).addCommand(V(o)),at=pt;at.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,13 +304,92 @@ declare class ListConversationsResponse {
|
|
|
270
304
|
* @see https://greatdetail.com
|
|
271
305
|
*/
|
|
272
306
|
|
|
273
|
-
interface Options$
|
|
307
|
+
interface Options$9 extends SendOptions {
|
|
308
|
+
body: z.infer<typeof CreateLabelRequest.SCHEMA>;
|
|
309
|
+
request?: RequestInit;
|
|
310
|
+
}
|
|
311
|
+
declare class CreateLabelRequest {
|
|
312
|
+
protected _client: Client;
|
|
313
|
+
static SCHEMA: z.ZodObject<{
|
|
314
|
+
title: z.ZodString;
|
|
315
|
+
description: z.ZodOptional<z.ZodString>;
|
|
316
|
+
account: z.ZodString;
|
|
317
|
+
}, "strip", z.ZodTypeAny, {
|
|
318
|
+
title: string;
|
|
319
|
+
account: string;
|
|
320
|
+
description?: string | undefined;
|
|
321
|
+
}, {
|
|
322
|
+
title: string;
|
|
323
|
+
account: string;
|
|
324
|
+
description?: string | undefined;
|
|
325
|
+
}>;
|
|
326
|
+
constructor(_client: Client);
|
|
327
|
+
send({ body, request, ...options }: Options$9): Promise<CreateLabelResponse>;
|
|
328
|
+
}
|
|
329
|
+
type CreateLabelResponsePayload = {
|
|
330
|
+
label: {
|
|
331
|
+
id: string;
|
|
332
|
+
title: string;
|
|
333
|
+
description?: string;
|
|
334
|
+
createdAt: string;
|
|
335
|
+
updatedAt?: string;
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
declare class CreateLabelResponse {
|
|
339
|
+
response: Response;
|
|
340
|
+
constructor(response: Response);
|
|
341
|
+
result(): Promise<CreateLabelResponsePayload>;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Great Detail Support System.
|
|
346
|
+
*
|
|
347
|
+
* @copyright 2024 Great Detail Ltd
|
|
348
|
+
* @author Great Detail Ltd <info@greatdetail.com>
|
|
349
|
+
* @author Dom Webber <dom.webber@greatdetail.com>
|
|
350
|
+
* @see https://greatdetail.com
|
|
351
|
+
*/
|
|
352
|
+
|
|
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 {
|
|
274
387
|
request?: RequestInit;
|
|
275
388
|
}
|
|
276
389
|
declare class ListLabelsRequest {
|
|
277
390
|
protected _client: Client;
|
|
278
391
|
constructor(_client: Client);
|
|
279
|
-
send({ request, ...options }?: Options$
|
|
392
|
+
send({ request, ...options }?: Options$7): Promise<ListLabelsResponse>;
|
|
280
393
|
}
|
|
281
394
|
type ListLabelsResponsePayload = {
|
|
282
395
|
labels: {
|
|
@@ -302,13 +415,13 @@ declare class ListLabelsResponse {
|
|
|
302
415
|
* @see https://greatdetail.com
|
|
303
416
|
*/
|
|
304
417
|
|
|
305
|
-
interface Options$
|
|
418
|
+
interface Options$6 extends SendOptions {
|
|
306
419
|
request?: RequestInit;
|
|
307
420
|
}
|
|
308
421
|
declare class ListMessagesRequest {
|
|
309
422
|
protected _client: Client;
|
|
310
423
|
constructor(_client: Client);
|
|
311
|
-
send({ request, ...options }?: Options$
|
|
424
|
+
send({ request, ...options }?: Options$6): Promise<ListMessagesResponse>;
|
|
312
425
|
}
|
|
313
426
|
type ListMessagesResponsePayload = {
|
|
314
427
|
messages: {
|
|
@@ -337,7 +450,7 @@ declare class ListMessagesResponse {
|
|
|
337
450
|
* @see https://greatdetail.com
|
|
338
451
|
*/
|
|
339
452
|
|
|
340
|
-
interface Options$
|
|
453
|
+
interface Options$5 extends SendOptions {
|
|
341
454
|
id: string;
|
|
342
455
|
body: z.infer<typeof CreateCorrectionModelRequest.SCHEMA>;
|
|
343
456
|
request?: RequestInit;
|
|
@@ -358,7 +471,7 @@ declare class CreateCorrectionModelRequest {
|
|
|
358
471
|
correction: string;
|
|
359
472
|
}>;
|
|
360
473
|
constructor(_client: Client);
|
|
361
|
-
send({ id, body, request, ...options }: Options$
|
|
474
|
+
send({ id, body, request, ...options }: Options$5): Promise<CreateCorrectionModelResponse>;
|
|
362
475
|
}
|
|
363
476
|
type CreateCorrectionResponsePayload = unknown;
|
|
364
477
|
declare class CreateCorrectionModelResponse {
|
|
@@ -376,13 +489,46 @@ declare class CreateCorrectionModelResponse {
|
|
|
376
489
|
* @see https://greatdetail.com
|
|
377
490
|
*/
|
|
378
491
|
|
|
379
|
-
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 {
|
|
380
526
|
request?: RequestInit;
|
|
381
527
|
}
|
|
382
528
|
declare class ListModelsRequest {
|
|
383
529
|
protected _client: Client;
|
|
384
530
|
constructor(_client: Client);
|
|
385
|
-
send({ request, ...options }?: Options$
|
|
531
|
+
send({ request, ...options }?: Options$3): Promise<ListModelsResponse>;
|
|
386
532
|
}
|
|
387
533
|
type ListModelsResponsePayload = {
|
|
388
534
|
models: {
|
|
@@ -408,7 +554,7 @@ declare class ListModelsResponse {
|
|
|
408
554
|
* @see https://greatdetail.com
|
|
409
555
|
*/
|
|
410
556
|
|
|
411
|
-
interface Options$
|
|
557
|
+
interface Options$2 extends SendOptions {
|
|
412
558
|
id: string;
|
|
413
559
|
body: z.infer<typeof CreateResponseModelRequest.SCHEMA>;
|
|
414
560
|
request?: RequestInit;
|
|
@@ -426,7 +572,7 @@ declare class CreateResponseModelRequest {
|
|
|
426
572
|
content: string | null;
|
|
427
573
|
}>, "many">;
|
|
428
574
|
constructor(_client: Client);
|
|
429
|
-
send({ id, body, request, ...options }: Options$
|
|
575
|
+
send({ id, body, request, ...options }: Options$2): Promise<CreateResponseModelResponse>;
|
|
430
576
|
}
|
|
431
577
|
type CreateResponseResponsePayload = {
|
|
432
578
|
message: string | null;
|
|
@@ -441,6 +587,39 @@ declare class CreateResponseModelResponse {
|
|
|
441
587
|
result(): Promise<CreateResponseResponsePayload>;
|
|
442
588
|
}
|
|
443
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
|
+
|
|
444
623
|
/**
|
|
445
624
|
* Great Detail Support System.
|
|
446
625
|
*
|
|
@@ -510,6 +689,7 @@ declare class Client {
|
|
|
510
689
|
list: ListChannelsRequest;
|
|
511
690
|
};
|
|
512
691
|
contact: {
|
|
692
|
+
get: GetContactRequest;
|
|
513
693
|
list: ListContactsRequest;
|
|
514
694
|
};
|
|
515
695
|
conversation: {
|
|
@@ -517,12 +697,15 @@ declare class Client {
|
|
|
517
697
|
list: ListConversationsRequest;
|
|
518
698
|
};
|
|
519
699
|
label: {
|
|
700
|
+
create: CreateLabelRequest;
|
|
701
|
+
get: GetLabelRequest;
|
|
520
702
|
list: ListLabelsRequest;
|
|
521
703
|
};
|
|
522
704
|
message: {
|
|
523
705
|
list: ListMessagesRequest;
|
|
524
706
|
};
|
|
525
707
|
model: {
|
|
708
|
+
get: GetModelRequest;
|
|
526
709
|
list: ListModelsRequest;
|
|
527
710
|
response: {
|
|
528
711
|
create: CreateResponseModelRequest;
|
|
@@ -532,10 +715,11 @@ declare class Client {
|
|
|
532
715
|
};
|
|
533
716
|
};
|
|
534
717
|
source: {
|
|
718
|
+
get: GetSourceRequest;
|
|
535
719
|
list: ListSourcesRequest;
|
|
536
720
|
};
|
|
537
721
|
protected _filterRequest(request: RequestInit): Promise<RequestInit>;
|
|
538
722
|
send(url: string | URL, request: RequestInit, { fetch: fetchAlternative }?: SendOptions): Promise<Response>;
|
|
539
723
|
}
|
|
540
724
|
|
|
541
|
-
export { Client, type CreateCorrectionResponsePayload, type CreateResponseResponsePayload, DEFAULT_SUPPORT_BASE_URL, type GetConversationResponsePayload, KeyAuthentication, type ListActionsResponsePayload, type ListChannelsResponsePayload, type ListContactsResponsePayload, type ListConversationsResponsePayload, type ListLabelsResponsePayload, type ListMessagesResponsePayload, type ListModelsResponsePayload, type ListSourcesResponsePayload, PublicAuthentication, type RequestFilterable, TokenAuthentication, Client as default };
|
|
725
|
+
export { Client, type CreateCorrectionResponsePayload, type CreateLabelResponsePayload, type CreateResponseResponsePayload, DEFAULT_SUPPORT_BASE_URL, type GetConversationResponsePayload, KeyAuthentication, type ListActionsResponsePayload, type ListChannelsResponsePayload, type ListContactsResponsePayload, type ListConversationsResponsePayload, type ListLabelsResponsePayload, type ListMessagesResponsePayload, type ListModelsResponsePayload, type ListSourcesResponsePayload, PublicAuthentication, type RequestFilterable, TokenAuthentication, Client as default };
|