@fusebase/fusebase-gate-sdk 2.3.6 → 2.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apis/AppApisApi.d.ts +15 -1
- package/dist/apis/AppApisApi.js +15 -0
- package/dist/apis/PortalsApi.d.ts +99 -2
- package/dist/apis/PortalsApi.js +121 -1
- package/dist/types/app-api/app-api.d.ts +11 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/portals/portals.d.ts +225 -0
- package/package.json +1 -1
- package/release-notes/2.3.10.md +9 -0
- package/release-notes/latest.md +3 -3
- package/release-notes/2.3.6.md +0 -9
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Domain: app-apis
|
|
6
6
|
*/
|
|
7
7
|
import type { Client } from "../runtime/transport";
|
|
8
|
-
import type { AppApiOperationContract, AppApiOperationListResponseContract, CallAppApiRequestContract, CallAppApiResponseContract, orgIdInPathRequired, VerifyAppApiContractsRequestContract, VerifyAppApiContractsResponseContract } from "../types";
|
|
8
|
+
import type { AppApiOperationContract, AppApiOperationListResponseContract, CallAppApiRequestContract, CallAppApiResponseContract, orgIdInPathRequired, PublishedAppListResponseContract, VerifyAppApiContractsRequestContract, VerifyAppApiContractsResponseContract } from "../types";
|
|
9
9
|
export declare class AppApisApi {
|
|
10
10
|
private client;
|
|
11
11
|
constructor(client: Client);
|
|
@@ -22,6 +22,20 @@ export declare class AppApisApi {
|
|
|
22
22
|
headers?: Record<string, string>;
|
|
23
23
|
body?: CallAppApiRequestContract;
|
|
24
24
|
}): Promise<CallAppApiResponseContract>;
|
|
25
|
+
/**
|
|
26
|
+
* Find apps by name
|
|
27
|
+
* Resolves an app name into the productId/appId pair needed by addPortalAppPage. Returns the organization's apps, optionally filtered by a case-insensitive substring of the app or product title (name). status is 'published' when the app has a deployed version, otherwise 'draft'. When several apps match, all candidates are returned so the agent can disambiguate. Requires org.read access.
|
|
28
|
+
*/
|
|
29
|
+
findPublishedApps(params: {
|
|
30
|
+
path: {
|
|
31
|
+
orgId: orgIdInPathRequired;
|
|
32
|
+
};
|
|
33
|
+
query?: {
|
|
34
|
+
name?: string;
|
|
35
|
+
limit?: number;
|
|
36
|
+
};
|
|
37
|
+
headers?: Record<string, string>;
|
|
38
|
+
}): Promise<PublishedAppListResponseContract>;
|
|
25
39
|
/**
|
|
26
40
|
* Describe app API operation
|
|
27
41
|
* Returns one published app API operation for the requested app and operation id.
|
package/dist/apis/AppApisApi.js
CHANGED
|
@@ -26,6 +26,21 @@ class AppApisApi {
|
|
|
26
26
|
expectedContentType: "application/json",
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Find apps by name
|
|
31
|
+
* Resolves an app name into the productId/appId pair needed by addPortalAppPage. Returns the organization's apps, optionally filtered by a case-insensitive substring of the app or product title (name). status is 'published' when the app has a deployed version, otherwise 'draft'. When several apps match, all candidates are returned so the agent can disambiguate. Requires org.read access.
|
|
32
|
+
*/
|
|
33
|
+
async findPublishedApps(params) {
|
|
34
|
+
return this.client.request({
|
|
35
|
+
method: "GET",
|
|
36
|
+
path: "/:orgId/apps",
|
|
37
|
+
pathParams: params.path,
|
|
38
|
+
query: params.query,
|
|
39
|
+
headers: params.headers,
|
|
40
|
+
opId: "findPublishedApps",
|
|
41
|
+
expectedContentType: "application/json",
|
|
42
|
+
});
|
|
43
|
+
}
|
|
29
44
|
/**
|
|
30
45
|
* Describe app API operation
|
|
31
46
|
* Returns one published app API operation for the requested app and operation id.
|
|
@@ -5,13 +5,37 @@
|
|
|
5
5
|
* Domain: portals
|
|
6
6
|
*/
|
|
7
7
|
import type { Client } from "../runtime/transport";
|
|
8
|
-
import type { CreatePortalRequestContract, CreatePortalResponseContract, DuplicatePortalRequestContract, globalIdInPathRequired, InviteToPortalRequestContract, InviteToPortalResponseContract, ListPortalContentResponseContract, orgIdInPathRequired, OrgPortalListResponseContract, PortalDetailContract } from "../types";
|
|
8
|
+
import type { AddPortalAppPageRequestContract, AddPortalAppPageResponseContract, AddPortalNoteBlockRequestContract, AddPortalNoteBlockResponseContract, CreatePortalFolderRequestContract, CreatePortalFolderResponseContract, CreatePortalPageWithNoteRequestContract, CreatePortalPageWithNoteResponseContract, CreatePortalRequestContract, CreatePortalResponseContract, DuplicatePortalItemRequestContract, DuplicatePortalItemResponseContract, DuplicatePortalRequestContract, globalIdInPathRequired, InvitePortalManagerRequestContract, InvitePortalManagerResponseContract, InviteToPortalRequestContract, InviteToPortalResponseContract, ListPortalContentResponseContract, orgIdInPathRequired, OrgPortalListResponseContract, PortalDetailContract, 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 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.
|
|
15
|
+
*/
|
|
16
|
+
addPortalAppPage(params: {
|
|
17
|
+
path: {
|
|
18
|
+
orgId: orgIdInPathRequired;
|
|
19
|
+
portalId: globalIdInPathRequired;
|
|
20
|
+
};
|
|
21
|
+
headers?: Record<string, string>;
|
|
22
|
+
body: AddPortalAppPageRequestContract;
|
|
23
|
+
}): Promise<AddPortalAppPageResponseContract>;
|
|
24
|
+
/**
|
|
25
|
+
* Add an existing Fusebase note as a block to a portal page
|
|
26
|
+
* 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.
|
|
27
|
+
*/
|
|
28
|
+
addPortalNoteBlock(params: {
|
|
29
|
+
path: {
|
|
30
|
+
orgId: orgIdInPathRequired;
|
|
31
|
+
portalId: globalIdInPathRequired;
|
|
32
|
+
};
|
|
33
|
+
headers?: Record<string, string>;
|
|
34
|
+
body: AddPortalNoteBlockRequestContract;
|
|
35
|
+
}): Promise<AddPortalNoteBlockResponseContract>;
|
|
12
36
|
/**
|
|
13
37
|
* Create a new portal
|
|
14
|
-
* Creates a new portal under the given org and workspace. Returns portal details and one-time admin credentials for the portal customizer. Requires org.write and org access.
|
|
38
|
+
* Creates a new portal under the given org and workspace. Optionally pass accessMode to set the initial access mode at creation: 'open' (anyone), 'invite-only' (invited users only), 'email' (visitor enters an email, no verification), or 'email-verified' (email with confirmation); when omitted the portal keeps the template's default access. Returns portal details and one-time admin credentials for the portal customizer. Requires org.write and org access.
|
|
15
39
|
*/
|
|
16
40
|
createPortal(params: {
|
|
17
41
|
path: {
|
|
@@ -20,6 +44,30 @@ export declare class PortalsApi {
|
|
|
20
44
|
headers?: Record<string, string>;
|
|
21
45
|
body: CreatePortalRequestContract;
|
|
22
46
|
}): Promise<CreatePortalResponseContract>;
|
|
47
|
+
/**
|
|
48
|
+
* Create a root folder in a portal
|
|
49
|
+
* Creates a new empty root folder (a portalSection) in the portal's sidebar navigation. The folder is staged in the portal's customizer draft (not published immediately): the portal owner opens the customizer, reviews the pending folder, and publishes it. Returns the created folder/page ids, its url, and the draft branch/seqs. Requires portals.write access.
|
|
50
|
+
*/
|
|
51
|
+
createPortalFolder(params: {
|
|
52
|
+
path: {
|
|
53
|
+
orgId: orgIdInPathRequired;
|
|
54
|
+
portalId: globalIdInPathRequired;
|
|
55
|
+
};
|
|
56
|
+
headers?: Record<string, string>;
|
|
57
|
+
body: CreatePortalFolderRequestContract;
|
|
58
|
+
}): Promise<CreatePortalFolderResponseContract>;
|
|
59
|
+
/**
|
|
60
|
+
* Create a portal page backed by a Fusebase note
|
|
61
|
+
* 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.
|
|
62
|
+
*/
|
|
63
|
+
createPortalPageWithNote(params: {
|
|
64
|
+
path: {
|
|
65
|
+
orgId: orgIdInPathRequired;
|
|
66
|
+
portalId: globalIdInPathRequired;
|
|
67
|
+
};
|
|
68
|
+
headers?: Record<string, string>;
|
|
69
|
+
body: CreatePortalPageWithNoteRequestContract;
|
|
70
|
+
}): Promise<CreatePortalPageWithNoteResponseContract>;
|
|
23
71
|
/**
|
|
24
72
|
* Duplicate an existing portal
|
|
25
73
|
* Creates a new portal as a full copy of an existing portal: settings, theme, menu structure, pages, and content blocks are all copied. Returns portal details. Status is 'ready' immediately for P_SUB domains; 'pending' for custom/CNAME domains or if content copy is still in progress. Requires org.write access.
|
|
@@ -32,6 +80,19 @@ export declare class PortalsApi {
|
|
|
32
80
|
headers?: Record<string, string>;
|
|
33
81
|
body: DuplicatePortalRequestContract;
|
|
34
82
|
}): Promise<CreatePortalResponseContract>;
|
|
83
|
+
/**
|
|
84
|
+
* Duplicate a folder or page within a portal
|
|
85
|
+
* Duplicates a menu item (folder, note page, portal page, or link) inside the same portal. For a folder the whole subtree of copyable child items is copied, with their page content blocks. Inner Fusebase notes are deep-cloned (each gets a fresh noteId, not reused). Pass itemId (the source menu item id from listPortalContent); optionally pass name to rename the copied root and parentId to place it under a different folder (default: next to the source). Unlike the staged content ops, the copy is applied to the published portal immediately. Returns the new root item id. Requires portals.write access.
|
|
86
|
+
*/
|
|
87
|
+
duplicatePortalItem(params: {
|
|
88
|
+
path: {
|
|
89
|
+
orgId: orgIdInPathRequired;
|
|
90
|
+
portalId: globalIdInPathRequired;
|
|
91
|
+
itemId: globalIdInPathRequired;
|
|
92
|
+
};
|
|
93
|
+
headers?: Record<string, string>;
|
|
94
|
+
body: DuplicatePortalItemRequestContract;
|
|
95
|
+
}): Promise<DuplicatePortalItemResponseContract>;
|
|
35
96
|
/**
|
|
36
97
|
* Get portal details
|
|
37
98
|
* Returns detailed information for a single portal by ID. Requires portals.read access.
|
|
@@ -43,6 +104,18 @@ export declare class PortalsApi {
|
|
|
43
104
|
};
|
|
44
105
|
headers?: Record<string, string>;
|
|
45
106
|
}): Promise<PortalDetailContract>;
|
|
107
|
+
/**
|
|
108
|
+
* Invite a portal manager (customizer access)
|
|
109
|
+
* Invites a user as a PORTAL MANAGER via a magic link. A manager has access to the portal customizer and can build, edit, and publish the portal (layout, settings, widgets, custom code); they always get full access to all portal pages. This is a dedicated shortcut for inviteToPortal with orgRole='manager' — no access question is needed (managers are always full access). Returns a magic link for direct portal/customizer access without email confirmation. Requires portals.manage access.
|
|
110
|
+
*/
|
|
111
|
+
invitePortalManager(params: {
|
|
112
|
+
path: {
|
|
113
|
+
orgId: orgIdInPathRequired;
|
|
114
|
+
portalId: globalIdInPathRequired;
|
|
115
|
+
};
|
|
116
|
+
headers?: Record<string, string>;
|
|
117
|
+
body: InvitePortalManagerRequestContract;
|
|
118
|
+
}): Promise<InvitePortalManagerResponseContract>;
|
|
46
119
|
/**
|
|
47
120
|
* Invite a user to a portal
|
|
48
121
|
* Invites a user (client, member, or manager) to a portal via a magic link. For orgRole='client' (default): isFullAccess controls access to private pages (default true). For orgRole='member' or 'manager': always full access, isFullAccess is ignored. Returns a magic link for direct portal access without email confirmation. Invarian — before calling this operation for a client invite (orgRole='client' or unspecified): ALWAYS ask the user 'Full access (all pages) or Shared only (public pages)?' and wait for their answer before proceeding. Do NOT silently assume a default.
|
|
@@ -76,4 +149,28 @@ export declare class PortalsApi {
|
|
|
76
149
|
};
|
|
77
150
|
headers?: Record<string, string>;
|
|
78
151
|
}): Promise<OrgPortalListResponseContract>;
|
|
152
|
+
/**
|
|
153
|
+
* Update portal access mode
|
|
154
|
+
* Sets the portal access mode: 'open' (anyone), 'invite-only' (invited users only), 'email' (visitor enters an email, no verification), or 'email-verified' (email with confirmation). The change is staged in the portal's customizer draft (not published immediately): the portal owner opens the customizer, reviews the pending change, and publishes it. Returns the staged access mode and the draft branch/seq. Requires portals.write access.
|
|
155
|
+
*/
|
|
156
|
+
updatePortalAccess(params: {
|
|
157
|
+
path: {
|
|
158
|
+
orgId: orgIdInPathRequired;
|
|
159
|
+
portalId: globalIdInPathRequired;
|
|
160
|
+
};
|
|
161
|
+
headers?: Record<string, string>;
|
|
162
|
+
body: UpdatePortalAccessRequestContract;
|
|
163
|
+
}): Promise<UpdatePortalAccessResponseContract>;
|
|
164
|
+
/**
|
|
165
|
+
* Update portal custom CSS/JS code
|
|
166
|
+
* Sets custom code for the portal: css (custom styles), headCode (HTML/JS at the start of <head>), and bodyCode (HTML/JS at the end of <body>). Only the provided fields change; omitted fields keep their current value, and an empty string clears a field. At least one field is required. Custom code only renders on portals served from a custom CNAME domain. The change is staged in the portal's customizer draft (not published immediately): the portal owner opens the customizer, reviews the pending change, and publishes it. Returns the draft branch/seq. Requires portals.write access.
|
|
167
|
+
*/
|
|
168
|
+
updatePortalCustomCode(params: {
|
|
169
|
+
path: {
|
|
170
|
+
orgId: orgIdInPathRequired;
|
|
171
|
+
portalId: globalIdInPathRequired;
|
|
172
|
+
};
|
|
173
|
+
headers?: Record<string, string>;
|
|
174
|
+
body: UpdatePortalCustomCodeRequestContract;
|
|
175
|
+
}): Promise<UpdatePortalCustomCodeResponseContract>;
|
|
79
176
|
}
|
package/dist/apis/PortalsApi.js
CHANGED
|
@@ -11,9 +11,39 @@ class PortalsApi {
|
|
|
11
11
|
constructor(client) {
|
|
12
12
|
this.client = client;
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* 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.
|
|
17
|
+
*/
|
|
18
|
+
async addPortalAppPage(params) {
|
|
19
|
+
return this.client.request({
|
|
20
|
+
method: "POST",
|
|
21
|
+
path: "/:orgId/portals/:portalId/pages/app",
|
|
22
|
+
pathParams: params.path,
|
|
23
|
+
headers: params.headers,
|
|
24
|
+
body: params.body,
|
|
25
|
+
opId: "addPortalAppPage",
|
|
26
|
+
expectedContentType: "application/json",
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Add an existing Fusebase note as a block to a portal page
|
|
31
|
+
* 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.
|
|
32
|
+
*/
|
|
33
|
+
async addPortalNoteBlock(params) {
|
|
34
|
+
return this.client.request({
|
|
35
|
+
method: "POST",
|
|
36
|
+
path: "/:orgId/portals/:portalId/blocks/note",
|
|
37
|
+
pathParams: params.path,
|
|
38
|
+
headers: params.headers,
|
|
39
|
+
body: params.body,
|
|
40
|
+
opId: "addPortalNoteBlock",
|
|
41
|
+
expectedContentType: "application/json",
|
|
42
|
+
});
|
|
43
|
+
}
|
|
14
44
|
/**
|
|
15
45
|
* Create a new portal
|
|
16
|
-
* Creates a new portal under the given org and workspace. Returns portal details and one-time admin credentials for the portal customizer. Requires org.write and org access.
|
|
46
|
+
* Creates a new portal under the given org and workspace. Optionally pass accessMode to set the initial access mode at creation: 'open' (anyone), 'invite-only' (invited users only), 'email' (visitor enters an email, no verification), or 'email-verified' (email with confirmation); when omitted the portal keeps the template's default access. Returns portal details and one-time admin credentials for the portal customizer. Requires org.write and org access.
|
|
17
47
|
*/
|
|
18
48
|
async createPortal(params) {
|
|
19
49
|
return this.client.request({
|
|
@@ -26,6 +56,36 @@ class PortalsApi {
|
|
|
26
56
|
expectedContentType: "application/json",
|
|
27
57
|
});
|
|
28
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Create a root folder in a portal
|
|
61
|
+
* Creates a new empty root folder (a portalSection) in the portal's sidebar navigation. The folder is staged in the portal's customizer draft (not published immediately): the portal owner opens the customizer, reviews the pending folder, and publishes it. Returns the created folder/page ids, its url, and the draft branch/seqs. Requires portals.write access.
|
|
62
|
+
*/
|
|
63
|
+
async createPortalFolder(params) {
|
|
64
|
+
return this.client.request({
|
|
65
|
+
method: "POST",
|
|
66
|
+
path: "/:orgId/portals/:portalId/folders",
|
|
67
|
+
pathParams: params.path,
|
|
68
|
+
headers: params.headers,
|
|
69
|
+
body: params.body,
|
|
70
|
+
opId: "createPortalFolder",
|
|
71
|
+
expectedContentType: "application/json",
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Create a portal page backed by a Fusebase note
|
|
76
|
+
* 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.
|
|
77
|
+
*/
|
|
78
|
+
async createPortalPageWithNote(params) {
|
|
79
|
+
return this.client.request({
|
|
80
|
+
method: "POST",
|
|
81
|
+
path: "/:orgId/portals/:portalId/pages/note",
|
|
82
|
+
pathParams: params.path,
|
|
83
|
+
headers: params.headers,
|
|
84
|
+
body: params.body,
|
|
85
|
+
opId: "createPortalPageWithNote",
|
|
86
|
+
expectedContentType: "application/json",
|
|
87
|
+
});
|
|
88
|
+
}
|
|
29
89
|
/**
|
|
30
90
|
* Duplicate an existing portal
|
|
31
91
|
* Creates a new portal as a full copy of an existing portal: settings, theme, menu structure, pages, and content blocks are all copied. Returns portal details. Status is 'ready' immediately for P_SUB domains; 'pending' for custom/CNAME domains or if content copy is still in progress. Requires org.write access.
|
|
@@ -41,6 +101,21 @@ class PortalsApi {
|
|
|
41
101
|
expectedContentType: "application/json",
|
|
42
102
|
});
|
|
43
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* Duplicate a folder or page within a portal
|
|
106
|
+
* Duplicates a menu item (folder, note page, portal page, or link) inside the same portal. For a folder the whole subtree of copyable child items is copied, with their page content blocks. Inner Fusebase notes are deep-cloned (each gets a fresh noteId, not reused). Pass itemId (the source menu item id from listPortalContent); optionally pass name to rename the copied root and parentId to place it under a different folder (default: next to the source). Unlike the staged content ops, the copy is applied to the published portal immediately. Returns the new root item id. Requires portals.write access.
|
|
107
|
+
*/
|
|
108
|
+
async duplicatePortalItem(params) {
|
|
109
|
+
return this.client.request({
|
|
110
|
+
method: "POST",
|
|
111
|
+
path: "/:orgId/portals/:portalId/items/:itemId/duplicate",
|
|
112
|
+
pathParams: params.path,
|
|
113
|
+
headers: params.headers,
|
|
114
|
+
body: params.body,
|
|
115
|
+
opId: "duplicatePortalItem",
|
|
116
|
+
expectedContentType: "application/json",
|
|
117
|
+
});
|
|
118
|
+
}
|
|
44
119
|
/**
|
|
45
120
|
* Get portal details
|
|
46
121
|
* Returns detailed information for a single portal by ID. Requires portals.read access.
|
|
@@ -55,6 +130,21 @@ class PortalsApi {
|
|
|
55
130
|
expectedContentType: "application/json",
|
|
56
131
|
});
|
|
57
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* Invite a portal manager (customizer access)
|
|
135
|
+
* Invites a user as a PORTAL MANAGER via a magic link. A manager has access to the portal customizer and can build, edit, and publish the portal (layout, settings, widgets, custom code); they always get full access to all portal pages. This is a dedicated shortcut for inviteToPortal with orgRole='manager' — no access question is needed (managers are always full access). Returns a magic link for direct portal/customizer access without email confirmation. Requires portals.manage access.
|
|
136
|
+
*/
|
|
137
|
+
async invitePortalManager(params) {
|
|
138
|
+
return this.client.request({
|
|
139
|
+
method: "POST",
|
|
140
|
+
path: "/:orgId/portals/:portalId/invite-manager",
|
|
141
|
+
pathParams: params.path,
|
|
142
|
+
headers: params.headers,
|
|
143
|
+
body: params.body,
|
|
144
|
+
opId: "invitePortalManager",
|
|
145
|
+
expectedContentType: "application/json",
|
|
146
|
+
});
|
|
147
|
+
}
|
|
58
148
|
/**
|
|
59
149
|
* Invite a user to a portal
|
|
60
150
|
* Invites a user (client, member, or manager) to a portal via a magic link. For orgRole='client' (default): isFullAccess controls access to private pages (default true). For orgRole='member' or 'manager': always full access, isFullAccess is ignored. Returns a magic link for direct portal access without email confirmation. Invarian — before calling this operation for a client invite (orgRole='client' or unspecified): ALWAYS ask the user 'Full access (all pages) or Shared only (public pages)?' and wait for their answer before proceeding. Do NOT silently assume a default.
|
|
@@ -98,5 +188,35 @@ class PortalsApi {
|
|
|
98
188
|
expectedContentType: "application/json",
|
|
99
189
|
});
|
|
100
190
|
}
|
|
191
|
+
/**
|
|
192
|
+
* Update portal access mode
|
|
193
|
+
* Sets the portal access mode: 'open' (anyone), 'invite-only' (invited users only), 'email' (visitor enters an email, no verification), or 'email-verified' (email with confirmation). The change is staged in the portal's customizer draft (not published immediately): the portal owner opens the customizer, reviews the pending change, and publishes it. Returns the staged access mode and the draft branch/seq. Requires portals.write access.
|
|
194
|
+
*/
|
|
195
|
+
async updatePortalAccess(params) {
|
|
196
|
+
return this.client.request({
|
|
197
|
+
method: "POST",
|
|
198
|
+
path: "/:orgId/portals/:portalId/access",
|
|
199
|
+
pathParams: params.path,
|
|
200
|
+
headers: params.headers,
|
|
201
|
+
body: params.body,
|
|
202
|
+
opId: "updatePortalAccess",
|
|
203
|
+
expectedContentType: "application/json",
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Update portal custom CSS/JS code
|
|
208
|
+
* Sets custom code for the portal: css (custom styles), headCode (HTML/JS at the start of <head>), and bodyCode (HTML/JS at the end of <body>). Only the provided fields change; omitted fields keep their current value, and an empty string clears a field. At least one field is required. Custom code only renders on portals served from a custom CNAME domain. The change is staged in the portal's customizer draft (not published immediately): the portal owner opens the customizer, reviews the pending change, and publishes it. Returns the draft branch/seq. Requires portals.write access.
|
|
209
|
+
*/
|
|
210
|
+
async updatePortalCustomCode(params) {
|
|
211
|
+
return this.client.request({
|
|
212
|
+
method: "POST",
|
|
213
|
+
path: "/:orgId/portals/:portalId/custom-code",
|
|
214
|
+
pathParams: params.path,
|
|
215
|
+
headers: params.headers,
|
|
216
|
+
body: params.body,
|
|
217
|
+
opId: "updatePortalCustomCode",
|
|
218
|
+
expectedContentType: "application/json",
|
|
219
|
+
});
|
|
220
|
+
}
|
|
101
221
|
}
|
|
102
222
|
exports.PortalsApi = PortalsApi;
|
|
@@ -22,6 +22,17 @@ export interface AppApiOperationContract {
|
|
|
22
22
|
export interface AppApiOperationListResponseContract {
|
|
23
23
|
operations: AppApiOperationContract[];
|
|
24
24
|
}
|
|
25
|
+
export interface PublishedAppContract {
|
|
26
|
+
productId: string;
|
|
27
|
+
appId: string;
|
|
28
|
+
title: string;
|
|
29
|
+
productTitle: string;
|
|
30
|
+
status: "published" | "draft";
|
|
31
|
+
}
|
|
32
|
+
export interface PublishedAppListResponseContract {
|
|
33
|
+
apps: PublishedAppContract[];
|
|
34
|
+
total: number;
|
|
35
|
+
}
|
|
25
36
|
export interface CallAppApiRequestContract {
|
|
26
37
|
path?: Record<string, string>;
|
|
27
38
|
query?: Record<string, string | number | boolean>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Generated by SDK codegen
|
|
6
6
|
*/
|
|
7
7
|
export type { AuthenticatedUserSummaryContract, MyOrgAccessResponseContract } from "./access/access";
|
|
8
|
-
export type { AppApiOperationContract, AppApiOperationListResponseContract, CallAppApiRequestContract, CallAppApiResponseContract, VerifyAppApiContractsRequestContract, VerifyAppApiContractsResponseContract, VerifyCaseResultContract } from "./app-api/app-api";
|
|
8
|
+
export type { AppApiOperationContract, AppApiOperationListResponseContract, CallAppApiRequestContract, CallAppApiResponseContract, PublishedAppContract, PublishedAppListResponseContract, VerifyAppApiContractsRequestContract, VerifyAppApiContractsResponseContract, VerifyCaseResultContract } from "./app-api/app-api";
|
|
9
9
|
export type { AppPortalEmbedContract, ListAppPortalEmbedsResponseContract } from "./app-embed-targets/app-embed-targets";
|
|
10
10
|
export type { ActivateAppMagicLinkResponseContract, CreateAppMagicLinkRequestContract, CreateAppMagicLinkResponseContract, RequestAppMagicLinkRequestContract, RequestAppMagicLinkResponseContract } from "./app-magic-link/app-magic-link";
|
|
11
11
|
export * from "./billing/billing";
|
|
@@ -20,7 +20,7 @@ export * from "./org-group/org-group";
|
|
|
20
20
|
export type { CreateWorkspaceRequestContract, OrgInviteContract, OrgMagicLinkContract, OrgPortalContract, OrgPortalListResponseContract, OrgUserAddRequestContract, OrgUserAddResponseContract, OrgUserContract, OrgUserListResponseContract, OrgWorkspaceContract, OrgWorkspaceInviteContract, OrgWorkspaceListResponseContract, OrgWorkspaceMemberContract } from "./org-user/org-user";
|
|
21
21
|
export * from "./orgs/orgs";
|
|
22
22
|
export type { VerifyPortalFeatureContextTokenRequestContract, VerifyPortalFeatureContextTokenResponseContract } from "./portal-feature-context/portal-feature-context";
|
|
23
|
-
export type { CreatePortalRequestContract, CreatePortalResponseContract, DuplicatePortalRequestContract, InviteToPortalRequestContract, InviteToPortalResponseContract, ListPortalContentResponseContract, PortalContentItemContract, PortalDetailContract, globalIdInPathRequired } from "./portals/portals";
|
|
23
|
+
export type { AddPortalAppPageRequestContract, AddPortalAppPageResponseContract, AddPortalNoteBlockRequestContract, AddPortalNoteBlockResponseContract, CreatePortalFolderRequestContract, CreatePortalFolderResponseContract, CreatePortalPageWithNoteRequestContract, CreatePortalPageWithNoteResponseContract, CreatePortalRequestContract, CreatePortalResponseContract, DuplicatePortalItemRequestContract, DuplicatePortalItemResponseContract, DuplicatePortalRequestContract, InvitePortalManagerRequestContract, InvitePortalManagerResponseContract, InviteToPortalRequestContract, InviteToPortalResponseContract, ListPortalContentResponseContract, PortalContentItemContract, PortalDetailContract, UpdatePortalAccessRequestContract, UpdatePortalAccessResponseContract, UpdatePortalCustomCodeRequestContract, UpdatePortalCustomCodeResponseContract, globalIdInPathRequired } from "./portals/portals";
|
|
24
24
|
export * from "./shared/common";
|
|
25
25
|
export * from "./shared/enums";
|
|
26
26
|
export type { GetHealth200ResponseContract } from "./shared/health";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { WorkspaceNoteContentFormatContract } from "../note/note";
|
|
1
2
|
export type globalIdInPathRequired = string;
|
|
2
3
|
export type PortalThemeKey = "light_purple" | "soft_light" | "quite_green" | "space_gray" | "carbon" | "oxford" | "ultramarine" | "milky_blue" | "shades_of_green" | "savvy_red" | "light_orange" | "light_blue" | "lemon_drop";
|
|
3
4
|
export interface DuplicatePortalRequestContract {
|
|
@@ -11,10 +12,220 @@ export interface CreatePortalRequestContract {
|
|
|
11
12
|
name?: string;
|
|
12
13
|
/** Color theme key for the portal. When provided, applied via updateThemeSettings changeEvent. */
|
|
13
14
|
theme?: PortalThemeKey;
|
|
15
|
+
/**
|
|
16
|
+
* Initial access mode (who may open the portal). When provided, applied at
|
|
17
|
+
* creation via an updateAccessSettings changeEvent; when omitted the portal
|
|
18
|
+
* keeps the template's default access. One of: "open" (anyone), "invite-only"
|
|
19
|
+
* (invited users only), "email" (visitor enters an email, no verification),
|
|
20
|
+
* "email-verified" (email with confirmation).
|
|
21
|
+
*/
|
|
22
|
+
accessMode?: PortalAccessMode;
|
|
14
23
|
}
|
|
15
24
|
export interface CreatePortalResponseContract {
|
|
16
25
|
portal: PortalDetailContract;
|
|
17
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Portal access mode (who may open the portal):
|
|
29
|
+
* - "open": anyone can view, no email required.
|
|
30
|
+
* - "invite-only": only invited users (clients/members/managers); no public access.
|
|
31
|
+
* - "email": visitor must enter an email, no verification.
|
|
32
|
+
* - "email-verified": visitor must enter an email and confirm it.
|
|
33
|
+
*/
|
|
34
|
+
export type PortalAccessMode = "open" | "invite-only" | "email" | "email-verified";
|
|
35
|
+
export interface UpdatePortalAccessRequestContract {
|
|
36
|
+
/** Desired access mode for the portal. */
|
|
37
|
+
accessMode: PortalAccessMode;
|
|
38
|
+
}
|
|
39
|
+
export interface UpdatePortalAccessResponseContract {
|
|
40
|
+
/** The access mode that was staged. */
|
|
41
|
+
accessMode: PortalAccessMode;
|
|
42
|
+
/** Draft branch the change was staged on. */
|
|
43
|
+
branchId: string;
|
|
44
|
+
/** Sequence number assigned to the staged change event. */
|
|
45
|
+
seq: number;
|
|
46
|
+
/**
|
|
47
|
+
* Always true: the change is staged in the portal's customizer draft, not yet
|
|
48
|
+
* live. The portal owner reviews and publishes it from the customizer.
|
|
49
|
+
*/
|
|
50
|
+
staged: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface CreatePortalFolderRequestContract {
|
|
53
|
+
/** Display name of the new root folder. */
|
|
54
|
+
name: string;
|
|
55
|
+
/** Optional icon key for the folder (default: "folder"). */
|
|
56
|
+
icon?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface CreatePortalFolderResponseContract {
|
|
59
|
+
/** Id of the created folder (the portalSection menu item). */
|
|
60
|
+
folderId: string;
|
|
61
|
+
/** Id of the backing page node created for the folder. */
|
|
62
|
+
pageId: string;
|
|
63
|
+
/** URL path assigned to the folder (e.g. "/support"). */
|
|
64
|
+
url: string;
|
|
65
|
+
/** Draft branch the change was staged on. */
|
|
66
|
+
branchId: string;
|
|
67
|
+
/** Sequence numbers assigned to the staged change events (addPage, addMenuItem). */
|
|
68
|
+
seqs: number[];
|
|
69
|
+
/**
|
|
70
|
+
* Always true: the folder is staged in the portal's customizer draft, not yet
|
|
71
|
+
* live. The portal owner reviews and publishes it from the customizer.
|
|
72
|
+
*/
|
|
73
|
+
staged: boolean;
|
|
74
|
+
}
|
|
75
|
+
export interface CreatePortalPageWithNoteRequestContract {
|
|
76
|
+
/** Title for the new page (also used as the backing Fusebase note title). */
|
|
77
|
+
title: string;
|
|
78
|
+
/**
|
|
79
|
+
* Optional id of an existing menu item (e.g. a folder) to nest the page under
|
|
80
|
+
* in the sidebar. When omitted the page is created at the portal root.
|
|
81
|
+
*/
|
|
82
|
+
parentId?: string;
|
|
83
|
+
/** Optional icon key for the menu item (default: "page"). */
|
|
84
|
+
icon?: string;
|
|
85
|
+
/** Optional initial text or html appended to the note after creation. */
|
|
86
|
+
content?: string;
|
|
87
|
+
/** Content format used with `content`. Defaults to `text`. */
|
|
88
|
+
format?: WorkspaceNoteContentFormatContract;
|
|
89
|
+
}
|
|
90
|
+
export interface CreatePortalPageWithNoteResponseContract {
|
|
91
|
+
/** Global id of the created Fusebase note backing the page. */
|
|
92
|
+
noteId: string;
|
|
93
|
+
/** Id of the created note menu item (the sidebar entry). */
|
|
94
|
+
menuItemId: string;
|
|
95
|
+
/** Id of the backing portal page node created for the note. */
|
|
96
|
+
pageId: string;
|
|
97
|
+
/** URL path assigned to the page (e.g. "/welcome"). */
|
|
98
|
+
url: string;
|
|
99
|
+
/** Draft branch the change was staged on. */
|
|
100
|
+
branchId: string;
|
|
101
|
+
/** Sequence numbers assigned to the staged change events (addPage, addMenuItem, addBlock). */
|
|
102
|
+
seqs: number[];
|
|
103
|
+
/**
|
|
104
|
+
* Always true: the page is staged in the portal's customizer draft, not yet
|
|
105
|
+
* live. The portal owner reviews and publishes it from the customizer.
|
|
106
|
+
*/
|
|
107
|
+
staged: boolean;
|
|
108
|
+
}
|
|
109
|
+
export interface AddPortalNoteBlockRequestContract {
|
|
110
|
+
/** Id of the existing portal page node to add the note block to. */
|
|
111
|
+
pageId: string;
|
|
112
|
+
/** Global id of the existing Fusebase note to embed as a block. */
|
|
113
|
+
noteId: string;
|
|
114
|
+
/** Optional block title (defaults to the page's current title). */
|
|
115
|
+
title?: string;
|
|
116
|
+
}
|
|
117
|
+
export interface AddPortalNoteBlockResponseContract {
|
|
118
|
+
/** Id of the created note content block. */
|
|
119
|
+
blockId: string;
|
|
120
|
+
/** Id of the page the block was added to. */
|
|
121
|
+
pageId: string;
|
|
122
|
+
/** Draft branch the change was staged on. */
|
|
123
|
+
branchId: string;
|
|
124
|
+
/** Sequence numbers assigned to the staged change events (addBlock). */
|
|
125
|
+
seqs: number[];
|
|
126
|
+
/**
|
|
127
|
+
* Always true: the block is staged in the portal's customizer draft, not yet
|
|
128
|
+
* live. The portal owner reviews and publishes it from the customizer.
|
|
129
|
+
*/
|
|
130
|
+
staged: boolean;
|
|
131
|
+
}
|
|
132
|
+
export interface AddPortalAppPageRequestContract {
|
|
133
|
+
/**
|
|
134
|
+
* Global id of the published Fusebase product that owns the app (the product
|
|
135
|
+
* shown in the apps catalog). Persisted on the portal block as `appId`.
|
|
136
|
+
*/
|
|
137
|
+
productId: string;
|
|
138
|
+
/**
|
|
139
|
+
* Global id of the published app (feature) to embed. Persisted on the portal
|
|
140
|
+
* block as `featureId`. The app's URL is resolved by the portal at render
|
|
141
|
+
* time from these ids — nothing is hard-coded here.
|
|
142
|
+
*/
|
|
143
|
+
appId: string;
|
|
144
|
+
/** Title for the new page and its sidebar entry (default: "App"). */
|
|
145
|
+
title?: string;
|
|
146
|
+
/**
|
|
147
|
+
* Optional id of an existing menu item (e.g. a folder) to nest the page under
|
|
148
|
+
* in the sidebar. When omitted the page is created at the portal root.
|
|
149
|
+
*/
|
|
150
|
+
parentId?: string;
|
|
151
|
+
/** Optional icon key for the menu item (default: "note"). */
|
|
152
|
+
icon?: string;
|
|
153
|
+
}
|
|
154
|
+
export interface AddPortalAppPageResponseContract {
|
|
155
|
+
/** Id of the created portal page node hosting the app embed. */
|
|
156
|
+
pageId: string;
|
|
157
|
+
/** Id of the created page menu item (the sidebar entry). */
|
|
158
|
+
menuItemId: string;
|
|
159
|
+
/** Id of the created flexible block carrying the app-feature embed. */
|
|
160
|
+
blockId: string;
|
|
161
|
+
/** URL path assigned to the page (e.g. "/my-app"). */
|
|
162
|
+
url: string;
|
|
163
|
+
/** Draft branch the change was staged on. */
|
|
164
|
+
branchId: string;
|
|
165
|
+
/** Sequence numbers assigned to the staged change events (addPage, addMenuItem, addBlock). */
|
|
166
|
+
seqs: number[];
|
|
167
|
+
/**
|
|
168
|
+
* Always true: the page is staged in the portal's customizer draft, not yet
|
|
169
|
+
* live. The portal owner reviews and publishes it from the customizer.
|
|
170
|
+
*/
|
|
171
|
+
staged: boolean;
|
|
172
|
+
}
|
|
173
|
+
export interface UpdatePortalCustomCodeRequestContract {
|
|
174
|
+
/**
|
|
175
|
+
* Custom CSS applied to every published portal page (portal-service
|
|
176
|
+
* `customStyle`). Pass an empty string to clear it.
|
|
177
|
+
*/
|
|
178
|
+
css?: string;
|
|
179
|
+
/**
|
|
180
|
+
* Custom HTML/JS injected at the start of the `<head>` tag on every published
|
|
181
|
+
* portal page (portal-service `customScript`). Pass an empty string to clear it.
|
|
182
|
+
*/
|
|
183
|
+
headCode?: string;
|
|
184
|
+
/**
|
|
185
|
+
* Custom HTML/JS injected at the end of the `<body>` tag on every published
|
|
186
|
+
* portal page (portal-service `customCode`). Pass an empty string to clear it.
|
|
187
|
+
*/
|
|
188
|
+
bodyCode?: string;
|
|
189
|
+
}
|
|
190
|
+
export interface UpdatePortalCustomCodeResponseContract {
|
|
191
|
+
/** Draft branch the change was staged on. */
|
|
192
|
+
branchId: string;
|
|
193
|
+
/** Sequence number assigned to the staged change event. */
|
|
194
|
+
seq: number;
|
|
195
|
+
/**
|
|
196
|
+
* Always true: the change is staged in the portal's customizer draft, not yet
|
|
197
|
+
* live. The portal owner reviews and publishes it from the customizer.
|
|
198
|
+
*/
|
|
199
|
+
staged: boolean;
|
|
200
|
+
}
|
|
201
|
+
export interface DuplicatePortalItemRequestContract {
|
|
202
|
+
/**
|
|
203
|
+
* Id of the menu item to duplicate (a folder, note page, portal page, or link),
|
|
204
|
+
* as returned by listPortalContent. For a folder, the whole subtree of
|
|
205
|
+
* copyable child items (folders, note pages, portal pages, links) is copied.
|
|
206
|
+
*/
|
|
207
|
+
itemId: string;
|
|
208
|
+
/**
|
|
209
|
+
* Optional name for the copied root item. When omitted the copy is named
|
|
210
|
+
* "<source name> copy".
|
|
211
|
+
*/
|
|
212
|
+
name?: string;
|
|
213
|
+
/**
|
|
214
|
+
* Optional id of an existing menu item (e.g. a folder) to place the copy under.
|
|
215
|
+
* When omitted the copy is placed next to the source (same parent).
|
|
216
|
+
*/
|
|
217
|
+
parentId?: string;
|
|
218
|
+
}
|
|
219
|
+
export interface DuplicatePortalItemResponseContract {
|
|
220
|
+
/** Id of the new root menu item (the copied folder/page/link). */
|
|
221
|
+
itemId: string;
|
|
222
|
+
/**
|
|
223
|
+
* Always true: unlike the staged content ops, a duplicate is applied to the
|
|
224
|
+
* published portal immediately (portal-service /menus/copy has no draft mode
|
|
225
|
+
* and the inner notes are truly cloned).
|
|
226
|
+
*/
|
|
227
|
+
published: boolean;
|
|
228
|
+
}
|
|
18
229
|
export interface PortalDetailContract {
|
|
19
230
|
id: string;
|
|
20
231
|
orgId: string;
|
|
@@ -55,6 +266,20 @@ export interface InviteToPortalResponseContract {
|
|
|
55
266
|
/** User ID in the system. */
|
|
56
267
|
userId: number;
|
|
57
268
|
}
|
|
269
|
+
export interface InvitePortalManagerRequestContract {
|
|
270
|
+
/** Email of the user to invite as a portal manager. */
|
|
271
|
+
email: string;
|
|
272
|
+
/** Optional display name for the invitee. */
|
|
273
|
+
fullName?: string;
|
|
274
|
+
}
|
|
275
|
+
export interface InvitePortalManagerResponseContract {
|
|
276
|
+
/** Magic link for direct portal/customizer access (no email confirmation needed). */
|
|
277
|
+
magicLink: string;
|
|
278
|
+
/** Portal URL. */
|
|
279
|
+
url: string;
|
|
280
|
+
/** User ID in the system. */
|
|
281
|
+
userId: number;
|
|
282
|
+
}
|
|
58
283
|
export type PortalMenuItemType = "home" | "link" | "notesFolder" | "note" | "portalSection" | "portalProcess" | "portalPage" | "unknown" | "allPages" | "tasks" | "chat" | "folders" | "tags" | "portalFilesDashboard" | "filesManager" | "portalTasksDashboard" | "portalChatsDashboard";
|
|
59
284
|
export type PortalContentPositionType = "top" | "sidebar" | "footer";
|
|
60
285
|
export interface PortalContentItemContract {
|
package/package.json
CHANGED
package/release-notes/latest.md
CHANGED