PhoenixKitCatalogue.Paths (PhoenixKitCatalogue v0.1.17)

Copy Markdown View Source

Centralized path helpers for the Catalogue module.

All paths go through PhoenixKit.Utils.Routes.path/1 for prefix/locale handling.

Summary

Functions

Signed URL under which the raw PDF binary is served. Resolves via core's Storage.URLSigner — the host app already routes /file/:file_uuid/:variant/:token through core's FileController.

Returns the PDF.js viewer URL with the file pre-bound and the optional page fragment set. The viewer assets are vendored under priv/static/pdfjs/ and served at /_pdfjs/ by the host endpoint's Plug.Static mount.

Functions

catalogue_detail(uuid)

catalogue_edit(uuid)

catalogue_new()

category_edit(uuid)

category_new(catalogue_uuid)

events()

import()

index()

item_edit(uuid)

item_new(catalogue_uuid)

manufacturer_edit(uuid)

manufacturer_new()

manufacturers()

pdf_detail(uuid)

@spec pdf_detail(Ecto.UUID.t()) :: String.t()

pdf_detail(uuid, page)

@spec pdf_detail(Ecto.UUID.t(), pos_integer()) :: String.t()

pdf_file(map)

@spec pdf_file(map()) :: String.t()

Signed URL under which the raw PDF binary is served. Resolves via core's Storage.URLSigner — the host app already routes /file/:file_uuid/:variant/:token through core's FileController.

pdf_viewer(pdf)

@spec pdf_viewer(map()) :: String.t()

pdf_viewer(pdf, page)

@spec pdf_viewer(map(), pos_integer()) :: String.t()

Returns the PDF.js viewer URL with the file pre-bound and the optional page fragment set. The viewer assets are vendored under priv/static/pdfjs/ and served at /_pdfjs/ by the host endpoint's Plug.Static mount.

The signed file URL is encoded via URI.encode_www_form/1 so reserved characters in the underlying URL (?, &, =, #, spaces) become percent-escaped query-param-safe bytes — URI.encode/1 alone does NOT escape those, which would corrupt the viewer's own #page=N fragment if the file URL ever carries them.

pdfs()

@spec pdfs() :: String.t()

supplier_edit(uuid)

supplier_new()

suppliers()