@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 CHANGED
@@ -312,6 +312,15 @@ var ConversationsError = class extends Error {
312
312
  this.status = status;
313
313
  }
314
314
  };
315
+ function assertConversationAddress(operation, input) {
316
+ if (!input.conversationId && !input.phonePair) {
317
+ throw new ConversationsError(
318
+ operation,
319
+ 0,
320
+ "Either `conversationId` or `phonePair` is required"
321
+ );
322
+ }
323
+ }
315
324
  var ConversationNotesSubresource = class {
316
325
  constructor(post) {
317
326
  this.post = post;
@@ -319,6 +328,7 @@ var ConversationNotesSubresource = class {
319
328
  /** Create a note on a conversation (addressed by id or phonePair). */
320
329
  create(input) {
321
330
  return __async(this, null, function* () {
331
+ assertConversationAddress("notes.create", input);
322
332
  return this.post("/conversations/notes", input);
323
333
  });
324
334
  }
@@ -330,6 +340,7 @@ var ConversationTasksSubresource = class {
330
340
  /** Create a task on a conversation. */
331
341
  create(input) {
332
342
  return __async(this, null, function* () {
343
+ assertConversationAddress("tasks.create", input);
333
344
  return this.post("/conversations/tasks", input);
334
345
  });
335
346
  }