sass-cms-template-common 0.0.3 → 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/index.d.ts +175 -7
- package/dist/index.js +448 -486
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +175 -0
- package/dist/server.js +2 -2
- package/dist/services-CK6pkce_.js +178 -0
- package/dist/services-CK6pkce_.js.map +1 -0
- package/package.json +2 -2
- package/dist/services-D9XCHGgK.js +0 -61
- package/dist/services-D9XCHGgK.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ import { Theme } from '@mui/material/styles';
|
|
|
14
14
|
*/
|
|
15
15
|
export declare const ACCOUNT_NAV_BLOCKS: NavBlock[];
|
|
16
16
|
|
|
17
|
-
export declare function AppShell({ pathname, sites, children, notificationUnreadCount, notifications, profile, primaryLogo, brandLogo, selectedPublicationId, getPublicationHref, resolvePublicationImageUrl, profileAvatarOptions, LinkComponent, permissions, locale, language, messages, }: AppShellProps): JSX.Element;
|
|
17
|
+
export declare function AppShell({ pathname, sites, children, notificationUnreadCount, notifications, profile, primaryLogo, brandLogo, selectedPublicationId, getPublicationHref, resolvePublicationImageUrl, profileAvatarOptions, LinkComponent, permissions, locale, language, messages, baseUrl, }: AppShellProps): JSX.Element;
|
|
18
18
|
|
|
19
19
|
export declare type AppShellProps = {
|
|
20
20
|
pathname: string;
|
|
@@ -25,7 +25,7 @@ export declare type AppShellProps = {
|
|
|
25
25
|
profile: ProfileGetResponse;
|
|
26
26
|
primaryLogo: ReactNode;
|
|
27
27
|
brandLogo?: ReactNode;
|
|
28
|
-
selectedPublicationId
|
|
28
|
+
selectedPublicationId: string;
|
|
29
29
|
getPublicationHref: (publication: Publication) => string;
|
|
30
30
|
resolvePublicationImageUrl?: (imagePath: string) => string;
|
|
31
31
|
profileAvatarOptions?: ProfileAvatarOptions;
|
|
@@ -35,6 +35,7 @@ export declare type AppShellProps = {
|
|
|
35
35
|
/** Alias de `locale`. */
|
|
36
36
|
language?: Locale | string;
|
|
37
37
|
messages?: CmsMessagesOverride;
|
|
38
|
+
baseUrl: string;
|
|
38
39
|
};
|
|
39
40
|
|
|
40
41
|
/** Credenciales de sesión CMS usadas por los servicios HTTP. */
|
|
@@ -90,6 +91,13 @@ export declare type CmsMuiProviderProps = {
|
|
|
90
91
|
children: ReactNode;
|
|
91
92
|
};
|
|
92
93
|
|
|
94
|
+
/** Envelope común de respuesta de los webservices de OpenCms. */
|
|
95
|
+
export declare interface CmsResponse {
|
|
96
|
+
status: 'ok' | 'fail' | 'error';
|
|
97
|
+
errorCode?: string;
|
|
98
|
+
error?: string;
|
|
99
|
+
}
|
|
100
|
+
|
|
93
101
|
export declare type CmsTranslator = {
|
|
94
102
|
messages: CmsMessages;
|
|
95
103
|
navigation: (module: NavigationModule | string) => string;
|
|
@@ -101,6 +109,47 @@ export declare type CmsTranslator = {
|
|
|
101
109
|
}) => string;
|
|
102
110
|
};
|
|
103
111
|
|
|
112
|
+
/** Usuario del CMS. Los campos presentes dependen del formato `fields`. */
|
|
113
|
+
export declare interface CmsUser {
|
|
114
|
+
username?: string;
|
|
115
|
+
firstname?: string;
|
|
116
|
+
lastname?: string;
|
|
117
|
+
fullName?: string;
|
|
118
|
+
email?: string;
|
|
119
|
+
datecreated?: string;
|
|
120
|
+
status?: string;
|
|
121
|
+
[key: string]: unknown;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Servicios HTTP del módulo `users` del CMS.
|
|
126
|
+
*
|
|
127
|
+
* Se construye igual que `CmsCommonServices`, con `{ axiosApi, authentication }`.
|
|
128
|
+
*/
|
|
129
|
+
export declare class CmsUsersServices {
|
|
130
|
+
protected props: IUsersServices;
|
|
131
|
+
protected authentication: Authentication;
|
|
132
|
+
constructor(props: IUsersServices);
|
|
133
|
+
/** POST /users/get — lista paginada de usuarios con filtros. */
|
|
134
|
+
getUsers: (filters?: UsersGetFilters) => Promise<UsersGetResponse>;
|
|
135
|
+
/** POST /users/publication — usuarios asociados a la publicación. */
|
|
136
|
+
getPublicationUsers: (filters?: UsersPublicationFilters) => Promise<UsersPublicationResponse>;
|
|
137
|
+
/** POST /users/groups/get — grupos disponibles del sistema. */
|
|
138
|
+
getGroups: (ou?: string) => Promise<UserGroupsResponse>;
|
|
139
|
+
/** POST /users/pin/get — pins del usuario autenticado. */
|
|
140
|
+
getPins: () => Promise<UserPinsGetResponse>;
|
|
141
|
+
/** POST /users/pin/add — agrega un pin de recurso. */
|
|
142
|
+
addPin: (pin: string) => Promise<UserPinAddResponse>;
|
|
143
|
+
/** POST /users/pin/delete — elimina uno o más pins por ID. */
|
|
144
|
+
deletePins: (ids: number[]) => Promise<CmsResponse>;
|
|
145
|
+
/** POST /users/action/setStatus — activa o desactiva un usuario. */
|
|
146
|
+
setUserStatus: (username: string, action: UserStatusAction) => Promise<CmsResponse>;
|
|
147
|
+
/** POST /users/action/resetPass — restablece la contraseña de un usuario. */
|
|
148
|
+
resetPassword: (username: string) => Promise<CmsResponse>;
|
|
149
|
+
/** POST /users/action/resetMfa — resetea la configuración MFA de un usuario. */
|
|
150
|
+
resetMfa: (username: string, reason: string) => Promise<CmsResponse>;
|
|
151
|
+
}
|
|
152
|
+
|
|
104
153
|
/** POST /dashboard/countNotificatio */
|
|
105
154
|
export declare interface CountNotificationsResponse {
|
|
106
155
|
status: string;
|
|
@@ -153,7 +202,7 @@ export declare const enMessages: {
|
|
|
153
202
|
readonly ANALYTICS: "Analytics";
|
|
154
203
|
readonly TAGS: "Tags";
|
|
155
204
|
readonly TRIVIAS: "Trivia";
|
|
156
|
-
readonly
|
|
205
|
+
readonly OTHERS: "Other";
|
|
157
206
|
readonly NEWSWIRES: "News Wires";
|
|
158
207
|
readonly EVENTS: "Events";
|
|
159
208
|
readonly PAGES: "Pages";
|
|
@@ -221,7 +270,7 @@ export declare const esMessages: {
|
|
|
221
270
|
ANALYTICS: string;
|
|
222
271
|
TAGS: string;
|
|
223
272
|
TRIVIAS: string;
|
|
224
|
-
|
|
273
|
+
OTHERS: string;
|
|
225
274
|
NEWSWIRES: string;
|
|
226
275
|
EVENTS: string;
|
|
227
276
|
PAGES: string;
|
|
@@ -299,6 +348,11 @@ export declare const ITEM_DEFAULT_BG = "#FFFFFF";
|
|
|
299
348
|
|
|
300
349
|
export declare const ITEM_HOVER_BG = "#D8E2FF";
|
|
301
350
|
|
|
351
|
+
declare interface IUsersServices {
|
|
352
|
+
axiosApi: AxiosInstance;
|
|
353
|
+
authentication: Authentication;
|
|
354
|
+
}
|
|
355
|
+
|
|
302
356
|
export declare const LIB_VERSION: "0.0.0";
|
|
303
357
|
|
|
304
358
|
export declare type Locale = (typeof SUPPORTED_LOCALES)[number];
|
|
@@ -424,7 +478,7 @@ export declare const ptMessages: {
|
|
|
424
478
|
ANALYTICS: string;
|
|
425
479
|
TAGS: string;
|
|
426
480
|
TRIVIAS: string;
|
|
427
|
-
|
|
481
|
+
OTHERS: string;
|
|
428
482
|
NEWSWIRES: string;
|
|
429
483
|
EVENTS: string;
|
|
430
484
|
PAGES: string;
|
|
@@ -520,6 +574,12 @@ export declare interface PublicationPermissions {
|
|
|
520
574
|
[key: string]: boolean;
|
|
521
575
|
}
|
|
522
576
|
|
|
577
|
+
/**
|
|
578
|
+
* Ámbito de publicación: `"pub"` (solo publicación), `"admin"` (solo admins
|
|
579
|
+
* globales) o cualquier otro valor (ambos).
|
|
580
|
+
*/
|
|
581
|
+
export declare type PublicationScope = 'pub' | 'admin' | (string & {});
|
|
582
|
+
|
|
523
583
|
/** Cuerpo de la respuesta de POST /publications/get */
|
|
524
584
|
export declare interface PublicationsGetResponse {
|
|
525
585
|
status: string;
|
|
@@ -549,15 +609,17 @@ export declare function resolveCmsAssetUrl(path: string, cmsOrigin?: string): st
|
|
|
549
609
|
|
|
550
610
|
export declare function resolveCmsOrigin(cmsOrigin?: string): string;
|
|
551
611
|
|
|
552
|
-
export declare function Sidebar({ open, pathname, permissions, LinkComponent, }: SidebarProps): JSX.Element;
|
|
612
|
+
export declare function Sidebar({ open, pathname, permissions, LinkComponent, baseUrl, selectedPublicationId, }: SidebarProps): JSX.Element;
|
|
553
613
|
|
|
554
614
|
export declare type SidebarMessageKey = keyof CmsMessages['sidebar'];
|
|
555
615
|
|
|
556
616
|
export declare type SidebarProps = {
|
|
557
|
-
open
|
|
617
|
+
open?: boolean;
|
|
558
618
|
pathname: string;
|
|
559
619
|
LinkComponent?: CmsLinkComponent;
|
|
560
620
|
permissions: Array<NavItemPermissions>;
|
|
621
|
+
baseUrl: string;
|
|
622
|
+
selectedPublicationId: string;
|
|
561
623
|
};
|
|
562
624
|
|
|
563
625
|
/** Entrada de sitio devuelta por POST /sites/get */
|
|
@@ -631,4 +693,110 @@ export declare type UseCmsTranslationOptions = {
|
|
|
631
693
|
catalog?: LocaleCatalog;
|
|
632
694
|
};
|
|
633
695
|
|
|
696
|
+
/** Grupo del sistema devuelto por POST /users/groups/get. */
|
|
697
|
+
export declare interface UserGroup {
|
|
698
|
+
id: string;
|
|
699
|
+
name: string;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
/** Cuerpo de la respuesta de POST /users/groups/get. */
|
|
703
|
+
export declare interface UserGroupsResponse extends CmsResponse {
|
|
704
|
+
groups: UserGroup[];
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
/** Pin (recurso fijado) de un usuario. */
|
|
708
|
+
export declare interface UserPin {
|
|
709
|
+
id: number;
|
|
710
|
+
[key: string]: unknown;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
/** Cuerpo de la respuesta de POST /users/pin/add. */
|
|
714
|
+
export declare interface UserPinAddResponse extends CmsResponse {
|
|
715
|
+
/** ID del pin creado. */
|
|
716
|
+
id?: number;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
/** Pin a eliminar en POST /users/pin/delete. */
|
|
720
|
+
export declare interface UserPinDeleteInput {
|
|
721
|
+
id: number;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
/** Cuerpo de la respuesta de POST /users/pin/get. */
|
|
725
|
+
export declare interface UserPinsGetResponse extends CmsResponse {
|
|
726
|
+
pins: UserPin[];
|
|
727
|
+
total?: number;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
/** Filtro sobre campos adicionales del usuario (`filters.advance`). */
|
|
731
|
+
export declare interface UsersAdvanceFilter {
|
|
732
|
+
name: string;
|
|
733
|
+
value: string;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
/** Formato de respuesta soportado por POST /users/get. */
|
|
737
|
+
export declare type UsersFieldsFormat = 'all' | 'FullName' | 'detail' | '';
|
|
738
|
+
|
|
739
|
+
/** Filtros de POST /users/get. */
|
|
740
|
+
export declare interface UsersGetFilters {
|
|
741
|
+
/** Cantidad de resultados por página (default: 100). */
|
|
742
|
+
size?: number;
|
|
743
|
+
/** Número de página (default: 1). */
|
|
744
|
+
page?: number;
|
|
745
|
+
/** Fuerza búsqueda global (default: false). */
|
|
746
|
+
searchGlobal?: boolean;
|
|
747
|
+
/**
|
|
748
|
+
* Campo + dirección. Campos válidos: `username`, `firstname`, `lastname`,
|
|
749
|
+
* `email`, `datecreated`. Ej: `"datecreated desc"`.
|
|
750
|
+
*/
|
|
751
|
+
order?: string;
|
|
752
|
+
/** Nombre del grupo para filtrar usuarios. */
|
|
753
|
+
grupo?: string;
|
|
754
|
+
/** Organizational Unit (default: "/"). */
|
|
755
|
+
ou?: string;
|
|
756
|
+
/** Estado del usuario. */
|
|
757
|
+
status?: UserStatus;
|
|
758
|
+
/** Timestamp en milisegundos (inicio del rango de fecha de creación). */
|
|
759
|
+
fromDate?: string;
|
|
760
|
+
/** Timestamp en milisegundos (fin del rango de fecha de creación). */
|
|
761
|
+
toDate?: string;
|
|
762
|
+
/** Filtra por ámbito de publicación. */
|
|
763
|
+
publicationScope?: PublicationScope;
|
|
764
|
+
/** Formato de respuesta. */
|
|
765
|
+
fields?: UsersFieldsFormat;
|
|
766
|
+
/** Búsqueda libre por email, username, apellido o nombre (LIKE). */
|
|
767
|
+
text?: string;
|
|
768
|
+
/** Filtros sobre campos adicionales del usuario. */
|
|
769
|
+
advance?: UsersAdvanceFilter[];
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
/** Cuerpo de la respuesta de POST /users/get. */
|
|
773
|
+
export declare interface UsersGetResponse extends CmsResponse {
|
|
774
|
+
users: CmsUser[];
|
|
775
|
+
total?: number;
|
|
776
|
+
page?: number;
|
|
777
|
+
size?: number;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
/** Formato de respuesta soportado por POST /users/publication. */
|
|
781
|
+
export declare type UsersPublicationFieldsFormat = 'all' | 'summary' | 'FullName' | '';
|
|
782
|
+
|
|
783
|
+
/** Filtros de POST /users/publication. */
|
|
784
|
+
export declare interface UsersPublicationFilters {
|
|
785
|
+
/** Texto libre para búsqueda de usuario. */
|
|
786
|
+
text?: string;
|
|
787
|
+
/** Formato de respuesta. */
|
|
788
|
+
fields?: UsersPublicationFieldsFormat;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
/** Cuerpo de la respuesta de POST /users/publication. */
|
|
792
|
+
export declare interface UsersPublicationResponse extends CmsResponse {
|
|
793
|
+
users: CmsUser[];
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
/** Estado posible de un usuario del sistema. */
|
|
797
|
+
export declare type UserStatus = 'active' | 'block' | 'pending';
|
|
798
|
+
|
|
799
|
+
/** Acción soportada por POST /users/action/setStatus. */
|
|
800
|
+
export declare type UserStatusAction = 'activate' | 'deactivate';
|
|
801
|
+
|
|
634
802
|
export { }
|