sass-cms-template-common 0.0.4 → 0.0.5

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/server.d.ts CHANGED
@@ -21,6 +21,54 @@ export declare class CmsCommonServices {
21
21
  getSitesAndPublications: () => Promise<SitesAndPublicationsResult>;
22
22
  }
23
23
 
24
+ /** Envelope común de respuesta de los webservices de OpenCms. */
25
+ export declare interface CmsResponse {
26
+ status: 'ok' | 'fail' | 'error';
27
+ errorCode?: string;
28
+ error?: string;
29
+ }
30
+
31
+ /** Usuario del CMS. Los campos presentes dependen del formato `fields`. */
32
+ export declare interface CmsUser {
33
+ username?: string;
34
+ firstname?: string;
35
+ lastname?: string;
36
+ fullName?: string;
37
+ email?: string;
38
+ datecreated?: string;
39
+ status?: string;
40
+ [key: string]: unknown;
41
+ }
42
+
43
+ /**
44
+ * Servicios HTTP del módulo `users` del CMS.
45
+ *
46
+ * Se construye igual que `CmsCommonServices`, con `{ axiosApi, authentication }`.
47
+ */
48
+ export declare class CmsUsersServices {
49
+ protected props: IUsersServices;
50
+ protected authentication: Authentication;
51
+ constructor(props: IUsersServices);
52
+ /** POST /users/get — lista paginada de usuarios con filtros. */
53
+ getUsers: (filters?: UsersGetFilters) => Promise<UsersGetResponse>;
54
+ /** POST /users/publication — usuarios asociados a la publicación. */
55
+ getPublicationUsers: (filters?: UsersPublicationFilters) => Promise<UsersPublicationResponse>;
56
+ /** POST /users/groups/get — grupos disponibles del sistema. */
57
+ getGroups: (ou?: string) => Promise<UserGroupsResponse>;
58
+ /** POST /users/pin/get — pins del usuario autenticado. */
59
+ getPins: () => Promise<UserPinsGetResponse>;
60
+ /** POST /users/pin/add — agrega un pin de recurso. */
61
+ addPin: (pin: string) => Promise<UserPinAddResponse>;
62
+ /** POST /users/pin/delete — elimina uno o más pins por ID. */
63
+ deletePins: (ids: number[]) => Promise<CmsResponse>;
64
+ /** POST /users/action/setStatus — activa o desactiva un usuario. */
65
+ setUserStatus: (username: string, action: UserStatusAction) => Promise<CmsResponse>;
66
+ /** POST /users/action/resetPass — restablece la contraseña de un usuario. */
67
+ resetPassword: (username: string) => Promise<CmsResponse>;
68
+ /** POST /users/action/resetMfa — resetea la configuración MFA de un usuario. */
69
+ resetMfa: (username: string, reason: string) => Promise<CmsResponse>;
70
+ }
71
+
24
72
  /** POST /dashboard/countNotificatio */
