valtech-components 2.0.995 → 2.0.996
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/esm2022/lib/components/organisms/api-keys-modal/api-keys-modal.component.mjs +385 -0
- package/esm2022/lib/components/organisms/api-keys-modal/api-keys-modal.i18n.mjs +63 -0
- package/esm2022/lib/components/organisms/organization-view/organization-view.component.mjs +24 -1
- package/esm2022/lib/components/organisms/organization-view/organization-view.i18n.mjs +3 -1
- package/esm2022/lib/services/apikeys/api-keys.service.mjs +46 -0
- package/esm2022/lib/services/apikeys/types.mjs +7 -0
- package/esm2022/lib/version.mjs +2 -2
- package/esm2022/public-api.mjs +3 -1
- package/fesm2022/valtech-components.mjs +548 -46
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/organisms/api-keys-modal/api-keys-modal.component.d.ts +44 -0
- package/lib/components/organisms/api-keys-modal/api-keys-modal.i18n.d.ts +6 -0
- package/lib/components/organisms/organization-view/organization-view.component.d.ts +2 -0
- package/lib/services/apikeys/api-keys.service.d.ts +25 -0
- package/lib/services/apikeys/types.d.ts +46 -0
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +4 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { ClientApiKey, ClientApiKeyWithSecret } from '../../../services/apikeys/types';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* `val-api-keys-modal` — gestión de Client API Keys org-scopeadas (ADR-023 fase 6).
|
|
6
|
+
*
|
|
7
|
+
* Lista las keys de la org, permite crear (mostrando el secreto UNA vez con copia)
|
|
8
|
+
* y revocar. Pensado para habilitar integraciones M2M del import de miembros, pero
|
|
9
|
+
* sirve a cualquier permiso del catálogo. Header canónico (Regla #5).
|
|
10
|
+
*/
|
|
11
|
+
export declare class ApiKeysModalComponent implements OnInit {
|
|
12
|
+
private i18n;
|
|
13
|
+
private apiKeys;
|
|
14
|
+
/** Inyectado por `ModalService.open`. */
|
|
15
|
+
_modalRef?: {
|
|
16
|
+
dismiss: (data?: unknown, role?: string) => void;
|
|
17
|
+
};
|
|
18
|
+
/** Namespace i18n. */
|
|
19
|
+
i18nNamespace: string;
|
|
20
|
+
readonly keys: import("@angular/core").WritableSignal<ClientApiKey[]>;
|
|
21
|
+
readonly availablePermissions: import("@angular/core").WritableSignal<string[]>;
|
|
22
|
+
readonly loading: import("@angular/core").WritableSignal<boolean>;
|
|
23
|
+
readonly showCreate: import("@angular/core").WritableSignal<boolean>;
|
|
24
|
+
readonly submitting: import("@angular/core").WritableSignal<boolean>;
|
|
25
|
+
readonly errorMsg: import("@angular/core").WritableSignal<string>;
|
|
26
|
+
readonly secret: import("@angular/core").WritableSignal<ClientApiKeyWithSecret>;
|
|
27
|
+
readonly copied: import("@angular/core").WritableSignal<boolean>;
|
|
28
|
+
name: string;
|
|
29
|
+
expiresInDays: number | null;
|
|
30
|
+
readonly selectedPerms: import("@angular/core").WritableSignal<Set<string>>;
|
|
31
|
+
constructor();
|
|
32
|
+
ngOnInit(): void;
|
|
33
|
+
private refresh;
|
|
34
|
+
openCreate(): void;
|
|
35
|
+
togglePerm(perm: string, ev: Event): void;
|
|
36
|
+
submit(): void;
|
|
37
|
+
revoke(key: ClientApiKey): void;
|
|
38
|
+
copy(secret: string): Promise<void>;
|
|
39
|
+
finishSecret(): void;
|
|
40
|
+
dismiss(): void;
|
|
41
|
+
t(key: string): string;
|
|
42
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ApiKeysModalComponent, never>;
|
|
43
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ApiKeysModalComponent, "val-api-keys-modal", never, { "_modalRef": { "alias": "_modalRef"; "required": false; }; "i18nNamespace": { "alias": "i18nNamespace"; "required": false; }; }, {}, never, never, true, never>;
|
|
44
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LanguagesContent } from '../../../services/i18n/types';
|
|
2
|
+
/**
|
|
3
|
+
* Defaults i18n (es/en) embebidos en `val-api-keys-modal` (ADR-023).
|
|
4
|
+
* Auto-registrados si el consumer no proveyó el namespace `Settings.ApiKeysModal`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const API_KEYS_MODAL_I18N: LanguagesContent;
|
|
@@ -83,6 +83,7 @@ export declare class OrganizationViewComponent {
|
|
|
83
83
|
readonly transferButtonProps: import("@angular/core").Signal<Partial<ButtonMetadata>>;
|
|
84
84
|
readonly openInviteButtonProps: import("@angular/core").Signal<Partial<ButtonMetadata>>;
|
|
85
85
|
readonly openImportButtonProps: import("@angular/core").Signal<Partial<ButtonMetadata>>;
|
|
86
|
+
readonly openApiKeysButtonProps: import("@angular/core").Signal<Partial<ButtonMetadata>>;
|
|
86
87
|
/** Guarda para detectar el primer disparo del effect (evita doble carga). */
|
|
87
88
|
private lastLoadedOrgId;
|
|
88
89
|
constructor();
|
|
@@ -90,6 +91,7 @@ export declare class OrganizationViewComponent {
|
|
|
90
91
|
onLeave(): Promise<void>;
|
|
91
92
|
onOpenInvite(): void;
|
|
92
93
|
onOpenImport(): void;
|
|
94
|
+
onOpenApiKeys(): void;
|
|
93
95
|
onViewPermissions(): void;
|
|
94
96
|
onOpenTransfer(): void;
|
|
95
97
|
onTransfer(newOwnerId: string): Promise<void>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { ValtechAuthConfig } from '../auth/types';
|
|
4
|
+
import { ClientApiKey, CreateApiKeyRequest, CreateApiKeyResponse, RevokeApiKeyResponse } from './types';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* Cliente HTTP de Client API Keys org-scopeadas (ADR-023). La org activa se
|
|
8
|
+
* resuelve en backend desde el JWT, así que el path no la incluye.
|
|
9
|
+
*/
|
|
10
|
+
export declare class ApiKeyService {
|
|
11
|
+
private config;
|
|
12
|
+
private http;
|
|
13
|
+
constructor(config: ValtechAuthConfig, http: HttpClient);
|
|
14
|
+
private get baseUrl();
|
|
15
|
+
/** Lista las API keys de la org activa. */
|
|
16
|
+
list(): Observable<ClientApiKey[]>;
|
|
17
|
+
/** Crea una API key. La respuesta incluye el secreto (se muestra UNA vez). */
|
|
18
|
+
create(req: CreateApiKeyRequest): Observable<CreateApiKeyResponse>;
|
|
19
|
+
/** Revoca (elimina) una API key por id. */
|
|
20
|
+
revoke(keyId: string): Observable<RevokeApiKeyResponse>;
|
|
21
|
+
/** Catálogo de permisos asignables a una key. */
|
|
22
|
+
availablePermissions(): Observable<string[]>;
|
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ApiKeyService, never>;
|
|
24
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ApiKeyService>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tipos de Client API Keys org-scopeadas (ADR-023). Contrato espejo de
|
|
3
|
+
* `lambdas/org` `/org/api-keys/*`. El orgID se resuelve del JWT (ActiveOrgID),
|
|
4
|
+
* no va en el path.
|
|
5
|
+
*/
|
|
6
|
+
export interface ClientApiKey {
|
|
7
|
+
keyId: string;
|
|
8
|
+
name: string;
|
|
9
|
+
organizationId: string;
|
|
10
|
+
status: string;
|
|
11
|
+
permissions: string[];
|
|
12
|
+
rateLimit?: number;
|
|
13
|
+
expiresAt?: string;
|
|
14
|
+
allowedIps?: string[];
|
|
15
|
+
createdBy: string;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
lastUsedAt?: string;
|
|
18
|
+
}
|
|
19
|
+
/** Solo en la respuesta de creación: el secreto se muestra UNA vez. */
|
|
20
|
+
export interface ClientApiKeyWithSecret extends ClientApiKey {
|
|
21
|
+
secret: string;
|
|
22
|
+
}
|
|
23
|
+
export interface CreateApiKeyRequest {
|
|
24
|
+
name: string;
|
|
25
|
+
permissions: string[];
|
|
26
|
+
rateLimit?: number;
|
|
27
|
+
expiresInDays?: number;
|
|
28
|
+
allowedIps?: string[];
|
|
29
|
+
}
|
|
30
|
+
export interface CreateApiKeyResponse {
|
|
31
|
+
operationId: string;
|
|
32
|
+
key: ClientApiKeyWithSecret;
|
|
33
|
+
}
|
|
34
|
+
export interface ListApiKeysResponse {
|
|
35
|
+
operationId: string;
|
|
36
|
+
keys: ClientApiKey[];
|
|
37
|
+
nextToken?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface AvailablePermissionsResponse {
|
|
40
|
+
operationId: string;
|
|
41
|
+
permissions: string[];
|
|
42
|
+
}
|
|
43
|
+
export interface RevokeApiKeyResponse {
|
|
44
|
+
operationId: string;
|
|
45
|
+
message: string;
|
|
46
|
+
}
|
package/lib/version.d.ts
CHANGED
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -295,6 +295,7 @@ export * from './lib/components/organisms/invite-member-modal/invite-member-moda
|
|
|
295
295
|
export * from './lib/components/organisms/member-detail-modal/member-detail-modal.component';
|
|
296
296
|
export * from './lib/components/organisms/member-detail-modal/types';
|
|
297
297
|
export * from './lib/components/organisms/member-import-modal/member-import-modal.component';
|
|
298
|
+
export * from './lib/components/organisms/api-keys-modal/api-keys-modal.component';
|
|
298
299
|
export * from './lib/components/organisms/edit-org-modal/edit-org-modal.component';
|
|
299
300
|
export * from './lib/components/organisms/transfer-ownership-modal/transfer-ownership-modal.component';
|
|
300
301
|
export * from './lib/components/organisms/transfer-ownership-modal/types';
|
|
@@ -341,7 +342,9 @@ export * from './lib/services/legal-link/legal-link.service';
|
|
|
341
342
|
export * from './lib/services/firebase';
|
|
342
343
|
export * from './lib/services/auth';
|
|
343
344
|
export { OrgService } from './lib/services/org/org.service';
|
|
344
|
-
export type { Organization, OrgType, OrgPlan, CreateOrgRequest, UpdateOrgRequest, InviteUserRequest, InviteUserResponse, LeaveOrgResponse, ListMyOrgsResponse, OrgResponse, OrgMember, ListOrgMembersResponse, PendingInvitation, ListPendingInvitationsResponse, AcceptInvitationResponse, OrgRole, ListOrgRolesResponse, ChangeMemberRoleRequest, ChangeMemberRoleResponse, } from './lib/services/org/types';
|
|
345
|
+
export type { Organization, OrgType, OrgPlan, CreateOrgRequest, UpdateOrgRequest, InviteUserRequest, InviteUserResponse, LeaveOrgResponse, ListMyOrgsResponse, OrgResponse, OrgMember, ListOrgMembersResponse, PendingInvitation, ListPendingInvitationsResponse, AcceptInvitationResponse, OrgRole, ListOrgRolesResponse, ChangeMemberRoleRequest, ChangeMemberRoleResponse, ImportUserRow, ImportOnConflict, ImportMembersRequest, ImportRowStatus, ImportRowResult, ImportSummary, ImportMembersResponse, } from './lib/services/org/types';
|
|
346
|
+
export { ApiKeyService } from './lib/services/apikeys/api-keys.service';
|
|
347
|
+
export type { ClientApiKey, ClientApiKeyWithSecret, CreateApiKeyRequest, CreateApiKeyResponse, ListApiKeysResponse, AvailablePermissionsResponse, RevokeApiKeyResponse, } from './lib/services/apikeys/types';
|
|
345
348
|
export * from './lib/services/i18n';
|
|
346
349
|
export * from './lib/services/preferences';
|
|
347
350
|
export * from './lib/services/network-status';
|