@baasix/sdk 0.1.18 → 0.1.19
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.cjs +49 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +37 -2
- package/dist/index.d.ts +37 -2
- package/dist/index.js +49 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2406,6 +2406,42 @@ var NotificationsModule = class {
|
|
|
2406
2406
|
);
|
|
2407
2407
|
return { count: response.count };
|
|
2408
2408
|
}
|
|
2409
|
+
/**
|
|
2410
|
+
* Mark notifications as unseen (unread)
|
|
2411
|
+
*
|
|
2412
|
+
* @example
|
|
2413
|
+
* ```typescript
|
|
2414
|
+
* // Mark specific notifications as unseen
|
|
2415
|
+
* await baasix.notifications.markAsUnseen(['id1', 'id2']);
|
|
2416
|
+
*
|
|
2417
|
+
* // Mark all notifications as unseen
|
|
2418
|
+
* await baasix.notifications.markAsUnseen();
|
|
2419
|
+
* ```
|
|
2420
|
+
*/
|
|
2421
|
+
async markAsUnseen(notificationIds) {
|
|
2422
|
+
const response = await this.client.post(
|
|
2423
|
+
"/notifications/mark-unseen",
|
|
2424
|
+
{ notificationIds }
|
|
2425
|
+
);
|
|
2426
|
+
return { count: response.count };
|
|
2427
|
+
}
|
|
2428
|
+
/**
|
|
2429
|
+
* Get the per-type notification link templates configured in settings
|
|
2430
|
+
* (`metadata.notificationLinks`). Templates may contain `{{field}}`
|
|
2431
|
+
* placeholders resolved from the notification (including `data.*` paths).
|
|
2432
|
+
*
|
|
2433
|
+
* @example
|
|
2434
|
+
* ```typescript
|
|
2435
|
+
* const links = await baasix.notifications.getLinks();
|
|
2436
|
+
* // { task_assigned: '/pages/?slug=tasks&id={{data.taskId}}' }
|
|
2437
|
+
* ```
|
|
2438
|
+
*/
|
|
2439
|
+
async getLinks() {
|
|
2440
|
+
const response = await this.client.get(
|
|
2441
|
+
"/notifications/links"
|
|
2442
|
+
);
|
|
2443
|
+
return response.data ?? {};
|
|
2444
|
+
}
|
|
2409
2445
|
/**
|
|
2410
2446
|
* Delete notifications for the current user
|
|
2411
2447
|
*
|
|
@@ -2712,10 +2748,11 @@ var SettingsModule = class {
|
|
|
2712
2748
|
* });
|
|
2713
2749
|
* ```
|
|
2714
2750
|
*/
|
|
2715
|
-
async update(settings) {
|
|
2751
|
+
async update(settings, options) {
|
|
2716
2752
|
const response = await this.client.patch(
|
|
2717
2753
|
"/settings",
|
|
2718
|
-
settings
|
|
2754
|
+
settings,
|
|
2755
|
+
options?.tenantId !== void 0 && options?.tenantId !== null ? { params: { tenant_id: options.tenantId } } : void 0
|
|
2719
2756
|
);
|
|
2720
2757
|
return response.data;
|
|
2721
2758
|
}
|
|
@@ -4721,15 +4758,23 @@ var ServerModule = class {
|
|
|
4721
4758
|
/**
|
|
4722
4759
|
* Get server information including project settings
|
|
4723
4760
|
*
|
|
4761
|
+
* @param tenantId - Optional tenant ID to fetch tenant-merged project settings
|
|
4762
|
+
*
|
|
4724
4763
|
* @example
|
|
4725
4764
|
* ```typescript
|
|
4726
4765
|
* const info = await baasix.server.info();
|
|
4727
4766
|
* console.log('Project:', info.project?.name);
|
|
4728
4767
|
* console.log('Version:', info.version);
|
|
4768
|
+
*
|
|
4769
|
+
* // Tenant-aware: settings merged for the given tenant
|
|
4770
|
+
* const tenantInfo = await baasix.server.info("tenant-uuid");
|
|
4729
4771
|
* ```
|
|
4730
4772
|
*/
|
|
4731
|
-
async info() {
|
|
4732
|
-
return this.client.get(
|
|
4773
|
+
async info(tenantId) {
|
|
4774
|
+
return this.client.get(
|
|
4775
|
+
"/",
|
|
4776
|
+
tenantId ? { params: { tenant_id: tenantId } } : void 0
|
|
4777
|
+
);
|
|
4733
4778
|
}
|
|
4734
4779
|
/**
|
|
4735
4780
|
* Check server health
|