@zeplin/sdk
Version:
Zeplin API client for JavaScript
77 lines (76 loc) • 7.6 kB
TypeScript
/**
* Zeplin API
* Access your resources in Zeplin
*
* Contact: support@zeplin.io
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { NotificationActor } from './notification-actor';
import { NotificationResource } from './notification-resource';
import { NotificationTypeEnum } from './notification-type-enum';
export declare const transformNotificationToJSON: (value: Notification) => any;
export declare const transformJSONToNotification: (value: any) => Notification;
/**
* Notification objects have a polymorphic structure. They can be of various types and each type has a certain set of actions that describe the notification further. Notification content (specifically `resource` and `context` fields) varies based on the value of type field. These variations and their details are described in the table below. Type | Actions | Context | Resource | Description --| --| --| --| -- `workspace.project` | `activated`<br>`archived`<br>`deleted`<br>`ownership_transferred` | - | `Project (extra: { name, platform })` | Used for changes related to projects in a workspace. `workspace.styleguide` | `activated`<br>`archived`<br>`deleted`<br>`ownership_transferred` | - | `Styleguide (extra: { name, platform })` | Used for changes related to styleguides in a workspace. `workspace.organization.member` | `role_updated`<br>`invited` | `Organization (extra: { name })` | `OrganizationMember (extra: { role })` | Used for changes related to members of a workspace. `project.screen` | `created`<br>`version_created`<br>`deleted` | `Project (extra: { name, platform })`<br>`ScreenVersion (extra: { image_url, thumbnails, width, height })` | `Screen (extra: { name })` | Used for changes related to screens in a project. `project.screen.note` | `created`<br>`mentioned` | `Project (extra: { name, platform })`<br>`Screen (extra: { name })`<br>`ScreenNoteComment (extra: { content })` | `Screen (extra: { order, color, status })` | Used for changes related to notes. `project.screen.note.comment` | `created`<br>`mentioned` | `Project (extra: { name, platform })`<br>`Screen (extra: { name })`<br>`Screen (extra: { order, color, status })` | `ScreenNoteComment (extra: { content })` | Used for changes related to note comments. `project.color` | `created`<br>`updated`<br>`deleted` | `Project (extra: { name, platform })` | `Color (extra: { name, r, g, b, a })` | Used for changes related to colors in a project. `project.text_style` | `created`<br>`updated`<br>`deleted` | `Project (extra: { name, platform })` | `TextStyle (extra: { name })` | Used for changes related to text styles in a project. `project.component` | `created`<br>`version_created`<br>`deleted` | `Project (extra: { name, platform })` | `Component (extra: { name })` | Used for changes related to components in a project. `project.spacing_token` | `created`<br>`updated`<br>`deleted` | `Project (extra: { name, platform })` | `SpacingToken (extra: { name, value })` | Used for changes related to spacing tokens in a project. `project.member` | `joined` | `Project (extra: { name, platform })` | | Used for changes related to members of a project. `project.extension` | `added`<br>`removed` | `Project (extra: { name, platform })` | `Extension (extra: { name })` | Used for changes related to extensions in a project. `project.slack_integration` | `added` | `Project (extra: { name, platform })` | `SlackIntegration (extra: { channel })` | Used for changes related to slack intgrations in a project. `project.jira_attachment` | `added`<br>`removed` | `Project (extra: { name, platform })` | `JiraIntegration (extra: { issue })` | Used for changes related to jira attachments in a project. `project.screen.jira_attachment` | `added`<br>`removed` | `Project (extra: { name, platform })`<br>`Screen (extra: { name })` | `JiraIntegration (extra: { issue })` | Used for changes related to jira attachments in a screen. `project.screen_section.jira_attachment` | `added`<br>`removed` | `Project (extra: { name, platform })`<br>`ScreenSection (extra: { name })` | `JiraIntegration (extra: { issue })` | Used for changes related to jira attachments in a screen section. `project.flow_board` | `added` | `Project (extra: { name, platform })` | `FlowBoard (extra: {})` | Used for changes related to flow boards in a project. `styleguide.color` | `created`<br>`updated`<br>`deleted` | `Styleguide (extra: { name, platform })` | `Color (extra: { name, r, g, b, a })` | Used for changes related to colors in a styleguide. `styleguide.text_style` | `created`<br>`updated`<br>`deleted` | `Styleguide (extra: { name, platform })` | `TextStyle (extra: { name })` | Used for changes related to text styles in a styleguide. `styleguide.component` | `created`<br>`version_created`<br>`deleted` | `Styleguide (extra: { name, platform })` | `Component (extra: { name })` | Used for changes related to components in a styleguide. `styleguide.spacing_token` | `created`<br>`updated`<br>`deleted` | `Styleguide (extra: { name, platform })` | `SpacingToken (extra: { name, value })` | Used for changes related to spacing tokens in a styleguide. `styleguide.member` | `joined` | `Styleguide (extra: { name, platform })` | `User (extra: { username })` | Used for changes related to members of a styleguide. `styleguide.extension` | `added`<br>`removed` | `Styleguide (extra: { name, platform })` | `Extension (extra: { name })` | Used for changes related to extensions in a styleguide. `styleguide.slack_integration` | `added` | `Styleguide (extra: { name, platform })` | `SlackIntegration (extra: { channel })` | Used for changes related to slack intgrations in a styleguide. `user.project_membership` | `invited`<br>`role_updated`<br>`removed` | - | `Project (extra: { name, platform })` | Used for changes related to notified user\'s membership to projects. `user.styleguide_membership` | `invited`<br>`role_updated`<br>`removed` | - | `Styleguide (extra: { name, platform })` | Used for changes related to notified user\'s membership to styleguides.
* @export
* @interface Notification
*/
export interface Notification {
/**
* The unique id of the notification
* @type {string}
* @memberof Notification
*/
id: string;
/**
*
* @type {NotificationTypeEnum}
* @memberof Notification
*/
type: NotificationTypeEnum;
/**
* Whether the notification is read or not
* @type {boolean}
* @memberof Notification
*/
isRead: boolean;
/**
* Action that causes the notification
* @type {string}
* @memberof Notification
*/
action: string;
/**
* The unix timestamp when the screen was created
* @type {number}
* @memberof Notification
*/
created: number;
/**
* The unix timestamp when the screen was updated
* @type {number}
* @memberof Notification
*/
updated: number;
/**
*
* @type {NotificationResource}
* @memberof Notification
*/
resource?: NotificationResource;
/**
* Additional objects which are related to the main resource object. The content of this object changes depending on the `type` field (e.g. `{ project: { ... }, screen: { ... } }` for a screen related notification).
* @type {object}
* @memberof Notification
*/
context: object;
/**
*
* @type {NotificationActor}
* @memberof Notification
*/
actor: NotificationActor;
}