@wikialisa/merchant-sdk 0.0.0-stage → 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.
@@ -0,0 +1,12 @@
1
+ import { MerchantCreateOrderRequest, MerchantOrderResponse } from '@wikialisa/types';
2
+
3
+ declare class AXVNMerchantClient {
4
+ private client;
5
+ constructor(apiKey: string, baseURL?: string);
6
+ /** Create a new payment order */
7
+ createOrder(req: MerchantCreateOrderRequest): Promise<MerchantOrderResponse>;
8
+ /** Query order status by ID */
9
+ getOrder(orderId: string): Promise<MerchantOrderResponse>;
10
+ }
11
+
12
+ export { AXVNMerchantClient };
@@ -0,0 +1,12 @@
1
+ import { MerchantCreateOrderRequest, MerchantOrderResponse } from '@wikialisa/types';
2
+
3
+ declare class AXVNMerchantClient {
4
+ private client;
5
+ constructor(apiKey: string, baseURL?: string);
6
+ /** Create a new payment order */
7
+ createOrder(req: MerchantCreateOrderRequest): Promise<MerchantOrderResponse>;
8
+ /** Query order status by ID */
9
+ getOrder(orderId: string): Promise<MerchantOrderResponse>;
10
+ }
11
+
12
+ export { AXVNMerchantClient };
package/dist/index.js ADDED
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ AXVNMerchantClient: () => AXVNMerchantClient
34
+ });
35
+ module.exports = __toCommonJS(index_exports);
36
+ var import_axios = __toESM(require("axios"));
37
+ var import_config = require("@wikialisa/config");
38
+ var AXVNMerchantClient = class {
39
+ constructor(apiKey, baseURL = import_config.DEFAULT_API_ENDPOINT) {
40
+ this.client = import_axios.default.create({
41
+ baseURL,
42
+ headers: {
43
+ "X-API-Key": apiKey,
44
+ "Content-Type": "application/json"
45
+ }
46
+ });
47
+ }
48
+ /** Create a new payment order */
49
+ async createOrder(req) {
50
+ const { data } = await this.client.post("/v1/orders", req);
51
+ return data;
52
+ }
53
+ /** Query order status by ID */
54
+ async getOrder(orderId) {
55
+ const { data } = await this.client.get(`/v1/orders/${orderId}`);
56
+ return data;
57
+ }
58
+ };
59
+ // Annotate the CommonJS export names for ESM import in node:
60
+ 0 && (module.exports = {
61
+ AXVNMerchantClient
62
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,27 @@
1
+ // src/index.ts
2
+ import axios from "axios";
3
+ import { DEFAULT_API_ENDPOINT } from "@wikialisa/config";
4
+ var AXVNMerchantClient = class {
5
+ constructor(apiKey, baseURL = DEFAULT_API_ENDPOINT) {
6
+ this.client = axios.create({
7
+ baseURL,
8
+ headers: {
9
+ "X-API-Key": apiKey,
10
+ "Content-Type": "application/json"
11
+ }
12
+ });
13
+ }
14
+ /** Create a new payment order */
15
+ async createOrder(req) {
16
+ const { data } = await this.client.post("/v1/orders", req);
17
+ return data;
18
+ }
19
+ /** Query order status by ID */
20
+ async getOrder(orderId) {
21
+ const { data } = await this.client.get(`/v1/orders/${orderId}`);
22
+ return data;
23
+ }
24
+ };
25
+ export {
26
+ AXVNMerchantClient
27
+ };
package/package.json CHANGED
@@ -1,6 +1,76 @@
1
1
  {
2
2
  "name": "@wikialisa/merchant-sdk",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.1",
4
+ "description": "WIKIALISA Merchant SDK — TypeScript/JS client for merchant partners integrating AXQ payment gateway API",
5
+ "author": "AXQ Tech Holding JSC <dev@axvn.vn>",
6
+ "license": "MIT",
7
+ "homepage": "https://github.com/wikialisa/wikialisa#readme",
8
+ "sideEffects": false,
9
+ "keywords": [
10
+ "wikialisa",
11
+ "axvn",
12
+ "axq",
13
+ "merchant",
14
+ "sdk",
15
+ "payments",
16
+ "payment-gateway",
17
+ "fintech",
18
+ "api-client",
19
+ "typescript",
20
+ "vietnam",
21
+ "vnd",
22
+ "e-commerce"
23
+ ],
24
+ "main": "./dist/index.js",
25
+ "module": "./dist/index.mjs",
26
+ "types": "./dist/index.d.ts",
27
+ "exports": {
28
+ ".": {
29
+ "import": {
30
+ "types": "./dist/index.d.mts",
31
+ "default": "./dist/index.mjs"
32
+ },
33
+ "require": {
34
+ "types": "./dist/index.d.ts",
35
+ "default": "./dist/index.js"
36
+ }
37
+ }
38
+ },
39
+ "files": [
40
+ "dist"
41
+ ],
42
+ "publishConfig": {
43
+ "access": "public",
44
+ "registry": "https://registry.npmjs.org/"
45
+ },
46
+ "scripts": {
47
+ "build": "tsup src/index.ts --format cjs,esm --dts --clean",
48
+ "dev": "tsup src/index.ts --format cjs,esm --dts --watch",
49
+ "lint": "eslint src",
50
+ "typecheck": "tsc --noEmit",
51
+ "test": "vitest run",
52
+ "clean": "rm -rf dist"
53
+ },
54
+ "dependencies": {
55
+ "@wikialisa/config": "workspace:*",
56
+ "@wikialisa/types": "workspace:*",
57
+ "axios": "^1.7.0"
58
+ },
59
+ "devDependencies": {
60
+ "@types/node": "^22.0.0",
61
+ "tsup": "^8.3.0",
62
+ "typescript": "^5.6.0",
63
+ "vitest": "^2.0.0"
64
+ },
65
+ "repository": {
66
+ "type": "git",
67
+ "url": "https://github.com/wikialisa/wikialisa.git",
68
+ "directory": "packages/merchant-sdk"
69
+ },
70
+ "bugs": {
71
+ "url": "https://github.com/wikialisa/wikialisa/issues"
72
+ },
73
+ "engines": {
74
+ "node": ">=22"
75
+ }
76
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.