@twilio/conversations 3.0.0 → 3.0.1-rc.0

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 (59) hide show
  1. package/README.md +2 -2
  2. package/builds/browser.esm.js +11 -3
  3. package/builds/browser.esm.js.map +1 -1
  4. package/builds/browser.js +11 -3
  5. package/builds/browser.js.map +1 -1
  6. package/builds/lib.esm.js +11 -3
  7. package/builds/lib.js +11 -3
  8. package/builds/lib.js.map +1 -1
  9. package/builds/twilio-conversations.js +65 -1180
  10. package/builds/twilio-conversations.js.map +1 -1
  11. package/builds/twilio-conversations.min.js +1 -1
  12. package/builds/twilio-conversations.min.js.map +1 -1
  13. package/dist/command-executor.js +3 -2
  14. package/dist/command-executor.js.map +1 -1
  15. package/dist/packages/conversations/package.json.js +1 -1
  16. package/dist/utils/uuid.js +145 -0
  17. package/dist/utils/uuid.js.map +1 -0
  18. package/package.json +7 -8
  19. package/docs/assets/css/main.css +0 -2660
  20. package/docs/assets/images/icons.png +0 -0
  21. package/docs/assets/images/icons@2x.png +0 -0
  22. package/docs/assets/images/widgets.png +0 -0
  23. package/docs/assets/images/widgets@2x.png +0 -0
  24. package/docs/assets/js/main.js +0 -248
  25. package/docs/assets/js/search.js +0 -1
  26. package/docs/classes/AggregatedDeliveryReceipt.html +0 -3184
  27. package/docs/classes/CancellablePromise.html +0 -3213
  28. package/docs/classes/ChannelMetadata.html +0 -3050
  29. package/docs/classes/Client.html +0 -4310
  30. package/docs/classes/ContentTemplate.html +0 -3116
  31. package/docs/classes/ContentTemplateVariable.html +0 -3116
  32. package/docs/classes/Conversation.html +0 -4391
  33. package/docs/classes/DetailedDeliveryReceipt.html +0 -3163
  34. package/docs/classes/EmailRecipientDescriptor.html +0 -3098
  35. package/docs/classes/Media.html +0 -3167
  36. package/docs/classes/Message.html +0 -3826
  37. package/docs/classes/MessageBuilder.html +0 -3318
  38. package/docs/classes/Participant.html +0 -3444
  39. package/docs/classes/PushNotification.html +0 -3130
  40. package/docs/classes/RestPaginator.html +0 -3160
  41. package/docs/classes/UnknownRecipientDescriptor.html +0 -3067
  42. package/docs/classes/UnsentMessage.html +0 -3042
  43. package/docs/classes/User.html +0 -3349
  44. package/docs/index.html +0 -4373
  45. package/docs/interfaces/ClientOptions.html +0 -3066
  46. package/docs/interfaces/ConversationBindings.html +0 -3001
  47. package/docs/interfaces/ConversationEmailBinding.html +0 -3001
  48. package/docs/interfaces/ConversationLimits.html +0 -3098
  49. package/docs/interfaces/ConversationState.html +0 -3050
  50. package/docs/interfaces/ConversationUpdatedEventArgs.html +0 -3001
  51. package/docs/interfaces/CreateConversationOptions.html +0 -3083
  52. package/docs/interfaces/LastMessage.html +0 -3050
  53. package/docs/interfaces/Paginator.html +0 -3141
  54. package/docs/interfaces/ParticipantBindings.html +0 -3001
  55. package/docs/interfaces/ParticipantEmailBinding.html +0 -3001
  56. package/docs/interfaces/PushNotificationData.html +0 -3114
  57. package/docs/interfaces/SendEmailOptions.html +0 -3034
  58. package/docs/interfaces/SendMediaOptions.html +0 -3068
  59. package/docs/modules.html +0 -4374
@@ -135,9 +135,10 @@ var global =
135
135
  ? window
136
136
  : {};
137
137
 
138
- import { v4 } from 'uuid';
139
138
  import { AsyncRetrier } from '@twilio/operation-retrier';
139
+ import { randomUUID } from './utils/uuid.js';
140
140
 
