@hellena-sdk/hellena 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +28 -8
  2. package/dist/core/HellenaConnect.d.ts +5 -8
  3. package/dist/core/HellenaConnect.d.ts.map +1 -1
  4. package/dist/main.d.ts +3 -4
  5. package/dist/main.d.ts.map +1 -1
  6. package/dist/main.js +121 -11
  7. package/dist/resources/order/dto/order.dto.d.ts +50 -8
  8. package/dist/resources/order/dto/order.dto.d.ts.map +1 -1
  9. package/dist/resources/order/order.feature.d.ts +2 -2
  10. package/dist/resources/order/order.feature.d.ts.map +1 -1
  11. package/dist/resources/order/order.model.d.ts +2 -2
  12. package/dist/resources/order/order.model.d.ts.map +1 -1
  13. package/dist/resources/order/service/order.ser.d.ts +2 -2
  14. package/dist/resources/order/service/order.ser.d.ts.map +1 -1
  15. package/dist/resources/organization/organization.feature.d.ts +2 -2
  16. package/dist/resources/organization/organization.feature.d.ts.map +1 -1
  17. package/dist/resources/organization/service/organization.ser.d.ts +2 -2
  18. package/dist/resources/organization/service/organization.ser.d.ts.map +1 -1
  19. package/dist/resources/product/product.feature.d.ts +2 -2
  20. package/dist/resources/product/product.feature.d.ts.map +1 -1
  21. package/dist/resources/product/product.model.d.ts +2 -2
  22. package/dist/resources/product/product.model.d.ts.map +1 -1
  23. package/dist/resources/product/service/product.ser.d.ts +2 -2
  24. package/dist/resources/product/service/product.ser.d.ts.map +1 -1
  25. package/package.json +31 -27
  26. package/LICENSE +0 -21
  27. package/dist/core/HellenaConnect.js +0 -15
  28. package/dist/core/HellenaConnect.js.map +0 -1
  29. package/dist/libs/graphql-client.ts.d.ts +0 -2
  30. package/dist/libs/graphql-client.ts.d.ts.map +0 -1
  31. package/dist/libs/graphql-client.ts.js +0 -3
  32. package/dist/libs/graphql-client.ts.js.map +0 -1
  33. package/dist/main.js.map +0 -1
  34. package/dist/resources/order/dto/order.dto.js +0 -2
  35. package/dist/resources/order/dto/order.dto.js.map +0 -1
  36. package/dist/resources/order/order.feature.js +0 -7
  37. package/dist/resources/order/order.feature.js.map +0 -1
  38. package/dist/resources/order/order.model.js +0 -7
  39. package/dist/resources/order/order.model.js.map +0 -1
  40. package/dist/resources/order/service/order.ser.js +0 -21
  41. package/dist/resources/order/service/order.ser.js.map +0 -1
  42. package/dist/resources/organization/dto/organization.dto.js +0 -2
  43. package/dist/resources/organization/dto/organization.dto.js.map +0 -1
  44. package/dist/resources/organization/organization.feature.js +0 -9
  45. package/dist/resources/organization/organization.feature.js.map +0 -1
  46. package/dist/resources/organization/organization.model.js +0 -7
  47. package/dist/resources/organization/organization.model.js.map +0 -1
  48. package/dist/resources/organization/service/organization.ser.js +0 -26
  49. package/dist/resources/organization/service/organization.ser.js.map +0 -1
  50. package/dist/resources/product/dto/product.dto.js +0 -2
  51. package/dist/resources/product/dto/product.dto.js.map +0 -1
  52. package/dist/resources/product/product.feature.js +0 -8
  53. package/dist/resources/product/product.feature.js.map +0 -1
  54. package/dist/resources/product/product.model.js +0 -7
  55. package/dist/resources/product/product.model.js.map +0 -1
  56. package/dist/resources/product/service/product.ser.js +0 -26
  57. package/dist/resources/product/service/product.ser.js.map +0 -1
  58. package/dist/test.d.ts +0 -2
  59. package/dist/test.d.ts.map +0 -1
  60. package/dist/test.js +0 -38
  61. package/dist/test.js.map +0 -1
package/README.md CHANGED
@@ -16,18 +16,38 @@ import dotenv from "dotenv";
16
16
 
