@growi/core 2.2.0 → 2.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.
Files changed (70) hide show
  1. package/dist/consts/index.cjs +1 -1
  2. package/dist/consts/index.d.ts +1 -0
  3. package/dist/consts/index.js +11 -8
  4. package/dist/consts/index.js.map +1 -1
  5. package/dist/consts/renderer.cjs +2 -0
  6. package/dist/consts/renderer.cjs.map +1 -0
  7. package/dist/consts/renderer.d.ts +12 -0
  8. package/dist/consts/renderer.js +6 -0
  9. package/dist/consts/renderer.js.map +1 -0
  10. package/dist/index.cjs +1 -1
  11. package/dist/index.js +55 -52
  12. package/dist/index.js.map +1 -1
  13. package/dist/interfaces/attachment.d.ts +0 -1
  14. package/dist/interfaces/common.cjs.map +1 -1
  15. package/dist/interfaces/common.d.ts +0 -1
  16. package/dist/interfaces/common.js.map +1 -1
  17. package/dist/interfaces/external-account.d.ts +0 -1
  18. package/dist/interfaces/growi-app-info.cjs.map +1 -1
  19. package/dist/interfaces/growi-app-info.js.map +1 -1
  20. package/dist/interfaces/growi-theme-metadata.cjs.map +1 -1
  21. package/dist/interfaces/page.d.ts +0 -1
  22. package/dist/interfaces/primitive/string.cjs.map +1 -1
  23. package/dist/interfaces/primitive/string.js.map +1 -1
  24. package/dist/interfaces/revision.d.ts +0 -1
  25. package/dist/interfaces/scope.cjs.map +1 -1
  26. package/dist/interfaces/scope.js.map +1 -1
  27. package/dist/interfaces/server/access-token-parser.d.ts +0 -1
  28. package/dist/interfaces/subscription.d.ts +0 -1
  29. package/dist/interfaces/user.d.ts +0 -1
  30. package/dist/models/devided-page-path.cjs.map +1 -1
  31. package/dist/models/devided-page-path.js.map +1 -1
  32. package/dist/models/serializers/attachment-serializer.cjs.map +1 -1
  33. package/dist/models/serializers/attachment-serializer.d.ts +1 -2
  34. package/dist/models/serializers/attachment-serializer.js.map +1 -1
  35. package/dist/models/serializers/user-serializer.cjs.map +1 -1
  36. package/dist/models/serializers/user-serializer.d.ts +0 -1
  37. package/dist/models/serializers/user-serializer.js.map +1 -1
  38. package/dist/models/vo/error-apiv3.cjs.map +1 -1
  39. package/dist/models/vo/error-apiv3.js.map +1 -1
  40. package/dist/remark-plugins/util/option-parser.cjs.map +1 -1
  41. package/dist/remark-plugins/util/option-parser.d.ts +0 -1
  42. package/dist/remark-plugins/util/option-parser.js.map +1 -1
  43. package/dist/swr/with-utils.cjs.map +1 -1
  44. package/dist/swr/with-utils.d.ts +0 -1
  45. package/dist/swr/with-utils.js.map +1 -1
  46. package/dist/utils/browser-utils.cjs.map +1 -1
  47. package/dist/utils/browser-utils.js.map +1 -1
  48. package/dist/utils/env-utils.cjs.map +1 -1
  49. package/dist/utils/env-utils.js.map +1 -1
  50. package/dist/utils/global-event-target.cjs.map +1 -1
  51. package/dist/utils/global-event-target.js.map +1 -1
  52. package/dist/utils/growi-theme-metadata.d.ts +0 -1
  53. package/dist/utils/growi-theme-metadata.js.map +1 -1
  54. package/dist/utils/is-deep-equals.cjs.map +1 -1
  55. package/dist/utils/is-deep-equals.js.map +1 -1
  56. package/dist/utils/objectid-utils.d.ts +0 -1
  57. package/dist/utils/page-path-utils/generate-children-regexp.cjs.map +1 -1
  58. package/dist/utils/page-path-utils/generate-children-regexp.js.map +1 -1
  59. package/dist/utils/page-path-utils/index.cjs.map +1 -1
  60. package/dist/utils/page-path-utils/index.js.map +1 -1
  61. package/dist/utils/page-path-utils/is-top-page.cjs.map +1 -1
  62. package/dist/utils/page-path-utils/is-top-page.js.map +1 -1
  63. package/dist/utils/page-utils.cjs.map +1 -1
  64. package/dist/utils/page-utils.d.ts +0 -1
  65. package/dist/utils/page-utils.js.map +1 -1
  66. package/dist/utils/path-utils.cjs.map +1 -1
  67. package/dist/utils/path-utils.js.map +1 -1
  68. package/dist/utils/template-checker.cjs.map +1 -1
  69. package/dist/utils/template-checker.js.map +1 -1
  70. package/package.json +2 -2
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./accepted-upload-file-type.cjs"),t=require("./growi-plugin.cjs"),e=require("./system.cjs"),o=require("./ydoc-status.cjs");exports.AcceptedUploadFileType=i.AcceptedUploadFileType;exports.GrowiPluginType=t.GrowiPluginType;exports.GrowiDeploymentType=e.GrowiDeploymentType;exports.GrowiServiceType=e.GrowiServiceType;exports.YDocStatus=o.YDocStatus;exports.YJS_WEBSOCKET_BASE_PATH=o.YJS_WEBSOCKET_BASE_PATH;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./accepted-upload-file-type.cjs"),i=require("./growi-plugin.cjs"),e=require("./renderer.cjs"),T=require("./system.cjs"),r=require("./ydoc-status.cjs");exports.AcceptedUploadFileType=o.AcceptedUploadFileType;exports.GrowiPluginType=i.GrowiPluginType;exports.GROWI_IS_CONTENT_RENDERING_ATTR=e.GROWI_IS_CONTENT_RENDERING_ATTR;exports.GROWI_IS_CONTENT_RENDERING_SELECTOR=e.GROWI_IS_CONTENT_RENDERING_SELECTOR;exports.GrowiDeploymentType=T.GrowiDeploymentType;exports.GrowiServiceType=T.GrowiServiceType;exports.YDocStatus=r.YDocStatus;exports.YJS_WEBSOCKET_BASE_PATH=r.YJS_WEBSOCKET_BASE_PATH;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,4 +1,5 @@
1
1
  export * from './accepted-upload-file-type';
2
2
  export * from './growi-plugin';
3
+ export * from './renderer';
3
4
  export * from './system';
4
5
  export * from './ydoc-status';
@@ -1,13 +1,16 @@
1
1
  import { AcceptedUploadFileType as r } from "./accepted-upload-file-type.js";
2
- import { GrowiPluginType as t } from "./growi-plugin.js";
3
- import { GrowiDeploymentType as T, GrowiServiceType as m } from "./system.js";
4
- import { YDocStatus as S, YJS_WEBSOCKET_BASE_PATH as c } from "./ydoc-status.js";
2
+ import { GrowiPluginType as p } from "./growi-plugin.js";
3
+ import { GROWI_IS_CONTENT_RENDERING_ATTR as _, GROWI_IS_CONTENT_RENDERING_SELECTOR as t } from "./renderer.js";
4
+ import { GrowiDeploymentType as R, GrowiServiceType as S } from "./system.js";
5
+ import { YDocStatus as i, YJS_WEBSOCKET_BASE_PATH as m } from "./ydoc-status.js";
5
6
  export {
6
7
  r as AcceptedUploadFileType,
7
- T as GrowiDeploymentType,
8
- t as GrowiPluginType,
9
- m as GrowiServiceType,
10
- S as YDocStatus,
11
- c as YJS_WEBSOCKET_BASE_PATH
8
+ _ as GROWI_IS_CONTENT_RENDERING_ATTR,
9
+ t as GROWI_IS_CONTENT_RENDERING_SELECTOR,
10
+ R as GrowiDeploymentType,
11
+ p as GrowiPluginType,
12
+ S as GrowiServiceType,
13
+ i as YDocStatus,
14
+ m as YJS_WEBSOCKET_BASE_PATH
12
15
  };
13
16
  //# 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":";;;;;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E="data-growi-is-content-rendering",N=`[${E}="true"]`;exports.GROWI_IS_CONTENT_RENDERING_ATTR=E;exports.GROWI_IS_CONTENT_RENDERING_SELECTOR=N;
2
+ //# sourceMappingURL=renderer.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderer.cjs","sources":["../../src/consts/renderer.ts"],"sourcesContent":["/**\n * HTML attribute name applied to elements that are currently being rendered\n * (e.g. Drawio, Mermaid diagrams). Set to \"true\" while rendering is in progress,\n * toggled to \"false\" once rendering is complete.\n * Used by the auto-scroll system to detect in-progress renders before re-scrolling.\n */\nexport const GROWI_IS_CONTENT_RENDERING_ATTR =\n 'data-growi-is-content-rendering' as const;\n\n/**\n * CSS selector matching elements currently rendering (value=\"true\" only).\n * Does not match completed elements (value=\"false\").\n */\nexport const GROWI_IS_CONTENT_RENDERING_SELECTOR =\n `[${GROWI_IS_CONTENT_RENDERING_ATTR}=\"true\"]` as const;\n"],"names":["GROWI_IS_CONTENT_RENDERING_ATTR","GROWI_IS_CONTENT_RENDERING_SELECTOR"],"mappings":"gFAMO,MAAMA,EACX,kCAMWC,EACX,IAAID,CAA+B"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * HTML attribute name applied to elements that are currently being rendered
3
+ * (e.g. Drawio, Mermaid diagrams). Set to "true" while rendering is in progress,
4
+ * toggled to "false" once rendering is complete.
5
+ * Used by the auto-scroll system to detect in-progress renders before re-scrolling.
6
+ */
7
+ export declare const GROWI_IS_CONTENT_RENDERING_ATTR: "data-growi-is-content-rendering";
8
+ /**
9
+ * CSS selector matching elements currently rendering (value="true" only).
10
+ * Does not match completed elements (value="false").
11
+ */
12
+ export declare const GROWI_IS_CONTENT_RENDERING_SELECTOR: "[data-growi-is-content-rendering=\"true\"]";
@@ -0,0 +1,6 @@
1
+ const E = "data-growi-is-content-rendering", N = `[${E}="true"]`;
2
+ export {
3
+ E as GROWI_IS_CONTENT_RENDERING_ATTR,
4
+ N as GROWI_IS_CONTENT_RENDERING_SELECTOR
5
+ };
6
+ //# sourceMappingURL=renderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderer.js","sources":["../../src/consts/renderer.ts"],"sourcesContent":["/**\n * HTML attribute name applied to elements that are currently being rendered\n * (e.g. Drawio, Mermaid diagrams). Set to \"true\" while rendering is in progress,\n * toggled to \"false\" once rendering is complete.\n * Used by the auto-scroll system to detect in-progress renders before re-scrolling.\n */\nexport const GROWI_IS_CONTENT_RENDERING_ATTR =\n 'data-growi-is-content-rendering' as const;\n\n/**\n * CSS selector matching elements currently rendering (value=\"true\" only).\n * Does not match completed elements (value=\"false\").\n */\nexport const GROWI_IS_CONTENT_RENDERING_SELECTOR =\n `[${GROWI_IS_CONTENT_RENDERING_ATTR}=\"true\"]` as const;\n"],"names":["GROWI_IS_CONTENT_RENDERING_ATTR","GROWI_IS_CONTENT_RENDERING_SELECTOR"],"mappings":"AAMO,MAAMA,IACX,mCAMWC,IACX,IAAID,CAA+B;"}
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./consts/accepted-upload-file-type.cjs"),u=require("./consts/growi-plugin.cjs"),r=require("./consts/system.cjs"),t=require("./consts/ydoc-status.cjs"),l=require("./interfaces/color-scheme.cjs"),o=require("./interfaces/common.cjs"),s=require("./interfaces/config-manager.cjs"),y=require("./interfaces/growi-app-info.cjs"),a=require("./interfaces/growi-theme-metadata.cjs"),g=require("./interfaces/lang.cjs"),e=require("./interfaces/page.cjs"),i=require("./interfaces/primitive/string.cjs"),S=require("./interfaces/revision.cjs"),n=require("./interfaces/scope.cjs"),p=require("./interfaces/subscription.cjs"),T=require("./interfaces/user.cjs");exports.AcceptedUploadFileType=c.AcceptedUploadFileType;exports.GrowiPluginType=u.GrowiPluginType;exports.GrowiDeploymentType=r.GrowiDeploymentType;exports.GrowiServiceType=r.GrowiServiceType;exports.YDocStatus=t.YDocStatus;exports.YJS_WEBSOCKET_BASE_PATH=t.YJS_WEBSOCKET_BASE_PATH;exports.ColorScheme=l.ColorScheme;exports.getIdForRef=o.getIdForRef;exports.getIdStringForRef=o.getIdStringForRef;exports.isPopulated=o.isPopulated;exports.isRef=o.isRef;exports.ConfigSource=s.ConfigSource;exports.defineConfig=s.defineConfig;exports.GrowiWikiType=y.GrowiWikiType;exports.GrowiThemeSchemeType=a.GrowiThemeSchemeType;exports.isGrowiThemeMetadata=a.isGrowiThemeMetadata;exports.AllLang=g.AllLang;exports.Lang=g.Lang;exports.GroupType=e.GroupType;exports.PageGrant=e.PageGrant;exports.PageStatus=e.PageStatus;exports.isIPageInfo=e.isIPageInfo;exports.isIPageInfoForEmpty=e.isIPageInfoForEmpty;exports.isIPageInfoForEntity=e.isIPageInfoForEntity;exports.isIPageInfoForListing=e.isIPageInfoForListing;exports.isIPageInfoForOperation=e.isIPageInfoForOperation;exports.isIPageNotFoundInfo=e.isIPageNotFoundInfo;exports.isNonBlankString=i.isNonBlankString;exports.isNonEmptyString=i.isNonEmptyString;exports.toNonBlankString=i.toNonBlankString;exports.toNonBlankStringOrUndefined=i.toNonBlankStringOrUndefined;exports.toNonEmptyString=i.toNonEmptyString;exports.toNonEmptyStringOrUndefined=i.toNonEmptyStringOrUndefined;exports.Origin=S.Origin;exports.allOrigin=S.allOrigin;exports.ACTION=n.ACTION;exports.ALL_SIGN=n.ALL_SIGN;exports.SCOPE=n.SCOPE;exports.AllSubscriptionStatusType=p.AllSubscriptionStatusType;exports.SubscriptionStatusType=p.SubscriptionStatusType;exports.USER_STATUS=T.USER_STATUS;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./consts/accepted-upload-file-type.cjs"),u=require("./consts/growi-plugin.cjs"),r=require("./consts/renderer.cjs"),t=require("./consts/system.cjs"),s=require("./consts/ydoc-status.cjs"),I=require("./interfaces/color-scheme.cjs"),o=require("./interfaces/common.cjs"),a=require("./interfaces/config-manager.cjs"),l=require("./interfaces/growi-app-info.cjs"),g=require("./interfaces/growi-theme-metadata.cjs"),S=require("./interfaces/lang.cjs"),e=require("./interfaces/page.cjs"),i=require("./interfaces/primitive/string.cjs"),p=require("./interfaces/revision.cjs"),n=require("./interfaces/scope.cjs"),T=require("./interfaces/subscription.cjs"),E=require("./interfaces/user.cjs");exports.AcceptedUploadFileType=c.AcceptedUploadFileType;exports.GrowiPluginType=u.GrowiPluginType;exports.GROWI_IS_CONTENT_RENDERING_ATTR=r.GROWI_IS_CONTENT_RENDERING_ATTR;exports.GROWI_IS_CONTENT_RENDERING_SELECTOR=r.GROWI_IS_CONTENT_RENDERING_SELECTOR;exports.GrowiDeploymentType=t.GrowiDeploymentType;exports.GrowiServiceType=t.GrowiServiceType;exports.YDocStatus=s.YDocStatus;exports.YJS_WEBSOCKET_BASE_PATH=s.YJS_WEBSOCKET_BASE_PATH;exports.ColorScheme=I.ColorScheme;exports.getIdForRef=o.getIdForRef;exports.getIdStringForRef=o.getIdStringForRef;exports.isPopulated=o.isPopulated;exports.isRef=o.isRef;exports.ConfigSource=a.ConfigSource;exports.defineConfig=a.defineConfig;exports.GrowiWikiType=l.GrowiWikiType;exports.GrowiThemeSchemeType=g.GrowiThemeSchemeType;exports.isGrowiThemeMetadata=g.isGrowiThemeMetadata;exports.AllLang=S.AllLang;exports.Lang=S.Lang;exports.GroupType=e.GroupType;exports.PageGrant=e.PageGrant;exports.PageStatus=e.PageStatus;exports.isIPageInfo=e.isIPageInfo;exports.isIPageInfoForEmpty=e.isIPageInfoForEmpty;exports.isIPageInfoForEntity=e.isIPageInfoForEntity;exports.isIPageInfoForListing=e.isIPageInfoForListing;exports.isIPageInfoForOperation=e.isIPageInfoForOperation;exports.isIPageNotFoundInfo=e.isIPageNotFoundInfo;exports.isNonBlankString=i.isNonBlankString;exports.isNonEmptyString=i.isNonEmptyString;exports.toNonBlankString=i.toNonBlankString;exports.toNonBlankStringOrUndefined=i.toNonBlankStringOrUndefined;exports.toNonEmptyString=i.toNonEmptyString;exports.toNonEmptyStringOrUndefined=i.toNonEmptyStringOrUndefined;exports.Origin=p.Origin;exports.allOrigin=p.allOrigin;exports.ACTION=n.ACTION;exports.ALL_SIGN=n.ALL_SIGN;exports.SCOPE=n.SCOPE;exports.AllSubscriptionStatusType=T.AllSubscriptionStatusType;exports.SubscriptionStatusType=T.SubscriptionStatusType;exports.USER_STATUS=E.USER_STATUS;
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -1,60 +1,63 @@
1
- import { AcceptedUploadFileType as r } from "./consts/accepted-upload-file-type.js";
1
+ import { AcceptedUploadFileType as e } from "./consts/accepted-upload-file-type.js";
2
2
  import { GrowiPluginType as i } from "./consts/growi-plugin.js";
