@or-sdk/lookup 1.1.0-beta.1830.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/README.md +983 -0
  2. package/dist/cjs/Lookup.js +413 -0
  3. package/dist/cjs/Lookup.js.map +1 -0
  4. package/dist/cjs/__tests__/QnA.collections.spec.js +177 -0
  5. package/dist/cjs/__tests__/QnA.collections.spec.js.map +1 -0
  6. package/dist/cjs/__tests__/fixtures/collection.json +34 -0
  7. package/dist/cjs/constants.js +5 -0
  8. package/dist/cjs/constants.js.map +1 -0
  9. package/dist/cjs/error-parser/OrNetworkError.js +45 -0
  10. package/dist/cjs/error-parser/OrNetworkError.js.map +1 -0
  11. package/dist/cjs/error-parser/index.js +34 -0
  12. package/dist/cjs/error-parser/index.js.map +1 -0
  13. package/dist/cjs/error-parser/parse-axios-error.js +38 -0
  14. package/dist/cjs/error-parser/parse-axios-error.js.map +1 -0
  15. package/dist/cjs/error-parser/processors.js +22 -0
  16. package/dist/cjs/error-parser/processors.js.map +1 -0
  17. package/dist/cjs/error-parser/types.js +3 -0
  18. package/dist/cjs/error-parser/types.js.map +1 -0
  19. package/dist/cjs/guards.js +9 -0
  20. package/dist/cjs/guards.js.map +1 -0
  21. package/dist/cjs/index.js +23 -0
  22. package/dist/cjs/index.js.map +1 -0
  23. package/dist/cjs/types.js +11 -0
  24. package/dist/cjs/types.js.map +1 -0
  25. package/dist/esm/Lookup.js +221 -0
  26. package/dist/esm/Lookup.js.map +1 -0
  27. package/dist/esm/__tests__/QnA.collections.spec.js +89 -0
  28. package/dist/esm/__tests__/QnA.collections.spec.js.map +1 -0
  29. package/dist/esm/__tests__/fixtures/collection.json +34 -0
  30. package/dist/esm/constants.js +2 -0
  31. package/dist/esm/constants.js.map +1 -0
  32. package/dist/esm/error-parser/OrNetworkError.js +14 -0
  33. package/dist/esm/error-parser/OrNetworkError.js.map +1 -0
  34. package/dist/esm/error-parser/index.js +12 -0
  35. package/dist/esm/error-parser/index.js.map +1 -0
  36. package/dist/esm/error-parser/parse-axios-error.js +34 -0
  37. package/dist/esm/error-parser/parse-axios-error.js.map +1 -0
  38. package/dist/esm/error-parser/processors.js +16 -0
  39. package/dist/esm/error-parser/processors.js.map +1 -0
  40. package/dist/esm/error-parser/types.js +2 -0
  41. package/dist/esm/error-parser/types.js.map +1 -0
  42. package/dist/esm/guards.js +5 -0
  43. package/dist/esm/guards.js.map +1 -0
  44. package/dist/esm/index.js +5 -0
  45. package/dist/esm/index.js.map +1 -0
  46. package/dist/esm/types.js +8 -0
  47. package/dist/esm/types.js.map +1 -0
  48. package/dist/types/Lookup.d.ts +27 -0
  49. package/dist/types/Lookup.d.ts.map +1 -0
  50. package/dist/types/__tests__/QnA.collections.spec.d.ts +2 -0
  51. package/dist/types/__tests__/QnA.collections.spec.d.ts.map +1 -0
  52. package/dist/types/constants.d.ts +2 -0
  53. package/dist/types/constants.d.ts.map +1 -0
  54. package/dist/types/error-parser/OrNetworkError.d.ts +14 -0
  55. package/dist/types/error-parser/OrNetworkError.d.ts.map +1 -0
  56. package/dist/types/error-parser/index.d.ts +5 -0
  57. package/dist/types/error-parser/index.d.ts.map +1 -0
  58. package/dist/types/error-parser/parse-axios-error.d.ts +3 -0
  59. package/dist/types/error-parser/parse-axios-error.d.ts.map +1 -0
  60. package/dist/types/error-parser/processors.d.ts +7 -0
  61. package/dist/types/error-parser/processors.d.ts.map +1 -0
  62. package/dist/types/error-parser/types.d.ts +6 -0
  63. package/dist/types/error-parser/types.d.ts.map +1 -0
  64. package/dist/types/guards.d.ts +3 -0
  65. package/dist/types/guards.d.ts.map +1 -0
  66. package/dist/types/index.d.ts +5 -0
  67. package/dist/types/index.d.ts.map +1 -0
  68. package/dist/types/types.d.ts +146 -0
  69. package/dist/types/types.d.ts.map +1 -0
  70. package/package.json +37 -0
  71. package/src/Lookup.ts +353 -0
  72. package/src/__tests__/QnA.collections.spec.ts +108 -0
  73. package/src/__tests__/fixtures/collection.json +34 -0
  74. package/src/constants.ts +1 -0
  75. package/src/error-parser/OrNetworkError.ts +23 -0
  76. package/src/error-parser/index.ts +16 -0
  77. package/src/error-parser/parse-axios-error.ts +40 -0
  78. package/src/error-parser/processors.ts +21 -0
  79. package/src/error-parser/types.ts +6 -0
  80. package/src/guards.ts +5 -0
  81. package/src/index.ts +4 -0
  82. package/src/types.ts +629 -0
  83. package/tsconfig.dev.json +8 -0
  84. package/tsconfig.esm.json +12 -0
  85. package/tsconfig.json +7 -0
  86. package/tsconfig.types.json +10 -0
  87. package/vitest.config.js +24 -0
