@henrylabs-interview/payment-processor 0.1.2

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 ADDED
@@ -0,0 +1,15 @@
1
+ # henry-labs/take-home
2
+
3
+ To install dependencies:
4
+
5
+ ```bash
6
+ bun install
7
+ ```
8
+
9
+ To run:
10
+
11
+ ```bash
12
+ bun run index.ts
13
+ ```
14
+
15
+ This project was created using `bun init` in bun v1.3.9. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime.
@@ -0,0 +1,8 @@
1
+ export interface ClientOptions {
2
+ apiKey: string;
3
+ }
4
+ export declare class MySDK {
5
+ private apiKey;
6
+ constructor(options: ClientOptions);
7
+ getData(): Promise<unknown>;
8
+ }
package/dist/index.js ADDED
@@ -0,0 +1,48 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropNames = Object.getOwnPropertyNames;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __moduleCache = /* @__PURE__ */ new WeakMap;
6
+ var __toCommonJS = (from) => {
7
+ var entry = __moduleCache.get(from), desc;
8
+ if (entry)
9
+ return entry;
10
+ entry = __defProp({}, "__esModule", { value: true });
11
+ if (from && typeof from === "object" || typeof from === "function")
12
+ __getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ }));
16
+ __moduleCache.set(from, entry);
17
+ return entry;
18
+ };
19
+ var __export = (target, all) => {
20
+ for (var name in all)
21
+ __defProp(target, name, {
22
+ get: all[name],
23
+ enumerable: true,
24
+ configurable: true,
25
+ set: (newValue) => all[name] = () => newValue
26
+ });
27
+ };
28
+
29
+ // src/index.ts
30
+ var exports_src = {};
31
+ __export(exports_src, {
32
+ MySDK: () => MySDK
33
+ });
34
+ module.exports = __toCommonJS(exports_src);
35
+
36
+ class MySDK {
37
+ apiKey;
38
+ constructor(options) {
39
+ this.apiKey = options.apiKey;
40
+ }
41
+ async getData() {
42
+ return fetch("https://api.example.com/data", {
43
+ headers: {
44
+ Authorization: `Bearer ${this.apiKey}`
45
+ }
46
+ }).then((res) => res.json());
47
+ }
48
+ }
package/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "@henrylabs-interview/payment-processor",
3
+ "version": "0.1.2",
4
+ "type": "module",
5
+ "main": "./dist/index.cjs",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.mjs",
12
+ "require": "./dist/index.cjs"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "scripts": {
19
+ "build": "bun run build.ts && bunx tsc -p tsconfig.build.json",
20
+ "dev": "bun run src/index.ts"
21
+ },
22
+ "devDependencies": {
23
+ "@types/bun": "latest",
24
+ "typescript": "^5"
25
+ }
26
+ }