@airxpay/init-sdk 1.0.1 → 1.0.3

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 CHANGED
@@ -1,8 +1,8 @@
1
1
  # AirXPay Flixora SDK - Seller Onboard
2
2
 
3
- <div align="center">
3
+ <!-- <div align="center">
4
4
  <img src="./assets/images/flixora.png" alt="AirXPay Flixora SDK" width="100"/>
5
- </div>
5
+ </div> -->
6
6
 
7
7
  **Enterprise-grade TypeScript SDK** for seamless seller onboarding in multi-tenant SaaS platforms. Built with ❤️ by the **Flixora Ecosystem**. Powered by **AirXPay** for payouts and payments, integrated with **TizzyGo**, **TizzyOS**, and soon **TizzyChat** for real-time notifications. Made with a **smiles-first philosophy**, designed to evolve and upgrade continuously for future generations.
8
8
 
@@ -0,0 +1,12 @@
1
+ import { Seller } from "../types/sellerTypes";
2
+ import { DeveloperKeys } from "../types/developerTypes";
3
+ import { ApiConfig } from "../config/apiConfig";
4
+ export declare class AirXPay {
5
+ private config;
6
+ constructor(config?: Partial<ApiConfig>);
7
+ private request;
8
+ createSeller(seller: Seller, keys: DeveloperKeys): Promise<any>;
9
+ updateKyc(sellerId: string, docs: Record<string, string>): Promise<any>;
10
+ updateBank(sellerId: string, bankDetails: Record<string, string>): Promise<any>;
11
+ getPendingStatus(sellerId: string): Promise<any>;
12
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.AirXPay = void 0;
16
+ const axios_1 = __importDefault(require("axios"));
17
+ const validateKeys_1 = require("../utils/validateKeys");
18
+ const apiConfig_1 = require("../config/apiConfig");
19
+ class AirXPay {
20
+ constructor(config) {
21
+ this.config = Object.assign(Object.assign({}, apiConfig_1.defaultConfig), config);
22
+ }
23
+ request(endpoint, data) {
24
+ return __awaiter(this, void 0, void 0, function* () {
25
+ return axios_1.default.post(`${this.config.baseUrl}${endpoint}`, Object.assign(Object.assign({}, data), { secretKey: this.config.secretKey, clientKey: this.config.clientKey }));
26
+ });
27
+ }
28
+ createSeller(seller, keys) {
29
+ return __awaiter(this, void 0, void 0, function* () {
30
+ (0, validateKeys_1.validateKeys)(keys);
31
+ const response = yield this.request("/create", Object.assign(Object.assign({}, seller), { publicKey: keys.publicKey }));
32
+ return response.data;
33
+ });
34
+ }
35
+ updateKyc(sellerId, docs) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ const response = yield this.request(`/${sellerId}/kyc`, docs);
38
+ return response.data;
39
+ });
40
+ }
41
+ updateBank(sellerId, bankDetails) {
42
+ return __awaiter(this, void 0, void 0, function* () {
43
+ const response = yield this.request(`/${sellerId}/bank`, bankDetails);
44
+ return response.data;
45
+ });
46
+ }
47
+ getPendingStatus(sellerId) {
48
+ return __awaiter(this, void 0, void 0, function* () {
49
+ const response = yield axios_1.default.get(`${this.config.baseUrl}/${sellerId}/status`);
50
+ return response.data;
51
+ });
52
+ }
53
+ }
54
+ exports.AirXPay = AirXPay;
@@ -0,0 +1,6 @@
1
+ export interface ApiConfig {
2
+ baseUrl: string;
3
+ secretKey: string;
4
+ clientKey: string;
5
+ }
6
+ export declare const defaultConfig: ApiConfig;
@@ -0,0 +1,5 @@
1
+ export * from "./api/sellerOnboardAPI";
2
+ export * from "./types/sellerTypes";
3
+ export * from "./types/developerTypes";
4
+ export * from "./utils/validateKeys";
5
+ export * from "./utils/uploadHelper";
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./api/sellerOnboard"), exports);
17
+ __exportStar(require("./api/sellerOnboardAPI"), exports);
18
18
  __exportStar(require("./types/sellerTypes"), exports);
19
19
  __exportStar(require("./types/developerTypes"), exports);
