@customafk/lunas-api-sdk 0.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.
- package/README.md +15 -0
- package/dist/index.cjs +187 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2202 -0
- package/dist/index.d.mts +2202 -0
- package/dist/index.mjs +187 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +32 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { treaty } from "@elysiajs/eden";
|
|
2
|
+
|
|
3
|
+
//#region src/utils.ts
|
|
4
|
+
var ClientApi = class ClientApi {
|
|
5
|
+
static {
|
|
6
|
+
this._getMeTask = null;
|
|
7
|
+
}
|
|
8
|
+
static {
|
|
9
|
+
this._refreshTokenTask = null;
|
|
10
|
+
}
|
|
11
|
+
static {
|
|
12
|
+
this._logoutTask = null;
|
|
13
|
+
}
|
|
14
|
+
static {
|
|
15
|
+
this._status = "INITIAL";
|
|
16
|
+
}
|
|
17
|
+
static {
|
|
18
|
+
this._user = null;
|
|
19
|
+
}
|
|
20
|
+
static async _getMe() {
|
|
21
|
+
if (ClientApi._status === "LOGGED") return;
|
|
22
|
+
if (!ClientApi._client) {
|
|
23
|
+
console.error("Client not initialized");
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (ClientApi._getMeTask) {
|
|
27
|
+
await ClientApi._getMeTask;
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const getMe = ClientApi._client.admin.v1.auth.me.get();
|
|
31
|
+
ClientApi._getMeTask = getMe;
|
|
32
|
+
try {
|
|
33
|
+
const res = await getMe;
|
|
34
|
+
if (!!res.data && !!res.data.data && res.data.success) {
|
|
35
|
+
ClientApi._status = "LOGGED";
|
|
36
|
+
ClientApi._user = res.data.data;
|
|
37
|
+
} else {
|
|
38
|
+
ClientApi._status = "INITIAL";
|
|
39
|
+
ClientApi._user = null;
|
|
40
|
+
}
|
|
41
|
+
} catch (error) {
|
|
42
|
+
console.error("Error fetching user data:", error);
|
|
43
|
+
ClientApi._status = "INITIAL";
|
|
44
|
+
ClientApi._user = null;
|
|
45
|
+
} finally {
|
|
46
|
+
ClientApi._getMeTask = null;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
static async _refreshToken() {
|
|
50
|
+
if (!ClientApi._client) {
|
|
51
|
+
console.error("Client not initialized");
|
|
52
|
+
return { status: "FAILED" };
|
|
53
|
+
}
|
|
54
|
+
if (ClientApi._refreshTokenTask) return await ClientApi._refreshTokenTask;
|
|
55
|
+
const handler = async () => {
|
|
56
|
+
try {
|
|
57
|
+
if ((await ClientApi._client?.admin.v1.auth["refresh-token"].get())?.data?.statusCode === 200) return { status: "SUCCESS" };
|
|
58
|
+
return { status: "FAILED" };
|
|
59
|
+
} catch (error) {
|
|
60
|
+
console.error("Error refreshing token:", JSON.stringify(error));
|
|
61
|
+
return { status: "FAILED" };
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
ClientApi._refreshTokenTask = handler();
|
|
65
|
+
return ClientApi._refreshTokenTask.finally(() => {
|
|
66
|
+
ClientApi._refreshTokenTask = null;
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
static async _logout() {
|
|
70
|
+
if (!ClientApi._client) {
|
|
71
|
+
console.error("Client not initialized");
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (ClientApi._logoutTask) {
|
|
75
|
+
await ClientApi._logoutTask;
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const logout = ClientApi._client.admin.v1.auth.logout.delete();
|
|
79
|
+
ClientApi._logoutTask = logout;
|
|
80
|
+
try {
|
|
81
|
+
await logout;
|
|
82
|
+
} catch (error) {
|
|
83
|
+
console.error("Error during logout:", error);
|
|
84
|
+
} finally {
|
|
85
|
+
ClientApi._logoutTask = null;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
constructor({ baseURL, config, listeners }) {
|
|
89
|
+
if (!ClientApi._client) ClientApi._client = treaty(baseURL, config);
|
|
90
|
+
this._onSetUser = async (user) => {
|
|
91
|
+
ClientApi._status = user ? "LOGGED" : "INITIAL";
|
|
92
|
+
ClientApi._user = user;
|
|
93
|
+
await listeners?.onSetUser?.(user);
|
|
94
|
+
};
|
|
95
|
+
this._onUnauthorized = async () => {
|
|
96
|
+
this._onSetUser?.(null);
|
|
97
|
+
await listeners?.onUnauthorized?.();
|
|
98
|
+
};
|
|
99
|
+
this._onLogout = async () => {
|
|
100
|
+
await listeners?.onLogout?.();
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
isLogged() {
|
|
104
|
+
return ClientApi._status === "LOGGED";
|
|
105
|
+
}
|
|
106
|
+
isInitial() {
|
|
107
|
+
return ClientApi._status === "INITIAL";
|
|
108
|
+
}
|
|
109
|
+
getUser() {
|
|
110
|
+
return ClientApi._user ?? null;
|
|
111
|
+
}
|
|
112
|
+
getClient() {
|
|
113
|
+
return ClientApi._client;
|
|
114
|
+
}
|
|
115
|
+
getUserClient() {}
|
|
116
|
+
async logout() {
|
|
117
|
+
await ClientApi._client?.admin.v1.auth.logout.delete();
|
|
118
|
+
await this._onLogout?.();
|
|
119
|
+
await this._onSetUser?.(null);
|
|
120
|
+
}
|
|
121
|
+
async fetchApi({ request }) {
|
|
122
|
+
if (!ClientApi._client) {
|
|
123
|
+
console.error("Client not initialized");
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
try {
|
|
127
|
+
if (ClientApi._getMeTask) {
|
|
128
|
+
console.log("Awaiting ongoing _getMeTask before proceeding with fetchApi");
|
|
129
|
+
await ClientApi._getMeTask;
|
|
130
|
+
}
|
|
131
|
+
if (ClientApi._refreshTokenTask) {
|
|
132
|
+
console.log("Awaiting ongoing _refreshTokenTask before proceeding with fetchApi");
|
|
133
|
+
await ClientApi._refreshTokenTask;
|
|
134
|
+
}
|
|
135
|
+
if (ClientApi._logoutTask) {
|
|
136
|
+
console.log("Awaiting ongoing _logoutTask before proceeding with fetchApi");
|
|
137
|
+
await ClientApi._logoutTask;
|
|
138
|
+
}
|
|
139
|
+
const response = await request(ClientApi._client);
|
|
140
|
+
if (!response.data) {
|
|
141
|
+
console.error("No response data received from API request");
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
const _data = response.data;
|
|
145
|
+
if (_data?.statusCode === 401) {
|
|
146
|
+
await this._onUnauthorized?.();
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
if (_data?.statusCode === 4001) {
|
|
150
|
+
const { status } = await ClientApi._refreshToken();
|
|
151
|
+
if (status === "SUCCESS") {
|
|
152
|
+
await ClientApi._getMe();
|
|
153
|
+
this._onSetUser?.(ClientApi._user);
|
|
154
|
+
return (await request(ClientApi._client)).data;
|
|
155
|
+
}
|
|
156
|
+
if (status === "FAILED") {
|
|
157
|
+
await ClientApi._logout();
|
|
158
|
+
this._onLogout?.();
|
|
159
|
+
this._onSetUser?.(null);
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return response.data;
|
|
164
|
+
} catch (error) {
|
|
165
|
+
console.error("Error in fetchApi:", JSON.stringify(error));
|
|
166
|
+
return {
|
|
167
|
+
success: false,
|
|
168
|
+
statusCode: 500,
|
|
169
|
+
data: null,
|
|
170
|
+
message: "Internal Client Error",
|
|
171
|
+
error: {
|
|
172
|
+
statusCode: 500,
|
|
173
|
+
message: "Internal Client Error"
|
|
174
|
+
},
|
|
175
|
+
meta: {
|
|
176
|
+
version: "1.0.0",
|
|
177
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
178
|
+
path: ""
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
//#endregion
|
|
186
|
+
export { ClientApi };
|
|
187
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +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,UAAU,YAAY,SACxB;AAIF,MAAI,CAAC,UAAU,SAAS;AACtB,WAAQ,MAAM,yBAAyB;AACvC;;AAIF,MAAI,UAAU,YAAY;AACxB,SAAM,UAAU;AAChB;;EAGF,MAAM,QAAQ,UAAU,QAAQ,MAAM,GAAG,KAAK,GAAG,KAAK;AAGtD,YAAU,aAAa;AACvB,MAAI;GACF,MAAM,MAAM,MAAM;AAClB,OAAI,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,KAAK,SAAS;AACrD,cAAU,UAAU;AACpB,cAAU,QAAQ,IAAI,KAAK;UACtB;AACL,cAAU,UAAU;AACpB,cAAU,QAAQ;;WAEb,OAAO;AACd,WAAQ,MAAM,6BAA6B,MAAM;AACjD,aAAU,UAAU;AACpB,aAAU,QAAQ;YACV;AACR,aAAU,aAAa;;;CAI3B,aAAqB,gBAAgB;AAEnC,MAAI,CAAC,UAAU,SAAS;AACtB,WAAQ,MAAM,yBAAyB;AACvC,UAAO,EAAE,QAAQ,UAAmB;;AAItC,MAAI,UAAU,kBAEZ,QADY,MAAM,UAAU;EAI9B,MAAM,UAAU,YAAuD;AACrE,OAAI;AAGF,SADE,MAAM,UAAU,SAAS,MAAM,GAAG,KAAK,iBAAiB,KAAK,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
+
"main": "./dist/index.cjs",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "tsdown"
|
|
7
|
+
},
|
|
8
|
+
"author": "",
|
|
9
|
+
"license": "ISC",
|
|
10
|
+
"description": "",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"package.json"
|
|
14
|
+
],
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"@elysiajs/eden": "^1.4.6"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@types/bun": "^1.3.5",
|
|
20
|
+
"app": "workspace:*",
|
|
21
|
+
"tsdown": "^0.18.0"
|
|
22
|
+
},
|
|
23
|
+
"module": "./dist/index.mjs",
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"require": "./dist/index.cjs",
|
|
27
|
+
"import": "./dist/index.mjs"
|
|
28
|
+
},
|
|
29
|
+
"./package.json": "./package.json"
|
|
30
|
+
},
|
|
31
|
+
"types": "./dist/index.d.cts"
|
|
32
|
+
}
|