@amos.com/node 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +89 -296
- package/dist/index.d.ts +89 -296
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/openapi/schema.ts +83 -290
- package/package.json +1 -1
- package/src/index.ts +9 -9
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import createClient, {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type ClientOptions,
|
|
3
|
+
type Middleware,
|
|
4
4
|
} from "openapi-fetch";
|
|
5
5
|
import type { paths } from "../openapi/schema";
|
|
6
6
|
|
|
7
7
|
export * from "../openapi/schema";
|
|
8
8
|
|
|
9
|
-
export const PAY_API_BASE_URL_PRODUCTION = "https://pay.
|
|
10
|
-
export const PAY_API_BASE_URL_SANDBOX = "https://pay-sandbox.
|
|
9
|
+
export const PAY_API_BASE_URL_PRODUCTION = "https://pay.amos.com";
|
|
10
|
+
export const PAY_API_BASE_URL_SANDBOX = "https://pay-sandbox.amos.com";
|
|
11
11
|
export const PAY_API_VERSION = "1";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Create a typed `openapi-fetch` client for the
|
|
14
|
+
* Create a typed `openapi-fetch` client for the Amos Pay API.
|
|
15
15
|
*
|
|
16
16
|
* The returned client exposes `GET`, `POST`, `PUT`, `DELETE`, etc., each
|
|
17
17
|
* fully typed against the OpenAPI spec — paths, path/query/header params,
|
|
@@ -28,12 +28,12 @@ export const PAY_API_VERSION = "1";
|
|
|
28
28
|
* createPayApiClient,
|
|
29
29
|
* PAY_API_BASE_URL_SANDBOX,
|
|
30
30
|
* PAY_API_VERSION,
|
|
31
|
-
* } from "@
|
|
31
|
+
* } from "@amos.com/node";
|
|
32
32
|
*
|
|
33
33
|
* const pay = createPayApiClient({
|
|
34
34
|
* baseUrl: PAY_API_BASE_URL_SANDBOX,
|
|
35
35
|
* headers: {
|
|
36
|
-
* "X-Api-Key": process.env.
|
|
36
|
+
* "X-Api-Key": process.env.AMOS_API_KEY!,
|
|
37
37
|
* "X-Api-Version": PAY_API_VERSION,
|
|
38
38
|
* },
|
|
39
39
|
* });
|
|
@@ -45,10 +45,10 @@ export const PAY_API_VERSION = "1";
|
|
|
45
45
|
* ```
|
|
46
46
|
*/
|
|
47
47
|
export function createPayApiClient(options: ClientOptions) {
|
|
48
|
-
|
|
48
|
+
return createClient<paths>(options);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
/** A configured
|
|
51
|
+
/** A configured Amos Pay API client returned by {@link createPayApiClient}. */
|
|
52
52
|
export type PayApiClient = ReturnType<typeof createPayApiClient>;
|
|
53
53
|
|
|
54
54
|
export type { ClientOptions, Middleware };
|