c1-api v0.8.0
$ : object
Kind: global namespace
Version: 0.8
Author: Artur Arslanov a.arslanov@pravo.tech
- $ : object
- .scriptsGet
- .scriptTypes() ⇒ Array.<object>
- .fieldByPath(fieldPath) ⇒ object
- .autoScriptTriggerFields(triggerType) ⇒ object
- .scriptAndFolders() ⇒ Array.<object>
- .scriptsSet
- .createOrUpdate(scriptScheme) ⇒ object
- .deleteScript(scriptId) ⇒ boolean
- .utils
- .uuidv4() ⇒ string
- .settingsGet
- .instanceSettings() ⇒ object
- .generalSettings() ⇒ object
- .settingsSet
- .generalSettings(settingsStructure) ⇒ object
- .dictionaryGet
- .dictionarySet
- .createDict(dictStructure) ⇒ object
- .deleteDict(dictId) ⇒ object
- .projectsGet
- .projectSettings(projectId) ⇒ object
- .projectBlocksTypes() ⇒ Array.<object>
- .relatedProjects(projectId) ⇒ Array.<object>
- .projectsByFilters(filterFields, projectClass, page, pageSize, folderName) ⇒ Array.<object>
- .projectsSet
- .relatedProject(params) ⇒ boolean
- .projectSettings(projectSettingsStructure) ⇒ object
- .createProjectClass(classStructure) ⇒ object
- .createProjectType(projectTypeParams) ⇒ object
- .updateProjectType(projectTypeParams) ⇒ object
- .deleteProjectType(projectTypeId) ⇒ object
- .updateVisualBlock(blockData) ⇒ object
- .projectCreate(projectStructure) ⇒ object
- .projectCopy(projectStructure) ⇒ string
- .updateProject(projectStructure) ⇒ object
- .deleteProject(projectId) ⇒ boolean
- .projectsBlocksGet
- .blockByBlockName(project, blockName, removeIds) ⇒ object
- .pathsByName(project, params) ⇒ Array.<object>
- .blockIdByBlockName(project, blockName) ⇒ string
- .blockByBlockId(project, blockId) ⇒ string
- .projectsBlocksSet
- .filesGet
- .fileById(fileId, binary) ⇒ string
- .fileByDocumentId(documentId, binary) ⇒ string
- .filesSet
- .notificationsSet
- .toSingleUser(notificationStructure) ⇒ object
- .tasksGet
- .taskById(taskId) ⇒ object
- .usersGet
- .participantsGet
- .participantsSet
- .feedsGet
- .feedById(feedId) ⇒ object
- .feedsByFilters(feedsFilter) ⇒ Array.<object>
- .commentsSet
- .createComment(commentStructure) ⇒ object
- .eventsSet
- .createEvent(eventStructure) ⇒ object
- .eventsGet
- .eventTypes() ⇒ Array.<object>
- .casebookSet
- .enableSync(casebookData) ⇒ boolean
- .reportsGet
- .reportsList(params) ⇒ object
- .reportData(params) ⇒ Array.<Array.<string>>
- .emailSet
- .send(letter) ⇒ object
- .emailGet
- .emailById(emailId) ⇒ object
- .scriptsGet
$.scriptsGet
Kind: static interface of $
- .scriptsGet
- .scriptTypes() ⇒ Array.<object>
- .fieldByPath(fieldPath) ⇒ object
- .autoScriptTriggerFields(triggerType) ⇒ object
- .scriptAndFolders() ⇒ Array.<object>
scriptsGet.scriptTypes() ⇒ Array.<object>
Return all script types
Kind: static method of scriptsGet
Returns: Array.<object> - Array of scripts types
Example
$.scriptsGet.scriptTypes()scriptsGet.fieldByPath(fieldPath) ⇒ object
Return field info by provided path
Kind: static method of scriptsGet
Returns: object - Field structure
| Param | Type | Description |
|---|---|---|
| fieldPath | Array.<string> | Path like "Проект", "Дело", "Блоки дел", "Обьект" |
Example
$.scriptsGet.fieldByPath()scriptsGet.autoScriptTriggerFields(triggerType) ⇒ object
Return filed by trigger type
Kind: static method of scriptsGet
Returns: object - Field structure
| Param | Type | Description |
|---|---|---|
| triggerType | 'Fill' | 'Update' | 'SystemEvent' | 'Insert' | 'Delete' | Trigger type |
Example
$.scriptsGet.autoScriptTriggerFields()scriptsGet.scriptAndFolders() ⇒ Array.<object>
Return scripts and folders
Kind: static method of scriptsGet
Returns: Array.<object> - Array of scripts and folders structures
Example
$.scriptsGet.scriptAndFolders()$.scriptsSet
Kind: static interface of $
- .scriptsSet
- .createOrUpdate(scriptScheme) ⇒ object
- .deleteScript(scriptId) ⇒ boolean
scriptsSet.createOrUpdate(scriptScheme) ⇒ object
Create or update script scheme
Kind: static method of scriptsSet
Returns: object - Script scheme structure
| Param | Type | Description |
|---|---|---|
| scriptScheme | object | Script scheme structure |
Example
$.scriptsSet.createOrUpdate(scriptScheme)scriptsSet.deleteScript(scriptId) ⇒ boolean
Delete script
Kind: static method of scriptsSet
Returns: boolean - Result - true or false
| Param | Type | Description |
|---|---|---|
| scriptId | string | Script Id |
Example
$.scriptsSet.deleteScript(scriptId)$.utils
Kind: static interface of $
utils.uuidv4() ⇒ string
Generate groups of 4 random characters
Kind: static method of utils
Returns: string - New uuidv4
Example
$.utils.uuidv4()$.settingsGet
Kind: static interface of $
- .settingsGet
- .instanceSettings() ⇒ object
- .generalSettings() ⇒ object
settingsGet.instanceSettings() ⇒ object
Get instance bootstrap settings
Kind: static method of settingsGet
Returns: object - Bootstrap structure
Example
$.settingsGet.instanceSettings()settingsGet.generalSettings() ⇒ object
Get instance general settings
Kind: static method of settingsGet
Returns: object - General settings structure
Example
$.settingsGet.generalSettings()$.settingsSet
Kind: static interface of $
settingsSet.generalSettings(settingsStructure) ⇒ object
Set instance general settings
Kind: static method of settingsSet
Returns: object - Settings structure
| Param | Type | Description |
|---|---|---|
| settingsStructure | object | Settings structure |
Example
$.settingsSet.generalSettings(settingsStructure)$.dictionaryGet
Kind: static interface of $
$.dictionarySet
Kind: static interface of $
- .dictionarySet
- .createDict(dictStructure) ⇒ object
- .deleteDict(dictId) ⇒ object
dictionarySet.createDict(dictStructure) ⇒ object
Create new dict
Kind: static method of dictionarySet
Returns: object - Dictionary structure
| Param | Type | Description |
|---|---|---|
| dictStructure | object | Dictionary structure |
Example
$.dictionarySet.createDict(dictStructure)dictionarySet.deleteDict(dictId) ⇒ object
Delete dict by dictId
Kind: static method of dictionarySet
Returns: object - Dictionary structure
| Param | Type | Description |
|---|---|---|
| dictId | object | Dictionary Id |
Example
$.dictionarySet.deleteDict(dictStructure)$.projectsGet
Kind: static interface of $
- .projectsGet
- .projectSettings(projectId) ⇒ object
- .projectBlocksTypes() ⇒ Array.<object>
- .relatedProjects(projectId) ⇒ Array.<object>
- .projectsByFilters(filterFields, projectClass, page, pageSize, folderName) ⇒ Array.<object>
projectsGet.projectSettings(projectId) ⇒ object
Get project settings
Kind: static method of projectsGet
Returns: object - Project settings structure
| Param | Type | Description |
|---|---|---|
| projectId | string | Project Id |
Example
$.projectsGet.projectSettings(projectId)projectsGet.projectBlocksTypes() ⇒ Array.<object>
Get all types of created visual blocks elements
Kind: static method of projectsGet
Returns: Array.<object> - Array or single project type
Example
$.projectsGet.projectBlocksTypes(projectId)projectsGet.relatedProjects(projectId) ⇒ Array.<object>
Get project related projects
Kind: static method of projectsGet
Returns: Array.<object> - Array realted project structure, like { Id: string; Name?: string | undefined; Type?: "Project" | "IntakeForm" | undefined; Description?: string | undefined; }[]
| Param | Type | Description |
|---|---|---|
| projectId | string | Project Id |
Example
$.projectsGet.relatedProjects(projectId)projectsGet.projectsByFilters(filterFields, projectClass, page, pageSize, folderName) ⇒ Array.<object>
Get project related projects
Kind: static method of projectsGet
Returns: Array.<object> - Array of base information of projects
| Param | Type | Description |
|---|---|---|
| filterFields | object | Field and values object, like {'Направление': 'продажи'} |
| projectClass | string | Class of project |
| page | number | Page number |
| pageSize | number | Page size |
| folderName | string | Folder of projects class |
Example
$.projectsGet.projectsByFilters({'Направление': 'продажи'}, 'Дело', 1, 20, 'Папка с делами')$.projectsSet
Kind: static interface of $
- .projectsSet
- .relatedProject(params) ⇒ boolean
- .projectSettings(projectSettingsStructure) ⇒ object
- .createProjectClass(classStructure) ⇒ object
- .createProjectType(projectTypeParams) ⇒ object
- .updateProjectType(projectTypeParams) ⇒ object
- .deleteProjectType(projectTypeId) ⇒ object
- .updateVisualBlock(blockData) ⇒ object
- .projectCreate(projectStructure) ⇒ object
- .projectCopy(projectStructure) ⇒ string
- .updateProject(projectStructure) ⇒ object
- .deleteProject(projectId) ⇒ boolean
projectsSet.relatedProject(params) ⇒ boolean
Get project related projects
Kind: static method of projectsSet
Returns: boolean - Result true or false
| Param | Type | Description |
|---|---|---|
| params | object | Params to save |
Example
$.projectsSet.relatedProject({ Id: string; Type?: "ProjectToProjects" | "ProjectToIntakeObjects" | "IntakeObjectToProjects" | undefined; RelatedObjects: { Id: string; Name?: string | undefined; Type?: "Project" | "IntakeForm" | undefined; Description?: string | undefined; }[])projectsSet.projectSettings(projectSettingsStructure) ⇒ object
Get project related projects
Kind: static method of projectsSet
Returns: object - Settings structure
| Param | Type | Description |
|---|---|---|
| projectSettingsStructure | object | Settings structure |
Example
$.projectsSet.projectSettings(projectSettingsStructure)projectsSet.createProjectClass(classStructure) ⇒ object
Create class of projects
Kind: static method of projectsSet
Returns: object - Class structure
| Param | Type | Description |
|---|---|---|
| classStructure | object | Class structure, like { Name: string; Section: string; Icon: string; } |
Example
$.projectsSet.createProjectClass({ Name: string; Section: string; Icon: string; })projectsSet.createProjectType(projectTypeParams) ⇒ object
Create type of project
Kind: static method of projectsSet
Returns: object - Params of project type
| Param | Type | Description |
|---|---|---|
| projectTypeParams | object | Params of project type |
Example
$.projectsSet.createProjectType({ Name: string; Section: string; Icon: string; })projectsSet.updateProjectType(projectTypeParams) ⇒ object
Update type of project
Kind: static method of projectsSet
Returns: object - Params of project type
| Param | Type | Description |
|---|---|---|
| projectTypeParams | object | Params of project type |
Example
$.projectsSet.updateProjectType(projectTypeParams)projectsSet.deleteProjectType(projectTypeId) ⇒ object
Delete type of project
Kind: static method of projectsSet
Returns: object - Project type structure
| Param | Type | Description |
|---|---|---|
| projectTypeId | object | Project type Id |
Example
$.projectsSet.deleteProjectType(projectTypeId)projectsSet.updateVisualBlock(blockData) ⇒ object
Update visulaBlock element
Kind: static method of projectsSet
Returns: object - Project type structure
| Param | Type | Description |
|---|---|---|
| blockData | object | Single block data |
Example
$.projectsSet.updateVisualBlock(projectTypeId)projectsSet.projectCreate(projectStructure) ⇒ object
Create new project
Kind: static method of projectsSet
Returns: object - Project structure
| Param | Type | Description |
|---|---|---|
| projectStructure | object | Project structure |
Example
$.projectsSet.projectStructure(projectStructure)projectsSet.projectCopy(projectStructure) ⇒ string
Copy project with part of data
Kind: static method of projectsSet
Returns: string - Text result
| Param | Type | Description |
|---|---|---|
| projectStructure | object | Project structure |
Example
$.projectsSet.projectCopy(projectStructure)projectsSet.updateProject(projectStructure) ⇒ object
Update project
Kind: static method of projectsSet
Returns: object - Project structure
| Param | Type | Description |
|---|---|---|
| projectStructure | object | Project structure |
Example
$.projectsSet.updateProject(projectStructure, 'mainTab' | 'allTabs')projectsSet.deleteProject(projectId) ⇒ boolean
Delete project
Kind: static method of projectsSet
Returns: boolean - True
| Param | Type | Description |
|---|---|---|
| projectId | object | Project Id |
Example
$.projectsSet.deleteProject(projectId)$.projectsBlocksGet
Kind: static interface of $
- .projectsBlocksGet
- .blockByBlockName(project, blockName, removeIds) ⇒ object
- .pathsByName(project, params) ⇒ Array.<object>
- .blockIdByBlockName(project, blockName) ⇒ string
- .blockByBlockId(project, blockId) ⇒ string
projectsBlocksGet.blockByBlockName(project, blockName, removeIds) ⇒ object
Find block by block name and return it, can use for copy blocks with same structures
Kind: static method of projectsBlocksGet
Returns: object - Block structure
| Param | Type | Description |
|---|---|---|
| project | object | Project structure, obtained by $.projectsGet.projectById(...) |
| blockName | string | Name of block |
| removeIds | boolean | False by defaults |
Example
$.projectsBlocksGet.blockByBlockName(project, 'Маркетинг', true)projectsBlocksGet.pathsByName(project, params) ⇒ Array.<object>
Find path to value in blocks
Kind: static method of projectsBlocksGet
Returns: Array.<object> - FiledPaths array, like { blockId, lineId, FiledId, ...etc }[]
| Param | Type | Description |
|---|---|---|
| project | object | Project structure, obtained by $.projectsGet.projectById(...) |
| params | object | Params for getting path |
Example
$.projectsBlocksGet.pathsByName(project, { fieldNames: ['Поле 1', 'Поле 2'], blockName: 'Новый блок' })projectsBlocksGet.blockIdByBlockName(project, blockName) ⇒ string
Find block by name and return block id
Kind: static method of projectsBlocksGet
Returns: string - Block Id
| Param | Type | Description |
|---|---|---|
| project | object | Project structure, obtained by $.projectsGet.projectById(...) |
| blockName | object | Name of block |
Example
$.projectsBlocksGet.pathsByName(project, 'Новый блок')projectsBlocksGet.blockByBlockId(project, blockId) ⇒ string
Find block in blocks and return full structure of block
Kind: static method of projectsBlocksGet
Returns: string - Single block structure
| Param | Type | Description |
|---|---|---|
| project | object | Project structure, obtained by $.projectsGet.projectById(...) |
| blockId | object | Block Id |
Example
$.projectsBlocksGet.blockByBlockId(project, 'Новый блок')$.projectsBlocksSet
Kind: static interface of $
projectsBlocksSet.valueToBlock(project, fieldPath, valueToSave)
Save value to block by path, after possible save project by use $.projectsSet.updateProject(...)
Kind: static method of projectsBlocksSet
| Param | Type | Description |
|---|---|---|
| project | object | Project structure, obtained by $.projectsGet.projectById(...) |
| fieldPath | object | Object like { blockId, lineId, fieldId, blockOrder, lineOrder }, obtained by $.projectsBlockGet.pathByName(...) |
| valueToSave | any | Value to save |
Example
$.projectsBlocksSet.valueToBlock(project, $.projectsBlockGet.pathByName(...), 'valueToSave')$.filesGet
Kind: static interface of $
- .filesGet
- .fileById(fileId, binary) ⇒ string
- .fileByDocumentId(documentId, binary) ⇒ string
filesGet.fileById(fileId, binary) ⇒ string
Get file by Id
Kind: static method of filesGet
Returns: string - Text presentation of file
| Param | Type | Description |
|---|---|---|
| fileId | string | File Id |
| binary | boolean | Format, by default false |
Example
$.filesGet.fileById(fileId, false)filesGet.fileByDocumentId(documentId, binary) ⇒ string
Get file by document Id
Kind: static method of filesGet
Returns: string - Text presentation of file
| Param | Type | Description |
|---|---|---|
| documentId | string | File Id |
| binary | boolean | Format, by default false |
Example
$.filesGet.fileByDocumentId(documentId, false)$.filesSet
Kind: static interface of $
filesSet.uploadToFolder(folderId, file, fileName, fileFormat) ⇒ object
Upload file to folder
Kind: static method of filesSet
Returns: object - Attach result structure
| Param | Type | Description | |
|---|---|---|---|
| folderId | string | File Id | |
| file | string | Text presentstion of file | |
| fileName | string | Name of file | |
| fileFormat | string | 'Binary' | 'Text' |
Example
$.filesSet.uploadToFolder(folderId: string, file: string, fileName: string, fileFormat: 'Binary' | 'Text')$.notificationsSet
Kind: static interface of $
notificationsSet.toSingleUser(notificationStructure) ⇒ object
Send notification to user by id
Kind: static method of notificationsSet
Returns: object - Notification structure
| Param | Type | Description |
|---|---|---|
| notificationStructure | object | Notification structure |
Example
$.notificationsSet.toSingleUser({ NotificationUserId: string, NotificationHeaderText: string, NotificationText: string, NotificationType: "Success" | "Error" | "Info" | "Attention" })$.tasksGet
Kind: static interface of $
tasksGet.taskById(taskId) ⇒ object
Get task by taskId
Kind: static method of tasksGet
Returns: object - Task structure
| Param | Type | Description |
|---|---|---|
| taskId | string | Task Id |
Example
$.tasksGet.taskById(taskId)$.usersGet
Kind: static interface of $
$.participantsGet
Kind: static interface of $
participantsGet.participantsByFilters(params, type) ⇒ boolean
Get participants by filters
Kind: static method of participantsGet
Returns: boolean - True or false result
| Param | Type | Description |
|---|---|---|
| params | object | Participant filter structure |
| type | string | undefined | Type of request - roled or undefined |
Example
$.participantsGet.participantsByFilters(params, 'roled')participantsGet.participantById(participantId) ⇒ object
Get participant
Kind: static method of participantsGet
Returns: object - Participant structure
| Param | Type | Description |
|---|---|---|
| participantId | string | Participant Id |
Example
$.participantsGet.participantById(participantId)participantsGet.blockValueByName(participant, fieldName) ⇒ any
Find value in paticipant blocks
Kind: static method of participantsGet
Returns: any - Field value
| Param | Type | Description |
|---|---|---|
| participant | object | Participant structure |
| fieldName | string | Name of needed field |
Example
$.participantsGet.blockValueByName(participantId)$.participantsSet
Kind: static interface of $
participantsSet.participantToProject(participantInfo) ⇒ object
Set participant to project
Kind: static method of participantsSet
Returns: object - Participant structure
| Param | Type | Description |
|---|---|---|
| participantInfo | object | Participant structure |
Example
$.participantsSet.participantToProject(participantInfo)participantsSet.createParticipant(participantStructure) ⇒ object
Create participant
Kind: static method of participantsSet
Returns: object - Participant structure
| Param | Type | Description |
|---|---|---|
| participantStructure | object | Participant structure |
Example
$.participantsSet.createParticipant(participantStructure)$.feedsGet
Kind: static interface of $
- .feedsGet
- .feedById(feedId) ⇒ object
- .feedsByFilters(feedsFilter) ⇒ Array.<object>
feedsGet.feedById(feedId) ⇒ object
Get feed by feedId
Kind: static method of feedsGet
Returns: object - Structure of feed
| Param | Type | Description |
|---|---|---|
| feedId | string | Feed Id |
Example
$.feedsGet.feedById(feedId)feedsGet.feedsByFilters(feedsFilter) ⇒ Array.<object>
Find events in feed by filters
Kind: static method of feedsGet
Returns: Array.<object> - Array of feeds
| Param | Type | Description |
|---|---|---|
| feedsFilter | object | Feed filter structure |
Example
$.feedsGet.feedsByFilters(feedsFilter)$.commentsSet
Kind: static interface of $
commentsSet.createComment(commentStructure) ⇒ object
Create comment
Kind: static method of commentsSet
Returns: object - Structure of comment
| Param | Type | Description |
|---|---|---|
| commentStructure | object | Structure of comment |
Example
$.commentsSet.createComment(commentStructure)$.eventsSet
Kind: static interface of $
eventsSet.createEvent(eventStructure) ⇒ object
Get event structure by Id
Kind: static method of eventsSet
Returns: object - Event structure
| Param | Type | Description |
|---|---|---|
| eventStructure | object | Id of event |
Example
$.eventsSet.createEvent(eventStructure)$.eventsGet
Kind: static interface of $
eventsGet.eventTypes() ⇒ Array.<object>
Get all event types
Kind: static method of eventsGet
Returns: Array.<object> - Event types list
Example
$.eventsGet.eventTypes()$.casebookSet
Kind: static interface of $
casebookSet.enableSync(casebookData) ⇒ boolean
Enable CaseeBook sync
Kind: static method of casebookSet
Returns: boolean - True or false result
| Param | Type | Description |
|---|---|---|
| casebookData | object | Request structure |
Example
$.casebookSet.enableSync({ ProjectId: 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx', CasebookNumber: 1234567 })$.reportsGet
Kind: static interface of $
- .reportsGet
- .reportsList(params) ⇒ object
- .reportData(params) ⇒ Array.<Array.<string>>
reportsGet.reportsList(params) ⇒ object
Kind: static method of reportsGet
Returns: object - Report list
| Param | Type | Description |
|---|---|---|
| params | object | Structure of request |
Example
$.reportsGet.reportsList(reportRequestStructure)reportsGet.reportData(params) ⇒ Array.<Array.<string>>
Kind: static method of reportsGet
Returns: Array.<Array.<string>> - Report data as lines
| Param | Type | Description |
|---|---|---|
| params | object | Get report data with filters |
Example
$.reportsGet.reportData({ ReportMetadataId: uuid, Filters: { Дата: ['2020-01-01', '2020-01-30'], 'Тип дела':['Продажи'] }})$.emailSet
Kind: static interface of $
emailSet.send(letter) ⇒ object
Kind: static method of emailSet
Returns: object - Single email structure
| Param | Type | Description |
|---|---|---|
| letter | object | Single email structure |
Example
$.emailGet.emailById(params)$.emailGet
Kind: static interface of $
emailGet.emailById(emailId) ⇒ object
Kind: static method of emailGet
Returns: object - Single email structure
| Param | Type | Description |
|---|---|---|
| emailId | string | Id of email |
Example
$.emailGet.emailById('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx')5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago