@webiny/api-core 0.0.0-unstable.e622468070 → 0.0.0-unstable.e6f0dc8ca7

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 (628) hide show
  1. package/ApiCoreFeature.d.ts +5 -1
  2. package/ApiCoreFeature.js +8 -0
  3. package/ApiCoreFeature.js.map +1 -1
  4. package/createApiCore.d.ts +1 -1
  5. package/createApiCore.js +2 -3
  6. package/createApiCore.js.map +1 -1
  7. package/domain/security/ApiToken.d.ts +1 -0
  8. package/domain/security/ApiToken.js +1 -0
  9. package/domain/security/ApiToken.js.map +1 -1
  10. package/exports/api/{buildParams.d.ts → build-params.d.ts} +1 -0
  11. package/exports/api/build-params.js +4 -0
  12. package/exports/api/build-params.js.map +1 -0
  13. package/exports/api/{eventPublisher.js → event-publisher.d.ts} +1 -2
  14. package/exports/api/event-publisher.js +4 -0
  15. package/exports/api/event-publisher.js.map +1 -0
  16. package/exports/api/{keyValueStore.d.ts → key-value-store.d.ts} +1 -0
  17. package/exports/api/key-value-store.js +4 -0
  18. package/exports/api/key-value-store.js.map +1 -0
  19. package/exports/api/logger.d.ts +1 -0
  20. package/exports/api/logger.js +1 -0
  21. package/exports/api/logger.js.map +1 -1
  22. package/exports/api/security/api-key.d.ts +7 -0
  23. package/exports/api/security/api-key.js +9 -0
  24. package/exports/api/security/api-key.js.map +1 -0
  25. package/exports/api/security/authentication.d.ts +1 -1
  26. package/exports/api/security/authentication.js +1 -1
  27. package/exports/api/security/authentication.js.map +1 -1
  28. package/exports/api/security/role.d.ts +3 -3
  29. package/exports/api/security/role.js +3 -3
  30. package/exports/api/security/role.js.map +1 -1
  31. package/exports/api/security/user.d.ts +3 -3
  32. package/exports/api/security/user.js +3 -3
  33. package/exports/api/security/user.js.map +1 -1
  34. package/exports/api/security.d.ts +6 -0
  35. package/exports/api/security.js +5 -0
  36. package/exports/api/security.js.map +1 -1
  37. package/exports/api/system.d.ts +1 -1
  38. package/exports/api/system.js +1 -1
  39. package/exports/api/system.js.map +1 -1
  40. package/exports/api/tenancy.d.ts +4 -4
  41. package/exports/api/tenancy.js +4 -4
  42. package/exports/api/tenancy.js.map +1 -1
  43. package/exports/api.d.ts +7 -0
  44. package/exports/api.js +8 -0
  45. package/exports/api.js.map +1 -0
  46. package/features/ai/Ai.d.ts +26 -0
  47. package/features/ai/Ai.js +133 -0
  48. package/features/ai/Ai.js.map +1 -0
  49. package/features/ai/AiSdkTools.d.ts +11 -0
  50. package/features/ai/AiSdkTools.js +25 -0
  51. package/features/ai/AiSdkTools.js.map +1 -0
  52. package/features/ai/AnthropicSdkFactory.d.ts +10 -0
  53. package/features/ai/AnthropicSdkFactory.js +71 -0
  54. package/features/ai/AnthropicSdkFactory.js.map +1 -0
  55. package/features/ai/OpenAiSdkFactory.d.ts +10 -0
  56. package/features/ai/OpenAiSdkFactory.js +187 -0
  57. package/features/ai/OpenAiSdkFactory.js.map +1 -0
  58. package/features/ai/abstractions.d.ts +92 -0
  59. package/features/ai/abstractions.js +35 -0
  60. package/features/ai/abstractions.js.map +1 -0
  61. package/features/ai/feature.d.ts +4 -0
  62. package/features/ai/feature.js +16 -0
  63. package/features/ai/feature.js.map +1 -0
  64. package/features/ai/index.d.ts +3 -0
  65. package/features/ai/index.js +4 -0
  66. package/features/ai/index.js.map +1 -0
  67. package/features/buildParams/abstractions.d.ts +2 -0
  68. package/features/buildParams/abstractions.js +2 -0
  69. package/features/buildParams/abstractions.js.map +1 -1
  70. package/features/buildParams/feature.d.ts +5 -1
  71. package/features/encryption/EncryptionService.d.ts +10 -0
  72. package/features/encryption/EncryptionService.js +58 -0
  73. package/features/encryption/EncryptionService.js.map +1 -0
  74. package/features/encryption/abstractions.d.ts +9 -0
  75. package/features/encryption/abstractions.js +5 -0
  76. package/features/encryption/abstractions.js.map +1 -0
  77. package/features/encryption/feature.d.ts +4 -0
  78. package/features/encryption/feature.js +10 -0
  79. package/features/encryption/feature.js.map +1 -0
  80. package/features/encryption/index.d.ts +1 -0
  81. package/features/encryption/index.js +3 -0
  82. package/features/encryption/index.js.map +1 -0
  83. package/features/eventPublisher/abstractions.d.ts +2 -0
  84. package/features/eventPublisher/abstractions.js +3 -0
  85. package/features/eventPublisher/abstractions.js.map +1 -1
  86. package/features/eventPublisher/feature.d.ts +5 -1
  87. package/features/featureFlags/FeatureFlags.d.ts +12 -0
  88. package/features/featureFlags/FeatureFlags.js +18 -0
  89. package/features/featureFlags/FeatureFlags.js.map +1 -0
  90. package/features/featureFlags/abstractions.d.ts +8 -0
  91. package/features/featureFlags/abstractions.js +4 -0
  92. package/features/featureFlags/abstractions.js.map +1 -0
  93. package/features/featureFlags/feature.d.ts +5 -0
  94. package/features/featureFlags/feature.js +10 -0
  95. package/features/featureFlags/feature.js.map +1 -0
  96. package/features/keyValueStore/GlobalKeyValueStore.js +3 -1
  97. package/features/keyValueStore/GlobalKeyValueStore.js.map +1 -1
  98. package/features/keyValueStore/KeyValueStoreRepository.d.ts +2 -2
  99. package/features/keyValueStore/KeyValueStoreRepository.js +2 -2
  100. package/features/keyValueStore/KeyValueStoreRepository.js.map +1 -1
  101. package/features/keyValueStore/abstractions.d.ts +10 -2
  102. package/features/keyValueStore/abstractions.js +4 -0
  103. package/features/keyValueStore/abstractions.js.map +1 -1
  104. package/features/keyValueStore/feature.d.ts +4 -1
  105. package/features/keyValueStore/feature.js.map +1 -1
  106. package/features/logger/abstractions.d.ts +1 -0
  107. package/features/logger/abstractions.js +1 -0
  108. package/features/logger/abstractions.js.map +1 -1
  109. package/features/logger/feature.d.ts +4 -1
  110. package/features/masker/Masker.d.ts +8 -0
  111. package/features/masker/Masker.js +21 -0
  112. package/features/masker/Masker.js.map +1 -0
  113. package/features/masker/abstractions.d.ts +11 -0
  114. package/features/masker/abstractions.js +4 -0
  115. package/features/masker/abstractions.js.map +1 -0
  116. package/features/masker/feature.d.ts +4 -0
  117. package/features/masker/feature.js +10 -0
  118. package/features/masker/feature.js.map +1 -0
  119. package/features/masker/index.d.ts +1 -0
  120. package/features/masker/index.js +3 -0
  121. package/features/masker/index.js.map +1 -0
  122. package/features/security/IdentityContext/IdentityContext.js +1 -1
  123. package/features/security/IdentityContext/IdentityContext.js.map +1 -1
  124. package/features/security/IdentityContext/abstractions.d.ts +1 -0
  125. package/features/security/IdentityContext/abstractions.js +1 -0
  126. package/features/security/IdentityContext/abstractions.js.map +1 -1
  127. package/features/security/IdentityContext/feature.d.ts +4 -1
  128. package/features/security/SecurityFeature.d.ts +5 -1
  129. package/features/security/apiKeys/CreateApiKey/CreateApiKeyUseCase.js +1 -1
  130. package/features/security/apiKeys/CreateApiKey/CreateApiKeyUseCase.js.map +1 -1
  131. package/features/security/apiKeys/CreateApiKey/abstractions.d.ts +1 -0
  132. package/features/security/apiKeys/CreateApiKey/abstractions.js +1 -0
  133. package/features/security/apiKeys/CreateApiKey/abstractions.js.map +1 -1
  134. package/features/security/apiKeys/CreateApiKey/events.d.ts +6 -4
  135. package/features/security/apiKeys/CreateApiKey/events.js +8 -4
  136. package/features/security/apiKeys/CreateApiKey/events.js.map +1 -1
  137. package/features/security/apiKeys/CreateApiKey/feature.d.ts +4 -1
  138. package/features/security/apiKeys/DeleteApiKey/abstractions.d.ts +1 -0
  139. package/features/security/apiKeys/DeleteApiKey/abstractions.js +1 -0
  140. package/features/security/apiKeys/DeleteApiKey/abstractions.js.map +1 -1
  141. package/features/security/apiKeys/DeleteApiKey/events.d.ts +6 -4
  142. package/features/security/apiKeys/DeleteApiKey/events.js +8 -4
  143. package/features/security/apiKeys/DeleteApiKey/events.js.map +1 -1
  144. package/features/security/apiKeys/DeleteApiKey/feature.d.ts +4 -1
  145. package/features/security/apiKeys/GetApiKey/abstractions.d.ts +1 -0
  146. package/features/security/apiKeys/GetApiKey/abstractions.js +1 -0
  147. package/features/security/apiKeys/GetApiKey/abstractions.js.map +1 -1
  148. package/features/security/apiKeys/GetApiKey/feature.d.ts +4 -1
  149. package/features/security/apiKeys/GetApiKeyBySlug/abstractions.d.ts +1 -0
  150. package/features/security/apiKeys/GetApiKeyBySlug/abstractions.js +1 -0
  151. package/features/security/apiKeys/GetApiKeyBySlug/abstractions.js.map +1 -1
  152. package/features/security/apiKeys/GetApiKeyBySlug/feature.d.ts +4 -1
  153. package/features/security/apiKeys/GetApiKeyByToken/abstractions.d.ts +1 -0
  154. package/features/security/apiKeys/GetApiKeyByToken/abstractions.js +1 -0
  155. package/features/security/apiKeys/GetApiKeyByToken/abstractions.js.map +1 -1
  156. package/features/security/apiKeys/GetApiKeyByToken/feature.d.ts +4 -1
  157. package/features/security/apiKeys/ListApiKeys/ListApiKeysUseCase.js +1 -1
  158. package/features/security/apiKeys/ListApiKeys/ListApiKeysUseCase.js.map +1 -1
  159. package/features/security/apiKeys/ListApiKeys/abstractions.d.ts +1 -0
  160. package/features/security/apiKeys/ListApiKeys/abstractions.js +1 -0
  161. package/features/security/apiKeys/ListApiKeys/abstractions.js.map +1 -1
  162. package/features/security/apiKeys/ListApiKeys/feature.d.ts +4 -1
  163. package/features/security/apiKeys/UpdateApiKey/UpdateApiKeyUseCase.js +1 -1
  164. package/features/security/apiKeys/UpdateApiKey/UpdateApiKeyUseCase.js.map +1 -1
  165. package/features/security/apiKeys/UpdateApiKey/abstractions.d.ts +1 -0
  166. package/features/security/apiKeys/UpdateApiKey/abstractions.js +1 -0
  167. package/features/security/apiKeys/UpdateApiKey/abstractions.js.map +1 -1
  168. package/features/security/apiKeys/UpdateApiKey/events.d.ts +6 -4
  169. package/features/security/apiKeys/UpdateApiKey/events.js +8 -4
  170. package/features/security/apiKeys/UpdateApiKey/events.js.map +1 -1
  171. package/features/security/apiKeys/UpdateApiKey/feature.d.ts +4 -1
  172. package/features/security/apiKeys/feature.d.ts +4 -1
  173. package/features/security/apiKeys/shared/abstractions.d.ts +5 -2
  174. package/features/security/apiKeys/shared/abstractions.js +3 -0
  175. package/features/security/apiKeys/shared/abstractions.js.map +1 -1
  176. package/features/security/apiKeys/shared/schemas.d.ts +10 -71
  177. package/features/security/apiKeys/shared/schemas.js +4 -4
  178. package/features/security/apiKeys/shared/schemas.js.map +1 -1
  179. package/features/security/authentication/AuthenticationContext/SetIdTokenCookie.d.ts +2 -2
  180. package/features/security/authentication/AuthenticationContext/SetIdTokenCookie.js +2 -2
  181. package/features/security/authentication/AuthenticationContext/SetIdTokenCookie.js.map +1 -1
  182. package/features/security/authentication/AuthenticationContext/abstractions.d.ts +1 -0
  183. package/features/security/authentication/AuthenticationContext/abstractions.js +1 -0
  184. package/features/security/authentication/AuthenticationContext/abstractions.js.map +1 -1
  185. package/features/security/authentication/AuthenticationContext/events.d.ts +6 -4
  186. package/features/security/authentication/AuthenticationContext/events.js +8 -4
  187. package/features/security/authentication/AuthenticationContext/events.js.map +1 -1
  188. package/features/security/authentication/AuthenticationContext/feature.d.ts +4 -1
  189. package/features/security/authentication/Authenticator/abstractions.d.ts +1 -0
  190. package/features/security/authentication/Authenticator/abstractions.js +1 -0
  191. package/features/security/authentication/Authenticator/abstractions.js.map +1 -1
  192. package/features/security/authorization/AuthorizationContext/AuthorizationContext.d.ts +1 -0
  193. package/features/security/authorization/AuthorizationContext/AuthorizationContext.js +14 -2
  194. package/features/security/authorization/AuthorizationContext/AuthorizationContext.js.map +1 -1
  195. package/features/security/authorization/AuthorizationContext/abstractions.d.ts +2 -0
  196. package/features/security/authorization/AuthorizationContext/abstractions.js +2 -0
  197. package/features/security/authorization/AuthorizationContext/abstractions.js.map +1 -1
  198. package/features/security/authorization/AuthorizationContext/feature.d.ts +4 -1
  199. package/features/security/authorization/Authorizer/abstractions.d.ts +1 -0
  200. package/features/security/authorization/Authorizer/abstractions.js +1 -0
  201. package/features/security/authorization/Authorizer/abstractions.js.map +1 -1
  202. package/features/security/authorization/GroupsTeamsAuthorizer/feature.d.ts +4 -1
  203. package/features/security/login/abstractions.d.ts +3 -2
  204. package/features/security/login/abstractions.js +4 -2
  205. package/features/security/login/abstractions.js.map +1 -1
  206. package/features/security/permissions/createPermissionSchema.d.ts +2 -0
  207. package/features/security/permissions/createPermissionSchema.js +8 -0
  208. package/features/security/permissions/createPermissionSchema.js.map +1 -0
  209. package/features/security/permissions/createPermissions.d.ts +8 -0
  210. package/features/security/permissions/createPermissions.js +250 -0
  211. package/features/security/permissions/createPermissions.js.map +1 -0
  212. package/features/security/permissions/index.d.ts +3 -0
  213. package/features/security/permissions/index.js +4 -0
  214. package/features/security/permissions/index.js.map +1 -0
  215. package/features/security/permissions/types.d.ts +137 -0
  216. package/features/security/permissions/types.js +3 -0
  217. package/features/security/permissions/types.js.map +1 -0
  218. package/features/security/roles/CreateRole/CreateRoleUseCase.d.ts +1 -3
  219. package/features/security/roles/CreateRole/CreateRoleUseCase.js +3 -7
  220. package/features/security/roles/CreateRole/CreateRoleUseCase.js.map +1 -1
  221. package/features/security/roles/CreateRole/abstractions.d.ts +1 -0
  222. package/features/security/roles/CreateRole/abstractions.js +1 -0
  223. package/features/security/roles/CreateRole/abstractions.js.map +1 -1
  224. package/features/security/roles/CreateRole/events.d.ts +6 -4
  225. package/features/security/roles/CreateRole/events.js +8 -4
  226. package/features/security/roles/CreateRole/events.js.map +1 -1
  227. package/features/security/roles/CreateRole/feature.d.ts +4 -1
  228. package/features/security/roles/CreateRole/schema.d.ts +2 -20
  229. package/features/security/roles/CreateRole/schema.js +2 -2
  230. package/features/security/roles/CreateRole/schema.js.map +1 -1
  231. package/features/security/roles/DeleteRole/abstractions.d.ts +1 -0
  232. package/features/security/roles/DeleteRole/abstractions.js +1 -0
  233. package/features/security/roles/DeleteRole/abstractions.js.map +1 -1
  234. package/features/security/roles/DeleteRole/events.d.ts +6 -4
  235. package/features/security/roles/DeleteRole/events.js +8 -4
  236. package/features/security/roles/DeleteRole/events.js.map +1 -1
  237. package/features/security/roles/DeleteRole/feature.d.ts +4 -1
  238. package/features/security/roles/GetRole/abstractions.d.ts +1 -0
  239. package/features/security/roles/GetRole/abstractions.js +1 -0
  240. package/features/security/roles/GetRole/abstractions.js.map +1 -1
  241. package/features/security/roles/GetRole/feature.d.ts +4 -1
  242. package/features/security/roles/ListRoles/abstractions.d.ts +1 -0
  243. package/features/security/roles/ListRoles/abstractions.js +1 -0
  244. package/features/security/roles/ListRoles/abstractions.js.map +1 -1
  245. package/features/security/roles/ListRoles/feature.d.ts +4 -1
  246. package/features/security/roles/UpdateRole/UpdateRoleUseCase.js +1 -1
  247. package/features/security/roles/UpdateRole/UpdateRoleUseCase.js.map +1 -1
  248. package/features/security/roles/UpdateRole/abstractions.d.ts +1 -0
  249. package/features/security/roles/UpdateRole/abstractions.js +1 -0
  250. package/features/security/roles/UpdateRole/abstractions.js.map +1 -1
  251. package/features/security/roles/UpdateRole/events.d.ts +6 -4
  252. package/features/security/roles/UpdateRole/events.js +8 -4
  253. package/features/security/roles/UpdateRole/events.js.map +1 -1
  254. package/features/security/roles/UpdateRole/feature.d.ts +4 -1
  255. package/features/security/roles/UpdateRole/schema.d.ts +2 -18
  256. package/features/security/roles/UpdateRole/schema.js +2 -2
  257. package/features/security/roles/UpdateRole/schema.js.map +1 -1
  258. package/features/security/roles/feature.d.ts +4 -1
  259. package/features/security/roles/feature.js +2 -0
  260. package/features/security/roles/feature.js.map +1 -1
  261. package/features/security/roles/shared/RoleProvider.d.ts +13 -0
  262. package/features/security/roles/shared/RoleProvider.js +29 -0
  263. package/features/security/roles/shared/RoleProvider.js.map +1 -0
  264. package/features/security/roles/shared/RolesRepository.d.ts +3 -1
  265. package/features/security/roles/shared/RolesRepository.js +19 -18
  266. package/features/security/roles/shared/RolesRepository.js.map +1 -1
  267. package/features/security/roles/shared/abstractions.d.ts +19 -0
  268. package/features/security/roles/shared/abstractions.js +3 -0
  269. package/features/security/roles/shared/abstractions.js.map +1 -1
  270. package/features/security/shared/abstractions.d.ts +5 -14
  271. package/features/security/shared/abstractions.js +3 -16
  272. package/features/security/shared/abstractions.js.map +1 -1
  273. package/features/security/teams/CreateTeam/CreateTeamUseCase.d.ts +1 -3
  274. package/features/security/teams/CreateTeam/CreateTeamUseCase.js +3 -7
  275. package/features/security/teams/CreateTeam/CreateTeamUseCase.js.map +1 -1
  276. package/features/security/teams/CreateTeam/abstractions.d.ts +1 -0
  277. package/features/security/teams/CreateTeam/abstractions.js +1 -0
  278. package/features/security/teams/CreateTeam/abstractions.js.map +1 -1
  279. package/features/security/teams/CreateTeam/events.d.ts +6 -4
  280. package/features/security/teams/CreateTeam/events.js +8 -4
  281. package/features/security/teams/CreateTeam/events.js.map +1 -1
  282. package/features/security/teams/CreateTeam/feature.d.ts +4 -1
  283. package/features/security/teams/CreateTeam/index.d.ts +1 -1
  284. package/features/security/teams/CreateTeam/index.js +1 -1
  285. package/features/security/teams/CreateTeam/index.js.map +1 -1
  286. package/features/security/teams/CreateTeam/schema.d.ts +2 -12
  287. package/features/security/teams/DeleteTeam/abstractions.d.ts +1 -0
  288. package/features/security/teams/DeleteTeam/abstractions.js +1 -0
  289. package/features/security/teams/DeleteTeam/abstractions.js.map +1 -1
  290. package/features/security/teams/DeleteTeam/events.d.ts +6 -4
  291. package/features/security/teams/DeleteTeam/events.js +8 -4
  292. package/features/security/teams/DeleteTeam/events.js.map +1 -1
  293. package/features/security/teams/DeleteTeam/feature.d.ts +4 -1
  294. package/features/security/teams/GetTeam/abstractions.d.ts +1 -0
  295. package/features/security/teams/GetTeam/abstractions.js +1 -0
  296. package/features/security/teams/GetTeam/abstractions.js.map +1 -1
  297. package/features/security/teams/GetTeam/feature.d.ts +4 -1
  298. package/features/security/teams/ListTeams/abstractions.d.ts +1 -0
  299. package/features/security/teams/ListTeams/abstractions.js +1 -0
  300. package/features/security/teams/ListTeams/abstractions.js.map +1 -1
  301. package/features/security/teams/ListTeams/feature.d.ts +4 -1
  302. package/features/security/teams/UpdateTeam/UpdateTeamUseCase.js +1 -1
  303. package/features/security/teams/UpdateTeam/UpdateTeamUseCase.js.map +1 -1
  304. package/features/security/teams/UpdateTeam/abstractions.d.ts +1 -0
  305. package/features/security/teams/UpdateTeam/abstractions.js +1 -0
  306. package/features/security/teams/UpdateTeam/abstractions.js.map +1 -1
  307. package/features/security/teams/UpdateTeam/events.d.ts +6 -4
  308. package/features/security/teams/UpdateTeam/events.js +8 -4
  309. package/features/security/teams/UpdateTeam/events.js.map +1 -1
  310. package/features/security/teams/UpdateTeam/feature.d.ts +4 -1
  311. package/features/security/teams/UpdateTeam/schema.d.ts +2 -10
  312. package/features/security/teams/feature.d.ts +4 -1
  313. package/features/security/teams/feature.js +6 -0
  314. package/features/security/teams/feature.js.map +1 -1
  315. package/features/security/teams/shared/TeamProvider.d.ts +13 -0
  316. package/features/security/teams/shared/TeamProvider.js +29 -0
  317. package/features/security/teams/shared/TeamProvider.js.map +1 -0
  318. package/features/security/teams/shared/TeamsRepository.js +20 -18
  319. package/features/security/teams/shared/TeamsRepository.js.map +1 -1
  320. package/features/security/teams/shared/abstractions.d.ts +18 -0
  321. package/features/security/teams/shared/abstractions.js +3 -0
  322. package/features/security/teams/shared/abstractions.js.map +1 -1
  323. package/features/security/teams/shared/decorators/TeamsRepositoryCachingDecorator.d.ts +17 -0
  324. package/features/security/teams/shared/decorators/TeamsRepositoryCachingDecorator.js +76 -0
  325. package/features/security/teams/shared/decorators/TeamsRepositoryCachingDecorator.js.map +1 -0
  326. package/features/security/utils/verifyJwtUsingJwk.d.ts +2 -4
  327. package/features/security/utils/verifyJwtUsingJwk.js +1 -1
  328. package/features/security/utils/verifyJwtUsingJwk.js.map +1 -1
  329. package/features/system/InstallSystem/abstractions.d.ts +4 -5
  330. package/features/system/InstallSystem/abstractions.js +3 -4
  331. package/features/system/InstallSystem/abstractions.js.map +1 -1
  332. package/features/system/InstallSystem/events.js +2 -2
  333. package/features/system/InstallSystem/events.js.map +1 -1
  334. package/features/system/InstallSystem/feature.d.ts +5 -1
  335. package/features/system/InstallSystem/index.d.ts +1 -1
  336. package/features/system/InstallSystem/index.js +1 -1
  337. package/features/system/InstallSystem/index.js.map +1 -1
  338. package/features/system/SystemFeature.d.ts +4 -1
  339. package/features/task/TaskController/abstractions.d.ts +1 -0
  340. package/features/task/TaskController/abstractions.js +1 -0
  341. package/features/task/TaskController/abstractions.js.map +1 -1
  342. package/features/task/TaskDefinition/abstractions.d.ts +7 -1
  343. package/features/task/TaskDefinition/abstractions.js +1 -0
  344. package/features/task/TaskDefinition/abstractions.js.map +1 -1
  345. package/features/task/TaskService/abstractions.d.ts +1 -0
  346. package/features/task/TaskService/abstractions.js +1 -0
  347. package/features/task/TaskService/abstractions.js.map +1 -1
  348. package/features/tenancy/CreateTenant/abstractions.d.ts +9 -7
  349. package/features/tenancy/CreateTenant/abstractions.js +7 -5
  350. package/features/tenancy/CreateTenant/abstractions.js.map +1 -1
  351. package/features/tenancy/CreateTenant/events.js +3 -3
  352. package/features/tenancy/CreateTenant/events.js.map +1 -1
  353. package/features/tenancy/CreateTenant/feature.d.ts +5 -1
  354. package/features/tenancy/CreateTenant/index.d.ts +1 -1
  355. package/features/tenancy/CreateTenant/index.js +1 -1
  356. package/features/tenancy/CreateTenant/index.js.map +1 -1
  357. package/features/tenancy/DeleteTenant/abstractions.d.ts +9 -4
  358. package/features/tenancy/DeleteTenant/abstractions.js +7 -2
  359. package/features/tenancy/DeleteTenant/abstractions.js.map +1 -1
  360. package/features/tenancy/DeleteTenant/events.js +3 -3
  361. package/features/tenancy/DeleteTenant/events.js.map +1 -1
  362. package/features/tenancy/DeleteTenant/feature.d.ts +5 -1
  363. package/features/tenancy/DeleteTenant/index.d.ts +1 -1
  364. package/features/tenancy/DeleteTenant/index.js +1 -1
  365. package/features/tenancy/DeleteTenant/index.js.map +1 -1
  366. package/features/tenancy/GetRootTenant/feature.d.ts +5 -1
  367. package/features/tenancy/GetTenantById/abstractions.d.ts +3 -0
  368. package/features/tenancy/GetTenantById/abstractions.js +3 -9
  369. package/features/tenancy/GetTenantById/abstractions.js.map +1 -1
  370. package/features/tenancy/GetTenantById/feature.d.ts +5 -1
  371. package/features/tenancy/InstallTenant/abstractions.d.ts +5 -11
  372. package/features/tenancy/InstallTenant/abstractions.js +4 -13
  373. package/features/tenancy/InstallTenant/abstractions.js.map +1 -1
  374. package/features/tenancy/InstallTenant/events.js +2 -2
  375. package/features/tenancy/InstallTenant/events.js.map +1 -1
  376. package/features/tenancy/InstallTenant/feature.d.ts +5 -1
  377. package/features/tenancy/InstallTenant/index.d.ts +1 -1
  378. package/features/tenancy/InstallTenant/index.js +1 -1
  379. package/features/tenancy/InstallTenant/index.js.map +1 -1
  380. package/features/tenancy/ListTenants/feature.d.ts +5 -1
  381. package/features/tenancy/TenancyFeature.d.ts +4 -1
  382. package/features/tenancy/TenancyFeature.js.map +1 -1
  383. package/features/tenancy/TenantContext/abstractions.d.ts +1 -0
  384. package/features/tenancy/TenantContext/abstractions.js +1 -0
  385. package/features/tenancy/TenantContext/abstractions.js.map +1 -1
  386. package/features/tenancy/TenantContext/feature.d.ts +4 -1
  387. package/features/tenancy/UpdateTenant/abstractions.d.ts +9 -4
  388. package/features/tenancy/UpdateTenant/abstractions.js +7 -2
  389. package/features/tenancy/UpdateTenant/abstractions.js.map +1 -1
  390. package/features/tenancy/UpdateTenant/events.js +3 -3
  391. package/features/tenancy/UpdateTenant/events.js.map +1 -1
  392. package/features/tenancy/UpdateTenant/feature.d.ts +5 -1
  393. package/features/tenancy/UpdateTenant/index.d.ts +1 -1
  394. package/features/tenancy/UpdateTenant/index.js +1 -1
  395. package/features/tenancy/UpdateTenant/index.js.map +1 -1
  396. package/features/users/AdminUsersFeature.d.ts +4 -1
  397. package/features/users/AdminUsersFeature.js.map +1 -1
  398. package/features/users/CreateUser/CreateUserUseCase.js +1 -1
  399. package/features/users/CreateUser/CreateUserUseCase.js.map +1 -1
  400. package/features/users/CreateUser/abstractions.d.ts +1 -0
  401. package/features/users/CreateUser/abstractions.js +1 -1
  402. package/features/users/CreateUser/abstractions.js.map +1 -1
  403. package/features/users/CreateUser/events.d.ts +6 -4
  404. package/features/users/CreateUser/events.js +8 -4
  405. package/features/users/CreateUser/events.js.map +1 -1
  406. package/features/users/CreateUser/feature.d.ts +4 -1
  407. package/features/users/CreateUser/schema.d.ts +4 -36
  408. package/features/users/DeleteUser/abstractions.d.ts +1 -0
  409. package/features/users/DeleteUser/abstractions.js +1 -1
  410. package/features/users/DeleteUser/abstractions.js.map +1 -1
  411. package/features/users/DeleteUser/events.d.ts +6 -4
  412. package/features/users/DeleteUser/events.js +8 -4
  413. package/features/users/DeleteUser/events.js.map +1 -1
  414. package/features/users/DeleteUser/feature.d.ts +4 -1
  415. package/features/users/ExternalIdpUserSync/ExternalIdpUserSyncHandler.d.ts +3 -3
  416. package/features/users/ExternalIdpUserSync/ExternalIdpUserSyncHandler.js +2 -2
  417. package/features/users/ExternalIdpUserSync/ExternalIdpUserSyncHandler.js.map +1 -1
  418. package/features/users/ExternalIdpUserSync/feature.d.ts +4 -1
  419. package/features/users/GetIdentityProfile/feature.d.ts +4 -1
  420. package/features/users/GetUser/abstractions.d.ts +1 -0
  421. package/features/users/GetUser/abstractions.js +1 -1
  422. package/features/users/GetUser/abstractions.js.map +1 -1
  423. package/features/users/GetUser/feature.d.ts +4 -1
  424. package/features/users/ListUserTeams/abstractions.d.ts +1 -0
  425. package/features/users/ListUserTeams/abstractions.js +1 -1
  426. package/features/users/ListUserTeams/abstractions.js.map +1 -1
  427. package/features/users/ListUserTeams/feature.d.ts +4 -1
  428. package/features/users/ListUsers/abstractions.d.ts +1 -0
  429. package/features/users/ListUsers/abstractions.js +1 -1
  430. package/features/users/ListUsers/abstractions.js.map +1 -1
  431. package/features/users/ListUsers/feature.d.ts +4 -1
  432. package/features/users/UpdateUser/UpdateUserUseCase.js +1 -1
  433. package/features/users/UpdateUser/UpdateUserUseCase.js.map +1 -1
  434. package/features/users/UpdateUser/abstractions.d.ts +1 -0
  435. package/features/users/UpdateUser/abstractions.js +1 -1
  436. package/features/users/UpdateUser/abstractions.js.map +1 -1
  437. package/features/users/UpdateUser/events.d.ts +6 -4
  438. package/features/users/UpdateUser/events.js +8 -4
  439. package/features/users/UpdateUser/events.js.map +1 -1
  440. package/features/users/UpdateUser/feature.d.ts +4 -1
  441. package/features/users/UpdateUser/schema.d.ts +4 -30
  442. package/features/users/shared/abstractions.d.ts +1 -0
  443. package/features/users/shared/abstractions.js +1 -1
  444. package/features/users/shared/abstractions.js.map +1 -1
  445. package/features/wcp/WcpContext/WcpContext.d.ts +5 -0
  446. package/features/wcp/WcpContext/WcpContext.js +15 -0
  447. package/features/wcp/WcpContext/WcpContext.js.map +1 -1
  448. package/features/wcp/WcpContext/abstractions.d.ts +1 -0
  449. package/features/wcp/WcpContext/abstractions.js.map +1 -1
  450. package/features/wcp/WcpContext/decorators/WcpContextWithFeatureFlagsDecorator.d.ts +94 -0
  451. package/features/wcp/WcpContext/decorators/WcpContextWithFeatureFlagsDecorator.js +142 -0
  452. package/features/wcp/WcpContext/decorators/WcpContextWithFeatureFlagsDecorator.js.map +1 -0
  453. package/features/wcp/WcpContext/feature.d.ts +5 -1
  454. package/features/wcp/WcpFeature.d.ts +4 -1
  455. package/features/wcp/WcpFeature.js +2 -0
  456. package/features/wcp/WcpFeature.js.map +1 -1
  457. package/graphql/security/NotAuthorizedResponse.d.ts +1 -0
  458. package/graphql/security/NotAuthorizedResponse.js +1 -0
  459. package/graphql/security/NotAuthorizedResponse.js.map +1 -1
  460. package/graphql/wcp/graphql.js +2 -1
  461. package/graphql/wcp/graphql.js.map +1 -1
  462. package/idp/abstractions.d.ts +4 -0
  463. package/idp/abstractions.js +4 -0
  464. package/idp/abstractions.js.map +1 -1
  465. package/idp/feature.d.ts +4 -1
  466. package/legacy/security/createSecurityContext.js +0 -11
  467. package/legacy/security/createSecurityContext.js.map +1 -1
  468. package/legacy/security/plugins/authenticateUsingHttpHeader.d.ts +1 -1
  469. package/legacy/wcp/LegacyWcpContext.d.ts +5 -0
  470. package/legacy/wcp/LegacyWcpContext.js +15 -0
  471. package/legacy/wcp/LegacyWcpContext.js.map +1 -1
  472. package/legacy/wcp/context.d.ts +1 -3
  473. package/legacy/wcp/context.js +4 -2
  474. package/legacy/wcp/context.js.map +1 -1
  475. package/models/base/BaseModel.js +2 -2
  476. package/models/base/BaseModel.js.map +1 -1
  477. package/models/base/ModelBuilder.d.ts +2 -2
  478. package/models/base/ModelBuilder.js +21 -2
  479. package/models/base/ModelBuilder.js.map +1 -1
  480. package/models/cms/FieldBuilder.d.ts +4 -3
  481. package/models/cms/FieldBuilder.js +17 -22
  482. package/models/cms/FieldBuilder.js.map +1 -1
  483. package/models/cms/FieldBuilderRegistry.d.ts +1 -1
  484. package/models/cms/FieldBuilderRegistry.js.map +1 -1
  485. package/models/cms/FieldDefinitionsBuilder.d.ts +1 -0
  486. package/models/cms/FieldDefinitionsBuilder.js +15 -17
  487. package/models/cms/FieldDefinitionsBuilder.js.map +1 -1
  488. package/models/cms/PrivateCmsModelBuilder.js +1 -1
  489. package/models/cms/PrivateCmsModelBuilder.js.map +1 -1
  490. package/models/cms/abstractions.d.ts +1 -1
  491. package/models/cms/abstractions.js.map +1 -1
  492. package/models/cms/fieldsBuilder.md +6 -4
  493. package/models/cms/types.d.ts +2 -2
  494. package/models/cms/types.js.map +1 -1
  495. package/models/simple/Page/abstractions.d.ts +1 -11
  496. package/package.json +28 -70
  497. package/types/security.d.ts +13 -10
  498. package/types/security.js.map +1 -1
  499. package/exports/api/buildParams.js +0 -3
  500. package/exports/api/buildParams.js.map +0 -1
  501. package/exports/api/eventPublisher.d.ts +0 -1
  502. package/exports/api/eventPublisher.js.map +0 -1
  503. package/exports/api/keyValueStore.js +0 -3
  504. package/exports/api/keyValueStore.js.map +0 -1
  505. package/exports/api/security/apiKey.d.ts +0 -7
  506. package/exports/api/security/apiKey.js +0 -9
  507. package/exports/api/security/apiKey.js.map +0 -1
  508. package/extensions/BuildParam.d.ts +0 -11
  509. package/extensions/BuildParam.js +0 -119
  510. package/extensions/BuildParam.js.map +0 -1
  511. package/extensions/GenericExtension.d.ts +0 -10
  512. package/extensions/GenericExtension.js +0 -7
  513. package/extensions/GenericExtension.js.map +0 -1
  514. package/extensions/eventHandlers/AfterAuthentication.d.ts +0 -10
  515. package/extensions/eventHandlers/AfterAuthentication.js +0 -9
  516. package/extensions/eventHandlers/AfterAuthentication.js.map +0 -1
  517. package/extensions/eventHandlers/ApiKeyAfterCreate.d.ts +0 -10
  518. package/extensions/eventHandlers/ApiKeyAfterCreate.js +0 -9
  519. package/extensions/eventHandlers/ApiKeyAfterCreate.js.map +0 -1
  520. package/extensions/eventHandlers/ApiKeyAfterDelete.d.ts +0 -10
  521. package/extensions/eventHandlers/ApiKeyAfterDelete.js +0 -9
  522. package/extensions/eventHandlers/ApiKeyAfterDelete.js.map +0 -1
  523. package/extensions/eventHandlers/ApiKeyAfterUpdate.d.ts +0 -10
  524. package/extensions/eventHandlers/ApiKeyAfterUpdate.js +0 -9
  525. package/extensions/eventHandlers/ApiKeyAfterUpdate.js.map +0 -1
  526. package/extensions/eventHandlers/ApiKeyBeforeCreate.d.ts +0 -10
  527. package/extensions/eventHandlers/ApiKeyBeforeCreate.js +0 -9
  528. package/extensions/eventHandlers/ApiKeyBeforeCreate.js.map +0 -1
  529. package/extensions/eventHandlers/ApiKeyBeforeDelete.d.ts +0 -10
  530. package/extensions/eventHandlers/ApiKeyBeforeDelete.js +0 -9
  531. package/extensions/eventHandlers/ApiKeyBeforeDelete.js.map +0 -1
  532. package/extensions/eventHandlers/ApiKeyBeforeUpdate.d.ts +0 -10
  533. package/extensions/eventHandlers/ApiKeyBeforeUpdate.js +0 -9
  534. package/extensions/eventHandlers/ApiKeyBeforeUpdate.js.map +0 -1
  535. package/extensions/eventHandlers/BeforeAuthentication.d.ts +0 -10
  536. package/extensions/eventHandlers/BeforeAuthentication.js +0 -9
  537. package/extensions/eventHandlers/BeforeAuthentication.js.map +0 -1
  538. package/extensions/eventHandlers/RoleAfterCreate.d.ts +0 -10
  539. package/extensions/eventHandlers/RoleAfterCreate.js +0 -9
  540. package/extensions/eventHandlers/RoleAfterCreate.js.map +0 -1
  541. package/extensions/eventHandlers/RoleAfterDelete.d.ts +0 -10
  542. package/extensions/eventHandlers/RoleAfterDelete.js +0 -9
  543. package/extensions/eventHandlers/RoleAfterDelete.js.map +0 -1
  544. package/extensions/eventHandlers/RoleAfterUpdate.d.ts +0 -10
  545. package/extensions/eventHandlers/RoleAfterUpdate.js +0 -9
  546. package/extensions/eventHandlers/RoleAfterUpdate.js.map +0 -1
  547. package/extensions/eventHandlers/RoleBeforeCreate.d.ts +0 -10
  548. package/extensions/eventHandlers/RoleBeforeCreate.js +0 -9
  549. package/extensions/eventHandlers/RoleBeforeCreate.js.map +0 -1
  550. package/extensions/eventHandlers/RoleBeforeDelete.d.ts +0 -10
  551. package/extensions/eventHandlers/RoleBeforeDelete.js +0 -9
  552. package/extensions/eventHandlers/RoleBeforeDelete.js.map +0 -1
  553. package/extensions/eventHandlers/RoleBeforeUpdate.d.ts +0 -10
  554. package/extensions/eventHandlers/RoleBeforeUpdate.js +0 -9
  555. package/extensions/eventHandlers/RoleBeforeUpdate.js.map +0 -1
  556. package/extensions/eventHandlers/SystemInstalled.d.ts +0 -10
  557. package/extensions/eventHandlers/SystemInstalled.js +0 -9
  558. package/extensions/eventHandlers/SystemInstalled.js.map +0 -1
  559. package/extensions/eventHandlers/TeamAfterCreate.d.ts +0 -10
  560. package/extensions/eventHandlers/TeamAfterCreate.js +0 -9
  561. package/extensions/eventHandlers/TeamAfterCreate.js.map +0 -1
  562. package/extensions/eventHandlers/TeamAfterDelete.d.ts +0 -10
  563. package/extensions/eventHandlers/TeamAfterDelete.js +0 -9
  564. package/extensions/eventHandlers/TeamAfterDelete.js.map +0 -1
  565. package/extensions/eventHandlers/TeamAfterUpdate.d.ts +0 -10
  566. package/extensions/eventHandlers/TeamAfterUpdate.js +0 -9
  567. package/extensions/eventHandlers/TeamAfterUpdate.js.map +0 -1
  568. package/extensions/eventHandlers/TeamBeforeCreate.d.ts +0 -10
  569. package/extensions/eventHandlers/TeamBeforeCreate.js +0 -9
  570. package/extensions/eventHandlers/TeamBeforeCreate.js.map +0 -1
  571. package/extensions/eventHandlers/TeamBeforeDelete.d.ts +0 -10
  572. package/extensions/eventHandlers/TeamBeforeDelete.js +0 -9
  573. package/extensions/eventHandlers/TeamBeforeDelete.js.map +0 -1
  574. package/extensions/eventHandlers/TeamBeforeUpdate.d.ts +0 -10
  575. package/extensions/eventHandlers/TeamBeforeUpdate.js +0 -9
  576. package/extensions/eventHandlers/TeamBeforeUpdate.js.map +0 -1
  577. package/extensions/eventHandlers/TenantAfterCreate.d.ts +0 -10
  578. package/extensions/eventHandlers/TenantAfterCreate.js +0 -9
  579. package/extensions/eventHandlers/TenantAfterCreate.js.map +0 -1
  580. package/extensions/eventHandlers/TenantAfterDelete.d.ts +0 -10
  581. package/extensions/eventHandlers/TenantAfterDelete.js +0 -9
  582. package/extensions/eventHandlers/TenantAfterDelete.js.map +0 -1
  583. package/extensions/eventHandlers/TenantAfterUpdate.d.ts +0 -10
  584. package/extensions/eventHandlers/TenantAfterUpdate.js +0 -9
  585. package/extensions/eventHandlers/TenantAfterUpdate.js.map +0 -1
  586. package/extensions/eventHandlers/TenantBeforeCreate.d.ts +0 -10
  587. package/extensions/eventHandlers/TenantBeforeCreate.js +0 -9
  588. package/extensions/eventHandlers/TenantBeforeCreate.js.map +0 -1
  589. package/extensions/eventHandlers/TenantBeforeDelete.d.ts +0 -10
  590. package/extensions/eventHandlers/TenantBeforeDelete.js +0 -9
  591. package/extensions/eventHandlers/TenantBeforeDelete.js.map +0 -1
  592. package/extensions/eventHandlers/TenantBeforeUpdate.d.ts +0 -10
  593. package/extensions/eventHandlers/TenantBeforeUpdate.js +0 -9
  594. package/extensions/eventHandlers/TenantBeforeUpdate.js.map +0 -1
  595. package/extensions/eventHandlers/TenantInstalled.d.ts +0 -10
  596. package/extensions/eventHandlers/TenantInstalled.js +0 -9
  597. package/extensions/eventHandlers/TenantInstalled.js.map +0 -1
  598. package/extensions/eventHandlers/UserAfterCreate.d.ts +0 -10
  599. package/extensions/eventHandlers/UserAfterCreate.js +0 -9
  600. package/extensions/eventHandlers/UserAfterCreate.js.map +0 -1
  601. package/extensions/eventHandlers/UserAfterDelete.d.ts +0 -10
  602. package/extensions/eventHandlers/UserAfterDelete.js +0 -9
  603. package/extensions/eventHandlers/UserAfterDelete.js.map +0 -1
  604. package/extensions/eventHandlers/UserAfterUpdate.d.ts +0 -10
  605. package/extensions/eventHandlers/UserAfterUpdate.js +0 -9
  606. package/extensions/eventHandlers/UserAfterUpdate.js.map +0 -1
  607. package/extensions/eventHandlers/UserBeforeCreate.d.ts +0 -10
  608. package/extensions/eventHandlers/UserBeforeCreate.js +0 -9
  609. package/extensions/eventHandlers/UserBeforeCreate.js.map +0 -1
  610. package/extensions/eventHandlers/UserBeforeDelete.d.ts +0 -10
  611. package/extensions/eventHandlers/UserBeforeDelete.js +0 -9
  612. package/extensions/eventHandlers/UserBeforeDelete.js.map +0 -1
  613. package/extensions/eventHandlers/UserBeforeUpdate.d.ts +0 -10
  614. package/extensions/eventHandlers/UserBeforeUpdate.js +0 -9
  615. package/extensions/eventHandlers/UserBeforeUpdate.js.map +0 -1
  616. package/extensions/eventHandlers/index.d.ts +0 -34
  617. package/extensions/eventHandlers/index.js +0 -49
  618. package/extensions/eventHandlers/index.js.map +0 -1
  619. package/extensions/index.d.ts +0 -58
  620. package/extensions/index.js +0 -49
  621. package/extensions/index.js.map +0 -1
  622. package/features/security/shared/abstractions.ts.bak +0 -52
  623. package/legacy/security/plugins/SecurityRolePlugin.d.ts +0 -16
  624. package/legacy/security/plugins/SecurityRolePlugin.js +0 -33
  625. package/legacy/security/plugins/SecurityRolePlugin.js.map +0 -1
  626. package/legacy/security/plugins/SecurityTeamPlugin.d.ts +0 -16
  627. package/legacy/security/plugins/SecurityTeamPlugin.js +0 -33
  628. package/legacy/security/plugins/SecurityTeamPlugin.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createImplementation","generateText","streamText","Ai","AiAbstraction","AiSdkFactory","AiConnectionFactory","toAiModel","factory","modelId","modelName","providerId","id","providerName","name","AiImpl","sdkCache","Map","resolvedConnections","constructor","sdkFactories","connectionFactories","params","model","connection","rest","resolveLanguageModel","then","resolvedModel","listModels","Promise","resolve","flatMap","models","map","m","listModelsByConnections","connections","getConnections","conn","find","f","sdkName","listModelsByConnection","resolveConnection","undefined","slashIndex","indexOf","Error","slice","sdk","getSdk","languageModel","all","execute","found","c","known","join","cacheKey","apiKey","cached","get","set","abstraction","implementation","dependencies","multiple"],"sources":["Ai.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/feature/api\";\nimport { generateText } from \"ai\";\nimport { streamText } from \"ai\";\nimport { Ai as AiAbstraction } from \"./abstractions.js\";\nimport { AiSdkFactory } from \"./abstractions.js\";\nimport { AiConnectionFactory } from \"./abstractions.js\";\nimport type { AiGenerateTextParams, AiModel, IAiSdkFactory } from \"./abstractions.js\";\nimport type { AiStreamTextParams } from \"./abstractions.js\";\nimport type { IAiSdk } from \"./abstractions.js\";\nimport type { IAiConnection } from \"./abstractions.js\";\nimport type { IAiConnectionInline } from \"./abstractions.js\";\nimport type { LanguageModel } from \"ai\";\n\nfunction toAiModel(factory: IAiSdkFactory, modelId: string, modelName: string): AiModel {\n return {\n providerId: factory.id,\n providerName: factory.name,\n modelId,\n modelName\n };\n}\n\nclass AiImpl implements AiAbstraction.Interface {\n private sdkCache = new Map<string, IAiSdk>();\n private resolvedConnections: IAiConnection[] | null = null;\n\n constructor(\n private readonly sdkFactories: AiSdkFactory.Interface[],\n private readonly connectionFactories: AiConnectionFactory.Interface[]\n ) {}\n\n generateText(params: AiGenerateTextParams): ReturnType<typeof generateText> {\n const { model, connection, ...rest } = params;\n return this.resolveLanguageModel(model, connection).then(resolvedModel => {\n // Cast required: spreading the discriminated Prompt union loses its narrowing.\n return generateText({ model: resolvedModel, ...rest } as Parameters<\n typeof generateText\n >[0]);\n });\n }\n\n async streamText(params: AiStreamTextParams): Promise<ReturnType<typeof streamText>> {\n const { model, connection, ...rest } = params;\n const resolvedModel = await this.resolveLanguageModel(model, connection);\n // Cast required: spreading the discriminated Prompt union loses its narrowing.\n return streamText({ model: resolvedModel, ...rest } as Parameters<typeof streamText>[0]);\n }\n\n listModels(): Promise<AiModel[]> {\n return Promise.resolve(\n this.sdkFactories.flatMap(factory =>\n factory.models.map(m => toAiModel(factory, m.id, m.name))\n )\n );\n }\n\n async listModelsByConnections(): Promise<AiModel[]> {\n const connections = await this.getConnections();\n return connections.flatMap(conn => {\n const factory = this.sdkFactories.find(f => f.id === conn.sdkName);\n if (!factory) {\n return [];\n }\n return factory.models.map(m => toAiModel(factory, m.id, m.name));\n });\n }\n\n async listModelsByConnection(connection: string | IAiConnectionInline): Promise<AiModel[]> {\n const conn = await this.resolveConnection(undefined, connection);\n const factory = this.sdkFactories.find(f => f.id === conn.sdkName);\n if (!factory) {\n return [];\n }\n return factory.models.map(m => toAiModel(factory, m.id, m.name));\n }\n\n private async resolveLanguageModel(\n modelId: string,\n connection?: string | IAiConnectionInline\n ): Promise<LanguageModel> {\n const slashIndex = modelId.indexOf(\"/\");\n if (slashIndex === -1) {\n throw new Error(\n `Invalid model ID \"${modelId}\". Expected format: \"<providerId>/<modelId>\" (e.g. \"openai/gpt-4o\").`\n );\n }\n\n const providerId = modelId.slice(0, slashIndex);\n const modelName = modelId.slice(slashIndex + 1);\n\n const conn = await this.resolveConnection(providerId, connection);\n const sdk = await this.getSdk(conn);\n return sdk.languageModel(modelName);\n }\n\n private async getConnections(): Promise<IAiConnection[]> {\n if (!this.resolvedConnections) {\n this.resolvedConnections = await Promise.all(\n this.connectionFactories.map(f => f.execute())\n );\n }\n return this.resolvedConnections;\n }\n\n private async resolveConnection(\n providerId: string | undefined,\n connection?: string | IAiConnectionInline\n ): Promise<IAiConnectionInline> {\n if (typeof connection === \"object\") {\n return connection;\n }\n\n const connections = await this.getConnections();\n\n if (typeof connection === \"string\") {\n const found = connections.find(c => c.id === connection);\n if (!found) {\n const known = connections.map(c => `\"${c.id}\"`).join(\", \");\n throw new Error(\n `Unknown AI connection \"${connection}\". Registered connections: ${known}.`\n );\n }\n return found;\n }\n\n const found = connections.find(c => c.sdkName === providerId);\n if (!found) {\n const known = connections.map(c => `\"${c.id}\" (${c.sdkName})`).join(\", \");\n throw new Error(\n `No AI connection found for provider \"${providerId}\". Registered connections: ${known}.`\n );\n }\n return found;\n }\n\n private async getSdk(connection: IAiConnectionInline): Promise<IAiSdk> {\n const cacheKey =\n \"id\" in connection\n ? (connection as IAiConnection).id\n : `${connection.sdkName}:${connection.apiKey ?? \"__env__\"}`;\n\n const cached = this.sdkCache.get(cacheKey);\n if (cached) {\n return cached;\n }\n\n const factory = this.sdkFactories.find(f => f.id === connection.sdkName);\n if (!factory) {\n const known = this.sdkFactories.map(f => `\"${f.id}\"`).join(\", \");\n throw new Error(\n `No AI SDK factory found for \"${connection.sdkName}\". Registered factories: ${known}.`\n );\n }\n\n const sdk = await factory.execute(connection.apiKey);\n this.sdkCache.set(cacheKey, sdk);\n return sdk;\n }\n}\n\nexport const Ai = createImplementation({\n abstraction: AiAbstraction,\n implementation: AiImpl,\n dependencies: [\n [AiSdkFactory, { multiple: true }],\n [AiConnectionFactory, { multiple: true }]\n ]\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,qBAAqB;AAC1D,SAASC,YAAY,QAAQ,IAAI;AACjC,SAASC,UAAU,QAAQ,IAAI;AAC/B,SAASC,EAAE,IAAIC,aAAa;AAC5B,SAASC,YAAY;AACrB,SAASC,mBAAmB;AAQ5B,SAASC,SAASA,CAACC,OAAsB,EAAEC,OAAe,EAAEC,SAAiB,EAAW;EACpF,OAAO;IACHC,UAAU,EAAEH,OAAO,CAACI,EAAE;IACtBC,YAAY,EAAEL,OAAO,CAACM,IAAI;IAC1BL,OAAO;IACPC;EACJ,CAAC;AACL;AAEA,MAAMK,MAAM,CAAoC;EACpCC,QAAQ,GAAG,IAAIC,GAAG,CAAiB,CAAC;EACpCC,mBAAmB,GAA2B,IAAI;EAE1DC,WAAWA,CACUC,YAAsC,EACtCC,mBAAoD,EACv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,EAAE;IAAE8D,QAAQ,EAAE;EAAK,CAAC,CAAC,EAClC,CAAC7D,mBAAmB,EAAE;IAAE6D,QAAQ,EAAE;EAAK,CAAC,CAAC;AAEjD,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ import { AiSdkTool, AiSdkTools as AiSdkToolsAbstraction } from "./abstractions.js";
