Skip to content

Commit 9d743e1

Browse files
committed
initial commit
0 parents  commit 9d743e1

17 files changed

+5311
-0
lines changed

.gitignore

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
.DS_Store
2+
.idea
3+
# Logs
4+
logs
5+
*.log
6+
npm-debug.log*
7+
yarn-debug.log*
8+
yarn-error.log*
9+
lerna-debug.log*
10+
.pnpm-debug.log*
11+
12+
# Diagnostic reports (https://nodejs.org/api/report.html)
13+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
14+
15+
# Runtime data
16+
pids
17+
*.pid
18+
*.seed
19+
*.pid.lock
20+
21+
# Directory for instrumented libs generated by jscoverage/JSCover
22+
lib-cov
23+
24+
# Coverage directory used by tools like istanbul
25+
coverage
26+
*.lcov
27+
28+
# nyc test coverage
29+
.nyc_output
30+
31+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
32+
.grunt
33+
34+
# Bower dependency directory (https://bower.io/)
35+
bower_components
36+
37+
# node-waf configuration
38+
.lock-wscript
39+
40+
# Compiled binary addons (https://nodejs.org/api/addons.html)
41+
build/Release
42+
43+
# Dependency directories
44+
node_modules/
45+
jspm_packages/
46+
47+
# Snowpack dependency directory (https://snowpack.dev/)
48+
web_modules/
49+
50+
# TypeScript cache
51+
*.tsbuildinfo
52+
53+
# Optional npm cache directory
54+
.npm
55+
56+
# Optional eslint cache
57+
.eslintcache
58+
59+
# Optional stylelint cache
60+
.stylelintcache
61+
62+
# Microbundle cache
63+
.rpt2_cache/
64+
.rts2_cache_cjs/
65+
.rts2_cache_es/
66+
.rts2_cache_umd/
67+
68+
# Optional REPL history
69+
.node_repl_history
70+
71+
# Output of 'npm pack'
72+
*.tgz
73+
74+
# Yarn Integrity file
75+
.yarn-integrity
76+
77+
# dotenv environment variable files
78+
.env
79+
.env.development.local
80+
.env.test.local
81+
.env.production.local
82+
.env.local
83+
84+
# parcel-bundler cache (https://parceljs.org/)
85+
.cache
86+
.parcel-cache
87+
88+
# Next.js build output
89+
.next
90+
out
91+
92+
# Nuxt.js build / generate output
93+
.nuxt
94+
dist
95+
96+
# Gatsby files
97+
.cache/
98+
# Comment in the public line in if your project uses Gatsby and not Next.js
99+
# https://nextjs.org/blog/next-9-1#public-directory-support
100+
# public
101+
102+
# vuepress build output
103+
.vuepress/dist
104+
105+
# vuepress v2.x temp and cache directory
106+
.temp
107+
.cache
108+
109+
# Docusaurus cache and generated files
110+
.docusaurus
111+
112+
# Serverless directories
113+
.serverless/
114+
115+
# FuseBox cache
116+
.fusebox/
117+
118+
# DynamoDB Local files
119+
.dynamodb/
120+
121+
# TernJS port file
122+
.tern-port
123+
124+
# Stores VSCode versions used for testing VSCode extensions
125+
.vscode-test
126+
127+
# yarn v2
128+
.yarn/cache
129+
.yarn/unplugged
130+
.yarn/build-state.yml
131+
.yarn/install-state.gz
132+
.pnp.*

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Changelog
2+
3+
## 1.0.0 - 2024-06-06
4+
5+
- Initial release of the SharpAPI Node.js SDK Client.
6+
- Included comprehensive documentation and examples.
7+

LICENCE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
MIT License
2+
3+
Copyright (c) 2024 SharpAPI
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10+

README.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# SharpAPI Node.js Client SDK
2+
3+
🚀 Automate workflows with AI-powered API
4+
5+
## Leverage AI API to streamline workflows in E-Commerce, Marketing, Content Management, HR Tech, Travel, and more.
6+
7+
[![Version](https://img.shields.io/npm/v/sharpapi-node-client.svg)](https://www.npmjs.com/package/sharpapi-node-client)
8+
[![License](https://img.shields.io/npm/l/sharpapi-node-client.svg)](https://github.com/yourusername/sharpapi-node-client/blob/main/LICENSE.md)
9+
10+
#### Save time on repetitive content analysis and generation tasks that your app users perform daily.
11+
12+
See more at [SharpAPI.com Website »](https://sharpapi.com/)
13+
14+
## Requirements
15+
16+
- Node.js >= 14.x
17+
18+
19+
## Installation
20+
21+
```bash
22+
npm install sharpapi-node-client
23+
```
24+
25+
## What can it do for you?
26+
27+
- **E-commerce**
28+
- Generate engaging product introductions.
29+
- Create personalized thank-you emails.
30+
- Streamline product categorization.
31+
- Perform sentiment analysis on product reviews.
32+
33+
- **Content & Marketing Automation**
34+
- Translate text for a global audience.
35+
- Paraphrase and proofread any text.
36+
- Detect spam content.
37+
- Extract contact information.
38+
- Summarize content and generate keywords/tags.
39+
- Generate SEO meta tags.
40+
41+
- **HR Tech**
42+
- Generate job descriptions.
43+
- Identify related job positions and skills.
44+
- Parse and extract information from resumes.
45+
46+
- **Travel, Tourism & Hospitality**
47+
- Analyze sentiment in travel reviews.
48+
- Categorize tours, activities, and hospitality products.
49+
50+
## Usage
51+
52+
### Simple Example
53+
54+
```javascript
55+
const { SharpApiService } = require('sharpapi-node-client');
56+
57+
const sharpApi = new SharpApiService('YOUR_SHARP_API_KEY');
58+
59+
(async () => {
60+
try {
61+
const statusUrl = await sharpApi.productCategories(
62+
'Lenovo Chromebook Laptop (2023), 14" FHD Touchscreen Slim 3, 8-Core MediaTek Kompanio 520 CPU, 4GB RAM, 128GB Storage',
63+
'German', // optional language
64+
400, // optional quantity
65+
'Neutral', // optional voice tone
66+
'Optional current e-store categories' // optional context
67+
);
68+
69+
const resultSharpApiJob = await sharpApi.fetchResults(statusUrl);
70+
console.log(resultSharpApiJob.getResultJson());
71+
} catch (error) {
72+
console.error(error);
73+
}
74+
})();
75+
```
76+
77+
## Documentation
78+
For detailed usage and API methods, please refer to the [SharpAPI.com Documentation](https://sharpapi.com/documentation).
79+
80+
## Changelog
81+
Please see CHANGELOG.md for more information on what has changed recently.
82+
83+
## License
84+
85+
The MIT License (MIT). Please see License File for more information.
86+
87+
88+
89+
90+

__mocks__/axios.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const axios = jest.genMockFromModule('axios');
2+
3+
axios.create = jest.fn(() => axios);
4+
5+
axios.get = jest.fn(() => Promise.resolve({ data: {} }));
6+
axios.post = jest.fn(() => Promise.resolve({ data: {} }));
7+
8+
module.exports = axios;
9+

0 commit comments

Comments
 (0)