@fibery/url-utils 2.2.6 → 2.2.7

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.
@@ -3,5 +3,5 @@ export let coveragePathIgnorePatterns: string[];
3
3
  export let collectCoverageFrom: string[];
4
4
  export let coverageReporters: string[];
5
5
  export let testRunner: string;
6
- export let setupFiles: string[];
6
+ export let setupFiles: any[];
7
7
  export let transformIgnorePatterns: string[];
package/lib/make-path.js CHANGED
@@ -4,7 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.makePath = makePath;
7
- const lodash_1 = __importDefault(require("lodash"));
7
+ const flow_1 = __importDefault(require("lodash/flow"));
8
+ const memoize_1 = __importDefault(require("lodash/memoize"));
8
9
  const path_to_regexp_1 = __importDefault(require("path-to-regexp"));
9
10
  const routes_1 = require("./routes");
10
11
  const index_1 = require("./index");
@@ -12,14 +13,14 @@ const url_constants_1 = require("./url-constants");
12
13
  const throwError = (message) => {
13
14
  throw new Error(message);
14
15
  };
15
- const memoizedCompile = lodash_1.default.memoize(path_to_regexp_1.default.compile);
16
+ const memoizedCompile = (0, memoize_1.default)(path_to_regexp_1.default.compile);
16
17
  // History lesson: at some point we've encoded space with "–" and then decided to use "_"
17
18
  // Need to support both old URLs and new ones
18
19
  const encodeSpacesWithDashes = (str = "") => str.replace(/ /g, "–");
19
20
  const encodeSpacesWithUnderscores = (str = "") => str.replace(/ /g, "_");
