@griddo/cx 1.75.179 → 1.75.181

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 (72) hide show
  1. package/README.md +22 -14
  2. package/build/index.js +65 -0
  3. package/gatsby-browser.tsx +140 -0
  4. package/gatsby-config.ts +40 -0
  5. package/gatsby-node.ts +134 -0
  6. package/gatsby-ssr.tsx +63 -0
  7. package/index.js +4 -0
  8. package/package.json +119 -100
  9. package/scripts/build-reset.ts +9 -0
  10. package/scripts/griddo-exporter.ts +305 -0
  11. package/src/components/Head.tsx +207 -0
  12. package/src/components/template.tsx +90 -0
  13. package/src/components/types.ts +35 -0
  14. package/src/components/utils.ts +138 -0
  15. package/src/html.tsx +31 -0
  16. package/src/services/auth.ts +64 -0
  17. package/src/services/distributors.ts +153 -0
  18. package/src/services/domains.ts +27 -0
  19. package/src/services/navigation.ts +169 -0
  20. package/src/services/robots.ts +64 -0
  21. package/src/services/settings.ts +52 -0
  22. package/src/services/sites.ts +196 -0
  23. package/src/services/store-with-for-loop.ts +513 -0
  24. package/src/services/store-with-promise-all.ts +515 -0
  25. package/src/services/store.ts +513 -0
  26. package/src/types/api.ts +184 -0
  27. package/src/types/global.ts +64 -0
  28. package/src/types/navigation.ts +25 -0
  29. package/src/types/pages.ts +145 -0
  30. package/src/types/sites.ts +64 -0
  31. package/src/types/templates.ts +11 -0
  32. package/src/utils/api.ts +325 -0
  33. package/src/utils/cache.ts +114 -0
  34. package/src/utils/domains.ts +32 -0
  35. package/src/utils/folders.ts +147 -0
  36. package/src/utils/instance.ts +71 -0
  37. package/src/utils/pages.ts +534 -0
  38. package/src/utils/searches.ts +103 -0
  39. package/src/utils/shared.ts +155 -0
  40. package/src/utils/sites.ts +279 -0
  41. package/.babelrc +0 -7
  42. package/LICENSE +0 -1
  43. package/gatsby-browser.js +0 -115
  44. package/gatsby-config.js +0 -38
  45. package/gatsby-node.js +0 -273
  46. package/gatsby-ssr.js +0 -43
  47. package/scripts/griddo-exporter.js +0 -133
  48. package/src/api/index.js +0 -185
  49. package/src/components/template.js +0 -261
  50. package/src/html.js +0 -30
  51. package/src/images/readme.md +0 -1
  52. package/src/scripts/build-reset.js +0 -12
  53. package/src/services/auth.js +0 -44
  54. package/src/services/distributors.js +0 -85
  55. package/src/services/domains.js +0 -16
  56. package/src/services/navigation.js +0 -104
  57. package/src/services/robots.js +0 -37
  58. package/src/services/settings.js +0 -25
  59. package/src/services/sites.js +0 -110
  60. package/src/utils/cache.js +0 -70
  61. package/src/utils/component-lib-helpers.js +0 -56
  62. package/src/utils/dataLayer.js +0 -47
  63. package/src/utils/delay.js +0 -5
  64. package/src/utils/domains.js +0 -24
  65. package/src/utils/folders.js +0 -123
  66. package/src/utils/helpers.js +0 -144
  67. package/src/utils/index.js +0 -44
  68. package/src/utils/package.js +0 -20
  69. package/src/utils/pages.js +0 -236
  70. package/src/utils/searches.js +0 -62
  71. package/src/utils/sites.js +0 -207
  72. package/static/griddo-full-logo.png +0 -0
