@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/CodeGen/modelServiceGenerator.js
CHANGED
|
@@ -264,13 +264,13 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
264
264
|
_c.sent();
|
|
265
265
|
return [3 /*break*/, 9];
|
|
266
266
|
case 3:
|
|
267
|
-
if (!
|
|
267
|
+
if (!(0, codeGenUtils_1.isSqlStoredProcedure)(schema)) return [3 /*break*/, 5];
|
|
268
268
|
return [4 /*yield*/, this.handleSqlStoredProcedure(modelName, dataSourceName, schema, schemaJson, processedOutputDir, vfs)];
|
|
269
269
|
case 4:
|
|
270
270
|
_c.sent();
|
|
271
271
|
return [3 /*break*/, 9];
|
|
272
272
|
case 5:
|
|
273
|
-
if (!
|
|
273
|
+
if (!(0, codeGenUtils_1.isSharepointSchema)(schema)) return [3 /*break*/, 7];
|
|
274
274
|
return [4 /*yield*/, this.handleSharepointSchema(modelName, dataSourceName, schema, schemaJson, processedOutputDir, vfs)];
|
|
275
275
|
case 6:
|
|
276
276
|
_c.sent();
|
|
@@ -295,7 +295,7 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
295
295
|
case 0: return [4 /*yield*/, this.loadSchemaFromFile(schemaPath, vfs, false)];
|
|
296
296
|
case 1:
|
|
297
297
|
schema = _b.sent();
|
|
298
|
-
modelName =
|
|
298
|
+
modelName = (0, nameUtility_1.extractModelName)(schema, schemaPath, vfs).modelName;
|
|
299
299
|
return [2 /*return*/, modelName];
|
|
300
300
|
}
|
|
301
301
|
});
|
|
@@ -320,7 +320,7 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
320
320
|
if (typeof schema !== 'object' || schema === null || Array.isArray(schema)) {
|
|
321
321
|
throw new Error('Schema must be a valid JSON object');
|
|
322
322
|
}
|
|
323
|
-
_c =
|
|
323
|
+
_c = (0, nameUtility_1.extractModelName)(schema, schemaPath, vfs), modelName = _c.modelName, dataSourceName = _c.dataSourceName;
|
|
324
324
|
return [2 /*return*/, {
|
|
325
325
|
schema: schema,
|
|
326
326
|
schemaJson: schemaJson,
|
|
@@ -396,128 +396,6 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
396
396
|
!Array.isArray(schema.properties) &&
|
|
397
397
|
Object.prototype.hasOwnProperty.call(schema.properties, 'swagger'));
|
|
398
398
|
};
|
|
399
|
-
/**
|
|
400
|
-
* The extractModelName method extracts the model name and data source name from the schema.
|
|
401
|
-
* Returns an object with modelName and dataSourceName.
|
|
402
|
-
*/
|
|
403
|
-
ModelServiceGenerator.extractModelName = function (schema, schemaPath, vfs) {
|
|
404
|
-
if (!schema) {
|
|
405
|
-
throw new Error('Schema cannot be null.');
|
|
406
|
-
}
|
|
407
|
-
// Check if this is a Dataverse entity schema
|
|
408
|
-
if (this.isDataverseEntity(schema)) {
|
|
409
|
-
var entitySetName = this.getDataverseEntitySetName(schema);
|
|
410
|
-
if (entitySetName) {
|
|
411
|
-
var modelName_1 = this.capitalizeForFileName((0, nameUtility_1.sanitizeName)(entitySetName));
|
|
412
|
-
return { modelName: modelName_1, dataSourceName: entitySetName === null || entitySetName === void 0 ? void 0 : entitySetName.trim() };
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
var nameNode = this.getNameNode(schema);
|
|
416
|
-
var modelName;
|
|
417
|
-
var dataSourceName;
|
|
418
|
-
if (this.isSharedName(nameNode)) {
|
|
419
|
-
modelName = this.getDisplayName(schema);
|
|
420
|
-
dataSourceName = this.getSharedDataSourceName(nameNode);
|
|
421
|
-
}
|
|
422
|
-
else if (this.isGuid(nameNode)) {
|
|
423
|
-
modelName = this.getTitle(schema);
|
|
424
|
-
dataSourceName = modelName;
|
|
425
|
-
}
|
|
426
|
-
else if (this.isSqlStoredProcedure(schema)) {
|
|
427
|
-
modelName = (0, nameUtility_1.sanitizeSqlName)(nameNode);
|
|
428
|
-
dataSourceName = this.getParentFolderName(schemaPath, vfs);
|
|
429
|
-
}
|
|
430
|
-
else {
|
|
431
|
-
modelName = /[\\/](sql)[\\/]/i.test(schemaPath) ? (0, nameUtility_1.sanitizeSqlName)(nameNode) : (0, nameUtility_1.sanitizeName)(nameNode);
|
|
432
|
-
dataSourceName = modelName;
|
|
433
|
-
}
|
|
434
|
-
modelName = this.capitalizeForFileName((0, nameUtility_1.sanitizeName)(modelName));
|
|
435
|
-
return { modelName: modelName, dataSourceName: dataSourceName };
|
|
436
|
-
};
|
|
437
|
-
/**
|
|
438
|
-
* The getNameNode method retrieves the name node from the schema.
|
|
439
|
-
*/
|
|
440
|
-
ModelServiceGenerator.getNameNode = function (schema) {
|
|
441
|
-
if (schema !== null && typeof schema === 'object' && !Array.isArray(schema)) {
|
|
442
|
-
var nameNode = schema.name;
|
|
443
|
-
if (typeof nameNode !== 'string' || !nameNode.trim()) {
|
|
444
|
-
throw new Error("No 'name' node found in schema");
|
|
445
|
-
}
|
|
446
|
-
return nameNode;
|
|
447
|
-
}
|
|
448
|
-
throw new Error('Schema must be a JSON object to extract name');
|
|
449
|
-
};
|
|
450
|
-
/**
|
|
451
|
-
* The isSharedName method checks if the name node is a shared name.
|
|
452
|
-
*/
|
|
453
|
-
ModelServiceGenerator.isSharedName = function (nameNode) {
|
|
454
|
-
return nameNode.toLowerCase().startsWith('shared_');
|
|
455
|
-
};
|
|
456
|
-
/**
|
|
457
|
-
* The getDisplayName method retrieves the display name from the schema.
|
|
458
|
-
*/
|
|
459
|
-
ModelServiceGenerator.getDisplayName = function (schema) {
|
|
460
|
-
if (schema !== null && typeof schema === 'object' && !Array.isArray(schema)) {
|
|
461
|
-
var properties = schema.properties;
|
|
462
|
-
if (typeof properties === 'object' && properties !== null && !Array.isArray(properties)) {
|
|
463
|
-
var displayName = properties.displayName;
|
|
464
|
-
if (typeof displayName !== 'string' || !displayName.trim()) {
|
|
465
|
-
throw new Error("No 'displayName' found in schema properties");
|
|
466
|
-
}
|
|
467
|
-
return displayName;
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
throw new Error('Schema must be a JSON object with properties to extract displayName');
|
|
471
|
-
};
|
|
472
|
-
/**
|
|
473
|
-
* The getSharedDataSourceName method retrieves the shared data source name from the name node.
|
|
474
|
-
*/
|
|
475
|
-
ModelServiceGenerator.getSharedDataSourceName = function (nameNode) {
|
|
476
|
-
return (0, nameUtility_1.sanitizeName)(nameNode.replace(/^shared_/i, '')).toLowerCase();
|
|
477
|
-
};
|
|
478
|
-
/**
|
|
479
|
-
* The isGuid method checks if the name node is a GUID.
|
|
480
|
-
*/
|
|
481
|
-
ModelServiceGenerator.isGuid = function (nameNode) {
|
|
482
|
-
// GUID regex, C# Guid.TryParse equivalent
|
|
483
|
-
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);
|
|
484
|
-
};
|
|
485
|
-
/**
|
|
486
|
-
* The isDataverseEntity method checks if the schema represents a Dataverse entity.
|
|
487
|
-
*/
|
|
488
|
-
ModelServiceGenerator.isDataverseEntity = function (schema) {
|
|
489
|
-
if (schema !== null && typeof schema === 'object' && !Array.isArray(schema)) {
|
|
490
|
-
var schemaObject = schema;
|
|
491
|
-
// Check if this has the Dataverse schema structure with schema.items
|
|
492
|
-
if (typeof schemaObject.schema === 'object' && schemaObject.schema !== null) {
|
|
493
|
-
var schemaProperty = schemaObject.schema;
|
|
494
|
-
if (typeof schemaProperty.items === 'object' && schemaProperty.items !== null) {
|
|
495
|
-
var items = schemaProperty.items;
|
|
496
|
-
return items['x-ms-dataverse-entity'] === true;
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
return false;
|
|
501
|
-
};
|
|
502
|
-
/**
|
|
503
|
-
* The getDataverseEntitySetName method retrieves the entity set name from a Dataverse schema.
|
|
504
|
-
*/
|
|
505
|
-
ModelServiceGenerator.getDataverseEntitySetName = function (schema) {
|
|
506
|
-
if (schema !== null && typeof schema === 'object' && !Array.isArray(schema)) {
|
|
507
|
-
var schemaObject = schema;
|
|
508
|
-
if (typeof schemaObject.schema === 'object' && schemaObject.schema !== null) {
|
|
509
|
-
var schemaProperty = schemaObject.schema;
|
|
510
|
-
if (typeof schemaProperty.items === 'object' && schemaProperty.items !== null) {
|
|
511
|
-
var items = schemaProperty.items;
|
|
512
|
-
var entitySetName = items['x-ms-dataverse-entityset'];
|
|
513
|
-
if (typeof entitySetName === 'string' && entitySetName.trim()) {
|
|
514
|
-
return entitySetName;
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
return null;
|
|
520
|
-
};
|
|
521
399
|
/**
|
|
522
400
|
* Checks if a property is a Dataverse lookup column.
|
|
523
401
|
*/
|
|
@@ -564,42 +442,6 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
564
442
|
ModelServiceGenerator.generateLookupValuePropertyName = function (lookupPropertyName) {
|
|
565
443
|
return "_".concat(lookupPropertyName, "_value");
|
|
566
444
|
};
|
|
567
|
-
/**
|
|
568
|
-
* The getTitle method retrieves the title from the schema.
|
|
569
|
-
*/
|
|
570
|
-
ModelServiceGenerator.getTitle = function (schema) {
|
|
571
|
-
if (schema !== null && typeof schema === 'object' && !Array.isArray(schema)) {
|
|
572
|
-
var title = schema.title;
|
|
573
|
-
if (typeof title !== 'string' || !title.trim()) {
|
|
574
|
-
throw new Error("No 'title' found in schema");
|
|
575
|
-
}
|
|
576
|
-
return title;
|
|
577
|
-
}
|
|
578
|
-
throw new Error('Schema must be a JSON object to extract title');
|
|
579
|
-
};
|
|
580
|
-
/**
|
|
581
|
-
* The getParentFolderName method retrieves the parent folder name from the schema path.
|
|
582
|
-
*/
|
|
583
|
-
ModelServiceGenerator.getParentFolderName = function (schemaPath, vfs) {
|
|
584
|
-
var directoryName = vfs.dirname(schemaPath);
|
|
585
|
-
if (!directoryName) {
|
|
586
|
-
throw new Error('The schemaPath does not have a valid directory.');
|
|
587
|
-
}
|
|
588
|
-
var parentFolderName = vfs.basename(directoryName);
|
|
589
|
-
if (!parentFolderName) {
|
|
590
|
-
throw new Error('The directory does not have a valid parent folder name.');
|
|
591
|
-
}
|
|
592
|
-
return parentFolderName.toLowerCase();
|
|
593
|
-
};
|
|
594
|
-
/**
|
|
595
|
-
* Capitalizes the first letter of a string for file naming purposes only
|
|
596
|
-
*/
|
|
597
|
-
ModelServiceGenerator.capitalizeForFileName = function (name) {
|
|
598
|
-
if (!name) {
|
|
599
|
-
return name;
|
|
600
|
-
}
|
|
601
|
-
return name.charAt(0).toUpperCase() + name.slice(1);
|
|
602
|
-
};
|
|
603
445
|
/**
|
|
604
446
|
* The addCopyrightNotice method adds a copyright notice to the generated files.
|
|
605
447
|
*/
|
|
@@ -668,14 +510,14 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
668
510
|
// Ensure schemaName is a string before passing to generateODataBindPropertyName
|
|
669
511
|
var schemaNameStr = typeof schemaName === 'string' ? schemaName : propName;
|
|
670
512
|
var odataBindProp = this.generateODataBindPropertyName(schemaNameStr);
|
|
671
|
-
var formattedPropName_1 =
|
|
513
|
+
var formattedPropName_1 = (0, nameUtility_1.formatPropertyName)(odataBindProp);
|
|
672
514
|
var optionalMark_1 = requiredFields.has(propName) ? '' : '?';
|
|
673
515
|
lines.push(" ".concat(formattedPropName_1).concat(optionalMark_1, ": string;"));
|
|
674
516
|
}
|
|
675
517
|
continue;
|
|
676
518
|
}
|
|
677
|
-
var formattedPropName =
|
|
678
|
-
formattedPropName =
|
|
519
|
+
var formattedPropName = (0, nameUtility_1.formatPropertyName)((0, codeGenUtils_1.convertToValidIdentifier)(propName));
|
|
520
|
+
formattedPropName = (0, nameUtility_1.normalizePropertyName)(formattedPropName);
|
|
679
521
|
var tsType = this.determineTypeScriptType(originalModelName, propValueAsObject, '', propName);
|
|
680
522
|
var optionalMark = requiredFields.has(propName) ? '' : '?';
|
|
681
523
|
this.addPropertyComment(lines, propValueAsObject, '');
|
|
@@ -717,8 +559,8 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
717
559
|
if (lookupColumns.has(propName)) {
|
|
718
560
|
continue;
|
|
719
561
|
}
|
|
720
|
-
var formattedPropName =
|
|
721
|
-
formattedPropName =
|
|
562
|
+
var formattedPropName = (0, nameUtility_1.formatPropertyName)((0, codeGenUtils_1.convertToValidIdentifier)(propName));
|
|
563
|
+
formattedPropName = (0, nameUtility_1.normalizePropertyName)(formattedPropName);
|
|
722
564
|
var tsType = this.determineTypeScriptType(modelName, propValueAsObject, '', propName);
|
|
723
565
|
var optionalMark = requiredFields.has(propName) ? '' : '?';
|
|
724
566
|
this.addPropertyComment(lines, propValueAsObject, '');
|
|
@@ -738,10 +580,10 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
738
580
|
for (var lookupPropNames_1 = __values(lookupPropNames), lookupPropNames_1_1 = lookupPropNames_1.next(); !lookupPropNames_1_1.done; lookupPropNames_1_1 = lookupPropNames_1.next()) {
|
|
739
581
|
var lookupPropName = lookupPropNames_1_1.value;
|
|
740
582
|
// Add the lookup object property
|
|
741
|
-
lines.push(" ".concat(
|
|
583
|
+
lines.push(" ".concat((0, nameUtility_1.formatPropertyName)((0, codeGenUtils_1.convertToValidIdentifier)(lookupPropName)), "?: object;"));
|
|
742
584
|
// Add the lookup value property (_propname_value)
|
|
743
585
|
var valuePropName = this.generateLookupValuePropertyName(lookupPropName);
|
|
744
|
-
var formattedValuePropName =
|
|
586
|
+
var formattedValuePropName = (0, nameUtility_1.formatPropertyName)(valuePropName);
|
|
745
587
|
lines.push(" ".concat(formattedValuePropName, "?: string;"));
|
|
746
588
|
}
|
|
747
589
|
}
|
|
@@ -950,11 +792,13 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
950
792
|
*/
|
|
951
793
|
ModelServiceGenerator.generateModelFromSchema = function (modelName, definition) {
|
|
952
794
|
modelName = (0, codeGenUtils_1.convertToValidIdentifier)(this.simplifyGenericInterfaceName(modelName));
|
|
953
|
-
// Start with copyright notice
|
|
954
795
|
var lines = [];
|
|
955
|
-
|
|
956
|
-
//
|
|
957
|
-
if ('type' in definition &&
|
|
796
|
+
// If it's a simple type (e.g., string, number, boolean) and has no "properties" or "items", generate a type alias
|
|
797
|
+
// Note: We exclude definitions with "items" because those are array types that need special handling
|
|
798
|
+
if ('type' in definition &&
|
|
799
|
+
definition.type &&
|
|
800
|
+
!('properties' in definition) &&
|
|
801
|
+
!('items' in definition)) {
|
|
958
802
|
var tsType = this.mapJsonTypeToTypeScript(definition.type);
|
|
959
803
|
lines.push("export type ".concat(modelName, " = ").concat(tsType, ";"));
|
|
960
804
|
return lines.join('\n');
|
|
@@ -965,7 +809,18 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
965
809
|
lines.push(this.generateTypeAliasForEmptyObject(modelName));
|
|
966
810
|
return lines.join('\n');
|
|
967
811
|
}
|
|
968
|
-
//
|
|
812
|
+
// Check if this is an array type definition
|
|
813
|
+
var isArrayType = definition.type === 'array' && itemsNode;
|
|
814
|
+
if (isArrayType) {
|
|
815
|
+
// For array types, generate an interface for the item type and a type alias for the array
|
|
816
|
+
var itemInterfaceName = "".concat(modelName, "Item");
|
|
817
|
+
var itemModelCode = this.generatePropertyLines(itemInterfaceName, itemsNode);
|
|
818
|
+
lines.push(itemModelCode);
|
|
819
|
+
lines.push('');
|
|
820
|
+
lines.push("export type ".concat(modelName, " = ").concat(itemInterfaceName, "[];"));
|
|
821
|
+
return lines.join('\n');
|
|
822
|
+
}
|
|
823
|
+
// If itemsNode exists but not an array type, pass that; otherwise, pass the full definition
|
|
969
824
|
var modelCode = itemsNode
|
|
970
825
|
? this.generatePropertyLines(modelName, itemsNode)
|
|
971
826
|
: this.generatePropertyLines(modelName, definition);
|
|
@@ -1032,9 +887,9 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
1032
887
|
try {
|
|
1033
888
|
for (var _c = __values(Object.entries(propertiesNode)), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
1034
889
|
var _e = __read(_d.value, 2), propName = _e[0], propValue = _e[1];
|
|
1035
|
-
var formattedPropName =
|
|
890
|
+
var formattedPropName = (0, nameUtility_1.formatPropertyName)((0, codeGenUtils_1.convertToValidIdentifier)(propName));
|
|
1036
891
|
// Normalize specific property names (e.g., "resultsets" => "ResultSets")
|
|
1037
|
-
formattedPropName =
|
|
892
|
+
formattedPropName = (0, nameUtility_1.normalizePropertyName)(formattedPropName);
|
|
1038
893
|
var propValueAsObject = typeof propValue === 'object' && propValue !== null && !Array.isArray(propValue)
|
|
1039
894
|
? propValue
|
|
1040
895
|
: undefined;
|
|
@@ -1054,13 +909,6 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
1054
909
|
this.closeInterfaceDeclarationWithPadding(lines, padding);
|
|
1055
910
|
return lines.join('\n');
|
|
1056
911
|
};
|
|
1057
|
-
/**
|
|
1058
|
-
* The normalizePropertyName method standardizes specific property names.
|
|
1059
|
-
* For example, it converts "resultsets" to "ResultSets".
|
|
1060
|
-
*/
|
|
1061
|
-
ModelServiceGenerator.normalizePropertyName = function (propertyName) {
|
|
1062
|
-
return propertyName.toLowerCase() === 'resultsets' ? 'ResultSets' : propertyName;
|
|
1063
|
-
};
|
|
1064
912
|
/**
|
|
1065
913
|
* Checks if a property has optionset data (enum and x-ms-enum-values)
|
|
1066
914
|
*/
|
|
@@ -1072,7 +920,7 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
1072
920
|
* Generates the enum name for an optionset property
|
|
1073
921
|
*/
|
|
1074
922
|
ModelServiceGenerator.generateOptionsetEnumName = function (modelName, propName) {
|
|
1075
|
-
var formattedPropName =
|
|
923
|
+
var formattedPropName = (0, nameUtility_1.formatPropertyName)(propName);
|
|
1076
924
|
return "".concat(modelName).concat(formattedPropName);
|
|
1077
925
|
};
|
|
1078
926
|
/**
|
|
@@ -1242,11 +1090,12 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
1242
1090
|
/*
|
|
1243
1091
|
* The extractReferencedType method extracts the referenced type from the ref value.
|
|
1244
1092
|
* It splits the ref value by '/' and returns the last part as the type name.
|
|
1093
|
+
* The result is converted to a valid TypeScript identifier (e.g., spaces become underscores).
|
|
1245
1094
|
*/
|
|
1246
1095
|
ModelServiceGenerator.extractReferencedType = function (refValue) {
|
|
1247
1096
|
var parts = refValue.split('/');
|
|
1248
1097
|
var typeName = parts[parts.length - 1];
|
|
1249
|
-
return this.normalizeGenericTypeName(typeName);
|
|
1098
|
+
return (0, codeGenUtils_1.convertToValidIdentifier)(this.normalizeGenericTypeName(typeName));
|
|
1250
1099
|
};
|
|
1251
1100
|
/*
|
|
1252
1101
|
* The mapDataverseTypeToTypeScript method maps Dataverse types to TypeScript types.
|
|
@@ -1362,17 +1211,6 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
1362
1211
|
return exports.TypeScriptTypes.UNKNOWN;
|
|
1363
1212
|
}
|
|
1364
1213
|
};
|
|
1365
|
-
/*
|
|
1366
|
-
* The formatPropertyName method formats the property name.
|
|
1367
|
-
* Skips formatting if the property name already starts and ends with quotes.
|
|
1368
|
-
*/
|
|
1369
|
-
ModelServiceGenerator.formatPropertyName = function (propName) {
|
|
1370
|
-
// Skip if already quoted
|
|
1371
|
-
if (propName.startsWith('"') && propName.endsWith('"')) {
|
|
1372
|
-
return propName;
|
|
1373
|
-
}
|
|
1374
|
-
return this.isValidPropertyName(propName) ? propName : "\"".concat(propName, "\"");
|
|
1375
|
-
};
|
|
1376
1214
|
/*
|
|
1377
1215
|
* The addPropertyComment method adds a comment for the property.
|
|
1378
1216
|
*/
|
|
@@ -1901,7 +1739,7 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
1901
1739
|
* and operation ID as parameters.
|
|
1902
1740
|
*/
|
|
1903
1741
|
ModelServiceGenerator.addMethodWithoutParameters = function (operations, operationFuncName, outputModel, operationId, modelName) {
|
|
1904
|
-
operations.push(" public static async ".concat(operationFuncName, "(): Promise<IOperationResult<").concat(outputModel, ">> {"), " const result = await ".concat(modelName, "Service.client.executeAsync<void, ").concat(outputModel, ">("), " {", " connectorOperation: {", " tableName: ".concat(
|
|
1742
|
+
operations.push(" public static async ".concat(operationFuncName, "(): Promise<IOperationResult<").concat(outputModel, ">> {"), " const result = await ".concat(modelName, "Service.client.executeAsync<void, ").concat(outputModel, ">("), " {", " connectorOperation: {", " tableName: ".concat((0, nameUtility_1.getServiceName)(modelName), ","), " operationName: '".concat(operationId, "',"), " },", " });", " return result;", " }");
|
|
1905
1743
|
};
|
|
1906
1744
|
/*
|
|
1907
1745
|
* The addMethodWithParameters method generates a method with parameters for the service class.
|
|
@@ -1909,7 +1747,7 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
1909
1747
|
* parameter object, output model, data source name, and operation ID as parameters.
|
|
1910
1748
|
*/
|
|
1911
1749
|
ModelServiceGenerator.addMethodWithParameters = function (operations, operationFuncName, parameterSignature, parametersType, parameterObject, outputModel, operationId, modelName) {
|
|
1912
|
-
operations.push(" public static async ".concat(operationFuncName, "(").concat(parameterSignature, "): Promise<IOperationResult<").concat(outputModel, ">> {"), " const params: ".concat(parametersType, " = { ").concat(parameterObject, " };"), " const result = await ".concat(modelName, "Service.client.executeAsync<").concat(parametersType, ", ").concat(outputModel, ">("), " {", " connectorOperation: {", " tableName: ".concat(
|
|
1750
|
+
operations.push(" public static async ".concat(operationFuncName, "(").concat(parameterSignature, "): Promise<IOperationResult<").concat(outputModel, ">> {"), " const params: ".concat(parametersType, " = { ").concat(parameterObject, " };"), " const result = await ".concat(modelName, "Service.client.executeAsync<").concat(parametersType, ", ").concat(outputModel, ">("), " {", " connectorOperation: {", " tableName: ".concat((0, nameUtility_1.getServiceName)(modelName), ","), " operationName: '".concat(operationId, "',"), " parameters: params", " },", " });", " return result;", " }");
|
|
1913
1751
|
};
|
|
1914
1752
|
/*
|
|
1915
1753
|
* The handleSqlStoredProcedure method handles the SQL stored procedure generation.
|
|
@@ -2129,39 +1967,6 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
2129
1967
|
});
|
|
2130
1968
|
});
|
|
2131
1969
|
};
|
|
2132
|
-
/*
|
|
2133
|
-
* The isSqlStoredProcedure method checks if the schema is a SQL stored procedure.
|
|
2134
|
-
* It returns true if the schema contains a "procedureresultschema" node.
|
|
2135
|
-
*/
|
|
2136
|
-
ModelServiceGenerator.isSqlStoredProcedure = function (schema) {
|
|
2137
|
-
// Logic to identify SQL stored procedures
|
|
2138
|
-
// Check if the "schema" node contains a "procedureresultschema" node
|
|
2139
|
-
if (schema !== null && typeof schema === 'object' && !Array.isArray(schema)) {
|
|
2140
|
-
var schemaObj = schema;
|
|
2141
|
-
var schemaNode = schemaObj.schema;
|
|
2142
|
-
if (typeof schemaNode === 'object' && schemaNode !== null && !Array.isArray(schemaNode)) {
|
|
2143
|
-
var schemaNodeObj = schemaNode;
|
|
2144
|
-
return !!schemaNodeObj.procedureresultschema;
|
|
2145
|
-
}
|
|
2146
|
-
}
|
|
2147
|
-
return false;
|
|
2148
|
-
};
|
|
2149
|
-
/**
|
|
2150
|
-
* The isSharepointSchema method checks if the schema is a SharePoint schema.
|
|
2151
|
-
* It returns true if the schema contains SharePoint-specific indicators.
|
|
2152
|
-
*/
|
|
2153
|
-
ModelServiceGenerator.isSharepointSchema = function (schema) {
|
|
2154
|
-
// Logic to identify SharePoint schemas
|
|
2155
|
-
// Check if the schema has SharePoint-specific properties or structure
|
|
2156
|
-
if (schema !== null && typeof schema === 'object' && !Array.isArray(schema)) {
|
|
2157
|
-
var schemaObj = schema;
|
|
2158
|
-
// Check for referencedEntities which is common in SharePoint schemas
|
|
2159
|
-
if (schemaObj.referencedEntities && typeof schemaObj.referencedEntities === 'object') {
|
|
2160
|
-
return true;
|
|
2161
|
-
}
|
|
2162
|
-
}
|
|
2163
|
-
return false;
|
|
2164
|
-
};
|
|
2165
1970
|
/*
|
|
2166
1971
|
* The handleStandardSchema method generates TypeScript models and services from any schema type.
|
|
2167
1972
|
* It routes to the appropriate handler based on schema type.
|
|
@@ -2171,7 +1976,7 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
2171
1976
|
return __generator(this, function (_b) {
|
|
2172
1977
|
switch (_b.label) {
|
|
2173
1978
|
case 0:
|
|
2174
|
-
if (!
|
|
1979
|
+
if (!(0, codeGenUtils_1.isDataverseEntity)(schema)) return [3 /*break*/, 2];
|
|
2175
1980
|
return [4 /*yield*/, this.handleDataverseSchema(modelName, dataSourceName, schema, outputDir, vfs)];
|
|
2176
1981
|
case 1:
|
|
2177
1982
|
_b.sent();
|
|
@@ -2365,7 +2170,7 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
2365
2170
|
*/
|
|
2366
2171
|
ModelServiceGenerator.addGetMethodForReferenceEntitiesCore = function (lines, modelName) {
|
|
2367
2172
|
// Add method summary
|
|
2368
|
-
lines.push("/**", "* Utility method to get possible values of a referenced entity by its name.", "*/", " public static async getReferencedEntity(search: string, referencedEntityKeyNormalized: string): Promise<IOperationResult<unknown>> {", " const params: {search: string} = { search };", " const result = await ".concat(modelName, "Service.client.executeAsync<{search: string}, unknown>("), " {", " connectorOperation: {", " tableName: ".concat(
|
|
2173
|
+
lines.push("/**", "* Utility method to get possible values of a referenced entity by its name.", "*/", " public static async getReferencedEntity(search: string, referencedEntityKeyNormalized: string): Promise<IOperationResult<unknown>> {", " const params: {search: string} = { search };", " const result = await ".concat(modelName, "Service.client.executeAsync<{search: string}, unknown>("), " {", " connectorOperation: {", " tableName: ".concat((0, nameUtility_1.getServiceName)(modelName), ","), " operationName: 'Get' + referencedEntityKeyNormalized,", " parameters: params", " }", " });", " return result;", " }", "");
|
|
2369
2174
|
};
|
|
2370
2175
|
/*
|
|
2371
2176
|
* The ensureCommonModelFileExists method checks if the CommonModels.ts file exists in the specified output directory.
|
|
@@ -2493,7 +2298,7 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
2493
2298
|
for (var _c = __values(Object.keys(propertiesNode)), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
2494
2299
|
var propName = _d.value;
|
|
2495
2300
|
var propNameNormalized = propName;
|
|
2496
|
-
if (!
|
|
2301
|
+
if (!(0, nameUtility_1.isValidPropertyName)(propName)) {
|
|
2497
2302
|
propNameNormalized = "\"".concat(propName, "\""); // Enclose invalid property names in double quotes
|
|
2498
2303
|
}
|
|
2499
2304
|
var isRequired = requiredFields.has(propName);
|
|
@@ -2670,32 +2475,22 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
2670
2475
|
primaryKey.value = propName;
|
|
2671
2476
|
}
|
|
2672
2477
|
// Check if the property name is valid
|
|
2673
|
-
if (!
|
|
2478
|
+
if (!(0, nameUtility_1.isValidPropertyName)(propName)) {
|
|
2674
2479
|
propName = "\"".concat(propName, "\""); // Enclose invalid property names in double quotes
|
|
2675
2480
|
}
|
|
2676
2481
|
var isRequired = requiredFields.has(propertyName);
|
|
2677
2482
|
var optionalMark = isRequired ? '' : '?';
|
|
2678
2483
|
lines.push(" ".concat(propName).concat(optionalMark, ": ").concat(propType, ";"));
|
|
2679
2484
|
};
|
|
2680
|
-
/*
|
|
2681
|
-
* The isValidPropertyName method checks if a property name is valid according to TypeScript rules.
|
|
2682
|
-
* A valid property name must start with a letter, underscore, or dollar sign
|
|
2683
|
-
* and can only contain letters, numbers, underscores, or dollar signs.
|
|
2684
|
-
*/
|
|
2685
|
-
ModelServiceGenerator.isValidPropertyName = function (propName) {
|
|
2686
|
-
// A valid property name must start with a letter, underscore, or dollar sign
|
|
2687
|
-
// and can only contain letters, numbers, underscores, or dollar signs
|
|
2688
|
-
return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(propName);
|
|
2689
|
-
};
|
|
2690
2485
|
/*
|
|
2691
2486
|
* The generateTypeScriptService method generates a TypeScript service class for the model.
|
|
2692
2487
|
* It includes methods for CRUD operations and uses the Power SDK for data access.
|
|
2693
2488
|
*/
|
|
2694
|
-
ModelServiceGenerator.generateTypeScriptService = function (modelName, dataSourceName, primaryKey,
|
|
2489
|
+
ModelServiceGenerator.generateTypeScriptService = function (modelName, dataSourceName, primaryKey, isADataverseEntity) {
|
|
2695
2490
|
var lines = [];
|
|
2696
2491
|
this.addCopyrightNotice(lines);
|
|
2697
|
-
this.addStandardServiceImports(lines, modelName,
|
|
2698
|
-
this.addServiceClassDefinition(lines, modelName, dataSourceName, primaryKey,
|
|
2492
|
+
this.addStandardServiceImports(lines, modelName, isADataverseEntity, false);
|
|
2493
|
+
this.addServiceClassDefinition(lines, modelName, dataSourceName, primaryKey, isADataverseEntity);
|
|
2699
2494
|
return lines.join('\n');
|
|
2700
2495
|
};
|
|
2701
2496
|
/*
|
|
@@ -2712,11 +2507,11 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
2712
2507
|
/*
|
|
2713
2508
|
* The addStandardServiceImports method adds the necessary imports for the service class.
|
|
2714
2509
|
*/
|
|
2715
|
-
ModelServiceGenerator.addStandardServiceImports = function (lines, modelName,
|
|
2510
|
+
ModelServiceGenerator.addStandardServiceImports = function (lines, modelName, isADataverseEntity, additionalLine) {
|
|
2716
2511
|
if (additionalLine === void 0) { additionalLine = true; }
|
|
2717
2512
|
var imports = __spreadArray([], __read(this.collectStandardImports('crud')), false);
|
|
2718
2513
|
imports.push("import type { IGetOptions, IGetAllOptions } from '".concat(this.RELATIVE_MODEL_PATH, "/CommonModels';"), "import type { ".concat(modelName, " } from '").concat(this.RELATIVE_MODEL_PATH, "/").concat(modelName, "Model';"));
|
|
2719
|
-
if (
|
|
2514
|
+
if (isADataverseEntity) {
|
|
2720
2515
|
imports.push("import type { GetEntityMetadataOptions, EntityMetadata } from '@microsoft/power-apps/data/metadata/dataverse';");
|
|
2721
2516
|
}
|
|
2722
2517
|
lines.push.apply(lines, __spreadArray([], __read(imports.sort()), false));
|
|
@@ -2769,9 +2564,9 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
2769
2564
|
* The AddServiceClassDefinition method generates the service class definition.
|
|
2770
2565
|
* It takes the lines to write to, model name, data source name, schema, and response model name as parameters.
|
|
2771
2566
|
*/
|
|
2772
|
-
ModelServiceGenerator.addServiceClassDefinition = function (lines, modelName, dataSourceName, primaryKey,
|
|
2567
|
+
ModelServiceGenerator.addServiceClassDefinition = function (lines, modelName, dataSourceName, primaryKey, isADataverseEntity) {
|
|
2773
2568
|
this.addServiceClassHeader(lines, modelName, dataSourceName, true);
|
|
2774
|
-
this.addServiceMethods(lines, modelName, dataSourceName, primaryKey,
|
|
2569
|
+
this.addServiceMethods(lines, modelName, dataSourceName, primaryKey, isADataverseEntity);
|
|
2775
2570
|
lines.push('}');
|
|
2776
2571
|
lines.push('');
|
|
2777
2572
|
};
|
|
@@ -2788,7 +2583,7 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
2788
2583
|
* The addServiceMethods method generates the CRUD methods for the service class.
|
|
2789
2584
|
* It includes create, update, delete, get, and getAll methods.
|
|
2790
2585
|
*/
|
|
2791
|
-
ModelServiceGenerator.addServiceMethods = function (lines, modelName, dataSourceName, primaryKey,
|
|
2586
|
+
ModelServiceGenerator.addServiceMethods = function (lines, modelName, dataSourceName, primaryKey, isADataverseEntity) {
|
|
2792
2587
|
var e_16, _b;
|
|
2793
2588
|
var methods = [];
|
|
2794
2589
|
methods.push(this.generateCreateMethod(modelName, primaryKey));
|
|
@@ -2796,7 +2591,7 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
2796
2591
|
methods.push(this.generateDeleteMethod(modelName));
|
|
2797
2592
|
methods.push(this.generateGetMethod(modelName));
|
|
2798
2593
|
methods.push(this.generateGetAllMethod(modelName));
|
|
2799
|
-
if (
|
|
2594
|
+
if (isADataverseEntity) {
|
|
2800
2595
|
methods.push(this.generateGetMetadataMethod(modelName));
|
|
2801
2596
|
}
|
|
2802
2597
|
try {
|
|
@@ -2850,7 +2645,7 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
2850
2645
|
return [
|
|
2851
2646
|
" public static async create(record: ".concat(datatypeForCreate, "): Promise<IOperationResult<").concat(modelName, ">> {"),
|
|
2852
2647
|
" const result = await ".concat(modelName, "Service.client.createRecordAsync<").concat(datatypeForCreate, ", ").concat(modelName, ">("),
|
|
2853
|
-
" ".concat(
|
|
2648
|
+
" ".concat((0, nameUtility_1.getServiceName)(modelName), ","),
|
|
2854
2649
|
" record",
|
|
2855
2650
|
" );",
|
|
2856
2651
|
" return result;",
|
|
@@ -2865,7 +2660,7 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
2865
2660
|
return [
|
|
2866
2661
|
" public static async update(id: string, changedFields: ".concat(datatypeForUpdate, "): Promise<IOperationResult<").concat(modelName, ">> {"),
|
|
2867
2662
|
" const result = await ".concat(modelName, "Service.client.updateRecordAsync<").concat(datatypeForUpdate, ", ").concat(modelName, ">("),
|
|
2868
|
-
" ".concat(
|
|
2663
|
+
" ".concat((0, nameUtility_1.getServiceName)(modelName), ","),
|
|
2869
2664
|
" id.toString(),",
|
|
2870
2665
|
" changedFields",
|
|
2871
2666
|
" );",
|
|
@@ -2880,7 +2675,7 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
2880
2675
|
return [
|
|
2881
2676
|
" public static async delete(id: string): Promise<void> {",
|
|
2882
2677
|
" await ".concat(modelName, "Service.client.deleteRecordAsync("),
|
|
2883
|
-
" ".concat(
|
|
2678
|
+
" ".concat((0, nameUtility_1.getServiceName)(modelName), ","),
|
|
2884
2679
|
" id.toString());",
|
|
2885
2680
|
" }",
|
|
2886
2681
|
];
|
|
@@ -2892,7 +2687,7 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
2892
2687
|
return [
|
|
2893
2688
|
" public static async get(id: string, options?: IGetOptions): Promise<IOperationResult<".concat(modelName, ">> {"),
|
|
2894
2689
|
" const result = await ".concat(modelName, "Service.client.retrieveRecordAsync<").concat(modelName, ">("),
|
|
2895
|
-
" ".concat(
|
|
2690
|
+
" ".concat((0, nameUtility_1.getServiceName)(modelName), ","),
|
|
2896
2691
|
" id.toString(),",
|
|
2897
2692
|
" options",
|
|
2898
2693
|
" );",
|
|
@@ -2907,7 +2702,7 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
2907
2702
|
return [
|
|
2908
2703
|
" public static async getAll(options?: IGetAllOptions): Promise<IOperationResult<".concat(modelName, "[]>> {"),
|
|
2909
2704
|
" const result = await ".concat(modelName, "Service.client.retrieveMultipleRecordsAsync<").concat(modelName, ">("),
|
|
2910
|
-
" ".concat(
|
|
2705
|
+
" ".concat((0, nameUtility_1.getServiceName)(modelName), ","),
|
|
2911
2706
|
" options",
|
|
2912
2707
|
" );",
|
|
2913
2708
|
" return result;",
|
|
@@ -2923,7 +2718,7 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
2923
2718
|
" dataverseRequest: {",
|
|
2924
2719
|
" action: \"getEntityMetadata\",",
|
|
2925
2720
|
" parameters: {",
|
|
2926
|
-
" tableName: ".concat(
|
|
2721
|
+
" tableName: ".concat((0, nameUtility_1.getServiceName)(modelName), ","),
|
|
2927
2722
|
" options: options as GetEntityMetadataOptions,",
|
|
2928
2723
|
" },",
|
|
2929
2724
|
" },",
|
|
@@ -2948,7 +2743,7 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
2948
2743
|
return [
|
|
2949
2744
|
" public static async create(record: ".concat(datatypeForCreate, "): Promise<IOperationResult<").concat(returnType, ">> {"),
|
|
2950
2745
|
" const result = await ".concat(modelName, "Service.client.createRecordAsync<").concat(datatypeForCreate, ", ").concat(returnType, ">("),
|
|
2951
|
-
" ".concat(
|
|
2746
|
+
" ".concat((0, nameUtility_1.getServiceName)(modelName), ","),
|
|
2952
2747
|
" record",
|
|
2953
2748
|
" );",
|
|
2954
2749
|
" return result;",
|
|
@@ -2972,7 +2767,7 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
2972
2767
|
return [
|
|
2973
2768
|
" public static async update(id: string, changedFields: ".concat(datatypeForUpdate, "): Promise<IOperationResult<").concat(returnType, ">> {"),
|
|
2974
2769
|
" const result = await ".concat(modelName, "Service.client.updateRecordAsync<").concat(datatypeForUpdate, ", ").concat(returnType, ">("),
|
|
2975
|
-
" ".concat(
|
|
2770
|
+
" ".concat((0, nameUtility_1.getServiceName)(modelName), ","),
|
|
2976
2771
|
" id.toString(),",
|
|
2977
2772
|
" changedFields",
|
|
2978
2773
|
" );",
|
|
@@ -2987,7 +2782,7 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
2987
2782
|
return [
|
|
2988
2783
|
" public static async delete(id: string): Promise<void> {",
|
|
2989
2784
|
" await ".concat(modelName, "Service.client.deleteRecordAsync("),
|
|
2990
|
-
" ".concat(
|
|
2785
|
+
" ".concat((0, nameUtility_1.getServiceName)(modelName), ","),
|
|
2991
2786
|
" id.toString());",
|
|
2992
2787
|
" }",
|
|
2993
2788
|
];
|
|
@@ -3006,7 +2801,7 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
3006
2801
|
return [
|
|
3007
2802
|
" public static async get(id: string, options?: IGetOptions): Promise<IOperationResult<".concat(returnType, ">> {"),
|
|
3008
2803
|
" const result = await ".concat(modelName, "Service.client.retrieveRecordAsync<").concat(returnType, ">("),
|
|
3009
|
-
" ".concat(
|
|
2804
|
+
" ".concat((0, nameUtility_1.getServiceName)(modelName), ","),
|
|
3010
2805
|
" id.toString(),",
|
|
3011
2806
|
" options",
|
|
3012
2807
|
" );",
|
|
@@ -3022,7 +2817,7 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
3022
2817
|
return [
|
|
3023
2818
|
" public static async getAll(options?: IGetAllOptions): Promise<IOperationResult<".concat(returnType, "[]>> {"),
|
|
3024
2819
|
" const result = await ".concat(modelName, "Service.client.retrieveMultipleRecordsAsync<").concat(returnType, ">("),
|
|
3025
|
-
" ".concat(
|
|
2820
|
+
" ".concat((0, nameUtility_1.getServiceName)(modelName), ","),
|
|
3026
2821
|
" options",
|
|
3027
2822
|
" );",
|
|
3028
2823
|
" return result;",
|
|
@@ -3039,7 +2834,7 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
3039
2834
|
return [
|
|
3040
2835
|
" public static async create(record: ".concat(datatypeForCreate, "): Promise<IOperationResult<").concat(extendedInterfaceName, ">> {"),
|
|
3041
2836
|
" const result = await ".concat(modelName, "Service.client.createRecordAsync<").concat(datatypeForCreate, ", ").concat(extendedInterfaceName, ">("),
|
|
3042
|
-
" ".concat(
|
|
2837
|
+
" ".concat((0, nameUtility_1.getServiceName)(modelName), ","),
|
|
3043
2838
|
" record",
|
|
3044
2839
|
" );",
|
|
3045
2840
|
" return result;",
|
|
@@ -3056,7 +2851,7 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
3056
2851
|
return [
|
|
3057
2852
|
" public static async update(id: string, changedFields: ".concat(datatypeForUpdate, "): Promise<IOperationResult<").concat(extendedInterfaceName, ">> {"),
|
|
3058
2853
|
" const result = await ".concat(modelName, "Service.client.updateRecordAsync<").concat(datatypeForUpdate, ", ").concat(extendedInterfaceName, ">("),
|
|
3059
|
-
" ".concat(
|
|
2854
|
+
" ".concat((0, nameUtility_1.getServiceName)(modelName), ","),
|
|
3060
2855
|
" id.toString(),",
|
|
3061
2856
|
" changedFields",
|
|
3062
2857
|
" );",
|
|
@@ -3072,7 +2867,7 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
3072
2867
|
return [
|
|
3073
2868
|
" public static async get(id: string, options?: IGetOptions): Promise<IOperationResult<".concat(extendedInterfaceName, ">> {"),
|
|
3074
2869
|
" const result = await ".concat(modelName, "Service.client.retrieveRecordAsync<").concat(extendedInterfaceName, ">("),
|
|
3075
|
-
" ".concat(
|
|
2870
|
+
" ".concat((0, nameUtility_1.getServiceName)(modelName), ","),
|
|
3076
2871
|
" id.toString(),",
|
|
3077
2872
|
" options",
|
|
3078
2873
|
" );",
|
|
@@ -3088,7 +2883,7 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
3088
2883
|
return [
|
|
3089
2884
|
" public static async getAll(options?: IGetAllOptions): Promise<IOperationResult<".concat(extendedInterfaceName, "[]>> {"),
|
|
3090
2885
|
" const result = await ".concat(modelName, "Service.client.retrieveMultipleRecordsAsync<").concat(extendedInterfaceName, ">("),
|
|
3091
|
-
" ".concat(
|
|
2886
|
+
" ".concat((0, nameUtility_1.getServiceName)(modelName), ","),
|
|
3092
2887
|
" options",
|
|
3093
2888
|
" );",
|
|
3094
2889
|
" return result;",
|
|
@@ -3108,7 +2903,7 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
3108
2903
|
" dataverseRequest: {",
|
|
3109
2904
|
" action: \"getEntityMetadata\",",
|
|
3110
2905
|
" parameters: {",
|
|
3111
|
-
" tableName: ".concat(
|
|
2906
|
+
" tableName: ".concat((0, nameUtility_1.getServiceName)(modelName), ","),
|
|
3112
2907
|
" options: options as GetEntityMetadataOptions,",
|
|
3113
2908
|
" },",
|
|
3114
2909
|
" },",
|
|
@@ -3116,15 +2911,6 @@ var ModelServiceGenerator = /** @class */ (function () {
|
|
|
3116
2911
|
" }",
|
|
3117
2912
|
];
|
|
3118
2913
|
};
|
|
3119
|
-
/*
|
|
3120
|
-
* The getServiceName method generates a service name by appending "Service" to the given model name.
|
|
3121
|
-
*/
|
|
3122
|
-
ModelServiceGenerator.getServiceName = function (modelName) {
|
|
3123
|
-
if (!modelName || !modelName.trim()) {
|
|
3124
|
-
throw new Error('Model name cannot be null or empty.');
|
|
3125
|
-
}
|
|
3126
|
-
return "".concat(modelName, "Service.dataSourceName");
|
|
3127
|
-
};
|
|
3128
2914
|
/**
|
|
3129
2915
|
* The generateIndexFile method creates an index.ts file that exports all models and services.
|
|
3130
2916
|
*/
|