box-node-sdk

MetadataTaxonomiesManager

Create metadata taxonomy

Creates a new metadata taxonomy that can be used in metadata templates.

This operation is performed by calling function createMetadataTaxonomy.

See the endpoint docs at API Reference.

await client.metadataTaxonomies.createMetadataTaxonomy({
  displayName: displayName,
  key: taxonomyKey,
  namespace: namespace,
} satisfies CreateMetadataTaxonomyRequestBody);

Arguments

Returns

This function returns a value of type MetadataTaxonomy.

The schema representing the metadata taxonomy created.

Get metadata taxonomies for namespace

Used to retrieve all metadata taxonomies in a namespace.

This operation is performed by calling function getMetadataTaxonomies.

See the endpoint docs at API Reference.

await client.metadataTaxonomies.getMetadataTaxonomies(namespace);

Arguments

Returns

This function returns a value of type MetadataTaxonomies.

Returns all of the metadata taxonomies within a namespace and their corresponding schema.

Get metadata taxonomy by taxonomy key

Used to retrieve a metadata taxonomy by taxonomy key.

This operation is performed by calling function getMetadataTaxonomyByKey.

See the endpoint docs at API Reference.

await client.metadataTaxonomies.getMetadataTaxonomyByKey(
  namespace,
  taxonomyKey,
);

Arguments

Returns

This function returns a value of type MetadataTaxonomy.

Returns the metadata taxonomy identified by the taxonomy key.

Update metadata taxonomy

Updates an existing metadata taxonomy.

This operation is performed by calling function updateMetadataTaxonomy.

See the endpoint docs at API Reference.

await client.metadataTaxonomies.updateMetadataTaxonomy(namespace, taxonomyKey, {
  displayName: updatedDisplayName,
} satisfies UpdateMetadataTaxonomyRequestBody);

Arguments

Returns

This function returns a value of type MetadataTaxonomy.

The schema representing the updated metadata taxonomy.

Remove metadata taxonomy

Delete a metadata taxonomy. This deletion is permanent and cannot be reverted.

This operation is performed by calling function deleteMetadataTaxonomy.

See the endpoint docs at API Reference.

await client.metadataTaxonomies.deleteMetadataTaxonomy(namespace, taxonomyKey);

Arguments

Returns

This function returns a value of type undefined.

Returns an empty response when the metadata taxonomy is successfully deleted.

Create metadata taxonomy levels

Creates new metadata taxonomy levels.

This operation is performed by calling function createMetadataTaxonomyLevel.

See the endpoint docs at API Reference.

await client.metadataTaxonomies.createMetadataTaxonomyLevel(
  namespace,
  taxonomyKey,
  [
    {
      displayName: 'Continent',
      description: 'Continent Level',
    } satisfies MetadataTaxonomyLevel,
    {
      displayName: 'Country',
      description: 'Country Level',
    } satisfies MetadataTaxonomyLevel,
  ],
);

Arguments

Returns

This function returns a value of type MetadataTaxonomyLevels.

Returns an array of all taxonomy levels.

Update metadata taxonomy level

Updates an existing metadata taxonomy level.

This operation is performed by calling function updateMetadataTaxonomyLevelById.

See the endpoint docs at API Reference.

await client.metadataTaxonomies.updateMetadataTaxonomyLevelById(
  namespace,
  taxonomyKey,
  1,
  {
    displayName: 'Continent UPDATED',
    description: 'Continent Level UPDATED',
  } satisfies UpdateMetadataTaxonomyLevelByIdRequestBody,
);

Arguments

Returns

This function returns a value of type MetadataTaxonomyLevel.

The updated taxonomy level.

Add metadata taxonomy level

Creates a new metadata taxonomy level and appends it to the existing levels. If there are no levels defined yet, this will create the first level.

This operation is performed by calling function addMetadataTaxonomyLevel.

See the endpoint docs at API Reference.

await client.metadataTaxonomies.addMetadataTaxonomyLevel(
  namespace,
  taxonomyKey,
  {
    displayName: 'Region',
    description: 'Region Description',
  } satisfies AddMetadataTaxonomyLevelRequestBody,
);

