You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@or-sdk/qna

Package Overview
Dependencies
Maintainers
2
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@or-sdk/qna - npm Package Compare versions

Comparing version

to
1.6.2-beta.1450.0

40

dist/cjs/QnA.js

@@ -17,13 +17,2 @@ "use strict";

})();
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -65,13 +54,2 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

};
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -133,14 +111,12 @@ exports.QnA = void 0;

};
QnA.prototype.createPassage = function (collectionId, params) {
QnA.prototype.createPassage = function (collectionId, passage) {
return __awaiter(this, void 0, void 0, function () {
var content, documentId, properties, response;
var response;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
content = params.content, documentId = params.documentId, properties = __rest(params, ["content", "documentId"]);
return [4, this.callApiV2({
method: 'POST',
route: "collections/".concat(collectionId, "/passages"),
data: __assign({ content: content, documentId: documentId }, properties),
})];
case 0: return [4, this.callApiV2({
method: 'POST',
route: "collections/".concat(collectionId, "/passages"),
data: passage,
})];
case 1:

@@ -159,3 +135,3 @@ response = _a.sent();

method: 'POST',
route: "collections/".concat(collectionId, "/passages"),
route: "collections/".concat(collectionId, "/passages/batch"),
data: passages,

@@ -162,0 +138,0 @@ })];

19

dist/esm/QnA.js

@@ -10,13 +10,2 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

};
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
import { Base, makeList } from '@or-sdk/base';

@@ -60,10 +49,8 @@ import { SERVICE_KEY } from './constants';

}
createPassage(collectionId, params) {
createPassage(collectionId, passage) {
return __awaiter(this, void 0, void 0, function* () {
const { content, documentId } = params, properties = __rest(params, ["content", "documentId"]);
const response = yield this.callApiV2({
method: 'POST',
route: `collections/${collectionId}/passages`,
data: Object.assign({ content,
documentId }, properties),
data: passage,
});

@@ -77,3 +64,3 @@ return response;

method: 'POST',
route: `collections/${collectionId}/passages`,
route: `collections/${collectionId}/passages/batch`,
data: passages,

@@ -80,0 +67,0 @@ });

@@ -7,3 +7,3 @@ import { Base, List } from '@or-sdk/base';

createCollection(params: CreateCollection): Promise<Collection>;
createPassage(collectionId: string, params: CreatePassage): Promise<Passage>;
createPassage(collectionId: string, passage: CreatePassage): Promise<Passage>;
createManyPassages(collectionId: string, passages: CreatePassage[]): Promise<void>;

@@ -10,0 +10,0 @@ deleteCollection(collectionId: string): Promise<Collection>;

{
"name": "@or-sdk/qna",
"version": "1.6.1",
"version": "1.6.2-beta.1450.0",
"main": "dist/cjs/index.js",

@@ -30,4 +30,3 @@ "module": "dist/esm/index.js",

"access": "public"
},
"gitHead": "eba5a8ffb828bd4e8888216aff585f98922c859d"
}
}

@@ -62,16 +62,10 @@ import { Base, List, makeList } from '@or-sdk/base';

* @param collectionId - The ID of the collection the passage belongs to.
* @param params - The passage creation parameters.
* @param passage - The passage creation parameters.
* @returns The created passage.
*/
async createPassage(collectionId: string, params: CreatePassage): Promise<Passage> {
const { content, documentId, ...properties } = params;
async createPassage(collectionId: string, passage: CreatePassage): Promise<Passage> {
const response = await this.callApiV2<Passage>({
method: 'POST',
route: `collections/${collectionId}/passages`,
data: {
content,
documentId,
...properties,
},
data: passage,
});

@@ -90,3 +84,3 @@

method: 'POST',
route: `collections/${collectionId}/passages`,
route: `collections/${collectionId}/passages/batch`,
data: passages,

@@ -93,0 +87,0 @@ });

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet