@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/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":[]}
|