Frodo Library - v5.0.0-47
    Preparing search index...

    Type Alias ApplicationTemplate

    type ApplicationTemplate = {
        listTemplates(
            options?: ApplicationTemplateListOptions,
        ): Promise<ApplicationTemplateListItem[]>;
        readCatalog(
            options?: ApplicationTemplateCatalogOptions,
        ): Promise<ApplicationTemplateCatalogResult>;
        readOverrides(): Promise<ApplicationTemplateOverrideSkeleton[]>;
        readTemplate(
            application: ApplicationTemplateReference,
            options?: ApplicationTemplateListOptions,
        ): Promise<ApplicationTemplateResolution>;
    }
    Index
    • Read the application template catalog. The default source is the public catalog that the Admin UI uses on Ping's CDN; it is requested without any credential of the tenant, and through the proxy settings of the library. The paths of the CDN are what the Admin UI happens to use, not a documented interface. A catalog that the caller has (catalog) or a URL that the caller names (url) is used instead. A catalog that was downloaded is kept for the state until refresh is set. Unless the cache is on, the library writes no file: the result holds the catalog and what identifies the download (etag, lastModified, fetchedAt), so that a caller can save it.

      With the cache on (state.setUseTemplateCatalogCache(true)), the catalog of the default source is kept in a directory (state.setTemplateCatalogCachePath, default ~/.frodo/AppTemplates) as <channel>.json (the decoded catalog, which can be copied to a machine that cannot reach the source and given there as catalog) and <channel>.meta.json. A copy younger than maxAgeMs (default one hour) is used with no request. An older one is asked about with its ETag and Last-Modified, so a copy that is current costs no download (304). If the source cannot be reached or fails on its side, the old copy is used and the result says so (cache: 'stale-after-error'). refresh asks the source now but still conditionally; ignoreCache downloads without validators. A catalog the caller hands over and a URL the caller names are never kept. The files are not trusted: they go through the same limits and checks as a download, and one that fails them is replaced. A write that fails never fails the read.

      When air-gapped mode is on (state.setAirGapped), no request is made: the copy in the cache is used, whatever its age, and without one the call fails with the error code AIR_GAPPED; an explicit catalog and a URL the caller names still work. metadata.cache says what the cache did.

      Parameters

      Returns Promise<ApplicationTemplateCatalogResult>

      a promise that resolves to the catalog and its metadata

    • Read the template that an application record was made from, and say whether that version exists, whether it is the newest one and whether the tenant defines it itself. Nothing is thrown for a template that does not exist: found and versionExists say so. Because it is not known whether a record made from a template of the tenant keeps the name with the suffix -override that the Admin UI shows, both forms are matched. A template that cannot be read at all (the catalog is unreachable or not a catalog) throws, with the source named in the message.

      Parameters

      Returns Promise<ApplicationTemplateResolution>

      a promise that resolves to the resolution