gt-next 6.8.3 → 6.9.1

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 (123) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/config-dir/props/defaultWithGTConfigProps.d.ts +2 -0
  3. package/dist/config-dir/props/defaultWithGTConfigProps.d.ts.map +1 -1
  4. package/dist/config-dir/props/defaultWithGTConfigProps.js +2 -0
  5. package/dist/config-dir/props/defaultWithGTConfigProps.js.map +1 -1
  6. package/dist/config-dir/props/withGTConfigProps.d.ts +12 -2
  7. package/dist/config-dir/props/withGTConfigProps.d.ts.map +1 -1
  8. package/dist/config-dir/props/withGTConfigProps.js +9 -0
  9. package/dist/config-dir/props/withGTConfigProps.js.map +1 -1
  10. package/dist/config-dir/utils/resolveConfigFilepath.d.ts +9 -0
  11. package/dist/config-dir/utils/resolveConfigFilepath.d.ts.map +1 -0
  12. package/dist/config-dir/utils/resolveConfigFilepath.js +49 -0
  13. package/dist/config-dir/utils/resolveConfigFilepath.js.map +1 -0
  14. package/dist/config-dir/utils/resolveRequestFunctionPaths.d.ts +19 -0
  15. package/dist/config-dir/utils/resolveRequestFunctionPaths.d.ts.map +1 -0
  16. package/dist/config-dir/utils/resolveRequestFunctionPaths.js +44 -0
  17. package/dist/config-dir/utils/resolveRequestFunctionPaths.js.map +1 -0
  18. package/dist/config-dir/{validateCompiler.d.ts → utils/validateCompiler.d.ts} +1 -1
  19. package/dist/config-dir/utils/validateCompiler.d.ts.map +1 -0
  20. package/dist/config-dir/{validateCompiler.js → utils/validateCompiler.js} +3 -3
  21. package/dist/config-dir/utils/validateCompiler.js.map +1 -0
  22. package/dist/config.d.ts +6 -0
  23. package/dist/config.d.ts.map +1 -1
  24. package/dist/config.js +64 -79
  25. package/dist/config.js.map +1 -1
  26. package/dist/errors/createErrors.d.ts +0 -1
  27. package/dist/errors/createErrors.d.ts.map +1 -1
  28. package/dist/errors/createErrors.js +1 -3
  29. package/dist/errors/createErrors.js.map +1 -1
  30. package/dist/errors/index.d.ts +3 -0
  31. package/dist/errors/index.d.ts.map +1 -0
  32. package/dist/errors/index.js +19 -0
  33. package/dist/errors/index.js.map +1 -0
  34. package/dist/errors/ssg.d.ts +11 -0
  35. package/dist/errors/ssg.d.ts.map +1 -0
  36. package/dist/errors/ssg.js +32 -0
  37. package/dist/errors/ssg.js.map +1 -0
  38. package/dist/internal/_getDomain.d.ts +3 -0
  39. package/dist/internal/_getDomain.d.ts.map +1 -0
  40. package/dist/internal/_getDomain.js +53 -0
  41. package/dist/internal/_getDomain.js.map +1 -0
  42. package/dist/internal/_getLocale.d.ts +3 -0
  43. package/dist/internal/_getLocale.d.ts.map +1 -0
  44. package/dist/internal/_getLocale.js +53 -0
  45. package/dist/internal/_getLocale.js.map +1 -0
  46. package/dist/internal/_getRegion.d.ts +3 -0
  47. package/dist/internal/_getRegion.d.ts.map +1 -0
  48. package/dist/internal/_getRegion.js +53 -0
  49. package/dist/internal/_getRegion.js.map +1 -0
  50. package/dist/internal/static/_getDomain.d.ts +3 -0
  51. package/dist/internal/static/_getDomain.d.ts.map +1 -0
  52. package/dist/internal/static/_getDomain.js +47 -0
  53. package/dist/internal/static/_getDomain.js.map +1 -0
  54. package/dist/internal/static/_getLocale.d.ts +3 -0
  55. package/dist/internal/static/_getLocale.d.ts.map +1 -0
  56. package/dist/internal/static/_getLocale.js +47 -0
  57. package/dist/internal/static/_getLocale.js.map +1 -0
  58. package/dist/internal/static/_getRegion.d.ts +3 -0
  59. package/dist/internal/static/_getRegion.d.ts.map +1 -0
  60. package/dist/internal/static/_getRegion.js +47 -0
  61. package/dist/internal/static/_getRegion.js.map +1 -0
  62. package/dist/middleware-dir/createNextMiddleware.d.ts.map +1 -1
  63. package/dist/middleware-dir/createNextMiddleware.js.map +1 -1
  64. package/dist/middleware-dir/utils.d.ts.map +1 -1
  65. package/dist/middleware-dir/utils.js +4 -4
  66. package/dist/middleware-dir/utils.js.map +1 -1
  67. package/dist/plugin/constants.d.ts +6 -0
  68. package/dist/plugin/constants.d.ts.map +1 -1
  69. package/dist/plugin/constants.js +7 -1
  70. package/dist/plugin/constants.js.map +1 -1
  71. package/dist/plugin/getStableNextVersionInfo.d.ts +4 -0
  72. package/dist/plugin/getStableNextVersionInfo.d.ts.map +1 -1
  73. package/dist/plugin/getStableNextVersionInfo.js +3 -9
  74. package/dist/plugin/getStableNextVersionInfo.js.map +1 -1
  75. package/dist/request/getLocale.d.ts.map +1 -1
  76. package/dist/request/getLocale.js +31 -48
  77. package/dist/request/getLocale.js.map +1 -1
  78. package/dist/request/getLocaleDirection.d.ts.map +1 -1
  79. package/dist/request/getLocaleDirection.js.map +1 -1
  80. package/dist/request/getRegion.d.ts.map +1 -1
  81. package/dist/request/getRegion.js +28 -11
  82. package/dist/request/getRegion.js.map +1 -1
  83. package/dist/{next → request/headers}/getNextDomain.d.ts +4 -3
  84. package/dist/request/headers/getNextDomain.d.ts.map +1 -0
  85. package/dist/{next → request/headers}/getNextDomain.js +3 -3
  86. package/dist/request/headers/getNextDomain.js.map +1 -0
  87. package/dist/{next → request/headers}/getNextLocale.d.ts +2 -1
  88. package/dist/request/headers/getNextLocale.d.ts.map +1 -0
  89. package/dist/request/headers/getNextLocale.js +96 -0
  90. package/dist/request/headers/getNextLocale.js.map +1 -0
  91. package/dist/request/headers/getNextRegion.d.ts +3 -0
  92. package/dist/request/headers/getNextRegion.d.ts.map +1 -0
  93. package/dist/{next → request/headers}/getNextRegion.js +0 -1
  94. package/dist/request/headers/getNextRegion.js.map +1 -0
  95. package/dist/request/types.d.ts +9 -0
  96. package/dist/request/types.d.ts.map +1 -0
  97. package/dist/request/types.js +14 -0
  98. package/dist/request/types.js.map +1 -0
  99. package/dist/request/utils/getRequestFunction.d.ts +10 -0
  100. package/dist/request/utils/getRequestFunction.d.ts.map +1 -0
  101. package/dist/request/utils/getRequestFunction.js +269 -0
  102. package/dist/request/utils/getRequestFunction.js.map +1 -0
  103. package/dist/request/utils/isSSR.d.ts +2 -0
  104. package/dist/request/utils/isSSR.d.ts.map +1 -0
  105. package/dist/request/utils/isSSR.js +27 -0
  106. package/dist/request/utils/isSSR.js.map +1 -0
  107. package/dist/server-dir/buildtime/getTranslations.d.ts.map +1 -1
  108. package/dist/server-dir/buildtime/getTranslations.js.map +1 -1
  109. package/dist/server.d.ts +2 -1
  110. package/dist/server.d.ts.map +1 -1
  111. package/dist/server.js +3 -1
  112. package/dist/server.js.map +1 -1
  113. package/package.json +61 -10
  114. package/dist/config-dir/validateCompiler.d.ts.map +0 -1
  115. package/dist/config-dir/validateCompiler.js.map +0 -1
  116. package/dist/next/getNextDomain.d.ts.map +0 -1
  117. package/dist/next/getNextDomain.js.map +0 -1
  118. package/dist/next/getNextLocale.d.ts.map +0 -1
  119. package/dist/next/getNextLocale.js +0 -175
  120. package/dist/next/getNextLocale.js.map +0 -1
  121. package/dist/next/getNextRegion.d.ts +0 -2
  122. package/dist/next/getNextRegion.d.ts.map +0 -1
  123. package/dist/next/getNextRegion.js.map +0 -1
@@ -42,9 +42,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
42
42
  exports.getLocale = getLocale;
43
43
  exports.useLocale = useLocale;
44
44
  var getI18NConfig_1 = __importDefault(require("../config-dir/getI18NConfig"));
45
- var getNextLocale_1 = require("../next/getNextLocale");
46
45
  var use_1 = __importDefault(require("../utils/use"));
46
+ var getRequestFunction_1 = require("./utils/getRequestFunction");
47
+ var isSSR_1 = __importDefault(require("./utils/isSSR"));
47
48
  var getLocaleFunction;
49
+ var getStaticLocaleFunction;
50
+ var getLocaleFunctionWrapper;
48
51
  /**
49
52
  * Gets the user's current locale.
50
53
  *
@@ -56,62 +59,42 @@ var getLocaleFunction;
56
59
  */
57
60
  function getLocale() {
58
61
  return __awaiter(this, void 0, void 0, function () {
59
- var I18NConfig, gt, customRequestConfig, customGetLocale_1, locale, _a, _b, _c;
62
+ var I18NConfig, gt;
60
63
  var _this = this;
61
- var _d;
62
- return __generator(this, function (_e) {
63
- switch (_e.label) {
64
+ return __generator(this, function (_a) {
65
+ switch (_a.label) {
64
66
  case 0:
65
- if (!getLocaleFunction) return [3 /*break*/, 2];
66
- return [4 /*yield*/, getLocaleFunction()];
67
- case 1: return [2 /*return*/, _e.sent()];
67
+ if (!getLocaleFunctionWrapper) return [3 /*break*/, 2];
68
+ return [4 /*yield*/, getLocaleFunctionWrapper()];
69
+ case 1: return [2 /*return*/, _a.sent()];
68
70
  case 2:
69
71
  I18NConfig = (0, getI18NConfig_1.default)();
70
72
  gt = I18NConfig.getGTClass();
71
- if (!(process.env._GENERALTRANSLATION_CUSTOM_GET_LOCALE_ENABLED === 'true')) return [3 /*break*/, 6];
72
- _e.label = 3;
73
- case 3:
74
- _e.trys.push([3, 5, , 6]);
75
- customRequestConfig = require('gt-next/_request');
76
- customGetLocale_1 = ((_d = customRequestConfig === null || customRequestConfig === void 0 ? void 0 : customRequestConfig.default) === null || _d === void 0 ? void 0 : _d.getLocale) ||
77
- (customRequestConfig === null || customRequestConfig === void 0 ? void 0 : customRequestConfig.default) ||
78
- customRequestConfig.getLocale;
79
- _b = (_a = gt).resolveAliasLocale;
80
- return [4 /*yield*/, customGetLocale_1()];
81
- case 4:
82
- locale = _b.apply(_a, [_e.sent()]);
83
- getLocaleFunction = function () { return __awaiter(_this, void 0, void 0, function () {
84
- var preferredLocale, nextLocale;
85
- return __generator(this, function (_a) {
86
- switch (_a.label) {
87
- case 0: return [4 /*yield*/, customGetLocale_1()];
73
+ // Construct getLocale function
74
+ getLocaleFunction = (0, getRequestFunction_1.getRequestFunction)('getLocale', true);
75
+ getStaticLocaleFunction = (0, getRequestFunction_1.getRequestFunction)('getLocale', false);
76
+ // Construct locale function
77
+ getLocaleFunctionWrapper = function () { return __awaiter(_this, void 0, void 0, function () {
78
+ var locale, _a;
79
+ return __generator(this, function (_b) {
80
+ switch (_b.label) {
81
+ case 0:
82
+ if (!(0, isSSR_1.default)()) return [3 /*break*/, 2];
83
+ return [4 /*yield*/, getLocaleFunction()];
88
84
  case 1:
89
- preferredLocale = _a.sent();
90
- return [4 /*yield*/, (0, getNextLocale_1.getNextLocale)(I18NConfig.getDefaultLocale(), I18NConfig.getLocales(), preferredLocale)];
91
- case 2:
92
- nextLocale = _a.sent();
93
- return [2 /*return*/, gt.resolveAliasLocale(nextLocale)];
85
+ _a = _b.sent();
86
+ return [3 /*break*/, 4];
87
+ case 2: return [4 /*yield*/, getStaticLocaleFunction()];
88
+ case 3:
89
+ _a = _b.sent();
90
+ _b.label = 4;
91
+ case 4:
92
+ locale = _a;
93
+ return [2 /*return*/, gt.resolveAliasLocale(locale || I18NConfig.getDefaultLocale())];
94
94
  }
95
95
  });
96
96
  }); };
97
- return [2 /*return*/, locale];
98
- case 5:
99
- _c = _e.sent();
100
- return [3 /*break*/, 6];
101
- case 6:
102
- getLocaleFunction = function () { return __awaiter(_this, void 0, void 0, function () {
103
- var res;
104
- return __generator(this, function (_a) {
105
- switch (_a.label) {
106
- case 0: return [4 /*yield*/, (0, getNextLocale_1.getNextLocale)(I18NConfig.getDefaultLocale(), I18NConfig.getLocales())];
107
- case 1:
108
- res = _a.sent();
109
- return [2 /*return*/, gt.resolveAliasLocale(res)];
110
- }
111
- });
112
- }); };
113
- return [4 /*yield*/, getLocaleFunction()];
114
- case 7: return [2 /*return*/, _e.sent()];
97
+ return [2 /*return*/, getLocaleFunctionWrapper()];
115
98
  }
116
99
  });
117
100
  });
@@ -1 +1 @@
1
- {"version":3,"file":"getLocale.js","sourceRoot":"","sources":["../../src/request/getLocale.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,8BAmCC;AAED,8BAEC;AAtDD,8EAAwD;AACxD,uDAAsD;AACtD,qDAA+B;AAE/B,IAAI,iBAAwC,CAAC;AAE7C;;;;;;;;GAQG;AACH,SAAsB,SAAS;;;;;;;;yBACzB,iBAAiB,EAAjB,wBAAiB;oBAAS,qBAAM,iBAAiB,EAAE,EAAA;wBAAh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1B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"getLocaleDirection.d.ts","sourceRoot":"","sources":["../../src/request/getLocaleDirection.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC;AAClE,wBAAgB,kBAAkB,IAAI,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC;AAc7D;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,KAAK,CAIjE"}
1
+ {"version":3,"file":"getLocaleDirection.d.ts","sourceRoot":"","sources":["../../src/request/getLocaleDirection.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC;AAClE,wBAAgB,kBAAkB,IAAI,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC;AAc7D;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,KAAK,CAIjE"}
@@ -1 +1 @@
1
- {"version":3,"file":"getLocaleDirection.js","sourceRoot":"","sources":["../../src/request/getLocaleDirection.ts"],"names":[],"mappings":";;;;;AAoBA,gDAUC;AAcD,gDAIC;AAhDD,8EAAwD;AAExD,yCAAmD;AAiBnD,iBAAiB;AACjB,SAAgB,kBAAkB,CAAC,MAAe;IAChD,IAAM,EAAE,GAAG,IAAA,uBAAa,GAAE,CAAC,UAAU,EAAE,CAAC;IACxC,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,0CAA0C;QAC1C,OAAO,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAkB,CAAC;IACxD,CAAC;IACD,+CAA+C;IAC/C,OAAO,IAAA,qBAAS,GAAE,CAAC,IAAI,CAAC,UAAC,cAAc;QACrC,OAAA,EAAE,CAAC,kBAAkB,CAAC,cAAc,CAAC;IAArC,CAAqC,CACZ,CAAC;AAC9B,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAgB,kBAAkB,CAAC,MAAe;IAChD,MAAM,GAAG,MAAM,IAAI,IAAA,qBAAS,GAAE,CAAC;IAC/B,IAAM,EAAE,GAAG,IAAA,uBAAa,GAAE,CAAC,UAAU,EAAE,CAAC;IACxC,OAAO,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC"}
1
+ {"version":3,"file":"getLocaleDirection.js","sourceRoot":"","sources":["../../src/request/getLocaleDirection.ts"],"names":[],"mappings":";;;;;AAmBA,gDAUC;AAcD,gDAIC;AA/CD,8EAAwD;AACxD,yCAAmD;AAiBnD,iBAAiB;AACjB,SAAgB,kBAAkB,CAAC,MAAe;IAChD,IAAM,EAAE,GAAG,IAAA,uBAAa,GAAE,CAAC,UAAU,EAAE,CAAC;IACxC,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,0CAA0C;QAC1C,OAAO,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAkB,CAAC;IACxD,CAAC;IACD,+CAA+C;IAC/C,OAAO,IAAA,qBAAS,GAAE,CAAC,IAAI,CAAC,UAAC,cAAc;QACrC,OAAA,EAAE,CAAC,kBAAkB,CAAC,cAAc,CAAC;IAArC,CAAqC,CACZ,CAAC;AAC9B,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAgB,kBAAkB,CAAC,MAAe;IAChD,MAAM,GAAG,MAAM,IAAI,IAAA,qBAAS,GAAE,CAAC;IAC/B,IAAM,EAAE,GAAG,IAAA,uBAAa,GAAE,CAAC,UAAU,EAAE,CAAC;IACxC,OAAO,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"getRegion.d.ts","sourceRoot":"","sources":["../../src/request/getRegion.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH,wBAAsB,SAAS,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAO7D"}
1
+ {"version":3,"file":"getRegion.d.ts","sourceRoot":"","sources":["../../src/request/getRegion.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;GAUG;AACH,wBAAsB,SAAS,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAc7D"}
@@ -35,10 +35,16 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
35
35
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
36
  }
37
37
  };
38
+ var __importDefault = (this && this.__importDefault) || function (mod) {
39
+ return (mod && mod.__esModule) ? mod : { "default": mod };
40
+ };
38
41
  Object.defineProperty(exports, "__esModule", { value: true });
39
42
  exports.getRegion = getRegion;
40
- var getNextRegion_1 = require("../next/getNextRegion");
43
+ var getRequestFunction_1 = require("./utils/getRequestFunction");
44
+ var isSSR_1 = __importDefault(require("./utils/isSSR"));
41
45
  var getRegionFunction;
46
+ var getStaticRegionFunction;
47
+ var getRegionFunctionWrapper;
42
48
  /**
43
49
  * @internal
44
50
  *
@@ -56,22 +62,33 @@ function getRegion() {
56
62
  return __generator(this, function (_a) {
57
63
  switch (_a.label) {
58
64
  case 0:
59
- if (!getRegionFunction) return [3 /*break*/, 2];
60
- return [4 /*yield*/, getRegionFunction()];
65
+ if (!getRegionFunctionWrapper) return [3 /*break*/, 2];
66
+ return [4 /*yield*/, getRegionFunctionWrapper()];
61
67
  case 1: return [2 /*return*/, _a.sent()];
62
68
  case 2:
63
- getRegionFunction = function () { return __awaiter(_this, void 0, void 0, function () {
64
- var res;
65
- return __generator(this, function (_a) {
66
- switch (_a.label) {
67
- case 0: return [4 /*yield*/, (0, getNextRegion_1.getNextRegion)()];
69
+ getRegionFunction = (0, getRequestFunction_1.getRequestFunction)('getRegion', true);
70
+ getStaticRegionFunction = (0, getRequestFunction_1.getRequestFunction)('getRegion', false);
71
+ getRegionFunctionWrapper = function () { return __awaiter(_this, void 0, void 0, function () {
72
+ var region, _a;
73
+ return __generator(this, function (_b) {
74
+ switch (_b.label) {
75
+ case 0:
76
+ if (!(0, isSSR_1.default)()) return [3 /*break*/, 2];
77
+ return [4 /*yield*/, getRegionFunction()];
68
78
  case 1:
69
- res = _a.sent();
70
- return [2 /*return*/, res];
79
+ _a = _b.sent();
80
+ return [3 /*break*/, 4];
81
+ case 2: return [4 /*yield*/, getStaticRegionFunction()];
82
+ case 3:
83
+ _a = _b.sent();
84
+ _b.label = 4;
85
+ case 4:
86
+ region = _a;
87
+ return [2 /*return*/, region];
71
88
  }
72
89
  });
73
90
  }); };
74
- return [4 /*yield*/, getRegionFunction()];
91
+ return [4 /*yield*/, getRegionFunctionWrapper()];
75
92
  case 3: return [2 /*return*/, _a.sent()];
76
93
  }
77
94
  });
@@ -1 +1 @@
1
- {"version":3,"file":"getRegion.js","sourceRoot":"","sources":["../../src/request/getRegion.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,8BAOC;AAvBD,uDAAsD;AAGtD,IAAI,iBAAoD,CAAC;AAEzD;;;;;;;;;;GAUG;AACH,SAAsB,SAAS;;;;;;yBACzB,iBAAiB,EAAjB,wBAAiB;oBAAS,qBAAM,iBAAiB,EAAE,EAAA;wBAAhC,sBAAO,SAAyB,EAAC;;oBACxD,iBAAiB,GAAG;;;;wCACN,qBAAM,IAAA,6BAAa,GAAE,EAAA;;oCAA3B,GAAG,GAAG,SAAqB;oCACjC,sBAAO,GAAG,EAAC;;;yBACZ,CAAC;oBACK,qBAAM,iBAAiB,EAAE,EAAA;wBAAhC,sBAAO,SAAyB,EAAC;;;;CAClC"}
1
+ {"version":3,"file":"getRegion.js","sourceRoot":"","sources":["../../src/request/getRegion.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,8BAcC;AA/BD,iEAAgE;AAChE,wDAAkC;AAElC,IAAI,iBAAoD,CAAC;AACzD,IAAI,uBAA0D,CAAC;AAC/D,IAAI,wBAA2D,CAAC;AAChE;;;;;;;;;;GAUG;AACH,SAAsB,SAAS;;;;;;yBACzB,wBAAwB,EAAxB,wBAAwB;oBAAS,qBAAM,wBAAwB,EAAE,EAAA;wBAAvC,sBAAO,SAAgC,EAAC;;oBAEtE,iBAAiB,GAAG,IAAA,uCAAkB,EAAC,WAAW,EAAE,IAAI,CAAC,CAAC;oBAC1D,uBAAuB,GAAG,IAAA,uCAAkB,EAAC,WAAW,EAAE,KAAK,CAAC,CAAC;oBAEjE,wBAAwB,GAAG;;;;;yCACV,IAAA,eAAK,GAAE,EAAP,wBAAO;oCAClB,qBAAM,iBAAiB,EAAE,EAAA;;oCAAzB,KAAA,SAAyB,CAAA;;wCACzB,qBAAM,uBAAuB,EAAE,EAAA;;oCAA/B,KAAA,SAA+B,CAAA;;;oCAF7B,MAAM,KAEuB;oCACnC,sBAAO,MAAM,EAAC;;;yBACf,CAAC;oBAEK,qBAAM,wBAAwB,EAAE,EAAA;wBAAvC,sBAAO,SAAgC,EAAC;;;;CACzC"}
@@ -1,11 +1,12 @@
1
+ import { RequestFunctionReturnType } from '../types';
1
2
  /**
2
3
  * Retrieves the 'host' header from the headers list.
3
4
  * If the 'next/headers' module is not available, it attempts to load it. If the
4
5
  * headers function is available, it returns the value of the 'host' header.
5
- * If the headers function or 'host' header is not available, returns null.
6
+ * If the headers function or 'host' header is not available, returns undefined.
6
7
  *
7
- * @returns {string | null} A promise that resolves to the value of the 'host' header,
8
+ * @returns {string | undefined} A promise that resolves to the value of the 'host' header,
8
9
  * or null if not available.
9
10
  */
10
- export declare function getNextDomain(): Promise<string | null>;
11
+ export declare function getNextDomain(): Promise<RequestFunctionReturnType>;
11
12
  //# sourceMappingURL=getNextDomain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getNextDomain.d.ts","sourceRoot":"","sources":["../../../src/request/headers/getNextDomain.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAErD;;;;;;;;GAQG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,yBAAyB,CAAC,CAGxE"}
@@ -42,9 +42,9 @@ var headers_1 = require("next/headers");
42
42
  * Retrieves the 'host' header from the headers list.
43
43
  * If the 'next/headers' module is not available, it attempts to load it. If the
44
44
  * headers function is available, it returns the value of the 'host' header.
45
- * If the headers function or 'host' header is not available, returns null.
45
+ * If the headers function or 'host' header is not available, returns undefined.
46
46
  *
47
- * @returns {string | null} A promise that resolves to the value of the 'host' header,
47
+ * @returns {string | undefined} A promise that resolves to the value of the 'host' header,
48
48
  * or null if not available.
49
49
  */
50
50
  function getNextDomain() {
@@ -55,7 +55,7 @@ function getNextDomain() {
55
55
  case 0: return [4 /*yield*/, (0, headers_1.headers)()];
56
56
  case 1:
57
57
  headerList = _a.sent();
58
- return [2 /*return*/, headerList.get('host') || null];
58
+ return [2 /*return*/, headerList.get('host') || undefined];
59
59
  }
60
60
  });
61
61
  });
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getNextDomain.js","sourceRoot":"","sources":["../../../src/request/headers/getNextDomain.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,sCAGC;AAfD,wCAAuC;AAGvC;;;;;;;;GAQG;AACH,SAAsB,aAAa;;;;;wBACd,qBAAM,IAAA,iBAAO,GAAE,EAAA;;oBAA5B,UAAU,GAAG,SAAe;oBAClC,sBAAO,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,SAAS,EAAC;;;;CAC5C"}
@@ -1,3 +1,4 @@
1
+ import { RequestFunctionReturnType } from '../types';
1
2
  /**
2
3
  * Retrieves the 'accept-language' header from the headers list.
3
4
  * If the 'next/headers' module is not available, it attempts to load it. If the
@@ -7,5 +8,5 @@
7
8
  * @returns {Promise<string>} A promise that resolves to the primary language from the
8
9
  * 'accept-language' header.
9
10
  */
10
- export declare function getNextLocale(defaultLocale: string | undefined, locales: string[], preferredLocale?: string): Promise<string>;
11
+ export declare function getNextLocale(): Promise<RequestFunctionReturnType>;
11
12
  //# sourceMappingURL=getNextLocale.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getNextLocale.d.ts","sourceRoot":"","sources":["../../../src/request/headers/getNextLocale.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAErD;;;;;;;;GAQG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,yBAAyB,CAAC,CA0CxE"}
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ var __importDefault = (this && this.__importDefault) || function (mod) {
39
+ return (mod && mod.__esModule) ? mod : { "default": mod };
40
+ };
41
+ Object.defineProperty(exports, "__esModule", { value: true });
42
+ exports.getNextLocale = getNextLocale;
43
+ var headers_1 = require("next/headers");
44
+ var getI18NConfig_1 = __importDefault(require("../../config-dir/getI18NConfig"));
45
+ var errors_1 = require("../../errors");
46
+ /**
47
+ * Retrieves the 'accept-language' header from the headers list.
48
+ * If the 'next/headers' module is not available, it attempts to load it. If the
49
+ * headers function is available, it returns the primary language from the 'accept-language'
50
+ * header.
51
+ *
52
+ * @returns {Promise<string>} A promise that resolves to the primary language from the
53
+ * 'accept-language' header.
54
+ */
55
+ function getNextLocale() {
56
+ return __awaiter(this, void 0, void 0, function () {
57
+ var _a, headersList, cookieStore, I18NConfig, defaultLocale, locales, preferredLocales, headerLocale, cookieLocale, acceptedLocales, gt;
58
+ var _b;
59
+ return __generator(this, function (_c) {
60
+ switch (_c.label) {
61
+ case 0: return [4 /*yield*/, Promise.all([(0, headers_1.headers)(), (0, headers_1.cookies)()])];
62
+ case 1:
63
+ _a = _c.sent(), headersList = _a[0], cookieStore = _a[1];
64
+ I18NConfig = (0, getI18NConfig_1.default)();
65
+ defaultLocale = I18NConfig.getDefaultLocale();
66
+ locales = I18NConfig.getLocales();
67
+ preferredLocales = [];
68
+ headerLocale = headersList.get(I18NConfig.getLocaleHeaderName());
69
+ if (headerLocale) {
70
+ preferredLocales.push(headerLocale);
71
+ }
72
+ cookieLocale = cookieStore.get(I18NConfig.getLocaleCookieName());
73
+ if (cookieLocale === null || cookieLocale === void 0 ? void 0 : cookieLocale.value) {
74
+ preferredLocales.push(cookieLocale.value);
75
+ }
76
+ // Browser languages, in preference order
77
+ if (process.env._GENERALTRANSLATION_IGNORE_BROWSER_LOCALES === 'false') {
78
+ acceptedLocales = (_b = headersList
79
+ .get('accept-language')) === null || _b === void 0 ? void 0 : _b.split(',').map(function (item) { var _a; return (_a = item.split(';')) === null || _a === void 0 ? void 0 : _a[0].trim(); });
80
+ if (acceptedLocales)
81
+ preferredLocales.push.apply(preferredLocales, acceptedLocales);
82
+ }
83
+ // Give an error here
84
+ if (preferredLocales.length === 0 &&
85
+ process.env._GENERALTRANSLATION_IGNORE_BROWSER_LOCALES === 'false') {
86
+ console.warn(errors_1.noLocalesCouldBeDeterminedWarning);
87
+ }
88
+ // add defaultLocale just in case there are no matches
89
+ preferredLocales.push(defaultLocale);
90
+ gt = (0, getI18NConfig_1.default)().getGTClass();
91
+ return [2 /*return*/, gt.determineLocale(preferredLocales, locales)];
92
+ }
93
+ });
94
+ });
95
+ }
96
+ //# sourceMappingURL=getNextLocale.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getNextLocale.js","sourceRoot":"","sources":["../../../src/request/headers/getNextLocale.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,sCA0CC;AAxDD,wCAAgD;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E,CAAC;oBAED,qBAAqB;oBACrB,IACE,gBAAgB,CAAC,MAAM,KAAK,CAAC;wBAC7B,OAAO,CAAC,GAAG,CAAC,0CAA0C,KAAK,OAAO,EAClE,CAAC;wBACD,OAAO,CAAC,IAAI,CAAC,0CAAiC,CAAC,CAAC;oBAClD,CAAC;oBAED,sDAAsD;oBACtD,gBAAgB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;oBAE/B,EAAE,GAAG,IAAA,uBAAa,GAAE,CAAC,UAAU,EAAE,CAAC;oBACxC,sBAAO,EAAE,CAAC,eAAe,CAAC,gBAAgB,EAAE,OAAO,CAAC,EAAC;;;;CACtD"}
@@ -0,0 +1,3 @@
1
+ import { RequestFunctionReturnType } from '../types';
2
+ export declare function getNextRegion(): Promise<RequestFunctionReturnType>;
3
+ //# sourceMappingURL=getNextRegion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getNextRegion.d.ts","sourceRoot":"","sources":["../../../src/request/headers/getNextRegion.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAErD,wBAAsB,aAAa,IAAI,OAAO,CAAC,yBAAyB,CAAC,CAIxE"}
@@ -38,7 +38,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.getNextRegion = getNextRegion;
40
40
  var headers_1 = require("next/headers");
41
- // import getI18NConfig from '../config-dir/getI18NConfig';
42
41
  var internal_1 = require("gt-react/internal");
43
42
  function getNextRegion() {
44
43
  return __awaiter(this, void 0, void 0, function () {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getNextRegion.js","sourceRoot":"","sources":["../../../src/request/headers/getNextRegion.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,sCAIC;AARD,wCAAuC;AACvC,8CAA4D;AAG5D,SAAsB,aAAa;;;;;;wBACb,qBAAM,IAAA,iBAAO,GAAE,EAAA;;oBAA7B,WAAW,GAAG,SAAe;oBAC7B,YAAY,GAAG,MAAA,WAAW,CAAC,GAAG,CAAC,kCAAuB,CAAC,0CAAE,KAAK,CAAC;oBACrE,sBAAO,YAAY,EAAC;;;;CACrB"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Shared types for headers functions for simplicity
3
+ */
4
+ export type RequestFunctionReturnType = string | undefined;
5
+ export declare const STATIC_REQUEST_FUNCTIONS: readonly ["getStaticLocale", "getStaticRegion", "getStaticDomain"];
6
+ export declare const REQUEST_FUNCTIONS: readonly ["getLocale", "getRegion", "getDomain"];
7
+ export type RequestFunctions = (typeof REQUEST_FUNCTIONS)[number];
8
+ export type StaticRequestFunctions = (typeof STATIC_REQUEST_FUNCTIONS)[number];
9
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/request/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,MAAM,GAAG,SAAS,CAAC;AAE3D,eAAO,MAAM,wBAAwB,oEAI3B,CAAC;AAEX,eAAO,MAAM,iBAAiB,kDAIpB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAClE,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.REQUEST_FUNCTIONS = exports.STATIC_REQUEST_FUNCTIONS = void 0;
4
+ exports.STATIC_REQUEST_FUNCTIONS = [
5
+ 'getStaticLocale',
6
+ 'getStaticRegion',
7
+ 'getStaticDomain',
8
+ ];
9
+ exports.REQUEST_FUNCTIONS = [
10
+ 'getLocale',
11
+ 'getRegion',
12
+ 'getDomain',
13
+ ];
14
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/request/types.ts"],"names":[],"mappings":";;;AAKa,QAAA,wBAAwB,GAAG;IACtC,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;CACT,CAAC;AAEE,QAAA,iBAAiB,GAAG;IAC/B,WAAW;IACX,WAAW;IACX,WAAW;CACH,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { RequestFunctionReturnType as RequestFunctionReturnType } from '../types';
2
+ /**
3
+ * Two scenarios: SSR or SSG
4
+ * SSR:
5
+ * - custom function > default function (library)
6
+ * SSG:
7
+ * - custom static function > custom function > SSG fallback (library)
8
+ */
9
+ export declare function getRequestFunction(functionName: 'getLocale' | 'getRegion' | 'getDomain', ssr: boolean): () => Promise<RequestFunctionReturnType>;
10
+ //# sourceMappingURL=getRequestFunction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getRequestFunction.d.ts","sourceRoot":"","sources":["../../../src/request/utils/getRequestFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,IAAI,yBAAyB,EAGvD,MAAM,UAAU,CAAC;AAclB;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,WAAW,GAAG,WAAW,GAAG,WAAW,EACrD,GAAG,EAAE,OAAO,GACX,MAAM,OAAO,CAAC,yBAAyB,CAAC,CAoC1C"}