1.0.87 • Published 3 years ago

flamestore v1.0.87

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

flamestore

Firebase Utility Wrapper & File Generators

Getting Started

npx flamestore

Flamestore JSON Schema

  • $schema : Json schema for flamestore.json. Set it to https://raw.githubusercontent.com/aabccd021/flamestore/master/flamestore-schema/v1.json
  • flutterOutputPath : Relative path where flutter file generated
  • region : Firebase region code
  • project : Firebase project configuration. You can set multiple projects in key-value pairs with project ID as key.
  • collections: Firestore collections definitions in key-value pairs with collection name as key.

Collection

  • rule:{get|list|create|update|delete}`: Granular update rules for the collection. Avaliable options:
    • all: Allow any requests
    • authenticated: Allow authenticated user
    • owner: Allow owner of the document
    • none: Disallow any requests
  • ownerField: Name of field defines owner
  • fields: Fields definition as key-value pair with field name as key.

Field Properties

  • property: Field can have properties, which can be assigned as string or array. Available options:
    • isUnique: Field value is unique across documents in the same collections
    • isOptional: The field is optional
    • isNotUpdatable: The field is not updatable

Field Types

Path Field path

Firestore Document Reference (Path) Field

  • collection: Name of referenced document's collection
  • syncFields: Array or name of field synced from reference document

Example:

{
  "owner": {
    "type": "path",
    "collection": "users",
    "syncField": "userName"
  }
}

String Field string

  • minLength: Minimum length of the string
  • maxLength: Maximum length of the string

Example:

{
  "tweetText": {
    "type": "string",
    "minLength": 1,
    "maxLength": 280
  }
}

Integer Field int

  • min: Minimum value of the integer
  • max: Maximum length of the integer
  • deleteDocWhen: The document will be deleted if the integer equals to this value

Example:

{
  "likeValue": {
    "type": "int",
    "max": 5,
    "min": 0,
    "deleteDocWhen": 0
  }
}

Float Field float

  • min: Minimum value of the integer
  • max: Maximum length of the integer
  • deleteDocWhen: The document will be deleted if the integer equals to this value

Example:

{
  "likeValue": {
    "type": "float",
    "max": 5,
    "min": 0,
    "deleteDocWhen": 0
  }
}

Image Field image

  • metadata: Array of values of image metadata name
    • height: Height of image
    • width: Width of image
    • size: Size of image in bytes

Example:

{
  "image": {
    "type": "image",
    "metadata": [
      "height",
      "width"
    ]
  }
}

Dynamic Link Field dynamicLink

  • title: String of field used as dynamic link data
    • field: Use value of the field as dynamic link data
  • description: String of field used as dynamic link data
    • field: Use value of the field as dynamic link data
  • imageURL: String of field used as dynamic link data
    • field: Use value of the field as dynamic link data
  • isSuffixShort: Use short suffix for dynamic Link

Example:

{
  "dynamicLink": {
    "type": "dynamicLink",
    "isSuffixShort": true,
    "title": {
      "field": "tweetText"
    },
    "description": "tweet description"
  }
}

Count Field count

Count certain field in documents with same reference.

  • collection: Name of document's collection to be counted
  • reference: Name of reference field which points to counting document

Example:

{
  "tweetsCount": {
    "type": "count",
    "collection": "tweets",
    "reference": "owner"
  }
}

Sum Field sum

Sums certain field in documents with same reference.

  • collection: Name of document's collection to be summed
  • reference: Name of reference field which points to summing document
  • field: Name of field to be summed

Example:

{
  "likesSum": {
    "type": "sum",
    "collection": "likes",
    "field": "likeValue",
    "reference": "tweet"
  }
}

Computed Field compute

Computes field using custom function on firebase trigger.

  • compute: Type of field to be computed. Available options are int , float , string , timestamp .

Example:

{
  "hotness": {
    "compute": "float"
  },
}

Server Timestamp Field serverTimestamp

Records time when document created

Example:

{
  "creationTime": "serverTimestamp",
}
1.0.87

3 years ago

1.0.86

3 years ago

1.0.80

3 years ago

1.0.82

3 years ago

1.0.76

3 years ago

1.0.75

3 years ago

1.0.74

3 years ago

1.0.66

3 years ago

1.0.69

3 years ago

1.0.68

3 years ago

1.0.67

3 years ago

1.0.73

3 years ago

1.0.72

3 years ago

1.0.71

3 years ago

1.0.70

3 years ago

1.0.65

3 years ago

1.0.64

3 years ago

1.0.63

4 years ago

1.0.62

4 years ago

1.0.61

4 years ago

1.0.60

4 years ago

1.0.59

4 years ago

1.0.58

4 years ago

1.0.57

4 years ago

1.0.56

4 years ago

1.0.55

4 years ago

1.0.54

4 years ago

1.0.53

4 years ago

1.0.52

4 years ago

1.0.51

4 years ago

1.0.49

4 years ago

1.0.50

4 years ago

1.0.48

4 years ago

1.0.47

4 years ago

1.0.46

4 years ago

1.0.44

4 years ago

1.0.45

4 years ago

1.0.43

4 years ago

1.0.42

4 years ago

1.0.41

4 years ago

1.0.40

4 years ago

1.0.39

4 years ago

1.0.38

4 years ago

1.0.37

4 years ago

1.0.36

4 years ago

1.0.35

4 years ago

1.0.33

4 years ago

1.0.34

4 years ago

1.0.32

4 years ago

1.0.30

4 years ago

1.0.29

4 years ago

1.0.28

4 years ago

1.0.26

4 years ago

1.0.25

4 years ago

1.0.24

4 years ago

1.0.22

4 years ago

1.0.23

4 years ago

1.0.21

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.20

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago