WIT_CONTENT

Constant WIT_CONTENT 

Source
pub const WIT_CONTENT: &str = "package vtx:api@5.0.0;\n\ninterface vtx-sql {\n    variant db-value {\n        text(string),\n        integer(s64),\n        real(f64),\n        null-val,\n    }\n\n    execute: func(\n        statement: string,\n        params: list<db-value>,\n    ) -> result<u64, string>;\n\n    query-json: func(\n        statement: string,\n        params: list<db-value>,\n    ) -> result<string, string>;\n}\n\ninterface vtx-vfs {\n    resource buffer {\n        size: func() -> u64;\n\n        read: func(\n            offset: u64,\n            max-bytes: u64,\n        ) -> list<u8>;\n\n        write: func(\n            data: list<u8>,\n        ) -> u64;\n    }\n\n    record vtx-object-meta {\n        uri: string,\n        size: u64,\n        last-modified: option<s64>,\n        etag: option<string>,\n    }\n\n    create-memory-buffer: func(\n        data: list<u8>,\n    ) -> buffer;\n\n    open-uri: func(\n        uri: string,\n    ) -> result<buffer, string>;\n\n    head: func(\n        uri: string,\n    ) -> result<vtx-object-meta, string>;\n\n    list-objects: func(\n        prefix-uri: string,\n    ) -> result<list<vtx-object-meta>, string>;\n\n    read-range: func(\n        uri: string,\n        offset: u64,\n        len: u64,\n    ) -> result<list<u8>, string>;\n}\n\ninterface vtx-auth-types {\n    record user-context {\n        user-id: string,\n        username: string,\n        groups: list<string>,\n        metadata: string,\n    }\n\n    record current-user {\n        user-id: string,\n        username: string,\n        groups: list<string>,\n    }\n}\n\ninterface vtx-types {\n    use vtx-vfs.{buffer};\n    use vtx-auth-types.{user-context};\n\n    record http-request {\n        method: string,\n        path: string,\n        query: string,\n    }\n\n    record http-response {\n        status: u16,\n        body: option<buffer>,\n    }\n\n    record http-client-request {\n        method: string,\n        url: string,\n        headers: list<tuple<string, string>>,\n        body: option<buffer>,\n    }\n\n    record http-client-response {\n        status: u16,\n        headers: list<tuple<string, string>>,\n        body: option<buffer>,\n    }\n\n    record http-allow-rule {\n        scheme: string,\n        host: string,\n        port: option<u16>,\n        path: option<string>,\n        methods: option<list<string>>,\n        allow-headers: option<list<string>>,\n        max-request-bytes: option<u64>,\n        max-response-bytes: option<u64>,\n        follow-redirects: option<bool>,\n        redirect-policy: option<string>,\n    }\n\n    record capabilities {\n        subscriptions: list<string>,\n        permissions: list<string>,\n        http: option<list<http-allow-rule>>,\n    }\n\n    record manifest {\n        id: string,\n        name: string,\n        version: string,\n        description: string,\n        entrypoint: string,\n    }\n}\n\ninterface vtx-ffmpeg {\n    use vtx-vfs.{buffer};\n\n    record ffmpeg-option {\n        key: string,\n        value: option<string>,\n    }\n\n    record transcode-profile {\n        profile: string,\n        input-id: string,\n        options: list<ffmpeg-option>,\n    }\n\n    execute: func(\n        params: transcode-profile,\n    ) -> result<buffer, string>;\n}\n\ninterface vtx-events {\n    record event-context {\n        user-id: option<string>,\n        username: option<string>,\n        request-id: option<string>,\n    }\n\n    record vtx-event {\n        id: string,\n        topic: string,\n        source: string,\n        payload: string,\n        context: event-context,\n        occurred-at: u64,\n    }\n}\n\ninterface vtx-context {\n    use vtx-auth-types.{current-user};\n\n    get-current-user: func() -> option<current-user>;\n}\n\ninterface vtx-event-bus {\n    publish-event: func(\n        topic: string,\n        payload: string,\n    ) -> result<_, string>;\n}\n\ninterface vtx-http-client {\n    use vtx-types.{http-client-request, http-client-response};\n\n    request: func(\n        req: http-client-request,\n    ) -> result<http-client-response, string>;\n}\n\nworld vtx-plugin {\n    use vtx-types.{capabilities, http-request, http-response, manifest};\n    use vtx-auth-types.{user-context};\n    use vtx-events.{vtx-event};\n\n    import vtx-vfs;\n    import vtx-sql;\n    import vtx-ffmpeg;\n    import vtx-context;\n    import vtx-event-bus;\n    import vtx-http-client;\n\n    export handle: func(\n        req: http-request,\n    ) -> http-response;\n\n    export handle-event: func(\n        event: vtx-event,\n    ) -> result<_, string>;\n\n    export get-migrations: func() -> list<string>;\n\n    export get-manifest: func() -> manifest;\n\n    export get-resources: func() -> list<string>;\n\n    export get-capabilities: func() -> capabilities;\n\n    export authenticate: func(\n        headers: list<tuple<string, string>>,\n    ) -> result<user-context, u16>;\n}\n";