UNPKG

@zeplin/sdk

Version:
57 lines (54 loc) 7.52 kB
"use strict"; require("core-js/modules/es.object.define-property.js"); Object.defineProperty(exports, "__esModule", { value: true }); exports.transformNotificationToJSON = exports.transformJSONToNotification = void 0; var _notificationActor = require("./notification-actor"); var _notificationResource = require("./notification-resource"); var _notificationTypeEnum = require("./notification-type-enum"); /* tslint:disable */ /* eslint-disable */ /** * 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. */ var transformNotificationToJSON = function transformNotificationToJSON(value) { return { id: value.id, type: (0, _notificationTypeEnum.transformNotificationTypeEnumToJSON)(value.type), is_read: value.isRead, action: value.action, created: value.created, updated: value.updated, resource: value.resource && (0, _notificationResource.transformNotificationResourceToJSON)(value.resource), context: value.context, actor: (0, _notificationActor.transformNotificationActorToJSON)(value.actor) }; }; exports.transformNotificationToJSON = transformNotificationToJSON; var transformJSONToNotification = function transformJSONToNotification(value) { return { id: value.id, type: (0, _notificationTypeEnum.transformJSONToNotificationTypeEnum)(value.type), isRead: value.is_read, action: value.action, created: value.created, updated: value.updated, resource: value.resource && (0, _notificationResource.transformJSONToNotificationResource)(value.resource), context: value.context, actor: (0, _notificationActor.transformJSONToNotificationActor)(value.actor) }; }; /** * 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 */ exports.transformJSONToNotification = transformJSONToNotification;