Skip to main content
Version: v4.6

IafProj

Use the IafProject API to manage project resources in the Passport, Item, File, and Graphics services.

addFileBrowser#

Adds file features to your project when you pass the project's id. This method adds a root container folder, which you can upload files or subcontainer folders to. The method sets the project as the as the current working project in the session.

ParameterRequiredTypeDescription
projectIdYesStringThe Project's id
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

NamedFileCollection - A root container object of type NamedFileCollection

Examples
const projectWithFileBrowser = await IafProj.addFileBrowser(project._id);

addFileBrowserToProject#

Adds file features to your project when you pass a Project object. This method adds a root container folder, which you can upload files or subcontainer folders to. The method sets the project as the as the current working project in the session.

ParameterRequiredTypeDescription
projectYesProjectProject object
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

NamedFileCollection - A root container object of type NamedFileCollection

Examples
const projectWithFileBrowser = await IafProj.addFileBrowserToProject(project, ctx);

addPermissionsOnColl#

Adds permissions to one or more user groups for a collection.

ParameterRequiredTypeDescription
userGroupsYesArray<UserGroup>Pass an array of UserGroup objects that you want to assign permissions to.
collYesNamedUserCollectionPass the NamedUserCollection object you want to grant permissions to.
permArrayYesArray<Permission>The permissions you want to assign to the user groups. Pass an array of Permission objects.
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

CreatePermissionsResponse - A CreatePermissionsResponse object that contains the successful and failed permissions.

Examples
//create an array and add Permission objects to it
const permissions = [  {    _namespace : "building_1",    _user : "service_person",    _actions : ["READ"],  },  {    _namespace : "building_2",    _user : "building_manager",    _actions : ["READ", "WRITE"],  }];
//call the method to add the permissionsconst newCollectionPerms = await IafProj.addPermissionsOnColl(userGroups, collection, permissions);

addScript#

Adds a Script class object to a Project.

ParameterRequiredTypeDescription
projectYesProjectProject object.
scriptYesScriptScript object.
ctxNoctxContext, such as namespaces or authentication token information.
Returns

Script - The created script object, which stores as a related item to the project.

Examples
//Create scriptconst script = {  _name: "Project setup script",  _shortName: "prjSetup",  _userType: "project_setup_script".  _version:{    _userData: "[{$defscript: {}}]"  }}
const addedScript = await IafProj.addScript(project, script);

addScriptToProject#

Adds a Script class object to a Project when you pass a project's id.

ParameterRequiredTypeDescription
projectIdYesStringThe Project's id.
scriptYesScriptThe Script class object.
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

Script - Created script

Examples
//Create scriptconst script = {  _name: "Project setup script",  _shortName: "prjSetup",  _userType: "project_setup_script".  _version: {    _userData: "[{$defscript: {}}]"}}
const script = await IafProj.addScriptToProject(project.id, script);

addUserConfig#

Adds a user config to a project when you pass a Project object and UserConfig object.

ParameterRequiredTypeDescription
projectYesProjectProject object.
userConfigYesUserConfigTo create a userConfig, pass a JSON object with properties of type UserConfig.
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

UserConfig - Created UserConfig object

Examples
//Define user configconst userConfig = {  _name: "Project setup config",  _shortName: "prjSetupConfig",  _userType: "project_setup_config".  _version:{    _userData: { handlers: { } }  }};
const userconfig = await IafProj.addUserConfig(project, userConfig);

addUserConfigToProject#

Adds a UserConfig to a project when you pass a Project id and UserConfig object.

ParameterRequiredTypeDescription
projectIdYesStringThe Project's id.
userConfigYesUserConfigDefine a UserConfig class object.
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

UserConfig - Created UserConfig

Examples
//Define user configconst userconfig = {  _name: "Project setup config",  _shortName: "prjSetupConfig",  _userType: "project_setup_config".  _version:{    _userData: { handlers: { } }  }};
const userconfig = await IafProj.addUserConfigToProject(project._id, userconfig);

addUserGroups#

Creates UserGroup class objects for a Project when you pass a Project object.

ParameterRequiredTypeDescription
projectYesProjectProject object
userGroupsYesArray<UserGroupDescriptor>Pass the array of UserGroup objects you want to create.
ctxNoCtxContext - Context, such as namespaces or authentication token information.
Returns

any - Array - An array of created UserGroup objects. The method returns void if any of the user groups already exist in the project object. The _shortName property is used for this check.

Examples
const userGroups = [  {_name: "proj_1_admin",  _userType: "proj_1_usergroup", "permissions":{accessAll:true}},  {_name: "proj_1_devs",   _userType: "proj_1_usergroup", "permissions":{namedUserItems:[{ actions: ["READ", "EDIT"] }], files: [{ actions: ["READ", "EDIT"] }] }},  {_name: "proj_1_visitor",   _userType: "proj_1_usergroup","permissions":{namedUserItems:[{ actions: ["READ", "EDIT"] }], files: [{ actions: ["READ", "EDIT"] }] }}];
const userGroups = await IafProj.addUserGroups(project, userGroups);

addUserGroupsToProject#

Creates UserGroups for a project when you pass the Project's id.

ParameterRequiredTypeDescription
projectIdYesStringThe project's id
userGroupsYesArray<UserGroup>Pass the array of UserGroup objects you want to create.
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

any - Array - An array of created user groups. The method returns void if any of the usergroup already exist in the project.The _shortName property is used for this check.

Examples
let userGroups = [  {_name: "proj_1_devs", _namespaces: ["3_jtOxaGwR"], _userType: "proj_1_usergroup"},  {_name: "proj_1_eng", _namespaces: ["3_jtOxaGwR"], _userType: "proj_1_usergroup"},  {_name: "proj_1_data", _namespaces: ["3_jtOxaGwR"], _userType: "proj_1_usergroup"}  ];
await IafProj.addUserGroupsToProject(project._id, userGroups);

create#

Creates a Project object on the platform with a JSON object you pass with properties of type Project.

ParameterRequiredTypeDescription
projectYesProjectPass a JSON object with properties of type Project and the values you want to define the project.
ctxNoCtxContext, such as namespaces and authentication token information.
Returns

Page<Project> -

Examples
// Create a new project object with properties of type Projectconst project = {   _description: "account workspace",   _name: "Account Workspace",   _shortName: "aw",};
const project = await IafProj.create(project);

createOrUpdatePerms#

Creates or updates permissions for a UserGroup in a project namespace.

ParameterRequiredTypeDescription
projectYesProjectProject object
userGroupYesUserGroupUserGroup object
permissionsYesArray<IafPermissionDescriptor>Pass an array of IafPermissionDescriptor objects with the permissions you want to create or update.
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

void -

Examples
//An array of permissions you already definedconst developerPerms = [itemServicePerm, scriptPerm, dataPerm];
await IafProj.createOrUpdatePerms(projectObj, userGroupObj, developerPerms)

createOrUpdatePermsForUserGroup#

Creates or updates permissions for a UserGroup in a project namespace when you pass Project and UserGroup ids.

ParameterRequiredTypeDescription
projectIdYesStringThe Project's id
userGroupIdYesStringThe UserGroup's id
permissionsYesArray<IafPermissionDescriptor>Pass an array of IafPermissionDescriptor objects with the permissions you want to create or update.
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

void -

Examples
//create permissions for a usergroup for differnt resources in the Platformconst permissions = {  namedUserColls: [ { actions: ["READ"] }],  files: [ { actions: ["READ"] }]}; await IafProj.createOrUpdatePermsForUserGroup(project._id, userGroup._id, permissions);

createProject#

Converts an object you define to a Project object.

ParameterRequiredTypeDescription
projectYesProjectPass an object with the Project type properties you want to create your project.
ctxNoCtxContext, such as namespaces and authentication token information.
Returns

Page<Project> -

Examples
// Create a new projectconst projectObj = {  _description: "account workspace",  _name: "Account Workspace",  _shortName: "aw",  _userAttributes: {    "usergroups":[]  }}
const project = await IafProj.createProject(projectObj, ctx);

delete#

Soft deletes a project when you pass a Project object.

ParameterRequiredTypeDescription
projectYesProjectProject object
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

String - 'ok: 204'

Examples
await IafProj.delete(project);

deletePerms#

Deletes permissions for a UserGroup in a project namespace.

