enonic-types
Advanced tools
Comparing version 0.3.18 to 0.3.19
@@ -126,2 +126,3 @@ declare module "*/lib/cristin" { | ||
type Result = import("./generated").Result; | ||
type CristinResultCategory = NonNullable<Result["category"]>; | ||
type ListOfInstitutions = import("./generated").ListOfInstitutions; | ||
@@ -143,2 +144,5 @@ type Institution = import("./generated").Institution; | ||
fetchResult(params: GetSingleParams): Result; | ||
fetchResultCategories(params?: { | ||
lang?: string; | ||
}): FetchResponse<Array<CristinResultCategory>>; | ||
fetchInstitutions(params: GetInstitutionsParams): FetchResponse<ListOfInstitutions>; | ||
@@ -237,1 +241,24 @@ fetchInstitution(params: GetSingleParams): Institution; | ||
} | ||
declare module "*/lib/cristin/utils/repos" { | ||
namespace cristinUtilsReposLib { | ||
type RepoConnection = import("/lib/xp/node").RepoConnection; | ||
interface CristinNode<Data> { | ||
_name: string; | ||
data: Data; | ||
topics: Array<string>; | ||
} | ||
interface SaveToRepoParams<NodeData> { | ||
id: string; | ||
connection: RepoConnection; | ||
data?: NodeData; | ||
} | ||
interface CristinUtilReposLibrary { | ||
getOrCreateRepoConnection(repoName: string): RepoConnection; | ||
getNodeByDataId(connection: RepoConnection, ids: string | Array<string>): Array<import("/lib/xp/node").NodeQueryHit>; | ||
getEntriesByName<NodeData>(repoId: string, name: Array<string>): Array<NodeData & import("/lib/xp/node").RepoNode>; | ||
saveToRepo<NodeData>({ data, id, connection }: SaveToRepoParams<NodeData>): NodeData | void; | ||
} | ||
} | ||
const cristinUtilsReposLib: cristinUtilsReposLib.CristinUtilReposLibrary; | ||
export = cristinUtilsReposLib; | ||
} |
@@ -27,17 +27,17 @@ declare module "*/lib/xp/node" { | ||
interface NodeQueryHit { | ||
readonly id: string; | ||
readonly score: number; | ||
id: string; | ||
score: number; | ||
} | ||
interface MultiRepoNodeQueryHit extends NodeQueryHit { | ||
readonly repoId: string; | ||
readonly branch: string; | ||
repoId: string; | ||
branch: string; | ||
} | ||
interface NodeQueryResponse<AggregationKeys extends string = never> { | ||
readonly total: number; | ||
readonly count: number; | ||
readonly hits: ReadonlyArray<NodeQueryHit>; | ||
readonly aggregations: import("/lib/xp/content").AggregationsResponse<AggregationKeys>; | ||
total: number; | ||
count: number; | ||
hits: Array<NodeQueryHit>; | ||
aggregations: import("/lib/xp/content").AggregationsResponse<AggregationKeys>; | ||
} | ||
type MultiRepoNodeQueryResponse<AggregationKeys extends string = never> = Omit<NodeQueryResponse<AggregationKeys>, "hits"> & { | ||
hits: ReadonlyArray<MultiRepoNodeQueryHit>; | ||
hits: Array<MultiRepoNodeQueryHit>; | ||
}; | ||
@@ -114,4 +114,4 @@ interface GetBinaryParams { | ||
path: boolean; | ||
indexValueProcessors: ReadonlyArray<any>; | ||
languages: ReadonlyArray<any>; | ||
indexValueProcessors: Array<any>; | ||
languages: Array<any>; | ||
} | ||
@@ -121,3 +121,3 @@ type IndexConfigTemplates = "none" | "byType" | "fulltext" | "path" | "minimal"; | ||
default: IndexConfigEntry | IndexConfigTemplates; | ||
configs?: ReadonlyArray<{ | ||
configs?: Array<{ | ||
path: string; | ||
@@ -143,3 +143,3 @@ config: IndexConfigEntry | IndexConfigTemplates; | ||
*/ | ||
_permissions?: ReadonlyArray<import("/lib/xp/content").PermissionsParams>; | ||
_permissions?: Array<import("/lib/xp/content").PermissionsParams>; | ||
/** | ||
@@ -206,9 +206,13 @@ * true if the permissions should be inherited from the node parent. Default is false. | ||
interface RepoNode { | ||
readonly _id: string; | ||
readonly _childOrder: string; | ||
readonly _indexConfig: IndexConfig; | ||
readonly _inheritsPermissions: boolean; | ||
readonly _permissions: ReadonlyArray<import("/lib/xp/content").PermissionsParams>; | ||
readonly _state: string; | ||
readonly _nodeType: string; | ||
_id: string; | ||
_name: string; | ||
_path: string; | ||
_childOrder: string; | ||
_indexConfig: IndexConfig; | ||
_inheritsPermissions: boolean; | ||
_permissions: Array<import("/lib/xp/content").PermissionsParams>; | ||
_state: string; | ||
_nodeType: string; | ||
_versionKey: string; | ||
_ts: string; | ||
} | ||
@@ -223,3 +227,3 @@ interface MultiRepoConnection { | ||
commit(params: CommitParams): CommitResponse; | ||
commit(params: MultiCommitParams): ReadonlyArray<CommitResponse>; | ||
commit(params: MultiCommitParams): Array<CommitResponse>; | ||
/** | ||
@@ -233,3 +237,3 @@ * Creating a node. To create a content where the name is not important and there could be multiple instances under the | ||
*/ | ||
delete(keys: string | ReadonlyArray<string>): ReadonlyArray<string>; | ||
delete(keys: string | Array<string>): Array<string>; | ||
/** | ||
@@ -242,3 +246,3 @@ * Resolves the differences for a node between current and given branch. | ||
*/ | ||
exists(keys: string | ReadonlyArray<string>): ReadonlyArray<string>; | ||
exists(keys: string | Array<string>): Array<string>; | ||
/** | ||
@@ -255,7 +259,7 @@ * Fetch the versions of a node. | ||
*/ | ||
get<NodeData>(keys: ReadonlyArray<string | NodeGetParams>): ReadonlyArray<NodeData & RepoNode>; | ||
get<NodeData>(keys: Array<string | NodeGetParams>): Array<NodeData & RepoNode>; | ||
/** | ||
* Fetches specific nodes by path(s) or ID(s). | ||
*/ | ||
get<NodeData>(keys: string | NodeGetParams | ReadonlyArray<string | NodeGetParams>): (NodeData & RepoNode) | ReadonlyArray<NodeData & RepoNode>; | ||
get<NodeData>(keys: string | NodeGetParams | Array<string | NodeGetParams>): (NodeData & RepoNode) | Array<NodeData & RepoNode>; | ||
/** | ||
@@ -340,8 +344,8 @@ * This function fetches commit by id. | ||
interface PushNodeResult { | ||
readonly success: ReadonlyArray<string>; | ||
readonly failed: ReadonlyArray<{ | ||
readonly id: string; | ||
readonly reason: string; | ||
success: Array<string>; | ||
failed: Array<{ | ||
id: string; | ||
reason: string; | ||
}>; | ||
readonly deleted: ReadonlyArray<string>; | ||
deleted: Array<string>; | ||
} | ||
@@ -353,3 +357,3 @@ interface SetChildOrderParams { | ||
interface SetRootPermissionParams { | ||
_permissions: ReadonlyArray<import("/lib/xp/content").PermissionsParams>; | ||
_permissions: Array<import("/lib/xp/content").PermissionsParams>; | ||
_inheritsPermissions: boolean; | ||
@@ -378,6 +382,6 @@ } | ||
interface CommitResponse { | ||
readonly id: string; | ||
readonly message: string; | ||
readonly committer: string; | ||
readonly timestamp: string; | ||
id: string; | ||
message: string; | ||
committer: string; | ||
timestamp: string; | ||
} | ||
@@ -428,12 +432,12 @@ interface NodeGetParams { | ||
interface NodeVersionQueryResult { | ||
readonly total: number; | ||
readonly count: number; | ||
readonly hits: ReadonlyArray<NodeVersionMetadata>; | ||
total: number; | ||
count: number; | ||
hits: Array<NodeVersionMetadata>; | ||
} | ||
interface NodeVersionMetadata { | ||
readonly versionId: string; | ||
readonly nodeId: string; | ||
readonly nodePath: string; | ||
readonly timestamp: string; | ||
readonly commitId: string; | ||
versionId: string; | ||
nodeId: string; | ||
nodePath: string; | ||
timestamp: string; | ||
commitId: string; | ||
} | ||
@@ -456,7 +460,7 @@ interface DiffParams { | ||
interface NodeComparison { | ||
readonly id: string; | ||
readonly status: CompareStatus; | ||
id: string; | ||
status: CompareStatus; | ||
} | ||
interface DiffResponse { | ||
diff: ReadonlyArray<NodeComparison>; | ||
diff: Array<NodeComparison>; | ||
} | ||
@@ -463,0 +467,0 @@ } |
{ | ||
"name": "enonic-types", | ||
"sideEffects": false, | ||
"version": "0.3.18", | ||
"version": "0.3.19", | ||
"description": "TypeScript types for Enonic XP", | ||
@@ -6,0 +6,0 @@ "typings": "index.d.ts", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
266280
7210