@amos.com/node 0.1.5 → 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 +6 -6
- package/dist/index.d.ts +6 -6
- 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/package.json +1 -1
- package/src/index.ts +9 -9
package/dist/index.d.mts
CHANGED
|
@@ -4660,11 +4660,11 @@ interface operations {
|
|
|
4660
4660
|
};
|
|
4661
4661
|
}
|
|
4662
4662
|
|
|
4663
|
-
declare const PAY_API_BASE_URL_PRODUCTION = "https://pay.
|
|
4664
|
-
declare const PAY_API_BASE_URL_SANDBOX = "https://pay-sandbox.
|
|
4663
|
+
declare const PAY_API_BASE_URL_PRODUCTION = "https://pay.amos.com";
|
|
4664
|
+
declare const PAY_API_BASE_URL_SANDBOX = "https://pay-sandbox.amos.com";
|
|
4665
4665
|
declare const PAY_API_VERSION = "1";
|
|
4666
4666
|
/**
|
|
4667
|
-
* Create a typed `openapi-fetch` client for the
|
|
4667
|
+
* Create a typed `openapi-fetch` client for the Amos Pay API.
|
|
4668
4668
|
*
|
|
4669
4669
|
* The returned client exposes `GET`, `POST`, `PUT`, `DELETE`, etc., each
|
|
4670
4670
|
* fully typed against the OpenAPI spec — paths, path/query/header params,
|
|
@@ -4681,12 +4681,12 @@ declare const PAY_API_VERSION = "1";
|
|
|
4681
4681
|
* createPayApiClient,
|
|
4682
4682
|
* PAY_API_BASE_URL_SANDBOX,
|
|
4683
4683
|
* PAY_API_VERSION,
|
|
4684
|
-
* } from "@
|
|
4684
|
+
* } from "@amos.com/node";
|
|
4685
4685
|
*
|
|
4686
4686
|
* const pay = createPayApiClient({
|
|
4687
4687
|
* baseUrl: PAY_API_BASE_URL_SANDBOX,
|
|
4688
4688
|
* headers: {
|
|
4689
|
-
* "X-Api-Key": process.env.
|
|
4689
|
+
* "X-Api-Key": process.env.AMOS_API_KEY!,
|
|
4690
4690
|
* "X-Api-Version": PAY_API_VERSION,
|
|
4691
4691
|
* },
|
|
4692
4692
|
* });
|
|
@@ -4698,7 +4698,7 @@ declare const PAY_API_VERSION = "1";
|
|
|
4698
4698
|
* ```
|
|
4699
4699
|
*/
|
|
4700
4700
|
declare function createPayApiClient(options: ClientOptions): openapi_fetch.Client<paths, `${string}/${string}`>;
|
|
4701
|
-
/** A configured
|
|
4701
|
+
/** A configured Amos Pay API client returned by {@link createPayApiClient}. */
|
|
4702
4702
|
type PayApiClient = ReturnType<typeof createPayApiClient>;
|
|
4703
4703
|
|
|
4704
4704
|
export { type $defs, PAY_API_BASE_URL_PRODUCTION, PAY_API_BASE_URL_SANDBOX, PAY_API_VERSION, type PayApiClient, type components, createPayApiClient, type operations, type paths, type webhooks };
|
package/dist/index.d.ts
CHANGED
|
@@ -4660,11 +4660,11 @@ interface operations {
|
|
|
4660
4660
|
};
|
|
4661
4661
|
}
|
|
4662
4662
|
|
|
4663
|
-
declare const PAY_API_BASE_URL_PRODUCTION = "https://pay.
|
|
4664
|
-
declare const PAY_API_BASE_URL_SANDBOX = "https://pay-sandbox.
|
|
4663
|
+
declare const PAY_API_BASE_URL_PRODUCTION = "https://pay.amos.com";
|
|
4664
|
+
declare const PAY_API_BASE_URL_SANDBOX = "https://pay-sandbox.amos.com";
|
|
4665
4665
|
declare const PAY_API_VERSION = "1";
|
|
4666
4666
|
/**
|
|
4667
|
-
* Create a typed `openapi-fetch` client for the
|
|
4667
|
+
* Create a typed `openapi-fetch` client for the Amos Pay API.
|
|
4668
4668
|
*
|
|
4669
4669
|
* The returned client exposes `GET`, `POST`, `PUT`, `DELETE`, etc., each
|
|
4670
4670
|
* fully typed against the OpenAPI spec — paths, path/query/header params,
|
|
@@ -4681,12 +4681,12 @@ declare const PAY_API_VERSION = "1";
|
|
|
4681
4681
|
* createPayApiClient,
|
|
4682
4682
|
* PAY_API_BASE_URL_SANDBOX,
|
|
4683
4683
|
* PAY_API_VERSION,
|
|
4684
|
-
* } from "@
|
|
4684
|
+
* } from "@amos.com/node";
|
|
4685
4685
|
*
|
|
4686
4686
|
* const pay = createPayApiClient({
|
|
4687
4687
|
* baseUrl: PAY_API_BASE_URL_SANDBOX,
|
|
4688
4688
|
* headers: {
|
|
4689
|
-
* "X-Api-Key": process.env.
|
|
4689
|
+
* "X-Api-Key": process.env.AMOS_API_KEY!,
|
|
4690
4690
|
* "X-Api-Version": PAY_API_VERSION,
|
|
4691
4691
|
* },
|
|
4692
4692
|
* });
|
|
@@ -4698,7 +4698,7 @@ declare const PAY_API_VERSION = "1";
|
|
|
4698
4698
|
* ```
|
|
4699
4699
|
*/
|
|
4700
4700
|
declare function createPayApiClient(options: ClientOptions): openapi_fetch.Client<paths, `${string}/${string}`>;
|
|
4701
|
-
/** A configured
|
|
4701
|
+
/** A configured Amos Pay API client returned by {@link createPayApiClient}. */
|
|
4702
4702
|
type PayApiClient = ReturnType<typeof createPayApiClient>;
|
|
4703
4703
|
|
|
4704
4704
|
export { type $defs, PAY_API_BASE_URL_PRODUCTION, PAY_API_BASE_URL_SANDBOX, PAY_API_VERSION, type PayApiClient, type components, createPayApiClient, type operations, type paths, type webhooks };
|
package/dist/index.js
CHANGED
|
@@ -37,8 +37,8 @@ __export(index_exports, {
|
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(index_exports);
|
|
39
39
|
var import_openapi_fetch = __toESM(require("openapi-fetch"));
|
|
40
|
-
var PAY_API_BASE_URL_PRODUCTION = "https://pay.
|
|
41
|
-
var PAY_API_BASE_URL_SANDBOX = "https://pay-sandbox.
|
|
40
|
+
var PAY_API_BASE_URL_PRODUCTION = "https://pay.amos.com";
|
|
41
|
+
var PAY_API_BASE_URL_SANDBOX = "https://pay-sandbox.amos.com";
|
|
42
42
|
var PAY_API_VERSION = "1";
|
|
43
43
|
function createPayApiClient(options) {
|
|
44
44
|
return (0, import_openapi_fetch.default)(options);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import createClient, {\n
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import createClient, {\n\ttype ClientOptions,\n\ttype Middleware,\n} from \"openapi-fetch\";\nimport type { paths } from \"../openapi/schema\";\n\nexport * from \"../openapi/schema\";\n\nexport const PAY_API_BASE_URL_PRODUCTION = \"https://pay.amos.com\";\nexport const PAY_API_BASE_URL_SANDBOX = \"https://pay-sandbox.amos.com\";\nexport const PAY_API_VERSION = \"1\";\n\n/**\n * Create a typed `openapi-fetch` client for the Amos Pay API.\n *\n * The returned client exposes `GET`, `POST`, `PUT`, `DELETE`, etc., each\n * fully typed against the OpenAPI spec — paths, path/query/header params,\n * request bodies, and response bodies are all checked at compile time.\n *\n * Provide credentials and the required `X-Api-Version` header either as\n * default `headers` here or via `params.header` on each call. Use\n * `client.use(middleware)` to add per-request behavior such as fresh\n * idempotency keys.\n *\n * @example\n * ```ts\n * import {\n * createPayApiClient,\n * PAY_API_BASE_URL_SANDBOX,\n * PAY_API_VERSION,\n * } from \"@amos.com/node\";\n *\n * const pay = createPayApiClient({\n * baseUrl: PAY_API_BASE_URL_SANDBOX,\n * headers: {\n * \"X-Api-Key\": process.env.AMOS_API_KEY!,\n * \"X-Api-Version\": PAY_API_VERSION,\n * },\n * });\n *\n * const { data, error } = await pay.POST(\"/customers\", {\n * params: { header: { \"X-Api-Version\": PAY_API_VERSION } },\n * body: { customer: { email: \"alex@example.com\" } },\n * });\n * ```\n */\nexport function createPayApiClient(options: ClientOptions) {\n\treturn createClient<paths>(options);\n}\n\n/** A configured Amos Pay API client returned by {@link createPayApiClient}. */\nexport type PayApiClient = ReturnType<typeof createPayApiClient>;\n\nexport type { ClientOptions, Middleware };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAGO;AAKA,IAAM,8BAA8B;AACpC,IAAM,2BAA2B;AACjC,IAAM,kBAAkB;AAoCxB,SAAS,mBAAmB,SAAwB;AAC1D,aAAO,qBAAAA,SAAoB,OAAO;AACnC;","names":["createClient"]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
import createClient from "openapi-fetch";
|
|
3
|
-
var PAY_API_BASE_URL_PRODUCTION = "https://pay.
|
|
4
|
-
var PAY_API_BASE_URL_SANDBOX = "https://pay-sandbox.
|
|
3
|
+
var PAY_API_BASE_URL_PRODUCTION = "https://pay.amos.com";
|
|
4
|
+
var PAY_API_BASE_URL_SANDBOX = "https://pay-sandbox.amos.com";
|
|
5
5
|
var PAY_API_VERSION = "1";
|
|
6
6
|
function createPayApiClient(options) {
|
|
7
7
|
return createClient(options);
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import createClient, {\n
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import createClient, {\n\ttype ClientOptions,\n\ttype Middleware,\n} from \"openapi-fetch\";\nimport type { paths } from \"../openapi/schema\";\n\nexport * from \"../openapi/schema\";\n\nexport const PAY_API_BASE_URL_PRODUCTION = \"https://pay.amos.com\";\nexport const PAY_API_BASE_URL_SANDBOX = \"https://pay-sandbox.amos.com\";\nexport const PAY_API_VERSION = \"1\";\n\n/**\n * Create a typed `openapi-fetch` client for the Amos Pay API.\n *\n * The returned client exposes `GET`, `POST`, `PUT`, `DELETE`, etc., each\n * fully typed against the OpenAPI spec — paths, path/query/header params,\n * request bodies, and response bodies are all checked at compile time.\n *\n * Provide credentials and the required `X-Api-Version` header either as\n * default `headers` here or via `params.header` on each call. Use\n * `client.use(middleware)` to add per-request behavior such as fresh\n * idempotency keys.\n *\n * @example\n * ```ts\n * import {\n * createPayApiClient,\n * PAY_API_BASE_URL_SANDBOX,\n * PAY_API_VERSION,\n * } from \"@amos.com/node\";\n *\n * const pay = createPayApiClient({\n * baseUrl: PAY_API_BASE_URL_SANDBOX,\n * headers: {\n * \"X-Api-Key\": process.env.AMOS_API_KEY!,\n * \"X-Api-Version\": PAY_API_VERSION,\n * },\n * });\n *\n * const { data, error } = await pay.POST(\"/customers\", {\n * params: { header: { \"X-Api-Version\": PAY_API_VERSION } },\n * body: { customer: { email: \"alex@example.com\" } },\n * });\n * ```\n */\nexport function createPayApiClient(options: ClientOptions) {\n\treturn createClient<paths>(options);\n}\n\n/** A configured Amos Pay API client returned by {@link createPayApiClient}. */\nexport type PayApiClient = ReturnType<typeof createPayApiClient>;\n\nexport type { ClientOptions, Middleware };\n"],"mappings":";AAAA,OAAO,kBAGA;AAKA,IAAM,8BAA8B;AACpC,IAAM,2BAA2B;AACjC,IAAM,kBAAkB;AAoCxB,SAAS,mBAAmB,SAAwB;AAC1D,SAAO,aAAoB,OAAO;AACnC;","names":[]}
|
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 };
|