@vritti/api-sdk 0.0.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 +134 -0
- package/dist/index.cjs +34 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/package.json +55 -0
package/README.md
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# @vritti/api-sdk
|
|
2
|
+
|
|
3
|
+
A TypeScript SDK for interacting with Vritti APIs.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@vritti/api-sdk)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
# npm
|
|
12
|
+
npm install @vritti/api-sdk
|
|
13
|
+
|
|
14
|
+
# yarn
|
|
15
|
+
yarn add @vritti/api-sdk
|
|
16
|
+
|
|
17
|
+
# pnpm
|
|
18
|
+
pnpm add @vritti/api-sdk
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import { getHello } from '@vritti/api-sdk';
|
|
25
|
+
|
|
26
|
+
const message = getHello();
|
|
27
|
+
console.log(message); // "Hello, World!"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## API Documentation
|
|
31
|
+
|
|
32
|
+
### `getHello()`
|
|
33
|
+
|
|
34
|
+
Returns a greeting message.
|
|
35
|
+
|
|
36
|
+
**Returns:** `string` - A hello world message
|
|
37
|
+
|
|
38
|
+
**Example:**
|
|
39
|
+
```typescript
|
|
40
|
+
const greeting = getHello();
|
|
41
|
+
// Returns: "Hello, World!"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Development
|
|
45
|
+
|
|
46
|
+
### Prerequisites
|
|
47
|
+
|
|
48
|
+
- Node.js 18+
|
|
49
|
+
- Yarn
|
|
50
|
+
|
|
51
|
+
### Setup
|
|
52
|
+
|
|
53
|
+
Clone the repository and install dependencies:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
git clone https://github.com/vritti-hub/api-sdk.git
|
|
57
|
+
cd api-sdk
|
|
58
|
+
yarn install
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Available Scripts
|
|
62
|
+
|
|
63
|
+
- `yarn dev` - Run the SDK in watch mode using tsx
|
|
64
|
+
- `yarn build` - Build the SDK for production (outputs CJS and ESM formats)
|
|
65
|
+
- `yarn type-check` - Run TypeScript type checking
|
|
66
|
+
- `yarn test` - Run tests
|
|
67
|
+
- `yarn test:watch` - Run tests in watch mode
|
|
68
|
+
- `yarn lint` - Lint source files with ESLint
|
|
69
|
+
- `yarn format` - Format code with Prettier
|
|
70
|
+
- `yarn format:check` - Check code formatting
|
|
71
|
+
- `yarn clean` - Remove build artifacts
|
|
72
|
+
|
|
73
|
+
### Project Structure
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
api-sdk/
|
|
77
|
+
├── src/
|
|
78
|
+
│ └── index.ts # Main entry point
|
|
79
|
+
├── dist/ # Build output (generated)
|
|
80
|
+
├── .prettierrc # Prettier configuration
|
|
81
|
+
├── eslint.config.js # ESLint configuration
|
|
82
|
+
├── tsconfig.json # TypeScript configuration
|
|
83
|
+
└── package.json # Package configuration
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Building
|
|
87
|
+
|
|
88
|
+
The SDK is built using [tsup](https://tsup.egoist.dev/) which generates both CommonJS and ESM outputs with TypeScript declarations:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
yarn build
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
This will create:
|
|
95
|
+
- `dist/index.js` - ESM build
|
|
96
|
+
- `dist/index.cjs` - CommonJS build
|
|
97
|
+
- `dist/index.d.ts` - TypeScript declarations for ESM
|
|
98
|
+
- `dist/index.d.cts` - TypeScript declarations for CJS
|
|
99
|
+
|
|
100
|
+
## Testing
|
|
101
|
+
|
|
102
|
+
Run the test suite:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
yarn test
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Run tests in watch mode during development:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
yarn test:watch
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Contributing
|
|
115
|
+
|
|
116
|
+
Contributions are welcome! Please follow these steps:
|
|
117
|
+
|
|
118
|
+
1. Fork the repository
|
|
119
|
+
2. Create a feature branch: `git checkout -b feature/my-feature`
|
|
120
|
+
3. Make your changes
|
|
121
|
+
4. Run tests and linting: `yarn test && yarn lint`
|
|
122
|
+
5. Commit your changes: `git commit -am 'Add new feature'`
|
|
123
|
+
6. Push to the branch: `git push origin feature/my-feature`
|
|
124
|
+
7. Submit a pull request
|
|
125
|
+
|
|
126
|
+
## License
|
|
127
|
+
|
|
128
|
+
MIT © [Shashank Raju](https://github.com/vritti-hub)
|
|
129
|
+
|
|
130
|
+
## Author
|
|
131
|
+
|
|
132
|
+
**Shashank Raju**
|
|
133
|
+
- Email: shashank@vrittiai.com
|
|
134
|
+
- GitHub: [@vritti-hub](https://github.com/vritti-hub)
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/index.ts
|
|
22
|
+
var index_exports = {};
|
|
23
|
+
__export(index_exports, {
|
|
24
|
+
getHello: () => getHello
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(index_exports);
|
|
27
|
+
var getHello = /* @__PURE__ */ __name(() => {
|
|
28
|
+
return "Hello, World!";
|
|
29
|
+
}, "getHello");
|
|
30
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
+
0 && (module.exports = {
|
|
32
|
+
getHello
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export const getHello = () => {\n return 'Hello, World!';\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,WAAW,6BAAM;AAC5B,SAAO;AACT,GAFwB;","names":[]}
|
package/dist/index.d.cts
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
4
|
+
// src/index.ts
|
|
5
|
+
var getHello = /* @__PURE__ */ __name(() => {
|
|
6
|
+
return "Hello, World!";
|
|
7
|
+
}, "getHello");
|
|
8
|
+
export {
|
|
9
|
+
getHello
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export const getHello = () => {\n return 'Hello, World!';\n};\n"],"mappings":";;;;AAAO,IAAM,WAAW,6BAAM;AAC5B,SAAO;AACT,GAFwB;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vritti/api-sdk",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"main": "./dist/index.cjs",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"require": {
|
|
15
|
+
"types": "./dist/index.d.cts",
|
|
16
|
+
"default": "./dist/index.cjs"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/vritti-hub/api-sdk.git"
|
|
26
|
+
},
|
|
27
|
+
"author": "Shashank Raju <shashank@vrittiai.com>",
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"private": false,
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"dev": "tsx --watch src/index.ts",
|
|
35
|
+
"build": "tsup src/index.ts --format cjs,esm --dts --clean",
|
|
36
|
+
"type-check": "tsc --noEmit",
|
|
37
|
+
"test": "tsx --test src/**/*.test.ts",
|
|
38
|
+
"test:watch": "tsx --test --watch src/**/*.test.ts",
|
|
39
|
+
"lint": "eslint src",
|
|
40
|
+
"format": "prettier --write src",
|
|
41
|
+
"format:check": "prettier --check src",
|
|
42
|
+
"clean": "rm -rf dist",
|
|
43
|
+
"prepublishOnly": "yarn type-check && yarn test && yarn build"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@eslint/js": "^9.38.0",
|
|
47
|
+
"@types/node": "^24.9.1",
|
|
48
|
+
"eslint": "^9.38.0",
|
|
49
|
+
"prettier": "^3.6.2",
|
|
50
|
+
"tsup": "^8.5.0",
|
|
51
|
+
"tsx": "^4.20.6",
|
|
52
|
+
"typescript": "^5.9.3",
|
|
53
|
+
"typescript-eslint": "^8.46.2"
|
|
54
|
+
}
|
|
55
|
+
}
|