@microsoft/power-apps-cli 0.5.3 → 0.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Constants/HelpStrings.d.ts +3 -3
- package/lib/Constants/HelpStrings.js +3 -3
- package/lib/Constants/HelpStrings.js.map +1 -1
- package/lib/HttpClient/CliHttpClient.d.ts.map +1 -1
- package/lib/HttpClient/CliHttpClient.js +8 -1
- package/lib/HttpClient/CliHttpClient.js.map +1 -1
- package/lib/Verbs/AddDataSource.d.ts.map +1 -1
- package/lib/Verbs/AddDataSource.js +25 -18
- package/lib/Verbs/AddDataSource.js.map +1 -1
- package/lib/Verbs/DeleteDataSource.d.ts +1 -1
- package/lib/Verbs/DeleteDataSource.d.ts.map +1 -1
- package/lib/Verbs/DeleteDataSource.js +5 -4
- package/lib/Verbs/DeleteDataSource.js.map +1 -1
- package/lib/Verbs/Init.d.ts.map +1 -1
- package/lib/Verbs/Init.js +20 -0
- package/lib/Verbs/Init.js.map +1 -1
- package/lib/Verbs/ListConnectionReferences.js +6 -6
- package/lib/Verbs/ListConnectionReferences.js.map +1 -1
- package/lib/Verbs/ListEnvironmentVariables.js +6 -6
- package/lib/Verbs/ListEnvironmentVariables.js.map +1 -1
- package/lib/Verbs/Push.js +7 -10
- package/lib/Verbs/Push.js.map +1 -1
- package/lib/Verbs/VerbConstants.d.ts +1 -1
- package/lib/Verbs/VerbConstants.js +3 -3
- package/lib/Verbs/VerbConstants.js.map +1 -1
- package/lib/__tests__/E2eTests/addAndDeleteDataverseDS.test.js +4 -3
- package/lib/__tests__/E2eTests/addAndDeleteDataverseDS.test.js.map +1 -1
- package/lib/__tests__/E2eTests/addTop10Datasources.test.js +3 -2
- package/lib/__tests__/E2eTests/addTop10Datasources.test.js.map +1 -1
- package/lib/__tests__/E2eTests/cliHelp.test.js +4 -11
- package/lib/__tests__/E2eTests/cliHelp.test.js.map +1 -1
- package/lib/__tests__/helpers/e2eTestHelpers.d.ts +24 -0
- package/lib/__tests__/helpers/e2eTestHelpers.d.ts.map +1 -0
- package/lib/__tests__/helpers/e2eTestHelpers.js +28 -0
- package/lib/__tests__/helpers/e2eTestHelpers.js.map +1 -0
- package/lib-cjs/Constants/HelpStrings.d.ts +3 -3
- package/lib-cjs/Constants/HelpStrings.js +3 -3
- package/lib-cjs/Constants/HelpStrings.js.map +1 -1
- package/lib-cjs/HttpClient/CliHttpClient.d.ts.map +1 -1
- package/lib-cjs/HttpClient/CliHttpClient.js +8 -2
- package/lib-cjs/HttpClient/CliHttpClient.js.map +1 -1
- package/lib-cjs/Verbs/AddDataSource.d.ts.map +1 -1
- package/lib-cjs/Verbs/AddDataSource.js +44 -48
- package/lib-cjs/Verbs/AddDataSource.js.map +1 -1
- package/lib-cjs/Verbs/DeleteDataSource.d.ts +1 -1
- package/lib-cjs/Verbs/DeleteDataSource.d.ts.map +1 -1
- package/lib-cjs/Verbs/DeleteDataSource.js +15 -19
- package/lib-cjs/Verbs/DeleteDataSource.js.map +1 -1
- package/lib-cjs/Verbs/Init.d.ts.map +1 -1
- package/lib-cjs/Verbs/Init.js +39 -8
- package/lib-cjs/Verbs/Init.js.map +1 -1
- package/lib-cjs/Verbs/ListConnectionReferences.js +6 -6
- package/lib-cjs/Verbs/ListConnectionReferences.js.map +1 -1
- package/lib-cjs/Verbs/ListEnvironmentVariables.js +6 -6
- package/lib-cjs/Verbs/ListEnvironmentVariables.js.map +1 -1
- package/lib-cjs/Verbs/Push.js +11 -16
- package/lib-cjs/Verbs/Push.js.map +1 -1
- package/lib-cjs/Verbs/VerbConstants.d.ts +1 -1
- package/lib-cjs/Verbs/VerbConstants.js +3 -3
- package/lib-cjs/Verbs/VerbConstants.js.map +1 -1
- package/lib-cjs/__tests__/E2eTests/addAndDeleteDataverseDS.test.js +3 -2
- package/lib-cjs/__tests__/E2eTests/addAndDeleteDataverseDS.test.js.map +1 -1
- package/lib-cjs/__tests__/E2eTests/addTop10Datasources.test.js +2 -1
- package/lib-cjs/__tests__/E2eTests/addTop10Datasources.test.js.map +1 -1
- package/lib-cjs/__tests__/E2eTests/cliHelp.test.js +4 -11
- package/lib-cjs/__tests__/E2eTests/cliHelp.test.js.map +1 -1
- package/lib-cjs/__tests__/helpers/e2eTestHelpers.d.ts +23 -0
- package/lib-cjs/__tests__/helpers/e2eTestHelpers.d.ts.map +1 -0
- package/lib-cjs/__tests__/helpers/e2eTestHelpers.js +31 -0
- package/lib-cjs/__tests__/helpers/e2eTestHelpers.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/README.md +193 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties-4.3.9.gbl.js +4844 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties-4.3.9.gbl.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties-4.3.9.gbl.min.js +7 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties-4.3.9.gbl.min.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties-4.3.9.integrity.json +46 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties-4.3.9.js +4848 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties-4.3.9.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties-4.3.9.min.js +7 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties-4.3.9.min.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties.gbl.js +4844 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties.gbl.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties.gbl.min.js +7 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties.gbl.min.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties.integrity.json +46 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties.js +4848 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties.min.js +7 -0
- package/node_modules/@microsoft/1ds-properties-js/bundle/es5/ms.properties.min.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist/es5/ms.properties.js +4827 -0
- package/node_modules/@microsoft/1ds-properties-js/dist/es5/ms.properties.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist/es5/ms.properties.min.js +7 -0
- package/node_modules/@microsoft/1ds-properties-js/dist/es5/ms.properties.min.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/DataModels.js +13 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/DataModels.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/ExtensionKeys.js +95 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/ExtensionKeys.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/Index.js +16 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/Index.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/InternalConstants.js +30 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/InternalConstants.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/PropertiesPlugin.js +200 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/PropertiesPlugin.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/SessionManager.js +168 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/SessionManager.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/TelemetryContext.js +286 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/TelemetryContext.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/Utils.js +106 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/Utils.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Application.js +178 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Application.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Cloud.js +17 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Cloud.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Device.js +17 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Device.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/IntWeb.js +58 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/IntWeb.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Loc.js +29 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Loc.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/OperatingSystem.js +176 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/OperatingSystem.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Sdk.js +71 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Sdk.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Session.js +47 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Session.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Trace.js +36 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Trace.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/User.js +102 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/User.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Utc.js +64 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Utc.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Web.js +274 -0
- package/node_modules/@microsoft/1ds-properties-js/dist-es5/context/Web.js.map +1 -0
- package/node_modules/@microsoft/1ds-properties-js/package.json +65 -0
- package/node_modules/@microsoft/1ds-properties-js/tsconfig.json +27 -0
- package/node_modules/@microsoft/1ds-properties-js/types/1ds-properties-js.d.ts +706 -0
- package/node_modules/@microsoft/1ds-properties-js/types/1ds-properties-js.namespaced.d.ts +2908 -0
- package/node_modules/@microsoft/powerapps-data/package.json +3 -3
- package/node_modules/@microsoft/powerapps-player-actions/lib/Actions/AddDataSource.js +31 -25
- package/node_modules/@microsoft/powerapps-player-actions/lib/Actions/AddDataSource.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib/Actions/DataUtils.d.ts +6 -4
- package/node_modules/@microsoft/powerapps-player-actions/lib/Actions/DataUtils.d.ts.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib/Actions/DataUtils.js +11 -5
- package/node_modules/@microsoft/powerapps-player-actions/lib/Actions/DataUtils.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib/Actions/DeleteDataSource.js +3 -3
- package/node_modules/@microsoft/powerapps-player-actions/lib/Actions/DeleteDataSource.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib/Actions/PushApp.js +10 -3
- package/node_modules/@microsoft/powerapps-player-actions/lib/Actions/PushApp.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib/CodeGen/codeGenUtils.d.ts +20 -0
- package/node_modules/@microsoft/powerapps-player-actions/lib/CodeGen/codeGenUtils.d.ts.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib/CodeGen/codeGenUtils.js +79 -0
- package/node_modules/@microsoft/powerapps-player-actions/lib/CodeGen/codeGenUtils.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib/CodeGen/dataSourceInfoProcessor.d.ts +2 -2
- package/node_modules/@microsoft/powerapps-player-actions/lib/CodeGen/dataSourceInfoProcessor.d.ts.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib/CodeGen/dataSourceInfoProcessor.js +27 -68
- package/node_modules/@microsoft/powerapps-player-actions/lib/CodeGen/dataSourceInfoProcessor.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib/CodeGen/modelServiceGenerator.d.ts +0 -59
- package/node_modules/@microsoft/powerapps-player-actions/lib/CodeGen/modelServiceGenerator.d.ts.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib/CodeGen/modelServiceGenerator.js +69 -281
- package/node_modules/@microsoft/powerapps-player-actions/lib/CodeGen/modelServiceGenerator.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib/CodeGen/nameUtility.d.ts +26 -0
- package/node_modules/@microsoft/powerapps-player-actions/lib/CodeGen/nameUtility.d.ts.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib/CodeGen/nameUtility.js +153 -0
- package/node_modules/@microsoft/powerapps-player-actions/lib/CodeGen/nameUtility.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib/Types/ActionTypes.d.ts +16 -11
- package/node_modules/@microsoft/powerapps-player-actions/lib/Types/ActionTypes.d.ts.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib/__tests__/AddDataSource.spec.js +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib/__tests__/AddDataSource.spec.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib/__tests__/AzureDevOpsModelServiceGenerator.spec.d.ts +5 -0
- package/node_modules/@microsoft/powerapps-player-actions/lib/__tests__/AzureDevOpsModelServiceGenerator.spec.d.ts.map +1 -0
- package/node_modules/@microsoft/powerapps-player-actions/lib/__tests__/AzureDevOpsModelServiceGenerator.spec.js +93 -0
- package/node_modules/@microsoft/powerapps-player-actions/lib/__tests__/AzureDevOpsModelServiceGenerator.spec.js.map +1 -0
- package/node_modules/@microsoft/powerapps-player-actions/lib/__tests__/DataSourceInfoProcessor.spec.js +897 -2
- package/node_modules/@microsoft/powerapps-player-actions/lib/__tests__/DataSourceInfoProcessor.spec.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib/__tests__/ModelServiceGenerator.spec.js +1 -17
- package/node_modules/@microsoft/powerapps-player-actions/lib/__tests__/ModelServiceGenerator.spec.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib/__tests__/arrayTypeGeneration.spec.d.ts +5 -0
- package/node_modules/@microsoft/powerapps-player-actions/lib/__tests__/arrayTypeGeneration.spec.d.ts.map +1 -0
- package/node_modules/@microsoft/powerapps-player-actions/lib/__tests__/arrayTypeGeneration.spec.js +63 -0
- package/node_modules/@microsoft/powerapps-player-actions/lib/__tests__/arrayTypeGeneration.spec.js.map +1 -0
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/Actions/AddDataSource.js +104 -86
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/Actions/AddDataSource.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/Actions/DataUtils.d.ts +6 -4
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/Actions/DataUtils.d.ts.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/Actions/DataUtils.js +26 -4
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/Actions/DataUtils.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/Actions/DeleteDataSource.js +52 -46
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/Actions/DeleteDataSource.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/Actions/PushApp.js +9 -4
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/Actions/PushApp.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/CodeGen/codeGenUtils.d.ts +20 -0
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/CodeGen/codeGenUtils.d.ts.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/CodeGen/codeGenUtils.js +86 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/CodeGen/codeGenUtils.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/CodeGen/dataSourceInfoProcessor.d.ts +2 -2
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/CodeGen/dataSourceInfoProcessor.d.ts.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/CodeGen/dataSourceInfoProcessor.js +25 -67
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/CodeGen/dataSourceInfoProcessor.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/CodeGen/modelServiceGenerator.d.ts +0 -59
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/CodeGen/modelServiceGenerator.d.ts.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/CodeGen/modelServiceGenerator.js +65 -279
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/CodeGen/modelServiceGenerator.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/CodeGen/nameUtility.d.ts +26 -0
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/CodeGen/nameUtility.d.ts.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/CodeGen/nameUtility.js +161 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/CodeGen/nameUtility.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/Types/ActionTypes.d.ts +16 -11
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/Types/ActionTypes.d.ts.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/__tests__/AddDataSource.spec.js +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/__tests__/AddDataSource.spec.js.map +1 -1
- package/node_modules/@microsoft/{powerapps-data/lib/components/codeGen/dataSourceInfo.js → powerapps-player-actions/lib-cjs/__tests__/AzureDevOpsModelServiceGenerator.spec.d.ts} +0 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/__tests__/AzureDevOpsModelServiceGenerator.spec.d.ts.map +1 -0
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/__tests__/AzureDevOpsModelServiceGenerator.spec.js +206 -0
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/__tests__/AzureDevOpsModelServiceGenerator.spec.js.map +1 -0
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/__tests__/DataSourceInfoProcessor.spec.js +1277 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/__tests__/DataSourceInfoProcessor.spec.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/__tests__/ModelServiceGenerator.spec.js +0 -32
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/__tests__/ModelServiceGenerator.spec.js.map +1 -1
- package/node_modules/@microsoft/{powerapps-data/lib/__tests__/dataSourceInfoProcessor.test.d.ts → powerapps-player-actions/lib-cjs/__tests__/arrayTypeGeneration.spec.d.ts} +0 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/__tests__/arrayTypeGeneration.spec.d.ts.map +1 -0
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/__tests__/arrayTypeGeneration.spec.js +171 -0
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/__tests__/arrayTypeGeneration.spec.js.map +1 -0
- package/node_modules/@microsoft/powerapps-player-actions/package.json +2 -2
- package/node_modules/@pa-client/powerapps-player-services/package.json +69 -69
- package/package.json +7 -5
- package/node_modules/@microsoft/powerapps-data/lib/__tests__/dataSourceInfoProcessor.test.d.ts.map +0 -1
- package/node_modules/@microsoft/powerapps-data/lib/__tests__/dataSourceInfoProcessor.test.js +0 -782
- package/node_modules/@microsoft/powerapps-data/lib/__tests__/dataSourceInfoProcessor.test.js.map +0 -1
- package/node_modules/@microsoft/powerapps-data/lib/components/codeGen/dataSourceInfo.d.ts +0 -28
- package/node_modules/@microsoft/powerapps-data/lib/components/codeGen/dataSourceInfo.d.ts.map +0 -1
- package/node_modules/@microsoft/powerapps-data/lib/components/codeGen/dataSourceInfo.js.map +0 -1
- package/node_modules/@microsoft/powerapps-data/lib/components/codeGen/dataSourceInfoProcessor.d.ts +0 -10
- package/node_modules/@microsoft/powerapps-data/lib/components/codeGen/dataSourceInfoProcessor.d.ts.map +0 -1
- package/node_modules/@microsoft/powerapps-data/lib/components/codeGen/dataSourceInfoProcessor.js +0 -530
- package/node_modules/@microsoft/powerapps-data/lib/components/codeGen/dataSourceInfoProcessor.js.map +0 -1
package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/Actions/DeleteDataSource.js
CHANGED
|
@@ -78,9 +78,12 @@ function deleteDataSourceAsync(config) {
|
|
|
78
78
|
var dataSourceName, apiId, _a, schemaFolder, codeGenDirectory, powerConfigPath, sqlStoredProcedure, vfs, _b, directoryPath, schemaFilePath, schemaFileExists, dataSourceDirectoryIsEmpty, updated, files, error_1, configUpdated, error_2, error_3;
|
|
79
79
|
return __generator(this, function (_c) {
|
|
80
80
|
switch (_c.label) {
|
|
81
|
-
case 0:
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
case 0: return [4 /*yield*/, (0, DataUtils_1.normalizeParam)(config.actionsParams.dataSourceName)];
|
|
82
|
+
case 1:
|
|
83
|
+
dataSourceName = _c.sent();
|
|
84
|
+
return [4 /*yield*/, (0, DataUtils_1.normalizeParam)(config.actionsParams.apiId)];
|
|
85
|
+
case 2:
|
|
86
|
+
apiId = _c.sent();
|
|
84
87
|
_a = config.localFilePaths, schemaFolder = _a.schemaPath, codeGenDirectory = _a.codeGenPath, powerConfigPath = _a.powerConfigPath;
|
|
85
88
|
// validate parameters, cleanup, and throw errors where necessary
|
|
86
89
|
if (!apiId) {
|
|
@@ -91,9 +94,12 @@ function deleteDataSourceAsync(config) {
|
|
|
91
94
|
apiId = apiId.substring('shared_'.length);
|
|
92
95
|
}
|
|
93
96
|
apiId = apiId.toLowerCase();
|
|
94
|
-
if (apiId === 'sql')
|
|
95
|
-
|
|
96
|
-
|
|
97
|
+
if (!(apiId === 'sql')) return [3 /*break*/, 4];
|
|
98
|
+
return [4 /*yield*/, (0, DataUtils_1.normalizeParam)(config.actionsParams.sqlStoredProcedure)];
|
|
99
|
+
case 3:
|
|
100
|
+
sqlStoredProcedure = _c.sent(); // optional
|
|
101
|
+
_c.label = 4;
|
|
102
|
+
case 4:
|
|
97
103
|
if (apiId === Config_types_1.DataSources.Dataverse.toLowerCase()) {
|
|
98
104
|
if (!dataSourceName) {
|
|
99
105
|
throw new Error('TABLE argument is required for Dataverse data sources');
|
|
@@ -108,91 +114,91 @@ function deleteDataSourceAsync(config) {
|
|
|
108
114
|
(0, VfsManager_1.setVfs)(config.vfs);
|
|
109
115
|
vfs = (0, VfsManager_1.getVfs)();
|
|
110
116
|
_b = !powerConfigPath;
|
|
111
|
-
if (_b) return [3 /*break*/,
|
|
117
|
+
if (_b) return [3 /*break*/, 6];
|
|
112
118
|
return [4 /*yield*/, vfs.exists(powerConfigPath)];
|
|
113
|
-
case
|
|
119
|
+
case 5:
|
|
114
120
|
_b = !(_c.sent());
|
|
115
|
-
_c.label =
|
|
116
|
-
case
|
|
121
|
+
_c.label = 6;
|
|
122
|
+
case 6:
|
|
117
123
|
if (_b) {
|
|
118
124
|
throw new Error('Power configuration file must exist');
|
|
119
125
|
}
|
|
120
|
-
_c.label =
|
|
121
|
-
case
|
|
122
|
-
_c.trys.push([
|
|
126
|
+
_c.label = 7;
|
|
127
|
+
case 7:
|
|
128
|
+
_c.trys.push([7, 24, , 25]);
|
|
123
129
|
directoryPath = vfs.join(schemaFolder, apiId);
|
|
124
130
|
if (sqlStoredProcedure && sqlStoredProcedure.length > 0) {
|
|
125
131
|
directoryPath = vfs.join(directoryPath, dataSourceName);
|
|
126
132
|
}
|
|
127
133
|
schemaFilePath = vfs.join(directoryPath, "".concat(sqlStoredProcedure !== null && sqlStoredProcedure !== void 0 ? sqlStoredProcedure : dataSourceName, ".Schema.json"));
|
|
128
134
|
return [4 /*yield*/, vfs.exists(schemaFilePath)];
|
|
129
|
-
case
|
|
135
|
+
case 8:
|
|
130
136
|
schemaFileExists = _c.sent();
|
|
131
137
|
dataSourceDirectoryIsEmpty = false;
|
|
132
138
|
updated = false;
|
|
133
|
-
if (!schemaFileExists) return [3 /*break*/,
|
|
139
|
+
if (!schemaFileExists) return [3 /*break*/, 16];
|
|
134
140
|
// delete the file
|
|
135
141
|
return [4 /*yield*/, vfs.unlink(schemaFilePath)];
|
|
136
|
-
case
|
|
142
|
+
case 9:
|
|
137
143
|
// delete the file
|
|
138
144
|
_c.sent();
|
|
139
145
|
return [4 /*yield*/, vfs.exists(directoryPath)];
|
|
140
|
-
case
|
|
141
|
-
if (!_c.sent()) return [3 /*break*/,
|
|
146
|
+
case 10:
|
|
147
|
+
if (!_c.sent()) return [3 /*break*/, 15];
|
|
142
148
|
return [4 /*yield*/, vfs.readdir(directoryPath)];
|
|
143
|
-
case
|
|
149
|
+
case 11:
|
|
144
150
|
files = _c.sent();
|
|
145
151
|
dataSourceDirectoryIsEmpty = files.length === 0;
|
|
146
|
-
if (!dataSourceDirectoryIsEmpty) return [3 /*break*/,
|
|
147
|
-
_c.label =
|
|
148
|
-
case
|
|
149
|
-
_c.trys.push([
|
|
152
|
+
if (!dataSourceDirectoryIsEmpty) return [3 /*break*/, 15];
|
|
153
|
+
_c.label = 12;
|
|
154
|
+
case 12:
|
|
155
|
+
_c.trys.push([12, 14, , 15]);
|
|
150
156
|
return [4 /*yield*/, vfs.rmdir(directoryPath)];
|
|
151
|
-
case
|
|
157
|
+
case 13:
|
|
152
158
|
_c.sent();
|
|
153
|
-
return [3 /*break*/,
|
|
154
|
-
case
|
|
159
|
+
return [3 /*break*/, 15];
|
|
160
|
+
case 14:
|
|
155
161
|
error_1 = _c.sent();
|
|
156
|
-
return [3 /*break*/,
|
|
157
|
-
case
|
|
162
|
+
return [3 /*break*/, 15];
|
|
163
|
+
case 15:
|
|
158
164
|
updated = true;
|
|
159
|
-
_c.label =
|
|
160
|
-
case
|
|
165
|
+
_c.label = 16;
|
|
166
|
+
case 16:
|
|
161
167
|
configUpdated = false;
|
|
162
|
-
if (!(!sqlStoredProcedure || dataSourceDirectoryIsEmpty)) return [3 /*break*/,
|
|
168
|
+
if (!(!sqlStoredProcedure || dataSourceDirectoryIsEmpty)) return [3 /*break*/, 18];
|
|
163
169
|
return [4 /*yield*/, _cleanupPowerConfig(powerConfigPath, dataSourceName, apiId === Config_types_1.DataSources.Dataverse.toLowerCase())];
|
|
164
|
-
case
|
|
170
|
+
case 17:
|
|
165
171
|
configUpdated = _c.sent();
|
|
166
|
-
_c.label =
|
|
167
|
-
case
|
|
168
|
-
if (!(updated || configUpdated)) return [3 /*break*/,
|
|
172
|
+
_c.label = 18;
|
|
173
|
+
case 18:
|
|
174
|
+
if (!(updated || configUpdated)) return [3 /*break*/, 23];
|
|
169
175
|
// Ensure that the datasource info file is updated
|
|
170
176
|
// Pass the deleted schema file so it can be excluded from processing
|
|
171
177
|
return [4 /*yield*/, (0, dataSourceInfoProcessor_1.processDataSourceInfo)(schemaFolder, config.logger)];
|
|
172
|
-
case
|
|
178
|
+
case 19:
|
|
173
179
|
// Ensure that the datasource info file is updated
|
|
174
180
|
// Pass the deleted schema file so it can be excluded from processing
|
|
175
181
|
_c.sent();
|
|
176
|
-
_c.label =
|
|
177
|
-
case
|
|
178
|
-
_c.trys.push([
|
|
182
|
+
_c.label = 20;
|
|
183
|
+
case 20:
|
|
184
|
+
_c.trys.push([20, 22, , 23]);
|
|
179
185
|
return [4 /*yield*/, modelServiceGenerator_1.ModelServiceGenerator.clearAndRegenerate(schemaFolder, codeGenDirectory, vfs, config.logger)];
|
|
180
|
-
case
|
|
186
|
+
case 21:
|
|
181
187
|
_c.sent();
|
|
182
|
-
return [3 /*break*/,
|
|
183
|
-
case
|
|
188
|
+
return [3 /*break*/, 23];
|
|
189
|
+
case 22:
|
|
184
190
|
error_2 = _c.sent();
|
|
185
191
|
throw error_2;
|
|
186
|
-
case
|
|
192
|
+
case 23:
|
|
187
193
|
if (!updated && !configUpdated) {
|
|
188
194
|
// There was nothing to delete or the data source was not found
|
|
189
195
|
return [2 /*return*/, false];
|
|
190
196
|
}
|
|
191
|
-
return [3 /*break*/,
|
|
192
|
-
case
|
|
197
|
+
return [3 /*break*/, 25];
|
|
198
|
+
case 24:
|
|
193
199
|
error_3 = _c.sent();
|
|
194
200
|
throw error_3;
|
|
195
|
-
case
|
|
201
|
+
case 25: return [2 /*return*/, true];
|
|
196
202
|
}
|
|
197
203
|
});
|
|
198
204
|
});
|
package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/Actions/DeleteDataSource.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteDataSource.js","sourceRoot":"","sources":["../../src/Actions/DeleteDataSource.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,8EAA2E;AAC3E,0EAAyE;AACzE,uDAAqD;AACrD,yDAA0E;AAE1E,4CAA+C;AAC/C,yCAA6C;AAE7C,SAAsB,qBAAqB,CAAC,MAA+B
|
|
1
|
+
{"version":3,"file":"DeleteDataSource.js","sourceRoot":"","sources":["../../src/Actions/DeleteDataSource.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,8EAA2E;AAC3E,0EAAyE;AACzE,uDAAqD;AACrD,yDAA0E;AAE1E,4CAA+C;AAC/C,yCAA6C;AAE7C,SAAsB,qBAAqB,CAAC,MAA+B;;;;;wBAClD,qBAAM,IAAA,0BAAc,EAAC,MAAM,CAAC,aAAa,CAAC,cAAc,CAAC,EAAA;;oBAA1E,cAAc,GAAG,SAAyD;oBACpE,qBAAM,IAAA,0BAAc,EAAC,MAA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202,7 @@ function pushApp(context) {
|
|
|
202
202
|
exports.pushApp = pushApp;
|
|
203
203
|
function uploadFilesToBlob(powerConfig, blobUri, vfs, logger) {
|
|
204
204
|
return __awaiter(this, void 0, void 0, function () {
|
|
205
|
-
var httpClient, pos, baseUrl, restUrl, buildEntryPoint, buildPath, uploadFilesScenario, allFiles, allFiles_1, allFiles_1_1, fullFilePath, fileContent, relativePath, url, e_1_1, error_3;
|
|
205
|
+
var httpClient, pos, baseUrl, restUrl, buildEntryPoint, buildPath, uploadFilesScenario, allFiles, normalizedBuildPath, allFiles_1, allFiles_1_1, fullFilePath, fileContent, relativePath, url, e_1_1, error_3;
|
|
206
206
|
var e_1, _a;
|
|
207
207
|
return __generator(this, function (_b) {
|
|
208
208
|
switch (_b.label) {
|
|
@@ -225,6 +225,7 @@ function uploadFilesToBlob(powerConfig, blobUri, vfs, logger) {
|
|
|
225
225
|
return [4 /*yield*/, collectAllFiles(buildPath, vfs)];
|
|
226
226
|
case 2:
|
|
227
227
|
allFiles = _b.sent();
|
|
228
|
+
normalizedBuildPath = buildPath.replace(/^\.\//, '');
|
|
228
229
|
logger.trackActivityEvent('PushApp.SaveApp.UploadFiles.FileCount', { fileCount: allFiles.length });
|
|
229
230
|
_b.label = 3;
|
|
230
231
|
case 3:
|
|
@@ -234,10 +235,13 @@ function uploadFilesToBlob(powerConfig, blobUri, vfs, logger) {
|
|
|
234
235
|
case 4:
|
|
235
236
|
if (!!allFiles_1_1.done) return [3 /*break*/, 8];
|
|
236
237
|
fullFilePath = allFiles_1_1.value;
|
|
237
|
-
return [4 /*yield*/, vfs.readFile(fullFilePath)];
|
|
238
|
+
return [4 /*yield*/, vfs.readFile(fullFilePath, 'utf-8')];
|
|
238
239
|
case 5:
|
|
239
240
|
fileContent = _b.sent();
|
|
240
|
-
relativePath = fullFilePath
|
|
241
|
+
relativePath = fullFilePath
|
|
242
|
+
.replace(normalizedBuildPath, '')
|
|
243
|
+
.replace(/\\/g, '/')
|
|
244
|
+
.replace(/^\//, '');
|
|
241
245
|
url = "".concat(baseUrl, "/").concat(relativePath).concat(restUrl);
|
|
242
246
|
return [4 /*yield*/, httpClient.put(url, {
|
|
243
247
|
headers: {
|
|
@@ -265,7 +269,7 @@ function uploadFilesToBlob(powerConfig, blobUri, vfs, logger) {
|
|
|
265
269
|
return [7 /*endfinally*/];
|
|
266
270
|
case 11:
|
|
267
271
|
uploadFilesScenario.complete();
|
|
268
|
-
return [2 /*return*/, "".concat(baseUrl, "/").concat(buildEntryPoint.replace(
|
|
272
|
+
return [2 /*return*/, "".concat(baseUrl, "/").concat(buildEntryPoint.replace(normalizedBuildPath, '').replace(/^\//, '')).concat(restUrl)];
|
|
269
273
|
case 12:
|
|
270
274
|
error_3 = _b.sent();
|
|
271
275
|
uploadFilesScenario.failure({ error: (0, ErrorUtils_1.stringifyError)(error_3) });
|
|
@@ -345,6 +349,7 @@ function collectAllFiles(dirPath, vfs) {
|
|
|
345
349
|
function createAppMetadata(powerConfig, environmentName, documentUri, appSubtype) {
|
|
346
350
|
var appMetadata = {
|
|
347
351
|
appType: 'CodeApp',
|
|
352
|
+
appSubtype: 'BYOCApp',
|
|
348
353
|
properties: {
|
|
349
354
|
lifeCycleId: 'Draft',
|
|
350
355
|
displayName: powerConfig.appDisplayName || 'New App' + Date.now(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PushApp.js","sourceRoot":"","sources":["../../src/Actions/PushApp.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,kFAAiG;AACjG,sEAAqE;AACrE,uHAQ0F;AAI1F,4CAA+C;AAE/C,yDAA0E;AAE1E,SAAsB,OAAO,CAAC,OAAuB;;;;;;oBAC3C,aAAa,GACnB,OAAO,cADY,EAAE,YAAY,GACjC,OAAO,aAD0B,EAAE,eAAe,GAClD,OAAO,gBA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sBAAsB,EAAE;gBACtB,KAAK,EAAE,CAAC;aACT;YACD,OAAO,EAAE;gBACP,iBAAiB,EAAE;oBACjB,KAAK,EAAE,WAAW;oBAClB,aAAa,EAAE,WAAW;iBAC3B;aACF;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,eAAe;gBACrB,EAAE,EAAE,sDAA+C,eAAe,CAAE;aACrE;SACF;KACF,CAAC;IAEF,IAAI,UAAU,EAAE;QACd,WAAW,CAAC,UAAU,GAAG,UAAU,CAAC;KACrC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
3
3
|
*/
|
|
4
|
+
import { JsonNode, JsonObject } from '../Common/jsonTypes';
|
|
4
5
|
export declare function getAllJsonFiles(folderPath: string): Promise<string[]>;
|
|
5
6
|
export declare function convertToValidIdentifier(variableOrInterfaceName: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* The isDataverseEntity method checks if the schema represents a Dataverse entity.
|
|
9
|
+
*/
|
|
10
|
+
export declare function isDataverseEntity(schema: JsonNode): boolean;
|
|
11
|
+
export declare function isSqlStoredProcedure(schema: JsonNode): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* The isSharepointSchema method checks if the schema is a SharePoint schema.
|
|
14
|
+
* It returns true if the schema contains SharePoint-specific indicators.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isSharepointSchema(schema: JsonNode): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The getDataverseEntitySetName method retrieves the entity set name from a Dataverse schema.
|
|
19
|
+
*/
|
|
20
|
+
export declare function getDataverseEntitySetName(schema: JsonNode): string | null;
|
|
21
|
+
/**
|
|
22
|
+
* The isGuid method checks if the name node is a GUID.
|
|
23
|
+
*/
|
|
24
|
+
export declare function isGuid(nameNode: string): boolean;
|
|
25
|
+
export declare function isJsonObject(value: JsonNode): value is JsonObject;
|
package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/CodeGen/codeGenUtils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codeGenUtils.d.ts","sourceRoot":"","sources":["../../src/CodeGen/codeGenUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"codeGenUtils.d.ts","sourceRoot":"","sources":["../../src/CodeGen/codeGenUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAmE3D,wBAAsB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CA6B3E;AAOD,wBAAgB,wBAAwB,CAAC,uBAAuB,EAAE,MAAM,UA0BvE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,QAAQ,GAAG,OAAO,CAa3D;AAMD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,QAAQ,GAAG,OAAO,CAY9D;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,QAAQ,GAAG,OAAO,CAW5D;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,GAAG,IAAI,CAezE;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAGhD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,QAAQ,GAAG,KAAK,IAAI,UAAU,CAEjE"}
|
|
@@ -50,7 +50,7 @@ var __values = (this && this.__values) || function(o) {
|
|
|
50
50
|
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
51
51
|
};
|
|
52
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
-
exports.convertToValidIdentifier = exports.getAllJsonFiles = void 0;
|
|
53
|
+
exports.isJsonObject = exports.isGuid = exports.getDataverseEntitySetName = exports.isSharepointSchema = exports.isSqlStoredProcedure = exports.isDataverseEntity = exports.convertToValidIdentifier = exports.getAllJsonFiles = void 0;
|
|
54
54
|
var VfsManager_1 = require("../VfsManager");
|
|
55
55
|
// TypeScript reserved keywords and built-in types
|
|
56
56
|
var RESERVED_KEYWORDS = new Set([
|
|
@@ -215,4 +215,89 @@ function convertToValidIdentifier(variableOrInterfaceName) {
|
|
|
215
215
|
return sanitizedName;
|
|
216
216
|
}
|
|
217
217
|
exports.convertToValidIdentifier = convertToValidIdentifier;
|
|
218
|
+
/**
|
|
219
|
+
* The isDataverseEntity method checks if the schema represents a Dataverse entity.
|
|
220
|
+
*/
|
|
221
|
+
function isDataverseEntity(schema) {
|
|
222
|
+
if (isJsonObject(schema)) {
|
|
223
|
+
var schemaObject = schema;
|
|
224
|
+
// Check if this has the Dataverse schema structure with schema.items
|
|
225
|
+
if (isJsonObject(schemaObject.schema)) {
|
|
226
|
+
var schemaProperty = schemaObject.schema;
|
|
227
|
+
if (typeof schemaProperty.items === 'object' && schemaProperty.items !== null) {
|
|
228
|
+
var items = schemaProperty.items;
|
|
229
|
+
return items['x-ms-dataverse-entity'] === true;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
return false;
|
|
234
|
+
}
|
|
235
|
+
exports.isDataverseEntity = isDataverseEntity;
|
|
236
|
+
/*
|
|
237
|
+
* The isSqlStoredProcedure method checks if the schema is a SQL stored procedure.
|
|
238
|
+
* It returns true if the schema contains a "procedureresultschema" node.
|
|
239
|
+
*/
|
|
240
|
+
function isSqlStoredProcedure(schema) {
|
|
241
|
+
// Logic to identify SQL stored procedures
|
|
242
|
+
// Check if the "schema" node contains a "procedureresultschema" node
|
|
243
|
+
if (isJsonObject(schema)) {
|
|
244
|
+
var schemaObj = schema;
|
|
245
|
+
var schemaNode = schemaObj.schema;
|
|
246
|
+
if (typeof schemaNode === 'object' && schemaNode !== null && !Array.isArray(schemaNode)) {
|
|
247
|
+
var schemaNodeObj = schemaNode;
|
|
248
|
+
return !!schemaNodeObj.procedureresultschema;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
return false;
|
|
252
|
+
}
|
|
253
|
+
exports.isSqlStoredProcedure = isSqlStoredProcedure;
|
|
254
|
+
/**
|
|
255
|
+
* The isSharepointSchema method checks if the schema is a SharePoint schema.
|
|
256
|
+
* It returns true if the schema contains SharePoint-specific indicators.
|
|
257
|
+
*/
|
|
258
|
+
function isSharepointSchema(schema) {
|
|
259
|
+
// Logic to identify SharePoint schemas
|
|
260
|
+
// Check if the schema has SharePoint-specific properties or structure
|
|
261
|
+
if (isJsonObject(schema)) {
|
|
262
|
+
var schemaObj = schema;
|
|
263
|
+
// Check for referencedEntities which is common in SharePoint schemas
|
|
264
|
+
if (schemaObj.referencedEntities && typeof schemaObj.referencedEntities === 'object') {
|
|
265
|
+
return true;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
return false;
|
|
269
|
+
}
|
|
270
|
+
exports.isSharepointSchema = isSharepointSchema;
|
|
271
|
+
/**
|
|
272
|
+
* The getDataverseEntitySetName method retrieves the entity set name from a Dataverse schema.
|
|
273
|
+
*/
|
|
274
|
+
function getDataverseEntitySetName(schema) {
|
|
275
|
+
if (isJsonObject(schema)) {
|
|
276
|
+
var schemaObject = schema;
|
|
277
|
+
if (typeof schemaObject.schema === 'object' && schemaObject.schema !== null) {
|
|
278
|
+
var schemaProperty = schemaObject.schema;
|
|
279
|
+
if (typeof schemaProperty.items === 'object' && schemaProperty.items !== null) {
|
|
280
|
+
var items = schemaProperty.items;
|
|
281
|
+
var entitySetName = items['x-ms-dataverse-entityset'];
|
|
282
|
+
if (typeof entitySetName === 'string' && entitySetName.trim()) {
|
|
283
|
+
return entitySetName;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
return null;
|
|
289
|
+
}
|
|
290
|
+
exports.getDataverseEntitySetName = getDataverseEntitySetName;
|
|
291
|
+
/**
|
|
292
|
+
* The isGuid method checks if the name node is a GUID.
|
|
293
|
+
*/
|
|
294
|
+
function isGuid(nameNode) {
|
|
295
|
+
// GUID regex, C# Guid.TryParse equivalent
|
|
296
|
+
return /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(nameNode);
|
|
297
|
+
}
|
|
298
|
+
exports.isGuid = isGuid;
|
|
299
|
+
function isJsonObject(value) {
|
|
300
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
301
|
+
}
|
|
302
|
+
exports.isJsonObject = isJsonObject;
|
|
218
303
|
//# sourceMappingURL=codeGenUtils.js.map
|
package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/CodeGen/codeGenUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codeGenUtils.js","sourceRoot":"","sources":["../../src/CodeGen/codeGenUtils.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"codeGenUtils.js","sourceRoot":"","sources":["../../src/CodeGen/codeGenUtils.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGH,4CAAuC;AAEvC,kDAAkD;AAClD,IAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC;IAChC,OAAO;IACP,MAAM;IACN,OAAO;IACP,OAAO;IACP,OAAO;IACP,UAAU;IACV,UAAU;IACV,SAAS;IACT,QAAQ;IACR,IAAI;IACJ,MAAM;IACN,MAAM;IACN,QAAQ;IACR,SAAS;IACT,OAAO;IACP,SAAS;IACT,KAAK;IACL,UAAU;IACV,IAAI;IACJ,QAAQ;IACR,IAAI;IACJ,YAAY;IACZ,KAAK;IACL,MAAM;IACN,QAAQ;IACR,OAAO;IACP,QA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BACjD,IAAM,aAAa,GAAG,KAAK,CAAC,0BAA0B,CAAC,CAAC;gBACxD,IAAI,OAAO,aAAa,KAAK,QAAQ,IAAI,aAAa,CAAC,IAAI,EAAE,EAAE;oBAC7D,OAAO,aAAa,CAAC;iBACtB;aACF;SACF;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAfD,8DAeC;AAED;;GAEG;AACH,SAAgB,MAAM,CAAC,QAAgB;IACrC,0CAA0C;IAC1C,OAAO,4EAA4E,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACrG,CAAC;AAHD,wBAGC;AAED,SAAgB,YAAY,CAAC,KAAe;IAC1C,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAFD,oCAEC"}
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
import { ILogger } from '@pa-client/powerapps-player-services';
|
|
5
5
|
/**
|
|
6
6
|
* Processes all JSON files in the specified folder and generates a TypeScript file with data source information.
|
|
7
|
-
* @param
|
|
7
|
+
* @param schemaFolderPath The path to the folder containing JSON files.
|
|
8
8
|
*/
|
|
9
|
-
export declare function processDataSourceInfo(
|
|
9
|
+
export declare function processDataSourceInfo(schemaFolderPath: string, logger: ILogger): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataSourceInfoProcessor.d.ts","sourceRoot":"","sources":["../../src/CodeGen/dataSourceInfoProcessor.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"dataSourceInfoProcessor.d.ts","sourceRoot":"","sources":["../../src/CodeGen/dataSourceInfoProcessor.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAW/D;;;GAGG;AACH,wBAAsB,qBAAqB,CAAC,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAmDpG"}
|
package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/CodeGen/dataSourceInfoProcessor.js
CHANGED
|
@@ -54,23 +54,25 @@ exports.processDataSourceInfo = void 0;
|
|
|
54
54
|
var VfsManager_1 = require("../VfsManager");
|
|
55
55
|
var nameUtility_1 = require("./nameUtility");
|
|
56
56
|
var codeGenUtils_1 = require("./codeGenUtils");
|
|
57
|
+
/** Regex to match file extension (e.g., ".json", ".ts") */
|
|
58
|
+
var FILE_EXTENSION_PATTERN = /\.[^/.]+$/;
|
|
57
59
|
/**
|
|
58
60
|
* Processes all JSON files in the specified folder and generates a TypeScript file with data source information.
|
|
59
|
-
* @param
|
|
61
|
+
* @param schemaFolderPath The path to the folder containing JSON files.
|
|
60
62
|
*/
|
|
61
|
-
function processDataSourceInfo(
|
|
63
|
+
function processDataSourceInfo(schemaFolderPath, logger) {
|
|
62
64
|
return __awaiter(this, void 0, void 0, function () {
|
|
63
65
|
var scenario, vfs, jsonFiles, resultJson, jsonFiles_1, jsonFiles_1_1, filePath, jsonContent, jsonDocument, dataSourceInfo, propertyKey, err_1, error, e_1_1, outputJson, finalOutput, outputDir, outputFilePath, error_1;
|
|
64
66
|
var e_1, _a;
|
|
65
67
|
return __generator(this, function (_b) {
|
|
66
68
|
switch (_b.label) {
|
|
67
69
|
case 0:
|
|
68
|
-
scenario = logger.trackScenario('ProcessDataSourceInfo', {
|
|
70
|
+
scenario = logger.trackScenario('ProcessDataSourceInfo', { schemaFolderPath: schemaFolderPath });
|
|
69
71
|
vfs = (0, VfsManager_1.getVfs)();
|
|
70
72
|
_b.label = 1;
|
|
71
73
|
case 1:
|
|
72
74
|
_b.trys.push([1, 17, , 18]);
|
|
73
|
-
return [4 /*yield*/, (0, codeGenUtils_1.getAllJsonFiles)(
|
|
75
|
+
return [4 /*yield*/, (0, codeGenUtils_1.getAllJsonFiles)(schemaFolderPath)];
|
|
74
76
|
case 2:
|
|
75
77
|
jsonFiles = _b.sent();
|
|
76
78
|
resultJson = {};
|
|
@@ -90,7 +92,7 @@ function processDataSourceInfo(folderPath, logger) {
|
|
|
90
92
|
jsonContent = _b.sent();
|
|
91
93
|
jsonDocument = JSON.parse(jsonContent);
|
|
92
94
|
dataSourceInfo = processJson(jsonDocument);
|
|
93
|
-
propertyKey = determinePropertyKey(filePath,
|
|
95
|
+
propertyKey = determinePropertyKey(jsonDocument, filePath, vfs, logger);
|
|
94
96
|
mergeDataSourceInfo(resultJson, propertyKey, dataSourceInfo);
|
|
95
97
|
return [3 /*break*/, 8];
|
|
96
98
|
case 7:
|
|
@@ -114,7 +116,7 @@ function processDataSourceInfo(folderPath, logger) {
|
|
|
114
116
|
case 12:
|
|
115
117
|
outputJson = JSON.stringify(resultJson, null, 2);
|
|
116
118
|
finalOutput = "/*!\n * Copyright (C) Microsoft Corporation. All rights reserved.\n * This file is auto-generated. Do not modify it manually.\n * Changes to this file may be overwritten.\n */\n\nexport const dataSourcesInfo = ".concat(outputJson, ";\n");
|
|
117
|
-
outputDir = vfs.join(
|
|
119
|
+
outputDir = vfs.join(schemaFolderPath, 'appschemas');
|
|
118
120
|
outputFilePath = vfs.join(outputDir, 'dataSourcesInfo.ts');
|
|
119
121
|
return [4 /*yield*/, vfs.exists(outputDir)];
|
|
120
122
|
case 13:
|
|
@@ -164,70 +166,26 @@ function mergeDataSourceInfo(resultJson, propertyKey, newDataSourceInfo) {
|
|
|
164
166
|
}
|
|
165
167
|
}
|
|
166
168
|
/**
|
|
167
|
-
* Determines the property key for a
|
|
168
|
-
* @param
|
|
169
|
-
* @param
|
|
170
|
-
* @
|
|
169
|
+
* Determines the property key for a data source, falling back to filename if extraction fails.
|
|
170
|
+
* @param jsonDocument The parsed JSON document.
|
|
171
|
+
* @param filePath The path to the JSON file.
|
|
172
|
+
* @param vfs The virtual file system instance.
|
|
173
|
+
* @param logger The logger instance for telemetry.
|
|
174
|
+
* @returns The property key to use for the data source.
|
|
171
175
|
*/
|
|
172
|
-
function determinePropertyKey(filePath,
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
if (typeof root.schema === 'object' && root.schema !== null) {
|
|
176
|
-
var schema = root.schema;
|
|
177
|
-
if (typeof schema.items === 'object' && schema.items !== null) {
|
|
178
|
-
var items = schema.items;
|
|
179
|
-
if (items['x-ms-dataverse-entity'] === true) {
|
|
180
|
-
// For Dataverse entities, use the entity set name if available
|
|
181
|
-
var entitySet = items['x-ms-dataverse-entityset'];
|
|
182
|
-
if (typeof entitySet === 'string' && entitySet) {
|
|
183
|
-
return entitySet.toLowerCase();
|
|
184
|
-
}
|
|
185
|
-
// Fallback to the entity name
|
|
186
|
-
if (typeof root.name === 'string' && root.name) {
|
|
187
|
-
return root.name.toLowerCase();
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
var nameValue = typeof root.name === 'string' ? root.name : '';
|
|
193
|
-
// Rule 1: For SQL stored procedure, use the parent folder name, lowercase
|
|
194
|
-
if (typeof root.schema === 'object' &&
|
|
195
|
-
root.schema !== null &&
|
|
196
|
-
typeof root.schema.procedureresultschema !== 'undefined') {
|
|
197
|
-
// Handle both Unix and Windows path separators
|
|
198
|
-
var separator_1 = filePath.includes('\\') ? '\\' : '/';
|
|
199
|
-
var directoryName = filePath.substring(0, filePath.lastIndexOf(separator_1));
|
|
200
|
-
if (directoryName) {
|
|
201
|
-
var parentFolder = directoryName.substring(directoryName.lastIndexOf(separator_1) + 1);
|
|
202
|
-
return parentFolder.toLowerCase();
|
|
203
|
-
}
|
|
204
|
-
else {
|
|
205
|
-
throw new Error("The directory name for the file path '".concat(filePath, "' could not be determined."));
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
// Rule 2: For SQL tables, use the "name" node value without [<schema>]. and [], lowercase
|
|
209
|
-
if (nameValue.match(/^\[[^\]]+\]\./)) {
|
|
210
|
-
return (0, nameUtility_1.sanitizeSqlName)(nameValue).toLowerCase();
|
|
211
|
-
}
|
|
212
|
-
// Rule 3: For non-tabular, use the rest part of the "name" without "shared_" and lowercase
|
|
213
|
-
if (nameValue.toLowerCase().startsWith('shared_')) {
|
|
214
|
-
return nameValue.substring('shared_'.length).toLowerCase();
|
|
215
|
-
}
|
|
216
|
-
// Rule 4: For tabular, use the "title" property and lowercase
|
|
217
|
-
if (typeof root.title === 'string') {
|
|
218
|
-
return root.title.toLowerCase();
|
|
176
|
+
function determinePropertyKey(jsonDocument, filePath, vfs, logger) {
|
|
177
|
+
try {
|
|
178
|
+
return (0, nameUtility_1.extractModelName)(jsonDocument, filePath, vfs).dataSourceName.toLowerCase();
|
|
219
179
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
180
|
+
catch (error) {
|
|
181
|
+
logger.trackActivityEvent('DataSourceInfoProcessor_FallbackName', {
|
|
182
|
+
filePath: filePath,
|
|
183
|
+
error: error instanceof Error ? error.message : String(error),
|
|
184
|
+
});
|
|
185
|
+
// fall back to using the file name without extension
|
|
186
|
+
var fileName = vfs.basename(filePath);
|
|
187
|
+
return fileName.replace(FILE_EXTENSION_PATTERN, '').toLowerCase();
|
|
223
188
|
}
|
|
224
|
-
// Fallback: Use the file name in lowercase if "name" property is missing
|
|
225
|
-
// Handle both Unix and Windows path separators
|
|
226
|
-
var separator = filePath.includes('\\') ? '\\' : '/';
|
|
227
|
-
var fileName = filePath.substring(filePath.lastIndexOf(separator) + 1);
|
|
228
|
-
// Extract base name without extension (e.g., "GetAllRecords.Schema.json" -> "GetAllRecords")
|
|
229
|
-
var baseName = fileName.split('.')[0];
|
|
230
|
-
return baseName.toLowerCase();
|
|
231
189
|
}
|
|
232
190
|
/**
|
|
233
191
|
* Processes the JSON document and extracts relevant data source information.
|