@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.d.cts CHANGED
@@ -146,6 +146,7 @@ declare class NotificationsModule {
146
146
  limit?: number;
147
147
  page?: number;
148
148
  filter?: Record<string, unknown>;
149
+ sort?: string[] | Record<string, "asc" | "desc">;
149
150
  }): Promise<PaginatedResponse<Notification>>;
150
151
  /**
151
152
  * Get unread notification count
@@ -171,6 +172,33 @@ declare class NotificationsModule {
171
172
  markAsSeen(notificationIds?: string[]): Promise<{
172
173
  count: number;
173
174
  }>;
175
+ /**
176
+ * Mark notifications as unseen (unread)
177
+ *
178
+ * @example
179
+ * ```typescript
180
+ * // Mark specific notifications as unseen
181
+ * await baasix.notifications.markAsUnseen(['id1', 'id2']);
182
+ *
183
+ * // Mark all notifications as unseen
184
+ * await baasix.notifications.markAsUnseen();
185
+ * ```
186
+ */
187
+ markAsUnseen(notificationIds?: string[]): Promise<{
188
+ count: number;
189
+ }>;
190
+ /**
191
+ * Get the per-type notification link templates configured in settings
192
+ * (`metadata.notificationLinks`). Templates may contain `{{field}}`
193
+ * placeholders resolved from the notification (including `data.*` paths).
194
+ *
195
+ * @example
196
+ * ```typescript
197
+ * const links = await baasix.notifications.getLinks();
198
+ * // { task_assigned: '/pages/?slug=tasks&id={{data.taskId}}' }
199
+ * ```
200
+ */
201
+ getLinks(): Promise<Record<string, string>>;
174
202
  /**
175
203
  * Delete notifications for the current user
176
204
  *
@@ -459,7 +487,9 @@ declare class SettingsModule {
459
487
  * });
460
488
  * ```
461
489
  */
462
- update(settings: Partial<Settings>): Promise<Settings>;
490
+ update(settings: Partial<Settings>, options?: {
491
+ tenantId?: string | number;
492
+ }): Promise<Settings>;
463
493
  /**
464
494
  * Set a specific setting
465
495
  *
@@ -2066,14 +2096,19 @@ declare class ServerModule {
2066
2096
  /**
2067
2097
  * Get server information including project settings
2068
2098
  *
2099
+ * @param tenantId - Optional tenant ID to fetch tenant-merged project settings
2100
+ *
2069
2101
  * @example
2070
2102
  * ```typescript
2071
2103
  * const info = await baasix.server.info();
2072
2104
  * console.log('Project:', info.project?.name);
2073
2105
  * console.log('Version:', info.version);
2106
+ *
2107
+ * // Tenant-aware: settings merged for the given tenant
2108
+ * const tenantInfo = await baasix.server.info("tenant-uuid");
2074
2109
  * ```
2075
2110
  */
2076
- info(): Promise<ServerInfo>;
2111
+ info(tenantId?: string): Promise<ServerInfo>;
2077
2112
  /**
2078
2113
  * Check server health
2079
2114
  *
package/dist/index.d.ts CHANGED
@@ -146,6 +146,7 @@ declare class NotificationsModule {
146
146
  limit?: number;
147
147
  page?: number;
148
148
  filter?: Record<string, unknown>;
149
+ sort?: string[] | Record<string, "asc" | "desc">;
149
150
  }): Promise<PaginatedResponse<Notification>>;
150
151
  /**
151
152
  * Get unread notification count
@@ -171,6 +172,33 @@ declare class NotificationsModule {
171
172
  markAsSeen(notificationIds?: string[]): Promise<{
172
173
  count: number;
173
174
  }>;
175
+ /**
176
+ * Mark notifications as unseen (unread)
177
+ *
178
+ * @example
179
+ * ```typescript
180
+ * // Mark specific notifications as unseen
181
+ * await baasix.notifications.markAsUnseen(['id1', 'id2']);
182
+ *
183
+ * // Mark all notifications as unseen
184
+ * await baasix.notifications.markAsUnseen();
185
+ * ```
186
+ */
187
+ markAsUnseen(notificationIds?: string[]): Promise<{
188
+ count: number;
189
+ }>;
190
+ /**
191
+ * Get the per-type notification link templates configured in settings
192
+ * (`metadata.notificationLinks`). Templates may contain `{{field}}`
193
+ * placeholders resolved from the notification (including `data.*` paths).
194
+ *
195
+ * @example
196
+ * ```typescript
197
+ * const links = await baasix.notifications.getLinks();
198
+ * // { task_assigned: '/pages/?slug=tasks&id={{data.taskId}}' }
199
+ * ```
200
+ */
201
+ getLinks(): Promise<Record<string, string>>;
174
202
  /**
175
203
  * Delete notifications for the current user
176
204
  *
@@ -459,7 +487,9 @@ declare class SettingsModule {
459
487
  * });
460
488
  * ```
461
489
  */
