@bluecopa/core 0.1.60 → 0.1.61

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.
@@ -0,0 +1,32 @@
1
+ export type InboxAlertType = "REPORT" | "DASHBOARD" | "DATASET" | "EXPORT_RESULT" | "RECON_RESULT" | "EXPORT_AS_DATASET_RESULT" | "DATA_PIPELINE_RESULT" | "PROCESS_TASK_ASSIGNMENT" | "PROCESS_ALERT" | "PROCESS_DUE_ALERT" | "CHAT_COMMENT_MENTION_ALERT" | "EXTERNAL_APP_ALERT";
2
+ export interface CreateInboxItemRequest {
3
+ message: string;
4
+ variables: Record<string, object>;
5
+ alertType: InboxAlertType;
6
+ users: string[];
7
+ teams: string[];
8
+ showLogo: boolean;
9
+ }
10
+ export interface CreatedInboxItem {
11
+ id?: string;
12
+ message: string;
13
+ alertType: InboxAlertType;
14
+ variables: Record<string, object>;
15
+ userId: string;
16
+ userAlert: boolean;
17
+ teamAlert: boolean;
18
+ teamIds?: string[];
19
+ read: boolean;
20
+ createdBy?: string;
21
+ createdDate?: string;
22
+ lastModifiedBy?: string;
23
+ lastModifiedDate?: string;
24
+ workspaceId?: string;
25
+ }
26
+ /**
27
+ * Creates inbox items for the specified users and teams
28
+ * @param data - The inbox item details
29
+ * @returns Promise<CreatedInboxItem[]> Created inbox items
30
+ * @throws Error if the request fails
31
+ */
32
+ export declare function createInboxItemPerUser(data: CreateInboxItemRequest): Promise<CreatedInboxItem[]>;
@@ -1,6 +1,8 @@
1
1
  export { getAllInboxItems } from './getAllInboxItems';
2
2
  export { markItemAsRead } from './markItemAsRead';
3
3
  export { markItemAsUnread } from './markItemAsUnread';
4
+ export { createInboxItemPerUser } from './createInboxItemPerUser';
4
5
  export type { GetAllInboxItemsRequest, InboxItem } from './getAllInboxItems';
5
6
  export type { MarkItemAsReadRequest } from './markItemAsRead';
6
7
  export type { MarkItemAsUnreadRequest } from './markItemAsUnread';
8
+ export type { CreateInboxItemRequest, CreatedInboxItem, InboxAlertType, } from './createInboxItemPerUser';
package/dist/index.es.js CHANGED
@@ -11406,8 +11406,27 @@ async function markItemAsUnread({
11406
11406
  throw { message, status };
11407
11407
  }
11408
11408
  }
11409
+ async function createInboxItemPerUser(data) {
11410
+ var _a, _b, _c, _d, _e, _f;
11411
+ if (!((_b = (_a = data == null ? void 0 : data.message) == null ? void 0 : _a.trim) == null ? void 0 : _b.call(_a))) {
11412
+ throw { message: "message is required", status: 400 };
11413
+ }
11414
+ if (!(data == null ? void 0 : data.alertType)) {
11415
+ throw { message: "alertType is required", status: 400 };
11416
+ }
11417
+ try {
11418
+ const response = await apiClient.post("/inbox-items/create", data);
11419
+ return ((_c = response.data) == null ? void 0 : _c.data) ?? response.data;
11420
+ } catch (error) {
11421
+ const e = error;
11422
+ const message = ((_e = (_d = e.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || e.message || "Failed to create inbox item";
11423
+ const status = ((_f = e.response) == null ? void 0 : _f.status) || 500;
11424
+ throw { message, status };
11425
+ }
11426
+ }
11409
11427
  const index$6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11410
11428
  __proto__: null,
11429
+ createInboxItemPerUser,
11411
11430
  getAllInboxItems,
11412
11431
  markItemAsRead,
11413
11432
  markItemAsUnread