<input id="id" type="text" autocomplete="off" placeholder="" data-ls-bind="{{project-bucket.$id}}" disabled data-forms-copy class="margin-bottom-no" />

data-analytics-label="View as JSON (Bucket)">

<?php

$logs = $this->getParam('logs', null);

?>

             Database

        <button type="button" class="close pull-end" data-ui-modal-close=""></button>

JSON View

            <input type="hidden" data-ls-bind="{{project-collection}}" data-forms-code />

        <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

Documents

                <div
                    data-service="database.listDocuments"
                    data-event="load,database.createDocument,database.updateDocument,database.deleteDocument"
                    data-param-collection-id="{{router.params.id}}"
                    data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
                    data-param-order-types="DESC"
                    data-param-order-types-cast-to="array"
                    data-scope="sdk"
                    data-name="project-documents"
                    x-data="{ project: new URLSearchParams(location.search).get('project') }">

No Documents Found

Add your first document to get started

<span data-ls-if="{{project-documents.total}} == <?php echo APP_LIMIT_COUNT; ?>">+ documents found

                                        $id
                                        <template x-for="attr in attributes">

                                                []

                                        </template>

                                    <template x-for="doc in documents">

                                                <a :href="`/console/database/document?id=${doc.$id}&collection=${doc.$collection}&project=${project}`" x-text="doc.$id">

                                            <template x-for="attr in attributes">

                                                    <a :href="`/console/database/document?id=${doc.$id}&collection=${doc.$collection}&project=${project}`">

                                            </template>

                                    </template>

                        <form
                            data-service="database.listDocuments"
                            data-event="submit"
                            data-param-collection-id="{{router.params.id}}"
                            data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
                            data-param-order-types="DESC"
                            data-param-order-types-cast-to="array"
                            data-scope="sdk"
                            data-name="project-documents"
                            data-success="state"
                            data-success-param-state-keys="search,offset">
                            <button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-total="{{project-documents.total}}" class="margin-end round small" aria-label="Back"></button>
                        </form>

                        <form
                            data-service="database.listDocuments"
                            data-event="submit"
                            data-param-collection-id="{{router.params.id}}"
                            data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
                            data-param-order-types="DESC"
                            data-param-order-types-cast-to="array"
                            data-scope="sdk"
                            data-name="project-documents"
                            data-success="state"
                            data-success-param-state-keys="search,offset">
                            <button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-total="{{project-documents.total}}" class="margin-start round small" aria-label="Next"></button>
                        </form>

                    <a data-ls-if="0 < {{project-collection.attributes.length}}" data-ls-attrs="href=/console/database/document/new?collection={{router.params.id}}&project={{router.params.project}}" class="button">
                        Add Document

                        Create Attribute

Attributes

No Attributes Found

Add your first attribute to get started

                    <table class="vertical" data-ls-if="0 < {{project-collection.attributes.length}}">

                                Attribute ID
                                Type

                                    available
                                    processing
                                    failed
                                    deleting
                                    stuck

                                    required

                                        <button type="button" class="close pull-end" data-ui-modal-close=""></button>

                                            <form>

                                                    Key

                                                        <input type="text" data-ls-bind="{{attribute.key}}" data-forms-copy disabled />

                                                    Type
                                                    <input type="text" data-ls-bind="{{attribute.type}}" disabled />

                                                        Format
                                                        <input type="text" data-ls-bind="{{attribute.format}}" class="full-width" disabled />

                                                            Required
                                                            <input type="text" data-ls-bind="{{attribute.required}}" disabled />

                                                            Array
                                                            <input type="text" data-ls-bind="{{attribute.array}}" disabled />

                                                        Default Value
                                                        <input type="text" data-ls-bind="{{attribute.default}}" class="full-width" disabled />

                                                        Length
                                                        <input type="text" data-ls-bind="{{attribute.size}}" class="full-width" disabled />

                                                        Elements

                                                            <input type="text" data-ls-bind="{{element}}" class="full-width" disabled />

                                                            Min
                                                            <input type="text" name="min" data-ls-bind="{{attribute.min}}" class="full-width" disabled />

                                                            Max
                                                            <input type="text" name="max" data-ls-bind="{{attribute.max}}" class="full-width" disabled />

                                            </form>

                                            <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>
                                            <form
                                                data-ls-if="{{attribute.status}} !== 'deleting'"
                                                class="pull-end"
                                                data-analytics
                                                data-analytics-activity
                                                data-analytics-event="submit"
                                                data-analytics-category="console"
                                                data-analytics-label="Delete Collection Attribute"
                                                data-service="database.deleteAttribute"
                                                data-scope="sdk"
                                                data-event="submit"
                                                data-confirm="Are you sure you want to delete this attribute?"
                                                data-success="alert,trigger"
                                                data-success-param-alert-text="Deleted attribute successfully"
                                                data-success-param-trigger-events="database.deleteAttribute"
                                                data-failure="alert"
                                                data-failure-param-alert-text="Failed to delete attribute"
                                                data-failure-param-alert-classname="error">

                                                <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
                                                <input type="hidden" name="collectionId" data-ls-bind="{{project-collection.$id}}" />
                                                <input type="hidden" name="key" data-ls-bind="{{attribute.key}}" />

                                                <button class="danger">Delete</button>
                                            </form>

 New String Attribute

 New Integer Attribute

 New Float Attribute

 New Boolean Attribute

 New URL Attribute

 New Email Attribute

 New IP Attribute

 New Enum Attribute

Indexes

No Indexes Found

Add your first index to get started

                    <table class="vertical multi-line" data-ls-if="0 < {{project-collection.indexes.length}}">

                                Index Key
                                Type
                                Attributes

                                    available
                                    processing
                                    failed
                                    deleting
                                    stuck

                                    []

                                    required

                                    <form
                                        data-ls-if="{{index.status}} !== 'deleting'"
                                        class="pull-end"
                                        data-analytics
                                        data-analytics-activity
                                        data-analytics-event="submit"
                                        data-analytics-category="console"
                                        data-analytics-label="Delete Collection Index"
                                        data-service="database.deleteIndex"
                                        data-scope="sdk"
                                        data-event="submit"
                                        data-confirm="Are you sure you want to delete this index?"
                                        data-success="alert,trigger"
                                        data-success-param-alert-text="Deleted index successfully"
                                        data-success-param-trigger-events="database.deleteIndex"
                                        data-failure="alert"
                                        data-failure-param-alert-text="Failed to delete index"
                                        data-failure-param-alert-classname="error">

                                        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
                                        <input type="hidden" name="collectionId" data-ls-bind="{{project-collection.$id}}" />
                                        <input type="hidden" name="key" data-ls-bind="{{index.key}}" />

                                        <button class="danger small">Delete</button>
                                    </form>

                <button class="new-index">Add Index</button>

Activity

                <?php echo $logs->render(); ?>

                <form
                    class="pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} !== '90d'"
                    data-service="database.getCollectionUsage"
                    data-event="submit"
                    data-name="usage"
                    data-param-collection-id="{{router.params.id}}"
                    data-param-range="90d">
                    <button class="tick">90d</button>
                </form>

                <button class="tick pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} === '90d'" disabled>90d</button>

                <form
                    class="pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} !== '30d'"
                    data-service="database.getCollectionUsage"
                    data-event="submit"
                    data-name="usage"
                    data-param-collection-id="{{router.params.id}}">
                    <button class="tick">30d</button>
                </form>

                <button class="tick pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} === '30d'" disabled>30d</button>

                <form
                    class="pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} !== '24h'"
                    data-service="database.getCollectionUsage"
                    data-event="submit"
                    data-name="usage"
                    data-param-collection-id="{{router.params.id}}"
                    data-param-range="24h">
                    <button class="tick">24h</button>
                </form>

                <button class="tick pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} === '24h'" disabled>24h</button>

Usage

Documents

Count of documents over time

                                <input type="hidden" data-ls-bind="{{usage}}" data-forms-chart="Documents=documentsCount" data-show-y-axis="true" data-height="140" />

Documents

Operations

Count of documents create, read, update and delete operations over time

                                <input
                                    type="hidden"
                                    data-ls-bind="{{usage}}"
                                    data-forms-chart="Created=documentsCreate,Read=documentsRead,Updated=documentsUpdate,Deleted=documentsDelete"
                                    data-show-y-axis="true"
                                    data-colors="create,read,update,delete"
                                    data-height="140" />

Created

Read

Updated

Deleted

Settings

                        <form
                            data-analytics
                            data-analytics-activity
                            data-analytics-event="submit"
                            data-analytics-category="console"
                            data-analytics-label="Update Database Collection"
                            data-service="database.updateCollection"
                            data-scope="sdk"
                            data-event="submit"
                            data-param-collection-id="{{router.params.id}}"
                            data-success="alert,trigger"
                            data-success-param-alert-text="Updated collection successfully"
                            data-success-param-trigger-events="database.updateCollection"
                            data-failure="alert"
                            data-failure-param-alert-text="Failed to update collection"
                            data-failure-param-alert-classname="error">

                                Name
                                <input name="name" id="collection-name" type="text" autocomplete="off" data-ls-bind="{{project-collection.name}}" data-forms-text-direction required placeholder="Collection Name" maxlength="128" />

                                    <input name="enabled" type="hidden" data-forms-switch data-cast-to="boolean" data-ls-bind="{{project-collection.enabled}}" />   Enabled

                                Permissions

