@azure/arm-trustedsigning 1.0.0-beta.2 → 1.0.0-beta.3

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.
Files changed (95) hide show
  1. package/CHANGELOG.md +11 -1
  2. package/LICENSE +4 -4
  3. package/README.md +24 -16
  4. package/dist/browser/api/certificateProfiles/index.js +128 -128
  5. package/dist/browser/api/certificateProfiles/index.js.map +1 -1
  6. package/dist/browser/api/codeSigningAccounts/index.js +82 -78
  7. package/dist/browser/api/codeSigningAccounts/index.js.map +1 -1
  8. package/dist/browser/api/codeSigningContext.js +12 -9
  9. package/dist/browser/api/codeSigningContext.js.map +1 -1
  10. package/dist/browser/api/operations/index.js +5 -6
  11. package/dist/browser/api/operations/index.js.map +1 -1
  12. package/dist/browser/classic/certificateProfiles/index.js +3 -1
  13. package/dist/browser/classic/certificateProfiles/index.js.map +1 -1
  14. package/dist/browser/classic/codeSigningAccounts/index.js +3 -1
  15. package/dist/browser/classic/codeSigningAccounts/index.js.map +1 -1
  16. package/dist/browser/classic/operations/index.js +3 -1
  17. package/dist/browser/classic/operations/index.js.map +1 -1
  18. package/dist/browser/codeSigningClient.js +14 -3
  19. package/dist/browser/codeSigningClient.js.map +1 -1
  20. package/dist/browser/restorePollerHelpers.js +11 -13
  21. package/dist/browser/restorePollerHelpers.js.map +1 -1
  22. package/dist/browser/static-helpers/pagingHelpers.js +31 -50
  23. package/dist/browser/static-helpers/pagingHelpers.js.map +1 -1
  24. package/dist/browser/static-helpers/pollingHelpers.js +14 -11
  25. package/dist/browser/static-helpers/pollingHelpers.js.map +1 -1
  26. package/dist/commonjs/api/certificateProfiles/index.js +128 -128
  27. package/dist/commonjs/api/certificateProfiles/index.js.map +1 -1
  28. package/dist/commonjs/api/codeSigningAccounts/index.js +82 -78
  29. package/dist/commonjs/api/codeSigningAccounts/index.js.map +1 -1
  30. package/dist/commonjs/api/codeSigningContext.js +12 -9
  31. package/dist/commonjs/api/codeSigningContext.js.map +1 -1
  32. package/dist/commonjs/api/operations/index.js +5 -6
  33. package/dist/commonjs/api/operations/index.js.map +1 -1
  34. package/dist/commonjs/classic/certificateProfiles/index.js +3 -1
  35. package/dist/commonjs/classic/certificateProfiles/index.js.map +1 -1
  36. package/dist/commonjs/classic/codeSigningAccounts/index.js +3 -1
  37. package/dist/commonjs/classic/codeSigningAccounts/index.js.map +1 -1
  38. package/dist/commonjs/classic/operations/index.js +3 -1
  39. package/dist/commonjs/classic/operations/index.js.map +1 -1
  40. package/dist/commonjs/codeSigningClient.js +14 -3
  41. package/dist/commonjs/codeSigningClient.js.map +1 -1
  42. package/dist/commonjs/restorePollerHelpers.js +11 -13
  43. package/dist/commonjs/restorePollerHelpers.js.map +1 -1
  44. package/dist/commonjs/static-helpers/pagingHelpers.js +31 -50
  45. package/dist/commonjs/static-helpers/pagingHelpers.js.map +1 -1
  46. package/dist/commonjs/static-helpers/pollingHelpers.js +14 -11
  47. package/dist/commonjs/static-helpers/pollingHelpers.js.map +1 -1
  48. package/dist/commonjs/tsdoc-metadata.json +11 -11
  49. package/dist/esm/api/certificateProfiles/index.js +128 -128
  50. package/dist/esm/api/certificateProfiles/index.js.map +1 -1
  51. package/dist/esm/api/codeSigningAccounts/index.js +82 -78
  52. package/dist/esm/api/codeSigningAccounts/index.js.map +1 -1
  53. package/dist/esm/api/codeSigningContext.js +12 -9
  54. package/dist/esm/api/codeSigningContext.js.map +1 -1
  55. package/dist/esm/api/operations/index.js +5 -6
  56. package/dist/esm/api/operations/index.js.map +1 -1
  57. package/dist/esm/classic/certificateProfiles/index.js +3 -1
  58. package/dist/esm/classic/certificateProfiles/index.js.map +1 -1
  59. package/dist/esm/classic/codeSigningAccounts/index.js +3 -1
  60. package/dist/esm/classic/codeSigningAccounts/index.js.map +1 -1
  61. package/dist/esm/classic/operations/index.js +3 -1
  62. package/dist/esm/classic/operations/index.js.map +1 -1
  63. package/dist/esm/codeSigningClient.js +14 -3
  64. package/dist/esm/codeSigningClient.js.map +1 -1
  65. package/dist/esm/restorePollerHelpers.js +11 -13
  66. package/dist/esm/restorePollerHelpers.js.map +1 -1
  67. package/dist/esm/static-helpers/pagingHelpers.js +31 -50
  68. package/dist/esm/static-helpers/pagingHelpers.js.map +1 -1
  69. package/dist/esm/static-helpers/pollingHelpers.js +14 -11
  70. package/dist/esm/static-helpers/pollingHelpers.js.map +1 -1
  71. package/dist/react-native/api/certificateProfiles/index.js +128 -128
  72. package/dist/react-native/api/certificateProfiles/index.js.map +1 -1
  73. package/dist/react-native/api/codeSigningAccounts/index.js +82 -78
  74. package/dist/react-native/api/codeSigningAccounts/index.js.map +1 -1
  75. package/dist/react-native/api/codeSigningContext.js +12 -9
  76. package/dist/react-native/api/codeSigningContext.js.map +1 -1
  77. package/dist/react-native/api/operations/index.js +5 -6
  78. package/dist/react-native/api/operations/index.js.map +1 -1
  79. package/dist/react-native/classic/certificateProfiles/index.js +3 -1
  80. package/dist/react-native/classic/certificateProfiles/index.js.map +1 -1
  81. package/dist/react-native/classic/codeSigningAccounts/index.js +3 -1
  82. package/dist/react-native/classic/codeSigningAccounts/index.js.map +1 -1
  83. package/dist/react-native/classic/operations/index.js +3 -1
  84. package/dist/react-native/classic/operations/index.js.map +1 -1
  85. package/dist/react-native/codeSigningClient.js +14 -3
  86. package/dist/react-native/codeSigningClient.js.map +1 -1
  87. package/dist/react-native/restorePollerHelpers.js +11 -13
  88. package/dist/react-native/restorePollerHelpers.js.map +1 -1
  89. package/dist/react-native/static-helpers/pagingHelpers.js +31 -50
  90. package/dist/react-native/static-helpers/pagingHelpers.js.map +1 -1
  91. package/dist/react-native/static-helpers/pollingHelpers.js +14 -11
  92. package/dist/react-native/static-helpers/pollingHelpers.js.map +1 -1
  93. package/package.json +45 -47
  94. /package/review/{arm-trustedsigning-models.api.md → arm-trustedsigning-models-node.api.md} +0 -0
  95. /package/review/{arm-trustedsigning.api.md → arm-trustedsigning-node.api.md} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Release History
