1.2.0 • Published 4 months ago

directus-cms-extensions v1.2.0

Weekly downloads
-
License
ISC
Repository
github
Last release
4 months ago

Building

  • Open folder with extension in terminal
  • For plain extension run directus-extension build + directus-extension-builder.js \ for bundles run directus-extension build + directus-extension-bundles-builder.js

Extensions:

You can find docs for operations in corresponding folders

Testing:

There is explained an approach how to create and maintain tests with Directus entities \ like Flows and Operations. \ Each test labeled with prefix [TEST | **]. \ We have 3 types ones: [TEST | START], [TEST | TESTS FLOWS], [TEST | FLOW].

Prepare tests output code:

module.exports = async function(data) {
  const defaultFields = {
    $trigger: '$trigger',
    $last: '$last',
    $accountability: '$accountability',
    $env: '$env'
  };

  const testsResult = { status: '', passed: {tests: []}, failed: {tests: []} };

const checkedTests = Object.keys(data.main_output)
  .filter((key) => !defaultFields[key])
  .map((key) => data.main_output[key])
  .forEach((t) => {
  if (t.status === 'success') {
    testsResult.passed.tests.push(t);
  } else {
    testsResult.failed.tests.push(t);
  }

  delete t.status;
});

  testsResult.passed.count = testsResult.passed.tests.length;
  testsResult.failed.count = testsResult.failed.tests.length;
  testsResult.status = testsResult.failed.count ? 'failed' : 'success';

  return testsResult;
}

Tested operations:

  • TEST | FLOW CRUD user flow - create_users/read_users/update_users/delete_users
  • TEST | FLOW Create proxy - serp
  • TEST | FLOW Generate pin code - generate_pin_code
  • TEST | FLOW JWT flow - create_jwt/verify_jwt
  • TEST | FLOW OpenAI - openai/openai_embeddings
  • TEST | FLOW Translations - deepL
  • TEST | FLOW Web-scraping - scrape_webpage/get_website_urls/get_website_dead_urls
  • TEST | FLOW Communication - send_sms_by_gateway/send_emails_by_mailgun/send_fb_push_notifications Test cases you can find in /directus-tests file
1.2.0

4 months ago