@fusebase/fusebase-gate-sdk 2.3.34-sdk.8 → 2.4.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.
- package/dist/apis/AppApisApi.d.ts +1 -1
- package/dist/apis/AppApisApi.js +1 -1
- package/dist/apis/FusebaseAuthApi.d.ts +2 -2
- package/dist/apis/FusebaseAuthApi.js +2 -2
- package/dist/apis/OrgUsersApi.d.ts +8 -4
- package/dist/apis/OrgUsersApi.js +4 -3
- package/dist/apis/PortalsApi.d.ts +94 -3
- package/dist/apis/PortalsApi.js +106 -2
- package/dist/types/app-api/app-api.d.ts +14 -0
- package/dist/types/fusebase-auth/fusebase-auth.d.ts +29 -16
- package/dist/types/index.d.ts +3 -3
- package/dist/types/org-user/org-user.d.ts +34 -0
- package/dist/types/portal-feature-context/portal-feature-context.d.ts +10 -0
- package/dist/types/portals/portals.d.ts +233 -4
- package/package.json +1 -1
- package/release-notes/2.3.34-sdk.10.md +1054 -0
- package/release-notes/2.4.0.md +9 -0
- package/release-notes/latest.md +3 -3
- package/release-notes/2.3.34-sdk.8.md +0 -9
|
@@ -11,7 +11,7 @@ export declare class AppApisApi {
|
|
|
11
11
|
constructor(client: Client);
|
|
12
12
|
/**
|
|
13
13
|
* Call app API operation
|
|
14
|
-
* Invokes a published app API operation through the owner app runtime using a runtime app token minted for the current authenticated caller context.
|
|
14
|
+
* Invokes a published app API operation through the owner app runtime using a runtime app token minted for the current authenticated caller context. Pass `onBehalfOfUserToken` (a platform app token, i.e. the user's `fbsfeaturetoken`) to run the call on behalf of an end user: Gate verifies it fail-closed and forwards the resolved user to the runtime as `X-Fusebase-Verified-User-Id` / `X-Fusebase-Verified-User-Source: obo`, so apps no longer need to hand-roll dual-token forwarding. The operation's `allowedCallers` / `requiredPermissions` are still evaluated against the calling identity, not the on-behalf-of user.
|
|
15
15
|
*/
|
|
16
16
|
callAppApi(params: {
|
|
17
17
|
path: {
|
package/dist/apis/AppApisApi.js
CHANGED
|
@@ -13,7 +13,7 @@ class AppApisApi {
|
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* Call app API operation
|
|
16
|
-
* Invokes a published app API operation through the owner app runtime using a runtime app token minted for the current authenticated caller context.
|
|
16
|
+
* Invokes a published app API operation through the owner app runtime using a runtime app token minted for the current authenticated caller context. Pass `onBehalfOfUserToken` (a platform app token, i.e. the user's `fbsfeaturetoken`) to run the call on behalf of an end user: Gate verifies it fail-closed and forwards the resolved user to the runtime as `X-Fusebase-Verified-User-Id` / `X-Fusebase-Verified-User-Source: obo`, so apps no longer need to hand-roll dual-token forwarding. The operation's `allowedCallers` / `requiredPermissions` are still evaluated against the calling identity, not the on-behalf-of user.
|
|
17
17
|
*/
|
|
18
18
|
async callAppApi(params) {
|
|
19
19
|
return this.client.request({
|
|
@@ -63,7 +63,7 @@ export declare class FusebaseAuthApi {
|
|
|
63
63
|
}): Promise<FusebaseAuthRegisterResponseContract>;
|
|
64
64
|
/**
|
|
65
65
|
* Request Fusebase password restore
|
|
66
|
-
* Visitor-safe password restore request. Forwards to auth-form `/auth/api/remind` and always returns a generic success shape so the route does not enumerate accounts. The email link
|
|
66
|
+
* Visitor-safe password restore request. Forwards to auth-form `/auth/api/remind` and always returns a generic success shape so the route does not enumerate accounts. The email and its reset link are rendered by the platform mail template; the link is not part of this contract. Set BOTH `portalId` and `workspaceId` for portal white-label branding. To control the reset URL yourself, use `requestFusebaseRestoreKey` and send your own email.
|
|
67
67
|
*/
|
|
68
68
|
requestFusebasePasswordRestore(params: {
|
|
69
69
|
headers?: Record<string, string>;
|
|
@@ -71,7 +71,7 @@ export declare class FusebaseAuthApi {
|
|
|
71
71
|
}): Promise<FusebaseAuthPasswordRestoreResponseContract>;
|
|
72
72
|
/**
|
|
73
73
|
* Mint a Fusebase password-restore key (no email)
|
|
74
|
-
*
|
|
74
|
+
* Mints a password-restore key without sending the platform email, so an app backend can send its own branded reset mail. The key works with `checkFusebasePasswordRestoreKey` / `resetFusebasePassword` at the same TTL and one-time-use as the email flow, and is not bound to any URL — build whatever reset link you want around it, or use the returned `platformResetUrl` if the app has no reset page of its own. Requires `auth.restore_key.write` and an app service token scoped to the path `orgId`; user, visitor and anonymous callers get 403, as does a token scoped to another org. Backend only — the app-wrapper `fbsfeaturetoken` cookie also resolves as a token subject, so the calling credential must never be reachable from frontend code. A key resets the target's GLOBAL FuseBase password, so it is minted only when the path `orgId` is the user's ONLY org; any footprint elsewhere is an independent account and 404s, as do unknown emails. NOT visitor-safe — it exposes the key.
|
|
75
75
|
*/
|
|
76
76
|
requestFusebaseRestoreKey(params: {
|
|
77
77
|
path: {
|
|
@@ -97,7 +97,7 @@ class FusebaseAuthApi {
|
|
|
97
97
|
}
|
|
98
98
|
/**
|
|
99
99
|
* Request Fusebase password restore
|
|
100
|
-
* Visitor-safe password restore request. Forwards to auth-form `/auth/api/remind` and always returns a generic success shape so the route does not enumerate accounts. The email link
|
|
100
|
+
* Visitor-safe password restore request. Forwards to auth-form `/auth/api/remind` and always returns a generic success shape so the route does not enumerate accounts. The email and its reset link are rendered by the platform mail template; the link is not part of this contract. Set BOTH `portalId` and `workspaceId` for portal white-label branding. To control the reset URL yourself, use `requestFusebaseRestoreKey` and send your own email.
|
|
101
101
|
*/
|
|
102
102
|
async requestFusebasePasswordRestore(params) {
|
|
103
103
|
return this.client.request({
|
|
@@ -111,7 +111,7 @@ class FusebaseAuthApi {
|
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
113
113
|
* Mint a Fusebase password-restore key (no email)
|
|
114
|
-
*
|
|
114
|
+
* Mints a password-restore key without sending the platform email, so an app backend can send its own branded reset mail. The key works with `checkFusebasePasswordRestoreKey` / `resetFusebasePassword` at the same TTL and one-time-use as the email flow, and is not bound to any URL — build whatever reset link you want around it, or use the returned `platformResetUrl` if the app has no reset page of its own. Requires `auth.restore_key.write` and an app service token scoped to the path `orgId`; user, visitor and anonymous callers get 403, as does a token scoped to another org. Backend only — the app-wrapper `fbsfeaturetoken` cookie also resolves as a token subject, so the calling credential must never be reachable from frontend code. A key resets the target's GLOBAL FuseBase password, so it is minted only when the path `orgId` is the user's ONLY org; any footprint elsewhere is an independent account and 404s, as do unknown emails. NOT visitor-safe — it exposes the key.
|
|
115
115
|
*/
|
|
116
116
|
async requestFusebaseRestoreKey(params) {
|
|
117
117
|
return this.client.request({
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Domain: org-users
|
|
6
6
|
*/
|
|
7
7
|
import type { Client } from "../runtime/transport";
|
|
8
|
-
import type { ClientAccountScheduledDeletionRequestContract, ClientAccountScheduledDeletionResponseContract, orgIdInPathRequired, OrgMemberRemoveResponseContract, OrgUserAddRequestContract, OrgUserAddResponseContract, OrgUserIdInPathRequired, OrgUserListResponseContract, OrgUserWorkspaceIdInPathRequired, OrgWorkspaceMemberListResponseContract, WorkspaceMemberRemoveResponseContract } from "../types";
|
|
8
|
+
import type { ClientAccountScheduledDeletionRequestContract, ClientAccountScheduledDeletionResponseContract, orgIdInPathRequired, OrgMemberExpectedJoinedAfterInQueryOptional, OrgMemberExpectedRoleInQueryOptional, OrgMemberRemoveResponseContract, OrgUserAddRequestContract, OrgUserAddResponseContract, OrgUserIdInPathRequired, OrgUserListResponseContract, OrgUserWorkspaceIdInPathRequired, OrgWorkspaceMemberListResponseContract, WorkspaceMemberRemoveResponseContract } from "../types";
|
|
9
9
|
export declare class OrgUsersApi {
|
|
10
10
|
private client;
|
|
11
11
|
constructor(client: Client);
|
|
@@ -32,7 +32,7 @@ export declare class OrgUsersApi {
|
|
|
32
32
|
}): Promise<OrgUserListResponseContract>;
|
|
33
33
|
/**
|
|
34
34
|
* List portal members
|
|
35
|
-
* Returns the members of a portal by its underlying workspaceId. Portal membership is currently represented by workspace membership (same semantics as removePortalMember), so Gate validates the workspace belongs to `orgId` and returns its members, each including the workspaceMember `id` (globalId). Requires org.members.read and org access.
|
|
35
|
+
* Returns the members of a portal by its underlying workspaceId. Portal membership is currently represented by workspace membership (same semantics as removePortalMember), so Gate validates the workspace belongs to `orgId` and returns its members, each including the workspaceMember `id` (globalId). Each member is enriched from org membership (joined by `userId`) with `orgRole` (guest|client|member|manager|owner), `email`, `firstname`, `lastname`, and `isPortalManager`. `isPortalManager` is the official flag for a portal manager (org role `manager`, what invitePortalManager grants, or `owner`); use it — plus `orgRole === 'client'` for clients — to answer 'client vs portal manager' and to build a 'Chat with <name | email>' channel name in one call, without a separate listOrgUsers roundtrip. Requires org.members.read and org access.
|
|
36
36
|
*/
|
|
37
37
|
listPortalMembers(params: {
|
|
38
38
|
path: {
|
|
@@ -43,7 +43,7 @@ export declare class OrgUsersApi {
|
|
|
43
43
|
}): Promise<OrgWorkspaceMemberListResponseContract>;
|
|
44
44
|
/**
|
|
45
45
|
* List workspace members
|
|
46
|
-
* Returns the members of a single workspace scoped to the organization. Gate validates that the workspace belongs to `orgId`, then calls org-service. Each member includes the workspaceMember `id` (globalId) needed by removeWorkspaceMember. Requires org.members.read and org access.
|
|
46
|
+
* Returns the members of a single workspace scoped to the organization. Gate validates that the workspace belongs to `orgId`, then calls org-service. Each member includes the workspaceMember `id` (globalId) needed by removeWorkspaceMember. Each member is enriched from org membership (joined by `userId`) with `orgRole` (guest|client|member|manager|owner), `email`, `firstname`, `lastname`, and `isPortalManager` — the official flag for a portal manager (org role `manager`, what invitePortalManager grants, or `owner`); prefer it over re-deriving the formula. Requires org.members.read and org access.
|
|
47
47
|
*/
|
|
48
48
|
listWorkspaceMembers(params: {
|
|
49
49
|
path: {
|
|
@@ -54,13 +54,17 @@ export declare class OrgUsersApi {
|
|
|
54
54
|
}): Promise<OrgWorkspaceMemberListResponseContract>;
|
|
55
55
|
/**
|
|
56
56
|
* Remove organization member
|
|
57
|
-
* Removes an organization member by numeric userId. Gate resolves the internal orgMember.globalId before calling org-service, and org-service cleans up workspace/group memberships for that org. Requires org.members.write and org access.
|
|
57
|
+
* Removes an organization member by numeric userId. Gate resolves the internal orgMember.globalId before calling org-service, and org-service cleans up workspace/group memberships for that org. Optional query preconditions make the removal conditional instead of unconditional: `expectedRole` requires the member to still hold that org role, and `expectedJoinedAfter` (unix seconds) requires the membership to have been created at or after that moment — use it when cancelling an invite so a pre-existing member is never dropped. Either mismatch fails with 409 and removes nothing; a precondition sent with an empty or unparsable value fails with 400 rather than degrading into an unconditional removal. Requires org.members.write and org access.
|
|
58
58
|
*/
|
|
59
59
|
removeOrgMember(params: {
|
|
60
60
|
path: {
|
|
61
61
|
orgId: orgIdInPathRequired;
|
|
62
62
|
userId: OrgUserIdInPathRequired;
|
|
63
63
|
};
|
|
64
|
+
query?: {
|
|
65
|
+
expectedRole?: OrgMemberExpectedRoleInQueryOptional;
|
|
66
|
+
expectedJoinedAfter?: OrgMemberExpectedJoinedAfterInQueryOptional;
|
|
67
|
+
};
|
|
64
68
|
headers?: Record<string, string>;
|
|
65
69
|
}): Promise<OrgMemberRemoveResponseContract>;
|
|
66
70
|
/**
|
package/dist/apis/OrgUsersApi.js
CHANGED
|
@@ -42,7 +42,7 @@ class OrgUsersApi {
|
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
44
|
* List portal members
|
|
45
|
-
* Returns the members of a portal by its underlying workspaceId. Portal membership is currently represented by workspace membership (same semantics as removePortalMember), so Gate validates the workspace belongs to `orgId` and returns its members, each including the workspaceMember `id` (globalId). Requires org.members.read and org access.
|
|
45
|
+
* Returns the members of a portal by its underlying workspaceId. Portal membership is currently represented by workspace membership (same semantics as removePortalMember), so Gate validates the workspace belongs to `orgId` and returns its members, each including the workspaceMember `id` (globalId). Each member is enriched from org membership (joined by `userId`) with `orgRole` (guest|client|member|manager|owner), `email`, `firstname`, `lastname`, and `isPortalManager`. `isPortalManager` is the official flag for a portal manager (org role `manager`, what invitePortalManager grants, or `owner`); use it — plus `orgRole === 'client'` for clients — to answer 'client vs portal manager' and to build a 'Chat with <name | email>' channel name in one call, without a separate listOrgUsers roundtrip. Requires org.members.read and org access.
|
|
46
46
|
*/
|
|
47
47
|
async listPortalMembers(params) {
|
|
48
48
|
return this.client.request({
|
|
@@ -56,7 +56,7 @@ class OrgUsersApi {
|
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* List workspace members
|
|
59
|
-
* Returns the members of a single workspace scoped to the organization. Gate validates that the workspace belongs to `orgId`, then calls org-service. Each member includes the workspaceMember `id` (globalId) needed by removeWorkspaceMember. Requires org.members.read and org access.
|
|
59
|
+
* Returns the members of a single workspace scoped to the organization. Gate validates that the workspace belongs to `orgId`, then calls org-service. Each member includes the workspaceMember `id` (globalId) needed by removeWorkspaceMember. Each member is enriched from org membership (joined by `userId`) with `orgRole` (guest|client|member|manager|owner), `email`, `firstname`, `lastname`, and `isPortalManager` — the official flag for a portal manager (org role `manager`, what invitePortalManager grants, or `owner`); prefer it over re-deriving the formula. Requires org.members.read and org access.
|
|
60
60
|
*/
|
|
61
61
|
async listWorkspaceMembers(params) {
|
|
62
62
|
return this.client.request({
|
|
@@ -70,13 +70,14 @@ class OrgUsersApi {
|
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
72
|
* Remove organization member
|
|
73
|
-
* Removes an organization member by numeric userId. Gate resolves the internal orgMember.globalId before calling org-service, and org-service cleans up workspace/group memberships for that org. Requires org.members.write and org access.
|
|
73
|
+
* Removes an organization member by numeric userId. Gate resolves the internal orgMember.globalId before calling org-service, and org-service cleans up workspace/group memberships for that org. Optional query preconditions make the removal conditional instead of unconditional: `expectedRole` requires the member to still hold that org role, and `expectedJoinedAfter` (unix seconds) requires the membership to have been created at or after that moment — use it when cancelling an invite so a pre-existing member is never dropped. Either mismatch fails with 409 and removes nothing; a precondition sent with an empty or unparsable value fails with 400 rather than degrading into an unconditional removal. Requires org.members.write and org access.
|
|
74
74
|
*/
|
|
75
75
|
async removeOrgMember(params) {
|
|
76
76
|
return this.client.request({
|
|
77
77
|
method: "DELETE",
|
|
78
78
|
path: "/:orgId/users/:userId",
|
|
79
79
|
pathParams: params.path,
|
|
80
|
+
query: params.query,
|
|
80
81
|
headers: params.headers,
|
|
81
82
|
opId: "removeOrgMember",
|
|
82
83
|
expectedContentType: "application/json",
|
|
@@ -5,13 +5,26 @@
|
|
|
5
5
|
* Domain: portals
|
|
6
6
|
*/
|
|
7
7
|
import type { Client } from "../runtime/transport";
|
|
8
|
-
import type { AddPortalAppPageRequestContract, AddPortalAppPageResponseContract, AddPortalBlockRequestContract, AddPortalBlockResponseContract, AddPortalNoteBlockRequestContract, AddPortalNoteBlockResponseContract, BulkInviteToPortalRequestContract, BulkInviteToPortalResponseContract, CreatePortalFolderRequestContract, CreatePortalFolderResponseContract, CreatePortalPageWithNoteRequestContract, CreatePortalPageWithNoteResponseContract, CreatePortalRequestContract, CreatePortalResponseContract, DuplicatePortalItemRequestContract, DuplicatePortalItemResponseContract, DuplicatePortalRequestContract, globalIdInPathRequired, InvitePortalManagerRequestContract, InvitePortalManagerResponseContract, InviteToPortalRequestContract, InviteToPortalResponseContract, ListPortalContentResponseContract, orgIdInPathRequired, OrgPortalListResponseContract, PortalDetailContract, PublishPortalDraftResponseContract, UpdatePortalAccessRequestContract, UpdatePortalAccessResponseContract, UpdatePortalCustomCodeRequestContract, UpdatePortalCustomCodeResponseContract } from "../types";
|
|
8
|
+
import type { AddPortalAppBlockRequestContract, AddPortalAppBlockResponseContract, AddPortalAppPageRequestContract, AddPortalAppPageResponseContract, AddPortalBlankNoteBlockRequestContract, AddPortalBlankNoteBlockResponseContract, AddPortalBlockRequestContract, AddPortalBlockResponseContract, AddPortalChatBlockRequestContract, AddPortalChatBlockResponseContract, AddPortalEmbedBlockRequestContract, AddPortalEmbedBlockResponseContract, AddPortalNoteBlockRequestContract, AddPortalNoteBlockResponseContract, BulkInviteToPortalRequestContract, BulkInviteToPortalResponseContract, CreatePortalFolderRequestContract, CreatePortalFolderResponseContract, CreatePortalPageRequestContract, CreatePortalPageResponseContract, CreatePortalPageWithNoteRequestContract, CreatePortalPageWithNoteResponseContract, CreatePortalRequestContract, CreatePortalResponseContract, DuplicatePortalItemRequestContract, DuplicatePortalItemResponseContract, DuplicatePortalRequestContract, globalIdInPathRequired, InvitePortalManagerRequestContract, InvitePortalManagerResponseContract, InviteToPortalRequestContract, InviteToPortalResponseContract, ListPortalChatChannelsResponseContract, ListPortalChatUsersResponseContract, ListPortalContentResponseContract, orgIdInPathRequired, OrgPortalListResponseContract, PortalDetailContract, PublishPortalDraftResponseContract, UpdatePortalAccessRequestContract, UpdatePortalAccessResponseContract, UpdatePortalCustomCodeRequestContract, UpdatePortalCustomCodeResponseContract } from "../types";
|
|
9
9
|
export declare class PortalsApi {
|
|
10
10
|
private client;
|
|
11
11
|
constructor(client: Client);
|
|
12
|
+
/**
|
|
13
|
+
* Add a published app as a block on an existing portal page
|
|
14
|
+
* Stages one published Fusebase app as a flexible app-feature block on an EXISTING portal page. No new page and no sidebar menu item is created — use addPortalAppPage when the app should get its own sidebar page. Pass productId (the product that owns the app) and appId (the app to embed); resolve both, plus productType and productOrgId, with findPublishedApps. For a managed product (Customizer "Managed Products") also pass productType='managed' and productOrgId. For a published page resolve pageId from listPortalContent; for a page created earlier in the active draft use the pageId that operation returned. The block is staged in the portal's customizer draft (not published immediately). Returns the block id, the page the block was staged on, and the draft branch/seqs. Requires portals.write access.
|
|
15
|
+
*/
|
|
16
|
+
addPortalAppBlock(params: {
|
|
17
|
+
path: {
|
|
18
|
+
orgId: orgIdInPathRequired;
|
|
19
|
+
portalId: globalIdInPathRequired;
|
|
20
|
+
pageId: globalIdInPathRequired;
|
|
21
|
+
};
|
|
22
|
+
headers?: Record<string, string>;
|
|
23
|
+
body: AddPortalAppBlockRequestContract;
|
|
24
|
+
}): Promise<AddPortalAppBlockResponseContract>;
|
|
12
25
|
/**
|
|
13
26
|
* Add a published app as a portal page (embed)
|
|
14
|
-
* Creates a new sidebar page in the portal that embeds a published Fusebase app (a flexible block with an app-feature brick). Pass productId (the product that owns the app) and appId (the app to embed) — typically the app you just built and published via the CLI. The app's URL is resolved by the portal at render time from these ids; nothing is hard-coded. Pass parentId to nest the page under an existing folder. The page is staged in the portal's customizer draft (not published immediately): the portal owner opens the customizer, reviews the pending page, and publishes it. Returns the page/menu-item/block ids, the page url, and the draft branch/seqs. Requires portals.write access.
|
|
27
|
+
* Creates a new sidebar page in the portal that embeds a published Fusebase app (a flexible block with an app-feature brick). Pass productId (the product that owns the app) and appId (the app to embed) — typically the app you just built and published via the CLI. For a managed product (Customizer "Managed Products") also pass productType='managed' and productOrgId from findPublishedApps. The app's URL is resolved by the portal at render time from these ids; nothing is hard-coded. Pass parentId to nest the page under an existing folder. The page is staged in the portal's customizer draft (not published immediately): the portal owner opens the customizer, reviews the pending page, and publishes it. Returns the page/menu-item/block ids, the page url, and the draft branch/seqs. Requires portals.write access.
|
|
15
28
|
*/
|
|
16
29
|
addPortalAppPage(params: {
|
|
17
30
|
path: {
|
|
@@ -21,9 +34,22 @@ export declare class PortalsApi {
|
|
|
21
34
|
headers?: Record<string, string>;
|
|
22
35
|
body: AddPortalAppPageRequestContract;
|
|
23
36
|
}): Promise<AddPortalAppPageResponseContract>;
|
|
37
|
+
/**
|
|
38
|
+
* Add an empty Fusebase note as a block to a portal page
|
|
39
|
+
* Creates a new EMPTY Fusebase note, shares it into the portal and adds it as a note block to an existing portal page — the programmatic equivalent of the customizer's "Blank Block" action. No new page and no sidebar menu item is created. For a published page resolve pageId from listPortalContent; for a page created earlier in the active draft use the pageId that operation returned. The block is appended after the last block of the page body and is staged in the portal's customizer draft (not published immediately). Use addPortalNoteBlock when the note already exists and is already shared into the portal, and createPortalPageWithNote when a new sidebar page backed by a note is wanted. Returns the note/block ids and the draft branch/seqs. Requires portals.write access.
|
|
40
|
+
*/
|
|
41
|
+
addPortalBlankNoteBlock(params: {
|
|
42
|
+
path: {
|
|
43
|
+
orgId: orgIdInPathRequired;
|
|
44
|
+
portalId: globalIdInPathRequired;
|
|
45
|
+
pageId: globalIdInPathRequired;
|
|
46
|
+
};
|
|
47
|
+
headers?: Record<string, string>;
|
|
48
|
+
body?: AddPortalBlankNoteBlockRequestContract;
|
|
49
|
+
}): Promise<AddPortalBlankNoteBlockResponseContract>;
|
|
24
50
|
/**
|
|
25
51
|
* Add a block of any palette type to a portal page
|
|
26
|
-
* Stages a single block of any supported type onto an existing portal page — the universal building block behind the customizer's 'Add new block' palette (no new page or sidebar item is created). Pass pageId (the target page node id from listPortalContent) and type. Supported types: note, content,
|
|
52
|
+
* Stages a single block of any supported type onto an existing portal page — the universal building block behind the customizer's 'Add new block' palette (no new page or sidebar item is created). Pass pageId (the target page node id from listPortalContent) and type. Supported types: note, content, info, docs, help, request, meetings, links, task-list, projection, files-dashboard, tasks-dashboard, chats-dashboard, files-recent, files-bucket, flexible. Type-specific fields: note/content require noteId; flexible requires template (e.g. {type:'text'|'image'|'title'|'code'|'form'|'dashboard'|'ai-agent'|'app-feature'|...}) and may carry bricks; info/projection/task-list and others take their fields via the free-form `properties` object (e.g. image/link, sourcePortalId/sourcePageId/sourceBlockId, taskListIds). This op does NOT accept type='embed' or type='chat' — use addPortalEmbedBlock for Embed blocks and addPortalChatBlock for Chat blocks. Use addPortalNoteBlock for the common note case or addPortalAppPage for an app on its own page. Note: a `content` block renames the page to its title, so leave title empty for content blocks. The block is staged in the portal's customizer draft (not published immediately); the owner reviews and publishes it. Returns the block id and the draft branch/seqs. Requires portals.write access.
|
|
27
53
|
*/
|
|
28
54
|
addPortalBlock(params: {
|
|
29
55
|
path: {
|
|
@@ -33,6 +59,32 @@ export declare class PortalsApi {
|
|
|
33
59
|
headers?: Record<string, string>;
|
|
34
60
|
body: AddPortalBlockRequestContract;
|
|
35
61
|
}): Promise<AddPortalBlockResponseContract>;
|
|
62
|
+
/**
|
|
63
|
+
* Add a Chat block to a portal page
|
|
64
|
+
* Stages one Customizer-compatible Chat block on an EXISTING portal page — the programmatic equivalent of the customizer's "Chat" action. Pass exactly one target: { type: 'channel', channelId } (id from listPortalChatChannels) or { type: 'dm', userId } (an active org member's userId). membersOnly is channel-only (default true; a private channel requires true; forbidden for dm). One active Chat block is allowed per page — a second returns 409. Creates one chat widget configuration and stages the block in the customizer draft (not published immediately). This is a Chat WIDGET on a page, distinct from the portal's system chat menu item and the chats-dashboard block. For a published page resolve pageId from listPortalContent; for a page created earlier in the active draft use the pageId that operation returned. Returns the block id and the draft branch/seqs. Requires portals.write access.
|
|
65
|
+
*/
|
|
66
|
+
addPortalChatBlock(params: {
|
|
67
|
+
path: {
|
|
68
|
+
orgId: orgIdInPathRequired;
|
|
69
|
+
portalId: globalIdInPathRequired;
|
|
70
|
+
pageId: globalIdInPathRequired;
|
|
71
|
+
};
|
|
72
|
+
headers?: Record<string, string>;
|
|
73
|
+
body: AddPortalChatBlockRequestContract;
|
|
74
|
+
}): Promise<AddPortalChatBlockResponseContract>;
|
|
75
|
+
/**
|
|
76
|
+
* Add an Embeds & Integrations block to a portal page
|
|
77
|
+
* Stages one Customizer-compatible Embed block on an EXISTING portal page — the programmatic equivalent of the customizer's "Embeds & Integrations" action. No new page and no sidebar menu item is created. embedType is one of the 11 chooser variants (custom, youtube, google-drive, ms-doc, calendly, hubspot, airtable, loom, data-studio, figma, miro). For `custom` pass `content` (URL or embed code) and NOT `url`; for every named variant pass `url` and NOT `content` — the service builds the canonical iframe. hubspot here is an iframe Embed block, not a Flexible Block integration brick. For a published page resolve pageId from listPortalContent; for a page created earlier in the active draft use the pageId that operation returned. The block is staged in the portal's customizer draft (not published immediately). Returns the block id and the draft branch/seqs. Requires portals.write access.
|
|
78
|
+
*/
|
|
79
|
+
addPortalEmbedBlock(params: {
|
|
80
|
+
path: {
|
|
81
|
+
orgId: orgIdInPathRequired;
|
|
82
|
+
portalId: globalIdInPathRequired;
|
|
83
|
+
pageId: globalIdInPathRequired;
|
|
84
|
+
};
|
|
85
|
+
headers?: Record<string, string>;
|
|
86
|
+
body: AddPortalEmbedBlockRequestContract;
|
|
87
|
+
}): Promise<AddPortalEmbedBlockResponseContract>;
|
|
36
88
|
/**
|
|
37
89
|
* Add an existing Fusebase note as a block to a portal page
|
|
38
90
|
* Embeds an existing Fusebase note as a content block on an existing portal page (no new page or sidebar item is created). The note must already exist in the portal's workspace and be shared into the portal (e.g. created via createPortalPageWithNote). Pass pageId (the target page node id, obtained from listPortalContent) and noteId. The block is staged in the portal's customizer draft (not published immediately): the portal owner opens the customizer, reviews the pending block, and publishes it. Returns the created block id and the draft branch/seqs. Requires portals.write access.
|
|
@@ -80,6 +132,18 @@ export declare class PortalsApi {
|
|
|
80
132
|
headers?: Record<string, string>;
|
|
81
133
|
body: CreatePortalFolderRequestContract;
|
|
82
134
|
}): Promise<CreatePortalFolderResponseContract>;
|
|
135
|
+
/**
|
|
136
|
+
* Create an empty portal page
|
|
137
|
+
* Creates a new EMPTY sidebar page in the portal — a page node plus its sidebar menu item, with no Fusebase note and no block. The page is staged in the portal's customizer draft (not published immediately): the portal owner opens the customizer, reviews the pending page, and publishes it. Pass parentId to nest the page under an existing published or active-draft folder. The returned pageId can immediately be passed to semantic block operations to add content before publishing. Use createPortalPageWithNote instead when a page backed by a new Fusebase note is wanted. Returns the page/menu-item ids, the page url, and the draft branch/seqs. Requires portals.write access.
|
|
138
|
+
*/
|
|
139
|
+
createPortalPage(params: {
|
|
140
|
+
path: {
|
|
141
|
+
orgId: orgIdInPathRequired;
|
|
142
|
+
portalId: globalIdInPathRequired;
|
|
143
|
+
};
|
|
144
|
+
headers?: Record<string, string>;
|
|
145
|
+
body: CreatePortalPageRequestContract;
|
|
146
|
+
}): Promise<CreatePortalPageResponseContract>;
|
|
83
147
|
/**
|
|
84
148
|
* Create a portal page backed by a Fusebase note
|
|
85
149
|
* Creates a new sidebar page in the portal backed by a freshly created Fusebase note. The note is created in the portal's workspace and shared into the portal; optional initial text or html can be appended to it. The page (page node + note menu item + note content block) is staged in the portal's customizer draft (not published immediately): the portal owner opens the customizer, reviews the pending page, and publishes it. Pass parentId to nest the page under an existing folder. Returns the note/page/menu-item ids, the page url, and the draft branch/seqs. Requires portals.write access.
|
|
@@ -152,6 +216,33 @@ export declare class PortalsApi {
|
|
|
152
216
|
headers?: Record<string, string>;
|
|
153
217
|
body: InviteToPortalRequestContract;
|
|
154
218
|
}): Promise<InviteToPortalResponseContract>;
|
|
219
|
+
/**
|
|
220
|
+
* List a portal's chat channels for the Chat block picker
|
|
221
|
+
* Lists the real, listable chat channels of a portal so a Chat block can target one by exact id. DMs, group DMs and hidden channels are excluded; the default channel is returned first. ALWAYS call this before addPortalChatBlock with a channel target — never guess a channel id and never assume `general` exists. This is the Chat widget's channel list, distinct from the portal's system chat menu item and the chats-dashboard block. Requires portals.write access.
|
|
222
|
+
*/
|
|
223
|
+
listPortalChatChannels(params: {
|
|
224
|
+
path: {
|
|
225
|
+
orgId: orgIdInPathRequired;
|
|
226
|
+
portalId: globalIdInPathRequired;
|
|
227
|
+
};
|
|
228
|
+
headers?: Record<string, string>;
|
|
229
|
+
}): Promise<ListPortalChatChannelsResponseContract>;
|
|
230
|
+
/**
|
|
231
|
+
* Search or browse a portal's DM target users for the Chat block picker
|
|
232
|
+
* Searches a portal org's active members + owner by name, username or email so a Chat block can target a DM by exact user id. Call this before addPortalChatBlock with a `dm` target — never guess a user id. `query` is optional: omit it to browse the first bounded page. Returns a single page of { id, displayName, username?, email? }, the matching `total`, and an opaque nextCursor when more pages exist. Show one page at a time and ask before fetching the next; never request or aggregate the full org user list. Requires portals.write access.
|
|
233
|
+
*/
|
|
234
|
+
listPortalChatUsers(params: {
|
|
235
|
+
path: {
|
|
236
|
+
orgId: orgIdInPathRequired;
|
|
237
|
+
portalId: globalIdInPathRequired;
|
|
238
|
+
};
|
|
239
|
+
query?: {
|
|
240
|
+
query?: string;
|
|
241
|
+
limit?: number;
|
|
242
|
+
cursor?: string;
|
|
243
|
+
};
|
|
244
|
+
headers?: Record<string, string>;
|
|
245
|
+
}): Promise<ListPortalChatUsersResponseContract>;
|
|
155
246
|
/**
|
|
156
247
|
* List portal content (folders and pages)
|
|
157
248
|
* Returns the menu tree of a portal: folders, note pages, portal pages, and system items. Use this operation to discover existing content before creating new folders or pages. Item types match portal-service values: notesFolder, note, portalPage, home, link, etc. For items of type 'note', the noteId field contains the Fusebase note id. Requires portals.read access.
|
package/dist/apis/PortalsApi.js
CHANGED
|
@@ -11,9 +11,24 @@ class PortalsApi {
|
|
|
11
11
|
constructor(client) {
|
|
12
12
|
this.client = client;
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Add a published app as a block on an existing portal page
|
|
16
|
+
* Stages one published Fusebase app as a flexible app-feature block on an EXISTING portal page. No new page and no sidebar menu item is created — use addPortalAppPage when the app should get its own sidebar page. Pass productId (the product that owns the app) and appId (the app to embed); resolve both, plus productType and productOrgId, with findPublishedApps. For a managed product (Customizer "Managed Products") also pass productType='managed' and productOrgId. For a published page resolve pageId from listPortalContent; for a page created earlier in the active draft use the pageId that operation returned. The block is staged in the portal's customizer draft (not published immediately). Returns the block id, the page the block was staged on, and the draft branch/seqs. Requires portals.write access.
|
|
17
|
+
*/
|
|
18
|
+
async addPortalAppBlock(params) {
|
|
19
|
+
return this.client.request({
|
|
20
|
+
method: "POST",
|
|
21
|
+
path: "/:orgId/portals/:portalId/pages/:pageId/blocks/app",
|
|
22
|
+
pathParams: params.path,
|
|
23
|
+
headers: params.headers,
|
|
24
|
+
body: params.body,
|
|
25
|
+
opId: "addPortalAppBlock",
|
|
26
|
+
expectedContentType: "application/json",
|
|
27
|
+
});
|
|
28
|
+
}
|
|
14
29
|
/**
|
|
15
30
|
* Add a published app as a portal page (embed)
|
|
16
|
-
* Creates a new sidebar page in the portal that embeds a published Fusebase app (a flexible block with an app-feature brick). Pass productId (the product that owns the app) and appId (the app to embed) — typically the app you just built and published via the CLI. The app's URL is resolved by the portal at render time from these ids; nothing is hard-coded. Pass parentId to nest the page under an existing folder. The page is staged in the portal's customizer draft (not published immediately): the portal owner opens the customizer, reviews the pending page, and publishes it. Returns the page/menu-item/block ids, the page url, and the draft branch/seqs. Requires portals.write access.
|
|
31
|
+
* Creates a new sidebar page in the portal that embeds a published Fusebase app (a flexible block with an app-feature brick). Pass productId (the product that owns the app) and appId (the app to embed) — typically the app you just built and published via the CLI. For a managed product (Customizer "Managed Products") also pass productType='managed' and productOrgId from findPublishedApps. The app's URL is resolved by the portal at render time from these ids; nothing is hard-coded. Pass parentId to nest the page under an existing folder. The page is staged in the portal's customizer draft (not published immediately): the portal owner opens the customizer, reviews the pending page, and publishes it. Returns the page/menu-item/block ids, the page url, and the draft branch/seqs. Requires portals.write access.
|
|
17
32
|
*/
|
|
18
33
|
async addPortalAppPage(params) {
|
|
19
34
|
return this.client.request({
|
|
@@ -26,9 +41,24 @@ class PortalsApi {
|
|
|
26
41
|
expectedContentType: "application/json",
|
|
27
42
|
});
|
|
28
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Add an empty Fusebase note as a block to a portal page
|
|
46
|
+
* Creates a new EMPTY Fusebase note, shares it into the portal and adds it as a note block to an existing portal page — the programmatic equivalent of the customizer's "Blank Block" action. No new page and no sidebar menu item is created. For a published page resolve pageId from listPortalContent; for a page created earlier in the active draft use the pageId that operation returned. The block is appended after the last block of the page body and is staged in the portal's customizer draft (not published immediately). Use addPortalNoteBlock when the note already exists and is already shared into the portal, and createPortalPageWithNote when a new sidebar page backed by a note is wanted. Returns the note/block ids and the draft branch/seqs. Requires portals.write access.
|
|
47
|
+
*/
|
|
48
|
+
async addPortalBlankNoteBlock(params) {
|
|
49
|
+
return this.client.request({
|
|
50
|
+
method: "POST",
|
|
51
|
+
path: "/:orgId/portals/:portalId/pages/:pageId/blocks/blank-note",
|
|
52
|
+
pathParams: params.path,
|
|
53
|
+
headers: params.headers,
|
|
54
|
+
body: params.body,
|
|
55
|
+
opId: "addPortalBlankNoteBlock",
|
|
56
|
+
expectedContentType: "application/json",
|
|
57
|
+
});
|
|
58
|
+
}
|
|
29
59
|
/**
|
|
30
60
|
* Add a block of any palette type to a portal page
|
|
31
|
-
* Stages a single block of any supported type onto an existing portal page — the universal building block behind the customizer's 'Add new block' palette (no new page or sidebar item is created). Pass pageId (the target page node id from listPortalContent) and type. Supported types: note, content,
|
|
61
|
+
* Stages a single block of any supported type onto an existing portal page — the universal building block behind the customizer's 'Add new block' palette (no new page or sidebar item is created). Pass pageId (the target page node id from listPortalContent) and type. Supported types: note, content, info, docs, help, request, meetings, links, task-list, projection, files-dashboard, tasks-dashboard, chats-dashboard, files-recent, files-bucket, flexible. Type-specific fields: note/content require noteId; flexible requires template (e.g. {type:'text'|'image'|'title'|'code'|'form'|'dashboard'|'ai-agent'|'app-feature'|...}) and may carry bricks; info/projection/task-list and others take their fields via the free-form `properties` object (e.g. image/link, sourcePortalId/sourcePageId/sourceBlockId, taskListIds). This op does NOT accept type='embed' or type='chat' — use addPortalEmbedBlock for Embed blocks and addPortalChatBlock for Chat blocks. Use addPortalNoteBlock for the common note case or addPortalAppPage for an app on its own page. Note: a `content` block renames the page to its title, so leave title empty for content blocks. The block is staged in the portal's customizer draft (not published immediately); the owner reviews and publishes it. Returns the block id and the draft branch/seqs. Requires portals.write access.
|
|
32
62
|
*/
|
|
33
63
|
async addPortalBlock(params) {
|
|
34
64
|
return this.client.request({
|
|
@@ -41,6 +71,36 @@ class PortalsApi {
|
|
|
41
71
|
expectedContentType: "application/json",
|
|
42
72
|
});
|
|
43
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Add a Chat block to a portal page
|
|
76
|
+
* Stages one Customizer-compatible Chat block on an EXISTING portal page — the programmatic equivalent of the customizer's "Chat" action. Pass exactly one target: { type: 'channel', channelId } (id from listPortalChatChannels) or { type: 'dm', userId } (an active org member's userId). membersOnly is channel-only (default true; a private channel requires true; forbidden for dm). One active Chat block is allowed per page — a second returns 409. Creates one chat widget configuration and stages the block in the customizer draft (not published immediately). This is a Chat WIDGET on a page, distinct from the portal's system chat menu item and the chats-dashboard block. For a published page resolve pageId from listPortalContent; for a page created earlier in the active draft use the pageId that operation returned. Returns the block id and the draft branch/seqs. Requires portals.write access.
|
|
77
|
+
*/
|
|
78
|
+
async addPortalChatBlock(params) {
|
|
79
|
+
return this.client.request({
|
|
80
|
+
method: "POST",
|
|
81
|
+
path: "/:orgId/portals/:portalId/pages/:pageId/blocks/chat",
|
|
82
|
+
pathParams: params.path,
|
|
83
|
+
headers: params.headers,
|
|
84
|
+
body: params.body,
|
|
85
|
+
opId: "addPortalChatBlock",
|
|
86
|
+
expectedContentType: "application/json",
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Add an Embeds & Integrations block to a portal page
|
|
91
|
+
* Stages one Customizer-compatible Embed block on an EXISTING portal page — the programmatic equivalent of the customizer's "Embeds & Integrations" action. No new page and no sidebar menu item is created. embedType is one of the 11 chooser variants (custom, youtube, google-drive, ms-doc, calendly, hubspot, airtable, loom, data-studio, figma, miro). For `custom` pass `content` (URL or embed code) and NOT `url`; for every named variant pass `url` and NOT `content` — the service builds the canonical iframe. hubspot here is an iframe Embed block, not a Flexible Block integration brick. For a published page resolve pageId from listPortalContent; for a page created earlier in the active draft use the pageId that operation returned. The block is staged in the portal's customizer draft (not published immediately). Returns the block id and the draft branch/seqs. Requires portals.write access.
|
|
92
|
+
*/
|
|
93
|
+
async addPortalEmbedBlock(params) {
|
|
94
|
+
return this.client.request({
|
|
95
|
+
method: "POST",
|
|
96
|
+
path: "/:orgId/portals/:portalId/pages/:pageId/blocks/embed",
|
|
97
|
+
pathParams: params.path,
|
|
98
|
+
headers: params.headers,
|
|
99
|
+
body: params.body,
|
|
100
|
+
opId: "addPortalEmbedBlock",
|
|
101
|
+
expectedContentType: "application/json",
|
|
102
|
+
});
|
|
103
|
+
}
|
|
44
104
|
/**
|
|
45
105
|
* Add an existing Fusebase note as a block to a portal page
|
|
46
106
|
* Embeds an existing Fusebase note as a content block on an existing portal page (no new page or sidebar item is created). The note must already exist in the portal's workspace and be shared into the portal (e.g. created via createPortalPageWithNote). Pass pageId (the target page node id, obtained from listPortalContent) and noteId. The block is staged in the portal's customizer draft (not published immediately): the portal owner opens the customizer, reviews the pending block, and publishes it. Returns the created block id and the draft branch/seqs. Requires portals.write access.
|
|
@@ -101,6 +161,21 @@ class PortalsApi {
|
|
|
101
161
|
expectedContentType: "application/json",
|
|
102
162
|
});
|
|
103
163
|
}
|
|
164
|
+
/**
|
|
165
|
+
* Create an empty portal page
|
|
166
|
+
* Creates a new EMPTY sidebar page in the portal — a page node plus its sidebar menu item, with no Fusebase note and no block. The page is staged in the portal's customizer draft (not published immediately): the portal owner opens the customizer, reviews the pending page, and publishes it. Pass parentId to nest the page under an existing published or active-draft folder. The returned pageId can immediately be passed to semantic block operations to add content before publishing. Use createPortalPageWithNote instead when a page backed by a new Fusebase note is wanted. Returns the page/menu-item ids, the page url, and the draft branch/seqs. Requires portals.write access.
|
|
167
|
+
*/
|
|
168
|
+
async createPortalPage(params) {
|
|
169
|
+
return this.client.request({
|
|
170
|
+
method: "POST",
|
|
171
|
+
path: "/:orgId/portals/:portalId/pages",
|
|
172
|
+
pathParams: params.path,
|
|
173
|
+
headers: params.headers,
|
|
174
|
+
body: params.body,
|
|
175
|
+
opId: "createPortalPage",
|
|
176
|
+
expectedContentType: "application/json",
|
|
177
|
+
});
|
|
178
|
+
}
|
|
104
179
|
/**
|
|
105
180
|
* Create a portal page backed by a Fusebase note
|
|
106
181
|
* Creates a new sidebar page in the portal backed by a freshly created Fusebase note. The note is created in the portal's workspace and shared into the portal; optional initial text or html can be appended to it. The page (page node + note menu item + note content block) is staged in the portal's customizer draft (not published immediately): the portal owner opens the customizer, reviews the pending page, and publishes it. Pass parentId to nest the page under an existing folder. Returns the note/page/menu-item ids, the page url, and the draft branch/seqs. Requires portals.write access.
|
|
@@ -190,6 +265,35 @@ class PortalsApi {
|
|
|
190
265
|
expectedContentType: "application/json",
|
|
191
266
|
});
|
|
192
267
|
}
|
|
268
|
+
/**
|
|
269
|
+
* List a portal's chat channels for the Chat block picker
|
|
270
|
+
* Lists the real, listable chat channels of a portal so a Chat block can target one by exact id. DMs, group DMs and hidden channels are excluded; the default channel is returned first. ALWAYS call this before addPortalChatBlock with a channel target — never guess a channel id and never assume `general` exists. This is the Chat widget's channel list, distinct from the portal's system chat menu item and the chats-dashboard block. Requires portals.write access.
|
|
271
|
+
*/
|
|
272
|
+
async listPortalChatChannels(params) {
|
|
273
|
+
return this.client.request({
|
|
274
|
+
method: "GET",
|
|
275
|
+
path: "/:orgId/portals/:portalId/chat/channels",
|
|
276
|
+
pathParams: params.path,
|
|
277
|
+
headers: params.headers,
|
|
278
|
+
opId: "listPortalChatChannels",
|
|
279
|
+
expectedContentType: "application/json",
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Search or browse a portal's DM target users for the Chat block picker
|
|
284
|
+
* Searches a portal org's active members + owner by name, username or email so a Chat block can target a DM by exact user id. Call this before addPortalChatBlock with a `dm` target — never guess a user id. `query` is optional: omit it to browse the first bounded page. Returns a single page of { id, displayName, username?, email? }, the matching `total`, and an opaque nextCursor when more pages exist. Show one page at a time and ask before fetching the next; never request or aggregate the full org user list. Requires portals.write access.
|
|
285
|
+
*/
|
|
286
|
+
async listPortalChatUsers(params) {
|
|
287
|
+
return this.client.request({
|
|
288
|
+
method: "GET",
|
|
289
|
+
path: "/:orgId/portals/:portalId/chat/users",
|
|
290
|
+
pathParams: params.path,
|
|
291
|
+
query: params.query,
|
|
292
|
+
headers: params.headers,
|
|
293
|
+
opId: "listPortalChatUsers",
|
|
294
|
+
expectedContentType: "application/json",
|
|
295
|
+
});
|
|
296
|
+
}
|
|
193
297
|
/**
|
|
194
298
|
* List portal content (folders and pages)
|
|
195
299
|
* Returns the menu tree of a portal: folders, note pages, portal pages, and system items. Use this operation to discover existing content before creating new folders or pages. Item types match portal-service values: notesFolder, note, portalPage, home, link, etc. For items of type 'note', the noteId field contains the Fusebase note id. Requires portals.read access.
|
|
@@ -28,6 +28,13 @@ export interface PublishedAppContract {
|
|
|
28
28
|
title: string;
|
|
29
29
|
productTitle: string;
|
|
30
30
|
status: "published" | "draft";
|
|
31
|
+
/** Product owner organization. Managed products are owned by another org. */
|
|
32
|
+
productOrgId: string;
|
|
33
|
+
/**
|
|
34
|
+
* private -> Customizer "Your Products/Apps"
|
|
35
|
+
* managed -> Customizer "Managed Products"
|
|
36
|
+
*/
|
|
37
|
+
productType: "private" | "managed";
|
|
31
38
|
}
|
|
32
39
|
export interface PublishedAppListResponseContract {
|
|
33
40
|
apps: PublishedAppContract[];
|
|
@@ -37,6 +44,13 @@ export interface CallAppApiRequestContract {
|
|
|
37
44
|
path?: Record<string, string>;
|
|
38
45
|
query?: Record<string, string | number | boolean>;
|
|
39
46
|
body?: unknown;
|
|
47
|
+
/**
|
|
48
|
+
* On-behalf-of: a platform app token (`fbsfeaturetoken` / `x-app-feature-token`)
|
|
49
|
+
* identifying the end user this call runs for. Gate verifies it fail-closed and
|
|
50
|
+
* forwards the resolved user to the runtime as `X-Fusebase-Verified-User-*`
|
|
51
|
+
* headers; the calling identity still governs the operation's access policy.
|
|
52
|
+
*/
|
|
53
|
+
onBehalfOfUserToken?: string;
|
|
40
54
|
}
|
|
41
55
|
export interface CallAppApiResponseContract {
|
|
42
56
|
ok: boolean;
|
|
@@ -68,6 +68,21 @@ export interface FusebaseAuthConflictErrorBodyContract {
|
|
|
68
68
|
upstreamErrorCode?: number;
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Body returned with HTTP 401 when auth-form rejects the supplied credentials
|
|
73
|
+
* or challenge answer. `data.errorCode` says which:
|
|
74
|
+
* `fusebase_auth_invalid_credentials` (wrong email/password — do not retry),
|
|
75
|
+
* `fusebase_auth_challenge_failed` (wrong verification code — re-prompt) or
|
|
76
|
+
* `fusebase_auth_challenge_expired` (restart the sign-in).
|
|
77
|
+
*/
|
|
78
|
+
export interface FusebaseAuthUnauthorizedErrorBodyContract {
|
|
79
|
+
success: false;
|
|
80
|
+
message: string;
|
|
81
|
+
data: {
|
|
82
|
+
code: string;
|
|
83
|
+
errorCode: string;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
71
86
|
export interface FusebaseAuthLoginRequestContract {
|
|
72
87
|
/**
|
|
73
88
|
* User email. Forwarded to auth-form as `login`.
|
|
@@ -101,16 +116,10 @@ export interface FusebaseAuthPasswordRestoreRequestContract {
|
|
|
101
116
|
* @format email
|
|
102
117
|
*/
|
|
103
118
|
email: string;
|
|
104
|
-
/**
|
|
105
|
-
* Base URL of the app's own reset page. The platform appends `/resetpass` and
|
|
106
|
-
* puts the restore key in query param `key`, so the email link is
|
|
107
|
-
* `${customAuthUrl}/resetpass?key=<key>`. Omit to use the default Fusebase host.
|
|
108
|
-
*/
|
|
109
|
-
customAuthUrl?: string;
|
|
110
119
|
/**
|
|
111
120
|
* Portal white-label branding. When BOTH `portalId` and `workspaceId` are set,
|
|
112
|
-
* user-service switches to portal branding: it
|
|
113
|
-
*
|
|
121
|
+
* user-service switches to portal branding: it resolves the portal domain
|
|
122
|
+
* itself, uses the portal name, and sends the `restore_portal_password`
|
|
114
123
|
* template instead of the default one.
|
|
115
124
|
*/
|
|
116
125
|
portalId?: string;
|
|
@@ -125,17 +134,21 @@ export interface FusebaseAuthRestoreKeyRequestContract {
|
|
|
125
134
|
* @format email
|
|
126
135
|
*/
|
|
127
136
|
email: string;
|
|
128
|
-
/**
|
|
129
|
-
* Base URL of the app's own reset page. When present the response `resetUrl` is
|
|
130
|
-
* `${customAuthUrl}/resetpass?key=<key>` (same format as the platform email link).
|
|
131
|
-
*/
|
|
132
|
-
customAuthUrl?: string;
|
|
133
137
|
}
|
|
134
138
|
export interface FusebaseAuthRestoreKeyResponseContract {
|
|
135
|
-
/**
|
|
139
|
+
/**
|
|
140
|
+
* Raw restore key. Passes `checkFusebasePasswordRestoreKey` /
|
|
141
|
+
* `resetFusebasePassword`. Not bound to any URL — an app hosting its own reset
|
|
142
|
+
* page puts this key wherever it likes and reads it back from there.
|
|
143
|
+
*/
|
|
136
144
|
key: string;
|
|
137
|
-
/**
|
|
138
|
-
|
|
145
|
+
/**
|
|
146
|
+
* Reset link on the platform auth-form page,
|
|
147
|
+
* `https://app.<fusebase-host>/auth/?f=resetpass&key=<key>&parentOrigin=`.
|
|
148
|
+
* Use it when the app has no reset page of its own; it saves callers from
|
|
149
|
+
* hardcoding the per-environment host.
|
|
150
|
+
*/
|
|
151
|
+
platformResetUrl: string;
|
|
139
152
|
/** Session expiry as a Unix epoch in milliseconds. */
|
|
140
153
|
expiresAt: number;
|
|
141
154
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -12,16 +12,16 @@ export type { ActivateAppMagicLinkResponseContract, AppMagicLinkSummaryContract,
|
|
|
12
12
|
export * from "./billing/billing";
|
|
13
13
|
export type { OrgEmailSendRequestContract, OrgEmailSendResponseContract } from "./email/email";
|
|
14
14
|
export * from "./file/file";
|
|
15
|
-
export type { FusebaseAuthChallengeContract, FusebaseAuthChallengeRequestContract, FusebaseAuthChallengeResponseContract, FusebaseAuthConflictErrorBodyContract, FusebaseAuthLoginRequestContract, FusebaseAuthLoginResponseContract, FusebaseAuthLogoutResponseContract, FusebaseAuthPasswordResetRequestContract, FusebaseAuthPasswordResetResponseContract, FusebaseAuthPasswordRestoreKeyResponseContract, FusebaseAuthPasswordRestoreRequestContract, FusebaseAuthPasswordRestoreResponseContract, FusebaseAuthRegisterMemberRequestContract, FusebaseAuthRegisterMemberResponseContract, FusebaseAuthRegisterRequestContract, FusebaseAuthRegisterResponseContract, FusebaseAuthRestoreKeyRequestContract, FusebaseAuthRestoreKeyResponseContract, FusebaseAuthSessionContract } from "./fusebase-auth/fusebase-auth";
|
|
15
|
+
export type { FusebaseAuthChallengeContract, FusebaseAuthChallengeRequestContract, FusebaseAuthChallengeResponseContract, FusebaseAuthConflictErrorBodyContract, FusebaseAuthLoginRequestContract, FusebaseAuthLoginResponseContract, FusebaseAuthLogoutResponseContract, FusebaseAuthPasswordResetRequestContract, FusebaseAuthPasswordResetResponseContract, FusebaseAuthPasswordRestoreKeyResponseContract, FusebaseAuthPasswordRestoreRequestContract, FusebaseAuthPasswordRestoreResponseContract, FusebaseAuthRegisterMemberRequestContract, FusebaseAuthRegisterMemberResponseContract, FusebaseAuthRegisterRequestContract, FusebaseAuthRegisterResponseContract, FusebaseAuthRestoreKeyRequestContract, FusebaseAuthRestoreKeyResponseContract, FusebaseAuthSessionContract, FusebaseAuthUnauthorizedErrorBodyContract } from "./fusebase-auth/fusebase-auth";
|
|
16
16
|
export * from "./isolated-store/isolated-store";
|
|
17
17
|
export * from "./mcp-manager/mcp-manager";
|
|
18
18
|
export type { MeAuthContract, MeOrgGroupContract, MePreferencesContract, MeResponseContract, MeScopeContract, MeUserContract } from "./me/me";
|
|
19
19
|
export * from "./note/note";
|
|
20
20
|
export * from "./org-group/org-group";
|
|
21
|
-
export type { ClientAccountScheduledDeletionRequestContract, ClientAccountScheduledDeletionResponseContract, CreateWorkspaceRequestContract, OrgInviteContract, OrgMagicLinkContract, OrgMemberRemoveResponseContract, OrgPortalContract, OrgPortalListResponseContract, OrgUserAddRequestContract, OrgUserAddResponseContract, OrgUserContract, OrgUserIdInPathRequired, OrgUserListResponseContract, OrgUserWorkspaceIdInPathRequired, OrgWorkspaceContract, OrgWorkspaceInviteContract, OrgWorkspaceListResponseContract, OrgWorkspaceMemberContract, OrgWorkspaceMemberListResponseContract, WorkspaceMemberRemoveResponseContract } from "./org-user/org-user";
|
|
21
|
+
export type { ClientAccountScheduledDeletionRequestContract, ClientAccountScheduledDeletionResponseContract, CreateWorkspaceRequestContract, OrgInviteContract, OrgMagicLinkContract, OrgMemberExpectedJoinedAfterInQueryOptional, OrgMemberExpectedRoleInQueryOptional, OrgMemberRemoveResponseContract, OrgPortalContract, OrgPortalListResponseContract, OrgUserAddRequestContract, OrgUserAddResponseContract, OrgUserContract, OrgUserIdInPathRequired, OrgUserListResponseContract, OrgUserWorkspaceIdInPathRequired, OrgWorkspaceContract, OrgWorkspaceInviteContract, OrgWorkspaceListResponseContract, OrgWorkspaceMemberContract, OrgWorkspaceMemberListResponseContract, WorkspaceMemberRemoveResponseContract } from "./org-user/org-user";
|
|
22
22
|
export * from "./orgs/orgs";
|
|
23
23
|
export type { VerifyPortalFeatureContextTokenRequestContract, VerifyPortalFeatureContextTokenResponseContract } from "./portal-feature-context/portal-feature-context";
|
|
24
|
-
export type { AddPortalAppPageRequestContract, AddPortalAppPageResponseContract, AddPortalBlockRequestContract, AddPortalBlockResponseContract, AddPortalNoteBlockRequestContract, AddPortalNoteBlockResponseContract, BulkInviteResultItemContract, BulkInviteToPortalRequestContract, BulkInviteToPortalResponseContract, BulkPortalInvitationContract, CreatePortalFolderRequestContract, CreatePortalFolderResponseContract, CreatePortalPageWithNoteRequestContract, CreatePortalPageWithNoteResponseContract, CreatePortalRequestContract, CreatePortalResponseContract, DuplicatePortalItemRequestContract, DuplicatePortalItemResponseContract, DuplicatePortalRequestContract, InvitePortalManagerRequestContract, InvitePortalManagerResponseContract, InviteToPortalRequestContract, InviteToPortalResponseContract, ListPortalContentResponseContract, PortalContentItemContract, PortalDetailContract, PublishPortalDraftResponseContract, UpdatePortalAccessRequestContract, UpdatePortalAccessResponseContract, UpdatePortalCustomCodeRequestContract, UpdatePortalCustomCodeResponseContract, globalIdInPathRequired } from "./portals/portals";
|
|
24
|
+
export type { AddPortalAppBlockRequestContract, AddPortalAppBlockResponseContract, AddPortalAppPageRequestContract, AddPortalAppPageResponseContract, AddPortalBlankNoteBlockRequestContract, AddPortalBlankNoteBlockResponseContract, AddPortalBlockRequestContract, AddPortalBlockResponseContract, AddPortalChatBlockRequestContract, AddPortalChatBlockResponseContract, AddPortalEmbedBlockRequestContract, AddPortalEmbedBlockResponseContract, AddPortalNoteBlockRequestContract, AddPortalNoteBlockResponseContract, BulkInviteResultItemContract, BulkInviteToPortalRequestContract, BulkInviteToPortalResponseContract, BulkPortalInvitationContract, CreatePortalFolderRequestContract, CreatePortalFolderResponseContract, CreatePortalPageRequestContract, CreatePortalPageResponseContract, CreatePortalPageWithNoteRequestContract, CreatePortalPageWithNoteResponseContract, CreatePortalRequestContract, CreatePortalResponseContract, DuplicatePortalItemRequestContract, DuplicatePortalItemResponseContract, DuplicatePortalRequestContract, InvitePortalManagerRequestContract, InvitePortalManagerResponseContract, InviteToPortalRequestContract, InviteToPortalResponseContract, ListPortalChatChannelsResponseContract, ListPortalChatUsersResponseContract, ListPortalContentResponseContract, PortalChatChannelContract, PortalChatUserContract, PortalContentItemContract, PortalDetailContract, PublishPortalDraftResponseContract, UpdatePortalAccessRequestContract, UpdatePortalAccessResponseContract, UpdatePortalCustomCodeRequestContract, UpdatePortalCustomCodeResponseContract, globalIdInPathRequired } from "./portals/portals";
|
|
25
25
|
export * from "./shared/common";
|
|
26
26
|
export * from "./shared/enums";
|
|
27
27
|
export type { GetHealth200ResponseContract } from "./shared/health";
|