Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
appwrite-utils
Advanced tools
`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 integrati
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.
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
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;
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;
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.
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.
evalSync
to run commands pre-build. That means you can deploy a TypeScript Node
project, and build it first, programmatically! These are just types, and only defined in AppwriteUtils
to try to keep some semblence of usefulness in both. I also added FunctionSpecifications
type defs, FunctionScopes
, AppwriteRequest
(A type definition for the request incoming to the Appwrite Function), AppwriteResponse
(A type definition for the response of course).I also fixed transfer
to actually transfer
string[]
var called ignore
-- to ignore filesSpecificationSchema, type Specification
type defs to support updating function specificationssafeParseDate
to handle formats like 8:00AM
vs 8:00 AM
-- spaces matter!getFilePreviewUrl
-- it was missing the &
if you didn't use a JWTgetFilePreviewUrl
which allows you to modify image files, or just get a preview of a file, without downloading it (creates a URL instead of an ArrayBuffer
)parsePermissions
which maps my permissions (target
, permission
to the Appwrite strings) -- also added PermissionToAppwritePermission
which converts one of mine (target, permission) to Appwriteulid
to replace with ulidx
for compatibilityappwrite
versionflattenArray
which flattens an array, so if you accidentally convert things into "someValue": [ ['1' ], '2', ]
you can now make that just ['1', '2',]
onlyUnsetToArray
converter, which is meant to be used last so if you need to guarantee something is an array instead of null or undefined, you would use thatvalueToSet
to attributeMappings, allowing you to set the thing you want to set literally in importDefslodash
tryAwaitWithRetry
which will retry the given (used for Appwrite calls mostly) function up to 5 times if the error includes fetch failed
or server error
(all lowercased) because there's a weird bug sometimes with the server SDKtargetFieldToMatch
to the idMappings
configuration which should allow more concise mapping of after-import fields@asteasolutions/zod-to-openapi
) with the AuthUserSchemaID.unique()
to ulid()
for random ID generation, refactored schema.ts
into multiple filesFAQs
`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 integrati
The npm package appwrite-utils receives a total of 371 weekly downloads. As such, appwrite-utils popularity was classified as not popular.
We found that appwrite-utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.