17
17
  dotenv.config({ quiet: true });
18
18
 
19
- const main = async () => {
19
+ async function main() {
20
20
  const hellena = new HellenaClient(process.env.HELLENA_API_KEY!);
21
21
 
22
- const product = await hellena.product.findOne({
23
- id: "123"
24
- })
25
-
26
- return product
22
+ try {
23
+ console.log("carregando...")
24
+ const products = await hellena.product.findOne({ id: "cmqs3vs6q00010mao7v945sat" });
25
+ const order = await hellena.order.new({
26
+ customerName: "Nome do Cliente",
27
+ customerEmail: "emaildocliente@exemplo.com",
28
+ lat: 7.120712,
29
+ lng: 7.619913,
30
+ address: "local de entrega",
31
+ items: [
32
+ {
33
+ productId: "cmqs3vs6q00010mao7v945sat",
34
+ quantity: 6,
35
+ price: 5000,
36
+ image: "https://encrypted-tbn0.gstatic.com/images?NM7ako&s=10",
37
+ category: "Sapato",
38
+ name: "NIKE"
39
+ }
40
+ ]
41
+ })
42
+ console.log("products: ", products);
43
+ console.log("order: ", order);
44
+ } catch (error) {
45
+ console.error(error)
46
+ }
27
47
  }
28
48
 
29
49
  main().then((data) => {
30
- console.log(data.barcode, data.name, data.quantity);
50
+ console.log("concluido");
31
51
  }).catch((error) => {
32
52
  console.error("An error occurred:", error);
33
53
  });
@@ -45,4 +65,4 @@ For more information, visit the [documentation](./docs).
45
65
 
46
66
  ## License
47
67
 
48
- MIT
68
+ MIT
@@ -1,12 +1,9 @@
1
1
  export declare class HellenaConnect {
2
2
  protected readonly apiKey: string;
3
- protected readonly apiUrl = "https://hellena-api-for-devs.vercel.app";
4
- protected readonly apiVersion = "v1";
5
- protected readonly apiEndpoint: string;
6
- constructor(apiKey: string);
7
- protected getHeaders(): {
8
- "Content-Type": string;
9
- Authorization: string;
10
- };
3
+ protected readonly apiUrl: string;
4
+ protected readonly apiVersion: string;
5
+ constructor(apiKey: string, apiUrl?: string, apiVersion?: string);
6
+ protected get apiEndpoint(): string;
7
+ protected getHeaders(): Record<string, string>;
11
8
  }
12
9
  //# sourceMappingURL=HellenaConnect.d.ts.map
@@ -1 +1 @@
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
+ {"version":3,"file":"HellenaConnect.d.ts","sourceRoot":"","sources":["../../src/core/HellenaConnect.ts"],"names":[],"mappings":"AAAA,qBAAa,cAAc;IAKnB,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM;IAJrC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAClC,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;gBAGf,MAAM,EAAE,MAAM,EACjC,MAAM,SAA4B,EAClC,UAAU,SAAO;IAMrB,SAAS,KAAK,WAAW,IAAI,MAAM,CAElC;IAED,SAAS,CAAC,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CAMjD"}
package/dist/main.d.ts CHANGED
@@ -1,8 +1,7 @@
1
- import { HellenaConnect } from "./core/HellenaConnect.js";
1
+ import { HellenaConnect } from "./core/HellenaConnect";
2
2
  export declare class HellenaClient extends HellenaConnect {
3
- readonly product: import("./resources/product/product.feature.js").ProductFeature;
4
- readonly order: import("./resources/order/order.feature.js").OrderFeature;
5
- readonly organization: import("./resources/organization/organization.feature.js").OrganizationFeature;
3
+ readonly product: import("./resources/product/product.feature").ProductFeature;
4
+ readonly order: import("./resources/order/order.feature").OrderFeature;
6
5
  constructor(apiKey: string);
7
6
  }
8
7
  //# sourceMappingURL=main.d.ts.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAIvD,qBAAa,aAAc,SAAQ,cAAc;IAC7C,SAAgB,OAAO,+DAAsB;IAC7C,SAAgB,KAAK,yDAAoB;gBAG7B,MAAM,EAAE,MAAM;CAG7B"}
package/dist/main.js CHANGED
@@ -1,13 +1,123 @@
1
- import { HellenaConnect } from "./core/HellenaConnect.js";
2
- import { OrderModel } from "./resources/order/order.model.js";
3
- import { OrganizationModel } from "./resources/organization/organization.model.js";
4
- import { ProductModel } from "./resources/product/product.model.js";
5
- export class HellenaClient extends HellenaConnect {
6
- constructor(apiKey) {
7
- super(apiKey);
8
- this.product = ProductModel(this);
9
- this.order = OrderModel(this);
10
- this.organization = OrganizationModel(this);
1
+ // src/core/HellenaConnect.ts
2
+ class HellenaConnect {
3
+ apiKey;
4
+ apiUrl;
5
+ apiVersion;
6
+ constructor(apiKey, apiUrl = "https://api.hellena.app", apiVersion = "v1") {
7
+ this.apiKey = apiKey;
8
+ this.apiUrl = apiUrl;
9
+ this.apiVersion = apiVersion;
10
+ }
11
+ get apiEndpoint() {
12
+ return `${this.apiUrl}/${this.apiVersion}`;
13
+ }
14
+ getHeaders() {
15
+ return {
16
+ "Content-Type": "application/json",
17
+ "x-hellena-api-key": this.apiKey
18
+ };
19
+ }
20
+ }
21
+
22
+ // src/resources/order/service/order.ser.ts
23
+ class OrderService {
24
+ connect;
25
+ constructor(connect) {
26
+ this.connect = connect;
27
+ }
28
+ async make({ data }) {
29
+ const response = await fetch(`${this.connect["apiEndpoint"]}/orders`, {
30
+ method: "POST",
31
+ headers: this.connect["getHeaders"](),
32
+ body: JSON.stringify(data)
33
+ });
34
+ if (!response.ok) {
35
+ throw {
36
+ cause: `Erro ao cadastrar compra (${response.status})`,
37
+ status: response.status,
38
+ message: response.statusText
39
+ };
40
+ }
41
+ return response.json();
42
+ }
43
+ }
44
+
45
+ // src/resources/order/order.feature.ts
46
+ class OrderFeature {
47
+ service;
48
+ constructor(service) {
49
+ this.service = service;
50
+ }
51
+ async new(data) {
52
+ const order = await this.service.make({ data });
53
+ return order;
54
+ }
55
+ }
56
+
57
+ // src/resources/order/order.model.ts
58
+ function OrderModel(connect) {
59
+ const service = new OrderService(connect);
60
+ return new OrderFeature(service);
61
+ }
62
+
63
+ // src/resources/product/service/product.ser.ts
64
+ class ProductService {
65
+ connect;
66
+ constructor(connect) {
67
+ this.connect = connect;
68
+ }
69
+ async getAllProducts() {
70
+ const response = await fetch(`${this.connect["apiEndpoint"]}/products/all`, {
71
+ method: "GET",
72
+ headers: this.connect["getHeaders"]()
73
+ });
74
+ if (!response.ok) {
75
+ throw new Error(`Erro ao buscar produtos (${response.status})`);
11
76
  }
77
+ return response.json();
78
+ }
79
+ async getProductById(id) {
80
+ const response = await fetch(`${this.connect["apiEndpoint"]}/products/${id}`, {
81
+ method: "GET",
82
+ headers: this.connect["getHeaders"]()
83
+ });
84
+ if (!response.ok) {
85
+ throw new Error(`Erro ao buscar produto (${response.status})`);
86
+ }
87
+ return response.json();
88
+ }
89
+ }
90
+
91
+ // src/resources/product/product.feature.ts
92
+ class ProductFeature {
93
+ service;
94
+ constructor(service) {
95
+ this.service = service;
96
+ }
97
+ async findMany() {
98
+ const products = await this.service.getAllProducts();
99
+ return products;
100
+ }
101
+ async findOne({ id }) {
102
+ const product = await this.service.getProductById(id);
103
+ return product;
104
+ }
105
+ }
106
+
107
+ // src/resources/product/product.model.ts
108
+ function ProductModel(connect) {
109
+ const service = new ProductService(connect);
110
+ return new ProductFeature(service);
111
+ }
112
+
113
+ // src/main.ts
114
+ class HellenaClient extends HellenaConnect {
115
+ product = ProductModel(this);
116
+ order = OrderModel(this);
117
+ constructor(apiKey) {
118
+ super(apiKey);
119
+ }
12
120
  }
13
- //# sourceMappingURL=main.js.map
121
+ export {
122
+ HellenaClient
123
+ };
@@ -1,14 +1,18 @@
1
1
  export interface OrderDTO {
2
- info: Order_InfoDTO;
3
- items: Order_ItemsDTO[];
4
- }
5
- interface Order_InfoDTO {
6
2
  customerName?: string;
7
3
  customerEmail?: string;
4
+ customerId?: string;
5
+ customerProfile?: string;
8
6
  notes?: string;
9
7
  lat?: number;
10
8
  lng?: number;
9
+ origin?: string;
10
+ shippingMethod?: string;
11
+ paymentMethod?: string;
12
+ cupon?: string;
13
+ meta?: Record<string, any>;
11
14
  address?: string;
15
+ items: Order_ItemsDTO[];
12
16
  }
13
17
  interface Order_ItemsDTO {
14
18
  productId: string;
@@ -20,10 +24,48 @@ interface Order_ItemsDTO {
20
24
  }
21
25
  export interface Order_Return {
22
26
  id: string;
23
- origin: string | null;
24
- createdAt: Date;
25
- updatedAt: Date;
26
- organizationId: string | null;
27
+ organizationId: string;
28
+ createdAt: string;
29
+ updatedAt: any;
30
+ origin: string;
31
+ status: string;
32
+ amount: number;
33
+ deletedAt: any;
34
+ deliveryDate: any;
35
+ dueDate: any;
36
+ trackingCode: any;
37
+ shippingMethod: any;
38
+ paymentMethod: any;
39
+ cupon: any;
40
+ meta: any;
41
+ orderInfo: OrderInfo;
42
+ items: Item[];
43
+ }
44
+ export interface OrderInfo {
45
+ id: string;
46
+ orderId: string;
47
+ customerId: any;
48
+ customerProfile: any;
49
+ customerName: string;
50
+ customerEmail: string;
51
+ notes: any;
52
+ lat: string;
53
+ lng: string;
54
+ address: string;
55
+ createdAt: string;
56
+ updatedAt: any;
57
+ }
58
+ export interface Item {
59
+ id: string;
60
+ orderId: string;
61
+ productId: string;
62
+ image: string;
63
+ category: string;
64
+ name: string;
65
+ quantity: number;
66
+ price: number;
67
+ createdAt: string;
68
+ updatedAt: any;
27
69
  }
28
70
  export {};
29
71
  //# sourceMappingURL=order.dto.d.ts.map
@@ -1 +1 @@
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,UAA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I;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,GAAG,CAAA;CACjB"}
@@ -1,5 +1,5 @@
1
- import type { Order_Return, OrderDTO } from "./dto/order.dto.js";
2
- import type { OrderService } from "./service/order.ser.js";
1
+ import type { Order_Return, OrderDTO } from "./dto/order.dto";
2
+ import type { OrderService } from "./service/order.ser";
3
3
  export declare class OrderFeature {
4
4
  private readonly service;
5
5
  constructor(service: OrderService);
@@ -1 +1 @@
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
+ {"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,iBAAiB,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,qBAAa,YAAY;IACT,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,YAAY;IAE5C,GAAG,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC;CAInD"}
@@ -1,4 +1,4 @@
1
- import type { HellenaConnect } from "@/core/HellenaConnect.js";
2
- import { OrderFeature } from "./order.feature.js";
1
+ import type { HellenaConnect } from "@//core/HellenaConnect";
2
+ import { OrderFeature } from "./order.feature";
3
3
  export declare function OrderModel(connect: HellenaConnect): OrderFeature;
4
4
  //# sourceMappingURL=order.model.d.ts.map
@@ -1 +1 @@
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
+ {"version":3,"file":"order.model.d.ts","sourceRoot":"","sources":["../../../src/resources/order/order.model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,wBAAgB,UAAU,CAAC,OAAO,EAAE,cAAc,gBAGjD"}
@@ -1,5 +1,5 @@
1
- import type { HellenaConnect } from "@/core/HellenaConnect.js";
2
- import type { Order_Return, OrderDTO } from "../dto/order.dto.js";
1
+ import type { HellenaConnect } from "@//core/HellenaConnect";
2
+ import type { Order_Return, OrderDTO } from "../dto/order.dto";
3
3
  export declare class OrderService {
4
4
  private readonly connect;
5
5
  constructor(connect: HellenaConnect);
@@ -1 +1 @@
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
+ {"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,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE/D,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,5 +1,5 @@
1
- import type { OrganizationInfoResponseDTO, OrganizationLinkDTO } from "./dto/organization.dto.js";
2
- import { OrganizationService } from "./service/organization.ser.js";
1
+ import type { OrganizationInfoResponseDTO, OrganizationLinkDTO } from "./dto/organization.dto";
2
+ import { OrganizationService } from "./service/organization.ser";
3
3
  export declare class OrganizationFeature {
4
4
  private readonly service;
5
5
  constructor(service: OrganizationService);
@@ -1 +1 @@
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
+ {"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,wBAAwB,CAAC;AAC/F,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,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,5 +1,5 @@
1
- import type { HellenaConnect } from "@/core/HellenaConnect.js";
2
- import type { OrganizationInfoResponseDTO, OrganizationLinkDTO } from "../dto/organization.dto.js";
1
+ import type { HellenaConnect } from "@//core/HellenaConnect";
2
+ import type { OrganizationInfoResponseDTO, OrganizationLinkDTO } from "../dto/organization.dto";
3
3
  export declare class OrganizationService {
4
4
  private readonly connect;
5
5
  constructor(connect: HellenaConnect);
@@ -1 +1 @@
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
+ {"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,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEhG,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,5 +1,5 @@
1
- import type { ProductDTO } from "./dto/product.dto.js";
2
- import type { ProductService } from "./service/product.ser.js";
1
+ import type { ProductDTO } 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);
@@ -1 +1 @@
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
+ {"version":3,"file":"product.feature.d.ts","sourceRoot":"","sources":["../../../src/resources/product/product.feature.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAE3D,qBAAa,cAAc;IACX,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,cAAc;IAE9C,QAAQ,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;IAKjC,OAAO,CAAC,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,UAAU,CAAC;CAI7D"}
@@ -1,4 +1,4 @@
1
- import type { HellenaConnect } from "@/core/HellenaConnect.js";
2
- import { ProductFeature } from "./product.feature.js";
1
+ import type { HellenaConnect } from "@//core/HellenaConnect";
2
+ import { ProductFeature } from "./product.feature";
3
3
  export declare function ProductModel(connect: HellenaConnect): ProductFeature;
4
4
  //# sourceMappingURL=product.model.d.ts.map
@@ -1 +1 @@
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
+ {"version":3,"file":"product.model.d.ts","sourceRoot":"","sources":["../../../src/resources/product/product.model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,wBAAgB,YAAY,CAAC,OAAO,EAAE,cAAc,kBAGnD"}
@@ -1,5 +1,5 @@
1
- import type { HellenaConnect } from "@/core/HellenaConnect.js";
2
- import type { ProductDTO } from "../dto/product.dto.js";
1
+ import type { HellenaConnect } from "@//core/HellenaConnect";
2
+ import type { ProductDTO } from "../dto/product.dto";
3
3
  export declare class ProductService {
4
4
  private readonly connect;
5
5
  constructor(connect: HellenaConnect);
@@ -1 +1 @@
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
+ {"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,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,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"}
package/package.json CHANGED
@@ -1,45 +1,49 @@
1
1
  {
2
2
  "name": "@hellena-sdk/hellena",
3
- "version": "1.0.4",
4
- "description": "",
3
+ "version": "1.0.6",
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
- "import": "./dist/main.js",
20
- "types": "./dist/main.d.ts"
13
+ "types": "./dist/main.d.ts",
14
+ "import": "./dist/main.js"
21
15
  }
22
16
  },
23
17
  "files": ["dist"],
18
+ "scripts": {
19
+ "build": "bun build src/main.ts --outdir dist --target node && tsc --emitDeclarationOnly",
20
+ "dev": "bun run index.ts",
21
+ "pack": "mkdir packages && npm pack && mv *.tgz packages/",
22
+ "prepublishOnly": "bun run build"
23
+ },
24
+ "devDependencies": {
25
+ "@types/bun": "latest",
26
+ "typescript": "^5.9.0"
27
+ },
28
+ "peerDependencies": {
29
+ "typescript": "^5"
30
+ },
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
24
34
  "repository": {
25
35
  "type": "git",
26
36
  "url": "git+https://github.com/Helena-mother/hellena-javascript-SDK.git"
27
37
  },
28
- "keywords": [],
29
- "author": "",
30
- "license": "ISC",
31
- "type": "module",
32
38
  "bugs": {
33
39
  "url": "https://github.com/Helena-mother/hellena-javascript-SDK/issues"
34
40
  },
35
41
  "homepage": "https://github.com/Helena-mother/hellena-javascript-SDK#readme",
36
- "devDependencies": {
37
- "@types/node": "^25.0.3",
38
- "ts-node": "^10.9.2",
39
- "tsconfig-paths": "^4.2.0",
40
- "typescript": "^5.9.3"
41
- },
42
- "dependencies": {
43
- "dotenv": "^17.2.3"
44
- }
42
+ "keywords": [
43
+ "hellena",
44
+ "sdk",
45
+ "api",
46
+ "javascript",
47
+ "typescript"
48
+ ]
45
49
  }
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,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,2 +0,0 @@
1
- export declare const graphQLClient: any;
2
- //# sourceMappingURL=graphql-client.ts.d.ts.map
@@ -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,3 +0,0 @@
1
- import { GraphQLClient } from "graphql-request";
2
- export const graphQLClient = new GraphQLClient("https://hellena-api-for-devs.vercel.app");
3
- //# sourceMappingURL=graphql-client.ts.js.map
@@ -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.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,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=order.dto.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"order.dto.js","sourceRoot":"","sources":["../../../../src/resources/order/dto/order.dto.ts"],"names":[],"mappings":""}
@@ -1,7 +0,0 @@
1
- export class OrderFeature {
2
- constructor(service) {
3
- this.service = service;
4
- }
5
- new(data) { return this.service.make({ data }); }
6
- }
7
- //# sourceMappingURL=order.feature.js.map
@@ -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,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,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,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=organization.dto.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"organization.dto.js","sourceRoot":"","sources":["../../../../src/resources/organization/dto/organization.dto.ts"],"names":[],"mappings":""}
@@ -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,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,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,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=product.dto.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"product.dto.js","sourceRoot":"","sources":["../../../../src/resources/product/dto/product.dto.ts"],"names":[],"mappings":""}
@@ -1,8 +0,0 @@
1
- export class ProductFeature {
2
- constructor(service) {
3
- this.service = service;
4
- }
5
- findMany() { return this.service.getAllProducts(); }
6
- findOne({ id }) { return this.service.getProductById(id); }
7
- }
8
- //# sourceMappingURL=product.feature.js.map
@@ -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,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,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
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":""}
package/dist/test.js DELETED
@@ -1,38 +0,0 @@
1
- import dotenv from "dotenv";
2
- import { HellenaClient } from "./main.js";
3
- dotenv.config({ quiet: true });
4
- async function main() {
5
- const hellena = new HellenaClient(process.env.HELLENA_API_KEY);
6
- try {
7
- console.log("carregando...");
8
- const products = await hellena.product.findMany();
9
- const social = await hellena.organization.info();
10
- const order = await hellena.order.new({
11
- info: {
12
- customerName: "walter santana",
13
- customerEmail: "walteralexandresantana@gmail.com",
14
- lat: 7.120712,
15
- lng: 7.619913,
16
- address: "golf 2",
17
- },
18
- items: [
19
- {
20
- productId: "cmj8ihkux0000aod30yod04pl",
21
- quantity: 6,
22
- price: 200,
23
- image: "944928849",
24
- category: "teste",
25
- name: "teste"
26
- }
27
- ]
28
- });
29
- console.log("products: ", products);
30
- console.log("social: ", social.shopping?.banners[0]?.link);
31
- console.log("order: ", order);
32
- }
33
- catch (error) {
34
- console.error(error);
35
- }
36
- }
37
- main();
38
- //# sourceMappingURL=test.js.map
package/dist/test.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"test.js","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAE/B,KAAK,UAAU,IAAI;IACf,MAAM,OAAO,GAAG,IAAI,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,eAAgB,CAAC,CAAC;IAEhE,IAAI,CA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