@microsoft/power-apps 0.3.1

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 (291) hide show
  1. package/LICENSE +153 -0
  2. package/README.md +63 -0
  3. package/lib/__tests__/connectorDataOperationExecutor.spec.d.ts +5 -0
  4. package/lib/__tests__/connectorDataOperationExecutor.spec.d.ts.map +1 -0
  5. package/lib/__tests__/connectorDataOperationExecutor.spec.js +509 -0
  6. package/lib/__tests__/connectorDataOperationExecutor.spec.js.map +1 -0
  7. package/lib/__tests__/dataverseDataOperationExecutor.spec.d.ts +5 -0
  8. package/lib/__tests__/dataverseDataOperationExecutor.spec.d.ts.map +1 -0
  9. package/lib/__tests__/dataverseDataOperationExecutor.spec.js +349 -0
  10. package/lib/__tests__/dataverseDataOperationExecutor.spec.js.map +1 -0
  11. package/lib/__tests__/helpers/testHelpers.d.ts +27 -0
  12. package/lib/__tests__/helpers/testHelpers.d.ts.map +1 -0
  13. package/lib/__tests__/helpers/testHelpers.js +67 -0
  14. package/lib/__tests__/helpers/testHelpers.js.map +1 -0
  15. package/lib/__tests__/index.spec.d.ts +5 -0
  16. package/lib/__tests__/index.spec.d.ts.map +1 -0
  17. package/lib/__tests__/index.spec.js +10 -0
  18. package/lib/__tests__/index.spec.js.map +1 -0
  19. package/lib/__tests__/mockDataOperationExecutor.spec.d.ts +5 -0
  20. package/lib/__tests__/mockDataOperationExecutor.spec.d.ts.map +1 -0
  21. package/lib/__tests__/mockDataOperationExecutor.spec.js +51 -0
  22. package/lib/__tests__/mockDataOperationExecutor.spec.js.map +1 -0
  23. package/lib/__tests__/mocks/mockDataverseRetrieveMultipleResponse.d.ts +17 -0
  24. package/lib/__tests__/mocks/mockDataverseRetrieveMultipleResponse.d.ts.map +1 -0
  25. package/lib/__tests__/mocks/mockDataverseRetrieveMultipleResponse.js +35 -0
  26. package/lib/__tests__/mocks/mockDataverseRetrieveMultipleResponse.js.map +1 -0
  27. package/lib/__tests__/mocks/mockLog.d.ts +31 -0
  28. package/lib/__tests__/mocks/mockLog.d.ts.map +1 -0
  29. package/lib/__tests__/mocks/mockLog.js +53 -0
  30. package/lib/__tests__/mocks/mockLog.js.map +1 -0
  31. package/lib/__tests__/mocks/mockTeamsConnectorResponse.d.ts +76 -0
  32. package/lib/__tests__/mocks/mockTeamsConnectorResponse.d.ts.map +1 -0
  33. package/lib/__tests__/mocks/mockTeamsConnectorResponse.js +81 -0
  34. package/lib/__tests__/mocks/mockTeamsConnectorResponse.js.map +1 -0
  35. package/lib/__tests__/mocks/silenceConsole.d.ts +37 -0
  36. package/lib/__tests__/mocks/silenceConsole.d.ts.map +1 -0
  37. package/lib/__tests__/mocks/silenceConsole.js +58 -0
  38. package/lib/__tests__/mocks/silenceConsole.js.map +1 -0
  39. package/lib/__tests__/powerDataRuntimeInstance.test.d.ts +5 -0
  40. package/lib/__tests__/powerDataRuntimeInstance.test.d.ts.map +1 -0
  41. package/lib/__tests__/powerDataRuntimeInstance.test.js +179 -0
  42. package/lib/__tests__/powerDataRuntimeInstance.test.js.map +1 -0
  43. package/lib/__tests__/powerDataSourcesInfoProvider.test.d.ts +5 -0
  44. package/lib/__tests__/powerDataSourcesInfoProvider.test.d.ts.map +1 -0
  45. package/lib/__tests__/powerDataSourcesInfoProvider.test.js +153 -0
  46. package/lib/__tests__/powerDataSourcesInfoProvider.test.js.map +1 -0
  47. package/lib/__tests__/runtimeClientProvider.test.d.ts +5 -0
  48. package/lib/__tests__/runtimeClientProvider.test.d.ts.map +1 -0
  49. package/lib/__tests__/runtimeClientProvider.test.js +248 -0
  50. package/lib/__tests__/runtimeClientProvider.test.js.map +1 -0
  51. package/lib/__tests__/runtimeDataClient.spec.d.ts +2 -0
  52. package/lib/__tests__/runtimeDataClient.spec.d.ts.map +1 -0
  53. package/lib/__tests__/runtimeDataClient.spec.js +351 -0
  54. package/lib/__tests__/runtimeDataClient.spec.js.map +1 -0
  55. package/lib/__tests__/runtimeDataClient.test.d.ts +2 -0
  56. package/lib/__tests__/runtimeDataClient.test.d.ts.map +1 -0
  57. package/lib/__tests__/runtimeDataClient.test.js +351 -0
  58. package/lib/__tests__/runtimeDataClient.test.js.map +1 -0
  59. package/lib/__tests__/runtimeDataOperation.test.d.ts +5 -0
  60. package/lib/__tests__/runtimeDataOperation.test.d.ts.map +1 -0
  61. package/lib/__tests__/runtimeDataOperation.test.js +234 -0
  62. package/lib/__tests__/runtimeDataOperation.test.js.map +1 -0
  63. package/lib/__tests__/runtimeMetadataClient.test.d.ts +5 -0
  64. package/lib/__tests__/runtimeMetadataClient.test.d.ts.map +1 -0
  65. package/lib/__tests__/runtimeMetadataClient.test.js +271 -0
  66. package/lib/__tests__/runtimeMetadataClient.test.js.map +1 -0
  67. package/lib/__tests__/runtimeMetadataOperations.test.d.ts +5 -0
  68. package/lib/__tests__/runtimeMetadataOperations.test.d.ts.map +1 -0
  69. package/lib/__tests__/runtimeMetadataOperations.test.js +286 -0
  70. package/lib/__tests__/runtimeMetadataOperations.test.js.map +1 -0
  71. package/lib/__tests__/serviceSchemaModelSnapshot.test.d.ts +2 -0
  72. package/lib/__tests__/serviceSchemaModelSnapshot.test.d.ts.map +1 -0
  73. package/lib/__tests__/serviceSchemaModelSnapshot.test.js +98 -0
  74. package/lib/__tests__/serviceSchemaModelSnapshot.test.js.map +1 -0
  75. package/lib/__tests__/types.spec.d.ts +5 -0
  76. package/lib/__tests__/types.spec.d.ts.map +1 -0
  77. package/lib/__tests__/types.spec.js +104 -0
  78. package/lib/__tests__/types.spec.js.map +1 -0
  79. package/lib/__tests__/utils.test.d.ts +5 -0
  80. package/lib/__tests__/utils.test.d.ts.map +1 -0
  81. package/lib/__tests__/utils.test.js +33 -0
  82. package/lib/__tests__/utils.test.js.map +1 -0
  83. package/lib/app/Lifecycle.d.ts +14 -0
  84. package/lib/app/Lifecycle.d.ts.map +1 -0
  85. package/lib/app/Lifecycle.js +37 -0
  86. package/lib/app/Lifecycle.js.map +1 -0
  87. package/lib/app/index.d.ts +5 -0
  88. package/lib/app/index.d.ts.map +1 -0
  89. package/lib/app/index.js +5 -0
  90. package/lib/app/index.js.map +1 -0
  91. package/lib/data/Data.types.d.ts +20 -0
  92. package/lib/data/Data.types.d.ts.map +1 -0
  93. package/lib/data/Data.types.js +5 -0
  94. package/lib/data/Data.types.js.map +1 -0
  95. package/lib/data/executors/index.d.ts +6 -0
  96. package/lib/data/executors/index.d.ts.map +1 -0
  97. package/lib/data/executors/index.js +5 -0
  98. package/lib/data/executors/index.js.map +1 -0
  99. package/lib/data/index.d.ts +7 -0
  100. package/lib/data/index.d.ts.map +1 -0
  101. package/lib/data/index.js +5 -0
  102. package/lib/data/index.js.map +1 -0
  103. package/lib/data/powerAppsData.d.ts +10 -0
  104. package/lib/data/powerAppsData.d.ts.map +1 -0
  105. package/lib/data/powerAppsData.js +43 -0
  106. package/lib/data/powerAppsData.js.map +1 -0
  107. package/lib/index.d.ts +8 -0
  108. package/lib/index.d.ts.map +1 -0
  109. package/lib/index.js +8 -0
  110. package/lib/index.js.map +1 -0
  111. package/lib/internal/communication/CompatibleMessageReceiver.d.ts +12 -0
  112. package/lib/internal/communication/CompatibleMessageReceiver.d.ts.map +1 -0
  113. package/lib/internal/communication/CompatibleMessageReceiver.js +92 -0
  114. package/lib/internal/communication/CompatibleMessageReceiver.js.map +1 -0
  115. package/lib/internal/communication/IncompatibleMessageReceiver.d.ts +10 -0
  116. package/lib/internal/communication/IncompatibleMessageReceiver.d.ts.map +1 -0
  117. package/lib/internal/communication/IncompatibleMessageReceiver.js +13 -0
  118. package/lib/internal/communication/IncompatibleMessageReceiver.js.map +1 -0
  119. package/lib/internal/communication/MessageReceiver.Types.d.ts +18 -0
  120. package/lib/internal/communication/MessageReceiver.Types.d.ts.map +1 -0
  121. package/lib/internal/communication/MessageReceiver.Types.js +5 -0
  122. package/lib/internal/communication/MessageReceiver.Types.js.map +1 -0
  123. package/lib/internal/communication/SendMessage.d.ts +11 -0
  124. package/lib/internal/communication/SendMessage.d.ts.map +1 -0
  125. package/lib/internal/communication/SendMessage.js +32 -0
  126. package/lib/internal/communication/SendMessage.js.map +1 -0
  127. package/lib/internal/communication/SendMessageOperation.d.ts +15 -0
  128. package/lib/internal/communication/SendMessageOperation.d.ts.map +1 -0
  129. package/lib/internal/communication/SendMessageOperation.js +18 -0
  130. package/lib/internal/communication/SendMessageOperation.js.map +1 -0
  131. package/lib/internal/data/ConnectionUtils.d.ts +5 -0
  132. package/lib/internal/data/ConnectionUtils.d.ts.map +1 -0
  133. package/lib/internal/data/ConnectionUtils.js +20 -0
  134. package/lib/internal/data/ConnectionUtils.js.map +1 -0
  135. package/lib/internal/data/OperationExecutor.d.ts +18 -0
  136. package/lib/internal/data/OperationExecutor.d.ts.map +1 -0
  137. package/lib/internal/data/OperationExecutor.js +35 -0
  138. package/lib/internal/data/OperationExecutor.js.map +1 -0
  139. package/lib/internal/data/core/api/createRecord.d.ts +13 -0
  140. package/lib/internal/data/core/api/createRecord.d.ts.map +1 -0
  141. package/lib/internal/data/core/api/createRecord.js +15 -0
  142. package/lib/internal/data/core/api/createRecord.js.map +1 -0
  143. package/lib/internal/data/core/api/deleteRecord.d.ts +13 -0
  144. package/lib/internal/data/core/api/deleteRecord.d.ts.map +1 -0
  145. package/lib/internal/data/core/api/deleteRecord.js +15 -0
  146. package/lib/internal/data/core/api/deleteRecord.js.map +1 -0
  147. package/lib/internal/data/core/api/execute.d.ts +11 -0
  148. package/lib/internal/data/core/api/execute.d.ts.map +1 -0
  149. package/lib/internal/data/core/api/execute.js +13 -0
  150. package/lib/internal/data/core/api/execute.js.map +1 -0
  151. package/lib/internal/data/core/api/retrieveMultipleRecords.d.ts +13 -0
  152. package/lib/internal/data/core/api/retrieveMultipleRecords.d.ts.map +1 -0
  153. package/lib/internal/data/core/api/retrieveMultipleRecords.js +15 -0
  154. package/lib/internal/data/core/api/retrieveMultipleRecords.js.map +1 -0
  155. package/lib/internal/data/core/api/retrieveRecord.d.ts +13 -0
  156. package/lib/internal/data/core/api/retrieveRecord.d.ts.map +1 -0
  157. package/lib/internal/data/core/api/retrieveRecord.js +15 -0
  158. package/lib/internal/data/core/api/retrieveRecord.js.map +1 -0
  159. package/lib/internal/data/core/api/updateRecord.d.ts +14 -0
  160. package/lib/internal/data/core/api/updateRecord.d.ts.map +1 -0
  161. package/lib/internal/data/core/api/updateRecord.js +16 -0
  162. package/lib/internal/data/core/api/updateRecord.js.map +1 -0
  163. package/lib/internal/data/core/common/types.d.ts +230 -0
  164. package/lib/internal/data/core/common/types.d.ts.map +1 -0
  165. package/lib/internal/data/core/common/types.js +25 -0
  166. package/lib/internal/data/core/common/types.js.map +1 -0
  167. package/lib/internal/data/core/common/utils.d.ts +19 -0
  168. package/lib/internal/data/core/common/utils.d.ts.map +1 -0
  169. package/lib/internal/data/core/common/utils.js +47 -0
  170. package/lib/internal/data/core/common/utils.js.map +1 -0
  171. package/lib/internal/data/core/data/defaultOperationOrchestrator.d.ts +93 -0
  172. package/lib/internal/data/core/data/defaultOperationOrchestrator.d.ts.map +1 -0
  173. package/lib/internal/data/core/data/defaultOperationOrchestrator.js +249 -0
  174. package/lib/internal/data/core/data/defaultOperationOrchestrator.js.map +1 -0
  175. package/lib/internal/data/core/data/executors/connectorDataOperationExecutor.d.ts +160 -0
  176. package/lib/internal/data/core/data/executors/connectorDataOperationExecutor.d.ts.map +1 -0
  177. package/lib/internal/data/core/data/executors/connectorDataOperationExecutor.js +500 -0
  178. package/lib/internal/data/core/data/executors/connectorDataOperationExecutor.js.map +1 -0
  179. package/lib/internal/data/core/data/executors/dataverseDataOperationExecutor.d.ts +164 -0
  180. package/lib/internal/data/core/data/executors/dataverseDataOperationExecutor.d.ts.map +1 -0
  181. package/lib/internal/data/core/data/executors/dataverseDataOperationExecutor.js +508 -0
  182. package/lib/internal/data/core/data/executors/dataverseDataOperationExecutor.js.map +1 -0
  183. package/lib/internal/data/core/data/executors/index.d.ts +5 -0
  184. package/lib/internal/data/core/data/executors/index.d.ts.map +1 -0
  185. package/lib/internal/data/core/data/executors/index.js +5 -0
  186. package/lib/internal/data/core/data/executors/index.js.map +1 -0
  187. package/lib/internal/data/core/data/executors/mockDataOperationExecutor.d.ts +21 -0
  188. package/lib/internal/data/core/data/executors/mockDataOperationExecutor.d.ts.map +1 -0
  189. package/lib/internal/data/core/data/executors/mockDataOperationExecutor.js +75 -0
  190. package/lib/internal/data/core/data/executors/mockDataOperationExecutor.js.map +1 -0
  191. package/lib/internal/data/core/error/codes.d.ts +31 -0
  192. package/lib/internal/data/core/error/codes.d.ts.map +1 -0
  193. package/lib/internal/data/core/error/codes.js +39 -0
  194. package/lib/internal/data/core/error/codes.js.map +1 -0
  195. package/lib/internal/data/core/error/constants.d.ts +30 -0
  196. package/lib/internal/data/core/error/constants.d.ts.map +1 -0
  197. package/lib/internal/data/core/error/constants.js +33 -0
  198. package/lib/internal/data/core/error/constants.js.map +1 -0
  199. package/lib/internal/data/core/error/error.d.ts +8 -0
  200. package/lib/internal/data/core/error/error.d.ts.map +1 -0
  201. package/lib/internal/data/core/error/error.js +8 -0
  202. package/lib/internal/data/core/error/error.js.map +1 -0
  203. package/lib/internal/data/core/error/messages.d.ts +24 -0
  204. package/lib/internal/data/core/error/messages.d.ts.map +1 -0
  205. package/lib/internal/data/core/error/messages.js +55 -0
  206. package/lib/internal/data/core/error/messages.js.map +1 -0
  207. package/lib/internal/data/core/error/types.d.ts +30 -0
  208. package/lib/internal/data/core/error/types.d.ts.map +1 -0
  209. package/lib/internal/data/core/error/types.js +28 -0
  210. package/lib/internal/data/core/error/types.js.map +1 -0
  211. package/lib/internal/data/core/error/util.d.ts +24 -0
  212. package/lib/internal/data/core/error/util.d.ts.map +1 -0
  213. package/lib/internal/data/core/error/util.js +71 -0
  214. package/lib/internal/data/core/error/util.js.map +1 -0
  215. package/lib/internal/data/core/metadata/runtimeDataSourceService.d.ts +65 -0
  216. package/lib/internal/data/core/metadata/runtimeDataSourceService.d.ts.map +1 -0
  217. package/lib/internal/data/core/metadata/runtimeDataSourceService.js +101 -0
  218. package/lib/internal/data/core/metadata/runtimeDataSourceService.js.map +1 -0
  219. package/lib/internal/data/core/metadata/runtimeMetadataOperations.d.ts +17 -0
  220. package/lib/internal/data/core/metadata/runtimeMetadataOperations.d.ts.map +1 -0
  221. package/lib/internal/data/core/metadata/runtimeMetadataOperations.js +34 -0
  222. package/lib/internal/data/core/metadata/runtimeMetadataOperations.js.map +1 -0
  223. package/lib/internal/data/core/runtime/getRuntimeContext.d.ts +11 -0
  224. package/lib/internal/data/core/runtime/getRuntimeContext.d.ts.map +1 -0
  225. package/lib/internal/data/core/runtime/getRuntimeContext.js +16 -0
  226. package/lib/internal/data/core/runtime/getRuntimeContext.js.map +1 -0
  227. package/lib/internal/data/core/runtime/initializeRuntime.d.ts +13 -0
  228. package/lib/internal/data/core/runtime/initializeRuntime.d.ts.map +1 -0
  229. package/lib/internal/data/core/runtime/initializeRuntime.js +38 -0
  230. package/lib/internal/data/core/runtime/initializeRuntime.js.map +1 -0
  231. package/lib/internal/data/core/runtime/powerDataRuntime.d.ts +68 -0
  232. package/lib/internal/data/core/runtime/powerDataRuntime.d.ts.map +1 -0
  233. package/lib/internal/data/core/runtime/powerDataRuntime.js +116 -0
  234. package/lib/internal/data/core/runtime/powerDataRuntime.js.map +1 -0
  235. package/lib/internal/data/core/runtime/powerDataRuntimeInstance.d.ts +20 -0
  236. package/lib/internal/data/core/runtime/powerDataRuntimeInstance.d.ts.map +1 -0
  237. package/lib/internal/data/core/runtime/powerDataRuntimeInstance.js +36 -0
  238. package/lib/internal/data/core/runtime/powerDataRuntimeInstance.js.map +1 -0
  239. package/lib/internal/data/core/runtime/powerDataSourcesInfoProvider.d.ts +34 -0
  240. package/lib/internal/data/core/runtime/powerDataSourcesInfoProvider.d.ts.map +1 -0
  241. package/lib/internal/data/core/runtime/powerDataSourcesInfoProvider.js +45 -0
  242. package/lib/internal/data/core/runtime/powerDataSourcesInfoProvider.js.map +1 -0
  243. package/lib/internal/data/core/runtimeClient/runtimeClientProvider.d.ts +43 -0
  244. package/lib/internal/data/core/runtimeClient/runtimeClientProvider.d.ts.map +1 -0
  245. package/lib/internal/data/core/runtimeClient/runtimeClientProvider.js +87 -0
  246. package/lib/internal/data/core/runtimeClient/runtimeClientProvider.js.map +1 -0
  247. package/lib/internal/data/core/runtimeClient/runtimeDataClient.d.ts +112 -0
  248. package/lib/internal/data/core/runtimeClient/runtimeDataClient.d.ts.map +1 -0
  249. package/lib/internal/data/core/runtimeClient/runtimeDataClient.js +457 -0
  250. package/lib/internal/data/core/runtimeClient/runtimeDataClient.js.map +1 -0
  251. package/lib/internal/data/core/runtimeClient/runtimeMetadataClient.d.ts +40 -0
  252. package/lib/internal/data/core/runtimeClient/runtimeMetadataClient.d.ts.map +1 -0
  253. package/lib/internal/data/core/runtimeClient/runtimeMetadataClient.js +94 -0
  254. package/lib/internal/data/core/runtimeClient/runtimeMetadataClient.js.map +1 -0
  255. package/lib/internal/data/core/telemetry/log.d.ts +20 -0
  256. package/lib/internal/data/core/telemetry/log.d.ts.map +1 -0
  257. package/lib/internal/data/core/telemetry/log.js +85 -0
  258. package/lib/internal/data/core/telemetry/log.js.map +1 -0
  259. package/lib/internal/data/core/types/index.d.ts +164 -0
  260. package/lib/internal/data/core/types/index.d.ts.map +1 -0
  261. package/lib/internal/data/core/types/index.js +7 -0
  262. package/lib/internal/data/core/types/index.js.map +1 -0
  263. package/lib/internal/plugin/PluginCommon.d.ts +16 -0
  264. package/lib/internal/plugin/PluginCommon.d.ts.map +1 -0
  265. package/lib/internal/plugin/PluginCommon.js +116 -0
  266. package/lib/internal/plugin/PluginCommon.js.map +1 -0
  267. package/lib/internal/plugin/PluginMobile.d.ts +13 -0
  268. package/lib/internal/plugin/PluginMobile.d.ts.map +1 -0
  269. package/lib/internal/plugin/PluginMobile.js +109 -0
  270. package/lib/internal/plugin/PluginMobile.js.map +1 -0
  271. package/lib/telemetry/Logger.types.d.ts +8 -0
  272. package/lib/telemetry/Logger.types.d.ts.map +1 -0
  273. package/lib/telemetry/Logger.types.js +5 -0
  274. package/lib/telemetry/Logger.types.js.map +1 -0
  275. package/lib/telemetry/LoggerManager.d.ts +6 -0
  276. package/lib/telemetry/LoggerManager.d.ts.map +1 -0
  277. package/lib/telemetry/LoggerManager.js +28 -0
  278. package/lib/telemetry/LoggerManager.js.map +1 -0
  279. package/lib/telemetry/Metrics.types.d.ts +53 -0
  280. package/lib/telemetry/Metrics.types.d.ts.map +1 -0
  281. package/lib/telemetry/Metrics.types.js +5 -0
  282. package/lib/telemetry/Metrics.types.js.map +1 -0
  283. package/lib/telemetry/Performance.d.ts +5 -0
  284. package/lib/telemetry/Performance.d.ts.map +1 -0
  285. package/lib/telemetry/Performance.js +47 -0
  286. package/lib/telemetry/Performance.js.map +1 -0
  287. package/lib/telemetry/index.d.ts +5 -0
  288. package/lib/telemetry/index.d.ts.map +1 -0
  289. package/lib/telemetry/index.js +5 -0
  290. package/lib/telemetry/index.js.map +1 -0
  291. package/package.json +44 -0