Choose the permissions model for this collection.

<input name="permission" value="collection" type="radio" class="margin-top-tiny" data-ls-bind="{{project-collection.permission}}" />

                                        Collection Level

With Collection Level permissions, you assign permissions only once in the collection.

In this permission level, permissions assigned to collection takes the precedence and documents permissions are ignored.

                                            Read Access (Learn more)
                                            <input type="hidden" id="collection-read" name="read" data-forms-tags data-cast-to="json" data-ls-bind="{{project-collection.$read}}" placeholder="User ID, Team ID or Role" />

Add 'role:all' for wildcard access

                                            Write Access (Learn more)
                                            <input type="hidden" id="collection-write" name="write" data-forms-tags data-cast-to="json" data-ls-bind="{{project-collection.$write}}" placeholder="User ID, Team ID or Role" />

Add 'role:all' for wildcard access

<input name="permission" value="document" type="radio" class="margin-top-no" data-ls-bind="{{project-collection.permission}}" />

                                        Document Level

With Document Level permissions, you have granular access control over every document. Users will only be able to access documents for which they have explicit permissions.

In this permission level, document permissions take precedence and collection permissions are ignored.

                                <button>Update</button>
                        </form>

                    Collection ID

                        <input id="id" type="text" autocomplete="off" placeholder="" data-ls-bind="{{project-collection.$id}}" disabled data-forms-copy class="margin-bottom-no" />

 <button data-ls-ui-trigger="open-json" class="link text-size-small">View as JSON</button>

 Last Updated:

 Created:

                        <form
                            name="database.deleteCollection" class="margin-bottom"
                            data-analytics
                            data-analytics-activity
                            data-analytics-event="submit"
                            data-analytics-category="console"
                            data-analytics-label="Delete Database Collection"
                            data-service="database.deleteCollection"
                            data-event="submit"
                            data-param-collection-id="{{router.params.id}}"
                            data-confirm="Are you sure you want to delete this collection?"
                            data-success="alert,trigger,redirect"
                            data-success-param-alert-text="Collection deleted successfully"
                            data-success-param-trigger-events="database.deleteCollection"
                            data-success-param-redirect-url="/console/database?project={{router.params.project}}"
                            data-failure="alert"
                            data-failure-param-alert-text="Failed to delete collection"
                            data-failure-param-alert-classname="error">

                        <button type="submit" class="danger fill">Delete Collection</button>
                    </form>

    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Add String Attribute

    <form
        id="add-string-attribute"
        data-analytics
        data-analytics-activity
        data-analytics-event="submit"
        data-analytics-category="console"
        data-analytics-label="Create Collection Attribute (string)"
        data-service="database.createStringAttribute"
        data-scope="sdk"
        data-event="submit"
        data-success="alert,trigger,reset"
        data-success-param-alert-text="Created new attribute successfully"
        data-success-param-trigger-events="database.createAttribute"
        data-failure="alert"
        data-failure-param-alert-text="Failed to create attribute"
        data-failure-param-alert-classname="error"
        @reset="array = required = false"
        x-data="{ array: false, required: false, size: null }">

        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
        <input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />

        Attribute ID
        <input id="string-key" type="text" class="full-width" name="key" required autocomplete="off" maxlength="36" pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,35}$" />

Allowed Characters A-Z, a-z, 0-9, and non-leading underscore, hyphen and dot

        Size
        <input id="string-length" name="size" type="number" class="margin-bottom" autocomplete="off" required value="255" data-cast-to="integer" x-model="size" />

            <input x-model="required" name="required" class="button switch" type="checkbox" />   Required

            <input x-model="array" name="array" class="button switch" type="checkbox" />   Array

        Default Value
        <template x-if="!(array || required)">
            <input name="xdefault" type="text" class="margin-bottom-large" autocomplete="off" :maxlength="size">
        </template>
        <template x-if="(array || required)">
            <input name="xdefault" type="text" class="margin-bottom-large" autocomplete="off" disabled value="">
        </template>

            <button type="submit">Create</button>   <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    </form>

    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Add Integer Attribute

    <form
        id="add-integer-attribute"
        data-analytics
        data-analytics-activity
        data-analytics-event="submit"
        data-analytics-category="console"
        data-analytics-label="Create Collection Attribute (integer)"
        data-service="database.createIntegerAttribute"
        data-scope="sdk"
        data-event="submit"
        data-success="alert,trigger,reset"
        data-success-param-alert-text="Created new attribute successfully"
        data-success-param-trigger-events="database.createAttribute"
        data-failure="alert"
        data-failure-param-alert-text="Failed to create attribute"
        data-failure-param-alert-classname="error"
        @reset="array = required = false"
        x-data="{ array: false, required: false, min: null, max: null }">

        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
        <input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />

        Attribute ID
        <input id="integer-key" type="text" class="full-width" name="key" required autocomplete="off" maxlength="36" pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,35}$" />

Allowed Characters A-Z, a-z, 0-9, and non-leading underscore, hyphen and dot

            <input x-model="required" name="required" class="button switch" type="checkbox" />   Required

            <input x-model="array" name="array" class="button switch" type="checkbox" />   Array

                Min
                <input id="integer-min" type="number" step="1" class="full-width" name="min" autocomplete="off" data-cast-to="integer" x-model="min" />

                Max
                <input id="integer-max" type="number" step="1" class="full-width" name="max" autocomplete="off" data-cast-to="integer" x-model="max" />

        Default Value

        <template x-if="!(array || required)">
            <input name="xdefault" type="number" class="margin-bottom-large" autocomplete="off" data-cast-to="integer" :min="min" :max="max">
        </template>
        <template x-if="(array || required)">
            <input name="xdefault" type="number" class="margin-bottom-large" autocomplete="off" data-cast-to="integer" disabled>
        </template>

            <button type="submit">Create</button>   <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    </form>

    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Add Float Attribute

    <form
        id="add-float-attribute"
        data-analytics
        data-analytics-activity
        data-analytics-event="submit"
        data-analytics-category="console"
        data-analytics-label="Create Collection Attribute (float)"
        data-service="database.createFloatAttribute"
        data-scope="sdk"
        data-event="submit"
        data-success="alert,trigger,reset"
        data-success-param-alert-text="Created new attribute successfully"
        data-success-param-trigger-events="database.createAttribute"
        data-failure="alert"
        data-failure-param-alert-text="Failed to create attribute"
        data-failure-param-alert-classname="error"
        @reset="array = required = false"
        x-data="{ array: false, required: false, min: null, max: null }">

        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
        <input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />

        Attribute ID
        <input id="float-key" type="text" class="full-width" name="key" required autocomplete="off" maxlength="36" pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,35}$" />

Allowed Characters A-Z, a-z, 0-9, and non-leading underscore, hyphen and dot

            <input x-model="required" name="required" class="button switch" type="checkbox" />   Required

            <input x-model="array" name="array" class="button switch" type="checkbox" />   Array

                Min
                <input id="float-min" type="number" class="full-width" name="min" step="any" autocomplete="off" data-cast-to="float" x-model="min" />

                Max
                <input id="float-max" type="number" class="full-width" name="max" step="any" autocomplete="off" data-cast-to="float" x-model="max" />

        Default Value

        <template x-if="!(array || required)">
            <input name="xdefault" type="number" step="any" class="margin-bottom-large" autocomplete="off" data-cast-to="float" :min="min" :max="max">
        </template>
        <template x-if="(array || required)">
            <input name="xdefault" type="number" step="any" class="margin-bottom-large" autocomplete="off" data-cast-to="float" disabled>
        </template>

            <button type="submit">Create</button>   <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    </form>

    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Add Email Attribute

    <form
        id="add-email-attribute"
        data-analytics
        data-analytics-activity
        data-analytics-event="submit"
        data-analytics-category="console"
        data-analytics-label="Create Collection Attribute (email)"
        data-service="database.createEmailAttribute"
        data-scope="sdk"
        data-event="submit"
        data-success="alert,trigger,reset"
        data-success-param-alert-text="Created new attribute successfully"
        data-success-param-trigger-events="database.createAttribute"
        data-failure="alert"
        data-failure-param-alert-text="Failed to create attribute"
        data-failure-param-alert-classname="error"
        @reset="array = required = false"
        x-data="{ array: false, required: false }">

        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
        <input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />

        Attribute ID
        <input id="email-key" type="text" class="full-width" name="key" required autocomplete="off" maxlength="128" maxlength="36" pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,35}$" />

