UNPKG

acquia-dam-sdk

Version:
154 lines (150 loc) 5.14 kB
'use strict'; var apis_index = require('./apis/index.cjs'); var client_index = require('./client/index.cjs'); class AcquiaDAM { /** * Create an instance of the Acquia DAM Module. * * Provides access to all Acquia DAM API functions. * * @param params Information for creating the client */ constructor(params) { this._client = params?.client ?? new client_index.ApiClient(); if (params?.accessToken) { this._client.accessToken = params.accessToken; } } /** * Retrieve the ApiClient instance. */ get client() { return this._client; } /** * Retrieve an instance of the AnalyticsApi class. * * The Analytics endpoints provide information about asset usage from the Insights application. The API will return download, view, and share details for a single asset. * Events may take up to 24 hours before appearing in analytics API results. * Note: Three years of analytics data is available, starting from January 1, 2021 onward. The default `date_range` filter is from this date until today. */ get analytics() { this._analyticsApi ??= new apis_index.AnalyticsApi(this._client); return this._analyticsApi; } /** * Retrieve an instance of the AssetsApi class. * * Asset objects represent stored files in the DAM system. The API allows you to create, update, and delete Assets. You can search for assets, matching specific search criteria or load an individual asset by unique ID. */ get assets() { this._assetsApi ??= new apis_index.AssetsApi(this._client); return this._assetsApi; } /** * Retrieve an instance of the AttributesApi class. * * The Attributes API lists all product attributes that have been configured in Entries, and all controlled vocabulary values for any single-select or multi-select attribute. */ get attributes() { this._attributesApi ??= new apis_index.AttributesApi(this._client); return this._attributesApi; } /** * Retrieve an instance of the CategoriesApi class. * * Provides information about Categories and the Assets contained in them. */ get categories() { this._categoriesApi ??= new apis_index.CategoriesApi(this._client); return this._categoriesApi; } /** * Retrieve an instance of the CollectionsApi class. * * Provides information about global, shared, and private Collections. */ get collections() { this._collectionsApi ??= new apis_index.CollectionsApi(this._client); return this._collectionsApi; } /** * Retrieve an instance of the MetadataApi class. * * These endpoints allow you to retrieve or modify information about existing metadata fields. If you want to retrieve or modify metadata applied to a specific asset, use the AssetsApi. */ get metadata() { this._metadataApi ??= new apis_index.MetadataApi(this._client); return this._metadataApi; } /** * Retrieve an instance of the OrdersApi class. * * Provides information about Orders and Conversions. */ get orders() { this._ordersApi ??= new apis_index.OrdersApi(this._client); return this._ordersApi; } /** * Retrieve an instance of the ProductsApi class. * * The Products API provides access to product information stored in Acquia Entries. The API allows you to create, retrieve, delete, and update products. */ get products() { this._productsApi ??= new apis_index.ProductsApi(this._client); return this._productsApi; } /** * Retrieve an instance of the SearchConnectorApi class. * * The Instant Search Connector allows external applications access to Acquia DAM Asset search, without having to implement a native search UI. */ get searchConnector() { this._searchConnectorApi ??= new apis_index.SearchConnectorApi(this._client); return this._searchConnectorApi; } /** * Retrieve an instance of the UsageApi class. * * Retrieve information about the monthly usage of the API. */ get usage() { this._usageApi ??= new apis_index.UsageApi(this._client); return this._usageApi; } /** * Retrieve an instance of the UsersApi class. * * Query for information about users. */ get users() { this._usersApi ??= new apis_index.UsersApi(this._client); return this._usersApi; } /** * Retrieve an instance of the WebhooksApi class. * * Create, list, read, ping, edit, and delete Acquia DAM webhook configurations. Create, List, and Delete Workflow Webhooks */ get webhooks() { this._webhooksApi ??= new apis_index.WebhooksApi(this._client); return this._webhooksApi; } /** * Retrieve an instance of the WorkflowApi class. * * Workflow objects represent projects and deliverables stored in the Acquia Workflow system. The API allows you to retrieve, create, delete, and close deliverables and projects. */ get workflow() { this._workflowApi ??= new apis_index.WorkflowApi(this._client); return this._workflowApi; } /** * Set the client's access token. */ set accessToken(token) { this._client.accessToken = token; } } module.exports = AcquiaDAM;