João Otávio Stivi [Profile]

Chief Technology Officer at Square Cloud

Changelog written by João Otávio Stivi in 26/06/2024.

Disclaimer: This is a summarized version of the changelog due to its length.

Official Website Update

We developed a new website from scratch, with a design similar to the previous one, but with much better performance. Navigation is smoother and the user experience has been improved. With a lot of new features and improvements, we are sure that you will love it!

Improved Performance

  • Faster Loading Times: The new website has been optimized for faster loading times, ensuring a smoother browsing experience.
  • Improved Responsiveness: The website is now more responsive, adapting to different screen sizes and devices.
  • Enhanced User Experience: The new design provides a more intuitive and user-friendly experience, making it easier to navigate and find information.

New team system

We have introduced a new team system that allows multiple users to collaboratively manage their applications. You can now invite team members, assign roles, and share access to your applications.

Add your application to a team and start collaborating with your team members.

And finally, invite your team members to join your team and start working together.

We hope you enjoy the new website and team system. If you have any feedback or suggestions, please let us know!

Automatized Backups

We have implemented a new daily backup system that automatically creates a backup of your application every day. This feature is available for PRO, BUSINESS, and ENTERPRISE clients.

Official Blob Update Notes:

All the Square Cloud Blob service has been updated, bringing significant improvements and new features. We have improved file upload and listing speeds and are preparing to launch the Blob file management portal, where you can upload, download, delete, and view files directly from your browser.

Updates on @squarecloud/blob

We have updated the @squarecloud/blob package, bringing significant improvements and new features.

Installation

To install the package, run the following command in your terminal:

npm install @squarecloud/blob

Improvements

  • New BlobObject Structure for standardized object data management.
  • New MimeTypeUtil Class for handling supported object mime types.
  • Overall semantic improved (objects.put > objects.create and more).
  • Blob API Routes now updated to follow Rest API semantic.
  • Enhanced developer experience: Now exporting helpful typings.
  • New SquareCloudBlob#stats Method: Introduced the new SquareCloudBlob#stats method for checking account statistics.
  • Added mimeType property for creating objects, required if the file is a Buffer.
  • Object create method now returns useful information about the uploaded object.
  • Added filtering support for the objects.list method.

Official API Update Notes:

We have updated the Square Cloud API, bringing significant improvements and new features.

New Routes

  • GET /v2/apps/:appID/backups: This route allows you to retrieve a list of backups (snapshots) for a specific application.
  • GET /v2/apps/:appID/network/dns: This route allows you to retrieve the DNS configuration for a specific application.
  • GET /v2/apps/:appID/network/analytics: This route allows you to retrieve the analytics configuration for a specific application. (BETA)

Improvements

  • Improved cache syncronization: We have improved the cache synchronization system to ensure that all data is up to date.
  • Improved error handling: We have improved the error handling system to provide more detailed and accurate error messages.
  • Improved fallback system: We have implemented a new fallback system that automatically switches to a backup server in case of downtime.
  • New daily backup system: We have implemented a new daily backup system that automatically creates a backup of your application every day. (Only for PRO, BUSINESS, and ENTERPRISE clients)
  • All backups now have a unique signature: In addition, we have increased the expiration period of Square backups from 14 days to 30 days. Previously, backups were accessible with: Account ID + Application ID + random key. Now, it requires: Account ID + Application ID + unique signature of each account (and unique of each backup). This makes it impossible for anyone to access your backup, even if you end up exposing your account ID, application ID, and random key (in the case of old backups).

Breaking Changes

  • “tag” property renamed to “name” in all routes.
  • Removed isWebsite property from the application object.

Official CLI Update Notes:

We have implemented a new CLI version, bringing significant improvements.

Installation

To install the CLI, just run the following command in your terminal:

Improvements

  • Support for .squareignore and .squarecloudignore Files: The CLI now supports the use of .squareignore and .squarecloudignore files to specify files and directories to be ignored during deployments and other operations.
  • New Upload Command: A new upload command has been introduced, which supports local files in .zip format for streamlined project uploads.
  • Bug Fixes in Project Compression: Various bugs encountered during the project compression process have been identified and resolved, ensuring a smoother and more reliable experience.
  • Enhanced Commit Command: The commit command has been enhanced to accept the —restart flag and also supports local files in .zip format, providing greater flexibility in managing project versions and deployments.

Update

To update the CLI, just run the following command in your terminal:

Official SDK JS Update Notes:

We have implemented a new SDK JS version, bringing significant improvements.

Installation

To install the SDK, run the following command in your terminal:

npm install @squarecloud/api

Improvements

  • Fix Circular Dependency Error: Resolved an issue with circular dependencies.
  • Rename ApplicationManager#status Method: Renamed the ApplicationManager#status method to statusAll to match its API endpoint.
  • Rename Tag Properties: Renamed all tag properties (user and application) to name as the API deprecated the old properties.
  • Enhancements to BaseApplication: Allowed additional app methods in BaseApplication to increase functionality and flexibility.

Curious about the changes? Check out the example below:

You can use app methods directly when you get the app from the user. You no longer need to fetch the specific app.
- const user = await api.users.get()
- const application = await user.applications.get("id").fetch()
- 
- await application.getStatus() // and other methods

+ const user = await api.users.get()
+ const application = user.applications.get("id")
+ 
+ await application.getStatus() // and other methods

Official SDK PY Update Notes:

We have implemented a new SDK PY version, bringing significant improvements.

Installation

To install the SDK, run the following command in your terminal:

pip install squarecloud-api

If you intend to use this SDK for command-line interface (CLI) operations, consider installing it with pipx:

pipx install squarecloud-api

