src/lib/fs/caas/caas-access-data.ts
This data class contains all the data needed to connect to a CaaS instance.
Methods |
constructor(baseUrl: string, tenantId: string, project: string, collection: CaasCollection, apiKey: string)
|
||||||||||||||||||||||||
Defined in src/lib/fs/caas/caas-access-data.ts:10
|
||||||||||||||||||||||||
Creates an instance of CaasAccessData. The the readme for more information about how to obtain the required information.
Parameters :
|
collectionUrl |
collectionUrl()
|
Defined in src/lib/fs/caas/caas-access-data.ts:36
|
This function returns the collection URL based on the parameter passed to the constructor.
Returns :
URL
The collection URL generated in the format |
tokenUrl |
tokenUrl()
|
Defined in src/lib/fs/caas/caas-access-data.ts:40
|
Returns :
any
|
import { CaasCollection } from './caas-collection';
/**
* This data class contains all the data needed to connect to a CaaS instance.
*
* @export
* @class CaasAccessData
*/
export class CaasAccessData {
/**
* Creates an instance of CaasAccessData.
* The the readme for more information about how to obtain the required information.
*
* @param {string} baseUrl The base URL represents the URL the CaaS is hosted at.
* @param {string} tenantId The tenant ID is the customer's name the CaaS instances was created for.
* @param {string} project The project ID identifies the FirstSpirit project that is connected to the CaaS instance.
* @param {CaasCollection} collection A collection helps to distinguish between preview and released content.
* @param {string} apiKey The CaaS API key identifies the permission for the access to the CaaS instance.
* @memberof CaasAccessData
*/
constructor(
private baseUrl: string,
private tenantId: string,
private project: string,
private collection: CaasCollection,
readonly apiKey: string
) {}
/**
* This function returns the collection URL based on the parameter passed to the constructor.
*
* @return {string} The collection URL generated in the format <baseURL>/<tenantId>/<projectId>.<collection>.
* @memberof CaasAccessData
*/
collectionUrl(): URL {
return new URL(`${this.baseUrl}/${this.tenantId}/${this.project}.${this.collection}`);
}
tokenUrl() {
return new URL(`_logic/securetoken?tenant=${this.tenantId}`, this.collectionUrl().origin).href
}
}