Skip to content

Commit

Permalink
Update versionup (#385)
Browse files Browse the repository at this point in the history
* update swagger

* add

* poetry update

* poetry update
  • Loading branch information
yuji38kwmt committed Nov 27, 2021
1 parent b45f25f commit 9920e07
Show file tree
Hide file tree
Showing 12 changed files with 181 additions and 68 deletions.
21 changes: 9 additions & 12 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:18.04 as devcontainer
FROM ubuntu:20.04 as devcontainer

RUN set -x \
&& sed -i.bak -r 's!(deb|deb-src) \S+!\1 mirror://mirrors.ubuntu.com/mirrors.txt!' /etc/apt/sources.list
Expand Down Expand Up @@ -101,25 +101,22 @@ RUN set -x \
&& chmod +x /usr/local/devcontainer-tool/bin/docker-compose
ENV PATH=/usr/local/devcontainer-tool/bin:${PATH}

# python3.8
# python3.9
RUN set -x \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
python3.8 \
python3-distutils \
python3.9 \
python3.9-dev \
python3-pip \
&& apt-get clean && rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/* \
&& ln -s $(which python3.8) /usr/local/bin/python

# pip
RUN set -x \
&& curl -sSL https://bootstrap.pypa.io/get-pip.py | sudo -u vscode -i python -
&& ln -s $(which python3.9) /usr/local/bin/python
ENV PIP_DEFAULT_TIMEOUT=100

# poetry
RUN set -x \
&& curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | sudo -u vscode -i python - \
&& sudo -u vscode -i /home/vscode/.local/bin/poetry config virtualenvs.in-project true
ENV PATH=$PATH:/home/vscode/.local/bin
&& python -m pip install -U pip setuptools \
&& pip install poetry \
&& sudo -u vscode -i poetry config virtualenvs.in-project true

# fix poetry issue (see: https://github.com/python-poetry/poetry/issues/221)
RUN set -x \
Expand Down
2 changes: 1 addition & 1 deletion annofabapi/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.50.2"
__version__ = "0.51.0"
3 changes: 3 additions & 0 deletions annofabapi/dataclass/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ class ProjectConfiguration(DataClassJsonMixin):
custom_specs_plugin_id: Optional[str]
"""プラグインID。[値の制約についてはこちら。](#section/API-Convention/APIID) """

editor_version: Optional[str]
"""標準アノテーションエディタのバージョン。 * `stable` * 安定版。通常はこちらを利用してください。 * `preview` * 最新版。新機能やUI変更の先行リリース版。 プロジェクト更新時に未指定の場合は `stable` が指定されたものとみなします。 """


@dataclass
class Project(DataClassJsonMixin):
Expand Down
25 changes: 24 additions & 1 deletion annofabapi/generated_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ def get_editor_annotation(
task_id (str): タスクID (required)
input_data_id (str): 入力データID (required)
query_params (Dict[str, Any]): Query Parameters
task_history_id (str): 過去のフェーズのアノテーションを取得する場合、タスク履歴IDを指定します。未指定時は最新のアノテーションを取得します。
task_history_id (str): 過去のフェーズのアノテーションを取得する場合、タスク履歴IDを指定します。未指定時は最新のアノテーションを取得します。 過去のアノテーションデータは最後に保存してから30日前のデータまで取得できます。 30日より前のデータを取得しようとした場合はアノテーションデータは空リストとなります。
Returns:
Tuple[Annotation, requests.Response]
Expand Down Expand Up @@ -2568,6 +2568,29 @@ def get_phase_daily_statistics(
}
return self._request_wrapper(http_method, url_path, **keyword_params)

def get_statistics_available_dates(self, project_id: str, **kwargs) -> Tuple[Any, requests.Response]:
"""プロジェクト統計記録期間取得
https://annofab.com/docs/api/#operation/getStatisticsAvailableDates
authorizations: AllProjectMember
プロジェクトの統計情報が記録されている日付期間を取得します。 日付期間とは、from(日付)からto(日付)までの連続する日付を指します。fromとtoの日付は期間に含みます。 プロジェクトが一度も停止されていない場合、プロジェクト作成日から昨日までの日付期間が一つだけ返ります。 プロジェクトを停止した場合、プロジェクトの作成日から停止した日までの日付期間が一つだけ返ります。 プロジェクトを再開した場合、統計情報が記録されない(プロジェクトの停止)期間を除いた日付期間が複数返ります。以降、プロジェクトの停止と再開を繰り返すたびに結果の日付期間が増えていきます。
Args:
project_id (str): プロジェクトID (required)
Returns:
Tuple[List[DateRange], requests.Response]
"""
url_path = f"/projects/{project_id}/statistics/dates"
http_method = "GET"
keyword_params: Dict[str, Any] = {}
return self._request_wrapper(http_method, url_path, **keyword_params)

def get_task_daily_statistics(
self, project_id: str, query_params: Optional[Dict[str, Any]] = None, **kwargs
) -> Tuple[Any, requests.Response]:
Expand Down
22 changes: 18 additions & 4 deletions annofabapi/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,9 +728,9 @@ class AnnotationDataHoldingType(Enum):
* attributes: List[AdditionalData]
* updated_from: str
開始日・終了日を含む区間[updated_from, updated_to]でアノテーションの更新日を絞り込むときに使用する、開始日。updated_toより後ろに指定された場合、期間指定は開始日・終了日を含む区間[updated_to, updated_from]となる。未指定の場合、本日であるとして扱われる
開始日・終了日を含む区間[updated_from, updated_to]でアノテーションの更新日を絞り込むときに使用する、開始日(ISO 8601 拡張形式または基本形式)。 `updated_to` より後の日付が指定された場合、期間指定は開始日・終了日を含む区間[updated_to, updated_from]となる。未指定の場合、未指定の場合、API実行日(JST)の日付が指定されたものとして扱われる
* updated_to: str
開始日・終了日を含む区間[updated_from, updated_to]でアノテーションの更新日を絞り込むときに使用する、終了日未指定の場合、本日であるとして扱われる
開始日・終了日を含む区間[updated_from, updated_to]でアノテーションの更新日を絞り込むときに使用する、終了日(ISO 8601 拡張形式または基本形式)。 未指定の場合、API実行日(JST)の日付が指定されたものとして扱われる
"""

Expand Down Expand Up @@ -1428,6 +1428,19 @@ class CommentStatus(Enum):
"""

DateRange = Dict[str, Any]
"""
日付の期間
Kyes of Dict
* _from: str
区間開始日(ISO 8601 拡張形式)
* to: str
区間終了日(ISO 8601 拡張形式)
"""

DeleteProjectResponse = Dict[str, Any]
"""
Expand Down Expand Up @@ -2099,13 +2112,12 @@ class InputDataType(Enum):

class InspectionStatus(Enum):
"""
##### スレッドの先頭のコメントである(`parent_inspection_id` に値がない)場合 * `annotator_action_required` - 未処置。`annotation`フェーズ担当者が何らかの回答をする必要あり * `no_correction_required` - 処置不要。`annotation`フェーズ担当者が、検査コメントによる修正は不要、と回答した * `error_corrected` - 修正済み。`annotation`フェーズ担当者が、検査コメントの指示どおり修正した * `no_comment_inspection` - 作成途中。検査コメントの中身が未入力 ##### 返信コメントである(`parent_inspection_id` に値がある)場合 現在は使用しておらず、レスポンスに含まれる値は不定です。APIのレスポンスにこの値を含む場合でも、「スレッドの先頭のコメント」の値を利用してください。 リクエストボディに指定する場合は、スレッドの先頭のコメントと同じ値を指定します。
##### スレッドの先頭のコメントである(`parent_inspection_id` に値がない)場合 * `annotator_action_required` - 未処置。`annotation`フェーズ担当者が何らかの回答をする必要あり * `no_correction_required` - 処置不要。`annotation`フェーズ担当者が、検査コメントによる修正は不要、と回答した * `error_corrected` - 修正済み。`annotation`フェーズ担当者が、検査コメントの指示どおり修正した ##### 返信コメントである(`parent_inspection_id` に値がある)場合 現在は使用しておらず、レスポンスに含まれる値は不定です。APIのレスポンスにこの値を含む場合でも、「スレッドの先頭のコメント」の値を利用してください。 リクエストボディに指定する場合は、スレッドの先頭のコメントと同じ値を指定します。
"""

ANNOTATOR_ACTION_REQUIRED = "annotator_action_required"
NO_CORRECTION_REQUIRED = "no_correction_required"
ERROR_CORRECTED = "error_corrected"
NO_COMMENT_INSPECTION = "no_comment_inspection"


class InspectionSummary(Enum):
Expand Down Expand Up @@ -3227,6 +3239,8 @@ class PricePlan(Enum):
プラグインID。[値の制約についてはこちら。](#section/API-Convention/APIID)
* custom_specs_plugin_id: str
プラグインID。[値の制約についてはこちら。](#section/API-Convention/APIID)
* editor_version: str
標準アノテーションエディタのバージョン。 * `stable` * 安定版。通常はこちらを利用してください。 * `preview` * 最新版。新機能やUI変更の先行リリース版。 プロジェクト更新時に未指定の場合は `stable` が指定されたものとみなします。
"""

Expand Down
41 changes: 35 additions & 6 deletions generate/swagger/swagger-api-components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ components:
schema:
$ref: "#/components/schemas/ErrorRefreshTokenExpired"
schemas:
ArrayOfDateRanges:
type: array
items:
$ref: "#/components/schemas/DateRange"
ArrayOfProjectTaskStatisticsHistory:
type: array
items:
Expand Down Expand Up @@ -275,6 +279,18 @@ components:
$ref: '#/components/schemas/Errors'
ErrorUnderMaintenance:
$ref: '#/components/schemas/Errors'
DateRange:
type: object
description: 日付の期間
properties:
from:
type: string
format: date
description: 区間開始日(ISO 8601 拡張形式)
to:
type: string
format: date
description: 区間終了日(ISO 8601 拡張形式)
Message:
type: object
properties:
Expand Down Expand Up @@ -1230,6 +1246,17 @@ components:
$ref: "#/components/schemas/PluginId"
description: |
カスタムアノテーション仕様のプラグインID。
editor_version:
type: string
description: |
標準アノテーションエディタのバージョン。
* `stable`
* 安定版。通常はこちらを利用してください。
* `preview`
* 最新版。新機能やUI変更の先行リリース版。
プロジェクト更新時に未指定の場合は `stable` が指定されたものとみなします。
ProjectSummary:
type: object
properties:
Expand Down Expand Up @@ -3792,14 +3819,18 @@ components:
$ref: "#/components/schemas/AdditionalData"
updated_from:
description: |
開始日・終了日を含む区間[updated_from, updated_to]でアノテーションの更新日を絞り込むときに使用する、開始日。updated_toより後ろに指定された場合、期間指定は開始日・終了日を含む区間[updated_to, updated_from]となる。未指定の場合、本日であるとして扱われる。
開始日・終了日を含む区間[updated_from, updated_to]でアノテーションの更新日を絞り込むときに使用する、開始日(ISO 8601 拡張形式または基本形式)。
`updated_to` より後の日付が指定された場合、期間指定は開始日・終了日を含む区間[updated_to, updated_from]となる。未指定の場合、未指定の場合、API実行日(JST)の日付が指定されたものとして扱われる。
type: string
example: "20191010"
format: date
updated_to:
description: |
開始日・終了日を含む区間[updated_from, updated_to]でアノテーションの更新日を絞り込むときに使用する、終了日。未指定の場合、本日であるとして扱われる。
開始日・終了日を含む区間[updated_from, updated_to]でアノテーションの更新日を絞り込むときに使用する、終了日(ISO 8601 拡張形式または基本形式)。
未指定の場合、API実行日(JST)の日付が指定されたものとして扱われる。
type: string
example: "20191010"
format: date
Annotation:
type: object
required:
Expand Down Expand Up @@ -4722,14 +4753,12 @@ components:
- annotator_action_required
- no_correction_required
- error_corrected
- no_comment_inspection
description: |
##### スレッドの先頭のコメントである(`parent_inspection_id` に値がない)場合
* `annotator_action_required` - 未処置。`annotation`フェーズ担当者が何らかの回答をする必要あり
* `no_correction_required` - 処置不要。`annotation`フェーズ担当者が、検査コメントによる修正は不要、と回答した
* `error_corrected` - 修正済み。`annotation`フェーズ担当者が、検査コメントの指示どおり修正した
* `no_comment_inspection` - 作成途中。検査コメントの中身が未入力
##### 返信コメントである(`parent_inspection_id` に値がある)場合
Expand Down
2 changes: 1 addition & 1 deletion generate/swagger/swagger.v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ info:
上記例 `account_id_count` は、タスクのフィールド `account_id` でタスクを分類したところ「`account_id` が `c5eee002` であるタスクが9件、`9f110e48` であるタスクが5件、`b25dfeb3` であるタスクが1件」だったという結果を表しています。
version: 0.127.0
version: 0.128.0
title: AnnoFab Web API
x-logo:
url: "https://annofab.com/resource/images/logo_landscape.png"
Expand Down
45 changes: 44 additions & 1 deletion generate/swagger/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ info:
上記例 `account_id_count` は、タスクのフィールド `account_id` でタスクを分類したところ「`account_id` が `c5eee002` であるタスクが9件、`9f110e48` であるタスクが5件、`b25dfeb3` であるタスクが1件」だったという結果を表しています。
また、AggregationResultの集約の件数は、合計で10000件以下に制限されており、それを超える件数がある場合は上位10000件が取得されます。もし、省略された部分を取得したい場合は、検索条件を縛って結果に上る集約の数を減らしてください。
version: 0.127.0
version: 0.128.0
title: AnnoFab Web API
x-logo:
url: "https://annofab.com/resource/images/logo_landscape.png"
Expand Down Expand Up @@ -2592,6 +2592,46 @@ paths:
$ref: "swagger-api-components.yaml#/components/responses/ErrorForbiddenResource"
"503":
$ref: "swagger-api-components.yaml#/components/responses/ErrorUnderMaintenance"
/projects/{project_id}/statistics/dates:
get:
tags:
- af-statistics
summary: プロジェクト統計記録期間取得
description: |
プロジェクトの統計情報が記録されている日付期間を取得します。
日付期間とは、from(日付)からto(日付)までの連続する日付を指します。fromとtoの日付は期間に含みます。
プロジェクトが一度も停止されていない場合、プロジェクト作成日から昨日までの日付期間が一つだけ返ります。
プロジェクトを停止した場合、プロジェクトの作成日から停止した日までの日付期間が一つだけ返ります。
プロジェクトを再開した場合、統計情報が記録されない(プロジェクトの停止)期間を除いた日付期間が複数返ります。以降、プロジェクトの停止と再開を繰り返すたびに結果の日付期間が増えていきます。
security:
- AllProjectMember: []
operationId: getStatisticsAvailableDates
parameters:
- name: project_id
in: path
description: プロジェクトID
required: true
schema:
$ref: "swagger-api-components.yaml#/components/schemas/ProjectId"
responses:
"200":
description: 正常
content:
application/json:
schema:
$ref: "swagger-api-components.yaml#/components/schemas/ArrayOfDateRanges"
"400":
$ref: "swagger-api-components.yaml#/components/responses/ErrorInvalidRequest"
"401":
$ref: "swagger-api-components.yaml#/components/responses/ErrorUnauthorizedApi"
"404":
$ref: "swagger-api-components.yaml#/components/responses/ErrorMissingResource"
"503":
$ref: "swagger-api-components.yaml#/components/responses/ErrorUnderMaintenance"
/projects/{project_id}/statistics/tasks/daily:
get:
tags:
Expand Down Expand Up @@ -4559,6 +4599,9 @@ paths:
in: query
description: |
過去のフェーズのアノテーションを取得する場合、タスク履歴IDを指定します。未指定時は最新のアノテーションを取得します。
過去のアノテーションデータは最後に保存してから30日前のデータまで取得できます。
30日より前のデータを取得しようとした場合はアノテーションデータは空リストとなります。
required: false
schema:
$ref: "swagger-api-components.yaml#/components/schemas/TaskHistoryId"
Expand Down

0 comments on commit 9920e07

Please sign in to comment.