@hexis-ai/engram-server 0.12.0 → 0.13.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/openapi.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "tags": [
9
9
  {
10
10
  "name": "Me",
11
- "description": "識別プローブ"
11
+ "description": "識別プローブ・閲覧可能な workspace/org 一覧"
12
12
  },
13
13
  {
14
14
  "name": "Sessions",
@@ -22,10 +22,22 @@
22
22
  "name": "Persons",
23
23
  "description": "person の作成・更新・検索"
24
24
  },
25
+ {
26
+ "name": "Aliases",
27
+ "description": "ワークスペース横断の alias 解決"
28
+ },
25
29
  {
26
30
  "name": "Identities",
27
31
  "description": "外部 ID(slack: / email: など)の resolve と upsert"
28
32
  },
33
+ {
34
+ "name": "Orgs (self-serve)",
35
+ "description": "engram-web からの cookie 認証 + org-member ロールでの org / workspace / API キー管理"
36
+ },
37
+ {
38
+ "name": "Orgs (admin)",
39
+ "description": "プラットフォーム管理者トークンでの org 管理"
40
+ },
29
41
  {
30
42
  "name": "Workspaces (admin)",
31
43
  "description": "ワークスペースの管理(管理者トークン必須)"
@@ -137,6 +149,80 @@
137
149
  },
138
150
  "additionalProperties": false
139
151
  },
152
+ "SessionUpdate": {
153
+ "type": "object",
154
+ "properties": {
155
+ "title": {
156
+ "anyOf": [
157
+ {
158
+ "type": "string"
159
+ },
160
+ {
161
+ "type": "null"
162
+ }
163
+ ]
164
+ },
165
+ "channel": {
166
+ "anyOf": [
167
+ {
168
+ "type": "string"
169
+ },
170
+ {
171
+ "type": "null"
172
+ }
173
+ ]
174
+ },
175
+ "status": {
176
+ "type": "string",
177
+ "enum": [
178
+ "active",
179
+ "idle",
180
+ "completed"
181
+ ]
182
+ },
183
+ "summary": {
184
+ "anyOf": [
185
+ {
186
+ "type": "string"
187
+ },
188
+ {
189
+ "type": "null"
190
+ }
191
+ ]
192
+ },
193
+ "model": {
194
+ "anyOf": [
195
+ {
196
+ "type": "string"
197
+ },
198
+ {
199
+ "type": "null"
200
+ }
201
+ ]
202
+ },
203
+ "trigger_conversation_id": {
204
+ "anyOf": [
205
+ {
206
+ "type": "string"
207
+ },
208
+ {
209
+ "type": "null"
210
+ }
211
+ ]
212
+ },
213
+ "trigger_event_id": {
214
+ "anyOf": [
215
+ {
216
+ "type": "string"
217
+ },
218
+ {
219
+ "type": "null"
220
+ }
221
+ ]
222
+ }
223
+ },
224
+ "additionalProperties": false
225
+ },
140
226
  "EventBatch": {
141
227
  "type": "object",
142
228
  "properties": {
@@ -406,6 +492,95 @@
406
492
  },
407
493
  "additionalProperties": false
408
494
  },
495
+ "AliasUpsert": {
496
+ "type": "object",
497
+ "properties": {
498
+ "caller": {
499
+ "type": "string",
500
+ "minLength": 1
501
+ },
502
+ "last_used": {
503
+ "type": "string",
504
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}"
505
+ },
506
+ "increment": {
507
+ "type": "boolean"
508
+ }
509
+ },
510
+ "required": [
511
+ "caller",
512
+ "last_used"
513
+ ],
514
+ "additionalProperties": false
515
+ },
516
+ "IdentityUpsert": {
517
+ "type": "object",
518
+ "properties": {
519
+ "person_id": {
520
+ "type": "string",
521
+ "minLength": 1
522
+ },
523
+ "service": {
524
+ "type": "string",
525
+ "minLength": 1
526
+ },
527
+ "external_id": {
528
+ "type": "string",
529
+ "minLength": 1
530
+ },
531
+ "display_name": {
532
+ "anyOf": [
533
+ {
534
+ "type": "string"
535
+ },
536
+ {
537
+ "type": "null"
538
+ }
539
+ ]
540
+ },
541
+ "source": {
542
+ "anyOf": [
543
+ {
544
+ "type": "string"
545
+ },
546
+ {
547
+ "type": "null"
548
+ }
549
+ ]
550
+ },
551
+ "is_primary": {
552
+ "anyOf": [
553
+ {
554
+ "type": "boolean"
555
+ },
556
+ {
557
+ "type": "null"
558
+ }
559
+ ]
560
+ },
561
+ "picture": {
562
+ "anyOf": [
563
+ {
564
+ "type": "string"
565
+ },
566
+ {
567
+ "type": "null"
568
+ }
569
+ ]
570
+ },
571
+ "linked_at": {
572
+ "type": "string",
573
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}"
574
+ }
575
+ },
576
+ "required": [
577
+ "person_id",
578
+ "service",
579
+ "external_id",
580
+ "linked_at"
581
+ ],
582
+ "additionalProperties": false
583
+ },
409
584
  "SearchRequest": {
410
585
  "type": "object",
411
586
  "properties": {
@@ -518,6 +693,72 @@
518
693
  }
519
694
  },
