@fibery/url-utils 2.3.5 → 2.4.0
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/lib/diactrics.d.ts +2 -3
- package/lib/index.d.ts +17 -18
- package/lib/locator-utils.d.ts +7 -8
- package/lib/make-path.d.ts +2 -3
- package/lib/parse-page-location.d.ts +9 -10
- package/lib/routes.d.ts +35 -36
- package/lib/routes.js +1 -0
- package/lib/url-constants.d.ts +12 -11
- package/lib/url-constants.js +8 -1
- package/lib/workspaces.d.ts +11 -7
- package/package.json +1 -1
package/lib/diactrics.d.ts
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
//#region src/index.d.ts
|
|
2
|
-
declare const appendQueryFlag: (url: string, key: string) => string;
|
|
3
|
-
declare const appendQueryParameter: (url: string, key: string, value: string | null) => string;
|
|
4
|
-
declare const getFlagValue: (flag: string) => string | null;
|
|
5
|
-
declare const getSharingKey: () => string | null;
|
|
6
|
-
declare const appendSharingKey: (url?: string | null, sharingKey?: undefined | string | null) => string;
|
|
7
|
-
declare const appendIsPublicParam: (url: string) => string;
|
|
8
|
-
declare const signedFileUrl: (url?: string | null) => string | null | undefined;
|
|
9
|
-
declare const getRefURL: (location?: {
|
|
2
|
+
export declare const appendQueryFlag: (url: string, key: string) => string;
|
|
3
|
+
export declare const appendQueryParameter: (url: string, key: string, value: string | null) => string;
|
|
4
|
+
export declare const getFlagValue: (flag: string) => string | null;
|
|
5
|
+
export declare const getSharingKey: () => string | null;
|
|
6
|
+
export declare const appendSharingKey: (url?: string | null, sharingKey?: undefined | string | null) => string;
|
|
7
|
+
export declare const appendIsPublicParam: (url: string) => string;
|
|
8
|
+
export declare const signedFileUrl: (url?: string | null) => string | null | undefined;
|
|
9
|
+
export declare const getRefURL: (location?: {
|
|
10
10
|
href: string;
|
|
11
11
|
origin: string;
|
|
12
12
|
}) => string;
|
|
13
|
-
declare const isSharingMode: boolean;
|
|
14
|
-
declare const isPublicSpaceMode: boolean;
|
|
15
|
-
declare const isPublicForm: boolean;
|
|
16
|
-
declare const isPublicAccessMode: boolean;
|
|
17
|
-
declare const isRelativeUrl: (url: string) => boolean;
|
|
18
|
-
declare const isPublicUrlInPrivateMode: (absoluteUrl: string, location?: Location) => boolean;
|
|
19
|
-
declare const getRelativeUrlFromAbsolute: (absoluteUrl: string, location?: Location) => string;
|
|
13
|
+
export declare const isSharingMode: boolean;
|
|
14
|
+
export declare const isPublicSpaceMode: boolean;
|
|
15
|
+
export declare const isPublicForm: boolean;
|
|
16
|
+
export declare const isPublicAccessMode: boolean;
|
|
17
|
+
export declare const isRelativeUrl: (url: string) => boolean;
|
|
18
|
+
export declare const isPublicUrlInPrivateMode: (absoluteUrl: string, location?: Location) => boolean;
|
|
19
|
+
export declare const getRelativeUrlFromAbsolute: (absoluteUrl: string, location?: Location) => string;
|
|
20
20
|
type Context = {
|
|
21
21
|
contextEntityTypeName: string;
|
|
22
22
|
contextEntityPublicId: string;
|
|
23
23
|
};
|
|
24
|
-
declare const createPureFiberyEntityUrlMatcher: ({ ownHost }: {
|
|
24
|
+
export declare const createPureFiberyEntityUrlMatcher: ({ ownHost }: {
|
|
25
25
|
ownHost: string;
|
|
26
26
|
}) => (originalUrl: string, matchUserAsWell?: boolean) => null | {
|
|
27
27
|
publicId: string;
|
|
@@ -34,5 +34,4 @@ declare const createPureFiberyEntityUrlMatcher: ({ ownHost }: {
|
|
|
34
34
|
};
|
|
35
35
|
context?: Context;
|
|
36
36
|
};
|
|
37
|
-
//#endregion
|
|
38
|
-
export { appendIsPublicParam, appendQueryFlag, appendQueryParameter, appendSharingKey, createPureFiberyEntityUrlMatcher, getFlagValue, getRefURL, getRelativeUrlFromAbsolute, getSharingKey, isPublicAccessMode, isPublicForm, isPublicSpaceMode, isPublicUrlInPrivateMode, isRelativeUrl, isSharingMode, signedFileUrl };
|
|
37
|
+
//#endregion
|
package/lib/locator-utils.d.ts
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
//#region src/locator-utils.d.ts
|
|
2
|
-
declare const escapeRegExpChar: (x: string) => string;
|
|
3
|
-
declare const parseLocator: (locator: string) => {
|
|
2
|
+
export declare const escapeRegExpChar: (x: string) => string;
|
|
3
|
+
export declare const parseLocator: (locator: string) => {
|
|
4
4
|
publicId: string | null;
|
|
5
5
|
title: null;
|
|
6
6
|
} | {
|
|
7
7
|
publicId: string;
|
|
8
8
|
title: string;
|
|
9
9
|
};
|
|
10
|
-
declare const parseScrollLocator: (locator?: string | null) => Record<string, string | null>;
|
|
11
|
-
declare const makeLocator: ({ publicId, title }: {
|
|
10
|
+
export declare const parseScrollLocator: (locator?: string | null) => Record<string, string | null>;
|
|
11
|
+
export declare const makeLocator: ({ publicId, title }: {
|
|
12
12
|
publicId: string | number | null;
|
|
13
13
|
title?: string | null;
|
|
14
14
|
}) => string;
|
|
15
|
-
declare const createAnchorScrollLocatorValue: (params: {
|
|
15
|
+
export declare const createAnchorScrollLocatorValue: (params: {
|
|
16
16
|
id: string;
|
|
17
17
|
text?: string;
|
|
18
18
|
}) => string;
|
|
19
|
-
declare const parseScrollLocatorValue: (key: string, originalValue: string) => string;
|
|
20
|
-
//#endregion
|
|
21
|
-
export { createAnchorScrollLocatorValue, escapeRegExpChar, makeLocator, parseLocator, parseScrollLocator, parseScrollLocatorValue };
|
|
19
|
+
export declare const parseScrollLocatorValue: (key: string, originalValue: string) => string;
|
|
20
|
+
//#endregion
|
package/lib/make-path.d.ts
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
//#region src/parse-page-location.d.ts
|
|
2
|
-
type PageMatch<P, PARAMS> = {
|
|
2
|
+
export type PageMatch<P, PARAMS> = {
|
|
3
3
|
page: P;
|
|
4
4
|
params: PARAMS;
|
|
5
5
|
isFavorite: boolean;
|
|
6
6
|
matchedPath: string | null;
|
|
7
7
|
};
|
|
8
|
-
declare function safeDecodeURIComponent(maybeEncodedPath: string): string;
|
|
9
|
-
declare function findPageMatch(maybeEncodedPath: string): PageMatch<string, Record<string,
|
|
10
|
-
type AuxMatch<AUX, PARAMS> = {
|
|
8
|
+
export declare function safeDecodeURIComponent(maybeEncodedPath: string): string;
|
|
9
|
+
export declare function findPageMatch(maybeEncodedPath: string): PageMatch<string, Record<string, string | undefined>> | null;
|
|
10
|
+
export type AuxMatch<AUX, PARAMS, Namespace = string> = {
|
|
11
11
|
aux: AUX;
|
|
12
12
|
params: PARAMS;
|
|
13
|
-
pageAppNamespace:
|
|
13
|
+
pageAppNamespace: Namespace;
|
|
14
14
|
};
|
|
15
|
-
declare function findAuxMatch(path: string, pageAppNamespace:
|
|
16
|
-
declare function getPageMatch(pathname: string): null | PageMatch<string, Record<string,
|
|
17
|
-
declare function getAuxMatch(hash: string | null | undefined, implicitAppNamespace:
|
|
18
|
-
//#endregion
|
|
19
|
-
export { AuxMatch, PageMatch, findAuxMatch, findPageMatch, getAuxMatch, getPageMatch, safeDecodeURIComponent };
|
|
15
|
+
export declare function findAuxMatch<Namespace extends string | null>(path: string, pageAppNamespace: Namespace): AuxMatch<string, Record<string, string | undefined>, Namespace> | null;
|
|
16
|
+
export declare function getPageMatch(pathname: string): null | PageMatch<string, Record<string, string | undefined>>;
|
|
17
|
+
export declare function getAuxMatch<Namespace extends string | null>(hash: string | null | undefined, implicitAppNamespace: Namespace): AuxMatch<string, Record<string, string | undefined>, Namespace> | null;
|
|
18
|
+
//#endregion
|
package/lib/routes.d.ts
CHANGED
|
@@ -1,41 +1,40 @@
|
|
|
1
1
|
//#region src/routes.d.ts
|
|
2
|
-
declare const appIndexViewLocator = "views";
|
|
3
|
-
declare const userAccessViewLocator = "access";
|
|
4
|
-
declare const specificObjectViewsCatalogViewLocator = "views";
|
|
5
|
-
declare const deprecatedSpecificObjectEditorViewLocator = "edit";
|
|
6
|
-
declare const specificObjectUnknownObjectLocator = "any";
|
|
7
|
-
declare const specificObjectEditorViewLocator: null;
|
|
8
|
-
declare const appTypeModePage = "/fibery/space/:appNamespace/:mode/:typeWithoutNamespace";
|
|
9
|
-
declare const appTypeModeSubPage = "/fibery/space/:appNamespace/:mode/:typeWithoutNamespace/:subPage";
|
|
10
|
-
declare const appTypeModeAutomationBasePage = "/fibery/space/:appNamespace/:mode/:typeWithoutNamespace/:subPage/:automationType/:automationItemId";
|
|
11
|
-
declare const appTypeModeAccessTemplatePage = "/fibery/space/:appNamespace/:mode/:typeWithoutNamespace/:subPage/access-templates/:accessTemplateId";
|
|
12
|
-
declare const appTypeModeFormPage = "/fibery/space/:appNamespace/:mode/:typeWithoutNamespace/:subPage/form/:formId";
|
|
13
|
-
declare const appTypeModeAutomationSpecificPage = "/fibery/space/:appNamespace/:mode/:typeWithoutNamespace/:subPage/:automationType/:automationItemId/:automationMode";
|
|
14
|
-
declare const appTypeModeFieldEditPage = "/fibery/space/:appNamespace/:mode/:typeWithoutNamespace/:subPage/:fieldTitle/edit";
|
|
15
|
-
declare const appTypeModeGroupEditPage = "/fibery/space/:appNamespace/:mode/:typeWithoutNamespace/:subPage/:typeId/members";
|
|
16
|
-
declare const appModePage = "/fibery/space/:appNamespace/:mode";
|
|
17
|
-
declare const appTypeModePageView: string;
|
|
18
|
-
declare const formsPublicPage = "/@public/forms/:formKey";
|
|
19
|
-
declare const highlightTypePage = "/fibery/settings/:subsection(highlights)/:typeWithoutNamespace";
|
|
20
|
-
declare const highlightTypeFieldEditPage = "/fibery/settings/:subsection(highlights)/:typeWithoutNamespace/fields/:fieldWithoutNamespace/edit";
|
|
21
|
-
declare const integrationSettingPage = "/fibery/settings/:subsection(integrations)/:templateId";
|
|
22
|
-
declare const personalIntegrationSettingPage = "/fibery/settings/:subsection(personal-integrations)/:integrationId";
|
|
23
|
-
declare const oauthApplicationSettingPage = "/fibery/settings/:subsection(oauth-applications)/:applicationId";
|
|
24
|
-
declare const typeAccessTemplateSettingPage = "/fibery/settings/:subsection(database-access-templates)/:templateId";
|
|
25
|
-
declare const isSettingsPage: (page?: string) => boolean;
|
|
26
|
-
declare const NON_SPA_PATH_PREFIXES: string[];
|
|
27
|
-
declare const isNonSpaPath: (path: string) => boolean;
|
|
28
|
-
declare const ORDERED_PAGE_ROUTES: Array<[string, string]>;
|
|
29
|
-
declare const PAGE_ROUTES: import("lodash").Dictionary<string>;
|
|
30
|
-
declare const ORDERED_COMMON_AUX_ROUTES: Array<[string, string]>;
|
|
31
|
-
declare const ORDERED_AUX_ROUTES: Array<[string, string]>;
|
|
32
|
-
declare const AUX_ROUTES: import("lodash").Dictionary<string>;
|
|
33
|
-
declare const AUX_ROUTES_PATTERNS: string[];
|
|
34
|
-
declare const ROUTES_WITH_PRESERVED_UNDERSCORES_LOOKUP: {
|
|
2
|
+
export declare const appIndexViewLocator = "views";
|
|
3
|
+
export declare const userAccessViewLocator = "access";
|
|
4
|
+
export declare const specificObjectViewsCatalogViewLocator = "views";
|
|
5
|
+
export declare const deprecatedSpecificObjectEditorViewLocator = "edit";
|
|
6
|
+
export declare const specificObjectUnknownObjectLocator = "any";
|
|
7
|
+
export declare const specificObjectEditorViewLocator: null;
|
|
8
|
+
export declare const appTypeModePage = "/fibery/space/:appNamespace/:mode/:typeWithoutNamespace";
|
|
9
|
+
export declare const appTypeModeSubPage = "/fibery/space/:appNamespace/:mode/:typeWithoutNamespace/:subPage";
|
|
10
|
+
export declare const appTypeModeAutomationBasePage = "/fibery/space/:appNamespace/:mode/:typeWithoutNamespace/:subPage/:automationType/:automationItemId";
|
|
11
|
+
export declare const appTypeModeAccessTemplatePage = "/fibery/space/:appNamespace/:mode/:typeWithoutNamespace/:subPage/access-templates/:accessTemplateId";
|
|
12
|
+
export declare const appTypeModeFormPage = "/fibery/space/:appNamespace/:mode/:typeWithoutNamespace/:subPage/form/:formId";
|
|
13
|
+
export declare const appTypeModeAutomationSpecificPage = "/fibery/space/:appNamespace/:mode/:typeWithoutNamespace/:subPage/:automationType/:automationItemId/:automationMode";
|
|
14
|
+
export declare const appTypeModeFieldEditPage = "/fibery/space/:appNamespace/:mode/:typeWithoutNamespace/:subPage/:fieldTitle/edit";
|
|
15
|
+
export declare const appTypeModeGroupEditPage = "/fibery/space/:appNamespace/:mode/:typeWithoutNamespace/:subPage/:typeId/members";
|
|
16
|
+
export declare const appModePage = "/fibery/space/:appNamespace/:mode";
|
|
17
|
+
export declare const appTypeModePageView: string;
|
|
18
|
+
export declare const formsPublicPage = "/@public/forms/:formKey";
|
|
19
|
+
export declare const highlightTypePage = "/fibery/settings/:subsection(highlights)/:typeWithoutNamespace";
|
|
20
|
+
export declare const highlightTypeFieldEditPage = "/fibery/settings/:subsection(highlights)/:typeWithoutNamespace/fields/:fieldWithoutNamespace/edit";
|
|
21
|
+
export declare const integrationSettingPage = "/fibery/settings/:subsection(integrations)/:templateId";
|
|
22
|
+
export declare const personalIntegrationSettingPage = "/fibery/settings/:subsection(personal-integrations)/:integrationId";
|
|
23
|
+
export declare const oauthApplicationSettingPage = "/fibery/settings/:subsection(oauth-applications)/:applicationId";
|
|
24
|
+
export declare const typeAccessTemplateSettingPage = "/fibery/settings/:subsection(database-access-templates)/:templateId";
|
|
25
|
+
export declare const isSettingsPage: (page?: string) => boolean;
|
|
26
|
+
export declare const NON_SPA_PATH_PREFIXES: string[];
|
|
27
|
+
export declare const isNonSpaPath: (path: string) => boolean;
|
|
28
|
+
export declare const ORDERED_PAGE_ROUTES: Array<[string, string]>;
|
|
29
|
+
export declare const PAGE_ROUTES: import("lodash").Dictionary<string>;
|
|
30
|
+
export declare const ORDERED_COMMON_AUX_ROUTES: Array<[string, string]>;
|
|
31
|
+
export declare const ORDERED_AUX_ROUTES: Array<[string, string]>;
|
|
32
|
+
export declare const AUX_ROUTES: import("lodash").Dictionary<string>;
|
|
33
|
+
export declare const AUX_ROUTES_PATTERNS: string[];
|
|
34
|
+
export declare const ROUTES_WITH_PRESERVED_UNDERSCORES_LOOKUP: {
|
|
35
35
|
[k: string]: boolean;
|
|
36
36
|
};
|
|
37
|
-
declare const ROUTES_WITH_PRESERVED_UNDERSCORES_PATTERNS_LOOKUP: {
|
|
37
|
+
export declare const ROUTES_WITH_PRESERVED_UNDERSCORES_PATTERNS_LOOKUP: {
|
|
38
38
|
[k: string]: boolean;
|
|
39
39
|
};
|
|
40
|
-
//#endregion
|
|
41
|
-
export { AUX_ROUTES, AUX_ROUTES_PATTERNS, NON_SPA_PATH_PREFIXES, ORDERED_AUX_ROUTES, ORDERED_COMMON_AUX_ROUTES, ORDERED_PAGE_ROUTES, PAGE_ROUTES, ROUTES_WITH_PRESERVED_UNDERSCORES_LOOKUP, ROUTES_WITH_PRESERVED_UNDERSCORES_PATTERNS_LOOKUP, appIndexViewLocator, appModePage, appTypeModeAccessTemplatePage, appTypeModeAutomationBasePage, appTypeModeAutomationSpecificPage, appTypeModeFieldEditPage, appTypeModeFormPage, appTypeModeGroupEditPage, appTypeModePage, appTypeModePageView, appTypeModeSubPage, deprecatedSpecificObjectEditorViewLocator, formsPublicPage, highlightTypeFieldEditPage, highlightTypePage, integrationSettingPage, isNonSpaPath, isSettingsPage, oauthApplicationSettingPage, personalIntegrationSettingPage, specificObjectEditorViewLocator, specificObjectUnknownObjectLocator, specificObjectViewsCatalogViewLocator, typeAccessTemplateSettingPage, userAccessViewLocator };
|
|
40
|
+
//#endregion
|
package/lib/routes.js
CHANGED
|
@@ -53,6 +53,7 @@ const isSettingsPage = (page) => {
|
|
|
53
53
|
};
|
|
54
54
|
const orderedRoutes = [
|
|
55
55
|
[":page/apps-gallery", `/fibery/apps-gallery/:appCategory`],
|
|
56
|
+
[":page/ai-connectors", `/fibery/ai-connectors/:connectorId?/:panel?/:section?`],
|
|
56
57
|
[":page/app", `/fibery/space/:appNamespace`],
|
|
57
58
|
[":page/app-access", `/fibery/space/:appNamespace/access`],
|
|
58
59
|
[":page/app-import", `/fibery/space/:appNamespace/import/:connectorId?/:mode?`],
|
package/lib/url-constants.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
//#region src/url-constants.d.ts
|
|
2
|
-
declare const sharingParamName = "sharing-key";
|
|
3
|
-
declare const publicParamName = "is-public";
|
|
4
|
-
declare const publicUrlPrefix = "/@public";
|
|
5
|
-
declare const formsUrlPrefix = "/@public/forms";
|
|
6
|
-
declare const formKeyParamName = "form-key";
|
|
7
|
-
declare const appsUrlPrefix = "/apps";
|
|
8
|
-
declare const publicAppsUrlPrefix = "/@public/apps";
|
|
9
|
-
declare const containerTypeParamName = "container-type";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export
|
|
2
|
+
export declare const sharingParamName = "sharing-key";
|
|
3
|
+
export declare const publicParamName = "is-public";
|
|
4
|
+
export declare const publicUrlPrefix = "/@public";
|
|
5
|
+
export declare const formsUrlPrefix = "/@public/forms";
|
|
6
|
+
export declare const formKeyParamName = "form-key";
|
|
7
|
+
export declare const appsUrlPrefix = "/apps";
|
|
8
|
+
export declare const publicAppsUrlPrefix = "/@public/apps";
|
|
9
|
+
export declare const containerTypeParamName = "container-type";
|
|
10
|
+
export declare const documentContainerTypes: readonly ["entity", "comment", "view", "canvas-comment"];
|
|
11
|
+
export type DocumentContainerType = (typeof documentContainerTypes)[number];
|
|
12
|
+
export declare const anyDocumentContainerType: string;
|
|
13
|
+
//#endregion
|
package/lib/url-constants.js
CHANGED
|
@@ -7,5 +7,12 @@ const formKeyParamName = "form-key";
|
|
|
7
7
|
const appsUrlPrefix = "/apps";
|
|
8
8
|
const publicAppsUrlPrefix = `${publicUrlPrefix}${appsUrlPrefix}`;
|
|
9
9
|
const containerTypeParamName = "container-type";
|
|
10
|
+
const documentContainerTypes = [
|
|
11
|
+
"entity",
|
|
12
|
+
"comment",
|
|
13
|
+
"view",
|
|
14
|
+
"canvas-comment"
|
|
15
|
+
];
|
|
16
|
+
const anyDocumentContainerType = documentContainerTypes.join(",");
|
|
10
17
|
//#endregion
|
|
11
|
-
export { appsUrlPrefix, containerTypeParamName, formKeyParamName, formsUrlPrefix, publicAppsUrlPrefix, publicParamName, publicUrlPrefix, sharingParamName };
|
|
18
|
+
export { anyDocumentContainerType, appsUrlPrefix, containerTypeParamName, documentContainerTypes, formKeyParamName, formsUrlPrefix, publicAppsUrlPrefix, publicParamName, publicUrlPrefix, sharingParamName };
|
package/lib/workspaces.d.ts
CHANGED
|
@@ -8,15 +8,19 @@ type WorkspaceSettings = {
|
|
|
8
8
|
documentsDisabled?: boolean;
|
|
9
9
|
custom_domain?: string | null;
|
|
10
10
|
};
|
|
11
|
-
type
|
|
11
|
+
export type DevEnvironmentLink = {
|
|
12
|
+
label: string;
|
|
13
|
+
origin: string;
|
|
14
|
+
};
|
|
15
|
+
export type Workspace = {
|
|
12
16
|
ui_settings: WorkspaceSettings;
|
|
13
17
|
name: string;
|
|
14
18
|
id?: number;
|
|
15
19
|
role?: string;
|
|
20
|
+
dev_environments?: DevEnvironmentLink[];
|
|
16
21
|
};
|
|
17
|
-
declare function getWorkspaceTitle(workspace: Workspace): string;
|
|
18
|
-
declare function hostnameFromWorkspace(workspace: Workspace): string;
|
|
19
|
-
declare function isCurrentWorkspace(workspace: Workspace, hostname: string): boolean;
|
|
20
|
-
declare function getCurrentWorkspaceTitle(workspace: Workspace | null, hostname: string): string;
|
|
21
|
-
//#endregion
|
|
22
|
-
export { Workspace, getCurrentWorkspaceTitle, getWorkspaceTitle, hostnameFromWorkspace, isCurrentWorkspace };
|
|
22
|
+
export declare function getWorkspaceTitle(workspace: Workspace): string;
|
|
23
|
+
export declare function hostnameFromWorkspace(workspace: Workspace): string;
|
|
24
|
+
export declare function isCurrentWorkspace(workspace: Workspace, hostname: string): boolean;
|
|
25
|
+
export declare function getCurrentWorkspaceTitle(workspace: Workspace | null, hostname: string): string;
|
|
26
|
+
//#endregion
|