@azure/synapse-access-control 1.0.0-beta.3 → 1.0.0-beta.5

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 (232) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +11 -18
  3. package/dist/browser/accessControlClient.d.ts +21 -0
  4. package/dist/browser/accessControlClient.d.ts.map +1 -0
  5. package/dist/browser/accessControlClient.js +103 -0
  6. package/dist/browser/accessControlClient.js.map +1 -0
  7. package/dist/browser/index.d.ts +4 -0
  8. package/dist/browser/index.d.ts.map +1 -0
  9. package/dist/browser/index.js +11 -0
  10. package/dist/browser/index.js.map +1 -0
  11. package/dist/browser/models/index.d.ts +213 -0
  12. package/dist/browser/models/index.d.ts.map +1 -0
  13. package/dist/browser/models/index.js.map +1 -0
  14. package/dist/browser/models/mappers.d.ts +16 -0
  15. package/dist/browser/models/mappers.d.ts.map +1 -0
  16. package/{dist-esm/src → dist/browser}/models/mappers.js +151 -151
  17. package/dist/browser/models/mappers.js.map +1 -0
  18. package/dist/browser/models/parameters.d.ts +20 -0
  19. package/dist/browser/models/parameters.d.ts.map +1 -0
  20. package/{dist-esm/src → dist/browser}/models/parameters.js +42 -42
  21. package/dist/browser/models/parameters.js.map +1 -0
  22. package/dist/browser/operations/index.d.ts +3 -0
  23. package/dist/browser/operations/index.d.ts.map +1 -0
  24. package/{dist-esm/src → dist/browser}/operations/index.js +2 -2
  25. package/{dist-esm/src → dist/browser}/operations/index.js.map +1 -1
  26. package/dist/browser/operations/roleAssignments.d.ts +55 -0
  27. package/dist/browser/operations/roleAssignments.d.ts.map +1 -0
  28. package/dist/browser/operations/roleAssignments.js +210 -0
  29. package/dist/browser/operations/roleAssignments.js.map +1 -0
  30. package/dist/browser/operations/roleDefinitions.d.ts +29 -0
  31. package/dist/browser/operations/roleDefinitions.d.ts.map +1 -0
  32. package/dist/browser/operations/roleDefinitions.js +110 -0
  33. package/dist/browser/operations/roleDefinitions.js.map +1 -0
  34. package/dist/browser/operationsInterfaces/index.d.ts +3 -0
  35. package/dist/browser/operationsInterfaces/index.d.ts.map +1 -0
  36. package/dist/browser/operationsInterfaces/index.js +10 -0
  37. package/{dist-esm/src → dist/browser}/operationsInterfaces/index.js.map +1 -1
  38. package/dist/browser/operationsInterfaces/roleAssignments.d.ts +40 -0
  39. package/dist/browser/operationsInterfaces/roleAssignments.d.ts.map +1 -0
  40. package/dist/browser/operationsInterfaces/roleAssignments.js.map +1 -0
  41. package/dist/browser/operationsInterfaces/roleDefinitions.d.ts +21 -0
  42. package/dist/browser/operationsInterfaces/roleDefinitions.d.ts.map +1 -0
  43. package/dist/browser/operationsInterfaces/roleDefinitions.js.map +1 -0
  44. package/dist/browser/package.json +3 -0
  45. package/dist/browser/tracing.d.ts +2 -0
  46. package/dist/browser/tracing.d.ts.map +1 -0
  47. package/{dist-esm/src → dist/browser}/tracing.js +4 -3
  48. package/dist/browser/tracing.js.map +1 -0
  49. package/dist/commonjs/accessControlClient.d.ts +21 -0
  50. package/dist/commonjs/accessControlClient.d.ts.map +1 -0
  51. package/dist/commonjs/accessControlClient.js +108 -0
  52. package/dist/commonjs/accessControlClient.js.map +1 -0
  53. package/dist/commonjs/index.d.ts +4 -0
  54. package/dist/commonjs/index.d.ts.map +1 -0
  55. package/dist/commonjs/index.js +16 -0
  56. package/dist/commonjs/index.js.map +1 -0
  57. package/dist/commonjs/models/index.d.ts +213 -0
  58. package/dist/commonjs/models/index.d.ts.map +1 -0
  59. package/dist/commonjs/models/index.js +10 -0
  60. package/dist/commonjs/models/index.js.map +1 -0
  61. package/dist/commonjs/models/mappers.d.ts +16 -0
  62. package/dist/commonjs/models/mappers.d.ts.map +1 -0
  63. package/dist/commonjs/models/mappers.js +460 -0
  64. package/dist/commonjs/models/mappers.js.map +1 -0
  65. package/dist/commonjs/models/parameters.d.ts +20 -0
  66. package/dist/commonjs/models/parameters.d.ts.map +1 -0
  67. package/dist/commonjs/models/parameters.js +152 -0
  68. package/dist/commonjs/models/parameters.js.map +1 -0
  69. package/dist/commonjs/operations/index.d.ts +3 -0
  70. package/dist/commonjs/operations/index.d.ts.map +1 -0
  71. package/dist/commonjs/operations/index.js +13 -0
  72. package/dist/commonjs/operations/index.js.map +1 -0
  73. package/dist/commonjs/operations/roleAssignments.d.ts +55 -0
  74. package/dist/commonjs/operations/roleAssignments.d.ts.map +1 -0
  75. package/dist/commonjs/operations/roleAssignments.js +215 -0
  76. package/dist/commonjs/operations/roleAssignments.js.map +1 -0
  77. package/dist/commonjs/operations/roleDefinitions.d.ts +29 -0
  78. package/dist/commonjs/operations/roleDefinitions.d.ts.map +1 -0
  79. package/dist/commonjs/operations/roleDefinitions.js +115 -0
  80. package/dist/commonjs/operations/roleDefinitions.js.map +1 -0
  81. package/dist/commonjs/operationsInterfaces/index.d.ts +3 -0
  82. package/dist/commonjs/operationsInterfaces/index.d.ts.map +1 -0
  83. package/dist/commonjs/operationsInterfaces/index.js +13 -0
  84. package/dist/commonjs/operationsInterfaces/index.js.map +1 -0
  85. package/dist/commonjs/operationsInterfaces/roleAssignments.d.ts +40 -0
  86. package/dist/commonjs/operationsInterfaces/roleAssignments.d.ts.map +1 -0
  87. package/dist/commonjs/operationsInterfaces/roleAssignments.js +10 -0
  88. package/dist/commonjs/operationsInterfaces/roleAssignments.js.map +1 -0
  89. package/dist/commonjs/operationsInterfaces/roleDefinitions.d.ts +21 -0
  90. package/dist/commonjs/operationsInterfaces/roleDefinitions.d.ts.map +1 -0
  91. package/dist/commonjs/operationsInterfaces/roleDefinitions.js +10 -0
  92. package/dist/commonjs/operationsInterfaces/roleDefinitions.js.map +1 -0
  93. package/dist/commonjs/package.json +3 -0
  94. package/dist/commonjs/tracing.d.ts +2 -0
  95. package/dist/commonjs/tracing.d.ts.map +1 -0
  96. package/dist/commonjs/tracing.js +17 -0
  97. package/dist/commonjs/tracing.js.map +1 -0
  98. package/dist/commonjs/tsdoc-metadata.json +11 -0
  99. package/dist/esm/accessControlClient.d.ts +21 -0
  100. package/dist/esm/accessControlClient.d.ts.map +1 -0
  101. package/dist/esm/accessControlClient.js +103 -0
  102. package/dist/esm/accessControlClient.js.map +1 -0
  103. package/dist/esm/index.d.ts +4 -0
  104. package/dist/esm/index.d.ts.map +1 -0
  105. package/dist/esm/index.js +11 -0
  106. package/dist/esm/index.js.map +1 -0
  107. package/dist/esm/models/index.d.ts +213 -0
  108. package/dist/esm/models/index.d.ts.map +1 -0
  109. package/{dist-esm/src/operationsInterfaces → dist/esm/models}/index.js +1 -2
  110. package/dist/esm/models/index.js.map +1 -0
  111. package/dist/esm/models/mappers.d.ts +16 -0
  112. package/dist/esm/models/mappers.d.ts.map +1 -0
  113. package/dist/esm/models/mappers.js +457 -0
  114. package/dist/esm/models/mappers.js.map +1 -0
  115. package/dist/esm/models/parameters.d.ts +20 -0
  116. package/dist/esm/models/parameters.d.ts.map +1 -0
  117. package/dist/esm/models/parameters.js +149 -0
  118. package/dist/esm/models/parameters.js.map +1 -0
  119. package/dist/esm/operations/index.d.ts +3 -0
  120. package/dist/esm/operations/index.d.ts.map +1 -0
  121. package/dist/esm/operations/index.js +10 -0
  122. package/dist/esm/operations/index.js.map +1 -0
  123. package/dist/esm/operations/roleAssignments.d.ts +55 -0
  124. package/dist/esm/operations/roleAssignments.d.ts.map +1 -0
  125. package/dist/esm/operations/roleAssignments.js +210 -0
  126. package/dist/esm/operations/roleAssignments.js.map +1 -0
  127. package/dist/esm/operations/roleDefinitions.d.ts +29 -0
  128. package/dist/esm/operations/roleDefinitions.d.ts.map +1 -0
  129. package/dist/esm/operations/roleDefinitions.js +110 -0
  130. package/dist/esm/operations/roleDefinitions.js.map +1 -0
  131. package/dist/esm/operationsInterfaces/index.d.ts +3 -0
  132. package/dist/esm/operationsInterfaces/index.d.ts.map +1 -0
  133. package/dist/esm/operationsInterfaces/index.js +10 -0
  134. package/dist/esm/operationsInterfaces/index.js.map +1 -0
  135. package/dist/esm/operationsInterfaces/roleAssignments.d.ts +40 -0
  136. package/dist/esm/operationsInterfaces/roleAssignments.d.ts.map +1 -0
  137. package/dist/esm/operationsInterfaces/roleAssignments.js +9 -0
  138. package/dist/esm/operationsInterfaces/roleAssignments.js.map +1 -0
  139. package/dist/esm/operationsInterfaces/roleDefinitions.d.ts +21 -0
  140. package/dist/esm/operationsInterfaces/roleDefinitions.d.ts.map +1 -0
  141. package/dist/esm/operationsInterfaces/roleDefinitions.js +9 -0
  142. package/dist/esm/operationsInterfaces/roleDefinitions.js.map +1 -0
  143. package/dist/esm/package.json +3 -0
  144. package/dist/esm/tracing.d.ts +2 -0
  145. package/dist/esm/tracing.d.ts.map +1 -0
  146. package/dist/esm/tracing.js +14 -0
  147. package/dist/esm/tracing.js.map +1 -0
  148. package/dist/react-native/accessControlClient.d.ts +21 -0
  149. package/dist/react-native/accessControlClient.d.ts.map +1 -0
  150. package/dist/react-native/accessControlClient.js +103 -0
  151. package/dist/react-native/accessControlClient.js.map +1 -0
  152. package/dist/react-native/index.d.ts +4 -0
  153. package/dist/react-native/index.d.ts.map +1 -0
  154. package/dist/react-native/index.js +11 -0
  155. package/dist/react-native/index.js.map +1 -0
  156. package/dist/react-native/models/index.d.ts +213 -0
  157. package/dist/react-native/models/index.d.ts.map +1 -0
  158. package/dist/react-native/models/index.js +9 -0
  159. package/dist/react-native/models/index.js.map +1 -0
  160. package/dist/react-native/models/mappers.d.ts +16 -0
  161. package/dist/react-native/models/mappers.d.ts.map +1 -0
  162. package/dist/react-native/models/mappers.js +457 -0
  163. package/dist/react-native/models/mappers.js.map +1 -0
  164. package/dist/react-native/models/parameters.d.ts +20 -0
  165. package/dist/react-native/models/parameters.d.ts.map +1 -0
  166. package/dist/react-native/models/parameters.js +149 -0
  167. package/dist/react-native/models/parameters.js.map +1 -0
  168. package/dist/react-native/operations/index.d.ts +3 -0
  169. package/dist/react-native/operations/index.d.ts.map +1 -0
  170. package/dist/react-native/operations/index.js +10 -0
  171. package/dist/react-native/operations/index.js.map +1 -0
  172. package/dist/react-native/operations/roleAssignments.d.ts +55 -0
  173. package/dist/react-native/operations/roleAssignments.d.ts.map +1 -0
  174. package/dist/react-native/operations/roleAssignments.js +210 -0
  175. package/dist/react-native/operations/roleAssignments.js.map +1 -0
  176. package/dist/react-native/operations/roleDefinitions.d.ts +29 -0
  177. package/dist/react-native/operations/roleDefinitions.d.ts.map +1 -0
  178. package/dist/react-native/operations/roleDefinitions.js +110 -0
  179. package/dist/react-native/operations/roleDefinitions.js.map +1 -0
  180. package/dist/react-native/operationsInterfaces/index.d.ts +3 -0
  181. package/dist/react-native/operationsInterfaces/index.d.ts.map +1 -0
  182. package/dist/react-native/operationsInterfaces/index.js +10 -0
  183. package/dist/react-native/operationsInterfaces/index.js.map +1 -0
  184. package/dist/react-native/operationsInterfaces/roleAssignments.d.ts +40 -0
  185. package/dist/react-native/operationsInterfaces/roleAssignments.d.ts.map +1 -0
  186. package/dist/react-native/operationsInterfaces/roleAssignments.js +9 -0
  187. package/dist/react-native/operationsInterfaces/roleAssignments.js.map +1 -0
  188. package/dist/react-native/operationsInterfaces/roleDefinitions.d.ts +21 -0
  189. package/dist/react-native/operationsInterfaces/roleDefinitions.d.ts.map +1 -0
  190. package/dist/react-native/operationsInterfaces/roleDefinitions.js +9 -0
  191. package/dist/react-native/operationsInterfaces/roleDefinitions.js.map +1 -0
  192. package/dist/react-native/package.json +3 -0
  193. package/dist/react-native/tracing.d.ts +2 -0
  194. package/dist/react-native/tracing.d.ts.map +1 -0
  195. package/dist/react-native/tracing.js +14 -0
  196. package/dist/react-native/tracing.js.map +1 -0
  197. package/package.json +84 -84
  198. package/CHANGELOG.md +0 -18
  199. package/dist/index.js +0 -1070
  200. package/dist/index.js.map +0 -1
  201. package/dist/index.min.js +0 -1
  202. package/dist/index.min.js.map +0 -1
  203. package/dist-esm/src/accessControlClient.js +0 -24
  204. package/dist-esm/src/accessControlClient.js.map +0 -1
  205. package/dist-esm/src/accessControlClientContext.js +0 -49
  206. package/dist-esm/src/accessControlClientContext.js.map +0 -1
  207. package/dist-esm/src/index.js +0 -12
  208. package/dist-esm/src/index.js.map +0 -1
  209. package/dist-esm/src/models/index.js.map +0 -1
  210. package/dist-esm/src/models/mappers.js.map +0 -1
  211. package/dist-esm/src/models/parameters.js.map +0 -1
  212. package/dist-esm/src/operations/roleAssignments.js +0 -243
  213. package/dist-esm/src/operations/roleAssignments.js.map +0 -1
  214. package/dist-esm/src/operations/roleDefinitions.js +0 -150
  215. package/dist-esm/src/operations/roleDefinitions.js.map +0 -1
  216. package/dist-esm/src/operationsInterfaces/roleAssignments.js.map +0 -1
  217. package/dist-esm/src/operationsInterfaces/roleDefinitions.js.map +0 -1
  218. package/dist-esm/src/tracing.js.map +0 -1
  219. package/dist-esm/test/public/test.spec.js +0 -18
  220. package/dist-esm/test/public/test.spec.js.map +0 -1
  221. package/dist-esm/test/public/utils/env.browser.js +0 -4
  222. package/dist-esm/test/public/utils/env.browser.js.map +0 -1
  223. package/dist-esm/test/public/utils/env.js +0 -5
  224. package/dist-esm/test/public/utils/env.js.map +0 -1
  225. package/dist-esm/test/public/utils/recordedClient.js +0 -41
  226. package/dist-esm/test/public/utils/recordedClient.js.map +0 -1
  227. package/rollup.config.js +0 -3
  228. package/tsconfig.json +0 -19
  229. package/types/synapse-access-control.d.ts +0 -329
  230. /package/{dist-esm/src → dist/browser}/models/index.js +0 -0
  231. /package/{dist-esm/src → dist/browser}/operationsInterfaces/roleAssignments.js +0 -0
  232. /package/{dist-esm/src → dist/browser}/operationsInterfaces/roleDefinitions.js +0 -0