2
-
2
+
3
+ ## 1.0.0-beta.3 (Unreleased)
4
+
5
+ ### Features Added
6
+
7
+ ### Breaking Changes
8
+
9
+ ### Bugs Fixed
10
+
11
+ ### Other Changes
12
+
3
13
  ## 1.0.0-beta.2 (2024-11-04)
4
14
 
5
15
  ### Bugs Fixed
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
- The MIT License (MIT)
1
+ Copyright (c) Microsoft Corporation.
2
2
 
3
- Copyright (c) 2024 Microsoft
3
+ MIT License
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -12,10 +12,10 @@ furnished to do so, subject to the following conditions:
12
12
  The above copyright notice and this permission notice shall be included in all
13
13
  copies or substantial portions of the Software.
14
14
 
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
16
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
17
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
21
+ SOFTWARE.
package/README.md CHANGED
@@ -5,7 +5,7 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) f
5
5
  Code Signing resource provider api.
6
6
 
7
7
  [Package (NPM)](https://www.npmjs.com/package/@azure/arm-trustedsigning) |
8
- [API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-trustedsigning?view=azure-node-preview) |
8
+ [API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-trustedsigning?view=azure-node-preview) |
9
9
 
10
10
  ## Getting started
11
11
 
@@ -44,26 +44,34 @@ npm install @azure/identity
44
44
  You will also need to **register a new AAD application and grant access to Azure CodeSigningManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
45
45
  Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.
46
46
 
47
- For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).
47
+ For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).
48
48
 
49
- ```javascript
50
- const { CodeSigningClient } = require("@azure/arm-trustedsigning");
51
- const { DefaultAzureCredential } = require("@azure/identity");
52
- // For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details.
49
+ Using Node.js and Node-like environments, you can use the `DefaultAzureCredential` class to authenticate the client.
50
+
51
+ ```ts snippet:ReadmeSampleCreateClient_Node
52
+ import { CodeSigningClient } from "@azure/arm-trustedsigning";
53
+ import { DefaultAzureCredential } from "@azure/identity";
53
54
 
54
55
  const subscriptionId = "00000000-0000-0000-0000-000000000000";
55
56
  const client = new CodeSigningClient(new DefaultAzureCredential(), subscriptionId);
