@nomalism-com/api 0.13.9 → 0.13.11
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.
- package/dist/index.d.ts +0 -3
- package/dist/index.js +23 -26
- package/package.json +2 -2
- package/dist/modules/user/userToken.d.ts +0 -20
- package/dist/modules/user/userToken.js +0 -128
package/dist/index.d.ts
CHANGED
|
@@ -76,7 +76,6 @@ import UnitOfMeasureClass from './modules/stock/unitOfMeasure';
|
|
|
76
76
|
import UserPermissionsClass from './modules/user/userPermission';
|
|
77
77
|
import UserPositionsClass from './modules/user/userPositions';
|
|
78
78
|
import UsersClass from './modules/user/user';
|
|
79
|
-
import UserTokensClass from './modules/user/userToken';
|
|
80
79
|
import VatTaxClass from './modules/stock/vatTax';
|
|
81
80
|
import VatTaxZoneClass from './modules/stock/vatTaxZone';
|
|
82
81
|
import WorkflowClass from './modules/supply/workflow';
|
|
@@ -204,7 +203,6 @@ export * as UnitOfMeasure from './modules/stock/unitOfMeasure';
|
|
|
204
203
|
export * as UserPermissions from './modules/user/userPermission';
|
|
205
204
|
export * as UserPositions from './modules/user/userPositions';
|
|
206
205
|
export * as Users from './modules/user/user';
|
|
207
|
-
export * as UserTokens from './modules/user/userToken';
|
|
208
206
|
export * as VatTax from './modules/stock/vatTax';
|
|
209
207
|
export * as VatTaxZone from './modules/stock/vatTaxZone';
|
|
210
208
|
export * as Workflow from './modules/supply/workflow';
|
|
@@ -356,7 +354,6 @@ export declare class API {
|
|
|
356
354
|
UserPermissions: UserPermissionsClass;
|
|
357
355
|
UserPositions: UserPositionsClass;
|
|
358
356
|
Users: UsersClass;
|
|
359
|
-
UserTokens: UserTokensClass;
|
|
360
357
|
VatTax: VatTaxClass;
|
|
361
358
|
VatTaxZone: VatTaxZoneClass;
|
|
362
359
|
Workflow: WorkflowClass;
|
package/dist/index.js
CHANGED
|
@@ -27,8 +27,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.ProductUse = exports.ProductSubCategory = exports.ProductPart = exports.ProductImage = exports.ProductColor = exports.ProductCategory = exports.ProductAttribute = exports.Product = exports.PrimaryColor = exports.Plot = exports.Permissions = exports.Password = exports.PaymentConditions = exports.ObservationType = exports.Observation = exports.Multimedia = exports.MaintenancePresetAssoc = exports.MaintenancePreset = exports.MaintenanceType = exports.MaintenanceAssoc = exports.Maintenance = exports.Logout = exports.Location = exports.Language = exports.History = exports.GroupPermissions = exports.GoogleSheets = exports.File = exports.FieldGroup = exports.Field = exports.Favorites = exports.EntityList = exports.DocumentType = exports.DocumentLineFolder = exports.DocumentLineAssoc = exports.DocumentLine = exports.DocumentHeader = exports.Country = exports.ContactType = exports.Contacts = exports.CompositionMaterial = exports.Composition = exports.Commissioner = exports.Color = exports.ClientType = exports.Client = exports.BankData = exports.AttributeValue = exports.Attribute = exports.Address = void 0;
|
|
30
|
-
exports.Cabide = exports.PreSaleProduct = exports.PreSale = exports.Tenant = exports.ZipCode = exports.StockMovement = exports.ProductNamePreset = exports.VatValidation = exports.MoloniRequest = exports.ProviderCurrentAccount = exports.ClientCurrentAccount = exports.ExternalDocumentHeader = exports.Payment = exports.DocumentSet = exports.ExternalDocumentType = exports.Vehicles = exports.PaymentMethods = exports.MaturityDates = exports.DeliveryMethods = exports.DynamicData = exports.Workflow = exports.VatTaxZone = exports.VatTax = exports.
|
|
31
|
-
exports.API = exports.shared = exports.EmailTemplateAttachment = exports.EmailTemplate = exports.SavedEmPicking = exports.UpfrontReturn = exports.Transformado = exports.MaterialEntrance = exports.Purchase = exports.Order = exports.ProjectInfo = exports.Persona = exports.ErrorHandler = exports.StartDocumentHeaderLastUpdate = exports.Clt = exports.TicketsLanguage = exports.Channel = exports.Tickets = exports.Settings = exports.GoogleFilePermission = exports.Schedule = exports.PropostaSheets = exports.ReturnReason = exports.QueryParameter = exports.QueryList = exports.SchedulePrintJob = exports.Printer = exports.Npc = exports.OrderManagement =
|
|
30
|
+
exports.CabideProduct = exports.Cabide = exports.PreSaleProduct = exports.PreSale = exports.Tenant = exports.ZipCode = exports.StockMovement = exports.ProductNamePreset = exports.VatValidation = exports.MoloniRequest = exports.ProviderCurrentAccount = exports.ClientCurrentAccount = exports.ExternalDocumentHeader = exports.Payment = exports.DocumentSet = exports.ExternalDocumentType = exports.Vehicles = exports.PaymentMethods = exports.MaturityDates = exports.DeliveryMethods = exports.DynamicData = exports.Workflow = exports.VatTaxZone = exports.VatTax = exports.Users = exports.UserPositions = exports.UserPermissions = exports.UnitOfMeasure = exports.TypeOfLocation = exports.TypeOfInventory = exports.TasksGroup = exports.Tasks = exports.TaskNote = exports.TaskAttachment = exports.Swift = exports.StoreOperator = exports.SocialMedia = exports.SimilarProduct = exports.Shippings = exports.Sessions = exports.SegmentsArea = exports.RefreshToken = exports.ReasonForExemption = exports.PurchaseConditions = exports.ProviderType = exports.Providers = exports.PromotionAssoc = exports.Promotion = exports.ProductName = exports.ProductUseAssoc = void 0;
|
|
31
|
+
exports.API = exports.shared = exports.EmailTemplateAttachment = exports.EmailTemplate = exports.SavedEmPicking = exports.UpfrontReturn = exports.Transformado = exports.MaterialEntrance = exports.Purchase = exports.Order = exports.ProjectInfo = exports.Persona = exports.ErrorHandler = exports.StartDocumentHeaderLastUpdate = exports.Clt = exports.TicketsLanguage = exports.Channel = exports.Tickets = exports.Settings = exports.GoogleFilePermission = exports.Schedule = exports.PropostaSheets = exports.ReturnReason = exports.QueryParameter = exports.QueryList = exports.SchedulePrintJob = exports.Printer = exports.Npc = exports.OrderManagement = void 0;
|
|
32
32
|
var types_1 = require("@nomalism-com/types");
|
|
33
33
|
Object.defineProperty(exports, "shared", { enumerable: true, get: function () { return types_1.shared; } });
|
|
34
34
|
var axios_1 = __importDefault(require("axios"));
|
|
@@ -108,7 +108,6 @@ var unitOfMeasure_1 = __importDefault(require("./modules/stock/unitOfMeasure"));
|
|
|
108
108
|
var userPermission_1 = __importDefault(require("./modules/user/userPermission"));
|
|
109
109
|
var userPositions_1 = __importDefault(require("./modules/user/userPositions"));
|
|
110
110
|
var user_1 = __importDefault(require("./modules/user/user"));
|
|
111
|
-
var userToken_1 = __importDefault(require("./modules/user/userToken"));
|
|
112
111
|
var vatTax_1 = __importDefault(require("./modules/stock/vatTax"));
|
|
113
112
|
var vatTaxZone_1 = __importDefault(require("./modules/stock/vatTaxZone"));
|
|
114
113
|
var workflow_1 = __importDefault(require("./modules/supply/workflow"));
|
|
@@ -236,7 +235,6 @@ exports.UnitOfMeasure = __importStar(require("./modules/stock/unitOfMeasure"));
|
|
|
236
235
|
exports.UserPermissions = __importStar(require("./modules/user/userPermission"));
|
|
237
236
|
exports.UserPositions = __importStar(require("./modules/user/userPositions"));
|
|
238
237
|
exports.Users = __importStar(require("./modules/user/user"));
|
|
239
|
-
exports.UserTokens = __importStar(require("./modules/user/userToken"));
|
|
240
238
|
exports.VatTax = __importStar(require("./modules/stock/vatTax"));
|
|
241
239
|
exports.VatTaxZone = __importStar(require("./modules/stock/vatTaxZone"));
|
|
242
240
|
exports.Workflow = __importStar(require("./modules/supply/workflow"));
|
|
@@ -334,20 +332,20 @@ var API = (function () {
|
|
|
334
332
|
};
|
|
335
333
|
var getModuleParams = function (service, module) { return ({
|
|
336
334
|
api: _this.client,
|
|
337
|
-
route: "".concat(_this.services[service].authPath).concat(module),
|
|
338
|
-
publicRoute: "".concat(_this.services[service].publicPath).concat(module),
|
|
335
|
+
route: "".concat(_this.services[service].authPath).concat(module, "/"),
|
|
336
|
+
publicRoute: "".concat(_this.services[service].publicPath).concat(module, "/"),
|
|
339
337
|
}); };
|
|
340
338
|
this.Address = new address_1.default(getModuleParams('user', 'address'));
|
|
341
339
|
this.Attribute = new attribute_1.default(getModuleParams('stock', 'attribute'));
|
|
342
340
|
this.AttributeValue = new attributeValue_1.default(getModuleParams('stock', 'attribute_value'));
|
|
343
341
|
this.BankData = new bankData_1.default(getModuleParams('user', 'bank_data'));
|
|
344
342
|
this.Client = new clients_1.default(getModuleParams('user', 'client'));
|
|
345
|
-
this.ClientType = new clientType_1.default(getModuleParams('user', '
|
|
343
|
+
this.ClientType = new clientType_1.default(getModuleParams('user', 'client_type'));
|
|
346
344
|
this.Color = new color_1.default(getModuleParams('stock', 'color'));
|
|
347
345
|
this.Commissioner = new commissioner_1.default(getModuleParams('user', 'commissioner'));
|
|
348
346
|
this.Composition = new composition_1.default(getModuleParams('stock', 'composition'));
|
|
349
347
|
this.CompositionMaterial = new compositionMaterial_1.default(getModuleParams('stock', 'composition_material'));
|
|
350
|
-
this.Contacts = new contacts_1.default(getModuleParams('user', '
|
|
348
|
+
this.Contacts = new contacts_1.default(getModuleParams('user', 'contact'));
|
|
351
349
|
this.ContactType = new contactTypes_1.default(getModuleParams('user', 'contact_type'));
|
|
352
350
|
this.Country = new country_1.default(getModuleParams('user', 'country'));
|
|
353
351
|
this.DocumentHeader = new documentHeader_1.default(getModuleParams('stock', 'document_header'));
|
|
@@ -355,14 +353,14 @@ var API = (function () {
|
|
|
355
353
|
this.DocumentLineAssoc = new documentLineAssoc_1.default(getModuleParams('stock', 'document_line_assoc'));
|
|
356
354
|
this.DocumentLineFolder = new documentLineFolder_1.default(getModuleParams('stock', 'document_line_folder'));
|
|
357
355
|
this.DocumentType = new documentType_1.default(getModuleParams('stock', 'document_type'));
|
|
358
|
-
this.EntityList = new entityList_1.default(getModuleParams('user', '
|
|
359
|
-
this.Favorites = new favorites_1.default(getModuleParams('user', '
|
|
360
|
-
this.Field = new field_1.default(getModuleParams('integration', '
|
|
356
|
+
this.EntityList = new entityList_1.default(getModuleParams('user', 'entity'));
|
|
357
|
+
this.Favorites = new favorites_1.default(getModuleParams('user', 'favorite'));
|
|
358
|
+
this.Field = new field_1.default(getModuleParams('integration', 'field'));
|
|
361
359
|
this.FieldGroup = new fieldGroup_1.default(getModuleParams('integration', 'field_group'));
|
|
362
360
|
this.File = new file_1.default(getModuleParams('integration', 'file'));
|
|
363
|
-
this.GoogleSheets = new googleSheets_1.default(getModuleParams('integration', '
|
|
364
|
-
this.GroupPermissions = new groupPermission_1.default(getModuleParams('user', '
|
|
365
|
-
this.History = new history_1.default(getModuleParams('
|
|
361
|
+
this.GoogleSheets = new googleSheets_1.default(getModuleParams('integration', 'google'));
|
|
362
|
+
this.GroupPermissions = new groupPermission_1.default(getModuleParams('user', 'group_permission'));
|
|
363
|
+
this.History = new history_1.default(getModuleParams('integration', 'history'));
|
|
366
364
|
this.Language = new language_1.default(getModuleParams('user', 'language'));
|
|
367
365
|
this.Location = new location_1.default(getModuleParams('stock', 'location'));
|
|
368
366
|
this.Logout = new logout_1.default(getModuleParams('user', 'logout'));
|
|
@@ -374,9 +372,9 @@ var API = (function () {
|
|
|
374
372
|
this.Multimedia = new multimedia_1.default(getModuleParams('documentmanagement', 'multimedia'));
|
|
375
373
|
this.Observation = new observation_1.default(getModuleParams('integration', 'observation'));
|
|
376
374
|
this.ObservationType = new observationType_1.default(getModuleParams('integration', 'observation_type'));
|
|
377
|
-
this.PaymentConditions = new paymentCondition_1.default(getModuleParams('user', '
|
|
375
|
+
this.PaymentConditions = new paymentCondition_1.default(getModuleParams('user', 'payment_condition'));
|
|
378
376
|
this.Password = new password_1.default(getModuleParams('user', 'password'));
|
|
379
|
-
this.Permissions = new permission_1.default(getModuleParams('user', '
|
|
377
|
+
this.Permissions = new permission_1.default(getModuleParams('user', 'permission'));
|
|
380
378
|
this.Plot = new plot_1.default(getModuleParams('stock', 'plot'));
|
|
381
379
|
this.PrimaryColor = new primaryColor_1.default(getModuleParams('stock', 'primary_color'));
|
|
382
380
|
this.Product = new product_1.default(getModuleParams('stock', 'product'));
|
|
@@ -391,29 +389,28 @@ var API = (function () {
|
|
|
391
389
|
this.ProductName = new productName_1.default(getModuleParams('stock', 'product_name'));
|
|
392
390
|
this.Promotion = new promotion_1.default(getModuleParams('stock', 'promotion'));
|
|
393
391
|
this.PromotionAssoc = new promotionAssoc_1.default(getModuleParams('stock', 'promotion_assoc'));
|
|
394
|
-
this.Providers = new provider_1.default(getModuleParams('user', '
|
|
392
|
+
this.Providers = new provider_1.default(getModuleParams('user', 'provider'));
|
|
395
393
|
this.ProviderType = new providerType_1.default(getModuleParams('user', 'provider_type'));
|
|
396
|
-
this.PurchaseConditions = new purchaseCondition_1.default(getModuleParams('user', '
|
|
394
|
+
this.PurchaseConditions = new purchaseCondition_1.default(getModuleParams('user', 'purchase_condition'));
|
|
397
395
|
this.ReasonForExemption = new reasonForExemption_1.default(getModuleParams('user', 'reason_for_exemption'));
|
|
398
|
-
this.RefreshToken = new refreshToken_1.default(getModuleParams('user', '
|
|
396
|
+
this.RefreshToken = new refreshToken_1.default(getModuleParams('user', 'refresh-token'));
|
|
399
397
|
this.SegmentsArea = new segmentsArea_1.default(getModuleParams('user', 'segments_area'));
|
|
400
398
|
this.Sessions = new sessions_1.default(getModuleParams('user', 'sessions'));
|
|
401
|
-
this.Shippings = new shippings_1.default(getModuleParams('user', '
|
|
399
|
+
this.Shippings = new shippings_1.default(getModuleParams('user', 'shipping'));
|
|
402
400
|
this.SimilarProduct = new similarProduct_1.default(getModuleParams('stock', 'similar_product'));
|
|
403
401
|
this.SocialMedia = new socialMedia_1.default(getModuleParams('user', 'social_media'));
|
|
404
402
|
this.StoreOperator = new storeOperator_1.default(getModuleParams('user', 'store_operator'));
|
|
405
403
|
this.Swift = new swift_1.default(getModuleParams('user', 'swift'));
|
|
406
404
|
this.TaskAttachment = new taskAttachment_1.default(getModuleParams('integration', 'task_attachment'));
|
|
407
405
|
this.TaskNote = new taskNote_1.default(getModuleParams('integration', 'task_note'));
|
|
408
|
-
this.Tasks = new task_1.default(getModuleParams('integration', '
|
|
409
|
-
this.TasksGroup = new taskGroup_1.default(getModuleParams('integration', '
|
|
406
|
+
this.Tasks = new task_1.default(getModuleParams('integration', 'task'));
|
|
407
|
+
this.TasksGroup = new taskGroup_1.default(getModuleParams('integration', 'task_group'));
|
|
410
408
|
this.TypeOfInventory = new typeOfInventory_1.default(getModuleParams('stock', 'type_of_inventory'));
|
|
411
409
|
this.TypeOfLocation = new typeOfLocation_1.default(getModuleParams('stock', 'type_of_location'));
|
|
412
410
|
this.UnitOfMeasure = new unitOfMeasure_1.default(getModuleParams('stock', 'unit_of_measure'));
|
|
413
|
-
this.UserPermissions = new userPermission_1.default(getModuleParams('user', '
|
|
414
|
-
this.UserPositions = new userPositions_1.default(getModuleParams('user', '
|
|
411
|
+
this.UserPermissions = new userPermission_1.default(getModuleParams('user', 'user_permission'));
|
|
412
|
+
this.UserPositions = new userPositions_1.default(getModuleParams('user', 'user_position'));
|
|
415
413
|
this.Users = new user_1.default(getModuleParams('user', 'users'));
|
|
416
|
-
this.UserTokens = new userToken_1.default(getModuleParams('user', 'user_tokens'));
|
|
417
414
|
this.VatTax = new vatTax_1.default(getModuleParams('stock', 'vat_tax'));
|
|
418
415
|
this.VatTaxZone = new vatTaxZone_1.default(getModuleParams('stock', 'vat_tax_zone'));
|
|
419
416
|
this.Workflow = new workflow_1.default(getModuleParams('stock', 'workflow'));
|
|
@@ -442,7 +439,7 @@ var API = (function () {
|
|
|
442
439
|
this.Npc = new npc_1.default(getModuleParams('print', 'npc'));
|
|
443
440
|
this.Printer = new printer_1.default(getModuleParams('print', 'printer'));
|
|
444
441
|
this.SchedulePrintJob = new schedulePrintJob_1.default(getModuleParams('print', 'schedule_print_job'));
|
|
445
|
-
this.QueryList = new queryList_1.default(getModuleParams('stock', '
|
|
442
|
+
this.QueryList = new queryList_1.default(getModuleParams('stock', 'query'));
|
|
446
443
|
this.QueryParameter = new queryParameter_1.default(getModuleParams('stock', 'query_parameter'));
|
|
447
444
|
this.ReturnReason = new returnReason_1.default(getModuleParams('stock', 'return_reason'));
|
|
448
445
|
this.PropostaSheets = new propostaSheets_1.default(getModuleParams('stock', 'proposta_sheets'));
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"typescript",
|
|
10
10
|
"helper"
|
|
11
11
|
],
|
|
12
|
-
"version": "0.13.
|
|
12
|
+
"version": "0.13.11",
|
|
13
13
|
"main": "dist/index.js",
|
|
14
14
|
"types": "./dist/index.d.ts",
|
|
15
15
|
"files": [
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/convert-units": "^2.3.9",
|
|
35
|
-
"@types/node": "^20.9.
|
|
35
|
+
"@types/node": "^20.9.5",
|
|
36
36
|
"@typescript-eslint/eslint-plugin": "^6.12.0",
|
|
37
37
|
"@typescript-eslint/parser": "^6.12.0",
|
|
38
38
|
"concurrently": "^8.2.2",
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { shared, UserTokens as Entity } from '@nomalism-com/types';
|
|
2
|
-
import { IModuleConstructor } from '../..';
|
|
3
|
-
export import IFindRequest = Entity.IFindRequest;
|
|
4
|
-
export import IFindPaginatedRequest = Entity.IFindPaginatedRequest;
|
|
5
|
-
export import IFindByOwnerIdRequest = shared.IFindByOwnerIdRequest;
|
|
6
|
-
export import IUpdateRequest = Entity.IUpdateRequest;
|
|
7
|
-
export import IEntity = Entity.Entity;
|
|
8
|
-
export type IPaginationResponse = shared.IPaginationResponse<IEntity>;
|
|
9
|
-
export default class Repository implements Entity.IApi {
|
|
10
|
-
route: string;
|
|
11
|
-
publicRoute: string;
|
|
12
|
-
private api;
|
|
13
|
-
constructor({ api, route, publicRoute }: IModuleConstructor);
|
|
14
|
-
findById(selector: shared.IFindByIdRequest): Promise<IEntity | null>;
|
|
15
|
-
findByOwnerId(params: IFindByOwnerIdRequest): Promise<IEntity[]>;
|
|
16
|
-
find(params: IFindRequest): Promise<IEntity[]>;
|
|
17
|
-
findPaginated(params: IFindPaginatedRequest): Promise<IPaginationResponse>;
|
|
18
|
-
update(selector: shared.IFindByIdRequest, body: IUpdateRequest): Promise<IEntity | null>;
|
|
19
|
-
deleteOne(selector: shared.IFindByIdRequest): Promise<IEntity | null>;
|
|
20
|
-
}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
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;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
var Repository = (function () {
|
|
40
|
-
function Repository(_a) {
|
|
41
|
-
var api = _a.api, route = _a.route, publicRoute = _a.publicRoute;
|
|
42
|
-
this.api = api;
|
|
43
|
-
this.route = route;
|
|
44
|
-
this.publicRoute = publicRoute;
|
|
45
|
-
}
|
|
46
|
-
Repository.prototype.findById = function (selector) {
|
|
47
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
48
|
-
var response;
|
|
49
|
-
return __generator(this, function (_a) {
|
|
50
|
-
switch (_a.label) {
|
|
51
|
-
case 0: return [4, this.api.get("".concat(this.route).concat(selector.id))];
|
|
52
|
-
case 1:
|
|
53
|
-
response = _a.sent();
|
|
54
|
-
return [2, response.data];
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
Repository.prototype.findByOwnerId = function (params) {
|
|
60
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
61
|
-
var response;
|
|
62
|
-
return __generator(this, function (_a) {
|
|
63
|
-
switch (_a.label) {
|
|
64
|
-
case 0: return [4, this.api.get("".concat(this.route, "by_owner"), {
|
|
65
|
-
params: params,
|
|
66
|
-
})];
|
|
67
|
-
case 1:
|
|
68
|
-
response = _a.sent();
|
|
69
|
-
return [2, response.data];
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
};
|
|
74
|
-
Repository.prototype.find = function (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.api.get("".concat(this.route), { params: params })];
|
|
80
|
-
case 1:
|
|
81
|
-
response = _a.sent();
|
|
82
|
-
return [2, response.data];
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
};
|
|
87
|
-
Repository.prototype.findPaginated = function (params) {
|
|
88
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
89
|
-
var response;
|
|
90
|
-
return __generator(this, function (_a) {
|
|
91
|
-
switch (_a.label) {
|
|
92
|
-
case 0: return [4, this.api.get("".concat(this.route, "paginated"), { params: params })];
|
|
93
|
-
case 1:
|
|
94
|
-
response = _a.sent();
|
|
95
|
-
return [2, response.data];
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
};
|
|
100
|
-
Repository.prototype.update = function (selector, body) {
|
|
101
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
102
|
-
var response;
|
|
103
|
-
return __generator(this, function (_a) {
|
|
104
|
-
switch (_a.label) {
|
|
105
|
-
case 0: return [4, this.api.put("".concat(this.route).concat(selector.id), body)];
|
|
106
|
-
case 1:
|
|
107
|
-
response = _a.sent();
|
|
108
|
-
return [2, response.data];
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
};
|
|
113
|
-
Repository.prototype.deleteOne = function (selector) {
|
|
114
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
115
|
-
var response;
|
|
116
|
-
return __generator(this, function (_a) {
|
|
117
|
-
switch (_a.label) {
|
|
118
|
-
case 0: return [4, this.api.delete("".concat(this.route).concat(selector.id))];
|
|
119
|
-
case 1:
|
|
120
|
-
response = _a.sent();
|
|
121
|
-
return [2, response.data];
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
};
|
|
126
|
-
return Repository;
|
|
127
|
-
}());
|
|
128
|
-
exports.default = Repository;
|