@hipnation-truth/sdk 0.17.0 → 0.17.2
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/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -0
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.ts +9 -0
- package/dist/react.js +1 -4
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -247,6 +247,15 @@ var ConversationsError = class extends Error {
|
|
|
247
247
|
this.status = status;
|
|
248
248
|
}
|
|
249
249
|
};
|
|
250
|
+
function assertConversationAddress(operation, input) {
|
|
251
|
+
if (!input.conversationId && !input.phonePair) {
|
|
252
|
+
throw new ConversationsError(
|
|
253
|
+
operation,
|
|
254
|
+
0,
|
|
255
|
+
"Either `conversationId` or `phonePair` is required"
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
250
259
|
var ConversationNotesSubresource = class {
|
|
251
260
|
constructor(post) {
|
|
252
261
|
this.post = post;
|
|
@@ -254,6 +263,7 @@ var ConversationNotesSubresource = class {
|
|
|
254
263
|
/** Create a note on a conversation (addressed by id or phonePair). */
|
|
255
264
|
create(input) {
|
|
256
265
|
return __async(this, null, function* () {
|
|
266
|
+
assertConversationAddress("notes.create", input);
|
|
257
267
|
return this.post("/conversations/notes", input);
|
|
258
268
|
});
|
|
259
269
|
}
|
|
@@ -265,6 +275,7 @@ var ConversationTasksSubresource = class {
|
|
|
265
275
|
/** Create a task on a conversation. */
|
|
266
276
|
create(input) {
|
|
267
277
|
return __async(this, null, function* () {
|
|
278
|
+
assertConversationAddress("tasks.create", input);
|
|
268
279
|
return this.post("/conversations/tasks", input);
|
|
269
280
|
});
|
|
270
281
|
}
|