@@ -0,0 +1,64 @@
1
+ // Types
2
+ import type { Core, Fields } from "@griddo/core";
3
+ import type { EndSiteRenderBody } from "./api";
4
+
5
+ export type StoreMode = "memory" | "file";
6
+
7
+ export interface Settings {
8
+ apiVersion?: string;
9
+ avoidCanonicalsOnSitemaps?: boolean;
10
+ avoidDebugMetas?: boolean;
11
+ avoidHrefLangsOnCanonicals?: boolean;
12
+ avoidHrefLangXDefault?: boolean;
13
+ avoidSelfReferenceCanonicals?: boolean;
14
+ cloudinaryName?: string;
15
+ forceMenuLinksLanguage?: boolean;
16
+ globalLogoBig?: string;
17
+ globalLogoMini?: string;
18
+ lastDBCheckVersion?: string;
19
+ schemasTimestamp?: string;
20
+ schemasVersion?: string;
21
+ showBasicMetaRobots?: boolean;
22
+ siteLogoBig?: string;
23
+ siteLogoMini?: string;
24
+ skipReviewOnPublish?: boolean;
25
+ useMetaTitle?: boolean;
26
+ welcomeText1?: string;
27
+ welcomeText2?: string;
28
+ }
29
+
30
+ /** ??? */
31
+ export type Petition = Record<string, unknown>;
32
+
33
+ export interface PostSearchInfoProps {
34
+ title?: string;
35
+ description: string;
36
+ image: string;
37
+ pageId?: number;
38
+ siteId: number;
39
+ content: string;
40
+ languageId?: number;
41
+ template?: string | null | number;
42
+ url?: string;
43
+ }
44
+
45
+ export interface FetchDataProps {
46
+ page: Core.Page;
47
+ component: {
48
+ data: Fields.Reference<unknown>;
49
+ };
50
+ cached: boolean;
51
+ }
52
+
53
+ export type Domains = Array<{
54
+ id: number;
55
+ slug: string;
56
+ url: string;
57
+ }>;
58
+
59
+ /** Describes the type of build process data object. */
60
+ export type BuildProcessData = Record<string, EndSiteRenderBody>;
61
+
62
+ export type Robot = { path: string; content: string };
63
+
64
+ export type Robots = Array<Robot>;
@@ -0,0 +1,25 @@
1
+ /** Describes a Griddo Header */
2
+ export type Header = {
3
+ component: "Header";
4
+ id: number;
5
+ isDefault: boolean;
6
+ language: number;
7
+ navigationLanguages: Array<{ navigationId: number }>;
8
+ setAsDefault: boolean;
9
+ theme: null | string;
10
+ title: string;
11
+ type: "header";
12
+ };
13
+
14
+ /** Describes a Griddo Footer */
15
+ export type Footer = {
16
+ component: "Footer";
17
+ id: number;
18
+ isDefault: boolean;
19
+ language: number;
20
+ navigationLanguages: Array<{ navigationId: number }>;
21
+ setAsDefault: boolean;
22
+ theme: null | string;
23
+ title: string;
24
+ type: "header";
25
+ };
@@ -0,0 +1,145 @@
1
+ // Types
2
+ import type { Core, Fields } from "@griddo/core";
3
+ import type { SocialsResponse } from "./api";
4
+ import type { Settings } from "./global";
5
+ import type { Site } from "./sites";
6
+
7
+ // TODO: In @griddo/core the type Core.Page has header/footer as React-Types,
8
+ // but API return `number | null`.
9
+ export type APIPageObject = Core.Page & {
10
+ header: number | null;
11
+ footer: number | null;
12
+ };
13
+
14
+ export type CleanPage = Core.Page & {
15
+ isRoot: boolean;
16
+ defaultLang?: Core.SiteLanguage | undefined;
17
+ };
18
+
19
+ export type RenderPage = Core.Page & {
20
+ isRoot?: boolean;
21
+ multiPageElements: MultiPageElements;
22
+ defaultLang?: Core.SiteLanguage;
23
+ header: number;
24
+ footer: number;
25
+ //
26
+ id: number;
27
+ path: string;
28
+ component: "Page";
29
+ template_id: string;
30
+ mode: "list";
31
+ };
32
+
33
+ export type GriddoSinglePage = Core.Page & {
34
+ defaultLang?: Core.SiteLanguage;
35
+ };
36
+
37
+ export type GriddoListPage = Core.Page & {
38
+ page: APIPageObject;
39
+ pages: Array<Array<Fields.QueriedDataItem>>;
40
+ isRoot?: boolean;
41
+ defaultLang?: Core.SiteLanguage;
42
+ template: {
43
+ [key: string]: any;
44
+ type: "template";
45
+ templateType: string;
46
+ activeSectionSlug: string;
47
+ activeSectionBase: string;
48
+ };
49
+ totalQueriedItems: Array<Fields.QueriedDataItem>;
50
+ };
51
+
52
+ export type GriddoMultiPage = Core.Page & {
53
+ header: number | null;
54
+ footer: number | null;
55
+ isRoot?: boolean;
56
+ multiPageElements: MultiPageElements;
57
+ defaultLang?: Core.SiteLanguage | undefined;
58
+ };
59
+
60
+ export interface AdditionalInfo {
61
+ baseUrl: string;
62
+ BUILD_MODE?: string;
63
+ cloudinaryName?: string;
64
+ griddoVersion: string;
65
+ instance?: string;
66
+ publicBaseUrl: string;
67
+ siteLangs: Array<Core.SiteLanguage>;
68
+ siteMetadata: Site["siteMetadata"];
69
+ siteSlug: string;
70
+ socials: SocialsResponse;
71
+ siteOptions: Pick<
72
+ Settings,
73
+ | "useMetaTitle"
74
+ | "showBasicMetaRobots"
75
+ | "avoidHrefLangsOnCanonicals"
76
+ | "avoidSelfReferenceCanonicals"
77
+ | "avoidHrefLangXDefault"
78
+ | "avoidDebugMetas"
79
+ >;
80
+ siteScript: string;
81
+ theme: string;
82
+ }
83
+
84
+ export interface PageAdditionalInfo extends AdditionalInfo {
85
+ navigations: {
86
+ header: Record<string, unknown> | null;
87
+ footer: Record<string, unknown> | null;
88
+ };
89
+ }
90
+
91
+ export type GatsbyPageObject = {
92
+ matchPath?: string;
93
+ path: string;
94
+ component: string;
95
+ /** Page size in bytes */
96
+ size: number;
97
+ context: {
98
+ // Page
99
+ BUILD_MODE?: string;
100
+ cloudinaryName?: string;
101
+ footer: Record<string, unknown> | null;
102
+ fullPath: Core.Page["fullPath"];
103
+ griddoVersion: string;
104
+ header: Record<string, unknown> | null;
105
+ id?: number;
106
+ languageId: number;
107
+ locale?: string;
108
+ openGraph: {
109
+ description?: string;
110
+ image?: string | null;
111
+ title?: string;
112
+ twitterImage?: string | null;
113
+ type: "website";
114
+ };
115
+ pageMetadata: {
116
+ canonical?: string | undefined;
117
+ description?: string;
118
+ follow?: "follow" | "nofollow";
119
+ index: "index" | "noindex";
120
+ locale?: string;
121
+ metasAdvanced?: string;
122
+ pageLanguages?: Core.Page["pageLanguages"];
123
+ title?: string;
124
+ translate?: "notranslate" | "";
125
+ url?: string;
126
+ };
127
+ siteMetadata: Site["siteMetadata"];
128
+ theme: string;
129
+ title: string;
130
+ siteLangs: Array<Core.SiteLanguage>;
131
+ siteOptions: AdditionalInfo["siteOptions"];
132
+ siteScript: string;
133
+ socials: SocialsResponse;
134
+ };
135
+ };
136
+
137
+ export type MultiPageElements = Array<{
138
+ component: string;
139
+ title: string | Required<Fields.Heading>;
140
+ elements: Array<Record<string, unknown>>;
141
+ componentModules: Array<Record<string, unknown>>;
142
+ sectionSlug: string;
143
+ metaTitle: string;
144
+ metaDescription: string;
145
+ }>;
@@ -0,0 +1,64 @@
1
+ // Types
2
+ import type { Core } from "@griddo/core";
3
+ import type { AllPagesResponse, SocialsResponse } from "./api";
4
+ import type { Footer, Header } from "./navigation";
5
+
6
+ /**
7
+ * Describe a Griddo site object from API.
8
+ * This takes some type props from Core.Site which is a Site for the Gatsby template.tsx.
9
+ */
10
+ export interface Site
11
+ extends Required<
12
+ Pick<
13
+ Core.Site,
14
+ | "bigAvatar"
15
+ | "favicon"
16
+ | "home"
17
+ | "id"
18
+ | "isPublished"
19
+ | "timezone"
20
+ | "thumbnail"
21
+ | "theme"
22
+ | "socials"
23
+ | "slug"
24
+ | "smallAvatar"
25
+ | "modified"
26
+ | "name"
27
+ | "siteMetadata"
28
+ >
29
+ > {
30
+ author: string;
31
+ deleted: number;
32
+ domains: Array<Record<string, string>>;
33
+ footers: Array<Footer>;
34
+ hash: string | null;
35
+ headers: Array<Header>;
36
+ languages: Array<Core.SiteLanguage>; // in Core is Array<number>
37
+ languageSites: Array<number>;
38
+ navigationModules: { header?: string; footer?: string } | null;
39
+ pages: Array<number>;
40
+ published: string;
41
+ rendering: boolean;
42
+ renderingHours: number;
43
+ shouldBeUpdated: boolean;
44
+ siteScript: string;
45
+ smallAvatar: string;
46
+ updated: boolean;
47
+ }
48
+
49
+ export interface SiteData {
50
+ siteInfo: Site;
51
+ validPagesIds: number[];
52
+ siteHash: string | null;
53
+ unpublishHashes: string[];
54
+ siteLangs: Array<Core.SiteLanguage>;
55
+ defaultLang: Core.SiteLanguage | undefined;
56
+ headers: Array<Header>;
57
+ footers: Array<Footer>;
58
+ socials: SocialsResponse;
59
+ sitePages: AllPagesResponse;
60
+ }
61
+
62
+ export type SiteHash = string | null;
63
+
64
+ export type HashSites = Record<string, number | string>;
@@ -0,0 +1,11 @@
1
+ // Types
2
+ import type { Core, Fields } from "@griddo/core";
3
+
4
+ /** Describe a template object from a Griddo Page */
5
+ export type Template = Core.Page["template"];
6
+
7
+ /** Describes a template with distributor data */
8
+ export type TemplateWithDistributor = Template & {
9
+ queriedItems?: Fields.QueriedData<unknown>;
10
+ itemsPerPage?: number;
11
+ };
@@ -0,0 +1,325 @@
1
+ // Types
2
+ import type {
3
+ APIResponses,
4
+ Error,
5
+ GetAPI,
6
+ PostAPI,
7
+ PutAPI,
8
+ } from "../types/api";
9
+
10
+ // External libraries
11
+ import axios from "axios";
12
+ import chalk from "chalk";
13
+ import dotenv from "dotenv";
14
+
15
+ // Services
16
+ import { AuthService } from "../services/auth";
17
+
18
+ // Utils
19
+ import { getCache, saveCache } from "./cache";
20
+ import { delay, getSafeSiteId, logInfo, msToSec } from "./shared";
21
+
22
+ dotenv.config();
23
+
24
+ // Envs
25
+ const {
26
+ env: { RETRY_WAIT_SECONDS = "4", RETRY_ATTEMPTS = "1" },
27
+ } = process;
28
+
29
+ /**
30
+ * Make a GET request to the Griddo API.
31
+ *
32
+ * @template T Response Type returned.
33
+ * @returns {Promise<T>} A promise that is resolved with the data from the API response.
34
+ * @todo Maybe remove the loggin responsability
35
+ * @example
36
+ * const response = await get<Site>({
37
+ * endpoint: "...",
38
+ * cached: true,
39
+ * });
40
+ */
41
+ async function getApi<T extends APIResponses>(props: GetAPI): Promise<T> {
42
+ const { endpoint, body, cached, attempt } = props;
43
+ const cacheOptions = { endpoint, body, cached };
44
+
45
+ // Start a timer
46
+ const start = new Date();
47
+
48
+ // Filesystem
49
+ if (cached) {
50
+ const cachedResponse = getCache<T>(cacheOptions);
51
+
52
+ if (cachedResponse) {
53
+ const duration = msToSec(new Date().getTime() - start.getTime());
54
+ const siteId = getSafeSiteId(cachedResponse);
55
+ const siteIdMsg = siteId ? `site: ${siteId} ` : "";
56
+
57
+ logInfo(`GET (cache) ${siteIdMsg}${endpoint} - ${duration}s`);
58
+
59
+ return cachedResponse;
60
+ }
61
+ }
62
+
63
+ // Network API
64
+ try {
65
+ // Success. Connection stablished.
66
+ const { data }: { data: T } = await axios({
67
+ url: endpoint,
68
+ method: "get",
69
+ headers: { ...AuthService.headers },
70
+ data: body,
71
+ });
72
+
73
+ const duration = msToSec(new Date().getTime() - start.getTime());
74
+ const siteId = getSafeSiteId(data);
75
+ const siteIdMsg = siteId ? `site: ${siteId} ` : "";
76
+
77
+ logInfo(`GET (fetch) ${siteIdMsg}${endpoint} - ${duration}s`);
78
+
79
+ // Save page object into filesystem
80
+ saveCache(cacheOptions, data);
81
+
82
+ // Return page object from API
83
+ return data;
84
+ } catch (e) {
85
+ // Failure. Network error
86
+ const error = e as Error;
87
+ showApiError(
88
+ error,
89
+ { endpoint, body, attempt },
90
+ error.response.status !== 404
91
+ );
92
+
93
+ if (error.response.status === 404) {
94
+ // @ts-expect-error
95
+ return null;
96
+ }
97
+
98
+ // Try again `RETRY_ATTEMPTS` times
99
+ if (attempt && attempt < parseInt(RETRY_ATTEMPTS)) {
100
+ console.warn("Waiting for retry: GET", endpoint);
101
+ await delay(parseInt(RETRY_WAIT_SECONDS) * 1000);
102
+
103
+ // Lets try again!
104
+ return getApi({ endpoint, body, cached, attempt: attempt + 1 });
105
+ } else {
106
+ throw new Error("Error in getApi()");
107
+ }
108
+ }
109
+ }
110
+
111
+ /**
112
+ * Make a PUT request to the Griddo API.
113
+ *
114
+ * @template T Response Type returned.
115
+ * @returns {Promise<T>} A promise that is resolved with the data from the API response.
116
+ */
117
+ async function putApi<T extends APIResponses>(props: PutAPI): Promise<T> {
118
+ const { endpoint, body, cached = false, attempt = 0 } = props;
119
+ const cacheOptions = { endpoint, body, cached };
120
+
121
+ // Start a timer
122
+ const start = new Date();
123
+
124
+ // Filesystem
125
+ if (cached) {
126
+ const cachedResponse = getCache<T>(cacheOptions);
127
+
128
+ if (cachedResponse) {
129
+ const duration = msToSec(new Date().getTime() - start.getTime());
130
+
131
+ logInfo(`PUT (cache) ${endpoint} - ${duration}s`);
132
+
133
+ return cachedResponse;
134
+ }
135
+ }
136
+
137
+ // Network API
138
+ try {
139
+ const { data }: { data: T } = await axios({
140
+ url: endpoint,
141
+ method: "put",
142
+ headers: { ...AuthService.headers },
143
+ data: body,
144
+ });
145
+
146
+ const duration = msToSec(new Date().getTime() - start.getTime());
147
+
148
+ logInfo(`PUT (fetch) ${endpoint} - ${duration}s`);
149
+
150
+ // Save page object to filesystem
151
+ saveCache(cacheOptions, data);
152
+
153
+ // Return page object from API
154
+ return data;
155
+ } catch (e) {
156
+ // Failure. Network error
157
+ const error = e as Error;
158
+ showApiError(
159
+ error,
160
+ { endpoint, body, attempt },
161
+ error.response.status !== 404
162
+ );
163
+
164
+ if (error.response.status === 404) {
165
+ // @ts-expect-error
166
+ return null;
167
+ }
168
+
169
+ // Try again `RETRY_ATTEMPTS` times
170
+ if (attempt < parseInt(RETRY_ATTEMPTS)) {
171
+ console.warn("Waiting for retry: PUT", endpoint);
172
+ await delay(parseInt(RETRY_WAIT_SECONDS) * 1000);
173
+
174
+ // Lets try again!
175
+ return putApi({ endpoint, body, cached, attempt: attempt + 1 });
176
+ } else {
177
+ throw new Error("Error in putApi()");
178
+ }
179
+ }
180
+ }
181
+
182
+ /**
183
+ * Make a POST request to the Griddo API.
184
+ *
185
+ * @template T Response Type returned.
186
+ * @returns {Promise<T>} A promise that is resolved with the data from the API response.
187
+ */
188
+ async function postApi<T extends APIResponses>(props: PostAPI): Promise<T> {
189
+ const { endpoint, body, headers, cached, attempt = 0 } = props;
190
+
191
+ const cacheOptions = { endpoint, body, headers, cached };
192
+
193
+ // Start a timer
194
+ const start = new Date();
195
+ const distributorBodyParams = endpoint.endsWith("/distributor")
196
+ ? `# Distributor body: ${JSON.stringify(body)} - lang: ${JSON.stringify(
197
+ headers?.lang
198
+ )}`
199
+ : "";
200
+
201
+ // Filesystem
202
+ if (cached) {
203
+ const cachedResponse = getCache<T>(cacheOptions);
204
+
205
+ if (cachedResponse) {
206
+ const duration = msToSec(new Date().getTime() - start.getTime());
207
+
208
+ logInfo(
209
+ `POST (cache) ${endpoint} - ${duration}s ${distributorBodyParams}`
210
+ );
211
+
212
+ return cachedResponse;
213
+ }
214
+ }
215
+
216
+ // Network API
217
+ try {
218
+ // Success. Connection stablished.
219
+ const { data }: { data: T } = await axios({
220
+ url: endpoint,
221
+ method: "post",
222
+ headers: { ...headers, ...AuthService.headers },
223
+ data: body,
224
+ });
225
+
226
+ const duration = msToSec(new Date().getTime() - start.getTime());
227
+
228
+ logInfo(`POST (fetch) ${endpoint} - ${duration}s`);
229
+
230
+ // Save page object to filesystem
231
+ saveCache(cacheOptions, data);
232
+
233
+ // Return page object from API
234
+ return data;
235
+ } catch (e) {
236
+ // Failure. Network error
237
+ const error = e as Error;
238
+ showApiError(
239
+ error,
240
+ { endpoint, body, headers, attempt },
241
+ error.response.status !== 404
242
+ );
243
+
244
+ if (error.response.status === 404) {
245
+ // @ts-expect-error
246
+ return null;
247
+ }
248
+
249
+ // Try again `RETRY_ATTEMPTS` times
250
+ if (attempt < parseInt(RETRY_ATTEMPTS)) {
251
+ console.warn("Waiting for retry: POST", endpoint);
252
+ await delay(parseInt(RETRY_WAIT_SECONDS) * 1000);
253
+
254
+ // Lets try again!
255
+ return postApi({ endpoint, body, headers, cached, attempt: attempt + 1 });
256
+ } else {
257
+ throw new Error("Error in postApi()");
258
+ }
259
+ }
260
+ }
261
+
262
+ /**
263
+ * Shows an API error through the terminal.
264
+ */
265
+ function showApiError(
266
+ error: Error,
267
+ callInfo: {
268
+ endpoint?: string;
269
+ // TODO: Remove any's
270
+ body?: any;
271
+ headers?: any;
272
+ attempt?: number;
273
+ } = {},
274
+ breakProcess = true
275
+ ) {
276
+ const { response, message, stack } = error;
277
+ const { status, statusText, data } = response || {};
278
+ const callInfoArray = [];
279
+
280
+ for (const item of Object.keys(callInfo)) {
281
+ const itemCasted = item as keyof typeof callInfo;
282
+ callInfoArray.push(
283
+ `${item}: ${
284
+ typeof callInfo[itemCasted] === "object"
285
+ ? JSON.stringify(callInfo[itemCasted])
286
+ : callInfo[itemCasted]
287
+ }`
288
+ );
289
+ }
290
+
291
+ // Compose the errors output
292
+ const callInfoStr = callInfoArray.join("\n");
293
+ const apiResponseStr = response
294
+ ? `Code: ${status} - ${statusText}\nResponse: ${JSON.stringify(data)}`
295
+ : "";
296
+ const errorDetailsStr = `${message}\n${stack}`;
297
+
298
+ // Print the error
299
+ console.warn(
300
+ chalk.bold.red(`
301
+ =============
302
+
303
+ { Call info }
304
+ ${callInfoStr}
305
+
306
+ { API Response }
307
+ ${apiResponseStr}
308
+
309
+ { Error details }
310
+ ${errorDetailsStr}
311
+
312
+ =============
313
+ `)
314
+ );
315
+
316
+ if (
317
+ breakProcess &&
318
+ (typeof callInfo?.attempt !== "number" ||
319
+ callInfo.attempt >= parseInt(RETRY_ATTEMPTS))
320
+ ) {
321
+ process.exit(1);
322
+ }
323
+ }
324
+
325
+ export { getApi as get, putApi as put, postApi as post };