@great-detail/support-sdk
Advanced tools
Comparing version 0.0.3 to 0.0.4
#!/usr/bin/env node | ||
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); | ||
import{c as u,d as C}from"./chunk-WCSPJBPY.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); |
@@ -51,3 +51,3 @@ import { z } from 'zod'; | ||
interface Options$c { | ||
interface Options$d { | ||
name?: string; | ||
@@ -60,3 +60,3 @@ key?: string; | ||
name: string; | ||
constructor({ name, key, }?: Options$c); | ||
constructor({ name, key, }?: Options$d); | ||
filter(request: RequestInit): Promise<RequestInit>; | ||
@@ -74,3 +74,3 @@ } | ||
interface Options$b { | ||
interface Options$c { | ||
token?: string; | ||
@@ -80,3 +80,3 @@ } | ||
#private; | ||
constructor({ token }?: Options$b); | ||
constructor({ token }?: Options$c); | ||
filter(request: RequestInit): Promise<RequestInit>; | ||
@@ -113,3 +113,3 @@ } | ||
interface Options$a extends SendOptions { | ||
interface Options$b extends SendOptions { | ||
request?: RequestInit; | ||
@@ -120,3 +120,3 @@ } | ||
constructor(_client: Client); | ||
send({ request, ...options }?: Options$a): Promise<ListActionsResponse>; | ||
send({ request, ...options }?: Options$b): Promise<ListActionsResponse>; | ||
} | ||
@@ -148,3 +148,3 @@ type ListActionsResponsePayload = { | ||
interface Options$9 extends SendOptions { | ||
interface Options$a extends SendOptions { | ||
request?: RequestInit; | ||
@@ -155,3 +155,3 @@ } | ||
constructor(_client: Client); | ||
send({ request, ...options }?: Options$9): Promise<ListChannelsResponse>; | ||
send({ request, ...options }?: Options$a): Promise<ListChannelsResponse>; | ||
} | ||
@@ -183,3 +183,3 @@ type ListChannelsResponsePayload = { | ||
interface Options$8 extends SendOptions { | ||
interface Options$9 extends SendOptions { | ||
request?: RequestInit; | ||
@@ -190,3 +190,3 @@ } | ||
constructor(_client: Client); | ||
send({ request, ...options }?: Options$8): Promise<ListContactsResponse>; | ||
send({ request, ...options }?: Options$9): Promise<ListContactsResponse>; | ||
} | ||
@@ -218,3 +218,3 @@ type ListContactsResponsePayload = { | ||
interface Options$7 extends SendOptions { | ||
interface Options$8 extends SendOptions { | ||
id: string; | ||
@@ -226,3 +226,3 @@ request?: RequestInit; | ||
constructor(_client: Client); | ||
send({ id, request, ...options }: Options$7): Promise<GetConversationResponse>; | ||
send({ id, request, ...options }: Options$8): Promise<GetConversationResponse>; | ||
} | ||
@@ -253,3 +253,3 @@ type GetConversationResponsePayload = { | ||
interface Options$6 extends SendOptions { | ||
interface Options$7 extends SendOptions { | ||
request?: RequestInit; | ||
@@ -260,3 +260,3 @@ } | ||
constructor(_client: Client); | ||
send({ request, ...options }?: Options$6): Promise<ListConversationsResponse>; | ||
send({ request, ...options }?: Options$7): Promise<ListConversationsResponse>; | ||
} | ||
@@ -287,2 +287,48 @@ type ListConversationsResponsePayload = { | ||
interface Options$6 extends SendOptions { | ||
body: z.infer<typeof CreateLabelRequest.SCHEMA>; | ||
request?: RequestInit; | ||
} | ||
declare class CreateLabelRequest { | ||
protected _client: Client; | ||
static SCHEMA: z.ZodObject<{ | ||
title: z.ZodString; | ||
description: z.ZodOptional<z.ZodString>; | ||
account: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
title: string; | ||
account: string; | ||
description?: string | undefined; | ||
}, { | ||
title: string; | ||
account: string; | ||
description?: string | undefined; | ||
}>; | ||
constructor(_client: Client); | ||
send({ body, request, ...options }: Options$6): Promise<CreateLabelResponse>; | ||
} | ||
type CreateLabelResponsePayload = { | ||
label: { | ||
id: string; | ||
title: string; | ||
description?: string; | ||
createdAt: string; | ||
updatedAt?: string; | ||
}; | ||
}; | ||
declare class CreateLabelResponse { | ||
response: Response; | ||
constructor(response: Response); | ||
result(): Promise<CreateLabelResponsePayload>; | ||
} | ||
/** | ||
* Great Detail Support System. | ||
* | ||
* @copyright 2024 Great Detail Ltd | ||
* @author Great Detail Ltd <info@greatdetail.com> | ||
* @author Dom Webber <dom.webber@greatdetail.com> | ||
* @see https://greatdetail.com | ||
*/ | ||
interface Options$5 extends SendOptions { | ||
@@ -535,2 +581,3 @@ request?: RequestInit; | ||
label: { | ||
create: CreateLabelRequest; | ||
list: ListLabelsRequest; | ||
@@ -557,2 +604,2 @@ }; | ||
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 }; | ||
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 }; |
@@ -1,1 +0,1 @@ | ||
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}; | ||
import{a,b as n,c as p,d as i}from"./chunk-WCSPJBPY.js";var t=class s{static DEFAULT_NAME=n;name;#e;constructor({name:e=process.env.SUPPORT_KEY_NAME??s.DEFAULT_NAME,key:r=process.env.SUPPORT_API_KEY}={}){if(!r)throw new Error("API Key option must be specified when using Key Authentication");this.name=e,this.#e=r}async filter(e){return{...e,headers:{...e.headers,Authorization:`Basic ${btoa(this.name+":"+this.#e)}`}}}};var o=class{#e;constructor({token:e=process.env.SUPPORT_ACCESS_TOKEN}={}){if(!e)throw new Error("Access Token option must be specified when using Token Authentication");this.#e=e}async filter(e){return{...e,headers:{...e.headers,Authorization:`Bearer ${this.#e}`}}}};export{i as Client,a as DEFAULT_SUPPORT_BASE_URL,t as KeyAuthentication,p as PublicAuthentication,o as TokenAuthentication,i as default}; |
{ | ||
"name": "@great-detail/support-sdk", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "JavaScript SDK for the Great Detail Support System", |
@@ -17,2 +17,3 @@ /** | ||
import ListConversationsRequest from "../Conversation/ListConversations.js"; | ||
import CreateLabelRequest from "../Label/CreateLabel.js"; | ||
import ListLabelsRequest from "../Label/ListLabels.js"; | ||
@@ -81,2 +82,3 @@ import ListMessagesRequest from "../Message/ListMessages.js"; | ||
public label = { | ||
create: new CreateLabelRequest(this), | ||
list: new ListLabelsRequest(this), | ||
@@ -83,0 +85,0 @@ }; |
@@ -21,2 +21,3 @@ /** | ||
export { type GetConversationResponsePayload } from "./Conversation/GetConversation.js"; | ||
export { type CreateLabelResponsePayload } from "./Label/CreateLabel.js"; | ||
export { type ListLabelsResponsePayload } from "./Label/ListLabels.js"; | ||
@@ -23,0 +24,0 @@ export { type ListMessagesResponsePayload } from "./Message/ListMessages.js"; |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
90989
42
1757
1
18