@baziapi/sdk 1.0.0 → 1.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 +28 -28
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +12 -12
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @baziapi/sdk
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/@baziapi/sdk)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
[](https://www.typescriptlang.org/)
|
|
6
6
|
|
|
@@ -59,7 +59,7 @@ console.log(result.luckPillars?.pillars); // 10-year luck cycles
|
|
|
59
59
|
```typescript
|
|
60
60
|
const client = new BaziClient({
|
|
61
61
|
apiKey: 'bazi_xxxx', // Your BaZi API key
|
|
62
|
-
baseUrl: 'https://api.
|
|
62
|
+
baseUrl: 'https://api.baziapi.pro', // API base URL (default: production)
|
|
63
63
|
timeout: 10_000, // Request timeout in ms (default: 10s)
|
|
64
64
|
retries: 3, // Retry attempts for transient errors (default: 3)
|
|
65
65
|
retryDelay: 500, // Base retry delay in ms, exponential (default: 500ms)
|
|
@@ -175,7 +175,7 @@ import type {
|
|
|
175
175
|
For CSP-compliant usage, add the API domain to your `connect-src` directive:
|
|
176
176
|
|
|
177
177
|
```
|
|
178
|
-
Content-Security-Policy: connect-src 'self' https://api.
|
|
178
|
+
Content-Security-Policy: connect-src 'self' https://api.baziapi.pro;
|
|
179
179
|
```
|
|
180
180
|
|
|
181
181
|
---
|
|
@@ -700,7 +700,7 @@ functions:
|
|
|
700
700
|
| Field | Value |
|
|
701
701
|
| ------------------ | ----------------------------------------------- |
|
|
702
702
|
| **Method** | `POST` |
|
|
703
|
-
| **URL** | `https://api.
|
|
703
|
+
| **URL** | `https://api.baziapi.pro/api/v1/bazi/calculate` |
|
|
704
704
|
| **Authentication** | Header Auth → `Authorization: Bearer bazi_xxxx` |
|
|
705
705
|
| **Content-Type** | `application/json` |
|
|
706
706
|
|
|
@@ -741,11 +741,11 @@ return [{ json: result }];
|
|
|
741
741
|
|
|
742
742
|
**Option A — Webhooks by Zapier → POST**:
|
|
743
743
|
|
|
744
|
-
| Field | Value
|
|
745
|
-
| ---------------- |
|
|
746
|
-
| **URL** | `https://api.
|
|
747
|
-
| **Payload Type** | `JSON`
|
|
748
|
-
| **Headers** | `Authorization: Bearer bazi_xxxx`
|
|
744
|
+
| Field | Value |
|
|
745
|
+
| ---------------- | ----------------------------------------------- |
|
|
746
|
+
| **URL** | `https://api.baziapi.pro/api/v1/bazi/calculate` |
|
|
747
|
+
| **Payload Type** | `JSON` |
|
|
748
|
+
| **Headers** | `Authorization: Bearer bazi_xxxx` |
|
|
749
749
|
|
|
750
750
|
**Data:**
|
|
751
751
|
|
|
@@ -813,12 +813,12 @@ export default defineComponent({
|
|
|
813
813
|
|
|
814
814
|
Use **HTTP → Make a request** module:
|
|
815
815
|
|
|
816
|
-
| Field | Value
|
|
817
|
-
| ------------- |
|
|
818
|
-
| **URL** | `https://api.
|
|
819
|
-
| **Method** | `POST`
|
|
820
|
-
| **Headers** | `Authorization: Bearer bazi_xxxx`
|
|
821
|
-
| **Body type** | `Raw` → `application/json`
|
|
816
|
+
| Field | Value |
|
|
817
|
+
| ------------- | ----------------------------------------------- |
|
|
818
|
+
| **URL** | `https://api.baziapi.pro/api/v1/bazi/calculate` |
|
|
819
|
+
| **Method** | `POST` |
|
|
820
|
+
| **Headers** | `Authorization: Bearer bazi_xxxx` |
|
|
821
|
+
| **Body type** | `Raw` → `application/json` |
|
|
822
822
|
|
|
823
823
|
**Body:**
|
|
824
824
|
|
|
@@ -837,7 +837,7 @@ Use **HTTP → Make a request** module:
|
|
|
837
837
|
#### cURL (Testing / CI)
|
|
838
838
|
|
|
839
839
|
```bash
|
|
840
|
-
curl -X POST https://api.
|
|
840
|
+
curl -X POST https://api.baziapi.pro/api/v1/bazi/calculate \
|
|
841
841
|
-H "Authorization: Bearer bazi_xxxx" \
|
|
842
842
|
-H "Content-Type: application/json" \
|
|
843
843
|
-d '{
|
|
@@ -859,15 +859,14 @@ To use this SDK in production, you need an active API Key from our platform. We
|
|
|
859
859
|
|
|
860
860
|
### Monthly Plans
|
|
861
861
|
|
|
862
|
-
| Feature
|
|
863
|
-
|
|
|
864
|
-
| **Target**
|
|
865
|
-
| **Price**
|
|
866
|
-
| **Rate Limit**
|
|
867
|
-
| **API Keys**
|
|
868
|
-
| **14-Day Trial** | ✅ | ❌ | ❌ | ❌ |
|
|
862
|
+
| Feature | 🆓 Free | 🚀 Basic | ⚡ Pro | 💎 Premium |
|
|
863
|
+
| -------------- | :--------------: | :-----------: | :-----------: | :-------------: |
|
|
864
|
+
| **Target** | Developer / Test | Indie Dev | Startup | Enterprise |
|
|
865
|
+
| **Price** | $0 / mo | $19 / mo | $49 / mo | $149 / mo |
|
|
866
|
+
| **Rate Limit** | 30 req / min | 300 req / min | 500 req / min | 1,000 req / min |
|
|
867
|
+
| **API Keys** | 1 | 3 | 10 | 30 |
|
|
869
868
|
|
|
870
|
-
### Yearly Plans _(Save
|
|
869
|
+
### Yearly Plans _(Save ~20%)_
|
|
871
870
|
|
|
872
871
|
| Feature | 🆓 Free | 🚀 Basic | ⚡ Pro | 💎 Premium |
|
|
873
872
|
| ---------------------- | :----------: | :-----------: | :-----------: | :-------------: |
|
|
@@ -875,18 +874,19 @@ To use this SDK in production, you need an active API Key from our platform. We
|
|
|
875
874
|
| **Billed Annually** | — | $180 / yr | $468 / yr | $1,428 / yr |
|
|
876
875
|
| **Savings vs Monthly** | — | ~21% off | ~20% off | ~20% off |
|
|
877
876
|
| **Rate Limit** | 30 req / min | 300 req / min | 500 req / min | 1,000 req / min |
|
|
878
|
-
| **API Keys** | 1 | 3 | 10 |
|
|
877
|
+
| **API Keys** | 1 | 3 | 10 | 30 |
|
|
879
878
|
|
|
880
879
|
> 💡 **Need more?** Contact us for custom enterprise plans with higher rate limits and dedicated support.
|
|
881
880
|
|
|
882
|
-
👉 **
|
|
881
|
+
👉 **Get your API Key & View Details:** N/A _(Coming Soon)_
|
|
883
882
|
|
|
884
883
|
---
|
|
885
884
|
|
|
886
885
|
## Support
|
|
887
886
|
|
|
888
|
-
- **Email:**
|
|
889
|
-
- **Documentation:**
|
|
887
|
+
- **Email:** shoyas@github.com
|
|
888
|
+
- **Documentation:** N/A _(Coming Soon)_
|
|
889
|
+
- **Repository:** [https://github.com/Shoyas/bazi-api-sdk](https://github.com/Shoyas/bazi-api-sdk)
|
|
890
890
|
|
|
891
891
|
---
|
|
892
892
|
|
package/dist/index.cjs
CHANGED
|
@@ -655,7 +655,7 @@ class WebhookService {
|
|
|
655
655
|
*
|
|
656
656
|
* @example
|
|
657
657
|
* ```typescript
|
|
658
|
-
* import { BaziClient } from '@
|
|
658
|
+
* import { BaziClient } from '@baziapi/sdk';
|
|
659
659
|
*
|
|
660
660
|
* const client = new BaziClient();
|
|
661
661
|
* const isValid = await client.webhooks.verifySignature({
|
|
@@ -722,7 +722,7 @@ async function verifyWebhookSignature(options) {
|
|
|
722
722
|
var __defProp = Object.defineProperty;
|
|
723
723
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
724
724
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
725
|
-
const DEFAULT_BASE_URL = "https://api.
|
|
725
|
+
const DEFAULT_BASE_URL = "https://api.baziapi.pro";
|
|
726
726
|
const DEFAULT_TIMEOUT = 1e4;
|
|
727
727
|
const DEFAULT_RETRIES = 3;
|
|
728
728
|
const DEFAULT_RETRY_DELAY = 500;
|
package/dist/index.d.cts
CHANGED
|
@@ -710,7 +710,7 @@ declare class WebhookService {
|
|
|
710
710
|
*
|
|
711
711
|
* @example
|
|
712
712
|
* ```typescript
|
|
713
|
-
* import { BaziClient } from '@
|
|
713
|
+
* import { BaziClient } from '@baziapi/sdk';
|
|
714
714
|
*
|
|
715
715
|
* const client = new BaziClient();
|
|
716
716
|
* const isValid = await client.webhooks.verifySignature({
|
|
@@ -760,7 +760,7 @@ interface BaziClientOptions {
|
|
|
760
760
|
readonly apiKey?: string;
|
|
761
761
|
/**
|
|
762
762
|
* Base URL of the BaZi API server.
|
|
763
|
-
* @default 'https://api.
|
|
763
|
+
* @default 'https://api.baziapi.pro'
|
|
764
764
|
*/
|
|
765
765
|
readonly baseUrl?: string;
|
|
766
766
|
/**
|
package/dist/index.d.mts
CHANGED
|
@@ -710,7 +710,7 @@ declare class WebhookService {
|
|
|
710
710
|
*
|
|
711
711
|
* @example
|
|
712
712
|
* ```typescript
|
|
713
|
-
* import { BaziClient } from '@
|
|
713
|
+
* import { BaziClient } from '@baziapi/sdk';
|
|
714
714
|
*
|
|
715
715
|
* const client = new BaziClient();
|
|
716
716
|
* const isValid = await client.webhooks.verifySignature({
|
|
@@ -760,7 +760,7 @@ interface BaziClientOptions {
|
|
|
760
760
|
readonly apiKey?: string;
|
|
761
761
|
/**
|
|
762
762
|
* Base URL of the BaZi API server.
|
|
763
|
-
* @default 'https://api.
|
|
763
|
+
* @default 'https://api.baziapi.pro'
|
|
764
764
|
*/
|
|
765
765
|
readonly baseUrl?: string;
|
|
766
766
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -710,7 +710,7 @@ declare class WebhookService {
|
|
|
710
710
|
*
|
|
711
711
|
* @example
|
|
712
712
|
* ```typescript
|
|
713
|
-
* import { BaziClient } from '@
|
|
713
|
+
* import { BaziClient } from '@baziapi/sdk';
|
|
714
714
|
*
|
|
715
715
|
* const client = new BaziClient();
|
|
716
716
|
* const isValid = await client.webhooks.verifySignature({
|
|
@@ -760,7 +760,7 @@ interface BaziClientOptions {
|
|
|
760
760
|
readonly apiKey?: string;
|
|
761
761
|
/**
|
|
762
762
|
* Base URL of the BaZi API server.
|
|
763
|
-
* @default 'https://api.
|
|
763
|
+
* @default 'https://api.baziapi.pro'
|
|
764
764
|
*/
|
|
765
765
|
readonly baseUrl?: string;
|
|
766
766
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -653,7 +653,7 @@ class WebhookService {
|
|
|
653
653
|
*
|
|
654
654
|
* @example
|
|
655
655
|
* ```typescript
|
|
656
|
-
* import { BaziClient } from '@
|
|
656
|
+
* import { BaziClient } from '@baziapi/sdk';
|
|
657
657
|
*
|
|
658
658
|
* const client = new BaziClient();
|
|
659
659
|
* const isValid = await client.webhooks.verifySignature({
|
|
@@ -720,7 +720,7 @@ async function verifyWebhookSignature(options) {
|
|
|
720
720
|
var __defProp = Object.defineProperty;
|
|
721
721
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
722
722
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
723
|
-
const DEFAULT_BASE_URL = "https://api.
|
|
723
|
+
const DEFAULT_BASE_URL = "https://api.baziapi.pro";
|
|
724
724
|
const DEFAULT_TIMEOUT = 1e4;
|
|
725
725
|
const DEFAULT_RETRIES = 3;
|
|
726
726
|
const DEFAULT_RETRY_DELAY = 500;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baziapi/sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Official TypeScript SDK for the BaZi API",
|
|
5
5
|
"author": "Md. Nasir Uddin Shoyas",
|
|
6
6
|
"license": "MIT",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"url": "https://github.com/Shoyas/bazi-api-sdk.git",
|
|
10
10
|
"directory": "packages/bazi"
|
|
11
11
|
},
|
|
12
|
-
"homepage": "https://
|
|
12
|
+
"homepage": "https://github.com/Shoyas/bazi-api-sdk#readme",
|
|
13
13
|
"bugs": {
|
|
14
14
|
"url": "https://github.com/Shoyas/bazi-api-sdk/issues"
|
|
15
15
|
},
|
|
@@ -44,15 +44,6 @@
|
|
|
44
44
|
"api-client"
|
|
45
45
|
],
|
|
46
46
|
"sideEffects": false,
|
|
47
|
-
"devDependencies": {
|
|
48
|
-
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
49
|
-
"@typescript-eslint/parser": "^8.0.0",
|
|
50
|
-
"@vitest/coverage-v8": "^2.0.0",
|
|
51
|
-
"eslint": "^9.0.0",
|
|
52
|
-
"typescript": "^5.6.3",
|
|
53
|
-
"unbuild": "^3.0.0",
|
|
54
|
-
"vitest": "^2.0.0"
|
|
55
|
-
},
|
|
56
47
|
"scripts": {
|
|
57
48
|
"build": "unbuild",
|
|
58
49
|
"dev": "unbuild --stub",
|
|
@@ -62,5 +53,14 @@
|
|
|
62
53
|
"type-check": "tsc --noEmit",
|
|
63
54
|
"lint": "eslint src",
|
|
64
55
|
"clean": "rm -rf dist"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
59
|
+
"@typescript-eslint/parser": "^8.0.0",
|
|
60
|
+
"@vitest/coverage-v8": "^2.0.0",
|
|
61
|
+
"eslint": "^9.0.0",
|
|
62
|
+
"typescript": "^5.6.3",
|
|
63
|
+
"unbuild": "^3.0.0",
|
|
64
|
+
"vitest": "^2.0.0"
|
|
65
65
|
}
|
|
66
|
-
}
|
|
66
|
+
}
|