@mitralab.io/platform-sdk 1.0.3 → 1.0.6

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 CHANGED
@@ -1,5 +1,8 @@
1
1
  # Mitra Platform SDK
2
2
 
3
+ [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=mitra-platform-sdk&metric=alert_status&token=28d7be14b66d6f88d706347e2418af5ea39ab3e9)](https://sonarcloud.io/summary/new_code?id=mitra-platform-sdk)
4
+ [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=mitra-platform-sdk&metric=coverage&token=28d7be14b66d6f88d706347e2418af5ea39ab3e9)](https://sonarcloud.io/summary/new_code?id=mitra-platform-sdk)
5
+
3
6
  The Mitra Platform SDK provides a JavaScript/TypeScript interface for building apps on the Mitra Platform. When Mitra generates your app, the generated code uses this SDK to authenticate users, manage your app's data, execute serverless functions, and more. You can use the same SDK to modify and extend your app.
4
7
 
5
8
  **Zero runtime dependencies.** Uses only standard Web APIs (`fetch`, `localStorage`, `URL`, `Proxy`).
package/dist/index.js CHANGED
@@ -234,8 +234,8 @@ var AuthModule = class {
234
234
  */
235
235
  async signIn(credentials) {
236
236
  const tokenResponse = await this.publicClient.post(
237
- "/api/v1/auth/tokens",
238
- credentials
237
+ "/api/v1/auth/login",
238
+ { ...credentials, appId: this.appId }
239
239
  );
240
240
  this._accessToken = tokenResponse.accessToken;
241
241
  this._refreshToken = tokenResponse.refreshToken;
@@ -260,7 +260,7 @@ var AuthModule = class {
260
260
  * ```
261
261
  */
262
262
  async signUp(data) {
263
- await this.publicClient.post("/api/v1/auth/users/register", {
263
+ await this.publicClient.post("/api/v1/auth/register", {
264
264
  ...data,
265
265
  appId: this.appId
266
266
  });
@@ -416,7 +416,7 @@ var AuthModule = class {
416
416
  async doRefresh() {
417
417
  try {
418
418
  const tokenResponse = await this.publicClient.post(
419
- "/api/v1/auth/tokens/refresh",
419
+ "/api/v1/auth/refresh-token",
420
420
  { refreshToken: this._refreshToken }
421
421
  );
422
422
  this._accessToken = tokenResponse.accessToken;
package/dist/index.mjs CHANGED
@@ -207,8 +207,8 @@ var AuthModule = class {
207
207
  */
208
208
  async signIn(credentials) {
209
209
  const tokenResponse = await this.publicClient.post(
210
- "/api/v1/auth/tokens",
211
- credentials
210
+ "/api/v1/auth/login",
211
+ { ...credentials, appId: this.appId }
212
212
  );
213
213
  this._accessToken = tokenResponse.accessToken;
214
214
  this._refreshToken = tokenResponse.refreshToken;
@@ -233,7 +233,7 @@ var AuthModule = class {
233
233
  * ```
234
234
  */
235
235
  async signUp(data) {
236
- await this.publicClient.post("/api/v1/auth/users/register", {
236
+ await this.publicClient.post("/api/v1/auth/register", {
237
237
  ...data,
238
238
  appId: this.appId
239
239
  });
@@ -389,7 +389,7 @@ var AuthModule = class {
389
389
  async doRefresh() {
390
390
  try {
391
391
  const tokenResponse = await this.publicClient.post(
392
- "/api/v1/auth/tokens/refresh",
392
+ "/api/v1/auth/refresh-token",
393
393
  { refreshToken: this._refreshToken }
394
394
  );
395
395
  this._accessToken = tokenResponse.accessToken;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mitralab.io/platform-sdk",
3
- "version": "1.0.3",
3
+ "version": "1.0.6",
4
4
  "description": "JavaScript/TypeScript SDK for building apps on the Mitra Platform",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -44,14 +44,16 @@
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/node": "^25.3.0",
47
- "@vitest/coverage-v8": "^4.0.18",
47
+ "@vitest/coverage-v8": "^4.1.2",
48
48
  "eslint": "^10.0.1",
49
49
  "tsup": "^8.0.1",
50
- "typescript": "^5.3.3",
51
- "vitest": "^4.0.18"
50
+ "typescript": "^6.0.2",
51
+ "vitest": "^4.1.2"
52
52
  },
53
- "peerDependencies": {},
54
53
  "engines": {
55
54
  "node": ">=18.0.0"
55
+ },
56
+ "overrides": {
57
+ "rollup": "^4.59.0"
56
58
  }
57
59
  }