Skip to content

Commit

Permalink
Update lexicons fetched from bfbac24 committed 2024-08-30T18:18:43Z
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshalX committed Aug 31, 2024
1 parent f37352b commit 1558566
Show file tree
Hide file tree
Showing 16 changed files with 237 additions and 30 deletions.
1 change: 1 addition & 0 deletions docs/source/aliases_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
'models.ComAtprotoModerationDefs': 'atproto_client.models.com.atproto.moderation.defs',
'models.ComAtprotoRepoApplyWrites': 'atproto_client.models.com.atproto.repo.apply_writes',
'models.ComAtprotoRepoCreateRecord': 'atproto_client.models.com.atproto.repo.create_record',
'models.ComAtprotoRepoDefs': 'atproto_client.models.com.atproto.repo.defs',
'models.ComAtprotoRepoDeleteRecord': 'atproto_client.models.com.atproto.repo.delete_record',
'models.ComAtprotoRepoDescribeRepo': 'atproto_client.models.com.atproto.repo.describe_repo',
'models.ComAtprotoRepoGetRecord': 'atproto_client.models.com.atproto.repo.get_record',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
com.atproto.repo.defs
============================================

.. automodule:: atproto_client.models.com.atproto.repo.defs
:members:
:undoc-members:
:show-inheritance:
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Submodules

atproto_client.models.com.atproto.repo.apply_writes
atproto_client.models.com.atproto.repo.create_record
atproto_client.models.com.atproto.repo.defs
atproto_client.models.com.atproto.repo.delete_record
atproto_client.models.com.atproto.repo.describe_repo
atproto_client.models.com.atproto.repo.get_record
Expand Down
53 changes: 51 additions & 2 deletions lexicons/com.atproto.repo.applyWrites.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
},
"validate": {
"type": "boolean",
"default": true,
"description": "Can be set to 'false' to skip Lexicon schema validation of record data, for all operations."
"description": "Can be set to 'false' to skip Lexicon schema validation of record data across all operations, 'true' to require it, or leave unset to validate only for known Lexicons."
},
"writes": {
"type": "array",
Expand All @@ -37,6 +36,27 @@
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": [],
"properties": {
"commit": {
"type": "ref",
"ref": "com.atproto.repo.defs#commitMeta"
},
"results": {
"type": "array",
"items": {
"type": "union",
"refs": ["#createResult", "#updateResult", "#deleteResult"],
"closed": true
}
}
}
}
},
"errors": [
{
"name": "InvalidSwap",
Expand Down Expand Up @@ -72,6 +92,35 @@
"collection": { "type": "string", "format": "nsid" },
"rkey": { "type": "string" }
}
},
"createResult": {
"type": "object",
"required": ["uri", "cid"],
"properties": {
"uri": { "type": "string", "format": "at-uri" },
"cid": { "type": "string", "format": "cid" },
"validationStatus": {
"type": "string",
"knownValues": ["valid", "unknown"]
}
}
},
"updateResult": {
"type": "object",
"required": ["uri", "cid"],
"properties": {
"uri": { "type": "string", "format": "at-uri" },
"cid": { "type": "string", "format": "cid" },
"validationStatus": {
"type": "string",
"knownValues": ["valid", "unknown"]
}
}
},
"deleteResult": {
"type": "object",
"required": [],
"properties": {}
}
}
}
13 changes: 10 additions & 3 deletions lexicons/com.atproto.repo.createRecord.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
},
"validate": {
"type": "boolean",
"default": true,
"description": "Can be set to 'false' to skip Lexicon schema validation of record data."
"description": "Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons."
},
"record": {
"type": "unknown",
Expand All @@ -50,7 +49,15 @@
"required": ["uri", "cid"],
"properties": {
"uri": { "type": "string", "format": "at-uri" },
"cid": { "type": "string", "format": "cid" }
"cid": { "type": "string", "format": "cid" },
"commit": {
"type": "ref",
"ref": "com.atproto.repo.defs#commitMeta"
},
"validationStatus": {
"type": "string",
"knownValues": ["valid", "unknown"]
}
}
}
},
Expand Down
14 changes: 14 additions & 0 deletions lexicons/com.atproto.repo.defs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"lexicon": 1,
"id": "com.atproto.repo.defs",
"defs": {
"commitMeta": {
"type": "object",
"required": ["cid", "rev"],
"properties": {
"cid": { "type": "string", "format": "cid" },
"rev": { "type": "string" }
}
}
}
}
12 changes: 12 additions & 0 deletions lexicons/com.atproto.repo.deleteRecord.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"properties": {
"commit": {
"type": "ref",
"ref": "com.atproto.repo.defs#commitMeta"
}
}
}
},
"errors": [{ "name": "InvalidSwap" }]
}
}
Expand Down
13 changes: 10 additions & 3 deletions lexicons/com.atproto.repo.putRecord.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
},
"validate": {
"type": "boolean",
"default": true,
"description": "Can be set to 'false' to skip Lexicon schema validation of record data."
"description": "Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons."
},
"record": {
"type": "unknown",
Expand All @@ -56,7 +55,15 @@
"required": ["uri", "cid"],
"properties": {
"uri": { "type": "string", "format": "at-uri" },
"cid": { "type": "string", "format": "cid" }
"cid": { "type": "string", "format": "cid" },
"commit": {
"type": "ref",
"ref": "com.atproto.repo.defs#commitMeta"
},
"validationStatus": {
"type": "string",
"knownValues": ["valid", "unknown"]
}
}
}
},
Expand Down
2 changes: 2 additions & 0 deletions packages/atproto_client/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
from atproto_client.models.com.atproto.moderation import defs as ComAtprotoModerationDefs
from atproto_client.models.com.atproto.repo import apply_writes as ComAtprotoRepoApplyWrites
from atproto_client.models.com.atproto.repo import create_record as ComAtprotoRepoCreateRecord
from atproto_client.models.com.atproto.repo import defs as ComAtprotoRepoDefs
from atproto_client.models.com.atproto.repo import delete_record as ComAtprotoRepoDeleteRecord
from atproto_client.models.com.atproto.repo import describe_repo as ComAtprotoRepoDescribeRepo
from atproto_client.models.com.atproto.repo import get_record as ComAtprotoRepoGetRecord
Expand Down Expand Up @@ -357,6 +358,7 @@ class _Ids:
ComAtprotoModerationDefs: str = 'com.atproto.moderation.defs'
ComAtprotoRepoApplyWrites: str = 'com.atproto.repo.applyWrites'
ComAtprotoRepoCreateRecord: str = 'com.atproto.repo.createRecord'
ComAtprotoRepoDefs: str = 'com.atproto.repo.defs'
ComAtprotoRepoDeleteRecord: str = 'com.atproto.repo.deleteRecord'
ComAtprotoRepoDescribeRepo: str = 'com.atproto.repo.describeRepo'
ComAtprotoRepoGetRecord: str = 'com.atproto.repo.getRecord'
Expand Down
54 changes: 52 additions & 2 deletions packages/atproto_client/models/com/atproto/repo/apply_writes.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Data(base.DataModelBase):
] = None #: If provided, the entire operation will fail if the current repo commit CID does not match this value. Used to prevent conflicting repo mutations.
validate_: t.Optional[
bool
] = None #: Can be set to 'false' to skip Lexicon schema validation of record data, for all operations.
] = None #: Can be set to 'false' to skip Lexicon schema validation of record data across all operations, 'true' to require it, or leave unset to validate only for known Lexicons.


