@gitbook/api 0.0.0 → 0.2.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/client.d.ts CHANGED
@@ -1,103 +1,750 @@
1
1
  export interface Error {
2
- /** @format int32 */
3
- code: number;
4
- message: string;
2
+ error: {
3
+ code: number;
4
+ message: string;
5
+ };
6
+ }
7
+ export interface List {
8
+ next?: {
9
+ page: string;
10
+ };
11
+ /** Total count of objects in the list */
12
+ count?: number;
5
13
  }
14
+ /**
15
+ * @format uri
16
+ */
17
+ export declare type URL = string;
18
+ /**
19
+ * @format date
20
+ */
21
+ export declare type Date = string;
6
22
  export interface RequestSpaceTrackPageView {
7
- /** Unique identifier of the page */
23
+ /** Unique identifier of the page. */
8
24
  pageId: string;
9
- /** Unique identifier of the visitor */
10
- visitorId: string;
25
+ /** Analytics info on the GitBook's content visitor. */
26
+ visitor: {
27
+ anonymousId: string;
28
+ cookies: Record<string, string>;
29
+ userAgent: string;
30
+ };
31
+ /** The GitBook content's URL visited (including URL params). */
32
+ url: string;
33
+ /** The URL of referrer that linked to the page. */
34
+ referrer: string;
11
35
  }
12
36
  export interface RequestPublishIntegration {
13
- /** Base64 content of the icon */
37
+ /**
38
+ * Base64 content of the icon
39
+ * @format byte
40
+ */
14
41
  icon?: string;
15
42
  title: any;
16
43
  description: any;
17
44
  summary?: any;
45
+ previewImages?: string[];
18
46
  visibility?: IntegrationVisibility;
19
47
  scopes: any;
20
48
  categories?: any;
49
+ blocks?: any;
50
+ externalLinks?: any;
21
51
  configurations?: IntegrationConfigurations;
22
52
  /** Content of the script to use */
23
53
  script: string;
54
+ /** The subdomain of the organization under which the integration should be published */
55
+ organization?: string;
24
56
  /** Secrets stored on the integration and passed at runtime. */
25
57
  secrets?: IntegrationSecrets;
58
+ /**
59
+ * Security policy to validate the content of the integrations scripts and Contentkit. Will be sent as
60
+ * headers when processing the script fetch event and the blocks fetch events.
61
+ *
62
+ */
63
+ contentSecurityPolicy?: IntegrationContentSecurityPolicy;
26
64
  }
27
65
  export interface RequestUpdateIntegrationInstallation {
28
- status?: IntegrationInstallationStatus;
29
- configurations?: any;
66
+ externalIds?: any;
67
+ configuration?: any;
68
+ }
69
+ export interface RequestUpgradeOrganizationBilling {
70
+ /** Name of the product */
71
+ product: BillingProduct;
72
+ /** Interval for a billing subscription */
73
+ interval: BillingInterval;
74
+ /** Reason that triggered the billing upgrade */
75
+ reason?: string;
76
+ /**
77
+ * Mode to use for the upgrade (default value is `commit`): - `auto`: user is redirect to checkout if possible, other a preview of the auto-upgrade is returned. - `commit`: a checkout session is returned or an auto-upgrade is done - `preview`: a preview invoice is always returned
78
+ *
79
+ */
80
+ mode?: 'auto' | 'commit' | 'preview';
81
+ }
82
+ export interface RequestInviteUsersToOrganization {
83
+ emails: (string | {
84
+ email: string;
85
+ role: MemberRoleOrGuest;
86
+ })[];
87
+ /** Default role to set on newly invited members. */
88
+ role?: MemberRoleOrGuest;
89
+ /** If true, invites the user as an SSO user of the organization. Defaults to false. */
90
+ sso?: boolean;
91
+ }
92
+ export interface RequestImportGitRepository {
93
+ /** URL of the Git repository to import. It can contain basic auth credentials. */
94
+ url: string;
95
+ /** Git ref to import in the format "refs/heads/main" */
96
+ ref: string;
97
+ /** Unique identifier to use to cache the Git repository across multiple operations. */
98
+ repoCacheID?: string;
99
+ /** URL to use as a prefix for external file references. */
100
+ repoTreeURL?: string;
101
+ /** URL to use as a prefix for the commit URL. */
102
+ repoCommitURL?: string;
103
+ /** Path to a root directory for the project in the repository. */
104
+ repoProjectDirectory?: string;
105
+ force?: boolean;
106
+ /** If true, the import will generate a revision without updating the space primary content. */
107
+ standalone?: boolean;
108
+ }
109
+ export interface RequestExportToGitRepository {
110
+ /** URL of the Git repository to export to. It can contain basic auth credentials. */
111
+ url: string;
112
+ /** Git ref to push the commit to in the format "refs/heads/main" */
113
+ ref: string;
114
+ /** Message for the commit generated by the export */
115
+ commitMessage: string;
116
+ /** Unique identifier to use to cache the Git repository across multiple operations. */
117
+ repoCacheID?: string;
118
+ /** URL to use as a prefix for external file references. */
119
+ repoTreeURL?: string;
120
+ /** URL to use as a prefix for the commit URL. */
121
+ repoCommitURL?: string;
122
+ /** Path to a root directory for the project in the repository. */
123
+ repoProjectDirectory?: string;
124
+ force?: boolean;
125
+ }
126
+ export interface RequestImportContent {
127
+ /** URL of the content to import. */
128
+ url: string;
129
+ source: ImportContentSource;
130
+ }
131
+ export interface RequestCreateChangeRequest {
132
+ /** Subject of the change-request */
133
+ subject?: string;
134
+ }
135
+ export interface RequestRenderIntegrationUI {
136
+ /** ID of the component to render in the integration. */
137
+ componentId: string;
138
+ /** ID of the space to render. */
139
+ spaceId: string;
140
+ /** Current properties of the UI. */
141
+ props: object;
142
+ /** Current local state of the UI. */
143
+ state?: object;
144
+ context: ContentKitContext;
145
+ /** Custom action to re-render the block. */
146
+ action?: ContentKitAction;
147
+ }
148
+ export interface ApiInformation {
149
+ /** Current release of GitBook */
150
+ version: string;
151
+ /** Date of the latest release in ISO format */
152
+ build: string;
153
+ }
154
+ /**
155
+ * The context to send when purging the CDN Cache
156
+ */
157
+ export interface RequestPurgeCDNCacheContext {
158
+ /** The type of purge, e.g by tags or hosts */
159
+ type: PurgeCDNCacheContextType;
160
+ /** The list of tags or hosts to purge */
161
+ values: string[];
162
+ }
163
+ /**
164
+ * The context to send when blocking/unblocking a user
165
+ */
166
+ export interface RequestBlockUserContext {
167
+ block: boolean;
168
+ }
169
+ /**
170
+ * The context to send when triggering a content indexing.
171
+ */
172
+ export interface TriggerContentIndexingContext {
173
+ /** The unique identifier of the Space to index. */
174
+ spaceId: string;
175
+ /** Whether to force a complete re-indexing of the Space. */
176
+ force: boolean;
30
177
  }
31
178
  export interface User {
179
+ /** Type of Object, always equals to "user" */
180
+ object: 'user';
181
+ /** Unique identifier for the user */
32
182
  id: string;
183
+ /** Full name for the user */
33
184
  displayName: string;
185
+ /** Email address of the user */
34
186
  email?: string;
187
+ /** URL of the user's profile picture */
188
+ photoURL?: string;
189
+ }
190
+ export interface UserTarget {
191
+ user?: string;
192
+ }
193
+ /**
194
+ * * `public`: Anyone can access the content, and the content is indexed by search engines.
195
+ * `unlisted`: Anyone can access the content, and the content is not indexed by search engines
196
+ * `share-link`: Anyone with a secret token in the url can access the content.
197
+ * `visitor-auth`: Anyone authenticated through a JWT token can access the content.
198
+ * `in-collection`: Anyone who can access the parent collection can access the content.
199
+ Only available for spaces in a collection.
200
+ * `private`: Authorized members can access the content.
201
+ */
202
+ export declare enum ContentVisibility {
203
+ Public = "public",
204
+ Unlisted = "unlisted",
205
+ ShareLink = "share-link",
206
+ VisitorAuth = "visitor-auth",
207
+ InCollection = "in-collection",
208
+ Private = "private"
209
+ }
210
+ export interface ImportContentResult {
211
+ /** ID of the newly created revision. */
212
+ revision: string;
213
+ /** How many resources were imported */
214
+ importedResources: number;
215
+ /** How many resources were processed */
216
+ totalResources: number;
35
217
  }