20
20
  __exportStar(require("./utils/validateKeys"), exports);
@@ -0,0 +1,8 @@
1
+ export interface BankDetails {
2
+ accountHolderName?: string;
3
+ bankName?: string;
4
+ accountNumber?: string;
5
+ ifscCode?: string;
6
+ upiId?: string;
7
+ cancelledChequeUrl?: string;
8
+ }
@@ -0,0 +1,5 @@
1
+ export interface DeveloperKeys {
2
+ publicKey: string;
3
+ secretKey: string;
4
+ clientKey: string;
5
+ }
@@ -0,0 +1,5 @@
1
+ export interface DeveloperKeys {
2
+ publicKey: string;
3
+ secretKey: string;
4
+ clientKey: string;
5
+ }
@@ -0,0 +1,14 @@
1
+ declare module 'airxpay' {
2
+ export * from './seller';
3
+ export * from './bank';
4
+ export * from './kyc';
5
+ export * from './keys';
6
+ }
7
+ export declare class AirXPayTypes {
8
+ constructor(config: { baseUrl: string; secretKey: string; clientKey: string });
9
+
10
+ createSeller(seller: import('./seller').SellerData, keys: import('./keys').Keys): Promise<import('./seller').SellerData>;
11
+ updateKyc(sellerId: string, docs: Partial<import('./kyc').KycDocuments>): Promise<import('./seller').SellerData>;
12
+ updateBank(sellerId: string, bankDetails: Partial<import('./bank').BankDetails>): Promise<import('./seller').SellerData>;
13
+ getPendingStatus(sellerId: string): Promise<{ status: import('./kyc').KycStatus | import('./seller').SellerStatus }>;
14
+ }
@@ -0,0 +1,5 @@
1
+ export interface Keys {
2
+ publicKey: string;
3
+ secretKey: string;
4
+ clientKey: string;
5
+ }
@@ -0,0 +1,11 @@
1
+ export type KycStatus = "not_submitted" | "pending" | "verified" | "rejected";
2
+
3
+ export interface KycDocuments {
4
+ panCardUrl?: string;
5
+ aadhaarUrl?: string;
6
+ identityProofUrl?: string;
7
+ addressProofUrl?: string;
8
+ selfieUrl?: string;
9
+ businessRegistrationUrl?: string;
10
+ gstCertificateUrl?: string;
11
+ }
@@ -0,0 +1,46 @@
1
+ export type BusinessType = "individual" | "company";
2
+ export type Mode = "test" | "live";
3
+ export type SellerStatus = "active" | "suspended" | "blocked";
4
+
5
+ export interface OnboardedPlatform {
6
+ platformName: string;
7
+ platformId: string;
8
+ onboardedAt: Date;
9
+ }
10
+
11
+ export interface SellerData {
12
+ sellerName: string;
13
+ sellerEmail: string;
14
+ sellerPhone?: string;
15
+
16
+ developerId: string;
17
+ developerUserId?: string;
18
+ developerClientKey: string;
19
+
20
+ sellerDID: string;
21
+ walletId: string;
22
+
23
+ businessName?: string;
24
+ businessType?: BusinessType;
25
+ businessCategory?: string;
26
+ country?: string;
27
+ dob?: Date;
28
+ nationality?: string;
29
+
30
+ mode: Mode;
31
+
32
+ kycStatus: "not_submitted" | "pending" | "verified" | "rejected";
33
+ isKycCompleted: boolean;
34
+
35
+ kycDocuments?: import("./kyc").KycDocuments;
36
+ bankDetails?: import("./bank").BankDetails;
37
+ isBankDetailsCompleted: boolean;
38
+
39
+ onboardedPlatforms: OnboardedPlatform[];
40
+
41
+ status: SellerStatus;
42
+ metadata?: any;
43
+
44
+ createdAt: Date;
45
+ updatedAt: Date;
46
+ }
@@ -0,0 +1,15 @@
1
+ export interface Seller {
2
+ sellerName: string;
3
+ sellerEmail: string;
4
+ sellerPhone: string;
5
+ sellerDID?: string;
6
+ walletId?: string;
7
+ businessName: string;
8
+ businessType: string;
9
+ businessCategory?: string;
10
+ country: string;
11
+ dob?: string;
12
+ nationality?: string;
13
+ mode?: "test" | "live";
14
+ metadata?: Record<string, any>;
15
+ }
@@ -0,0 +1,15 @@
1
+ export interface Seller {
2
+ sellerName: string;
3
+ sellerEmail: string;
4
+ sellerPhone: string;
5
+ sellerDID?: string;
6
+ walletId?: string;
7
+ businessName: string;
8
+ businessType: string;
9
+ businessCategory?: string;
10
+ country: string;
11
+ dob?: string;
12
+ nationality?: string;
13
+ mode?: "test" | "live";
14
+ metadata?: Record<string, any>;
15
+ }
@@ -0,0 +1 @@
1
+ export declare function base64ToBlob(base64: string, type?: string): Blob;
@@ -0,0 +1,2 @@
1
+ import { DeveloperKeys } from "../types/developerTypes";
2
+ export declare function validateKeys(keys: DeveloperKeys): boolean;
package/package.json CHANGED
@@ -1,35 +1,29 @@
1
1
  {
2
2
  "name": "@airxpay/init-sdk",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "AirXPay Flixora SDK - Seller Onboard",
5
5
  "author": "Tafseel Khan",
6
6
  "license": "MIT",
7
-
7
+ "types": "dist/types/index.d.ts",
8
8
  "main": "dist/index.js",
9
-
10
9
  "files": [
11
- "dist",
12
- "types"
10
+ "dist"
13
11
  ],
14
-
15
- "scripts": {
16
- "build": "tsc --project tsconfig.json --outDir dist --declaration false",
17
- "prepare": "npm run build"
18
- },
19
-
12
+ "scripts": {
13
+ "build": "tsc --project tsconfig.json --outDir dist && cpx \"src/types/**/*\" dist/types",
14
+ "prepare": "npm run build"
15
+ },
20
16
  "dependencies": {
21
17
  "axios": "^1.13.5"
22
18
  },
23
-
24
19
  "devDependencies": {
20
+ "cpx": "^1.5.0",
25
21
  "typescript": "^5.9.3"
26
22
  },
27
-
28
23
  "repository": {
29
24
  "type": "git",
30
25
  "url": "https://github.com/tafseelkhan/airxpay-sdk.git"
31
26
  },
32
-
33
27
  "keywords": [
34
28
  "airxpay",
35
29
  "flixora",
@@ -37,10 +31,8 @@
37
31
  "seller",
38
32
  "onboard"
39
33
  ],
40
-
41
34
  "bugs": {
42
35
  "url": "https://github.com/tafseelkhan/airxpay-sdk/issues"
43
36
  },
44
-
45
37
  "homepage": "https://github.com/tafseelkhan/airxpay-sdk#readme"
46
38
  }