Arguments

Returns

This function returns a value of type MetadataTaxonomyLevels.

Returns an array of all taxonomy levels.

Delete metadata taxonomy level

Deletes the last level of the metadata taxonomy.

This operation is performed by calling function deleteMetadataTaxonomyLevel.

See the endpoint docs at API Reference.

await client.metadataTaxonomies.deleteMetadataTaxonomyLevel(
  namespace,
  taxonomyKey,
);

Arguments

Returns

This function returns a value of type MetadataTaxonomyLevels.

Returns an array of all taxonomy levels.

List metadata taxonomy nodes

Used to retrieve metadata taxonomy nodes based on the parameters specified. Results are sorted in lexicographic order unless a query parameter is passed. With a query parameter specified, results are sorted in order of relevance.

This operation is performed by calling function getMetadataTaxonomyNodes.

See the endpoint docs at API Reference.

await client.metadataTaxonomies.getMetadataTaxonomyNodes(
  namespace,
  taxonomyKey,
);

Arguments

Returns

This function returns a value of type MetadataTaxonomyNodes.

Returns a list of the taxonomy nodes that match the specified parameters.

Create metadata taxonomy node

Creates a new metadata taxonomy node.

This operation is performed by calling function createMetadataTaxonomyNode.

See the endpoint docs at API Reference.

await client.metadataTaxonomies.createMetadataTaxonomyNode(
  namespace,
  taxonomyKey,
  {
    displayName: 'Europe',
    level: 1,
  } satisfies CreateMetadataTaxonomyNodeRequestBody,
);

Arguments

Returns

This function returns a value of type MetadataTaxonomyNode.

The schema representing the taxonomy node created.

Get metadata taxonomy node by ID

Retrieves a metadata taxonomy node by its identifier.

This operation is performed by calling function getMetadataTaxonomyNodeById.

See the endpoint docs at API Reference.

await client.metadataTaxonomies.getMetadataTaxonomyNodeById(
  namespace,
  taxonomyKey,
  countryNode.id,
);

Arguments

Returns

This function returns a value of type MetadataTaxonomyNode.

Returns the metadata taxonomy node that matches the identifier.

Update metadata taxonomy node

Updates an existing metadata taxonomy node.

This operation is performed by calling function updateMetadataTaxonomyNode.

See the endpoint docs at API Reference.

await client.metadataTaxonomies.updateMetadataTaxonomyNode(
  namespace,
  taxonomyKey,
  countryNode.id,
  {
    requestBody: {
      displayName: 'Poland UPDATED',
    } satisfies UpdateMetadataTaxonomyNodeRequestBody,
  } satisfies UpdateMetadataTaxonomyNodeOptionalsInput,
);

Arguments

Returns

This function returns a value of type MetadataTaxonomyNode.

The schema representing the updated taxonomy node.

Remove metadata taxonomy node

Delete a metadata taxonomy node. This deletion is permanent and cannot be reverted. Only metadata taxonomy nodes without any children can be deleted.

This operation is performed by calling function deleteMetadataTaxonomyNode.

See the endpoint docs at API Reference.

await client.metadataTaxonomies.deleteMetadataTaxonomyNode(
  namespace,
  taxonomyKey,
  countryNode.id,
);

Arguments

Returns

This function returns a value of type undefined.

Returns an empty response when the metadata taxonomy node is successfully deleted.

List metadata template’s options for taxonomy field

Used to retrieve metadata taxonomy nodes which are available for the taxonomy field based on its configuration and the parameters specified. Results are sorted in lexicographic order unless a query parameter is passed. With a query parameter specified, results are sorted in order of relevance.

This operation is performed by calling function getMetadataTemplateFieldOptions.

See the endpoint docs at API Reference.

await client.metadataTaxonomies.getMetadataTemplateFieldOptions(
  namespace,
  metadataTemplateKey,
  'taxonomy',
);

Arguments

Returns

This function returns a value of type MetadataTaxonomyNodes.

Returns a list of the taxonomy nodes that match the specified parameters.