Switch backend to production API and adjust headers for auth
Updated the backend API URL to production across configurations and removed unused bearer security schemes in SDK. Introduced optional `authorization` headers in type definitions to handle authentication dynamically.
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
import { defineConfig } from "@hey-api/openapi-ts";
|
import { defineConfig } from "@hey-api/openapi-ts";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
|
|
||||||
const API_URL =
|
const API_URL = "https://api.eventspace.pragmazest.com";
|
||||||
process.env.NEXT_PUBLIC_BACKEND_API_URL || "http://localhost:8000";
|
// process.env.NEXT_PUBLIC_BACKEND_API_URL || "http://localhost:8000";
|
||||||
const OPENAPI_URL = `${API_URL}/api/v1/openapi.json`;
|
const OPENAPI_URL = `${API_URL}/api/v1/openapi.json`;
|
||||||
const OUTPUT_DIR = path.resolve(__dirname, "./src/client");
|
const OUTPUT_DIR = path.resolve(__dirname, "./src/client");
|
||||||
// const OPENAPI_FILE = path.resolve(__dirname, './openapi.json');
|
// const OPENAPI_FILE = path.resolve(__dirname, './openapi.json');
|
||||||
|
|||||||
@@ -23,6 +23,6 @@ export type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> =
|
|||||||
|
|
||||||
export const client = createClient(
|
export const client = createClient(
|
||||||
createConfig<ClientOptions>({
|
createConfig<ClientOptions>({
|
||||||
baseURL: "http://localhost:8000",
|
baseURL: "https://api.eventspace.pragmazest.com",
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -739,12 +739,6 @@ export const readGiftCategories = <ThrowOnError extends boolean = false>(
|
|||||||
ReadGiftCategoriesError,
|
ReadGiftCategoriesError,
|
||||||
ThrowOnError
|
ThrowOnError
|
||||||
>({
|
>({
|
||||||
security: [
|
|
||||||
{
|
|
||||||
scheme: "bearer",
|
|
||||||
type: "http",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
url: "/api/v1/events/gifts/categories/event/{event_id}",
|
url: "/api/v1/events/gifts/categories/event/{event_id}",
|
||||||
...options,
|
...options,
|
||||||
});
|
});
|
||||||
@@ -786,12 +780,6 @@ export const readGiftCategory = <ThrowOnError extends boolean = false>(
|
|||||||
ReadGiftCategoryError,
|
ReadGiftCategoryError,
|
||||||
ThrowOnError
|
ThrowOnError
|
||||||
>({
|
>({
|
||||||
security: [
|
|
||||||
{
|
|
||||||
scheme: "bearer",
|
|
||||||
type: "http",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
url: "/api/v1/events/gifts/categories/{category_id}",
|
url: "/api/v1/events/gifts/categories/{category_id}",
|
||||||
...options,
|
...options,
|
||||||
});
|
});
|
||||||
@@ -963,12 +951,6 @@ export const readGiftItems = <ThrowOnError extends boolean = false>(
|
|||||||
ReadGiftItemsError,
|
ReadGiftItemsError,
|
||||||
ThrowOnError
|
ThrowOnError
|
||||||
>({
|
>({
|
||||||
security: [
|
|
||||||
{
|
|
||||||
scheme: "bearer",
|
|
||||||
type: "http",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
url: "/api/v1/events/gifts/items/event/{event_id}",
|
url: "/api/v1/events/gifts/items/event/{event_id}",
|
||||||
...options,
|
...options,
|
||||||
});
|
});
|
||||||
@@ -1009,12 +991,6 @@ export const readGiftItem = <ThrowOnError extends boolean = false>(
|
|||||||
ReadGiftItemError,
|
ReadGiftItemError,
|
||||||
ThrowOnError
|
ThrowOnError
|
||||||
>({
|
>({
|
||||||
security: [
|
|
||||||
{
|
|
||||||
scheme: "bearer",
|
|
||||||
type: "http",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
url: "/api/v1/events/gifts/items/{item_id}",
|
url: "/api/v1/events/gifts/items/{item_id}",
|
||||||
...options,
|
...options,
|
||||||
});
|
});
|
||||||
@@ -1083,12 +1059,6 @@ export const reserveGiftItem = <ThrowOnError extends boolean = false>(
|
|||||||
ReserveGiftItemError,
|
ReserveGiftItemError,
|
||||||
ThrowOnError
|
ThrowOnError
|
||||||
>({
|
>({
|
||||||
security: [
|
|
||||||
{
|
|
||||||
scheme: "bearer",
|
|
||||||
type: "http",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
url: "/api/v1/events/gifts/items/{item_id}/reserve",
|
url: "/api/v1/events/gifts/items/{item_id}/reserve",
|
||||||
...options,
|
...options,
|
||||||
});
|
});
|
||||||
@@ -1106,12 +1076,6 @@ export const cancelGiftReservation = <ThrowOnError extends boolean = false>(
|
|||||||
CancelGiftReservationError,
|
CancelGiftReservationError,
|
||||||
ThrowOnError
|
ThrowOnError
|
||||||
>({
|
>({
|
||||||
security: [
|
|
||||||
{
|
|
||||||
scheme: "bearer",
|
|
||||||
type: "http",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
url: "/api/v1/events/gifts/items/{item_id}/cancel-reservation",
|
url: "/api/v1/events/gifts/items/{item_id}/cancel-reservation",
|
||||||
...options,
|
...options,
|
||||||
});
|
});
|
||||||
@@ -1129,12 +1093,6 @@ export const createGiftPurchase = <ThrowOnError extends boolean = false>(
|
|||||||
CreateGiftPurchaseError,
|
CreateGiftPurchaseError,
|
||||||
ThrowOnError
|
ThrowOnError
|
||||||
>({
|
>({
|
||||||
security: [
|
|
||||||
{
|
|
||||||
scheme: "bearer",
|
|
||||||
type: "http",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
url: "/api/v1/events/gifts/purchases/",
|
url: "/api/v1/events/gifts/purchases/",
|
||||||
...options,
|
...options,
|
||||||
headers: {
|
headers: {
|
||||||
@@ -1156,12 +1114,6 @@ export const readGiftPurchase = <ThrowOnError extends boolean = false>(
|
|||||||
ReadGiftPurchaseError,
|
ReadGiftPurchaseError,
|
||||||
ThrowOnError
|
ThrowOnError
|
||||||
>({
|
>({
|
||||||
security: [
|
|
||||||
{
|
|
||||||
scheme: "bearer",
|
|
||||||
type: "http",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
url: "/api/v1/events/gifts/purchases/{purchase_id}",
|
url: "/api/v1/events/gifts/purchases/{purchase_id}",
|
||||||
...options,
|
...options,
|
||||||
});
|
});
|
||||||
@@ -1179,12 +1131,6 @@ export const readGiftPurchasesByGift = <ThrowOnError extends boolean = false>(
|
|||||||
ReadGiftPurchasesByGiftError,
|
ReadGiftPurchasesByGiftError,
|
||||||
ThrowOnError
|
ThrowOnError
|
||||||
>({
|
>({
|
||||||
security: [
|
|
||||||
{
|
|
||||||
scheme: "bearer",
|
|
||||||
type: "http",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
url: "/api/v1/events/gifts/purchases/gift/{gift_id}",
|
url: "/api/v1/events/gifts/purchases/gift/{gift_id}",
|
||||||
...options,
|
...options,
|
||||||
});
|
});
|
||||||
@@ -1202,12 +1148,6 @@ export const readGiftPurchasesByGuest = <ThrowOnError extends boolean = false>(
|
|||||||
ReadGiftPurchasesByGuestError,
|
ReadGiftPurchasesByGuestError,
|
||||||
ThrowOnError
|
ThrowOnError
|
||||||
>({
|
>({
|
||||||
security: [
|
|
||||||
{
|
|
||||||
scheme: "bearer",
|
|
||||||
type: "http",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
url: "/api/v1/events/gifts/purchases/guest/{guest_id}",
|
url: "/api/v1/events/gifts/purchases/guest/{guest_id}",
|
||||||
...options,
|
...options,
|
||||||
});
|
});
|
||||||
@@ -1388,12 +1328,6 @@ export const getEventBySlug = <ThrowOnError extends boolean = false>(
|
|||||||
GetEventBySlugError,
|
GetEventBySlugError,
|
||||||
ThrowOnError
|
ThrowOnError
|
||||||
>({
|
>({
|
||||||
security: [
|
|
||||||
{
|
|
||||||
scheme: "bearer",
|
|
||||||
type: "http",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
url: "/api/v1/events/by-slug/{slug}",
|
url: "/api/v1/events/by-slug/{slug}",
|
||||||
...options,
|
...options,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1237,6 +1237,9 @@ export type CreateGiftCategoryResponse =
|
|||||||
|
|
||||||
export type ReadGiftCategoriesData = {
|
export type ReadGiftCategoriesData = {
|
||||||
body?: never;
|
body?: never;
|
||||||
|
headers?: {
|
||||||
|
authorization?: string;
|
||||||
|
};
|
||||||
path: {
|
path: {
|
||||||
event_id: string;
|
event_id: string;
|
||||||
};
|
};
|
||||||
@@ -1303,6 +1306,9 @@ export type DeleteGiftCategoryResponse =
|
|||||||
|
|
||||||
export type ReadGiftCategoryData = {
|
export type ReadGiftCategoryData = {
|
||||||
body?: never;
|
body?: never;
|
||||||
|
headers?: {
|
||||||
|
authorization?: string;
|
||||||
|
};
|
||||||
path: {
|
path: {
|
||||||
category_id: string;
|
category_id: string;
|
||||||
};
|
};
|
||||||
@@ -1521,6 +1527,9 @@ export type CreateGiftItemResponse =
|
|||||||
|
|
||||||
export type ReadGiftItemsData = {
|
export type ReadGiftItemsData = {
|
||||||
body?: never;
|
body?: never;
|
||||||
|
headers?: {
|
||||||
|
authorization?: string;
|
||||||
|
};
|
||||||
path: {
|
path: {
|
||||||
event_id: string;
|
event_id: string;
|
||||||
};
|
};
|
||||||
@@ -1583,6 +1592,9 @@ export type DeleteGiftItemResponse =
|
|||||||
|
|
||||||
export type ReadGiftItemData = {
|
export type ReadGiftItemData = {
|
||||||
body?: never;
|
body?: never;
|
||||||
|
headers?: {
|
||||||
|
authorization?: string;
|
||||||
|
};
|
||||||
path: {
|
path: {
|
||||||
item_id: string;
|
item_id: string;
|
||||||
};
|
};
|
||||||
@@ -1671,6 +1683,9 @@ export type UpdateGiftItemStatusResponse =
|
|||||||
|
|
||||||
export type ReserveGiftItemData = {
|
export type ReserveGiftItemData = {
|
||||||
body?: never;
|
body?: never;
|
||||||
|
headers?: {
|
||||||
|
authorization?: string;
|
||||||
|
};
|
||||||
path: {
|
path: {
|
||||||
item_id: string;
|
item_id: string;
|
||||||
};
|
};
|
||||||
@@ -1704,6 +1719,9 @@ export type ReserveGiftItemResponse =
|
|||||||
|
|
||||||
export type CancelGiftReservationData = {
|
export type CancelGiftReservationData = {
|
||||||
body?: never;
|
body?: never;
|
||||||
|
headers?: {
|
||||||
|
authorization?: string;
|
||||||
|
};
|
||||||
path: {
|
path: {
|
||||||
item_id: string;
|
item_id: string;
|
||||||
};
|
};
|
||||||
@@ -1735,6 +1753,9 @@ export type CancelGiftReservationResponse =
|
|||||||
|
|
||||||
export type CreateGiftPurchaseData = {
|
export type CreateGiftPurchaseData = {
|
||||||
body: GiftPurchaseCreate;
|
body: GiftPurchaseCreate;
|
||||||
|
headers?: {
|
||||||
|
authorization?: string;
|
||||||
|
};
|
||||||
path?: never;
|
path?: never;
|
||||||
query?: never;
|
query?: never;
|
||||||
url: "/api/v1/events/gifts/purchases/";
|
url: "/api/v1/events/gifts/purchases/";
|
||||||
@@ -1762,6 +1783,9 @@ export type CreateGiftPurchaseResponse =
|
|||||||
|
|
||||||
export type ReadGiftPurchaseData = {
|
export type ReadGiftPurchaseData = {
|
||||||
body?: never;
|
body?: never;
|
||||||
|
headers?: {
|
||||||
|
authorization?: string;
|
||||||
|
};
|
||||||
path: {
|
path: {
|
||||||
purchase_id: string;
|
purchase_id: string;
|
||||||
};
|
};
|
||||||
@@ -1791,6 +1815,9 @@ export type ReadGiftPurchaseResponse =
|
|||||||
|
|
||||||
export type ReadGiftPurchasesByGiftData = {
|
export type ReadGiftPurchasesByGiftData = {
|
||||||
body?: never;
|
body?: never;
|
||||||
|
headers?: {
|
||||||
|
authorization?: string;
|
||||||
|
};
|
||||||
path: {
|
path: {
|
||||||
gift_id: string;
|
gift_id: string;
|
||||||
};
|
};
|
||||||
@@ -2055,6 +2082,9 @@ export type UpdateEventResponse =
|
|||||||
|
|
||||||
export type GetEventBySlugData = {
|
export type GetEventBySlugData = {
|
||||||
body?: never;
|
body?: never;
|
||||||
|
headers?: {
|
||||||
|
authorization?: string;
|
||||||
|
};
|
||||||
path: {
|
path: {
|
||||||
slug: string;
|
slug: string;
|
||||||
};
|
};
|
||||||
@@ -2137,5 +2167,5 @@ export type UploadFileResponses = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type ClientOptions = {
|
export type ClientOptions = {
|
||||||
baseURL: "http://localhost:8000" | (string & {});
|
baseURL: "https://api.eventspace.pragmazest.com" | (string & {});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
export const RESERVED_SLUGS = ["new", "edit", "delete", "settings"];
|
export const RESERVED_SLUGS = ["new", "edit", "delete", "settings"];
|
||||||
export const BACKEND_API_URL =
|
export const BACKEND_API_URL = "https://api.eventspace.pragmazest.com";
|
||||||
process.env.NEXT_PUBLIC_API_URL || "https://api.eventspace.pragmazest.com";
|
|
||||||
export const APP_URL =
|
export const APP_URL =
|
||||||
process.env.NEXT_PUBLIC_APP_URL || "https://eventspace.pragmazest.com";
|
process.env.NEXT_PUBLIC_APP_URL || "https://eventspace.pragmazest.com";
|
||||||
|
|||||||
Reference in New Issue
Block a user