bizzabo-api
Advanced tools
Comparing version 0.1.6 to 0.2.0
import { HttpClient } from '../../http-client'; | ||
import { Token } from '../../auth/token'; | ||
import { Contact, ContactPayload, ContactResponse } from './types'; | ||
import type { Token } from '../../auth/types'; | ||
import type { Contact, ContactPayload, ContactResponse } from './types'; | ||
export declare class ContactsApi extends HttpClient { | ||
@@ -5,0 +5,0 @@ constructor(token?: Token); |
@@ -70,5 +70,3 @@ "use strict"; | ||
contactsByEmail = _c.sent(); | ||
return [2 /*return*/, ((_b = (_a = contactsByEmail === null || contactsByEmail === void 0 ? void 0 : contactsByEmail.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.length) | ||
? contactsByEmail.data.content.pop() | ||
: null]; | ||
return [2 /*return*/, ((_b = (_a = contactsByEmail === null || contactsByEmail === void 0 ? void 0 : contactsByEmail.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.length) ? contactsByEmail.data.content.pop() : null]; | ||
} | ||
@@ -89,4 +87,3 @@ }); | ||
case 0: return [4 /*yield*/, this.instance.post("/events/".concat(eventId, "/contacts"), contact)]; | ||
case 1: return [2 /*return*/, (_a.sent()) | ||
.data]; | ||
case 1: return [2 /*return*/, (_a.sent()).data]; | ||
} | ||
@@ -93,0 +90,0 @@ }); |
import { HttpClient } from '../../http-client'; | ||
import { Token } from '../../auth/token'; | ||
import { Event } from './types'; | ||
import type { Token } from '../../auth/types'; | ||
import type { Event } from './types'; | ||
export declare class EventsApi extends HttpClient { | ||
@@ -5,0 +5,0 @@ constructor(token?: Token); |
import { HttpClient } from '../../http-client'; | ||
import { Token } from '../../auth/token'; | ||
import type { Token } from '../../auth/types'; | ||
import { CreateSession, Session } from './types'; | ||
@@ -4,0 +4,0 @@ export declare class SessionsApi extends HttpClient { |
import { HttpClient } from '../../http-client'; | ||
import { Token } from '../../auth/token'; | ||
import { Speaker, SpeakerPayload } from './types'; | ||
import type { Token } from '../../auth/types'; | ||
import type { Speaker, SpeakerPayload } from './types'; | ||
export declare class SpeakersApi extends HttpClient { | ||
@@ -5,0 +5,0 @@ private contactsApi; |
@@ -111,4 +111,3 @@ "use strict"; | ||
case 0: return [4 /*yield*/, this.instance.get("/events/".concat(eventId, "/speakers/").concat(speakerId))]; | ||
case 1: return [2 /*return*/, (_a.sent()) | ||
.data]; | ||
case 1: return [2 /*return*/, (_a.sent()).data]; | ||
} | ||
@@ -115,0 +114,0 @@ }); |
import { AxiosInstance, AxiosError } from 'axios'; | ||
import { Token } from './auth/token'; | ||
import type { Token } from './auth/types'; | ||
export declare abstract class HttpClient { | ||
@@ -4,0 +4,0 @@ protected readonly instance: AxiosInstance; |
@@ -5,13 +5,14 @@ import { ContactsApi } from './api/contacts-client'; | ||
import { SpeakersApi } from './api/speakers-client'; | ||
import { Token } from './auth/token'; | ||
export * from './auth/token'; | ||
import type { Token } from './auth/types'; | ||
export * from './auth/types'; | ||
export * from './auth/builder'; | ||
export * from './api'; | ||
export * from './errors'; | ||
export * from './utils/http-status.enum'; | ||
export declare class Bizzabo { | ||
contactsApi: ContactsApi; | ||
speakersApi: SpeakersApi; | ||
eventsApi: EventsApi; | ||
sessionsApi: SessionsApi; | ||
export declare class ApiClient { | ||
contacts: ContactsApi; | ||
speakers: SpeakersApi; | ||
events: EventsApi; | ||
sessions: SessionsApi; | ||
constructor(token: Token); | ||
} |
@@ -17,3 +17,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Bizzabo = void 0; | ||
exports.ApiClient = void 0; | ||
var contacts_client_1 = require("./api/contacts-client"); | ||
@@ -23,15 +23,16 @@ var events_client_1 = require("./api/events-client"); | ||
var speakers_client_1 = require("./api/speakers-client"); | ||
__exportStar(require("./auth/token"), exports); | ||
__exportStar(require("./auth/types"), exports); | ||
__exportStar(require("./auth/builder"), exports); | ||
__exportStar(require("./api"), exports); | ||
__exportStar(require("./errors"), exports); | ||
__exportStar(require("./utils/http-status.enum"), exports); | ||
var Bizzabo = /** @class */ (function () { | ||
function Bizzabo(token) { | ||
this.contactsApi = new contacts_client_1.ContactsApi(token); | ||
this.speakersApi = new speakers_client_1.SpeakersApi(token); | ||
this.eventsApi = new events_client_1.EventsApi(token); | ||
this.sessionsApi = new sessions_client_1.SessionsApi(token); | ||
var ApiClient = /** @class */ (function () { | ||
function ApiClient(token) { | ||
this.contacts = new contacts_client_1.ContactsApi(token); | ||
this.speakers = new speakers_client_1.SpeakersApi(token); | ||
this.events = new events_client_1.EventsApi(token); | ||
this.sessions = new sessions_client_1.SessionsApi(token); | ||
} | ||
return Bizzabo; | ||
return ApiClient; | ||
}()); | ||
exports.Bizzabo = Bizzabo; | ||
exports.ApiClient = ApiClient; |
{ | ||
"name": "bizzabo-api", | ||
"version": "0.1.6", | ||
"version": "0.2.0", | ||
"description": "The Bizzabo API is a Typescript client that allows calling Bizzabo public APIs", | ||
@@ -5,0 +5,0 @@ "author": "Bizzabo", |
# Bizzabo Node.js SDK | ||
This SDK is a wrapper around the [Bizzabo Public APIs](https://bizzabo.stoplight.io/docs/bizzabo-partner-apis/ZG9jOjM1MTkyNzQx-build-anything-reimagine-events) | ||
@@ -6,4 +7,4 @@ | ||
* Node.js version 14 and above. | ||
* A set of API credentials within your Bizzabo Sandbox account (See [Create Sandbox Credentials](#create-sandbox-credentials)) | ||
- Node.js version 14 and above. | ||
- A set of API credentials within your Bizzabo Sandbox account (See [Create Sandbox Credentials](#create-sandbox-credentials)) | ||
@@ -17,5 +18,7 @@ ### Installation | ||
### Create Sandbox Credentials | ||
Go to the APIs page in your Bizzabo account (https://accounts.bizzabo.com/{accountId}/api) and create a new set of API Credentials. Make sure you copy those to a secure place as you will not be able to retrieve the client secret at a later time. | ||
## Authentication | ||
This SDK comes with an Auhentication client that allows you to | ||
@@ -28,9 +31,9 @@ retrieve [OAuth 2.0](https://bizzabo.stoplight.io/docs/bizzabo-partner-apis/ZG9jOjU4NjM4-authentication) based JWT tokens per the account for which you're performing your API requests | ||
``` JavaScript | ||
import { Authentication } from 'bizzabo-api'; | ||
```JavaScript | ||
import { AuthenticationBuilder } from 'bizzabo-api'; | ||
const CLIENT_ID = '<clientId>' , CLIENT_SECRET = '<clientSecret>', ACCOUNT_ID = '<accountId>'; | ||
const auth = new Authentication(CLIENT_ID, CLIENT_SECRET, ACCOUNT_ID); | ||
const auth = new AuthenticationBuilder(CLIENT_ID, CLIENT_SECRET, ACCOUNT_ID).build(); | ||
auth.getToken().then(token => { | ||
auth.getClientCredentialsToken().then(token => { | ||
// The `token` object contains an access_token that is being used to call the endpoints. | ||
@@ -40,3 +43,3 @@ }, (err) => console.error(err)); | ||
// or, if you prefer the async/await syntactic sugar | ||
const token = await auth.getToken(); | ||
const token = await auth.getClientCredentialsToken(); | ||
``` | ||
@@ -46,12 +49,12 @@ | ||
``` JavaScript | ||
import { Authentication, Bizzabo } from 'bizzabo-api'; | ||
```JavaScript | ||
import { AuthenticationBuilder, ApiClient } from 'bizzabo-api'; | ||
// Get auth token | ||
const auth = new Authentication('pfTIxlfvPZ...', 'wodXksxANQi6eq...', 521477); | ||
const token = await auth.getToken(); | ||
const auth = new AuthenticationBuilder('pfTIxlfvPZ...', 'wodXksxANQi6eq...', 521477).build(); | ||
const token = await auth.getClientCredentialsToken(); | ||
// Initialize the relevant clients; in this example, the Contacts client. | ||
const bizzaboApi = new Bizzabo(token); | ||
const contactsApi = bizzaboApi.contactsApi; | ||
const sdk = new ApiClient(token); | ||
const contactsApi = sdk.contacts; | ||
@@ -68,6 +71,7 @@ // Get a contact by their email | ||
## Using this SDK | ||
This SDK exports all the relevant typings, so you can use the built-in functions with confidence. Use a popular IDE such as VSCode or Webstorm to get the code hints from these typings | ||
## API Documentation | ||
You can get the full documentation for the API on the [API Docs page](https://bizzabo.stoplight.io/docs/bizzabo-partner-apis/branches/main/216a013c43f8e-bizzabo-public-api) | ||
You can get the full documentation for the API on the [API Docs page](https://bizzabo.stoplight.io/docs/bizzabo-partner-apis) |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
62903
46
1284
72
0