Modules@robinpath/webflow
webflow

@robinpath/webflow

0.1.1Node.jsPublic

Webflow module for RobinPath.

Webflow

Webflow module for RobinPath.

Package: @robinpath/webflow | Category: Cms | Type: Integration

Authentication

webflow.setCredentials "your-credentials"

Call this once at the start of your script before using any other function. Credentials persist for the duration of the script execution.

Use Cases

Use the webflow module when you need to:

  • listSites -- Use webflow.listSites to perform this operation
  • getSite -- Use webflow.getSite to perform this operation
  • publishSite -- Use webflow.publishSite to perform this operation
  • listCollections -- Use webflow.listCollections to perform this operation
  • getCollection -- Use webflow.getCollection to perform this operation

Quick Reference

FunctionDescriptionReturns
setCredentialsConfigure webflow credentials.object
listSiteslistSitesobject
getSitegetSiteobject
publishSitepublishSiteobject
listCollectionslistCollectionsobject
getCollectiongetCollectionobject
listCollectionItemslistCollectionItemsobject
getCollectionItemgetCollectionItemobject
createCollectionItemcreateCollectionItemobject
updateCollectionItemupdateCollectionItemobject
deleteCollectionItemdeleteCollectionItemobject
publishCollectionItemspublishCollectionItemsobject
listFormSubmissionslistFormSubmissionsobject
listDomainslistDomainsobject
getUsergetUserobject
listUserslistUsersobject
listOrderslistOrdersobject
getOrdergetOrderobject
updateOrderupdateOrderobject

Functions

setCredentials

Configure webflow credentials.

Module: webflow | Returns: object -- API response.

webflow.setCredentials
ParameterTypeRequiredDescription
accessTokenstringYesaccessToken

listSites

listSites

Module: webflow | Returns: object -- API response.

webflow.listSites
ParameterTypeRequiredDescription
inputstringNoInput parameter

getSite

getSite

Module: webflow | Returns: object -- API response.

webflow.getSite
ParameterTypeRequiredDescription
inputstringNoInput parameter

publishSite

publishSite

Module: webflow | Returns: object -- API response.

webflow.publishSite
ParameterTypeRequiredDescription
inputstringNoInput parameter

listCollections

listCollections

Module: webflow | Returns: object -- API response.

webflow.listCollections
ParameterTypeRequiredDescription
inputstringNoInput parameter

getCollection

getCollection

Module: webflow | Returns: object -- API response.

webflow.getCollection
ParameterTypeRequiredDescription
inputstringNoInput parameter

listCollectionItems

listCollectionItems

Module: webflow | Returns: object -- API response.

webflow.listCollectionItems
ParameterTypeRequiredDescription
inputstringNoInput parameter

getCollectionItem

getCollectionItem

Module: webflow | Returns: object -- API response.

webflow.getCollectionItem
ParameterTypeRequiredDescription
inputstringNoInput parameter

createCollectionItem

createCollectionItem

Module: webflow | Returns: object -- API response.

webflow.createCollectionItem
ParameterTypeRequiredDescription
inputstringNoInput parameter

updateCollectionItem

updateCollectionItem

Module: webflow | Returns: object -- API response.

webflow.updateCollectionItem
ParameterTypeRequiredDescription
inputstringNoInput parameter

deleteCollectionItem

deleteCollectionItem

Module: webflow | Returns: object -- API response.

webflow.deleteCollectionItem
ParameterTypeRequiredDescription
inputstringNoInput parameter

publishCollectionItems

publishCollectionItems

Module: webflow | Returns: object -- API response.

webflow.publishCollectionItems
ParameterTypeRequiredDescription
inputstringNoInput parameter

listFormSubmissions

listFormSubmissions

Module: webflow | Returns: object -- API response.

webflow.listFormSubmissions
ParameterTypeRequiredDescription
inputstringNoInput parameter

listDomains

listDomains

Module: webflow | Returns: object -- API response.

