@platform-mesh/portal-ui-lib 0.68.7 → 0.70.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/assets/platform-mesh-portal-ui-wc.js +750 -750
- package/fesm2022/platform-mesh-portal-ui-lib-portal-options.mjs +119 -32
- package/fesm2022/platform-mesh-portal-ui-lib-portal-options.mjs.map +1 -1
- package/fesm2022/platform-mesh-portal-ui-lib-services.mjs +37 -53
- package/fesm2022/platform-mesh-portal-ui-lib-services.mjs.map +1 -1
- package/fesm2022/platform-mesh-portal-ui-lib-utils.mjs +1 -28
- package/fesm2022/platform-mesh-portal-ui-lib-utils.mjs.map +1 -1
- package/package.json +1 -1
- package/types/platform-mesh-portal-ui-lib-portal-options.d.ts +19 -4
- package/types/platform-mesh-portal-ui-lib-services.d.ts +4 -10
- package/types/platform-mesh-portal-ui-lib-utils.d.ts +1 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-mesh-portal-ui-lib-utils.mjs","sources":["../../projects/lib/utils/utils/build-graphql-input-type-name.ts","../../projects/lib/utils/utils/build-resource-list-operation.ts","../../projects/lib/utils/utils/flatten-field-tree.ts","../../projects/lib/utils/utils/columns-to-gql-fields.ts","../../projects/lib/utils/utils/resource-field-by-path.ts","../../projects/lib/utils/utils/get-value-by-path.ts","../../projects/lib/utils/utils/instance-permission-key.ts","../../projects/lib/utils/utils/is-local-setup.ts","../../projects/lib/utils/utils/is-namespaced-resource.ts","../../projects/lib/utils/utils/merge-list-with-subscription-result.ts","../../projects/lib/utils/utils/parse-raw-gql-query.ts","../../projects/lib/utils/utils/resource-action-allowed.ts","../../projects/lib/utils/utils/resource-sanitizer.ts","../../projects/lib/utils/utils/delete-property-by-path.ts","../../projects/lib/utils/utils/set-property-by-path.ts","../../projects/lib/utils/utils/luigi-navigation.ts","../../projects/lib/utils/platform-mesh-portal-ui-lib-utils.ts"],"sourcesContent":["function sanitizeGroup(group: string): string {\n let sanitized = group.replace(/[^a-zA-Z0-9]/g, '_');\n if (/^[0-9]/.test(sanitized)) {\n sanitized = '_' + sanitized;\n }\n return sanitized;\n}\n\nfunction pascalize(snakeCase: string): string {\n return snakeCase\n .split('_')\n .filter((segment) => segment.length > 0)\n .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))\n .join('');\n}\n\nexport function buildGraphQLInputTypeName(\n apiGroup: string | undefined,\n version: string | undefined,\n entity: string,\n): string {\n let prefix: string;\n\n if (apiGroup && version) {\n prefix = pascalize(sanitizeGroup(apiGroup) + '_' + version);\n } else if (apiGroup) {\n prefix = pascalize(sanitizeGroup(apiGroup));\n } else if (version) {\n prefix = pascalize('_' + version);\n } else {\n return `${entity}_Input`;\n }\n\n return `${prefix}${entity}_Input`;\n}\n","export function buildResourcePath(\n input: {\n apiGroup?: string | undefined;\n entity: string;\n version?: string | undefined;\n },\n separator: string = '_',\n): string {\n return [input.apiGroup, input.version, input.entity]\n .filter((p): p is string => !!p)\n .join(separator);\n}\n","import { PlatformMeshFieldDefinition } from '@platform-mesh/portal-ui-lib/models';\n\n/** Flattens nested `propertyCollection` trees into a list of leaf field definitions. */\nexport function flattenFieldTree(\n fields: readonly PlatformMeshFieldDefinition[] | undefined,\n): PlatformMeshFieldDefinition[] {\n const result: PlatformMeshFieldDefinition[] = [];\n for (const field of fields ?? []) {\n if (field.propertyCollection?.length) {\n result.push(...flattenFieldTree(field.propertyCollection));\n continue;\n }\n result.push(field);\n }\n return result;\n}\n","import { flattenFieldTree } from './flatten-field-tree';\nimport { PlatformMeshFieldDefinition } from '@platform-mesh/portal-ui-lib/models';\n\nexport type GenerateGraphQLFieldsOptions = {\n /** Omit fields marked writeOnly (for queries/mutation return selections). */\n forRead?: boolean;\n};\n\n/** Builds GraphQL field selections for reads, omitting write-only secrets. */\nexport const generateGraphQLReadFields = (\n uiFields: readonly PlatformMeshFieldDefinition[],\n): any[] => generateGraphQLFields(uiFields, { forRead: true });\n\nexport const generateGraphQLFields = (\n uiFields: readonly PlatformMeshFieldDefinition[],\n options: GenerateGraphQLFieldsOptions = {},\n): any[] => {\n const graphQLFields: any[] = [];\n const flattened = flattenFieldTree(uiFields);\n const fields = options.forRead\n ? flattened.filter((field) => !field.writeOnly)\n : flattened;\n fields.map((field) => {\n if (field.property instanceof Array) {\n field.property.map((property) => generate(property, graphQLFields));\n } else {\n generate(field.property, graphQLFields);\n }\n });\n return graphQLFields;\n};\n\nconst generate = (root: string | undefined, fields: any = []) => {\n if (!root) {\n return [];\n }\n\n const paths = root.split('.');\n\n for (const part of paths) {\n if (paths.length === 1) {\n fields.push(part);\n return fields;\n }\n\n fields.push({\n [part]: [...generate(paths.splice(1).join('.'))],\n });\n\n return fields;\n }\n};\n","import {\n PropertyField,\n TransformType,\n} from '@platform-mesh/portal-ui-lib/models';\nimport { JSONPath } from 'jsonpath-plus';\n\nexport const getResourceValueByJsonPath = <T>(\n resource: T,\n field: {\n jsonPathExpression?: string;\n property?: string | string[];\n propertyField?: PropertyField;\n },\n) => {\n const property = field.jsonPathExpression || field.property;\n if (!property) {\n return undefined;\n }\n\n if (property instanceof Array) {\n console.error(\n `Property defined as an array: ${JSON.stringify(property)}, provide \"jsonPathExpression\" field to properly ready resource value`,\n );\n return undefined;\n }\n\n const prefix = property.startsWith('$.') ? '' : '$.';\n const queryResult = JSONPath({\n path: `${prefix}${property}`,\n json: resource as object,\n });\n const value = queryResult.length ? queryResult[0] : undefined;\n\n if (value && field.propertyField) {\n return executeTransform(\n value[field.propertyField.key],\n field.propertyField.transform,\n );\n }\n\n return value;\n};\n\nconst executeTransform = (\n value: string | undefined,\n transform: TransformType[] | undefined,\n): string | undefined => {\n if (value == null || transform == null || !transform.length) return value;\n\n return transform.reduce((acc, t) => {\n if (acc == null) return acc;\n\n switch (t) {\n case 'uppercase':\n return acc.toUpperCase();\n case 'lowercase':\n return acc.toLowerCase();\n case 'capitalize': {\n const str = String(acc);\n return str.length ? str.charAt(0).toUpperCase() + str.slice(1) : str;\n }\n case 'decode': {\n try {\n return decodeBase64(acc);\n } catch {\n return acc;\n }\n }\n case 'encode': {\n try {\n return encodeBase64(acc);\n } catch {\n return acc;\n }\n }\n default:\n return acc;\n }\n }, value);\n};\n\nexport const encodeBase64 = (str: string): string => {\n try {\n const utf8Bytes = new TextEncoder().encode(str);\n const binaryString = Array.from(utf8Bytes, (byte) =>\n String.fromCharCode(byte),\n ).join('');\n return btoa(binaryString);\n } catch (error) {\n console.error('Base64 encoding failed:', error);\n throw new Error('Failed to encode string to Base64');\n }\n};\n\nexport const decodeBase64 = (base64: string): string => {\n try {\n const binaryString = atob(base64);\n const bytes = Uint8Array.from(binaryString, (char) => char.charCodeAt(0));\n return new TextDecoder().decode(bytes);\n } catch (error) {\n console.error('Base64 decoding failed:', error);\n throw new Error('Failed to decode Base64 string');\n }\n};\n","import { getResourceValueByJsonPath } from './resource-field-by-path';\nimport { Resource } from '@platform-mesh/portal-ui-lib/models';\n\nexport const getValueByPath = <T extends object, R = unknown>(\n obj: T,\n path: string,\n): R | undefined => {\n return getResourceValueByJsonPath(obj as Resource, {\n jsonPathExpression: path,\n });\n};\n","import { InstancePermission } from '@platform-mesh/portal-ui-lib/models';\n\nexport const permissionKey = (\n instance: Partial<Omit<InstancePermission, 'actions'>>,\n): string =>\n [instance.resource, instance.namespace, instance.name]\n .filter(Boolean)\n .join('/');\n","export const isLocalSetup = () => {\n return (\n window.location.hostname.includes('localhost') ||\n window.location.hostname.includes('portal.dev.local')\n );\n};\n","import { NodeContext } from '@openmfp/portal-ui-lib';\n\nexport function isNamespacedResource(nodeContext: Partial<NodeContext>) {\n return nodeContext?.resourceDefinition?.scope === 'Namespaced';\n}\n","import {\n Resource,\n ResourceOperationTypeMap,\n ResourceSubscriptionResult,\n} from '@platform-mesh/portal-ui-lib/models';\n\nexport interface MergeListWithSubscriptionResultOptions<T> {\n getItemKey: (item: T) => string | undefined;\n mapSubscriptionObjectToItem: (object: Resource) => T;\n}\n\nexport function mergeListWithSubscriptionResult<T>(\n items: T[],\n subscriptionResult: ResourceSubscriptionResult | undefined,\n options: MergeListWithSubscriptionResultOptions<T>,\n): T[] {\n if (!subscriptionResult) {\n return items;\n }\n\n const { getItemKey, mapSubscriptionObjectToItem } = options;\n\n const result = new Map<string, T>();\n items.forEach((item) => {\n const key = getItemKey(item);\n if (!key) {\n return;\n }\n result.set(key, item);\n });\n\n const { type, object } = subscriptionResult;\n const mappedObject = mapSubscriptionObjectToItem(object);\n const objectKey = getItemKey(mappedObject);\n if (!objectKey) {\n return items;\n }\n\n if (type === ResourceOperationTypeMap.ADDED) {\n result.set(objectKey, mappedObject);\n } else if (type === ResourceOperationTypeMap.MODIFIED) {\n if (result.has(objectKey)) {\n result.set(objectKey, mappedObject);\n }\n } else if (type === ResourceOperationTypeMap.DELETED) {\n result.delete(objectKey);\n }\n\n return [...result.values()];\n}\n","export const parseRawGqlQueryToFields = (s: string): any[] => {\n const tokens = s.replace(/[{}]/g, ' $& ').trim().split(/\\s+/);\n const root: any[] = [];\n const stack: any[][] = [root];\n\n for (let i = 0; i < tokens.length; i++) {\n const v = tokens[i];\n\n if (v === '{') continue;\n if (v === '}') {\n stack.pop();\n continue;\n }\n\n if (tokens[i + 1] === '{') {\n const node = { [v]: [] };\n stack.at(-1)?.push(node);\n stack.push(node[v]);\n } else {\n stack.at(-1)?.push(v);\n }\n }\n\n return root;\n};\n","/**\n * Tier-1 resource-level permission check (fail-open).\n *\n * Returns true when the verb is granted for the resource, OR when no\n * permissions were fetched for the resource at all (no entry in\n * portalPermissions → we don't gate). Returns false ONLY when permissions\n * WERE fetched for the resource and the verb is absent.\n */\nexport const resourceActionAllowed = (\n portalPermissions: { [key: string]: string[] } | undefined,\n resource: string | undefined,\n verb: string,\n): boolean => portalPermissions?.[resource ?? '']?.includes(verb) ?? true;\n","export function stripTypename<T>(value: T): T {\n if (Array.isArray(value)) {\n return (value as unknown as any[]).map((v) => stripTypename(v)) as T;\n }\n if (value && typeof value === 'object') {\n const { __typename, ...rest } = value as Record<string, unknown> & {\n __typename?: string;\n };\n for (const k of Object.keys(rest)) {\n // @ts-ignore - rest is an indexable object\n rest[k] = stripTypename((rest as any)[k]);\n }\n return rest as T;\n }\n return value;\n}\n","export function deletePropertyByPath<T extends Record<string, unknown>>(\n object: T,\n path: string,\n): T {\n const segments = path.split('.').filter(Boolean);\n if (segments.length === 0) {\n return object;\n }\n\n let current: Record<string, unknown> = object;\n\n for (let i = 0; i < segments.length - 1; i += 1) {\n const key = segments[i];\n const next = current[key];\n if (next == null || typeof next !== 'object') {\n return object;\n }\n current = next as Record<string, unknown>;\n }\n\n delete current[segments[segments.length - 1]];\n return object;\n}\n","export function setPropertyByPath<T extends Record<string, any>>(\n object: T,\n path: string,\n value: unknown,\n): T {\n const segments = path.split('.').filter(Boolean);\n if (segments.length === 0) {\n return object;\n }\n\n let current: Record<string, any> = object;\n\n for (let i = 0; i < segments.length; i += 1) {\n const key = segments[i];\n if (i === segments.length - 1) {\n current[key] = value;\n break;\n }\n\n const existing = current[key];\n\n if (\n existing === undefined ||\n existing === null ||\n typeof existing !== 'object'\n ) {\n current[key] = {};\n }\n\n current = current[key];\n }\n\n return object;\n}\n","/**\n * Navigates to a path via Luigi Core by posting a `luigi.navigation.open` message directly,\n * bypassing the public `LuigiCoreService.navigation().navigate()` API.\n *\n * This is intentional: the public API always calls `history.pushState`, with no way to\n * request `replaceState` instead. Luigi's internal `preventHistoryEntry` flag is read by\n * the Svelte shell and results in `history.replaceState`, but it is not exposed through\n * `linkManager.navigate()`. Posting the message directly lets us set that flag until\n * Luigi exposes it as a first-class option in its public navigation API.\n */\nexport function luigiNavigateTo(path: string, replaceHistory = false): void {\n window.postMessage(\n {\n msg: 'luigi.navigation.open',\n params: {\n link: path,\n relative: false,\n preserveView: false,\n nodeParams: {},\n errorSkipNavigation: false,\n fromContext: null,\n fromParent: false,\n fromClosestContext: false,\n preventHistoryEntry: replaceHistory,\n },\n },\n '*',\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\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AG,KAAK,EAAA;IAClE,MAAM,CAAC,WAAW,CAChB;AACE,QAAA,GAAG,EAAE,uBAAuB;AAC5B,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,IAAI;AACV,YAAA,QAAQ,EAAE,KAAK;AACf,YAAA,YAAY,EAAE,KAAK;AACnB,YAAA,UAAU,EAAE,EAAE;AACd,YAAA,mBAAmB,EAAE,KAAK;AAC1B,YAAA,WAAW,EAAE,IAAI;AACjB,YAAA,UAAU,EAAE,KAAK;AACjB,YAAA,kBAAkB,EAAE,KAAK;AACzB,YAAA,mBAAmB,EAAE,cAAc;AACpC,SAAA;KACF,EACD,GAAG,CACJ;AACH;;AC5BA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"platform-mesh-portal-ui-lib-utils.mjs","sources":["../../projects/lib/utils/utils/build-graphql-input-type-name.ts","../../projects/lib/utils/utils/build-resource-list-operation.ts","../../projects/lib/utils/utils/flatten-field-tree.ts","../../projects/lib/utils/utils/columns-to-gql-fields.ts","../../projects/lib/utils/utils/resource-field-by-path.ts","../../projects/lib/utils/utils/get-value-by-path.ts","../../projects/lib/utils/utils/instance-permission-key.ts","../../projects/lib/utils/utils/is-local-setup.ts","../../projects/lib/utils/utils/is-namespaced-resource.ts","../../projects/lib/utils/utils/merge-list-with-subscription-result.ts","../../projects/lib/utils/utils/parse-raw-gql-query.ts","../../projects/lib/utils/utils/resource-action-allowed.ts","../../projects/lib/utils/utils/resource-sanitizer.ts","../../projects/lib/utils/utils/delete-property-by-path.ts","../../projects/lib/utils/utils/set-property-by-path.ts","../../projects/lib/utils/platform-mesh-portal-ui-lib-utils.ts"],"sourcesContent":["function sanitizeGroup(group: string): string {\n let sanitized = group.replace(/[^a-zA-Z0-9]/g, '_');\n if (/^[0-9]/.test(sanitized)) {\n sanitized = '_' + sanitized;\n }\n return sanitized;\n}\n\nfunction pascalize(snakeCase: string): string {\n return snakeCase\n .split('_')\n .filter((segment) => segment.length > 0)\n .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))\n .join('');\n}\n\nexport function buildGraphQLInputTypeName(\n apiGroup: string | undefined,\n version: string | undefined,\n entity: string,\n): string {\n let prefix: string;\n\n if (apiGroup && version) {\n prefix = pascalize(sanitizeGroup(apiGroup) + '_' + version);\n } else if (apiGroup) {\n prefix = pascalize(sanitizeGroup(apiGroup));\n } else if (version) {\n prefix = pascalize('_' + version);\n } else {\n return `${entity}_Input`;\n }\n\n return `${prefix}${entity}_Input`;\n}\n","export function buildResourcePath(\n input: {\n apiGroup?: string | undefined;\n entity: string;\n version?: string | undefined;\n },\n separator: string = '_',\n): string {\n return [input.apiGroup, input.version, input.entity]\n .filter((p): p is string => !!p)\n .join(separator);\n}\n","import { PlatformMeshFieldDefinition } from '@platform-mesh/portal-ui-lib/models';\n\n/** Flattens nested `propertyCollection` trees into a list of leaf field definitions. */\nexport function flattenFieldTree(\n fields: readonly PlatformMeshFieldDefinition[] | undefined,\n): PlatformMeshFieldDefinition[] {\n const result: PlatformMeshFieldDefinition[] = [];\n for (const field of fields ?? []) {\n if (field.propertyCollection?.length) {\n result.push(...flattenFieldTree(field.propertyCollection));\n continue;\n }\n result.push(field);\n }\n return result;\n}\n","import { flattenFieldTree } from './flatten-field-tree';\nimport { PlatformMeshFieldDefinition } from '@platform-mesh/portal-ui-lib/models';\n\nexport type GenerateGraphQLFieldsOptions = {\n /** Omit fields marked writeOnly (for queries/mutation return selections). */\n forRead?: boolean;\n};\n\n/** Builds GraphQL field selections for reads, omitting write-only secrets. */\nexport const generateGraphQLReadFields = (\n uiFields: readonly PlatformMeshFieldDefinition[],\n): any[] => generateGraphQLFields(uiFields, { forRead: true });\n\nexport const generateGraphQLFields = (\n uiFields: readonly PlatformMeshFieldDefinition[],\n options: GenerateGraphQLFieldsOptions = {},\n): any[] => {\n const graphQLFields: any[] = [];\n const flattened = flattenFieldTree(uiFields);\n const fields = options.forRead\n ? flattened.filter((field) => !field.writeOnly)\n : flattened;\n fields.map((field) => {\n if (field.property instanceof Array) {\n field.property.map((property) => generate(property, graphQLFields));\n } else {\n generate(field.property, graphQLFields);\n }\n });\n return graphQLFields;\n};\n\nconst generate = (root: string | undefined, fields: any = []) => {\n if (!root) {\n return [];\n }\n\n const paths = root.split('.');\n\n for (const part of paths) {\n if (paths.length === 1) {\n fields.push(part);\n return fields;\n }\n\n fields.push({\n [part]: [...generate(paths.splice(1).join('.'))],\n });\n\n return fields;\n }\n};\n","import {\n PropertyField,\n TransformType,\n} from '@platform-mesh/portal-ui-lib/models';\nimport { JSONPath } from 'jsonpath-plus';\n\nexport const getResourceValueByJsonPath = <T>(\n resource: T,\n field: {\n jsonPathExpression?: string;\n property?: string | string[];\n propertyField?: PropertyField;\n },\n) => {\n const property = field.jsonPathExpression || field.property;\n if (!property) {\n return undefined;\n }\n\n if (property instanceof Array) {\n console.error(\n `Property defined as an array: ${JSON.stringify(property)}, provide \"jsonPathExpression\" field to properly ready resource value`,\n );\n return undefined;\n }\n\n const prefix = property.startsWith('$.') ? '' : '$.';\n const queryResult = JSONPath({\n path: `${prefix}${property}`,\n json: resource as object,\n });\n const value = queryResult.length ? queryResult[0] : undefined;\n\n if (value && field.propertyField) {\n return executeTransform(\n value[field.propertyField.key],\n field.propertyField.transform,\n );\n }\n\n return value;\n};\n\nconst executeTransform = (\n value: string | undefined,\n transform: TransformType[] | undefined,\n): string | undefined => {\n if (value == null || transform == null || !transform.length) return value;\n\n return transform.reduce((acc, t) => {\n if (acc == null) return acc;\n\n switch (t) {\n case 'uppercase':\n return acc.toUpperCase();\n case 'lowercase':\n return acc.toLowerCase();\n case 'capitalize': {\n const str = String(acc);\n return str.length ? str.charAt(0).toUpperCase() + str.slice(1) : str;\n }\n case 'decode': {\n try {\n return decodeBase64(acc);\n } catch {\n return acc;\n }\n }\n case 'encode': {\n try {\n return encodeBase64(acc);\n } catch {\n return acc;\n }\n }\n default:\n return acc;\n }\n }, value);\n};\n\nexport const encodeBase64 = (str: string): string => {\n try {\n const utf8Bytes = new TextEncoder().encode(str);\n const binaryString = Array.from(utf8Bytes, (byte) =>\n String.fromCharCode(byte),\n ).join('');\n return btoa(binaryString);\n } catch (error) {\n console.error('Base64 encoding failed:', error);\n throw new Error('Failed to encode string to Base64');\n }\n};\n\nexport const decodeBase64 = (base64: string): string => {\n try {\n const binaryString = atob(base64);\n const bytes = Uint8Array.from(binaryString, (char) => char.charCodeAt(0));\n return new TextDecoder().decode(bytes);\n } catch (error) {\n console.error('Base64 decoding failed:', error);\n throw new Error('Failed to decode Base64 string');\n }\n};\n","import { getResourceValueByJsonPath } from './resource-field-by-path';\nimport { Resource } from '@platform-mesh/portal-ui-lib/models';\n\nexport const getValueByPath = <T extends object, R = unknown>(\n obj: T,\n path: string,\n): R | undefined => {\n return getResourceValueByJsonPath(obj as Resource, {\n jsonPathExpression: path,\n });\n};\n","import { InstancePermission } from '@platform-mesh/portal-ui-lib/models';\n\nexport const permissionKey = (\n instance: Partial<Omit<InstancePermission, 'actions'>>,\n): string =>\n [instance.resource, instance.namespace, instance.name]\n .filter(Boolean)\n .join('/');\n","export const isLocalSetup = () => {\n return (\n window.location.hostname.includes('localhost') ||\n window.location.hostname.includes('portal.dev.local')\n );\n};\n","import { NodeContext } from '@openmfp/portal-ui-lib';\n\nexport function isNamespacedResource(nodeContext: Partial<NodeContext>) {\n return nodeContext?.resourceDefinition?.scope === 'Namespaced';\n}\n","import {\n Resource,\n ResourceOperationTypeMap,\n ResourceSubscriptionResult,\n} from '@platform-mesh/portal-ui-lib/models';\n\nexport interface MergeListWithSubscriptionResultOptions<T> {\n getItemKey: (item: T) => string | undefined;\n mapSubscriptionObjectToItem: (object: Resource) => T;\n}\n\nexport function mergeListWithSubscriptionResult<T>(\n items: T[],\n subscriptionResult: ResourceSubscriptionResult | undefined,\n options: MergeListWithSubscriptionResultOptions<T>,\n): T[] {\n if (!subscriptionResult) {\n return items;\n }\n\n const { getItemKey, mapSubscriptionObjectToItem } = options;\n\n const result = new Map<string, T>();\n items.forEach((item) => {\n const key = getItemKey(item);\n if (!key) {\n return;\n }\n result.set(key, item);\n });\n\n const { type, object } = subscriptionResult;\n const mappedObject = mapSubscriptionObjectToItem(object);\n const objectKey = getItemKey(mappedObject);\n if (!objectKey) {\n return items;\n }\n\n if (type === ResourceOperationTypeMap.ADDED) {\n result.set(objectKey, mappedObject);\n } else if (type === ResourceOperationTypeMap.MODIFIED) {\n if (result.has(objectKey)) {\n result.set(objectKey, mappedObject);\n }\n } else if (type === ResourceOperationTypeMap.DELETED) {\n result.delete(objectKey);\n }\n\n return [...result.values()];\n}\n","export const parseRawGqlQueryToFields = (s: string): any[] => {\n const tokens = s.replace(/[{}]/g, ' $& ').trim().split(/\\s+/);\n const root: any[] = [];\n const stack: any[][] = [root];\n\n for (let i = 0; i < tokens.length; i++) {\n const v = tokens[i];\n\n if (v === '{') continue;\n if (v === '}') {\n stack.pop();\n continue;\n }\n\n if (tokens[i + 1] === '{') {\n const node = { [v]: [] };\n stack.at(-1)?.push(node);\n stack.push(node[v]);\n } else {\n stack.at(-1)?.push(v);\n }\n }\n\n return root;\n};\n","/**\n * Tier-1 resource-level permission check (fail-open).\n *\n * Returns true when the verb is granted for the resource, OR when no\n * permissions were fetched for the resource at all (no entry in\n * portalPermissions → we don't gate). Returns false ONLY when permissions\n * WERE fetched for the resource and the verb is absent.\n */\nexport const resourceActionAllowed = (\n portalPermissions: { [key: string]: string[] } | undefined,\n resource: string | undefined,\n verb: string,\n): boolean => portalPermissions?.[resource ?? '']?.includes(verb) ?? true;\n","export function stripTypename<T>(value: T): T {\n if (Array.isArray(value)) {\n return (value as unknown as any[]).map((v) => stripTypename(v)) as T;\n }\n if (value && typeof value === 'object') {\n const { __typename, ...rest } = value as Record<string, unknown> & {\n __typename?: string;\n };\n for (const k of Object.keys(rest)) {\n // @ts-ignore - rest is an indexable object\n rest[k] = stripTypename((rest as any)[k]);\n }\n return rest as T;\n }\n return value;\n}\n","export function deletePropertyByPath<T extends Record<string, unknown>>(\n object: T,\n path: string,\n): T {\n const segments = path.split('.').filter(Boolean);\n if (segments.length === 0) {\n return object;\n }\n\n let current: Record<string, unknown> = object;\n\n for (let i = 0; i < segments.length - 1; i += 1) {\n const key = segments[i];\n const next = current[key];\n if (next == null || typeof next !== 'object') {\n return object;\n }\n current = next as Record<string, unknown>;\n }\n\n delete current[segments[segments.length - 1]];\n return object;\n}\n","export function setPropertyByPath<T extends Record<string, any>>(\n object: T,\n path: string,\n value: unknown,\n): T {\n const segments = path.split('.').filter(Boolean);\n if (segments.length === 0) {\n return object;\n }\n\n let current: Record<string, any> = object;\n\n for (let i = 0; i < segments.length; i += 1) {\n const key = segments[i];\n if (i === segments.length - 1) {\n current[key] = value;\n break;\n }\n\n const existing = current[key];\n\n if (\n existing === undefined ||\n existing === null ||\n typeof existing !== 'object'\n ) {\n current[key] = {};\n }\n\n current = current[key];\n }\n\n return object;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAAA,SAAS,aAAa,CAAC,KAAa,EAAA;IAClC,IAAI,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,eAAe,EAAE,GAAG,CAAC;AACnD,IAAA,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;AAC5B,QAAA,SAAS,GAAG,GAAG,GAAG,SAAS;IAC7B;AACA,IAAA,OAAO,SAAS;AAClB;AAEA,SAAS,SAAS,CAAC,SAAiB,EAAA;AAClC,IAAA,OAAO;SACJ,KAAK,CAAC,GAAG;SACT,MAAM,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,MAAM,GAAG,CAAC;SACtC,GAAG,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;SACnE,IAAI,CAAC,EAAE,CAAC;AACb;SAEgB,yBAAyB,CACvC,QAA4B,EAC5B,OAA2B,EAC3B,MAAc,EAAA;AAEd,I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,EAAE,CAAC,IAAI,CAAC,EAAE;AAC3C,QAAA,MAAM,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAC;QACvB,IAAI,CAAC,KAAK,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;AAC7B,YAAA,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK;YACpB;QACF;AAEA,QAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;QAE7B,IACE,QAAQ,KAAK,SAAS;AACtB,YAAA,QAAQ,KAAK,IAAI;AACjB,YAAA,OAAO,QAAQ,KAAK,QAAQ,EAC5B;AACA,YAAA,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE;QACnB;AAEA,QAAA,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC;IACxB;AAEA,IAAA,OAAO,MAAM;AACf;;ACjCA;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NodeContext, LuigiNode, EntityDefinition, CustomGlobalNodesService, HeaderBarConfigService, HeaderBarConfig, LuigiExtendedGlobalContextConfigService, NavigationRedirectStrategy, NodeChangeHookConfigService, NodeContextProcessingService, RoutingConfigService, UserProfileConfigService, UserProfile, CustomMessageListener } from '@openmfp/portal-ui-lib';
|
|
1
|
+
import { NodeContext, LuigiNode, EntityDefinition, CustomGlobalNodesService, CustomNodeProcessingService, HeaderBarConfigService, HeaderBarConfig, LuigiExtendedGlobalContextConfigService, NavigationRedirectStrategy, NodeChangeHookConfigService, NodeContextProcessingService, RoutingConfigService, UserProfileConfigService, UserProfile, CustomMessageListener, ErrorComponentConfig } from '@openmfp/portal-ui-lib';
|
|
2
2
|
import { ResourceDefinition, Permission } from '@platform-mesh/portal-ui-lib/models';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
|
|
@@ -19,6 +19,7 @@ interface PortalNodeContext extends NodeContext {
|
|
|
19
19
|
translationTable?: any;
|
|
20
20
|
namespaceId?: string;
|
|
21
21
|
namespaces?: string[];
|
|
22
|
+
entityErrorCode?: number;
|
|
22
23
|
entityName?: string;
|
|
23
24
|
entityKind?: string;
|
|
24
25
|
entityId?: string;
|
|
@@ -34,6 +35,7 @@ interface PortalLuigiNode extends LuigiNode {
|
|
|
34
35
|
defineEntity?: PMEntityDefinition;
|
|
35
36
|
context: PortalNodeContext;
|
|
36
37
|
parent?: PortalLuigiNode;
|
|
38
|
+
keepSelectedForChildren?: boolean;
|
|
37
39
|
}
|
|
38
40
|
interface PMEntityDefinition extends EntityDefinition {
|
|
39
41
|
type?: string;
|
|
@@ -46,6 +48,19 @@ declare class CustomGlobalNodesServiceImpl implements CustomGlobalNodesService {
|
|
|
46
48
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
47
49
|
}
|
|
48
50
|
|
|
51
|
+
declare class CustomNodeProcessingServiceImpl implements CustomNodeProcessingService {
|
|
52
|
+
private luigiNodesService;
|
|
53
|
+
private entityChildrenWrappers;
|
|
54
|
+
private failedEntityNodeStates;
|
|
55
|
+
processNode(ctx: PortalNodeContext, node: PortalLuigiNode): Promise<PortalLuigiNode>;
|
|
56
|
+
private wrapEntityChildren;
|
|
57
|
+
private resolveEntityChildren;
|
|
58
|
+
private restoreEntityNode;
|
|
59
|
+
private showErrorOnEntityNode;
|
|
60
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CustomNodeProcessingServiceImpl, never>;
|
|
61
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
62
|
+
}
|
|
63
|
+
|
|
49
64
|
declare class HeaderBarConfigServiceImpl implements HeaderBarConfigService {
|
|
50
65
|
private configService;
|
|
51
66
|
private namespaceSelectionRendererService;
|
|
@@ -89,8 +104,6 @@ declare class NodeContextProcessingServiceImpl implements NodeContextProcessingS
|
|
|
89
104
|
private namespaceService;
|
|
90
105
|
private namespacedResourceSelectionService;
|
|
91
106
|
processNodeContext(dynamicEntityId: string, entityNode: PortalLuigiNode, ctx: PortalNodeContext): Promise<void>;
|
|
92
|
-
private abandonPendingNavigation;
|
|
93
|
-
private isLocationWithinEntity;
|
|
94
107
|
private addFieldsToContext;
|
|
95
108
|
private addNamespacesToContext;
|
|
96
109
|
private addFieldsToContextFromAccountInfo;
|
|
@@ -130,4 +143,6 @@ declare class OpenPersistentPanelListener implements CustomMessageListener {
|
|
|
130
143
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
131
144
|
}
|
|
132
145
|
|
|
133
|
-
|
|
146
|
+
declare const errorComponentConfig: ErrorComponentConfig;
|
|
147
|
+
|
|
148
|
+
export { CustomGlobalNodesServiceImpl, CustomNodeProcessingServiceImpl, CustomRoutingConfigServiceImpl, HeaderBarConfigServiceImpl, LuigiExtendedGlobalContextConfigServiceImpl, NavigationRedirectStrategyServiceImpl, NodeChangeHookConfigServiceImpl, NodeContextProcessingServiceImpl, OpenPersistentPanelListener, UserProfileConfigServiceImpl, errorComponentConfig };
|
|
@@ -229,11 +229,7 @@ declare class NamespaceService {
|
|
|
229
229
|
declare class ErrorHandlerService {
|
|
230
230
|
private luigiCoreService;
|
|
231
231
|
handleError(error: any, msg?: string): void;
|
|
232
|
-
|
|
233
|
-
redirectToErrorPage(error: any, replaceHistory?: boolean): boolean;
|
|
234
|
-
private navigateToErrorPage;
|
|
235
|
-
handleResourcePendingDeletion(_resource: Resource): void;
|
|
236
|
-
private isNotFound;
|
|
232
|
+
errorCode(error: any): number;
|
|
237
233
|
private isUnauthorizedAccess;
|
|
238
234
|
static ɵfac: i0.ɵɵFactoryDeclaration<ErrorHandlerService, never>;
|
|
239
235
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
@@ -242,14 +238,12 @@ declare class ErrorHandlerService {
|
|
|
242
238
|
declare class OrganizationReadyService {
|
|
243
239
|
private configService;
|
|
244
240
|
private envConfigService;
|
|
245
|
-
private luigiCoreService;
|
|
246
241
|
private logicalClusterService;
|
|
247
242
|
private authService;
|
|
248
243
|
private isReady;
|
|
249
|
-
private
|
|
250
|
-
|
|
251
|
-
private
|
|
252
|
-
checkOrganizationReady(): void;
|
|
244
|
+
private pendingCheck?;
|
|
245
|
+
isOrganizationReady(): Promise<boolean>;
|
|
246
|
+
private readOrganizationReady;
|
|
253
247
|
static ɵfac: i0.ɵɵFactoryDeclaration<OrganizationReadyService, never>;
|
|
254
248
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
255
249
|
}
|
|
@@ -62,17 +62,5 @@ declare function flattenFieldTree(fields: readonly PlatformMeshFieldDefinition[]
|
|
|
62
62
|
|
|
63
63
|
declare function setPropertyByPath<T extends Record<string, any>>(object: T, path: string, value: unknown): T;
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
* Navigates to a path via Luigi Core by posting a `luigi.navigation.open` message directly,
|
|
67
|
-
* bypassing the public `LuigiCoreService.navigation().navigate()` API.
|
|
68
|
-
*
|
|
69
|
-
* This is intentional: the public API always calls `history.pushState`, with no way to
|
|
70
|
-
* request `replaceState` instead. Luigi's internal `preventHistoryEntry` flag is read by
|
|
71
|
-
* the Svelte shell and results in `history.replaceState`, but it is not exposed through
|
|
72
|
-
* `linkManager.navigate()`. Posting the message directly lets us set that flag until
|
|
73
|
-
* Luigi exposes it as a first-class option in its public navigation API.
|
|
74
|
-
*/
|
|
75
|
-
declare function luigiNavigateTo(path: string, replaceHistory?: boolean): void;
|
|
76
|
-
|
|
77
|
-
export { buildGraphQLInputTypeName, buildResourcePath, decodeBase64, deletePropertyByPath, encodeBase64, flattenFieldTree, generateGraphQLFields, generateGraphQLReadFields, getResourceValueByJsonPath, getValueByPath, isLocalSetup, isNamespacedResource, luigiNavigateTo, mergeListWithSubscriptionResult, parseRawGqlQueryToFields, permissionKey, resourceActionAllowed, setPropertyByPath, stripTypename };
|
|
65
|
+
export { buildGraphQLInputTypeName, buildResourcePath, decodeBase64, deletePropertyByPath, encodeBase64, flattenFieldTree, generateGraphQLFields, generateGraphQLReadFields, getResourceValueByJsonPath, getValueByPath, isLocalSetup, isNamespacedResource, mergeListWithSubscriptionResult, parseRawGqlQueryToFields, permissionKey, resourceActionAllowed, setPropertyByPath, stripTypename };
|
|
78
66
|
export type { GenerateGraphQLFieldsOptions, MergeListWithSubscriptionResultOptions };
|