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