0.5.0 • Published 4 years ago
@windingtree/lpms-cli v0.5.0
@windingtree/lpms-cli
Console utility for ease access to LPMS APIs
Setup
yarn add @windingtree/lpms-cli
lpmsUsage: lpms [options] [command]
LPMS API CLI
Options:
-V, --version output the version number
-h, --help display help for command
Commands:
config [options] Adds or removes configuration properties
mnemonic [options] Generates random 24 word mnemonic
salt Returns a random salt string (bytes32)
wallet [options] Wallet account information
login [options] Makes login with password
storage [options] Uploads files to storage
addresses Returns addresses of service provider roles
register [options] Registration of the service provider
facility [options] Operation with the facility
item [options] Operations with a item
stub [options] Operations with stubs
help [command] display help for commandConfiguration
lpms config --set apiUrl --value http://localhost:5000
lpms config --set providerUri --value https://sokol.poa.network
lpms config --get providerUriFull list of config properties
apiUrl:lpms-serverAPI URIproviderUri: Blockchain provider URImnemonic: Wallet mnemonic. Can be generated and saved with themnemoniccommanddefaultAccountIndex: Default wallet account index.0by defaultsalt: Unique salt string, Required for creation and registration of the service provider. Can be generated and saved with thesalecommandlineRegistry: Address of the smart contract of the Service PRoviders Registry (Videreprotocol)
Login
lpms login --login manager --password winwin"manager" user has been successfully logged inWallet mnemonic generation
lpms mnemonic
lpms mnemonic --save
lpms mnemonic --save --index 0--savesaves the mnemonic to the CLI config--indexsets the default account index
history pudding dynamic dynamic staff village pupil prison nut father goose column lonely meadow effort aunt sure biology surround echo bachelor mechanic artwork void
Mnemonic has been successfully saved to the CLI configWallet status information
lpms wallet
lpms wallet --index 1
lpms wallet --index 1 --keys--indexspecifies the idex of the account to display--keysexport of the public and private keys
Account idex: 0
Wallet account: 0xcF76325B47a0edF0723DC4071A73C41B4FBc44eA (0.0 xDAI)
Public key: 0x048498a9f26844c54f88...e6b7a836bd25487ef1994bf291979e9dbc8
Private key: 0xa0d132baf98616634f19a368bc99e8e4bc6f4f140eefb31dc8b80096c0c24f8bGetting addresses of servers roles
lpms addresses┌─────────┬───────────┬──────────────────────────────────────────────┐
│ (index) │ role │ address │
├─────────┼───────────┼──────────────────────────────────────────────┤
│ 0 │ 'api' │ '0x8c27Aa036fE743162A09Cbb46bf6AA98C60c103d' │
│ 1 │ 'bidder' │ '0x2760e234062C4a04494DE11b1521C36f947DbdE8' │
│ 2 │ 'manager' │ '0xE67297b5556728499392B2fF72c3596A43d42800' │
│ 3 │ 'staff' │ '0x8e811c0D0969865D6Cb632Fb820f2275396D7AA6' │
└─────────┴───────────┴──────────────────────────────────────────────┘Uploading files to storage
lpms storage --file ./path/to/README.md./README.md has been uploaded successfully. Storage Id: bafkreiddp6nksmdoe6rw7rakpwrr3yosh6hnzzkwrc2nuuiemk74aa3mqySalt string generation
lpms saltRandom salt string: 0x18b6369b08e7e3b3776ba41653c39d7ec3f4806eeab047518d1c06479d178ec7Registration of the service provider
Getting Id
lpms register --line stays --salt 0xa47669298673f7d2c0d76cb399f902d2dddbe937040ecc40c550b2ed05da95ea --idRegistration
staysmust be initialized and registered
lpms register --line stays --salt 0xa47669298673f7d2c0d76cb399f902d2dddbe937040ecc40c550b2ed05da95eaFacility management
Activation
lpms facility --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --activateDeactivation
lpms facility --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --deactivateAdding/updating the facility metadata
lpms facility --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --data ./path/to/metadata.jsonGetting of the facility metadata
lpms facility --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7Removal of the facility
lpms facility --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --removeAdding of modifiers to the facility
Modifiers keys:
day_of_week,occupancy,length_of_stay
lpms facility --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --modifier <key> --data ./path/to/modifier.jsonGetting of modifiers from the facility
lpms facility --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --modifier <key>Deleting of modifiers from the facility
lpms facility --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --modifier <key> --removeAdding of rules to the facility
Rules keys:
notice_required,length_of_stay
lpms facility --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --rule <key> --data ./path/to/rule.jsonGetting of rules from the facility
lpms facility --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --rule <key>Deleting of rules from the facility
lpms facility --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --rule <key> --removeItems management
Adding/updating item metadata
lpms item --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --itemId 0x01e5404aa35dfe2b33fe4a714bfd301e0b5723dbbaf48454ee44b741b484900b --itemType space --data ./path/to/metadata.jsonGetting of the item metadata
lpms item --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --itemId 0x01e5404aa35dfe2b33fe4a714bfd301e0b5723dbbaf48454ee44b741b484900bRemoval of the item
lpms item --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --itemId 0x01e5404aa35dfe2b33fe4a714bfd301e0b5723dbbaf48454ee44b741b484900b --removeGetting availability (default or on date) of the item
lpms item --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --itemId 0x01e5404aa35dfe2b33fe4a714bfd301e0b5723dbbaf48454ee44b741b484900b --availability default
lpms item --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --itemId 0x01e5404aa35dfe2b33fe4a714bfd301e0b5723dbbaf48454ee44b741b484900b --availability 2022-07-11Adding availability to the item
lpms item --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --itemId 0x01e5404aa35dfe2b33fe4a714bfd301e0b5723dbbaf48454ee44b741b484900b --availability default --data ./path/to/availability.json
lpms item --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --itemId 0x01e5404aa35dfe2b33fe4a714bfd301e0b5723dbbaf48454ee44b741b484900b --availability 2022-07-11 --data ./path/to/availability.jsonRemoval of availability from the item
Note: you cannot remove the
defaultkind of availability from the item. To changedefaultavailability you should just add it
lpms item --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --itemId 0x01e5404aa35dfe2b33fe4a714bfd301e0b5723dbbaf48454ee44b741b484900b --availability 2022-07-11 --numSpaces 1 --removeAdding of modifiers to the facility
lpms item --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --itemId 0x01e5404aa35dfe2b33fe4a714bfd301e0b5723dbbaf48454ee44b741b484900b --modifier <key> --data ./path/to/modifier.jsonGetting of modifiers from the item
lpms item --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --itemId 0x01e5404aa35dfe2b33fe4a714bfd301e0b5723dbbaf48454ee44b741b484900b --modifier <key>Deleting of modifiers from the item
lpms item --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --itemId 0x01e5404aa35dfe2b33fe4a714bfd301e0b5723dbbaf48454ee44b741b484900b --modifier <key> --removeAdding of rules to the item
lpms item --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --itemId 0x01e5404aa35dfe2b33fe4a714bfd301e0b5723dbbaf48454ee44b741b484900b --rule <key> --data ./path/to/rule.jsonGetting of rules from the item
lpms item --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --itemId 0x01e5404aa35dfe2b33fe4a714bfd301e0b5723dbbaf48454ee44b741b484900b --rule <key>Deleting of rules from the item
lpms item --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --itemId 0x01e5404aa35dfe2b33fe4a714bfd301e0b5723dbbaf48454ee44b741b484900b --rule <key> --removeAdding of rates to the item
lpms item --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --itemId 0x01e5404aa35dfe2b33fe4a714bfd301e0b5723dbbaf48454ee44b741b484900b --rate <key> --rateType items --data ./path/to/rule.jsonGetting of rules from the item
lpms item --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --itemId 0x01e5404aa35dfe2b33fe4a714bfd301e0b5723dbbaf48454ee44b741b484900b --rate <key> --rateType itemsDeleting of rules from the item
lpms item --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --itemId 0x01e5404aa35dfe2b33fe4a714bfd301e0b5723dbbaf48454ee44b741b484900b --rate <key> --rateType items --removeStubs
Getting all stubs of the facility
lpms stub --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --index 0 --perPage 10Getting a stub of the facility by date
lpms stub --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --date 2022-08-12 --index 0 --perPage 10Getting a stub of the item of the facility
lpms stub --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --itemId 0x01e5404aa35dfe2b33fe4a714bfd301e0b5723dbbaf48454ee44b741b484900b --index 0 --perPage 10Getting a stub of the item of the facility by date
lpms stub --facilityId 0x8991ad64938cc0ceecc328dd28107facab94f509d1bd54ff3cf4511164edf1c7 --itemId 0x01e5404aa35dfe2b33fe4a714bfd301e0b5723dbbaf48454ee44b741b484900b --date 2022-08-12 --index 0 --perPage 100.5.0
4 years ago
0.4.3
4 years ago
0.4.2
4 years ago
0.4.1
4 years ago
0.4.0
4 years ago
0.3.2
4 years ago
0.3.1
4 years ago
0.3.0
4 years ago
0.2.0
4 years ago
0.1.0
4 years ago
0.0.10
4 years ago
0.0.9
4 years ago
0.0.8
4 years ago
0.0.7
4 years ago
0.0.6
4 years ago
0.0.5
4 years ago
0.0.4
4 years ago
0.0.3
4 years ago
0.0.2
4 years ago
0.0.1
4 years ago