ParameterRequiredTypeDescription
projectYesProjectProject object
userGroupYesUserGroupPass the UserGroup object you want to remove permissions from.
permissionsYesArray<IafPermissionDescriptor>Pass an array of IafPermissionDescriptor objects with the permissions you want to delete from the user group.
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

void -

Examples
//An array of permissions you already definedconst developerPerms = [itemServicePerm, scriptPerm, dataPerm];
//call the method on the project, user group, and the developerPerms array of IafPermissionDescriptor objectsawait IafProj.deletePerms(projectObj, userGroupObj, developerPerms);

deleteProjectById#

Soft deletes a Project when you pass the project's id.

ParameterRequiredTypeDescription
idYesStringThe Project's id.
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

String - 'ok: 204'

Examples
await IafProj.deleteProjectById(projectId);

deleteScript#

Deletes a project script when you pass Project and Script objects.

ParameterRequiredTypeDescription
projectYesProjectThe Project object that contains the script.
scriptYesScriptThe Script object you want to delete.
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

String - 'ok: 204'

Examples
await IafProj.deleteScript(projectObj, scriptObj);

deleteScriptInProject#

Deletes a project Script when you pass the Project and Script ids.

ParameterRequiredTypeDescription
projectIdYesProjectThe Project's id
scriptIdYesScriptThe id of the Script you want to delete
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

String - 'ok: 204'

Examples
await IafProj.deleteScriptInProject(project._id, script._id);

deleteUserConfig#

Deletes a UserConfig from a project when you pass Project and UserConfig ids.

ParameterRequiredTypeDescription
projectYesProjectThe Project object that contains the user config you want to delete.
userConfigYesUserConfigThe UserConfig object you want to delete.
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

String - 'ok: 204'

Examples
await IafProj.deleteUserConfig(project, userConfig);

deleteUserConfigInProject#

Deletes a UserConfig from a project when you pass project and user config ids.

ParameterRequiredTypeDescription
projectIdYesStringThe Project's id
userConfigIdYesStringThe UserConfig's id
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

String - 'ok: 204'

Examples
const response = await IafProj.deleteUserConfigInProject(project._id, userConfig._id);

deleteUserGroup#

Deletes a UserGroup and removes it from a project when you pass Project and UserGroup objects.

ParameterRequiredTypeDescription
projectYesProjectThe Project object
userGroupYesUserGroupThe UserGroup object
ctxYesCtxContext, such as namespaces or authentication token information.
Returns

Project - The Project object without the user group

Examples
const updatedProj = await IafProj.deleteUserGroup(project, userGroup);

deleteUserGroupFromProject#

Deletes a UserGroup and removes it from a Project when you pass Project and UserGroup ids.

ParameterRequiredTypeDescription
projectIdYesStringThe Project's id
userGroupIdYesStringThe UserGroup's id
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

Project - The Project object without the UserGroup

Examples
await IafProj.deleteUserGroupFromProject(project._id, usergroup._id);

getById#

Gets a Project class object when you pass its id.

ParameterRequiredTypeDescription
idYesStringThe Project's id
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

Project - The project object

getCurrent#

Gets the current Project from the browser's session storage or based on a parameter you pass as the ctx parameter.

ParameterRequiredTypeDescription
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

Project - The Project object

Examples
//Get the current project from the browser's session storageconst currentProject = await IafProj.getCurrent();

getFileContainers#

Gets a Project's FileContainer class objects.

ParameterRequiredTypeDescription
projectIdYesStringThe project's id
queryYesJSONTo filter the response, pass an object with a simple query.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsYesNamedUserItemCriteriaOptionsPass a NamedUserItemCriteriaOptions object with your response options, such as "_pageSize" and "_offset".
Returns

any - Array An array of containers

Examples
const fileContainers = IafProj.getFileContainers(  project._id,   { _version: 1 },   ctx,  { _pageSize: 100 });

getModels#

ParameterRequiredTypeDescription
projectYesProjectProject object
criteriaYesNamedUserItemCriteriaPass a NamedUserItemCriteria object with your simple query.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsYesJSONPass an object with one or more response options, such as _offset and _pageSize, as a JSON object.
Returns

Array - An array of models

getModelsWithPagination#

ParameterRequiredTypeDescription
projectYesProjectProject object
criteriaYesNamedUserItemCriteriaTo filter the response, pass a NamedUserItemCriteria object with a simple query.
ctxNoctxContext, such as namespaces and authentication token information.
optionsYesJSONPass an object with one or more response options, such as _offset and _pageSize, as a JSON object.
Returns

