@azure/communication-identity 1.3.2-alpha.20241122.8 → 1.3.2-alpha.20241203.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (255) hide show
  1. package/dist/browser/common/logger.d.ts +5 -0
  2. package/dist/browser/common/logger.d.ts.map +1 -0
  3. package/{types/communication-identity.d.ts → dist/browser/communicationIdentityClient.d.ts} +76 -148
  4. package/dist/browser/communicationIdentityClient.d.ts.map +1 -0
  5. package/{dist-esm/src → dist/browser}/communicationIdentityClient.js +3 -3
  6. package/dist/browser/communicationIdentityClient.js.map +1 -0
  7. package/dist/browser/constants.d.ts +2 -0
  8. package/dist/browser/constants.d.ts.map +1 -0
  9. package/dist/browser/generated/src/identityRestClient.d.ts +17 -0
  10. package/dist/browser/generated/src/identityRestClient.d.ts.map +1 -0
  11. package/{dist-esm/src → dist/browser}/generated/src/identityRestClient.js +1 -1
  12. package/dist/browser/generated/src/identityRestClient.js.map +1 -0
  13. package/dist/browser/generated/src/index.d.ts +4 -0
  14. package/dist/browser/generated/src/index.d.ts.map +1 -0
  15. package/dist/browser/generated/src/index.js +11 -0
  16. package/dist/browser/generated/src/index.js.map +1 -0
  17. package/dist/browser/generated/src/models/index.d.ts +127 -0
  18. package/dist/browser/generated/src/models/index.d.ts.map +1 -0
  19. package/dist/browser/generated/src/models/mappers.d.ts +10 -0
  20. package/dist/browser/generated/src/models/mappers.d.ts.map +1 -0
  21. package/dist/browser/generated/src/models/parameters.d.ts +14 -0
  22. package/dist/browser/generated/src/models/parameters.d.ts.map +1 -0
  23. package/{dist-esm/src → dist/browser}/generated/src/models/parameters.js +1 -1
  24. package/dist/browser/generated/src/models/parameters.js.map +1 -0
  25. package/dist/browser/generated/src/operations/communicationIdentityOperations.d.ts +49 -0
  26. package/dist/browser/generated/src/operations/communicationIdentityOperations.d.ts.map +1 -0
  27. package/{dist-esm/src → dist/browser}/generated/src/operations/communicationIdentityOperations.js +3 -3
  28. package/dist/browser/generated/src/operations/communicationIdentityOperations.js.map +1 -0
  29. package/dist/browser/generated/src/operations/index.d.ts +2 -0
  30. package/dist/browser/generated/src/operations/index.d.ts.map +1 -0
  31. package/{dist-esm/src/generated/src → dist/browser/generated/src/operations}/index.js +1 -3
  32. package/{dist-esm/src → dist/browser}/generated/src/operations/index.js.map +1 -1
  33. package/dist/browser/generated/src/operationsInterfaces/communicationIdentityOperations.d.ts +41 -0
  34. package/dist/browser/generated/src/operationsInterfaces/communicationIdentityOperations.d.ts.map +1 -0
  35. package/dist/browser/generated/src/operationsInterfaces/communicationIdentityOperations.js.map +1 -0
  36. package/dist/browser/generated/src/operationsInterfaces/index.d.ts +2 -0
  37. package/dist/browser/generated/src/operationsInterfaces/index.d.ts.map +1 -0
  38. package/dist/browser/generated/src/operationsInterfaces/index.js +9 -0
  39. package/{dist-esm/src → dist/browser}/generated/src/operationsInterfaces/index.js.map +1 -1
  40. package/dist/browser/generated/src/tracing.d.ts +2 -0
  41. package/dist/browser/generated/src/tracing.d.ts.map +1 -0
  42. package/dist/browser/index.d.ts +3 -0
  43. package/dist/browser/index.d.ts.map +1 -0
  44. package/dist/browser/index.js +5 -0
  45. package/{dist-esm/src → dist/browser}/index.js.map +1 -1
  46. package/dist/browser/models.d.ts +65 -0
  47. package/dist/browser/models.d.ts.map +1 -0
  48. package/dist/browser/package.json +3 -0
  49. package/dist/commonjs/common/logger.d.ts +5 -0
  50. package/dist/commonjs/common/logger.d.ts.map +1 -0
  51. package/dist/commonjs/common/logger.js +11 -0
  52. package/dist/commonjs/common/logger.js.map +1 -0
  53. package/dist/commonjs/communicationIdentityClient.d.ts +76 -0
  54. package/dist/commonjs/communicationIdentityClient.d.ts.map +1 -0
  55. package/dist/commonjs/communicationIdentityClient.js +107 -0
  56. package/dist/commonjs/communicationIdentityClient.js.map +1 -0
  57. package/dist/commonjs/constants.d.ts +2 -0
  58. package/dist/commonjs/constants.d.ts.map +1 -0
  59. package/dist/commonjs/constants.js +7 -0
  60. package/dist/commonjs/constants.js.map +1 -0
  61. package/dist/commonjs/generated/src/identityRestClient.d.ts +17 -0
  62. package/dist/commonjs/generated/src/identityRestClient.d.ts.map +1 -0
  63. package/dist/commonjs/generated/src/identityRestClient.js +74 -0
  64. package/dist/commonjs/generated/src/identityRestClient.js.map +1 -0
  65. package/dist/commonjs/generated/src/index.d.ts +4 -0
  66. package/dist/commonjs/generated/src/index.d.ts.map +1 -0
  67. package/dist/commonjs/generated/src/index.js +16 -0
  68. package/dist/commonjs/generated/src/index.js.map +1 -0
  69. package/dist/commonjs/generated/src/models/index.d.ts +127 -0
  70. package/dist/commonjs/generated/src/models/index.d.ts.map +1 -0
  71. package/dist/commonjs/generated/src/models/index.js +25 -0
  72. package/dist/commonjs/generated/src/models/index.js.map +1 -0
  73. package/dist/commonjs/generated/src/models/mappers.d.ts +10 -0
  74. package/dist/commonjs/generated/src/models/mappers.d.ts.map +1 -0
  75. package/dist/commonjs/generated/src/models/mappers.js +224 -0
  76. package/dist/commonjs/generated/src/models/mappers.js.map +1 -0
  77. package/dist/commonjs/generated/src/models/parameters.d.ts +14 -0
  78. package/dist/commonjs/generated/src/models/parameters.d.ts.map +1 -0
  79. package/dist/commonjs/generated/src/models/parameters.js +94 -0
  80. package/dist/commonjs/generated/src/models/parameters.js.map +1 -0
  81. package/dist/commonjs/generated/src/operations/communicationIdentityOperations.d.ts +49 -0
  82. package/dist/commonjs/generated/src/operations/communicationIdentityOperations.d.ts.map +1 -0
  83. package/dist/commonjs/generated/src/operations/communicationIdentityOperations.js +182 -0
  84. package/dist/commonjs/generated/src/operations/communicationIdentityOperations.js.map +1 -0
  85. package/dist/commonjs/generated/src/operations/index.d.ts +2 -0
  86. package/dist/commonjs/generated/src/operations/index.d.ts.map +1 -0
  87. package/dist/commonjs/generated/src/operations/index.js +12 -0
  88. package/dist/commonjs/generated/src/operations/index.js.map +1 -0
  89. package/dist/commonjs/generated/src/operationsInterfaces/communicationIdentityOperations.d.ts +41 -0
  90. package/dist/commonjs/generated/src/operationsInterfaces/communicationIdentityOperations.d.ts.map +1 -0
  91. package/dist/commonjs/generated/src/operationsInterfaces/communicationIdentityOperations.js +10 -0
  92. package/dist/commonjs/generated/src/operationsInterfaces/communicationIdentityOperations.js.map +1 -0
  93. package/dist/commonjs/generated/src/operationsInterfaces/index.d.ts +2 -0
  94. package/dist/commonjs/generated/src/operationsInterfaces/index.d.ts.map +1 -0
  95. package/dist/commonjs/generated/src/operationsInterfaces/index.js +12 -0
  96. package/dist/commonjs/generated/src/operationsInterfaces/index.js.map +1 -0
  97. package/dist/commonjs/generated/src/tracing.d.ts +2 -0
  98. package/dist/commonjs/generated/src/tracing.d.ts.map +1 -0
  99. package/dist/commonjs/generated/src/tracing.js +17 -0
  100. package/dist/commonjs/generated/src/tracing.js.map +1 -0
  101. package/dist/commonjs/index.d.ts +3 -0
  102. package/dist/commonjs/index.d.ts.map +1 -0
  103. package/dist/commonjs/index.js +8 -0
  104. package/dist/commonjs/index.js.map +1 -0
  105. package/dist/commonjs/models.d.ts +65 -0
  106. package/dist/commonjs/models.d.ts.map +1 -0
  107. package/dist/commonjs/models.js +5 -0
  108. package/dist/commonjs/models.js.map +1 -0
  109. package/dist/commonjs/package.json +3 -0
  110. package/dist/commonjs/tsdoc-metadata.json +11 -0
  111. package/dist/esm/common/logger.d.ts +5 -0
  112. package/dist/esm/common/logger.d.ts.map +1 -0
  113. package/dist/esm/common/logger.js +8 -0
  114. package/dist/esm/common/logger.js.map +1 -0
  115. package/dist/esm/communicationIdentityClient.d.ts +76 -0
  116. package/dist/esm/communicationIdentityClient.d.ts.map +1 -0
  117. package/dist/esm/communicationIdentityClient.js +103 -0
  118. package/dist/esm/communicationIdentityClient.js.map +1 -0
  119. package/dist/esm/constants.d.ts +2 -0
  120. package/dist/esm/constants.d.ts.map +1 -0
  121. package/dist/esm/constants.js +4 -0
  122. package/dist/esm/constants.js.map +1 -0
  123. package/dist/esm/generated/src/identityRestClient.d.ts +17 -0
  124. package/dist/esm/generated/src/identityRestClient.d.ts.map +1 -0
  125. package/dist/esm/generated/src/identityRestClient.js +69 -0
  126. package/dist/esm/generated/src/identityRestClient.js.map +1 -0
  127. package/dist/esm/generated/src/index.d.ts +4 -0
  128. package/dist/esm/generated/src/index.d.ts.map +1 -0
  129. package/dist/esm/generated/src/index.js +11 -0
  130. package/dist/esm/generated/src/index.js.map +1 -0
  131. package/dist/esm/generated/src/models/index.d.ts +127 -0
  132. package/dist/esm/generated/src/models/index.d.ts.map +1 -0
  133. package/dist/esm/generated/src/models/index.js +22 -0
  134. package/dist/esm/generated/src/models/index.js.map +1 -0
  135. package/dist/esm/generated/src/models/mappers.d.ts +10 -0
  136. package/dist/esm/generated/src/models/mappers.d.ts.map +1 -0
  137. package/dist/esm/generated/src/models/mappers.js +221 -0
  138. package/dist/esm/generated/src/models/mappers.js.map +1 -0
  139. package/dist/esm/generated/src/models/parameters.d.ts +14 -0
  140. package/dist/esm/generated/src/models/parameters.d.ts.map +1 -0
  141. package/dist/esm/generated/src/models/parameters.js +91 -0
  142. package/dist/esm/generated/src/models/parameters.js.map +1 -0
  143. package/dist/esm/generated/src/operations/communicationIdentityOperations.d.ts +49 -0
  144. package/dist/esm/generated/src/operations/communicationIdentityOperations.d.ts.map +1 -0
  145. package/dist/esm/generated/src/operations/communicationIdentityOperations.js +177 -0
  146. package/dist/esm/generated/src/operations/communicationIdentityOperations.js.map +1 -0
  147. package/dist/esm/generated/src/operations/index.d.ts +2 -0
  148. package/dist/esm/generated/src/operations/index.d.ts.map +1 -0
  149. package/dist/esm/generated/src/operations/index.js +9 -0
  150. package/dist/esm/generated/src/operations/index.js.map +1 -0
  151. package/dist/esm/generated/src/operationsInterfaces/communicationIdentityOperations.d.ts +41 -0
  152. package/dist/esm/generated/src/operationsInterfaces/communicationIdentityOperations.d.ts.map +1 -0
  153. package/{dist-esm/src/generated/src/operationsInterfaces/index.js → dist/esm/generated/src/operationsInterfaces/communicationIdentityOperations.js} +2 -2
  154. package/dist/esm/generated/src/operationsInterfaces/communicationIdentityOperations.js.map +1 -0
  155. package/dist/esm/generated/src/operationsInterfaces/index.d.ts +2 -0
  156. package/dist/esm/generated/src/operationsInterfaces/index.d.ts.map +1 -0
  157. package/dist/esm/generated/src/operationsInterfaces/index.js +9 -0
  158. package/dist/esm/generated/src/operationsInterfaces/index.js.map +1 -0
  159. package/dist/esm/generated/src/tracing.d.ts +2 -0
  160. package/dist/esm/generated/src/tracing.d.ts.map +1 -0
  161. package/dist/esm/generated/src/tracing.js +14 -0
  162. package/dist/esm/generated/src/tracing.js.map +1 -0
  163. package/dist/esm/index.d.ts +3 -0
  164. package/dist/esm/index.d.ts.map +1 -0
  165. package/dist/esm/index.js +5 -0
  166. package/dist/esm/index.js.map +1 -0
  167. package/dist/esm/models.d.ts +65 -0
  168. package/dist/esm/models.d.ts.map +1 -0
  169. package/dist/esm/models.js +4 -0
  170. package/dist/esm/models.js.map +1 -0
  171. package/dist/esm/package.json +3 -0
  172. package/dist/react-native/common/logger.d.ts +5 -0
  173. package/dist/react-native/common/logger.d.ts.map +1 -0
  174. package/dist/react-native/common/logger.js +8 -0
  175. package/dist/react-native/common/logger.js.map +1 -0
  176. package/dist/react-native/communicationIdentityClient.d.ts +76 -0
  177. package/dist/react-native/communicationIdentityClient.d.ts.map +1 -0
  178. package/dist/react-native/communicationIdentityClient.js +103 -0
  179. package/dist/react-native/communicationIdentityClient.js.map +1 -0
  180. package/dist/react-native/constants.d.ts +2 -0
  181. package/dist/react-native/constants.d.ts.map +1 -0
  182. package/dist/react-native/constants.js +4 -0
  183. package/dist/react-native/constants.js.map +1 -0
  184. package/dist/react-native/generated/src/identityRestClient.d.ts +17 -0
  185. package/dist/react-native/generated/src/identityRestClient.d.ts.map +1 -0
  186. package/dist/react-native/generated/src/identityRestClient.js +69 -0
  187. package/dist/react-native/generated/src/identityRestClient.js.map +1 -0
  188. package/dist/react-native/generated/src/index.d.ts +4 -0
  189. package/dist/react-native/generated/src/index.d.ts.map +1 -0
  190. package/dist/react-native/generated/src/index.js +11 -0
  191. package/dist/react-native/generated/src/index.js.map +1 -0
  192. package/dist/react-native/generated/src/models/index.d.ts +127 -0
  193. package/dist/react-native/generated/src/models/index.d.ts.map +1 -0
  194. package/dist/react-native/generated/src/models/index.js +22 -0
  195. package/dist/react-native/generated/src/models/index.js.map +1 -0
  196. package/dist/react-native/generated/src/models/mappers.d.ts +10 -0
  197. package/dist/react-native/generated/src/models/mappers.d.ts.map +1 -0
  198. package/dist/react-native/generated/src/models/mappers.js +221 -0
  199. package/dist/react-native/generated/src/models/mappers.js.map +1 -0
  200. package/dist/react-native/generated/src/models/parameters.d.ts +14 -0
  201. package/dist/react-native/generated/src/models/parameters.d.ts.map +1 -0
  202. package/dist/react-native/generated/src/models/parameters.js +91 -0
  203. package/dist/react-native/generated/src/models/parameters.js.map +1 -0
  204. package/dist/react-native/generated/src/operations/communicationIdentityOperations.d.ts +49 -0
  205. package/dist/react-native/generated/src/operations/communicationIdentityOperations.d.ts.map +1 -0
  206. package/dist/react-native/generated/src/operations/communicationIdentityOperations.js +177 -0
  207. package/dist/react-native/generated/src/operations/communicationIdentityOperations.js.map +1 -0
  208. package/dist/react-native/generated/src/operations/index.d.ts +2 -0
  209. package/dist/react-native/generated/src/operations/index.d.ts.map +1 -0
  210. package/dist/react-native/generated/src/operations/index.js +9 -0
  211. package/dist/react-native/generated/src/operations/index.js.map +1 -0
  212. package/dist/react-native/generated/src/operationsInterfaces/communicationIdentityOperations.d.ts +41 -0
  213. package/dist/react-native/generated/src/operationsInterfaces/communicationIdentityOperations.d.ts.map +1 -0
  214. package/{dist-esm/src/generated/src/operations/index.js → dist/react-native/generated/src/operationsInterfaces/communicationIdentityOperations.js} +2 -2
  215. package/dist/react-native/generated/src/operationsInterfaces/communicationIdentityOperations.js.map +1 -0
  216. package/dist/react-native/generated/src/operationsInterfaces/index.d.ts +2 -0
  217. package/dist/react-native/generated/src/operationsInterfaces/index.d.ts.map +1 -0
  218. package/dist/react-native/generated/src/operationsInterfaces/index.js +9 -0
  219. package/dist/react-native/generated/src/operationsInterfaces/index.js.map +1 -0
  220. package/dist/react-native/generated/src/tracing.d.ts +2 -0
  221. package/dist/react-native/generated/src/tracing.d.ts.map +1 -0
  222. package/dist/react-native/generated/src/tracing.js +14 -0
  223. package/dist/react-native/generated/src/tracing.js.map +1 -0
  224. package/dist/react-native/index.d.ts +3 -0
  225. package/dist/react-native/index.d.ts.map +1 -0
  226. package/dist/react-native/index.js +5 -0
  227. package/dist/react-native/index.js.map +1 -0
  228. package/dist/react-native/models.d.ts +65 -0
  229. package/dist/react-native/models.d.ts.map +1 -0
  230. package/dist/react-native/models.js +4 -0
  231. package/dist/react-native/models.js.map +1 -0
  232. package/dist/react-native/package.json +3 -0
  233. package/package.json +68 -48
  234. package/dist/index.js +0 -684
  235. package/dist/index.js.map +0 -1
  236. package/dist-esm/src/communicationIdentityClient.js.map +0 -1
  237. package/dist-esm/src/generated/src/identityRestClient.js.map +0 -1
  238. package/dist-esm/src/generated/src/index.js.map +0 -1
  239. package/dist-esm/src/generated/src/models/parameters.js.map +0 -1
  240. package/dist-esm/src/generated/src/operations/communicationIdentityOperations.js.map +0 -1
  241. package/dist-esm/src/generated/src/operationsInterfaces/communicationIdentityOperations.js.map +0 -1
  242. package/dist-esm/src/index.js +0 -5
  243. /package/{dist-esm/src → dist/browser}/common/logger.js +0 -0
  244. /package/{dist-esm/src → dist/browser}/common/logger.js.map +0 -0
  245. /package/{dist-esm/src → dist/browser}/constants.js +0 -0
  246. /package/{dist-esm/src → dist/browser}/constants.js.map +0 -0
  247. /package/{dist-esm/src → dist/browser}/generated/src/models/index.js +0 -0
  248. /package/{dist-esm/src → dist/browser}/generated/src/models/index.js.map +0 -0
  249. /package/{dist-esm/src → dist/browser}/generated/src/models/mappers.js +0 -0
  250. /package/{dist-esm/src → dist/browser}/generated/src/models/mappers.js.map +0 -0
  251. /package/{dist-esm/src → dist/browser}/generated/src/operationsInterfaces/communicationIdentityOperations.js +0 -0
  252. /package/{dist-esm/src → dist/browser}/generated/src/tracing.js +0 -0
  253. /package/{dist-esm/src → dist/browser}/generated/src/tracing.js.map +0 -0
  254. /package/{dist-esm/src → dist/browser}/models.js +0 -0
  255. /package/{dist-esm/src → dist/browser}/models.js.map +0 -0
package/dist/index.js DELETED
@@ -1,684 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var communicationCommon = require('@azure/communication-common');
6
- var coreAuth = require('@azure/core-auth');
7
- var coreClient = require('@azure/core-client');
8
- var coreTracing = require('@azure/core-tracing');
9
- var logger$1 = require('@azure/logger');
10
-
11
- function _interopNamespaceDefault(e) {
12
- var n = Object.create(null);
13
- if (e) {
14
- Object.keys(e).forEach(function (k) {
15
- if (k !== 'default') {
16
- var d = Object.getOwnPropertyDescriptor(e, k);
17
- Object.defineProperty(n, k, d.get ? d : {
18
- enumerable: true,
19
- get: function () { return e[k]; }
20
- });
21
- }
22
- });
23
- }
24
- n.default = e;
25
- return Object.freeze(n);
26
- }
27
-
28
- var coreClient__namespace = /*#__PURE__*/_interopNamespaceDefault(coreClient);
29
-
30
- /*
31
- * Copyright (c) Microsoft Corporation.
32
- * Licensed under the MIT License.
33
- *
34
- * Code generated by Microsoft (R) AutoRest Code Generator.
35
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
36
- */
37
- const tracingClient = coreTracing.createTracingClient({
38
- namespace: "Microsoft.Communication",
39
- packageName: "@azure/communication-identity",
40
- packageVersion: "1.3.2"
41
- });
42
-
43
- /*
44
- * Copyright (c) Microsoft Corporation.
45
- * Licensed under the MIT License.
46
- *
47
- * Code generated by Microsoft (R) AutoRest Code Generator.
48
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
49
- */
50
- const CommunicationIdentityCreateRequest = {
51
- type: {
52
- name: "Composite",
53
- className: "CommunicationIdentityCreateRequest",
54
- modelProperties: {
55
- createTokenWithScopes: {
56
- serializedName: "createTokenWithScopes",
57
- type: {
58
- name: "Sequence",
59
- element: {
60
- type: {
61
- name: "String"
62
- }
63
- }
64
- }
65
- },
66
- expiresInMinutes: {
67
- defaultValue: 1440,
68
- constraints: {
69
- InclusiveMaximum: 1440,
70
- InclusiveMinimum: 60
71
- },
72
- serializedName: "expiresInMinutes",
73
- type: {
74
- name: "Number"
75
- }
76
- }
77
- }
78
- }
79
- };
80
- const CommunicationIdentityAccessTokenResult = {
81
- type: {
82
- name: "Composite",
83
- className: "CommunicationIdentityAccessTokenResult",
84
- modelProperties: {
85
- identity: {
86
- serializedName: "identity",
87
- type: {
88
- name: "Composite",
89
- className: "CommunicationIdentity"
90
- }
91
- },
92
- accessToken: {
93
- serializedName: "accessToken",
94
- type: {
95
- name: "Composite",
96
- className: "CommunicationIdentityAccessToken"
97
- }
98
- }
99
- }
100
- }
101
- };
102
- const CommunicationIdentity = {
103
- type: {
104
- name: "Composite",
105
- className: "CommunicationIdentity",
106
- modelProperties: {
107
- id: {
108
- serializedName: "id",
109
- required: true,
110
- type: {
111
- name: "String"
112
- }
113
- }
114
- }
115
- }
116
- };
117
- const CommunicationIdentityAccessToken = {
118
- type: {
119
- name: "Composite",
120
- className: "CommunicationIdentityAccessToken",
121
- modelProperties: {
122
- token: {
123
- serializedName: "token",
124
- required: true,
125
- type: {
126
- name: "String"
127
- }
128
- },
129
- expiresOn: {
130
- serializedName: "expiresOn",
131
- required: true,
132
- type: {
133
- name: "DateTime"
134
- }
135
- }
136
- }
137
- }
138
- };
139
- const CommunicationErrorResponse = {
140
- type: {
141
- name: "Composite",
142
- className: "CommunicationErrorResponse",
143
- modelProperties: {
144
- error: {
145
- serializedName: "error",
146
- type: {
147
- name: "Composite",
148
- className: "CommunicationError"
149
- }
150
- }
151
- }
152
- }
153
- };
154
- const CommunicationError = {
155
- type: {
156
- name: "Composite",
157
- className: "CommunicationError",
158
- modelProperties: {
159
- code: {
160
- serializedName: "code",
161
- required: true,
162
- type: {
163
- name: "String"
164
- }
165
- },
166
- message: {
167
- serializedName: "message",
168
- required: true,
169
- type: {
170
- name: "String"
171
- }
172
- },
173
- target: {
174
- serializedName: "target",
175
- readOnly: true,
176
- type: {
177
- name: "String"
178
- }
179
- },
180
- details: {
181
- serializedName: "details",
182
- readOnly: true,
183
- type: {
184
- name: "Sequence",
185
- element: {
186
- type: {
187
- name: "Composite",
188
- className: "CommunicationError"
189
- }
190
- }
191
- }
192
- },
193
- innerError: {
194
- serializedName: "innererror",
195
- type: {
196
- name: "Composite",
197
- className: "CommunicationError"
198
- }
199
- }
200
- }
201
- }
202
- };
203
- const TeamsUserExchangeTokenRequest = {
204
- type: {
205
- name: "Composite",
206
- className: "TeamsUserExchangeTokenRequest",
207
- modelProperties: {
208
- token: {
209
- serializedName: "token",
210
- required: true,
211
- type: {
212
- name: "String"
213
- }
214
- },
215
- appId: {
216
- serializedName: "appId",
217
- required: true,
218
- type: {
219
- name: "String"
220
- }
221
- },
222
- userId: {
223
- serializedName: "userId",
224
- required: true,
225
- type: {
226
- name: "String"
227
- }
228
- }
229
- }
230
- }
231
- };
232
- const CommunicationIdentityAccessTokenRequest = {
233
- type: {
234
- name: "Composite",
235
- className: "CommunicationIdentityAccessTokenRequest",
236
- modelProperties: {
237
- scopes: {
238
- serializedName: "scopes",
239
- required: true,
240
- type: {
241
- name: "Sequence",
242
- element: {
243
- type: {
244
- name: "String"
245
- }
246
- }
247
- }
248
- },
249
- expiresInMinutes: {
250
- defaultValue: 1440,
251
- constraints: {
252
- InclusiveMaximum: 1440,
253
- InclusiveMinimum: 60
254
- },
255
- serializedName: "expiresInMinutes",
256
- type: {
257
- name: "Number"
258
- }
259
- }
260
- }
261
- }
262
- };
263
-
264
- var Mappers = /*#__PURE__*/Object.freeze({
265
- __proto__: null,
266
- CommunicationError: CommunicationError,
267
- CommunicationErrorResponse: CommunicationErrorResponse,
268
- CommunicationIdentity: CommunicationIdentity,
269
- CommunicationIdentityAccessToken: CommunicationIdentityAccessToken,
270
- CommunicationIdentityAccessTokenRequest: CommunicationIdentityAccessTokenRequest,
271
- CommunicationIdentityAccessTokenResult: CommunicationIdentityAccessTokenResult,
272
- CommunicationIdentityCreateRequest: CommunicationIdentityCreateRequest,
273
- TeamsUserExchangeTokenRequest: TeamsUserExchangeTokenRequest
274
- });
275
-
276
- /*
277
- * Copyright (c) Microsoft Corporation.
278
- * Licensed under the MIT License.
279
- *
280
- * Code generated by Microsoft (R) AutoRest Code Generator.
281
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
282
- */
283
- const contentType = {
284
- parameterPath: ["options", "contentType"],
285
- mapper: {
286
- defaultValue: "application/json",
287
- isConstant: true,
288
- serializedName: "Content-Type",
289
- type: {
290
- name: "String"
291
- }
292
- }
293
- };
294
- const accept = {
295
- parameterPath: "accept",
296
- mapper: {
297
- defaultValue: "application/json",
298
- isConstant: true,
299
- serializedName: "Accept",
300
- type: {
301
- name: "String"
302
- }
303
- }
304
- };
305
- const endpoint = {
306
- parameterPath: "endpoint",
307
- mapper: {
308
- serializedName: "endpoint",
309
- required: true,
310
- type: {
311
- name: "String"
312
- }
313
- },
314
- skipEncoding: true
315
- };
316
- const apiVersion = {
317
- parameterPath: "apiVersion",
318
- mapper: {
319
- defaultValue: "2023-10-01",
320
- isConstant: true,
321
- serializedName: "api-version",
322
- type: {
323
- name: "String"
324
- }
325
- }
326
- };
327
- const id = {
328
- parameterPath: "id",
329
- mapper: {
330
- serializedName: "id",
331
- required: true,
332
- type: {
333
- name: "String"
334
- }
335
- }
336
- };
337
-
338
- /*
339
- * Copyright (c) Microsoft Corporation.
340
- * Licensed under the MIT License.
341
- *
342
- * Code generated by Microsoft (R) AutoRest Code Generator.
343
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
344
- */
345
- /** Class containing CommunicationIdentityOperations operations. */
346
- class CommunicationIdentityOperationsImpl {
347
- /**
348
- * Initialize a new instance of the class CommunicationIdentityOperations class.
349
- * @param client Reference to the service client
350
- */
351
- constructor(client) {
352
- this.client = client;
353
- }
354
- /**
355
- * Create a new identity, and optionally, an access token.
356
- * @param options The options parameters.
357
- */
358
- async create(options) {
359
- return tracingClient.withSpan("IdentityRestClient.create", options !== null && options !== void 0 ? options : {}, async (options) => {
360
- return this.client.sendOperationRequest({ options }, createOperationSpec);
361
- });
362
- }
363
- /**
364
- * Delete the identity, revoke all tokens for the identity and delete all associated data.
365
- * @param id Identifier of the identity to be deleted.
366
- * @param options The options parameters.
367
- */
368
- async delete(id, options) {
369
- return tracingClient.withSpan("IdentityRestClient.delete", options !== null && options !== void 0 ? options : {}, async (options) => {
370
- return this.client.sendOperationRequest({ id, options }, deleteOperationSpec);
371
- });
372
- }
373
- /**
374
- * Revoke all access tokens for the specific identity.
375
- * @param id Identifier of the identity.
376
- * @param options The options parameters.
377
- */
378
- async revokeAccessTokens(id, options) {
379
- return tracingClient.withSpan("IdentityRestClient.revokeAccessTokens", options !== null && options !== void 0 ? options : {}, async (options) => {
380
- return this.client.sendOperationRequest({ id, options }, revokeAccessTokensOperationSpec);
381
- });
382
- }
383
- /**
384
- * Exchange an Azure Active Directory (Azure AD) access token of a Teams user for a new Communication
385
- * Identity access token with a matching expiration time.
386
- * @param token Azure AD access token of a Teams User to acquire a new Communication Identity access
387
- * token.
388
- * @param appId Client ID of an Azure AD application to be verified against the appid claim in the
389
- * Azure AD access token.
390
- * @param userId Object ID of an Azure AD user (Teams User) to be verified against the oid claim in the
391
- * Azure AD access token.
392
- * @param options The options parameters.
393
- */
394
- async exchangeTeamsUserAccessToken(token, appId, userId, options) {
395
- return tracingClient.withSpan("IdentityRestClient.exchangeTeamsUserAccessToken", options !== null && options !== void 0 ? options : {}, async (options) => {
396
- return this.client.sendOperationRequest({ token, appId, userId, options }, exchangeTeamsUserAccessTokenOperationSpec);
397
- });
398
- }
399
- /**
400
- * Issue a new token for an identity.
401
- * @param id Identifier of the identity to issue token for.
402
- * @param scopes List of scopes attached to the token.
403
- * @param options The options parameters.
404
- */
405
- async issueAccessToken(id, scopes, options) {
406
- return tracingClient.withSpan("IdentityRestClient.issueAccessToken", options !== null && options !== void 0 ? options : {}, async (options) => {
407
- return this.client.sendOperationRequest({ id, scopes, options }, issueAccessTokenOperationSpec);
408
- });
409
- }
410
- }
411
- // Operation Specifications
412
- const serializer = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
413
- const createOperationSpec = {
414
- path: "/identities",
415
- httpMethod: "POST",
416
- responses: {
417
- 201: {
418
- bodyMapper: CommunicationIdentityAccessTokenResult
419
- },
420
- default: {
421
- bodyMapper: CommunicationErrorResponse
422
- }
423
- },
424
- requestBody: {
425
- parameterPath: {
426
- createTokenWithScopes: ["options", "createTokenWithScopes"],
427
- expiresInMinutes: ["options", "expiresInMinutes"]
428
- },
429
- mapper: CommunicationIdentityCreateRequest
430
- },
431
- queryParameters: [apiVersion],
432
- urlParameters: [endpoint],
433
- headerParameters: [contentType, accept],
434
- mediaType: "json",
435
- serializer
436
- };
437
- const deleteOperationSpec = {
438
- path: "/identities/{id}",
439
- httpMethod: "DELETE",
440
- responses: {
441
- 204: {},
442
- default: {
443
- bodyMapper: CommunicationErrorResponse
444
- }
445
- },
446
- queryParameters: [apiVersion],
447
- urlParameters: [endpoint, id],
448
- headerParameters: [accept],
449
- serializer
450
- };
451
- const revokeAccessTokensOperationSpec = {
452
- path: "/identities/{id}/:revokeAccessTokens",
453
- httpMethod: "POST",
454
- responses: {
455
- 204: {},
456
- default: {
457
- bodyMapper: CommunicationErrorResponse
458
- }
459
- },
460
- queryParameters: [apiVersion],
461
- urlParameters: [endpoint, id],
462
- headerParameters: [accept],
463
- serializer
464
- };
465
- const exchangeTeamsUserAccessTokenOperationSpec = {
466
- path: "/teamsUser/:exchangeAccessToken",
467
- httpMethod: "POST",
468
- responses: {
469
- 200: {
470
- bodyMapper: CommunicationIdentityAccessToken
471
- },
472
- default: {
473
- bodyMapper: CommunicationErrorResponse
474
- }
475
- },
476
- requestBody: {
477
- parameterPath: { token: ["token"], appId: ["appId"], userId: ["userId"] },
478
- mapper: Object.assign(Object.assign({}, TeamsUserExchangeTokenRequest), { required: true })
479
- },
480
- queryParameters: [apiVersion],
481
- urlParameters: [endpoint],
482
- headerParameters: [contentType, accept],
483
- mediaType: "json",
484
- serializer
485
- };
486
- const issueAccessTokenOperationSpec = {
487
- path: "/identities/{id}/:issueAccessToken",
488
- httpMethod: "POST",
489
- responses: {
490
- 200: {
491
- bodyMapper: CommunicationIdentityAccessToken
492
- },
493
- default: {
494
- bodyMapper: CommunicationErrorResponse
495
- }
496
- },
497
- requestBody: {
498
- parameterPath: {
499
- scopes: ["scopes"],
500
- expiresInMinutes: ["options", "expiresInMinutes"]
501
- },
502
- mapper: Object.assign(Object.assign({}, CommunicationIdentityAccessTokenRequest), { required: true })
503
- },
504
- queryParameters: [apiVersion],
505
- urlParameters: [endpoint, id],
506
- headerParameters: [contentType, accept],
507
- mediaType: "json",
508
- serializer
509
- };
510
-
511
- /*
512
- * Copyright (c) Microsoft Corporation.
513
- * Licensed under the MIT License.
514
- *
515
- * Code generated by Microsoft (R) AutoRest Code Generator.
516
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
517
- */
518
- class IdentityRestClient extends coreClient__namespace.ServiceClient {
519
- /**
520
- * Initializes a new instance of the IdentityRestClient class.
521
- * @param endpoint The communication resource, for example https://my-resource.communication.azure.com
522
- * @param options The parameter options
523
- */
524
- constructor(endpoint, options) {
525
- var _a, _b;
526
- if (endpoint === undefined) {
527
- throw new Error("'endpoint' cannot be null");
528
- }
529
- // Initializing default values for options
530
- if (!options) {
531
- options = {};
532
- }
533
- const defaults = {
534
- requestContentType: "application/json; charset=utf-8"
535
- };
536
- const packageDetails = `azsdk-js-communication-identity/1.3.2`;
537
- const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
538
- ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
539
- : `${packageDetails}`;
540
- const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
541
- userAgentPrefix
542
- }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{endpoint}" });
543
- super(optionsWithDefaults);
544
- // Parameter assignments
545
- this.endpoint = endpoint;
546
- // Assigning values to Constant parameters
547
- this.apiVersion = options.apiVersion || "2023-10-01";
548
- this.communicationIdentityOperations = new CommunicationIdentityOperationsImpl(this);
549
- this.addCustomApiVersionPolicy(options.apiVersion);
550
- }
551
- /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
552
- addCustomApiVersionPolicy(apiVersion) {
553
- if (!apiVersion) {
554
- return;
555
- }
556
- const apiVersionPolicy = {
557
- name: "CustomApiVersionPolicy",
558
- async sendRequest(request, next) {
559
- const param = request.url.split("?");
560
- if (param.length > 1) {
561
- const newParams = param[1].split("&").map((item) => {
562
- if (item.indexOf("api-version") > -1) {
563
- return "api-version=" + apiVersion;
564
- }
565
- else {
566
- return item;
567
- }
568
- });
569
- request.url = param[0] + "?" + newParams.join("&");
570
- }
571
- return next(request);
572
- }
573
- };
574
- this.pipeline.addPolicy(apiVersionPolicy);
575
- }
576
- }
577
-
578
- // Copyright (c) Microsoft Corporation.
579
- // Licensed under the MIT License.
580
- /**
581
- * The \@azure/logger configuration for this package.
582
- */
583
- const logger = logger$1.createClientLogger("communication-identity");
584
-
585
- // Copyright (c) Microsoft Corporation.
586
- // Licensed under the MIT License.
587
- const isCommunicationIdentityClientOptions = (options) => options && !coreAuth.isTokenCredential(options) && !communicationCommon.isKeyCredential(options);
588
- /**
589
- * Client class for interacting with Azure Communication Services User Token Management.
590
- */
591
- class CommunicationIdentityClient {
592
- constructor(connectionStringOrEndpoint, credentialOrOptions, maybeOptions = {}) {
593
- const { url, credential } = communicationCommon.parseClientArguments(connectionStringOrEndpoint, credentialOrOptions);
594
- const options = isCommunicationIdentityClientOptions(credentialOrOptions)
595
- ? credentialOrOptions
596
- : maybeOptions;
597
- const internalPipelineOptions = Object.assign(Object.assign({}, options), {
598
- loggingOptions: {
599
- logger: logger.info,
600
- },
601
- });
602
- this.client = new IdentityRestClient(url, Object.assign({ endpoint: url }, internalPipelineOptions));
603
- const authPolicy = communicationCommon.createCommunicationAuthPolicy(credential);
604
- this.client.pipeline.addPolicy(authPolicy);
605
- }
606
- /**
607
- * Creates a scoped user token.
608
- *
609
- * @param user - The user whose tokens are being issued.
610
- * @param scopes - Scopes to include in the token.
611
- * @param options - Additional options for the request.
612
- */
613
- getToken(user, scopes, options = {}) {
614
- return tracingClient.withSpan("CommunicationIdentity-issueToken", options, (updatedOptions) => {
615
- return this.client.communicationIdentityOperations.issueAccessToken(user.communicationUserId, scopes, Object.assign({ expiresInMinutes: options.tokenExpiresInMinutes }, updatedOptions));
616
- });
617
- }
618
- /**
619
- * Revokes all data and tokens created for a user.
620
- *
621
- * @param user - The user whose tokens are being revoked.
622
- * @param options - Additional options for the request.
623
- */
624
- revokeTokens(user,
625
- // eslint-disable-next-line @azure/azure-sdk/ts-naming-options
626
- options = {}) {
627
- return tracingClient.withSpan("CommunicationIdentity-revokeTokens", options, async (updatedOptions) => {
628
- await this.client.communicationIdentityOperations.revokeAccessTokens(user.communicationUserId, updatedOptions);
629
- });
630
- }
631
- /**
632
- * Creates a single user.
633
- *
634
- * @param options - Additional options for the request.
635
- */
636
- // eslint-disable-next-line @azure/azure-sdk/ts-naming-options
637
- createUser(options = {}) {
638
- return tracingClient.withSpan("CommunicationIdentity-createUser", options, async (updatedOptions) => {
639
- const result = await this.client.communicationIdentityOperations.create(Object.assign({ expiresInMinutes: undefined }, updatedOptions));
640
- return {
641
- communicationUserId: result.identity.id,
642
- };
643
- });
644
- }
645
- /**
646
- * Creates a single user and a token simultaneously.
647
- *
648
- * @param scopes - Scopes to include in the token.
649
- * @param options - Additional options for the request.
650
- */
651
- createUserAndToken(scopes, options = {}) {
652
- return tracingClient.withSpan("CommunicationIdentity-createUserAndToken", options, async (updatedOptions) => {
653
- const { identity, accessToken } = await this.client.communicationIdentityOperations.create(Object.assign({ createTokenWithScopes: scopes, expiresInMinutes: options.tokenExpiresInMinutes }, updatedOptions));
654
- return Object.assign(Object.assign({}, accessToken), { user: { communicationUserId: identity.id } });
655
- });
656
- }
657
- /**
658
- * Triggers revocation event for user and deletes all its data.
659
- *
660
- * @param user - The user being deleted.
661
- * @param options - Additional options for the request.
662
- */
663
- deleteUser(user,
664
- // eslint-disable-next-line @azure/azure-sdk/ts-naming-options
665
- options = {}) {
666
- return tracingClient.withSpan("CommunicationIdentity-deleteUser", options, async (updatedOptions) => {
667
- await this.client.communicationIdentityOperations.delete(user.communicationUserId, updatedOptions);
668
- });
669
- }
670
- /**
671
- * Exchanges an Azure AD access token of a Teams user for a new Communication Identity access token with a matching expiration time.
672
- *
673
- * @param options - Options used to exchange an Azure AD access token of a Teams user for a new Communication Identity access token.
674
- */
675
- getTokenForTeamsUser(options) {
676
- return tracingClient.withSpan("CommunicationIdentity-getTokenForTeamsUser", options, (updatedOptions) => {
677
- const { teamsUserAadToken, clientId, userObjectId } = updatedOptions;
678
- return this.client.communicationIdentityOperations.exchangeTeamsUserAccessToken(teamsUserAadToken, clientId, userObjectId, updatedOptions);
679
- });
680
- }
681
- }
682
-
683
- exports.CommunicationIdentityClient = CommunicationIdentityClient;
684
- //# sourceMappingURL=index.js.map