@mitway/sdk 0.7.1 → 0.7.3
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/README.md +1 -1
- package/dist/index.d.cts +11 -14
- package/dist/index.d.ts +11 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ const { data: session, error } = await client.auth.signInWithPassword({
|
|
|
47
47
|
password: 'a-strong-password',
|
|
48
48
|
});
|
|
49
49
|
|
|
50
|
-
// Database query (PostgREST query builder
|
|
50
|
+
// Database query (PostgREST query builder)
|
|
51
51
|
const { data: posts, error: dbError } = await client.database
|
|
52
52
|
.from('posts')
|
|
53
53
|
.select('*, author:users(*)')
|
package/dist/index.d.cts
CHANGED
|
@@ -471,11 +471,10 @@ declare class Realtime {
|
|
|
471
471
|
|
|
472
472
|
interface MitwayBaasConfig {
|
|
473
473
|
/**
|
|
474
|
-
* Base URL of the MITWAY-BaaS backend
|
|
475
|
-
*
|
|
476
|
-
*
|
|
477
|
-
*
|
|
478
|
-
* storage/functions — through this one URL.
|
|
474
|
+
* Base URL of the MITWAY-BaaS backend the SDK should talk to. The SDK
|
|
475
|
+
* routes every request — auth, database (via the backend's PostgREST
|
|
476
|
+
* proxy at `/api/database/records/*`), storage, realtime (via
|
|
477
|
+
* `/socket.io/`) and functions — through this single URL.
|
|
479
478
|
*
|
|
480
479
|
* @default "http://localhost:7130"
|
|
481
480
|
*/
|
|
@@ -723,9 +722,7 @@ type AuthResult<T> = {
|
|
|
723
722
|
error: MitwayBaasError | null;
|
|
724
723
|
};
|
|
725
724
|
/**
|
|
726
|
-
* Event names emitted by `auth.onAuthStateChange`.
|
|
727
|
-
* `@supabase/supabase-js` event names so consumers that already know that
|
|
728
|
-
* contract do not have to re-learn ours.
|
|
725
|
+
* Event names emitted by `auth.onAuthStateChange`.
|
|
729
726
|
*
|
|
730
727
|
* - `INITIAL_SESSION` — emitted once per `auth.initialize()` call
|
|
731
728
|
* regardless of whether a persisted session was found. `session` is
|
|
@@ -992,7 +989,7 @@ type UploadBody = Blob | ArrayBuffer | ArrayBufferView | ReadableStream<Uint8Arr
|
|
|
992
989
|
* Storage module — thin wrapper over the /api/storage/* REST endpoints
|
|
993
990
|
* exposed by MITWAY-BaaS.
|
|
994
991
|
*
|
|
995
|
-
* Surface
|
|
992
|
+
* Surface exposes per-bucket object operations + admin bucket CRUD via `/api/storage/*`
|
|
996
993
|
* SDK but routes through the Mitway backend (no direct S3 calls). Binary
|
|
997
994
|
* upload/download uses `HttpClient.rawFetch`; JSON operations use the
|
|
998
995
|
* standard typed `request<T>` path.
|
|
@@ -1122,7 +1119,7 @@ declare class Functions {
|
|
|
1122
1119
|
* import { createClient } from '@mitway/sdk';
|
|
1123
1120
|
*
|
|
1124
1121
|
* const client = createClient({
|
|
1125
|
-
* baseUrl: 'https://
|
|
1122
|
+
* baseUrl: 'https://your-baas.example.com',
|
|
1126
1123
|
* anonKey: 'eyJhbGciOiJIUzI1NiIs...', // optional
|
|
1127
1124
|
* });
|
|
1128
1125
|
*
|
|
@@ -1162,7 +1159,7 @@ declare class MitwayBaasClient {
|
|
|
1162
1159
|
*
|
|
1163
1160
|
* Currently ships:
|
|
1164
1161
|
* - auth (signUp, signInWithPassword, signOut, refreshSession, getSession, getUser)
|
|
1165
|
-
* - database (PostgREST-backed query builder
|
|
1162
|
+
* - database (PostgREST-backed query builder)
|
|
1166
1163
|
* - realtime (Socket.IO transport: subscribe / unsubscribe / publish / on)
|
|
1167
1164
|
* - storage (bucket admin + per-bucket object operations)
|
|
1168
1165
|
* - functions (edge function CRUD, invoke, secrets management)
|
|
@@ -1179,11 +1176,11 @@ declare class MitwayBaasClient {
|
|
|
1179
1176
|
*
|
|
1180
1177
|
* @example
|
|
1181
1178
|
* ```typescript
|
|
1182
|
-
* import { createClient } from '@mitway
|
|
1179
|
+
* import { createClient } from '@mitway/sdk';
|
|
1183
1180
|
*
|
|
1184
1181
|
* const client = createClient({
|
|
1185
|
-
* baseUrl: 'https://
|
|
1186
|
-
*
|
|
1182
|
+
* baseUrl: 'https://your-baas.example.com',
|
|
1183
|
+
* anonKey: 'eyJhbGciOiJIUzI1NiIs...', // optional
|
|
1187
1184
|
* });
|
|
1188
1185
|
* ```
|
|
1189
1186
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -471,11 +471,10 @@ declare class Realtime {
|
|
|
471
471
|
|
|
472
472
|
interface MitwayBaasConfig {
|
|
473
473
|
/**
|
|
474
|
-
* Base URL of the MITWAY-BaaS backend
|
|
475
|
-
*
|
|
476
|
-
*
|
|
477
|
-
*
|
|
478
|
-
* storage/functions — through this one URL.
|
|
474
|
+
* Base URL of the MITWAY-BaaS backend the SDK should talk to. The SDK
|
|
475
|
+
* routes every request — auth, database (via the backend's PostgREST
|
|
476
|
+
* proxy at `/api/database/records/*`), storage, realtime (via
|
|
477
|
+
* `/socket.io/`) and functions — through this single URL.
|
|
479
478
|
*
|
|
480
479
|
* @default "http://localhost:7130"
|
|
481
480
|
*/
|
|
@@ -723,9 +722,7 @@ type AuthResult<T> = {
|
|
|
723
722
|
error: MitwayBaasError | null;
|
|
724
723
|
};
|
|
725
724
|
/**
|
|
726
|
-
* Event names emitted by `auth.onAuthStateChange`.
|
|
727
|
-
* `@supabase/supabase-js` event names so consumers that already know that
|
|
728
|
-
* contract do not have to re-learn ours.
|
|
725
|
+
* Event names emitted by `auth.onAuthStateChange`.
|
|
729
726
|
*
|
|
730
727
|
* - `INITIAL_SESSION` — emitted once per `auth.initialize()` call
|
|
731
728
|
* regardless of whether a persisted session was found. `session` is
|
|
@@ -992,7 +989,7 @@ type UploadBody = Blob | ArrayBuffer | ArrayBufferView | ReadableStream<Uint8Arr
|
|
|
992
989
|
* Storage module — thin wrapper over the /api/storage/* REST endpoints
|
|
993
990
|
* exposed by MITWAY-BaaS.
|
|
994
991
|
*
|
|
995
|
-
* Surface
|
|
992
|
+
* Surface exposes per-bucket object operations + admin bucket CRUD via `/api/storage/*`
|
|
996
993
|
* SDK but routes through the Mitway backend (no direct S3 calls). Binary
|
|
997
994
|
* upload/download uses `HttpClient.rawFetch`; JSON operations use the
|
|
998
995
|
* standard typed `request<T>` path.
|
|
@@ -1122,7 +1119,7 @@ declare class Functions {
|
|
|
1122
1119
|
* import { createClient } from '@mitway/sdk';
|
|
1123
1120
|
*
|
|
1124
1121
|
* const client = createClient({
|
|
1125
|
-
* baseUrl: 'https://
|
|
1122
|
+
* baseUrl: 'https://your-baas.example.com',
|
|
1126
1123
|
* anonKey: 'eyJhbGciOiJIUzI1NiIs...', // optional
|
|
1127
1124
|
* });
|
|
1128
1125
|
*
|
|
@@ -1162,7 +1159,7 @@ declare class MitwayBaasClient {
|
|
|
1162
1159
|
*
|
|
1163
1160
|
* Currently ships:
|
|
1164
1161
|
* - auth (signUp, signInWithPassword, signOut, refreshSession, getSession, getUser)
|
|
1165
|
-
* - database (PostgREST-backed query builder
|
|
1162
|
+
* - database (PostgREST-backed query builder)
|
|
1166
1163
|
* - realtime (Socket.IO transport: subscribe / unsubscribe / publish / on)
|
|
1167
1164
|
* - storage (bucket admin + per-bucket object operations)
|
|
1168
1165
|
* - functions (edge function CRUD, invoke, secrets management)
|
|
@@ -1179,11 +1176,11 @@ declare class MitwayBaasClient {
|
|
|
1179
1176
|
*
|
|
1180
1177
|
* @example
|
|
1181
1178
|
* ```typescript
|
|
1182
|
-
* import { createClient } from '@mitway
|
|
1179
|
+
* import { createClient } from '@mitway/sdk';
|
|
1183
1180
|
*
|
|
1184
1181
|
* const client = createClient({
|
|
1185
|
-
* baseUrl: 'https://
|
|
1186
|
-
*
|
|
1182
|
+
* baseUrl: 'https://your-baas.example.com',
|
|
1183
|
+
* anonKey: 'eyJhbGciOiJIUzI1NiIs...', // optional
|
|
1187
1184
|
* });
|
|
1188
1185
|
* ```
|
|
1189
1186
|
*/
|