@objectstack/client 2.0.2 → 2.0.4

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @objectstack/client@2.0.2 build /home/runner/work/spec/spec/packages/client
2
+ > @objectstack/client@2.0.4 build /home/runner/work/spec/spec/packages/client
3
3
  > tsup --config ../../tsup.config.ts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -10,13 +10,13 @@
10
10
  CLI Cleaning output folder
11
11
  ESM Build start
12
12
  CJS Build start
13
- ESM dist/index.mjs 38.84 KB
14
- ESM dist/index.mjs.map 78.88 KB
15
- ESM ⚡️ Build success in 34ms
16
- CJS dist/index.js 39.99 KB
17
- CJS dist/index.js.map 78.94 KB
18
- CJS ⚡️ Build success in 34ms
13
+ CJS dist/index.js 40.50 KB
14
+ CJS dist/index.js.map 79.61 KB
15
+ CJS ⚡️ Build success in 36ms
16
+ ESM dist/index.mjs 39.35 KB
17
+ ESM dist/index.mjs.map 79.55 KB
18
+ ESM ⚡️ Build success in 44ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 2988ms
21
- DTS dist/index.d.mts 22.77 KB
22
- DTS dist/index.d.ts 22.77 KB
20
+ DTS ⚡️ Build success in 2837ms
21
+ DTS dist/index.d.mts 23.61 KB
22
+ DTS dist/index.d.ts 23.61 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @objectstack/client
2
2
 
3
+ ## 2.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Patch release for maintenance and stability improvements
8
+ - Updated dependencies
9
+ - @objectstack/spec@2.0.4
10
+ - @objectstack/core@2.0.4
11
+
12
+ ## 2.0.3
13
+
14
+ ### Patch Changes
15
+
16
+ - Patch release for maintenance and stability improvements
17
+ - Updated dependencies
18
+ - @objectstack/spec@2.0.3
19
+ - @objectstack/core@2.0.3
20
+
3
21
  ## 2.0.2
4
22
 
5
23
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -283,6 +283,13 @@ declare class ObjectStackClient {
283
283
  ai?: string | undefined;
284
284
  i18n?: string | undefined;
285
285
  } | undefined;
286
+ services?: Record<string, {
287
+ enabled: boolean;
288
+ status: "degraded" | "available" | "unavailable" | "stub";
289
+ route?: string | undefined;
290
+ provider?: string | undefined;
291
+ message?: string | undefined;
292
+ }> | undefined;
286
293
  }>;
287
294
  /**
288
295
  * Metadata Operations
@@ -406,17 +413,32 @@ declare class ObjectStackClient {
406
413
  * Authentication Services
407
414
  */
408
415
  auth: {
416
+ /**
417
+ * Login with email and password
418
+ * Uses better-auth endpoint: POST /sign-in/email
419
+ */
409
420
  login: (request: LoginRequest) => Promise<SessionResponse>;
421
+ /**
422
+ * Logout current user
423
+ * Uses better-auth endpoint: POST /sign-out
424
+ */
410
425
  logout: () => Promise<void>;
426
+ /**
427
+ * Get current user session
428
+ * Uses better-auth endpoint: GET /get-session
429
+ */
411
430
  me: () => Promise<SessionResponse>;
412
431
  /**
413
432
  * Register a new user account
433
+ * Uses better-auth endpoint: POST /sign-up/email
414
434
  */
415
435
  register: (request: RegisterRequest) => Promise<SessionResponse>;
416
436
  /**
417
437
  * Refresh an authentication token
438
+ * Note: better-auth handles token refresh automatically via /get-session
439
+ * @param _refreshToken - Not used (better-auth handles refresh automatically)
418
440
  */
419
- refreshToken: (refreshToken: string) => Promise<SessionResponse>;
441
+ refreshToken: (_refreshToken: string) => Promise<SessionResponse>;
420
442
  };
421
443
  /**
422
444
  * Storage Services
package/dist/index.d.ts CHANGED
@@ -283,6 +283,13 @@ declare class ObjectStackClient {
283
283
  ai?: string | undefined;
284
284
  i18n?: string | undefined;
285
285
  } | undefined;
286
+ services?: Record<string, {
287
+ enabled: boolean;
288
+ status: "degraded" | "available" | "unavailable" | "stub";
289
+ route?: string | undefined;
290
+ provider?: string | undefined;
291
+ message?: string | undefined;
292
+ }> | undefined;
286
293
  }>;
287
294
  /**
288
295
  * Metadata Operations
@@ -406,17 +413,32 @@ declare class ObjectStackClient {
406
413
  * Authentication Services
407
414
  */
