@fusebase/fusebase-gate-sdk 2.2.6-sdk.4 → 2.2.9

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.
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Files API
3
+ *
4
+ * Generated from contract introspection
5
+ * Domain: files
6
+ */
7
+ import type { Client } from "../runtime/transport";
8
+ import type { CompleteMultipartFileUploadRequestContract, CompleteMultipartFileUploadResponseContract, DeleteFileRequestContract, DeleteFileResponseContract, GetFileDownloadUrlRequestContract, GetFileDownloadUrlResponseContract, MultipartUploadIdInPathRequired, orgIdInPathRequired, PrepareFileUploadRequestContract, PrepareFileUploadResponseContract, StartMultipartFileUploadResponseContract } from "../types";
9
+ export declare class FilesApi {
10
+ private client;
11
+ constructor(client: Client);
12
+ /**
13
+ * Complete multipart file upload
14
+ * Commits the provided Azure block ids for a previously started multipart upload.
15
+ */
16
+ completeMultipartFileUpload(params: {
17
+ path: {
18
+ orgId: orgIdInPathRequired;
19
+ uploadId: MultipartUploadIdInPathRequired;
20
+ };
21
+ headers?: Record<string, string>;
22
+ body: CompleteMultipartFileUploadRequestContract;
23
+ }): Promise<CompleteMultipartFileUploadResponseContract>;
24
+ /**
25
+ * Delete file
26
+ * Deletes an org-scoped Azure Blob by the previously returned fileId.
27
+ */
28
+ deleteFile(params: {
29
+ path: {
30
+ orgId: orgIdInPathRequired;
31
+ };
32
+ headers?: Record<string, string>;
33
+ body: DeleteFileRequestContract;
34
+ }): Promise<DeleteFileResponseContract>;
35
+ /**
36
+ * Get file download URL
37
+ * Creates a short-lived Azure Blob download URL for a previously uploaded org-scoped file. Gate never handles the file bytes.
38
+ */
39
+ getFileDownloadUrl(params: {
40
+ path: {
41
+ orgId: orgIdInPathRequired;
42
+ };
43
+ headers?: Record<string, string>;
44
+ body: GetFileDownloadUrlRequestContract;
45
+ }): Promise<GetFileDownloadUrlResponseContract>;
46
+ /**
47
+ * Prepare direct file upload
48
+ * Creates a short-lived Azure Blob upload URL for the organization. Gate never handles the file bytes.
49
+ */
50
+ prepareFileUpload(params: {
51
+ path: {
52
+ orgId: orgIdInPathRequired;
53
+ };
54
+ headers?: Record<string, string>;
55
+ body: PrepareFileUploadRequestContract;
56
+ }): Promise<PrepareFileUploadResponseContract>;
57
+ /**
58
+ * Start multipart file upload
59
+ * Creates a short-lived Azure Blob upload URL for block staging and returns a signed, short-lived uploadId for later completion.
60
+ */
61
+ startMultipartFileUpload(params: {
62
+ path: {
63
+ orgId: orgIdInPathRequired;
64
+ };
65
+ headers?: Record<string, string>;
66
+ body: PrepareFileUploadRequestContract;
67
+ }): Promise<StartMultipartFileUploadResponseContract>;
68
+ }
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ /**
3
+ * Files API
4
+ *
5
+ * Generated from contract introspection
6
+ * Domain: files
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.FilesApi = void 0;
10
+ class FilesApi {
11
+ constructor(client) {
12
+ this.client = client;
13
+ }
14
+ /**
15
+ * Complete multipart file upload
16
+ * Commits the provided Azure block ids for a previously started multipart upload.
17
+ */
18
+ async completeMultipartFileUpload(params) {
19
+ return this.client.request({
20
+ method: "POST",
21
+ path: "/:orgId/files/uploads/:uploadId/complete",
22
+ pathParams: params.path,
23
+ headers: params.headers,
24
+ body: params.body,
25
+ opId: "completeMultipartFileUpload",
26
+ expectedContentType: "application/json",
27
+ });
28
+ }
29
+ /**
30
+ * Delete file
31
+ * Deletes an org-scoped Azure Blob by the previously returned fileId.
32
+ */
33
+ async deleteFile(params) {
34
+ return this.client.request({
35
+ method: "DELETE",
36
+ path: "/:orgId/files",
37
+ pathParams: params.path,
38
+ headers: params.headers,
39
+ body: params.body,
40
+ opId: "deleteFile",
41
+ expectedContentType: "application/json",
42
+ });
43
+ }
44
+ /**
45
+ * Get file download URL
46
+ * Creates a short-lived Azure Blob download URL for a previously uploaded org-scoped file. Gate never handles the file bytes.
47
+ */
48
+ async getFileDownloadUrl(params) {
49
+ return this.client.request({
50
+ method: "POST",
51
+ path: "/:orgId/files/download-url",
52
+ pathParams: params.path,
53
+ headers: params.headers,
54
+ body: params.body,
55
+ opId: "getFileDownloadUrl",
56
+ expectedContentType: "application/json",
57
+ });
58
+ }
59
+ /**
60
+ * Prepare direct file upload
61
+ * Creates a short-lived Azure Blob upload URL for the organization. Gate never handles the file bytes.
62
+ */
63
+ async prepareFileUpload(params) {
64
+ return this.client.request({
65
+ method: "POST",
66
+ path: "/:orgId/files/prepare-upload",
67
+ pathParams: params.path,
68
+ headers: params.headers,
69
+ body: params.body,
70
+ opId: "prepareFileUpload",
71
+ expectedContentType: "application/json",
72
+ });
73
+ }
74
+ /**
75
+ * Start multipart file upload
76
+ * Creates a short-lived Azure Blob upload URL for block staging and returns a signed, short-lived uploadId for later completion.
77
+ */
78
+ async startMultipartFileUpload(params) {
79
+ return this.client.request({
80
+ method: "POST",
81
+ path: "/:orgId/files/uploads/start",
82
+ pathParams: params.path,
83
+ headers: params.headers,
84
+ body: params.body,
85
+ opId: "startMultipartFileUpload",
86
+ expectedContentType: "application/json",
87
+ });
88
+ }
89
+ }
90
+ exports.FilesApi = FilesApi;
package/dist/index.d.ts CHANGED
@@ -8,6 +8,7 @@ export * from "./types";
8
8
  export { AccessApi } from "./apis/AccessApi";
9
9
  export { BillingApi } from "./apis/BillingApi";
10
10
  export { EmailsApi } from "./apis/EmailsApi";
11
+ export { FilesApi } from "./apis/FilesApi";
11
12
  export { HealthApi } from "./apis/HealthApi";
12
13
  export { IsolatedStoresApi } from "./apis/IsolatedStoresApi";
13
14
  export { NotesApi } from "./apis/NotesApi";
package/dist/index.js CHANGED
@@ -19,7 +19,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
19
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
20
  };
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.WorkspacesApi = exports.TokensApi = exports.SystemApi = exports.PortalsApi = exports.OrgUsersApi = exports.OrgGroupsApi = exports.NotesApi = exports.IsolatedStoresApi = exports.HealthApi = exports.EmailsApi = exports.BillingApi = exports.AccessApi = void 0;
22
+ exports.WorkspacesApi = exports.TokensApi = exports.SystemApi = exports.PortalsApi = exports.OrgUsersApi = exports.OrgGroupsApi = exports.NotesApi = exports.IsolatedStoresApi = exports.HealthApi = exports.FilesApi = exports.EmailsApi = exports.BillingApi = exports.AccessApi = void 0;
23
23
  __exportStar(require("./runtime"), exports);
24
24
  __exportStar(require("./types"), exports);
25
25
  var AccessApi_1 = require("./apis/AccessApi");
@@ -28,6 +28,8 @@ var BillingApi_1 = require("./apis/BillingApi");
28
28
  Object.defineProperty(exports, "BillingApi", { enumerable: true, get: function () { return BillingApi_1.BillingApi; } });
29
29
  var EmailsApi_1 = require("./apis/EmailsApi");
30
30
  Object.defineProperty(exports, "EmailsApi", { enumerable: true, get: function () { return EmailsApi_1.EmailsApi; } });
31
+ var FilesApi_1 = require("./apis/FilesApi");
32
+ Object.defineProperty(exports, "FilesApi", { enumerable: true, get: function () { return FilesApi_1.FilesApi; } });
31
33
  var HealthApi_1 = require("./apis/HealthApi");
32
34
  Object.defineProperty(exports, "HealthApi", { enumerable: true, get: function () { return HealthApi_1.HealthApi; } });
33
35
  var IsolatedStoresApi_1 = require("./apis/IsolatedStoresApi");
