@great-detail/support-sdk
Advanced tools
Comparing version 0.0.2 to 0.0.3
#!/usr/bin/env node | ||
import{c as u,d as C}from"./chunk-ZLBEVMCE.js";import{Command as I}from"commander";import{Command as O}from"commander";import{oraPromise as h}from"ora";function e({client:n,ora:s}){let o=new O("actions").description("Actions");return o.addCommand(new O("list").description("List actions").action(async()=>{let t=await h(()=>n.action.list.send(),{...s,text:"Finding actions"});console.log(await t.result())})),o}import{Command as x}from"commander";import{oraPromise as j}from"ora";function a({client:n,ora:s}){let o=new x("channels").description("Channels");return o.addCommand(new x("list").description("List channels").action(async()=>{let t=await j(()=>n.channel.list.send(),{...s,text:"Finding channels"});console.log(await t.result())})),o}import{Command as w}from"commander";import{oraPromise as S}from"ora";function r({client:n,ora:s}){let o=new w("contacts").description("Contacts");return o.addCommand(new w("list").description("List contacts").action(async()=>{let t=await S(()=>n.contact.list.send(),{...s,text:"Finding contacts"});console.log(await t.result())})),o}import{Command as m}from"commander";import{oraPromise as g}from"ora";function d({client:n,ora:s}){let o=new m("conversations").description("Conversations");return o.addCommand(new m("get").description("Find conversation").argument("<conversation>","Conversation ID").action(async t=>{let P=await g(()=>n.conversation.get.send({id:t}),{...s,text:"Finding conversation"});console.log(await P.result())})),o.addCommand(new m("list").description("List conversations").action(async()=>{let t=await g(()=>n.conversation.list.send(),{...s,text:"Finding conversations"});console.log(await t.result())})),o}import{Command as y}from"commander";import{oraPromise as A}from"ora";function c({client:n,ora:s}){let o=new y("labels").description("Labels");return o.addCommand(new y("list").description("List labels").action(async()=>{let t=await A(()=>n.label.list.send(),{...s,text:"Finding labels"});console.log(await t.result())})),o}import{Command as v}from"commander";import{oraPromise as D}from"ora";function p({client:n,ora:s}){let o=new v("messages").description("Messages");return o.addCommand(new v("list").description("List messages").action(async()=>{let t=await D(()=>n.message.list.send(),{...s,text:"Finding messages"});console.log(await t.result())})),o}import{Command as F}from"commander";import{oraPromise as M}from"ora";function l({client:n,ora:s}){let o=new F("models").description("Models");return o.addCommand(new F("list").description("List models").action(async()=>{let t=await M(()=>n.model.list.send(),{...s,text:"Finding models"});console.log(await t.result())})),o}import{Command as b}from"commander";import{oraPromise as G}from"ora";function f({client:n,ora:s}){let o=new b("sources").description("Sources");return o.addCommand(new b("list").description("List sources").action(async()=>{let t=await G(()=>n.source.list.send(),{...s,text:"Finding sources"});console.log(await t.result())})),o}var i={ora:{spinner:"simpleDotsScrolling"},client:new C(new u)},k=new I("gds").description("Great Detail Support System").addCommand(e(i)).addCommand(a(i)).addCommand(r(i)).addCommand(d(i)).addCommand(c(i)).addCommand(p(i)).addCommand(l(i)).addCommand(f(i)),L=k;L.parseAsync(process.argv); | ||
import{c as u,d as C}from"./chunk-LS7DRWDS.js";import{Command as I}from"commander";import{Command as O}from"commander";import{oraPromise as h}from"ora";function e({client:n,ora:s}){let o=new O("actions").description("Actions");return o.addCommand(new O("list").description("List actions").action(async()=>{let t=await h(()=>n.action.list.send(),{...s,text:"Finding actions"});console.log(await t.result())})),o}import{Command as x}from"commander";import{oraPromise as j}from"ora";function a({client:n,ora:s}){let o=new x("channels").description("Channels");return o.addCommand(new x("list").description("List channels").action(async()=>{let t=await j(()=>n.channel.list.send(),{...s,text:"Finding channels"});console.log(await t.result())})),o}import{Command as w}from"commander";import{oraPromise as S}from"ora";function r({client:n,ora:s}){let o=new w("contacts").description("Contacts");return o.addCommand(new w("list").description("List contacts").action(async()=>{let t=await S(()=>n.contact.list.send(),{...s,text:"Finding contacts"});console.log(await t.result())})),o}import{Command as m}from"commander";import{oraPromise as g}from"ora";function d({client:n,ora:s}){let o=new m("conversations").description("Conversations");return o.addCommand(new m("get").description("Find conversation").argument("<conversation>","Conversation ID").action(async t=>{let P=await g(()=>n.conversation.get.send({id:t}),{...s,text:"Finding conversation"});console.log(await P.result())})),o.addCommand(new m("list").description("List conversations").action(async()=>{let t=await g(()=>n.conversation.list.send(),{...s,text:"Finding conversations"});console.log(await t.result())})),o}import{Command as y}from"commander";import{oraPromise as A}from"ora";function c({client:n,ora:s}){let o=new y("labels").description("Labels");return o.addCommand(new y("list").description("List labels").action(async()=>{let t=await A(()=>n.label.list.send(),{...s,text:"Finding labels"});console.log(await t.result())})),o}import{Command as v}from"commander";import{oraPromise as D}from"ora";function p({client:n,ora:s}){let o=new v("messages").description("Messages");return o.addCommand(new v("list").description("List messages").action(async()=>{let t=await D(()=>n.message.list.send(),{...s,text:"Finding messages"});console.log(await t.result())})),o}import{Command as F}from"commander";import{oraPromise as M}from"ora";function l({client:n,ora:s}){let o=new F("models").description("Models");return o.addCommand(new F("list").description("List models").action(async()=>{let t=await M(()=>n.model.list.send(),{...s,text:"Finding models"});console.log(await t.result())})),o}import{Command as b}from"commander";import{oraPromise as G}from"ora";function f({client:n,ora:s}){let o=new b("sources").description("Sources");return o.addCommand(new b("list").description("List sources").action(async()=>{let t=await G(()=>n.source.list.send(),{...s,text:"Finding sources"});console.log(await t.result())})),o}var i={ora:{spinner:"simpleDotsScrolling"},client:new C(new u)},k=new I("gds").description("Great Detail Support System").addCommand(e(i)).addCommand(a(i)).addCommand(r(i)).addCommand(d(i)).addCommand(c(i)).addCommand(p(i)).addCommand(l(i)).addCommand(f(i)),L=k;L.parseAsync(process.argv); |
@@ -117,3 +117,3 @@ import { z } from 'zod'; | ||
} | ||
type ListResponse$9 = { | ||
type ListActionsResponsePayload = { | ||
actions: { | ||
@@ -131,3 +131,3 @@ id: string; | ||
constructor(response: Response); | ||
result(): Promise<ListResponse$9>; | ||
result(): Promise<ListActionsResponsePayload>; | ||
} | ||
@@ -152,3 +152,3 @@ | ||
} | ||
type ListResponse$8 = { | ||
type ListChannelsResponsePayload = { | ||
channels: { | ||
@@ -166,3 +166,3 @@ id: string; | ||
constructor(response: Response); | ||
result(): Promise<ListResponse$8>; | ||
result(): Promise<ListChannelsResponsePayload>; | ||
} | ||
@@ -187,3 +187,3 @@ | ||
} | ||
type ListResponse$7 = { | ||
type ListContactsResponsePayload = { | ||
contacts: { | ||
@@ -201,3 +201,3 @@ id: string; | ||
constructor(response: Response); | ||
result(): Promise<ListResponse$7>; | ||
result(): Promise<ListContactsResponsePayload>; | ||
} | ||
@@ -223,3 +223,3 @@ | ||
} | ||
type GetResponse = { | ||
type GetConversationResponsePayload = { | ||
conversation: { | ||
@@ -236,3 +236,3 @@ id: string; | ||
constructor(response: Response); | ||
result(): Promise<GetResponse>; | ||
result(): Promise<GetConversationResponsePayload>; | ||
} | ||
@@ -257,3 +257,3 @@ | ||
} | ||
type ListResponse$6 = { | ||
type ListConversationsResponsePayload = { | ||
conversations: { | ||
@@ -270,3 +270,3 @@ id: string; | ||
constructor(response: Response); | ||
result(): Promise<ListResponse$6>; | ||
result(): Promise<ListConversationsResponsePayload>; | ||
} | ||
@@ -291,3 +291,3 @@ | ||
} | ||
type ListResponse$5 = { | ||
type ListLabelsResponsePayload = { | ||
labels: { | ||
@@ -304,3 +304,3 @@ id: string; | ||
constructor(response: Response); | ||
result(): Promise<ListResponse$5>; | ||
result(): Promise<ListLabelsResponsePayload>; | ||
} | ||
@@ -325,3 +325,3 @@ | ||
} | ||
type ListResponse$4 = { | ||
type ListMessagesResponsePayload = { | ||
messages: { | ||
@@ -341,3 +341,3 @@ id: string; | ||
constructor(response: Response); | ||
result(): Promise<ListResponse$4>; | ||
result(): Promise<ListMessagesResponsePayload>; | ||
} | ||
@@ -377,7 +377,7 @@ | ||
} | ||
type ListResponse$3 = unknown; | ||
type CreateCorrectionResponsePayload = unknown; | ||
declare class CreateCorrectionModelResponse { | ||
response: Response; | ||
constructor(response: Response); | ||
result(): Promise<ListResponse$3>; | ||
result(): Promise<CreateCorrectionResponsePayload>; | ||
} | ||
@@ -402,3 +402,3 @@ | ||
} | ||
type ListResponse$2 = { | ||
type ListModelsResponsePayload = { | ||
models: { | ||
@@ -415,3 +415,3 @@ id: string; | ||
constructor(response: Response); | ||
result(): Promise<ListResponse$2>; | ||
result(): Promise<ListModelsResponsePayload>; | ||
} | ||
@@ -448,3 +448,3 @@ | ||
} | ||
type ListResponse$1 = { | ||
type CreateResponseResponsePayload = { | ||
message: string | null; | ||
@@ -459,3 +459,3 @@ debug: { | ||
constructor(response: Response); | ||
result(): Promise<ListResponse$1>; | ||
result(): Promise<CreateResponseResponsePayload>; | ||
} | ||
@@ -480,3 +480,3 @@ | ||
} | ||
type ListResponse = { | ||
type ListSourcesResponsePayload = { | ||
sources: { | ||
@@ -493,3 +493,3 @@ id: string; | ||
constructor(response: Response); | ||
result(): Promise<ListResponse>; | ||
result(): Promise<ListSourcesResponsePayload>; | ||
} | ||
@@ -562,2 +562,2 @@ | ||
export { Client, DEFAULT_SUPPORT_BASE_URL, KeyAuthentication, PublicAuthentication, type RequestFilterable, TokenAuthentication, Client as default }; | ||
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 }; |
@@ -1,1 +0,1 @@ | ||
import{a,b as o,c as u,d as s}from"./chunk-ZLBEVMCE.js";var e=class r{static DEFAULT_NAME=o;name;#t;constructor({name:t=process.env.SUPPORT_KEY_NAME??r.DEFAULT_NAME,key:n=process.env.SUPPORT_API_KEY}={}){if(!n)throw new Error("API Key option must be specified when using Key Authentication");this.name=t,this.#t=n}async filter(t){return{...t,headers:{...t.headers,Authorization:`Basic ${btoa(this.name+":"+this.#t)}`}}}};var i=class{#t;constructor({token:t=process.env.SUPPORT_ACCESS_TOKEN}={}){if(!t)throw new Error("Access Token option must be specified when using Token Authentication");this.#t=t}async filter(t){return{...t,headers:{...t.headers,Authorization:`Bearer ${this.#t}`}}}};export{s as Client,a as DEFAULT_SUPPORT_BASE_URL,e as KeyAuthentication,u as PublicAuthentication,i as TokenAuthentication,s as default}; | ||
import{a,b as i,c as p,d as n}from"./chunk-LS7DRWDS.js";var t=class s{static DEFAULT_NAME=i;name;#e;constructor({name:e=process.env.SUPPORT_KEY_NAME??s.DEFAULT_NAME,key:r=process.env.SUPPORT_API_KEY}={}){if(!r)throw new Error("API Key option must be specified when using Key Authentication");this.name=e,this.#e=r}async filter(e){return{...e,headers:{...e.headers,Authorization:`Basic ${btoa(this.name+":"+this.#e)}`}}}};var o=class{#e;constructor({token:e=process.env.SUPPORT_ACCESS_TOKEN}={}){if(!e)throw new Error("Access Token option must be specified when using Token Authentication");this.#e=e}async filter(e){return{...e,headers:{...e.headers,Authorization:`Bearer ${this.#e}`}}}};export{n as Client,a as DEFAULT_SUPPORT_BASE_URL,t as KeyAuthentication,p as PublicAuthentication,o as TokenAuthentication,n as default}; |
{ | ||
"name": "@great-detail/support-sdk", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "JavaScript SDK for the Great Detail Support System", |
@@ -33,3 +33,3 @@ /** | ||
export type ListResponse = { | ||
export type ListActionsResponsePayload = { | ||
actions: { | ||
@@ -48,5 +48,5 @@ id: string; | ||
public async result(): Promise<ListResponse> { | ||
public async result(): Promise<ListActionsResponsePayload> { | ||
return this.response.json(); | ||
} | ||
} |
@@ -33,3 +33,3 @@ /** | ||
export type ListResponse = { | ||
export type ListChannelsResponsePayload = { | ||
channels: { | ||
@@ -48,5 +48,5 @@ id: string; | ||
public async result(): Promise<ListResponse> { | ||
public async result(): Promise<ListChannelsResponsePayload> { | ||
return this.response.json(); | ||
} | ||
} |
@@ -33,3 +33,3 @@ /** | ||
export type ListResponse = { | ||
export type ListContactsResponsePayload = { | ||
contacts: { | ||
@@ -48,5 +48,5 @@ id: string; | ||
public async result(): Promise<ListResponse> { | ||
public async result(): Promise<ListContactsResponsePayload> { | ||
return this.response.json(); | ||
} | ||
} |
@@ -34,3 +34,3 @@ /** | ||
export type GetResponse = { | ||
export type GetConversationResponsePayload = { | ||
conversation: { | ||
@@ -48,5 +48,5 @@ id: string; | ||
public async result(): Promise<GetResponse> { | ||
public async result(): Promise<GetConversationResponsePayload> { | ||
return this.response.json(); | ||
} | ||
} |
@@ -33,3 +33,3 @@ /** | ||
export type ListResponse = { | ||
export type ListConversationsResponsePayload = { | ||
conversations: { | ||
@@ -47,5 +47,5 @@ id: string; | ||
public async result(): Promise<ListResponse> { | ||
public async result(): Promise<ListConversationsResponsePayload> { | ||
return this.response.json(); | ||
} | ||
} |
@@ -16,1 +16,12 @@ /** | ||
export { default, default as Client } from "./Client/index.js"; | ||
export { type ListActionsResponsePayload } from "./Action/ListActions.js"; | ||
export { type ListChannelsResponsePayload } from "./Channel/ListChannels.js"; | ||
export { type ListContactsResponsePayload } from "./Contact/ListContacts.js"; | ||
export { type ListConversationsResponsePayload } from "./Conversation/ListConversations.js"; | ||
export { type GetConversationResponsePayload } from "./Conversation/GetConversation.js"; | ||
export { type ListLabelsResponsePayload } from "./Label/ListLabels.js"; | ||
export { type ListMessagesResponsePayload } from "./Message/ListMessages.js"; | ||
export { type ListModelsResponsePayload } from "./Model/ListModels.js"; | ||
export { type CreateCorrectionResponsePayload } from "./Model/Correction/CreateCorrectionModel.js"; | ||
export { type CreateResponseResponsePayload } from "./Model/Response/CreateResponseModel.js"; | ||
export { type ListSourcesResponsePayload } from "./Source/ListSources.js"; |
@@ -33,3 +33,3 @@ /** | ||
export type ListResponse = { | ||
export type ListLabelsResponsePayload = { | ||
labels: { | ||
@@ -47,5 +47,5 @@ id: string; | ||
public async result(): Promise<ListResponse> { | ||
public async result(): Promise<ListLabelsResponsePayload> { | ||
return this.response.json(); | ||
} | ||
} |
@@ -33,3 +33,3 @@ /** | ||
export type ListResponse = { | ||
export type ListMessagesResponsePayload = { | ||
messages: { | ||
@@ -50,5 +50,5 @@ id: string; | ||
public async result(): Promise<ListResponse> { | ||
public async result(): Promise<ListMessagesResponsePayload> { | ||
return this.response.json(); | ||
} | ||
} |
@@ -47,3 +47,3 @@ /** | ||
export type ListResponse = unknown; | ||
export type CreateCorrectionResponsePayload = unknown; | ||
@@ -53,5 +53,5 @@ export class CreateCorrectionModelResponse { | ||
public async result(): Promise<ListResponse> { | ||
public async result(): Promise<CreateCorrectionResponsePayload> { | ||
return this.response.json(); | ||
} | ||
} |
@@ -33,3 +33,3 @@ /** | ||
export type ListResponse = { | ||
export type ListModelsResponsePayload = { | ||
models: { | ||
@@ -47,5 +47,5 @@ id: string; | ||
public async result(): Promise<ListResponse> { | ||
public async result(): Promise<ListModelsResponsePayload> { | ||
return this.response.json(); | ||
} | ||
} |
@@ -50,3 +50,3 @@ /** | ||
export type ListResponse = { | ||
export type CreateResponseResponsePayload = { | ||
message: string | null; | ||
@@ -62,5 +62,5 @@ debug: { | ||
public async result(): Promise<ListResponse> { | ||
public async result(): Promise<CreateResponseResponsePayload> { | ||
return this.response.json(); | ||
} | ||
} |
@@ -33,3 +33,3 @@ /** | ||
export type ListResponse = { | ||
export type ListSourcesResponsePayload = { | ||
sources: { | ||
@@ -47,5 +47,5 @@ id: string; | ||
public async result(): Promise<ListResponse> { | ||
public async result(): Promise<ListSourcesResponsePayload> { | ||
return this.response.json(); | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
84949
1648