Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

enonic-types

Package Overview
Dependencies
Maintainers
1
Versions
179
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

enonic-types - npm Package Compare versions

Comparing version 0.4.5 to 0.4.6

159

content.d.ts

@@ -11,4 +11,4 @@ declare module "*/lib/xp/content" {

*/
query<Data extends object = object, XData extends object = object, AggregationKeys extends string = never>(params: QueryContentParams<AggregationKeys>): QueryResponse<Data, XData, QueryResponseMetaDataScore, AggregationKeys>;
query<Data extends object = object, XData extends object = object, AggregationKeys extends string = never>(params: QueryContentParamsWithSort<AggregationKeys>): QueryResponse<Data, XData, QueryResponseMetaDataSort, AggregationKeys>;
query<Data extends object = object, XData extends object = object>(params: QueryContentParams): QueryResponse<Data, XData, QueryResponseMetaDataScore>;
query<Data extends object = object, XData extends object = object>(params: QueryContentParamsWithSort): QueryResponse<Data, XData, QueryResponseMetaDataSort>;
/**

@@ -234,11 +234,130 @@ * This function creates a content.

}
interface QueryContentParams<AggregationKeys extends string = never> {
interface QueryContentParams {
start?: number;
count: number;
query?: string;
query?: string | QueryDSL;
filters?: BasicFilters | BooleanFilter;
aggregations?: Record<AggregationKeys, Aggregation>;
aggregations?: Record<string, Aggregation>;
contentTypes?: Array<string>;
highlight?: Highlight;
}
/**
* @since 7.9.0
*/
type QueryDSL = TermQuery | InQuery | LikeQuery | RangeQuery | PathMatchQuery | MatchAllQuery | FulltextQuery | NgramQuery | StemmedQuery | BooleanQuery;
type ValueTypeTimeValue = string | import("/lib/xp/value").LocalTime;
type ValueTypeDateTimeValue = string | number | import("/lib/xp/value").Instant | import("/lib/xp/value").LocalDate | import("/lib/xp/value").LocalDateTime;
interface TermQuery {
term: {
type?: never;
field: string;
value: unknown;
boost?: number;
} | {
type: "time";
field: string;
value: ValueTypeTimeValue;
boost?: number;
} | {
type: "dateTime";
field: string;
value: ValueTypeDateTimeValue;
boost?: number;
};
}
interface InQuery {
in: {
type?: never;
field: string;
value: Array<unknown>;
boost?: number;
} | {
type: "time";
field: string;
value: Array<ValueTypeTimeValue>;
boost?: number;
} | {
type: "dateTime";
field: string;
value: Array<ValueTypeDateTimeValue>;
boost?: number;
};
}
interface LikeQuery {
like: {
field: string;
value: string;
type?: "time" | "dateTime";
boost?: number;
};
}
interface RangeQuery {
range: {
type?: never;
field: string;
lt?: unknown;
lte?: unknown;
gt?: unknown;
gte?: unknown;
boost?: number;
} | {
type: "time";
field: string;
lt?: ValueTypeTimeValue;
lte?: ValueTypeTimeValue;
gt?: ValueTypeTimeValue;
gte?: ValueTypeTimeValue;
boost?: number;
} | {
type: "dateTime";
field: string;
lt?: ValueTypeDateTimeValue;
lte?: ValueTypeDateTimeValue;
gt?: ValueTypeDateTimeValue;
gte?: ValueTypeDateTimeValue;
boost?: number;
};
}
interface PathMatchQuery {
pathMatch: {
field: string;
path: string;
minimumMatch?: number;
boost?: number;
};
}
interface MatchAllQuery {
matchAll: {
boost?: number;
};
}
interface FulltextQuery {
fulltext: {
fields: Array<string>;
query: string;
operator?: "AND" | "OR";
};
}
interface NgramQuery {
ngram: {
fields: Array<string>;
query: string;
operator?: "AND" | "OR";
};
}
interface StemmedQuery {
stemmed: {
fields?: string;
field?: string;
query: string;
language: string;
};
}
interface BooleanQuery {
boolean: {
must?: QueryDSL | Array<QueryDSL>;
mustNot?: QueryDSL | Array<QueryDSL>;
should?: QueryDSL | Array<QueryDSL>;
};
}
interface ExistsFilter {

@@ -273,10 +392,29 @@ exists: {

}
type QueryContentParamsWithSort<AggregationKeys extends string = never> = QueryContentParams<AggregationKeys> & {
sort: string;
type Direction = "ASC" | "DESC";
type QueryContentParamsWithSort = QueryContentParams & {
sort: string | SortDSL;
};
interface QueryResponse<Data extends object, XData extends object, QueryMetaData extends QueryResponseMetaDataSort | QueryResponseMetaDataScore | {} = {}, AggregationKeys extends string = never> {
/**
* @since 7.9.0
*/
type SortDSL = FieldSort | GeoDistanceSort;
interface FieldSort {
field: string;
direction?: Direction;
}
type DistanceUnit = "m" | "meters" | "in" | "inch" | "yd" | "yards" | "ft" | "feet" | "km" | "kilometers" | "NM" | "nmi" | "nauticalmiles" | "mm" | "millimeters" | "cm" | "centimeters" | "mi" | "miles";
interface GeoDistanceSort {
field: string;
direction?: Direction;
location: {
lat: number;
lon: number;
};
unit?: DistanceUnit;
}
interface QueryResponse<Data extends object, XData extends object, QueryMetaData extends QueryResponseMetaDataSort | QueryResponseMetaDataScore | {} = {}> {
readonly count: number;
readonly hits: ReadonlyArray<Content<Data, XData> & QueryMetaData>;
readonly total: number;
readonly aggregations: AggregationsResponse<AggregationKeys>;
readonly aggregations: Record<string, AggregationsResponseEntry>;
readonly highlight: HighlightResponse;

@@ -417,5 +555,2 @@ }

}
type AggregationsResponse<AggregationKeys extends string> = {
[K in AggregationKeys]: AggregationsResponseEntry;
};
interface Highlight {

@@ -422,0 +557,0 @@ encoder?: "default" | "html";

@@ -11,2 +11,3 @@ declare module "*/lib/cristin" {

type ListOfResultContributors = import("./generated").ListOfResultContributors;
type CristinResultContributorAffiliations = NonNullable<Unarray<CristinResultContributor["affiliations"]>>;
type ListOfInstitutions = import("./generated").ListOfInstitutions;

@@ -262,2 +263,3 @@ type Institution = import("./generated").Institution;

connection: RepoConnection;
repoId: string;
data?: NodeData;

@@ -264,0 +266,0 @@ }

14

node.d.ts

@@ -34,9 +34,9 @@ declare module "*/lib/xp/node" {

}
interface NodeQueryResponse<AggregationKeys extends string = never> {
interface NodeQueryResponse {
total: number;
count: number;
hits: Array<NodeQueryHit>;
aggregations: import("/lib/xp/content").AggregationsResponse<AggregationKeys>;
aggregations: Record<string, import("/lib/xp/content").AggregationsResponseEntry>;
}
type MultiRepoNodeQueryResponse<AggregationKeys extends string = never> = Omit<NodeQueryResponse<AggregationKeys>, "hits"> & {
type MultiRepoNodeQueryResponse = Omit<NodeQueryResponse, "hits"> & {
hits: Array<MultiRepoNodeQueryHit>;

@@ -54,3 +54,3 @@ };

}
interface NodeQueryParams<AggregationKeys extends string = never> {
interface NodeQueryParams {
/**

@@ -79,3 +79,3 @@ * Start index (used for paging).

*/
aggregations?: Record<AggregationKeys, import("/lib/xp/content").Aggregation>;
aggregations?: Record<string, import("/lib/xp/content").Aggregation>;
/**

@@ -218,3 +218,3 @@ * Highlighting config

interface MultiRepoConnection {
query<AggregationKeys extends string>(params: NodeQueryParams<AggregationKeys>): MultiRepoNodeQueryResponse<AggregationKeys>;
query(params: NodeQueryParams): MultiRepoNodeQueryResponse;
}

@@ -280,3 +280,3 @@ interface RepoConnection {

*/
query<AggregationKeys extends string = never>(params: NodeQueryParams<AggregationKeys>): NodeQueryResponse<AggregationKeys>;
query(params: NodeQueryParams): NodeQueryResponse;
/**

@@ -283,0 +283,0 @@ * Refresh the index for the current repoConnection

{
"name": "enonic-types",
"sideEffects": false,
"version": "0.4.5",
"version": "0.4.6",
"description": "TypeScript types for Enonic XP",

@@ -29,6 +29,6 @@ "typings": "index.d.ts",

"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.18.0",
"@typescript-eslint/parser": "^5.18.0",
"@typescript-eslint/eslint-plugin": "^5.21.0",
"@typescript-eslint/parser": "^5.21.0",
"copyfiles": "^2.4.1",
"eslint": "^8.12.0",
"eslint": "^8.14.0",
"eslint-config-prettier": "^8.5.0",

@@ -35,0 +35,0 @@ "eslint-plugin-prettier": "^4.0.0",

@@ -185,3 +185,3 @@ declare module "*/lib/xp/portal" {

application?: string;
type?: "server" | "absolute";
type?: "server" | "absolute" | "websocket";
params?: Params;

@@ -188,0 +188,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc