@arkyn/server 3.0.1-beta.36 → 3.0.1-beta.38

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.
@@ -26,7 +26,7 @@ type ConfigProps = {
26
26
  * @param config.responseBody - The body of the response received.
27
27
  *
28
28
  * @remarks
29
- * - This function retrieves the inbox flow configuration using `InboxFlowInstance.getInboxConfig()`.
29
+ * - This function retrieves the inbox flow configuration using `InboxFlowService.getInboxConfig()`.
30
30
  * - If the configuration is not available, the function will return early without performing any action.
31
31
  * - In a development environment (`NODE_ENV === "development"`), the function will also return early.
32
32
  * - The request is sent as a POST request to the inbox API URL with the provided configuration details.
@@ -1,4 +1,4 @@
1
- import { ArkynLogInstance } from "../config/arkynLogInstance";
1
+ import { ArkynLogService } from "../services/arkynLogService";
2
2
  import { httpDebug } from "../services/httpDebug";
3
3
  /**
4
4
  * Sends a request to the inbox flow API with the provided configuration.
@@ -16,7 +16,7 @@ import { httpDebug } from "../services/httpDebug";
16
16
  * @param config.responseBody - The body of the response received.
17
17
  *
18
18
  * @remarks
19
- * - This function retrieves the inbox flow configuration using `InboxFlowInstance.getInboxConfig()`.
19
+ * - This function retrieves the inbox flow configuration using `InboxFlowService.getInboxConfig()`.
20
20
  * - If the configuration is not available, the function will return early without performing any action.
21
21
  * - In a development environment (`NODE_ENV === "development"`), the function will also return early.
22
22
  * - The request is sent as a POST request to the inbox API URL with the provided configuration details.
@@ -41,10 +41,10 @@ import { httpDebug } from "../services/httpDebug";
41
41
  * ```
42
42
  */
43
43
  async function arkynLogRequest(config) {
44
- const arkynInstance = ArkynLogInstance.getArkynConfig();
45
- if (!arkynInstance)
44
+ const arkynService = ArkynLogService.getArkynConfig();
45
+ if (!arkynService)
46
46
  return;
47
- const { arkynUserToken, arkynApiUrl } = arkynInstance;
47
+ const { arkynUserToken, arkynApiUrl } = arkynService;
48
48
  const { elapsedTime, method, queryParams, requestBody, requestHeaders, responseBody, responseHeaders, status, token, rawUrl, } = config;
49
49
  // if (process.env.NODE_ENV === "development") return;
50
50
  try {
@@ -66,7 +66,7 @@ async function arkynLogRequest(config) {
66
66
  responseHeaders,
67
67
  responseBody,
68
68
  });
69
- await fetch(arkynApiUrl.replace(":trafficSourceId", arkynInstance.arkynTrafficSourceId), {
69
+ await fetch(arkynApiUrl.replace(":trafficSourceId", arkynService.arkynTrafficSourceId), {
70
70
  method: "POST",
71
71
  body,
72
72
  headers: {
package/dist/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- export { ApiInstance } from "./config/apiInstance";
2
- export { ArkynLogInstance } from "./config/arkynLogInstance";
3
1
  export { BadGateway } from "./http/badResponses/badGateway";
4
2
  export { BadRequest } from "./http/badResponses/badRequest";
5
3
  export { Conflict } from "./http/badResponses/conflict";
@@ -14,6 +12,8 @@ export { Found } from "./http/successResponses/found";
14
12
  export { NoContent } from "./http/successResponses/noContent";
15
13
  export { Success } from "./http/successResponses/success";
16
14
  export { Updated } from "./http/successResponses/updated";
15
+ export { ApiService } from "./services/apiService";
16
+ export { ArkynLogService } from "./services/arkynLogService";
17
17
  export { decodeErrorMessageFromRequest } from "./services/decodeErrorMessageFromRequest";
18
18
  export { decodeRequestBody } from "./services/decodeRequestBody";
19
19
  export { errorHandler } from "./services/errorHandler";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAG7D,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC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,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAG9E,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAG1D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,6BAA6B,EAAE,MAAM,0CAA0C,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC"}
package/dist/index.js CHANGED
@@ -1,6 +1,3 @@
1
- // config
2
- export { ApiInstance } from "./config/apiInstance";
3
- export { ArkynLogInstance } from "./config/arkynLogInstance";
4
1
  // http bad responses
5
2
  export { BadGateway } from "./http/badResponses/badGateway";
6
3
  export { BadRequest } from "./http/badResponses/badRequest";
@@ -18,6 +15,8 @@ export { NoContent } from "./http/successResponses/noContent";
18
15
  export { Success } from "./http/successResponses/success";
19
16
  export { Updated } from "./http/successResponses/updated";
20
17
  // services
18
+ export { ApiService } from "./services/apiService";
19
+ export { ArkynLogService } from "./services/arkynLogService";
21
20
  export { decodeErrorMessageFromRequest } from "./services/decodeErrorMessageFromRequest";
22
21
  export { decodeRequestBody } from "./services/decodeRequestBody";
23
22
  export { errorHandler } from "./services/errorHandler";
@@ -1,4 +1,4 @@
1
- type ApiInstanceConstructorProps = {
1
+ type ApiServiceConstructorProps = {
2
2
  baseUrl: string;
3
3
  baseHeaders?: HeadersInit;
4
4
  baseToken?: string | null;
@@ -15,18 +15,18 @@ type ApiRequestDataWithBodyProps = {
15
15
  /**
16
16
  * Class representing an API instance to handle HTTP requests with base configurations.
17
17
  */
18
- declare class ApiInstance {
18
+ declare class ApiService {
19
19
  private baseUrl;
20
20
  private baseHeaders?;
21
21
  private baseToken?;
22
22
  /**
23
- * Creates an instance of ApiInstance.
23
+ * Creates an instance of ApiService.
24
24
  * @param props - The configuration properties for the API instance.
25
25
  * @param props.baseUrl - The base URL for the API.
26
26
  * @param props.baseHeaders - Optional base headers to include in all requests.
27
27
  * @param props.baseToken - Optional base token for authorization.
28
28
  */
29
- constructor(props: ApiInstanceConstructorProps);
29
+ constructor(props: ApiServiceConstructorProps);
30
30
  /**
31
31
  * Generates the full URL by appending the route to the base URL.
32
32
  * @param route - The route to append to the base URL.
@@ -76,5 +76,5 @@ declare class ApiInstance {
76
76
  */
77
77
  delete(route: string, data?: ApiRequestDataWithBodyProps): Promise<import("../types/ApiResponseDTO").ApiResponseDTO<any>>;
78
78
  }
79
- export { ApiInstance };
80
- //# sourceMappingURL=apiInstance.d.ts.map
79
+ export { ApiService };
80
+ //# sourceMappingURL=apiService.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"apiInstance.d.ts","sourceRoot":"","sources":["../../src/config/apiInstance.ts"],"names":[],"mappings":"AAMA,KAAK,2BAA2B,GAAG;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC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AW,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,CAAC;AAEF,KAAK,8BAA8B,GAAG;IACpC,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,2BAA2B,GAAG;IACjC,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AAEH,cAAM,UAAU;IACd,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,WAAW,CAAC,CAAc;IAClC,OAAO,CAAC,SAAS,CAAC,CAAS;IAE3B;;;;;;OAMG;gBAES,KAAK,EAAE,0BAA0B;IAM7C;;;;OAIG;IAEH,OAAO,CAAC,WAAW;IAInB;;;;;OAKG;IAEH,OAAO,CAAC,eAAe;IAcvB;;;;;OAKG;IAEG,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,8BAA8B;IAM9D;;;;;OAKG;IAEG,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,2BAA2B;IAO5D;;;;;OAKG;IAEG,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,2BAA2B;IAO3D;;;;;OAKG;IAEG,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,2BAA2B;IAO7D;;;;;OAKG;IAEG,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,2BAA2B;CAM/D;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -6,12 +6,12 @@ import { putRequest } from "../api/putRequest";
6
6
  /**
7
7
  * Class representing an API instance to handle HTTP requests with base configurations.
8
8
  */
9
- class ApiInstance {
9
+ class ApiService {
10
10
  baseUrl;
11
11
  baseHeaders;
12
12
  baseToken;
13
13
  /**
14
- * Creates an instance of ApiInstance.
14
+ * Creates an instance of ApiService.
15
15
  * @param props - The configuration properties for the API instance.
16
16
  * @param props.baseUrl - The base URL for the API.
17
17
  * @param props.baseHeaders - Optional base headers to include in all requests.
@@ -108,4 +108,4 @@ class ApiInstance {
108
108
  return await deleteRequest(url, headers, body);
109
109
  }
110
110
  }
111
- export { ApiInstance };
111
+ export { ApiService };
@@ -9,11 +9,11 @@ type SetArkynConfigProps = {
9
9
  arkynLogBaseApiUrl?: string;
10
10
  };
11
11
  /**
12
- * The `ArkynLogInstance` class manages the configuration for the arkyn flow.
12
+ * The `ArkynLogService` class manages the configuration for the arkyn flow.
13
13
  * It allows you to set and retrieve the arkyn configuration, including the traffic source ID,
14
14
  * user token, and API URL.
15
15
  */
16
- declare class ArkynLogInstance {
16
+ declare class ArkynLogService {
17
17
  private static arkynConfig?;
18
18
  /**
19
19
  * Sets the configuration for the arkyn. This method initializes the arkyn configuration
@@ -28,7 +28,7 @@ declare class ArkynLogInstance {
28
28
  */
29
29
  static setArkynConfig(arkynConfig: SetArkynConfigProps): void;
30
30
  /**
31
- * Retrieves the current arkyn configuration for the ArkynLogInstance.
31
+ * Retrieves the current arkyn configuration for the ArkynLogService.
32
32
  *
33
33
  * @returns {ArkynConfigProps | undefined} The current arkyn configuration if set,
34
34
  * or `undefined` if no configuration has been initialized.
@@ -40,5 +40,5 @@ declare class ArkynLogInstance {
40
40
  */
41
41
  static resetArkynConfig(): void;
42
42
  }
43
- export { ArkynLogInstance };
44
- //# sourceMappingURL=arkynLogInstance.d.ts.map
43
+ export { ArkynLogService };
44
+ //# sourceMappingURL=arkynLogService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arkynLogService.d.ts","sourceRoot":"","sources":["../../src/services/arkynLogService.ts"],"names":[],"mappings":"AAAA,KAAK,gBAAgB,GAAG;IACtB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,mBAAmB,GAAG;IACzB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF;;;;GAIG;AAEH,cAAM,eAAe;IACnB,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAmB;IAE9C;;;;;;;;;;OAUG;IAEH,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,mBAAmB;IAgBtD;;;;;OAKG;IACH,MAAM,CAAC,cAAc,IAAI,gBAAgB,GAAG,SAAS;IAIrD;;;OAGG;IAEH,MAAM,CAAC,gBAAgB;CAGxB;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -1,9 +1,9 @@
1
1
  /**
2
- * The `ArkynLogInstance` class manages the configuration for the arkyn flow.
2
+ * The `ArkynLogService` class manages the configuration for the arkyn flow.
3
3
  * It allows you to set and retrieve the arkyn configuration, including the traffic source ID,
4
4
  * user token, and API URL.
5
5
  */
6
- class ArkynLogInstance {
6
+ class ArkynLogService {
7
7
  static arkynConfig;
8
8
  /**
9
9
  * Sets the configuration for the arkyn. This method initializes the arkyn configuration
@@ -30,7 +30,7 @@ class ArkynLogInstance {
30
30
  };
31
31
  }
32
32
  /**
33
- * Retrieves the current arkyn configuration for the ArkynLogInstance.
33
+ * Retrieves the current arkyn configuration for the ArkynLogService.
34
34
  *
35
35
  * @returns {ArkynConfigProps | undefined} The current arkyn configuration if set,
36
36
  * or `undefined` if no configuration has been initialized.
@@ -46,4 +46,4 @@ class ArkynLogInstance {
46
46
  this.arkynConfig = undefined;
47
47
  }
48
48
  }
49
- export { ArkynLogInstance };
49
+ export { ArkynLogService };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkyn/server",
3
- "version": "3.0.1-beta.36",
3
+ "version": "3.0.1-beta.38",
4
4
  "author": "Arkyn | Lucas Gonçalves",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./src/index.ts",
@@ -1,4 +1,4 @@
1
- import { ArkynLogInstance } from "../config/arkynLogInstance";
1
+ import { ArkynLogService } from "../services/arkynLogService";
2
2
  import { httpDebug } from "../services/httpDebug";
3
3
 
4
4
  type ConfigProps = {
@@ -30,7 +30,7 @@ type ConfigProps = {
30
30
  * @param config.responseBody - The body of the response received.
31
31
  *
32
32
  * @remarks
33
- * - This function retrieves the inbox flow configuration using `InboxFlowInstance.getInboxConfig()`.
33
+ * - This function retrieves the inbox flow configuration using `InboxFlowService.getInboxConfig()`.
34
34
  * - If the configuration is not available, the function will return early without performing any action.
35
35
  * - In a development environment (`NODE_ENV === "development"`), the function will also return early.
36
36
  * - The request is sent as a POST request to the inbox API URL with the provided configuration details.
@@ -56,10 +56,10 @@ type ConfigProps = {
56
56
  */
57
57
 
58
58
  async function arkynLogRequest(config: ConfigProps) {
59
- const arkynInstance = ArkynLogInstance.getArkynConfig();
60
- if (!arkynInstance) return;
59
+ const arkynService = ArkynLogService.getArkynConfig();
60
+ if (!arkynService) return;
61
61
 
62
- const { arkynUserToken, arkynApiUrl } = arkynInstance;
62
+ const { arkynUserToken, arkynApiUrl } = arkynService;
63
63
 
64
64
  const {
65
65
  elapsedTime,
@@ -99,7 +99,7 @@ async function arkynLogRequest(config: ConfigProps) {
99
99
  await fetch(
100
100
  arkynApiUrl.replace(
101
101
  ":trafficSourceId",
102
- arkynInstance.arkynTrafficSourceId
102
+ arkynService.arkynTrafficSourceId
103
103
  ),
104
104
  {
105
105
  method: "POST",
package/src/index.ts CHANGED
@@ -1,7 +1,3 @@
1
- // config
2
- export { ApiInstance } from "./config/apiInstance";
3
- export { ArkynLogInstance } from "./config/arkynLogInstance";
4
-
5
1
  // http bad responses
6
2
  export { BadGateway } from "./http/badResponses/badGateway";
7
3
  export { BadRequest } from "./http/badResponses/badRequest";
@@ -21,6 +17,8 @@ export { Success } from "./http/successResponses/success";
21
17
  export { Updated } from "./http/successResponses/updated";
22
18
 
23
19
  // services
20
+ export { ApiService } from "./services/apiService";
21
+ export { ArkynLogService } from "./services/arkynLogService";
24
22
  export { decodeErrorMessageFromRequest } from "./services/decodeErrorMessageFromRequest";
25
23
  export { decodeRequestBody } from "./services/decodeRequestBody";
26
24
  export { errorHandler } from "./services/errorHandler";
@@ -4,7 +4,7 @@ import { patchRequest } from "../api/patchRequest";
4
4
  import { postRequest } from "../api/postRequest";
5
5
  import { putRequest } from "../api/putRequest";
6
6
 
7
- type ApiInstanceConstructorProps = {
7
+ type ApiServiceConstructorProps = {
8
8
  baseUrl: string;
9
9
  baseHeaders?: HeadersInit;
10
10
  baseToken?: string | null;
@@ -25,20 +25,20 @@ type ApiRequestDataWithBodyProps = {
25
25
  * Class representing an API instance to handle HTTP requests with base configurations.
26
26
  */
27
27
 
28
- class ApiInstance {
28
+ class ApiService {
29
29
  private baseUrl: string;
30
30
  private baseHeaders?: HeadersInit;
31
31
  private baseToken?: string;
32
32
 
33
33
  /**
34
- * Creates an instance of ApiInstance.
34
+ * Creates an instance of ApiService.
35
35
  * @param props - The configuration properties for the API instance.
36
36
  * @param props.baseUrl - The base URL for the API.
37
37
  * @param props.baseHeaders - Optional base headers to include in all requests.
38
38
  * @param props.baseToken - Optional base token for authorization.
39
39
  */
40
40
 
41
- constructor(props: ApiInstanceConstructorProps) {
41
+ constructor(props: ApiServiceConstructorProps) {
42
42
  this.baseUrl = props.baseUrl;
43
43
  this.baseHeaders = props.baseHeaders || undefined;
44
44
  this.baseToken = props.baseToken || undefined;
@@ -145,4 +145,4 @@ class ApiInstance {
145
145
  }
146
146
  }
147
147
 
148
- export { ApiInstance };
148
+ export { ApiService };
@@ -11,12 +11,12 @@ type SetArkynConfigProps = {
11
11
  };
12
12
 
13
13
  /**
14
- * The `ArkynLogInstance` class manages the configuration for the arkyn flow.
14
+ * The `ArkynLogService` class manages the configuration for the arkyn flow.
15
15
  * It allows you to set and retrieve the arkyn configuration, including the traffic source ID,
16
16
  * user token, and API URL.
17
17
  */
18
18
 
19
- class ArkynLogInstance {
19
+ class ArkynLogService {
20
20
  private static arkynConfig?: ArkynConfigProps;
21
21
 
22
22
  /**
@@ -48,7 +48,7 @@ class ArkynLogInstance {
48
48
  }
49
49
 
50
50
  /**
51
- * Retrieves the current arkyn configuration for the ArkynLogInstance.
51
+ * Retrieves the current arkyn configuration for the ArkynLogService.
52
52
  *
53
53
  * @returns {ArkynConfigProps | undefined} The current arkyn configuration if set,
54
54
  * or `undefined` if no configuration has been initialized.
@@ -67,4 +67,4 @@ class ArkynLogInstance {
67
67
  }
68
68
  }
69
69
 
70
- export { ArkynLogInstance };
70
+ export { ArkynLogService };
@@ -1 +0,0 @@
1
- {"version":3,"file":"arkynLogInstance.d.ts","sourceRoot":"","sources":["../../src/config/arkynLogInstance.ts"],"names":[],"mappings":"AAAA,KAAK,gBAAgB,GAAG;IACtB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,mBAAmB,GAAG;IACzB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF;;;;GAIG;AAEH,cAAM,gBAAgB;IACpB,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAmB;IAE9C;;;;;;;;;;OAUG;IAEH,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,mBAAmB;IAgBtD;;;;;OAKG;IACH,MAAM,CAAC,cAAc,IAAI,gBAAgB,GAAG,SAAS;IAIrD;;;OAGG;IAEH,MAAM,CAAC,gBAAgB;CAGxB;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}