From 6465313d8f2601a348ea66c77ec809f3f51b0bde Mon Sep 17 00:00:00 2001 From: chuang8511 Date: Fri, 29 Nov 2024 14:46:56 +0000 Subject: [PATCH 1/2] feat: support optional field for leadiq --- pkg/component/application/leadiq/v0/io.go | 24 ++++++++-------- .../leadiq/v0/task_find_prospects.go | 28 +++++++++---------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/pkg/component/application/leadiq/v0/io.go b/pkg/component/application/leadiq/v0/io.go index 96ef42f80..c8fb55f41 100644 --- a/pkg/component/application/leadiq/v0/io.go +++ b/pkg/component/application/leadiq/v0/io.go @@ -20,21 +20,21 @@ type FindProspectsInput struct { // Company is the company information to find prospects for. type Company struct { // Name is the name of the company. - Names []string `instill:"names,omitempty"` + Names []*string `instill:"names"` // RevenueSize is the revenue size of the company. - RevenueSize RevenueSize `instill:"revenue-size,omitempty"` + RevenueSize *RevenueSize `instill:"revenue-size"` // Countries is the list of countries the company operates in. - Countries []string `instill:"countries,omitempty"` + Countries []*string `instill:"countries"` // States is the list of states the company operates in. - States []string `instill:"states,omitempty"` + States []*string `instill:"states"` // Cities is the list of cities the company operates in. - Cities []string `instill:"cities,omitempty"` + Cities []*string `instill:"cities"` // Industries is the list of industries the company are. - Industries []string `instill:"industries,omitempty"` + Industries []*string `instill:"industries"` // Descriptions is the list of descriptions of the company. - Descriptions []string `instill:"descriptions,omitempty"` + Descriptions []*string `instill:"descriptions"` // Technologies is the list of technologies the company uses. - Technologies []string `instill:"technologies,omitempty"` + Technologies []*string `instill:"technologies"` } // RevenueSize is the revenue size of the company. @@ -44,17 +44,17 @@ type RevenueSize struct { // Max is the maximum revenue size. Max int `instill:"max"` // Description is the description of the revenue size. - Description string `instill:"description,omitempty"` + Description *string `instill:"description"` } // FilterBy is the filter to apply to the prospects. type FilterBy struct { // JobTitle is the job title to filter by. - JobTitle string `instill:"job-title,omitempty"` + JobTitle *string `instill:"job-title"` // Seniorities is the seniorities to filter by. - Seniorities []string `instill:"seniorities,omitempty"` + Seniorities []*string `instill:"seniorities"` // Function is the function to filter by. - Function string `instill:"function,omitempty"` + Function *string `instill:"function"` jobTitleRegex *regexp.Regexp functionRegex *regexp.Regexp diff --git a/pkg/component/application/leadiq/v0/task_find_prospects.go b/pkg/component/application/leadiq/v0/task_find_prospects.go index eebbeaabd..829e47a9b 100644 --- a/pkg/component/application/leadiq/v0/task_find_prospects.go +++ b/pkg/component/application/leadiq/v0/task_find_prospects.go @@ -30,6 +30,7 @@ func (e *execution) executeFindProspects(ctx context.Context, job *base.Job) err } flatAdvancedSearchIn := buildFlatAdvancedSearchInput(inputStruct) + flatAdvancedSearchResp := flatAdvancedSearchResp{} if err := e.sendRequest(ctx, client, logger, flatAdvancedSearchQuery, flatAdvancedSearchIn, &flatAdvancedSearchResp); err != nil { msg := fmt.Sprintf("LeadIQ API result error: %v", err) @@ -76,7 +77,7 @@ func (e *execution) executeFindProspects(ctx context.Context, job *base.Job) err RevenueSize: RevenueSize{ Min: person.Company.RevenueRange.Start, Max: person.Company.RevenueRange.End, - Description: person.Company.RevenueRange.Description, + Description: &person.Company.RevenueRange.Description, }, } prospects = append(prospects, prospect) @@ -187,16 +188,15 @@ func (e *execution) sendRequest(ctx context.Context, client *graphql.Client, log func buildFlatAdvancedSearchInput(in FindProspectsInput) map[string]interface{} { companyFilter := make(map[string]interface{}) - // Now, we don't support optional fields in the Console/API input. - // So, we set the default value with the " " string. - // If it is the default value, it means the users don't provide any information. - // So, we won't add the field to the companyFilter. - filterNonBlank := func(slice []string) []string { - result := []string{} + filterNonBlank := func(slice []*string) []*string { + result := []*string{} for _, s := range slice { - trimmed := strings.TrimSpace(s) + if s == nil { + continue + } + trimmed := strings.TrimSpace(*s) if trimmed != "" { - result = append(result, trimmed) + result = append(result, &trimmed) } } return result @@ -262,14 +262,14 @@ func buildSearchPeopleInput(prospect Prospect) map[string]interface{} { func (f *FilterBy) compile() error { var err error - if f.JobTitle != "" { - f.jobTitleRegex, err = regexp.Compile(f.JobTitle) + if f.JobTitle != nil { + f.jobTitleRegex, err = regexp.Compile(*f.JobTitle) if err != nil { return fmt.Errorf("compiling job title filter: %w", err) } } - if f.Function != "" { - f.functionRegex, err = regexp.Compile(f.Function) + if f.Function != nil { + f.functionRegex, err = regexp.Compile(*f.Function) if err != nil { return fmt.Errorf("compiling seniority filter: %w", err) } @@ -284,7 +284,7 @@ func (f *FilterBy) beforeAPICallingMatch(person person) bool { if len(f.Seniorities) > 0 { found := false for _, seniority := range f.Seniorities { - if seniority == person.Seniority { + if *seniority == person.Seniority { found = true break } From 42cd718521ba819ff4bd81b94727735a82c21889 Mon Sep 17 00:00:00 2001 From: chuang8511 Date: Fri, 29 Nov 2024 15:29:14 +0000 Subject: [PATCH 2/2] feat: support optional field for smartlead --- .pre-commit-config.yaml | 7 + .../application/smartlead/v0/README.mdx | 6 +- .../smartlead/v0/config/tasks.json | 8 +- pkg/component/application/smartlead/v0/io.go | 24 ++- .../smartlead/v0/task_add_leads.go | 8 +- .../smartlead/v0/task_get_sequences.go | 7 +- .../smartlead/v0/task_save_sequences.go | 30 ++- .../smartlead/v0/task_setup_campaign.go | 4 +- pkg/component/data/googlesheets/v0/README.mdx | 187 +++++++++++++++--- .../generic/collection/v0/README.mdx | 5 + 10 files changed, 224 insertions(+), 62 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3bd28ab79..cbcfa7b6d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,3 +31,10 @@ repos: hooks: - id: conventional-pre-commit stages: [commit-msg] + - repo: local + hooks: + - id: generate-docs + name: Generate Docs + entry: bash -c 'make gen-component-doc' + language: system + files: ^pkg/component/.*\.(json|mdx)$ diff --git a/pkg/component/application/smartlead/v0/README.mdx b/pkg/component/application/smartlead/v0/README.mdx index 28dbec092..eb92fec49 100644 --- a/pkg/component/application/smartlead/v0/README.mdx +++ b/pkg/component/application/smartlead/v0/README.mdx @@ -101,7 +101,7 @@ Setup a campaign. You can update campaign settings to this campaign. For Smartle | Task ID (required) | `task` | string | `TASK_SETUP_CAMPAIGN` | | Campaign Name (required) | `campaign-name` | string | Name of the campaign. | | Timezone (required) | `timezone` | string | Timezone of the campaign. Please choose the value in [List of Timezones](https://help.smartlead.ai/Timezones-20fcff9ddbb5441790c7c8e5ce0e9233). | -| Days of the Week | `days-of-the-week` | array[number] | Days of the week when the campaign will run. A number value ranging from 0 to 6; i.e [0,1,2,3,4,5,6]. 0 is Sunday, 1 is Monday, and so on. | +| Days of the Week (required) | `days-of-the-week` | array[number] | Days of the week when the campaign will run. A number value ranging from 0 to 6; i.e [0,1,2,3,4,5,6]. 0 is Sunday, 1 is Monday, and so on. | | Start Hour (required) | `start-hour` | string | Start hour of the campaign. Time to start the campaign in 24-hour format (HH:MM). | | End Hour (required) | `end-hour` | string | End hour of the campaign. Time to end the campaign in 24-hour format (HH:MM). | | Minimum Time Between Emails (required) | `min-time-btw-emails` | number | Minimum time between emails in minutes. The minimum value is 3 minutes. | @@ -154,8 +154,8 @@ A Smartlead sequence is a series of automated emails sent to potential customers | Field | Field ID | Type | Note | | :--- | :--- | :--- | :--- | | Email Body | `email-body` | string | Body of the email. If you want to set the variable according to different leads, you can use {{variable_name}}. It will be replaced by the actual value from the lead. | -| Sequence Number | `seq-number` | number | Sequence number means the order of the sequence. | -| Sequence Delay Days | `sequence-delay-days` | number | Number of days to wait before sending the next email. | +| Sequence Number | `seq-number` | number | Sequence number means the order of the sequence. If you don't specify this, it will be automatically assigned by the order of the sequences. | +| Sequence Delay Days | `sequence-delay-days` | number | Number of days to wait before sending the next email. If you don't specify this, the default value is 1 day. | | Subject | `subject` | string | Subject of the email. If you want to set the variable according to different leads, you can use {{variable_name}}. It will be replaced by the actual value from the lead. | diff --git a/pkg/component/application/smartlead/v0/config/tasks.json b/pkg/component/application/smartlead/v0/config/tasks.json index 2e983c9b2..32311f58c 100644 --- a/pkg/component/application/smartlead/v0/config/tasks.json +++ b/pkg/component/application/smartlead/v0/config/tasks.json @@ -203,6 +203,7 @@ "required": [ "campaign-name", "timezone", + "days-of-the-week", "start-hour", "end-hour", "min-time-btw-emails", @@ -260,7 +261,7 @@ "properties": { "seq-number": { "title": "Sequence Number", - "description": "Sequence number means the order of the sequence.", + "description": "Sequence number means the order of the sequence. If you don't specify this, it will be automatically assigned by the order of the sequences.", "type": "number", "instillFormat": "number", "instillAcceptFormats": [ @@ -270,13 +271,14 @@ }, "sequence-delay-days": { "title": "Sequence Delay Days", - "description": "Number of days to wait before sending the next email.", + "description": "Number of days to wait before sending the next email. If you don't specify this, the default value is 1 day.", "type": "number", "instillFormat": "number", "instillAcceptFormats": [ "number" ], - "instillUIOrder": 1 + "instillUIOrder": 1, + "default": 1 }, "subject": { "title": "Subject", diff --git a/pkg/component/application/smartlead/v0/io.go b/pkg/component/application/smartlead/v0/io.go index 3f1281cf2..324749914 100644 --- a/pkg/component/application/smartlead/v0/io.go +++ b/pkg/component/application/smartlead/v0/io.go @@ -20,9 +20,9 @@ type setupCampaignInput struct { MaxNewLeadsPerDay int `instill:"max-new-leads-per-day"` ScheduleStartTime string `instill:"schedule-start-time"` TrackSettings []string `instill:"track-settings"` - StopLeadSettings string `instill:"stop-lead-settings"` + StopLeadSettings *string `instill:"stop-lead-settings"` SendAsPlainText bool `instill:"send-as-plain-text"` - FollowUpPercentage int `instill:"follow-up-percentage"` + FollowUpPercentage *int `instill:"follow-up-percentage"` AddUnsubscribeTag bool `instill:"add-unsubscribe-tag"` IgnoreSsMailboxSendingLimit bool `instill:"ignore-ss-mailbox-sending-limit"` } @@ -37,11 +37,11 @@ type saveSequencesInput struct { } type sequence struct { - SeqID string `instill:"seq-id"` - SeqNumber int `instill:"seq-number"` - SequenceDelayDays int `instill:"sequence-delay-days"` - Subject string `instill:"subject"` - EmailBody string `instill:"email-body"` + SeqID *string `instill:"seq-id"` + SeqNumber *int `instill:"seq-number"` + SequenceDelayDays *int `instill:"sequence-delay-days"` + Subject string `instill:"subject"` + EmailBody string `instill:"email-body"` } type saveSequencesOutput struct { @@ -64,10 +64,10 @@ type addLeadsInput struct { type lead struct { Email string `instill:"email"` - FirstName string `instill:"first-name"` - LastName string `instill:"last-name"` - Company string `instill:"company"` - Location string `instill:"location"` + FirstName *string `instill:"first-name"` + LastName *string `instill:"last-name"` + Company *string `instill:"company"` + Location *string `instill:"location"` CustomFields []customField `instill:"custom-fields"` } @@ -111,8 +111,6 @@ type updateCampaignStatusOutput struct { type getCampaignMetricInput struct { CampaignName string `instill:"campaign-name"` - StartDate string `instill:"start-date"` - EndDate string `instill:"end-date"` } type getCampaignMetricOutput struct { diff --git a/pkg/component/application/smartlead/v0/task_add_leads.go b/pkg/component/application/smartlead/v0/task_add_leads.go index 2250c4f78..f10f263aa 100644 --- a/pkg/component/application/smartlead/v0/task_add_leads.go +++ b/pkg/component/application/smartlead/v0/task_add_leads.go @@ -119,11 +119,11 @@ type addLeadsReq struct { } type leadReq struct { - FirstName string `json:"first_name"` - LastName string `json:"last_name"` + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` Email string `json:"email"` - CompanyName string `json:"company_name"` - Location string `json:"location"` + CompanyName *string `json:"company_name,omitempty"` + Location *string `json:"location,omitempty"` CustomFields map[string]string `json:"custom_fields"` } diff --git a/pkg/component/application/smartlead/v0/task_get_sequences.go b/pkg/component/application/smartlead/v0/task_get_sequences.go index 7171c9149..993d4f41d 100644 --- a/pkg/component/application/smartlead/v0/task_get_sequences.go +++ b/pkg/component/application/smartlead/v0/task_get_sequences.go @@ -63,12 +63,13 @@ func (e *execution) getSequences(ctx context.Context, job *base.Job) error { var sequences []sequence for _, s := range sequenceResp { + seqID := fmt.Sprintf("%d", s.ID) sequences = append(sequences, sequence{ - SeqID: fmt.Sprintf("%d", s.ID), - SeqNumber: s.SeqNumber, + SeqID: &seqID, + SeqNumber: &s.SeqNumber, Subject: s.Subject, EmailBody: s.EmailBody, - SequenceDelayDays: s.SeqDelayDetails.DelayInDays, + SequenceDelayDays: &s.SeqDelayDetails.DelayInDays, }) } diff --git a/pkg/component/application/smartlead/v0/task_save_sequences.go b/pkg/component/application/smartlead/v0/task_save_sequences.go index d8a403306..513099892 100644 --- a/pkg/component/application/smartlead/v0/task_save_sequences.go +++ b/pkg/component/application/smartlead/v0/task_save_sequences.go @@ -79,14 +79,28 @@ func (e *execution) saveSequences(ctx context.Context, job *base.Job) error { func buildSaveSequenceReq(input saveSequencesInput) saveSequencesReq { var sequences []sequenceReq - for _, seq := range input.Sequences { + for i, seq := range input.Sequences { + var seqDelayDetails sequenceDelayDetails + if seq.SequenceDelayDays != nil { + seqDelayDetails = sequenceDelayDetails{ + DelayInDays: *seq.SequenceDelayDays, + } + } else { + seqDelayDetails = sequenceDelayDetails{ + DelayInDays: 1, + } + } + var seqNumber int + if seq.SeqNumber != nil { + seqNumber = *seq.SeqNumber + } else { + seqNumber = i + 1 + } sequences = append(sequences, sequenceReq{ - SeqNumber: seq.SeqNumber, - SeqDelayDetails: sequenceDelayDetails{ - DelayInDays: seq.SequenceDelayDays, - }, - Subject: seq.Subject, - EmailBody: seq.EmailBody, + SeqNumber: &seqNumber, + SeqDelayDetails: seqDelayDetails, + Subject: seq.Subject, + EmailBody: seq.EmailBody, }) } return saveSequencesReq{ @@ -99,7 +113,7 @@ type saveSequencesReq struct { } type sequenceReq struct { - SeqNumber int `json:"seq_number"` + SeqNumber *int `json:"seq_number,omitempty"` SeqDelayDetails sequenceDelayDetails `json:"seq_delay_details"` Subject string `json:"subject"` EmailBody string `json:"email_body"` diff --git a/pkg/component/application/smartlead/v0/task_setup_campaign.go b/pkg/component/application/smartlead/v0/task_setup_campaign.go index 65d62e1a9..6fd9d2adb 100644 --- a/pkg/component/application/smartlead/v0/task_setup_campaign.go +++ b/pkg/component/application/smartlead/v0/task_setup_campaign.go @@ -131,9 +131,9 @@ func buildGeneralSettingReq(input setupCampaignInput) setupGeneralCampaignReq { type setupGeneralCampaignReq struct { TrackSettings []string `json:"track_settings,omitempty"` - StopLeadSettings string `json:"stop_lead_settings,omitempty"` + StopLeadSettings *string `json:"stop_lead_settings,omitempty"` SendAsPlainText bool `json:"send_as_plain_text,omitempty"` - FollowUpPercentage int `json:"follow_up_percentage,omitempty"` + FollowUpPercentage *int `json:"follow_up_percentage,omitempty"` AddUnsubscribeTag bool `json:"add_unsubscribe_tag,omitempty"` IgnoreSsMailboxSendingLimit bool `json:"ignore_ss_mailbox_sending_limit,omitempty"` } diff --git a/pkg/component/data/googlesheets/v0/README.mdx b/pkg/component/data/googlesheets/v0/README.mdx index 6a5014d43..adb5264dd 100644 --- a/pkg/component/data/googlesheets/v0/README.mdx +++ b/pkg/component/data/googlesheets/v0/README.mdx @@ -123,7 +123,7 @@ Delete a Google Sheets spreadsheet. | Output | ID | Type | Description | | :--- | :--- | :--- | :--- | -| Success | `success` | string | Result of the operation. | +| Success | `success` | boolean | Result of the operation. | @@ -150,7 +150,7 @@ Add a new sheet to an existing Google Sheets spreadsheet. | Output | ID | Type | Description | | :--- | :--- | :--- | :--- | -| Success | `result` | string | Result of the operation. | +| Success | `success` | boolean | Result of the operation. | @@ -176,7 +176,7 @@ Remove a sheet from a Google Sheets spreadsheet. | Output | ID | Type | Description | | :--- | :--- | :--- | :--- | -| Success | `result` | string | Result of the operation. | +| Success | `success` | boolean | Result of the operation. | @@ -203,7 +203,7 @@ Add a new column to a Google Sheets spreadsheet. | Output | ID | Type | Description | | :--- | :--- | :--- | :--- | -| Success | `result` | string | Result of the operation. | +| Success | `success` | boolean | Result of the operation. | @@ -230,7 +230,7 @@ Delete a column from a Google Sheets spreadsheet. | Output | ID | Type | Description | | :--- | :--- | :--- | :--- | -| Success | `result` | string | Result of the operation. | +| Success | `success` | boolean | Result of the operation. | @@ -244,8 +244,8 @@ List all rows in a Google Sheets spreadsheet. | :--- | :--- | :--- | :--- | | Task ID (required) | `task` | string | `TASK_LIST_ROWS` | | Spreadsheet ID (required) | `shared-link` | string | Shared link of the spreadsheet. You can get the shared link by clicking 'Share' button and selecting 'Copy link'. | -| Start Row (required) | `start-row` | integer | The starting row number to retrieve (1-based index). | -| End Row (required) | `end-row` | integer | The ending row number to retrieve (1-based index). | +| Start Row | `start-row` | integer | The starting row number to retrieve (1-based index). | +| End Row | `end-row` | integer | The ending row number to retrieve (1-based index). | | Sheet Name (required) | `sheet-name` | string | Name of the sheet. | @@ -258,9 +258,23 @@ List all rows in a Google Sheets spreadsheet. | Output | ID | Type | Description | | :--- | :--- | :--- | :--- | -| [Rows Data](#list-rows-rows-data) | `rows` | array[object] | Rows data in JSON format where keys are column names. | +| [Rows Data](#list-rows-rows-data) | `rows` | array[object] | Multiple rows data with row numbers and data. | +
+ Output Objects in List Rows + +

Rows Data

+ +
+ +| Field | Field ID | Type | Note | +| :--- | :--- | :--- | :--- | +| Row Number | `row-number` | integer | Row number to update (1-based index) | +| Row Data | `row-value` | object | Row data in JSON format where keys are column names and values are the corresponding cell values | +
+
+ ### Lookup Rows @@ -286,10 +300,23 @@ Find multiple rows based on column value in a Google Sheets spreadsheet. | Output | ID | Type | Description | | :--- | :--- | :--- | :--- | -| Row Numbers (optional) | `row-numbers` | array[integer] | Row numbers to update (1-based indices). | -| [Rows Data](#lookup-rows-rows-data) | `rows` | array[object] | Rows data in JSON format where keys are column names. | +| [Rows Data](#lookup-rows-rows-data) | `rows` | array[object] | Multiple rows data with row numbers and data. | +
+ Output Objects in Lookup Rows + +

Rows Data

+ +
+ +| Field | Field ID | Type | Note | +| :--- | :--- | :--- | :--- | +| Row Number | `row-number` | integer | Row number to update (1-based index) | +| Row Data | `row-value` | object | Row data in JSON format where keys are column names and values are the corresponding cell values | +
+
+ ### Get Row @@ -314,8 +341,22 @@ Get a single row from a Google Sheets spreadsheet. | Output | ID | Type | Description | | :--- | :--- | :--- | :--- | -| Row Data | `row` | object | Row data in JSON format where keys are column names. | +| [Row Data](#get-row-row-data) | `row` | object | Row data with row number and data. | + + +
+ Output Objects in Get Row + +

Row Data

+ +
+ +| Field | Field ID | Type | Note | +| :--- | :--- | :--- | :--- | +| Row Number | `row-number` | integer | Row number to update (1-based index) | +| Row Data | `row-value` | object | Row data in JSON format where keys are column names and values are the corresponding cell values |
+
### Get Multiple Rows @@ -341,9 +382,23 @@ Get multiple rows from a Google Sheets spreadsheet. | Output | ID | Type | Description | | :--- | :--- | :--- | :--- | -| [Rows Data](#get-multiple-rows-rows-data) | `rows` | array[object] | Rows data in JSON format where keys are column names. | +| [Rows Data](#get-multiple-rows-rows-data) | `rows` | array[object] | Multiple rows data with row numbers and data. | +
+ Output Objects in Get Multiple Rows + +

Rows Data

+ +
+ +| Field | Field ID | Type | Note | +| :--- | :--- | :--- | :--- | +| Row Number | `row-number` | integer | Row number to update (1-based index) | +| Row Data | `row-value` | object | Row data in JSON format where keys are column names and values are the corresponding cell values | +
+
+ ### Insert Row @@ -356,7 +411,7 @@ Insert a single row into a Google Sheets spreadsheet. | Task ID (required) | `task` | string | `TASK_INSERT_ROW` | | Spreadsheet ID (required) | `shared-link` | string | Shared link of the spreadsheet. You can get the shared link by clicking 'Share' button and selecting 'Copy link'. | | Sheet Name (required) | `sheet-name` | string | Name of the sheet. | -| Row Data (required) | `row` | object | Row data in JSON format where keys are column names. | +| Row Data | `row-value` | object | Row data in JSON format where keys are column names and values are the corresponding cell values | @@ -368,9 +423,22 @@ Insert a single row into a Google Sheets spreadsheet. | Output | ID | Type | Description | | :--- | :--- | :--- | :--- | -| Row Number | `row-number` | integer | Row number to update (1-based index). | -| Row Data | `row` | object | Row data in JSON format where keys are column names. | +| [Row Data](#insert-row-row-data) | `row` | object | Row data with row number and data. | + + +
+ Output Objects in Insert Row + +

Row Data

+ +
+ +| Field | Field ID | Type | Note | +| :--- | :--- | :--- | :--- | +| Row Number | `row-number` | integer | Row number to update (1-based index) | +| Row Data | `row-value` | object | Row data in JSON format where keys are column names and values are the corresponding cell values |
+
### Insert Multiple Rows @@ -383,8 +451,8 @@ Insert multiple rows into a Google Sheets spreadsheet. | :--- | :--- | :--- | :--- | | Task ID (required) | `task` | string | `TASK_INSERT_MULTIPLE_ROWS` | | Spreadsheet ID (required) | `shared-link` | string | Shared link of the spreadsheet. You can get the shared link by clicking 'Share' button and selecting 'Copy link'. | +| [Row Values](#insert-multiple-rows-row-values) | `row-values` | array[object] | Array of row data in JSON format where keys are column names and values are the corresponding cell values | | Sheet Name (required) | `sheet-name` | string | Name of the sheet. | -| [Rows Data](#insert-multiple-rows-rows-data) (required) | `rows` | array[object] | Rows data in JSON format where keys are column names. | @@ -396,10 +464,23 @@ Insert multiple rows into a Google Sheets spreadsheet. | Output | ID | Type | Description | | :--- | :--- | :--- | :--- | -| Row Numbers | `row-numbers` | array[integer] | Row numbers to update (1-based indices). | -| [Rows Data](#insert-multiple-rows-rows-data) | `rows` | array[object] | Rows data in JSON format where keys are column names. | +| [Rows Data](#insert-multiple-rows-rows-data) | `rows` | array[object] | Multiple rows data with row numbers and data. | +
+ Output Objects in Insert Multiple Rows + +

Rows Data

+ +
+ +| Field | Field ID | Type | Note | +| :--- | :--- | :--- | :--- | +| Row Number | `row-number` | integer | Row number to update (1-based index) | +| Row Data | `row-value` | object | Row data in JSON format where keys are column names and values are the corresponding cell values | +
+
+ ### Update Row @@ -412,12 +493,25 @@ Update a row in a Google Sheets spreadsheet. | Task ID (required) | `task` | string | `TASK_UPDATE_ROW` | | Spreadsheet ID (required) | `shared-link` | string | Shared link of the spreadsheet. You can get the shared link by clicking 'Share' button and selecting 'Copy link'. | | Sheet Name (required) | `sheet-name` | string | Name of the sheet. | -| Row Number (required) | `row-number` | integer | Row number to update (1-based index). | -| Row Data (required) | `row` | object | Row data in JSON format where keys are column names. | +| [Row Data](#update-row-row-data) (required) | `row` | object | Row data with row number and data. | +
+ Input Objects in Update Row +

Row Data

+ +Row data with row number and data. + +
+ +| Field | Field ID | Type | Note | +| :--- | :--- | :--- | :--- | +| Row Number | `row-number` | integer | Row number to update (1-based index) | +| Row Data | `row-value` | object | Row data in JSON format where keys are column names and values are the corresponding cell values | +
+
@@ -425,8 +519,22 @@ Update a row in a Google Sheets spreadsheet. | Output | ID | Type | Description | | :--- | :--- | :--- | :--- | -| Row Data | `row` | object | Row data in JSON format where keys are column names. | +| [Row Data](#update-row-row-data) | `row` | object | Row data with row number and data. | + + +
+ Output Objects in Update Row + +

Row Data

+ +
+ +| Field | Field ID | Type | Note | +| :--- | :--- | :--- | :--- | +| Row Number | `row-number` | integer | Row number to update (1-based index) | +| Row Data | `row-value` | object | Row data in JSON format where keys are column names and values are the corresponding cell values |
+
### Update Multiple Rows @@ -440,12 +548,25 @@ Update multiple rows in a Google Sheets spreadsheet. | Task ID (required) | `task` | string | `TASK_UPDATE_MULTIPLE_ROWS` | | Spreadsheet ID (required) | `shared-link` | string | Shared link of the spreadsheet. You can get the shared link by clicking 'Share' button and selecting 'Copy link'. | | Sheet Name (required) | `sheet-name` | string | Name of the sheet. | -| Row Numbers (required) | `row-numbers` | array[integer] | Row numbers to update (1-based indices). | -| [Rows Data](#update-multiple-rows-rows-data) (required) | `rows` | array[object] | Rows data in JSON format where keys are column names. | +| [Rows Data](#update-multiple-rows-rows-data) (required) | `rows` | array[object] | Multiple rows data with row numbers and data. | +
+ Input Objects in Update Multiple Rows +

Rows Data

+ +Multiple rows data with row numbers and data. + +
+ +| Field | Field ID | Type | Note | +| :--- | :--- | :--- | :--- | +| Row Number | `row-number` | integer | Row number to update (1-based index) | +| Row Data | `row-value` | object | Row data in JSON format where keys are column names and values are the corresponding cell values | +
+
@@ -453,8 +574,22 @@ Update multiple rows in a Google Sheets spreadsheet. | Output | ID | Type | Description | | :--- | :--- | :--- | :--- | -| [Rows Data](#update-multiple-rows-rows-data) | `rows` | array[object] | Rows data in JSON format where keys are column names. | +| [Rows Data](#update-multiple-rows-rows-data) | `rows` | array[object] | Multiple rows data with row numbers and data. | + + +
+ Output Objects in Update Multiple Rows + +

Rows Data

+ +
+ +| Field | Field ID | Type | Note | +| :--- | :--- | :--- | :--- | +| Row Number | `row-number` | integer | Row number to update (1-based index) | +| Row Data | `row-value` | object | Row data in JSON format where keys are column names and values are the corresponding cell values |
+
### Delete Row @@ -480,7 +615,7 @@ Delete a row from a Google Sheets spreadsheet. | Output | ID | Type | Description | | :--- | :--- | :--- | :--- | -| Success | `result` | string | Result of the operation. | +| Success | `success` | boolean | Result of the operation. | @@ -507,7 +642,7 @@ Delete multiple rows from a Google Sheets spreadsheet. | Output | ID | Type | Description | | :--- | :--- | :--- | :--- | -| Success | `result` | string | Result of the operation. | +| Success | `success` | boolean | Result of the operation. | diff --git a/pkg/component/generic/collection/v0/README.mdx b/pkg/component/generic/collection/v0/README.mdx index 2fa935ddc..19d637827 100644 --- a/pkg/component/generic/collection/v0/README.mdx +++ b/pkg/component/generic/collection/v0/README.mdx @@ -60,6 +60,7 @@ Append values to create or extend an array, or add key-value pairs to an object. | Data | `data` | any | The resulting data structure after the append operation. Will be either an array (if input was array or primitive) or an object (if input was object). Examples: [1,2,3], \{'name':'John', 'age':25\}, or ['hello','world']. | + ### Assign Assign a value to a specific path in a data structure. @@ -111,6 +112,7 @@ Concatenate multiple arrays or merge multiple objects into a single collection. | Data | `data` | any | The resulting array or object after concat operation. | + ### Difference Find elements that exist in the first array or object but not in any of the other arrays or objects. @@ -135,6 +137,7 @@ Find elements that exist in the first array or object but not in any of the othe | Data | `data` | any | The resulting array or object after the difference operation. | + ### Intersection Find common elements that exist in all input arrays or objects. @@ -185,6 +188,7 @@ Split arrays or objects into smaller chunks. | Data | `data` | array | The resulting array after splitting. For arrays: array of subarrays. For objects: array of smaller objects with alphabetically ordered keys | + ### Symmetric Difference Find elements that exist in exactly one of the input arrays or objects, but not in multiple inputs. @@ -209,6 +213,7 @@ Find elements that exist in exactly one of the input arrays or objects, but not | Data | `data` | any | The resulting array or object after the symmetric difference operation. | + ### Union Find unique elements that exist in any of the input arrays or objects.