@@ -0,0 +1,84 @@
1
+ export type FileIdInPathRequired = string;
2
+ export type MultipartUploadIdInPathRequired = string;
3
+ export type FileUploadMethodContract = "PUT";
4
+ export type FileDownloadMethodContract = "GET";
5
+ export interface PrepareFileUploadRequestContract {
6
+ filename: string;
7
+ contentType?: string | null;
8
+ folder?: string | null;
9
+ }
10
+ export interface DeleteFileRequestContract {
11
+ fileId: string;
12
+ }
13
+ export interface GetFileDownloadUrlRequestContract {
14
+ fileId: string;
15
+ }
16
+ export interface FileUploadHeadersContract {
17
+ "x-ms-blob-type": "BlockBlob";
18
+ "Content-Type": string;
19
+ }
20
+ export interface PrepareFileUploadResponseContract {
21
+ /**
22
+ * Blob path in Azure Storage. Use this exact value as `fileId` for deletion.
23
+ */
24
+ fileId: string;
25
+ /**
26
+ * @format uri
27
+ */
28
+ uploadUrl: string;
29
+ method: FileUploadMethodContract;
30
+ headers: FileUploadHeadersContract;
31
+ /**
32
+ * @format date-time
33
+ */
34
+ expiresAt: string;
35
+ }
36
+ export interface DeleteFileResponseContract {
37
+ fileId: string;
38
+ deleted: boolean;
39
+ }
40
+ export interface GetFileDownloadUrlResponseContract {
41
+ fileId: string;
42
+ /**
43
+ * @format uri
44
+ */
45
+ downloadUrl: string;
46
+ method: FileDownloadMethodContract;
47
+ /**
48
+ * @format date-time
49
+ */
50
+ expiresAt: string;
51
+ }
52
+ export interface StartMultipartFileUploadResponseContract {
53
+ /**
54
+ * Signed short-lived multipart token. Treat as opaque and send it back unchanged.
55
+ */
56
+ uploadId: string;
57
+ fileId: string;
58
+ /**
59
+ * @format uri
60
+ */
61
+ uploadUrl: string;
62
+ method: FileUploadMethodContract;
63
+ /**
64
+ * @format date-time
65
+ */
66
+ expiresAt: string;
67
+ }
68
+ export interface CompleteMultipartFileUploadRequestContract {
69
+ /**
70
+ * Base64-encoded block ids in the exact order they should be committed.
71
+ */
72
+ blockIds: string[];
73
+ }
74
+ export interface CompleteMultipartFileUploadResponseContract {
75
+ fileId: string;
76
+ committed: boolean;
77
+ blockCount: number;
78
+ }
79
+ export declare const FileUploadMethodContract: {
80
+ readonly Put: "PUT";
81
+ };
82
+ export declare const FileDownloadMethodContract: {
83
+ readonly Get: "GET";
84
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FileDownloadMethodContract = exports.FileUploadMethodContract = void 0;
4
+ exports.FileUploadMethodContract = {
5
+ Put: "PUT"
6
+ };
7
+ exports.FileDownloadMethodContract = {
8
+ Get: "GET"
9
+ };
@@ -7,6 +7,7 @@
7
7
  export type { AuthenticatedUserSummaryContract, MyOrgAccessResponseContract } from "./access/access";
8
8
  export * from "./billing/billing";
9
9
  export type { OrgEmailSendRequestContract, OrgEmailSendResponseContract } from "./email/email";
10
+ export * from "./file/file";
10
11
  export * from "./isolated-store/isolated-store";
11
12
  export type { MeAuthContract, MeOrgGroupContract, MeResponseContract, MeScopeContract, MeUserContract } from "./me/me";
12
13
  export * from "./note/note";
@@ -21,6 +21,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
21
21
  };
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
23
  __exportStar(require("./billing/billing"), exports);
24
+ __exportStar(require("./file/file"), exports);
24
25
  __exportStar(require("./isolated-store/isolated-store"), exports);
25
26
  __exportStar(require("./note/note"), exports);