Allowed Characters A-Z, a-z, 0-9, and non-leading underscore, hyphen and dot

            <input x-model="required" name="required" class="button switch" type="checkbox" />   Required

            <input x-model="array" name="array" class="button switch" type="checkbox" />   Array

        Default Value
        <template x-if="!(array || required)">
            <input name="xdefault" type="email" class="margin-bottom-large" autocomplete="off">
        </template>
        <template x-if="(array || required)">
            <input name="xdefault" type="email" class="margin-bottom-large" autocomplete="off" disabled value="">
        </template>

            <button type="submit">Create</button>   <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    </form>

    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Add Boolean Attribute

    <form
        id="add-boolean-attribute"
        data-analytics
        data-analytics-activity
        data-analytics-event="submit"
        data-analytics-category="console"
        data-analytics-label="Create Collection Attribute (boolean)"
        data-service="database.createBooleanAttribute"
        data-scope="sdk"
        data-event="submit"
        data-success="alert,trigger,reset"
        data-success-param-alert-text="Created new attribute successfully"
        data-success-param-trigger-events="database.createAttribute"
        data-failure="alert"
        data-failure-param-alert-text="Failed to create attribute"
        data-failure-param-alert-classname="error"
        @reset="array = required = false"
        x-data="{ array: false, required: false }">

        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
        <input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />

        Attribute ID
        <input id="boolean-key" type="text" class="full-width" name="key" required autocomplete="off" maxlength="36" pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,35}$" />

Allowed Characters A-Z, a-z, 0-9, and non-leading underscore, hyphen and dot

            <input x-model="required" name="required" class="button switch" type="checkbox" />   Required

            <input x-model="array" name="array" class="button switch" type="checkbox" />   Array

            <template x-if="!(array || required)">
                <input name="xdefault" class="button switch" type="checkbox" />
            </template>
            <template x-if="(array || required)">
                <input name="" class="button switch" type="checkbox" disabled />
            </template>
              Default Value

            <button type="submit">Create</button>   <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    </form>

    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Add IP Attribute

    <form
        id="add-ip-attribute"
        data-analytics
        data-analytics-activity
        data-analytics-event="submit"
        data-analytics-category="console"
        data-analytics-label="Create Collection Attribute (IP)"
        data-service="database.createIpAttribute"
        data-scope="sdk"
        data-event="submit"
        data-success="alert,trigger,reset"
        data-success-param-alert-text="Created new attribute successfully"
        data-success-param-trigger-events="database.createAttribute"
        data-failure="alert"
        data-failure-param-alert-text="Failed to create attribute"
        data-failure-param-alert-classname="error"
        @reset="array = required = false"
        x-data="{ array: false, required: false }">

        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
        <input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />

        Attribute ID
        <input id="ip-key" type="text" class="full-width" name="key" required autocomplete="off" maxlength="36" pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,35}$" />

Allowed Characters A-Z, a-z, 0-9, and non-leading underscore, hyphen and dot

            <input x-model="required" name="required" class="button switch" type="checkbox" />   Required

            <input x-model="array" name="array" class="button switch" type="checkbox" />   Array

        Default Value
        <template x-if="!(array || required)">
            <input name="xdefault" type="text" class="margin-bottom-large" autocomplete="off">
        </template>
        <template x-if="(array || required)">
            <input name="xdefault" type="text" class="margin-bottom-large" autocomplete="off" disabled value="">
        </template>

            <button type="submit">Create</button>   <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    </form>

    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Add URL Attribute

    <form
        id="add-url-attribute"
        data-analytics
        data-analytics-activity
        data-analytics-event="submit"
        data-analytics-category="console"
        data-analytics-label="Create Collection Attribute (url)"
        data-service="database.createUrlAttribute"
        data-scope="sdk"
        data-event="submit"
        data-success="alert,trigger,reset"
        data-success-param-alert-text="Created new attribute successfully"
        data-success-param-trigger-events="database.createAttribute"
        data-failure="alert"
        data-failure-param-alert-text="Failed to create attribute"
        data-failure-param-alert-classname="error"
        @reset="array = required = false"
        x-data="{ array: false, required: false }">

        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
        <input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />

        Attribute ID
        <input id="url-key" type="text" class="full-width" name="key" required autocomplete="off" maxlength="36" pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,35}$" />

Allowed Characters A-Z, a-z, 0-9, and non-leading underscore, hyphen and dot

            <input x-model="required" name="required" class="button switch" type="checkbox" />   Required

            <input x-model="array" name="array" class="button switch" type="checkbox" />   Array

        Default Value
        <template x-if="!(array || required)">
            <input name="xdefault" type="url" class="margin-bottom-large" autocomplete="off">
        </template>
        <template x-if="(array || required)">
            <input name="xdefault" type="url" class="margin-bottom-large" autocomplete="off" disabled value="">
        </template>

            <button type="submit">Create</button>   <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    </form>

    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Add Enum Attribute

    <form
        id="add-enum-attribute"
        data-analytics
        data-analytics-activity
        data-analytics-event="submit"
        data-analytics-category="console"
        data-analytics-label="Create Collection Attribute (enum)"
        data-service="database.createEnumAttribute"
        data-scope="sdk"
        data-event="submit"
        data-success="alert,trigger,reset"
        data-success-param-alert-text="Created new attribute successfully"
        data-success-param-trigger-events="database.createAttribute"
        data-failure="alert"
        data-failure-param-alert-text="Failed to create attribute"
        data-failure-param-alert-classname="error"
        @reset="array = required = false"
        x-data="{ array: false, required: false }">

        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
        <input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />

        Attribute ID
        <input id="enum-key" type="text" class="full-width" name="key" required autocomplete="off" maxlength="36" pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,35}$" />

Allowed Characters A-Z, a-z, 0-9, and non-leading underscore, hyphen and dot

        Elements

                        <input data-cast-to="array" type="text" class="full-width" name="elements" required autocomplete="off" maxlength="128" />

                        <button type="button" data-remove class="dark danger small round pull-end" style="margin-top: 10px;"></button>

            <input x-model="required" name="required" class="button switch" type="checkbox" />   Required

            <input x-model="array" name="array" class="button switch" type="checkbox" />   Array

        Default Value
        <template x-if="!(array || required)">
            <input name="xdefault" type="text" class="margin-bottom-large" autocomplete="off">
        </template>
        <template x-if="(array || required)">
            <input name="xdefault" type="text" class="margin-bottom-large" autocomplete="off" disabled value="">
        </template>

            <button type="submit">Create</button>   <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    </form>

    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Add Index

No Attributes Found

Please add your first attribute before adding your first index.

        <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    <form
        data-ls-if="0 < {{project-collection.attributes.length}}"
        data-analytics
        data-analytics-activity
        data-analytics-event="submit"
        data-analytics-category="console"
        data-analytics-label="Create Collection Index"
        data-service="database.createIndex"
        data-scope="sdk"
        data-event="submit"
        data-success="alert,trigger,reset"
        data-success-param-alert-text="Created new index successfully"
        data-success-param-trigger-events="database.createIndex"
        data-failure="alert"
        data-failure-param-alert-text="Failed to create index"
        data-failure-param-alert-classname="error">

        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
        <input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />

        Index Key
        <input id="index-key" type="text" class="full-width" name="key" required autocomplete="off" maxlength="36" pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,35}$" />

Allowed Characters A-Z, a-z, 0-9, and non-leading underscore, hyphen and dot

        Type
        <select id="index-type" name="type">
            <option value="key">Key</option>
            <option value="unique">Unique</option>
            <option value="fulltext">Fulltext</option>
        </select>

        Attributes

                        <select data-duplications data-ls-attrs="name=attributes" data-ls-loop="project-collection.attributes" data-ls-as="option" data-cast-to="array" class="margin-bottom-no">
                            <option data-ls-attrs="value={{option.key}}" data-ls-bind="{{option.key}}"></option>
                        </select>

                        <select name="orders" data-cast-to="array" class="margin-bottom-no">
                            <option value="ASC">ASC</option>
                            <option value="DESC">DESC</option>
                        </select>

                        <button type="button" data-remove class="dark danger small round pull-end" style="margin-top: 10px;"></button>

            <button type="submit">Create</button>   <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    </form>


<ul class="margin-bottom-large text-fade text-size-small">

<button data-ls-ui-trigger="open-json" class="link text-size-small">View as JSON</button>

keep keep keep keep keep replace keep keep keep keep keep

import Appwrite

