From 29159130375c9b25c661a51ba6bb33ea2e9138b2 Mon Sep 17 00:00:00 2001 From: nick22985 Date: Mon, 6 Oct 2025 21:38:35 +1000 Subject: [PATCH 1/3] fix: change entrypoint to tebex.ts instead of blank index.ts file --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 944a114..fe9d7b7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "tebex-sdk-nodejs", - "version": "1.0.0", + "version": "1.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "tebex-sdk-nodejs", - "version": "1.0.0", + "version": "1.1.0", "dependencies": { "@cypress/request": "^3.0.7", "@openapitools/openapi-generator-cli": "^2.15.3", diff --git a/package.json b/package.json index cb33f38..837f2c6 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "tebex-sdk-nodejs", "version": "1.1.0", "description": "Gaming payments done right - Tebex is the monetization platform designed to grow your gaming revenue streams", - "main": "dist/index.js", + "main": "dist/tebex.js", "scripts": { "generate-headless": "openapi-generator-cli generate -i openapi/Headless/headless-api.yaml -o src/Headless/lib --package-name TebexHeadless --invoker-package TebexHeadless -g typescript-node", "generate-checkout": "openapi-generator-cli generate -i openapi/Checkout/checkout-api.yaml -o src/Checkout/lib --package-name TebexCheckout --invoker-package TebexCheckout -g typescript-node", From 219424d1e98fd91502eac6fcb8f478a4389d8466 Mon Sep 17 00:00:00 2001 From: nick22985 Date: Mon, 6 Oct 2025 21:38:51 +1000 Subject: [PATCH 2/3] fix: localVarRequest type, add form to requestOptions, remove unessary if statment --- src/tebex-request.ts | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/tebex-request.ts b/src/tebex-request.ts index 4fafdb4..4a741a2 100644 --- a/src/tebex-request.ts +++ b/src/tebex-request.ts @@ -37,15 +37,8 @@ const request = require('@cypress/request'); * } * }); */ -export function localVarRequest(incomingRequestOptions: { - method: string; - qs: any; - headers: any; - uri: string; - useQuerystring: boolean; - json: boolean; - body: any; -} | any, callback: (error: any, response: any, body: any) => void) { + +export function localVarRequest(incomingRequestOptions: localVarRequest.Options, callback: (error: any, response: any, body: any) => void) { const requestOptions = { auth: incomingRequestOptions.auth, method: incomingRequestOptions.method, @@ -54,20 +47,30 @@ export function localVarRequest(incomingRequestOptions: { json: incomingRequestOptions.json === true, qs: incomingRequestOptions.qs, body: incomingRequestOptions.body, + form: incomingRequestOptions.form, }; if (incomingRequestOptions.useQuerystring && incomingRequestOptions.qs) { requestOptions.qs = incomingRequestOptions.qs; } - // Add body if provided - if (incomingRequestOptions.body !== undefined) { - requestOptions.body = incomingRequestOptions.body; - } - // Use cypress request library to complete the request as needed request(requestOptions, (error:any, response:any, body:any) => { // Invoke the provided callback with the results callback(error, response, body); }); -} \ No newline at end of file +} + +export namespace localVarRequest { + export interface Options { + method: string; + qs: any; + headers: any; + uri: string; + useQuerystring: boolean; + json: boolean; + body?: any; + auth?: any; + form?: any; + } +} From 4e500dd8a9990b75839a0285c051fce5a20af63e Mon Sep 17 00:00:00 2001 From: nick22985 Date: Mon, 6 Oct 2025 21:39:25 +1000 Subject: [PATCH 3/3] fix: tests fixed typos for Headless and webhooks --- test/Headless/headlessIntegration.test.ts | 4 ++-- test/Webhooks/webhooksIntegration.test.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/Headless/headlessIntegration.test.ts b/test/Headless/headlessIntegration.test.ts index fe923cb..a124688 100644 --- a/test/Headless/headlessIntegration.test.ts +++ b/test/Headless/headlessIntegration.test.ts @@ -1,4 +1,4 @@ -import { Headless } from "../../src/Headless"; +import { Headless } from "../../src/headless"; import { HeadlessApi } from "../../src/Headless/lib/api/headlessApi"; import { Basket } from "../../src/Headless/lib/model/basket"; import { WebstoreResponse } from "../../src/Headless/lib/model/webstoreResponse"; @@ -235,4 +235,4 @@ describe("Headless", () => { expect(result).not.toBeNull(); expect(result.success).toBe(true); }) -}); \ No newline at end of file +}); diff --git a/test/Webhooks/webhooksIntegration.test.ts b/test/Webhooks/webhooksIntegration.test.ts index 82d73cc..35afcae 100644 --- a/test/Webhooks/webhooksIntegration.test.ts +++ b/test/Webhooks/webhooksIntegration.test.ts @@ -1,4 +1,4 @@ -import { Webhooks } from "../../src/Webhooks"; +import { Webhooks } from "../../src/webhooks"; import { Webhook } from "../../src/Webhook/webhook"; describe("Webhooks", () => { @@ -91,4 +91,4 @@ describe("Webhooks", () => { expect(mockWebhook.validateIp).toHaveBeenCalledWith(mockIncomingRequestIp); }); }); -}); \ No newline at end of file +});