@growi/core 2.4.0 → 2.5.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 (103) hide show
  1. package/dist/consts/index.d.ts +5 -5
  2. package/dist/index.d.ts +2 -2
  3. package/dist/interfaces/attachment.d.ts +4 -4
  4. package/dist/interfaces/common.cjs.map +1 -1
  5. package/dist/interfaces/common.js.map +1 -1
  6. package/dist/interfaces/external-account.d.ts +2 -2
  7. package/dist/interfaces/growi-app-info.cjs.map +1 -1
  8. package/dist/interfaces/growi-app-info.d.ts +1 -1
  9. package/dist/interfaces/growi-app-info.js.map +1 -1
  10. package/dist/interfaces/growi-theme-metadata.cjs.map +1 -1
  11. package/dist/interfaces/growi-theme-metadata.js.map +1 -1
  12. package/dist/interfaces/index.d.ts +20 -20
  13. package/dist/interfaces/page.cjs.map +1 -1
  14. package/dist/interfaces/page.d.ts +6 -6
  15. package/dist/interfaces/page.js.map +1 -1
  16. package/dist/interfaces/primitive/string.cjs.map +1 -1
  17. package/dist/interfaces/primitive/string.js.map +1 -1
  18. package/dist/interfaces/revision.cjs.map +1 -1
  19. package/dist/interfaces/revision.d.ts +4 -4
  20. package/dist/interfaces/revision.js.map +1 -1
  21. package/dist/interfaces/scope.cjs +1 -1
  22. package/dist/interfaces/scope.cjs.map +1 -1
  23. package/dist/interfaces/scope.d.ts +8 -8
  24. package/dist/interfaces/scope.js +6 -6
  25. package/dist/interfaces/scope.js.map +1 -1
  26. package/dist/interfaces/server/access-token-parser.d.ts +3 -3
  27. package/dist/interfaces/server/index.d.ts +1 -1
  28. package/dist/interfaces/subscription.cjs.map +1 -1
  29. package/dist/interfaces/subscription.d.ts +3 -3
  30. package/dist/interfaces/subscription.js.map +1 -1
  31. package/dist/interfaces/user.cjs.map +1 -1
  32. package/dist/interfaces/user.d.ts +4 -4
  33. package/dist/interfaces/user.js.map +1 -1
  34. package/dist/interfaces/vault/index.cjs +2 -0
  35. package/dist/interfaces/vault/index.cjs.map +1 -0
  36. package/dist/interfaces/vault/index.d.ts +3 -0
  37. package/dist/interfaces/vault/index.js +2 -0
  38. package/dist/interfaces/vault/index.js.map +1 -0
  39. package/dist/interfaces/vault/vault-compose-view.cjs +2 -0
  40. package/dist/interfaces/vault/vault-compose-view.cjs.map +1 -0
  41. package/dist/interfaces/vault/vault-compose-view.d.ts +11 -0
  42. package/dist/interfaces/vault/vault-compose-view.js +2 -0
  43. package/dist/interfaces/vault/vault-compose-view.js.map +1 -0
  44. package/dist/interfaces/vault/vault-instruction.cjs +2 -0
  45. package/dist/interfaces/vault/vault-instruction.cjs.map +1 -0
  46. package/dist/interfaces/vault/vault-instruction.d.ts +35 -0
  47. package/dist/interfaces/vault/vault-instruction.js +2 -0
  48. package/dist/interfaces/vault/vault-instruction.js.map +1 -0
  49. package/dist/interfaces/vault/vault-storage-stats.cjs +2 -0
  50. package/dist/interfaces/vault/vault-storage-stats.cjs.map +1 -0
  51. package/dist/interfaces/vault/vault-storage-stats.d.ts +11 -0
  52. package/dist/interfaces/vault/vault-storage-stats.js +2 -0
  53. package/dist/interfaces/vault/vault-storage-stats.js.map +1 -0
  54. package/dist/models/devided-page-path.cjs.map +1 -1
  55. package/dist/models/devided-page-path.js.map +1 -1
  56. package/dist/models/index.d.ts +2 -2
  57. package/dist/models/serializers/attachment-serializer.cjs.map +1 -1
  58. package/dist/models/serializers/attachment-serializer.d.ts +2 -2
  59. package/dist/models/serializers/attachment-serializer.js.map +1 -1
  60. package/dist/models/serializers/index.d.ts +2 -2
  61. package/dist/models/serializers/user-serializer.cjs.map +1 -1
  62. package/dist/models/serializers/user-serializer.d.ts +2 -2
  63. package/dist/models/serializers/user-serializer.js.map +1 -1
  64. package/dist/models/vo/error-apiv3.cjs.map +1 -1
  65. package/dist/models/vo/error-apiv3.js.map +1 -1
  66. package/dist/remark-plugins/index.d.ts +2 -2
  67. package/dist/remark-plugins/util/option-parser.cjs.map +1 -1
  68. package/dist/remark-plugins/util/option-parser.d.ts +1 -1
  69. package/dist/remark-plugins/util/option-parser.js.map +1 -1
  70. package/dist/swr/index.d.ts +1 -1
  71. package/dist/swr/with-utils.cjs.map +1 -1
  72. package/dist/swr/with-utils.js.map +1 -1
  73. package/dist/utils/browser-utils.cjs.map +1 -1
  74. package/dist/utils/browser-utils.js.map +1 -1
  75. package/dist/utils/env-utils.cjs.map +1 -1
  76. package/dist/utils/env-utils.js.map +1 -1
  77. package/dist/utils/escape-string-for-regex.cjs.map +1 -1
  78. package/dist/utils/escape-string-for-regex.js.map +1 -1
  79. package/dist/utils/global-event-target.cjs.map +1 -1
  80. package/dist/utils/global-event-target.js.map +1 -1
  81. package/dist/utils/growi-theme-metadata.cjs.map +1 -1
  82. package/dist/utils/growi-theme-metadata.d.ts +2 -2
  83. package/dist/utils/growi-theme-metadata.js.map +1 -1
  84. package/dist/utils/index.cjs.map +1 -1
  85. package/dist/utils/index.d.ts +11 -11
  86. package/dist/utils/index.js.map +1 -1
  87. package/dist/utils/is-deep-equals.cjs.map +1 -1
  88. package/dist/utils/is-deep-equals.js.map +1 -1
  89. package/dist/utils/page-path-utils/generate-children-regexp.cjs.map +1 -1
  90. package/dist/utils/page-path-utils/generate-children-regexp.js.map +1 -1
  91. package/dist/utils/page-path-utils/index.cjs.map +1 -1
  92. package/dist/utils/page-path-utils/index.d.ts +2 -2
  93. package/dist/utils/page-path-utils/index.js.map +1 -1
  94. package/dist/utils/page-path-utils/is-top-page.cjs.map +1 -1
  95. package/dist/utils/page-path-utils/is-top-page.js.map +1 -1
  96. package/dist/utils/page-utils.cjs.map +1 -1
  97. package/dist/utils/page-utils.d.ts +1 -1
  98. package/dist/utils/page-utils.js.map +1 -1
  99. package/dist/utils/path-utils.cjs.map +1 -1
  100. package/dist/utils/path-utils.js.map +1 -1
  101. package/dist/utils/template-checker.cjs.map +1 -1
  102. package/dist/utils/template-checker.js.map +1 -1
  103. package/package.json +6 -1