3
- import { GrowiDeploymentType as p, GrowiServiceType as f } from "./consts/system.js";
4
- import { YDocStatus as g, YJS_WEBSOCKET_BASE_PATH as m } from "./consts/ydoc-status.js";
5
- import { ColorScheme as s } from "./interfaces/color-scheme.js";
6
- import { getIdForRef as I, getIdStringForRef as T, isPopulated as l, isRef as y } from "./interfaces/common.js";
7
- import { ConfigSource as P, defineConfig as u } from "./interfaces/config-manager.js";
8
- import { GrowiWikiType as c } from "./interfaces/growi-app-info.js";
9
- import { GrowiThemeSchemeType as N, isGrowiThemeMetadata as A } from "./interfaces/growi-theme-metadata.js";
10
- import { AllLang as O, Lang as w } from "./interfaces/lang.js";
11
- import { GroupType as B, PageGrant as L, PageStatus as U, isIPageInfo as _, isIPageInfoForEmpty as h, isIPageInfoForEntity as k, isIPageInfoForListing as R, isIPageInfoForOperation as b, isIPageNotFoundInfo as D } from "./interfaces/page.js";
12
- import { isNonBlankString as Y, isNonEmptyString as v, toNonBlankString as H, toNonBlankStringOrUndefined as J, toNonEmptyString as K, toNonEmptyStringOrUndefined as M } from "./interfaces/primitive/string.js";
13
- import { Origin as q, allOrigin as z } from "./interfaces/revision.js";
14
- import { ACTION as V, ALL_SIGN as X, SCOPE as Z } from "./interfaces/scope.js";
15
- import { AllSubscriptionStatusType as oo, SubscriptionStatusType as eo } from "./interfaces/subscription.js";
16
- import { USER_STATUS as to } from "./interfaces/user.js";
3
+ import { GROWI_IS_CONTENT_RENDERING_ATTR as p, GROWI_IS_CONTENT_RENDERING_SELECTOR as f } from "./consts/renderer.js";
4
+ import { GrowiDeploymentType as m, GrowiServiceType as a } from "./consts/system.js";
5
+ import { YDocStatus as T, YJS_WEBSOCKET_BASE_PATH as I } from "./consts/ydoc-status.js";
6
+ import { ColorScheme as E } from "./interfaces/color-scheme.js";
7
+ import { getIdForRef as N, getIdStringForRef as l, isPopulated as y, isRef as G } from "./interfaces/common.js";
8
+ import { ConfigSource as _, defineConfig as d } from "./interfaces/config-manager.js";
9
+ import { GrowiWikiType as R } from "./interfaces/growi-app-info.js";
10
+ import { GrowiThemeSchemeType as c, isGrowiThemeMetadata as A } from "./interfaces/growi-theme-metadata.js";
11
+ import { AllLang as F, Lang as w } from "./interfaces/lang.js";
12
+ import { GroupType as B, PageGrant as U, PageStatus as h, isIPageInfo as k, isIPageInfoForEmpty as D, isIPageInfoForEntity as W, isIPageInfoForListing as b, isIPageInfoForOperation as Y, isIPageNotFoundInfo as v } from "./interfaces/page.js";
13
+ import { isNonBlankString as J, isNonEmptyString as K, toNonBlankString as M, toNonBlankStringOrUndefined as j, toNonEmptyString as q, toNonEmptyStringOrUndefined as z } from "./interfaces/primitive/string.js";
14
+ import { Origin as V, allOrigin as X } from "./interfaces/revision.js";
15
+ import { ACTION as $, ALL_SIGN as oo, SCOPE as ro } from "./interfaces/scope.js";
16
+ import { AllSubscriptionStatusType as to, SubscriptionStatusType as io } from "./interfaces/subscription.js";
17
+ import { USER_STATUS as po } from "./interfaces/user.js";
17
18
  export {
18
- V as ACTION,
19
- X as ALL_SIGN,
20
- r as AcceptedUploadFileType,
21
- O as AllLang,
22
- oo as AllSubscriptionStatusType,
23
- s as ColorScheme,
24
- P as ConfigSource,
19
+ $ as ACTION,
20
+ oo as ALL_SIGN,
21
+ e as AcceptedUploadFileType,
22
+ F as AllLang,
23
+ to as AllSubscriptionStatusType,
24
+ E as ColorScheme,
25
+ _ as ConfigSource,
26
+ p as GROWI_IS_CONTENT_RENDERING_ATTR,
27
+ f as GROWI_IS_CONTENT_RENDERING_SELECTOR,
25
28
  B as GroupType,
26
- p as GrowiDeploymentType,
29
+ m as GrowiDeploymentType,
27
30
  i as GrowiPluginType,
28
- f as GrowiServiceType,
29
- N as GrowiThemeSchemeType,
30
- c as GrowiWikiType,
31
+ a as GrowiServiceType,
32
+ c as GrowiThemeSchemeType,
33
+ R as GrowiWikiType,
31
34
  w as Lang,
32
- q as Origin,
33
- L as PageGrant,
34
- U as PageStatus,
35
- Z as SCOPE,
36
- eo as SubscriptionStatusType,
37
- to as USER_STATUS,
38
- g as YDocStatus,
39
- m as YJS_WEBSOCKET_BASE_PATH,
40
- z as allOrigin,
41
- u as defineConfig,
42
- I as getIdForRef,
43
- T as getIdStringForRef,
35
+ V as Origin,
36
+ U as PageGrant,
37
+ h as PageStatus,
38
+ ro as SCOPE,
39
+ io as SubscriptionStatusType,
40
+ po as USER_STATUS,
41
+ T as YDocStatus,
42
+ I as YJS_WEBSOCKET_BASE_PATH,
43
+ X as allOrigin,
44
+ d as defineConfig,
45
+ N as getIdForRef,
46
+ l as getIdStringForRef,
44
47
  A as isGrowiThemeMetadata,
45
- _ as isIPageInfo,
46
- h as isIPageInfoForEmpty,
47
- k as isIPageInfoForEntity,
48
- R as isIPageInfoForListing,
49
- b as isIPageInfoForOperation,
50
- D as isIPageNotFoundInfo,
51
- Y as isNonBlankString,
52
- v as isNonEmptyString,
53
- l as isPopulated,
54
- y as isRef,
55
- H as toNonBlankString,
56
- J as toNonBlankStringOrUndefined,
57
- K as toNonEmptyString,
58
- M as toNonEmptyStringOrUndefined
48
+ k as isIPageInfo,
49
+ D as isIPageInfoForEmpty,
50
+ W as isIPageInfoForEntity,
51
+ b as isIPageInfoForListing,
52
+ Y as isIPageInfoForOperation,
53
+ v as isIPageNotFoundInfo,
54
+ J as isNonBlankString,
55
+ K as isNonEmptyString,
56
+ y as isPopulated,
57
+ G as isRef,
58
+ M as toNonBlankString,
59
+ j as toNonBlankStringOrUndefined,
60
+ q as toNonEmptyString,
61
+ z as toNonEmptyStringOrUndefined
59
62
  };
60
63
  //# 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":";;;;;;;;;;;;;;;;;"}
@@ -2,7 +2,6 @@ import { Ref } from './common';
2
2
  import { HasObjectId } from './has-object-id';
3
3
  import { IPage } from './page';
4
4
  import { IUser } from './user';