func main() async throws {
    let client = Client()
      .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
      .setProject("5df5acd0d48c2") // Your project ID
      .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    let locale = Locale(client)
    let continentList = try await locale.getContinents()

    print(String(describing: continentList)
}


<?php

use Appwrite\Client;
use Appwrite\Services\Users;

$client = new Client();

$client
    ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
    ->setProject('5df5acd0d48c2') // Your project ID
    ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

$users = new Users($client);

$result = $users->deleteUser('[USER_ID]');


appwrite teams delete --teamId="[TEAM_ID]"


<input id="uid" type="text" autocomplete="off" placeholder="" data-ls-bind="{{team.$id}}" disabled data-forms-copy>

keep keep keep keep keep replace keep keep keep

data-analytics-label="View as JSON (Team)">

<?php
$fileLimit = $this->getParam('fileLimit', 0);
$fileLimitHuman = $this->getParam('fileLimitHuman', 0);
$events = $this->getParam('events', []);
$timeout = $this->getParam('timeout', 900);
$usageStatsEnabled = $this->getParam('usageStatsEnabled', true);
$patterns = [];

foreach ($events as $name => $event) {
    $patterns[] = $name;
    foreach ($event as $key => $value) {
        if (!\str_starts_with($key, '$')) {
            if (!($value['$resource'] ?? false)) {
                $patterns[] = "{$name}.{$key}";
            } else {
                $patterns[] = $key;
                foreach ($value as $key2 => $value2) {
                    if (!\str_starts_with($key2, '$')) {
                        if (!($value2['$resource'] ?? false)) {
                            $patterns[] = "{$key}.{$key2}";
                        }
                    }
                }
            }
        }
    }
}

sort($patterns);

?>

             Functions

        <button type="button" class="close pull-end" data-ui-modal-close=""></button>

JSON View

            <input type="hidden" data-ls-bind="{{project-function}}" data-forms-code />

        <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

Overview

                                    <button data-ls-ui-trigger="execute-now">Execute Now</button>   View Logs

                        <div class="margin-bottom"
                            data-service="functions.listDeployments"
                            data-scope="sdk"
                            data-event="load,functions.createDeployment,functions.deleteDeployment,functions.updateDeployment,functions.retryBuild"
                            data-name="project-function-deployments"
                            data-param-function-id="{{router.params.id}}"
                            data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
                            data-param-offset=""
                            data-param-order-type="DESC"
                            data-success="trigger"
                            data-success-param-trigger-events="functions.listDeployments">

Deployments

No Deployments Found

You haven't deployed any deployments for your function yet.

                                                <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Build Error Log

                                                    <input type="hidden" data-ls-bind="{{deployment.buildStderr}}" data-forms-code="bash" data-lang="bash" data-lang-label="Bash" />

                                                <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

                                                <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Build Log

                                                    <input type="hidden" data-ls-bind="{{deployment.buildStdout}}" data-forms-code="bash" data-lang="bash" data-lang-label="Bash" />

                                                <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

                                            <form data-ls-if="({{deployment.$id}} !== {{project-function.deployment}} && {{deployment.status}} == 'ready')" name="functions.updateDeployment" class="pull-end"
                                                data-analytics
                                                data-analytics-activity
                                                data-analytics-event="submit"
                                                data-analytics-category="console"
                                                data-analytics-label="Create Function Execution"
                                                data-service="functions.updateDeployment"
                                                data-event="submit"
                                                data-param-function-id="{{router.params.id}}"
                                                data-success="alert,trigger"
                                                data-success-param-alert-text="Deployment updated successfully"
                                                data-success-param-trigger-events="functions.updateDeployment"
                                                data-failure="alert"
                                                data-failure-param-alert-text="Failed to update deployment"
                                                data-failure-param-alert-classname="error">
                                                <input type="hidden" name="deploymentId" data-ls-bind="{{deployment.$id}}">
                                                <button>Activate</button>
                                            </form>
                                            <form data-ls-if="({{deployment.$id}} !== {{project-function.deployment}} && {{deployment.status}} == 'failed')" name="functions.retryBuild" class="pull-end"
                                                data-analytics
                                                data-analytics-activity
                                                data-analytics-event="submit"
                                                data-analytics-category="console"
                                                data-analytics-label="Retry Build"
                                                data-service="functions.retryBuild"
                                                data-event="submit"
                                                data-success="alert,trigger"
                                                data-success-param-alert-text="Build started successfully"
                                                data-success-param-trigger-events="functions.retryBuild"
                                                data-failure="alert"
                                                data-failure-param-alert-text="Failed to retry build"
                                                data-failure-param-alert-classname="error">
                                                <input type="hidden" name="buildId" data-ls-bind="{{deployment.buildId}}">
                                                <input type="hidden" name="functionId" data-ls-bind="{{router.params.id}}">
                                                <input type="hidden" name="deploymentId" data-ls-bind="{{deployment.$id}}">
                                                <button>Retry Build</button>
                                            </form>

                                                  |  <button type="button" class="link text-size-small" data-ls-ui-trigger="open-stderr-{{deployment.$id}}">Logs</button>
                                                  |  <button type="button" class="link text-size-small" data-ls-ui-trigger="open-stdout-{{deployment.$id}}">Logs</button>

                                                <form data-ls-if="{{deployment.$id}} !== {{project-function.deployment}}" name="functions.deleteDeployment" class="pull-start"
                                                    data-analytics
                                                    data-analytics-activity
                                                    data-analytics-event="submit"
                                                    data-analytics-category="console"
                                                    data-analytics-label="Delete Function Deployment"
                                                    data-service="functions.deleteDeployment"
                                                    data-event="submit"
                                                    data-param-function-id="{{router.params.id}}"
                                                    data-confirm="Are you sure you want to delete this function deployment?"
                                                    data-success="alert,trigger"
                                                    data-success-param-alert-text="Function deployment deleted successfully"
                                                    data-success-param-trigger-events="functions.deleteDeployment"
                                                    data-failure="alert"
                                                    data-failure-param-alert-text="Failed to delete function deployment"
                                                    data-failure-param-alert-classname="error">
                                                    <input type="hidden" name="deploymentId" data-ls-bind="{{deployment.$id}}" />

                                                      |  <button type="submit" class="link text-danger text-size-small">Delete</button>
                                                </form>

                            <button data-ls-ui-trigger="create-deployment">Create Deployment</button>

                            <form
                                data-service="functions.listDeployments"
                                data-event="submit"
                                data-param-function-id="{{router.params.id}}"
                                data-param-search="{{router.params.search}}"
                                data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
                                data-param-order-type="DESC"
                                data-scope="sdk"
                                data-name="project-function-deployments"
                                data-success="state"
                                data-success-param-state-keys="search,offset">
                                <button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-total="{{project-function-deployments.total}}" class="margin-end round small" aria-label="Back"></button>
                            </form>

                            <form
                                data-service="functions.listDeployments"
                                data-event="submit"
                                data-param-function-id="{{router.params.id}}"
                                data-param-search="{{router.params.search}}"
                                data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
                                data-param-order-type="DESC"
                                data-scope="sdk"
                                data-name="project-function-deployments"
                                data-success="state"
                                data-success-param-state-keys="search,offset">
                                <button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-total="{{project-function-deployments.total}}" class="margin-start round small" aria-label="Next"></button>
                            </form>

                        Function ID

                            <input id="uid" type="text" autocomplete="off" placeholder="" data-ls-bind="{{project-function.$id}}" disabled data-forms-copy>

 <button data-ls-ui-trigger="open-json" class="link text-size-small">View as JSON</button>

 Last Updated:

 Created:

                        <form name="functions.delete" class="margin-bottom"
                            data-analytics
                            data-analytics-activity
                            data-analytics-event="submit"
                            data-analytics-category="console"
                            data-analytics-label="Delete Function"
                            data-service="functions.delete"
                            data-event="submit"
                            data-param-function-id="{{router.params.id}}"
                            data-confirm="Are you sure you want to delete this function?"
                            data-success="alert,trigger,redirect"
                            data-success-param-alert-text="Function deleted successfully"
                            data-success-param-trigger-events="functions.delete"
                            data-success-param-redirect-url="/console/functions?project={{router.params.project}}"
                            data-failure="alert"
                            data-failure-param-alert-text="Failed to delete function"
                            data-failure-param-alert-classname="error">

                            <button type="submit" class="danger fill">Delete Function</button>
                        </form>

            <?php if ($usageStatsEnabled): ?>

                <form class="pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} !== '90d'"
                    data-service="functions.getUsage"
                    data-event="submit"
                    data-name="usage"
                    data-param-function-id="{{router.params.id}}"
                    data-param-range="90d">
                    <button class="tick">90d</button>
                </form>

                <button class="tick pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} === '90d'" disabled>90d</button>

                <form class="pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} !== '30d'"
                    data-service="functions.getUsage"
                    data-event="submit"
                    data-name="usage"
                    data-param-function-id="{{router.params.id}}">
                    <button class="tick">30d</button>
                </form>

                <button class="tick pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} === '30d'" disabled>30d</button>

                <form class="pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} !== '24h'"
                    data-service="functions.getUsage"
                    data-event="submit"
                    data-name="usage"
                    data-param-function-id="{{router.params.id}}"
                    data-param-range="24h">
                    <button class="tick">24h</button>
                </form>

                <button class="tick pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} === '24h'" disabled>24h</button>

Monitors

                                <input type="hidden" data-ls-bind="{{usage}}" data-forms-chart="Executions=functionsExecutions" data-height="140" data-show-y-axis="true" />

Executions

                                <input type="hidden" data-ls-bind="{{usage}}" data-forms-chart="CPU Time (milliseconds)=functionsCompute" data-colors="orange" data-height="140" data-show-y-axis="true" />

CPU Time

                                <input type="hidden" data-ls-bind="{{usage}}" data-forms-chart="Failures=functionsFailures" data-colors="red" data-height="140" data-show-y-axis="true" />

Errors

            <?php endif;?>

Logs

                <div
                    data-service="functions.listExecutions"
                    data-scope="sdk"
                    data-event="load,functions.createExecution"
                    data-name="project-function-executions"
                    data-param-function-id="{{router.params.id}}"
                    data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
                    data-param-offset=""
                    data-param-order-type="DESC"
                    data-success="trigger"
                    data-success-param-trigger-events="functions.listExecutions">

                    <div data-ls-if="0 < {{project-function-executions.executions.length}} && undefined !== {{project-function-executions.executions}}">

                                        Created
                                        Status
                                        Trigger
                                        Runtime

                                            <span class="text-fade text-size-small" data-ls-if="{{execution.statusCode}} < 200 && {{execution.statusCode}} >= 300" data-ls-bind=" exit code: {{execution.statusCode}}">

                                            -

                                                <button class="desktops-only pull-end link margin-start text-danger" data-ls-ui-trigger="execution-stderr-{{execution.$id}}">Errors</button>
                                                <button class="desktops-only pull-end link margin-start" data-ls-ui-trigger="execution-stdout-{{execution.$id}}">Output</button>

                                                <button class="phones-only-inline tablets-only-inline link margin-end-small" data-ls-ui-trigger="execution-stdout-{{execution.$id}}">Output</button>
                                                <button class="phones-only-inline tablets-only-inline link text-danger" data-ls-ui-trigger="execution-stderr-{{execution.$id}}">Errors</button>

                                                    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

STDOUT

No output was logged.

                                                    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

STDERR

No errors were logged.

                            <form
                                data-service="functions.listExecutions"
                                data-event="submit"
                                data-param-function-id="{{router.params.id}}"
                                data-param-search="{{router.params.search}}"
                                data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
                                data-param-order-type="DESC"
                                data-scope="sdk"
                                data-name="project-function-executions"
                                data-success="state"
                                data-success-param-state-keys="search,offset">
                                <button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-total="{{project-function-executions.total}}" class="margin-end round small" aria-label="Back"></button>
                            </form>

                            <form
                                data-service="functions.listExecutions"
                                data-event="submit"
                                data-param-function-id="{{router.params.id}}"
                                data-param-search="{{router.params.search}}"
                                data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
                                data-param-order-type="DESC"
                                data-scope="sdk"
                                data-name="project-function-executions"
                                data-success="state"
                                data-success-param-state-keys="search,offset">
                                <button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-total="{{project-function-executions.total}}" class="margin-start round small" aria-label="Next"></button>
                            </form>

No Logs Founds

Execute your function to view execution logs.

Settings

                        <form
                            data-analytics
                            data-analytics-activity
                            data-analytics-event="submit"
                            data-analytics-category="console"
                            data-analytics-label="Update Function"
                            data-service="functions.update"
                            data-scope="sdk"
                            data-event="submit"
                            data-param-function-id="{{router.params.id}}"
                            data-success="alert,trigger"
                            data-success-param-alert-text="Updated function successfully"
                            data-success-param-trigger-events="functions.update"
                            data-failure="alert"
                            data-failure-param-alert-text="Failed to update function"
                            data-failure-param-alert-classname="error">

                                    Name
                                    <input name="name" id="function-name" type="text" autocomplete="off" data-ls-bind="{{project-function.name}}" data-forms-text-direction required placeholder="Function Name" maxlength="128" />

                                    Execute Access  (Learn more)
                                    <input type="hidden" id="execute" name="execute" data-forms-tags data-cast-to="json" data-ls-bind="{{project-function.execute}}" placeholder="User ID, Team ID or Role" />

Add 'role:all' for wildcard access

                                    Timeout (seconds)
                                    <input name="timeout" id="function-timeout" type="number" autocomplete="off" data-ls-bind="{{project-function.timeout}}" min="1" max="<?php echo $this->escape($timeout); ?>" data-cast-to="integer" />

Max value is <?php echo $this->escape(number_format($timeout)); ?> seconds (<?php echo $this->escape((int) ($timeout / 60)); ?> minutes)

                                    Events

                                        <template x-for="event in Array.from(events)">

                                                <input name="events" data-cast-to="array" type="hidden" :value="event"></input>

                                        </template>

                                    <button class="margin-end margin-bottom-small reverse" type="button" @click="showModal($refs.modal_function)">Add Event</button>

                                Schedule (CRON Syntax)
                                <input type="text" id="function-schedule" class="full-width" name="schedule" autocomplete="off" data-ls-bind="{{project-function.schedule}}" placeholder="* * * * *" />

Leave blank for no schedule

                                Variables

                                    <fieldset name="vars" data-cast-to="object">

                                                        <input type="hidden" data-forms-key-value data-ls-attrs="name={{$index}}" data-ls-bind="{{var}}" />

                                                        <button type="button" data-remove class="close pull-end is-margin-top-10"></button>

                                                        <input type="hidden" data-ls-attrs="data-forms-key-value"/>

                                                        <button type="button" data-remove class="close pull-end is-margin-top-10"></button>

                                    </fieldset>

                                <button>Update</button>

                        </form>

                        Function ID

                            <input id="uid" type="text" autocomplete="off" placeholder="" data-ls-bind="{{project-function.$id}}" disabled data-forms-copy>

 <button data-ls-ui-trigger="open-json" class="link text-size-small">View as JSON</button>

 Last Updated:

 Created:

                        <form name="functions.delete" class="margin-bottom"
                            data-analytics
                            data-analytics-activity
                            data-analytics-event="submit"
                            data-analytics-category="console"
                            data-analytics-label="Delete Function"
                            data-service="functions.delete"
                            data-event="submit"
                            data-param-function-id="{{router.params.id}}"
                            data-confirm="Are you sure you want to delete this function?"
                            data-success="alert,trigger,redirect"
                            data-success-param-alert-text="Function deleted successfully"
                            data-success-param-trigger-events="functions.delete"
                            data-success-param-redirect-url="/console/functions?project={{router.params.project}}"
                            data-failure="alert"
                            data-failure-param-alert-text="Failed to delete function"
                            data-failure-param-alert-classname="error">

                            <button type="submit" class="danger fill">Delete Function</button>
                        </form>

                        <form @submit.prevent="addEvent($refs.modal_function)">

                                Event

                            <select id="event" x-model="selected" @change="setEvent()">
                                <option value="" selected>Select event</option>
                                <?php foreach ($patterns as $event) : ?>
                                    <option value="<?php echo $event; ?>"><?php echo $event; ?></option>
                                <?php endforeach; ?>
                            </select>

                                <input id="resource" type="text" :placeholder="resourceName" x-model="resource" maxlength="36" pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]{0,35}$">

Leave empty for wildcard

                                <input id="subResource" type="text" :placeholder="subResourceName" x-model="subResource" maxlength="36" pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]{0,35}$">

Leave empty for wildcard

                                Add Attribute (optional)
                                <select id="attribute" x-model="attribute">
                                    <option value="*">Select attribute</option>
                                    <template x-for="attr in attributes">
                                        <option :value="attr" x-text="attr"></option>
                                    </template>
                                </select>

                            <button x-show="selected" type="submit">Add Event</button>   <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>
                        </form>

    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Execute Function

    <form data-ls-if="{{project-function.deployment}} !== ''" name="functions.createExecution" class="margin-top"
        data-analytics
        data-analytics-activity
        data-analytics-event="submit"
        data-analytics-category="console"
        data-analytics-label="Create Function Execution"
        data-service="functions.createExecution"
        data-event="submit"
        data-param-function-id="{{router.params.id}}"
        data-success="alert,trigger"
        data-success-param-alert-text="Function executed successfully"
        data-success-param-trigger-events="functions.createExecution"
        data-failure="alert"
        data-failure-param-alert-text="Failed to execute function"
        data-failure-param-alert-classname="error">

        Custom Data
        <textarea id="execution-data" name="data" autocomplete="off" class="margin-bottom" placeholder="Data string (optional)"></textarea>

        <button type="submit" style="vertical-align: top;">Execute Now</button>
     </form>

    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Create a New Deployment

CLI

Unix

                <textarea type="hidden" data-ls-bind="appwrite functions createDeployment \
    --functionId={{project-function.$id}} \
    --activate=true \
    --entrypoint='scriptFile' \
    --code='.'" data-forms-code="bash" data-lang="bash" data-lang-label="Bash"></textarea>

PowerShell

                <textarea type="hidden" data-ls-bind="appwrite functions createDeployment `
    --functionId={{project-function.$id}} `
    --activate=true `
    --entrypoint='scriptFile' `
    --code='.'" data-forms-code="powershell" data-lang="powershell" data-lang-label="PowerShell"></textarea>

Learn more about creating deployments, installing and using the Appwrite CLI.

Manual

            <form class="margin-top-negative"
                data-analytics
                data-analytics-activity
                data-analytics-event="submit"
                data-analytics-category="console"
                data-analytics-label="Create Function Deployment"
                data-service="functions.createDeployment"
                data-scope="sdk"
                data-event="submit"
                data-success="alert,trigger,reset"
                data-success-param-alert-text="Created function deployment successfully"
                data-success-param-trigger-events="functions.createDeployment"
                data-failure="alert"
                data-failure-param-alert-text="Failed to create function deployment"
                data-failure-param-alert-classname="error">

                <input type="hidden" name="functionId" data-ls-bind="{{router.params.id}}" />

                Entrypoint
                <input type="text" id="deployment-entrypoint" name="entrypoint" required autocomplete="off" class="margin-bottom" placeholder="main.js" />

                Gzipped Code (tar.gz file)
                <input type="file" name="code" id="deployment-code" size="1" required accept="application/x-gzip,.gz">

(Max file size allowed: <?php echo $fileLimitHuman; ?>)

                <input type="checkbox" class="margin-start-small" id="deployment-activate" name="activate" /> Activate Deployment after build

                    <button type="submit">Create</button>   <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

            </form>


appwrite functions get --functionId="[FUNCTION_ID]"


import Appwrite

func main() async throws {
    let client = Client()
      .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
      .setProject("5df5acd0d48c2") // Your project ID
      .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    let database = Database(client)
    let attributeIp = try await database.createIpAttribute(
        collectionId: "[COLLECTION_ID]",
        key: "",
        required: xfalse
    )

    print(String(describing: attributeIp)
}


import 'package:appwrite/appwrite.dart';

void main() { // Init SDK
  Client client = Client();
  Locale locale = Locale(client);

  client
    .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
    .setProject('5df5acd0d48c2') // Your project ID
  ;
  Future result = locale.getCurrencies();

  result
    .then((response) {
      print(response);
    }).catchError((error) {
      print(error.response);
  });
}


<button data-ls-ui-trigger="open-update-name" class="link text-size-small">Update name</button>

<button data-ls-ui-trigger="open-update-email" class="link text-size-small">Update Email</button>

<button data-ls-ui-trigger="open-update-password" class="link text-size-small">Update Password</button>

<div data-ls-if="{{user.emailVerification}} === false" style="display: none">

keep keep keep keep replace keep keep keep

data-analytics-label="View as JSON (User)">


from appwrite.client import Client
from appwrite.services.health import Health

client = Client()

(client
  .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
  .set_project('5df5acd0d48c2') # Your project ID
  .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
)

health = Health(client)

result = health.get_time()


appwrite functions create \
        --name="[NAME]" \
        --execute="" \
        --runtime="dotnet-5.0" \
        --vars="{}" \
        --events="" \
        --schedule="" \
        --timeout="1"


## Getting Started

### Init your SDK
Initialize your SDK with your Appwrite server API endpoint and project ID which can be found on your project settings page and your new API secret Key from project's API keys section.

```python
from appwrite.client import Client
from appwrite.services.users import Users

client = Client()

(client
  .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
  .set_project('5df5acd0d48c2') # Your project ID
  .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
  .set_self_signed() # Use only on dev mode with a self-signed SSL cert
)
```

### Make Your First Request
Once your SDK object is set, create any of the Appwrite service objects and choose any request to send. Full documentation for any service method you would like to use can be found in your SDK documentation or in the [API References](https://appwrite.io/docs) section.

```python
users = Users(client)

result = users.create('[USER_ID]', 'email@example.com', 'password')
```

### Full Example
```python
from appwrite.client import Client
from appwrite.services.users import Users

client = Client()

(client
  .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
  .set_project('5df5acd0d48c2') # Your project ID
  .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
  .set_self_signed() # Use only on dev mode with a self-signed SSL cert
)

users = Users(client)

result = users.create('[USER_ID]', 'email@example.com', 'password')
```

### Error Handling
The Appwrite Python SDK raises `AppwriteException` object with `message`, `code` and `response` properties. You can handle any errors by catching `AppwriteException` and present the `message` to the user or handle it yourself based on the provided error information. Below is an example.

```python
users = Users(client)
try:
  result = users.create('[USER_ID]', 'email@example.com', 'password')
except AppwriteException as e:
  print(e.message)
