Skip to content
Merged
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
6 changes: 3 additions & 3 deletions server/libs/modules/components/webflow/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ info:
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"
- url: "https://api.webflow.com/v2"
paths:
/v2/sites/{siteId}/orders/{orderId}/fulfill:
/sites/{siteId}/orders/{orderId}/fulfill:
post:
summary: "Fulfill Order"
description: "Updates an order's status to fulfilled."
Expand Down Expand Up @@ -40,7 +40,7 @@ paths:
type: "string"
status:
type: "string"
/v2/collections/{collectionId}/item/{itemId}:
/collections/{collectionId}/items/{itemId}:
get:
summary: "Get Collection Item"
description: "Get collection item in a collection."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class WebflowFulfillOrderAction {
.metadata(
Map.of(
"method", "POST",
"path", "/v2/sites/{siteId}/orders/{orderId}/fulfill"
"path", "/sites/{siteId}/orders/{orderId}/fulfill"

))
.properties(string("siteId").label("Site")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class WebflowGetCollectionItemAction {
.metadata(
Map.of(
"method", "GET",
"path", "/v2/collections/{collectionId}/item/{itemId}"
"path", "/collections/{collectionId}/items/{itemId}"

))
.properties(string("collectionId").label("Collection")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*/
public class WebflowConnection {
public static final ComponentDsl.ModifiableConnectionDefinition CONNECTION_DEFINITION = connection()
.baseUri((connectionParameters, context) -> "https://api.webflow.com")
.baseUri((connectionParameters, context) -> "https://api.webflow.com/v2")
.authorizations(authorization(AuthorizationType.OAUTH2_AUTHORIZATION_CODE)
.title("OAuth2 Authorization Code")
.properties(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,19 @@ public static List<Option<String>> getCollectionItemOptions(
Parameters inputParameters, Parameters connectionParameters, Map<String, String> dependencyPaths,
String searchText, ActionContext context) {

Map<String, List<Map<String, Object>>> body = context
Map<String, Object> body = context
.http(http -> http.get("/collections/" + inputParameters.getRequiredString(COLLECTION_ID) + "/items"))
.configuration(Http.responseType(Http.ResponseType.JSON))
.execute()
.getBody(new TypeReference<>() {});

List<Option<String>> options = new ArrayList<>();

for (Map<String, Object> map : body.get("items")) {
if (map.get("fieldData") instanceof Map<?, ?> fieldDataMap) {
options.add(option((String) fieldDataMap.get("name"), (String) map.get(ID)));
if (body.get("items") instanceof List<?> list) {
for (Object item : list) {
if (item instanceof Map<?, ?> itemMap && (itemMap.get("fieldData") instanceof Map<?, ?> fieldData)) {
options.add(option((String) fieldData.get("name"), (String) itemMap.get(ID)));
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"help" : null,
"metadata" : {
"method" : "POST",
"path" : "/v2/sites/{siteId}/orders/{orderId}/fulfill"
"path" : "/sites/{siteId}/orders/{orderId}/fulfill"
},
"name" : "fulfillOrder",
"outputDefinition" : {
Expand Down Expand Up @@ -258,7 +258,7 @@
"help" : null,
"metadata" : {
"method" : "GET",
"path" : "/v2/collections/{collectionId}/item/{itemId}"
"path" : "/collections/{collectionId}/items/{itemId}"
},
"name" : "getCollectionItem",
"outputDefinition" : {
Expand Down
Loading