@growi/core 1.0.0 → 1.1.0-next.2e3166abd61b2b5237b29e7b2ed62b17f1a86bef
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/consts/index.cjs +1 -1
- package/dist/consts/index.d.ts +1 -0
- package/dist/consts/index.js +4 -2
- package/dist/consts/index.js.map +1 -1
- package/dist/consts/ydoc-status.cjs +2 -0
- package/dist/consts/ydoc-status.cjs.map +1 -0
- package/dist/consts/ydoc-status.d.ts +15 -0
- package/dist/consts/ydoc-status.js +11 -0
- package/dist/consts/ydoc-status.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +30 -29
- package/dist/interfaces/common.cjs +1 -1
- package/dist/interfaces/common.cjs.map +1 -1
- package/dist/interfaces/common.d.ts +11 -4
- package/dist/interfaces/common.js +4 -3
- package/dist/interfaces/common.js.map +1 -1
- package/dist/interfaces/common.spec.d.ts +1 -0
- package/dist/interfaces/index.cjs +1 -1
- package/dist/interfaces/index.d.ts +0 -1
- package/dist/interfaces/index.js +26 -27
- package/dist/interfaces/index.js.map +1 -1
- package/dist/interfaces/page.cjs +1 -1
- package/dist/interfaces/page.cjs.map +1 -1
- package/dist/interfaces/page.js +7 -7
- package/dist/interfaces/page.js.map +1 -1
- package/dist/interfaces/revision.cjs.map +1 -1
- package/dist/interfaces/revision.d.ts +7 -9
- package/dist/interfaces/revision.js.map +1 -1
- package/dist/interfaces/user.cjs.map +1 -1
- package/dist/interfaces/user.d.ts +1 -1
- package/dist/interfaces/user.js.map +1 -1
- package/dist/models/devided-page-path.cjs +1 -1
- package/dist/models/devided-page-path.cjs.map +1 -1
- package/dist/models/devided-page-path.js +21 -14
- package/dist/models/devided-page-path.js.map +1 -1
- package/dist/models/vo/error-apiv3.cjs +1 -1
- package/dist/models/vo/error-apiv3.cjs.map +1 -1
- package/dist/models/vo/error-apiv3.js +10 -4
- package/dist/models/vo/error-apiv3.js.map +1 -1
- package/package.json +2 -1
- package/dist/interfaces/websocket.cjs +0 -2
- package/dist/interfaces/websocket.cjs.map +0 -1
- package/dist/interfaces/websocket.d.ts +0 -5
- package/dist/interfaces/websocket.js +0 -9
- package/dist/interfaces/websocket.js.map +0 -1
package/dist/consts/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./accepted-upload-file-type.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./accepted-upload-file-type.cjs"),t=require("./growi-plugin.cjs"),o=require("./ydoc-status.cjs");exports.AcceptedUploadFileType=e.AcceptedUploadFileType;exports.GrowiPluginType=t.GrowiPluginType;exports.YDocStatus=o.YDocStatus;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/consts/index.d.ts
CHANGED
package/dist/consts/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { AcceptedUploadFileType as p } from "./accepted-upload-file-type.js";
|
|
2
|
-
import { GrowiPluginType as
|
|
2
|
+
import { GrowiPluginType as t } from "./growi-plugin.js";
|
|
3
|
+
import { YDocStatus as f } from "./ydoc-status.js";
|
|
3
4
|
export {
|
|
4
5
|
p as AcceptedUploadFileType,
|
|
5
|
-
|
|
6
|
+
t as GrowiPluginType,
|
|
7
|
+
f as YDocStatus
|
|
6
8
|
};
|
|
7
9
|
//# sourceMappingURL=index.js.map
|
package/dist/consts/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":";;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ydoc-status.cjs","sources":["../../src/consts/ydoc-status.ts"],"sourcesContent":["/**\n * NEW: The document is newly created and not yet synced with the latest revision.\n * SYNCED: The document is synced with the latest revision.\n * DRAFT: The document advances as a draft compared to the latest revision\n * OUTDATED: The document is outdated and needs to be synced with the latest revision.\n * ISOLATED: The latest revision does not exist and the document is isolated from the page.\n */\nexport const YDocStatus = {\n NEW: 'new',\n SYNCED: 'synced',\n DRAFT: 'draft',\n OUTDATED: 'outdated',\n ISOLATED: 'isolated',\n} as const;\nexport type YDocStatus = typeof YDocStatus[keyof typeof YDocStatus]\n"],"names":["YDocStatus"],"mappings":"gFAOO,MAAMA,EAAa,CACxB,IAAK,MACL,OAAQ,SACR,MAAO,QACP,SAAU,WACV,SAAU,UACZ"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NEW: The document is newly created and not yet synced with the latest revision.
|
|
3
|
+
* SYNCED: The document is synced with the latest revision.
|
|
4
|
+
* DRAFT: The document advances as a draft compared to the latest revision
|
|
5
|
+
* OUTDATED: The document is outdated and needs to be synced with the latest revision.
|
|
6
|
+
* ISOLATED: The latest revision does not exist and the document is isolated from the page.
|
|
7
|
+
*/
|
|
8
|
+
export declare const YDocStatus: {
|
|
9
|
+
readonly NEW: "new";
|
|
10
|
+
readonly SYNCED: "synced";
|
|
11
|
+
readonly DRAFT: "draft";
|
|
12
|
+
readonly OUTDATED: "outdated";
|
|
13
|
+
readonly ISOLATED: "isolated";
|
|
14
|
+
};
|
|
15
|
+
export type YDocStatus = typeof YDocStatus[keyof typeof YDocStatus];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ydoc-status.js","sources":["../../src/consts/ydoc-status.ts"],"sourcesContent":["/**\n * NEW: The document is newly created and not yet synced with the latest revision.\n * SYNCED: The document is synced with the latest revision.\n * DRAFT: The document advances as a draft compared to the latest revision\n * OUTDATED: The document is outdated and needs to be synced with the latest revision.\n * ISOLATED: The latest revision does not exist and the document is isolated from the page.\n */\nexport const YDocStatus = {\n NEW: 'new',\n SYNCED: 'synced',\n DRAFT: 'draft',\n OUTDATED: 'outdated',\n ISOLATED: 'isolated',\n} as const;\nexport type YDocStatus = typeof YDocStatus[keyof typeof YDocStatus]\n"],"names":["YDocStatus"],"mappings":"AAOO,MAAMA,IAAa;AAAA,EACxB,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AACZ;"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
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"),c=require("./interfaces/color-scheme.cjs"),r=require("./interfaces/common.cjs"),
|
|
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"),r=require("./interfaces/common.cjs"),g=require("./interfaces/external-account.cjs"),t=require("./interfaces/growi-theme-metadata.cjs"),i=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=r.getIdForRef;exports.getIdStringForRef=r.getIdStringForRef;exports.isPopulated=r.isPopulated;exports.IExternalAuthProviderType=g.IExternalAuthProviderType;exports.GrowiThemeSchemeType=t.GrowiThemeSchemeType;exports.isGrowiThemeMetadata=t.isGrowiThemeMetadata;exports.AllLang=i.AllLang;exports.Lang=i.Lang;exports.GroupType=e.GroupType;exports.PageGrant=e.PageGrant;exports.PageStatus=e.PageStatus;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,37 +1,38 @@
|
|
|
1
1
|
import { AcceptedUploadFileType as r } from "./consts/accepted-upload-file-type.js";
|
|
2
2
|
import { GrowiPluginType as p } from "./consts/growi-plugin.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
3
|
+
import { YDocStatus as a } from "./consts/ydoc-status.js";
|
|
4
|
+
import { ColorScheme as m } from "./interfaces/color-scheme.js";
|
|
5
|
+
import { getIdForRef as g, getIdStringForRef as x, isPopulated as l } from "./interfaces/common.js";
|
|
6
|
+
import { IExternalAuthProviderType as S } from "./interfaces/external-account.js";
|
|
7
|
+
import { GrowiThemeSchemeType as u, isGrowiThemeMetadata as I } from "./interfaces/growi-theme-metadata.js";
|
|
8
|
+
import { AllLang as P, Lang as c } from "./interfaces/lang.js";
|
|
9
|
+
import { GroupType as F, PageGrant as h, PageStatus as A, isIPageInfoForEntity as G, isIPageInfoForListing as w, isIPageInfoForOperation as E } from "./interfaces/page.js";
|
|
10
|
+
import { Origin as O, allOrigin as R } from "./interfaces/revision.js";
|
|
11
|
+
import { AllSubscriptionStatusType as b, SubscriptionStatusType as v } from "./interfaces/subscription.js";
|
|
12
|
+
import { USER_STATUS as D } from "./interfaces/user.js";
|
|
13
13
|
export {
|
|
14
14
|
r as AcceptedUploadFileType,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
P as GroupType,
|
|
15
|
+
P as AllLang,
|
|
16
|
+
b as AllSubscriptionStatusType,
|
|
17
|
+
m as ColorScheme,
|
|
18
|
+
F as GroupType,
|
|
20
19
|
p as GrowiPluginType,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
20
|
+
u as GrowiThemeSchemeType,
|
|
21
|
+
S as IExternalAuthProviderType,
|
|
22
|
+
c as Lang,
|
|
23
|
+
O as Origin,
|
|
24
|
+
h as PageGrant,
|
|
25
|
+
A as PageStatus,
|
|
26
|
+
v as SubscriptionStatusType,
|
|
27
|
+
D as USER_STATUS,
|
|
28
|
+
a as YDocStatus,
|
|
29
|
+
R as allOrigin,
|
|
30
|
+
g as getIdForRef,
|
|
31
|
+
x as getIdStringForRef,
|
|
32
|
+
I as isGrowiThemeMetadata,
|
|
32
33
|
G as isIPageInfoForEntity,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
w as isIPageInfoForListing,
|
|
35
|
+
E as isIPageInfoForOperation,
|
|
36
|
+
l as isPopulated
|
|
36
37
|
};
|
|
37
38
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=t=>typeof t!="string",o=t=>e(t)?t._id:t;exports.getIdForRef=o;exports.isPopulated=e;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=t=>t!=null&&typeof t!="string"&&!("_bsontype"in t&&t._bsontype==="ObjectID"),o=t=>e(t)?t._id:t,n=t=>o(t).toString();exports.getIdForRef=o;exports.getIdStringForRef=n;exports.isPopulated=e;
|
|
2
2
|
//# sourceMappingURL=common.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.cjs","sources":["../../src/interfaces/common.ts"],"sourcesContent":["/*\n * Common types and interfaces\n */\n\nimport type {
|
|
1
|
+
{"version":3,"file":"common.cjs","sources":["../../src/interfaces/common.ts"],"sourcesContent":["/*\n * Common types and interfaces\n */\n\n\nimport type { Types } from 'mongoose';\n\ntype ObjectId = Types.ObjectId;\n\n// Foreign key field\nexport type Ref<T> = string | ObjectId | T & { _id: string | ObjectId };\n\nexport type Nullable<T> = T | null | undefined;\n\nexport const isPopulated = <T>(ref: Ref<T>): ref is T & { _id: string | ObjectId } => {\n return ref != null\n && typeof ref !== 'string'\n && !('_bsontype' in ref && ref._bsontype === 'ObjectID');\n};\n\nexport const getIdForRef = <T>(ref: Ref<T>): string | ObjectId => {\n return isPopulated(ref)\n ? ref._id\n : ref;\n};\n\nexport const getIdStringForRef = <T>(ref: Ref<T>): string => {\n return getIdForRef(ref).toString();\n};\n"],"names":["isPopulated","ref","getIdForRef","getIdStringForRef"],"mappings":"gFAca,MAAAA,EAAkBC,GACtBA,GAAO,MACT,OAAOA,GAAQ,UACf,EAAE,cAAeA,GAAOA,EAAI,YAAc,YAGpCC,EAAkBD,GACtBD,EAAYC,CAAG,EAClBA,EAAI,IACJA,EAGOE,EAAwBF,GAC5BC,EAAYD,CAAG,EAAE"}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Types } from 'mongoose';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
type ObjectId = Types.ObjectId;
|
|
4
|
+
export type Ref<T> = string | ObjectId | T & {
|
|
5
|
+
_id: string | ObjectId;
|
|
6
|
+
};
|
|
4
7
|
export type Nullable<T> = T | null | undefined;
|
|
5
|
-
export declare const isPopulated: <T>(ref: Ref<T>) => ref is T &
|
|
6
|
-
|
|
8
|
+
export declare const isPopulated: <T>(ref: Ref<T>) => ref is T & {
|
|
9
|
+
_id: string | ObjectId;
|
|
10
|
+
};
|
|
11
|
+
export declare const getIdForRef: <T>(ref: Ref<T>) => string | ObjectId;
|
|
12
|
+
export declare const getIdStringForRef: <T>(ref: Ref<T>) => string;
|
|
13
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
const
|
|
1
|
+
const n = (t) => t != null && typeof t != "string" && !("_bsontype" in t && t._bsontype === "ObjectID"), o = (t) => n(t) ? t._id : t, e = (t) => o(t).toString();
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
o as getIdForRef,
|
|
4
|
+
e as getIdStringForRef,
|
|
5
|
+
n as isPopulated
|
|
5
6
|
};
|
|
6
7
|
//# sourceMappingURL=common.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sources":["../../src/interfaces/common.ts"],"sourcesContent":["/*\n * Common types and interfaces\n */\n\nimport type {
|
|
1
|
+
{"version":3,"file":"common.js","sources":["../../src/interfaces/common.ts"],"sourcesContent":["/*\n * Common types and interfaces\n */\n\n\nimport type { Types } from 'mongoose';\n\ntype ObjectId = Types.ObjectId;\n\n// Foreign key field\nexport type Ref<T> = string | ObjectId | T & { _id: string | ObjectId };\n\nexport type Nullable<T> = T | null | undefined;\n\nexport const isPopulated = <T>(ref: Ref<T>): ref is T & { _id: string | ObjectId } => {\n return ref != null\n && typeof ref !== 'string'\n && !('_bsontype' in ref && ref._bsontype === 'ObjectID');\n};\n\nexport const getIdForRef = <T>(ref: Ref<T>): string | ObjectId => {\n return isPopulated(ref)\n ? ref._id\n : ref;\n};\n\nexport const getIdStringForRef = <T>(ref: Ref<T>): string => {\n return getIdForRef(ref).toString();\n};\n"],"names":["isPopulated","ref","getIdForRef","getIdStringForRef"],"mappings":"AAca,MAAAA,IAAc,CAAIC,MACtBA,KAAO,QACT,OAAOA,KAAQ,YACf,EAAE,eAAeA,KAAOA,EAAI,cAAc,aAGpCC,IAAc,CAAID,MACtBD,EAAYC,CAAG,IAClBA,EAAI,MACJA,GAGOE,IAAoB,CAAIF,MAC5BC,EAAYD,CAAG,EAAE;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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"),t=require("./growi-theme-metadata.cjs"),i=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.IExternalAuthProviderType=s.IExternalAuthProviderType;exports.GrowiThemeSchemeType=t.GrowiThemeSchemeType;exports.isGrowiThemeMetadata=t.isGrowiThemeMetadata;exports.AllLang=i.AllLang;exports.Lang=i.Lang;exports.GroupType=e.GroupType;exports.PageGrant=e.PageGrant;exports.PageStatus=e.PageStatus;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,33 +1,32 @@
|
|
|
1
|
-
import { ColorScheme as
|
|
2
|
-
import { getIdForRef as
|
|
3
|
-
import { IExternalAuthProviderType as
|
|
4
|
-
import { GrowiThemeSchemeType as
|
|
5
|
-
import { AllLang as
|
|
6
|
-
import { GroupType as T, PageGrant as u, PageStatus as
|
|
7
|
-
import { Origin as
|
|
8
|
-
import { AllSubscriptionStatusType as E, SubscriptionStatusType as
|
|
9
|
-
import { USER_STATUS as
|
|
10
|
-
import { GlobalSocketEventName as v } from "./websocket.js";
|
|
1
|
+
import { ColorScheme as o } from "./color-scheme.js";
|
|
2
|
+
import { getIdForRef as i, getIdStringForRef as p, isPopulated as a } from "./common.js";
|
|
3
|
+
import { IExternalAuthProviderType as f } from "./external-account.js";
|
|
4
|
+
import { GrowiThemeSchemeType as m, isGrowiThemeMetadata as s } from "./growi-theme-metadata.js";
|
|
5
|
+
import { AllLang as x, Lang as l } from "./lang.js";
|
|
6
|
+
import { GroupType as T, PageGrant as u, PageStatus as P, isIPageInfoForEntity as y, isIPageInfoForListing as d, isIPageInfoForOperation as h } from "./page.js";
|
|
7
|
+
import { Origin as c, allOrigin as A } from "./revision.js";
|
|
8
|
+
import { AllSubscriptionStatusType as E, SubscriptionStatusType as L } from "./subscription.js";
|
|
9
|
+
import { USER_STATUS as R } from "./user.js";
|
|
11
10
|
export {
|
|
12
|
-
|
|
11
|
+
x as AllLang,
|
|
13
12
|
E as AllSubscriptionStatusType,
|
|
14
|
-
|
|
15
|
-
v as GlobalSocketEventName,
|
|
13
|
+
o as ColorScheme,
|
|
16
14
|
T as GroupType,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
m as GrowiThemeSchemeType,
|
|
16
|
+
f as IExternalAuthProviderType,
|
|
17
|
+
l as Lang,
|
|
18
|
+
c as Origin,
|
|
21
19
|
u as PageGrant,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
y as
|
|
30
|
-
|
|
31
|
-
|
|
20
|
+
P as PageStatus,
|
|
21
|
+
L as SubscriptionStatusType,
|
|
22
|
+
R as USER_STATUS,
|
|
23
|
+
A as allOrigin,
|
|
24
|
+
i as getIdForRef,
|
|
25
|
+
p as getIdStringForRef,
|
|
26
|
+
s as isGrowiThemeMetadata,
|
|
27
|
+
y as isIPageInfoForEntity,
|
|
28
|
+
d as isIPageInfoForListing,
|
|
29
|
+
h as isIPageInfoForOperation,
|
|
30
|
+
a as isPopulated
|
|
32
31
|
};
|
|
33
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.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 i={userGroup:"UserGroup",externalUserGroup:"ExternalUserGroup"},s={GRANT_PUBLIC:1,GRANT_RESTRICTED:2,GRANT_SPECIFIED:3,GRANT_OWNER:4,GRANT_USER_GROUP:5},e={STATUS_PUBLISHED:"published",STATUS_DELETED:"deleted"},r=t=>t!=null&&t instanceof Object&&"isEmpty"in t&&t.isEmpty===!1,n=t=>t!=null&&r(t)&&("isBookmarked"in t||"isLiked"in t||"subscriptionStatus"in t),o=t=>t!=null&&r(t)&&"revisionShortBody"in t;exports.GroupType=i;exports.PageGrant=s;exports.PageStatus=e;exports.isIPageInfoForEntity=r;exports.isIPageInfoForListing=o;exports.isIPageInfoForOperation=n;
|
|
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 isIPageInfoForEntity = (pageInfo: any | undefined): pageInfo is IPageInfoForEntity => {\n return pageInfo != null;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isIPageInfoForOperation = (pageInfo: any | undefined): pageInfo is IPageInfoForOperation => {\n return pageInfo != null\n && 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 pageInfo != null\n && 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","isIPageInfoForEntity","pageInfo","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,EAAwBC,GAC5BA,GAAY,
|
|
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 isIPageInfoForEntity = (pageInfo: any | undefined): pageInfo is IPageInfoForEntity => {\n return pageInfo != null && pageInfo instanceof Object\n && ('isEmpty' in 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 pageInfo != null\n && 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 pageInfo != null\n && 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","isIPageInfoForEntity","pageInfo","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,EAAwBC,GAC5BA,GAAY,MAAQA,aAAoB,QACzC,YAAaA,GACdA,EAAS,UAAY,GAIfC,EAA2BD,GAC/BA,GAAY,MACdD,EAAqBC,CAAQ,IAC5B,iBAAkBA,GAAY,YAAaA,GAAY,uBAAwBA,GAI1EE,EAAyBF,GAC7BA,GAAY,MACdD,EAAqBC,CAAQ,GAC7B,sBAAuBA"}
|
package/dist/interfaces/page.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
const s = { userGroup: "UserGroup", externalUserGroup: "ExternalUserGroup" },
|
|
1
|
+
const s = { userGroup: "UserGroup", externalUserGroup: "ExternalUserGroup" }, i = {
|
|
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
|
+
}, n = {
|
|
9
9
|
STATUS_PUBLISHED: "published",
|
|
10
10
|
STATUS_DELETED: "deleted"
|
|
11
|
-
},
|
|
11
|
+
}, r = (t) => t != null && t instanceof Object && "isEmpty" in t && t.isEmpty === !1, e = (t) => t != null && r(t) && ("isBookmarked" in t || "isLiked" in t || "subscriptionStatus" in t), o = (t) => t != null && r(t) && "revisionShortBody" in t;
|
|
12
12
|
export {
|
|
13
13
|
s as GroupType,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
i as PageGrant,
|
|
15
|
+
n as PageStatus,
|
|
16
|
+
r as isIPageInfoForEntity,
|
|
17
17
|
o as isIPageInfoForListing,
|
|
18
|
-
|
|
18
|
+
e as isIPageInfoForOperation
|
|
19
19
|
};
|
|
20
20
|
//# 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 isIPageInfoForEntity = (pageInfo: any | undefined): pageInfo is IPageInfoForEntity => {\n return pageInfo != null;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isIPageInfoForOperation = (pageInfo: any | undefined): pageInfo is IPageInfoForOperation => {\n return pageInfo != null\n && 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 pageInfo != null\n && 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","isIPageInfoForEntity","pageInfo","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,IAAuB,CAACC,MAC5BA,KAAY,
|
|
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 isIPageInfoForEntity = (pageInfo: any | undefined): pageInfo is IPageInfoForEntity => {\n return pageInfo != null && pageInfo instanceof Object\n && ('isEmpty' in 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 pageInfo != null\n && 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 pageInfo != null\n && 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","isIPageInfoForEntity","pageInfo","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,IAAuB,CAACC,MAC5BA,KAAY,QAAQA,aAAoB,UACzC,aAAaA,KACdA,EAAS,YAAY,IAIfC,IAA0B,CAACD,MAC/BA,KAAY,QACdD,EAAqBC,CAAQ,MAC5B,kBAAkBA,KAAY,aAAaA,KAAY,wBAAwBA,IAI1EE,IAAwB,CAACF,MAC7BA,KAAY,QACdD,EAAqBC,CAAQ,KAC7B,uBAAuBA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revision.cjs","sources":["../../src/interfaces/revision.ts"],"sourcesContent":["import type { Ref } from './common';\nimport type { HasObjectId } from './has-object-id';\nimport type { IUser } from './user';\n\nexport const Origin = {\n View: 'view',\n Editor: 'editor',\n} as const;\n\nexport type Origin = typeof Origin[keyof typeof Origin];\n\nexport const allOrigin = Object.values(Origin);\n\nexport type IRevision = {\n body: string,\n author: Ref<IUser>,\n
|
|
1
|
+
{"version":3,"file":"revision.cjs","sources":["../../src/interfaces/revision.ts"],"sourcesContent":["import type { Ref } from './common';\nimport type { HasObjectId } from './has-object-id';\nimport type { IPage } from './page';\nimport type { IUser } from './user';\n\nexport const Origin = {\n View: 'view',\n Editor: 'editor',\n} as const;\n\nexport type Origin = typeof Origin[keyof typeof Origin];\n\nexport const allOrigin = Object.values(Origin);\n\nexport type IRevision = {\n pageId: Ref<IPage>,\n body: string,\n author: Ref<IUser>,\n format: string,\n hasDiffToPrev?: boolean;\n origin?: Origin,\n createdAt: Date,\n updatedAt: Date,\n}\n\nexport type IRevisionHasId = IRevision & HasObjectId;\n\nexport type IRevisionsForPagination = {\n revisions: IRevisionHasId[], // revisions in one pagination\n totalCounts: number // total counts\n}\nexport type HasRevisionShortbody = {\n revisionShortBody?: string,\n}\n\nexport type SWRInfinitePageRevisionsResponse = {\n revisions: IRevisionHasId[],\n totalCount: number,\n offset: number,\n}\n"],"names":["Origin","allOrigin"],"mappings":"gFAKO,MAAMA,EAAS,CACpB,KAAM,OACN,OAAQ,QACV,EAIaC,EAAY,OAAO,OAAOD,CAAM"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IUser } from './user';
|
|
2
|
+
import { IPage } from './page';
|
|
2
3
|
import { HasObjectId } from './has-object-id';
|
|
3
4
|
import { Ref } from './common';
|
|
4
5
|
|
|
@@ -9,28 +10,25 @@ export declare const Origin: {
|
|
|
9
10
|
export type Origin = typeof Origin[keyof typeof Origin];
|
|
10
11
|
export declare const allOrigin: ("view" | "editor")[];
|
|
11
12
|
export type IRevision = {
|
|
13
|
+
pageId: Ref<IPage>;
|
|
12
14
|
body: string;
|
|
13
15
|
author: Ref<IUser>;
|
|
14
|
-
|
|
16
|
+
format: string;
|
|
17
|
+
hasDiffToPrev?: boolean;
|
|
18
|
+
origin?: Origin;
|
|
15
19
|
createdAt: Date;
|
|
16
20
|
updatedAt: Date;
|
|
17
|
-
origin?: Origin;
|
|
18
21
|
};
|
|
19
22
|
export type IRevisionHasId = IRevision & HasObjectId;
|
|
20
|
-
type HasPageId = {
|
|
21
|
-
pageId: string;
|
|
22
|
-
};
|
|
23
|
-
export type IRevisionHasPageId = IRevisionHasId & HasPageId;
|
|
24
23
|
export type IRevisionsForPagination = {
|
|
25
|
-
revisions:
|
|
24
|
+
revisions: IRevisionHasId[];
|
|
26
25
|
totalCounts: number;
|
|
27
26
|
};
|
|
28
27
|
export type HasRevisionShortbody = {
|
|
29
28
|
revisionShortBody?: string;
|
|
30
29
|
};
|
|
31
30
|
export type SWRInfinitePageRevisionsResponse = {
|
|
32
|
-
revisions:
|
|
31
|
+
revisions: IRevisionHasId[];
|
|
33
32
|
totalCount: number;
|
|
34
33
|
offset: number;
|
|
35
34
|
};
|
|
36
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revision.js","sources":["../../src/interfaces/revision.ts"],"sourcesContent":["import type { Ref } from './common';\nimport type { HasObjectId } from './has-object-id';\nimport type { IUser } from './user';\n\nexport const Origin = {\n View: 'view',\n Editor: 'editor',\n} as const;\n\nexport type Origin = typeof Origin[keyof typeof Origin];\n\nexport const allOrigin = Object.values(Origin);\n\nexport type IRevision = {\n body: string,\n author: Ref<IUser>,\n
|
|
1
|
+
{"version":3,"file":"revision.js","sources":["../../src/interfaces/revision.ts"],"sourcesContent":["import type { Ref } from './common';\nimport type { HasObjectId } from './has-object-id';\nimport type { IPage } from './page';\nimport type { IUser } from './user';\n\nexport const Origin = {\n View: 'view',\n Editor: 'editor',\n} as const;\n\nexport type Origin = typeof Origin[keyof typeof Origin];\n\nexport const allOrigin = Object.values(Origin);\n\nexport type IRevision = {\n pageId: Ref<IPage>,\n body: string,\n author: Ref<IUser>,\n format: string,\n hasDiffToPrev?: boolean;\n origin?: Origin,\n createdAt: Date,\n updatedAt: Date,\n}\n\nexport type IRevisionHasId = IRevision & HasObjectId;\n\nexport type IRevisionsForPagination = {\n revisions: IRevisionHasId[], // revisions in one pagination\n totalCounts: number // total counts\n}\nexport type HasRevisionShortbody = {\n revisionShortBody?: string,\n}\n\nexport type SWRInfinitePageRevisionsResponse = {\n revisions: IRevisionHasId[],\n totalCount: number,\n offset: number,\n}\n"],"names":["Origin","allOrigin"],"mappings":"AAKO,MAAMA,IAAS;AAAA,EACpB,MAAM;AAAA,EACN,QAAQ;AACV,GAIaC,IAAY,OAAO,OAAOD,CAAM;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.cjs","sources":["../../src/interfaces/user.ts"],"sourcesContent":["import type { IAttachment } from './attachment';\nimport type { Ref } from './common';\nimport type { IExternalAuthProviderType } from './external-account';\nimport type { HasObjectId } from './has-object-id';\nimport type { Lang } from './lang';\n\nexport type IUser = {\n name: string,\n username: string,\n email: string,\n password: string,\n image?: string, // for backward conpatibility\n imageAttachment?: Ref<IAttachment>,\n imageUrlCached: string,\n isGravatarEnabled: boolean,\n admin: boolean,\n readOnly: boolean,\n apiToken?: string,\n isEmailPublished: boolean,\n isInvitationEmailSended: boolean,\n lang: Lang,\n slackMemberId?: string,\n createdAt: Date,\n lastLoginAt?: Date,\n introduction: string,\n status: IUserStatus,\n isQuestionnaireEnabled: boolean,\n}\n\nexport type IUserGroupRelation = {\n relatedGroup: Ref<IUserGroup>,\n relatedUser: Ref<IUser>,\n createdAt: Date,\n}\n\nexport type IUserGroup = {\n name: string;\n createdAt: Date;\n description: string;\n parent: Ref<
|
|
1
|
+
{"version":3,"file":"user.cjs","sources":["../../src/interfaces/user.ts"],"sourcesContent":["import type { IAttachment } from './attachment';\nimport type { Ref } from './common';\nimport type { IExternalAuthProviderType } from './external-account';\nimport type { HasObjectId } from './has-object-id';\nimport type { Lang } from './lang';\n\nexport type IUser = {\n name: string,\n username: string,\n email: string,\n password: string,\n image?: string, // for backward conpatibility\n imageAttachment?: Ref<IAttachment>,\n imageUrlCached: string,\n isGravatarEnabled: boolean,\n admin: boolean,\n readOnly: boolean,\n apiToken?: string,\n isEmailPublished: boolean,\n isInvitationEmailSended: boolean,\n lang: Lang,\n slackMemberId?: string,\n createdAt: Date,\n lastLoginAt?: Date,\n introduction: string,\n status: IUserStatus,\n isQuestionnaireEnabled: boolean,\n}\n\nexport type IUserGroupRelation = {\n relatedGroup: Ref<IUserGroup>,\n relatedUser: Ref<IUser>,\n createdAt: Date,\n}\n\nexport type IUserGroup = {\n name: string;\n createdAt: Date;\n description: string;\n parent: Ref<IUserGroup> | null;\n}\n\nexport const USER_STATUS = {\n REGISTERED: 1,\n ACTIVE: 2,\n SUSPENDED: 3,\n DELETED: 4,\n INVITED: 5,\n} as const;\nexport type IUserStatus = typeof USER_STATUS[keyof typeof USER_STATUS]\n\nexport type IUserHasId = IUser & HasObjectId;\nexport type IUserGroupHasId = IUserGroup & HasObjectId;\nexport type IUserGroupRelationHasId = IUserGroupRelation & HasObjectId;\n\nexport type IAdminExternalAccount = {\n _id: string,\n providerType: IExternalAuthProviderType,\n accountId: string,\n user: IUser,\n createdAt: Date,\n}\n"],"names":["USER_STATUS"],"mappings":"gFA0CO,MAAMA,EAAc,CACzB,WAAY,EACZ,OAAQ,EACR,UAAW,EACX,QAAS,EACT,QAAS,CACX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sources":["../../src/interfaces/user.ts"],"sourcesContent":["import type { IAttachment } from './attachment';\nimport type { Ref } from './common';\nimport type { IExternalAuthProviderType } from './external-account';\nimport type { HasObjectId } from './has-object-id';\nimport type { Lang } from './lang';\n\nexport type IUser = {\n name: string,\n username: string,\n email: string,\n password: string,\n image?: string, // for backward conpatibility\n imageAttachment?: Ref<IAttachment>,\n imageUrlCached: string,\n isGravatarEnabled: boolean,\n admin: boolean,\n readOnly: boolean,\n apiToken?: string,\n isEmailPublished: boolean,\n isInvitationEmailSended: boolean,\n lang: Lang,\n slackMemberId?: string,\n createdAt: Date,\n lastLoginAt?: Date,\n introduction: string,\n status: IUserStatus,\n isQuestionnaireEnabled: boolean,\n}\n\nexport type IUserGroupRelation = {\n relatedGroup: Ref<IUserGroup>,\n relatedUser: Ref<IUser>,\n createdAt: Date,\n}\n\nexport type IUserGroup = {\n name: string;\n createdAt: Date;\n description: string;\n parent: Ref<
|
|
1
|
+
{"version":3,"file":"user.js","sources":["../../src/interfaces/user.ts"],"sourcesContent":["import type { IAttachment } from './attachment';\nimport type { Ref } from './common';\nimport type { IExternalAuthProviderType } from './external-account';\nimport type { HasObjectId } from './has-object-id';\nimport type { Lang } from './lang';\n\nexport type IUser = {\n name: string,\n username: string,\n email: string,\n password: string,\n image?: string, // for backward conpatibility\n imageAttachment?: Ref<IAttachment>,\n imageUrlCached: string,\n isGravatarEnabled: boolean,\n admin: boolean,\n readOnly: boolean,\n apiToken?: string,\n isEmailPublished: boolean,\n isInvitationEmailSended: boolean,\n lang: Lang,\n slackMemberId?: string,\n createdAt: Date,\n lastLoginAt?: Date,\n introduction: string,\n status: IUserStatus,\n isQuestionnaireEnabled: boolean,\n}\n\nexport type IUserGroupRelation = {\n relatedGroup: Ref<IUserGroup>,\n relatedUser: Ref<IUser>,\n createdAt: Date,\n}\n\nexport type IUserGroup = {\n name: string;\n createdAt: Date;\n description: string;\n parent: Ref<IUserGroup> | null;\n}\n\nexport const USER_STATUS = {\n REGISTERED: 1,\n ACTIVE: 2,\n SUSPENDED: 3,\n DELETED: 4,\n INVITED: 5,\n} as const;\nexport type IUserStatus = typeof USER_STATUS[keyof typeof USER_STATUS]\n\nexport type IUserHasId = IUser & HasObjectId;\nexport type IUserGroupHasId = IUserGroup & HasObjectId;\nexport type IUserGroupRelationHasId = IUserGroupRelation & HasObjectId;\n\nexport type IAdminExternalAccount = {\n _id: string,\n providerType: IExternalAuthProviderType,\n accountId: string,\n user: IUser,\n createdAt: Date,\n}\n"],"names":["USER_STATUS"],"mappings":"AA0CO,MAAMA,IAAc;AAAA,EACzB,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,SAAS;AAAA,EACT,SAAS;AACX;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";var c=Object.defineProperty;var n=(r,t,e)=>t in r?c(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var s=(r,t,e)=>(n(r,typeof t!="symbol"?t+"":t,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../utils/path-utils.cjs"),m=/^(.+\/[^/]+)\/(\d{4}|\d{4}\/\d{2}|\d{4}\/\d{2}\/\d{2})$/;class d{constructor(t,e=!1,h=!1){s(this,"isRoot");s(this,"isFormerRoot");s(this,"former");s(this,"latter");if(this.isRoot=!1,this.isFormerRoot=!1,this.former="",t==null||t===""||t==="/"){this.isRoot=!0,this.latter="/";return}const a=e?t:f.normalizePath(t);if(this.latter=a,h){const i=a.match(m);if(i!=null){this.former=i[1],this.latter=i[2];return}}let l=/^((.*)\/(?!em>))?(.+)$/;try{l=new RegExp("^((.*)(?<!<)\\/)?(.+)$")}catch{}const o=a.match(l);o!=null&&(this.isFormerRoot=o[1]==="/",this.former=o[2],this.latter=o[3])}}exports.DevidedPagePath=d;
|
|
2
2
|
//# sourceMappingURL=devided-page-path.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devided-page-path.cjs","sources":["../../src/models/devided-page-path.ts"],"sourcesContent":["import * as pathUtils from '../utils/path-utils';\n\n// https://regex101.com/r/BahpKX/2\nconst PATTERN_INCLUDE_DATE = /^(.+\\/[^/]+)\\/(\\d{4}|\\d{4}\\/\\d{2}|\\d{4}\\/\\d{2}\\/\\d{2})$/;\n\nexport class DevidedPagePath {\n\n isRoot: boolean;\n\n isFormerRoot: boolean;\n\n former: string;\n\n latter: string;\n\n constructor(path: string, skipNormalize = false, evalDatePath = false) {\n\n this.isRoot = false;\n this.isFormerRoot = false;\n this.former = '';\n\n // root\n if (path == null || path === '' || path === '/') {\n this.isRoot = true;\n this.latter = '/';\n return;\n }\n\n const pagePath = skipNormalize ? path : pathUtils.normalizePath(path);\n this.latter = pagePath;\n\n // evaluate date path\n if (evalDatePath) {\n const matchDate = pagePath.match(PATTERN_INCLUDE_DATE);\n if (matchDate != null) {\n this.former = matchDate[1];\n this.latter = matchDate[2];\n return;\n }\n }\n\n let PATTERN_DEFAULT = /^((.*)\\/(?!em>))?(.+)$/; // this will ignore em's end tags\n try { // for non-chrome browsers\n // eslint-disable-next-line regex/invalid\n PATTERN_DEFAULT = new RegExp('^((.*)(?<!<)\\\\/)?(.+)$'); // https://regex101.com/r/HJNvMW/1\n }\n catch (err) {\n // lookbehind regex is not supported on non-chrome browsers\n }\n\n const matchDefault = pagePath.match(PATTERN_DEFAULT);\n if (matchDefault != null) {\n this.isFormerRoot = matchDefault[1] === '/';\n this.former = matchDefault[2];\n this.latter = matchDefault[3];\n }\n }\n\n}\n"],"names":["PATTERN_INCLUDE_DATE","DevidedPagePath","path","skipNormalize","evalDatePath","pagePath","pathUtils.normalizePath","matchDate","PATTERN_DEFAULT","matchDefault"],"mappings":"
|
|
1
|
+
{"version":3,"file":"devided-page-path.cjs","sources":["../../src/models/devided-page-path.ts"],"sourcesContent":["import * as pathUtils from '../utils/path-utils';\n\n// https://regex101.com/r/BahpKX/2\nconst PATTERN_INCLUDE_DATE = /^(.+\\/[^/]+)\\/(\\d{4}|\\d{4}\\/\\d{2}|\\d{4}\\/\\d{2}\\/\\d{2})$/;\n\nexport class DevidedPagePath {\n\n isRoot: boolean;\n\n isFormerRoot: boolean;\n\n former: string;\n\n latter: string;\n\n constructor(path: string, skipNormalize = false, evalDatePath = false) {\n\n this.isRoot = false;\n this.isFormerRoot = false;\n this.former = '';\n\n // root\n if (path == null || path === '' || path === '/') {\n this.isRoot = true;\n this.latter = '/';\n return;\n }\n\n const pagePath = skipNormalize ? path : pathUtils.normalizePath(path);\n this.latter = pagePath;\n\n // evaluate date path\n if (evalDatePath) {\n const matchDate = pagePath.match(PATTERN_INCLUDE_DATE);\n if (matchDate != null) {\n this.former = matchDate[1];\n this.latter = matchDate[2];\n return;\n }\n }\n\n let PATTERN_DEFAULT = /^((.*)\\/(?!em>))?(.+)$/; // this will ignore em's end tags\n try { // for non-chrome browsers\n // eslint-disable-next-line regex/invalid\n PATTERN_DEFAULT = new RegExp('^((.*)(?<!<)\\\\/)?(.+)$'); // https://regex101.com/r/HJNvMW/1\n }\n catch (err) {\n // lookbehind regex is not supported on non-chrome browsers\n }\n\n const matchDefault = pagePath.match(PATTERN_DEFAULT);\n if (matchDefault != null) {\n this.isFormerRoot = matchDefault[1] === '/';\n this.former = matchDefault[2];\n this.latter = matchDefault[3];\n }\n }\n\n}\n"],"names":["PATTERN_INCLUDE_DATE","DevidedPagePath","path","skipNormalize","evalDatePath","__publicField","pagePath","pathUtils.normalizePath","matchDate","PATTERN_DEFAULT","matchDefault"],"mappings":"mSAGMA,EAAuB,0DAEtB,MAAMC,CAAgB,CAU3B,YAAYC,EAAcC,EAAgB,GAAOC,EAAe,GAAO,CARvEC,EAAA,eAEAA,EAAA,qBAEAA,EAAA,eAEAA,EAAA,eASE,GALA,KAAK,OAAS,GACd,KAAK,aAAe,GACpB,KAAK,OAAS,GAGVH,GAAQ,MAAQA,IAAS,IAAMA,IAAS,IAAK,CAC/C,KAAK,OAAS,GACd,KAAK,OAAS,IACd,MACF,CAEA,MAAMI,EAAWH,EAAgBD,EAAOK,gBAAwBL,CAAI,EAIpE,GAHA,KAAK,OAASI,EAGVF,EAAc,CACV,MAAAI,EAAYF,EAAS,MAAMN,CAAoB,EACrD,GAAIQ,GAAa,KAAM,CAChB,KAAA,OAASA,EAAU,CAAC,EACpB,KAAA,OAASA,EAAU,CAAC,EACzB,MACF,CACF,CAEA,IAAIC,EAAkB,yBAClB,GAAA,CAEgBA,EAAA,IAAI,OAAO,wBAAwB,OAE3C,CAEZ,CAEM,MAAAC,EAAeJ,EAAS,MAAMG,CAAe,EAC/CC,GAAgB,OACb,KAAA,aAAeA,EAAa,CAAC,IAAM,IACnC,KAAA,OAASA,EAAa,CAAC,EACvB,KAAA,OAASA,EAAa,CAAC,EAEhC,CAEF"}
|
|
@@ -1,29 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
var m = Object.defineProperty;
|
|
2
|
+
var f = (e, t, r) => t in e ? m(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var o = (e, t, r) => (f(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
4
|
+
import { normalizePath as c } from "../utils/path-utils.js";
|
|
5
|
+
const n = /^(.+\/[^/]+)\/(\d{4}|\d{4}\/\d{2}|\d{4}\/\d{2}\/\d{2})$/;
|
|
6
|
+
class u {
|
|
7
|
+
constructor(t, r = !1, h = !1) {
|
|
8
|
+
o(this, "isRoot");
|
|
9
|
+
o(this, "isFormerRoot");
|
|
10
|
+
o(this, "former");
|
|
11
|
+
o(this, "latter");
|
|
5
12
|
if (this.isRoot = !1, this.isFormerRoot = !1, this.former = "", t == null || t === "" || t === "/") {
|
|
6
13
|
this.isRoot = !0, this.latter = "/";
|
|
7
14
|
return;
|
|
8
15
|
}
|
|
9
|
-
const
|
|
10
|
-
if (this.latter =
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
13
|
-
this.former =
|
|
16
|
+
const a = r ? t : c(t);
|
|
17
|
+
if (this.latter = a, h) {
|
|
18
|
+
const i = a.match(n);
|
|
19
|
+
if (i != null) {
|
|
20
|
+
this.former = i[1], this.latter = i[2];
|
|
14
21
|
return;
|
|
15
22
|
}
|
|
16
23
|
}
|
|
17
|
-
let
|
|
24
|
+
let l = /^((.*)\/(?!em>))?(.+)$/;
|
|
18
25
|
try {
|
|
19
|
-
|
|
26
|
+
l = new RegExp("^((.*)(?<!<)\\/)?(.+)$");
|
|
20
27
|
} catch {
|
|
21
28
|
}
|
|
22
|
-
const
|
|
23
|
-
|
|
29
|
+
const s = a.match(l);
|
|
30
|
+
s != null && (this.isFormerRoot = s[1] === "/", this.former = s[2], this.latter = s[3]);
|
|
24
31
|
}
|
|
25
32
|
}
|
|
26
33
|
export {
|
|
27
|
-
|
|
34
|
+
u as DevidedPagePath
|
|
28
35
|
};
|
|
29
36
|
//# sourceMappingURL=devided-page-path.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devided-page-path.js","sources":["../../src/models/devided-page-path.ts"],"sourcesContent":["import * as pathUtils from '../utils/path-utils';\n\n// https://regex101.com/r/BahpKX/2\nconst PATTERN_INCLUDE_DATE = /^(.+\\/[^/]+)\\/(\\d{4}|\\d{4}\\/\\d{2}|\\d{4}\\/\\d{2}\\/\\d{2})$/;\n\nexport class DevidedPagePath {\n\n isRoot: boolean;\n\n isFormerRoot: boolean;\n\n former: string;\n\n latter: string;\n\n constructor(path: string, skipNormalize = false, evalDatePath = false) {\n\n this.isRoot = false;\n this.isFormerRoot = false;\n this.former = '';\n\n // root\n if (path == null || path === '' || path === '/') {\n this.isRoot = true;\n this.latter = '/';\n return;\n }\n\n const pagePath = skipNormalize ? path : pathUtils.normalizePath(path);\n this.latter = pagePath;\n\n // evaluate date path\n if (evalDatePath) {\n const matchDate = pagePath.match(PATTERN_INCLUDE_DATE);\n if (matchDate != null) {\n this.former = matchDate[1];\n this.latter = matchDate[2];\n return;\n }\n }\n\n let PATTERN_DEFAULT = /^((.*)\\/(?!em>))?(.+)$/; // this will ignore em's end tags\n try { // for non-chrome browsers\n // eslint-disable-next-line regex/invalid\n PATTERN_DEFAULT = new RegExp('^((.*)(?<!<)\\\\/)?(.+)$'); // https://regex101.com/r/HJNvMW/1\n }\n catch (err) {\n // lookbehind regex is not supported on non-chrome browsers\n }\n\n const matchDefault = pagePath.match(PATTERN_DEFAULT);\n if (matchDefault != null) {\n this.isFormerRoot = matchDefault[1] === '/';\n this.former = matchDefault[2];\n this.latter = matchDefault[3];\n }\n }\n\n}\n"],"names":["PATTERN_INCLUDE_DATE","DevidedPagePath","path","skipNormalize","evalDatePath","pagePath","pathUtils.normalizePath","matchDate","PATTERN_DEFAULT","matchDefault"],"mappings":"
|
|
1
|
+
{"version":3,"file":"devided-page-path.js","sources":["../../src/models/devided-page-path.ts"],"sourcesContent":["import * as pathUtils from '../utils/path-utils';\n\n// https://regex101.com/r/BahpKX/2\nconst PATTERN_INCLUDE_DATE = /^(.+\\/[^/]+)\\/(\\d{4}|\\d{4}\\/\\d{2}|\\d{4}\\/\\d{2}\\/\\d{2})$/;\n\nexport class DevidedPagePath {\n\n isRoot: boolean;\n\n isFormerRoot: boolean;\n\n former: string;\n\n latter: string;\n\n constructor(path: string, skipNormalize = false, evalDatePath = false) {\n\n this.isRoot = false;\n this.isFormerRoot = false;\n this.former = '';\n\n // root\n if (path == null || path === '' || path === '/') {\n this.isRoot = true;\n this.latter = '/';\n return;\n }\n\n const pagePath = skipNormalize ? path : pathUtils.normalizePath(path);\n this.latter = pagePath;\n\n // evaluate date path\n if (evalDatePath) {\n const matchDate = pagePath.match(PATTERN_INCLUDE_DATE);\n if (matchDate != null) {\n this.former = matchDate[1];\n this.latter = matchDate[2];\n return;\n }\n }\n\n let PATTERN_DEFAULT = /^((.*)\\/(?!em>))?(.+)$/; // this will ignore em's end tags\n try { // for non-chrome browsers\n // eslint-disable-next-line regex/invalid\n PATTERN_DEFAULT = new RegExp('^((.*)(?<!<)\\\\/)?(.+)$'); // https://regex101.com/r/HJNvMW/1\n }\n catch (err) {\n // lookbehind regex is not supported on non-chrome browsers\n }\n\n const matchDefault = pagePath.match(PATTERN_DEFAULT);\n if (matchDefault != null) {\n this.isFormerRoot = matchDefault[1] === '/';\n this.former = matchDefault[2];\n this.latter = matchDefault[3];\n }\n }\n\n}\n"],"names":["PATTERN_INCLUDE_DATE","DevidedPagePath","path","skipNormalize","evalDatePath","__publicField","pagePath","pathUtils.normalizePath","matchDate","PATTERN_DEFAULT","matchDefault"],"mappings":";;;;AAGA,MAAMA,IAAuB;AAEtB,MAAMC,EAAgB;AAAA,EAU3B,YAAYC,GAAcC,IAAgB,IAAOC,IAAe,IAAO;AARvE,IAAAC,EAAA;AAEA,IAAAA,EAAA;AAEA,IAAAA,EAAA;AAEA,IAAAA,EAAA;AASE,QALA,KAAK,SAAS,IACd,KAAK,eAAe,IACpB,KAAK,SAAS,IAGVH,KAAQ,QAAQA,MAAS,MAAMA,MAAS,KAAK;AAC/C,WAAK,SAAS,IACd,KAAK,SAAS;AACd;AAAA,IACF;AAEA,UAAMI,IAAWH,IAAgBD,IAAOK,EAAwBL,CAAI;AAIpE,QAHA,KAAK,SAASI,GAGVF,GAAc;AACV,YAAAI,IAAYF,EAAS,MAAMN,CAAoB;AACrD,UAAIQ,KAAa,MAAM;AAChB,aAAA,SAASA,EAAU,CAAC,GACpB,KAAA,SAASA,EAAU,CAAC;AACzB;AAAA,MACF;AAAA,IACF;AAEA,QAAIC,IAAkB;AAClB,QAAA;AAEgB,MAAAA,IAAA,IAAI,OAAO,wBAAwB;AAAA,YAE3C;AAAA,IAEZ;AAEM,UAAAC,IAAeJ,EAAS,MAAMG,CAAe;AACnD,IAAIC,KAAgB,SACb,KAAA,eAAeA,EAAa,CAAC,MAAM,KACnC,KAAA,SAASA,EAAa,CAAC,GACvB,KAAA,SAASA,EAAa,CAAC;AAAA,EAEhC;AAEF;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class
|
|
1
|
+
"use strict";var a=Object.defineProperty;var d=(e,r,s)=>r in e?a(e,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[r]=s;var t=(e,r,s)=>(d(e,typeof r!="symbol"?r+"":r,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class g extends Error{constructor(s="",o="",i=void 0,c=void 0){super();t(this,"code");t(this,"args");this.message=s,this.code=o,this.stack=i,this.args=c}}exports.ErrorV3=g;
|
|
2
2
|
//# sourceMappingURL=error-apiv3.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-apiv3.cjs","sources":["../../../src/models/vo/error-apiv3.ts"],"sourcesContent":["export class ErrorV3 extends Error {\n\n code: string;\n\n args?: any;\n\n constructor(message = '', code = '', stack = undefined, args: any = undefined) {\n super(); // do not provide message to the super constructor\n this.message = message;\n this.code = code;\n this.stack = stack;\n this.args = args;\n }\n\n}\n"],"names":["ErrorV3","message","code","stack","args"],"mappings":"
|
|
1
|
+
{"version":3,"file":"error-apiv3.cjs","sources":["../../../src/models/vo/error-apiv3.ts"],"sourcesContent":["export class ErrorV3 extends Error {\n\n code: string;\n\n args?: any;\n\n constructor(message = '', code = '', stack = undefined, args: any = undefined) {\n super(); // do not provide message to the super constructor\n this.message = message;\n this.code = code;\n this.stack = stack;\n this.args = args;\n }\n\n}\n"],"names":["ErrorV3","message","code","stack","args","__publicField"],"mappings":"wPAAO,MAAMA,UAAgB,KAAM,CAMjC,YAAYC,EAAU,GAAIC,EAAO,GAAIC,EAAQ,OAAWC,EAAY,OAAW,CACvE,QALRC,EAAA,aAEAA,EAAA,aAIE,KAAK,QAAUJ,EACf,KAAK,KAAOC,EACZ,KAAK,MAAQC,EACb,KAAK,KAAOC,CACd,CAEF"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var a = Object.defineProperty;
|
|
2
|
+
var d = (o, s, r) => s in o ? a(o, s, { enumerable: !0, configurable: !0, writable: !0, value: r }) : o[s] = r;
|
|
3
|
+
var t = (o, s, r) => (d(o, typeof s != "symbol" ? s + "" : s, r), r);
|
|
4
|
+
class g extends Error {
|
|
5
|
+
constructor(r = "", e = "", c = void 0, i = void 0) {
|
|
6
|
+
super();
|
|
7
|
+
t(this, "code");
|
|
8
|
+
t(this, "args");
|
|
9
|
+
this.message = r, this.code = e, this.stack = c, this.args = i;
|
|
4
10
|
}
|
|
5
11
|
}
|
|
6
12
|
export {
|
|
7
|
-
|
|
13
|
+
g as ErrorV3
|
|
8
14
|
};
|
|
9
15
|
//# sourceMappingURL=error-apiv3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-apiv3.js","sources":["../../../src/models/vo/error-apiv3.ts"],"sourcesContent":["export class ErrorV3 extends Error {\n\n code: string;\n\n args?: any;\n\n constructor(message = '', code = '', stack = undefined, args: any = undefined) {\n super(); // do not provide message to the super constructor\n this.message = message;\n this.code = code;\n this.stack = stack;\n this.args = args;\n }\n\n}\n"],"names":["ErrorV3","message","code","stack","args"],"mappings":"AAAO,MAAMA,UAAgB,MAAM;AAAA,EAMjC,YAAYC,IAAU,IAAIC,IAAO,IAAIC,IAAQ,QAAWC,IAAY,QAAW;AACvE,
|
|
1
|
+
{"version":3,"file":"error-apiv3.js","sources":["../../../src/models/vo/error-apiv3.ts"],"sourcesContent":["export class ErrorV3 extends Error {\n\n code: string;\n\n args?: any;\n\n constructor(message = '', code = '', stack = undefined, args: any = undefined) {\n super(); // do not provide message to the super constructor\n this.message = message;\n this.code = code;\n this.stack = stack;\n this.args = args;\n }\n\n}\n"],"names":["ErrorV3","message","code","stack","args","__publicField"],"mappings":";;;AAAO,MAAMA,UAAgB,MAAM;AAAA,EAMjC,YAAYC,IAAU,IAAIC,IAAO,IAAIC,IAAQ,QAAWC,IAAY,QAAW;AACvE;AALR,IAAAC,EAAA;AAEA,IAAAA,EAAA;AAIE,SAAK,UAAUJ,GACf,KAAK,OAAOC,GACZ,KAAK,QAAQC,GACb,KAAK,OAAOC;AAAA,EACd;AAEF;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@growi/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.1.0-next.2e3166abd61b2b5237b29e7b2ed62b17f1a86bef",
|
|
4
4
|
"description": "GROWI Core Libraries",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"eslint-plugin-regex": "^1.8.0",
|
|
73
|
+
"mongoose": "^6.11.3",
|
|
73
74
|
"swr": "^2.2.2"
|
|
74
75
|
}
|
|
75
76
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"websocket.cjs","sources":["../../src/interfaces/websocket.ts"],"sourcesContent":["export const GlobalSocketEventName = {\n // YDoc\n YDocSync: 'ydoc:sync',\n YDocSyncError: 'ydoc:sync:error',\n} as const;\nexport type GlobalSocketEventName = typeof GlobalSocketEventName[keyof typeof GlobalSocketEventName];\n"],"names":["GlobalSocketEventName"],"mappings":"gFAAO,MAAMA,EAAwB,CAEnC,SAAU,YACV,cAAe,iBACjB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"websocket.js","sources":["../../src/interfaces/websocket.ts"],"sourcesContent":["export const GlobalSocketEventName = {\n // YDoc\n YDocSync: 'ydoc:sync',\n YDocSyncError: 'ydoc:sync:error',\n} as const;\nexport type GlobalSocketEventName = typeof GlobalSocketEventName[keyof typeof GlobalSocketEventName];\n"],"names":["GlobalSocketEventName"],"mappings":"AAAO,MAAMA,IAAwB;AAAA;AAAA,EAEnC,UAAU;AAAA,EACV,eAAe;AACjB;"}
|