Protected Optional _configTrait instance configuration.
Protected Readonly _dataProtected _globalWhether this is a global (not bound to any specific schema item) trait instance.
Protected Readonly _graphqlProtected _runtimeProtected Readonly _schemaProtected Optional _typeTrait type.
Protected dbProtected checkProtected createThis internal function is used to create an alias for a tenant.
This is the users tenant id.
This is the url alias.
This is the uuid of the entity.
This is the type of the entity.
Protected deleteThis internal function is used to delete all aliases for a specified entity uuid, its used a DynamoDB GSI to find all the aliases for the entity.
This is the users tenant id.
This is the uuid of the entity.
Extracts the URL part from a string in the format 'uuid#url'.
The input string containing a UUID and a URL separated by '#'.
Protected getAttaches Trait callbacks to schema item hooks.
Protected isMakes this Trait instance global.
If the alias field exists, create the Alias entry as we now have the uuid of the entity that we have created.
The trait data object
The item being created
Datasource wrapper object.
The user context.
Clean up and handle consequences of the alias deletion.
If the alias field has been updated then a new create the Alias entry
Used by traits for non user accessible entities
The item being updated.
Not used
The user context.
Post-view hook implementation, handles replacing the keyed data with the content from the storage engine
The current item being retrieved
Check if the alias has been populated, skip if empty, if not then ensure that the new alias does not conflict with existing ones.
Validate the format and structure of the alias to make sure it conforms to your desired pattern.
Check the DynamoDB table to ensure the alias doesn't already exist for the current tenant.
The trait data.
The user context.
Check if the alias field has been changed, if so:
Validate the format and structure of the alias to make sure it conforms to your desired pattern.
Check the DynamoDB table to ensure the alias doesn't already exist for the current tenant.
The trait data object
The user context.
This method is triggered when a trait callback has been activated
This is the name of the callback function to call.
References to the Graph Hanlder
Request data passed along as part of the request.
Private retrieveThis function is used to retrieve the alias for an item.
void
The item which the alias is being retrieved for
The datasource wrapper object
The user context
Configuration setter.
The new configuration.
This function is used as a resolver for the alias field.
NOTE: This function is not used in the current implementation. It's currently disabled as the postView hook is used to populate the alias, this is due to how the AncestorTrait retrieves data via the findVertex function.
Rest ...__namedParameters: [datasourceWrapper: DataSourceWrapper, data: TraitDataObject<any, any, Promise<any>>]Helper method for wrapping legacy Kosmos traits callbacks.
TODO: Remove this method once all Traits are converted.
Optional callbackName: stringOptional callback name; passing this parameter will additionally wrap the callback into legacy process().
Static traitGenerated using TypeDoc
The URLAlias module manages the lifecycle of an entity's URL aliases. Lifecycle hooks such as:
It provides granular control over alias creation, updates, and deletion. This ensures that each alias remains associated with its intended content while providing flexibility for dynamic URL restructuring.
Usage: