Skip to content

gi-nx


gi-nx / fetchContentPacks

ts
function fetchContentPacks(search?: string, contents?: (
  | number
  | "sections"
  | "usages"
  | "layers"
  | "flows"
  | "blocks"
  | "analytics"
  | "report_builder"
  | "apps"
| "scenarios")[]): Promise<PackFile[]>;

Fetches all available content packs from the server.

Parameters

ParameterTypeDescription
search?stringOptional search string to filter packs by name
contents?( | number | "sections" | "usages" | "layers" | "flows" | "blocks" | "analytics" | "report_builder" | "apps" | "scenarios")[]Optional list of pack content types; only packs containing at least one of these will be returned

Returns

Promise<PackFile[]>

Example

ts
const packs = await fetchContentPacks();
const blockPacks = await fetchContentPacks(undefined, [BLOCKS_IN_BUNDLE]);
const searched = await fetchContentPacks('kitchen');