@fusebase/fusebase-gate-sdk 2.12.0 → 2.13.0

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.
@@ -56,7 +56,7 @@ export declare class FilesApi {
56
56
  }): Promise<DeleteFileResponseContract>;
57
57
  /**
58
58
  * List bucket attachments
59
- * Lists the organization's files from every source in one list: files uploaded into an app (`app`), note attachments (`note`) and portal files (`portalPage`, `portalGlobal`, `portalFiles`, `portalBlock`). Each item carries its source `target`, its file `kind` (`image`, `video`, `audio`, `doc`, `archive` or `file`, detected from the mime type), the uploader `userId` (resolve the email and role with the org-users operations), the `size` in bytes, the custom `attributes` and the `accessPrincipals`. Filter by source with `targets`, drop small files with `sizeFrom`, keep only the files one user uploaded with `uploaderId`, keep only some file types with `kinds`, and match custom metadata with `attributes`, a JSON object of strings sent as a string, such as `{"source":"file-manager"}`, where every given pair must match exactly (`total` follows the same filter). Clients only receive files their access principals or the bucket permissions allow.
59
+ * Lists the organization's files from every source in one list: files uploaded into an app (`app`), note attachments (`note`) and portal files (`portalPage`, `portalGlobal`, `portalFiles`, `portalBlock`). Each item carries its source `target`, its file `kind` (`image`, `video`, `audio`, `doc`, `archive` or `file`, detected from the mime type), the uploader `userId` (resolve the email and role with the org-users operations), the `size` in bytes, the custom `attributes` and the `accessPrincipals`. Filter by source with `targets`, keep only some apps or other sources with `targetIds` (matched against the item `targetId`; a bare app id needs `targets` set to `app`), drop small files with `sizeFrom`, keep only the files one user uploaded with `uploaderId`, keep only some file types with `kinds`, and match custom metadata with `attributes`, a JSON object of strings sent as a string, such as `{"source":"file-manager"}`, where every given pair must match exactly (`total` follows the same filter). Clients only receive files their access principals or the bucket permissions allow.
60
60
  */
