Skip to content

Commit 3745595

Browse files
authored
Merge branch 'dev' into po/modulesUpdate
2 parents 32b99e5 + fb8a9e5 commit 3745595

File tree

5 files changed

+60
-6
lines changed

5 files changed

+60
-6
lines changed

src/Authentication/Authentication/Microsoft.Graph.Authentication.csproj

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,14 @@
2121
<PreLoadAssemblies Include="$(RepoTools)lib\System.Security.Cryptography.ProtectedData.dll" />
2222
</ItemGroup>
2323
<ItemGroup>
24-
<PackageReference Include="Microsoft.Graph.Auth" Version="1.0.0-preview.3" />
25-
<PackageReference Include="Microsoft.Graph.Core" Version="1.19.0" />
26-
<PackageReference Include="Microsoft.Identity.Client" Version="4.8.0" />
24+
<PackageReference Include="Microsoft.Graph.Auth" Version="1.0.0-preview.4" />
25+
<PackageReference Include="Microsoft.Graph.Core" Version="1.20.0" />
26+
<PackageReference Include="Microsoft.Identity.Client" Version="4.8.2" />
27+
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="5.6.0" />
28+
<PackageReference Include="Microsoft.IdentityModel.Logging" Version="5.6.0" />
29+
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="5.6.0" />
2730
<PackageReference Include="PowerShellStandard.Library" Version="5.1.0" />
31+
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
2832
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.6.0" />
2933
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="4.7.0" />
3034
</ItemGroup>

src/Authentication/Authentication/Microsoft.Graph.Authentication.nuspec

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,17 @@
2020
<file src="Microsoft.Graph.Authentication.format.ps1xml" />
2121
<file src="Microsoft.Graph.Authentication.psm1" />
2222
<!-- https://github.com/NuGet/Home/issues/3584 -->
23+
2324
<file src="bin/Microsoft.Graph.Authentication.dll" target="bin" />
2425
<file src="bin/Microsoft.Graph.Authentication.deps.json" target="bin" />
2526
<file src="bin/Microsoft.Graph.Auth.dll" target="bin" />
2627
<file src="bin/Microsoft.Graph.Core.dll" target="bin" />
2728
<file src="bin/Microsoft.Identity.Client.dll" target="bin" />
29+
<file src="bin/System.IdentityModel.Tokens.Jwt.dll" target="bin" />
30+
<file src="bin/Newtonsoft.Json.dll" target="bin" />
31+
<file src="bin/Microsoft.IdentityModel.JsonWebTokens.dll" target="bin" />
32+
<file src="bin/Microsoft.IdentityModel.Tokens.dll" target="bin" />
33+
<file src="bin/Microsoft.IdentityModel.Logging.dll" target="bin" />
2834
<file src="bin/PreloadAssemblies/System.Security.Cryptography.ProtectedData.dll" target="bin/PreloadAssemblies" />
2935
</files>
3036
</package>

src/Authentication/Authentication/Microsoft.Graph.Authentication.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Microsoft
55
#
6-
# Generated on: 2/10/2020
6+
# Generated on: 3/4/2020
77
#
88