```

### Learn more
You can use the following resources to learn more and get help
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
- 📜 [Appwrite Docs](https://appwrite.io/docs)
- 💬 [Discord Community](https://appwrite.io/discord)
- 🚂 [Appwrite Python Playground](https://github.com/appwrite/playground-for-python)


"dev": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true,
"optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,

keep keep keep keep keep replace replace keep keep keep keep

import { Input, InputGroup } from '@rocket.chat/fuselage';
import { Session } from 'meteor/session';
import React, { useMemo, useState } from 'react';
import toastr from 'toastr';

import { call } from '../../../../app/ui-utils/client';
import { handleError } from '../../../../app/utils/client';
import { callbacks } from '../../../../app/callbacks/client';
import { useSetting } from '../../../hooks/useSetting';
import { useTranslation } from '../../../hooks/useTranslation';
import { useSetupWizardStepsState } from '../StepsState';
import { Step } from '../Step';
import { StepHeader } from '../StepHeader';
import { Pager } from '../Pager';
import { StepContent } from '../StepContent';
import { loginWithPassword } from '../functions';
import { useFocus } from '../../../hooks/useFocus';

const registerAdminUser = async ({ name, username, email, password, onRegistrationEmailSent }) => {
	await call('registerUser', { name, username, email, pass: password });
	callbacks.run('userRegistered');

	try {
		await loginWithPassword(email, password);
	} catch (error) {
		if (error.error === 'error-invalid-email') {
			onRegistrationEmailSent && onRegistrationEmailSent();
			return;
		}

		throw error;
	}

	Session.set('forceLogin', false);

	await call('setUsername', username);

	callbacks.run('usernameSet');
};

export function AdminUserInformationStep({ step, title }) {
	const { currentStep, goToNextStep } = useSetupWizardStepsState();
	const active = step === currentStep;

	const regexpForUsernameValidation = useSetting('UTF8_Names_Validation');
	const usernameRegExp = useMemo(() => new RegExp(`^${ regexpForUsernameValidation }$`), [regexpForUsernameValidation]);
	const emailRegExp = useMemo(() => /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]+$/i, []);

	const [name, setName] = useState('');
	const [username, setUsername] = useState('');
	const [email, setEmail] = useState('');
	const [password, setPassword] = useState('');

	const [isNameValid, validateName] = useState(true);
	const [isUsernameValid, validateUsername] = useState(true);
	const [isEmailValid, validateEmail] = useState(true);
	const [isPasswordValid, validatePassword] = useState(true);

	const isContinueEnabled = useMemo(() => name && username && email && password, [name, username, email, password]);

	const [commiting, setCommiting] = useState(false);

	const validate = () => {
		const isNameValid = !!name;
		const isUsernameValid = !!username && usernameRegExp.test(username);
		const isEmailValid = !!email && emailRegExp.test(email);
		const isPasswordValid = !!password;

		validateName(isNameValid);
		validateUsername(isUsernameValid);
		validateEmail(isEmailValid);
		validatePassword(isPasswordValid);

		return isNameValid && isUsernameValid && isEmailValid && isPasswordValid;
	};

	const t = useTranslation();

	const autoFocusRef = useFocus(active);

	const handleSubmit = async (event) => {
		event.preventDefault();

		const canRegisterAdminUser = validate();

		if (!canRegisterAdminUser) {
			return;
		}

		setCommiting(true);

		try {
			await registerAdminUser({
				name,
				username,
				email,
				password,
				onRegistrationEmailSent: () => toastr.success(t('We_have_sent_registration_email')),
			});
			goToNextStep();
		} catch (error) {
			console.error(error);
			handleError(error);
		} finally {
			setCommiting(false);
		}
	};

	return <Step active={active} working={commiting} onSubmit={handleSubmit}>
		<StepHeader number={step} title={title} />

		<StepContent>
			<InputGroup>
				<Input
					ref={autoFocusRef}
					type='text'
					label={t('Name')}
					icon='user'
					placeholder={t('Type_your_name')}
					value={name}
					onChange={({ currentTarget: { value } }) => setName(value)}
					error={!isNameValid}
				/>
				<Input
					type='text'
					label={t('Username')}
					icon='at'
					placeholder={t('Type_your_username')}
					value={username}
					onChange={({ currentTarget: { value } }) => setUsername(value)}
					error={!isUsernameValid && t('Invalid_username')}
				/>
				<Input
					type='email'
					label={t('Organization_Email')}
					icon='mail'
					placeholder={t('Type_your_email')}
					value={email}
					onChange={({ currentTarget: { value } }) => setEmail(value)}
					error={!isEmailValid && t('Invalid_email')}
				/>
				<Input
					type='password'
					label={t('Password')}
					icon='key'
					placeholder={t('Type_your_password')}
					value={password}
					onChange={({ currentTarget: { value } }) => setPassword(value)}
					error={!isPasswordValid}
				/>
			</InputGroup>
		</StepContent>

		<Pager disabled={commiting} isContinueEnabled={isContinueEnabled} />
	</Step>;
}


import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';

import { hasPermission } from '../../../authorization';
import { LivechatRooms } from '../../../models';

Meteor.publish('livechat:monitoring', function(date) {
	if (!this.userId) {
		return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:monitoring' }));
	}

	if (!hasPermission(this.userId, 'view-livechat-manager')) {
		return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:monitoring' }));
	}

	date = {
		gte: new Date(date.gte),
		lt: new Date(date.lt),
	};

	check(date.gte, Date);
	check(date.lt, Date);

	const self = this;

	const handle = LivechatRooms.getAnalyticsMetricsBetweenDate('l', date).observeChanges({
		added(id, fields) {
			self.added('livechatMonitoring', id, fields);
		},
		changed(id, fields) {
			self.changed('livechatMonitoring', id, fields);
		},
		removed(id) {
			self.removed('livechatMonitoring', id);
		},
	});

	self.ready();

	self.onStop(function() {
		handle.stop();
	});
});


import { Meteor } from 'meteor/meteor';

const url = new URL(window.location);
const keys = new Set();
export const getConfig = (key) => {
	keys.add(key);
	return url.searchParams.get(key) || Meteor._localStorage.getItem(`rc-config-${ key }`);
};


RocketChat Action Links
============

Action Links are a way to add custom javascript functions to RocketChat messages. The links appear as a horizontal list below the message they correspond to, and by clicking the link will run a function you define server-side.

Usage
------------

Add 'actionLinks' to any message object as in the example below. It should be an array of object, each containing a 'label' (this will be the text printed to click on), a method_id (this is the name of the method that will be run), and params (this is the parameters passed to the method_id function).

~~~
message.actionLinks = [{ label: "Another Option", method_id: "anotherFunction", params: "stuff"}, { label: "An Option", method_id: "functOne", params: ""}];
~~~

The functions to be run need to be added to the actionLinkFuncts namespace. This is done by calling the RocketChat.actionLinks.register method. Your custom functions should take two parameters: the original message from the database, and the 'params' object given for that function.
~~~
RocketChat.actionLinks.register('functOne', function (origDbMsg, params) {

	console.log("I did some stuff!");

});
~~~


import '../../stylus/components/_dialogs.styl'

// Mixins
import Dependent from '../../mixins/dependent'
import Detachable from '../../mixins/detachable'
import Overlayable from '../../mixins/overlayable'
import Returnable from '../../mixins/returnable'
import Stackable from '../../mixins/stackable'
import Toggleable from '../../mixins/toggleable'

// Directives
import ClickOutside from '../../directives/click-outside'

// Helpers
import { convertToUnit, keyCodes, getSlotType } from '../../util/helpers'
import ThemeProvider from '../../util/ThemeProvider'
import { consoleError } from '../../util/console'

/* @vue/component */
export default {
  name: 'v-dialog',

  directives: {
    ClickOutside
  },

  mixins: [
    Dependent,
    Detachable,
    Overlayable,
    Returnable,
    Stackable,
    Toggleable
  ],

  props: {
    disabled: Boolean,
    persistent: Boolean,
    fullscreen: Boolean,
    fullWidth: Boolean,
    noClickAnimation: Boolean,
    light: Boolean,
    dark: Boolean,
    maxWidth: {
      type: [String, Number],
      default: 'none'
    },
    origin: {
      type: String,
      default: 'center center'
    },
    width: {
      type: [String, Number],
      default: 'auto'
    },
    scrollable: Boolean,
    transition: {
      type: [String, Boolean],
      default: 'dialog-transition'
    }
  },

  data () {
    return {
      animate: false,
      animateTimeout: null,
      stackClass: 'v-dialog__content--active',
      stackMinZIndex: 200
    }
  },

  computed: {
    classes () {
      return {
        [(`v-dialog ${this.contentClass}`).trim()]: true,
        'v-dialog--active': this.isActive,
        'v-dialog--persistent': this.persistent,
        'v-dialog--fullscreen': this.fullscreen,
        'v-dialog--scrollable': this.scrollable,
        'v-dialog--animated': this.animate
      }
    },
    contentClasses () {
      return {
        'v-dialog__content': true,
        'v-dialog__content--active': this.isActive
      }
    },
    hasActivator () {
      return Boolean(
        !!this.$slots.activator ||
        !!this.$scopedSlots.activator
      )
    }
  },

  watch: {
    isActive (val) {
      if (val) {
        this.show()
        this.hideScroll()
      } else {
        this.removeOverlay()
        this.unbind()
      }
    },
    fullscreen (val) {
      if (!this.isActive) return

      if (val) {
        this.hideScroll()
        this.removeOverlay(false)
      } else {
        this.showScroll()
        this.genOverlay()
      }
    }
  },

  beforeMount () {
    this.$nextTick(() => {
      this.isBooted = this.isActive
      this.isActive && this.show()
    })
  },

  mounted () {
    if (getSlotType(this, 'activator', true) === 'v-slot') {
      consoleError(`v-dialog's activator slot must be bound, try '<template #activator="data"><v-btn v-on="data.on>'`, this)
    }
  },

  beforeDestroy () {
    if (typeof window !== 'undefined') this.unbind()
  },

  methods: {
    animateClick () {
      this.animate = false
      // Needed for when clicking very fast
      // outside of the dialog
      this.$nextTick(() => {
        this.animate = true
        clearTimeout(this.animateTimeout)
        this.animateTimeout = setTimeout(() => (this.animate = false), 150)
      })
    },
    closeConditional (e) {
      // If the dialog content contains
      // the click event, or if the
      // dialog is not active
      if (!this.isActive || this.$refs.content.contains(e.target)) return false

      // If we made it here, the click is outside
      // and is active. If persistent, and the
      // click is on the overlay, animate
      if (this.persistent) {
        if (!this.noClickAnimation &&
          this.overlay === e.target
        ) this.animateClick()

        return false
      }

      // close dialog if !persistent, clicked outside and we're the topmost dialog.
      // Since this should only be called in a capture event (bottom up), we shouldn't need to stop propagation
      return this.activeZIndex >= this.getMaxZIndex()
    },
    hideScroll () {
      if (this.fullscreen) {
        document.documentElement.classList.add('overflow-y-hidden')
      } else {
        Overlayable.options.methods.hideScroll.call(this)
      }
    },
    show () {
      !this.fullscreen && !this.hideOverlay && this.genOverlay()
      this.$refs.content.focus()
      this.bind()
    },
    bind () {
      this.$listeners.keydown && window.addEventListener('keydown', this.onKeydown)
      window.addEventListener('focusin', this.onFocusin)
    },
    unbind () {
      window.removeEventListener('keydown', this.onKeydown)
      window.removeEventListener('focusin', this.onFocusin)
    },
    onKeydown (e) {
      this.$emit('keydown', e)
    },
    onFocusin (e) {
      const { target } = event

      if (
        // It isn't the document or the dialog body
        ![document, this.$refs.content].includes(target) &&
        // It isn't inside the dialog body
        !this.$refs.content.contains(target) &&
        // We're the topmost dialog
        this.activeZIndex >= this.getMaxZIndex() &&
        // It isn't inside a dependent element (like a menu)
        !this.getOpenDependentElements().some(el => el.contains(target))
        // So we must have focused something outside the dialog and its children
      ) {
        // Find and focus the first available element inside the dialog
        const focusable = this.$refs.content.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')
        focusable.length && focusable[0].focus()
      }
    },
    genActivator () {
      if (!this.hasActivator) return null

      const listeners = this.disabled ? {} : {
        click: e => {
          e.stopPropagation()
          if (!this.disabled) this.isActive = !this.isActive
        }
      }

      if (getSlotType(this, 'activator') === 'scoped') {
        const activator = this.$scopedSlots.activator({ on: listeners })
        this.activatorNode = activator
        return activator
      }

      return this.$createElement('div', {
        staticClass: 'v-dialog__activator',
        'class': {
          'v-dialog__activator--disabled': this.disabled
        },
        on: listeners
      }, this.$slots.activator)
    }
  },

  render (h) {
    const children = []
    const data = {
      'class': this.classes,
      ref: 'dialog',
      directives: [
        {
          name: 'click-outside',
          value: () => { this.isActive = false },
          args: {
            closeConditional: this.closeConditional,
            include: this.getOpenDependentElements
          }
        },
        { name: 'show', value: this.isActive }
      ],
      on: {
        click: e => { e.stopPropagation() }
      }
    }

    if (!this.fullscreen) {
      data.style = {
        maxWidth: this.maxWidth === 'none' ? undefined : convertToUnit(this.maxWidth),
        width: this.width === 'auto' ? undefined : convertToUnit(this.width)
      }
    }

    children.push(this.genActivator())

    let dialog = h('div', data, this.showLazyContent(this.$slots.default))
    if (this.transition) {
      dialog = h('transition', {
        props: {
          name: this.transition,
          origin: this.origin
        }
      }, [dialog])
    }

    children.push(h('div', {
      'class': this.contentClasses,
      attrs: {
        tabIndex: '-1',
        ...this.getScopeIdAttrs()
      },
      style: { zIndex: this.activeZIndex },
      ref: 'content'
    }, [
      this.$createElement(ThemeProvider, {
        props: {
          root: true,
          light: this.light,
          dark: this.dark
        }
      }, [dialog])
    ]))

    return h('div', {
      staticClass: 'v-dialog__container',
      style: {
        display: (!this.hasActivator || this.fullWidth) ? 'block' : 'inline-block'
      }
    }, children)
  }
}


When you run into a roadblock, you need assistance right away. Vuetify offers support in our massive community on Discord.

Vibrant Community

Be prepared for an armada of specialized components at your disposal. With over 80 in total, there is a solution to any situation.

Semantic Material Components

Vuetify supports the future of Vue tooling through its vue-cli-3 plugin. With one command you are ready to start building your next great idea.

