@growi/sdk-typescript 1.2.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -988,30 +988,6 @@ export interface LikeParams {
988
988
  bool?: boolean;
989
989
  }
990
990
 
991
- /**
992
- * PageInfo
993
- */
994
- export interface PageInfo {
995
- /** Whether the page is liked by the logged in user */
996
- isLiked?: boolean;
997
- /** Number of users who have liked the page */
998
- sumOfLikers: number;
999
- /** Ids of users who have liked the page */
1000
- likerIds: string[];
1001
- /** Number of users who have seen the page */
1002
- sumOfSeenUsers: number;
1003
- /** Ids of users who have seen the page */
1004
- seenUserIds: string[];
1005
- }
1006
-
1007
- /**
1008
- * PageParams
1009
- */
1010
- export interface PageParams {
1011
- /** page ID */
1012
- pageId: string;
1013
- }
1014
-
1015
991
  /**
1016
992
  * personal settings
1017
993
  */
@@ -1476,6 +1452,89 @@ export type PagePath = string;
1476
1452
  */
1477
1453
  export type PageGrant = number;
1478
1454
 
1455
+ /**
1456
+ * Basic page information
1457
+ */
1458
+ export interface PageInfo {
1459
+ /** Whether the page is compatible with v5 */
1460
+ isV5Compatible?: boolean;
1461
+ /** Whether the page is empty */
1462
+ isEmpty?: boolean;
1463
+ /** Whether the page is movable */
1464
+ isMovable?: boolean;
1465
+ /** Whether the page is deletable */
1466
+ isDeletable?: boolean;
1467
+ /** Whether the page is able to delete completely */
1468
+ isAbleToDeleteCompletely?: boolean;
1469
+ /** Whether the page is revertible */
1470
+ isRevertible?: boolean;
1471
+ }
1472
+
1473
+ export type PageInfoForEntityAllOf = {
1474
+ /** Number of bookmarks */
1475
+ bookmarkCount?: number;
1476
+ /** Number of users who have liked the page */
1477
+ sumOfLikers?: number;
1478
+ /** Ids of users who have liked the page */
1479
+ likerIds?: string[];
1480
+ /** Number of users who have seen the page */
1481
+ sumOfSeenUsers?: number;
1482
+ /** Ids of users who have seen the page */
1483
+ seenUserIds?: string[];
1484
+ /** Content age */
1485
+ contentAge?: number;
1486
+ /** Number of descendant pages */
1487
+ descendantCount?: number;
1488
+ /** Number of comments */
1489
+ commentCount?: number;
1490
+ };
1491
+
1492
+ /**
1493
+ * Page information for entity (extends IPageInfo)
1494
+ */
1495
+ export type PageInfoForEntity = PageInfo & PageInfoForEntityAllOf;
1496
+
1497
+ /**
1498
+ * Subscription status
1499
+ */
1500
+ export type PageInfoForOperationAllOfSubscriptionStatus =
1501
+ (typeof PageInfoForOperationAllOfSubscriptionStatus)[keyof typeof PageInfoForOperationAllOfSubscriptionStatus];
1502
+
1503
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
1504
+ export const PageInfoForOperationAllOfSubscriptionStatus = {
1505
+ SUBSCRIBE: 'SUBSCRIBE',
1506
+ UNSUBSCRIBE: 'UNSUBSCRIBE',
1507
+ } as const;
1508
+
1509
+ export type PageInfoForOperationAllOf = {
1510
+ /** Whether the page is bookmarked by the logged in user */
1511
+ isBookmarked?: boolean;
1512
+ /** Whether the page is liked by the logged in user */
1513
+ isLiked?: boolean;
1514
+ /** Subscription status */
1515
+ subscriptionStatus?: PageInfoForOperationAllOfSubscriptionStatus;
1516
+ };
1517
+
1518
+ /**
1519
+ * Page information for operation (extends IPageInfoForEntity)
1520
+ */
1521
+ export type PageInfoForOperation = PageInfoForEntity & PageInfoForOperationAllOf;
1522
+
1523
+ export type PageInfoForListingAllOf = {
1524
+ /** Short body of the revision */
1525
+ revisionShortBody?: string;
1526
+ };
1527
+
1528
+ /**
1529
+ * Page information for listing (extends IPageInfoForEntity with revision short body)
1530
+ */
1531
+ export type PageInfoForListing = PageInfoForEntity & PageInfoForListingAllOf;
1532
+
1533
+ /**
1534
+ * Page information (union of all page info types)
1535
+ */
1536
+ export type PageInfoAll = PageInfo | PageInfoForEntity | PageInfoForOperation | PageInfoForListing;
1537
+
1479
1538
  /**
1480
1539
  * extend data
1481
1540
  */
