@tagsamurai/fats-api-services 1.0.0-alpha.11 → 1.0.0-alpha.12
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/api-services.es.js +113 -66
- package/api-services.system.js +1 -1
- package/main.d.ts +2 -1
- package/package.json +1 -1
- package/src/services/i18n.service.d.ts +32 -0
- package/src/types/i18nService.type.d.ts +22 -0
package/api-services.es.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
const f = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_APP_API: "https://dev-api.tagsamurai.com", VITE_APP_COUNTRY_STATE_API: "https://api.countrystatecity.in", VITE_APP_COUNTRY_STATE_API_KEY: "ZTc5TVc2STlwTkFFNFltYTRjc05sOHR3ODJEYzVMVTZ5UnBJaWU5SA==", VITE_APP_LOGS_NOTIFICATION_API: "https://dev-api-logs-notification.tagsamurai.com", VITE_APP_TAGSAMURAI_API: "https://dev-api.tagsamurai.com" },
|
|
3
|
-
const { env: r = "APP_API", prefix:
|
|
4
|
-
return
|
|
5
|
-
...
|
|
6
|
-
baseURL:
|
|
7
|
-
headers: e ?
|
|
1
|
+
import d from "axios";
|
|
2
|
+
const f = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_APP_ADMIN_API: "https://dev-admin-api.tagsamurai.com", VITE_APP_API: "https://dev-api.tagsamurai.com", VITE_APP_COUNTRY_STATE_API: "https://api.countrystatecity.in", VITE_APP_COUNTRY_STATE_API_KEY: "ZTc5TVc2STlwTkFFNFltYTRjc05sOHR3ODJEYzVMVTZ5UnBJaWU5SA==", VITE_APP_LOGS_NOTIFICATION_API: "https://dev-api-logs-notification.tagsamurai.com", VITE_APP_TAGSAMURAI_API: "https://dev-api.tagsamurai.com" }, A = (t = "APP_API") => f["VITE_" + t], n = (t = {}, e = !1) => {
|
|
3
|
+
const { env: r = "APP_API", prefix: a = "", headers: u = {}, ...P } = t, I = `${A(r)}${a}`, c = JSON.parse(localStorage.getItem("user") ?? "{}"), _ = c.jwt ?? c.token ?? "";
|
|
4
|
+
return d.create({
|
|
5
|
+
...P,
|
|
6
|
+
baseURL: I,
|
|
7
|
+
headers: e ? u : {
|
|
8
8
|
"Content-Type": "application/json",
|
|
9
|
-
Authorization: `Bearer ${
|
|
10
|
-
...
|
|
9
|
+
Authorization: `Bearer ${_}`,
|
|
10
|
+
...u
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
-
},
|
|
13
|
+
}, O = (t) => {
|
|
14
14
|
if (!t || typeof t == "string")
|
|
15
15
|
return;
|
|
16
16
|
const e = {};
|
|
@@ -21,96 +21,96 @@ const f = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
21
21
|
[r]: t[r]
|
|
22
22
|
});
|
|
23
23
|
}), e;
|
|
24
|
-
},
|
|
24
|
+
}, U = (t) => {
|
|
25
25
|
if (!t) return;
|
|
26
|
-
const e =
|
|
26
|
+
const e = A("APP_TAGSAMURAI_API");
|
|
27
27
|
return t.startsWith("http") ? t : `${e}/file-manager/v2/files/${t}`;
|
|
28
|
-
},
|
|
28
|
+
}, o = n({
|
|
29
29
|
prefix: "/settings-attribute/v2",
|
|
30
30
|
env: "APP_TAGSAMURAI_API"
|
|
31
|
-
}),
|
|
31
|
+
}), y = {
|
|
32
32
|
getGroupCategory: (t) => {
|
|
33
33
|
const e = t === "category" ? t : "groups";
|
|
34
|
-
return
|
|
34
|
+
return o.get(`/${e}/tree`);
|
|
35
35
|
},
|
|
36
36
|
getGroupCategoryList: (t, e) => {
|
|
37
37
|
const r = t === "category" ? t : "groups";
|
|
38
|
-
return
|
|
38
|
+
return o.get(`/${r}/${e}`);
|
|
39
39
|
},
|
|
40
40
|
getNames: (t) => {
|
|
41
41
|
const e = t === "category" ? t : "groups";
|
|
42
|
-
return
|
|
42
|
+
return o.get(`/${e}/names`);
|
|
43
43
|
},
|
|
44
44
|
postCreateGroupCategory: (t, e) => {
|
|
45
45
|
const r = t === "category" ? t : "groups";
|
|
46
|
-
return
|
|
46
|
+
return o.post(`/${r}`, e);
|
|
47
47
|
},
|
|
48
48
|
putEditGroupCategory: (t, e, r) => {
|
|
49
|
-
const
|
|
50
|
-
return
|
|
49
|
+
const a = t === "category" ? t : "groups";
|
|
50
|
+
return o.put(`/${a}/${r}`, e);
|
|
51
51
|
},
|
|
52
|
-
putMoveGroup: (t, e) =>
|
|
53
|
-
putEditBulkGroups: async (t) =>
|
|
52
|
+
putMoveGroup: (t, e) => o.put(`/groups/${e}/move-group`, t),
|
|
53
|
+
putEditBulkGroups: async (t) => o.put("/bulk", t),
|
|
54
54
|
deleteGroupCategory: (t, e, r) => {
|
|
55
|
-
const
|
|
56
|
-
return
|
|
55
|
+
const a = t === "category" ? t : "groups";
|
|
56
|
+
return o.delete(`/${a}/${r}`, { data: e });
|
|
57
57
|
}
|
|
58
|
-
},
|
|
58
|
+
}, v = n({
|
|
59
59
|
prefix: "/v2",
|
|
60
60
|
env: "APP_LOGS_NOTIFICATION_API"
|
|
61
|
-
}),
|
|
62
|
-
getTotalApprovals: () =>
|
|
63
|
-
},
|
|
61
|
+
}), h = {
|
|
62
|
+
getTotalApprovals: () => v.get("/approval/count")
|
|
63
|
+
}, i = n({
|
|
64
64
|
prefix: "/v2",
|
|
65
65
|
env: "APP_LOGS_NOTIFICATION_API"
|
|
66
|
-
}),
|
|
67
|
-
getActionLog: (t) =>
|
|
68
|
-
getActionLogOption: (t) =>
|
|
69
|
-
getSessionLogList: (t) =>
|
|
70
|
-
getUserDetailSystemLogList: (t) =>
|
|
71
|
-
getUserDetailSystemLogOption: (t) =>
|
|
72
|
-
},
|
|
66
|
+
}), D = {
|
|
67
|
+
getActionLog: (t) => i.get("/change-log", { params: t }),
|
|
68
|
+
getActionLogOption: (t) => i.get("/change-log/options", { params: t }),
|
|
69
|
+
getSessionLogList: (t) => i.get("/session-log", { params: t }),
|
|
70
|
+
getUserDetailSystemLogList: (t) => i.get("/change-log", { params: t }),
|
|
71
|
+
getUserDetailSystemLogOption: (t) => i.get("/change-log/options", { params: t })
|
|
72
|
+
}, S = n({
|
|
73
73
|
prefix: "/assets/v2/assets"
|
|
74
|
-
}),
|
|
75
|
-
getScanTag: (t) =>
|
|
76
|
-
}, T =
|
|
74
|
+
}), N = {
|
|
75
|
+
getScanTag: (t) => S.get("/scan", { params: { tag: t } })
|
|
76
|
+
}, T = n({
|
|
77
77
|
prefix: "/tracking/v2/missing"
|
|
78
|
-
}),
|
|
78
|
+
}), C = {
|
|
79
79
|
putFoundAsset: (t, e) => {
|
|
80
80
|
const r = { ids: [t], serialNumber: e };
|
|
81
81
|
return T.put("/found", r);
|
|
82
82
|
}
|
|
83
|
-
},
|
|
83
|
+
}, p = n({
|
|
84
84
|
prefix: "/v2/notification",
|
|
85
85
|
env: "APP_LOGS_NOTIFICATION_API"
|
|
86
|
-
}),
|
|
87
|
-
getNotifications: (t) =>
|
|
88
|
-
readNotification: (t) =>
|
|
89
|
-
}, $ =
|
|
86
|
+
}), E = {
|
|
87
|
+
getNotifications: (t) => p.get("/", { params: t }),
|
|
88
|
+
readNotification: (t) => p.put(`/${t}`)
|
|
89
|
+
}, $ = n({
|
|
90
90
|
prefix: "/v2/session-log",
|
|
91
91
|
env: "APP_LOGS_NOTIFICATION_API"
|
|
92
92
|
}), R = {
|
|
93
93
|
postLogout: () => $.post("/logout")
|
|
94
|
-
},
|
|
94
|
+
}, l = n({
|
|
95
95
|
prefix: "/tag/v2"
|
|
96
|
-
}), E = {
|
|
97
|
-
getScanQR: (t) => p.get("/qr", { params: { tag: t } }),
|
|
98
|
-
getScanRFID: (t) => p.get("/rfid", { params: { tag: t } })
|
|
99
|
-
}, m = o({
|
|
100
|
-
prefix: "/tracking/v2/tracking"
|
|
101
96
|
}), G = {
|
|
97
|
+
getScanQR: (t) => l.get("/qr", { params: { tag: t } }),
|
|
98
|
+
getScanRFID: (t) => l.get("/rfid", { params: { tag: t } })
|
|
99
|
+
}, m = n({
|
|
100
|
+
prefix: "/tracking/v2/tracking"
|
|
101
|
+
}), x = {
|
|
102
102
|
putFoundAsset: (t, e, r) => {
|
|
103
|
-
const
|
|
103
|
+
const a = {
|
|
104
104
|
tag: t,
|
|
105
105
|
group: e,
|
|
106
106
|
serialNumber: r,
|
|
107
107
|
type: "Global"
|
|
108
108
|
};
|
|
109
|
-
return m.put("/found", { params:
|
|
109
|
+
return m.put("/found", { params: a });
|
|
110
110
|
}
|
|
111
|
-
}, s =
|
|
111
|
+
}, s = n({
|
|
112
112
|
prefix: "/settings-user-role/v2"
|
|
113
|
-
}),
|
|
113
|
+
}), w = {
|
|
114
114
|
reLogin: (t) => s.post("/auth/login", t),
|
|
115
115
|
changePassword: (t) => s.put("/users/change-password", t),
|
|
116
116
|
getUserDetail: (t) => s.get(`/users/${t}`),
|
|
@@ -145,19 +145,66 @@ const f = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1, VITE_
|
|
|
145
145
|
getUserDetailUserLogAssignmentOption: (t, e) => s.get(`/users-log/${t}/assignment/option`, { params: e }),
|
|
146
146
|
getUserDetailTransactionAdminLogList: (t, e) => s.get(`/users-log/${t}/transaction-log`, { params: e }),
|
|
147
147
|
getUserDetailTransactionAdminLogOption: (t, e) => s.get(`/users-log/${t}/transaction-log/option`, { params: e })
|
|
148
|
+
}, g = n({
|
|
149
|
+
env: "APP_ADMIN_API",
|
|
150
|
+
prefix: "/settings-attribute/languages"
|
|
151
|
+
}), M = {
|
|
152
|
+
/**
|
|
153
|
+
* Fetch all translation messages for a specific locale.
|
|
154
|
+
* @param locale The locale code (e.g., 'en', 'id').
|
|
155
|
+
* @returns A promise resolving to a key-value record of messages.
|
|
156
|
+
*/
|
|
157
|
+
getMessages: (t) => g.get(`/${t}/translations`),
|
|
158
|
+
/**
|
|
159
|
+
* Fetch all available lang options for LanguageDropdown and LanguageSwitcher
|
|
160
|
+
*
|
|
161
|
+
* @returns Promise Array of options
|
|
162
|
+
*/
|
|
163
|
+
getLanguageOptions: async () => {
|
|
164
|
+
const { data: t } = await g.get(
|
|
165
|
+
"/dropdown"
|
|
166
|
+
);
|
|
167
|
+
return t.data;
|
|
168
|
+
},
|
|
169
|
+
/**
|
|
170
|
+
* Fetch single lang option meta data
|
|
171
|
+
*
|
|
172
|
+
* @param isoCode The locale code (e.g., 'en', 'id').
|
|
173
|
+
* @returns Promise LanguageMeta
|
|
174
|
+
*/
|
|
175
|
+
getLanguageOptionMeta: async (t) => {
|
|
176
|
+
const { data: e } = await g.get(
|
|
177
|
+
"/dropdown/" + t
|
|
178
|
+
);
|
|
179
|
+
return e.data;
|
|
180
|
+
},
|
|
181
|
+
/**
|
|
182
|
+
* Translate a specific text to the target locale.
|
|
183
|
+
*
|
|
184
|
+
* @param key Unique translation key.
|
|
185
|
+
* @param locale Target locale code.
|
|
186
|
+
*/
|
|
187
|
+
translateText: async (t, e) => {
|
|
188
|
+
const { data: r } = await g.post("/translate", {
|
|
189
|
+
q: t,
|
|
190
|
+
target: e
|
|
191
|
+
});
|
|
192
|
+
return r.data.translations[t];
|
|
193
|
+
}
|
|
148
194
|
};
|
|
149
195
|
export {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
196
|
+
N as AssetServices,
|
|
197
|
+
D as ChangelogServices,
|
|
198
|
+
y as GroupCategoryServices,
|
|
199
|
+
M as I18nService,
|
|
200
|
+
C as MissingServices,
|
|
201
|
+
h as NotificationApprovalServices,
|
|
202
|
+
E as NotificationServices,
|
|
156
203
|
R as SessionLogServices,
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
204
|
+
G as TAGServices,
|
|
205
|
+
x as TrackingServices,
|
|
206
|
+
w as UserServices,
|
|
207
|
+
A as getBaseURL,
|
|
208
|
+
U as getImageURL,
|
|
209
|
+
O as queryParamsStringfy
|
|
163
210
|
};
|
package/api-services.system.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["axios"],function(n,
|
|
1
|
+
System.register(["axios"],function(n,y){"use strict";var p;return{setters:[u=>{p=u.default}],execute:function(){const u={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APP_ADMIN_API:"https://dev-admin-api.tagsamurai.com",VITE_APP_API:"https://dev-api.tagsamurai.com",VITE_APP_COUNTRY_STATE_API:"https://api.countrystatecity.in",VITE_APP_COUNTRY_STATE_API_KEY:"ZTc5TVc2STlwTkFFNFltYTRjc05sOHR3ODJEYzVMVTZ5UnBJaWU5SA==",VITE_APP_LOGS_NOTIFICATION_API:"https://dev-api-logs-notification.tagsamurai.com",VITE_APP_TAGSAMURAI_API:"https://dev-api.tagsamurai.com"},l=n("getBaseURL",(t="APP_API")=>u["VITE_"+t]),o=(t={},e=!1)=>{const{env:r="APP_API",prefix:a="",headers:I={},...$}=t,m=`${l(r)}${a}`,S=JSON.parse(localStorage.getItem("user")??"{}"),L=S.jwt??S.token??"";return p.create({...$,baseURL:m,headers:e?I:{"Content-Type":"application/json",Authorization:`Bearer ${L}`,...I}})},O=n("queryParamsStringfy",t=>{if(!t||typeof t=="string")return;const e={};return Object.keys(t).forEach(r=>{Array.isArray(t[r])?t[r].length>0&&Object.assign(e,{[r]:JSON.stringify(t[r])}):t[r]!==void 0&&Object.assign(e,{[r]:t[r]})}),e}),U=n("getImageURL",t=>{if(!t)return;const e=l("APP_TAGSAMURAI_API");return t.startsWith("http")?t:`${e}/file-manager/v2/files/${t}`}),i=o({prefix:"/settings-attribute/v2",env:"APP_TAGSAMURAI_API"}),h=n("GroupCategoryServices",{getGroupCategory:t=>{const e=t==="category"?t:"groups";return i.get(`/${e}/tree`)},getGroupCategoryList:(t,e)=>{const r=t==="category"?t:"groups";return i.get(`/${r}/${e}`)},getNames:t=>{const e=t==="category"?t:"groups";return i.get(`/${e}/names`)},postCreateGroupCategory:(t,e)=>{const r=t==="category"?t:"groups";return i.post(`/${r}`,e)},putEditGroupCategory:(t,e,r)=>{const a=t==="category"?t:"groups";return i.put(`/${a}/${r}`,e)},putMoveGroup:(t,e)=>i.put(`/groups/${e}/move-group`,t),putEditBulkGroups:async t=>i.put("/bulk",t),deleteGroupCategory:(t,e,r)=>{const a=t==="category"?t:"groups";return i.delete(`/${a}/${r}`,{data:e})}}),v=o({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),N=n("NotificationApprovalServices",{getTotalApprovals:()=>v.get("/approval/count")}),g=o({prefix:"/v2",env:"APP_LOGS_NOTIFICATION_API"}),C=n("ChangelogServices",{getActionLog:t=>g.get("/change-log",{params:t}),getActionLogOption:t=>g.get("/change-log/options",{params:t}),getSessionLogList:t=>g.get("/session-log",{params:t}),getUserDetailSystemLogList:t=>g.get("/change-log",{params:t}),getUserDetailSystemLogOption:t=>g.get("/change-log/options",{params:t})}),_=o({prefix:"/assets/v2/assets"}),D=n("AssetServices",{getScanTag:t=>_.get("/scan",{params:{tag:t}})}),f=o({prefix:"/tracking/v2/missing"}),R=n("MissingServices",{putFoundAsset:(t,e)=>{const r={ids:[t],serialNumber:e};return f.put("/found",r)}}),A=o({prefix:"/v2/notification",env:"APP_LOGS_NOTIFICATION_API"}),E=n("NotificationServices",{getNotifications:t=>A.get("/",{params:t}),readNotification:t=>A.put(`/${t}`)}),d=o({prefix:"/v2/session-log",env:"APP_LOGS_NOTIFICATION_API"}),G=n("SessionLogServices",{postLogout:()=>d.post("/logout")}),P=o({prefix:"/tag/v2"}),w=n("TAGServices",{getScanQR:t=>P.get("/qr",{params:{tag:t}}),getScanRFID:t=>P.get("/rfid",{params:{tag:t}})}),T=o({prefix:"/tracking/v2/tracking"}),M=n("TrackingServices",{putFoundAsset:(t,e,r)=>{const a={tag:t,group:e,serialNumber:r,type:"Global"};return T.put("/found",{params:a})}}),s=o({prefix:"/settings-user-role/v2"}),b=n("UserServices",{reLogin:t=>s.post("/auth/login",t),changePassword:t=>s.put("/users/change-password",t),getUserDetail:t=>s.get(`/users/${t}`),putEditUser:(t,e)=>{const r={"Content-Type":"multipart/form-data"};return s.put(`/users/${t}`,e,{headers:r})},putDeleteProfilePicture:t=>s.put(`/users/${t}/delete-profile-picture`),putCancelEmailChange:(t,e)=>s.put("/auth/confirm-email-change/cancel",{user:t,companyCode:e}),getUserDetailSystemRoles:(t,e,r)=>s.get(`/user-detail/${t}/system-roles`,{params:{...r,type:e}}),getUserDetailSystemRoleList:(t,e)=>s.get(`/user-detail/${t}/system-role-list`,{params:e}),getUserDetailSystemRoleOptions:(t,e)=>s.get(`/user-detail/${t}/system-role/option`,{params:e}),getUserDetailTransactionRoleList:(t,e)=>s.get(`/user-detail/${t}/transaction-role-list`,{params:e}),getUserDetailUserLogBorrowingList:(t,e)=>s.get(`/users-log/${t}/borrowing`,{params:e}),getUserDetailUserLogAssignmentList:(t,e)=>s.get(`/users-log/${t}/assignment`,{params:e}),getUserDetailUserLogBorrowingOption:(t,e)=>s.get(`/users-log/${t}/borrowing/option`,{params:e}),getUserDetailUserLogAssignmentOption:(t,e)=>s.get(`/users-log/${t}/assignment/option`,{params:e}),getUserDetailTransactionAdminLogList:(t,e)=>s.get(`/users-log/${t}/transaction-log`,{params:e}),getUserDetailTransactionAdminLogOption:(t,e)=>s.get(`/users-log/${t}/transaction-log/option`,{params:e})}),c=o({env:"APP_ADMIN_API",prefix:"/settings-attribute/languages"}),F=n("I18nService",{getMessages:t=>c.get(`/${t}/translations`),getLanguageOptions:async()=>{const{data:t}=await c.get("/dropdown");return t.data},getLanguageOptionMeta:async t=>{const{data:e}=await c.get("/dropdown/"+t);return e.data},translateText:async(t,e)=>{const{data:r}=await c.post("/translate",{q:t,target:e});return r.data.translations[t]}})}}});
|
package/main.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { oldGetImageURL as getImageURL, getBaseURL, queryParamsStringfy, } from './src/utils';
|
|
1
2
|
export { default as GroupCategoryServices } from './src/services/oldGroupCategory.service';
|
|
2
3
|
export { default as NotificationApprovalServices } from './src/services/oldNotificationApproval.service';
|
|
3
4
|
export { default as ChangelogServices } from './src/services/oldLog.service';
|
|
@@ -8,4 +9,4 @@ export { default as SessionLogServices } from './src/services/oldSessionLog.serv
|
|
|
8
9
|
export { default as TAGServices } from './src/services/oldTag.service';
|
|
9
10
|
export { default as TrackingServices } from './src/services/oldTracking.service';
|
|
10
11
|
export { default as UserServices } from './src/services/oldUser.service';
|
|
11
|
-
export {
|
|
12
|
+
export { default as I18nService } from './src/services/i18n.service';
|
package/package.json
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { LanguageMeta, LanguageTranslations } from '../types/i18nService.type';
|
|
3
|
+
import { FetchDetailResponse } from '../types/fetchResponse.type';
|
|
4
|
+
declare const I18nService: {
|
|
5
|
+
/**
|
|
6
|
+
* Fetch all translation messages for a specific locale.
|
|
7
|
+
* @param locale The locale code (e.g., 'en', 'id').
|
|
8
|
+
* @returns A promise resolving to a key-value record of messages.
|
|
9
|
+
*/
|
|
10
|
+
getMessages: (isoCode: string) => Promise<AxiosResponse<FetchDetailResponse<LanguageTranslations>>>;
|
|
11
|
+
/**
|
|
12
|
+
* Fetch all available lang options for LanguageDropdown and LanguageSwitcher
|
|
13
|
+
*
|
|
14
|
+
* @returns Promise Array of options
|
|
15
|
+
*/
|
|
16
|
+
getLanguageOptions: () => Promise<LanguageMeta[]>;
|
|
17
|
+
/**
|
|
18
|
+
* Fetch single lang option meta data
|
|
19
|
+
*
|
|
20
|
+
* @param isoCode The locale code (e.g., 'en', 'id').
|
|
21
|
+
* @returns Promise LanguageMeta
|
|
22
|
+
*/
|
|
23
|
+
getLanguageOptionMeta: (isoCode: string) => Promise<LanguageMeta>;
|
|
24
|
+
/**
|
|
25
|
+
* Translate a specific text to the target locale.
|
|
26
|
+
*
|
|
27
|
+
* @param key Unique translation key.
|
|
28
|
+
* @param locale Target locale code.
|
|
29
|
+
*/
|
|
30
|
+
translateText: (key: string, locale: string) => Promise<string>;
|
|
31
|
+
};
|
|
32
|
+
export default I18nService;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FetchResponse } from './fetchResponse.type';
|
|
2
|
+
export interface LanguageMeta {
|
|
3
|
+
isoCode: string;
|
|
4
|
+
name: string;
|
|
5
|
+
flag: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface LanguageListItem extends LanguageMeta {
|
|
9
|
+
_id: string;
|
|
10
|
+
updatedAt: string;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
modifiedBy: string;
|
|
13
|
+
}
|
|
14
|
+
export type LanguageTranslations = Record<string, string>;
|
|
15
|
+
export interface LanguageDetail extends LanguageListItem {
|
|
16
|
+
translations: LanguageTranslations;
|
|
17
|
+
}
|
|
18
|
+
export type TranslateResponse = FetchResponse & {
|
|
19
|
+
data: {
|
|
20
|
+
translations: LanguageTranslations;
|
|
21
|
+
};
|
|
22
|
+
};
|