@microsoft/power-apps-cli 0.5.4 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/CliUtils.d.ts +1 -1
- package/lib/CliUtils.d.ts.map +1 -1
- package/lib/Constants/HelpStrings.d.ts +3 -3
- package/lib/Constants/HelpStrings.js +4 -4
- package/lib/Constants/HelpStrings.js.map +1 -1
- package/lib/HttpClient/CliHttpClient.d.ts +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/Logger/CliLogger.d.ts +1 -2
- package/lib/Logger/CliLogger.d.ts.map +1 -1
- package/lib/Logger/CliLogger.js +1 -2
- package/lib/Logger/CliLogger.js.map +1 -1
- package/lib/Verbs/AddDataSource.d.ts.map +1 -1
- package/lib/Verbs/AddDataSource.js +7 -6
- package/lib/Verbs/AddDataSource.js.map +1 -1
- package/lib/Verbs/DeleteDataSource.d.ts.map +1 -1
- package/lib/Verbs/DeleteDataSource.js +6 -1
- package/lib/Verbs/DeleteDataSource.js.map +1 -1
- package/lib/Verbs/ListCodeApps.js +1 -1
- package/lib/Verbs/ListCodeApps.js.map +1 -1
- package/lib/Verbs/ListConnectionReferences.js +6 -6
- package/lib/Verbs/ListConnectionReferences.js.map +1 -1
- package/lib/Verbs/ListDatasets.js +1 -1
- package/lib/Verbs/ListDatasets.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 +14 -17
- package/lib/__tests__/E2eTests/addAndDeleteDataverseDS.test.js.map +1 -1
- package/lib/__tests__/E2eTests/addTop10Datasources.test.js +97 -83
- 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__/E2eTests/commonUserWorkflowSmokeTest.test.d.ts +5 -0
- package/lib/__tests__/E2eTests/commonUserWorkflowSmokeTest.test.d.ts.map +1 -0
- package/lib/__tests__/E2eTests/commonUserWorkflowSmokeTest.test.js +290 -0
- package/lib/__tests__/E2eTests/commonUserWorkflowSmokeTest.test.js.map +1 -0
- package/lib/__tests__/E2eTests/constants.d.ts +22 -0
- package/lib/__tests__/E2eTests/constants.d.ts.map +1 -0
- package/lib/__tests__/E2eTests/constants.js +35 -0
- package/lib/__tests__/E2eTests/constants.js.map +1 -0
- package/lib/__tests__/UnitTests/commandLineUtils.test.js +20 -21
- package/lib/__tests__/UnitTests/commandLineUtils.test.js.map +1 -1
- package/lib/__tests__/helpers/commandLineUtils.d.ts +1 -0
- package/lib/__tests__/helpers/commandLineUtils.d.ts.map +1 -1
- package/lib/__tests__/helpers/commandLineUtils.js +40 -52
- package/lib/__tests__/helpers/commandLineUtils.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/__tests__/helpers/testHelpers.d.ts +9 -4
- package/lib/__tests__/helpers/testHelpers.d.ts.map +1 -1
- package/lib/__tests__/helpers/testHelpers.js +24 -5
- package/lib/__tests__/helpers/testHelpers.js.map +1 -1
- package/lib-cjs/CliUtils.d.ts +1 -1
- package/lib-cjs/CliUtils.d.ts.map +1 -1
- package/lib-cjs/Constants/HelpStrings.d.ts +3 -3
- package/lib-cjs/Constants/HelpStrings.js +4 -4
- package/lib-cjs/Constants/HelpStrings.js.map +1 -1
- package/lib-cjs/HttpClient/CliHttpClient.d.ts +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/Logger/CliLogger.d.ts +1 -2
- package/lib-cjs/Logger/CliLogger.d.ts.map +1 -1
- package/lib-cjs/Logger/CliLogger.js +3 -4
- package/lib-cjs/Logger/CliLogger.js.map +1 -1
- package/lib-cjs/Verbs/AddDataSource.d.ts.map +1 -1
- package/lib-cjs/Verbs/AddDataSource.js +7 -6
- package/lib-cjs/Verbs/AddDataSource.js.map +1 -1
- package/lib-cjs/Verbs/DeleteDataSource.d.ts.map +1 -1
- package/lib-cjs/Verbs/DeleteDataSource.js +12 -5
- package/lib-cjs/Verbs/DeleteDataSource.js.map +1 -1
- package/lib-cjs/Verbs/ListCodeApps.js +2 -2
- package/lib-cjs/Verbs/ListCodeApps.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/ListDatasets.js +1 -1
- package/lib-cjs/Verbs/ListDatasets.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 +10 -8
- package/lib-cjs/__tests__/E2eTests/addAndDeleteDataverseDS.test.js.map +1 -1
- package/lib-cjs/__tests__/E2eTests/addTop10Datasources.test.js +140 -157
- 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/{node_modules/@microsoft/powerapps-data/lib/components/codeGen/dataSourceInfo.js → lib-cjs/__tests__/E2eTests/commonUserWorkflowSmokeTest.test.d.ts} +0 -1
- package/lib-cjs/__tests__/E2eTests/commonUserWorkflowSmokeTest.test.d.ts.map +1 -0
- package/lib-cjs/__tests__/E2eTests/commonUserWorkflowSmokeTest.test.js +377 -0
- package/lib-cjs/__tests__/E2eTests/commonUserWorkflowSmokeTest.test.js.map +1 -0
- package/lib-cjs/__tests__/E2eTests/constants.d.ts +21 -0
- package/lib-cjs/__tests__/E2eTests/constants.d.ts.map +1 -0
- package/lib-cjs/__tests__/E2eTests/constants.js +38 -0
- package/lib-cjs/__tests__/E2eTests/constants.js.map +1 -0
- package/lib-cjs/__tests__/UnitTests/commandLineUtils.test.js +20 -21
- package/lib-cjs/__tests__/UnitTests/commandLineUtils.test.js.map +1 -1
- package/lib-cjs/__tests__/helpers/commandLineUtils.d.ts +1 -0
- package/lib-cjs/__tests__/helpers/commandLineUtils.d.ts.map +1 -1
- package/lib-cjs/__tests__/helpers/commandLineUtils.js +45 -59
- package/lib-cjs/__tests__/helpers/commandLineUtils.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/lib-cjs/__tests__/helpers/testHelpers.d.ts +9 -4
- package/lib-cjs/__tests__/helpers/testHelpers.d.ts.map +1 -1
- package/lib-cjs/__tests__/helpers/testHelpers.js +27 -6
- package/lib-cjs/__tests__/helpers/testHelpers.js.map +1 -1
- package/node_modules/@microsoft/powerapps-data/package.json +3 -3
- package/node_modules/@microsoft/powerapps-player-actions/lib/Actions/ListDatasets.d.ts +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib/Actions/ListDatasets.d.ts.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib/Actions/ListDatasets.js +1 -2
- package/node_modules/@microsoft/powerapps-player-actions/lib/Actions/ListDatasets.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib/Actions/PushApp.d.ts.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib/Actions/PushApp.js +32 -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/__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/ListDatasets.d.ts +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/Actions/ListDatasets.d.ts.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/Actions/ListDatasets.js +4 -5
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/Actions/ListDatasets.js.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/Actions/PushApp.d.ts.map +1 -1
- package/node_modules/@microsoft/powerapps-player-actions/lib-cjs/Actions/PushApp.js +42 -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-data/lib/__tests__/dataSourceInfoProcessor.test.d.ts → 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-player-actions/lib-cjs/__tests__/arrayTypeGeneration.spec.d.ts +4 -0
- 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/lib/Services/PowerAppsRp/PowerAppsRpService.types.d.ts +3 -1
- package/node_modules/@pa-client/powerapps-player-services/lib/Services/PowerAppsRp/PowerAppsRpService.types.d.ts.map +1 -1
- package/node_modules/@pa-client/powerapps-player-services/lib/index.d.ts +2 -1
- package/node_modules/@pa-client/powerapps-player-services/lib/index.d.ts.map +1 -1
- package/node_modules/@pa-client/powerapps-player-services/lib/index.js.map +1 -1
- package/node_modules/@pa-client/powerapps-player-services/lib-cjs/Services/PowerAppsRp/PowerAppsRpService.types.d.ts +3 -1
- package/node_modules/@pa-client/powerapps-player-services/lib-cjs/Services/PowerAppsRp/PowerAppsRpService.types.d.ts.map +1 -1
- package/node_modules/@pa-client/powerapps-player-services/lib-cjs/index.d.ts +2 -1
- package/node_modules/@pa-client/powerapps-player-services/lib-cjs/index.d.ts.map +1 -1
- package/node_modules/@pa-client/powerapps-player-services/lib-cjs/index.js.map +1 -1
- package/node_modules/@pa-client/powerapps-player-services/package.json +69 -69
- package/package.json +4 -4
- 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
|
@@ -118,13 +118,15 @@ var npmPath = null;
|
|
|
118
118
|
* @param {string[]} args - The npm command to run (without 'npm' prefix)
|
|
119
119
|
* @param {CommandOptions} [options={}] - Options for running the command
|
|
120
120
|
* @returns {Promise<string>} - Promise resolving with command output
|
|
121
|
+
* @throws {Error} - Throws error if npm is not available or command fails with non-zero exit code
|
|
121
122
|
*/
|
|
122
123
|
function runNpmCommandInDirectory(args, options) {
|
|
124
|
+
var _a, _b, _c;
|
|
123
125
|
if (options === void 0) { options = {}; }
|
|
124
126
|
return __awaiter(this, void 0, void 0, function () {
|
|
125
|
-
var workingDirectory,
|
|
126
|
-
return __generator(this, function (
|
|
127
|
-
workingDirectory = options.workingDirectory,
|
|
127
|
+
var workingDirectory, _d, timeout, cwd, command, result, stderr, stdout_1, stdout;
|
|
128
|
+
return __generator(this, function (_e) {
|
|
129
|
+
workingDirectory = options.workingDirectory, _d = options.timeout, timeout = _d === void 0 ? 60000 : _d;
|
|
128
130
|
if (!npmPath) {
|
|
129
131
|
verifyCanRunNPM();
|
|
130
132
|
if (!npmPath) {
|
|
@@ -132,31 +134,24 @@ function runNpmCommandInDirectory(args, options) {
|
|
|
132
134
|
}
|
|
133
135
|
}
|
|
134
136
|
cwd = workingDirectory ? path.resolve(workingDirectory) : exports.testDir;
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
throw result.error;
|
|
146
|
-
}
|
|
147
|
-
if ((result === null || result === void 0 ? void 0 : result.status) !== 0) {
|
|
148
|
-
stderr = result.stderr ? result.stderr.toString().trim() : '';
|
|
149
|
-
stdout_1 = result.stdout ? result.stdout.toString().trim() : '';
|
|
150
|
-
throw new Error(stderr || stdout_1 || 'npm command failed');
|
|
151
|
-
}
|
|
152
|
-
stdout = (result === null || result === void 0 ? void 0 : result.stdout) ? result.stdout.toString().trim() : '';
|
|
153
|
-
return [2 /*return*/, stdout];
|
|
137
|
+
command = "".concat(npmPath, " ").concat(args.join(' '));
|
|
138
|
+
result = (0, child_process_1.spawnSync)(command, {
|
|
139
|
+
cwd: cwd,
|
|
140
|
+
timeout: timeout,
|
|
141
|
+
encoding: 'utf-8',
|
|
142
|
+
shell: true,
|
|
143
|
+
stdio: 'pipe',
|
|
144
|
+
});
|
|
145
|
+
if (result.error) {
|
|
146
|
+
throw result.error;
|
|
154
147
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
148
|
+
if (result.status !== 0) {
|
|
149
|
+
stderr = ((_a = result.stderr) !== null && _a !== void 0 ? _a : '').trim();
|
|
150
|
+
stdout_1 = ((_b = result.stdout) !== null && _b !== void 0 ? _b : '').trim();
|
|
151
|
+
throw new Error(stderr || stdout_1 || 'npm command failed');
|
|
158
152
|
}
|
|
159
|
-
|
|
153
|
+
stdout = ((_c = result.stdout) !== null && _c !== void 0 ? _c : '').trim();
|
|
154
|
+
return [2 /*return*/, stdout];
|
|
160
155
|
});
|
|
161
156
|
});
|
|
162
157
|
}
|
|
@@ -168,37 +163,31 @@ exports.runNpmCommandInDirectory = runNpmCommandInDirectory;
|
|
|
168
163
|
* @returns {Promise<string>} - Promise resolving with command output
|
|
169
164
|
*/
|
|
170
165
|
function runNpxCommandInDirectory(args, options) {
|
|
166
|
+
var _a, _b, _c;
|
|
171
167
|
if (options === void 0) { options = {}; }
|
|
172
168
|
return __awaiter(this, void 0, void 0, function () {
|
|
173
|
-
var workingDirectory,
|
|
174
|
-
return __generator(this, function (
|
|
175
|
-
workingDirectory = options.workingDirectory,
|
|
169
|
+
var workingDirectory, _d, timeout, cwd, command, result, stderr, stdout_2, stdout;
|
|
170
|
+
return __generator(this, function (_e) {
|
|
171
|
+
workingDirectory = options.workingDirectory, _d = options.timeout, timeout = _d === void 0 ? 60000 : _d;
|
|
176
172
|
cwd = workingDirectory ? path.resolve(workingDirectory) : exports.testDir;
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
throw result.error;
|
|
188
|
-
}
|
|
189
|
-
if (result.status !== 0) {
|
|
190
|
-
stderr = result.stderr ? result.stderr.toString().trim() : '';
|
|
191
|
-
stdout_2 = result.stdout ? result.stdout.toString().trim() : '';
|
|
192
|
-
throw new Error(stderr || stdout_2 || 'npx command failed');
|
|
193
|
-
}
|
|
194
|
-
stdout = result.stdout ? result.stdout.toString().trim() : '';
|
|
195
|
-
return [2 /*return*/, stdout];
|
|
173
|
+
command = "npx ".concat(args.join(' '));
|
|
174
|
+
result = (0, child_process_1.spawnSync)(command, {
|
|
175
|
+
cwd: cwd,
|
|
176
|
+
timeout: timeout,
|
|
177
|
+
encoding: 'utf-8',
|
|
178
|
+
shell: true,
|
|
179
|
+
stdio: 'pipe',
|
|
180
|
+
});
|
|
181
|
+
if (result.error) {
|
|
182
|
+
throw result.error;
|
|
196
183
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
184
|
+
if (result.status !== 0) {
|
|
185
|
+
stderr = ((_a = result.stderr) !== null && _a !== void 0 ? _a : '').trim();
|
|
186
|
+
stdout_2 = ((_b = result.stdout) !== null && _b !== void 0 ? _b : '').trim();
|
|
187
|
+
throw new Error(stderr || stdout_2 || 'npx command failed');
|
|
200
188
|
}
|
|
201
|
-
|
|
189
|
+
stdout = ((_c = result.stdout) !== null && _c !== void 0 ? _c : '').trim();
|
|
190
|
+
return [2 /*return*/, stdout];
|
|
202
191
|
});
|
|
203
192
|
});
|
|
204
193
|
}
|
|
@@ -283,8 +272,7 @@ exports.formatCliInvocation = formatCliInvocation;
|
|
|
283
272
|
* @returns A {@link CliCommandResult} object containing stdout, stderr, the formatted invocation command
|
|
284
273
|
*/
|
|
285
274
|
function runCliCommand(options) {
|
|
286
|
-
var _a,
|
|
287
|
-
var cliPath = options.cliPath, verb = options.verb, cwd = options.cwd, _c = options.args, args = _c === void 0 ? [] : _c, env = options.env, timeoutMs = options.timeoutMs, maxBuffer = options.maxBuffer;
|
|
275
|
+
var cliPath = options.cliPath, verb = options.verb, cwd = options.cwd, _a = options.args, args = _a === void 0 ? [] : _a, env = options.env, timeoutMs = options.timeoutMs, maxBuffer = options.maxBuffer;
|
|
288
276
|
var invocation = formatCliInvocation(cliPath, verb, args);
|
|
289
277
|
// Set environment variables to disable TTY features
|
|
290
278
|
var testEnv = __assign(__assign(__assign({}, process_1.default.env), env), { CI: 'true', NO_COLOR: '1', FORCE_COLOR: '0', NODE_ENV: 'test', TERM: 'dumb', FORCE_TTY: '0' });
|
|
@@ -305,8 +293,8 @@ function runCliCommand(options) {
|
|
|
305
293
|
throw new Error("CLI command '".concat(invocation, "' failed with exit code ").concat(result.status, ".\nSTDOUT:\n").concat(result.stdout, "\nSTDERR:\n").concat(result.stderr));
|
|
306
294
|
}
|
|
307
295
|
return {
|
|
308
|
-
stdout:
|
|
309
|
-
stderr:
|
|
296
|
+
stdout: result.stdout,
|
|
297
|
+
stderr: result.stderr,
|
|
310
298
|
command: invocation,
|
|
311
299
|
};
|
|
312
300
|
}
|
|
@@ -329,9 +317,7 @@ function runCliCommandAllowFailure(options) {
|
|
|
329
317
|
var cliPath = options.cliPath, verb = options.verb, cwd = options.cwd, _c = options.args, args = _c === void 0 ? [] : _c, env = options.env, timeoutMs = options.timeoutMs, maxBuffer = options.maxBuffer;
|
|
330
318
|
var invocation = formatCliInvocation(cliPath, verb, args);
|
|
331
319
|
var testEnv = __assign(__assign(__assign({}, process_1.default.env), env), { CI: 'true', NO_COLOR: '1', FORCE_COLOR: '0', NODE_ENV: 'test', TERM: 'dumb', FORCE_TTY: '0' });
|
|
332
|
-
var
|
|
333
|
-
var command = __spreadArray([quote(process_1.default.execPath), quote(cliPath), verb], __read(args), false).join(' ');
|
|
334
|
-
var result = (0, child_process_1.spawnSync)(command, {
|
|
320
|
+
var result = (0, child_process_1.spawnSync)(invocation, {
|
|
335
321
|
cwd: cwd,
|
|
336
322
|
env: testEnv,
|
|
337
323
|
encoding: 'utf-8',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commandLineUtils.js","sourceRoot":"","sources":["../../../src/__tests__/helpers/commandLineUtils.ts"],"names":[],"mappings":";;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EAAE,MAAM,EACZ,SAAS,EAAE,GAAG,GACf,CAAC;IAEF,IAAM,MAAM,GAAG,IAAA,yBAAS,EAAC,UAAU,EAAE;QACnC,GAAG,KAAA;QACH,GAAG,EAAE,OAAO;QACZ,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,MAAM;QACb,KAAK,EAAE,IAAI;QACX,OAAO,EAAE,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,0BAA0B;QAChD,SAAS,EAAE,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,0BAA0B;KACnD,CAAC,CAAC;IAEH,OAAO;QACL,MAAM,EAAE,MAAA,MAAM,CAAC,MAAM,mCAAI,EAAE;QAC3B,MAAM,EAAE,MAAA,MAAM,CAAC,MAAM,mCAAI,EAAE;QAC3B,OAAO,EAAE,UAAU;QACnB,QAAQ,EAAE,MAAM,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,kBAAW,MAAM,CAAC,MAAM,CAAE,CAAC,CAAC,CAAC,CAAC,CAAC;KACnG,CAAC;AACJ,CAAC;AAOC,8DAAyB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { describe } from '@jest/globals';
|
|
5
|
+
/**
|
|
6
|
+
* Conditional describe wrapper for E2E tests that require Service Principal authentication.
|
|
7
|
+
*
|
|
8
|
+
* E2E tests will be skipped if required environment variables are not set:
|
|
9
|
+
* - SP_CLIENT_ID: Service Principal Application ID
|
|
10
|
+
* - SP_CLIENT_SECRET: Service Principal Secret
|
|
11
|
+
* - SP_TENANT_ID: Azure AD Tenant ID
|
|
12
|
+
*
|
|
13
|
+
* Usage:
|
|
14
|
+
* ```typescript
|
|
15
|
+
* import { describeE2E } from '../helpers/e2eTestHelpers';
|
|
16
|
+
*
|
|
17
|
+
* describeE2E('My E2E test suite', () => {
|
|
18
|
+
* it('should do something', () => { ... });
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare const hasRequiredEnvVars: boolean;
|
|
23
|
+
export declare const describeE2E: typeof describe;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e2eTestHelpers.d.ts","sourceRoot":"","sources":["../../../src/__tests__/helpers/e2eTestHelpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,kBAAkB,SAI9B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,OAAO,QAE7B,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.describeE2E = exports.hasRequiredEnvVars = void 0;
|
|
7
|
+
var globals_1 = require("@jest/globals");
|
|
8
|
+
/**
|
|
9
|
+
* Conditional describe wrapper for E2E tests that require Service Principal authentication.
|
|
10
|
+
*
|
|
11
|
+
* E2E tests will be skipped if required environment variables are not set:
|
|
12
|
+
* - SP_CLIENT_ID: Service Principal Application ID
|
|
13
|
+
* - SP_CLIENT_SECRET: Service Principal Secret
|
|
14
|
+
* - SP_TENANT_ID: Azure AD Tenant ID
|
|
15
|
+
*
|
|
16
|
+
* Usage:
|
|
17
|
+
* ```typescript
|
|
18
|
+
* import { describeE2E } from '../helpers/e2eTestHelpers';
|
|
19
|
+
*
|
|
20
|
+
* describeE2E('My E2E test suite', () => {
|
|
21
|
+
* it('should do something', () => { ... });
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
exports.hasRequiredEnvVars = !!(process.env.SP_CLIENT_ID &&
|
|
26
|
+
process.env.SP_CLIENT_SECRET &&
|
|
27
|
+
process.env.SP_TENANT_ID);
|
|
28
|
+
exports.describeE2E = (function () {
|
|
29
|
+
return (exports.hasRequiredEnvVars ? globals_1.describe : globals_1.describe.skip);
|
|
30
|
+
})();
|
|
31
|
+
//# sourceMappingURL=e2eTestHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e2eTestHelpers.js","sourceRoot":"","sources":["../../../src/__tests__/helpers/e2eTestHelpers.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,yCAAyC;AAEzC;;;;;;;;;;;;;;;;GAgBG;AACU,QAAA,kBAAkB,GAAG,CAAC,CAAC,CAClC,OAAO,CAAC,GAAG,CAAC,YAAY;IACxB,OAAO,CAAC,GAAG,CAAC,gBAAgB;IAC5B,OAAO,CAAC,GAAG,CAAC,YAAY,CACzB,CAAC;AAEW,QAAA,WAAW,GAAoB,CAAC;IAC3C,OAAO,CAAC,0BAAkB,CAAC,CAAC,CAAC,kBAAQ,CAAC,CAAC,CAAC,kBAAQ,CAAC,IAAI,CAAoB,CAAC;AAC5E,CAAC,CAAC,EAAE,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
import { PowerAppsRepoConfig } from '@microsoft/powerapps-player-actions/lib/Config/Config.types';
|
|
2
3
|
/**
|
|
3
4
|
* Creates a test folder relative to the current working directory.
|
|
4
5
|
*
|
|
@@ -53,8 +54,13 @@ export declare function setupE2eTestProject(config: {
|
|
|
53
54
|
cliPath?: string;
|
|
54
55
|
tempBaseDir: string;
|
|
55
56
|
testFolderName: string;
|
|
56
|
-
hostTemplateFolder
|
|
57
|
+
hostTemplateFolder?: string;
|
|
57
58
|
}): string;
|
|
59
|
+
/**
|
|
60
|
+
* Extracts a zip file using the native 'tar' command (available on Windows 10+, Mac, Linux).
|
|
61
|
+
* This avoids adding a dependency like adm-zip.
|
|
62
|
+
*/
|
|
63
|
+
export declare function extractZip(source: string, destination: string): void;
|
|
58
64
|
/**
|
|
59
65
|
* Cleans up an E2E test project by removing the temporary directory and all its contents.
|
|
60
66
|
*
|
|
@@ -65,11 +71,9 @@ export declare function cleanupE2eTestProject(projectRoot: string): void;
|
|
|
65
71
|
* Creates a function that executes CLI commands with predefined configuration.
|
|
66
72
|
* Isolates the stdout and stderr for each executor instance.
|
|
67
73
|
*
|
|
68
|
-
* @param {object} options - Configuration options for command execution
|
|
69
74
|
* @param {string} [options.cliPath] - Path to the CLI entry point (defaults to dist/nomodule/powerapps-player-cli.js)
|
|
70
75
|
* @param {string} options.workingDirectory - Working directory for command execution
|
|
71
76
|
* @param {NodeJS.ProcessEnv} [options.envOverrides] - Environment variable overrides
|
|
72
|
-
*
|
|
73
77
|
* @returns {(verb: string, args?: string[]) => CliCommandResult} Command executor function
|
|
74
78
|
*/
|
|
75
79
|
export declare function createExecuteCodeCommand(options: {
|
|
@@ -85,10 +89,11 @@ export declare function createExecuteCodeCommand(options: {
|
|
|
85
89
|
* @param {string} [options.cliPath] - Path to the CLI entry point (defaults to dist/nomodule/powerapps-player-cli.js)
|
|
86
90
|
* @param {string} options.workingDirectory - Working directory for command execution
|
|
87
91
|
* @param {NodeJS.ProcessEnv} [options.envOverrides] - Environment variable overrides
|
|
88
|
-
* @returns {(verb: string, args?: string[]) => CliCommandResultWithExitCode
|
|
92
|
+
* @returns {(verb: string, args?: string[]) => CliCommandResultWithExitCode} executor function
|
|
89
93
|
*/
|
|
90
94
|
export declare function createExecuteCodeCommandAllowFailure(options: {
|
|
91
95
|
cliPath?: string;
|
|
92
96
|
workingDirectory: string;
|
|
93
97
|
envOverrides?: NodeJS.ProcessEnv;
|
|
94
98
|
}): (verb: string, args?: string[]) => import("./commandLineUtils").CliCommandResultWithExitCode;
|
|
99
|
+
export declare function readConfig(projectRoot: string): PowerAppsRepoConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testHelpers.d.ts","sourceRoot":"","sources":["../../../src/__tests__/helpers/testHelpers.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"testHelpers.d.ts","sourceRoot":"","sources":["../../../src/__tests__/helpers/testHelpers.ts"],"names":[],"mappings":";AAgBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6DAA6D,CAAC;AAGlG;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAU3D;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAO1D;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAI7E;AAED,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAElE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAiBhE;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,IAAI,CA2BxF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,GAAG,MAAM,CAmCT;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAQpE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAI/D;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CAClC,UAkBe,MAAM,SAAQ,MAAM,EAAE,mDAIrC;AAED;;;;;;;;;GASG;AACH,wBAAgB,oCAAoC,CAAC,OAAO,EAAE;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CAClC,UAkBe,MAAM,SAAQ,MAAM,EAAE,+DAIrC;AAED,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,mBAAmB,CAEnE"}
|
|
@@ -25,7 +25,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
25
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.createExecuteCodeCommandAllowFailure = exports.createExecuteCodeCommand = exports.cleanupE2eTestProject = exports.setupE2eTestProject = exports.validateGeneratedFiles = exports.copyDirRecursive = exports.readJson = exports.copyHostTemplateApp = exports.cleanupTestFolder = exports.createTestFolder = void 0;
|
|
28
|
+
exports.readConfig = exports.createExecuteCodeCommandAllowFailure = exports.createExecuteCodeCommand = exports.cleanupE2eTestProject = exports.extractZip = exports.setupE2eTestProject = exports.validateGeneratedFiles = exports.copyDirRecursive = exports.readJson = exports.copyHostTemplateApp = exports.cleanupTestFolder = exports.createTestFolder = void 0;
|
|
29
29
|
/*!
|
|
30
30
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
31
31
|
*/
|
|
@@ -34,6 +34,7 @@ var fs_1 = __importDefault(require("fs"));
|
|
|
34
34
|
var path_1 = __importDefault(require("path"));
|
|
35
35
|
var process_1 = __importDefault(require("process"));
|
|
36
36
|
var commandLineUtils_1 = require("./commandLineUtils");
|
|
37
|
+
var child_process_1 = require("child_process");
|
|
37
38
|
// Test helpers for power-data-runtime tests
|
|
38
39
|
/**
|
|
39
40
|
* Creates a test folder relative to the current working directory.
|
|
@@ -178,12 +179,30 @@ function setupE2eTestProject(config) {
|
|
|
178
179
|
fs_1.default.mkdirSync(projectRoot, { recursive: true });
|
|
179
180
|
}
|
|
180
181
|
// Copy the host template folder if it exists
|
|
181
|
-
if (
|
|
182
|
-
|
|
182
|
+
if (config.hostTemplateFolder) {
|
|
183
|
+
if (config.hostTemplateFolder.endsWith('.zip')) {
|
|
184
|
+
extractZip(config.hostTemplateFolder, projectRoot);
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
copyDirRecursive(config.hostTemplateFolder, projectRoot);
|
|
188
|
+
}
|
|
183
189
|
}
|
|
184
190
|
return projectRoot;
|
|
185
191
|
}
|
|
186
192
|
exports.setupE2eTestProject = setupE2eTestProject;
|
|
193
|
+
/**
|
|
194
|
+
* Extracts a zip file using the native 'tar' command (available on Windows 10+, Mac, Linux).
|
|
195
|
+
* This avoids adding a dependency like adm-zip.
|
|
196
|
+
*/
|
|
197
|
+
function extractZip(source, destination) {
|
|
198
|
+
if (!fs_1.default.existsSync(destination)) {
|
|
199
|
+
fs_1.default.mkdirSync(destination, { recursive: true });
|
|
200
|
+
}
|
|
201
|
+
// 'tar' is built-in on Windows 10+, macOS, and Linux
|
|
202
|
+
// -x: extract, -f: file, -C: change directory
|
|
203
|
+
(0, child_process_1.spawnSync)('tar', ['-xf', source, '-C', destination], { stdio: 'inherit' });
|
|
204
|
+
}
|
|
205
|
+
exports.extractZip = extractZip;
|
|
187
206
|
/**
|
|
188
207
|
* Cleans up an E2E test project by removing the temporary directory and all its contents.
|
|
189
208
|
*
|
|
@@ -199,11 +218,9 @@ exports.cleanupE2eTestProject = cleanupE2eTestProject;
|
|
|
199
218
|
* Creates a function that executes CLI commands with predefined configuration.
|
|
200
219
|
* Isolates the stdout and stderr for each executor instance.
|
|
201
220
|
*
|
|
202
|
-
* @param {object} options - Configuration options for command execution
|
|
203
221
|
* @param {string} [options.cliPath] - Path to the CLI entry point (defaults to dist/nomodule/powerapps-player-cli.js)
|
|
204
222
|
* @param {string} options.workingDirectory - Working directory for command execution
|
|
205
223
|
* @param {NodeJS.ProcessEnv} [options.envOverrides] - Environment variable overrides
|
|
206
|
-
*
|
|
207
224
|
* @returns {(verb: string, args?: string[]) => CliCommandResult} Command executor function
|
|
208
225
|
*/
|
|
209
226
|
function createExecuteCodeCommand(options) {
|
|
@@ -234,7 +251,7 @@ exports.createExecuteCodeCommand = createExecuteCodeCommand;
|
|
|
234
251
|
* @param {string} [options.cliPath] - Path to the CLI entry point (defaults to dist/nomodule/powerapps-player-cli.js)
|
|
235
252
|
* @param {string} options.workingDirectory - Working directory for command execution
|
|
236
253
|
* @param {NodeJS.ProcessEnv} [options.envOverrides] - Environment variable overrides
|
|
237
|
-
* @returns {(verb: string, args?: string[]) => CliCommandResultWithExitCode
|
|
254
|
+
* @returns {(verb: string, args?: string[]) => CliCommandResultWithExitCode} executor function
|
|
238
255
|
*/
|
|
239
256
|
function createExecuteCodeCommandAllowFailure(options) {
|
|
240
257
|
var _a;
|
|
@@ -256,4 +273,8 @@ function createExecuteCodeCommandAllowFailure(options) {
|
|
|
256
273
|
};
|
|
257
274
|
}
|
|
258
275
|
exports.createExecuteCodeCommandAllowFailure = createExecuteCodeCommandAllowFailure;
|
|
276
|
+
function readConfig(projectRoot) {
|
|
277
|
+
return JSON.parse(fs_1.default.readFileSync(path_1.default.join(projectRoot, 'power.config.json'), 'utf-8'));
|
|
278
|
+
}
|
|
279
|
+
exports.readConfig = readConfig;
|
|
259
280
|
//# sourceMappingURL=testHelpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testHelpers.js","sourceRoot":"","sources":["../../../src/__tests__/helpers/testHelpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;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YAAY,CAAC,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,mBAAmB,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;AAC3F,CAAC;AAFD,gCAEC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/powerapps-data",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.17",
|
|
4
4
|
"description": "Package providing the data functionalities for Power Apps SDK",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
"bundle": "pa-client-bundle --nopolyfills --externals ./externals.js --bundlename powerapps-data"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@pa-client/powerapps-player-services": "
|
|
15
|
+
"@pa-client/powerapps-player-services": "3.0.1"
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
18
18
|
"lib/",
|
|
19
19
|
"package.json"
|
|
20
20
|
],
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@pa-client/build-scripts": "
|
|
22
|
+
"@pa-client/build-scripts": "1.0.0",
|
|
23
23
|
"@types/enzyme": "3.10.3",
|
|
24
24
|
"@types/jest": "29.5.6",
|
|
25
25
|
"@jest/globals": "29.7.0",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
3
3
|
*/
|
|
4
|
-
import { IConnectedDatasetListMetadata } from '@pa-client/powerapps-player-services
|
|
4
|
+
import { IConnectedDatasetListMetadata } from '@pa-client/powerapps-player-services';
|
|
5
5
|
import { ListDataSetsContext } from '../Types/ActionTypes';
|
|
6
6
|
export declare function listDatasetsAsync(context: ListDataSetsContext): Promise<IConnectedDatasetListMetadata>;
|
|
7
7
|
//# sourceMappingURL=ListDatasets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListDatasets.d.ts","sourceRoot":"","sources":["../../src/Actions/ListDatasets.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"ListDatasets.d.ts","sourceRoot":"","sources":["../../src/Actions/ListDatasets.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAIL,6BAA6B,EAC9B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,6BAA6B,CAAC,CAmBxC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
3
3
|
*/
|
|
4
|
-
import { getDatasetsAsync, } from '@pa-client/powerapps-player-services
|
|
5
|
-
import { getConnectionByNameAsync, getConnectorAsync, } from '@pa-client/powerapps-player-services/lib/Services/Connectivity/ConnectivityService';
|
|
4
|
+
import { getConnectionByNameAsync, getConnectorAsync, getDatasetsAsync, } from '@pa-client/powerapps-player-services';
|
|
6
5
|
export async function listDatasetsAsync(context) {
|
|
7
6
|
const connectorName = context.actionsParams.apiId;
|
|
8
7
|
const connectionName = context.actionsParams.connectionId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListDatasets.js","sourceRoot":"","sources":["../../src/Actions/ListDatasets.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"ListDatasets.js","sourceRoot":"","sources":["../../src/Actions/ListDatasets.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,GAEjB,MAAM,sCAAsC,CAAC;AAG9C,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,OAA4B;IAE5B,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC;IAClD,MAAM,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,YAAY,CAAC;IAE1D,IAAI,CAAC,aAAa,IAAI,CAAC,cAAc,EAAE;QACrC,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;KAChF;IAED,MAAM,SAAS,GAAG,MAAM,iBAAiB,CAAC,aAAa,CAAC,CAAC;IACzD,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,IAAI,KAAK,CAAC,uBAAuB,aAAa,aAAa,CAAC,CAAC;KACpE;IAED,MAAM,UAAU,GAAG,MAAM,wBAAwB,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC;IACjF,IAAI,CAAC,UAAU,EAAE;QACf,MAAM,IAAI,KAAK,CAAC,wBAAwB,cAAc,4BAA4B,aAAa,GAAG,CAAC,CAAC;KACrG;IAED,OAAO,MAAM,gBAAgB,CAAC,UAAU,EAAE,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PushApp.d.ts","sourceRoot":"","sources":["../../src/Actions/PushApp.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,GAAG,EAAmC,MAAM,sCAAsC,CAAC;AAWjG,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"PushApp.d.ts","sourceRoot":"","sources":["../../src/Actions/PushApp.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,GAAG,EAAmC,MAAM,sCAAsC,CAAC;AAWjG,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAWtD,wBAAsB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,CA4EnE"}
|
|
@@ -93,10 +93,16 @@ async function uploadFilesToBlob(powerConfig, blobUri, vfs, logger) {
|
|
|
93
93
|
try {
|
|
94
94
|
// Recursively collect all files from buildPath, handling nested directories
|
|
95
95
|
const allFiles = await collectAllFiles(buildPath, vfs);
|
|
96
|
+
// Normalize buildPath by removing leading ./ for consistent replacement
|
|
97
|
+
const normalizedBuildPath = buildPath.replace(/^\.\//, '');
|
|
96
98
|
logger.trackActivityEvent('PushApp.SaveApp.UploadFiles.FileCount', { fileCount: allFiles.length });
|
|
97
99
|
for (const fullFilePath of allFiles) {
|
|
98
|
-
const fileContent = await vfs.readFile(fullFilePath);
|
|
99
|
-
|
|
100
|
+
const fileContent = await vfs.readFile(fullFilePath, 'utf-8');
|
|
101
|
+
// Normalize path: remove buildPath prefix, convert backslashes to forward slashes for URLs, and remove leading slash
|
|
102
|
+
const relativePath = fullFilePath
|
|
103
|
+
.replace(normalizedBuildPath, '')
|
|
104
|
+
.replace(/\\/g, '/')
|
|
105
|
+
.replace(/^\//, '');
|
|
100
106
|
const url = `${baseUrl}/${relativePath}${restUrl}`;
|
|
101
107
|
await httpClient.put(url, {
|
|
102
108
|
headers: {
|
|
@@ -107,7 +113,7 @@ async function uploadFilesToBlob(powerConfig, blobUri, vfs, logger) {
|
|
|
107
113
|
});
|
|
108
114
|
}
|
|
109
115
|
uploadFilesScenario.complete();
|
|
110
|
-
return `${baseUrl}/${buildEntryPoint.replace(
|
|
116
|
+
return `${baseUrl}/${buildEntryPoint.replace(normalizedBuildPath, '').replace(/^\//, '')}${restUrl}`;
|
|
111
117
|
}
|
|
112
118
|
catch (error) {
|
|
113
119
|
uploadFilesScenario.failure({ error: stringifyError(error) });
|
|
@@ -150,6 +156,7 @@ async function collectAllFiles(dirPath, vfs) {
|
|
|
150
156
|
function createAppMetadata(powerConfig, environmentName, documentUri, appSubtype) {
|
|
151
157
|
const appMetadata = {
|
|
152
158
|
appType: 'CodeApp',
|
|
159
|
+
appSubtype: 'BYOCApp',
|
|
153
160
|
properties: {
|
|
154
161
|
lifeCycleId: 'Draft',
|
|
155
162
|
displayName: powerConfig.appDisplayName || 'New App' + Date.now(),
|
|
@@ -169,6 +176,8 @@ function createAppMetadata(powerConfig, environmentName, documentUri, appSubtype
|
|
|
169
176
|
name: environmentName,
|
|
170
177
|
id: `/providers/Microsoft.PowerApps/environments/${environmentName}`,
|
|
171
178
|
},
|
|
179
|
+
connectionReferences: powerConfig.connectionReferences,
|
|
180
|
+
databaseReferences: constructDatabaseReferences(powerConfig.databaseReferences),
|
|
172
181
|
},
|
|
173
182
|
};
|
|
174
183
|
if (appSubtype) {
|
|
@@ -176,4 +185,24 @@ function createAppMetadata(powerConfig, environmentName, documentUri, appSubtype
|
|
|
176
185
|
}
|
|
177
186
|
return appMetadata;
|
|
178
187
|
}
|
|
188
|
+
function constructDatabaseReferences(databaseReferences) {
|
|
189
|
+
var _a;
|
|
190
|
+
const constructedDatabaseReferences = {};
|
|
191
|
+
if (!databaseReferences) {
|
|
192
|
+
return constructedDatabaseReferences;
|
|
193
|
+
}
|
|
194
|
+
for (const key of Object.keys(databaseReferences)) {
|
|
195
|
+
const value = databaseReferences[key];
|
|
196
|
+
constructedDatabaseReferences[key] = {
|
|
197
|
+
databaseDetails: {
|
|
198
|
+
environmentName: key,
|
|
199
|
+
overrideValues: {
|
|
200
|
+
environmentVariableName: (_a = value === null || value === void 0 ? void 0 : value.environmentVariableName) !== null && _a !== void 0 ? _a : '',
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
dataSources: value === null || value === void 0 ? void 0 : value.dataSources,
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
return constructedDatabaseReferences;
|
|
207
|
+
}
|
|
179
208
|
//# sourceMappingURL=PushApp.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PushApp.js","sourceRoot":"","sources":["../../src/Actions/PushApp.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAY,sBAAsB,EAAW,MAAM,sCAAsC,CAAC;AACjG,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAC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AC;KACH;IAED,OAAO,6BAA6B,CAAC;AACvC,CAAC"}
|
|
@@ -1,6 +1,26 @@
|
|
|
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;
|
|
6
26
|
//# sourceMappingURL=codeGenUtils.d.ts.map
|