TrashItem

The trash: what was deleted and can still be put back.

Deleting an app, database, bucket, dict, queue, repo, volume, inbox or agent moves it here, restorable for 30 days, then purged for good. delete() on each of them returns its TrashItem:

item = noclick.Dict.from_name("rates-cache").delete()
item.restore()   # back under its name, every key with it

While it's in the trash its name is free and its storage is billed as before; restoring is free. purge() deletes it for good now: the one deletion that can't be undone, so through MCP it waits for a person.

class TrashItem

Something deleted, restorable until purgeAfter.

Attributes
idstring
kindTrashKind

What it is.

resourceIdstring

Its id as it was, and will be again once restored.

namestring | null
userIdstring | null

The user it was deleted from (null for the account's).

trashedAtDate | null
purgeAfterDate | null

When it's purged for good unless restored first.

operationIdstring | null

The deletion's operation (on the item a delete() returned): Operation.undo() on it restores it too.

fromIdstatic

static fromId(trashId: string, options?: CallOptions): TrashItem

A lazy reference to an item in the trash by its id.

Parameters
trashIdstringrequired
options.userUserOption

undefined = the ambient user (asUser), null = the account itself.

(defaults to the current user)
options.clientNoClick

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

Returns

The item; it loads the first time it's used.

liststatic

static list(
  options?: TrashListOptions & { limit?: number },
): Promise<TrashItem[]>

What's in the trash, newest first.

Parameters
options.kindTrashKind

One kind; omitted, every kind.

options.limitnumber

Return at most this many.

options.userUserOption

undefined = the ambient user (asUser), null = the account itself.

(defaults to the current user)
options.clientNoClick

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

options.userFilterUserFilter

Which users the read covers (user_id query), instead of acting as one (user).

Returns

Each item, with when it's purged unless restored first.

listPagestatic

static listPage(
  options?: TrashListOptions & PageOptions,
): Promise<Page<TrashItem>>

One page of the trash; pass nextCursor back as cursor.

Parameters
options.kindTrashKind

One kind; omitted, every kind.

options.cursorstring | null

The next_cursor of the page before; omit it for the first page.

options.limitnumber

Return at most this many.

options.userUserOption

undefined = the ambient user (asUser), null = the account itself.

(defaults to the current user)
options.clientNoClick

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

options.userFilterUserFilter

Which users the read covers (user_id query), instead of acting as one (user).

Returns

A page whose data holds the items and whose next_cursor is None on the last page.

restore

restore(): Promise<JsonObject>

Put it back where it was, under its name, with everything in it; throws Conflict when something new has taken its name since. Returns the restored resource as its own API shows it.

Returns

The restored resource as its own API shows it, with restored: True.

purge

purge(): Promise<void>

Delete it for good now: the one deletion that can't be undone.