36
218
  export interface Space {
219
+ /** Type of Object, always equals to "space" */
220
+ object: 'space';
37
221
  /** Unique identifier for the space */
38
222
  id: string;
39
223
  /** Title of the space */
40
224
  title: string;
225
+ /**
226
+ * * `public`: Anyone can access the content, and the content is indexed by search engines.
227
+ * * `unlisted`: Anyone can access the content, and the content is not indexed by search engines
228
+ * * `share-link`: Anyone with a secret token in the url can access the content.
229
+ * * `visitor-auth`: Anyone authenticated through a JWT token can access the content.
230
+ * * `in-collection`: Anyone who can access the parent collection can access the content.
231
+ * Only available for spaces in a collection.
232
+ * * `private`: Authorized members can access the content.
233
+ *
234
+ */
235
+ visibility: ContentVisibility;
236
+ createdAt: Date;
237
+ updatedAt: Date;
238
+ /** URLs associated with the object */
239
+ urls: {
240
+ app: string;
241
+ published?: string;
242
+ public?: string;
243
+ };
244
+ }
245
+ export interface Revision {
246
+ /** Type of Object, always equals to "revision" */
247
+ object: 'revision';
248
+ /** Unique identifier for the revision */
249
+ id: string;
250
+ /** IDs of the parent revisions */
251
+ parents: string[];
252
+ pages: RevisionPage[];
253
+ files: RevisionFile[];
254
+ /** Metadata about a potential associated git commit. */
255
+ git?: {
256
+ oid: string;
257
+ message: string;
258
+ createdByGitBook: boolean;
259
+ url?: string;
260
+ };
261
+ urls: {
262
+ app: string;
263
+ published?: string;
264
+ public?: string;
265
+ };
266
+ }
267
+ export declare type RevisionPage = RevisionPageSheet | RevisionPageGroup | RevisionPageLink;
268
+ export interface RevisionPageBase {
269
+ /** Unique identifier for the page in the revision */
270
+ id: string;
271
+ /** Title of the page */
272
+ title: string;
273
+ }
274
+ export declare type RevisionPageSheet = RevisionPageBase & {
275
+ kind: 'sheet';
276
+ slug: string;
277
+ path: string;
278
+ description?: string;
279
+ pages: (RevisionPageSheet | RevisionPageLink)[];
280
+ } & ({
281
+ markdown: string;
282
+ } | {
283
+ document: PageDocument;
284
+ } | object);
285
+ export declare type RevisionPageGroup = RevisionPageBase & {
286
+ kind: 'group';
287
+ slug: string;
288
+ path: string;
289
+ pages: (RevisionPageSheet | RevisionPageLink)[];
290
+ };
291
+ export declare type RevisionPageLink = RevisionPageBase & {
292
+ kind: 'link';
293
+ href?: string;
294
+ };
295
+ export interface RevisionFile {
296
+ id: string;
297
+ name: string;
298
+ contentType: string;
299
+ downloadURL: string;
300
+ }
301
+ export interface PageDocument {
302
+ nodes: object[];
303
+ }
304
+ export declare enum ImportContentSource {
305
+ Website = "website",
306
+ Docx = "docx",
307
+ Markdown = "markdown",
308
+ Html = "html",
309
+ Zip = "zip",
310
+ Confluence = "confluence",
311
+ GithubWiki = "github-wiki",
312
+ DropboxPaper = "dropbox-paper",
313
+ Notion = "notion",
314
+ Quip = "quip",
315
+ GoogleDocs = "google-docs",
316
+ OpenApi = "open-api"
317
+ }
318
+ export interface Organization {
319
+ /** Type of Object, always equals to "organization" */
320
+ object: 'organization';
321
+ /** Unique identifier for the organization */
322
+ id: string;
323
+ /** Name of the organization */
324
+ title: string;
325
+ }
326
+ /**
327
+ * "The role of a member in an organization.
328
+ "admin": Can administrate the content: create, delete spaces, ...
329
+ "create": Can create content.
330
+ "review": Can review content.
331
+ "edit": Can edit the content (live or change requests).
332
+ "comment": Can access the content and its discussions.
333
+ "read": Can access the content, but cannot update it in any way.
334
+ */
335
+ export declare enum MemberRole {
336
+ Admin = "admin",
337
+ Create = "create",
338
+ Edit = "edit",
339
+ Review = "review",
340
+ Comment = "comment",
341
+ Read = "read"
342
+ }
343
+ /**
344
+ * The role of a member in an organization, null for guests
345
+ */
346
+ export declare type MemberRoleOrGuest = MemberRole | null;
347
+ export interface OrganizationTransferResponse {
348
+ /** The unique id of the collection created in the target organization containing the content of the source organization. */
349
+ collection: string;
350
+ /** The new hostname if the source organization needed to change hostname. */
351
+ newSourceHostname?: string;
352
+ }
353
+ export interface OrganizationDirectorySyncGroup {
354
+ /** The unique identifier of this group in WorkOS. Not the unique ID from GitBook. */
355
+ id: string;
356
+ /** The identity provider's unique ID for this group, should be used to generate the team's unique ID when syncing the groups. */
357
+ idp_id: string;
358
+ /** The unique ID of the directory this group is owned by in WorkOS. Is not a unique ID from our database. */
359
+ directory_id: string;
360
+ /** The name of the group from the identity provider, it should always be set according to the WorkOS documentation. */
361
+ name: string;
362
+ /** The unique ID of the GitBook team already synced to this group, if applicable. */
363
+ teamKey?: string;
364
+ }
365
+ export declare type OrganizationDirectorySyncGroupTeamStatus = {
366
+ success: true;
367
+ group_id: string;
368
+ team_id: string;
369
+ } | {
370
+ success: false;
371
+ error: string;
372
+ } | ({
373
+ success: true;
374
+ group_id: string;
375
+ team_id: string;
376
+ } & {
377
+ success: false;
378
+ error: string;
379
+ });
380
+ export interface OrganizationTarget {
381
+ organization?: string;
382
+ }
383
+ export interface OrganizationMember {
384
+ /** Type of Object, always equals to "member" */
385
+ object: 'member';
386
+ /** Unique identifier for the user. */
387
+ id: string;
388
+ /** The role of a member in an organization, null for guests */
389
+ role: MemberRoleOrGuest;
390
+ user: User;
391
+ /** Whatever the membership of this user is disabled and prevent them from accessing content. */
392
+ disabled: boolean;
393
+ /** Date at which the user joined the organization. */
394
+ joinedAt: Date;
395
+ }
396
+ export interface OrganizationTeam {
397
+ /** Type of Object, always equals to "team" */
398
+ object: 'team';
399
+ /** Unique identifier for the team. */
400
+ id: string;
401
+ /** Title of the team. */
402
+ title: string;
403
+ /** Count of members in this team. */
404
+ members: number;
405
+ /** Date at which the team was created. */
406
+ createdAt: Date;
407
+ }
408
+ export interface ChangeRequest {
409
+ /** Type of Object, always equals to "change-request" */
410
+ object: 'change-request';
411
+ /** Unique identifier for the change request */
412
+ id: string;
413
+ /** Incremental identifier of the change request */
414
+ number: number;
415
+ status: ChangeRequestStatus;
416
+ /** Subject of the change request */
417
+ subject: string;
418
+ createdBy: User;
419
+ createdAt: Date;
420
+ updatedAt: Date;
421
+ /** URLs associated with the object */
422
+ urls: {
423
+ app: string;
424
+ };
425
+ }
426
+ export declare enum ChangeRequestStatus {
427
+ Draft = "draft",
428
+ Open = "open",
429
+ Archived = "archived",
430
+ Merged = "merged"
431
+ }
432
+ /**
433
+ * Permission of a user in a content.
434
+ */
435
+ export interface UserContentPermission {
436
+ /**
437
+ * "The role of a member in an organization.
438
+ * "admin": Can administrate the content: create, delete spaces, ...
439
+ * "create": Can create content.
440
+ * "review": Can review content.
441
+ * "edit": Can edit the content (live or change requests).
442
+ * "comment": Can access the content and its discussions.
443
+ * "read": Can access the content, but cannot update it in any way.
444
+ *
445
+ */
446
+ permission: MemberRole;
447
+ user: User;
448
+ }
449
+ /**
450
+ * Permission of a member in a content.
451
+ */
452
+ export interface MemberContentPermission {
453
+ /**
454
+ * "The role of a member in an organization.
455
+ * "admin": Can administrate the content: create, delete spaces, ...
456
+ * "create": Can create content.
457
+ * "review": Can review content.
458
+ * "edit": Can edit the content (live or change requests).
459
+ * "comment": Can access the content and its discussions.
460
+ * "read": Can access the content, but cannot update it in any way.
461
+ *
462
+ */
463
+ permission: MemberRole;
464
+ space: Space;
465
+ }
466
+ /**
467
+ * Search result representing a space.
468
+ */
469
+ export interface SearchSpaceResult {
470
+ id: string;
471
+ title: string;
472
+ pages: SearchPageResult[];
473
+ }
474
+ /**
475
+ * Search result representing a page in a space.
476
+ */
477
+ export interface SearchPageResult {
478
+ id: string;
479
+ title: string;
480
+ path: string;
481
+ sections?: SearchSectionResult[];
482
+ /** URLs associated with the object */
483
+ urls: {
484
+ app: string;
485
+ };
486
+ }
487
+ /**
488
+ * Search result representing a section in a page.
489
+ */
490
+ export interface SearchSectionResult {
491
+ id: string;
492
+ title: string;
493
+ path: string;
494
+ body: string;
495
+ /** URLs associated with the object */
496
+ urls: {
497
+ app: string;
498
+ };
499
+ }
500
+ /**
501
+ * Answer from AI for a question asked on a content.
502
+ */
503
+ export interface SearchAIAnswer {
504
+ text: string;
505
+ pages: {
506
+ page: string;
507
+ revision: string;
508
+ space: string;
509
+ sections: string[];
510
+ }[];
511
+ }
512
+ export declare enum AnalyticsSearchPeriod {
513
+ LastMonth = "last_month",
514
+ LastWeek = "last_week",
515
+ LastYear = "last_year"
516
+ }
517
+ /**
518
+ * Analytics entry for a search query.
519
+ */
520
+ export interface AnalyticsSearchQuery {
521
+ query: string;
522
+ /** Number of searches done by users. */
523
+ searches: number;
524
+ /** Number of objects matching this search. */
525
+ hits: number;
526
+ /** Number of pages matching this search. */
527
+ pageHits: number;
528
+ /** Number of sections matching this search. */
529
+ sectionHits: number;
530
+ }
531
+ /**
532
+ * Top search queries for a content.
533
+ */
534
+ export interface AnalyticsTopSearches {
535
+ /** Number of searches done by users. */
536
+ searches: number;
537
+ /** Top queries searched for this content. */
538
+ queries: AnalyticsSearchQuery[];
539
+ }
540
+ export declare enum AnalyticsTrafficInterval {
541
+ Daily = "daily",
542
+ Weekly = "weekly",
543
+ Monthly = "monthly"
544
+ }
545
+ export interface AnalyticsTrafficPageViews {
546
+ /** Total number of page views over the period. */
547
+ count: number;
548
+ /** Page views per interval (day, week, month). */
549
+ views: {
550
+ timestamp: string;
551
+ count: number;
552
+ }[];
553
+ }
554
+ export interface AnalyticsContentPages {
555
+ pages: AnalyticsContentPage[];
556
+ }
557
+ /**
558
+ * Page entry in the content analytics.
559
+ */
560
+ export interface AnalyticsContentPage {
561
+ page: string;
562
+ title: string;
563
+ pageViews: number;
564
+ feedbacks?: {
565
+ score: number;
566
+ total: number;
567
+ rating: 'unknown' | 'bad' | 'ok' | 'good';
568
+ bad: number;
569
+ ok: number;
570
+ good: number;
571
+ };
572
+ }
573
+ export interface Collection {
574
+ /** Type of Object, always equals to "collection" */
575
+ object: 'collection';
576
+ /** Unique identifier for the collection */
577
+ id: string;
578
+ /** Title of the collection */
579
+ title: string;
580
+ /** Path in the published URL */
581
+ path?: string;
582
+ /**
583
+ * * `public`: Anyone can access the content, and the content is indexed by search engines.
584
+ * * `unlisted`: Anyone can access the content, and the content is not indexed by search engines
585
+ * * `share-link`: Anyone with a secret token in the url can access the content.
586
+ * * `visitor-auth`: Anyone authenticated through a JWT token can access the content.
587
+ * * `in-collection`: Anyone who can access the parent collection can access the content.
588
+ * Only available for spaces in a collection.
589
+ * * `private`: Authorized members can access the content.
590
+ *
591
+ */
592
+ visibility: ContentVisibility;
593
+ publishingType?: 'variants';
594
+ /** ID of the primary space for this collection */
595
+ primarySpace?: string;
596
+ /** ID of the parent collection, if any */
597
+ collection?: string;
41
598
  }
42
599
  export interface Integration {
600
+ object: 'integration';
43
601
  /** Unique named identifier for the integration */
44
602
  name: string;
45
603
  /** Title of the integration */
46
604
  title: string;
47
- /** Title of the integration */
605
+ /** Description of the integration */
48
606
  description?: string;
49
607
  /** Long form markdown summary of the integration */
50
608
  summary?: string;
51
- /** Content of the script to run. */
52
- script: string;
609
+ /** URLs of images to showcase the integration */
610
+ previewImages: string[];
53
611
  visibility: IntegrationVisibility;
54
612
  /** Permissions that should be granted to the integration */
55
613
  scopes: IntegrationScope[];
56
614
  /** Categories for which the integration is listed in the marketplace */
57
615
  categories: IntegrationCategory[];
616
+ /** Custom blocks defined by this integration. */
617
+ blocks?: IntegrationBlock[];
58
618
  configurations?: IntegrationConfigurations;
619
+ /** External urls configured by the developer of the integration */
620
+ externalLinks: {
621
+ url: URL;
622
+ label: string;
623
+ }[];
624
+ /** URLs associated with the object */
625
+ urls: {
626
+ icon?: string;
627
+ app: string;
628
+ assets: string;
629
+ publicEndpoint: string;
630
+ };
631
+ /**
632
+ * Security policy to validate the content of the integrations scripts and Contentkit. Will be sent as
633
+ * headers when processing the script fetch event and the blocks fetch events.
634
+ *
635
+ */
636
+ contentSecurityPolicy?: IntegrationContentSecurityPolicy;
59
637
  }
60
638
  export declare enum IntegrationScope {
61
- SpaceViews = "space:views",
62
- SpaceContent = "space:content"
639
+ SpaceViewsRead = "space:views:read",
640
+ SpaceContentRead = "space:content:read",
641
+ SpaceContentWrite = "space:content:write",
642
+ SpaceMetadataRead = "space:metadata:read",
643
+ SpaceMetadataWrite = "space:metadata:write",
644
+ SpaceScriptInject = "space:script:inject",
645
+ SpaceScriptCookies = "space:script:cookies"
646
+ }
647
+ /**
648
+ * Format the custom block as a codeblock
649
+ */
650
+ export declare type IntegrationBlockMarkdown = {
651
+ codeblock: string;
652
+ body: string;
653
+ };
654
+ export interface IntegrationBlock {
655
+ /** Unique ID in the integration for the block. It also represents the UI component used. */
656
+ id: string;
657
+ /** Short descriptive title for the block. */
658
+ title: string;
659
+ /** Long descriptive text for the block. */
660
+ description?: string;
661
+ /** URL of the icon to represent this block. */
662
+ icon?: string;
663
+ /** URLs patterns to convert as this block. */
664
+ urlUnfurl?: string[];
665
+ /** Format the custom block as a codeblock */
666
+ markdown?: IntegrationBlockMarkdown;
667
+ }
668
+ /**
669
+ * Describe whether all spaces have been selected or there's a selection involved
670
+ */
671
+ export declare enum IntegrationInstallationSpaceSelection {
672
+ All = "all",
673
+ Selected = "selected"
63
674
  }
64
675
  export declare enum IntegrationCategory {
65
676
  Analytics = "analytics",
66
677
  Collaboration = "collaboration",
678
+ Marketing = "marketing",
679
+ Content = "content",
67
680
  Other = "other"
68
681
  }
69
682
  export interface IntegrationConfigurations {
683
+ /** Schema for a configuration */
684
+ account?: IntegrationConfiguration;
685
+ /** Schema for a configuration */
70
686
  space?: IntegrationConfiguration;
71
687
  }
688
+ /**
689
+ * Schema for a configuration
690
+ */
72
691
  export interface IntegrationConfiguration {
73
692
  properties: Record<string, {
74
- type?: string;
75
693
  title?: string;
76
694
  description?: string;
77
695
  } & ({
78
- type?: "string";
696
+ type: 'string';
79
697
  default?: string;
80
698
  } | {
81
- type?: "number";
699
+ type: 'number';
82
700
  default?: number;
83
701
  } | {
84
- type?: "boolean";
702
+ type: 'boolean';
85
703
  default?: boolean;
86
704
  } | {
87
- type?: "button";
705
+ type: 'button';
88
706
  callback_url: string;
89
707
  button_text: string;
90
708
  })>;
709
+ required?: string[];
91
710
  }
92
711
  export declare enum IntegrationVisibility {
93
712
  Public = "public",
94
713
  Private = "private"
95
714
  }
