@techdocs/cli 0.0.0-nightly-20250910023713 → 0.0.0-nightly-20250912023732

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/CHANGELOG.md CHANGED
@@ -1,16 +1,16 @@
1
1
  # @techdocs/cli
2
2
 
3
- ## 0.0.0-nightly-20250910023713
3
+ ## 0.0.0-nightly-20250912023732
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - db63208: Fixed an issue where `@techdocs/cli serve` command did not pick up the latest changes to TechDocs.
8
8
  - Updated dependencies
9
- - @backstage/backend-defaults@0.0.0-nightly-20250910023713
9
+ - @backstage/backend-defaults@0.0.0-nightly-20250912023732
10
10
  - @backstage/catalog-model@1.7.5
11
11
  - @backstage/cli-common@0.1.15
12
12
  - @backstage/config@1.3.3
13
- - @backstage/plugin-techdocs-node@0.0.0-nightly-20250910023713
13
+ - @backstage/plugin-techdocs-node@0.0.0-nightly-20250912023732
14
14
 
15
15
  ## 1.9.8-next.0
16
16
 
@@ -404,67 +404,6 @@
404
404
  },
405
405
  "packageName": "@backstage/core-components"
406
406
  },
407
- {
408
- "path": "../../plugins/techdocs/config.d.ts",
409
- "value": {
410
- "type": "object",
411
- "properties": {
412
- "techdocs": {
413
- "description": "Configuration options for the techdocs plugin",
414
- "type": "object",
415
- "properties": {
416
- "builder": {
417
- "description": "Documentation building process depends on the builder attr",
418
- "visibility": "frontend",
419
- "enum": [
420
- "external",
421
- "local"
422
- ],
423
- "type": "string"
424
- },
425
- "legacyUseCaseSensitiveTripletPaths": {
426
- "description": "Allows fallback to case-sensitive triplets in case of migration issues.",
427
- "visibility": "frontend",
428
- "type": "boolean"
429
- },
430
- "sanitizer": {
431
- "type": "object",
432
- "properties": {
433
- "allowedIframeHosts": {
434
- "description": "Allows iframe tag only for listed hosts\nExample:\n allowedIframeHosts: [\"example.com\"]\n this will allow all iframes with the host `example.com` in the src attribute",
435
- "visibility": "frontend",
436
- "type": "array",
437
- "items": {
438
- "type": "string"
439
- }
440
- },
441
- "allowedCustomElementTagNameRegExp": {
442
- "description": "Allows listed custom element tag name regex\nExample:\n allowedCustomElementTagNameRegExp: '^backstage-'\n this will allow all custom elements with tag name matching `^backstage-` like <backstage-custom-element /> etc.",
443
- "visibility": "frontend",
444
- "type": "string"
445
- },
446
- "allowedCustomElementAttributeNameRegExp": {
447
- "description": "Allows listed custom element attribute name regex\nExample:\n allowedCustomElementAttributeNameRegExp: 'attribute1|attribute2'\n this will allow all custom element attributes matching `attribute1` or `attribute2` like <backstage-custom-element attribute1=\"yes\" attribute2/>",
448
- "visibility": "frontend",
449
- "type": "string"
450
- },
451
- "additionalAllowedURIProtocols": {
452
- "description": "Allows listed protocols in attributes with URI values\nExample:\n additionalAllowedURIProtocols: ['vscode']\n this will allow all attributes with URI values to have `vscode` protocol like `vscode://some/path` in addition to the default protocols\n matched by DOMPurify's IS_ALLOWED_URI RegExp:",
453
- "visibility": "frontend",
454
- "type": "string"
455
- }
456
- }
457
- }
458
- }
459
- }
460
- },
461
- "required": [
462
- "techdocs"
463
- ],
464
- "$schema": "http://json-schema.org/draft-07/schema#"
465
- },
466
- "packageName": "@backstage/plugin-techdocs"
467
- },
468
407
  {
469
408
  "path": "../integration/config.d.ts",
470
409
  "value": {
@@ -1196,69 +1135,84 @@
1196
1135
  "packageName": "@backstage/plugin-catalog"
1197
1136
  },
1198
1137
  {
1199
- "path": "../backend-plugin-api/config.d.ts",
1138
+ "path": "../../plugins/techdocs/config.d.ts",
1200
1139
  "value": {
1201
1140
  "type": "object",
1202
1141
  "properties": {
1203
- "backend": {
1142
+ "techdocs": {
1143
+ "description": "Configuration options for the techdocs plugin",
1204
1144
  "type": "object",
1205
1145
  "properties": {
1206
- "workingDirectory": {
1207
- "description": "An absolute path to a directory that can be used as a working dir, for\nexample as scratch space for large operations.",
1146
+ "builder": {
1147
+ "description": "Documentation building process depends on the builder attr",
1148
+ "visibility": "frontend",
1149
+ "enum": [
1150
+ "external",
1151
+ "local"
1152
+ ],
1208
1153
  "type": "string"
1154
+ },
1155
+ "legacyUseCaseSensitiveTripletPaths": {
1156
+ "description": "Allows fallback to case-sensitive triplets in case of migration issues.",
1157
+ "visibility": "frontend",
1158
+ "type": "boolean"
1159
+ },
1160
+ "sanitizer": {
1161
+ "type": "object",
1162
+ "properties": {
1163
+ "allowedIframeHosts": {
1164
+ "description": "Allows iframe tag only for listed hosts\nExample:\n allowedIframeHosts: [\"example.com\"]\n this will allow all iframes with the host `example.com` in the src attribute",
1165
+ "visibility": "frontend",
1166
+ "type": "array",
1167
+ "items": {
1168
+ "type": "string"
1169
+ }
1170
+ },
1171
+ "allowedCustomElementTagNameRegExp": {
1172
+ "description": "Allows listed custom element tag name regex\nExample:\n allowedCustomElementTagNameRegExp: '^backstage-'\n this will allow all custom elements with tag name matching `^backstage-` like <backstage-custom-element /> etc.",
1173
+ "visibility": "frontend",
1174
+ "type": "string"
1175
+ },
1176
+ "allowedCustomElementAttributeNameRegExp": {
1177
+ "description": "Allows listed custom element attribute name regex\nExample:\n allowedCustomElementAttributeNameRegExp: 'attribute1|attribute2'\n this will allow all custom element attributes matching `attribute1` or `attribute2` like <backstage-custom-element attribute1=\"yes\" attribute2/>",
1178
+ "visibility": "frontend",
1179
+ "type": "string"
1180
+ },
1181
+ "additionalAllowedURIProtocols": {
1182
+ "description": "Allows listed protocols in attributes with URI values\nExample:\n additionalAllowedURIProtocols: ['vscode']\n this will allow all attributes with URI values to have `vscode` protocol like `vscode://some/path` in addition to the default protocols\n matched by DOMPurify's IS_ALLOWED_URI RegExp:",
1183
+ "visibility": "frontend",
1184
+ "type": "string"
1185
+ }
1186
+ }
1209
1187
  }
1210
1188
  }
1211
1189
  }
1212
1190
  },
1191
+ "required": [
1192
+ "techdocs"
1193
+ ],
1213
1194
  "$schema": "http://json-schema.org/draft-07/schema#"
1214
1195
  },
1215
- "packageName": "@backstage/backend-plugin-api"
1196
+ "packageName": "@backstage/plugin-techdocs"
1216
1197
  },
1217
1198
  {
1218
- "path": "../../plugins/auth-backend-module-guest-provider/config.d.ts",
1199
+ "path": "../backend-plugin-api/config.d.ts",
1219
1200
  "value": {
1220
1201
  "type": "object",
1221
1202
  "properties": {
1222
- "auth": {
1223
- "description": "Configuration options for the auth plugin",
1203
+ "backend": {
1224
1204
  "type": "object",
1225
1205
  "properties": {
1226
- "providers": {
1227
- "type": "object",
1228
- "properties": {
1229
- "guest": {
1230
- "type": "object",
1231
- "properties": {
1232
- "userEntityRef": {
1233
- "description": "The entity reference to use for the guest user.",
1234
- "default": "user:development/guest",
1235
- "type": "string"
1236
- },
1237
- "ownershipEntityRefs": {
1238
- "description": "A list of entity references to user for ownership of the guest user if the user\n is not found in the catalog.",
1239
- "default": "[userEntityRef]",
1240
- "type": "array",
1241
- "items": {
1242
- "type": "string"
1243
- }
1244
- },
1245
- "dangerouslyAllowOutsideDevelopment": {
1246
- "description": "Allow users to sign in with the guest provider outside of their development environments.",
1247
- "type": "boolean"
1248
- }
1249
- }
1250
- }
1251
- }
1206
+ "workingDirectory": {
1207
+ "description": "An absolute path to a directory that can be used as a working dir, for\nexample as scratch space for large operations.",
1208
+ "type": "string"
1252
1209
  }
1253
- },
1254
- "required": [
1255
- "providers"
1256
- ]
1210
+ }
1257
1211
  }
1258
1212
  },
1259
1213
  "$schema": "http://json-schema.org/draft-07/schema#"
1260
1214
  },
1261
- "packageName": "@backstage/plugin-auth-backend-module-guest-provider"
1215
+ "packageName": "@backstage/backend-plugin-api"
1262
1216
  },
1263
1217
  {
1264
1218
  "path": "../../plugins/auth-backend/config.d.ts",
@@ -1395,6 +1349,52 @@
1395
1349
  },
1396
1350
  "packageName": "@backstage/plugin-auth-backend"
1397
1351
  },
1352
+ {
1353
+ "path": "../../plugins/auth-backend-module-guest-provider/config.d.ts",
1354
+ "value": {
1355
+ "type": "object",
1356
+ "properties": {
1357
+ "auth": {
1358
+ "description": "Configuration options for the auth plugin",
1359
+ "type": "object",
1360
+ "properties": {
1361
+ "providers": {
1362
+ "type": "object",
1363
+ "properties": {
1364
+ "guest": {
1365
+ "type": "object",
1366
+ "properties": {
1367
+ "userEntityRef": {
1368
+ "description": "The entity reference to use for the guest user.",
1369
+ "default": "user:development/guest",
1370
+ "type": "string"
1371
+ },
1372
+ "ownershipEntityRefs": {
1373
+ "description": "A list of entity references to user for ownership of the guest user if the user\n is not found in the catalog.",
1374
+ "default": "[userEntityRef]",
1375
+ "type": "array",
1376
+ "items": {
1377
+ "type": "string"
1378
+ }
1379
+ },
1380
+ "dangerouslyAllowOutsideDevelopment": {
1381
+ "description": "Allow users to sign in with the guest provider outside of their development environments.",
1382
+ "type": "boolean"
1383
+ }
1384
+ }
1385
+ }
1386
+ }
1387
+ }
1388
+ },
1389
+ "required": [
1390
+ "providers"
1391
+ ]
1392
+ }
1393
+ },
1394
+ "$schema": "http://json-schema.org/draft-07/schema#"
1395
+ },
1396
+ "packageName": "@backstage/plugin-auth-backend-module-guest-provider"
1397
+ },
1398
1398
  {
1399
1399
  "path": "../backend-app-api/config.d.ts",
1400
1400
  "value": {
@@ -1,4 +1,4 @@
1
- <!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Backstage is an open source framework for building developer portals"/><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"/><link rel="icon" href="/favicon.ico"/><link rel="shortcut icon" href="/favicon.ico"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"/><title>Techdocs Preview App</title><meta name="backstage-app-mode" content="public"><script defer="defer" src="/static/runtime.bd13797f.js"></script><script defer="defer" src="/static/module-material-ui.27b8440e.js"></script><script defer="defer" src="/static/module-lodash.9a2c3bdd.js"></script><script defer="defer" src="/static/module-date-fns.eb783be6.js"></script><script defer="defer" src="/static/module-mui.0878525e.js"></script><script defer="defer" src="/static/module-material-table.82bde846.js"></script><script defer="defer" src="/static/module-zod.f7599534.js"></script><script defer="defer" src="/static/module-react-dom.71e2a3dc.js"></script><script defer="defer" src="/static/module-i18next.668ff997.js"></script><script defer="defer" src="/static/module-react-beautiful-dnd.d3a32da9.js"></script><script defer="defer" src="/static/module-remix-run.825b4274.js"></script><script defer="defer" src="/static/vendor.bd13797f.js"></script><script defer="defer" src="/static/main.bd13797f.js"></script><script type="backstage.io/config">[
1
+ <!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Backstage is an open source framework for building developer portals"/><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"/><link rel="icon" href="/favicon.ico"/><link rel="shortcut icon" href="/favicon.ico"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"/><title>Techdocs Preview App</title><meta name="backstage-app-mode" content="public"><script defer="defer" src="/static/runtime.f2a9c2af.js"></script><script defer="defer" src="/static/module-material-ui.27b8440e.js"></script><script defer="defer" src="/static/module-lodash.9a2c3bdd.js"></script><script defer="defer" src="/static/module-date-fns.eb783be6.js"></script><script defer="defer" src="/static/module-mui.0878525e.js"></script><script defer="defer" src="/static/module-material-table.82bde846.js"></script><script defer="defer" src="/static/module-zod.f7599534.js"></script><script defer="defer" src="/static/module-react-dom.71e2a3dc.js"></script><script defer="defer" src="/static/module-i18next.668ff997.js"></script><script defer="defer" src="/static/module-react-beautiful-dnd.d3a32da9.js"></script><script defer="defer" src="/static/module-remix-run.825b4274.js"></script><script defer="defer" src="/static/vendor.f2a9c2af.js"></script><script defer="defer" src="/static/main.f2a9c2af.js"></script><script type="backstage.io/config">[
2
2
  {
3
3
  "context": "app-config.yaml",
4
4
  "data": {
@@ -42,7 +42,7 @@
42
42
  color="#5bbad5"
43
43
  />
44
44
  <title><%= config.getString('app.title') %></title>
45
- <meta name="backstage-app-mode" content="public"><meta name="backstage-public-path" content="<%= publicPath %>/"><script defer src="<%= publicPath %>/static/runtime.bd13797f.js"></script><script defer src="<%= publicPath %>/static/module-material-ui.27b8440e.js"></script><script defer src="<%= publicPath %>/static/module-lodash.9a2c3bdd.js"></script><script defer src="<%= publicPath %>/static/module-date-fns.eb783be6.js"></script><script defer src="<%= publicPath %>/static/module-mui.0878525e.js"></script><script defer src="<%= publicPath %>/static/module-material-table.82bde846.js"></script><script defer src="<%= publicPath %>/static/module-zod.f7599534.js"></script><script defer src="<%= publicPath %>/static/module-react-dom.71e2a3dc.js"></script><script defer src="<%= publicPath %>/static/module-i18next.668ff997.js"></script><script defer src="<%= publicPath %>/static/module-react-beautiful-dnd.d3a32da9.js"></script><script defer src="<%= publicPath %>/static/module-remix-run.825b4274.js"></script><script defer src="<%= publicPath %>/static/vendor.bd13797f.js"></script><script defer src="<%= publicPath %>/static/main.bd13797f.js"></script></head>
45
+ <meta name="backstage-app-mode" content="public"><meta name="backstage-public-path" content="<%= publicPath %>/"><script defer src="<%= publicPath %>/static/runtime.f2a9c2af.js"></script><script defer src="<%= publicPath %>/static/module-material-ui.27b8440e.js"></script><script defer src="<%= publicPath %>/static/module-lodash.9a2c3bdd.js"></script><script defer src="<%= publicPath %>/static/module-date-fns.eb783be6.js"></script><script defer src="<%= publicPath %>/static/module-mui.0878525e.js"></script><script defer src="<%= publicPath %>/static/module-material-table.82bde846.js"></script><script defer src="<%= publicPath %>/static/module-zod.f7599534.js"></script><script defer src="<%= publicPath %>/static/module-react-dom.71e2a3dc.js"></script><script defer src="<%= publicPath %>/static/module-i18next.668ff997.js"></script><script defer src="<%= publicPath %>/static/module-react-beautiful-dnd.d3a32da9.js"></script><script defer src="<%= publicPath %>/static/module-remix-run.825b4274.js"></script><script defer src="<%= publicPath %>/static/vendor.f2a9c2af.js"></script><script defer src="<%= publicPath %>/static/main.f2a9c2af.js"></script></head>
46
46
  <body>
47
47
  <noscript>You need to enable JavaScript to run this app.</noscript>
48
48
  <div id="root"></div>
@@ -0,0 +1,10 @@
1
+ "use strict";(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([["3058"],{23490:function(e,t,n){n.d(t,{O:()=>r});var a=n(73557);function r(e){return(0,a.UO)()}},5e4:function(e,t,n){n.d(t,{X2:()=>u,ce:()=>d,h$:()=>c});var a=n(52322),r=n(39381),s=n(60214),o=n(18011),i=n(88260);let l=(0,o.CT)("entity-context"),c=e=>{let{children:t,entity:n,loading:o,error:c,refresh:u}=e;return(0,a.jsx)(l.Provider,{value:(0,i.E)({1:{entity:n,loading:o,error:c,refresh:u}}),children:(0,a.jsx)(s.fC,{attributes:{...n?{entityRef:(0,r.eE)(n)}:void 0},children:t})})};function u(){let e=(0,o.Vt)("entity-context");if(!e)throw Error("Entity context is not available");let t=e.atVersion(1);if(!t)throw Error("EntityContext v1 not available");if(!t.entity)throw Error("useEntity hook is being called outside of an EntityLayout where the entity has not been loaded. If this is intentional, please use useAsyncEntity instead.");return{entity:t.entity}}function d(){let e=(0,o.Vt)("entity-context");if(!e)throw Error("Entity context is not available");let t=e.atVersion(1);if(!t)throw Error("EntityContext v1 not available");let{entity:n,loading:a,error:r,refresh:s}=t;return{entity:n,loading:a,error:r,refresh:s}}},55195:function(e,t,n){n.r(t),n.d(t,{Router:()=>A,EmbeddedDocsRouter:()=>$,TechDocsReaderRouter:()=>M,LegacyEmbeddedDocsRouter:()=>I,isTechDocsAvailable:()=>Z});var a=n(52322),r=n(73557),s=n(39381),o=n(99503),i=n(25942),l=n(98248),c=n(37065),u=n(33741),d=n(2784),h=n(93048),p=n(51173);let m=e=>e.replace(/\/+$/,""),x=({entity:e,withSearch:t=!0})=>{let n=(0,s.iB)(e),r=function(e){let{kind:t,name:n,namespace:a}=e,r=(0,h.t)(p.Fw),s=(0,h.t)(p.pd);return(0,d.useMemo)(()=>{let e=m(r({kind:t,namespace:a,name:n})),o=m(s());return t=>{if(t.toLocaleLowerCase("en-US").startsWith(e.toLocaleLowerCase("en-US"))){let n=t.slice(e.length).replace(/^\/+/,"");return 0===n.length||n.startsWith("#")?`${o}${n}`:`${o}/${n}`}return t}},[r,s,t,n,a])}(n);if(e.metadata.annotations?.[o.Un])try{n=(0,s.of)(e.metadata.annotations?.[o.Un])}catch{}let x=(0,i.IG)(e);return(0,a.jsxs)(l.I6,{entityRef:n,children:[(0,a.jsx)(u.b,{}),(0,a.jsx)(c.F,{withSearch:t,searchResultUrlMapper:r,defaultPath:x})]})};var g=n(84377),f=n(49447),y=n(5e4),j=n(53244),w=n(77277),v=n(79692),b=n(90436),C=n(24780),E=n(12753),k=n(13039);let S=(0,v.Z)(e=>({code:{borderRadius:6,margin:e.spacing(2,0),background:"dark"===e.palette.type?"#444":e.palette.common.white}}),{name:"BackstageMissingAnnotationEmptyState"});function R(e){let t;try{t=(0,y.X2)().entity}catch(e){}let{annotation:n,readMoreUrl:r}=e,s=Array.isArray(n)?n:[n],o=S(),i=t?.kind||"Component",{yamlText:l,lineNumbers:c}=function(e,t){let n=t?.kind||"Component",a=t?.metadata.name||"example",r=t?.spec?.type||"website",s=t?.spec?.owner||"user:default/guest",o=`apiVersion: backstage.io/v1alpha1
2
+ kind: ${n}
3
+ metadata:
4
+ name: ${a}
5
+ annotations:${e.map(e=>`
6
+ ${e}: value`).join("")}
7
+ spec:
8
+ type: ${r}
9
+ owner: ${s}`,i=6,l=[];return e.forEach(()=>{l.push(i),i++}),{yamlText:o,lineNumbers:l}}(s,t);return(0,a.jsx)(C.u,{missing:"field",title:"Missing Annotation",description:function(e,t="Component"){let n=e.length<=1;return(0,a.jsxs)(a.Fragment,{children:["The ",n?"annotation":"annotations"," ",e.map(e=>(0,a.jsx)("code",{children:e})).reduce((e,t)=>(0,a.jsxs)(a.Fragment,{children:[e,", ",t]}))," ",n?"is":"are"," missing. You need to add the"," ",n?"annotation":"annotations"," to your ",t," if you want to enable this tool."]})}(s,i),action:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(b.Z,{variant:"body1",children:["Add the annotation to your ",i," YAML as shown in the highlighted example below:"]}),(0,a.jsx)(j.Z,{className:o.code,children:(0,a.jsx)(E.O,{text:l,language:"yaml",showLineNumbers:!0,highlightedNumbers:c,customStyle:{background:"inherit",fontSize:"115%"}})}),(0,a.jsx)(w.Z,{color:"primary",component:k.rU,to:r||"https://backstage.io/docs/features/software-catalog/well-known-annotations",children:"Read more"})]})})}let Z=e=>!!e?.metadata?.annotations?.[o.w5]||!!e?.metadata?.annotations?.[o.Un],A=()=>(0,a.jsxs)(r.Z5,{children:[(0,a.jsx)(r.AW,{path:"/",element:(0,a.jsx)(g.TechDocsIndexPage,{})}),(0,a.jsx)(r.AW,{path:"/:namespace/:kind/:name/*",element:(0,a.jsx)(f.I,{})})]}),M=e=>{let{children:t}=e;return(0,r.V$)([{path:"*",element:(0,a.jsx)(f.I,{}),children:[{path:"*",element:t}]}])},$=e=>{let{children:t,emptyState:n,withSearch:s=!0}=e,{entity:i}=(0,y.X2)(),l=(0,r.V$)([{path:"/*",element:(0,a.jsx)(x,{entity:i,withSearch:s}),children:[{path:"*",element:t}]}]);return i.metadata.annotations?.[o.w5]||i.metadata.annotations?.[o.Un]?l:n??(0,a.jsx)(R,{annotation:[o.w5]})},I=({children:e,withSearch:t=!0})=>(0,a.jsx)($,{children:e,withSearch:t})},84377:function(e,t,n){n.r(t),n.d(t,{TechDocsIndexPage:()=>o});var a=n(52322),r=n(73557),s=n(74556);let o=e=>(0,r.pC)()||(0,a.jsx)(s.u,{...e})},49447:function(e,t,n){n.d(t,{r:()=>T,I:()=>_});var a=n(52322),r=n(2784),s=n(73557),o=n(64796),i=n(25942),l=n(98049),c=n(31546),u=n(99503),d=n(4812),h=n(37065),p=n(99064),m=n(33741),x=n(51173),g=n(23490),f=n(16162),y=n(93048),j=n(32904),w=n(33414),v=n(40098),b=n(77277),C=n(42412),E=n(51943),k=n(6020),S=n(91246),R=n(26291);function Z(e){let{children:t,...n}=e,{Progress:s}=(0,v.q)().getComponents(),o=function(e){let{pluginId:t}=e??{},n=(0,f.h_)(C.g),a=(0,f.h_)(E.N),s=(0,r.useMemo)(()=>"BroadcastChannel"in window?new BroadcastChannel(`${t}-auth-cookie-expires-at`):null,[t]),[o,i]=function(e,t){let[n,a]=(0,r.useState)({status:"not-executed",error:void 0,result:void 0}),s=(0,r.useRef)(),o=(0,r.useRef)(),i=(0,k.x)({execute(...t){o.current=t;let n=e(...t);return s.current=n,a(e=>({...e,status:"loading"})),n.then(e=>{n===s.current&&a(t=>({...t,status:"success",error:void 0,result:e}))},e=>{n===s.current&&a(t=>({...t,status:"error",error:e}))}),n},reset(){a({status:"not-executed",error:void 0,result:void 0}),s.current=void 0,o.current=void 0}});return[n,(0,r.useMemo)(()=>({reset(){i.current.reset()},execute:(...e)=>i.current.execute(...e)}),[]),{promise:s.current,lastArgs:o.current}]}(async()=>{let e=await a.getBaseUrl(t),r=`${e}/.backstage/auth/v1/cookie`,s=await n.fetch(`${r}`,{credentials:"include"});if(!s.ok){if(404===s.status)return{expiresAt:new Date(Date.now()+31536e6)};throw await R.V.fromResponse(s)}let o=await s.json();if(!o.expiresAt)throw Error("No expiration date found in response");return o});(0,S.n)(i.execute);let l=(0,r.useCallback)(()=>{i.execute()},[i]),c=(0,r.useCallback)(e=>{let t=(1+3*Math.random())*6e4,n=setTimeout(l,Date.parse(e.expiresAt)-Date.now()-t);return()=>clearTimeout(n)},[l]);return((0,r.useEffect)(()=>{if("success"!==o.status||!o.result)return()=>{};s?.postMessage({action:"COOKIE_REFRESH_SUCCESS",payload:o.result});let e=c(o.result),t=t=>{let{action:n,payload:a}=t.data;"COOKIE_REFRESH_SUCCESS"===n&&(e(),e=c(a))};return s?.addEventListener("message",t),()=>{e(),s?.removeEventListener("message",t)}},[o,c,s]),"not-executed"===o.status||"loading"===o.status&&!o.result||"loading"===o.status&&o.error)?{status:"loading"}:"error"===o.status&&o.error?{status:"error",error:o.error,retry:l}:{status:"success",data:o.result}}(n);return"loading"===o.status?(0,a.jsx)(s,{}):"error"===o.status?(0,a.jsx)(w.y,{error:o.error,children:(0,a.jsx)(b.Z,{variant:"outlined",onClick:o.retry,children:"Retry"})}):(0,a.jsx)(a.Fragment,{children:t})}var A=n(84081),M=n(36363),$=n(60364),I=n(84620),L=n(41547),F=n(77344);let T=e=>{let{withSearch:t,withHeader:n=!0}=e;return(0,a.jsxs)(o.T,{themeId:"documentation",children:[n&&(0,a.jsx)(p.S,{}),(0,a.jsx)(m.b,{}),(0,a.jsx)(h.F,{withSearch:t})]})},U=(0,M.Z)(o.T)({height:"inherit",overflowY:"visible"}),_=e=>{let t=(0,$.Z)(),n=(0,r.useMemo)(()=>(0,I.Z)({...t,...e.overrideThemeOptions||{}}),[t,e.overrideThemeOptions]),{kind:o,name:h,namespace:p}=(0,g.O)(x.Fw),{children:m,entityRef:w={kind:o,name:h,namespace:p}}=e,v=(0,s.pC)(),b=(0,f.h_)(A.A),C=(0,s.s0)(),E=(0,y.t)(x.Fw),k=(0,r.useMemo)(()=>({kind:w.kind,name:w.name,namespace:w.namespace}),[w.kind,w.name,w.namespace]),S=(0,d.Z)(async()=>{try{let e=await b.getEntityByRef(k);if(e?.metadata?.annotations?.[u.Un])return(0,i.Li)(e,E)}catch(e){}},[k,b,E]),R=(0,r.useCallback)(e=>{C(e,{replace:!0})},[C]);(0,r.useEffect)(()=>{!S.loading&&S.value&&R(S.value)},[S.loading,S.value,R]);let M=(0,r.useMemo)(()=>m?null:(v?r.Children.toArray(v.props.children):[]).flatMap(e=>e?.props?.children??[]).find(e=>!(0,j.I)(e,l.Zz)&&!(0,j.I)(e,l.jM)),[m,v]);return S.loading||S.value?(0,a.jsx)(F.E,{}):m?(0,a.jsx)(L.Z,{theme:n,children:(0,a.jsx)(Z,{pluginId:"techdocs",children:(0,a.jsx)(c.Z,{entityRef:k,children:({metadata:e,entityMetadata:t,onReady:n})=>(0,a.jsx)(U,{themeId:"documentation",className:"techdocs-reader-page",children:m instanceof Function?m({entityRef:k,techdocsMetadataValue:e.value,entityMetadataValue:t.value,onReady:n}):m})})})}):(0,a.jsx)(L.Z,{theme:n,children:(0,a.jsx)(Z,{pluginId:"techdocs",children:(0,a.jsx)(c.Z,{entityRef:k,children:M||(0,a.jsx)(T,{})})})})}},33741:function(e,t,n){n.d(t,{b:()=>g});var a=n(52322),r=n(2784),s=n(79692),o=n(61837),i=n(15223),l=n(80030),c=n(48348),u=n(53244),d=n(47603),h=n(31546),p=n(98049),m=n(63424);let x=(0,s.Z)(e=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:e.spacing(3,3,0),"@media print":{display:"none"}}})),g=e=>{let t=x(),[n,s]=(0,r.useState)(null),g=(0,r.useCallback)(e=>{s(e.currentTarget)},[]),f=(0,r.useCallback)(()=>{s(null)},[]),{entityMetadata:{value:y,loading:j}}=(0,h.x)(),w=(0,p.$L)(),v=w.renderComponentsByLocation(m.o.Subheader),b=w.renderComponentsByLocation(m.o.Settings);return(v||b)&&(!1!==j||y)?(0,a.jsx)(i.Z,{classes:t,...e.toolbarProps,children:(0,a.jsxs)(u.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[v,b?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.ZP,{title:"Settings",children:(0,a.jsx)(o.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:g,children:(0,a.jsx)(d.default,{})})}),(0,a.jsx)(c.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:n,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:!!n,onClose:f,keepMounted:!0,children:(0,a.jsx)("div",{children:b})})]}):null]})}):null}}}]);
10
+ //# sourceMappingURL=3058.79958f5c.chunk.js.map