@bluecopa/core 0.1.59 → 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
@@ -11841,7 +11860,7 @@ const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
11841
11860
  processManualDial,
11842
11861
  refreshToken
11843
11862
  }, Symbol.toStringTag, { value: "Module" }));
11844
- const BASE$4 = "/api/v1/webcron/webhooks";
11863
+ const BASE$4 = "/webcron/webhooks";
11845
11864
  async function listWebhooks() {
11846
11865
  var _a, _b, _c, _d;
11847
11866
  try {
@@ -11940,7 +11959,7 @@ async function createWebhookSchedule(webhookId, data) {
11940
11959
  throw { message: ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || "Failed to create schedule", status: ((_d = e.response) == null ? void 0 : _d.status) || 500 };
11941
11960
  }
11942
11961
  }
11943
- const BASE$3 = "/api/v1/webcron/schedules";
11962
+ const BASE$3 = "/webcron/schedules";
11944
11963
  async function getSchedule(id) {
11945
11964
  var _a, _b, _c, _d;
11946
11965
  if (!(id == null ? void 0 : id.trim())) throw { message: "id is required", status: 400 };
@@ -12006,7 +12025,7 @@ async function triggerSchedule(id) {
12006
12025
  throw { message: ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || "Failed to trigger schedule", status: ((_d = e.response) == null ? void 0 : _d.status) || 500 };
12007
12026
  }
12008
12027
  }
12009
- const BASE$2 = "/api/v1/webcron/executions";
12028
+ const BASE$2 = "/webcron/executions";
12010
12029
  async function listExecutions(params) {
12011
12030
  var _a, _b, _c, _d;
12012
12031
  try {
@@ -12039,7 +12058,7 @@ async function retryExecution(id) {
12039
12058
  throw { message: ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || "Failed to retry execution", status: ((_d = e.response) == null ? void 0 : _d.status) || 500 };
12040
12059
  }
12041
12060
  }
12042
- const BASE$1 = "/api/v1/webcron/tasks";
12061
+ const BASE$1 = "/webcron/tasks";
12043
12062
  async function listTasks() {
12044
12063
  var _a, _b, _c, _d;
12045
12064
  try {
@@ -12116,7 +12135,7 @@ async function signalTask(id, data, branchId) {
12116
12135
  throw { message: ((_c = (_b = e.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || "Failed to signal task", status: ((_d = e.response) == null ? void 0 : _d.status) || 500 };
12117
12136
  }
12118
12137
  }
12119
- const BASE = "/api/v1/webcron/inspection/bins";
12138
+ const BASE = "/webcron/inspection/bins";
12120
12139
  async function listBins() {
12121
12140
  var _a, _b, _c, _d;
12122
12141
  try {
@@ -12187,7 +12206,7 @@ async function triggerWorkflowById(id, data) {
12187
12206
  }
12188
12207
  try {
12189
12208
  const response = await apiClient.post(
12190
- `/api/v1/workflow/trigger/${id.trim()}`,
12209
+ `/workflow/trigger/${id.trim()}`,
12191
12210
  data ?? {}
12192
12211
  );
12193
12212
  return ((_a = response.data) == null ? void 0 : _a.data) ?? response.data;