@customafk/lunas-api-sdk 0.0.1 → 0.0.2
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/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1627 -1670
- package/dist/index.d.mts +1627 -1670
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -151,7 +151,7 @@ var ClientApi = class ClientApi {
|
|
|
151
151
|
if (status === "SUCCESS") {
|
|
152
152
|
await ClientApi._getMe();
|
|
153
153
|
this._onSetUser?.(ClientApi._user);
|
|
154
|
-
return
|
|
154
|
+
return await request(ClientApi._client);
|
|
155
155
|
}
|
|
156
156
|
if (status === "FAILED") {
|
|
157
157
|
await ClientApi._logout();
|
|
@@ -160,7 +160,7 @@ var ClientApi = class ClientApi {
|
|
|
160
160
|
return null;
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
return response
|
|
163
|
+
return response;
|
|
164
164
|
} catch (error) {
|
|
165
165
|
console.error("Error in fetchApi:", JSON.stringify(error));
|
|
166
166
|
return {
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/utils.ts"],"sourcesContent":["/** biome-ignore-all lint/suspicious/noExplicitAny: true */\nimport type { Treaty } from '@elysiajs/eden';\nimport { treaty } from '@elysiajs/eden';\nimport type { AppType } from 'app/src/global';\nimport type { TResponse } from './types';\n\nexport type TUser = Treaty.Data<\n Awaited<\n ReturnType<Treaty.Create<AppType>['admin']['v1']['auth']['me']['get']>\n >\n>['data'];\n\ntype Config = {\n baseURL: string;\n config?: Omit<Treaty.Config, 'onResponse'>;\n listeners?: {\n onSetUser?: (user: TUser | null) => void | Promise<void>;\n onUnauthorized?: () => void | Promise<void>;\n onLogout?: () => void | Promise<void>;\n onRefreshToken?: (status: 'SUCCESS' | 'FAILED') => void | Promise<void>;\n onRefreshFailed?: () => void | Promise<void>;\n };\n};\n\nexport class ClientApi {\n // Keep track of the ongoing \"me\" request to prevent multiple simultaneous calls\n private static _getMeTask: Promise<any> | null = null;\n private static _refreshTokenTask: Promise<{\n status: 'SUCCESS' | 'FAILED';\n }> | null = null;\n private static _logoutTask: Promise<any> | null = null;\n private static _client: Treaty.Create<AppType> | undefined;\n\n public static client: Treaty.Create<AppType>;\n public static _status: 'LOGGED' | 'INITIAL' | 'LOGGING' = 'INITIAL';\n public static _user: TUser = null;\n\n private static async _getMe() {\n // If already logged in, no need to fetch again\n if (ClientApi._status === 'LOGGED') {\n return;\n }\n\n // Ensure client is initialized\n if (!ClientApi._client) {\n console.error('Client not initialized');\n return;\n }\n\n // If there's an ongoing \"me\" request, await its completion\n if (ClientApi._getMeTask) {\n await ClientApi._getMeTask;\n return;\n }\n\n const getMe = ClientApi._client.admin.v1.auth.me.get();\n // Store the ongoing task, so other can know about it\n // and await it if needed\n ClientApi._getMeTask = getMe;\n try {\n const res = await getMe;\n if (!!res.data && !!res.data.data && res.data.success) {\n ClientApi._status = 'LOGGED';\n ClientApi._user = res.data.data;\n } else {\n ClientApi._status = 'INITIAL';\n ClientApi._user = null;\n }\n } catch (error) {\n console.error('Error fetching user data:', error);\n ClientApi._status = 'INITIAL';\n ClientApi._user = null;\n } finally {\n ClientApi._getMeTask = null;\n }\n }\n\n private static async _refreshToken() {\n // Ensure client is initialized\n if (!ClientApi._client) {\n console.error('Client not initialized');\n return { status: 'FAILED' as const };\n }\n\n // If there's an ongoing \"refresh token\" request, await its completion\n if (ClientApi._refreshTokenTask) {\n const res = await ClientApi._refreshTokenTask;\n return res;\n }\n\n const handler = async (): Promise<{ status: 'SUCCESS' | 'FAILED' }> => {\n try {\n const res =\n await ClientApi._client?.admin.v1.auth['refresh-token'].get();\n if (res?.data?.statusCode === 200) {\n return { status: 'SUCCESS' };\n }\n return { status: 'FAILED' };\n } catch (error) {\n console.error('Error refreshing token:', JSON.stringify(error));\n return { status: 'FAILED' };\n }\n };\n // Store the ongoing task, so other can know about it\n // and await it if needed\n ClientApi._refreshTokenTask = handler();\n return ClientApi._refreshTokenTask.finally(() => {\n ClientApi._refreshTokenTask = null;\n });\n }\n\n private static async _logout() {\n // Ensure client is initialized\n if (!ClientApi._client) {\n console.error('Client not initialized');\n return;\n }\n\n // If there's an ongoing \"logout\" request, await its completion\n if (ClientApi._logoutTask) {\n await ClientApi._logoutTask;\n return;\n }\n\n const logout = ClientApi._client.admin.v1.auth.logout.delete();\n // Store the ongoing task, so other can know about it\n // and await it if needed\n ClientApi._logoutTask = logout;\n try {\n await logout;\n } catch (error) {\n console.error('Error during logout:', error);\n } finally {\n ClientApi._logoutTask = null;\n }\n }\n\n constructor({ baseURL, config, listeners }: Config) {\n // Initialize Treaty Client\n if (!ClientApi._client) {\n ClientApi._client = treaty<AppType>(baseURL, config);\n }\n this._onSetUser = async (user: TUser) => {\n ClientApi._status = user ? 'LOGGED' : 'INITIAL';\n ClientApi._user = user;\n await listeners?.onSetUser?.(user);\n };\n\n this._onUnauthorized = async () => {\n this._onSetUser?.(null);\n await listeners?.onUnauthorized?.();\n };\n\n this._onLogout = async () => {\n await listeners?.onLogout?.();\n };\n }\n\n public isLogged() {\n return ClientApi._status === 'LOGGED';\n }\n\n public isInitial() {\n return ClientApi._status === 'INITIAL';\n }\n\n public getUser() {\n return ClientApi._user ?? null;\n }\n\n public getClient() {\n return ClientApi._client;\n }\n\n public getUserClient() {}\n\n public async logout() {\n await ClientApi._client?.admin.v1.auth.logout.delete();\n await this._onLogout?.();\n await this._onSetUser?.(null);\n }\n\n public async fetchApi<TData>({\n request,\n }: {\n request: (api: Treaty.Create<AppType>) => Promise<TData>;\n }) {\n // Ensure client is initialized\n if (!ClientApi._client) {\n console.error('Client not initialized');\n return null;\n }\n\n try {\n // Await ongoing \"me\" request to ensure user state is up-to-date\n if (ClientApi._getMeTask) {\n console.log(\n 'Awaiting ongoing _getMeTask before proceeding with fetchApi'\n );\n await ClientApi._getMeTask;\n }\n\n // Await ongoing \"refresh token\" request to ensure token state is up-to-date\n if (ClientApi._refreshTokenTask) {\n console.log(\n 'Awaiting ongoing _refreshTokenTask before proceeding with fetchApi'\n );\n await ClientApi._refreshTokenTask;\n }\n\n // Await ongoing \"logout\" request to ensure user is logged out properly\n if (ClientApi._logoutTask) {\n console.log(\n 'Awaiting ongoing _logoutTask before proceeding with fetchApi'\n );\n await ClientApi._logoutTask;\n }\n\n const response = (await request(\n ClientApi._client\n )) as Treaty.TreatyResponse<Record<number, TResponse<any>>>;\n\n // Check if response data exists\n if (!response.data) {\n console.error('No response data received from API request');\n return null;\n }\n\n // Check for status codes in the response data\n const _data = response.data;\n\n // CASE: User is Unauthorized\n if (_data?.statusCode === 401) {\n await this._onUnauthorized?.();\n return null;\n }\n\n // CASE: TOKEN EXPIRED - Re-fetch user data\n if (_data?.statusCode === 4001) {\n const { status } = await ClientApi._refreshToken();\n if (status === 'SUCCESS') {\n await ClientApi._getMe();\n this._onSetUser?.(ClientApi._user);\n const response = (await request(\n ClientApi._client\n )) as Treaty.TreatyResponse<Record<number, TResponse<any>>>;\n return response.data;\n }\n if (status === 'FAILED') {\n await ClientApi._logout();\n this._onLogout?.();\n this._onSetUser?.(null);\n return null;\n }\n }\n\n return response.data;\n } catch (error) {\n console.error('Error in fetchApi:', JSON.stringify(error));\n return {\n success: false,\n statusCode: 500,\n data: null,\n message: 'Internal Client Error',\n error: {\n statusCode: 500,\n message: 'Internal Client Error',\n },\n meta: {\n version: '1.0.0',\n timestamp: new Date().toISOString(),\n path: '',\n },\n };\n }\n }\n\n private _onSetUser?: (user: TUser | null) => void | Promise<void>;\n private _onUnauthorized?: () => void | Promise<void>;\n private _onLogout?: () => void | Promise<void>;\n}\n"],"mappings":";;;AAwBA,IAAa,YAAb,MAAa,UAAU;;oBAE4B;;;2BAGrC;;;qBACsC;;;iBAIQ;;;eAC7B;;CAE7B,aAAqB,SAAS;AAE5B,MAAI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C3D,WAAO;;GAIT,MAAM,QAAQ,SAAS;AAGvB,OAAI,OAAO,eAAe,KAAK;AAC7B,UAAM,KAAK,mBAAmB;AAC9B,WAAO;;AAIT,OAAI,OAAO,eAAe,MAAM;IAC9B,MAAM,EAAE,WAAW,MAAM,UAAU,eAAe;AAClD,QAAI,WAAW,WAAW;AACxB,WAAM,UAAU,QAAQ;AACxB,UAAK,aAAa,UAAU,MAAM;AAIlC,aAHkB,MAAM,QACtB,UAAU,QACX,EACe;;AAElB,QAAI,WAAW,UAAU;AACvB,WAAM,UAAU,SAAS;AACzB,UAAK,aAAa;AAClB,UAAK,aAAa,KAAK;AACvB,YAAO;;;AAIX,UAAO,SAAS;WACT,OAAO;AACd,WAAQ,MAAM,sBAAsB,KAAK,UAAU,MAAM,CAAC;AAC1D,UAAO;IACL,SAAS;IACT,YAAY;IACZ,MAAM;IACN,SAAS;IACT,OAAO;KACL,YAAY;KACZ,SAAS;KACV;IACD,MAAM;KACJ,SAAS;KACT,4BAAW,IAAI,MAAM,EAAC,aAAa;KACnC,MAAM;KACP;IACF"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/utils.ts"],"sourcesContent":["/** biome-ignore-all lint/suspicious/noExplicitAny: true */\nimport type { Treaty } from '@elysiajs/eden';\nimport { treaty } from '@elysiajs/eden';\nimport type { AppType } from 'app/src/global';\nimport type { TResponse } from './types';\n\n\nexport type TUser = Treaty.Data<\n Awaited<\n ReturnType<Treaty.Create<AppType>['admin']['v1']['auth']['me']['get']>\n >\n>['data'];\n\nclass TempClient {\n public static client: Treaty.Create<AppType>;\n public getClient() {\n return null;\n }\n}\n\nconst _ = () => TempClient.client;\n\ntype TClient = ReturnType<typeof _>;\n\ntype Config = {\n baseURL: string;\n config?: Omit<Treaty.Config, 'onResponse'>;\n listeners?: {\n onSetUser?: (user: TUser | null) => void | Promise<void>;\n onUnauthorized?: () => void | Promise<void>;\n onLogout?: () => void | Promise<void>;\n onRefreshToken?: (status: 'SUCCESS' | 'FAILED') => void | Promise<void>;\n onRefreshFailed?: () => void | Promise<void>;\n };\n};\n\nexport class ClientApi {\n // Keep track of the ongoing \"me\" request to prevent multiple simultaneous calls\n private static _getMeTask: Promise<any> | null = null;\n private static _refreshTokenTask: Promise<{\n status: 'SUCCESS' | 'FAILED';\n }> | null = null;\n private static _logoutTask: Promise<any> | null = null;\n private static _client: TClient | undefined;\n\n public static client: Treaty.Create<AppType>;\n public static _status: 'LOGGED' | 'INITIAL' | 'LOGGING' = 'INITIAL';\n public static _user: TUser = null;\n\n private static async _getMe() {\n // If already logged in, no need to fetch again\n if (ClientApi._status === 'LOGGED') {\n return;\n }\n\n // Ensure client is initialized\n if (!ClientApi._client) {\n console.error('Client not initialized');\n return;\n }\n\n // If there's an ongoing \"me\" request, await its completion\n if (ClientApi._getMeTask) {\n await ClientApi._getMeTask;\n return;\n }\n\n const getMe = ClientApi._client.admin.v1.auth.me.get();\n // Store the ongoing task, so other can know about it\n // and await it if needed\n ClientApi._getMeTask = getMe;\n try {\n const res = await getMe;\n if (!!res.data && !!res.data.data && res.data.success) {\n ClientApi._status = 'LOGGED';\n ClientApi._user = res.data.data;\n } else {\n ClientApi._status = 'INITIAL';\n ClientApi._user = null;\n }\n } catch (error) {\n console.error('Error fetching user data:', error);\n ClientApi._status = 'INITIAL';\n ClientApi._user = null;\n } finally {\n ClientApi._getMeTask = null;\n }\n }\n\n private static async _refreshToken() {\n // Ensure client is initialized\n if (!ClientApi._client) {\n console.error('Client not initialized');\n return { status: 'FAILED' as const };\n }\n\n // If there's an ongoing \"refresh token\" request, await its completion\n if (ClientApi._refreshTokenTask) {\n const res = await ClientApi._refreshTokenTask;\n return res;\n }\n\n const handler = async (): Promise<{ status: 'SUCCESS' | 'FAILED' }> => {\n try {\n const res =\n await ClientApi._client?.admin.v1.auth['refresh-token'].get();\n if (res?.data?.statusCode === 200) {\n return { status: 'SUCCESS' };\n }\n return { status: 'FAILED' };\n } catch (error) {\n console.error('Error refreshing token:', JSON.stringify(error));\n return { status: 'FAILED' };\n }\n };\n // Store the ongoing task, so other can know about it\n // and await it if needed\n ClientApi._refreshTokenTask = handler();\n return ClientApi._refreshTokenTask.finally(() => {\n ClientApi._refreshTokenTask = null;\n });\n }\n\n private static async _logout() {\n // Ensure client is initialized\n if (!ClientApi._client) {\n console.error('Client not initialized');\n return;\n }\n\n // If there's an ongoing \"logout\" request, await its completion\n if (ClientApi._logoutTask) {\n await ClientApi._logoutTask;\n return;\n }\n\n const logout = ClientApi._client.admin.v1.auth.logout.delete();\n // Store the ongoing task, so other can know about it\n // and await it if needed\n ClientApi._logoutTask = logout;\n try {\n await logout;\n } catch (error) {\n console.error('Error during logout:', error);\n } finally {\n ClientApi._logoutTask = null;\n }\n }\n\n constructor({ baseURL, config, listeners }: Config) {\n // Initialize Treaty Client\n if (!ClientApi._client) {\n ClientApi._client = treaty<AppType>(baseURL, config);\n }\n this._onSetUser = async (user: TUser) => {\n ClientApi._status = user ? 'LOGGED' : 'INITIAL';\n ClientApi._user = user;\n await listeners?.onSetUser?.(user);\n };\n\n this._onUnauthorized = async () => {\n this._onSetUser?.(null);\n await listeners?.onUnauthorized?.();\n };\n\n this._onLogout = async () => {\n await listeners?.onLogout?.();\n };\n }\n\n public isLogged() {\n return ClientApi._status === 'LOGGED';\n }\n\n public isInitial() {\n return ClientApi._status === 'INITIAL';\n }\n\n public getUser() {\n return ClientApi._user ?? null;\n }\n\n public getClient(): TClient | undefined {\n return ClientApi._client;\n }\n\n public getUserClient() {}\n\n public async logout() {\n await ClientApi._client?.admin.v1.auth.logout.delete();\n await this._onLogout?.();\n await this._onSetUser?.(null);\n }\n\n public async fetchApi<TData>({\n request,\n }: {\n request: (api: TClient) => Promise<TData>;\n }) {\n // Ensure client is initialized\n if (!ClientApi._client) {\n console.error('Client not initialized');\n return null;\n }\n\n try {\n // Await ongoing \"me\" request to ensure user state is up-to-date\n if (ClientApi._getMeTask) {\n console.log(\n 'Awaiting ongoing _getMeTask before proceeding with fetchApi'\n );\n await ClientApi._getMeTask;\n }\n\n // Await ongoing \"refresh token\" request to ensure token state is up-to-date\n if (ClientApi._refreshTokenTask) {\n console.log(\n 'Awaiting ongoing _refreshTokenTask before proceeding with fetchApi'\n );\n await ClientApi._refreshTokenTask;\n }\n\n // Await ongoing \"logout\" request to ensure user is logged out properly\n if (ClientApi._logoutTask) {\n console.log(\n 'Awaiting ongoing _logoutTask before proceeding with fetchApi'\n );\n await ClientApi._logoutTask;\n }\n\n const response = (await request(\n ClientApi._client\n )) as Treaty.TreatyResponse<Record<number, TResponse<any>>>;\n\n // Check if response data exists\n if (!response.data) {\n console.error('No response data received from API request');\n return null;\n }\n\n // Check for status codes in the response data\n const _data = response.data;\n\n // CASE: User is Unauthorized\n if (_data?.statusCode === 401) {\n await this._onUnauthorized?.();\n return null;\n }\n\n // CASE: TOKEN EXPIRED - Re-fetch user data\n if (_data?.statusCode === 4001) {\n const { status } = await ClientApi._refreshToken();\n if (status === 'SUCCESS') {\n await ClientApi._getMe();\n this._onSetUser?.(ClientApi._user);\n const response = (await request(\n ClientApi._client\n )) as Treaty.TreatyResponse<Record<number, TResponse<any>>>;\n return response as TData;\n }\n if (status === 'FAILED') {\n await ClientApi._logout();\n this._onLogout?.();\n this._onSetUser?.(null);\n return null;\n }\n }\n\n return response as TData\n } catch (error) {\n console.error('Error in fetchApi:', JSON.stringify(error));\n return {\n success: false,\n statusCode: 500,\n data: null,\n message: 'Internal Client Error',\n error: {\n statusCode: 500,\n message: 'Internal Client Error',\n },\n meta: {\n version: '1.0.0',\n timestamp: new Date().toISOString(),\n path: '',\n },\n };\n }\n }\n\n private _onSetUser?: (user: TUser | null) => void | Promise<void>;\n private _onUnauthorized?: () => void | Promise<void>;\n private _onLogout?: () => void | Promise<void>;\n}\n\n\n// const client = new ClientApi({\n// baseURL: 'http://localhost:4000',\n// })\n// const data = await client.fetchApi({\n// request: api => api.admin.v1.auth.me.get()\n// })\n"],"mappings":";;;AAoCA,IAAa,YAAb,MAAa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