npm package: @spheremall_org/shared-toolbox
Description: SM toolbox with common script to avoid duplicating of these scripts
Author: SphereMall
Latest version: 0.10.0

# SphereMall shared toolbox

_A package with common scripts that are commonly used during deployment._

List of scripts:

## sm-publish-swagger 
  publishing swagger.json to the shared S3 bucket (`tsoa spec` is required before publish).
  
  __Usage example__:
  
  * _package.json_:
    ```json
      {
        "scripts": {
            "swagger:generate": "tsoa spec",
            "swagger:publish": "sm-publish-swagger"
        }
      }
    ```
    
  * _bitbucket-pipelines.yml_
    ```yml
      step:
        script:
          - npm run swagger:generate
          - npm run swagger:publish
    ```
    
  __Requirements__:
  
  * `AWS_STATIC_BUCKET_NAME` env variable
  * `AWS_DEFAULT_REGION` env variable

## sm-output-hash-update
  updating output hash for a microfrontend in `mf-imports.json` on a static S3 bucket.

  __Usage example__:
  
  * _package.json_:
    ```json
      {
        "scripts": {
            "output-hash-update": "sm-output-hash-update"
        }
      }
    ```
    
  * _bitbucket-pipelines.yml_
    ```yml
      step:
        artifacts:
          - public/**
        script:
          - npm run build
          - npm run output-hash-update
    ```
    
  __Requirements__:
  
  * `AWS_STATIC_BUCKET_NAME` env variable
  * `AWS_DEFAULT_REGION` env variable

## pact-broker-configuration
  common constant with required properties of pact broker to authorize with basic auth flow.

  __Usage example__:
  * publish-pacts.js
      ```js
      require('dotenv').config({ path: `./.env.${process.env.NODE_ENV || 'development'}` });
    
      const pact    = require('@pact-foundation/pact-node/src/index'),
            project = require('../package.json'),
            toolbox = require('@spheremall_org/shared-toolbox');
    
      pact.publishPacts(Object.assign({
              pactFilesOrDirs: [ './pacts/files' ],
              pactBroker     : project.pactBrokerUrl,
              consumerVersion: project.version,
              tags           : [ 'latest' ]
          }, toolbox.pactBrokerConfig))
          .then(() => console.log('Pacts were successfully published!'));
      ```
    * pact.verify.spec.ts
    ```ts
    import pact from '@pact-foundation/pact-node';
    /**
     * For verifying pacts locally: creds for pact should not be stored in `.env.test`.
     * If no variable exists - load it from `.env.development`.
    */
    if (!process.env.PACT_BROKER_BASE_URL) {
       require('dotenv').config({ path: './.env.development' });
    }
    const project = require('../../package.json'),
          toolbox = require('@spheremall_org/shared-toolbox');
    pact.verifyPacts(Object.assign({
            providerBaseUrl          : 'http://localhost:3000',
            provider                 : project.name,
            providerVersion          : project.version,
            publishVerificationResult: true
        }, toolbox.pactBrokerConfig));
    ```

  __Requirements__:

  * `PACT_BROKER_BASE_URL` env variable
  * `PACT_BROKER_USERNAME` env variable
  * `PACT_BROKER_PASSWORD` env variable