@griddo/cx 11.10.5 → 11.10.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.
package/build/index.js CHANGED
@@ -345,6 +345,113 @@ var SEARCH = `${GRIDDO_API_URL2}/search`;
345
345
  var SETTINGS = `${GRIDDO_API_URL2}/settings`;
346
346
  var SITE_URI = `${GRIDDO_API_URL2}/site/`;
347
347
 
348
+ // package.json
349
+ var package_default = {
350
+ name: "@griddo/cx",
351
+ description: "Griddo SSG based on Gatsby",
352
+ version: "11.10.6",
353
+ authors: [
354
+ "Hisco <francis.vega@griddo.io>"
355
+ ],
356
+ license: "UNLICENSED",
357
+ homepage: "https://griddo.io",
358
+ repository: {
359
+ type: "git",
360
+ url: "https://github.com/griddo/griddo"
361
+ },
362
+ bin: {
363
+ "griddo-render": "cli.mjs"
364
+ },
365
+ exports: {
366
+ ".": {
367
+ import: "./build/index.js",
368
+ require: "./build/index.js",
369
+ types: "./build/index.d.ts"
370
+ },
371
+ "./react": {
372
+ import: "./build/react/index.js",
373
+ require: "./build/react/index.js",
374
+ types: "./build/react/index.d.ts"
375
+ }
376
+ },
377
+ scripts: {
378
+ "// NPM": "",
379
+ prepare: "yarn run build",
380
+ "// BUILD": "",
381
+ build: "rm -rf build && sh ./exporter/build.sh",
382
+ "build:debug": "rm -rf build && sh ./exporter/build.sh --debug",
383
+ "// TESTS": "",
384
+ test: "npm run test:compile && npm run test:create-render-fixtures && node --env-file=.env --test ./build/__tests__/* && npm run test:remove-render-fixtures",
385
+ "test-exporter": "npm run test:compile && node --env-file=.env --test ./build/__tests__exporter__/",
386
+ "test:create-render-fixtures": "node --env-file=.env ./build/__tests__/utils/create-fixtures",
387
+ "test:remove-render-fixtures": "node --env-file=.env ./build/__tests__/utils/remove-fixtures",
388
+ "test:compile": "tsgo --project tsconfig.tests.json",
389
+ "// INFRA SCRIPTS": "",
390
+ "prepare-domains-render": "node ./build/commands/prepare-domains-render",
391
+ "start-render": "node ./build/commands/start-render",
392
+ "end-render": "node ./build/commands/end-render",
393
+ "upload-search-content": "node ./build/commands/upload-search-content",
394
+ "reset-render": "node ./build/commands/reset-render",
395
+ "// ONLY LOCAL SCRIPTS": "",
396
+ "prepare-assets-directory": "node ./build/commands/prepare-assets-directory",
397
+ "create-rollback-copy": "rm -rf ../../exports-backup && cp -r ../../exports ../../exports-backup",
398
+ render: "npm run build && node --env-file=.env cli.mjs render --root=../..",
399
+ "// LINTER & FORMATTER": "",
400
+ lint: "biome check --write",
401
+ format: "biome format --write",
402
+ flint: "npm run lint && npm run format",
403
+ "ts-lint": "tsgo --noEmit",
404
+ "watch:ts-lint": "tsc --noEmit --watch"
405
+ },
406
+ dependencies: {
407
+ gatsby: "5.15.0",
408
+ "html-react-parser": "^5.2.10"
409
+ },
410
+ devDependencies: {
411
+ "@biomejs/biome": "2.3.4",
412
+ "@types/node": "20.19.4",
413
+ "@typescript/native-preview": "latest",
414
+ cheerio: "1.1.2",
415
+ esbuild: "0.25.12",
416
+ "p-limit": "7.2.0",
417
+ typescript: "5.9.3"
418
+ },
419
+ peerDependencies: {
420
+ "@griddo/core": "11.9.16",
421
+ react: ">=18 <19",
422
+ "react-dom": ">=18 <19"
423
+ },
424
+ engines: {
425
+ node: ">=20.19"
426
+ },
427
+ files: [
428
+ "build",
429
+ "exporter",
430
+ "src",
431
+ "gatsby-browser.tsx",
432
+ "gatsby-config.ts",
433
+ "gatsby-node.ts",
434
+ "gatsby-ssr.tsx",
435
+ "global.d.ts",
436
+ "tsconfig.commands.json",
437
+ "tsconfig.exporter.json",
438
+ "tsconfig.json",
439
+ "plugins",
440
+ "cli.mjs"
441
+ ],
442
+ publishConfig: {
443
+ access: "public"
444
+ },
445
+ gitHead: "dd1168a97e74dee06cdf9a3e668855a6b2cba906"
446
+ };
447
+
448
+ // exporter/shared/headers.ts
449
+ var DEFAULT_HEADERS = {
450
+ "x-application-id": "griddo-cx",
451
+ "x-client-version": package_default.version,
452
+ "x-client-name": "CX"
453
+ };
454
+
348
455
  // exporter/services/auth.ts
349
456
  var AuthService = class {
350
457
  headers;
@@ -352,7 +459,10 @@ var AuthService = class {
352
459
  try {
353
460
  const response = await fetch(LOGIN, {
354
461
  method: "POST",
355
- headers: { "Content-Type": "application/json", Connection: "close" },
462
+ headers: Object.assign({}, DEFAULT_HEADERS, {
463
+ "Content-Type": "application/json",
464
+ Connection: "close"
465
+ }),
356
466
  body: JSON.stringify({
357
467
  username: GRIDDO_BOT_USER,
358
468
  password: GRIDDO_BOT_PASSWORD
@@ -10,10 +10,9 @@ declare const SEARCH: string;
10
10
  declare const SETTINGS: string;
11
11
  declare const BUILD_END: string[];
12
12
  declare const BUILD_START: string[];
13
- declare const GET_PAGES: string[];
14
13
  declare const GET_REFERENCE_FIELD_DATA: string[];
15
14
  declare const GET_SITEMAP: string[];
16
15
  declare const INFO: string[];
17
16
  declare const LANGUAGES: string[];
18
17
  declare const SOCIALS: string[];
19
- export { AI_EMBEDDINGS, ALERT, BUILD_END, BUILD_START, DOMAINS, GET_ALL, GET_PAGE, GET_PAGES, GET_REFERENCE_FIELD_DATA, GET_SITEMAP, INFO, LANGUAGES, LOGIN, RESET_RENDER, ROBOTS, SEARCH, SETTINGS, SOCIALS, };
18
+ export { AI_EMBEDDINGS, ALERT, BUILD_END, BUILD_START, DOMAINS, GET_ALL, GET_PAGE, GET_REFERENCE_FIELD_DATA, GET_SITEMAP, INFO, LANGUAGES, LOGIN, RESET_RENDER, ROBOTS, SEARCH, SETTINGS, SOCIALS, };
@@ -0,0 +1,5 @@
1
+ export declare const DEFAULT_HEADERS: {
2
+ readonly "x-application-id": "griddo-cx";
3
+ readonly "x-client-version": string;
4
+ readonly "x-client-name": "CX";
5
+ };
@@ -16,6 +16,7 @@ import { RenderError } from "../core/errors";
16
16
  import { pathExists } from "../core/fs";
17
17
  import { GriddoLog } from "../core/GriddoLog";
18
18
  import { addLogToBuffer } from "../core/logger";
19
+ import { DEFAULT_HEADERS } from "../shared/headers";
19
20
  import { brush } from "../shared/npm-modules/brush";
20
21
  import { AuthService } from "./auth";
21
22
  import { getRenderPathsHydratedWithDomainFromDB } from "./render";
@@ -76,7 +77,10 @@ async function requestAPI<T extends APIResponses>(
76
77
  // Prepare fetch options
77
78
  const fetchOptions: RequestInit = {
78
79
  method: method.toUpperCase(),
79
- headers: Object.assign({}, headers, AuthService.headers) as Record<string, string>,
80
+ headers: Object.assign({}, DEFAULT_HEADERS, headers, AuthService.headers) as Record<
81
+ string,
82
+ string
83
+ >,
80
84
  };
81
85
 
82
86
  // Add body for non-GET requests
@@ -4,6 +4,7 @@ import { throwError } from "../core/errors";
4
4
  import { LOGIN } from "../shared/endpoints";
5
5
  import { GRIDDO_BOT_PASSWORD, GRIDDO_BOT_USER } from "../shared/envs";
6
6
  import { LoginError } from "../shared/errors";
7
+ import { DEFAULT_HEADERS } from "../shared/headers";
7
8
 
8
9
  class AuthService {
9
10
  headers: AuthHeaders | undefined;
@@ -12,7 +13,10 @@ class AuthService {
12
13
  try {
13
14
  const response = await fetch(LOGIN, {
14
15
  method: "POST",
15
- headers: { "Content-Type": "application/json", Connection: "close" },
16
+ headers: Object.assign({}, DEFAULT_HEADERS, {
17
+ "Content-Type": "application/json",
18
+ Connection: "close",
19
+ }),
16
20
  body: JSON.stringify({
17
21
  username: GRIDDO_BOT_USER,
18
22
  password: GRIDDO_BOT_PASSWORD,
@@ -16,7 +16,6 @@ const SETTINGS = `${GRIDDO_API_URL}/settings`;
16
16
  const SITE_URI = `${GRIDDO_API_URL}/site/`;
17
17
  const BUILD_END = [SITE_URI, "/build/end"];
18
18
  const BUILD_START = [SITE_URI, "/build/start"];
19
- const GET_PAGES = [SITE_URI, "/pages?pagination=false"];
20
19
  const GET_REFERENCE_FIELD_DATA = [SITE_URI, "/distributor"];
21
20
  const GET_SITEMAP = [SITE_URI, "/sitemap"];
22
21
  const INFO = [SITE_URI, "/all"];
@@ -31,7 +30,6 @@ export {
31
30
  DOMAINS,
32
31
  GET_ALL,
33
32
  GET_PAGE,
34
- GET_PAGES,
35
33
  GET_REFERENCE_FIELD_DATA,
36
34
  GET_SITEMAP,
37
35
  INFO,
@@ -0,0 +1,7 @@
1
+ import packageJson from "../../package.json";
2
+
3
+ export const DEFAULT_HEADERS = {
4
+ "x-application-id": "griddo-cx",
5
+ "x-client-version": packageJson.version,
6
+ "x-client-name": "CX",
7
+ } as const;
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.10.5",
4
+ "version": "11.10.6",
5
5
  "authors": [
6
6
  "Hisco <francis.vega@griddo.io>"
7
7
  ],
@@ -94,5 +94,5 @@
94
94
  "publishConfig": {
95
95
  "access": "public"
96
96
  },
97
- "gitHead": "c53ffb9d9d4890b4ef87a00decb31f178247779f"
97
+ "gitHead": "dd1168a97e74dee06cdf9a3e668855a6b2cba906"
98
98
  }