56
-
57
- // For client-side applications running in the browser, use this code instead:
58
- // const credential = new InteractiveBrowserCredential({
59
- // tenantId: "<YOUR_TENANT_ID>",
60
- // clientId: "<YOUR_CLIENT_ID>"
61
- // });
62
- // const client = new CodeSigningClient(credential, subscriptionId);
63
57
  ```
64
58
 
59
+ For browser environments, use the `InteractiveBrowserCredential` from the `@azure/identity` package to authenticate.
60
+
61
+ ```ts snippet:ReadmeSampleCreateClient_Browser
62
+ import { InteractiveBrowserCredential } from "@azure/identity";
63
+ import { CodeSigningClient } from "@azure/arm-trustedsigning";
64
+
65
+ const subscriptionId = "00000000-0000-0000-0000-000000000000";
66
+ const credential = new InteractiveBrowserCredential({
67
+ tenantId: "<YOUR_TENANT_ID>",
68
+ clientId: "<YOUR_CLIENT_ID>",
69
+ });
70
+ const client = new CodeSigningClient(credential, subscriptionId);
71
+ ```
65
72
 
66
73
  ### JavaScript Bundle
74
+
67
75
  To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling).
68
76
 
69
77
  ## Key concepts
@@ -78,14 +86,14 @@ To use this client library in the browser, first you need to use a bundler. For
78
86
 
79
87
  Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
80
88
 
81
- ```javascript
82
- const { setLogLevel } = require("@azure/logger");
89
+ ```ts snippet:SetLogLevel
90
+ import { setLogLevel } from "@azure/logger";
91
+
83
92
  setLogLevel("info");
84
93
  ```
85
94
 
86
95
  For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
87
96
 
88
-
89
97
  ## Contributing
90
98
 
91
99
  If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code.
@@ -7,10 +7,9 @@ import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js";
7
7
  export function _getSend(context, subscriptionId, resourceGroupName, accountName, profileName, options = { requestOptions: {} }) {
8
8
  return context
9
9
  .path("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}/certificateProfiles/{profileName}", subscriptionId, resourceGroupName, accountName, profileName)
10
- .get(Object.assign({}, operationOptionsToRequestParameters(options)));
10
+ .get({ ...operationOptionsToRequestParameters(options) });
11
11
  }