Page<Array> - Page object with array of models

getPermissions#

Gets a user's permissions for a project when you pass User and Project objects.

ParameterRequiredTypeDescription
userYesUserThe User object
projectYesProjectThe Project object
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

PermissionOperation - A PermissionOperation object with permission operations for the User.

Examples
const userPerms = await getPermissions(currentUser._id, project);

getPermissionsOnColl#

Gets a user's permissions for a NamedUserCollection.

ParameterRequiredTypeDescription
userYesUserUser object
collYesNamedUserCollectionFor the collection, pass a NamedUserCollection object.
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

Array<PermissionOperation> - Returns the user's permissions for the collection as an array of PermissionOperation objects.

Examples
const collectionPermissions = await IafProj.getPermissionsOnColl(user, coll);

getProjectModels#

ParameterRequiredTypeDescription
projectIdYesStringThe Project’s id
criteriaYesNamedUserItemCriteriaPass a NamedUserItemCriteria object with your simple query.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsYesJSONPass an object with one or more response options, such as _offset and _pageSize, as a JSON object.
Returns

Page<Array> - A page object containing an array of models

getProjects#

Gets all the Project class objects for the session user with the option to filter by project criteria.

ParameterRequiredTypeDescription
criteriaNoProjectCriteriaPass an object with the Project type properties you want to filter your search. If you do not pass criteria, all the user's projects return.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoJSONPass an object with one or more Page type properties, such as "_offset" and "_pageSize". The default value for _offset is 0 and for _pageSize is 10.
Returns

Array<Project> - An array of Project objects.

Examples
// Retrieves by project name. const projects = await IafProj.getProjects({  _name:'test-project' }, ctx);

//Retrieves with particular offset and pageSizelet options = { _offset: 10, _pageSize: 50 }const projects = await IafProj.getProjects({  _name: 'test-project'  },  options);

getProjectsWithPagination#

Gets all the projects with pagination for a session user with the option to filter by project criteria.

ParameterRequiredTypeDescription
criteriaNoProjectCriteriaPass an object with the Project type properties you want to filter your search. If you do not pass criteria, all the user's projects return.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoJSONPass an object with one or more Page type properties, such as "_offset" and "_pageSize". The default value for _offset is 0 and for _pageSize is 10.
Returns

Page<Array<Project>> - An array of Project objects with pagination in a Page object

Examples
// Retrieves by project name. const projects = await IafProj.getProjects({  _name:'test-project' }, ctx);
//Retrieves with particular offset and pageSizeconst options = { _offset: 10, _pageSize: 50 }const projects = await IafProj.getProjects({  _name: 'test-project'  },  options);

getProjectUserGroupsForCurrentUser#

Get a User's UserGroups for a stored Project that the user has permissions for.

ParameterRequiredTypeDescription
projectIdYesStringProject id
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

any - Array - An array of the User's associated UserGroups for the stored Project

Examples
const projUserGroups = await getProjectUserGroupsForCurrentUser(project._id);

getScripts#

Gets all of a project's Script objects or gets the scripts that match a query you pass.

ParameterRequiredTypeDescription
projectYesProjectProject object
filtersYesNamedUserItemCriteriaTo get all scripts, pass an empty object: {}. To filter the scripts, in the object, pass a simple query.
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

Array<Script> - An array of Script objects

Examples
// Get scripts without filterconst scripts = IafProj.getScripts(project, {}, ctx);
// Get scripts with filter, refer {NamedUserItemCriteria} for more examplesconst filters =  { query: { _userType: "cde_script" } };const scripts = await IafProj.getScripts(project, filters);

getScriptsByProjectId#

Gets the Script objects for project when you pass the Project's id.

ParameterRequiredTypeDescription
projectIdYesStringThe Project's id
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

Array<Script> - An array of Script objects

Examples
const scripts = await IafProj.getScripts(project._id);

getUserConfigs#

Gets all of a project's user configs or gets the user configs that match a query you pass.

ParameterRequiredTypeDescription
projectYesProjectProject object
filtersYesNamedUserItemCriteriaTo get all user configs, pass an empty object: {}. To filter the user configs, in the object, pass a simple query.
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

