Skip to content
Merged

1740 #1741

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions docs/src/content/docs/reference/components/zeplin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
title: "Zeplin"
description: "Zeplin is a collaboration tool that bridges the gap between designers and developers by providing a platform to share, organize, and translate design files into development."
---
## Reference
<hr />

Zeplin is a collaboration tool that bridges the gap between designers and developers by providing a platform to share, organize, and translate design files into development.


Categories: [communication]


Version: 1

<hr />



## Connections

Version: 1


### OAuth2 Authorization Code

#### Properties

| Name | Type | Control Type | Description |
|:--------------:|:------------:|:--------------------:|:-------------------:|
| Client Id | STRING | TEXT | |
| Client Secret | STRING | TEXT | |





<hr />



## Triggers



<hr />



## Actions


### Update Project
Updates an existing project.

#### Properties

| Name | Type | Control Type | Description |
|:--------------:|:------------:|:--------------------:|:-------------------:|
| Project | STRING | SELECT | Project to update. |
| Project | {STRING\(name), STRING\(description)} | OBJECT_BUILDER | |




1 change: 1 addition & 0 deletions server/apps/server-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ dependencies {
implementation(project(":server:libs:modules:components:xml-file"))
implementation(project(":server:libs:modules:components:xml-helper"))
implementation(project(":server:libs:modules:components:zendesk-sell"))
implementation(project(":server:libs:modules:components:zeplin"))
implementation(project(":server:libs:modules:components:zoho:zoho-crm"))

implementation(project(":server:libs:modules:task-dispatchers:branch"))
Expand Down
1 change: 1 addition & 0 deletions server/ee/apps/worker-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ dependencies {
implementation(project(":server:libs:modules:components:xml-file"))
implementation(project(":server:libs:modules:components:xml-helper"))
implementation(project(":server:libs:modules:components:zendesk-sell"))
implementation(project(":server:libs:modules:components:zeplin"))
implementation(project(":server:libs:modules:components:zoho:zoho-crm"))

runtimeOnly("org.springframework.boot:spring-boot-starter-amqp")
Expand Down
51 changes: 51 additions & 0 deletions server/libs/modules/components/zeplin/openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
openapi: "3.0.2"
info:
title: "Zeplin"
description: "Zeplin is a collaboration tool that bridges the gap between designers and developers by providing a platform to share, organize, and translate design files into development."
version: "v1"
servers:
- url: "https://api.zeplin.dev/v1"
paths:
/projects/{project_id}:
patch:
summary: "Update Project"
description: "Updates an existing project."
operationId: "updateProject"
parameters:
- name: "project_id"
in: "path"
description: "Project to update."
required: true
schema:
type: "string"
title: "Project"
requestBody:
required: true
content:
application/json:
schema:
type: "object"
title: "Project"
required:
- "name"
properties:
name:
type: "string"
format: "uuid"
description: "New name for the project."
description:
type: "string"
description: "New description for the project."
responses:
204:
description: "Successful update."
components:
securitySchemes:
oauth2:
type: "oauth2"
flows:
authorizationCode:
authorizationUrl: "https://api.zeplin.dev/v1/oauth/authorize"
tokenUrl: "https://api.zeplin.dev/v1/oauth/token"
refreshUrl: "https://api.zeplin.dev/v1/oauth/token"
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright 2023-present ByteChef Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.bytechef.component.zeplin;

import static com.bytechef.component.definition.ComponentDsl.component;

import com.bytechef.component.OpenApiComponentHandler;
import com.bytechef.component.definition.ComponentDefinition;
import com.bytechef.component.zeplin.action.ZeplinUpdateProjectAction;
import com.bytechef.component.zeplin.connection.ZeplinConnection;

/**
* Provides the base implementation for the REST based component.
*
* @generated
*/
public abstract class AbstractZeplinComponentHandler implements OpenApiComponentHandler {
private final ComponentDefinition componentDefinition = modifyComponent(
component("zeplin")
.title("Zeplin")
.description(
"Zeplin is a collaboration tool that bridges the gap between designers and developers by providing a platform to share, organize, and translate design files into development."))
.actions(modifyActions(ZeplinUpdateProjectAction.ACTION_DEFINITION))
.connection(modifyConnection(ZeplinConnection.CONNECTION_DEFINITION))
.triggers(getTriggers());

@Override
public ComponentDefinition getDefinition() {
return componentDefinition;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright 2023-present ByteChef Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.bytechef.component.zeplin;

import com.bytechef.component.OpenApiComponentHandler;
import com.bytechef.component.definition.ActionDefinition;
import com.bytechef.component.definition.ComponentCategory;
import com.bytechef.component.definition.ComponentDsl.ModifiableComponentDefinition;
import com.bytechef.component.definition.ComponentDsl.ModifiableProperty;
import com.bytechef.component.definition.ComponentDsl.ModifiableStringProperty;
import com.bytechef.component.definition.OptionsDataSource.ActionOptionsFunction;
import com.bytechef.component.zeplin.util.ZeplinUtils;
import com.google.auto.service.AutoService;
import java.util.Objects;

/**
* @author Monika Kušter
*/
@AutoService(OpenApiComponentHandler.class)
public class ZeplinComponentHandler extends AbstractZeplinComponentHandler {

@Override
public ModifiableComponentDefinition modifyComponent(ModifiableComponentDefinition modifiableComponentDefinition) {
return modifiableComponentDefinition
.customAction(true)
.icon("path:assets/zeplin.svg")
.categories(ComponentCategory.COMMUNICATION);
}

@Override
public ModifiableProperty<?> modifyProperty(
ActionDefinition actionDefinition, ModifiableProperty<?> modifiableProperty) {

if (Objects.equals(modifiableProperty.getName(), "project_id")) {
((ModifiableStringProperty) modifiableProperty)
.options((ActionOptionsFunction<String>) ZeplinUtils::getProjectIdOptions);
}

return modifiableProperty;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Copyright 2023-present ByteChef Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.bytechef.component.zeplin.action;

import static com.bytechef.component.OpenApiComponentHandler.PropertyType;
import static com.bytechef.component.definition.ComponentDsl.action;
import static com.bytechef.component.definition.ComponentDsl.object;
import static com.bytechef.component.definition.ComponentDsl.string;
import static com.bytechef.component.definition.Context.Http.BodyContentType;

import com.bytechef.component.definition.ComponentDsl;
import java.util.Map;

/**
* Provides a list of the component actions.
*
* @generated
*/
public class ZeplinUpdateProjectAction {
public static final ComponentDsl.ModifiableActionDefinition ACTION_DEFINITION = action("updateProject")
.title("Update Project")
.description("Updates an existing project.")
.metadata(
Map.of(
"method", "PATCH",
"path", "/projects/{project_id}", "bodyContentType", BodyContentType.JSON, "mimeType",
"application/json"

))
.properties(string("project_id").label("Project")
.description("Project to update.")
.required(true)
.metadata(
Map.of(
"type", PropertyType.PATH)),
object("__item").properties(string("name").label("Name")
.description("New name for the project.")
.required(true),
string("description").label("Description")
.description("New description for the project.")
.required(false))
.label("Project")
.required(true)
.metadata(
Map.of(
"type", PropertyType.BODY)));

private ZeplinUpdateProjectAction() {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright 2023-present ByteChef Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.bytechef.component.zeplin.connection;

import static com.bytechef.component.definition.Authorization.AuthorizationType;
import static com.bytechef.component.definition.Authorization.CLIENT_ID;
import static com.bytechef.component.definition.Authorization.CLIENT_SECRET;
import static com.bytechef.component.definition.ComponentDsl.authorization;
import static com.bytechef.component.definition.ComponentDsl.connection;
import static com.bytechef.component.definition.ComponentDsl.string;

import com.bytechef.component.definition.ComponentDsl;

/**
* Provides the component connection definition.
*
* @generated
*/
public class ZeplinConnection {
public static final ComponentDsl.ModifiableConnectionDefinition CONNECTION_DEFINITION = connection()
.baseUri((connectionParameters, context) -> "https://api.zeplin.dev/v1")
.authorizations(authorization(AuthorizationType.OAUTH2_AUTHORIZATION_CODE)
.title("OAuth2 Authorization Code")
.properties(
string(CLIENT_ID)
.label("Client Id")
.required(true),
string(CLIENT_SECRET)
.label("Client Secret")
.required(true))
.authorizationUrl((connectionParameters, context) -> "https://api.zeplin.dev/v1/oauth/authorize")
.tokenUrl((connectionParameters, context) -> "https://api.zeplin.dev/v1/oauth/token")
.refreshUrl((connectionParameters, context) -> "https://api.zeplin.dev/v1/oauth/token"));

private ZeplinConnection() {
}
}
Loading