Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@deepsel/cms-utils

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@deepsel/cms-utils - npm Package Compare versions

Comparing version
1.9.7
to
1.9.8
+8
-1
dist/common/utils/index.d.ts

@@ -14,3 +14,3 @@ export * from './cookieUtils.js';

* Builds the relative URL for an attachment file (no host)
* @param name - The attachment filename
* @param name - The attachment filename (AttachmentLocaleVersionModel.name)
* @returns Relative URL to serve the attachment, or empty string if name is falsy

@@ -20,2 +20,9 @@ */

/**
* Builds the relative URL for an attachment by AttachmentModel.name with optional locale (no host)
* @param name - The attachment name (AttachmentModel.name)
* @param locale - Optional locale ISO code (e.g. "en", "fr"); defaults to org default on the backend
* @returns Relative URL to serve the attachment, or empty string if name is falsy
*/
export declare function getAttachmentByNameRelativeUrl(name: string, locale?: string): string;
/**
* Extracts the filename from an attachment serve URL

@@ -22,0 +29,0 @@ * @param url - The attachment URL (e.g. "https://api.example.com/attachment/serve/file.png")

@@ -16,3 +16,3 @@ export * from './cookieUtils.js';

* Builds the relative URL for an attachment file (no host)
* @param name - The attachment filename
* @param name - The attachment filename (AttachmentLocaleVersionModel.name)
* @returns Relative URL to serve the attachment, or empty string if name is falsy

@@ -24,2 +24,14 @@ */

/**
* Builds the relative URL for an attachment by AttachmentModel.name with optional locale (no host)
* @param name - The attachment name (AttachmentModel.name)
* @param locale - Optional locale ISO code (e.g. "en", "fr"); defaults to org default on the backend
* @returns Relative URL to serve the attachment, or empty string if name is falsy
*/
export function getAttachmentByNameRelativeUrl(name, locale) {
if (!name)
return '';
const base = `/api/v1/attachment/serve-by-name/${name}`;
return locale ? `${base}?locale=${locale}` : base;
}
/**
* Extracts the filename from an attachment serve URL

@@ -26,0 +38,0 @@ * @param url - The attachment URL (e.g. "https://api.example.com/attachment/serve/file.png")

+1
-1
{
"name": "@deepsel/cms-utils",
"version": "1.9.7",
"version": "1.9.8",
"description": "Helper utilities for Deepsel CMS",

@@ -5,0 +5,0 @@ "repository": {