520
695
  "additionalProperties": false
696
+ },
697
+ "CreateOrg": {
698
+ "type": "object",
699
+ "properties": {
700
+ "id": {
701
+ "type": "string"
702
+ },
703
+ "name": {
704
+ "type": "string"
705
+ },
706
+ "metadata": {
707
+ "type": "object",
708
+ "propertyNames": {
709
+ "type": "string"
710
+ },
711
+ "additionalProperties": {}
712
+ }
713
+ },
714
+ "additionalProperties": false
715
+ },
716
+ "OrgPatch": {
717
+ "type": "object",
718
+ "properties": {
719
+ "name": {
720
+ "type": "string"
721
+ },
722
+ "metadata": {
723
+ "type": "object",
724
+ "propertyNames": {
725
+ "type": "string"
726
+ },
727
+ "additionalProperties": {}
728
+ }
729
+ },
730
+ "additionalProperties": false
731
+ },
732
+ "WorkspacePatch": {
733
+ "type": "object",
734
+ "properties": {
735
+ "name": {
736
+ "type": "string"
737
+ },
738
+ "metadata": {
739
+ "type": "object",
740
+ "propertyNames": {
741
+ "type": "string"
742
+ },
743
+ "additionalProperties": {}
744
+ }
745
+ },
746
+ "additionalProperties": false
747
+ },
748
+ "AddMember": {
749
+ "type": "object",
750
+ "properties": {
751
+ "userId": {
752
+ "type": "string"
753
+ },
754
+ "email": {
755
+ "type": "string"
756
+ },
757
+ "role": {
758
+ "type": "string"
759
+ }
760
+ },
761
+ "additionalProperties": false
521
762
  }
522
763
  }
523
764
  },
@@ -538,6 +779,38 @@
538
779
  ]
539
780
  }
540
781
  },
782
+ "/v1/me/workspaces": {
783
+ "get": {
784
+ "summary": "サインイン中のユーザーが閲覧できる workspace 一覧。cookie 認証専用 — workspace 選択前にも到達できるよう workspace ゲートの前段に置かれている。",
785
+ "responses": {
786
+ "200": {
787
+ "description": "workspace 一覧"
788
+ },
789
+ "401": {
790
+ "description": "認証エラー"
791
+ }
792
+ },
793
+ "tags": [
794
+ "Me"
795
+ ]
796
+ }
797
+ },
798
+ "/v1/me/orgs": {
799
+ "get": {
800
+ "summary": "サインイン中のユーザーが member として所属する org 一覧(自分の role 付き)。cookie 認証専用。",
801
+ "responses": {
802
+ "200": {
803
+ "description": "org 一覧"
804
+ },
805
+ "401": {
806
+ "description": "認証エラー"
807
+ }
808
+ },
809
+ "tags": [
810
+ "Me"
811
+ ]
812
+ }
813
+ },
541
814
  "/v1/sessions": {
542
815
  "post": {
543
816
  "summary": "セッションを作成する。",
@@ -1114,6 +1387,33 @@
1114
1387
  ]
1115
1388
  }
1116
1389
  },
1390
+ "/v1/aliases": {
1391
+ "get": {
1392
+ "summary": "ワークスペース全体で alias 名を case-insensitive に逆引き。同名の alias を持つ複数の person を `last_used` desc で返す。`persons` map も同梱。",
1393
+ "parameters": [
1394
+ {
1395
+ "name": "name",
1396
+ "in": "query",
1397
+ "required": true,
1398
+ "schema": {
1399
+ "type": "string"
1400
+ },
1401
+ "description": "alias 名(URL-encoded)。"
1402
+ }
1403
+ ],
1404
+ "responses": {
1405
+ "200": {
1406
+ "description": "alias 一覧 + persons map"
1407
+ },
1408
+ "401": {
1409
+ "description": "認証エラー"
1410
+ }
1411
+ },
1412
+ "tags": [
1413
+ "Aliases"
1414
+ ]
1415
+ }
1416
+ },
1117
1417
  "/v1/identities/{ref}": {
1118
1418
  "put": {
1119
1419
  "summary": "ref(例: `slack:U12345`、`email:foo@bar.com`)で identity を upsert する。",
@@ -1185,6 +1485,984 @@
1185
1485
  ]
1186
1486
  }
