How to use the @pnp/sp-clientsvc.MethodParams.build function in @pnp/sp-clientsvc

To help you get started, we’ve selected a few @pnp/sp-clientsvc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pnp / pnpjs / sp-taxonomy / src / termstores.ts View on Github external
// this will be the parent of the GetTerms call, but we need to create the input param first
        const parentIndex = objectPaths.lastIndex;

        // this is our input object
        const input = objConstructor("{61a1d689-2744-4ea3-a88b-c95bee9803aa}",
            // actions
            objectPath(),
            ...objectProperties(info),
        );

        // add the input object path
        const inputIndex = objectPaths.add(input);

        // this sets up the GetTerms call
        const params = MethodParams.build().objectPath(inputIndex);

        // call the method
        const methodIndex = objectPaths.add(method("GetTerms", params,
            // actions
            objectPath()));

        // setup the parent relationship even though they are seperated in the collection
        objectPaths.addChildRelationship(parentIndex, methodIndex);

        return new Terms(this, objectPaths);
    }
github pnp / pnpjs / packages / sp-taxonomy / src / termsets.ts View on Github external
public addStakeholder(stakeholderName: string): Promise {
        const params = MethodParams.build()
            .string(stakeholderName);

        return this.invokeNonQuery("DeleteStakeholder", params);
    }
github pnp / pnpjs / packages / sp-taxonomy / src / termstores.ts View on Github external
public addLanguage(lcid: number): Promise {

        const params = MethodParams.build().number(lcid);
        return this.invokeNonQuery("AddLanguage", params);
    }
github pnp / pnpjs / sp-taxonomy / src / termstores.ts View on Github external
public getTermsById(...ids: string[]): ITerms {

        const params = MethodParams.build().strArray(ids.map(id => sanitizeGuid(id)));
        return this.getChild(Terms, "GetTermsById", params);
    }
github pnp / pnpjs / sp-taxonomy / src / termstores.ts View on Github external
public getTermInTermSet(termId: string, termSetId: string): ITerm {

        const params = MethodParams.build().string(sanitizeGuid(termId)).string(sanitizeGuid(termSetId));
        return this.getChild(Term, "GetTermInTermSet", params);
    }
github pnp / pnpjs / sp-taxonomy / src / termstores.ts View on Github external
public deleteLanguage(lcid: number): Promise {

        const params = MethodParams.build().number(lcid);
        return this.invokeNonQuery("DeleteLanguage", params);
    }
github pnp / pnpjs / packages / sp-taxonomy / src / termgroup.ts View on Github external
public addContributor(principalName: string): Promise {

        const params = MethodParams.build().string(principalName);
        return this.invokeNonQuery("AddContributor", params);
    }
github pnp / pnpjs / packages / sp-taxonomy / src / labels.ts View on Github external
public getByValue(value: string): ILabel {

        const params = MethodParams.build().string(value);
        return this.getChild(Label, "GetByValue", params);
    }
github pnp / pnpjs / packages / sp-taxonomy / src / termstores.ts View on Github external
public getTermGroupById(id: string): ITermGroup {

        const params = MethodParams.build()
            .string(sanitizeGuid(id));

        return this.getChild(TermGroup, "GetGroup", params);
    }
github pnp / pnpjs / packages / sp-taxonomy / src / termstores.ts View on Github external
public addGroup(name: string, id = getGUID()): Promise {

        const params = MethodParams.build()
            .string(name)
            .string(sanitizeGuid(id));

        this._useCaching = false;
        return this.invokeMethod("CreateGroup", params)
            .then(r => assign(this.getTermGroupById(r.Id), r));
    }

@pnp/sp-clientsvc

pnp - Provides core functionality to interact with the legacy client.svc SharePoint endpoint

MIT
Latest version published 5 years ago

Package Health Score

70 / 100
Full package analysis

Similar packages