-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(readme): update readme and test
- Loading branch information
Gerald Baulig
committed
Dec 13, 2023
1 parent
0aacead
commit 670d005
Showing
6 changed files
with
81 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
data/generated/ | ||
#data/generated/ | ||
objects/*.js | ||
objects/*.js.map | ||
objects/*.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# System Data Set for Restorecommerce | ||
|
||
The data set comprises the following resources: | ||
|
||
- System relevant enumerations | ||
- Basic access control rules, policies and roles | ||
- Tech users | ||
- Unit codes, countries, timezones, taxes, etc. | ||
|
||
The data is partially generated with a set of generator scripts which reside | ||
under [generator](generator). | ||
|
||
## Usage | ||
|
||
This data set comes with a set of scripts which import JSON and YAML data. | ||
Resources are imported using the [gql-bot](https://github.com/restorecommerce/gql-bot) which is an automated task processor with a GraphQL Client. | ||
All data is imported via the GraphQL API exposed by the [facade-srv](https://github.com/restorecommerce/facade-srv). | ||
|
||
All possible operations are exposed through JS scripts. | ||
These scripts either execute GraphQL mutations/ queries through the `import.js` script. | ||
The `import.js` also includes command-line options such as specifying if we wish | ||
to import the data locally or into the production environment. | ||
|
||
### Current supported jobs are | ||
|
||
- master (imports resources `commands` `contact_points_types`, `countries`, `locales`, `organizations`, `tax_types`, `taxes`, `timezones`) | ||
- identity (imports `users`, `policies`, `policy_sets`, `roles`, `rules`) | ||
- extra (imports resources `unit_codes`) | ||
|
||
> NOTE: Resources must be imported in a specific order! | ||
> Master > Identity > Extra. | ||
> | ||
> For the case when importing resources returns "Access denied", one way to fix | ||
> this is to restart `facade-srv` in order to sync the api key with the other | ||
> upstream services. | ||
### Script usage | ||
|
||
1. Extract the API-KEY from the logs of `facade-srv`. | ||
|
||
2. Either export the API-KEY, paste it to an `.env` file or paste as command argument. | ||
|
||
2. Generate catalog datasets using [`transform.js script`](./generator/catalog/transform.js): | ||
|
||
- `node ./transform.js` | ||
|
||
3. Import datasets using [`import.js script`](./import.js): | ||
|
||
- `node ./import.js import -t <access_token> -d system -j <job>` | ||
|
||
4. Examples: | ||
|
||
- `node ./import.js import -t <access_token> -d system -j master` | ||
- `node ./import.js import -t <access_token> -d system -j identity` | ||
- `node ./import.js import -t <access_token> -d system -j extra` | ||
|
||
### Supported environment variables: `GQL_ENDPOINT`. | ||
|
||
All flags are optional, and they can be listed by typing `node ./import.js -h`. | ||
The API key can be obtained from the [`facade-srv`](https://github.com/restorecommerce/facade-srv/blob/master/cfg/config.json#L21) configuration. | ||
The API key is generated during system startup from the `facade-srv` (Check the log message of facade-srv `Bootstrap API Key is`). | ||
|
||
By default, the GraphQL importer uses the configuration file `config.json` to read data regarding endpoints for retrieving the API key | ||
and executing mutations/ queries. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters