@growi/core 1.2.0 → 1.3.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/index.cjs +1 -1
- package/dist/index.js +31 -33
- package/dist/index.js.map +1 -1
- package/dist/interfaces/index.cjs +1 -1
- package/dist/interfaces/index.js +23 -25
- package/dist/interfaces/index.js.map +1 -1
- package/dist/interfaces/locale.cjs +1 -1
- package/dist/interfaces/locale.cjs.map +1 -1
- package/dist/interfaces/locale.d.ts +1 -8
- package/dist/interfaces/locale.js +1 -10
- package/dist/interfaces/locale.js.map +1 -1
- package/dist/interfaces/page.cjs +1 -1
- package/dist/interfaces/page.cjs.map +1 -1
- package/dist/interfaces/page.d.ts +1 -0
- package/dist/interfaces/page.js +9 -8
- package/dist/interfaces/page.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./consts/accepted-upload-file-type.cjs"),s=require("./consts/growi-plugin.cjs"),u=require("./consts/ydoc-status.cjs"),c=require("./interfaces/color-scheme.cjs"),i=require("./interfaces/common.cjs"),g=require("./interfaces/external-account.cjs"),r=require("./interfaces/growi-theme-metadata.cjs"),t=require("./interfaces/lang.cjs"),e=require("./interfaces/page.cjs"),o=require("./interfaces/revision.cjs"),n=require("./interfaces/subscription.cjs"),p=require("./interfaces/user.cjs");exports.AcceptedUploadFileType=a.AcceptedUploadFileType;exports.GrowiPluginType=s.GrowiPluginType;exports.YDocStatus=u.YDocStatus;exports.ColorScheme=c.ColorScheme;exports.getIdForRef=i.getIdForRef;exports.getIdStringForRef=i.getIdStringForRef;exports.isPopulated=i.isPopulated;exports.isRef=i.isRef;exports.IExternalAuthProviderType=g.IExternalAuthProviderType;exports.GrowiThemeSchemeType=r.GrowiThemeSchemeType;exports.isGrowiThemeMetadata=r.isGrowiThemeMetadata;exports.AllLang=t.AllLang;exports.Lang=t.Lang;exports.GroupType=e.GroupType;exports.PageGrant=e.PageGrant;exports.PageStatus=e.PageStatus;exports.isIPageInfo=e.isIPageInfo;exports.isIPageInfoForEntity=e.isIPageInfoForEntity;exports.isIPageInfoForListing=e.isIPageInfoForListing;exports.isIPageInfoForOperation=e.isIPageInfoForOperation;exports.Origin=o.Origin;exports.allOrigin=o.allOrigin;exports.AllSubscriptionStatusType=n.AllSubscriptionStatusType;exports.SubscriptionStatusType=n.SubscriptionStatusType;exports.USER_STATUS=p.USER_STATUS;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -1,42 +1,40 @@
|
|
|
1
1
|
import { AcceptedUploadFileType as r } from "./consts/accepted-upload-file-type.js";
|
|
2
|
-
import { GrowiPluginType as
|
|
2
|
+
import { GrowiPluginType as i } from "./consts/growi-plugin.js";
|
|
3
3
|
import { YDocStatus as a } from "./consts/ydoc-status.js";
|
|
4
|
-
import { ColorScheme as
|
|
5
|
-
import { getIdForRef as
|
|
6
|
-
import { IExternalAuthProviderType as
|
|
7
|
-
import { GrowiThemeSchemeType as
|
|
8
|
-
import { AllLang as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { USER_STATUS as j } from "./interfaces/user.js";
|
|
4
|
+
import { ColorScheme as n } from "./interfaces/color-scheme.js";
|
|
5
|
+
import { getIdForRef as g, getIdStringForRef as s, isPopulated as x, isRef as l } from "./interfaces/common.js";
|
|
6
|
+
import { IExternalAuthProviderType as I } from "./interfaces/external-account.js";
|
|
7
|
+
import { GrowiThemeSchemeType as u, isGrowiThemeMetadata as P } from "./interfaces/growi-theme-metadata.js";
|
|
8
|
+
import { AllLang as c, Lang as d } from "./interfaces/lang.js";
|
|
9
|
+
import { GroupType as h, PageGrant as A, PageStatus as G, isIPageInfo as R, isIPageInfoForEntity as w, isIPageInfoForListing as E, isIPageInfoForOperation as L } from "./interfaces/page.js";
|
|
10
|
+
import { Origin as U, allOrigin as b } from "./interfaces/revision.js";
|
|
11
|
+
import { AllSubscriptionStatusType as C, SubscriptionStatusType as D } from "./interfaces/subscription.js";
|
|
12
|
+
import { USER_STATUS as Y } from "./interfaces/user.js";
|
|
14
13
|
export {
|
|
15
14
|
r as AcceptedUploadFileType,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
T as IExternalAuthProviderType,
|
|
15
|
+
c as AllLang,
|
|
16
|
+
C as AllSubscriptionStatusType,
|
|
17
|
+
n as ColorScheme,
|
|
18
|
+
h as GroupType,
|
|
19
|
+
i as GrowiPluginType,
|
|
20
|
+
u as GrowiThemeSchemeType,
|
|
21
|
+
I as IExternalAuthProviderType,
|
|
24
22
|
d as Lang,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
Y as
|
|
30
|
-
j as USER_STATUS,
|
|
23
|
+
U as Origin,
|
|
24
|
+
A as PageGrant,
|
|
25
|
+
G as PageStatus,
|
|
26
|
+
D as SubscriptionStatusType,
|
|
27
|
+
Y as USER_STATUS,
|
|
31
28
|
a as YDocStatus,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
b as allOrigin,
|
|
30
|
+
g as getIdForRef,
|
|
31
|
+
s as getIdStringForRef,
|
|
32
|
+
P as isGrowiThemeMetadata,
|
|
33
|
+
R as isIPageInfo,
|
|
34
|
+
w as isIPageInfoForEntity,
|
|
35
|
+
E as isIPageInfoForListing,
|
|
36
|
+
L as isIPageInfoForOperation,
|
|
39
37
|
x as isPopulated,
|
|
40
|
-
|
|
38
|
+
l as isRef
|
|
41
39
|
};
|
|
42
40
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./color-scheme.cjs"),r=require("./common.cjs"),s=require("./external-account.cjs"),i=require("./growi-theme-metadata.cjs"),t=require("./lang.cjs"),e=require("./page.cjs"),o=require("./revision.cjs"),n=require("./subscription.cjs"),g=require("./user.cjs");exports.ColorScheme=a.ColorScheme;exports.getIdForRef=r.getIdForRef;exports.getIdStringForRef=r.getIdStringForRef;exports.isPopulated=r.isPopulated;exports.isRef=r.isRef;exports.IExternalAuthProviderType=s.IExternalAuthProviderType;exports.GrowiThemeSchemeType=i.GrowiThemeSchemeType;exports.isGrowiThemeMetadata=i.isGrowiThemeMetadata;exports.AllLang=t.AllLang;exports.Lang=t.Lang;exports.GroupType=e.GroupType;exports.PageGrant=e.PageGrant;exports.PageStatus=e.PageStatus;exports.isIPageInfo=e.isIPageInfo;exports.isIPageInfoForEntity=e.isIPageInfoForEntity;exports.isIPageInfoForListing=e.isIPageInfoForListing;exports.isIPageInfoForOperation=e.isIPageInfoForOperation;exports.Origin=o.Origin;exports.allOrigin=o.allOrigin;exports.AllSubscriptionStatusType=n.AllSubscriptionStatusType;exports.SubscriptionStatusType=n.SubscriptionStatusType;exports.USER_STATUS=g.USER_STATUS;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/interfaces/index.js
CHANGED
|
@@ -1,35 +1,33 @@
|
|
|
1
1
|
import { ColorScheme as r } from "./color-scheme.js";
|
|
2
2
|
import { getIdForRef as i, getIdStringForRef as a, isPopulated as p, isRef as f } from "./common.js";
|
|
3
|
-
import { IExternalAuthProviderType as
|
|
4
|
-
import { GrowiThemeSchemeType as
|
|
5
|
-
import { AllLang as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { USER_STATUS as v } from "./user.js";
|
|
3
|
+
import { IExternalAuthProviderType as g } from "./external-account.js";
|
|
4
|
+
import { GrowiThemeSchemeType as s, isGrowiThemeMetadata as I } from "./growi-theme-metadata.js";
|
|
5
|
+
import { AllLang as x, Lang as l } from "./lang.js";
|
|
6
|
+
import { GroupType as u, PageGrant as P, PageStatus as y, isIPageInfo as d, isIPageInfoForEntity as h, isIPageInfoForListing as F, isIPageInfoForOperation as c } from "./page.js";
|
|
7
|
+
import { Origin as G, allOrigin as R } from "./revision.js";
|
|
8
|
+
import { AllSubscriptionStatusType as L, SubscriptionStatusType as O } from "./subscription.js";
|
|
9
|
+
import { USER_STATUS as w } from "./user.js";
|
|
11
10
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
b as AllSubscriptionStatusType,
|
|
11
|
+
x as AllLang,
|
|
12
|
+
L as AllSubscriptionStatusType,
|
|
15
13
|
r as ColorScheme,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
w as
|
|
25
|
-
|
|
26
|
-
E as allOrigin,
|
|
14
|
+
u as GroupType,
|
|
15
|
+
s as GrowiThemeSchemeType,
|
|
16
|
+
g as IExternalAuthProviderType,
|
|
17
|
+
l as Lang,
|
|
18
|
+
G as Origin,
|
|
19
|
+
P as PageGrant,
|
|
20
|
+
y as PageStatus,
|
|
21
|
+
O as SubscriptionStatusType,
|
|
22
|
+
w as USER_STATUS,
|
|
23
|
+
R as allOrigin,
|
|
27
24
|
i as getIdForRef,
|
|
28
25
|
a as getIdStringForRef,
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
I as isGrowiThemeMetadata,
|
|
27
|
+
d as isIPageInfo,
|
|
28
|
+
h as isIPageInfoForEntity,
|
|
31
29
|
F as isIPageInfoForListing,
|
|
32
|
-
|
|
30
|
+
c as isIPageInfoForOperation,
|
|
33
31
|
p as isPopulated,
|
|
34
32
|
f as isRef
|
|
35
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
2
|
//# sourceMappingURL=locale.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale.cjs","sources":[
|
|
1
|
+
{"version":3,"file":"locale.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
readonly 'en-US': "en-US";
|
|
3
|
-
readonly 'ja-JP': "ja-JP";
|
|
4
|
-
readonly 'zh-CN': "zh-CN";
|
|
5
|
-
readonly 'fr-FR': "fr-FR";
|
|
6
|
-
};
|
|
7
|
-
export declare const AllLocale: ("en-US" | "ja-JP" | "zh-CN" | "fr-FR")[];
|
|
8
|
-
export type Locale = typeof Locale[keyof typeof Locale];
|
|
1
|
+
export type Locale = 'en-US' | 'ja-JP' | 'zh-CN' | 'fr-FR';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale.js","sources":[
|
|
1
|
+
{"version":3,"file":"locale.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/interfaces/page.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s={userGroup:"UserGroup",externalUserGroup:"ExternalUserGroup"},i={GRANT_PUBLIC:1,GRANT_RESTRICTED:2,GRANT_SPECIFIED:3,GRANT_OWNER:4,GRANT_USER_GROUP:5},n={STATUS_PUBLISHED:"published",STATUS_DELETED:"deleted"},e=t=>t!=null&&t instanceof Object&&"isEmpty"in t,r=t=>e(t)&&t.isEmpty===!1,o=t=>r(t)&&("isBookmarked"in t||"isLiked"in t||"subscriptionStatus"in t),u=t=>r(t)&&"revisionShortBody"in t;exports.GroupType=s;exports.PageGrant=i;exports.PageStatus=n;exports.isIPageInfo=e;exports.isIPageInfoForEntity=r;exports.isIPageInfoForListing=u;exports.isIPageInfoForOperation=o;
|
|
2
2
|
//# sourceMappingURL=page.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.cjs","sources":["../../src/interfaces/page.ts"],"sourcesContent":["import type { Ref } from './common';\nimport type { HasObjectId } from './has-object-id';\nimport type { IRevision, HasRevisionShortbody, IRevisionHasId } from './revision';\nimport type { SubscriptionStatusType } from './subscription';\nimport type { ITag } from './tag';\nimport type {\n IUser, IUserGroup, IUserGroupHasId, IUserHasId,\n} from './user';\n\nexport const GroupType = { userGroup: 'UserGroup', externalUserGroup: 'ExternalUserGroup' } as const;\nexport type GroupType = typeof GroupType[keyof typeof GroupType];\n\nexport type IGrantedGroup = {\n type: GroupType,\n item: Ref<IUserGroup>,\n}\n\nexport type IPage = {\n path: string,\n status: string,\n revision?: Ref<IRevision>,\n tags: Ref<ITag>[],\n creator?: Ref<IUser>,\n createdAt: Date,\n updatedAt: Date,\n seenUsers: Ref<IUser>[],\n parent: Ref<IPage> | null,\n descendantCount: number,\n isEmpty: boolean,\n grant: PageGrant,\n grantedUsers: Ref<IUser>[],\n grantedGroups: IGrantedGroup[],\n lastUpdateUser?: Ref<IUser>,\n liker: Ref<IUser>[],\n commentCount: number\n slackChannels: string,\n deleteUser: Ref<IUser>,\n deletedAt: Date,\n latestRevision?: Ref<IRevision>,\n latestRevisionBodyLength?: number,\n expandContentWidth?: boolean,\n wip?: boolean,\n ttlTimestamp?: Date\n}\n\nexport type IPagePopulatedToShowRevision = Omit<IPageHasId, 'lastUpdateUser'|'creator'|'deleteUser'|'grantedGroups'|'revision'|'author'> & {\n lastUpdateUser?: IUserHasId,\n creator?: IUserHasId,\n deleteUser: IUserHasId,\n grantedGroups: { type: GroupType, item: IUserGroupHasId }[],\n revision?: IRevisionHasId,\n author: IUserHasId,\n}\n\nexport const PageGrant = {\n GRANT_PUBLIC: 1,\n GRANT_RESTRICTED: 2,\n GRANT_SPECIFIED: 3, // DEPRECATED\n GRANT_OWNER: 4,\n GRANT_USER_GROUP: 5,\n} as const;\ntype UnionPageGrantKeys = keyof typeof PageGrant;\nexport type PageGrant = typeof PageGrant[UnionPageGrantKeys];\n\nexport const PageStatus = {\n STATUS_PUBLISHED: 'published',\n STATUS_DELETED: 'deleted',\n} as const;\nexport type PageStatus = typeof PageStatus[keyof typeof PageStatus];\n\nexport type IPageHasId = IPage & HasObjectId;\n\nexport type IPageInfo = {\n isV5Compatible: boolean,\n isEmpty: boolean,\n isMovable: boolean,\n isDeletable: boolean,\n isAbleToDeleteCompletely: boolean,\n isRevertible: boolean,\n}\n\nexport type IPageInfoForEntity = IPageInfo & {\n bookmarkCount: number,\n sumOfLikers: number,\n likerIds: string[],\n sumOfSeenUsers: number,\n seenUserIds: string[],\n contentAge: number,\n descendantCount: number,\n commentCount: number,\n}\n\nexport type IPageInfoForOperation = IPageInfoForEntity & {\n isBookmarked?: boolean,\n isLiked?: boolean,\n subscriptionStatus?: SubscriptionStatusType,\n}\n\nexport type IPageInfoForListing = IPageInfoForEntity & HasRevisionShortbody;\n\nexport type IPageInfoAll = IPageInfo | IPageInfoForEntity | IPageInfoForOperation | IPageInfoForListing;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const
|
|
1
|
+
{"version":3,"file":"page.cjs","sources":["../../src/interfaces/page.ts"],"sourcesContent":["import type { Ref } from './common';\nimport type { HasObjectId } from './has-object-id';\nimport type { IRevision, HasRevisionShortbody, IRevisionHasId } from './revision';\nimport type { SubscriptionStatusType } from './subscription';\nimport type { ITag } from './tag';\nimport type {\n IUser, IUserGroup, IUserGroupHasId, IUserHasId,\n} from './user';\n\nexport const GroupType = { userGroup: 'UserGroup', externalUserGroup: 'ExternalUserGroup' } as const;\nexport type GroupType = typeof GroupType[keyof typeof GroupType];\n\nexport type IGrantedGroup = {\n type: GroupType,\n item: Ref<IUserGroup>,\n}\n\nexport type IPage = {\n path: string,\n status: string,\n revision?: Ref<IRevision>,\n tags: Ref<ITag>[],\n creator?: Ref<IUser>,\n createdAt: Date,\n updatedAt: Date,\n seenUsers: Ref<IUser>[],\n parent: Ref<IPage> | null,\n descendantCount: number,\n isEmpty: boolean,\n grant: PageGrant,\n grantedUsers: Ref<IUser>[],\n grantedGroups: IGrantedGroup[],\n lastUpdateUser?: Ref<IUser>,\n liker: Ref<IUser>[],\n commentCount: number\n slackChannels: string,\n deleteUser: Ref<IUser>,\n deletedAt: Date,\n latestRevision?: Ref<IRevision>,\n latestRevisionBodyLength?: number,\n expandContentWidth?: boolean,\n wip?: boolean,\n ttlTimestamp?: Date\n}\n\nexport type IPagePopulatedToShowRevision = Omit<IPageHasId, 'lastUpdateUser'|'creator'|'deleteUser'|'grantedGroups'|'revision'|'author'> & {\n lastUpdateUser?: IUserHasId,\n creator?: IUserHasId,\n deleteUser: IUserHasId,\n grantedGroups: { type: GroupType, item: IUserGroupHasId }[],\n revision?: IRevisionHasId,\n author: IUserHasId,\n}\n\nexport const PageGrant = {\n GRANT_PUBLIC: 1,\n GRANT_RESTRICTED: 2,\n GRANT_SPECIFIED: 3, // DEPRECATED\n GRANT_OWNER: 4,\n GRANT_USER_GROUP: 5,\n} as const;\ntype UnionPageGrantKeys = keyof typeof PageGrant;\nexport type PageGrant = typeof PageGrant[UnionPageGrantKeys];\n\nexport const PageStatus = {\n STATUS_PUBLISHED: 'published',\n STATUS_DELETED: 'deleted',\n} as const;\nexport type PageStatus = typeof PageStatus[keyof typeof PageStatus];\n\nexport type IPageHasId = IPage & HasObjectId;\n\nexport type IPageInfo = {\n isV5Compatible: boolean,\n isEmpty: boolean,\n isMovable: boolean,\n isDeletable: boolean,\n isAbleToDeleteCompletely: boolean,\n isRevertible: boolean,\n}\n\nexport type IPageInfoForEntity = IPageInfo & {\n bookmarkCount: number,\n sumOfLikers: number,\n likerIds: string[],\n sumOfSeenUsers: number,\n seenUserIds: string[],\n contentAge: number,\n descendantCount: number,\n commentCount: number,\n}\n\nexport type IPageInfoForOperation = IPageInfoForEntity & {\n isBookmarked?: boolean,\n isLiked?: boolean,\n subscriptionStatus?: SubscriptionStatusType,\n}\n\nexport type IPageInfoForListing = IPageInfoForEntity & HasRevisionShortbody;\n\nexport type IPageInfoAll = IPageInfo | IPageInfoForEntity | IPageInfoForOperation | IPageInfoForListing;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isIPageInfo = (pageInfo: any | undefined): pageInfo is IPageInfo => {\n return pageInfo != null && pageInfo instanceof Object\n && ('isEmpty' in pageInfo);\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isIPageInfoForEntity = (pageInfo: any | undefined): pageInfo is IPageInfoForEntity => {\n return isIPageInfo(pageInfo)\n && pageInfo.isEmpty === false;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isIPageInfoForOperation = (pageInfo: any | undefined): pageInfo is IPageInfoForOperation => {\n return isIPageInfoForEntity(pageInfo)\n && ('isBookmarked' in pageInfo || 'isLiked' in pageInfo || 'subscriptionStatus' in pageInfo);\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isIPageInfoForListing = (pageInfo: any | undefined): pageInfo is IPageInfoForListing => {\n return isIPageInfoForEntity(pageInfo)\n && 'revisionShortBody' in pageInfo;\n};\n\n// export type IPageInfoTypeResolver<T extends IPageInfo> =\n// T extends HasRevisionShortbody ? IPageInfoForListing :\n// T extends { isBookmarked?: boolean } | { isLiked?: boolean } | { subscriptionStatus?: SubscriptionStatusType } ? IPageInfoForOperation :\n// T extends { bookmarkCount: number } ? IPageInfoForEntity :\n// T extends { isEmpty: number } ? IPageInfo :\n// T;\n\n/**\n * Union Distribution\n * @param pageInfo\n * @returns\n */\n// export const resolvePageInfo = <T extends IPageInfo>(pageInfo: T | undefined): IPageInfoTypeResolver<T> => {\n// return <IPageInfoTypeResolver<T>>pageInfo;\n// };\n\nexport type IDataWithMeta<D = unknown, M = unknown> = {\n data: D,\n meta?: M,\n}\n\nexport type IPageWithMeta<M = IPageInfoAll> = IDataWithMeta<IPageHasId, M>;\n\nexport type IPageToDeleteWithMeta<T = IPageInfoForEntity | unknown> = IDataWithMeta<HasObjectId & (IPage | { path: string, revision: string | null}), T>;\nexport type IPageToRenameWithMeta<T = IPageInfoForEntity | unknown> = IPageToDeleteWithMeta<T>;\n"],"names":["GroupType","PageGrant","PageStatus","isIPageInfo","pageInfo","isIPageInfoForEntity","isIPageInfoForOperation","isIPageInfoForListing"],"mappings":"gFASO,MAAMA,EAAY,CAAE,UAAW,YAAa,kBAAmB,mBAAoB,EA6C7EC,EAAY,CACvB,aAAc,EACd,iBAAkB,EAClB,gBAAiB,EACjB,YAAa,EACb,iBAAkB,CACpB,EAIaC,EAAa,CACxB,iBAAkB,YAClB,eAAgB,SAClB,EAoCaC,EAAeC,GACnBA,GAAY,MAAQA,aAAoB,QACzC,YAAaA,EAIRC,EAAwBD,GAC5BD,EAAYC,CAAQ,GACtBA,EAAS,UAAY,GAIfE,EAA2BF,GAC/BC,EAAqBD,CAAQ,IAC9B,iBAAkBA,GAAY,YAAaA,GAAY,uBAAwBA,GAI1EG,EAAyBH,GAC7BC,EAAqBD,CAAQ,GAC/B,sBAAuBA"}
|
|
@@ -92,6 +92,7 @@ export type IPageInfoForOperation = IPageInfoForEntity & {
|
|
|
92
92
|
};
|
|
93
93
|
export type IPageInfoForListing = IPageInfoForEntity & HasRevisionShortbody;
|
|
94
94
|
export type IPageInfoAll = IPageInfo | IPageInfoForEntity | IPageInfoForOperation | IPageInfoForListing;
|
|
95
|
+
export declare const isIPageInfo: (pageInfo: any | undefined) => pageInfo is IPageInfo;
|
|
95
96
|
export declare const isIPageInfoForEntity: (pageInfo: any | undefined) => pageInfo is IPageInfoForEntity;
|
|
96
97
|
export declare const isIPageInfoForOperation: (pageInfo: any | undefined) => pageInfo is IPageInfoForOperation;
|
|
97
98
|
export declare const isIPageInfoForListing: (pageInfo: any | undefined) => pageInfo is IPageInfoForListing;
|
package/dist/interfaces/page.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
const
|
|
1
|
+
const i = { userGroup: "UserGroup", externalUserGroup: "ExternalUserGroup" }, n = {
|
|
2
2
|
GRANT_PUBLIC: 1,
|
|
3
3
|
GRANT_RESTRICTED: 2,
|
|
4
4
|
GRANT_SPECIFIED: 3,
|
|
5
5
|
// DEPRECATED
|
|
6
6
|
GRANT_OWNER: 4,
|
|
7
7
|
GRANT_USER_GROUP: 5
|
|
8
|
-
},
|
|
8
|
+
}, e = {
|
|
9
9
|
STATUS_PUBLISHED: "published",
|
|
10
10
|
STATUS_DELETED: "deleted"
|
|
11
|
-
},
|
|
11
|
+
}, s = (t) => t != null && t instanceof Object && "isEmpty" in t, r = (t) => s(t) && t.isEmpty === !1, o = (t) => r(t) && ("isBookmarked" in t || "isLiked" in t || "subscriptionStatus" in t), u = (t) => r(t) && "revisionShortBody" in t;
|
|
12
12
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
i as GroupType,
|
|
14
|
+
n as PageGrant,
|
|
15
|
+
e as PageStatus,
|
|
16
|
+
s as isIPageInfo,
|
|
16
17
|
r as isIPageInfoForEntity,
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
u as isIPageInfoForListing,
|
|
19
|
+
o as isIPageInfoForOperation
|
|
19
20
|
};
|
|
20
21
|
//# sourceMappingURL=page.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.js","sources":["../../src/interfaces/page.ts"],"sourcesContent":["import type { Ref } from './common';\nimport type { HasObjectId } from './has-object-id';\nimport type { IRevision, HasRevisionShortbody, IRevisionHasId } from './revision';\nimport type { SubscriptionStatusType } from './subscription';\nimport type { ITag } from './tag';\nimport type {\n IUser, IUserGroup, IUserGroupHasId, IUserHasId,\n} from './user';\n\nexport const GroupType = { userGroup: 'UserGroup', externalUserGroup: 'ExternalUserGroup' } as const;\nexport type GroupType = typeof GroupType[keyof typeof GroupType];\n\nexport type IGrantedGroup = {\n type: GroupType,\n item: Ref<IUserGroup>,\n}\n\nexport type IPage = {\n path: string,\n status: string,\n revision?: Ref<IRevision>,\n tags: Ref<ITag>[],\n creator?: Ref<IUser>,\n createdAt: Date,\n updatedAt: Date,\n seenUsers: Ref<IUser>[],\n parent: Ref<IPage> | null,\n descendantCount: number,\n isEmpty: boolean,\n grant: PageGrant,\n grantedUsers: Ref<IUser>[],\n grantedGroups: IGrantedGroup[],\n lastUpdateUser?: Ref<IUser>,\n liker: Ref<IUser>[],\n commentCount: number\n slackChannels: string,\n deleteUser: Ref<IUser>,\n deletedAt: Date,\n latestRevision?: Ref<IRevision>,\n latestRevisionBodyLength?: number,\n expandContentWidth?: boolean,\n wip?: boolean,\n ttlTimestamp?: Date\n}\n\nexport type IPagePopulatedToShowRevision = Omit<IPageHasId, 'lastUpdateUser'|'creator'|'deleteUser'|'grantedGroups'|'revision'|'author'> & {\n lastUpdateUser?: IUserHasId,\n creator?: IUserHasId,\n deleteUser: IUserHasId,\n grantedGroups: { type: GroupType, item: IUserGroupHasId }[],\n revision?: IRevisionHasId,\n author: IUserHasId,\n}\n\nexport const PageGrant = {\n GRANT_PUBLIC: 1,\n GRANT_RESTRICTED: 2,\n GRANT_SPECIFIED: 3, // DEPRECATED\n GRANT_OWNER: 4,\n GRANT_USER_GROUP: 5,\n} as const;\ntype UnionPageGrantKeys = keyof typeof PageGrant;\nexport type PageGrant = typeof PageGrant[UnionPageGrantKeys];\n\nexport const PageStatus = {\n STATUS_PUBLISHED: 'published',\n STATUS_DELETED: 'deleted',\n} as const;\nexport type PageStatus = typeof PageStatus[keyof typeof PageStatus];\n\nexport type IPageHasId = IPage & HasObjectId;\n\nexport type IPageInfo = {\n isV5Compatible: boolean,\n isEmpty: boolean,\n isMovable: boolean,\n isDeletable: boolean,\n isAbleToDeleteCompletely: boolean,\n isRevertible: boolean,\n}\n\nexport type IPageInfoForEntity = IPageInfo & {\n bookmarkCount: number,\n sumOfLikers: number,\n likerIds: string[],\n sumOfSeenUsers: number,\n seenUserIds: string[],\n contentAge: number,\n descendantCount: number,\n commentCount: number,\n}\n\nexport type IPageInfoForOperation = IPageInfoForEntity & {\n isBookmarked?: boolean,\n isLiked?: boolean,\n subscriptionStatus?: SubscriptionStatusType,\n}\n\nexport type IPageInfoForListing = IPageInfoForEntity & HasRevisionShortbody;\n\nexport type IPageInfoAll = IPageInfo | IPageInfoForEntity | IPageInfoForOperation | IPageInfoForListing;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const
|
|
1
|
+
{"version":3,"file":"page.js","sources":["../../src/interfaces/page.ts"],"sourcesContent":["import type { Ref } from './common';\nimport type { HasObjectId } from './has-object-id';\nimport type { IRevision, HasRevisionShortbody, IRevisionHasId } from './revision';\nimport type { SubscriptionStatusType } from './subscription';\nimport type { ITag } from './tag';\nimport type {\n IUser, IUserGroup, IUserGroupHasId, IUserHasId,\n} from './user';\n\nexport const GroupType = { userGroup: 'UserGroup', externalUserGroup: 'ExternalUserGroup' } as const;\nexport type GroupType = typeof GroupType[keyof typeof GroupType];\n\nexport type IGrantedGroup = {\n type: GroupType,\n item: Ref<IUserGroup>,\n}\n\nexport type IPage = {\n path: string,\n status: string,\n revision?: Ref<IRevision>,\n tags: Ref<ITag>[],\n creator?: Ref<IUser>,\n createdAt: Date,\n updatedAt: Date,\n seenUsers: Ref<IUser>[],\n parent: Ref<IPage> | null,\n descendantCount: number,\n isEmpty: boolean,\n grant: PageGrant,\n grantedUsers: Ref<IUser>[],\n grantedGroups: IGrantedGroup[],\n lastUpdateUser?: Ref<IUser>,\n liker: Ref<IUser>[],\n commentCount: number\n slackChannels: string,\n deleteUser: Ref<IUser>,\n deletedAt: Date,\n latestRevision?: Ref<IRevision>,\n latestRevisionBodyLength?: number,\n expandContentWidth?: boolean,\n wip?: boolean,\n ttlTimestamp?: Date\n}\n\nexport type IPagePopulatedToShowRevision = Omit<IPageHasId, 'lastUpdateUser'|'creator'|'deleteUser'|'grantedGroups'|'revision'|'author'> & {\n lastUpdateUser?: IUserHasId,\n creator?: IUserHasId,\n deleteUser: IUserHasId,\n grantedGroups: { type: GroupType, item: IUserGroupHasId }[],\n revision?: IRevisionHasId,\n author: IUserHasId,\n}\n\nexport const PageGrant = {\n GRANT_PUBLIC: 1,\n GRANT_RESTRICTED: 2,\n GRANT_SPECIFIED: 3, // DEPRECATED\n GRANT_OWNER: 4,\n GRANT_USER_GROUP: 5,\n} as const;\ntype UnionPageGrantKeys = keyof typeof PageGrant;\nexport type PageGrant = typeof PageGrant[UnionPageGrantKeys];\n\nexport const PageStatus = {\n STATUS_PUBLISHED: 'published',\n STATUS_DELETED: 'deleted',\n} as const;\nexport type PageStatus = typeof PageStatus[keyof typeof PageStatus];\n\nexport type IPageHasId = IPage & HasObjectId;\n\nexport type IPageInfo = {\n isV5Compatible: boolean,\n isEmpty: boolean,\n isMovable: boolean,\n isDeletable: boolean,\n isAbleToDeleteCompletely: boolean,\n isRevertible: boolean,\n}\n\nexport type IPageInfoForEntity = IPageInfo & {\n bookmarkCount: number,\n sumOfLikers: number,\n likerIds: string[],\n sumOfSeenUsers: number,\n seenUserIds: string[],\n contentAge: number,\n descendantCount: number,\n commentCount: number,\n}\n\nexport type IPageInfoForOperation = IPageInfoForEntity & {\n isBookmarked?: boolean,\n isLiked?: boolean,\n subscriptionStatus?: SubscriptionStatusType,\n}\n\nexport type IPageInfoForListing = IPageInfoForEntity & HasRevisionShortbody;\n\nexport type IPageInfoAll = IPageInfo | IPageInfoForEntity | IPageInfoForOperation | IPageInfoForListing;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isIPageInfo = (pageInfo: any | undefined): pageInfo is IPageInfo => {\n return pageInfo != null && pageInfo instanceof Object\n && ('isEmpty' in pageInfo);\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isIPageInfoForEntity = (pageInfo: any | undefined): pageInfo is IPageInfoForEntity => {\n return isIPageInfo(pageInfo)\n && pageInfo.isEmpty === false;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isIPageInfoForOperation = (pageInfo: any | undefined): pageInfo is IPageInfoForOperation => {\n return isIPageInfoForEntity(pageInfo)\n && ('isBookmarked' in pageInfo || 'isLiked' in pageInfo || 'subscriptionStatus' in pageInfo);\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isIPageInfoForListing = (pageInfo: any | undefined): pageInfo is IPageInfoForListing => {\n return isIPageInfoForEntity(pageInfo)\n && 'revisionShortBody' in pageInfo;\n};\n\n// export type IPageInfoTypeResolver<T extends IPageInfo> =\n// T extends HasRevisionShortbody ? IPageInfoForListing :\n// T extends { isBookmarked?: boolean } | { isLiked?: boolean } | { subscriptionStatus?: SubscriptionStatusType } ? IPageInfoForOperation :\n// T extends { bookmarkCount: number } ? IPageInfoForEntity :\n// T extends { isEmpty: number } ? IPageInfo :\n// T;\n\n/**\n * Union Distribution\n * @param pageInfo\n * @returns\n */\n// export const resolvePageInfo = <T extends IPageInfo>(pageInfo: T | undefined): IPageInfoTypeResolver<T> => {\n// return <IPageInfoTypeResolver<T>>pageInfo;\n// };\n\nexport type IDataWithMeta<D = unknown, M = unknown> = {\n data: D,\n meta?: M,\n}\n\nexport type IPageWithMeta<M = IPageInfoAll> = IDataWithMeta<IPageHasId, M>;\n\nexport type IPageToDeleteWithMeta<T = IPageInfoForEntity | unknown> = IDataWithMeta<HasObjectId & (IPage | { path: string, revision: string | null}), T>;\nexport type IPageToRenameWithMeta<T = IPageInfoForEntity | unknown> = IPageToDeleteWithMeta<T>;\n"],"names":["GroupType","PageGrant","PageStatus","isIPageInfo","pageInfo","isIPageInfoForEntity","isIPageInfoForOperation","isIPageInfoForListing"],"mappings":"AASO,MAAMA,IAAY,EAAE,WAAW,aAAa,mBAAmB,oBAAoB,GA6C7EC,IAAY;AAAA,EACvB,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,iBAAiB;AAAA;AAAA,EACjB,aAAa;AAAA,EACb,kBAAkB;AACpB,GAIaC,IAAa;AAAA,EACxB,kBAAkB;AAAA,EAClB,gBAAgB;AAClB,GAoCaC,IAAc,CAACC,MACnBA,KAAY,QAAQA,aAAoB,UACzC,aAAaA,GAIRC,IAAuB,CAACD,MAC5BD,EAAYC,CAAQ,KACtBA,EAAS,YAAY,IAIfE,IAA0B,CAACF,MAC/BC,EAAqBD,CAAQ,MAC9B,kBAAkBA,KAAY,aAAaA,KAAY,wBAAwBA,IAI1EG,IAAwB,CAACH,MAC7BC,EAAqBD,CAAQ,KAC/B,uBAAuBA;"}
|