Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// 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);
}
public addStakeholder(stakeholderName: string): Promise {
const params = MethodParams.build()
.string(stakeholderName);
return this.invokeNonQuery("DeleteStakeholder", params);
}
public addLanguage(lcid: number): Promise {
const params = MethodParams.build().number(lcid);
return this.invokeNonQuery("AddLanguage", params);
}
public getTermsById(...ids: string[]): ITerms {
const params = MethodParams.build().strArray(ids.map(id => sanitizeGuid(id)));
return this.getChild(Terms, "GetTermsById", params);
}
public getTermInTermSet(termId: string, termSetId: string): ITerm {
const params = MethodParams.build().string(sanitizeGuid(termId)).string(sanitizeGuid(termSetId));
return this.getChild(Term, "GetTermInTermSet", params);
}
public deleteLanguage(lcid: number): Promise {
const params = MethodParams.build().number(lcid);
return this.invokeNonQuery("DeleteLanguage", params);
}
public addContributor(principalName: string): Promise {
const params = MethodParams.build().string(principalName);
return this.invokeNonQuery("AddContributor", params);
}
public getByValue(value: string): ILabel {
const params = MethodParams.build().string(value);
return this.getChild(Label, "GetByValue", params);
}
public getTermGroupById(id: string): ITermGroup {
const params = MethodParams.build()
.string(sanitizeGuid(id));
return this.getChild(TermGroup, "GetGroup", params);
}
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));
}