@wildo-ai/saas-technical-doc 1.1.5 → 1.1.7

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.
Files changed (156) hide show
  1. package/dist/esm/build/csp-emit.d.ts.map +1 -1
  2. package/dist/esm/build/load-materialized-frontend-providers.d.ts.map +1 -1
  3. package/dist/esm/companion/application-documentation/application-authentication-documentation.d.ts.map +1 -1
  4. package/dist/esm/companion/application-documentation/application-connection-documentation.d.ts.map +1 -1
  5. package/dist/esm/companion/application-documentation/application-documentation-chapters.d.ts.map +1 -1
  6. package/dist/esm/companion/application-documentation/application-organization-role-documentation.d.ts.map +1 -1
  7. package/dist/esm/companion/application-documentation/application-organization-unit-resource-documentation.d.ts.map +1 -1
  8. package/dist/esm/companion/application-documentation/docs-api-origin-substitution.d.ts.map +1 -1
  9. package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.d.ts.map +1 -1
  10. package/dist/esm/companion/application-documentation/technical-documentation-operational-evidence.d.ts.map +1 -1
  11. package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.d.ts.map +1 -1
  12. package/dist/esm/companion/application-documentation/technical-documentation-publication-policy.d.ts.map +1 -1
  13. package/dist/esm/companion/content/application-consumer-documentation-content-loader.d.ts.map +1 -1
  14. package/dist/esm/companion/index.d.ts.map +1 -1
  15. package/dist/esm/companion/manual-controller-route-projection.d.ts.map +1 -1
  16. package/dist/esm/companion/openapi-example-derivation.d.ts +53 -0
  17. package/dist/esm/companion/openapi-example-derivation.d.ts.map +1 -0
  18. package/dist/esm/companion/openapi-example-derivation.js +229 -0
  19. package/dist/esm/companion/openapi-example-derivation.js.map +1 -0
  20. package/dist/esm/companion/openapi-generator.d.ts.map +1 -1
  21. package/dist/esm/companion/openapi-generator.js +284 -16
  22. package/dist/esm/companion/openapi-generator.js.map +1 -1
  23. package/dist/esm/companion/operation-projection.schemas.d.ts +36 -0
  24. package/dist/esm/companion/operation-projection.schemas.d.ts.map +1 -1
  25. package/dist/esm/companion/operation-projection.schemas.js +18 -0
  26. package/dist/esm/companion/operation-projection.schemas.js.map +1 -1
  27. package/dist/esm/companion/publish-result.types.d.ts.map +1 -1
  28. package/dist/esm/companion/rendering/technical-documentation-authorized-bundle-reader.d.ts.map +1 -1
  29. package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.d.ts.map +1 -1
  30. package/dist/esm/companion/rendering/technical-documentation-managed-tree-validator.d.ts.map +1 -1
  31. package/dist/esm/companion/rendering/technical-documentation-managed-tree-validator.js +20 -0
  32. package/dist/esm/companion/rendering/technical-documentation-managed-tree-validator.js.map +1 -1
  33. package/dist/esm/companion/rendering/technical-documentation-markdown-links.d.ts.map +1 -1
  34. package/dist/esm/companion/rendering/technical-documentation-openapi-renderer.d.ts +2 -0
  35. package/dist/esm/companion/rendering/technical-documentation-openapi-renderer.d.ts.map +1 -1
  36. package/dist/esm/companion/rendering/technical-documentation-openapi-renderer.js +48 -31
  37. package/dist/esm/companion/rendering/technical-documentation-openapi-renderer.js.map +1 -1
  38. package/dist/esm/companion/rendering/technical-documentation-render-model.d.ts.map +1 -1
  39. package/dist/esm/companion/rendering/technical-documentation-search-index-renderer.d.ts.map +1 -1
  40. package/dist/esm/companion/spec-to-operation-doc.d.ts +52 -10
  41. package/dist/esm/companion/spec-to-operation-doc.d.ts.map +1 -1
  42. package/dist/esm/companion/spec-to-operation-doc.js +125 -7
  43. package/dist/esm/companion/spec-to-operation-doc.js.map +1 -1
  44. package/dist/esm/companion/technical-documentation-asset-path.d.ts.map +1 -1
  45. package/dist/esm/companion/technical-documentation-capture-execution-port.d.ts.map +1 -1
  46. package/dist/esm/companion/technical-documentation-diagram-definitions.d.ts.map +1 -1
  47. package/dist/esm/companion/technical-documentation-diagram-materializer.d.ts.map +1 -1
  48. package/dist/esm/companion/technical-documentation-placeholder-materializer.d.ts.map +1 -1
  49. package/dist/esm/companion/zod-to-openapi.d.ts.map +1 -1
  50. package/dist/esm/companion-exports.d.ts.map +1 -1
  51. package/dist/esm/config/define-tech-doc-config.d.ts.map +1 -1
  52. package/dist/esm/config/index.d.ts.map +1 -1
  53. package/dist/esm/config/wildo-tech-doc-config.schemas.d.ts.map +1 -1
  54. package/dist/esm/content/application-consumer-documentation-content-manifest.schemas.d.ts.map +1 -1
  55. package/dist/esm/content/application-consumer-documentation-content.techdoc.d.ts +10 -10
  56. package/dist/esm/content/application-consumer-documentation-content.techdoc.d.ts.map +1 -1
  57. package/dist/esm/content/application-consumer-documentation-content.techdoc.js +43 -28
  58. package/dist/esm/content/application-consumer-documentation-content.techdoc.js.map +1 -1
  59. package/dist/esm/content.exports.d.ts.map +1 -1
  60. package/dist/esm/index.d.ts.map +1 -1
  61. package/dist/esm/openapi/api-reference-link-index.d.ts +3 -0
  62. package/dist/esm/openapi/api-reference-link-index.d.ts.map +1 -1
  63. package/dist/esm/openapi/api-reference-link-index.js +26 -15
  64. package/dist/esm/openapi/api-reference-link-index.js.map +1 -1
  65. package/dist/esm/openapi/api-reference-pages.d.ts +55 -0
  66. package/dist/esm/openapi/api-reference-pages.d.ts.map +1 -0
  67. package/dist/esm/openapi/api-reference-pages.js +229 -0
  68. package/dist/esm/openapi/api-reference-pages.js.map +1 -0
  69. package/dist/esm/openapi/api-reference-search.d.ts +53 -0
  70. package/dist/esm/openapi/api-reference-search.d.ts.map +1 -0
  71. package/dist/esm/openapi/api-reference-search.js +100 -0
  72. package/dist/esm/openapi/api-reference-search.js.map +1 -0
  73. package/dist/esm/openapi/api-reference-targets.d.ts +11 -0
  74. package/dist/esm/openapi/api-reference-targets.d.ts.map +1 -1
  75. package/dist/esm/openapi/api-reference-targets.js +8 -0
  76. package/dist/esm/openapi/api-reference-targets.js.map +1 -1
  77. package/dist/esm/openapi/index.d.ts +2 -0
  78. package/dist/esm/openapi/index.d.ts.map +1 -1
  79. package/dist/esm/openapi/index.js +2 -0
  80. package/dist/esm/openapi/index.js.map +1 -1
  81. package/dist/esm/openapi/openapi-generation-output.schemas.d.ts.map +1 -1
  82. package/dist/esm/openapi-reference-model.exports.d.ts +2 -0
  83. package/dist/esm/openapi-reference-model.exports.d.ts.map +1 -1
  84. package/dist/esm/openapi-reference-model.exports.js +2 -0
  85. package/dist/esm/openapi-reference-model.exports.js.map +1 -1
  86. package/dist/esm/runtime/AuthExchangePage.d.ts +45 -4
  87. package/dist/esm/runtime/AuthExchangePage.d.ts.map +1 -1
  88. package/dist/esm/runtime/AuthExchangePage.js +45 -12
  89. package/dist/esm/runtime/AuthExchangePage.js.map +1 -1
  90. package/dist/esm/runtime/DocsAuthContext.d.ts.map +1 -1
  91. package/dist/esm/runtime/DocsFrontendProviders.d.ts +15 -1
  92. package/dist/esm/runtime/DocsFrontendProviders.d.ts.map +1 -1
  93. package/dist/esm/runtime/DocsFrontendProviders.js +16 -3
  94. package/dist/esm/runtime/DocsFrontendProviders.js.map +1 -1
  95. package/dist/esm/runtime/DocsProviderComponent.d.ts +41 -0
  96. package/dist/esm/runtime/DocsProviderComponent.d.ts.map +1 -0
  97. package/dist/esm/runtime/DocsProviderComponent.js +17 -0
  98. package/dist/esm/runtime/DocsProviderComponent.js.map +1 -0
  99. package/dist/esm/runtime/decode-jwt-claims.d.ts.map +1 -1
  100. package/dist/esm/runtime/docs-auth-client.d.ts.map +1 -1
  101. package/dist/esm/runtime/docs-auth-session.schemas.d.ts.map +1 -1
  102. package/dist/esm/runtime/documentation-site-translator.d.ts +53 -0
  103. package/dist/esm/runtime/documentation-site-translator.d.ts.map +1 -0
  104. package/dist/esm/runtime/documentation-site-translator.js +51 -0
  105. package/dist/esm/runtime/documentation-site-translator.js.map +1 -0
  106. package/dist/esm/runtime/frontend-provider-registry.techdoc.d.ts.map +1 -1
  107. package/dist/esm/runtime/index.d.ts +6 -0
  108. package/dist/esm/runtime/index.d.ts.map +1 -1
  109. package/dist/esm/runtime/index.js +6 -0
  110. package/dist/esm/runtime/index.js.map +1 -1
  111. package/dist/esm/runtime/openapi-reference-conservation.d.ts.map +1 -1
  112. package/dist/esm/runtime/openapi-reference-model.d.ts +25 -0
  113. package/dist/esm/runtime/openapi-reference-model.d.ts.map +1 -1
  114. package/dist/esm/runtime/openapi-reference-model.js +82 -13
  115. package/dist/esm/runtime/openapi-reference-model.js.map +1 -1
  116. package/dist/esm/runtime/openapi-reference-navigation.d.ts +50 -0
  117. package/dist/esm/runtime/openapi-reference-navigation.d.ts.map +1 -0
  118. package/dist/esm/runtime/openapi-reference-navigation.js +46 -0
  119. package/dist/esm/runtime/openapi-reference-navigation.js.map +1 -0
  120. package/dist/esm/runtime/openapi-reference-samples.d.ts +40 -0
  121. package/dist/esm/runtime/openapi-reference-samples.d.ts.map +1 -0
  122. package/dist/esm/runtime/openapi-reference-samples.js +169 -0
  123. package/dist/esm/runtime/openapi-reference-samples.js.map +1 -0
  124. package/dist/esm/runtime/openapi-reference-styles.d.ts +28 -0
  125. package/dist/esm/runtime/openapi-reference-styles.d.ts.map +1 -0
  126. package/dist/esm/runtime/openapi-reference-styles.js +292 -0
  127. package/dist/esm/runtime/openapi-reference-styles.js.map +1 -0
  128. package/dist/esm/runtime/openapi-reference-view.d.ts +40 -5
  129. package/dist/esm/runtime/openapi-reference-view.d.ts.map +1 -1
  130. package/dist/esm/runtime/openapi-reference-view.js +828 -82
  131. package/dist/esm/runtime/openapi-reference-view.js.map +1 -1
  132. package/dist/esm/runtime/openapi-reference-words-context.d.ts +12 -0
  133. package/dist/esm/runtime/openapi-reference-words-context.d.ts.map +1 -0
  134. package/dist/esm/runtime/openapi-reference-words-context.js +30 -0
  135. package/dist/esm/runtime/openapi-reference-words-context.js.map +1 -0
  136. package/dist/esm/runtime/openapi-reference-words.d.ts +205 -0
  137. package/dist/esm/runtime/openapi-reference-words.d.ts.map +1 -0
  138. package/dist/esm/runtime/openapi-reference-words.js +162 -0
  139. package/dist/esm/runtime/openapi-reference-words.js.map +1 -0
  140. package/dist/esm/runtime/provider-component-registry.techdoc.d.ts +31 -0
  141. package/dist/esm/runtime/provider-component-registry.techdoc.d.ts.map +1 -0
  142. package/dist/esm/runtime/provider-component-registry.techdoc.js +35 -0
  143. package/dist/esm/runtime/provider-component-registry.techdoc.js.map +1 -0
  144. package/dist/esm/runtime/use-docs-auth-session.d.ts.map +1 -1
  145. package/dist/esm/runtime/use-docs-frontend-provider-registry.d.ts.map +1 -1
  146. package/dist/esm/runtime/use-docs-provider-component.d.ts +29 -0
  147. package/dist/esm/runtime/use-docs-provider-component.d.ts.map +1 -0
  148. package/dist/esm/runtime/use-docs-provider-component.js +42 -0
  149. package/dist/esm/runtime/use-docs-provider-component.js.map +1 -0
  150. package/dist/esm/runtime/use-docs-provider-scripts.d.ts +12 -5
  151. package/dist/esm/runtime/use-docs-provider-scripts.d.ts.map +1 -1
  152. package/dist/esm/runtime/use-docs-provider-scripts.js +15 -8
  153. package/dist/esm/runtime/use-docs-provider-scripts.js.map +1 -1
  154. package/dist/esm/runtime/use-docs-provider-sdks.d.ts.map +1 -1
  155. package/dist/tsconfig.build.tsbuildinfo +1 -1
  156. package/package.json +6 -6
@@ -313,6 +313,17 @@ export declare const OperationProjectionSchema: z.ZodObject<{
313
313
  headerName: z.ZodString;
314
314
  required: z.ZodBoolean;
315
315
  }, z.core.$strict>>;
316
+ /**
317
+ * Present only when the resolved variant declares `submissionChallenge` (#1985): the answer header's name and the path a
318
+ * caller fetches a proof-of-work challenge from (both projected from the framework's named constants, never retyped).
319
+ * The generator documents the header as OPTIONAL, because whether it is asked depends on two facts the reference cannot
320
+ * fix: that the application declares a captcha provider, and that the caller is not signed in. It says so, and lists the
321
+ * two 400 refusals.
322
+ */
323
+ submissionChallenge: z.ZodOptional<z.ZodObject<{
324
+ headerName: z.ZodString;
325
+ proofOfWorkChallengePath: z.ZodString;
326
+ }, z.core.$strict>>;
316
327
  summary: z.ZodOptional<z.ZodString>;
317
328
  description: z.ZodOptional<z.ZodString>;
318
329
  /**
@@ -384,9 +395,16 @@ export declare const OperationProjectionSchema: z.ZodObject<{
384
395
  code: z.ZodString;
385
396
  meaning: z.ZodString;
386
397
  }, z.core.$strict>>>;
398
+ /**
399
+ * Documented failure modes. `errorType` / `customMessageReference` / `errorCode` are the
400
+ * `error.type` / `error.customMessageReference` / `error.code` values of the error body — three
401
+ * fields a client branches on, kept apart because a client reads them from different places.
402
+ */
387
403
  errorScenarios: z.ZodOptional<z.ZodArray<z.ZodObject<{
388
404
  code: z.ZodString;
389
405
  when: z.ZodString;
406
+ errorType: z.ZodOptional<z.ZodString>;
407
+ customMessageReference: z.ZodOptional<z.ZodString>;
390
408
  errorCode: z.ZodOptional<z.ZodString>;
391
409
  }, z.core.$strict>>>;
392
410
  idempotent: z.ZodOptional<z.ZodBoolean>;
@@ -679,6 +697,17 @@ export declare const OpenApiGenerationInputSchema: z.ZodObject<{
679
697
  headerName: z.ZodString;
680
698
  required: z.ZodBoolean;
681
699
  }, z.core.$strict>>;
700
+ /**
701
+ * Present only when the resolved variant declares `submissionChallenge` (#1985): the answer header's name and the path a
702
+ * caller fetches a proof-of-work challenge from (both projected from the framework's named constants, never retyped).
703
+ * The generator documents the header as OPTIONAL, because whether it is asked depends on two facts the reference cannot
704
+ * fix: that the application declares a captcha provider, and that the caller is not signed in. It says so, and lists the
705
+ * two 400 refusals.
706
+ */
707
+ submissionChallenge: z.ZodOptional<z.ZodObject<{
708
+ headerName: z.ZodString;
709
+ proofOfWorkChallengePath: z.ZodString;
710
+ }, z.core.$strict>>;
682
711
  summary: z.ZodOptional<z.ZodString>;
683
712
  description: z.ZodOptional<z.ZodString>;
684
713
  /**
@@ -750,9 +779,16 @@ export declare const OpenApiGenerationInputSchema: z.ZodObject<{
750
779
  code: z.ZodString;
751
780
  meaning: z.ZodString;
752
781
  }, z.core.$strict>>>;
782
+ /**
783
+ * Documented failure modes. `errorType` / `customMessageReference` / `errorCode` are the
784
+ * `error.type` / `error.customMessageReference` / `error.code` values of the error body — three
785
+ * fields a client branches on, kept apart because a client reads them from different places.
786
+ */
753
787
  errorScenarios: z.ZodOptional<z.ZodArray<z.ZodObject<{
754
788
  code: z.ZodString;
755
789
  when: z.ZodString;
790
+ errorType: z.ZodOptional<z.ZodString>;
791
+ customMessageReference: z.ZodOptional<z.ZodString>;
756
792
  errorCode: z.ZodOptional<z.ZodString>;
757
793
  }, z.core.$strict>>>;
