@bluecopa/core 0.1.60 → 0.1.62
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
|
|
@@ -12446,7 +12465,9 @@ class DocRefImpl {
|
|
|
12446
12465
|
return doc ? doc.toJSON() : null;
|
|
12447
12466
|
}
|
|
12448
12467
|
async update(data) {
|
|
12468
|
+
console.log("doxxxxx 12344");
|
|
12449
12469
|
const doc = await this.collection.findOne(this.id).exec();
|
|
12470
|
+
console.log("doxxxxx", doc);
|
|
12450
12471
|
if (!doc) {
|
|
12451
12472
|
throw new InputTableError(`Document "${this.id}" not found`, 404);
|
|
12452
12473
|
}
|
|
@@ -12454,6 +12475,7 @@ class DocRefImpl {
|
|
|
12454
12475
|
delete patch[this.primaryKeyField];
|
|
12455
12476
|
delete patch[CHECKPOINT_FIELD];
|
|
12456
12477
|
await doc.patch(patch);
|
|
12478
|
+
await doc.upsert(patch);
|
|
12457
12479
|
}
|
|
12458
12480
|
async delete() {
|
|
12459
12481
|
await apiClient.request({
|
|
@@ -12886,9 +12908,11 @@ function createReplication(collection, solutionId, tableName, primaryKeyField) {
|
|
|
12886
12908
|
async handler(changeRows) {
|
|
12887
12909
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
12888
12910
|
const conflicts = [];
|
|
12911
|
+
console.log(changeRows, "chnageRows");
|
|
12889
12912
|
for (const row of changeRows) {
|
|
12890
12913
|
const doc = row.newDocumentState;
|
|
12891
12914
|
try {
|
|
12915
|
+
debugger;
|
|
12892
12916
|
let serverResponse;
|
|
12893
12917
|
if (row.assumedMasterState == null) {
|
|
12894
12918
|
const insertData = { ...doc };
|
|
@@ -13042,7 +13066,10 @@ async function createCollectionInternal(key, solutionId, tableDef, workspaceId,
|
|
|
13042
13066
|
const collectionConfig = {
|
|
13043
13067
|
schema,
|
|
13044
13068
|
conflictHandler: {
|
|
13045
|
-
isEqual: (a, b) =>
|
|
13069
|
+
isEqual: (a, b) => {
|
|
13070
|
+
console.log("kywfvyiubwe", { CHECKPOINT_FIELD, a, b });
|
|
13071
|
+
return a[CHECKPOINT_FIELD] === b[CHECKPOINT_FIELD];
|
|
13072
|
+
},
|
|
13046
13073
|
resolve: (i) => i.realMasterState
|
|
13047
13074
|
// server wins
|
|
13048
13075
|
}
|