any - Array<UserConfig} - An array of UserConfig objects

Examples
// Get user configs without filterconst userconfigs = IafProj.getUserConfigs(project, {}, ctx);
// Get user configs with filter. For more examples, refer NamedUserItemCriteria on the Types page. const filters =  { query: { _userType: "cde_user_config" } };
const userconfigs = await IafProj.getUserConfigs(project, filters);

getUserConfigsWithPagination#

Gets all of a project's UserConfig objects with pagination or gets the user configs that match a query you pass.

ParameterRequiredTypeDescription
projectIdYesProjectThe Project's id
filtersYesNamedUserItemCriteriaTo get all user configs, pass an empty object: {}. To filter the user configs, in the object, pass a simple query.
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

any - Array<UserConfig} - An array of UserConfig objects

Examples
// Get user configs without filter
const userconfigs = await IafProj.getUserConfigs(project, {}, ctx);
// Get user configs with filter, refer to NamedUserItemCriteria class for more examples
const filters =  { query: { _userType: "cde_user_config" } }const userconfigs = await IafProj.getUserConfigs(project, filters, ctx);

getUserGroups#

Gets the UserGroup objects associated with a project that the current user can access.

ParameterRequiredTypeDescription
projectYesProjectProject object
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

any - Array{UserGroup} - An array of UserGroup objects

Examples
const userGroups = await IafProj.getUserGroups(project);

getUserGroupsForCurrentUser#

Gets the current User's UserGroups for a Project that the User has permissions for.

ParameterRequiredTypeDescription
projectYesProjectProject object
ctxYesCtxContext, such as namespaces and authentication token information.
Returns

any - Array - An array of the current User's associated UserGroups for the Project object

Examples
const userGroups = await getUserGroupsForCurrentUser(project, ctx);

getUserGroupsForUser#

Get a User's UserGroups for a Project when you pass User and Project objects. Only the UserGroups that the user has permissions for return.

ParameterRequiredTypeDescription
userYesUserThe User object
projectYesProjectThe Project object
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

any - Array - An array of UserGroup objects associated with the User for the Project.

Examples
const userUserGroups = await getUserGroupsForUser(currentUser, project);

getUserPermissions#

Get a User's permissions for a Project when you pass the User and Project ids.

ParameterRequiredTypeDescription
userIdYesStringThe User's id
projectIdYesStringThe Project's id
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

PermissionOperation - A PermissionOperation object with the permission operations for the User.

Examples
const userPerms = await IafProj.getUserPermissions(currentUser._id, project._id);

getUsers#

Gets all users from the user groups associated with a project when you pass a Project object.

ParameterRequiredTypeDescription
projectYesProjectProject object
queryYesUserCriteria//TODO: apply query
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

Array<User> - An array of User objects

Examples
const projectUsers = await IafProj.getUsersInProject(project);

getUsersInProject#

Gets all Users from the UserGroups associated with a Project when you pass the project's id.

ParameterRequiredTypeDescription
projectIdYesStringThe Project's id.
queryYesUserCriteria//TODO: apply query
ctxYesCtxContext, such as namespaces or authentication token information - Optional
Returns

Array<User> - An array of User objects

Examples
const projectUsers = await IafProj.getUsersInProject(project._id);

purgeProject#

Hard deletes a Project and its contents when you pass a Project object.

ParameterRequiredTypeDescription
projectYesProjectThe Project object
ctxNoCtxContext, such as namespaces and authentication token information.
Returns

void -

Examples
await IafProj.purgeProject(project, ctx);

purgeProjectById#

Hard deletes a stored Project and its contents when you pass its id.

ParameterRequiredTypeDescription
projectIdYesStringThe Project's id
ctxNoCtxContext, such as namespaces and authentication token information.
Returns

void -

Examples
await IafProj.purgeProjectById(project._id, ctx);

setupCurrent#

Sets a Project as the current session project. Use this method to set up namespaces, switch projects, and more.

ParameterRequiredTypeDescription
projectYesProjectProject object
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

Project - The Project object and its root container reference

Examples
const project = await IafProj.setupCurrent(project);

switchProject#

Sets a Project as the current project in session storage or based on a parameter you pass as the ctx parameter.

