@great-detail/support-sdk 0.0.5 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/README.md +59 -0
  2. package/dist/chunk-PWDTRAX2.js +1 -0
  3. package/dist/chunk-QYWS5WK5.js +1 -0
  4. package/dist/cli/index.cjs +1 -0
  5. package/dist/cli/index.d.cts +21 -0
  6. package/dist/cli/index.d.ts +21 -0
  7. package/dist/cli/index.js +1 -0
  8. package/dist/cli.cjs +1 -1
  9. package/dist/cli.js +1 -1
  10. package/dist/index-ByUz_hOL.d.cts +728 -0
  11. package/dist/index-ByUz_hOL.d.ts +728 -0
  12. package/dist/index.cjs +1 -1
  13. package/dist/index.d.cts +8 -655
  14. package/dist/index.d.ts +8 -655
  15. package/dist/index.js +1 -1
  16. package/package.json +15 -8
  17. package/src/Action/ListActions.ts +6 -2
  18. package/src/Authentication/KeyAuthentication.ts +7 -3
  19. package/src/Authentication/TokenAuthentication.ts +2 -1
  20. package/src/Authentication/index.ts +2 -1
  21. package/src/Channel/ListChannels.ts +20 -3
  22. package/src/Client/index.ts +2 -0
  23. package/src/Contact/GetContact.ts +1 -0
  24. package/src/Contact/ListContacts.ts +1 -0
  25. package/src/Conversation/GetConversation.ts +1 -0
  26. package/src/Conversation/ListConversations.ts +1 -0
  27. package/src/Conversation/UpdateConversation.ts +62 -0
  28. package/src/Label/CreateLabel.ts +1 -0
  29. package/src/Label/GetLabel.ts +1 -0
  30. package/src/Label/ListLabels.ts +1 -0
  31. package/src/Message/ListMessages.ts +7 -0
  32. package/src/Model/GetModel.ts +2 -2
  33. package/src/Model/ListModels.ts +2 -2
  34. package/src/Source/GetSource.ts +2 -1
  35. package/src/Source/ListSources.ts +2 -1
  36. package/src/__tests__/Authentication/KeyAuthentication.test.ts +79 -0
  37. package/src/__tests__/Authentication/TokenAuthentication.test.ts +79 -0
  38. package/src/cli/actions.ts +1 -1
  39. package/src/cli/channels.ts +1 -1
  40. package/src/cli/contacts.ts +1 -1
  41. package/src/cli/conversations.ts +1 -1
  42. package/src/cli/labels.ts +1 -1
  43. package/src/cli/messages.ts +1 -1
  44. package/src/cli/models.ts +1 -1
  45. package/src/cli/sources.ts +1 -1
  46. package/src/constants/index.ts +21 -0
  47. package/dist/chunk-BFO7RVLV.js +0 -1
package/README.md CHANGED
@@ -2,10 +2,69 @@
2
2
 
3
3
  ## Getting Started
4
4
 
5
+ ```typescript
6
+ // ESM
7
+
8
+ import Client, { TokenAuthentication } from "@great-detail/support-sdk";
9
+
10
+ // Note: CJS dist files are also published
11
+
12
+ const auth = new TokenAuthentication();
13
+ const sdk = new Client(auth);
14
+
15
+ // List the stored contacts
16
+ const request = await sdk.contact.list.send();
17
+ console.log(await request.result());
18
+ ```
19
+
20
+ ## Installation
21
+
5
22
  ```bash
6
23
  npm install @great-detail/support-sdk
7
24
  ```
8
25
 
