@telia-ace/widget-conversation 1.0.1 → 1.0.4

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.
package/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
- Copyright © 2021, Telia Company AB. All rights reserved.
2
-
3
- THIS PACKAGE AND CONTAINING SOFTWARE IS PART OF
4
- THE HUMANY SERVICE. BY USING THIS SOFTWARE YOU
5
- AGREE TO THE FOLLOWING TERMS AND CONDITIONS:
1
+ Copyright © 2021, Telia Company AB. All rights reserved.
2
+
3
+ THIS PACKAGE AND CONTAINING SOFTWARE IS PART OF
4
+ THE HUMANY SERVICE. BY USING THIS SOFTWARE YOU
5
+ AGREE TO THE FOLLOWING TERMS AND CONDITIONS:
6
6
  http://www.humany.com/legal
package/README.md CHANGED
@@ -1,256 +1,256 @@
1
- # Widget Conversation API
2
-
3
- The Widget Conversation API provides support for reading and writing to a conversational component inside a widget.
4
-
5
- ## Explore the API
6
-
7
- You can try out and watch the Conversation API in action by clicking the button below.
8
- Keep in mind that this is for demonstration purposes only and may not be best practice.
9
- We do not recommend binding functions to the `Window` object.
10
-
11
- [![Edit elegant-jones-rnyrd](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/elegant-jones-rnyrd?fontsize=14&hidenavigation=1&theme=dark)
12
-
13
- ## Accessing the API
14
-
15
- Inside a plugin, access the global instance of `ConversationPlatform` by passing in the current `Container` to the `getInstance()` method. It will return a `Promise` that is resolved to the `ConversationPlatform` instance. On the instance, register a provider and pass in a name and handler by calling the `registerProvider()` function as shown below.
16
-
17
- The handler function will be called once a conversational component for the specified provider is activated in the widget. Use the provider to interact with the conversation.
18
-
19
- ##### Example
20
-
21
- ```ts
22
- import { ConversationPlatform } from '@telia-ace/widget-conversation';
23
-
24
- const MyPlugin = async (container) => {
25
- const platform = await ConversationPlatform.getInstance(container);
26
-
27
- platform.registerProvider('my-chat', (conversation, component) => {
28
- // start interacting with the conversation here
29
- });
30
- };
31
- ```
32
-
33
- ## Writing to the conversation
34
-
35
- When writing content to the conversation you will first need to create an `Agent` object and then use its `print()` function. Specify the type of entry to print and pass in the content.
36
-
37
- ### `print(content: object)`
38
-
39
- Returns a `ConversationEntry` message that can be used to update and/or remove the content from the conversation at a later stage.
40
-
41
- ##### Example
42
-
43
- ```ts
44
- const agent = conversation.createAgent();
45
- const entry = agent.print('Lorem ipsum');
46
-
47
- entry.update({
48
- // ...
49
- });
50
-
51
- entry.remove();
52
- ```
53
-
54
- ### Messages
55
-
56
- #### Simple text message
57
-
58
- Used to render plain text without HTML-formatting.
59
-
60
- ##### Example
61
-
62
- ```ts
63
- // print user message
64
- conversation.user.print('Lorem ipsum');
65
-
66
- // print agent message
67
- const agent = conversation.createAgent();
68
- agent.print('Lorem ipsum');
69
- ```
70
-
71
- #### Message with list of actions
72
-
73
- Example of how to render a list with actions. Is only supported on `Agent` and as system message.
74
-
75
- | Name | Type | Description |
76
- | --------- | -------- | ------------------------------------------------------------- |
77
- | `title` | `string` | Title for the entry. |
78
- | `body` | `string` | Body content for the entry. Supports HTML. |
79
- | `actions` | `object` | Key-value-pairs representing available actions for the entry. |
80
-
81
- ##### Example
82
-
83
- ```ts
84
- agent.print({
85
- title: 'Download invoices',
86
- body: 'Click an invoice below to download a copy.',
87
- actions: {
88
- invoice_190201: 'Invoice 190201',
89
- invoice_190301: 'Invoice 190301',
90
- invoice_190401: 'Invoice 190401',
91
- },
92
- });
93
- ```
94
-
95
- #### Message with a form
96
-
97
- Example of how to render a form that can be handled by the `conversation.form` event. Is only supported on `Agent` and as system message.
98
-
99
- | Name | Type | Description |
100
- | ------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
101
- | `title` | `string` | Title for the entry. |
102
- | `body` | `string` | Body content for the entry. Supports HTML. |
103
- | `form` | `(FormBuilder) => void` | A callback function for building the form. Refer to the [`@telia-ace/widget-forms`](https://www.npmjs.com/package/@telia-ace/widget-forms) package for more information about `FormBuilder`. |
104
- | `key` | `string` | The key used to refer to the form when validating and submitting the form. |
105
-
106
- ##### Example
107
-
108
- ```ts
109
- agent.print({
110
- title: 'Log in',
111
- body: 'Enter your ID to login',
112
- key: 'my-login-form',
113
- form: (builder) => {
114
- builder
115
- .createComponent({
116
- component: 'Text',
117
- type: 'number',
118
- name: 'id',
119
- title: 'ID',
120
- required: true,
121
- })
122
- .createComponent({
123
- title: 'Log in',
124
- actionKey: 'submit',
125
- name: 'submit',
126
- component: 'Submit',
127
- type: 'submit',
128
- evaluate: true,
129
- value: 'Log in',
130
- });
131
- },
132
- });
133
- ```
134
-
135
- ### Specify a sender name and/or avatar
136
-
137
- To create an agent with a name and avatar use the `createAgent` method on the conversation.
138
-
139
- ##### Example
140
-
141
- ```ts
142
- const agent = conversation.createAgent({
143
- name: 'Mr. Agent',
144
- avatar: 'https://www.site.com/avatar.jpg',
145
- });
146
-
147
- agent.print({
148
- title: 'I found the following invoices associated to your account:',
149
- actions: {
150
- action1: 'Action 1',
151
- action2: 'Action 2',
152
- action3: 'Action 3',
153
- },
154
- });
155
- ```
156
-
157
- ### Writing system messages
158
-
159
- In order to print a system message to the conversation you invoke the `print` method on the `conversation`. The `print` method accepts the same arguments as on the `Agent`.
160
-
161
- #### Example
162
-
163
- ```ts
164
- conversation.print('Lorem ipsum');
165
- ```
166
-
167
- ### Loading/typing indicator
168
-
169
- In many cases you will likely fetch data from an external resource before the content is written to the conversation. In this case you should use the `loading()` function on the `ConversationProvider` to inform the user that something is about to happen. Even in cases when the response is available immediately it gives a better user experience to present a loading indicator for a short while.
170
-
171
- In cases where you want to notify the user that the agent is currently typing, you should use the `typing` function on `Agent`.
172
-
173
- #### Example
174
-
175
- ##### Loading
176
-
177
- ```ts
178
- const done = conversation.loading();
179
- // ...
180
- done(); // remove loader
181
- ```
182
-
183
- ##### Typing indicator
184
-
185
- ```ts
186
- const done = agent.typing();
187
- // ...
188
- done(); // remove loader
189
- ```
190
-
191
- ## Reading from the conversation
192
-
193
- The second parameter to your provider handler is a `ComponentNode` instance representing the conversational component. On it you can read the component's properties and react to action emitted by the component.
194
-
195
- ### Actions
196
-
197
- The following actions are emitted from the conversational component.
198
-
199
- **Important**: For default actions it is important to call `next()` unless you want to completely stop the execution flow for the particular action. Not doing so will stop any succeeding handlers and may unintentionally break functionality.
200
-
201
- #### `conversation.user-typing`
202
-
203
- Is emitted when the user´s typing indicator is changed.
204
-
205
- | Name | Type | Description |
206
- | ------------ | -------- | ---------------------------------------------- |
207
- | `textLength` | `number` | The current text length of the user's message. |
208
-
209
- #### `conversation.user-submit`
210
-
211
- Is emitted when the user submits a message.
212
-
213
- | Name | Type | Description |
214
- | ------ | -------- | ------------------- |
215
- | `text` | `string` | The submitted text. |
216
-
217
- #### `conversation.action`
218
-
219
- Is emitted when the user clicks on an action.
220
-
221
- | Name | Type | Description |
222
- | ------ | -------- | ---------------------------- |
223
- | `text` | `string` | Key of the submitted action. |
224
-
225
- #### `conversation.form`
226
-
227
- Is emitted when the data of a form is changed.
228
-
229
- | Name | Type | Description |
230
- | ----------- | ---------- | --------------------------------------------------------- |
231
- | `data` | `FormData` | The form data. |
232
- | `formKey` | `string` | The unique key for the form. |
233
- | `actionKey` | `string` | The key of the form component responsible for the change. |
234
-
235
- In order to subscribe to any of these actions you have access to the `ComponentNodeController`. Below is an example how to subscribe to the `conversation.form` action.
236
-
237
- ```ts
238
- component.actions.watch('conversation.form', (input, next) => {
239
- return next(input);
240
- });
241
- ```
242
-
243
- ### Submitting forms
244
-
245
- In order to listen for form events you should subscribe to the `conversation.form` event. By passing a `key` to the form, you are able to target the form in this listener.
246
-
247
- ```ts
248
- component.actions.watch('conversation.form', (input, next) => {
249
- if (input.formKey === 'my-login-form' && input.actionKey === 'submit') {
250
- const username = input.data.username;
251
- const password = input.data.password;
252
- }
253
-
254
- return next(input);
255
- });
256
- ```
1
+ # Widget Conversation API
2
+
3
+ The Widget Conversation API provides support for reading and writing to a conversational component inside a widget.
4
+
5
+ ## Explore the API
6
+
7
+ You can try out and watch the Conversation API in action by clicking the button below.
8
+ Keep in mind that this is for demonstration purposes only and may not be best practice.
9
+ We do not recommend binding functions to the `Window` object.
10
+
11
+ [![Edit elegant-jones-rnyrd](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/elegant-jones-rnyrd?fontsize=14&hidenavigation=1&theme=dark)
12
+
13
+ ## Accessing the API
14
+
15
+ Inside a plugin, access the global instance of `ConversationPlatform` by passing in the current `Container` to the `getInstance()` method. It will return a `Promise` that is resolved to the `ConversationPlatform` instance. On the instance, register a provider and pass in a name and handler by calling the `registerProvider()` function as shown below.
16
+
17
+ The handler function will be called once a conversational component for the specified provider is activated in the widget. Use the provider to interact with the conversation.
18
+
19
+ ##### Example
20
+
21
+ ```ts
22
+ import { ConversationPlatform } from '@telia-ace/widget-conversation';
23
+
24
+ const MyPlugin = async (container) => {
25
+ const platform = await ConversationPlatform.getInstance(container);
26
+
27
+ platform.registerProvider('my-chat', (conversation, component) => {
28
+ // start interacting with the conversation here
29
+ });
30
+ };
31
+ ```
32
+
33
+ ## Writing to the conversation
34
+
35
+ When writing content to the conversation you will first need to create an `Agent` object and then use its `print()` function. Specify the type of entry to print and pass in the content.
36
+
37
+ ### `print(content: object)`
38
+
39
+ Returns a `ConversationEntry` message that can be used to update and/or remove the content from the conversation at a later stage.
40
+
41
+ ##### Example
42
+
43
+ ```ts
44
+ const agent = conversation.createAgent();
45
+ const entry = agent.print('Lorem ipsum');
46
+
47
+ entry.update({
48
+ // ...
49
+ });
50
+
51
+ entry.remove();
52
+ ```
53
+
54
+ ### Messages
55
+
56
+ #### Simple text message
57
+
58
+ Used to render plain text without HTML-formatting.
59
+
60
+ ##### Example
61
+
62
+ ```ts
63
+ // print user message
64
+ conversation.user.print('Lorem ipsum');
65
+
66
+ // print agent message
67
+ const agent = conversation.createAgent();
68
+ agent.print('Lorem ipsum');
69
+ ```
70
+
71
+ #### Message with list of actions
72
+
73
+ Example of how to render a list with actions. Is only supported on `Agent` and as system message.
74
+
75
+ | Name | Type | Description |
76
+ | --------- | -------- | ------------------------------------------------------------- |
77
+ | `title` | `string` | Title for the entry. |
78
+ | `body` | `string` | Body content for the entry. Supports HTML. |
79
+ | `actions` | `object` | Key-value-pairs representing available actions for the entry. |
80
+
81
+ ##### Example
82
+
83
+ ```ts
84
+ agent.print({
85
+ title: 'Download invoices',
86
+ body: 'Click an invoice below to download a copy.',
87
+ actions: {
88
+ invoice_190201: 'Invoice 190201',
89
+ invoice_190301: 'Invoice 190301',
90
+ invoice_190401: 'Invoice 190401',
91
+ },
92
+ });
93
+ ```
94
+
95
+ #### Message with a form
96
+
97
+ Example of how to render a form that can be handled by the `conversation.form` event. Is only supported on `Agent` and as system message.
98
+
99
+ | Name | Type | Description |
100
+ | ------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
101
+ | `title` | `string` | Title for the entry. |
102
+ | `body` | `string` | Body content for the entry. Supports HTML. |
103
+ | `form` | `(FormBuilder) => void` | A callback function for building the form. Refer to the [`@telia-ace/widget-forms`](https://www.npmjs.com/package/@telia-ace/widget-forms) package for more information about `FormBuilder`. |
104
+ | `key` | `string` | The key used to refer to the form when validating and submitting the form. |
105
+
106
+ ##### Example
107
+
108
+ ```ts
109
+ agent.print({
110
+ title: 'Log in',
111
+ body: 'Enter your ID to login',
112
+ key: 'my-login-form',
113
+ form: (builder) => {
114
+ builder
115
+ .createComponent({
116
+ component: 'Text',
117
+ type: 'number',
118
+ name: 'id',
119
+ title: 'ID',
120
+ required: true,
121
+ })
122
+ .createComponent({
123
+ title: 'Log in',
124
+ actionKey: 'submit',
125
+ name: 'submit',
126
+ component: 'Submit',
127
+ type: 'submit',
128
+ evaluate: true,
129
+ value: 'Log in',
130
+ });
131
+ },
132
+ });
133
+ ```
134
+
135
+ ### Specify a sender name and/or avatar
136
+
137
+ To create an agent with a name and avatar use the `createAgent` method on the conversation.
138
+
139
+ ##### Example
140
+
141
+ ```ts
142
+ const agent = conversation.createAgent({
143
+ name: 'Mr. Agent',
144
+ avatar: 'https://www.site.com/avatar.jpg',
145
+ });
146
+
147
+ agent.print({
148
+ title: 'I found the following invoices associated to your account:',
149
+ actions: {
150
+ action1: 'Action 1',
151
+ action2: 'Action 2',
152
+ action3: 'Action 3',
153
+ },
154
+ });
155
+ ```
156
+
157
+ ### Writing system messages
158
+
159
+ In order to print a system message to the conversation you invoke the `print` method on the `conversation`. The `print` method accepts the same arguments as on the `Agent`.
160
+
161
+ #### Example
162
+
163
+ ```ts
164
+ conversation.print('Lorem ipsum');
165
+ ```
166
+
167
+ ### Loading/typing indicator
168
+
169
+ In many cases you will likely fetch data from an external resource before the content is written to the conversation. In this case you should use the `loading()` function on the `ConversationProvider` to inform the user that something is about to happen. Even in cases when the response is available immediately it gives a better user experience to present a loading indicator for a short while.
170
+
171
+ In cases where you want to notify the user that the agent is currently typing, you should use the `typing` function on `Agent`.
172
+
173
+ #### Example
174
+
175
+ ##### Loading
176
+
177
+ ```ts
178
+ const done = conversation.loading();
179
+ // ...
180
+ done(); // remove loader
181
+ ```
182
+
183
+ ##### Typing indicator
184
+
185
+ ```ts
186
+ const done = agent.typing();
187
+ // ...
188
+ done(); // remove loader
189
+ ```
190
+
191
+ ## Reading from the conversation
192
+
193
+ The second parameter to your provider handler is a `ComponentNode` instance representing the conversational component. On it you can read the component's properties and react to action emitted by the component.
194
+
195
+ ### Actions
196
+
197
+ The following actions are emitted from the conversational component.
198
+
199
+ **Important**: For default actions it is important to call `next()` unless you want to completely stop the execution flow for the particular action. Not doing so will stop any succeeding handlers and may unintentionally break functionality.
200
+
201
+ #### `conversation.user-typing`
202
+
203
+ Is emitted when the user´s typing indicator is changed.
204
+
205
+ | Name | Type | Description |
206
+ | ------------ | -------- | ---------------------------------------------- |
207
+ | `textLength` | `number` | The current text length of the user's message. |
208
+
209
+ #### `conversation.user-submit`
210
+
211
+ Is emitted when the user submits a message.
212
+
213
+ | Name | Type | Description |
214
+ | ------ | -------- | ------------------- |
215
+ | `text` | `string` | The submitted text. |
216
+
217
+ #### `conversation.action`
218
+
219
+ Is emitted when the user clicks on an action.
220
+
221
+ | Name | Type | Description |
222
+ | ------ | -------- | ---------------------------- |
223
+ | `text` | `string` | Key of the submitted action. |
224
+
225
+ #### `conversation.form`
226
+
227
+ Is emitted when the data of a form is changed.
228
+
229
+ | Name | Type | Description |
230
+ | ----------- | ---------- | --------------------------------------------------------- |
231
+ | `data` | `FormData` | The form data. |
232
+ | `formKey` | `string` | The unique key for the form. |
233
+ | `actionKey` | `string` | The key of the form component responsible for the change. |
234
+
235
+ In order to subscribe to any of these actions you have access to the `ComponentNodeController`. Below is an example how to subscribe to the `conversation.form` action.
236
+
237
+ ```ts
238
+ component.actions.watch('conversation.form', (input, next) => {
239
+ return next(input);
240
+ });
241
+ ```
242
+
243
+ ### Submitting forms
244
+
245
+ In order to listen for form events you should subscribe to the `conversation.form` event. By passing a `key` to the form, you are able to target the form in this listener.
246
+
247
+ ```ts
248
+ component.actions.watch('conversation.form', (input, next) => {
249
+ if (input.formKey === 'my-login-form' && input.actionKey === 'submit') {
250
+ const username = input.data.username;
251
+ const password = input.data.password;
252
+ }
253
+
254
+ return next(input);
255
+ });
256
+ ```
package/lib/agent.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Symbol } from '@telia-ace/widget-ui';
2
2
  import { ConversationEntry } from './conversation-controller';
3
3
  import { ConversationProvider } from './conversation-provider';
4
- import { ConversationMessageSettings } from './types';
4
+ import { ConversationMessageSettings, ConverstationMessageItem } from './types';
5
5
  export declare type AgentSettings = {
6
6
  name?: string;
7
7
  avatar?: string | Symbol;
@@ -11,7 +11,7 @@ export declare class Agent {
11
11
  name?: string;
12
12
  avatar?: string | Symbol;
13
13
  constructor(provider: ConversationProvider, settings: AgentSettings);
14
- print: (settings: string | ConversationMessageSettings) => ConversationEntry | undefined;
14
+ print: (settings: string | ConversationMessageSettings | ConverstationMessageItem<any> | ConverstationMessageItem<any>[]) => ConversationEntry | undefined;
15
15
  typing: () => (() => void) | undefined;
16
16
  update(settings: AgentSettings): void;
17
17
  }
@@ -1,6 +1,6 @@
1
1
  import { Container, EventListener, EventManager } from '@webprovisions/platform';
2
2
  import { ConversationProvider } from './conversation-provider';
3
- import { ConversationMessageContent, ConversationMessageSender, ConversationMessageSettings, ConversationMessageUpdateSettings, NormalizedMessageSettings } from './types';
3
+ import { ConversationMessageContent, ConversationMessageSender, ConversationMessageSettings, ConversationMessageUpdateSettings, ConverstationMessageItem, NormalizedMessageSettings } from './types';
4
4
  import { User } from './user';
5
5
  export declare type ValidateHandler = (formValues: {
6
6
  [key: string]: any;
@@ -20,8 +20,9 @@ export declare type CancelLoaderDelegate = () => void;
20
20
  export declare class ConversationEntry {
21
21
  private writer;
22
22
  constructor(writer: EntryWriter);
23
- update(content: string | ConversationMessageUpdateSettings): void;
23
+ update(content: string | ConversationMessageUpdateSettings | ConverstationMessageItem<any> | ConverstationMessageItem<any>[]): void;
24
24
  remove(): void;
25
+ private getNormalizedSettings;
25
26
  }
26
27
  export declare enum ConversationMessageType {
27
28
  User = "user",
@@ -36,7 +37,7 @@ export declare type ConversationMessage = {
36
37
  type: ConversationMessageType;
37
38
  };
38
39
  export declare type EntryWriter = (content: ConversationMessageUpdateSettings | null) => void;
39
- export declare const getNormalizedMessageSettings: (settings: string | ConversationMessageSettings) => NormalizedMessageSettings;
40
+ export declare const getNormalizedMessageSettings: (settings: string | ConversationMessageSettings | ConverstationMessageItem<any> | ConverstationMessageItem<any>[]) => NormalizedMessageSettings;
40
41
  /**
41
42
  * Manages the stream of messages inside a `ConversationComponent` and provides external read-write
42
43
  * access to it as well as exposing emitted actions.
@@ -32,12 +32,21 @@ var ConversationEntry = /** @class */ (function () {
32
32
  this.writer = writer;
33
33
  }
34
34
  ConversationEntry.prototype.update = function (content) {
35
- var normalized = typeof content === 'string' ? { body: content } : content;
35
+ var normalized = this.getNormalizedSettings(content);
36
+ // const normalized = typeof content === 'string' ? { body: content } : content;
36
37
  this.writer(normalized);
37
38
  };
38
39
  ConversationEntry.prototype.remove = function () {
39
40
  this.writer(null);
40
41
  };
42
+ ConversationEntry.prototype.getNormalizedSettings = function (content) {
43
+ if (typeof content === 'string')
44
+ return { body: content };
45
+ else if (content.length > -1 && typeof content === 'object')
46
+ return { items: content };
47
+ else
48
+ return content;
49
+ };
41
50
  return ConversationEntry;
42
51
  }());
43
52
  exports.ConversationEntry = ConversationEntry;
@@ -51,32 +60,43 @@ var getNormalizedMessageSettings = function (settings) {
51
60
  var content;
52
61
  var key = (0, widget_utilities_1.uuid)();
53
62
  var timestamp = Date.now();
54
- if (typeof settings === 'string') {
55
- content = { body: settings };
63
+ if (settings.length > -1 && typeof settings === 'object') {
64
+ if (typeof settings[0] === 'string') {
65
+ content = { items: [settings] };
66
+ }
67
+ else {
68
+ content = { items: settings };
69
+ }
56
70
  }
57
- else if (settings.type) {
58
- content = __assign({}, settings);
71
+ else if (typeof settings === 'string') {
72
+ content = { body: settings };
59
73
  }
60
74
  else {
61
- content = {
62
- body: settings.body,
63
- actions: settings.actions,
64
- title: settings.title,
65
- };
66
- if (settings.key) {
67
- key = settings.key;
75
+ settings = settings;
76
+ if (settings.type) {
77
+ content = __assign({}, settings);
68
78
  }
69
- if (settings.timestamp) {
70
- timestamp = settings.timestamp;
71
- }
72
- if (settings.form) {
73
- var builder = widget_forms_1.FormBuilder.create(key);
74
- settings.form(builder);
75
- var builtForm = builder.get();
76
- content.form = builtForm;
77
- }
78
- if (settings.timestamp === null) {
79
- timestamp = null;
79
+ else {
80
+ content = {
81
+ body: settings.body,
82
+ actions: settings.actions,
83
+ title: settings.title,
84
+ };
85
+ if (settings.key) {
86
+ key = settings.key;
87
+ }
88
+ if (settings.timestamp) {
89
+ timestamp = settings.timestamp;
90
+ }
91
+ if (settings.form) {
92
+ var builder = widget_forms_1.FormBuilder.create(key);
93
+ settings.form(builder);
94
+ var builtForm = builder.get();
95
+ content.form = builtForm;
96
+ }
97
+ if (settings.timestamp === null) {
98
+ timestamp = null;
99
+ }
80
100
  }
81
101
  }
82
102
  return { content: content, key: key, timestamp: timestamp };