@hellena-sdk/hellena 1.0.5 → 1.0.7
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/README.md +274 -27
- package/dist/core/HellenaConnect.d.ts +32 -10
- package/dist/main.d.ts +15 -6
- package/dist/main.js +382 -13
- package/dist/resources/comment/comment.feature.d.ts +22 -0
- package/dist/resources/comment/comment.model.d.ts +3 -0
- package/dist/resources/comment/dto/comment.dto.d.ts +31 -0
- package/dist/resources/comment/service/comment.ser.d.ts +17 -0
- package/dist/resources/order/dto/order.dto.d.ts +62 -15
- package/dist/resources/order/order.feature.d.ts +13 -4
- package/dist/resources/order/order.model.d.ts +2 -3
- package/dist/resources/order/service/order.ser.d.ts +8 -3
- package/dist/resources/organization/dto/organization.dto.d.ts +0 -1
- package/dist/resources/organization/organization.feature.d.ts +6 -5
- package/dist/resources/organization/organization.model.d.ts +0 -1
- package/dist/resources/organization/service/organization.ser.d.ts +2 -3
- package/dist/resources/payment/dto/payment.dto.d.ts +14 -0
- package/dist/resources/payment/payment.feature.d.ts +10 -0
- package/dist/resources/payment/payment.model.d.ts +3 -0
- package/dist/resources/payment/service/payment.ser.d.ts +8 -0
- package/dist/resources/product/dto/product.dto.d.ts +39 -4
- package/dist/resources/product/product.feature.d.ts +8 -7
- package/dist/resources/product/product.model.d.ts +2 -3
- package/dist/resources/product/service/product.ser.d.ts +4 -4
- package/dist/resources/rating/dto/rating.dto.d.ts +25 -0
- package/dist/resources/rating/rating.feature.d.ts +19 -0
- package/dist/resources/rating/rating.model.d.ts +3 -0
- package/dist/resources/rating/service/rating.ser.d.ts +15 -0
- package/package.json +34 -28
- package/LICENSE +0 -21
- package/dist/core/HellenaConnect.d.ts.map +0 -1
- package/dist/core/HellenaConnect.js +0 -15
- package/dist/core/HellenaConnect.js.map +0 -1
- package/dist/libs/graphql-client.ts.d.ts +0 -2
- package/dist/libs/graphql-client.ts.d.ts.map +0 -1
- package/dist/libs/graphql-client.ts.js +0 -3
- package/dist/libs/graphql-client.ts.js.map +0 -1
- package/dist/main.d.ts.map +0 -1
- package/dist/main.js.map +0 -1
- package/dist/resources/order/dto/order.dto.d.ts.map +0 -1
- package/dist/resources/order/dto/order.dto.js +0 -2
- package/dist/resources/order/dto/order.dto.js.map +0 -1
- package/dist/resources/order/order.feature.d.ts.map +0 -1
- package/dist/resources/order/order.feature.js +0 -7
- package/dist/resources/order/order.feature.js.map +0 -1
- package/dist/resources/order/order.model.d.ts.map +0 -1
- package/dist/resources/order/order.model.js +0 -7
- package/dist/resources/order/order.model.js.map +0 -1
- package/dist/resources/order/service/order.ser.d.ts.map +0 -1
- package/dist/resources/order/service/order.ser.js +0 -21
- package/dist/resources/order/service/order.ser.js.map +0 -1
- package/dist/resources/organization/dto/organization.dto.d.ts.map +0 -1
- package/dist/resources/organization/dto/organization.dto.js +0 -2
- package/dist/resources/organization/dto/organization.dto.js.map +0 -1
- package/dist/resources/organization/organization.feature.d.ts.map +0 -1
- package/dist/resources/organization/organization.feature.js +0 -9
- package/dist/resources/organization/organization.feature.js.map +0 -1
- package/dist/resources/organization/organization.model.d.ts.map +0 -1
- package/dist/resources/organization/organization.model.js +0 -7
- package/dist/resources/organization/organization.model.js.map +0 -1
- package/dist/resources/organization/service/organization.ser.d.ts.map +0 -1
- package/dist/resources/organization/service/organization.ser.js +0 -26
- package/dist/resources/organization/service/organization.ser.js.map +0 -1
- package/dist/resources/product/dto/product.dto.d.ts.map +0 -1
- package/dist/resources/product/dto/product.dto.js +0 -2
- package/dist/resources/product/dto/product.dto.js.map +0 -1
- package/dist/resources/product/product.feature.d.ts.map +0 -1
- package/dist/resources/product/product.feature.js +0 -8
- package/dist/resources/product/product.feature.js.map +0 -1
- package/dist/resources/product/product.model.d.ts.map +0 -1
- package/dist/resources/product/product.model.js +0 -7
- package/dist/resources/product/product.model.js.map +0 -1
- package/dist/resources/product/service/product.ser.d.ts.map +0 -1
- package/dist/resources/product/service/product.ser.js +0 -26
- package/dist/resources/product/service/product.ser.js.map +0 -1
- package/dist/test.d.ts +0 -2
- package/dist/test.d.ts.map +0 -1
- package/dist/test.js +0 -38
- package/dist/test.js.map +0 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HellenaConnect } from "../../../core/HellenaConnect";
|
|
2
|
+
import type { CreateWiPayPaymentDTO, CreateWiPayPaymentResponseDTO, PaymentMethodDTO } from "../dto/payment.dto";
|
|
3
|
+
export declare class PaymentService {
|
|
4
|
+
private readonly connect;
|
|
5
|
+
constructor(connect: HellenaConnect);
|
|
6
|
+
methods(): Promise<PaymentMethodDTO[]>;
|
|
7
|
+
createWiPayPayment(data: CreateWiPayPaymentDTO): Promise<CreateWiPayPaymentResponseDTO>;
|
|
8
|
+
}
|
|
@@ -2,10 +2,25 @@ export interface PriceDTO {
|
|
|
2
2
|
id: string;
|
|
3
3
|
quantity: number;
|
|
4
4
|
price: number;
|
|
5
|
+
priceType?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ProductVariantDTO {
|
|
8
|
+
id: string;
|
|
9
|
+
value: string;
|
|
10
|
+
color?: string | null;
|
|
11
|
+
link?: string | null;
|
|
12
|
+
variantProduct?: {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
slug?: string;
|
|
16
|
+
image: string | null;
|
|
17
|
+
prices: PriceDTO[];
|
|
18
|
+
} | null;
|
|
5
19
|
}
|
|
6
20
|
export interface ProductDTO {
|
|
7
21
|
id: string;
|
|
8
|
-
|
|
22
|
+
slug?: string;
|
|
23
|
+
barcode: string | null;
|
|
9
24
|
name: string;
|
|
10
25
|
category: string | null;
|
|
11
26
|
image: string | null;
|
|
@@ -18,8 +33,28 @@ export interface ProductDTO {
|
|
|
18
33
|
material: string[] | null;
|
|
19
34
|
size: string[] | null;
|
|
20
35
|
tags: string[] | null;
|
|
21
|
-
|
|
22
|
-
unit: string;
|
|
36
|
+
prices: PriceDTO[];
|
|
37
|
+
unit: string | null;
|
|
38
|
+
unitsPerBox?: number | null;
|
|
23
39
|
quantity: number;
|
|
40
|
+
variants?: ProductVariantDTO[];
|
|
41
|
+
}
|
|
42
|
+
export interface PaginationMeta {
|
|
43
|
+
page: number;
|
|
44
|
+
limit: number;
|
|
45
|
+
total: number;
|
|
46
|
+
totalPages: number;
|
|
47
|
+
hasNextPage: boolean;
|
|
48
|
+
hasPreviousPage: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface PaginatedResponse<T> {
|
|
51
|
+
data: T[];
|
|
52
|
+
meta: PaginationMeta;
|
|
53
|
+
}
|
|
54
|
+
export interface ProductListParams {
|
|
55
|
+
page?: number;
|
|
56
|
+
limit?: number;
|
|
57
|
+
}
|
|
58
|
+
export interface ProductSearchParams extends ProductListParams {
|
|
59
|
+
ref: string;
|
|
24
60
|
}
|
|
25
|
-
//# sourceMappingURL=product.dto.d.ts.map
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type { ProductDTO } from "./dto/product.dto
|
|
2
|
-
import type { ProductService } from "./service/product.ser
|
|
1
|
+
import type { ProductDTO, ProductListParams, ProductSearchParams, PaginatedResponse } from "./dto/product.dto";
|
|
2
|
+
import type { ProductService } from "./service/product.ser";
|
|
3
3
|
export declare class ProductFeature {
|
|
4
4
|
private readonly service;
|
|
5
5
|
constructor(service: ProductService);
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
/** Lista produtos com paginação. */
|
|
7
|
+
listProducts(params?: ProductListParams): Promise<PaginatedResponse<ProductDTO>>;
|
|
8
|
+
/** Pesquisa produtos por ID, slug, nome, código de barras, categoria, marca ou descrição. */
|
|
9
|
+
searchProducts(params: ProductSearchParams): Promise<PaginatedResponse<ProductDTO>>;
|
|
10
|
+
/** Obtém os detalhes de um produto através do ID ou slug. */
|
|
11
|
+
getProductByIdOrSlug(id: string): Promise<ProductDTO>;
|
|
10
12
|
}
|
|
11
|
-
//# sourceMappingURL=product.feature.d.ts.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { HellenaConnect } from "@/core/HellenaConnect
|
|
2
|
-
import { ProductFeature } from "./product.feature
|
|
1
|
+
import type { HellenaConnect } from "@/core/HellenaConnect";
|
|
2
|
+
import { ProductFeature } from "./product.feature";
|
|
3
3
|
export declare function ProductModel(connect: HellenaConnect): ProductFeature;
|
|
4
|
-
//# sourceMappingURL=product.model.d.ts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { HellenaConnect } from "
|
|
2
|
-
import type { ProductDTO } from "../dto/product.dto
|
|
1
|
+
import type { HellenaConnect } from "../../../core/HellenaConnect";
|
|
2
|
+
import type { PaginatedResponse, ProductDTO, ProductListParams, ProductSearchParams } from "../dto/product.dto";
|
|
3
3
|
export declare class ProductService {
|
|
4
4
|
private readonly connect;
|
|
5
5
|
constructor(connect: HellenaConnect);
|
|
6
|
-
getAllProducts(): Promise<ProductDTO
|
|
6
|
+
getAllProducts(params?: ProductListParams): Promise<PaginatedResponse<ProductDTO>>;
|
|
7
|
+
searchProducts(params: ProductSearchParams): Promise<PaginatedResponse<ProductDTO>>;
|
|
7
8
|
getProductById(id: string): Promise<ProductDTO>;
|
|
8
9
|
}
|
|
9
|
-
//# sourceMappingURL=product.ser.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface RatingDTO {
|
|
2
|
+
id: string;
|
|
3
|
+
stockId: string;
|
|
4
|
+
score: number;
|
|
5
|
+
customerId?: string | null;
|
|
6
|
+
customerProfile?: string | null;
|
|
7
|
+
customerName?: string | null;
|
|
8
|
+
customerEmail?: string | null;
|
|
9
|
+
createdAt?: string;
|
|
10
|
+
updatedAt?: string | null;
|
|
11
|
+
}
|
|
12
|
+
export interface AddRatingDTO {
|
|
13
|
+
stockId: string;
|
|
14
|
+
score: number;
|
|
15
|
+
customerId?: string;
|
|
16
|
+
customerProfile?: string;
|
|
17
|
+
customerName?: string;
|
|
18
|
+
customerEmail?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface RatingSummaryDTO {
|
|
21
|
+
stockId: string;
|
|
22
|
+
averageRating: number;
|
|
23
|
+
ratingCount: number;
|
|
24
|
+
commentsCount: number;
|
|
25
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { AddRatingDTO, RatingDTO, RatingSummaryDTO } from "./dto/rating.dto";
|
|
2
|
+
import type { RatingService } from "./service/rating.ser";
|
|
3
|
+
export declare class RatingFeature {
|
|
4
|
+
private readonly service;
|
|
5
|
+
constructor(service: RatingService);
|
|
6
|
+
/** Obtém a classificação média e as contagens de avaliações/comentários de um produto. */
|
|
7
|
+
getProductRatingSummary(stockId: string): Promise<RatingSummaryDTO>;
|
|
8
|
+
/** Obtém a avaliação de um cliente para um produto, se existir. */
|
|
9
|
+
getCustomerProductRating(params: {
|
|
10
|
+
stockId: string;
|
|
11
|
+
customerId: string;
|
|
12
|
+
}): Promise<RatingDTO | null>;
|
|
13
|
+
/** Regista uma avaliação de produto. */
|
|
14
|
+
createProductRating(data: AddRatingDTO): Promise<RatingDTO>;
|
|
15
|
+
/** Elimina uma avaliação pelo seu identificador. */
|
|
16
|
+
deleteProductRating(id: string): Promise<{
|
|
17
|
+
success: boolean;
|
|
18
|
+
}>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { HellenaConnect } from "../../../core/HellenaConnect";
|
|
2
|
+
import type { AddRatingDTO, RatingDTO, RatingSummaryDTO } from "../dto/rating.dto";
|
|
3
|
+
export declare class RatingService {
|
|
4
|
+
private readonly connect;
|
|
5
|
+
constructor(connect: HellenaConnect);
|
|
6
|
+
summary(stockId: string): Promise<RatingSummaryDTO>;
|
|
7
|
+
findOne(params: {
|
|
8
|
+
stockId: string;
|
|
9
|
+
customerId: string;
|
|
10
|
+
}): Promise<RatingDTO | null>;
|
|
11
|
+
create(data: AddRatingDTO): Promise<RatingDTO>;
|
|
12
|
+
delete(id: string): Promise<{
|
|
13
|
+
success: boolean;
|
|
14
|
+
}>;
|
|
15
|
+
}
|
package/package.json
CHANGED
|
@@ -1,45 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hellena-sdk/hellena",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "1.0.7",
|
|
4
|
+
"description": "Official JavaScript SDK for the Hellena API",
|
|
5
|
+
"license": "ISC",
|
|
6
|
+
"author": "",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"module": "dist/main.js",
|
|
5
9
|
"main": "dist/main.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"build": "tsc",
|
|
8
|
-
"start": "node dist/main.js",
|
|
9
|
-
"pack": "mkdir -p packages && npm pack && mv *.tgz packages/",
|
|
10
|
-
"dev": "node --loader ts-node/esm src/test.ts"
|
|
11
|
-
},
|
|
12
|
-
"publishConfig": {
|
|
13
|
-
"access": "public"
|
|
14
|
-
},
|
|
15
|
-
"packDestination": "./packages",
|
|
16
10
|
"types": "dist/main.d.ts",
|
|
17
11
|
"exports": {
|
|
18
12
|
".": {
|
|
19
|
-
"
|
|
20
|
-
"
|
|
13
|
+
"types": "./dist/main.d.ts",
|
|
14
|
+
"import": "./dist/main.js"
|
|
21
15
|
}
|
|
22
16
|
},
|
|
23
|
-
"files": [
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "bun build src/main.ts --outdir dist --target node && tsc --emitDeclarationOnly -p tsconfig.json",
|
|
22
|
+
"dev": "bun run index.ts",
|
|
23
|
+
"pack": "mkdir packages && npm pack && mv *.tgz packages/",
|
|
24
|
+
"prepublishOnly": "bun run build"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/bun": "latest",
|
|
28
|
+
"typescript": "^5.9.0"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"typescript": "^5"
|
|
32
|
+
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public"
|
|
35
|
+
},
|
|
24
36
|
"repository": {
|
|
25
37
|
"type": "git",
|
|
26
38
|
"url": "git+https://github.com/Helena-mother/hellena-javascript-SDK.git"
|
|
27
39
|
},
|
|
28
|
-
"keywords": [],
|
|
29
|
-
"author": "",
|
|
30
|
-
"license": "ISC",
|
|
31
|
-
"type": "module",
|
|
32
40
|
"bugs": {
|
|
33
41
|
"url": "https://github.com/Helena-mother/hellena-javascript-SDK/issues"
|
|
34
42
|
},
|
|
35
43
|
"homepage": "https://github.com/Helena-mother/hellena-javascript-SDK#readme",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"dotenv": "^17.2.3"
|
|
44
|
-
}
|
|
44
|
+
"keywords": [
|
|
45
|
+
"hellena",
|
|
46
|
+
"sdk",
|
|
47
|
+
"api",
|
|
48
|
+
"javascript",
|
|
49
|
+
"typescript"
|
|
50
|
+
]
|
|
45
51
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Hellena
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HellenaConnect.d.ts","sourceRoot":"","sources":["../../src/core/HellenaConnect.ts"],"names":[],"mappings":"AAAA,qBAAa,cAAc;IAKX,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM;IAJ7C,SAAS,CAAC,QAAQ,CAAC,MAAM,6CAA6C;IACtE,SAAS,CAAC,QAAQ,CAAC,UAAU,QAAQ;IACrC,SAAS,CAAC,QAAQ,CAAC,WAAW,SAAuC;gBAEtC,MAAM,EAAE,MAAM;IAE7C,SAAS,CAAC,UAAU;;;;CAMvB"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export class HellenaConnect {
|
|
2
|
-
constructor(apiKey) {
|
|
3
|
-
this.apiKey = apiKey;
|
|
4
|
-
this.apiUrl = "https://hellena-api-for-devs.vercel.app";
|
|
5
|
-
this.apiVersion = "v1";
|
|
6
|
-
this.apiEndpoint = `${this.apiUrl}/${this.apiVersion}`;
|
|
7
|
-
}
|
|
8
|
-
getHeaders() {
|
|
9
|
-
return {
|
|
10
|
-
"Content-Type": "application/json",
|
|
11
|
-
Authorization: `Bearer ${this.apiKey}`,
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=HellenaConnect.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HellenaConnect.js","sourceRoot":"","sources":["../../src/core/HellenaConnect.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,cAAc;IAKvB,YAA+B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QAJ1B,WAAM,GAAG,yCAAyC,CAAC;QACnD,eAAU,GAAG,IAAI,CAAC;QAClB,gBAAW,GAAG,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;IAEpB,CAAC;IAExC,UAAU;QAChB,OAAO;YACH,cAAc,EAAE,kBAAkB;YAClC,aAAa,EAAE,UAAU,IAAI,CAAC,MAAM,EAAE;SACzC,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-client.ts.d.ts","sourceRoot":"","sources":["../../src/libs/graphql-client.ts.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,KAA+D,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-client.ts.js","sourceRoot":"","sources":["../../src/libs/graphql-client.ts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,aAAa,CAAC,yCAAyC,CAAC,CAAC"}
|
package/dist/main.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAK1D,qBAAa,aAAc,SAAQ,cAAc;IAC7C,SAAgB,OAAO,kEAAsB;IAC7C,SAAgB,KAAK,4DAAoB;IACzC,SAAgB,YAAY,iFAA2B;gBAE3C,MAAM,EAAE,MAAM;CAG7B"}
|
package/dist/main.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAEpE,MAAM,OAAO,aAAc,SAAQ,cAAc;IAK7C,YAAY,MAAc;QACtB,KAAK,CAAC,MAAM,CAAC,CAAC;QALF,YAAO,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;QAC7B,UAAK,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;QACzB,iBAAY,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAIvD,CAAC;CACJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"order.dto.d.ts","sourceRoot":"","sources":["../../../../src/resources/order/dto/order.dto.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACrB,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,EAAE,cAAc,EAAE,CAAA;CAC1B;AAED,UAAU,aAAa;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,cAAc;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAGD,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"order.dto.js","sourceRoot":"","sources":["../../../../src/resources/order/dto/order.dto.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"order.feature.d.ts","sourceRoot":"","sources":["../../../src/resources/order/order.feature.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,qBAAa,YAAY;IACT,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,YAAY;IAElD,GAAG,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC;CAC7C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"order.feature.js","sourceRoot":"","sources":["../../../src/resources/order/order.feature.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,YAAY;IACrB,YAA6B,OAAqB;QAArB,YAAO,GAAP,OAAO,CAAc;IAAI,CAAC;IAEvD,GAAG,CAAC,IAAc,IAA2B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAA,CAAC,CAAC;CACpF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"order.model.d.ts","sourceRoot":"","sources":["../../../src/resources/order/order.model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,wBAAgB,UAAU,CAAC,OAAO,EAAE,cAAc,gBAGjD"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { OrderFeature } from "./order.feature.js";
|
|
2
|
-
import { OrderService } from "./service/order.ser.js";
|
|
3
|
-
export function OrderModel(connect) {
|
|
4
|
-
const service = new OrderService(connect);
|
|
5
|
-
return new OrderFeature(service);
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=order.model.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"order.model.js","sourceRoot":"","sources":["../../../src/resources/order/order.model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,MAAM,UAAU,UAAU,CAAC,OAAuB;IAC9C,MAAM,OAAO,GAAG,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC;IAC1C,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"order.ser.d.ts","sourceRoot":"","sources":["../../../../src/resources/order/service/order.ser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAElE,qBAAa,YAAY;IACT,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,cAAc;IAE9C,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE;QAAE,IAAI,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,CAAC;CAoBlE"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export class OrderService {
|
|
2
|
-
constructor(connect) {
|
|
3
|
-
this.connect = connect;
|
|
4
|
-
}
|
|
5
|
-
async make({ data }) {
|
|
6
|
-
const response = await fetch(`${this.connect["apiEndpoint"]}/order/new`, {
|
|
7
|
-
method: "POST",
|
|
8
|
-
headers: this.connect["getHeaders"](),
|
|
9
|
-
body: JSON.stringify(data)
|
|
10
|
-
});
|
|
11
|
-
if (!response.ok) {
|
|
12
|
-
throw ({
|
|
13
|
-
cause: `Erro ao cadastrar compra (${response.status})`,
|
|
14
|
-
status: response.status,
|
|
15
|
-
message: response.statusText
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
return response.json();
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=order.ser.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"order.ser.js","sourceRoot":"","sources":["../../../../src/resources/order/service/order.ser.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,YAAY;IACrB,YAA6B,OAAuB;QAAvB,YAAO,GAAP,OAAO,CAAgB;IAAI,CAAC;IAEzD,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAsB;QACnC,MAAM,QAAQ,GAAG,MAAM,KAAK,CACxB,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,YAAY,EAC1C;YACI,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;YACrC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;SAC7B,CACJ,CAAC;QAEF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACf,MAAM,CAAC;gBACH,KAAK,EAAE,6BAA6B,QAAQ,CAAC,MAAM,GAAG;gBACtD,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,OAAO,EAAE,QAAQ,CAAC,UAAU;aAC/B,CAAC,CAAC;QACP,CAAC;QAED,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC;CACJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"organization.dto.d.ts","sourceRoot":"","sources":["../../../../src/resources/organization/dto/organization.dto.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,2BAA2B;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,mCAAmC,GAAG,IAAI,CAAA;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,0CAA0C;IACvD,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,mCAAmC;IAChD,OAAO,EAAE,0CAA0C,EAAE,CAAA;CACxD;AAED,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"organization.dto.js","sourceRoot":"","sources":["../../../../src/resources/organization/dto/organization.dto.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"organization.feature.d.ts","sourceRoot":"","sources":["../../../src/resources/organization/organization.feature.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAClG,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,qBAAa,mBAAmB;IAChB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,mBAAmB;IAEzD,IAAI,IAAI,OAAO,CAAC,2BAA2B,CAAC;IAC5C,WAAW,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC;CAChD"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { OrganizationService } from "./service/organization.ser.js";
|
|
2
|
-
export class OrganizationFeature {
|
|
3
|
-
constructor(service) {
|
|
4
|
-
this.service = service;
|
|
5
|
-
}
|
|
6
|
-
info() { return this.service.getInfo(); }
|
|
7
|
-
socialLinks() { return this.service.getLinks(); }
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=organization.feature.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"organization.feature.js","sourceRoot":"","sources":["../../../src/resources/organization/organization.feature.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,MAAM,OAAO,mBAAmB;IAC5B,YAA6B,OAA4B;QAA5B,YAAO,GAAP,OAAO,CAAqB;IAAI,CAAC;IAE9D,IAAI,KAA2C,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAA,CAAC,CAAC;IAC9E,WAAW,KAAqC,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAA,CAAC,CAAC;CACnF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"organization.model.d.ts","sourceRoot":"","sources":["../../../src/resources/organization/organization.model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,cAAc,uBAGxD"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { OrganizationService } from "./service/organization.ser.js";
|
|
2
|
-
import { OrganizationFeature } from "./organization.feature.js";
|
|
3
|
-
export function OrganizationModel(connect) {
|
|
4
|
-
const service = new OrganizationService(connect);
|
|
5
|
-
return new OrganizationFeature(service);
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=organization.model.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"organization.model.js","sourceRoot":"","sources":["../../../src/resources/organization/organization.model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,MAAM,UAAU,iBAAiB,CAAC,OAAuB;IACrD,MAAM,OAAO,GAAG,IAAI,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACjD,OAAO,IAAI,mBAAmB,CAAC,OAAO,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"organization.ser.d.ts","sourceRoot":"","sources":["../../../../src/resources/organization/service/organization.ser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAE,2BAA2B,EAAE,mBAAmB,EAAC,MAAM,4BAA4B,CAAC;AAElG,qBAAa,mBAAmB;IAChB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,cAAc;IAE9C,OAAO,IAAI,OAAO,CAAC,2BAA2B,CAAC;IAgB/C,QAAQ,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC;CAenD"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export class OrganizationService {
|
|
2
|
-
constructor(connect) {
|
|
3
|
-
this.connect = connect;
|
|
4
|
-
}
|
|
5
|
-
async getInfo() {
|
|
6
|
-
const response = await fetch(`${this.connect["apiEndpoint"]}/organization/info`, {
|
|
7
|
-
method: "GET",
|
|
8
|
-
headers: this.connect["getHeaders"](),
|
|
9
|
-
});
|
|
10
|
-
if (!response.ok) {
|
|
11
|
-
throw new Error(`Erro ao buscar informações da organização (${response.status})`);
|
|
12
|
-
}
|
|
13
|
-
return response.json();
|
|
14
|
-
}
|
|
15
|
-
async getLinks() {
|
|
16
|
-
const response = await fetch(`${this.connect["apiEndpoint"]}/organization/links`, {
|
|
17
|
-
method: "GET",
|
|
18
|
-
headers: this.connect["getHeaders"](),
|
|
19
|
-
});
|
|
20
|
-
if (!response.ok) {
|
|
21
|
-
throw new Error(`Erro ao buscar links da organização (${response.status})`);
|
|
22
|
-
}
|
|
23
|
-
return response.json();
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=organization.ser.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"organization.ser.js","sourceRoot":"","sources":["../../../../src/resources/organization/service/organization.ser.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,mBAAmB;IAC5B,YAA6B,OAAuB;QAAvB,YAAO,GAAP,OAAO,CAAgB;IAAG,CAAC;IAExD,KAAK,CAAC,OAAO;QACT,MAAM,QAAQ,GAAG,MAAM,KAAK,CACxB,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,oBAAoB,EAClD;YACI,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;SACxC,CACJ,CAAC;QAEF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,8CAA8C,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;QACtF,CAAC;QAED,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,QAAQ;QACV,MAAM,QAAQ,GAAG,MAAM,KAAK,CACxB,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,qBAAqB,EACnD;YACI,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;SACxC,CACJ,CAAC;QAEF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,wCAAwC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;QAChF,CAAC;QAED,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC;CACJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"product.dto.d.ts","sourceRoot":"","sources":["../../../../src/resources/product/dto/product.dto.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC7B,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC1B,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACtB,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACtB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"product.dto.js","sourceRoot":"","sources":["../../../../src/resources/product/dto/product.dto.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"product.feature.d.ts","sourceRoot":"","sources":["../../../src/resources/product/product.feature.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,qBAAa,cAAc;IACX,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,cAAc;IAEpD,QAAQ,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;IACjC,OAAO,CAAC,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,UAAU,CAAC;CACvD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"product.feature.js","sourceRoot":"","sources":["../../../src/resources/product/product.feature.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,cAAc;IACvB,YAA6B,OAAuB;QAAvB,YAAO,GAAP,OAAO,CAAgB;IAAI,CAAC;IAEzD,QAAQ,KAA4B,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,CAAA,CAAC,CAAC;IAC1E,OAAO,CAAC,EAAE,EAAE,EAAkB,IAAyB,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC;CAClG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"product.model.d.ts","sourceRoot":"","sources":["../../../src/resources/product/product.model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,wBAAgB,YAAY,CAAC,OAAO,EAAE,cAAc,kBAGnD"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ProductFeature } from "./product.feature.js";
|
|
2
|
-
import { ProductService } from "./service/product.ser.js";
|
|
3
|
-
export function ProductModel(connect) {
|
|
4
|
-
const service = new ProductService(connect);
|
|
5
|
-
return new ProductFeature(service);
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=product.model.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"product.model.js","sourceRoot":"","sources":["../../../src/resources/product/product.model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,MAAM,UAAU,YAAY,CAAC,OAAuB;IAChD,MAAM,OAAO,GAAG,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;IAC5C,OAAO,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"product.ser.d.ts","sourceRoot":"","sources":["../../../../src/resources/product/service/product.ser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,qBAAa,cAAc;IACX,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,cAAc;IAE9C,cAAc,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;IAgBvC,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;CAexD"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export class ProductService {
|
|
2
|
-
constructor(connect) {
|
|
3
|
-
this.connect = connect;
|
|
4
|
-
}
|
|
5
|
-
async getAllProducts() {
|
|
6
|
-
const response = await fetch(`${this.connect["apiEndpoint"]}/product/all`, {
|
|
7
|
-
method: "GET",
|
|
8
|
-
headers: this.connect["getHeaders"](),
|
|
9
|
-
});
|
|
10
|
-
if (!response.ok) {
|
|
11
|
-
throw new Error(`Erro ao buscar produtos (${response.status})`);
|
|
12
|
-
}
|
|
13
|
-
return response.json();
|
|
14
|
-
}
|
|
15
|
-
async getProductById(id) {
|
|
16
|
-
const response = await fetch(`${this.connect["apiEndpoint"]}/product/${id}`, {
|
|
17
|
-
method: "GET",
|
|
18
|
-
headers: this.connect["getHeaders"](),
|
|
19
|
-
});
|
|
20
|
-
if (!response.ok) {
|
|
21
|
-
throw new Error(`Erro ao buscar produto (${response.status})`);
|
|
22
|
-
}
|
|
23
|
-
return response.json();
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=product.ser.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"product.ser.js","sourceRoot":"","sources":["../../../../src/resources/product/service/product.ser.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,cAAc;IACvB,YAA6B,OAAuB;QAAvB,YAAO,GAAP,OAAO,CAAgB;IAAG,CAAC;IAExD,KAAK,CAAC,cAAc;QAChB,MAAM,QAAQ,GAAG,MAAM,KAAK,CACxB,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,cAAc,EAC5C;YACI,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;SACxC,CACJ,CAAC;QAEF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,4BAA4B,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;QACpE,CAAC;QAED,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,EAAU;QAC3B,MAAM,QAAQ,GAAG,MAAM,KAAK,CACxB,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,YAAY,EAAE,EAAE,EAC9C;YACI,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;SACxC,CACJ,CAAC;QAEF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,2BAA2B,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;QACnE,CAAC;QAED,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC;CACJ"}
|
package/dist/test.d.ts
DELETED
package/dist/test.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":""}
|