Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions BuildAutoRest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,15 @@ ForEach ($SDK In $SDKName)
if (($SDKName -eq "JumpCloud.SDK.V1") -or ($SDKName -eq "JumpCloud.SDK.V2")) {
# Modify .cs file "https://github.com/Azure/autorest/issues/3604" #autorest does not support even the "collectionFormat": "multi" in my testing
$inputFile = Get-Content -Path "$OutputFullPath/generated/api/JumpCloudApi.cs" -Raw
# Replace the filter logic to use indexed array parameters: filter[0]=..., filter[1]=..., etc.
# Replace AutoRest's comma-joined filter= with repeated query keys: filter=...&filter=... (API expects multi-value filter this way).
# Pattern matches both filter.Length and filter.Count variations, with flexible whitespace
# Also handles both patterns: with and without EscapeDataString wrapper

# Pattern 1: Without EscapeDataString (V1 SDK)
$newFile = $inputFile -replace '\(null != filter\s+&&\s+filter\.(Length|Count)\s+>\s+0\s+\?\s+"filter="\s+\+\s+\(global::System\.Linq\.Enumerable\.Aggregate\(filter,\s+\(current,\s+each\)\s+=>\s+current\s+\+\s+","\s+\+\s+\(\s+null\s+==\s+each\s+\?\s+global::System\.String\.Empty\s+:\s+each\.ToString\(\)\s*\)\s*\)\s*\)\s+:\s+global::System\.String\.Empty\)', '(null != filter && filter.Count > 0 ? global::System.Linq.Enumerable.Aggregate(global::System.Linq.Enumerable.Select(filter, (value, index) => new { value, index }), "", (current, item) => current + (item.index > 0 ? "&" : "") + "filter[" + item.index + "]=" + (item.value?.ToString() ?? global::System.String.Empty)) : global::System.String.Empty)'
$newFile = $inputFile -replace '\(null != filter\s+&&\s+filter\.(Length|Count)\s+>\s+0\s+\?\s+"filter="\s+\+\s+\(global::System\.Linq\.Enumerable\.Aggregate\(filter,\s+\(current,\s+each\)\s+=>\s+current\s+\+\s+","\s+\+\s+\(\s+null\s+==\s+each\s+\?\s+global::System\.String\.Empty\s+:\s+each\.ToString\(\)\s*\)\s*\)\s*\)\s+:\s+global::System\.String\.Empty\)', '(null != filter && filter.Count > 0 ? global::System.Linq.Enumerable.Aggregate(global::System.Linq.Enumerable.Select(filter, (value, index) => new { value, index }), "", (current, item) => current + (item.index > 0 ? "&" : "") + "filter=" + (item.value?.ToString() ?? global::System.String.Empty)) : global::System.String.Empty)'

# Pattern 2: With EscapeDataString (V2 SDK)
$newFile = $newFile -replace '\(null != filter\s+&&\s+filter\.(Length|Count)\s+>\s+0\s+\?\s+"filter="\s+\+\s+global::System\.Uri\.EscapeDataString\(global::System\.Linq\.Enumerable\.Aggregate\(filter,\s+\(current,\s+each\)\s+=>\s+current\s+\+\s+","\s+\+\s+\(\s+null\s+==\s+each\s+\?\s+global::System\.String\.Empty\s+:\s+each\.ToString\(\)\s*\)\s*\)\s*\)\s+:\s+global::System\.String\.Empty\)', '(null != filter && filter.Count > 0 ? global::System.Linq.Enumerable.Aggregate(global::System.Linq.Enumerable.Select(filter, (value, index) => new { value, index }), "", (current, item) => current + (item.index > 0 ? "&" : "") + "filter[" + item.index + "]=" + global::System.Uri.EscapeDataString(item.value?.ToString() ?? global::System.String.Empty)) : global::System.String.Empty)'
$newFile = $newFile -replace '\(null != filter\s+&&\s+filter\.(Length|Count)\s+>\s+0\s+\?\s+"filter="\s+\+\s+global::System\.Uri\.EscapeDataString\(global::System\.Linq\.Enumerable\.Aggregate\(filter,\s+\(current,\s+each\)\s+=>\s+current\s+\+\s+","\s+\+\s+\(\s+null\s+==\s+each\s+\?\s+global::System\.String\.Empty\s+:\s+each\.ToString\(\)\s*\)\s*\)\s*\)\s+:\s+global::System\.String\.Empty\)', '(null != filter && filter.Count > 0 ? global::System.Linq.Enumerable.Aggregate(global::System.Linq.Enumerable.Select(filter, (value, index) => new { value, index }), "", (current, item) => current + (item.index > 0 ? "&" : "") + "filter=" + global::System.Uri.EscapeDataString(item.value?.ToString() ?? global::System.String.Empty)) : global::System.String.Empty)'

Set-Content -Path "$OutputFullPath/generated/api/JumpCloudApi.cs" -Value $newFile
}
Expand Down
15 changes: 14 additions & 1 deletion BuildCustomFunctions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,20 @@ Try {
# Get AutoRest Versions
$coreRegex = [regex]'autorest_core@([0-9]+\.[0-9]+\.[0-9]+)'
$PSRegex = [regex]'autorest_powershell@([0-9]+\.[0-9]+\.[0-9]+)'
$autorestRaw = npx autorest --version
# AutoRest --version exits non-zero when printing the TypeSpec deprecation notice; PS7+ would otherwise treat that as terminating.
$prevNativeErr = $null
if (Get-Variable -Name PSNativeCommandUseErrorActionPreference -ErrorAction SilentlyContinue) {
$prevNativeErr = $PSNativeCommandUseErrorActionPreference
$PSNativeCommandUseErrorActionPreference = $false
}
try {
$autorestRaw = (& npx @('autorest', '--version') 2>&1 | Out-String)
}
finally {
if ($null -ne $prevNativeErr) {
$PSNativeCommandUseErrorActionPreference = $prevNativeErr
}
}
$autorestCore = (Select-String -InputObject $autorestRaw -Pattern $coreRegex).Matches.Groups[1].value
$autorestPS = (Select-String -InputObject $autorestRaw -Pattern $PSRegex).Matches.Groups[1].value
$MSCopyrightHeader = "`n# ----------------------------------------------------------------------------------`n# Code generated by Microsoft (R) AutoRest Code Generator (autorest: $autorestCore, generator: @autorest/powershell@$autorestPS)`n# Changes may cause incorrect behavior and will be lost if the code is regenerated.`n# ----------------------------------------------------------------------------------`n"
Expand Down
2 changes: 1 addition & 1 deletion Configs/JumpCloud.SDK.V1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ input-file:
module-name: JumpCloud.SDK.V1
namespace: JumpCloud.SDK.V1
sample-generation: true
module-version: 0.1.2
module-version: 0.1.3
dll-name: JumpCloud.SDK.V1.private

directive:
Expand Down
2 changes: 1 addition & 1 deletion Configs/JumpCloud.SDK.V2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ verbose: true
module-name: JumpCloud.SDK.V2
output-folder: SDKs/PowerShell/JumpCloud.SDK.V2
dll-name: JumpCloud.SDK.V2.private
module-version: 0.2.0
module-version: 0.2.1
powershell: true
base-folder: ..
40 changes: 40 additions & 0 deletions JumpCloud.SDK.V1.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
## JumpCloud.SDK.V1-0.1.3
Release Date: March 26, 2026
#### RELEASE NOTES
```
This release is a rollup release for existing SDK functions.
```
#### FEATURES:
NA

#### IMPROVEMENTS:
URL filtering in the V1 module has been updated to match filtering in the V2 module.

#### BUG FIXES:
NA

#### Generated Changes:

<details>
<summary>Functions Added</summary>

No changes
</details>

<details>
<summary>Functions Modified</summary>

* New-JcSdkCommand.ps1
* Search-JcSdkUser.ps1
* Set-JcSdkAdministratorUser.ps1
* Set-JcSdkCommand.ps1
* Set-JcSdkOrganization.ps1

</details>

<details>
<summary>Functions Removed</summary>

No changes
</details>

## JumpCloud.SDK.V1-0.1.2
Release Date: December 16, 2025
#### RELEASE NOTES
Expand Down
35 changes: 35 additions & 0 deletions JumpCloud.SDK.V2.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
## JumpCloud.SDK.V2-0.2.1
Release Date: March 26, 2026
#### RELEASE NOTES
```
This is a rollup release of the V2 functions generated from docs.
```
#### FEATURES:
NA

#### IMPROVEMENTS:
This release changes the way in which GET functions and Filter parameters are used in the module. URL queryFilters should now be formatted the same as the V1 API. The '?Filter[0]=something&Filter[1]=somethingElse' url query filtering is no longer supported, this release addresses that issue in the V2 SDK.

#### BUG FIXES:
NA

#### Generated Changes:

<details>
<summary>Functions Added</summary>

No changes
</details>

<details>
<summary>Functions Modified</summary>

No changes
</details>

<details>
<summary>Functions Removed</summary>

No changes
</details>

## JumpCloud.SDK.V2-0.2.0

Release Date: February 26, 2026
Expand Down
2 changes: 1 addition & 1 deletion SDKs/PowerShell/JumpCloud.SDK.V1/JumpCloud.SDK.V1.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>0.1.2</Version>
<Version>0.1.3</Version>
<LangVersion>7.1</LangVersion>
<TargetFramework>netstandard2.0</TargetFramework>
<OutputType>Library</OutputType>
Expand Down
Loading
Loading