Socket
Socket
Sign inDemoInstall

@sajari/sdk-node

Package Overview
Dependencies
47
Maintainers
5
Versions
49
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.0-alpha.6 to 4.0.0-alpha.7

build/src/api-util 2.d.ts

6

build/src/client.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Client = exports.withKeyCredentials = exports.withEndpoint = void 0;
exports.withEndpoint = (endpoint) => (client) => {
const withEndpoint = (endpoint) => (client) => {
client.endpoint = endpoint;
};
exports.withKeyCredentials = (keyId, keySecret) => (client) => {
exports.withEndpoint = withEndpoint;
const withKeyCredentials = (keyId, keySecret) => (client) => {
client.keyId = keyId;
client.keySecret = keySecret;
};
exports.withKeyCredentials = withKeyCredentials;
class Client {

@@ -12,0 +14,0 @@ constructor(...options) {

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

import { CollectionsApi, V4beta1QueryCollectionRequest } from "../src/generated/api";
import { Client } from "./client";
import { CollectionsApi, Collection, QueryCollectionRequest } from "./generated/api";
export { withEndpoint, withKeyCredentials } from "./client";

@@ -7,13 +7,28 @@ export declare class CollectionsClient extends Client {

constructor(...options: Array<(client: Client) => void>);
getCollection(id: string): Promise<import("./generated/api").V4beta1Collection>;
getCollection(id: string): Promise<Collection>;
listCollections({ pageSize, pageToken, }: {
pageSize?: number;
pageToken?: string;
}): Promise<import("./generated/api").V4beta1ListCollectionsResponse>;
}): Promise<import("./generated/api").ListCollectionsResponse>;
createCollection({ id, displayName, }: {
id?: string;
id: string;
displayName: string;
}): Promise<import("./generated/api").V4beta1Collection>;
queryCollection(id: string, request: V4beta1QueryCollectionRequest): Promise<import("./generated/api").V4beta1QueryCollectionResponse>;
}): Promise<{
id: string;
accountId?: string | undefined;
createTime?: Date | undefined;
displayName: string;
authorizedQueryDomains?: string[] | undefined;
}>;
updateCollection(id: string, ...options: Array<(c: Collection, updateMask: Record<string, boolean>) => void>): Promise<{
id: string;
accountId?: string | undefined;
createTime?: Date | undefined;
displayName: string;
authorizedQueryDomains?: string[] | undefined;
}>;
queryCollection(id: string, request: QueryCollectionRequest): Promise<import("./generated/api").QueryCollectionResponse>;
deleteCollection(id: string): Promise<any>;
}
export declare const setCollectionDisplayName: (displayName: string) => (c: Collection, updateMask: Record<string, boolean>) => void;
export declare const setCollectionAuthorizedQueryDomains: (domains: string[]) => (c: Collection, updateMask: Record<string, boolean>) => void;
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CollectionsClient = exports.withKeyCredentials = exports.withEndpoint = void 0;
const ksuid_1 = __importDefault(require("ksuid"));
const api_1 = require("../src/generated/api");
exports.setCollectionAuthorizedQueryDomains = exports.setCollectionDisplayName = exports.CollectionsClient = exports.withKeyCredentials = exports.withEndpoint = void 0;
const client_1 = require("./client");
const api_1 = require("./generated/api");
const user_agent_1 = require("./user-agent");
const api_util_1 = require("./api-util");
var client_2 = require("./client");

@@ -19,6 +17,14 @@ Object.defineProperty(exports, "withEndpoint", { enumerable: true, get: function () { return client_2.withEndpoint; } });

this.client.password = this.keySecret;
this.client.defaultHeaders = {
[user_agent_1.clientUserAgentHeader]: user_agent_1.clientUserAgent(),
};
}
async getCollection(id) {
const res = await this.client.getCollection(id);
return res.body;
try {
const res = await this.client.getCollection(id);
return res.body;
}
catch (e) {
throw api_util_1.handleError(e);
}
}

@@ -31,34 +37,67 @@ async listCollections({ pageSize, pageToken, }) {

catch (e) {
if (e instanceof api_1.HttpError) {
console.error(JSON.stringify(e.response));
// TODO(jingram): wrap common errors
}
throw e;
throw api_util_1.handleError(e);
}
}
async createCollection({
// FIXME(jingram): ideally want to use _, but it's not allowed.
id = `col-${ksuid_1.default.randomSync().string}`, displayName, }) {
async createCollection({ id, displayName, }) {
try {
const res = await this.client.createCollection(id, { displayName });
return res.body;
// OpenAPI readonly fields become optional TS fields, but we know the API
// will return it, so use ! to fix the types. This is done so upstream
// users don't have to do this.
return { ...res.body, id: res.body.id };
}
catch (e) {
if (e instanceof api_1.HttpError) {
console.error(JSON.stringify(e.response));
// TODO(jingram): wrap common errors, e.g. already exists
}
throw e;
throw api_util_1.handleError(e);
}
}
async updateCollection(id, ...options) {
const c = {
displayName: "",
};
const updateMask = {};
for (const opt of options) {
opt(c, updateMask);
}
const um = Object.keys(updateMask).map((field) => field);
try {
const res = await this.client.updateCollection(id, c, um.join(","));
// OpenAPI readonly fields become optional TS fields, but we know the API
// will return it, so use ! to fix the types. This is done so upstream
// users don't have to do this.
return { ...res.body, id: res.body.id };
}
catch (e) {
throw api_util_1.handleError(e);
}
}
async queryCollection(id, request) {
const res = await this.client.queryCollection(id, request);
return res.body;
try {
const res = await this.client.queryCollection(id, request);
return res.body;
}
catch (e) {
throw api_util_1.handleError(e);
}
}
async deleteCollection(id) {
const res = await this.client.deleteCollection(id);
return res.body;
try {
const res = await this.client.deleteCollection(id);
return res.body;
}
catch (e) {
throw api_util_1.handleError(e);
}
}
}
exports.CollectionsClient = CollectionsClient;
const setCollectionDisplayName = (displayName) => (c, updateMask) => {
c.displayName = displayName;
updateMask["display_name"] = true;
};
exports.setCollectionDisplayName = setCollectionDisplayName;
const setCollectionAuthorizedQueryDomains = (domains) => (c, updateMask) => {
c.authorizedQueryDomains = domains;
updateMask["authorized_query_domains"] = true;
};
exports.setCollectionAuthorizedQueryDomains = setCollectionAuthorizedQueryDomains;
//# sourceMappingURL=collections.js.map
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const ksuid_1 = __importDefault(require("ksuid"));
const collections_1 = require("./collections");
const test_util_1 = require("./test-util");
const _client = createClient();
if (!_client) {
test_util_1.skipSuite("Set TEST_ACCOUNT_KEY_ID and TEST_ACCOUNT_KEY_SECRET to run test");
}
const client = _client;
function createClient() {
if (!(process.env.TEST_ACCOUNT_KEY_ID && process.env.TEST_ACCOUNT_KEY_SECRET)) {
return;
}
return new collections_1.CollectionsClient(collections_1.withKeyCredentials(process.env.TEST_ACCOUNT_KEY_ID, process.env.TEST_ACCOUNT_KEY_SECRET));
}
async function createCollection(displayName) {
const collection = await client.createCollection({ displayName });
await client.deleteCollection(collection.id); // TODO(jingram): remove ! once types are fixed.
}
const server_1 = require("./test/server");
const api_util_1 = require("./test/api-util");
const _1 = require(".");
jest.mock("../package.json", () => ({
version: "1.2.3",
}), { virtual: true });
const createClient = () => new collections_1.CollectionsClient(collections_1.withKeyCredentials("test-key-id", "test-key-secret"));
const newId = () => `col-${ksuid_1.default.randomSync().string}`;
test("create collection", async () => {
jest.setTimeout(10000); // create can take longer than the default 5s
await createCollection("My collection");
const client = createClient();
await client.createCollection({ id: newId(), displayName: "My collection" });
});
test("server error turns into thrown APIError", async () => {
server_1.server.use(server_1.rest.post(`${api_util_1.endpoint}/v4/collections`, async (req, res, ctx) => res(ctx.status(400), ctx.json(api_util_1.errorResponse(3, "msg")))));
const client = createClient();
try {
await client.createCollection({
id: newId(),
displayName: "My collection",
});
}
catch (e) {
expect(e).toBeInstanceOf(_1.APIError);
expect(e).toEqual(expect.objectContaining({
code: 3,
message: "msg",
}));
}
});
test("sends client user agent header", async () => {
let header = null;
server_1.server.use(server_1.rest.delete(`${api_util_1.endpoint}/v4/collections/:id`, (req, res, ctx) => {
header = req.headers.get("sajari-client-user-agent");
return res(ctx.json({}));
}));
const client = createClient();
await client.deleteCollection(newId());
expect(header).toEqual("sajari-sdk-node/1.2.3");
});
//# sourceMappingURL=collections.test.js.map

