Skip to content

Commit

Permalink
fix: updated sdk to 0.4.9
Browse files Browse the repository at this point in the history
Signed-off-by: Rubicon Lee <132176609+raff-wakflo@users.noreply.github.com>
  • Loading branch information
raff-wakflo committed Aug 28, 2024
1 parent 4eb5a10 commit d3cd8f8
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion internal/connectors/cin7/trigger_new_sales.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (t *TriggerNewSales) Run(ctx *sdk.RunContext) (sdk.JSON, error) {

var fromDate string
if lastRunTime != nil {
fromDate = lastRunTime.Format(time.RFC3339)
fromDate = lastRunTime.UTC().Format(time.RFC3339)
}

queryParams := map[string]interface{}{
Expand Down
3 changes: 2 additions & 1 deletion internal/connectors/freshdesk/trigger_new_ticket.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package freshdesk
import (
"errors"
"fmt"
"time"

"github.com/wakflo/go-sdk/autoform"
sdk "github.com/wakflo/go-sdk/connector"
Expand Down Expand Up @@ -63,7 +64,7 @@ func (t *TriggerNewTicket) Run(ctx *sdk.RunContext) (sdk.JSON, error) {

var fromDate string
if lastRunTime != nil {
fromDate = lastRunTime.Format("2006-01-02")
fromDate = lastRunTime.UTC().Format(time.RFC3339)
} else {
fromDate = ""
}
Expand Down
2 changes: 1 addition & 1 deletion internal/connectors/googlemail/trigger_new_email.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (t *TriggerNewEmail) Run(ctx *sdk.RunContext) (sdk.JSON, error) {
lastRunTime = *ctx.Metadata.LastRun
}

query := "after:" + lastRunTime.Format("2006/01/02")
query := "after:" + lastRunTime.UTC().Format(time.RFC3339)

messages, err := gmailService.Users.Messages.List("me").Q(query).Do()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/connectors/linear/trigger_new_issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (t *TriggerNewIssue) Run(ctx *sdk.RunContext) (sdk.JSON, error) {
updatedAt
}
}
}`, lastRunTime.Format(time.RFC3339))
}`, lastRunTime.UTC().Format(time.RFC3339))
}

response, err := MakeGraphQLRequest(apiKEY, query)
Expand Down
2 changes: 1 addition & 1 deletion internal/connectors/linear/trigger_updated_issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (t *TriggerIssueUpdated) Run(ctx *sdk.RunContext) (sdk.JSON, error) {
updatedAt
}
}
}`, lastRunTime.Format(time.RFC3339))
}`, lastRunTime.UTC().Format(time.RFC3339))
}

