Socket
Socket
Sign inDemoInstall

@attraqt/search

Package Overview
Dependencies
317
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.5.1 to 1.6.0

dist/models/search-context.schema.json

5

dist/models/search-options.schema.json

@@ -39,4 +39,9 @@ {

"aiSearch": {
"description": "Toggle AI Search \"on\" or \"off\".\nIf true, AI Search is used\nIf false, regular fulltext search is used\nIf not specified, the type of search will be determined by the configuration",
"type": "boolean"
},
"configurationId": {
"description": "If specified, this configuration will be used instead of the default configuration set for the tenant",
"type": "string"
},
"customResponseMask": {

@@ -43,0 +48,0 @@ "description": "Response mask to return only specific attributes of items",

5

dist/models/search.d.ts

@@ -1,3 +0,4 @@

import { FacetRequestOptions as FacetRequestOptionsCommons, SearchOptions as SearchOptionsCommons, SearchRequest as SearchRequestCommons } from '@attraqt/search-commons';
import { FacetRequestOptions as FacetRequestOptionsCommons, SearchOptions as SearchOptionsCommons, SearchRequest as SearchRequestCommons, SearchContext as SearchContextCommons } from '@attraqt/search-commons';
declare type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
export declare type SearchContext = Partial<SearchContextCommons>;
export declare type FacetRequestOptions = PartialBy<PartialBy<FacetRequestOptionsCommons, 'attribute'>, 'id'>;

@@ -7,5 +8,5 @@ export declare type SearchOptions = Omit<Partial<SearchOptionsCommons>, 'facets'> & {

};
export declare type SearchRequest = Omit<PartialBy<SearchRequestCommons, 'profileId'>, 'options'> & {
export declare type SearchRequest = Omit<SearchRequestCommons, 'options'> & {
options?: SearchOptions;
};
export { DisableOptions, SortOptions, SearchResponseProduct, SearchResponseRedirectItem, SearchResponseItem, SearchResponseMetadata_Facet_Value, SearchResponseMetadata_Facet, SearchResponseMetadata, SearchResponse } from '@attraqt/search-commons';

4

dist/models/suggest-options.schema.json

@@ -48,2 +48,6 @@ {

"properties": {
"configurationId": {
"description": "If specified, this configuration will be used instead of the default configuration set for the tenant",
"type": "string"
},
"customResponseMask": {

@@ -50,0 +54,0 @@ "description": "Response mask to return only specific attributes of items",

"use strict";
module.exports = validate20;
module.exports.default = validate20;
var schema22 = { "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "definitions": { "DisableOptions": { "additionalProperties": false, "properties": { "name": { "description": "Feature to disable in the query\nExample: \"facet\"", "type": "string" } }, "required": ["name"], "type": "object" }, "SortOptions": { "additionalProperties": false, "properties": { "attribute": { "description": "Attribute to sort by", "type": "string" }, "order": { "description": "Order of the sort.\nMust be either \"asc\" or \"desc\"", "type": "string" } }, "required": ["attribute", "order"], "type": "object" } }, "properties": { "aiSearch": { "type": "boolean" }, "customResponseMask": { "description": "Response mask to return only specific attributes of items", "type": "string" }, "disable": { "description": "Disable rules\nIf specified, disable specific functionalities", "items": { "$ref": "#/definitions/DisableOptions" }, "type": "array" }, "facets": { "items": { "additionalProperties": false, "properties": { "attribute": { "description": "Selected facet to filter by\nTODO: Should be removed after migration to ids", "type": "string" }, "id": { "description": "Selected facet to filter by", "type": "string" }, "values": { "description": "Values of the facet used for filtering the results", "items": { "type": "string" }, "type": "array" } }, "required": ["values"], "type": "object" }, "type": "array" }, "filter": { "description": "Filter string", "type": "string" }, "limit": { "description": "Pagination: size of the page", "type": "number" }, "offset": { "description": "Pagination: index of the first item to return", "type": "number" }, "sortBy": { "description": "List of sorting rules\n(applied in order)", "items": { "$ref": "#/definitions/SortOptions" }, "type": "array" } }, "type": "object" };
var schema22 = { "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "definitions": { "DisableOptions": { "additionalProperties": false, "properties": { "name": { "description": "Feature to disable in the query\nExample: \"facet\"", "type": "string" } }, "required": ["name"], "type": "object" }, "SortOptions": { "additionalProperties": false, "properties": { "attribute": { "description": "Attribute to sort by", "type": "string" }, "order": { "description": "Order of the sort.\nMust be either \"asc\" or \"desc\"", "type": "string" } }, "required": ["attribute", "order"], "type": "object" } }, "properties": { "aiSearch": { "description": "Toggle AI Search \"on\" or \"off\".\nIf true, AI Search is used\nIf false, regular fulltext search is used\nIf not specified, the type of search will be determined by the configuration", "type": "boolean" }, "configurationId": { "description": "If specified, this configuration will be used instead of the default configuration set for the tenant", "type": "string" }, "customResponseMask": { "description": "Response mask to return only specific attributes of items", "type": "string" }, "disable": { "description": "Disable rules\nIf specified, disable specific functionalities", "items": { "$ref": "#/definitions/DisableOptions" }, "type": "array" }, "facets": { "items": { "additionalProperties": false, "properties": { "attribute": { "description": "Selected facet to filter by\nTODO: Should be removed after migration to ids", "type": "string" }, "id": { "description": "Selected facet to filter by", "type": "string" }, "values": { "description": "Values of the facet used for filtering the results", "items": { "type": "string" }, "type": "array" } }, "required": ["values"], "type": "object" }, "type": "array" }, "filter": { "description": "Filter string", "type": "string" }, "limit": { "description": "Pagination: size of the page", "type": "number" }, "offset": { "description": "Pagination: index of the first item to return", "type": "number" }, "sortBy": { "description": "List of sorting rules\n(applied in order)", "items": { "$ref": "#/definitions/SortOptions" }, "type": "array" } }, "type": "object" };
var schema23 = { "additionalProperties": false, "properties": { "name": { "description": "Feature to disable in the query\nExample: \"facet\"", "type": "string" } }, "required": ["name"], "type": "object" };
var schema24 = { "additionalProperties": false, "properties": { "attribute": { "description": "Attribute to sort by", "type": "string" }, "order": { "description": "Order of the sort.\nMust be either \"asc\" or \"desc\"", "type": "string" } }, "required": ["attribute", "order"], "type": "object" };
var func4 = Object.prototype.hasOwnProperty;
function validate20(data, valCxt) {

@@ -26,3 +27,3 @@ "use strict";

for (var key0 in data) {
if (!((((((((key0 === "aiSearch") || (key0 === "customResponseMask")) || (key0 === "disable")) || (key0 === "facets")) || (key0 === "filter")) || (key0 === "limit")) || (key0 === "offset")) || (key0 === "sortBy"))) {
if (!(func4.call(schema22.properties, key0))) {
var err0 = { instancePath: instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties", schema: false, parentSchema: schema22, data: data };

@@ -51,6 +52,6 @@ if (vErrors === null) {

}
if (data.customResponseMask !== undefined) {
var data1 = data.customResponseMask;
if (data.configurationId !== undefined) {
var data1 = data.configurationId;
if (typeof data1 !== "string") {
var err2 = { instancePath: instancePath + "/customResponseMask", schemaPath: "#/properties/customResponseMask/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema22.properties.customResponseMask.type, parentSchema: schema22.properties.customResponseMask, data: data1 };
var err2 = { instancePath: instancePath + "/configurationId", schemaPath: "#/properties/configurationId/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema22.properties.configurationId.type, parentSchema: schema22.properties.configurationId, data: data1 };
if (vErrors === null) {

@@ -65,27 +66,40 @@ vErrors = [err2];

}
if (data.customResponseMask !== undefined) {
var data2 = data.customResponseMask;
if (typeof data2 !== "string") {
var err3 = { instancePath: instancePath + "/customResponseMask", schemaPath: "#/properties/customResponseMask/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema22.properties.customResponseMask.type, parentSchema: schema22.properties.customResponseMask, data: data2 };
if (vErrors === null) {
vErrors = [err3];
}
else {
vErrors.push(err3);
}
errors++;
}
}
if (data.disable !== undefined) {
var data2 = data.disable;
if (Array.isArray(data2)) {
var len0 = data2.length;
var data3 = data.disable;
if (Array.isArray(data3)) {
var len0 = data3.length;
for (var i0 = 0; i0 < len0; i0++) {
var data3 = data2[i0];
if (data3 && typeof data3 == "object" && !Array.isArray(data3)) {
if (data3.name === undefined) {
var err3 = { instancePath: instancePath + "/disable/" + i0, schemaPath: "#/definitions/DisableOptions/required", keyword: "required", params: { missingProperty: "name" }, message: "must have required property '" + "name" + "'", schema: schema23.required, parentSchema: schema23, data: data3 };
var data4 = data3[i0];
if (data4 && typeof data4 == "object" && !Array.isArray(data4)) {
if (data4.name === undefined) {
var err4 = { instancePath: instancePath + "/disable/" + i0, schemaPath: "#/definitions/DisableOptions/required", keyword: "required", params: { missingProperty: "name" }, message: "must have required property '" + "name" + "'", schema: schema23.required, parentSchema: schema23, data: data4 };
if (vErrors === null) {
vErrors = [err3];
vErrors = [err4];
}
else {
vErrors.push(err3);
vErrors.push(err4);
}
errors++;
}
for (var key1 in data3) {
for (var key1 in data4) {
if (!(key1 === "name")) {
var err4 = { instancePath: instancePath + "/disable/" + i0, schemaPath: "#/definitions/DisableOptions/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties", schema: false, parentSchema: schema23, data: data3 };
var err5 = { instancePath: instancePath + "/disable/" + i0, schemaPath: "#/definitions/DisableOptions/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties", schema: false, parentSchema: schema23, data: data4 };
if (vErrors === null) {
vErrors = [err4];
vErrors = [err5];
}
else {
vErrors.push(err4);
vErrors.push(err5);
}

@@ -95,11 +109,11 @@ errors++;

}
if (data3.name !== undefined) {
var data4 = data3.name;
if (typeof data4 !== "string") {
var err5 = { instancePath: instancePath + "/disable/" + i0 + "/name", schemaPath: "#/definitions/DisableOptions/properties/name/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema23.properties.name.type, parentSchema: schema23.properties.name, data: data4 };
if (data4.name !== undefined) {
var data5 = data4.name;
if (typeof data5 !== "string") {
var err6 = { instancePath: instancePath + "/disable/" + i0 + "/name", schemaPath: "#/definitions/DisableOptions/properties/name/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema23.properties.name.type, parentSchema: schema23.properties.name, data: data5 };
if (vErrors === null) {
vErrors = [err5];
vErrors = [err6];
}
else {
vErrors.push(err5);
vErrors.push(err6);
}

@@ -111,8 +125,8 @@ errors++;

else {
var err6 = { instancePath: instancePath + "/disable/" + i0, schemaPath: "#/definitions/DisableOptions/type", keyword: "type", params: { type: "object" }, message: "must be object", schema: schema23.type, parentSchema: schema23, data: data3 };
var err7 = { instancePath: instancePath + "/disable/" + i0, schemaPath: "#/definitions/DisableOptions/type", keyword: "type", params: { type: "object" }, message: "must be object", schema: schema23.type, parentSchema: schema23, data: data4 };
if (vErrors === null) {
vErrors = [err6];
vErrors = [err7];
}
else {
vErrors.push(err6);
vErrors.push(err7);
}

@@ -124,8 +138,8 @@ errors++;

else {
var err7 = { instancePath: instancePath + "/disable", schemaPath: "#/properties/disable/type", keyword: "type", params: { type: "array" }, message: "must be array", schema: schema22.properties.disable.type, parentSchema: schema22.properties.disable, data: data2 };
var err8 = { instancePath: instancePath + "/disable", schemaPath: "#/properties/disable/type", keyword: "type", params: { type: "array" }, message: "must be array", schema: schema22.properties.disable.type, parentSchema: schema22.properties.disable, data: data3 };
if (vErrors === null) {
vErrors = [err7];
vErrors = [err8];
}
else {
vErrors.push(err7);
vErrors.push(err8);
}

@@ -136,26 +150,26 @@ errors++;

if (data.facets !== undefined) {
var data5 = data.facets;
if (Array.isArray(data5)) {
var len1 = data5.length;
var data6 = data.facets;
if (Array.isArray(data6)) {
var len1 = data6.length;
for (var i1 = 0; i1 < len1; i1++) {
var data6 = data5[i1];
if (data6 && typeof data6 == "object" && !Array.isArray(data6)) {
if (data6.values === undefined) {
var err8 = { instancePath: instancePath + "/facets/" + i1, schemaPath: "#/properties/facets/items/required", keyword: "required", params: { missingProperty: "values" }, message: "must have required property '" + "values" + "'", schema: schema22.properties.facets.items.required, parentSchema: schema22.properties.facets.items, data: data6 };
var data7 = data6[i1];
if (data7 && typeof data7 == "object" && !Array.isArray(data7)) {
if (data7.values === undefined) {
var err9 = { instancePath: instancePath + "/facets/" + i1, schemaPath: "#/properties/facets/items/required", keyword: "required", params: { missingProperty: "values" }, message: "must have required property '" + "values" + "'", schema: schema22.properties.facets.items.required, parentSchema: schema22.properties.facets.items, data: data7 };
if (vErrors === null) {
vErrors = [err8];
vErrors = [err9];
}
else {
vErrors.push(err8);
vErrors.push(err9);
}
errors++;
}
for (var key2 in data6) {
for (var key2 in data7) {
if (!(((key2 === "attribute") || (key2 === "id")) || (key2 === "values"))) {
var err9 = { instancePath: instancePath + "/facets/" + i1, schemaPath: "#/properties/facets/items/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key2 }, message: "must NOT have additional properties", schema: false, parentSchema: schema22.properties.facets.items, data: data6 };
var err10 = { instancePath: instancePath + "/facets/" + i1, schemaPath: "#/properties/facets/items/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key2 }, message: "must NOT have additional properties", schema: false, parentSchema: schema22.properties.facets.items, data: data7 };
if (vErrors === null) {
vErrors = [err9];
vErrors = [err10];
}
else {
vErrors.push(err9);
vErrors.push(err10);
}

@@ -165,11 +179,11 @@ errors++;

}
if (data6.attribute !== undefined) {
var data7 = data6.attribute;
if (typeof data7 !== "string") {
var err10 = { instancePath: instancePath + "/facets/" + i1 + "/attribute", schemaPath: "#/properties/facets/items/properties/attribute/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema22.properties.facets.items.properties.attribute.type, parentSchema: schema22.properties.facets.items.properties.attribute, data: data7 };
if (data7.attribute !== undefined) {
var data8 = data7.attribute;
if (typeof data8 !== "string") {
var err11 = { instancePath: instancePath + "/facets/" + i1 + "/attribute", schemaPath: "#/properties/facets/items/properties/attribute/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema22.properties.facets.items.properties.attribute.type, parentSchema: schema22.properties.facets.items.properties.attribute, data: data8 };
if (vErrors === null) {
vErrors = [err10];
vErrors = [err11];
}
else {
vErrors.push(err10);
vErrors.push(err11);
}

@@ -179,11 +193,11 @@ errors++;

}
if (data6.id !== undefined) {
var data8 = data6.id;
if (typeof data8 !== "string") {
var err11 = { instancePath: instancePath + "/facets/" + i1 + "/id", schemaPath: "#/properties/facets/items/properties/id/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema22.properties.facets.items.properties.id.type, parentSchema: schema22.properties.facets.items.properties.id, data: data8 };
if (data7.id !== undefined) {
var data9 = data7.id;
if (typeof data9 !== "string") {
var err12 = { instancePath: instancePath + "/facets/" + i1 + "/id", schemaPath: "#/properties/facets/items/properties/id/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema22.properties.facets.items.properties.id.type, parentSchema: schema22.properties.facets.items.properties.id, data: data9 };
if (vErrors === null) {
vErrors = [err11];
vErrors = [err12];
}
else {
vErrors.push(err11);
vErrors.push(err12);
}

@@ -193,15 +207,15 @@ errors++;

}
if (data6.values !== undefined) {
var data9 = data6.values;
if (Array.isArray(data9)) {
var len2 = data9.length;
if (data7.values !== undefined) {
var data10 = data7.values;
if (Array.isArray(data10)) {
var len2 = data10.length;
for (var i2 = 0; i2 < len2; i2++) {
var data10 = data9[i2];
if (typeof data10 !== "string") {
var err12 = { instancePath: instancePath + "/facets/" + i1 + "/values/" + i2, schemaPath: "#/properties/facets/items/properties/values/items/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema22.properties.facets.items.properties.values.items.type, parentSchema: schema22.properties.facets.items.properties.values.items, data: data10 };
var data11 = data10[i2];
if (typeof data11 !== "string") {
var err13 = { instancePath: instancePath + "/facets/" + i1 + "/values/" + i2, schemaPath: "#/properties/facets/items/properties/values/items/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema22.properties.facets.items.properties.values.items.type, parentSchema: schema22.properties.facets.items.properties.values.items, data: data11 };
if (vErrors === null) {
vErrors = [err12];
vErrors = [err13];
}
else {
vErrors.push(err12);
vErrors.push(err13);
}

@@ -213,8 +227,8 @@ errors++;

else {
var err13 = { instancePath: instancePath + "/facets/" + i1 + "/values", schemaPath: "#/properties/facets/items/properties/values/type", keyword: "type", params: { type: "array" }, message: "must be array", schema: schema22.properties.facets.items.properties.values.type, parentSchema: schema22.properties.facets.items.properties.values, data: data9 };
var err14 = { instancePath: instancePath + "/facets/" + i1 + "/values", schemaPath: "#/properties/facets/items/properties/values/type", keyword: "type", params: { type: "array" }, message: "must be array", schema: schema22.properties.facets.items.properties.values.type, parentSchema: schema22.properties.facets.items.properties.values, data: data10 };
if (vErrors === null) {
vErrors = [err13];
vErrors = [err14];
}
else {
vErrors.push(err13);
vErrors.push(err14);
}

@@ -226,8 +240,8 @@ errors++;

else {
var err14 = { instancePath: instancePath + "/facets/" + i1, schemaPath: "#/properties/facets/items/type", keyword: "type", params: { type: "object" }, message: "must be object", schema: schema22.properties.facets.items.type, parentSchema: schema22.properties.facets.items, data: data6 };
var err15 = { instancePath: instancePath + "/facets/" + i1, schemaPath: "#/properties/facets/items/type", keyword: "type", params: { type: "object" }, message: "must be object", schema: schema22.properties.facets.items.type, parentSchema: schema22.properties.facets.items, data: data7 };
if (vErrors === null) {
vErrors = [err14];
vErrors = [err15];
}
else {
vErrors.push(err14);
vErrors.push(err15);
}

@@ -239,8 +253,8 @@ errors++;

else {
var err15 = { instancePath: instancePath + "/facets", schemaPath: "#/properties/facets/type", keyword: "type", params: { type: "array" }, message: "must be array", schema: schema22.properties.facets.type, parentSchema: schema22.properties.facets, data: data5 };
var err16 = { instancePath: instancePath + "/facets", schemaPath: "#/properties/facets/type", keyword: "type", params: { type: "array" }, message: "must be array", schema: schema22.properties.facets.type, parentSchema: schema22.properties.facets, data: data6 };
if (vErrors === null) {
vErrors = [err15];
vErrors = [err16];
}
else {
vErrors.push(err15);
vErrors.push(err16);
}

@@ -251,10 +265,10 @@ errors++;

if (data.filter !== undefined) {
var data11 = data.filter;
if (typeof data11 !== "string") {
var err16 = { instancePath: instancePath + "/filter", schemaPath: "#/properties/filter/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema22.properties.filter.type, parentSchema: schema22.properties.filter, data: data11 };
var data12 = data.filter;
if (typeof data12 !== "string") {
var err17 = { instancePath: instancePath + "/filter", schemaPath: "#/properties/filter/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema22.properties.filter.type, parentSchema: schema22.properties.filter, data: data12 };
if (vErrors === null) {
vErrors = [err16];
vErrors = [err17];
}
else {
vErrors.push(err16);
vErrors.push(err17);
}

@@ -265,10 +279,10 @@ errors++;

if (data.limit !== undefined) {
var data12 = data.limit;
if (!((typeof data12 == "number") && (isFinite(data12)))) {
var err17 = { instancePath: instancePath + "/limit", schemaPath: "#/properties/limit/type", keyword: "type", params: { type: "number" }, message: "must be number", schema: schema22.properties.limit.type, parentSchema: schema22.properties.limit, data: data12 };
var data13 = data.limit;
if (!((typeof data13 == "number") && (isFinite(data13)))) {
var err18 = { instancePath: instancePath + "/limit", schemaPath: "#/properties/limit/type", keyword: "type", params: { type: "number" }, message: "must be number", schema: schema22.properties.limit.type, parentSchema: schema22.properties.limit, data: data13 };
if (vErrors === null) {
vErrors = [err17];
vErrors = [err18];
}
else {
vErrors.push(err17);
vErrors.push(err18);
}

@@ -279,10 +293,10 @@ errors++;

if (data.offset !== undefined) {
var data13 = data.offset;
if (!((typeof data13 == "number") && (isFinite(data13)))) {
var err18 = { instancePath: instancePath + "/offset", schemaPath: "#/properties/offset/type", keyword: "type", params: { type: "number" }, message: "must be number", schema: schema22.properties.offset.type, parentSchema: schema22.properties.offset, data: data13 };
var data14 = data.offset;
if (!((typeof data14 == "number") && (isFinite(data14)))) {
var err19 = { instancePath: instancePath + "/offset", schemaPath: "#/properties/offset/type", keyword: "type", params: { type: "number" }, message: "must be number", schema: schema22.properties.offset.type, parentSchema: schema22.properties.offset, data: data14 };
if (vErrors === null) {
vErrors = [err18];
vErrors = [err19];
}
else {
vErrors.push(err18);
vErrors.push(err19);
}

@@ -293,36 +307,36 @@ errors++;

if (data.sortBy !== undefined) {
var data14 = data.sortBy;
if (Array.isArray(data14)) {
var len3 = data14.length;
var data15 = data.sortBy;
if (Array.isArray(data15)) {
var len3 = data15.length;
for (var i3 = 0; i3 < len3; i3++) {
var data15 = data14[i3];
if (data15 && typeof data15 == "object" && !Array.isArray(data15)) {
if (data15.attribute === undefined) {
var err19 = { instancePath: instancePath + "/sortBy/" + i3, schemaPath: "#/definitions/SortOptions/required", keyword: "required", params: { missingProperty: "attribute" }, message: "must have required property '" + "attribute" + "'", schema: schema24.required, parentSchema: schema24, data: data15 };
var data16 = data15[i3];
if (data16 && typeof data16 == "object" && !Array.isArray(data16)) {
if (data16.attribute === undefined) {
var err20 = { instancePath: instancePath + "/sortBy/" + i3, schemaPath: "#/definitions/SortOptions/required", keyword: "required", params: { missingProperty: "attribute" }, message: "must have required property '" + "attribute" + "'", schema: schema24.required, parentSchema: schema24, data: data16 };
if (vErrors === null) {
vErrors = [err19];
vErrors = [err20];
}
else {
vErrors.push(err19);
vErrors.push(err20);
}
errors++;
}
if (data15.order === undefined) {
var err20 = { instancePath: instancePath + "/sortBy/" + i3, schemaPath: "#/definitions/SortOptions/required", keyword: "required", params: { missingProperty: "order" }, message: "must have required property '" + "order" + "'", schema: schema24.required, parentSchema: schema24, data: data15 };
if (data16.order === undefined) {
var err21 = { instancePath: instancePath + "/sortBy/" + i3, schemaPath: "#/definitions/SortOptions/required", keyword: "required", params: { missingProperty: "order" }, message: "must have required property '" + "order" + "'", schema: schema24.required, parentSchema: schema24, data: data16 };
if (vErrors === null) {
vErrors = [err20];
vErrors = [err21];
}
else {
vErrors.push(err20);
vErrors.push(err21);
}
errors++;
}
for (var key3 in data15) {
for (var key3 in data16) {
if (!((key3 === "attribute") || (key3 === "order"))) {
var err21 = { instancePath: instancePath + "/sortBy/" + i3, schemaPath: "#/definitions/SortOptions/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key3 }, message: "must NOT have additional properties", schema: false, parentSchema: schema24, data: data15 };
var err22 = { instancePath: instancePath + "/sortBy/" + i3, schemaPath: "#/definitions/SortOptions/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key3 }, message: "must NOT have additional properties", schema: false, parentSchema: schema24, data: data16 };
if (vErrors === null) {
vErrors = [err21];
vErrors = [err22];
}
else {
vErrors.push(err21);
vErrors.push(err22);
}

@@ -332,11 +346,11 @@ errors++;

}
if (data15.attribute !== undefined) {
var data16 = data15.attribute;
if (typeof data16 !== "string") {
var err22 = { instancePath: instancePath + "/sortBy/" + i3 + "/attribute", schemaPath: "#/definitions/SortOptions/properties/attribute/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema24.properties.attribute.type, parentSchema: schema24.properties.attribute, data: data16 };
if (data16.attribute !== undefined) {
var data17 = data16.attribute;
if (typeof data17 !== "string") {
var err23 = { instancePath: instancePath + "/sortBy/" + i3 + "/attribute", schemaPath: "#/definitions/SortOptions/properties/attribute/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema24.properties.attribute.type, parentSchema: schema24.properties.attribute, data: data17 };
if (vErrors === null) {
vErrors = [err22];
vErrors = [err23];
}
else {
vErrors.push(err22);
vErrors.push(err23);
}

@@ -346,11 +360,11 @@ errors++;

}
if (data15.order !== undefined) {
var data17 = data15.order;
if (typeof data17 !== "string") {
var err23 = { instancePath: instancePath + "/sortBy/" + i3 + "/order", schemaPath: "#/definitions/SortOptions/properties/order/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema24.properties.order.type, parentSchema: schema24.properties.order, data: data17 };
if (data16.order !== undefined) {
var data18 = data16.order;
if (typeof data18 !== "string") {
var err24 = { instancePath: instancePath + "/sortBy/" + i3 + "/order", schemaPath: "#/definitions/SortOptions/properties/order/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema24.properties.order.type, parentSchema: schema24.properties.order, data: data18 };
if (vErrors === null) {
vErrors = [err23];
vErrors = [err24];
}
else {
vErrors.push(err23);
vErrors.push(err24);
}

@@ -362,8 +376,8 @@ errors++;

else {
var err24 = { instancePath: instancePath + "/sortBy/" + i3, schemaPath: "#/definitions/SortOptions/type", keyword: "type", params: { type: "object" }, message: "must be object", schema: schema24.type, parentSchema: schema24, data: data15 };
var err25 = { instancePath: instancePath + "/sortBy/" + i3, schemaPath: "#/definitions/SortOptions/type", keyword: "type", params: { type: "object" }, message: "must be object", schema: schema24.type, parentSchema: schema24, data: data16 };
if (vErrors === null) {
vErrors = [err24];
vErrors = [err25];
}
else {
vErrors.push(err24);
vErrors.push(err25);
}

@@ -375,8 +389,8 @@ errors++;

else {
var err25 = { instancePath: instancePath + "/sortBy", schemaPath: "#/properties/sortBy/type", keyword: "type", params: { type: "array" }, message: "must be array", schema: schema22.properties.sortBy.type, parentSchema: schema22.properties.sortBy, data: data14 };
var err26 = { instancePath: instancePath + "/sortBy", schemaPath: "#/properties/sortBy/type", keyword: "type", params: { type: "array" }, message: "must be array", schema: schema22.properties.sortBy.type, parentSchema: schema22.properties.sortBy, data: data15 };
if (vErrors === null) {
vErrors = [err25];
vErrors = [err26];
}
else {
vErrors.push(err25);
vErrors.push(err26);
}

@@ -388,8 +402,8 @@ errors++;

else {
var err26 = { instancePath: instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object", schema: schema22.type, parentSchema: schema22, data: data };
var err27 = { instancePath: instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object", schema: schema22.type, parentSchema: schema22, data: data };
if (vErrors === null) {
vErrors = [err26];
vErrors = [err27];
}
else {
vErrors.push(err26);
vErrors.push(err27);
}

@@ -396,0 +410,0 @@ errors++;

"use strict";
module.exports = validate20;
module.exports.default = validate20;
var schema22 = { "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "definitions": { "GroupOptions": { "additionalProperties": false, "properties": { "attribute": { "type": "string" }, "size": { "type": "number" }, "values": { "items": { "type": "string" }, "type": "array" } }, "required": ["attribute", "size", "values"], "type": "object" }, "SortOptions": { "additionalProperties": false, "properties": { "attribute": { "description": "Attribute to sort by", "type": "string" }, "order": { "description": "Order of the sort.\nMust be either \"asc\" or \"desc\"", "type": "string" } }, "required": ["attribute", "order"], "type": "object" } }, "properties": { "customResponseMask": { "description": "Response mask to return only specific attributes of items", "type": "string" }, "filter": { "description": "Filter string", "type": "string" }, "groupBy": { "$ref": "#/definitions/GroupOptions", "description": "to do" }, "sortBy": { "description": "List of sorting rules\n(applied in order)", "items": { "$ref": "#/definitions/SortOptions" }, "type": "array" } }, "type": "object" };
var schema22 = { "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "definitions": { "GroupOptions": { "additionalProperties": false, "properties": { "attribute": { "type": "string" }, "size": { "type": "number" }, "values": { "items": { "type": "string" }, "type": "array" } }, "required": ["attribute", "size", "values"], "type": "object" }, "SortOptions": { "additionalProperties": false, "properties": { "attribute": { "description": "Attribute to sort by", "type": "string" }, "order": { "description": "Order of the sort.\nMust be either \"asc\" or \"desc\"", "type": "string" } }, "required": ["attribute", "order"], "type": "object" } }, "properties": { "configurationId": { "description": "If specified, this configuration will be used instead of the default configuration set for the tenant", "type": "string" }, "customResponseMask": { "description": "Response mask to return only specific attributes of items", "type": "string" }, "filter": { "description": "Filter string", "type": "string" }, "groupBy": { "$ref": "#/definitions/GroupOptions", "description": "to do" }, "sortBy": { "description": "List of sorting rules\n(applied in order)", "items": { "$ref": "#/definitions/SortOptions" }, "type": "array" } }, "type": "object" };
var schema23 = { "additionalProperties": false, "properties": { "attribute": { "type": "string" }, "size": { "type": "number" }, "values": { "items": { "type": "string" }, "type": "array" } }, "required": ["attribute", "size", "values"], "type": "object" };

@@ -26,3 +26,3 @@ var schema24 = { "additionalProperties": false, "properties": { "attribute": { "description": "Attribute to sort by", "type": "string" }, "order": { "description": "Order of the sort.\nMust be either \"asc\" or \"desc\"", "type": "string" } }, "required": ["attribute", "order"], "type": "object" };

for (var key0 in data) {
if (!((((key0 === "customResponseMask") || (key0 === "filter")) || (key0 === "groupBy")) || (key0 === "sortBy"))) {
if (!(((((key0 === "configurationId") || (key0 === "customResponseMask")) || (key0 === "filter")) || (key0 === "groupBy")) || (key0 === "sortBy"))) {
var err0 = { instancePath: instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties", schema: false, parentSchema: schema22, data: data };

@@ -38,6 +38,6 @@ if (vErrors === null) {

}
if (data.customResponseMask !== undefined) {
var data0 = data.customResponseMask;
if (data.configurationId !== undefined) {
var data0 = data.configurationId;
if (typeof data0 !== "string") {
var err1 = { instancePath: instancePath + "/customResponseMask", schemaPath: "#/properties/customResponseMask/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema22.properties.customResponseMask.type, parentSchema: schema22.properties.customResponseMask, data: data0 };
var err1 = { instancePath: instancePath + "/configurationId", schemaPath: "#/properties/configurationId/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema22.properties.configurationId.type, parentSchema: schema22.properties.configurationId, data: data0 };
if (vErrors === null) {

@@ -52,6 +52,6 @@ vErrors = [err1];

}
if (data.filter !== undefined) {
var data1 = data.filter;
if (data.customResponseMask !== undefined) {
var data1 = data.customResponseMask;
if (typeof data1 !== "string") {
var err2 = { instancePath: instancePath + "/filter", schemaPath: "#/properties/filter/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema22.properties.filter.type, parentSchema: schema22.properties.filter, data: data1 };
var err2 = { instancePath: instancePath + "/customResponseMask", schemaPath: "#/properties/customResponseMask/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema22.properties.customResponseMask.type, parentSchema: schema22.properties.customResponseMask, data: data1 };
if (vErrors === null) {

@@ -66,43 +66,56 @@ vErrors = [err2];

}
if (data.filter !== undefined) {
var data2 = data.filter;
if (typeof data2 !== "string") {
var err3 = { instancePath: instancePath + "/filter", schemaPath: "#/properties/filter/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema22.properties.filter.type, parentSchema: schema22.properties.filter, data: data2 };
if (vErrors === null) {
vErrors = [err3];
}
else {
vErrors.push(err3);
}
errors++;
}
}
if (data.groupBy !== undefined) {
var data2 = data.groupBy;
if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
if (data2.attribute === undefined) {
var err3 = { instancePath: instancePath + "/groupBy", schemaPath: "#/definitions/GroupOptions/required", keyword: "required", params: { missingProperty: "attribute" }, message: "must have required property '" + "attribute" + "'", schema: schema23.required, parentSchema: schema23, data: data2 };
var data3 = data.groupBy;
if (data3 && typeof data3 == "object" && !Array.isArray(data3)) {
if (data3.attribute === undefined) {
var err4 = { instancePath: instancePath + "/groupBy", schemaPath: "#/definitions/GroupOptions/required", keyword: "required", params: { missingProperty: "attribute" }, message: "must have required property '" + "attribute" + "'", schema: schema23.required, parentSchema: schema23, data: data3 };
if (vErrors === null) {
vErrors = [err3];
vErrors = [err4];
}
else {
vErrors.push(err3);
vErrors.push(err4);
}
errors++;
}
if (data2.size === undefined) {
var err4 = { instancePath: instancePath + "/groupBy", schemaPath: "#/definitions/GroupOptions/required", keyword: "required", params: { missingProperty: "size" }, message: "must have required property '" + "size" + "'", schema: schema23.required, parentSchema: schema23, data: data2 };
if (data3.size === undefined) {
var err5 = { instancePath: instancePath + "/groupBy", schemaPath: "#/definitions/GroupOptions/required", keyword: "required", params: { missingProperty: "size" }, message: "must have required property '" + "size" + "'", schema: schema23.required, parentSchema: schema23, data: data3 };
if (vErrors === null) {
vErrors = [err4];
vErrors = [err5];
}
else {
vErrors.push(err4);
vErrors.push(err5);
}
errors++;
}
if (data2.values === undefined) {
var err5 = { instancePath: instancePath + "/groupBy", schemaPath: "#/definitions/GroupOptions/required", keyword: "required", params: { missingProperty: "values" }, message: "must have required property '" + "values" + "'", schema: schema23.required, parentSchema: schema23, data: data2 };
if (data3.values === undefined) {
var err6 = { instancePath: instancePath + "/groupBy", schemaPath: "#/definitions/GroupOptions/required", keyword: "required", params: { missingProperty: "values" }, message: "must have required property '" + "values" + "'", schema: schema23.required, parentSchema: schema23, data: data3 };
if (vErrors === null) {
vErrors = [err5];
vErrors = [err6];
}
else {
vErrors.push(err5);
vErrors.push(err6);
}
errors++;
}
for (var key1 in data2) {
for (var key1 in data3) {
if (!(((key1 === "attribute") || (key1 === "size")) || (key1 === "values"))) {
var err6 = { instancePath: instancePath + "/groupBy", schemaPath: "#/definitions/GroupOptions/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties", schema: false, parentSchema: schema23, data: data2 };
var err7 = { instancePath: instancePath + "/groupBy", schemaPath: "#/definitions/GroupOptions/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties", schema: false, parentSchema: schema23, data: data3 };
if (vErrors === null) {
vErrors = [err6];
vErrors = [err7];
}
else {
vErrors.push(err6);
vErrors.push(err7);
}

@@ -112,11 +125,11 @@ errors++;

}
if (data2.attribute !== undefined) {
var data3 = data2.attribute;
if (typeof data3 !== "string") {
var err7 = { instancePath: instancePath + "/groupBy/attribute", schemaPath: "#/definitions/GroupOptions/properties/attribute/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema23.properties.attribute.type, parentSchema: schema23.properties.attribute, data: data3 };
if (data3.attribute !== undefined) {
var data4 = data3.attribute;
if (typeof data4 !== "string") {
var err8 = { instancePath: instancePath + "/groupBy/attribute", schemaPath: "#/definitions/GroupOptions/properties/attribute/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema23.properties.attribute.type, parentSchema: schema23.properties.attribute, data: data4 };
if (vErrors === null) {
vErrors = [err7];
vErrors = [err8];
}
else {
vErrors.push(err7);
vErrors.push(err8);
}

@@ -126,11 +139,11 @@ errors++;

}
if (data2.size !== undefined) {
var data4 = data2.size;
if (!((typeof data4 == "number") && (isFinite(data4)))) {
var err8 = { instancePath: instancePath + "/groupBy/size", schemaPath: "#/definitions/GroupOptions/properties/size/type", keyword: "type", params: { type: "number" }, message: "must be number", schema: schema23.properties.size.type, parentSchema: schema23.properties.size, data: data4 };
if (data3.size !== undefined) {
var data5 = data3.size;
if (!((typeof data5 == "number") && (isFinite(data5)))) {
var err9 = { instancePath: instancePath + "/groupBy/size", schemaPath: "#/definitions/GroupOptions/properties/size/type", keyword: "type", params: { type: "number" }, message: "must be number", schema: schema23.properties.size.type, parentSchema: schema23.properties.size, data: data5 };
if (vErrors === null) {
vErrors = [err8];
vErrors = [err9];
}
else {
vErrors.push(err8);
vErrors.push(err9);
}

@@ -140,15 +153,15 @@ errors++;

}
if (data2.values !== undefined) {
var data5 = data2.values;
if (Array.isArray(data5)) {
var len0 = data5.length;
if (data3.values !== undefined) {
var data6 = data3.values;
if (Array.isArray(data6)) {
var len0 = data6.length;
for (var i0 = 0; i0 < len0; i0++) {
var data6 = data5[i0];
if (typeof data6 !== "string") {
var err9 = { instancePath: instancePath + "/groupBy/values/" + i0, schemaPath: "#/definitions/GroupOptions/properties/values/items/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema23.properties.values.items.type, parentSchema: schema23.properties.values.items, data: data6 };
var data7 = data6[i0];
if (typeof data7 !== "string") {
var err10 = { instancePath: instancePath + "/groupBy/values/" + i0, schemaPath: "#/definitions/GroupOptions/properties/values/items/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema23.properties.values.items.type, parentSchema: schema23.properties.values.items, data: data7 };
if (vErrors === null) {
vErrors = [err9];
vErrors = [err10];
}
else {
vErrors.push(err9);
vErrors.push(err10);
}

@@ -160,8 +173,8 @@ errors++;

else {
var err10 = { instancePath: instancePath + "/groupBy/values", schemaPath: "#/definitions/GroupOptions/properties/values/type", keyword: "type", params: { type: "array" }, message: "must be array", schema: schema23.properties.values.type, parentSchema: schema23.properties.values, data: data5 };
var err11 = { instancePath: instancePath + "/groupBy/values", schemaPath: "#/definitions/GroupOptions/properties/values/type", keyword: "type", params: { type: "array" }, message: "must be array", schema: schema23.properties.values.type, parentSchema: schema23.properties.values, data: data6 };
if (vErrors === null) {
vErrors = [err10];
vErrors = [err11];
}
else {
vErrors.push(err10);
vErrors.push(err11);
}

@@ -173,8 +186,8 @@ errors++;

else {
var err11 = { instancePath: instancePath + "/groupBy", schemaPath: "#/definitions/GroupOptions/type", keyword: "type", params: { type: "object" }, message: "must be object", schema: schema23.type, parentSchema: schema23, data: data2 };
var err12 = { instancePath: instancePath + "/groupBy", schemaPath: "#/definitions/GroupOptions/type", keyword: "type", params: { type: "object" }, message: "must be object", schema: schema23.type, parentSchema: schema23, data: data3 };
if (vErrors === null) {
vErrors = [err11];
vErrors = [err12];
}
else {
vErrors.push(err11);
vErrors.push(err12);
}

@@ -185,36 +198,36 @@ errors++;

if (data.sortBy !== undefined) {
var data7 = data.sortBy;
if (Array.isArray(data7)) {
var len1 = data7.length;
var data8 = data.sortBy;
if (Array.isArray(data8)) {
var len1 = data8.length;
for (var i1 = 0; i1 < len1; i1++) {
var data8 = data7[i1];
if (data8 && typeof data8 == "object" && !Array.isArray(data8)) {
if (data8.attribute === undefined) {
var err12 = { instancePath: instancePath + "/sortBy/" + i1, schemaPath: "#/definitions/SortOptions/required", keyword: "required", params: { missingProperty: "attribute" }, message: "must have required property '" + "attribute" + "'", schema: schema24.required, parentSchema: schema24, data: data8 };
var data9 = data8[i1];
if (data9 && typeof data9 == "object" && !Array.isArray(data9)) {
if (data9.attribute === undefined) {
var err13 = { instancePath: instancePath + "/sortBy/" + i1, schemaPath: "#/definitions/SortOptions/required", keyword: "required", params: { missingProperty: "attribute" }, message: "must have required property '" + "attribute" + "'", schema: schema24.required, parentSchema: schema24, data: data9 };
if (vErrors === null) {
vErrors = [err12];
vErrors = [err13];
}
else {
vErrors.push(err12);
vErrors.push(err13);
}
errors++;
}
if (data8.order === undefined) {
var err13 = { instancePath: instancePath + "/sortBy/" + i1, schemaPath: "#/definitions/SortOptions/required", keyword: "required", params: { missingProperty: "order" }, message: "must have required property '" + "order" + "'", schema: schema24.required, parentSchema: schema24, data: data8 };
if (data9.order === undefined) {
var err14 = { instancePath: instancePath + "/sortBy/" + i1, schemaPath: "#/definitions/SortOptions/required", keyword: "required", params: { missingProperty: "order" }, message: "must have required property '" + "order" + "'", schema: schema24.required, parentSchema: schema24, data: data9 };
if (vErrors === null) {
vErrors = [err13];
vErrors = [err14];
}
else {
vErrors.push(err13);
vErrors.push(err14);
}
errors++;
}
for (var key2 in data8) {
for (var key2 in data9) {
if (!((key2 === "attribute") || (key2 === "order"))) {
var err14 = { instancePath: instancePath + "/sortBy/" + i1, schemaPath: "#/definitions/SortOptions/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key2 }, message: "must NOT have additional properties", schema: false, parentSchema: schema24, data: data8 };
var err15 = { instancePath: instancePath + "/sortBy/" + i1, schemaPath: "#/definitions/SortOptions/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key2 }, message: "must NOT have additional properties", schema: false, parentSchema: schema24, data: data9 };
if (vErrors === null) {
vErrors = [err14];
vErrors = [err15];
}
else {
vErrors.push(err14);
vErrors.push(err15);
}

@@ -224,11 +237,11 @@ errors++;

}
if (data8.attribute !== undefined) {
var data9 = data8.attribute;
if (typeof data9 !== "string") {
var err15 = { instancePath: instancePath + "/sortBy/" + i1 + "/attribute", schemaPath: "#/definitions/SortOptions/properties/attribute/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema24.properties.attribute.type, parentSchema: schema24.properties.attribute, data: data9 };
if (data9.attribute !== undefined) {
var data10 = data9.attribute;
if (typeof data10 !== "string") {
var err16 = { instancePath: instancePath + "/sortBy/" + i1 + "/attribute", schemaPath: "#/definitions/SortOptions/properties/attribute/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema24.properties.attribute.type, parentSchema: schema24.properties.attribute, data: data10 };
if (vErrors === null) {
vErrors = [err15];
vErrors = [err16];
}
else {
vErrors.push(err15);
vErrors.push(err16);
}

@@ -238,11 +251,11 @@ errors++;

}
if (data8.order !== undefined) {
var data10 = data8.order;
if (typeof data10 !== "string") {
var err16 = { instancePath: instancePath + "/sortBy/" + i1 + "/order", schemaPath: "#/definitions/SortOptions/properties/order/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema24.properties.order.type, parentSchema: schema24.properties.order, data: data10 };
if (data9.order !== undefined) {
var data11 = data9.order;
if (typeof data11 !== "string") {
var err17 = { instancePath: instancePath + "/sortBy/" + i1 + "/order", schemaPath: "#/definitions/SortOptions/properties/order/type", keyword: "type", params: { type: "string" }, message: "must be string", schema: schema24.properties.order.type, parentSchema: schema24.properties.order, data: data11 };
if (vErrors === null) {
vErrors = [err16];
vErrors = [err17];
}
else {
vErrors.push(err16);
vErrors.push(err17);
}

@@ -254,8 +267,8 @@ errors++;

else {
var err17 = { instancePath: instancePath + "/sortBy/" + i1, schemaPath: "#/definitions/SortOptions/type", keyword: "type", params: { type: "object" }, message: "must be object", schema: schema24.type, parentSchema: schema24, data: data8 };
var err18 = { instancePath: instancePath + "/sortBy/" + i1, schemaPath: "#/definitions/SortOptions/type", keyword: "type", params: { type: "object" }, message: "must be object", schema: schema24.type, parentSchema: schema24, data: data9 };
if (vErrors === null) {
vErrors = [err17];
vErrors = [err18];
}
else {
vErrors.push(err17);
vErrors.push(err18);
}

@@ -267,8 +280,8 @@ errors++;

else {
var err18 = { instancePath: instancePath + "/sortBy", schemaPath: "#/properties/sortBy/type", keyword: "type", params: { type: "array" }, message: "must be array", schema: schema22.properties.sortBy.type, parentSchema: schema22.properties.sortBy, data: data7 };
var err19 = { instancePath: instancePath + "/sortBy", schemaPath: "#/properties/sortBy/type", keyword: "type", params: { type: "array" }, message: "must be array", schema: schema22.properties.sortBy.type, parentSchema: schema22.properties.sortBy, data: data8 };
if (vErrors === null) {
vErrors = [err18];
vErrors = [err19];
}
else {
vErrors.push(err18);
vErrors.push(err19);
}

@@ -280,8 +293,8 @@ errors++;

else {
var err19 = { instancePath: instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object", schema: schema22.type, parentSchema: schema22, data: data };
var err20 = { instancePath: instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object", schema: schema22.type, parentSchema: schema22, data: data };
if (vErrors === null) {
vErrors = [err19];
vErrors = [err20];
}
else {
vErrors.push(err19);
vErrors.push(err20);
}

@@ -288,0 +301,0 @@ errors++;

import { HttpClient } from '@attraqt/http-client-common';
import { ProductSuggestOptions, SearchOptions, SearchResponse } from './models';
import { ProductSuggestOptions, SearchContext, SearchOptions, SearchResponse } from './models';
/**

@@ -14,4 +14,4 @@ * Search module.

init(options: SearchInitOptions, httpClient?: HttpClient): void;
query(query: string, options?: SearchOptions, requestOptions?: SearchRequestOptions): Promise<SearchResponse>;
suggest(query: string, options?: ProductSuggestOptions, requestOptions?: SearchRequestOptions): Promise<SearchResponse>;
query(query: string, options?: SearchOptions, requestOptions?: SearchRequestOptions, context?: SearchContext): Promise<SearchResponse>;
suggest(query: string, options?: ProductSuggestOptions, requestOptions?: SearchRequestOptions, context?: SearchContext): Promise<SearchResponse>;
private sendRequest;

@@ -18,0 +18,0 @@ private assertIsInit;

@@ -55,2 +55,3 @@ "use strict";

var validateSearchOptionsSchema_1 = __importDefault(require("./models/validateSearchOptionsSchema"));
var validateSearchContextSchema_1 = __importDefault(require("./models/validateSearchContextSchema"));
var validateSuggestOptionsSchema_1 = __importDefault(require("./models/validateSuggestOptionsSchema"));

@@ -75,3 +76,3 @@ /**

};
Search.prototype.query = function (query, options, requestOptions) {
Search.prototype.query = function (query, options, requestOptions, context) {
return __awaiter(this, void 0, void 0, function () {

@@ -81,9 +82,12 @@ return __generator(this, function (_a) {

if (options && !validateSearchOptionsSchema_1.default(options)) {
throw Error("The provided search options don't match the required format.");
throw Error("The provided search options doesn't match the required format.");
}
return [2 /*return*/, this.sendRequest('/search', query, options, requestOptions)];
if (context && !validateSearchContextSchema_1.default(context)) {
throw Error("The provided search context doesn't match the required format.");
}
return [2 /*return*/, this.sendRequest('/search', query, options, context, requestOptions)];
});
});
};
Search.prototype.suggest = function (query, options, requestOptions) {
Search.prototype.suggest = function (query, options, requestOptions, context) {
return __awaiter(this, void 0, void 0, function () {

@@ -95,7 +99,10 @@ return __generator(this, function (_a) {

}
return [2 /*return*/, this.sendRequest('/search/suggest', query, options, requestOptions)];
if (context && !validateSearchContextSchema_1.default(context)) {
throw Error("The provided search context doesn't match the required format.");
}
return [2 /*return*/, this.sendRequest('/search/suggest', query, options, context, requestOptions)];
});
});
};
Search.prototype.sendRequest = function (path, query, options, requestOptions) {
Search.prototype.sendRequest = function (path, query, options, context, requestOptions) {
return __awaiter(this, void 0, void 0, function () {

@@ -109,3 +116,4 @@ var request, response;

token: this.token,
options: options
options: options,
context: context
}) }, requestOptions);

@@ -112,0 +120,0 @@ return [4 /*yield*/, this.httpClient.send(request)];

{
"name": "@attraqt/search",
"version": "1.5.1",
"version": "1.6.0",
"license": "MIT",

@@ -17,8 +17,10 @@ "repository": "git://github.com:Attraqt/attraqt-js.git",

"scripts": {
"generate-json-schemas-search": "typescript-json-schema ./src/models/search.ts SearchOptions --out ./src/models/search-options.schema.json --required --noExtraProps",
"generate-json-schemas-suggest": "typescript-json-schema ./src/models/suggest.ts ProductSuggestOptions --out ./src/models/suggest-options.schema.json --required --noExtraProps",
"generate-json-schemas": "npm run generate-json-schemas-search && npm run generate-json-schemas-suggest",
"generate-validation-search": "ajv compile -s ./src/models/search-options.schema.json -o ./src/models/validateSearchOptionsSchema.js --strict=true --all-errors --verbose --comment --code-es5 --allow-union-types",
"generate-validation-suggest": "ajv compile -s ./src/models/suggest-options.schema.json -o ./src/models/validateSuggestOptionsSchema.js --strict=true --all-errors --verbose --comment --code-es5 --allow-union-types",
"generate-validation": "npm run generate-validation-search && npm run generate-validation-suggest",
"generate-json-schemas-search-options": "typescript-json-schema ./src/models/search.ts SearchOptions --out ./src/models/search-options.schema.json --required --noExtraProps",
"generate-json-schemas-search-context": "typescript-json-schema ./src/models/search.ts SearchContext --out ./src/models/search-context.schema.json --required --noExtraProps",
"generate-json-schemas-suggest-options": "typescript-json-schema ./src/models/suggest.ts ProductSuggestOptions --out ./src/models/suggest-options.schema.json --required --noExtraProps",
"generate-json-schemas": "npm run generate-json-schemas-search-options && npm run generate-json-schemas-search-context && npm run generate-json-schemas-suggest-options",
"generate-validation-search-options": "ajv compile -s ./src/models/search-options.schema.json -o ./src/models/validateSearchOptionsSchema.js --strict=true --all-errors --verbose --comment --code-es5 --allow-union-types",
"generate-validation-search-context": "ajv compile -s ./src/models/search-context.schema.json -o ./src/models/validateSearchContextSchema.js --strict=true --all-errors --verbose --comment --code-es5 --allow-union-types",
"generate-validation-suggest-options": "ajv compile -s ./src/models/suggest-options.schema.json -o ./src/models/validateSuggestOptionsSchema.js --strict=true --all-errors --verbose --comment --code-es5 --allow-union-types",
"generate-validation": "npm run generate-validation-search-options && npm run generate-validation-search-context && npm run generate-validation-suggest-options",
"copy-json-schemas": "cp ./src/models/*.schema.json ./dist/models",

@@ -36,3 +38,3 @@ "build": "npm run generate-json-schemas && npm run generate-validation && npm run clean && npm run compile && npm run copy-json-schemas",

"@attraqt/http-client-node": "^1.5.1",
"@attraqt/search-commons": "^1.6.0"
"@attraqt/search-commons": "1.11.0"
},

@@ -47,3 +49,3 @@ "devDependencies": {

},
"gitHead": "8b34ce85a3ea8cc45aa410b3fea690aa0631d310"
"gitHead": "d04411f25d312dd80584c25468d7df5b6edb7d64"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc