@griddo/cx 11.0.1 → 11.0.3

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.
@@ -24,15 +24,15 @@ export const ArtifactError: ErrorData = {
24
24
  error: "ArtifactError",
25
25
  message: "There was a problem with an artifact",
26
26
  expected:
27
- "Some external process has modified or deleted one of the artifacts (files and directories).",
28
- hint: "Have there been any recent deployments? This can delete directories from the current render.",
27
+ "An external process may have has modified or deleted one of the artifacts (files and directories).",
28
+ hint: "Have there been any recent deployments? These can delete directories from the current render.",
29
29
  };
30
30
 
31
31
  export const NoJSConfigFileFound: ErrorData = {
32
32
  error: "NoJSConfigFileFound",
33
33
  message: "Could not find jsconfig.json or tsconfig.json",
34
34
  expected:
35
- "This can happen if the instance is not properly configured a jsconfig.json or tsconfig.json file.",
35
+ "This can happen if the instance is not properly configured with a jsconfig.json or tsconfig.json file.",
36
36
  };
37
37
 
38
38
  export const LifecycleExecutionError = (
@@ -47,38 +47,39 @@ export const ErrorInSSGBuildProcess = (
47
47
  command: SpawnSyncReturns<string>,
48
48
  ): ErrorData => ({
49
49
  error: "ErrorInSSGBuildProcess",
50
- message: `Error in SSG build process ${JSON.stringify(command)}`,
50
+ message: `Error in SSG build process: ${JSON.stringify(command)}`,
51
51
  expected:
52
- "This can happen if there were a problem with the SSG build process.",
52
+ "This can happen if there was a problem with the SSG build process.",
53
53
  });
54
54
 
55
55
  export const NoDomainsFoundError: ErrorData = {
56
56
  error: "NoDomainsFoundError",
57
- message: "No domains found in this instance. The process cannot continue.",
57
+ message:
58
+ "No domains were found in this instance. The process cannot continue.",
58
59
  expected:
59
- "This can happen if the API is not functioning or the site is not properly configured, or the domains are not registered.",
60
+ "This may happen if the API is not functioning, or the site is not properly configured, or the domains are not registered.",
60
61
  hint: "You can contact the instance administrator.",
61
62
  };
62
63
 
63
64
  export const RenderUUIDError: ErrorData = {
64
65
  error: "RenderUUIDError",
65
66
  message: `Render sentinel file does not exist.
66
- The rendering uuid cannot be read safely.
67
- There was probably a instance deployment during the render and files were deleted.
67
+ The rendering UUID cannot be read safely.
68
+ There was probably an instance deployment during the render, and files were deleted.
68
69
 
69
70
  The files generated in this render will not be published.`,
70
71
  };
71
72
 
72
73
  export const ReferenceFieldSourcesNotFoundError: ErrorData = {
73
74
  error: "ReferenceFieldSourcesNotFoundError",
74
- message: "The distributor has not sources defined.",
75
+ message: "The distributor has no sources defined.",
75
76
  expected:
76
77
  "It is expected to have at least one data source in the `sources` property, even if it is empty.",
77
78
  };
78
79
 
79
80
  export const LoginError: ErrorData = {
80
81
  error: "LoginError",
81
- message: "There where a problem login in the API",
82
+ message: "There was a problem logging in to the API",
82
83
  expected:
83
- "This happend if the API is currently not working or the credentials are not correct.",
84
+ "This happens if the API is currently not working or the credentials are incorrect.",
84
85
  };
@@ -3,7 +3,6 @@ import type { AuthHeaders } from "../types/api";
3
3
  import { endpoints, envs } from "../constants";
4
4
  import { throwError } from "../errors";
5
5
  import { LoginError } from "../errors/errors-data";
6
- import { boxLog } from "../utils/loggin";
7
6
 
8
7
  /**
9
8
  * Service for authentication in the Griddo Private API
@@ -22,25 +21,18 @@ class AuthService {
22
21
  }),
23
22
  });
24
23
 
25
- if (response.ok) {
26
- const { token } = await response.json();
27
- this.headers = {
28
- Authorization: `bearer ${token}`,
29
- "Cache-Control": "no-store",
30
- };
31
- return this.headers;
24
+ if (!response.ok) {
25
+ throw new Error("Error while login in the API");
32
26
  }
33
27
 
34
- throw new Error("Error while login");
35
- } catch (e) {
36
- boxLog(
37
- `Access failure.
38
- You may want to review your .env file credentials.`,
39
- "Error",
40
- 1,
41
- 0,
42
- );
28
+ const { token } = await response.json();
29
+ this.headers = {
30
+ Authorization: `bearer ${token}`,
31
+ "Cache-Control": "no-store",
32
+ };
43
33
 
34
+ return this.headers;
35
+ } catch (e) {
44
36
  throwError(LoginError, e);
45
37
  }
46
38
  }
@@ -208,7 +208,7 @@ async function getReferenceFieldData({
208
208
 
209
209
  return response;
210
210
  } catch (err) {
211
- console.error(`Error en get ReferenceFieldData ${err}`);
211
+ console.error(`Error in getReferenceFieldData ${err}`);
212
212
 
213
213
  process.exit(1);
214
214
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@griddo/cx",
3
3
  "description": "Griddo SSG based on Gatsby",
4
- "version": "11.0.1",
4
+ "version": "11.0.3",
5
5
  "authors": [
6
6
  "Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
7
7
  "Diego M. Béjar <diego.bejar@secuoyas.com>",
@@ -60,7 +60,7 @@
60
60
  "@babel/preset-env": "7.24.7",
61
61
  "@babel/preset-react": "7.24.7",
62
62
  "@babel/preset-typescript": "7.24.7",
63
- "@griddo/core": "11.0.1",
63
+ "@griddo/core": "11.0.3",
64
64
  "@svgr/webpack": "8.1.0",
65
65
  "axios": "^1.7.4",
66
66
  "babel-loader": "9.1.3",
@@ -127,5 +127,5 @@
127
127
  "publishConfig": {
128
128
  "access": "public"
129
129
  },
130
- "gitHead": "af8ad67ec86fe5dfb587c6885bcbd7988adc74e9"
130
+ "gitHead": "1e3bef9685dbb10446cd30bbce54813c641190b9"
131
131
  }