Skip to main content
Module

x/feoblog_client/mod.ts>protobuf.Item

a JavaScript client for feoblog written for Deno
Latest
class protobuf.Item
extends Message<Item>
import { protobuf } from "https://deno.land/x/feoblog_client@v0.7.0/mod.ts";
const { Item } = protobuf;

Each FeoBlog user's "blog" is really a collection of "Items" of different types. It's important to keep in mind that different servers may cache different subsets of items.

Servers may (and probably should) impose a size limit for Item records. Servers should accept items up to 32KiB (from users who have permission to post to the server).

Clients upload items to servers by PUTing to: /u/{userID}/i/{itemID}/proto3 The body of the PUT is the binary proto3 representation of the Item. The userID is a base58-encoded NaCl public key. The {itemID} is a bas58-encoded detached NaCl signature of the proto3 bytes. The server must then verify the signature before storing and serving the proto3 bytes and must reject invalid signatures.

Constructors

new
Item(data?: PartialMessage<Item>)

Properties

itemType:
| { value: Post; case: "post"; }
| { value: Profile; case: "profile"; }
| { value: Comment; case: "comment"; }
| { case: undefined; value?: undefined; }
timestampMsUtc

REQUIRED The timestamp is used to give order to a user's collection of Items. This timestamp represents the number of milliseconds since 1970-01-01 00:00:00.000Z (ignoring leap seconds).

This is somewhat useful for displaying blog posts in order. But it's especially important for ordering things like updates to a user's profile.

As a result, servers should not accept timestamps in the future (except for maybe a small allowance due to clock drift.)

Servers must validate that this value is specified.

Due to protobuf3 default values, this means the value can not be exactly 0. Update: With new versionf of proto3, we can now unambiguously specify 0. TODO: Implement that.

utcOffsetMinutes: number

Optionally specify the user's timezone offset when they created this Item. This is useful when displaying more meaningful dates on things like Posts.

For example, Pacific Daylight Time has an offset of "-0700", or -420 minutes. Servers should reject offsets of more than +/- 24 hours.

Defaults to 0 (UTC).

Static Properties

readonly
fields: FieldList
readonly
runtime
readonly
typeName: string

Static Methods

equals(a: Item | PlainMessage<Item> | undefined, b: Item | PlainMessage<Item> | undefined): boolean
fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Item
fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Item
fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Item