26
27
  __exportStar(require("./org-group/org-group"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fusebase/fusebase-gate-sdk",
3
- "version": "2.2.6-sdk.4",
3
+ "version": "2.2.9",
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",
@@ -2,8 +2,62 @@
2
2
 
3
3
  - Current ref: `HEAD`
4
4
  - Previous tag: `v2.2.6-sdk.4`
5
- - Generated at: 2026-04-17T08:03:27.015Z
5
+ - Generated at: 2026-04-21T08:19:38.558Z
6
6
 
7
7
  ## Included Drafts
8
8
 
9
- - None
9
+ - `docs/release-notes/2026-04-20-azure-file-upload-api.md` - 2026-04-20-azure-file-upload-api
10
+
11
+ ## Summary
12
+
13
+ ### 2026-04-20-azure-file-upload-api
14
+
15
+ Added org-scoped file upload, download-url, and deletion endpoints for Azure Blob Storage direct transfers, then hardened the multipart token flow and moved container creation out of per-request runtime handling.
16
+
17
+
18
+ ## API / SDK Changes
19
+
20
+ ### 2026-04-20-azure-file-upload-api
21
+
22
+ - Added `POST /:orgId/files/prepare-upload` to generate a short-lived SAS upload URL, blob `fileId`, required upload headers, and expiration time.
23
+ - Added `POST /:orgId/files/uploads/start` to start an explicit Azure block-blob multipart upload and return an opaque `uploadId`.
24
+ - Added `POST /:orgId/files/uploads/:uploadId/complete` to commit the staged Azure block ids for a multipart upload.
25
+ - Added `POST /:orgId/files/download-url` to generate a short-lived read-only SAS URL for a previously uploaded org-scoped blob.
26
+ - Added `DELETE /:orgId/files` to delete a previously prepared org-scoped blob by `fileId` in the request body.
27
+ - Added the generated `FilesApi` SDK surface for these operations.
28
+ - Hardened multipart `uploadId` values so they are signed and expiring instead of plain base64 payloads.
29
+ - Removed container creation from the request path; upload preparation now performs only blob-level work.
30
+ - Added optional startup-time container initialization through `AZURE_STORAGE_CREATE_CONTAINER_ON_STARTUP`.
31
+ - Added Gate MCP guidance for file-upload flows and new `files.write` and `files.read` permissions.
32
+
33
+
34
+ ## Consumer Impact
35
+
36
+ ### 2026-04-20-azure-file-upload-api
37
+
38
+ - Clients should upload file bytes directly to Azure Blob Storage using the returned `uploadUrl`, `method`, and `headers`; Gate does not proxy file bytes.
39
+ - Clients should download file bytes directly from Azure Blob Storage using the returned `downloadUrl`; Gate does not proxy file bytes for reads either.
40
+ - Multipart clients should stage blocks directly against the returned `uploadUrl`, keep the base64 block ids they used, and send those ids to `completeMultipartFileUpload`.
41
+ - Treat multipart `uploadId` values as opaque short-lived server tokens. Clients must not decode, modify, or synthesize them.
42
+ - Persist the returned `fileId` exactly as-is if the app needs to delete the blob later.
43
+ - Runtime configuration now expects `AZURE_STORAGE_ACCOUNT_NAME` and can optionally use `AZURE_STORAGE_CONTAINER`, `AZURE_STORAGE_ACCOUNT_KEY`, `AZURE_STORAGE_UPLOAD_URL_TTL_SECONDS`, `AZURE_STORAGE_UPLOAD_ID_SECRET`, and `AZURE_STORAGE_CREATE_CONTAINER_ON_STARTUP`.
44
+ - Preferred deployment model is a pre-created container from infrastructure. Startup-time container creation is opt-in for environments that intentionally grant container-management permissions.
45
+
46
+
47
+ ## Verification
48
+
49
+ ### 2026-04-20-azure-file-upload-api
50
+
51
+ - `npm run build:sdk`
52
+ - `npm run mcp:skills:generate`
53
+ - `npm run mcp:skills:validate`
54
+ - `npm test`
55
+ - `npm run lint`
56
+
57
+
58
+ ## Follow-ups
59
+
60
+ ### 2026-04-20-azure-file-upload-api
61
+
62
+ - Wire the new Azure storage env vars into the active Fusebase Gate Helm chart values and secrets once the deployment chart path and environment-specific account values are confirmed.
63
+ - If the production environment supports Microsoft Entra or managed identity, prefer user delegation SAS over account-key SAS.
@@ -0,0 +1,9 @@
1
+ # Release Notes 2.2.9
2
+
3
+ - Current ref: `HEAD`
4
+ - Previous tag: `v2.2.9`
5
+ - Generated at: 2026-04-21T08:52:18.461Z
6
+
7
+ ## Included Drafts
8
+
9
+ - None
@@ -1,8 +1,8 @@
1
- # Release Notes 2.2.6-sdk.4
1
+ # Release Notes 2.2.9
2
2
 
3
3
  - Current ref: `HEAD`
4
- - Previous tag: `v2.2.6-sdk.4`
5
- - Generated at: 2026-04-17T08:03:27.015Z
4
+ - Previous tag: `v2.2.9`
5
+ - Generated at: 2026-04-21T08:52:18.461Z
6
6
 
7
7
  ## Included Drafts
8
8