@owox/backend 0.37.0 → 0.39.0

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 (264) hide show
  1. package/dist/src/common/helpers/read-bounded-body.helper.d.ts +1 -0
  2. package/dist/src/common/helpers/read-bounded-body.helper.js +28 -0
  3. package/dist/src/common/scheduler/system-tasks/system-trigger-type.d.ts +3 -1
  4. package/dist/src/common/scheduler/system-tasks/system-trigger-type.js +2 -0
  5. package/dist/src/common/search/search.facade.d.ts +1 -0
  6. package/dist/src/config/data-source-options.config.d.ts +4 -3
  7. package/dist/src/config/data-source-options.config.js +10 -3
  8. package/dist/src/config/plugin-collections-body-parser.config.js +3 -0
  9. package/dist/src/data-marts/credentials/credential.types.d.ts +26 -2
  10. package/dist/src/data-marts/credentials/credential.types.js +18 -6
  11. package/dist/src/data-marts/credentials/dto/credential-api.dto.d.ts +5 -1
  12. package/dist/src/data-marts/credentials/dto/credential-api.dto.js +21 -0
  13. package/dist/src/data-marts/credentials/dto/credential.dto.d.ts +2 -1
  14. package/dist/src/data-marts/credentials/entities/credential.entity.d.ts +2 -1
  15. package/dist/src/data-marts/credentials/entities/credential.entity.js +5 -0
  16. package/dist/src/data-marts/credentials/facades/credential-consumer-binding.facade.impl.js +6 -1
  17. package/dist/src/data-marts/credentials/mappers/credential.mapper.js +2 -0
  18. package/dist/src/data-marts/credentials/services/builtin-credential-definitions.js +8 -0
  19. package/dist/src/data-marts/credentials/services/credential-external-definition-registry.service.d.ts +4 -0
  20. package/dist/src/data-marts/credentials/services/credential-external-definition-registry.service.js +36 -17
  21. package/dist/src/data-marts/credentials/services/credential-fetch.service.d.ts +8 -0
  22. package/dist/src/data-marts/credentials/services/credential-fetch.service.js +115 -46
  23. package/dist/src/data-marts/credentials/services/credential-validation-probe.service.d.ts +3 -1
  24. package/dist/src/data-marts/credentials/services/credential-validation-probe.service.js +10 -2
  25. package/dist/src/data-marts/credentials/services/credential.service.d.ts +4 -0
  26. package/dist/src/data-marts/credentials/services/credential.service.js +36 -0
  27. package/dist/src/data-marts/credentials/services/google-service-account-key.d.ts +6 -0
  28. package/dist/src/data-marts/credentials/services/google-service-account-key.js +46 -0
  29. package/dist/src/data-marts/credentials/services/google-service-account-token.service.d.ts +25 -0
  30. package/dist/src/data-marts/credentials/services/google-service-account-token.service.js +177 -0
  31. package/dist/src/data-marts/credentials/use-cases/create-credential.service.d.ts +1 -0
  32. package/dist/src/data-marts/credentials/use-cases/create-credential.service.js +10 -2
  33. package/dist/src/data-marts/credentials/use-cases/update-credential.service.d.ts +1 -0
  34. package/dist/src/data-marts/credentials/use-cases/update-credential.service.js +28 -4
  35. package/dist/src/data-marts/credentials/use-cases/validate-credential.service.js +2 -5
  36. package/dist/src/data-marts/data-destination-types/ee/email/services/email-credentials-validator.js +1 -3
  37. package/dist/src/data-marts/data-destination-types/ee/google-chat/services/google-chat-credentials-validator.js +1 -3
  38. package/dist/src/data-marts/data-destination-types/google-sheets/services/google-sheets-credentials-validator.js +1 -3
  39. package/dist/src/data-marts/data-destination-types/google-sheets/services/google-sheets-report-writer.d.ts +1 -0
  40. package/dist/src/data-marts/data-destination-types/google-sheets/services/google-sheets-report-writer.js +13 -1
  41. package/dist/src/data-marts/data-destination-types/interfaces/data-destination-credentials-validator.interface.d.ts +2 -0
  42. package/dist/src/data-marts/data-destination-types/interfaces/data-destination-credentials-validator.interface.js +7 -0
  43. package/dist/src/data-marts/data-destination-types/looker-studio-connector/services/looker-studio-connector-credentials-validator.js +1 -3
  44. package/dist/src/data-marts/data-marts.module.js +8 -0
  45. package/dist/src/data-marts/data-storage-types/athena/adapters/athena-api.adapter.js +2 -1
  46. package/dist/src/data-marts/data-storage-types/athena/adapters/s3-api.adapter.js +5 -3
  47. package/dist/src/data-marts/data-storage-types/athena/services/athena-access.validator.js +2 -4
  48. package/dist/src/data-marts/data-storage-types/athena/utils/athena-output-location.util.d.ts +5 -0
  49. package/dist/src/data-marts/data-storage-types/athena/utils/athena-output-location.util.js +13 -0
  50. package/dist/src/data-marts/data-storage-types/bigquery/services/bigquery-access.validator.js +2 -4
  51. package/dist/src/data-marts/data-storage-types/bigquery/services/bigquery-resource-location.util.d.ts +3 -0
  52. package/dist/src/data-marts/data-storage-types/bigquery/services/bigquery-resource-location.util.js +18 -0
  53. package/dist/src/data-marts/data-storage-types/bigquery/services/bigquery-sharded-tables.util.d.ts +1 -0
  54. package/dist/src/data-marts/data-storage-types/bigquery/services/bigquery-sharded-tables.util.js +4 -1
  55. package/dist/src/data-marts/data-storage-types/bigquery/services/bigquery-storage-resource-browser.service.js +12 -5
  56. package/dist/src/data-marts/data-storage-types/databricks/services/databricks-access.validator.js +2 -4
  57. package/dist/src/data-marts/data-storage-types/interfaces/data-storage-access-validator.interface.d.ts +3 -0
  58. package/dist/src/data-marts/data-storage-types/interfaces/data-storage-access-validator.interface.js +7 -0
  59. package/dist/src/data-marts/data-storage-types/interfaces/storage-resource-browser.interface.d.ts +2 -0
  60. package/dist/src/data-marts/data-storage-types/redshift/services/redshift-access.validator.js +2 -6
  61. package/dist/src/data-marts/data-storage-types/snowflake/adapters/snowflake-api.adapter.js +1 -0
  62. package/dist/src/data-marts/data-storage-types/snowflake/services/snowflake-access.validator.js +2 -4
  63. package/dist/src/data-marts/dto/domain/list-data-marts.command.d.ts +2 -1
  64. package/dist/src/data-marts/dto/domain/list-data-marts.command.js +3 -1
  65. package/dist/src/data-marts/dto/presentation/run-data-mart-request-api.dto.js +4 -2
  66. package/dist/src/data-marts/dto/presentation/sql-dry-run-request-api.dto.js +3 -0
  67. package/dist/src/data-marts/dto/presentation/storage-resources/list-storage-resources-response.dto.d.ts +2 -0
  68. package/dist/src/data-marts/dto/presentation/storage-resources/list-storage-resources-response.dto.js +17 -0
  69. package/dist/src/data-marts/errors/google-sheets-api-call.error.d.ts +6 -0
  70. package/dist/src/data-marts/errors/google-sheets-api-call.error.js +34 -0
  71. package/dist/src/data-marts/facades/mcp-contexts.facade.d.ts +13 -0
  72. package/dist/src/data-marts/facades/mcp-contexts.facade.impl.d.ts +9 -0
  73. package/dist/src/data-marts/facades/mcp-contexts.facade.impl.js +35 -0
  74. package/dist/src/data-marts/facades/mcp-contexts.facade.js +5 -0
  75. package/dist/src/data-marts/facades/mcp-data-marts.facade.d.ts +9 -0
  76. package/dist/src/data-marts/facades/mcp-data-marts.facade.impl.js +4 -1
  77. package/dist/src/data-marts/mappers/context.mapper.d.ts +4 -0
  78. package/dist/src/data-marts/mappers/context.mapper.js +12 -0
  79. package/dist/src/data-marts/search/engine/advanced-search.service.js +1 -0
  80. package/dist/src/data-marts/search/engine/in-memory-paginated.search.js +17 -1
  81. package/dist/src/data-marts/search/engine/vector-search.port.d.ts +1 -0
  82. package/dist/src/data-marts/services/connector/backfill-segment.d.ts +22 -0
  83. package/dist/src/data-marts/services/connector/backfill-segment.js +91 -0
  84. package/dist/src/data-marts/services/connector/connector-execution.service.d.ts +1 -0
  85. package/dist/src/data-marts/services/connector/connector-execution.service.js +3 -0
  86. package/dist/src/data-marts/services/connector/connector-executor.service.d.ts +4 -1
  87. package/dist/src/data-marts/services/connector/connector-executor.service.js +107 -23
  88. package/dist/src/data-marts/services/connector/connector-run.service.d.ts +3 -0
  89. package/dist/src/data-marts/services/connector/connector-run.service.js +98 -4
  90. package/dist/src/data-marts/services/context/context.service.d.ts +2 -0
  91. package/dist/src/data-marts/services/context/context.service.js +21 -0
  92. package/dist/src/data-marts/services/data-mart-run.service.d.ts +1 -0
  93. package/dist/src/data-marts/services/data-mart-run.service.js +9 -0
  94. package/dist/src/data-marts/services/data-mart.service.d.ts +1 -0
  95. package/dist/src/data-marts/services/data-mart.service.js +3 -0
  96. package/dist/src/data-marts/system-triggers/processors/repair-backfill-chains-processor.d.ts +14 -0
  97. package/dist/src/data-marts/system-triggers/processors/repair-backfill-chains-processor.js +45 -0
  98. package/dist/src/data-marts/use-cases/cancel-data-mart-run.service.d.ts +4 -0
  99. package/dist/src/data-marts/use-cases/cancel-data-mart-run.service.js +46 -1
  100. package/dist/src/data-marts/use-cases/list-data-marts.service.js +1 -0
  101. package/dist/src/data-marts/use-cases/stream-http-data.service.d.ts +0 -1
  102. package/dist/src/data-marts/use-cases/stream-http-data.service.js +2 -6
  103. package/dist/src/data-marts/use-cases/update-data-storage.service.js +7 -7
  104. package/dist/src/data-marts/utils/field-errors.utils.d.ts +9 -0
  105. package/dist/src/data-marts/utils/field-errors.utils.js +51 -0
  106. package/dist/src/data-marts/utils/manual-backfill-range.d.ts +52 -0
  107. package/dist/src/data-marts/utils/manual-backfill-range.js +110 -8
  108. package/dist/src/ee/mcp/instructions/mcp-system-instructions.d.ts +1 -1
  109. package/dist/src/ee/mcp/instructions/mcp-system-instructions.js +4 -0
  110. package/dist/src/ee/mcp/sdk/mcp-output-schema.d.ts +3 -0
  111. package/dist/src/ee/mcp/sdk/mcp-output-schema.js +53 -0
  112. package/dist/src/ee/mcp/sdk/mcp-schema-refresh.d.ts +8 -0
  113. package/dist/src/ee/mcp/sdk/mcp-schema-refresh.js +44 -0
  114. package/dist/src/ee/mcp/sdk/mcp-sdk-server.factory.d.ts +8 -1
  115. package/dist/src/ee/mcp/sdk/mcp-sdk-server.factory.js +35 -4
  116. package/dist/src/ee/mcp/tools/context-input.d.ts +6 -0
  117. package/dist/src/ee/mcp/tools/context-input.js +13 -0
  118. package/dist/src/ee/mcp/tools/data-mart-catalog.tool.d.ts +10 -2
  119. package/dist/src/ee/mcp/tools/data-mart-catalog.tool.js +17 -5
  120. package/dist/src/ee/mcp/tools/data-mart-details.tool.d.ts +5 -1
  121. package/dist/src/ee/mcp/tools/data-mart-details.tool.js +4 -1
  122. package/dist/src/ee/mcp/tools/list-contexts.tool.d.ts +131 -0
  123. package/dist/src/ee/mcp/tools/list-contexts.tool.js +50 -0
  124. package/dist/src/ee/mcp/tools/mcp-tool.providers.js +2 -0
  125. package/dist/src/ee/mcp/tools/search-data-marts.tool.d.ts +10 -2
  126. package/dist/src/ee/mcp/tools/search-data-marts.tool.js +17 -3
  127. package/dist/src/ee/mcp/transport/mcp-http-entry.service.js +1 -1
  128. package/dist/src/idp/decorators/auth-context.decorator.js +1 -0
  129. package/dist/src/idp/guards/idp.guard.d.ts +3 -0
  130. package/dist/src/idp/guards/idp.guard.js +38 -8
  131. package/dist/src/idp/oauth/controllers/oauth-authorization.controller.js +8 -6
  132. package/dist/src/idp/oauth/mcp-client-integration.d.ts +1 -0
  133. package/dist/src/idp/oauth/mcp-client-integration.js +15 -0
  134. package/dist/src/idp/ports/plugin-runtime-authorizer.port.d.ts +6 -0
  135. package/dist/src/idp/types/auth.types.d.ts +1 -0
  136. package/dist/src/migrations/1790830000000-widen-sql-dry-run-trigger-sql-column.d.ts +6 -0
  137. package/dist/src/migrations/1790830000000-widen-sql-dry-run-trigger-sql-column.js +21 -0
  138. package/dist/src/migrations/1790900000000-add-plugin-version-backend.d.ts +6 -0
  139. package/dist/src/migrations/1790900000000-add-plugin-version-backend.js +21 -0
  140. package/dist/src/migrations/1790900000001-create-plugin-action-execution.d.ts +6 -0
  141. package/dist/src/migrations/1790900000001-create-plugin-action-execution.js +77 -0
  142. package/dist/src/migrations/1791000000000-add-credential-public-metadata.d.ts +6 -0
  143. package/dist/src/migrations/1791000000000-add-credential-public-metadata.js +23 -0
  144. package/dist/src/plugin-host/collections/dto/domain/plugin-collection.types.d.ts +1 -0
  145. package/dist/src/plugin-host/collections/errors/plugin-collection.errors.d.ts +6 -0
  146. package/dist/src/plugin-host/collections/errors/plugin-collection.errors.js +19 -1
  147. package/dist/src/plugin-host/collections/services/plugin-collection-declaration.service.js +3 -3
  148. package/dist/src/plugin-host/collections/use-cases/put-plugin-collection-document.service.js +7 -0
  149. package/dist/src/plugin-host/constants/plugin-action-limits.d.ts +34 -0
  150. package/dist/src/plugin-host/constants/plugin-action-limits.js +51 -0
  151. package/dist/src/plugin-host/controllers/plugin-action-runtime.controller.d.ts +20 -0
  152. package/dist/src/plugin-host/controllers/plugin-action-runtime.controller.js +123 -0
  153. package/dist/src/plugin-host/controllers/plugin-credential-runtime.controller.js +11 -19
  154. package/dist/src/plugin-host/controllers/plugin-gallery.controller.d.ts +5 -1
  155. package/dist/src/plugin-host/controllers/plugin-gallery.controller.js +25 -1
  156. package/dist/src/plugin-host/controllers/plugin-history.controller.d.ts +10 -0
  157. package/dist/src/plugin-host/controllers/plugin-history.controller.js +57 -0
  158. package/dist/src/plugin-host/controllers/plugin-release-check.controller.d.ts +10 -0
  159. package/dist/src/plugin-host/controllers/plugin-release-check.controller.js +58 -0
  160. package/dist/src/plugin-host/dto/domain/check-plugin-release.command.d.ts +22 -0
  161. package/dist/src/plugin-host/dto/domain/check-plugin-release.command.js +17 -0
  162. package/dist/src/plugin-host/dto/domain/find-plugin-by-repository.command.d.ts +6 -0
  163. package/dist/src/plugin-host/dto/domain/find-plugin-by-repository.command.js +13 -0
  164. package/dist/src/plugin-host/dto/domain/list-plugin-history.command.d.ts +10 -0
  165. package/dist/src/plugin-host/dto/domain/list-plugin-history.command.js +18 -0
  166. package/dist/src/plugin-host/dto/domain/plugin-action-execution.command.d.ts +23 -0
  167. package/dist/src/plugin-host/dto/domain/plugin-action-execution.command.js +44 -0
  168. package/dist/src/plugin-host/dto/domain/plugin-action-execution.dto.d.ts +36 -0
  169. package/dist/src/plugin-host/dto/domain/plugin-action-execution.dto.js +3 -0
  170. package/dist/src/plugin-host/dto/domain/plugin-history.dto.d.ts +29 -0
  171. package/dist/src/plugin-host/dto/domain/plugin-history.dto.js +3 -0
  172. package/dist/src/plugin-host/dto/domain/plugin-view.dto.d.ts +1 -0
  173. package/dist/src/plugin-host/dto/presentation/plugin-action-api.dto.d.ts +44 -0
  174. package/dist/src/plugin-host/dto/presentation/plugin-action-api.dto.js +208 -0
  175. package/dist/src/plugin-host/dto/presentation/plugin-gallery-api.dto.d.ts +2 -0
  176. package/dist/src/plugin-host/dto/presentation/plugin-gallery-api.dto.js +7 -0
  177. package/dist/src/plugin-host/dto/presentation/plugin-history-api.dto.d.ts +29 -0
  178. package/dist/src/plugin-host/dto/presentation/plugin-history-api.dto.js +148 -0
  179. package/dist/src/plugin-host/dto/presentation/plugin-lookup-api.dto.d.ts +3 -0
  180. package/dist/src/plugin-host/dto/presentation/plugin-lookup-api.dto.js +22 -0
  181. package/dist/src/plugin-host/dto/presentation/publication-api.dto.d.ts +17 -0
  182. package/dist/src/plugin-host/dto/presentation/publication-api.dto.js +95 -1
  183. package/dist/src/plugin-host/entities/plugin-action-execution.entity.d.ts +24 -0
  184. package/dist/src/plugin-host/entities/plugin-action-execution.entity.js +136 -0
  185. package/dist/src/plugin-host/entities/plugin-version.entity.d.ts +2 -1
  186. package/dist/src/plugin-host/entities/plugin-version.entity.js +5 -0
  187. package/dist/src/plugin-host/enums/plugin-action-execution-status.enum.d.ts +9 -0
  188. package/dist/src/plugin-host/enums/plugin-action-execution-status.enum.js +22 -0
  189. package/dist/src/plugin-host/enums/release-rejection-code.enum.d.ts +3 -0
  190. package/dist/src/plugin-host/enums/release-rejection-code.enum.js +6 -0
  191. package/dist/src/plugin-host/errors/plugin-action.errors.d.ts +45 -0
  192. package/dist/src/plugin-host/errors/plugin-action.errors.js +70 -0
  193. package/dist/src/plugin-host/errors/plugin-host.errors.d.ts +6 -0
  194. package/dist/src/plugin-host/errors/plugin-host.errors.js +10 -1
  195. package/dist/src/plugin-host/filters/plugin-host-exception.filter.js +2 -2
  196. package/dist/src/plugin-host/mappers/plugin-action-execution.mapper.d.ts +3 -0
  197. package/dist/src/plugin-host/mappers/plugin-action-execution.mapper.js +22 -0
  198. package/dist/src/plugin-host/mappers/plugin-presentation.mapper.d.ts +22 -1
  199. package/dist/src/plugin-host/mappers/plugin-presentation.mapper.js +87 -1
  200. package/dist/src/plugin-host/plugin-host.module.js +34 -0
  201. package/dist/src/plugin-host/services/action-input-validator.service.d.ts +23 -0
  202. package/dist/src/plugin-host/services/action-input-validator.service.js +277 -0
  203. package/dist/src/plugin-host/services/external-credential-definition-sync.service.d.ts +3 -0
  204. package/dist/src/plugin-host/services/external-credential-definition-sync.service.js +47 -15
  205. package/dist/src/plugin-host/services/plugin-action-dispatcher.service.d.ts +13 -0
  206. package/dist/src/plugin-host/services/plugin-action-dispatcher.service.js +140 -0
  207. package/dist/src/plugin-host/services/plugin-action-execution.service.d.ts +69 -0
  208. package/dist/src/plugin-host/services/plugin-action-execution.service.js +239 -0
  209. package/dist/src/plugin-host/services/plugin-action-starter.service.d.ts +22 -0
  210. package/dist/src/plugin-host/services/plugin-action-starter.service.js +81 -0
  211. package/dist/src/plugin-host/services/plugin-audit.service.d.ts +13 -0
  212. package/dist/src/plugin-host/services/plugin-audit.service.js +78 -0
  213. package/dist/src/plugin-host/services/plugin-publication.service.d.ts +4 -0
  214. package/dist/src/plugin-host/services/plugin-publication.service.js +51 -23
  215. package/dist/src/plugin-host/services/plugin-runtime-authorizer.service.d.ts +5 -2
  216. package/dist/src/plugin-host/services/plugin-runtime-authorizer.service.js +31 -3
  217. package/dist/src/plugin-host/services/plugin-version.service.d.ts +2 -1
  218. package/dist/src/plugin-host/services/release-candidate-rules.service.d.ts +51 -0
  219. package/dist/src/plugin-host/services/release-candidate-rules.service.js +198 -0
  220. package/dist/src/plugin-host/services/remote-url-validator.service.d.ts +7 -0
  221. package/dist/src/plugin-host/services/remote-url-validator.service.js +4 -0
  222. package/dist/src/plugin-host/system-triggers/plugin-action-execution-sweep.processor.d.ts +14 -0
  223. package/dist/src/plugin-host/system-triggers/plugin-action-execution-sweep.processor.js +50 -0
  224. package/dist/src/plugin-host/use-cases/cancel-plugin-action-execution.service.d.ts +8 -0
  225. package/dist/src/plugin-host/use-cases/cancel-plugin-action-execution.service.js +39 -0
  226. package/dist/src/plugin-host/use-cases/check-plugin-release.service.d.ts +22 -0
  227. package/dist/src/plugin-host/use-cases/check-plugin-release.service.js +152 -0
  228. package/dist/src/plugin-host/use-cases/find-plugin-by-repository.service.d.ts +9 -0
  229. package/dist/src/plugin-host/use-cases/find-plugin-by-repository.service.js +35 -0
  230. package/dist/src/plugin-host/use-cases/get-current-plugin-action-execution.service.d.ts +14 -0
  231. package/dist/src/plugin-host/use-cases/get-current-plugin-action-execution.service.js +85 -0
  232. package/dist/src/plugin-host/use-cases/get-plugin-action-execution.service.d.ts +9 -0
  233. package/dist/src/plugin-host/use-cases/get-plugin-action-execution.service.js +67 -0
  234. package/dist/src/plugin-host/use-cases/get-plugin-installation-entry.service.js +2 -7
  235. package/dist/src/plugin-host/use-cases/install-plugin.service.js +4 -0
  236. package/dist/src/plugin-host/use-cases/list-installations.service.d.ts +3 -1
  237. package/dist/src/plugin-host/use-cases/list-installations.service.js +14 -3
  238. package/dist/src/plugin-host/use-cases/list-plugin-history.service.d.ts +25 -0
  239. package/dist/src/plugin-host/use-cases/list-plugin-history.service.js +147 -0
  240. package/dist/src/plugin-host/use-cases/plugin-publisher-access.d.ts +5 -0
  241. package/dist/src/plugin-host/use-cases/plugin-publisher-access.js +28 -0
  242. package/dist/src/plugin-host/use-cases/start-plugin-action-execution.service.d.ts +12 -0
  243. package/dist/src/plugin-host/use-cases/start-plugin-action-execution.service.js +64 -0
  244. package/dist/src/plugin-host/use-cases/sync-plugin-releases.service.d.ts +3 -5
  245. package/dist/src/plugin-host/use-cases/sync-plugin-releases.service.js +15 -59
  246. package/dist/src/plugin-host/use-cases/uninstall-plugin.service.js +3 -1
  247. package/dist/src/plugin-host/use-cases/update-plugin.service.d.ts +0 -1
  248. package/dist/src/plugin-host/use-cases/update-plugin.service.js +3 -25
  249. package/dist/src/plugin-host/utils/action-input-schema.util.d.ts +14 -0
  250. package/dist/src/plugin-host/utils/action-input-schema.util.js +133 -0
  251. package/dist/src/plugin-host/utils/credential-handles.util.d.ts +3 -0
  252. package/dist/src/plugin-host/utils/credential-handles.util.js +13 -0
  253. package/dist/src/plugin-host/utils/execution-token.util.d.ts +5 -0
  254. package/dist/src/plugin-host/utils/execution-token.util.js +13 -0
  255. package/dist/src/plugin-host/utils/github-repo-locator.util.js +1 -1
  256. package/dist/src/plugin-host/utils/json-shape.util.d.ts +1 -0
  257. package/dist/src/plugin-host/utils/json-shape.util.js +21 -0
  258. package/dist/src/plugin-host/utils/plugin-action-outcome.util.d.ts +10 -0
  259. package/dist/src/plugin-host/utils/plugin-action-outcome.util.js +67 -0
  260. package/dist/src/plugin-host/utils/plugin-manifest.util.d.ts +121 -0
  261. package/dist/src/plugin-host/utils/plugin-manifest.util.js +111 -1
  262. package/dist/src/plugin-host/utils/request-abort-signal.util.d.ts +5 -0
  263. package/dist/src/plugin-host/utils/request-abort-signal.util.js +19 -0
  264. package/package.json +10 -8
@@ -0,0 +1,34 @@
1
+ export declare const PLUGIN_ACTION_LIMITS: {
2
+ readonly maxActions: 50;
3
+ readonly maxInputSchemaBytes: number;
4
+ readonly maxInputSchemaNodes: 2000;
5
+ readonly maxInputBytes: number;
6
+ readonly maxJsonDepth: 100;
7
+ readonly routeBodyLimit: "512kb";
8
+ readonly maxResultBytes: number;
9
+ readonly maxErrorMessageChars: 1000;
10
+ readonly maxReportedInputErrors: 20;
11
+ readonly maxRunningPerInstallation: 5;
12
+ readonly maxStartsPerInstallationPerMinute: 60;
13
+ readonly maxStartsPerInstallationPerDay: 5000;
14
+ readonly maxPayloadBytesPerInstallation: number;
15
+ readonly maxWaitSeconds: 20;
16
+ readonly waitPollMs: 1000;
17
+ readonly cancelPollMs: 5000;
18
+ readonly orphanGraceMs: 60000;
19
+ readonly payloadRetentionHours: 24;
20
+ readonly rowRetentionDays: 90;
21
+ readonly sweepBatchSize: 500;
22
+ readonly validationWorkers: 2;
23
+ readonly validationBudgetMs: 500;
24
+ readonly inputSchemaCompileBudgetMs: 2000;
25
+ readonly validationBootMs: 5000;
26
+ readonly validationWorkerHeapMb: 64;
27
+ readonly validationWorkerCacheSize: 50;
28
+ readonly maxValidationsPerVersion: 4;
29
+ readonly maxQueuedValidations: 64;
30
+ };
31
+ export declare const PLUGIN_ACTION_ERROR_CODE_PATTERN: RegExp;
32
+ export declare const PLUGIN_ACTION_RESERVED_ERROR_CODES: ReadonlySet<string>;
33
+ export declare const PLUGIN_ACTION_RESERVED_ERROR_CODE_PREFIX = "BACKEND_";
34
+ export declare function isPluginOwnedErrorCode(code: unknown): code is string;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PLUGIN_ACTION_RESERVED_ERROR_CODE_PREFIX = exports.PLUGIN_ACTION_RESERVED_ERROR_CODES = exports.PLUGIN_ACTION_ERROR_CODE_PATTERN = exports.PLUGIN_ACTION_LIMITS = void 0;
4
+ exports.isPluginOwnedErrorCode = isPluginOwnedErrorCode;
5
+ exports.PLUGIN_ACTION_LIMITS = {
6
+ maxActions: 50,
7
+ maxInputSchemaBytes: 32 * 1024,
8
+ maxInputSchemaNodes: 2000,
9
+ maxInputBytes: 256 * 1024,
10
+ maxJsonDepth: 100,
11
+ routeBodyLimit: '512kb',
12
+ maxResultBytes: 1024 * 1024,
13
+ maxErrorMessageChars: 1000,
14
+ maxReportedInputErrors: 20,
15
+ maxRunningPerInstallation: 5,
16
+ maxStartsPerInstallationPerMinute: 60,
17
+ maxStartsPerInstallationPerDay: 5000,
18
+ maxPayloadBytesPerInstallation: 100 * 1024 * 1024,
19
+ maxWaitSeconds: 20,
20
+ waitPollMs: 1000,
21
+ cancelPollMs: 5000,
22
+ orphanGraceMs: 60_000,
23
+ payloadRetentionHours: 24,
24
+ rowRetentionDays: 90,
25
+ sweepBatchSize: 500,
26
+ validationWorkers: 2,
27
+ validationBudgetMs: 500,
28
+ inputSchemaCompileBudgetMs: 2000,
29
+ validationBootMs: 5000,
30
+ validationWorkerHeapMb: 64,
31
+ validationWorkerCacheSize: 50,
32
+ maxValidationsPerVersion: 4,
33
+ maxQueuedValidations: 64,
34
+ };
35
+ exports.PLUGIN_ACTION_ERROR_CODE_PATTERN = /^[A-Z][A-Z0-9_]{0,63}$/;
36
+ exports.PLUGIN_ACTION_RESERVED_ERROR_CODES = new Set([
37
+ 'TIMED_OUT',
38
+ 'CANCELLED',
39
+ 'ACTION_NOT_DECLARED',
40
+ 'INVALID_INPUT',
41
+ 'INSTALLATION_INACTIVE',
42
+ 'PLUGIN_SUSPENDED',
43
+ ]);
44
+ exports.PLUGIN_ACTION_RESERVED_ERROR_CODE_PREFIX = 'BACKEND_';
45
+ function isPluginOwnedErrorCode(code) {
46
+ return (typeof code === 'string' &&
47
+ exports.PLUGIN_ACTION_ERROR_CODE_PATTERN.test(code) &&
48
+ !code.startsWith(exports.PLUGIN_ACTION_RESERVED_ERROR_CODE_PREFIX) &&
49
+ !exports.PLUGIN_ACTION_RESERVED_ERROR_CODES.has(code));
50
+ }
51
+ //# sourceMappingURL=plugin-action-limits.js.map
@@ -0,0 +1,20 @@
1
+ import type { Request } from 'express';
2
+ import { type AuthorizationContext } from '../../idp';
3
+ import { PluginActionExecutionApiDto, PluginActionExecutionQueryApiDto, PluginActionWorkerContextApiDto, StartedPluginActionExecutionApiDto } from '../dto/presentation/plugin-action-api.dto';
4
+ import { PluginPresentationMapper } from '../mappers/plugin-presentation.mapper';
5
+ import { CancelPluginActionExecutionService } from '../use-cases/cancel-plugin-action-execution.service';
6
+ import { GetCurrentPluginActionExecutionService } from '../use-cases/get-current-plugin-action-execution.service';
7
+ import { GetPluginActionExecutionService } from '../use-cases/get-plugin-action-execution.service';
8
+ import { StartPluginActionExecutionService } from '../use-cases/start-plugin-action-execution.service';
9
+ export declare class PluginActionRuntimeController {
10
+ private readonly startExecution;
11
+ private readonly getExecution;
12
+ private readonly cancelExecution;
13
+ private readonly getCurrentExecution;
14
+ private readonly mapper;
15
+ constructor(startExecution: StartPluginActionExecutionService, getExecution: GetPluginActionExecutionService, cancelExecution: CancelPluginActionExecutionService, getCurrentExecution: GetCurrentPluginActionExecutionService, mapper: PluginPresentationMapper);
16
+ start(action: string, body: Record<string, unknown> | undefined, context: AuthorizationContext): Promise<StartedPluginActionExecutionApiDto>;
17
+ current(context: AuthorizationContext): Promise<PluginActionWorkerContextApiDto>;
18
+ get(id: string, query: PluginActionExecutionQueryApiDto, context: AuthorizationContext, request: Request): Promise<PluginActionExecutionApiDto>;
19
+ cancel(id: string, context: AuthorizationContext): Promise<PluginActionExecutionApiDto>;
20
+ }
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.PluginActionRuntimeController = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const swagger_1 = require("@nestjs/swagger");
18
+ const idp_1 = require("../../idp");
19
+ const role_config_types_1 = require("../../idp/types/role-config.types");
20
+ const plugin_action_execution_command_1 = require("../dto/domain/plugin-action-execution.command");
21
+ const plugin_action_api_dto_1 = require("../dto/presentation/plugin-action-api.dto");
22
+ const plugin_host_exception_filter_1 = require("../filters/plugin-host-exception.filter");
23
+ const plugin_presentation_mapper_1 = require("../mappers/plugin-presentation.mapper");
24
+ const cancel_plugin_action_execution_service_1 = require("../use-cases/cancel-plugin-action-execution.service");
25
+ const get_current_plugin_action_execution_service_1 = require("../use-cases/get-current-plugin-action-execution.service");
26
+ const get_plugin_action_execution_service_1 = require("../use-cases/get-plugin-action-execution.service");
27
+ const start_plugin_action_execution_service_1 = require("../use-cases/start-plugin-action-execution.service");
28
+ const request_abort_signal_util_1 = require("../utils/request-abort-signal.util");
29
+ let PluginActionRuntimeController = class PluginActionRuntimeController {
30
+ startExecution;
31
+ getExecution;
32
+ cancelExecution;
33
+ getCurrentExecution;
34
+ mapper;
35
+ constructor(startExecution, getExecution, cancelExecution, getCurrentExecution, mapper) {
36
+ this.startExecution = startExecution;
37
+ this.getExecution = getExecution;
38
+ this.cancelExecution = cancelExecution;
39
+ this.getCurrentExecution = getCurrentExecution;
40
+ this.mapper = mapper;
41
+ }
42
+ async start(action, body, context) {
43
+ const unknownProperty = Object.keys(body ?? {}).find(key => key !== 'input');
44
+ if (unknownProperty !== undefined) {
45
+ throw new common_1.BadRequestException([`property ${unknownProperty} should not exist`]);
46
+ }
47
+ const started = await this.startExecution.run(new plugin_action_execution_command_1.StartPluginActionExecutionCommand(context, action, body?.input));
48
+ return this.mapper.toStartedActionExecutionResponse(started);
49
+ }
50
+ async current(context) {
51
+ const current = await this.getCurrentExecution.run(new plugin_action_execution_command_1.GetCurrentPluginActionExecutionCommand(context));
52
+ return this.mapper.toActionWorkerContextResponse(current);
53
+ }
54
+ async get(id, query, context, request) {
55
+ const disconnected = (0, request_abort_signal_util_1.requestAbortSignal)(request);
56
+ try {
57
+ const execution = await this.getExecution.run(new plugin_action_execution_command_1.GetPluginActionExecutionCommand(context, id, query.waitSeconds ?? 0, disconnected.signal));
58
+ return this.mapper.toActionExecutionResponse(execution);
59
+ }
60
+ finally {
61
+ disconnected.dispose();
62
+ }
63
+ }
64
+ async cancel(id, context) {
65
+ const execution = await this.cancelExecution.run(new plugin_action_execution_command_1.CancelPluginActionExecutionCommand(context, id));
66
+ return this.mapper.toActionExecutionResponse(execution);
67
+ }
68
+ };
69
+ exports.PluginActionRuntimeController = PluginActionRuntimeController;
70
+ __decorate([
71
+ (0, common_1.Post)('actions/:action/executions'),
72
+ (0, common_1.HttpCode)(202),
73
+ (0, swagger_1.ApiBody)({ type: plugin_action_api_dto_1.StartPluginActionExecutionApiDto }),
74
+ (0, swagger_1.ApiAcceptedResponse)({ type: plugin_action_api_dto_1.StartedPluginActionExecutionApiDto }),
75
+ __param(0, (0, common_1.Param)('action')),
76
+ __param(1, (0, common_1.Body)()),
77
+ __param(2, (0, idp_1.AuthContext)()),
78
+ __metadata("design:type", Function),
79
+ __metadata("design:paramtypes", [String, Object, Object]),
80
+ __metadata("design:returntype", Promise)
81
+ ], PluginActionRuntimeController.prototype, "start", null);
82
+ __decorate([
83
+ (0, common_1.Get)('executions/current'),
84
+ (0, swagger_1.ApiOkResponse)({ type: plugin_action_api_dto_1.PluginActionWorkerContextApiDto }),
85
+ __param(0, (0, idp_1.AuthContext)()),
86
+ __metadata("design:type", Function),
87
+ __metadata("design:paramtypes", [Object]),
88
+ __metadata("design:returntype", Promise)
89
+ ], PluginActionRuntimeController.prototype, "current", null);
90
+ __decorate([
91
+ (0, common_1.Get)('executions/:id'),
92
+ (0, swagger_1.ApiOkResponse)({ type: plugin_action_api_dto_1.PluginActionExecutionApiDto }),
93
+ __param(0, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
94
+ __param(1, (0, common_1.Query)()),
95
+ __param(2, (0, idp_1.AuthContext)()),
96
+ __param(3, (0, common_1.Req)()),
97
+ __metadata("design:type", Function),
98
+ __metadata("design:paramtypes", [String, plugin_action_api_dto_1.PluginActionExecutionQueryApiDto, Object, Object]),
99
+ __metadata("design:returntype", Promise)
100
+ ], PluginActionRuntimeController.prototype, "get", null);
101
+ __decorate([
102
+ (0, common_1.Post)('executions/:id/cancel'),
103
+ (0, common_1.HttpCode)(200),
104
+ (0, swagger_1.ApiOkResponse)({ type: plugin_action_api_dto_1.PluginActionExecutionApiDto }),
105
+ __param(0, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
106
+ __param(1, (0, idp_1.AuthContext)()),
107
+ __metadata("design:type", Function),
108
+ __metadata("design:paramtypes", [String, Object]),
109
+ __metadata("design:returntype", Promise)
110
+ ], PluginActionRuntimeController.prototype, "cancel", null);
111
+ exports.PluginActionRuntimeController = PluginActionRuntimeController = __decorate([
112
+ (0, swagger_1.ApiTags)('Plugin Actions'),
113
+ (0, common_1.Controller)('plugins/runtime'),
114
+ (0, idp_1.Auth)(role_config_types_1.Role.viewer(role_config_types_1.Strategy.PARSE)),
115
+ (0, idp_1.RequirePluginAuth)(),
116
+ (0, common_1.UseFilters)(plugin_host_exception_filter_1.PluginHostExceptionFilter),
117
+ __metadata("design:paramtypes", [start_plugin_action_execution_service_1.StartPluginActionExecutionService,
118
+ get_plugin_action_execution_service_1.GetPluginActionExecutionService,
119
+ cancel_plugin_action_execution_service_1.CancelPluginActionExecutionService,
120
+ get_current_plugin_action_execution_service_1.GetCurrentPluginActionExecutionService,
121
+ plugin_presentation_mapper_1.PluginPresentationMapper])
122
+ ], PluginActionRuntimeController);
123
+ //# sourceMappingURL=plugin-action-runtime.controller.js.map
@@ -23,8 +23,11 @@ const credential_types_1 = require("../../data-marts/credentials/credential.type
23
23
  const credential_fetch_service_1 = require("../../data-marts/credentials/services/credential-fetch.service");
24
24
  const credential_ai_service_1 = require("../../data-marts/credentials/services/credential-ai.service");
25
25
  const credential_ai_api_dto_1 = require("../../data-marts/credentials/dto/credential-ai-api.dto");
26
+ const plugin_action_errors_1 = require("../errors/plugin-action.errors");
27
+ const plugin_host_exception_filter_1 = require("../filters/plugin-host-exception.filter");
26
28
  const plugin_service_1 = require("../services/plugin.service");
27
29
  const plugin_version_service_1 = require("../services/plugin-version.service");
30
+ const request_abort_signal_util_1 = require("../utils/request-abort-signal.util");
28
31
  let PluginCredentialRuntimeController = class PluginCredentialRuntimeController {
29
32
  plugins;
30
33
  versions;
@@ -40,7 +43,7 @@ let PluginCredentialRuntimeController = class PluginCredentialRuntimeController
40
43
  }
41
44
  async fetch(handle, input, context, request) {
42
45
  const binding = await this.resolveBinding(handle, context, 'fetch');
43
- const disconnected = requestAbortSignal(request);
46
+ const disconnected = (0, request_abort_signal_util_1.requestAbortSignal)(request);
44
47
  try {
45
48
  const response = await this.fetchService.run(binding, input, {
46
49
  signal: disconnected.signal,
@@ -57,7 +60,7 @@ let PluginCredentialRuntimeController = class PluginCredentialRuntimeController
57
60
  throw new common_1.BadRequestException('A language model mapping is required');
58
61
  }
59
62
  const binding = await this.resolveBinding(handle, context, input.model);
60
- const disconnected = requestAbortSignal(request);
63
+ const disconnected = (0, request_abort_signal_util_1.requestAbortSignal)(request);
61
64
  try {
62
65
  const result = await this.aiService.generate(binding, input.model, input.options, disconnected.signal);
63
66
  await this.markUsed(binding, context);
@@ -72,7 +75,7 @@ let PluginCredentialRuntimeController = class PluginCredentialRuntimeController
72
75
  throw new common_1.BadRequestException('The embedding model mapping is required');
73
76
  }
74
77
  const binding = await this.resolveBinding(handle, context, input.model);
75
- const disconnected = requestAbortSignal(request);
78
+ const disconnected = (0, request_abort_signal_util_1.requestAbortSignal)(request);
76
79
  try {
77
80
  const result = await this.aiService.embed(binding, input.model, input.options, disconnected.signal);
78
81
  await this.markUsed(binding, context);
@@ -87,7 +90,7 @@ let PluginCredentialRuntimeController = class PluginCredentialRuntimeController
87
90
  throw new common_1.BadRequestException('A language model mapping is required');
88
91
  }
89
92
  const binding = await this.resolveBinding(handle, context, input.model);
90
- const disconnected = requestAbortSignal(request);
93
+ const disconnected = (0, request_abort_signal_util_1.requestAbortSignal)(request);
91
94
  let stream;
92
95
  try {
93
96
  stream = await this.aiService.stream(binding, input.model, input.options, disconnected.signal);
@@ -125,6 +128,9 @@ let PluginCredentialRuntimeController = class PluginCredentialRuntimeController
125
128
  }
126
129
  }
127
130
  async resolveBinding(handle, context, capability) {
131
+ if (context.executionId && capability !== 'fetch') {
132
+ throw new plugin_action_errors_1.ExecutionTokenNotAllowedError('AI Credentials are not available in a backend action');
133
+ }
128
134
  if (!context.installationId || !context.pluginId) {
129
135
  throw new common_1.ForbiddenException('A plugin installation is required');
130
136
  }
@@ -213,6 +219,7 @@ exports.PluginCredentialRuntimeController = PluginCredentialRuntimeController =
213
219
  (0, common_1.Controller)('plugins/runtime/credentials'),
214
220
  (0, idp_1.Auth)(role_config_types_1.Role.viewer(role_config_types_1.Strategy.PARSE)),
215
221
  (0, idp_1.RequirePluginAuth)(),
222
+ (0, common_1.UseFilters)(plugin_host_exception_filter_1.PluginHostExceptionFilter),
216
223
  __param(4, (0, common_1.Inject)(credential_consumer_binding_facade_1.CREDENTIAL_CONSUMER_BINDING_FACADE)),
217
224
  __metadata("design:paramtypes", [plugin_service_1.PluginService,
218
225
  plugin_version_service_1.PluginVersionService,
@@ -230,21 +237,6 @@ function assertDeclaredAiModel(requirement, model) {
230
237
  throw new common_1.NotFoundException(`AI model ${model} is not declared by this plugin`);
231
238
  }
232
239
  }
233
- function requestAbortSignal(request) {
234
- const controller = new AbortController();
235
- const abort = () => controller.abort();
236
- request.once('aborted', abort);
237
- request.res?.once('close', abort);
238
- request.res?.once('error', abort);
239
- return {
240
- signal: controller.signal,
241
- dispose: () => {
242
- request.off('aborted', abort);
243
- request.res?.off('close', abort);
244
- request.res?.off('error', abort);
245
- },
246
- };
247
- }
248
240
  function waitForDrain(response, signal) {
249
241
  if (signal.aborted || response.destroyed) {
250
242
  return Promise.reject(signal.reason ?? new DOMException('Response closed', 'AbortError'));
@@ -1,13 +1,17 @@
1
1
  import { type AuthorizationContext } from '../../idp';
2
2
  import { PluginGalleryEntryApiDto } from '../dto/presentation/plugin-gallery-api.dto';
3
+ import { PluginLookupApiDto } from '../dto/presentation/plugin-lookup-api.dto';
3
4
  import { PluginPresentationMapper } from '../mappers/plugin-presentation.mapper';
5
+ import { FindPluginByRepositoryService } from '../use-cases/find-plugin-by-repository.service';
4
6
  import { GetPluginDetailsService } from '../use-cases/get-plugin-details.service';
5
7
  import { GetPluginGalleryService } from '../use-cases/get-plugin-gallery.service';
6
8
  export declare class PluginGalleryController {
7
9
  private readonly getPluginGalleryService;
8
10
  private readonly getPluginDetailsService;
11
+ private readonly findPluginByRepositoryService;
9
12
  private readonly mapper;
10
- constructor(getPluginGalleryService: GetPluginGalleryService, getPluginDetailsService: GetPluginDetailsService, mapper: PluginPresentationMapper);
13
+ constructor(getPluginGalleryService: GetPluginGalleryService, getPluginDetailsService: GetPluginDetailsService, findPluginByRepositoryService: FindPluginByRepositoryService, mapper: PluginPresentationMapper);
11
14
  gallery(context: AuthorizationContext): Promise<PluginGalleryEntryApiDto[]>;
15
+ lookup(context: AuthorizationContext, repository: string): Promise<PluginLookupApiDto>;
12
16
  details(context: AuthorizationContext, pluginId: string): Promise<PluginGalleryEntryApiDto>;
13
17
  }
@@ -18,23 +18,31 @@ const swagger_1 = require("@nestjs/swagger");
18
18
  const idp_1 = require("../../idp");
19
19
  const role_config_types_1 = require("../../idp/types/role-config.types");
20
20
  const plugin_gallery_api_dto_1 = require("../dto/presentation/plugin-gallery-api.dto");
21
+ const plugin_lookup_api_dto_1 = require("../dto/presentation/plugin-lookup-api.dto");
21
22
  const plugin_host_exception_filter_1 = require("../filters/plugin-host-exception.filter");
22
23
  const plugin_presentation_mapper_1 = require("../mappers/plugin-presentation.mapper");
24
+ const find_plugin_by_repository_service_1 = require("../use-cases/find-plugin-by-repository.service");
23
25
  const get_plugin_details_service_1 = require("../use-cases/get-plugin-details.service");
24
26
  const get_plugin_gallery_service_1 = require("../use-cases/get-plugin-gallery.service");
25
27
  let PluginGalleryController = class PluginGalleryController {
26
28
  getPluginGalleryService;
27
29
  getPluginDetailsService;
30
+ findPluginByRepositoryService;
28
31
  mapper;
29
- constructor(getPluginGalleryService, getPluginDetailsService, mapper) {
32
+ constructor(getPluginGalleryService, getPluginDetailsService, findPluginByRepositoryService, mapper) {
30
33
  this.getPluginGalleryService = getPluginGalleryService;
31
34
  this.getPluginDetailsService = getPluginDetailsService;
35
+ this.findPluginByRepositoryService = findPluginByRepositoryService;
32
36
  this.mapper = mapper;
33
37
  }
34
38
  async gallery(context) {
35
39
  const result = await this.getPluginGalleryService.run(this.mapper.toGetPluginGalleryCommand(context));
36
40
  return this.mapper.toGalleryEntryResponseList(result);
37
41
  }
42
+ async lookup(context, repository) {
43
+ const result = await this.findPluginByRepositoryService.run(this.mapper.toFindPluginByRepositoryCommand(repository ?? '', context));
44
+ return this.mapper.toLookupResponse(result);
45
+ }
38
46
  async details(context, pluginId) {
39
47
  const result = await this.getPluginDetailsService.run(this.mapper.toGetPluginDetailsCommand(pluginId, context));
40
48
  return this.mapper.toGalleryEntryResponse(result);
@@ -54,6 +62,21 @@ __decorate([
54
62
  __metadata("design:paramtypes", [Object]),
55
63
  __metadata("design:returntype", Promise)
56
64
  ], PluginGalleryController.prototype, "gallery", null);
65
+ __decorate([
66
+ (0, idp_1.Auth)(role_config_types_1.Role.viewer(role_config_types_1.Strategy.PARSE)),
67
+ (0, common_1.Get)('lookup'),
68
+ (0, swagger_1.ApiOperation)({
69
+ summary: 'A public plugin by its GitHub repository',
70
+ description: "Resolves owner/name or a GitHub URL to the id of a public plugin whose deployment publication reaches the caller's project: all projects, or a selected audience that includes it. Any other repository, private, unknown or outside the audience, answers 404 alike.",
71
+ }),
72
+ (0, swagger_1.ApiQuery)({ name: 'repository', required: true, example: 'OWOX/odm-usage-stat' }),
73
+ (0, swagger_1.ApiOkResponse)({ type: plugin_lookup_api_dto_1.PluginLookupApiDto }),
74
+ __param(0, (0, idp_1.AuthContext)()),
75
+ __param(1, (0, common_1.Query)('repository')),
76
+ __metadata("design:type", Function),
77
+ __metadata("design:paramtypes", [Object, String]),
78
+ __metadata("design:returntype", Promise)
79
+ ], PluginGalleryController.prototype, "lookup", null);
57
80
  __decorate([
58
81
  (0, idp_1.Auth)(role_config_types_1.Role.viewer(role_config_types_1.Strategy.PARSE)),
59
82
  (0, common_1.Get)(':pluginId'),
@@ -74,6 +97,7 @@ exports.PluginGalleryController = PluginGalleryController = __decorate([
74
97
  (0, common_1.UseFilters)(plugin_host_exception_filter_1.PluginHostExceptionFilter),
75
98
  __metadata("design:paramtypes", [get_plugin_gallery_service_1.GetPluginGalleryService,
76
99
  get_plugin_details_service_1.GetPluginDetailsService,
100
+ find_plugin_by_repository_service_1.FindPluginByRepositoryService,
77
101
  plugin_presentation_mapper_1.PluginPresentationMapper])
78
102
  ], PluginGalleryController);
79
103
  //# sourceMappingURL=plugin-gallery.controller.js.map
@@ -0,0 +1,10 @@
1
+ import { type AuthorizationContext } from '../../idp';
2
+ import { ListPluginHistoryQueryApiDto, PluginHistoryPageApiDto } from '../dto/presentation/plugin-history-api.dto';
3
+ import { PluginPresentationMapper } from '../mappers/plugin-presentation.mapper';
4
+ import { ListPluginHistoryService } from '../use-cases/list-plugin-history.service';
5
+ export declare class PluginHistoryController {
6
+ private readonly listPluginHistoryService;
7
+ private readonly mapper;
8
+ constructor(listPluginHistoryService: ListPluginHistoryService, mapper: PluginPresentationMapper);
9
+ list(context: AuthorizationContext, query: ListPluginHistoryQueryApiDto): Promise<PluginHistoryPageApiDto>;
10
+ }
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.PluginHistoryController = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const swagger_1 = require("@nestjs/swagger");
18
+ const idp_1 = require("../../idp");
19
+ const role_config_types_1 = require("../../idp/types/role-config.types");
20
+ const plugin_history_api_dto_1 = require("../dto/presentation/plugin-history-api.dto");
21
+ const plugin_presentation_mapper_1 = require("../mappers/plugin-presentation.mapper");
22
+ const list_plugin_history_service_1 = require("../use-cases/list-plugin-history.service");
23
+ let PluginHistoryController = class PluginHistoryController {
24
+ listPluginHistoryService;
25
+ mapper;
26
+ constructor(listPluginHistoryService, mapper) {
27
+ this.listPluginHistoryService = listPluginHistoryService;
28
+ this.mapper = mapper;
29
+ }
30
+ async list(context, query) {
31
+ const page = await this.listPluginHistoryService.run(this.mapper.toListPluginHistoryCommand(context, query));
32
+ return this.mapper.toPluginHistoryResponse(page);
33
+ }
34
+ };
35
+ exports.PluginHistoryController = PluginHistoryController;
36
+ __decorate([
37
+ (0, idp_1.Auth)(role_config_types_1.Role.viewer(role_config_types_1.Strategy.PARSE)),
38
+ (0, idp_1.RejectPluginAuth)(),
39
+ (0, common_1.Get)('history'),
40
+ (0, swagger_1.ApiOperation)({
41
+ summary: "The caller's plugin history in this project",
42
+ description: "Newest first: the caller's own installations, publications for this project and the caller's own, Verified listing changes, and updates and suspensions of those plugins. A Verified listing change shows for every project the listing is set to reach or has ever named. Events within the same second may come in either order.",
43
+ }),
44
+ (0, swagger_1.ApiOkResponse)({ type: plugin_history_api_dto_1.PluginHistoryPageApiDto }),
45
+ __param(0, (0, idp_1.AuthContext)()),
46
+ __param(1, (0, common_1.Query)()),
47
+ __metadata("design:type", Function),
48
+ __metadata("design:paramtypes", [Object, plugin_history_api_dto_1.ListPluginHistoryQueryApiDto]),
49
+ __metadata("design:returntype", Promise)
50
+ ], PluginHistoryController.prototype, "list", null);
51
+ exports.PluginHistoryController = PluginHistoryController = __decorate([
52
+ (0, swagger_1.ApiTags)('Plugins'),
53
+ (0, common_1.Controller)('plugins'),
54
+ __metadata("design:paramtypes", [list_plugin_history_service_1.ListPluginHistoryService,
55
+ plugin_presentation_mapper_1.PluginPresentationMapper])
56
+ ], PluginHistoryController);
57
+ //# sourceMappingURL=plugin-history.controller.js.map
@@ -0,0 +1,10 @@
1
+ import { type AuthorizationContext } from '../../idp';
2
+ import { CheckPluginReleaseApiDto, PluginReleaseCheckResultApiDto } from '../dto/presentation/publication-api.dto';
3
+ import { PluginPresentationMapper } from '../mappers/plugin-presentation.mapper';
4
+ import { CheckPluginReleaseService } from '../use-cases/check-plugin-release.service';
5
+ export declare class PluginReleaseCheckController {
6
+ private readonly checkPluginReleaseService;
7
+ private readonly mapper;
8
+ constructor(checkPluginReleaseService: CheckPluginReleaseService, mapper: PluginPresentationMapper);
9
+ check(context: AuthorizationContext, dto: CheckPluginReleaseApiDto): Promise<PluginReleaseCheckResultApiDto>;
10
+ }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.PluginReleaseCheckController = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const swagger_1 = require("@nestjs/swagger");
18
+ const idp_1 = require("../../idp");
19
+ const role_config_types_1 = require("../../idp/types/role-config.types");
20
+ const publication_api_dto_1 = require("../dto/presentation/publication-api.dto");
21
+ const plugin_presentation_mapper_1 = require("../mappers/plugin-presentation.mapper");
22
+ const check_plugin_release_service_1 = require("../use-cases/check-plugin-release.service");
23
+ let PluginReleaseCheckController = class PluginReleaseCheckController {
24
+ checkPluginReleaseService;
25
+ mapper;
26
+ constructor(checkPluginReleaseService, mapper) {
27
+ this.checkPluginReleaseService = checkPluginReleaseService;
28
+ this.mapper = mapper;
29
+ }
30
+ async check(context, dto) {
31
+ const result = await this.checkPluginReleaseService.run(this.mapper.toCheckReleaseCommand(context, dto));
32
+ return this.mapper.toReleaseCheckResponse(result);
33
+ }
34
+ };
35
+ exports.PluginReleaseCheckController = PluginReleaseCheckController;
36
+ __decorate([
37
+ (0, idp_1.Auth)(role_config_types_1.Role.viewer(role_config_types_1.Strategy.INTROSPECT)),
38
+ (0, common_1.Post)('check'),
39
+ (0, common_1.HttpCode)(200),
40
+ (0, swagger_1.ApiOperation)({
41
+ summary: 'Check a release before publishing it',
42
+ description: 'Dry run: reports whether a release from this ref would be accepted, using the same rules as release sync, and records nothing. For deployment publishers and members who manage a publication of the plugin. Verifies that the repository is still the one the plugin was published from. Rate-limited per plugin and caller, separately from Check now.',
43
+ }),
44
+ (0, swagger_1.ApiOkResponse)({ type: publication_api_dto_1.PluginReleaseCheckResultApiDto }),
45
+ __param(0, (0, idp_1.AuthContext)()),
46
+ __param(1, (0, common_1.Body)()),
47
+ __metadata("design:type", Function),
48
+ __metadata("design:paramtypes", [Object, publication_api_dto_1.CheckPluginReleaseApiDto]),
49
+ __metadata("design:returntype", Promise)
50
+ ], PluginReleaseCheckController.prototype, "check", null);
51
+ exports.PluginReleaseCheckController = PluginReleaseCheckController = __decorate([
52
+ (0, swagger_1.ApiTags)('Plugins'),
53
+ (0, common_1.Controller)('plugins'),
54
+ (0, idp_1.RejectPluginAuth)(),
55
+ __metadata("design:paramtypes", [check_plugin_release_service_1.CheckPluginReleaseService,
56
+ plugin_presentation_mapper_1.PluginPresentationMapper])
57
+ ], PluginReleaseCheckController);
58
+ //# sourceMappingURL=plugin-release-check.controller.js.map
@@ -0,0 +1,22 @@
1
+ import { AuthorizationContext } from '../../../idp/types/auth.types';
2
+ import { ReleaseRejectionCode } from '../../enums/release-rejection-code.enum';
3
+ export declare class CheckPluginReleaseCommand {
4
+ readonly context: AuthorizationContext;
5
+ readonly repoLocator: string;
6
+ readonly ref: string;
7
+ readonly version?: string | undefined;
8
+ constructor(context: AuthorizationContext, repoLocator: string, ref: string, version?: string | undefined);
9
+ }
10
+ export interface PluginReleaseCheckIssueDto {
11
+ readonly code: ReleaseRejectionCode;
12
+ readonly detail: string;
13
+ }
14
+ export interface PluginReleaseCheckResultDto {
15
+ readonly pluginId: string;
16
+ readonly repository: string;
17
+ readonly commitSha: string | null;
18
+ readonly candidateVersion: string | null;
19
+ readonly baselineVersion: string | null;
20
+ readonly collectionsEvaluated: boolean;
21
+ readonly issues: readonly PluginReleaseCheckIssueDto[];
22
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CheckPluginReleaseCommand = void 0;
4
+ class CheckPluginReleaseCommand {
5
+ context;
6
+ repoLocator;
7
+ ref;
8
+ version;
9
+ constructor(context, repoLocator, ref, version) {
10
+ this.context = context;
11
+ this.repoLocator = repoLocator;
12
+ this.ref = ref;
13
+ this.version = version;
14
+ }
15
+ }
16
+ exports.CheckPluginReleaseCommand = CheckPluginReleaseCommand;
17
+ //# sourceMappingURL=check-plugin-release.command.js.map
@@ -0,0 +1,6 @@
1
+ import { AuthorizationContext } from '../../../idp/types/auth.types';
2
+ export declare class FindPluginByRepositoryCommand {
3
+ readonly repository: string;
4
+ readonly context: AuthorizationContext;
5
+ constructor(repository: string, context: AuthorizationContext);
6
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FindPluginByRepositoryCommand = void 0;
4
+ class FindPluginByRepositoryCommand {
5
+ repository;
6
+ context;
7
+ constructor(repository, context) {
8
+ this.repository = repository;
9
+ this.context = context;
10
+ }
11
+ }
12
+ exports.FindPluginByRepositoryCommand = FindPluginByRepositoryCommand;
13
+ //# sourceMappingURL=find-plugin-by-repository.command.js.map
@@ -0,0 +1,10 @@
1
+ import { AuthorizationContext } from '../../../idp/types/auth.types';
2
+ export declare const PLUGIN_HISTORY_DEFAULT_LIMIT = 50;
3
+ export type PluginHistoryType = 'all' | 'installations' | 'publications';
4
+ export declare class ListPluginHistoryCommand {
5
+ readonly context: AuthorizationContext;
6
+ readonly type: PluginHistoryType;
7
+ readonly limit: number;
8
+ readonly cursor: string | null;
9
+ constructor(context: AuthorizationContext, type: PluginHistoryType, limit: number, cursor: string | null);
10
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ListPluginHistoryCommand = exports.PLUGIN_HISTORY_DEFAULT_LIMIT = void 0;
4
+ exports.PLUGIN_HISTORY_DEFAULT_LIMIT = 50;
5
+ class ListPluginHistoryCommand {
6
+ context;
7
+ type;
8
+ limit;
9
+ cursor;
10
+ constructor(context, type, limit, cursor) {
11
+ this.context = context;
12
+ this.type = type;
13
+ this.limit = limit;
14
+ this.cursor = cursor;
15
+ }
16
+ }
17
+ exports.ListPluginHistoryCommand = ListPluginHistoryCommand;
18
+ //# sourceMappingURL=list-plugin-history.command.js.map