ac-bundle-module-utils-request

utils/request.js

A module for ac-bundle-app, published by ac-bundle-module.

Available Methods: data

data

async function(request, prop) {
  if (!app.has(prop)) prop = "";
  var data = await request.text();
  try { var json = JSON.parse(data); } catch (error) {}
  if (app.has(json)) {
    if

ac-bundle-module-utils-promise

utils/promise.js

A module for ac-bundle-app, published by ac-bundle-module.

Available Methods: wrap

wrap

function(value, p) {
  if (typeof value === "object") {
    p = value;
    value = "data";
  }
  return new Promise(function(resolve, reject) {
    p.then(function(d) {
      var data = {error: undefined};

ac-bundle-module-utils-username

utils/username.js

A module for ac-bundle-app, published by ac-bundle-module.

Available Methods: valid, exists

valid

function(value) {
  var re = /^\w+$/;
  return re.test(value) && value.length = 5;
}

exists

async function(username) {
  var {users, error} = await app.api.mysql.request("users", function(data) {}, `
    SELECT

ac-bundle-module-utils-user

utils/user.js

A module for ac-bundle-app, published by ac-bundle-module.

Available Methods: getByKey, getByKeyAndToken, getByEmail, list, save

getByKey

async function(key) {
  var {user, error} = await app.api.mysql.request("user", function(data) {}, `
    SELECT
      *
    FROM \`user\`
    WHERE
      \`key\`=` + app.api.mysql.escape(key) + `
  `);
  return

ac-bundle-module-utils-string

utils/string.js

A module for ac-bundle-app, published by ac-bundle-module.

Available Methods: toProperCase

toProperCase

function(str) {
  return str.replace(
    /\w\S*/g,
    function(txt) {
      return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
    }
  );
}

Happy Coding!…

ac-bundle-module-utils-password

utils/password.js

A module for ac-bundle-app, published by ac-bundle-module.

Available Methods: test, medium, strong

test

function(password, level) {
  if (typeof level === "undefined") level = "medium";
  return mod[level]().test(password);
}

medium

function() {
  return new RegExp("^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})");
}

strong

function() {
  return new

ac-bundle-module-storage-kv

storage/kv.js

A module for ac-bundle-app, published by ac-bundle-module.

Available Methods: namespace

namespace

function(namespaceKey) {
  var namespace = {
    get link() { return "getter"; return "getter";
      var link = "https://api.cloudflare.com/client/v4/accounts/" + appConfig.cloudflare.account + "/storage/kv/namespaces/" + namespaceKey;
      return link;
    },
    get: async

ac-bundle-module-api-mysql

api/mysql.js

A module for ac-bundle-app, published by ac-bundle-module.

Available Methods: escape, connect, requestCallback

escape

function(value) {
  return mysql.escape(value);
}

connect

function() {
  return new Promise(function(resolve, reject) {
    if (!app.has(mod.connection) || mod.connection.state.split("disconnect").length 1) {
      mod.connection = mysql.createConnection(appConfig.mysql);
      mod.connection.connect(function(error, data) {
        resolve(true);

ac-bundle-module-utils-compression

utils/compression.js

A module for ac-bundle-app, published by ac-bundle-module.

Available Methods: compress, decompress

compress

function(s) {
  var dict = {};
  var data = (s + "").split("");
  var out = [];
  var currChar;
  var phrase = data[0];
  var code = 256;
  for

ac-bundle-module-utils-metadata-airtable

utils/metadata/airtable.js

A module for ac-bundle-app, published by ac-bundle-module.

Available Methods: table

table

async function(base, table) {
  var {record, error} = await app.api.airtable.requestMetadata("record", function(json, page) {}, "Structure", "Grid view", [], "GET", "&filterByFormula=" + app.utils.url.encode("IF(AND(Base=\"" + base + "\", Table=\"" + table