@webiny/api-core 0.0.0-unstable.a4f3e4ea8b → 0.0.0-unstable.a85ef555b2

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 (442) hide show
  1. package/ApiCoreFeature.d.ts +2 -2
  2. package/ApiCoreFeature.js +35 -5
  3. package/ApiCoreFeature.js.map +1 -1
  4. package/exports/api/tasks.d.ts +1 -0
  5. package/exports/api/tasks.js +1 -1
  6. package/exports/api.d.ts +2 -1
  7. package/exports/api.js +2 -1
  8. package/features/ai/Ai.js +16 -6
  9. package/features/ai/Ai.js.map +1 -1
  10. package/features/ai/AiModelRegistry.d.ts +3 -1
  11. package/features/ai/AiModelRegistry.js +16 -7
  12. package/features/ai/AiModelRegistry.js.map +1 -1
  13. package/features/ai/AiSdkToolHandlerResolver.d.ts +11 -0
  14. package/features/ai/AiSdkToolHandlerResolver.js +19 -0
  15. package/features/ai/AiSdkToolHandlerResolver.js.map +1 -0
  16. package/features/ai/AiSdkTools.d.ts +4 -3
  17. package/features/ai/AiSdkTools.js +11 -9
  18. package/features/ai/AiSdkTools.js.map +1 -1
  19. package/features/ai/DEVELOPERS.md +69 -12
  20. package/features/ai/OpenRouterSdkFactory.d.ts +10 -0
  21. package/features/ai/OpenRouterSdkFactory.js +112 -0
  22. package/features/ai/OpenRouterSdkFactory.js.map +1 -0
  23. package/features/ai/RemoteAiModelCatalog.d.ts +13 -0
  24. package/features/ai/RemoteAiModelCatalog.js +74 -0
  25. package/features/ai/RemoteAiModelCatalog.js.map +1 -0
  26. package/features/ai/abstractions.d.ts +90 -7
  27. package/features/ai/abstractions.js +5 -2
  28. package/features/ai/abstractions.js.map +1 -1
  29. package/features/ai/feature.js +6 -0
  30. package/features/ai/feature.js.map +1 -1
  31. package/features/ai/index.d.ts +2 -4
  32. package/features/ai/index.js +1 -1
  33. package/features/dateFormatter/DefaultDateFormatter.d.ts +15 -0
  34. package/features/dateFormatter/DefaultDateFormatter.js +20 -0
  35. package/features/dateFormatter/DefaultDateFormatter.js.map +1 -0
  36. package/features/dateFormatter/abstractions.d.ts +13 -0
  37. package/features/dateFormatter/abstractions.js +5 -0
  38. package/features/dateFormatter/abstractions.js.map +1 -0
  39. package/features/dateFormatter/feature.d.ts +4 -0
  40. package/features/dateFormatter/feature.js +11 -0
  41. package/features/dateFormatter/feature.js.map +1 -0
  42. package/features/dateFormatter/index.d.ts +3 -0
  43. package/features/dateFormatter/index.js +2 -0
  44. package/features/debugger/Debugger.d.ts +30 -0
  45. package/features/debugger/Debugger.js +142 -0
  46. package/features/debugger/Debugger.js.map +1 -0
  47. package/features/debugger/DebuggerRouteDecorator.d.ts +45 -0
  48. package/features/debugger/DebuggerRouteDecorator.js +107 -0
  49. package/features/debugger/DebuggerRouteDecorator.js.map +1 -0
  50. package/features/debugger/GraphQLDebuggerTransport.d.ts +28 -0
  51. package/features/debugger/GraphQLDebuggerTransport.js +45 -0
  52. package/features/debugger/GraphQLDebuggerTransport.js.map +1 -0
  53. package/features/debugger/__tests__/matchNamespace.test.d.ts +1 -0
  54. package/features/debugger/__tests__/matchNamespace.test.js +68 -0
  55. package/features/debugger/__tests__/matchNamespace.test.js.map +1 -0
  56. package/features/debugger/__tests__/serialize.test.d.ts +1 -0
  57. package/features/debugger/__tests__/serialize.test.js +220 -0
  58. package/features/debugger/__tests__/serialize.test.js.map +1 -0
  59. package/features/debugger/abstractions.d.ts +100 -0
  60. package/features/debugger/abstractions.js +6 -0
  61. package/features/debugger/abstractions.js.map +1 -0
  62. package/features/debugger/feature.d.ts +5 -0
  63. package/features/debugger/feature.js +15 -0
  64. package/features/debugger/feature.js.map +1 -0
  65. package/features/debugger/index.d.ts +12 -0
  66. package/features/debugger/index.js +7 -0
  67. package/features/debugger/limits.d.ts +18 -0
  68. package/features/debugger/limits.js +11 -0
  69. package/features/debugger/limits.js.map +1 -0
  70. package/features/debugger/matchNamespace.d.ts +14 -0
  71. package/features/debugger/matchNamespace.js +35 -0
  72. package/features/debugger/matchNamespace.js.map +1 -0
  73. package/features/debugger/parseNamespaceHeader.d.ts +7 -0
  74. package/features/debugger/parseNamespaceHeader.js +16 -0
  75. package/features/debugger/parseNamespaceHeader.js.map +1 -0
  76. package/features/debugger/permissions.d.ts +14 -0
  77. package/features/debugger/permissions.js +8 -0
  78. package/features/debugger/permissions.js.map +1 -0
  79. package/features/debugger/permissionsSchema.d.ts +17 -0
  80. package/features/debugger/permissionsSchema.js +18 -0
  81. package/features/debugger/permissionsSchema.js.map +1 -0
  82. package/features/debugger/serialize.d.ts +11 -0
  83. package/features/debugger/serialize.js +121 -0
  84. package/features/debugger/serialize.js.map +1 -0
  85. package/features/encryption/EncryptionKeyCacheFeature.d.ts +8 -0
  86. package/features/encryption/EncryptionKeyCacheFeature.js +11 -0
  87. package/features/encryption/EncryptionKeyCacheFeature.js.map +1 -0
  88. package/features/encryption/EncryptionService.d.ts +2 -1
  89. package/features/encryption/EncryptionService.js +11 -4
  90. package/features/encryption/EncryptionService.js.map +1 -1
  91. package/features/encryption/MemoryEncryptionKeyCache.d.ts +13 -0
  92. package/features/encryption/MemoryEncryptionKeyCache.js +26 -0
  93. package/features/encryption/MemoryEncryptionKeyCache.js.map +1 -0
  94. package/features/encryption/abstractions.d.ts +11 -0
  95. package/features/encryption/abstractions.js +2 -1
  96. package/features/encryption/abstractions.js.map +1 -1
  97. package/features/encryption/index.d.ts +1 -0
  98. package/features/encryption/index.js +1 -0
  99. package/features/featureFlags/decorators/FeatureFlagsWithLicenseDecorator.d.ts +13 -0
  100. package/features/featureFlags/decorators/FeatureFlagsWithLicenseDecorator.js +62 -0
  101. package/features/featureFlags/decorators/FeatureFlagsWithLicenseDecorator.js.map +1 -0
  102. package/features/hashing/ScryptHasher.d.ts +11 -0
  103. package/features/hashing/ScryptHasher.js +74 -0
  104. package/features/hashing/ScryptHasher.js.map +1 -0
  105. package/features/hashing/abstractions.d.ts +18 -0
  106. package/features/hashing/abstractions.js +5 -0
  107. package/features/hashing/abstractions.js.map +1 -0
  108. package/features/hashing/feature.d.ts +4 -0
  109. package/features/hashing/feature.js +11 -0
  110. package/features/hashing/feature.js.map +1 -0
  111. package/features/hashing/index.d.ts +2 -0
  112. package/features/hashing/index.js +1 -0
  113. package/features/httpClient/HttpClient.d.ts +7 -0
  114. package/features/httpClient/HttpClient.js +72 -0
  115. package/features/httpClient/HttpClient.js.map +1 -0
  116. package/features/httpClient/HttpRequestError.d.ts +10 -0
  117. package/features/httpClient/HttpRequestError.js +13 -0
  118. package/features/httpClient/HttpRequestError.js.map +1 -0
  119. package/features/httpClient/HttpStatusError.d.ts +12 -0
  120. package/features/httpClient/HttpStatusError.js +12 -0
  121. package/features/httpClient/HttpStatusError.js.map +1 -0
  122. package/features/httpClient/abstractions.d.ts +32 -0
  123. package/features/httpClient/abstractions.js +5 -0
  124. package/features/httpClient/abstractions.js.map +1 -0
  125. package/features/httpClient/feature.d.ts +4 -0
  126. package/features/httpClient/feature.js +11 -0
  127. package/features/httpClient/feature.js.map +1 -0
  128. package/features/httpClient/index.d.ts +3 -0
  129. package/features/httpClient/index.js +3 -0
  130. package/features/keyValueStore/GlobalKeyValueStore.d.ts +9 -3
  131. package/features/keyValueStore/GlobalKeyValueStore.js +12 -2
  132. package/features/keyValueStore/GlobalKeyValueStore.js.map +1 -1
  133. package/features/keyValueStore/KeyValueStore.d.ts +6 -2
  134. package/features/keyValueStore/KeyValueStore.js +13 -3
  135. package/features/keyValueStore/KeyValueStore.js.map +1 -1
  136. package/features/keyValueStore/KeyValueStoreRepository.d.ts +8 -2
  137. package/features/keyValueStore/KeyValueStoreRepository.js +82 -4
  138. package/features/keyValueStore/KeyValueStoreRepository.js.map +1 -1
  139. package/features/keyValueStore/abstractions.d.ts +132 -14
  140. package/features/keyValueStore/abstractions.js.map +1 -1
  141. package/features/keyValueStore/errors.d.ts +29 -0
  142. package/features/keyValueStore/errors.js +49 -1
  143. package/features/keyValueStore/errors.js.map +1 -1
  144. package/features/keyValueStore/index.d.ts +4 -1
  145. package/features/keyValueStore/index.js +1 -1
  146. package/features/publicUrls/NullPublicUrls.d.ts +11 -0
  147. package/features/publicUrls/NullPublicUrls.js +17 -0
  148. package/features/publicUrls/NullPublicUrls.js.map +1 -0
  149. package/features/publicUrls/PublicUrl.d.ts +24 -0
  150. package/features/publicUrls/PublicUrl.js +43 -0
  151. package/features/publicUrls/PublicUrl.js.map +1 -0
  152. package/features/publicUrls/__tests__/PublicUrl.test.d.ts +1 -0
  153. package/features/publicUrls/__tests__/PublicUrl.test.js +38 -0
  154. package/features/publicUrls/__tests__/PublicUrl.test.js.map +1 -0
  155. package/features/publicUrls/__tests__/PublicUrls.test.d.ts +1 -0
  156. package/features/publicUrls/__tests__/PublicUrls.test.js +14 -0
  157. package/features/publicUrls/__tests__/PublicUrls.test.js.map +1 -0
  158. package/features/publicUrls/abstractions.d.ts +27 -0
  159. package/features/publicUrls/abstractions.js +5 -0
  160. package/features/publicUrls/abstractions.js.map +1 -0
  161. package/features/publicUrls/feature.d.ts +8 -0
  162. package/features/publicUrls/feature.js +11 -0
  163. package/features/publicUrls/feature.js.map +1 -0
  164. package/features/publicUrls/index.d.ts +3 -0
  165. package/features/publicUrls/index.js +3 -0
  166. package/features/requestContext/RawAssumePermissions.d.ts +14 -0
  167. package/features/requestContext/RawAssumePermissions.js +19 -0
  168. package/features/requestContext/RawAssumePermissions.js.map +1 -0
  169. package/features/requestContext/RawAuthToken.d.ts +14 -0
  170. package/features/requestContext/RawAuthToken.js +19 -0
  171. package/features/requestContext/RawAuthToken.js.map +1 -0
  172. package/features/requestContext/RawTenantId.d.ts +14 -0
  173. package/features/requestContext/RawTenantId.js +19 -0
  174. package/features/requestContext/RawTenantId.js.map +1 -0
  175. package/features/requestContext/RequestIdentityLoader.d.ts +19 -0
  176. package/features/requestContext/RequestIdentityLoader.js +26 -0
  177. package/features/requestContext/RequestIdentityLoader.js.map +1 -0
  178. package/features/requestContext/RequestTenantLoader.d.ts +18 -0
  179. package/features/requestContext/RequestTenantLoader.js +52 -0
  180. package/features/requestContext/RequestTenantLoader.js.map +1 -0
  181. package/features/requestContext/abstractions.d.ts +75 -0
  182. package/features/requestContext/abstractions.js +9 -0
  183. package/features/requestContext/abstractions.js.map +1 -0
  184. package/features/requestContext/extractAssumePermissions.d.ts +14 -0
  185. package/features/requestContext/extractAssumePermissions.js +32 -0
  186. package/features/requestContext/extractAssumePermissions.js.map +1 -0
  187. package/features/requestContext/feature.d.ts +12 -0
  188. package/features/requestContext/feature.js +19 -0
  189. package/features/requestContext/feature.js.map +1 -0
  190. package/features/requestContext/index.d.ts +4 -0
  191. package/features/requestContext/index.js +3 -0
  192. package/features/security/IdentityContext/IdentityContext.d.ts +4 -3
  193. package/features/security/IdentityContext/IdentityContext.js +9 -6
  194. package/features/security/IdentityContext/IdentityContext.js.map +1 -1
  195. package/features/security/IdentityContext/abstractions.d.ts +5 -0
  196. package/features/security/IdentityContext/abstractions.js.map +1 -1
  197. package/features/security/apiKeys/ApiKeyAuthenticator.d.ts +14 -0
  198. package/features/security/apiKeys/ApiKeyAuthenticator.js +36 -0
  199. package/features/security/apiKeys/ApiKeyAuthenticator.js.map +1 -0
  200. package/features/security/apiKeys/ApiKeyAuthorizer.d.ts +10 -0
  201. package/features/security/apiKeys/ApiKeyAuthorizer.js +15 -0
  202. package/features/security/apiKeys/ApiKeyAuthorizer.js.map +1 -0
  203. package/features/security/apiKeys/CreateApiKey/CreateApiKeyUseCase.js +11 -6
  204. package/features/security/apiKeys/CreateApiKey/CreateApiKeyUseCase.js.map +1 -1
  205. package/features/security/apiKeys/GetApiKeyBySlug/GetApiKeyBySlugUseCase.d.ts +1 -1
  206. package/features/security/apiKeys/GetApiKeyByToken/GetApiKeyByTokenUseCase.d.ts +1 -1
  207. package/features/security/apiKeys/UpdateApiKey/UpdateApiKeyUseCase.js +9 -3
  208. package/features/security/apiKeys/UpdateApiKey/UpdateApiKeyUseCase.js.map +1 -1
  209. package/features/security/apiKeys/feature.js +4 -0
  210. package/features/security/apiKeys/feature.js.map +1 -1
  211. package/features/security/apiKeys/shared/schemas.d.ts +2 -2
  212. package/features/security/apiKeys/shared/schemas.js +2 -2
  213. package/features/security/apiKeys/shared/schemas.js.map +1 -1
  214. package/features/security/authorization/AuthorizationContext/AuthorizationContext.d.ts +12 -3
  215. package/features/security/authorization/AuthorizationContext/AuthorizationContext.js +31 -18
  216. package/features/security/authorization/AuthorizationContext/AuthorizationContext.js.map +1 -1
  217. package/features/security/authorization/AuthorizationContext/abstractions.d.ts +2 -0
  218. package/features/security/authorization/AuthorizationContext/abstractions.js.map +1 -1
  219. package/features/security/authorization/AuthorizationContext/feature.js +6 -1
  220. package/features/security/authorization/AuthorizationContext/feature.js.map +1 -1
  221. package/features/security/authorization/GroupsTeamsAuthorizer/AssumedPermissions.d.ts +30 -0
  222. package/features/security/authorization/GroupsTeamsAuthorizer/AssumedPermissions.js +60 -0
  223. package/features/security/authorization/GroupsTeamsAuthorizer/AssumedPermissions.js.map +1 -0
  224. package/features/security/authorization/GroupsTeamsAuthorizer/GetPermissionsFromIdentity.d.ts +3 -3
  225. package/features/security/authorization/GroupsTeamsAuthorizer/GetPermissionsFromIdentity.js +5 -5
  226. package/features/security/authorization/GroupsTeamsAuthorizer/GetPermissionsFromIdentity.js.map +1 -1
  227. package/features/security/authorization/GroupsTeamsAuthorizer/feature.js +2 -0
  228. package/features/security/authorization/GroupsTeamsAuthorizer/feature.js.map +1 -1
  229. package/features/security/roles/CreateRole/CreateRoleUseCase.js +11 -6
  230. package/features/security/roles/CreateRole/CreateRoleUseCase.js.map +1 -1
  231. package/features/security/roles/CreateRole/schema.d.ts +1 -1
  232. package/features/security/roles/CreateRole/schema.js +1 -1
  233. package/features/security/roles/CreateRole/schema.js.map +1 -1
  234. package/features/security/roles/UpdateRole/UpdateRoleUseCase.js +9 -3
  235. package/features/security/roles/UpdateRole/UpdateRoleUseCase.js.map +1 -1
  236. package/features/security/roles/UpdateRole/schema.d.ts +1 -1
  237. package/features/security/roles/UpdateRole/schema.js +1 -1
  238. package/features/security/roles/UpdateRole/schema.js.map +1 -1
  239. package/features/security/shared/description.d.ts +4 -0
  240. package/features/security/shared/description.js +7 -0
  241. package/features/security/shared/description.js.map +1 -0
  242. package/features/security/shared/index.d.ts +1 -0
  243. package/features/security/shared/index.js +1 -0
  244. package/features/security/teams/CreateTeam/CreateTeamUseCase.d.ts +3 -1
  245. package/features/security/teams/CreateTeam/CreateTeamUseCase.js +20 -8
  246. package/features/security/teams/CreateTeam/CreateTeamUseCase.js.map +1 -1
  247. package/features/security/teams/CreateTeam/schema.d.ts +1 -1
  248. package/features/security/teams/CreateTeam/schema.js +1 -1
  249. package/features/security/teams/CreateTeam/schema.js.map +1 -1
  250. package/features/security/teams/UpdateTeam/UpdateTeamUseCase.d.ts +3 -1
  251. package/features/security/teams/UpdateTeam/UpdateTeamUseCase.js +20 -5
  252. package/features/security/teams/UpdateTeam/UpdateTeamUseCase.js.map +1 -1
  253. package/features/security/teams/UpdateTeam/schema.d.ts +1 -1
  254. package/features/security/teams/UpdateTeam/schema.js +1 -1
  255. package/features/security/teams/UpdateTeam/schema.js.map +1 -1
  256. package/features/security/teams/shared/resolveRoleIdentifiers.d.ts +17 -0
  257. package/features/security/teams/shared/resolveRoleIdentifiers.js +32 -0
  258. package/features/security/teams/shared/resolveRoleIdentifiers.js.map +1 -0
  259. package/features/slugify/DefaultSlugify.d.ts +8 -0
  260. package/features/slugify/DefaultSlugify.js +20 -0
  261. package/features/slugify/DefaultSlugify.js.map +1 -0
  262. package/features/slugify/abstractions.d.ts +12 -0
  263. package/features/slugify/abstractions.js +5 -0
  264. package/features/slugify/abstractions.js.map +1 -0
  265. package/features/slugify/feature.d.ts +4 -0
  266. package/features/slugify/feature.js +11 -0
  267. package/features/slugify/feature.js.map +1 -0
  268. package/features/slugify/index.d.ts +3 -0
  269. package/features/slugify/index.js +2 -0
  270. package/features/storageOperations/abstractions.d.ts +21 -0
  271. package/features/storageOperations/abstractions.js +10 -0
  272. package/features/storageOperations/abstractions.js.map +1 -0
  273. package/features/stringFormatter/DefaultStringFormatter.d.ts +17 -0
  274. package/features/stringFormatter/DefaultStringFormatter.js +19 -0
  275. package/features/stringFormatter/DefaultStringFormatter.js.map +1 -0
  276. package/features/stringFormatter/abstractions.d.ts +11 -0
  277. package/features/stringFormatter/abstractions.js +5 -0
  278. package/features/stringFormatter/abstractions.js.map +1 -0
  279. package/features/stringFormatter/feature.d.ts +4 -0
  280. package/features/stringFormatter/feature.js +13 -0
  281. package/features/stringFormatter/feature.js.map +1 -0
  282. package/features/stringFormatter/index.d.ts +3 -0
  283. package/features/stringFormatter/index.js +2 -0
  284. package/features/task/TaskDefinition/abstractions.d.ts +69 -4
  285. package/features/task/TaskDefinition/abstractions.js +2 -1
  286. package/features/task/TaskDefinition/abstractions.js.map +1 -1
  287. package/features/tenancy/TenantContext/TenantContext.d.ts +1 -0
  288. package/features/tenancy/TenantContext/TenantContext.js +13 -8
  289. package/features/tenancy/TenantContext/TenantContext.js.map +1 -1
  290. package/features/users/shared/types.d.ts +9 -7
  291. package/features/wcp/WcpContext/WcpContext.d.ts +12 -5
  292. package/features/wcp/WcpContext/WcpContext.js +29 -2
  293. package/features/wcp/WcpContext/WcpContext.js.map +1 -1
  294. package/features/wcp/WcpContext/decorators/WcpContextWithFeatureFlagsDecorator.d.ts +11 -66
  295. package/features/wcp/WcpContext/decorators/WcpContextWithFeatureFlagsDecorator.js +71 -33
  296. package/features/wcp/WcpContext/decorators/WcpContextWithFeatureFlagsDecorator.js.map +1 -1
  297. package/features/wcp/WcpContext/feature.d.ts +1 -2
  298. package/features/wcp/WcpContext/feature.js +2 -2
  299. package/features/wcp/WcpContext/feature.js.map +1 -1
  300. package/features/wcp/WcpContext/index.d.ts +0 -1
  301. package/features/wcp/WcpContext/types.d.ts +0 -4
  302. package/features/wcp/WcpFeature.d.ts +1 -1
  303. package/features/wcp/WcpFeature.js +7 -2
  304. package/features/wcp/WcpFeature.js.map +1 -1
  305. package/features/wcp/WcpLicenseLoader.d.ts +25 -0
  306. package/features/wcp/WcpLicenseLoader.js +58 -0
  307. package/features/wcp/WcpLicenseLoader.js.map +1 -0
  308. package/features/wcp/WcpLicenseProvider.d.ts +21 -0
  309. package/features/wcp/WcpLicenseProvider.js +14 -0
  310. package/features/wcp/WcpLicenseProvider.js.map +1 -0
  311. package/features/wcp/resolveWcpProjectEnvironment.d.ts +9 -0
  312. package/features/wcp/resolveWcpProjectEnvironment.js +23 -0
  313. package/features/wcp/resolveWcpProjectEnvironment.js.map +1 -0
  314. package/graphql/ApiCoreSchemaFactory.d.ts +16 -0
  315. package/graphql/ApiCoreSchemaFactory.js +58 -0
  316. package/graphql/ApiCoreSchemaFactory.js.map +1 -0
  317. package/graphql/featureFlags/FeatureFlagsSchemaFactory.d.ts +10 -0
  318. package/graphql/featureFlags/FeatureFlagsSchemaFactory.js +53 -0
  319. package/graphql/featureFlags/FeatureFlagsSchemaFactory.js.map +1 -0
  320. package/graphql/security/NotAuthorizedResponse.d.ts +1 -1
  321. package/graphql/security/NotAuthorizedResponse.js +1 -1
  322. package/graphql/security/NotAuthorizedResponse.js.map +1 -1
  323. package/graphql/security/SecuritySchemaFactory.d.ts +15 -0
  324. package/graphql/security/SecuritySchemaFactory.js +27 -0
  325. package/graphql/security/SecuritySchemaFactory.js.map +1 -0
  326. package/graphql/security/addApiKeySchema.d.ts +2 -0
  327. package/graphql/security/{apiKey.gql.js → addApiKeySchema.js} +45 -27
  328. package/graphql/security/addApiKeySchema.js.map +1 -0
  329. package/graphql/security/addIdentitySchema.d.ts +2 -0
  330. package/graphql/security/{identity.gql.js → addIdentitySchema.js} +52 -35
  331. package/graphql/security/addIdentitySchema.js.map +1 -0
  332. package/graphql/security/addRoleSchema.d.ts +2 -0
  333. package/graphql/security/addRoleSchema.js +137 -0
  334. package/graphql/security/addRoleSchema.js.map +1 -0
  335. package/graphql/security/addSecurityBaseSchema.d.ts +2 -0
  336. package/graphql/security/{base.gql.js → addSecurityBaseSchema.js} +14 -16
  337. package/graphql/security/addSecurityBaseSchema.js.map +1 -0
  338. package/graphql/security/addTeamSchema.d.ts +2 -0
  339. package/graphql/security/addTeamSchema.js +157 -0
  340. package/graphql/security/addTeamSchema.js.map +1 -0
  341. package/graphql/system/SystemSchemaFactory.d.ts +10 -0
  342. package/graphql/system/SystemSchemaFactory.js +70 -0
  343. package/graphql/system/SystemSchemaFactory.js.map +1 -0
  344. package/graphql/users/UsersSchemaFactory.d.ts +10 -0
  345. package/graphql/users/UsersSchemaFactory.js +195 -0
  346. package/graphql/users/UsersSchemaFactory.js.map +1 -0
  347. package/graphql/wcp/WcpSchemaFactory.d.ts +10 -0
  348. package/graphql/wcp/{graphql.js → WcpSchemaFactory.js} +32 -18
  349. package/graphql/wcp/WcpSchemaFactory.js.map +1 -0
  350. package/idp/JwksCache.d.ts +14 -3
  351. package/idp/JwksCache.js +97 -17
  352. package/idp/JwksCache.js.map +1 -1
  353. package/idp/JwksStoreFeature.d.ts +8 -0
  354. package/idp/JwksStoreFeature.js +11 -0
  355. package/idp/JwksStoreFeature.js.map +1 -0
  356. package/idp/MemoryJwksStore.d.ts +14 -0
  357. package/idp/MemoryJwksStore.js +21 -0
  358. package/idp/MemoryJwksStore.js.map +1 -0
  359. package/idp/OidcJwtIdentityProvider.js +5 -1
  360. package/idp/OidcJwtIdentityProvider.js.map +1 -1
  361. package/idp/abstractions.d.ts +24 -0
  362. package/idp/abstractions.js +2 -1
  363. package/idp/abstractions.js.map +1 -1
  364. package/idp/feature.js +1 -2
  365. package/idp/feature.js.map +1 -1
  366. package/idp/index.d.ts +1 -0
  367. package/idp/index.js +1 -0
  368. package/index.d.ts +3 -1
  369. package/index.js +3 -1
  370. package/package.json +22 -22
  371. package/testing/environment.d.ts +14 -0
  372. package/testing/environment.js +18 -0
  373. package/testing/environment.js.map +1 -0
  374. package/types/core.d.ts +17 -5
  375. package/types/security.d.ts +0 -6
  376. package/types/tenancy.d.ts +0 -17
  377. package/types/users.d.ts +2 -16
  378. package/createApiCore.d.ts +0 -7
  379. package/createApiCore.js +0 -26
  380. package/createApiCore.js.map +0 -1
  381. package/graphql/security/apiKey.gql.d.ts +0 -4
  382. package/graphql/security/apiKey.gql.js.map +0 -1
  383. package/graphql/security/base.gql.d.ts +0 -4
  384. package/graphql/security/base.gql.js.map +0 -1
  385. package/graphql/security/identity.gql.d.ts +0 -4
  386. package/graphql/security/identity.gql.js.map +0 -1
  387. package/graphql/security/index.d.ts +0 -1
  388. package/graphql/security/index.js +0 -15
  389. package/graphql/security/index.js.map +0 -1
  390. package/graphql/security/role.gql.d.ts +0 -4
  391. package/graphql/security/role.gql.js +0 -106
  392. package/graphql/security/role.gql.js.map +0 -1
  393. package/graphql/security/team.gql.d.ts +0 -4
  394. package/graphql/security/team.gql.js +0 -119
  395. package/graphql/security/team.gql.js.map +0 -1
  396. package/graphql/system/createSystemGraphQL.d.ts +0 -2
  397. package/graphql/system/createSystemGraphQL.js +0 -54
  398. package/graphql/system/createSystemGraphQL.js.map +0 -1
  399. package/graphql/users/user.gql.d.ts +0 -3
  400. package/graphql/users/user.gql.js +0 -167
  401. package/graphql/users/user.gql.js.map +0 -1
  402. package/graphql/wcp/graphql.d.ts +0 -2
  403. package/graphql/wcp/graphql.js.map +0 -1
  404. package/legacy/security/LegacyContext.d.ts +0 -36
  405. package/legacy/security/LegacyContext.js +0 -152
  406. package/legacy/security/LegacyContext.js.map +0 -1
  407. package/legacy/security/createSecurityContext.d.ts +0 -3
  408. package/legacy/security/createSecurityContext.js +0 -10
  409. package/legacy/security/createSecurityContext.js.map +0 -1
  410. package/legacy/security/plugins/apiKeyAuthentication.d.ts +0 -7
  411. package/legacy/security/plugins/apiKeyAuthentication.js +0 -20
  412. package/legacy/security/plugins/apiKeyAuthentication.js.map +0 -1
  413. package/legacy/security/plugins/apiKeyAuthorization.d.ts +0 -6
  414. package/legacy/security/plugins/apiKeyAuthorization.js +0 -13
  415. package/legacy/security/plugins/apiKeyAuthorization.js.map +0 -1
  416. package/legacy/security/plugins/authenticateUsingCookie.d.ts +0 -5
  417. package/legacy/security/plugins/authenticateUsingCookie.js +0 -23
  418. package/legacy/security/plugins/authenticateUsingCookie.js.map +0 -1
  419. package/legacy/security/plugins/authenticateUsingHttpHeader.d.ts +0 -5
  420. package/legacy/security/plugins/authenticateUsingHttpHeader.js +0 -20
  421. package/legacy/security/plugins/authenticateUsingHttpHeader.js.map +0 -1
  422. package/legacy/security/plugins/secureHeaders.d.ts +0 -1
  423. package/legacy/security/plugins/secureHeaders.js +0 -30
  424. package/legacy/security/plugins/secureHeaders.js.map +0 -1
  425. package/legacy/tenancy/LegacyContext.d.ts +0 -15
  426. package/legacy/tenancy/LegacyContext.js +0 -57
  427. package/legacy/tenancy/LegacyContext.js.map +0 -1
  428. package/legacy/tenancy/createTenancyContext.d.ts +0 -3
  429. package/legacy/tenancy/createTenancyContext.js +0 -31
  430. package/legacy/tenancy/createTenancyContext.js.map +0 -1
  431. package/legacy/users/LegacyContext.d.ts +0 -13
  432. package/legacy/users/LegacyContext.js +0 -55
  433. package/legacy/users/LegacyContext.js.map +0 -1
  434. package/legacy/users/createAdminUsersContext.d.ts +0 -3
  435. package/legacy/users/createAdminUsersContext.js +0 -12
  436. package/legacy/users/createAdminUsersContext.js.map +0 -1
  437. package/legacy/wcp/LegacyWcpContext.d.ts +0 -37
  438. package/legacy/wcp/LegacyWcpContext.js +0 -96
  439. package/legacy/wcp/LegacyWcpContext.js.map +0 -1
  440. package/legacy/wcp/context.d.ts +0 -5
  441. package/legacy/wcp/context.js +0 -46
  442. package/legacy/wcp/context.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"legacy/users/createAdminUsersContext.js","sources":["../../../src/legacy/users/createAdminUsersContext.ts"],"sourcesContent":["import { ContextPlugin } from \"@webiny/api\";\nimport { LegacyContext } from \"./LegacyContext.js\";\nimport { createUsersGraphQL } from \"~/graphql/users/user.gql.js\";\nimport type { ApiCoreContext } from \"~/types/core.js\";\n\nexport const createAdminUsersContext = () => {\n return [\n new ContextPlugin<ApiCoreContext>(async context => {\n // Attach legacy context interface\n context.adminUsers = new LegacyContext(context.container);\n\n context.plugins.register(createUsersGraphQL());\n })\n ];\n};\n"],"names":["createAdminUsersContext","ContextPlugin","context","LegacyContext","createUsersGraphQL"],"mappings":";;;AAKO,MAAMA,0BAA0B,IAC5B;QACH,IAAIC,cAA8B,OAAMC;YAEpCA,QAAQ,UAAU,GAAG,IAAIC,cAAcD,QAAQ,SAAS;YAExDA,QAAQ,OAAO,CAAC,QAAQ,CAACE;QAC7B;KACH"}