26
+ ## Authentication
27
+
28
+ The following authentication methods are supported with this SDK.
29
+
30
+ ### Token Authentication
31
+
32
+ > Note: This is the primary authentication method intended to be used with this
33
+ > SDK.
34
+
35
+ ```typescript
36
+ import { TokenAuthentication } from "@great-detail/support-sdk";
37
+
38
+ // Note: This token should not be hardcoded into your use-case
39
+ process.env.SUPPORT_ACCESS_TOKEN = "...";
40
+
41
+ const auth = new TokenAuthentication();
42
+ ```
43
+
44
+ ### Key Authentication
45
+
46
+ > Note: Not all of the APIs will work with the key authentication method.
47
+
48
+ ```typescript
49
+ import { KeyAuthentication } from "@great-detail/support-sdk";
50
+
51
+ // Note: This api key should not be hardcoded into your use-case
52
+ process.env.SUPPORT_API_KEY = "...";
53
+
54
+ // Set api key in environment variable: SUPPORT_API_KEY
55
+ const auth = new KeyAuthentication();
56
+ ```
57
+
58
+ ### Public Authentication
59
+
60
+ > Note: Not all of the APIs will work with the public authentication method.
61
+
62
+ ```typescript
63
+ import { PublicAuthentication } from "@great-detail/support-sdk";
64
+
65
+ const auth = new PublicAuthentication();
66
+ ```
67
+
9
68
  ## License
10
69
 
11
70
  Proprietary © 2024 Great Detail Ltd