class DataDict(t.TypedDict):
Expand All @@ -55,7 +55,25 @@ class DataDict(t.TypedDict):
] #: If provided, the entire operation will fail if the current repo commit CID does not match this value. Used to prevent conflicting repo mutations.
validate: te.NotRequired[
t.Optional[bool]
] #: Can be set to 'false' to skip Lexicon schema validation of record data, for all operations.
] #: Can be set to 'false' to skip Lexicon schema validation of record data across all operations, 'true' to require it, or leave unset to validate only for known Lexicons.


class Response(base.ResponseModelBase):
"""Output data model for :obj:`com.atproto.repo.applyWrites`."""

commit: t.Optional['models.ComAtprotoRepoDefs.CommitMeta'] = None #: Commit.
results: t.Optional[
t.List[
te.Annotated[
t.Union[
'models.ComAtprotoRepoApplyWrites.CreateResult',
'models.ComAtprotoRepoApplyWrites.UpdateResult',
'models.ComAtprotoRepoApplyWrites.DeleteResult',
],
Field(discriminator='py_type'),
]
]
] = None #: Results.


class Create(base.ModelBase):
Expand Down Expand Up @@ -91,3 +109,35 @@ class Delete(base.ModelBase):
py_type: t.Literal['com.atproto.repo.applyWrites#delete'] = Field(
default='com.atproto.repo.applyWrites#delete', alias='$type', frozen=True
)


class CreateResult(base.ModelBase):
"""Definition model for :obj:`com.atproto.repo.applyWrites`."""

cid: str #: Cid.
uri: str #: Uri.
validation_status: t.Optional[str] = None #: Validation status.

py_type: t.Literal['com.atproto.repo.applyWrites#createResult'] = Field(
default='com.atproto.repo.applyWrites#createResult', alias='$type', frozen=True
)


class UpdateResult(base.ModelBase):
"""Definition model for :obj:`com.atproto.repo.applyWrites`."""

cid: str #: Cid.
uri: str #: Uri.
validation_status: t.Optional[str] = None #: Validation status.