20
21
  const makeEncodeURIComponentPretty = (spacesEncoder) => {
21
22
  return (str) => {
22
- return lodash_1.default.flow([
23
+ return (0, flow_1.default)([
23
24
  spacesEncoder,
24
25
  encodeURI,
25
26
  // old encodePretty implementation from prev version of path-to-regexp
package/lib/routes.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import _ from "lodash";
2
1
  export declare const appIndexViewLocator = "views";
3
2
  export declare const userAccessViewLocator = "access";
4
3
  export declare const specificObjectViewsCatalogViewLocator = "views";
@@ -19,12 +18,13 @@ export declare const highlightTypePage = "/fibery/settings/:subsection(highlight
19
18
  export declare const highlightTypeFieldEditPage = "/fibery/settings/:subsection(highlights)/:typeWithoutNamespace/fields/:fieldWithoutNamespace/edit";
20
19
  export declare const integrationSettingPage = "/fibery/settings/:subsection(integrations)/:templateId";
21
20
  export declare const personalIntegrationSettingPage = "/fibery/settings/:subsection(personal-integrations)/:integrationId";
21
+ export declare const typeAccessTemplateSettingPage = "/fibery/settings/:subsection(database-access-templates)/:templateId";
22
22
  export declare const isSettingsPage: (page?: string) => boolean;
23
23
  export declare const ORDERED_PAGE_ROUTES: Array<[string, string]>;
24
- export declare const PAGE_ROUTES: _.Dictionary<string>;
24
+ export declare const PAGE_ROUTES: import("lodash").Dictionary<string>;
25
25
  export declare const ORDERED_COMMON_AUX_ROUTES: Array<[string, string]>;
26
26
  export declare const ORDERED_AUX_ROUTES: Array<[string, string]>;
27
- export declare const AUX_ROUTES: _.Dictionary<string>;
27
+ export declare const AUX_ROUTES: import("lodash").Dictionary<string>;
28
28
  export declare const AUX_ROUTES_PATTERNS: string[];
29
29
  export declare const ROUTES_WITH_PRESERVED_UNDERSCORES_LOOKUP: {
30
30
  [k: string]: boolean;
package/lib/routes.js CHANGED
@@ -3,8 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ROUTES_WITH_PRESERVED_UNDERSCORES_PATTERNS_LOOKUP = exports.ROUTES_WITH_PRESERVED_UNDERSCORES_LOOKUP = exports.AUX_ROUTES_PATTERNS = exports.AUX_ROUTES = exports.ORDERED_AUX_ROUTES = exports.ORDERED_COMMON_AUX_ROUTES = exports.PAGE_ROUTES = exports.ORDERED_PAGE_ROUTES = exports.isSettingsPage = exports.personalIntegrationSettingPage = exports.integrationSettingPage = exports.highlightTypeFieldEditPage = exports.highlightTypePage = exports.formsPublicPage = exports.appTypeModePageView = exports.appModePage = exports.appTypeModeGroupEditPage = exports.appTypeModeFieldEditPage = exports.appTypeModeAutomationSpecificPage = exports.appTypeModeAccessTemplatePage = exports.appTypeModeAutomationBasePage = exports.appTypeModeSubPage = exports.appTypeModePage = exports.specificObjectEditorViewLocator = exports.specificObjectUnknownObjectLocator = exports.deprecatedSpecificObjectEditorViewLocator = exports.specificObjectViewsCatalogViewLocator = exports.userAccessViewLocator = exports.appIndexViewLocator = void 0;
7
- const lodash_1 = __importDefault(require("lodash"));
6
+ exports.ROUTES_WITH_PRESERVED_UNDERSCORES_PATTERNS_LOOKUP = exports.ROUTES_WITH_PRESERVED_UNDERSCORES_LOOKUP = exports.AUX_ROUTES_PATTERNS = exports.AUX_ROUTES = exports.ORDERED_AUX_ROUTES = exports.ORDERED_COMMON_AUX_ROUTES = exports.PAGE_ROUTES = exports.ORDERED_PAGE_ROUTES = exports.isSettingsPage = exports.typeAccessTemplateSettingPage = exports.personalIntegrationSettingPage = exports.integrationSettingPage = exports.highlightTypeFieldEditPage = exports.highlightTypePage = exports.formsPublicPage = exports.appTypeModePageView = exports.appModePage = exports.appTypeModeGroupEditPage = exports.appTypeModeFieldEditPage = exports.appTypeModeAutomationSpecificPage = exports.appTypeModeAccessTemplatePage = exports.appTypeModeAutomationBasePage = exports.appTypeModeSubPage = exports.appTypeModePage = exports.specificObjectEditorViewLocator = exports.specificObjectUnknownObjectLocator = exports.deprecatedSpecificObjectEditorViewLocator = exports.specificObjectViewsCatalogViewLocator = exports.userAccessViewLocator = exports.appIndexViewLocator = void 0;
7
+ const fromPairs_1 = __importDefault(require("lodash/fromPairs"));
8
8
  const locator_utils_1 = require("./locator-utils");
9
9
  const url_constants_1 = require("./url-constants");
10
10
  const titleWithPublicIdLocatorPattern = `[^/=]+?-\\d+`;
@@ -43,6 +43,7 @@ exports.highlightTypePage = "/fibery/settings/:subsection(highlights)/:typeWitho
43
43
  exports.highlightTypeFieldEditPage = `${exports.highlightTypePage}/fields/:fieldWithoutNamespace/edit`;
44
44
  exports.integrationSettingPage = "/fibery/settings/:subsection(integrations)/:templateId";
45
45
  exports.personalIntegrationSettingPage = "/fibery/settings/:subsection(personal-integrations)/:integrationId";
46
+ exports.typeAccessTemplateSettingPage = "/fibery/settings/:subsection(database-access-templates)/:templateId";
46
47
  const settingsPage = ":page/settings";
47
48
  const appPage = ":page/app";
48
49
  const typePage = ":page/type";
@@ -71,11 +72,13 @@ const orderedRoutes = [
71
72
  [typePage, exports.appTypeModeSubPage],
72
73
  [typePage, exports.appTypeModePage],
73
74
  [":page/schema", `/:appNamespace(fibery)/settings/domain`],
75
+ [":page/schema", `/workspace-map`],
74
76
  [":page/me", `/:appNamespace(fibery)/me`],
75
77
  [settingsPage, exports.highlightTypePage],
76
78
  [settingsPage, exports.integrationSettingPage],
77
79
  [settingsPage, exports.highlightTypeFieldEditPage],
78
80
  [settingsPage, exports.personalIntegrationSettingPage],
81
+ [settingsPage, exports.typeAccessTemplateSettingPage],
79
82
  [settingsPage, "/fibery/settings/:subsection"],
80
83
  [settingsPage, "/fibery/settings"],
81
84
  [
@@ -113,7 +116,7 @@ const orderedRoutes = [
113
116
  exports.ORDERED_PAGE_ROUTES = orderedRoutes
114
117
  .map(([page, route]) => [page, `${url_constants_1.publicUrlPrefix}${route === "/" ? "" : route}`])
115
118
  .concat(orderedRoutes);
116
- exports.PAGE_ROUTES = lodash_1.default.fromPairs(exports.ORDERED_PAGE_ROUTES);
119
+ exports.PAGE_ROUTES = (0, fromPairs_1.default)(exports.ORDERED_PAGE_ROUTES);
117
120
  exports.ORDERED_COMMON_AUX_ROUTES = [
118
121
  [":aux/no-panel-support", `no-panel/:type`],
119
122
  [":aux/notifications", `notifications`],
@@ -124,6 +127,8 @@ exports.ORDERED_COMMON_AUX_ROUTES = [
124
127
  [":aux/ai-assistant", `ai-assistant/:agentId`],
125
128
  [":aux/user-access", `user-access/:userPublicId`],
126
129
  [":aux/user-group-access", `user-group-access/:auxTypeNamespace/:auxTypeName/:publicId`],
130
+ [":aux/type-access-templates", `database-access-templates/:templateId`],
131
+ [":aux/type-access-templates", `database-access-templates`],
127
132
  [":aux/type-access", `:auxTypeNamespace/:auxTypeName/type-access`],
128
133
  [":aux/type-object-editor", `:auxTypeNamespace/:auxTypeName/edit`],
129
134
  [":aux/type-object-editor-implicit-namespace", `:auxTypeName/edit`],
@@ -166,7 +171,7 @@ exports.ORDERED_AUX_ROUTES = [
166
171
  ...exports.ORDERED_COMMON_AUX_ROUTES,
167
172
  [":aux/view-config-raw", "config/raw"],
168
173
  ];
169
- exports.AUX_ROUTES = lodash_1.default.fromPairs(exports.ORDERED_AUX_ROUTES);
174
+ exports.AUX_ROUTES = (0, fromPairs_1.default)(exports.ORDERED_AUX_ROUTES);
170
175
  exports.AUX_ROUTES_PATTERNS = exports.ORDERED_AUX_ROUTES.map(([, pattern]) => pattern);
171
176
  const ROUTES_WITH_PRESERVED_UNDERSCORES = [
172
177
  // enums
@@ -4,6 +4,8 @@ type WorkspaceSettings = {
4
4
  publicSharing?: {
5
5
  disabled: boolean;
6
6
  } | null;
7
+ documentsDisabled?: boolean;
8
+ custom_domain?: string | null;
7
9
  };
8
10
  export type Workspace = {
9
11
  ui_settings: WorkspaceSettings | null;
@@ -11,5 +13,5 @@ export type Workspace = {
11
13
  };
12
14
  export declare function getWorkspaceTitle(workspace: Workspace): string;
13
15
  export declare function isCurrentWorkspace(workspace: Workspace, hostname: string): boolean;
14
- export declare function getCurrentWorkspaceTitle(workspace: Workspace | null, hostname: string, remoteHost?: string): string;
16
+ export declare function getCurrentWorkspaceTitle(workspace: Workspace | null, hostname: string): string;
15
17
  export {};
package/lib/workspaces.js CHANGED
@@ -16,15 +16,9 @@ function getWorkspaceTitle(workspace) {
16
16
  return name.split(`-`).map(capitalizeFirstChar).join(" ");
17
17
  }
18
18
  function isCurrentWorkspace(workspace, hostname) {
19
- return workspace.name === hostname;
19
+ return workspace.name === hostname || workspace.ui_settings?.custom_domain === hostname;
20
20
  }
21
- function getCurrentWorkspaceTitle(workspace, hostname, remoteHost) {
22
- if (hostname === "localhost") {
23
- if (remoteHost) {
24
- return `Remote ${remoteHost}`;
25
- }
26
- return "Local Development";
27
- }
21
+ function getCurrentWorkspaceTitle(workspace, hostname) {
28
22
  return workspace
29
23
  ? getWorkspaceTitle(workspace)
30
24
  : hostname.split(".")[0].split("-").map(capitalizeFirstChar).join(" ");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fibery/url-utils",
3
- "version": "2.2.6",
3
+ "version": "2.2.7",
4
4
  "main": "lib/index.js",
5
5
  "browser": "index.ts",
6
6
  "files": [
@@ -20,21 +20,20 @@
20
20
  "devDependencies": {
21
21
  "@types/jest": "30.0.0",
22
22
  "@types/lodash": "4.14.172",
23
- "@types/node": "24.10.1",
24
23
  "@types/react-router-dom": "5.3.2",
25
- "@typescript-eslint/eslint-plugin": "6.10.0",
26
- "@typescript-eslint/parser": "6.10.0",
27
- "eslint": "8.53.0",
28
- "eslint-plugin-unicorn": "46.0.0",
24
+ "@typescript-eslint/eslint-plugin": "8.54.0",
25
+ "@typescript-eslint/parser": "8.54.0",
26
+ "eslint": "9.39.2",
27
+ "eslint-plugin-unicorn": "62.0.0",
29
28
  "jest": "30.2.0",
30
29
  "jest-circus": "30.2.0",
31
30
  "jest-junit": "16.0.0",
32
31
  "lodash": "4.17.21",
33
- "react": "18.2.0",
32
+ "react": "18.3.1",
34
33
  "react-router-dom": "5.3.0",
35
34
  "typescript": "5.9.3",
36
- "@fibery/babel-preset": "7.4.1",
37
- "@fibery/eslint-config": "8.6.2"
35
+ "@fibery/babel-preset": "7.4.2",
36
+ "@fibery/eslint-config": "9.0.1"
38
37
  },
39
38
  "peerDependencies": {
40
39
  "lodash": "4.17.21",