@@ -1,39 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.AirXPay = void 0;
7
- const axios_1 = __importDefault(require("axios"));
8
- const validateKeys_1 = require("../utils/validateKeys");
9
- const apiConfig_1 = require("../config/apiConfig");
10
- class AirXPay {
11
- constructor(config) {
12
- this.config = { ...apiConfig_1.defaultConfig, ...config };
13
- }
14
- async request(endpoint, data) {
15
- return axios_1.default.post(`${this.config.baseUrl}${endpoint}`, {
16
- ...data,
17
- secretKey: this.config.secretKey,
18
- clientKey: this.config.clientKey,
19
- });
20
- }
21
- async createSeller(seller, keys) {
22
- (0, validateKeys_1.validateKeys)(keys);
23
- const response = await this.request("/create", { ...seller, publicKey: keys.publicKey });
24
- return response.data;
25
- }
26
- async updateKyc(sellerId, docs) {
27
- const response = await this.request(`/${sellerId}/kyc`, docs);
28
- return response.data;
29
- }
30
- async updateBank(sellerId, bankDetails) {
31
- const response = await this.request(`/${sellerId}/bank`, bankDetails);
32
- return response.data;
33
- }
34
- async getPendingStatus(sellerId) {
35
- const response = await axios_1.default.get(`${this.config.baseUrl}/${sellerId}/status`);
36
- return response.data;
37
- }
38
- }
39
- exports.AirXPay = AirXPay;