Skip to content

Commit

Permalink
Merge pull request #224 from cloudblue/LITE-28260-sync-stream
Browse files Browse the repository at this point in the history
Lite 28260 sync stream
  • Loading branch information
ffaraone authored Oct 6, 2023
2 parents 826de2e + 90074cd commit e8aa3e5
Show file tree
Hide file tree
Showing 8 changed files with 987 additions and 8 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ You can download its zip file from the [Github Releases](https://github.com/clou
* [Reports](docs/reports_usage.md)
* [Translations](docs/translations_usage.md)
* [Projects](docs/project_usage.md)
* [Streams](docs/stream_usage.md)


## Development
Expand Down
30 changes: 30 additions & 0 deletions connect/cli/plugins/commerce/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
display_streams_table,
export_stream,
get_destination_account,
print_errors,
print_results,
sync_stream,
)


Expand Down Expand Up @@ -165,5 +167,33 @@ def cmd_clone_stream(
print_results(results)


@grp_commerce_streams.command(
name='sync',
short_help='Synchronize a stream from an excel file.',
)
@click.argument('input_file', metavar='input_file', nargs=1, required=True) # noqa: E304
@pass_config
def cmd_sync_stream(config, input_file):
stream_id = None
if '.xlsx' not in input_file:
stream_id = input_file
input_file = f'{input_file}/{input_file}.xlsx'
else:
stream_id = input_file.split('/')[-1].split('.')[0]
results, errors = sync_stream(
account=config.active,
stream_id=stream_id,
input_file=input_file,
)

console.echo('')

print_results(results)

console.echo('')

print_errors(errors)


def get_group():
return grp_commerce
Loading

0 comments on commit e8aa3e5

Please sign in to comment.