25
73
  export declare interface CountNotificationsResponse {
26
74
  status: string;
@@ -51,6 +99,11 @@ declare interface ICommonServices {
51
99
  authentication: Authentication;
52
100
  }
53
101
 
102
+ declare interface IUsersServices {
103
+ axiosApi: AxiosInstance;
104
+ authentication: Authentication;
105
+ }
106
+
54
107
  /** Cuerpo de la respuesta de POST /auth/modulesAvailable */
55
108
  export declare interface ModulesAvailableResponse {
56
109
  modules: NavItemPermissions[];
@@ -159,6 +212,12 @@ export declare interface PublicationPermissions {
159
212
  [key: string]: boolean;
160
213
  }
161
214
 
215
+ /**
216
+ * Ámbito de publicación: `"pub"` (solo publicación), `"admin"` (solo admins
217
+ * globales) o cualquier otro valor (ambos).
218
+ */
219
+ export declare type PublicationScope = 'pub' | 'admin' | (string & {});
220
+
162
221
  /** Cuerpo de la respuesta de POST /publications/get */
163
222
  export declare interface PublicationsGetResponse {
164
223
  status: string;
@@ -214,4 +273,110 @@ export declare interface SitesGetResponse {
214
273
  sites: Site[];
215
274
  }
216
275
 
276
+ /** Grupo del sistema devuelto por POST /users/groups/get. */
277
+ export declare interface UserGroup {
278
+ id: string;
279
+ name: string;
280
+ }
281
+
282
+ /** Cuerpo de la respuesta de POST /users/groups/get. */
283
+ export declare interface UserGroupsResponse extends CmsResponse {
284
+ groups: UserGroup[];
285
+ }
286
+
287
+ /** Pin (recurso fijado) de un usuario. */
288
+ export declare interface UserPin {
289
+ id: number;
290
+ [key: string]: unknown;
291
+ }
292
+
293
+ /** Cuerpo de la respuesta de POST /users/pin/add. */
294
+ export declare interface UserPinAddResponse extends CmsResponse {
295
+ /** ID del pin creado. */
296
+ id?: number;
297
+ }
298
+
299
+ /** Pin a eliminar en POST /users/pin/delete. */
300
+ export declare interface UserPinDeleteInput {
301
+ id: number;
302
+ }
303
+
304
+ /** Cuerpo de la respuesta de POST /users/pin/get. */
305
+ export declare interface UserPinsGetResponse extends CmsResponse {
306
+ pins: UserPin[];
307
+ total?: number;
308
+ }
309
+
310
+ /** Filtro sobre campos adicionales del usuario (`filters.advance`). */
311
+ export declare interface UsersAdvanceFilter {
312
+ name: string;
313
+ value: string;
314
+ }
315
+
316
+ /** Formato de respuesta soportado por POST /users/get. */
317
+ export declare type UsersFieldsFormat = 'all' | 'FullName' | 'detail' | '';
318
+
319
+ /** Filtros de POST /users/get. */
320
+ export declare interface UsersGetFilters {
321
+ /** Cantidad de resultados por página (default: 100). */
322
+ size?: number;
323
+ /** Número de página (default: 1). */
324
+ page?: number;
325
+ /** Fuerza búsqueda global (default: false). */
326
+ searchGlobal?: boolean;
327
+ /**
328
+ * Campo + dirección. Campos válidos: `username`, `firstname`, `lastname`,
329
+ * `email`, `datecreated`. Ej: `"datecreated desc"`.
330
+ */
331
+ order?: string;
332
+ /** Nombre del grupo para filtrar usuarios. */
333
+ grupo?: string;
334
+ /** Organizational Unit (default: "/"). */
335
+ ou?: string;
336
+ /** Estado del usuario. */
337
+ status?: UserStatus;
338
+ /** Timestamp en milisegundos (inicio del rango de fecha de creación). */
339
+ fromDate?: string;
340
+ /** Timestamp en milisegundos (fin del rango de fecha de creación). */
341
+ toDate?: string;
342
+ /** Filtra por ámbito de publicación. */
343
+ publicationScope?: PublicationScope;
344
+ /** Formato de respuesta. */
345
+ fields?: UsersFieldsFormat;
346
+ /** Búsqueda libre por email, username, apellido o nombre (LIKE). */
347
+ text?: string;
348
+ /** Filtros sobre campos adicionales del usuario. */
349
+ advance?: UsersAdvanceFilter[];
350
+ }
351
+
352
+ /** Cuerpo de la respuesta de POST /users/get. */
353
+ export declare interface UsersGetResponse extends CmsResponse {
354
+ users: CmsUser[];
355
+ total?: number;
356
+ page?: number;
357
+ size?: number;
358
+ }
359
+
360
+ /** Formato de respuesta soportado por POST /users/publication. */
361
+ export declare type UsersPublicationFieldsFormat = 'all' | 'summary' | 'FullName' | '';
362
+
363
+ /** Filtros de POST /users/publication. */
364
+ export declare interface UsersPublicationFilters {
365
+ /** Texto libre para búsqueda de usuario. */
366
+ text?: string;
367
+ /** Formato de respuesta. */
368
+ fields?: UsersPublicationFieldsFormat;
369
+ }
370
+
371
+ /** Cuerpo de la respuesta de POST /users/publication. */
372
+ export declare interface UsersPublicationResponse extends CmsResponse {
373
+ users: CmsUser[];
374
+ }
375
+
376
+ /** Estado posible de un usuario del sistema. */
377
+ export declare type UserStatus = 'active' | 'block' | 'pending';
378
+
379
+ /** Acción soportada por POST /users/action/setStatus. */
380
+ export declare type UserStatusAction = 'activate' | 'deactivate';
381
+
217
382
  export { }
package/dist/server.js CHANGED
@@ -1,2 +1,2 @@
1
- import { c as e, l as t, o as n, s as r, t as i, u as a } from "./services-DlTJ4HIV.js";
2
- export { i as CmsCommonServices, n as findPublicationBySlug, r as findPublicationLabel, e as getAllPublications, t as getDefaultPublicationSlug, a as parsePublicationSlug };
1
+ import { c as e, d as t, l as n, n as r, s as i, t as a, u as o } from "./services-CK6pkce_.js";
2
+ export { a as CmsCommonServices, r as CmsUsersServices, i as findPublicationBySlug, e as findPublicationLabel, n as getAllPublications, o as getDefaultPublicationSlug, t as parsePublicationSlug };
@@ -0,0 +1,178 @@
1
+ //#region src/lib/utils/site-selector.ts
2
+ var e = "#ECEDF6", t = "#D8E2FF", n = "#FFFFFF", r = "bluestack-es";
3
+ function i(e) {
4
+ return e.flatMap((e) => e.publications);
5
+ }
6
+ function a(e, t) {
7
+ return i(e).find((e) => String(e.id) === t);
8
+ }
9
+ function o(e, t) {
10
+ return i(e).find((e) => String(e.id) === t)?.description ?? "Seleccionar publicación";
11
+ }
12
+ function s(e) {
13
+ let t = i(e)[0];
14
+ return t ? String(t.id) : "1";
15
+ }
16
+ function c(e) {
17
+ let t = Number(e);
18
+ return Number.isFinite(t) && t > 0 ? t : 1;
19
+ }
20
+ //#endregion
21
+ //#region src/lib/services/users.ts
22
+ var l = class {
23
+ props;
24
+ authentication;
25
+ constructor(e) {
26
+ this.props = e, this.authentication = e.authentication;
27
+ }
28
+ getUsers = async (e = {}) => {
29
+ try {
30
+ return (await this.props.axiosApi.post("/users/get", {
31
+ authentication: this.authentication,
32
+ filters: e
33
+ })).data;
34
+ } catch (e) {
35
+ return console.error("[/users/get]", e), Promise.reject(e);
36
+ }
37
+ };
38
+ getPublicationUsers = async (e = {}) => {
39
+ try {
40
+ return (await this.props.axiosApi.post("/users/publication", {
41
+ authentication: this.authentication,
42
+ filters: e
43
+ })).data;
44
+ } catch (e) {
45
+ return console.error("[/users/publication]", e), Promise.reject(e);
46
+ }
47
+ };
48
+ getGroups = async (e = "/") => {
49
+ try {
50
+ return (await this.props.axiosApi.post("/users/groups/get", {
51
+ authentication: this.authentication,
52
+ ou: e
53
+ })).data;
54
+ } catch (e) {
55
+ return console.error("[/users/groups/get]", e), Promise.reject(e);
56
+ }
57
+ };
58
+ getPins = async () => {
59
+ try {
60
+ return (await this.props.axiosApi.post("/users/pin/get", { authentication: this.authentication })).data;
61
+ } catch (e) {
62
+ return console.error("[/users/pin/get]", e), Promise.reject(e);
63
+ }
64
+ };
65
+ addPin = async (e) => {
66
+ try {
67
+ return (await this.props.axiosApi.post("/users/pin/add", {
68
+ authentication: this.authentication,
69
+ pines: { pin: [e] }
70
+ })).data;
71
+ } catch (e) {
72
+ return console.error("[/users/pin/add]", e), Promise.reject(e);
73
+ }
74
+ };
75
+ deletePins = async (e) => {
76
+ try {
77
+ let t = e.map((e) => ({ id: e }));
78
+ return (await this.props.axiosApi.post("/users/pin/delete", {
79
+ authentication: this.authentication,
80
+ pines: { pin: t }
81
+ })).data;
82
+ } catch (e) {
83
+ return console.error("[/users/pin/delete]", e), Promise.reject(e);
84
+ }
85
+ };
86
+ setUserStatus = async (e, t) => {
87
+ try {
88
+ return (await this.props.axiosApi.post("/users/action/setStatus", {
89
+ authentication: this.authentication,
90
+ username: e,
91
+ action: t
92
+ })).data;
93
+ } catch (e) {
94
+ return console.error("[/users/action/setStatus]", e), Promise.reject(e);
95
+ }
96
+ };
97
+ resetPassword = async (e) => {
98
+ try {
99
+ return (await this.props.axiosApi.post("/users/action/resetPass", {
100
+ authentication: this.authentication,
101
+ username: e
102
+ })).data;
103
+ } catch (e) {
104
+ return console.error("[/users/action/resetPass]", e), Promise.reject(e);
105
+ }
106
+ };
107
+ resetMfa = async (e, t) => {
108
+ try {
109
+ return (await this.props.axiosApi.post("/users/action/resetMfa", {
110
+ authentication: this.authentication,
111
+ username: e,
112
+ reason: t
113
+ })).data;
114
+ } catch (e) {
115
+ return console.error("[/users/action/resetMfa]", e), Promise.reject(e);
116
+ }
117
+ };
118
+ }, u = class {
119
+ props;
120
+ authentication;
121
+ constructor(e) {
122
+ this.props = e, this.authentication = e.authentication;
123
+ }
124
+ getDefaultPublication = async () => {
125
+ try {
126
+ return (await this.props.axiosApi.post("/publications/default", { authentication: this.authentication })).data;
127
+ } catch (e) {
128
+ return console.log(`[/publications/default] Error: ${e.message}`), Promise.reject(e);
129
+ }
130
+ };
131
+ getProfile = async () => {
132
+ try {
133
+ return (await this.props.axiosApi.post("/profile/get", { authentication: this.authentication })).data;
134
+ } catch (e) {
135
+ return console.error("[/profile/get]", e), Promise.reject(e);
136
+ }
137
+ };
138
+ getCountNotifications = async () => {
139
+ try {
140
+ return (await this.props.axiosApi.post("/dashboard/countNotifications", { authentication: this.authentication })).data;
141
+ } catch (e) {
142
+ return console.error("[/dashboard/countNotificatio]", e), Promise.reject(e);
143
+ }
144
+ };
145
+ getNotifications = async () => {
146
+ try {
147
+ return (await this.props.axiosApi.post("/dashboard/notification", { authentication: this.authentication })).data;
148
+ } catch (e) {
149
+ return console.error("[/dashboard/notification]", e), Promise.reject(e);
150
+ }
151
+ };
152
+ getSitesAndPublications = async () => {
153
+ try {
154
+ let [e, t, n, r] = await Promise.all([
155
+ this.props.axiosApi.post("/sites/get", { authentication: this.authentication }),
156
+ this.props.axiosApi.post("/publications/get", { authentication: this.authentication }),
157
+ this.props.axiosApi.post("/auth/modulesAvailable", { authentication: this.authentication }),
158
+ this.props.axiosApi.post("/auth/permissions", { authentication: this.authentication })
159
+ ]), i = e.data.sites.map((e) => ({
160
+ title: e.title,
161
+ publications: t.data.publications.filter((t) => t.site === e.name)
162
+ }));
163
+ return console.log(r, "permissions"), {
164
+ sites: i.filter((e) => e.publications.length > 0),
165
+ modules: n.data.modules
166
+ };
167
+ } catch (e) {
168
+ return console.error(e), {
169
+ sites: [],
170
+ modules: []
171
+ };
172
+ }
173
+ };
174
+ };
175
+ //#endregion
176
+ export { t as a, o as c, c as d, n as i, i as l, l as n, e as o, r, a as s, u as t, s as u };
177
+
178
+ //# sourceMappingURL=services-CK6pkce_.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"services-CK6pkce_.js","names":[],"sources":["../src/lib/utils/site-selector.ts","../src/lib/services/users.ts","../src/lib/services/index.ts"],"sourcesContent":["import type { Publication } from '../types/publication';\nimport type { SiteSection } from '../types/site';\n\nexport const MENU_BG = '#ECEDF6';\nexport const ITEM_HOVER_BG = '#D8E2FF';\nexport const ITEM_DEFAULT_BG = '#FFFFFF';\n\nexport const DEFAULT_SITE_ID = 'bluestack-es';\n\nexport function getAllPublications(sites: SiteSection[]): Publication[] {\n return sites.flatMap((section) => section.publications);\n}\n\nexport function findPublicationBySlug(\n sites: SiteSection[],\n slug: string,\n): Publication | undefined {\n return getAllPublications(sites).find((p) => String(p.id) === slug);\n}\n\nexport function findPublicationLabel(\n sites: SiteSection[],\n publicationId: string,\n): string {\n const publication = getAllPublications(sites).find(\n (p) => String(p.id) === publicationId,\n );\n return publication?.description ?? 'Seleccionar publicación';\n}\n\nexport function getDefaultPublicationSlug(sites: SiteSection[]): string {\n const first = getAllPublications(sites)[0];\n return first ? String(first.id) : '1';\n}\n\nexport function parsePublicationSlug(slug: string): number {\n const id = Number(slug);\n return Number.isFinite(id) && id > 0 ? id : 1;\n}\n","import type { AxiosInstance } from 'axios';\n\nimport type { Authentication } from '../types/authentication';\n\n/** Envelope común de respuesta de los webservices de OpenCms. */\nexport interface CmsResponse {\n status: 'ok' | 'fail' | 'error';\n errorCode?: string;\n error?: string;\n}\n\n/** Estado posible de un usuario del sistema. */\nexport type UserStatus = 'active' | 'block' | 'pending';\n\n/** Formato de respuesta soportado por POST /users/get. */\nexport type UsersFieldsFormat = 'all' | 'FullName' | 'detail' | '';\n\n/**\n * Ámbito de publicación: `\"pub\"` (solo publicación), `\"admin\"` (solo admins\n * globales) o cualquier otro valor (ambos).\n */\nexport type PublicationScope = 'pub' | 'admin' | (string & {});\n\n/** Filtro sobre campos adicionales del usuario (`filters.advance`). */\nexport interface UsersAdvanceFilter {\n name: string;\n value: string;\n}\n\n/** Filtros de POST /users/get. */\nexport interface UsersGetFilters {\n /** Cantidad de resultados por página (default: 100). */\n size?: number;\n /** Número de página (default: 1). */\n page?: number;\n /** Fuerza búsqueda global (default: false). */\n searchGlobal?: boolean;\n /**\n * Campo + dirección. Campos válidos: `username`, `firstname`, `lastname`,\n * `email`, `datecreated`. Ej: `\"datecreated desc\"`.\n */\n order?: string;\n /** Nombre del grupo para filtrar usuarios. */\n grupo?: string;\n /** Organizational Unit (default: \"/\"). */\n ou?: string;\n /** Estado del usuario. */\n status?: UserStatus;\n /** Timestamp en milisegundos (inicio del rango de fecha de creación). */\n fromDate?: string;\n /** Timestamp en milisegundos (fin del rango de fecha de creación). */\n toDate?: string;\n /** Filtra por ámbito de publicación. */\n publicationScope?: PublicationScope;\n /** Formato de respuesta. */\n fields?: UsersFieldsFormat;\n /** Búsqueda libre por email, username, apellido o nombre (LIKE). */\n text?: string;\n /** Filtros sobre campos adicionales del usuario. */\n advance?: UsersAdvanceFilter[];\n}\n\n/** Usuario del CMS. Los campos presentes dependen del formato `fields`. */\nexport interface CmsUser {\n username?: string;\n firstname?: string;\n lastname?: string;\n fullName?: string;\n email?: string;\n datecreated?: string;\n status?: string;\n [key: string]: unknown;\n}\n\n/** Cuerpo de la respuesta de POST /users/get. */\nexport interface UsersGetResponse extends CmsResponse {\n users: CmsUser[];\n total?: number;\n page?: number;\n size?: number;\n}\n\n/** Formato de respuesta soportado por POST /users/publication. */\nexport type UsersPublicationFieldsFormat = 'all' | 'summary' | 'FullName' | '';\n\n/** Filtros de POST /users/publication. */\nexport interface UsersPublicationFilters {\n /** Texto libre para búsqueda de usuario. */\n text?: string;\n /** Formato de respuesta. */\n fields?: UsersPublicationFieldsFormat;\n}\n\n/** Cuerpo de la respuesta de POST /users/publication. */\nexport interface UsersPublicationResponse extends CmsResponse {\n users: CmsUser[];\n}\n\n/** Grupo del sistema devuelto por POST /users/groups/get. */\nexport interface UserGroup {\n id: string;\n name: string;\n}\n\n/** Cuerpo de la respuesta de POST /users/groups/get. */\nexport interface UserGroupsResponse extends CmsResponse {\n groups: UserGroup[];\n}\n\n/** Pin (recurso fijado) de un usuario. */\nexport interface UserPin {\n id: number;\n [key: string]: unknown;\n}\n\n/** Cuerpo de la respuesta de POST /users/pin/get. */\nexport interface UserPinsGetResponse extends CmsResponse {\n pins: UserPin[];\n total?: number;\n}\n\n/** Cuerpo de la respuesta de POST /users/pin/add. */\nexport interface UserPinAddResponse extends CmsResponse {\n /** ID del pin creado. */\n id?: number;\n}\n\n/** Pin a eliminar en POST /users/pin/delete. */\nexport interface UserPinDeleteInput {\n id: number;\n}\n\n/** Acción soportada por POST /users/action/setStatus. */\nexport type UserStatusAction = 'activate' | 'deactivate';\n\ninterface IUsersServices {\n axiosApi: AxiosInstance;\n authentication: Authentication;\n}\n\n/**\n * Servicios HTTP del módulo `users` del CMS.\n *\n * Se construye igual que `CmsCommonServices`, con `{ axiosApi, authentication }`.\n */\nexport class CmsUsersServices {\n protected props: IUsersServices;\n protected authentication: Authentication;\n\n constructor(props: IUsersServices) {\n this.props = props;\n this.authentication = props.authentication;\n }\n\n /** POST /users/get — lista paginada de usuarios con filtros. */\n getUsers = async (\n filters: UsersGetFilters = {},\n ): Promise<UsersGetResponse> => {\n try {\n const response = await this.props.axiosApi.post<UsersGetResponse>(\n '/users/get',\n {\n authentication: this.authentication,\n filters,\n },\n );\n return response.data;\n } catch (error: any) {\n console.error('[/users/get]', error);\n return Promise.reject(error);\n }\n };\n\n /** POST /users/publication — usuarios asociados a la publicación. */\n getPublicationUsers = async (\n filters: UsersPublicationFilters = {},\n ): Promise<UsersPublicationResponse> => {\n try {\n const response =\n await this.props.axiosApi.post<UsersPublicationResponse>(\n '/users/publication',\n {\n authentication: this.authentication,\n filters,\n },\n );\n return response.data;\n } catch (error: any) {\n console.error('[/users/publication]', error);\n return Promise.reject(error);\n }\n };\n\n /** POST /users/groups/get — grupos disponibles del sistema. */\n getGroups = async (ou = '/'): Promise<UserGroupsResponse> => {\n try {\n const response = await this.props.axiosApi.post<UserGroupsResponse>(\n '/users/groups/get',\n {\n authentication: this.authentication,\n ou,\n },\n );\n return response.data;\n } catch (error: any) {\n console.error('[/users/groups/get]', error);\n return Promise.reject(error);\n }\n };\n\n /** POST /users/pin/get — pins del usuario autenticado. */\n getPins = async (): Promise<UserPinsGetResponse> => {\n try {\n const response = await this.props.axiosApi.post<UserPinsGetResponse>(\n '/users/pin/get',\n {\n authentication: this.authentication,\n },\n );\n return response.data;\n } catch (error: any) {\n console.error('[/users/pin/get]', error);\n return Promise.reject(error);\n }\n };\n\n /** POST /users/pin/add — agrega un pin de recurso. */\n addPin = async (pin: string): Promise<UserPinAddResponse> => {\n try {\n const response = await this.props.axiosApi.post<UserPinAddResponse>(\n '/users/pin/add',\n {\n authentication: this.authentication,\n pines: { pin: [pin] },\n },\n );\n return response.data;\n } catch (error: any) {\n console.error('[/users/pin/add]', error);\n return Promise.reject(error);\n }\n };\n\n /** POST /users/pin/delete — elimina uno o más pins por ID. */\n deletePins = async (ids: number[]): Promise<CmsResponse> => {\n try {\n const pin: UserPinDeleteInput[] = ids.map((id) => ({ id }));\n const response = await this.props.axiosApi.post<CmsResponse>(\n '/users/pin/delete',\n {\n authentication: this.authentication,\n pines: { pin },\n },\n );\n return response.data;\n } catch (error: any) {\n console.error('[/users/pin/delete]', error);\n return Promise.reject(error);\n }\n };\n\n /** POST /users/action/setStatus — activa o desactiva un usuario. */\n setUserStatus = async (\n username: string,\n action: UserStatusAction,\n ): Promise<CmsResponse> => {\n try {\n const response = await this.props.axiosApi.post<CmsResponse>(\n '/users/action/setStatus',\n {\n authentication: this.authentication,\n username,\n action,\n },\n );\n return response.data;\n } catch (error: any) {\n console.error('[/users/action/setStatus]', error);\n return Promise.reject(error);\n }\n };\n\n /** POST /users/action/resetPass — restablece la contraseña de un usuario. */\n resetPassword = async (username: string): Promise<CmsResponse> => {\n try {\n const response = await this.props.axiosApi.post<CmsResponse>(\n '/users/action/resetPass',\n {\n authentication: this.authentication,\n username,\n },\n );\n return response.data;\n } catch (error: any) {\n console.error('[/users/action/resetPass]', error);\n return Promise.reject(error);\n }\n };\n\n /** POST /users/action/resetMfa — resetea la configuración MFA de un usuario. */\n resetMfa = async (username: string, reason: string): Promise<CmsResponse> => {\n try {\n const response = await this.props.axiosApi.post<CmsResponse>(\n '/users/action/resetMfa',\n {\n authentication: this.authentication,\n username,\n reason,\n },\n );\n return response.data;\n } catch (error: any) {\n console.error('[/users/action/resetMfa]', error);\n return Promise.reject(error);\n }\n };\n}\n","import type { AxiosInstance } from 'axios';\n\nimport type { Authentication } from '../types/authentication';\nimport type {\n CountNotificationsResponse,\n NotificationsListResponse,\n} from '../types/notification';\nimport type { ProfileGetResponse } from '../types/profile';\nimport type { SiteSection } from '../types/site';\nimport type { Publication, PublicationsGetResponse } from './publication';\nimport type {\n ModulesAvailableResponse,\n SitesAndPublicationsResult,\n SitesGetResponse,\n} from './site';\n\nexport type {\n Publication,\n PublicationPermissions,\n PublicationsGetResponse,\n PublicationUpdateAdmin,\n PublicationZoneConfig,\n} from './publication';\n\nexport type {\n ModulesAvailableResponse,\n Site,\n SitesAndPublicationsResult,\n SitesGetResponse,\n} from './site';\n\nexport { CmsUsersServices } from './users';\nexport type {\n CmsResponse,\n CmsUser,\n PublicationScope,\n UserGroup,\n UserGroupsResponse,\n UserPin,\n UserPinAddResponse,\n UserPinDeleteInput,\n UserPinsGetResponse,\n UserStatus,\n UserStatusAction,\n UsersAdvanceFilter,\n UsersFieldsFormat,\n UsersGetFilters,\n UsersGetResponse,\n UsersPublicationFieldsFormat,\n UsersPublicationFilters,\n UsersPublicationResponse,\n} from './users';\n\ninterface ICommonServices {\n axiosApi: AxiosInstance;\n authentication: Authentication;\n}\n\nexport class CmsCommonServices {\n protected props: ICommonServices;\n protected authentication: Authentication;\n\n constructor(props: ICommonServices) {\n this.props = props;\n this.authentication = props.authentication;\n }\n\n getDefaultPublication = async () => {\n try {\n const response = await this.props.axiosApi.post<Publication>(\n '/publications/default',\n {\n authentication: this.authentication,\n },\n );\n return response.data;\n } catch (error: any) {\n console.log(`[/publications/default] Error: ${error.message}`);\n return Promise.reject(error);\n }\n };\n\n getProfile = async (): Promise<ProfileGetResponse> => {\n try {\n const response = await this.props.axiosApi.post<ProfileGetResponse>(\n '/profile/get',\n {\n authentication: this.authentication,\n },\n );\n return response.data;\n } catch (error: any) {\n console.error('[/profile/get]', error);\n return Promise.reject(error);\n }\n };\n\n getCountNotifications = async (): Promise<CountNotificationsResponse> => {\n try {\n const response =\n await this.props.axiosApi.post<CountNotificationsResponse>(\n '/dashboard/countNotifications',\n {\n authentication: this.authentication,\n },\n );\n return response.data;\n } catch (error: any) {\n console.error('[/dashboard/countNotificatio]', error);\n return Promise.reject(error);\n }\n };\n\n getNotifications = async (): Promise<NotificationsListResponse> => {\n try {\n const response =\n await this.props.axiosApi.post<NotificationsListResponse>(\n '/dashboard/notification',\n {\n authentication: this.authentication,\n },\n );\n return response.data;\n } catch (error: any) {\n console.error('[/dashboard/notification]', error);\n return Promise.reject(error);\n }\n };\n\n getSitesAndPublications = async (): Promise<SitesAndPublicationsResult> => {\n try {\n const [resSites, resPublications, resModules, permissions] =\n await Promise.all([\n this.props.axiosApi.post<SitesGetResponse>('/sites/get', {\n authentication: this.authentication,\n }),\n this.props.axiosApi.post<PublicationsGetResponse>(\n '/publications/get',\n {\n authentication: this.authentication,\n },\n ),\n this.props.axiosApi.post<ModulesAvailableResponse>(\n '/auth/modulesAvailable',\n {\n authentication: this.authentication,\n },\n ),\n this.props.axiosApi.post<ModulesAvailableResponse>(\n '/auth/permissions',\n {\n authentication: this.authentication,\n },\n ),\n ]);\n\n const sites: SiteSection[] = resSites.data.sites.map((site) => ({\n title: site.title,\n publications: resPublications.data.publications.filter(\n (publication) => publication.site === site.name,\n ),\n }));\n\n console.log(permissions, 'permissions');\n\n return {\n sites: sites.filter((site) => site.publications.length > 0),\n modules: resModules.data.modules,\n };\n } catch (error) {\n console.error(error);\n return {\n sites: [],\n modules: [],\n };\n }\n };\n}\n"],"mappings":";AAGA,IAAa,IAAU,WACV,IAAgB,WAChB,IAAkB,WAElB,IAAkB;AAE/B,SAAgB,EAAmB,GAAqC;CACtE,OAAO,EAAM,SAAS,MAAY,EAAQ,YAAY;AACxD;AAEA,SAAgB,EACd,GACA,GACyB;CACzB,OAAO,EAAmB,CAAK,EAAE,MAAM,MAAM,OAAO,EAAE,EAAE,MAAM,CAAI;AACpE;AAEA,SAAgB,EACd,GACA,GACQ;CAIR,OAHoB,EAAmB,CAAK,EAAE,MAC3C,MAAM,OAAO,EAAE,EAAE,MAAM,CAEnB,GAAa,eAAe;AACrC;AAEA,SAAgB,EAA0B,GAA8B;CACtE,IAAM,IAAQ,EAAmB,CAAK,EAAE;CACxC,OAAO,IAAQ,OAAO,EAAM,EAAE,IAAI;AACpC;AAEA,SAAgB,EAAqB,GAAsB;CACzD,IAAM,IAAK,OAAO,CAAI;CACtB,OAAO,OAAO,SAAS,CAAE,KAAK,IAAK,IAAI,IAAK;AAC9C;;;AC2GA,IAAa,IAAb,MAA8B;CAC5B;CACA;CAEA,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ACF,EAAE;GAIF,OAFA,QAAQ,IAAI,GAAa,aAAa,GAE/B;IACL,OAAO,EAAM,QAAQ,MAAS,EAAK,aAAa,SAAS,CAAC;IAC1D,SAAS,EAAW,KAAK;GAC3B;EACF,SAAS,GAAO;GAEd,OADA,QAAQ,MAAM,CAAK,GACZ;IACL,OAAO,CAAC;IACR,SAAS,CAAC;GACZ;EACF;CACF;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sass-cms-template-common",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "Componentes y utilidades compartidas para CMS Bluestack",
5
5
  "type": "module",
6
6
  "engines": {
@@ -34,7 +34,7 @@
34
34
  "build:watch": "vite build --watch",
35
35
  "lint": "eslint .",
36
36
  "preview": "vite preview",
37
- "prepack": "npm run build"
37
+ "prepublishOnly": "npm run build"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@emotion/react": "^11.0.0",
@@ -1,82 +0,0 @@
1
- //#region src/lib/utils/site-selector.ts
2
- var e = "#ECEDF6", t = "#D8E2FF", n = "#FFFFFF", r = "bluestack-es";
3
- function i(e) {
4
- return e.flatMap((e) => e.publications);
5
- }
6
- function a(e, t) {
7
- return i(e).find((e) => String(e.id) === t);
8
- }
9
- function o(e, t) {
10
- return i(e).find((e) => String(e.id) === t)?.description ?? "Seleccionar publicación";
11
- }
12
- function s(e) {
13
- let t = i(e)[0];
14
- return t ? String(t.id) : "1";
15
- }
16
- function c(e) {
17
- let t = Number(e);
18
- return Number.isFinite(t) && t > 0 ? t : 1;
19
- }
20
- //#endregion
21
- //#region src/lib/services/index.ts
22
- var l = class {
23
- props;
24
- authentication;
25
- constructor(e) {
26
- this.props = e, this.authentication = e.authentication;
27
- }
28
- getDefaultPublication = async () => {
29
- try {
30
- return (await this.props.axiosApi.post("/publications/default", { authentication: this.authentication })).data;
31
- } catch (e) {
32
- return console.log(`[/publications/default] Error: ${e.message}`), Promise.reject(e);
33
- }
34
- };
35
- getProfile = async () => {
36
- try {
37
- return (await this.props.axiosApi.post("/profile/get", { authentication: this.authentication })).data;
38
- } catch (e) {
39
- return console.error("[/profile/get]", e), Promise.reject(e);
40
- }
41
- };
42
- getCountNotifications = async () => {
43
- try {
44
- return (await this.props.axiosApi.post("/dashboard/countNotifications", { authentication: this.authentication })).data;
45
- } catch (e) {
46
- return console.error("[/dashboard/countNotificatio]", e), Promise.reject(e);
47
- }
48
- };
49
- getNotifications = async () => {
50
- try {
51
- return (await this.props.axiosApi.post("/dashboard/notification", { authentication: this.authentication })).data;
52
- } catch (e) {
53
- return console.error("[/dashboard/notification]", e), Promise.reject(e);
54
- }
55
- };
56
- getSitesAndPublications = async () => {
57
- try {
58
- let [e, t, n, r] = await Promise.all([
59
- this.props.axiosApi.post("/sites/get", { authentication: this.authentication }),
60
- this.props.axiosApi.post("/publications/get", { authentication: this.authentication }),
61
- this.props.axiosApi.post("/auth/modulesAvailable", { authentication: this.authentication }),
62
- this.props.axiosApi.post("/auth/permissions", { authentication: this.authentication })
63
- ]), i = e.data.sites.map((e) => ({
64
- title: e.title,
65
- publications: t.data.publications.filter((t) => t.site === e.name)
66
- }));
67
- return console.log(r, "permissions"), {
68
- sites: i.filter((e) => e.publications.length > 0),
69
- modules: n.data.modules
70
- };
71
- } catch (e) {
72
- return console.error(e), {
73
- sites: [],
74
- modules: []
75
- };
76
- }
77
- };
78
- };
79
- //#endregion
80
- export { e as a, i as c, t as i, s as l, r as n, a as o, n as r, o as s, l as t, c as u };
81
-
82
- //# sourceMappingURL=services-DlTJ4HIV.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"services-DlTJ4HIV.js","names":[],"sources":["../src/lib/utils/site-selector.ts","../src/lib/services/index.ts"],"sourcesContent":["import type { Publication } from '../types/publication';\nimport type { SiteSection } from '../types/site';\n\nexport const MENU_BG = '#ECEDF6';\nexport const ITEM_HOVER_BG = '#D8E2FF';\nexport const ITEM_DEFAULT_BG = '#FFFFFF';\n\nexport const DEFAULT_SITE_ID = 'bluestack-es';\n\nexport function getAllPublications(sites: SiteSection[]): Publication[] {\n return sites.flatMap((section) => section.publications);\n}\n\nexport function findPublicationBySlug(\n sites: SiteSection[],\n slug: string,\n): Publication | undefined {\n return getAllPublications(sites).find((p) => String(p.id) === slug);\n}\n\nexport function findPublicationLabel(\n sites: SiteSection[],\n publicationId: string,\n): string {\n const publication = getAllPublications(sites).find(\n (p) => String(p.id) === publicationId,\n );\n return publication?.description ?? 'Seleccionar publicación';\n}\n\nexport function getDefaultPublicationSlug(sites: SiteSection[]): string {\n const first = getAllPublications(sites)[0];\n return first ? String(first.id) : '1';\n}\n\nexport function parsePublicationSlug(slug: string): number {\n const id = Number(slug);\n return Number.isFinite(id) && id > 0 ? id : 1;\n}\n","import type { AxiosInstance } from 'axios';\n\nimport type { Authentication } from '../types/authentication';\nimport type {\n CountNotificationsResponse,\n NotificationsListResponse,\n} from '../types/notification';\nimport type { ProfileGetResponse } from '../types/profile';\nimport type { SiteSection } from '../types/site';\nimport type { Publication, PublicationsGetResponse } from './publication';\nimport type {\n ModulesAvailableResponse,\n SitesAndPublicationsResult,\n SitesGetResponse,\n} from './site';\n\nexport type {\n Publication,\n PublicationPermissions,\n PublicationsGetResponse,\n PublicationUpdateAdmin,\n PublicationZoneConfig,\n} from './publication';\n\nexport type {\n ModulesAvailableResponse,\n Site,\n SitesAndPublicationsResult,\n SitesGetResponse,\n} from './site';\n\ninterface ICommonServices {\n axiosApi: AxiosInstance;\n authentication: Authentication;\n}\n\nexport class CmsCommonServices {\n protected props: ICommonServices;\n protected authentication: Authentication;\n\n constructor(props: ICommonServices) {\n this.props = props;\n this.authentication = props.authentication;\n }\n\n getDefaultPublication = async () => {\n try {\n const response = await this.props.axiosApi.post<Publication>(\n '/publications/default',\n {\n authentication: this.authentication,\n },\n );\n return response.data;\n } catch (error: any) {\n console.log(`[/publications/default] Error: ${error.message}`);\n return Promise.reject(error);\n }\n };\n\n getProfile = async (): Promise<ProfileGetResponse> => {\n try {\n const response = await this.props.axiosApi.post<ProfileGetResponse>(\n '/profile/get',\n {\n authentication: this.authentication,\n },\n );\n return response.data;\n } catch (error: any) {\n console.error('[/profile/get]', error);\n return Promise.reject(error);\n }\n };\n\n getCountNotifications = async (): Promise<CountNotificationsResponse> => {\n try {\n const response =\n await this.props.axiosApi.post<CountNotificationsResponse>(\n '/dashboard/countNotifications',\n {\n authentication: this.authentication,\n },\n );\n return response.data;\n } catch (error: any) {\n console.error('[/dashboard/countNotificatio]', error);\n return Promise.reject(error);\n }\n };\n\n getNotifications = async (): Promise<NotificationsListResponse> => {\n try {\n const response =\n await this.props.axiosApi.post<NotificationsListResponse>(\n '/dashboard/notification',\n {\n authentication: this.authentication,\n },\n );\n return response.data;\n } catch (error: any) {\n console.error('[/dashboard/notification]', error);\n return Promise.reject(error);\n }\n };\n\n getSitesAndPublications = async (): Promise<SitesAndPublicationsResult> => {\n try {\n const [resSites, resPublications, resModules, permissions] =\n await Promise.all([\n this.props.axiosApi.post<SitesGetResponse>('/sites/get', {\n authentication: this.authentication,\n }),\n this.props.axiosApi.post<PublicationsGetResponse>(\n '/publications/get',\n {\n authentication: this.authentication,\n },\n ),\n this.props.axiosApi.post<ModulesAvailableResponse>(\n '/auth/modulesAvailable',\n {\n authentication: this.authentication,\n },\n ),\n this.props.axiosApi.post<ModulesAvailableResponse>(\n '/auth/permissions',\n {\n authentication: this.authentication,\n },\n ),\n ]);\n\n const sites: SiteSection[] = resSites.data.sites.map((site) => ({\n title: site.title,\n publications: resPublications.data.publications.filter(\n (publication) => publication.site === site.name,\n ),\n }));\n\n console.log(permissions, 'permissions');\n\n return {\n sites: sites.filter((site) => site.publications.length > 0),\n modules: resModules.data.modules,\n };\n } catch (error) {\n console.error(error);\n return {\n sites: [],\n modules: [],\n };\n }\n };\n}\n"],"mappings":";AAGA,IAAa,IAAU,WACV,IAAgB,WAChB,IAAkB,WAElB,IAAkB;AAE/B,SAAgB,EAAmB,GAAqC;CACtE,OAAO,EAAM,SAA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