@ribpay/oxlin
Advanced tools
Comparing version 1.0.0-aplha.5 to 1.0.0-beta.0
{ | ||
"name": "@ribpay/oxlin", | ||
"version": "1.0.0-aplha.5", | ||
"version": "1.0.0-beta.0", | ||
"description": "The official TypeScript library for the Oxlin API", | ||
"author": "Oxlin <dev-feedback@oxlin.com>", | ||
"types": "./index.d.ts", | ||
"main": "./index.js", | ||
"author": "Oxlin <support@oxlin.zendesk.com>", | ||
"types": "dist/index.d.ts", | ||
"main": "dist/index.js", | ||
"type": "commonjs", | ||
"repository": "github:fortaine/ribpay-node", | ||
"repository": "github:stainless-sdks/oxlin-node", | ||
"license": "Apache-2.0", | ||
"packageManager": "yarn@1.22.22", | ||
"files": [ | ||
"dist" | ||
"dist", | ||
"api.md" | ||
], | ||
@@ -37,2 +38,20 @@ "private": false, | ||
}, | ||
"devDependencies": { | ||
"@swc/core": "^1.3.102", | ||
"@swc/jest": "^0.2.29", | ||
"@types/jest": "^29.4.0", | ||
"@typescript-eslint/eslint-plugin": "^6.7.0", | ||
"@typescript-eslint/parser": "^6.7.0", | ||
"eslint": "^8.49.0", | ||
"eslint-plugin-prettier": "^5.0.1", | ||
"eslint-plugin-unused-imports": "^3.0.0", | ||
"jest": "^29.4.0", | ||
"prettier": "^3.0.0", | ||
"ts-jest": "^29.1.0", | ||
"ts-morph": "^19.0.0", | ||
"ts-node": "^10.5.0", | ||
"tsc-multi": "^1.1.0", | ||
"tsconfig-paths": "^4.0.0", | ||
"typescript": "^4.8.2" | ||
}, | ||
"sideEffects": [ | ||
@@ -47,4 +66,4 @@ "./_shims/index.js", | ||
"imports": { | ||
"oxlin": ".", | ||
"oxlin/*": "./src/*" | ||
"@ribpay/oxlin": ".", | ||
"@ribpay/oxlin/*": "./src/*" | ||
}, | ||
@@ -54,57 +73,57 @@ "exports": { | ||
"deno": { | ||
"types": "./_shims/auto/*.d.ts", | ||
"require": "./_shims/auto/*.js", | ||
"default": "./_shims/auto/*.mjs" | ||
"types": "./dist/_shims/auto/*.d.ts", | ||
"require": "./dist/_shims/auto/*.js", | ||
"default": "./dist/_shims/auto/*.mjs" | ||
}, | ||
"bun": { | ||
"types": "./_shims/auto/*.d.ts", | ||
"require": "./_shims/auto/*-bun.js", | ||
"default": "./_shims/auto/*-bun.mjs" | ||
"types": "./dist/_shims/auto/*.d.ts", | ||
"require": "./dist/_shims/auto/*-bun.js", | ||
"default": "./dist/_shims/auto/*-bun.mjs" | ||
}, | ||
"browser": { | ||
"types": "./_shims/auto/*.d.ts", | ||
"require": "./_shims/auto/*.js", | ||
"default": "./_shims/auto/*.mjs" | ||
"types": "./dist/_shims/auto/*.d.ts", | ||
"require": "./dist/_shims/auto/*.js", | ||
"default": "./dist/_shims/auto/*.mjs" | ||
}, | ||
"worker": { | ||
"types": "./_shims/auto/*.d.ts", | ||
"require": "./_shims/auto/*.js", | ||
"default": "./_shims/auto/*.mjs" | ||
"types": "./dist/_shims/auto/*.d.ts", | ||
"require": "./dist/_shims/auto/*.js", | ||
"default": "./dist/_shims/auto/*.mjs" | ||
}, | ||
"workerd": { | ||
"types": "./_shims/auto/*.d.ts", | ||
"require": "./_shims/auto/*.js", | ||
"default": "./_shims/auto/*.mjs" | ||
"types": "./dist/_shims/auto/*.d.ts", | ||
"require": "./dist/_shims/auto/*.js", | ||
"default": "./dist/_shims/auto/*.mjs" | ||
}, | ||
"node": { | ||
"types": "./_shims/auto/*-node.d.ts", | ||
"require": "./_shims/auto/*-node.js", | ||
"default": "./_shims/auto/*-node.mjs" | ||
"types": "./dist/_shims/auto/*-node.d.ts", | ||
"require": "./dist/_shims/auto/*-node.js", | ||
"default": "./dist/_shims/auto/*-node.mjs" | ||
}, | ||
"types": "./_shims/auto/*.d.ts", | ||
"require": "./_shims/auto/*.js", | ||
"default": "./_shims/auto/*.mjs" | ||
"types": "./dist/_shims/auto/*.d.ts", | ||
"require": "./dist/_shims/auto/*.js", | ||
"default": "./dist/_shims/auto/*.mjs" | ||
}, | ||
".": { | ||
"require": { | ||
"types": "./index.d.ts", | ||
"default": "./index.js" | ||
"types": "./dist/index.d.ts", | ||
"default": "./dist/index.js" | ||
}, | ||
"types": "./index.d.mts", | ||
"default": "./index.mjs" | ||
"types": "./dist/index.d.mts", | ||
"default": "./dist/index.mjs" | ||
}, | ||
"./*.mjs": { | ||
"types": "./*.d.ts", | ||
"default": "./*.mjs" | ||
"types": "./dist/*.d.ts", | ||
"default": "./dist/*.mjs" | ||
}, | ||
"./*.js": { | ||
"types": "./*.d.ts", | ||
"default": "./*.js" | ||
"types": "./dist/*.d.ts", | ||
"default": "./dist/*.js" | ||
}, | ||
"./*": { | ||
"types": "./*.d.ts", | ||
"require": "./*.js", | ||
"default": "./*.mjs" | ||
"types": "./dist/*.d.ts", | ||
"require": "./dist/*.js", | ||
"default": "./dist/*.mjs" | ||
} | ||
} | ||
} |
# Oxlin Node API Library | ||
[![NPM version](https://img.shields.io/npm/v/oxlin.svg)](https://npmjs.org/package/oxlin) | ||
[![NPM version](https://img.shields.io/npm/v/@ribpay/oxlin.svg)](https://npmjs.org/package/@ribpay/oxlin) | ||
This library provides convenient access to the Oxlin REST API from server-side TypeScript or JavaScript. | ||
The REST API documentation can be found [on docs.oxlin.com](https://docs.oxlin.com). The full API of this library can be found in [api.md](api.md). | ||
The REST API documentation can be found [on developers.oxlin.io](https://developers.oxlin.io/reference-direct-payment-api). The full API of this library can be found in [api.md](api.md). | ||
@@ -14,7 +14,7 @@ It is generated with [Stainless](https://www.stainlessapi.com/). | ||
```sh | ||
npm install git+ssh://git@github.com:fortaine/ribpay-node.git | ||
npm install @ribpay/oxlin | ||
``` | ||
> [!NOTE] | ||
> Once this package is [published to npm](https://app.stainlessapi.com/docs/guides/publish), this will become: `npm install oxlin` | ||
> Once this package is [published to npm](https://app.stainlessapi.com/docs/guides/publish), this will become: `npm install @ribpay/oxlin` | ||
@@ -27,8 +27,11 @@ ## Usage | ||
```js | ||
import Oxlin from 'oxlin'; | ||
import Oxlin from '@ribpay/oxlin'; | ||
const oxlin = new Oxlin(); | ||
const oxlin = new Oxlin({ | ||
clientId: process.env['OXLIN_CLIENT_ID'], // This is the default and can be omitted | ||
clientSecret: process.env['OXLIN_CLIENT_SECRET'], // This is the default and can be omitted | ||
}); | ||
async function main() { | ||
const orderItem = await oxlin.paymentOrders.orders.create({ redirect_url: 'string' }); | ||
const orderItem = await oxlin.paymentOrders.create({ redirect_url: 'string' }); | ||
@@ -47,9 +50,12 @@ console.log(orderItem.id); | ||
```ts | ||
import Oxlin from 'oxlin'; | ||
import Oxlin from '@ribpay/oxlin'; | ||
const oxlin = new Oxlin(); | ||
const oxlin = new Oxlin({ | ||
clientId: process.env['OXLIN_CLIENT_ID'], // This is the default and can be omitted | ||
clientSecret: process.env['OXLIN_CLIENT_SECRET'], // This is the default and can be omitted | ||
}); | ||
async function main() { | ||
const params: Oxlin.PaymentOrders.OrderCreateParams = { redirect_url: 'string' }; | ||
const orderItem: Oxlin.OrderItem = await oxlin.paymentOrders.orders.create(params); | ||
const params: Oxlin.PaymentOrderCreateParams = { redirect_url: 'string' }; | ||
const orderItem: Oxlin.OrderItem = await oxlin.paymentOrders.create(params); | ||
} | ||
@@ -71,3 +77,3 @@ | ||
async function main() { | ||
const orderItem = await oxlin.paymentOrders.orders.create({ redirect_url: 'string' }).catch(async (err) => { | ||
const orderItem = await oxlin.paymentOrders.create({ redirect_url: 'string' }).catch(async (err) => { | ||
if (err instanceof Oxlin.APIError) { | ||
@@ -115,3 +121,3 @@ console.log(err.status); // 400 | ||
// Or, configure per-request: | ||
await oxlin.paymentOrders.orders.create({ redirect_url: 'string' }, { | ||
await oxlin.paymentOrders.create({ redirect_url: 'string' }, { | ||
maxRetries: 5, | ||
@@ -133,3 +139,3 @@ }); | ||
// Override per-request: | ||
await oxlin.paymentOrders.orders.create({ redirect_url: 'string' }, { | ||
await oxlin.paymentOrders.create({ redirect_url: 'string' }, { | ||
timeout: 5 * 1000, | ||
@@ -155,7 +161,7 @@ }); | ||
const response = await oxlin.paymentOrders.orders.create({ redirect_url: 'string' }).asResponse(); | ||
const response = await oxlin.paymentOrders.create({ redirect_url: 'string' }).asResponse(); | ||
console.log(response.headers.get('X-My-Header')); | ||
console.log(response.statusText); // access the underlying Response object | ||
const { data: orderItem, response: raw } = await oxlin.paymentOrders.orders | ||
const { data: orderItem, response: raw } = await oxlin.paymentOrders | ||
.create({ redirect_url: 'string' }) | ||
@@ -222,8 +228,8 @@ .withResponse(); | ||
// Note, despite the name, this does not add any polyfills, but expects them to be provided if needed. | ||
import 'oxlin/shims/web'; | ||
import Oxlin from 'oxlin'; | ||
import '@ribpay/oxlin/shims/web'; | ||
import Oxlin from '@ribpay/oxlin'; | ||
``` | ||
To do the inverse, add `import "oxlin/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/fortaine/ribpay-node/tree/main/src/_shims#readme)). | ||
To do the inverse, add `import "@ribpay/oxlin/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-sdks/oxlin-node/tree/main/src/_shims#readme)). | ||
@@ -237,3 +243,3 @@ ### Logging and middleware | ||
import { fetch } from 'undici'; // as one example | ||
import Oxlin from 'oxlin'; | ||
import Oxlin from '@ribpay/oxlin'; | ||
@@ -270,3 +276,3 @@ const client = new Oxlin({ | ||
// Override per-request: | ||
await oxlin.paymentOrders.orders.create( | ||
await oxlin.paymentOrders.create( | ||
{ redirect_url: 'string' }, | ||
@@ -289,3 +295,3 @@ { | ||
We are keen for your feedback; please open an [issue](https://www.github.com/fortaine/ribpay-node/issues) with questions, bugs, or suggestions. | ||
We are keen for your feedback; please open an [issue](https://www.github.com/fortaine/oxlin-node/issues) with questions, bugs, or suggestions. | ||
@@ -299,3 +305,3 @@ ## Requirements | ||
- Node.js 18 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions. | ||
- Deno v1.28.0 or higher, using `import Oxlin from "npm:oxlin"`. | ||
- Deno v1.28.0 or higher, using `import Oxlin from "npm:@ribpay/oxlin"`. | ||
- Bun 1.0 or later. | ||
@@ -302,0 +308,0 @@ - Cloudflare Workers. |
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
Network access
Supply chain riskThis module accesses the network.
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 2 instances in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
801831
310
14567
304
16
5
5