@amos.com/node 0.1.0 → 0.1.1
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/README.md +63 -106
- package/dist/index.d.mts +4452 -0
- package/dist/index.d.ts +4452 -0
- package/dist/index.js +53 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +15 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +5 -3
package/dist/index.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
PAY_API_BASE_URL_PRODUCTION: () => PAY_API_BASE_URL_PRODUCTION,
|
|
34
|
+
PAY_API_BASE_URL_SANDBOX: () => PAY_API_BASE_URL_SANDBOX,
|
|
35
|
+
PAY_API_VERSION: () => PAY_API_VERSION,
|
|
36
|
+
createPayApiClient: () => createPayApiClient
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(index_exports);
|
|
39
|
+
var import_openapi_fetch = __toESM(require("openapi-fetch"));
|
|
40
|
+
var PAY_API_BASE_URL_PRODUCTION = "https://pay.subfi.com";
|
|
41
|
+
var PAY_API_BASE_URL_SANDBOX = "https://pay-sandbox.subfi.com";
|
|
42
|
+
var PAY_API_VERSION = "1";
|
|
43
|
+
function createPayApiClient(options) {
|
|
44
|
+
return (0, import_openapi_fetch.default)(options);
|
|
45
|
+
}
|
|
46
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
+
0 && (module.exports = {
|
|
48
|
+
PAY_API_BASE_URL_PRODUCTION,
|
|
49
|
+
PAY_API_BASE_URL_SANDBOX,
|
|
50
|
+
PAY_API_VERSION,
|
|
51
|
+
createPayApiClient
|
|
52
|
+
});
|
|
53
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import createClient, {\n type ClientOptions,\n type 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.subfi.com\";\nexport const PAY_API_BASE_URL_SANDBOX = \"https://pay-sandbox.subfi.com\";\nexport const PAY_API_VERSION = \"1\";\n\n/**\n * Create a typed `openapi-fetch` client for the SubFi 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 \"@subfico/pay-js-sdk/api\";\n *\n * const pay = createPayApiClient({\n * baseUrl: PAY_API_BASE_URL_SANDBOX,\n * headers: {\n * \"X-Api-Key\": process.env.SUBFI_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 return createClient<paths>(options);\n}\n\n/** A configured SubFi 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;AACzD,aAAO,qBAAAA,SAAoB,OAAO;AACpC;","names":["createClient"]}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import createClient from "openapi-fetch";
|
|
3
|
+
var PAY_API_BASE_URL_PRODUCTION = "https://pay.subfi.com";
|
|
4
|
+
var PAY_API_BASE_URL_SANDBOX = "https://pay-sandbox.subfi.com";
|
|
5
|
+
var PAY_API_VERSION = "1";
|
|
6
|
+
function createPayApiClient(options) {
|
|
7
|
+
return createClient(options);
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
PAY_API_BASE_URL_PRODUCTION,
|
|
11
|
+
PAY_API_BASE_URL_SANDBOX,
|
|
12
|
+
PAY_API_VERSION,
|
|
13
|
+
createPayApiClient
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import createClient, {\n type ClientOptions,\n type 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.subfi.com\";\nexport const PAY_API_BASE_URL_SANDBOX = \"https://pay-sandbox.subfi.com\";\nexport const PAY_API_VERSION = \"1\";\n\n/**\n * Create a typed `openapi-fetch` client for the SubFi 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 \"@subfico/pay-js-sdk/api\";\n *\n * const pay = createPayApiClient({\n * baseUrl: PAY_API_BASE_URL_SANDBOX,\n * headers: {\n * \"X-Api-Key\": process.env.SUBFI_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 return createClient<paths>(options);\n}\n\n/** A configured SubFi 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;AACzD,SAAO,aAAoB,OAAO;AACpC;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amos.com/node",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Node.js client for the Amos Pay API.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -19,9 +19,10 @@
|
|
|
19
19
|
],
|
|
20
20
|
"scripts": {
|
|
21
21
|
"biome": "biome check --write",
|
|
22
|
-
"
|
|
23
|
-
"
|
|
22
|
+
"build": "tsup",
|
|
23
|
+
"typecheck": "tsc --noEmit",
|
|
24
24
|
"generate": "git -C ../openapi pull && rm -rf openapi/schema.ts && openapi-typescript ../openapi/amos/openapi.public.yaml --output openapi/schema.ts",
|
|
25
|
+
"prepack": "npm run build",
|
|
25
26
|
"changeset": "changeset",
|
|
26
27
|
"version": "changeset version",
|
|
27
28
|
"release": "npm run build && changeset publish"
|
|
@@ -50,6 +51,7 @@
|
|
|
50
51
|
"@changesets/cli": "2.31.0",
|
|
51
52
|
"@types/node": "25.6.2",
|
|
52
53
|
"openapi-typescript": "7.13.0",
|
|
54
|
+
"tsup": "^8.5.1",
|
|
53
55
|
"typescript": "5.9.3"
|
|
54
56
|
},
|
|
55
57
|
"engines": {
|