Options
All
  • Public
  • Public/Protected
  • All
Menu

Module dms

@dvelop-sdk/dms

npm (scoped) npm bundle size (scoped) GitHub license

This package contains functionality for the DMS-App in the d.velop cloud.

Explore the docs »
Install via npm »
Check us out on GitHub »

Index

DmsObject Functions

  • Create a DmsObject.

    import { createDmsObject } from "@dvelop-sdk/dms";
    import { readFileSync } from "fs";

    //only node.js
    const file: ArrayBuffer = readFileSync(`${ __dirname }/our-profits.kaching`).buffer;

    const dmsObject: GetDmsObjectParams = await createDmsObject({
    systemBaseUri: "https://steamwheedle-cartel.d-velop.cloud",
    authSessionId: "dQw4w9WgXcQ"
    }, {
    repositoryId: "qnydFmqHuVo",
    sourceId: "/dms/r/qnydFmqHuVo/source",
    categoryId: "GDYQ3PJKrT8",
    properties: [
    {
    key: "AaGK-fj-BAM",
    values: ["unpaid"]
    }
    ],
    fileName: "our-profits.kaching",
    content: file,
    });

    Parameters

    Returns Promise<GetDmsObjectParams>

  • Deletes the current (last) version of a DmsObject. The version before that automatically becomes the current version.

    Parameters

    Returns Promise<boolean>

    Boolean value indicating if the dmsObject was completly deleted (aka: You just deleted the first version)

    import { deleteCurrentDmsObjectVersion } from "@dvelop-sdk/dms";

    await deleteCurrentDmsObjectVersion({
    systemBaseUri: "https://steamwheedle-cartel.d-velop.cloud",
    authSessionId: "dQw4w9WgXcQ"
    }, {
    repositoryId: "qnydFmqHuVo",
    sourceId: "/dms/r/qnydFmqHuVo/source",
    dmsObjectId: "GDYQ3PJKrT8",
    reason: "This shall be gone! Tout de suite!"
    });

    // Delete the whole DmsObject
    // * Attention: This method wraps a HTTP-Call in a loop and can significantly slow down your code *
    let deletedAllVersions: boolean = false;
    while (!deletedAllVersions) {
    deletedAllVersions = await deleteCurrentDmsObjectVersion({
    systemBaseUri: "https://steamwheedle-cartel.d-velop.cloud",
    authSessionId: "dQw4w9WgXcQ"
    }, {
    repositoryId: "qnydFmqHuVo",
    sourceId: "/dms/r/qnydFmqHuVo/source",
    dmsObjectId: "GDYQ3PJKrT8",
    reason: "This shall be gone! Tout de suite!"
    });
    }
  • Download a DmsObject-file.

    import { getDmsObjectMainFile } from "@dvelop-sdk/dms";
    import { writeFileSync } from "fs";

    const file: ArrayBuffer = await getDmsObjectMainFile({
    systemBaseUri: "https://steamwheedle-cartel.d-velop.cloud",
    authSessionId: "dQw4w9WgXcQ"
    },{
    repositoryId: "qnydFmqHuVo",
    sourceId: "/dms/r/qnydFmqHuVo/source",
    dmsObjectId: "GDYQ3PJKrT8",
    });

    writeFileSync(`${__dirname}/our-profits.kaching`, Buffer.from(file)); // only node.js

    Parameters

    Returns Promise<ArrayBuffer>

  • Get all notes for an existing DmsObject.

    import { getDmsObjectNotes } from "@dvelop-sdk/dms";

    const notes: DmsObjectNote[] = getDmsObjectNotes({
    systemBaseUri: "https://steamwheedle-cartel.d-velop.cloud",
    authSessionId: "dQw4w9WgXcQ"
    }, {
    repositoryId: "qnydFmqHuVo",
    dmsObjectId: "GDYQ3PJKrT8"
    });

    notes.forEach(n => {
    console.log(`${n.creator.displayName}: "${n.text}"`);
    });

    // Jastor Gallywix: "I need this taken care of ASAP!"
    // Bing Zapcrackle: "I'm on it my prince."

    Parameters

    Returns Promise<DmsObjectNote[]>

  • Download a DmsObject-file as PDF.

    import { getDmsObjectPdfFile } from "@dvelop-sdk/dms";
    import { writeFileSync } from "fs";

    const file: ArrayBuffer = await getDmsObjectPdfFile({
    systemBaseUri: "https://steamwheedle-cartel.d-velop.cloud",
    authSessionId: "dQw4w9WgXcQ"
    },{
    repositoryId: "qnydFmqHuVo",
    sourceId: "/dms/r/qnydFmqHuVo/source",
    dmsObjectId: "GDYQ3PJKrT8",
    });

    writeFileSync(`${__dirname}/our-profits.pdf`, Buffer.from(file)); // only node.js

    Parameters

    Returns Promise<ArrayBuffer>

  • Link a DmsObject to multiple child DmsObjects.

    import { linkDmsObjects } from "@dvelop-sdk/dms";

    await linkDmsObjects({
    systemBaseUri: "https://steamwheedle-cartel.d-velop.cloud",
    authSessionId: "dQw4w9WgXcQ"
    }, {
    repositoryId: "qnydFmqHuVo",
    sourceId: "/dms/r/qnydFmqHuVo/source",
    parentDmsObjectId: "GDYQ3PJKrT8",
    childDmsObjectsIds: [
    "N3bEh-PEk1g",
    "AC86VI0j85M"
    ]
    });

    Parameters

    Returns Promise<void>

  • Execute a search and returns the search-result. This result might be partial due to the defined pageSize-property. You can navigate pages with the getPreviousPage- and getNextPage-functions. If functions are undefined the page does not exist.

    import { searchDmsObjects } from "@dvelop-sdk/dms";

    const searchResult: SearchDmsObjectsResultPage = await searchDmsObjects({
    systemBaseUri: "https://steamwheedle-cartel.d-velop.cloud",
    authSessionId: "dQw4w9WgXcQ"
    },{
    repositoryId: "qnydFmqHuVo",
    sourceId: "/dms/r/qnydFmqHuVo/source",
    categories: ["TIfAkOBMf5A"]
    fulltext: "Ashenvale",
    properties: [{
    key: "AaGK-fj-BAM",
    values: ["unpaid"]
    }]
    });

    console.log(searchResult.dmsObjects.length);

    Parameters

    Returns Promise<SearchDmsObjectsResultPage>

  • Returns an URI under which a file is temporarily available for download.

    import { storeFileTemporarily } from "@dvelop-sdk/dms";
    import { readFileSync } from "fs";

    //only node.js
    const file: ArrayBuffer = readFileSync(`${ __dirname }/our-profits.kaching`).buffer;

    const temporaryUri: string = await storeFileTemporarily({
    systemBaseUri: "https://steamwheedle-cartel.d-velop.cloud",
    authSessionId: "dQw4w9WgXcQ"
    }, {
    repositoryId: "qnydFmqHuVo",
    content: file
    });

    console.log(temporaryUri); // /dms/some-random-blob-url

    Parameters

    Returns Promise<string>

  • Update a DmsObject.

    import { updateDmsObject } from "@dvelop-sdk/dms";
    import { readFileSync } from "fs";

    //only node.js
    const file: ArrayBuffer = readFileSync(`${ __dirname }/our-profits.kaching`).buffer;

    await updateDmsObject({
    systemBaseUri: "https://steamwheedle-cartel.d-velop.cloud",
    authSessionId: "dQw4w9WgXcQ"
    }, {
    repositoryId: "qnydFmqHuVo",
    sourceId: "/dms/r/qnydFmqHuVo/source",
    dmsObjectId: "GDYQ3PJKrT8",
    alterationText: "Updated by SDK",
    properties: [
    {
    key: "AaGK-fj-BAM",
    values: ["paid"]
    }
    ],
    fileName: "our-profits.kaching",
    content: file,
    });

    Parameters

    Returns Promise<void>

Mappings Functions

  • Get a list of property mappings for a given source.

    import { getMappings } from "@dvelop-sdk/dms";

    const dmsMappings: DmsMapping[] = await getMappings({
    systemBaseUri: "https://steamwheedle-cartel.d-velop.cloud",
    authSessionId: "dQw4w9WgXcQ"
    },{
    repositoryId: "qnydFmqHuVo",
    sourceId: "/dms/r/qnydFmqHuVo/source"
    });

    console.log(dmsMappings);

    Parameters

    Returns Promise<DmsMapping[]>

Repository Functions

  • Returns an array of all Repository-objects for a tenant.

    import { Repository, getRepositories } from "@dvelop-sdk/dms";

    const repos: Repository[] = await getRepositories({
    systemBaseUri: "https://steamwheedle-cartel.d-velop.cloud",
    authSessionId: "dQw4w9WgXcQ"
    });
    const repoList: string = repos.map(r => r.name).join(", ");
    console.log("Repositories:", repoList); // Booty Bay, Everlook, Gadgetzan, Ratchet

    Parameters

    Returns Promise<Repository[]>

Generated using TypeDoc