141
+ const uuidv4 = randomUUID;
141
142
  const trimSlashes = (url) => url.replace(/(^\/+|\/+$)/g, "");
142
143
  const isMutationConflictResponse = (response) => response.status.code === 202;
143
144
  class ChannelMetadataNotFoundError extends Error {
@@ -229,7 +230,7 @@ class CommandExecutor {
229
230
  }
230
231
  async mutateResource(method, url, requestBody) {
231
232
  const result = await this._makeRequest(method, url, requestBody, {
232
- "X-Twilio-Mutation-Id": v4(),
233
+ "X-Twilio-Mutation-Id": uuidv4(),
233
234
  });
234
235
  if (isMutationConflictResponse(result)) {
235
236
  return await this.fetchResource(result.body.resource_url);
@@ -1 +1 @@
1
- {"version":3,"file":"command-executor.js","sources":["../src/command-executor.ts"],"sourcesContent":["import { TransportResult as Result, Transport } from \"twilsock\";\nimport { MutationConflictResponse } from \"./interfaces/commands/mutation-conflict\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { AsyncRetrier } from \"@twilio/operation-retrier\";\n\nexport interface CommandExecutorServices {\n transport: Transport;\n}\n\nconst trimSlashes = (url: string): string => url.replace(/(^\\/+|\\/+$)/g, \"\");\n\nconst isMutationConflictResponse = (\n response: Result<unknown>\n): response is Result<MutationConflictResponse> => response.status.code === 202;\n\n/**\n * Reason for why retrier in `CommandExecutor.fetchResource` resolved. If the\n * retrier resolved with type of `\"noMetadata\"`, that means the retrier got\n * preemptively stopped, as there is no point in retrying to receive metadata\n * for a message after it was confirmed to not exist. If the retrier resolved\n * with type `\"success\"`, it means that the retrier resolved with a normal\n * response.\n */\ntype RetrierResolution<T> =\n | {\n type: \"success\";\n data: T;\n }\n | {\n type: \"noMetadata\";\n };\n\nclass ChannelMetadataNotFoundError extends Error {\n public constructor(message: string) {\n super(message);\n }\n}\n\nclass CommandExecutor {\n constructor(\n private _serviceUrl: string,\n private _services: CommandExecutorServices,\n private _productId?: string\n ) {}\n\n private _preProcessUrl(url: string): string {\n const trimmedUrl = trimSlashes(url);\n\n if (/^https?:\\/\\//.test(url)) {\n return trimmedUrl;\n }\n\n return `${trimSlashes(this._serviceUrl)}/${trimmedUrl}`;\n }\n\n private async _makeRequest<Request = void, Response = void>(\n method: \"get\" | \"post\" | \"delete\",\n url: string,\n requestBody?: Request,\n headers?: Record<string, string>\n ): Promise<Result<Response>> {\n const preProcessedUrl = this._preProcessUrl(url);\n const finalHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\",\n ...(headers || {}),\n };\n let response: Result<Response>;\n\n switch (method) {\n case \"get\":\n let getUrl = preProcessedUrl;\n\n if (requestBody) {\n getUrl +=\n \"?\" +\n Object.entries(requestBody)\n .map((entry) => entry.map(encodeURIComponent).join(\"=\"))\n .join(\"&\");\n }\n\n response = await this._services.transport.get(\n getUrl,\n finalHeaders,\n this._productId\n );\n break;\n case \"post\":\n response = await this._services.transport.post(\n preProcessedUrl,\n finalHeaders,\n JSON.stringify(requestBody),\n this._productId\n );\n break;\n case \"delete\":\n response = await this._services.transport.delete(\n preProcessedUrl,\n finalHeaders,\n {},\n this._productId\n );\n break;\n }\n\n if (response.status.code < 200 || response.status.code >= 300) {\n throw new Error(\n `Request responded with a non-success code ${response.status.code}`\n );\n }\n\n return response;\n }\n\n public async fetchResource<Request = void, Response = void>(\n url: string,\n requestBody?: Request\n ): Promise<Response> {\n const maxAttemptsCount = 6;\n const retrier = new AsyncRetrier({\n min: 50,\n max: 1600,\n maxAttemptsCount,\n });\n\n let resolution: RetrierResolution<Response>;\n\n try {\n resolution = await retrier.run<RetrierResolution<Response>>(async () => {\n try {\n const response = await this._makeRequest<Request, Response>(\n \"get\",\n url,\n requestBody\n );\n return {\n type: \"success\",\n data: response.body,\n };\n } catch (e) {\n // If we get the 50530 error, which signifies that the message has no\n // metadata, we can stop the retrier by resolving it with the type\n // `\"noMetadata\"`.\n if (e?.body?.status === 404 && e?.body?.code === 50530) {\n return {\n type: \"noMetadata\",\n };\n }\n\n // Any other error will be rethrown, thus continuing work of the\n // retrier.\n throw e;\n }\n });\n } catch {\n throw new Error(`Fetch resource from \"${url}\" failed.`);\n }\n\n if (resolution.type === \"noMetadata\") {\n throw new ChannelMetadataNotFoundError(\"No metadata found.\");\n }\n\n return resolution.data;\n }\n\n public async mutateResource<Request = void, Response = void>(\n method: \"post\" | \"delete\",\n url: string,\n requestBody?: Request\n ): Promise<Response> {\n const result = await this._makeRequest<Request, Response>(\n method,\n url,\n requestBody,\n {\n \"X-Twilio-Mutation-Id\": uuidv4(),\n }\n );\n\n if (isMutationConflictResponse(result)) {\n return await this.fetchResource<undefined, Response>(\n result.body.resource_url\n );\n }\n\n return result.body;\n }\n}\n\nexport { CommandExecutor, ChannelMetadataNotFoundError };\n"],"names":["uuidv4"],"mappings":";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ACN,YAAA,MAAM,IAAI,KAAK,CAAC,wBAAwB,GAAG,CAAA,SAAA,CAAW,CAAC,CAAC;AACzD,SAAA;AAED,QAAA,IAAI,UAAU,CAAC,IAAI,KAAK,YAAY,EAAE;AACpC,YAAA,MAAM,IAAI,4BAA4B,CAAC,oBAAoB,CAAC,CAAC;AAC9D,SAAA;QAED,OAAO,UAAU,CAAC,IAAI,CAAC;KACxB;AAEM,IAAA,MAAM,cAAc,CACzB,MAAyB,EACzB,GAAW,EACX,WAAqB,EAAA;AAErB,QAAA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,CACpC,MAAM,EACN,GAAG,EACH,WAAW,EACX;YACE,sBAAsB,EAAEA,EAAM,EAAE;AACjC,SAAA,CACF,CAAC;AAEF,QAAA,IAAI,0BAA0B,CAAC,MAAM,CAAC,EAAE;YACtC,OAAO,MAAM,IAAI,CAAC,aAAa,CAC7B,MAAM,CAAC,IAAI,CAAC,YAAY,CACzB,CAAC;AACH,SAAA;QAED,OAAO,MAAM,CAAC,IAAI,CAAC;KACpB;AACF;;;;"}
1
+ {"version":3,"file":"command-executor.js","sources":["../src/command-executor.ts"],"sourcesContent":["import { TransportResult as Result, Transport } from \"twilsock\";\nimport { MutationConflictResponse } from \"./interfaces/commands/mutation-conflict\";\nimport { AsyncRetrier } from \"@twilio/operation-retrier\";\nimport { randomUUID } from \"./utils/uuid\";\n\nconst uuidv4 = randomUUID;\n\nexport interface CommandExecutorServices {\n transport: Transport;\n}\n\nconst trimSlashes = (url: string): string => url.replace(/(^\\/+|\\/+$)/g, \"\");\n\nconst isMutationConflictResponse = (\n response: Result<unknown>\n): response is Result<MutationConflictResponse> => response.status.code === 202;\n\n/**\n * Reason for why retrier in `CommandExecutor.fetchResource` resolved. If the\n * retrier resolved with type of `\"noMetadata\"`, that means the retrier got\n * preemptively stopped, as there is no point in retrying to receive metadata\n * for a message after it was confirmed to not exist. If the retrier resolved\n * with type `\"success\"`, it means that the retrier resolved with a normal\n * response.\n */\ntype RetrierResolution<T> =\n | {\n type: \"success\";\n data: T;\n }\n | {\n type: \"noMetadata\";\n };\n\nclass ChannelMetadataNotFoundError extends Error {\n public constructor(message: string) {\n super(message);\n }\n}\n\nclass CommandExecutor {\n constructor(\n private _serviceUrl: string,\n private _services: CommandExecutorServices,\n private _productId?: string\n ) {}\n\n private _preProcessUrl(url: string): string {\n const trimmedUrl = trimSlashes(url);\n\n if (/^https?:\\/\\//.test(url)) {\n return trimmedUrl;\n }\n\n return `${trimSlashes(this._serviceUrl)}/${trimmedUrl}`;\n }\n\n private async _makeRequest<Request = void, Response = void>(\n method: \"get\" | \"post\" | \"delete\",\n url: string,\n requestBody?: Request,\n headers?: Record<string, string>\n ): Promise<Result<Response>> {\n const preProcessedUrl = this._preProcessUrl(url);\n const finalHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\",\n ...(headers || {}),\n };\n let response: Result<Response>;\n\n switch (method) {\n case \"get\":\n let getUrl = preProcessedUrl;\n\n if (requestBody) {\n getUrl +=\n \"?\" +\n Object.entries(requestBody)\n .map((entry) => entry.map(encodeURIComponent).join(\"=\"))\n .join(\"&\");\n }\n\n response = await this._services.transport.get(\n getUrl,\n finalHeaders,\n this._productId\n );\n break;\n case \"post\":\n response = await this._services.transport.post(\n preProcessedUrl,\n finalHeaders,\n JSON.stringify(requestBody),\n this._productId\n );\n break;\n case \"delete\":\n response = await this._services.transport.delete(\n preProcessedUrl,\n finalHeaders,\n {},\n this._productId\n );\n break;\n }\n\n if (response.status.code < 200 || response.status.code >= 300) {\n throw new Error(\n `Request responded with a non-success code ${response.status.code}`\n );\n }\n\n return response;\n }\n\n public async fetchResource<Request = void, Response = void>(\n url: string,\n requestBody?: Request\n ): Promise<Response> {\n const maxAttemptsCount = 6;\n const retrier = new AsyncRetrier({\n min: 50,\n max: 1600,\n maxAttemptsCount,\n });\n\n let resolution: RetrierResolution<Response>;\n\n try {\n resolution = await retrier.run<RetrierResolution<Response>>(async () => {\n try {\n const response = await this._makeRequest<Request, Response>(\n \"get\",\n url,\n requestBody\n );\n return {\n type: \"success\",\n data: response.body,\n };\n } catch (e) {\n // If we get the 50530 error, which signifies that the message has no\n // metadata, we can stop the retrier by resolving it with the type\n // `\"noMetadata\"`.\n if (e?.body?.status === 404 && e?.body?.code === 50530) {\n return {\n type: \"noMetadata\",\n };\n }\n\n // Any other error will be rethrown, thus continuing work of the\n // retrier.\n throw e;\n }\n });\n } catch {\n throw new Error(`Fetch resource from \"${url}\" failed.`);\n }\n\n if (resolution.type === \"noMetadata\") {\n throw new ChannelMetadataNotFoundError(\"No metadata found.\");\n }\n\n return resolution.data;\n }\n\n public async mutateResource<Request = void, Response = void>(\n method: \"post\" | \"delete\",\n url: string,\n requestBody?: Request\n ): Promise<Response> {\n const result = await this._makeRequest<Request, Response>(\n method,\n url,\n requestBody,\n {\n \"X-Twilio-Mutation-Id\": uuidv4(),\n }\n );\n\n if (isMutationConflictResponse(result)) {\n return await this.fetchResource<undefined, Response>(\n result.body.resource_url\n );\n }\n\n return result.body;\n }\n}\n\nexport { CommandExecutor, ChannelMetadataNotFoundError };\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM,MAAM,GAAG,UAAU,CAAC;AAM1B,MAAM,WAAW,GAAG,CAAC,GAAW,KAAa,GAAG,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;AAE7E,MAAM,0BAA0B,GAAG,CACjC,QAAyB,KACwB,QAAQ,CAAC,MAAM,CAAC,IAAI,KAAK,GAAG,CAAC;AAmBhF,MAAM,4BAA6B,SAAQ,KAAK,CAAA;AAC9C,IAAA,WAAA,CAAmB,OAAe,EAAA;QAChC,KAAK,CAAC,OAAO,CAAC,CAAC;KAChB;AACF,CAAA;A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0B,CAAC,MAAM,CAAC,EAAE;YACtC,OAAO,MAAM,IAAI,CAAC,aAAa,CAC7B,MAAM,CAAC,IAAI,CAAC,YAAY,CACzB,CAAC;AACH,SAAA;QAED,OAAO,MAAM,CAAC,IAAI,CAAC;KACpB;AACF;;;;"}
@@ -135,7 +135,7 @@ var global =
135
135
  ? window
136
136
  : {};
137
137
 
138
- var version = "3.0.0";
138
+ var version = "3.0.1-rc.0";
139
139
 
140
140
  export { version };
141
141
  //# sourceMappingURL=package.json.js.map
@@ -0,0 +1,145 @@
1
+ /*
2
+ @license
3
+ The following license applies to all parts of this software except as
4
+ documented below.
5
+
6
+ Copyright (c) 2019, Twilio, inc.
7
+ All rights reserved.
8
+
9
+ Redistribution and use in source and binary forms, with or without
10
+ modification, are permitted provided that the following conditions are
11
+ met:
12
+
13
+ 1. Redistributions of source code must retain the above copyright
14
+ notice, this list of conditions and the following disclaimer.
15
+
16
+ 2. Redistributions in binary form must reproduce the above copyright
17
+ notice, this list of conditions and the following disclaimer in
18
+ the documentation and/or other materials provided with the
19
+ distribution.
20
+
21
+ 3. Neither the name of Twilio nor the names of its contributors may
22
+ be used to endorse or promote products derived from this software
23
+ without specific prior written permission.
24
+
25
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36
+
37
+ This software includes javascript-state-machine under the following license.
38
+
39
+ Copyright (c) 2012, 2013, 2014, 2015, Jake Gordon and contributors
40
+
41
+ Permission is hereby granted, free of charge, to any person obtaining a copy
42
+ of this software and associated documentation files (the "Software"), to deal
43
+ in the Software without restriction, including without limitation the rights
44
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
45
+ copies of the Software, and to permit persons to whom the Software is
46
+ furnished to do so, subject to the following conditions:
47
+
48
+ The above copyright notice and this permission notice shall be included in all
49
+ copies or substantial portions of the Software.
50
+
51
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
52
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
53
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
54
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
55
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
56
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
57
+
58
+ This software includes loglevel under the following license.
59
+
60
+ Copyright (c) 2013 Tim Perry
61
+
62
+ Permission is hereby granted, free of charge, to any person
63
+ obtaining a copy of this software and associated documentation
64
+ files (the "Software"), to deal in the Software without
65
+ restriction, including without limitation the rights to use,
66
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
67
+ copies of the Software, and to permit persons to whom the
68
+ Software is furnished to do so, subject to the following
69
+ conditions:
70
+
71
+ The above copyright notice and this permission notice shall be
72
+ included in all copies or substantial portions of the Software.
73
+
74
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
75
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
76
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
77
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
78
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
79
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
80
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
81
+ OTHER DEALINGS IN THE SOFTWARE.
82
+
83
+ This software includes q under the following license.
84
+
85
+ Copyright 2009–2014 Kristopher Michael Kowal. All rights reserved.
86
+ Permission is hereby granted, free of charge, to any person obtaining a copy
87
+ of this software and associated documentation files (the "Software"), to
88
+ deal in the Software without restriction, including without limitation the
89
+ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
90
+ sell copies of the Software, and to permit persons to whom the Software is
91
+ furnished to do so, subject to the following conditions:
92
+
93
+ The above copyright notice and this permission notice shall be included in
94
+ all copies or substantial portions of the Software.
95
+
96
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
97
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
98
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
99
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
100
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
101
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
102
+ IN THE SOFTWARE.
103
+
104
+ This software includes platform.js under the following license.
105
+
106
+ Copyright 2014 Benjamin Tan <https://d10.github.io/>
107
+ Copyright 2011-2015 John-David Dalton <http://allyoucanleet.com/>
108
+
109
+ Permission is hereby granted, free of charge, to any person obtaining
110
+ a copy of this software and associated documentation files (the
111
+ "Software"), to deal in the Software without restriction, including
112
+ without limitation the rights to use, copy, modify, merge, publish,
113
+ distribute, sublicense, and/or sell copies of the Software, and to
114
+ permit persons to whom the Software is furnished to do so, subject to
115
+ the following conditions:
116
+
117
+ The above copyright notice and this permission notice shall be
118
+ included in all copies or substantial portions of the Software.
119
+
120
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
121
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
122
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
123
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
124
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
125
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
126
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
127
+
128
+ */
129
+ var global =
130
+ typeof global !== "undefined"
131
+ ? global
132
+ : typeof self !== "undefined"
133
+ ? self
134
+ : typeof window !== "undefined"
135
+ ? window
136
+ : {};
137
+
138
+ /**
139
+ * Generate a random UUID using the Web Crypto API.
140
+ * Available in Node.js 14.17+, modern browsers, and React Native.
141
+ */
142
+ const randomUUID = () => crypto.randomUUID();
143
+
144
+ export { randomUUID };
145
+ //# sourceMappingURL=uuid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uuid.js","sources":["../../src/utils/uuid.ts"],"sourcesContent":["/**\n * Generate a random UUID using the Web Crypto API.\n * Available in Node.js 14.17+, modern browsers, and React Native.\n */\nexport const randomUUID = (): string =>\n (crypto as unknown as { randomUUID(): string }).randomUUID();\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;AAGG;AACU,MAAA,UAAU,GAAG,MACvB,MAA8C,CAAC,UAAU;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twilio/conversations",
3
- "version": "3.0.0",
3
+ "version": "3.0.1-rc.0",
4
4
  "description": "Twilio Conversations client library",
5
5
  "main": "./builds/lib.js",
6
6
  "browser": "./builds/browser.js",
@@ -38,8 +38,8 @@
38
38
  "@babel/runtime": "^7.17.0",
39
39
  "@twilio/declarative-type-validator": "^1.0.0",
40
40
  "@twilio/deprecation-decorator": "^1.0.0",
41
- "@twilio/mcs-client": "^1.0.0",
42
- "@twilio/notifications": "^3.0.0",
41
+ "@twilio/mcs-client": "^1.0.1-rc.0",
42
+ "@twilio/notifications": "^3.0.2-rc.0",
43
43
  "@twilio/operation-retrier": "^5.0.0",
44
44
  "@twilio/replay-event-emitter": "^1.0.0",
45
45
  "core-js": "^3.17.3",
@@ -47,9 +47,8 @@
47
47
  "loglevel": "^1.8.0",
48
48
  "platform": "^1.3.6",
49
49
  "quick-lru": "^5.1.1",
50
- "twilio-sync": "^4.0.0",
51
- "twilsock": "^1.0.0",
52
- "uuid": "^9.0.0",
50
+ "twilio-sync": "^4.0.1-rc.0",
51
+ "twilsock": "^1.0.2-rc.0",
53
52
  "xmlhttprequest": "^1.8.0"
54
53
  },
55
54
  "devDependencies": {
@@ -65,7 +64,7 @@
65
64
  "@types/chai-as-promised": "^7.1.2",
66
65
  "@types/chai-string": "^1.4.1",
67
66
  "@types/mocha": "^5.2.7",
68
- "@types/node": "^12.12.12",
67
+ "@types/node": "~20.1.0",
69
68
  "@types/sinon": "^10.0.0",
70
69
  "@types/sinon-chai": "^3.2.2",
71
70
  "@typescript-eslint/eslint-plugin": "^5.51.0",
@@ -102,7 +101,7 @@
102
101
  "sinon-chai": "^3.3.0",
103
102
  "ts-node": "^8.5.2",
104
103
  "tslib": "^2.4.0",
105
- "twilio": "^4.17.0",
104
+ "twilio": "^5.13.1",
106
105
  "typedoc": "^0.21.4",
107
106
  "typescript": "^4.3.2",
108
107
  "typescript-strict-plugin": "1.1.2"