-
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
c835e8f
commit a9edb6f
Showing
40 changed files
with
233 additions
and
236 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,25 +42,25 @@ If you’d like to use the repository from source, you can either install from g | |
To install via git: | ||
|
||
```bash | ||
npm install git+ssh://[email protected]:stainless-api/meorphis-test.git | ||
npm install git+ssh://[email protected]:meorphis/meorphis-test.git | ||
``` | ||
|
||
Alternatively, to link a local copy of the repo: | ||
|
||
```bash | ||
# Clone | ||
git clone https://www.github.com/stainless-api/meorphis-test | ||
git clone https://www.github.com/meorphis/meorphis-test | ||
cd meorphis-test | ||
|
||
# With yarn | ||
yarn link | ||
cd ../my-package | ||
yarn link meorphis-test-41 | ||
yarn link test-repo-1 | ||
|
||
# With pnpm | ||
pnpm link --global | ||
cd ../my-package | ||
pnpm link -—global meorphis-test-41 | ||
pnpm link -—global test-repo-1 | ||
``` | ||
|
||
## Running tests | ||
|
@@ -99,7 +99,7 @@ the changes aren't made through the automated pipeline, you may want to make rel | |
|
||
### Publish with a GitHub workflow | ||
|
||
You can release to package managers by using [the `Publish NPM` GitHub action](https://www.github.com/stainless-api/meorphis-test/actions/workflows/publish-npm.yml). This requires a setup organization or repository secret to be set up. | ||
You can release to package managers by using [the `Publish NPM` GitHub action](https://www.github.com/meorphis/meorphis-test/actions/workflows/publish-npm.yml). This requires a setup organization or repository secret to be set up. | ||
|
||
### Publish manually | ||
|
||
|
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/test-repo-1.svg)](https://npmjs.org/package/test-repo-1) | ||
|
||
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). | ||
|
||
|
@@ -11,27 +11,24 @@ It is generated with [Stainless](https://www.stainlessapi.com/). | |
## Installation | ||
|
||
```sh | ||
npm install git+ssh://[email protected]:stainless-api/meorphis-test.git | ||
npm install test-repo-1 | ||
``` | ||
|
||
> [!NOTE] | ||
> Once this package is [published to npm](https://app.stainlessapi.com/docs/guides/publish), this will become: `npm install meorphis-test-41` | ||
## 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 'test-repo-1'; | ||
|
||
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 +44,17 @@ This library includes TypeScript definitions for all request params and response | |
|
||
<!-- prettier-ignore --> | ||
```ts | ||
import MeorphisTest41 from 'meorphis-test-41'; | ||
import MeorphisTest40 from 'test-repo-1'; | ||
|
||
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 +71,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 +111,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 +129,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 +154,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,17 +217,17 @@ 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 'test-repo-1/shims/web'; | ||
import MeorphisTest40 from 'test-repo-1'; | ||
``` | ||
|
||
To do the inverse, add `import "meorphis-test-41/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)). | ||
To do the inverse, add `import "test-repo-1/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/meorphis/meorphis-test/tree/main/src/_shims#readme)). | ||
|
||
### Logging and middleware | ||
|
||
|
@@ -239,9 +236,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 'test-repo-1'; | ||
|
||
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 +263,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 }), | ||
|
@@ -290,7 +287,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con | |
|
||
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. | ||
|
||
We are keen for your feedback; please open an [issue](https://www.github.com/stainless-api/meorphis-test/issues) with questions, bugs, or suggestions. | ||
We are keen for your feedback; please open an [issue](https://www.github.com/meorphis/meorphis-test/issues) with questions, bugs, or suggestions. | ||
|
||
## Requirements | ||
|
||
|
@@ -299,7 +296,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:test-repo-1"`. | ||
- 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
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,12 +1,12 @@ | ||
{ | ||
"name": "meorphis-test-41", | ||
"name": "test-repo-1", | ||
"version": "0.0.1-alpha.0", | ||
"description": "The official TypeScript library for the Meorphis Test 41 API", | ||
"author": "Meorphis Test 41 <api-help1@bolt.com>", | ||
"description": "The official TypeScript library for the Meorphis Test 40 API", | ||
"author": "Meorphis Test 40 <api-help2@bolt.com>", | ||
"types": "dist/index.d.ts", | ||
"main": "dist/index.js", | ||
"type": "commonjs", | ||
"repository": "github:stainless-api/meorphis-test", | ||
"repository": "github:meorphis/meorphis-test", | ||
"license": "Apache-2.0", | ||
"packageManager": "[email protected]", | ||
"files": [ | ||
|
@@ -63,8 +63,8 @@ | |
"./shims/web.mjs" | ||
], | ||
"imports": { | ||
"meorphis-test-41": ".", | ||
"meorphis-test-41/*": "./src/*" | ||
"test-repo-1": ".", | ||
"test-repo-1/*": "./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
Oops, something went wrong.