@nomalism-com/api 0.14.12 → 0.15.1
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 -9
- package/dist/index.js +3 -12
- package/dist/modules/supply/transformado.d.ts +1 -1
- package/dist/modules/user/clients.d.ts +1 -1
- package/dist/modules/user/persona.d.ts +3 -0
- package/dist/modules/user/persona.js +15 -0
- package/package.json +6 -6
- package/dist/modules/user/address.d.ts +0 -27
- package/dist/modules/user/address.js +0 -154
- package/dist/modules/user/contactTypes.d.ts +0 -24
- package/dist/modules/user/contactTypes.js +0 -141
- package/dist/modules/user/contacts.d.ts +0 -28
- package/dist/modules/user/contacts.js +0 -169
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { shared } from '@nomalism-com/types';
|
|
2
2
|
import { AxiosInstance, AxiosRequestHeaders } from 'axios';
|
|
3
|
-
import AddressClass from './modules/user/address';
|
|
4
3
|
import AttributeClass from './modules/stock/attribute';
|
|
5
4
|
import AttributeValueClass from './modules/stock/attributeValue';
|
|
6
5
|
import BankDataClass from './modules/user/bankData';
|
|
@@ -10,8 +9,6 @@ import ColorClass from './modules/stock/color';
|
|
|
10
9
|
import CommissionerClass from './modules/user/commissioner';
|
|
11
10
|
import CompositionClass from './modules/stock/composition';
|
|
12
11
|
import CompositionMaterialClass from './modules/stock/compositionMaterial';
|
|
13
|
-
import ContactsClass from './modules/user/contacts';
|
|
14
|
-
import ContactTypeClass from './modules/user/contactTypes';
|
|
15
12
|
import CountryClass from './modules/user/country';
|
|
16
13
|
import DocumentHeaderClass from './modules/supply/documentHeader';
|
|
17
14
|
import DocumentLineClass from './modules/supply/documentLine';
|
|
@@ -127,7 +124,6 @@ import UpfrontReturnClass from './modules/supply/upfrontReturn';
|
|
|
127
124
|
import SavedEmPickingClass from './modules/stock/savedEmPicking';
|
|
128
125
|
import EmailTemplateClass from './modules/integration/emailTemplate';
|
|
129
126
|
import EmailTemplateAttachmentClass from './modules/integration/emailTemplateAttachment';
|
|
130
|
-
export * as Address from './modules/user/address';
|
|
131
127
|
export * as Attribute from './modules/stock/attribute';
|
|
132
128
|
export * as AttributeValue from './modules/stock/attributeValue';
|
|
133
129
|
export * as BankData from './modules/user/bankData';
|
|
@@ -137,8 +133,6 @@ export * as Color from './modules/stock/color';
|
|
|
137
133
|
export * as Commissioner from './modules/user/commissioner';
|
|
138
134
|
export * as Composition from './modules/stock/composition';
|
|
139
135
|
export * as CompositionMaterial from './modules/stock/compositionMaterial';
|
|
140
|
-
export * as Contacts from './modules/user/contacts';
|
|
141
|
-
export * as ContactType from './modules/user/contactTypes';
|
|
142
136
|
export * as Country from './modules/user/country';
|
|
143
137
|
export * as DocumentHeader from './modules/supply/documentHeader';
|
|
144
138
|
export * as DocumentLine from './modules/supply/documentLine';
|
|
@@ -279,7 +273,6 @@ export declare class API {
|
|
|
279
273
|
private defaultHeaders;
|
|
280
274
|
client: AxiosInstance;
|
|
281
275
|
services: Record<IService, IServiceExternalPath>;
|
|
282
|
-
Address: AddressClass;
|
|
283
276
|
Attribute: AttributeClass;
|
|
284
277
|
AttributeValue: AttributeValueClass;
|
|
285
278
|
BankData: BankDataClass;
|
|
@@ -289,8 +282,6 @@ export declare class API {
|
|
|
289
282
|
Commissioner: CommissionerClass;
|
|
290
283
|
Composition: CompositionClass;
|
|
291
284
|
CompositionMaterial: CompositionMaterialClass;
|
|
292
|
-
Contacts: ContactsClass;
|
|
293
|
-
ContactType: ContactTypeClass;
|
|
294
285
|
Country: CountryClass;
|
|
295
286
|
DocumentHeader: DocumentHeaderClass;
|
|
296
287
|
DocumentLine: DocumentLineClass;
|
package/dist/index.js
CHANGED
|
@@ -26,13 +26,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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.
|
|
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 =
|
|
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 =
|
|
29
|
+
exports.Promotion = exports.ProductName = exports.ProductUseAssoc = 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.CompositionMaterial = exports.Composition = exports.Commissioner = exports.Color = exports.ClientType = exports.Client = exports.BankData = exports.AttributeValue = exports.Attribute = void 0;
|
|
30
|
+
exports.Printer = exports.Npc = exports.OrderManagement = 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 = 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 = 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"));
|
|
35
|
-
var address_1 = __importDefault(require("./modules/user/address"));
|
|
36
35
|
var attribute_1 = __importDefault(require("./modules/stock/attribute"));
|
|
37
36
|
var attributeValue_1 = __importDefault(require("./modules/stock/attributeValue"));
|
|
38
37
|
var bankData_1 = __importDefault(require("./modules/user/bankData"));
|
|
@@ -42,8 +41,6 @@ var color_1 = __importDefault(require("./modules/stock/color"));
|
|
|
42
41
|
var commissioner_1 = __importDefault(require("./modules/user/commissioner"));
|
|
43
42
|
var composition_1 = __importDefault(require("./modules/stock/composition"));
|
|
44
43
|
var compositionMaterial_1 = __importDefault(require("./modules/stock/compositionMaterial"));
|
|
45
|
-
var contacts_1 = __importDefault(require("./modules/user/contacts"));
|
|
46
|
-
var contactTypes_1 = __importDefault(require("./modules/user/contactTypes"));
|
|
47
44
|
var country_1 = __importDefault(require("./modules/user/country"));
|
|
48
45
|
var documentHeader_1 = __importDefault(require("./modules/supply/documentHeader"));
|
|
49
46
|
var documentLine_1 = __importDefault(require("./modules/supply/documentLine"));
|
|
@@ -159,7 +156,6 @@ var upfrontReturn_1 = __importDefault(require("./modules/supply/upfrontReturn"))
|
|
|
159
156
|
var savedEmPicking_1 = __importDefault(require("./modules/stock/savedEmPicking"));
|
|
160
157
|
var emailTemplate_1 = __importDefault(require("./modules/integration/emailTemplate"));
|
|
161
158
|
var emailTemplateAttachment_1 = __importDefault(require("./modules/integration/emailTemplateAttachment"));
|
|
162
|
-
exports.Address = __importStar(require("./modules/user/address"));
|
|
163
159
|
exports.Attribute = __importStar(require("./modules/stock/attribute"));
|
|
164
160
|
exports.AttributeValue = __importStar(require("./modules/stock/attributeValue"));
|
|
165
161
|
exports.BankData = __importStar(require("./modules/user/bankData"));
|
|
@@ -169,8 +165,6 @@ exports.Color = __importStar(require("./modules/stock/color"));
|
|
|
169
165
|
exports.Commissioner = __importStar(require("./modules/user/commissioner"));
|
|
170
166
|
exports.Composition = __importStar(require("./modules/stock/composition"));
|
|
171
167
|
exports.CompositionMaterial = __importStar(require("./modules/stock/compositionMaterial"));
|
|
172
|
-
exports.Contacts = __importStar(require("./modules/user/contacts"));
|
|
173
|
-
exports.ContactType = __importStar(require("./modules/user/contactTypes"));
|
|
174
168
|
exports.Country = __importStar(require("./modules/user/country"));
|
|
175
169
|
exports.DocumentHeader = __importStar(require("./modules/supply/documentHeader"));
|
|
176
170
|
exports.DocumentLine = __importStar(require("./modules/supply/documentLine"));
|
|
@@ -336,7 +330,6 @@ var API = (function () {
|
|
|
336
330
|
route: "".concat(_this.services[service].authPath).concat(module, "/"),
|
|
337
331
|
publicRoute: "".concat(_this.services[service].publicPath).concat(module, "/"),
|
|
338
332
|
}); };
|
|
339
|
-
this.Address = new address_1.default(getModuleParams('users', 'address'));
|
|
340
333
|
this.Attribute = new attribute_1.default(getModuleParams('stock', 'attribute'));
|
|
341
334
|
this.AttributeValue = new attributeValue_1.default(getModuleParams('stock', 'attribute_value'));
|
|
342
335
|
this.BankData = new bankData_1.default(getModuleParams('users', 'bank_data'));
|
|
@@ -346,8 +339,6 @@ var API = (function () {
|
|
|
346
339
|
this.Commissioner = new commissioner_1.default(getModuleParams('users', 'commissioner'));
|
|
347
340
|
this.Composition = new composition_1.default(getModuleParams('stock', 'composition'));
|
|
348
341
|
this.CompositionMaterial = new compositionMaterial_1.default(getModuleParams('stock', 'composition_material'));
|
|
349
|
-
this.Contacts = new contacts_1.default(getModuleParams('users', 'contact'));
|
|
350
|
-
this.ContactType = new contactTypes_1.default(getModuleParams('users', 'contact_type'));
|
|
351
342
|
this.Country = new country_1.default(getModuleParams('users', 'country'));
|
|
352
343
|
this.DocumentHeader = new documentHeader_1.default(getModuleParams('stock', 'document_header'));
|
|
353
344
|
this.DocumentLine = new documentLine_1.default(getModuleParams('stock', 'document_line'));
|
|
@@ -7,5 +7,5 @@ export default class Repository implements Entity.IRepository {
|
|
|
7
7
|
publicRoute: string;
|
|
8
8
|
private api;
|
|
9
9
|
constructor({ api, route, publicRoute }: IModuleConstructor);
|
|
10
|
-
create(body: ICreateTransformado): Promise<
|
|
10
|
+
create(body: ICreateTransformado): Promise<string>;
|
|
11
11
|
}
|
|
@@ -10,7 +10,7 @@ export import IFindByOwnerIdRequest = shared.IFindByOwnerIdRequest;
|
|
|
10
10
|
export import IFindByOwnerIdResponse = Entity.IFindByOwnerIdResponse;
|
|
11
11
|
export import IFindByIdResponse = Entity.IFindByIdResponse;
|
|
12
12
|
export import ICreateUser = Entity.ICreateUser;
|
|
13
|
-
export import ICreatePreferencialContact = Entity.
|
|
13
|
+
export import ICreatePreferencialContact = Entity.ICreateMainPersona;
|
|
14
14
|
export import ICreateRequest = Entity.ICreateRequest;
|
|
15
15
|
export import IEntity = Entity.Entity;
|
|
16
16
|
export import IUpdateRequest = Entity.IUpdateRequest;
|
|
@@ -4,6 +4,8 @@ export import IEntityExtended = Entity.IEntityExtended;
|
|
|
4
4
|
export import IFindByOwnerIdRequest = shared.IFindByOwnerIdRequest;
|
|
5
5
|
export import ICreateRequest = Entity.ICreateRequest;
|
|
6
6
|
export import IUpdateRequest = Entity.IUpdateRequest;
|
|
7
|
+
export import IBasicSearchRequest = Entity.IBasicSearchRequest;
|
|
8
|
+
export import IBasicSearchResponse = Entity.IBasicSearchResponse;
|
|
7
9
|
export default class Repository implements Entity.IRepository {
|
|
8
10
|
route: string;
|
|
9
11
|
publicRoute: string;
|
|
@@ -14,4 +16,5 @@ export default class Repository implements Entity.IRepository {
|
|
|
14
16
|
create(body: ICreateRequest): Promise<IEntityExtended>;
|
|
15
17
|
update(selector: shared.IFindByIdRequest, body: IUpdateRequest): Promise<IEntityExtended | null>;
|
|
16
18
|
deleteOne(selector: shared.IFindByIdRequest): Promise<IEntityExtended | null>;
|
|
19
|
+
findByBasic(params: IBasicSearchRequest): Promise<shared.IPaginationResponse<IBasicSearchResponse>>;
|
|
17
20
|
}
|
|
@@ -110,6 +110,21 @@ var Repository = (function () {
|
|
|
110
110
|
});
|
|
111
111
|
});
|
|
112
112
|
};
|
|
113
|
+
Repository.prototype.findByBasic = function (params) {
|
|
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.get("".concat(this.route, "basic_search"), {
|
|
119
|
+
params: params,
|
|
120
|
+
})];
|
|
121
|
+
case 1:
|
|
122
|
+
response = _a.sent();
|
|
123
|
+
return [2, response.data];
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
};
|
|
113
128
|
return Repository;
|
|
114
129
|
}());
|
|
115
130
|
exports.default = Repository;
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"typescript",
|
|
10
10
|
"helper"
|
|
11
11
|
],
|
|
12
|
-
"version": "0.
|
|
12
|
+
"version": "0.15.1",
|
|
13
13
|
"main": "dist/index.js",
|
|
14
14
|
"types": "./dist/index.d.ts",
|
|
15
15
|
"files": [
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/convert-units": "^2.3.9",
|
|
35
|
-
"@types/node": "^20.10.
|
|
36
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
37
|
-
"@typescript-eslint/parser": "^6.
|
|
35
|
+
"@types/node": "^20.10.5",
|
|
36
|
+
"@typescript-eslint/eslint-plugin": "^6.15.0",
|
|
37
|
+
"@typescript-eslint/parser": "^6.15.0",
|
|
38
38
|
"concurrently": "^8.2.2",
|
|
39
|
-
"eslint": "^8.
|
|
39
|
+
"eslint": "^8.56.0",
|
|
40
40
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
41
41
|
"eslint-config-prettier": "^9.1.0",
|
|
42
42
|
"eslint-import-resolver-typescript": "^3.6.1",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"typescript": "^5.3.3"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@nomalism-com/types": "^0.
|
|
50
|
+
"@nomalism-com/types": "^0.15.1",
|
|
51
51
|
"axios": "^0.27.2"
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { shared, Address as Entity } from '@nomalism-com/types';
|
|
2
|
-
import { IModuleConstructor } from '../..';
|
|
3
|
-
export import IFindRequest = Entity.IFindRequest;
|
|
4
|
-
export import IFindResponse = Entity.IFindResponse;
|
|
5
|
-
export import IFindPaginatedRequest = Entity.IFindPaginatedRequest;
|
|
6
|
-
export import IFindByOwnerIdRequest = shared.IFindByOwnerIdRequest;
|
|
7
|
-
export import IFindByOwnerIdResponse = Entity.IFindByOwnerIdResponse;
|
|
8
|
-
export import ICreateRequest = Entity.ICreateRequest;
|
|
9
|
-
export import IEntity = Entity.Entity;
|
|
10
|
-
export import IUpdateRequest = Entity.IUpdateRequest;
|
|
11
|
-
export import IFindMinifiedRequest = shared.IFindMinifiedRequest;
|
|
12
|
-
export import IFindMinifiedResponse = shared.IFindMinifiedResponse;
|
|
13
|
-
export type IPaginationResponse = shared.IPaginationResponse<Entity.IFindResponse>;
|
|
14
|
-
export default class Repository implements Entity.IRepository {
|
|
15
|
-
route: string;
|
|
16
|
-
publicRoute: string;
|
|
17
|
-
private api;
|
|
18
|
-
constructor({ api, route, publicRoute }: IModuleConstructor);
|
|
19
|
-
find(params: IFindRequest): Promise<IFindResponse[]>;
|
|
20
|
-
findMinified(params?: IFindMinifiedRequest): Promise<IFindMinifiedResponse[]>;
|
|
21
|
-
findPaginated(params: IFindPaginatedRequest): Promise<IPaginationResponse>;
|
|
22
|
-
findByOwnerId(params: IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
|
|
23
|
-
findById(selector: shared.IFindByIdRequest): Promise<IFindResponse | null>;
|
|
24
|
-
create(body: ICreateRequest): Promise<IFindByOwnerIdResponse>;
|
|
25
|
-
update(selector: shared.IFindByIdRequest, body: IUpdateRequest): Promise<IFindByOwnerIdResponse | null>;
|
|
26
|
-
deleteOne(selector: shared.IFindByIdRequest): Promise<IFindByOwnerIdResponse | null>;
|
|
27
|
-
}
|
|
@@ -1,154 +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.find = function (params) {
|
|
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), { params: params })];
|
|
52
|
-
case 1:
|
|
53
|
-
response = _a.sent();
|
|
54
|
-
return [2, response.data];
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
Repository.prototype.findMinified = 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, "minified"), { params: params })];
|
|
65
|
-
case 1:
|
|
66
|
-
response = _a.sent();
|
|
67
|
-
return [2, response.data];
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
Repository.prototype.findPaginated = function (params) {
|
|
73
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
74
|
-
var response;
|
|
75
|
-
return __generator(this, function (_a) {
|
|
76
|
-
switch (_a.label) {
|
|
77
|
-
case 0: return [4, this.api.get("".concat(this.route, "paginated"), { params: params })];
|
|
78
|
-
case 1:
|
|
79
|
-
response = _a.sent();
|
|
80
|
-
return [2, response.data];
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
};
|
|
85
|
-
Repository.prototype.findByOwnerId = function (params) {
|
|
86
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
87
|
-
var response;
|
|
88
|
-
return __generator(this, function (_a) {
|
|
89
|
-
switch (_a.label) {
|
|
90
|
-
case 0: return [4, this.api.get("".concat(this.route, "by_owner"), {
|
|
91
|
-
params: params,
|
|
92
|
-
})];
|
|
93
|
-
case 1:
|
|
94
|
-
response = _a.sent();
|
|
95
|
-
return [2, response.data];
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
};
|
|
100
|
-
Repository.prototype.findById = function (selector) {
|
|
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.get("".concat(this.route).concat(selector.id))];
|
|
106
|
-
case 1:
|
|
107
|
-
response = _a.sent();
|
|
108
|
-
return [2, response.data];
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
};
|
|
113
|
-
Repository.prototype.create = function (body) {
|
|
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.post("".concat(this.route), body)];
|
|
119
|
-
case 1:
|
|
120
|
-
response = _a.sent();
|
|
121
|
-
return [2, response.data];
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
};
|
|
126
|
-
Repository.prototype.update = function (selector, body) {
|
|
127
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
128
|
-
var response;
|
|
129
|
-
return __generator(this, function (_a) {
|
|
130
|
-
switch (_a.label) {
|
|
131
|
-
case 0: return [4, this.api.put("".concat(this.route).concat(selector.id), body)];
|
|
132
|
-
case 1:
|
|
133
|
-
response = _a.sent();
|
|
134
|
-
return [2, response.data];
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
});
|
|
138
|
-
};
|
|
139
|
-
Repository.prototype.deleteOne = function (selector) {
|
|
140
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
141
|
-
var response;
|
|
142
|
-
return __generator(this, function (_a) {
|
|
143
|
-
switch (_a.label) {
|
|
144
|
-
case 0: return [4, this.api.delete("".concat(this.route).concat(selector.id))];
|
|
145
|
-
case 1:
|
|
146
|
-
response = _a.sent();
|
|
147
|
-
return [2, response.data];
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
});
|
|
151
|
-
};
|
|
152
|
-
return Repository;
|
|
153
|
-
}());
|
|
154
|
-
exports.default = Repository;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { shared, ContactType as Entity } from '@nomalism-com/types';
|
|
2
|
-
import { IModuleConstructor } from '../..';
|
|
3
|
-
export import IFindRequest = Entity.IFindRequest;
|
|
4
|
-
export import IFindResponse = Entity.IFindResponse;
|
|
5
|
-
export import IFindPaginatedRequest = Entity.IFindPaginatedRequest;
|
|
6
|
-
export import IFindMinifiedRequest = shared.IFindMinifiedRequest;
|
|
7
|
-
export import IFindMinifiedResponse = shared.IFindMinifiedResponse;
|
|
8
|
-
export import ICreateRequest = Entity.ICreateRequest;
|
|
9
|
-
export import IEntity = Entity.Entity;
|
|
10
|
-
export import IUpdateRequest = Entity.IUpdateRequest;
|
|
11
|
-
export type IPaginationResponse = shared.IPaginationResponse<Entity.IFindResponse>;
|
|
12
|
-
export default class Repository implements Entity.IRepository {
|
|
13
|
-
route: string;
|
|
14
|
-
publicRoute: string;
|
|
15
|
-
private api;
|
|
16
|
-
constructor({ api, route, publicRoute }: IModuleConstructor);
|
|
17
|
-
find(params: IFindRequest): Promise<IFindResponse[]>;
|
|
18
|
-
findPaginated(params: IFindPaginatedRequest): Promise<IPaginationResponse>;
|
|
19
|
-
findMinified(params?: IFindMinifiedRequest): Promise<IFindMinifiedResponse[]>;
|
|
20
|
-
findById(selector: shared.IFindByIdRequest): Promise<IFindResponse | null>;
|
|
21
|
-
create(body: ICreateRequest): Promise<IEntity>;
|
|
22
|
-
update(selector: shared.IFindByIdRequest, body: IUpdateRequest): Promise<IEntity | null>;
|
|
23
|
-
deleteOne(selector: shared.IFindByIdRequest): Promise<IEntity | null>;
|
|
24
|
-
}
|
|
@@ -1,141 +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.find = function (params) {
|
|
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), { params: params })];
|
|
52
|
-
case 1:
|
|
53
|
-
response = _a.sent();
|
|
54
|
-
return [2, response.data];
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
Repository.prototype.findPaginated = 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, "paginated"), { params: params })];
|
|
65
|
-
case 1:
|
|
66
|
-
response = _a.sent();
|
|
67
|
-
return [2, response.data];
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
Repository.prototype.findMinified = function (params) {
|
|
73
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
74
|
-
var response;
|
|
75
|
-
return __generator(this, function (_a) {
|
|
76
|
-
switch (_a.label) {
|
|
77
|
-
case 0: return [4, this.api.get("".concat(this.route, "minified"), {
|
|
78
|
-
params: params,
|
|
79
|
-
})];
|
|
80
|
-
case 1:
|
|
81
|
-
response = _a.sent();
|
|
82
|
-
return [2, response.data];
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
};
|
|
87
|
-
Repository.prototype.findById = function (selector) {
|
|
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).concat(selector.id))];
|
|
93
|
-
case 1:
|
|
94
|
-
response = _a.sent();
|
|
95
|
-
return [2, response.data];
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
};
|
|
100
|
-
Repository.prototype.create = function (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.post("".concat(this.route), body)];
|
|
106
|
-
case 1:
|
|
107
|
-
response = _a.sent();
|
|
108
|
-
return [2, response.data];
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
};
|
|
113
|
-
Repository.prototype.update = function (selector, body) {
|
|
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.put("".concat(this.route).concat(selector.id), body)];
|
|
119
|
-
case 1:
|
|
120
|
-
response = _a.sent();
|
|
121
|
-
return [2, response.data];
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
};
|
|
126
|
-
Repository.prototype.deleteOne = function (selector) {
|
|
127
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
128
|
-
var response;
|
|
129
|
-
return __generator(this, function (_a) {
|
|
130
|
-
switch (_a.label) {
|
|
131
|
-
case 0: return [4, this.api.delete("".concat(this.route).concat(selector.id))];
|
|
132
|
-
case 1:
|
|
133
|
-
response = _a.sent();
|
|
134
|
-
return [2, response.data];
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
});
|
|
138
|
-
};
|
|
139
|
-
return Repository;
|
|
140
|
-
}());
|
|
141
|
-
exports.default = Repository;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { shared, Contacts as Entity } from '@nomalism-com/types';
|
|
2
|
-
import { IModuleConstructor } from '../..';
|
|
3
|
-
export import IFindRequest = Entity.IFindRequest;
|
|
4
|
-
export import IFindResponse = Entity.IFindResponse;
|
|
5
|
-
export import IFindPaginatedRequest = Entity.IFindPaginatedRequest;
|
|
6
|
-
export import IFindByOwnerIdRequest = shared.IFindByOwnerIdRequest;
|
|
7
|
-
export import IFindByOwnerIdResponse = Entity.IFindByOwnerIdResponse;
|
|
8
|
-
export import ICreateRequest = Entity.ICreateRequest;
|
|
9
|
-
export import IEntity = Entity.Entity;
|
|
10
|
-
export import IUpdateRequest = Entity.IUpdateRequest;
|
|
11
|
-
export import IBasicSearchRequest = Entity.IBasicSearchRequest;
|
|
12
|
-
export import IBasicSearchResponse = Entity.IBasicSearchResponse;
|
|
13
|
-
export type IPaginationResponse = shared.IPaginationResponse<Entity.IFindResponse>;
|
|
14
|
-
export default class Repository implements Entity.IRepository {
|
|
15
|
-
route: string;
|
|
16
|
-
publicRoute: string;
|
|
17
|
-
private api;
|
|
18
|
-
constructor({ api, route, publicRoute }: IModuleConstructor);
|
|
19
|
-
find(params: IFindRequest): Promise<IFindResponse[]>;
|
|
20
|
-
findMinified(params: shared.IFindMinifiedRequest): Promise<shared.IFindMinifiedResponse[]>;
|
|
21
|
-
findPaginated(params: IFindPaginatedRequest): Promise<IPaginationResponse>;
|
|
22
|
-
findByOwnerId(params: IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
|
|
23
|
-
findById(selector: shared.IFindByIdRequest): Promise<IFindResponse | null>;
|
|
24
|
-
create(body: ICreateRequest): Promise<IFindByOwnerIdResponse>;
|
|
25
|
-
update(selector: shared.IFindByIdRequest, body: IUpdateRequest): Promise<IFindByOwnerIdResponse | null>;
|
|
26
|
-
deleteOne(selector: shared.IFindByIdRequest): Promise<IFindByOwnerIdResponse | null>;
|
|
27
|
-
findByBasic(params: IBasicSearchRequest): Promise<shared.IPaginationResponse<IBasicSearchResponse>>;
|
|
28
|
-
}
|
|
@@ -1,169 +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.find = function (params) {
|
|
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), { params: params })];
|
|
52
|
-
case 1:
|
|
53
|
-
response = _a.sent();
|
|
54
|
-
return [2, response.data];
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
Repository.prototype.findMinified = 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, "minified"), { params: params })];
|
|
65
|
-
case 1:
|
|
66
|
-
response = _a.sent();
|
|
67
|
-
return [2, response.data];
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
Repository.prototype.findPaginated = function (params) {
|
|
73
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
74
|
-
var response;
|
|
75
|
-
return __generator(this, function (_a) {
|
|
76
|
-
switch (_a.label) {
|
|
77
|
-
case 0: return [4, this.api.get("".concat(this.route, "paginated"), { params: params })];
|
|
78
|
-
case 1:
|
|
79
|
-
response = _a.sent();
|
|
80
|
-
return [2, response.data];
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
};
|
|
85
|
-
Repository.prototype.findByOwnerId = function (params) {
|
|
86
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
87
|
-
var response;
|
|
88
|
-
return __generator(this, function (_a) {
|
|
89
|
-
switch (_a.label) {
|
|
90
|
-
case 0: return [4, this.api.get("".concat(this.route, "by_owner"), {
|
|
91
|
-
params: params,
|
|
92
|
-
})];
|
|
93
|
-
case 1:
|
|
94
|
-
response = _a.sent();
|
|
95
|
-
return [2, response.data];
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
};
|
|
100
|
-
Repository.prototype.findById = function (selector) {
|
|
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.get("".concat(this.route).concat(selector.id))];
|
|
106
|
-
case 1:
|
|
107
|
-
response = _a.sent();
|
|
108
|
-
return [2, response.data];
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
};
|
|
113
|
-
Repository.prototype.create = function (body) {
|
|
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.post("".concat(this.route), body)];
|
|
119
|
-
case 1:
|
|
120
|
-
response = _a.sent();
|
|
121
|
-
return [2, response.data];
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
};
|
|
126
|
-
Repository.prototype.update = function (selector, body) {
|
|
127
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
128
|
-
var response;
|
|
129
|
-
return __generator(this, function (_a) {
|
|
130
|
-
switch (_a.label) {
|
|
131
|
-
case 0: return [4, this.api.put("".concat(this.route).concat(selector.id), body)];
|
|
132
|
-
case 1:
|
|
133
|
-
response = _a.sent();
|
|
134
|
-
return [2, response.data];
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
});
|
|
138
|
-
};
|
|
139
|
-
Repository.prototype.deleteOne = function (selector) {
|
|
140
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
141
|
-
var response;
|
|
142
|
-
return __generator(this, function (_a) {
|
|
143
|
-
switch (_a.label) {
|
|
144
|
-
case 0: return [4, this.api.delete("".concat(this.route).concat(selector.id))];
|
|
145
|
-
case 1:
|
|
146
|
-
response = _a.sent();
|
|
147
|
-
return [2, response.data];
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
});
|
|
151
|
-
};
|
|
152
|
-
Repository.prototype.findByBasic = function (params) {
|
|
153
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
154
|
-
var response;
|
|
155
|
-
return __generator(this, function (_a) {
|
|
156
|
-
switch (_a.label) {
|
|
157
|
-
case 0: return [4, this.api.get("".concat(this.route, "basic_search"), {
|
|
158
|
-
params: params,
|
|
159
|
-
})];
|
|
160
|
-
case 1:
|
|
161
|
-
response = _a.sent();
|
|
162
|
-
return [2, response.data];
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
});
|
|
166
|
-
};
|
|
167
|
-
return Repository;
|
|
168
|
-
}());
|
|
169
|
-
exports.default = Repository;
|