2
+ import type { ToolSet } from "ai";
3
+ declare class AiSdkToolsImpl implements AiSdkToolsAbstraction.Interface {
4
+ private tools;
5
+ constructor(tools: AiSdkTool.Interface[]);
6
+ getToolSet(): ToolSet;
7
+ }
8
+ export declare const AiSdkTools: typeof AiSdkToolsImpl & {
9
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IAiSdkTools>;
10
+ };
11
+ export {};
@@ -0,0 +1,25 @@
1
+ import { AiSdkTool, AiSdkTools as AiSdkToolsAbstraction } from "./abstractions.js";
2
+ class AiSdkToolsImpl {
3
+ constructor(tools) {
4
+ this.tools = tools;
5
+ }
6
+ getToolSet() {
7
+ const map = {};
8
+ for (const t of this.tools) {
9
+ map[t.name] = {
10
+ description: t.description,
11
+ inputSchema: t.inputSchema,
12
+ execute: input => t.execute(input)
13
+ };
14
+ }
15
+ return map;
16
+ }
17
+ }
18
+ export const AiSdkTools = AiSdkToolsAbstraction.createImplementation({
19
+ implementation: AiSdkToolsImpl,
20
+ dependencies: [[AiSdkTool, {
21
+ multiple: true
22
+ }]]
23
+ });
24
+
25
+ //# sourceMappingURL=AiSdkTools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["AiSdkTool","AiSdkTools","AiSdkToolsAbstraction","AiSdkToolsImpl","constructor","tools","getToolSet","map","t","name","description","inputSchema","execute","input","createImplementation","implementation","dependencies","multiple"],"sources":["AiSdkTools.ts"],"sourcesContent":["import { AiSdkTool, AiSdkTools as AiSdkToolsAbstraction } from \"./abstractions.js\";\nimport type { ToolSet } from \"ai\";\n\nclass AiSdkToolsImpl implements AiSdkToolsAbstraction.Interface {\n constructor(private tools: AiSdkTool.Interface[]) {}\n\n getToolSet(): ToolSet {\n const map: ToolSet = {};\n for (const t of this.tools) {\n map[t.name] = {\n description: t.description,\n inputSchema: t.inputSchema,\n execute: (input: unknown) => t.execute(input)\n };\n }\n return map;\n }\n}\n\nexport const AiSdkTools = AiSdkToolsAbstraction.createImplementation({\n implementation: AiSdkToolsImpl,\n dependencies: [[AiSdkTool, { multiple: true }]]\n});\n"],"mappings":"AAAA,SAASA,SAAS,EAAEC,UAAU,IAAIC,qBAAqB;AAGvD,MAAMC,cAAc,CAA4C;EAC5DC,WAAWA,CAASC,KAA4B,EAAE;IAAA,KAA9BA,KAA4B,GAA5BA,KAA4B;EAAG;EAEnDC,UAAUA,CAAA,EAAY;IAClB,MAAMC,GAAY,GAAG,CAAC,CAAC;IACvB,KAAK,MAAMC,CAAC,IAAI,IAAI,CAACH,KAAK,EAAE;MACxBE,GAAG,CAACC,CAAC,CAACC,IAAI,CAAC,GAAG;QACVC,WAAW,EAAEF,CAAC,CAACE,WAAW;QAC1BC,WAAW,EAAEH,CAAC,CAACG,WAAW;QAC1BC,OAAO,EAAGC,KAAc,IAAKL,CAAC,CAACI,OAAO,CAACC,KAAK;MAChD,CAAC;IACL;IACA,OAAON,GAAG;EACd;AACJ;AAEA,OAAO,MAAMN,UAAU,GAAGC,qBAAqB,CAACY,oBAAoB,CAAC;EACjEC,cAAc,EAAEZ,cAAc;EAC9Ba,YAAY,EAAE,CAAC,CAAChB,SAAS,EAAE;IAAEiB,QAAQ,EAAE;EAAK,CAAC,CAAC;AAClD,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ import { AiSdkFactory as AiSdkFactoryAbstraction } from "./abstractions.js";
2
+ import type { IAiSdk, IAiSdkModel } from "./abstractions.js";
3
+ declare class AnthropicSdkFactoryImpl implements AiSdkFactoryAbstraction.Interface {
4
+ readonly id = "anthropic";
5
+ readonly name = "Anthropic";
6
+ readonly models: IAiSdkModel[];
7
+ execute(apiKey?: string): Promise<IAiSdk>;
8
+ }
9
+ export declare const AnthropicSdkFactory: import("@webiny/di").Implementation<typeof AnthropicSdkFactoryImpl>;
10
+ export {};
@@ -0,0 +1,71 @@
1
+ import { createImplementation } from "@webiny/feature/api";
2
+ import { AiSdkFactory as AiSdkFactoryAbstraction } from "./abstractions.js";
3
+ const ANTHROPIC_MODELS = [{
4
+ id: "claude-3-haiku-20240307",
5
+ name: "Claude 3 Haiku"
6
+ }, {
7
+ id: "claude-haiku-4-5-20251001",
8
+ name: "Claude Haiku 4.5"
9
+ }, {
10
+ id: "claude-haiku-4-5",
11
+ name: "Claude Haiku 4.5"
12
+ }, {
13
+ id: "claude-opus-4-0",
14
+ name: "Claude Opus 4"
15
+ }, {
16
+ id: "claude-opus-4-20250514",
17
+ name: "Claude Opus 4"
18
+ }, {
19
+ id: "claude-opus-4-1-20250805",
20
+ name: "Claude Opus 4.1"
21
+ }, {
22
+ id: "claude-opus-4-1",
23
+ name: "Claude Opus 4.1"
24
+ }, {
25
+ id: "claude-opus-4-5",
26
+ name: "Claude Opus 4.5"
27
+ }, {
28
+ id: "claude-opus-4-5-20251101",
29
+ name: "Claude Opus 4.5"
30
+ }, {
31
+ id: "claude-sonnet-4-0",
32
+ name: "Claude Sonnet 4"
33
+ }, {
34
+ id: "claude-sonnet-4-20250514",
35
+ name: "Claude Sonnet 4"
36
+ }, {
37
+ id: "claude-sonnet-4-5-20250929",
38
+ name: "Claude Sonnet 4.5"
39
+ }, {
40
+ id: "claude-sonnet-4-5",
41
+ name: "Claude Sonnet 4.5"
42
+ }, {
43
+ id: "claude-sonnet-4-6",
44
+ name: "Claude Sonnet 4.6"
45
+ }, {
46
+ id: "claude-opus-4-6",
47
+ name: "Claude Opus 4.6"
48
+ }];
49
+ class AnthropicSdkFactoryImpl {
50
+ id = "anthropic";
51
+ name = "Anthropic";
52
+ models = ANTHROPIC_MODELS;
53
+ async execute(apiKey) {
54
+ const {
55
+ createAnthropic
56
+ } = await import("@ai-sdk/anthropic");
57
+ const provider = createAnthropic({
58
+ apiKey: apiKey ?? process.env.WEBINY_API_ANTHROPIC_API_KEY
59
+ });
60
+ return {
61
+ languageModel: modelId => provider.chat(modelId)
62
+ };
63
+ }
64
+ }
65
+ export const AnthropicSdkFactory = createImplementation({
66
+ abstraction: AiSdkFactoryAbstraction,
67
+ implementation: AnthropicSdkFactoryImpl,
68
+ dependencies: []
69
+ });
70
+
71
+ //# sourceMappingURL=AnthropicSdkFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createImplementation","AiSdkFactory","AiSdkFactoryAbstraction","ANTHROPIC_MODELS","id","name","AnthropicSdkFactoryImpl","models","execute","apiKey","createAnthropic","provider","process","env","WEBINY_API_ANTHROPIC_API_KEY","languageModel","modelId","chat","AnthropicSdkFactory","abstraction","implementation","dependencies"],"sources":["AnthropicSdkFactory.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/feature/api\";\nimport { AiSdkFactory as AiSdkFactoryAbstraction } from \"./abstractions.js\";\nimport type { IAiSdk, IAiSdkModel } from \"./abstractions.js\";\n\nconst ANTHROPIC_MODELS: IAiSdkModel[] = [\n { id: \"claude-3-haiku-20240307\", name: \"Claude 3 Haiku\" },\n { id: \"claude-haiku-4-5-20251001\", name: \"Claude Haiku 4.5\" },\n { id: \"claude-haiku-4-5\", name: \"Claude Haiku 4.5\" },\n { id: \"claude-opus-4-0\", name: \"Claude Opus 4\" },\n { id: \"claude-opus-4-20250514\", name: \"Claude Opus 4\" },\n { id: \"claude-opus-4-1-20250805\", name: \"Claude Opus 4.1\" },\n { id: \"claude-opus-4-1\", name: \"Claude Opus 4.1\" },\n { id: \"claude-opus-4-5\", name: \"Claude Opus 4.5\" },\n { id: \"claude-opus-4-5-20251101\", name: \"Claude Opus 4.5\" },\n { id: \"claude-sonnet-4-0\", name: \"Claude Sonnet 4\" },\n { id: \"claude-sonnet-4-20250514\", name: \"Claude Sonnet 4\" },\n { id: \"claude-sonnet-4-5-20250929\", name: \"Claude Sonnet 4.5\" },\n { id: \"claude-sonnet-4-5\", name: \"Claude Sonnet 4.5\" },\n { id: \"claude-sonnet-4-6\", name: \"Claude Sonnet 4.6\" },\n { id: \"claude-opus-4-6\", name: \"Claude Opus 4.6\" }\n];\n\nclass AnthropicSdkFactoryImpl implements AiSdkFactoryAbstraction.Interface {\n readonly id = \"anthropic\";\n readonly name = \"Anthropic\";\n readonly models = ANTHROPIC_MODELS;\n\n async execute(apiKey?: string): Promise<IAiSdk> {\n const { createAnthropic } = await import(\"@ai-sdk/anthropic\");\n const provider = createAnthropic({\n apiKey: apiKey ?? process.env.WEBINY_API_ANTHROPIC_API_KEY\n });\n return {\n languageModel: modelId => provider.chat(modelId)\n };\n }\n}\n\nexport const AnthropicSdkFactory = createImplementation({\n abstraction: AiSdkFactoryAbstraction,\n implementation: AnthropicSdkFactoryImpl,\n dependencies: []\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,qBAAqB;AAC1D,SAASC,YAAY,IAAIC,uBAAuB;AAGhD,MAAMC,gBAA+B,GAAG,CACpC;EAAEC,EAAE,EAAE,yBAAyB;EAAEC,IAAI,EAAE;AAAiB,CAAC,EACzD;EAAED,EAAE,EAAE,2BAA2B;EAAEC,IAAI,EAAE;AAAmB,CAAC,EAC7D;EAAED,EAAE,EAAE,kBAAkB;EAAEC,IAAI,EAAE;AAAmB,CAAC,EACpD;EAAED,EAAE,EAAE,iBAAiB;EAAEC,IAAI,EAAE;AAAgB,CAAC,EAChD;EAAED,EAAE,EAAE,wBAAwB;EAAEC,IAAI,EAAE;AAAgB,CAAC,EACvD;EAAED,EAAE,EAAE,0BAA0B;EAAEC,IAAI,EAAE;AAAkB,CAAC,EAC3D;EAAED,EAAE,EAAE,iBAAiB;EAAEC,IAAI,EAAE;AAAkB,CAAC,EAClD;EAAED,EAAE,EAAE,iBAAiB;EAAEC,IAAI,EAAE;AAAkB,CAAC,EAClD;EAAED,EAAE,EAAE,0BAA0B;EAAEC,IAAI,EAAE;AAAkB,CAAC,EAC3D;EAAED,EAAE,EAAE,mBAAmB;EAAEC,IAAI,EAAE;AAAkB,CAAC,EACpD;EAAED,EAAE,EAAE,0BAA0B;EAAEC,IAAI,EAAE;AAAkB,CAAC,EAC3D;EAAED,EAAE,EAAE,4BAA4B;EAAEC,IAAI,EAAE;AAAoB,CAAC,EAC/D;EAAED,EAAE,EAAE,mBAAmB;EAAEC,IAAI,EAAE;AAAoB,CAAC,EACtD;EAAED,EAAE,EAAE,mBAAmB;EAAEC,IAAI,EAAE;AAAoB,CAAC,EACtD;EAAED,EAAE,EAAE,iBAAiB;EAAEC,IAAI,EAAE;AAAkB,CAAC,CACrD;AAED,MAAMC,uBAAuB,CAA8C;EAC9DF,EAAE,GAAG,WAAW;EAChBC,IAAI,GAAG,WAAW;EAClBE,MAAM,GAAGJ,gBAAgB;EAElC,MAAMK,OAAOA,CAACC,MAAe,EAAmB;IAC5C,MAAM;MAAEC;IAAgB,CAAC,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC;IAC7D,MAAMC,QAAQ,GAAGD,eAAe,CAAC;MAC7BD,MAAM,EAAEA,MAAM,IAAIG,OAAO,CAACC,GAAG,CAACC;IAClC,CAAC,CAAC;IACF,OAAO;MACHC,aAAa,EAAEC,OAAO,IAAIL,QAAQ,CAACM,IAAI,CAACD,OAAO;IACnD,CAAC;EACL;AACJ;AAEA,OAAO,MAAME,mBAAmB,GAAGlB,oBAAoB,CAAC;EACpDmB,WAAW,EAAEjB,uBAAuB;EACpCkB,cAAc,EAAEd,uBAAuB;EACvCe,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ import { AiSdkFactory as AiSdkFactoryAbstraction } from "./abstractions.js";
2
+ import type { IAiSdk, IAiSdkModel } from "./abstractions.js";
3
+ declare class OpenAiSdkFactoryImpl implements AiSdkFactoryAbstraction.Interface {
4
+ readonly id = "openai";
5
+ readonly name = "OpenAI";
6
+ readonly models: IAiSdkModel[];
7
+ execute(apiKey?: string): Promise<IAiSdk>;
8
+ }
9
+ export declare const OpenAiSdkFactory: import("@webiny/di").Implementation<typeof OpenAiSdkFactoryImpl>;
10
+ export {};
@@ -0,0 +1,187 @@
1
+ import { createImplementation } from "@webiny/feature/api";
2
+ import { AiSdkFactory as AiSdkFactoryAbstraction } from "./abstractions.js";
3
+ // 'gpt-5' | 'gpt-5-2025-08-07' | 'gpt-5-mini' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano' | 'gpt-5-nano-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-chat-latest' | 'gpt-5.2' | 'gpt-5.2-2025-12-11' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-pro-2025-12-11' | 'gpt-5.3-chat-latest' | 'gpt-5.4' | 'gpt-5.4-2026-03-05' | 'gpt-5.4-mini' | 'gpt-5.4-mini-2026-03-17' | 'gpt-5.4-nano' | 'gpt-5.4-nano-2026-03-17' | 'gpt-5.4-pro' | 'gpt-5.4-pro-2026-03-05'
4
+
5
+ const OPENAI_MODELS = [{
6
+ id: "gpt-5",
7
+ name: "GPT-5"
8
+ }, {
9
+ id: "gpt-5-2025-08-07",
10
+ name: "GPT-5"
11
+ }, {
12
+ id: "gpt-5-chat-latest",
13
+ name: "GPT-5"
14
+ }, {
15
+ id: "gpt-5-mini",
16
+ name: "GPT-5 Mini"
17
+ }, {
18
+ id: "gpt-5-mini-2025-08-07",
19
+ name: "GPT-5 Mini"
20
+ }, {
21
+ id: "gpt-5-nano",
22
+ name: "GPT-5 Nano"
23
+ }, {
24
+ id: "gpt-5-nano-2025-08-07",
25
+ name: "GPT-5 Nano"
26
+ }, {
27
+ id: "gpt-5.1",
28
+ name: "GPT-5.1"
29
+ }, {
30
+ id: "gpt-5.1-2025-11-13",
31
+ name: "GPT-5.1"
32
+ }, {
33
+ id: "gpt-5.1-chat-latest",
34
+ name: "GPT-5.1"
35
+ }, {
36
+ id: "gpt-5.2",
37
+ name: "GPT-5.2"
38
+ }, {
39
+ id: "gpt-5.2-2025-12-11",
40
+ name: "GPT-5.2"
41
+ }, {
42
+ id: "gpt-5.2-chat-latest",
43
+ name: "GPT-5.2"
44
+ }, {
45
+ id: "gpt-5.2-pro",
46
+ name: "GPT-5.2 Pro"
47
+ }, {
48
+ id: "gpt-5.2-pro-2025-12-11",
49
+ name: "GPT-5.2 Pro"
50
+ }, {
51
+ id: "gpt-5.3-chat-latest",
52
+ name: "GPT-5.3"
53
+ }, {
54
+ id: "gpt-5.4",
55
+ name: "GPT-5.4"
56
+ }, {
57
+ id: "gpt-5.4-2026-03-05",
58
+ name: "GPT-5.4"
59
+ }, {
60
+ id: "gpt-5.4-mini",
61
+ name: "GPT-5.4 Mini"
62
+ }, {
63
+ id: "gpt-5.4-mini-2026-03-17",
64
+ name: "GPT-5.4 Mini"
65
+ }, {
66
+ id: "gpt-5.4-nano",
67
+ name: "GPT-5.4 Nano"
68
+ }, {
69
+ id: "gpt-5.4-nano-2026-03-17",
70
+ name: "GPT-5.4 Nano"
71
+ }, {
72
+ id: "gpt-5.4-pro",
73
+ name: "GPT-5.4 Pro"
74
+ }, {
75
+ id: "gpt-5.4-pro-2026-03-05",
76
+ name: "GPT-5.4 Pro"
77
+ }, {
78
+ id: "gpt-4.1",
79
+ name: "GPT-4.1"
80
+ }, {
81
+ id: "gpt-4.1-2025-04-14",
82
+ name: "GPT-4.1"
83
+ }, {
84
+ id: "gpt-4.1-mini",
85
+ name: "GPT-4.1 Mini"
86
+ }, {
87
+ id: "gpt-4.1-mini-2025-04-14",
88
+ name: "GPT-4.1 Mini"
89
+ }, {
90
+ id: "gpt-4.1-nano",
91
+ name: "GPT-4.1 Nano"
92
+ }, {
93
+ id: "gpt-4.1-nano-2025-04-14",
94
+ name: "GPT-4.1 Nano"
95
+ }, {
96
+ id: "gpt-4o",
97
+ name: "GPT-4o"
98
+ }, {
99
+ id: "gpt-4o-2024-05-13",
100
+ name: "GPT-4o"
101
+ }, {
102
+ id: "gpt-4o-2024-08-06",
103
+ name: "GPT-4o"
104
+ }, {
105
+ id: "gpt-4o-2024-11-20",
106
+ name: "GPT-4o"
107
+ }, {
108
+ id: "gpt-4o-audio-preview",
109
+ name: "GPT-4o Audio Preview"
110
+ }, {
111
+ id: "gpt-4o-audio-preview-2024-12-17",
112
+ name: "GPT-4o Audio Preview"
113
+ }, {
114
+ id: "gpt-4o-search-preview",
115
+ name: "GPT-4o Search Preview"
116
+ }, {
117
+ id: "gpt-4o-search-preview-2025-03-11",
118
+ name: "GPT-4o Search Preview"
119
+ }, {
120
+ id: "gpt-4o-mini-search-preview",
121
+ name: "GPT-4o Mini Search Preview"
122
+ }, {
123
+ id: "gpt-4o-mini-search-preview-2025-03-11",
124
+ name: "GPT-4o Mini Search Preview"
125
+ }, {
126
+ id: "gpt-4o-mini",
127
+ name: "GPT-4o Mini"
128
+ }, {
129
+ id: "gpt-4o-mini-2024-07-18",
130
+ name: "GPT-4o Mini"
131
+ }, {
132
+ id: "gpt-3.5-turbo-0125",
133
+ name: "GPT-3.5 Turbo"
134
+ }, {
135
+ id: "gpt-3.5-turbo",
136
+ name: "GPT-3.5 Turbo"
137
+ }, {
138
+ id: "gpt-3.5-turbo-1106",
139
+ name: "GPT-3.5 Turbo"
140
+ }, {
141
+ id: "o1",
142
+ name: "o1"
143
+ }, {
144
+ id: "o1-2024-12-17",
145
+ name: "o1"
146
+ }, {
147
+ id: "o3",
148
+ name: "o3"
149
+ }, {
150
+ id: "o3-2025-04-16",
151
+ name: "o3"
152
+ }, {
153
+ id: "o3-mini",
154
+ name: "o3 Mini"
155
+ }, {
156
+ id: "o3-mini-2025-01-31",
157
+ name: "o3 Mini"
158
+ }, {
159
+ id: "o4-mini",
160
+ name: "o4 Mini"
161
+ }, {
162
+ id: "o4-mini-2025-04-16",
163
+ name: "o4 Mini"
164
+ }];
165
+ class OpenAiSdkFactoryImpl {
166
+ id = "openai";
167
+ name = "OpenAI";
168
+ models = OPENAI_MODELS;
169
+ async execute(apiKey) {
170
+ const {
171
+ createOpenAI
172
+ } = await import("@ai-sdk/openai");
173
+ const provider = createOpenAI({
174
+ apiKey: apiKey ?? process.env.WEBINY_API_OPENAI_API_KEY
175
+ });
176
+ return {
177
+ languageModel: modelId => provider.chat(modelId)
178
+ };
179
+ }
180
+ }
181
+ export const OpenAiSdkFactory = createImplementation({
182
+ abstraction: AiSdkFactoryAbstraction,
183
+ implementation: OpenAiSdkFactoryImpl,
184
+ dependencies: []
185
+ });
186
+
187
+ //# sourceMappingURL=OpenAiSdkFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createImplementation","AiSdkFactory","AiSdkFactoryAbstraction","OPENAI_MODELS","id","name","OpenAiSdkFactoryImpl","models","execute","apiKey","createOpenAI","provider","process","env","WEBINY_API_OPENAI_API_KEY","languageModel","modelId","chat","OpenAiSdkFactory","abstraction","implementation","dependencies"],"sources":["OpenAiSdkFactory.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/feature/api\";\nimport { AiSdkFactory as AiSdkFactoryAbstraction } from \"./abstractions.js\";\nimport type { IAiSdk, IAiSdkModel } from \"./abstractions.js\";\n\n// 'gpt-5' | 'gpt-5-2025-08-07' | 'gpt-5-mini' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano' | 'gpt-5-nano-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-chat-latest' | 'gpt-5.2' | 'gpt-5.2-2025-12-11' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-pro-2025-12-11' | 'gpt-5.3-chat-latest' | 'gpt-5.4' | 'gpt-5.4-2026-03-05' | 'gpt-5.4-mini' | 'gpt-5.4-mini-2026-03-17' | 'gpt-5.4-nano' | 'gpt-5.4-nano-2026-03-17' | 'gpt-5.4-pro' | 'gpt-5.4-pro-2026-03-05'\n\nconst OPENAI_MODELS: IAiSdkModel[] = [\n { id: \"gpt-5\", name: \"GPT-5\" },\n { id: \"gpt-5-2025-08-07\", name: \"GPT-5\" },\n { id: \"gpt-5-chat-latest\", name: \"GPT-5\" },\n { id: \"gpt-5-mini\", name: \"GPT-5 Mini\" },\n { id: \"gpt-5-mini-2025-08-07\", name: \"GPT-5 Mini\" },\n { id: \"gpt-5-nano\", name: \"GPT-5 Nano\" },\n { id: \"gpt-5-nano-2025-08-07\", name: \"GPT-5 Nano\" },\n { id: \"gpt-5.1\", name: \"GPT-5.1\" },\n { id: \"gpt-5.1-2025-11-13\", name: \"GPT-5.1\" },\n { id: \"gpt-5.1-chat-latest\", name: \"GPT-5.1\" },\n { id: \"gpt-5.2\", name: \"GPT-5.2\" },\n { id: \"gpt-5.2-2025-12-11\", name: \"GPT-5.2\" },\n { id: \"gpt-5.2-chat-latest\", name: \"GPT-5.2\" },\n { id: \"gpt-5.2-pro\", name: \"GPT-5.2 Pro\" },\n { id: \"gpt-5.2-pro-2025-12-11\", name: \"GPT-5.2 Pro\" },\n { id: \"gpt-5.3-chat-latest\", name: \"GPT-5.3\" },\n { id: \"gpt-5.4\", name: \"GPT-5.4\" },\n { id: \"gpt-5.4-2026-03-05\", name: \"GPT-5.4\" },\n { id: \"gpt-5.4-mini\", name: \"GPT-5.4 Mini\" },\n { id: \"gpt-5.4-mini-2026-03-17\", name: \"GPT-5.4 Mini\" },\n { id: \"gpt-5.4-nano\", name: \"GPT-5.4 Nano\" },\n { id: \"gpt-5.4-nano-2026-03-17\", name: \"GPT-5.4 Nano\" },\n { id: \"gpt-5.4-pro\", name: \"GPT-5.4 Pro\" },\n { id: \"gpt-5.4-pro-2026-03-05\", name: \"GPT-5.4 Pro\" },\n { id: \"gpt-4.1\", name: \"GPT-4.1\" },\n { id: \"gpt-4.1-2025-04-14\", name: \"GPT-4.1\" },\n { id: \"gpt-4.1-mini\", name: \"GPT-4.1 Mini\" },\n { id: \"gpt-4.1-mini-2025-04-14\", name: \"GPT-4.1 Mini\" },\n { id: \"gpt-4.1-nano\", name: \"GPT-4.1 Nano\" },\n { id: \"gpt-4.1-nano-2025-04-14\", name: \"GPT-4.1 Nano\" },\n { id: \"gpt-4o\", name: \"GPT-4o\" },\n { id: \"gpt-4o-2024-05-13\", name: \"GPT-4o\" },\n { id: \"gpt-4o-2024-08-06\", name: \"GPT-4o\" },\n { id: \"gpt-4o-2024-11-20\", name: \"GPT-4o\" },\n { id: \"gpt-4o-audio-preview\", name: \"GPT-4o Audio Preview\" },\n { id: \"gpt-4o-audio-preview-2024-12-17\", name: \"GPT-4o Audio Preview\" },\n { id: \"gpt-4o-search-preview\", name: \"GPT-4o Search Preview\" },\n { id: \"gpt-4o-search-preview-2025-03-11\", name: \"GPT-4o Search Preview\" },\n { id: \"gpt-4o-mini-search-preview\", name: \"GPT-4o Mini Search Preview\" },\n { id: \"gpt-4o-mini-search-preview-2025-03-11\", name: \"GPT-4o Mini Search Preview\" },\n { id: \"gpt-4o-mini\", name: \"GPT-4o Mini\" },\n { id: \"gpt-4o-mini-2024-07-18\", name: \"GPT-4o Mini\" },\n { id: \"gpt-3.5-turbo-0125\", name: \"GPT-3.5 Turbo\" },\n { id: \"gpt-3.5-turbo\", name: \"GPT-3.5 Turbo\" },\n { id: \"gpt-3.5-turbo-1106\", name: \"GPT-3.5 Turbo\" },\n { id: \"o1\", name: \"o1\" },\n { id: \"o1-2024-12-17\", name: \"o1\" },\n { id: \"o3\", name: \"o3\" },\n { id: \"o3-2025-04-16\", name: \"o3\" },\n { id: \"o3-mini\", name: \"o3 Mini\" },\n { id: \"o3-mini-2025-01-31\", name: \"o3 Mini\" },\n { id: \"o4-mini\", name: \"o4 Mini\" },\n { id: \"o4-mini-2025-04-16\", name: \"o4 Mini\" }\n];\n\nclass OpenAiSdkFactoryImpl implements AiSdkFactoryAbstraction.Interface {\n readonly id = \"openai\";\n readonly name = \"OpenAI\";\n readonly models = OPENAI_MODELS;\n\n async execute(apiKey?: string): Promise<IAiSdk> {\n const { createOpenAI } = await import(\"@ai-sdk/openai\");\n const provider = createOpenAI({\n apiKey: apiKey ?? process.env.WEBINY_API_OPENAI_API_KEY\n });\n return {\n languageModel: modelId => provider.chat(modelId)\n };\n }\n}\n\nexport const OpenAiSdkFactory = createImplementation({\n abstraction: AiSdkFactoryAbstraction,\n implementation: OpenAiSdkFactoryImpl,\n dependencies: []\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,qBAAqB;AAC1D,SAASC,YAAY,IAAIC,uBAAuB;AAGhD;;AAEA,MAAMC,aAA4B,GAAG,CACjC;EAAEC,EAAE,EAAE,OAAO;EAAEC,IAAI,EAAE;AAAQ,CAAC,EAC9B;EAAED,EAAE,EAAE,kBAAkB;EAAEC,IAAI,EAAE;AAAQ,CAAC,EACzC;EAAED,EAAE,EAAE,mBAAmB;EAAEC,IAAI,EAAE;AAAQ,CAAC,EAC1C;EAAED,EAAE,EAAE,YAAY;EAAEC,IAAI,EAAE;AAAa,CAAC,EACxC;EAAED,EAAE,EAAE,uBAAuB;EAAEC,IAAI,EAAE;AAAa,CAAC,EACnD;EAAED,EAAE,EAAE,YAAY;EAAEC,IAAI,EAAE;AAAa,CAAC,EACxC;EAAED,EAAE,EAAE,uBAAuB;EAAEC,IAAI,EAAE;AAAa,CAAC,EACnD;EAAED,EAAE,EAAE,SAAS;EAAEC,IAAI,EAAE;AAAU,CAAC,EAClC;EAAED,EAAE,EAAE,oBAAoB;EAAEC,IAAI,EAAE;AAAU,CAAC,EAC7C;EAAED,EAAE,EAAE,qBAAqB;EAAEC,IAAI,EAAE;AAAU,CAAC,EAC9C;EAAED,EAAE,EAAE,SAAS;EAAEC,IAAI,EAAE;AAAU,CAAC,EAClC;EAAED,EAAE,EAAE,oBAAoB;EAAEC,IAAI,EAAE;AAAU,CAAC,EAC7C;EAAED,EAAE,EAAE,qBAAqB;EAAEC,IAAI,EAAE;AAAU,CAAC,EAC9C;EAAED,EAAE,EAAE,aAAa;EAAEC,IAAI,EAAE;AAAc,CAAC,EAC1C;EAAED,EAAE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AChD;AAED,MAAMC,oBAAoB,CAA8C;EAC3DF,EAAE,GAAG,QAAQ;EACbC,IAAI,GAAG,QAAQ;EACfE,MAAM,GAAGJ,aAAa;EAE/B,MAAMK,OAAOA,CAACC,MAAe,EAAmB;IAC5C,MAAM;MAAEC;IAAa,CAAC,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAAC;IACvD,MAAMC,QAAQ,GAAGD,YAAY,CAAC;MAC1BD,MAAM,EAAEA,MAAM,IAAIG,OAAO,CAACC,GAAG,CAACC;IAClC,CAAC,CAAC;IACF,OAAO;MACHC,aAAa,EAAEC,OAAO,IAAIL,QAAQ,CAACM,IAAI,CAACD,OAAO;IACnD,CAAC;EACL;AACJ;AAEA,OAAO,MAAME,gBAAgB,GAAGlB,oBAAoB,CAAC;EACjDmB,WAAW,EAAEjB,uBAAuB;EACpCkB,cAAc,EAAEd,oBAAoB;EACpCe,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,92 @@
1
+ import type { generateText } from "ai";
2
+ import type { streamText } from "ai";
3
+ import type { LanguageModel } from "ai";
4
+ import type { FlexibleSchema, ToolSet } from "ai";
5
+ export interface IAiSdkModel {
6
+ id: string;
7
+ name: string;
8
+ }
9
+ export interface IAiSdk {
10
+ languageModel(modelId: string): LanguageModel;
11
+ }
12
+ /** A single AI SDK instance (e.g. OpenAI, Anthropic) that resolves model instances. */
13
+ export declare const AiSdk: import("@webiny/di").Abstraction<IAiSdk>;
14
+ export declare namespace AiSdk {
15
+ type Interface = IAiSdk;
16
+ }
17
+ export interface IAiSdkFactory {
18
+ readonly id: string;
19
+ readonly name: string;
20
+ readonly models: readonly IAiSdkModel[];
21
+ execute(apiKey?: string): Promise<IAiSdk>;
22
+ }
23
+ /** Factory that asynchronously initialises an AI SDK. Register one per provider namespace. */
24
+ export declare const AiSdkFactory: import("@webiny/di").Abstraction<IAiSdkFactory>;
25
+ export declare namespace AiSdkFactory {
26
+ type Interface = IAiSdkFactory;
27
+ }
28
+ export interface IAiConnectionInline {
29
+ readonly sdkName: string;
30
+ readonly apiKey?: string;
31
+ }
32
+ export interface IAiConnection extends IAiConnectionInline {
33
+ readonly id: string;
34
+ }
35
+ export interface IAiConnectionFactory {
36
+ execute(): Promise<IAiConnection>;
37
+ }
38
+ /** Factory that asynchronously produces an AiConnection. */
39
+ export declare const AiConnectionFactory: import("@webiny/di").Abstraction<IAiConnectionFactory>;
40
+ export declare namespace AiConnectionFactory {
41
+ type Interface = IAiConnectionFactory;
42
+ }
43
+ type SDKGenerateTextParams = Parameters<typeof generateText>[0];
44
+ type SDKStreamTextParams = Parameters<typeof streamText>[0];
45
+ export type AiGenerateTextParams = Omit<SDKGenerateTextParams, "model"> & {
46
+ model: string;
47
+ connection?: string | IAiConnectionInline;
48
+ };
49
+ export type AiStreamTextParams = Omit<SDKStreamTextParams, "model"> & {
50
+ model: string;
51
+ connection?: string | IAiConnectionInline;
52
+ };
53
+ export interface AiModel {
54
+ providerId: string;
55
+ providerName: string;
56
+ modelId: string;
57
+ modelName: string;
58
+ }
59
+ export interface IAi {
60
+ generateText(params: AiGenerateTextParams): ReturnType<typeof generateText>;
61
+ streamText(params: AiStreamTextParams): Promise<ReturnType<typeof streamText>>;
62
+ listModels(): Promise<AiModel[]>;
63
+ listModelsByConnections(): Promise<AiModel[]>;
64
+ listModelsByConnection(connection: string | IAiConnectionInline): Promise<AiModel[]>;
65
+ }
66
+ /** Interact with AI language models using registered providers. */
67
+ export declare const Ai: import("@webiny/di").Abstraction<IAi>;
68
+ export declare namespace Ai {
69
+ type Interface = IAi;
70
+ type GenerateTextParams = AiGenerateTextParams;
71
+ type StreamTextParams = AiStreamTextParams;
72
+ }
73
+ export interface IAiSdkTool<TInput = any> {
74
+ readonly name: string;
75
+ readonly description: string;
76
+ readonly inputSchema: FlexibleSchema<TInput>;
77
+ execute(input: TInput): Promise<unknown>;
78
+ }
79
+ /** A single tool that can be provided to AI generateText/streamText calls. */
80
+ export declare const AiSdkTool: import("@webiny/di").Abstraction<IAiSdkTool<any>>;
81
+ export declare namespace AiSdkTool {
82
+ type Interface = IAiSdkTool;
83
+ }
84
+ export interface IAiSdkTools {
85
+ getToolSet(): ToolSet;
86
+ }
87
+ /** Collection of AI SDK tools. Returns a ready-to-use ToolSet for generateText/streamText. */
88
+ export declare const AiSdkTools: import("@webiny/di").Abstraction<IAiSdkTools>;
89
+ export declare namespace AiSdkTools {
90
+ type Interface = IAiSdkTools;
91
+ }
92
+ export {};
@@ -0,0 +1,35 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+
3
+ // AiSdk
4
+
5
+ /** A single AI SDK instance (e.g. OpenAI, Anthropic) that resolves model instances. */
6
+ export const AiSdk = createAbstraction("AiSdk");
7
+
8
+ // AiSdkFactory
9
+
10
+ /** Factory that asynchronously initialises an AI SDK. Register one per provider namespace. */
11
+ export const AiSdkFactory = createAbstraction("AiSdkFactory");
12
+
13
+ // AiConnection
14
+
15
+ // AiConnectionFactory
16
+
17
+ /** Factory that asynchronously produces an AiConnection. */
18
+ export const AiConnectionFactory = createAbstraction("AiConnectionFactory");
19
+
20
+ // Ai
21
+
22
+ /** Interact with AI language models using registered providers. */
23
+ export const Ai = createAbstraction("Ai");
24
+
25
+ // AiSdkTool
26
+
27
+ /** A single tool that can be provided to AI generateText/streamText calls. */
28
+ export const AiSdkTool = createAbstraction("AiSdkTool");
29
+
30
+ // AiSdkTools
31
+
32
+ /** Collection of AI SDK tools. Returns a ready-to-use ToolSet for generateText/streamText. */
33
+ export const AiSdkTools = createAbstraction("AiSdkTools");
34
+
35
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createAbstraction","AiSdk","AiSdkFactory","AiConnectionFactory","Ai","AiSdkTool","AiSdkTools"],"sources":["abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { generateText } from \"ai\";\nimport type { streamText } from \"ai\";\nimport type { LanguageModel } from \"ai\";\nimport type { FlexibleSchema, ToolSet } from \"ai\";\n\n// AiSdk\n\nexport interface IAiSdkModel {\n id: string; // raw model id, e.g. \"claude-sonnet-4-5\"\n name: string; // human-friendly name, e.g. \"Claude Sonnet 4.5\"\n}\n\nexport interface IAiSdk {\n languageModel(modelId: string): LanguageModel;\n}\n\n/** A single AI SDK instance (e.g. OpenAI, Anthropic) that resolves model instances. */\nexport const AiSdk = createAbstraction<IAiSdk>(\"AiSdk\");\n\nexport namespace AiSdk {\n export type Interface = IAiSdk;\n}\n\n// AiSdkFactory\n\nexport interface IAiSdkFactory {\n readonly id: string; // machine id, e.g. \"anthropic\"\n readonly name: string; // human-friendly name, e.g. \"Anthropic\"\n readonly models: readonly IAiSdkModel[]; // static model list, no API call needed\n execute(apiKey?: string): Promise<IAiSdk>;\n}\n\n/** Factory that asynchronously initialises an AI SDK. Register one per provider namespace. */\nexport const AiSdkFactory = createAbstraction<IAiSdkFactory>(\"AiSdkFactory\");\n\nexport namespace AiSdkFactory {\n export type Interface = IAiSdkFactory;\n}\n\n// AiConnection\n\nexport interface IAiConnectionInline {\n readonly sdkName: string;\n readonly apiKey?: string;\n}\n\nexport interface IAiConnection extends IAiConnectionInline {\n readonly id: string;\n}\n\n// AiConnectionFactory\n\nexport interface IAiConnectionFactory {\n execute(): Promise<IAiConnection>;\n}\n\n/** Factory that asynchronously produces an AiConnection. */\nexport const AiConnectionFactory = createAbstraction<IAiConnectionFactory>(\"AiConnectionFactory\");\n\nexport namespace AiConnectionFactory {\n export type Interface = IAiConnectionFactory;\n}\n\n// Ai\n\ntype SDKGenerateTextParams = Parameters<typeof generateText>[0];\ntype SDKStreamTextParams = Parameters<typeof streamText>[0];\n\nexport type AiGenerateTextParams = Omit<SDKGenerateTextParams, \"model\"> & {\n model: string;\n connection?: string | IAiConnectionInline;\n};\nexport type AiStreamTextParams = Omit<SDKStreamTextParams, \"model\"> & {\n model: string;\n connection?: string | IAiConnectionInline;\n};\n\nexport interface AiModel {\n providerId: string; // e.g. \"anthropic\"\n providerName: string; // e.g. \"Anthropic\"\n modelId: string; // e.g. \"claude-sonnet-4-5\"\n modelName: string; // e.g. \"Claude Sonnet 4.5\"\n}\n\nexport interface IAi {\n generateText(params: AiGenerateTextParams): ReturnType<typeof generateText>;\n streamText(params: AiStreamTextParams): Promise<ReturnType<typeof streamText>>;\n listModels(): Promise<AiModel[]>;\n listModelsByConnections(): Promise<AiModel[]>;\n listModelsByConnection(connection: string | IAiConnectionInline): Promise<AiModel[]>;\n}\n\n/** Interact with AI language models using registered providers. */\nexport const Ai = createAbstraction<IAi>(\"Ai\");\n\nexport namespace Ai {\n export type Interface = IAi;\n export type GenerateTextParams = AiGenerateTextParams;\n export type StreamTextParams = AiStreamTextParams;\n}\n\n// AiSdkTool\n\nexport interface IAiSdkTool<TInput = any> {\n readonly name: string;\n readonly description: string;\n readonly inputSchema: FlexibleSchema<TInput>;\n execute(input: TInput): Promise<unknown>;\n}\n\n/** A single tool that can be provided to AI generateText/streamText calls. */\nexport const AiSdkTool = createAbstraction<IAiSdkTool>(\"AiSdkTool\");\n\nexport namespace AiSdkTool {\n export type Interface = IAiSdkTool;\n}\n\n// AiSdkTools\n\nexport interface IAiSdkTools {\n getToolSet(): ToolSet;\n}\n\n/** Collection of AI SDK tools. Returns a ready-to-use ToolSet for generateText/streamText. */\nexport const AiSdkTools = createAbstraction<IAiSdkTools>(\"AiSdkTools\");\n\nexport namespace AiSdkTools {\n export type Interface = IAiSdkTools;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,qBAAqB;;AAMvD;;AAWA;AACA,OAAO,MAAMC,KAAK,GAAGD,iBAAiB,CAAS,OAAO,CAAC;;AAMvD;;AASA;AACA,OAAO,MAAME,YAAY,GAAGF,iBAAiB,CAAgB,cAAc,CAAC;;AAM5E;;AAWA;;AAMA;AACA,OAAO,MAAMG,mBAAmB,GAAGH,iBAAiB,CAAuB,qBAAqB,CAAC;;AAMjG;;AA6BA;AACA,OAAO,MAAMI,EAAE,GAAGJ,iBAAiB,CAAM,IAAI,CAAC;;AAQ9C;;AASA;AACA,OAAO,MAAMK,SAAS,GAAGL,iBAAiB,CAAa,WAAW,CAAC;;AAMnE;;AAMA;AACA,OAAO,MAAMM,UAAU,GAAGN,iBAAiB,CAAc,YAAY,CAAC","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ export declare const AiFeature: {
2
+ name: string;
3
+ register(container: import("@webiny/di").Container): void;
4
+ };
@@ -0,0 +1,16 @@
1
+ import { createFeature } from "@webiny/feature/api";
2
+ import { OpenAiSdkFactory } from "./OpenAiSdkFactory.js";
3
+ import { AnthropicSdkFactory } from "./AnthropicSdkFactory.js";
4
+ import { Ai } from "./Ai.js";
5
+ import { AiSdkTools } from "./AiSdkTools.js";
6
+ export const AiFeature = createFeature({
7
+ name: "AiFeature",
8
+ register(container) {
9
+ container.register(OpenAiSdkFactory);
10
+ container.register(AnthropicSdkFactory);
11
+ container.register(Ai);
12
+ container.register(AiSdkTools);
13
+ }
14
+ });
15
+
16
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createFeature","OpenAiSdkFactory","AnthropicSdkFactory","Ai","AiSdkTools","AiFeature","name","register","container"],"sources":["feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { OpenAiSdkFactory } from \"./OpenAiSdkFactory.js\";\nimport { AnthropicSdkFactory } from \"./AnthropicSdkFactory.js\";\nimport { Ai } from \"./Ai.js\";\nimport { AiSdkTools } from \"./AiSdkTools.js\";\n\nexport const AiFeature = createFeature({\n name: \"AiFeature\",\n register(container) {\n container.register(OpenAiSdkFactory);\n container.register(AnthropicSdkFactory);\n container.register(Ai);\n container.register(AiSdkTools);\n }\n});\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,qBAAqB;AACnD,SAASC,gBAAgB;AACzB,SAASC,mBAAmB;AAC5B,SAASC,EAAE;AACX,SAASC,UAAU;AAEnB,OAAO,MAAMC,SAAS,GAAGL,aAAa,CAAC;EACnCM,IAAI,EAAE,WAAW;EACjBC,QAAQA,CAACC,SAAS,EAAE;IAChBA,SAAS,CAACD,QAAQ,CAACN,gBAAgB,CAAC;IACpCO,SAAS,CAACD,QAAQ,CAACL,mBAAmB,CAAC;IACvCM,SAAS,CAACD,QAAQ,CAACJ,EAAE,CAAC;IACtBK,SAAS,CAACD,QAAQ,CAACH,UAAU,CAAC;EAClC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ export { AiSdk, AiSdkFactory, AiConnectionFactory, Ai, AiSdkTool, AiSdkTools } from "./abstractions.js";
2
+ export type { IAiConnection, IAiConnectionInline, AiModel, IAiSdkModel, IAiSdkTool, IAiSdkTools } from "./abstractions.js";
3
+ export { AiFeature } from "./feature.js";
@@ -0,0 +1,4 @@
1
+ export { AiSdk, AiSdkFactory, AiConnectionFactory, Ai, AiSdkTool, AiSdkTools } from "./abstractions.js";
2
+ export { AiFeature } from "./feature.js";
3
+
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["AiSdk","AiSdkFactory","AiConnectionFactory","Ai","AiSdkTool","AiSdkTools","AiFeature"],"sources":["index.ts"],"sourcesContent":["export {\n AiSdk,\n AiSdkFactory,\n AiConnectionFactory,\n Ai,\n AiSdkTool,\n AiSdkTools\n} from \"./abstractions.js\";\nexport type {\n IAiConnection,\n IAiConnectionInline,\n AiModel,\n IAiSdkModel,\n IAiSdkTool,\n IAiSdkTools\n} from \"./abstractions.js\";\nexport { AiFeature } from \"./feature.js\";\n"],"mappings":"AAAA,SACIA,KAAK,EACLC,YAAY,EACZC,mBAAmB,EACnBC,EAAE,EACFC,SAAS,EACTC,UAAU;AAUd,SAASC,SAAS","ignoreList":[]}
@@ -2,6 +2,7 @@ export interface IBuildParam {
2
2
  key: string;
3
3
  value: any;
4
4
  }
