@hipnation-truth/sdk 0.24.0 → 0.25.1

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.d.mts CHANGED
@@ -72,12 +72,26 @@ declare const ENVIRONMENTS: {
72
72
  readonly production: "production";
73
73
  };
74
74
  type Environment = (typeof ENVIRONMENTS)[keyof typeof ENVIRONMENTS];
75
+ /**
76
+ * Fetches a user-identity JWT for Convex calls. Return the token from
77
+ * your identity provider's Clerk JWT template named "convex"
78
+ * (e.g. `getToken({ template: "convex" })` from `@clerk/expo`), or
79
+ * `null` when no user is signed in.
80
+ */
81
+ type AuthTokenFetcher = () => Promise<string | null | undefined>;
75
82
  /**
76
83
  * Configuration for initializing a TruthClient.
77
84
  */
78
85
  interface TruthClientConfig {
79
86
  /** API key for authenticating with the Truth platform (e.g. "hn_live_...") */
80
87
  apiKey: string;
88
+ /**
89
+ * Per-call Clerk JWT fetcher for Convex data access. When provided,
90
+ * every Convex query/mutation/action carries the caller's identity;
91
+ * Convex deployments with `CLERK_AUTH_REQUIRED` enabled reject calls
92
+ * without it. Omit for service contexts that don't act as a user.
93
+ */
94
+ getAuthToken?: AuthTokenFetcher;
81
95
  /** Target environment */
82
96
  environment: Environment;
83
97
  /** Override the default Convex URL for data access */
@@ -267,12 +281,6 @@ interface SetConversationTaskStatusInput {
267
281
  taskId: string;
268
282
  status: ConversationTaskStatus;
269
283
  resolvedBy?: string;
270
- /**
271
- * Email of the user performing the action. Truth excludes the actor
272
- * from the task-action push fan-out (legacy parity) — omit it and the
273
- * actor notifies themselves.
274
- */
275
- actor?: string;
276
284
  }
277
285
  interface UpdateConversationTaskInput {
278
286
  taskId: string;
@@ -287,18 +295,6 @@ interface UpdateConversationTaskInput {
287
295
  status?: ConversationTaskStatus;
288
296
  assignee?: string;
289
297
  type?: string;
290
- /**
291
- * Email of the user performing the action. Truth excludes the actor
292
- * from the task-action push fan-out (legacy parity) — omit it and the
293
- * actor notifies themselves.
294
- */
295
- actor?: string;
296
- }
297
- interface SetConversationTaskArchivedInput {
298
- taskId: string;
299
- archived: boolean;
300
- /** Email of the acting user — excluded from the archive push fan-out. */
301
- actor?: string;
302
298
  }
303
299
  interface SendConversationMessageInput {
304
300
  fromNumber: string;
@@ -335,11 +331,6 @@ declare class ConversationTasksSubresource {
335
331
  setStatus(input: SetConversationTaskStatusInput): Promise<{
336
332
  ok: true;
337
333
  }>;
338
- /** Archive or un-archive a task (hides it from My Tasks without deleting). */
339
- setArchived(input: SetConversationTaskArchivedInput): Promise<{
340
- ok: true;
341
- changed: boolean;
342
- }>;
343
334
  /**
344
335
  * Update task fields (priority, assignee, description, type). Wraps
345
336
  * `PATCH /api/conversations/tasks/{id}` so CommHub doesn't have to
@@ -1795,4 +1786,4 @@ declare function subscriptionToJSON(sub: PushSubscription): {
1795
1786
  };
1796
1787
  declare function onServiceWorkerMessage(type: string, callback: (payload: unknown) => void): () => void;
1797
1788
 
1798
- export { AUTH_EVENTS, type ActorContext, type Appointment, type AppointmentListOptions, AppointmentResource, type Attachment, AttachmentsError, AttachmentsResource, type AuthEventType, type AuthLoginFailedPayload, type AuthLoginSucceededPayload, CALL_EVENTS, CONVERSATION_EVENTS, type CallConnectedPayload, type CallEndedPayload, type CallEventType, type CallInitiatedPayload, type CallMissedPayload, type CallStatusResponse, type CancelScheduledNotificationResult, type ConversationAddress, type ConversationAttachmentDownloadedPayload, type ConversationAttachmentUploadedPayload, type ConversationCreatedPayload, type ConversationEventType, type ConversationMarkedReadPayload, type ConversationMessageReceivedPayload, type ConversationMessageSentPayload, type ConversationTaskPriority, type ConversationTaskStatus, ConversationsError, ConversationsResource, type CreateConversationNoteInput, type CreateConversationTaskInput, type CreateTaskInput, type CreateUploadUrlInput, type CreateUploadUrlResult, type DetectionResult, type DialpadNumberInfo, DialpadProxyError, DialpadResource, type DialpadUser, ENVIRONMENTS, EVENT_TYPES, EhrProviderProxy, EhrProxyError, EhrResource, type Environment, type EventActor, type EventCompliance, type EventEnvelope, type EventPayloadMap, type EventSubject, type EventType, type GetDownloadUrlResult, type InitiateCallResponse, MessagesResource, NOTIFICATION_EVENTS, type NonVisitNoteBullet, NotesError, NotesResource, type NotificationDeliveredPayload, type NotificationEventType, type NotificationOpenedPayload, type NotificationPlatform, type NotificationPreferences, type NotificationSentPayload, NotificationsError, NotificationsResource, PROVIDER_EVENTS, type PaginatedResult, type Patient, type PatientBasicDetailsResult, PatientDetailsError, type PatientDetailsInput, PatientDetailsResource, type PatientDetailsResult, type PatientListOptions, type PatientMedicalDetailsResult, PatientResource, type Physician, PhysiciansResource, type ProviderEventType, type ProviderSyncFailedPayload, type ProviderSyncStartedPayload, type ProviderSyncSucceededPayload, type PushEventPayload, type PushNoteToElationInput, type PushNoteToElationResult, REMINDER_EVENTS, type RecordAttachmentInput, type RegisterDeviceInput, type RegisterDeviceResult, type Reminder, type ReminderEventType, type ReminderScheduledPayload, type ReminderStatus, type ReminderTriggeredPayload, RemindersResource, SECURITY_EVENTS, type ScheduleNotificationInput, type ScheduleNotificationResult, type ScheduleReminderInput, type ScheduleReminderResult, type ScheduledJobStatus, type ScheduledNotification, type SecurityAccessDeniedPayload, type SecurityEventType, type SendConversationMessageInput, type SendConversationMessageResult, type SendNotificationInput, type SendNotificationResult, type SendSmsParams, type SendSmsResponse, type SetConversationTaskStatusInput, TASK_EVENTS, TRANSLATION_EVENTS, type Task, type TaskAssignedPayload, type TaskCreatedPayload, type TaskEventType, type TaskStatus, type TaskStatusChangedPayload, TasksResource, type TrackOptions, Tracker, type TranslateBatchInput, type TranslateTextInput, type TranslationCompletedPayload, TranslationError, type TranslationEventType, type TranslationRequestedPayload, TranslationResource, type TranslationResult, TruthClient, type TruthClientConfig, type UnregisterDeviceInput, type UpdateNotificationsInput, type UpdateNotificationsResult, type UpdatePreferencesInput, type UpdateTaskStatusInput, type UserSettings, UserSettingsResource, type VoicemailAuthResponse, type WebPushConfig, generateUuidV7, isWebPushSupported, onServiceWorkerMessage, registerServiceWorker, subscribeToPush, subscriptionToJSON };
1789
+ export { AUTH_EVENTS, type ActorContext, type Appointment, type AppointmentListOptions, AppointmentResource, type Attachment, AttachmentsError, AttachmentsResource, type AuthEventType, type AuthLoginFailedPayload, type AuthLoginSucceededPayload, type AuthTokenFetcher, CALL_EVENTS, CONVERSATION_EVENTS, type CallConnectedPayload, type CallEndedPayload, type CallEventType, type CallInitiatedPayload, type CallMissedPayload, type CallStatusResponse, type CancelScheduledNotificationResult, type ConversationAddress, type ConversationAttachmentDownloadedPayload, type ConversationAttachmentUploadedPayload, type ConversationCreatedPayload, type ConversationEventType, type ConversationMarkedReadPayload, type ConversationMessageReceivedPayload, type ConversationMessageSentPayload, type ConversationTaskPriority, type ConversationTaskStatus, ConversationsError, ConversationsResource, type CreateConversationNoteInput, type CreateConversationTaskInput, type CreateTaskInput, type CreateUploadUrlInput, type CreateUploadUrlResult, type DetectionResult, type DialpadNumberInfo, DialpadProxyError, DialpadResource, type DialpadUser, ENVIRONMENTS, EVENT_TYPES, EhrProviderProxy, EhrProxyError, EhrResource, type Environment, type EventActor, type EventCompliance, type EventEnvelope, type EventPayloadMap, type EventSubject, type EventType, type GetDownloadUrlResult, type InitiateCallResponse, MessagesResource, NOTIFICATION_EVENTS, type NonVisitNoteBullet, NotesError, NotesResource, type NotificationDeliveredPayload, type NotificationEventType, type NotificationOpenedPayload, type NotificationPlatform, type NotificationPreferences, type NotificationSentPayload, NotificationsError, NotificationsResource, PROVIDER_EVENTS, type PaginatedResult, type Patient, type PatientBasicDetailsResult, PatientDetailsError, type PatientDetailsInput, PatientDetailsResource, type PatientDetailsResult, type PatientListOptions, type PatientMedicalDetailsResult, PatientResource, type Physician, PhysiciansResource, type ProviderEventType, type ProviderSyncFailedPayload, type ProviderSyncStartedPayload, type ProviderSyncSucceededPayload, type PushEventPayload, type PushNoteToElationInput, type PushNoteToElationResult, REMINDER_EVENTS, type RecordAttachmentInput, type RegisterDeviceInput, type RegisterDeviceResult, type Reminder, type ReminderEventType, type ReminderScheduledPayload, type ReminderStatus, type ReminderTriggeredPayload, RemindersResource, SECURITY_EVENTS, type ScheduleNotificationInput, type ScheduleNotificationResult, type ScheduleReminderInput, type ScheduleReminderResult, type ScheduledJobStatus, type ScheduledNotification, type SecurityAccessDeniedPayload, type SecurityEventType, type SendConversationMessageInput, type SendConversationMessageResult, type SendNotificationInput, type SendNotificationResult, type SendSmsParams, type SendSmsResponse, type SetConversationTaskStatusInput, TASK_EVENTS, TRANSLATION_EVENTS, type Task, type TaskAssignedPayload, type TaskCreatedPayload, type TaskEventType, type TaskStatus, type TaskStatusChangedPayload, TasksResource, type TrackOptions, Tracker, type TranslateBatchInput, type TranslateTextInput, type TranslationCompletedPayload, TranslationError, type TranslationEventType, type TranslationRequestedPayload, TranslationResource, type TranslationResult, TruthClient, type TruthClientConfig, type UnregisterDeviceInput, type UpdateNotificationsInput, type UpdateNotificationsResult, type UpdatePreferencesInput, type UpdateTaskStatusInput, type UserSettings, UserSettingsResource, type VoicemailAuthResponse, type WebPushConfig, generateUuidV7, isWebPushSupported, onServiceWorkerMessage, registerServiceWorker, subscribeToPush, subscriptionToJSON };
package/dist/index.d.ts CHANGED
@@ -72,12 +72,26 @@ declare const ENVIRONMENTS: {
72
72
  readonly production: "production";
73
73
  };
74
74
  type Environment = (typeof ENVIRONMENTS)[keyof typeof ENVIRONMENTS];
75
+ /**
76
+ * Fetches a user-identity JWT for Convex calls. Return the token from
77
+ * your identity provider's Clerk JWT template named "convex"
78
+ * (e.g. `getToken({ template: "convex" })` from `@clerk/expo`), or
79
+ * `null` when no user is signed in.
80
+ */
81
+ type AuthTokenFetcher = () => Promise<string | null | undefined>;
75
82
  /**
76
83
  * Configuration for initializing a TruthClient.
77
84
  */
78
85
  interface TruthClientConfig {
79
86
  /** API key for authenticating with the Truth platform (e.g. "hn_live_...") */
80
87
  apiKey: string;
88
+ /**
89
+ * Per-call Clerk JWT fetcher for Convex data access. When provided,
90
+ * every Convex query/mutation/action carries the caller's identity;
91
+ * Convex deployments with `CLERK_AUTH_REQUIRED` enabled reject calls
92
+ * without it. Omit for service contexts that don't act as a user.
93
+ */
94
+ getAuthToken?: AuthTokenFetcher;
81
95
  /** Target environment */
82
96
  environment: Environment;
83
97
  /** Override the default Convex URL for data access */
@@ -267,12 +281,6 @@ interface SetConversationTaskStatusInput {
267
281
  taskId: string;
268
282
  status: ConversationTaskStatus;
269
283
  resolvedBy?: string;
270
- /**
271
- * Email of the user performing the action. Truth excludes the actor
272
- * from the task-action push fan-out (legacy parity) — omit it and the
273
- * actor notifies themselves.
274
- */
275
- actor?: string;
276
284
  }
277
285
  interface UpdateConversationTaskInput {
278
286
  taskId: string;
@@ -287,18 +295,6 @@ interface UpdateConversationTaskInput {
287
295
  status?: ConversationTaskStatus;
288
296
  assignee?: string;
289
297
  type?: string;
290
- /**
291
- * Email of the user performing the action. Truth excludes the actor
292
- * from the task-action push fan-out (legacy parity) — omit it and the
293
- * actor notifies themselves.
294
- */
295
- actor?: string;
296
- }
297
- interface SetConversationTaskArchivedInput {
298
- taskId: string;
299
- archived: boolean;
300
- /** Email of the acting user — excluded from the archive push fan-out. */
301
- actor?: string;
302
298
  }
303
299
  interface SendConversationMessageInput {
304
300
  fromNumber: string;
@@ -335,11 +331,6 @@ declare class ConversationTasksSubresource {
335
331
  setStatus(input: SetConversationTaskStatusInput): Promise<{
336
332
  ok: true;
337
333
  }>;
338
- /** Archive or un-archive a task (hides it from My Tasks without deleting). */
339
- setArchived(input: SetConversationTaskArchivedInput): Promise<{
340
- ok: true;
341
- changed: boolean;
342
- }>;
343
334
  /**
344
335
  * Update task fields (priority, assignee, description, type). Wraps
345
336
  * `PATCH /api/conversations/tasks/{id}` so CommHub doesn't have to
@@ -1795,4 +1786,4 @@ declare function subscriptionToJSON(sub: PushSubscription): {
1795
1786
  };
1796
1787
  declare function onServiceWorkerMessage(type: string, callback: (payload: unknown) => void): () => void;
1797
1788
 
1798
- export { AUTH_EVENTS, type ActorContext, type Appointment, type AppointmentListOptions, AppointmentResource, type Attachment, AttachmentsError, AttachmentsResource, type AuthEventType, type AuthLoginFailedPayload, type AuthLoginSucceededPayload, CALL_EVENTS, CONVERSATION_EVENTS, type CallConnectedPayload, type CallEndedPayload, type CallEventType, type CallInitiatedPayload, type CallMissedPayload, type CallStatusResponse, type CancelScheduledNotificationResult, type ConversationAddress, type ConversationAttachmentDownloadedPayload, type ConversationAttachmentUploadedPayload, type ConversationCreatedPayload, type ConversationEventType, type ConversationMarkedReadPayload, type ConversationMessageReceivedPayload, type ConversationMessageSentPayload, type ConversationTaskPriority, type ConversationTaskStatus, ConversationsError, ConversationsResource, type CreateConversationNoteInput, type CreateConversationTaskInput, type CreateTaskInput, type CreateUploadUrlInput, type CreateUploadUrlResult, type DetectionResult, type DialpadNumberInfo, DialpadProxyError, DialpadResource, type DialpadUser, ENVIRONMENTS, EVENT_TYPES, EhrProviderProxy, EhrProxyError, EhrResource, type Environment, type EventActor, type EventCompliance, type EventEnvelope, type EventPayloadMap, type EventSubject, type EventType, type GetDownloadUrlResult, type InitiateCallResponse, MessagesResource, NOTIFICATION_EVENTS, type NonVisitNoteBullet, NotesError, NotesResource, type NotificationDeliveredPayload, type NotificationEventType, type NotificationOpenedPayload, type NotificationPlatform, type NotificationPreferences, type NotificationSentPayload, NotificationsError, NotificationsResource, PROVIDER_EVENTS, type PaginatedResult, type Patient, type PatientBasicDetailsResult, PatientDetailsError, type PatientDetailsInput, PatientDetailsResource, type PatientDetailsResult, type PatientListOptions, type PatientMedicalDetailsResult, PatientResource, type Physician, PhysiciansResource, type ProviderEventType, type ProviderSyncFailedPayload, type ProviderSyncStartedPayload, type ProviderSyncSucceededPayload, type PushEventPayload, type PushNoteToElationInput, type PushNoteToElationResult, REMINDER_EVENTS, type RecordAttachmentInput, type RegisterDeviceInput, type RegisterDeviceResult, type Reminder, type ReminderEventType, type ReminderScheduledPayload, type ReminderStatus, type ReminderTriggeredPayload, RemindersResource, SECURITY_EVENTS, type ScheduleNotificationInput, type ScheduleNotificationResult, type ScheduleReminderInput, type ScheduleReminderResult, type ScheduledJobStatus, type ScheduledNotification, type SecurityAccessDeniedPayload, type SecurityEventType, type SendConversationMessageInput, type SendConversationMessageResult, type SendNotificationInput, type SendNotificationResult, type SendSmsParams, type SendSmsResponse, type SetConversationTaskStatusInput, TASK_EVENTS, TRANSLATION_EVENTS, type Task, type TaskAssignedPayload, type TaskCreatedPayload, type TaskEventType, type TaskStatus, type TaskStatusChangedPayload, TasksResource, type TrackOptions, Tracker, type TranslateBatchInput, type TranslateTextInput, type TranslationCompletedPayload, TranslationError, type TranslationEventType, type TranslationRequestedPayload, TranslationResource, type TranslationResult, TruthClient, type TruthClientConfig, type UnregisterDeviceInput, type UpdateNotificationsInput, type UpdateNotificationsResult, type UpdatePreferencesInput, type UpdateTaskStatusInput, type UserSettings, UserSettingsResource, type VoicemailAuthResponse, type WebPushConfig, generateUuidV7, isWebPushSupported, onServiceWorkerMessage, registerServiceWorker, subscribeToPush, subscriptionToJSON };
1789
+ export { AUTH_EVENTS, type ActorContext, type Appointment, type AppointmentListOptions, AppointmentResource, type Attachment, AttachmentsError, AttachmentsResource, type AuthEventType, type AuthLoginFailedPayload, type AuthLoginSucceededPayload, type AuthTokenFetcher, CALL_EVENTS, CONVERSATION_EVENTS, type CallConnectedPayload, type CallEndedPayload, type CallEventType, type CallInitiatedPayload, type CallMissedPayload, type CallStatusResponse, type CancelScheduledNotificationResult, type ConversationAddress, type ConversationAttachmentDownloadedPayload, type ConversationAttachmentUploadedPayload, type ConversationCreatedPayload, type ConversationEventType, type ConversationMarkedReadPayload, type ConversationMessageReceivedPayload, type ConversationMessageSentPayload, type ConversationTaskPriority, type ConversationTaskStatus, ConversationsError, ConversationsResource, type CreateConversationNoteInput, type CreateConversationTaskInput, type CreateTaskInput, type CreateUploadUrlInput, type CreateUploadUrlResult, type DetectionResult, type DialpadNumberInfo, DialpadProxyError, DialpadResource, type DialpadUser, ENVIRONMENTS, EVENT_TYPES, EhrProviderProxy, EhrProxyError, EhrResource, type Environment, type EventActor, type EventCompliance, type EventEnvelope, type EventPayloadMap, type EventSubject, type EventType, type GetDownloadUrlResult, type InitiateCallResponse, MessagesResource, NOTIFICATION_EVENTS, type NonVisitNoteBullet, NotesError, NotesResource, type NotificationDeliveredPayload, type NotificationEventType, type NotificationOpenedPayload, type NotificationPlatform, type NotificationPreferences, type NotificationSentPayload, NotificationsError, NotificationsResource, PROVIDER_EVENTS, type PaginatedResult, type Patient, type PatientBasicDetailsResult, PatientDetailsError, type PatientDetailsInput, PatientDetailsResource, type PatientDetailsResult, type PatientListOptions, type PatientMedicalDetailsResult, PatientResource, type Physician, PhysiciansResource, type ProviderEventType, type ProviderSyncFailedPayload, type ProviderSyncStartedPayload, type ProviderSyncSucceededPayload, type PushEventPayload, type PushNoteToElationInput, type PushNoteToElationResult, REMINDER_EVENTS, type RecordAttachmentInput, type RegisterDeviceInput, type RegisterDeviceResult, type Reminder, type ReminderEventType, type ReminderScheduledPayload, type ReminderStatus, type ReminderTriggeredPayload, RemindersResource, SECURITY_EVENTS, type ScheduleNotificationInput, type ScheduleNotificationResult, type ScheduleReminderInput, type ScheduleReminderResult, type ScheduledJobStatus, type ScheduledNotification, type SecurityAccessDeniedPayload, type SecurityEventType, type SendConversationMessageInput, type SendConversationMessageResult, type SendNotificationInput, type SendNotificationResult, type SendSmsParams, type SendSmsResponse, type SetConversationTaskStatusInput, TASK_EVENTS, TRANSLATION_EVENTS, type Task, type TaskAssignedPayload, type TaskCreatedPayload, type TaskEventType, type TaskStatus, type TaskStatusChangedPayload, TasksResource, type TrackOptions, Tracker, type TranslateBatchInput, type TranslateTextInput, type TranslationCompletedPayload, TranslationError, type TranslationEventType, type TranslationRequestedPayload, TranslationResource, type TranslationResult, TruthClient, type TruthClientConfig, type UnregisterDeviceInput, type UpdateNotificationsInput, type UpdateNotificationsResult, type UpdatePreferencesInput, type UpdateTaskStatusInput, type UserSettings, UserSettingsResource, type VoicemailAuthResponse, type WebPushConfig, generateUuidV7, isWebPushSupported, onServiceWorkerMessage, registerServiceWorker, subscribeToPush, subscriptionToJSON };
package/dist/index.js CHANGED
@@ -3,8 +3,10 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
+ var __getProtoOf = Object.getPrototypeOf;
6
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
8
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
+ var __reflectGet = Reflect.get;
8
10
  var __pow = Math.pow;
9
11
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
12
  var __spreadValues = (a, b) => {
@@ -31,6 +33,7 @@ var __copyProps = (to, from, except, desc) => {
31
33
  return to;
32
34
  };
33
35
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
36
+ var __superGet = (cls, obj, key) => __reflectGet(__getProtoOf(cls), key, obj);
34
37
  var __async = (__this, __arguments, generator) => {
35
38
  return new Promise((resolve, reject) => {
36
39
  var fulfilled = (value) => {
@@ -101,8 +104,53 @@ __export(src_exports, {
101
104
  });
102
105
  module.exports = __toCommonJS(src_exports);
103
106
 
104
- // src/client.ts
107
+ // src/auth-convex-client.ts
105
108
  var import_browser = require("convex/browser");
109
+ var AuthAwareConvexHttpClient = class _AuthAwareConvexHttpClient extends import_browser.ConvexHttpClient {
110
+ constructor(address, getAuthToken) {
111
+ super(address);
112
+ this.getAuthToken = getAuthToken;
113
+ }
114
+ /**
115
+ * Pull a fresh token from the fetcher and apply it. A fetcher error
116
+ * keeps the previously-applied token rather than dropping auth
117
+ * mid-session.
118
+ */
119
+ syncAuth() {
120
+ return __async(this, null, function* () {
121
+ if (!this.getAuthToken) {
122
+ return;
123
+ }
124
+ try {
125
+ const token = yield this.getAuthToken();
126
+ if (token) {
127
+ this.setAuth(token);
128
+ } else {
129
+ this.clearAuth();
130
+ }
131
+ } catch (e) {
132
+ }
133
+ });
134
+ }
135
+ query(query, ...args) {
136
+ return __async(this, null, function* () {
137
+ yield this.syncAuth();
138
+ return __superGet(_AuthAwareConvexHttpClient.prototype, this, "query").call(this, query, ...args);
139
+ });
140
+ }
141
+ mutation(mutation, ...args) {
142
+ return __async(this, null, function* () {
143
+ yield this.syncAuth();
144
+ return __superGet(_AuthAwareConvexHttpClient.prototype, this, "mutation").call(this, mutation, ...args);
145
+ });
146
+ }
147
+ action(action, ...args) {
148
+ return __async(this, null, function* () {
149
+ yield this.syncAuth();
150
+ return __superGet(_AuthAwareConvexHttpClient.prototype, this, "action").call(this, action, ...args);
151
+ });
152
+ }
153
+ };
106
154
 
107
155
  // src/resources/appointments.ts
108
156
  var AppointmentResource = class {
@@ -350,22 +398,10 @@ var ConversationTasksSubresource = class {
350
398
  return __async(this, null, function* () {
351
399
  return this.post(
352
400
  `/conversations/tasks/${encodeURIComponent(input.taskId)}/status`,
353
- __spreadValues(__spreadValues({
354
- id: input.taskId,
355
- status: input.status
356
- }, input.resolvedBy ? { resolvedBy: input.resolvedBy } : {}), input.actor ? { actor: input.actor } : {})
357
- );
358
- });
359
- }
360
- /** Archive or un-archive a task (hides it from My Tasks without deleting). */
361
- setArchived(input) {
362
- return __async(this, null, function* () {
363
- return this.post(
364
- `/conversations/tasks/${encodeURIComponent(input.taskId)}/archive`,
365
401
  __spreadValues({
366
402
  id: input.taskId,
367
- archived: input.archived
368
- }, input.actor ? { actor: input.actor } : {})
403
+ status: input.status
404
+ }, input.resolvedBy ? { resolvedBy: input.resolvedBy } : {})
369
405
  );
370
406
  });
371
407
  }
@@ -378,12 +414,12 @@ var ConversationTasksSubresource = class {
378
414
  return __async(this, null, function* () {
379
415
  return this.patch(
380
416
  `/conversations/tasks/${encodeURIComponent(input.taskId)}`,
381
- __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({
417
+ __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({
382
418
  id: input.taskId,
383
419
  conversationId: input.conversationId,
384
420
  author: input.author,
385
421
  description: input.description
386
- }, input.title !== void 0 ? { title: input.title } : {}), input.priority ? { priority: input.priority } : {}), input.status ? { status: input.status } : {}), input.assignee !== void 0 ? { assignee: input.assignee } : {}), input.type !== void 0 ? { type: input.type } : {}), input.actor ? { actor: input.actor } : {})
422
+ }, input.title !== void 0 ? { title: input.title } : {}), input.priority ? { priority: input.priority } : {}), input.status ? { status: input.status } : {}), input.assignee !== void 0 ? { assignee: input.assignee } : {}), input.type !== void 0 ? { type: input.type } : {})
387
423
  );
388
424
  });
389
425
  }
@@ -1945,7 +1981,7 @@ var TruthClient = class {
1945
1981
  this._webPushReady = null;
1946
1982
  var _a, _b, _c, _d, _e, _f, _g, _h;
1947
1983
  const convexUrl = (_b = (_a = config.convexUrl) != null ? _a : CONVEX_URLS[config.environment]) != null ? _b : CONVEX_URLS.local;
1948
- this.convex = new import_browser.ConvexHttpClient(convexUrl);
1984
+ this.convex = new AuthAwareConvexHttpClient(convexUrl, config.getAuthToken);
1949
1985
  this.tracker = new Tracker({
1950
1986
  apiKey: config.apiKey,
1951
1987
  environment: config.environment,