@@ -0,0 +1,413 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ var __generator = (this && this.__generator) || function (thisArg, body) {
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
+ function verb(n) { return function (v) { return step([n, v]); }; }
30
+ function step(op) {
31
+ if (f) throw new TypeError("Generator is already executing.");
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
+ if (y = 0, t) op = [op[0] & 2, t.value];
35
+ switch (op[0]) {
36
+ case 0: case 1: t = op; break;
37
+ case 4: _.label++; return { value: op[1], done: false };
38
+ case 5: _.label++; y = op[1]; op = [0]; continue;
39
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
+ default:
41
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
+ if (t[2]) _.ops.pop();
46
+ _.trys.pop(); continue;
47
+ }
48
+ op = body.call(thisArg, _);
49
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
+ }
52
+ };
53
+ Object.defineProperty(exports, "__esModule", { value: true });
54
+ exports.Lookup = void 0;
55
+ var base_1 = require("@or-sdk/base");
56
+ var constants_1 = require("./constants");
57
+ var error_parser_1 = require("./error-parser");
58
+ var errorParser = (0, error_parser_1.createErrorParser)(error_parser_1.processors.AXIOS);
59
+ var Lookup = (function (_super) {
60
+ __extends(Lookup, _super);
61
+ function Lookup(params) {
62
+ var token = params.token, discoveryUrl = params.discoveryUrl, accountId = params.accountId, serviceUrl = params.serviceUrl;
63
+ return _super.call(this, {
64
+ token: token,
65
+ discoveryUrl: discoveryUrl,
66
+ serviceKey: constants_1.SERVICE_KEY,
67
+ accountId: accountId,
68
+ serviceUrl: serviceUrl,
69
+ }) || this;
70
+ }
71
+ Lookup.prototype.parseError = function (err) {
72
+ return errorParser(err);
73
+ };
74
+ Lookup.prototype.loadDocument = function (collectionId, params) {
75
+ return __awaiter(this, void 0, void 0, function () {
76
+ var response;
77
+ return __generator(this, function (_a) {
78
+ switch (_a.label) {
79
+ case 0: return [4, this.callApiV2({
80
+ method: 'POST',
81
+ route: "collections/".concat(collectionId, "/documents"),
82
+ data: params,
83
+ })];
84
+ case 1:
85
+ response = _a.sent();
86
+ return [2, response];
87
+ }
88
+ });
89
+ });
90
+ };
91
+ Lookup.prototype.createCollection = function (params) {
92
+ return __awaiter(this, void 0, void 0, function () {
93
+ var response;
94
+ return __generator(this, function (_a) {
95
+ switch (_a.label) {
96
+ case 0: return [4, this.callApiV2({
97
+ method: 'POST',
98
+ route: 'collections',
99
+ data: params,
100
+ })];
101
+ case 1:
102
+ response = _a.sent();
103
+ return [2, response];
104
+ }
105
+ });
106
+ });
107
+ };
108
+ Lookup.prototype.createPassage = function (collectionId, passage) {
109
+ return __awaiter(this, void 0, void 0, function () {
110
+ var response;
111
+ return __generator(this, function (_a) {
112
+ switch (_a.label) {
113
+ case 0: return [4, this.callApiV2({
114
+ method: 'POST',
115
+ route: "collections/".concat(collectionId, "/passages"),
116
+ data: passage,
117
+ })];
118
+ case 1:
119
+ response = _a.sent();
120
+ return [2, response];
121
+ }
122
+ });
123
+ });
124
+ };
125
+ Lookup.prototype.createManyPassages = function (collectionId, passages) {
126
+ return __awaiter(this, void 0, void 0, function () {
127
+ return __generator(this, function (_a) {
128
+ switch (_a.label) {
129
+ case 0: return [4, this.callApiV2({
130
+ method: 'POST',
131
+ route: "collections/".concat(collectionId, "/passages/batch"),
132
+ data: passages,
133
+ })];
134
+ case 1:
135
+ _a.sent();
136
+ return [2];
137
+ }
138
+ });
139
+ });
140
+ };
141
+ Lookup.prototype.deleteCollection = function (collectionId) {
142
+ return __awaiter(this, void 0, void 0, function () {
143
+ var response;
144
+ return __generator(this, function (_a) {
145
+ switch (_a.label) {
146
+ case 0: return [4, this.callApiV2({
147
+ method: 'DELETE',
148
+ route: "collections/".concat(collectionId),
149
+ })];
150
+ case 1:
151
+ response = _a.sent();
152
+ return [2, response];
153
+ }
154
+ });
155
+ });
156
+ };
157
+ Lookup.prototype.deletePassage = function (collectionId, passageId) {
158
+ return __awaiter(this, void 0, void 0, function () {
159
+ var response;
160
+ return __generator(this, function (_a) {
161
+ switch (_a.label) {
162
+ case 0: return [4, this.callApiV2({
163
+ method: 'DELETE',
164
+ route: "collections/".concat(collectionId, "/passages/").concat(passageId),
165
+ })];
166
+ case 1:
167
+ response = _a.sent();
168
+ return [2, response];
169
+ }
170
+ });
171
+ });
172
+ };
173
+ Lookup.prototype.search = function (collectionId, params) {
174
+ return __awaiter(this, void 0, void 0, function () {
175
+ var response;
176
+ return __generator(this, function (_a) {
177
+ switch (_a.label) {
178
+ case 0: return [4, this.callApiV2({
179
+ method: 'POST',
180
+ route: "collections/".concat(collectionId, "/search"),
181
+ data: params,
182
+ })];
183
+ case 1:
184
+ response = _a.sent();
185
+ return [2, response];
186
+ }
187
+ });
188
+ });
189
+ };
190
+ Lookup.prototype.ask = function (collectionId, params) {
191
+ return __awaiter(this, void 0, void 0, function () {
192
+ var response;
193
+ return __generator(this, function (_a) {
194
+ switch (_a.label) {
195
+ case 0: return [4, this.callApiV2({
196
+ method: 'POST',
197
+ route: "collections/".concat(collectionId, "/ask"),
198
+ data: params,
199
+ })];
200
+ case 1:
201
+ response = _a.sent();
202
+ return [2, response];
203
+ }
204
+ });
205
+ });
206
+ };
207
+ Lookup.prototype.updateDocument = function (collectionId, documentId, params) {
208
+ return __awaiter(this, void 0, void 0, function () {
209
+ var response;
210
+ return __generator(this, function (_a) {
211
+ switch (_a.label) {
212
+ case 0: return [4, this.callApiV2({
213
+ method: 'PUT',
214
+ route: "collections/".concat(collectionId, "/documents/").concat(documentId),
215
+ data: params,
216
+ })];
217
+ case 1:
218
+ response = _a.sent();
219
+ return [2, response];
220
+ }
221
+ });
222
+ });
223
+ };
224
+ Lookup.prototype.updatePassage = function (collectionId, passageId, params) {
225
+ return __awaiter(this, void 0, void 0, function () {
226
+ var response;
227
+ return __generator(this, function (_a) {
228
+ switch (_a.label) {
229
+ case 0: return [4, this.callApiV2({
230
+ method: 'PUT',
231
+ route: "collections/".concat(collectionId, "/passages/").concat(passageId),
232
+ data: params,
233
+ })];
234
+ case 1:
235
+ response = _a.sent();
236
+ return [2, response];
237
+ }
238
+ });
239
+ });
240
+ };
241
+ Lookup.prototype.updateCollection = function (collectionId, params) {
242
+ return __awaiter(this, void 0, void 0, function () {
243
+ var response;
244
+ return __generator(this, function (_a) {
245
+ switch (_a.label) {
246
+ case 0: return [4, this.callApiV2({
247
+ method: 'PUT',
248
+ route: "collections/".concat(collectionId),
249
+ data: params,
250
+ })];
251
+ case 1:
252
+ response = _a.sent();
253
+ return [2, response];
254
+ }
255
+ });
256
+ });
257
+ };
258
+ Lookup.prototype.getDocument = function (collectionId, documentId) {
259
+ return __awaiter(this, void 0, void 0, function () {
260
+ var response;
261
+ return __generator(this, function (_a) {
262
+ switch (_a.label) {
263
+ case 0: return [4, this.callApiV2({
264
+ method: 'GET',
265
+ route: "collections/".concat(collectionId, "/documents/").concat(documentId),
266
+ })];
267
+ case 1:
268
+ response = _a.sent();
269
+ return [2, response];
270
+ }
271
+ });
272
+ });
273
+ };
274
+ Lookup.prototype.getCollection = function (collectionId) {
275
+ return __awaiter(this, void 0, void 0, function () {
276
+ var response;
277
+ return __generator(this, function (_a) {
278
+ switch (_a.label) {
279
+ case 0: return [4, this.callApiV2({
280
+ method: 'GET',
281
+ route: "collections/".concat(collectionId),
282
+ })];
283
+ case 1:
284
+ response = _a.sent();
285
+ return [2, response];
286
+ }
287
+ });
288
+ });
289
+ };
290
+ Lookup.prototype.getPassage = function (collectionId, passageId) {
291
+ return __awaiter(this, void 0, void 0, function () {
292
+ var response;
293
+ return __generator(this, function (_a) {
294
+ switch (_a.label) {
295
+ case 0: return [4, this.callApiV2({
296
+ method: 'GET',
297
+ route: "collections/".concat(collectionId, "/passages/").concat(passageId),
298
+ })];
299
+ case 1:
300
+ response = _a.sent();
301
+ return [2, response];
302
+ }
303
+ });
304
+ });
305
+ };
306
+ Lookup.prototype.addProperty = function (collectionId, property) {
307
+ return __awaiter(this, void 0, void 0, function () {
308
+ return __generator(this, function (_a) {
309
+ switch (_a.label) {
310
+ case 0: return [4, this.callApiV2({
311
+ method: 'POST',
312
+ route: "collections/".concat(collectionId, "/properties"),
313
+ data: property,
314
+ })];
315
+ case 1:
316
+ _a.sent();
317
+ return [2];
318
+ }
319
+ });
320
+ });
321
+ };
322
+ Lookup.prototype.listDocuments = function (collectionId, params) {
323
+ if (params === void 0) { params = {}; }
324
+ return __awaiter(this, void 0, void 0, function () {
325
+ var response;
326
+ return __generator(this, function (_a) {
327
+ switch (_a.label) {
328
+ case 0: return [4, this.callApiV2({
329
+ method: 'GET',
330
+ route: "collections/".concat(collectionId, "/documents"),
331
+ params: params,
332
+ })];
333
+ case 1:
334
+ response = _a.sent();
335
+ return [2, (0, base_1.makeList)(response)];
336
+ }
337
+ });
338
+ });
339
+ };
340
+ Lookup.prototype.listCollections = function (params) {
341
+ if (params === void 0) { params = {}; }
342
+ return __awaiter(this, void 0, void 0, function () {
343
+ var response;
344
+ return __generator(this, function (_a) {
345
+ switch (_a.label) {
346
+ case 0: return [4, this.callApiV2({
347
+ method: 'GET',
348
+ route: 'collections',
349
+ params: params,
350
+ })];
351
+ case 1:
352
+ response = _a.sent();
353
+ return [2, (0, base_1.makeList)(response)];
354
+ }
355
+ });
356
+ });
357
+ };
358
+ Lookup.prototype.listPassages = function (collectionId, params) {
359
+ if (params === void 0) { params = {}; }
360
+ return __awaiter(this, void 0, void 0, function () {
361
+ var response;
362
+ return __generator(this, function (_a) {
363
+ switch (_a.label) {
364
+ case 0: return [4, this.callApiV2({
365
+ method: 'GET',
366
+ route: "collections/".concat(collectionId, "/passages"),
367
+ params: params,
368
+ })];
369
+ case 1:
370
+ response = _a.sent();
371
+ return [2, (0, base_1.makeList)(response)];
372
+ }
373
+ });
374
+ });
375
+ };
376
+ Lookup.prototype.listPassagesInDocument = function (collectionId, documentId, find) {
377
+ if (find === void 0) { find = {}; }
378
+ return __awaiter(this, void 0, void 0, function () {
379
+ var response;
380
+ return __generator(this, function (_a) {
381
+ switch (_a.label) {
382
+ case 0: return [4, this.callApiV2({
383
+ method: 'GET',
384
+ route: "collections/".concat(collectionId, "/documents/").concat(documentId, "/passages"),
385
+ params: find,
386
+ })];
387
+ case 1:
388
+ response = _a.sent();
389
+ return [2, (0, base_1.makeList)(response)];
390
+ }
391
+ });
392
+ });
393
+ };
394
+ Lookup.prototype.deleteDocument = function (collectionId, documentId) {
395
+ return __awaiter(this, void 0, void 0, function () {
396
+ var response;
397
+ return __generator(this, function (_a) {
398
+ switch (_a.label) {
399
+ case 0: return [4, this.callApiV2({
400
+ method: 'DELETE',
401
+ route: "collections/".concat(collectionId, "/documents/").concat(documentId),
402
+ })];
403
+ case 1:
404
+ response = _a.sent();
405
+ return [2, response];
406
+ }
407
+ });
408
+ });
409
+ };
410
+ return Lookup;
411
+ }(base_1.Base));
412
+ exports.Lookup = Lookup;
413
+ //# sourceMappingURL=Lookup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Lookup.js","sourceRoot":"","sources":["../../src/Lookup.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAoD;AACpD,yCAA0C;AAO1C,+CAA+D;AAE/D,IAAM,WAAW,GAAG,IAAA,gCAAiB,EAAC,yBAAU,CAAC,KAAK,CAAC,CAAC;AAExD;IAA4B,0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;yBACP,CAAC,EAAA;;wBAJI,QAAQ,GAAG,SAIf;wBAEF,WAAO,IAAA,eAAQ,EAAC,QAAQ,CAAC,EAAC;;;;KAC3B;IASK,uCAAsB,GAA5B,UACE,YAAoB,EACpB,UAAkB,EAClB,IAAuB;QAAvB,qBAAA,EAAA,SAAuB;;;;;4BAEN,WAAM,IAAI,CAAC,SAAS,CAAe;4BAClD,MAAM,EAAE,KAAK;4BACb,KAAK,EAAE,sBAAe,YAAY,wBAAc,UAAU,cAAW;4BACrE,MAAM,EAAE,IAAI;yBACb,CAAC,EAAA;;wBAJI,QAAQ,GAAG,SAIf;wBAEF,WAAO,IAAA,eAAQ,EAAC,QAAQ,CAAC,EAAC;;;;KAC3B;IAQK,+BAAc,GAApB,UAAqB,YAAoB,EAAE,UAAkB;;;;;4BAC1C,WAAM,IAAI,CAAC,SAAS,CAAW;4BAC9C,MAAM,EAAE,QAAQ;4BAChB,KAAK,EAAE,sBAAe,YAAY,wBAAc,UAAU,CAAE;yBAC7D,CAAC,EAAA;;wBAHI,QAAQ,GAAG,SAGf;wBAEF,WAAO,QAAQ,EAAC;;;;KACjB;IACH,aAAC;AAAD,CAAC,AApVD,CAA4B,WAAI,GAoV/B;AApVY,wBAAM"}
@@ -0,0 +1,177 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
+ return new (P || (P = Promise))(function (resolve, reject) {
16
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
20
+ });
21
+ };
22
+ var __generator = (this && this.__generator) || function (thisArg, body) {
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
+ function verb(n) { return function (v) { return step([n, v]); }; }
26
+ function step(op) {
27
+ if (f) throw new TypeError("Generator is already executing.");
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
+ if (y = 0, t) op = [op[0] & 2, t.value];
31
+ switch (op[0]) {
32
+ case 0: case 1: t = op; break;
33
+ case 4: _.label++; return { value: op[1], done: false };
34
+ case 5: _.label++; y = op[1]; op = [0]; continue;
35
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
+ default:
37
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
+ if (t[2]) _.ops.pop();
42
+ _.trys.pop(); continue;
43
+ }
44
+ op = body.call(thisArg, _);
45
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
+ }
48
+ };
49
+ var __importDefault = (this && this.__importDefault) || function (mod) {
50
+ return (mod && mod.__esModule) ? mod : { "default": mod };
51
+ };
52
+ Object.defineProperty(exports, "__esModule", { value: true });
53
+ var vitest_1 = require("vitest");
54
+ var msw_1 = require("msw");
55
+ var node_1 = require("msw/node");
56
+ var __1 = require("..");
57
+ var collection_json_1 = __importDefault(require("./fixtures/collection.json"));
58
+ var server = (0, node_1.setupServer)(msw_1.rest.post('https://lookup-api.svc.staging.api.onereach.ai/collections', function (req, res, ctx) { return __awaiter(void 0, void 0, void 0, function () {
59
+ var body;
60
+ return __generator(this, function (_a) {
61
+ switch (_a.label) {
62
+ case 0:
63
+ if (req.headers.get('authorization') !== 'valid-auth-token') {
64
+ return [2, res(ctx.status(401))];
65
+ }
66
+ return [4, req.json()];
67
+ case 1:
68
+ body = _a.sent();
69
+ if (body.ise === true) {
70
+ return [2, res(ctx.status(500), ctx.json({
71
+ error: 'Some tech error message here',
72
+ statusCode: 500,
73
+ }))];
74
+ }
75
+ if (typeof body.name === 'string' && body.name.length < 3) {
76
+ return [2, res(ctx.status(400), ctx.json({
77
+ error: [
78
+ 'name must be longer than or equal to 5 characters',
79
+ 'Can start only with a letter.',
80
+ ],
81
+ statusCode: 400,
82
+ }))];
83
+ }
84
+ return [2, res(ctx.json(collection_json_1.default))];
85
+ }
86
+ });
87
+ }); }));
88
+ var createLookupInstance = function (opts) {
89
+ if (opts === void 0) { opts = {}; }
90
+ return new __1.Lookup(__assign({ serviceUrl: 'https://lookup-api.svc.staging.api.onereach.ai', token: 'valid-auth-token' }, opts));
91
+ };
92
+ (0, vitest_1.describe)('Lookup', function () {
93
+ (0, vitest_1.beforeAll)(function () { return server.listen(); });
94
+ (0, vitest_1.afterEach)(function () { return server.resetHandlers(); });
95
+ (0, vitest_1.afterAll)(function () { return server.close(); });
96
+ (0, vitest_1.it)('should create an instance successfully', function () {
97
+ var lookup = createLookupInstance();
98
+ (0, vitest_1.expect)(lookup).toBeInstanceOf(__1.Lookup);
99
+ });
100
+ (0, vitest_1.it)('should create a new collection properly', function () { return __awaiter(void 0, void 0, void 0, function () {
101
+ var lookup, resp;
102
+ return __generator(this, function (_a) {
103
+ switch (_a.label) {
104
+ case 0:
105
+ lookup = createLookupInstance();
106
+ return [4, lookup.createCollection({
107
+ name: 'dev collection',
108
+ })];
109
+ case 1:
110
+ resp = _a.sent();
111
+ (0, vitest_1.expect)(resp).toEqual(collection_json_1.default);
112
+ return [2];
113
+ }
114
+ });
115
+ }); });
116
+ (0, vitest_1.it)('should show UnAuth Error if token is invalid', function () { return __awaiter(void 0, void 0, void 0, function () {
117
+ var lookup, promise;
118
+ return __generator(this, function (_a) {
119
+ switch (_a.label) {
120
+ case 0:
121
+ lookup = createLookupInstance({
122
+ token: 'invalid-token',
123
+ });
124
+ promise = lookup.createCollection({
125
+ name: 'dev collection',
126
+ });
127
+ return [4, (0, vitest_1.expect)(promise).rejects.toMatchObject({
128
+ status: 401,
129
+ message: 'We are not able to authenticate you',
130
+ })];
131
+ case 1:
132
+ _a.sent();
133
+ return [2];
134
+ }
135
+ });
136
+ }); });
137
+ (0, vitest_1.it)('should show validation errors properly', function () { return __awaiter(void 0, void 0, void 0, function () {
138
+ var lookup, promise;
139
+ return __generator(this, function (_a) {
140
+ switch (_a.label) {
141
+ case 0:
142
+ lookup = createLookupInstance();
143
+ promise = lookup.createCollection({
144
+ name: '1',
145
+ });
146
+ return [4, (0, vitest_1.expect)(promise).rejects.toMatchObject({
147
+ status: 400,
148
+ message: 'name must be longer than or equal to 5 characters. Can start only with a letter.',
149
+ })];
150
+ case 1:
151
+ _a.sent();
152
+ return [2];
153
+ }
154
+ });
155
+ }); });
156
+ (0, vitest_1.it)('should show ISE properly', function () { return __awaiter(void 0, void 0, void 0, function () {
157
+ var lookup, promise;
158
+ return __generator(this, function (_a) {
159
+ switch (_a.label) {
160
+ case 0:
161
+ lookup = createLookupInstance();
162
+ promise = lookup.createCollection({
163
+ ise: true,
164
+ });
165
+ return [4, (0, vitest_1.expect)(promise).rejects.toMatchObject({
166
+ status: 500,
167
+ message: 'Internal server error',
168
+ description: 'Some tech error message here',
169
+ })];
170
+ case 1:
171
+ _a.sent();
172
+ return [2];
173
+ }
174
+ });
175
+ }); });
176
+ });
177
+ //# sourceMappingURL=QnA.collections.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QnA.collections.spec.js","sourceRoot":"","sources":["../../../src/__tests__/QnA.collections.spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAA8E;AAC9E,2BAA2B;AAC3B,iCAAuC;AAEvC,wBAA4B;AAG5B,+EAAoD;AAEpD,IAAM,MAAM,GAAG,IAAA,kBAAW,EACxB,UAAI,CAAC,IAAI,CAAC,4DAA4D,EAAE,UAAO,GAAG,EAAE,GAAG,EAAE,GAAG;;;;;gBAC1F,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,KAAK,kBAAkB,EAAE;oBAC3D,WAAO,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAC;iBAC7B;gBACY,WAAM,GAAG,CAAC,IAAI,EAAE,EAAA;;gBAAvB,IAAI,GAAG,SAAgB;gBAC7B,IAAI,IAAI,CAAC,GAAG,KAAK,IAAI,EAAE;oBACrB,WAAO,GAAG,CACR,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,EACf,GAAG,CAAC,IAAI,CAAC;4BACP,KAAK,EAAE,8BAA8B;4BACrC,UAAU,EAAE,GAAG;yBAChB,CAAC,CACH,EAAC;iBACH;gBACD,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;oBACzD,WAAO,GAAG,CACR,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,EACf,GAAG,CAAC,IAAI,CAAC;4BACP,KAAK,EAAE;gCACL,mDAAmD;gCACnD,+BAA+B;6BAChC;4BACD,UAAU,EAAE,GAAG;yBACh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AC,gBAAgB,CAAC;wBACtC,IAAI,EAAE,gBAAgB;qBACvB,CAAC,CAAC;oBAEH,WAAM,IAAA,eAAM,EAAC,OAAO,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;4BAC1C,MAAM,EAAE,GAAG;4BACX,OAAO,EAAE,qCAAqC;yBAC/C,CAAC,EAAA;;oBAHF,SAGE,CAAC;;;;SACJ,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,wCAAwC,EAAE;;;;;oBACrC,MAAM,GAAG,oBAAoB,EAAE,CAAC;oBAEhC,OAAO,GAAG,MAAM,CAAC,gBAAgB,CAAC;wBACtC,IAAI,EAAE,GAAG;qBACV,CAAC,CAAC;oBAEH,WAAM,IAAA,eAAM,EAAC,OAAO,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;4BAC1C,MAAM,EAAE,GAAG;4BACX,OAAO,EAAE,kFAAkF;yBAC5F,CAAC,EAAA;;oBAHF,SAGE,CAAC;;;;SACJ,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,0BAA0B,EAAE;;;;;oBACvB,MAAM,GAAG,oBAAoB,EAAE,CAAC;oBAEhC,OAAO,GAAG,MAAM,CAAC,gBAAgB,CAAC;wBACtC,GAAG,EAAE,IAAI;qBACqB,CAAC,CAAC;oBAElC,WAAM,IAAA,eAAM,EAAC,OAAO,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;4BAC1C,MAAM,EAAE,GAAG;4BACX,OAAO,EAAE,uBAAuB;4BAChC,WAAW,EAAE,8BAA8B;yBAC5C,CAAC,EAAA;;oBAJF,SAIE,CAAC;;;;SACJ,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,34 @@
1
+ {
2
+ "id": "c5cd0f6d-cf98-4f2e-822e-42be148012b1",
3
+ "accountId": "d40ff964-dd12-4cbd-bb85-6ad35af3f908",
4
+ "description": "some lorem description here",
5
+ "name": "dev collection",
6
+ "createdAt": "2023-06-21T05:38:51.211Z",
7
+ "updatedAt": "2023-06-21T05:38:51.211Z",
8
+ "properties": [
9
+ {
10
+ "name": "document",
11
+ "dataType": "Document",
12
+ "description": "A document the passage belongs to."
13
+ },
14
+ {
15
+ "name": "content",
16
+ "dataType": "text",
17
+ "description": "the searchable passage content."
18
+ },
19
+ {
20
+ "name": "loaderMetadata",
21
+ "dataType": "text",
22
+ "description": "JSON encoded metadata of the content loader."
23
+ },
24
+ {
25
+ "name": "sourceUrl",
26
+ "dataType": "text",
27
+ "description": "The url of the document this passage belongs to."
28
+ },
29
+ {
30
+ "name": "dddddd",
31
+ "dataType": "date[]"
32
+ }
33
+ ]
34
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SERVICE_KEY = void 0;
4
+ exports.SERVICE_KEY = 'lookup-api';
5
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,YAAY,CAAC"}