1187
1487
  },
1488
+ "/v1/orgs/{id}": {
1489
+ "get": {
1490
+ "summary": "自分が member の org を取得する(自分の role 付き)。",
1491
+ "parameters": [
1492
+ {
1493
+ "name": "id",
1494
+ "in": "path",
1495
+ "required": true,
1496
+ "schema": {
1497
+ "type": "string"
1498
+ },
1499
+ "description": "org id。"
1500
+ }
1501
+ ],
1502
+ "responses": {
1503
+ "200": {
1504
+ "description": "org + role"
1505
+ },
1506
+ "401": {
1507
+ "description": "認証エラー"
1508
+ },
1509
+ "403": {
1510
+ "description": "この org の member ではない"
1511
+ },
1512
+ "404": {
1513
+ "description": "org が見つからない"
1514
+ }
1515
+ },
1516
+ "tags": [
1517
+ "Orgs (self-serve)"
1518
+ ]
1519
+ },
1520
+ "patch": {
1521
+ "summary": "org の name / metadata を更新する(owner / admin のみ)。",
1522
+ "parameters": [
1523
+ {
1524
+ "name": "id",
1525
+ "in": "path",
1526
+ "required": true,
1527
+ "schema": {
1528
+ "type": "string"
1529
+ },
1530
+ "description": "org id。"
1531
+ }
1532
+ ],
1533
+ "requestBody": {
1534
+ "required": true,
1535
+ "content": {
1536
+ "application/json": {
1537
+ "schema": {
1538
+ "$ref": "#/components/schemas/OrgPatch"
1539
+ }
1540
+ }
1541
+ }
1542
+ },
1543
+ "responses": {
1544
+ "200": {
1545
+ "description": "更新後の org"
1546
+ },
1547
+ "401": {
1548
+ "description": "認証エラー"
1549
+ },
1550
+ "403": {
1551
+ "description": "権限不足(owner / admin が必要)"
1552
+ },
1553
+ "404": {
1554
+ "description": "org が見つからない"
1555
+ }
1556
+ },
1557
+ "tags": [
1558
+ "Orgs (self-serve)"
1559
+ ]
1560
+ }
1561
+ },
1562
+ "/v1/orgs/{id}/members": {
1563
+ "get": {
1564
+ "summary": "org の member 一覧。",
1565
+ "parameters": [
1566
+ {
1567
+ "name": "id",
1568
+ "in": "path",
1569
+ "required": true,
1570
+ "schema": {
1571
+ "type": "string"
1572
+ },
1573
+ "description": "org id。"
1574
+ }
1575
+ ],
1576
+ "responses": {
1577
+ "200": {
1578
+ "description": "member 一覧"
1579
+ },
1580
+ "401": {
1581
+ "description": "認証エラー"
1582
+ },
1583
+ "403": {
1584
+ "description": "この org の member ではない"
1585
+ }
1586
+ },
1587
+ "tags": [
1588
+ "Orgs (self-serve)"
1589
+ ]
1590
+ },
1591
+ "post": {
1592
+ "summary": "member を追加する(owner / admin のみ)。`email` か `userId` のいずれかを必須で渡す。",
1593
+ "parameters": [
1594
+ {
1595
+ "name": "id",
1596
+ "in": "path",
1597
+ "required": true,
1598
+ "schema": {
1599
+ "type": "string"
1600
+ },
1601
+ "description": "org id。"
1602
+ }
1603
+ ],
1604
+ "requestBody": {
1605
+ "required": true,
1606
+ "content": {
1607
+ "application/json": {
1608
+ "schema": {
1609
+ "$ref": "#/components/schemas/AddMember"
1610
+ }
1611
+ }
1612
+ }
1613
+ },
1614
+ "responses": {
1615
+ "200": {
1616
+ "description": "追加された membership"
1617
+ },
1618
+ "400": {
1619
+ "description": "`userId` も `email` も無い、または body が不正"
1620
+ },
1621
+ "401": {
1622
+ "description": "認証エラー"
1623
+ },
1624
+ "403": {
1625
+ "description": "権限不足"
1626
+ },
1627
+ "404": {
1628
+ "description": "email から user を解決できない"
1629
+ }
1630
+ },
1631
+ "tags": [
1632
+ "Orgs (self-serve)"
1633
+ ]
1634
+ }
1635
+ },
1636
+ "/v1/orgs/{id}/members/{userId}": {
1637
+ "delete": {
1638
+ "summary": "member を削除する(owner / admin のみ)。最後の owner は削除拒否(`cannot_remove_last_owner`)。",
1639
+ "parameters": [
1640
+ {
1641
+ "name": "id",
1642
+ "in": "path",
1643
+ "required": true,
1644
+ "schema": {
1645
+ "type": "string"
1646
+ },
1647
+ "description": "org id。"
1648
+ },
1649
+ {
1650
+ "name": "userId",
1651
+ "in": "path",
1652
+ "required": true,
1653
+ "schema": {
1654
+ "type": "string"
1655
+ },
1656
+ "description": "user id。"
1657
+ }
1658
+ ],
1659
+ "responses": {
1660
+ "204": {
1661
+ "description": "削除完了"
1662
+ },
1663
+ "400": {
1664
+ "description": "最後の owner は削除できない"
1665
+ },
1666
+ "401": {
1667
+ "description": "認証エラー"
1668
+ },
1669
+ "403": {
1670
+ "description": "権限不足"
1671
+ }
1672
+ },
1673
+ "tags": [
1674
+ "Orgs (self-serve)"
1675
+ ]
1676
+ }
1677
+ },
1678
+ "/v1/orgs/{id}/workspaces": {
1679
+ "get": {
1680
+ "summary": "org の workspace 一覧。",
1681
+ "parameters": [
1682
+ {
1683
+ "name": "id",
1684
+ "in": "path",
1685
+ "required": true,
1686
+ "schema": {
1687
+ "type": "string"
1688
+ },
1689
+ "description": "org id。"
1690
+ }
1691
+ ],
1692
+ "responses": {
1693
+ "200": {
1694
+ "description": "workspace 一覧"
1695
+ },
1696
+ "401": {
1697
+ "description": "認証エラー"
1698
+ },
1699
+ "403": {
1700
+ "description": "この org の member ではない"
1701
+ }
1702
+ },
1703
+ "tags": [
1704
+ "Orgs (self-serve)"
1705
+ ]
1706
+ },
1707
+ "post": {
1708
+ "summary": "workspace を作成し、(issueKey=false でなければ)初期 API キーも発行する。owner / admin のみ。",
1709
+ "parameters": [
1710
+ {
1711
+ "name": "id",
1712
+ "in": "path",
1713
+ "required": true,
1714
+ "schema": {
1715
+ "type": "string"
1716
+ },
1717
+ "description": "org id。"
1718
+ }
1719
+ ],
1720
+ "requestBody": {
1721
+ "required": true,
1722
+ "content": {
1723
+ "application/json": {
1724
+ "schema": {
1725
+ "$ref": "#/components/schemas/CreateWorkspace"
1726
+ }
1727
+ }
1728
+ }
1729
+ },
1730
+ "responses": {
1731
+ "200": {
1732
+ "description": "workspace(issueKey=false でない限り key も含む)"
1733
+ },
1734
+ "400": {
1735
+ "description": "body または workspace id が不正"
1736
+ },
1737
+ "401": {
1738
+ "description": "認証エラー"
1739
+ },
1740
+ "403": {
1741
+ "description": "権限不足"
1742
+ }
1743
+ },
1744
+ "tags": [
1745
+ "Orgs (self-serve)"
1746
+ ]
1747
+ }
1748
+ },
1749
+ "/v1/orgs/{id}/workspaces/{wsId}": {
1750
+ "patch": {
1751
+ "summary": "workspace の name / metadata を更新する(owner / admin のみ)。",
1752
+ "parameters": [
1753
+ {
1754
+ "name": "id",
1755
+ "in": "path",
1756
+ "required": true,
1757
+ "schema": {
1758
+ "type": "string"
1759
+ },
1760
+ "description": "org id。"
1761
+ },
1762
+ {
1763
+ "name": "wsId",
1764
+ "in": "path",
1765
+ "required": true,
1766
+ "schema": {
1767
+ "type": "string"
1768
+ },
1769
+ "description": "workspace id。"
1770
+ }
1771
+ ],
1772
+ "requestBody": {
1773
+ "required": true,
1774
+ "content": {
1775
+ "application/json": {
1776
+ "schema": {
1777
+ "$ref": "#/components/schemas/WorkspacePatch"
1778
+ }
1779
+ }
1780
+ }
1781
+ },
1782
+ "responses": {
1783
+ "200": {
1784
+ "description": "更新後の workspace"
1785
+ },
1786
+ "401": {
1787
+ "description": "認証エラー"
1788
+ },
1789
+ "403": {
1790
+ "description": "権限不足"
1791
+ },
1792
+ "404": {
1793
+ "description": "workspace がこの org に属さない / 存在しない"
1794
+ }
1795
+ },
1796
+ "tags": [
1797
+ "Orgs (self-serve)"
1798
+ ]
1799
+ },
1800
+ "delete": {
1801
+ "summary": "workspace を削除する(セッション・persons・identities・API キーにカスケード)。owner / admin のみ。",
1802
+ "parameters": [
1803
+ {
1804
+ "name": "id",
1805
+ "in": "path",
1806
+ "required": true,
1807
+ "schema": {
1808
+ "type": "string"
1809
+ },
1810
+ "description": "org id。"
1811
+ },
1812
+ {
1813
+ "name": "wsId",
1814
+ "in": "path",
1815
+ "required": true,
1816
+ "schema": {
1817
+ "type": "string"
1818
+ },
1819
+ "description": "workspace id。"
1820
+ }
1821
+ ],
1822
+ "responses": {
1823
+ "204": {
1824
+ "description": "削除完了"
1825
+ },
1826
+ "401": {
1827
+ "description": "認証エラー"
1828
+ },
1829
+ "403": {
1830
+ "description": "権限不足"
1831
+ },
1832
+ "404": {
1833
+ "description": "workspace がこの org に属さない"
1834
+ }
1835
+ },
1836
+ "tags": [
1837
+ "Orgs (self-serve)"
1838
+ ]
1839
+ }
1840
+ },
1841
+ "/v1/orgs/{id}/workspaces/{wsId}/keys": {
1842
+ "get": {
1843
+ "summary": "workspace の API キー一覧(owner / admin のみ)。",
1844
+ "parameters": [
1845
+ {
1846
+ "name": "id",
1847
+ "in": "path",
1848
+ "required": true,
1849
+ "schema": {
1850
+ "type": "string"
1851
+ },
1852
+ "description": "org id。"
1853
+ },
1854
+ {
1855
+ "name": "wsId",
1856
+ "in": "path",
1857
+ "required": true,
1858
+ "schema": {
1859
+ "type": "string"
1860
+ },
1861
+ "description": "workspace id。"
1862
+ }
1863
+ ],
1864
+ "responses": {
1865
+ "200": {
1866
+ "description": "キー一覧"
1867
+ },
1868
+ "401": {
1869
+ "description": "認証エラー"
1870
+ },
1871
+ "403": {
1872
+ "description": "権限不足"
1873
+ },
1874
+ "404": {
1875
+ "description": "workspace がこの org に属さない"
1876
+ }
1877
+ },
1878
+ "tags": [
1879
+ "Orgs (self-serve)"
1880
+ ]
1881
+ },
1882
+ "post": {
1883
+ "summary": "新しい API キーを発行する(owner / admin のみ)。",
1884
+ "parameters": [
1885
+ {
1886
+ "name": "id",
1887
+ "in": "path",
1888
+ "required": true,
1889
+ "schema": {
1890
+ "type": "string"
1891
+ },
1892
+ "description": "org id。"
1893
+ },
1894
+ {
1895
+ "name": "wsId",
1896
+ "in": "path",
1897
+ "required": true,
1898
+ "schema": {
1899
+ "type": "string"
1900
+ },
1901
+ "description": "workspace id。"
1902
+ }
1903
+ ],
1904
+ "requestBody": {
1905
+ "required": false,
1906
+ "content": {
1907
+ "application/json": {
1908
+ "schema": {
1909
+ "$ref": "#/components/schemas/IssueKey"
1910
+ }
1911
+ }
1912
+ }
1913
+ },
1914
+ "responses": {
1915
+ "200": {
1916
+ "description": "発行されたキー(raw は一度のみ返却)"
1917
+ },
1918
+ "401": {
1919
+ "description": "認証エラー"
1920
+ },
1921
+ "403": {
1922
+ "description": "権限不足"
1923
+ },
1924
+ "404": {
1925
+ "description": "workspace がこの org に属さない"
1926
+ }
1927
+ },
1928
+ "tags": [
1929
+ "Orgs (self-serve)"
1930
+ ]
1931
+ }
1932
+ },
1933
+ "/v1/orgs/{id}/workspaces/{wsId}/keys/{keyId}": {
1934
+ "delete": {
1935
+ "summary": "API キーを無効化する(owner / admin のみ)。",
1936
+ "parameters": [
1937
+ {
1938
+ "name": "id",
1939
+ "in": "path",
1940
+ "required": true,
1941
+ "schema": {
1942
+ "type": "string"
1943
+ },
1944
+ "description": "org id。"
1945
+ },
1946
+ {
1947
+ "name": "wsId",
1948
+ "in": "path",
1949
+ "required": true,
1950
+ "schema": {
1951
+ "type": "string"
1952
+ },
1953
+ "description": "workspace id。"
1954
+ },
1955
+ {
1956
+ "name": "keyId",
1957
+ "in": "path",
1958
+ "required": true,
1959
+ "schema": {
1960
+ "type": "string"
1961
+ },
1962
+ "description": "key id。"
1963
+ }
1964
+ ],
1965
+ "responses": {
1966
+ "204": {
1967
+ "description": "無効化完了"
1968
+ },
1969
+ "401": {
1970
+ "description": "認証エラー"
1971
+ },
1972
+ "403": {
1973
+ "description": "権限不足"
1974
+ },
1975
+ "404": {
1976
+ "description": "workspace / key がこの org に属さない、または存在しない"
1977
+ }
1978
+ },
1979
+ "tags": [
1980
+ "Orgs (self-serve)"
1981
+ ]
1982
+ }
1983
+ },
1984
+ "/admin/v1/orgs": {
1985
+ "post": {
1986
+ "summary": "org を作成する。",
1987
+ "security": [
1988
+ {
1989
+ "adminToken": []
1990
+ }
1991
+ ],
1992
+ "requestBody": {
1993
+ "required": true,
1994
+ "content": {
1995
+ "application/json": {
1996
+ "schema": {
1997
+ "$ref": "#/components/schemas/CreateOrg"
1998
+ }
1999
+ }
2000
+ }
2001
+ },
2002
+ "responses": {
2003
+ "200": {
2004
+ "description": "作成された org"
2005
+ },
2006
+ "400": {
2007
+ "description": "body が不正"
2008
+ },
2009
+ "401": {
2010
+ "description": "認証エラー"
2011
+ }
2012
+ },
2013
+ "tags": [
2014
+ "Orgs (admin)"
2015
+ ]
2016
+ },
2017
+ "get": {
2018
+ "summary": "全 org を一覧取得する。",
2019
+ "security": [
2020
+ {
2021
+ "adminToken": []
2022
+ }
2023
+ ],
2024
+ "responses": {
2025
+ "200": {
2026
+ "description": "org 一覧"
2027
+ },
2028
+ "401": {
2029
+ "description": "認証エラー"
2030
+ }
2031
+ },
2032
+ "tags": [
2033
+ "Orgs (admin)"
2034
+ ]
2035
+ }
2036
+ },
2037
+ "/admin/v1/orgs/{id}": {
2038
+ "get": {
2039
+ "summary": "単一の org を取得する。",
2040
+ "security": [
2041
+ {
2042
+ "adminToken": []
2043
+ }
2044
+ ],
2045
+ "parameters": [
2046
+ {
2047
+ "name": "id",
2048
+ "in": "path",
2049
+ "required": true,
2050
+ "schema": {
2051
+ "type": "string"
2052
+ },
2053
+ "description": "org id。"
2054
+ }
2055
+ ],
2056
+ "responses": {
2057
+ "200": {
2058
+ "description": "org"
2059
+ },
2060
+ "401": {
2061
+ "description": "認証エラー"
2062
+ },
2063
+ "404": {
2064
+ "description": "org が見つからない"
2065
+ }
2066
+ },
2067
+ "tags": [
2068
+ "Orgs (admin)"
2069
+ ]
2070
+ },
2071
+ "delete": {
2072
+ "summary": "org を削除する(member と workspace にカスケード)。",
2073
+ "security": [
2074
+ {
2075
+ "adminToken": []
2076
+ }
2077
+ ],
2078
+ "parameters": [
2079
+ {
2080
+ "name": "id",
2081
+ "in": "path",
2082
+ "required": true,
2083
+ "schema": {
2084
+ "type": "string"
2085
+ },
2086
+ "description": "org id。"
2087
+ }
2088
+ ],
2089
+ "responses": {
2090
+ "204": {
2091
+ "description": "削除完了"
2092
+ },
2093
+ "401": {
2094
+ "description": "認証エラー"
2095
+ },
2096
+ "404": {
2097
+ "description": "org が見つからない"
2098
+ }
2099
+ },
2100
+ "tags": [
2101
+ "Orgs (admin)"
2102
+ ]
2103
+ }
2104
+ },
2105
+ "/admin/v1/orgs/{id}/members": {
2106
+ "get": {
2107
+ "summary": "org の member 一覧。",
2108
+ "security": [
2109
+ {
2110
+ "adminToken": []
2111
+ }
2112
+ ],
2113
+ "parameters": [
2114
+ {
2115
+ "name": "id",
2116
+ "in": "path",
2117
+ "required": true,
2118
+ "schema": {
2119
+ "type": "string"
2120
+ },
2121
+ "description": "org id。"
2122
+ }
2123
+ ],
2124
+ "responses": {
2125
+ "200": {
2126
+ "description": "member 一覧"
2127
+ },
2128
+ "401": {
2129
+ "description": "認証エラー"
2130
+ },
2131
+ "404": {
2132
+ "description": "org が見つからない"
2133
+ }
2134
+ },
2135
+ "tags": [
2136
+ "Orgs (admin)"
2137
+ ]
2138
+ },
2139
+ "post": {
2140
+ "summary": "member を追加する(email または userId)。",
2141
+ "security": [
2142
+ {
2143
+ "adminToken": []
2144
+ }
2145
+ ],
2146
+ "parameters": [
2147
+ {
2148
+ "name": "id",
2149
+ "in": "path",
2150
+ "required": true,
2151
+ "schema": {
2152
+ "type": "string"
2153
+ },
2154
+ "description": "org id。"
2155
+ }
2156
+ ],
2157
+ "requestBody": {
2158
+ "required": true,
2159
+ "content": {
2160
+ "application/json": {
2161
+ "schema": {
2162
+ "$ref": "#/components/schemas/AddMember"
2163
+ }
2164
+ }
2165
+ }
2166
+ },
2167
+ "responses": {
2168
+ "200": {
2169
+ "description": "追加された membership"
2170
+ },
2171
+ "400": {
2172
+ "description": "`userId` も `email` も無い、または body が不正"
2173
+ },
2174
+ "401": {
2175
+ "description": "認証エラー"
2176
+ },
2177
+ "404": {
2178
+ "description": "org または email から user を解決できない"
2179
+ }
2180
+ },
2181
+ "tags": [
2182
+ "Orgs (admin)"
2183
+ ]
2184
+ }
2185
+ },
2186
+ "/admin/v1/orgs/{id}/members/{userId}": {
2187
+ "delete": {
2188
+ "summary": "member を削除する。最後の owner は削除拒否(`cannot_remove_last_owner`)。",
2189
+ "security": [
2190
+ {
2191
+ "adminToken": []
2192
+ }
2193
+ ],
2194
+ "parameters": [
2195
+ {
2196
+ "name": "id",
2197
+ "in": "path",
2198
+ "required": true,
2199
+ "schema": {
2200
+ "type": "string"
2201
+ },
2202
+ "description": "org id。"
2203
+ },
2204
+ {
2205
+ "name": "userId",
2206
+ "in": "path",
2207
+ "required": true,
2208
+ "schema": {
2209
+ "type": "string"
2210
+ },
2211
+ "description": "user id。"
2212
+ }
2213
+ ],
2214
+ "responses": {
2215
+ "204": {
2216
+ "description": "削除完了"
2217
+ },
2218
+ "400": {
2219
+ "description": "最後の owner は削除できない"
2220
+ },
2221
+ "401": {
2222
+ "description": "認証エラー"
2223
+ },
2224
+ "404": {
2225
+ "description": "org が見つからない"
2226
+ }
2227
+ },
2228
+ "tags": [
2229
+ "Orgs (admin)"
2230
+ ]
2231
+ }
2232
+ },
2233
+ "/admin/v1/orgs/{id}/workspaces": {
2234
+ "post": {
2235
+ "summary": "org の下に workspace を作成し、(issueKey=false でなければ)初期 API キーも発行する。",
2236
+ "security": [
2237
+ {
2238
+ "adminToken": []
2239
+ }
2240
+ ],
2241
+ "parameters": [
2242
+ {
2243
+ "name": "id",
2244
+ "in": "path",
2245
+ "required": true,
2246
+ "schema": {
2247
+ "type": "string"
2248
+ },
2249
+ "description": "org id。"
2250
+ }
2251
+ ],
2252
+ "requestBody": {
2253
+ "required": true,
2254
+ "content": {
2255
+ "application/json": {
2256
+ "schema": {
2257
+ "$ref": "#/components/schemas/CreateWorkspace"
2258
+ }
2259
+ }
2260
+ }
2261
+ },
2262
+ "responses": {
2263
+ "200": {
2264
+ "description": "workspace(issueKey=false でない限り key も含む)"
2265
+ },
2266
+ "400": {
2267
+ "description": "body または workspace id が不正"
2268
+ },
2269
+ "401": {
2270
+ "description": "認証エラー"
2271
+ },
2272
+ "404": {
2273
+ "description": "org が見つからない"
2274
+ }
2275
+ },
2276
+ "tags": [
2277
+ "Orgs (admin)"
2278
+ ]
2279
+ },
2280
+ "get": {
2281
+ "summary": "org の workspace 一覧。",
2282
+ "security": [
2283
+ {
2284
+ "adminToken": []
2285
+ }
2286
+ ],
2287
+ "parameters": [
2288
+ {
2289
+ "name": "id",
2290
+ "in": "path",
2291
+ "required": true,
2292
+ "schema": {
2293
+ "type": "string"
2294
+ },
2295
+ "description": "org id。"
2296
+ }
2297
+ ],
2298
+ "responses": {
2299
+ "200": {
2300
+ "description": "workspace 一覧"
2301
+ },
2302
+ "401": {
2303
+ "description": "認証エラー"
2304
+ },
2305
+ "404": {
2306
+ "description": "org が見つからない"
2307
+ }
2308
+ },
2309
+ "tags": [
2310
+ "Orgs (admin)"
2311
+ ]
2312
+ }
2313
+ },
2314
+ "/admin/v1/orgs/{id}/workspaces/{wsId}/keys": {
2315
+ "get": {
2316
+ "summary": "org 配下の workspace の API キー一覧(ハッシュのみ)。",
2317
+ "security": [
2318
+ {
2319
+ "adminToken": []
2320
+ }
2321
+ ],
2322
+ "parameters": [
2323
+ {
2324
+ "name": "id",
2325
+ "in": "path",
2326
+ "required": true,
2327
+ "schema": {
2328
+ "type": "string"
2329
+ },
2330
+ "description": "org id。"
2331
+ },
2332
+ {
2333
+ "name": "wsId",
2334
+ "in": "path",
2335
+ "required": true,
2336
+ "schema": {
2337
+ "type": "string"
2338
+ },
2339
+ "description": "workspace id。"
2340
+ }
2341
+ ],
2342
+ "responses": {
2343
+ "200": {
2344
+ "description": "キー一覧"
2345
+ },
2346
+ "401": {
2347
+ "description": "認証エラー"
2348
+ },
2349
+ "404": {
2350
+ "description": "workspace がこの org に属さない / org が無い"
2351
+ }
2352
+ },
2353
+ "tags": [
2354
+ "Orgs (admin)"
2355
+ ]
2356
+ },
2357
+ "post": {
2358
+ "summary": "org 配下の workspace に新しい API キーを発行する。`createWorkspaceUnderOrg` 後のキー rotation に使う。",
2359
+ "security": [
2360
+ {
2361
+ "adminToken": []
2362
+ }
2363
+ ],
2364
+ "parameters": [
2365
+ {
2366
+ "name": "id",
2367
+ "in": "path",
2368
+ "required": true,
2369
+ "schema": {
2370
+ "type": "string"
2371
+ },
2372
+ "description": "org id。"
2373
+ },
2374
+ {
2375
+ "name": "wsId",
2376
+ "in": "path",
2377
+ "required": true,
2378
+ "schema": {
2379
+ "type": "string"
2380
+ },
2381
+ "description": "workspace id。"
2382
+ }
2383
+ ],
2384
+ "requestBody": {
2385
+ "required": false,
2386
+ "content": {
2387
+ "application/json": {
2388
+ "schema": {
2389
+ "$ref": "#/components/schemas/IssueKey"
2390
+ }
2391
+ }
2392
+ }
2393
+ },
2394
+ "responses": {
2395
+ "200": {
2396
+ "description": "発行されたキー(raw は一度のみ返却)"
2397
+ },
2398
+ "400": {
2399
+ "description": "リクエストボディが不正"
2400
+ },
2401
+ "401": {
2402
+ "description": "認証エラー"
2403
+ },
2404
+ "404": {
2405
+ "description": "workspace がこの org に属さない / org が無い"
2406
+ }
2407
+ },
2408
+ "tags": [
2409
+ "Orgs (admin)"
2410
+ ]
2411
+ }
2412
+ },
2413
+ "/admin/v1/orgs/{id}/workspaces/{wsId}/keys/{keyId}": {
2414
+ "delete": {
2415
+ "summary": "org 配下の workspace の API キーを無効化する。",
2416
+ "security": [
2417
+ {
2418
+ "adminToken": []
2419
+ }
2420
+ ],
2421
+ "parameters": [
2422
+ {
2423
+ "name": "id",
2424
+ "in": "path",
2425
+ "required": true,
2426
+ "schema": {
2427
+ "type": "string"
2428
+ },
2429
+ "description": "org id。"
2430
+ },
2431
+ {
2432
+ "name": "wsId",
2433
+ "in": "path",
2434
+ "required": true,
2435
+ "schema": {
2436
+ "type": "string"
2437
+ },
2438
+ "description": "workspace id。"
2439
+ },
2440
+ {
2441
+ "name": "keyId",
2442
+ "in": "path",
2443
+ "required": true,
2444
+ "schema": {
2445
+ "type": "string"
2446
+ },
2447
+ "description": "key id。"
2448
+ }
2449
+ ],
2450
+ "responses": {
2451
+ "204": {
2452
+ "description": "無効化完了"
2453
+ },
2454
+ "401": {
2455
+ "description": "認証エラー"
2456
+ },
2457
+ "404": {
2458
+ "description": "workspace / key がこの org に属さない、または存在しない"
2459
+ }
2460
+ },
2461
+ "tags": [
2462
+ "Orgs (admin)"
2463
+ ]
2464
+ }
2465
+ },
1188
2466
  "/admin/v1/workspaces": {
1189
2467
  "post": {
1190
2468
  "summary": "ワークスペースを作成する(デフォルトで初期キーも発行する)。",