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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (256) hide show
  1. package/dist/index.js +684 -0
  2. package/dist/index.js.map +1 -0
  3. package/{dist/esm → dist-esm/src}/communicationIdentityClient.js +3 -3
  4. package/dist-esm/src/communicationIdentityClient.js.map +1 -0
  5. package/{dist/esm → dist-esm/src}/generated/src/identityRestClient.js +1 -1
  6. package/dist-esm/src/generated/src/identityRestClient.js.map +1 -0
  7. package/{dist/esm/generated/src/operations → dist-esm/src/generated/src}/index.js +3 -1
  8. package/dist-esm/src/generated/src/index.js.map +1 -0
  9. package/{dist/esm → dist-esm/src}/generated/src/models/parameters.js +1 -1
  10. package/dist-esm/src/generated/src/models/parameters.js.map +1 -0
  11. package/{dist/browser → dist-esm/src}/generated/src/operations/communicationIdentityOperations.js +3 -3
  12. package/dist-esm/src/generated/src/operations/communicationIdentityOperations.js.map +1 -0
  13. package/{dist/esm/generated/src/operationsInterfaces/communicationIdentityOperations.js → dist-esm/src/generated/src/operations/index.js} +2 -2
  14. package/{dist/esm → dist-esm/src}/generated/src/operations/index.js.map +1 -1
  15. package/dist-esm/src/generated/src/operationsInterfaces/communicationIdentityOperations.js.map +1 -0
  16. package/{dist/react-native/generated/src/operationsInterfaces/communicationIdentityOperations.js → dist-esm/src/generated/src/operationsInterfaces/index.js} +2 -2
  17. package/{dist/react-native → dist-esm/src}/generated/src/operationsInterfaces/index.js.map +1 -1
  18. package/dist-esm/src/index.js +5 -0
  19. package/{dist/react-native → dist-esm/src}/index.js.map +1 -1
  20. package/package.json +48 -68
  21. package/dist/browser/common/logger.d.ts +0 -5
  22. package/dist/browser/common/logger.d.ts.map +0 -1
  23. package/dist/browser/communicationIdentityClient.d.ts +0 -76
  24. package/dist/browser/communicationIdentityClient.d.ts.map +0 -1
  25. package/dist/browser/communicationIdentityClient.js +0 -103
  26. package/dist/browser/communicationIdentityClient.js.map +0 -1
  27. package/dist/browser/constants.d.ts +0 -2
  28. package/dist/browser/constants.d.ts.map +0 -1
  29. package/dist/browser/generated/src/identityRestClient.d.ts +0 -17
  30. package/dist/browser/generated/src/identityRestClient.d.ts.map +0 -1
  31. package/dist/browser/generated/src/identityRestClient.js +0 -69
  32. package/dist/browser/generated/src/identityRestClient.js.map +0 -1
  33. package/dist/browser/generated/src/index.d.ts +0 -4
  34. package/dist/browser/generated/src/index.d.ts.map +0 -1
  35. package/dist/browser/generated/src/index.js +0 -11
  36. package/dist/browser/generated/src/index.js.map +0 -1
  37. package/dist/browser/generated/src/models/index.d.ts +0 -127
  38. package/dist/browser/generated/src/models/index.d.ts.map +0 -1
  39. package/dist/browser/generated/src/models/mappers.d.ts +0 -10
  40. package/dist/browser/generated/src/models/mappers.d.ts.map +0 -1
  41. package/dist/browser/generated/src/models/parameters.d.ts +0 -14
  42. package/dist/browser/generated/src/models/parameters.d.ts.map +0 -1
  43. package/dist/browser/generated/src/models/parameters.js +0 -91
  44. package/dist/browser/generated/src/models/parameters.js.map +0 -1
  45. package/dist/browser/generated/src/operations/communicationIdentityOperations.d.ts +0 -49
  46. package/dist/browser/generated/src/operations/communicationIdentityOperations.d.ts.map +0 -1
  47. package/dist/browser/generated/src/operations/communicationIdentityOperations.js.map +0 -1
  48. package/dist/browser/generated/src/operations/index.d.ts +0 -2
  49. package/dist/browser/generated/src/operations/index.d.ts.map +0 -1
  50. package/dist/browser/generated/src/operations/index.js +0 -9
  51. package/dist/browser/generated/src/operations/index.js.map +0 -1
  52. package/dist/browser/generated/src/operationsInterfaces/communicationIdentityOperations.d.ts +0 -41
  53. package/dist/browser/generated/src/operationsInterfaces/communicationIdentityOperations.d.ts.map +0 -1
  54. package/dist/browser/generated/src/operationsInterfaces/communicationIdentityOperations.js.map +0 -1
  55. package/dist/browser/generated/src/operationsInterfaces/index.d.ts +0 -2
  56. package/dist/browser/generated/src/operationsInterfaces/index.d.ts.map +0 -1
  57. package/dist/browser/generated/src/operationsInterfaces/index.js +0 -9
  58. package/dist/browser/generated/src/operationsInterfaces/index.js.map +0 -1
  59. package/dist/browser/generated/src/tracing.d.ts +0 -2
  60. package/dist/browser/generated/src/tracing.d.ts.map +0 -1
  61. package/dist/browser/index.d.ts +0 -3
  62. package/dist/browser/index.d.ts.map +0 -1
  63. package/dist/browser/index.js +0 -5
  64. package/dist/browser/index.js.map +0 -1
  65. package/dist/browser/models.d.ts +0 -65
  66. package/dist/browser/models.d.ts.map +0 -1
  67. package/dist/browser/package.json +0 -3
  68. package/dist/commonjs/common/logger.d.ts +0 -5
  69. package/dist/commonjs/common/logger.d.ts.map +0 -1
  70. package/dist/commonjs/common/logger.js +0 -11
  71. package/dist/commonjs/common/logger.js.map +0 -1
  72. package/dist/commonjs/communicationIdentityClient.d.ts +0 -76
  73. package/dist/commonjs/communicationIdentityClient.d.ts.map +0 -1
  74. package/dist/commonjs/communicationIdentityClient.js +0 -107
  75. package/dist/commonjs/communicationIdentityClient.js.map +0 -1
  76. package/dist/commonjs/constants.d.ts +0 -2
  77. package/dist/commonjs/constants.d.ts.map +0 -1
  78. package/dist/commonjs/constants.js +0 -7
  79. package/dist/commonjs/constants.js.map +0 -1
  80. package/dist/commonjs/generated/src/identityRestClient.d.ts +0 -17
  81. package/dist/commonjs/generated/src/identityRestClient.d.ts.map +0 -1
  82. package/dist/commonjs/generated/src/identityRestClient.js +0 -74
  83. package/dist/commonjs/generated/src/identityRestClient.js.map +0 -1
  84. package/dist/commonjs/generated/src/index.d.ts +0 -4
  85. package/dist/commonjs/generated/src/index.d.ts.map +0 -1
  86. package/dist/commonjs/generated/src/index.js +0 -16
  87. package/dist/commonjs/generated/src/index.js.map +0 -1
  88. package/dist/commonjs/generated/src/models/index.d.ts +0 -127
  89. package/dist/commonjs/generated/src/models/index.d.ts.map +0 -1
  90. package/dist/commonjs/generated/src/models/index.js +0 -25
  91. package/dist/commonjs/generated/src/models/index.js.map +0 -1
  92. package/dist/commonjs/generated/src/models/mappers.d.ts +0 -10
  93. package/dist/commonjs/generated/src/models/mappers.d.ts.map +0 -1
  94. package/dist/commonjs/generated/src/models/mappers.js +0 -224
  95. package/dist/commonjs/generated/src/models/mappers.js.map +0 -1
  96. package/dist/commonjs/generated/src/models/parameters.d.ts +0 -14
  97. package/dist/commonjs/generated/src/models/parameters.d.ts.map +0 -1
  98. package/dist/commonjs/generated/src/models/parameters.js +0 -94
  99. package/dist/commonjs/generated/src/models/parameters.js.map +0 -1
  100. package/dist/commonjs/generated/src/operations/communicationIdentityOperations.d.ts +0 -49
  101. package/dist/commonjs/generated/src/operations/communicationIdentityOperations.d.ts.map +0 -1
  102. package/dist/commonjs/generated/src/operations/communicationIdentityOperations.js +0 -182
  103. package/dist/commonjs/generated/src/operations/communicationIdentityOperations.js.map +0 -1
  104. package/dist/commonjs/generated/src/operations/index.d.ts +0 -2
  105. package/dist/commonjs/generated/src/operations/index.d.ts.map +0 -1
  106. package/dist/commonjs/generated/src/operations/index.js +0 -12
  107. package/dist/commonjs/generated/src/operations/index.js.map +0 -1
  108. package/dist/commonjs/generated/src/operationsInterfaces/communicationIdentityOperations.d.ts +0 -41
  109. package/dist/commonjs/generated/src/operationsInterfaces/communicationIdentityOperations.d.ts.map +0 -1
  110. package/dist/commonjs/generated/src/operationsInterfaces/communicationIdentityOperations.js +0 -10
  111. package/dist/commonjs/generated/src/operationsInterfaces/communicationIdentityOperations.js.map +0 -1
  112. package/dist/commonjs/generated/src/operationsInterfaces/index.d.ts +0 -2
  113. package/dist/commonjs/generated/src/operationsInterfaces/index.d.ts.map +0 -1
  114. package/dist/commonjs/generated/src/operationsInterfaces/index.js +0 -12
  115. package/dist/commonjs/generated/src/operationsInterfaces/index.js.map +0 -1
  116. package/dist/commonjs/generated/src/tracing.d.ts +0 -2
  117. package/dist/commonjs/generated/src/tracing.d.ts.map +0 -1
  118. package/dist/commonjs/generated/src/tracing.js +0 -17
  119. package/dist/commonjs/generated/src/tracing.js.map +0 -1
  120. package/dist/commonjs/index.d.ts +0 -3
  121. package/dist/commonjs/index.d.ts.map +0 -1
  122. package/dist/commonjs/index.js +0 -8
  123. package/dist/commonjs/index.js.map +0 -1
  124. package/dist/commonjs/models.d.ts +0 -65
  125. package/dist/commonjs/models.d.ts.map +0 -1
  126. package/dist/commonjs/models.js +0 -5
  127. package/dist/commonjs/models.js.map +0 -1
  128. package/dist/commonjs/package.json +0 -3
  129. package/dist/commonjs/tsdoc-metadata.json +0 -11
  130. package/dist/esm/common/logger.d.ts +0 -5
  131. package/dist/esm/common/logger.d.ts.map +0 -1
  132. package/dist/esm/common/logger.js +0 -8
  133. package/dist/esm/common/logger.js.map +0 -1
  134. package/dist/esm/communicationIdentityClient.d.ts +0 -76
  135. package/dist/esm/communicationIdentityClient.d.ts.map +0 -1
  136. package/dist/esm/communicationIdentityClient.js.map +0 -1
  137. package/dist/esm/constants.d.ts +0 -2
  138. package/dist/esm/constants.d.ts.map +0 -1
  139. package/dist/esm/constants.js +0 -4
  140. package/dist/esm/constants.js.map +0 -1
  141. package/dist/esm/generated/src/identityRestClient.d.ts +0 -17
  142. package/dist/esm/generated/src/identityRestClient.d.ts.map +0 -1
  143. package/dist/esm/generated/src/identityRestClient.js.map +0 -1
  144. package/dist/esm/generated/src/index.d.ts +0 -4
  145. package/dist/esm/generated/src/index.d.ts.map +0 -1
  146. package/dist/esm/generated/src/index.js +0 -11
  147. package/dist/esm/generated/src/index.js.map +0 -1
  148. package/dist/esm/generated/src/models/index.d.ts +0 -127
  149. package/dist/esm/generated/src/models/index.d.ts.map +0 -1
  150. package/dist/esm/generated/src/models/index.js +0 -22
  151. package/dist/esm/generated/src/models/index.js.map +0 -1
  152. package/dist/esm/generated/src/models/mappers.d.ts +0 -10
  153. package/dist/esm/generated/src/models/mappers.d.ts.map +0 -1
  154. package/dist/esm/generated/src/models/mappers.js +0 -221
  155. package/dist/esm/generated/src/models/mappers.js.map +0 -1
  156. package/dist/esm/generated/src/models/parameters.d.ts +0 -14
  157. package/dist/esm/generated/src/models/parameters.d.ts.map +0 -1
  158. package/dist/esm/generated/src/models/parameters.js.map +0 -1
  159. package/dist/esm/generated/src/operations/communicationIdentityOperations.d.ts +0 -49
  160. package/dist/esm/generated/src/operations/communicationIdentityOperations.d.ts.map +0 -1
  161. package/dist/esm/generated/src/operations/communicationIdentityOperations.js +0 -177
  162. package/dist/esm/generated/src/operations/communicationIdentityOperations.js.map +0 -1
  163. package/dist/esm/generated/src/operations/index.d.ts +0 -2
  164. package/dist/esm/generated/src/operations/index.d.ts.map +0 -1
  165. package/dist/esm/generated/src/operationsInterfaces/communicationIdentityOperations.d.ts +0 -41
  166. package/dist/esm/generated/src/operationsInterfaces/communicationIdentityOperations.d.ts.map +0 -1
  167. package/dist/esm/generated/src/operationsInterfaces/communicationIdentityOperations.js.map +0 -1
  168. package/dist/esm/generated/src/operationsInterfaces/index.d.ts +0 -2
  169. package/dist/esm/generated/src/operationsInterfaces/index.d.ts.map +0 -1
  170. package/dist/esm/generated/src/operationsInterfaces/index.js +0 -9
  171. package/dist/esm/generated/src/operationsInterfaces/index.js.map +0 -1
  172. package/dist/esm/generated/src/tracing.d.ts +0 -2
  173. package/dist/esm/generated/src/tracing.d.ts.map +0 -1
  174. package/dist/esm/generated/src/tracing.js +0 -14
  175. package/dist/esm/generated/src/tracing.js.map +0 -1
  176. package/dist/esm/index.d.ts +0 -3
  177. package/dist/esm/index.d.ts.map +0 -1
  178. package/dist/esm/index.js +0 -5
  179. package/dist/esm/index.js.map +0 -1
  180. package/dist/esm/models.d.ts +0 -65
  181. package/dist/esm/models.d.ts.map +0 -1
  182. package/dist/esm/models.js +0 -4
  183. package/dist/esm/models.js.map +0 -1
  184. package/dist/esm/package.json +0 -3
  185. package/dist/react-native/common/logger.d.ts +0 -5
  186. package/dist/react-native/common/logger.d.ts.map +0 -1
  187. package/dist/react-native/common/logger.js +0 -8
  188. package/dist/react-native/common/logger.js.map +0 -1
  189. package/dist/react-native/communicationIdentityClient.d.ts +0 -76
  190. package/dist/react-native/communicationIdentityClient.d.ts.map +0 -1
  191. package/dist/react-native/communicationIdentityClient.js +0 -103
  192. package/dist/react-native/communicationIdentityClient.js.map +0 -1
  193. package/dist/react-native/constants.d.ts +0 -2
  194. package/dist/react-native/constants.d.ts.map +0 -1
  195. package/dist/react-native/constants.js +0 -4
  196. package/dist/react-native/constants.js.map +0 -1
  197. package/dist/react-native/generated/src/identityRestClient.d.ts +0 -17
  198. package/dist/react-native/generated/src/identityRestClient.d.ts.map +0 -1
  199. package/dist/react-native/generated/src/identityRestClient.js +0 -69
  200. package/dist/react-native/generated/src/identityRestClient.js.map +0 -1
  201. package/dist/react-native/generated/src/index.d.ts +0 -4
  202. package/dist/react-native/generated/src/index.d.ts.map +0 -1
  203. package/dist/react-native/generated/src/index.js +0 -11
  204. package/dist/react-native/generated/src/index.js.map +0 -1
  205. package/dist/react-native/generated/src/models/index.d.ts +0 -127
  206. package/dist/react-native/generated/src/models/index.d.ts.map +0 -1
  207. package/dist/react-native/generated/src/models/index.js +0 -22
  208. package/dist/react-native/generated/src/models/index.js.map +0 -1
  209. package/dist/react-native/generated/src/models/mappers.d.ts +0 -10
  210. package/dist/react-native/generated/src/models/mappers.d.ts.map +0 -1
  211. package/dist/react-native/generated/src/models/mappers.js +0 -221
  212. package/dist/react-native/generated/src/models/mappers.js.map +0 -1
  213. package/dist/react-native/generated/src/models/parameters.d.ts +0 -14
  214. package/dist/react-native/generated/src/models/parameters.d.ts.map +0 -1
  215. package/dist/react-native/generated/src/models/parameters.js +0 -91
  216. package/dist/react-native/generated/src/models/parameters.js.map +0 -1
  217. package/dist/react-native/generated/src/operations/communicationIdentityOperations.d.ts +0 -49
  218. package/dist/react-native/generated/src/operations/communicationIdentityOperations.d.ts.map +0 -1
  219. package/dist/react-native/generated/src/operations/communicationIdentityOperations.js +0 -177
  220. package/dist/react-native/generated/src/operations/communicationIdentityOperations.js.map +0 -1
  221. package/dist/react-native/generated/src/operations/index.d.ts +0 -2
  222. package/dist/react-native/generated/src/operations/index.d.ts.map +0 -1
  223. package/dist/react-native/generated/src/operations/index.js +0 -9
  224. package/dist/react-native/generated/src/operations/index.js.map +0 -1
  225. package/dist/react-native/generated/src/operationsInterfaces/communicationIdentityOperations.d.ts +0 -41
  226. package/dist/react-native/generated/src/operationsInterfaces/communicationIdentityOperations.d.ts.map +0 -1
  227. package/dist/react-native/generated/src/operationsInterfaces/communicationIdentityOperations.js.map +0 -1
  228. package/dist/react-native/generated/src/operationsInterfaces/index.d.ts +0 -2
  229. package/dist/react-native/generated/src/operationsInterfaces/index.d.ts.map +0 -1
  230. package/dist/react-native/generated/src/operationsInterfaces/index.js +0 -9
  231. package/dist/react-native/generated/src/tracing.d.ts +0 -2
  232. package/dist/react-native/generated/src/tracing.d.ts.map +0 -1
  233. package/dist/react-native/generated/src/tracing.js +0 -14
  234. package/dist/react-native/generated/src/tracing.js.map +0 -1
  235. package/dist/react-native/index.d.ts +0 -3
  236. package/dist/react-native/index.d.ts.map +0 -1
  237. package/dist/react-native/index.js +0 -5
  238. package/dist/react-native/models.d.ts +0 -65
  239. package/dist/react-native/models.d.ts.map +0 -1
  240. package/dist/react-native/models.js +0 -4
  241. package/dist/react-native/models.js.map +0 -1
  242. package/dist/react-native/package.json +0 -3
  243. /package/{dist/browser → dist-esm/src}/common/logger.js +0 -0
  244. /package/{dist/browser → dist-esm/src}/common/logger.js.map +0 -0
  245. /package/{dist/browser → dist-esm/src}/constants.js +0 -0
  246. /package/{dist/browser → dist-esm/src}/constants.js.map +0 -0
  247. /package/{dist/browser → dist-esm/src}/generated/src/models/index.js +0 -0
  248. /package/{dist/browser → dist-esm/src}/generated/src/models/index.js.map +0 -0
  249. /package/{dist/browser → dist-esm/src}/generated/src/models/mappers.js +0 -0
  250. /package/{dist/browser → dist-esm/src}/generated/src/models/mappers.js.map +0 -0
  251. /package/{dist/browser → dist-esm/src}/generated/src/operationsInterfaces/communicationIdentityOperations.js +0 -0
  252. /package/{dist/browser → dist-esm/src}/generated/src/tracing.js +0 -0
  253. /package/{dist/browser → dist-esm/src}/generated/src/tracing.js.map +0 -0
  254. /package/{dist/browser → dist-esm/src}/models.js +0 -0
  255. /package/{dist/browser → dist-esm/src}/models.js.map +0 -0
  256. /package/{dist → types}/communication-identity.d.ts +0 -0
package/dist/index.js ADDED
@@ -0,0 +1,684 @@
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