@azure-rest/synapse-access-control 1.0.0-alpha.20241219.1 → 1.0.0-alpha.20241220.1

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 (117) hide show
  1. package/dist/browser/accessControlRestClient.d.ts +12 -1
  2. package/dist/browser/accessControlRestClient.d.ts.map +1 -1
  3. package/dist/browser/accessControlRestClient.js +30 -8
  4. package/dist/browser/accessControlRestClient.js.map +1 -1
  5. package/dist/browser/clientDefinitions.d.ts +9 -9
  6. package/dist/browser/clientDefinitions.js.map +1 -1
  7. package/dist/browser/isUnexpected.d.ts +9 -9
  8. package/dist/browser/isUnexpected.js +35 -28
  9. package/dist/browser/isUnexpected.js.map +1 -1
  10. package/dist/browser/logger.d.ts +2 -0
  11. package/dist/browser/logger.d.ts.map +1 -0
  12. package/dist/browser/logger.js +5 -0
  13. package/dist/browser/logger.js.map +1 -0
  14. package/dist/browser/models.d.ts +4 -0
  15. package/dist/browser/models.d.ts.map +1 -1
  16. package/dist/browser/models.js.map +1 -1
  17. package/dist/browser/outputModels.d.ts +16 -7
  18. package/dist/browser/outputModels.d.ts.map +1 -1
  19. package/dist/browser/outputModels.js.map +1 -1
  20. package/dist/browser/paginateHelper.d.ts +27 -2
  21. package/dist/browser/paginateHelper.d.ts.map +1 -1
  22. package/dist/browser/paginateHelper.js +98 -1
  23. package/dist/browser/paginateHelper.js.map +1 -1
  24. package/dist/browser/parameters.d.ts +1 -1
  25. package/dist/browser/parameters.d.ts.map +1 -1
  26. package/dist/browser/parameters.js.map +1 -1
  27. package/dist/browser/responses.d.ts +8 -10
  28. package/dist/browser/responses.d.ts.map +1 -1
  29. package/dist/browser/responses.js.map +1 -1
  30. package/dist/commonjs/accessControlRestClient.d.ts +12 -1
  31. package/dist/commonjs/accessControlRestClient.d.ts.map +1 -1
  32. package/dist/commonjs/accessControlRestClient.js +30 -8
  33. package/dist/commonjs/accessControlRestClient.js.map +1 -1
  34. package/dist/commonjs/clientDefinitions.d.ts +9 -9
  35. package/dist/commonjs/clientDefinitions.js.map +1 -1
  36. package/dist/commonjs/isUnexpected.d.ts +9 -9
  37. package/dist/commonjs/isUnexpected.js +35 -28
  38. package/dist/commonjs/isUnexpected.js.map +1 -1
  39. package/dist/commonjs/logger.d.ts +2 -0
  40. package/dist/commonjs/logger.d.ts.map +1 -0
  41. package/dist/commonjs/logger.js +8 -0
  42. package/dist/commonjs/logger.js.map +1 -0
  43. package/dist/commonjs/models.d.ts +4 -0
  44. package/dist/commonjs/models.d.ts.map +1 -1
  45. package/dist/commonjs/models.js.map +1 -1
  46. package/dist/commonjs/outputModels.d.ts +16 -7
  47. package/dist/commonjs/outputModels.d.ts.map +1 -1
  48. package/dist/commonjs/outputModels.js.map +1 -1
  49. package/dist/commonjs/paginateHelper.d.ts +27 -2
  50. package/dist/commonjs/paginateHelper.d.ts.map +1 -1
  51. package/dist/commonjs/paginateHelper.js +99 -2
  52. package/dist/commonjs/paginateHelper.js.map +1 -1
  53. package/dist/commonjs/parameters.d.ts +1 -1
  54. package/dist/commonjs/parameters.d.ts.map +1 -1
  55. package/dist/commonjs/parameters.js.map +1 -1
  56. package/dist/commonjs/responses.d.ts +8 -10
  57. package/dist/commonjs/responses.d.ts.map +1 -1
  58. package/dist/commonjs/responses.js.map +1 -1
  59. package/dist/esm/accessControlRestClient.d.ts +12 -1
  60. package/dist/esm/accessControlRestClient.d.ts.map +1 -1
  61. package/dist/esm/accessControlRestClient.js +30 -8
  62. package/dist/esm/accessControlRestClient.js.map +1 -1
  63. package/dist/esm/clientDefinitions.d.ts +9 -9
  64. package/dist/esm/clientDefinitions.js.map +1 -1
  65. package/dist/esm/isUnexpected.d.ts +9 -9
  66. package/dist/esm/isUnexpected.js +35 -28
  67. package/dist/esm/isUnexpected.js.map +1 -1
  68. package/dist/esm/logger.d.ts +2 -0
  69. package/dist/esm/logger.d.ts.map +1 -0
  70. package/dist/esm/logger.js +5 -0
  71. package/dist/esm/logger.js.map +1 -0
  72. package/dist/esm/models.d.ts +4 -0
  73. package/dist/esm/models.d.ts.map +1 -1
  74. package/dist/esm/models.js.map +1 -1
  75. package/dist/esm/outputModels.d.ts +16 -7
  76. package/dist/esm/outputModels.d.ts.map +1 -1
  77. package/dist/esm/outputModels.js.map +1 -1
  78. package/dist/esm/paginateHelper.d.ts +27 -2
  79. package/dist/esm/paginateHelper.d.ts.map +1 -1
  80. package/dist/esm/paginateHelper.js +98 -1
  81. package/dist/esm/paginateHelper.js.map +1 -1
  82. package/dist/esm/parameters.d.ts +1 -1
  83. package/dist/esm/parameters.d.ts.map +1 -1
  84. package/dist/esm/parameters.js.map +1 -1
  85. package/dist/esm/responses.d.ts +8 -10
  86. package/dist/esm/responses.d.ts.map +1 -1
  87. package/dist/esm/responses.js.map +1 -1
  88. package/dist/react-native/accessControlRestClient.d.ts +12 -1
  89. package/dist/react-native/accessControlRestClient.d.ts.map +1 -1
  90. package/dist/react-native/accessControlRestClient.js +30 -8
  91. package/dist/react-native/accessControlRestClient.js.map +1 -1
  92. package/dist/react-native/clientDefinitions.d.ts +9 -9
  93. package/dist/react-native/clientDefinitions.js.map +1 -1
  94. package/dist/react-native/isUnexpected.d.ts +9 -9
  95. package/dist/react-native/isUnexpected.js +35 -28
  96. package/dist/react-native/isUnexpected.js.map +1 -1
  97. package/dist/react-native/logger.d.ts +2 -0
  98. package/dist/react-native/logger.d.ts.map +1 -0
  99. package/dist/react-native/logger.js +5 -0
  100. package/dist/react-native/logger.js.map +1 -0
  101. package/dist/react-native/models.d.ts +4 -0
  102. package/dist/react-native/models.d.ts.map +1 -1
  103. package/dist/react-native/models.js.map +1 -1
  104. package/dist/react-native/outputModels.d.ts +16 -7
  105. package/dist/react-native/outputModels.d.ts.map +1 -1
  106. package/dist/react-native/outputModels.js.map +1 -1
  107. package/dist/react-native/paginateHelper.d.ts +27 -2
  108. package/dist/react-native/paginateHelper.d.ts.map +1 -1
  109. package/dist/react-native/paginateHelper.js +98 -1
  110. package/dist/react-native/paginateHelper.js.map +1 -1
  111. package/dist/react-native/parameters.d.ts +1 -1
  112. package/dist/react-native/parameters.d.ts.map +1 -1
  113. package/dist/react-native/parameters.js.map +1 -1
  114. package/dist/react-native/responses.d.ts +8 -10
  115. package/dist/react-native/responses.d.ts.map +1 -1
  116. package/dist/react-native/responses.js.map +1 -1
  117. package/package.json +2 -2
@@ -1,5 +1,16 @@
1
1
  import type { ClientOptions } from "@azure-rest/core-client";
2
2
  import type { TokenCredential } from "@azure/core-auth";
3
3
  import type { AccessControlRestClient } from "./clientDefinitions.js";
4
- export default function createClient(endpoint: string, credentials: TokenCredential, options?: ClientOptions): AccessControlRestClient;
4
+ /** The optional parameters for the client */
5
+ export interface AccessControlRestClientOptions extends ClientOptions {
6
+ /** The api version option of the client */
7
+ apiVersion?: string;
8
+ }
9
+ /**
10
+ * Initialize a new instance of `AccessControlRestClient`
11
+ * @param endpoint - The workspace development endpoint, for example `https://myworkspace.dev.azuresynapse.net`.
12
+ * @param credentials - uniquely identify client credential
13
+ * @param options - the parameter for all optional parameters
14
+ */
15
+ export default function createClient(endpoint: string, credentials: TokenCredential, { apiVersion, ...options }?: AccessControlRestClientOptions): AccessControlRestClient;
5
16
  //# sourceMappingURL=accessControlRestClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"accessControlRestClient.d.ts","sourceRoot":"","sources":["../../src/accessControlRestClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,eAAe,EAC5B,OAAO,GAAE,aAAkB,GAC1B,uBAAuB,CAyBzB"}