@@ -0,0 +1 @@
1
+ var J="https://api.support.greatdetail.com",Y={"X-Powered-By":"GDSupport/JavaScript"},W="api-key",X="SUPPORT_ACCESS_TOKEN",Q="SUPPORT_API_KEY",Z="SUPPORT_KEY_NAME";var E=class{async filter(t){return t}};var i=class{constructor(t){this._client=t}async send({request:t={},...s}={}){return this._client.send("/v1/actions",{...t,method:"GET"},s).then(n=>new w(n))}},w=class{constructor(t){this.response=t}async result(){return this.response.json()}};var p=class{constructor(t){this._client=t}async send({request:t={},...s}={}){return this._client.send("/v1/channels",{...t,method:"GET"},s).then(n=>new q(n))}},q=class{constructor(t){this.response=t}async result(){return this.response.json()}};var c=class{constructor(t){this._client=t}async send({request:t={},...s}={}){return this._client.send("/v1/contacts",{...t,method:"GET"},s).then(n=>new T(n))}},T=class{constructor(t){this.response=t}async result(){return this.response.json()}};var a=class{constructor(t){this._client=t}async send({id:t,request:s={},...n}){return this._client.send("/v1/conversations/"+encodeURIComponent(t),{...s,method:"GET"},n).then(r=>new I(r))}},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={},...s}={}){return this._client.send("/v1/conversations",{...t,method:"GET"},s).then(n=>new v(n))}},v=class{constructor(t){this.response=t}async result(){return this.response.json()}};import{z as d}from"zod";var u=class e{constructor(t){this._client=t}static SCHEMA=d.object({title:d.string(),description:d.optional(d.string()),account:d.string()});async send({body:t,request:s={},...n}){return this._client.send("/v1/labels",{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(t))},n).then(r=>new U(r))}},U=class{constructor(t){this.response=t}async result(){return this.response.json()}};var m=class{constructor(t){this._client=t}async send({request:t={},...s}={}){return this._client.send("/v1/labels",{...t,method:"GET"},s).then(n=>new L(n))}},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={},...s}={}){return this._client.send("/v1/messages",{...t,method:"GET"},s).then(n=>new j(n))}},j=class{constructor(t){this.response=t}async result(){return this.response.json()}};import{z as P}from"zod";var h=class e{constructor(t){this._client=t}static SCHEMA=P.object({input:P.string().max(65536),original:P.string().max(65536),correction:P.string().max(65536)});async send({id:t,body:s,request:n={},...r}){return this._client.send("/v1/models/"+encodeURIComponent(t)+"/correction",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))},r).then(o=>new D(o))}},D=class{constructor(t){this.response=t}async result(){return this.response.json()}};var b=class{constructor(t){this._client=t}async send({request:t={},...s}={}){return this._client.send("/v1/models",{...t,method:"GET"},s).then(n=>new N(n))}},N=class{constructor(t){this.response=t}async result(){return this.response.json()}};import{z as _}from"zod";var y=class e{constructor(t){this._client=t}static SCHEMA=_.array(_.object({role:_.enum(["user","assistant"]),content:_.string().max(65536).nullable()})).min(1);async send({id:t,body:s,request:n={},...r}){return this._client.send("/v1/models/"+encodeURIComponent(t)+"/response",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))},r).then(o=>new G(o))}},G=class{constructor(t){this.response=t}async result(){return this.response.json()}};var f=class{constructor(t){this._client=t}async send({request:t={},...s}={}){return this._client.send("/v1/sources",{...t,method:"GET"},s).then(n=>new H(n))}},H=class{constructor(t){this.response=t}async result(){return this.response.json()}};var R=class{constructor(t){this._client=t}async send({id:t,request:s={},...n}){return this._client.send("/v1/contacts/"+encodeURIComponent(t),{...s,method:"GET"},n).then(r=>new M(r))}},M=class{constructor(t){this.response=t}async result(){return this.response.json()}};import{z as k}from"zod";var x=class e{constructor(t){this._client=t}static SCHEMA=k.object({hasEnded:k.boolean()});async send({id:t,body:s,request:n={},...r}){return this._client.send("/v1/conversations/"+encodeURIComponent(t),{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},body:JSON.stringify(e.SCHEMA.parse(s))},r).then(o=>new F(o))}},F=class{constructor(t){this.response=t}async result(){return this.response.json()}};var O=class{constructor(t){this._client=t}async send({id:t,request:s={},...n}){return this._client.send("/v1/labels/"+encodeURIComponent(t),{...s,method:"GET"},n).then(r=>new z(r))}},z=class{constructor(t){this.response=t}async result(){return this.response.json()}};var S=class{constructor(t){this._client=t}async send({id:t,request:s={},...n}){return this._client.send("/v1/models/"+encodeURIComponent(t),{...s,method:"GET"},n).then(r=>new K(r))}},K=class{constructor(t){this.response=t}async result(){return this.response.json()}};var C=class e{constructor(t=e.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=Y;async filter(t){return{...t,headers:{...t.headers,...this._standardHeaders}}}};var A=class{constructor(t){this._client=t}async send({id:t,request:s={},...n}){return this._client.send("/v1/sources/"+encodeURIComponent(t),{...s,method:"GET"},n).then(r=>new B(r))}},B=class{constructor(t){this.response=t}async result(){return this.response.json()}};var V=class e{static DEFAULT_BASE_URL=J;options;constructor(t,s={}){this.options={requestFilterables:[new C,t],baseURL:process.env.SUPPORT_BASE_URL??e.DEFAULT_BASE_URL,...s}}action={list:new i(this)};channel={list:new p(this)};contact={get:new R(this),list:new c(this)};conversation={get:new a(this),list:new l(this),update:new x(this)};label={create:new u(this),get:new O(this),list:new m(this)};message={list:new g(this)};model={get:new S(this),list:new b(this),response:{create:new y(this)},correction:{create:new h(this)}};source={get:new A(this),list:new f(this)};async _filterRequest(t){for(let s of this.options.requestFilterables)t=await s.filter(t);return t}async send(t,s,{fetch:n=fetch}={}){return await n(new Request(new URL(t,this.options.baseURL),await this._filterRequest(s)))}};export{J as a,W as b,X as c,Q as d,Z as e,E as f,V as g};
@@ -0,0 +1 @@
1
+ import{f as x,g as y}from"./chunk-PWDTRAX2.js";import{Command as A}from"commander";import{Command as F}from"commander";import{oraPromise as I}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 I(()=>n.action.list.send(),{...s,text:"Finding actions"});console.log(await t.result())})),o}import{Command as b}from"commander";import{oraPromise as S}from"ora";function m({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 S(()=>n.channel.list.send(),{...s,text:"Finding channels"});console.log(await t.result())})),o}import{Command as r}from"commander";import{oraPromise as v}from"ora";function d({client:n,ora:s}){let o=new r("contacts").description("Contacts");return o.addCommand(new r("get").description("Find contact").argument("<contact>","Contact ID").action(async t=>{let i=await v(()=>n.contact.get.send({id:t}),{...s,text:"Finding contact"});console.log(await i.result())})),o.addCommand(new r("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 i=await L(()=>n.conversation.get.send({id:t}),{...s,text:"Finding conversation"});console.log(await i.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 i=await P(()=>n.label.get.send({id:t}),{...s,text:"Finding label"});console.log(await i.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 i=await j(()=>n.model.get.send({id:t}),{...s,text:"Finding model"});console.log(await i.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 O({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 i=await D(()=>n.source.get.send({id:t}),{...s,text:"Finding source"});console.log(await i.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 e={ora:{spinner:"simpleDotsScrolling"},client:new y(new x)},G=new A("gds").description("Great Detail Support System").addCommand(a(e)).addCommand(m(e)).addCommand(d(e)).addCommand(p(e)).addCommand(u(e)).addCommand(f(e)).addCommand(g(e)).addCommand(O(e)),go=G;export{go as a};
@@ -0,0 +1 @@
1
+ "use strict";var U=Object.defineProperty;var Rt=Object.getOwnPropertyDescriptor;var wt=Object.getOwnPropertyNames;var St=Object.prototype.hasOwnProperty;var At=(n,t)=>{for(var e in t)U(n,e,{get:t[e],enumerable:!0})},Pt=(n,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of wt(t))!St.call(n,o)&&o!==e&&U(n,o,{get:()=>t[o],enumerable:!(s=Rt(t,o))||s.enumerable});return n};var _t=n=>Pt(U({},"__esModule",{value:!0}),n);var vt={};At(vt,{default:()=>qt});module.exports=_t(vt);var bt=require("commander");var p=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(s=>new D(s))}},D=class{constructor(t){this.response=t}async result(){return this.response.json()}};var d=class{constructor(t){this._client=t}async send({request:t={},...e}={}){return this._client.send("/v1/channels",{...t,method:"GET"},e).then(s=>new F(s))}},F=class{constructor(t){this.response=t}async result(){return this.response.json()}};var yt="https://api.support.greatdetail.com",xt={"X-Powered-By":"GDSupport/JavaScript"};var l=class{constructor(t){this._client=t}async send({id:t,request:e={},...s}){return this._client.send("/v1/contacts/"+encodeURIComponent(t),{...e,method:"GET"},s).then(o=>new G(o))}},G=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/contacts",{...t,method:"GET"},e).then(s=>new M(s))}},M=class{constructor(t){this.response=t}async result(){return this.response.json()}};var u=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 N(o))}},N=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/conversations",{...t,method:"GET"},e).then(s=>new H(s))}},H=class{constructor(t){this.response=t}async result(){return this.response.json()}};var z=require("zod"),f=class n{constructor(t){this._client=t}static SCHEMA=z.z.object({hasEnded:z.z.boolean()});async send({id:t,body:e,request:s={},...o}){return this._client.send("/v1/conversations/"+encodeURIComponent(t),{...s,method:"POST",headers:{...s.headers,"Content-Type":"application/json"},body:JSON.stringify(n.SCHEMA.parse(e))},o).then(a=>new K(a))}},K=class{constructor(t){this.response=t}async result(){return this.response.json()}};var r=require("zod"),y=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 B(o))}},B=class{constructor(t){this.response=t}async result(){return this.response.json()}};var x=class{constructor(t){this._client=t}async send({id:t,request:e={},...s}){return this._client.send("/v1/labels/"+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 O=class{constructor(t){this._client=t}async send({request:t={},...e}={}){return this._client.send("/v1/labels",{...t,method:"GET"},e).then(s=>new J(s))}},J=class{constructor(t){this.response=t}async result(){return this.response.json()}};var h=class{constructor(t){this._client=t}async send({request:t={},...e}={}){return this._client.send("/v1/messages",{...t,method:"GET"},e).then(s=>new Y(s))}},Y=class{constructor(t){this.response=t}async result(){return this.response.json()}};var C=require("zod"),b=class n{constructor(t){this._client=t}static SCHEMA=C.z.object({input:C.z.string().max(65536),original:C.z.string().max(65536),correction:C.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 k(a))}},k=class{constructor(t){this.response=t}async result(){return this.response.json()}};var R=class{constructor(t){this._client=t}async send({id:t,request:e={},...s}){return this._client.send("/v1/models/"+encodeURIComponent(t),{...e,method:"GET"},s).then(o=>new W(o))}},W=class{constructor(t){this.response=t}async result(){return this.response.json()}};var w=class{constructor(t){this._client=t}async send({request:t={},...e}={}){return this._client.send("/v1/models",{...t,method:"GET"},e).then(s=>new X(s))}},X=class{constructor(t){this.response=t}async result(){return this.response.json()}};var S=require("zod"),A=class n{constructor(t){this._client=t}static SCHEMA=S.z.array(S.z.object({role:S.z.enum(["user","assistant"]),content:S.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 Q(a))}},Q=class{constructor(t){this.response=t}async result(){return this.response.json()}};var P=class n{constructor(t=n.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=xt;async filter(t){return{...t,headers:{...t.headers,...this._standardHeaders}}}};var _=class{constructor(t){this._client=t}async send({id:t,request:e={},...s}){return this._client.send("/v1/sources/"+encodeURIComponent(t),{...e,method:"GET"},s).then(o=>new Z(o))}},Z=class{constructor(t){this.response=t}async result(){return this.response.json()}};var E=class{constructor(t){this._client=t}async send({request:t={},...e}={}){return this._client.send("/v1/sources",{...t,method:"GET"},e).then(s=>new $(s))}},$=class{constructor(t){this.response=t}async result(){return this.response.json()}};var q=class n{static DEFAULT_BASE_URL=yt;options;constructor(t,e={}){this.options={requestFilterables:[new P,t],baseURL:process.env.SUPPORT_BASE_URL??n.DEFAULT_BASE_URL,...e}}action={list:new c(this)};channel={list:new d(this)};contact={get:new l(this),list:new m(this)};conversation={get:new u(this),list:new g(this),update:new f(this)};label={create:new y(this),get:new x(this),list:new O(this)};message={list:new h(this)};model={get:new R(this),list:new w(this),response:{create:new A(this)},correction:{create:new b(this)}};source={get:new _(this),list:new E(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 tt=require("commander"),Ot=require("ora");function et({client:n,ora:t}){let e=new tt.Command("actions").description("Actions");return e.addCommand(new tt.Command("list").description("List actions").action(async()=>{let s=await(0,Ot.oraPromise)(()=>n.action.list.send(),{...t,text:"Finding actions"});console.log(await s.result())})),e}var nt=require("commander"),ht=require("ora");function st({client:n,ora:t}){let e=new nt.Command("channels").description("Channels");return e.addCommand(new nt.Command("list").description("List channels").action(async()=>{let s=await(0,ht.oraPromise)(()=>n.channel.list.send(),{...t,text:"Finding channels"});console.log(await s.result())})),e}var v=require("commander"),ot=require("ora");function it({client:n,ora:t}){let e=new v.Command("contacts").description("Contacts");return e.addCommand(new v.Command("get").description("Find contact").argument("<contact>","Contact ID").action(async s=>{let o=await(0,ot.oraPromise)(()=>n.contact.get.send({id:s}),{...t,text:"Finding contact"});console.log(await o.result())})),e.addCommand(new v.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 I=require("commander"),rt=require("ora");function at({client:n,ora:t}){let e=new I.Command("conversations").description("Conversations");return e.addCommand(new I.Command("get").description("Find conversation").argument("<conversation>","Conversation ID").action(async s=>{let o=await(0,rt.oraPromise)(()=>n.conversation.get.send({id:s}),{...t,text:"Finding conversation"});console.log(await o.result())})),e.addCommand(new I.Command("list").description("List conversations").action(async()=>{let s=await(0,rt.oraPromise)(()=>n.conversation.list.send(),{...t,text:"Finding conversations"});console.log(await s.result())})),e}var T=require("commander"),pt=require("ora");function ct({client:n,ora:t}){let e=new T.Command("labels").description("Labels");return e.addCommand(new T.Command("get").description("Find label").argument("<label>","Label ID").action(async s=>{let o=await(0,pt.oraPromise)(()=>n.label.get.send({id:s}),{...t,text:"Finding label"});console.log(await o.result())})),e.addCommand(new T.Command("list").description("List labels").action(async()=>{let s=await(0,pt.oraPromise)(()=>n.label.list.send(),{...t,text:"Finding labels"});console.log(await s.result())})),e}var dt=require("commander"),Ct=require("ora");function lt({client:n,ora:t}){let e=new dt.Command("messages").description("Messages");return e.addCommand(new dt.Command("list").description("List messages").action(async()=>{let s=await(0,Ct.oraPromise)(()=>n.message.list.send(),{...t,text:"Finding messages"});console.log(await s.result())})),e}var L=require("commander"),mt=require("ora");function ut({client:n,ora:t}){let e=new L.Command("models").description("Models");return e.addCommand(new L.Command("get").description("Find model").argument("<model>","Model ID").action(async s=>{let o=await(0,mt.oraPromise)(()=>n.model.get.send({id:s}),{...t,text:"Finding model"});console.log(await o.result())})),e.addCommand(new L.Command("list").description("List models").action(async()=>{let s=await(0,mt.oraPromise)(()=>n.model.list.send(),{...t,text:"Finding models"});console.log(await s.result())})),e}var j=require("commander"),gt=require("ora");function ft({client:n,ora:t}){let e=new j.Command("sources").description("Sources");return e.addCommand(new j.Command("get").description("Find source").argument("<source>","Source ID").action(async s=>{let o=await(0,gt.oraPromise)(()=>n.source.get.send({id:s}),{...t,text:"Finding source"});console.log(await o.result())})),e.addCommand(new j.Command("list").description("List sources").action(async()=>{let s=await(0,gt.oraPromise)(()=>n.source.list.send(),{...t,text:"Finding sources"});console.log(await s.result())})),e}var i={ora:{spinner:"simpleDotsScrolling"},client:new q(new p)},Et=new bt.Command("gds").description("Great Detail Support System").addCommand(et(i)).addCommand(st(i)).addCommand(it(i)).addCommand(at(i)).addCommand(ct(i)).addCommand(lt(i)).addCommand(ut(i)).addCommand(ft(i)),qt=Et;
@@ -0,0 +1,21 @@
1
+ import { Command } from 'commander';
2
+ import { C as Client } from '../index-ByUz_hOL.cjs';
3
+ import { Options as Options$1 } from 'ora';
4
+ import 'zod';
5
+
6
+ /**
7
+ * Great Detail Support System.
8
+ *
9
+ * @copyright 2024 Great Detail Ltd
10
+ * @author Great Detail Ltd <info@greatdetail.com>
11
+ * @author Dom Webber <dom.webber@greatdetail.com>
12
+ * @see https://greatdetail.com
13
+ */
14
+
15
+ interface Options {
16
+ client: Client;
17
+ ora: Options$1;
18
+ }
19
+ declare const cli: Command;
20
+
21
+ export { type Options, cli as default };
@@ -0,0 +1,21 @@
1
+ import { Command } from 'commander';
2
+ import { C as Client } from '../index-ByUz_hOL.js';
3
+ import { Options as Options$1 } from 'ora';
4
+ import 'zod';
5
+
6
+ /**
7
+ * Great Detail Support System.
8
+ *
9
+ * @copyright 2024 Great Detail Ltd
10
+ * @author Great Detail Ltd <info@greatdetail.com>
11
+ * @author Dom Webber <dom.webber@greatdetail.com>
12
+ * @see https://greatdetail.com
13
+ */
14
+
15
+ interface Options {
16
+ client: Client;
17
+ ora: Options$1;
18
+ }
19
+ declare const cli: Command;
20
+
21
+ export { type Options, cli as default };
@@ -0,0 +1 @@
1
+ import{a}from"../chunk-QYWS5WK5.js";import"../chunk-PWDTRAX2.js";export{a as default};
package/dist/cli.cjs CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
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);
2
+ "use strict";var Ct=require("commander");var p=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 U(n))}},U=class{constructor(t){this.response=t}async result(){return this.response.json()}};var d=class{constructor(t){this._client=t}async send({request:t={},...e}={}){return this._client.send("/v1/channels",{...t,method:"GET"},e).then(n=>new D(n))}},D=class{constructor(t){this.response=t}async result(){return this.response.json()}};var ft="https://api.support.greatdetail.com",yt={"X-Powered-By":"GDSupport/JavaScript"};var l=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 F(o))}},F=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/contacts",{...t,method:"GET"},e).then(n=>new G(n))}},G=class{constructor(t){this.response=t}async result(){return this.response.json()}};var u=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 M(o))}},M=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/conversations",{...t,method:"GET"},e).then(n=>new N(n))}},N=class{constructor(t){this.response=t}async result(){return this.response.json()}};var H=require("zod"),f=class s{constructor(t){this._client=t}static SCHEMA=H.z.object({hasEnded:H.z.boolean()});async send({id:t,body:e,request:n={},...o}){return this._client.send("/v1/conversations/"+encodeURIComponent(t),{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},body:JSON.stringify(s.SCHEMA.parse(e))},o).then(a=>new z(a))}},z=class{constructor(t){this.response=t}async result(){return this.response.json()}};var r=require("zod"),y=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 K(o))}},K=class{constructor(t){this.response=t}async result(){return this.response.json()}};var x=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 B(o))}},B=class{constructor(t){this.response=t}async result(){return this.response.json()}};var O=class{constructor(t){this._client=t}async send({request:t={},...e}={}){return this._client.send("/v1/labels",{...t,method:"GET"},e).then(n=>new V(n))}},V=class{constructor(t){this.response=t}async result(){return this.response.json()}};var h=class{constructor(t){this._client=t}async send({request:t={},...e}={}){return this._client.send("/v1/messages",{...t,method:"GET"},e).then(n=>new J(n))}},J=class{constructor(t){this.response=t}async result(){return this.response.json()}};var C=require("zod"),b=class s{constructor(t){this._client=t}static SCHEMA=C.z.object({input:C.z.string().max(65536),original:C.z.string().max(65536),correction:C.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(a=>new Y(a))}},Y=class{constructor(t){this.response=t}async result(){return this.response.json()}};var R=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 k(o))}},k=class{constructor(t){this.response=t}async result(){return this.response.json()}};var w=class{constructor(t){this._client=t}async send({request:t={},...e}={}){return this._client.send("/v1/models",{...t,method:"GET"},e).then(n=>new W(n))}},W=class{constructor(t){this.response=t}async result(){return this.response.json()}};var S=require("zod"),A=class s{constructor(t){this._client=t}static SCHEMA=S.z.array(S.z.object({role:S.z.enum(["user","assistant"]),content:S.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(a=>new X(a))}},X=class{constructor(t){this.response=t}async result(){return this.response.json()}};var P=class s{constructor(t=s.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=yt;async filter(t){return{...t,headers:{...t.headers,...this._standardHeaders}}}};var _=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 Q(o))}},Q=class{constructor(t){this.response=t}async result(){return this.response.json()}};var E=class{constructor(t){this._client=t}async send({request:t={},...e}={}){return this._client.send("/v1/sources",{...t,method:"GET"},e).then(n=>new Z(n))}},Z=class{constructor(t){this.response=t}async result(){return this.response.json()}};var v=class s{static DEFAULT_BASE_URL=ft;options;constructor(t,e={}){this.options={requestFilterables:[new P,t],baseURL:process.env.SUPPORT_BASE_URL??s.DEFAULT_BASE_URL,...e}}action={list:new c(this)};channel={list:new d(this)};contact={get:new l(this),list:new m(this)};conversation={get:new u(this),list:new g(this),update:new f(this)};label={create:new y(this),get:new x(this),list:new O(this)};message={list:new h(this)};model={get:new R(this),list:new w(this),response:{create:new A(this)},correction:{create:new b(this)}};source={get:new _(this),list:new E(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 $=require("commander"),xt=require("ora");function tt({client:s,ora:t}){let e=new $.Command("actions").description("Actions");return e.addCommand(new $.Command("list").description("List actions").action(async()=>{let n=await(0,xt.oraPromise)(()=>s.action.list.send(),{...t,text:"Finding actions"});console.log(await n.result())})),e}var et=require("commander"),Ot=require("ora");function nt({client:s,ora:t}){let e=new et.Command("channels").description("Channels");return e.addCommand(new et.Command("list").description("List channels").action(async()=>{let n=await(0,Ot.oraPromise)(()=>s.channel.list.send(),{...t,text:"Finding channels"});console.log(await n.result())})),e}var q=require("commander"),st=require("ora");function ot({client:s,ora:t}){let e=new q.Command("contacts").description("Contacts");return e.addCommand(new q.Command("get").description("Find contact").argument("<contact>","Contact ID").action(async n=>{let o=await(0,st.oraPromise)(()=>s.contact.get.send({id:n}),{...t,text:"Finding contact"});console.log(await o.result())})),e.addCommand(new q.Command("list").description("List contacts").action(async()=>{let n=await(0,st.oraPromise)(()=>s.contact.list.send(),{...t,text:"Finding contacts"});console.log(await n.result())})),e}var I=require("commander"),it=require("ora");function rt({client:s,ora:t}){let e=new I.Command("conversations").description("Conversations");return e.addCommand(new I.Command("get").description("Find conversation").argument("<conversation>","Conversation ID").action(async n=>{let o=await(0,it.oraPromise)(()=>s.conversation.get.send({id:n}),{...t,text:"Finding conversation"});console.log(await o.result())})),e.addCommand(new I.Command("list").description("List conversations").action(async()=>{let n=await(0,it.oraPromise)(()=>s.conversation.list.send(),{...t,text:"Finding conversations"});console.log(await n.result())})),e}var T=require("commander"),at=require("ora");function pt({client:s,ora:t}){let e=new T.Command("labels").description("Labels");return e.addCommand(new T.Command("get").description("Find label").argument("<label>","Label ID").action(async n=>{let o=await(0,at.oraPromise)(()=>s.label.get.send({id:n}),{...t,text:"Finding label"});console.log(await o.result())})),e.addCommand(new T.Command("list").description("List labels").action(async()=>{let n=await(0,at.oraPromise)(()=>s.label.list.send(),{...t,text:"Finding labels"});console.log(await n.result())})),e}var ct=require("commander"),ht=require("ora");function dt({client:s,ora:t}){let e=new ct.Command("messages").description("Messages");return e.addCommand(new ct.Command("list").description("List messages").action(async()=>{let n=await(0,ht.oraPromise)(()=>s.message.list.send(),{...t,text:"Finding messages"});console.log(await n.result())})),e}var L=require("commander"),lt=require("ora");function mt({client:s,ora:t}){let e=new L.Command("models").description("Models");return e.addCommand(new L.Command("get").description("Find model").argument("<model>","Model ID").action(async n=>{let o=await(0,lt.oraPromise)(()=>s.model.get.send({id:n}),{...t,text:"Finding model"});console.log(await o.result())})),e.addCommand(new L.Command("list").description("List models").action(async()=>{let n=await(0,lt.oraPromise)(()=>s.model.list.send(),{...t,text:"Finding models"});console.log(await n.result())})),e}var j=require("commander"),ut=require("ora");function gt({client:s,ora:t}){let e=new j.Command("sources").description("Sources");return e.addCommand(new j.Command("get").description("Find source").argument("<source>","Source ID").action(async n=>{let o=await(0,ut.oraPromise)(()=>s.source.get.send({id:n}),{...t,text:"Finding source"});console.log(await o.result())})),e.addCommand(new j.Command("list").description("List sources").action(async()=>{let n=await(0,ut.oraPromise)(()=>s.source.list.send(),{...t,text:"Finding sources"});console.log(await n.result())})),e}var i={ora:{spinner:"simpleDotsScrolling"},client:new v(new p)},Rt=new Ct.Command("gds").description("Great Detail Support System").addCommand(tt(i)).addCommand(nt(i)).addCommand(ot(i)).addCommand(rt(i)).addCommand(pt(i)).addCommand(dt(i)).addCommand(mt(i)).addCommand(gt(i)),bt=Rt;bt.parseAsync(process.argv);
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
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);
2
+ import{a as r}from"./chunk-QYWS5WK5.js";import"./chunk-PWDTRAX2.js";r.parseAsync(process.argv);