@fusebase/fusebase-gate-sdk 2.2.2-sdk.3 → 2.2.2-sdk.30

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.
@@ -43,6 +43,11 @@ export interface OrgUserAddRequestContract {
43
43
  * Without `workspaceId`, this remains an org invite email hint only.
44
44
  */
45
45
  portalUrl?: string;
46
+ /**
47
+ * Org-only shortcut for instant client onboarding without invite
48
+ * confirmation. Valid only when `orgRole` is `client` and `workspaceId`
49
+ * is omitted.
50
+ */
46
51
  autoConfirmClientInvite?: boolean;
47
52
  }
48
53
  export interface OrgInviteContract {
@@ -122,6 +127,8 @@ export interface OrgUserAddResponseContract {
122
127
  /**
123
128
  * org-service returns `invite` or `member` for org invites, and
124
129
  * `invite`, `member`, or `link` for workspace-aware invites.
130
+ * `invite` means an invite exists; it is not proof that org access is
131
+ * already active for the current session.
125
132
  */
126
133
  result: "invite" | "member" | "link";
127
134
  orgInvite?: OrgInviteContract;
@@ -1,6 +1,6 @@
1
1
  export type OrgRoleContract = "owner" | "manager" | "member" | "client" | "guest" | "visitor";
2
2
  export type PermissionContract = string & {
3
- __pattern: "^[a-z][a-z0-9_]*(\\.[a-z0-9_]+)*\\.(read|write|delete|execute)$";
3
+ __pattern: "^[^.]+\\.(?:[^.]+\\.)?(read|write|delete|execute)$";
4
4
  };
5
5
  export type RootEntityContract = "custom" | "portal" | "workspace" | "org" | "user" | "client" | "form" | "form-response" | "tracker" | "tracker-result" | "meeting";
6
6
  export type ScopeTypeContract = "org" | "workspace" | "portal" | "user" | "client" | "block" | "tracker" | "parent_row" | "parent_table";
@@ -37,7 +37,7 @@ exports.ScopeTypeContract = {
37
37
  exports.ScopeTypeOrgContract = {
38
38
  Org: "org"
39
39
  };
40
- const PERMISSION_RE = /^[a-z][a-z0-9_]*(\.[a-z0-9_]+)*\.(read|write|delete|execute)$/;
40
+ const PERMISSION_RE = /^[^.]+\.(?:[^.]+\.)?(read|write|delete|execute)$/;
41
41
  function asPermission(value) {
42
42
  if (!PERMISSION_RE.test(value)) {
43
43
  throw new Error(`Invalid permission: ${value}`);
@@ -2,6 +2,14 @@ import type { PermissionContract } from "../shared/enums";
2
2
  export interface ResolveOperationPermissionsRequestContract {
3
3
  operations: string[];
4
4
  }
5
+ export interface ListPermissionCatalogResultContract {
6
+ permissions: PermissionContract[];
7
+ }
8
+ export interface ListPermissionCatalogResponseContract {
9
+ success: boolean;
10
+ message?: string | null;
11
+ data: ListPermissionCatalogResultContract;
12
+ }
5
13
  export type OperationPermissionMatchTypeContract = "operation_id" | "mcp_tool_name";
6
14
  export interface ResolvedOperationPermissionContract {
7
15
  requested: string;
@@ -6,6 +6,7 @@ export interface CreateTokenRequestContract {
6
6
  resource_scope: ResourceScopeContract;
7
7
  name?: string | null;
8
8
  expires_at?: Date | null;
9
+ meta?: TokenMetaContract;
9
10
  }
10
11
  export interface CreateTokenResponseContract {
11
12
  success: boolean;
@@ -16,6 +17,7 @@ export interface CreateTokenResponseContract {
16
17
  name?: string | null;
17
18
  permissions: string[];
18
19
  expires_at?: Date | null;
20
+ meta?: TokenMetaContract;
19
21
  created_at: Date;
20
22
  };
21
23
  }
@@ -27,6 +29,13 @@ export interface ResourceScopeRuleContract {
27
29
  resource_type: string;
28
30
  ids: string[];
29
31
  }
32
+ export interface TokenMetaIssuerContract {
33
+ kind: string;
34
+ id: string;
35
+ }
36
+ export interface TokenMetaContract {
37
+ issuer?: TokenMetaIssuerContract;
38
+ }
30
39
  export interface RevokeTokenResponseContract {
31
40
  success: boolean;
32
41
  message: string;
@@ -36,6 +45,7 @@ export interface TokenContract {
36
45
  name?: string | null;
37
46
  permissions: PermissionContract[];
38
47
  scopes?: ScopeContract[];
48
+ meta?: TokenMetaContract;
39
49
  expires_at?: Date | null;
40
50
  last_used_at?: Date | null;
41
51
  created_at: Date;
@@ -54,4 +64,5 @@ export interface UpdateTokenRequestContract {
54
64
  name?: string | null;
55
65
  permissions?: PermissionContract[];
56
66
  expires_at?: Date | null;
67
+ meta?: TokenMetaContract;
57
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fusebase/fusebase-gate-sdk",
3
- "version": "2.2.2-sdk.3",
3
+ "version": "2.2.2-sdk.30",
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",
@@ -0,0 +1,9 @@
1
+ # Release Notes 2.2.2-sdk.30
2
+
3
+ - Current ref: `HEAD`
4
+ - Previous tag: `v2.2.2-sdk.30`
5
+ - Generated at: 2026-04-06T09:32:22.763Z
6
+
7
+ ## Included Drafts
8
+
9
+ - None
@@ -1,85 +1,9 @@
1
- # Release Notes 2.2.2-sdk.3
1
+ # Release Notes 2.2.2-sdk.30
2
2
 
3
3
  - Current ref: `HEAD`
4
- - Previous tag: `v2.2.2-sdk.2`
5
- - Generated at: 2026-03-30T12:29:12.945Z
4
+ - Previous tag: `v2.2.2-sdk.30`
5
+ - Generated at: 2026-04-06T09:32:22.763Z
6
6
 
7
7
  ## Included Drafts
8
8
 
9
- - `docs/release-notes/2026-03-30-notes-list-ops.md` - 2026-03-30-notes-list-ops
10
- - `docs/release-notes/2026-03-30-notes-mcp-opaque-ids.md` - 2026-03-30-notes-mcp-opaque-ids
11
-
12
- ## Summary
13
-
14
- ### 2026-03-30-notes-list-ops
15
-
16
- Add Gate notes read and write endpoints for listing, reading, and creating workspace notes and folders.
17
-
18
- ### 2026-03-30-notes-mcp-opaque-ids
19
-
20
- Notes notes-tool validation and HTTP routing now match the note-service behavior more closely: MCP no longer treats note-service IDs as UUIDs, and the HTTP/SDK notes folder listing route no longer gets shadowed by the generic note-read route.
21
-
22
-
23
- ## API / SDK Changes
24
-
25
- ### 2026-03-30-notes-list-ops
26
-
27
- - Added `listWorkspaceNoteFolders` for `GET /:orgId/workspaces/:workspaceId/notes/folders`.
28
- - Added `listWorkspaceNotes` for `GET /:orgId/workspaces/:workspaceId/notes`.
29
- - Added `getWorkspaceNote` for `GET /:orgId/workspaces/:workspaceId/notes/:noteId`.
30
- - Added `createWorkspaceNoteFolder` for `POST /:orgId/workspaces/:workspaceId/notes/folders`.
31
- - Added `createWorkspaceNote` for `POST /:orgId/workspaces/:workspaceId/notes`.
32
- - Added the `notes.read` and `notes.write` service permissions for the new note operations.
33
-
34
- ### 2026-03-30-notes-mcp-opaque-ids
35
-
36
- - MCP notes tools no longer require UUID-formatted values for note-service IDs.
37
- - `GET /:orgId/workspaces/:workspaceId/notes/folders` now resolves to the folder-list operation instead of being captured by `/:noteId`.
38
- - Service runtime schema registration now overlays explicit opaque-string schemas for notes path/query params.
39
-
40
-
41
- ## Consumer Impact
42
-
43
- ### 2026-03-30-notes-list-ops
44
-
45
- - Consumers can now discover workspace note folders, fetch notes under a specific folder, read rendered html for a single note, and create folders or notes through Gate.
46
- - `listWorkspaceNotes` defaults to the workspace root when `parentId` is omitted.
47
- - `createWorkspaceNoteFolder` defaults `parentId` to `root`.
48
- - `createWorkspaceNote` defaults `parentId` to `default` and can append initial text or html content after creation.
49
-
50
- ### 2026-03-30-notes-mcp-opaque-ids
51
-
52
- - MCP consumers can pass real note-service IDs like `workspace-default-1` or `folder-projects-1` without hitting `INVALID_ARGS` UUID validation failures.
53
- - SDK and raw HTTP consumers can call the notes folder-list endpoint without it being misrouted into note-content fetching.
54
- - Notes E2E suites now reset fake note fixtures between tests so SDK/MCP coverage stays order-independent.
55
-
56
-
57
- ## Verification
58
-
59
- ### 2026-03-30-notes-list-ops
60
-
61
- - `npm run build`
62
- - `node --loader tsx scripts/build-sdk.mts`
63
- - `node --loader tsx scripts/generate-mcp-skills.mts`
64
- - `node --loader tsx scripts/validate-mcp-skills.mts`
65
-
66
- ### 2026-03-30-notes-mcp-opaque-ids
67
-
68
- - `npm run lint -- src/api/contracts/ops/notes/notes.ts src/api/contracts/schemas/runtime-schema-defs.ts src/api/contracts/schemas/runtime-schema-overrides.ts tests/unit/notes-contracts.test.ts tests/unit/notes-controller.test.ts`
69
- - `npm run test:unit -- --runTestsByPath tests/unit/notes-contracts.test.ts tests/unit/notes-controller.test.ts`
70
- - `npm run lint -- src/controllers/notes/notes.ts tests/helpers/fake-notes-store.ts tests/helpers/fake-note-service.ts tests/helpers/reset-fake-notes.ts tests/e2e-sdk/notes/0.list-workspace-notes.test.ts tests/e2e-sdk/notes/1.get-workspace-note.test.ts tests/e2e-sdk/notes/2.create-workspace-note.test.ts tests/mcp-e2e/notes/0.list-workspace-notes.test.ts tests/mcp-e2e/notes/1.get-workspace-note.test.ts tests/mcp-e2e/notes/2.create-workspace-note.test.ts tests/unit/notes-controller.test.ts tests/unit/notes-contracts.test.ts tests/unit/notes-routes.test.ts`
71
- - `npm run test:unit -- --runTestsByPath tests/unit/notes-controller.test.ts tests/unit/notes-contracts.test.ts tests/unit/notes-routes.test.ts`
72
- - `npm run mcp:skills:generate`
73
- - `npm run mcp:skills:validate`
74
- - Blocked locally: `env USE_BUILD_ARTIFACT=true npm run test:mcp-e2e:full` failed because `db:migrate:test` could not connect to MySQL at `localhost:3306`
75
-
76
-
77
- ## Follow-ups
78
-
79
- ### 2026-03-30-notes-list-ops
80
-
81
- - Confirm whether client and visitor roles should receive `notes.read` or `notes.write` in read-only org contexts.
82
-
83
- ### 2026-03-30-notes-mcp-opaque-ids
84
-
85
- - Re-run the MCP E2E suite in CI or an environment with the test MySQL instance available to confirm the notes MCP failures are resolved end to end.
9
+ - None
@@ -1,85 +0,0 @@
1
- # Release Notes 2.2.2-sdk.3
2
-
3
- - Current ref: `HEAD`
4
- - Previous tag: `v2.2.2-sdk.2`
5
- - Generated at: 2026-03-30T12:29:12.945Z
6
-
7
- ## Included Drafts
8
-
9
- - `docs/release-notes/2026-03-30-notes-list-ops.md` - 2026-03-30-notes-list-ops
10
- - `docs/release-notes/2026-03-30-notes-mcp-opaque-ids.md` - 2026-03-30-notes-mcp-opaque-ids
11
-
12
- ## Summary
13
-
14
- ### 2026-03-30-notes-list-ops
15
-
16
- Add Gate notes read and write endpoints for listing, reading, and creating workspace notes and folders.
17
-
18
- ### 2026-03-30-notes-mcp-opaque-ids
19
-
20
- Notes notes-tool validation and HTTP routing now match the note-service behavior more closely: MCP no longer treats note-service IDs as UUIDs, and the HTTP/SDK notes folder listing route no longer gets shadowed by the generic note-read route.
21
-
22
-
23
- ## API / SDK Changes
24
-
25
- ### 2026-03-30-notes-list-ops
26
-
27
- - Added `listWorkspaceNoteFolders` for `GET /:orgId/workspaces/:workspaceId/notes/folders`.
28
- - Added `listWorkspaceNotes` for `GET /:orgId/workspaces/:workspaceId/notes`.
29
- - Added `getWorkspaceNote` for `GET /:orgId/workspaces/:workspaceId/notes/:noteId`.
30
- - Added `createWorkspaceNoteFolder` for `POST /:orgId/workspaces/:workspaceId/notes/folders`.
31
- - Added `createWorkspaceNote` for `POST /:orgId/workspaces/:workspaceId/notes`.
32
- - Added the `notes.read` and `notes.write` service permissions for the new note operations.
33
-
34
- ### 2026-03-30-notes-mcp-opaque-ids
35
-
36
- - MCP notes tools no longer require UUID-formatted values for note-service IDs.
37
- - `GET /:orgId/workspaces/:workspaceId/notes/folders` now resolves to the folder-list operation instead of being captured by `/:noteId`.
38
- - Service runtime schema registration now overlays explicit opaque-string schemas for notes path/query params.
39
-
40
-
41
- ## Consumer Impact
42
-
43
- ### 2026-03-30-notes-list-ops
44
-
45
- - Consumers can now discover workspace note folders, fetch notes under a specific folder, read rendered html for a single note, and create folders or notes through Gate.
46
- - `listWorkspaceNotes` defaults to the workspace root when `parentId` is omitted.
47
- - `createWorkspaceNoteFolder` defaults `parentId` to `root`.
48
- - `createWorkspaceNote` defaults `parentId` to `default` and can append initial text or html content after creation.
49
-
50
- ### 2026-03-30-notes-mcp-opaque-ids
51
-
52
- - MCP consumers can pass real note-service IDs like `workspace-default-1` or `folder-projects-1` without hitting `INVALID_ARGS` UUID validation failures.
53
- - SDK and raw HTTP consumers can call the notes folder-list endpoint without it being misrouted into note-content fetching.
54
- - Notes E2E suites now reset fake note fixtures between tests so SDK/MCP coverage stays order-independent.
55
-
56
-
57
- ## Verification
58
-
59
- ### 2026-03-30-notes-list-ops
60
-
61
- - `npm run build`
62
- - `node --loader tsx scripts/build-sdk.mts`
63
- - `node --loader tsx scripts/generate-mcp-skills.mts`
64
- - `node --loader tsx scripts/validate-mcp-skills.mts`
65
-
66
- ### 2026-03-30-notes-mcp-opaque-ids
67
-
68
- - `npm run lint -- src/api/contracts/ops/notes/notes.ts src/api/contracts/schemas/runtime-schema-defs.ts src/api/contracts/schemas/runtime-schema-overrides.ts tests/unit/notes-contracts.test.ts tests/unit/notes-controller.test.ts`
69
- - `npm run test:unit -- --runTestsByPath tests/unit/notes-contracts.test.ts tests/unit/notes-controller.test.ts`
70
- - `npm run lint -- src/controllers/notes/notes.ts tests/helpers/fake-notes-store.ts tests/helpers/fake-note-service.ts tests/helpers/reset-fake-notes.ts tests/e2e-sdk/notes/0.list-workspace-notes.test.ts tests/e2e-sdk/notes/1.get-workspace-note.test.ts tests/e2e-sdk/notes/2.create-workspace-note.test.ts tests/mcp-e2e/notes/0.list-workspace-notes.test.ts tests/mcp-e2e/notes/1.get-workspace-note.test.ts tests/mcp-e2e/notes/2.create-workspace-note.test.ts tests/unit/notes-controller.test.ts tests/unit/notes-contracts.test.ts tests/unit/notes-routes.test.ts`
71
- - `npm run test:unit -- --runTestsByPath tests/unit/notes-controller.test.ts tests/unit/notes-contracts.test.ts tests/unit/notes-routes.test.ts`
72
- - `npm run mcp:skills:generate`
73
- - `npm run mcp:skills:validate`
74
- - Blocked locally: `env USE_BUILD_ARTIFACT=true npm run test:mcp-e2e:full` failed because `db:migrate:test` could not connect to MySQL at `localhost:3306`
75
-
76
-
77
- ## Follow-ups
78
-
79
- ### 2026-03-30-notes-list-ops
80
-
81
- - Confirm whether client and visitor roles should receive `notes.read` or `notes.write` in read-only org contexts.
82
-
83
- ### 2026-03-30-notes-mcp-opaque-ids
84
-
85
- - Re-run the MCP E2E suite in CI or an environment with the test MySQL instance available to confirm the notes MCP failures are resolved end to end.