w3platformsdk
v1.0.38
Published
The W3 Platform CLI is a Node.js based command-line tool that provides a set of utilities to interact with the W3 Platform services. This includes managing credentials, profiles, initializing environments, and handling user accounts.
Downloads
24
Readme
W3 Platform Command Line Interface
The W3 Platform CLI is a Node.js based command-line tool that provides a set of utilities to interact with the W3 Platform services. This includes managing credentials, profiles, initializing environments, and handling user accounts.
Installation
Ensure that you have Node.js installed on your system.
- Clone this repository or download the source code.
- Navigate to the directory where you downloaded the CLI.
- Run the following command to install dependencies:
npm install
- To make the CLI globally available on your system, run:
npm link
Configuration
Before using the CLI, you need to configure your credentials:
w3platform-cli configure
Follow the prompts to enter your organization's name, API key, org ID, and secret.
Commands
The CLI supports various commands, such as:
configure
: Sets up your API key and other configuration details required to authenticate against the W3 Platform services.profiles
: Lists all the profiles that have been configured on your local machine.profile
: Displays the currently active profile with its configuration details.setProfile [profileName]
: Switches the active profile to the one specified byprofileName
.init
: Begins the initialization process for your organization, setting up the necessary environment for using W3 Platform services.createOwnerAccount
: Specifically designed to be used during the initialization process, this creates the primary owner account for your organization.createAccount
: Creates a new user account within the organization.createUser [accountId] [name]
: Registers a new user within the account specified byaccountId
with the namename
.initEnv
: Triggers the creation of a full environment setup, including all necessary services and configurations.addUserRole [userId] [role]
: Assigns a new role to a user identified byuserId
.removeUserRole [userId] [role]
: Removes a role from a user identified byuserId
.assignUserToWebUser [userId] [UserWebId]
: Links a user to a web user profile.registerAdmin [accountId]
: Registers an admin account using theaccountId
provided.registerAccount [accountId]
: Finalizes the account registration process for an account specified byaccountId
.registerStorageService [accountId]
: Signs up the account identified byaccountId
for the W3 storage service.uploadContent [accountId] [fileName] [type] [description] [TTL]
: Uploads content to the W3 platform under the provided account.getContent [tokenId]
: Retrieves content from the W3 platform using the provided token ID.signupStorageRead [accountId]
: Allows the specified account to read from W3 storage service.assignContnet [tokenId] [tokenOwnerAccountId] [assignedAccountId]
: Assigns access for content identified bytokenId
to another account.deprecateToken [tokenId] [storageAccountId]
: Deprecates a token that was previously in use.organizations
: Lists all available organizations within the scope of the credentials provided.callService [serviceId] [serviceOrgid] [accountId] [request]
: Invokes a service with a specific request.signupUser [name] [password] [email] [phone] [accountId]
: Registers a web user on the W3 platform.verifyUser [name] [code]
: Verifies a user's identity with the provided code.userLogin [name] [password]
: Logs in a user to the W3 platform.validateToken [tokenResponseFile]
: Validates a user's login token.forgotPassword [username]
: Initiates a password reset process for a user.confirmResetPassword [username] [newpassword] [code]
: Finalizes the password reset process for a
Usage
To use the CLI, run w3platform
followed by the command you want to execute. For example:
w3platform profiles
This command will display the current organization profiles configured on your system.
Contributing
Contributions are welcome. Please fork the repository and submit a pull request with your changes.
License
This project is open-source and available under the MIT License.
Support
If you encounter any issues or require assistance, please raise an issue in the repository or contact [email protected].