99
@{
@@ -45,7 +45,7 @@ PowerShellVersion = '5.1'
4545
DotNetFrameworkVersion = '4.7.2'
4646

4747
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
48-
# CLRVersion = ''
48+
# ClrVersion = ''
4949

5050
# Processor architecture (None, X86, Amd64) required by this module
5151
# ProcessorArchitecture = ''

src/readme.graph.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ prefix: Mg
2727
module-name: Microsoft.Graph.$(service-name)
2828
subject-prefix: $(service-name)
2929
namespace: Microsoft.Graph.PowerShell
30+
sanitize-names: false
3031
```
3132
3233
> Folders
@@ -51,7 +52,9 @@ directive:
5152
- microsoft.graph.post
5253
- microsoft.graph.sectionGroup
5354
- microsoft.graph.team
54-
# Formart cmdlet response.
55+
- microsoft.graph.recipient
56+
57+
# Format cmdlet response.
5558
- where:
5659
model-name: MicrosoftGraphUser
5760
set:
@@ -289,4 +292,41 @@ directive:
289292
set:
290293
verb: Get
291294
subject: $2$1
295+
# Add AfterToJson
296+
- from: source-file-csharp
297+
where: $
298+
transform: >
299+
if (!$documentPath.match(/generated%5Capi%5CModels%5CMicrosoftGraph\w*.json.cs/gm))
300+
{
301+
return $;
302+
} else {
303+
let afterJsonDeclarationRegex = /(^\s*)(partial\s*void\s*AfterFromJson\s*\(Microsoft.Graph.PowerShell.Runtime.Json.JsonObject\s*json\s*\);$)/gm
304+
$ = $.replace(afterJsonDeclarationRegex, '$1$2\n$1partial void AfterToJson(ref Microsoft.Graph.PowerShell.Runtime.Json.JsonObject container, Microsoft.Graph.PowerShell.Runtime.SerializationMode serializationMode);\n');
305+
let afterJsonRegex = /(^\s*)(AfterToJson\(ref\s*container\s*\);$)/gm
306+
$ = $.replace(afterJsonRegex, '$1$2\n$1AfterToJson(ref container, serializationMode);\n');
307+
return $;
308+
}
309+
- from: source-file-csharp
310+
where: $
311+
transform: >
312+
if (!$documentPath.match(/generated%5Capi%5CModels%5CMicrosoftGraph\w*.cs/gm))
313+
{
314+
return $;
315+
} else {
316+
let regexPattern = /^\s*public\s*partial\s*class\s*MicrosoftGraph(?<EntityName>.*):$/gm;
317+
let regexArray;
318+
while ((regexArray = regexPattern.exec($)) !== null) {
319+
if (regexArray['groups'] != null)
320+
{
321+
let EntityName = regexArray['groups'].EntityName.trim();
322+
let newEntityId = EntityName + 'Id';
323+
let newEntityIdPropRegex = new RegExp("^\\s*public\\s*string\\s*"+newEntityId+"\\.*","gm");
324+
let existingIdPropRegex = /(^\s*)(public\s*string\s*Id\s.*)/gm;
325+
if ((!$.match(newEntityIdPropRegex)) && $.match(existingIdPropRegex) && (newEntityId != "EntityId") && (newEntityId != "BaseItemId")) {
326+
$ = $.replace(existingIdPropRegex, '$1$2\n\n$1partial void AfterToJson(ref Microsoft.Graph.PowerShell.Runtime.Json.JsonObject container, Microsoft.Graph.PowerShell.Runtime.SerializationMode serializationMode)\n$1{\n$1\tif (serializationMode == Microsoft.Graph.PowerShell.Runtime.SerializationMode.IncludeAll) {\n$1\t\tAddIf(null != this.Id ? (Microsoft.Graph.PowerShell.Runtime.Json.JsonNode)new Microsoft.Graph.PowerShell.Runtime.Json.JsonString(this.Id) : null, "'+ EntityName.toLowerCase() +'-id", container.Add);\n$1\t}\n$1}');
327+
}
328+
}
329+
}
330+
return $;
331+
}
292332
```

tools/GenerateModules.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ $ModuleMapping.Keys | ForEach-Object {
128128
else {
129129
& $BuildModulePS1 -Module $ModuleName -ModulePrefix $ModulePrefix -GraphVersion $GraphVersion -ModuleVersion $ModuleVersion -ModulePreviewNumber $ModulePreviewNumber -RequiredModules $AuthenticationModule -ReleaseNotes $ModuleReleaseNotes
130130
}
131+
132+
if ($LASTEXITCODE) {
133+
Write-Error "Failed to build '$ModuleName' module."
134+
}
131135
}
132136

133137
if ($Pack) {

0 commit comments

Comments
 (0)