@@ -2577,33 +2636,19 @@ export type GetChildrenForPageListing200 = {
2577
2636
  };
2578
2637
 
2579
2638
  export type GetInfoForPageListingParams = {
2639
+ /**
2640
+ * Array of page IDs to retrieve information for (One of pageIds or path is required)
2641
+ */
2580
2642
  pageIds?: string[];
2643
+ /**
2644
+ * Path of the page to retrieve information for (One of pageIds or path is required)
2645
+ */
2581
2646
  path?: string;
2582
2647
  attachBookmarkCount?: boolean;
2583
2648
  attachShortBody?: boolean;
2584
2649
  };
2585
2650
 
2586
- export type GetInfoForPageListing200IdToPageInfoMap = {
2587
- [key: string]: {
2588
- commentCount?: number;
2589
- contentAge?: number;
2590
- descendantCount?: number;
2591
- isAbleToDeleteCompletely?: boolean;
2592
- isDeletable?: boolean;
2593
- isEmpty?: boolean;
2594
- isMovable?: boolean;
2595
- isRevertible?: boolean;
2596
- isV5Compatible?: boolean;
2597
- likerIds?: string[];
2598
- seenUserIds?: string[];
2599
- sumOfLikers?: number;
2600
- sumOfSeenUsers?: number;
2601
- };
2602
- };
2603
-
2604
- export type GetInfoForPageListing200 = {
2605
- idToPageInfoMap?: GetInfoForPageListing200IdToPageInfoMap;
2606
- };
2651
+ export type GetInfoForPageListing200 = { [key: string]: PageInfoAll };
2607
2652
 
2608
2653
  export type GetPageParams = {
2609
2654
  /**
@@ -2674,6 +2719,13 @@ export type GetExistForPage200 = {
2674
2719
  isExist?: boolean;
2675
2720
  };
2676
2721
 
2722
+ export type GetInfoForPageParams = {
2723
+ /**
2724
+ * page id
2725
+ */
2726
+ pageId: ObjectId;
2727
+ };
2728
+
2677
2729
  export type GetGrantDataForPageParams = {
2678
2730
  /**
2679
2731
  * page id
@@ -2792,7 +2844,7 @@ export type GetRecentForPagesParams = {
2792
2844
  includeWipPage?: string;
2793
2845
  };
2794
2846
 
2795
- export type PostRenameForPagesBody = {
2847
+ export type PutRenameForPagesBody = {
2796
2848
  pageId: ObjectId;
2797
2849
  path?: PagePath;
2798
2850
  /** revision ID */
@@ -2807,7 +2859,7 @@ export type PostRenameForPagesBody = {
2807
2859
  isRecursively?: boolean;
2808
2860
  };
2809
2861
 
2810
- export type PostRenameForPages200 = {
2862
+ export type PutRenameForPages200 = {
2811
2863
  page?: Page;
2812
2864
  };
2813
2865
 
@@ -91,6 +91,7 @@ import type {
91
91
  GetInfoForBookmarksParams,
92
92
  GetInfoForPageListing200,
93
93
  GetInfoForPageListingParams,
94
+ GetInfoForPageParams,
94
95
  GetIsEnabledForQuestionnaire200,
95
96
  GetIsPasswordSetForPersonalSetting200,
96
97
  GetLimitForAttachment200,
@@ -166,8 +167,7 @@ import type {
166
167
  NotifyForPageGrant,
167
168
  OidcAuthSetting,
168
169
  Page,
169
- PageInfo,
170
- PageParams,
170
+ PageInfoAll,
171
171
  PersonalSettings,
172
172
  PostAddBookmarkToFolderForBookmarkFolder200,
173
173
  PostAddBookmarkToFolderForBookmarkFolderBody,
@@ -227,8 +227,6 @@ import type {
227
227
  PostRegister200,
228
228
  PostRegisterBody,
229
229
  PostRelationTestByIdForSlackIntegrationSettingsSlackAppIntegrationsBody,
230
- PostRenameForPages200,
231
- PostRenameForPagesBody,
232
230
  PostResumeRenameForPages200,
233
231
  PostResumeRenameForPagesBody,
234
232
  PostShareLinksParams,
@@ -314,6 +312,8 @@ import type {
314
312
  PutQuestionnaireSettingsForPersonalSetting200,
315
313
  PutQuestionnaireSettingsForPersonalSettingBody,
316
314
  PutRegenerateTokensByIdForSlackIntegrationSettingsSlackAppIntegrations200,
315
+ PutRenameForPages200,
316
+ PutRenameForPagesBody,
317
317
  PutResetPasswordEmailForUsersBody,
318
318
  PutResetPasswordForUsers200,
319
319
  PutResetPasswordForUsersBody,
@@ -1489,7 +1489,7 @@ export const getGrowirestapiv3 = () => {
1489
1489
  };
1490
1490
 
1491
1491
  /**
1492
- * Get the information of a page
1492
+ * Get summary information of pages
1493
1493
  * @summary /page-listing/info
1494
1494
  */
1495
1495
  const getInfoForPageListing = (params?: GetInfoForPageListingParams, options?: SecondParameter<typeof customInstance>) => {
@@ -1536,11 +1536,11 @@ export const getGrowirestapiv3 = () => {
1536
1536
  };
1537
1537
 
1538
1538
  /**
1539
- * Retrieve current page info
1540
- * @summary Get page info
1539
+ * Get summary informations for a page
1540
+ * @summary /page/info
1541
1541
  */
1542
- const getInfoForPage = (pageParams: PageParams, options?: SecondParameter<typeof customInstance>) => {
1543
- return customInstance<PageInfo>({ url: `/page/info`, method: 'GET', headers: { 'Content-Type': 'application/json' } }, options);
1542
+ const getInfoForPage = (params: GetInfoForPageParams, options?: SecondParameter<typeof customInstance>) => {
1543
+ return customInstance<PageInfoAll>({ url: `/page/info`, method: 'GET', params }, options);
1544
1544
  };
1545
1545
 
1546
1546
  /**
@@ -1673,9 +1673,9 @@ export const getGrowirestapiv3 = () => {
1673
1673
  /**
1674
1674
  * Rename page
1675
1675
  */
1676
- const postRenameForPages = (postRenameForPagesBody: PostRenameForPagesBody, options?: SecondParameter<typeof customInstance>) => {
1677
- return customInstance<PostRenameForPages200>(
1678
- { url: `/pages/rename`, method: 'POST', headers: { 'Content-Type': 'application/json' }, data: postRenameForPagesBody },
1676
+ const putRenameForPages = (putRenameForPagesBody: PutRenameForPagesBody, options?: SecondParameter<typeof customInstance>) => {
1677
+ return customInstance<PutRenameForPages200>(
1678
+ { url: `/pages/rename`, method: 'PUT', headers: { 'Content-Type': 'application/json' }, data: putRenameForPagesBody },
1679
1679
  options,
1680
1680
  );
1681
1681
  };
@@ -2965,7 +2965,7 @@ export const getGrowirestapiv3 = () => {
2965
2965
  getYjsDataByPageId,
2966
2966
  putSyncLatestRevisionBodyToYjsDraftByPageId,
2967
2967
  getRecentForPages,
2968
- postRenameForPages,
2968
+ putRenameForPages,
2969
2969
  postResumeRenameForPages,
2970
2970
  deleteEmptyTrashForPages,
2971
2971
  getListForPages,
@@ -3285,7 +3285,7 @@ export type PutSyncLatestRevisionBodyToYjsDraftByPageIdResult = NonNullable<
3285
3285
  Awaited<ReturnType<ReturnType<typeof getGrowirestapiv3>['putSyncLatestRevisionBodyToYjsDraftByPageId']>>
3286
3286
  >;
3287
3287
  export type GetRecentForPagesResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getGrowirestapiv3>['getRecentForPages']>>>;
3288
- export type PostRenameForPagesResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getGrowirestapiv3>['postRenameForPages']>>>;
3288
+ export type PutRenameForPagesResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getGrowirestapiv3>['putRenameForPages']>>>;
3289
3289
  export type PostResumeRenameForPagesResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getGrowirestapiv3>['postResumeRenameForPages']>>>;
3290
3290
  export type DeleteEmptyTrashForPagesResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getGrowirestapiv3>['deleteEmptyTrashForPages']>>>;
3291
3291
  export type GetListForPagesResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getGrowirestapiv3>['getListForPages']>>>;