@@ -1,5 +1,5 @@
1
- export * from './accepted-upload-file-type';
2
- export * from './growi-plugin';
3
- export * from './renderer';
4
- export * from './system';
5
- export * from './ydoc-status';
1
+ export * from './accepted-upload-file-type.js';
2
+ export * from './growi-plugin.js';
3
+ export * from './renderer.js';
4
+ export * from './system.js';
5
+ export * from './ydoc-status.js';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export * from './consts';
2
- export * from './interfaces';
1
+ export * from './consts/index.js';
2
+ export * from './interfaces/index.js';
3
3
  declare global {
4
4
  interface RegExpConstructor {
5
5
  escape(str: string): string;
@@ -1,7 +1,7 @@
1
- import { Ref } from './common';
2
- import { HasObjectId } from './has-object-id';
3
- import { IPage } from './page';
4
- import { IUser } from './user';
1
+ import { Ref } from './common.js';
2
+ import { HasObjectId } from './has-object-id.js';
3
+ import { IPage } from './page.js';
4
+ import { IUser } from './user.js';
5
5
  export type IAttachment = {
6
6
  page?: Ref<IPage>;
7
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.js';\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 +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.js';\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,5 +1,5 @@
1
- import { Ref } from './common';
2
- import { IUser } from './user';
1
+ import { Ref } from './common.js';
2
+ import { IUser } from './user.js';
3
3
  export type IExternalAccount<P> = {
4
4
  providerType: P;
5
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 {\n GrowiDeploymentType,\n GrowiServiceType,\n} from '../consts/system.js';\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":"gFAOO,MAAMA,EAAgB,CAAE,KAAM,OAAQ,OAAQ,QAAA"}
@@ -1,4 +1,4 @@
1
- import { GrowiDeploymentType, GrowiServiceType } from '../consts/system';
1
+ import { GrowiDeploymentType, GrowiServiceType } from '../consts/system.js';
2
2
  import type * as os from 'node:os';
3
3
  export declare const GrowiWikiType: {
4
4
  readonly open: "open";
@@ -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 {\n GrowiDeploymentType,\n GrowiServiceType,\n} from '../consts/system.js';\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":"AAOO,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.js';\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"}
@@ -1 +1 @@
1
- {"version":3,"file":"growi-theme-metadata.js","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":";AAEO,MAAMA,IAAuB;AAAA,EAClC,GAAGC;AAAA,EACH,MAAM;AACR,GAkBaC,IAAuB,CAClCC,MAC8B;AAE9B,QAAMC,IAASD;AAEf,SACEC,KAAU,QACV,OAAOA,KAAW,YAClB,MAAM,QAAQA,CAAM,MAAM,MAC1B,UAAUA,KACV,OAAOA,EAAO,QAAS,YACvB,iBAAiBA,KACjB,OAAOA,EAAO,eAAgB,YAC9B,gBAAgBA,KAChB,OAAOA,EAAO,cAAe,YAC7B,aAAaA,KACb,OAAOA,EAAO,WAAY,YAC1B,YAAYA,KACZ,OAAOA,EAAO,UAAW,YACzB,kBAAkBA,KAClB,OAAOA,EAAO,gBAAiB,YAC/B,iBAAiBA,KACjB,OAAOA,EAAO,eAAgB,YAC9B,eAAeA,KACf,OAAOA,EAAO,aAAc,YAC5B,cAAcA,KACd,OAAOA,EAAO,YAAa,YAC3B,eAAeA,KACf,OAAOA,EAAO,aAAc;AAEhC;"}
1
+ {"version":3,"file":"growi-theme-metadata.js","sources":["../../src/interfaces/growi-theme-metadata.ts"],"sourcesContent":["import { ColorScheme } from './color-scheme.js';\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":";AAEO,MAAMA,IAAuB;AAAA,EAClC,GAAGC;AAAA,EACH,MAAM;AACR,GAkBaC,IAAuB,CAClCC,MAC8B;AAE9B,QAAMC,IAASD;AAEf,SACEC,KAAU,QACV,OAAOA,KAAW,YAClB,MAAM,QAAQA,CAAM,MAAM,MAC1B,UAAUA,KACV,OAAOA,EAAO,QAAS,YACvB,iBAAiBA,KACjB,OAAOA,EAAO,eAAgB,YAC9B,gBAAgBA,KAChB,OAAOA,EAAO,cAAe,YAC7B,aAAaA,KACb,OAAOA,EAAO,WAAY,YAC1B,YAAYA,KACZ,OAAOA,EAAO,UAAW,YACzB,kBAAkBA,KAClB,OAAOA,EAAO,gBAAiB,YAC/B,iBAAiBA,KACjB,OAAOA,EAAO,eAAgB,YAC9B,eAAeA,KACf,OAAOA,EAAO,aAAc,YAC5B,cAAcA,KACd,OAAOA,EAAO,YAAa,YAC3B,eAAeA,KACf,OAAOA,EAAO,aAAc;AAEhC;"}
@@ -1,20 +1,20 @@
1
- export * from './attachment';
2
- export * from './color-scheme';
3
- export * from './color-scheme';
4
- export * from './common';
5
- export * from './config-manager';
6
- export * from './external-account';
7
- export * from './growi-app-info';
8
- export * from './growi-facade';
9
- export * from './growi-theme-metadata';
10
- export * from './has-object-id';
11
- export * from './lang';
12
- export * from './locale';
13
- export * from './page';
14
- export * from './primitive/string';
15
- export * from './revision';
16
- export * from './scope';
17
- export * from './subscription';
18
- export * from './tag';
19
- export * from './user';
20
- export * from './vite';
1
+ export * from './attachment.js';
2
+ export * from './color-scheme.js';
3
+ export * from './color-scheme.js';
4
+ export * from './common.js';
5
+ export * from './config-manager.js';
6
+ export * from './external-account.js';
7
+ export * from './growi-app-info.js';
8
+ export * from './growi-facade.js';
9
+ export * from './growi-theme-metadata.js';
10
+ export * from './has-object-id.js';
11
+ export * from './lang.js';
12
+ export * from './locale.js';
13
+ export * from './page.js';
14
+ export * from './primitive/string.js';
15
+ export * from './revision.js';
16
+ export * from './scope.js';
17
+ export * from './subscription.js';
18
+ export * from './tag.js';
19
+ export * from './user.js';
20
+ export * from './vite.js';
@@ -1 +1 @@
1
- {"version":3,"file":"page.cjs","sources":["../../src/interfaces/page.ts"],"sourcesContent":["import type { Ref } from './common';\nimport type { HasObjectId } from './has-object-id';\nimport type {\n HasRevisionShortbody,\n IRevision,\n IRevisionHasId,\n} from './revision';\nimport type { SubscriptionStatusType } from './subscription';\nimport type { ITag } from './tag';\nimport type { IUser, IUserGroup, IUserGroupHasId, IUserHasId } from './user';\n\nexport const GroupType = {\n userGroup: 'UserGroup',\n externalUserGroup: 'ExternalUserGroup',\n} as const;\nexport type GroupType = (typeof GroupType)[keyof typeof GroupType];\n\nexport type IGrantedGroup = {\n type: GroupType;\n item: Ref<IUserGroup>;\n};\n\nexport type IPage = {\n path: string;\n status: string;\n revision?: Ref<IRevision>;\n tags: Ref<ITag>[];\n creator?: Ref<IUser>;\n createdAt: Date;\n updatedAt: Date;\n seenUsers: Ref<IUser>[];\n parent: Ref<IPage> | null;\n descendantCount: number;\n isEmpty: boolean;\n grant: PageGrant;\n grantedUsers: Ref<IUser>[];\n grantedGroups: IGrantedGroup[];\n lastUpdateUser?: Ref<IUser>;\n liker: Ref<IUser>[];\n commentCount: number;\n slackChannels: string;\n deleteUser: Ref<IUser>;\n deletedAt: Date;\n latestRevision?: Ref<IRevision>;\n latestRevisionBodyLength?: number;\n expandContentWidth?: boolean;\n wip?: boolean;\n ttlTimestamp?: Date;\n};\n\nexport type IPagePopulatedToShowRevision = Omit<\n IPageHasId,\n | 'lastUpdateUser'\n | 'creator'\n | 'deleteUser'\n | 'grantedGroups'\n | 'revision'\n | 'author'\n> & {\n lastUpdateUser?: IUserHasId;\n creator?: IUserHasId;\n deleteUser: IUserHasId;\n grantedGroups: { type: GroupType; item: IUserGroupHasId }[];\n revision?: IRevisionHasId;\n author: IUserHasId;\n};\n\nexport const PageGrant = {\n GRANT_PUBLIC: 1,\n GRANT_RESTRICTED: 2,\n GRANT_SPECIFIED: 3, // DEPRECATED\n GRANT_OWNER: 4,\n GRANT_USER_GROUP: 5,\n} as const;\ntype UnionPageGrantKeys = keyof typeof PageGrant;\nexport type PageGrant = (typeof PageGrant)[UnionPageGrantKeys];\n\nexport const PageStatus = {\n STATUS_PUBLISHED: 'published',\n STATUS_DELETED: 'deleted',\n} as const;\nexport type PageStatus = (typeof PageStatus)[keyof typeof PageStatus];\n\nexport type IPageHasId = IPage & HasObjectId;\n\n// Special type to represent page is an empty page or not found or forbidden status\nexport type IPageNotFoundInfo = {\n isNotFound: true;\n isForbidden: boolean;\n};\n\nexport type IPageInfo = {\n isNotFound: boolean;\n isV5Compatible: boolean;\n isEmpty: boolean;\n isMovable: boolean;\n isDeletable: boolean;\n isAbleToDeleteCompletely: boolean;\n isRevertible: boolean;\n bookmarkCount: number;\n};\n\nexport type IPageInfoForEmpty = Omit<IPageInfo, 'isNotFound' | 'isEmpty'> & {\n emptyPageId: string;\n isNotFound: false;\n isEmpty: true;\n isBookmarked?: boolean;\n};\n\nexport type IPageInfoForEntity = Omit<IPageInfo, 'isNotFound' | 'isEmpty'> & {\n isNotFound: false;\n isEmpty: false;\n sumOfLikers: number;\n likerIds: string[];\n sumOfSeenUsers: number;\n seenUserIds: string[];\n contentAge: number;\n descendantCount: number;\n commentCount: number;\n latestRevisionId: Ref<IRevision>;\n};\n\nexport type IPageInfoForOperation = IPageInfoForEntity & {\n isBookmarked?: boolean;\n isLiked?: boolean;\n subscriptionStatus?: SubscriptionStatusType;\n};\n\nexport type IPageInfoForListing = IPageInfoForEntity & HasRevisionShortbody;\n\nexport type IPageInfoExt =\n | IPageInfo\n | IPageInfoForEmpty\n | IPageInfoForEntity\n | IPageInfoForOperation\n | IPageInfoForListing;\n\nexport const isIPageNotFoundInfo = (\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n pageInfo: any | undefined,\n): pageInfo is IPageNotFoundInfo => {\n return (\n pageInfo != null &&\n pageInfo instanceof Object &&\n pageInfo.isNotFound === true &&\n 'isForbidden' in pageInfo\n );\n};\n\nexport const isIPageInfo = (\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n pageInfo: any | undefined,\n): pageInfo is IPageInfo => {\n return (\n pageInfo != null && pageInfo instanceof Object && 'isEmpty' in pageInfo\n );\n};\n\nexport const isIPageInfoForEmpty = (\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n pageInfo: any | undefined,\n): pageInfo is IPageInfoForEmpty => {\n return isIPageInfo(pageInfo) && pageInfo.isEmpty === true;\n};\n\nexport const isIPageInfoForEntity = (\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n pageInfo: any | undefined,\n): pageInfo is IPageInfoForEntity => {\n return isIPageInfo(pageInfo) && pageInfo.isEmpty === false;\n};\n\nexport type IPageInfoBasicForEmpty = Omit<\n IPageInfoForEmpty,\n 'bookmarkCount' | 'isDeletable' | 'isAbleToDeleteCompletely' | 'isBookmarked'\n>;\n\nexport type IPageInfoBasicForEntity = Omit<\n IPageInfoForEntity,\n 'bookmarkCount' | 'isDeletable' | 'isAbleToDeleteCompletely'\n>;\n\nexport type IPageInfoBasic = IPageInfoBasicForEmpty | IPageInfoBasicForEntity;\n\nexport const isIPageInfoForOperation = (\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n pageInfo: any | undefined,\n): pageInfo is IPageInfoForOperation => {\n return (\n isIPageInfoForEntity(pageInfo) &&\n ('isBookmarked' in pageInfo ||\n 'isLiked' in pageInfo ||\n 'subscriptionStatus' in pageInfo)\n );\n};\n\nexport const isIPageInfoForListing = (\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n pageInfo: any | undefined,\n): pageInfo is IPageInfoForListing => {\n return isIPageInfoForEntity(pageInfo) && 'revisionShortBody' in pageInfo;\n};\n\nexport type IDataWithMeta<D = unknown, M = unknown> = {\n data: D;\n meta?: M;\n};\nexport type IDataWithRequiredMeta<D = unknown, M = unknown> = IDataWithMeta<\n D,\n M\n> & { meta: M };\n\nexport type IPageWithMeta<M = IPageInfoExt> = IDataWithMeta<IPageHasId, M>;\n\nexport type IPageToDeleteWithMeta<T = IPageInfoForEntity | unknown> =\n IDataWithMeta<\n HasObjectId & (IPage | { path: string; revision: string | null }),\n T\n >;\nexport type IPageToRenameWithMeta<T = IPageInfoForEntity | unknown> =\n IPageToDeleteWithMeta<T>;\n"],"names":["GroupType","PageGrant","PageStatus","isIPageNotFoundInfo","pageInfo","isIPageInfo","isIPageInfoForEmpty","isIPageInfoForEntity","isIPageInfoForOperation","isIPageInfoForListing"],"mappings":"gFAWO,MAAMA,EAAY,CACvB,UAAW,YACX,kBAAmB,mBACrB,EAqDaC,EAAY,CACvB,aAAc,EACd,iBAAkB,EAClB,gBAAiB,EACjB,YAAa,EACb,iBAAkB,CACpB,EAIaC,EAAa,CACxB,iBAAkB,YAClB,eAAgB,SAClB,EAyDaC,EAEXC,GAGEA,GAAY,MACZA,aAAoB,QACpBA,EAAS,aAAe,IACxB,gBAAiBA,EAIRC,EAEXD,GAGEA,GAAY,MAAQA,aAAoB,QAAU,YAAaA,EAItDE,EAEXF,GAEOC,EAAYD,CAAQ,GAAKA,EAAS,UAAY,GAG1CG,EAEXH,GAEOC,EAAYD,CAAQ,GAAKA,EAAS,UAAY,GAe1CI,EAEXJ,GAGEG,EAAqBH,CAAQ,IAC5B,iBAAkBA,GACjB,YAAaA,GACb,uBAAwBA,GAIjBK,EAEXL,GAEOG,EAAqBH,CAAQ,GAAK,sBAAuBA"}
1
+ {"version":3,"file":"page.cjs","sources":["../../src/interfaces/page.ts"],"sourcesContent":["import type { Ref } from './common.js';\nimport type { HasObjectId } from './has-object-id.js';\nimport type {\n HasRevisionShortbody,\n IRevision,\n IRevisionHasId,\n} from './revision.js';\nimport type { SubscriptionStatusType } from './subscription.js';\nimport type { ITag } from './tag.js';\nimport type { IUser, IUserGroup, IUserGroupHasId, IUserHasId } from './user.js';\n\nexport const GroupType = {\n userGroup: 'UserGroup',\n externalUserGroup: 'ExternalUserGroup',\n} as const;\nexport type GroupType = (typeof GroupType)[keyof typeof GroupType];\n\nexport type IGrantedGroup = {\n type: GroupType;\n item: Ref<IUserGroup>;\n};\n\nexport type IPage = {\n path: string;\n status: string;\n revision?: Ref<IRevision>;\n tags: Ref<ITag>[];\n creator?: Ref<IUser>;\n createdAt: Date;\n updatedAt: Date;\n seenUsers: Ref<IUser>[];\n parent: Ref<IPage> | null;\n descendantCount: number;\n isEmpty: boolean;\n grant: PageGrant;\n grantedUsers: Ref<IUser>[];\n grantedGroups: IGrantedGroup[];\n lastUpdateUser?: Ref<IUser>;\n liker: Ref<IUser>[];\n commentCount: number;\n slackChannels: string;\n deleteUser: Ref<IUser>;\n deletedAt: Date;\n latestRevision?: Ref<IRevision>;\n latestRevisionBodyLength?: number;\n expandContentWidth?: boolean;\n wip?: boolean;\n ttlTimestamp?: Date;\n};\n\nexport type IPagePopulatedToShowRevision = Omit<\n IPageHasId,\n | 'lastUpdateUser'\n | 'creator'\n | 'deleteUser'\n | 'grantedGroups'\n | 'revision'\n | 'author'\n> & {\n lastUpdateUser?: IUserHasId;\n creator?: IUserHasId;\n deleteUser: IUserHasId;\n grantedGroups: { type: GroupType; item: IUserGroupHasId }[];\n revision?: IRevisionHasId;\n author: IUserHasId;\n};\n\nexport const PageGrant = {\n GRANT_PUBLIC: 1,\n GRANT_RESTRICTED: 2,\n GRANT_SPECIFIED: 3, // DEPRECATED\n GRANT_OWNER: 4,\n GRANT_USER_GROUP: 5,\n} as const;\ntype UnionPageGrantKeys = keyof typeof PageGrant;\nexport type PageGrant = (typeof PageGrant)[UnionPageGrantKeys];\n\nexport const PageStatus = {\n STATUS_PUBLISHED: 'published',\n STATUS_DELETED: 'deleted',\n} as const;\nexport type PageStatus = (typeof PageStatus)[keyof typeof PageStatus];\n\nexport type IPageHasId = IPage & HasObjectId;\n\n// Special type to represent page is an empty page or not found or forbidden status\nexport type IPageNotFoundInfo = {\n isNotFound: true;\n isForbidden: boolean;\n};\n\nexport type IPageInfo = {\n isNotFound: boolean;\n isV5Compatible: boolean;\n isEmpty: boolean;\n isMovable: boolean;\n isDeletable: boolean;\n isAbleToDeleteCompletely: boolean;\n isRevertible: boolean;\n bookmarkCount: number;\n};\n\nexport type IPageInfoForEmpty = Omit<IPageInfo, 'isNotFound' | 'isEmpty'> & {\n emptyPageId: string;\n isNotFound: false;\n isEmpty: true;\n isBookmarked?: boolean;\n};\n\nexport type IPageInfoForEntity = Omit<IPageInfo, 'isNotFound' | 'isEmpty'> & {\n isNotFound: false;\n isEmpty: false;\n sumOfLikers: number;\n likerIds: string[];\n sumOfSeenUsers: number;\n seenUserIds: string[];\n contentAge: number;\n descendantCount: number;\n commentCount: number;\n latestRevisionId: Ref<IRevision>;\n};\n\nexport type IPageInfoForOperation = IPageInfoForEntity & {\n isBookmarked?: boolean;\n isLiked?: boolean;\n subscriptionStatus?: SubscriptionStatusType;\n};\n\nexport type IPageInfoForListing = IPageInfoForEntity & HasRevisionShortbody;\n\nexport type IPageInfoExt =\n | IPageInfo\n | IPageInfoForEmpty\n | IPageInfoForEntity\n | IPageInfoForOperation\n | IPageInfoForListing;\n\nexport const isIPageNotFoundInfo = (\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n pageInfo: any | undefined,\n): pageInfo is IPageNotFoundInfo => {\n return (\n pageInfo != null &&\n pageInfo instanceof Object &&\n pageInfo.isNotFound === true &&\n 'isForbidden' in pageInfo\n );\n};\n\nexport const isIPageInfo = (\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n pageInfo: any | undefined,\n): pageInfo is IPageInfo => {\n return (\n pageInfo != null && pageInfo instanceof Object && 'isEmpty' in pageInfo\n );\n};\n\nexport const isIPageInfoForEmpty = (\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n pageInfo: any | undefined,\n): pageInfo is IPageInfoForEmpty => {\n return isIPageInfo(pageInfo) && pageInfo.isEmpty === true;\n};\n\nexport const isIPageInfoForEntity = (\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n pageInfo: any | undefined,\n): pageInfo is IPageInfoForEntity => {\n return isIPageInfo(pageInfo) && pageInfo.isEmpty === false;\n};\n\nexport type IPageInfoBasicForEmpty = Omit<\n IPageInfoForEmpty,\n 'bookmarkCount' | 'isDeletable' | 'isAbleToDeleteCompletely' | 'isBookmarked'\n>;\n\nexport type IPageInfoBasicForEntity = Omit<\n IPageInfoForEntity,\n 'bookmarkCount' | 'isDeletable' | 'isAbleToDeleteCompletely'\n>;\n\nexport type IPageInfoBasic = IPageInfoBasicForEmpty | IPageInfoBasicForEntity;\n\nexport const isIPageInfoForOperation = (\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n pageInfo: any | undefined,\n): pageInfo is IPageInfoForOperation => {\n return (\n isIPageInfoForEntity(pageInfo) &&\n ('isBookmarked' in pageInfo ||\n 'isLiked' in pageInfo ||\n 'subscriptionStatus' in pageInfo)\n );\n};\n\nexport const isIPageInfoForListing = (\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n pageInfo: any | undefined,\n): pageInfo is IPageInfoForListing => {\n return isIPageInfoForEntity(pageInfo) && 'revisionShortBody' in pageInfo;\n};\n\nexport type IDataWithMeta<D = unknown, M = unknown> = {\n data: D;\n meta?: M;\n};\nexport type IDataWithRequiredMeta<D = unknown, M = unknown> = IDataWithMeta<\n D,\n M\n> & { meta: M };\n\nexport type IPageWithMeta<M = IPageInfoExt> = IDataWithMeta<IPageHasId, M>;\n\nexport type IPageToDeleteWithMeta<T = IPageInfoForEntity | unknown> =\n IDataWithMeta<\n HasObjectId & (IPage | { path: string; revision: string | null }),\n T\n >;\nexport type IPageToRenameWithMeta<T = IPageInfoForEntity | unknown> =\n IPageToDeleteWithMeta<T>;\n"],"names":["GroupType","PageGrant","PageStatus","isIPageNotFoundInfo","pageInfo","isIPageInfo","isIPageInfoForEmpty","isIPageInfoForEntity","isIPageInfoForOperation","isIPageInfoForListing"],"mappings":"gFAWO,MAAMA,EAAY,CACvB,UAAW,YACX,kBAAmB,mBACrB,EAqDaC,EAAY,CACvB,aAAc,EACd,iBAAkB,EAClB,gBAAiB,EACjB,YAAa,EACb,iBAAkB,CACpB,EAIaC,EAAa,CACxB,iBAAkB,YAClB,eAAgB,SAClB,EAyDaC,EAEXC,GAGEA,GAAY,MACZA,aAAoB,QACpBA,EAAS,aAAe,IACxB,gBAAiBA,EAIRC,EAEXD,GAGEA,GAAY,MAAQA,aAAoB,QAAU,YAAaA,EAItDE,EAEXF,GAEOC,EAAYD,CAAQ,GAAKA,EAAS,UAAY,GAG1CG,EAEXH,GAEOC,EAAYD,CAAQ,GAAKA,EAAS,UAAY,GAe1CI,EAEXJ,GAGEG,EAAqBH,CAAQ,IAC5B,iBAAkBA,GACjB,YAAaA,GACb,uBAAwBA,GAIjBK,EAEXL,GAEOG,EAAqBH,CAAQ,GAAK,sBAAuBA"}
@@ -1,9 +1,9 @@
1
- import { Ref } from './common';
2
- import { HasObjectId } from './has-object-id';
3
- import { HasRevisionShortbody, IRevision, IRevisionHasId } from './revision';
4
- import { SubscriptionStatusType } from './subscription';
5
- import { ITag } from './tag';
6
- import { IUser, IUserGroup, IUserGroupHasId, IUserHasId } from './user';
1
+ import { Ref } from './common.js';
2
+ import { HasObjectId } from './has-object-id.js';
3
+ import { HasRevisionShortbody, IRevision, IRevisionHasId } from './revision.js';
4
+ import { SubscriptionStatusType } from './subscription.js';
5
+ import { ITag } from './tag.js';
6
+ import { IUser, IUserGroup, IUserGroupHasId, IUserHasId } from './user.js';
7
7
  export declare const GroupType: {
8
8
  readonly userGroup: "UserGroup";
9
9
  readonly externalUserGroup: "ExternalUserGroup";
@@ -1 +1 @@
1
- {"version":3,"file":"page.js","sources":["../../src/interfaces/page.ts"],"sourcesContent":["import type { Ref } from './common';\nimport type { HasObjectId } from './has-object-id';\nimport type {\n HasRevisionShortbody,\n IRevision,\n IRevisionHasId,\n} from './revision';\nimport type { SubscriptionStatusType } from './subscription';\nimport type { ITag } from './tag';\nimport type { IUser, IUserGroup, IUserGroupHasId, IUserHasId } from './user';\n\nexport const GroupType = {\n userGroup: 'UserGroup',\n externalUserGroup: 'ExternalUserGroup',\n} as const;\nexport type GroupType = (typeof GroupType)[keyof typeof GroupType];\n\nexport type IGrantedGroup = {\n type: GroupType;\n item: Ref<IUserGroup>;\n};\n\nexport type IPage = {\n path: string;\n status: string;\n revision?: Ref<IRevision>;\n tags: Ref<ITag>[];\n creator?: Ref<IUser>;\n createdAt: Date;\n updatedAt: Date;\n seenUsers: Ref<IUser>[];\n parent: Ref<IPage> | null;\n descendantCount: number;\n isEmpty: boolean;\n grant: PageGrant;\n grantedUsers: Ref<IUser>[];\n grantedGroups: IGrantedGroup[];\n lastUpdateUser?: Ref<IUser>;\n liker: Ref<IUser>[];\n commentCount: number;\n slackChannels: string;\n deleteUser: Ref<IUser>;\n deletedAt: Date;\n latestRevision?: Ref<IRevision>;\n latestRevisionBodyLength?: number;\n expandContentWidth?: boolean;\n wip?: boolean;\n ttlTimestamp?: Date;\n};\n\nexport type IPagePopulatedToShowRevision = Omit<\n IPageHasId,\n | 'lastUpdateUser'\n | 'creator'\n | 'deleteUser'\n | 'grantedGroups'\n | 'revision'\n | 'author'\n> & {\n lastUpdateUser?: IUserHasId;\n creator?: IUserHasId;\n deleteUser: IUserHasId;\n grantedGroups: { type: GroupType; item: IUserGroupHasId }[];\n revision?: IRevisionHasId;\n author: IUserHasId;\n};\n\nexport const PageGrant = {\n GRANT_PUBLIC: 1,\n GRANT_RESTRICTED: 2,\n GRANT_SPECIFIED: 3, // DEPRECATED\n GRANT_OWNER: 4,\n GRANT_USER_GROUP: 5,\n} as const;\ntype UnionPageGrantKeys = keyof typeof PageGrant;\nexport type PageGrant = (typeof PageGrant)[UnionPageGrantKeys];\n\nexport const PageStatus = {\n STATUS_PUBLISHED: 'published',\n STATUS_DELETED: 'deleted',\n} as const;\nexport type PageStatus = (typeof PageStatus)[keyof typeof PageStatus];\n\nexport type IPageHasId = IPage & HasObjectId;\n\n// Special type to represent page is an empty page or not found or forbidden status\nexport type IPageNotFoundInfo = {\n isNotFound: true;\n isForbidden: boolean;\n};\n\nexport type IPageInfo = {\n isNotFound: boolean;\n isV5Compatible: boolean;\n isEmpty: boolean;\n isMovable: boolean;\n isDeletable: boolean;\n isAbleToDeleteCompletely: boolean;\n isRevertible: boolean;\n bookmarkCount: number;\n};\n\nexport type IPageInfoForEmpty = Omit<IPageInfo, 'isNotFound' | 'isEmpty'> & {\n emptyPageId: string;\n isNotFound: false;\n isEmpty: true;\n isBookmarked?: boolean;\n};\n\nexport type IPageInfoForEntity = Omit<IPageInfo, 'isNotFound' | 'isEmpty'> & {\n isNotFound: false;\n isEmpty: false;\n sumOfLikers: number;\n likerIds: string[];\n sumOfSeenUsers: number;\n seenUserIds: string[];\n contentAge: number;\n descendantCount: number;\n commentCount: number;\n latestRevisionId: Ref<IRevision>;\n};\n\nexport type IPageInfoForOperation = IPageInfoForEntity & {\n isBookmarked?: boolean;\n isLiked?: boolean;\n subscriptionStatus?: SubscriptionStatusType;\n};\n\nexport type IPageInfoForListing = IPageInfoForEntity & HasRevisionShortbody;\n\nexport type IPageInfoExt =\n | IPageInfo\n | IPageInfoForEmpty\n | IPageInfoForEntity\n | IPageInfoForOperation\n | IPageInfoForListing;\n\nexport const isIPageNotFoundInfo = (\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n pageInfo: any | undefined,\n): pageInfo is IPageNotFoundInfo => {\n return (\n pageInfo != null &&\n pageInfo instanceof Object &&\n pageInfo.isNotFound === true &&\n 'isForbidden' in pageInfo\n );\n};\n\nexport const isIPageInfo = (\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n pageInfo: any | undefined,\n): pageInfo is IPageInfo => {\n return (\n pageInfo != null && pageInfo instanceof Object && 'isEmpty' in pageInfo\n );\n};\n\nexport const isIPageInfoForEmpty = (\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n pageInfo: any | undefined,\n): pageInfo is IPageInfoForEmpty => {\n return isIPageInfo(pageInfo) && pageInfo.isEmpty === true;\n};\n\nexport const isIPageInfoForEntity = (\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n pageInfo: any | undefined,\n): pageInfo is IPageInfoForEntity => {\n return isIPageInfo(pageInfo) && pageInfo.isEmpty === false;\n};\n\nexport type IPageInfoBasicForEmpty = Omit<\n IPageInfoForEmpty,\n 'bookmarkCount' | 'isDeletable' | 'isAbleToDeleteCompletely' | 'isBookmarked'\n>;\n\nexport type IPageInfoBasicForEntity = Omit<\n IPageInfoForEntity,\n 'bookmarkCount' | 'isDeletable' | 'isAbleToDeleteCompletely'\n>;\n\nexport type IPageInfoBasic = IPageInfoBasicForEmpty | IPageInfoBasicForEntity;\n\nexport const isIPageInfoForOperation = (\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n pageInfo: any | undefined,\n): pageInfo is IPageInfoForOperation => {\n return (\n isIPageInfoForEntity(pageInfo) &&\n ('isBookmarked' in pageInfo ||\n 'isLiked' in pageInfo ||\n 'subscriptionStatus' in pageInfo)\n );\n};\n\nexport const isIPageInfoForListing = (\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n pageInfo: any | undefined,\n): pageInfo is IPageInfoForListing => {\n return isIPageInfoForEntity(pageInfo) && 'revisionShortBody' in pageInfo;\n};\n\nexport type IDataWithMeta<D = unknown, M = unknown> = {\n data: D;\n meta?: M;\n};\nexport type IDataWithRequiredMeta<D = unknown, M = unknown> = IDataWithMeta<\n D,\n M\n> & { meta: M };\n\nexport type IPageWithMeta<M = IPageInfoExt> = IDataWithMeta<IPageHasId, M>;\n\nexport type IPageToDeleteWithMeta<T = IPageInfoForEntity | unknown> =\n IDataWithMeta<\n HasObjectId & (IPage | { path: string; revision: string | null }),\n T\n >;\nexport type IPageToRenameWithMeta<T = IPageInfoForEntity | unknown> =\n IPageToDeleteWithMeta<T>;\n"],"names":["GroupType","PageGrant","PageStatus","isIPageNotFoundInfo","pageInfo","isIPageInfo","isIPageInfoForEmpty","isIPageInfoForEntity","isIPageInfoForOperation","isIPageInfoForListing"],"mappings":"AAWO,MAAMA,IAAY;AAAA,EACvB,WAAW;AAAA,EACX,mBAAmB;AACrB,GAqDaC,IAAY;AAAA,EACvB,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,iBAAiB;AAAA;AAAA,EACjB,aAAa;AAAA,EACb,kBAAkB;AACpB,GAIaC,IAAa;AAAA,EACxB,kBAAkB;AAAA,EAClB,gBAAgB;AAClB,GAyDaC,IAAsB,CAEjCC,MAGEA,KAAY,QACZA,aAAoB,UACpBA,EAAS,eAAe,MACxB,iBAAiBA,GAIRC,IAAc,CAEzBD,MAGEA,KAAY,QAAQA,aAAoB,UAAU,aAAaA,GAItDE,IAAsB,CAEjCF,MAEOC,EAAYD,CAAQ,KAAKA,EAAS,YAAY,IAG1CG,IAAuB,CAElCH,MAEOC,EAAYD,CAAQ,KAAKA,EAAS,YAAY,IAe1CI,IAA0B,CAErCJ,MAGEG,EAAqBH,CAAQ,MAC5B,kBAAkBA,KACjB,aAAaA,KACb,wBAAwBA,IAIjBK,IAAwB,CAEnCL,MAEOG,EAAqBH,CAAQ,KAAK,uBAAuBA;"}
1
+ {"version":3,"file":"page.js","sources":["../../src/interfaces/page.ts"],"sourcesContent":["import type { Ref } from './common.js';\nimport type { HasObjectId } from './has-object-id.js';\nimport type {\n HasRevisionShortbody,\n IRevision,\n IRevisionHasId,\n} from './revision.js';\nimport type { SubscriptionStatusType } from './subscription.js';\nimport type { ITag } from './tag.js';\nimport type { IUser, IUserGroup, IUserGroupHasId, IUserHasId } from './user.js';\n\nexport const GroupType = {\n userGroup: 'UserGroup',\n externalUserGroup: 'ExternalUserGroup',\n} as const;\nexport type GroupType = (typeof GroupType)[keyof typeof GroupType];\n\nexport type IGrantedGroup = {\n type: GroupType;\n item: Ref<IUserGroup>;\n};\n\nexport type IPage = {\n path: string;\n status: string;\n revision?: Ref<IRevision>;\n tags: Ref<ITag>[];\n creator?: Ref<IUser>;\n createdAt: Date;\n updatedAt: Date;\n seenUsers: Ref<IUser>[];\n parent: Ref<IPage> | null;\n descendantCount: number;\n isEmpty: boolean;\n grant: PageGrant;\n grantedUsers: Ref<IUser>[];\n grantedGroups: IGrantedGroup[];\n lastUpdateUser?: Ref<IUser>;\n liker: Ref<IUser>[];\n commentCount: number;\n slackChannels: string;\n deleteUser: Ref<IUser>;\n deletedAt: Date;\n latestRevision?: Ref<IRevision>;\n latestRevisionBodyLength?: number;\n expandContentWidth?: boolean;\n wip?: boolean;\n ttlTimestamp?: Date;\n};\n\nexport type IPagePopulatedToShowRevision = Omit<\n IPageHasId,\n | 'lastUpdateUser'\n | 'creator'\n | 'deleteUser'\n | 'grantedGroups'\n | 'revision'\n | 'author'\n> & {\n lastUpdateUser?: IUserHasId;\n creator?: IUserHasId;\n deleteUser: IUserHasId;\n grantedGroups: { type: GroupType; item: IUserGroupHasId }[];\n revision?: IRevisionHasId;\n author: IUserHasId;\n};\n\nexport const PageGrant = {\n GRANT_PUBLIC: 1,\n GRANT_RESTRICTED: 2,\n GRANT_SPECIFIED: 3, // DEPRECATED\n GRANT_OWNER: 4,\n GRANT_USER_GROUP: 5,\n} as const;\ntype UnionPageGrantKeys = keyof typeof PageGrant;\nexport type PageGrant = (typeof PageGrant)[UnionPageGrantKeys];\n\nexport const PageStatus = {\n STATUS_PUBLISHED: 'published',\n STATUS_DELETED: 'deleted',\n} as const;\nexport type PageStatus = (typeof PageStatus)[keyof typeof PageStatus];\n\nexport type IPageHasId = IPage & HasObjectId;\n\n// Special type to represent page is an empty page or not found or forbidden status\nexport type IPageNotFoundInfo = {\n isNotFound: true;\n isForbidden: boolean;\n};\n\nexport type IPageInfo = {\n isNotFound: boolean;\n isV5Compatible: boolean;\n isEmpty: boolean;\n isMovable: boolean;\n isDeletable: boolean;\n isAbleToDeleteCompletely: boolean;\n isRevertible: boolean;\n bookmarkCount: number;\n};\n\nexport type IPageInfoForEmpty = Omit<IPageInfo, 'isNotFound' | 'isEmpty'> & {\n emptyPageId: string;\n isNotFound: false;\n isEmpty: true;\n isBookmarked?: boolean;\n};\n\nexport type IPageInfoForEntity = Omit<IPageInfo, 'isNotFound' | 'isEmpty'> & {\n isNotFound: false;\n isEmpty: false;\n sumOfLikers: number;\n likerIds: string[];\n sumOfSeenUsers: number;\n seenUserIds: string[];\n contentAge: number;\n descendantCount: number;\n commentCount: number;\n latestRevisionId: Ref<IRevision>;\n};\n\nexport type IPageInfoForOperation = IPageInfoForEntity & {\n isBookmarked?: boolean;\n isLiked?: boolean;\n subscriptionStatus?: SubscriptionStatusType;\n};\n\nexport type IPageInfoForListing = IPageInfoForEntity & HasRevisionShortbody;\n\nexport type IPageInfoExt =\n | IPageInfo\n | IPageInfoForEmpty\n | IPageInfoForEntity\n | IPageInfoForOperation\n | IPageInfoForListing;\n\nexport const isIPageNotFoundInfo = (\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n pageInfo: any | undefined,\n): pageInfo is IPageNotFoundInfo => {\n return (\n pageInfo != null &&\n pageInfo instanceof Object &&\n pageInfo.isNotFound === true &&\n 'isForbidden' in pageInfo\n );\n};\n\nexport const isIPageInfo = (\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n pageInfo: any | undefined,\n): pageInfo is IPageInfo => {\n return (\n pageInfo != null && pageInfo instanceof Object && 'isEmpty' in pageInfo\n );\n};\n\nexport const isIPageInfoForEmpty = (\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n pageInfo: any | undefined,\n): pageInfo is IPageInfoForEmpty => {\n return isIPageInfo(pageInfo) && pageInfo.isEmpty === true;\n};\n\nexport const isIPageInfoForEntity = (\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n pageInfo: any | undefined,\n): pageInfo is IPageInfoForEntity => {\n return isIPageInfo(pageInfo) && pageInfo.isEmpty === false;\n};\n\nexport type IPageInfoBasicForEmpty = Omit<\n IPageInfoForEmpty,\n 'bookmarkCount' | 'isDeletable' | 'isAbleToDeleteCompletely' | 'isBookmarked'\n>;\n\nexport type IPageInfoBasicForEntity = Omit<\n IPageInfoForEntity,\n 'bookmarkCount' | 'isDeletable' | 'isAbleToDeleteCompletely'\n>;\n\nexport type IPageInfoBasic = IPageInfoBasicForEmpty | IPageInfoBasicForEntity;\n\nexport const isIPageInfoForOperation = (\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n pageInfo: any | undefined,\n): pageInfo is IPageInfoForOperation => {\n return (\n isIPageInfoForEntity(pageInfo) &&\n ('isBookmarked' in pageInfo ||\n 'isLiked' in pageInfo ||\n 'subscriptionStatus' in pageInfo)\n );\n};\n\nexport const isIPageInfoForListing = (\n // biome-ignore lint/suspicious/noExplicitAny: ignore\n pageInfo: any | undefined,\n): pageInfo is IPageInfoForListing => {\n return isIPageInfoForEntity(pageInfo) && 'revisionShortBody' in pageInfo;\n};\n\nexport type IDataWithMeta<D = unknown, M = unknown> = {\n data: D;\n meta?: M;\n};\nexport type IDataWithRequiredMeta<D = unknown, M = unknown> = IDataWithMeta<\n D,\n M\n> & { meta: M };\n\nexport type IPageWithMeta<M = IPageInfoExt> = IDataWithMeta<IPageHasId, M>;\n\nexport type IPageToDeleteWithMeta<T = IPageInfoForEntity | unknown> =\n IDataWithMeta<\n HasObjectId & (IPage | { path: string; revision: string | null }),\n T\n >;\nexport type IPageToRenameWithMeta<T = IPageInfoForEntity | unknown> =\n IPageToDeleteWithMeta<T>;\n"],"names":["GroupType","PageGrant","PageStatus","isIPageNotFoundInfo","pageInfo","isIPageInfo","isIPageInfoForEmpty","isIPageInfoForEntity","isIPageInfoForOperation","isIPageInfoForListing"],"mappings":"AAWO,MAAMA,IAAY;AAAA,EACvB,WAAW;AAAA,EACX,mBAAmB;AACrB,GAqDaC,IAAY;AAAA,EACvB,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,iBAAiB;AAAA;AAAA,EACjB,aAAa;AAAA,EACb,kBAAkB;AACpB,GAIaC,IAAa;AAAA,EACxB,kBAAkB;AAAA,EAClB,gBAAgB;AAClB,GAyDaC,IAAsB,CAEjCC,MAGEA,KAAY,QACZA,aAAoB,UACpBA,EAAS,eAAe,MACxB,iBAAiBA,GAIRC,IAAc,CAEzBD,MAGEA,KAAY,QAAQA,aAAoB,UAAU,aAAaA,GAItDE,IAAsB,CAEjCF,MAEOC,EAAYD,CAAQ,KAAKA,EAAS,YAAY,IAG1CG,IAAuB,CAElCH,MAEOC,EAAYD,CAAQ,KAAKA,EAAS,YAAY,IAe1CI,IAA0B,CAErCJ,MAGEG,EAAqBH,CAAQ,MAC5B,kBAAkBA,KACjB,aAAaA,KACb,wBAAwBA,IAIjBK,IAAwB,CAEnCL,MAEOG,EAAqBH,CAAQ,KAAK,uBAAuBA;"}
@@ -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;"}
@@ -1 +1 @@
1
- {"version":3,"file":"revision.cjs","sources":["../../src/interfaces/revision.ts"],"sourcesContent":["import type { Ref } from './common';\nimport type { HasObjectId } from './has-object-id';\nimport type { IPage } from './page';\nimport type { IUser } from './user';\n\nexport const Origin = {\n View: 'view',\n Editor: 'editor',\n} as const;\n\nexport type Origin = (typeof Origin)[keyof typeof Origin];\n\nexport const allOrigin = Object.values(Origin);\n\nexport type IRevision = {\n pageId: Ref<IPage>;\n body: string;\n author: Ref<IUser>;\n format: string;\n hasDiffToPrev?: boolean;\n origin?: Origin;\n createdAt: Date;\n updatedAt: Date;\n};\n\nexport type IRevisionHasId = IRevision & HasObjectId;\n\nexport type IRevisionsForPagination = {\n revisions: IRevisionHasId[]; // revisions in one pagination\n totalCounts: number; // total counts\n};\nexport type HasRevisionShortbody = {\n revisionShortBody?: string;\n};\n\nexport type SWRInfinitePageRevisionsResponse = {\n revisions: IRevisionHasId[];\n totalCount: number;\n offset: number;\n};\n"],"names":["Origin","allOrigin"],"mappings":"gFAKO,MAAMA,EAAS,CACpB,KAAM,OACN,OAAQ,QACV,EAIaC,EAAY,OAAO,OAAOD,CAAM"}
1
+ {"version":3,"file":"revision.cjs","sources":["../../src/interfaces/revision.ts"],"sourcesContent":["import type { Ref } from './common.js';\nimport type { HasObjectId } from './has-object-id.js';\nimport type { IPage } from './page.js';\nimport type { IUser } from './user.js';\n\nexport const Origin = {\n View: 'view',\n Editor: 'editor',\n} as const;\n\nexport type Origin = (typeof Origin)[keyof typeof Origin];\n\nexport const allOrigin = Object.values(Origin);\n\nexport type IRevision = {\n pageId: Ref<IPage>;\n body: string;\n author: Ref<IUser>;\n format: string;\n hasDiffToPrev?: boolean;\n origin?: Origin;\n createdAt: Date;\n updatedAt: Date;\n};\n\nexport type IRevisionHasId = IRevision & HasObjectId;\n\nexport type IRevisionsForPagination = {\n revisions: IRevisionHasId[]; // revisions in one pagination\n totalCounts: number; // total counts\n};\nexport type HasRevisionShortbody = {\n revisionShortBody?: string;\n};\n\nexport type SWRInfinitePageRevisionsResponse = {\n revisions: IRevisionHasId[];\n totalCount: number;\n offset: number;\n};\n"],"names":["Origin","allOrigin"],"mappings":"gFAKO,MAAMA,EAAS,CACpB,KAAM,OACN,OAAQ,QACV,EAIaC,EAAY,OAAO,OAAOD,CAAM"}
@@ -1,7 +1,7 @@
1
- import { Ref } from './common';
2
- import { HasObjectId } from './has-object-id';
3
- import { IPage } from './page';
4
- import { IUser } from './user';
1
+ import { Ref } from './common.js';
2
+ import { HasObjectId } from './has-object-id.js';
3
+ import { IPage } from './page.js';
4
+ import { IUser } from './user.js';
5
5
  export declare const Origin: {
6
6
  readonly View: "view";
7
7
  readonly Editor: "editor";
@@ -1 +1 @@
1
- {"version":3,"file":"revision.js","sources":["../../src/interfaces/revision.ts"],"sourcesContent":["import type { Ref } from './common';\nimport type { HasObjectId } from './has-object-id';\nimport type { IPage } from './page';\nimport type { IUser } from './user';\n\nexport const Origin = {\n View: 'view',\n Editor: 'editor',\n} as const;\n\nexport type Origin = (typeof Origin)[keyof typeof Origin];\n\nexport const allOrigin = Object.values(Origin);\n\nexport type IRevision = {\n pageId: Ref<IPage>;\n body: string;\n author: Ref<IUser>;\n format: string;\n hasDiffToPrev?: boolean;\n origin?: Origin;\n createdAt: Date;\n updatedAt: Date;\n};\n\nexport type IRevisionHasId = IRevision & HasObjectId;\n\nexport type IRevisionsForPagination = {\n revisions: IRevisionHasId[]; // revisions in one pagination\n totalCounts: number; // total counts\n};\nexport type HasRevisionShortbody = {\n revisionShortBody?: string;\n};\n\nexport type SWRInfinitePageRevisionsResponse = {\n revisions: IRevisionHasId[];\n totalCount: number;\n offset: number;\n};\n"],"names":["Origin","allOrigin"],"mappings":"AAKO,MAAMA,IAAS;AAAA,EACpB,MAAM;AAAA,EACN,QAAQ;AACV,GAIaC,IAAY,OAAO,OAAOD,CAAM;"}
1
+ {"version":3,"file":"revision.js","sources":["../../src/interfaces/revision.ts"],"sourcesContent":["import type { Ref } from './common.js';\nimport type { HasObjectId } from './has-object-id.js';\nimport type { IPage } from './page.js';\nimport type { IUser } from './user.js';\n\nexport const Origin = {\n View: 'view',\n Editor: 'editor',\n} as const;\n\nexport type Origin = (typeof Origin)[keyof typeof Origin];\n\nexport const allOrigin = Object.values(Origin);\n\nexport type IRevision = {\n pageId: Ref<IPage>;\n body: string;\n author: Ref<IUser>;\n format: string;\n hasDiffToPrev?: boolean;\n origin?: Origin;\n createdAt: Date;\n updatedAt: Date;\n};\n\nexport type IRevisionHasId = IRevision & HasObjectId;\n\nexport type IRevisionsForPagination = {\n revisions: IRevisionHasId[]; // revisions in one pagination\n totalCounts: number; // total counts\n};\nexport type HasRevisionShortbody = {\n revisionShortBody?: string;\n};\n\nexport type SWRInfinitePageRevisionsResponse = {\n revisions: IRevisionHasId[];\n totalCount: number;\n offset: number;\n};\n"],"names":["Origin","allOrigin"],"mappings":"AAKO,MAAMA,IAAS;AAAA,EACpB,MAAM;AAAA,EACN,QAAQ;AACV,GAIaC,IAAY,OAAO,OAAOD,CAAM;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l={admin:{top:{},app:{},security:{},markdown:{},customize:{},import_data:{},export_data:{},data_transfer:{},external_notification:{},slack_integration:{},legacy_slack_integration:{},user_management:{},user_group_management:{},audit_log:{},plugin:{},ai_integration:{},full_text_search:{}}},E={user_settings:{info:{},external_account:{},password:{},api:{api_token:{},access_token:{}},in_app_notification:{},other:{}},features:{ai_assistant:{},page:{},share_link:{},bookmark:{},attachment:{},page_bulk_export:{},in_app_notification:{},user:{},user_group:{}}},g={...l,...E},c={READ:"read",WRITE:"write"},_="*",S=Object.values(c).reduce((t,n)=>(t[n]=g,t),{}),f=()=>{const t={},n=(p,u=[],o)=>{for(const[s,e]of Object.entries(p)){const a=s.toUpperCase(),i=[...u,s],r=i.join(":");e!=null&&(typeof e=="object"&&Object.keys(e).length===0?o[a]=`${r}`:typeof e=="object"&&(o[a]={ALL:`${r}:${_}`},n(e,i,o[a])))}};return n(S,[],t),t},d=f();exports.ACTION=c;exports.ALL_SIGN=_;exports.SCOPE=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l={admin:{top:{},app:{},ai:{},security:{},markdown:{},customize:{},import_data:{},export_data:{},data_transfer:{},external_notification:{},slack_integration:{},legacy_slack_integration:{},user_management:{},user_group_management:{},audit_log:{},plugin:{},full_text_search:{}}},E={user_settings:{info:{},external_account:{},password:{},api:{api_token:{},access_token:{}},in_app_notification:{},other:{}},features:{ai:{},page:{},share_link:{},bookmark:{},attachment:{},page_bulk_export:{},in_app_notification:{},user:{},user_group:{}}},S={...l,...E},i={READ:"read",WRITE:"write"},_="*",f=Object.values(i).reduce((t,n)=>(t[n]=S,t),{}),g=()=>{const t={},n=(p,u=[],o)=>{for(const[s,e]of Object.entries(p)){const a=s.toUpperCase(),r=[...u,s],c=r.join(":");e!=null&&(typeof e=="object"&&Object.keys(e).length===0?o[a]=`${c}`:typeof e=="object"&&(o[a]={ALL:`${c}:${_}`},n(e,r,o[a])))}};return n(f,[],t),t},d=g();exports.ACTION=i;exports.ALL_SIGN=_;exports.SCOPE=d;
2
2
  //# sourceMappingURL=scope.cjs.map
@@ -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 in_app_notification: {},\n user: {},\n user_group: {},\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:in_app_notification'\n | 'read:features:user'\n | 'read:features:user_group'\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:in_app_notification'\n | 'write:features:user'\n | 'write:features:user_group'\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,CAAC,EACnB,oBAAqB,CAAC,EACtB,KAAM,CAAC,EACP,WAAY,CAAA,CAAC,CAEjB,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,EAqIME,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 ai: {},\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 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: {},\n page: {},\n share_link: {},\n bookmark: {},\n attachment: {},\n page_bulk_export: {},\n in_app_notification: {},\n user: {},\n user_group: {},\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:ai'\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: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'\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:in_app_notification'\n | 'read:features:user'\n | 'read:features:user_group'\n | 'read:features:*';\n\n// Write scopes - Admin\ntype WriteAdminScope =\n | 'write:admin:top'\n | 'write:admin:app'\n | 'write:admin:ai'\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: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'\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:in_app_notification'\n | 'write:features:user'\n | 'write:features:user_group'\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,GAAI,CAAA,EACJ,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,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,GAAI,CAAA,EACJ,KAAM,CAAA,EACN,WAAY,CAAA,EACZ,SAAU,CAAA,EACV,WAAY,CAAA,EACZ,iBAAkB,CAAA,EAClB,oBAAqB,CAAA,EACrB,KAAM,CAAA,EACN,WAAY,CAAA,CAAC,CAEjB,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,EAqIME,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"}
@@ -11,7 +11,7 @@ declare const SCOPE_SEED: {
11
11
  readonly other: {};
12
12
  };
13
13
  readonly features: {
14
- readonly ai_assistant: {};
14
+ readonly ai: {};
15
15
  readonly page: {};
16
16
  readonly share_link: {};
17
17
  readonly bookmark: {};
@@ -24,6 +24,7 @@ declare const SCOPE_SEED: {
24
24
  readonly admin: {
25
25
  readonly top: {};
26
26
  readonly app: {};
27
+ readonly ai: {};
27
28
  readonly security: {};
28
29
  readonly markdown: {};
29
30
  readonly customize: {};
@@ -37,7 +38,6 @@ declare const SCOPE_SEED: {
37
38
  readonly user_group_management: {};
38
39
  readonly audit_log: {};
39
40
  readonly plugin: {};
40
- readonly ai_integration: {};
41
41
  readonly full_text_search: {};
42
42
  };
43
43
  };
@@ -60,7 +60,7 @@ declare const SCOPE_SEED_WITH_ACTION: Record<ACTION_TYPE, {
60
60
  readonly other: {};
61
61
  };
62
62
  readonly features: {
63
- readonly ai_assistant: {};
63
+ readonly ai: {};
64
64
  readonly page: {};
65
65
  readonly share_link: {};
66
66
  readonly bookmark: {};
@@ -73,6 +73,7 @@ declare const SCOPE_SEED_WITH_ACTION: Record<ACTION_TYPE, {
73
73
  readonly admin: {
74
74
  readonly top: {};
75
75
  readonly app: {};
76
+ readonly ai: {};
76
77
  readonly security: {};
77
78
  readonly markdown: {};
78
79
  readonly customize: {};
@@ -86,16 +87,15 @@ declare const SCOPE_SEED_WITH_ACTION: Record<ACTION_TYPE, {
86
87
  readonly user_group_management: {};
87
88
  readonly audit_log: {};
88
89
  readonly plugin: {};
89
- readonly ai_integration: {};
90
90
  readonly full_text_search: {};
91
91
  };
92
92
  }>;
93
- type ReadAdminScope = 'read:admin:top' | 'read:admin:app' | 'read:admin:security' | 'read:admin:markdown' | 'read:admin:customize' | 'read:admin:import_data' | 'read:admin:export_data' | 'read:admin:data_transfer' | 'read:admin:external_notification' | 'read:admin:slack_integration' | 'read:admin:legacy_slack_integration' | 'read:admin:user_management' | 'read:admin:user_group_management' | 'read:admin:audit_log' | 'read:admin:plugin' | 'read:admin:ai_integration' | 'read:admin:full_text_search' | 'read:admin:*';
93
+ type ReadAdminScope = 'read:admin:top' | 'read:admin:app' | 'read:admin:ai' | 'read:admin:security' | 'read:admin:markdown' | 'read:admin:customize' | 'read:admin:import_data' | 'read:admin:export_data' | 'read:admin:data_transfer' | 'read:admin:external_notification' | 'read:admin:slack_integration' | 'read:admin:legacy_slack_integration' | 'read:admin:user_management' | 'read:admin:user_group_management' | 'read:admin:audit_log' | 'read:admin:plugin' | 'read:admin:full_text_search' | 'read:admin:*';
94
94
  type ReadUserSettingsScope = 'read:user_settings:info' | 'read:user_settings:external_account' | 'read:user_settings:password' | 'read:user_settings:api:api_token' | 'read:user_settings:api:access_token' | 'read:user_settings:api:*' | 'read:user_settings:in_app_notification' | 'read:user_settings:other' | 'read:user_settings:*';
95
- type ReadFeaturesScope = 'read:features:ai_assistant' | 'read:features:page' | 'read:features:share_link' | 'read:features:bookmark' | 'read:features:attachment' | 'read:features:page_bulk_export' | 'read:features:in_app_notification' | 'read:features:user' | 'read:features:user_group' | 'read:features:*';
96
- type WriteAdminScope = 'write:admin:top' | 'write:admin:app' | 'write:admin:security' | 'write:admin:markdown' | 'write:admin:customize' | 'write:admin:import_data' | 'write:admin:export_data' | 'write:admin:data_transfer' | 'write:admin:external_notification' | 'write:admin:slack_integration' | 'write:admin:legacy_slack_integration' | 'write:admin:user_management' | 'write:admin:user_group_management' | 'write:admin:audit_log' | 'write:admin:plugin' | 'write:admin:ai_integration' | 'write:admin:full_text_search' | 'write:admin:*';
95
+ type ReadFeaturesScope = 'read:features:ai' | 'read:features:page' | 'read:features:share_link' | 'read:features:bookmark' | 'read:features:attachment' | 'read:features:page_bulk_export' | 'read:features:in_app_notification' | 'read:features:user' | 'read:features:user_group' | 'read:features:*';
96
+ type WriteAdminScope = 'write:admin:top' | 'write:admin:app' | 'write:admin:ai' | 'write:admin:security' | 'write:admin:markdown' | 'write:admin:customize' | 'write:admin:import_data' | 'write:admin:export_data' | 'write:admin:data_transfer' | 'write:admin:external_notification' | 'write:admin:slack_integration' | 'write:admin:legacy_slack_integration' | 'write:admin:user_management' | 'write:admin:user_group_management' | 'write:admin:audit_log' | 'write:admin:plugin' | 'write:admin:full_text_search' | 'write:admin:*';
97
97
  type WriteUserSettingsScope = 'write:user_settings:info' | 'write:user_settings:external_account' | 'write:user_settings:password' | 'write:user_settings:api:api_token' | 'write:user_settings:api:access_token' | 'write:user_settings:api:*' | 'write:user_settings:in_app_notification' | 'write:user_settings:other' | 'write:user_settings:*';
98
- type WriteFeaturesScope = 'write:features:ai_assistant' | 'write:features:page' | 'write:features:share_link' | 'write:features:bookmark' | 'write:features:attachment' | 'write:features:page_bulk_export' | 'write:features:in_app_notification' | 'write:features:user' | 'write:features:user_group' | 'write:features:*';
98
+ type WriteFeaturesScope = 'write:features:ai' | 'write:features:page' | 'write:features:share_link' | 'write:features:bookmark' | 'write:features:attachment' | 'write:features:page_bulk_export' | 'write:features:in_app_notification' | 'write:features:user' | 'write:features:user_group' | 'write:features:*';
99
99
  export type Scope = ReadAdminScope | ReadUserSettingsScope | ReadFeaturesScope | WriteAdminScope | WriteUserSettingsScope | WriteFeaturesScope | 'read:*' | 'write:*';
100
100
  type ScopeConstantLeaf = Scope;
101
101
  type ScopeConstantNode<T> = {
@@ -2,6 +2,7 @@ const p = {
2
2
  admin: {
3
3
  top: {},
4
4
  app: {},
5
+ ai: {},
5
6
  security: {},
6
7
  markdown: {},
7
8
  customize: {},
@@ -15,7 +16,6 @@ const p = {
15
16
  user_group_management: {},
16
17
  audit_log: {},
17
18
  plugin: {},
18
- ai_integration: {},
19
19
  full_text_search: {}
20
20
  }
21
21
  }, u = {
@@ -31,7 +31,7 @@ const p = {
31
31
  other: {}
32
32
  },
33
33
  features: {
34
- ai_assistant: {},
34
+ ai: {},
35
35
  page: {},
36
36
  share_link: {},
37
37
  bookmark: {},
@@ -51,12 +51,12 @@ const p = {
51
51
  (t, n) => (t[n] = l, t),
52
52
  {}
53
53
  ), S = () => {
54
- const t = {}, n = (c, _ = [], o) => {
55
- for (const [s, e] of Object.entries(c)) {
56
- const a = s.toUpperCase(), i = [..._, s], r = i.join(":");
54
+ const t = {}, n = (i, _ = [], o) => {
55
+ for (const [s, e] of Object.entries(i)) {
56
+ const a = s.toUpperCase(), c = [..._, s], r = c.join(":");
57
57
  e != null && (typeof e == "object" && Object.keys(e).length === 0 ? o[a] = `${r}` : typeof e == "object" && (o[a] = {
58
58
  ALL: `${r}:${f}`
59
- }, n(e, i, o[a])));
59
+ }, n(e, c, o[a])));
60
60
  }
61
61
  };
62
62
  return n(g, [], t), t;