Improvements

  • Metadata in Listeners: Added the ability to incorporate the extra argument in certain methods to send metadata to listeners. If the annotation of this parameter in the listener is a Pydantic model, the SDK will attempt to convert the provided metadata into that model.
  • Logs in Listeners: Implemented logging for listeners. When a listener is called, useful information such as the endpoint and its return is logged.
  • Configuration File Management: The API for creating and managing configuration files has been enhanced. Configuration files are now class objects with added features such as serialization and deserialization. The method create_config_file is still available but marked as deprecated and will be removed in the future.
  • Field Addition to FileInfo Object: Added the app_id field to the FileInfo object.
  • Fixed CLI Root Command Error: Resolved an issue where the squarecloud command was missing in pyproject.toml scripts.
  • Fixed Typing Due to API Changes: Corrected typing issues arising from recent API updates.

SDK Documentation

  • Updated request listener example.
  • Updated docstrings to reflect the latest changes and improvements.
  • Removed statistics examples (route discontinued).
  • Added new examples and use cases to the documentation.

Breaking Changes

  • Endpoint Changes:
    • Endpoint.user_me renamed to Endpoint.user.
    • Removed Endpoint.user_info.
  • Client Changes:
    • Removed Client.user_info.
    • Renamed Client.me to Client.user.
    • Removed support for the statistics endpoint:
      • Client.statistics method.
      • Endpoint.statistics class method.
      • CLI sub-command statistics.

Official Github Action Update

We have implemented a new Github Action version, bringing significant improvements. Now you can use the CLI as a backend for the GitHub Action. That’s right, you read it correctly! Now you have the freedom to use your creativity to the fullest, being able to run custom commands like zip, commit, and upload and create completely unimaginable workflows.

Example of Workflow

Note: This is just an example, you can create your own workflow according to your needs.

name: Publish to production

on:
  push:
    branches:
      - master

jobs:
  publish-production:
    name: Publish to Production
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Setup Node.js 20.x
        uses: actions/setup-node@v4
        with:
          node-version: 20

      - name: Install Dependencies
        run: npm i

      - name: Build Project
        run: npm run build

      - name: Create .env file
        env:
          ENV_CONTENT: ${{ secrets.ENV_FILE }}
        run: echo $ENV_CONTENT > .env

      - name: Setup Square Cloud
        uses: squarecloudofc/github-action@v2
        with:
          token: '${{ secrets.SQUARE_TOKEN }}'
          install-only: true

      - name: Commit discord bot to square cloud
        run: squarecloud commit ${{ secrets.SQUARE_APPLICATION_ID }}

Check out the Square Cloud github action for more information.

Official Documentation Update

We have made several updates to the official documentation, including new articles, guides, and FAQs. We have also revised and updated existing articles to provide more detailed and complete information. Check out the latest updates below:

New Articles & Guides:

  • Comprehensive Guide on Square Cloud Bot Hosting Services: An in-depth article detailing the bot hosting capabilities of Square Cloud, presented in a clear and accessible manner for users of all levels.
  • Comprehensive Guide on Square Cloud Hosting Services for Sites and APIs: A thorough article that explains the site and API hosting features of Square Cloud, offering detailed insights and easy-to-follow instructions for optimal usage.
  • New Hosting Guide for Discord Bots, teaching how to host and create Discord Bots.
  • New Hosting Guide for WhatsApp Bots, teaching how to host and create WhatsApp Bots.
  • New Hosting Guide for Telegram Bots, teaching how to host and create Telegram Bots.
  • New Hosting Guide for Vue, Vite & Next.js frameworks, teaching how to host sites in these frameworks and how to configure them.
  • New Hosting Guide for Flask, NestJS, Django, Fastify, and Express applications, teaching how to host applications in these frameworks and how to configure them.
  • New Hosting Guide for Applications Using Selenium, teaching how to host and create applications in Python using Selenium.

Updated Articles & Guides:

  • Revised “Overview” Article: The “Overview” Article Was Completely Rewritten to Provide a More Comprehensive and Explanatory Guide to the Square Cloud Platform and Its Services.
  • Revised “Quickstart” Article: The “Quickstart” Article Was Completely Rewritten to Provide a More Comprehensive and Explanatory Guide on How to Use Square Cloud Services and Host Your Application.
  • Revised “Config File” Article: The “Config File” Article Was Completely Rewritten to Provide More Detailed and Complete Examples About the Configuration File.
  • Addition of “Troubleshooting” in Articles for Sites and APIs: Inclusion of a Section Dedicated to Solving Common Problems in Site and API Hosting Articles.
  • Revamped CLI Articles: The Articles on the CLI Were Completely Redone, Offering More Comprehensive and Explanatory Guides on How to Use Square Cloud’s CLI.
  • Updated Minimum RAM for Bots in Documentation to 256MB: The Minimum RAM was Changed from 100MB to 256MB.

New FAQs:

  • New FAQ About Square Cloud Timezone: Article Explaining the Square Cloud Timezone and How to Change It in Python and JavaScript.
  • New FAQ About the Top.gg Webhook: Article Explaining the Top.gg Webhook and How to Configure It in Square Cloud.
  • Addition of “Troubleshooting” in Articles for Sites and APIs: Inclusion of a Section Dedicated to Solving Common Problems in Site and API Hosting Articles.

Other Updates:

  • New Square Cloud Service Documented, presentation article and tutorial on Blob, Square Cloud’s CDN service.
  • Documented Team System, new introduction of a team system allowing multiple users to collaboratively manage their applications.
  • Standardization in Documentation Guides, with a comprehensive standardization of the guides section to ensure consistency and clarity.