@@ -1,37 +0,0 @@
1
- import { Container } from "@webiny/di";
2
- import type { WCP_FEATURE_LABEL } from "@webiny/wcp";
3
- import type { DecryptedWcpProjectLicense, ILicense, WcpProject, WcpProjectEnvironment } from "@webiny/wcp/types.js";
4
- import { WcpContextObject } from "../../features/wcp/WcpContext/types.js";
5
- export declare class LegacyWcpContext implements WcpContextObject {
6
- private container;
7
- constructor(container: Container);
8
- private getWcpContext;
9
- getRawLicense(): DecryptedWcpProjectLicense | null;
10
- getProject(): WcpProject | null;
11
- getProjectWithFeatureFlags(): WcpProject | null;
12
- getProjectLicense(): ILicense;
13
- getProjectEnvironment(): WcpProjectEnvironment | null;
14
- canUseFeature(wcpFeatureId: keyof typeof WCP_FEATURE_LABEL): boolean;
15
- canUseAacl(): boolean;
16
- canUseTeams(): boolean;
17
- canUseFolderLevelPermissions(): boolean;
18
- canUsePrivateFiles(): boolean;
19
- canUseAuditLogs(): boolean;
20
- canUseRecordLocking(): boolean;
21
- canUseFileManagerThreatDetection(): boolean;
22
- canUseWorkflows(): boolean;
23
- canUseHcmsFieldPermissions(): boolean;
24
- canUseAiImageEnrichment(): boolean;
25
- canUseAiPageGeneration(): boolean;
26
- canUseAiPageTranslation(): boolean;
27
- canUseAiLexicalGeneration(): boolean;
28
- canUseAiEntryGeneration(): boolean;
29
- canUseAiEntryComparison(): boolean;
30
- canUseAiEntryTranslation(): boolean;
31
- ensureCanUseFeature(featureId: keyof typeof WCP_FEATURE_LABEL): void;
32
- incrementSeats(): Promise<void>;
33
- decrementSeats(): Promise<void>;
34
- incrementTenants(): Promise<void>;
35
- decrementTenants(): Promise<void>;
36
- toDto(): DecryptedWcpProjectLicense | null;
37
- }
@@ -1,96 +0,0 @@
1
- import { WcpContext } from "../../features/wcp/WcpContext/index.js";
2
- class LegacyWcpContext {
3
- constructor(container){
4
- this.container = container;
5
- }
6
- getWcpContext() {
7
- return this.container.resolve(WcpContext);
8
- }
9
- getRawLicense() {
10
- return this.getWcpContext().getRawLicense();
11
- }
12
- getProject() {
13
- return this.getWcpContext().getProject();
14
- }
15
- getProjectWithFeatureFlags() {
16
- return this.getWcpContext().getProjectWithFeatureFlags();
17
- }
18
- getProjectLicense() {
19
- return this.getWcpContext().getProjectLicense();
20
- }
21
- getProjectEnvironment() {
22
- return this.getWcpContext().getProjectEnvironment();
23
- }
24
- canUseFeature(wcpFeatureId) {
25
- return this.getWcpContext().canUseFeature(wcpFeatureId);
26
- }
27
- canUseAacl() {
28
- return this.getWcpContext().canUseAacl();
29
- }
30
- canUseTeams() {
31
- return this.getWcpContext().canUseTeams();
32
- }
33
- canUseFolderLevelPermissions() {
34
- return this.getWcpContext().canUseFolderLevelPermissions();
35
- }
36
- canUsePrivateFiles() {
37
- return this.getWcpContext().canUsePrivateFiles();
38
- }
39
- canUseAuditLogs() {
40
- return this.getWcpContext().canUseAuditLogs();
41
- }
42
- canUseRecordLocking() {
43
- return this.getWcpContext().canUseRecordLocking();
44
- }
45
- canUseFileManagerThreatDetection() {
46
- return this.getWcpContext().canUseFileManagerThreatDetection();
47
- }
48
- canUseWorkflows() {
49
- return this.getWcpContext().canUseWorkflows();
50
- }
51
- canUseHcmsFieldPermissions() {
52
- return this.getWcpContext().canUseHcmsFieldPermissions();
53
- }
54
- canUseAiImageEnrichment() {
55
- return this.getWcpContext().canUseAiImageEnrichment();
56
- }
57
- canUseAiPageGeneration() {
58
- return this.getWcpContext().canUseAiPageGeneration();
59
- }
60
- canUseAiPageTranslation() {
61
- return this.getWcpContext().canUseAiPageTranslation();
62
- }
63
- canUseAiLexicalGeneration() {
64
- return this.getWcpContext().canUseAiLexicalGeneration();
65
- }
66
- canUseAiEntryGeneration() {
67
- return this.getWcpContext().canUseAiEntryGeneration();
68
- }
69
- canUseAiEntryComparison() {
70
- return this.getWcpContext().canUseAiEntryComparison();
71
- }
72
- canUseAiEntryTranslation() {
73
- return this.getWcpContext().canUseAiEntryTranslation();
74
- }
75
- ensureCanUseFeature(featureId) {
76
- this.getWcpContext().ensureCanUseFeature(featureId);
77
- }
78
- async incrementSeats() {
79
- await this.getWcpContext().incrementSeats();
80
- }
81
- async decrementSeats() {
82
- await this.getWcpContext().decrementSeats();
83
- }
84
- async incrementTenants() {
85
- await this.getWcpContext().incrementTenants();
86
- }
87
- async decrementTenants() {
88
- await this.getWcpContext().decrementTenants();
89
- }
90
- toDto() {
91
- return this.getWcpContext().toDto();
92
- }
93
- }
94
- export { LegacyWcpContext };
95
-
96
- //# sourceMappingURL=LegacyWcpContext.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"legacy/wcp/LegacyWcpContext.js","sources":["../../../src/legacy/wcp/LegacyWcpContext.ts"],"sourcesContent":["import { Container } from \"@webiny/di\";\nimport type { WCP_FEATURE_LABEL } from \"@webiny/wcp\";\nimport type {\n DecryptedWcpProjectLicense,\n ILicense,\n WcpProject,\n WcpProjectEnvironment\n} from \"@webiny/wcp/types.js\";\nimport { WcpContextObject } from \"~/features/wcp/WcpContext/types.js\";\nimport { WcpContext } from \"~/features/wcp/WcpContext/index.js\";\n\nexport class LegacyWcpContext implements WcpContextObject {\n constructor(private container: Container) {}\n\n private getWcpContext(): WcpContext.Interface {\n return this.container.resolve(WcpContext);\n }\n\n getRawLicense(): DecryptedWcpProjectLicense | null {\n return this.getWcpContext().getRawLicense();\n }\n\n getProject(): WcpProject | null {\n return this.getWcpContext().getProject();\n }\n\n getProjectWithFeatureFlags(): WcpProject | null {\n return this.getWcpContext().getProjectWithFeatureFlags();\n }\n\n getProjectLicense(): ILicense {\n return this.getWcpContext().getProjectLicense();\n }\n\n getProjectEnvironment(): WcpProjectEnvironment | null {\n return this.getWcpContext().getProjectEnvironment();\n }\n\n canUseFeature(wcpFeatureId: keyof typeof WCP_FEATURE_LABEL): boolean {\n return this.getWcpContext().canUseFeature(wcpFeatureId);\n }\n\n canUseAacl(): boolean {\n return this.getWcpContext().canUseAacl();\n }\n\n canUseTeams(): boolean {\n return this.getWcpContext().canUseTeams();\n }\n\n canUseFolderLevelPermissions(): boolean {\n return this.getWcpContext().canUseFolderLevelPermissions();\n }\n\n canUsePrivateFiles(): boolean {\n return this.getWcpContext().canUsePrivateFiles();\n }\n\n canUseAuditLogs(): boolean {\n return this.getWcpContext().canUseAuditLogs();\n }\n\n canUseRecordLocking(): boolean {\n return this.getWcpContext().canUseRecordLocking();\n }\n\n canUseFileManagerThreatDetection(): boolean {\n return this.getWcpContext().canUseFileManagerThreatDetection();\n }\n\n canUseWorkflows(): boolean {\n return this.getWcpContext().canUseWorkflows();\n }\n\n canUseHcmsFieldPermissions(): boolean {\n return this.getWcpContext().canUseHcmsFieldPermissions();\n }\n\n canUseAiImageEnrichment(): boolean {\n return this.getWcpContext().canUseAiImageEnrichment();\n }\n\n canUseAiPageGeneration(): boolean {\n return this.getWcpContext().canUseAiPageGeneration();\n }\n\n canUseAiPageTranslation(): boolean {\n return this.getWcpContext().canUseAiPageTranslation();\n }\n\n canUseAiLexicalGeneration(): boolean {\n return this.getWcpContext().canUseAiLexicalGeneration();\n }\n\n canUseAiEntryGeneration(): boolean {\n return this.getWcpContext().canUseAiEntryGeneration();\n }\n\n canUseAiEntryComparison(): boolean {\n return this.getWcpContext().canUseAiEntryComparison();\n }\n\n canUseAiEntryTranslation(): boolean {\n return this.getWcpContext().canUseAiEntryTranslation();\n }\n\n ensureCanUseFeature(featureId: keyof typeof WCP_FEATURE_LABEL): void {\n this.getWcpContext().ensureCanUseFeature(featureId);\n }\n\n async incrementSeats(): Promise<void> {\n await this.getWcpContext().incrementSeats();\n }\n\n async decrementSeats(): Promise<void> {\n await this.getWcpContext().decrementSeats();\n }\n\n async incrementTenants(): Promise<void> {\n await this.getWcpContext().incrementTenants();\n }\n\n async decrementTenants(): Promise<void> {\n await this.getWcpContext().decrementTenants();\n }\n\n toDto(): DecryptedWcpProjectLicense | null {\n return this.getWcpContext().toDto();\n }\n}\n"],"names":["LegacyWcpContext","container","WcpContext","wcpFeatureId","featureId"],"mappings":";AAWO,MAAMA;IACT,YAAoBC,SAAoB,CAAE;aAAtBA,SAAS,GAATA;IAAuB;IAEnC,gBAAsC;QAC1C,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAACC;IAClC;IAEA,gBAAmD;QAC/C,OAAO,IAAI,CAAC,aAAa,GAAG,aAAa;IAC7C;IAEA,aAAgC;QAC5B,OAAO,IAAI,CAAC,aAAa,GAAG,UAAU;IAC1C;IAEA,6BAAgD;QAC5C,OAAO,IAAI,CAAC,aAAa,GAAG,0BAA0B;IAC1D;IAEA,oBAA8B;QAC1B,OAAO,IAAI,CAAC,aAAa,GAAG,iBAAiB;IACjD;IAEA,wBAAsD;QAClD,OAAO,IAAI,CAAC,aAAa,GAAG,qBAAqB;IACrD;IAEA,cAAcC,YAA4C,EAAW;QACjE,OAAO,IAAI,CAAC,aAAa,GAAG,aAAa,CAACA;IAC9C;IAEA,aAAsB;QAClB,OAAO,IAAI,CAAC,aAAa,GAAG,UAAU;IAC1C;IAEA,cAAuB;QACnB,OAAO,IAAI,CAAC,aAAa,GAAG,WAAW;IAC3C;IAEA,+BAAwC;QACpC,OAAO,IAAI,CAAC,aAAa,GAAG,4BAA4B;IAC5D;IAEA,qBAA8B;QAC1B,OAAO,IAAI,CAAC,aAAa,GAAG,kBAAkB;IAClD;IAEA,kBAA2B;QACvB,OAAO,IAAI,CAAC,aAAa,GAAG,eAAe;IAC/C;IAEA,sBAA+B;QAC3B,OAAO,IAAI,CAAC,aAAa,GAAG,mBAAmB;IACnD;IAEA,mCAA4C;QACxC,OAAO,IAAI,CAAC,aAAa,GAAG,gCAAgC;IAChE;IAEA,kBAA2B;QACvB,OAAO,IAAI,CAAC,aAAa,GAAG,eAAe;IAC/C;IAEA,6BAAsC;QAClC,OAAO,IAAI,CAAC,aAAa,GAAG,0BAA0B;IAC1D;IAEA,0BAAmC;QAC/B,OAAO,IAAI,CAAC,aAAa,GAAG,uBAAuB;IACvD;IAEA,yBAAkC;QAC9B,OAAO,IAAI,CAAC,aAAa,GAAG,sBAAsB;IACtD;IAEA,0BAAmC;QAC/B,OAAO,IAAI,CAAC,aAAa,GAAG,uBAAuB;IACvD;IAEA,4BAAqC;QACjC,OAAO,IAAI,CAAC,aAAa,GAAG,yBAAyB;IACzD;IAEA,0BAAmC;QAC/B,OAAO,IAAI,CAAC,aAAa,GAAG,uBAAuB;IACvD;IAEA,0BAAmC;QAC/B,OAAO,IAAI,CAAC,aAAa,GAAG,uBAAuB;IACvD;IAEA,2BAAoC;QAChC,OAAO,IAAI,CAAC,aAAa,GAAG,wBAAwB;IACxD;IAEA,oBAAoBC,SAAyC,EAAQ;QACjE,IAAI,CAAC,aAAa,GAAG,mBAAmB,CAACA;IAC7C;IAEA,MAAM,iBAAgC;QAClC,MAAM,IAAI,CAAC,aAAa,GAAG,cAAc;IAC7C;IAEA,MAAM,iBAAgC;QAClC,MAAM,IAAI,CAAC,aAAa,GAAG,cAAc;IAC7C;IAEA,MAAM,mBAAkC;QACpC,MAAM,IAAI,CAAC,aAAa,GAAG,gBAAgB;IAC/C;IAEA,MAAM,mBAAkC;QACpC,MAAM,IAAI,CAAC,aAAa,GAAG,gBAAgB;IAC/C;IAEA,QAA2C;QACvC,OAAO,IAAI,CAAC,aAAa,GAAG,KAAK;IACrC;AACJ"}
@@ -1,5 +0,0 @@
1
- import type { DecryptedWcpProjectLicense } from "@webiny/wcp/types.js";
2
- export interface CreateWcpContextParams {
3
- testProjectLicense?: DecryptedWcpProjectLicense;
4
- }
5
- export declare const createWcpContext: (params?: CreateWcpContextParams) => import("@webiny/handler/index.js").RegisterExtensionPlugin<import("@webiny/handler/types.js").Context>;
@@ -1,46 +0,0 @@
1
- import { License, NullLicense, getWcpProjectEnvironment, getWcpProjectLicense } from "@webiny/wcp";
2
- import { createRegisterExtensionPlugin } from "@webiny/handler/plugins/RegisterExtensionPlugin.js";
3
- import { getWcpProjectLicenseCacheKey } from "../../features/wcp/WcpContext/utils.js";
4
- import { WcpFeature } from "../../features/wcp/WcpFeature.js";
5
- import { LegacyWcpContext } from "./LegacyWcpContext.js";
6
- import { createWcpGraphQL } from "../../graphql/wcp/graphql.js";
7
- const wcpProjectEnvironment = getWcpProjectEnvironment();
8
- const cachedLicense = {
9
- cacheKey: null,
10
- project: null,
11
- license: new NullLicense()
12
- };
13
- async function loadLicense(testProjectLicense) {
14
- if (testProjectLicense) cachedLicense.license = License.fromLicenseDto(testProjectLicense);
15
- else if (wcpProjectEnvironment) {
16
- const currentCacheKey = getWcpProjectLicenseCacheKey();
17
- if (cachedLicense.cacheKey !== currentCacheKey) {
18
- cachedLicense.cacheKey = currentCacheKey;
19
- const decryptedLicenseDto = await getWcpProjectLicense({
20
- orgId: wcpProjectEnvironment.org.id,
21
- projectId: wcpProjectEnvironment.project.id,
22
- projectEnvironmentApiKey: wcpProjectEnvironment.apiKey
23
- });
24
- if (decryptedLicenseDto) cachedLicense.project = {
25
- orgId: decryptedLicenseDto.orgId,
26
- projectId: decryptedLicenseDto.projectId,
27
- package: decryptedLicenseDto.package
28
- };
29
- cachedLicense.license = License.fromLicenseDto(decryptedLicenseDto);
30
- }
31
- }
32
- return cachedLicense.license;
33
- }
34
- const createWcpContext = (params = {})=>{
35
- const plugin = createRegisterExtensionPlugin(async (context)=>{
36
- const license = await loadLicense(params.testProjectLicense);
37
- WcpFeature.register(context.container, license);
38
- context.wcp = new LegacyWcpContext(context.container);
39
- context.plugins.register(createWcpGraphQL());
40
- });
41
- plugin.name = "wcp.context.create";
42
- return plugin;
43
- };
44
- export { createWcpContext };
45
-
46
- //# sourceMappingURL=context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"legacy/wcp/context.js","sources":["../../../src/legacy/wcp/context.ts"],"sourcesContent":["import { getWcpProjectLicense, getWcpProjectEnvironment, NullLicense } from \"@webiny/wcp\";\nimport type { DecryptedWcpProjectLicense, ILicense } from \"@webiny/wcp/types.js\";\nimport { License } from \"@webiny/wcp\";\nimport { createRegisterExtensionPlugin } from \"@webiny/handler/plugins/RegisterExtensionPlugin.js\";\nimport type { CachedWcpProjectLicense } from \"~/features/wcp/WcpContext/types.js\";\nimport { getWcpProjectLicenseCacheKey } from \"~/features/wcp/WcpContext/utils.js\";\nimport { WcpFeature } from \"~/features/wcp/WcpFeature.js\";\nimport { LegacyWcpContext } from \"./LegacyWcpContext.js\";\nimport { createWcpGraphQL } from \"~/graphql/wcp/graphql.js\";\n\nconst wcpProjectEnvironment = getWcpProjectEnvironment();\n\nconst cachedLicense: CachedWcpProjectLicense = {\n cacheKey: null,\n project: null,\n license: new NullLicense()\n};\n\nasync function loadLicense(testProjectLicense?: DecryptedWcpProjectLicense): Promise<ILicense> {\n if (testProjectLicense) {\n cachedLicense.license = License.fromLicenseDto(testProjectLicense);\n } else if (wcpProjectEnvironment) {\n const currentCacheKey = getWcpProjectLicenseCacheKey();\n if (cachedLicense.cacheKey !== currentCacheKey) {\n cachedLicense.cacheKey = currentCacheKey;\n // Pull the project license from the WCP API.\n const decryptedLicenseDto = await getWcpProjectLicense({\n orgId: wcpProjectEnvironment.org.id,\n projectId: wcpProjectEnvironment.project.id,\n projectEnvironmentApiKey: wcpProjectEnvironment.apiKey\n });\n\n if (decryptedLicenseDto) {\n cachedLicense.project = {\n orgId: decryptedLicenseDto.orgId,\n projectId: decryptedLicenseDto.projectId,\n package: decryptedLicenseDto.package\n };\n }\n\n cachedLicense.license = License.fromLicenseDto(decryptedLicenseDto);\n }\n }\n\n return cachedLicense.license;\n}\n\nexport interface CreateWcpContextParams {\n testProjectLicense?: DecryptedWcpProjectLicense;\n}\n\nexport const createWcpContext = (params: CreateWcpContextParams = {}) => {\n const plugin = createRegisterExtensionPlugin(async context => {\n const license = await loadLicense(params.testProjectLicense);\n\n WcpFeature.register(context.container, license);\n\n // @ts-expect-error This is a legacy property\n context.wcp = new LegacyWcpContext(context.container);\n\n context.plugins.register(createWcpGraphQL());\n });\n\n plugin.name = \"wcp.context.create\";\n\n return plugin;\n};\n"],"names":["wcpProjectEnvironment","getWcpProjectEnvironment","cachedLicense","NullLicense","loadLicense","testProjectLicense","License","currentCacheKey","getWcpProjectLicenseCacheKey","decryptedLicenseDto","getWcpProjectLicense","createWcpContext","params","plugin","createRegisterExtensionPlugin","context","license","WcpFeature","LegacyWcpContext","createWcpGraphQL"],"mappings":";;;;;;AAUA,MAAMA,wBAAwBC;AAE9B,MAAMC,gBAAyC;IAC3C,UAAU;IACV,SAAS;IACT,SAAS,IAAIC;AACjB;AAEA,eAAeC,YAAYC,kBAA+C;IACtE,IAAIA,oBACAH,cAAc,OAAO,GAAGI,QAAQ,cAAc,CAACD;SAC5C,IAAIL,uBAAuB;QAC9B,MAAMO,kBAAkBC;QACxB,IAAIN,cAAc,QAAQ,KAAKK,iBAAiB;YAC5CL,cAAc,QAAQ,GAAGK;YAEzB,MAAME,sBAAsB,MAAMC,qBAAqB;gBACnD,OAAOV,sBAAsB,GAAG,CAAC,EAAE;gBACnC,WAAWA,sBAAsB,OAAO,CAAC,EAAE;gBAC3C,0BAA0BA,sBAAsB,MAAM;YAC1D;YAEA,IAAIS,qBACAP,cAAc,OAAO,GAAG;gBACpB,OAAOO,oBAAoB,KAAK;gBAChC,WAAWA,oBAAoB,SAAS;gBACxC,SAASA,oBAAoB,OAAO;YACxC;YAGJP,cAAc,OAAO,GAAGI,QAAQ,cAAc,CAACG;QACnD;IACJ;IAEA,OAAOP,cAAc,OAAO;AAChC;AAMO,MAAMS,mBAAmB,CAACC,SAAiC,CAAC,CAAC;IAChE,MAAMC,SAASC,8BAA8B,OAAMC;QAC/C,MAAMC,UAAU,MAAMZ,YAAYQ,OAAO,kBAAkB;QAE3DK,WAAW,QAAQ,CAACF,QAAQ,SAAS,EAAEC;QAGvCD,QAAQ,GAAG,GAAG,IAAIG,iBAAiBH,QAAQ,SAAS;QAEpDA,QAAQ,OAAO,CAAC,QAAQ,CAACI;IAC7B;IAEAN,OAAO,IAAI,GAAG;IAEd,OAAOA;AACX"}