5
+ /** A single build-time configuration parameter. */
5
6
  export declare const BuildParam: import("@webiny/di").Abstraction<IBuildParam>;
6
7
  export declare namespace BuildParam {
7
8
  type Interface = IBuildParam;
@@ -9,6 +10,7 @@ export declare namespace BuildParam {
9
10
  export interface IBuildParams {
10
11
  get<T = any>(key: string): T | null;
11
12
  }
13
+ /** Access build-time configuration parameters. */
12
14
  export declare const BuildParams: import("@webiny/di").Abstraction<IBuildParams>;
13
15
  export declare namespace BuildParams {
14
16
  type Interface = IBuildParams;
@@ -1,5 +1,7 @@
1
1
  import { createAbstraction } from "@webiny/feature/api";
2
+ /** A single build-time configuration parameter. */
2
3
  export const BuildParam = createAbstraction("BuildParam");
4
+ /** Access build-time configuration parameters. */
3
5
  export const BuildParams = createAbstraction("BuildParams");
4
6
 
5
7
  //# sourceMappingURL=abstractions.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createAbstraction","BuildParam","BuildParams"],"sources":["abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\n\nexport interface IBuildParam {\n key: string;\n value: any;\n}\n\nexport const BuildParam = createAbstraction<IBuildParam>(\"BuildParam\");\n\nexport namespace BuildParam {\n export type Interface = IBuildParam;\n}\n\nexport interface IBuildParams {\n get<T = any>(key: string): T | null;\n}\n\nexport const BuildParams = createAbstraction<IBuildParams>(\"BuildParams\");\n\nexport namespace BuildParams {\n export type Interface = IBuildParams;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,qBAAqB;AAOvD,OAAO,MAAMC,UAAU,GAAGD,iBAAiB,CAAc,YAAY,CAAC;AAUtE,OAAO,MAAME,WAAW,GAAGF,iBAAiB,CAAe,aAAa,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["createAbstraction","BuildParam","BuildParams"],"sources":["abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\n\nexport interface IBuildParam {\n key: string;\n value: any;\n}\n\n/** A single build-time configuration parameter. */\nexport const BuildParam = createAbstraction<IBuildParam>(\"BuildParam\");\n\nexport namespace BuildParam {\n export type Interface = IBuildParam;\n}\n\nexport interface IBuildParams {\n get<T = any>(key: string): T | null;\n}\n\n/** Access build-time configuration parameters. */\nexport const BuildParams = createAbstraction<IBuildParams>(\"BuildParams\");\n\nexport namespace BuildParams {\n export type Interface = IBuildParams;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,qBAAqB;AAOvD;AACA,OAAO,MAAMC,UAAU,GAAGD,iBAAiB,CAAc,YAAY,CAAC;AAUtE;AACA,OAAO,MAAME,WAAW,GAAGF,iBAAiB,CAAe,aAAa,CAAC","ignoreList":[]}
@@ -1 +1,5 @@
1
- export declare const BuildParamsFeature: import("@webiny/feature/api/createFeature.js").FeatureDefinition<unknown>;
1
+ import { Container } from "@webiny/di";
2
+ export declare const BuildParamsFeature: {
3
+ name: string;
4
+ register(container: Container): void;
5
+ };
@@ -0,0 +1,10 @@
1
+ import { Encryption as EncryptionAbstraction } from "./abstractions.js";
2
+ import { BuildParams } from "../buildParams/abstractions.js";
3
+ export declare class EncryptionImpl implements EncryptionAbstraction.Interface {
4
+ private key;
5
+ private algorithm;
6
+ constructor(buildParams: BuildParams.Interface);
7
+ encrypt(value: string): string;
8
+ decrypt(value: string): string;
9
+ }
10
+ export declare const Encryption: import("@webiny/di").Implementation<typeof EncryptionImpl>;