0.2.2 • Published 3 days ago

appwrite-utils v0.2.2

Weekly downloads
-
License
-
Repository
github
Last release
3 days ago

appwrite-utils

Overview

appwrite-utils is a comprehensive TypeScript library designed to streamline the development process for Appwrite projects. It provides a suite of utilities and helper functions that facilitate data manipulation, schema management, and seamless integration with Appwrite services. Whether you're managing data migrations, schema updates, or simply need a set of robust tools for your Appwrite project, appwrite-utils has you covered. This package is meant to be imported into your project for access to validation functions, converter functions, and more, enhancing your project's capabilities with Appwrite.

Features

  • Validation Functions: Utilize a collection of validation functions to ensure data integrity throughout your Appwrite projects.
  • Converter Functions: Transform data effortlessly with a suite of converter functions, facilitating smooth data manipulation and integration.
  • Attribute Schemas: Define and manage your data models with ease using comprehensive attribute schemas.
  • File Operations: Leverage functions for efficient file management and access within your Appwrite projects, including URL generation for file viewing and downloading.

Installation

To integrate appwrite-utils into your project, ensure you have npm installed and run the following command in your project directory:

npm install appwrite-utils

Utilities

Validation Functions

These functions help ensure the integrity and correctness of the data in your Appwrite projects:

isNumber, isString, isBoolean, isArray, isObject, isNull, isUndefined, isDefined, isDate,
isEmpty, isInteger, isFloat, isArrayLike, isArrayLikeObject, isFunction, isLength, isMap,
isSet, isRegExp, isSymbol, isObjectLike, isPlainObject, isSafeInteger, isTypedArray,
isEqual, isMatch, has, get

Converter Functions

Converters are designed to transform data formats or types to suit specific needs within your applications:

anyToString, anyToNumber, anyToBoolean, anyToAnyArray, anyToStringArray,
trySplitByDifferentSeparators, removeStartEndQuotes, splitByComma, splitByPipe,
splitBySemicolon, splitByColon, splitBySlash, splitByBackslash, splitBySpace,
splitByDot, splitByUnderscore, splitByHyphen, pickFirstElement, pickLastElement,
stringifyObject, parseObject, safeParseDate, removeInvalidElements, joinValues,
joinBySpace, joinByComma, joinByPipe, joinBySemicolon, joinByColon, joinBySlash,
joinByHyphen, convertPhoneStringToUSInternational, validateOrNullEmail

File Functions

These functions facilitate the management and operation of files within your Appwrite projects:

getFileViewUrl, getFileDownloadUrl

Both getFileViewUrl and getFileDownloadUrl take parameters like endpoint, projectId, bucketId, fileId, and optionally jwt to generate accessible URLs for files stored in Appwrite.

Usage

After installing the package, you can directly import and use the various utilities in your TypeScript or JavaScript code. For example:

import { isNumber, anyToString } from 'appwrite-utils';

// Use the functions directly in your code
console.log(isNumber(5));  // Output: true
console.log(anyToString(1234));  // Output: "1234"

This setup ensures that your interactions with Appwrite are more robust, less error-prone, and significantly more manageable.

Changelog

  • 0.2.2: Lots of updates, moved schemas and stuff here, fixed package, added export of AuthUser which got removed accidentally
  • 0.1.21: Changed ID.unique() to ulid() for random ID generation, refactored schema.ts into multiple files
  • 0.1.20: Forgot type ValidationRules, type ConverterFunctions, and type AfterImportActions
  • 0.1.19: Forgot Indexes oopsie
  • 0.1.18: Added Attribute type to exports (union of all types)
  • 0.1.17: Fixed package in general, removed redundancies in appwrite-utils-cli as it now depends on this package
0.2.2

3 days ago

0.1.27

3 days ago

0.1.28

3 days ago

0.1.29

3 days ago

0.1.20

4 days ago

0.1.21

3 days ago

0.1.22

3 days ago

0.1.23

3 days ago

0.1.24

3 days ago

0.1.25

3 days ago

0.1.26

3 days ago

0.1.17

4 days ago

0.1.18

4 days ago

0.1.19

4 days ago

0.2.1

3 days ago

0.2.0

3 days ago

0.1.224

3 days ago

0.1.223

3 days ago

0.1.225

3 days ago

0.1.222

3 days ago

0.1.221

3 days ago

0.1.16

13 days ago

0.1.15

19 days ago

0.1.11

26 days ago

0.1.12

26 days ago

0.1.13

25 days ago

0.1.14

25 days ago

0.1.1

26 days ago

0.9.9897

27 days ago

0.9.9899

27 days ago

0.1.0

26 days ago

0.9.9991

27 days ago

0.9.9990

27 days ago

0.9.9993

26 days ago

0.9.9992

26 days ago

0.9.9-9.0

26 days ago

0.9.9890

27 days ago

0.9.9892

27 days ago

0.9.9891

27 days ago

0.9.9894

27 days ago

0.9.9893

27 days ago

0.9.9896

27 days ago

0.9.9895

27 days ago

0.9.9881

28 days ago

0.9.9883

28 days ago

0.9.9882

28 days ago

0.9.9885

27 days ago

0.9.9884

27 days ago

0.9.9887

27 days ago

0.9.9886

27 days ago

0.9.9889

27 days ago

0.9.9888

27 days ago

0.9.9879

28 days ago

0.9.9880

28 days ago

0.9.986

28 days ago

0.9.987

28 days ago

0.9.985

28 days ago

0.9.9861

28 days ago

0.9.9863

28 days ago

0.9.9862

28 days ago

0.9.9865

28 days ago

0.9.9864

28 days ago

0.9.9866

28 days ago

0.9.9869

28 days ago

0.9.9868

28 days ago

0.9.9872

28 days ago

0.9.9871

28 days ago

0.9.9874

28 days ago

0.9.9873

28 days ago

0.9.9876

28 days ago

0.9.9875

28 days ago

0.9.9878

28 days ago

0.9.9877

28 days ago

0.9.984

29 days ago

0.9.96

29 days ago

0.9.97

29 days ago

0.9.98

29 days ago

0.9.964

29 days ago

0.9.92

1 month ago

0.9.93

30 days ago

0.9.94

29 days ago

0.9.95

29 days ago

0.9.982

29 days ago

0.9.983

29 days ago

0.9.90

1 month ago

0.9.91

1 month ago

0.9.981

29 days ago

0.9.96420

29 days ago

0.9.96421

29 days ago

0.9.89

1 month ago

0.9.85

1 month ago

0.9.86

1 month ago

0.9.87

1 month ago

0.9.88

1 month ago

0.9.81

1 month ago

0.9.82

1 month ago

0.9.83

1 month ago

0.9.84

1 month ago

0.9.8

1 month ago

0.9.7

1 month ago

0.9.69422

1 month ago

0.9.69421

1 month ago

0.9.69

1 month ago

0.9.4

1 month ago

0.9.3

1 month ago

0.9.6

1 month ago

0.9.5

1 month ago

0.9.6942

1 month ago

0.9.2

1 month ago

0.9.1

1 month ago

0.9.0

1 month ago