webflow.listDomains
ParameterTypeRequiredDescription
inputstringNoInput parameter

getUser

getUser

Module: webflow | Returns: object -- API response.

webflow.getUser
ParameterTypeRequiredDescription
inputstringNoInput parameter

listUsers

listUsers

Module: webflow | Returns: object -- API response.

webflow.listUsers
ParameterTypeRequiredDescription
inputstringNoInput parameter

listOrders

listOrders

Module: webflow | Returns: object -- API response.

webflow.listOrders
ParameterTypeRequiredDescription
inputstringNoInput parameter

getOrder

getOrder

Module: webflow | Returns: object -- API response.

webflow.getOrder
ParameterTypeRequiredDescription
inputstringNoInput parameter

updateOrder

updateOrder

Module: webflow | Returns: object -- API response.

webflow.updateOrder
ParameterTypeRequiredDescription
inputstringNoInput parameter

Error Handling

All functions throw on failure. Common errors:

ErrorCause
Webflow API error (${res.status}): ${t}Check the error message for details
webflow.setCredentials requires accessToken.Check the error message for details
webflow.publishSite requires an ID.Check the error message for details
webflow.updateCollectionItem requires an ID.Check the error message for details
webflow.deleteCollectionItem requires an ID.Check the error message for details
webflow.publishCollectionItems requires an ID.Check the error message for details
webflow.updateOrder requires an ID.Check the error message for details
Webflow: "..." not configured. Call webflow.setCredentials first.Check the error message for details
@desc "List sites and validate result"
do
  set $result as webflow.listSites
  if $result != null
    print "Success"
  else
    print "No result"
  end
enddo

Recipes

1. List and iterate Sites

Retrieve all items and loop through them.

@desc "Setup authentication"
do
  webflow.setCredentials $token
enddo

@desc "List sites and iterate results"
do
  set $result as webflow.listSites
  each $item in $result
    print $item
  end
enddo

2. Create a new item with createCollectionItem

Create a new resource and capture the result.

@desc "Setup authentication"
do
  webflow.setCredentials $token
enddo

@desc "Create collection item"
do
  set $result as webflow.createCollectionItem
  print "Created: " + $result
enddo

3. Create and update workflow

Create an item and then update it.

@desc "Setup authentication"
do
  webflow.setCredentials $token
enddo

@desc "Create collection item and update collection item"
do
  set $created as webflow.createCollectionItem
  # Update the created item
  webflow.updateCollectionItem
enddo

4. Check before creating

List existing items and only create if needed.

@desc "Setup authentication"
do
  webflow.setCredentials $token
enddo

@desc "List sites and create collection item"
do
  set $existing as webflow.listSites
  if $existing == null
    webflow.createCollectionItem
    print "Item created"
  else
    print "Item already exists"
  end
enddo

5. Multi-step Webflow workflow

Chain multiple webflow operations together.

@desc "Setup authentication"
do
  webflow.setCredentials $token
enddo

@desc "List sites, get site, and more"
do
  set $r_listSites as webflow.listSites
  set $r_getSite as webflow.getSite
  set $r_publishSite as webflow.publishSite
  print "All operations complete"
enddo

6. Safe listSites with validation

Check results before proceeding.

@desc "Setup authentication"
do
  webflow.setCredentials $token
enddo

@desc "List sites and validate result"
do
  set $result as webflow.listSites
  if $result != null
    print "Success: " + $result
  else
    print "Operation returned no data"
  end
enddo

Related Modules

  • json -- JSON module for complementary functionality

Versions (1)

VersionTagPublished
0.1.1latest1 months ago
Install
$ robinpath add @robinpath/webflow

Collaborators

Dumitru Balaban
Dumitru Balaban
@dumitru
View all @robinpath modules
Version0.1.1
LicenseMIT
Unpacked Size4.7 KB
Versions1
Weekly Downloads21
Total Downloads21
Stars0
Last Publish1 months ago
Created1 months ago

Keywords

Category

web