Skip to content

Commit

Permalink
Merge pull request #174 from kuzzleio/0.25.0-proposal
Browse files Browse the repository at this point in the history
Release 0.25.0
  • Loading branch information
rolljee authored Jan 12, 2023
2 parents 45a92a3 + 0092872 commit 5fe16f0
Show file tree
Hide file tree
Showing 36 changed files with 6,941 additions and 8,959 deletions.
7 changes: 4 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
"plugin:@typescript-eslint/recommended"
],
"rules": {
"no-shadow": "off",
"@typescript-eslint/no-shadow": "error",
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/explicit-module-boundary-types": 0
"@typescript-eslint/no-shadow": "error",
"no-empty": ["error", { "allowEmptyCatch": true }],
"no-shadow": "off"
}
}
6 changes: 3 additions & 3 deletions .github/workflows/pull_request.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [pull_request]
jobs:
lint:
name: Lint
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Cache node modules
Expand All @@ -26,7 +26,7 @@ jobs:

build:
name: Build
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
needs: [lint]
steps:
- uses: actions/checkout@v2
Expand All @@ -53,7 +53,7 @@ jobs:

functional-test:
name: Functional Test - ${{ matrix.test-set }}
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
needs: [build]
strategy:
matrix:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/push_dev.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
lint:
name: Lint
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Cache node modules
Expand All @@ -29,7 +29,7 @@ jobs:

build:
name: Build
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
needs: [lint]
steps:
- uses: actions/checkout@v2
Expand All @@ -56,7 +56,7 @@ jobs:

functional-test:
name: Functional Test - ${{ matrix.test-set }}
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
needs: [build]
strategy:
matrix:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/push_master.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
lint:
name: Lint
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Cache node modules
Expand All @@ -29,7 +29,7 @@ jobs:

build:
name: Build
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
needs: [lint]
steps:
- uses: actions/checkout@v2
Expand All @@ -56,7 +56,7 @@ jobs:

functional-test:
name: Functional Test - ${{ matrix.test-set }}
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
needs: [build]
strategy:
matrix:
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:

deploy:
name: Deploy to NPM.js
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
needs: [functional-test]
steps:
- uses: actions/checkout@v2
Expand Down
108 changes: 97 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ $ npm install -g kourou
$ kourou COMMAND
running command...
$ kourou (-v|--version|version)
kourou/0.24.2 darwin-x64 node-v16.17.0
kourou/0.25.0 linux-x64 node-v16.15.0
$ kourou --help [COMMAND]
USAGE
$ kourou COMMAND
Expand Down Expand Up @@ -130,14 +130,17 @@ All other arguments and options will be passed as-is to the `sdk:query` method.
* [`kourou api-key:delete USER ID`](#kourou-api-keydelete-user-id)
* [`kourou api-key:search USER`](#kourou-api-keysearch-user)
* [`kourou app:debug-proxy`](#kourou-appdebug-proxy)
* [`kourou app:doctor`](#kourou-appdoctor)
* [`kourou app:scaffold DESTINATION`](#kourou-appscaffold-destination)
* [`kourou app:start-services`](#kourou-appstart-services)
* [`kourou autocomplete [SHELL]`](#kourou-autocomplete-shell)
* [`kourou collection:create INDEX COLLECTION [BODY]`](#kourou-collectioncreate-index-collection-body)
* [`kourou collection:export INDEX COLLECTION`](#kourou-collectionexport-index-collection)
* [`kourou collection:import PATH`](#kourou-collectionimport-path)
* [`kourou collection:migrate SCRIPT PATH`](#kourou-collectionmigrate-script-path)
* [`kourou config:diff FIRST SECOND`](#kourou-configdiff-first-second)
* [`kourou document:search INDEX COLLECTION [QUERY]`](#kourou-documentsearch-index-collection-query)
* [`kourou es:aliases:cat`](#kourou-esaliasescat)
* [`kourou es:indices:cat`](#kourou-esindicescat)
* [`kourou es:indices:get INDEX ID`](#kourou-esindicesget-index-id)
* [`kourou es:indices:insert INDEX`](#kourou-esindicesinsert-index)
Expand Down Expand Up @@ -327,6 +330,29 @@ OPTIONS

_See code: [src/commands/app/debug-proxy.ts](src/commands/app/debug-proxy.ts)_

## `kourou app:doctor`

Analyze a Kuzzle application

```
USAGE
$ kourou app:doctor
OPTIONS
--api-key=api-key Kuzzle user api-key
--as=as Impersonate a user
--elasticsearch=elasticsearch [default: http://localhost:9200] Elasticsearch server URL
--help show CLI help
--host=host [default: localhost] Kuzzle server host
--password=password Kuzzle user password
--port=port [default: 7512] Kuzzle server port
--protocol=protocol [default: ws] Kuzzle protocol (http or ws)
--ssl Use SSL to connect to Kuzzle
--username=username [default: anonymous] Kuzzle username (local strategy)
```

_See code: [src/commands/app/doctor.ts](src/commands/app/doctor.ts)_

## `kourou app:scaffold DESTINATION`

Scaffolds a new Kuzzle application
Expand All @@ -339,7 +365,9 @@ ARGUMENTS
DESTINATION Directory to scaffold the app
OPTIONS
--flavor=flavor [default: generic] Template flavor ("generic", "iot-platform")
--flavor=flavor [default: generic] Template flavor ("generic", "iot-platform", "iot-console", "iot-platform").
Those can be found here: https://github.com/kuzzleio/project-templates
--help show CLI help
```

Expand Down Expand Up @@ -381,7 +409,7 @@ EXAMPLES
$ kourou autocomplete --refresh-cache
```

_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v1.2.0/src/commands/autocomplete/index.ts)_
_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v1.3.10/src/commands/autocomplete/index.ts)_

## `kourou collection:create INDEX COLLECTION [BODY]`

Expand Down Expand Up @@ -471,7 +499,8 @@ OPTIONS
[default: {}] Only dump documents matching the query (JS or JSON format)
--scrollTTL=scrollTTL
The scroll TTL option to pass to the dump operation (which performs a document.search under the hood),
[default: 20s] The scroll TTL option to pass to the dump operation (which performs a document.search under the
hood),
expressed in ms format, e.g. '2s', '1m', '3h'.
--ssl
Expand Down Expand Up @@ -516,6 +545,35 @@ OPTIONS

_See code: [src/commands/collection/import.ts](src/commands/collection/import.ts)_

## `kourou collection:migrate SCRIPT PATH`

Migrate a collection

```
USAGE
$ kourou collection:migrate SCRIPT PATH
ARGUMENTS
SCRIPT Migration script path
PATH Collection dump path
OPTIONS
--api-key=api-key Kuzzle user api-key
--as=as Impersonate a user
--batch-size=batch-size [default: 200] Maximum batch size (see limits.documentsWriteCount config)
--collection=collection If set, override the collection destination name
--help show CLI help
--host=host [default: localhost] Kuzzle server host
--index=index If set, override the index destination name
--password=password Kuzzle user password
--port=port [default: 7512] Kuzzle server port
--protocol=protocol [default: ws] Kuzzle protocol (http or websocket)
--ssl Use SSL to connect to Kuzzle
--username=username [default: anonymous] Kuzzle username (local strategy)
```

_See code: [src/commands/collection/migrate.ts](src/commands/collection/migrate.ts)_

## `kourou config:diff FIRST SECOND`

Returns differences between two Kuzzle configuration files (kuzzlerc)
Expand Down Expand Up @@ -576,6 +634,22 @@ EXAMPLES

_See code: [src/commands/document/search.ts](src/commands/document/search.ts)_

## `kourou es:aliases:cat`

Lists available ES aliases

```
USAGE
$ kourou es:aliases:cat
OPTIONS
-g, --grep=grep Match output with pattern
-n, --node=node [default: http://localhost:9200] Elasticsearch server URL
--help show CLI help
```

_See code: [src/commands/es/aliases/cat.ts](src/commands/es/aliases/cat.ts)_

## `kourou es:indices:cat`

Lists available ES indexes
Expand Down Expand Up @@ -633,27 +707,27 @@ _See code: [src/commands/es/indices/insert.ts](src/commands/es/indices/insert.ts

## `kourou es:migrate`

Migrate all the index from one Elasticsearch server to another
Migrate all the index from an Elasticsearch (or a file) to another Elasticsearch

```
USAGE
$ kourou es:migrate
OPTIONS
--batch-size=batch-size [default: 1000] How many documents to move in batch per operation
--dest=dest (required) Destination Elasticsearch server URL
--dest=dest (required) Migration destination provider
--dry-run Print witch collections will be migrated
--help show CLI help
--no-interactive Skip confirmation interactive prompts (perfect for scripting)
--pattern=pattern Pattern to match indices to migrate
--reset Reset destination Elasticsearch server
--scroll=scroll [default: 30s] Scroll duration for Elasticsearch scrolling
--src=src (required) Source Elasticsearch server URL
--src=src (required) Migration source provider
EXAMPLES
kourou es:migrate --src http://elasticsearch:9200 --dest http://otherElasticsearch:9200 --reset --batch-size 2000
kourou es:migrate --src http://elasticsearch:9200 --dest http://otherElasticsearch:9200 --reset --batch-size 2000
--no-interactive
kourou es:migrate --src http://elasticsearch:9200 --dest ./my-backup --batch-size 2000 --pattern
'&myindexes.collection-*'
kourou es:migrate --src ./my-backup --dest http://elasticsearch:9200 --reset --batch-size 2000 --no-interactive
```

_See code: [src/commands/es/migrate.ts](src/commands/es/migrate.ts)_
Expand Down Expand Up @@ -796,7 +870,7 @@ OPTIONS
--all see all commands in CLI
```

_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.2.2/src/commands/help.ts)_
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.2.18/src/commands/help.ts)_

## `kourou import PATH`

Expand Down Expand Up @@ -858,6 +932,10 @@ OPTIONS
--query=query [default: {}] Only dump documents in collections matching the query (JS or JSON format)
--scrollTTL=scrollTTL [default: 20s] The scroll TTL option to pass to the dump operation (which performs a
document.search under the hood),
expressed in ms format, e.g. '2s', '1m', '3h'.
--ssl Use SSL to connect to Kuzzle
--username=username [default: anonymous] Kuzzle username (local strategy)
Expand Down Expand Up @@ -1026,8 +1104,14 @@ ARGUMENTS
APPLICATION Kuzzle PaaS application
OPTIONS
-f, --follow Follow log output
-n, --tail=tail Number of lines to show from the end of the logs
-t, --timestamp Show timestamp
--help show CLI help
--podName=podName Name of the pod to show logs from
--project=project Current PaaS project
--since=since Display logs from a specific absolute (e.g. 2022/12/02 09:41) or relative (e.g. a minute ago) time
--until=until Display logs until a specific absolute (e.g. 2022/12/02 09:41) or relative (e.g. a minute ago) time
```

_See code: [src/commands/paas/logs.ts](src/commands/paas/logs.ts)_
Expand Down Expand Up @@ -1306,6 +1390,8 @@ OPTIONS
--port=port [default: 7512] Kuzzle server port
--print-raw Print only the query result to stdout
--protocol=protocol [default: ws] Kuzzle protocol (http or ws)
--ssl Use SSL to connect to Kuzzle
Expand Down
2 changes: 1 addition & 1 deletion features/CSV.feature
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Feature: CSV Export
| flag | --format | csv |
Then I get the file in "nyc-open-data/yellow-taxi/documents.csv" containing
"""
_id,city,city.type,name,name.type
_id,city,firstName,lastName,name
the-hive-th,changmai,,,
luca,changmai,,,
chuon-chuon-kim,hcmc,,,
Expand Down
27 changes: 27 additions & 0 deletions features/Collection.feature
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,30 @@ Feature: Collection Commands
| collection | "yellow-taxi" |
Then I should receive a result matching:
| dynamic | "false" |

# collection:migrate ======================================

@mappings
Scenario: Migrate a collection
Given an existing collection "nyc-open-data":"yellow-taxi"
Given I "create" the following documents:
| _id | body |
| "antoine" | { "name": "Antoine Ducuroy" } |
| "karina" | { "name": "Karina Tsimashenka" } |
Given I refresh the collection
Given I run the command "collection:export" with:
| arg | nyc-open-data | |
| arg | yellow-taxi | |
Given I successfully call the route "collection":"truncate" with args:
| index | "nyc-open-data" |
| collection | "yellow-taxi" |
# migrate
When I run the command "collection:migrate" with args:
| "./features/fixtures/migration.js" |
| "./nyc-open-data/yellow-taxi" |
Then The document "antoine" content match:
| firstName | "Antoine" |
| lastName | "Ducuroy" |
Then The document "karina" content match:
| firstName | "Karina" |
| lastName | "Tsimashenka" |
Loading

0 comments on commit 5fe16f0

Please sign in to comment.