Ready-Made Project Scaffolding


// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`VStepperStep.js should accept a custom color 1`] = `

      check

`;

exports[`VStepperStep.js should accept a custom css color 1`] = `

      check

`;


<template>
  <v-card flat>
    <v-card-text>
      <v-container fluid>
        <v-layout row wrap>
          <v-flex xs12 sm6 md6>
            <v-radio-group v-model="ex7" column>
              <v-radio
                label="red"
                color="red"
                value="red"
              ></v-radio>
              <v-radio
                label="red darken-3"
                color="red darken-3"
                value="red darken-3"
              ></v-radio>
              <v-radio
                label="indigo"
                color="indigo"
                value="indigo"
              ></v-radio>
              <v-radio
                label="indigo darken-3"
                color="indigo darken-3"
                value="indigo darken-3"
              ></v-radio>
              <v-radio
                label="orange"
                color="orange"
                value="orange"
              ></v-radio>
              <v-radio
                label="orange darken-3"
                color="orange darken-3"
                value="orange darken-3"
              ></v-radio>
            </v-radio-group>
          </v-flex>
          <v-flex xs12 sm6 md6>
            <v-radio-group v-model="ex8" column>
              <v-radio
                label="primary"
                color="primary"
                value="primary"
              ></v-radio>
              <v-radio
                label="secondary"
                color="secondary"
                value="secondary"
              ></v-radio>
              <v-radio
                label="success"
                color="success"
                value="success"
              ></v-radio>
              <v-radio
                label="info"
                color="info"
                value="info"
              ></v-radio>
              <v-radio
                label="warning"
                color="warning"
                value="warning"
              ></v-radio>
              <v-radio
                label="error"
                color="error"
                value="error"
              ></v-radio>
            </v-radio-group>
          </v-flex>
        </v-layout>
      </v-container>
    </v-card-text>
  </v-card>
</template>

<script>
  export default {
    data () {
      return {
        ex7: 'red',
        ex8: 'primary'
      }
    }
  }
</script>


import VDialog from '@/components/VDialog'
import { test } from '@/test'
import Vue from 'vue'

test('VDialog.js', ({ mount, compileToFunctions }) => {
  it('should render component and match snapshot', () => {
    const wrapper = mount(VDialog)

    expect(wrapper.html()).toMatchSnapshot()
    expect('Unable to locate target [data-app]').toHaveBeenTipped()
  })

  it('should render a disabled component and match snapshot', () => {
    const wrapper = mount(VDialog, {
      propsData: {
        disabled: true
      }
    })

    expect(wrapper.html()).toMatchSnapshot()
    expect('Unable to locate target [data-app]').toHaveBeenTipped()
  })

  it('should render a persistent component and match snapshot', () => {
    const wrapper = mount(VDialog, {
      propsData: {
        persistent: true
      }
    })

    expect(wrapper.html()).toMatchSnapshot()
    expect('Unable to locate target [data-app]').toHaveBeenTipped()
  })

  it('should render a fullscreen component and match snapshot', () => {
    const wrapper = mount(VDialog, {
      propsData: {
        fullscreen: true
      }
    })

    expect(wrapper.html()).toMatchSnapshot()
    expect('Unable to locate target [data-app]').toHaveBeenTipped()
  })

  it('should render a lazy component and match snapshot', () => {
    const wrapper = mount(VDialog, {
      propsData: {
        lazy: true
      }
    })

    expect(wrapper.html()).toMatchSnapshot()
  })

  it('should render a scrollable component and match snapshot', () => {
    const wrapper = mount(VDialog, {
      propsData: {
        scrollable: true
      }
    })

    expect(wrapper.html()).toMatchSnapshot()
    expect('Unable to locate target [data-app]').toHaveBeenTipped()
  })

  it('should render component with custom origin and match snapshot', () => {
    const wrapper = mount(VDialog, {
      propsData: {
        origin: 'top right'
      }
    })

    expect(wrapper.html()).toMatchSnapshot()
    expect('Unable to locate target [data-app]').toHaveBeenTipped()
  })

  it('should render component with custom width (max-width) and match snapshot', () => {
    const wrapper = mount(VDialog, {
      propsData: {
        maxWidth: 100
      }
    })

    expect(wrapper.html()).toMatchSnapshot()
    expect('Unable to locate target [data-app]').toHaveBeenTipped()
  })

  it('should render component with custom width and match snapshot', () => {
    const wrapper = mount(VDialog, {
      propsData: {
        width: '50%'
      }
    })

    expect(wrapper.html()).toMatchSnapshot()
    expect('Unable to locate target [data-app]').toHaveBeenTipped()
  })

  it('should render component with custom transition and match snapshot', () => {
    const wrapper = mount(VDialog, {
      propsData: {
        transition: 'fade-transition'
      }
    })

    expect(wrapper.html()).toMatchSnapshot()
    expect('Unable to locate target [data-app]').toHaveBeenTipped()
  })

  it('should open dialog on activator click', async () => {
    const input = jest.fn()
    const wrapper = mount(VDialog, {
      slots: {
        activator: [compileToFunctions('activator')]
      }
    })

    wrapper.vm.$on('input', input)

    expect(wrapper.vm.isActive).toBe(false)
    wrapper.find('.v-dialog__activator')[0].trigger('click')
    expect(wrapper.vm.isActive).toBe(true)
    await wrapper.vm.$nextTick()
    expect(input).toBeCalledWith(true)

    expect('Unable to locate target [data-app]').toHaveBeenTipped()
  })

  it('not should open disabed dialog on activator click', async () => {
    const input = jest.fn()
    const wrapper = mount(VDialog, {
      propsData: {
        disabled: true
      },
      slots: {
        activator: [compileToFunctions('activator')]
      }
    })

    wrapper.vm.$on('input', input)

    expect(wrapper.vm.isActive).toBe(false)
    wrapper.find('.v-dialog__activator')[0].trigger('click')
    expect(wrapper.vm.isActive).toBe(false)
    await wrapper.vm.$nextTick()
    expect(input).not.toBeCalled()

    expect('Unable to locate target [data-app]').toHaveBeenTipped()
  })

  it('not change state on v-model update', async () => {
    const wrapper = mount(VDialog, {
      propsData: {
        value: false
      },
      slots: {
        activator: [compileToFunctions('activator')]
      }
    })

    expect(wrapper.vm.isActive).toBe(false)

    wrapper.setProps({
      value: true
    })
    await wrapper.vm.$nextTick()
    expect(wrapper.vm.isActive).toBe(true)

    wrapper.setProps({
      value: false
    })
    await wrapper.vm.$nextTick()
    expect(wrapper.vm.isActive).toBe(false)

    expect('Unable to locate target [data-app]').toHaveBeenTipped()
  })

  it('should emit keydown event', async () => {
    const keydown = jest.fn()
    const component = {
      render: h => h(VDialog, {
        props: {
          value: true
        },
        on: {
          keydown
        }
      })
    }
    const wrapper = mount(component)

    await wrapper.vm.$nextTick()
    window.dispatchEvent(new Event('keydown'))
    expect(keydown).toBeCalled()

    expect('Unable to locate target [data-app]').toHaveBeenTipped()
  })

  // https://github.com/vuetifyjs/vuetify/issues/3101
  it('should always remove scrollbar when fullscreen', async () => {
    const wrapper = mount(VDialog)

    wrapper.setProps({ value: true })

    await wrapper.vm.$nextTick()

    expect(document.documentElement.className).not.toContain('overflow-y-hidden')

    wrapper.setProps({ fullscreen: true })

    await wrapper.vm.$nextTick()

    expect(document.documentElement.className).toContain('overflow-y-hidden')

    expect('Unable to locate target [data-app]').toHaveBeenTipped()
  })

  it('should not attach event handlers to the activator container if disabled', async () => {
    const wrapper = mount(VDialog, {
      propsData: {
        disabled: true
      },
      slots: {
        activator: [compileToFunctions('<button></button>')]
      }
    })

    const activator = wrapper.find('.v-dialog__activator')[0]
    expect(Object.keys(activator.vNode.data.on)).toHaveLength(0)

    expect('Unable to locate target [data-app]').toHaveBeenTipped()
  })

  // https://github.com/vuetifyjs/vuetify/issues/6115
  it('should have activator', () => {
    const wrapper = mount(VDialog)
    expect(wrapper.vm.hasActivator).toBe(false)
    expect(wrapper.hasStyle('display', 'block')).toBe(true)

    const wrapper2 = mount(VDialog, {
      slots: {
        activator: [compileToFunctions('

')]
      }
    })
    expect(wrapper2.hasStyle('display', 'inline-block')).toBe(true)
    expect(wrapper2.vm.hasActivator).toBe(true)

    const wrapper3 = mount({
      render: h => h(VDialog, {
        scopedSlots: {
          activator: () => '

'
        }
      })
    })
    const dialog = wrapper3.first(VDialog)
    expect(dialog.hasStyle('display', 'inline-block')).toBe(true)
    expect(dialog.vm.hasActivator).toBe(true)

    expect('Unable to locate target [data-app]').toHaveBeenTipped()
  })
})


header