@@ -5,3 +5,3 @@ /**

*
* The version of the OpenAPI document: v4beta1
* The version of the OpenAPI document: v4
* Contact: support@sajari.com

@@ -15,6 +15,6 @@ *

import http from "http";
import { V4beta1Collection } from "../model/v4beta1Collection";
import { V4beta1ListCollectionsResponse } from "../model/v4beta1ListCollectionsResponse";
import { V4beta1QueryCollectionRequest } from "../model/v4beta1QueryCollectionRequest";
import { V4beta1QueryCollectionResponse } from "../model/v4beta1QueryCollectionResponse";
import { Collection } from "../model/collection";
import { ListCollectionsResponse } from "../model/listCollectionsResponse";
import { QueryCollectionRequest } from "../model/queryCollectionRequest";
import { QueryCollectionResponse } from "../model/queryCollectionResponse";
import { Authentication, Interceptor } from "../model/models";

@@ -49,5 +49,5 @@ import { HttpBasicAuth } from "../model/models";

* @param collectionId The ID to use for the collection. This must start with an alphanumeric character followed by one or more alphanumeric or &#x60;-&#x60; characters. Strictly speaking, it must match the regular expression: &#x60;^[A-Za-z][A-Za-z0-9\\-]*$&#x60;.
* @param v4beta1Collection Details of the collection to create.
* @param collection Details of the collection to create.
*/
createCollection(collectionId: string, v4beta1Collection: V4beta1Collection, options?: {
createCollection(collectionId: string, collection: Collection, options?: {
headers: {

@@ -58,3 +58,3 @@ [name: string]: string;

response: http.IncomingMessage;
body: V4beta1Collection;
body: Collection;
}>;

@@ -85,3 +85,3 @@ /**

response: http.IncomingMessage;
body: V4beta1Collection;
body: Collection;
}>;

@@ -100,3 +100,3 @@ /**

response: http.IncomingMessage;
body: V4beta1ListCollectionsResponse;
body: ListCollectionsResponse;
}>;

@@ -107,5 +107,5 @@ /**

* @param collectionId The collection to query, e.g. &#x60;my-collection&#x60;.
* @param v4beta1QueryCollectionRequest
* @param queryCollectionRequest
*/
queryCollection(collectionId: string, v4beta1QueryCollectionRequest: V4beta1QueryCollectionRequest, options?: {
queryCollection(collectionId: string, queryCollectionRequest: QueryCollectionRequest, options?: {
headers: {

@@ -116,4 +116,19 @@ [name: string]: string;

response: http.IncomingMessage;
body: V4beta1QueryCollectionResponse;
body: QueryCollectionResponse;
}>;
/**
* Update the details of a collection.
* @summary Update collection
* @param collectionId The collection to update, e.g. &#x60;my-collection&#x60;.
* @param collection Details of the collection to update.
* @param updateMask The list of fields to be updated, separated by a comma, e.g. &#x60;field1,field2&#x60;. Each field should be in snake case, e.g. &#x60;display_name&#x60;. For each field that you want to update, provide a corresponding value in the collection object containing the new value.
*/
updateCollection(collectionId: string, collection: Collection, updateMask?: string, options?: {
headers: {
[name: string]: string;
};
}): Promise<{
response: http.IncomingMessage;
body: Collection;
}>;
}

@@ -6,3 +6,3 @@ "use strict";

*
* The version of the OpenAPI document: v4beta1
* The version of the OpenAPI document: v4
* Contact: support@sajari.com

@@ -87,6 +87,6 @@ *

* @param collectionId The ID to use for the collection. This must start with an alphanumeric character followed by one or more alphanumeric or &#x60;-&#x60; characters. Strictly speaking, it must match the regular expression: &#x60;^[A-Za-z][A-Za-z0-9\\-]*$&#x60;.
* @param v4beta1Collection Details of the collection to create.
* @param collection Details of the collection to create.
*/
async createCollection(collectionId, v4beta1Collection, options = { headers: {} }) {
const localVarPath = this.basePath + "/v4beta1/collections";
async createCollection(collectionId, collection, options = { headers: {} }) {
const localVarPath = this.basePath + "/v4/collections";
let localVarQueryParameters = {};

@@ -107,5 +107,5 @@ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);

}
// verify required parameter 'v4beta1Collection' is not null or undefined
if (v4beta1Collection === null || v4beta1Collection === undefined) {
throw new Error("Required parameter v4beta1Collection was null or undefined when calling createCollection.");
// verify required parameter 'collection' is not null or undefined
if (collection === null || collection === undefined) {
throw new Error("Required parameter collection was null or undefined when calling createCollection.");
}

@@ -124,3 +124,3 @@ if (collectionId !== undefined) {

json: true,
body: models_1.ObjectSerializer.serialize(v4beta1Collection, "V4beta1Collection"),
body: models_1.ObjectSerializer.serialize(collection, "Collection"),
};

@@ -152,3 +152,3 @@ let authenticationPromise = Promise.resolve();

else {
body = models_1.ObjectSerializer.deserialize(body, "V4beta1Collection");
body = models_1.ObjectSerializer.deserialize(body, "Collection");
if (response.statusCode &&

@@ -174,3 +174,3 @@ response.statusCode >= 200 &&

const localVarPath = this.basePath +
"/v4beta1/collections/{collection_id}".replace(/{\w+}/, String(collectionId));
"/v4/collections/{collection_id}".replace("{" + "collection_id" + "}", encodeURIComponent(String(collectionId)));
let localVarQueryParameters = {};

@@ -247,3 +247,3 @@ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);

const localVarPath = this.basePath +
"/v4beta1/collections/{collection_id}".replace(/{\w+}/, String(collectionId));
"/v4/collections/{collection_id}".replace("{" + "collection_id" + "}", encodeURIComponent(String(collectionId)));
let localVarQueryParameters = {};

@@ -299,3 +299,3 @@ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);

else {
body = models_1.ObjectSerializer.deserialize(body, "V4beta1Collection");
body = models_1.ObjectSerializer.deserialize(body, "Collection");
if (response.statusCode &&

@@ -321,3 +321,3 @@ response.statusCode >= 200 &&

async listCollections(pageSize, pageToken, options = { headers: {} }) {
const localVarPath = this.basePath + "/v4beta1/collections";
const localVarPath = this.basePath + "/v4/collections";
let localVarQueryParameters = {};

@@ -375,3 +375,3 @@ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);

else {
body = models_1.ObjectSerializer.deserialize(body, "V4beta1ListCollectionsResponse");
body = models_1.ObjectSerializer.deserialize(body, "ListCollectionsResponse");
if (response.statusCode &&

@@ -394,7 +394,7 @@ response.statusCode >= 200 &&

* @param collectionId The collection to query, e.g. &#x60;my-collection&#x60;.
* @param v4beta1QueryCollectionRequest
* @param queryCollectionRequest
*/
async queryCollection(collectionId, v4beta1QueryCollectionRequest, options = { headers: {} }) {
async queryCollection(collectionId, queryCollectionRequest, options = { headers: {} }) {
const localVarPath = this.basePath +
"/v4beta1/collections/{collection_id}:queryCollection".replace(/{\w+}/, String(collectionId));
"/v4/collections/{collection_id}:queryCollection".replace("{" + "collection_id" + "}", encodeURIComponent(String(collectionId)));
let localVarQueryParameters = {};

@@ -415,6 +415,6 @@ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);

}
// verify required parameter 'v4beta1QueryCollectionRequest' is not null or undefined
if (v4beta1QueryCollectionRequest === null ||
v4beta1QueryCollectionRequest === undefined) {
throw new Error("Required parameter v4beta1QueryCollectionRequest was null or undefined when calling queryCollection.");
// verify required parameter 'queryCollectionRequest' is not null or undefined
if (queryCollectionRequest === null ||
queryCollectionRequest === undefined) {
throw new Error("Required parameter queryCollectionRequest was null or undefined when calling queryCollection.");
}

@@ -430,3 +430,3 @@ Object.assign(localVarHeaderParams, options.headers);

json: true,
body: models_1.ObjectSerializer.serialize(v4beta1QueryCollectionRequest, "V4beta1QueryCollectionRequest"),
body: models_1.ObjectSerializer.serialize(queryCollectionRequest, "QueryCollectionRequest"),
};

@@ -458,3 +458,3 @@ let authenticationPromise = Promise.resolve();

else {
body = models_1.ObjectSerializer.deserialize(body, "V4beta1QueryCollectionResponse");
body = models_1.ObjectSerializer.deserialize(body, "QueryCollectionResponse");
if (response.statusCode &&

@@ -473,4 +473,86 @@ response.statusCode >= 200 &&

}
/**
* Update the details of a collection.
* @summary Update collection
* @param collectionId The collection to update, e.g. &#x60;my-collection&#x60;.
* @param collection Details of the collection to update.
* @param updateMask The list of fields to be updated, separated by a comma, e.g. &#x60;field1,field2&#x60;. Each field should be in snake case, e.g. &#x60;display_name&#x60;. For each field that you want to update, provide a corresponding value in the collection object containing the new value.
*/
async updateCollection(collectionId, collection, updateMask, options = { headers: {} }) {
const localVarPath = this.basePath +
"/v4/collections/{collection_id}".replace("{" + "collection_id" + "}", encodeURIComponent(String(collectionId)));
let localVarQueryParameters = {};
let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
const produces = ["application/json"];
// give precedence to 'application/json'
if (produces.indexOf("application/json") >= 0) {
localVarHeaderParams.Accept = "application/json";
}
else {
localVarHeaderParams.Accept = produces.join(",");
}
let localVarFormParams = {};
// verify required parameter 'collectionId' is not null or undefined
if (collectionId === null || collectionId === undefined) {
throw new Error("Required parameter collectionId was null or undefined when calling updateCollection.");
}
// verify required parameter 'collection' is not null or undefined
if (collection === null || collection === undefined) {
throw new Error("Required parameter collection was null or undefined when calling updateCollection.");
}
if (updateMask !== undefined) {
localVarQueryParameters["update_mask"] = models_1.ObjectSerializer.serialize(updateMask, "string");
}
Object.assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions = {
method: "PATCH",
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: models_1.ObjectSerializer.serialize(collection, "Collection"),
};
let authenticationPromise = Promise.resolve();
if (this.authentications.BasicAuth.username &&
this.authentications.BasicAuth.password) {
authenticationPromise = authenticationPromise.then(() => this.authentications.BasicAuth.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
localVarRequestOptions.formData = localVarFormParams;
}
else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise((resolve, reject) => {
request_1.default(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
}
else {
body = models_1.ObjectSerializer.deserialize(body, "Collection");
if (response.statusCode &&
response.statusCode >= 200 &&
response.statusCode <= 299) {
resolve({ response: response, body: body });
}
else {
reject(new apis_1.HttpError(response, body, response.statusCode));
}
}
});
});
});
}
}
exports.CollectionsApi = CollectionsApi;
//# sourceMappingURL=collectionsApi.js.map

@@ -5,3 +5,3 @@ /**

*
* The version of the OpenAPI document: v4beta1
* The version of the OpenAPI document: v4
* Contact: support@sajari.com

@@ -15,8 +15,9 @@ *

import http from "http";
import { Sajariv4beta1Pipeline1 } from "../model/sajariv4beta1Pipeline1";
import { V4beta1GeneratePipelinesRequest } from "../model/v4beta1GeneratePipelinesRequest";
import { V4beta1GeneratePipelinesResponse } from "../model/v4beta1GeneratePipelinesResponse";
import { V4beta1ListPipelinesResponse } from "../model/v4beta1ListPipelinesResponse";
import { V4beta1SetDefaultPipelineRequest } from "../model/v4beta1SetDefaultPipelineRequest";
import { V4beta1SetDefaultVersionRequest } from "../model/v4beta1SetDefaultVersionRequest";
import { GeneratePipelinesRequest } from "../model/generatePipelinesRequest";
import { GeneratePipelinesResponse } from "../model/generatePipelinesResponse";
import { GetDefaultPipelineResponse } from "../model/getDefaultPipelineResponse";
import { ListPipelinesResponse } from "../model/listPipelinesResponse";
import { Pipeline } from "../model/pipeline";
import { SetDefaultPipelineRequest } from "../model/setDefaultPipelineRequest";
import { SetDefaultVersionRequest } from "../model/setDefaultVersionRequest";
import { Authentication, Interceptor } from "../model/models";

@@ -51,5 +52,5 @@ import { HttpBasicAuth } from "../model/models";

* @param collectionId The collection to create the pipeline in, e.g. &#x60;my-collection&#x60;.
* @param sajariv4beta1Pipeline1 The pipeline to create.
* @param pipeline The pipeline to create.
*/
createPipeline(collectionId: string, sajariv4beta1Pipeline1: Sajariv4beta1Pipeline1, options?: {
createPipeline(collectionId: string, pipeline: Pipeline, options?: {
headers: {

@@ -60,3 +61,3 @@ [name: string]: string;

response: http.IncomingMessage;
body: Sajariv4beta1Pipeline1;
body: Pipeline;
}>;

@@ -67,5 +68,5 @@ /**

* @param collectionId The collection, e.g. &#x60;my-collection&#x60;.
* @param v4beta1GeneratePipelinesRequest
* @param generatePipelinesRequest
*/
generatePipelines(collectionId: string, v4beta1GeneratePipelinesRequest: V4beta1GeneratePipelinesRequest, options?: {
generatePipelines(collectionId: string, generatePipelinesRequest: GeneratePipelinesRequest, options?: {
headers: {

@@ -76,9 +77,39 @@ [name: string]: string;

response: http.IncomingMessage;
body: V4beta1GeneratePipelinesResponse;
body: GeneratePipelinesResponse;
}>;
/**
* Get the default pipeline for a collection. Every collection has a default record pipeline and a default query pipeline. When a pipeline is required to complete an operation, it can be omitted from the request if a default pipeline has been set. When adding a record to a collection, the default record pipeline is used if none is provided. When querying a collection, the default query pipeline is used if none is provided.
* @summary Get default pipeline
* @param collectionId The collection to get the default query pipeline of, e.g. &#x60;my-collection&#x60;.
* @param type The type of the pipeline to get. - TYPE_UNSPECIFIED: Pipeline type not specified. - RECORD: Record pipeline. - QUERY: Query pipeline.
*/
getDefaultPipeline(collectionId: string, type: "TYPE_UNSPECIFIED" | "RECORD" | "QUERY", options?: {
headers: {
[name: string]: string;
};
}): Promise<{
response: http.IncomingMessage;
body: GetDefaultPipelineResponse;
}>;
/**
* Get the default version for a given pipeline. The default version of a pipeline is used when a pipeline is referred to without specifying a version. This allows you to change the pipeline version used for requests without having to change your code. To retrieve the pipeline in YAML, set the request\'s `Accept` header to `application/yaml`.
* @summary Get default pipeline version
* @param collectionId The collection that owns the pipeline to get the default version of, e.g. &#x60;my-collection&#x60;.
* @param type The type of the pipeline to get the default version of.
* @param name The name of the pipeline to get the default version of, e.g. &#x60;my-pipeline&#x60;.
* @param view The amount of information to include in the retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the &#x60;BASIC&#x60; view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/docs/api-reference#operation/ListPipelines) and [GetPipeline](/docs/api-reference#operation/GetPipeline)). - FULL: Include the information from &#x60;BASIC&#x60;, plus full step configuration.
*/
getDefaultVersion(collectionId: string, type: "TYPE_UNSPECIFIED" | "RECORD" | "QUERY", name: string, view?: "VIEW_UNSPECIFIED" | "BASIC" | "FULL", options?: {
headers: {
[name: string]: string;
};
}): Promise<{
response: http.IncomingMessage;
body: Pipeline;
}>;
/**
* Retrieve the details of a pipeline. Supply the type, name and version. To retrieve the pipeline in YAML, set the request\'s `Accept` header to `application/yaml`.
* @summary Get pipeline
* @param collectionId The collection that owns the pipeline, e.g. &#x60;my-collection&#x60;.
* @param type The type of the pipeline to retrieve, either &#x60;record&#x60; or &#x60;query&#x60;.
* @param type The type of the pipeline to retrieve.
* @param name The name of the pipeline to retrieve, e.g. &#x60;my-pipeline&#x60;.

@@ -88,3 +119,3 @@ * @param version The version of the pipeline to retrieve, e.g. &#x60;42&#x60;.

*/
getPipeline(collectionId: string, type: string, name: string, version: string, view?: "VIEW_UNSPECIFIED" | "BASIC" | "FULL", options?: {
getPipeline(collectionId: string, type: "TYPE_UNSPECIFIED" | "RECORD" | "QUERY", name: string, version: string, view?: "VIEW_UNSPECIFIED" | "BASIC" | "FULL", options?: {
headers: {

@@ -95,3 +126,3 @@ [name: string]: string;

response: http.IncomingMessage;
body: Sajariv4beta1Pipeline1;
body: Pipeline;
}>;

@@ -112,11 +143,11 @@ /**

response: http.IncomingMessage;
body: V4beta1ListPipelinesResponse;
body: ListPipelinesResponse;
}>;
/**
* Set the default pipeline for a collection. Every collection has a default `record` pipeline and a default `query` pipeline. When a pipeline is required to complete an operation, it can be omitted from the request if a default pipeline has been set. When adding a record to a collection, the default `record` pipeline is used if none is provided. When querying a collection, the default `query` pipeline is used if none is provided. Once a default pipeline has been set it cannot be cleared, only set to another pipeline.
* Set the default pipeline for a collection. Every collection has a default record pipeline and a default query pipeline. When a pipeline is required to complete an operation, it can be omitted from the request if a default pipeline has been set. When adding a record to a collection, the default record pipeline is used if none is provided. When querying a collection, the default query pipeline is used if none is provided. Once a default pipeline has been set it cannot be cleared, only set to another pipeline.
* @summary Set default pipeline
* @param collectionId The collection to set the default query pipeline of, e.g. &#x60;my-collection&#x60;.
* @param v4beta1SetDefaultPipelineRequest
* @param setDefaultPipelineRequest
*/
setDefaultPipeline(collectionId: string, v4beta1SetDefaultPipelineRequest: V4beta1SetDefaultPipelineRequest, options?: {
setDefaultPipeline(collectionId: string, setDefaultPipelineRequest: SetDefaultPipelineRequest, options?: {
headers: {

@@ -130,10 +161,10 @@ [name: string]: string;

/**
* Set the default version for a given pipeline. The default version of a pipeline allows you to refer to a pipeline without having to specify a version. This means you can change the pipeline version used for requests without having to change your code.
* Set the default version for a given pipeline. The default version of a pipeline is used when a pipeline is referred to without specifying a version. This allows you to change the pipeline version used for requests without having to change your code.
* @summary Set default pipeline version
* @param collectionId The collection that owns the pipeline to set the default version of, e.g. &#x60;my-collection&#x60;.
* @param type The type of the pipeline to set the default version of, either &#x60;record&#x60; or &#x60;query&#x60;.
* @param type The type of the pipeline to set the default version of.
* @param name The name of the pipeline to set the default version of, e.g. &#x60;my-pipeline&#x60;.
* @param v4beta1SetDefaultVersionRequest
* @param setDefaultVersionRequest
*/
setDefaultVersion(collectionId: string, type: string, name: string, v4beta1SetDefaultVersionRequest: V4beta1SetDefaultVersionRequest, options?: {
setDefaultVersion(collectionId: string, type: "TYPE_UNSPECIFIED" | "RECORD" | "QUERY", name: string, setDefaultVersionRequest: SetDefaultVersionRequest, options?: {
headers: {

@@ -140,0 +171,0 @@ [name: string]: string;

@@ -6,3 +6,3 @@ "use strict";

*
* The version of the OpenAPI document: v4beta1
* The version of the OpenAPI document: v4
* Contact: support@sajari.com

@@ -87,7 +87,7 @@ *

* @param collectionId The collection to create the pipeline in, e.g. &#x60;my-collection&#x60;.
* @param sajariv4beta1Pipeline1 The pipeline to create.
* @param pipeline The pipeline to create.
*/
async createPipeline(collectionId, sajariv4beta1Pipeline1, options = { headers: {} }) {
async createPipeline(collectionId, pipeline, options = { headers: {} }) {
const localVarPath = this.basePath +
"/v4beta1/collections/{collection_id}/pipelines".replace(/{\w+}/, String(collectionId));
"/v4/collections/{collection_id}/pipelines".replace("{" + "collection_id" + "}", encodeURIComponent(String(collectionId)));
let localVarQueryParameters = {};

@@ -108,6 +108,5 @@ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);

}
// verify required parameter 'sajariv4beta1Pipeline1' is not null or undefined
if (sajariv4beta1Pipeline1 === null ||
sajariv4beta1Pipeline1 === undefined) {
throw new Error("Required parameter sajariv4beta1Pipeline1 was null or undefined when calling createPipeline.");
// verify required parameter 'pipeline' is not null or undefined
if (pipeline === null || pipeline === undefined) {
throw new Error("Required parameter pipeline was null or undefined when calling createPipeline.");
}

@@ -123,3 +122,3 @@ Object.assign(localVarHeaderParams, options.headers);

json: true,
body: models_1.ObjectSerializer.serialize(sajariv4beta1Pipeline1, "Sajariv4beta1Pipeline1"),
body: models_1.ObjectSerializer.serialize(pipeline, "Pipeline"),
};

@@ -151,3 +150,3 @@ let authenticationPromise = Promise.resolve();

else {
body = models_1.ObjectSerializer.deserialize(body, "Sajariv4beta1Pipeline1");
body = models_1.ObjectSerializer.deserialize(body, "Pipeline");
if (response.statusCode &&

@@ -170,7 +169,7 @@ response.statusCode >= 200 &&

* @param collectionId The collection, e.g. &#x60;my-collection&#x60;.
* @param v4beta1GeneratePipelinesRequest
* @param generatePipelinesRequest
*/
async generatePipelines(collectionId, v4beta1GeneratePipelinesRequest, options = { headers: {} }) {
async generatePipelines(collectionId, generatePipelinesRequest, options = { headers: {} }) {
const localVarPath = this.basePath +
"/v4beta1/collections/{collection_id}:generatePipelines".replace(/{\w+}/, String(collectionId));
"/v4/collections/{collection_id}:generatePipelines".replace("{" + "collection_id" + "}", encodeURIComponent(String(collectionId)));
let localVarQueryParameters = {};

@@ -191,6 +190,6 @@ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);

}
// verify required parameter 'v4beta1GeneratePipelinesRequest' is not null or undefined
if (v4beta1GeneratePipelinesRequest === null ||
v4beta1GeneratePipelinesRequest === undefined) {
throw new Error("Required parameter v4beta1GeneratePipelinesRequest was null or undefined when calling generatePipelines.");
// verify required parameter 'generatePipelinesRequest' is not null or undefined
if (generatePipelinesRequest === null ||
generatePipelinesRequest === undefined) {
throw new Error("Required parameter generatePipelinesRequest was null or undefined when calling generatePipelines.");
}

@@ -206,3 +205,3 @@ Object.assign(localVarHeaderParams, options.headers);

json: true,
body: models_1.ObjectSerializer.serialize(v4beta1GeneratePipelinesRequest, "V4beta1GeneratePipelinesRequest"),
body: models_1.ObjectSerializer.serialize(generatePipelinesRequest, "GeneratePipelinesRequest"),
};

@@ -234,3 +233,3 @@ let authenticationPromise = Promise.resolve();

else {
body = models_1.ObjectSerializer.deserialize(body, "V4beta1GeneratePipelinesResponse");
body = models_1.ObjectSerializer.deserialize(body, "GeneratePipelinesResponse");
if (response.statusCode &&

@@ -250,6 +249,175 @@ response.statusCode >= 200 &&

/**
* Get the default pipeline for a collection. Every collection has a default record pipeline and a default query pipeline. When a pipeline is required to complete an operation, it can be omitted from the request if a default pipeline has been set. When adding a record to a collection, the default record pipeline is used if none is provided. When querying a collection, the default query pipeline is used if none is provided.
* @summary Get default pipeline
* @param collectionId The collection to get the default query pipeline of, e.g. &#x60;my-collection&#x60;.
* @param type The type of the pipeline to get. - TYPE_UNSPECIFIED: Pipeline type not specified. - RECORD: Record pipeline. - QUERY: Query pipeline.
*/
async getDefaultPipeline(collectionId, type, options = { headers: {} }) {
const localVarPath = this.basePath +
"/v4/collections/{collection_id}:getDefaultPipeline".replace("{" + "collection_id" + "}", encodeURIComponent(String(collectionId)));
let localVarQueryParameters = {};
let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
const produces = ["application/json"];
// give precedence to 'application/json'
if (produces.indexOf("application/json") >= 0) {
localVarHeaderParams.Accept = "application/json";
}
else {
localVarHeaderParams.Accept = produces.join(",");
}
let localVarFormParams = {};
// verify required parameter 'collectionId' is not null or undefined
if (collectionId === null || collectionId === undefined) {
throw new Error("Required parameter collectionId was null or undefined when calling getDefaultPipeline.");
}
// verify required parameter 'type' is not null or undefined
if (type === null || type === undefined) {
throw new Error("Required parameter type was null or undefined when calling getDefaultPipeline.");
}
if (type !== undefined) {
localVarQueryParameters["type"] = models_1.ObjectSerializer.serialize(type, "'TYPE_UNSPECIFIED' | 'RECORD' | 'QUERY'");
}
Object.assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions = {
method: "GET",
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
};
let authenticationPromise = Promise.resolve();
if (this.authentications.BasicAuth.username &&
this.authentications.BasicAuth.password) {
authenticationPromise = authenticationPromise.then(() => this.authentications.BasicAuth.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
localVarRequestOptions.formData = localVarFormParams;
}
else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise((resolve, reject) => {
request_1.default(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
}
else {
body = models_1.ObjectSerializer.deserialize(body, "GetDefaultPipelineResponse");
if (response.statusCode &&
response.statusCode >= 200 &&
response.statusCode <= 299) {
resolve({ response: response, body: body });
}
else {
reject(new apis_1.HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
* Get the default version for a given pipeline. The default version of a pipeline is used when a pipeline is referred to without specifying a version. This allows you to change the pipeline version used for requests without having to change your code. To retrieve the pipeline in YAML, set the request\'s `Accept` header to `application/yaml`.
* @summary Get default pipeline version
* @param collectionId The collection that owns the pipeline to get the default version of, e.g. &#x60;my-collection&#x60;.
* @param type The type of the pipeline to get the default version of.
* @param name The name of the pipeline to get the default version of, e.g. &#x60;my-pipeline&#x60;.
* @param view The amount of information to include in the retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the &#x60;BASIC&#x60; view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/docs/api-reference#operation/ListPipelines) and [GetPipeline](/docs/api-reference#operation/GetPipeline)). - FULL: Include the information from &#x60;BASIC&#x60;, plus full step configuration.
*/
async getDefaultVersion(collectionId, type, name, view, options = { headers: {} }) {
const localVarPath = this.basePath +
"/v4/collections/{collection_id}/pipelines/{type}/{name}:getDefaultVersion"
.replace("{" + "collection_id" + "}", encodeURIComponent(String(collectionId)))
.replace("{" + "type" + "}", encodeURIComponent(String(type)))
.replace("{" + "name" + "}", encodeURIComponent(String(name)));
let localVarQueryParameters = {};
let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
const produces = ["application/json", "application/yaml"];
// give precedence to 'application/json'
if (produces.indexOf("application/json") >= 0) {
localVarHeaderParams.Accept = "application/json";
}
else {
localVarHeaderParams.Accept = produces.join(",");
}
let localVarFormParams = {};
// verify required parameter 'collectionId' is not null or undefined
if (collectionId === null || collectionId === undefined) {
throw new Error("Required parameter collectionId was null or undefined when calling getDefaultVersion.");
}
// verify required parameter 'type' is not null or undefined
if (type === null || type === undefined) {
throw new Error("Required parameter type was null or undefined when calling getDefaultVersion.");
}
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new Error("Required parameter name was null or undefined when calling getDefaultVersion.");
}
if (view !== undefined) {
localVarQueryParameters["view"] = models_1.ObjectSerializer.serialize(view, "'VIEW_UNSPECIFIED' | 'BASIC' | 'FULL'");
}
Object.assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions = {
method: "GET",
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
};
let authenticationPromise = Promise.resolve();
if (this.authentications.BasicAuth.username &&
this.authentications.BasicAuth.password) {
authenticationPromise = authenticationPromise.then(() => this.authentications.BasicAuth.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
localVarRequestOptions.formData = localVarFormParams;
}
else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise((resolve, reject) => {
request_1.default(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
}
else {
body = models_1.ObjectSerializer.deserialize(body, "Pipeline");
if (response.statusCode &&
response.statusCode >= 200 &&
response.statusCode <= 299) {
resolve({ response: response, body: body });
}
else {
reject(new apis_1.HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
* Retrieve the details of a pipeline. Supply the type, name and version. To retrieve the pipeline in YAML, set the request\'s `Accept` header to `application/yaml`.
* @summary Get pipeline
* @param collectionId The collection that owns the pipeline, e.g. &#x60;my-collection&#x60;.
* @param type The type of the pipeline to retrieve, either &#x60;record&#x60; or &#x60;query&#x60;.
* @param type The type of the pipeline to retrieve.
* @param name The name of the pipeline to retrieve, e.g. &#x60;my-pipeline&#x60;.

@@ -261,7 +429,7 @@ * @param version The version of the pipeline to retrieve, e.g. &#x60;42&#x60;.

const localVarPath = this.basePath +
"/v4beta1/collections/{collection_id}/pipelines/{type}/{name}/{version}"
.replace(/{\w+}/, String(collectionId))
.replace(/{\w+}/, String(type))
.replace(/{\w+}/, String(name))
.replace(/{\w+}/, String(version));
"/v4/collections/{collection_id}/pipelines/{type}/{name}/{version}"
.replace("{" + "collection_id" + "}", encodeURIComponent(String(collectionId)))
.replace("{" + "type" + "}", encodeURIComponent(String(type)))
.replace("{" + "name" + "}", encodeURIComponent(String(name)))
.replace("{" + "version" + "}", encodeURIComponent(String(version)));
let localVarQueryParameters = {};

@@ -332,3 +500,3 @@ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);

else {
body = models_1.ObjectSerializer.deserialize(body, "Sajariv4beta1Pipeline1");
body = models_1.ObjectSerializer.deserialize(body, "Pipeline");
if (response.statusCode &&

@@ -357,3 +525,3 @@ response.statusCode >= 200 &&

const localVarPath = this.basePath +
"/v4beta1/collections/{collection_id}/pipelines".replace(/{\w+}/, String(collectionId));
"/v4/collections/{collection_id}/pipelines".replace("{" + "collection_id" + "}", encodeURIComponent(String(collectionId)));
let localVarQueryParameters = {};

@@ -418,3 +586,3 @@ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);

else {
body = models_1.ObjectSerializer.deserialize(body, "V4beta1ListPipelinesResponse");
body = models_1.ObjectSerializer.deserialize(body, "ListPipelinesResponse");
if (response.statusCode &&

@@ -434,10 +602,10 @@ response.statusCode >= 200 &&

/**
* Set the default pipeline for a collection. Every collection has a default `record` pipeline and a default `query` pipeline. When a pipeline is required to complete an operation, it can be omitted from the request if a default pipeline has been set. When adding a record to a collection, the default `record` pipeline is used if none is provided. When querying a collection, the default `query` pipeline is used if none is provided. Once a default pipeline has been set it cannot be cleared, only set to another pipeline.
* Set the default pipeline for a collection. Every collection has a default record pipeline and a default query pipeline. When a pipeline is required to complete an operation, it can be omitted from the request if a default pipeline has been set. When adding a record to a collection, the default record pipeline is used if none is provided. When querying a collection, the default query pipeline is used if none is provided. Once a default pipeline has been set it cannot be cleared, only set to another pipeline.
* @summary Set default pipeline
* @param collectionId The collection to set the default query pipeline of, e.g. &#x60;my-collection&#x60;.
* @param v4beta1SetDefaultPipelineRequest
* @param setDefaultPipelineRequest
*/
async setDefaultPipeline(collectionId, v4beta1SetDefaultPipelineRequest, options = { headers: {} }) {
async setDefaultPipeline(collectionId, setDefaultPipelineRequest, options = { headers: {} }) {
const localVarPath = this.basePath +
"/v4beta1/collections/{collection_id}:setDefaultPipeline".replace(/{\w+}/, String(collectionId));
"/v4/collections/{collection_id}:setDefaultPipeline".replace("{" + "collection_id" + "}", encodeURIComponent(String(collectionId)));
let localVarQueryParameters = {};

@@ -458,6 +626,6 @@ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);

}
// verify required parameter 'v4beta1SetDefaultPipelineRequest' is not null or undefined
if (v4beta1SetDefaultPipelineRequest === null ||
v4beta1SetDefaultPipelineRequest === undefined) {
throw new Error("Required parameter v4beta1SetDefaultPipelineRequest was null or undefined when calling setDefaultPipeline.");
// verify required parameter 'setDefaultPipelineRequest' is not null or undefined
if (setDefaultPipelineRequest === null ||
setDefaultPipelineRequest === undefined) {
throw new Error("Required parameter setDefaultPipelineRequest was null or undefined when calling setDefaultPipeline.");
}

@@ -473,3 +641,3 @@ Object.assign(localVarHeaderParams, options.headers);

json: true,
body: models_1.ObjectSerializer.serialize(v4beta1SetDefaultPipelineRequest, "V4beta1SetDefaultPipelineRequest"),
body: models_1.ObjectSerializer.serialize(setDefaultPipelineRequest, "SetDefaultPipelineRequest"),
};

@@ -516,15 +684,15 @@ let authenticationPromise = Promise.resolve();

/**
* Set the default version for a given pipeline. The default version of a pipeline allows you to refer to a pipeline without having to specify a version. This means you can change the pipeline version used for requests without having to change your code.
* Set the default version for a given pipeline. The default version of a pipeline is used when a pipeline is referred to without specifying a version. This allows you to change the pipeline version used for requests without having to change your code.
* @summary Set default pipeline version
* @param collectionId The collection that owns the pipeline to set the default version of, e.g. &#x60;my-collection&#x60;.
* @param type The type of the pipeline to set the default version of, either &#x60;record&#x60; or &#x60;query&#x60;.
* @param type The type of the pipeline to set the default version of.
* @param name The name of the pipeline to set the default version of, e.g. &#x60;my-pipeline&#x60;.
* @param v4beta1SetDefaultVersionRequest
* @param setDefaultVersionRequest
*/
async setDefaultVersion(collectionId, type, name, v4beta1SetDefaultVersionRequest, options = { headers: {} }) {
async setDefaultVersion(collectionId, type, name, setDefaultVersionRequest, options = { headers: {} }) {
const localVarPath = this.basePath +
"/v4beta1/collections/{collection_id}/pipelines/{type}/{name}:setDefaultVersion"
.replace(/{\w+}/, String(collectionId))
.replace(/{\w+}/, String(type))
.replace(/{\w+}/, String(name));
"/v4/collections/{collection_id}/pipelines/{type}/{name}:setDefaultVersion"
.replace("{" + "collection_id" + "}", encodeURIComponent(String(collectionId)))
.replace("{" + "type" + "}", encodeURIComponent(String(type)))
.replace("{" + "name" + "}", encodeURIComponent(String(name)));
let localVarQueryParameters = {};

@@ -553,6 +721,6 @@ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);

}
// verify required parameter 'v4beta1SetDefaultVersionRequest' is not null or undefined
if (v4beta1SetDefaultVersionRequest === null ||
v4beta1SetDefaultVersionRequest === undefined) {
throw new Error("Required parameter v4beta1SetDefaultVersionRequest was null or undefined when calling setDefaultVersion.");
// verify required parameter 'setDefaultVersionRequest' is not null or undefined
if (setDefaultVersionRequest === null ||
setDefaultVersionRequest === undefined) {
throw new Error("Required parameter setDefaultVersionRequest was null or undefined when calling setDefaultVersion.");
}

@@ -568,3 +736,3 @@ Object.assign(localVarHeaderParams, options.headers);

json: true,
body: models_1.ObjectSerializer.serialize(v4beta1SetDefaultVersionRequest, "V4beta1SetDefaultVersionRequest"),
body: models_1.ObjectSerializer.serialize(setDefaultVersionRequest, "SetDefaultVersionRequest"),
};

@@ -571,0 +739,0 @@ let authenticationPromise = Promise.resolve();

@@ -5,3 +5,3 @@ /**

*
* The version of the OpenAPI document: v4beta1
* The version of the OpenAPI document: v4
* Contact: support@sajari.com

@@ -15,8 +15,8 @@ *

import http from "http";
import { Sajariv4beta1DeleteRecordRequest } from "../model/sajariv4beta1DeleteRecordRequest";
import { Sajariv4beta1GetRecordRequest } from "../model/sajariv4beta1GetRecordRequest";
import { V4beta1BatchPutRecordsRequest } from "../model/v4beta1BatchPutRecordsRequest";
import { V4beta1BatchPutRecordsResponse } from "../model/v4beta1BatchPutRecordsResponse";
import { V4beta1PutRecordRequest } from "../model/v4beta1PutRecordRequest";
import { V4beta1PutRecordResponse } from "../model/v4beta1PutRecordResponse";
import { BatchUpsertRecordsRequest } from "../model/batchUpsertRecordsRequest";
import { BatchUpsertRecordsResponse } from "../model/batchUpsertRecordsResponse";
import { DeleteRecordRequest } from "../model/deleteRecordRequest";
import { GetRecordRequest } from "../model/getRecordRequest";
import { UpsertRecordRequest } from "../model/upsertRecordRequest";
import { UpsertRecordResponse } from "../model/upsertRecordResponse";
import { Authentication, Interceptor } from "../model/models";

@@ -48,8 +48,8 @@ import { HttpBasicAuth } from "../model/models";

/**
* The batch version of the [PutRecord](/docs/api-reference#operation/PutRecord) call.
* @summary Batch put records
* @param collectionId The collection to put the records in, e.g. &#x60;my-collection&#x60;.
* @param v4beta1BatchPutRecordsRequest
* The batch version of the [UpsertRecord](/docs/api-reference#operation/UpsertRecord) call.
* @summary Batch upsert records
* @param collectionId The collection to upsert the records in, e.g. &#x60;my-collection&#x60;.
* @param batchUpsertRecordsRequest
*/
batchPutRecords(collectionId: string, v4beta1BatchPutRecordsRequest: V4beta1BatchPutRecordsRequest, options?: {
batchUpsertRecords(collectionId: string, batchUpsertRecordsRequest: BatchUpsertRecordsRequest, options?: {
headers: {

@@ -60,3 +60,3 @@ [name: string]: string;

response: http.IncomingMessage;
body: V4beta1BatchPutRecordsResponse;
body: BatchUpsertRecordsResponse;
}>;

@@ -67,5 +67,5 @@ /**

* @param collectionId The collection that contains the record to delete, e.g. &#x60;my-collection&#x60;.
* @param sajariv4beta1DeleteRecordRequest
* @param deleteRecordRequest
*/
deleteRecord(collectionId: string, sajariv4beta1DeleteRecordRequest: Sajariv4beta1DeleteRecordRequest, options?: {
deleteRecord(collectionId: string, deleteRecordRequest: DeleteRecordRequest, options?: {
headers: {

@@ -82,5 +82,5 @@ [name: string]: string;

* @param collectionId The collection that contains the record to retrieve, e.g. &#x60;my-collection&#x60;.
* @param sajariv4beta1GetRecordRequest
* @param getRecordRequest
*/
getRecord(collectionId: string, sajariv4beta1GetRecordRequest: Sajariv4beta1GetRecordRequest, options?: {
getRecord(collectionId: string, getRecordRequest: GetRecordRequest, options?: {
headers: {

@@ -94,8 +94,8 @@ [name: string]: string;

/**
* Upsert a record. If the record does not exist in your collection it is inserted. If it does exist it is updated. If no pipeline is specified, the default record pipeline is used to process the record. For example, to add a single product from your ecommerce store to a collection, use the following call: ```json { \"pipeline\": { \"name\": \"my-pipeline\", \"version\": \"1\" }, \"record\": { \"id\": \"54hdc7h2334h\", \"name\": \"Smart TV\", \"price\": 1999, \"brand\": \"Acme\", \"description\": \"...\", \"in_stock\": true } } ```
* @summary Put record
* @param collectionId The collection to put the record in, e.g. &#x60;my-collection&#x60;.
* @param v4beta1PutRecordRequest
* If the record does not exist in your collection it is inserted. If it does exist it is updated. If no pipeline is specified, the default record pipeline is used to process the record. For example, to add a single product from your ecommerce store to a collection, use the following call: ```json { \"pipeline\": { \"name\": \"my-pipeline\", \"version\": \"1\" }, \"record\": { \"id\": \"54hdc7h2334h\", \"name\": \"Smart TV\", \"price\": 1999, \"brand\": \"Acme\", \"description\": \"...\", \"in_stock\": true } } ```
* @summary Upsert record
* @param collectionId The collection to upsert the record in, e.g. &#x60;my-collection&#x60;.
* @param upsertRecordRequest
*/
putRecord(collectionId: string, v4beta1PutRecordRequest: V4beta1PutRecordRequest, options?: {
upsertRecord(collectionId: string, upsertRecordRequest: UpsertRecordRequest, options?: {
headers: {

@@ -106,4 +106,4 @@ [name: string]: string;

response: http.IncomingMessage;
body: V4beta1PutRecordResponse;
body: UpsertRecordResponse;
}>;
}

@@ -6,3 +6,3 @@ "use strict";

*
* The version of the OpenAPI document: v4beta1
* The version of the OpenAPI document: v4
* Contact: support@sajari.com

@@ -84,10 +84,10 @@ *

/**
* The batch version of the [PutRecord](/docs/api-reference#operation/PutRecord) call.
* @summary Batch put records
* @param collectionId The collection to put the records in, e.g. &#x60;my-collection&#x60;.
* @param v4beta1BatchPutRecordsRequest
* The batch version of the [UpsertRecord](/docs/api-reference#operation/UpsertRecord) call.
* @summary Batch upsert records
* @param collectionId The collection to upsert the records in, e.g. &#x60;my-collection&#x60;.
* @param batchUpsertRecordsRequest
*/
async batchPutRecords(collectionId, v4beta1BatchPutRecordsRequest, options = { headers: {} }) {
async batchUpsertRecords(collectionId, batchUpsertRecordsRequest, options = { headers: {} }) {
const localVarPath = this.basePath +
"/v4beta1/collections/{collection_id}/records:batchPut".replace(/{\w+}/, String(collectionId));
"/v4/collections/{collection_id}/records:batchUpsert".replace("{" + "collection_id" + "}", encodeURIComponent(String(collectionId)));
let localVarQueryParameters = {};

@@ -106,8 +106,8 @@ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);

if (collectionId === null || collectionId === undefined) {
throw new Error("Required parameter collectionId was null or undefined when calling batchPutRecords.");
throw new Error("Required parameter collectionId was null or undefined when calling batchUpsertRecords.");
}
// verify required parameter 'v4beta1BatchPutRecordsRequest' is not null or undefined
if (v4beta1BatchPutRecordsRequest === null ||
v4beta1BatchPutRecordsRequest === undefined) {
throw new Error("Required parameter v4beta1BatchPutRecordsRequest was null or undefined when calling batchPutRecords.");
// verify required parameter 'batchUpsertRecordsRequest' is not null or undefined
if (batchUpsertRecordsRequest === null ||
batchUpsertRecordsRequest === undefined) {
throw new Error("Required parameter batchUpsertRecordsRequest was null or undefined when calling batchUpsertRecords.");
}

@@ -123,3 +123,3 @@ Object.assign(localVarHeaderParams, options.headers);

json: true,
body: models_1.ObjectSerializer.serialize(v4beta1BatchPutRecordsRequest, "V4beta1BatchPutRecordsRequest"),
body: models_1.ObjectSerializer.serialize(batchUpsertRecordsRequest, "BatchUpsertRecordsRequest"),
};

@@ -151,3 +151,3 @@ let authenticationPromise = Promise.resolve();

else {
body = models_1.ObjectSerializer.deserialize(body, "V4beta1BatchPutRecordsResponse");
body = models_1.ObjectSerializer.deserialize(body, "BatchUpsertRecordsResponse");
if (response.statusCode &&

@@ -170,7 +170,7 @@ response.statusCode >= 200 &&

* @param collectionId The collection that contains the record to delete, e.g. &#x60;my-collection&#x60;.
* @param sajariv4beta1DeleteRecordRequest
* @param deleteRecordRequest
*/
async deleteRecord(collectionId, sajariv4beta1DeleteRecordRequest, options = { headers: {} }) {
async deleteRecord(collectionId, deleteRecordRequest, options = { headers: {} }) {
const localVarPath = this.basePath +
"/v4beta1/collections/{collection_id}/records:delete".replace(/{\w+}/, String(collectionId));
"/v4/collections/{collection_id}/records:delete".replace("{" + "collection_id" + "}", encodeURIComponent(String(collectionId)));
let localVarQueryParameters = {};

@@ -191,6 +191,5 @@ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);

}
// verify required parameter 'sajariv4beta1DeleteRecordRequest' is not null or undefined
if (sajariv4beta1DeleteRecordRequest === null ||
sajariv4beta1DeleteRecordRequest === undefined) {
throw new Error("Required parameter sajariv4beta1DeleteRecordRequest was null or undefined when calling deleteRecord.");
// verify required parameter 'deleteRecordRequest' is not null or undefined
if (deleteRecordRequest === null || deleteRecordRequest === undefined) {
throw new Error("Required parameter deleteRecordRequest was null or undefined when calling deleteRecord.");
}

@@ -206,3 +205,3 @@ Object.assign(localVarHeaderParams, options.headers);

json: true,
body: models_1.ObjectSerializer.serialize(sajariv4beta1DeleteRecordRequest, "Sajariv4beta1DeleteRecordRequest"),
body: models_1.ObjectSerializer.serialize(deleteRecordRequest, "DeleteRecordRequest"),
};

@@ -252,7 +251,7 @@ let authenticationPromise = Promise.resolve();

* @param collectionId The collection that contains the record to retrieve, e.g. &#x60;my-collection&#x60;.
* @param sajariv4beta1GetRecordRequest
* @param getRecordRequest
*/
async getRecord(collectionId, sajariv4beta1GetRecordRequest, options = { headers: {} }) {
async getRecord(collectionId, getRecordRequest, options = { headers: {} }) {
const localVarPath = this.basePath +
"/v4beta1/collections/{collection_id}/records:get".replace(/{\w+}/, String(collectionId));
"/v4/collections/{collection_id}/records:get".replace("{" + "collection_id" + "}", encodeURIComponent(String(collectionId)));
let localVarQueryParameters = {};

@@ -273,6 +272,5 @@ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);

}
// verify required parameter 'sajariv4beta1GetRecordRequest' is not null or undefined
if (sajariv4beta1GetRecordRequest === null ||
sajariv4beta1GetRecordRequest === undefined) {
throw new Error("Required parameter sajariv4beta1GetRecordRequest was null or undefined when calling getRecord.");
// verify required parameter 'getRecordRequest' is not null or undefined
if (getRecordRequest === null || getRecordRequest === undefined) {
throw new Error("Required parameter getRecordRequest was null or undefined when calling getRecord.");
}

@@ -288,3 +286,3 @@ Object.assign(localVarHeaderParams, options.headers);

json: true,
body: models_1.ObjectSerializer.serialize(sajariv4beta1GetRecordRequest, "Sajariv4beta1GetRecordRequest"),
body: models_1.ObjectSerializer.serialize(getRecordRequest, "GetRecordRequest"),
};

@@ -331,10 +329,10 @@ let authenticationPromise = Promise.resolve();

/**
* Upsert a record. If the record does not exist in your collection it is inserted. If it does exist it is updated. If no pipeline is specified, the default record pipeline is used to process the record. For example, to add a single product from your ecommerce store to a collection, use the following call: ```json { \"pipeline\": { \"name\": \"my-pipeline\", \"version\": \"1\" }, \"record\": { \"id\": \"54hdc7h2334h\", \"name\": \"Smart TV\", \"price\": 1999, \"brand\": \"Acme\", \"description\": \"...\", \"in_stock\": true } } ```
* @summary Put record
* @param collectionId The collection to put the record in, e.g. &#x60;my-collection&#x60;.
* @param v4beta1PutRecordRequest
* If the record does not exist in your collection it is inserted. If it does exist it is updated. If no pipeline is specified, the default record pipeline is used to process the record. For example, to add a single product from your ecommerce store to a collection, use the following call: ```json { \"pipeline\": { \"name\": \"my-pipeline\", \"version\": \"1\" }, \"record\": { \"id\": \"54hdc7h2334h\", \"name\": \"Smart TV\", \"price\": 1999, \"brand\": \"Acme\", \"description\": \"...\", \"in_stock\": true } } ```
* @summary Upsert record
* @param collectionId The collection to upsert the record in, e.g. &#x60;my-collection&#x60;.
* @param upsertRecordRequest
*/
async putRecord(collectionId, v4beta1PutRecordRequest, options = { headers: {} }) {
async upsertRecord(collectionId, upsertRecordRequest, options = { headers: {} }) {
const localVarPath = this.basePath +
"/v4beta1/collections/{collection_id}/records:put".replace(/{\w+}/, String(collectionId));
"/v4/collections/{collection_id}/records:upsert".replace("{" + "collection_id" + "}", encodeURIComponent(String(collectionId)));
let localVarQueryParameters = {};

@@ -353,8 +351,7 @@ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);

if (collectionId === null || collectionId === undefined) {
throw new Error("Required parameter collectionId was null or undefined when calling putRecord.");
throw new Error("Required parameter collectionId was null or undefined when calling upsertRecord.");
}
// verify required parameter 'v4beta1PutRecordRequest' is not null or undefined
if (v4beta1PutRecordRequest === null ||
v4beta1PutRecordRequest === undefined) {
throw new Error("Required parameter v4beta1PutRecordRequest was null or undefined when calling putRecord.");
// verify required parameter 'upsertRecordRequest' is not null or undefined
if (upsertRecordRequest === null || upsertRecordRequest === undefined) {
throw new Error("Required parameter upsertRecordRequest was null or undefined when calling upsertRecord.");
}

@@ -370,3 +367,3 @@ Object.assign(localVarHeaderParams, options.headers);

json: true,
body: models_1.ObjectSerializer.serialize(v4beta1PutRecordRequest, "V4beta1PutRecordRequest"),
body: models_1.ObjectSerializer.serialize(upsertRecordRequest, "UpsertRecordRequest"),
};

@@ -398,3 +395,3 @@ let authenticationPromise = Promise.resolve();

else {
body = models_1.ObjectSerializer.deserialize(body, "V4beta1PutRecordResponse");
body = models_1.ObjectSerializer.deserialize(body, "UpsertRecordResponse");
if (response.statusCode &&

@@ -401,0 +398,0 @@ response.statusCode >= 200 &&

@@ -5,3 +5,3 @@ /**

*
* The version of the OpenAPI document: v4beta1
* The version of the OpenAPI document: v4
* Contact: support@sajari.com

@@ -15,6 +15,6 @@ *

import http from "http";
import { V4beta1BatchCreateSchemaFieldsRequest } from "../model/v4beta1BatchCreateSchemaFieldsRequest";
import { V4beta1BatchCreateSchemaFieldsResponse } from "../model/v4beta1BatchCreateSchemaFieldsResponse";
import { V4beta1ListSchemaFieldsResponse } from "../model/v4beta1ListSchemaFieldsResponse";
import { V4beta1SchemaField1 } from "../model/v4beta1SchemaField1";
import { BatchCreateSchemaFieldsRequest } from "../model/batchCreateSchemaFieldsRequest";
import { BatchCreateSchemaFieldsResponse } from "../model/batchCreateSchemaFieldsResponse";
import { ListSchemaFieldsResponse } from "../model/listSchemaFieldsResponse";
import { SchemaField } from "../model/schemaField";
import { Authentication, Interceptor } from "../model/models";

@@ -49,5 +49,5 @@ import { HttpBasicAuth } from "../model/models";

* @param collectionId The collection to create the schema fields in, e.g. &#x60;my-collection&#x60;.
* @param v4beta1BatchCreateSchemaFieldsRequest
* @param batchCreateSchemaFieldsRequest
*/
batchCreateSchemaFields(collectionId: string, v4beta1BatchCreateSchemaFieldsRequest: V4beta1BatchCreateSchemaFieldsRequest, options?: {
batchCreateSchemaFields(collectionId: string, batchCreateSchemaFieldsRequest: BatchCreateSchemaFieldsRequest, options?: {
headers: {

@@ -58,3 +58,3 @@ [name: string]: string;

response: http.IncomingMessage;
body: V4beta1BatchCreateSchemaFieldsResponse;
body: BatchCreateSchemaFieldsResponse;
}>;

@@ -65,5 +65,5 @@ /**

* @param collectionId The collection to create a schema field in, e.g. &#x60;my-collection&#x60;.
* @param v4beta1SchemaField1 The schema field to create.
* @param schemaField The schema field to create.
*/
createSchemaField(collectionId: string, v4beta1SchemaField1: V4beta1SchemaField1, options?: {
createSchemaField(collectionId: string, schemaField: SchemaField, options?: {
headers: {

@@ -74,3 +74,3 @@ [name: string]: string;

response: http.IncomingMessage;
body: V4beta1SchemaField1;
body: SchemaField;
}>;

@@ -90,4 +90,4 @@ /**

response: http.IncomingMessage;
body: V4beta1ListSchemaFieldsResponse;
body: ListSchemaFieldsResponse;
}>;
}

@@ -6,3 +6,3 @@ "use strict";

*
* The version of the OpenAPI document: v4beta1
* The version of the OpenAPI document: v4
* Contact: support@sajari.com

@@ -87,7 +87,7 @@ *

* @param collectionId The collection to create the schema fields in, e.g. &#x60;my-collection&#x60;.
* @param v4beta1BatchCreateSchemaFieldsRequest
* @param batchCreateSchemaFieldsRequest
*/
async batchCreateSchemaFields(collectionId, v4beta1BatchCreateSchemaFieldsRequest, options = { headers: {} }) {
async batchCreateSchemaFields(collectionId, batchCreateSchemaFieldsRequest, options = { headers: {} }) {
const localVarPath = this.basePath +
"/v4beta1/collections/{collection_id}/schemaFields:batchCreate".replace(/{\w+}/, String(collectionId));
"/v4/collections/{collection_id}/schemaFields:batchCreate".replace("{" + "collection_id" + "}", encodeURIComponent(String(collectionId)));
let localVarQueryParameters = {};

@@ -108,6 +108,6 @@ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);

}
// verify required parameter 'v4beta1BatchCreateSchemaFieldsRequest' is not null or undefined
if (v4beta1BatchCreateSchemaFieldsRequest === null ||
v4beta1BatchCreateSchemaFieldsRequest === undefined) {
throw new Error("Required parameter v4beta1BatchCreateSchemaFieldsRequest was null or undefined when calling batchCreateSchemaFields.");
// verify required parameter 'batchCreateSchemaFieldsRequest' is not null or undefined
if (batchCreateSchemaFieldsRequest === null ||
batchCreateSchemaFieldsRequest === undefined) {
throw new Error("Required parameter batchCreateSchemaFieldsRequest was null or undefined when calling batchCreateSchemaFields.");
}

@@ -123,3 +123,3 @@ Object.assign(localVarHeaderParams, options.headers);

json: true,
body: models_1.ObjectSerializer.serialize(v4beta1BatchCreateSchemaFieldsRequest, "V4beta1BatchCreateSchemaFieldsRequest"),
body: models_1.ObjectSerializer.serialize(batchCreateSchemaFieldsRequest, "BatchCreateSchemaFieldsRequest"),
};

@@ -151,3 +151,3 @@ let authenticationPromise = Promise.resolve();

else {
body = models_1.ObjectSerializer.deserialize(body, "V4beta1BatchCreateSchemaFieldsResponse");
body = models_1.ObjectSerializer.deserialize(body, "BatchCreateSchemaFieldsResponse");
if (response.statusCode &&

@@ -170,7 +170,7 @@ response.statusCode >= 200 &&

* @param collectionId The collection to create a schema field in, e.g. &#x60;my-collection&#x60;.
* @param v4beta1SchemaField1 The schema field to create.
* @param schemaField The schema field to create.
*/
async createSchemaField(collectionId, v4beta1SchemaField1, options = { headers: {} }) {
async createSchemaField(collectionId, schemaField, options = { headers: {} }) {
const localVarPath = this.basePath +
"/v4beta1/collections/{collection_id}/schemaFields".replace(/{\w+}/, String(collectionId));
"/v4/collections/{collection_id}/schemaFields".replace("{" + "collection_id" + "}", encodeURIComponent(String(collectionId)));
let localVarQueryParameters = {};

@@ -191,5 +191,5 @@ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);

}
// verify required parameter 'v4beta1SchemaField1' is not null or undefined
if (v4beta1SchemaField1 === null || v4beta1SchemaField1 === undefined) {
throw new Error("Required parameter v4beta1SchemaField1 was null or undefined when calling createSchemaField.");
// verify required parameter 'schemaField' is not null or undefined
if (schemaField === null || schemaField === undefined) {
throw new Error("Required parameter schemaField was null or undefined when calling createSchemaField.");
}

@@ -205,3 +205,3 @@ Object.assign(localVarHeaderParams, options.headers);

json: true,
body: models_1.ObjectSerializer.serialize(v4beta1SchemaField1, "V4beta1SchemaField1"),
body: models_1.ObjectSerializer.serialize(schemaField, "SchemaField"),
};

@@ -233,3 +233,3 @@ let authenticationPromise = Promise.resolve();

else {
body = models_1.ObjectSerializer.deserialize(body, "V4beta1SchemaField1");
body = models_1.ObjectSerializer.deserialize(body, "SchemaField");
if (response.statusCode &&

@@ -257,3 +257,3 @@ response.statusCode >= 200 &&

const localVarPath = this.basePath +
"/v4beta1/collections/{collection_id}/schemaFields".replace(/{\w+}/, String(collectionId));
"/v4/collections/{collection_id}/schemaFields".replace("{" + "collection_id" + "}", encodeURIComponent(String(collectionId)));
let localVarQueryParameters = {};

@@ -315,3 +315,3 @@ let localVarHeaderParams = Object.assign({}, this._defaultHeaders);

else {
body = models_1.ObjectSerializer.deserialize(body, "V4beta1ListSchemaFieldsResponse");
body = models_1.ObjectSerializer.deserialize(body, "ListSchemaFieldsResponse");
if (response.statusCode &&

@@ -318,0 +318,0 @@ response.statusCode >= 200 &&

/// <reference types="node" />
import localVarRequest from "request";
export * from "./batchPutRecordsResponseVariables";
export * from "./bucketsBucket";
export * from "./enginev2Value";
export * from "./gatewayruntimeError";
export * from "./gatewayruntimeError1";
export * from "./gatewayruntimeError2";
export * from "./gatewayruntimeError3";
export * from "./gatewayruntimeError4";
export * from "./batchCreateSchemaFieldsRequest";
export * from "./batchCreateSchemaFieldsResponse";
export * from "./batchCreateSchemaFieldsResponseError";
export * from "./batchUpsertRecordsRequest";
export * from "./batchUpsertRecordsRequestPipeline";
export * from "./batchUpsertRecordsResponse";
export * from "./batchUpsertRecordsResponseError";
export * from "./batchUpsertRecordsResponseKey";
export * from "./batchUpsertRecordsResponseVariables";
export * from "./collection";
export * from "./deleteRecordRequest";
export * from "./generatePipelinesRequest";
export * from "./generatePipelinesResponse";
export * from "./getDefaultPipelineResponse";
export * from "./getDefaultVersionRequestView";
export * from "./getPipelineRequestView";
export * from "./getRecordRequest";
export * from "./listCollectionsResponse";
export * from "./listPipelinesRequestView";
export * from "./listPipelinesResponse";
export * from "./listSchemaFieldsResponse";
export * from "./modelError";
export * from "./pipeline";
export * from "./pipelineStep";
export * from "./pipelineStepParamBinding";
export * from "./pipelineType";
export * from "./protobufAny";
export * from "./protobufNullValue";
export * from "./queryAggregateResult";
export * from "./queryAggregateResultAnalysis";
export * from "./queryAggregateResultBuckets";
export * from "./queryAggregateResultBucketsBucket";
export * from "./queryAggregateResultCount";
export * from "./queryAggregateResultDate";
export * from "./queryAggregateResultMetric";
export * from "./rpcStatus";
export * from "./rpcStatus1";
export * from "./rpcStatus2";
export * from "./sajariv4beta1DeleteRecordRequest";
export * from "./sajariv4beta1GetRecordRequest";
export * from "./sajariv4beta1Key";
export * from "./sajariv4beta1Pipeline";
export * from "./sajariv4beta1Pipeline1";
export * from "./queryCollectionRequest";
export * from "./queryCollectionRequestPipeline";
export * from "./queryCollectionRequestTracking";
export * from "./queryCollectionRequestTrackingType";
export * from "./queryCollectionResponse";
export * from "./queryCollectionResponsePipeline";
export * from "./queryResult";
export * from "./queryResultToken";
export * from "./queryResultTokenClick";
export * from "./queryResultTokenPosNeg";
export * from "./recordKey";
export * from "./schemaField";
export * from "./schemaFieldMode";
export * from "./stepParamBinding";
export * from "./tokenClick";
export * from "./tokenPosNeg";
export * from "./v2QueryAggregateResult";
export * from "./v2QueryResult";
export * from "./v2QueryResults";
export * from "./v2Token";
export * from "./v2Tracking";
export * from "./v2TrackingType";
export * from "./v4beta1BatchCreateSchemaFieldsRequest";
export * from "./v4beta1BatchCreateSchemaFieldsResponse";
export * from "./v4beta1BatchCreateSchemaFieldsResponseError";
export * from "./v4beta1BatchPutRecordsRequest";
export * from "./v4beta1BatchPutRecordsRequestPipeline";
export * from "./v4beta1BatchPutRecordsResponse";
export * from "./v4beta1BatchPutRecordsResponseError";
export * from "./v4beta1BatchPutRecordsResponseKey";
export * from "./v4beta1Collection";
export * from "./v4beta1GeneratePipelinesRequest";
export * from "./v4beta1GeneratePipelinesResponse";
export * from "./v4beta1GetPipelineRequestView";
export * from "./v4beta1ListCollectionsResponse";
export * from "./v4beta1ListPipelinesRequestView";
export * from "./v4beta1ListPipelinesResponse";
export * from "./v4beta1ListSchemaFieldsResponse";
export * from "./v4beta1PipelineType";
export * from "./v4beta1PutRecordRequest";
export * from "./v4beta1PutRecordRequestPipeline";
export * from "./v4beta1PutRecordResponse";
export * from "./v4beta1QueryCollectionRequest";
export * from "./v4beta1QueryCollectionRequestPipeline";
export * from "./v4beta1QueryCollectionResponse";
export * from "./v4beta1QueryCollectionResponsePipeline";
export * from "./v4beta1SchemaField";
export * from "./v4beta1SchemaField1";
export * from "./v4beta1SchemaFieldType";
export * from "./v4beta1SetDefaultPipelineRequest";
export * from "./v4beta1SetDefaultVersionRequest";
export * from "./v4beta1Step";
export * from "./v4beta1Step1";
export * from "./valueRepeated";
export * from "./schemaFieldType";
export * from "./setDefaultPipelineRequest";
export * from "./setDefaultVersionRequest";
export * from "./status";
export * from "./upsertRecordRequest";
export * from "./upsertRecordRequestPipeline";
export * from "./upsertRecordResponse";
import * as fs from "fs";

@@ -69,0 +59,0 @@ export interface RequestDetailedFile {

@@ -14,132 +14,112 @@ "use strict";

exports.VoidAuth = exports.OAuth = exports.ApiKeyAuth = exports.HttpBearerAuth = exports.HttpBasicAuth = exports.ObjectSerializer = void 0;
__exportStar(require("./batchPutRecordsResponseVariables"), exports);
__exportStar(require("./bucketsBucket"), exports);
__exportStar(require("./enginev2Value"), exports);
__exportStar(require("./gatewayruntimeError"), exports);
__exportStar(require("./gatewayruntimeError1"), exports);
__exportStar(require("./gatewayruntimeError2"), exports);
__exportStar(require("./gatewayruntimeError3"), exports);
__exportStar(require("./gatewayruntimeError4"), exports);
__exportStar(require("./batchCreateSchemaFieldsRequest"), exports);
__exportStar(require("./batchCreateSchemaFieldsResponse"), exports);
__exportStar(require("./batchCreateSchemaFieldsResponseError"), exports);
__exportStar(require("./batchUpsertRecordsRequest"), exports);
__exportStar(require("./batchUpsertRecordsRequestPipeline"), exports);
__exportStar(require("./batchUpsertRecordsResponse"), exports);
__exportStar(require("./batchUpsertRecordsResponseError"), exports);
__exportStar(require("./batchUpsertRecordsResponseKey"), exports);
__exportStar(require("./batchUpsertRecordsResponseVariables"), exports);
__exportStar(require("./collection"), exports);
__exportStar(require("./deleteRecordRequest"), exports);
__exportStar(require("./generatePipelinesRequest"), exports);
__exportStar(require("./generatePipelinesResponse"), exports);
__exportStar(require("./getDefaultPipelineResponse"), exports);
__exportStar(require("./getDefaultVersionRequestView"), exports);
__exportStar(require("./getPipelineRequestView"), exports);
__exportStar(require("./getRecordRequest"), exports);
__exportStar(require("./listCollectionsResponse"), exports);
__exportStar(require("./listPipelinesRequestView"), exports);
__exportStar(require("./listPipelinesResponse"), exports);
__exportStar(require("./listSchemaFieldsResponse"), exports);
__exportStar(require("./modelError"), exports);
__exportStar(require("./pipeline"), exports);
__exportStar(require("./pipelineStep"), exports);
__exportStar(require("./pipelineStepParamBinding"), exports);
__exportStar(require("./pipelineType"), exports);
__exportStar(require("./protobufAny"), exports);
__exportStar(require("./protobufNullValue"), exports);
__exportStar(require("./queryAggregateResult"), exports);
__exportStar(require("./queryAggregateResultAnalysis"), exports);
__exportStar(require("./queryAggregateResultBuckets"), exports);
__exportStar(require("./queryAggregateResultBucketsBucket"), exports);
__exportStar(require("./queryAggregateResultCount"), exports);
__exportStar(require("./queryAggregateResultDate"), exports);
__exportStar(require("./queryAggregateResultMetric"), exports);
__exportStar(require("./rpcStatus"), exports);
__exportStar(require("./rpcStatus1"), exports);
__exportStar(require("./rpcStatus2"), exports);
__exportStar(require("./sajariv4beta1DeleteRecordRequest"), exports);
__exportStar(require("./sajariv4beta1GetRecordRequest"), exports);
__exportStar(require("./sajariv4beta1Key"), exports);
__exportStar(require("./sajariv4beta1Pipeline"), exports);
__exportStar(require("./sajariv4beta1Pipeline1"), exports);
__exportStar(require("./queryCollectionRequest"), exports);
__exportStar(require("./queryCollectionRequestPipeline"), exports);
__exportStar(require("./queryCollectionRequestTracking"), exports);
__exportStar(require("./queryCollectionRequestTrackingType"), exports);
__exportStar(require("./queryCollectionResponse"), exports);
__exportStar(require("./queryCollectionResponsePipeline"), exports);
__exportStar(require("./queryResult"), exports);
__exportStar(require("./queryResultToken"), exports);
__exportStar(require("./queryResultTokenClick"), exports);
__exportStar(require("./queryResultTokenPosNeg"), exports);
__exportStar(require("./recordKey"), exports);
__exportStar(require("./schemaField"), exports);
__exportStar(require("./schemaFieldMode"), exports);
__exportStar(require("./stepParamBinding"), exports);
__exportStar(require("./tokenClick"), exports);
__exportStar(require("./tokenPosNeg"), exports);
__exportStar(require("./v2QueryAggregateResult"), exports);
__exportStar(require("./v2QueryResult"), exports);
__exportStar(require("./v2QueryResults"), exports);
__exportStar(require("./v2Token"), exports);
__exportStar(require("./v2Tracking"), exports);
__exportStar(require("./v2TrackingType"), exports);
__exportStar(require("./v4beta1BatchCreateSchemaFieldsRequest"), exports);
__exportStar(require("./v4beta1BatchCreateSchemaFieldsResponse"), exports);
__exportStar(require("./v4beta1BatchCreateSchemaFieldsResponseError"), exports);
__exportStar(require("./v4beta1BatchPutRecordsRequest"), exports);
__exportStar(require("./v4beta1BatchPutRecordsRequestPipeline"), exports);
__exportStar(require("./v4beta1BatchPutRecordsResponse"), exports);
__exportStar(require("./v4beta1BatchPutRecordsResponseError"), exports);
__exportStar(require("./v4beta1BatchPutRecordsResponseKey"), exports);
__exportStar(require("./v4beta1Collection"), exports);
__exportStar(require("./v4beta1GeneratePipelinesRequest"), exports);
__exportStar(require("./v4beta1GeneratePipelinesResponse"), exports);
__exportStar(require("./v4beta1GetPipelineRequestView"), exports);
__exportStar(require("./v4beta1ListCollectionsResponse"), exports);
__exportStar(require("./v4beta1ListPipelinesRequestView"), exports);
__exportStar(require("./v4beta1ListPipelinesResponse"), exports);
__exportStar(require("./v4beta1ListSchemaFieldsResponse"), exports);
__exportStar(require("./v4beta1PipelineType"), exports);
__exportStar(require("./v4beta1PutRecordRequest"), exports);
__exportStar(require("./v4beta1PutRecordRequestPipeline"), exports);
__exportStar(require("./v4beta1PutRecordResponse"), exports);
__exportStar(require("./v4beta1QueryCollectionRequest"), exports);
__exportStar(require("./v4beta1QueryCollectionRequestPipeline"), exports);
__exportStar(require("./v4beta1QueryCollectionResponse"), exports);
__exportStar(require("./v4beta1QueryCollectionResponsePipeline"), exports);
__exportStar(require("./v4beta1SchemaField"), exports);
__exportStar(require("./v4beta1SchemaField1"), exports);
__exportStar(require("./v4beta1SchemaFieldType"), exports);
__exportStar(require("./v4beta1SetDefaultPipelineRequest"), exports);
__exportStar(require("./v4beta1SetDefaultVersionRequest"), exports);
__exportStar(require("./v4beta1Step"), exports);
__exportStar(require("./v4beta1Step1"), exports);
__exportStar(require("./valueRepeated"), exports);
const batchPutRecordsResponseVariables_1 = require("./batchPutRecordsResponseVariables");
const bucketsBucket_1 = require("./bucketsBucket");
const enginev2Value_1 = require("./enginev2Value");
const gatewayruntimeError_1 = require("./gatewayruntimeError");
const gatewayruntimeError1_1 = require("./gatewayruntimeError1");
const gatewayruntimeError2_1 = require("./gatewayruntimeError2");
const gatewayruntimeError3_1 = require("./gatewayruntimeError3");
const gatewayruntimeError4_1 = require("./gatewayruntimeError4");
__exportStar(require("./schemaFieldType"), exports);
__exportStar(require("./setDefaultPipelineRequest"), exports);
__exportStar(require("./setDefaultVersionRequest"), exports);
__exportStar(require("./status"), exports);
__exportStar(require("./upsertRecordRequest"), exports);
__exportStar(require("./upsertRecordRequestPipeline"), exports);
__exportStar(require("./upsertRecordResponse"), exports);
const batchCreateSchemaFieldsRequest_1 = require("./batchCreateSchemaFieldsRequest");
const batchCreateSchemaFieldsResponse_1 = require("./batchCreateSchemaFieldsResponse");
const batchCreateSchemaFieldsResponseError_1 = require("./batchCreateSchemaFieldsResponseError");
const batchUpsertRecordsRequest_1 = require("./batchUpsertRecordsRequest");
const batchUpsertRecordsRequestPipeline_1 = require("./batchUpsertRecordsRequestPipeline");
const batchUpsertRecordsResponse_1 = require("./batchUpsertRecordsResponse");
const batchUpsertRecordsResponseError_1 = require("./batchUpsertRecordsResponseError");
const batchUpsertRecordsResponseKey_1 = require("./batchUpsertRecordsResponseKey");
const batchUpsertRecordsResponseVariables_1 = require("./batchUpsertRecordsResponseVariables");
const collection_1 = require("./collection");
const deleteRecordRequest_1 = require("./deleteRecordRequest");
const generatePipelinesRequest_1 = require("./generatePipelinesRequest");
const generatePipelinesResponse_1 = require("./generatePipelinesResponse");
const getDefaultPipelineResponse_1 = require("./getDefaultPipelineResponse");
const getDefaultVersionRequestView_1 = require("./getDefaultVersionRequestView");
const getPipelineRequestView_1 = require("./getPipelineRequestView");
const getRecordRequest_1 = require("./getRecordRequest");
const listCollectionsResponse_1 = require("./listCollectionsResponse");
const listPipelinesRequestView_1 = require("./listPipelinesRequestView");
const listPipelinesResponse_1 = require("./listPipelinesResponse");
const listSchemaFieldsResponse_1 = require("./listSchemaFieldsResponse");
const modelError_1 = require("./modelError");
const pipeline_1 = require("./pipeline");
const pipelineStep_1 = require("./pipelineStep");
const pipelineStepParamBinding_1 = require("./pipelineStepParamBinding");
const pipelineType_1 = require("./pipelineType");
const protobufAny_1 = require("./protobufAny");
const protobufNullValue_1 = require("./protobufNullValue");
const queryAggregateResult_1 = require("./queryAggregateResult");
const queryAggregateResultAnalysis_1 = require("./queryAggregateResultAnalysis");
const queryAggregateResultBuckets_1 = require("./queryAggregateResultBuckets");
const queryAggregateResultBucketsBucket_1 = require("./queryAggregateResultBucketsBucket");
const queryAggregateResultCount_1 = require("./queryAggregateResultCount");
const queryAggregateResultDate_1 = require("./queryAggregateResultDate");
const queryAggregateResultMetric_1 = require("./queryAggregateResultMetric");
const rpcStatus_1 = require("./rpcStatus");
const rpcStatus1_1 = require("./rpcStatus1");
const rpcStatus2_1 = require("./rpcStatus2");
const sajariv4beta1DeleteRecordRequest_1 = require("./sajariv4beta1DeleteRecordRequest");
const sajariv4beta1GetRecordRequest_1 = require("./sajariv4beta1GetRecordRequest");
const sajariv4beta1Key_1 = require("./sajariv4beta1Key");
const sajariv4beta1Pipeline_1 = require("./sajariv4beta1Pipeline");
const sajariv4beta1Pipeline1_1 = require("./sajariv4beta1Pipeline1");
const queryCollectionRequest_1 = require("./queryCollectionRequest");
const queryCollectionRequestPipeline_1 = require("./queryCollectionRequestPipeline");
const queryCollectionRequestTracking_1 = require("./queryCollectionRequestTracking");
const queryCollectionRequestTrackingType_1 = require("./queryCollectionRequestTrackingType");
const queryCollectionResponse_1 = require("./queryCollectionResponse");
const queryCollectionResponsePipeline_1 = require("./queryCollectionResponsePipeline");
const queryResult_1 = require("./queryResult");
const queryResultToken_1 = require("./queryResultToken");
const queryResultTokenClick_1 = require("./queryResultTokenClick");
const queryResultTokenPosNeg_1 = require("./queryResultTokenPosNeg");
const recordKey_1 = require("./recordKey");
const schemaField_1 = require("./schemaField");
const schemaFieldMode_1 = require("./schemaFieldMode");
const stepParamBinding_1 = require("./stepParamBinding");
const tokenClick_1 = require("./tokenClick");
const tokenPosNeg_1 = require("./tokenPosNeg");
const v2QueryAggregateResult_1 = require("./v2QueryAggregateResult");
const v2QueryResult_1 = require("./v2QueryResult");
const v2QueryResults_1 = require("./v2QueryResults");
const v2Token_1 = require("./v2Token");
const v2Tracking_1 = require("./v2Tracking");
const v2TrackingType_1 = require("./v2TrackingType");
const v4beta1BatchCreateSchemaFieldsRequest_1 = require("./v4beta1BatchCreateSchemaFieldsRequest");
const v4beta1BatchCreateSchemaFieldsResponse_1 = require("./v4beta1BatchCreateSchemaFieldsResponse");
const v4beta1BatchCreateSchemaFieldsResponseError_1 = require("./v4beta1BatchCreateSchemaFieldsResponseError");
const v4beta1BatchPutRecordsRequest_1 = require("./v4beta1BatchPutRecordsRequest");
const v4beta1BatchPutRecordsRequestPipeline_1 = require("./v4beta1BatchPutRecordsRequestPipeline");
const v4beta1BatchPutRecordsResponse_1 = require("./v4beta1BatchPutRecordsResponse");
const v4beta1BatchPutRecordsResponseError_1 = require("./v4beta1BatchPutRecordsResponseError");
const v4beta1BatchPutRecordsResponseKey_1 = require("./v4beta1BatchPutRecordsResponseKey");
const v4beta1Collection_1 = require("./v4beta1Collection");
const v4beta1GeneratePipelinesRequest_1 = require("./v4beta1GeneratePipelinesRequest");
const v4beta1GeneratePipelinesResponse_1 = require("./v4beta1GeneratePipelinesResponse");
const v4beta1GetPipelineRequestView_1 = require("./v4beta1GetPipelineRequestView");
const v4beta1ListCollectionsResponse_1 = require("./v4beta1ListCollectionsResponse");
const v4beta1ListPipelinesRequestView_1 = require("./v4beta1ListPipelinesRequestView");
const v4beta1ListPipelinesResponse_1 = require("./v4beta1ListPipelinesResponse");
const v4beta1ListSchemaFieldsResponse_1 = require("./v4beta1ListSchemaFieldsResponse");
const v4beta1PipelineType_1 = require("./v4beta1PipelineType");
const v4beta1PutRecordRequest_1 = require("./v4beta1PutRecordRequest");
const v4beta1PutRecordRequestPipeline_1 = require("./v4beta1PutRecordRequestPipeline");
const v4beta1PutRecordResponse_1 = require("./v4beta1PutRecordResponse");
const v4beta1QueryCollectionRequest_1 = require("./v4beta1QueryCollectionRequest");
const v4beta1QueryCollectionRequestPipeline_1 = require("./v4beta1QueryCollectionRequestPipeline");
const v4beta1QueryCollectionResponse_1 = require("./v4beta1QueryCollectionResponse");
const v4beta1QueryCollectionResponsePipeline_1 = require("./v4beta1QueryCollectionResponsePipeline");
const v4beta1SchemaField_1 = require("./v4beta1SchemaField");
const v4beta1SchemaField1_1 = require("./v4beta1SchemaField1");
const v4beta1SchemaFieldType_1 = require("./v4beta1SchemaFieldType");
const v4beta1SetDefaultPipelineRequest_1 = require("./v4beta1SetDefaultPipelineRequest");
const v4beta1SetDefaultVersionRequest_1 = require("./v4beta1SetDefaultVersionRequest");
const v4beta1Step_1 = require("./v4beta1Step");
const v4beta1Step1_1 = require("./v4beta1Step1");
const valueRepeated_1 = require("./valueRepeated");
const schemaFieldType_1 = require("./schemaFieldType");
const setDefaultPipelineRequest_1 = require("./setDefaultPipelineRequest");
const setDefaultVersionRequest_1 = require("./setDefaultVersionRequest");
const status_1 = require("./status");
const upsertRecordRequest_1 = require("./upsertRecordRequest");
const upsertRecordRequestPipeline_1 = require("./upsertRecordRequestPipeline");
const upsertRecordResponse_1 = require("./upsertRecordResponse");
/* tslint:disable:no-unused-variable */

@@ -157,69 +137,59 @@ let primitives = [

let enumsMap = {
GetDefaultVersionRequestView: getDefaultVersionRequestView_1.GetDefaultVersionRequestView,
GetPipelineRequestView: getPipelineRequestView_1.GetPipelineRequestView,
ListPipelinesRequestView: listPipelinesRequestView_1.ListPipelinesRequestView,
PipelineType: pipelineType_1.PipelineType,
ProtobufNullValue: protobufNullValue_1.ProtobufNullValue,
QueryCollectionRequestTrackingType: queryCollectionRequestTrackingType_1.QueryCollectionRequestTrackingType,
SchemaFieldMode: schemaFieldMode_1.SchemaFieldMode,
V2TrackingType: v2TrackingType_1.V2TrackingType,
V4beta1GetPipelineRequestView: v4beta1GetPipelineRequestView_1.V4beta1GetPipelineRequestView,
V4beta1ListPipelinesRequestView: v4beta1ListPipelinesRequestView_1.V4beta1ListPipelinesRequestView,
V4beta1PipelineType: v4beta1PipelineType_1.V4beta1PipelineType,
V4beta1SchemaFieldType: v4beta1SchemaFieldType_1.V4beta1SchemaFieldType,
SchemaFieldType: schemaFieldType_1.SchemaFieldType,
};
let typeMap = {
BatchPutRecordsResponseVariables: batchPutRecordsResponseVariables_1.BatchPutRecordsResponseVariables,
BucketsBucket: bucketsBucket_1.BucketsBucket,
Enginev2Value: enginev2Value_1.Enginev2Value,
GatewayruntimeError: gatewayruntimeError_1.GatewayruntimeError,
GatewayruntimeError1: gatewayruntimeError1_1.GatewayruntimeError1,
GatewayruntimeError2: gatewayruntimeError2_1.GatewayruntimeError2,
GatewayruntimeError3: gatewayruntimeError3_1.GatewayruntimeError3,
GatewayruntimeError4: gatewayruntimeError4_1.GatewayruntimeError4,
BatchCreateSchemaFieldsRequest: batchCreateSchemaFieldsRequest_1.BatchCreateSchemaFieldsRequest,
BatchCreateSchemaFieldsResponse: batchCreateSchemaFieldsResponse_1.BatchCreateSchemaFieldsResponse,
BatchCreateSchemaFieldsResponseError: batchCreateSchemaFieldsResponseError_1.BatchCreateSchemaFieldsResponseError,
BatchUpsertRecordsRequest: batchUpsertRecordsRequest_1.BatchUpsertRecordsRequest,
BatchUpsertRecordsRequestPipeline: batchUpsertRecordsRequestPipeline_1.BatchUpsertRecordsRequestPipeline,
BatchUpsertRecordsResponse: batchUpsertRecordsResponse_1.BatchUpsertRecordsResponse,
BatchUpsertRecordsResponseError: batchUpsertRecordsResponseError_1.BatchUpsertRecordsResponseError,
BatchUpsertRecordsResponseKey: batchUpsertRecordsResponseKey_1.BatchUpsertRecordsResponseKey,
BatchUpsertRecordsResponseVariables: batchUpsertRecordsResponseVariables_1.BatchUpsertRecordsResponseVariables,
Collection: collection_1.Collection,
DeleteRecordRequest: deleteRecordRequest_1.DeleteRecordRequest,
GeneratePipelinesRequest: generatePipelinesRequest_1.GeneratePipelinesRequest,
GeneratePipelinesResponse: generatePipelinesResponse_1.GeneratePipelinesResponse,
GetDefaultPipelineResponse: getDefaultPipelineResponse_1.GetDefaultPipelineResponse,
GetRecordRequest: getRecordRequest_1.GetRecordRequest,
ListCollectionsResponse: listCollectionsResponse_1.ListCollectionsResponse,
ListPipelinesResponse: listPipelinesResponse_1.ListPipelinesResponse,
ListSchemaFieldsResponse: listSchemaFieldsResponse_1.ListSchemaFieldsResponse,
ModelError: modelError_1.ModelError,
Pipeline: pipeline_1.Pipeline,
PipelineStep: pipelineStep_1.PipelineStep,
PipelineStepParamBinding: pipelineStepParamBinding_1.PipelineStepParamBinding,
ProtobufAny: protobufAny_1.ProtobufAny,
QueryAggregateResult: queryAggregateResult_1.QueryAggregateResult,
QueryAggregateResultAnalysis: queryAggregateResultAnalysis_1.QueryAggregateResultAnalysis,
QueryAggregateResultBuckets: queryAggregateResultBuckets_1.QueryAggregateResultBuckets,
QueryAggregateResultBucketsBucket: queryAggregateResultBucketsBucket_1.QueryAggregateResultBucketsBucket,
QueryAggregateResultCount: queryAggregateResultCount_1.QueryAggregateResultCount,
QueryAggregateResultDate: queryAggregateResultDate_1.QueryAggregateResultDate,
QueryAggregateResultMetric: queryAggregateResultMetric_1.QueryAggregateResultMetric,
RpcStatus: rpcStatus_1.RpcStatus,
RpcStatus1: rpcStatus1_1.RpcStatus1,
RpcStatus2: rpcStatus2_1.RpcStatus2,
Sajariv4beta1DeleteRecordRequest: sajariv4beta1DeleteRecordRequest_1.Sajariv4beta1DeleteRecordRequest,
Sajariv4beta1GetRecordRequest: sajariv4beta1GetRecordRequest_1.Sajariv4beta1GetRecordRequest,
Sajariv4beta1Key: sajariv4beta1Key_1.Sajariv4beta1Key,
Sajariv4beta1Pipeline: sajariv4beta1Pipeline_1.Sajariv4beta1Pipeline,
Sajariv4beta1Pipeline1: sajariv4beta1Pipeline1_1.Sajariv4beta1Pipeline1,
StepParamBinding: stepParamBinding_1.StepParamBinding,
TokenClick: tokenClick_1.TokenClick,
TokenPosNeg: tokenPosNeg_1.TokenPosNeg,
V2QueryAggregateResult: v2QueryAggregateResult_1.V2QueryAggregateResult,
V2QueryResult: v2QueryResult_1.V2QueryResult,
V2QueryResults: v2QueryResults_1.V2QueryResults,
V2Token: v2Token_1.V2Token,
V2Tracking: v2Tracking_1.V2Tracking,
V4beta1BatchCreateSchemaFieldsRequest: v4beta1BatchCreateSchemaFieldsRequest_1.V4beta1BatchCreateSchemaFieldsRequest,
V4beta1BatchCreateSchemaFieldsResponse: v4beta1BatchCreateSchemaFieldsResponse_1.V4beta1BatchCreateSchemaFieldsResponse,
V4beta1BatchCreateSchemaFieldsResponseError: v4beta1BatchCreateSchemaFieldsResponseError_1.V4beta1BatchCreateSchemaFieldsResponseError,
V4beta1BatchPutRecordsRequest: v4beta1BatchPutRecordsRequest_1.V4beta1BatchPutRecordsRequest,
V4beta1BatchPutRecordsRequestPipeline: v4beta1BatchPutRecordsRequestPipeline_1.V4beta1BatchPutRecordsRequestPipeline,
V4beta1BatchPutRecordsResponse: v4beta1BatchPutRecordsResponse_1.V4beta1BatchPutRecordsResponse,
V4beta1BatchPutRecordsResponseError: v4beta1BatchPutRecordsResponseError_1.V4beta1BatchPutRecordsResponseError,
V4beta1BatchPutRecordsResponseKey: v4beta1BatchPutRecordsResponseKey_1.V4beta1BatchPutRecordsResponseKey,
V4beta1Collection: v4beta1Collection_1.V4beta1Collection,
V4beta1GeneratePipelinesRequest: v4beta1GeneratePipelinesRequest_1.V4beta1GeneratePipelinesRequest,
V4beta1GeneratePipelinesResponse: v4beta1GeneratePipelinesResponse_1.V4beta1GeneratePipelinesResponse,
V4beta1ListCollectionsResponse: v4beta1ListCollectionsResponse_1.V4beta1ListCollectionsResponse,
V4beta1ListPipelinesResponse: v4beta1ListPipelinesResponse_1.V4beta1ListPipelinesResponse,
V4beta1ListSchemaFieldsResponse: v4beta1ListSchemaFieldsResponse_1.V4beta1ListSchemaFieldsResponse,
V4beta1PutRecordRequest: v4beta1PutRecordRequest_1.V4beta1PutRecordRequest,
V4beta1PutRecordRequestPipeline: v4beta1PutRecordRequestPipeline_1.V4beta1PutRecordRequestPipeline,
V4beta1PutRecordResponse: v4beta1PutRecordResponse_1.V4beta1PutRecordResponse,
V4beta1QueryCollectionRequest: v4beta1QueryCollectionRequest_1.V4beta1QueryCollectionRequest,
V4beta1QueryCollectionRequestPipeline: v4beta1QueryCollectionRequestPipeline_1.V4beta1QueryCollectionRequestPipeline,
V4beta1QueryCollectionResponse: v4beta1QueryCollectionResponse_1.V4beta1QueryCollectionResponse,
V4beta1QueryCollectionResponsePipeline: v4beta1QueryCollectionResponsePipeline_1.V4beta1QueryCollectionResponsePipeline,
V4beta1SchemaField: v4beta1SchemaField_1.V4beta1SchemaField,
V4beta1SchemaField1: v4beta1SchemaField1_1.V4beta1SchemaField1,
V4beta1SetDefaultPipelineRequest: v4beta1SetDefaultPipelineRequest_1.V4beta1SetDefaultPipelineRequest,
V4beta1SetDefaultVersionRequest: v4beta1SetDefaultVersionRequest_1.V4beta1SetDefaultVersionRequest,
V4beta1Step: v4beta1Step_1.V4beta1Step,
V4beta1Step1: v4beta1Step1_1.V4beta1Step1,
ValueRepeated: valueRepeated_1.ValueRepeated,
QueryCollectionRequest: queryCollectionRequest_1.QueryCollectionRequest,
QueryCollectionRequestPipeline: queryCollectionRequestPipeline_1.QueryCollectionRequestPipeline,
QueryCollectionRequestTracking: queryCollectionRequestTracking_1.QueryCollectionRequestTracking,
QueryCollectionResponse: queryCollectionResponse_1.QueryCollectionResponse,
QueryCollectionResponsePipeline: queryCollectionResponsePipeline_1.QueryCollectionResponsePipeline,
QueryResult: queryResult_1.QueryResult,
QueryResultToken: queryResultToken_1.QueryResultToken,
QueryResultTokenClick: queryResultTokenClick_1.QueryResultTokenClick,
QueryResultTokenPosNeg: queryResultTokenPosNeg_1.QueryResultTokenPosNeg,
RecordKey: recordKey_1.RecordKey,
SchemaField: schemaField_1.SchemaField,
SetDefaultPipelineRequest: setDefaultPipelineRequest_1.SetDefaultPipelineRequest,
SetDefaultVersionRequest: setDefaultVersionRequest_1.SetDefaultVersionRequest,
Status: status_1.Status,
UpsertRecordRequest: upsertRecordRequest_1.UpsertRecordRequest,
UpsertRecordRequestPipeline: upsertRecordRequestPipeline_1.UpsertRecordRequestPipeline,
UpsertRecordResponse: upsertRecordResponse_1.UpsertRecordResponse,
};

@@ -226,0 +196,0 @@ class ObjectSerializer {

@@ -5,3 +5,3 @@ /**

*
* The version of the OpenAPI document: v4beta1
* The version of the OpenAPI document: v4
* Contact: support@sajari.com

@@ -8,0 +8,0 @@ *

@@ -6,3 +6,3 @@ "use strict";

*
* The version of the OpenAPI document: v4beta1
* The version of the OpenAPI document: v4
* Contact: support@sajari.com

@@ -9,0 +9,0 @@ *

@@ -5,3 +5,3 @@ /**

*
* The version of the OpenAPI document: v4beta1
* The version of the OpenAPI document: v4
* Contact: support@sajari.com

@@ -8,0 +8,0 @@ *

@@ -6,3 +6,3 @@ "use strict";

*
* The version of the OpenAPI document: v4beta1
* The version of the OpenAPI document: v4
* Contact: support@sajari.com

@@ -9,0 +9,0 @@ *

@@ -5,3 +5,3 @@ /**

*
* The version of the OpenAPI document: v4beta1
* The version of the OpenAPI document: v4
* Contact: support@sajari.com

@@ -23,13 +23,13 @@ *

/**
* Min length of a repeated field.
* Minimum length of an array field.
*/
"minLen"?: number;
"minLength"?: number;
/**
* Max number of values in a repeated field.
* Maximum number of values in an array field.
*/
"maxLen"?: number;
"maxLength"?: number;
/**
* Avg number of items in repeated field.
* Average number of items in an array field.
*/
"avgLen"?: number;
"avgLength"?: number;
static discriminator: string | undefined;

@@ -36,0 +36,0 @@ static attributeTypeMap: Array<{

@@ -6,3 +6,3 @@ "use strict";

*
* The version of the OpenAPI document: v4beta1
* The version of the OpenAPI document: v4
* Contact: support@sajari.com

@@ -35,14 +35,14 @@ *

{
name: "minLen",
baseName: "min_len",
name: "minLength",
baseName: "min_length",
type: "number",
},
{
name: "maxLen",
baseName: "max_len",
name: "maxLength",
baseName: "max_length",
type: "number",
},
{
name: "avgLen",
baseName: "avg_len",
name: "avgLength",
baseName: "avg_length",
type: "number",

@@ -49,0 +49,0 @@ },

@@ -5,3 +5,3 @@ /**

*
* The version of the OpenAPI document: v4beta1
* The version of the OpenAPI document: v4
* Contact: support@sajari.com

@@ -13,3 +13,3 @@ *

*/
import { BucketsBucket } from "./bucketsBucket";
import { QueryAggregateResultBucketsBucket } from "./queryAggregateResultBucketsBucket";
/**

@@ -20,3 +20,3 @@ * Buckets is a full set of buckets computed in an aggregation.

"buckets"?: {
[key: string]: BucketsBucket;
[key: string]: QueryAggregateResultBucketsBucket;
};

@@ -23,0 +23,0 @@ static discriminator: string | undefined;

@@ -6,3 +6,3 @@ "use strict";

*
* The version of the OpenAPI document: v4beta1
* The version of the OpenAPI document: v4
* Contact: support@sajari.com

@@ -30,5 +30,5 @@ *

baseName: "buckets",
type: "{ [key: string]: BucketsBucket; }",
type: "{ [key: string]: QueryAggregateResultBucketsBucket; }",
},
];
//# sourceMappingURL=queryAggregateResultBuckets.js.map

@@ -5,3 +5,3 @@ /**

*
* The version of the OpenAPI document: v4beta1
* The version of the OpenAPI document: v4
* Contact: support@sajari.com

@@ -13,2 +13,5 @@ *

*/
/**
* Count contains the counts for the set of values returned.
*/
export declare class QueryAggregateResultCount {

@@ -15,0 +18,0 @@ "counts"?: {

@@ -6,3 +6,3 @@ "use strict";

*
* The version of the OpenAPI document: v4beta1
* The version of the OpenAPI document: v4
* Contact: support@sajari.com

@@ -16,2 +16,5 @@ *

exports.QueryAggregateResultCount = void 0;
/**
* Count contains the counts for the set of values returned.
*/
class QueryAggregateResultCount {

@@ -18,0 +21,0 @@ static getAttributeTypeMap() {

@@ -5,3 +5,3 @@ /**

*
* The version of the OpenAPI document: v4beta1
* The version of the OpenAPI document: v4
* Contact: support@sajari.com

@@ -8,0 +8,0 @@ *

@@ -6,3 +6,3 @@ "use strict";

*
* The version of the OpenAPI document: v4beta1
* The version of the OpenAPI document: v4
* Contact: support@sajari.com

@@ -9,0 +9,0 @@ *

@@ -5,3 +5,3 @@ /**

*
* The version of the OpenAPI document: v4beta1
* The version of the OpenAPI document: v4
* Contact: support@sajari.com

@@ -8,0 +8,0 @@ *

@@ -6,3 +6,3 @@ "use strict";

*
* The version of the OpenAPI document: v4beta1
* The version of the OpenAPI document: v4
* Contact: support@sajari.com

@@ -9,0 +9,0 @@ *

@@ -5,3 +5,3 @@ /**

*
* The version of the OpenAPI document: v4beta1
* The version of the OpenAPI document: v4
* Contact: support@sajari.com

@@ -8,0 +8,0 @@ *

@@ -6,3 +6,3 @@ "use strict";

*
* The version of the OpenAPI document: v4beta1
* The version of the OpenAPI document: v4
* Contact: support@sajari.com

@@ -9,0 +9,0 @@ *

export { withEndpoint, withKeyCredentials } from "./client";
export { CollectionsClient } from "./collections";
export { CollectionsClient, setCollectionDisplayName, setCollectionAuthorizedQueryDomains, } from "./collections";
export { SchemaClient } from "./schema";
export { PipelinesClient } from "./pipelines";
export { RecordsClient } from "./records";
export { V4beta1SchemaFieldType as SchemaFieldType, V4beta1SchemaField as SchemaField, SchemaFieldMode, } from "./generated/api";
export { HttpError, ModelError as APIError, SchemaFieldType, SchemaField, SchemaFieldMode, } from "./generated/api";
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SchemaFieldMode = exports.SchemaField = exports.SchemaFieldType = exports.RecordsClient = exports.PipelinesClient = exports.SchemaClient = exports.CollectionsClient = exports.withKeyCredentials = exports.withEndpoint = void 0;
exports.SchemaFieldMode = exports.SchemaField = exports.SchemaFieldType = exports.APIError = exports.HttpError = exports.RecordsClient = exports.PipelinesClient = exports.SchemaClient = exports.setCollectionAuthorizedQueryDomains = exports.setCollectionDisplayName = exports.CollectionsClient = exports.withKeyCredentials = exports.withEndpoint = void 0;
var client_1 = require("./client");

@@ -9,2 +9,4 @@ Object.defineProperty(exports, "withEndpoint", { enumerable: true, get: function () { return client_1.withEndpoint; } });

Object.defineProperty(exports, "CollectionsClient", { enumerable: true, get: function () { return collections_1.CollectionsClient; } });
Object.defineProperty(exports, "setCollectionDisplayName", { enumerable: true, get: function () { return collections_1.setCollectionDisplayName; } });
Object.defineProperty(exports, "setCollectionAuthorizedQueryDomains", { enumerable: true, get: function () { return collections_1.setCollectionAuthorizedQueryDomains; } });
var schema_1 = require("./schema");

@@ -17,5 +19,7 @@ Object.defineProperty(exports, "SchemaClient", { enumerable: true, get: function () { return schema_1.SchemaClient; } });

var api_1 = require("./generated/api");
Object.defineProperty(exports, "SchemaFieldType", { enumerable: true, get: function () { return api_1.V4beta1SchemaFieldType; } });
Object.defineProperty(exports, "SchemaField", { enumerable: true, get: function () { return api_1.V4beta1SchemaField; } });
Object.defineProperty(exports, "HttpError", { enumerable: true, get: function () { return api_1.HttpError; } });
Object.defineProperty(exports, "APIError", { enumerable: true, get: function () { return api_1.ModelError; } });
Object.defineProperty(exports, "SchemaFieldType", { enumerable: true, get: function () { return api_1.SchemaFieldType; } });
Object.defineProperty(exports, "SchemaField", { enumerable: true, get: function () { return api_1.SchemaField; } });
Object.defineProperty(exports, "SchemaFieldMode", { enumerable: true, get: function () { return api_1.SchemaFieldMode; } });
//# sourceMappingURL=index.js.map
import { Client } from "./client";
import { PipelinesApi, Sajariv4beta1Pipeline, V4beta1SetDefaultPipelineRequest, V4beta1GeneratePipelinesRequest, V4beta1SetDefaultVersionRequest } from "../src/generated/api";
import { PipelinesApi, Pipeline, SetDefaultPipelineRequest, GeneratePipelinesRequest, SetDefaultVersionRequest } from "./generated/api";
export { withEndpoint, withKeyCredentials } from "./client";
export declare const typeToEnum: (x?: string | undefined) => 1 | 0 | 2;
export declare class PipelinesClient extends Client {

@@ -14,3 +13,3 @@ collectionId: string;

view?: "basic" | "full";
}): Promise<import("./generated/api").Sajariv4beta1Pipeline1>;
}): Promise<Pipeline>;
listPipelines({ pageSize, pageToken, view, }: {

@@ -20,3 +19,3 @@ pageSize?: number;

view?: "basic" | "full";
}): Promise<import("./generated/api").V4beta1ListPipelinesResponse>;
}): Promise<import("./generated/api").ListPipelinesResponse>;
createPipeline({ type, name, version, ...rest }: {

@@ -26,11 +25,19 @@ type: "record" | "query";

version: string;
} & Omit<Sajariv4beta1Pipeline, "type" | "name" | "version" | "createTime">): Promise<import("./generated/api").Sajariv4beta1Pipeline1>;
generatePipelines(id: string, request: V4beta1GeneratePipelinesRequest): Promise<import("./generated/api").V4beta1GeneratePipelinesResponse>;
} & Omit<Pipeline, "type" | "name" | "version" | "createTime">): Promise<Pipeline>;
generatePipelines(id: string, request: GeneratePipelinesRequest): Promise<import("./generated/api").GeneratePipelinesResponse>;
setDefaultPipeline({ type, ...request }: {
type: "record" | "query";
} & Omit<V4beta1SetDefaultPipelineRequest, "type">): Promise<object>;
} & Omit<SetDefaultPipelineRequest, "type">): Promise<object>;
getDefaultPipeline({ type }: {
type: "record" | "query";
}): Promise<import("./generated/api").GetDefaultPipelineResponse>;
setDefaultPipelineVersion({ type, name, ...request }: {
type: "record" | "query";
name: string;
} & V4beta1SetDefaultVersionRequest): Promise<object>;
} & SetDefaultVersionRequest): Promise<object>;
getDefaultPipelineVersion({ type, name, view, }: {
type: "record" | "query";
name: string;
view: "basic" | "full";
}): Promise<Pipeline>;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PipelinesClient = exports.typeToEnum = exports.withKeyCredentials = exports.withEndpoint = void 0;
exports.PipelinesClient = exports.withKeyCredentials = exports.withEndpoint = void 0;
const client_1 = require("./client");
const api_1 = require("../src/generated/api");
const api_1 = require("./generated/api");
const user_agent_1 = require("./user-agent");
const api_util_1 = require("./api-util");
var client_2 = require("./client");
Object.defineProperty(exports, "withEndpoint", { enumerable: true, get: function () { return client_2.withEndpoint; } });
Object.defineProperty(exports, "withKeyCredentials", { enumerable: true, get: function () { return client_2.withKeyCredentials; } });
// TODO(jingram): work out how to return the enum int.
exports.typeToEnum = (x) => {
const typeToEnum = (x) => {
switch (x) {
case "record":
return 1;
return api_1.PipelineType.Record;
case "query":
return 2;
return api_1.PipelineType.Query;
default:
return 0;
return api_1.PipelineType.TypeUnspecified;
}
};
const typeToEnumString = (x) => {
switch (x) {
case "record":
return "RECORD";
case "query":
return "QUERY";
default:
return "TYPE_UNSPECIFIED";
}
};
const viewToEnum = (x) => {

@@ -37,6 +48,14 @@ switch (x) {

this.client.password = this.keySecret;
this.client.defaultHeaders = {
[user_agent_1.clientUserAgentHeader]: user_agent_1.clientUserAgent(),
};
}
async getPipeline({ type, name, version, view, }) {
const res = await this.client.getPipeline(this.collectionId, type, name, version, viewToEnum(view));
return res.body;
try {
const res = await this.client.getPipeline(this.collectionId, typeToEnumString(type), name, version, viewToEnum(view));
return res.body;
}
catch (e) {
throw api_util_1.handleError(e);
}
}

@@ -49,7 +68,3 @@ async listPipelines({ pageSize, pageToken, view, }) {

catch (e) {
if (e instanceof api_1.HttpError) {
console.error(JSON.stringify(e.response));
// TODO(jingram): wrap common errors
}
throw e;
throw api_util_1.handleError(e);
}

@@ -60,3 +75,3 @@ }

const res = await this.client.createPipeline(this.collectionId, {
type: exports.typeToEnum(type),
type: typeToEnum(type),
name,

@@ -69,12 +84,13 @@ version,

catch (e) {
if (e instanceof api_1.HttpError) {
console.error(JSON.stringify(e.response));
// TODO(jingram): wrap common errors
}
throw e;
throw api_util_1.handleError(e);
}
}
async generatePipelines(id, request) {
const res = await this.client.generatePipelines(id, request);
return res.body;
try {
const res = await this.client.generatePipelines(id, request);
return res.body;
}
catch (e) {
throw api_util_1.handleError(e);
}
}

@@ -85,3 +101,3 @@ async setDefaultPipeline({ type, ...request }) {

...request,
type: exports.typeToEnum(type),
type: typeToEnum(type),
});

@@ -91,12 +107,17 @@ return res.body;

catch (e) {
if (e instanceof api_1.HttpError) {
console.error(JSON.stringify(e.response));
// TODO(jingram): wrap common errors
}
throw e;
throw api_util_1.handleError(e);
}
}
async getDefaultPipeline({ type }) {
try {
const res = await this.client.getDefaultPipeline(this.collectionId, typeToEnumString(type));
return res.body;
}
catch (e) {
throw api_util_1.handleError(e);
}
}
async setDefaultPipelineVersion({ type, name, ...request }) {
try {
const res = await this.client.setDefaultVersion(this.collectionId, type, name, {
const res = await this.client.setDefaultVersion(this.collectionId, typeToEnumString(type), name, {
...request,

@@ -107,11 +128,16 @@ });

catch (e) {
if (e instanceof api_1.HttpError) {
console.error(JSON.stringify(e.response));
// TODO(jingram): wrap common errors
}
throw e;
throw api_util_1.handleError(e);
}
}
async getDefaultPipelineVersion({ type, name, view, }) {
try {
const res = await this.client.getDefaultVersion(this.collectionId, typeToEnumString(type), name, viewToEnum(view));
return res.body;
}
catch (e) {
throw api_util_1.handleError(e);
}
}
}
exports.PipelinesClient = PipelinesClient;
//# sourceMappingURL=pipelines.js.map
import { Client } from "./client";
import { RecordsApi, V4beta1PutRecordRequest, Sajariv4beta1Key, V4beta1BatchPutRecordsRequest } from "../src/generated/api";
import { RecordsApi, UpsertRecordRequest, RecordKey, BatchUpsertRecordsRequest } from "./generated/api";
export { withEndpoint, withKeyCredentials } from "./client";

@@ -8,8 +8,11 @@ export declare class RecordsClient extends Client {

constructor(collectionId: string, ...options: Array<(client: Client) => void>);
getRecord(key: Sajariv4beta1Key): Promise<object>;
putRecord(request: V4beta1PutRecordRequest): Promise<import("./generated/api").V4beta1PutRecordResponse>;
batchPutRecords(request: Omit<V4beta1BatchPutRecordsRequest, "records"> & {
getRecord(key: RecordKey): Promise<object>;
upsertRecord(request: UpsertRecordRequest): Promise<{
key: RecordKey;
variables?: object | undefined;
}>;
batchUpsertRecords(request: Omit<BatchUpsertRecordsRequest, "records"> & {
records: object[];
}): Promise<import("./generated/api").V4beta1BatchPutRecordsResponse>;
deleteRecord(key: Sajariv4beta1Key): Promise<any>;
}): Promise<import("./generated/api").BatchUpsertRecordsResponse>;
deleteRecord(key: RecordKey): Promise<any>;
}

@@ -5,3 +5,5 @@ "use strict";

const client_1 = require("./client");
const api_1 = require("../src/generated/api");
const api_1 = require("./generated/api");
const user_agent_1 = require("./user-agent");
const api_util_1 = require("./api-util");
var client_2 = require("./client");

@@ -17,2 +19,5 @@ Object.defineProperty(exports, "withEndpoint", { enumerable: true, get: function () { return client_2.withEndpoint; } });

this.client.password = this.keySecret;
this.client.defaultHeaders = {
[user_agent_1.clientUserAgentHeader]: user_agent_1.clientUserAgent(),
};
}

@@ -25,33 +30,24 @@ async getRecord(key) {

catch (e) {
if (e instanceof api_1.HttpError) {
console.error(JSON.stringify(e.response));
// TODO(jingram): wrap common errors
}
throw e;
throw api_util_1.handleError(e);
}
}
async putRecord(request) {
async upsertRecord(request) {
try {
const res = await this.client.putRecord(this.collectionId, request);
return res.body;
const res = await this.client.upsertRecord(this.collectionId, request);
// OpenAPI readonly fields become optional TS fields, but we know the API
// will return it, so use ! to fix the types. This is done so upstream
// users don't have to do this.
return { ...res.body, key: res.body.key };
}
catch (e) {
if (e instanceof api_1.HttpError) {
console.error(JSON.stringify(e.response));
// TODO(jingram): wrap common errors
}
throw e;
throw api_util_1.handleError(e);
}
}
async batchPutRecords(request) {
async batchUpsertRecords(request) {
try {
const res = await this.client.batchPutRecords(this.collectionId, request);
const res = await this.client.batchUpsertRecords(this.collectionId, request);
return res.body;
}
catch (e) {
if (e instanceof api_1.HttpError) {
console.error(JSON.stringify(e.response));
// TODO(jingram): wrap common errors
}
throw e;
throw api_util_1.handleError(e);
}

@@ -65,7 +61,3 @@ }

catch (e) {
if (e instanceof api_1.HttpError) {
console.error(JSON.stringify(e.response));
// TODO(jingram): wrap common errors
}
throw e;
throw api_util_1.handleError(e);
}

@@ -72,0 +64,0 @@ }

@@ -22,9 +22,9 @@ "use strict";

}
async function putRecord(id) {
const record = await client.putRecord({ record: { id } });
await client.deleteRecord(record.key); // TODO(jingram): remove ! once types are fixed.
async function upsertRecord(id) {
const record = await client.upsertRecord({ record: { id } });
await client.deleteRecord(record.key);
}
test("put record", async () => {
await putRecord(ksuid_1.default.randomSync().string);
test("upsert record", async () => {
await upsertRecord(ksuid_1.default.randomSync().string);
});
//# sourceMappingURL=records.test.js.map
import { Client } from "./client";
import { SchemaApi, V4beta1SchemaField1 } from "../src/generated/api";
import { SchemaApi, SchemaField } from "./generated/api";
export { withEndpoint, withKeyCredentials } from "./client";

@@ -11,7 +11,7 @@ export declare class SchemaClient extends Client {

pageToken?: string;
}): Promise<import("./generated/api").V4beta1ListSchemaFieldsResponse>;
createField(field: V4beta1SchemaField1): Promise<V4beta1SchemaField1>;
}): Promise<import("./generated/api").ListSchemaFieldsResponse>;
createField(field: SchemaField): Promise<SchemaField>;
batchCreateFields({ fields }: {
fields: V4beta1SchemaField1[];
}): Promise<import("./generated/api").V4beta1BatchCreateSchemaFieldsResponse>;
fields: SchemaField[];
}): Promise<import("./generated/api").BatchCreateSchemaFieldsResponse>;
}

@@ -5,3 +5,5 @@ "use strict";

const client_1 = require("./client");
const api_1 = require("../src/generated/api");
const api_1 = require("./generated/api");
const user_agent_1 = require("./user-agent");
const api_util_1 = require("./api-util");
var client_2 = require("./client");

@@ -17,2 +19,5 @@ Object.defineProperty(exports, "withEndpoint", { enumerable: true, get: function () { return client_2.withEndpoint; } });

this.client.password = this.keySecret;
this.client.defaultHeaders = {
[user_agent_1.clientUserAgentHeader]: user_agent_1.clientUserAgent(),
};
}

@@ -25,7 +30,3 @@ async listFields({ pageSize, pageToken, }) {

catch (e) {
if (e instanceof api_1.HttpError) {
console.error(JSON.stringify(e.response));
// TODO(jingram): wrap common errors
}
throw e;
throw api_util_1.handleError(e);
}

@@ -39,7 +40,3 @@ }

catch (e) {
if (e instanceof api_1.HttpError) {
console.error(JSON.stringify(e.response));
// TODO(jingram): wrap common errors
}
throw e;
throw api_util_1.handleError(e);
}

@@ -55,7 +52,3 @@ }

catch (e) {
if (e instanceof api_1.HttpError) {
console.error(JSON.stringify(e.response));
// TODO(jingram): wrap common errors
}
throw e;
throw api_util_1.handleError(e);
}

@@ -62,0 +55,0 @@ }

{
"name": "@sajari/sdk-node",
"version": "4.0.0-alpha.6",
"version": "4.0.0-alpha.7",
"repository": "git@github.com:github.com/sajari/sdk-node.git",

@@ -16,16 +16,16 @@ "author": "Sajari Pty Ltd",

"dependencies": {
"ksuid": "^2.0.0",
"request": "2.88.2"
},
"devDependencies": {
"@types/jest": "^26.0.13",
"@types/node": "14.6.4",
"@types/jest": "^26.0.19",
"@types/node": "14.14.13",
"@types/request": "2.48.5",
"csv-parser": "^2.3.3",
"jest": "^26.4.2",
"prettier": "2.1.1",
"csv-parser": "^3.0.0",
"jest": "^26.6.3",
"ksuid": "^2.0.0",
"msw": "0.23.0",
"prettier": "2.2.1",
"rimraf": "^3.0.2",
"ts-jest": "^26.3.0",
"ts-node": "^9.0.0",
"typescript": "^4.0.2"
"ts-jest": "^26.4.4",
"typescript": "^4.1.3"
},

@@ -38,4 +38,8 @@ "scripts": {

"test": "jest",
"test:watch": "jest --watch",
"test-examples": "cd examples && npm test && cd ../"
},
"volta": {
"node": "12.20.0"
}
}

@@ -1,5 +0,11 @@

# sajari-sdk-node
# Sajari SDK for Node
**Table of contents:**
[![Build status](https://github.com/sajari/sdk-node/workflows/Build/badge.svg?branch=master)](https://github.com/sajari/sdk-node/actions)
The official [Sajari](https://www.sajari.com) Node client library.
Sajari is a smart, highly-configurable, real-time search service that enables thousands of businesses worldwide to provide amazing search experiences on their websites, stores, and applications.
## Table of contents
- [Quickstart](#quickstart)

@@ -34,16 +40,15 @@ - [Before you begin](#before-you-begin)

// Import the Sajari SDK.
const { CollectionsClient, withKeyCredentials } = require("@sajari/sdk-node");
import { CollectionsClient, withKeyCredentials } from "@sajari/sdk-node";
// Create a client for working with collections from the account key
// credentials.
// Create a client for working with collections from account key credentials.
const client = new CollectionsClient(
withKeyCredentials("key-id", "key-secret")
withKeyCredentials("account-key-id", "account-key-secret")
);
async function createCollection(displayName) {
async function createCollection(id, displayName) {
// Create a new collection.
const collection = await client.createCollection({ displayName });
const collection = await client.createCollection({ id, displayName });
console.log(`Collection ${collection.displayName} created.`);
// Clean up.
// Clean up. Remove this in your application to keep the collection.
await client.deleteCollection(collection.id);

@@ -59,28 +64,30 @@ }

Examples are in the [examples](https://github.com/sajari/sdk-node/blob/v4/examples) directory.
Examples are in the [examples](https://github.com/sajari/sdk-node/blob/master/examples) directory.
| Example | Source code |
| ---------------------------- | -------------------------------------------------------------------------------------------------- |
| Batch create schema fields | [source code](https://github.com/sajari/sdk-node/blob/v4/examples/batch-create-schema-fields.ts) |
| Batch put records | [source code](https://github.com/sajari/sdk-node/blob/v4/examples/batch-put-records.ts) |
| Create collection | [source code](https://github.com/sajari/sdk-node/blob/v4/examples/create-collection.ts) |
| Create pipeline | [source code](https://github.com/sajari/sdk-node/blob/v4/examples/create-pipeline.ts) |
| Create schema field | [source code](https://github.com/sajari/sdk-node/blob/v4/examples/create-schema-field.ts) |
| Delete collection | [source code](https://github.com/sajari/sdk-node/blob/v4/examples/delete-collection.ts) |
| Delete record | [source code](https://github.com/sajari/sdk-node/blob/v4/examples/delete-record.ts) |
| Generate pipelines | [source code](https://github.com/sajari/sdk-node/blob/v4/examples/generate-pipelines.ts) |
| Get collection | [source code](https://github.com/sajari/sdk-node/blob/v4/examples/get-collection.ts) |
| Get pipeline | [source code](https://github.com/sajari/sdk-node/blob/v4/examples/get-pipeline.ts) |
| Get record | [source code](https://github.com/sajari/sdk-node/blob/v4/examples/get-record.ts) |
| List collections | [source code](https://github.com/sajari/sdk-node/blob/v4/examples/list-collections.ts) |
| List pipelines | [source code](https://github.com/sajari/sdk-node/blob/v4/examples/list-pipelines.ts) |
| List schema fields | [source code](https://github.com/sajari/sdk-node/blob/v4/examples/list-schema-fields.ts) |
| Put record | [source code](https://github.com/sajari/sdk-node/blob/v4/examples/put-record.ts) |
| Query collection | [source code](https://github.com/sajari/sdk-node/blob/v4/examples/query-collection.ts) |
| Set default pipeline | [source code](https://github.com/sajari/sdk-node/blob/v4/examples/set-default-pipeline.ts) |
| Set default pipeline version | [source code](https://github.com/sajari/sdk-node/blob/v4/examples/set-default-pipeline-version.ts) |
| Example | Source code |
| ---------------------------- | ------------------------------------------------------------------------------------------------------ |
| Batch create schema fields | [source code](https://github.com/sajari/sdk-node/blob/master/examples/batch-create-schema-fields.ts) |
| Batch upsert records | [source code](https://github.com/sajari/sdk-node/blob/master/examples/batch-upsert-records.ts) |
| Create collection | [source code](https://github.com/sajari/sdk-node/blob/master/examples/create-collection.ts) |
| Create pipeline | [source code](https://github.com/sajari/sdk-node/blob/master/examples/create-pipeline.ts) |
| Create schema field | [source code](https://github.com/sajari/sdk-node/blob/master/examples/create-schema-field.ts) |
| Delete collection | [source code](https://github.com/sajari/sdk-node/blob/master/examples/delete-collection.ts) |
| Delete record | [source code](https://github.com/sajari/sdk-node/blob/master/examples/delete-record.ts) |
| Generate pipelines | [source code](https://github.com/sajari/sdk-node/blob/master/examples/generate-pipelines.ts) |
| Get collection | [source code](https://github.com/sajari/sdk-node/blob/master/examples/get-collection.ts) |
| Get pipeline | [source code](https://github.com/sajari/sdk-node/blob/master/examples/get-pipeline.ts) |
| Get record | [source code](https://github.com/sajari/sdk-node/blob/master/examples/get-record.ts) |
| List collections | [source code](https://github.com/sajari/sdk-node/blob/master/examples/list-collections.ts) |
| List pipelines | [source code](https://github.com/sajari/sdk-node/blob/master/examples/list-pipelines.ts) |
| List schema fields | [source code](https://github.com/sajari/sdk-node/blob/master/examples/list-schema-fields.ts) |
| Upsert record | [source code](https://github.com/sajari/sdk-node/blob/master/examples/upsert-record.ts) |
| Query collection | [source code](https://github.com/sajari/sdk-node/blob/master/examples/query-collection.ts) |
| Set default pipeline | [source code](https://github.com/sajari/sdk-node/blob/master/examples/set-default-pipeline.ts) |
| Get default pipeline | [source code](https://github.com/sajari/sdk-node/blob/master/examples/get-default-pipeline.ts) |
| Set default pipeline version | [source code](https://github.com/sajari/sdk-node/blob/master/examples/set-default-pipeline-version.ts) |
| Get default pipeline version | [source code](https://github.com/sajari/sdk-node/blob/master/examples/get-default-pipeline-version.ts) |
## Contributing
Contributions are welcome. See the [Contributing](https://github.com/sajari/sdk-node/blob/v4/examples/CONTRIBUTING.md) guide.
Contributions are welcome. See the [Contributing](https://github.com/sajari/sdk-node/blob/master/examples/CONTRIBUTING.md) guide.

@@ -91,2 +98,2 @@ ## License

See [LICENSE](https://github.com/sajari/sdk-node/blob/v4/LICENSE)
See [LICENSE](https://github.com/sajari/sdk-node/blob/master/LICENSE)
SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc