@aurabase/aurabase-js 0.5.0 → 0.5.1
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 +6 -4
- package/dist/{AuraClient-0WhqmK0u.d.cts → AuraClient-DL7mqfNu.d.cts} +15 -0
- package/dist/{AuraClient-0WhqmK0u.d.ts → AuraClient-DL7mqfNu.d.ts} +15 -0
- package/dist/index.cjs +30 -0
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +30 -0
- package/dist/ssr.cjs +30 -0
- package/dist/ssr.d.cts +1 -1
- package/dist/ssr.d.ts +1 -1
- package/dist/ssr.js +30 -0
- package/package.json +20 -19
package/README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
# aurabase
|
|
1
|
+
# @aurabase/aurabase-js
|
|
2
2
|
|
|
3
|
-
Client JavaScript/TypeScript officiel
|
|
3
|
+
Client JavaScript/TypeScript officiel pour [Aurabase](https://aurabase.cloud) : la plateforme Backend-as-a-Service open-source haute performance propulsée par Rust.
|
|
4
4
|
|
|
5
|
-
 
|
|
5
|
+
[](https://www.npmjs.com/package/@aurabase/aurabase-js) [](https://github.com/daylami555/aurabase/blob/main/LICENSE)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
🌐 **Site officiel** : [https://aurabase.cloud](https://aurabase.cloud)
|
|
8
|
+
📖 **Documentation** : [https://aurabase.cloud/docs](https://aurabase.cloud)
|
|
9
|
+
🐙 **GitHub** : [daylami555/aurabase](https://github.com/daylami555/aurabase)
|
|
8
10
|
|
|
9
11
|
## Installation
|
|
10
12
|
|
|
@@ -82,6 +82,21 @@ declare class AuraClient<Database = any> implements AuraClientLike {
|
|
|
82
82
|
* ```
|
|
83
83
|
*/
|
|
84
84
|
channel(name: string, options?: ChannelConfig): AuraChannel;
|
|
85
|
+
/**
|
|
86
|
+
* Shortcut: remove a realtime channel by name or AuraChannel instance.
|
|
87
|
+
* Equivalent to `aura.realtime.removeChannel(channel)`.
|
|
88
|
+
*/
|
|
89
|
+
removeChannel(channel: string | AuraChannel): void;
|
|
90
|
+
/**
|
|
91
|
+
* Shortcut: remove all realtime channels and unsubscribe.
|
|
92
|
+
* Equivalent to `aura.realtime.removeAllChannels()`.
|
|
93
|
+
*/
|
|
94
|
+
removeAllChannels(): void;
|
|
95
|
+
/**
|
|
96
|
+
* Shortcut: list all active realtime channels.
|
|
97
|
+
* Equivalent to `aura.realtime.getChannels()`.
|
|
98
|
+
*/
|
|
99
|
+
getChannels(): AuraChannel[];
|
|
85
100
|
}
|
|
86
101
|
|
|
87
102
|
export { AuraClient as A };
|
|
@@ -82,6 +82,21 @@ declare class AuraClient<Database = any> implements AuraClientLike {
|
|
|
82
82
|
* ```
|
|
83
83
|
*/
|
|
84
84
|
channel(name: string, options?: ChannelConfig): AuraChannel;
|
|
85
|
+
/**
|
|
86
|
+
* Shortcut: remove a realtime channel by name or AuraChannel instance.
|
|
87
|
+
* Equivalent to `aura.realtime.removeChannel(channel)`.
|
|
88
|
+
*/
|
|
89
|
+
removeChannel(channel: string | AuraChannel): void;
|
|
90
|
+
/**
|
|
91
|
+
* Shortcut: remove all realtime channels and unsubscribe.
|
|
92
|
+
* Equivalent to `aura.realtime.removeAllChannels()`.
|
|
93
|
+
*/
|
|
94
|
+
removeAllChannels(): void;
|
|
95
|
+
/**
|
|
96
|
+
* Shortcut: list all active realtime channels.
|
|
97
|
+
* Equivalent to `aura.realtime.getChannels()`.
|
|
98
|
+
*/
|
|
99
|
+
getChannels(): AuraChannel[];
|
|
85
100
|
}
|
|
86
101
|
|
|
87
102
|
export { AuraClient as A };
|
package/dist/index.cjs
CHANGED
|
@@ -108,6 +108,15 @@ var AuraClient = class {
|
|
|
108
108
|
persistSession: this._persistSession,
|
|
109
109
|
detectSessionInUrl: this._detectSessionInUrl
|
|
110
110
|
});
|
|
111
|
+
this._auth.onAuthStateChange(({ event, accessToken }) => {
|
|
112
|
+
if (this._realtime) {
|
|
113
|
+
if (accessToken) {
|
|
114
|
+
this._realtime.setAuth(accessToken);
|
|
115
|
+
} else if (event === "SIGNED_OUT") {
|
|
116
|
+
this._realtime.setAuth("");
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
});
|
|
111
120
|
}
|
|
112
121
|
return this._auth;
|
|
113
122
|
}
|
|
@@ -158,6 +167,27 @@ var AuraClient = class {
|
|
|
158
167
|
channel(name, options) {
|
|
159
168
|
return this.realtime.channel(name, options);
|
|
160
169
|
}
|
|
170
|
+
/**
|
|
171
|
+
* Shortcut: remove a realtime channel by name or AuraChannel instance.
|
|
172
|
+
* Equivalent to `aura.realtime.removeChannel(channel)`.
|
|
173
|
+
*/
|
|
174
|
+
removeChannel(channel) {
|
|
175
|
+
return this.realtime.removeChannel(channel);
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Shortcut: remove all realtime channels and unsubscribe.
|
|
179
|
+
* Equivalent to `aura.realtime.removeAllChannels()`.
|
|
180
|
+
*/
|
|
181
|
+
removeAllChannels() {
|
|
182
|
+
return this.realtime.removeAllChannels();
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Shortcut: list all active realtime channels.
|
|
186
|
+
* Equivalent to `aura.realtime.getChannels()`.
|
|
187
|
+
*/
|
|
188
|
+
getChannels() {
|
|
189
|
+
return this.realtime.getChannels();
|
|
190
|
+
}
|
|
161
191
|
};
|
|
162
192
|
|
|
163
193
|
// src/index.ts
|
package/dist/index.d.cts
CHANGED
|
@@ -7,7 +7,7 @@ export { FunctionsService } from '@aurabase/functions';
|
|
|
7
7
|
export { NotificationsAdminService, NotificationsService } from '@aurabase/notifications';
|
|
8
8
|
export { AuraChannel, RealtimeService } from '@aurabase/realtime';
|
|
9
9
|
export { StorageService } from '@aurabase/storage';
|
|
10
|
-
import { A as AuraClient } from './AuraClient-
|
|
10
|
+
import { A as AuraClient } from './AuraClient-DL7mqfNu.cjs';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Create a new Aurabase client instance.
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export { FunctionsService } from '@aurabase/functions';
|
|
|
7
7
|
export { NotificationsAdminService, NotificationsService } from '@aurabase/notifications';
|
|
8
8
|
export { AuraChannel, RealtimeService } from '@aurabase/realtime';
|
|
9
9
|
export { StorageService } from '@aurabase/storage';
|
|
10
|
-
import { A as AuraClient } from './AuraClient-
|
|
10
|
+
import { A as AuraClient } from './AuraClient-DL7mqfNu.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Create a new Aurabase client instance.
|
package/dist/index.js
CHANGED
|
@@ -114,6 +114,15 @@ var AuraClient = class {
|
|
|
114
114
|
persistSession: this._persistSession,
|
|
115
115
|
detectSessionInUrl: this._detectSessionInUrl
|
|
116
116
|
});
|
|
117
|
+
this._auth.onAuthStateChange(({ event, accessToken }) => {
|
|
118
|
+
if (this._realtime) {
|
|
119
|
+
if (accessToken) {
|
|
120
|
+
this._realtime.setAuth(accessToken);
|
|
121
|
+
} else if (event === "SIGNED_OUT") {
|
|
122
|
+
this._realtime.setAuth("");
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
});
|
|
117
126
|
}
|
|
118
127
|
return this._auth;
|
|
119
128
|
}
|
|
@@ -164,6 +173,27 @@ var AuraClient = class {
|
|
|
164
173
|
channel(name, options) {
|
|
165
174
|
return this.realtime.channel(name, options);
|
|
166
175
|
}
|
|
176
|
+
/**
|
|
177
|
+
* Shortcut: remove a realtime channel by name or AuraChannel instance.
|
|
178
|
+
* Equivalent to `aura.realtime.removeChannel(channel)`.
|
|
179
|
+
*/
|
|
180
|
+
removeChannel(channel) {
|
|
181
|
+
return this.realtime.removeChannel(channel);
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Shortcut: remove all realtime channels and unsubscribe.
|
|
185
|
+
* Equivalent to `aura.realtime.removeAllChannels()`.
|
|
186
|
+
*/
|
|
187
|
+
removeAllChannels() {
|
|
188
|
+
return this.realtime.removeAllChannels();
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Shortcut: list all active realtime channels.
|
|
192
|
+
* Equivalent to `aura.realtime.getChannels()`.
|
|
193
|
+
*/
|
|
194
|
+
getChannels() {
|
|
195
|
+
return this.realtime.getChannels();
|
|
196
|
+
}
|
|
167
197
|
};
|
|
168
198
|
|
|
169
199
|
// src/index.ts
|
package/dist/ssr.cjs
CHANGED
|
@@ -108,6 +108,15 @@ var AuraClient = class {
|
|
|
108
108
|
persistSession: this._persistSession,
|
|
109
109
|
detectSessionInUrl: this._detectSessionInUrl
|
|
110
110
|
});
|
|
111
|
+
this._auth.onAuthStateChange(({ event, accessToken }) => {
|
|
112
|
+
if (this._realtime) {
|
|
113
|
+
if (accessToken) {
|
|
114
|
+
this._realtime.setAuth(accessToken);
|
|
115
|
+
} else if (event === "SIGNED_OUT") {
|
|
116
|
+
this._realtime.setAuth("");
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
});
|
|
111
120
|
}
|
|
112
121
|
return this._auth;
|
|
113
122
|
}
|
|
@@ -158,6 +167,27 @@ var AuraClient = class {
|
|
|
158
167
|
channel(name, options) {
|
|
159
168
|
return this.realtime.channel(name, options);
|
|
160
169
|
}
|
|
170
|
+
/**
|
|
171
|
+
* Shortcut: remove a realtime channel by name or AuraChannel instance.
|
|
172
|
+
* Equivalent to `aura.realtime.removeChannel(channel)`.
|
|
173
|
+
*/
|
|
174
|
+
removeChannel(channel) {
|
|
175
|
+
return this.realtime.removeChannel(channel);
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Shortcut: remove all realtime channels and unsubscribe.
|
|
179
|
+
* Equivalent to `aura.realtime.removeAllChannels()`.
|
|
180
|
+
*/
|
|
181
|
+
removeAllChannels() {
|
|
182
|
+
return this.realtime.removeAllChannels();
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Shortcut: list all active realtime channels.
|
|
186
|
+
* Equivalent to `aura.realtime.getChannels()`.
|
|
187
|
+
*/
|
|
188
|
+
getChannels() {
|
|
189
|
+
return this.realtime.getChannels();
|
|
190
|
+
}
|
|
161
191
|
};
|
|
162
192
|
var MAX_CHUNK_SIZE = 3600;
|
|
163
193
|
function createServerClient(baseUrl, apiKey, options) {
|
package/dist/ssr.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SerializeCookieOptions, AuraClientOptions } from '@aurabase/core';
|
|
2
2
|
export { SerializeCookieOptions, parseCookieHeader, serializeCookieHeader } from '@aurabase/core';
|
|
3
|
-
import { A as AuraClient } from './AuraClient-
|
|
3
|
+
import { A as AuraClient } from './AuraClient-DL7mqfNu.cjs';
|
|
4
4
|
import '@aurabase/ai';
|
|
5
5
|
import '@aurabase/auth';
|
|
6
6
|
import '@aurabase/db';
|
package/dist/ssr.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SerializeCookieOptions, AuraClientOptions } from '@aurabase/core';
|
|
2
2
|
export { SerializeCookieOptions, parseCookieHeader, serializeCookieHeader } from '@aurabase/core';
|
|
3
|
-
import { A as AuraClient } from './AuraClient-
|
|
3
|
+
import { A as AuraClient } from './AuraClient-DL7mqfNu.js';
|
|
4
4
|
import '@aurabase/ai';
|
|
5
5
|
import '@aurabase/auth';
|
|
6
6
|
import '@aurabase/db';
|
package/dist/ssr.js
CHANGED
|
@@ -107,6 +107,15 @@ var AuraClient = class {
|
|
|
107
107
|
persistSession: this._persistSession,
|
|
108
108
|
detectSessionInUrl: this._detectSessionInUrl
|
|
109
109
|
});
|
|
110
|
+
this._auth.onAuthStateChange(({ event, accessToken }) => {
|
|
111
|
+
if (this._realtime) {
|
|
112
|
+
if (accessToken) {
|
|
113
|
+
this._realtime.setAuth(accessToken);
|
|
114
|
+
} else if (event === "SIGNED_OUT") {
|
|
115
|
+
this._realtime.setAuth("");
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
});
|
|
110
119
|
}
|
|
111
120
|
return this._auth;
|
|
112
121
|
}
|
|
@@ -157,6 +166,27 @@ var AuraClient = class {
|
|
|
157
166
|
channel(name, options) {
|
|
158
167
|
return this.realtime.channel(name, options);
|
|
159
168
|
}
|
|
169
|
+
/**
|
|
170
|
+
* Shortcut: remove a realtime channel by name or AuraChannel instance.
|
|
171
|
+
* Equivalent to `aura.realtime.removeChannel(channel)`.
|
|
172
|
+
*/
|
|
173
|
+
removeChannel(channel) {
|
|
174
|
+
return this.realtime.removeChannel(channel);
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Shortcut: remove all realtime channels and unsubscribe.
|
|
178
|
+
* Equivalent to `aura.realtime.removeAllChannels()`.
|
|
179
|
+
*/
|
|
180
|
+
removeAllChannels() {
|
|
181
|
+
return this.realtime.removeAllChannels();
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Shortcut: list all active realtime channels.
|
|
185
|
+
* Equivalent to `aura.realtime.getChannels()`.
|
|
186
|
+
*/
|
|
187
|
+
getChannels() {
|
|
188
|
+
return this.realtime.getChannels();
|
|
189
|
+
}
|
|
160
190
|
};
|
|
161
191
|
var MAX_CHUNK_SIZE = 3600;
|
|
162
192
|
function createServerClient(baseUrl, apiKey, options) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aurabase/aurabase-js",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Official JavaScript/TypeScript client for Aurabase BaaS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"url": "git+https://github.com/daylami555/aurabase.git",
|
|
45
45
|
"directory": "aurabase-js/packages/aurabase"
|
|
46
46
|
},
|
|
47
|
-
"homepage": "https://
|
|
47
|
+
"homepage": "https://aurabase.cloud",
|
|
48
48
|
"bugs": {
|
|
49
49
|
"url": "https://github.com/daylami555/aurabase/issues"
|
|
50
50
|
},
|
|
@@ -55,28 +55,29 @@
|
|
|
55
55
|
"sdk",
|
|
56
56
|
"client"
|
|
57
57
|
],
|
|
58
|
-
"dependencies": {
|
|
59
|
-
"@aurabase/core": "0.5.0",
|
|
60
|
-
"@aurabase/db": "0.5.0",
|
|
61
|
-
"@aurabase/storage": "0.5.0",
|
|
62
|
-
"@aurabase/realtime": "0.5.0",
|
|
63
|
-
"@aurabase/functions": "0.5.0",
|
|
64
|
-
"@aurabase/ai": "0.5.0",
|
|
65
|
-
"@aurabase/notifications": "0.5.0",
|
|
66
|
-
"@aurabase/auth": "0.5.0"
|
|
67
|
-
},
|
|
68
|
-
"devDependencies": {
|
|
69
|
-
"@types/node": "20.14.15",
|
|
70
|
-
"tsup": "^8.0.0",
|
|
71
|
-
"typescript": "^5.5.0",
|
|
72
|
-
"vitest": "^4.1.6"
|
|
73
|
-
},
|
|
74
58
|
"scripts": {
|
|
75
59
|
"build": "tsup",
|
|
76
60
|
"test": "vitest run && tsc --noEmit -p tsconfig.test-d.json",
|
|
77
61
|
"test:types": "tsc --noEmit -p tsconfig.test-d.json",
|
|
78
62
|
"test:e2e": "RUN_E2E=true vitest run --config vitest.e2e.config.ts tests/integration.test.ts",
|
|
79
63
|
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.test.json",
|
|
64
|
+
"prepack": "pnpm build",
|
|
80
65
|
"typecheck:tests": "tsc --noEmit -p tsconfig.test.json"
|
|
66
|
+
},
|
|
67
|
+
"dependencies": {
|
|
68
|
+
"@aurabase/core": "workspace:*",
|
|
69
|
+
"@aurabase/auth": "workspace:*",
|
|
70
|
+
"@aurabase/db": "workspace:*",
|
|
71
|
+
"@aurabase/storage": "workspace:*",
|
|
72
|
+
"@aurabase/realtime": "workspace:*",
|
|
73
|
+
"@aurabase/functions": "workspace:*",
|
|
74
|
+
"@aurabase/ai": "workspace:*",
|
|
75
|
+
"@aurabase/notifications": "workspace:*"
|
|
76
|
+
},
|
|
77
|
+
"devDependencies": {
|
|
78
|
+
"@types/node": "catalog:",
|
|
79
|
+
"tsup": "catalog:",
|
|
80
|
+
"typescript": "catalog:",
|
|
81
|
+
"vitest": "catalog:"
|
|
81
82
|
}
|
|
82
|
-
}
|
|
83
|
+
}
|