@globalscoutme/api-client 1.0.9 → 1.0.10

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.
Files changed (2) hide show
  1. package/README.md +8 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -28,7 +28,7 @@ client.setConfig({
28
28
  All endpoints are grouped by controller and fully typed:
29
29
 
30
30
  ```ts
31
- import { Players, Profile, Documents, Videos, Achievements, Body, Index, Organizations } from '@globalscoutme/api-client';
31
+ import { Players, Profile, Documents, Videos, Achievements, Body, Index, Organizations, Storage } from '@globalscoutme/api-client';
32
32
 
33
33
  // Players
34
34
  const player = await Players.getPlayersMe();
@@ -62,6 +62,13 @@ const positions = await Index.getIndexByTableName({ path: { tableName: 'position
62
62
 
63
63
  // Organizations
64
64
  const org = await Organizations.getOrganizationsMe();
65
+
66
+ // Storage — get a signed upload URL, then PUT the file directly to Supabase Storage
67
+ const { uploadUrl, token, path, bucket, expiresIn } = await Storage.createUploadUrl({
68
+ body: { bucket: 'avatars', contentType: 'image/jpeg', sizeBytes: 204800 },
69
+ });
70
+ await fetch(uploadUrl, { method: 'PUT', body: fileBlob, headers: { 'Content-Type': 'image/jpeg' } });
71
+ // persist `path` on the player record (e.g. patchPlayersMe with avatarPath: path)
65
72
  ```
66
73
 
67
74
  ## Updating auth token
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@globalscoutme/api-client",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "GlobalScoutMe API client (generated)",
5
5
  "author": "GlobalScoutMe",
6
6
  "license": "UNLICENSED",