715
+ /**
716
+ * Installation of an integration on an account
717
+ */
96
718
  export interface IntegrationInstallation {
97
719
  id: string;
98
720
  status: IntegrationInstallationStatus;
99
- configurations?: {
100
- space?: object;
721
+ /** Describe whether all spaces have been selected or there's a selection involved */
722
+ space_selection: IntegrationInstallationSpaceSelection;
723
+ /** Configuration of the integration at the account level */
724
+ configuration: object;
725
+ /** URLs associated with the object */
726
+ urls: {
727
+ app: string;
728
+ publicEndpoint: string;
729
+ };
730
+ /** External IDs assigned by the integration. */
731
+ externalIds: string[];
732
+ /** Target of the integration installation */
733
+ target: IntegrationInstallationTarget;
734
+ }
735
+ /**
736
+ * Installation of an integration at a space level
737
+ */
738
+ export interface IntegrationSpaceInstallation {
739
+ /** ID of the space the integration is installed on. */
740
+ space: string;
741
+ status: IntegrationInstallationStatus;
742
+ /** Configuration of the integration for this space */
743
+ configuration: object;
744
+ externalIds: any;
745
+ /** URLs associated with the object */
746
+ urls: {
747
+ publicEndpoint: string;
101
748
  };
102
749
  }
103
750
  export declare enum IntegrationInstallationStatus {
@@ -116,16 +763,57 @@ export interface IntegrationEnvironment {
116
763
  /** URL of the HTTP API */
117
764
  apiEndpoint: string;
118
765
  /** Authentication token to use with the HTTP API */
119
- authToken: string;
766
+ authToken?: string;
120
767
  integration: Integration;
121
- installation: IntegrationInstallation;
768
+ /** Installation of an integration on an account */
769
+ installation?: IntegrationInstallation;
770
+ /** Installation of an integration at a space level */
771
+ spaceInstallation?: IntegrationSpaceInstallation;
122
772
  /** Secrets stored on the integration and passed at runtime. */
123
773
  secrets: IntegrationSecrets;
124
774
  }
775
+ export declare type IntegrationInstallationTarget = UserTarget | OrganizationTarget;
776
+ /**
777
+ * Security policy to validate the content of the integrations scripts and Contentkit. Will be sent as
778
+ headers when processing the script fetch event and the blocks fetch events.
779
+ */
780
+ export declare type IntegrationContentSecurityPolicy = string | {
781
+ 'base-uri'?: string;
782
+ 'block-all-mixed-content'?: string;
783
+ 'child-src'?: string;
784
+ 'connect-src'?: string;
785
+ 'default-src'?: string;
786
+ 'font-src'?: string;
787
+ 'form-action'?: string;
788
+ 'frame-ancestors'?: string;
789
+ 'frame-src'?: string;
790
+ 'img-src'?: string;
791
+ 'manifest-src'?: string;
792
+ 'media-src'?: string;
793
+ 'navigate-to'?: string;
794
+ 'object-src'?: string;
795
+ 'plugin-types'?: string;
796
+ 'prefetch-src'?: string;
797
+ referrer?: string;
798
+ 'report-to'?: string;
799
+ 'report-uri'?: string;
800
+ 'require-sri-for'?: string;
801
+ 'require-trusted-types-for'?: string;
802
+ sandbox?: string;
803
+ 'script-src'?: string;
804
+ 'script-src-attr'?: string;
805
+ 'script-src-elem'?: string;
806
+ 'style-src'?: string;
807
+ 'style-src-attr'?: string;
808
+ 'style-src-elem'?: string;
809
+ 'trusted-types'?: string;
810
+ 'upgrade-insecure-requests'?: string;
811
+ 'worker-src'?: string;
812
+ };
125
813
  /**
126
814
  * Any event that can be received from GitBook.
127
815
  */
128
- export declare type Event = InstallationSetupEvent | SpaceViewEvent | SpaceContentUpdatedEvent | FetchEvent;
816
+ export declare type Event = InstallationSetupEvent | SpaceInstallationSetupEvent | SpaceViewEvent | SpaceContentUpdatedEvent | SpaceGitSyncCompletedEvent | SpaceGitSyncStartedEvent | SpaceVisibilityUpdatedEvent | FetchEvent | FetchPublishedScriptEvent | UIRenderEvent;
129
817
  /**
130
818
  * Common properties for all events.
131
819
  */
@@ -148,172 +836,1686 @@ export declare type SpaceEvent = InstallationEvent & {
148
836
  spaceId: string;
149
837
  };
150
838
  /**
151
- * Event received when integration has been installed.
839
+ * Event received when integration has been installed or updated.
840
+ */
841
+ export declare type InstallationSetupEvent = InstallationEvent & {
842
+ type: 'installation_setup';
843
+ status: IntegrationInstallationStatus;
844
+ previous?: {
845
+ status: IntegrationInstallationStatus;
846
+ configuration?: object;
847
+ };
848
+ };
849
+ /**
850
+ * Event received when integration has been installed or updated on a space.
152
851
  */
153
- export declare type InstallationSetupEvent = SpaceEvent & {
154
- type: "installation:setup";
852
+ export declare type SpaceInstallationSetupEvent = SpaceEvent & {
853
+ type: 'space_installation_setup';
155
854
  status: IntegrationInstallationStatus;
855
+ previous?: {
856
+ status: IntegrationInstallationStatus;
857
+ configuration?: object;
858
+ };
156
859
  };
157
860
  /**
158
861
  * Event received when a page has been visited.
159
862
  */
160
863
  export declare type SpaceViewEvent = SpaceEvent & {
161
- type: "space:view";
864
+ type: 'space_view';
162
865
  pageId?: string;
163
- visitorId: string;
164
- visitorIp: string;
165
- visitorUserAgent: string;
866
+ visitor: {
867
+ anonymousId: string;
868
+ cookies: Record<string, string>;
869
+ userAgent: string;
870
+ ip: string;
871
+ };
872
+ url: string;
873
+ referrer: string;
166
874
  };
167
875
  /**
168
876
  * Event when the primary content of a space has been updated.
169
877
  */
170
878
  export declare type SpaceContentUpdatedEvent = SpaceEvent & {
171
- type: "space:content:updated";
879
+ type: 'space_content_updated';
880
+ revisionId: string;
881
+ };
882
+ /**
883
+ * Event when the visibility of the space has been changed.
884
+ */
885
+ export declare type SpaceVisibilityUpdatedEvent = SpaceEvent & {
886
+ type: 'space_visibility_updated';
887
+ previousVisibility: ContentVisibility;
888
+ visibility: ContentVisibility;
889
+ };
890
+ /**
891
+ * Event when a GitSync operation has been completed.
892
+ */
893
+ export declare type SpaceGitSyncCompletedEvent = SpaceEvent & {
894
+ type: 'space_gitsync_completed';
895
+ state: 'success' | 'failure';
896
+ revisionId: string;
897
+ commitId: string;
898
+ };
899
+ /**
900
+ * Event when a GitSync operation has been started.
901
+ */
902
+ export declare type SpaceGitSyncStartedEvent = SpaceEvent & {
903
+ type: 'space_gitsync_started';
172
904
  revisionId: string;
905
+ commitId: string;
173
906
  };
174
907
  export interface FetchRequest {
175
- method: "post" | "get" | "put" | "delete";
908
+ method: 'post' | 'get' | 'put' | 'delete';
176
909
  url: string;
177
- body?: string;
178
- headers: Record<string, string>;
179
- }
180
- export interface FetchResponse {
181
- status: number;
182
- body: string;
183
910
  headers: Record<string, string>;
184
911
  }
185
912
  /**
186
913
  * Event representing an incoming HTTP request.
187
914
  */
188
- export declare type FetchEvent = InstallationEvent & {
189
- type: "fetch";
915
+ export declare type FetchEvent = BaseEvent & {
916
+ spaceId?: string;
917
+ installationId?: string;
918
+ auth?: {
919
+ userId: string;
920
+ };
921
+ type: 'fetch';
190
922
  request: FetchRequest;
191
923
  };
192
- export declare type QueryParamsType = Record<string | number, any>;
193
- export declare type ResponseFormat = keyof Omit<Body, "body" | "bodyUsed">;
194
- export interface FullRequestParams extends Omit<RequestInit, "body"> {
195
- /** set parameter to `true` for call `securityWorker` for this request */
196
- secure?: boolean;
197
- /** request path */
198
- path: string;
199
- /** content type of request body */
200
- type?: ContentType;
201
- /** query params */
202
- query?: QueryParamsType;
203
- /** format of response (i.e. response.json() -> format: "json") */
204
- format?: ResponseFormat;
205
- /** request body */
206
- body?: unknown;
207
- /** base url */
208
- baseUrl?: string;
209
- /** request cancellation token */
210
- cancelToken?: CancelToken;
924
+ /**
925
+ * Common properties for all events related to fetching a published script from an installation
926
+ */
927
+ export declare type FetchPublishedScriptEvent = SpaceEvent & {
928
+ type: 'fetch_published_script';
929
+ };
930
+ /**
931
+ * Event generated when rendering a UI
932
+ */
933
+ export declare type UIRenderEvent = SpaceEvent & {
934
+ auth?: {
935
+ userId: string;
936
+ };
937
+ type: 'ui_render';
938
+ componentId: string;
939
+ props: object;
940
+ state?: object;
941
+ context: ContentKitContext;
942
+ action?: object;
943
+ };
944
+ /**
945
+ * Interval for a billing subscription
946
+ */
947
+ export declare enum BillingInterval {
948
+ Monthly = "monthly",
949
+ Yearly = "yearly"
211
950
  }
212
- export declare type RequestParams = Omit<FullRequestParams, "body" | "method" | "query" | "path">;
213
- export interface ApiConfig<SecurityDataType = unknown> {
214
- baseUrl?: string;
215
- baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">;
216
- securityWorker?: (securityData: SecurityDataType | null) => Promise<RequestParams | void> | RequestParams | void;
217
- customFetch?: typeof fetch;
951
+ export interface BillingPortal {
952
+ /** URL to the billing portal for an organization */
953
+ url: string;
218
954
  }
219
- export interface HttpResponse<D extends unknown, E extends unknown = unknown> extends Response {
220
- data: D;
221
- error: E;
955
+ /**
956
+ * Name of the product
957
+ */
958
+ export declare enum BillingProduct {
959
+ Free = "free",
960
+ Plus = "plus",
961
+ Pro = "pro",
962
+ Team = "team",
963
+ Business = "business",
964
+ Legacy = "legacy",
965
+ Startup = "startup",
966
+ Enterprise = "enterprise"
222
967
  }
223
- declare type CancelToken = Symbol | string | number;
224
- export declare enum ContentType {
225
- Json = "application/json",
226
- FormData = "multipart/form-data",
227
- UrlEncoded = "application/x-www-form-urlencoded"
968
+ export declare type BillingUpgrade = {
969
+ result: 'checkout';
970
+ sessionId: string;
971
+ } | {
972
+ result: 'preview';
973
+ invoice: BillingInvoicePreview;
974
+ } | {
975
+ result: 'upgraded';
976
+ } | {
977
+ result: 'downgraded';
978
+ };
979
+ export interface BillingInvoicePreview {
980
+ /** Amount of the invoice */
981
+ amount: number;
982
+ /** Amount that will be immediately charged. */
983
+ amountDueToday: number;
984
+ /** Current balance, if any, being stored on the customer. If positive, the customer has credit to apply to their next invoice. */
985
+ customerBalance: number;
986
+ /** Current balance after potential upgrade. */
987
+ remainingCustomerBalance: number;
988
+ /** Details of the change happening on the subscription. */
989
+ lines: {
990
+ description: string;
991
+ amount: number;
992
+ periodStart: Date;
993
+ periodEnd: Date;
994
+ }[];
228
995
  }
229
- export declare class HttpClient<SecurityDataType = unknown> {
230
- baseUrl: string;
231
- private securityData;
232
- private securityWorker?;
233
- private abortControllers;
234
- private customFetch;
235
- private baseApiParams;
236
- constructor(apiConfig?: ApiConfig<SecurityDataType>);
237
- setSecurityData: (data: SecurityDataType | null) => void;
238
- private encodeQueryParam;
239
- private addQueryParam;
240
- private addArrayQueryParam;
241
- protected toQueryString(rawQuery?: QueryParamsType): string;
242
- protected addQueryParams(rawQuery?: QueryParamsType): string;
243
- private contentFormatters;
244
- private mergeRequestParams;
245
- private createAbortSignal;
246
- abortRequest: (cancelToken: CancelToken) => void;
247
- request: <T = any, E = any>({ body, secure, path, type, query, format, baseUrl, cancelToken, ...params }: FullRequestParams) => Promise<HttpResponse<T, E>>;
996
+ export declare enum APIIntegrationScope {
997
+ IntegrationRead = "integration:read",
998
+ IntegrationUpdate = "integration:update",
999
+ IntegrationInstallationRead = "integration:installation:read",
1000
+ IntegrationInstallationUpdate = "integration:installation:update"
248
1001
  }
1002
+ export declare type APIScope = IntegrationScope | APIIntegrationScope | (IntegrationScope & APIIntegrationScope);
249
1003
  /**
250
- * @title GitBook API
251
- * @version 0.0.1-beta
252
- * @termsOfService https://policies.gitbook.com
253
- * @baseUrl {host}/v1
254
- * @contact API Support <support@gitbook.com> (https://gitbook.com/support)
255
- *
256
- * The GitBook API
1004
+ * The Cloudflare Hostname status
257
1005
  */
258
- export declare class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
259
- user: {
260
- /**
261
- * No description
262
- *
263
- * @name GetAuthenticated
264
- * @summary Get profile of authenticated user
265
- * @request GET:/user
266
- * @secure
267
- */
268
- getAuthenticated: (params?: RequestParams) => Promise<HttpResponse<User, Error>>;
269
- };
270
- spaces: {
271
- /**
272
- * No description
273
- *
274
- * @name GetSpace
275
- * @summary Get the details about a space
276
- * @request GET:/spaces/{spaceId}
1006
+ export declare enum CloudflareHostnameStatus {
1007
+ Pending = "pending",
1008
+ Active = "active",
1009
+ Blocked = "blocked",
1010
+ Moved = "moved",
1011
+ Deleted = "deleted"
1012
+ }
1013
+ /**
1014
+ * The Cloudflare Hostname TLS certificate
1015
+ */
1016
+ export interface CloudflareHostnameTLSCertificate {
1017
+ issuer?: string;
1018
+ expiresOn?: string;
1019
+ issuedOn?: string;
1020
+ }
1021
+ /**
1022
+ * The Cloudflare Hostname TLS information
1023
+ */
1024
+ export interface CloudflareHostnameTLSInfo {
1025
+ /** The Cloudflare Hostname TLS status */
1026
+ status: CloudflareHostnameTLSStatus;
1027
+ /** The Cloudflare Hostname TLS validation method */
1028
+ method: CloudflareHostnameTLSValidationMethod;
1029
+ certificateAuthority?: string;
1030
+ certificates: CloudflareHostnameTLSCertificate[];
1031
+ validationErrors: CloudflareHostnameTLSValidationError[];
1032
+ }
1033
+ /**
1034
+ * The Cloudflare Hostname TLS status
1035
+ */
1036
+ export declare enum CloudflareHostnameTLSStatus {
1037
+ Initializing = "initializing",
1038
+ PendingValidation = "pending_validation",
1039
+ PendingIssuance = "pending_issuance",
1040
+ PendingDeployment = "pending_deployment",
1041
+ Active = "active",
1042
+ PendingDeletion = "pending_deletion",
1043
+ PendingCleanup = "pending_cleanup",
1044
+ Deleted = "deleted"
1045
+ }
1046
+ /**
1047
+ * The Cloudflare Hostname TLS validation error
1048
+ */
1049
+ export interface CloudflareHostnameTLSValidationError {
1050
+ message: string;
1051
+ }
1052
+ /**
1053
+ * The Cloudflare Hostname TLS validation method
1054
+ */
1055
+ export declare enum CloudflareHostnameTLSValidationMethod {
1056
+ Http = "http",
1057
+ Txt = "txt",
1058
+ Email = "email"
1059
+ }
1060
+ /**
1061
+ * Cloudflare Custom Domain's information
1062
+ */
1063
+ export interface CustomDomainInfo {
1064
+ hostname: string;
1065
+ /** The Cloudflare Hostname status */
1066
+ status: CloudflareHostnameStatus;
1067
+ createdAt: string;
1068
+ /** The Cloudflare Hostname TLS information */
1069
+ ssl?: CloudflareHostnameTLSInfo;
1070
+ verificationErrors: string[];
1071
+ }
1072
+ /**
1073
+ * The User Firebase Auth Info.
1074
+ */
1075
+ export interface FirebaseUserInfo {
1076
+ uid: string;
1077
+ displayName?: string;
1078
+ email?: string;
1079
+ phoneNumber?: string;
1080
+ photoUrl?: string;
1081
+ providerId?: string;
1082
+ }
1083
+ /**
1084
+ * The type of purge, e.g by tags or hosts
1085
+ */
1086
+ export declare enum PurgeCDNCacheContextType {
1087
+ Tags = "tags",
1088
+ Hosts = "hosts"
1089
+ }
1090
+ /**
1091
+ * The GitBook Staff User info.
1092
+ */
1093
+ export interface StaffUserInfo {
1094
+ id: string;
1095
+ searchKey: string;
1096
+ }
1097
+ /**
1098
+ * The GitBook User info shown in the BackOffice.
1099
+ */
1100
+ export interface UserBackOfficeInfo {
1101
+ id: string;
1102
+ /** The GitBook User risk evaluation. */
1103
+ riskEvaluation: UserRiskEvaluation;
1104
+ authProviders: FirebaseUserInfo[];
1105
+ createdAt: string;
1106
+ lastSignInAt: string;
1107
+ disabled: boolean;
1108
+ }
1109
+ /**
1110
+ * The info returned when impersonating a GitBook User.
1111
+ */
1112
+ export declare type UserImpersonation = UserBackOfficeInfo & {
1113
+ impersonation: UserImpersonationInfo;
1114
+ };
1115
+ /**
1116
+ * The GitBook User impersonation info.
1117
+ */
1118
+ export interface UserImpersonationInfo {
1119
+ authURL: string;
1120
+ impersonatorId: string;
1121
+ }
1122
+ /**
1123
+ * The GitBook User risk evaluation.
1124
+ */
1125
+ export interface UserRiskEvaluation {
1126
+ /** True if the user was originally considered as risky */
1127
+ wasRisky: boolean;
1128
+ /** True if the user is currently considered as risky */
1129
+ isRisky: boolean;
1130
+ /** True if the user went through the verification process */
1131
+ isVerified: boolean;
1132
+ /** Risk score of the user */
1133
+ riskScore: number;
1134
+ /** Number of verification steps completed by the user */
1135
+ completedSteps: number;
1136
+ /** Total number of verification steps expected */
1137
+ expectedSteps: number;
1138
+ /** User completed the Google Account verification step */
1139
+ googleLogin: boolean;
1140
+ /** User completed the GitHub Account verification step */
1141
+ githubLogin: boolean;
1142
+ /** User completed the Email verification step */
1143
+ emailVerified: boolean;
1144
+ activeDaysRemaining: number;
1145
+ }
1146
+ export interface UnsplashImage {
1147
+ kind: 'unsplash_image';
1148
+ id: string;
1149
+ description: string;
1150
+ downloadLocation: string;
1151
+ urls: {
1152
+ full: string;
1153
+ small: string;
1154
+ };
1155
+ author: {
1156
+ name: string;
1157
+ url: string;
1158
+ };
1159
+ }
1160
+ export interface APITemporaryToken {
1161
+ /** Temporary access token to authenticate with the API */
1162
+ token: string;
1163
+ }
1164
+ export declare type ContentKitContext = {
1165
+ type: 'document';
1166
+ editable: boolean;
1167
+ theme: 'dark' | 'light';
1168
+ };
1169
+ /**
1170
+ * Binding between a property and a state value.
1171
+ */
1172
+ export interface ContentKitDynamicBinding {
1173
+ /** Key in the state */
1174
+ $state: string;
1175
+ }
1176
+ /**
1177
+ * Higher level element to represent a custom block.
1178
+ */
1179
+ export interface ContentKitBlock {
1180
+ type: 'block';
1181
+ children: ContentKitDescendantElement[];
1182
+ controls?: (ContentKitBlockControl | ContentKitBlockControl[])[];
1183
+ }
1184
+ /**
1185
+ * Control menu item displayed for the block.
1186
+ */
1187
+ export interface ContentKitBlockControl {
1188
+ icon?: ContentKitIcon;
1189
+ label: string;
1190
+ /** Custom action to re-render the block. */
1191
+ onPress: ContentKitAction;
1192
+ /** A confirm object that defines an optional confirmation dialog after the input is clicked. */
1193
+ confirm?: ContentKitConfirm;
1194
+ }
1195
+ /**
1196
+ * Pressable button triggering an action.
1197
+ */
1198
+ export interface ContentKitButton {
1199
+ type: 'button';
1200
+ style?: 'primary' | 'secondary' | 'danger';
1201
+ /** Custom action to re-render the block. */
1202
+ onPress: ContentKitAction;
1203
+ icon?: ContentKitIcon;
1204
+ label?: string;
1205
+ tooltip?: string;
1206
+ /** A confirm object that defines an optional confirmation dialog after the input is clicked. */
1207
+ confirm?: ContentKitConfirm;
1208
+ disabled?: boolean;
1209
+ }
1210
+ /**
1211
+ * Text input to prompt the user.
1212
+ */
1213
+ export interface ContentKitTextInput {
1214
+ type: 'textinput';
1215
+ /** State binding. The value of the input will be stored as a property in the state named after this ID. */
1216
+ state: string;
1217
+ /** Text value to initialize the input with. */
1218
+ initialValue?: string;
1219
+ /** Text that appears in the form control when it has no value set */
1220
+ placeholder?: string;
1221
+ multiline?: boolean;
1222
+ }
1223
+ /**
1224
+ * Low level text element.
1225
+ */
1226
+ export interface ContentKitText {
1227
+ type: 'text';
1228
+ style?: 'bold' | 'italic' | 'code' | 'strikethrough';
1229
+ children: (string | ContentKitText)[];
1230
+ }
1231
+ export interface ContentKitBox {
1232
+ type?: 'box';
1233
+ /** specifies how much of the remaining space in the container should be assigned to the element */
1234
+ grow?: number;
1235
+ children?: ContentKitDescendantElement[];
1236
+ }
1237
+ /**
1238
+ * Horizontal stack of boxes.
1239
+ */
1240
+ export interface ContentKitHStack {
1241
+ type: 'hstack';
1242
+ align?: 'start' | 'center' | 'end';
1243
+ children: ContentKitDescendantElement[];
1244
+ }
1245
+ /**
1246
+ * Vertical stack of boxes.
1247
+ */
1248
+ export interface ContentKitVStack {
1249
+ type: 'vstack';
1250
+ align?: 'start' | 'center' | 'end';
1251
+ children: ContentKitDescendantElement[];
1252
+ }
1253
+ /**
1254
+ * Divider between 2 boxes in a stack.
1255
+ */
1256
+ export interface ContentKitDivider {
1257
+ type: 'divider';
1258
+ size?: 'small' | 'medium' | 'large';
1259
+ }
1260
+ /**
1261
+ * Custom action to re-render the block.
1262
+ */
1263
+ export declare type ContentKitAction = {
1264
+ action: string;
1265
+ [key: string]: any;
1266
+ } | ContentKitDefaultAction | ({
1267
+ action: string;
1268
+ [key: string]: any;
1269
+ } & ContentKitDefaultAction);
1270
+ /**
1271
+ * Action to open an overlay modal defined by "componentId".
1272
+ */
1273
+ export declare type ContentKitDefaultAction = {
1274
+ action: '@ui.modal.open';
1275
+ componentId: string;
1276
+ props: object;
1277
+ } | {
1278
+ action: '@ui.modal.close';
1279
+ returnValue: object;
1280
+ } | {
1281
+ action: '@ui.url.open';
1282
+ url: string;
1283
+ } | {
1284
+ action: '@link.unfurl';
1285
+ url: string;
1286
+ } | {
1287
+ action: '@editor.node.updateProps';
1288
+ props: object;
1289
+ };
1290
+ export declare enum ContentKitIcon {
1291
+ Close = "close",
1292
+ Edit = "edit",
1293
+ Github = "github",
1294
+ Maximize = "maximize",
1295
+ Email = "email",
1296
+ Settings = "settings",
1297
+ Search = "search",
1298
+ Delete = "delete",
1299
+ Star = "star",
1300
+ Warning = "warning",
1301
+ Link = "link",
1302
+ LinkExternal = "link-external"
1303
+ }
1304
+ /**
1305
+ * Overlay modal.
1306
+ */
1307
+ export interface ContentKitModal {
1308
+ type: 'modal';
1309
+ title?: string;
1310
+ subtitle?: ContentKitInlineElement[];
1311
+ size?: 'medium' | 'xlarge' | 'fullscreen';
1312
+ /** Data passed back to the parent view when the modal is closed. These data are accessible in the "@ui.modal.close" */
1313
+ returnValue?: object;
1314
+ children: ContentKitDescendantElement[];
1315
+ /** Pressable button triggering an action. */
1316
+ submit?: ContentKitButton;
1317
+ }
1318
+ /**
1319
+ * Frame for a webpage
1320
+ */
1321
+ export interface ContentKitWebFrame {
1322
+ type: 'webframe';
1323
+ /** Ratio between width and height. Used to size the webframe. */
1324
+ aspectRatio?: number;
1325
+ /** Content to load in the frame. */
1326
+ source: {
1327
+ url: string;
1328
+ };
1329
+ /** Controls button shown as an overlay in a corner of the frame. */
1330
+ buttons?: ContentKitButton[];
1331
+ /** Data to communicated to the webframe's content. Each state update will cause the webframe to receive a message. */
1332
+ data?: Record<string, string | ContentKitDynamicBinding>;
1333
+ }
1334
+ /**
1335
+ * Code block with syntax highlighting
1336
+ */
1337
+ export interface ContentKitCodeBlock {
1338
+ type: 'codeblock';
1339
+ /** Code content to display */
1340
+ content: ContentKitDynamicBinding | string;
1341
+ /** Syntax to use for highlighting (ex: javascript, python) */
1342
+ syntax?: string;
1343
+ /** Line number to start at. */
1344
+ lineNumbers?: boolean | number;
1345
+ /** Controls button shown as an overlay in a corner of the code block. */
1346
+ buttons?: ContentKitButton[];
1347
+ /** State binding when editable. The value of the input will be stored as a property in the state named after this ID. */
1348
+ state?: string;
1349
+ /** Custom action to re-render the block. */
1350
+ onContentChange?: ContentKitAction;
1351
+ /** Header displayed before the code lines */
1352
+ header?: ContentKitDescendantElement[];
1353
+ /** Footer displayed after the code lines */
1354
+ footer?: ContentKitDescendantElement[];
1355
+ }
1356
+ /**
1357
+ * Output of the integration when rendering an UI.
1358
+ */
1359
+ export interface ContentKitRenderOutput {
1360
+ /** Element used as root */
1361
+ element: ContentKitRootElement;
1362
+ state: object;
1363
+ props: object;
1364
+ }
1365
+ /**
1366
+ * Block with rich text formatting of a markdown content.
1367
+ */
1368
+ export interface ContentKitMarkdown {
1369
+ type: 'markdown';
1370
+ /** Markdown content to display */
1371
+ content: ContentKitDynamicBinding | string;
1372
+ }
1373
+ export interface ContentKitCard {
1374
+ type: 'card';
1375
+ title?: string;
1376
+ hint?: string | ContentKitInlineElement[];
1377
+ icon?: ContentKitIcon | ContentKitImage;
1378
+ /** Custom action to re-render the block. */
1379
+ onPress?: ContentKitAction;
1380
+ children?: ContentKitDescendantElement[];
1381
+ /** Buttons displayed in the top right corner of the card. */
1382
+ buttons?: ContentKitButton[];
1383
+ }
1384
+ export interface ContentKitImage {
1385
+ type: 'image';
1386
+ source: {
1387
+ url: string;
1388
+ };
1389
+ aspectRatio: number;
1390
+ }
1391
+ /**
1392
+ * Field for an input.
1393
+ */
1394
+ export interface ContentKitInput {
1395
+ type: 'input';
1396
+ /** Text label displayed next to the input. */
1397
+ label: string;
1398
+ hint?: string | ContentKitInlineElement;
1399
+ element: ContentKitTextInput | ContentKitSelect | ContentKitSwitch | ContentKitRadio | ContentKitCheckbox | ContentKitButton;
1400
+ }
1401
+ /**
1402
+ * An individual option in a select element
1403
+ */
1404
+ export interface ContentKitSelectOption {
1405
+ id: string;
1406
+ label: string;
1407
+ }
1408
+ /**
1409
+ * Creates a drop down menu with a list of options for a user to choose.
1410
+ */
1411
+ export interface ContentKitSelect {
1412
+ type: 'select';
1413
+ /** State binding. The value of the input will be stored as a property in the state named after this ID. */
1414
+ state: string;
1415
+ /** Value to initialize the select with. */
1416
+ initialValue?: string | string[];
1417
+ /** Text that appears in the form control when it has no value set */
1418
+ placeholder?: string;
1419
+ /** Should the select accept the selection of multiple options. If true, the state will be an array. */
1420
+ multiple?: boolean;
1421
+ /** Static list of options */
1422
+ options: ContentKitSelectOption[] | {
1423
+ url: string;
1424
+ };
1425
+ }
1426
+ /**
1427
+ * Renders a boolean input.
1428
+ */
1429
+ export interface ContentKitSwitch {
1430
+ type: 'switch';
1431
+ /** State binding. The value of the input will be stored as a property in the state named after this ID. */
1432
+ state: string;
1433
+ /** Value to initialize the switch with. */
1434
+ initialValue?: boolean;
1435
+ /** A confirm object that defines an optional confirmation dialog after the input is clicked. */
1436
+ confirm?: ContentKitConfirm;
1437
+ }
1438
+ export interface ContentKitCheckbox {
1439
+ type: 'checkbox';
1440
+ /** State binding. The value of the input will be stored as a property in the state named after this ID. */
1441
+ state: string;
1442
+ /** Value to store in a state array when the checkbox is selected. */
1443
+ value: string | number;
1444
+ /** A confirm object that defines an optional confirmation dialog after the input is clicked. */
1445
+ confirm?: ContentKitConfirm;
1446
+ }
1447
+ export interface ContentKitRadio {
1448
+ type: 'radio';
1449
+ /** State binding. The value of the input will be stored as a property in the state named after this ID. */
1450
+ state: string;
1451
+ /** Value to store in th state when the checkbox is selected. */
1452
+ value: string | number;
1453
+ /** A confirm object that defines an optional confirmation dialog after the input is clicked. */
1454
+ confirm?: ContentKitConfirm;
1455
+ }
1456
+ /**
1457
+ * A confirm object that defines an optional confirmation dialog after the input is clicked.
1458
+ */
1459
+ export interface ContentKitConfirm {
1460
+ /** A text value that defines the dialog's title. */
1461
+ title: string;
1462
+ /** A text value that defines the explanatory text that appears in the confirm dialog. */
1463
+ text: string;
1464
+ /** A text value to define the text of the button that confirms the action. */
1465
+ confirm: string;
1466
+ style?: 'primary' | 'danger';
1467
+ }
1468
+ /**
1469
+ * Element used as root
1470
+ */
1471
+ export declare type ContentKitRootElement = ContentKitBlock | ContentKitModal;
1472
+ /**
1473
+ * Any element that can be used as children.
1474
+ */
1475
+ export declare type ContentKitDescendantElement = ContentKitButton | ContentKitTextInput | ContentKitHStack | ContentKitVStack | ContentKitBox | ContentKitDivider | ContentKitWebFrame | ContentKitCodeBlock | ContentKitMarkdown | ContentKitCard | ContentKitImage | ContentKitInput | ContentKitSelect | ContentKitSwitch | ContentKitCheckbox | ContentKitRadio | ContentKitText;
1476
+ /**
1477
+ * Any element that is inline.
1478
+ */
1479
+ export declare type ContentKitInlineElement = ContentKitText | ContentKitImage;
1480
+ export declare type QueryParamsType = Record<string | number, any>;
1481
+ export declare type ResponseFormat = keyof Omit<Body, 'body' | 'bodyUsed'>;
1482
+ export interface FullRequestParams extends Omit<RequestInit, 'body'> {
1483
+ /** set parameter to `true` for call `securityWorker` for this request */
1484
+ secure?: boolean;
1485
+ /** request path */
1486
+ path: string;
1487
+ /** content type of request body */
1488
+ type?: ContentType;
1489
+ /** query params */
1490
+ query?: QueryParamsType;
1491
+ /** format of response (i.e. response.json() -> format: "json") */
1492
+ format?: ResponseFormat;
1493
+ /** request body */
1494
+ body?: unknown;
1495
+ /** base url */
1496
+ baseUrl?: string;
1497
+ /** request cancellation token */
1498
+ cancelToken?: CancelToken;
1499
+ }
1500
+ export declare type RequestParams = Omit<FullRequestParams, 'body' | 'method' | 'query' | 'path'>;
1501
+ export interface ApiConfig<SecurityDataType = unknown> {
1502
+ baseUrl?: string;
1503
+ baseApiParams?: Omit<RequestParams, 'baseUrl' | 'cancelToken' | 'signal'>;
1504
+ securityWorker?: (securityData: SecurityDataType | null) => Promise<RequestParams | void> | RequestParams | void;
1505
+ customFetch?: typeof fetch;
1506
+ }
1507
+ export interface HttpResponse<D extends unknown, E extends unknown = unknown> extends Response {
1508
+ data: D;
1509
+ error: E;
1510
+ }
1511
+ declare type CancelToken = Symbol | string | number;
1512
+ export declare enum ContentType {
1513
+ Json = "application/json",
1514
+ FormData = "multipart/form-data",
1515
+ UrlEncoded = "application/x-www-form-urlencoded"
1516
+ }
1517
+ export declare class HttpClient<SecurityDataType = unknown> {
1518
+ baseUrl: string;
1519
+ private securityData;
1520
+ private securityWorker?;
1521
+ private abortControllers;
1522
+ private customFetch;
1523
+ private baseApiParams;
1524
+ constructor(apiConfig?: ApiConfig<SecurityDataType>);
1525
+ setSecurityData: (data: SecurityDataType | null) => void;
1526
+ private encodeQueryParam;
1527
+ private addQueryParam;
1528
+ private addArrayQueryParam;
1529
+ protected toQueryString(rawQuery?: QueryParamsType): string;
1530
+ protected addQueryParams(rawQuery?: QueryParamsType): string;
1531
+ private contentFormatters;
1532
+ private mergeRequestParams;
1533
+ private createAbortSignal;
1534
+ abortRequest: (cancelToken: CancelToken) => void;
1535
+ request: <T = any, E = any>({ body, secure, path, type, query, format, baseUrl, cancelToken, ...params }: FullRequestParams) => Promise<HttpResponse<T, E>>;
1536
+ }
1537
+ /**
1538
+ * @title GitBook API
1539
+ * @version 0.0.1-beta
1540
+ * @termsOfService https://policies.gitbook.com
1541
+ * @baseUrl {host}/v1
1542
+ * @contact API Support <support@gitbook.com> (https://gitbook.com/support)
1543
+ *
1544
+ * The GitBook API
1545
+ */
1546
+ export declare class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
1547
+ /**
1548
+ * @description Access the release version and build date of the GitBook codebase
1549
+ *
1550
+ * @tags api
1551
+ * @name GetApiInformation
1552
+ * @summary Get information about the state of the GitBook API
1553
+ * @request GET:/
1554
+ * @secure
1555
+ */
1556
+ getApiInformation: (params?: RequestParams) => Promise<HttpResponse<ApiInformation, Error>>;
1557
+ search: {
1558
+ /**
1559
+ * No description
1560
+ *
1561
+ * @tags search
1562
+ * @name SearchContent
1563
+ * @summary Search content across spaces that is accessible by the currently authenticated target
1564
+ * @request GET:/search
1565
+ * @secure
1566
+ */
1567
+ searchContent: (query: {
1568
+ query: string;
1569
+ page?: string;
1570
+ limit?: number;
1571
+ }, params?: RequestParams) => Promise<HttpResponse<List & {
1572
+ items: SearchSpaceResult[];
1573
+ }, Error>>;
1574
+ /**
1575
+ * No description
1576
+ *
1577
+ * @name AskQuery
1578
+ * @summary Ask a question to an AI across spaces that is accessible by the currently authenticated target.
1579
+ * @request GET:/search/ask
1580
+ * @secure
1581
+ */
1582
+ askQuery: (query: {
1583
+ query: string;
1584
+ }, params?: RequestParams) => Promise<HttpResponse<{
1585
+ answer?: SearchAIAnswer;
1586
+ }, Error>>;
1587
+ };
1588
+ user: {
1589
+ /**
1590
+ * @description Returns details about the user associated with the authentication provided in the request's authorization header.
1591
+ *
1592
+ * @tags users
1593
+ * @name GetAuthenticatedUser
1594
+ * @summary Get profile of authenticated user
1595
+ * @request GET:/user
1596
+ * @secure
1597
+ */
1598
+ getAuthenticatedUser: (params?: RequestParams) => Promise<HttpResponse<User, Error>>;
1599
+ /**
1600
+ * @description Lists spaces that the authenticated user explicitly own.
1601
+ *
1602
+ * @tags users
1603
+ * @name ListSpacesForAuthenticatedUser
1604
+ * @summary List spaces for the authenticated user
1605
+ * @request GET:/user/spaces
1606
+ * @secure
1607
+ */
1608
+ listSpacesForAuthenticatedUser: (query?: {
1609
+ page?: string;
1610
+ limit?: number;
1611
+ }, params?: RequestParams) => Promise<HttpResponse<List & {
1612
+ items: Space[];
1613
+ }, Error>>;
1614
+ };
1615
+ users: {
1616
+ /**
1617
+ * @description Provides publicly available information about someone with a GitBook account.
1618
+ *
1619
+ * @tags users
1620
+ * @name GetUserById
1621
+ * @summary Get a user by its ID
1622
+ * @request GET:/users/{userId}
1623
+ * @secure
1624
+ */
1625
+ getUserById: (userId: string, params?: RequestParams) => Promise<HttpResponse<User, Error>>;
1626
+ };
1627
+ spaces: {
1628
+ /**
1629
+ * No description
1630
+ *
1631
+ * @tags spaces
1632
+ * @name GetSpaceById
1633
+ * @summary Get the details about a space.
1634
+ * @request GET:/spaces/{spaceId}
1635
+ * @secure
1636
+ */
1637
+ getSpaceById: (spaceId: string, params?: RequestParams) => Promise<HttpResponse<Space, Error>>;
1638
+ /**
1639
+ * No description
1640
+ *
1641
+ * @name SearchSpaceContent
1642
+ * @summary Search content in a space
1643
+ * @request GET:/spaces/{spaceId}/search
1644
+ * @secure
1645
+ */
1646
+ searchSpaceContent: (spaceId: string, query: {
1647
+ query: string;
1648
+ page?: string;
1649
+ limit?: number;
1650
+ }, params?: RequestParams) => Promise<HttpResponse<List & {
1651
+ items: SearchPageResult[];
1652
+ }, Error>>;
1653
+ /**
1654
+ * No description
1655
+ *
1656
+ * @name AskQueryInSpace
1657
+ * @summary Ask a question to an AI within the context of the space.
1658
+ * @request GET:/spaces/{spaceId}/search/ask
1659
+ * @secure
1660
+ */
1661
+ askQueryInSpace: (spaceId: string, query: {
1662
+ query: string;
1663
+ }, params?: RequestParams) => Promise<HttpResponse<{
1664
+ answer?: SearchAIAnswer;
1665
+ }, Error>>;
1666
+ /**
1667
+ * No description
1668
+ *
1669
+ * @tags spaces
1670
+ * @name ImportGitRepository
1671
+ * @summary Import a Git repository
1672
+ * @request POST:/spaces/{spaceId}/git/import
1673
+ * @secure
1674
+ */
1675
+ importGitRepository: (spaceId: string, data: RequestImportGitRepository, params?: RequestParams) => Promise<HttpResponse<void, Error>>;
1676
+ /**
1677
+ * No description
1678
+ *
1679
+ * @tags spaces
1680
+ * @name ExportToGitRepository
1681
+ * @summary Export the space content to a Git repository.
1682
+ * @request POST:/spaces/{spaceId}/git/export
1683
+ * @secure
1684
+ */
1685
+ exportToGitRepository: (spaceId: string, data: RequestExportToGitRepository, params?: RequestParams) => Promise<HttpResponse<void, Error>>;
1686
+ /**
1687
+ * No description
1688
+ *
1689
+ * @tags analytics, spaces
1690
+ * @name GetContentAnalyticsForSpaceById
1691
+ * @summary Get content analytics for a given space.
1692
+ * @request GET:/spaces/{spaceId}/insights/content
1693
+ * @secure
1694
+ */
1695
+ getContentAnalyticsForSpaceById: (spaceId: string, params?: RequestParams) => Promise<HttpResponse<AnalyticsContentPages, Error>>;
1696
+ /**
1697
+ * No description
1698
+ *
1699
+ * @tags analytics, spaces
1700
+ * @name GetSearchAnalyticsForSpaceById
1701
+ * @summary Get an overview of the top search queries in a space.
1702
+ * @request GET:/spaces/{spaceId}/insights/search
1703
+ * @secure
1704
+ */
1705
+ getSearchAnalyticsForSpaceById: (spaceId: string, query?: {
1706
+ period?: AnalyticsSearchPeriod;
1707
+ }, params?: RequestParams) => Promise<HttpResponse<AnalyticsTopSearches, Error>>;
1708
+ /**
1709
+ * @description Get the total number of views and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday.
1710
+ *
1711
+ * @tags analytics, spaces
1712
+ * @name GetTrafficAnalyticsForSpaceById
1713
+ * @summary Get traffic page views for a given space
1714
+ * @request GET:/spaces/{spaceId}/insights/traffic
1715
+ * @secure
1716
+ */
1717
+ getTrafficAnalyticsForSpaceById: (spaceId: string, query?: {
1718
+ interval?: AnalyticsTrafficInterval;
1719
+ }, params?: RequestParams) => Promise<HttpResponse<AnalyticsTrafficPageViews, Error>>;
1720
+ /**
1721
+ * @description Track a page view in a space.
1722
+ *
1723
+ * @tags analytics, spaces
1724
+ * @name TrackViewInSpaceById
1725
+ * @request POST:/spaces/{spaceId}/insights/track_view
1726
+ * @secure
1727
+ */
1728
+ trackViewInSpaceById: (spaceId: string, data: RequestSpaceTrackPageView, params?: RequestParams) => Promise<HttpResponse<void, Error>>;
1729
+ /**
1730
+ * No description
1731
+ *
1732
+ * @name GetCurrentRevision
1733
+ * @summary Get the current primary content revision for a space
1734
+ * @request GET:/spaces/{spaceId}/content
1735
+ * @secure
1736
+ */
1737
+ getCurrentRevision: (spaceId: string, params?: RequestParams) => Promise<HttpResponse<Revision, Error>>;
1738
+ /**
1739
+ * No description
1740
+ *
1741
+ * @name ImportContent
1742
+ * @summary Import content in a space.
1743
+ * @request POST:/spaces/{spaceId}/content/import
1744
+ * @secure
1745
+ */
1746
+ importContent: (spaceId: string, data: RequestImportContent, params?: RequestParams) => Promise<HttpResponse<ImportContentResult, Error>>;
1747
+ /**
1748
+ * No description
1749
+ *
1750
+ * @name ListFiles
1751
+ * @summary List all files for the latest primary revision content for a space
1752
+ * @request GET:/spaces/{spaceId}/content/files
1753
+ * @secure
1754
+ */
1755
+ listFiles: (spaceId: string, query?: {
1756
+ page?: string;
1757
+ limit?: number;
1758
+ }, params?: RequestParams) => Promise<HttpResponse<List & {
1759
+ items: RevisionFile[];
1760
+ }, Error>>;
1761
+ /**
1762
+ * No description
1763
+ *
1764
+ * @name GetPageById
1765
+ * @summary Get a page by its ID in the primary content.
1766
+ * @request GET:/spaces/{spaceId}/content/page/{pageId}
1767
+ * @secure
1768
+ */
1769
+ getPageById: (spaceId: string, pageId: string, query?: {
1770
+ format?: 'document' | 'markdown';
1771
+ }, params?: RequestParams) => Promise<HttpResponse<RevisionPage, Error>>;
1772
+ /**
1773
+ * No description
1774
+ *
1775
+ * @name ImportContentInPageById
1776
+ * @summary Import external content into a page by its ID.
1777
+ * @request POST:/spaces/{spaceId}/content/page/{pageId}/import
1778
+ * @secure
1779
+ */
1780
+ importContentInPageById: (spaceId: string, pageId: string, data: RequestImportContent, params?: RequestParams) => Promise<HttpResponse<ImportContentResult, Error>>;
1781
+ /**
1782
+ * No description
1783
+ *
1784
+ * @name GetPageByPath
1785
+ * @summary Get a page by its path in the primary content.
1786
+ * @request GET:/spaces/{spaceId}/content/path/{pagePath}
1787
+ * @secure
1788
+ */
1789
+ getPageByPath: (spaceId: string, pagePath: string, query?: {
1790
+ format?: 'document' | 'markdown';
1791
+ }, params?: RequestParams) => Promise<HttpResponse<RevisionPageSheet | RevisionPageGroup, Error>>;
1792
+ /**
1793
+ * No description
1794
+ *
1795
+ * @tags spaces
1796
+ * @name CreateChangeRequest
1797
+ * @summary Create a new change request for a space.
1798
+ * @request POST:/spaces/{spaceId}/change-requests
1799
+ * @secure
1800
+ */
1801
+ createChangeRequest: (spaceId: string, data: RequestCreateChangeRequest, params?: RequestParams) => Promise<HttpResponse<ChangeRequest & {
1802
+ changeRequest: string;
1803
+ }, Error>>;
1804
+ /**
1805
+ * No description
1806
+ *
1807
+ * @tags spaces
1808
+ * @name MergeChangeRequest
1809
+ * @summary Merge a change request in the primary content of a space.
1810
+ * @request POST:/spaces/{spaceId}/change-requests/{changeRequestId}/merge
1811
+ * @secure
1812
+ */
1813
+ mergeChangeRequest: (spaceId: string, changeRequestId: string | number, params?: RequestParams) => Promise<HttpResponse<{
1814
+ revision: string;
1815
+ result: 'merge' | 'conflicts';
1816
+ }, Error>>;
1817
+ /**
1818
+ * No description
1819
+ *
1820
+ * @tags spaces
1821
+ * @name UpdateChangeRequest
1822
+ * @summary Update a change-request with changes from primary content.
1823
+ * @request POST:/spaces/{spaceId}/change-requests/{changeRequestId}/update
1824
+ * @secure
1825
+ */
1826
+ updateChangeRequest: (spaceId: string, changeRequestId: string | number, params?: RequestParams) => Promise<HttpResponse<{
1827
+ revision: string;
1828
+ result: 'update' | 'conflicts';
1829
+ }, Error>>;
1830
+ /**
1831
+ * No description
1832
+ *
1833
+ * @name GetRevisionOfChangeRequestById
1834
+ * @summary Get the latest content revision for a change request.
1835
+ * @request GET:/spaces/{spaceId}/change-requests/{changeRequestId}/content
1836
+ * @secure
1837
+ */
1838
+ getRevisionOfChangeRequestById: (spaceId: string, changeRequestId: string | number, params?: RequestParams) => Promise<HttpResponse<Revision, Error>>;
1839
+ /**
1840
+ * No description
1841
+ *
1842
+ * @name ImportContentInChangeRequest
1843
+ * @summary Import content in a change request.
1844
+ * @request POST:/spaces/{spaceId}/change-requests/{changeRequestId}/content/import
1845
+ * @secure
1846
+ */
1847
+ importContentInChangeRequest: (spaceId: string, changeRequestId: string | number, data: RequestImportContent, params?: RequestParams) => Promise<HttpResponse<ImportContentResult, Error>>;
1848
+ /**
1849
+ * No description
1850
+ *
1851
+ * @name ListFilesInChangeRequestById
1852
+ * @summary List all files in the latest content of the change-request
1853
+ * @request GET:/spaces/{spaceId}/change-requests/{changeRequestId}/content/files
1854
+ * @secure
1855
+ */
1856
+ listFilesInChangeRequestById: (spaceId: string, changeRequestId: string | number, query?: {
1857
+ page?: string;
1858
+ limit?: number;
1859
+ }, params?: RequestParams) => Promise<HttpResponse<List & {
1860
+ items: RevisionFile[];
1861
+ }, Error>>;
1862
+ /**
1863
+ * No description
1864
+ *
1865
+ * @name GetPageInChangeRequestById
1866
+ * @summary Get a page by its ID in a change request.
1867
+ * @request GET:/spaces/{spaceId}/change-requests/{changeRequestId}/content/page/{pageId}
1868
+ * @secure
1869
+ */
1870
+ getPageInChangeRequestById: (spaceId: string, changeRequestId: string | number, pageId: string, query?: {
1871
+ format?: 'document' | 'markdown';
1872
+ }, params?: RequestParams) => Promise<HttpResponse<RevisionPage, Error>>;
1873
+ /**
1874
+ * No description
1875
+ *
1876
+ * @name ImportContentInChangeRequestPageById
1877
+ * @summary Import external content into a page of a change-request by its ID.
1878
+ * @request POST:/spaces/{spaceId}/change-requests/{changeRequestId}/content/page/{pageId}/import
1879
+ * @secure
1880
+ */
1881
+ importContentInChangeRequestPageById: (spaceId: string, changeRequestId: string | number, pageId: string, data: RequestImportContent, params?: RequestParams) => Promise<HttpResponse<ImportContentResult, Error>>;
1882
+ /**
1883
+ * No description
1884
+ *
1885
+ * @name GetPageInChangeRequestByPath
1886
+ * @summary Get a page by its path in a change request.
1887
+ * @request GET:/spaces/{spaceId}/change-requests/{changeRequestId}/content/path/{pagePath}
1888
+ * @secure
1889
+ */
1890
+ getPageInChangeRequestByPath: (spaceId: string, changeRequestId: string | number, pagePath: string, query?: {
1891
+ format?: 'document' | 'markdown';
1892
+ }, params?: RequestParams) => Promise<HttpResponse<RevisionPageSheet | RevisionPageGroup, Error>>;
1893
+ /**
1894
+ * No description
1895
+ *
1896
+ * @name GetRevisionById
1897
+ * @summary Get a specific revision in a space
1898
+ * @request GET:/spaces/{spaceId}/revisions/{revisionId}
1899
+ * @secure
1900
+ */
1901
+ getRevisionById: (spaceId: string, revisionId: string, params?: RequestParams) => Promise<HttpResponse<Revision, Error>>;
1902
+ /**
1903
+ * No description
1904
+ *
1905
+ * @name ListFilesInRevisionById
1906
+ * @summary List all files in a revision
1907
+ * @request GET:/spaces/{spaceId}/revisions/{revisionId}/files
1908
+ * @secure
1909
+ */
1910
+ listFilesInRevisionById: (spaceId: string, revisionId: string, query?: {
1911
+ page?: string;
1912
+ limit?: number;
1913
+ }, params?: RequestParams) => Promise<HttpResponse<List & {
1914
+ items: RevisionFile[];
1915
+ }, Error>>;
1916
+ /**
1917
+ * No description
1918
+ *
1919
+ * @name GetPageInRevisionById
1920
+ * @summary Get a page by its ID in a revision.
1921
+ * @request GET:/spaces/{spaceId}/revisions/{revisionId}/page/{pageId}
277
1922
  * @secure
278
1923
  */
279
- getSpace: (spaceId: string, params?: RequestParams) => Promise<HttpResponse<Space, Error>>;
1924
+ getPageInRevisionById: (spaceId: string, revisionId: string, pageId: string, query?: {
1925
+ format?: 'document' | 'markdown';
1926
+ }, params?: RequestParams) => Promise<HttpResponse<RevisionPage, Error>>;
280
1927
  /**
281
- * @description Track a page view on a space
1928
+ * No description
1929
+ *
1930
+ * @name GetPageInRevisionByPath
1931
+ * @summary Get a page by its path in a revision.
1932
+ * @request GET:/spaces/{spaceId}/revisions/{revisionId}/path/{pagePath}
1933
+ * @secure
1934
+ */
1935
+ getPageInRevisionByPath: (spaceId: string, revisionId: string, pagePath: string, query?: {
1936
+ format?: 'document' | 'markdown';
1937
+ }, params?: RequestParams) => Promise<HttpResponse<RevisionPageSheet | RevisionPageGroup, Error>>;
1938
+ /**
1939
+ * No description
1940
+ *
1941
+ * @tags permissions, spaces
1942
+ * @name ListPermissionsAggregateInSpace
1943
+ * @summary List permissions for all users in a space.
1944
+ * @request GET:/spaces/{spaceId}/permissions/aggregate
1945
+ * @secure
1946
+ */
1947
+ listPermissionsAggregateInSpace: (spaceId: string, query?: {
1948
+ page?: string;
1949
+ limit?: number;
1950
+ }, params?: RequestParams) => Promise<HttpResponse<List & {
1951
+ items: UserContentPermission[];
1952
+ }, Error>>;
1953
+ };
1954
+ collections: {
1955
+ /**
1956
+ * No description
1957
+ *
1958
+ * @tags collections
1959
+ * @name GetCollectionById
1960
+ * @summary Get the details about a collection using its ID
1961
+ * @request GET:/collections/{collectionId}
1962
+ * @secure
1963
+ */
1964
+ getCollectionById: (collectionId: string, params?: RequestParams) => Promise<HttpResponse<Collection, Error>>;
1965
+ /**
1966
+ * No description
1967
+ *
1968
+ * @tags collections
1969
+ * @name ListSpacesInCollectionById
1970
+ * @summary List all the spaces in a collection by its ID.
1971
+ * @request GET:/collections/{collectionId}/spaces
1972
+ * @secure
1973
+ */
1974
+ listSpacesInCollectionById: (collectionId: string, query?: {
1975
+ page?: string;
1976
+ limit?: number;
1977
+ }, params?: RequestParams) => Promise<HttpResponse<List & {
1978
+ items: Space[];
1979
+ }, Error>>;
1980
+ /**
1981
+ * No description
282
1982
  *
283
- * @name TrackPageView
284
- * @request POST:/spaces/{spaceId}/views
1983
+ * @tags permissions, spaces
1984
+ * @name ListPermissionsAggregateInCollection
1985
+ * @summary List permissions for all users in a collection.
1986
+ * @request GET:/collections/{collectionId}/permissions/aggregate
285
1987
  * @secure
286
1988
  */
287
- trackPageView: (spaceId: string, data: RequestSpaceTrackPageView, params?: RequestParams) => Promise<HttpResponse<object, Error>>;
1989
+ listPermissionsAggregateInCollection: (collectionId: string, query?: {
1990
+ page?: string;
1991
+ limit?: number;
1992
+ }, params?: RequestParams) => Promise<HttpResponse<List & {
1993
+ items: UserContentPermission[];
1994
+ }, Error>>;
288
1995
  };
289
1996
  integrations: {
290
1997
  /**
291
1998
  * No description
292
1999
  *
293
- * @name Publish
2000
+ * @tags integrations
2001
+ * @name ListIntegrations
2002
+ * @summary List all public integrations
2003
+ * @request GET:/integrations
2004
+ * @secure
2005
+ */
2006
+ listIntegrations: (query?: {
2007
+ page?: string;
2008
+ limit?: number;
2009
+ }, params?: RequestParams) => Promise<HttpResponse<List & {
2010
+ items: Integration[];
2011
+ }, Error>>;
2012
+ /**
2013
+ * No description
2014
+ *
2015
+ * @tags integrations
2016
+ * @name GetIntegrationByName
2017
+ * @summary Get a specific integration by its name
2018
+ * @request GET:/integrations/{integrationName}
2019
+ * @secure
2020
+ */
2021
+ getIntegrationByName: (integrationName: string, params?: RequestParams) => Promise<HttpResponse<Integration, Error | {
2022
+ error: {
2023
+ code: 404;
2024
+ message: string;
2025
+ };
2026
+ }>>;
2027
+ /**
2028
+ * No description
2029
+ *
2030
+ * @tags integrations
2031
+ * @name PublishIntegration
294
2032
  * @summary Publish an integration
295
2033
  * @request POST:/integrations/{integrationName}
296
2034
  * @secure
297
2035
  */
298
- publish: (integrationName: string, data: RequestPublishIntegration, params?: RequestParams) => Promise<HttpResponse<Integration, Error>>;
2036
+ publishIntegration: (integrationName: string, data: RequestPublishIntegration, params?: RequestParams) => Promise<HttpResponse<Integration, Error | {
2037
+ error: {
2038
+ code: 404;
2039
+ message: string;
2040
+ };
2041
+ }>>;
299
2042
  /**
300
2043
  * No description
301
2044
  *
302
- * @name GetInstallation
303
- * @summary Get the status and configurations of an integration's installation
304
- * @request GET:/integrations/{integrationName}/installations/{installationId}
2045
+ * @tags integrations
2046
+ * @name UnpublishIntegration
2047
+ * @summary Unpublish an integration
2048
+ * @request DELETE:/integrations/{integrationName}
305
2049
  * @secure
306
2050
  */
307
- getInstallation: (integrationName: string, installationId: string, params?: RequestParams) => Promise<HttpResponse<IntegrationInstallation, Error>>;
2051
+ unpublishIntegration: (integrationName: string, params?: RequestParams) => Promise<HttpResponse<void, Error>>;
308
2052
  /**
309
2053
  * No description
310
2054
  *
311
- * @name UpdateInstallation
312
- * @summary Update status and configurations of an integration's installation
2055
+ * @tags integrations
2056
+ * @name ListIntegrationInstallations
2057
+ * @summary Fetch a list of installations of an integration
2058
+ * @request GET:/integrations/{integrationName}/installations
2059
+ * @secure
2060
+ */
2061
+ listIntegrationInstallations: (integrationName: string, query?: {
2062
+ page?: string;
2063
+ limit?: number;
2064
+ externalId?: string;
2065
+ }, params?: RequestParams) => Promise<HttpResponse<List & {
2066
+ items: IntegrationInstallation[];
2067
+ }, Error>>;
2068
+ /**
2069
+ * No description
2070
+ *
2071
+ * @tags integrations
2072
+ * @name ListIntegrationSpaceInstallations
2073
+ * @summary Fetch a list of space installations of an integration
2074
+ * @request GET:/integrations/{integrationName}/spaces
2075
+ * @secure
2076
+ */
2077
+ listIntegrationSpaceInstallations: (integrationName: string, query?: {
2078
+ page?: string;
2079
+ limit?: number;
2080
+ externalId?: string;
2081
+ }, params?: RequestParams) => Promise<HttpResponse<List & {
2082
+ items: IntegrationSpaceInstallation[];
2083
+ }, Error>>;
2084
+ /**
2085
+ * No description
2086
+ *
2087
+ * @name RenderIntegrationUiWithGet
2088
+ * @summary Render an integration UI in the context of an installation.
2089
+ * @request GET:/integrations/{integrationName}/render
2090
+ * @secure
2091
+ */
2092
+ renderIntegrationUiWithGet: (integrationName: string, query: {
2093
+ request: string;
2094
+ }, params?: RequestParams) => Promise<HttpResponse<ContentKitRenderOutput, Error>>;
2095
+ /**
2096
+ * No description
2097
+ *
2098
+ * @name RenderIntegrationUiWithPost
2099
+ * @summary Render an integration UI in the context of an installation.
2100
+ * @request POST:/integrations/{integrationName}/render
2101
+ * @secure
2102
+ */
2103
+ renderIntegrationUiWithPost: (integrationName: string, data: RequestRenderIntegrationUI, params?: RequestParams) => Promise<HttpResponse<ContentKitRenderOutput, Error>>;
2104
+ /**
2105
+ * No description
2106
+ *
2107
+ * @tags integrations
2108
+ * @name UpdateIntegrationInstallation
2109
+ * @summary Update external IDs and configurations of an integration's installation
313
2110
  * @request PATCH:/integrations/{integrationName}/installations/{installationId}
314
2111
  * @secure
315
2112
  */
316
- updateInstallation: (integrationName: string, installationId: string, data: RequestUpdateIntegrationInstallation, params?: RequestParams) => Promise<HttpResponse<object, Error>>;
2113
+ updateIntegrationInstallation: (integrationName: string, installationId: string, data: RequestUpdateIntegrationInstallation, params?: RequestParams) => Promise<HttpResponse<IntegrationInstallation, Error>>;
2114
+ /**
2115
+ * @description Creates a temporary API token of an integration's installation that has access to the installation and it's scopes. You must be authenticated as the integration to obtain this token.
2116
+ *
2117
+ * @tags integrations
2118
+ * @name CreateIntegrationInstallationToken
2119
+ * @summary Create an integration installation API token
2120
+ * @request POST:/integrations/{integrationName}/installations/{installationId}/tokens
2121
+ * @secure
2122
+ */
2123
+ createIntegrationInstallationToken: (integrationName: string, installationId: string, params?: RequestParams) => Promise<HttpResponse<APITemporaryToken, Error | {
2124
+ error: {
2125
+ code: 404;
2126
+ message: string;
2127
+ };
2128
+ }>>;
2129
+ /**
2130
+ * No description
2131
+ *
2132
+ * @name UpdateIntegrationSpaceInstallation
2133
+ * @summary Update external IDs and configurations of an integration's installation for a space
2134
+ * @request PATCH:/integrations/{integrationName}/installations/{installationId}/spaces/{spaceId}
2135
+ * @secure
2136
+ */
2137
+ updateIntegrationSpaceInstallation: (integrationName: string, installationId: string, spaceId: string, data: RequestUpdateIntegrationInstallation, params?: RequestParams) => Promise<HttpResponse<IntegrationSpaceInstallation, Error>>;
2138
+ };
2139
+ orgs: {
2140
+ /**
2141
+ * No description
2142
+ *
2143
+ * @tags organizations
2144
+ * @name ListOrganizationsForAuthenticatedUser
2145
+ * @summary Get the list of organizations for the currently authenticated user
2146
+ * @request GET:/orgs
2147
+ * @secure
2148
+ */
2149
+ listOrganizationsForAuthenticatedUser: (query?: {
2150
+ page?: string;
2151
+ limit?: number;
2152
+ }, params?: RequestParams) => Promise<HttpResponse<List & {
2153
+ items: Organization[];
2154
+ }, Error>>;
2155
+ /**
2156
+ * @description Lists members for the specified organization.
2157
+ *
2158
+ * @tags organizations
2159
+ * @name ListMembersInOrganizationById
2160
+ * @summary List organization members
2161
+ * @request GET:/orgs/{organizationId}/members
2162
+ * @secure
2163
+ */
2164
+ listMembersInOrganizationById: (organizationId: string, query?: {
2165
+ page?: string;
2166
+ limit?: number;
2167
+ }, params?: RequestParams) => Promise<HttpResponse<List & {
2168
+ items: OrganizationMember[];
2169
+ }, Error>>;
2170
+ /**
2171
+ * @description Gets a specific member in an organization.
2172
+ *
2173
+ * @tags organizations
2174
+ * @name GetMemberInOrganizationById
2175
+ * @summary Get specified organization member
2176
+ * @request GET:/orgs/{organizationId}/members/{userId}
2177
+ * @secure
2178
+ */
2179
+ getMemberInOrganizationById: (organizationId: string, userId: string, params?: RequestParams) => Promise<HttpResponse<OrganizationMember, Error>>;
2180
+ /**
2181
+ * @description Updates a specific member in an organization.
2182
+ *
2183
+ * @tags organizations
2184
+ * @name UpdateMemberInOrganizationById
2185
+ * @summary Update specified organization member
2186
+ * @request PATCH:/orgs/{organizationId}/members/{userId}
2187
+ * @secure
2188
+ */
2189
+ updateMemberInOrganizationById: (organizationId: string, userId: string, data: {
2190
+ role?: MemberRoleOrGuest;
2191
+ }, params?: RequestParams) => Promise<HttpResponse<OrganizationMember, Error>>;
2192
+ /**
2193
+ * @description Deletes a specific member from an organization
2194
+ *
2195
+ * @tags organizations
2196
+ * @name RemoveMemberFromOrganizationById
2197
+ * @summary Delete a member from an organization
2198
+ * @request DELETE:/orgs/{organizationId}/members/{userId}
2199
+ * @secure
2200
+ */
2201
+ removeMemberFromOrganizationById: (organizationId: string, userId: string, params?: RequestParams) => Promise<HttpResponse<void, Error>>;
2202
+ /**
2203
+ * No description
2204
+ *
2205
+ * @tags organizations
2206
+ * @name SetUserAsSsoMemberForOrganization
2207
+ * @summary Set a user as an SSO member of an organization
2208
+ * @request POST:/orgs/{organizationId}/members/{userId}/sso
2209
+ * @secure
2210
+ */
2211
+ setUserAsSsoMemberForOrganization: (organizationId: string, userId: string, params?: RequestParams) => Promise<HttpResponse<void, Error>>;
2212
+ /**
2213
+ * No description
2214
+ *
2215
+ * @tags permissions, spaces
2216
+ * @name ListSpacesForOrganizationMember
2217
+ * @summary List permissions accross all spaces for a member of an organization
2218
+ * @request GET:/orgs/{organizationId}/members/{userId}/spaces
2219
+ * @secure
2220
+ */
2221
+ listSpacesForOrganizationMember: (organizationId: string, userId: string, query?: {
2222
+ page?: string;
2223
+ limit?: number;
2224
+ }, params?: RequestParams) => Promise<HttpResponse<List & {
2225
+ items: MemberContentPermission[];
2226
+ }, Error>>;
2227
+ /**
2228
+ * @description Lists teams for the specified organization.
2229
+ *
2230
+ * @tags organizations
2231
+ * @name ListTeamsInOrganizationById
2232
+ * @summary List organization teams
2233
+ * @request GET:/orgs/{organizationId}/teams
2234
+ * @secure
2235
+ */
2236
+ listTeamsInOrganizationById: (organizationId: string, query?: {
2237
+ page?: string;
2238
+ limit?: number;
2239
+ title?: string;
2240
+ }, params?: RequestParams) => Promise<HttpResponse<List & {
2241
+ items: OrganizationTeam[];
2242
+ }, Error>>;
2243
+ /**
2244
+ * @description Creates a team in the specified organization.
2245
+ *
2246
+ * @tags organizations
2247
+ * @name CreateOrganizationTeam
2248
+ * @summary Create organization team
2249
+ * @request PUT:/orgs/{organizationId}/teams
2250
+ * @secure
2251
+ */
2252
+ createOrganizationTeam: (organizationId: string, data: {
2253
+ title: string;
2254
+ members?: string[];
2255
+ }, params?: RequestParams) => Promise<HttpResponse<OrganizationTeam, Error>>;
2256
+ /**
2257
+ * @description Gets a specific team in an organization.
2258
+ *
2259
+ * @tags organizations
2260
+ * @name GetTeamInOrganizationById
2261
+ * @summary Get specified organization team
2262
+ * @request GET:/orgs/{organizationId}/teams/{teamId}
2263
+ * @secure
2264
+ */
2265
+ getTeamInOrganizationById: (organizationId: string, teamId: string, params?: RequestParams) => Promise<HttpResponse<OrganizationTeam, Error>>;
2266
+ /**
2267
+ * @description Updates a specific team in an organization.
2268
+ *
2269
+ * @tags organizations
2270
+ * @name UpdateTeamInOrganizationById
2271
+ * @summary Update specified organization team
2272
+ * @request PATCH:/orgs/{organizationId}/teams/{teamId}
2273
+ * @secure
2274
+ */
2275
+ updateTeamInOrganizationById: (organizationId: string, teamId: string, data: {
2276
+ title: string;
2277
+ }, params?: RequestParams) => Promise<HttpResponse<OrganizationTeam, Error>>;
2278
+ /**
2279
+ * @description Deletes a specific team in an organization
2280
+ *
2281
+ * @tags organizations
2282
+ * @name RemoveTeamFromOrganizationById
2283
+ * @summary Delete a team in an organization
2284
+ * @request DELETE:/orgs/{organizationId}/teams/{teamId}
2285
+ * @secure
2286
+ */
2287
+ removeTeamFromOrganizationById: (organizationId: string, teamId: string, params?: RequestParams) => Promise<HttpResponse<void, Error>>;
2288
+ /**
2289
+ * @description Updates members of an organization team, either adding or removing them. If a the same user is included as both an add and a remove, they will be removed from the team.
2290
+ *
2291
+ * @tags organizations
2292
+ * @name UpdateMembersInOrganizationTeam
2293
+ * @summary Updates members of an organization team
2294
+ * @request PUT:/orgs/{organizationId}/teams/{teamId}/members
2295
+ * @secure
2296
+ */
2297
+ updateMembersInOrganizationTeam: (organizationId: string, teamId: string, data: {
2298
+ add?: string[];
2299
+ remove?: string[];
2300
+ }, params?: RequestParams) => Promise<HttpResponse<void, Error>>;
2301
+ /**
2302
+ * @description Lists members for the specified organization team.
2303
+ *
2304
+ * @tags organizations
2305
+ * @name ListTeamMembersInOrganizationById
2306
+ * @summary List team members
2307
+ * @request GET:/orgs/{organizationId}/teams/{teamId}/members
2308
+ * @secure
2309
+ */
2310
+ listTeamMembersInOrganizationById: (organizationId: string, teamId: string, query?: {
2311
+ page?: string;
2312
+ limit?: number;
2313
+ }, params?: RequestParams) => Promise<HttpResponse<List & {
2314
+ items: OrganizationMember[];
2315
+ }, Error>>;
2316
+ /**
2317
+ * @description Adds member into the specified organization team.
2318
+ *
2319
+ * @tags organizations
2320
+ * @name AddMemberToOrganizationTeamById
2321
+ * @summary Add member to a team
2322
+ * @request PUT:/orgs/{organizationId}/teams/{teamId}/members/{userId}
2323
+ * @secure
2324
+ */
2325
+ addMemberToOrganizationTeamById: (organizationId: string, teamId: string, userId: string, params?: RequestParams) => Promise<HttpResponse<void, Error>>;
2326
+ /**
2327
+ * @description Deletes member from the specified organization team.
2328
+ *
2329
+ * @tags organizations
2330
+ * @name DeleteMemberFromOrganizationTeamById
2331
+ * @summary Delete members from a team
2332
+ * @request DELETE:/orgs/{organizationId}/teams/{teamId}/members/{userId}
2333
+ * @secure
2334
+ */
2335
+ deleteMemberFromOrganizationTeamById: (organizationId: string, teamId: string, userId: string, params?: RequestParams) => Promise<HttpResponse<void, Error>>;
2336
+ /**
2337
+ * No description
2338
+ *
2339
+ * @tags organizations
2340
+ * @name InviteUsersToOrganization
2341
+ * @summary Invite users to a given organization based on a list of emails
2342
+ * @request POST:/orgs/{organizationId}/invites
2343
+ * @secure
2344
+ */
2345
+ inviteUsersToOrganization: (organizationId: string, data: RequestInviteUsersToOrganization, params?: RequestParams) => Promise<HttpResponse<{
2346
+ users: string[];
2347
+ invited: number;
2348
+ failedSSOEmails?: string[];
2349
+ }, Error | {
2350
+ error: {
2351
+ code: 400;
2352
+ message: string;
2353
+ };
2354
+ }>>;
2355
+ /**
2356
+ * No description
2357
+ *
2358
+ * @tags organizations
2359
+ * @name JoinOrganizationWithInvite
2360
+ * @summary Use an invite to join an organization.
2361
+ * @request POST:/orgs/{organizationId}/invites/{inviteId}
2362
+ * @secure
2363
+ */
2364
+ joinOrganizationWithInvite: (organizationId: string, inviteId: string, params?: RequestParams) => Promise<HttpResponse<object, Error>>;
2365
+ /**
2366
+ * No description
2367
+ *
2368
+ * @tags organizations
2369
+ * @name UpgradeOrganizationPlan
2370
+ * @summary Upgrade an organization's billing plan
2371
+ * @request POST:/orgs/{organizationId}/billing
2372
+ * @secure
2373
+ */
2374
+ upgradeOrganizationPlan: (organizationId: string, data: RequestUpgradeOrganizationBilling, params?: RequestParams) => Promise<HttpResponse<BillingUpgrade, Error>>;
2375
+ /**
2376
+ * No description
2377
+ *
2378
+ * @tags organizations
2379
+ * @name GetOrganizationBillingPortal
2380
+ * @summary Get the billing portal for an organization
2381
+ * @request GET:/orgs/{organizationId}/billing
2382
+ * @secure
2383
+ */
2384
+ getOrganizationBillingPortal: (organizationId: string, params?: RequestParams) => Promise<HttpResponse<BillingPortal, Error>>;
2385
+ /**
2386
+ * No description
2387
+ *
2388
+ * @tags organizations
2389
+ * @name RequestOrganizationUpgrade
2390
+ * @summary Send a request to ask the organization's admin to upgrade it.
2391
+ * @request POST:/orgs/{organizationId}/request_upgrade
2392
+ * @secure
2393
+ */
2394
+ requestOrganizationUpgrade: (organizationId: string, params?: RequestParams) => Promise<HttpResponse<object, Error>>;
2395
+ /**
2396
+ * No description
2397
+ *
2398
+ * @tags organizations
2399
+ * @name TransferOrganization
2400
+ * @summary Transfer one organization (source) into another organization (target).
2401
+ * @request POST:/orgs/{organizationId}/transfer
2402
+ * @secure
2403
+ */
2404
+ transferOrganization: (organizationId: string, data: {
2405
+ source: string;
2406
+ defaultOrgRole?: MemberRoleOrGuest | 'saml';
2407
+ }, params?: RequestParams) => Promise<HttpResponse<{
2408
+ collection: string;
2409
+ newSourceHostname?: string;
2410
+ }, Error>>;
2411
+ /**
2412
+ * No description
2413
+ *
2414
+ * @tags organizations
2415
+ * @name SearchOrganizationContent
2416
+ * @summary Search content in an organization
2417
+ * @request GET:/orgs/{organizationId}/search
2418
+ * @secure
2419
+ */
2420
+ searchOrganizationContent: (organizationId: string, query: {
2421
+ query: string;
2422
+ page?: string;
2423
+ limit?: number;
2424
+ }, params?: RequestParams) => Promise<HttpResponse<List & {
2425
+ items: SearchSpaceResult[];
2426
+ }, Error>>;
2427
+ /**
2428
+ * @description Lists spaces for the specified organization.
2429
+ *
2430
+ * @tags organizations
2431
+ * @name ListSpacesInOrganizationById
2432
+ * @summary List organization spaces
2433
+ * @request GET:/orgs/{organizationId}/spaces
2434
+ * @secure
2435
+ */
2436
+ listSpacesInOrganizationById: (organizationId: string, query?: {
2437
+ page?: string;
2438
+ limit?: number;
2439
+ }, params?: RequestParams) => Promise<HttpResponse<List & {
2440
+ items: Space[];
2441
+ }, Error>>;
2442
+ /**
2443
+ * @description Lists collections for the specified organization.
2444
+ *
2445
+ * @tags organizations
2446
+ * @name ListCollectionsInOrganizationById
2447
+ * @summary List organization collections
2448
+ * @request GET:/orgs/{organizationId}/collections
2449
+ * @secure
2450
+ */
2451
+ listCollectionsInOrganizationById: (organizationId: string, query?: {
2452
+ page?: string;
2453
+ limit?: number;
2454
+ nested?: boolean;
2455
+ }, params?: RequestParams) => Promise<HttpResponse<List & {
2456
+ items: Collection[];
2457
+ }, Error>>;
2458
+ /**
2459
+ * No description
2460
+ *
2461
+ * @tags organizations, dsync
2462
+ * @name SetupDirectorySync
2463
+ * @summary Set up Directory Sync in an organization.
2464
+ * @request POST:/orgs/{organizationId}/dsync
2465
+ * @secure
2466
+ */
2467
+ setupDirectorySync: (organizationId: string, params?: RequestParams) => Promise<HttpResponse<{
2468
+ setupUrl: string;
2469
+ }, Error>>;
2470
+ /**
2471
+ * No description
2472
+ *
2473
+ * @tags organizations, dsync
2474
+ * @name ListDirectorySyncGroups
2475
+ * @summary Lists the groups exposed to the synced Directory on an organization.
2476
+ * @request GET:/orgs/{organizationId}/dsync/groups
2477
+ * @secure
2478
+ */
2479
+ listDirectorySyncGroups: (organizationId: string, params?: RequestParams) => Promise<HttpResponse<{
2480
+ groups: OrganizationDirectorySyncGroup[];
2481
+ }, Error>>;
2482
+ /**
2483
+ * @description Each pair will lead the team being synced to the group (unless it is already synced to another) and the members of the group will then be synced to the team. Each sync is independent, the endpoint will still succeed if some of the syncs fail. Check the response to know more about the success or failure of the entire sync.
2484
+ *
2485
+ * @tags organizations, dsync
2486
+ * @name SyncDirectorySyncGroupsToTeams
2487
+ * @summary Syncs a list of group/team unique identifiers pairs together.
2488
+ * @request POST:/orgs/{organizationId}/dsync/teams
2489
+ * @secure
2490
+ */
2491
+ syncDirectorySyncGroupsToTeams: (organizationId: string, data: {
2492
+ to_sync: {
2493
+ group_id: string;
2494
+ team_id?: string;
2495
+ }[];
2496
+ }, params?: RequestParams) => Promise<HttpResponse<{
2497
+ synced: OrganizationDirectorySyncGroupTeamStatus[];
2498
+ }, Error>>;
2499
+ };
2500
+ urls: {
2501
+ /**
2502
+ * No description
2503
+ *
2504
+ * @tags urls
2505
+ * @name GetContentByUrl
2506
+ * @summary Resolve a URL to a content (space, collection, page)
2507
+ * @request GET:/urls/content
2508
+ * @secure
2509
+ */
2510
+ getContentByUrl: (query: {
2511
+ url: string;
2512
+ }, params?: RequestParams) => Promise<HttpResponse<{
2513
+ collection: Collection;
2514
+ } | {
2515
+ space: Space;
2516
+ changeRequest?: ChangeRequest;
2517
+ page?: RevisionPageSheet | RevisionPageGroup;
2518
+ }, Error>>;
317
2519
  };
318
2520
  }
319
2521
  export {};