Skip to content

Commit 9920e07

Browse files
authored
Update versionup (#385)
* update swagger * add * poetry update * poetry update
1 parent b45f25f commit 9920e07

File tree

12 files changed

+181
-68
lines changed

12 files changed

+181
-68
lines changed

.devcontainer/Dockerfile

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:18.04 as devcontainer
1+
FROM ubuntu:20.04 as devcontainer
22

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

104-
# python3.8
104+
# python3.9
105105
RUN set -x \
106106
&& apt-get update \
107107
&& apt-get install -y --no-install-recommends \
108-
python3.8 \
109-
python3-distutils \
108+
python3.9 \
109+
python3.9-dev \
110+
python3-pip \
110111
&& apt-get clean && rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/* \
111-
&& ln -s $(which python3.8) /usr/local/bin/python
112-
113-
# pip
114-
RUN set -x \
115-
&& curl -sSL https://bootstrap.pypa.io/get-pip.py | sudo -u vscode -i python -
112+
&& ln -s $(which python3.9) /usr/local/bin/python
116113
ENV PIP_DEFAULT_TIMEOUT=100
117114

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

124121
# fix poetry issue (see: https://github.com/python-poetry/poetry/issues/221)
125122
RUN set -x \

annofabapi/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.50.2"
1+
__version__ = "0.51.0"

annofabapi/dataclass/project.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ class ProjectConfiguration(DataClassJsonMixin):
7878
custom_specs_plugin_id: Optional[str]
7979
"""プラグインID。[値の制約についてはこちら。](#section/API-Convention/APIID) """
8080

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

8285
@dataclass
8386
class Project(DataClassJsonMixin):

annofabapi/generated_api.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ def get_editor_annotation(
429429
task_id (str): タスクID (required)
430430
input_data_id (str): 入力データID (required)
431431
query_params (Dict[str, Any]): Query Parameters
432-
task_history_id (str): 過去のフェーズのアノテーションを取得する場合、タスク履歴IDを指定します。未指定時は最新のアノテーションを取得します。
432+
task_history_id (str): 過去のフェーズのアノテーションを取得する場合、タスク履歴IDを指定します。未指定時は最新のアノテーションを取得します。 過去のアノテーションデータは最後に保存してから30日前のデータまで取得できます。 30日より前のデータを取得しようとした場合はアノテーションデータは空リストとなります。
433433
434434
Returns:
435435
Tuple[Annotation, requests.Response]
@@ -2568,6 +2568,29 @@ def get_phase_daily_statistics(
25682568
}
25692569
return self._request_wrapper(http_method, url_path, **keyword_params)
25702570

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

annofabapi/models.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -728,9 +728,9 @@ class AnnotationDataHoldingType(Enum):
728728
* attributes: List[AdditionalData]
729729
730730
* updated_from: str
731-
開始日・終了日を含む区間[updated_from, updated_to]でアノテーションの更新日を絞り込むときに使用する、開始日。updated_toより後ろに指定された場合、期間指定は開始日・終了日を含む区間[updated_to, updated_from]となる。未指定の場合、本日であるとして扱われる
731+
開始日・終了日を含む区間[updated_from, updated_to]でアノテーションの更新日を絞り込むときに使用する、開始日(ISO 8601 拡張形式または基本形式)。 `updated_to` より後の日付が指定された場合、期間指定は開始日・終了日を含む区間[updated_to, updated_from]となる。未指定の場合、未指定の場合、API実行日(JST)の日付が指定されたものとして扱われる
732732
* updated_to: str
733-
開始日・終了日を含む区間[updated_from, updated_to]でアノテーションの更新日を絞り込むときに使用する、終了日未指定の場合、本日であるとして扱われる
733+
開始日・終了日を含む区間[updated_from, updated_to]でアノテーションの更新日を絞り込むときに使用する、終了日(ISO 8601 拡張形式または基本形式)。 未指定の場合、API実行日(JST)の日付が指定されたものとして扱われる
734734
735735
"""
736736

@@ -1428,6 +1428,19 @@ class CommentStatus(Enum):
14281428
14291429
"""
14301430

1431+
DateRange = Dict[str, Any]
1432+
"""
1433+
日付の期間
1434+
1435+
Kyes of Dict
1436+
1437+
* _from: str
1438+
区間開始日(ISO 8601 拡張形式)
1439+
* to: str
1440+
区間終了日(ISO 8601 拡張形式)
1441+
1442+
"""
1443+
14311444
DeleteProjectResponse = Dict[str, Any]
14321445
"""
14331446
@@ -2099,13 +2112,12 @@ class InputDataType(Enum):
20992112

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

21052118
ANNOTATOR_ACTION_REQUIRED = "annotator_action_required"
21062119
NO_CORRECTION_REQUIRED = "no_correction_required"
21072120
ERROR_CORRECTED = "error_corrected"
2108-
NO_COMMENT_INSPECTION = "no_comment_inspection"
21092121

21102122

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

generate/swagger/swagger-api-components.yaml

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ components:
179179
schema:
180180
$ref: "#/components/schemas/ErrorRefreshTokenExpired"
181181
schemas:
182+
ArrayOfDateRanges:
183+
type: array
184+
items:
185+
$ref: "#/components/schemas/DateRange"
182186
ArrayOfProjectTaskStatisticsHistory:
183187
type: array
184188
items:
@@ -275,6 +279,18 @@ components:
275279
$ref: '#/components/schemas/Errors'
276280
ErrorUnderMaintenance:
277281
$ref: '#/components/schemas/Errors'
282+
DateRange:
283+
type: object
284+
description: 日付の期間
285+
properties:
286+
from:
287+
type: string
288+
format: date
289+
description: 区間開始日(ISO 8601 拡張形式)
290+
to:
291+
type: string
292+
format: date
293+
description: 区間終了日(ISO 8601 拡張形式)
278294
Message:
279295
type: object
280296
properties:
@@ -1230,6 +1246,17 @@ components:
12301246
$ref: "#/components/schemas/PluginId"
12311247
description: |
12321248
カスタムアノテーション仕様のプラグインID。
1249+
editor_version:
1250+
type: string
1251+
description: |
1252+
標準アノテーションエディタのバージョン。
1253+
1254+
* `stable`
1255+
* 安定版。通常はこちらを利用してください。
1256+
* `preview`
1257+
* 最新版。新機能やUI変更の先行リリース版。
1258+
1259+
プロジェクト更新時に未指定の場合は `stable` が指定されたものとみなします。
12331260
ProjectSummary:
12341261
type: object
12351262
properties:
@@ -3792,14 +3819,18 @@ components:
37923819
$ref: "#/components/schemas/AdditionalData"
37933820
updated_from:
37943821
description: |
3795-
開始日・終了日を含む区間[updated_from, updated_to]でアノテーションの更新日を絞り込むときに使用する、開始日。updated_toより後ろに指定された場合、期間指定は開始日・終了日を含む区間[updated_to, updated_from]となる。未指定の場合、本日であるとして扱われる。
3822+
開始日・終了日を含む区間[updated_from, updated_to]でアノテーションの更新日を絞り込むときに使用する、開始日(ISO 8601 拡張形式または基本形式)。
3823+
3824+
`updated_to` より後の日付が指定された場合、期間指定は開始日・終了日を含む区間[updated_to, updated_from]となる。未指定の場合、未指定の場合、API実行日(JST)の日付が指定されたものとして扱われる。
37963825
type: string
3797-
example: "20191010"
3826+
format: date
37983827
updated_to:
37993828
description: |
3800-
開始日・終了日を含む区間[updated_from, updated_to]でアノテーションの更新日を絞り込むときに使用する、終了日。未指定の場合、本日であるとして扱われる。
3829+
開始日・終了日を含む区間[updated_from, updated_to]でアノテーションの更新日を絞り込むときに使用する、終了日(ISO 8601 拡張形式または基本形式)。
3830+
3831+
未指定の場合、API実行日(JST)の日付が指定されたものとして扱われる。
38013832
type: string
3802-
example: "20191010"
3833+
format: date
38033834
Annotation:
38043835
type: object
38053836
required:
@@ -4722,14 +4753,12 @@ components:
47224753
- annotator_action_required
47234754
- no_correction_required
47244755
- error_corrected
4725-
- no_comment_inspection
47264756
description: |
47274757
##### スレッドの先頭のコメントである(`parent_inspection_id` に値がない)場合
47284758
47294759
* `annotator_action_required` - 未処置。`annotation`フェーズ担当者が何らかの回答をする必要あり
47304760
* `no_correction_required` - 処置不要。`annotation`フェーズ担当者が、検査コメントによる修正は不要、と回答した
47314761
* `error_corrected` - 修正済み。`annotation`フェーズ担当者が、検査コメントの指示どおり修正した
4732-
* `no_comment_inspection` - 作成途中。検査コメントの中身が未入力
47334762
47344763
##### 返信コメントである(`parent_inspection_id` に値がある)場合
47354764

generate/swagger/swagger.v2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ info:
115115
116116
上記例 `account_id_count` は、タスクのフィールド `account_id` でタスクを分類したところ「`account_id` が `c5eee002` であるタスクが9件、`9f110e48` であるタスクが5件、`b25dfeb3` であるタスクが1件」だったという結果を表しています。
117117
118-
version: 0.127.0
118+
version: 0.128.0
119119
title: AnnoFab Web API
120120
x-logo:
121121
url: "https://annofab.com/resource/images/logo_landscape.png"

generate/swagger/swagger.yaml

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ info:
116116
上記例 `account_id_count` は、タスクのフィールド `account_id` でタスクを分類したところ「`account_id` が `c5eee002` であるタスクが9件、`9f110e48` であるタスクが5件、`b25dfeb3` であるタスクが1件」だったという結果を表しています。
117117
また、AggregationResultの集約の件数は、合計で10000件以下に制限されており、それを超える件数がある場合は上位10000件が取得されます。もし、省略された部分を取得したい場合は、検索条件を縛って結果に上る集約の数を減らしてください。
118118
119-
version: 0.127.0
119+
version: 0.128.0
120120
title: AnnoFab Web API
121121
x-logo:
122122
url: "https://annofab.com/resource/images/logo_landscape.png"
@@ -2592,6 +2592,46 @@ paths:
25922592
$ref: "swagger-api-components.yaml#/components/responses/ErrorForbiddenResource"
25932593
"503":
25942594
$ref: "swagger-api-components.yaml#/components/responses/ErrorUnderMaintenance"
2595+
/projects/{project_id}/statistics/dates:
2596+
get:
2597+
tags:
2598+
- af-statistics
2599+
summary: プロジェクト統計記録期間取得
2600+
description: |
2601+
プロジェクトの統計情報が記録されている日付期間を取得します。
2602+
2603+
日付期間とは、from(日付)からto(日付)までの連続する日付を指します。fromとtoの日付は期間に含みます。
2604+
2605+
プロジェクトが一度も停止されていない場合、プロジェクト作成日から昨日までの日付期間が一つだけ返ります。
2606+
2607+
プロジェクトを停止した場合、プロジェクトの作成日から停止した日までの日付期間が一つだけ返ります。
2608+
2609+
プロジェクトを再開した場合、統計情報が記録されない(プロジェクトの停止)期間を除いた日付期間が複数返ります。以降、プロジェクトの停止と再開を繰り返すたびに結果の日付期間が増えていきます。
2610+
security:
2611+
- AllProjectMember: []
2612+
operationId: getStatisticsAvailableDates
2613+
parameters:
2614+
- name: project_id
2615+
in: path
2616+
description: プロジェクトID
2617+
required: true
2618+
schema:
2619+
$ref: "swagger-api-components.yaml#/components/schemas/ProjectId"
2620+
responses:
2621+
"200":
2622+
description: 正常
2623+
content:
2624+
application/json:
2625+
schema:
2626+
$ref: "swagger-api-components.yaml#/components/schemas/ArrayOfDateRanges"
2627+
"400":
2628+
$ref: "swagger-api-components.yaml#/components/responses/ErrorInvalidRequest"
2629+
"401":
2630+
$ref: "swagger-api-components.yaml#/components/responses/ErrorUnauthorizedApi"
2631+
"404":
2632+
$ref: "swagger-api-components.yaml#/components/responses/ErrorMissingResource"
2633+
"503":
2634+
$ref: "swagger-api-components.yaml#/components/responses/ErrorUnderMaintenance"
25952635
/projects/{project_id}/statistics/tasks/daily:
25962636
get:
25972637
tags:
@@ -4559,6 +4599,9 @@ paths:
45594599
in: query
45604600
description: |
45614601
過去のフェーズのアノテーションを取得する場合、タスク履歴IDを指定します。未指定時は最新のアノテーションを取得します。
4602+
4603+
過去のアノテーションデータは最後に保存してから30日前のデータまで取得できます。
4604+
30日より前のデータを取得しようとした場合はアノテーションデータは空リストとなります。
45624605
required: false
45634606
schema:
45644607
$ref: "swagger-api-components.yaml#/components/schemas/TaskHistoryId"

0 commit comments

Comments
 (0)