@@ -0,0 +1,65 @@
1
+ /*!
2
+ * Copyright (C) Microsoft Corporation. All rights reserved.
3
+ */
4
+ import { IPowerDataSourcesInfoProvider } from '../common/types';
5
+ import { DataSourcesInfo, IDataSourceInfo } from '../types';
6
+ /**
7
+ * Error types specific to RuntimeDataSourceService
8
+ */
9
+ export declare enum DataSourceServiceError {
10
+ }
11
+ /**
12
+ * RuntimeDataSourceService provides functionality for managing and retrieving
13
+ * data source information.
14
+ */
15
+ export declare class RuntimeDataSourceService {
16
+ private _powerDataSourcesInfoProvider;
17
+ /**
18
+ * Data source information
19
+ */
20
+ private _dataSourcesInfo;
21
+ /**
22
+ * Indicates whether the service has been initialized
23
+ */
24
+ private _isInitialized;
25
+ /**
26
+ * Creates a new instance of RuntimeDataSourceService
27
+ */
28
+ constructor(_powerDataSourcesInfoProvider: IPowerDataSourcesInfoProvider);
29
+ /**
30
+ * Initializes the service by loading user data sources
31
+ * @throws PowerDataRuntimeError if initialization fails
32
+ */
33
+ initialize(): Promise<void>;
34
+ /**
35
+ * Gets all user data sources
36
+ * @returns Array of data source information
37
+ * @throws PowerDataRuntimeError if service is not initialized
38
+ */
39
+ getUserDataSources(): Promise<DataSourcesInfo>;
40
+ /**
41
+ * Gets information for a specific data source
42
+ * @param dataSource - The ID of the data source
43
+ * @returns Data source information
44
+ * @throws PowerDataRuntimeError if data source is not found or service is not initialized
45
+ */
46
+ getDataSource(dataSource: string): Promise<IDataSourceInfo>;
47
+ /**
48
+ * Checks if a data source exists
49
+ * @param dataSourceId - The ID of the data source to check
50
+ * @returns True if the data source exists, false otherwise
51
+ * @throws PowerDataRuntimeError if service is not initialized
52
+ */
53
+ hasDataSource(dataSource: string): Promise<boolean>;
54
+ /**
55
+ * Ensures the service is initialized
56
+ * @throws PowerDataRuntimeError if service is not initialized
57
+ */
58
+ private _ensureInitialized;
59
+ /**
60
+ * Gets user data sources from the provided data source schemas
61
+ * @returns Promise resolving to array of data source information
62
+ */
63
+ private _getUserDataSources;
64
+ }
65
+ //# sourceMappingURL=runtimeDataSourceService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtimeDataSourceService.d.ts","sourceRoot":"","sources":["../../../../../src/internal/data/core/metadata/runtimeDataSourceService.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE5D;;GAEG;AACH,oBAAY,sBAAsB;CAAG;AAErC;;;GAGG;AACH,qBAAa,wBAAwB;IAavB,OAAO,CAAC,6BAA6B;IAZjD;;OAEG;IACH,OAAO,CAAC,gBAAgB,CAAkB;IAC1C;;OAEG;IACH,OAAO,CAAC,cAAc,CAAU;IAEhC;;OAEG;gBACiB,6BAA6B,EAAE,6BAA6B;IAKhF;;;OAGG;IACU,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAexC;;;;OAIG;IACU,kBAAkB,IAAI,OAAO,CAAC,eAAe,CAAC;IAM3D;;;;;OAKG;IACU,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAWxE;;;;;OAKG;IACU,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAMhE;;;OAGG;YACW,kBAAkB;IAMhC;;;OAGG;YACW,mBAAmB;CAIlC"}
@@ -0,0 +1,101 @@
1
+ /*!
2
+ * Copyright (C) Microsoft Corporation. All rights reserved.
3
+ */
4
+ import { ErrorCodes, getErrorMessage, PowerDataRuntimeError } from '../error/error';
5
+ /**
6
+ * Error types specific to RuntimeDataSourceService
7
+ */
8
+ export var DataSourceServiceError;
9
+ (function (DataSourceServiceError) {
10
+ })(DataSourceServiceError || (DataSourceServiceError = {}));
11
+ /**
12
+ * RuntimeDataSourceService provides functionality for managing and retrieving
13
+ * data source information.
14
+ */
15
+ export class RuntimeDataSourceService {
16
+ _powerDataSourcesInfoProvider;
17
+ /**
18
+ * Data source information
19
+ */
20
+ _dataSourcesInfo;
21
+ /**
22
+ * Indicates whether the service has been initialized
23
+ */
24
+ _isInitialized;
25
+ /**
26
+ * Creates a new instance of RuntimeDataSourceService
27
+ */
28
+ constructor(_powerDataSourcesInfoProvider) {
29
+ this._powerDataSourcesInfoProvider = _powerDataSourcesInfoProvider;
30
+ this._dataSourcesInfo = {};
31
+ this._isInitialized = false;
32
+ }
33
+ /**
34
+ * Initializes the service by loading user data sources
35
+ * @throws PowerDataRuntimeError if initialization fails
36
+ */
37
+ async initialize() {
38
+ try {
39
+ const userDataSources = await this._getUserDataSources();
40
+ this._dataSourcesInfo = {};
41
+ Object.keys(userDataSources).forEach((key) => {
42
+ this._dataSourcesInfo[key] = userDataSources[key];
43
+ });
44
+ this._isInitialized = true;
45
+ }
46
+ catch (error) {
47
+ throw new PowerDataRuntimeError(ErrorCodes.InitializationError, getErrorMessage(error));
48
+ }
49
+ }
50
+ /**
51
+ * Gets all user data sources
52
+ * @returns Array of data source information
53
+ * @throws PowerDataRuntimeError if service is not initialized
54
+ */
55
+ async getUserDataSources() {
56
+ await this._ensureInitialized();
57
+ return this._dataSourcesInfo;
58
+ }
59
+ /**
60
+ * Gets information for a specific data source
61
+ * @param dataSource - The ID of the data source
62
+ * @returns Data source information
63
+ * @throws PowerDataRuntimeError if data source is not found or service is not initialized
64
+ */
65
+ async getDataSource(dataSource) {
66
+ await this._ensureInitialized();
67
+ const dataSourceInfo = this._dataSourcesInfo[dataSource];
68
+ if (!dataSourceInfo) {
69
+ throw new PowerDataRuntimeError(ErrorCodes.DataSourceNotFound, dataSource);
70
+ }
71
+ return dataSourceInfo;
72
+ }
73
+ /**
74
+ * Checks if a data source exists
75
+ * @param dataSourceId - The ID of the data source to check
76
+ * @returns True if the data source exists, false otherwise
77
+ * @throws PowerDataRuntimeError if service is not initialized
78
+ */
79
+ async hasDataSource(dataSource) {
80
+ await this._ensureInitialized();
81
+ return dataSource in this._dataSourcesInfo;
82
+ }
83
+ /**
84
+ * Ensures the service is initialized
85
+ * @throws PowerDataRuntimeError if service is not initialized
86
+ */
87
+ async _ensureInitialized() {
88
+ if (!this._isInitialized) {
89
+ await this.initialize();
90
+ }
91
+ }
92
+ /**
93
+ * Gets user data sources from the provided data source schemas
94
+ * @returns Promise resolving to array of data source information
95
+ */
96
+ async _getUserDataSources() {
97
+ const dataSourcesInfo = await this._powerDataSourcesInfoProvider.getDataSourcesInfo();
98
+ return Promise.resolve(dataSourcesInfo);
99
+ }
100
+ }
101
+ //# sourceMappingURL=runtimeDataSourceService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtimeDataSourceService.js","sourceRoot":"","sources":["../../../../../src/internal/data/core/metadata/runtimeDataSourceService.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAIpF;;GAEG;AACH,MAAM,CAAN,IAAY,sBAAyB;AAArC,WAAY,sBAAsB;AAAE,CAAC,EAAzB,sBAAsB,KAAtB,sBAAsB,QAAG;AAErC;;;GAGG;AACH,MAAM,OAAO,wBAAwB;IAaf;IAZpB;;OAEG;IACK,gBAAgB,CAAkB;IAC1C;;OAEG;IACK,cAAc,CAAU;IAEhC;;OAEG;IACH,YAAoB,6BAA4D;QAA5D,kCAA6B,GAA7B,6BAA6B,CAA+B;QAC9E,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;QAC3B,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,UAAU;QACrB,IAAI;YACF,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAEzD,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;YAC3B,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;gBAC3C,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;YACpD,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;SAC5B;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,IAAI,qBAAqB,CAAC,UAAU,CAAC,mBAAmB,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;SACzF;IACH,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,kBAAkB;QAC7B,MAAM,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAEhC,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,aAAa,CAAC,UAAkB;QAC3C,MAAM,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAEhC,MAAM,cAAc,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QACzD,IAAI,CAAC,cAAc,EAAE;YACnB,MAAM,IAAI,qBAAqB,CAAC,UAAU,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;SAC5E;QAED,OAAO,cAAc,CAAC;IACxB,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,aAAa,CAAC,UAAkB;QAC3C,MAAM,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAEhC,OAAO,UAAU,IAAI,IAAI,CAAC,gBAAgB,CAAC;IAC7C,CAAC;IAED;;;OAGG;IACK,KAAK,CAAC,kBAAkB;QAC9B,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE;YACxB,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;SACzB;IACH,CAAC;IAED;;;OAGG;IACK,KAAK,CAAC,mBAAmB;QAC/B,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,6BAA6B,CAAC,kBAAkB,EAAE,CAAC;QACtF,OAAO,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IAC1C,CAAC;CACF"}
@@ -0,0 +1,17 @@
1
+ /*!
2
+ * Copyright (C) Microsoft Corporation. All rights reserved.
3
+ */
4
+ import { IRuntimeClientProvider } from '../common/types';
5
+ import { IConnectionApi, IConnectionReference, IMetadataOperations, IOperationContext } from '../common/types';
6
+ import { IOperationResult } from '../types';
7
+ /**
8
+ * RuntimeMetadataOperations provides functionality for retrieving metadata
9
+ * about connections and APIs.
10
+ */
11
+ export declare class RuntimeMetadataOperations implements IMetadataOperations {
12
+ private readonly _clientProvider;
13
+ constructor(_clientProvider: IRuntimeClientProvider);
14
+ getConnections(context?: IOperationContext): Promise<IOperationResult<IConnectionReference[]>>;
15
+ getConnectionApis(_connectionId: string, context?: IOperationContext): Promise<IOperationResult<IConnectionApi[]>>;
16
+ }
17
+ //# sourceMappingURL=runtimeMetadataOperations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtimeMetadataOperations.d.ts","sourceRoot":"","sources":["../../../../../src/internal/data/core/metadata/runtimeMetadataOperations.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C;;;GAGG;AACH,qBAAa,yBAA0B,YAAW,mBAAmB;IAGvD,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAAf,eAAe,EAAE,sBAAsB;IAEvD,cAAc,CACzB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,gBAAgB,CAAC,oBAAoB,EAAE,CAAC,CAAC;IAUvC,iBAAiB,CAC5B,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,gBAAgB,CAAC,cAAc,EAAE,CAAC,CAAC;CAS/C"}
@@ -0,0 +1,34 @@
1
+ /*!
2
+ * Copyright (C) Microsoft Corporation. All rights reserved.
3
+ */
4
+ /**
5
+ * RuntimeMetadataOperations provides functionality for retrieving metadata
6
+ * about connections and APIs.
7
+ */
8
+ export class RuntimeMetadataOperations {
9
+ _clientProvider;
10
+ // Static identifiers for services and actions
11
+ // Used to identify specific services and actions within the PowerApps environment
12
+ constructor(_clientProvider) {
13
+ this._clientProvider = _clientProvider;
14
+ }
15
+ async getConnections(context) {
16
+ const client = await this._clientProvider.getMetadataClientAsync();
17
+ const response = await client.getAppConnectionConfigsAsync(context);
18
+ return {
19
+ success: response.success,
20
+ data: response.data ? [response.data] : [],
21
+ error: response.error,
22
+ };
23
+ }
24
+ async getConnectionApis(_connectionId, context) {
25
+ const client = await this._clientProvider.getMetadataClientAsync();
26
+ const response = await client.getAppDataSourceConfigsAsync(context);
27
+ return {
28
+ success: response.success,
29
+ data: response.data ? [response.data] : [],
30
+ error: response.error,
31
+ };
32
+ }
33
+ }
34
+ //# sourceMappingURL=runtimeMetadataOperations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtimeMetadataOperations.js","sourceRoot":"","sources":["../../../../../src/internal/data/core/metadata/runtimeMetadataOperations.ts"],"names":[],"mappings":"AAAA;;GAEG;AAWH;;;GAGG;AACH,MAAM,OAAO,yBAAyB;IAGP;IAF7B,8CAA8C;IAC9C,kFAAkF;IAClF,YAA6B,eAAuC;QAAvC,oBAAe,GAAf,eAAe,CAAwB;IAAG,CAAC;IAEjE,KAAK,CAAC,cAAc,CACzB,OAA2B;QAE3B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,sBAAsB,EAAE,CAAC;QACnE,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAAC;QACpE,OAAO;YACL,OAAO,EAAE,QAAQ,CAAC,OAAO;YACzB,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;YAC1C,KAAK,EAAE,QAAQ,CAAC,KAAK;SACtB,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,iBAAiB,CAC5B,aAAqB,EACrB,OAA2B;QAE3B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,sBAAsB,EAAE,CAAC;QACnE,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAAC;QACpE,OAAO;YACL,OAAO,EAAE,QAAQ,CAAC,OAAO;YACzB,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAsB,CAAC,CAAC,CAAC,CAAC,EAAE;YAC5D,KAAK,EAAE,QAAQ,CAAC,KAAK;SACtB,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,11 @@
1
+ /*!
2
+ * Copyright (C) Microsoft Corporation. All rights reserved.
3
+ */
4
+ import type { DataSourcesInfo } from '../types';
5
+ import { PowerDataRuntime } from './powerDataRuntime';
6
+ /**
7
+ * Builds (or retrieves) a singleton runtime context based on provided data sources.
8
+ * Must be called after initializeRuntime() has injected the OperationExecutor.
9
+ */
10
+ export declare function getPowerSdkInstance(dataSourcesInfo: DataSourcesInfo): PowerDataRuntime;
11
+ //# sourceMappingURL=getRuntimeContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getRuntimeContext.d.ts","sourceRoot":"","sources":["../../../../../src/internal/data/core/runtime/getRuntimeContext.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,eAAe,GAAG,gBAAgB,CAKtF"}
@@ -0,0 +1,16 @@
1
+ /*!
2
+ * Copyright (C) Microsoft Corporation. All rights reserved.
3
+ */
4
+ import { getPowerDataRuntime } from './powerDataRuntimeInstance';
5
+ import { getExecutor } from './initializeRuntime';
6
+ import PowerDataSourcesInfoProvider from './powerDataSourcesInfoProvider';
7
+ /**
8
+ * Builds (or retrieves) a singleton runtime context based on provided data sources.
9
+ * Must be called after initializeRuntime() has injected the OperationExecutor.
10
+ */
11
+ export function getPowerSdkInstance(dataSourcesInfo) {
12
+ const executor = getExecutor(); // from initializeRuntime.ts
13
+ const provider = PowerDataSourcesInfoProvider.getInstance(dataSourcesInfo);
14
+ return getPowerDataRuntime(provider, executor);
15
+ }
16
+ //# sourceMappingURL=getRuntimeContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getRuntimeContext.js","sourceRoot":"","sources":["../../../../../src/internal/data/core/runtime/getRuntimeContext.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,4BAA4B,MAAM,gCAAgC,CAAC;AAI1E;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,eAAgC;IAClE,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC,CAAC,4BAA4B;IAC5D,MAAM,QAAQ,GAAG,4BAA4B,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IAE3E,OAAO,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AACjD,CAAC"}
@@ -0,0 +1,13 @@
1
+ /*!
2
+ * Copyright (C) Microsoft Corporation. All rights reserved.
3
+ */
4
+ import { IPowerOperationExecutor } from '../types';
5
+ /**
6
+ * Initializes the PowerDataRuntime with the provided executor.
7
+ * This function should be called once at the start of the application.
8
+ * @param executor - The executor to be used for operations.
9
+ * @throws Will throw an error if the executor is already initialized.
10
+ */
11
+ export declare function initializeRuntime(executor: IPowerOperationExecutor): void;
12
+ export declare function getExecutor(): IPowerOperationExecutor;
13
+ //# sourceMappingURL=initializeRuntime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initializeRuntime.d.ts","sourceRoot":"","sources":["../../../../../src/internal/data/core/runtime/initializeRuntime.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAOnD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,uBAAuB,GAAG,IAAI,CAczE;AASD,wBAAgB,WAAW,IAAI,uBAAuB,CAQrD"}
@@ -0,0 +1,38 @@
1
+ /*!
2
+ * Copyright (C) Microsoft Corporation. All rights reserved.
3
+ */
4
+ import { ErrorCodes, PowerDataRuntimeError } from '../error/error';
5
+ // _executor is a private variable that holds the instance of IPowerOperationExecutor.
6
+ let _executor;
7
+ // _initialized is a private variable that indicates whether the runtime has been initialized.
8
+ let _initialized = false;
9
+ /**
10
+ * Initializes the PowerDataRuntime with the provided executor.
11
+ * This function should be called once at the start of the application.
12
+ * @param executor - The executor to be used for operations.
13
+ * @throws Will throw an error if the executor is already initialized.
14
+ */
15
+ export function initializeRuntime(executor) {
16
+ if (_initialized) {
17
+ return;
18
+ }
19
+ if (!executor) {
20
+ throw new PowerDataRuntimeError(ErrorCodes.InvalidOperationExecutor, 'PowerDataRuntime is not initialized. Please call initializeRuntime() first.');
21
+ }
22
+ _executor = executor;
23
+ _initialized = true;
24
+ }
25
+ /*
26
+ * Retrieves the current executor.
27
+ * This function should be called after initializeRuntime() to get the executor.
28
+ *
29
+ * @returns The current executor.
30
+ * @throws Will throw an error if the executor is not initialized.
31
+ */
32
+ export function getExecutor() {
33
+ if (!_executor) {
34
+ throw new PowerDataRuntimeError(ErrorCodes.InvalidOperationExecutor, 'PowerDataRuntime is not initialized. Please call initializeRuntime() first.');
35
+ }
36
+ return _executor;
37
+ }
38
+ //# sourceMappingURL=initializeRuntime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initializeRuntime.js","sourceRoot":"","sources":["../../../../../src/internal/data/core/runtime/initializeRuntime.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAGnE,sFAAsF;AACtF,IAAI,SAA8C,CAAC;AACnD,8FAA8F;AAC9F,IAAI,YAAY,GAAG,KAAK,CAAC;AAEzB;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAAiC;IACjE,IAAI,YAAY,EAAE;QAChB,OAAO;KACR;IAED,IAAI,CAAC,QAAQ,EAAE;QACb,MAAM,IAAI,qBAAqB,CAC7B,UAAU,CAAC,wBAAwB,EACnC,6EAA6E,CAC9E,CAAC;KACH;IAED,SAAS,GAAG,QAAQ,CAAC;IACrB,YAAY,GAAG,IAAI,CAAC;AACtB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,WAAW;IACzB,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,IAAI,qBAAqB,CAC7B,UAAU,CAAC,wBAAwB,EACnC,6EAA6E,CAC9E,CAAC;KACH;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,68 @@
1
+ /*!
2
+ * Copyright (C) Microsoft Corporation. All rights reserved.
3
+ */
4
+ import { IMetadataOperations, IPowerDataSourcesInfoProvider, IXrmContext } from '../common/types';
5
+ import { IClientConfig } from '../common/types';
6
+ import { IDataOperationOrchestrator, IPowerDataRuntime, IPowerOperationExecutor } from '../types';
7
+ /**
8
+ * Interface for PowerDataRuntime initialization parameters
9
+ */
10
+ export interface IPowerDataRuntimeInitParams {
11
+ powerDataSourcesInfoProvider: IPowerDataSourcesInfoProvider;
12
+ powerOperationExecutor: IPowerOperationExecutor;
13
+ xrm: IXrmContext;
14
+ clientConfig?: IClientConfig;
15
+ }
16
+ /**
17
+ * PowerDataRuntime provides a unified interface for data and metadata operations
18
+ * in the Power runtime environment.
19
+ */
20
+ export declare class PowerDataRuntime implements IPowerDataRuntime {
21
+ private readonly _clientProvider;
22
+ private readonly _dataSourceService;
23
+ private readonly _xrm;
24
+ private _dataOperations?;
25
+ private _metadataOperations?;
26
+ private _isInitialized;
27
+ /**
28
+ * Creates a new instance of PowerDataRuntime
29
+ * @param params - Initialization parameters
30
+ * @throws DataRuntimeError if initialization fails
31
+ */
32
+ constructor(params: IPowerDataRuntimeInitParams);
33
+ /**
34
+ * Gets the Data operations interface
35
+ * @throws PowerDataRuntimeError if operations are not initialized
36
+ */
37
+ get Data(): IDataOperationOrchestrator;
38
+ /**
39
+ * Gets the Metadata operations interface
40
+ * @throws PowerDataRuntimeError if operations are not initialized
41
+ */
42
+ get Metadata(): IMetadataOperations;
43
+ /**
44
+ * Validates initialization parameters
45
+ * @param params - Parameters to validate
46
+ * @throws PowerDataRuntimeError if validation fails
47
+ */
48
+ private _validateInitParams;
49
+ /**
50
+ * Ensures the PowerDataRuntime is initialized
51
+ * @throws PowerDataRuntimeError if not initialized
52
+ */
53
+ private _ensureInitialized;
54
+ /**
55
+ * Initializes the PowerDataRuntime components
56
+ * @throws PowerDataRuntimeError if initialization fails
57
+ */
58
+ private _initialize;
59
+ /**
60
+ * Creates a new instance of DataOperations
61
+ */
62
+ private _createDataOperations;
63
+ /**
64
+ * Creates a new instance of MetadataOperations
65
+ */
66
+ private _createMetadataOperations;
67
+ }
68
+ //# sourceMappingURL=powerDataRuntime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"powerDataRuntime.d.ts","sourceRoot":"","sources":["../../../../../src/internal/data/core/runtime/powerDataRuntime.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,mBAAmB,EACnB,6BAA6B,EAE7B,WAAW,EACZ,MAAM,iBAAiB,CAAC;AAIzB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIhD,OAAO,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAIlG;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,4BAA4B,EAAE,6BAA6B,CAAC;IAC5D,sBAAsB,EAAE,uBAAuB,CAAC;IAChD,GAAG,EAAE,WAAW,CAAC;IACjB,YAAY,CAAC,EAAE,aAAa,CAAC;CAC9B;AAED;;;GAGG;AACH,qBAAa,gBAAiB,YAAW,iBAAiB;IACxD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAyB;IACzD,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA2B;IAC9D,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAc;IACnC,OAAO,CAAC,eAAe,CAAC,CAA6B;IACrD,OAAO,CAAC,mBAAmB,CAAC,CAAsB;IAClD,OAAO,CAAC,cAAc,CAAU;IAEhC;;;;OAIG;gBACS,MAAM,EAAE,2BAA2B;IAoB/C;;;OAGG;IACH,IAAW,IAAI,IAAI,0BAA0B,CAM5C;IAED;;;OAGG;IACH,IAAW,QAAQ,IAAI,mBAAmB,CAMzC;IAED;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;IAM3B;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAM1B;;;OAGG;IACH,OAAO,CAAC,WAAW;IAUnB;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAiB7B;;OAEG;IACH,OAAO,CAAC,yBAAyB;CAGlC"}
@@ -0,0 +1,116 @@
1
+ /*!
2
+ * Copyright (C) Microsoft Corporation. All rights reserved.
3
+ */
4
+ import { DefaultDataOperationOrchestrator } from '../data/defaultOperationOrchestrator';
5
+ import { RuntimeMetadataOperations } from '../metadata/runtimeMetadataOperations';
6
+ import { RuntimeClientProvider } from '../runtimeClient/runtimeClientProvider';
7
+ import { DataverseDataOperationExecutor } from '../data/executors/dataverseDataOperationExecutor';
8
+ import { ConnectorDataOperationExecutor } from '../data/executors/connectorDataOperationExecutor';
9
+ import { RuntimeDataSourceService } from '../metadata/runtimeDataSourceService';
10
+ import { Log } from '../telemetry/log';
11
+ import { ErrorCodes, getErrorMessage, PowerDataRuntimeError } from '../error/error';
12
+ /**
13
+ * PowerDataRuntime provides a unified interface for data and metadata operations
14
+ * in the Power runtime environment.
15
+ */
16
+ export class PowerDataRuntime {
17
+ _clientProvider;
18
+ _dataSourceService;
19
+ _xrm;
20
+ _dataOperations;
21
+ _metadataOperations;
22
+ _isInitialized;
23
+ /**
24
+ * Creates a new instance of PowerDataRuntime
25
+ * @param params - Initialization parameters
26
+ * @throws DataRuntimeError if initialization fails
27
+ */
28
+ constructor(params) {
29
+ try {
30
+ this._validateInitParams(params);
31
+ // Initialize the telemetry logger
32
+ Log.createInstance(params.powerOperationExecutor);
33
+ this._clientProvider = new RuntimeClientProvider(params.powerOperationExecutor);
34
+ this._dataSourceService = new RuntimeDataSourceService(params.powerDataSourcesInfoProvider);
35
+ this._xrm = params.xrm;
36
+ this._isInitialized = false;
37
+ this._initialize();
38
+ }
39
+ catch (error) {
40
+ if (error instanceof Error) {
41
+ Log.trackException(error);
42
+ }
43
+ throw error;
44
+ }
45
+ }
46
+ /**
47
+ * Gets the Data operations interface
48
+ * @throws PowerDataRuntimeError if operations are not initialized
49
+ */
50
+ get Data() {
51
+ this._ensureInitialized();
52
+ if (!this._dataOperations) {
53
+ this._dataOperations = this._createDataOperations();
54
+ }
55
+ return this._dataOperations;
56
+ }
57
+ /**
58
+ * Gets the Metadata operations interface
59
+ * @throws PowerDataRuntimeError if operations are not initialized
60
+ */
61
+ get Metadata() {
62
+ this._ensureInitialized();
63
+ if (!this._metadataOperations) {
64
+ this._metadataOperations = this._createMetadataOperations();
65
+ }
66
+ return this._metadataOperations;
67
+ }
68
+ /**
69
+ * Validates initialization parameters
70
+ * @param params - Parameters to validate
71
+ * @throws PowerDataRuntimeError if validation fails
72
+ */
73
+ _validateInitParams(params) {
74
+ if (!params.xrm) {
75
+ throw new PowerDataRuntimeError(ErrorCodes.InvalidXrmInfo);
76
+ }
77
+ }
78
+ /**
79
+ * Ensures the PowerDataRuntime is initialized
80
+ * @throws PowerDataRuntimeError if not initialized
81
+ */
82
+ _ensureInitialized() {
83
+ if (!this._isInitialized) {
84
+ throw new PowerDataRuntimeError(ErrorCodes.OperationsNotInitialized);
85
+ }
86
+ }
87
+ /**
88
+ * Initializes the PowerDataRuntime components
89
+ * @throws PowerDataRuntimeError if initialization fails
90
+ */
91
+ _initialize() {
92
+ try {
93
+ this._dataOperations = this._createDataOperations();
94
+ this._metadataOperations = this._createMetadataOperations();
95
+ this._isInitialized = true;
96
+ }
97
+ catch (error) {
98
+ throw new PowerDataRuntimeError(ErrorCodes.InitializationFailed, getErrorMessage(error));
99
+ }
100
+ }
101
+ /**
102
+ * Creates a new instance of DataOperations
103
+ */
104
+ _createDataOperations() {
105
+ const dataverseOperation = new DataverseDataOperationExecutor(this._xrm, this._dataSourceService, this._clientProvider);
106
+ const connectorOperation = new ConnectorDataOperationExecutor(this._clientProvider, this._dataSourceService);
107
+ return new DefaultDataOperationOrchestrator(dataverseOperation, connectorOperation, this._dataSourceService);
108
+ }
109
+ /**
110
+ * Creates a new instance of MetadataOperations
111
+ */
112
+ _createMetadataOperations() {
113
+ return new RuntimeMetadataOperations(this._clientProvider);
114
+ }
115
+ }
116
+ //# sourceMappingURL=powerDataRuntime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"powerDataRuntime.js","sourceRoot":"","sources":["../../../../../src/internal/data/core/runtime/powerDataRuntime.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,20 @@
1
+ /*!
2
+ * Copyright (C) Microsoft Corporation. All rights reserved.
3
+ */
4
+ import { PowerDataRuntime } from './powerDataRuntime';
5
+ import { IPowerDataSourcesInfoProvider, IXrmContext } from '../common/types';
6
+ import { IPowerOperationExecutor } from '../types';
7
+ /**
8
+ * Gets or creates a singleton instance of PowerDataRuntime
9
+ * @param powerDataSourcesInfoProvider - Data sources info provider to initialize the PowerDataRuntime
10
+ * @param powerOperationExecutor - Optional power operation executor to initialize the PowerDataRuntime
11
+ * @param xrm - Optional xrm object to initialize the PowerDataRuntime
12
+ * @returns PowerDataRuntime instance
13
+ */
14
+ export declare function getPowerDataRuntime(powerDataSourcesInfoProvider: IPowerDataSourcesInfoProvider, powerOperationExecutor: IPowerOperationExecutor, xrm?: IXrmContext): PowerDataRuntime;
15
+ /**
16
+ * Resets the PowerDataRuntime singleton instance.
17
+ * Useful for testing or reinitialization.
18
+ */
19
+ export declare function resetPowerDataRuntimeInstance(): void;
20
+ //# sourceMappingURL=powerDataRuntimeInstance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"powerDataRuntimeInstance.d.ts","sourceRoot":"","sources":["../../../../../src/internal/data/core/runtime/powerDataRuntimeInstance.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,6BAA6B,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAQnD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,4BAA4B,EAAE,6BAA6B,EAC3D,sBAAsB,EAAE,uBAAuB,EAC/C,GAAG,CAAC,EAAE,WAAW,GAChB,gBAAgB,CASlB;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,IAAI,IAAI,CAIpD"}
@@ -0,0 +1,36 @@
1
+ /*!
2
+ * Copyright (C) Microsoft Corporation. All rights reserved.
3
+ */
4
+ import { PowerDataRuntime } from './powerDataRuntime';
5
+ import { Log } from '../telemetry/log';
6
+ /**
7
+ * Singleton instance of PowerDataRuntime
8
+ */
9
+ let powerDataRuntimeInstance;
10
+ /**
11
+ * Gets or creates a singleton instance of PowerDataRuntime
12
+ * @param powerDataSourcesInfoProvider - Data sources info provider to initialize the PowerDataRuntime
13
+ * @param powerOperationExecutor - Optional power operation executor to initialize the PowerDataRuntime
14
+ * @param xrm - Optional xrm object to initialize the PowerDataRuntime
15
+ * @returns PowerDataRuntime instance
16
+ */
17
+ export function getPowerDataRuntime(powerDataSourcesInfoProvider, powerOperationExecutor, xrm) {
18
+ if (!powerDataRuntimeInstance) {
19
+ powerDataRuntimeInstance = new PowerDataRuntime({
20
+ powerDataSourcesInfoProvider,
21
+ powerOperationExecutor,
22
+ xrm: xrm ?? { WebApi: {} },
23
+ });
24
+ }
25
+ return powerDataRuntimeInstance;
26
+ }
27
+ /**
28
+ * Resets the PowerDataRuntime singleton instance.
29
+ * Useful for testing or reinitialization.
30
+ */
31
+ export function resetPowerDataRuntimeInstance() {
32
+ powerDataRuntimeInstance = undefined;
33
+ // Reset the Log instance as well to ensure a clean state
34
+ Log.resetInstance();
35
+ }
36
+ //# sourceMappingURL=powerDataRuntimeInstance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"powerDataRuntimeInstance.js","sourceRoot":"","sources":["../../../../../src/internal/data/core/runtime/powerDataRuntimeInstance.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAEvC;;GAEG;AACH,IAAI,wBAAsD,CAAC;AAE3D;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CACjC,4BAA2D,EAC3D,sBAA+C,EAC/C,GAAiB;IAEjB,IAAI,CAAC,wBAAwB,EAAE;QAC7B,wBAAwB,GAAG,IAAI,gBAAgB,CAAC;YAC9C,4BAA4B;YAC5B,sBAAsB;YACtB,GAAG,EAAE,GAAG,IAAK,EAAE,MAAM,EAAE,EAAE,EAAkB;SAC5C,CAAC,CAAC;KACJ;IACD,OAAO,wBAAwB,CAAC;AAClC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,6BAA6B;IAC3C,wBAAwB,GAAG,SAAS,CAAC;IACrC,yDAAyD;IACzD,GAAG,CAAC,aAAa,EAAE,CAAC;AACtB,CAAC"}
@@ -0,0 +1,34 @@
1
+ /*!
2
+ * Copyright (C) Microsoft Corporation. All rights reserved.
3
+ */
4
+ import { IPowerDataSourcesInfoProvider } from '../common/types';
5
+ import { DataSourcesInfo } from '../types';
6
+ /**
7
+ * Singleton provider for managing data sources information.
8
+ */
9
+ declare class PowerDataSourcesInfoProvider implements IPowerDataSourcesInfoProvider {
10
+ private static instance;
11
+ private dataSourcesInfo;
12
+ /**
13
+ * Private constructor to enforce the singleton pattern.
14
+ * @param dataSourcesInfo The data sources information to initialize the provider with.
15
+ */
16
+ private constructor();
17
+ /**
18
+ * Retrieves the singleton instance of PowerDataSourcesInfoProvider.
19
+ * If the instance does not exist, it initializes it with the provided data sources info.
20
+ *
21
+ * @param dataSourcesInfo Optional parameter to initialize the instance if it doesn't exist.
22
+ * @returns The singleton instance of PowerDataSourcesInfoProvider.
23
+ * @throws Error if the instance is not initialized and no dataSourcesInfo is provided.
24
+ */
25
+ static getInstance(dataSourcesInfo?: DataSourcesInfo): PowerDataSourcesInfoProvider;
26
+ /**
27
+ * Retrieves the data sources information.
28
+ *
29
+ * @returns A promise resolving to the data sources information.
30
+ */
31
+ getDataSourcesInfo(): Promise<DataSourcesInfo>;
32
+ }
33
+ export default PowerDataSourcesInfoProvider;
34
+ //# sourceMappingURL=powerDataSourcesInfoProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"powerDataSourcesInfoProvider.d.ts","sourceRoot":"","sources":["../../../../../src/internal/data/core/runtime/powerDataSourcesInfoProvider.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG3C;;GAEG;AACH,cAAM,4BAA6B,YAAW,6BAA6B;IACzE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAA6C;IACpE,OAAO,CAAC,eAAe,CAAkB;IAEzC;;;OAGG;IACH,OAAO;IAIP;;;;;;;OAOG;WACW,WAAW,CAAC,eAAe,CAAC,EAAE,eAAe,GAAG,4BAA4B;IAU1F;;;;OAIG;IACU,kBAAkB,IAAI,OAAO,CAAC,eAAe,CAAC;CAG5D;AAED,eAAe,4BAA4B,CAAC"}