Skip to content

Commit

Permalink
Merge pull request #16 from midday-ai/release-please--branches--main-…
Browse files Browse the repository at this point in the history
…-changes--next--components--engine

release: 0.1.0-alpha.5
  • Loading branch information
pontusab authored Jul 14, 2024
2 parents ff3f13e + fa1cde1 commit 9ed9afd
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.4"
".": "0.1.0-alpha.5"
}
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 0.1.0-alpha.5 (2024-07-14)

Full Changelog: [v0.1.0-alpha.4...v0.1.0-alpha.5](https://github.com/midday-ai/engine-sdk/compare/v0.1.0-alpha.4...v0.1.0-alpha.5)

### Features

* **api:** update via SDK Studio ([#15](https://github.com/midday-ai/engine-sdk/issues/15)) ([e4e990e](https://github.com/midday-ai/engine-sdk/commit/e4e990eb7344141389bfc9f2f0d15de31375130c))
* **api:** update via SDK Studio ([#17](https://github.com/midday-ai/engine-sdk/issues/17)) ([9152748](https://github.com/midday-ai/engine-sdk/commit/915274815aebf2fe14364315c7617180ffd7b259))

## 0.1.0-alpha.4 (2024-07-12)

Full Changelog: [v0.1.0-alpha.3...v0.1.0-alpha.4](https://github.com/midday-ai/engine-sdk/compare/v0.1.0-alpha.3...v0.1.0-alpha.4)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@midday-ai/engine",
"version": "0.1.0-alpha.4",
"version": "0.1.0-alpha.5",
"description": "The official TypeScript library for the Midday API",
"author": "Midday <[email protected]>",
"types": "dist/index.d.ts",
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as API from '@midday-ai/engine/resources/index';

export interface ClientOptions {
/**
* Defaults to process.env['MIDDAY_BEARER_TOKEN'].
* Defaults to process.env['MIDDAY_ENGINE_API_KEY'].
*/
bearerToken?: string | undefined;

Expand Down Expand Up @@ -80,7 +80,7 @@ export class Midday extends Core.APIClient {
/**
* API Client for interfacing with the Midday API.
*
* @param {string | undefined} [opts.bearerToken=process.env['MIDDAY_BEARER_TOKEN'] ?? undefined]
* @param {string | undefined} [opts.bearerToken=process.env['MIDDAY_ENGINE_API_KEY'] ?? undefined]
* @param {string} [opts.baseURL=process.env['MIDDAY_BASE_URL'] ?? https://engine.midday.ai] - Override the default base URL for the API.
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
Expand All @@ -91,12 +91,12 @@ export class Midday extends Core.APIClient {
*/
constructor({
baseURL = Core.readEnv('MIDDAY_BASE_URL'),
bearerToken = Core.readEnv('MIDDAY_BEARER_TOKEN'),
bearerToken = Core.readEnv('MIDDAY_ENGINE_API_KEY'),
...opts
}: ClientOptions = {}) {
if (bearerToken === undefined) {
throw new Errors.MiddayError(
"The MIDDAY_BEARER_TOKEN environment variable is missing or empty; either provide it, or instantiate the Midday client with an bearerToken option, like new Midday({ bearerToken: 'My Bearer Token' }).",
"The MIDDAY_ENGINE_API_KEY environment variable is missing or empty; either provide it, or instantiate the Midday client with an bearerToken option, like new Midday({ bearerToken: 'My Bearer Token' }).",
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '0.1.0-alpha.4'; // x-release-please-version
export const VERSION = '0.1.0-alpha.5'; // x-release-please-version
4 changes: 2 additions & 2 deletions tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,14 @@ describe('instantiate client', () => {

test('with environment variable arguments', () => {
// set options via env var
process.env['MIDDAY_BEARER_TOKEN'] = 'My Bearer Token';
process.env['MIDDAY_ENGINE_API_KEY'] = 'My Bearer Token';
const client = new Midday();
expect(client.bearerToken).toBe('My Bearer Token');
});

test('with overriden environment variable arguments', () => {
// set options via env var
process.env['MIDDAY_BEARER_TOKEN'] = 'another My Bearer Token';
process.env['MIDDAY_ENGINE_API_KEY'] = 'another My Bearer Token';
const client = new Midday({ bearerToken: 'My Bearer Token' });
expect(client.bearerToken).toBe('My Bearer Token');
});
Expand Down

0 comments on commit 9ed9afd

Please sign in to comment.