Skip to content
Merged

1764 #1818

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
111 changes: 111 additions & 0 deletions docs/src/content/docs/reference/components/webflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
---
title: "Webflow"
description: "Webflow is a web design and development platform that allows users to build responsive websites visually without writing code."
---
## Reference
<hr />

Webflow is a web design and development platform that allows users to build responsive websites visually without writing code.


Categories: [developer-tools]


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


### Fulfill Order
Updates an order's status to fulfilled.

#### Properties

| Name | Type | Control Type | Description |
|:--------------:|:------------:|:--------------------:|:-------------------:|
| Site | STRING | SELECT | |
| Order | STRING | SELECT | |


### Output



Type: OBJECT


#### Properties

| Type | Control Type |
|:------------:|:--------------------:|
| {STRING\(orderId), STRING\(status)} | OBJECT_BUILDER |






### Get Collection Item
Get collection item in a collection.

#### Properties

| Name | Type | Control Type | Description |
|:--------------:|:------------:|:--------------------:|:-------------------:|
| Site | STRING | SELECT | |
| Collection | STRING | SELECT | |
| Item | STRING | SELECT | |


### Output



Type: OBJECT


#### Properties

| Type | Control Type |
|:------------:|:--------------------:|
| {STRING\(id), {STRING\(name), STRING\(slug)}\(fieldData)} | 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 @@ -228,6 +228,7 @@ dependencies {
implementation(project(":server:libs:modules:components:typeform"))
implementation(project(":server:libs:modules:components:var"))
implementation(project(":server:libs:modules:components:vtiger"))
implementation(project(":server:libs:modules:components:webflow"))
implementation(project(":server:libs:modules:components:webhook"))
implementation(project(":server:libs:modules:components:whatsapp"))
implementation(project(":server:libs:modules:components:xero"))
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 @@ -149,6 +149,7 @@ dependencies {
implementation(project(":server:libs:modules:components:typeform"))
implementation(project(":server:libs:modules:components:var"))
implementation(project(":server:libs:modules:components:vtiger"))
implementation(project(":server:libs:modules:components:webflow"))
implementation(project(":server:libs:modules:components:webhook"))
implementation(project(":server:libs:modules:components:whatsapp"))
implementation(project(":server:libs:modules:components:xero"))
Expand Down
96 changes: 96 additions & 0 deletions server/libs/modules/components/webflow/openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
---
openapi: "3.0.1"
info:
title: "Webflow"
description: "Webflow is a web design and development platform that allows users to build responsive websites visually without writing code."
version: "v1"
servers:
- url: "https://api.webflow.com"
paths:
/v2/sites/{siteId}/orders/{orderId}/fulfill:
post:
summary: "Fulfill Order"
description: "Updates an order's status to fulfilled."
operationId: "fulfillOrder"
parameters:
- name: "siteId"
in: "path"
required: true
schema:
type: "string"
title: "Site"
- name: "orderId"
in: "path"
required: true
schema:
type: "string"
title: "Order"
responses:
200:
description: "Successful operation"
content:
application/json:
schema:
type: "object"
properties:
body:
type: "object"
properties:
orderId:
type: "string"
status:
type: "string"
/v2/collections/{collectionId}/item/{itemId}:
get:
summary: "Get Collection Item"
description: "Get collection item in a collection."
operationId: "getCollectionItem"
parameters:
- name: "collectionId"
in: "path"
description: ""
required: true
schema:
type: "string"
title: "Collection"
- name: "itemId"
in: "path"
description: ""
required: true
schema:
type: "string"
title: "Item"
responses:
200:
description: "Successful operation"
content:
application/json:
schema:
type: "object"
properties:
body:
type: "object"
properties:
id:
type: "string"
fieldData:
type: "object"
properties:
name:
type: "string"
slug:
type: "string"
components:
securitySchemes:
oauth2:
type: "oauth2"
flows:
authorizationCode:
authorizationUrl: "https://webflow.com/oauth/authorize"
tokenUrl: "https://api.webflow.com/oauth/access_token"
refreshUrl: "https://api.webflow.com/oauth/access_token"
scopes:
cms:read: " "
ecommerce:read: " "
ecommerce:write: " "
sites:read: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* 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.webflow;

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

import com.bytechef.component.OpenApiComponentHandler;
import com.bytechef.component.definition.ComponentDefinition;
import com.bytechef.component.webflow.action.WebflowFulfillOrderAction;
import com.bytechef.component.webflow.action.WebflowGetCollectionItemAction;
import com.bytechef.component.webflow.connection.WebflowConnection;

/**
* Provides the base implementation for the REST based component.
*
* @generated
*/
public abstract class AbstractWebflowComponentHandler implements OpenApiComponentHandler {
private final ComponentDefinition componentDefinition = modifyComponent(
component("webflow")
.title("Webflow")
.description(
"Webflow is a web design and development platform that allows users to build responsive websites visually without writing code."))
.actions(modifyActions(WebflowFulfillOrderAction.ACTION_DEFINITION,
WebflowGetCollectionItemAction.ACTION_DEFINITION))
.connection(modifyConnection(WebflowConnection.CONNECTION_DEFINITION))
.triggers(getTriggers());

@Override
public ComponentDefinition getDefinition() {
return componentDefinition;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
/*
* 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.webflow;

import static com.bytechef.component.definition.ComponentDsl.string;
import static com.bytechef.component.webflow.constant.WebflowConstants.COLLECTION_ID;
import static com.bytechef.component.webflow.constant.WebflowConstants.ORDER_ID;
import static com.bytechef.component.webflow.constant.WebflowConstants.SITE_ID;

import com.bytechef.component.OpenApiComponentHandler;
import com.bytechef.component.definition.ActionDefinition;
import com.bytechef.component.definition.ComponentCategory;
import com.bytechef.component.definition.ComponentDsl.ModifiableActionDefinition;
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.definition.Property;
import com.bytechef.component.webflow.util.WebflowUtils;
import com.google.auto.service.AutoService;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Optional;

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

@Override
public List<? extends ModifiableActionDefinition> modifyActions(ModifiableActionDefinition... actionDefinitions) {

for (ModifiableActionDefinition modifiableActionDefinition : actionDefinitions) {
if (Objects.equals(modifiableActionDefinition.getName(), "getCollectionItem")) {
Optional<List<? extends Property>> propertiesOptional = modifiableActionDefinition.getProperties();

List<Property> properties = new ArrayList<>(propertiesOptional.get());

properties.addFirst(
string(SITE_ID)
.label("Site")
.options((ActionOptionsFunction<String>) WebflowUtils::getSiteOptions)
.required(true));

modifiableActionDefinition.properties(properties);
}
}

return super.modifyActions(actionDefinitions);
}

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

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

if (Objects.equals(modifiableProperty.getName(), SITE_ID)) {
((ModifiableStringProperty) modifiableProperty)
.options((ActionOptionsFunction<String>) WebflowUtils::getSiteOptions);
} else if (Objects.equals(modifiableProperty.getName(), ORDER_ID)) {
((ModifiableStringProperty) modifiableProperty)
.options((ActionOptionsFunction<String>) WebflowUtils::getOrderOptions)
.optionsLookupDependsOn(SITE_ID);
} else if (Objects.equals(modifiableProperty.getName(), COLLECTION_ID)) {
((ModifiableStringProperty) modifiableProperty)
.options((ActionOptionsFunction<String>) WebflowUtils::getCollectionOptions)
.optionsLookupDependsOn(SITE_ID);
} else if (Objects.equals(modifiableProperty.getName(), "itemId")) {
((ModifiableStringProperty) modifiableProperty)
.options((ActionOptionsFunction<String>) WebflowUtils::getCollectionItemOptions)
.optionsLookupDependsOn(COLLECTION_ID, SITE_ID);
}

return modifiableProperty;
}
}
Loading
Loading