5
-
6
5
  export type IAttachment = {
7
6
  page?: Ref<IPage>;
8
7
  creator?: Ref<IUser>;
@@ -1 +1 @@
1
- {"version":3,"file":"common.cjs","sources":["../../src/interfaces/common.ts"],"sourcesContent":["/*\n * Common types and interfaces\n */\n\nimport type { Types } from 'mongoose';\n\nimport { isValidObjectId } from '../utils/objectid-utils';\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 isRef = <T>(obj: unknown): obj is Ref<T> => {\n return (\n obj != null &&\n ((typeof obj === 'string' && isValidObjectId(obj)) ||\n (typeof obj === 'object' &&\n '_bsontype' in obj &&\n obj._bsontype === 'ObjectID') ||\n (typeof obj === 'object' && '_id' in obj))\n );\n};\n\nexport const isPopulated = <T>(\n ref: Ref<T>,\n): ref is T & { _id: string | ObjectId } => {\n return (\n ref != null &&\n typeof ref !== 'string' &&\n !('_bsontype' in ref && ref._bsontype === 'ObjectID')\n );\n};\n\nexport const getIdForRef = <T>(ref: Ref<T>): string | ObjectId => {\n return isPopulated(ref) ? ref._id : ref;\n};\n\nexport const getIdStringForRef = <T>(ref: Ref<T>): string => {\n return getIdForRef(ref).toString();\n};\n"],"names":["isRef","obj","isValidObjectId","isPopulated","ref","getIdForRef","getIdStringForRef"],"mappings":"+HAeaA,EAAYC,GAErBA,GAAO,OACL,OAAOA,GAAQ,UAAYC,kBAAgBD,CAAG,GAC7C,OAAOA,GAAQ,UACd,cAAeA,GACfA,EAAI,YAAc,YACnB,OAAOA,GAAQ,UAAY,QAASA,GAI9BE,EACXC,GAGEA,GAAO,MACP,OAAOA,GAAQ,UACf,EAAE,cAAeA,GAAOA,EAAI,YAAc,YAIjCC,EAAkBD,GACtBD,EAAYC,CAAG,EAAIA,EAAI,IAAMA,EAGzBE,EAAwBF,GAC5BC,EAAYD,CAAG,EAAE,SAAS"}
1
+ {"version":3,"file":"common.cjs","sources":["../../src/interfaces/common.ts"],"sourcesContent":["/*\n * Common types and interfaces\n */\n\nimport type { Types } from 'mongoose';\n\nimport { isValidObjectId } from '../utils/objectid-utils';\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 isRef = <T>(obj: unknown): obj is Ref<T> => {\n return (\n obj != null &&\n ((typeof obj === 'string' && isValidObjectId(obj)) ||\n (typeof obj === 'object' &&\n '_bsontype' in obj &&\n obj._bsontype === 'ObjectID') ||\n (typeof obj === 'object' && '_id' in obj))\n );\n};\n\nexport const isPopulated = <T>(\n ref: Ref<T>,\n): ref is T & { _id: string | ObjectId } => {\n return (\n ref != null &&\n typeof ref !== 'string' &&\n !('_bsontype' in ref && ref._bsontype === 'ObjectID')\n );\n};\n\nexport const getIdForRef = <T>(ref: Ref<T>): string | ObjectId => {\n return isPopulated(ref) ? ref._id : ref;\n};\n\nexport const getIdStringForRef = <T>(ref: Ref<T>): string => {\n return getIdForRef(ref).toString();\n};\n"],"names":["isRef","obj","isValidObjectId","isPopulated","ref","getIdForRef","getIdStringForRef"],"mappings":"+HAeaA,EAAYC,GAErBA,GAAO,OACL,OAAOA,GAAQ,UAAYC,kBAAgBD,CAAG,GAC7C,OAAOA,GAAQ,UACd,cAAeA,GACfA,EAAI,YAAc,YACnB,OAAOA,GAAQ,UAAY,QAASA,GAI9BE,EACXC,GAGEA,GAAO,MACP,OAAOA,GAAQ,UACf,EAAE,cAAeA,GAAOA,EAAI,YAAc,YAIjCC,EAAkBD,GACtBD,EAAYC,CAAG,EAAIA,EAAI,IAAMA,EAGzBE,EAAwBF,GAC5BC,EAAYD,CAAG,EAAE,SAAA"}
@@ -1,5 +1,4 @@
1
1
  import { Types } from 'mongoose';
2
-
3
2
  type ObjectId = Types.ObjectId;
4
3
  export type Ref<T> = string | ObjectId | (T & {
5
4
  _id: string | ObjectId;
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sources":["../../src/interfaces/common.ts"],"sourcesContent":["/*\n * Common types and interfaces\n */\n\nimport type { Types } from 'mongoose';\n\nimport { isValidObjectId } from '../utils/objectid-utils';\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 isRef = <T>(obj: unknown): obj is Ref<T> => {\n return (\n obj != null &&\n ((typeof obj === 'string' && isValidObjectId(obj)) ||\n (typeof obj === 'object' &&\n '_bsontype' in obj &&\n obj._bsontype === 'ObjectID') ||\n (typeof obj === 'object' && '_id' in obj))\n );\n};\n\nexport const isPopulated = <T>(\n ref: Ref<T>,\n): ref is T & { _id: string | ObjectId } => {\n return (\n ref != null &&\n typeof ref !== 'string' &&\n !('_bsontype' in ref && ref._bsontype === 'ObjectID')\n );\n};\n\nexport const getIdForRef = <T>(ref: Ref<T>): string | ObjectId => {\n return isPopulated(ref) ? ref._id : ref;\n};\n\nexport const getIdStringForRef = <T>(ref: Ref<T>): string => {\n return getIdForRef(ref).toString();\n};\n"],"names":["isRef","obj","isValidObjectId","isPopulated","ref","getIdForRef","getIdStringForRef"],"mappings":";AAea,MAAAA,IAAQ,CAAIC,MAErBA,KAAO,SACL,OAAOA,KAAQ,YAAYC,EAAgBD,CAAG,KAC7C,OAAOA,KAAQ,YACd,eAAeA,KACfA,EAAI,cAAc,cACnB,OAAOA,KAAQ,YAAY,SAASA,IAI9BE,IAAc,CACzBC,MAGEA,KAAO,QACP,OAAOA,KAAQ,YACf,EAAE,eAAeA,KAAOA,EAAI,cAAc,aAIjCC,IAAc,CAAID,MACtBD,EAAYC,CAAG,IAAIA,EAAI,MAAMA,GAGzBE,IAAoB,CAAIF,MAC5BC,EAAYD,CAAG,EAAE,SAAS;"}
1
+ {"version":3,"file":"common.js","sources":["../../src/interfaces/common.ts"],"sourcesContent":["/*\n * Common types and interfaces\n */\n\nimport type { Types } from 'mongoose';\n\nimport { isValidObjectId } from '../utils/objectid-utils';\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 isRef = <T>(obj: unknown): obj is Ref<T> => {\n return (\n obj != null &&\n ((typeof obj === 'string' && isValidObjectId(obj)) ||\n (typeof obj === 'object' &&\n '_bsontype' in obj &&\n obj._bsontype === 'ObjectID') ||\n (typeof obj === 'object' && '_id' in obj))\n );\n};\n\nexport const isPopulated = <T>(\n ref: Ref<T>,\n): ref is T & { _id: string | ObjectId } => {\n return (\n ref != null &&\n typeof ref !== 'string' &&\n !('_bsontype' in ref && ref._bsontype === 'ObjectID')\n );\n};\n\nexport const getIdForRef = <T>(ref: Ref<T>): string | ObjectId => {\n return isPopulated(ref) ? ref._id : ref;\n};\n\nexport const getIdStringForRef = <T>(ref: Ref<T>): string => {\n return getIdForRef(ref).toString();\n};\n"],"names":["isRef","obj","isValidObjectId","isPopulated","ref","getIdForRef","getIdStringForRef"],"mappings":";AAeO,MAAMA,IAAQ,CAAIC,MAErBA,KAAO,SACL,OAAOA,KAAQ,YAAYC,EAAgBD,CAAG,KAC7C,OAAOA,KAAQ,YACd,eAAeA,KACfA,EAAI,cAAc,cACnB,OAAOA,KAAQ,YAAY,SAASA,IAI9BE,IAAc,CACzBC,MAGEA,KAAO,QACP,OAAOA,KAAQ,YACf,EAAE,eAAeA,KAAOA,EAAI,cAAc,aAIjCC,IAAc,CAAID,MACtBD,EAAYC,CAAG,IAAIA,EAAI,MAAMA,GAGzBE,IAAoB,CAAIF,MAC5BC,EAAYD,CAAG,EAAE,SAAA;"}
@@ -1,6 +1,5 @@
1
1
  import { Ref } from './common';
2
2
  import { IUser } from './user';
3
-
4
3
  export type IExternalAccount<P> = {
5
4
  providerType: P;
6
5
  accountId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"growi-app-info.cjs","sources":["../../src/interfaces/growi-app-info.ts"],"sourcesContent":["import type * as os from 'node:os';\n\nimport type { GrowiDeploymentType, GrowiServiceType } from '../consts/system';\n\nexport const GrowiWikiType = { open: 'open', closed: 'closed' } as const;\ntype GrowiWikiType = (typeof GrowiWikiType)[keyof typeof GrowiWikiType];\n\n// Info options for additionalInfo selection\nexport interface GrowiInfoOptions {\n includeAttachmentInfo?: boolean;\n includeInstalledInfo?: boolean;\n includeUserCountInfo?: boolean;\n includePageCountInfo?: boolean;\n // Future extensions can be added here\n}\n\ninterface IGrowiOSInfo {\n type?: ReturnType<typeof os.type>;\n platform?: ReturnType<typeof os.platform>;\n arch?: ReturnType<typeof os.arch>;\n totalmem?: ReturnType<typeof os.totalmem>;\n}\n\ninterface IAdditionalAttachmentInfo {\n attachmentType: string;\n activeExternalAccountTypes: string[];\n}\n\ninterface IAdditionalInstalledAtInfo {\n installedAt: Date;\n installedAtByOldestUser: Date | null;\n}\n\ninterface IAdditionalUserCountInfo {\n currentUsersCount: number;\n currentActiveUsersCount: number;\n}\n\ninterface IAdditionalPageCountInfo {\n currentPagesCount: number;\n}\n\nexport interface IGrowiAdditionalInfo\n extends IAdditionalInstalledAtInfo,\n IAdditionalUserCountInfo,\n IAdditionalPageCountInfo,\n IAdditionalAttachmentInfo {}\n\n// Type mapping for flexible options\nexport type IGrowiAdditionalInfoByOptions<T extends GrowiInfoOptions> =\n (T['includeAttachmentInfo'] extends true\n ? IAdditionalAttachmentInfo\n : Record<string, never>) &\n (T['includeInstalledInfo'] extends true\n ? IAdditionalInstalledAtInfo\n : Record<string, never>) &\n (T['includeUserCountInfo'] extends true\n ? IAdditionalUserCountInfo\n : Record<string, never>) &\n (T['includePageCountInfo'] extends true\n ? IAdditionalPageCountInfo\n : Record<string, never>);\n\n// Helper type to check if any option is enabled\nexport type HasAnyOption<T extends GrowiInfoOptions> =\n T['includeAttachmentInfo'] extends true\n ? true\n : T['includeInstalledInfo'] extends true\n ? true\n : T['includeUserCountInfo'] extends true\n ? true\n : T['includePageCountInfo'] extends true\n ? true\n : false;\n\n// Final result type based on options\nexport type IGrowiAdditionalInfoResult<T extends GrowiInfoOptions> =\n HasAnyOption<T> extends true ? IGrowiAdditionalInfoByOptions<T> : undefined;\n\nexport interface IGrowiInfo<A extends object | undefined = undefined> {\n serviceInstanceId: string;\n appSiteUrl: string;\n osInfo: IGrowiOSInfo;\n version: string;\n type: GrowiServiceType;\n wikiType: GrowiWikiType;\n deploymentType: GrowiDeploymentType;\n additionalInfo?: A;\n}\n"],"names":["GrowiWikiType"],"mappings":"gFAIO,MAAMA,EAAgB,CAAE,KAAM,OAAQ,OAAQ,QAAS"}
1
+ {"version":3,"file":"growi-app-info.cjs","sources":["../../src/interfaces/growi-app-info.ts"],"sourcesContent":["import type * as os from 'node:os';\n\nimport type { GrowiDeploymentType, GrowiServiceType } from '../consts/system';\n\nexport const GrowiWikiType = { open: 'open', closed: 'closed' } as const;\ntype GrowiWikiType = (typeof GrowiWikiType)[keyof typeof GrowiWikiType];\n\n// Info options for additionalInfo selection\nexport interface GrowiInfoOptions {\n includeAttachmentInfo?: boolean;\n includeInstalledInfo?: boolean;\n includeUserCountInfo?: boolean;\n includePageCountInfo?: boolean;\n // Future extensions can be added here\n}\n\ninterface IGrowiOSInfo {\n type?: ReturnType<typeof os.type>;\n platform?: ReturnType<typeof os.platform>;\n arch?: ReturnType<typeof os.arch>;\n totalmem?: ReturnType<typeof os.totalmem>;\n}\n\ninterface IAdditionalAttachmentInfo {\n attachmentType: string;\n activeExternalAccountTypes: string[];\n}\n\ninterface IAdditionalInstalledAtInfo {\n installedAt: Date;\n installedAtByOldestUser: Date | null;\n}\n\ninterface IAdditionalUserCountInfo {\n currentUsersCount: number;\n currentActiveUsersCount: number;\n}\n\ninterface IAdditionalPageCountInfo {\n currentPagesCount: number;\n}\n\nexport interface IGrowiAdditionalInfo\n extends IAdditionalInstalledAtInfo,\n IAdditionalUserCountInfo,\n IAdditionalPageCountInfo,\n IAdditionalAttachmentInfo {}\n\n// Type mapping for flexible options\nexport type IGrowiAdditionalInfoByOptions<T extends GrowiInfoOptions> =\n (T['includeAttachmentInfo'] extends true\n ? IAdditionalAttachmentInfo\n : Record<string, never>) &\n (T['includeInstalledInfo'] extends true\n ? IAdditionalInstalledAtInfo\n : Record<string, never>) &\n (T['includeUserCountInfo'] extends true\n ? IAdditionalUserCountInfo\n : Record<string, never>) &\n (T['includePageCountInfo'] extends true\n ? IAdditionalPageCountInfo\n : Record<string, never>);\n\n// Helper type to check if any option is enabled\nexport type HasAnyOption<T extends GrowiInfoOptions> =\n T['includeAttachmentInfo'] extends true\n ? true\n : T['includeInstalledInfo'] extends true\n ? true\n : T['includeUserCountInfo'] extends true\n ? true\n : T['includePageCountInfo'] extends true\n ? true\n : false;\n\n// Final result type based on options\nexport type IGrowiAdditionalInfoResult<T extends GrowiInfoOptions> =\n HasAnyOption<T> extends true ? IGrowiAdditionalInfoByOptions<T> : undefined;\n\nexport interface IGrowiInfo<A extends object | undefined = undefined> {\n serviceInstanceId: string;\n appSiteUrl: string;\n osInfo: IGrowiOSInfo;\n version: string;\n type: GrowiServiceType;\n wikiType: GrowiWikiType;\n deploymentType: GrowiDeploymentType;\n additionalInfo?: A;\n}\n"],"names":["GrowiWikiType"],"mappings":"gFAIO,MAAMA,EAAgB,CAAE,KAAM,OAAQ,OAAQ,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"growi-app-info.js","sources":["../../src/interfaces/growi-app-info.ts"],"sourcesContent":["import type * as os from 'node:os';\n\nimport type { GrowiDeploymentType, GrowiServiceType } from '../consts/system';\n\nexport const GrowiWikiType = { open: 'open', closed: 'closed' } as const;\ntype GrowiWikiType = (typeof GrowiWikiType)[keyof typeof GrowiWikiType];\n\n// Info options for additionalInfo selection\nexport interface GrowiInfoOptions {\n includeAttachmentInfo?: boolean;\n includeInstalledInfo?: boolean;\n includeUserCountInfo?: boolean;\n includePageCountInfo?: boolean;\n // Future extensions can be added here\n}\n\ninterface IGrowiOSInfo {\n type?: ReturnType<typeof os.type>;\n platform?: ReturnType<typeof os.platform>;\n arch?: ReturnType<typeof os.arch>;\n totalmem?: ReturnType<typeof os.totalmem>;\n}\n\ninterface IAdditionalAttachmentInfo {\n attachmentType: string;\n activeExternalAccountTypes: string[];\n}\n\ninterface IAdditionalInstalledAtInfo {\n installedAt: Date;\n installedAtByOldestUser: Date | null;\n}\n\ninterface IAdditionalUserCountInfo {\n currentUsersCount: number;\n currentActiveUsersCount: number;\n}\n\ninterface IAdditionalPageCountInfo {\n currentPagesCount: number;\n}\n\nexport interface IGrowiAdditionalInfo\n extends IAdditionalInstalledAtInfo,\n IAdditionalUserCountInfo,\n IAdditionalPageCountInfo,\n IAdditionalAttachmentInfo {}\n\n// Type mapping for flexible options\nexport type IGrowiAdditionalInfoByOptions<T extends GrowiInfoOptions> =\n (T['includeAttachmentInfo'] extends true\n ? IAdditionalAttachmentInfo\n : Record<string, never>) &\n (T['includeInstalledInfo'] extends true\n ? IAdditionalInstalledAtInfo\n : Record<string, never>) &\n (T['includeUserCountInfo'] extends true\n ? IAdditionalUserCountInfo\n : Record<string, never>) &\n (T['includePageCountInfo'] extends true\n ? IAdditionalPageCountInfo\n : Record<string, never>);\n\n// Helper type to check if any option is enabled\nexport type HasAnyOption<T extends GrowiInfoOptions> =\n T['includeAttachmentInfo'] extends true\n ? true\n : T['includeInstalledInfo'] extends true\n ? true\n : T['includeUserCountInfo'] extends true\n ? true\n : T['includePageCountInfo'] extends true\n ? true\n : false;\n\n// Final result type based on options\nexport type IGrowiAdditionalInfoResult<T extends GrowiInfoOptions> =\n HasAnyOption<T> extends true ? IGrowiAdditionalInfoByOptions<T> : undefined;\n\nexport interface IGrowiInfo<A extends object | undefined = undefined> {\n serviceInstanceId: string;\n appSiteUrl: string;\n osInfo: IGrowiOSInfo;\n version: string;\n type: GrowiServiceType;\n wikiType: GrowiWikiType;\n deploymentType: GrowiDeploymentType;\n additionalInfo?: A;\n}\n"],"names":["GrowiWikiType"],"mappings":"AAIO,MAAMA,IAAgB,EAAE,MAAM,QAAQ,QAAQ,SAAS;"}
1
+ {"version":3,"file":"growi-app-info.js","sources":["../../src/interfaces/growi-app-info.ts"],"sourcesContent":["import type * as os from 'node:os';\n\nimport type { GrowiDeploymentType, GrowiServiceType } from '../consts/system';\n\nexport const GrowiWikiType = { open: 'open', closed: 'closed' } as const;\ntype GrowiWikiType = (typeof GrowiWikiType)[keyof typeof GrowiWikiType];\n\n// Info options for additionalInfo selection\nexport interface GrowiInfoOptions {\n includeAttachmentInfo?: boolean;\n includeInstalledInfo?: boolean;\n includeUserCountInfo?: boolean;\n includePageCountInfo?: boolean;\n // Future extensions can be added here\n}\n\ninterface IGrowiOSInfo {\n type?: ReturnType<typeof os.type>;\n platform?: ReturnType<typeof os.platform>;\n arch?: ReturnType<typeof os.arch>;\n totalmem?: ReturnType<typeof os.totalmem>;\n}\n\ninterface IAdditionalAttachmentInfo {\n attachmentType: string;\n activeExternalAccountTypes: string[];\n}\n\ninterface IAdditionalInstalledAtInfo {\n installedAt: Date;\n installedAtByOldestUser: Date | null;\n}\n\ninterface IAdditionalUserCountInfo {\n currentUsersCount: number;\n currentActiveUsersCount: number;\n}\n\ninterface IAdditionalPageCountInfo {\n currentPagesCount: number;\n}\n\nexport interface IGrowiAdditionalInfo\n extends IAdditionalInstalledAtInfo,\n IAdditionalUserCountInfo,\n IAdditionalPageCountInfo,\n IAdditionalAttachmentInfo {}\n\n// Type mapping for flexible options\nexport type IGrowiAdditionalInfoByOptions<T extends GrowiInfoOptions> =\n (T['includeAttachmentInfo'] extends true\n ? IAdditionalAttachmentInfo\n : Record<string, never>) &\n (T['includeInstalledInfo'] extends true\n ? IAdditionalInstalledAtInfo\n : Record<string, never>) &\n (T['includeUserCountInfo'] extends true\n ? IAdditionalUserCountInfo\n : Record<string, never>) &\n (T['includePageCountInfo'] extends true\n ? IAdditionalPageCountInfo\n : Record<string, never>);\n\n// Helper type to check if any option is enabled\nexport type HasAnyOption<T extends GrowiInfoOptions> =\n T['includeAttachmentInfo'] extends true\n ? true\n : T['includeInstalledInfo'] extends true\n ? true\n : T['includeUserCountInfo'] extends true\n ? true\n : T['includePageCountInfo'] extends true\n ? true\n : false;\n\n// Final result type based on options\nexport type IGrowiAdditionalInfoResult<T extends GrowiInfoOptions> =\n HasAnyOption<T> extends true ? IGrowiAdditionalInfoByOptions<T> : undefined;\n\nexport interface IGrowiInfo<A extends object | undefined = undefined> {\n serviceInstanceId: string;\n appSiteUrl: string;\n osInfo: IGrowiOSInfo;\n version: string;\n type: GrowiServiceType;\n wikiType: GrowiWikiType;\n deploymentType: GrowiDeploymentType;\n additionalInfo?: A;\n}\n"],"names":["GrowiWikiType"],"mappings":"AAIO,MAAMA,IAAgB,EAAE,MAAM,QAAQ,QAAQ,SAAA;"}
@@ -1 +1 @@
1
- {"version":3,"file":"growi-theme-metadata.cjs","sources":["../../src/interfaces/growi-theme-metadata.ts"],"sourcesContent":["import { ColorScheme } from './color-scheme';\n\nexport const GrowiThemeSchemeType = {\n ...ColorScheme,\n BOTH: 'both',\n} as const;\nexport type GrowiThemeSchemeType =\n (typeof GrowiThemeSchemeType)[keyof typeof GrowiThemeSchemeType];\n\nexport type GrowiThemeMetadata = {\n name: string;\n manifestKey: string;\n schemeType: GrowiThemeSchemeType;\n lightBg: string;\n darkBg: string;\n lightSidebar: string;\n darkSidebar: string;\n lightIcon: string;\n darkIcon: string;\n createBtn: string;\n isPresetTheme?: boolean;\n};\n\nexport const isGrowiThemeMetadata = (\n obj: unknown,\n): obj is GrowiThemeMetadata => {\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n const objAny = obj as any;\n\n return (\n objAny != null &&\n typeof objAny === 'object' &&\n Array.isArray(objAny) === false &&\n 'name' in objAny &&\n typeof objAny.name === 'string' &&\n 'manifestKey' in objAny &&\n typeof objAny.manifestKey === 'string' &&\n 'schemeType' in objAny &&\n typeof objAny.schemeType === 'string' &&\n 'lightBg' in objAny &&\n typeof objAny.lightBg === 'string' &&\n 'darkBg' in objAny &&\n typeof objAny.darkBg === 'string' &&\n 'lightSidebar' in objAny &&\n typeof objAny.lightSidebar === 'string' &&\n 'darkSidebar' in objAny &&\n typeof objAny.darkSidebar === 'string' &&\n 'lightIcon' in objAny &&\n typeof objAny.lightIcon === 'string' &&\n 'darkIcon' in objAny &&\n typeof objAny.darkIcon === 'string' &&\n 'createBtn' in objAny &&\n typeof objAny.createBtn === 'string'\n );\n};\n"],"names":["GrowiThemeSchemeType","ColorScheme","isGrowiThemeMetadata","obj","objAny"],"mappings":"sHAEaA,EAAuB,CAClC,GAAGC,EAAA,YACH,KAAM,MACR,EAkBaC,EACXC,GAC8B,CAE9B,MAAMC,EAASD,EAEf,OACEC,GAAU,MACV,OAAOA,GAAW,UAClB,MAAM,QAAQA,CAAM,IAAM,IAC1B,SAAUA,GACV,OAAOA,EAAO,MAAS,UACvB,gBAAiBA,GACjB,OAAOA,EAAO,aAAgB,UAC9B,eAAgBA,GAChB,OAAOA,EAAO,YAAe,UAC7B,YAAaA,GACb,OAAOA,EAAO,SAAY,UAC1B,WAAYA,GACZ,OAAOA,EAAO,QAAW,UACzB,iBAAkBA,GAClB,OAAOA,EAAO,cAAiB,UAC/B,gBAAiBA,GACjB,OAAOA,EAAO,aAAgB,UAC9B,cAAeA,GACf,OAAOA,EAAO,WAAc,UAC5B,aAAcA,GACd,OAAOA,EAAO,UAAa,UAC3B,cAAeA,GACf,OAAOA,EAAO,WAAc,QAEhC"}
1
+ {"version":3,"file":"growi-theme-metadata.cjs","sources":["../../src/interfaces/growi-theme-metadata.ts"],"sourcesContent":["import { ColorScheme } from './color-scheme';\n\nexport const GrowiThemeSchemeType = {\n ...ColorScheme,\n BOTH: 'both',\n} as const;\nexport type GrowiThemeSchemeType =\n (typeof GrowiThemeSchemeType)[keyof typeof GrowiThemeSchemeType];\n\nexport type GrowiThemeMetadata = {\n name: string;\n manifestKey: string;\n schemeType: GrowiThemeSchemeType;\n lightBg: string;\n darkBg: string;\n lightSidebar: string;\n darkSidebar: string;\n lightIcon: string;\n darkIcon: string;\n createBtn: string;\n isPresetTheme?: boolean;\n};\n\nexport const isGrowiThemeMetadata = (\n obj: unknown,\n): obj is GrowiThemeMetadata => {\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n const objAny = obj as any;\n\n return (\n objAny != null &&\n typeof objAny === 'object' &&\n Array.isArray(objAny) === false &&\n 'name' in objAny &&\n typeof objAny.name === 'string' &&\n 'manifestKey' in objAny &&\n typeof objAny.manifestKey === 'string' &&\n 'schemeType' in objAny &&\n typeof objAny.schemeType === 'string' &&\n 'lightBg' in objAny &&\n typeof objAny.lightBg === 'string' &&\n 'darkBg' in objAny &&\n typeof objAny.darkBg === 'string' &&\n 'lightSidebar' in objAny &&\n typeof objAny.lightSidebar === 'string' &&\n 'darkSidebar' in objAny &&\n typeof objAny.darkSidebar === 'string' &&\n 'lightIcon' in objAny &&\n typeof objAny.lightIcon === 'string' &&\n 'darkIcon' in objAny &&\n typeof objAny.darkIcon === 'string' &&\n 'createBtn' in objAny &&\n typeof objAny.createBtn === 'string'\n );\n};\n"],"names":["GrowiThemeSchemeType","ColorScheme","isGrowiThemeMetadata","obj","objAny"],"mappings":"sHAEaA,EAAuB,CAClC,GAAGC,EAAAA,YACH,KAAM,MACR,EAkBaC,EACXC,GAC8B,CAE9B,MAAMC,EAASD,EAEf,OACEC,GAAU,MACV,OAAOA,GAAW,UAClB,MAAM,QAAQA,CAAM,IAAM,IAC1B,SAAUA,GACV,OAAOA,EAAO,MAAS,UACvB,gBAAiBA,GACjB,OAAOA,EAAO,aAAgB,UAC9B,eAAgBA,GAChB,OAAOA,EAAO,YAAe,UAC7B,YAAaA,GACb,OAAOA,EAAO,SAAY,UAC1B,WAAYA,GACZ,OAAOA,EAAO,QAAW,UACzB,iBAAkBA,GAClB,OAAOA,EAAO,cAAiB,UAC/B,gBAAiBA,GACjB,OAAOA,EAAO,aAAgB,UAC9B,cAAeA,GACf,OAAOA,EAAO,WAAc,UAC5B,aAAcA,GACd,OAAOA,EAAO,UAAa,UAC3B,cAAeA,GACf,OAAOA,EAAO,WAAc,QAEhC"}
@@ -4,7 +4,6 @@ import { HasRevisionShortbody, IRevision, IRevisionHasId } from './revision';
4
4
  import { SubscriptionStatusType } from './subscription';
5
5
  import { ITag } from './tag';
6
6
  import { IUser, IUserGroup, IUserGroupHasId, IUserHasId } from './user';
7
-
8
7
  export declare const GroupType: {
9
8
  readonly userGroup: "UserGroup";
10
9
  readonly externalUserGroup: "ExternalUserGroup";
@@ -1 +1 @@
1
- {"version":3,"file":"string.cjs","sources":["../../../src/interfaces/primitive/string.ts"],"sourcesContent":["/**\n * A branded type representing a string that is guaranteed to be non-empty (length > 0).\n * This type allows distinguishing non-empty strings from regular strings at compile time.\n */\nexport type NonEmptyString = string & { readonly __brand: unique symbol };\n\n/**\n * Checks if a value is a non-empty string.\n * @param value - The value to check\n * @returns True if the value is a string with length > 0, false otherwise\n */\nexport const isNonEmptyString = (\n value: string | null | undefined,\n): value is NonEmptyString => {\n return value != null && value.length > 0;\n};\n\n/**\n * Converts a string to NonEmptyString type.\n * @param value - The string to convert\n * @returns The string as NonEmptyString type\n * @throws Error if the value is null, undefined, or empty string\n */\nexport const toNonEmptyString = (value: string): NonEmptyString => {\n // throw Error if the value is null, undefined or empty\n if (!isNonEmptyString(value))\n throw new Error(`Expected a non-empty string, but received: ${value}`);\n return value;\n};\n\n/**\n * Converts a string to NonEmptyString type or returns undefined.\n * @param value - The string to convert\n * @returns The string as NonEmptyString type, or undefined if the value is null, undefined, or empty\n */\nexport const toNonEmptyStringOrUndefined = (\n value: string | null | undefined,\n): NonEmptyString | undefined => {\n // return undefined if the value is null, undefined or empty\n if (!isNonEmptyString(value)) return undefined;\n return value;\n};\n\n/**\n * A branded type representing a string that is guaranteed to be non-blank.\n * A non-blank string contains at least one non-whitespace character.\n * This type allows distinguishing non-blank strings from regular strings at compile time.\n */\nexport type NonBlankString = string & { readonly __brand: unique symbol };\n\n/**\n * Checks if a value is a non-blank string.\n * A non-blank string is a string that contains at least one non-whitespace character.\n * @param value - The value to check\n * @returns True if the value is a string with trimmed length > 0, false otherwise\n */\nexport const isNonBlankString = (\n value: string | null | undefined,\n): value is NonBlankString => {\n return value != null && value.trim().length > 0;\n};\n\n/**\n * Converts a string to NonBlankString type.\n * @param value - The string to convert\n * @returns The string as NonBlankString type\n * @throws Error if the value is null, undefined, empty string, or contains only whitespace characters\n */\nexport const toNonBlankString = (value: string): NonBlankString => {\n // throw Error if the value is null, undefined or empty\n if (!isNonBlankString(value))\n throw new Error(`Expected a non-blank string, but received: ${value}`);\n return value;\n};\n\n/**\n * Converts a string to NonBlankString type or returns undefined.\n * @param value - The string to convert\n * @returns The string as NonBlankString type, or undefined if the value is null, undefined, empty, or contains only whitespace characters\n */\nexport const toNonBlankStringOrUndefined = (\n value: string | null | undefined,\n): NonBlankString | undefined => {\n // return undefined if the value is null, undefined or blank (empty or whitespace only)\n if (!isNonBlankString(value)) return undefined;\n return value;\n};\n"],"names":["isNonEmptyString","value","toNonEmptyString","toNonEmptyStringOrUndefined","isNonBlankString","toNonBlankString","toNonBlankStringOrUndefined"],"mappings":"gFAWa,MAAAA,EACXC,GAEOA,GAAS,MAAQA,EAAM,OAAS,EAS5BC,EAAoBD,GAAkC,CAE7D,GAAA,CAACD,EAAiBC,CAAK,EACzB,MAAM,IAAI,MAAM,8CAA8CA,CAAK,EAAE,EAChE,OAAAA,CACT,EAOaE,EACXF,GAC+B,CAE/B,GAAKD,EAAiBC,CAAK,EACpB,OAAAA,CACT,EAeaG,EACXH,GAEOA,GAAS,MAAQA,EAAM,OAAO,OAAS,EASnCI,EAAoBJ,GAAkC,CAE7D,GAAA,CAACG,EAAiBH,CAAK,EACzB,MAAM,IAAI,MAAM,8CAA8CA,CAAK,EAAE,EAChE,OAAAA,CACT,EAOaK,EACXL,GAC+B,CAE/B,GAAKG,EAAiBH,CAAK,EACpB,OAAAA,CACT"}
1
+ {"version":3,"file":"string.cjs","sources":["../../../src/interfaces/primitive/string.ts"],"sourcesContent":["/**\n * A branded type representing a string that is guaranteed to be non-empty (length > 0).\n * This type allows distinguishing non-empty strings from regular strings at compile time.\n */\nexport type NonEmptyString = string & { readonly __brand: unique symbol };\n\n/**\n * Checks if a value is a non-empty string.\n * @param value - The value to check\n * @returns True if the value is a string with length > 0, false otherwise\n */\nexport const isNonEmptyString = (\n value: string | null | undefined,\n): value is NonEmptyString => {\n return value != null && value.length > 0;\n};\n\n/**\n * Converts a string to NonEmptyString type.\n * @param value - The string to convert\n * @returns The string as NonEmptyString type\n * @throws Error if the value is null, undefined, or empty string\n */\nexport const toNonEmptyString = (value: string): NonEmptyString => {\n // throw Error if the value is null, undefined or empty\n if (!isNonEmptyString(value))\n throw new Error(`Expected a non-empty string, but received: ${value}`);\n return value;\n};\n\n/**\n * Converts a string to NonEmptyString type or returns undefined.\n * @param value - The string to convert\n * @returns The string as NonEmptyString type, or undefined if the value is null, undefined, or empty\n */\nexport const toNonEmptyStringOrUndefined = (\n value: string | null | undefined,\n): NonEmptyString | undefined => {\n // return undefined if the value is null, undefined or empty\n if (!isNonEmptyString(value)) return undefined;\n return value;\n};\n\n/**\n * A branded type representing a string that is guaranteed to be non-blank.\n * A non-blank string contains at least one non-whitespace character.\n * This type allows distinguishing non-blank strings from regular strings at compile time.\n */\nexport type NonBlankString = string & { readonly __brand: unique symbol };\n\n/**\n * Checks if a value is a non-blank string.\n * A non-blank string is a string that contains at least one non-whitespace character.\n * @param value - The value to check\n * @returns True if the value is a string with trimmed length > 0, false otherwise\n */\nexport const isNonBlankString = (\n value: string | null | undefined,\n): value is NonBlankString => {\n return value != null && value.trim().length > 0;\n};\n\n/**\n * Converts a string to NonBlankString type.\n * @param value - The string to convert\n * @returns The string as NonBlankString type\n * @throws Error if the value is null, undefined, empty string, or contains only whitespace characters\n */\nexport const toNonBlankString = (value: string): NonBlankString => {\n // throw Error if the value is null, undefined or empty\n if (!isNonBlankString(value))\n throw new Error(`Expected a non-blank string, but received: ${value}`);\n return value;\n};\n\n/**\n * Converts a string to NonBlankString type or returns undefined.\n * @param value - The string to convert\n * @returns The string as NonBlankString type, or undefined if the value is null, undefined, empty, or contains only whitespace characters\n */\nexport const toNonBlankStringOrUndefined = (\n value: string | null | undefined,\n): NonBlankString | undefined => {\n // return undefined if the value is null, undefined or blank (empty or whitespace only)\n if (!isNonBlankString(value)) return undefined;\n return value;\n};\n"],"names":["isNonEmptyString","value","toNonEmptyString","toNonEmptyStringOrUndefined","isNonBlankString","toNonBlankString","toNonBlankStringOrUndefined"],"mappings":"gFAWO,MAAMA,EACXC,GAEOA,GAAS,MAAQA,EAAM,OAAS,EAS5BC,EAAoBD,GAAkC,CAEjE,GAAI,CAACD,EAAiBC,CAAK,EACzB,MAAM,IAAI,MAAM,8CAA8CA,CAAK,EAAE,EACvE,OAAOA,CACT,EAOaE,EACXF,GAC+B,CAE/B,GAAKD,EAAiBC,CAAK,EAC3B,OAAOA,CACT,EAeaG,EACXH,GAEOA,GAAS,MAAQA,EAAM,KAAA,EAAO,OAAS,EASnCI,EAAoBJ,GAAkC,CAEjE,GAAI,CAACG,EAAiBH,CAAK,EACzB,MAAM,IAAI,MAAM,8CAA8CA,CAAK,EAAE,EACvE,OAAOA,CACT,EAOaK,EACXL,GAC+B,CAE/B,GAAKG,EAAiBH,CAAK,EAC3B,OAAOA,CACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"string.js","sources":["../../../src/interfaces/primitive/string.ts"],"sourcesContent":["/**\n * A branded type representing a string that is guaranteed to be non-empty (length > 0).\n * This type allows distinguishing non-empty strings from regular strings at compile time.\n */\nexport type NonEmptyString = string & { readonly __brand: unique symbol };\n\n/**\n * Checks if a value is a non-empty string.\n * @param value - The value to check\n * @returns True if the value is a string with length > 0, false otherwise\n */\nexport const isNonEmptyString = (\n value: string | null | undefined,\n): value is NonEmptyString => {\n return value != null && value.length > 0;\n};\n\n/**\n * Converts a string to NonEmptyString type.\n * @param value - The string to convert\n * @returns The string as NonEmptyString type\n * @throws Error if the value is null, undefined, or empty string\n */\nexport const toNonEmptyString = (value: string): NonEmptyString => {\n // throw Error if the value is null, undefined or empty\n if (!isNonEmptyString(value))\n throw new Error(`Expected a non-empty string, but received: ${value}`);\n return value;\n};\n\n/**\n * Converts a string to NonEmptyString type or returns undefined.\n * @param value - The string to convert\n * @returns The string as NonEmptyString type, or undefined if the value is null, undefined, or empty\n */\nexport const toNonEmptyStringOrUndefined = (\n value: string | null | undefined,\n): NonEmptyString | undefined => {\n // return undefined if the value is null, undefined or empty\n if (!isNonEmptyString(value)) return undefined;\n return value;\n};\n\n/**\n * A branded type representing a string that is guaranteed to be non-blank.\n * A non-blank string contains at least one non-whitespace character.\n * This type allows distinguishing non-blank strings from regular strings at compile time.\n */\nexport type NonBlankString = string & { readonly __brand: unique symbol };\n\n/**\n * Checks if a value is a non-blank string.\n * A non-blank string is a string that contains at least one non-whitespace character.\n * @param value - The value to check\n * @returns True if the value is a string with trimmed length > 0, false otherwise\n */\nexport const isNonBlankString = (\n value: string | null | undefined,\n): value is NonBlankString => {\n return value != null && value.trim().length > 0;\n};\n\n/**\n * Converts a string to NonBlankString type.\n * @param value - The string to convert\n * @returns The string as NonBlankString type\n * @throws Error if the value is null, undefined, empty string, or contains only whitespace characters\n */\nexport const toNonBlankString = (value: string): NonBlankString => {\n // throw Error if the value is null, undefined or empty\n if (!isNonBlankString(value))\n throw new Error(`Expected a non-blank string, but received: ${value}`);\n return value;\n};\n\n/**\n * Converts a string to NonBlankString type or returns undefined.\n * @param value - The string to convert\n * @returns The string as NonBlankString type, or undefined if the value is null, undefined, empty, or contains only whitespace characters\n */\nexport const toNonBlankStringOrUndefined = (\n value: string | null | undefined,\n): NonBlankString | undefined => {\n // return undefined if the value is null, undefined or blank (empty or whitespace only)\n if (!isNonBlankString(value)) return undefined;\n return value;\n};\n"],"names":["isNonEmptyString","value","toNonEmptyString","toNonEmptyStringOrUndefined","isNonBlankString","toNonBlankString","toNonBlankStringOrUndefined"],"mappings":"AAWa,MAAAA,IAAmB,CAC9BC,MAEOA,KAAS,QAAQA,EAAM,SAAS,GAS5BC,IAAmB,CAACD,MAAkC;AAE7D,MAAA,CAACD,EAAiBC,CAAK;AACzB,UAAM,IAAI,MAAM,8CAA8CA,CAAK,EAAE;AAChE,SAAAA;AACT,GAOaE,IAA8B,CACzCF,MAC+B;AAE/B,MAAKD,EAAiBC,CAAK;AACpB,WAAAA;AACT,GAeaG,IAAmB,CAC9BH,MAEOA,KAAS,QAAQA,EAAM,OAAO,SAAS,GASnCI,IAAmB,CAACJ,MAAkC;AAE7D,MAAA,CAACG,EAAiBH,CAAK;AACzB,UAAM,IAAI,MAAM,8CAA8CA,CAAK,EAAE;AAChE,SAAAA;AACT,GAOaK,IAA8B,CACzCL,MAC+B;AAE/B,MAAKG,EAAiBH,CAAK;AACpB,WAAAA;AACT;"}
1
+ {"version":3,"file":"string.js","sources":["../../../src/interfaces/primitive/string.ts"],"sourcesContent":["/**\n * A branded type representing a string that is guaranteed to be non-empty (length > 0).\n * This type allows distinguishing non-empty strings from regular strings at compile time.\n */\nexport type NonEmptyString = string & { readonly __brand: unique symbol };\n\n/**\n * Checks if a value is a non-empty string.\n * @param value - The value to check\n * @returns True if the value is a string with length > 0, false otherwise\n */\nexport const isNonEmptyString = (\n value: string | null | undefined,\n): value is NonEmptyString => {\n return value != null && value.length > 0;\n};\n\n/**\n * Converts a string to NonEmptyString type.\n * @param value - The string to convert\n * @returns The string as NonEmptyString type\n * @throws Error if the value is null, undefined, or empty string\n */\nexport const toNonEmptyString = (value: string): NonEmptyString => {\n // throw Error if the value is null, undefined or empty\n if (!isNonEmptyString(value))\n throw new Error(`Expected a non-empty string, but received: ${value}`);\n return value;\n};\n\n/**\n * Converts a string to NonEmptyString type or returns undefined.\n * @param value - The string to convert\n * @returns The string as NonEmptyString type, or undefined if the value is null, undefined, or empty\n */\nexport const toNonEmptyStringOrUndefined = (\n value: string | null | undefined,\n): NonEmptyString | undefined => {\n // return undefined if the value is null, undefined or empty\n if (!isNonEmptyString(value)) return undefined;\n return value;\n};\n\n/**\n * A branded type representing a string that is guaranteed to be non-blank.\n * A non-blank string contains at least one non-whitespace character.\n * This type allows distinguishing non-blank strings from regular strings at compile time.\n */\nexport type NonBlankString = string & { readonly __brand: unique symbol };\n\n/**\n * Checks if a value is a non-blank string.\n * A non-blank string is a string that contains at least one non-whitespace character.\n * @param value - The value to check\n * @returns True if the value is a string with trimmed length > 0, false otherwise\n */\nexport const isNonBlankString = (\n value: string | null | undefined,\n): value is NonBlankString => {\n return value != null && value.trim().length > 0;\n};\n\n/**\n * Converts a string to NonBlankString type.\n * @param value - The string to convert\n * @returns The string as NonBlankString type\n * @throws Error if the value is null, undefined, empty string, or contains only whitespace characters\n */\nexport const toNonBlankString = (value: string): NonBlankString => {\n // throw Error if the value is null, undefined or empty\n if (!isNonBlankString(value))\n throw new Error(`Expected a non-blank string, but received: ${value}`);\n return value;\n};\n\n/**\n * Converts a string to NonBlankString type or returns undefined.\n * @param value - The string to convert\n * @returns The string as NonBlankString type, or undefined if the value is null, undefined, empty, or contains only whitespace characters\n */\nexport const toNonBlankStringOrUndefined = (\n value: string | null | undefined,\n): NonBlankString | undefined => {\n // return undefined if the value is null, undefined or blank (empty or whitespace only)\n if (!isNonBlankString(value)) return undefined;\n return value;\n};\n"],"names":["isNonEmptyString","value","toNonEmptyString","toNonEmptyStringOrUndefined","isNonBlankString","toNonBlankString","toNonBlankStringOrUndefined"],"mappings":"AAWO,MAAMA,IAAmB,CAC9BC,MAEOA,KAAS,QAAQA,EAAM,SAAS,GAS5BC,IAAmB,CAACD,MAAkC;AAEjE,MAAI,CAACD,EAAiBC,CAAK;AACzB,UAAM,IAAI,MAAM,8CAA8CA,CAAK,EAAE;AACvE,SAAOA;AACT,GAOaE,IAA8B,CACzCF,MAC+B;AAE/B,MAAKD,EAAiBC,CAAK;AAC3B,WAAOA;AACT,GAeaG,IAAmB,CAC9BH,MAEOA,KAAS,QAAQA,EAAM,KAAA,EAAO,SAAS,GASnCI,IAAmB,CAACJ,MAAkC;AAEjE,MAAI,CAACG,EAAiBH,CAAK;AACzB,UAAM,IAAI,MAAM,8CAA8CA,CAAK,EAAE;AACvE,SAAOA;AACT,GAOaK,IAA8B,CACzCL,MAC+B;AAE/B,MAAKG,EAAiBH,CAAK;AAC3B,WAAOA;AACT;"}
@@ -2,7 +2,6 @@ import { Ref } from './common';
2
2
  import { HasObjectId } from './has-object-id';
3
3
  import { IPage } from './page';
4
4
  import { IUser } from './user';
5
-
6
5
  export declare const Origin: {
7
6
  readonly View: "view";
8
7
  readonly Editor: "editor";
@@ -1 +1 @@
1
- {"version":3,"file":"scope.cjs","sources":["../../src/interfaces/scope.ts"],"sourcesContent":["// SCOPE_SEED defines the basic scope structure.\n// When you need to set different permissions for Admin and User\n// on specific endpoints (like /me), use SCOPE rather than modifying SCOPE_SEED.\n\n// If you want to add a new scope:\n// 1. Add a new key to the SCOPE_SEED object below\n// 2. Add the corresponding scope strings to the Scope type union at the bottom of this file\n// 3. Change translation file contents (accesstoken_scopes_desc) when scope structure is modified\n\nconst SCOPE_SEED_ADMIN = {\n admin: {\n top: {},\n app: {},\n security: {},\n markdown: {},\n customize: {},\n import_data: {},\n export_data: {},\n data_transfer: {},\n external_notification: {},\n slack_integration: {},\n legacy_slack_integration: {},\n user_management: {},\n user_group_management: {},\n audit_log: {},\n plugin: {},\n ai_integration: {},\n full_text_search: {},\n },\n} as const;\n\nconst SCOPE_SEED_USER = {\n user_settings: {\n info: {},\n external_account: {},\n password: {},\n api: {\n api_token: {},\n access_token: {},\n },\n in_app_notification: {},\n other: {},\n },\n features: {\n ai_assistant: {},\n page: {},\n share_link: {},\n bookmark: {},\n attachment: {},\n page_bulk_export: {},\n },\n} as const;\n\nconst SCOPE_SEED = {\n ...SCOPE_SEED_ADMIN,\n ...SCOPE_SEED_USER,\n} as const;\n\nexport const ACTION = {\n READ: 'read',\n WRITE: 'write',\n} as const;\n\ntype ACTION_TYPE = (typeof ACTION)[keyof typeof ACTION];\nexport const ALL_SIGN = '*';\n\nconst SCOPE_SEED_WITH_ACTION = Object.values(ACTION).reduce(\n (acc, action) => {\n acc[action] = SCOPE_SEED;\n return acc;\n },\n {} as Record<ACTION_TYPE, typeof SCOPE_SEED>,\n);\n\n// ============================================================================\n// SCOPE LITERAL TYPE\n// ============================================================================\n// This type is explicitly defined to avoid TS2589 \"Type instantiation is\n// excessively deep\" errors that occur with recursive type definitions.\n//\n// IMPORTANT: When modifying SCOPE_SEED above, update this type union accordingly.\n// The scope strings follow the pattern: {action}:{category}[:{subcategory}[:{item}]]\n// Wildcard scopes use '*' at any level: {action}:{category}:*\n// ============================================================================\n\n// Read scopes - Admin\ntype ReadAdminScope =\n | 'read:admin:top'\n | 'read:admin:app'\n | 'read:admin:security'\n | 'read:admin:markdown'\n | 'read:admin:customize'\n | 'read:admin:import_data'\n | 'read:admin:export_data'\n | 'read:admin:data_transfer'\n | 'read:admin:external_notification'\n | 'read:admin:slack_integration'\n | 'read:admin:legacy_slack_integration'\n | 'read:admin:user_management'\n | 'read:admin:user_group_management'\n | 'read:admin:audit_log'\n | 'read:admin:plugin'\n | 'read:admin:ai_integration'\n | 'read:admin:full_text_search'\n | 'read:admin:*';\n\n// Read scopes - User Settings\ntype ReadUserSettingsScope =\n | 'read:user_settings:info'\n | 'read:user_settings:external_account'\n | 'read:user_settings:password'\n | 'read:user_settings:api:api_token'\n | 'read:user_settings:api:access_token'\n | 'read:user_settings:api:*'\n | 'read:user_settings:in_app_notification'\n | 'read:user_settings:other'\n | 'read:user_settings:*';\n\n// Read scopes - Features\ntype ReadFeaturesScope =\n | 'read:features:ai_assistant'\n | 'read:features:page'\n | 'read:features:share_link'\n | 'read:features:bookmark'\n | 'read:features:attachment'\n | 'read:features:page_bulk_export'\n | 'read:features:*';\n\n// Write scopes - Admin\ntype WriteAdminScope =\n | 'write:admin:top'\n | 'write:admin:app'\n | 'write:admin:security'\n | 'write:admin:markdown'\n | 'write:admin:customize'\n | 'write:admin:import_data'\n | 'write:admin:export_data'\n | 'write:admin:data_transfer'\n | 'write:admin:external_notification'\n | 'write:admin:slack_integration'\n | 'write:admin:legacy_slack_integration'\n | 'write:admin:user_management'\n | 'write:admin:user_group_management'\n | 'write:admin:audit_log'\n | 'write:admin:plugin'\n | 'write:admin:ai_integration'\n | 'write:admin:full_text_search'\n | 'write:admin:*';\n\n// Write scopes - User Settings\ntype WriteUserSettingsScope =\n | 'write:user_settings:info'\n | 'write:user_settings:external_account'\n | 'write:user_settings:password'\n | 'write:user_settings:api:api_token'\n | 'write:user_settings:api:access_token'\n | 'write:user_settings:api:*'\n | 'write:user_settings:in_app_notification'\n | 'write:user_settings:other'\n | 'write:user_settings:*';\n\n// Write scopes - Features\ntype WriteFeaturesScope =\n | 'write:features:ai_assistant'\n | 'write:features:page'\n | 'write:features:share_link'\n | 'write:features:bookmark'\n | 'write:features:attachment'\n | 'write:features:page_bulk_export'\n | 'write:features:*';\n\n// Combined Scope type - all valid scope strings\nexport type Scope =\n | ReadAdminScope\n | ReadUserSettingsScope\n | ReadFeaturesScope\n | WriteAdminScope\n | WriteUserSettingsScope\n | WriteFeaturesScope\n | 'read:*'\n | 'write:*';\n\n// ScopeConstants type definition\ntype ScopeConstantLeaf = Scope;\n\ntype ScopeConstantNode<T> = {\n [K in keyof T as Uppercase<string & K>]: T[K] extends object\n ? keyof T[K] extends never\n ? ScopeConstantLeaf\n : ScopeConstantNode<T[K]> & { ALL: Scope }\n : ScopeConstantLeaf;\n};\n\ntype ScopeConstantType = {\n [A in keyof typeof SCOPE_SEED_WITH_ACTION as Uppercase<\n string & A\n >]: ScopeConstantNode<typeof SCOPE_SEED> & { ALL: Scope };\n};\n\nconst buildScopeConstants = (): ScopeConstantType => {\n const result = {} as Partial<ScopeConstantType>;\n\n const processObject = (\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n obj: Record<string, any>,\n path: string[] = [],\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n resultObj: Record<string, any>,\n ) => {\n for (const [key, value] of Object.entries(obj)) {\n const upperKey = key.toUpperCase();\n const currentPath = [...path, key];\n const scopePath = currentPath.join(':');\n\n if (value == null) {\n continue; // Changed from 'return' to 'continue' to match the loop behavior\n }\n\n if (typeof value === 'object' && Object.keys(value).length === 0) {\n resultObj[upperKey] = `${scopePath}` as Scope;\n } else if (typeof value === 'object') {\n resultObj[upperKey] = {\n ALL: `${scopePath}:${ALL_SIGN}` as Scope,\n };\n\n processObject(value, currentPath, resultObj[upperKey]);\n }\n }\n };\n processObject(SCOPE_SEED_WITH_ACTION, [], result);\n\n return result as ScopeConstantType;\n};\n\nexport const SCOPE = buildScopeConstants();\n"],"names":["SCOPE_SEED_ADMIN","SCOPE_SEED_USER","SCOPE_SEED","ACTION","ALL_SIGN","SCOPE_SEED_WITH_ACTION","acc","action","buildScopeConstants","result","processObject","obj","path","resultObj","key","value","upperKey","currentPath","scopePath","SCOPE"],"mappings":"gFASA,MAAMA,EAAmB,CACvB,MAAO,CACL,IAAK,CAAC,EACN,IAAK,CAAC,EACN,SAAU,CAAC,EACX,SAAU,CAAC,EACX,UAAW,CAAC,EACZ,YAAa,CAAC,EACd,YAAa,CAAC,EACd,cAAe,CAAC,EAChB,sBAAuB,CAAC,EACxB,kBAAmB,CAAC,EACpB,yBAA0B,CAAC,EAC3B,gBAAiB,CAAC,EAClB,sBAAuB,CAAC,EACxB,UAAW,CAAC,EACZ,OAAQ,CAAC,EACT,eAAgB,CAAC,EACjB,iBAAkB,CAAA,CAAC,CAEvB,EAEMC,EAAkB,CACtB,cAAe,CACb,KAAM,CAAC,EACP,iBAAkB,CAAC,EACnB,SAAU,CAAC,EACX,IAAK,CACH,UAAW,CAAC,EACZ,aAAc,CAAA,CAChB,EACA,oBAAqB,CAAC,EACtB,MAAO,CAAA,CACT,EACA,SAAU,CACR,aAAc,CAAC,EACf,KAAM,CAAC,EACP,WAAY,CAAC,EACb,SAAU,CAAC,EACX,WAAY,CAAC,EACb,iBAAkB,CAAA,CAAC,CAEvB,EAEMC,EAAa,CACjB,GAAGF,EACH,GAAGC,CACL,EAEaE,EAAS,CACpB,KAAM,OACN,MAAO,OACT,EAGaC,EAAW,IAElBC,EAAyB,OAAO,OAAOF,CAAM,EAAE,OACnD,CAACG,EAAKC,KACJD,EAAIC,CAAM,EAAIL,EACPI,GAET,CAAA,CACF,EA+HME,EAAsB,IAAyB,CACnD,MAAMC,EAAS,CAAC,EAEVC,EAAgB,CAEpBC,EACAC,EAAiB,CAAA,EAEjBC,IACG,CACH,SAAW,CAACC,EAAKC,CAAK,IAAK,OAAO,QAAQJ,CAAG,EAAG,CACxC,MAAAK,EAAWF,EAAI,YAAY,EAC3BG,EAAc,CAAC,GAAGL,EAAME,CAAG,EAC3BI,EAAYD,EAAY,KAAK,GAAG,EAElCF,GAAS,OAIT,OAAOA,GAAU,UAAY,OAAO,KAAKA,CAAK,EAAE,SAAW,EACnDF,EAAAG,CAAQ,EAAI,GAAGE,CAAS,GACzB,OAAOH,GAAU,WAC1BF,EAAUG,CAAQ,EAAI,CACpB,IAAK,GAAGE,CAAS,IAAId,CAAQ,EAC/B,EAEAM,EAAcK,EAAOE,EAAaJ,EAAUG,CAAQ,CAAC,GACvD,CAEJ,EACc,OAAAN,EAAAL,EAAwB,CAAC,EAAGI,CAAM,EAEzCA,CACT,EAEaU,EAAQX,EAAoB"}
1
+ {"version":3,"file":"scope.cjs","sources":["../../src/interfaces/scope.ts"],"sourcesContent":["// SCOPE_SEED defines the basic scope structure.\n// When you need to set different permissions for Admin and User\n// on specific endpoints (like /me), use SCOPE rather than modifying SCOPE_SEED.\n\n// If you want to add a new scope:\n// 1. Add a new key to the SCOPE_SEED object below\n// 2. Add the corresponding scope strings to the Scope type union at the bottom of this file\n// 3. Change translation file contents (accesstoken_scopes_desc) when scope structure is modified\n\nconst SCOPE_SEED_ADMIN = {\n admin: {\n top: {},\n app: {},\n security: {},\n markdown: {},\n customize: {},\n import_data: {},\n export_data: {},\n data_transfer: {},\n external_notification: {},\n slack_integration: {},\n legacy_slack_integration: {},\n user_management: {},\n user_group_management: {},\n audit_log: {},\n plugin: {},\n ai_integration: {},\n full_text_search: {},\n },\n} as const;\n\nconst SCOPE_SEED_USER = {\n user_settings: {\n info: {},\n external_account: {},\n password: {},\n api: {\n api_token: {},\n access_token: {},\n },\n in_app_notification: {},\n other: {},\n },\n features: {\n ai_assistant: {},\n page: {},\n share_link: {},\n bookmark: {},\n attachment: {},\n page_bulk_export: {},\n },\n} as const;\n\nconst SCOPE_SEED = {\n ...SCOPE_SEED_ADMIN,\n ...SCOPE_SEED_USER,\n} as const;\n\nexport const ACTION = {\n READ: 'read',\n WRITE: 'write',\n} as const;\n\ntype ACTION_TYPE = (typeof ACTION)[keyof typeof ACTION];\nexport const ALL_SIGN = '*';\n\nconst SCOPE_SEED_WITH_ACTION = Object.values(ACTION).reduce(\n (acc, action) => {\n acc[action] = SCOPE_SEED;\n return acc;\n },\n {} as Record<ACTION_TYPE, typeof SCOPE_SEED>,\n);\n\n// ============================================================================\n// SCOPE LITERAL TYPE\n// ============================================================================\n// This type is explicitly defined to avoid TS2589 \"Type instantiation is\n// excessively deep\" errors that occur with recursive type definitions.\n//\n// IMPORTANT: When modifying SCOPE_SEED above, update this type union accordingly.\n// The scope strings follow the pattern: {action}:{category}[:{subcategory}[:{item}]]\n// Wildcard scopes use '*' at any level: {action}:{category}:*\n// ============================================================================\n\n// Read scopes - Admin\ntype ReadAdminScope =\n | 'read:admin:top'\n | 'read:admin:app'\n | 'read:admin:security'\n | 'read:admin:markdown'\n | 'read:admin:customize'\n | 'read:admin:import_data'\n | 'read:admin:export_data'\n | 'read:admin:data_transfer'\n | 'read:admin:external_notification'\n | 'read:admin:slack_integration'\n | 'read:admin:legacy_slack_integration'\n | 'read:admin:user_management'\n | 'read:admin:user_group_management'\n | 'read:admin:audit_log'\n | 'read:admin:plugin'\n | 'read:admin:ai_integration'\n | 'read:admin:full_text_search'\n | 'read:admin:*';\n\n// Read scopes - User Settings\ntype ReadUserSettingsScope =\n | 'read:user_settings:info'\n | 'read:user_settings:external_account'\n | 'read:user_settings:password'\n | 'read:user_settings:api:api_token'\n | 'read:user_settings:api:access_token'\n | 'read:user_settings:api:*'\n | 'read:user_settings:in_app_notification'\n | 'read:user_settings:other'\n | 'read:user_settings:*';\n\n// Read scopes - Features\ntype ReadFeaturesScope =\n | 'read:features:ai_assistant'\n | 'read:features:page'\n | 'read:features:share_link'\n | 'read:features:bookmark'\n | 'read:features:attachment'\n | 'read:features:page_bulk_export'\n | 'read:features:*';\n\n// Write scopes - Admin\ntype WriteAdminScope =\n | 'write:admin:top'\n | 'write:admin:app'\n | 'write:admin:security'\n | 'write:admin:markdown'\n | 'write:admin:customize'\n | 'write:admin:import_data'\n | 'write:admin:export_data'\n | 'write:admin:data_transfer'\n | 'write:admin:external_notification'\n | 'write:admin:slack_integration'\n | 'write:admin:legacy_slack_integration'\n | 'write:admin:user_management'\n | 'write:admin:user_group_management'\n | 'write:admin:audit_log'\n | 'write:admin:plugin'\n | 'write:admin:ai_integration'\n | 'write:admin:full_text_search'\n | 'write:admin:*';\n\n// Write scopes - User Settings\ntype WriteUserSettingsScope =\n | 'write:user_settings:info'\n | 'write:user_settings:external_account'\n | 'write:user_settings:password'\n | 'write:user_settings:api:api_token'\n | 'write:user_settings:api:access_token'\n | 'write:user_settings:api:*'\n | 'write:user_settings:in_app_notification'\n | 'write:user_settings:other'\n | 'write:user_settings:*';\n\n// Write scopes - Features\ntype WriteFeaturesScope =\n | 'write:features:ai_assistant'\n | 'write:features:page'\n | 'write:features:share_link'\n | 'write:features:bookmark'\n | 'write:features:attachment'\n | 'write:features:page_bulk_export'\n | 'write:features:*';\n\n// Combined Scope type - all valid scope strings\nexport type Scope =\n | ReadAdminScope\n | ReadUserSettingsScope\n | ReadFeaturesScope\n | WriteAdminScope\n | WriteUserSettingsScope\n | WriteFeaturesScope\n | 'read:*'\n | 'write:*';\n\n// ScopeConstants type definition\ntype ScopeConstantLeaf = Scope;\n\ntype ScopeConstantNode<T> = {\n [K in keyof T as Uppercase<string & K>]: T[K] extends object\n ? keyof T[K] extends never\n ? ScopeConstantLeaf\n : ScopeConstantNode<T[K]> & { ALL: Scope }\n : ScopeConstantLeaf;\n};\n\ntype ScopeConstantType = {\n [A in keyof typeof SCOPE_SEED_WITH_ACTION as Uppercase<\n string & A\n >]: ScopeConstantNode<typeof SCOPE_SEED> & { ALL: Scope };\n};\n\nconst buildScopeConstants = (): ScopeConstantType => {\n const result = {} as Partial<ScopeConstantType>;\n\n const processObject = (\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n obj: Record<string, any>,\n path: string[] = [],\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n resultObj: Record<string, any>,\n ) => {\n for (const [key, value] of Object.entries(obj)) {\n const upperKey = key.toUpperCase();\n const currentPath = [...path, key];\n const scopePath = currentPath.join(':');\n\n if (value == null) {\n continue; // Changed from 'return' to 'continue' to match the loop behavior\n }\n\n if (typeof value === 'object' && Object.keys(value).length === 0) {\n resultObj[upperKey] = `${scopePath}` as Scope;\n } else if (typeof value === 'object') {\n resultObj[upperKey] = {\n ALL: `${scopePath}:${ALL_SIGN}` as Scope,\n };\n\n processObject(value, currentPath, resultObj[upperKey]);\n }\n }\n };\n processObject(SCOPE_SEED_WITH_ACTION, [], result);\n\n return result as ScopeConstantType;\n};\n\nexport const SCOPE = buildScopeConstants();\n"],"names":["SCOPE_SEED_ADMIN","SCOPE_SEED_USER","SCOPE_SEED","ACTION","ALL_SIGN","SCOPE_SEED_WITH_ACTION","acc","action","buildScopeConstants","result","processObject","obj","path","resultObj","key","value","upperKey","currentPath","scopePath","SCOPE"],"mappings":"gFASA,MAAMA,EAAmB,CACvB,MAAO,CACL,IAAK,CAAA,EACL,IAAK,CAAA,EACL,SAAU,CAAA,EACV,SAAU,CAAA,EACV,UAAW,CAAA,EACX,YAAa,CAAA,EACb,YAAa,CAAA,EACb,cAAe,CAAA,EACf,sBAAuB,CAAA,EACvB,kBAAmB,CAAA,EACnB,yBAA0B,CAAA,EAC1B,gBAAiB,CAAA,EACjB,sBAAuB,CAAA,EACvB,UAAW,CAAA,EACX,OAAQ,CAAA,EACR,eAAgB,CAAA,EAChB,iBAAkB,CAAA,CAAC,CAEvB,EAEMC,EAAkB,CACtB,cAAe,CACb,KAAM,CAAA,EACN,iBAAkB,CAAA,EAClB,SAAU,CAAA,EACV,IAAK,CACH,UAAW,CAAA,EACX,aAAc,CAAA,CAAC,EAEjB,oBAAqB,CAAA,EACrB,MAAO,CAAA,CAAC,EAEV,SAAU,CACR,aAAc,CAAA,EACd,KAAM,CAAA,EACN,WAAY,CAAA,EACZ,SAAU,CAAA,EACV,WAAY,CAAA,EACZ,iBAAkB,CAAA,CAAC,CAEvB,EAEMC,EAAa,CACjB,GAAGF,EACH,GAAGC,CACL,EAEaE,EAAS,CACpB,KAAM,OACN,MAAO,OACT,EAGaC,EAAW,IAElBC,EAAyB,OAAO,OAAOF,CAAM,EAAE,OACnD,CAACG,EAAKC,KACJD,EAAIC,CAAM,EAAIL,EACPI,GAET,CAAA,CACF,EA+HME,EAAsB,IAAyB,CACnD,MAAMC,EAAS,CAAA,EAETC,EAAgB,CAEpBC,EACAC,EAAiB,CAAA,EAEjBC,IACG,CACH,SAAW,CAACC,EAAKC,CAAK,IAAK,OAAO,QAAQJ,CAAG,EAAG,CAC9C,MAAMK,EAAWF,EAAI,YAAA,EACfG,EAAc,CAAC,GAAGL,EAAME,CAAG,EAC3BI,EAAYD,EAAY,KAAK,GAAG,EAElCF,GAAS,OAIT,OAAOA,GAAU,UAAY,OAAO,KAAKA,CAAK,EAAE,SAAW,EAC7DF,EAAUG,CAAQ,EAAI,GAAGE,CAAS,GACzB,OAAOH,GAAU,WAC1BF,EAAUG,CAAQ,EAAI,CACpB,IAAK,GAAGE,CAAS,IAAId,CAAQ,EAAA,EAG/BM,EAAcK,EAAOE,EAAaJ,EAAUG,CAAQ,CAAC,GAEzD,CACF,EACA,OAAAN,EAAcL,EAAwB,CAAA,EAAII,CAAM,EAEzCA,CACT,EAEaU,EAAQX,EAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"scope.js","sources":["../../src/interfaces/scope.ts"],"sourcesContent":["// SCOPE_SEED defines the basic scope structure.\n// When you need to set different permissions for Admin and User\n// on specific endpoints (like /me), use SCOPE rather than modifying SCOPE_SEED.\n\n// If you want to add a new scope:\n// 1. Add a new key to the SCOPE_SEED object below\n// 2. Add the corresponding scope strings to the Scope type union at the bottom of this file\n// 3. Change translation file contents (accesstoken_scopes_desc) when scope structure is modified\n\nconst SCOPE_SEED_ADMIN = {\n admin: {\n top: {},\n app: {},\n security: {},\n markdown: {},\n customize: {},\n import_data: {},\n export_data: {},\n data_transfer: {},\n external_notification: {},\n slack_integration: {},\n legacy_slack_integration: {},\n user_management: {},\n user_group_management: {},\n audit_log: {},\n plugin: {},\n ai_integration: {},\n full_text_search: {},\n },\n} as const;\n\nconst SCOPE_SEED_USER = {\n user_settings: {\n info: {},\n external_account: {},\n password: {},\n api: {\n api_token: {},\n access_token: {},\n },\n in_app_notification: {},\n other: {},\n },\n features: {\n ai_assistant: {},\n page: {},\n share_link: {},\n bookmark: {},\n attachment: {},\n page_bulk_export: {},\n },\n} as const;\n\nconst SCOPE_SEED = {\n ...SCOPE_SEED_ADMIN,\n ...SCOPE_SEED_USER,\n} as const;\n\nexport const ACTION = {\n READ: 'read',\n WRITE: 'write',\n} as const;\n\ntype ACTION_TYPE = (typeof ACTION)[keyof typeof ACTION];\nexport const ALL_SIGN = '*';\n\nconst SCOPE_SEED_WITH_ACTION = Object.values(ACTION).reduce(\n (acc, action) => {\n acc[action] = SCOPE_SEED;\n return acc;\n },\n {} as Record<ACTION_TYPE, typeof SCOPE_SEED>,\n);\n\n// ============================================================================\n// SCOPE LITERAL TYPE\n// ============================================================================\n// This type is explicitly defined to avoid TS2589 \"Type instantiation is\n// excessively deep\" errors that occur with recursive type definitions.\n//\n// IMPORTANT: When modifying SCOPE_SEED above, update this type union accordingly.\n// The scope strings follow the pattern: {action}:{category}[:{subcategory}[:{item}]]\n// Wildcard scopes use '*' at any level: {action}:{category}:*\n// ============================================================================\n\n// Read scopes - Admin\ntype ReadAdminScope =\n | 'read:admin:top'\n | 'read:admin:app'\n | 'read:admin:security'\n | 'read:admin:markdown'\n | 'read:admin:customize'\n | 'read:admin:import_data'\n | 'read:admin:export_data'\n | 'read:admin:data_transfer'\n | 'read:admin:external_notification'\n | 'read:admin:slack_integration'\n | 'read:admin:legacy_slack_integration'\n | 'read:admin:user_management'\n | 'read:admin:user_group_management'\n | 'read:admin:audit_log'\n | 'read:admin:plugin'\n | 'read:admin:ai_integration'\n | 'read:admin:full_text_search'\n | 'read:admin:*';\n\n// Read scopes - User Settings\ntype ReadUserSettingsScope =\n | 'read:user_settings:info'\n | 'read:user_settings:external_account'\n | 'read:user_settings:password'\n | 'read:user_settings:api:api_token'\n | 'read:user_settings:api:access_token'\n | 'read:user_settings:api:*'\n | 'read:user_settings:in_app_notification'\n | 'read:user_settings:other'\n | 'read:user_settings:*';\n\n// Read scopes - Features\ntype ReadFeaturesScope =\n | 'read:features:ai_assistant'\n | 'read:features:page'\n | 'read:features:share_link'\n | 'read:features:bookmark'\n | 'read:features:attachment'\n | 'read:features:page_bulk_export'\n | 'read:features:*';\n\n// Write scopes - Admin\ntype WriteAdminScope =\n | 'write:admin:top'\n | 'write:admin:app'\n | 'write:admin:security'\n | 'write:admin:markdown'\n | 'write:admin:customize'\n | 'write:admin:import_data'\n | 'write:admin:export_data'\n | 'write:admin:data_transfer'\n | 'write:admin:external_notification'\n | 'write:admin:slack_integration'\n | 'write:admin:legacy_slack_integration'\n | 'write:admin:user_management'\n | 'write:admin:user_group_management'\n | 'write:admin:audit_log'\n | 'write:admin:plugin'\n | 'write:admin:ai_integration'\n | 'write:admin:full_text_search'\n | 'write:admin:*';\n\n// Write scopes - User Settings\ntype WriteUserSettingsScope =\n | 'write:user_settings:info'\n | 'write:user_settings:external_account'\n | 'write:user_settings:password'\n | 'write:user_settings:api:api_token'\n | 'write:user_settings:api:access_token'\n | 'write:user_settings:api:*'\n | 'write:user_settings:in_app_notification'\n | 'write:user_settings:other'\n | 'write:user_settings:*';\n\n// Write scopes - Features\ntype WriteFeaturesScope =\n | 'write:features:ai_assistant'\n | 'write:features:page'\n | 'write:features:share_link'\n | 'write:features:bookmark'\n | 'write:features:attachment'\n | 'write:features:page_bulk_export'\n | 'write:features:*';\n\n// Combined Scope type - all valid scope strings\nexport type Scope =\n | ReadAdminScope\n | ReadUserSettingsScope\n | ReadFeaturesScope\n | WriteAdminScope\n | WriteUserSettingsScope\n | WriteFeaturesScope\n | 'read:*'\n | 'write:*';\n\n// ScopeConstants type definition\ntype ScopeConstantLeaf = Scope;\n\ntype ScopeConstantNode<T> = {\n [K in keyof T as Uppercase<string & K>]: T[K] extends object\n ? keyof T[K] extends never\n ? ScopeConstantLeaf\n : ScopeConstantNode<T[K]> & { ALL: Scope }\n : ScopeConstantLeaf;\n};\n\ntype ScopeConstantType = {\n [A in keyof typeof SCOPE_SEED_WITH_ACTION as Uppercase<\n string & A\n >]: ScopeConstantNode<typeof SCOPE_SEED> & { ALL: Scope };\n};\n\nconst buildScopeConstants = (): ScopeConstantType => {\n const result = {} as Partial<ScopeConstantType>;\n\n const processObject = (\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n obj: Record<string, any>,\n path: string[] = [],\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n resultObj: Record<string, any>,\n ) => {\n for (const [key, value] of Object.entries(obj)) {\n const upperKey = key.toUpperCase();\n const currentPath = [...path, key];\n const scopePath = currentPath.join(':');\n\n if (value == null) {\n continue; // Changed from 'return' to 'continue' to match the loop behavior\n }\n\n if (typeof value === 'object' && Object.keys(value).length === 0) {\n resultObj[upperKey] = `${scopePath}` as Scope;\n } else if (typeof value === 'object') {\n resultObj[upperKey] = {\n ALL: `${scopePath}:${ALL_SIGN}` as Scope,\n };\n\n processObject(value, currentPath, resultObj[upperKey]);\n }\n }\n };\n processObject(SCOPE_SEED_WITH_ACTION, [], result);\n\n return result as ScopeConstantType;\n};\n\nexport const SCOPE = buildScopeConstants();\n"],"names":["SCOPE_SEED_ADMIN","SCOPE_SEED_USER","SCOPE_SEED","ACTION","ALL_SIGN","SCOPE_SEED_WITH_ACTION","acc","action","buildScopeConstants","result","processObject","obj","path","resultObj","key","value","upperKey","currentPath","scopePath","SCOPE"],"mappings":"AASA,MAAMA,IAAmB;AAAA,EACvB,OAAO;AAAA,IACL,KAAK,CAAC;AAAA,IACN,KAAK,CAAC;AAAA,IACN,UAAU,CAAC;AAAA,IACX,UAAU,CAAC;AAAA,IACX,WAAW,CAAC;AAAA,IACZ,aAAa,CAAC;AAAA,IACd,aAAa,CAAC;AAAA,IACd,eAAe,CAAC;AAAA,IAChB,uBAAuB,CAAC;AAAA,IACxB,mBAAmB,CAAC;AAAA,IACpB,0BAA0B,CAAC;AAAA,IAC3B,iBAAiB,CAAC;AAAA,IAClB,uBAAuB,CAAC;AAAA,IACxB,WAAW,CAAC;AAAA,IACZ,QAAQ,CAAC;AAAA,IACT,gBAAgB,CAAC;AAAA,IACjB,kBAAkB,CAAA;AAAA,EAAC;AAEvB,GAEMC,IAAkB;AAAA,EACtB,eAAe;AAAA,IACb,MAAM,CAAC;AAAA,IACP,kBAAkB,CAAC;AAAA,IACnB,UAAU,CAAC;AAAA,IACX,KAAK;AAAA,MACH,WAAW,CAAC;AAAA,MACZ,cAAc,CAAA;AAAA,IAChB;AAAA,IACA,qBAAqB,CAAC;AAAA,IACtB,OAAO,CAAA;AAAA,EACT;AAAA,EACA,UAAU;AAAA,IACR,cAAc,CAAC;AAAA,IACf,MAAM,CAAC;AAAA,IACP,YAAY,CAAC;AAAA,IACb,UAAU,CAAC;AAAA,IACX,YAAY,CAAC;AAAA,IACb,kBAAkB,CAAA;AAAA,EAAC;AAEvB,GAEMC,IAAa;AAAA,EACjB,GAAGF;AAAA,EACH,GAAGC;AACL,GAEaE,IAAS;AAAA,EACpB,MAAM;AAAA,EACN,OAAO;AACT,GAGaC,IAAW,KAElBC,IAAyB,OAAO,OAAOF,CAAM,EAAE;AAAA,EACnD,CAACG,GAAKC,OACJD,EAAIC,CAAM,IAAIL,GACPI;AAAA,EAET,CAAA;AACF,GA+HME,IAAsB,MAAyB;AACnD,QAAMC,IAAS,CAAC,GAEVC,IAAgB,CAEpBC,GACAC,IAAiB,CAAA,GAEjBC,MACG;AACH,eAAW,CAACC,GAAKC,CAAK,KAAK,OAAO,QAAQJ,CAAG,GAAG;AACxC,YAAAK,IAAWF,EAAI,YAAY,GAC3BG,IAAc,CAAC,GAAGL,GAAME,CAAG,GAC3BI,IAAYD,EAAY,KAAK,GAAG;AAEtC,MAAIF,KAAS,SAIT,OAAOA,KAAU,YAAY,OAAO,KAAKA,CAAK,EAAE,WAAW,IACnDF,EAAAG,CAAQ,IAAI,GAAGE,CAAS,KACzB,OAAOH,KAAU,aAC1BF,EAAUG,CAAQ,IAAI;AAAA,QACpB,KAAK,GAAGE,CAAS,IAAId,CAAQ;AAAA,MAC/B,GAEAM,EAAcK,GAAOE,GAAaJ,EAAUG,CAAQ,CAAC;AAAA,IACvD;AAAA,EAEJ;AACc,SAAAN,EAAAL,GAAwB,CAAC,GAAGI,CAAM,GAEzCA;AACT,GAEaU,IAAQX,EAAoB;"}
1
+ {"version":3,"file":"scope.js","sources":["../../src/interfaces/scope.ts"],"sourcesContent":["// SCOPE_SEED defines the basic scope structure.\n// When you need to set different permissions for Admin and User\n// on specific endpoints (like /me), use SCOPE rather than modifying SCOPE_SEED.\n\n// If you want to add a new scope:\n// 1. Add a new key to the SCOPE_SEED object below\n// 2. Add the corresponding scope strings to the Scope type union at the bottom of this file\n// 3. Change translation file contents (accesstoken_scopes_desc) when scope structure is modified\n\nconst SCOPE_SEED_ADMIN = {\n admin: {\n top: {},\n app: {},\n security: {},\n markdown: {},\n customize: {},\n import_data: {},\n export_data: {},\n data_transfer: {},\n external_notification: {},\n slack_integration: {},\n legacy_slack_integration: {},\n user_management: {},\n user_group_management: {},\n audit_log: {},\n plugin: {},\n ai_integration: {},\n full_text_search: {},\n },\n} as const;\n\nconst SCOPE_SEED_USER = {\n user_settings: {\n info: {},\n external_account: {},\n password: {},\n api: {\n api_token: {},\n access_token: {},\n },\n in_app_notification: {},\n other: {},\n },\n features: {\n ai_assistant: {},\n page: {},\n share_link: {},\n bookmark: {},\n attachment: {},\n page_bulk_export: {},\n },\n} as const;\n\nconst SCOPE_SEED = {\n ...SCOPE_SEED_ADMIN,\n ...SCOPE_SEED_USER,\n} as const;\n\nexport const ACTION = {\n READ: 'read',\n WRITE: 'write',\n} as const;\n\ntype ACTION_TYPE = (typeof ACTION)[keyof typeof ACTION];\nexport const ALL_SIGN = '*';\n\nconst SCOPE_SEED_WITH_ACTION = Object.values(ACTION).reduce(\n (acc, action) => {\n acc[action] = SCOPE_SEED;\n return acc;\n },\n {} as Record<ACTION_TYPE, typeof SCOPE_SEED>,\n);\n\n// ============================================================================\n// SCOPE LITERAL TYPE\n// ============================================================================\n// This type is explicitly defined to avoid TS2589 \"Type instantiation is\n// excessively deep\" errors that occur with recursive type definitions.\n//\n// IMPORTANT: When modifying SCOPE_SEED above, update this type union accordingly.\n// The scope strings follow the pattern: {action}:{category}[:{subcategory}[:{item}]]\n// Wildcard scopes use '*' at any level: {action}:{category}:*\n// ============================================================================\n\n// Read scopes - Admin\ntype ReadAdminScope =\n | 'read:admin:top'\n | 'read:admin:app'\n | 'read:admin:security'\n | 'read:admin:markdown'\n | 'read:admin:customize'\n | 'read:admin:import_data'\n | 'read:admin:export_data'\n | 'read:admin:data_transfer'\n | 'read:admin:external_notification'\n | 'read:admin:slack_integration'\n | 'read:admin:legacy_slack_integration'\n | 'read:admin:user_management'\n | 'read:admin:user_group_management'\n | 'read:admin:audit_log'\n | 'read:admin:plugin'\n | 'read:admin:ai_integration'\n | 'read:admin:full_text_search'\n | 'read:admin:*';\n\n// Read scopes - User Settings\ntype ReadUserSettingsScope =\n | 'read:user_settings:info'\n | 'read:user_settings:external_account'\n | 'read:user_settings:password'\n | 'read:user_settings:api:api_token'\n | 'read:user_settings:api:access_token'\n | 'read:user_settings:api:*'\n | 'read:user_settings:in_app_notification'\n | 'read:user_settings:other'\n | 'read:user_settings:*';\n\n// Read scopes - Features\ntype ReadFeaturesScope =\n | 'read:features:ai_assistant'\n | 'read:features:page'\n | 'read:features:share_link'\n | 'read:features:bookmark'\n | 'read:features:attachment'\n | 'read:features:page_bulk_export'\n | 'read:features:*';\n\n// Write scopes - Admin\ntype WriteAdminScope =\n | 'write:admin:top'\n | 'write:admin:app'\n | 'write:admin:security'\n | 'write:admin:markdown'\n | 'write:admin:customize'\n | 'write:admin:import_data'\n | 'write:admin:export_data'\n | 'write:admin:data_transfer'\n | 'write:admin:external_notification'\n | 'write:admin:slack_integration'\n | 'write:admin:legacy_slack_integration'\n | 'write:admin:user_management'\n | 'write:admin:user_group_management'\n | 'write:admin:audit_log'\n | 'write:admin:plugin'\n | 'write:admin:ai_integration'\n | 'write:admin:full_text_search'\n | 'write:admin:*';\n\n// Write scopes - User Settings\ntype WriteUserSettingsScope =\n | 'write:user_settings:info'\n | 'write:user_settings:external_account'\n | 'write:user_settings:password'\n | 'write:user_settings:api:api_token'\n | 'write:user_settings:api:access_token'\n | 'write:user_settings:api:*'\n | 'write:user_settings:in_app_notification'\n | 'write:user_settings:other'\n | 'write:user_settings:*';\n\n// Write scopes - Features\ntype WriteFeaturesScope =\n | 'write:features:ai_assistant'\n | 'write:features:page'\n | 'write:features:share_link'\n | 'write:features:bookmark'\n | 'write:features:attachment'\n | 'write:features:page_bulk_export'\n | 'write:features:*';\n\n// Combined Scope type - all valid scope strings\nexport type Scope =\n | ReadAdminScope\n | ReadUserSettingsScope\n | ReadFeaturesScope\n | WriteAdminScope\n | WriteUserSettingsScope\n | WriteFeaturesScope\n | 'read:*'\n | 'write:*';\n\n// ScopeConstants type definition\ntype ScopeConstantLeaf = Scope;\n\ntype ScopeConstantNode<T> = {\n [K in keyof T as Uppercase<string & K>]: T[K] extends object\n ? keyof T[K] extends never\n ? ScopeConstantLeaf\n : ScopeConstantNode<T[K]> & { ALL: Scope }\n : ScopeConstantLeaf;\n};\n\ntype ScopeConstantType = {\n [A in keyof typeof SCOPE_SEED_WITH_ACTION as Uppercase<\n string & A\n >]: ScopeConstantNode<typeof SCOPE_SEED> & { ALL: Scope };\n};\n\nconst buildScopeConstants = (): ScopeConstantType => {\n const result = {} as Partial<ScopeConstantType>;\n\n const processObject = (\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n obj: Record<string, any>,\n path: string[] = [],\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n resultObj: Record<string, any>,\n ) => {\n for (const [key, value] of Object.entries(obj)) {\n const upperKey = key.toUpperCase();\n const currentPath = [...path, key];\n const scopePath = currentPath.join(':');\n\n if (value == null) {\n continue; // Changed from 'return' to 'continue' to match the loop behavior\n }\n\n if (typeof value === 'object' && Object.keys(value).length === 0) {\n resultObj[upperKey] = `${scopePath}` as Scope;\n } else if (typeof value === 'object') {\n resultObj[upperKey] = {\n ALL: `${scopePath}:${ALL_SIGN}` as Scope,\n };\n\n processObject(value, currentPath, resultObj[upperKey]);\n }\n }\n };\n processObject(SCOPE_SEED_WITH_ACTION, [], result);\n\n return result as ScopeConstantType;\n};\n\nexport const SCOPE = buildScopeConstants();\n"],"names":["SCOPE_SEED_ADMIN","SCOPE_SEED_USER","SCOPE_SEED","ACTION","ALL_SIGN","SCOPE_SEED_WITH_ACTION","acc","action","buildScopeConstants","result","processObject","obj","path","resultObj","key","value","upperKey","currentPath","scopePath","SCOPE"],"mappings":"AASA,MAAMA,IAAmB;AAAA,EACvB,OAAO;AAAA,IACL,KAAK,CAAA;AAAA,IACL,KAAK,CAAA;AAAA,IACL,UAAU,CAAA;AAAA,IACV,UAAU,CAAA;AAAA,IACV,WAAW,CAAA;AAAA,IACX,aAAa,CAAA;AAAA,IACb,aAAa,CAAA;AAAA,IACb,eAAe,CAAA;AAAA,IACf,uBAAuB,CAAA;AAAA,IACvB,mBAAmB,CAAA;AAAA,IACnB,0BAA0B,CAAA;AAAA,IAC1B,iBAAiB,CAAA;AAAA,IACjB,uBAAuB,CAAA;AAAA,IACvB,WAAW,CAAA;AAAA,IACX,QAAQ,CAAA;AAAA,IACR,gBAAgB,CAAA;AAAA,IAChB,kBAAkB,CAAA;AAAA,EAAC;AAEvB,GAEMC,IAAkB;AAAA,EACtB,eAAe;AAAA,IACb,MAAM,CAAA;AAAA,IACN,kBAAkB,CAAA;AAAA,IAClB,UAAU,CAAA;AAAA,IACV,KAAK;AAAA,MACH,WAAW,CAAA;AAAA,MACX,cAAc,CAAA;AAAA,IAAC;AAAA,IAEjB,qBAAqB,CAAA;AAAA,IACrB,OAAO,CAAA;AAAA,EAAC;AAAA,EAEV,UAAU;AAAA,IACR,cAAc,CAAA;AAAA,IACd,MAAM,CAAA;AAAA,IACN,YAAY,CAAA;AAAA,IACZ,UAAU,CAAA;AAAA,IACV,YAAY,CAAA;AAAA,IACZ,kBAAkB,CAAA;AAAA,EAAC;AAEvB,GAEMC,IAAa;AAAA,EACjB,GAAGF;AAAA,EACH,GAAGC;AACL,GAEaE,IAAS;AAAA,EACpB,MAAM;AAAA,EACN,OAAO;AACT,GAGaC,IAAW,KAElBC,IAAyB,OAAO,OAAOF,CAAM,EAAE;AAAA,EACnD,CAACG,GAAKC,OACJD,EAAIC,CAAM,IAAIL,GACPI;AAAA,EAET,CAAA;AACF,GA+HME,IAAsB,MAAyB;AACnD,QAAMC,IAAS,CAAA,GAETC,IAAgB,CAEpBC,GACAC,IAAiB,CAAA,GAEjBC,MACG;AACH,eAAW,CAACC,GAAKC,CAAK,KAAK,OAAO,QAAQJ,CAAG,GAAG;AAC9C,YAAMK,IAAWF,EAAI,YAAA,GACfG,IAAc,CAAC,GAAGL,GAAME,CAAG,GAC3BI,IAAYD,EAAY,KAAK,GAAG;AAEtC,MAAIF,KAAS,SAIT,OAAOA,KAAU,YAAY,OAAO,KAAKA,CAAK,EAAE,WAAW,IAC7DF,EAAUG,CAAQ,IAAI,GAAGE,CAAS,KACzB,OAAOH,KAAU,aAC1BF,EAAUG,CAAQ,IAAI;AAAA,QACpB,KAAK,GAAGE,CAAS,IAAId,CAAQ;AAAA,MAAA,GAG/BM,EAAcK,GAAOE,GAAaJ,EAAUG,CAAQ,CAAC;AAAA,IAEzD;AAAA,EACF;AACA,SAAAN,EAAcL,GAAwB,CAAA,GAAII,CAAM,GAEzCA;AACT,GAEaU,IAAQX,EAAA;"}
@@ -2,7 +2,6 @@ import { Request, RequestHandler } from 'express';
2
2
  import { IUserSerializedSecurely } from '../../models/serializers';
3
3
  import { Scope } from '../scope';
4
4
  import { IUserHasId } from '../user';
5
-
6
5
  export interface AccessTokenParserReq extends Request {
7
6
  user?: IUserSerializedSecurely<IUserHasId>;
8
7
  query: Request['query'] & {
@@ -1,7 +1,6 @@
1
1
  import { Ref } from './common';
2
2
  import { IPage } from './page';
3
3
  import { IUser } from './user';
4
-
5
4
  export declare const SubscriptionStatusType: {
6
5
  readonly SUBSCRIBE: "SUBSCRIBE";
7
6
  readonly UNSUBSCRIBE: "UNSUBSCRIBE";
@@ -2,7 +2,6 @@ import { IAttachment } from './attachment';
2
2
  import { Ref } from './common';
3
3
  import { HasObjectId } from './has-object-id';
4
4
  import { Lang } from './lang';
5
-
6
5
  export type IUser = {
7
6
  name: string;
8
7
  username: string;
@@ -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 =\n /^(.+\\/[^/]+)\\/(\\d{4}|\\d{4}\\/\\d{2}|\\d{4}\\/\\d{2}\\/\\d{2})$/;\n\nexport class DevidedPagePath {\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 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 {\n // for non-chrome browsers\n // biome-ignore lint/complexity/useRegexLiterals: ignore\n PATTERN_DEFAULT = new RegExp('^((.*)(?<!<)\\\\/)?(.+)$'); // https://regex101.com/r/HJNvMW/1\n } catch {\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"],"names":["PATTERN_INCLUDE_DATE","DevidedPagePath","path","skipNormalize","evalDatePath","__publicField","pagePath","pathUtils.normalizePath","matchDate","PATTERN_DEFAULT","matchDefault"],"mappings":"+RAGMA,EACJ,0DAEK,MAAMC,CAAgB,CAS3B,YAAYC,EAAcC,EAAgB,GAAOC,EAAe,GAAO,CARvEC,EAAA,eAEAA,EAAA,qBAEAA,EAAA,eAEAA,EAAA,eAQE,GALA,KAAK,OAAS,GACd,KAAK,aAAe,GACpB,KAAK,OAAS,GAGVH,GAAQ,MAAQA,IAAS,IAAMA,IAAS,IAAK,CAC/C,KAAK,OAAS,GACd,KAAK,OAAS,IACd,MAAA,CAGF,MAAMI,EAAWH,EAAgBD,EAAOK,EAAAA,cAAwBL,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,MAAA,CACF,CAGF,IAAIC,EAAkB,yBAClB,GAAA,CAGgBA,EAAA,IAAI,OAAO,wBAAwB,CAAA,MAC/C,CAAA,CAIF,MAAAC,EAAeJ,EAAS,MAAMG,CAAe,EAC/CC,GAAgB,OACb,KAAA,aAAeA,EAAa,CAAC,IAAM,IACnC,KAAA,OAASA,EAAa,CAAC,EACvB,KAAA,OAASA,EAAa,CAAC,EAC9B,CAEJ"}
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 =\n /^(.+\\/[^/]+)\\/(\\d{4}|\\d{4}\\/\\d{2}|\\d{4}\\/\\d{2}\\/\\d{2})$/;\n\nexport class DevidedPagePath {\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 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 {\n // for non-chrome browsers\n // biome-ignore lint/complexity/useRegexLiterals: ignore\n PATTERN_DEFAULT = new RegExp('^((.*)(?<!<)\\\\/)?(.+)$'); // https://regex101.com/r/HJNvMW/1\n } catch {\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"],"names":["PATTERN_INCLUDE_DATE","DevidedPagePath","path","skipNormalize","evalDatePath","__publicField","pagePath","pathUtils.normalizePath","matchDate","PATTERN_DEFAULT","matchDefault"],"mappings":"+RAGMA,EACJ,0DAEK,MAAMC,CAAgB,CAS3B,YAAYC,EAAcC,EAAgB,GAAOC,EAAe,GAAO,CARvEC,EAAA,eAEAA,EAAA,qBAEAA,EAAA,eAEAA,EAAA,eAQE,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,EAAAA,cAAwBL,CAAI,EAIpE,GAHA,KAAK,OAASI,EAGVF,EAAc,CAChB,MAAMI,EAAYF,EAAS,MAAMN,CAAoB,EACrD,GAAIQ,GAAa,KAAM,CACrB,KAAK,OAASA,EAAU,CAAC,EACzB,KAAK,OAASA,EAAU,CAAC,EACzB,MACF,CACF,CAEA,IAAIC,EAAkB,yBACtB,GAAI,CAGFA,EAAkB,IAAI,OAAO,wBAAwB,CACvD,MAAQ,CAER,CAEA,MAAMC,EAAeJ,EAAS,MAAMG,CAAe,EAC/CC,GAAgB,OAClB,KAAK,aAAeA,EAAa,CAAC,IAAM,IACxC,KAAK,OAASA,EAAa,CAAC,EAC5B,KAAK,OAASA,EAAa,CAAC,EAEhC,CACF"}
@@ -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 =\n /^(.+\\/[^/]+)\\/(\\d{4}|\\d{4}\\/\\d{2}|\\d{4}\\/\\d{2}\\/\\d{2})$/;\n\nexport class DevidedPagePath {\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 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 {\n // for non-chrome browsers\n // biome-ignore lint/complexity/useRegexLiterals: ignore\n PATTERN_DEFAULT = new RegExp('^((.*)(?<!<)\\\\/)?(.+)$'); // https://regex101.com/r/HJNvMW/1\n } catch {\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"],"names":["PATTERN_INCLUDE_DATE","DevidedPagePath","path","skipNormalize","evalDatePath","__publicField","pagePath","pathUtils.normalizePath","matchDate","PATTERN_DEFAULT","matchDefault"],"mappings":";;;;AAGA,MAAMA,IACJ;AAEK,MAAMC,EAAgB;AAAA,EAS3B,YAAYC,GAAcC,IAAgB,IAAOC,IAAe,IAAO;AARvE,IAAAC,EAAA;AAEA,IAAAA,EAAA;AAEA,IAAAA,EAAA;AAEA,IAAAA,EAAA;AAQE,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,IAAA;AAGF,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,MAAA;AAAA,IACF;AAGF,QAAIC,IAAkB;AAClB,QAAA;AAGgB,MAAAA,IAAA,IAAI,OAAO,wBAAwB;AAAA,IAAA,QAC/C;AAAA,IAAA;AAIF,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,EAC9B;AAEJ;"}
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 =\n /^(.+\\/[^/]+)\\/(\\d{4}|\\d{4}\\/\\d{2}|\\d{4}\\/\\d{2}\\/\\d{2})$/;\n\nexport class DevidedPagePath {\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 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 {\n // for non-chrome browsers\n // biome-ignore lint/complexity/useRegexLiterals: ignore\n PATTERN_DEFAULT = new RegExp('^((.*)(?<!<)\\\\/)?(.+)$'); // https://regex101.com/r/HJNvMW/1\n } catch {\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"],"names":["PATTERN_INCLUDE_DATE","DevidedPagePath","path","skipNormalize","evalDatePath","__publicField","pagePath","pathUtils.normalizePath","matchDate","PATTERN_DEFAULT","matchDefault"],"mappings":";;;;AAGA,MAAMA,IACJ;AAEK,MAAMC,EAAgB;AAAA,EAS3B,YAAYC,GAAcC,IAAgB,IAAOC,IAAe,IAAO;AARvE,IAAAC,EAAA;AAEA,IAAAA,EAAA;AAEA,IAAAA,EAAA;AAEA,IAAAA,EAAA;AAQE,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;AAChB,YAAMI,IAAYF,EAAS,MAAMN,CAAoB;AACrD,UAAIQ,KAAa,MAAM;AACrB,aAAK,SAASA,EAAU,CAAC,GACzB,KAAK,SAASA,EAAU,CAAC;AACzB;AAAA,MACF;AAAA,IACF;AAEA,QAAIC,IAAkB;AACtB,QAAI;AAGF,MAAAA,IAAkB,IAAI,OAAO,wBAAwB;AAAA,IACvD,QAAQ;AAAA,IAER;AAEA,UAAMC,IAAeJ,EAAS,MAAMG,CAAe;AACnD,IAAIC,KAAgB,SAClB,KAAK,eAAeA,EAAa,CAAC,MAAM,KACxC,KAAK,SAASA,EAAa,CAAC,GAC5B,KAAK,SAASA,EAAa,CAAC;AAAA,EAEhC;AACF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"attachment-serializer.cjs","sources":["../../../src/models/serializers/attachment-serializer.ts"],"sourcesContent":["import { Document } from 'mongoose';\n\nimport type { IAttachment, IUser } from '~/interfaces';\n\nimport { isPopulated, isRef, type Ref } from '../../interfaces/common';\nimport {\n type IUserSerializedSecurely,\n serializeUserSecurely,\n} from './user-serializer';\n\nexport type IAttachmentSerializedSecurely<A extends IAttachment> = Omit<\n A,\n 'creator'\n> & { creator?: Ref<IUserSerializedSecurely<IUser>> };\n\nconst omitInsecureAttributes = <A extends IAttachment>(\n attachment: A,\n): IAttachmentSerializedSecurely<A> => {\n const leanDoc =\n attachment instanceof Document ? attachment.toObject<A>() : attachment;\n\n const { creator, ...rest } = leanDoc;\n\n const secureCreator =\n creator == null ? undefined : serializeUserSecurely(creator);\n\n return {\n creator: secureCreator,\n ...rest,\n };\n};\n\nexport function serializeAttachmentSecurely<A extends IAttachment>(\n attachment?: A,\n): IAttachmentSerializedSecurely<A>;\nexport function serializeAttachmentSecurely<A extends IAttachment>(\n attachment?: Ref<A>,\n): Ref<IAttachmentSerializedSecurely<A>>;\nexport function serializeAttachmentSecurely<A extends IAttachment>(\n attachment?: A | Ref<A>,\n):\n | undefined\n | IAttachmentSerializedSecurely<A>\n | Ref<IAttachmentSerializedSecurely<A>> {\n if (attachment == null) return attachment;\n\n if (isRef(attachment) && !isPopulated(attachment)) return attachment;\n\n return omitInsecureAttributes(attachment);\n}\n"],"names":["omitInsecureAttributes","attachment","leanDoc","Document","creator","rest","serializeUserSecurely","serializeAttachmentSecurely","isRef","isPopulated"],"mappings":"wLAeMA,EACJC,GACqC,CACrC,MAAMC,EACJD,aAAsBE,EAAAA,SAAWF,EAAW,SAAgB,EAAAA,EAExD,CAAE,QAAAG,EAAS,GAAGC,CAAA,EAASH,EAKtB,MAAA,CACL,QAHAE,GAAW,KAAO,OAAYE,EAAAA,sBAAsBF,CAAO,EAI3D,GAAGC,CACL,CACF,EAQO,SAASE,EACdN,EAIwC,CAGxC,OAFIA,GAAc,MAEdO,EAAAA,MAAMP,CAAU,GAAK,CAACQ,EAAAA,YAAYR,CAAU,EAAUA,EAEnDD,EAAuBC,CAAU,CAC1C"}
1
+ {"version":3,"file":"attachment-serializer.cjs","sources":["../../../src/models/serializers/attachment-serializer.ts"],"sourcesContent":["import { Document } from 'mongoose';\n\nimport type { IAttachment, IUser } from '~/interfaces';\n\nimport { isPopulated, isRef, type Ref } from '../../interfaces/common';\nimport {\n type IUserSerializedSecurely,\n serializeUserSecurely,\n} from './user-serializer';\n\nexport type IAttachmentSerializedSecurely<A extends IAttachment> = Omit<\n A,\n 'creator'\n> & { creator?: Ref<IUserSerializedSecurely<IUser>> };\n\nconst omitInsecureAttributes = <A extends IAttachment>(\n attachment: A,\n): IAttachmentSerializedSecurely<A> => {\n const leanDoc =\n attachment instanceof Document ? attachment.toObject<A>() : attachment;\n\n const { creator, ...rest } = leanDoc;\n\n const secureCreator =\n creator == null ? undefined : serializeUserSecurely(creator);\n\n return {\n creator: secureCreator,\n ...rest,\n };\n};\n\nexport function serializeAttachmentSecurely<A extends IAttachment>(\n attachment?: A,\n): IAttachmentSerializedSecurely<A>;\nexport function serializeAttachmentSecurely<A extends IAttachment>(\n attachment?: Ref<A>,\n): Ref<IAttachmentSerializedSecurely<A>>;\nexport function serializeAttachmentSecurely<A extends IAttachment>(\n attachment?: A | Ref<A>,\n):\n | undefined\n | IAttachmentSerializedSecurely<A>\n | Ref<IAttachmentSerializedSecurely<A>> {\n if (attachment == null) return attachment;\n\n if (isRef(attachment) && !isPopulated(attachment)) return attachment;\n\n return omitInsecureAttributes(attachment);\n}\n"],"names":["omitInsecureAttributes","attachment","leanDoc","Document","creator","rest","serializeUserSecurely","serializeAttachmentSecurely","isRef","isPopulated"],"mappings":"wLAeMA,EACJC,GACqC,CACrC,MAAMC,EACJD,aAAsBE,EAAAA,SAAWF,EAAW,WAAgBA,EAExD,CAAE,QAAAG,EAAS,GAAGC,CAAA,EAASH,EAK7B,MAAO,CACL,QAHAE,GAAW,KAAO,OAAYE,EAAAA,sBAAsBF,CAAO,EAI3D,GAAGC,CAAA,CAEP,EAQO,SAASE,EACdN,EAIwC,CAGxC,OAFIA,GAAc,MAEdO,EAAAA,MAAMP,CAAU,GAAK,CAACQ,EAAAA,YAAYR,CAAU,EAAUA,EAEnDD,EAAuBC,CAAU,CAC1C"}
@@ -1,7 +1,6 @@
1
- import { IAttachment, IUser } from '~/interfaces';
1
+ import { IAttachment, IUser } from '../../interfaces';
2
2
  import { Ref } from '../../interfaces/common';
3
3
  import { IUserSerializedSecurely } from './user-serializer';
4
-
5
4
  export type IAttachmentSerializedSecurely<A extends IAttachment> = Omit<A, 'creator'> & {
6
5
  creator?: Ref<IUserSerializedSecurely<IUser>>;
7
6
  };