@@ -1,243 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- */
8
- import { createSpan } from "../tracing";
9
- import * as coreClient from "@azure/core-client";
10
- import * as coreTracing from "@azure/core-tracing";
11
- import * as Mappers from "../models/mappers";
12
- import * as Parameters from "../models/parameters";
13
- /** Class representing a RoleAssignments. */
14
- export class RoleAssignmentsImpl {
15
- /**
16
- * Initialize a new instance of the class RoleAssignments class.
17
- * @param client Reference to the service client
18
- */
19
- constructor(client) {
20
- this.client = client;
21
- }
22
- /**
23
- * Check if the given principalId has access to perform list of actions at a given scope.
24
- * @param subject Subject details
25
- * @param actions List of actions.
26
- * @param scope Scope at which the check access is done.
27
- * @param options The options parameters.
28
- */
29
- async checkPrincipalAccess(subject, actions, scope, options) {
30
- const { span } = createSpan("AccessControlClient-checkPrincipalAccess", options || {});
31
- try {
32
- const result = await this.client.sendOperationRequest({ subject, actions, scope, options }, checkPrincipalAccessOperationSpec);
33
- return result;
34
- }
35
- catch (error) {
36
- span.setStatus({
37
- code: coreTracing.SpanStatusCode.UNSET,
38
- message: error.message
39
- });
40
- throw error;
41
- }
42
- finally {
43
- span.end();
44
- }
45
- }
46
- /**
47
- * List role assignments.
48
- * @param options The options parameters.
49
- */
50
- async listRoleAssignments(options) {
51
- const { span } = createSpan("AccessControlClient-listRoleAssignments", options || {});
52
- try {
53
- const result = await this.client.sendOperationRequest({ options }, listRoleAssignmentsOperationSpec);
54
- return result;
55
- }
56
- catch (error) {
57
- span.setStatus({
58
- code: coreTracing.SpanStatusCode.UNSET,
59
- message: error.message
60
- });
61
- throw error;
62
- }
63
- finally {
64
- span.end();
65
- }
66
- }
67
- /**
68
- * Create role assignment.
69
- * @param roleAssignmentId The ID of the role assignment.
70
- * @param roleId Role ID of the Synapse Built-In Role
71
- * @param principalId Object ID of the AAD principal or security-group
72
- * @param scope Scope at which the role assignment is created
73
- * @param options The options parameters.
74
- */
75
- async createRoleAssignment(roleAssignmentId, roleId, principalId, scope, options) {
76
- const { span } = createSpan("AccessControlClient-createRoleAssignment", options || {});
77
- try {
78
- const result = await this.client.sendOperationRequest({ roleAssignmentId, roleId, principalId, scope, options }, createRoleAssignmentOperationSpec);
79
- return result;
80
- }
81
- catch (error) {
82
- span.setStatus({
83
- code: coreTracing.SpanStatusCode.UNSET,
84
- message: error.message
85
- });
86
- throw error;
87
- }
88
- finally {
89
- span.end();
90
- }
91
- }
92
- /**
93
- * Get role assignment by role assignment Id.
94
- * @param roleAssignmentId The ID of the role assignment.
95
- * @param options The options parameters.
96
- */
97
- async getRoleAssignmentById(roleAssignmentId, options) {
98
- const { span } = createSpan("AccessControlClient-getRoleAssignmentById", options || {});
99
- try {
100
- const result = await this.client.sendOperationRequest({ roleAssignmentId, options }, getRoleAssignmentByIdOperationSpec);
101
- return result;
102
- }
103
- catch (error) {
104
- span.setStatus({
105
- code: coreTracing.SpanStatusCode.UNSET,
106
- message: error.message
107
- });
108
- throw error;
109
- }
110
- finally {
111
- span.end();
112
- }
113
- }
114
- /**
115
- * Delete role assignment by role assignment Id.
116
- * @param roleAssignmentId The ID of the role assignment.
117
- * @param options The options parameters.
118
- */
119
- async deleteRoleAssignmentById(roleAssignmentId, options) {
120
- const { span } = createSpan("AccessControlClient-deleteRoleAssignmentById", options || {});
121
- try {
122
- const result = await this.client.sendOperationRequest({ roleAssignmentId, options }, deleteRoleAssignmentByIdOperationSpec);
123
- return result;
124
- }
125
- catch (error) {
126
- span.setStatus({
127
- code: coreTracing.SpanStatusCode.UNSET,
128
- message: error.message
129
- });
130
- throw error;
131
- }
132
- finally {
133
- span.end();
134
- }
135
- }
136
- }
137
- // Operation Specifications
138
- const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
139
- const checkPrincipalAccessOperationSpec = {
140
- path: "/checkAccessSynapseRbac",
141
- httpMethod: "POST",
142
- responses: {
143
- 200: {
144
- bodyMapper: Mappers.CheckPrincipalAccessResponse
145
- },
146
- default: {
147
- bodyMapper: Mappers.ErrorContract
148
- }
149
- },
150
- requestBody: {
151
- parameterPath: {
152
- subject: ["subject"],
153
- actions: ["actions"],
154
- scope: ["scope"]
155
- },
156
- mapper: Object.assign(Object.assign({}, Mappers.CheckPrincipalAccessRequest), { required: true })
157
- },
158
- queryParameters: [Parameters.apiVersion],
159
- urlParameters: [Parameters.endpoint],
160
- headerParameters: [Parameters.contentType, Parameters.accept],
161
- mediaType: "json",
162
- serializer
163
- };
164
- const listRoleAssignmentsOperationSpec = {
165
- path: "/roleAssignments",
166
- httpMethod: "GET",
167
- responses: {
168
- 200: {
169
- bodyMapper: Mappers.RoleAssignmentDetailsList,
170
- headersMapper: Mappers.RoleAssignmentsListRoleAssignmentsHeaders
171
- },
172
- default: {
173
- bodyMapper: Mappers.ErrorContract
174
- }
175
- },
176
- queryParameters: [
177
- Parameters.apiVersion,
178
- Parameters.roleId,
179
- Parameters.principalId,
180
- Parameters.scope1
181
- ],
182
- urlParameters: [Parameters.endpoint],
183
- headerParameters: [Parameters.accept, Parameters.continuationToken],
184
- serializer
185
- };
186
- const createRoleAssignmentOperationSpec = {
187
- path: "/roleAssignments/{roleAssignmentId}",
188
- httpMethod: "PUT",
189
- responses: {
190
- 200: {
191
- bodyMapper: Mappers.RoleAssignmentDetails
192
- },
193
- default: {
194
- bodyMapper: Mappers.ErrorContract
195
- }
196
- },
197
- requestBody: {
198
- parameterPath: {
199
- roleId: ["roleId"],
200
- principalId: ["principalId"],
201
- scope: ["scope"],
202
- principalType: ["options", "principalType"]
203
- },
204
- mapper: Object.assign(Object.assign({}, Mappers.RoleAssignmentRequest), { required: true })
205
- },
206
- queryParameters: [Parameters.apiVersion],
207
- urlParameters: [Parameters.endpoint, Parameters.roleAssignmentId],
208
- headerParameters: [Parameters.contentType, Parameters.accept],
209
- mediaType: "json",
210
- serializer
211
- };
212
- const getRoleAssignmentByIdOperationSpec = {
213
- path: "/roleAssignments/{roleAssignmentId}",
214
- httpMethod: "GET",
215
- responses: {
216
- 200: {
217
- bodyMapper: Mappers.RoleAssignmentDetails
218
- },
219
- default: {
220
- bodyMapper: Mappers.ErrorContract
221
- }
222
- },
223
- queryParameters: [Parameters.apiVersion],
224
- urlParameters: [Parameters.endpoint, Parameters.roleAssignmentId],
225
- headerParameters: [Parameters.accept],
226
- serializer
227
- };
228
- const deleteRoleAssignmentByIdOperationSpec = {
229
- path: "/roleAssignments/{roleAssignmentId}",
230
- httpMethod: "DELETE",
231
- responses: {
232
- 200: {},
233
- 204: {},
234
- default: {
235
- bodyMapper: Mappers.ErrorContract
236
- }
237
- },
238
- queryParameters: [Parameters.apiVersion, Parameters.scope1],
239
- urlParameters: [Parameters.endpoint, Parameters.roleAssignmentId],
240
- headerParameters: [Parameters.accept],
241
- serializer
242
- };
243
- //# sourceMappingURL=roleAssignments.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"roleAssignments.js","sourceRoot":"","sources":["../../../src/operations/roleAssignments.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,WAAW,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,OAAO,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,sBAAsB,CAAC;AAgBnD,4CAA4C;AAC5C,MAAM,OAAO,mBAAmB;IAG9B;;;OAGG;IACH,YAAY,MAAkC;QAC5C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,oBAAoB,CACxB,OAAoB,EACpB,OAAyB,EACzB,KAAa,EACb,OAA2D;QAE3D,MAAM,EAAE,IAAI,EAAE,GAAG,UAAU,CACzB,0CAA0C,EAC1C,OAAO,IAAI,EAAE,CACd,CAAC;QACF,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACnD,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EACpC,iCAAiC,CAClC,CAAC;YACF,OAAO,MAAqD,CAAC;SAC9D;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,SAAS,CAAC;gBACb,IAAI,EAAE,WAAW,CAAC,cAAc,CAAC,KAAK;gBACtC,OAAO,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,qCAAqC,GAA6B;IACtE,IAAI,EAAE,qCAAqC;IAC3C,UAAU,EAAE,QAAQ;IACpB,SAAS,EAAE;QACT,GAAG,EAAE,EAAE;QACP,GAAG,EAAE,EAAE;QACP,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC;IAC3D,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,gBAAgB,CAAC;IACjE,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { createSpan } from \"../tracing\";\nimport { RoleAssignments } from \"../operationsInterfaces\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreTracing from \"@azure/core-tracing\";\nimport * as Mappers from \"../models/mappers\";\nimport * as Parameters from \"../models/parameters\";\nimport { AccessControlClientContext } from \"../accessControlClientContext\";\nimport {\n SubjectInfo,\n RequiredAction,\n RoleAssignmentsCheckPrincipalAccessOptionalParams,\n RoleAssignmentsCheckPrincipalAccessResponse,\n RoleAssignmentsListRoleAssignmentsOptionalParams,\n RoleAssignmentsListRoleAssignmentsResponse,\n RoleAssignmentsCreateRoleAssignmentOptionalParams,\n RoleAssignmentsCreateRoleAssignmentResponse,\n RoleAssignmentsGetRoleAssignmentByIdOptionalParams,\n RoleAssignmentsGetRoleAssignmentByIdResponse,\n RoleAssignmentsDeleteRoleAssignmentByIdOptionalParams\n} from \"../models\";\n\n/** Class representing a RoleAssignments. */\nexport class RoleAssignmentsImpl implements RoleAssignments {\n private readonly client: AccessControlClientContext;\n\n /**\n * Initialize a new instance of the class RoleAssignments class.\n * @param client Reference to the service client\n */\n constructor(client: AccessControlClientContext) {\n this.client = client;\n }\n\n /**\n * Check if the given principalId has access to perform list of actions at a given scope.\n * @param subject Subject details\n * @param actions List of actions.\n * @param scope Scope at which the check access is done.\n * @param options The options parameters.\n */\n async checkPrincipalAccess(\n subject: SubjectInfo,\n actions: RequiredAction[],\n scope: string,\n options?: RoleAssignmentsCheckPrincipalAccessOptionalParams\n ): Promise<RoleAssignmentsCheckPrincipalAccessResponse> {\n const { span } = createSpan(\n \"AccessControlClient-checkPrincipalAccess\",\n options || {}\n );\n try {\n const result = await this.client.sendOperationRequest(\n { subject, actions, scope, options },\n checkPrincipalAccessOperationSpec\n );\n return result as RoleAssignmentsCheckPrincipalAccessResponse;\n } catch (error) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.UNSET,\n message: error.message\n });\n throw error;\n } finally {\n span.end();\n }\n }\n\n /**\n * List role assignments.\n * @param options The options parameters.\n */\n async listRoleAssignments(\n options?: RoleAssignmentsListRoleAssignmentsOptionalParams\n ): Promise<RoleAssignmentsListRoleAssignmentsResponse> {\n const { span } = createSpan(\n \"AccessControlClient-listRoleAssignments\",\n options || {}\n );\n try {\n const result = await this.client.sendOperationRequest(\n { options },\n listRoleAssignmentsOperationSpec\n );\n return result as RoleAssignmentsListRoleAssignmentsResponse;\n } catch (error) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.UNSET,\n message: error.message\n });\n throw error;\n } finally {\n span.end();\n }\n }\n\n /**\n * Create role assignment.\n * @param roleAssignmentId The ID of the role assignment.\n * @param roleId Role ID of the Synapse Built-In Role\n * @param principalId Object ID of the AAD principal or security-group\n * @param scope Scope at which the role assignment is created\n * @param options The options parameters.\n */\n async createRoleAssignment(\n roleAssignmentId: string,\n roleId: string,\n principalId: string,\n scope: string,\n options?: RoleAssignmentsCreateRoleAssignmentOptionalParams\n ): Promise<RoleAssignmentsCreateRoleAssignmentResponse> {\n const { span } = createSpan(\n \"AccessControlClient-createRoleAssignment\",\n options || {}\n );\n try {\n const result = await this.client.sendOperationRequest(\n { roleAssignmentId, roleId, principalId, scope, options },\n createRoleAssignmentOperationSpec\n );\n return result as RoleAssignmentsCreateRoleAssignmentResponse;\n } catch (error) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.UNSET,\n message: error.message\n });\n throw error;\n } finally {\n span.end();\n }\n }\n\n /**\n * Get role assignment by role assignment Id.\n * @param roleAssignmentId The ID of the role assignment.\n * @param options The options parameters.\n */\n async getRoleAssignmentById(\n roleAssignmentId: string,\n options?: RoleAssignmentsGetRoleAssignmentByIdOptionalParams\n ): Promise<RoleAssignmentsGetRoleAssignmentByIdResponse> {\n const { span } = createSpan(\n \"AccessControlClient-getRoleAssignmentById\",\n options || {}\n );\n try {\n const result = await this.client.sendOperationRequest(\n { roleAssignmentId, options },\n getRoleAssignmentByIdOperationSpec\n );\n return result as RoleAssignmentsGetRoleAssignmentByIdResponse;\n } catch (error) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.UNSET,\n message: error.message\n });\n throw error;\n } finally {\n span.end();\n }\n }\n\n /**\n * Delete role assignment by role assignment Id.\n * @param roleAssignmentId The ID of the role assignment.\n * @param options The options parameters.\n */\n async deleteRoleAssignmentById(\n roleAssignmentId: string,\n options?: RoleAssignmentsDeleteRoleAssignmentByIdOptionalParams\n ): Promise<void> {\n const { span } = createSpan(\n \"AccessControlClient-deleteRoleAssignmentById\",\n options || {}\n );\n try {\n const result = await this.client.sendOperationRequest(\n { roleAssignmentId, options },\n deleteRoleAssignmentByIdOperationSpec\n );\n return result as void;\n } catch (error) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.UNSET,\n message: error.message\n });\n throw error;\n } finally {\n span.end();\n }\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst checkPrincipalAccessOperationSpec: coreClient.OperationSpec = {\n path: \"/checkAccessSynapseRbac\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.CheckPrincipalAccessResponse\n },\n default: {\n bodyMapper: Mappers.ErrorContract\n }\n },\n requestBody: {\n parameterPath: {\n subject: [\"subject\"],\n actions: [\"actions\"],\n scope: [\"scope\"]\n },\n mapper: { ...Mappers.CheckPrincipalAccessRequest, required: true }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst listRoleAssignmentsOperationSpec: coreClient.OperationSpec = {\n path: \"/roleAssignments\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.RoleAssignmentDetailsList,\n headersMapper: Mappers.RoleAssignmentsListRoleAssignmentsHeaders\n },\n default: {\n bodyMapper: Mappers.ErrorContract\n }\n },\n queryParameters: [\n Parameters.apiVersion,\n Parameters.roleId,\n Parameters.principalId,\n Parameters.scope1\n ],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept, Parameters.continuationToken],\n serializer\n};\nconst createRoleAssignmentOperationSpec: coreClient.OperationSpec = {\n path: \"/roleAssignments/{roleAssignmentId}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n bodyMapper: Mappers.RoleAssignmentDetails\n },\n default: {\n bodyMapper: Mappers.ErrorContract\n }\n },\n requestBody: {\n parameterPath: {\n roleId: [\"roleId\"],\n principalId: [\"principalId\"],\n scope: [\"scope\"],\n principalType: [\"options\", \"principalType\"]\n },\n mapper: { ...Mappers.RoleAssignmentRequest, required: true }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.roleAssignmentId],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst getRoleAssignmentByIdOperationSpec: coreClient.OperationSpec = {\n path: \"/roleAssignments/{roleAssignmentId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.RoleAssignmentDetails\n },\n default: {\n bodyMapper: Mappers.ErrorContract\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.roleAssignmentId],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst deleteRoleAssignmentByIdOperationSpec: coreClient.OperationSpec = {\n path: \"/roleAssignments/{roleAssignmentId}\",\n httpMethod: \"DELETE\",\n responses: {\n 200: {},\n 204: {},\n default: {\n bodyMapper: Mappers.ErrorContract\n }\n },\n queryParameters: [Parameters.apiVersion, Parameters.scope1],\n urlParameters: [Parameters.endpoint, Parameters.roleAssignmentId],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
@@ -1,150 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- */
8
- import { createSpan } from "../tracing";
9
- import * as coreClient from "@azure/core-client";
10
- import * as coreTracing from "@azure/core-tracing";
11
- import * as Mappers from "../models/mappers";
12
- import * as Parameters from "../models/parameters";
13
- /** Class representing a RoleDefinitions. */
14
- export class RoleDefinitionsImpl {
15
- /**
16
- * Initialize a new instance of the class RoleDefinitions class.
17
- * @param client Reference to the service client
18
- */
19
- constructor(client) {
20
- this.client = client;
21
- }
22
- /**
23
- * List role definitions.
24
- * @param options The options parameters.
25
- */
26
- async listRoleDefinitions(options) {
27
- const { span } = createSpan("AccessControlClient-listRoleDefinitions", options || {});
28
- try {
29
- const result = await this.client.sendOperationRequest({ options }, listRoleDefinitionsOperationSpec);
30
- return result;
31
- }
32
- catch (error) {
33
- span.setStatus({
34
- code: coreTracing.SpanStatusCode.UNSET,
35
- message: error.message
36
- });
37
- throw error;
38
- }
39
- finally {
40
- span.end();
41
- }
42
- }
43
- /**
44
- * Get role definition by role definition Id.
45
- * @param roleDefinitionId Synapse Built-In Role Definition Id.
46
- * @param options The options parameters.
47
- */
48
- async getRoleDefinitionById(roleDefinitionId, options) {
49
- const { span } = createSpan("AccessControlClient-getRoleDefinitionById", options || {});
50
- try {
51
- const result = await this.client.sendOperationRequest({ roleDefinitionId, options }, getRoleDefinitionByIdOperationSpec);
52
- return result;
53
- }
54
- catch (error) {
55
- span.setStatus({
56
- code: coreTracing.SpanStatusCode.UNSET,
57
- message: error.message
58
- });
59
- throw error;
60
- }
61
- finally {
62
- span.end();
63
- }
64
- }
65
- /**
66
- * List rbac scopes.
67
- * @param options The options parameters.
68
- */
69
- async listScopes(options) {
70
- const { span } = createSpan("AccessControlClient-listScopes", options || {});
71
- try {
72
- const result = await this.client.sendOperationRequest({ options }, listScopesOperationSpec);
73
- return result;
74
- }
75
- catch (error) {
76
- span.setStatus({
77
- code: coreTracing.SpanStatusCode.UNSET,
78
- message: error.message
79
- });
80
- throw error;
81
- }
82
- finally {
83
- span.end();
84
- }
85
- }
86
- }
87
- // Operation Specifications
88
- const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
89
- const listRoleDefinitionsOperationSpec = {
90
- path: "/roleDefinitions",
91
- httpMethod: "GET",
92
- responses: {
93
- 200: {
94
- bodyMapper: {
95
- type: {
96
- name: "Sequence",
97
- element: {
98
- type: { name: "Composite", className: "SynapseRoleDefinition" }
99
- }
100
- }
101
- }
102
- },
103
- default: {
104
- bodyMapper: Mappers.ErrorContract
105
- }
106
- },
107
- queryParameters: [
108
- Parameters.apiVersion,
109
- Parameters.scope1,
110
- Parameters.isBuiltIn
111
- ],
112
- urlParameters: [Parameters.endpoint],
113
- headerParameters: [Parameters.accept],
114
- serializer
115
- };
116
- const getRoleDefinitionByIdOperationSpec = {
117
- path: "/roleDefinitions/{roleDefinitionId}",
118
- httpMethod: "GET",
119
- responses: {
120
- 200: {
121
- bodyMapper: Mappers.SynapseRoleDefinition
122
- },
123
- default: {
124
- bodyMapper: Mappers.ErrorContract
125
- }
126
- },
127
- queryParameters: [Parameters.apiVersion],
128
- urlParameters: [Parameters.endpoint, Parameters.roleDefinitionId],
129
- headerParameters: [Parameters.accept],
130
- serializer
131
- };
132
- const listScopesOperationSpec = {
133
- path: "/rbacScopes",
134
- httpMethod: "GET",
135
- responses: {
136
- 200: {
137
- bodyMapper: {
138
- type: { name: "Sequence", element: { type: { name: "String" } } }
139
- }
140
- },
141
- default: {
142
- bodyMapper: Mappers.ErrorContract
143
- }
144
- },
145
- queryParameters: [Parameters.apiVersion],
146
- urlParameters: [Parameters.endpoint],
147
- headerParameters: [Parameters.accept],
148
- serializer
149
- };
150
- //# sourceMappingURL=roleDefinitions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"roleDefinitions.js","sourceRoot":"","sources":["../../../src/operations/roleDefinitions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,WAAW,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,OAAO,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,sBAAsB,CAAC;AAWnD,4CAA4C;AAC5C,MAAM,OAAO,mBAAmB;IAG9B;;;OAGG;IACH,YAAY,MAAkC;QAC5C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,mBAAmB,CACvB,OAA0D;QAE1D,MAAM,EAAE,IAAI,EAAE,GAAG,UAAU,CACzB,yCAAyC,EACzC,OAAO,IAAI,EAAE,CACd,CAAC;QACF,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACnD,EAAE,OAAO,EAAE,EACX,gCAAgC,CACjC,CAAC;YACF,OAAO,MAAoD,CAAC;SAC7D;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,SAAS,CAAC;gBACb,IAAI,EAAE,WAAW,CAAC,cAAc,CAAC,KAAK;gBACtC,OAAO,EAAE,KAAK,CAAC,OAAO;aACvB,CAAC,CAAC;YACH,MAAM,KAAK,CAAC;SACb;gBAAS;YACR,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IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;aAClE;SACF;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;IACpC,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { createSpan } from \"../tracing\";\nimport { RoleDefinitions } from \"../operationsInterfaces\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreTracing from \"@azure/core-tracing\";\nimport * as Mappers from \"../models/mappers\";\nimport * as Parameters from \"../models/parameters\";\nimport { AccessControlClientContext } from \"../accessControlClientContext\";\nimport {\n RoleDefinitionsListRoleDefinitionsOptionalParams,\n RoleDefinitionsListRoleDefinitionsResponse,\n RoleDefinitionsGetRoleDefinitionByIdOptionalParams,\n RoleDefinitionsGetRoleDefinitionByIdResponse,\n RoleDefinitionsListScopesOptionalParams,\n RoleDefinitionsListScopesResponse\n} from \"../models\";\n\n/** Class representing a RoleDefinitions. */\nexport class RoleDefinitionsImpl implements RoleDefinitions {\n private readonly client: AccessControlClientContext;\n\n /**\n * Initialize a new instance of the class RoleDefinitions class.\n * @param client Reference to the service client\n */\n constructor(client: AccessControlClientContext) {\n this.client = client;\n }\n\n /**\n * List role definitions.\n * @param options The options parameters.\n */\n async listRoleDefinitions(\n options?: RoleDefinitionsListRoleDefinitionsOptionalParams\n ): Promise<RoleDefinitionsListRoleDefinitionsResponse> {\n const { span } = createSpan(\n \"AccessControlClient-listRoleDefinitions\",\n options || {}\n );\n try {\n const result = await this.client.sendOperationRequest(\n { options },\n listRoleDefinitionsOperationSpec\n );\n return result as RoleDefinitionsListRoleDefinitionsResponse;\n } catch (error) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.UNSET,\n message: error.message\n });\n throw error;\n } finally {\n span.end();\n }\n }\n\n /**\n * Get role definition by role definition Id.\n * @param roleDefinitionId Synapse Built-In Role Definition Id.\n * @param options The options parameters.\n */\n async getRoleDefinitionById(\n roleDefinitionId: string,\n options?: RoleDefinitionsGetRoleDefinitionByIdOptionalParams\n ): Promise<RoleDefinitionsGetRoleDefinitionByIdResponse> {\n const { span } = createSpan(\n \"AccessControlClient-getRoleDefinitionById\",\n options || {}\n );\n try {\n const result = await this.client.sendOperationRequest(\n { roleDefinitionId, options },\n getRoleDefinitionByIdOperationSpec\n );\n return result as RoleDefinitionsGetRoleDefinitionByIdResponse;\n } catch (error) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.UNSET,\n message: error.message\n });\n throw error;\n } finally {\n span.end();\n }\n }\n\n /**\n * List rbac scopes.\n * @param options The options parameters.\n */\n async listScopes(\n options?: RoleDefinitionsListScopesOptionalParams\n ): Promise<RoleDefinitionsListScopesResponse> {\n const { span } = createSpan(\n \"AccessControlClient-listScopes\",\n options || {}\n );\n try {\n const result = await this.client.sendOperationRequest(\n { options },\n listScopesOperationSpec\n );\n return result as RoleDefinitionsListScopesResponse;\n } catch (error) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.UNSET,\n message: error.message\n });\n throw error;\n } finally {\n span.end();\n }\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listRoleDefinitionsOperationSpec: coreClient.OperationSpec = {\n path: \"/roleDefinitions\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: {\n type: { name: \"Composite\", className: \"SynapseRoleDefinition\" }\n }\n }\n }\n },\n default: {\n bodyMapper: Mappers.ErrorContract\n }\n },\n queryParameters: [\n Parameters.apiVersion,\n Parameters.scope1,\n Parameters.isBuiltIn\n ],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getRoleDefinitionByIdOperationSpec: coreClient.OperationSpec = {\n path: \"/roleDefinitions/{roleDefinitionId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SynapseRoleDefinition\n },\n default: {\n bodyMapper: Mappers.ErrorContract\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.roleDefinitionId],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst listScopesOperationSpec: coreClient.OperationSpec = {\n path: \"/rbacScopes\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: {\n type: { name: \"Sequence\", element: { type: { name: \"String\" } } }\n }\n },\n default: {\n bodyMapper: Mappers.ErrorContract\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"roleAssignments.js","sourceRoot":"","sources":["../../../src/operationsInterfaces/roleAssignments.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport {\n SubjectInfo,\n RequiredAction,\n RoleAssignmentsCheckPrincipalAccessOptionalParams,\n RoleAssignmentsCheckPrincipalAccessResponse,\n RoleAssignmentsListRoleAssignmentsOptionalParams,\n RoleAssignmentsListRoleAssignmentsResponse,\n RoleAssignmentsCreateRoleAssignmentOptionalParams,\n RoleAssignmentsCreateRoleAssignmentResponse,\n RoleAssignmentsGetRoleAssignmentByIdOptionalParams,\n RoleAssignmentsGetRoleAssignmentByIdResponse,\n RoleAssignmentsDeleteRoleAssignmentByIdOptionalParams\n} from \"../models\";\n\n/** Interface representing a RoleAssignments. */\nexport interface RoleAssignments {\n /**\n * Check if the given principalId has access to perform list of actions at a given scope.\n * @param subject Subject details\n * @param actions List of actions.\n * @param scope Scope at which the check access is done.\n * @param options The options parameters.\n */\n checkPrincipalAccess(\n subject: SubjectInfo,\n actions: RequiredAction[],\n scope: string,\n options?: RoleAssignmentsCheckPrincipalAccessOptionalParams\n ): Promise<RoleAssignmentsCheckPrincipalAccessResponse>;\n /**\n * List role assignments.\n * @param options The options parameters.\n */\n listRoleAssignments(\n options?: RoleAssignmentsListRoleAssignmentsOptionalParams\n ): Promise<RoleAssignmentsListRoleAssignmentsResponse>;\n /**\n * Create role assignment.\n * @param roleAssignmentId The ID of the role assignment.\n * @param roleId Role ID of the Synapse Built-In Role\n * @param principalId Object ID of the AAD principal or security-group\n * @param scope Scope at which the role assignment is created\n * @param options The options parameters.\n */\n createRoleAssignment(\n roleAssignmentId: string,\n roleId: string,\n principalId: string,\n scope: string,\n options?: RoleAssignmentsCreateRoleAssignmentOptionalParams\n ): Promise<RoleAssignmentsCreateRoleAssignmentResponse>;\n /**\n * Get role assignment by role assignment Id.\n * @param roleAssignmentId The ID of the role assignment.\n * @param options The options parameters.\n */\n getRoleAssignmentById(\n roleAssignmentId: string,\n options?: RoleAssignmentsGetRoleAssignmentByIdOptionalParams\n ): Promise<RoleAssignmentsGetRoleAssignmentByIdResponse>;\n /**\n * Delete role assignment by role assignment Id.\n * @param roleAssignmentId The ID of the role assignment.\n * @param options The options parameters.\n */\n deleteRoleAssignmentById(\n roleAssignmentId: string,\n options?: RoleAssignmentsDeleteRoleAssignmentByIdOptionalParams\n ): Promise<void>;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"roleDefinitions.js","sourceRoot":"","sources":["../../../src/operationsInterfaces/roleDefinitions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport {\n RoleDefinitionsListRoleDefinitionsOptionalParams,\n RoleDefinitionsListRoleDefinitionsResponse,\n RoleDefinitionsGetRoleDefinitionByIdOptionalParams,\n RoleDefinitionsGetRoleDefinitionByIdResponse,\n RoleDefinitionsListScopesOptionalParams,\n RoleDefinitionsListScopesResponse\n} from \"../models\";\n\n/** Interface representing a RoleDefinitions. */\nexport interface RoleDefinitions {\n /**\n * List role definitions.\n * @param options The options parameters.\n */\n listRoleDefinitions(\n options?: RoleDefinitionsListRoleDefinitionsOptionalParams\n ): Promise<RoleDefinitionsListRoleDefinitionsResponse>;\n /**\n * Get role definition by role definition Id.\n * @param roleDefinitionId Synapse Built-In Role Definition Id.\n * @param options The options parameters.\n */\n getRoleDefinitionById(\n roleDefinitionId: string,\n options?: RoleDefinitionsGetRoleDefinitionByIdOptionalParams\n ): Promise<RoleDefinitionsGetRoleDefinitionByIdResponse>;\n /**\n * List rbac scopes.\n * @param options The options parameters.\n */\n listScopes(\n options?: RoleDefinitionsListScopesOptionalParams\n ): Promise<RoleDefinitionsListScopesResponse>;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"tracing.js","sourceRoot":"","sources":["../../src/tracing.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,CAAC;IAC3C,SAAS,EAAE,6BAA6B;IACxC,aAAa,EAAE,mBAAmB;CACnC,CAAC,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { createSpanFunction } from \"@azure/core-tracing\";\n\nexport const createSpan = createSpanFunction({\n namespace: \"Azure.Synapse.AccessControl\",\n packagePrefix: \"Microsoft.Synapse\"\n});\n"]}
@@ -1,18 +0,0 @@
1
- import { assert } from "chai";
2
- import { createClient, createRecorder } from "./utils/recordedClient";
3
- describe("Access Control smoke", () => {
4
- let recorder;
5
- let client;
6
- beforeEach(function () {
7
- recorder = createRecorder(this);
8
- client = createClient();
9
- });
10
- afterEach(async () => {
11
- await recorder.stop();
12
- });
13
- it("should list roles", async () => {
14
- const result = await client.roleDefinitions.listRoleDefinitions();
15
- assert.isTrue(result.length > 0);
16
- });
17
- });
18
- //# sourceMappingURL=test.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test.spec.js","sourceRoot":"","sources":["../../../test/public/test.spec.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEtE,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,IAAI,QAAkB,CAAC;IACvB,IAAI,MAA2B,CAAC;IAEhC,UAAU,CAAC;QACT,QAAQ,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;QAChC,MAAM,GAAG,YAAY,EAAE,CAAC;IAC1B,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IACxB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mBAAmB,EAAE,KAAK,IAAI,EAAE;QACjC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,eAAe,CAAC,mBAAmB,EAAE,CAAC;QAClE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { AccessControlClient } from \"../../src/accessControlClient\";\nimport { Recorder } from \"@azure/test-utils-recorder\";\nimport { assert } from \"chai\";\nimport { createClient, createRecorder } from \"./utils/recordedClient\";\n\ndescribe(\"Access Control smoke\", () => {\n let recorder: Recorder;\n let client: AccessControlClient;\n\n beforeEach(function() {\n recorder = createRecorder(this);\n client = createClient();\n });\n\n afterEach(async () => {\n await recorder.stop();\n });\n\n it(\"should list roles\", async () => {\n const result = await client.roleDefinitions.listRoleDefinitions();\n assert.isTrue(result.length > 0);\n });\n});\n"]}
@@ -1,4 +0,0 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation.
3
- // Licensed under the MIT license.
4
- //# sourceMappingURL=env.browser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"env.browser.js","sourceRoot":"","sources":["../../../../test/public/utils/env.browser.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n"]}
@@ -1,5 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import * as dotenv from "dotenv";
4
- dotenv.config();
5
- //# sourceMappingURL=env.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"env.js","sourceRoot":"","sources":["../../../../test/public/utils/env.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,MAAM,CAAC,MAAM,EAAE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport * as dotenv from \"dotenv\";\n\ndotenv.config();\n"]}
@@ -1,41 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import { env, record } from "@azure/test-utils-recorder";
4
- import { ClientSecretCredential } from "@azure/identity";
5
- import { AccessControlClient } from "../../../src";
6
- import "./env";
7
- const replaceableVariables = {
8
- AZURE_CLIENT_ID: "azure_client_id",
9
- AZURE_CLIENT_SECRET: "azure_client_secret",
10
- AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888",
11
- ENDPOINT: "https://testaccount.dev.azuresynapse.net"
12
- };
13
- export const environmentSetup = {
14
- replaceableVariables,
15
- customizationsOnRecordings: [
16
- (recording) => recording.replace(/"access_token"\s?:\s?"[^"]*"/g, `"access_token":"access_token"`),
17
- // If we put ENDPOINT in replaceableVariables above, it will not capture
18
- // the endpoint string used with nock, which will be expanded to
19
- // https://<endpoint>:443/ and therefore will not match, so we have to do
20
- // this instead.
21
- (recording) => {
22
- const replaced = recording.replace("testaccount.dev.azuresynapse.net:443", "testaccount.dev.azuresynapse.net");
23
- return replaced;
24
- }
25
- ],
26
- queryParametersToSkip: []
27
- };
28
- export function createClient(options) {
29
- let credential;
30
- credential = new ClientSecretCredential(env.AZURE_TENANT_ID, env.AZURE_CLIENT_ID, env.AZURE_CLIENT_SECRET);
31
- return new AccessControlClient(credential, env.ENDPOINT, options);
32
- }
33
- /**
34
- * creates the recorder and reads the environment variables from the `.env` file.
35
- * Should be called first in the test suite to make sure environment variables are
36
- * read before they are being used.
37
- */
38
- export function createRecorder(context) {
39
- return record(context, environmentSetup);
40
- }
41
- //# sourceMappingURL=recordedClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recordedClient.js","sourceRoot":"","sources":["../../../../test/public/utils/recordedClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,GAAG,EAAY,MAAM,EAA4B,MAAM,4BAA4B,CAAC;AAC7F,OAAO,EAAmB,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAE1E,OAAO,EAAE,mBAAmB,EAAqC,MAAM,cAAc,CAAC;AACtF,OAAO,OAAO,CAAC;AAEf,MAAM,oBAAoB,GAA4B;IACpD,eAAe,EAAE,iBAAiB;IAClC,mBAAmB,EAAE,qBAAqB;IAC1C,eAAe,EAAE,sCAAsC;IACvD,QAAQ,EAAE,0CAA0C;CACrD,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAA6B;IACxD,oBAAoB;IACpB,0BAA0B,EAAE;QAC1B,CAAC,SAAiB,EAAU,EAAE,CAC5B,SAAS,CAAC,OAAO,CAAC,+BAA+B,EAAE,+BAA+B,CAAC;QACrF,wEAAwE;QACxE,gEAAgE;QAChE,yEAAyE;QACzE,gBAAgB;QAChB,CAAC,SAAiB,EAAU,EAAE;YAC5B,MAAM,QAAQ,GAAG,SAAS,CAAC,OAAO,CAChC,sCAAsC,EACtC,kCAAkC,CACnC,CAAC;YACF,OAAO,QAAQ,CAAC;QAClB,CAAC;KACF;IACD,qBAAqB,EAAE,EAAE;CAC1B,CAAC;AAEF,MAAM,UAAU,YAAY,CAAC,OAA2C;IACtE,IAAI,UAA2B,CAAC;IAEhC,UAAU,GAAG,IAAI,sBAAsB,CACrC,GAAG,CAAC,eAAe,EACnB,GAAG,CAAC,eAAe,EACnB,GAAG,CAAC,mBAAmB,CACxB,CAAC;IAEF,OAAO,IAAI,mBAAmB,CAAC,UAAU,EAAE,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACpE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,OAAgB;IAC7C,OAAO,MAAM,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { Context } from \"mocha\";\n\nimport { env, Recorder, record, RecorderEnvironmentSetup } from \"@azure/test-utils-recorder\";\nimport { TokenCredential, ClientSecretCredential } from \"@azure/identity\";\n\nimport { AccessControlClient, AccessControlClientOptionalParams } from \"../../../src\";\nimport \"./env\";\n\nconst replaceableVariables: { [k: string]: string } = {\n AZURE_CLIENT_ID: \"azure_client_id\",\n AZURE_CLIENT_SECRET: \"azure_client_secret\",\n AZURE_TENANT_ID: \"88888888-8888-8888-8888-888888888888\",\n ENDPOINT: \"https://testaccount.dev.azuresynapse.net\"\n};\n\nexport const environmentSetup: RecorderEnvironmentSetup = {\n replaceableVariables,\n customizationsOnRecordings: [\n (recording: string): string =>\n recording.replace(/\"access_token\"\\s?:\\s?\"[^\"]*\"/g, `\"access_token\":\"access_token\"`),\n // If we put ENDPOINT in replaceableVariables above, it will not capture\n // the endpoint string used with nock, which will be expanded to\n // https://<endpoint>:443/ and therefore will not match, so we have to do\n // this instead.\n (recording: string): string => {\n const replaced = recording.replace(\n \"testaccount.dev.azuresynapse.net:443\",\n \"testaccount.dev.azuresynapse.net\"\n );\n return replaced;\n }\n ],\n queryParametersToSkip: []\n};\n\nexport function createClient(options?: AccessControlClientOptionalParams): AccessControlClient {\n let credential: TokenCredential;\n\n credential = new ClientSecretCredential(\n env.AZURE_TENANT_ID,\n env.AZURE_CLIENT_ID,\n env.AZURE_CLIENT_SECRET\n );\n\n return new AccessControlClient(credential, env.ENDPOINT, options);\n}\n\n/**\n * creates the recorder and reads the environment variables from the `.env` file.\n * Should be called first in the test suite to make sure environment variables are\n * read before they are being used.\n */\nexport function createRecorder(context: Context): Recorder {\n return record(context, environmentSetup);\n}\n"]}
package/rollup.config.js DELETED
@@ -1,3 +0,0 @@
1
- import { makeConfig } from "@azure/dev-tool/shared-config/rollup";
2
-
3
- export default makeConfig(require("./package.json"));
package/tsconfig.json DELETED
@@ -1,19 +0,0 @@
1
- {
2
- "extends": "../../../tsconfig.package",
3
- "compilerOptions": {
4
- "outDir": "./dist-esm",
5
- "declarationDir": "./types"
6
- },
7
- "include": [
8
- "src/**/*.ts",
9
- "test/**/*.ts"
10
- ],
11
- "exclude": [
12
- "node_modules",
13
- "types",
14
- "temp",
15
- "browser",
16
- "dist*",
17
- "./dom-shims.d.ts"
18
- ]
19
- }