ParameterRequiredTypeDescription
idYesStringThe Project's id.
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

Project - The Project object

Examples
const currentProj = await IafProj.switchProject(proj._id);

update#

Updates a Project object.

ParameterRequiredTypeDescription
projectYesProjectThe Project object
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

Project - The updated Project object

Examples
project._name = "updated-proj-name";const updatedProj = await IafProj.update(project);

updateProjectScript#

Updates a project script when you pass the Project's id and the updated Script object. To update script content, use the updateProjectScriptVersion method.

ParameterRequiredTypeDescription
projectIdYesStringThe Project's id.
scriptYesScriptYour updated Script object.
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

Script - Updated Script object

Examples
//Update scriptscript._name = "updated script name";
const script = await IafProj.updateProjectScript(project._id, script, ctx);

updateScript#

Updates a project script when you pass a Project object and the updated Script object. To update script content, use the updateProjectScriptVersion method.

ParameterRequiredTypeDescription
projectYesProjectProject object
scriptYesScriptYour updated Script object
ctxNoctxContext, such as namespaces or authentication token information.
Returns

Script - Updated script object

Examples
//Update scriptscript._name = "updated script name";
const updatedScript = await IafProj.updateScript(project, script, ctx);

updateScriptVersion#

Updates an existing script version's content when you pass Script and ScriptVersion objects.

ParameterRequiredTypeDescription
scriptYesScriptScript object
versionYesScriptVersionPass a ScriptVersion object with your updates.
ctxNoctxContext, such as namespaces or authentication token information.
Returns

ScriptVersion - The updated ScriptVersion object

Examples
//Update script versionscript._versions[2]._name = "updated script name"; 
const scriptVersion = await IafProj.updateScriptVersion(script, script._versions[2], ctx);

updateScriptVersionById#

Updates an existing ScriptVersion when you pass Project and Script ids.

ParameterRequiredTypeDescription
projectIdYesStringThe Project's id.
scriptIdYesStringThe Script's id.
versionYesScriptVersionPass the updated ScriptVersion object.
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

ScriptVersion - Updated ScriptVersion object

Examples
//Update script versionscript._versions[2]._name = "updated script name"; 
const updatedScriptVersion = await IafProj.updateScriptVersion(project._id, script._id, script._versions[2], ctx);

updateUserConfig#

Updates a UserConfig object in a project when you pass the Project and UserConfig objects. To update user config content, use updateUserConfigVersion.

ParameterRequiredTypeDescription
projectYesProjectProject object
userConfigYesUserConfigThe updated UserConfig class object
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

UserConfig - Updated UserConfig object

Examples
// Update user configuserConfig._name = "updated name";
const userconfig = await IafProj.updateUserConfig(project, userConfig);

updateUserConfigInProject#

Updates a UserConfig object in a project when you pass the project id and a UserConfig object. To update user config content, use updateUserConfigVersionInProject.

ParameterRequiredTypeDescription
projectIdYesStringThe Project's id.
userConfigYesUserConfigThe updated UserConfig class object
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

UserConfig - Updated UserConfig object

Examples
// Update user configuserConfig._name = "updated name";
const userconfig = await IafProj.updateUserConfig(project._id, userConfig);

updateUserConfigVersion#

Updates the content of a UserConfigVersion.

ParameterRequiredTypeDescription
userConfigYesUserConfigUserConfig object
versionYesUserConfigVersionThe updated UserConfigVersion object
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

UserConfigVersion - Updated UserConfigVersion object

Examples
userConfig._versions[2]._name = "updated user config name"; 
const userConfigVersion = await IafProj.updateUserConfigVersion(userConfig, userConfig._versions[2]);

updateUserConfigVersionInProject#

Updates the content of a UserConfigVersion in a specific project.

ParameterRequiredTypeDescription
projectIdYesStringThe Project's id
userConfigIdYesStringThe UserConfig's id
versionYesUserConfigVersionTo update user config version content, pass a JSON object with properties of type UserConfigVersion.
ctxNoCtxContext, such as namespaces or authentication token information.
Returns

UserConfigVersion - Updated UserConfigVersion object

Examples
userConfig._versions[2]._name = "updated user config name"; 
const userConfigVersion = await IafProj.updateUserConfigVersion(project._id, userConfig._id, userConfig._versions[2]);