1
+ {"version":3,"file":"accessControlRestClient.d.ts","sourceRoot":"","sources":["../../src/accessControlRestClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,6CAA6C;AAC7C,MAAM,WAAW,8BAA+B,SAAQ,aAAa;IACnE,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,eAAe,EAC5B,EAAE,UAAyB,EAAE,GAAG,OAAO,EAAE,GAAE,8BAAmC,GAC7E,uBAAuB,CAuCzB"}
@@ -1,21 +1,43 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
+ import { __rest } from "tslib";
3
4
  import { getClient } from "@azure-rest/core-client";
4
- export default function createClient(endpoint, credentials, options = {}) {
5
- var _a, _b;
6
- const baseUrl = (_a = options.baseUrl) !== null && _a !== void 0 ? _a : `${endpoint}`;
7
- options.apiVersion = (_b = options.apiVersion) !== null && _b !== void 0 ? _b : "2020-12-01";
8
- options = Object.assign(Object.assign({}, options), { credentials: {
9
- scopes: ["https://dev.azuresynapse.net/.default"],
10
- } });
5
+ import { logger } from "./logger.js";
6
+ /**
7
+ * Initialize a new instance of `AccessControlRestClient`
8
+ * @param endpoint - The workspace development endpoint, for example `https://myworkspace.dev.azuresynapse.net`.
9
+ * @param credentials - uniquely identify client credential
10
+ * @param options - the parameter for all optional parameters
11
+ */
12
+ export default function createClient(endpoint, credentials, _a = {}) {
13
+ var _b, _c, _d, _e, _f, _g;
14
+ var { apiVersion = "2020-12-01" } = _a, options = __rest(_a, ["apiVersion"]);
15
+ const endpointUrl = (_c = (_b = options.endpoint) !== null && _b !== void 0 ? _b : options.baseUrl) !== null && _c !== void 0 ? _c : `${endpoint}`;
11
16
  const userAgentInfo = `azsdk-js-synapse-access-control-rest/1.0.0-beta.1`;
12
17
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
13
18
  ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
14
19
  : `${userAgentInfo}`;
15
20
  options = Object.assign(Object.assign({}, options), { userAgentOptions: {
16
21
  userAgentPrefix,
22
+ }, loggingOptions: {
23
+ logger: (_e = (_d = options.loggingOptions) === null || _d === void 0 ? void 0 : _d.logger) !== null && _e !== void 0 ? _e : logger.info,
24
+ }, credentials: {
25
+ scopes: (_g = (_f = options.credentials) === null || _f === void 0 ? void 0 : _f.scopes) !== null && _g !== void 0 ? _g : ["https://dev.azuresynapse.net/.default"],
17
26
  } });
18
- const client = getClient(baseUrl, credentials, options);
27
+ const client = getClient(endpointUrl, credentials, options);
28
+ client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
29
+ client.pipeline.addPolicy({
30
+ name: "ClientApiVersionPolicy",
31
+ sendRequest: (req, next) => {
32
+ // Use the apiVersion defined in request url directly
33
+ // Append one if there is no apiVersion and we have one at client options
34
+ const url = new URL(req.url);
35
+ if (!url.searchParams.get("api-version") && apiVersion) {
36
+ req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${apiVersion}`;
37
+ }
38
+ return next(req);
39
+ },
40
+ });
19
41
  return client;
20
42
  }
21
43
  //# sourceMappingURL=accessControlRestClient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"accessControlRestClient.js","sourceRoot":"","sources":["../../src/accessControlRestClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAIpD,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,QAAgB,EAChB,WAA4B,EAC5B,UAAyB,EAAE;;IAE3B,MAAM,OAAO,GAAG,MAAA,OAAO,CAAC,OAAO,mCAAI,GAAG,QAAQ,EAAE,CAAC;IACjD,OAAO,CAAC,UAAU,GAAG,MAAA,OAAO,CAAC,UAAU,mCAAI,YAAY,CAAC;IACxD,OAAO,mCACF,OAAO,KACV,WAAW,EAAE;YACX,MAAM,EAAE,CAAC,uCAAuC,CAAC;SAClD,GACF,CAAC;IAEF,MAAM,aAAa,GAAG,mDAAmD,CAAC;IAC1E,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;QAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,aAAa,EAAE;QAChE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC;IACzB,OAAO,mCACF,OAAO,KACV,gBAAgB,EAAE;YAChB,eAAe;SAChB,GACF,CAAC;IAEF,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAA4B,CAAC;IAEnF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { AccessControlRestClient } from \"./clientDefinitions.js\";\n\nexport default function createClient(\n endpoint: string,\n credentials: TokenCredential,\n options: ClientOptions = {},\n): AccessControlRestClient {\n const baseUrl = options.baseUrl ?? `${endpoint}`;\n options.apiVersion = options.apiVersion ?? \"2020-12-01\";\n options = {\n ...options,\n credentials: {\n scopes: [\"https://dev.azuresynapse.net/.default\"],\n },\n };\n\n const userAgentInfo = `azsdk-js-synapse-access-control-rest/1.0.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n };\n\n const client = getClient(baseUrl, credentials, options) as AccessControlRestClient;\n\n return client;\n}\n"]}
1
+ {"version":3,"file":"accessControlRestClient.js","sourceRoot":"","sources":["../../src/accessControlRestClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUrC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,QAAgB,EAChB,WAA4B,EAC5B,KAA4E,EAAE;;QAA9E,EAAE,UAAU,GAAG,YAAY,OAAmD,EAA9C,OAAO,cAAvC,cAAyC,CAAF;IAEvC,MAAM,WAAW,GAAG,MAAA,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC,OAAO,mCAAI,GAAG,QAAQ,EAAE,CAAC;IACzE,MAAM,aAAa,GAAG,mDAAmD,CAAC;IAC1E,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;QAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,aAAa,EAAE;QAChE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC;IACzB,OAAO,mCACF,OAAO,KACV,gBAAgB,EAAE;YAChB,eAAe;SAChB,EACD,cAAc,EAAE;YACd,MAAM,EAAE,MAAA,MAAA,OAAO,CAAC,cAAc,0CAAE,MAAM,mCAAI,MAAM,CAAC,IAAI;SACtD,EACD,WAAW,EAAE;YACX,MAAM,EAAE,MAAA,MAAA,OAAO,CAAC,WAAW,0CAAE,MAAM,mCAAI,CAAC,uCAAuC,CAAC;SACjF,GACF,CAAC;IACF,MAAM,MAAM,GAAG,SAAS,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,CAA4B,CAAC;IAEvF,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAC3D,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;QACxB,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACzB,qDAAqD;YACrD,yEAAyE;YACzE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,UAAU,EAAE,CAAC;gBACvD,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { AccessControlRestClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface AccessControlRestClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `AccessControlRestClient`\n * @param endpoint - The workspace development endpoint, for example `https://myworkspace.dev.azuresynapse.net`.\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpoint: string,\n credentials: TokenCredential,\n { apiVersion = \"2020-12-01\", ...options }: AccessControlRestClientOptions = {},\n): AccessControlRestClient {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpoint}`;\n const userAgentInfo = `azsdk-js-synapse-access-control-rest/1.0.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://dev.azuresynapse.net/.default\"],\n },\n };\n const client = getClient(endpointUrl, credentials, options) as AccessControlRestClient;\n\n client.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n client.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\") && apiVersion) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n\n return client;\n}\n"]}
@@ -1,33 +1,33 @@
1
1
  import type { RoleAssignmentsCheckPrincipalAccessParameters, RoleAssignmentsListRoleAssignmentsParameters, RoleAssignmentsCreateRoleAssignmentParameters, RoleAssignmentsGetRoleAssignmentByIdParameters, RoleAssignmentsDeleteRoleAssignmentByIdParameters, RoleDefinitionsListRoleDefinitionsParameters, RoleDefinitionsGetRoleDefinitionByIdParameters, RoleDefinitionsListScopesParameters } from "./parameters.js";
2
- import type { RoleAssignmentsCheckPrincipalAccess200Response, RoleAssignmentsCheckPrincipalAccessdefaultResponse, RoleAssignmentsListRoleAssignments200Response, RoleAssignmentsListRoleAssignmentsdefaultResponse, RoleAssignmentsCreateRoleAssignment200Response, RoleAssignmentsCreateRoleAssignmentdefaultResponse, RoleAssignmentsGetRoleAssignmentById200Response, RoleAssignmentsGetRoleAssignmentByIddefaultResponse, RoleAssignmentsDeleteRoleAssignmentById200Response, RoleAssignmentsDeleteRoleAssignmentById204Response, RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse, RoleDefinitionsListRoleDefinitions200Response, RoleDefinitionsListRoleDefinitionsdefaultResponse, RoleDefinitionsGetRoleDefinitionById200Response, RoleDefinitionsGetRoleDefinitionByIddefaultResponse, RoleDefinitionsListScopes200Response, RoleDefinitionsListScopesdefaultResponse } from "./responses.js";
2
+ import type { RoleAssignmentsCheckPrincipalAccess200Response, RoleAssignmentsCheckPrincipalAccessDefaultResponse, RoleAssignmentsListRoleAssignments200Response, RoleAssignmentsListRoleAssignmentsDefaultResponse, RoleAssignmentsCreateRoleAssignment200Response, RoleAssignmentsCreateRoleAssignmentDefaultResponse, RoleAssignmentsGetRoleAssignmentById200Response, RoleAssignmentsGetRoleAssignmentByIdDefaultResponse, RoleAssignmentsDeleteRoleAssignmentById200Response, RoleAssignmentsDeleteRoleAssignmentById204Response, RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse, RoleDefinitionsListRoleDefinitions200Response, RoleDefinitionsListRoleDefinitionsDefaultResponse, RoleDefinitionsGetRoleDefinitionById200Response, RoleDefinitionsGetRoleDefinitionByIdDefaultResponse, RoleDefinitionsListScopes200Response, RoleDefinitionsListScopesDefaultResponse } from "./responses.js";
3
3
  import type { Client, StreamableMethod } from "@azure-rest/core-client";
4
4
  export interface RoleAssignmentsCheckPrincipalAccess {
5
5
  /** Check if the given principalId has access to perform list of actions at a given scope. */
6
- post(options: RoleAssignmentsCheckPrincipalAccessParameters): StreamableMethod<RoleAssignmentsCheckPrincipalAccess200Response | RoleAssignmentsCheckPrincipalAccessdefaultResponse>;
6
+ post(options: RoleAssignmentsCheckPrincipalAccessParameters): StreamableMethod<RoleAssignmentsCheckPrincipalAccess200Response | RoleAssignmentsCheckPrincipalAccessDefaultResponse>;
7
7
  }
8
8
  export interface RoleAssignmentsListRoleAssignments {
9
9
  /** List role assignments. */
10
- get(options?: RoleAssignmentsListRoleAssignmentsParameters): StreamableMethod<RoleAssignmentsListRoleAssignments200Response | RoleAssignmentsListRoleAssignmentsdefaultResponse>;
10
+ get(options?: RoleAssignmentsListRoleAssignmentsParameters): StreamableMethod<RoleAssignmentsListRoleAssignments200Response | RoleAssignmentsListRoleAssignmentsDefaultResponse>;
11
11
  }
12
12
  export interface RoleAssignmentsCreateRoleAssignment {
13
13
  /** Create role assignment. */
14
- put(options: RoleAssignmentsCreateRoleAssignmentParameters): StreamableMethod<RoleAssignmentsCreateRoleAssignment200Response | RoleAssignmentsCreateRoleAssignmentdefaultResponse>;
14
+ put(options: RoleAssignmentsCreateRoleAssignmentParameters): StreamableMethod<RoleAssignmentsCreateRoleAssignment200Response | RoleAssignmentsCreateRoleAssignmentDefaultResponse>;
15
15
  /** Get role assignment by role assignment Id. */
16
- get(options?: RoleAssignmentsGetRoleAssignmentByIdParameters): StreamableMethod<RoleAssignmentsGetRoleAssignmentById200Response | RoleAssignmentsGetRoleAssignmentByIddefaultResponse>;
16
+ get(options?: RoleAssignmentsGetRoleAssignmentByIdParameters): StreamableMethod<RoleAssignmentsGetRoleAssignmentById200Response | RoleAssignmentsGetRoleAssignmentByIdDefaultResponse>;
17
17
  /** Delete role assignment by role assignment Id. */
18
- delete(options?: RoleAssignmentsDeleteRoleAssignmentByIdParameters): StreamableMethod<RoleAssignmentsDeleteRoleAssignmentById200Response | RoleAssignmentsDeleteRoleAssignmentById204Response | RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse>;
18
+ delete(options?: RoleAssignmentsDeleteRoleAssignmentByIdParameters): StreamableMethod<RoleAssignmentsDeleteRoleAssignmentById200Response | RoleAssignmentsDeleteRoleAssignmentById204Response | RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse>;
19
19
  }
20
20
  export interface RoleDefinitionsListRoleDefinitions {
21
21
  /** List role definitions. */
22
- get(options?: RoleDefinitionsListRoleDefinitionsParameters): StreamableMethod<RoleDefinitionsListRoleDefinitions200Response | RoleDefinitionsListRoleDefinitionsdefaultResponse>;
22
+ get(options?: RoleDefinitionsListRoleDefinitionsParameters): StreamableMethod<RoleDefinitionsListRoleDefinitions200Response | RoleDefinitionsListRoleDefinitionsDefaultResponse>;
23
23
  }
24
24
  export interface RoleDefinitionsGetRoleDefinitionById {
25
25
  /** Get role definition by role definition Id. */
26
- get(options?: RoleDefinitionsGetRoleDefinitionByIdParameters): StreamableMethod<RoleDefinitionsGetRoleDefinitionById200Response | RoleDefinitionsGetRoleDefinitionByIddefaultResponse>;
26
+ get(options?: RoleDefinitionsGetRoleDefinitionByIdParameters): StreamableMethod<RoleDefinitionsGetRoleDefinitionById200Response | RoleDefinitionsGetRoleDefinitionByIdDefaultResponse>;
27
27
  }
28
28
  export interface RoleDefinitionsListScopes {
29
29
  /** List rbac scopes. */
30
- get(options?: RoleDefinitionsListScopesParameters): StreamableMethod<RoleDefinitionsListScopes200Response | RoleDefinitionsListScopesdefaultResponse>;
30
+ get(options?: RoleDefinitionsListScopesParameters): StreamableMethod<RoleDefinitionsListScopes200Response | RoleDefinitionsListScopesDefaultResponse>;
31
31
  }
32
32
  export interface Routes {
33
33
  /** Resource for '/checkAccessSynapseRbac' has methods for the following verbs: post */
@@ -1 +1 @@
1
- {"version":3,"file":"clientDefinitions.js","sourceRoot":"","sources":["../../src/clientDefinitions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n RoleAssignmentsCheckPrincipalAccessParameters,\n RoleAssignmentsListRoleAssignmentsParameters,\n RoleAssignmentsCreateRoleAssignmentParameters,\n RoleAssignmentsGetRoleAssignmentByIdParameters,\n RoleAssignmentsDeleteRoleAssignmentByIdParameters,\n RoleDefinitionsListRoleDefinitionsParameters,\n RoleDefinitionsGetRoleDefinitionByIdParameters,\n RoleDefinitionsListScopesParameters,\n} from \"./parameters.js\";\nimport type {\n RoleAssignmentsCheckPrincipalAccess200Response,\n RoleAssignmentsCheckPrincipalAccessdefaultResponse,\n RoleAssignmentsListRoleAssignments200Response,\n RoleAssignmentsListRoleAssignmentsdefaultResponse,\n RoleAssignmentsCreateRoleAssignment200Response,\n RoleAssignmentsCreateRoleAssignmentdefaultResponse,\n RoleAssignmentsGetRoleAssignmentById200Response,\n RoleAssignmentsGetRoleAssignmentByIddefaultResponse,\n RoleAssignmentsDeleteRoleAssignmentById200Response,\n RoleAssignmentsDeleteRoleAssignmentById204Response,\n RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse,\n RoleDefinitionsListRoleDefinitions200Response,\n RoleDefinitionsListRoleDefinitionsdefaultResponse,\n RoleDefinitionsGetRoleDefinitionById200Response,\n RoleDefinitionsGetRoleDefinitionByIddefaultResponse,\n RoleDefinitionsListScopes200Response,\n RoleDefinitionsListScopesdefaultResponse,\n} from \"./responses.js\";\nimport type { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface RoleAssignmentsCheckPrincipalAccess {\n /** Check if the given principalId has access to perform list of actions at a given scope. */\n post(\n options: RoleAssignmentsCheckPrincipalAccessParameters,\n ): StreamableMethod<\n | RoleAssignmentsCheckPrincipalAccess200Response\n | RoleAssignmentsCheckPrincipalAccessdefaultResponse\n >;\n}\n\nexport interface RoleAssignmentsListRoleAssignments {\n /** List role assignments. */\n get(\n options?: RoleAssignmentsListRoleAssignmentsParameters,\n ): StreamableMethod<\n | RoleAssignmentsListRoleAssignments200Response\n | RoleAssignmentsListRoleAssignmentsdefaultResponse\n >;\n}\n\nexport interface RoleAssignmentsCreateRoleAssignment {\n /** Create role assignment. */\n put(\n options: RoleAssignmentsCreateRoleAssignmentParameters,\n ): StreamableMethod<\n | RoleAssignmentsCreateRoleAssignment200Response\n | RoleAssignmentsCreateRoleAssignmentdefaultResponse\n >;\n /** Get role assignment by role assignment Id. */\n get(\n options?: RoleAssignmentsGetRoleAssignmentByIdParameters,\n ): StreamableMethod<\n | RoleAssignmentsGetRoleAssignmentById200Response\n | RoleAssignmentsGetRoleAssignmentByIddefaultResponse\n >;\n /** Delete role assignment by role assignment Id. */\n delete(\n options?: RoleAssignmentsDeleteRoleAssignmentByIdParameters,\n ): StreamableMethod<\n | RoleAssignmentsDeleteRoleAssignmentById200Response\n | RoleAssignmentsDeleteRoleAssignmentById204Response\n | RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse\n >;\n}\n\nexport interface RoleDefinitionsListRoleDefinitions {\n /** List role definitions. */\n get(\n options?: RoleDefinitionsListRoleDefinitionsParameters,\n ): StreamableMethod<\n | RoleDefinitionsListRoleDefinitions200Response\n | RoleDefinitionsListRoleDefinitionsdefaultResponse\n >;\n}\n\nexport interface RoleDefinitionsGetRoleDefinitionById {\n /** Get role definition by role definition Id. */\n get(\n options?: RoleDefinitionsGetRoleDefinitionByIdParameters,\n ): StreamableMethod<\n | RoleDefinitionsGetRoleDefinitionById200Response\n | RoleDefinitionsGetRoleDefinitionByIddefaultResponse\n >;\n}\n\nexport interface RoleDefinitionsListScopes {\n /** List rbac scopes. */\n get(\n options?: RoleDefinitionsListScopesParameters,\n ): StreamableMethod<\n RoleDefinitionsListScopes200Response | RoleDefinitionsListScopesdefaultResponse\n >;\n}\n\nexport interface Routes {\n /** Resource for '/checkAccessSynapseRbac' has methods for the following verbs: post */\n (path: \"/checkAccessSynapseRbac\"): RoleAssignmentsCheckPrincipalAccess;\n /** Resource for '/roleAssignments' has methods for the following verbs: get */\n (path: \"/roleAssignments\"): RoleAssignmentsListRoleAssignments;\n /** Resource for '/roleAssignments/\\{roleAssignmentId\\}' has methods for the following verbs: put, get, delete */\n (\n path: \"/roleAssignments/{roleAssignmentId}\",\n roleAssignmentId: string,\n ): RoleAssignmentsCreateRoleAssignment;\n /** Resource for '/roleDefinitions' has methods for the following verbs: get */\n (path: \"/roleDefinitions\"): RoleDefinitionsListRoleDefinitions;\n /** Resource for '/roleDefinitions/\\{roleDefinitionId\\}' has methods for the following verbs: get */\n (\n path: \"/roleDefinitions/{roleDefinitionId}\",\n roleDefinitionId: string,\n ): RoleDefinitionsGetRoleDefinitionById;\n /** Resource for '/rbacScopes' has methods for the following verbs: get */\n (path: \"/rbacScopes\"): RoleDefinitionsListScopes;\n}\n\nexport type AccessControlRestClient = Client & {\n path: Routes;\n};\n"]}
1
+ {"version":3,"file":"clientDefinitions.js","sourceRoot":"","sources":["../../src/clientDefinitions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n RoleAssignmentsCheckPrincipalAccessParameters,\n RoleAssignmentsListRoleAssignmentsParameters,\n RoleAssignmentsCreateRoleAssignmentParameters,\n RoleAssignmentsGetRoleAssignmentByIdParameters,\n RoleAssignmentsDeleteRoleAssignmentByIdParameters,\n RoleDefinitionsListRoleDefinitionsParameters,\n RoleDefinitionsGetRoleDefinitionByIdParameters,\n RoleDefinitionsListScopesParameters,\n} from \"./parameters.js\";\nimport type {\n RoleAssignmentsCheckPrincipalAccess200Response,\n RoleAssignmentsCheckPrincipalAccessDefaultResponse,\n RoleAssignmentsListRoleAssignments200Response,\n RoleAssignmentsListRoleAssignmentsDefaultResponse,\n RoleAssignmentsCreateRoleAssignment200Response,\n RoleAssignmentsCreateRoleAssignmentDefaultResponse,\n RoleAssignmentsGetRoleAssignmentById200Response,\n RoleAssignmentsGetRoleAssignmentByIdDefaultResponse,\n RoleAssignmentsDeleteRoleAssignmentById200Response,\n RoleAssignmentsDeleteRoleAssignmentById204Response,\n RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse,\n RoleDefinitionsListRoleDefinitions200Response,\n RoleDefinitionsListRoleDefinitionsDefaultResponse,\n RoleDefinitionsGetRoleDefinitionById200Response,\n RoleDefinitionsGetRoleDefinitionByIdDefaultResponse,\n RoleDefinitionsListScopes200Response,\n RoleDefinitionsListScopesDefaultResponse,\n} from \"./responses.js\";\nimport type { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface RoleAssignmentsCheckPrincipalAccess {\n /** Check if the given principalId has access to perform list of actions at a given scope. */\n post(\n options: RoleAssignmentsCheckPrincipalAccessParameters,\n ): StreamableMethod<\n | RoleAssignmentsCheckPrincipalAccess200Response\n | RoleAssignmentsCheckPrincipalAccessDefaultResponse\n >;\n}\n\nexport interface RoleAssignmentsListRoleAssignments {\n /** List role assignments. */\n get(\n options?: RoleAssignmentsListRoleAssignmentsParameters,\n ): StreamableMethod<\n | RoleAssignmentsListRoleAssignments200Response\n | RoleAssignmentsListRoleAssignmentsDefaultResponse\n >;\n}\n\nexport interface RoleAssignmentsCreateRoleAssignment {\n /** Create role assignment. */\n put(\n options: RoleAssignmentsCreateRoleAssignmentParameters,\n ): StreamableMethod<\n | RoleAssignmentsCreateRoleAssignment200Response\n | RoleAssignmentsCreateRoleAssignmentDefaultResponse\n >;\n /** Get role assignment by role assignment Id. */\n get(\n options?: RoleAssignmentsGetRoleAssignmentByIdParameters,\n ): StreamableMethod<\n | RoleAssignmentsGetRoleAssignmentById200Response\n | RoleAssignmentsGetRoleAssignmentByIdDefaultResponse\n >;\n /** Delete role assignment by role assignment Id. */\n delete(\n options?: RoleAssignmentsDeleteRoleAssignmentByIdParameters,\n ): StreamableMethod<\n | RoleAssignmentsDeleteRoleAssignmentById200Response\n | RoleAssignmentsDeleteRoleAssignmentById204Response\n | RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse\n >;\n}\n\nexport interface RoleDefinitionsListRoleDefinitions {\n /** List role definitions. */\n get(\n options?: RoleDefinitionsListRoleDefinitionsParameters,\n ): StreamableMethod<\n | RoleDefinitionsListRoleDefinitions200Response\n | RoleDefinitionsListRoleDefinitionsDefaultResponse\n >;\n}\n\nexport interface RoleDefinitionsGetRoleDefinitionById {\n /** Get role definition by role definition Id. */\n get(\n options?: RoleDefinitionsGetRoleDefinitionByIdParameters,\n ): StreamableMethod<\n | RoleDefinitionsGetRoleDefinitionById200Response\n | RoleDefinitionsGetRoleDefinitionByIdDefaultResponse\n >;\n}\n\nexport interface RoleDefinitionsListScopes {\n /** List rbac scopes. */\n get(\n options?: RoleDefinitionsListScopesParameters,\n ): StreamableMethod<\n RoleDefinitionsListScopes200Response | RoleDefinitionsListScopesDefaultResponse\n >;\n}\n\nexport interface Routes {\n /** Resource for '/checkAccessSynapseRbac' has methods for the following verbs: post */\n (path: \"/checkAccessSynapseRbac\"): RoleAssignmentsCheckPrincipalAccess;\n /** Resource for '/roleAssignments' has methods for the following verbs: get */\n (path: \"/roleAssignments\"): RoleAssignmentsListRoleAssignments;\n /** Resource for '/roleAssignments/\\{roleAssignmentId\\}' has methods for the following verbs: put, get, delete */\n (\n path: \"/roleAssignments/{roleAssignmentId}\",\n roleAssignmentId: string,\n ): RoleAssignmentsCreateRoleAssignment;\n /** Resource for '/roleDefinitions' has methods for the following verbs: get */\n (path: \"/roleDefinitions\"): RoleDefinitionsListRoleDefinitions;\n /** Resource for '/roleDefinitions/\\{roleDefinitionId\\}' has methods for the following verbs: get */\n (\n path: \"/roleDefinitions/{roleDefinitionId}\",\n roleDefinitionId: string,\n ): RoleDefinitionsGetRoleDefinitionById;\n /** Resource for '/rbacScopes' has methods for the following verbs: get */\n (path: \"/rbacScopes\"): RoleDefinitionsListScopes;\n}\n\nexport type AccessControlRestClient = Client & {\n path: Routes;\n};\n"]}
@@ -1,10 +1,10 @@
1
- import type { RoleAssignmentsCheckPrincipalAccess200Response, RoleAssignmentsCheckPrincipalAccessdefaultResponse, RoleAssignmentsListRoleAssignments200Response, RoleAssignmentsListRoleAssignmentsdefaultResponse, RoleAssignmentsCreateRoleAssignment200Response, RoleAssignmentsCreateRoleAssignmentdefaultResponse, RoleAssignmentsGetRoleAssignmentById200Response, RoleAssignmentsGetRoleAssignmentByIddefaultResponse, RoleAssignmentsDeleteRoleAssignmentById200Response, RoleAssignmentsDeleteRoleAssignmentById204Response, RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse, RoleDefinitionsListRoleDefinitions200Response, RoleDefinitionsListRoleDefinitionsdefaultResponse, RoleDefinitionsGetRoleDefinitionById200Response, RoleDefinitionsGetRoleDefinitionByIddefaultResponse, RoleDefinitionsListScopes200Response, RoleDefinitionsListScopesdefaultResponse } from "./responses.js";
2
- export declare function isUnexpected(response: RoleAssignmentsCheckPrincipalAccess200Response | RoleAssignmentsCheckPrincipalAccessdefaultResponse): response is RoleAssignmentsCheckPrincipalAccessdefaultResponse;
3
- export declare function isUnexpected(response: RoleAssignmentsListRoleAssignments200Response | RoleAssignmentsListRoleAssignmentsdefaultResponse): response is RoleAssignmentsListRoleAssignmentsdefaultResponse;
4
- export declare function isUnexpected(response: RoleAssignmentsCreateRoleAssignment200Response | RoleAssignmentsCreateRoleAssignmentdefaultResponse): response is RoleAssignmentsCreateRoleAssignmentdefaultResponse;
5
- export declare function isUnexpected(response: RoleAssignmentsGetRoleAssignmentById200Response | RoleAssignmentsGetRoleAssignmentByIddefaultResponse): response is RoleAssignmentsGetRoleAssignmentByIddefaultResponse;
6
- export declare function isUnexpected(response: RoleAssignmentsDeleteRoleAssignmentById200Response | RoleAssignmentsDeleteRoleAssignmentById204Response | RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse): response is RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse;
7
- export declare function isUnexpected(response: RoleDefinitionsListRoleDefinitions200Response | RoleDefinitionsListRoleDefinitionsdefaultResponse): response is RoleDefinitionsListRoleDefinitionsdefaultResponse;
8
- export declare function isUnexpected(response: RoleDefinitionsGetRoleDefinitionById200Response | RoleDefinitionsGetRoleDefinitionByIddefaultResponse): response is RoleDefinitionsGetRoleDefinitionByIddefaultResponse;
9
- export declare function isUnexpected(response: RoleDefinitionsListScopes200Response | RoleDefinitionsListScopesdefaultResponse): response is RoleDefinitionsListScopesdefaultResponse;
1
+ import type { RoleAssignmentsCheckPrincipalAccess200Response, RoleAssignmentsCheckPrincipalAccessDefaultResponse, RoleAssignmentsListRoleAssignments200Response, RoleAssignmentsListRoleAssignmentsDefaultResponse, RoleAssignmentsCreateRoleAssignment200Response, RoleAssignmentsCreateRoleAssignmentDefaultResponse, RoleAssignmentsGetRoleAssignmentById200Response, RoleAssignmentsGetRoleAssignmentByIdDefaultResponse, RoleAssignmentsDeleteRoleAssignmentById200Response, RoleAssignmentsDeleteRoleAssignmentById204Response, RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse, RoleDefinitionsListRoleDefinitions200Response, RoleDefinitionsListRoleDefinitionsDefaultResponse, RoleDefinitionsGetRoleDefinitionById200Response, RoleDefinitionsGetRoleDefinitionByIdDefaultResponse, RoleDefinitionsListScopes200Response, RoleDefinitionsListScopesDefaultResponse } from "./responses.js";
2
+ export declare function isUnexpected(response: RoleAssignmentsCheckPrincipalAccess200Response | RoleAssignmentsCheckPrincipalAccessDefaultResponse): response is RoleAssignmentsCheckPrincipalAccessDefaultResponse;
3
+ export declare function isUnexpected(response: RoleAssignmentsListRoleAssignments200Response | RoleAssignmentsListRoleAssignmentsDefaultResponse): response is RoleAssignmentsListRoleAssignmentsDefaultResponse;
4
+ export declare function isUnexpected(response: RoleAssignmentsCreateRoleAssignment200Response | RoleAssignmentsCreateRoleAssignmentDefaultResponse): response is RoleAssignmentsCreateRoleAssignmentDefaultResponse;
5
+ export declare function isUnexpected(response: RoleAssignmentsGetRoleAssignmentById200Response | RoleAssignmentsGetRoleAssignmentByIdDefaultResponse): response is RoleAssignmentsGetRoleAssignmentByIdDefaultResponse;
6
+ export declare function isUnexpected(response: RoleAssignmentsDeleteRoleAssignmentById200Response | RoleAssignmentsDeleteRoleAssignmentById204Response | RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse): response is RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse;
7
+ export declare function isUnexpected(response: RoleDefinitionsListRoleDefinitions200Response | RoleDefinitionsListRoleDefinitionsDefaultResponse): response is RoleDefinitionsListRoleDefinitionsDefaultResponse;
8
+ export declare function isUnexpected(response: RoleDefinitionsGetRoleDefinitionById200Response | RoleDefinitionsGetRoleDefinitionByIdDefaultResponse): response is RoleDefinitionsGetRoleDefinitionByIdDefaultResponse;
9
+ export declare function isUnexpected(response: RoleDefinitionsListScopes200Response | RoleDefinitionsListScopesDefaultResponse): response is RoleDefinitionsListScopesDefaultResponse;
10
10
  //# sourceMappingURL=isUnexpected.d.ts.map
@@ -16,52 +16,59 @@ export function isUnexpected(response) {
16
16
  const method = response.request.method;
17
17
  let pathDetails = responseMap[`${method} ${url.pathname}`];
18
18
  if (!pathDetails) {
19
- pathDetails = geParametrizedPathSuccess(url.pathname);
19
+ pathDetails = getParametrizedPathSuccess(method, url.pathname);
20
20
  }
21
21
  return !pathDetails.includes(response.status);
22
22
  }
23
- function geParametrizedPathSuccess(path) {
23
+ function getParametrizedPathSuccess(method, path) {
24
+ var _a, _b, _c, _d;
24
25
  const pathParts = path.split("/");
26
+ // Traverse list to match the longest candidate
27
+ // matchedLen: the length of candidate path
28
+ // matchedValue: the matched status code array
29
+ let matchedLen = -1, matchedValue = [];
25
30
  // Iterate the responseMap to find a match
26
31
  for (const [key, value] of Object.entries(responseMap)) {
27
32
  // Extracting the path from the map key which is in format
28
33
  // GET /path/foo
34
+ if (!key.startsWith(method)) {
35
+ continue;
36
+ }
29
37
  const candidatePath = getPathFromMapKey(key);
30
38
  // Get each part of the url path
31
39
  const candidateParts = candidatePath.split("/");
32
- // If the candidate and actual paths don't match in size
33
- // we move on to the next candidate path
34
- if (candidateParts.length === pathParts.length && hasParametrizedPath(key)) {
35
- // track if we have found a match to return the values found.
36
- let found = true;
37
- for (let i = 0; i < candidateParts.length; i++) {
38
- if (candidateParts[i].startsWith("{") && candidateParts[i].endsWith("}")) {
39
- // If the current part of the candidate is a "template" part
40
- // it is a match with the actual path part on hand
41
- // skip as the parameterized part can match anything
42
- continue;
43
- }
44
- // If the candidate part is not a template and
45
- // the parts don't match mark the candidate as not found
46
- // to move on with the next candidate path.
47
- if (candidateParts[i] !== pathParts[i]) {
40
+ // track if we have found a match to return the values found.
41
+ let found = true;
42
+ for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
43
+ if (((_a = candidateParts[i]) === null || _a === void 0 ? void 0 : _a.startsWith("{")) && ((_b = candidateParts[i]) === null || _b === void 0 ? void 0 : _b.indexOf("}")) !== -1) {
44
+ const start = candidateParts[i].indexOf("}") + 1, end = (_c = candidateParts[i]) === null || _c === void 0 ? void 0 : _c.length;
45
+ // If the current part of the candidate is a "template" part
46
+ // Try to use the suffix of pattern to match the path
47
+ // {guid} ==> $
48
+ // {guid}:export ==> :export$
49
+ const isMatched = new RegExp(`${(_d = candidateParts[i]) === null || _d === void 0 ? void 0 : _d.slice(start, end)}`).test(pathParts[j] || "");
50
+ if (!isMatched) {
48
51
  found = false;
49
52
  break;
50
53
  }
54
+ continue;
51
55
  }
52
- // We finished evaluating the current candidate parts
53
- // if all parts matched we return the success values form
54
- // the path mapping.
55
- if (found) {
56
- return value;
56
+ // If the candidate part is not a template and
57
+ // the parts don't match mark the candidate as not found
58
+ // to move on with the next candidate path.
59
+ if (candidateParts[i] !== pathParts[j]) {
60
+ found = false;
61
+ break;
57
62
  }
58
63
  }
64
+ // We finished evaluating the current candidate parts
65
+ // Update the matched value if and only if we found the longer pattern
66
+ if (found && candidatePath.length > matchedLen) {
67
+ matchedLen = candidatePath.length;
68
+ matchedValue = value;
69
+ }
59
70
  }
60
- // No match was found, return an empty array.
61
- return [];
62
- }
63
- function hasParametrizedPath(path) {
64
- return path.includes("/{");
71
+ return matchedValue;
65
72
  }
66
73
  function getPathFromMapKey(mapKey) {
67
74
  const pathStart = mapKey.indexOf("/");
@@ -1 +1 @@
1
- {"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../src/isUnexpected.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAsBlC,MAAM,WAAW,GAA6B;IAC5C,8BAA8B,EAAE,CAAC,KAAK,CAAC;IACvC,sBAAsB,EAAE,CAAC,KAAK,CAAC;IAC/B,yCAAyC,EAAE,CAAC,KAAK,CAAC;IAClD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c,CAAC,MAAM,KAAK,SAAS,CAAC,MAAM,IAAI,mBAAmB,CAAC,GAAG,CAAC,EAAE,CAAC;YAC3E,6DAA6D;YAC7D,IAAI,KAAK,GAAG,IAAI,CAAC;YACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC/C,IAAI,cAAc,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,cAAc,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;oBACzE,4DAA4D;oBAC5D,kDAAkD;oBAClD,oDAAoD;oBACpD,SAAS;gBACX,CAAC;gBAED,8CAA8C;gBAC9C,wDAAwD;gBACxD,2CAA2C;gBAC3C,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;oBACvC,KAAK,GAAG,KAAK,CAAC;oBACd,MAAM;gBACR,CAAC;YACH,CAAC;YAED,qDAAqD;YACrD,yDAAyD;YACzD,oBAAoB;YACpB,IAAI,KAAK,EAAE,CAAC;gBACV,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;IACH,CAAC;IAED,6CAA6C;IAC7C,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAS,mBAAmB,CAAC,IAAY;IACvC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n RoleAssignmentsCheckPrincipalAccess200Response,\n RoleAssignmentsCheckPrincipalAccessdefaultResponse,\n RoleAssignmentsListRoleAssignments200Response,\n RoleAssignmentsListRoleAssignmentsdefaultResponse,\n RoleAssignmentsCreateRoleAssignment200Response,\n RoleAssignmentsCreateRoleAssignmentdefaultResponse,\n RoleAssignmentsGetRoleAssignmentById200Response,\n RoleAssignmentsGetRoleAssignmentByIddefaultResponse,\n RoleAssignmentsDeleteRoleAssignmentById200Response,\n RoleAssignmentsDeleteRoleAssignmentById204Response,\n RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse,\n RoleDefinitionsListRoleDefinitions200Response,\n RoleDefinitionsListRoleDefinitionsdefaultResponse,\n RoleDefinitionsGetRoleDefinitionById200Response,\n RoleDefinitionsGetRoleDefinitionByIddefaultResponse,\n RoleDefinitionsListScopes200Response,\n RoleDefinitionsListScopesdefaultResponse,\n} from \"./responses.js\";\n\nconst responseMap: Record<string, string[]> = {\n \"POST /checkAccessSynapseRbac\": [\"200\"],\n \"GET /roleAssignments\": [\"200\"],\n \"PUT /roleAssignments/{roleAssignmentId}\": [\"200\"],\n \"GET /roleAssignments/{roleAssignmentId}\": [\"200\"],\n \"DELETE /roleAssignments/{roleAssignmentId}\": [\"200\", \"204\"],\n \"GET /roleDefinitions\": [\"200\"],\n \"GET /roleDefinitions/{roleDefinitionId}\": [\"200\"],\n \"GET /rbacScopes\": [\"200\"],\n};\n\nexport function isUnexpected(\n response:\n | RoleAssignmentsCheckPrincipalAccess200Response\n | RoleAssignmentsCheckPrincipalAccessdefaultResponse,\n): response is RoleAssignmentsCheckPrincipalAccessdefaultResponse;\nexport function isUnexpected(\n response:\n | RoleAssignmentsListRoleAssignments200Response\n | RoleAssignmentsListRoleAssignmentsdefaultResponse,\n): response is RoleAssignmentsListRoleAssignmentsdefaultResponse;\nexport function isUnexpected(\n response:\n | RoleAssignmentsCreateRoleAssignment200Response\n | RoleAssignmentsCreateRoleAssignmentdefaultResponse,\n): response is RoleAssignmentsCreateRoleAssignmentdefaultResponse;\nexport function isUnexpected(\n response:\n | RoleAssignmentsGetRoleAssignmentById200Response\n | RoleAssignmentsGetRoleAssignmentByIddefaultResponse,\n): response is RoleAssignmentsGetRoleAssignmentByIddefaultResponse;\nexport function isUnexpected(\n response:\n | RoleAssignmentsDeleteRoleAssignmentById200Response\n | RoleAssignmentsDeleteRoleAssignmentById204Response\n | RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse,\n): response is RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse;\nexport function isUnexpected(\n response:\n | RoleDefinitionsListRoleDefinitions200Response\n | RoleDefinitionsListRoleDefinitionsdefaultResponse,\n): response is RoleDefinitionsListRoleDefinitionsdefaultResponse;\nexport function isUnexpected(\n response:\n | RoleDefinitionsGetRoleDefinitionById200Response\n | RoleDefinitionsGetRoleDefinitionByIddefaultResponse,\n): response is RoleDefinitionsGetRoleDefinitionByIddefaultResponse;\nexport function isUnexpected(\n response: RoleDefinitionsListScopes200Response | RoleDefinitionsListScopesdefaultResponse,\n): response is RoleDefinitionsListScopesdefaultResponse;\nexport function isUnexpected(\n response:\n | RoleAssignmentsCheckPrincipalAccess200Response\n | RoleAssignmentsCheckPrincipalAccessdefaultResponse\n | RoleAssignmentsListRoleAssignments200Response\n | RoleAssignmentsListRoleAssignmentsdefaultResponse\n | RoleAssignmentsCreateRoleAssignment200Response\n | RoleAssignmentsCreateRoleAssignmentdefaultResponse\n | RoleAssignmentsGetRoleAssignmentById200Response\n | RoleAssignmentsGetRoleAssignmentByIddefaultResponse\n | RoleAssignmentsDeleteRoleAssignmentById200Response\n | RoleAssignmentsDeleteRoleAssignmentById204Response\n | RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse\n | RoleDefinitionsListRoleDefinitions200Response\n | RoleDefinitionsListRoleDefinitionsdefaultResponse\n | RoleDefinitionsGetRoleDefinitionById200Response\n | RoleDefinitionsGetRoleDefinitionByIddefaultResponse\n | RoleDefinitionsListScopes200Response\n | RoleDefinitionsListScopesdefaultResponse,\n): response is\n | RoleAssignmentsCheckPrincipalAccessdefaultResponse\n | RoleAssignmentsListRoleAssignmentsdefaultResponse\n | RoleAssignmentsCreateRoleAssignmentdefaultResponse\n | RoleAssignmentsGetRoleAssignmentByIddefaultResponse\n | RoleAssignmentsDeleteRoleAssignmentByIddefaultResponse\n | RoleDefinitionsListRoleDefinitionsdefaultResponse\n | RoleDefinitionsGetRoleDefinitionByIddefaultResponse\n | RoleDefinitionsListScopesdefaultResponse {\n const lroOriginal = response.headers[\"x-ms-original-url\"];\n const url = new URL(lroOriginal ?? response.request.url);\n const method = response.request.method;\n let pathDetails = responseMap[`${method} ${url.pathname}`];\n if (!pathDetails) {\n pathDetails = geParametrizedPathSuccess(url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction geParametrizedPathSuccess(path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(responseMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // If the candidate and actual paths don't match in size\n // we move on to the next candidate path\n if (candidateParts.length === pathParts.length && hasParametrizedPath(key)) {\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = 0; i < candidateParts.length; i++) {\n if (candidateParts[i].startsWith(\"{\") && candidateParts[i].endsWith(\"}\")) {\n // If the current part of the candidate is a \"template\" part\n // it is a match with the actual path part on hand\n // skip as the parameterized part can match anything\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[i]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // if all parts matched we return the success values form\n // the path mapping.\n if (found) {\n return value;\n }\n }\n }\n\n // No match was found, return an empty array.\n return [];\n}\n\nfunction hasParametrizedPath(path: string): boolean {\n return path.includes(\"/{\");\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
1
+ {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C,IAAI,CAC1E,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,CACnB,CAAC;gBAEF,IAAI,CAAC,SAAS,EAAE,CAAC;oBACf,KAAK,GAAG,KAAK,CAAC;oBACd,MAAM;gBACR,CAAC;gBACD,SAAS;YACX,CAAC;YAED,8CAA8C;YAC9C,wDAAwD;YACxD,2CAA2C;YAC3C,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;gBACvC,KAAK,GAAG,KAAK,CAAC;gBACd,MAAM;YACR,CAAC;QACH,CAAC;QAED,qDAAqD;QACrD,sEAAsE;QACtE,IAAI,KAAK,IAAI,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE,CAAC;YAC/C,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC;YAClC,YAAY,GAAG,KAAK,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n RoleAssignmentsCheckPrincipalAccess200Response,\n RoleAssignmentsCheckPrincipalAccessDefaultResponse,\n RoleAssignmentsListRoleAssignments200Response,\n RoleAssignmentsListRoleAssignmentsDefaultResponse,\n RoleAssignmentsCreateRoleAssignment200Response,\n RoleAssignmentsCreateRoleAssignmentDefaultResponse,\n RoleAssignmentsGetRoleAssignmentById200Response,\n RoleAssignmentsGetRoleAssignmentByIdDefaultResponse,\n RoleAssignmentsDeleteRoleAssignmentById200Response,\n RoleAssignmentsDeleteRoleAssignmentById204Response,\n RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse,\n RoleDefinitionsListRoleDefinitions200Response,\n RoleDefinitionsListRoleDefinitionsDefaultResponse,\n RoleDefinitionsGetRoleDefinitionById200Response,\n RoleDefinitionsGetRoleDefinitionByIdDefaultResponse,\n RoleDefinitionsListScopes200Response,\n RoleDefinitionsListScopesDefaultResponse,\n} from \"./responses.js\";\n\nconst responseMap: Record<string, string[]> = {\n \"POST /checkAccessSynapseRbac\": [\"200\"],\n \"GET /roleAssignments\": [\"200\"],\n \"PUT /roleAssignments/{roleAssignmentId}\": [\"200\"],\n \"GET /roleAssignments/{roleAssignmentId}\": [\"200\"],\n \"DELETE /roleAssignments/{roleAssignmentId}\": [\"200\", \"204\"],\n \"GET /roleDefinitions\": [\"200\"],\n \"GET /roleDefinitions/{roleDefinitionId}\": [\"200\"],\n \"GET /rbacScopes\": [\"200\"],\n};\n\nexport function isUnexpected(\n response:\n | RoleAssignmentsCheckPrincipalAccess200Response\n | RoleAssignmentsCheckPrincipalAccessDefaultResponse,\n): response is RoleAssignmentsCheckPrincipalAccessDefaultResponse;\nexport function isUnexpected(\n response:\n | RoleAssignmentsListRoleAssignments200Response\n | RoleAssignmentsListRoleAssignmentsDefaultResponse,\n): response is RoleAssignmentsListRoleAssignmentsDefaultResponse;\nexport function isUnexpected(\n response:\n | RoleAssignmentsCreateRoleAssignment200Response\n | RoleAssignmentsCreateRoleAssignmentDefaultResponse,\n): response is RoleAssignmentsCreateRoleAssignmentDefaultResponse;\nexport function isUnexpected(\n response:\n | RoleAssignmentsGetRoleAssignmentById200Response\n | RoleAssignmentsGetRoleAssignmentByIdDefaultResponse,\n): response is RoleAssignmentsGetRoleAssignmentByIdDefaultResponse;\nexport function isUnexpected(\n response:\n | RoleAssignmentsDeleteRoleAssignmentById200Response\n | RoleAssignmentsDeleteRoleAssignmentById204Response\n | RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse,\n): response is RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse;\nexport function isUnexpected(\n response:\n | RoleDefinitionsListRoleDefinitions200Response\n | RoleDefinitionsListRoleDefinitionsDefaultResponse,\n): response is RoleDefinitionsListRoleDefinitionsDefaultResponse;\nexport function isUnexpected(\n response:\n | RoleDefinitionsGetRoleDefinitionById200Response\n | RoleDefinitionsGetRoleDefinitionByIdDefaultResponse,\n): response is RoleDefinitionsGetRoleDefinitionByIdDefaultResponse;\nexport function isUnexpected(\n response: RoleDefinitionsListScopes200Response | RoleDefinitionsListScopesDefaultResponse,\n): response is RoleDefinitionsListScopesDefaultResponse;\nexport function isUnexpected(\n response:\n | RoleAssignmentsCheckPrincipalAccess200Response\n | RoleAssignmentsCheckPrincipalAccessDefaultResponse\n | RoleAssignmentsListRoleAssignments200Response\n | RoleAssignmentsListRoleAssignmentsDefaultResponse\n | RoleAssignmentsCreateRoleAssignment200Response\n | RoleAssignmentsCreateRoleAssignmentDefaultResponse\n | RoleAssignmentsGetRoleAssignmentById200Response\n | RoleAssignmentsGetRoleAssignmentByIdDefaultResponse\n | RoleAssignmentsDeleteRoleAssignmentById200Response\n | RoleAssignmentsDeleteRoleAssignmentById204Response\n | RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse\n | RoleDefinitionsListRoleDefinitions200Response\n | RoleDefinitionsListRoleDefinitionsDefaultResponse\n | RoleDefinitionsGetRoleDefinitionById200Response\n | RoleDefinitionsGetRoleDefinitionByIdDefaultResponse\n | RoleDefinitionsListScopes200Response\n | RoleDefinitionsListScopesDefaultResponse,\n): response is\n | RoleAssignmentsCheckPrincipalAccessDefaultResponse\n | RoleAssignmentsListRoleAssignmentsDefaultResponse\n | RoleAssignmentsCreateRoleAssignmentDefaultResponse\n | RoleAssignmentsGetRoleAssignmentByIdDefaultResponse\n | RoleAssignmentsDeleteRoleAssignmentByIdDefaultResponse\n | RoleDefinitionsListRoleDefinitionsDefaultResponse\n | RoleDefinitionsGetRoleDefinitionByIdDefaultResponse\n | RoleDefinitionsListScopesDefaultResponse {\n const lroOriginal = response.headers[\"x-ms-original-url\"];\n const url = new URL(lroOriginal ?? response.request.url);\n const method = response.request.method;\n let pathDetails = responseMap[`${method} ${url.pathname}`];\n if (!pathDetails) {\n pathDetails = getParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction getParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: string[] = [];\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(responseMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {\n if (candidateParts[i]?.startsWith(\"{\") && candidateParts[i]?.indexOf(\"}\") !== -1) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(\n pathParts[j] || \"\",\n );\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export declare const logger: import("@azure/logger").AzureLogger;
2
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM,qCAA+C,CAAC"}
@@ -0,0 +1,5 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { createClientLogger } from "@azure/logger";
4
+ export const logger = createClientLogger("synapse-access-control");
5
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,wBAAwB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createClientLogger } from \"@azure/logger\";\nexport const logger = createClientLogger(\"synapse-access-control\");\n"]}
@@ -1,3 +1,4 @@
1
+ /** Check access request details */
1
2
  export interface CheckPrincipalAccessRequest {
2
3
  /** Subject details */
3
4
  subject: SubjectInfo;
@@ -6,6 +7,7 @@ export interface CheckPrincipalAccessRequest {
6
7
  /** Scope at which the check access is done. */
7
8
  scope: string;
8
9
  }
10
+ /** Subject details */
9
11
  export interface SubjectInfo {
10
12
  /**
11
13
  * Principal Id
@@ -16,12 +18,14 @@ export interface SubjectInfo {
16
18
  /** List of group Ids that the principalId is part of. */
17
19
  groupIds?: Array<string>;
18
20
  }
21
+ /** Action Info */
19
22
  export interface RequiredAction {
20
23
  /** Action Id. */
21
24
  id: string;
22
25
  /** Is a data action or not. */
23
26
  isDataAction: boolean;
24
27
  }
28
+ /** Role Assignment request details */
25
29
  export interface RoleAssignmentRequest {
26
30
  /**
27
31
  * Role ID of the Synapse Built-In Role
@@ -1 +1 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAGA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sC;AACtC,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport interface CheckPrincipalAccessRequest {\n /** Subject details */\n subject: SubjectInfo;\n /** List of actions. */\n actions: Array<RequiredAction>;\n /** Scope at which the check access is done. */\n scope: string;\n}\n\nexport interface SubjectInfo {\n /**\n * Principal Id\n *\n * Value may contain a UUID\n */\n principalId: string;\n /** List of group Ids that the principalId is part of. */\n groupIds?: Array<string>;\n}\n\nexport interface RequiredAction {\n /** Action Id. */\n id: string;\n /** Is a data action or not. */\n isDataAction: boolean;\n}\n\nexport interface RoleAssignmentRequest {\n /**\n * Role ID of the Synapse Built-In Role\n *\n * Value may contain a UUID\n */\n roleId: string;\n /**\n * Object ID of the AAD principal or security-group\n *\n * Value may contain a UUID\n */\n principalId: string;\n /** Scope at which the role assignment is created */\n scope: string;\n /** Type of the principal Id: User, Group or ServicePrincipal */\n principalType?: string;\n}\n"]}
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/** Check access request details */\nexport interface CheckPrincipalAccessRequest {\n /** Subject details */\n subject: SubjectInfo;\n /** List of actions. */\n actions: Array<RequiredAction>;\n /** Scope at which the check access is done. */\n scope: string;\n}\n\n/** Subject details */\nexport interface SubjectInfo {\n /**\n * Principal Id\n *\n * Value may contain a UUID\n */\n principalId: string;\n /** List of group Ids that the principalId is part of. */\n groupIds?: Array<string>;\n}\n\n/** Action Info */\nexport interface RequiredAction {\n /** Action Id. */\n id: string;\n /** Is a data action or not. */\n isDataAction: boolean;\n}\n\n/** Role Assignment request details */\nexport interface RoleAssignmentRequest {\n /**\n * Role ID of the Synapse Built-In Role\n *\n * Value may contain a UUID\n */\n roleId: string;\n /**\n * Object ID of the AAD principal or security-group\n *\n * Value may contain a UUID\n */\n principalId: string;\n /** Scope at which the role assignment is created */\n scope: string;\n /** Type of the principal Id: User, Group or ServicePrincipal */\n principalType?: string;\n}\n"]}
@@ -1,7 +1,9 @@
1
+ /** Check access response details */
1
2
  export interface CheckPrincipalAccessResponseOutput {
2
3
  /** To check if the current user, group, or service principal has permission to read artifacts in the specified workspace. */
3
4
  AccessDecisions?: Array<CheckAccessDecisionOutput>;
4
5
  }
6
+ /** Check access response details */
5
7
  export interface CheckAccessDecisionOutput {
6
8
  /** Access Decision. */
7
9
  accessDecision?: string;
@@ -10,6 +12,7 @@ export interface CheckAccessDecisionOutput {
10
12
  /** Role Assignment response details */
11
13
  roleAssignment?: RoleAssignmentDetailsOutput;
12
14
  }
15
+ /** Role Assignment response details */
13
16
  export interface RoleAssignmentDetailsOutput {
14
17
  /** Role Assignment ID */
15
18
  id?: string;
@@ -30,34 +33,39 @@ export interface RoleAssignmentDetailsOutput {
30
33
  /** Type of the principal Id: User, Group or ServicePrincipal */
31
34
  principalType?: string;
32
35
  }
36
+ /** Contains details when the response code indicates an error. */
33
37
  export interface ErrorContractOutput {
34
38
  /** The error details. */
35
39
  error?: ErrorResponseOutput;
36
40
  }
41
+ /** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.) */
37
42
  export interface ErrorResponseOutput {
38
43
  /** The error code. */
39
- code?: string;
44
+ readonly code?: string;
40
45
  /** The error message. */
41
- message?: string;
46
+ readonly message?: string;
42
47
  /** The error target. */
43
- target?: string;
48
+ readonly target?: string;
44
49
  /** The error details. */
45
- details?: Array<ErrorResponseOutput>;
50
+ readonly details?: Array<ErrorResponseOutput>;
46
51
  /** The error additional info. */
47
- additionalInfo?: Array<ErrorAdditionalInfoOutput>;
52
+ readonly additionalInfo?: Array<ErrorAdditionalInfoOutput>;
48
53
  }
54
+ /** The resource management error additional info. */
49
55
  export interface ErrorAdditionalInfoOutput {
50
56
  /** The additional info type. */
51
- type?: string;
57
+ readonly type?: string;
52
58
  /** The additional info. */
53
- info?: Record<string, unknown>;
59
+ readonly info?: Record<string, unknown>;
54
60
  }
61
+ /** Role Assignment response details */
55
62
  export interface RoleAssignmentDetailsListOutput {
56
63
  /** Number of role assignments */
57
64
  count?: number;
58
65
  /** A list of role assignments */
59
66
  value?: Array<RoleAssignmentDetailsOutput>;
60
67
  }
68
+ /** Synapse role definition details */
61
69
  export interface SynapseRoleDefinitionOutput {
62
70
  /**
63
71
  * Role Definition ID
@@ -78,6 +86,7 @@ export interface SynapseRoleDefinitionOutput {
78
86
  /** Availability of the Synapse role */
79
87
  availabilityStatus?: string;
80
88
  }
89
+ /** Synapse role definition details */
81
90
  export interface SynapseRbacPermissionOutput {
82
91
  /** List of actions */
83
92
  actions?: Array<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"outputModels.d.ts","sourceRoot":"","sources":["../../src/outputModels.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,kCAAkC;IACjD,6HAA6H;IAC7H,eAAe,CAAC,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;CACpD;AAED,MAAM,WAAW,yBAAyB;IACxC,uBAAuB;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,cAAc,CAAC,EAAE,2BAA2B,CAAC;CAC9C;AAED,MAAM,WAAW,2BAA2B;IAC1C,yBAAyB;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,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B;IAC1C,sBAAsB;IACtB,OAAO,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACxB,0BAA0B;IAC1B,UAAU,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC3B,2BAA2B;IAC3B,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5B,+BAA+B;IAC/B,cAAc,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAChC"}
@@ -1 +1 @@
1
- {"version":3,"file":"outputModels.js","sourceRoot":"","sources":["../../src/outputModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport interface CheckPrincipalAccessResponseOutput {\n /** To check if the current user, group, or service principal has permission to read artifacts in the specified workspace. */\n AccessDecisions?: Array<CheckAccessDecisionOutput>;\n}\n\nexport interface CheckAccessDecisionOutput {\n /** Access Decision. */\n accessDecision?: string;\n /** Action Id. */\n actionId?: string;\n /** Role Assignment response details */\n roleAssignment?: RoleAssignmentDetailsOutput;\n}\n\nexport interface RoleAssignmentDetailsOutput {\n /** Role Assignment ID */\n id?: string;\n /**\n * Role ID of the Synapse Built-In Role\n *\n * Value may contain a UUID\n */\n roleDefinitionId?: string;\n /**\n * Object ID of the AAD principal or security-group\n *\n * Value may contain a UUID\n */\n principalId?: string;\n /** Scope at the role assignment is created */\n scope?: string;\n /** Type of the principal Id: User, Group or ServicePrincipal */\n principalType?: string;\n}\n\nexport interface ErrorContractOutput {\n /** The error details. */\n error?: ErrorResponseOutput;\n}\n\nexport interface ErrorResponseOutput {\n /** The error code. */\n code?: string;\n /** The error message. */\n message?: string;\n /** The error target. */\n target?: string;\n /** The error details. */\n details?: Array<ErrorResponseOutput>;\n /** The error additional info. */\n additionalInfo?: Array<ErrorAdditionalInfoOutput>;\n}\n\nexport interface ErrorAdditionalInfoOutput {\n /** The additional info type. */\n type?: string;\n /** The additional info. */\n info?: Record<string, unknown>;\n}\n\nexport interface RoleAssignmentDetailsListOutput {\n /** Number of role assignments */\n count?: number;\n /** A list of role assignments */\n value?: Array<RoleAssignmentDetailsOutput>;\n}\n\nexport interface SynapseRoleDefinitionOutput {\n /**\n * Role Definition ID\n *\n * Value may contain a UUID\n */\n id?: string;\n /** Name of the Synapse role */\n name?: string;\n /** Is a built-in role or not */\n isBuiltIn?: boolean;\n /** Description for the Synapse role */\n description?: string;\n /** Permissions for the Synapse role */\n permissions?: Array<SynapseRbacPermissionOutput>;\n /** Allowed scopes for the Synapse role */\n scopes?: Array<string>;\n /** Availability of the Synapse role */\n availabilityStatus?: string;\n}\n\nexport interface SynapseRbacPermissionOutput {\n /** List of actions */\n actions?: Array<string>;\n /** List of Not actions */\n notActions?: Array<string>;\n /** List of data actions */\n dataActions?: Array<string>;\n /** List of Not data actions */\n notDataActions?: Array<string>;\n}\n"]}
1
+ {"version":3,"file":"outputModels.js","sourceRoot":"","sources":["../../src/outputModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/** Check access response details */\nexport interface CheckPrincipalAccessResponseOutput {\n /** To check if the current user, group, or service principal has permission to read artifacts in the specified workspace. */\n AccessDecisions?: Array<CheckAccessDecisionOutput>;\n}\n\n/** Check access response details */\nexport interface CheckAccessDecisionOutput {\n /** Access Decision. */\n accessDecision?: string;\n /** Action Id. */\n actionId?: string;\n /** Role Assignment response details */\n roleAssignment?: RoleAssignmentDetailsOutput;\n}\n\n/** Role Assignment response details */\nexport interface RoleAssignmentDetailsOutput {\n /** Role Assignment ID */\n id?: string;\n /**\n * Role ID of the Synapse Built-In Role\n *\n * Value may contain a UUID\n */\n roleDefinitionId?: string;\n /**\n * Object ID of the AAD principal or security-group\n *\n * Value may contain a UUID\n */\n principalId?: string;\n /** Scope at the role assignment is created */\n scope?: string;\n /** Type of the principal Id: User, Group or ServicePrincipal */\n principalType?: string;\n}\n\n/** Contains details when the response code indicates an error. */\nexport interface ErrorContractOutput {\n /** The error details. */\n error?: ErrorResponseOutput;\n}\n\n/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.) */\nexport interface ErrorResponseOutput {\n /** The error code. */\n readonly code?: string;\n /** The error message. */\n readonly message?: string;\n /** The error target. */\n readonly target?: string;\n /** The error details. */\n readonly details?: Array<ErrorResponseOutput>;\n /** The error additional info. */\n readonly additionalInfo?: Array<ErrorAdditionalInfoOutput>;\n}\n\n/** The resource management error additional info. */\nexport interface ErrorAdditionalInfoOutput {\n /** The additional info type. */\n readonly type?: string;\n /** The additional info. */\n readonly info?: Record<string, unknown>;\n}\n\n/** Role Assignment response details */\nexport interface RoleAssignmentDetailsListOutput {\n /** Number of role assignments */\n count?: number;\n /** A list of role assignments */\n value?: Array<RoleAssignmentDetailsOutput>;\n}\n\n/** Synapse role definition details */\nexport interface SynapseRoleDefinitionOutput {\n /**\n * Role Definition ID\n *\n * Value may contain a UUID\n */\n id?: string;\n /** Name of the Synapse role */\n name?: string;\n /** Is a built-in role or not */\n isBuiltIn?: boolean;\n /** Description for the Synapse role */\n description?: string;\n /** Permissions for the Synapse role */\n permissions?: Array<SynapseRbacPermissionOutput>;\n /** Allowed scopes for the Synapse role */\n scopes?: Array<string>;\n /** Availability of the Synapse role */\n availabilityStatus?: string;\n}\n\n/** Synapse role definition details */\nexport interface SynapseRbacPermissionOutput {\n /** List of actions */\n actions?: Array<string>;\n /** List of Not actions */\n notActions?: Array<string>;\n /** List of data actions */\n dataActions?: Array<string>;\n /** List of Not data actions */\n notDataActions?: Array<string>;\n}\n"]}
@@ -1,5 +1,30 @@
1
- import type { PagedAsyncIterableIterator } from "@azure/core-paging";
2
1
  import type { Client, PathUncheckedResponse } from "@azure-rest/core-client";
2
+ /**
3
+ * An interface that tracks the settings for paged iteration
4
+ */
5
+ export interface PageSettings {
6
+ /**
7
+ * The token that keeps track of where to continue the iterator
8
+ */
9
+ continuationToken?: string;
10
+ }
11
+ /**
12
+ * An interface that allows async iterable iteration both to completion and by page.
13
+ */
14
+ export interface PagedAsyncIterableIterator<TElement, TPage = TElement[], TPageSettings = PageSettings> {
15
+ /**
16
+ * The next method, part of the iteration protocol
17
+ */
18
+ next(): Promise<IteratorResult<TElement>>;
19
+ /**
20
+ * The connection to the async iterator, part of the iteration protocol
21
+ */
22
+ [Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;
23
+ /**
24
+ * Return an AsyncIterableIterator that works a page at a time
25
+ */
26
+ byPage: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;
27
+ }
3
28
  /**
4
29
  * Helper type to extract the type of an array
5
30
  */
@@ -7,7 +32,7 @@ export type GetArrayType<T> = T extends Array<infer TData> ? TData : never;
7
32
  /**
8
33
  * The type of a custom function that defines how to get a page and a link to the next one if any.
9
34
  */
10
- export type GetPage<TPage> = (pageLink: string, maxPageSize?: number) => Promise<{
35
+ export type GetPage<TPage> = (pageLink: string) => Promise<{
11
36
  page: TPage;
12
37
  nextPageLink?: string;
13
38
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"paginateHelper.d.ts","sourceRoot":"","sources":["../../src/paginateHelper.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,0BAA0B,EAAe,MAAM,oBAAoB,CAAC;AAElF,OAAO,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAG7E;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,MAAM,KAAK,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC;AAE3E;;GAEG;AACH,MAAM,MAAM,OAAO,CAAC,KAAK,IAAI,CAC3B,QAAQ,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,MAAM,KACjB,OAAO,CAAC;IACX,IAAI,EAAE,KAAK,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;CAC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