eoapi-cdk 11.4.0 → 11.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +36 -21
- package/lib/bastion-host/index.js +1 -1
- package/lib/database/bootstrapper_runtime/handler.py +29 -12
- package/lib/database/index.js +1 -1
- package/lib/ingestor-api/index.d.ts +4 -0
- package/lib/ingestor-api/index.js +8 -3
- package/lib/ingestor-api/runtime/Dockerfile +13 -9
- package/lib/ingestor-api/runtime/pyproject.toml +37 -0
- package/lib/ingestor-api/runtime/src/config.py +9 -0
- package/lib/ingestor-api/runtime/src/ingestor.py +1 -1
- package/lib/ingestor-api/runtime/src/schemas.py +11 -19
- package/lib/ingestor-api/runtime/src/services.py +4 -2
- package/lib/ingestor-api/runtime/uv.lock +1279 -0
- package/lib/lambda-api-gateway/index.js +1 -1
- package/lib/lambda-api-gateway-private/index.js +1 -1
- package/lib/stac-api/index.js +2 -2
- package/lib/stac-api/runtime/uv.lock +50 -50
- package/lib/stac-auth-proxy/index.js +2 -2
- package/lib/stac-browser/index.js +1 -1
- package/lib/stac-loader/index.js +2 -2
- package/lib/stac-loader/runtime/uv.lock +48 -48
- package/lib/stactools-item-generator/index.js +1 -1
- package/lib/tipg-api/index.js +2 -2
- package/lib/tipg-api/runtime/uv.lock +50 -50
- package/lib/titiler-pgstac-api/index.js +2 -2
- package/package.json +1 -1
- package/pyproject.toml +4 -0
- package/uv.lock +433 -50
- package/lib/ingestor-api/runtime/dev_requirements.txt +0 -4
- package/lib/ingestor-api/runtime/requirements.txt +0 -10
|
@@ -3,17 +3,15 @@ import binascii
|
|
|
3
3
|
import enum
|
|
4
4
|
import json
|
|
5
5
|
from datetime import datetime
|
|
6
|
-
from typing import TYPE_CHECKING, Dict, List, Optional, Union
|
|
6
|
+
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
|
|
7
7
|
from urllib.parse import urlparse
|
|
8
8
|
|
|
9
9
|
from fastapi.encoders import jsonable_encoder
|
|
10
|
-
from fastapi.exceptions import RequestValidationError
|
|
11
10
|
from pydantic import (
|
|
12
11
|
BaseModel,
|
|
13
12
|
Json,
|
|
14
13
|
PositiveInt,
|
|
15
14
|
dataclasses,
|
|
16
|
-
error_wrappers,
|
|
17
15
|
field_validator,
|
|
18
16
|
)
|
|
19
17
|
from stac_pydantic import Collection, Item, shared
|
|
@@ -107,25 +105,19 @@ class Ingestion(BaseModel):
|
|
|
107
105
|
class ListIngestionRequest:
|
|
108
106
|
status: Status = Status.queued
|
|
109
107
|
limit: Optional[PositiveInt] = None
|
|
110
|
-
next: Optional[
|
|
111
|
-
|
|
112
|
-
def __post_init_post_parse__(self) -> None:
|
|
113
|
-
# https://github.com/tiangolo/fastapi/issues/1474#issuecomment-1049987786
|
|
114
|
-
if self.next is None:
|
|
115
|
-
return
|
|
108
|
+
next: Optional[Any] = None
|
|
116
109
|
|
|
110
|
+
@field_validator("next", mode="before")
|
|
111
|
+
@classmethod
|
|
112
|
+
def decode_next_token(cls, v: Optional[str]) -> Optional[Any]:
|
|
113
|
+
"""Decode the base64-encoded JSON pagination token supplied as a query param."""
|
|
114
|
+
if v is None:
|
|
115
|
+
return None
|
|
117
116
|
try:
|
|
118
|
-
|
|
117
|
+
return json.loads(base64.b64decode(v))
|
|
119
118
|
except (UnicodeDecodeError, binascii.Error) as e:
|
|
120
|
-
raise
|
|
121
|
-
|
|
122
|
-
error_wrappers.ErrorWrapper(
|
|
123
|
-
ValueError(
|
|
124
|
-
"Unable to decode next token. Should be base64 encoded JSON"
|
|
125
|
-
),
|
|
126
|
-
"query.next",
|
|
127
|
-
)
|
|
128
|
-
]
|
|
119
|
+
raise ValueError(
|
|
120
|
+
"Unable to decode next token. Should be base64 encoded JSON"
|
|
129
121
|
) from e
|
|
130
122
|
|
|
131
123
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from typing import TYPE_CHECKING, List
|
|
2
2
|
|
|
3
3
|
from boto3.dynamodb import conditions
|
|
4
|
-
from pydantic import
|
|
4
|
+
from pydantic import TypeAdapter
|
|
5
5
|
|
|
6
6
|
from . import schemas
|
|
7
7
|
|
|
@@ -35,7 +35,9 @@ class Database:
|
|
|
35
35
|
**{"ExclusiveStartKey": next} if next else {},
|
|
36
36
|
)
|
|
37
37
|
return {
|
|
38
|
-
"items":
|
|
38
|
+
"items": TypeAdapter(List[schemas.Ingestion]).validate_python(
|
|
39
|
+
response["Items"]
|
|
40
|
+
),
|
|
39
41
|
"next": response.get("LastEvaluatedKey"),
|
|
40
42
|
}
|
|
41
43
|
|