758
794
  idempotent: z.ZodOptional<z.ZodBoolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"operation-projection.schemas.d.ts","sourceRoot":"","sources":["../../../../src/companion/operation-projection.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAE9E;;;;;;;;;;;;GAYG;AACH,oBAAY,8BAA8B;IACxC,QAAQ,aAAa;IACrB,sBAAsB,2BAA2B;CAClD;AAED;;;;;;;;;GASG;AACH,oBAAY,+BAA+B;IACzC,SAAS,cAAc;IACvB,aAAa,kBAAkB;IAC/B,WAAW,iBAAiB;IAC5B,SAAS,cAAc;CACxB;AAED;;;;;;;;;GASG;AACH,oBAAY,2BAA2B;IACrC,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAED;;;;;GAKG;AACH,oBAAY,qCAAqC;IAC/C,MAAM,WAAW;IACjB,iBAAiB,sBAAsB;IACvC,aAAa,kBAAkB;IAC/B,0BAA0B,+BAA+B;CAC1D;AAED;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B;;;;;kBAKzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;kBAI7C,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,C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;;OAMG;;IAEH,gFAAgF;;kBAEhF,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,4BAA4B;IACvC;;;;;;;OAOG;;IAEH;;;;;OAKG;;IAEH;;;;OAIG;;IAEH,sFAAsF;;IAEtF;;;;OAIG;;;;QApZH;;;;;;;;;;WAUG;;QAEH,oFAAoF;;;;;;QAMpF;;;;WAIG;;QAEH;;;;WAIG;;;;;;;;;;;QASH;;;;WAIG;;;;;;;;;;;;;;;;;QAQH;;;;WAIG;;;;;QAKH;;;;;;WAMG;;;;;;;QAOH;;;;;;;;;;WAUG;;QAEH;;;;;WAKG;;QAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;WA2BG;;;;;QAKH;;;;WAIG;;QAEH;;;;;;;WAOG;;;;;QAKH;;;;WAIG;;;;;;;;;QASH;;;;;;;;WAQG;;YAED,yDAAyD;;YAEzD,iGAAiG;;;;;;;;;;;;IAiPnG;;;;;;;OAOG;;IAEH;;;;;OAKG;;QAtFH,8EAA8E;;QAE9E,qDAAqD;;QAErD,8EAA8E;;QAE9E,6DAA6D;;;YAlD7D,4EAA4E;;;;;;;;;;;;;QAoD5E,oEAAoE;;YA1BpE,wEAAwE;;YAExE,gEAAgE;;YAEhE,8EAA8E;;;;IAsG9E;;;;;;OAMG;;QAvEH;;;;;;WAMG;;QAEH,gFAAgF;;;IAiEhF;;;;;;;OAOG;;kBAEH,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
@@ -306,6 +306,17 @@ export const OperationProjectionSchema = z.strictObject({
306
306
  headerName: z.string().min(1),
307
307
  required: z.boolean(),
308
308
  }).optional(),
309
+ /**
310
+ * Present only when the resolved variant declares `submissionChallenge` (#1985): the answer header's name and the path a
311
+ * caller fetches a proof-of-work challenge from (both projected from the framework's named constants, never retyped).
312
+ * The generator documents the header as OPTIONAL, because whether it is asked depends on two facts the reference cannot
313
+ * fix: that the application declares a captcha provider, and that the caller is not signed in. It says so, and lists the
314
+ * two 400 refusals.
315
+ */
316
+ submissionChallenge: z.strictObject({
317
+ headerName: z.string().min(1),
318
+ proofOfWorkChallengePath: z.string().min(1),
319
+ }).optional(),
309
320
  summary: z.string().min(1).max(200).optional(),
310
321
  description: z.string().min(1).max(2000).optional(),
311
322
  /**
@@ -377,9 +388,16 @@ export const OperationProjectionSchema = z.strictObject({
377
388
  code: z.string().min(1),
378
389
  meaning: z.string().min(1),
379
390
  })).optional(),
391
+ /**
392
+ * Documented failure modes. `errorType` / `customMessageReference` / `errorCode` are the
393
+ * `error.type` / `error.customMessageReference` / `error.code` values of the error body — three
394
+ * fields a client branches on, kept apart because a client reads them from different places.
395
+ */
380
396
  errorScenarios: z.array(z.strictObject({
381
397
  code: z.string().min(1),
382
398
  when: z.string().min(1),
399
+ errorType: z.string().min(1).optional(),
400
+ customMessageReference: z.string().min(1).optional(),
383
401
  errorCode: z.string().min(1).optional(),
384
402
  })).optional(),
385
403
  idempotent: z.boolean().optional(),
@@ -1 +1 @@
1
- {"version":3,"file":"operation-projection.schemas.js","sourceRoot":"","sources":["../../../../src/companion/operation-projection.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,OAAO,EAAE,+CAA+C,EAAE,MAAM,uDAAuD,CAAC;AACxH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAE9E;;;;;;;;;;;;GAYG;AACH,MAAM,CAAN,IAAY,8BAGX;AAHD,WAAY,8BAA8B;IACxC,uDAAqB,CAAA;IACrB,mFAAiD,CAAA;AACnD,CAAC,EAHW,8BAA8B,KAA9B,8BAA8B,QAGzC;AAED;;;;;;;;;GASG;AACH,MAAM,CAA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mBAAmB,EAAE,CAAC,CAAC,OAAO,EAAE;IAChC;;;;;OAKG;IACH,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,QAAQ,EAAE;IACnD;;;;;;OAMG;IACH,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,QAAQ,EAAE;IAChD;;;;;;;OAOG;IACH,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;CACpD,CAAC,CAAC","sourcesContent":["/**\n * @wildo-package @wildo-ai/saas-technical-doc/companion (input projection)\n *\n * Input shape consumed by the companion-side OpenAPI generator\n * (saas-technical-doc.md Step 3).\n *\n * Why a dedicated projection (and NOT importing `ResourcesRegistry` from\n * `@wildo-ai/saas-models`):\n *\n * - The full `ResourceConfiguration` carries ~40 internal-only fields\n * (factory metadata, repository wiring, validation hooks, frontend\n * presets, lifecycle bindings, …). The OpenAPI generator does NOT need\n * any of them — it needs ONLY operation-level HTTP shape data\n * (method + path + request/response Zod schemas + role binding +\n * primary scope + authentication-mode flags). Coupling the\n * generator to the full type would (a) drag the entire schema graph\n * + decorator framework into the companion bundle, defeating the\n * point of `@wildo-ai/saas-models/public-runtime`; (b) couple test\n * fixtures to dozens of irrelevant fields, making generator unit\n * tests brittle to unrelated framework changes; (c) make the\n * introspection-subprocess hop's wire format depend on the entire\n * framework's type stability.\n *\n * - The introspection subprocess (wonder-todos backend) ALREADY has\n * the resolved `ResourceConfiguration` graph — it's the natural\n * place to flatten it into this minimal projection. The companion\n * process then transforms the projection into YAML without ever\n * needing the framework's resource-config types.\n *\n * - This file re-declares the small subset of enums/literals the\n * projection carries (`ResourceOperationVariantTypeProjection`,\n * `ResourcePrimaryScopeProjection`) rather than importing them from\n * `@wildo-ai/saas-models` so that `engine/saas-technical-doc/companion`\n * does NOT pull the heavy package's root barrel (which boots\n * `initZodDecorators()` — see `saas-models-public-runtime.md` K-3 for\n * the rationale). The projection's enum members MUST stay in\n * one-to-one alignment with `ResourceOperationVariantType` and\n * `ResourcePrimaryScope`; if the source enums grow a new member,\n * update this file in the same commit and rerun the boundary tests.\n *\n * @wildo-boundary\n * This file imports only Zod and the portable technical-documentation\n * contract subpath — no React, no `@wildo-ai/saas-models` root, no\n * decorators. The supported API version deliberately reuses the publication\n * contract's named runtime schema rather than creating a parallel vocabulary.\n */\n\nimport { TechnicalDocumentationSupportedApiVersionSchema } from '@wildo-ai/saas-specifications/technical-documentation';\nimport { z } from 'zod';\n\nimport { OpenApiSection } from '../openapi/openapi-generation-output.schemas';\n\n/**\n * Mirror of `@wildo-ai/saas-models` `ResourceOperationVariantType` —\n * narrowed to the two variants the OpenAPI generator emits per K-5\n * (`API_CALL` is the default URL-bearing operation; `API_CALL_WITH_CALLBACK`\n * additionally carries an asynchronous callback URL). Other variants\n * (`CRON_JOB`, `BATCH_JOB`, `INTERNAL_CALL`, `REPOSITORY_ONLY`) are\n * intentionally NOT included — they have no HTTP surface to document.\n *\n * The introspection emitter MUST drop non-API operations BEFORE\n * projecting; the generator additionally re-asserts the variant via\n * Zod parse so a future bug at the projector layer cannot inject\n * non-API ops into an API doc.\n */\nexport enum OperationProjectionVariantType {\n API_CALL = 'api_call',\n API_CALL_WITH_CALLBACK = 'api_call_with_callback',\n}\n\n/**\n * Mirror of `@wildo-ai/saas-models` `ResourcePrimaryScope` — kept\n * complete (4 members) because scope remains part of the documented operation\n * contract even though consumer sectioning is now an explicit separate fact.\n *\n * If `ResourcePrimaryScope` grows a new member upstream, update this\n * enum in the same commit AND extend the audience splitter to either\n * route the new scope into one of the existing buckets or fail-closed\n * with a clear \"unsupported scope\" error — never silently drop the op.\n */\nexport enum OperationProjectionPrimaryScope {\n USER_SELF = 'user_self',\n ORGANIZATIONS = 'organizations',\n APPLICATION = 'applications',\n ANONYMOUS = 'anonymous',\n}\n\n/**\n * Allowed HTTP methods carried on a projected operation. Mirrors the\n * `HttpMethod` enum in `@wildo-ai/saas-models` but kept local for the\n * same boundary reason as the variant + scope enums above.\n *\n * Lowercase string values match the OpenAPI 3.1 path-item keys\n * (`get`, `post`, `put`, `delete`, `patch`) — keeping the projection\n * value verbatim consumable by the YAML emitter avoids one hop of\n * case-translation in the hot path.\n */\nexport enum OperationProjectionHttpVerb {\n GET = 'get',\n POST = 'post',\n PUT = 'put',\n DELETE = 'delete',\n PATCH = 'patch',\n}\n\n/**\n * Authentication posture resolved from the same role binding the backend\n * enforces. This is intentionally a documentation fact rather than a browser\n * inference: `APP_PUBLIC` and `APP_ANONYMOUS` are access-mode sentinels, while\n * every other role is an authorization requirement.\n */\nexport enum OperationProjectionAuthenticationMode {\n PUBLIC = 'public',\n ANONYMOUS_SESSION = 'anonymous_session',\n AUTHENTICATED = 'authenticated',\n ANONYMOUS_OR_AUTHENTICATED = 'anonymous_or_authenticated',\n}\n\n/**\n * One role requirement as it should be understood by an integrator. `role`\n * remains the exact runtime token; `label` is resolved once at generation time\n * and the explanatory fields come from the application role specification —\n * never from a browser-side naming heuristic.\n */\nexport const OperationRoleRequirementSchema = z.strictObject({\n role: z.string().min(1),\n label: z.string().min(1).max(200),\n businessRole: z.string().min(1).max(4000).nullable(),\n authorityBoundary: z.string().min(1).max(4000).nullable(),\n});\nexport type OperationRoleRequirement = z.infer<typeof OperationRoleRequirementSchema>;\n\n/**\n * Consumer-facing access contract emitted into the operation's `x-wildo`\n * metadata. Its prose is assembled in the introspection subprocess from the\n * authoritative role specifications; the OpenAPI generator and browser only\n * transport and render it.\n */\nexport const OperationAccessDocumentationSchema = z.strictObject({\n authenticationMode: z.enum(OperationProjectionAuthenticationMode),\n authenticationSummary: z.string().min(1).max(500),\n roleRequirements: z.array(OperationRoleRequirementSchema),\n});\nexport type OperationAccessDocumentation = z.infer<typeof OperationAccessDocumentationSchema>;\n\n/** Versioned identity carried from the resolved HTTP operation into OpenAPI. */\nexport const OPENAPI_OPERATION_IDENTITY_CONTRACT_VERSION = 1;\n\n/** Versioned identity carried by each generated OpenAPI resource tag. */\nexport const OPENAPI_RESOURCE_IDENTITY_CONTRACT_VERSION = 1;\n\n/**\n * The non-editorial identity of one externally exposed HTTP operation.\n *\n * This deliberately excludes `operationKey`: that key exists to create a\n * readable OpenAPI `operationId` and can contain a defensive positional\n * fallback for unusual multi-path configurations. Conservation, generated\n * routes and framework metadata must instead join this stable source tuple.\n */\nexport const OpenApiOperationIdentitySchema = z.strictObject({\n contractVersion: z.literal(OPENAPI_OPERATION_IDENTITY_CONTRACT_VERSION),\n resourceRef: z.string().min(1),\n operationFamilyRef: z.string().min(1),\n operationVariantRef: z.string().min(1),\n variantType: z.enum(OperationProjectionVariantType),\n httpVerb: z.enum(OperationProjectionHttpVerb),\n path: z.string().min(1),\n});\nexport type OpenApiOperationIdentity = z.infer<typeof OpenApiOperationIdentitySchema>;\n\n/**\n * Derives stable semantic refs for the resolved operation tuple. This is the\n * sole constructor so the subprocess projector, generator and future browser\n * reader cannot gradually invent incompatible identities.\n */\nexport function createOpenApiOperationIdentity(input: {\n readonly resourceIdentifier: string;\n readonly baseOperationIdentifier: string;\n readonly variantKey: string | null;\n readonly variantType: OperationProjectionVariantType;\n readonly httpVerb: OperationProjectionHttpVerb;\n readonly path: string;\n}): OpenApiOperationIdentity {\n const encode = (value: string): string => encodeURIComponent(value);\n const resourceRef = `technical-documentation:resource/${encode(input.resourceIdentifier)}`;\n const operationFamilyRef = `${resourceRef}/operation-family/${encode(input.baseOperationIdentifier)}`;\n const variantSegment = input.variantKey === null ? 'default' : encode(input.variantKey);\n return {\n contractVersion: OPENAPI_OPERATION_IDENTITY_CONTRACT_VERSION,\n resourceRef,\n operationFamilyRef,\n operationVariantRef:\n `${operationFamilyRef}/variant/${variantSegment}/${input.variantType}/${input.httpVerb}/${encode(input.path)}`,\n variantType: input.variantType,\n httpVerb: input.httpVerb,\n path: input.path,\n };\n}\n\n/**\n * Single projected operation — the atomic unit consumed by the URL-bearing\n * operation guard and the explicit consumer-section grouping.\n *\n * Field decisions:\n *\n * - `resourceIdentifier` is a free string (NOT typed against\n * `CoreResourceType`) because applications can declare custom\n * resource types beyond the core enum. The generator uses this\n * string as the OpenAPI tag name, so we want the wire format to\n * survive any application-extended vocabulary without a schema\n * bump.\n *\n * - `operationKey` is the framework's canonical operation identifier\n * (e.g. `'CREATE'`, `'LIST'`, `'READ'`, custom-named ops); used\n * verbatim as the OpenAPI `operationId` after a small\n * PascalCase prefix (`<Resource><OperationKey>`). Stable across\n * runs so client-codegen consumers can rely on it.\n *\n * - `httpVerb` and `path` carry the wire-level routing details. The\n * `path` MUST be the OpenAPI-style template path (e.g.\n * `/api/v1/{organizationId}/users/{userId}`), NOT an Express\n * `:userId` form — the projector at the introspection side is\n * responsible for the Express → OpenAPI brace conversion so the\n * generator can pass the value through unchanged.\n *\n * - `roles` is the resolved string list (after enum → string\n * flattening) so the splitter can audience-classify without\n * re-importing the role enums. Empty array is rejected via Zod's\n * `.min(1)` because every operation in the framework MUST declare\n * at least one role binding (the framework's resource-config\n * schema enforces this on the source side; the Zod check here is\n * defense-in-depth).\n *\n * - `requestBodySchema` / `responseBodySchema` carry pre-converted\n * JSON Schema fragments (from `z.toJSONSchema()` at the projector\n * side). The generator does NOT see the source Zod schemas — the\n * projector does the conversion so the generator stays\n * decorator-framework-free (importing a Zod schema graph would\n * pull `initZodDecorators()` for any `@wildo-ai/saas-models`-typed\n * schema).\n *\n * - `summary` and `description` are optional human-readable strings;\n * when omitted, the YAML emitter falls back to the canonical\n * `<HTTP_VERB> <Resource>.<OperationKey>` derivation so the docs\n * site never renders a literal \"undefined\" title.\n *\n * - `isApiKeyAccessDisabled` is an authentication-mode fact. The\n * introspection projector forwards it verbatim; the generator keeps the\n * operation and omits only its API-key security alternative.\n *\n * - `stepUpAuthentication` is present only when the resolved operation\n * requires a fresh, single-use re-authentication proof. Both values are\n * projected from the framework's named route/header constants so OpenAPI\n * never invents or duplicates the protocol vocabulary.\n *\n * - `acceptsIfMatch` is the resolved optimistic-locking capability of this\n * exact HTTP operation. It is true only for the controller's supported\n * single-resource UPDATE-like lane, including custom operations borrowing\n * UPDATE semantics; the generator uses it to expose the optional header and\n * its framework-owned 400/409 outcomes without resource-level duplication.\n *\n * - `callbackPath` is OPTIONAL and MUST be present iff\n * `variantType === API_CALL_WITH_CALLBACK`. The generator emits an\n * OpenAPI 3.1 `callbacks:` block when set. The schema's\n * `superRefine` enforces this invariant at parse time so the\n * generator's hot path can assume the field is correctly populated.\n */\nexport const OperationProjectionSchema = z.strictObject({\n resourceIdentifier: z.string().min(1),\n operationKey: z.string().min(1),\n /**\n * The RAW operation identifier (e.g. `CREATE`, `LIST`, `EXPORT_AUDIT_LOGS`,\n * `ROTATE_TOKEN`) WITHOUT the variant / bulk / multi-path qualifiers that\n * `operationKey` appends. `buildOperationId` needs this to compose a\n * verb-first developer-facing operationId (`createOrganization`): the verb\n * is derived from the base identifier and the resource noun from\n * `resourceIdentifier`, while the qualifiers are `operationKey` with this\n * prefix removed. Carried separately because a base identifier can itself\n * contain `_` (e.g. `EXPORT_AUDIT_LOGS`), so the qualifier boundary cannot be\n * recovered from `operationKey` alone.\n */\n baseOperationIdentifier: z.string().min(1),\n /** Exact runtime variant discriminator. `null` is the canonical default variant. */\n variantKey: z.string().min(1).nullable(),\n variantType: z.enum(OperationProjectionVariantType),\n httpVerb: z.enum(OperationProjectionHttpVerb),\n path: z.string().min(1),\n primaryScope: z.enum(OperationProjectionPrimaryScope),\n /**\n * Consumer-facing documentation section resolved at the source-authority\n * boundary. The OpenAPI generator groups by this explicit fact; it must not\n * reinterpret internal scopes or role strings into product navigation.\n */\n consumerApiSection: z.enum(OpenApiSection),\n /**\n * Stable source identity used for conservation and the strict `x-wildo`\n * extension. It is not a human-facing operationId and never depends on\n * iteration order or display prose.\n */\n identity: OpenApiOperationIdentitySchema,\n // Resolved role list (enum → string). MAY be empty: an operation with no\n // declared roles is a real, intentional runtime state — an open / no-specific-\n // role-gate endpoint (e.g. the core `users` LIST: \"app users can list users\").\n // Each entry must be a non-empty string, but the array itself can be `[]`. The\n // source classifier treats an empty role set as normal API, not application\n // administration. NOT `.min(1)` — not every engine endpoint is role-gated.\n roles: z.array(z.string().min(1)),\n /**\n * Source-resolved consumer access explanation. This must remain aligned with\n * `roles`: the projector is the only place allowed to interpret access-mode\n * sentinels and attach the app's role-specification prose.\n */\n access: OperationAccessDocumentationSchema,\n isApiKeyAccessDisabled: z.boolean(),\n stepUpAuthentication: z.strictObject({\n headerName: z.string().min(1),\n tokenEndpointPath: z.string().min(1),\n }).optional(),\n acceptsIfMatch: z.boolean(),\n /**\n * Present only when the resolved variant declares `idempotencyKey`: the header name (projected from the framework's\n * named constant, never retyped) and whether a request without it is refused. The generator documents the header and\n * the framework's 400 refusals; a replay's 409/422 belong to the implementing operation and live in its specification.\n */\n idempotencyKey: z.strictObject({\n headerName: z.string().min(1),\n required: z.boolean(),\n }).optional(),\n summary: z.string().min(1).max(200).optional(),\n description: z.string().min(1).max(2000).optional(),\n /**\n * JSON-Schema fragment representing the request body (or query for\n * GET / DELETE if the projector chose to flatten query parameters\n * into a single schema). The exact shape is whatever\n * `z.toJSONSchema()` emits. For POST / PUT / PATCH style verbs the\n * generator passes it through unchanged into the OpenAPI\n * `requestBody.content.application/json.schema` slot. For GET /\n * DELETE the generator expects an object-shaped schema and explodes\n * the top-level properties into `parameters[]` entries with\n * `in: 'query'`. `null` means \"no request input\".\n */\n requestBodySchema: z.unknown().nullable(),\n /**\n * JSON-Schema fragment representing the 2xx response body. `null`\n * means \"no body\" → emitted as a 204-style `responses` entry with\n * description only. `unknown` to stay format-agnostic; the\n * projector is responsible for emitting valid JSON Schema.\n */\n responseBodySchema: z.unknown().nullable(),\n /**\n * Paginated-collection query contract — present iff the operation is a\n * framework paginated collection operation (a `LIST` / `SEARCH` core\n * operation, or a custom operation borrowing one via\n * `resourceOperationLike`). Those operations universally accept the flat\n * `page` / `limit` / `sort` query parameters and return the\n * `{ data, pagination }` envelope (the backend controller forces\n * `paginated: true` for every HTTP LIST/SEARCH dispatch), but NONE of that\n * appears in the operation's request DTO — without this block the generator\n * would document a paginated endpoint with no way to page it.\n *\n * The PROJECTOR resolves the per-operation values (it sees the resolved\n * runtime operation); the GENERATOR owns the universal parameter shapes and\n * the framework-constant defaults (`page` defaults to 1, `limit` to 20 —\n * mirrors of the repository `_doList` defaults). Split chosen so this wire\n * schema stays framework-decoupled: the projection carries FACTS, not\n * OpenAPI fragments.\n *\n * - `maxLimit` — largest accepted `limit` value. Resolved from the\n * operation's `maxPaginatedResultPerPageLimit ?? 50` (the same fallback\n * the frontend HTTP client clamps with; only SEARCH-like operations can\n * author a different cap today).\n * - `sortableFields` — the operation's declared `sortFields` allow-list.\n * Non-empty: only these fields may be named in `sort` (unrecognised\n * fields are silently ignored by the backend validator) and the default\n * ordering is the first entry, descending. Empty: the backend applies\n * any requested field verbatim and defaults to `createdAt:desc`.\n */\n pagination: z.strictObject({\n maxLimit: z.number().int().min(1),\n sortableFields: z.array(z.string().min(1)),\n }).optional(),\n /**\n * Path of the asynchronous callback (`API_CALL_WITH_CALLBACK` only).\n * The generator turns this into an OpenAPI `callbacks:` block\n * referencing the same `responseBodySchema`.\n */\n callbackPath: z.string().min(1).optional(),\n /**\n * Tier-3 authored HTTP documentation, projected from the resource\n * specification's operation overlay. All optional; when present the\n * generator emits real `responses` (success + error), request/response\n * `examples`, an `x-idempotent` extension, and a rate-limit note instead of\n * the default single `200`/`204`. `code` / `forStatus` are OpenAPI status\n * keys (`'200'`, `'404'`, …).\n */\n responseStatuses: z.array(z.strictObject({\n code: z.string().min(1),\n meaning: z.string().min(1),\n })).optional(),\n errorScenarios: z.array(z.strictObject({\n code: z.string().min(1),\n when: z.string().min(1),\n errorCode: z.string().min(1).optional(),\n })).optional(),\n idempotent: z.boolean().optional(),\n /**\n * The outbound webhook events this operation fires, if any.\n *\n * Carried on the OPERATION because that is the fact a reader needs where they are standing: a\n * developer looking at `changeStatus` wants to know that calling it notifies every configured\n * endpoint, and a receiver author wants to know which call produced the delivery they are\n * holding. The delivery mechanics — retries, signature, timeouts — belong to the webhook\n * contract and are described once, not per operation.\n */\n m2mNotifications: z.array(z.strictObject({\n /** Stable identifier of the notification declaration. */\n identifier: z.string().min(1),\n /** The channel that carries it, which is also its delivery scope (`webhook_organization`, …). */\n channel: z.string().min(1),\n level: z.string().min(1).optional(),\n })).optional(),\n rateLimitNote: z.string().min(1).optional(),\n examples: z.array(z.strictObject({\n title: z.string().min(1),\n request: z.unknown().optional(),\n response: z.unknown().optional(),\n forStatus: z.string().min(1).optional(),\n })).optional(),\n}).superRefine((projection, ctx) => {\n if (\n projection.identity.variantType !== projection.variantType\n || projection.identity.httpVerb !== projection.httpVerb\n || projection.identity.path !== projection.path\n ) {\n ctx.addIssue({\n code: 'custom',\n path: ['identity'],\n message: 'OperationProjection identity must exactly mirror the resolved variant type, HTTP verb and path.',\n });\n }\n if (projection.variantType === OperationProjectionVariantType.API_CALL_WITH_CALLBACK) {\n if (projection.callbackPath === undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['callbackPath'],\n message:\n `OperationProjection for '${projection.resourceIdentifier}.${projection.operationKey}' ` +\n `has variantType=${OperationProjectionVariantType.API_CALL_WITH_CALLBACK} but no callbackPath. ` +\n `The introspection projector MUST populate callbackPath for callback variants — without it the generator ` +\n `cannot emit an OpenAPI \\`callbacks:\\` block, which would silently produce a misleading doc that ` +\n `looks like a regular synchronous endpoint.`,\n });\n }\n } else if (projection.callbackPath !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['callbackPath'],\n message:\n `OperationProjection for '${projection.resourceIdentifier}.${projection.operationKey}' ` +\n `has callbackPath but variantType=${projection.variantType} (expected ${OperationProjectionVariantType.API_CALL_WITH_CALLBACK}). ` +\n `Reject at parse time so the projector bug surfaces immediately rather than producing a doc with phantom callback metadata.`,\n });\n }\n});\nexport type OperationProjection = z.infer<typeof OperationProjectionSchema>;\n\n/**\n * Closed projection vocabulary mirroring the relationship cardinalities in\n * `@wildo-ai/saas-models`. It deliberately lives in the narrow IPC/OpenAPI\n * contract so the generator and browser never need to import the full resource\n * registry just to render a resource's public relationship semantics.\n */\nexport enum ResourceRelationshipDocumentationCardinality {\n ONE = 'one',\n ZERO_OR_ONE = 'zero_or_one',\n ONE_OR_MANY = 'one_or_many',\n MANY = 'many',\n}\n\n/** The three developer-authored relationship meanings projected into OpenAPI. */\nexport enum ResourceRelationshipDocumentationNature {\n COMPOSITION = 'composition',\n REFERENCE = 'reference',\n ASSOCIATION = 'association',\n}\n\n/** The compiled lifecycle dependency of a relationship, not a presentation hint. */\nexport enum ResourceRelationshipDocumentationLifecycleModel {\n DEPENDENT = 'dependent',\n INDEPENDENT = 'independent',\n LINK_ONLY = 'link_only',\n}\n\n/** Execution timing for an explicitly configured parent-delete lifecycle. */\nexport enum ResourceRelationshipDocumentationDeleteMode {\n IMMEDIATE = 'immediate',\n LAZY = 'lazy',\n}\n\n/** Effect of an explicitly configured parent-delete lifecycle. */\nexport enum ResourceRelationshipDocumentationDeleteStrategy {\n DELETE = 'delete',\n IMPERSONALIZE_AND_RETAIN = 'impersonalize_and_retain',\n /** The parent's delete is refused while related rows exist; nothing is torn down. */\n REFUSE_WHILE_CHILDREN_EXIST = 'refuse_while_children_exist',\n}\n\n/**\n * Consumer words for the relationship vocabularies.\n *\n * Beside the enums rather than in the documentation projection, so the values and the words that\n * explain them cannot drift apart, and a member added to an enum has one obvious place to gain a\n * meaning. Same reason the sign-in methods carry theirs next to `AuthMethod`.\n *\n * `NATURE` deliberately avoids the framework's own vocabulary: a customer reading \"composition\"\n * learns nothing, while \"part of it\" is the thing they can act on.\n */\nexport const RESOURCE_RELATIONSHIP_CARDINALITY_MEANINGS: Readonly<Record<ResourceRelationshipDocumentationCardinality, string>> = Object.freeze({\n [ResourceRelationshipDocumentationCardinality.ONE]: 'exactly one',\n [ResourceRelationshipDocumentationCardinality.ZERO_OR_ONE]: 'at most one',\n [ResourceRelationshipDocumentationCardinality.ONE_OR_MANY]: 'one or more',\n [ResourceRelationshipDocumentationCardinality.MANY]: 'any number of',\n});\n\nexport const RESOURCE_RELATIONSHIP_NATURE_MEANINGS: Readonly<Record<ResourceRelationshipDocumentationNature, string>> = Object.freeze({\n [ResourceRelationshipDocumentationNature.COMPOSITION]: 'Part of it',\n [ResourceRelationshipDocumentationNature.REFERENCE]: 'Points at it',\n [ResourceRelationshipDocumentationNature.ASSOCIATION]: 'Linked to it',\n});\n\n/**\n * One relationship fact from the perspective of a resource OpenAPI tag.\n *\n * `relatedResourceName` and the two cardinalities are deliberately symmetric:\n * resource configurations include both ordinary parent → child relationships\n * and FK-reference declarations, so this public contract must not guess an\n * ownership direction from declaration order. `lifecycleModel` and the\n * optional `onParentDelete` policy carry the framework's already-resolved\n * lifecycle truth without exposing registry implementation details.\n */\nexport const ResourceRelationshipDocumentationSchema = z.strictObject({\n relatedResourceName: z.string().min(1),\n /** Resolved FK identity when the relationship is represented by a field. */\n foreignKeyField: z.string().min(1).optional(),\n resourceCardinality: z.enum(ResourceRelationshipDocumentationCardinality),\n relatedResourceCardinality: z.enum(ResourceRelationshipDocumentationCardinality),\n nature: z.enum(ResourceRelationshipDocumentationNature),\n lifecycleModel: z.enum(ResourceRelationshipDocumentationLifecycleModel),\n onParentDelete: z.strictObject({\n enabled: z.boolean(),\n mode: z.enum(ResourceRelationshipDocumentationDeleteMode),\n strategy: z.enum(ResourceRelationshipDocumentationDeleteStrategy),\n maxDepth: z.number().int().min(0),\n }).optional(),\n});\nexport type ResourceRelationshipDocumentation = z.infer<typeof ResourceRelationshipDocumentationSchema>;\n\n/**\n * A source-declared grouping for resources in one consumer API reference.\n *\n * API resource categories are navigation meaning, not a renderer inference.\n * An application declares the category once in `wildo.tech-doc.config.ts`; the\n * companion attaches it to the corresponding resource tag and the generator\n * transports the fact through strict OpenAPI metadata. The identifier is\n * deliberately application-defined: different products can have genuinely\n * different business domains while still using the same renderer.\n */\nexport const ApiReferenceResourceCategorySchema = z.strictObject({\n /** Stable, readable public identity used in API-reference fragments. */\n id: z.string().regex(/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/).max(100),\n /** Consumer-facing category label displayed by the renderer. */\n label: z.string().min(1).max(200),\n /** Optional category orientation supplied by the application, never React. */\n description: z.string().min(1).max(2000).optional(),\n});\nexport type ApiReferenceResourceCategory = z.infer<typeof ApiReferenceResourceCategorySchema>;\n\n/**\n * Optional per-resource OpenAPI tag descriptor (specification + registry enrichment).\n *\n * The generator groups operations under a tag named after the resource\n * identifier. Each emitted OpenAPI tag has a strict `x-wildo` resource identity;\n * this descriptor enriches it with its specification-owned purpose/lifecycle\n * prose and the compiled relationship facts from the resolved resource graph.\n */\nexport const ResourceTagSchema = z.strictObject({\n /** Must equal the `resourceIdentifier` the generator derives the tag from. */\n name: z.string().min(1),\n /** Business-purpose prose for the resource group. */\n description: z.string().min(1).max(2000).optional(),\n /** Specification-owned explanation of how this resource changes over time. */\n lifecycleRole: z.string().min(1).max(4000).optional(),\n /** Compiled relationship facts relevant to this resource. */\n relationships: z.array(ResourceRelationshipDocumentationSchema).optional(),\n /** Explicit application-owned API-reference navigation grouping. */\n category: ApiReferenceResourceCategorySchema.optional(),\n});\nexport type ResourceTag = z.infer<typeof ResourceTagSchema>;\n\n/**\n * One OpenAPI `servers[]` entry — a base URL the API is reachable at, plus an\n * optional human label. **App-enriched**: deployment URLs are an\n * application/environment concern (the framework cannot know an app's prod\n * domain), so they are authored on `WildoTechnicalDocConfig.apiServers` and\n * threaded into `OpenApiGenerationInput.servers`. The shared shape lives here\n * (the boundary-clean, zod-only module the generator consumes); the config\n * schema imports it so the two never drift.\n */\nexport const OpenApiServerSchema = z.strictObject({\n /**\n * Base URL — the bare ORIGIN the API is served from, e.g.\n * `http://localhost:4241` or `https://api.example.com`. Do NOT append the\n * `/api/v1` mount: the generated operation `paths` are already mount-prefixed\n * (`/api/v1/...`), and the effective request URL is `server.url` + path — so\n * including the mount here would DOUBLE it (`…/api/v1/api/v1/...`).\n */\n url: z.string().min(1),\n /** Optional human label shown in the docs server picker (e.g. \"Production\"). */\n description: z.string().min(1).max(200).optional(),\n});\nexport type OpenApiServer = z.infer<typeof OpenApiServerSchema>;\n\n/**\n * Top-level wire format consumed by the OpenAPI generator. Wrapped\n * in an object so the projector can attach metadata (app slug, build\n * timestamp, framework version) without a schema-shape break later.\n */\nexport const OpenApiGenerationInputSchema = z.strictObject({\n /**\n * App slug from `WildoSaasConfig.slug`. Surfaces in the generated\n * `openapi.info.title` so a\n * multi-app generation run can be disambiguated. Free-string\n * (no validation against `WildoSaasConfigSchema.slug` regex) because\n * the generator should not gate on the same constraint twice; the\n * `defineSaasConfig` parser already enforced the shape at author time.\n */\n appSlug: z.string().min(1),\n /**\n * App display name from `WildoSaasConfig.displayName` — used as the\n * default base title in the generated `openapi.info.title`. The\n * companion route concatenates it with the section name\n * (`\"Wonder Todos API reference\"`).\n */\n appDisplayName: z.string().min(1),\n /**\n * Optional public marketing title from `WildoSaasConfig.technicalDoc.publicMarketingTitle`.\n * When present, replaces `appDisplayName` in the generated title so\n * the OpenAPI docs match the docs site landing page.\n */\n publicMarketingTitle: z.string().min(1).max(200).optional(),\n /** Exact supported public API contract release surfaced in `openapi.info.version`. */\n supportedApiVersion: TechnicalDocumentationSupportedApiVersionSchema,\n /**\n * Flat list of all URL-bearing operation projections. The projector includes\n * every exposed operation and resolves its consumer section explicitly; the\n * generator validates, groups and renders without eligibility inference.\n */\n operations: z.array(OperationProjectionSchema),\n /**\n * JSON Schema for the canonical framework HTTP error envelope. The\n * subprocess converts the same `ErrorResponseSchema` the backend serializes;\n * the generator registers it once as `components.schemas.ErrorResponse` and\n * references it from every documented non-success response. Keeping this\n * here makes the OpenAPI document an exact projection of the runtime wire\n * contract rather than a renderer-owned approximation.\n */\n errorResponseSchema: z.unknown(),\n /**\n * Optional resource → tag-description descriptors. The generator emits each\n * one as an OpenAPI top-level `tags[].description` for the tags it derives\n * from a section's operations; resources without a descriptor still get a\n * bare `{ name }` tag. Order-independent (the generator looks up by `name`).\n */\n resourceTags: z.array(ResourceTagSchema).optional(),\n /**\n * Optional OpenAPI `servers[]` — the base URLs the API is reachable at.\n * App-enriched via `WildoTechnicalDocConfig.apiServers` (deployment URLs are\n * application/environment knowledge, not framework knowledge). When omitted\n * the generator emits no `servers` block (back-compatible with the\n * pre-servers output). Each entry is `{ url, description? }`.\n */\n servers: z.array(OpenApiServerSchema).optional(),\n /**\n * Optional app-authored markdown intro for the API reference landing page,\n * from `WildoTechnicalDocConfig.apiOverview`. The generator PREPENDS it to the\n * framework-universal \"## API conventions\" block (auth / pagination /\n * idempotency / errors — which it always emits) to form `info.description`.\n * App enrichment: the conventions are framework knowledge; the overview is the\n * app's own framing.\n */\n apiOverview: z.string().min(1).max(8000).optional(),\n});\nexport type OpenApiGenerationInput = z.infer<typeof OpenApiGenerationInputSchema>;\n"]}
1
+ {"version":3,"file":"operation-projection.schemas.js","sourceRoot":"","sources":["../../../src/companion/operation-projection.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,OAAO,EAAE,+CAA+C,EAAE,MAAM,uDAAuD,CAAC;AACxH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAE9E;;;;;;;;;;;;GAYG;AACH,MAAM,CAAN,IAAY,8BAGX;AAHD,WAAY,8BAA8B;IACxC,uDAAqB,CAAA;IACrB,mFAAiD,CAAA;AACnD,CAAC,EAHW,8BAA8B,KAA9B,8BAA8B,QAGzC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAN,IAAY,+BAKX;AALD,WAAY,+BAA+B;IACzC,0DAAuB,CAAA;IACvB,kEAA+B,CAAA;IAC/B,+DAA4B,CAAA;IAC5B,0DAAuB,CAAA;AACzB,CAAC,EALW,+BAA+B,KAA/B,+BAA+B,QAK1C;AAED;;;;;;;;;GAS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AAoB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IAC3D,sFAAsF;IACtF,mBAAmB,EAAE,+CAA+C;IACpE;;;;OAIG;IACH,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,yBAAyB,CAAC;IAC9C;;;;;;;OAOG;IACH,mBAAmB,EAAE,CAAC,CAAC,OAAO,EAAE;IAChC;;;;;OAKG;IACH,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,QAAQ,EAAE;IACnD;;;;;;OAMG;IACH,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,QAAQ,EAAE;IAChD;;;;;;;OAOG;IACH,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;CACpD,CAAC,CAAC","sourcesContent":["/**\n * @wildo-package @wildo-ai/saas-technical-doc/companion (input projection)\n *\n * Input shape consumed by the companion-side OpenAPI generator\n * (saas-technical-doc.md Step 3).\n *\n * Why a dedicated projection (and NOT importing `ResourcesRegistry` from\n * `@wildo-ai/saas-models`):\n *\n * - The full `ResourceConfiguration` carries ~40 internal-only fields\n * (factory metadata, repository wiring, validation hooks, frontend\n * presets, lifecycle bindings, …). The OpenAPI generator does NOT need\n * any of them — it needs ONLY operation-level HTTP shape data\n * (method + path + request/response Zod schemas + role binding +\n * primary scope + authentication-mode flags). Coupling the\n * generator to the full type would (a) drag the entire schema graph\n * + decorator framework into the companion bundle, defeating the\n * point of `@wildo-ai/saas-models/public-runtime`; (b) couple test\n * fixtures to dozens of irrelevant fields, making generator unit\n * tests brittle to unrelated framework changes; (c) make the\n * introspection-subprocess hop's wire format depend on the entire\n * framework's type stability.\n *\n * - The introspection subprocess (wonder-todos backend) ALREADY has\n * the resolved `ResourceConfiguration` graph — it's the natural\n * place to flatten it into this minimal projection. The companion\n * process then transforms the projection into YAML without ever\n * needing the framework's resource-config types.\n *\n * - This file re-declares the small subset of enums/literals the\n * projection carries (`ResourceOperationVariantTypeProjection`,\n * `ResourcePrimaryScopeProjection`) rather than importing them from\n * `@wildo-ai/saas-models` so that `engine/saas-technical-doc/companion`\n * does NOT pull the heavy package's root barrel (which boots\n * `initZodDecorators()` — see `saas-models-public-runtime.md` K-3 for\n * the rationale). The projection's enum members MUST stay in\n * one-to-one alignment with `ResourceOperationVariantType` and\n * `ResourcePrimaryScope`; if the source enums grow a new member,\n * update this file in the same commit and rerun the boundary tests.\n *\n * @wildo-boundary\n * This file imports only Zod and the portable technical-documentation\n * contract subpath — no React, no `@wildo-ai/saas-models` root, no\n * decorators. The supported API version deliberately reuses the publication\n * contract's named runtime schema rather than creating a parallel vocabulary.\n */\n\nimport { TechnicalDocumentationSupportedApiVersionSchema } from '@wildo-ai/saas-specifications/technical-documentation';\nimport { z } from 'zod';\n\nimport { OpenApiSection } from '../openapi/openapi-generation-output.schemas';\n\n/**\n * Mirror of `@wildo-ai/saas-models` `ResourceOperationVariantType` —\n * narrowed to the two variants the OpenAPI generator emits per K-5\n * (`API_CALL` is the default URL-bearing operation; `API_CALL_WITH_CALLBACK`\n * additionally carries an asynchronous callback URL). Other variants\n * (`CRON_JOB`, `BATCH_JOB`, `INTERNAL_CALL`, `REPOSITORY_ONLY`) are\n * intentionally NOT included — they have no HTTP surface to document.\n *\n * The introspection emitter MUST drop non-API operations BEFORE\n * projecting; the generator additionally re-asserts the variant via\n * Zod parse so a future bug at the projector layer cannot inject\n * non-API ops into an API doc.\n */\nexport enum OperationProjectionVariantType {\n API_CALL = 'api_call',\n API_CALL_WITH_CALLBACK = 'api_call_with_callback',\n}\n\n/**\n * Mirror of `@wildo-ai/saas-models` `ResourcePrimaryScope` — kept\n * complete (4 members) because scope remains part of the documented operation\n * contract even though consumer sectioning is now an explicit separate fact.\n *\n * If `ResourcePrimaryScope` grows a new member upstream, update this\n * enum in the same commit AND extend the audience splitter to either\n * route the new scope into one of the existing buckets or fail-closed\n * with a clear \"unsupported scope\" error — never silently drop the op.\n */\nexport enum OperationProjectionPrimaryScope {\n USER_SELF = 'user_self',\n ORGANIZATIONS = 'organizations',\n APPLICATION = 'applications',\n ANONYMOUS = 'anonymous',\n}\n\n/**\n * Allowed HTTP methods carried on a projected operation. Mirrors the\n * `HttpMethod` enum in `@wildo-ai/saas-models` but kept local for the\n * same boundary reason as the variant + scope enums above.\n *\n * Lowercase string values match the OpenAPI 3.1 path-item keys\n * (`get`, `post`, `put`, `delete`, `patch`) — keeping the projection\n * value verbatim consumable by the YAML emitter avoids one hop of\n * case-translation in the hot path.\n */\nexport enum OperationProjectionHttpVerb {\n GET = 'get',\n POST = 'post',\n PUT = 'put',\n DELETE = 'delete',\n PATCH = 'patch',\n}\n\n/**\n * Authentication posture resolved from the same role binding the backend\n * enforces. This is intentionally a documentation fact rather than a browser\n * inference: `APP_PUBLIC` and `APP_ANONYMOUS` are access-mode sentinels, while\n * every other role is an authorization requirement.\n */\nexport enum OperationProjectionAuthenticationMode {\n PUBLIC = 'public',\n ANONYMOUS_SESSION = 'anonymous_session',\n AUTHENTICATED = 'authenticated',\n ANONYMOUS_OR_AUTHENTICATED = 'anonymous_or_authenticated',\n}\n\n/**\n * One role requirement as it should be understood by an integrator. `role`\n * remains the exact runtime token; `label` is resolved once at generation time\n * and the explanatory fields come from the application role specification —\n * never from a browser-side naming heuristic.\n */\nexport const OperationRoleRequirementSchema = z.strictObject({\n role: z.string().min(1),\n label: z.string().min(1).max(200),\n businessRole: z.string().min(1).max(4000).nullable(),\n authorityBoundary: z.string().min(1).max(4000).nullable(),\n});\nexport type OperationRoleRequirement = z.infer<typeof OperationRoleRequirementSchema>;\n\n/**\n * Consumer-facing access contract emitted into the operation's `x-wildo`\n * metadata. Its prose is assembled in the introspection subprocess from the\n * authoritative role specifications; the OpenAPI generator and browser only\n * transport and render it.\n */\nexport const OperationAccessDocumentationSchema = z.strictObject({\n authenticationMode: z.enum(OperationProjectionAuthenticationMode),\n authenticationSummary: z.string().min(1).max(500),\n roleRequirements: z.array(OperationRoleRequirementSchema),\n});\nexport type OperationAccessDocumentation = z.infer<typeof OperationAccessDocumentationSchema>;\n\n/** Versioned identity carried from the resolved HTTP operation into OpenAPI. */\nexport const OPENAPI_OPERATION_IDENTITY_CONTRACT_VERSION = 1;\n\n/** Versioned identity carried by each generated OpenAPI resource tag. */\nexport const OPENAPI_RESOURCE_IDENTITY_CONTRACT_VERSION = 1;\n\n/**\n * The non-editorial identity of one externally exposed HTTP operation.\n *\n * This deliberately excludes `operationKey`: that key exists to create a\n * readable OpenAPI `operationId` and can contain a defensive positional\n * fallback for unusual multi-path configurations. Conservation, generated\n * routes and framework metadata must instead join this stable source tuple.\n */\nexport const OpenApiOperationIdentitySchema = z.strictObject({\n contractVersion: z.literal(OPENAPI_OPERATION_IDENTITY_CONTRACT_VERSION),\n resourceRef: z.string().min(1),\n operationFamilyRef: z.string().min(1),\n operationVariantRef: z.string().min(1),\n variantType: z.enum(OperationProjectionVariantType),\n httpVerb: z.enum(OperationProjectionHttpVerb),\n path: z.string().min(1),\n});\nexport type OpenApiOperationIdentity = z.infer<typeof OpenApiOperationIdentitySchema>;\n\n/**\n * Derives stable semantic refs for the resolved operation tuple. This is the\n * sole constructor so the subprocess projector, generator and future browser\n * reader cannot gradually invent incompatible identities.\n */\nexport function createOpenApiOperationIdentity(input: {\n readonly resourceIdentifier: string;\n readonly baseOperationIdentifier: string;\n readonly variantKey: string | null;\n readonly variantType: OperationProjectionVariantType;\n readonly httpVerb: OperationProjectionHttpVerb;\n readonly path: string;\n}): OpenApiOperationIdentity {\n const encode = (value: string): string => encodeURIComponent(value);\n const resourceRef = `technical-documentation:resource/${encode(input.resourceIdentifier)}`;\n const operationFamilyRef = `${resourceRef}/operation-family/${encode(input.baseOperationIdentifier)}`;\n const variantSegment = input.variantKey === null ? 'default' : encode(input.variantKey);\n return {\n contractVersion: OPENAPI_OPERATION_IDENTITY_CONTRACT_VERSION,\n resourceRef,\n operationFamilyRef,\n operationVariantRef:\n `${operationFamilyRef}/variant/${variantSegment}/${input.variantType}/${input.httpVerb}/${encode(input.path)}`,\n variantType: input.variantType,\n httpVerb: input.httpVerb,\n path: input.path,\n };\n}\n\n/**\n * Single projected operation — the atomic unit consumed by the URL-bearing\n * operation guard and the explicit consumer-section grouping.\n *\n * Field decisions:\n *\n * - `resourceIdentifier` is a free string (NOT typed against\n * `CoreResourceType`) because applications can declare custom\n * resource types beyond the core enum. The generator uses this\n * string as the OpenAPI tag name, so we want the wire format to\n * survive any application-extended vocabulary without a schema\n * bump.\n *\n * - `operationKey` is the framework's canonical operation identifier\n * (e.g. `'CREATE'`, `'LIST'`, `'READ'`, custom-named ops); used\n * verbatim as the OpenAPI `operationId` after a small\n * PascalCase prefix (`<Resource><OperationKey>`). Stable across\n * runs so client-codegen consumers can rely on it.\n *\n * - `httpVerb` and `path` carry the wire-level routing details. The\n * `path` MUST be the OpenAPI-style template path (e.g.\n * `/api/v1/{organizationId}/users/{userId}`), NOT an Express\n * `:userId` form — the projector at the introspection side is\n * responsible for the Express → OpenAPI brace conversion so the\n * generator can pass the value through unchanged.\n *\n * - `roles` is the resolved string list (after enum → string\n * flattening) so the splitter can audience-classify without\n * re-importing the role enums. Empty array is rejected via Zod's\n * `.min(1)` because every operation in the framework MUST declare\n * at least one role binding (the framework's resource-config\n * schema enforces this on the source side; the Zod check here is\n * defense-in-depth).\n *\n * - `requestBodySchema` / `responseBodySchema` carry pre-converted\n * JSON Schema fragments (from `z.toJSONSchema()` at the projector\n * side). The generator does NOT see the source Zod schemas — the\n * projector does the conversion so the generator stays\n * decorator-framework-free (importing a Zod schema graph would\n * pull `initZodDecorators()` for any `@wildo-ai/saas-models`-typed\n * schema).\n *\n * - `summary` and `description` are optional human-readable strings;\n * when omitted, the YAML emitter falls back to the canonical\n * `<HTTP_VERB> <Resource>.<OperationKey>` derivation so the docs\n * site never renders a literal \"undefined\" title.\n *\n * - `isApiKeyAccessDisabled` is an authentication-mode fact. The\n * introspection projector forwards it verbatim; the generator keeps the\n * operation and omits only its API-key security alternative.\n *\n * - `stepUpAuthentication` is present only when the resolved operation\n * requires a fresh, single-use re-authentication proof. Both values are\n * projected from the framework's named route/header constants so OpenAPI\n * never invents or duplicates the protocol vocabulary.\n *\n * - `acceptsIfMatch` is the resolved optimistic-locking capability of this\n * exact HTTP operation. It is true only for the controller's supported\n * single-resource UPDATE-like lane, including custom operations borrowing\n * UPDATE semantics; the generator uses it to expose the optional header and\n * its framework-owned 400/409 outcomes without resource-level duplication.\n *\n * - `callbackPath` is OPTIONAL and MUST be present iff\n * `variantType === API_CALL_WITH_CALLBACK`. The generator emits an\n * OpenAPI 3.1 `callbacks:` block when set. The schema's\n * `superRefine` enforces this invariant at parse time so the\n * generator's hot path can assume the field is correctly populated.\n */\nexport const OperationProjectionSchema = z.strictObject({\n resourceIdentifier: z.string().min(1),\n operationKey: z.string().min(1),\n /**\n * The RAW operation identifier (e.g. `CREATE`, `LIST`, `EXPORT_AUDIT_LOGS`,\n * `ROTATE_TOKEN`) WITHOUT the variant / bulk / multi-path qualifiers that\n * `operationKey` appends. `buildOperationId` needs this to compose a\n * verb-first developer-facing operationId (`createOrganization`): the verb\n * is derived from the base identifier and the resource noun from\n * `resourceIdentifier`, while the qualifiers are `operationKey` with this\n * prefix removed. Carried separately because a base identifier can itself\n * contain `_` (e.g. `EXPORT_AUDIT_LOGS`), so the qualifier boundary cannot be\n * recovered from `operationKey` alone.\n */\n baseOperationIdentifier: z.string().min(1),\n /** Exact runtime variant discriminator. `null` is the canonical default variant. */\n variantKey: z.string().min(1).nullable(),\n variantType: z.enum(OperationProjectionVariantType),\n httpVerb: z.enum(OperationProjectionHttpVerb),\n path: z.string().min(1),\n primaryScope: z.enum(OperationProjectionPrimaryScope),\n /**\n * Consumer-facing documentation section resolved at the source-authority\n * boundary. The OpenAPI generator groups by this explicit fact; it must not\n * reinterpret internal scopes or role strings into product navigation.\n */\n consumerApiSection: z.enum(OpenApiSection),\n /**\n * Stable source identity used for conservation and the strict `x-wildo`\n * extension. It is not a human-facing operationId and never depends on\n * iteration order or display prose.\n */\n identity: OpenApiOperationIdentitySchema,\n // Resolved role list (enum → string). MAY be empty: an operation with no\n // declared roles is a real, intentional runtime state — an open / no-specific-\n // role-gate endpoint (e.g. the core `users` LIST: \"app users can list users\").\n // Each entry must be a non-empty string, but the array itself can be `[]`. The\n // source classifier treats an empty role set as normal API, not application\n // administration. NOT `.min(1)` — not every engine endpoint is role-gated.\n roles: z.array(z.string().min(1)),\n /**\n * Source-resolved consumer access explanation. This must remain aligned with\n * `roles`: the projector is the only place allowed to interpret access-mode\n * sentinels and attach the app's role-specification prose.\n */\n access: OperationAccessDocumentationSchema,\n isApiKeyAccessDisabled: z.boolean(),\n stepUpAuthentication: z.strictObject({\n headerName: z.string().min(1),\n tokenEndpointPath: z.string().min(1),\n }).optional(),\n acceptsIfMatch: z.boolean(),\n /**\n * Present only when the resolved variant declares `idempotencyKey`: the header name (projected from the framework's\n * named constant, never retyped) and whether a request without it is refused. The generator documents the header and\n * the framework's 400 refusals; a replay's 409/422 belong to the implementing operation and live in its specification.\n */\n idempotencyKey: z.strictObject({\n headerName: z.string().min(1),\n required: z.boolean(),\n }).optional(),\n /**\n * Present only when the resolved variant declares `submissionChallenge` (#1985): the answer header's name and the path a\n * caller fetches a proof-of-work challenge from (both projected from the framework's named constants, never retyped).\n * The generator documents the header as OPTIONAL, because whether it is asked depends on two facts the reference cannot\n * fix: that the application declares a captcha provider, and that the caller is not signed in. It says so, and lists the\n * two 400 refusals.\n */\n submissionChallenge: z.strictObject({\n headerName: z.string().min(1),\n proofOfWorkChallengePath: z.string().min(1),\n }).optional(),\n summary: z.string().min(1).max(200).optional(),\n description: z.string().min(1).max(2000).optional(),\n /**\n * JSON-Schema fragment representing the request body (or query for\n * GET / DELETE if the projector chose to flatten query parameters\n * into a single schema). The exact shape is whatever\n * `z.toJSONSchema()` emits. For POST / PUT / PATCH style verbs the\n * generator passes it through unchanged into the OpenAPI\n * `requestBody.content.application/json.schema` slot. For GET /\n * DELETE the generator expects an object-shaped schema and explodes\n * the top-level properties into `parameters[]` entries with\n * `in: 'query'`. `null` means \"no request input\".\n */\n requestBodySchema: z.unknown().nullable(),\n /**\n * JSON-Schema fragment representing the 2xx response body. `null`\n * means \"no body\" → emitted as a 204-style `responses` entry with\n * description only. `unknown` to stay format-agnostic; the\n * projector is responsible for emitting valid JSON Schema.\n */\n responseBodySchema: z.unknown().nullable(),\n /**\n * Paginated-collection query contract — present iff the operation is a\n * framework paginated collection operation (a `LIST` / `SEARCH` core\n * operation, or a custom operation borrowing one via\n * `resourceOperationLike`). Those operations universally accept the flat\n * `page` / `limit` / `sort` query parameters and return the\n * `{ data, pagination }` envelope (the backend controller forces\n * `paginated: true` for every HTTP LIST/SEARCH dispatch), but NONE of that\n * appears in the operation's request DTO — without this block the generator\n * would document a paginated endpoint with no way to page it.\n *\n * The PROJECTOR resolves the per-operation values (it sees the resolved\n * runtime operation); the GENERATOR owns the universal parameter shapes and\n * the framework-constant defaults (`page` defaults to 1, `limit` to 20 —\n * mirrors of the repository `_doList` defaults). Split chosen so this wire\n * schema stays framework-decoupled: the projection carries FACTS, not\n * OpenAPI fragments.\n *\n * - `maxLimit` — largest accepted `limit` value. Resolved from the\n * operation's `maxPaginatedResultPerPageLimit ?? 50` (the same fallback\n * the frontend HTTP client clamps with; only SEARCH-like operations can\n * author a different cap today).\n * - `sortableFields` — the operation's declared `sortFields` allow-list.\n * Non-empty: only these fields may be named in `sort` (unrecognised\n * fields are silently ignored by the backend validator) and the default\n * ordering is the first entry, descending. Empty: the backend applies\n * any requested field verbatim and defaults to `createdAt:desc`.\n */\n pagination: z.strictObject({\n maxLimit: z.number().int().min(1),\n sortableFields: z.array(z.string().min(1)),\n }).optional(),\n /**\n * Path of the asynchronous callback (`API_CALL_WITH_CALLBACK` only).\n * The generator turns this into an OpenAPI `callbacks:` block\n * referencing the same `responseBodySchema`.\n */\n callbackPath: z.string().min(1).optional(),\n /**\n * Tier-3 authored HTTP documentation, projected from the resource\n * specification's operation overlay. All optional; when present the\n * generator emits real `responses` (success + error), request/response\n * `examples`, an `x-idempotent` extension, and a rate-limit note instead of\n * the default single `200`/`204`. `code` / `forStatus` are OpenAPI status\n * keys (`'200'`, `'404'`, …).\n */\n responseStatuses: z.array(z.strictObject({\n code: z.string().min(1),\n meaning: z.string().min(1),\n })).optional(),\n /**\n * Documented failure modes. `errorType` / `customMessageReference` / `errorCode` are the\n * `error.type` / `error.customMessageReference` / `error.code` values of the error body — three\n * fields a client branches on, kept apart because a client reads them from different places.\n */\n errorScenarios: z.array(z.strictObject({\n code: z.string().min(1),\n when: z.string().min(1),\n errorType: z.string().min(1).optional(),\n customMessageReference: z.string().min(1).optional(),\n errorCode: z.string().min(1).optional(),\n })).optional(),\n idempotent: z.boolean().optional(),\n /**\n * The outbound webhook events this operation fires, if any.\n *\n * Carried on the OPERATION because that is the fact a reader needs where they are standing: a\n * developer looking at `changeStatus` wants to know that calling it notifies every configured\n * endpoint, and a receiver author wants to know which call produced the delivery they are\n * holding. The delivery mechanics — retries, signature, timeouts — belong to the webhook\n * contract and are described once, not per operation.\n */\n m2mNotifications: z.array(z.strictObject({\n /** Stable identifier of the notification declaration. */\n identifier: z.string().min(1),\n /** The channel that carries it, which is also its delivery scope (`webhook_organization`, …). */\n channel: z.string().min(1),\n level: z.string().min(1).optional(),\n })).optional(),\n rateLimitNote: z.string().min(1).optional(),\n examples: z.array(z.strictObject({\n title: z.string().min(1),\n request: z.unknown().optional(),\n response: z.unknown().optional(),\n forStatus: z.string().min(1).optional(),\n })).optional(),\n}).superRefine((projection, ctx) => {\n if (\n projection.identity.variantType !== projection.variantType\n || projection.identity.httpVerb !== projection.httpVerb\n || projection.identity.path !== projection.path\n ) {\n ctx.addIssue({\n code: 'custom',\n path: ['identity'],\n message: 'OperationProjection identity must exactly mirror the resolved variant type, HTTP verb and path.',\n });\n }\n if (projection.variantType === OperationProjectionVariantType.API_CALL_WITH_CALLBACK) {\n if (projection.callbackPath === undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['callbackPath'],\n message:\n `OperationProjection for '${projection.resourceIdentifier}.${projection.operationKey}' ` +\n `has variantType=${OperationProjectionVariantType.API_CALL_WITH_CALLBACK} but no callbackPath. ` +\n `The introspection projector MUST populate callbackPath for callback variants — without it the generator ` +\n `cannot emit an OpenAPI \\`callbacks:\\` block, which would silently produce a misleading doc that ` +\n `looks like a regular synchronous endpoint.`,\n });\n }\n } else if (projection.callbackPath !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['callbackPath'],\n message:\n `OperationProjection for '${projection.resourceIdentifier}.${projection.operationKey}' ` +\n `has callbackPath but variantType=${projection.variantType} (expected ${OperationProjectionVariantType.API_CALL_WITH_CALLBACK}). ` +\n `Reject at parse time so the projector bug surfaces immediately rather than producing a doc with phantom callback metadata.`,\n });\n }\n});\nexport type OperationProjection = z.infer<typeof OperationProjectionSchema>;\n\n/**\n * Closed projection vocabulary mirroring the relationship cardinalities in\n * `@wildo-ai/saas-models`. It deliberately lives in the narrow IPC/OpenAPI\n * contract so the generator and browser never need to import the full resource\n * registry just to render a resource's public relationship semantics.\n */\nexport enum ResourceRelationshipDocumentationCardinality {\n ONE = 'one',\n ZERO_OR_ONE = 'zero_or_one',\n ONE_OR_MANY = 'one_or_many',\n MANY = 'many',\n}\n\n/** The three developer-authored relationship meanings projected into OpenAPI. */\nexport enum ResourceRelationshipDocumentationNature {\n COMPOSITION = 'composition',\n REFERENCE = 'reference',\n ASSOCIATION = 'association',\n}\n\n/** The compiled lifecycle dependency of a relationship, not a presentation hint. */\nexport enum ResourceRelationshipDocumentationLifecycleModel {\n DEPENDENT = 'dependent',\n INDEPENDENT = 'independent',\n LINK_ONLY = 'link_only',\n}\n\n/** Execution timing for an explicitly configured parent-delete lifecycle. */\nexport enum ResourceRelationshipDocumentationDeleteMode {\n IMMEDIATE = 'immediate',\n LAZY = 'lazy',\n}\n\n/** Effect of an explicitly configured parent-delete lifecycle. */\nexport enum ResourceRelationshipDocumentationDeleteStrategy {\n DELETE = 'delete',\n IMPERSONALIZE_AND_RETAIN = 'impersonalize_and_retain',\n /** The parent's delete is refused while related rows exist; nothing is torn down. */\n REFUSE_WHILE_CHILDREN_EXIST = 'refuse_while_children_exist',\n}\n\n/**\n * Consumer words for the relationship vocabularies.\n *\n * Beside the enums rather than in the documentation projection, so the values and the words that\n * explain them cannot drift apart, and a member added to an enum has one obvious place to gain a\n * meaning. Same reason the sign-in methods carry theirs next to `AuthMethod`.\n *\n * `NATURE` deliberately avoids the framework's own vocabulary: a customer reading \"composition\"\n * learns nothing, while \"part of it\" is the thing they can act on.\n */\nexport const RESOURCE_RELATIONSHIP_CARDINALITY_MEANINGS: Readonly<Record<ResourceRelationshipDocumentationCardinality, string>> = Object.freeze({\n [ResourceRelationshipDocumentationCardinality.ONE]: 'exactly one',\n [ResourceRelationshipDocumentationCardinality.ZERO_OR_ONE]: 'at most one',\n [ResourceRelationshipDocumentationCardinality.ONE_OR_MANY]: 'one or more',\n [ResourceRelationshipDocumentationCardinality.MANY]: 'any number of',\n});\n\nexport const RESOURCE_RELATIONSHIP_NATURE_MEANINGS: Readonly<Record<ResourceRelationshipDocumentationNature, string>> = Object.freeze({\n [ResourceRelationshipDocumentationNature.COMPOSITION]: 'Part of it',\n [ResourceRelationshipDocumentationNature.REFERENCE]: 'Points at it',\n [ResourceRelationshipDocumentationNature.ASSOCIATION]: 'Linked to it',\n});\n\n/**\n * One relationship fact from the perspective of a resource OpenAPI tag.\n *\n * `relatedResourceName` and the two cardinalities are deliberately symmetric:\n * resource configurations include both ordinary parent → child relationships\n * and FK-reference declarations, so this public contract must not guess an\n * ownership direction from declaration order. `lifecycleModel` and the\n * optional `onParentDelete` policy carry the framework's already-resolved\n * lifecycle truth without exposing registry implementation details.\n */\nexport const ResourceRelationshipDocumentationSchema = z.strictObject({\n relatedResourceName: z.string().min(1),\n /** Resolved FK identity when the relationship is represented by a field. */\n foreignKeyField: z.string().min(1).optional(),\n resourceCardinality: z.enum(ResourceRelationshipDocumentationCardinality),\n relatedResourceCardinality: z.enum(ResourceRelationshipDocumentationCardinality),\n nature: z.enum(ResourceRelationshipDocumentationNature),\n lifecycleModel: z.enum(ResourceRelationshipDocumentationLifecycleModel),\n onParentDelete: z.strictObject({\n enabled: z.boolean(),\n mode: z.enum(ResourceRelationshipDocumentationDeleteMode),\n strategy: z.enum(ResourceRelationshipDocumentationDeleteStrategy),\n maxDepth: z.number().int().min(0),\n }).optional(),\n});\nexport type ResourceRelationshipDocumentation = z.infer<typeof ResourceRelationshipDocumentationSchema>;\n\n/**\n * A source-declared grouping for resources in one consumer API reference.\n *\n * API resource categories are navigation meaning, not a renderer inference.\n * An application declares the category once in `wildo.tech-doc.config.ts`; the\n * companion attaches it to the corresponding resource tag and the generator\n * transports the fact through strict OpenAPI metadata. The identifier is\n * deliberately application-defined: different products can have genuinely\n * different business domains while still using the same renderer.\n */\nexport const ApiReferenceResourceCategorySchema = z.strictObject({\n /** Stable, readable public identity used in API-reference fragments. */\n id: z.string().regex(/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/).max(100),\n /** Consumer-facing category label displayed by the renderer. */\n label: z.string().min(1).max(200),\n /** Optional category orientation supplied by the application, never React. */\n description: z.string().min(1).max(2000).optional(),\n});\nexport type ApiReferenceResourceCategory = z.infer<typeof ApiReferenceResourceCategorySchema>;\n\n/**\n * Optional per-resource OpenAPI tag descriptor (specification + registry enrichment).\n *\n * The generator groups operations under a tag named after the resource\n * identifier. Each emitted OpenAPI tag has a strict `x-wildo` resource identity;\n * this descriptor enriches it with its specification-owned purpose/lifecycle\n * prose and the compiled relationship facts from the resolved resource graph.\n */\nexport const ResourceTagSchema = z.strictObject({\n /** Must equal the `resourceIdentifier` the generator derives the tag from. */\n name: z.string().min(1),\n /** Business-purpose prose for the resource group. */\n description: z.string().min(1).max(2000).optional(),\n /** Specification-owned explanation of how this resource changes over time. */\n lifecycleRole: z.string().min(1).max(4000).optional(),\n /** Compiled relationship facts relevant to this resource. */\n relationships: z.array(ResourceRelationshipDocumentationSchema).optional(),\n /** Explicit application-owned API-reference navigation grouping. */\n category: ApiReferenceResourceCategorySchema.optional(),\n});\nexport type ResourceTag = z.infer<typeof ResourceTagSchema>;\n\n/**\n * One OpenAPI `servers[]` entry — a base URL the API is reachable at, plus an\n * optional human label. **App-enriched**: deployment URLs are an\n * application/environment concern (the framework cannot know an app's prod\n * domain), so they are authored on `WildoTechnicalDocConfig.apiServers` and\n * threaded into `OpenApiGenerationInput.servers`. The shared shape lives here\n * (the boundary-clean, zod-only module the generator consumes); the config\n * schema imports it so the two never drift.\n */\nexport const OpenApiServerSchema = z.strictObject({\n /**\n * Base URL — the bare ORIGIN the API is served from, e.g.\n * `http://localhost:4241` or `https://api.example.com`. Do NOT append the\n * `/api/v1` mount: the generated operation `paths` are already mount-prefixed\n * (`/api/v1/...`), and the effective request URL is `server.url` + path — so\n * including the mount here would DOUBLE it (`…/api/v1/api/v1/...`).\n */\n url: z.string().min(1),\n /** Optional human label shown in the docs server picker (e.g. \"Production\"). */\n description: z.string().min(1).max(200).optional(),\n});\nexport type OpenApiServer = z.infer<typeof OpenApiServerSchema>;\n\n/**\n * Top-level wire format consumed by the OpenAPI generator. Wrapped\n * in an object so the projector can attach metadata (app slug, build\n * timestamp, framework version) without a schema-shape break later.\n */\nexport const OpenApiGenerationInputSchema = z.strictObject({\n /**\n * App slug from `WildoSaasConfig.slug`. Surfaces in the generated\n * `openapi.info.title` so a\n * multi-app generation run can be disambiguated. Free-string\n * (no validation against `WildoSaasConfigSchema.slug` regex) because\n * the generator should not gate on the same constraint twice; the\n * `defineSaasConfig` parser already enforced the shape at author time.\n */\n appSlug: z.string().min(1),\n /**\n * App display name from `WildoSaasConfig.displayName` — used as the\n * default base title in the generated `openapi.info.title`. The\n * companion route concatenates it with the section name\n * (`\"Wonder Todos API reference\"`).\n */\n appDisplayName: z.string().min(1),\n /**\n * Optional public marketing title from `WildoSaasConfig.technicalDoc.publicMarketingTitle`.\n * When present, replaces `appDisplayName` in the generated title so\n * the OpenAPI docs match the docs site landing page.\n */\n publicMarketingTitle: z.string().min(1).max(200).optional(),\n /** Exact supported public API contract release surfaced in `openapi.info.version`. */\n supportedApiVersion: TechnicalDocumentationSupportedApiVersionSchema,\n /**\n * Flat list of all URL-bearing operation projections. The projector includes\n * every exposed operation and resolves its consumer section explicitly; the\n * generator validates, groups and renders without eligibility inference.\n */\n operations: z.array(OperationProjectionSchema),\n /**\n * JSON Schema for the canonical framework HTTP error envelope. The\n * subprocess converts the same `ErrorResponseSchema` the backend serializes;\n * the generator registers it once as `components.schemas.ErrorResponse` and\n * references it from every documented non-success response. Keeping this\n * here makes the OpenAPI document an exact projection of the runtime wire\n * contract rather than a renderer-owned approximation.\n */\n errorResponseSchema: z.unknown(),\n /**\n * Optional resource → tag-description descriptors. The generator emits each\n * one as an OpenAPI top-level `tags[].description` for the tags it derives\n * from a section's operations; resources without a descriptor still get a\n * bare `{ name }` tag. Order-independent (the generator looks up by `name`).\n */\n resourceTags: z.array(ResourceTagSchema).optional(),\n /**\n * Optional OpenAPI `servers[]` — the base URLs the API is reachable at.\n * App-enriched via `WildoTechnicalDocConfig.apiServers` (deployment URLs are\n * application/environment knowledge, not framework knowledge). When omitted\n * the generator emits no `servers` block (back-compatible with the\n * pre-servers output). Each entry is `{ url, description? }`.\n */\n servers: z.array(OpenApiServerSchema).optional(),\n /**\n * Optional app-authored markdown intro for the API reference landing page,\n * from `WildoTechnicalDocConfig.apiOverview`. The generator PREPENDS it to the\n * framework-universal \"## API conventions\" block (auth / pagination /\n * idempotency / errors — which it always emits) to form `info.description`.\n * App enrichment: the conventions are framework knowledge; the overview is the\n * app's own framing.\n */\n apiOverview: z.string().min(1).max(8000).optional(),\n});\nexport type OpenApiGenerationInput = z.infer<typeof OpenApiGenerationInputSchema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"publish-result.types.d.ts","sourceRoot":"","sources":["../../../../src/companion/publish-result.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,cAAc,EAAE,KAAK,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,WAAW,+BAA+B;IAC9C,aAAa,EAAE,MAAM,CAAC;IACtB,wBAAwB,EAAE,MAAM,CAAC;IACjC,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;;;;;;;;;;OAWG;IACH,8BAA8B,EAAE,KAAK,CAAC;QACpC,QAAQ,EAAE,wBAAwB,CAAC;QACnC,OAAO,EAAE,cAAc,CAAC;QACxB,KAAK,EAAE,MAAM,EAAE,CAAC;KACjB,CAAC,CAAC;IACH;;;;;;;;;;;;;;;;OAgBG;IACH,6BAA6B,EAAE,MAAM,CAAC;IACtC,0CAA0C,EAAE,MAAM,CAAC;IACnD,sCAAsC,EAAE,KAAK,CAAC;QAC5C,kBAAkB,EAAE,MAAM,CAAC;QAC3B,mBAAmB,EAAE,MAAM,CAAC;QAC5B,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B,CAAC,CAAC;IACH,oBAAoB,CAAC,EAAE,KAAK,CAAC;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvE,uBAAuB,CAAC,EAAE,KAAK,CAAC;QAC9B,YAAY,EAAE,MAAM,CAAC;QACrB,YAAY,EAAE,MAAM,CAAC;QACrB,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;IACH,sFAAsF;IACtF,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;CAClC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,iCAAiC;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,iCAAiC;IAChD,SAAS,EAAE,uBAAuB,CAAC;IACnC,KAAK,EAAE,+BAA+B,CAAC;IACvC,QAAQ,EAAE,iCAAiC,CAAC;CAC7C"}
1
+ {"version":3,"file":"publish-result.types.d.ts","sourceRoot":"","sources":["../../../src/companion/publish-result.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,cAAc,EAAE,KAAK,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,WAAW,+BAA+B;IAC9C,aAAa,EAAE,MAAM,CAAC;IACtB,wBAAwB,EAAE,MAAM,CAAC;IACjC,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;;;;;;;;;;OAWG;IACH,8BAA8B,EAAE,KAAK,CAAC;QACpC,QAAQ,EAAE,wBAAwB,CAAC;QACnC,OAAO,EAAE,cAAc,CAAC;QACxB,KAAK,EAAE,MAAM,EAAE,CAAC;KACjB,CAAC,CAAC;IACH;;;;;;;;;;;;;;;;OAgBG;IACH,6BAA6B,EAAE,MAAM,CAAC;IACtC,0CAA0C,EAAE,MAAM,CAAC;IACnD,sCAAsC,EAAE,KAAK,CAAC;QAC5C,kBAAkB,EAAE,MAAM,CAAC;QAC3B,mBAAmB,EAAE,MAAM,CAAC;QAC5B,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B,CAAC,CAAC;IACH,oBAAoB,CAAC,EAAE,KAAK,CAAC;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvE,uBAAuB,CAAC,EAAE,KAAK,CAAC;QAC9B,YAAY,EAAE,MAAM,CAAC;QACrB,YAAY,EAAE,MAAM,CAAC;QACrB,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;IACH,sFAAsF;IACtF,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;CAClC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,iCAAiC;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,iCAAiC;IAChD,SAAS,EAAE,uBAAuB,CAAC;IACnC,KAAK,EAAE,+BAA+B,CAAC;IACvC,QAAQ,EAAE,iCAAiC,CAAC;CAC7C"}
@@ -1 +1 @@
1
- {"version":3,"file":"technical-documentation-authorized-bundle-reader.d.ts","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-authorized-bundle-reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,gDAAgD,EACrD,KAAK,mDAAmD,EACzD,MAAM,uDAAuD,CAAC;AAkB/D,MAAM,WAAW,yCAAyC;IACxD,QAAQ,CAAC,gBAAgB,EAAE,gDAAgD,CAAC;IAC5E,QAAQ,CAAC,mBAAmB,EAAE,mDAAmD,CAAC;IAClF,QAAQ,CAAC,gBAAgB,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CAC5D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,+CAA+C,CAAC,KAAK,EAAE;IACrE,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC,QAAQ,CAAC,mBAAmB,EAAE,OAAO,CAAC;IACtC,QAAQ,CAAC,gBAAgB,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CAC5D,GAAG,yCAAyC,CA+B5C"}
1
+ {"version":3,"file":"technical-documentation-authorized-bundle-reader.d.ts","sourceRoot":"","sources":["../../../../src/companion/rendering/technical-documentation-authorized-bundle-reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,gDAAgD,EACrD,KAAK,mDAAmD,EACzD,MAAM,uDAAuD,CAAC;AAkB/D,MAAM,WAAW,yCAAyC;IACxD,QAAQ,CAAC,gBAAgB,EAAE,gDAAgD,CAAC;IAC5E,QAAQ,CAAC,mBAAmB,EAAE,mDAAmD,CAAC;IAClF,QAAQ,CAAC,gBAAgB,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CAC5D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,+CAA+C,CAAC,KAAK,EAAE;IACrE,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC,QAAQ,CAAC,mBAAmB,EAAE,OAAO,CAAC;IACtC,QAAQ,CAAC,gBAAgB,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CAC5D,GAAG,yCAAyC,CA+B5C"}
@@ -1 +1 @@
1
- {"version":3,"file":"technical-documentation-docusaurus-renderer.d.ts","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-docusaurus-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,mDAAmD,EACxD,KAAK,0CAA0C,EAEhD,MAAM,uDAAuD,CAAC;AAQ/D,OAAO,EAEL,KAAK,iCAAiC,EACtC,KAAK,oCAAoC,EAE1C,MAAM,wCAAwC,CAAC;AAqZhD,wBAAgB,sCAAsC,CAAC,KAAK,EAAE;IAC5D,QAAQ,CAAC,KAAK,EAAE,iCAAiC,CAAC;IAClD,QAAQ,CAAC,mBAAmB,EAAE,mDAAmD,CAAC;IAClF,QAAQ,CAAC,gBAAgB,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC3D;;;;;OAKG;IACH,QAAQ,CAAC,yBAAyB,CAAC,EAAE,CAAC,MAAM,EAAE,0CAA0C,KAAK,MAAM,GAAG,IAAI,CAAC;CAC5G,GAAG,oCAAoC,CAgEvC"}
1
+ {"version":3,"file":"technical-documentation-docusaurus-renderer.d.ts","sourceRoot":"","sources":["../../../../src/companion/rendering/technical-documentation-docusaurus-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,mDAAmD,EACxD,KAAK,0CAA0C,EAEhD,MAAM,uDAAuD,CAAC;AAQ/D,OAAO,EAEL,KAAK,iCAAiC,EACtC,KAAK,oCAAoC,EAE1C,MAAM,wCAAwC,CAAC;AAqZhD,wBAAgB,sCAAsC,CAAC,KAAK,EAAE;IAC5D,QAAQ,CAAC,KAAK,EAAE,iCAAiC,CAAC;IAClD,QAAQ,CAAC,mBAAmB,EAAE,mDAAmD,CAAC;IAClF,QAAQ,CAAC,gBAAgB,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC3D;;;;;OAKG;IACH,QAAQ,CAAC,yBAAyB,CAAC,EAAE,CAAC,MAAM,EAAE,0CAA0C,KAAK,MAAM,GAAG,IAAI,CAAC;CAC5G,GAAG,oCAAoC,CAgEvC"}
@@ -1 +1 @@
1
- {"version":3,"file":"technical-documentation-managed-tree-validator.d.ts","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-managed-tree-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,gDAAgD,EAErD,KAAK,mDAAmD,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AC;IACrD,QAAQ,CAAC,OAAO,EAAE,mCAAmC,CAAC;CACvD,GAAG,iDAAiD,CA0FpD"}
@@ -88,6 +88,25 @@ const INDEPENDENT_API_REFERENCE_ROUTES = new Set([
88
88
  applicationConsumerDocumentationRoutePath(ApplicationConsumerDocumentationRoute.API_REFERENCE),
89
89
  applicationConsumerDocumentationRoutePath(ApplicationConsumerDocumentationRoute.APPLICATION_ADMINISTRATION_API_REFERENCE),
90
90
  ]);
91
+ /** One readable page segment, the shape `apiReferenceResourcePageSlug` produces. */
92
+ const API_REFERENCE_RESOURCE_PAGE_SLUG = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
93
+ /**
94
+ * Whether `path` is a resource's own page under an API-reference root (`/api/<slug>`, #1623).
95
+ *
96
+ * The page exists because the link index derives the href from the same page plan the site's build
97
+ * plugin registers routes from, so the validator only has to refuse what that plan cannot produce:
98
+ * a second path segment, or a segment in any other shape.
99
+ */
100
+ function isApiReferenceResourcePage(path) {
101
+ for (const root of INDEPENDENT_API_REFERENCE_ROUTES) {
102
+ if (!path.startsWith(`${root}/`))
103
+ continue;
104
+ const slug = path.slice(root.length + 1);
105
+ if (API_REFERENCE_RESOURCE_PAGE_SLUG.test(slug))
106
+ return true;
107
+ }
108
+ return false;
109
+ }
91
110
  function validateGeneratedMarkdownLinkClosure(input) {
92
111
  for (const match of input.text.matchAll(GENERATED_MARKDOWN_LINK_PATTERN)) {
93
112
  const destination = match[1];
@@ -100,6 +119,7 @@ function validateGeneratedMarkdownLinkClosure(input) {
100
119
  const rootRelativePath = pathOnly.slice(1);
101
120
  const docusaurusStaticPath = `docusaurus/static/${rootRelativePath}`;
102
121
  if (input.docusaurusRoutes.has(pathOnly)
122
+ || isApiReferenceResourcePage(pathOnly)
103
123
  || (input.sourcePath.startsWith('docusaurus/docs/') ? input.declaredByPath.has(docusaurusStaticPath) : input.declaredByPath.has(rootRelativePath)))
104
124
  continue;
105
125
  throw new Error(`technical-documentation generated link target is absent: ${input.sourcePath} -> ${destination}`);
@@ -1 +1 @@
1
- {"version":3,"file":"technical-documentation-managed-tree-validator.js","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-managed-tree-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gCAAgC,EAChC,kCAAkC,EAClC,kDAAkD,GAInD,MAAM,uDAAuD,CAAC;AAE/D,OAAO,EACL,iCAAiC,GAElC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,qCAAqC,EACrC,yCAAyC,GAC1C,MAAM,qCAAqC,CAAC;AAQ7C;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,8CAA8C,GAAwC,MAAM,CAAC,MAAM,CAAC;IAC/G,gBAAgB,EAAE,KAAK;IACvB,iBAAiB,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI;IACpC,uBAAuB,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI;CAC1C,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,kDAAkD,GAAsB,MAAM,CAAC,MAAM,CAAC;IACjG,qCAAqC;IACrC,uCAAuC;IACvC,6BAA6B;IAC7B,iCAAiC;CAClC,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,UAAU,0CAA0C,CACxD,QAAuD;IAEvD,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,8CAA8C,EAAE,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;AACnG,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,qDAAqD,CACnE,QAA4B;IAE5B,MAAM,SAAS,GAAG,IAAI,GAAG,CAAS,kDAAkD,CAAC,CAAC;IACtF,KAAK,MAAM,QAAQ,IAAI,QAAQ,IAAI,EAAE,EAAE,CAAC;QACtC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;QAChC,mFAAmF;QACnF,kEAAkE;QAClE,IAAI,OAAO,CAAC,MAAM,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AAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAAC;QAC7K,KAAK,MAAM,IAAI,IAAI,kBAAkB,EAAE,CAAC;YACtC;;;;;;eAMG;YACH,MAAM,MAAM,GAAG,cAAc,CAAC,GAAG,CAAC,qBAAqB,IAAI,EAAE,CAAC,CAAC;YAC/D,IAAI,MAAM,EAAE,UAAU,KAAK,gCAAgC,CAAC,KAAK,EAAE,CAAC;gBAClE,MAAM,IAAI,KAAK,CAAC,kFAAkF,IAAI,EAAE,CAAC,CAAC;YAC5G,CAAC;QACH,CAAC;IACH,CAAC;IACD,MAAM,MAAM,GAAG,EAAE,SAAS,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC;IAC3D,IAAI,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,gBAAgB;QAAE,MAAM,IAAI,KAAK,CAAC,iDAAiD,SAAS,EAAE,CAAC,CAAC;IAC9H,IAAI,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,iBAAiB;QAAE,MAAM,IAAI,KAAK,CAAC,uDAAuD,UAAU,EAAE,CAAC,CAAC;IACvI,IAAI,gBAAgB,GAAG,KAAK,CAAC,OAAO,CAAC,uBAAuB;QAAE,MAAM,IAAI,KAAK,CAAC,yDAAyD,gBAAgB,EAAE,CAAC,CAAC;IAC3J,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC;AACD,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC","sourcesContent":["import {\n TechnicalDocumentationOutputKind,\n TechnicalDocumentationRendererKind,\n TechnicalDocumentationRenderOutputManifestV1Schema,\n type TechnicalDocumentationAuthorizedBundleManifestV1,\n type TechnicalDocumentationRenderOutputManifestV1,\n type TechnicalDocumentationResolvedAssetBundleManifestV1,\n} from '@wildo-ai/saas-specifications/technical-documentation';\n\nimport {\n technicalDocumentationSha256Bytes,\n type TechnicalDocumentationRenderedFile,\n} from './technical-documentation-render-model';\nimport {\n ApplicationConsumerDocumentationRoute,\n applicationConsumerDocumentationRoutePath,\n} from '../../openapi/api-reference-targets';\n\nexport interface TechnicalDocumentationOutputBudgets {\n readonly maximumPageCount: number;\n readonly maximumTotalBytes: number;\n readonly maximumSearchIndexBytes: number;\n}\n\n/**\n * Ceilings applied when an application declares none.\n *\n * The point is that ABSENCE is bounded, not that these numbers are precisely right. An\n * application which never thought about output size still gets a documentation tree that\n * cannot silently grow until a build host runs out of memory; one that genuinely outgrows\n * a ceiling raises it explicitly, and that edit is visible in review.\n *\n * Generous on purpose. A default tight enough to be \"safe\" for a small application would\n * fire on ordinary growth, and a limit that routinely fires is a limit people learn to\n * raise without reading — which is worse than no limit at all.\n */\nexport const TECHNICAL_DOCUMENTATION_DEFAULT_OUTPUT_BUDGETS: TechnicalDocumentationOutputBudgets = Object.freeze({\n maximumPageCount: 2_000,\n maximumTotalBytes: 512 * 1024 * 1024,\n maximumSearchIndexBytes: 64 * 1024 * 1024,\n});\n\n/**\n * Sentinels every application inherits, which an application can EXTEND but never remove.\n *\n * ## Why this set is so small\n *\n * A sentinel is matched with `String.includes` against every public file, so a generic\n * marker — `secret`, `token`, `password`, `Bearer` — would fire on the very guides that\n * teach authentication, error handling and webhook signature verification. Those documents\n * legitimately contain those words. A canary that cries on correct content gets removed,\n * and then it protects nothing.\n *\n * So the mandatory set is restricted to byte sequences that **cannot legitimately appear in\n * published product documentation** under any authoring style. A PEM private-key header\n * qualifies: documentation teaches readers to *use* a public key, never to read a private\n * one, so its presence in a public tree is a leak by construction rather than by judgement.\n *\n * Application-specific canaries — a restricted-content marker, a fixture value that must\n * stay internal — belong in the application's own declared list, which is UNIONED with this\n * one. The union direction is the safety property: an application must be able to add\n * canaries and must not be able to switch these off.\n */\nexport const TECHNICAL_DOCUMENTATION_MANDATORY_PUBLIC_SENTINELS: readonly string[] = Object.freeze([\n '-----BEGIN OPENSSH PRIVATE KEY-----',\n '-----BEGIN PGP PRIVATE KEY BLOCK-----',\n '-----BEGIN PRIVATE KEY-----',\n '-----BEGIN RSA PRIVATE KEY-----',\n]);\n\n/**\n * Resolves the effective budgets from an application's partial declaration.\n *\n * Per-field rather than all-or-nothing: an application that only needs a larger page\n * count should not have to restate — and thereby freeze a copy of — every other ceiling.\n */\nexport function resolveTechnicalDocumentationOutputBudgets(\n declared?: Partial<TechnicalDocumentationOutputBudgets>,\n): TechnicalDocumentationOutputBudgets {\n return Object.freeze({ ...TECHNICAL_DOCUMENTATION_DEFAULT_OUTPUT_BUDGETS, ...(declared ?? {}) });\n}\n\n/**\n * Unions the mandatory sentinels with an application's declared ones.\n *\n * A union, never a replacement — see\n * {@link TECHNICAL_DOCUMENTATION_MANDATORY_PUBLIC_SENTINELS}. Deduplicated and sorted so\n * the resolved set is a stable value: it is compared and reported, and an order that\n * varied with authoring order would make two identical policies look different.\n */\nexport function resolveTechnicalDocumentationForbiddenPublicSentinels(\n declared?: readonly string[],\n): readonly string[] {\n const sentinels = new Set<string>(TECHNICAL_DOCUMENTATION_MANDATORY_PUBLIC_SENTINELS);\n for (const sentinel of declared ?? []) {\n const trimmed = sentinel.trim();\n // An empty sentinel is skipped by the validator anyway; dropping it here keeps the\n // resolved set honest about how many canaries are actually armed.\n if (trimmed.length > 0) sentinels.add(trimmed);\n }\n return Object.freeze([...sentinels].sort());\n}\n\nexport interface TechnicalDocumentationManagedTreeValidationReport {\n readonly pageCount: number;\n readonly totalBytes: number;\n readonly searchIndexBytes: number;\n}\n\nconst GENERATED_MARKDOWN_LINK_PATTERN = /!?\\[[^\\]]*\\]\\(([^)\\s]+)(?:\\s+[\"'][^)]*)?\\)/g;\n\n/**\n * Routes published by the API-reference pipeline rather than the guide renderer.\n *\n * API-reference links enter a guide only through the semantic OpenAPI link index,\n * which proves the requested resource, operation, request, response or schema is\n * present before the renderer receives its public URL. The managed-tree validator\n * must therefore recognize the independently published route root while continuing\n * to require every ordinary guide and static-asset target to exist in this exact\n * render manifest.\n */\nconst INDEPENDENT_API_REFERENCE_ROUTES: ReadonlySet<string> = new Set([\n applicationConsumerDocumentationRoutePath(ApplicationConsumerDocumentationRoute.API_REFERENCE),\n applicationConsumerDocumentationRoutePath(ApplicationConsumerDocumentationRoute.APPLICATION_ADMINISTRATION_API_REFERENCE),\n]);\n\nfunction validateGeneratedMarkdownLinkClosure(input: {\n readonly sourcePath: string;\n readonly text: string;\n readonly declaredByPath: ReadonlyMap<string, TechnicalDocumentationRenderOutputManifestV1['outputs'][number]>;\n readonly docusaurusRoutes: ReadonlySet<string>;\n}): void {\n for (const match of input.text.matchAll(GENERATED_MARKDOWN_LINK_PATTERN)) {\n const destination = match[1];\n if (destination === undefined || destination.startsWith('#') || /^(?:https?:|mailto:)/i.test(destination)) continue;\n const pathOnly = destination.split(/[?#]/, 1)[0];\n if (pathOnly === undefined || pathOnly.length === 0) continue;\n if (pathOnly.startsWith('/')) {\n const rootRelativePath = pathOnly.slice(1);\n const docusaurusStaticPath = `docusaurus/static/${rootRelativePath}`;\n if (input.docusaurusRoutes.has(pathOnly)\n || (input.sourcePath.startsWith('docusaurus/docs/') ? input.declaredByPath.has(docusaurusStaticPath) : input.declaredByPath.has(rootRelativePath))) continue;\n throw new Error(`technical-documentation generated link target is absent: ${input.sourcePath} -> ${destination}`);\n }\n const resolvedPath = posixPath.normalize(posixPath.join(posixPath.dirname(input.sourcePath), pathOnly));\n if (resolvedPath.startsWith('../') || posixPath.isAbsolute(resolvedPath) || !input.declaredByPath.has(resolvedPath)) {\n throw new Error(`technical-documentation generated link target is absent: ${input.sourcePath} -> ${destination}`);\n }\n }\n}\n\nexport function validateTechnicalDocumentationManagedTree(input: {\n readonly manifest: unknown;\n readonly files: readonly TechnicalDocumentationRenderedFile[];\n readonly authorizedBundle: TechnicalDocumentationAuthorizedBundleManifestV1;\n readonly resolvedAssetBundle: TechnicalDocumentationResolvedAssetBundleManifestV1;\n readonly forbiddenPublicSentinels: readonly string[];\n readonly budgets: TechnicalDocumentationOutputBudgets;\n}): TechnicalDocumentationManagedTreeValidationReport {\n const manifest: TechnicalDocumentationRenderOutputManifestV1 = TechnicalDocumentationRenderOutputManifestV1Schema.parse(input.manifest);\n /*\n * Binding is an identity comparison between two independently produced manifests, which is a\n * check with two real sides. The `renderOutputDigest` recomputation that used to follow was not:\n * it hashed this manifest and compared the result against the copy stored inside it.\n */\n const boundBundle = manifest.authorizedBundleIdentity;\n if (boundBundle.ref !== input.authorizedBundle.bundleRef || boundBundle.version !== input.authorizedBundle.bundleVersion) {\n throw new Error('technical-documentation render manifest does not bind the authorized bundle');\n }\n const boundAssets = manifest.resolvedAssetBundleIdentity;\n if (boundAssets.ref !== input.resolvedAssetBundle.assetBundleRef || boundAssets.version !== input.resolvedAssetBundle.assetBundleVersion) {\n throw new Error('technical-documentation render manifest does not bind the resolved asset bundle');\n }\n\n const declaredByPath = new Map<string, TechnicalDocumentationRenderOutputManifestV1['outputs'][number]>(\n manifest.outputs.map((output) => [output.normalizedRelativePath, output]),\n );\n const docusaurusRoutes = new Set(manifest.outputs.flatMap((output) => {\n const path = output.normalizedRelativePath as string;\n return path.startsWith('docusaurus/docs/') && path.endsWith('.mdx')\n ? [`/${path.slice('docusaurus/docs/'.length, -'.mdx'.length)}`]\n : [];\n }));\n for (const apiReferenceRoute of INDEPENDENT_API_REFERENCE_ROUTES) docusaurusRoutes.add(apiReferenceRoute);\n const filesByPath = new Map<string, TechnicalDocumentationRenderedFile>();\n for (const file of input.files) {\n if (filesByPath.has(file.normalizedRelativePath)) throw new Error(`technical-documentation managed tree duplicates path: ${file.normalizedRelativePath}`);\n filesByPath.set(file.normalizedRelativePath, file);\n }\n if (filesByPath.size !== declaredByPath.size) throw new Error('technical-documentation managed tree inventory does not match its manifest');\n\n const authorizedUnitRefs = new Set(input.authorizedBundle.units.map((unit) => unit.unitRef));\n let totalBytes = 0;\n let pageCount = 0;\n let searchIndexBytes = 0;\n for (const [path, output] of declaredByPath) {\n const file = filesByPath.get(path);\n if (file === undefined) throw new Error(`technical-documentation managed output is missing: ${path}`);\n if (file.outputRef !== output.outputRef || file.rendererRef !== output.rendererRef || file.outputKind !== output.outputKind\n || file.mediaType !== output.mediaType || [...file.sourceUnitRefs].sort().join('\\0') !== output.sourceUnitRefs.join('\\0')) {\n throw new Error(`technical-documentation managed output metadata mismatch: ${path}`);\n }\n if (file.bytes.byteLength !== output.byteLength || technicalDocumentationSha256Bytes(file.bytes) !== output.byteDigest) {\n throw new Error(`technical-documentation managed output byte identity mismatch: ${path}`);\n }\n for (const sourceUnitRef of output.sourceUnitRefs) {\n if (!authorizedUnitRefs.has(sourceUnitRef)) throw new Error(`technical-documentation output cites an unauthorized unit: ${sourceUnitRef}`);\n }\n const text = Buffer.from(file.bytes).toString('utf8');\n for (const sentinel of input.forbiddenPublicSentinels) {\n if (sentinel.length > 0 && text.includes(sentinel)) throw new Error(`technical-documentation managed public tree contains forbidden sentinel in ${path}`);\n }\n if (output.outputKind === TechnicalDocumentationOutputKind.MARKDOWN_DOCUMENT) {\n validateGeneratedMarkdownLinkClosure({ sourcePath: path, text, declaredByPath, docusaurusRoutes });\n }\n totalBytes += file.bytes.byteLength;\n if (output.outputKind === TechnicalDocumentationOutputKind.HTML_PAGE || output.outputKind === TechnicalDocumentationOutputKind.MARKDOWN_DOCUMENT) pageCount += 1;\n if (path === 'indexes/search.json') searchIndexBytes = file.bytes.byteLength;\n }\n\n /**\n * Captures are source material, not unconditional public output. An API-only\n * publication deliberately has no page renderer that can reference a\n * screenshot, so it must not publish unused product imagery. Once the\n * Docusaurus content renderer participates, every resolved asset remains a\n * required managed output as before.\n */\n if (manifest.rendererExecutions.some((execution) => execution.rendererKind === TechnicalDocumentationRendererKind.DOCUSAURUS)) {\n const resolvedAssetPaths = input.resolvedAssetBundle.resolvedAssetSet.assets.flatMap((asset) => asset.normalizedRelativePath === null ? [] : [asset.normalizedRelativePath]);\n for (const path of resolvedAssetPaths) {\n /*\n * `docusaurus/static/<path>` is where the asset SHIPS — the directory the site serves. This\n * looked for the bare `<path>`, and passed only because a second renderer family published\n * every asset there as well. That family was read by nothing and was removed (#274), which\n * left the check looking for a file no renderer writes any more: the rule is \"a resolved asset\n * reaches the reader\", and the reader reaches it through the site.\n */\n const output = declaredByPath.get(`docusaurus/static/${path}`);\n if (output?.outputKind !== TechnicalDocumentationOutputKind.ASSET) {\n throw new Error(`technical-documentation resolved asset is absent from the managed output tree: ${path}`);\n }\n }\n }\n const report = { pageCount, totalBytes, searchIndexBytes };\n if (pageCount > input.budgets.maximumPageCount) throw new Error(`technical-documentation page budget exceeded: ${pageCount}`);\n if (totalBytes > input.budgets.maximumTotalBytes) throw new Error(`technical-documentation total-byte budget exceeded: ${totalBytes}`);\n if (searchIndexBytes > input.budgets.maximumSearchIndexBytes) throw new Error(`technical-documentation search-index budget exceeded: ${searchIndexBytes}`);\n return Object.freeze(report);\n}\nimport { posix as posixPath } from 'node:path';\n"]}
1
+ {"version":3,"file":"technical-documentation-managed-tree-validator.js","sourceRoot":"","sources":["../../../../src/companion/rendering/technical-documentation-managed-tree-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gCAAgC,EAChC,kCAAkC,EAClC,kDAAkD,GAInD,MAAM,uDAAuD,CAAC;AAE/D,OAAO,EACL,iCAAiC,GAElC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,qCAAqC,EACrC,yCAAyC,GAC1C,MAAM,qCAAqC,CAAC;AAQ7C;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,8CAA8C,GAAwC,MAAM,CAAC,MAAM,CAAC;IAC/G,gBAAgB,EAAE,KAAK;IACvB,iBAAiB,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI;IACpC,uBAAuB,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI;CAC1C,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,kDAAkD,GAAsB,MAAM,CAAC,MAAM,CAAC;IACjG,qCAAq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,GAAG,CAAC,qBAAqB,IAAI,EAAE,CAAC,CAAC;YAC/D,IAAI,MAAM,EAAE,UAAU,KAAK,gCAAgC,CAAC,KAAK,EAAE,CAAC;gBAClE,MAAM,IAAI,KAAK,CAAC,kFAAkF,IAAI,EAAE,CAAC,CAAC;YAC5G,CAAC;QACH,CAAC;IACH,CAAC;IACD,MAAM,MAAM,GAAG,EAAE,SAAS,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC;IAC3D,IAAI,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,gBAAgB;QAAE,MAAM,IAAI,KAAK,CAAC,iDAAiD,SAAS,EAAE,CAAC,CAAC;IAC9H,IAAI,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,iBAAiB;QAAE,MAAM,IAAI,KAAK,CAAC,uDAAuD,UAAU,EAAE,CAAC,CAAC;IACvI,IAAI,gBAAgB,GAAG,KAAK,CAAC,OAAO,CAAC,uBAAuB;QAAE,MAAM,IAAI,KAAK,CAAC,yDAAyD,gBAAgB,EAAE,CAAC,CAAC;IAC3J,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC;AACD,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC","sourcesContent":["import {\n TechnicalDocumentationOutputKind,\n TechnicalDocumentationRendererKind,\n TechnicalDocumentationRenderOutputManifestV1Schema,\n type TechnicalDocumentationAuthorizedBundleManifestV1,\n type TechnicalDocumentationRenderOutputManifestV1,\n type TechnicalDocumentationResolvedAssetBundleManifestV1,\n} from '@wildo-ai/saas-specifications/technical-documentation';\n\nimport {\n technicalDocumentationSha256Bytes,\n type TechnicalDocumentationRenderedFile,\n} from './technical-documentation-render-model';\nimport {\n ApplicationConsumerDocumentationRoute,\n applicationConsumerDocumentationRoutePath,\n} from '../../openapi/api-reference-targets';\n\nexport interface TechnicalDocumentationOutputBudgets {\n readonly maximumPageCount: number;\n readonly maximumTotalBytes: number;\n readonly maximumSearchIndexBytes: number;\n}\n\n/**\n * Ceilings applied when an application declares none.\n *\n * The point is that ABSENCE is bounded, not that these numbers are precisely right. An\n * application which never thought about output size still gets a documentation tree that\n * cannot silently grow until a build host runs out of memory; one that genuinely outgrows\n * a ceiling raises it explicitly, and that edit is visible in review.\n *\n * Generous on purpose. A default tight enough to be \"safe\" for a small application would\n * fire on ordinary growth, and a limit that routinely fires is a limit people learn to\n * raise without reading — which is worse than no limit at all.\n */\nexport const TECHNICAL_DOCUMENTATION_DEFAULT_OUTPUT_BUDGETS: TechnicalDocumentationOutputBudgets = Object.freeze({\n maximumPageCount: 2_000,\n maximumTotalBytes: 512 * 1024 * 1024,\n maximumSearchIndexBytes: 64 * 1024 * 1024,\n});\n\n/**\n * Sentinels every application inherits, which an application can EXTEND but never remove.\n *\n * ## Why this set is so small\n *\n * A sentinel is matched with `String.includes` against every public file, so a generic\n * marker — `secret`, `token`, `password`, `Bearer` — would fire on the very guides that\n * teach authentication, error handling and webhook signature verification. Those documents\n * legitimately contain those words. A canary that cries on correct content gets removed,\n * and then it protects nothing.\n *\n * So the mandatory set is restricted to byte sequences that **cannot legitimately appear in\n * published product documentation** under any authoring style. A PEM private-key header\n * qualifies: documentation teaches readers to *use* a public key, never to read a private\n * one, so its presence in a public tree is a leak by construction rather than by judgement.\n *\n * Application-specific canaries — a restricted-content marker, a fixture value that must\n * stay internal — belong in the application's own declared list, which is UNIONED with this\n * one. The union direction is the safety property: an application must be able to add\n * canaries and must not be able to switch these off.\n */\nexport const TECHNICAL_DOCUMENTATION_MANDATORY_PUBLIC_SENTINELS: readonly string[] = Object.freeze([\n '-----BEGIN OPENSSH PRIVATE KEY-----',\n '-----BEGIN PGP PRIVATE KEY BLOCK-----',\n '-----BEGIN PRIVATE KEY-----',\n '-----BEGIN RSA PRIVATE KEY-----',\n]);\n\n/**\n * Resolves the effective budgets from an application's partial declaration.\n *\n * Per-field rather than all-or-nothing: an application that only needs a larger page\n * count should not have to restate — and thereby freeze a copy of — every other ceiling.\n */\nexport function resolveTechnicalDocumentationOutputBudgets(\n declared?: Partial<TechnicalDocumentationOutputBudgets>,\n): TechnicalDocumentationOutputBudgets {\n return Object.freeze({ ...TECHNICAL_DOCUMENTATION_DEFAULT_OUTPUT_BUDGETS, ...(declared ?? {}) });\n}\n\n/**\n * Unions the mandatory sentinels with an application's declared ones.\n *\n * A union, never a replacement — see\n * {@link TECHNICAL_DOCUMENTATION_MANDATORY_PUBLIC_SENTINELS}. Deduplicated and sorted so\n * the resolved set is a stable value: it is compared and reported, and an order that\n * varied with authoring order would make two identical policies look different.\n */\nexport function resolveTechnicalDocumentationForbiddenPublicSentinels(\n declared?: readonly string[],\n): readonly string[] {\n const sentinels = new Set<string>(TECHNICAL_DOCUMENTATION_MANDATORY_PUBLIC_SENTINELS);\n for (const sentinel of declared ?? []) {\n const trimmed = sentinel.trim();\n // An empty sentinel is skipped by the validator anyway; dropping it here keeps the\n // resolved set honest about how many canaries are actually armed.\n if (trimmed.length > 0) sentinels.add(trimmed);\n }\n return Object.freeze([...sentinels].sort());\n}\n\nexport interface TechnicalDocumentationManagedTreeValidationReport {\n readonly pageCount: number;\n readonly totalBytes: number;\n readonly searchIndexBytes: number;\n}\n\nconst GENERATED_MARKDOWN_LINK_PATTERN = /!?\\[[^\\]]*\\]\\(([^)\\s]+)(?:\\s+[\"'][^)]*)?\\)/g;\n\n/**\n * Routes published by the API-reference pipeline rather than the guide renderer.\n *\n * API-reference links enter a guide only through the semantic OpenAPI link index,\n * which proves the requested resource, operation, request, response or schema is\n * present before the renderer receives its public URL. The managed-tree validator\n * must therefore recognize the independently published route root while continuing\n * to require every ordinary guide and static-asset target to exist in this exact\n * render manifest.\n */\nconst INDEPENDENT_API_REFERENCE_ROUTES: ReadonlySet<string> = new Set([\n applicationConsumerDocumentationRoutePath(ApplicationConsumerDocumentationRoute.API_REFERENCE),\n applicationConsumerDocumentationRoutePath(ApplicationConsumerDocumentationRoute.APPLICATION_ADMINISTRATION_API_REFERENCE),\n]);\n\n/** One readable page segment, the shape `apiReferenceResourcePageSlug` produces. */\nconst API_REFERENCE_RESOURCE_PAGE_SLUG = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;\n\n/**\n * Whether `path` is a resource's own page under an API-reference root (`/api/<slug>`, #1623).\n *\n * The page exists because the link index derives the href from the same page plan the site's build\n * plugin registers routes from, so the validator only has to refuse what that plan cannot produce:\n * a second path segment, or a segment in any other shape.\n */\nfunction isApiReferenceResourcePage(path: string): boolean {\n for (const root of INDEPENDENT_API_REFERENCE_ROUTES) {\n if (!path.startsWith(`${root}/`)) continue;\n const slug = path.slice(root.length + 1);\n if (API_REFERENCE_RESOURCE_PAGE_SLUG.test(slug)) return true;\n }\n return false;\n}\n\nfunction validateGeneratedMarkdownLinkClosure(input: {\n readonly sourcePath: string;\n readonly text: string;\n readonly declaredByPath: ReadonlyMap<string, TechnicalDocumentationRenderOutputManifestV1['outputs'][number]>;\n readonly docusaurusRoutes: ReadonlySet<string>;\n}): void {\n for (const match of input.text.matchAll(GENERATED_MARKDOWN_LINK_PATTERN)) {\n const destination = match[1];\n if (destination === undefined || destination.startsWith('#') || /^(?:https?:|mailto:)/i.test(destination)) continue;\n const pathOnly = destination.split(/[?#]/, 1)[0];\n if (pathOnly === undefined || pathOnly.length === 0) continue;\n if (pathOnly.startsWith('/')) {\n const rootRelativePath = pathOnly.slice(1);\n const docusaurusStaticPath = `docusaurus/static/${rootRelativePath}`;\n if (input.docusaurusRoutes.has(pathOnly)\n || isApiReferenceResourcePage(pathOnly)\n || (input.sourcePath.startsWith('docusaurus/docs/') ? input.declaredByPath.has(docusaurusStaticPath) : input.declaredByPath.has(rootRelativePath))) continue;\n throw new Error(`technical-documentation generated link target is absent: ${input.sourcePath} -> ${destination}`);\n }\n const resolvedPath = posixPath.normalize(posixPath.join(posixPath.dirname(input.sourcePath), pathOnly));\n if (resolvedPath.startsWith('../') || posixPath.isAbsolute(resolvedPath) || !input.declaredByPath.has(resolvedPath)) {\n throw new Error(`technical-documentation generated link target is absent: ${input.sourcePath} -> ${destination}`);\n }\n }\n}\n\nexport function validateTechnicalDocumentationManagedTree(input: {\n readonly manifest: unknown;\n readonly files: readonly TechnicalDocumentationRenderedFile[];\n readonly authorizedBundle: TechnicalDocumentationAuthorizedBundleManifestV1;\n readonly resolvedAssetBundle: TechnicalDocumentationResolvedAssetBundleManifestV1;\n readonly forbiddenPublicSentinels: readonly string[];\n readonly budgets: TechnicalDocumentationOutputBudgets;\n}): TechnicalDocumentationManagedTreeValidationReport {\n const manifest: TechnicalDocumentationRenderOutputManifestV1 = TechnicalDocumentationRenderOutputManifestV1Schema.parse(input.manifest);\n /*\n * Binding is an identity comparison between two independently produced manifests, which is a\n * check with two real sides. The `renderOutputDigest` recomputation that used to follow was not:\n * it hashed this manifest and compared the result against the copy stored inside it.\n */\n const boundBundle = manifest.authorizedBundleIdentity;\n if (boundBundle.ref !== input.authorizedBundle.bundleRef || boundBundle.version !== input.authorizedBundle.bundleVersion) {\n throw new Error('technical-documentation render manifest does not bind the authorized bundle');\n }\n const boundAssets = manifest.resolvedAssetBundleIdentity;\n if (boundAssets.ref !== input.resolvedAssetBundle.assetBundleRef || boundAssets.version !== input.resolvedAssetBundle.assetBundleVersion) {\n throw new Error('technical-documentation render manifest does not bind the resolved asset bundle');\n }\n\n const declaredByPath = new Map<string, TechnicalDocumentationRenderOutputManifestV1['outputs'][number]>(\n manifest.outputs.map((output) => [output.normalizedRelativePath, output]),\n );\n const docusaurusRoutes = new Set(manifest.outputs.flatMap((output) => {\n const path = output.normalizedRelativePath as string;\n return path.startsWith('docusaurus/docs/') && path.endsWith('.mdx')\n ? [`/${path.slice('docusaurus/docs/'.length, -'.mdx'.length)}`]\n : [];\n }));\n for (const apiReferenceRoute of INDEPENDENT_API_REFERENCE_ROUTES) docusaurusRoutes.add(apiReferenceRoute);\n const filesByPath = new Map<string, TechnicalDocumentationRenderedFile>();\n for (const file of input.files) {\n if (filesByPath.has(file.normalizedRelativePath)) throw new Error(`technical-documentation managed tree duplicates path: ${file.normalizedRelativePath}`);\n filesByPath.set(file.normalizedRelativePath, file);\n }\n if (filesByPath.size !== declaredByPath.size) throw new Error('technical-documentation managed tree inventory does not match its manifest');\n\n const authorizedUnitRefs = new Set(input.authorizedBundle.units.map((unit) => unit.unitRef));\n let totalBytes = 0;\n let pageCount = 0;\n let searchIndexBytes = 0;\n for (const [path, output] of declaredByPath) {\n const file = filesByPath.get(path);\n if (file === undefined) throw new Error(`technical-documentation managed output is missing: ${path}`);\n if (file.outputRef !== output.outputRef || file.rendererRef !== output.rendererRef || file.outputKind !== output.outputKind\n || file.mediaType !== output.mediaType || [...file.sourceUnitRefs].sort().join('\\0') !== output.sourceUnitRefs.join('\\0')) {\n throw new Error(`technical-documentation managed output metadata mismatch: ${path}`);\n }\n if (file.bytes.byteLength !== output.byteLength || technicalDocumentationSha256Bytes(file.bytes) !== output.byteDigest) {\n throw new Error(`technical-documentation managed output byte identity mismatch: ${path}`);\n }\n for (const sourceUnitRef of output.sourceUnitRefs) {\n if (!authorizedUnitRefs.has(sourceUnitRef)) throw new Error(`technical-documentation output cites an unauthorized unit: ${sourceUnitRef}`);\n }\n const text = Buffer.from(file.bytes).toString('utf8');\n for (const sentinel of input.forbiddenPublicSentinels) {\n if (sentinel.length > 0 && text.includes(sentinel)) throw new Error(`technical-documentation managed public tree contains forbidden sentinel in ${path}`);\n }\n if (output.outputKind === TechnicalDocumentationOutputKind.MARKDOWN_DOCUMENT) {\n validateGeneratedMarkdownLinkClosure({ sourcePath: path, text, declaredByPath, docusaurusRoutes });\n }\n totalBytes += file.bytes.byteLength;\n if (output.outputKind === TechnicalDocumentationOutputKind.HTML_PAGE || output.outputKind === TechnicalDocumentationOutputKind.MARKDOWN_DOCUMENT) pageCount += 1;\n if (path === 'indexes/search.json') searchIndexBytes = file.bytes.byteLength;\n }\n\n /**\n * Captures are source material, not unconditional public output. An API-only\n * publication deliberately has no page renderer that can reference a\n * screenshot, so it must not publish unused product imagery. Once the\n * Docusaurus content renderer participates, every resolved asset remains a\n * required managed output as before.\n */\n if (manifest.rendererExecutions.some((execution) => execution.rendererKind === TechnicalDocumentationRendererKind.DOCUSAURUS)) {\n const resolvedAssetPaths = input.resolvedAssetBundle.resolvedAssetSet.assets.flatMap((asset) => asset.normalizedRelativePath === null ? [] : [asset.normalizedRelativePath]);\n for (const path of resolvedAssetPaths) {\n /*\n * `docusaurus/static/<path>` is where the asset SHIPS — the directory the site serves. This\n * looked for the bare `<path>`, and passed only because a second renderer family published\n * every asset there as well. That family was read by nothing and was removed (#274), which\n * left the check looking for a file no renderer writes any more: the rule is \"a resolved asset\n * reaches the reader\", and the reader reaches it through the site.\n */\n const output = declaredByPath.get(`docusaurus/static/${path}`);\n if (output?.outputKind !== TechnicalDocumentationOutputKind.ASSET) {\n throw new Error(`technical-documentation resolved asset is absent from the managed output tree: ${path}`);\n }\n }\n }\n const report = { pageCount, totalBytes, searchIndexBytes };\n if (pageCount > input.budgets.maximumPageCount) throw new Error(`technical-documentation page budget exceeded: ${pageCount}`);\n if (totalBytes > input.budgets.maximumTotalBytes) throw new Error(`technical-documentation total-byte budget exceeded: ${totalBytes}`);\n if (searchIndexBytes > input.budgets.maximumSearchIndexBytes) throw new Error(`technical-documentation search-index budget exceeded: ${searchIndexBytes}`);\n return Object.freeze(report);\n}\nimport { posix as posixPath } from 'node:path';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"technical-documentation-markdown-links.d.ts","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-markdown-links.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,EAAG,UAAmB,CAAC;AAEjE,wBAAgB,qBAAqB,CAAC,OAAO,EAAE;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAEnG;AAUD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,EAAE,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,CAahJ"}
1
+ {"version":3,"file":"technical-documentation-markdown-links.d.ts","sourceRoot":"","sources":["../../../../src/companion/rendering/technical-documentation-markdown-links.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,EAAG,UAAmB,CAAC;AAEjE,wBAAgB,qBAAqB,CAAC,OAAO,EAAE;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAEnG;AAUD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,EAAE,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,CAahJ"}
@@ -1,5 +1,7 @@
1
1
  import { type OpenApiGenerationOutput } from '../../openapi/openapi-generation-output.schemas';
2
2
  import { type TechnicalDocumentationRendererResult } from './technical-documentation-render-model';
3
+ /** Where the API reference's search entries land, relative to the generated API-reference root. */
4
+ export declare const API_REFERENCE_SEARCH_INDEX_RELATIVE_PATH = "indexes/api-reference-search.json";
3
5
  export declare function renderVerifiedTechnicalDocumentationOpenApi(input: {
4
6
  readonly documents: OpenApiGenerationOutput;
5
7
  readonly sourceUnitRefs: readonly string[];
@@ -1 +1 @@
1
- {"version":3,"file":"technical-documentation-openapi-renderer.d.ts","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-openapi-renderer.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAEL,KAAK,oCAAoC,EAC1C,MAAM,wCAAwC,CAAC;AAIhD,wBAAgB,2CAA2C,CAAC,KAAK,EAAE;IACjE,QAAQ,CAAC,SAAS,EAAE,uBAAuB,CAAC;IAC5C,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;CAC5C,GAAG,oCAAoC,CA2CvC"}
1
+ {"version":3,"file":"technical-documentation-openapi-renderer.d.ts","sourceRoot":"","sources":["../../../../src/companion/rendering/technical-documentation-openapi-renderer.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAEL,KAAK,oCAAoC,EAC1C,MAAM,wCAAwC,CAAC;AAIhD,mGAAmG;AACnG,eAAO,MAAM,wCAAwC,sCAAsC,CAAC;AAE5F,wBAAgB,2CAA2C,CAAC,KAAK,EAAE;IACjE,QAAQ,CAAC,SAAS,EAAE,uBAAuB,CAAC;IAC5C,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;CAC5C,GAAG,oCAAoC,CAyDvC"}