@growi/core 1.6.0-next.384d2f3aefb435b19df52b06091ff37731eb6e2d → 1.6.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.
|
@@ -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\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\
|
|
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 // Future extensions can be added here\n // includePageCount?: boolean;\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\nexport interface IGrowiAdditionalInfo\n extends IAdditionalInstalledAtInfo,\n IAdditionalUserCountInfo,\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\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 : 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"}
|
|
@@ -5,19 +5,35 @@ export declare const GrowiWikiType: {
|
|
|
5
5
|
readonly closed: "closed";
|
|
6
6
|
};
|
|
7
7
|
type GrowiWikiType = (typeof GrowiWikiType)[keyof typeof GrowiWikiType];
|
|
8
|
+
export interface GrowiInfoOptions {
|
|
9
|
+
includeAttachmentInfo?: boolean;
|
|
10
|
+
includeInstalledInfo?: boolean;
|
|
11
|
+
includeUserCountInfo?: boolean;
|
|
12
|
+
}
|
|
8
13
|
interface IGrowiOSInfo {
|
|
9
14
|
type?: ReturnType<typeof os.type>;
|
|
10
15
|
platform?: ReturnType<typeof os.platform>;
|
|
11
16
|
arch?: ReturnType<typeof os.arch>;
|
|
12
17
|
totalmem?: ReturnType<typeof os.totalmem>;
|
|
13
18
|
}
|
|
14
|
-
|
|
19
|
+
interface IAdditionalAttachmentInfo {
|
|
20
|
+
attachmentType: string;
|
|
21
|
+
activeExternalAccountTypes: string[];
|
|
22
|
+
}
|
|
23
|
+
interface IAdditionalInstalledAtInfo {
|
|
15
24
|
installedAt: Date;
|
|
16
25
|
installedAtByOldestUser: Date | null;
|
|
26
|
+
}
|
|
27
|
+
interface IAdditionalUserCountInfo {
|
|
17
28
|
currentUsersCount: number;
|
|
18
29
|
currentActiveUsersCount: number;
|
|
19
30
|
}
|
|
20
|
-
export interface
|
|
31
|
+
export interface IGrowiAdditionalInfo extends IAdditionalInstalledAtInfo, IAdditionalUserCountInfo, IAdditionalAttachmentInfo {
|
|
32
|
+
}
|
|
33
|
+
export type IGrowiAdditionalInfoByOptions<T extends GrowiInfoOptions> = (T['includeAttachmentInfo'] extends true ? IAdditionalAttachmentInfo : Record<string, never>) & (T['includeInstalledInfo'] extends true ? IAdditionalInstalledAtInfo : Record<string, never>) & (T['includeUserCountInfo'] extends true ? IAdditionalUserCountInfo : Record<string, never>);
|
|
34
|
+
export type HasAnyOption<T extends GrowiInfoOptions> = T['includeAttachmentInfo'] extends true ? true : T['includeInstalledInfo'] extends true ? true : T['includeUserCountInfo'] extends true ? true : false;
|
|
35
|
+
export type IGrowiAdditionalInfoResult<T extends GrowiInfoOptions> = HasAnyOption<T> extends true ? IGrowiAdditionalInfoByOptions<T> : undefined;
|
|
36
|
+
export interface IGrowiInfo<A extends object | undefined = undefined> {
|
|
21
37
|
serviceInstanceId: string;
|
|
22
38
|
appSiteUrl: string;
|
|
23
39
|
osInfo: IGrowiOSInfo;
|
|
@@ -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\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\
|
|
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 // Future extensions can be added here\n // includePageCount?: boolean;\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\nexport interface IGrowiAdditionalInfo\n extends IAdditionalInstalledAtInfo,\n IAdditionalUserCountInfo,\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\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 : 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;"}
|