61
61
  listBucketAttachments(params: {
62
62
  path: {
@@ -64,6 +64,7 @@ export declare class FilesApi {
64
64
  };
65
65
  query?: {
66
66
  targets?: unknown[];
67
+ targetIds?: unknown[];
67
68
  sizeFrom?: number;
68
69
  uploaderId?: number;
69
70
  kinds?: unknown[];
@@ -73,7 +73,7 @@ class FilesApi {
73
73
  }
74
74
  /**
75
75
  * List bucket attachments
76
- * Lists the organization's files from every source in one list: files uploaded into an app (`app`), note attachments (`note`) and portal files (`portalPage`, `portalGlobal`, `portalFiles`, `portalBlock`). Each item carries its source `target`, its file `kind` (`image`, `video`, `audio`, `doc`, `archive` or `file`, detected from the mime type), the uploader `userId` (resolve the email and role with the org-users operations), the `size` in bytes, the custom `attributes` and the `accessPrincipals`. Filter by source with `targets`, drop small files with `sizeFrom`, keep only the files one user uploaded with `uploaderId`, keep only some file types with `kinds`, and match custom metadata with `attributes`, a JSON object of strings sent as a string, such as `{"source":"file-manager"}`, where every given pair must match exactly (`total` follows the same filter). Clients only receive files their access principals or the bucket permissions allow.
76
+ * Lists the organization's files from every source in one list: files uploaded into an app (`app`), note attachments (`note`) and portal files (`portalPage`, `portalGlobal`, `portalFiles`, `portalBlock`). Each item carries its source `target`, its file `kind` (`image`, `video`, `audio`, `doc`, `archive` or `file`, detected from the mime type), the uploader `userId` (resolve the email and role with the org-users operations), the `size` in bytes, the custom `attributes` and the `accessPrincipals`. Filter by source with `targets`, keep only some apps or other sources with `targetIds` (matched against the item `targetId`; a bare app id needs `targets` set to `app`), drop small files with `sizeFrom`, keep only the files one user uploaded with `uploaderId`, keep only some file types with `kinds`, and match custom metadata with `attributes`, a JSON object of strings sent as a string, such as `{"source":"file-manager"}`, where every given pair must match exactly (`total` follows the same filter). Clients only receive files their access principals or the bucket permissions allow.
77
77
  */
78
78
  async listBucketAttachments(params) {
79
79
  return this.client.request({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fusebase/fusebase-gate-sdk",
3
- "version": "2.12.0",
3
+ "version": "2.13.0",
4
4
  "description": "TypeScript SDK for Fusebase Gate APIs - Generated from contract introspection",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -1,8 +1,8 @@
1
- # Release Notes 2.12.0
1
+ # Release Notes 2.12.3-sdk.0
2
2
 
3
3
  - Current ref: `HEAD`
4
4
  - Previous tag: `v2.12.0`
5
- - Generated at: 2026-09-28T09:44:29.506Z
5
+ - Generated at: 2026-09-29T09:18:04.507Z
6
6
 
7
7
  ## Included Drafts
8
8
 
@@ -0,0 +1,9 @@
1
+ # Release Notes 2.13.0
2
+
3
+ - Current ref: `HEAD`
4
+ - Previous tag: `v2.13.0`
5
+ - Generated at: 2026-09-29T10:32:05.503Z
6
+
7
+ ## Included Drafts
8
+
9
+ - None
@@ -1,8 +1,8 @@
1
- # Release Notes 2.12.0
1
+ # Release Notes 2.13.0
2
2
 
3
3
  - Current ref: `HEAD`
4
- - Previous tag: `v2.12.0`
5
- - Generated at: 2026-09-28T09:44:29.506Z
4
+ - Previous tag: `v2.13.0`
5
+ - Generated at: 2026-09-29T10:32:05.503Z
6
6
 
7
7
  ## Included Drafts
8
8
 
@@ -1,252 +0,0 @@
1
- # Release Notes 2.11.8-sdk.0
2
-
3
- - Current ref: `HEAD`
4
- - Previous tag: `v2.11.7-sdk.0`
5
- - Generated at: 2026-09-21T10:48:18.778Z
6
-
7
- ## Included Drafts
8
-
9
- - `docs/release-notes/2026-06-08-get-org-url.md` - Get organization URL
10
- - `docs/release-notes/2026-09-09-org-url-web-client-host.md` - getOrgUrl returns the web-client host
11
- - `docs/release-notes/2026-09-14-bucket-attachments.md` - Bucket attachments for app files
12
- - `docs/release-notes/2026-09-14-list-bucket-attachments.md` - One file list across app, note and portal files
13
- - `docs/release-notes/2026-09-14-presigned-file-upload.md` - Presigned single-request file upload
14
- - `docs/release-notes/2026-09-19-web-studio-motion-guidance.md` - Web Studio motion guidance
15
-
16
- ## Summary
17
-
18
- ### Get organization URL
19
-
20
- Gate exposes `GET /:orgId/url` (`getOrgUrl`) to resolve the canonical HTTPS base URL for an organization. The hostname follows org-service rules: custom CNAME domain when configured, otherwise `{sub}.{FUSEBASE_WEB_CLIENT_HOST}` (see the 2026-09-09 note; before that it was `{sub}.{FUSEBASE_HOST}`).
21
-
22
- ### getOrgUrl returns the web-client host
23
-
24
- `getOrgUrl` built org subdomain URLs from `FUSEBASE_HOST` (the API host, e.g.
25
- `thefusebase.com`), so it returned `{sub}.thefusebase.com`. Users know their org by
26
- the web-client host (`{sub}.nimbusweb.me` on prod). Both hosts resolve, so the wrong
27
- one never failed loudly.
28
-
29
- `FUSEBASE_HOST` could not be repurposed — it also derives `app.thefusebase.com` for
30
- the auth-form URLs.
31
-
32
- ### Bucket attachments for app files
33
-
34
- An app that uploaded a file through Gate had nowhere to put it: the stored file was
35
- not part of the organization's file listing, so the File Manager app could only ever
36
- show its own files. Gate now talks to bucket-service, so an uploaded file becomes an
37
- attachment in the organization's `app` bucket and shows up next to files from notes
38
- and portals.
39
-
40
- ### One file list across app, note and portal files
41
-
42
- The File Manager app could only show the files it uploaded itself. `listBucketAttachments`
43
- returns the organization's files from every source in one list, with the metadata needed to
44
- filter them (source, uploader, size) and to show each file only to people who may see it.
45
-
46
- ### Presigned single-request file upload
47
-
48
- Uploading a file through Gate always meant a multipart upload: start, PUT every part,
49
- complete. For a file small enough to fit in one request that is three round trips for
50
- no reason, and the completion step always created a stored-file record, which the
51
- File Manager app does not want — it creates its own bucket attachment instead.
52
-
53
- ### Web Studio motion guidance
54
-
55
- Added the safe, declarative Web Studio motion contract to the Gate MCP prompt.
56
-
57
-
58
- ## API / SDK Changes
59
-
60
- ### Get organization URL
61
-
62
- - Added `getOrgUrl` operation and `OrgsApi.getOrgUrl` SDK client method.
63
- - Response fields: `url`, `host`, `kind` (`cname` | `subdomain`), `sub`, `customDomain`, `domainShorter`.
64
- - Permission: `org.read` with org-scoped authz.
65
-
66
- ### Bucket attachments for app files
67
-
68
- - New op `createBucketAttachment`, `POST /:orgId/bucket-attachments` (`files.write`).
69
- Body takes `tempStoredFileName` (required) plus optional `attributes`, `accessPrincipals`
70
- and `folder`. Gate generates the attachment id and reads the owning app from the
71
- token's `client` scope, so a call without an app token answers 400.
72
- - New op `updateBucketAttachment`, `PATCH /:orgId/bucket-attachments/:globalId`
73
- (`files.write`). Body takes `filename`, `attributes` and `accessPrincipals`, all optional.
74
- A field that is not sent stays as it is; `accessPrincipals: null` clears every
75
- restriction. bucket-service statuses (400, 404) are passed through unchanged.
76
- - Both return the attachment as `globalId`, `target`, `targetId`, `filename`, `type`,
77
- `size`, `userId`, `url`, `createdAt`, `attributes` and `accessPrincipals`.
78
- - MCP `files` prompt covers both ops, and the Gate files skill reference is
79
- regenerated.
80
-
81
- ### One file list across app, note and portal files
82
-
83
- - New op `listBucketAttachments`, `GET /:orgId/bucket-attachments` (`files.read`, clients
84
- included). Query: `targets` (source buckets, for example `app` or `note`), `sizeFrom`
85
- (bytes), `attributes`, `limit` (default 50, max 100), `offset`, `sortField`, `sortOrder`.
86
- - `attributes` keeps only the files whose custom metadata contains every given pair, as a
87
- JSON object of strings such as `{"source":"file-manager"}` (max 50 keys, 255 chars per key
88
- and value). `total` follows the same filter. A malformed filter is a 400, answered before
89
- bucket-service is called.
90
- - Returns `{items, total}`. Each item carries `globalId`, `target` (the source), `targetId`,
91
- `workspaceId`, `portalId`, `filename`, `type`, `size`, `userId` (the uploader), `url`,
92
- `createdAt`, `attributes`, `accessPrincipals` and, for organization members, `permissions`.
93
- - `createBucketAttachment` and `updateBucketAttachment` now return the same three extra
94
- fields (`workspaceId`, `portalId`, `permissions`), null for app files.
95
- - Gate resolves the caller's organization role and group memberships itself and forwards
96
- them, with the caller's user id, to both the listing and the count. bucket-service then
97
- decides what the caller may see. A client role is filtered in `client` permissions mode,
98
- everyone else in `admin` mode.
99
- - `accessPrincipals.groupIds` on `createBucketAttachment` and `updateBucketAttachment` are
100
- organization group global ids (strings), the ids org-service and bucket-service use.
101
- - MCP `files` prompt covers the new op, and the Gate files skill reference is regenerated.
102
-
103
- ### Presigned single-request file upload
104
-
105
- - New op `createTempStoredFileUpload`, `POST /:orgId/files/uploads/presigned`
106
- (`files.write`). Body takes `name` (required) plus optional `type`, `size`,
107
- `folder` and `public`. It returns `uploadUrl`, `method`, `expiresAt`,
108
- `tempStoredFileName`, and `headers` holding the single `content-type` header the
109
- PUT may carry — the URL signs `host` only, so anything else breaks the signature.
110
- - `completeMultipartFileUpload` takes an optional `saveStoredFile` (default `true`).
111
- With `false` it finishes the upload and skips the stored-file record.
112
- - `completeMultipartFileUpload` response gains `storedFileCreated` and
113
- `tempStoredfileName`. `fileId` and `storedFileUUID` are now nullable — they are
114
- null exactly when `saveStoredFile` was `false`.
115
- - MCP `files` prompt covers both, and the Gate files skill reference is regenerated.
116
-
117
- ### Web Studio motion guidance
118
-
119
- No operation or SDK contract changed. The `webStudio` MCP prompt is now version
120
- `1.11.0` and describes the supported `reveal`, `count`, and `parallax` motion
121
- attributes and their bounded options.
122
-
123
-
124
- ## Consumer Impact
125
-
126
- ### Get organization URL
127
-
128
- - Apps and agents can stop hardcoding Fusebase hostnames when building org-scoped links.
129
- - Portal domains and app magic-link hosts remain separate surfaces; use `listPortals` or app APIs for those.
130
-
131
- ### getOrgUrl returns the web-client host
132
-
133
- - Custom CNAME domains are unchanged — they already won over the host.
134
- - Deployments without the new variable keep the previous behaviour via the fallback.
135
-
136
- ### Bucket attachments for app files
137
-
138
- - Nothing changes for existing callers: both ops are new and no existing response
139
- shape moved.
140
- - Deployments need `BUCKET_SERVICE_URL`. Without it the two new ops answer 500 and
141
- every other op is unaffected.
142
- - Gate calls bucket-service with the plain `Internal` header and no super secret, so
143
- bucket-service authorizes the real user against the file's own organization. That
144
- is what keeps an app from touching an attachment in another organization.
145
-
146
- ### One file list across app, note and portal files
147
-
148
- - Nothing changes for existing callers: the op is new and the two added fields are optional.
149
- - A token issued for an app sees exactly what a user session for the same user sees: the
150
- role and the group memberships are resolved from the organization membership and from
151
- org-service, not from the request.
152
- - `total` is counted by bucket-service, which counts the page it would return, so the gate
153
- asks it for up to 1000 files. A larger organization reports 1000.
154
-
155
- ### Presigned single-request file upload
156
-
157
- - Existing callers are unaffected: `saveStoredFile` defaults to `true`, so the
158
- response keeps the same values it had.
159
- - TypeScript consumers reading `storedFileUUID` from the completion response now see
160
- `string | null` and have to narrow it. Checking `storedFileCreated` is the clearest
161
- way.
162
-
163
- ### Web Studio motion guidance
164
-
165
- MCP agents receive the same motion guidance as Studio Chat: they can request
166
- compiler-owned motion without attempting to add site-authored JavaScript.
167
-
168
-
169
- ## Verification
170
-
171
- ### Get organization URL
172
-
173
- - `npm test -- tests/unit/org-url-service.test.ts tests/unit/orgs-controller.test.ts`
174
- - `npm run build:sdk`
175
- - `npm run mcp:skills:generate`
176
- - `npm run mcp:skills:validate`
177
-
178
- ### getOrgUrl returns the web-client host
179
-
180
- - `npm test -- tests/unit/config-env.test.ts tests/unit/orgs-controller.test.ts tests/unit/org-url-service.test.ts`
181
-
182
- ### Bucket attachments for app files
183
-
184
- - `npm test -- tests/unit/files`
185
- - `npm run build`, `npm run build:sdk`, `npm run mcp:skills:generate`,
186
- `npm run mcp:skills:validate`
187
- - e2e-sdk and mcp-e2e cover the update flow and the 400/404 cases against a fake
188
- bucket-service. Creating an attachment needs a real app token (`client` scope),
189
- so that path is covered by unit tests and by QA on dev (NIM-44491).
190
-
191
- ### One file list across app, note and portal files
192
-
193
- - `npm test -- tests/unit/files tests/unit/bucket-service-client`
194
- - `npm run build`, `npm run build:sdk`, `npm run mcp:skills:generate`,
195
- `npm run mcp:skills:validate`
196
- - e2e-sdk and mcp-e2e list app and note files against the fake bucket-service and check the
197
- `targets` and `sizeFrom` filters. The fake enforces the caller access principals, and one
198
- e2e-sdk case creates a real group, grants files by role and by group, and asserts both
199
- a token and a user session see them while a file granted to neither stays hidden. Further
200
- cases cover the `attributes` filter and its count, an app file addressed to another user
201
- staying hidden from an org member, the uploader receiving their own restricted file, and a
202
- client receiving the app file granted to the `client` role.
203
-
204
- ### Presigned single-request file upload
205
-
206
- - `npm test -- tests/unit/files`
207
- - `npm run build`, `npm run build:sdk`, `npm run mcp:skills:generate`,
208
- `npm run mcp:skills:validate`
209
-
210
- ### Web Studio motion guidance
211
-
212
- - `npm run build`
213
- - `npm run mcp:skills:generate`
214
- - `npm run mcp:skills:validate` remains blocked locally because the `skills_ref`
215
- Python module is unavailable.
216
-
217
-
218
- ## Follow-ups
219
-
220
- ### Get organization URL
221
-
222
- - None.
223
-
224
- ### Bucket attachments for app files
225
-
226
- - `listBucketAttachments` (NIM-44489) returns the aggregated listing these
227
- attachments join.
228
-
229
- ### Presigned single-request file upload
230
-
231
- - `createBucketAttachment` (NIM-44488) is what turns `tempStoredFileName` into a
232
- bucket attachment for the File Manager app.
233
-
234
- ### Web Studio motion guidance
235
-
236
- Deploy the matching Web Studio compiler release before relying on motion
237
- attributes in published sites.
238
-
239
-
240
- ## Changes
241
-
242
- ### getOrgUrl returns the web-client host
243
-
244
- - New env variable `FUSEBASE_WEB_CLIENT_HOST` (`config.fusebaseWebClientHost`),
245
- falling back to `FUSEBASE_HOST` when unset.
246
- - `getOrgUrl` now resolves subdomain org URLs against `fusebaseWebClientHost`, and so
247
- do the markdown-note share URLs, which are built on the same org base.
248
- - The MCP prompt host bag carries `fusebaseWebClientHost` alongside `fusebaseHost`;
249
- the `getOrgUrl` prompt example uses the web-client one. `fusebaseHost` keeps meaning
250
- the API/platform host everywhere.
251
- - Added to nimbus-helm-chart `fusebase-gate` values and deployment env
252
- (prod `nimbusweb.me`, dev `dev-thefusebase.com`).