12
12
  export async function _getDeserialize(result) {
13
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
14
13
  const expectedStatuses = ["200"];
15
14
  if (!expectedStatuses.includes(result.status)) {
16
15
  throw createRestError(result);
@@ -22,42 +21,41 @@ export async function _getDeserialize(result) {
22
21
  systemData: !result.body.systemData
23
22
  ? undefined
24
23
  : {
25
- createdBy: (_a = result.body.systemData) === null || _a === void 0 ? void 0 : _a["createdBy"],
26
- createdByType: (_b = result.body.systemData) === null || _b === void 0 ? void 0 : _b["createdByType"],
27
- createdAt: ((_c = result.body.systemData) === null || _c === void 0 ? void 0 : _c["createdAt"]) !== undefined
28
- ? new Date((_d = result.body.systemData) === null || _d === void 0 ? void 0 : _d["createdAt"])
24
+ createdBy: result.body.systemData?.["createdBy"],
25
+ createdByType: result.body.systemData?.["createdByType"],
26
+ createdAt: result.body.systemData?.["createdAt"] !== undefined
27
+ ? new Date(result.body.systemData?.["createdAt"])
29
28
  : undefined,
30
- lastModifiedBy: (_e = result.body.systemData) === null || _e === void 0 ? void 0 : _e["lastModifiedBy"],
31
- lastModifiedByType: (_f = result.body.systemData) === null || _f === void 0 ? void 0 : _f["lastModifiedByType"],
32
- lastModifiedAt: ((_g = result.body.systemData) === null || _g === void 0 ? void 0 : _g["lastModifiedAt"]) !== undefined
33
- ? new Date((_h = result.body.systemData) === null || _h === void 0 ? void 0 : _h["lastModifiedAt"])
29
+ lastModifiedBy: result.body.systemData?.["lastModifiedBy"],
30
+ lastModifiedByType: result.body.systemData?.["lastModifiedByType"],
31
+ lastModifiedAt: result.body.systemData?.["lastModifiedAt"] !== undefined
32
+ ? new Date(result.body.systemData?.["lastModifiedAt"])
34
33
  : undefined,
35
34
  },
36
35
  properties: !result.body.properties
37
36
  ? undefined
38
37
  : {
39
- profileType: (_j = result.body.properties) === null || _j === void 0 ? void 0 : _j["profileType"],
40
- commonName: (_k = result.body.properties) === null || _k === void 0 ? void 0 : _k["commonName"],
41
- organization: (_l = result.body.properties) === null || _l === void 0 ? void 0 : _l["organization"],
42
- organizationUnit: (_m = result.body.properties) === null || _m === void 0 ? void 0 : _m["organizationUnit"],
43
- streetAddress: (_o = result.body.properties) === null || _o === void 0 ? void 0 : _o["streetAddress"],
44
- includeStreetAddress: (_p = result.body.properties) === null || _p === void 0 ? void 0 : _p["includeStreetAddress"],
45
- city: (_q = result.body.properties) === null || _q === void 0 ? void 0 : _q["city"],
46
- includeCity: (_r = result.body.properties) === null || _r === void 0 ? void 0 : _r["includeCity"],
47
- state: (_s = result.body.properties) === null || _s === void 0 ? void 0 : _s["state"],
48
- includeState: (_t = result.body.properties) === null || _t === void 0 ? void 0 : _t["includeState"],
49
- country: (_u = result.body.properties) === null || _u === void 0 ? void 0 : _u["country"],
50
- includeCountry: (_v = result.body.properties) === null || _v === void 0 ? void 0 : _v["includeCountry"],
51
- postalCode: (_w = result.body.properties) === null || _w === void 0 ? void 0 : _w["postalCode"],
52
- includePostalCode: (_x = result.body.properties) === null || _x === void 0 ? void 0 : _x["includePostalCode"],
53
- enhancedKeyUsage: (_y = result.body.properties) === null || _y === void 0 ? void 0 : _y["enhancedKeyUsage"],
54
- identityValidationId: (_z = result.body.properties) === null || _z === void 0 ? void 0 : _z["identityValidationId"],
55
- provisioningState: (_0 = result.body.properties) === null || _0 === void 0 ? void 0 : _0["provisioningState"],
56
- status: (_1 = result.body.properties) === null || _1 === void 0 ? void 0 : _1["status"],
57
- certificates: ((_2 = result.body.properties) === null || _2 === void 0 ? void 0 : _2["certificates"]) === undefined
58
- ? (_3 = result.body.properties) === null || _3 === void 0 ? void 0 : _3["certificates"]
59
- : (_4 = result.body.properties) === null || _4 === void 0 ? void 0 : _4["certificates"].map((p) => {
60
- var _a, _b, _c, _d, _e, _f, _g, _h;
38
+ profileType: result.body.properties?.["profileType"],
39
+ commonName: result.body.properties?.["commonName"],
40
+ organization: result.body.properties?.["organization"],
41
+ organizationUnit: result.body.properties?.["organizationUnit"],
42
+ streetAddress: result.body.properties?.["streetAddress"],
43
+ includeStreetAddress: result.body.properties?.["includeStreetAddress"],
44
+ city: result.body.properties?.["city"],
45
+ includeCity: result.body.properties?.["includeCity"],
46
+ state: result.body.properties?.["state"],
47
+ includeState: result.body.properties?.["includeState"],
48
+ country: result.body.properties?.["country"],
49
+ includeCountry: result.body.properties?.["includeCountry"],
50
+ postalCode: result.body.properties?.["postalCode"],
51
+ includePostalCode: result.body.properties?.["includePostalCode"],
52
+ enhancedKeyUsage: result.body.properties?.["enhancedKeyUsage"],
53
+ identityValidationId: result.body.properties?.["identityValidationId"],
54
+ provisioningState: result.body.properties?.["provisioningState"],
55
+ status: result.body.properties?.["status"],
56
+ certificates: result.body.properties?.["certificates"] === undefined
57
+ ? result.body.properties?.["certificates"]
58
+ : result.body.properties?.["certificates"].map((p) => {
61
59
  return {
62
60
  serialNumber: p["serialNumber"],
63
61
  subjectName: p["subjectName"],
@@ -68,16 +66,16 @@ export async function _getDeserialize(result) {
68
66
  revocation: !p.revocation
69
67
  ? undefined
70
68
  : {
71
- requestedAt: ((_a = p.revocation) === null || _a === void 0 ? void 0 : _a["requestedAt"]) !== undefined
72
- ? new Date((_b = p.revocation) === null || _b === void 0 ? void 0 : _b["requestedAt"])
69
+ requestedAt: p.revocation?.["requestedAt"] !== undefined
70
+ ? new Date(p.revocation?.["requestedAt"])
73
71
  : undefined,
74
- effectiveAt: ((_c = p.revocation) === null || _c === void 0 ? void 0 : _c["effectiveAt"]) !== undefined
75
- ? new Date((_d = p.revocation) === null || _d === void 0 ? void 0 : _d["effectiveAt"])
72
+ effectiveAt: p.revocation?.["effectiveAt"] !== undefined
73
+ ? new Date(p.revocation?.["effectiveAt"])
76
74
  : undefined,
77
- reason: (_e = p.revocation) === null || _e === void 0 ? void 0 : _e["reason"],
78
- remarks: (_f = p.revocation) === null || _f === void 0 ? void 0 : _f["remarks"],
79
- status: (_g = p.revocation) === null || _g === void 0 ? void 0 : _g["status"],
80
- failureReason: (_h = p.revocation) === null || _h === void 0 ? void 0 : _h["failureReason"],
75
+ reason: p.revocation?.["reason"],
76
+ remarks: p.revocation?.["remarks"],
77
+ status: p.revocation?.["status"],
78
+ failureReason: p.revocation?.["failureReason"],
81
79
  },
82
80
  };
83
81
  }),
@@ -92,14 +90,16 @@ export async function get(context, subscriptionId, resourceGroupName, accountNam
92
90
  export function _createSend(context, subscriptionId, resourceGroupName, accountName, profileName, resource, options = { requestOptions: {} }) {
93
91
  return context
94
92
  .path("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}/certificateProfiles/{profileName}", subscriptionId, resourceGroupName, accountName, profileName)
95
- .put(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { body: {
93
+ .put({
94
+ ...operationOptionsToRequestParameters(options),
95
+ body: {
96
96
  properties: !resource.properties
97
97
  ? resource.properties
98
98
  : certificateProfilePropertiesSerializer(resource.properties),
99
- } }));
99
+ },
100
+ });
100
101
  }
101
102
  export async function _createDeserialize(result) {
102
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
103
103
  const expectedStatuses = ["200", "201"];
104
104
  if (!expectedStatuses.includes(result.status)) {
105
105
  throw createRestError(result);
@@ -111,42 +111,41 @@ export async function _createDeserialize(result) {
111
111
  systemData: !result.body.systemData
112
112
  ? undefined
113
113
  : {
114
- createdBy: (_a = result.body.systemData) === null || _a === void 0 ? void 0 : _a["createdBy"],
115
- createdByType: (_b = result.body.systemData) === null || _b === void 0 ? void 0 : _b["createdByType"],
116
- createdAt: ((_c = result.body.systemData) === null || _c === void 0 ? void 0 : _c["createdAt"]) !== undefined
117
- ? new Date((_d = result.body.systemData) === null || _d === void 0 ? void 0 : _d["createdAt"])
114
+ createdBy: result.body.systemData?.["createdBy"],
115
+ createdByType: result.body.systemData?.["createdByType"],
116
+ createdAt: result.body.systemData?.["createdAt"] !== undefined
117
+ ? new Date(result.body.systemData?.["createdAt"])
118
118
  : undefined,
119
- lastModifiedBy: (_e = result.body.systemData) === null || _e === void 0 ? void 0 : _e["lastModifiedBy"],
120
- lastModifiedByType: (_f = result.body.systemData) === null || _f === void 0 ? void 0 : _f["lastModifiedByType"],
121
- lastModifiedAt: ((_g = result.body.systemData) === null || _g === void 0 ? void 0 : _g["lastModifiedAt"]) !== undefined
122
- ? new Date((_h = result.body.systemData) === null || _h === void 0 ? void 0 : _h["lastModifiedAt"])
119
+ lastModifiedBy: result.body.systemData?.["lastModifiedBy"],
120
+ lastModifiedByType: result.body.systemData?.["lastModifiedByType"],
121
+ lastModifiedAt: result.body.systemData?.["lastModifiedAt"] !== undefined
122
+ ? new Date(result.body.systemData?.["lastModifiedAt"])
123
123
  : undefined,
124
124
  },
125
125
  properties: !result.body.properties
126
126
  ? undefined
127
127
  : {
128
- profileType: (_j = result.body.properties) === null || _j === void 0 ? void 0 : _j["profileType"],
129
- commonName: (_k = result.body.properties) === null || _k === void 0 ? void 0 : _k["commonName"],
130
- organization: (_l = result.body.properties) === null || _l === void 0 ? void 0 : _l["organization"],
131
- organizationUnit: (_m = result.body.properties) === null || _m === void 0 ? void 0 : _m["organizationUnit"],
132
- streetAddress: (_o = result.body.properties) === null || _o === void 0 ? void 0 : _o["streetAddress"],
133
- includeStreetAddress: (_p = result.body.properties) === null || _p === void 0 ? void 0 : _p["includeStreetAddress"],
134
- city: (_q = result.body.properties) === null || _q === void 0 ? void 0 : _q["city"],
135
- includeCity: (_r = result.body.properties) === null || _r === void 0 ? void 0 : _r["includeCity"],
136
- state: (_s = result.body.properties) === null || _s === void 0 ? void 0 : _s["state"],
137
- includeState: (_t = result.body.properties) === null || _t === void 0 ? void 0 : _t["includeState"],
138
- country: (_u = result.body.properties) === null || _u === void 0 ? void 0 : _u["country"],
139
- includeCountry: (_v = result.body.properties) === null || _v === void 0 ? void 0 : _v["includeCountry"],
140
- postalCode: (_w = result.body.properties) === null || _w === void 0 ? void 0 : _w["postalCode"],
141
- includePostalCode: (_x = result.body.properties) === null || _x === void 0 ? void 0 : _x["includePostalCode"],
142
- enhancedKeyUsage: (_y = result.body.properties) === null || _y === void 0 ? void 0 : _y["enhancedKeyUsage"],
143
- identityValidationId: (_z = result.body.properties) === null || _z === void 0 ? void 0 : _z["identityValidationId"],
144
- provisioningState: (_0 = result.body.properties) === null || _0 === void 0 ? void 0 : _0["provisioningState"],
145
- status: (_1 = result.body.properties) === null || _1 === void 0 ? void 0 : _1["status"],
146
- certificates: ((_2 = result.body.properties) === null || _2 === void 0 ? void 0 : _2["certificates"]) === undefined
147
- ? (_3 = result.body.properties) === null || _3 === void 0 ? void 0 : _3["certificates"]
148
- : (_4 = result.body.properties) === null || _4 === void 0 ? void 0 : _4["certificates"].map((p) => {
149
- var _a, _b, _c, _d, _e, _f, _g, _h;
128
+ profileType: result.body.properties?.["profileType"],
129
+ commonName: result.body.properties?.["commonName"],
130
+ organization: result.body.properties?.["organization"],
131
+ organizationUnit: result.body.properties?.["organizationUnit"],
132
+ streetAddress: result.body.properties?.["streetAddress"],
133
+ includeStreetAddress: result.body.properties?.["includeStreetAddress"],
134
+ city: result.body.properties?.["city"],
135
+ includeCity: result.body.properties?.["includeCity"],
136
+ state: result.body.properties?.["state"],
137
+ includeState: result.body.properties?.["includeState"],
138
+ country: result.body.properties?.["country"],
139
+ includeCountry: result.body.properties?.["includeCountry"],
140
+ postalCode: result.body.properties?.["postalCode"],
141
+ includePostalCode: result.body.properties?.["includePostalCode"],
142
+ enhancedKeyUsage: result.body.properties?.["enhancedKeyUsage"],
143
+ identityValidationId: result.body.properties?.["identityValidationId"],
144
+ provisioningState: result.body.properties?.["provisioningState"],
145
+ status: result.body.properties?.["status"],
146
+ certificates: result.body.properties?.["certificates"] === undefined
147
+ ? result.body.properties?.["certificates"]
148
+ : result.body.properties?.["certificates"].map((p) => {
150
149
  return {
151
150
  serialNumber: p["serialNumber"],
152
151
  subjectName: p["subjectName"],
@@ -157,16 +156,16 @@ export async function _createDeserialize(result) {
157
156
  revocation: !p.revocation
158
157
  ? undefined
159
158
  : {
160
- requestedAt: ((_a = p.revocation) === null || _a === void 0 ? void 0 : _a["requestedAt"]) !== undefined
161
- ? new Date((_b = p.revocation) === null || _b === void 0 ? void 0 : _b["requestedAt"])
159
+ requestedAt: p.revocation?.["requestedAt"] !== undefined
160
+ ? new Date(p.revocation?.["requestedAt"])
162
161
  : undefined,
163
- effectiveAt: ((_c = p.revocation) === null || _c === void 0 ? void 0 : _c["effectiveAt"]) !== undefined
164
- ? new Date((_d = p.revocation) === null || _d === void 0 ? void 0 : _d["effectiveAt"])
162
+ effectiveAt: p.revocation?.["effectiveAt"] !== undefined
163
+ ? new Date(p.revocation?.["effectiveAt"])
165
164
  : undefined,
166
- reason: (_e = p.revocation) === null || _e === void 0 ? void 0 : _e["reason"],
167
- remarks: (_f = p.revocation) === null || _f === void 0 ? void 0 : _f["remarks"],
168
- status: (_g = p.revocation) === null || _g === void 0 ? void 0 : _g["status"],
169
- failureReason: (_h = p.revocation) === null || _h === void 0 ? void 0 : _h["failureReason"],
165
+ reason: p.revocation?.["reason"],
166
+ remarks: p.revocation?.["remarks"],
167
+ status: p.revocation?.["status"],
168
+ failureReason: p.revocation?.["failureReason"],
170
169
  },
171
170
  };
172
171
  }),
@@ -176,8 +175,8 @@ export async function _createDeserialize(result) {
176
175
  /** Create a certificate profile. */
177
176
  export function create(context, subscriptionId, resourceGroupName, accountName, profileName, resource, options = { requestOptions: {} }) {
178
177
  return getLongRunningPoller(context, _createDeserialize, ["200", "201"], {
179
- updateIntervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
180
- abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal,
178
+ updateIntervalInMs: options?.updateIntervalInMs,
179
+ abortSignal: options?.abortSignal,
181
180
  getInitialResponse: () => _createSend(context, subscriptionId, resourceGroupName, accountName, profileName, resource, options),
182
181
  resourceLocationConfig: "azure-async-operation",
183
182
  });
@@ -185,7 +184,7 @@ export function create(context, subscriptionId, resourceGroupName, accountName,
185
184
  export function _$deleteSend(context, subscriptionId, resourceGroupName, accountName, profileName, options = { requestOptions: {} }) {
186
185
  return context
187
186
  .path("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}/certificateProfiles/{profileName}", subscriptionId, resourceGroupName, accountName, profileName)
188
- .delete(Object.assign({}, operationOptionsToRequestParameters(options)));
187
+ .delete({ ...operationOptionsToRequestParameters(options) });
189
188
  }
190
189
  export async function _$deleteDeserialize(result) {
191
190
  const expectedStatuses = ["202", "204", "200"];
@@ -202,8 +201,8 @@ export async function _$deleteDeserialize(result) {
202
201
  */
203
202
  export function $delete(context, subscriptionId, resourceGroupName, accountName, profileName, options = { requestOptions: {} }) {
204
203
  return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], {
205
- updateIntervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
206
- abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal,
204
+ updateIntervalInMs: options?.updateIntervalInMs,
205
+ abortSignal: options?.abortSignal,
207
206
  getInitialResponse: () => _$deleteSend(context, subscriptionId, resourceGroupName, accountName, profileName, options),
208
207
  resourceLocationConfig: "location",
209
208
  });
@@ -213,7 +212,7 @@ export function _listByCodeSigningAccountSend(context, subscriptionId, resourceG
213
212
  }) {
214
213
  return context
215
214
  .path("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}/certificateProfiles", subscriptionId, resourceGroupName, accountName)
216
- .get(Object.assign({}, operationOptionsToRequestParameters(options)));
215
+ .get({ ...operationOptionsToRequestParameters(options) });
217
216
  }
218
217
  export async function _listByCodeSigningAccountDeserialize(result) {
219
218
  const expectedStatuses = ["200"];
@@ -222,7 +221,6 @@ export async function _listByCodeSigningAccountDeserialize(result) {
222
221
  }
223
222
  return {
224
223
  value: result.body["value"].map((p) => {
225
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
226
224
  return {
227
225
  id: p["id"],
228
226
  name: p["name"],
@@ -230,42 +228,41 @@ export async function _listByCodeSigningAccountDeserialize(result) {
230
228
  systemData: !p.systemData
231
229
  ? undefined
232
230
  : {
233
- createdBy: (_a = p.systemData) === null || _a === void 0 ? void 0 : _a["createdBy"],
234
- createdByType: (_b = p.systemData) === null || _b === void 0 ? void 0 : _b["createdByType"],
235
- createdAt: ((_c = p.systemData) === null || _c === void 0 ? void 0 : _c["createdAt"]) !== undefined
236
- ? new Date((_d = p.systemData) === null || _d === void 0 ? void 0 : _d["createdAt"])
231
+ createdBy: p.systemData?.["createdBy"],
232
+ createdByType: p.systemData?.["createdByType"],
233
+ createdAt: p.systemData?.["createdAt"] !== undefined
234
+ ? new Date(p.systemData?.["createdAt"])
237
235
  : undefined,
238
- lastModifiedBy: (_e = p.systemData) === null || _e === void 0 ? void 0 : _e["lastModifiedBy"],
239
- lastModifiedByType: (_f = p.systemData) === null || _f === void 0 ? void 0 : _f["lastModifiedByType"],
240
- lastModifiedAt: ((_g = p.systemData) === null || _g === void 0 ? void 0 : _g["lastModifiedAt"]) !== undefined
241
- ? new Date((_h = p.systemData) === null || _h === void 0 ? void 0 : _h["lastModifiedAt"])
236
+ lastModifiedBy: p.systemData?.["lastModifiedBy"],
237
+ lastModifiedByType: p.systemData?.["lastModifiedByType"],
238
+ lastModifiedAt: p.systemData?.["lastModifiedAt"] !== undefined
239
+ ? new Date(p.systemData?.["lastModifiedAt"])
242
240
  : undefined,
243
241
  },
244
242
  properties: !p.properties
245
243
  ? undefined
246
244
  : {
247
- profileType: (_j = p.properties) === null || _j === void 0 ? void 0 : _j["profileType"],
248
- commonName: (_k = p.properties) === null || _k === void 0 ? void 0 : _k["commonName"],
249
- organization: (_l = p.properties) === null || _l === void 0 ? void 0 : _l["organization"],
250
- organizationUnit: (_m = p.properties) === null || _m === void 0 ? void 0 : _m["organizationUnit"],
251
- streetAddress: (_o = p.properties) === null || _o === void 0 ? void 0 : _o["streetAddress"],
252
- includeStreetAddress: (_p = p.properties) === null || _p === void 0 ? void 0 : _p["includeStreetAddress"],
253
- city: (_q = p.properties) === null || _q === void 0 ? void 0 : _q["city"],
254
- includeCity: (_r = p.properties) === null || _r === void 0 ? void 0 : _r["includeCity"],
255
- state: (_s = p.properties) === null || _s === void 0 ? void 0 : _s["state"],
256
- includeState: (_t = p.properties) === null || _t === void 0 ? void 0 : _t["includeState"],
257
- country: (_u = p.properties) === null || _u === void 0 ? void 0 : _u["country"],
258
- includeCountry: (_v = p.properties) === null || _v === void 0 ? void 0 : _v["includeCountry"],
259
- postalCode: (_w = p.properties) === null || _w === void 0 ? void 0 : _w["postalCode"],
260
- includePostalCode: (_x = p.properties) === null || _x === void 0 ? void 0 : _x["includePostalCode"],
261
- enhancedKeyUsage: (_y = p.properties) === null || _y === void 0 ? void 0 : _y["enhancedKeyUsage"],
262
- identityValidationId: (_z = p.properties) === null || _z === void 0 ? void 0 : _z["identityValidationId"],
263
- provisioningState: (_0 = p.properties) === null || _0 === void 0 ? void 0 : _0["provisioningState"],
264
- status: (_1 = p.properties) === null || _1 === void 0 ? void 0 : _1["status"],
265
- certificates: ((_2 = p.properties) === null || _2 === void 0 ? void 0 : _2["certificates"]) === undefined
266
- ? (_3 = p.properties) === null || _3 === void 0 ? void 0 : _3["certificates"]
267
- : (_4 = p.properties) === null || _4 === void 0 ? void 0 : _4["certificates"].map((p) => {
268
- var _a, _b, _c, _d, _e, _f, _g, _h;
245
+ profileType: p.properties?.["profileType"],
246
+ commonName: p.properties?.["commonName"],
247
+ organization: p.properties?.["organization"],
248
+ organizationUnit: p.properties?.["organizationUnit"],
249
+ streetAddress: p.properties?.["streetAddress"],
250
+ includeStreetAddress: p.properties?.["includeStreetAddress"],
251
+ city: p.properties?.["city"],
252
+ includeCity: p.properties?.["includeCity"],
253
+ state: p.properties?.["state"],
254
+ includeState: p.properties?.["includeState"],
255
+ country: p.properties?.["country"],
256
+ includeCountry: p.properties?.["includeCountry"],
257
+ postalCode: p.properties?.["postalCode"],
258
+ includePostalCode: p.properties?.["includePostalCode"],
259
+ enhancedKeyUsage: p.properties?.["enhancedKeyUsage"],
260
+ identityValidationId: p.properties?.["identityValidationId"],
261
+ provisioningState: p.properties?.["provisioningState"],
262
+ status: p.properties?.["status"],
263
+ certificates: p.properties?.["certificates"] === undefined
264
+ ? p.properties?.["certificates"]
265
+ : p.properties?.["certificates"].map((p) => {
269
266
  return {
270
267
  serialNumber: p["serialNumber"],
271
268
  subjectName: p["subjectName"],
@@ -276,16 +273,16 @@ export async function _listByCodeSigningAccountDeserialize(result) {
276
273
  revocation: !p.revocation
277
274
  ? undefined
278
275
  : {
279
- requestedAt: ((_a = p.revocation) === null || _a === void 0 ? void 0 : _a["requestedAt"]) !== undefined
280
- ? new Date((_b = p.revocation) === null || _b === void 0 ? void 0 : _b["requestedAt"])
276
+ requestedAt: p.revocation?.["requestedAt"] !== undefined
277
+ ? new Date(p.revocation?.["requestedAt"])
281
278
  : undefined,
282
- effectiveAt: ((_c = p.revocation) === null || _c === void 0 ? void 0 : _c["effectiveAt"]) !== undefined
283
- ? new Date((_d = p.revocation) === null || _d === void 0 ? void 0 : _d["effectiveAt"])
279
+ effectiveAt: p.revocation?.["effectiveAt"] !== undefined
280
+ ? new Date(p.revocation?.["effectiveAt"])
284
281
  : undefined,
285
- reason: (_e = p.revocation) === null || _e === void 0 ? void 0 : _e["reason"],
286
- remarks: (_f = p.revocation) === null || _f === void 0 ? void 0 : _f["remarks"],
287
- status: (_g = p.revocation) === null || _g === void 0 ? void 0 : _g["status"],
288
- failureReason: (_h = p.revocation) === null || _h === void 0 ? void 0 : _h["failureReason"],
282
+ reason: p.revocation?.["reason"],
283
+ remarks: p.revocation?.["remarks"],
284
+ status: p.revocation?.["status"],
285
+ failureReason: p.revocation?.["failureReason"],
289
286
  },
290
287
  };
291
288
  }),
@@ -306,13 +303,16 @@ export function _revokeCertificateSend(context, subscriptionId, resourceGroupNam
306
303
  }) {
307
304
  return context
308
305
  .path("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}/certificateProfiles/{profileName}/revokeCertificate", subscriptionId, resourceGroupName, accountName, profileName)
309
- .post(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { body: {
306
+ .post({
307
+ ...operationOptionsToRequestParameters(options),
308
+ body: {
310
309
  serialNumber: body["serialNumber"],
311
310
  thumbprint: body["thumbprint"],
312
311
  effectiveAt: body["effectiveAt"].toISOString(),
313
312
  reason: body["reason"],
314
313
  remarks: body["remarks"],
315
- } }));
314
+ },
315
+ });
316
316
  }
317
317
  export async function _revokeCertificateDeserialize(result) {
318
318
  const expectedStatuses = ["204"];