462
- update(settings: Partial<Settings>): Promise<Settings>;
490
+ update(settings: Partial<Settings>, options?: {
491
+ tenantId?: string | number;
492
+ }): Promise<Settings>;
463
493
  /**
464
494
  * Set a specific setting
465
495
  *
@@ -2066,14 +2096,19 @@ declare class ServerModule {
2066
2096
  /**
2067
2097
  * Get server information including project settings
2068
2098
  *
2099
+ * @param tenantId - Optional tenant ID to fetch tenant-merged project settings
2100
+ *
2069
2101
  * @example
2070
2102
  * ```typescript
2071
2103
  * const info = await baasix.server.info();
2072
2104
  * console.log('Project:', info.project?.name);
2073
2105
  * console.log('Version:', info.version);
2106
+ *
2107
+ * // Tenant-aware: settings merged for the given tenant
2108
+ * const tenantInfo = await baasix.server.info("tenant-uuid");
2074
2109
  * ```
2075
2110
  */
2076
- info(): Promise<ServerInfo>;
2111
+ info(tenantId?: string): Promise<ServerInfo>;
2077
2112
  /**
2078
2113
  * Check server health
2079
2114
  *
package/dist/index.js CHANGED
@@ -2404,6 +2404,42 @@ var NotificationsModule = class {
2404
2404
  );
2405
2405
  return { count: response.count };
2406
2406
  }
2407
+ /**
2408
+ * Mark notifications as unseen (unread)
2409
+ *
2410
+ * @example
2411
+ * ```typescript
2412
+ * // Mark specific notifications as unseen
2413
+ * await baasix.notifications.markAsUnseen(['id1', 'id2']);
2414
+ *
2415
+ * // Mark all notifications as unseen
2416
+ * await baasix.notifications.markAsUnseen();
2417
+ * ```
2418
+ */
2419
+ async markAsUnseen(notificationIds) {
2420
+ const response = await this.client.post(
2421
+ "/notifications/mark-unseen",
2422
+ { notificationIds }
2423
+ );
2424
+ return { count: response.count };
2425
+ }
2426
+ /**
2427
+ * Get the per-type notification link templates configured in settings
2428
+ * (`metadata.notificationLinks`). Templates may contain `{{field}}`
2429
+ * placeholders resolved from the notification (including `data.*` paths).
2430
+ *
2431
+ * @example
2432
+ * ```typescript
2433
+ * const links = await baasix.notifications.getLinks();
2434
+ * // { task_assigned: '/pages/?slug=tasks&id={{data.taskId}}' }
2435
+ * ```
2436
+ */
2437
+ async getLinks() {
2438
+ const response = await this.client.get(
2439
+ "/notifications/links"
2440
+ );
2441
+ return response.data ?? {};
2442
+ }
2407
2443
  /**
2408
2444
  * Delete notifications for the current user
2409
2445
  *
@@ -2710,10 +2746,11 @@ var SettingsModule = class {
2710
2746
  * });
2711
2747
  * ```
2712
2748
  */
2713
- async update(settings) {
2749
+ async update(settings, options) {
2714
2750
  const response = await this.client.patch(
2715
2751
  "/settings",
2716
- settings
2752
+ settings,
2753
+ options?.tenantId !== void 0 && options?.tenantId !== null ? { params: { tenant_id: options.tenantId } } : void 0
2717
2754
  );
2718
2755
  return response.data;
2719
2756
  }
@@ -4719,15 +4756,23 @@ var ServerModule = class {
4719
4756
  /**
4720
4757
  * Get server information including project settings
4721
4758
  *
4759
+ * @param tenantId - Optional tenant ID to fetch tenant-merged project settings
4760
+ *
4722
4761
  * @example
4723
4762
  * ```typescript
4724
4763
  * const info = await baasix.server.info();
4725
4764
  * console.log('Project:', info.project?.name);
4726
4765
  * console.log('Version:', info.version);
4766
+ *
4767
+ * // Tenant-aware: settings merged for the given tenant
4768
+ * const tenantInfo = await baasix.server.info("tenant-uuid");
4727
4769
  * ```
4728
4770
  */
4729
- async info() {
4730
- return this.client.get("/");
4771
+ async info(tenantId) {
4772
+ return this.client.get(
4773
+ "/",
4774
+ tenantId ? { params: { tenant_id: tenantId } } : void 0
4775
+ );
4731
4776
  }
4732
4777
  /**
4733
4778
  * Check server health