@great-detail/support-sdk
Advanced tools
Comparing version 0.1.0 to 0.1.1
#!/usr/bin/env node | ||
import{a as r}from"./chunk-POO5QTDO.js";import"./chunk-F7GYYFWQ.js";r.parseAsync(process.argv); | ||
import{a as r}from"./chunk-WZYR7OGA.js";import"./chunk-4DLAUWLS.js";r.parseAsync(process.argv); |
import { Command } from 'commander'; | ||
import { C as Client } from '../index-EaleABGN.js'; | ||
import { C as Client } from '../index-6KJofFiG.js'; | ||
import { Options as Options$1 } from 'ora'; | ||
@@ -4,0 +4,0 @@ import 'zod'; |
@@ -1,1 +0,1 @@ | ||
import{a}from"../chunk-POO5QTDO.js";import"../chunk-F7GYYFWQ.js";export{a as default}; | ||
import{a}from"../chunk-WZYR7OGA.js";import"../chunk-4DLAUWLS.js";export{a as default}; |
@@ -1,3 +0,3 @@ | ||
import { A as Authentication } from './index-EaleABGN.js'; | ||
export { C as Client, h as CreateCorrectionResponsePayload, d as CreateLabelResponsePayload, i as CreateResponseResponsePayload, G as GetConversationResponsePayload, L as ListActionsResponsePayload, a as ListChannelsResponsePayload, b as ListContactsResponsePayload, c as ListConversationsResponsePayload, e as ListLabelsResponsePayload, f as ListMessagesResponsePayload, g as ListModelsResponsePayload, j as ListSourcesResponsePayload, R as RequestFilterable, C as default } from './index-EaleABGN.js'; | ||
import { A as Authentication } from './index-6KJofFiG.js'; | ||
export { C as Client, p as CreateCorrectionResponsePayload, h as CreateLabelResponsePayload, q as CreateResponseResponsePayload, D as DeleteLabelResponsePayload, G as GetContactResponsePayload, d as GetConversationResponsePayload, i as GetLabelResponsePayload, n as GetModelResponsePayload, r as GetSourceResponsePayload, L as ListActionsResponsePayload, b as ListChannelsResponsePayload, c as ListContactsResponsePayload, l as ListConversationMessagesResponsePayload, e as ListConversationsResponsePayload, f as ListLabelConversationsResponsePayload, j as ListLabelsResponsePayload, m as ListMessagesResponsePayload, o as ListModelsResponsePayload, s as ListSourcesResponsePayload, O as Options, R as RequestFilterable, a as TransportOptions, S as TransportSendOptions, U as UpdateContactResponsePayload, g as UpdateConversationResponsePayload, k as UpdateLabelResponsePayload, C as default } from './index-6KJofFiG.js'; | ||
import 'zod'; | ||
@@ -4,0 +4,0 @@ |
@@ -1,1 +0,1 @@ | ||
import{a as l,b as i,c as n,d as a,e as p,f as m,g as f}from"./chunk-F7GYYFWQ.js";var t=class s{static DEFAULT_NAME=i;name;#e;constructor({name:e=process.env[p]??s.DEFAULT_NAME,key:r=process.env[a]}={}){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[n]}={}){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{f as Client,l as DEFAULT_SUPPORT_BASE_URL,t as KeyAuthentication,m as PublicAuthentication,o as TokenAuthentication,f as default}; | ||
import{a as y,b as p,c as a,d as n,e as i,f as l,g as f}from"./chunk-4DLAUWLS.js";var t=class s{static DEFAULT_NAME=p;name;#e;constructor({name:e=process.env[i]??s.DEFAULT_NAME,key:r=process.env[n]}={}){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[a]}={}){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{l as Client,y as DEFAULT_SUPPORT_BASE_URL,t as KeyAuthentication,f as PublicAuthentication,o as TokenAuthentication,l as default}; |
{ | ||
"name": "@great-detail/support-sdk", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "JavaScript SDK for the Great Detail Support System", |
@@ -37,3 +37,3 @@ /** | ||
export interface ClientOptions { | ||
export interface Options { | ||
baseURL?: string | URL; | ||
@@ -45,9 +45,9 @@ } | ||
public transport: Transport; | ||
public _transport: Transport; | ||
constructor( | ||
authentication: Authentication, | ||
{ baseURL, ...options }: ClientOptions = {}, | ||
{ baseURL, ...options }: Options = {}, | ||
) { | ||
this.transport = new Transport({ | ||
this._transport = new Transport({ | ||
requestFilterables: [new RequestStandardHeaders(), authentication], | ||
@@ -65,3 +65,3 @@ ...options, | ||
return { | ||
list: new ListActionsRequest(this.transport), | ||
list: new ListActionsRequest(this._transport), | ||
}; | ||
@@ -72,3 +72,3 @@ } | ||
return { | ||
list: new ListChannelsRequest(this.transport), | ||
list: new ListChannelsRequest(this._transport), | ||
}; | ||
@@ -79,5 +79,5 @@ } | ||
return { | ||
get: new GetContactRequest(this.transport), | ||
list: new ListContactsRequest(this.transport), | ||
update: new UpdateContactRequest(this.transport), | ||
get: new GetContactRequest(this._transport), | ||
list: new ListContactsRequest(this._transport), | ||
update: new UpdateContactRequest(this._transport), | ||
}; | ||
@@ -88,7 +88,7 @@ } | ||
return { | ||
get: new GetConversationRequest(this.transport), | ||
list: new ListConversationsRequest(this.transport), | ||
update: new UpdateConversationRequest(this.transport), | ||
get: new GetConversationRequest(this._transport), | ||
list: new ListConversationsRequest(this._transport), | ||
update: new UpdateConversationRequest(this._transport), | ||
message: { | ||
list: new ListConversationMessages(this.transport), | ||
list: new ListConversationMessages(this._transport), | ||
}, | ||
@@ -100,9 +100,9 @@ }; | ||
return { | ||
create: new CreateLabelRequest(this.transport), | ||
get: new GetLabelRequest(this.transport), | ||
list: new ListLabelsRequest(this.transport), | ||
update: new UpdateLabelRequest(this.transport), | ||
delete: new DeleteLabelRequest(this.transport), | ||
create: new CreateLabelRequest(this._transport), | ||
get: new GetLabelRequest(this._transport), | ||
list: new ListLabelsRequest(this._transport), | ||
update: new UpdateLabelRequest(this._transport), | ||
delete: new DeleteLabelRequest(this._transport), | ||
conversation: { | ||
list: new ListLabelConversations(this.transport), | ||
list: new ListLabelConversations(this._transport), | ||
}, | ||
@@ -114,3 +114,3 @@ }; | ||
return { | ||
list: new ListMessagesRequest(this.transport), | ||
list: new ListMessagesRequest(this._transport), | ||
}; | ||
@@ -121,9 +121,9 @@ } | ||
return { | ||
get: new GetModelRequest(this.transport), | ||
list: new ListModelsRequest(this.transport), | ||
get: new GetModelRequest(this._transport), | ||
list: new ListModelsRequest(this._transport), | ||
response: { | ||
create: new CreateResponseModelRequest(this.transport), | ||
create: new CreateResponseModelRequest(this._transport), | ||
}, | ||
correction: { | ||
create: new CreateCorrectionModelRequest(this.transport), | ||
create: new CreateCorrectionModelRequest(this._transport), | ||
}, | ||
@@ -135,6 +135,6 @@ }; | ||
return { | ||
get: new GetSourceRequest(this.transport), | ||
list: new ListSourcesRequest(this.transport), | ||
get: new GetSourceRequest(this._transport), | ||
list: new ListSourcesRequest(this._transport), | ||
}; | ||
} | ||
} |
@@ -11,18 +11,54 @@ /** | ||
export { DEFAULT_SUPPORT_BASE_URL } from "./constants/index.js"; | ||
// Client | ||
export { default, default as Client, type Options } from "./Client/index.js"; | ||
// Transport & Filtering | ||
export { type default as RequestFilterable } from "./Request/RequestFilterable.js"; | ||
export { | ||
type Options as TransportOptions, | ||
type SendOptions as TransportSendOptions, | ||
} from "./Transport/index.js"; | ||
// Authentication | ||
export { default as KeyAuthentication } from "./Authentication/KeyAuthentication.js"; | ||
export { default as TokenAuthentication } from "./Authentication/TokenAuthentication.js"; | ||
export { default as PublicAuthentication } from "./Authentication/PublicAuthentication.js"; | ||
export { type default as RequestFilterable } from "./Request/RequestFilterable.js"; | ||
export { default, default as Client } from "./Client/index.js"; | ||
// Actions | ||
export { type ListActionsResponsePayload } from "./Action/ListActions.js"; | ||
// Channels | ||
export { type ListChannelsResponsePayload } from "./Channel/ListChannels.js"; | ||
// Contacts | ||
export { type GetContactResponsePayload } from "./Contact/GetContact.js"; | ||
export { type ListContactsResponsePayload } from "./Contact/ListContacts.js"; | ||
export { type UpdateContactResponsePayload } from "./Contact/UpdateContact.js"; | ||
// Conversations | ||
export { type GetConversationResponsePayload } from "./Conversation/GetConversation.js"; | ||
export { type ListConversationsResponsePayload } from "./Conversation/ListConversations.js"; | ||
export { type GetConversationResponsePayload } from "./Conversation/GetConversation.js"; | ||
export { type ListLabelConversationsResponsePayload } from "./Conversation/ListLabelConversations.js"; | ||
export { type UpdateConversationResponsePayload } from "./Conversation/UpdateConversation.js"; | ||
// Labels | ||
export { type CreateLabelResponsePayload } from "./Label/CreateLabel.js"; | ||
export { type DeleteLabelResponsePayload } from "./Label/DeleteLabel.js"; | ||
export { type GetLabelResponsePayload } from "./Label/GetLabel.js"; | ||
export { type ListLabelsResponsePayload } from "./Label/ListLabels.js"; | ||
export { type UpdateLabelResponsePayload } from "./Label/UpdateLabel.js"; | ||
// Messages | ||
export { type ListConversationMessagesResponsePayload } from "./Message/ListConversationMessages.js"; | ||
export { type ListMessagesResponsePayload } from "./Message/ListMessages.js"; | ||
// Models | ||
export { type GetModelResponsePayload } from "./Model/GetModel.js"; | ||
export { type ListModelsResponsePayload } from "./Model/ListModels.js"; | ||
export { type CreateCorrectionResponsePayload } from "./Model/Correction/CreateCorrectionModel.js"; | ||
export { type CreateResponseResponsePayload } from "./Model/Response/CreateResponseModel.js"; | ||
// Sources | ||
export { type GetSourceResponsePayload } from "./Source/GetSource.js"; | ||
export { type ListSourcesResponsePayload } from "./Source/ListSources.js"; |
@@ -46,3 +46,3 @@ /** | ||
export type CreateLabelResponsePayload = { | ||
export type UpdateLabelResponsePayload = { | ||
label: { | ||
@@ -61,5 +61,5 @@ id: string; | ||
public async result(): Promise<CreateLabelResponsePayload> { | ||
public async result(): Promise<UpdateLabelResponsePayload> { | ||
return this.response.json(); | ||
} | ||
} |
@@ -12,3 +12,3 @@ /** | ||
export interface TransportOptions { | ||
export interface Options { | ||
requestFilterables: RequestFilterable[]; | ||
@@ -30,5 +30,5 @@ baseURL: string; | ||
export default class Transport { | ||
public options: TransportOptions; | ||
public options: Options; | ||
constructor({ baseURL, ...options }: TransportOptions) { | ||
constructor({ baseURL, ...options }: Options) { | ||
this.options = { | ||
@@ -35,0 +35,0 @@ ...options, |
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
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
176930
3153