@trismegisto/spine 3.3.0 → 3.3.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 +19 -11
- package/fesm2022/trismegisto-spine-audit.mjs +16 -12
- package/fesm2022/trismegisto-spine-audit.mjs.map +1 -1
- package/fesm2022/{trismegisto-spine-auto-service-auto-service-audit.component-tfGcVR3i.mjs → trismegisto-spine-auto-service-auto-service-audit.component-D8HUpZtA.mjs} +4 -4
- package/fesm2022/{trismegisto-spine-auto-service-auto-service-audit.component-tfGcVR3i.mjs.map → trismegisto-spine-auto-service-auto-service-audit.component-D8HUpZtA.mjs.map} +1 -1
- package/fesm2022/trismegisto-spine-auto-service-auto-service-client-picker.component-NawbfdLW.mjs +65 -0
- package/fesm2022/trismegisto-spine-auto-service-auto-service-client-picker.component-NawbfdLW.mjs.map +1 -0
- package/fesm2022/{trismegisto-spine-auto-service-auto-service-client.component-IATeedbr.mjs → trismegisto-spine-auto-service-auto-service-client.component-BAfeLyTB.mjs} +27 -19
- package/fesm2022/trismegisto-spine-auto-service-auto-service-client.component-BAfeLyTB.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-auto-service-groups.component-BYjIQ9ID.mjs +635 -0
- package/fesm2022/trismegisto-spine-auto-service-auto-service-groups.component-BYjIQ9ID.mjs.map +1 -0
- package/fesm2022/{trismegisto-spine-auto-service-auto-service-login-attempts.component-CRvxfSWD.mjs → trismegisto-spine-auto-service-auto-service-login-attempts.component-DoyhkSYc.mjs} +4 -4
- package/fesm2022/{trismegisto-spine-auto-service-auto-service-login-attempts.component-CRvxfSWD.mjs.map → trismegisto-spine-auto-service-auto-service-login-attempts.component-DoyhkSYc.mjs.map} +1 -1
- package/fesm2022/trismegisto-spine-auto-service-auto-service-news-page.component-CBemH4hr.mjs +432 -0
- package/fesm2022/trismegisto-spine-auto-service-auto-service-news-page.component-CBemH4hr.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-auto-service-ratings-page.component-C_THGTkw.mjs +769 -0
- package/fesm2022/trismegisto-spine-auto-service-auto-service-ratings-page.component-C_THGTkw.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-auto-service-suggestions-page.component-DIeunpQ9.mjs +2123 -0
- package/fesm2022/trismegisto-spine-auto-service-auto-service-suggestions-page.component-DIeunpQ9.mjs.map +1 -0
- package/fesm2022/{trismegisto-spine-auto-service-auto-service.component-DGrs_Jvw.mjs → trismegisto-spine-auto-service-auto-service.component-QsIQ61w2.mjs} +31 -23
- package/fesm2022/trismegisto-spine-auto-service-auto-service.component-QsIQ61w2.mjs.map +1 -0
- package/fesm2022/{trismegisto-spine-auto-service-client.usage-C_2zBCRN.mjs → trismegisto-spine-auto-service-client.usage-CJxn9Ysz.mjs} +5 -3
- package/fesm2022/trismegisto-spine-auto-service-client.usage-CJxn9Ysz.mjs.map +1 -0
- package/fesm2022/{trismegisto-spine-auto-service-groups.technical-9aPPulhy.mjs → trismegisto-spine-auto-service-groups.technical-_jQrg1Qh.mjs} +7 -5
- package/fesm2022/trismegisto-spine-auto-service-groups.technical-_jQrg1Qh.mjs.map +1 -0
- package/fesm2022/{trismegisto-spine-auto-service-groups.usage-CYh61LFL.mjs → trismegisto-spine-auto-service-groups.usage-OvWjNeeT.mjs} +7 -6
- package/fesm2022/{trismegisto-spine-auto-service-groups.usage-CYh61LFL.mjs.map → trismegisto-spine-auto-service-groups.usage-OvWjNeeT.mjs.map} +1 -1
- package/fesm2022/trismegisto-spine-auto-service-home.component-rQ3dIGIE.mjs +315 -0
- package/fesm2022/trismegisto-spine-auto-service-home.component-rQ3dIGIE.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-home.technical-Ce7oYRdg.mjs +46 -0
- package/fesm2022/trismegisto-spine-auto-service-home.technical-Ce7oYRdg.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-home.usage-D9R_ZMuU.mjs +48 -0
- package/fesm2022/trismegisto-spine-auto-service-home.usage-D9R_ZMuU.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-news.technical-DV9UpobG.mjs +38 -0
- package/fesm2022/trismegisto-spine-auto-service-news.technical-DV9UpobG.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-news.usage-CeuZnG0V.mjs +48 -0
- package/fesm2022/trismegisto-spine-auto-service-news.usage-CeuZnG0V.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-ratings.technical-QIVj6HBU.mjs +52 -0
- package/fesm2022/trismegisto-spine-auto-service-ratings.technical-QIVj6HBU.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-ratings.usage-BkteY8lz.mjs +45 -0
- package/fesm2022/trismegisto-spine-auto-service-ratings.usage-BkteY8lz.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-suggestions.technical-BtUK6sKD.mjs +69 -0
- package/fesm2022/trismegisto-spine-auto-service-suggestions.technical-BtUK6sKD.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service-suggestions.usage-BwO9Hjsx.mjs +72 -0
- package/fesm2022/trismegisto-spine-auto-service-suggestions.usage-BwO9Hjsx.mjs.map +1 -0
- package/fesm2022/trismegisto-spine-auto-service.mjs +49 -19
- package/fesm2022/trismegisto-spine-auto-service.mjs.map +1 -1
- package/fesm2022/trismegisto-spine-graphql.mjs +11 -2
- package/fesm2022/trismegisto-spine-graphql.mjs.map +1 -1
- package/fesm2022/trismegisto-spine-layout.mjs +3160 -1279
- package/fesm2022/trismegisto-spine-layout.mjs.map +1 -1
- package/fesm2022/trismegisto-spine-modal.mjs +7 -5
- package/fesm2022/trismegisto-spine-modal.mjs.map +1 -1
- package/fesm2022/trismegisto-spine-routing.mjs +12 -20
- package/fesm2022/trismegisto-spine-routing.mjs.map +1 -1
- package/fesm2022/trismegisto-spine-shell.mjs +15 -39
- package/fesm2022/trismegisto-spine-shell.mjs.map +1 -1
- package/fesm2022/trismegisto-spine-side-panel.mjs +7 -5
- package/fesm2022/trismegisto-spine-side-panel.mjs.map +1 -1
- package/fesm2022/trismegisto-spine.mjs +1969 -279
- package/fesm2022/trismegisto-spine.mjs.map +1 -1
- package/package.json +6 -6
- package/types/trismegisto-spine-audit.d.ts +2 -12
- package/types/trismegisto-spine-audit.d.ts.map +1 -1
- package/types/trismegisto-spine-auto-service.d.ts +22 -5
- package/types/trismegisto-spine-auto-service.d.ts.map +1 -1
- package/types/trismegisto-spine-layout.d.ts +1086 -283
- package/types/trismegisto-spine-layout.d.ts.map +1 -1
- package/types/trismegisto-spine-modal.d.ts +1 -0
- package/types/trismegisto-spine-modal.d.ts.map +1 -1
- package/types/trismegisto-spine-routing.d.ts +3 -12
- package/types/trismegisto-spine-routing.d.ts.map +1 -1
- package/types/trismegisto-spine-shell.d.ts +2 -15
- package/types/trismegisto-spine-shell.d.ts.map +1 -1
- package/types/trismegisto-spine-side-panel.d.ts +1 -0
- package/types/trismegisto-spine-side-panel.d.ts.map +1 -1
- package/types/trismegisto-spine.d.ts +739 -165
- package/types/trismegisto-spine.d.ts.map +1 -1
- package/fesm2022/trismegisto-spine-auto-service-auto-service-client-picker.component-Cl7ahisu.mjs +0 -65
- package/fesm2022/trismegisto-spine-auto-service-auto-service-client-picker.component-Cl7ahisu.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-auto-service-client.component-IATeedbr.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-auto-service-groups.component-D6L0gTmd.mjs +0 -605
- package/fesm2022/trismegisto-spine-auto-service-auto-service-groups.component-D6L0gTmd.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-auto-service.component-DGrs_Jvw.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-client.usage-C_2zBCRN.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-groups.technical-9aPPulhy.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-home.component-5_aji1hf.mjs +0 -239
- package/fesm2022/trismegisto-spine-auto-service-home.component-5_aji1hf.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-home.technical-BrVhcgDO.mjs +0 -35
- package/fesm2022/trismegisto-spine-auto-service-home.technical-BrVhcgDO.mjs.map +0 -1
- package/fesm2022/trismegisto-spine-auto-service-home.usage-DWYGtngX.mjs +0 -43
- package/fesm2022/trismegisto-spine-auto-service-home.usage-DWYGtngX.mjs.map +0 -1
|
@@ -10,14 +10,15 @@ import * as i2 from '@orfeu/angular/core';
|
|
|
10
10
|
|
|
11
11
|
const AUTO_SERVICE_CONFIG = new InjectionToken('AUTO_SERVICE_CONFIG');
|
|
12
12
|
// router_id dos roteadores (páginas) do template "auto-service" (web.template_router,
|
|
13
|
-
// ver apps/argos/database/seed/04-
|
|
13
|
+
// ver apps/argos/database/argos/seed/web/04-template_router.sql) -- valores literais e
|
|
14
14
|
// estáveis (mesma convenção do resto do seed: UUID fixo, nunca gerado em runtime). É
|
|
15
15
|
// contra ISSO que o ComponentDistributorService casa via source_template_router_id
|
|
16
16
|
// (não o router_id materializado de cada client, que varia): qualquer client
|
|
17
17
|
// vinculado ao template "auto-service" resolve todos automaticamente, sem precisar
|
|
18
|
-
// declarar nada no próprio features.routes.ts.
|
|
19
|
-
// "Administração" do template
|
|
20
|
-
//
|
|
18
|
+
// declarar nada no próprio features.routes.ts. Grupos, Aplicações e Cliente ficam no grupo
|
|
19
|
+
// "Administração" do template e Ações e Tentativas de login no grupo "Auditoria"; Início,
|
|
20
|
+
// Novidades, Sugestões e Avaliações são páginas soltas na raiz. Os grupos nunca precisam de
|
|
21
|
+
// componente (nunca são page_id de router).
|
|
21
22
|
const AUTO_SERVICE_GROUPS_TEMPLATE_ROUTER_ID = 'ad100001-0000-4000-8000-000000000001';
|
|
22
23
|
const AUTO_SERVICE_APPS_TEMPLATE_ROUTER_ID = 'ad100002-0000-4000-8000-000000000001';
|
|
23
24
|
const AUTO_SERVICE_CLIENT_TEMPLATE_ROUTER_ID = 'ad100003-0000-4000-8000-000000000001';
|
|
@@ -26,25 +27,33 @@ const AUTO_SERVICE_CLIENT_TEMPLATE_ROUTER_ID = 'ad100003-0000-4000-8000-00000000
|
|
|
26
27
|
const AUTO_SERVICE_AUDIT_TEMPLATE_ROUTER_ID = 'ad100004-0000-4000-8000-000000000001';
|
|
27
28
|
// Tentativas de login (`auth.auth_attempts` com o client do app).
|
|
28
29
|
const AUTO_SERVICE_LOGIN_ATTEMPTS_TEMPLATE_ROUTER_ID = 'ad100005-0000-4000-8000-000000000001';
|
|
30
|
+
// Novidades, Sugestões e Avaliações (migration 0036 do argos): páginas na raiz, fora de "Administração" -- eram abas
|
|
31
|
+
// da tela Cliente. Cada uma é o seletor de client + o painel que ficava na aba.
|
|
32
|
+
const AUTO_SERVICE_NEWS_TEMPLATE_ROUTER_ID = 'ad100006-0000-4000-8000-000000000001';
|
|
33
|
+
const AUTO_SERVICE_SUGGESTIONS_TEMPLATE_ROUTER_ID = 'ad100007-0000-4000-8000-000000000001';
|
|
34
|
+
const AUTO_SERVICE_RATINGS_TEMPLATE_ROUTER_ID = 'ad100008-0000-4000-8000-000000000001';
|
|
29
35
|
// Início ("home", página de topo e pública do mesmo template). Todo client clonado do
|
|
30
36
|
// template ganha a própria linha em web.router com source_template_router_id apontando pra cá.
|
|
31
37
|
const AUTO_SERVICE_HOME_TEMPLATE_ROUTER_ID = '6a9a13db-f31b-494e-b51c-79af0ac28b60';
|
|
32
38
|
|
|
33
39
|
/**
|
|
34
|
-
* As
|
|
40
|
+
* As 9 telas do auto-serviço, carregadas sob demanda. Cada `import()` relativo vira um chunk próprio no
|
|
35
41
|
* FESM publicado (`trismegisto-spine-auto-service-<tela>-<hash>.mjs`), que o bundler do app mantém fora
|
|
36
42
|
* do carregamento inicial. Não exporte as telas no `public-api.ts` (ver o comentário lá).
|
|
37
43
|
*/
|
|
38
44
|
const AUTO_SERVICE_SCREENS = {
|
|
39
|
-
home: () => import('./trismegisto-spine-auto-service-home.component-
|
|
40
|
-
groups: () => import('./trismegisto-spine-auto-service-auto-service-groups.component-
|
|
41
|
-
apps: () => import('./trismegisto-spine-auto-service-auto-service.component-
|
|
42
|
-
client: () => import('./trismegisto-spine-auto-service-auto-service-client.component-
|
|
43
|
-
audit: () => import('./trismegisto-spine-auto-service-auto-service-audit.component-
|
|
44
|
-
loginAttempts: () => import('./trismegisto-spine-auto-service-auto-service-login-attempts.component-
|
|
45
|
+
home: () => import('./trismegisto-spine-auto-service-home.component-rQ3dIGIE.mjs').then(m => m.HomeComponent),
|
|
46
|
+
groups: () => import('./trismegisto-spine-auto-service-auto-service-groups.component-BYjIQ9ID.mjs').then(m => m.AutoServiceGroupsComponent),
|
|
47
|
+
apps: () => import('./trismegisto-spine-auto-service-auto-service.component-QsIQ61w2.mjs').then(m => m.AutoServiceComponent),
|
|
48
|
+
client: () => import('./trismegisto-spine-auto-service-auto-service-client.component-BAfeLyTB.mjs').then(m => m.AutoServiceClientComponent),
|
|
49
|
+
audit: () => import('./trismegisto-spine-auto-service-auto-service-audit.component-D8HUpZtA.mjs').then(m => m.AutoServiceAuditComponent),
|
|
50
|
+
loginAttempts: () => import('./trismegisto-spine-auto-service-auto-service-login-attempts.component-DoyhkSYc.mjs').then(m => m.AutoServiceLoginAttemptsComponent),
|
|
51
|
+
news: () => import('./trismegisto-spine-auto-service-auto-service-news-page.component-CBemH4hr.mjs').then(m => m.AutoServiceNewsPageComponent),
|
|
52
|
+
suggestions: () => import('./trismegisto-spine-auto-service-auto-service-suggestions-page.component-DIeunpQ9.mjs').then(m => m.AutoServiceSuggestionsPageComponent),
|
|
53
|
+
ratings: () => import('./trismegisto-spine-auto-service-auto-service-ratings-page.component-C_THGTkw.mjs').then(m => m.AutoServiceRatingsPageComponent),
|
|
45
54
|
};
|
|
46
55
|
/**
|
|
47
|
-
* Documentação das
|
|
56
|
+
* Documentação das 9 telas (botão de documentação da barra da página e índice "Documentação do sistema"): o manual
|
|
48
57
|
* de uso (`load`) e a especificação técnica (`loadTechnical`, só com `SpineConfig.technicalDocs`). O Markdown fica em
|
|
49
58
|
* módulos `.ts` próprios em `./docs/` (o ng-packagr não carrega `.md` como texto), cada um atrás de um `import()`
|
|
50
59
|
* relativo: vira um chunk à parte no FESM e só é baixado quando alguém abre o documento. Sem `title`/`group`: o
|
|
@@ -53,19 +62,19 @@ const AUTO_SERVICE_SCREENS = {
|
|
|
53
62
|
*/
|
|
54
63
|
const AUTO_SERVICE_DOCUMENTS = {
|
|
55
64
|
home: {
|
|
56
|
-
load: () => import('./trismegisto-spine-auto-service-home.usage-
|
|
57
|
-
loadTechnical: () => import('./trismegisto-spine-auto-service-home.technical-
|
|
65
|
+
load: () => import('./trismegisto-spine-auto-service-home.usage-D9R_ZMuU.mjs').then(m => m.default),
|
|
66
|
+
loadTechnical: () => import('./trismegisto-spine-auto-service-home.technical-Ce7oYRdg.mjs').then(m => m.default),
|
|
58
67
|
},
|
|
59
68
|
groups: {
|
|
60
|
-
load: () => import('./trismegisto-spine-auto-service-groups.usage-
|
|
61
|
-
loadTechnical: () => import('./trismegisto-spine-auto-service-groups.technical-
|
|
69
|
+
load: () => import('./trismegisto-spine-auto-service-groups.usage-OvWjNeeT.mjs').then(m => m.default),
|
|
70
|
+
loadTechnical: () => import('./trismegisto-spine-auto-service-groups.technical-_jQrg1Qh.mjs').then(m => m.default),
|
|
62
71
|
},
|
|
63
72
|
apps: {
|
|
64
73
|
load: () => import('./trismegisto-spine-auto-service-apps.usage-C0F_MlCo.mjs').then(m => m.default),
|
|
65
74
|
loadTechnical: () => import('./trismegisto-spine-auto-service-apps.technical-D3W2Vwic.mjs').then(m => m.default),
|
|
66
75
|
},
|
|
67
76
|
client: {
|
|
68
|
-
load: () => import('./trismegisto-spine-auto-service-client.usage-
|
|
77
|
+
load: () => import('./trismegisto-spine-auto-service-client.usage-CJxn9Ysz.mjs').then(m => m.default),
|
|
69
78
|
loadTechnical: () => import('./trismegisto-spine-auto-service-client.technical-DP5G8i3o.mjs').then(m => m.default),
|
|
70
79
|
},
|
|
71
80
|
audit: {
|
|
@@ -76,6 +85,18 @@ const AUTO_SERVICE_DOCUMENTS = {
|
|
|
76
85
|
load: () => import('./trismegisto-spine-auto-service-login-attempts.usage-BMgLNu7W.mjs').then(m => m.default),
|
|
77
86
|
loadTechnical: () => import('./trismegisto-spine-auto-service-login-attempts.technical-CasKIIws.mjs').then(m => m.default),
|
|
78
87
|
},
|
|
88
|
+
news: {
|
|
89
|
+
load: () => import('./trismegisto-spine-auto-service-news.usage-CeuZnG0V.mjs').then(m => m.default),
|
|
90
|
+
loadTechnical: () => import('./trismegisto-spine-auto-service-news.technical-DV9UpobG.mjs').then(m => m.default),
|
|
91
|
+
},
|
|
92
|
+
suggestions: {
|
|
93
|
+
load: () => import('./trismegisto-spine-auto-service-suggestions.usage-BwO9Hjsx.mjs').then(m => m.default),
|
|
94
|
+
loadTechnical: () => import('./trismegisto-spine-auto-service-suggestions.technical-BtUK6sKD.mjs').then(m => m.default),
|
|
95
|
+
},
|
|
96
|
+
ratings: {
|
|
97
|
+
load: () => import('./trismegisto-spine-auto-service-ratings.usage-BkteY8lz.mjs').then(m => m.default),
|
|
98
|
+
loadTechnical: () => import('./trismegisto-spine-auto-service-ratings.technical-QIVj6HBU.mjs').then(m => m.default),
|
|
99
|
+
},
|
|
79
100
|
};
|
|
80
101
|
// Cada app consumidora chama isso uma vez no bootstrap (mesmo padrão do
|
|
81
102
|
// provideAuth do @orfeu/angular) informando só a URL do argos-admin-server --
|
|
@@ -84,7 +105,8 @@ const AUTO_SERVICE_DOCUMENTS = {
|
|
|
84
105
|
// route_id -- esse varia por client, ver ComponentDistributorService). O app não
|
|
85
106
|
// precisa (e não deve) declarar nada em features.routes.ts pra isso funcionar; basta
|
|
86
107
|
// o client dele estar vinculado ao template "auto-service" (auth.clients.template_id).
|
|
87
|
-
//
|
|
108
|
+
// 9 páginas (Início, Novidades, Sugestões e Avaliações na raiz + Grupos/Aplicações/Cliente em Administração +
|
|
109
|
+
// Ações/Tentativas de login em Auditoria) -- o ComponentDistributorService
|
|
88
110
|
// já suporta N entradas, cada uma casando pelo seu próprio source_template_router_id.
|
|
89
111
|
function provideAutoService(config) {
|
|
90
112
|
const componentRoutes = [
|
|
@@ -94,6 +116,9 @@ function provideAutoService(config) {
|
|
|
94
116
|
{ source_template_router_id: AUTO_SERVICE_CLIENT_TEMPLATE_ROUTER_ID, load: AUTO_SERVICE_SCREENS.client, document: AUTO_SERVICE_DOCUMENTS.client },
|
|
95
117
|
{ source_template_router_id: AUTO_SERVICE_AUDIT_TEMPLATE_ROUTER_ID, load: AUTO_SERVICE_SCREENS.audit, document: AUTO_SERVICE_DOCUMENTS.audit },
|
|
96
118
|
{ source_template_router_id: AUTO_SERVICE_LOGIN_ATTEMPTS_TEMPLATE_ROUTER_ID, load: AUTO_SERVICE_SCREENS.loginAttempts, document: AUTO_SERVICE_DOCUMENTS.loginAttempts },
|
|
119
|
+
{ source_template_router_id: AUTO_SERVICE_NEWS_TEMPLATE_ROUTER_ID, load: AUTO_SERVICE_SCREENS.news, document: AUTO_SERVICE_DOCUMENTS.news },
|
|
120
|
+
{ source_template_router_id: AUTO_SERVICE_SUGGESTIONS_TEMPLATE_ROUTER_ID, load: AUTO_SERVICE_SCREENS.suggestions, document: AUTO_SERVICE_DOCUMENTS.suggestions },
|
|
121
|
+
{ source_template_router_id: AUTO_SERVICE_RATINGS_TEMPLATE_ROUTER_ID, load: AUTO_SERVICE_SCREENS.ratings, document: AUTO_SERVICE_DOCUMENTS.ratings },
|
|
97
122
|
];
|
|
98
123
|
return makeEnvironmentProviders([
|
|
99
124
|
{ provide: AUTO_SERVICE_CONFIG, useValue: config },
|
|
@@ -147,6 +172,11 @@ class AutoServiceService {
|
|
|
147
172
|
updateGroup(clientId, groupId, body) { return firstValueFrom(this.http.put(this.url `/${clientId}/groups/${groupId}`, body, { headers: this.headers })); }
|
|
148
173
|
deleteGroup(clientId, groupId) { return firstValueFrom(this.http.delete(this.url `/${clientId}/groups/${groupId}`, { headers: this.headers })); }
|
|
149
174
|
getGroupMembers(clientId, groupId) { return firstValueFrom(this.http.get(this.url `/${clientId}/groups/${groupId}/members`, { headers: this.headers })); }
|
|
175
|
+
/** Sugestões para adicionar ao grupo: quem já está em outro grupo deste sistema e ainda não neste, com foto e os grupos. */
|
|
176
|
+
getMemberSuggestions(clientId, groupId, limit = 8) {
|
|
177
|
+
const params = new HttpParams().set('limit', String(limit));
|
|
178
|
+
return firstValueFrom(this.http.get(this.url `/${clientId}/groups/${groupId}/member-suggestions`, { headers: this.headers, params }));
|
|
179
|
+
}
|
|
150
180
|
addGroupMember(clientId, groupId, userId, role) { return firstValueFrom(this.http.post(this.url `/${clientId}/groups/${groupId}/members`, { user_id: userId, role }, { headers: this.headers })); }
|
|
151
181
|
updateGroupMemberRole(clientId, groupId, userId, role) { return firstValueFrom(this.http.put(this.url `/${clientId}/groups/${groupId}/members/${userId}`, { role }, { headers: this.headers })); }
|
|
152
182
|
removeGroupMember(clientId, groupId, userId) { return firstValueFrom(this.http.delete(this.url `/${clientId}/groups/${groupId}/members/${userId}`, { headers: this.headers })); }
|
|
@@ -212,5 +242,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImpo
|
|
|
212
242
|
* Generated bundle index. Do not edit.
|
|
213
243
|
*/
|
|
214
244
|
|
|
215
|
-
export { AUTO_SERVICE_APPS_TEMPLATE_ROUTER_ID, AUTO_SERVICE_AUDIT_TEMPLATE_ROUTER_ID, AUTO_SERVICE_CLIENT_TEMPLATE_ROUTER_ID, AUTO_SERVICE_CONFIG, AUTO_SERVICE_DOCUMENTS, AUTO_SERVICE_GROUPS_TEMPLATE_ROUTER_ID, AUTO_SERVICE_HOME_TEMPLATE_ROUTER_ID, AUTO_SERVICE_LOGIN_ATTEMPTS_TEMPLATE_ROUTER_ID, AUTO_SERVICE_SCREENS, AutoServiceService, provideAutoService };
|
|
245
|
+
export { AUTO_SERVICE_APPS_TEMPLATE_ROUTER_ID, AUTO_SERVICE_AUDIT_TEMPLATE_ROUTER_ID, AUTO_SERVICE_CLIENT_TEMPLATE_ROUTER_ID, AUTO_SERVICE_CONFIG, AUTO_SERVICE_DOCUMENTS, AUTO_SERVICE_GROUPS_TEMPLATE_ROUTER_ID, AUTO_SERVICE_HOME_TEMPLATE_ROUTER_ID, AUTO_SERVICE_LOGIN_ATTEMPTS_TEMPLATE_ROUTER_ID, AUTO_SERVICE_NEWS_TEMPLATE_ROUTER_ID, AUTO_SERVICE_RATINGS_TEMPLATE_ROUTER_ID, AUTO_SERVICE_SCREENS, AUTO_SERVICE_SUGGESTIONS_TEMPLATE_ROUTER_ID, AutoServiceService, provideAutoService };
|
|
216
246
|
//# sourceMappingURL=trismegisto-spine-auto-service.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trismegisto-spine-auto-service.mjs","sources":["../../../projects/ui/auto-service/src/auto-service.tokens.ts","../../../projects/ui/auto-service/src/provide-auto-service.ts","../../../projects/ui/auto-service/src/auto-service.service.ts","../../../projects/ui/auto-service/src/public-api.ts","../../../projects/ui/auto-service/src/trismegisto-spine-auto-service.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport interface AutoServiceConfig {\n // Base URL do argos-admin-server (o mesmo backend central que atende\n // /admin/*) -- /auto-service/* já existe lá, escopado por client_id, servindo\n // qualquer aplicação que instale este pacote, não só o argos-admin.\n adminApi: string;\n}\n\nexport const AUTO_SERVICE_CONFIG = new InjectionToken<AutoServiceConfig>('AUTO_SERVICE_CONFIG');\n\n// router_id dos roteadores (páginas) do template \"auto-service\" (web.template_router,\n// ver apps/argos/database/seed/04-web.template_router.sql) -- valores literais e\n// estáveis (mesma convenção do resto do seed: UUID fixo, nunca gerado em runtime). É\n// contra ISSO que o ComponentDistributorService casa via source_template_router_id\n// (não o router_id materializado de cada client, que varia): qualquer client\n// vinculado ao template \"auto-service\" resolve todos automaticamente, sem precisar\n// declarar nada no próprio features.routes.ts. As páginas vivem dentro da navegação\n// \"Administração\" do template (Ações e Tentativas de login num menu \"Auditoria\" dentro\n// dela) -- navegação e menu nunca precisam de componente (nunca são page_id de router).\nexport const AUTO_SERVICE_GROUPS_TEMPLATE_ROUTER_ID = 'ad100001-0000-4000-8000-000000000001';\nexport const AUTO_SERVICE_APPS_TEMPLATE_ROUTER_ID = 'ad100002-0000-4000-8000-000000000001';\nexport const AUTO_SERVICE_CLIENT_TEMPLATE_ROUTER_ID = 'ad100003-0000-4000-8000-000000000001';\n// Menu \"Auditoria\" (rota AD000006, dentro de \"Administração\", migration 0012 do argos): duas páginas.\n// Ações (a leitura da auditoria, `audit.events`) -- o nome da constante ficou do tempo em que era a página \"Auditoria\".\nexport const AUTO_SERVICE_AUDIT_TEMPLATE_ROUTER_ID = 'ad100004-0000-4000-8000-000000000001';\n// Tentativas de login (`auth.auth_attempts` com o client do app).\nexport const AUTO_SERVICE_LOGIN_ATTEMPTS_TEMPLATE_ROUTER_ID = 'ad100005-0000-4000-8000-000000000001';\n// Início (\"home\", página de topo e pública do mesmo template). Todo client clonado do\n// template ganha a própria linha em web.router com source_template_router_id apontando pra cá.\nexport const AUTO_SERVICE_HOME_TEMPLATE_ROUTER_ID = '6a9a13db-f31b-494e-b51c-79af0ac28b60';\n","import { EnvironmentProviders, Type, makeEnvironmentProviders } from '@angular/core';\nimport { COMPONENT_ROUTES, ComponentRoute, RouteDocument } from '@trismegisto/spine/routing';\nimport { SPINE_ADMIN_API } from '@trismegisto/spine';\nimport {\n AUTO_SERVICE_CONFIG, AutoServiceConfig,\n AUTO_SERVICE_GROUPS_TEMPLATE_ROUTER_ID, AUTO_SERVICE_APPS_TEMPLATE_ROUTER_ID, AUTO_SERVICE_CLIENT_TEMPLATE_ROUTER_ID,\n AUTO_SERVICE_HOME_TEMPLATE_ROUTER_ID, AUTO_SERVICE_AUDIT_TEMPLATE_ROUTER_ID, AUTO_SERVICE_LOGIN_ATTEMPTS_TEMPLATE_ROUTER_ID,\n} from './auto-service.tokens';\n\n/**\n * As 6 telas do auto-serviço, carregadas sob demanda. Cada `import()` relativo vira um chunk próprio no\n * FESM publicado (`trismegisto-spine-auto-service-<tela>-<hash>.mjs`), que o bundler do app mantém fora\n * do carregamento inicial. Não exporte as telas no `public-api.ts` (ver o comentário lá).\n */\nexport const AUTO_SERVICE_SCREENS: Readonly<Record<'home' | 'groups' | 'apps' | 'client' | 'audit' | 'loginAttempts', () => Promise<Type<unknown>>>> = {\n home: () => import('./home/home.component').then(m => m.HomeComponent),\n groups: () => import('./groups/auto-service-groups.component').then(m => m.AutoServiceGroupsComponent),\n apps: () => import('./auto-service.component').then(m => m.AutoServiceComponent),\n client: () => import('./auto-service-client.component').then(m => m.AutoServiceClientComponent),\n audit: () => import('./audit/auto-service-audit.component').then(m => m.AutoServiceAuditComponent),\n loginAttempts: () => import('./audit/auto-service-login-attempts.component').then(m => m.AutoServiceLoginAttemptsComponent),\n};\n\n/**\n * Documentação das 6 telas (botão de documentação da barra da página e índice \"Documentação do sistema\"): o manual\n * de uso (`load`) e a especificação técnica (`loadTechnical`, só com `SpineConfig.technicalDocs`). O Markdown fica em\n * módulos `.ts` próprios em `./docs/` (o ng-packagr não carrega `.md` como texto), cada um atrás de um `import()`\n * relativo: vira um chunk à parte no FESM e só é baixado quando alguém abre o documento. Sem `title`/`group`: o\n * índice usa o nome da rota e o módulo da árvore do client. O `SpineDocsService` casa estas entradas pelo\n * `source_template_router_id`, como o `ComponentDistributorService` faz com as telas.\n */\nexport const AUTO_SERVICE_DOCUMENTS: Readonly<Record<keyof typeof AUTO_SERVICE_SCREENS, RouteDocument>> = {\n home: {\n load: () => import('./docs/home.usage').then(m => m.default),\n loadTechnical: () => import('./docs/home.technical').then(m => m.default),\n },\n groups: {\n load: () => import('./docs/groups.usage').then(m => m.default),\n loadTechnical: () => import('./docs/groups.technical').then(m => m.default),\n },\n apps: {\n load: () => import('./docs/apps.usage').then(m => m.default),\n loadTechnical: () => import('./docs/apps.technical').then(m => m.default),\n },\n client: {\n load: () => import('./docs/client.usage').then(m => m.default),\n loadTechnical: () => import('./docs/client.technical').then(m => m.default),\n },\n audit: {\n load: () => import('./docs/audit.usage').then(m => m.default),\n loadTechnical: () => import('./docs/audit.technical').then(m => m.default),\n },\n loginAttempts: {\n load: () => import('./docs/login-attempts.usage').then(m => m.default),\n loadTechnical: () => import('./docs/login-attempts.technical').then(m => m.default),\n },\n};\n\n// Cada app consumidora chama isso uma vez no bootstrap (mesmo padrão do\n// provideAuth do @orfeu/angular) informando só a URL do argos-admin-server --\n// o resto vem pronto: rotas/serviço (@trismegisto/spine/auto-service) E a própria\n// ligação com os itens de menu, registrada aqui via source_template_router_id (não\n// route_id -- esse varia por client, ver ComponentDistributorService). O app não\n// precisa (e não deve) declarar nada em features.routes.ts pra isso funcionar; basta\n// o client dele estar vinculado ao template \"auto-service\" (auth.clients.template_id).\n// 6 páginas (Início + Grupos/Aplicações/Cliente + Ações/Tentativas de login no menu Auditoria) -- o ComponentDistributorService\n// já suporta N entradas, cada uma casando pelo seu próprio source_template_router_id.\nexport function provideAutoService(config: AutoServiceConfig): EnvironmentProviders {\n const componentRoutes: ComponentRoute[] = [\n { source_template_router_id: AUTO_SERVICE_HOME_TEMPLATE_ROUTER_ID, load: AUTO_SERVICE_SCREENS.home, document: AUTO_SERVICE_DOCUMENTS.home },\n { source_template_router_id: AUTO_SERVICE_GROUPS_TEMPLATE_ROUTER_ID, load: AUTO_SERVICE_SCREENS.groups, document: AUTO_SERVICE_DOCUMENTS.groups },\n { source_template_router_id: AUTO_SERVICE_APPS_TEMPLATE_ROUTER_ID, load: AUTO_SERVICE_SCREENS.apps, document: AUTO_SERVICE_DOCUMENTS.apps },\n { source_template_router_id: AUTO_SERVICE_CLIENT_TEMPLATE_ROUTER_ID, load: AUTO_SERVICE_SCREENS.client, document: AUTO_SERVICE_DOCUMENTS.client },\n { source_template_router_id: AUTO_SERVICE_AUDIT_TEMPLATE_ROUTER_ID, load: AUTO_SERVICE_SCREENS.audit, document: AUTO_SERVICE_DOCUMENTS.audit },\n { source_template_router_id: AUTO_SERVICE_LOGIN_ATTEMPTS_TEMPLATE_ROUTER_ID, load: AUTO_SERVICE_SCREENS.loginAttempts, document: AUTO_SERVICE_DOCUMENTS.loginAttempts },\n ];\n\n return makeEnvironmentProviders([\n { provide: AUTO_SERVICE_CONFIG, useValue: config },\n // Mesma URL, exposta também para o painel de configurações (tokens de aplicação em /me).\n { provide: SPINE_ADMIN_API, useValue: config.adminApi },\n { provide: COMPONENT_ROUTES, useValue: componentRoutes, multi: true },\n ]);\n}\n","import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';\nimport { Inject, Injectable } from '@angular/core';\nimport { firstValueFrom } from 'rxjs';\nimport { AuthorizationService } from '@orfeu/angular/core';\nimport { urlPath } from '@trismegisto/primitives';\nimport { AUTO_SERVICE_CONFIG, AutoServiceConfig } from './auto-service.tokens';\n\n/** Nível de um nó na árvore do menu (`GET /routers/tree`). */\nexport type RouterOrderType = 'header' | 'navigation' | 'menu' | 'item' | 'submenu' | 'page';\n\n/** Nó da árvore do menu: uma rota num nível, com todos os routers que passam por ela. */\nexport interface RouterOrderNode {\n route_type: RouterOrderType;\n routed_id: string;\n route_name: string;\n route_display_name: string | null;\n route_icon: string | null;\n order: number;\n router_ids: string[];\n children: RouterOrderNode[];\n}\n\n/** Um item da ordem nova de um nível (`PATCH /routers/reorder`). */\nexport interface RouterOrderGroup { type: RouterOrderType; router_ids: string[] }\n\n/**\n * Grupo do projeto do client (`GET /groups`). O grupo de administração do projeto (`is_admin`) é gerido só no painel\n * central e o servidor não o devolve aqui; servidor antigo ainda devolve com `is_admin: true` e as telas descartam.\n */\nexport interface AutoServiceGroup {\n id: string;\n name: string;\n description: string | null;\n enabled: boolean;\n is_admin?: boolean;\n type: { id: string; name: string; level: number } | null;\n}\n\n/** Tipo de grupo (crachá) do realm (`GET /group-types`). */\nexport interface AutoServiceGroupType { id: string; name: string; level: number; assignable: boolean }\n\n/** Corpo de `POST /groups` (o projeto é sempre o do client). */\nexport interface AutoServiceGroupCreate { group_id?: string; name: string; type_id: string; description?: string }\n\n/** Corpo de `PUT /groups/:groupId`; do grupo de administração só `description`. `null` apaga a descrição. */\nexport interface AutoServiceGroupUpdate { name?: string; type_id?: string; description?: string | null; enabled?: boolean }\n\n/** Aplicação (client_credentials) do projeto do client (`GET /apps`). */\nexport interface AutoServiceApp {\n id: string;\n name: string;\n enabled: boolean;\n allowed_grants?: string[] | null;\n [key: string]: unknown;\n}\n\n/**\n * Token de API (`x-api-token`) de uma aplicação (`GET /apps/:appId/tokens`). O valor só vem na criação; aqui fica o\n * começo dele (`token_prefix`) para reconhecer. Cada token é também um consumer (`consumer_id`) com as permissões dele.\n */\nexport interface AutoServiceAppToken {\n id: string;\n consumer_id: string;\n name: string;\n description: string | null;\n token_prefix: string;\n expires_at: string;\n revoked_at: string | null;\n created_at: string;\n last_used_at: string | null;\n}\n\n/** Corpo de `POST /apps/:appId/tokens`: validade ISO (até 365 dias) e as operações protected liberadas ao token. */\nexport interface AutoServiceAppTokenCreate { name: string; description?: string; expires_at: string; operation_ids?: string[] }\n\n/** Resposta de `POST /apps/:appId/tokens`: `token` é o valor cru, devolvido uma única vez. */\nexport interface AutoServiceAppTokenCreated { id: string; consumer_id: string; name: string; token: string }\n\n@Injectable({ providedIn: 'root' })\nexport class AutoServiceService {\n\n private get baseUrl() {\n return `${this.config.adminApi}/auto-service`;\n }\n\n /** `baseUrl` + caminho com cada id interpolado codificado (`urlPath`): um id com `/`, `?`, `#` ou `..` não muda o recurso. */\n private url(strings: TemplateStringsArray, ...ids: readonly string[]): string {\n return this.baseUrl + urlPath(strings, ...ids);\n }\n\n private get headers(): HttpHeaders {\n const token = this.auth.getToken();\n return new HttpHeaders({ 'x-access-token': token ?? '' });\n }\n\n constructor(\n private http: HttpClient,\n private auth: AuthorizationService,\n @Inject(AUTO_SERVICE_CONFIG) private config: AutoServiceConfig,\n ) {}\n\n // Descoberta\n getMyClients() { return firstValueFrom(this.http.get<{ clients: any[] }>(this.baseUrl, { headers: this.headers })); }\n\n // Routes\n getWebRoutes(clientId: string) { return firstValueFrom(this.http.get<{ routes: any[] }>(this.url`/${clientId}/routes`, { headers: this.headers })); }\n createWebRoute(clientId: string, body: any) { return firstValueFrom(this.http.post<any>(this.url`/${clientId}/routes`, body, { headers: this.headers })); }\n updateWebRoute(clientId: string, id: string, body: any) { return firstValueFrom(this.http.put<any>(this.url`/${clientId}/routes/${id}`, body, { headers: this.headers })); }\n deleteWebRoute(clientId: string, id: string) { return firstValueFrom(this.http.delete<any>(this.url`/${clientId}/routes/${id}`, { headers: this.headers })); }\n\n // Routers\n getRouters(clientId: string) { return firstValueFrom(this.http.get<{ routers: any[] }>(this.url`/${clientId}/routers`, { headers: this.headers })); }\n createRouter(clientId: string, body: any) { return firstValueFrom(this.http.post<any>(this.url`/${clientId}/routers`, body, { headers: this.headers })); }\n updateRouter(clientId: string, id: string, body: any) { return firstValueFrom(this.http.put<any>(this.url`/${clientId}/routers/${id}`, body, { headers: this.headers })); }\n deleteRouter(clientId: string, id: string) { return firstValueFrom(this.http.delete<any>(this.url`/${clientId}/routers/${id}`, { headers: this.headers })); }\n /** Árvore do menu (header → … → página) com os router_ids de cada nó, já na ordem gravada. */\n getRouterTree(clientId: string) { return firstValueFrom(this.http.get<{ tree: RouterOrderNode[] }>(this.url`/${clientId}/routers/tree`, { headers: this.headers })); }\n /**\n * Grava a ordem de UM nível (irmãos): o índice do grupo é a ordem; cada grupo escreve `${type}_order`\n * em todos os seus routers. Vale também para routers de template (ordem é do client).\n */\n reorderRouters(clientId: string, groups: RouterOrderGroup[]) { return firstValueFrom(this.http.patch<any>(this.url`/${clientId}/routers/reorder`, { groups }, { headers: this.headers })); }\n\n // Groups (do projeto do client, sem o grupo de administração: editar/excluir/membros dele respondem 404)\n getGroups(clientId: string) { return firstValueFrom(this.http.get<{ groups: AutoServiceGroup[] }>(this.url`/${clientId}/groups`, { headers: this.headers })); }\n /** Tipos (crachás) do realm; `assignable: false` no Administrador, que é só do grupo de administração (painel central). */\n getGroupTypes(clientId: string) { return firstValueFrom(this.http.get<{ group_types: AutoServiceGroupType[] }>(this.url`/${clientId}/group-types`, { headers: this.headers })); }\n createGroup(clientId: string, body: AutoServiceGroupCreate) { return firstValueFrom(this.http.post<AutoServiceGroup>(this.url`/${clientId}/groups`, body, { headers: this.headers })); }\n updateGroup(clientId: string, groupId: string, body: AutoServiceGroupUpdate) { return firstValueFrom(this.http.put<AutoServiceGroup>(this.url`/${clientId}/groups/${groupId}`, body, { headers: this.headers })); }\n deleteGroup(clientId: string, groupId: string) { return firstValueFrom(this.http.delete<void>(this.url`/${clientId}/groups/${groupId}`, { headers: this.headers })); }\n getGroupMembers(clientId: string, groupId: string) { return firstValueFrom(this.http.get<{ members: any[] }>(this.url`/${clientId}/groups/${groupId}/members`, { headers: this.headers })); }\n addGroupMember(clientId: string, groupId: string, userId: string, role: string | null) { return firstValueFrom(this.http.post<any>(this.url`/${clientId}/groups/${groupId}/members`, { user_id: userId, role }, { headers: this.headers })); }\n updateGroupMemberRole(clientId: string, groupId: string, userId: string, role: string | null) { return firstValueFrom(this.http.put<any>(this.url`/${clientId}/groups/${groupId}/members/${userId}`, { role }, { headers: this.headers })); }\n removeGroupMember(clientId: string, groupId: string, userId: string) { return firstValueFrom(this.http.delete<any>(this.url`/${clientId}/groups/${groupId}/members/${userId}`, { headers: this.headers })); }\n\n // Users (só leitura -- popular a busca de \"adicionar membro\" na aba Grupos, escopada pelo realm do próprio client)\n searchUsers(clientId: string, opts: { search?: string; limit?: number } = {}) {\n let params = new HttpParams();\n if (opts.search) params = params.set('search', opts.search);\n if (opts.limit) params = params.set('limit', String(opts.limit));\n return firstValueFrom(this.http.get<{ users: any[] }>(this.url`/${clientId}/users`, { headers: this.headers, params }));\n }\n\n // Access\n getAccess(clientId: string) { return firstValueFrom(this.http.get<{ access: any[] }>(this.url`/${clientId}/access`, { headers: this.headers })); }\n createAccess(clientId: string, groupId: string) { return firstValueFrom(this.http.post<any>(this.url`/${clientId}/access`, { group_id: groupId }, { headers: this.headers })); }\n deleteAccess(clientId: string, accessId: string) { return firstValueFrom(this.http.delete<any>(this.url`/${clientId}/access/${accessId}`, { headers: this.headers })); }\n getGuards(clientId: string, accessId: string) { return firstValueFrom(this.http.get<{ guards: any[] }>(this.url`/${clientId}/access/${accessId}/guards`, { headers: this.headers })); }\n addGuard(clientId: string, accessId: string, routerId: string) { return firstValueFrom(this.http.post<any>(this.url`/${clientId}/access/${accessId}/guards`, { router_id: routerId }, { headers: this.headers })); }\n removeGuard(clientId: string, accessId: string, guardId: string) { return firstValueFrom(this.http.delete<any>(this.url`/${clientId}/access/${accessId}/guards/${guardId}`, { headers: this.headers })); }\n\n // Apps (aplicações client_credentials no Project deste client)\n getApps(clientId: string) { return firstValueFrom(this.http.get<{ apps: AutoServiceApp[] }>(this.url`/${clientId}/apps`, { headers: this.headers })); }\n createApp(clientId: string, body: { name: string; allowed_grants?: string[] }) { return firstValueFrom(this.http.post<{ id: string; name: string; secret: string }>(this.url`/${clientId}/apps`, body, { headers: this.headers })); }\n updateApp(clientId: string, appId: string, body: any) { return firstValueFrom(this.http.put<any>(this.url`/${clientId}/apps/${appId}`, body, { headers: this.headers })); }\n /** Gera um segredo novo para a aplicação (o anterior para de valer na hora). A resposta traz o segredo uma única vez. */\n rotateAppSecret(clientId: string, appId: string) { return firstValueFrom(this.http.post<{ id: string; secret: string }>(this.url`/${clientId}/apps/${appId}/secret`, {}, { headers: this.headers })); }\n deleteApp(clientId: string, appId: string) { return firstValueFrom(this.http.delete<any>(this.url`/${clientId}/apps/${appId}`, { headers: this.headers })); }\n getAppOperations(clientId: string, appId: string) { return firstValueFrom(this.http.get<{ operations: any[] }>(this.url`/${clientId}/apps/${appId}/operations`, { headers: this.headers })); }\n\n // Tokens de API da aplicação (x-api-token)\n getAppTokens(clientId: string, appId: string) { return firstValueFrom(this.http.get<{ tokens: AutoServiceAppToken[] }>(this.url`/${clientId}/apps/${appId}/tokens`, { headers: this.headers })); }\n /** Cria o token (e o consumer dele, com as permissões escolhidas). A resposta traz o valor uma única vez. */\n createAppToken(clientId: string, appId: string, body: AutoServiceAppTokenCreate) { return firstValueFrom(this.http.post<AutoServiceAppTokenCreated>(this.url`/${clientId}/apps/${appId}/tokens`, body, { headers: this.headers })); }\n /** Revoga: o token para de valer na hora e continua na lista como revogado. */\n revokeAppToken(clientId: string, appId: string, tokenId: string) { return firstValueFrom(this.http.delete<void>(this.url`/${clientId}/apps/${appId}/tokens/${tokenId}`, { headers: this.headers })); }\n\n // Consumers (grupo ↔ aplicação), sem o do grupo de administração: o servidor não o lista e o :consumerId dele é 404\n // (servidor antigo ainda devolve com `group_is_admin: true` e a aba Acessos descarta)\n getAppConsumers(clientId: string, appId: string) { return firstValueFrom(this.http.get<{ consumers: any[] }>(this.url`/${clientId}/apps/${appId}/consumers`, { headers: this.headers })); }\n createAppConsumer(clientId: string, appId: string, groupId: string) { return firstValueFrom(this.http.post<any>(this.url`/${clientId}/apps/${appId}/consumers`, { group_id: groupId }, { headers: this.headers })); }\n deleteAppConsumer(clientId: string, consumerId: string) { return firstValueFrom(this.http.delete<any>(this.url`/${clientId}/apps/consumers/${consumerId}`, { headers: this.headers })); }\n\n // Permissions (consumer ↔ operação)\n getAppPermissions(clientId: string, consumerId: string) { return firstValueFrom(this.http.get<{ permissions: any[] }>(this.url`/${clientId}/apps/consumers/${consumerId}/permissions`, { headers: this.headers })); }\n addAppPermission(clientId: string, consumerId: string, operationId: string) { return firstValueFrom(this.http.post<any>(this.url`/${clientId}/apps/consumers/${consumerId}/permissions`, { operation_id: operationId }, { headers: this.headers })); }\n removeAppPermission(clientId: string, consumerId: string, permissionId: string) { return firstValueFrom(this.http.delete<any>(this.url`/${clientId}/apps/consumers/${consumerId}/permissions/${permissionId}`, { headers: this.headers })); }\n // Auditoria: ver `SpineAuditService` (`@trismegisto/spine/audit`), o mesmo nos escopos admin e client.\n}\n","export * from './auto-service.tokens';\nexport * from './provide-auto-service';\nexport * from './auto-service.service';\nexport type { AutoServiceClient } from './client-picker/auto-service-client-picker.component';\n// A auditoria (tipos, serviço e a tela) mora em `@trismegisto/spine/audit` — NÃO reexporte daqui: um\n// `export` estático puxaria a tela para o arquivo deste ponto de entrada (ver abaixo e check-lazy).\n// As telas (Início, Grupos, Aplicações, Cliente) e as peças delas NÃO são exportadas daqui de propósito:\n// ficam só atrás dos `import()` de `AUTO_SERVICE_SCREENS`. Qualquer `export` estático de um componente\n// delas faz o rollup do ng-packagr juntar a tela no FESM do ponto de entrada e trocar o `import()` por\n// `Promise.resolve()` — e a tela (data-grid, combobox, drawer...) vai para o bundle inicial de todo app\n// (bug da 0.9.9). `scripts/check-lazy.mjs` (no `npm run build`) falha se isso voltar.\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;MASa,mBAAmB,GAAG,IAAI,cAAc,CAAoB,qBAAqB;AAE9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,sCAAsC,GAAG;AAC/C,MAAM,oCAAoC,GAAK;AAC/C,MAAM,sCAAsC,GAAG;AACtD;AACA;AACO,MAAM,qCAAqC,GAAI;AACtD;AACO,MAAM,8CAA8C,GAAG;AAC9D;AACA;AACO,MAAM,oCAAoC,GAAI;;ACrBrD;;;;AAIG;AACI,MAAM,oBAAoB,GAAsH;AACrJ,IAAA,IAAI,EAAE,MAAM,OAAO,8DAAuB,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,CAAC;AACtE,IAAA,MAAM,EAAE,MAAM,OAAO,6EAAwC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,0BAA0B,CAAC;AACtG,IAAA,IAAI,EAAE,MAAM,OAAO,sEAA0B,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,oBAAoB,CAAC;AAChF,IAAA,MAAM,EAAE,MAAM,OAAO,6EAAiC,CAAC,CAAC,IAAI,CAAC,CAA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AAG,CAAA,CAAA,CAAA,EAAI,QAAQ,CAAA,gBAAA,EAAmB,UAAU,cAAc,EAAE,EAAE,YAAY,EAAE,WAAW,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;AACrP,IAAA,mBAAmB,CAAC,QAAgB,EAAE,UAAkB,EAAE,YAAoB,EAAA,EAAI,OAAO,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAM,IAAI,CAAC,GAAG,CAAA,CAAA,CAAA,EAAI,QAAQ,CAAA,gBAAA,EAAmB,UAAU,gBAAgB,YAAY,CAAA,CAAE,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;AAjGjO,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,gFAmBnB,mBAAmB,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAnBlB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,cADL,MAAM,EAAA,CAAA,CAAA;;4FACnB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAD9B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;0BAoB7B,MAAM;2BAAC,mBAAmB;;;AC9F/B;AACA;AACA;AACA;AACA;AACA;AACA;;ACVA;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"trismegisto-spine-auto-service.mjs","sources":["../../../projects/ui/auto-service/src/auto-service.tokens.ts","../../../projects/ui/auto-service/src/provide-auto-service.ts","../../../projects/ui/auto-service/src/auto-service.service.ts","../../../projects/ui/auto-service/src/public-api.ts","../../../projects/ui/auto-service/src/trismegisto-spine-auto-service.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport interface AutoServiceConfig {\n // Base URL do argos-admin-server (o mesmo backend central que atende\n // /admin/*) -- /auto-service/* já existe lá, escopado por client_id, servindo\n // qualquer aplicação que instale este pacote, não só o argos-admin.\n adminApi: string;\n}\n\nexport const AUTO_SERVICE_CONFIG = new InjectionToken<AutoServiceConfig>('AUTO_SERVICE_CONFIG');\n\n// router_id dos roteadores (páginas) do template \"auto-service\" (web.template_router,\n// ver apps/argos/database/argos/seed/web/04-template_router.sql) -- valores literais e\n// estáveis (mesma convenção do resto do seed: UUID fixo, nunca gerado em runtime). É\n// contra ISSO que o ComponentDistributorService casa via source_template_router_id\n// (não o router_id materializado de cada client, que varia): qualquer client\n// vinculado ao template \"auto-service\" resolve todos automaticamente, sem precisar\n// declarar nada no próprio features.routes.ts. Grupos, Aplicações e Cliente ficam no grupo\n// \"Administração\" do template e Ações e Tentativas de login no grupo \"Auditoria\"; Início,\n// Novidades, Sugestões e Avaliações são páginas soltas na raiz. Os grupos nunca precisam de\n// componente (nunca são page_id de router).\nexport const AUTO_SERVICE_GROUPS_TEMPLATE_ROUTER_ID = 'ad100001-0000-4000-8000-000000000001';\nexport const AUTO_SERVICE_APPS_TEMPLATE_ROUTER_ID = 'ad100002-0000-4000-8000-000000000001';\nexport const AUTO_SERVICE_CLIENT_TEMPLATE_ROUTER_ID = 'ad100003-0000-4000-8000-000000000001';\n// Menu \"Auditoria\" (rota AD000006, dentro de \"Administração\", migration 0012 do argos): duas páginas.\n// Ações (a leitura da auditoria, `audit.events`) -- o nome da constante ficou do tempo em que era a página \"Auditoria\".\nexport const AUTO_SERVICE_AUDIT_TEMPLATE_ROUTER_ID = 'ad100004-0000-4000-8000-000000000001';\n// Tentativas de login (`auth.auth_attempts` com o client do app).\nexport const AUTO_SERVICE_LOGIN_ATTEMPTS_TEMPLATE_ROUTER_ID = 'ad100005-0000-4000-8000-000000000001';\n// Novidades, Sugestões e Avaliações (migration 0036 do argos): páginas na raiz, fora de \"Administração\" -- eram abas\n// da tela Cliente. Cada uma é o seletor de client + o painel que ficava na aba.\nexport const AUTO_SERVICE_NEWS_TEMPLATE_ROUTER_ID = 'ad100006-0000-4000-8000-000000000001';\nexport const AUTO_SERVICE_SUGGESTIONS_TEMPLATE_ROUTER_ID = 'ad100007-0000-4000-8000-000000000001';\nexport const AUTO_SERVICE_RATINGS_TEMPLATE_ROUTER_ID = 'ad100008-0000-4000-8000-000000000001';\n// Início (\"home\", página de topo e pública do mesmo template). Todo client clonado do\n// template ganha a própria linha em web.router com source_template_router_id apontando pra cá.\nexport const AUTO_SERVICE_HOME_TEMPLATE_ROUTER_ID = '6a9a13db-f31b-494e-b51c-79af0ac28b60';\n","import { EnvironmentProviders, Type, makeEnvironmentProviders } from '@angular/core';\nimport { COMPONENT_ROUTES, ComponentRoute, RouteDocument } from '@trismegisto/spine/routing';\nimport { SPINE_ADMIN_API } from '@trismegisto/spine';\nimport {\n AUTO_SERVICE_CONFIG, AutoServiceConfig,\n AUTO_SERVICE_GROUPS_TEMPLATE_ROUTER_ID, AUTO_SERVICE_APPS_TEMPLATE_ROUTER_ID, AUTO_SERVICE_CLIENT_TEMPLATE_ROUTER_ID,\n AUTO_SERVICE_HOME_TEMPLATE_ROUTER_ID, AUTO_SERVICE_AUDIT_TEMPLATE_ROUTER_ID, AUTO_SERVICE_LOGIN_ATTEMPTS_TEMPLATE_ROUTER_ID,\n AUTO_SERVICE_NEWS_TEMPLATE_ROUTER_ID, AUTO_SERVICE_SUGGESTIONS_TEMPLATE_ROUTER_ID, AUTO_SERVICE_RATINGS_TEMPLATE_ROUTER_ID,\n} from './auto-service.tokens';\n\n/**\n * As 9 telas do auto-serviço, carregadas sob demanda. Cada `import()` relativo vira um chunk próprio no\n * FESM publicado (`trismegisto-spine-auto-service-<tela>-<hash>.mjs`), que o bundler do app mantém fora\n * do carregamento inicial. Não exporte as telas no `public-api.ts` (ver o comentário lá).\n */\nexport const AUTO_SERVICE_SCREENS: Readonly<Record<\n 'home' | 'groups' | 'apps' | 'client' | 'audit' | 'loginAttempts' | 'news' | 'suggestions' | 'ratings',\n () => Promise<Type<unknown>>\n>> = {\n home: () => import('./home/home.component').then(m => m.HomeComponent),\n groups: () => import('./groups/auto-service-groups.component').then(m => m.AutoServiceGroupsComponent),\n apps: () => import('./auto-service.component').then(m => m.AutoServiceComponent),\n client: () => import('./auto-service-client.component').then(m => m.AutoServiceClientComponent),\n audit: () => import('./audit/auto-service-audit.component').then(m => m.AutoServiceAuditComponent),\n loginAttempts: () => import('./audit/auto-service-login-attempts.component').then(m => m.AutoServiceLoginAttemptsComponent),\n news: () => import('./pages/auto-service-news-page.component').then(m => m.AutoServiceNewsPageComponent),\n suggestions: () => import('./pages/auto-service-suggestions-page.component').then(m => m.AutoServiceSuggestionsPageComponent),\n ratings: () => import('./pages/auto-service-ratings-page.component').then(m => m.AutoServiceRatingsPageComponent),\n};\n\n/**\n * Documentação das 9 telas (botão de documentação da barra da página e índice \"Documentação do sistema\"): o manual\n * de uso (`load`) e a especificação técnica (`loadTechnical`, só com `SpineConfig.technicalDocs`). O Markdown fica em\n * módulos `.ts` próprios em `./docs/` (o ng-packagr não carrega `.md` como texto), cada um atrás de um `import()`\n * relativo: vira um chunk à parte no FESM e só é baixado quando alguém abre o documento. Sem `title`/`group`: o\n * índice usa o nome da rota e o módulo da árvore do client. O `SpineDocsService` casa estas entradas pelo\n * `source_template_router_id`, como o `ComponentDistributorService` faz com as telas.\n */\nexport const AUTO_SERVICE_DOCUMENTS: Readonly<Record<keyof typeof AUTO_SERVICE_SCREENS, RouteDocument>> = {\n home: {\n load: () => import('./docs/home.usage').then(m => m.default),\n loadTechnical: () => import('./docs/home.technical').then(m => m.default),\n },\n groups: {\n load: () => import('./docs/groups.usage').then(m => m.default),\n loadTechnical: () => import('./docs/groups.technical').then(m => m.default),\n },\n apps: {\n load: () => import('./docs/apps.usage').then(m => m.default),\n loadTechnical: () => import('./docs/apps.technical').then(m => m.default),\n },\n client: {\n load: () => import('./docs/client.usage').then(m => m.default),\n loadTechnical: () => import('./docs/client.technical').then(m => m.default),\n },\n audit: {\n load: () => import('./docs/audit.usage').then(m => m.default),\n loadTechnical: () => import('./docs/audit.technical').then(m => m.default),\n },\n loginAttempts: {\n load: () => import('./docs/login-attempts.usage').then(m => m.default),\n loadTechnical: () => import('./docs/login-attempts.technical').then(m => m.default),\n },\n news: {\n load: () => import('./docs/news.usage').then(m => m.default),\n loadTechnical: () => import('./docs/news.technical').then(m => m.default),\n },\n suggestions: {\n load: () => import('./docs/suggestions.usage').then(m => m.default),\n loadTechnical: () => import('./docs/suggestions.technical').then(m => m.default),\n },\n ratings: {\n load: () => import('./docs/ratings.usage').then(m => m.default),\n loadTechnical: () => import('./docs/ratings.technical').then(m => m.default),\n },\n};\n\n// Cada app consumidora chama isso uma vez no bootstrap (mesmo padrão do\n// provideAuth do @orfeu/angular) informando só a URL do argos-admin-server --\n// o resto vem pronto: rotas/serviço (@trismegisto/spine/auto-service) E a própria\n// ligação com os itens de menu, registrada aqui via source_template_router_id (não\n// route_id -- esse varia por client, ver ComponentDistributorService). O app não\n// precisa (e não deve) declarar nada em features.routes.ts pra isso funcionar; basta\n// o client dele estar vinculado ao template \"auto-service\" (auth.clients.template_id).\n// 9 páginas (Início, Novidades, Sugestões e Avaliações na raiz + Grupos/Aplicações/Cliente em Administração +\n// Ações/Tentativas de login em Auditoria) -- o ComponentDistributorService\n// já suporta N entradas, cada uma casando pelo seu próprio source_template_router_id.\nexport function provideAutoService(config: AutoServiceConfig): EnvironmentProviders {\n const componentRoutes: ComponentRoute[] = [\n { source_template_router_id: AUTO_SERVICE_HOME_TEMPLATE_ROUTER_ID, load: AUTO_SERVICE_SCREENS.home, document: AUTO_SERVICE_DOCUMENTS.home },\n { source_template_router_id: AUTO_SERVICE_GROUPS_TEMPLATE_ROUTER_ID, load: AUTO_SERVICE_SCREENS.groups, document: AUTO_SERVICE_DOCUMENTS.groups },\n { source_template_router_id: AUTO_SERVICE_APPS_TEMPLATE_ROUTER_ID, load: AUTO_SERVICE_SCREENS.apps, document: AUTO_SERVICE_DOCUMENTS.apps },\n { source_template_router_id: AUTO_SERVICE_CLIENT_TEMPLATE_ROUTER_ID, load: AUTO_SERVICE_SCREENS.client, document: AUTO_SERVICE_DOCUMENTS.client },\n { source_template_router_id: AUTO_SERVICE_AUDIT_TEMPLATE_ROUTER_ID, load: AUTO_SERVICE_SCREENS.audit, document: AUTO_SERVICE_DOCUMENTS.audit },\n { source_template_router_id: AUTO_SERVICE_LOGIN_ATTEMPTS_TEMPLATE_ROUTER_ID, load: AUTO_SERVICE_SCREENS.loginAttempts, document: AUTO_SERVICE_DOCUMENTS.loginAttempts },\n { source_template_router_id: AUTO_SERVICE_NEWS_TEMPLATE_ROUTER_ID, load: AUTO_SERVICE_SCREENS.news, document: AUTO_SERVICE_DOCUMENTS.news },\n { source_template_router_id: AUTO_SERVICE_SUGGESTIONS_TEMPLATE_ROUTER_ID, load: AUTO_SERVICE_SCREENS.suggestions, document: AUTO_SERVICE_DOCUMENTS.suggestions },\n { source_template_router_id: AUTO_SERVICE_RATINGS_TEMPLATE_ROUTER_ID, load: AUTO_SERVICE_SCREENS.ratings, document: AUTO_SERVICE_DOCUMENTS.ratings },\n ];\n\n return makeEnvironmentProviders([\n { provide: AUTO_SERVICE_CONFIG, useValue: config },\n // Mesma URL, exposta também para o painel de configurações (tokens de aplicação em /me).\n { provide: SPINE_ADMIN_API, useValue: config.adminApi },\n { provide: COMPONENT_ROUTES, useValue: componentRoutes, multi: true },\n ]);\n}\n","import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';\nimport { Inject, Injectable } from '@angular/core';\nimport { firstValueFrom } from 'rxjs';\nimport { AuthorizationService } from '@orfeu/angular/core';\nimport { urlPath } from '@trismegisto/primitives';\nimport { AUTO_SERVICE_CONFIG, AutoServiceConfig } from './auto-service.tokens';\n\n/** Nível de um nó na árvore do menu (`GET /routers/tree`). */\nexport type RouterOrderType = 'header' | 'navigation' | 'menu' | 'item' | 'submenu' | 'page';\n\n/** Nó da árvore do menu: uma rota num nível, com todos os routers que passam por ela. */\nexport interface RouterOrderNode {\n route_type: RouterOrderType;\n routed_id: string;\n route_name: string;\n route_display_name: string | null;\n route_icon: string | null;\n order: number;\n router_ids: string[];\n children: RouterOrderNode[];\n}\n\n/** Um item da ordem nova de um nível (`PATCH /routers/reorder`). */\nexport interface RouterOrderGroup { type: RouterOrderType; router_ids: string[] }\n\n/**\n * Grupo do projeto do client (`GET /groups`). O grupo de administração do projeto (`is_admin`) é gerido só no painel\n * central e o servidor não o devolve aqui; servidor antigo ainda devolve com `is_admin: true` e as telas descartam.\n */\nexport interface AutoServiceGroup {\n id: string;\n name: string;\n description: string | null;\n enabled: boolean;\n is_admin?: boolean;\n type: { id: string; name: string; level: number } | null;\n}\n\n/** Sugestão de membro (`GET /groups/:groupId/member-suggestions`): está em outros grupos do sistema (`groups`). */\nexport interface AutoServiceMemberSuggestion {\n id: string;\n username: string;\n email: string | null;\n name: string | null;\n picture: string | null;\n group_count: number;\n groups: string[];\n}\n\n/** Tipo de grupo (crachá) do realm (`GET /group-types`). */\nexport interface AutoServiceGroupType { id: string; name: string; level: number; assignable: boolean }\n\n/** Corpo de `POST /groups` (o projeto é sempre o do client). */\nexport interface AutoServiceGroupCreate { group_id?: string; name: string; type_id: string; description?: string }\n\n/** Corpo de `PUT /groups/:groupId`; do grupo de administração só `description`. `null` apaga a descrição. */\nexport interface AutoServiceGroupUpdate { name?: string; type_id?: string; description?: string | null; enabled?: boolean }\n\n/** Aplicação (client_credentials) do projeto do client (`GET /apps`). */\nexport interface AutoServiceApp {\n id: string;\n name: string;\n enabled: boolean;\n allowed_grants?: string[] | null;\n [key: string]: unknown;\n}\n\n/**\n * Token de API (`x-api-token`) de uma aplicação (`GET /apps/:appId/tokens`). O valor só vem na criação; aqui fica o\n * começo dele (`token_prefix`) para reconhecer. Cada token é também um consumer (`consumer_id`) com as permissões dele.\n */\nexport interface AutoServiceAppToken {\n id: string;\n consumer_id: string;\n name: string;\n description: string | null;\n token_prefix: string;\n expires_at: string;\n revoked_at: string | null;\n created_at: string;\n last_used_at: string | null;\n}\n\n/** Corpo de `POST /apps/:appId/tokens`: validade ISO (até 365 dias) e as operações protected liberadas ao token. */\nexport interface AutoServiceAppTokenCreate { name: string; description?: string; expires_at: string; operation_ids?: string[] }\n\n/** Resposta de `POST /apps/:appId/tokens`: `token` é o valor cru, devolvido uma única vez. */\nexport interface AutoServiceAppTokenCreated { id: string; consumer_id: string; name: string; token: string }\n\n@Injectable({ providedIn: 'root' })\nexport class AutoServiceService {\n\n private get baseUrl() {\n return `${this.config.adminApi}/auto-service`;\n }\n\n /** `baseUrl` + caminho com cada id interpolado codificado (`urlPath`): um id com `/`, `?`, `#` ou `..` não muda o recurso. */\n private url(strings: TemplateStringsArray, ...ids: readonly string[]): string {\n return this.baseUrl + urlPath(strings, ...ids);\n }\n\n private get headers(): HttpHeaders {\n const token = this.auth.getToken();\n return new HttpHeaders({ 'x-access-token': token ?? '' });\n }\n\n constructor(\n private http: HttpClient,\n private auth: AuthorizationService,\n @Inject(AUTO_SERVICE_CONFIG) private config: AutoServiceConfig,\n ) {}\n\n // Descoberta\n getMyClients() { return firstValueFrom(this.http.get<{ clients: any[] }>(this.baseUrl, { headers: this.headers })); }\n\n // Routes\n getWebRoutes(clientId: string) { return firstValueFrom(this.http.get<{ routes: any[] }>(this.url`/${clientId}/routes`, { headers: this.headers })); }\n createWebRoute(clientId: string, body: any) { return firstValueFrom(this.http.post<any>(this.url`/${clientId}/routes`, body, { headers: this.headers })); }\n updateWebRoute(clientId: string, id: string, body: any) { return firstValueFrom(this.http.put<any>(this.url`/${clientId}/routes/${id}`, body, { headers: this.headers })); }\n deleteWebRoute(clientId: string, id: string) { return firstValueFrom(this.http.delete<any>(this.url`/${clientId}/routes/${id}`, { headers: this.headers })); }\n\n // Routers\n getRouters(clientId: string) { return firstValueFrom(this.http.get<{ routers: any[] }>(this.url`/${clientId}/routers`, { headers: this.headers })); }\n createRouter(clientId: string, body: any) { return firstValueFrom(this.http.post<any>(this.url`/${clientId}/routers`, body, { headers: this.headers })); }\n updateRouter(clientId: string, id: string, body: any) { return firstValueFrom(this.http.put<any>(this.url`/${clientId}/routers/${id}`, body, { headers: this.headers })); }\n deleteRouter(clientId: string, id: string) { return firstValueFrom(this.http.delete<any>(this.url`/${clientId}/routers/${id}`, { headers: this.headers })); }\n /** Árvore do menu (header → … → página) com os router_ids de cada nó, já na ordem gravada. */\n getRouterTree(clientId: string) { return firstValueFrom(this.http.get<{ tree: RouterOrderNode[] }>(this.url`/${clientId}/routers/tree`, { headers: this.headers })); }\n /**\n * Grava a ordem de UM nível (irmãos): o índice do grupo é a ordem; cada grupo escreve `${type}_order`\n * em todos os seus routers. Vale também para routers de template (ordem é do client).\n */\n reorderRouters(clientId: string, groups: RouterOrderGroup[]) { return firstValueFrom(this.http.patch<any>(this.url`/${clientId}/routers/reorder`, { groups }, { headers: this.headers })); }\n\n // Groups (do projeto do client, sem o grupo de administração: editar/excluir/membros dele respondem 404)\n getGroups(clientId: string) { return firstValueFrom(this.http.get<{ groups: AutoServiceGroup[] }>(this.url`/${clientId}/groups`, { headers: this.headers })); }\n /** Tipos (crachás) do realm; `assignable: false` no Administrador, que é só do grupo de administração (painel central). */\n getGroupTypes(clientId: string) { return firstValueFrom(this.http.get<{ group_types: AutoServiceGroupType[] }>(this.url`/${clientId}/group-types`, { headers: this.headers })); }\n createGroup(clientId: string, body: AutoServiceGroupCreate) { return firstValueFrom(this.http.post<AutoServiceGroup>(this.url`/${clientId}/groups`, body, { headers: this.headers })); }\n updateGroup(clientId: string, groupId: string, body: AutoServiceGroupUpdate) { return firstValueFrom(this.http.put<AutoServiceGroup>(this.url`/${clientId}/groups/${groupId}`, body, { headers: this.headers })); }\n deleteGroup(clientId: string, groupId: string) { return firstValueFrom(this.http.delete<void>(this.url`/${clientId}/groups/${groupId}`, { headers: this.headers })); }\n getGroupMembers(clientId: string, groupId: string) { return firstValueFrom(this.http.get<{ members: any[] }>(this.url`/${clientId}/groups/${groupId}/members`, { headers: this.headers })); }\n /** Sugestões para adicionar ao grupo: quem já está em outro grupo deste sistema e ainda não neste, com foto e os grupos. */\n getMemberSuggestions(clientId: string, groupId: string, limit = 8) {\n const params = new HttpParams().set('limit', String(limit));\n return firstValueFrom(this.http.get<{ users: AutoServiceMemberSuggestion[] }>(this.url`/${clientId}/groups/${groupId}/member-suggestions`, { headers: this.headers, params }));\n }\n addGroupMember(clientId: string, groupId: string, userId: string, role: string | null) { return firstValueFrom(this.http.post<any>(this.url`/${clientId}/groups/${groupId}/members`, { user_id: userId, role }, { headers: this.headers })); }\n updateGroupMemberRole(clientId: string, groupId: string, userId: string, role: string | null) { return firstValueFrom(this.http.put<any>(this.url`/${clientId}/groups/${groupId}/members/${userId}`, { role }, { headers: this.headers })); }\n removeGroupMember(clientId: string, groupId: string, userId: string) { return firstValueFrom(this.http.delete<any>(this.url`/${clientId}/groups/${groupId}/members/${userId}`, { headers: this.headers })); }\n\n // Users (só leitura -- popular a busca de \"adicionar membro\" na aba Grupos, escopada pelo realm do próprio client)\n searchUsers(clientId: string, opts: { search?: string; limit?: number } = {}) {\n let params = new HttpParams();\n if (opts.search) params = params.set('search', opts.search);\n if (opts.limit) params = params.set('limit', String(opts.limit));\n return firstValueFrom(this.http.get<{ users: any[] }>(this.url`/${clientId}/users`, { headers: this.headers, params }));\n }\n\n // Access\n getAccess(clientId: string) { return firstValueFrom(this.http.get<{ access: any[] }>(this.url`/${clientId}/access`, { headers: this.headers })); }\n createAccess(clientId: string, groupId: string) { return firstValueFrom(this.http.post<any>(this.url`/${clientId}/access`, { group_id: groupId }, { headers: this.headers })); }\n deleteAccess(clientId: string, accessId: string) { return firstValueFrom(this.http.delete<any>(this.url`/${clientId}/access/${accessId}`, { headers: this.headers })); }\n getGuards(clientId: string, accessId: string) { return firstValueFrom(this.http.get<{ guards: any[] }>(this.url`/${clientId}/access/${accessId}/guards`, { headers: this.headers })); }\n addGuard(clientId: string, accessId: string, routerId: string) { return firstValueFrom(this.http.post<any>(this.url`/${clientId}/access/${accessId}/guards`, { router_id: routerId }, { headers: this.headers })); }\n removeGuard(clientId: string, accessId: string, guardId: string) { return firstValueFrom(this.http.delete<any>(this.url`/${clientId}/access/${accessId}/guards/${guardId}`, { headers: this.headers })); }\n\n // Apps (aplicações client_credentials no Project deste client)\n getApps(clientId: string) { return firstValueFrom(this.http.get<{ apps: AutoServiceApp[] }>(this.url`/${clientId}/apps`, { headers: this.headers })); }\n createApp(clientId: string, body: { name: string; allowed_grants?: string[] }) { return firstValueFrom(this.http.post<{ id: string; name: string; secret: string }>(this.url`/${clientId}/apps`, body, { headers: this.headers })); }\n updateApp(clientId: string, appId: string, body: any) { return firstValueFrom(this.http.put<any>(this.url`/${clientId}/apps/${appId}`, body, { headers: this.headers })); }\n /** Gera um segredo novo para a aplicação (o anterior para de valer na hora). A resposta traz o segredo uma única vez. */\n rotateAppSecret(clientId: string, appId: string) { return firstValueFrom(this.http.post<{ id: string; secret: string }>(this.url`/${clientId}/apps/${appId}/secret`, {}, { headers: this.headers })); }\n deleteApp(clientId: string, appId: string) { return firstValueFrom(this.http.delete<any>(this.url`/${clientId}/apps/${appId}`, { headers: this.headers })); }\n getAppOperations(clientId: string, appId: string) { return firstValueFrom(this.http.get<{ operations: any[] }>(this.url`/${clientId}/apps/${appId}/operations`, { headers: this.headers })); }\n\n // Tokens de API da aplicação (x-api-token)\n getAppTokens(clientId: string, appId: string) { return firstValueFrom(this.http.get<{ tokens: AutoServiceAppToken[] }>(this.url`/${clientId}/apps/${appId}/tokens`, { headers: this.headers })); }\n /** Cria o token (e o consumer dele, com as permissões escolhidas). A resposta traz o valor uma única vez. */\n createAppToken(clientId: string, appId: string, body: AutoServiceAppTokenCreate) { return firstValueFrom(this.http.post<AutoServiceAppTokenCreated>(this.url`/${clientId}/apps/${appId}/tokens`, body, { headers: this.headers })); }\n /** Revoga: o token para de valer na hora e continua na lista como revogado. */\n revokeAppToken(clientId: string, appId: string, tokenId: string) { return firstValueFrom(this.http.delete<void>(this.url`/${clientId}/apps/${appId}/tokens/${tokenId}`, { headers: this.headers })); }\n\n // Consumers (grupo ↔ aplicação), sem o do grupo de administração: o servidor não o lista e o :consumerId dele é 404\n // (servidor antigo ainda devolve com `group_is_admin: true` e a aba Acessos descarta)\n getAppConsumers(clientId: string, appId: string) { return firstValueFrom(this.http.get<{ consumers: any[] }>(this.url`/${clientId}/apps/${appId}/consumers`, { headers: this.headers })); }\n createAppConsumer(clientId: string, appId: string, groupId: string) { return firstValueFrom(this.http.post<any>(this.url`/${clientId}/apps/${appId}/consumers`, { group_id: groupId }, { headers: this.headers })); }\n deleteAppConsumer(clientId: string, consumerId: string) { return firstValueFrom(this.http.delete<any>(this.url`/${clientId}/apps/consumers/${consumerId}`, { headers: this.headers })); }\n\n // Permissions (consumer ↔ operação)\n getAppPermissions(clientId: string, consumerId: string) { return firstValueFrom(this.http.get<{ permissions: any[] }>(this.url`/${clientId}/apps/consumers/${consumerId}/permissions`, { headers: this.headers })); }\n addAppPermission(clientId: string, consumerId: string, operationId: string) { return firstValueFrom(this.http.post<any>(this.url`/${clientId}/apps/consumers/${consumerId}/permissions`, { operation_id: operationId }, { headers: this.headers })); }\n removeAppPermission(clientId: string, consumerId: string, permissionId: string) { return firstValueFrom(this.http.delete<any>(this.url`/${clientId}/apps/consumers/${consumerId}/permissions/${permissionId}`, { headers: this.headers })); }\n // Auditoria: ver `SpineAuditService` (`@trismegisto/spine/audit`), o mesmo nos escopos admin e client.\n}\n","export * from './auto-service.tokens';\nexport * from './provide-auto-service';\nexport * from './auto-service.service';\nexport type { AutoServiceClient } from './client-picker/auto-service-client-picker.component';\n// A auditoria (tipos, serviço e a tela) mora em `@trismegisto/spine/audit` — NÃO reexporte daqui: um\n// `export` estático puxaria a tela para o arquivo deste ponto de entrada (ver abaixo e check-lazy).\n// As telas (Início, Grupos, Aplicações, Cliente) e as peças delas NÃO são exportadas daqui de propósito:\n// ficam só atrás dos `import()` de `AUTO_SERVICE_SCREENS`. Qualquer `export` estático de um componente\n// delas faz o rollup do ng-packagr juntar a tela no FESM do ponto de entrada e trocar o `import()` por\n// `Promise.resolve()` — e a tela (data-grid, combobox, drawer...) vai para o bundle inicial de todo app\n// (bug da 0.9.9). `scripts/check-lazy.mjs` (no `npm run build`) falha se isso voltar.\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;MASa,mBAAmB,GAAG,IAAI,cAAc,CAAoB,qBAAqB;AAE9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,sCAAsC,GAAG;AAC/C,MAAM,oCAAoC,GAAK;AAC/C,MAAM,sCAAsC,GAAG;AACtD;AACA;AACO,MAAM,qCAAqC,GAAI;AACtD;AACO,MAAM,8CAA8C,GAAG;AAC9D;AACA;AACO,MAAM,oCAAoC,GAAU;AACpD,MAAM,2CAA2C,GAAG;AACpD,MAAM,uCAAuC,GAAO;AAC3D;AACA;AACO,MAAM,oCAAoC,GAAI;;AC1BrD;;;;AAIG;AACI,MAAM,oBAAoB,GAG5B;AACH,IAAA,IAAI,EAAE,MAAM,OAAO,8DAAuB,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,CAAC;AACtE,IAAA,MAAM,EAAE,MAAM,OAAO,6EAAwC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,0BAA0B,CAAC;AACtG,IAAA,IAAI,EAAE,MAAM,OAAO,sEAA0B,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,oBAAoB,CAAC;AAChF,IAAA,MAAM,EAAE,MAAM,OAAO,6EAAiC,CAAC,CAAC,IAAI,CAAC,CAAC,IA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QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,gFAmBnB,mBAAmB,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAnBlB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,cADL,MAAM,EAAA,CAAA,CAAA;;4FACnB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAD9B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;0BAoB7B,MAAM;2BAAC,mBAAmB;;;ACzG/B;AACA;AACA;AACA;AACA;AACA;AACA;;ACVA;;AAEG;;"}
|
|
@@ -157,8 +157,8 @@ function buildClients(options) {
|
|
|
157
157
|
return forward(operation);
|
|
158
158
|
});
|
|
159
159
|
const toastLink = notifications ? envelopeToastLink(notifications, messages) : null;
|
|
160
|
-
const socketParams = () => {
|
|
161
|
-
const token = auth
|
|
160
|
+
const socketParams = async () => {
|
|
161
|
+
const token = await validToken(auth);
|
|
162
162
|
if (!token)
|
|
163
163
|
return {};
|
|
164
164
|
const params = { [TOKEN_HEADER]: token, headers: { [TOKEN_HEADER]: token } };
|
|
@@ -215,6 +215,15 @@ function buildClients(options) {
|
|
|
215
215
|
});
|
|
216
216
|
return named;
|
|
217
217
|
}
|
|
218
|
+
/**
|
|
219
|
+
* The socket skips HttpClient (and the @orfeu/angular token interceptor), so on (re)connect it asks for a token that
|
|
220
|
+
* is not stale: `getValidToken` (@orfeu/angular 1.7+) waits for the renewal when the tab's timers were held past the
|
|
221
|
+
* expiry. Older versions only have `getToken`.
|
|
222
|
+
*/
|
|
223
|
+
function validToken(auth) {
|
|
224
|
+
const renewing = auth;
|
|
225
|
+
return renewing.getValidToken ? renewing.getValidToken() : Promise.resolve(auth.getToken());
|
|
226
|
+
}
|
|
218
227
|
function openSocket(endpoint, connectionParams) {
|
|
219
228
|
let everConnected = false;
|
|
220
229
|
return createClient({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trismegisto-spine-graphql.mjs","sources":["../../../projects/ui/graphql/src/envelope.ts","../../../projects/ui/graphql/src/graphql-client.ts","../../../projects/ui/graphql/src/provide-graphql.ts","../../../projects/ui/graphql/src/trismegisto-spine-graphql.ts"],"sourcesContent":["import { currentSpineMessages } from '@trismegisto/spine';\n\n/** Shape every root query/mutation field returns on the platform: business status travels in the payload. */\nexport interface GraphqlEnvelope<T> {\n readonly status?: number | string | null;\n readonly message?: string | null;\n readonly data?: T | null;\n}\n\n/** Business failure carried by an envelope. `status` is kept exactly as the backend sent it. */\nexport class GraphqlEnvelopeError extends Error {\n readonly status: number | string | null | undefined;\n\n constructor(status: number | string | null | undefined, message: string) {\n super(message);\n this.name = 'GraphqlEnvelopeError';\n this.status = status;\n // Keeps `instanceof` working when the output is down-levelled.\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\nconst FAILURE_WORDS = new Set(['error', 'failed', 'failure', 'fail']);\n\nexport function isEnvelopeOk(status: GraphqlEnvelope<unknown>['status']): boolean {\n if (status === null || status === undefined) return true;\n if (typeof status === 'number') return status >= 200 && status < 300;\n if (typeof status !== 'string') return true;\n // Numeric text is deliberately not parsed: only the failure words count as failure.\n return !FAILURE_WORDS.has(status.trim().toLowerCase());\n}\n\n/** Returns `data` of an ok envelope; throws `GraphqlEnvelopeError` for a missing or failed one. */\nexport function unwrap<T>(envelope: GraphqlEnvelope<T> | null | undefined): T {\n if (envelope === null || envelope === undefined) {\n throw new GraphqlEnvelopeError(null, currentSpineMessages().graphql.noResponse);\n }\n if (!isEnvelopeOk(envelope.status)) {\n throw new GraphqlEnvelopeError(envelope.status, envelope.message || currentSpineMessages().graphql.failed);\n }\n return envelope.data as T;\n}\n\ntype Fields = [string, Record<string, unknown>][];\n\nfunction objectFields(data: unknown): Fields {\n if (!data || typeof data !== 'object') return [];\n return Object.entries(data as Record<string, unknown>).filter(\n (entry): entry is [string, Record<string, unknown>] => typeof entry[1] === 'object' && entry[1] !== null,\n );\n}\n\nconst hasStatus = (value: Record<string, unknown>): boolean =>\n 'status' in value && value['status'] !== null && value['status'] !== undefined;\n\n/** First-level envelopes found in an operation's `data` (fields that carry both `status` and `message`). */\nexport function envelopesOf(data: unknown): { field: string; status: number | string; message: string; ok: boolean }[] {\n return objectFields(data)\n .filter(([, value]) => 'message' in value && hasStatus(value))\n .map(([field, value]) => {\n const status = value['status'] as number | string;\n return { field, status, message: (value['message'] as string | null) ?? '', ok: isEnvelopeOk(status) };\n });\n}\n\n/** First-level fields whose status is a failure; `message` is optional here. */\nexport function failedEnvelopes(\n data: unknown,\n fallbackMessage: string = currentSpineMessages().graphql.serviceFailure,\n): { field: string; status: unknown; message: string }[] {\n return objectFields(data)\n .filter(([, value]) => hasStatus(value) && !isEnvelopeOk(value['status'] as GraphqlEnvelope<unknown>['status']))\n .map(([field, value]) => ({\n field,\n status: value['status'],\n message: (value['message'] as string | null | undefined) || fallbackMessage,\n }));\n}\n","import { inject } from '@angular/core';\nimport type { DefaultContext, OperationVariables, TypedDocumentNode } from '@apollo/client/core';\nimport { Apollo } from 'apollo-angular';\nimport { Observable, filter, firstValueFrom, map } from 'rxjs';\n\nimport { currentSpineMessages } from '@trismegisto/spine';\nimport { GraphqlEnvelopeError } from './envelope';\n\n/** Opções de uma chamada. `silenceEnvelope`: a tela trata a falha sozinha, sem o toast automático. */\nexport interface GraphqlCallOptions {\n readonly silenceEnvelope?: boolean;\n readonly context?: DefaultContext;\n}\n\n/**\n * Cliente GraphQL de UM backend do app, tipado pelo documento gerado no codegen\n * (`TypedDocumentNode`): o retorno é o `data` da operação, sem `<any>`. Junto com o `unwrap` do\n * envelope, é o caminho padrão dos serviços de domínio:\n *\n * private readonly gql = injectGraphqlClient('main');\n * async listTeams() { return unwrap((await this.gql.query(ListTeamsDocument)).teams); }\n *\n * Erro de transporte/GraphQL (`errors[]`) rejeita a Promise (o `errorPolicy` é o padrão `none`);\n * resposta sem `data` também. Falha de NEGÓCIO vem no envelope e quem decide é o `unwrap`.\n */\nexport interface GraphqlClient {\n query<T, V extends OperationVariables = OperationVariables>(\n document: TypedDocumentNode<T, V>, variables?: V, options?: GraphqlCallOptions): Promise<T>;\n mutate<T, V extends OperationVariables = OperationVariables>(\n document: TypedDocumentNode<T, V>, variables?: V, options?: GraphqlCallOptions): Promise<T>;\n /** Eventos da subscription (sem envelope: evento não é resposta). Mensagem sem `data` é ignorada. */\n subscribe<T, V extends OperationVariables = OperationVariables>(\n document: TypedDocumentNode<T, V>, variables?: V): Observable<T>;\n}\n\nconst contextOf = (options?: GraphqlCallOptions): DefaultContext | undefined =>\n options?.silenceEnvelope ? { ...options.context, silenceEnvelope: true } : options?.context;\n\nconst required = <T>(data: T | null | undefined): T => {\n if (data === null || data === undefined) throw new GraphqlEnvelopeError(null, currentSpineMessages().graphql.noResponse);\n return data;\n};\n\n/** O `GraphqlClient` do backend `namedClient` (`environment.graphql.<chave>.namedClient`). Chamar em contexto de injeção. */\nexport function injectGraphqlClient(namedClient: string): GraphqlClient {\n const apollo = inject(Apollo);\n const client = () => apollo.use(namedClient);\n // Os genéricos do apollo-angular não casam 1:1 com os do TypedDocumentNode (variáveis opcionais):\n // o tipo público acima é o contrato; aqui dentro o cast é deliberado.\n /* eslint-disable @typescript-eslint/no-explicit-any */\n return {\n async query(document: any, variables?: any, options?: GraphqlCallOptions) {\n const result = await firstValueFrom(client().query<any, any>({ query: document, variables, context: contextOf(options) }));\n return required(result.data);\n },\n async mutate(document: any, variables?: any, options?: GraphqlCallOptions) {\n const result = await firstValueFrom(client().mutate<any, any>({ mutation: document, variables, context: contextOf(options) }));\n return required(result.data);\n },\n subscribe(document: any, variables?: any) {\n return client().subscribe<any, any>({ query: document, variables }).pipe(\n map((result) => result.data),\n filter((data) => data !== null && data !== undefined),\n );\n },\n } as GraphqlClient;\n /* eslint-enable @typescript-eslint/no-explicit-any */\n}\n","import { DOCUMENT, DestroyRef, PLATFORM_ID, Provider, inject } from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport { HttpHeaders } from '@angular/common/http';\nimport { ApolloLink, CombinedGraphQLErrors, InMemoryCache } from '@apollo/client';\nimport { ErrorLink } from '@apollo/client/link/error';\nimport { GraphQLWsLink } from '@apollo/client/link/subscriptions';\nimport { NamedOptions, provideNamedApollo } from 'apollo-angular';\nimport { HttpBatchLink } from 'apollo-angular/http';\nimport { OperationTypeNode } from 'graphql';\nimport { Client, createClient } from 'graphql-ws';\nimport { Subject, tap } from 'rxjs';\n\nimport { AuthorizationService } from '@orfeu/angular/core';\nimport { SPINE_CONFIG, SPINE_MESSAGES, SpineMessages } from '@trismegisto/spine';\nimport { AlertType, NotificationService } from '@trismegisto/spine/notification';\nimport { LoggerService } from '@trismegisto/spine/routing';\n\nimport { envelopesOf } from './envelope';\n\nexport interface GraphqlEndpoint {\n // Mutable on purpose: the runtime environment rewrites `http`/`ws` before bootstrap.\n namedClient: string;\n http: string;\n ws?: string;\n}\n\nexport interface GraphqlOptions {\n readonly endpoints: Readonly<Record<string, GraphqlEndpoint>>;\n}\n\n/** Emits the `namedClient` whose socket came back after a drop (never on the first connection). */\nexport const wsReconnected$ = new Subject<string>();\n\nconst TOKEN_HEADER = 'x-access-token';\nconst AUTH_CODES = new Set([401, 4401, 4403]);\nconst AUTH_RESET_WINDOW_MS = 5_000;\nconst STALE_TAB_MS = 60_000;\n// Well under the ~60 s idle cut most reverse proxies apply.\nconst PING_EVERY_MS = 20_000;\nconst RETRY_BASE_MS = 1_000;\nconst RETRY_CAP_MS = 30_000;\nconst TOAST_OK_SECONDS = 4;\nconst TOAST_FAIL_SECONDS = 8;\n// graphql-ws gives up on some close codes no matter what `shouldRetry` says; reporting them as this\n// \"try again later\" code keeps the socket coming back.\nconst RETRYABLE_CLOSE = 1013;\n\ntype InitPayload = Record<string, unknown>;\n\nexport function provideGraphql(options: GraphqlOptions): Provider {\n return provideNamedApollo(() => buildClients(options));\n}\n\nfunction buildClients(options: GraphqlOptions): NamedOptions {\n const auth = inject(AuthorizationService);\n const messages = inject(SPINE_MESSAGES);\n const batchLink = inject(HttpBatchLink);\n const notifications = inject(NotificationService, { optional: true });\n const logger = inject(LoggerService, { optional: true });\n const config = inject(SPINE_CONFIG, { optional: true });\n const browser = isPlatformBrowser(inject(PLATFORM_ID));\n\n const sockets: Client[] = [];\n const dropAllSockets = () => {\n for (const socket of sockets) {\n try {\n socket.terminate();\n } catch {\n // already dead: nothing to do\n }\n }\n };\n\n let lastAuthReset = -Infinity;\n const authErrorLink = new ErrorLink(({ error }) => {\n if (!carriesAuthCode(error)) return;\n const now = Date.now();\n if (now - lastAuthReset < AUTH_RESET_WINDOW_MS) return;\n lastAuthReset = now;\n dropAllSockets();\n });\n\n const tokenLink = new ApolloLink((operation, forward) => {\n const token = auth.getToken();\n if (token) {\n operation.setContext(({ headers }: { headers?: HttpHeaders | Record<string, string> }) => ({\n headers: toHttpHeaders(headers).set(TOKEN_HEADER, token),\n }));\n }\n return forward(operation);\n });\n\n const toastLink = notifications ? envelopeToastLink(notifications, messages) : null;\n\n const socketParams = (): InitPayload => {\n const token = auth.getToken();\n if (!token) return {};\n const params: InitPayload = { [TOKEN_HEADER]: token, headers: { [TOKEN_HEADER]: token } };\n const routeId = logger?.routeId;\n if (routeId) params['routeId'] = routeId;\n if (config?.clientId) params['clientId'] = config.clientId;\n return params;\n };\n\n const named: NamedOptions = {};\n for (const endpoint of Object.values(options.endpoints)) {\n const httpLink = ApolloLink.concat(tokenLink, batchLink.create({ uri: endpoint.http }));\n let transport: ApolloLink = httpLink;\n\n if (browser && endpoint.ws) {\n const socket = openSocket(endpoint, socketParams);\n sockets.push(socket);\n transport = ApolloLink.split(\n (operation) => operation.operationType === OperationTypeNode.SUBSCRIPTION,\n new GraphQLWsLink(socket),\n httpLink,\n );\n }\n\n named[endpoint.namedClient] = {\n link: ApolloLink.from(toastLink ? [authErrorLink, toastLink, transport] : [authErrorLink, transport]),\n cache: new InMemoryCache(),\n defaultOptions: {\n query: { fetchPolicy: 'no-cache' },\n watchQuery: { fetchPolicy: 'no-cache' },\n },\n };\n }\n\n const destroyRef = inject(DestroyRef);\n if (browser && sockets.length) {\n const doc = inject(DOCUMENT);\n let hiddenAt: number | null = null;\n const onVisibility = () => {\n if (doc.visibilityState === 'hidden') {\n hiddenAt = Date.now();\n return;\n }\n if (doc.visibilityState !== 'visible' || hiddenAt === null) return;\n const away = Date.now() - hiddenAt;\n hiddenAt = null;\n if (away >= STALE_TAB_MS) dropAllSockets();\n };\n doc.addEventListener('visibilitychange', onVisibility);\n destroyRef.onDestroy(() => doc.removeEventListener('visibilitychange', onVisibility));\n }\n destroyRef.onDestroy(() => {\n for (const socket of sockets) {\n Promise.resolve()\n .then(() => socket.dispose())\n .catch(() => undefined);\n }\n });\n\n return named;\n}\n\nfunction openSocket(endpoint: GraphqlEndpoint, connectionParams: () => InitPayload): Client {\n let everConnected = false;\n return createClient({\n url: endpoint.ws!,\n connectionParams,\n keepAlive: PING_EVERY_MS,\n retryAttempts: Infinity,\n shouldRetry: () => true,\n retryWait: backoff,\n webSocketImpl: forgivingSocket(globalThis.WebSocket),\n on: {\n connected: (_socket, _payload, wasRetry) => {\n if (wasRetry && everConnected) wsReconnected$.next(endpoint.namedClient);\n everConnected = true;\n },\n },\n });\n}\n\n/** Exponential wait with \"equal jitter\": half fixed, half random, capped. */\nfunction backoff(attempt: number): Promise<void> {\n const ceiling = Math.min(RETRY_CAP_MS, RETRY_BASE_MS * 2 ** attempt);\n const wait = ceiling / 2 + Math.random() * (ceiling / 2);\n return new Promise((resolve) => setTimeout(resolve, wait));\n}\n\n/**\n * Thin wrapper around the platform WebSocket that reports every abnormal close as retryable, so the\n * client keeps reconnecting even after closes graphql-ws would otherwise treat as final.\n */\nfunction forgivingSocket(Native: typeof WebSocket): typeof WebSocket {\n class ForgivingSocket {\n static readonly CONNECTING = 0;\n static readonly OPEN = 1;\n static readonly CLOSING = 2;\n static readonly CLOSED = 3;\n\n private readonly inner: WebSocket;\n\n constructor(url: string | URL, protocols?: string | string[]) {\n this.inner = new Native(url, protocols);\n }\n\n get readyState(): number {\n return this.inner.readyState;\n }\n\n get protocol(): string {\n return this.inner.protocol;\n }\n\n set onopen(handler: WebSocket['onopen']) {\n this.inner.onopen = handler;\n }\n\n set onmessage(handler: WebSocket['onmessage']) {\n this.inner.onmessage = handler;\n }\n\n set onerror(handler: WebSocket['onerror']) {\n this.inner.onerror = handler;\n }\n\n set onclose(handler: ((event: CloseEvent) => void) | null) {\n this.inner.onclose = handler\n ? (event: CloseEvent) =>\n handler({\n code: event.code === 1000 ? 1000 : RETRYABLE_CLOSE,\n reason: event.reason,\n wasClean: event.wasClean,\n } as CloseEvent)\n : null;\n }\n\n send(data: string): void {\n this.inner.send(data);\n }\n\n close(code?: number, reason?: string): void {\n this.inner.close(code, reason);\n }\n }\n return ForgivingSocket as unknown as typeof WebSocket;\n}\n\nfunction toHttpHeaders(headers: HttpHeaders | Record<string, string> | undefined): HttpHeaders {\n if (headers instanceof HttpHeaders) return headers;\n return new HttpHeaders(headers ?? {});\n}\n\nfunction codeOf(source: unknown): number | null {\n if (!source || typeof source !== 'object') return null;\n const record = source as Record<string, unknown>;\n for (const key of ['code', 'status', 'statusCode']) {\n const value = record[key];\n if (value !== undefined && value !== null && value !== '') {\n const code = Number(value);\n if (Number.isFinite(code)) return code;\n }\n }\n return null;\n}\n\nfunction carriesAuthCode(error: unknown): boolean {\n const codes = CombinedGraphQLErrors.is(error)\n ? error.errors.map((entry) => codeOf(entry.extensions))\n : [codeOf(error)];\n return codes.some((code) => code !== null && AUTH_CODES.has(code));\n}\n\nfunction envelopeToastLink(notifications: NotificationService, messages: SpineMessages): ApolloLink {\n return new ApolloLink((operation, forward) => {\n const kind = operation.operationType;\n if (kind === OperationTypeNode.SUBSCRIPTION || operation.getContext()['silenceEnvelope'] === true) {\n return forward(operation);\n }\n const isMutation = kind === OperationTypeNode.MUTATION;\n return forward(operation).pipe(\n tap((result) => {\n for (const envelope of envelopesOf(result.data)) {\n if (envelope.ok ? !isMutation || !envelope.message : !isMutation && String(envelope.status) === '404') {\n continue;\n }\n const numeric = Number(envelope.status);\n notifications.addNotification({\n timer: envelope.ok ? TOAST_OK_SECONDS : TOAST_FAIL_SECONDS,\n hermesAlertType: Number.isFinite(numeric)\n ? notifications.resolveAlertType(numeric)\n : envelope.ok\n ? AlertType.SUCCESS\n : AlertType.DANGER,\n message: envelope.message || (envelope.ok ? messages.graphql.done : messages.graphql.failed),\n hermesAlertClosable: true,\n });\n }\n }),\n );\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AASA;AACM,MAAO,oBAAqB,SAAQ,KAAK,CAAA;IAG7C,WAAA,CAAY,MAA0C,EAAE,OAAe,EAAA;QACrE,KAAK,CAAC,OAAO,CAAC;AACd,QAAA,IAAI,CAAC,IAAI,GAAG,sBAAsB;AAClC,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;;QAEpB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC;IACnD;AACD;AAED,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;AAE/D,SAAU,YAAY,CAAC,MAA0C,EAAA;AACrE,IAAA,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,SAAS;AAAE,QAAA,OAAO,IAAI;IACxD,IAAI,OAAO,MAAM,KAAK,QAAQ;AAAE,QAAA,OAAO,MAAM,IAAI,GAAG,IAAI,MAAM,GAAG,GAAG;IACpE,IAAI,OAAO,MAAM,KAAK,QAAQ;AAAE,QAAA,OAAO,IAAI;;AAE3C,IAAA,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC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AAC,QAAQ,CAAC,MAAM,CAAC;gBACvC,aAAa,CAAC,eAAe,CAAC;oBAC5B,KAAK,EAAE,QAAQ,CAAC,EAAE,GAAG,gBAAgB,GAAG,kBAAkB;AAC1D,oBAAA,eAAe,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO;AACtC,0BAAE,aAAa,CAAC,gBAAgB,CAAC,OAAO;0BACtC,QAAQ,CAAC;8BACP,SAAS,CAAC;8BACV,SAAS,CAAC,MAAM;oBACtB,OAAO,EAAE,QAAQ,CAAC,OAAO,KAAK,QAAQ,CAAC,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;AAC5F,oBAAA,mBAAmB,EAAE,IAAI;AAC1B,iBAAA,CAAC;YACJ;QACF,CAAC,CAAC,CACH;AACH,IAAA,CAAC,CAAC;AACJ;;ACvSA;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"trismegisto-spine-graphql.mjs","sources":["../../../projects/ui/graphql/src/envelope.ts","../../../projects/ui/graphql/src/graphql-client.ts","../../../projects/ui/graphql/src/provide-graphql.ts","../../../projects/ui/graphql/src/trismegisto-spine-graphql.ts"],"sourcesContent":["import { currentSpineMessages } from '@trismegisto/spine';\n\n/** Shape every root query/mutation field returns on the platform: business status travels in the payload. */\nexport interface GraphqlEnvelope<T> {\n readonly status?: number | string | null;\n readonly message?: string | null;\n readonly data?: T | null;\n}\n\n/** Business failure carried by an envelope. `status` is kept exactly as the backend sent it. */\nexport class GraphqlEnvelopeError extends Error {\n readonly status: number | string | null | undefined;\n\n constructor(status: number | string | null | undefined, message: string) {\n super(message);\n this.name = 'GraphqlEnvelopeError';\n this.status = status;\n // Keeps `instanceof` working when the output is down-levelled.\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\nconst FAILURE_WORDS = new Set(['error', 'failed', 'failure', 'fail']);\n\nexport function isEnvelopeOk(status: GraphqlEnvelope<unknown>['status']): boolean {\n if (status === null || status === undefined) return true;\n if (typeof status === 'number') return status >= 200 && status < 300;\n if (typeof status !== 'string') return true;\n // Numeric text is deliberately not parsed: only the failure words count as failure.\n return !FAILURE_WORDS.has(status.trim().toLowerCase());\n}\n\n/** Returns `data` of an ok envelope; throws `GraphqlEnvelopeError` for a missing or failed one. */\nexport function unwrap<T>(envelope: GraphqlEnvelope<T> | null | undefined): T {\n if (envelope === null || envelope === undefined) {\n throw new GraphqlEnvelopeError(null, currentSpineMessages().graphql.noResponse);\n }\n if (!isEnvelopeOk(envelope.status)) {\n throw new GraphqlEnvelopeError(envelope.status, envelope.message || currentSpineMessages().graphql.failed);\n }\n return envelope.data as T;\n}\n\ntype Fields = [string, Record<string, unknown>][];\n\nfunction objectFields(data: unknown): Fields {\n if (!data || typeof data !== 'object') return [];\n return Object.entries(data as Record<string, unknown>).filter(\n (entry): entry is [string, Record<string, unknown>] => typeof entry[1] === 'object' && entry[1] !== null,\n );\n}\n\nconst hasStatus = (value: Record<string, unknown>): boolean =>\n 'status' in value && value['status'] !== null && value['status'] !== undefined;\n\n/** First-level envelopes found in an operation's `data` (fields that carry both `status` and `message`). */\nexport function envelopesOf(data: unknown): { field: string; status: number | string; message: string; ok: boolean }[] {\n return objectFields(data)\n .filter(([, value]) => 'message' in value && hasStatus(value))\n .map(([field, value]) => {\n const status = value['status'] as number | string;\n return { field, status, message: (value['message'] as string | null) ?? '', ok: isEnvelopeOk(status) };\n });\n}\n\n/** First-level fields whose status is a failure; `message` is optional here. */\nexport function failedEnvelopes(\n data: unknown,\n fallbackMessage: string = currentSpineMessages().graphql.serviceFailure,\n): { field: string; status: unknown; message: string }[] {\n return objectFields(data)\n .filter(([, value]) => hasStatus(value) && !isEnvelopeOk(value['status'] as GraphqlEnvelope<unknown>['status']))\n .map(([field, value]) => ({\n field,\n status: value['status'],\n message: (value['message'] as string | null | undefined) || fallbackMessage,\n }));\n}\n","import { inject } from '@angular/core';\nimport type { DefaultContext, OperationVariables, TypedDocumentNode } from '@apollo/client/core';\nimport { Apollo } from 'apollo-angular';\nimport { Observable, filter, firstValueFrom, map } from 'rxjs';\n\nimport { currentSpineMessages } from '@trismegisto/spine';\nimport { GraphqlEnvelopeError } from './envelope';\n\n/** Opções de uma chamada. `silenceEnvelope`: a tela trata a falha sozinha, sem o toast automático. */\nexport interface GraphqlCallOptions {\n readonly silenceEnvelope?: boolean;\n readonly context?: DefaultContext;\n}\n\n/**\n * Cliente GraphQL de UM backend do app, tipado pelo documento gerado no codegen\n * (`TypedDocumentNode`): o retorno é o `data` da operação, sem `<any>`. Junto com o `unwrap` do\n * envelope, é o caminho padrão dos serviços de domínio:\n *\n * private readonly gql = injectGraphqlClient('main');\n * async listTeams() { return unwrap((await this.gql.query(ListTeamsDocument)).teams); }\n *\n * Erro de transporte/GraphQL (`errors[]`) rejeita a Promise (o `errorPolicy` é o padrão `none`);\n * resposta sem `data` também. Falha de NEGÓCIO vem no envelope e quem decide é o `unwrap`.\n */\nexport interface GraphqlClient {\n query<T, V extends OperationVariables = OperationVariables>(\n document: TypedDocumentNode<T, V>, variables?: V, options?: GraphqlCallOptions): Promise<T>;\n mutate<T, V extends OperationVariables = OperationVariables>(\n document: TypedDocumentNode<T, V>, variables?: V, options?: GraphqlCallOptions): Promise<T>;\n /** Eventos da subscription (sem envelope: evento não é resposta). Mensagem sem `data` é ignorada. */\n subscribe<T, V extends OperationVariables = OperationVariables>(\n document: TypedDocumentNode<T, V>, variables?: V): Observable<T>;\n}\n\nconst contextOf = (options?: GraphqlCallOptions): DefaultContext | undefined =>\n options?.silenceEnvelope ? { ...options.context, silenceEnvelope: true } : options?.context;\n\nconst required = <T>(data: T | null | undefined): T => {\n if (data === null || data === undefined) throw new GraphqlEnvelopeError(null, currentSpineMessages().graphql.noResponse);\n return data;\n};\n\n/** O `GraphqlClient` do backend `namedClient` (`environment.graphql.<chave>.namedClient`). Chamar em contexto de injeção. */\nexport function injectGraphqlClient(namedClient: string): GraphqlClient {\n const apollo = inject(Apollo);\n const client = () => apollo.use(namedClient);\n // Os genéricos do apollo-angular não casam 1:1 com os do TypedDocumentNode (variáveis opcionais):\n // o tipo público acima é o contrato; aqui dentro o cast é deliberado.\n /* eslint-disable @typescript-eslint/no-explicit-any */\n return {\n async query(document: any, variables?: any, options?: GraphqlCallOptions) {\n const result = await firstValueFrom(client().query<any, any>({ query: document, variables, context: contextOf(options) }));\n return required(result.data);\n },\n async mutate(document: any, variables?: any, options?: GraphqlCallOptions) {\n const result = await firstValueFrom(client().mutate<any, any>({ mutation: document, variables, context: contextOf(options) }));\n return required(result.data);\n },\n subscribe(document: any, variables?: any) {\n return client().subscribe<any, any>({ query: document, variables }).pipe(\n map((result) => result.data),\n filter((data) => data !== null && data !== undefined),\n );\n },\n } as GraphqlClient;\n /* eslint-enable @typescript-eslint/no-explicit-any */\n}\n","import { DOCUMENT, DestroyRef, PLATFORM_ID, Provider, inject } from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport { HttpHeaders } from '@angular/common/http';\nimport { ApolloLink, CombinedGraphQLErrors, InMemoryCache } from '@apollo/client';\nimport { ErrorLink } from '@apollo/client/link/error';\nimport { GraphQLWsLink } from '@apollo/client/link/subscriptions';\nimport { NamedOptions, provideNamedApollo } from 'apollo-angular';\nimport { HttpBatchLink } from 'apollo-angular/http';\nimport { OperationTypeNode } from 'graphql';\nimport { Client, createClient } from 'graphql-ws';\nimport { Subject, tap } from 'rxjs';\n\nimport { AuthorizationService } from '@orfeu/angular/core';\nimport { SPINE_CONFIG, SPINE_MESSAGES, SpineMessages } from '@trismegisto/spine';\nimport { AlertType, NotificationService } from '@trismegisto/spine/notification';\nimport { LoggerService } from '@trismegisto/spine/routing';\n\nimport { envelopesOf } from './envelope';\n\nexport interface GraphqlEndpoint {\n // Mutable on purpose: the runtime environment rewrites `http`/`ws` before bootstrap.\n namedClient: string;\n http: string;\n ws?: string;\n}\n\nexport interface GraphqlOptions {\n readonly endpoints: Readonly<Record<string, GraphqlEndpoint>>;\n}\n\n/** Emits the `namedClient` whose socket came back after a drop (never on the first connection). */\nexport const wsReconnected$ = new Subject<string>();\n\nconst TOKEN_HEADER = 'x-access-token';\nconst AUTH_CODES = new Set([401, 4401, 4403]);\nconst AUTH_RESET_WINDOW_MS = 5_000;\nconst STALE_TAB_MS = 60_000;\n// Well under the ~60 s idle cut most reverse proxies apply.\nconst PING_EVERY_MS = 20_000;\nconst RETRY_BASE_MS = 1_000;\nconst RETRY_CAP_MS = 30_000;\nconst TOAST_OK_SECONDS = 4;\nconst TOAST_FAIL_SECONDS = 8;\n// graphql-ws gives up on some close codes no matter what `shouldRetry` says; reporting them as this\n// \"try again later\" code keeps the socket coming back.\nconst RETRYABLE_CLOSE = 1013;\n\ntype InitPayload = Record<string, unknown>;\n\nexport function provideGraphql(options: GraphqlOptions): Provider {\n return provideNamedApollo(() => buildClients(options));\n}\n\nfunction buildClients(options: GraphqlOptions): NamedOptions {\n const auth = inject(AuthorizationService);\n const messages = inject(SPINE_MESSAGES);\n const batchLink = inject(HttpBatchLink);\n const notifications = inject(NotificationService, { optional: true });\n const logger = inject(LoggerService, { optional: true });\n const config = inject(SPINE_CONFIG, { optional: true });\n const browser = isPlatformBrowser(inject(PLATFORM_ID));\n\n const sockets: Client[] = [];\n const dropAllSockets = () => {\n for (const socket of sockets) {\n try {\n socket.terminate();\n } catch {\n // already dead: nothing to do\n }\n }\n };\n\n let lastAuthReset = -Infinity;\n const authErrorLink = new ErrorLink(({ error }) => {\n if (!carriesAuthCode(error)) return;\n const now = Date.now();\n if (now - lastAuthReset < AUTH_RESET_WINDOW_MS) return;\n lastAuthReset = now;\n dropAllSockets();\n });\n\n const tokenLink = new ApolloLink((operation, forward) => {\n const token = auth.getToken();\n if (token) {\n operation.setContext(({ headers }: { headers?: HttpHeaders | Record<string, string> }) => ({\n headers: toHttpHeaders(headers).set(TOKEN_HEADER, token),\n }));\n }\n return forward(operation);\n });\n\n const toastLink = notifications ? envelopeToastLink(notifications, messages) : null;\n\n const socketParams = async (): Promise<InitPayload> => {\n const token = await validToken(auth);\n if (!token) return {};\n const params: InitPayload = { [TOKEN_HEADER]: token, headers: { [TOKEN_HEADER]: token } };\n const routeId = logger?.routeId;\n if (routeId) params['routeId'] = routeId;\n if (config?.clientId) params['clientId'] = config.clientId;\n return params;\n };\n\n const named: NamedOptions = {};\n for (const endpoint of Object.values(options.endpoints)) {\n const httpLink = ApolloLink.concat(tokenLink, batchLink.create({ uri: endpoint.http }));\n let transport: ApolloLink = httpLink;\n\n if (browser && endpoint.ws) {\n const socket = openSocket(endpoint, socketParams);\n sockets.push(socket);\n transport = ApolloLink.split(\n (operation) => operation.operationType === OperationTypeNode.SUBSCRIPTION,\n new GraphQLWsLink(socket),\n httpLink,\n );\n }\n\n named[endpoint.namedClient] = {\n link: ApolloLink.from(toastLink ? [authErrorLink, toastLink, transport] : [authErrorLink, transport]),\n cache: new InMemoryCache(),\n defaultOptions: {\n query: { fetchPolicy: 'no-cache' },\n watchQuery: { fetchPolicy: 'no-cache' },\n },\n };\n }\n\n const destroyRef = inject(DestroyRef);\n if (browser && sockets.length) {\n const doc = inject(DOCUMENT);\n let hiddenAt: number | null = null;\n const onVisibility = () => {\n if (doc.visibilityState === 'hidden') {\n hiddenAt = Date.now();\n return;\n }\n if (doc.visibilityState !== 'visible' || hiddenAt === null) return;\n const away = Date.now() - hiddenAt;\n hiddenAt = null;\n if (away >= STALE_TAB_MS) dropAllSockets();\n };\n doc.addEventListener('visibilitychange', onVisibility);\n destroyRef.onDestroy(() => doc.removeEventListener('visibilitychange', onVisibility));\n }\n destroyRef.onDestroy(() => {\n for (const socket of sockets) {\n Promise.resolve()\n .then(() => socket.dispose())\n .catch(() => undefined);\n }\n });\n\n return named;\n}\n\n/**\n * The socket skips HttpClient (and the @orfeu/angular token interceptor), so on (re)connect it asks for a token that\n * is not stale: `getValidToken` (@orfeu/angular 1.7+) waits for the renewal when the tab's timers were held past the\n * expiry. Older versions only have `getToken`.\n */\nfunction validToken(auth: AuthorizationService): Promise<string | null> {\n const renewing = auth as unknown as { getValidToken?: () => Promise<string | null> };\n return renewing.getValidToken ? renewing.getValidToken() : Promise.resolve(auth.getToken());\n}\n\nfunction openSocket(endpoint: GraphqlEndpoint, connectionParams: () => Promise<InitPayload>): Client {\n let everConnected = false;\n return createClient({\n url: endpoint.ws!,\n connectionParams,\n keepAlive: PING_EVERY_MS,\n retryAttempts: Infinity,\n shouldRetry: () => true,\n retryWait: backoff,\n webSocketImpl: forgivingSocket(globalThis.WebSocket),\n on: {\n connected: (_socket, _payload, wasRetry) => {\n if (wasRetry && everConnected) wsReconnected$.next(endpoint.namedClient);\n everConnected = true;\n },\n },\n });\n}\n\n/** Exponential wait with \"equal jitter\": half fixed, half random, capped. */\nfunction backoff(attempt: number): Promise<void> {\n const ceiling = Math.min(RETRY_CAP_MS, RETRY_BASE_MS * 2 ** attempt);\n const wait = ceiling / 2 + Math.random() * (ceiling / 2);\n return new Promise((resolve) => setTimeout(resolve, wait));\n}\n\n/**\n * Thin wrapper around the platform WebSocket that reports every abnormal close as retryable, so the\n * client keeps reconnecting even after closes graphql-ws would otherwise treat as final.\n */\nfunction forgivingSocket(Native: typeof WebSocket): typeof WebSocket {\n class ForgivingSocket {\n static readonly CONNECTING = 0;\n static readonly OPEN = 1;\n static readonly CLOSING = 2;\n static readonly CLOSED = 3;\n\n private readonly inner: WebSocket;\n\n constructor(url: string | URL, protocols?: string | string[]) {\n this.inner = new Native(url, protocols);\n }\n\n get readyState(): number {\n return this.inner.readyState;\n }\n\n get protocol(): string {\n return this.inner.protocol;\n }\n\n set onopen(handler: WebSocket['onopen']) {\n this.inner.onopen = handler;\n }\n\n set onmessage(handler: WebSocket['onmessage']) {\n this.inner.onmessage = handler;\n }\n\n set onerror(handler: WebSocket['onerror']) {\n this.inner.onerror = handler;\n }\n\n set onclose(handler: ((event: CloseEvent) => void) | null) {\n this.inner.onclose = handler\n ? (event: CloseEvent) =>\n handler({\n code: event.code === 1000 ? 1000 : RETRYABLE_CLOSE,\n reason: event.reason,\n wasClean: event.wasClean,\n } as CloseEvent)\n : null;\n }\n\n send(data: string): void {\n this.inner.send(data);\n }\n\n close(code?: number, reason?: string): void {\n this.inner.close(code, reason);\n }\n }\n return ForgivingSocket as unknown as typeof WebSocket;\n}\n\nfunction toHttpHeaders(headers: HttpHeaders | Record<string, string> | undefined): HttpHeaders {\n if (headers instanceof HttpHeaders) return headers;\n return new HttpHeaders(headers ?? {});\n}\n\nfunction codeOf(source: unknown): number | null {\n if (!source || typeof source !== 'object') return null;\n const record = source as Record<string, unknown>;\n for (const key of ['code', 'status', 'statusCode']) {\n const value = record[key];\n if (value !== undefined && value !== null && value !== '') {\n const code = Number(value);\n if (Number.isFinite(code)) return code;\n }\n }\n return null;\n}\n\nfunction carriesAuthCode(error: unknown): boolean {\n const codes = CombinedGraphQLErrors.is(error)\n ? error.errors.map((entry) => codeOf(entry.extensions))\n : [codeOf(error)];\n return codes.some((code) => code !== null && AUTH_CODES.has(code));\n}\n\nfunction envelopeToastLink(notifications: NotificationService, messages: SpineMessages): ApolloLink {\n return new ApolloLink((operation, forward) => {\n const kind = operation.operationType;\n if (kind === OperationTypeNode.SUBSCRIPTION || operation.getContext()['silenceEnvelope'] === true) {\n return forward(operation);\n }\n const isMutation = kind === OperationTypeNode.MUTATION;\n return forward(operation).pipe(\n tap((result) => {\n for (const envelope of envelopesOf(result.data)) {\n if (envelope.ok ? !isMutation || !envelope.message : !isMutation && String(envelope.status) === '404') {\n continue;\n }\n const numeric = Number(envelope.status);\n notifications.addNotification({\n timer: envelope.ok ? TOAST_OK_SECONDS : TOAST_FAIL_SECONDS,\n hermesAlertType: Number.isFinite(numeric)\n ? notifications.resolveAlertType(numeric)\n : envelope.ok\n ? AlertType.SUCCESS\n : AlertType.DANGER,\n message: envelope.message || (envelope.ok ? messages.graphql.done : messages.graphql.failed),\n hermesAlertClosable: true,\n });\n }\n }),\n );\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"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