py_type: t.Literal['com.atproto.repo.applyWrites#updateResult'] = Field(
default='com.atproto.repo.applyWrites#updateResult', alias='$type', frozen=True
)


class DeleteResult(base.ModelBase):
"""Definition model for :obj:`com.atproto.repo.applyWrites`."""

py_type: t.Literal['com.atproto.repo.applyWrites#deleteResult'] = Field(
default='com.atproto.repo.applyWrites#deleteResult', alias='$type', frozen=True
)
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from pydantic import Field

if t.TYPE_CHECKING:
from atproto_client import models
from atproto_client.models.unknown_type import UnknownInputType
from atproto_client.models import base

Expand All @@ -23,7 +24,9 @@ class Data(base.DataModelBase):
repo: str #: The handle or DID of the repo (aka, current account).
rkey: t.Optional[str] = Field(default=None, max_length=15) #: The Record Key.
swap_commit: t.Optional[str] = None #: Compare and swap with the previous commit by CID.
validate_: t.Optional[bool] = None #: Can be set to 'false' to skip Lexicon schema validation of record data.
validate_: t.Optional[
bool
] = None #: Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons.


class DataDict(t.TypedDict):
Expand All @@ -34,11 +37,13 @@ class DataDict(t.TypedDict):
swap_commit: te.NotRequired[t.Optional[str]] #: Compare and swap with the previous commit by CID.
validate: te.NotRequired[
t.Optional[bool]
] #: Can be set to 'false' to skip Lexicon schema validation of record data.
] #: Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons.


class Response(base.ResponseModelBase):
"""Output data model for :obj:`com.atproto.repo.createRecord`."""

cid: str #: Cid.
uri: str #: Uri.
commit: t.Optional['models.ComAtprotoRepoDefs.CommitMeta'] = None #: Commit.
validation_status: t.Optional[str] = None #: Validation status.
23 changes: 23 additions & 0 deletions packages/atproto_client/models/com/atproto/repo/defs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
##################################################################
# THIS IS THE AUTO-GENERATED CODE. DON'T EDIT IT BY HANDS!
# Copyright (C) 2024 Ilya (Marshal) <https://github.com/MarshalX>.
# This file is part of Python atproto SDK. Licenced under MIT.
##################################################################


import typing as t

from pydantic import Field

from atproto_client.models import base


class CommitMeta(base.ModelBase):
"""Definition model for :obj:`com.atproto.repo.defs`."""

cid: str #: Cid.
rev: str #: Rev.

py_type: t.Literal['com.atproto.repo.defs#commitMeta'] = Field(
default='com.atproto.repo.defs#commitMeta', alias='$type', frozen=True
)
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

import typing_extensions as te

if t.TYPE_CHECKING:
from atproto_client import models
from atproto_client.models import base


Expand All @@ -28,3 +30,9 @@ class DataDict(t.TypedDict):
rkey: str #: The Record Key.
swap_commit: te.NotRequired[t.Optional[str]] #: Compare and swap with the previous commit by CID.
swap_record: te.NotRequired[t.Optional[str]] #: Compare and swap with the previous record by CID.


class Response(base.ResponseModelBase):
"""Output data model for :obj:`com.atproto.repo.deleteRecord`."""

commit: t.Optional['models.ComAtprotoRepoDefs.CommitMeta'] = None #: Commit.
9 changes: 7 additions & 2 deletions packages/atproto_client/models/com/atproto/repo/put_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from pydantic import Field

if t.TYPE_CHECKING:
from atproto_client import models
from atproto_client.models.unknown_type import UnknownInputType
from atproto_client.models import base

Expand All @@ -26,7 +27,9 @@ class Data(base.DataModelBase):
swap_record: t.Optional[
str
] = None #: Compare and swap with the previous record by CID. WARNING: nullable and optional field; may cause problems with golang implementation.
validate_: t.Optional[bool] = None #: Can be set to 'false' to skip Lexicon schema validation of record data.
validate_: t.Optional[
bool
] = None #: Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons.


class DataDict(t.TypedDict):
Expand All @@ -40,11 +43,13 @@ class DataDict(t.TypedDict):
] #: Compare and swap with the previous record by CID. WARNING: nullable and optional field; may cause problems with golang implementation.
validate: te.NotRequired[
t.Optional[bool]
] #: Can be set to 'false' to skip Lexicon schema validation of record data.
] #: Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons.


class Response(base.ResponseModelBase):
"""Output data model for :obj:`com.atproto.repo.putRecord`."""

cid: str #: Cid.
uri: str #: Uri.
commit: t.Optional['models.ComAtprotoRepoDefs.CommitMeta'] = None #: Commit.
validation_status: t.Optional[str] = None #: Validation status.
Loading

0 comments on commit 1558566

Please sign in to comment.