-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
88620bd
commit a147290
Showing
39 changed files
with
224 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# Meorphis Test 41 Node API Library | ||
# Meorphis Test 40 Node API Library | ||
|
||
[![NPM version](https://img.shields.io/npm/v/meorphis-test-41.svg)](https://npmjs.org/package/meorphis-test-41) | ||
[![NPM version](https://img.shields.io/npm/v/meorphis-test-40.svg)](https://npmjs.org/package/meorphis-test-40) | ||
|
||
This library provides convenient access to the Meorphis Test 41 REST API from server-side TypeScript or JavaScript. | ||
This library provides convenient access to the Meorphis Test 40 REST API from server-side TypeScript or JavaScript. | ||
|
||
The REST API documentation can be found [on help.bolt.com](https://help.bolt.com/api-bolt/). The full API of this library can be found in [api.md](api.md). | ||
|
||
|
@@ -15,23 +15,23 @@ npm install git+ssh://[email protected]:stainless-api/meorphis-test.git | |
``` | ||
|
||
> [!NOTE] | ||
> Once this package is [published to npm](https://app.stainlessapi.com/docs/guides/publish), this will become: `npm install meorphis-test-41` | ||
> Once this package is [published to npm](https://app.stainlessapi.com/docs/guides/publish), this will become: `npm install meorphis-test-40` | ||
## Usage | ||
|
||
The full API of this library can be found in [api.md](api.md). | ||
|
||
<!-- prettier-ignore --> | ||
```js | ||
import MeorphisTest41 from 'meorphis-test-41'; | ||
import MeorphisTest40 from 'meorphis-test-40'; | ||
|
||
const meorphisTest41 = new MeorphisTest41({ | ||
const meorphisTest40 = new MeorphisTest40({ | ||
environment: 'environment_1', // defaults to 'production' | ||
apiKey: 'My API Key', | ||
}); | ||
|
||
async function main() { | ||
const accountAccountGetResponse = await meorphisTest41.accounts.accountGet({ | ||
const accountAccountGetResponse = await meorphisTest40.accounts.accountGet({ | ||
'X-Publishable-Key': 'string', | ||
}); | ||
|
||
|
@@ -47,17 +47,17 @@ This library includes TypeScript definitions for all request params and response | |
|
||
<!-- prettier-ignore --> | ||
```ts | ||
import MeorphisTest41 from 'meorphis-test-41'; | ||
import MeorphisTest40 from 'meorphis-test-40'; | ||
|
||
const meorphisTest41 = new MeorphisTest41({ | ||
const meorphisTest40 = new MeorphisTest40({ | ||
environment: 'environment_1', // defaults to 'production' | ||
apiKey: 'My API Key', | ||
}); | ||
|
||
async function main() { | ||
const params: MeorphisTest41.AccountAccountGetParams = { 'X-Publishable-Key': 'string' }; | ||
const accountAccountGetResponse: MeorphisTest41.AccountAccountGetResponse = | ||
await meorphisTest41.accounts.accountGet(params); | ||
const params: MeorphisTest40.AccountAccountGetParams = { 'X-Publishable-Key': 'string' }; | ||
const accountAccountGetResponse: MeorphisTest40.AccountAccountGetResponse = | ||
await meorphisTest40.accounts.accountGet(params); | ||
} | ||
|
||
main(); | ||
|
@@ -74,10 +74,10 @@ a subclass of `APIError` will be thrown: | |
<!-- prettier-ignore --> | ||
```ts | ||
async function main() { | ||
const accountAccountGetResponse = await meorphisTest41.accounts | ||
const accountAccountGetResponse = await meorphisTest40.accounts | ||
.accountGet({ 'X-Publishable-Key': 'string' }) | ||
.catch(async (err) => { | ||
if (err instanceof MeorphisTest41.APIError) { | ||
if (err instanceof MeorphisTest40.APIError) { | ||
console.log(err.status); // 400 | ||
console.log(err.name); // BadRequestError | ||
console.log(err.headers); // {server: 'nginx', ...} | ||
|
@@ -114,13 +114,13 @@ You can use the `maxRetries` option to configure or disable this: | |
<!-- prettier-ignore --> | ||
```js | ||
// Configure the default for all requests: | ||
const meorphisTest41 = new MeorphisTest41({ | ||
const meorphisTest40 = new MeorphisTest40({ | ||
maxRetries: 0, // default is 2 | ||
apiKey: 'My API Key', | ||
}); | ||
|
||
// Or, configure per-request: | ||
await meorphisTest41.accounts.accountGet({ 'X-Publishable-Key': 'string' }, { | ||
await meorphisTest40.accounts.accountGet({ 'X-Publishable-Key': 'string' }, { | ||
maxRetries: 5, | ||
}); | ||
``` | ||
|
@@ -132,13 +132,13 @@ Requests time out after 1 minute by default. You can configure this with a `time | |
<!-- prettier-ignore --> | ||
```ts | ||
// Configure the default for all requests: | ||
const meorphisTest41 = new MeorphisTest41({ | ||
const meorphisTest40 = new MeorphisTest40({ | ||
timeout: 20 * 1000, // 20 seconds (default is 1 minute) | ||
apiKey: 'My API Key', | ||
}); | ||
|
||
// Override per-request: | ||
await meorphisTest41.accounts.accountGet({ 'X-Publishable-Key': 'string' }, { | ||
await meorphisTest40.accounts.accountGet({ 'X-Publishable-Key': 'string' }, { | ||
timeout: 5 * 1000, | ||
}); | ||
``` | ||
|
@@ -157,13 +157,13 @@ You can also use the `.withResponse()` method to get the raw `Response` along wi | |
|
||
<!-- prettier-ignore --> | ||
```ts | ||
const meorphisTest41 = new MeorphisTest41(); | ||
const meorphisTest40 = new MeorphisTest40(); | ||
|
||
const response = await meorphisTest41.accounts.accountGet({ 'X-Publishable-Key': 'string' }).asResponse(); | ||
const response = await meorphisTest40.accounts.accountGet({ 'X-Publishable-Key': 'string' }).asResponse(); | ||
console.log(response.headers.get('X-My-Header')); | ||
console.log(response.statusText); // access the underlying Response object | ||
|
||
const { data: accountAccountGetResponse, response: raw } = await meorphisTest41.accounts | ||
const { data: accountAccountGetResponse, response: raw } = await meorphisTest40.accounts | ||
.accountGet({ 'X-Publishable-Key': 'string' }) | ||
.withResponse(); | ||
console.log(raw.headers.get('X-My-Header')); | ||
|
@@ -220,16 +220,16 @@ By default, this library uses `node-fetch` in Node, and expects a global `fetch` | |
|
||
If you would prefer to use a global, web-standards-compliant `fetch` function even in a Node environment, | ||
(for example, if you are running Node with `--experimental-fetch` or using NextJS which polyfills with `undici`), | ||
add the following import before your first import `from "MeorphisTest41"`: | ||
add the following import before your first import `from "MeorphisTest40"`: | ||
|
||
```ts | ||
// Tell TypeScript and the package to use the global web fetch instead of node-fetch. | ||
// Note, despite the name, this does not add any polyfills, but expects them to be provided if needed. | ||
import 'meorphis-test-41/shims/web'; | ||
import MeorphisTest41 from 'meorphis-test-41'; | ||
import 'meorphis-test-40/shims/web'; | ||
import MeorphisTest40 from 'meorphis-test-40'; | ||
``` | ||
|
||
To do the inverse, add `import "meorphis-test-41/shims/node"` (which does import polyfills). | ||
To do the inverse, add `import "meorphis-test-40/shims/node"` (which does import polyfills). | ||
This can also be useful if you are getting the wrong TypeScript types for `Response` ([more details](https://github.com/stainless-api/meorphis-test/tree/main/src/_shims#readme)). | ||
|
||
### Logging and middleware | ||
|
@@ -239,9 +239,9 @@ which can be used to inspect or alter the `Request` or `Response` before/after e | |
|
||
```ts | ||
import { fetch } from 'undici'; // as one example | ||
import MeorphisTest41 from 'meorphis-test-41'; | ||
import MeorphisTest40 from 'meorphis-test-40'; | ||
|
||
const client = new MeorphisTest41({ | ||
const client = new MeorphisTest40({ | ||
fetch: async (url: RequestInfo, init?: RequestInit): Promise<Response> => { | ||
console.log('About to make a request', url, init); | ||
const response = await fetch(url, init); | ||
|
@@ -266,13 +266,13 @@ import http from 'http'; | |
import { HttpsProxyAgent } from 'https-proxy-agent'; | ||
|
||
// Configure the default for all requests: | ||
const meorphisTest41 = new MeorphisTest41({ | ||
const meorphisTest40 = new MeorphisTest40({ | ||
httpAgent: new HttpsProxyAgent(process.env.PROXY_URL), | ||
apiKey: 'My API Key', | ||
}); | ||
|
||
// Override per-request: | ||
await meorphisTest41.accounts.accountGet( | ||
await meorphisTest40.accounts.accountGet( | ||
{ 'X-Publishable-Key': 'string' }, | ||
{ | ||
httpAgent: new http.Agent({ keepAlive: false }), | ||
|
@@ -299,7 +299,7 @@ TypeScript >= 4.5 is supported. | |
The following runtimes are supported: | ||
|
||
- Node.js 18 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions. | ||
- Deno v1.28.0 or higher, using `import MeorphisTest41 from "npm:meorphis-test-41"`. | ||
- Deno v1.28.0 or higher, using `import MeorphisTest40 from "npm:meorphis-test-40"`. | ||
- Bun 1.0 or later. | ||
- Cloudflare Workers. | ||
- Vercel Edge Runtime. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,9 +16,9 @@ before making any information public. | |
## Reporting Non-SDK Related Security Issues | ||
|
||
If you encounter security issues that are not directly related to SDKs but pertain to the services | ||
or products provided by Meorphis Test 41 please follow the respective company's security reporting guidelines. | ||
or products provided by Meorphis Test 40 please follow the respective company's security reporting guidelines. | ||
|
||
### Meorphis Test 41 Terms and Policies | ||
### Meorphis Test 40 Terms and Policies | ||
|
||
Please contact [email protected] for any questions or concerns regarding security of our services. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{ | ||
"name": "meorphis-test-41", | ||
"name": "meorphis-test-40", | ||
"version": "0.0.1-alpha.0", | ||
"description": "The official TypeScript library for the Meorphis Test 41 API", | ||
"author": "Meorphis Test 41 <[email protected]>", | ||
"description": "The official TypeScript library for the Meorphis Test 40 API", | ||
"author": "Meorphis Test 40 <[email protected]>", | ||
"types": "dist/index.d.ts", | ||
"main": "dist/index.js", | ||
"type": "commonjs", | ||
|
@@ -63,8 +63,8 @@ | |
"./shims/web.mjs" | ||
], | ||
"imports": { | ||
"meorphis-test-41": ".", | ||
"meorphis-test-41/*": "./src/*" | ||
"meorphis-test-40": ".", | ||
"meorphis-test-40/*": "./src/*" | ||
}, | ||
"exports": { | ||
"./_shims/auto/*": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.