response, err := MakeGraphQLRequest(apiKEY, query)
Expand Down
2 changes: 1 addition & 1 deletion internal/connectors/mailchimp/trigger_new_subscriber.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (t *TriggerNewSubscriber) Run(ctx *sdk.RunContext) (sdk.JSON, error) {
lastRunTime := ctx.Metadata.LastRun

if lastRunTime != nil {
fromDate = lastRunTime.Format(time.RFC3339)
fromDate = lastRunTime.UTC().Format(time.RFC3339)
}

var newSubscribers interface{}
Expand Down
2 changes: 1 addition & 1 deletion internal/connectors/mailchimp/trigger_unsubscriber.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (t *TriggerUnSubscriber) Run(ctx *sdk.RunContext) (sdk.JSON, error) {
lastRunTime := ctx.Metadata.LastRun

if lastRunTime != nil {
fromDate = lastRunTime.Format(time.RFC3339)
fromDate = lastRunTime.UTC().Format(time.RFC3339)
}

var unsubscribes interface{}
Expand Down
2 changes: 1 addition & 1 deletion internal/connectors/shopify/trigger_new_customer.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (t *TriggerNewCustomer) Run(ctx *sdk.RunContext) (sdk.JSON, error) {
}

options := &goshopify.ListOptions{
CreatedAtMin: lastRunTime,
CreatedAtMin: lastRunTime.UTC(),
}

customers, err := client.Customer.List(context.Background(), options)
Expand Down
2 changes: 1 addition & 1 deletion internal/connectors/shopify/trigger_new_order.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (t *TriggerNewOrder) Run(ctx *sdk.RunContext) (sdk.JSON, error) {
}

options := &goshopify.ListOptions{
CreatedAtMin: lastRunTime,
CreatedAtMin: lastRunTime.UTC(),
}

orders, err := client.Order.List(context.Background(), options)
Expand Down
4 changes: 2 additions & 2 deletions internal/connectors/square/trigger_new_payment.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ func (t *TriggerNewPayment) Run(ctx *sdk.RunContext) (sdk.JSON, error) {
lastRunTime := ctx.Metadata.LastRun

if lastRunTime != nil {
fromDate = lastRunTime.Format(time.RFC3339)
fromDate = lastRunTime.UTC().Format(time.RFC3339)
} else {
defaultStartDate := time.Date(2006, 1, 1, 0, 0, 0, 0, time.UTC)
fromDate = defaultStartDate.Format(time.RFC3339)
fromDate = defaultStartDate.UTC().Format(time.RFC3339)

fmt.Println("DEFAULT", fromDate)
}
Expand Down
8 changes: 1 addition & 7 deletions internal/connectors/webhook/help-text.mdx
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
### Live URL:

```shell
{{ baseUrl }}/{{ hookEndpoint }}/{{ hookId }}
```

triggers the flow and does NOT generate sample data.

Test URL:

### Test URL:
```shell
{{ baseUrl }}/{{ hookEndpoint }}/{{ hookId }}/test
```

generates sample data and does NOT trigger the flow.

Synchronous Requests:

If you expect a response from this webhook, add /sync to the end of the URL. If it takes more than 30 seconds, it will return a 408 Request Timeout response.

To return data, add an HTTP step to your flow with the Return Response action.
3 changes: 2 additions & 1 deletion internal/connectors/woocommerce/trigger_new_order.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package woocommerce
import (
"errors"
"fmt"
"time"

"github.com/hiscaler/woocommerce-go"

Expand Down Expand Up @@ -67,7 +68,7 @@ func (t *TriggerNewOrder) Run(ctx *sdk.RunContext) (sdk.JSON, error) {
var formattedTime string
if lastRunTime != nil {
utcTime := lastRunTime.UTC()
formattedTime = utcTime.Format("2006-01-02T15:04:05")
formattedTime = utcTime.Format(time.RFC3339)
}

params := woocommerce.OrdersQueryParams{
Expand Down
3 changes: 2 additions & 1 deletion internal/connectors/woocommerce/trigger_new_product.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package woocommerce
import (
"errors"
"fmt"
"time"

"github.com/hiscaler/woocommerce-go"

Expand Down Expand Up @@ -68,7 +69,7 @@ func (t *TriggerNewProduct) Run(ctx *sdk.RunContext) (sdk.JSON, error) {
var formattedTime string
if lastRunTime != nil {
utcTime := lastRunTime.UTC()
formattedTime = utcTime.Format("2006-01-02T15:04:05")
formattedTime = utcTime.Format(time.RFC3339)
}

params := woocommerce.ProductsQueryParams{
Expand Down
3 changes: 2 additions & 1 deletion internal/connectors/xero/trigger_new_invoice.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"errors"
"fmt"
"strings"
"time"

sdk "github.com/wakflo/go-sdk/connector"
sdkcore "github.com/wakflo/go-sdk/core"
Expand Down Expand Up @@ -54,7 +55,7 @@ func (t *TriggerNewInvoice) Run(ctx *sdk.RunContext) (sdk.JSON, error) {
lastRunTime := ctx.Metadata.LastRun

if lastRunTime != nil {
fromDate := lastRunTime.Format("2006-01-02")
fromDate := lastRunTime.UTC().Format(time.RFC3339)
fromDate = strings.ReplaceAll(fromDate, "-", ",")
endpoint = fmt.Sprintf("/Invoices?where=Date>=DateTime(%s)", fromDate)
} else {
Expand Down
3 changes: 2 additions & 1 deletion internal/connectors/zohoinventory/trigger_new_payment.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"io"
"net/http"
"net/url"
"time"

"github.com/wakflo/go-sdk/autoform"
sdk "github.com/wakflo/go-sdk/connector"
Expand Down Expand Up @@ -60,7 +61,7 @@ func (t *TriggerNewPayment) Run(ctx *sdk.RunContext) (sdk.JSON, error) {
lastRunTime := ctx.Metadata.LastRun

if lastRunTime != nil {
fromDate = lastRunTime.Format("2006-01-02")
fromDate = lastRunTime.UTC().Format(time.RFC3339)
}

baseURL := "https://www.zohoapis.com/inventory/v1/customerpayments"
Expand Down

0 comments on commit d3cd8f8

Please sign in to comment.