408
415
  auth: {
416
+ /**
417
+ * Login with email and password
418
+ * Uses better-auth endpoint: POST /sign-in/email
419
+ */
409
420
  login: (request: LoginRequest) => Promise<SessionResponse>;
421
+ /**
422
+ * Logout current user
423
+ * Uses better-auth endpoint: POST /sign-out
424
+ */
410
425
  logout: () => Promise<void>;
426
+ /**
427
+ * Get current user session
428
+ * Uses better-auth endpoint: GET /get-session
429
+ */
411
430
  me: () => Promise<SessionResponse>;
412
431
  /**
413
432
  * Register a new user account
433
+ * Uses better-auth endpoint: POST /sign-up/email
414
434
  */
415
435
  register: (request: RegisterRequest) => Promise<SessionResponse>;
416
436
  /**
417
437
  * Refresh an authentication token
438
+ * Note: better-auth handles token refresh automatically via /get-session
439
+ * @param _refreshToken - Not used (better-auth handles refresh automatically)
418
440
  */
419
- refreshToken: (refreshToken: string) => Promise<SessionResponse>;
441
+ refreshToken: (_refreshToken: string) => Promise<SessionResponse>;
420
442
  };
421
443
  /**
422
444
  * Storage Services
package/dist/index.js CHANGED
@@ -518,9 +518,13 @@ var ObjectStackClient = class {
518
518
  * Authentication Services
519
519
  */
520
520
  this.auth = {
521
+ /**
522
+ * Login with email and password
523
+ * Uses better-auth endpoint: POST /sign-in/email
524
+ */
521
525
  login: async (request) => {
522
526
  const route = this.getRoute("auth");
523
- const res = await this.fetch(`${this.baseUrl}${route}/login`, {
527
+ const res = await this.fetch(`${this.baseUrl}${route}/sign-in/email`, {
524
528
  method: "POST",
525
529
  body: JSON.stringify(request)
526
530
  });
@@ -530,22 +534,31 @@ var ObjectStackClient = class {
530
534
  }
531
535
  return data;
532
536
  },
537
+ /**
538
+ * Logout current user
539
+ * Uses better-auth endpoint: POST /sign-out
540
+ */
533
541
  logout: async () => {
534
542
  const route = this.getRoute("auth");
535
- await this.fetch(`${this.baseUrl}${route}/logout`, { method: "POST" });
543
+ await this.fetch(`${this.baseUrl}${route}/sign-out`, { method: "POST" });
536
544
  this.token = void 0;
537
545
  },
546
+ /**
547
+ * Get current user session
548
+ * Uses better-auth endpoint: GET /get-session
549
+ */
538
550
  me: async () => {
539
551
  const route = this.getRoute("auth");
540
- const res = await this.fetch(`${this.baseUrl}${route}/me`);
552
+ const res = await this.fetch(`${this.baseUrl}${route}/get-session`);
541
553
  return res.json();
542
554
  },
543
555
  /**
544
556
  * Register a new user account
557
+ * Uses better-auth endpoint: POST /sign-up/email
545
558
  */
546
559
  register: async (request) => {
547
560
  const route = this.getRoute("auth");
548
- const res = await this.fetch(`${this.baseUrl}${route}/register`, {
561
+ const res = await this.fetch(`${this.baseUrl}${route}/sign-up/email`, {
549
562
  method: "POST",
550
563
  body: JSON.stringify(request)
551
564
  });
@@ -557,12 +570,13 @@ var ObjectStackClient = class {
557
570
  },
558
571
  /**
559
572
  * Refresh an authentication token
573
+ * Note: better-auth handles token refresh automatically via /get-session
574
+ * @param _refreshToken - Not used (better-auth handles refresh automatically)
560
575
  */
561
- refreshToken: async (refreshToken) => {
576
+ refreshToken: async (_refreshToken) => {
562
577
  const route = this.getRoute("auth");
563
- const res = await this.fetch(`${this.baseUrl}${route}/refresh`, {
564
- method: "POST",
565
- body: JSON.stringify({ refreshToken })
578
+ const res = await this.fetch(`${this.baseUrl}${route}/get-session`, {
579
+ method: "GET"
566
580
  });
567
581
  const data = await res.json();
568
582
  if (data.data?.token) {