1.7.0 • Published 22 days ago

fetch-appwrite-types v1.7.0

Weekly downloads
-
License
MIT
Repository
github
Last release
22 days ago

fetch-appwrite-types banner

Generate Typesript types from Appwrite Databases

npm npm

Quick usage

Make sure ton add the following values to your .env : APPWRITE_ENDPOINT APPWRITE_PROJECT_ID APPWRITE_API_KEY

Then run the following command :

npx fetch-appwrite-types

Installation

# yarn
yarn add fetch-appwrite-types

# npm
npm install fetch-appwrite-types

Make sure ton add the following values to your .env : APPWRITE_ENDPOINT APPWRITE_PROJECT_ID APPWRITE_API_KEY

import { FetchNewTypes } from "fetch-appwrite-types/dist/main";

await FetchNewTypes();

Parameters

NameDefault valueDescription
outDir"/types"The folder where the type file will be generated
outFileName"appwrite"The name of the generated type file
includeDBNamefalseAdd the collection name at start of types
hardTypesfalseCreates an Email type and an URL types. More.

Usage

CLI

Params can be passed as arguments in any order, except for the outDir which might be followed by the path.

npx fetch-appwrite-types includeDBName outDir /types outFileName appwrite hardTypes

Library

await FetchNewTypes({
    outDir: "/types",
    outFileName: "appwrite",
    includeDBName: true,
    hardTypes: true
})

Handled types

Appwrite typeGenerated type (simple)Generated type (hard)
Stringstringstring
Integerintegerinteger
Floatintegerinteger
Booleanbooleanboolean
DateTimestringDate
EmailstringEmail
IPstringstring
URLstringURL
EnumEnumEnum
RelationshipReference to TypeReference to Type

Hard types

The hard types are types that are not native to typescript, but are often used in the context of a web application. They are generated as classes with methods to validate and parse the data.

NameValue
Email${string}@${string}.${string}
URL${string}://${string}.${string}
1.7.0

22 days ago

1.6.4

2 months ago

1.6.3

2 months ago

1.6.2

2 months ago

1.6.1

2 months ago

1.6.0

2 months ago

1.5.0

2 months ago

1.4.0

2 months ago

1.3.1

2 months ago

1.3.0

2 months ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.1.16

1 year ago

0.1.15

1 year ago

0.1.14

1 year ago

0.1.13

1 year ago

0.1.12

1 year ago

0.1.11

1 year ago

0.1.10

1 year ago

0.1.9

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago