Просмотр исходного кода

✨ (group): 团队邀请链接,打开同意后以只读成员加入

团队成员页「加人」旁加「获取邀请链接」。别人打开链接看到「xxx 邀请你加入团队空间 yyy」,
点同意即以 reader 加入;未登录先看到邀请,登录后回到邀请页再同意。

- POST /v3/groups/{group}/invite-links:owner / manager 签链接
- GET  /v3/group-invites/{token}:公开预览,无效 404
- POST /v3/me/groups {invite}:同意加入,新加入 201、已是成员 200(角色不变),无效 422

链接是签名 token(独立密钥),不落库,7 天有效;接受时再查签发人,签发人被降级或移出则其链接全部失效。
不支持 AI 模型签发或接受。加入走 GroupMemberService::join(以签发人身份调用 add)。
新能力,无对应 v2 端点。

顺带:api-test 重生客户端时 TipitakaExportsApi.php 随规格同步(此前漏生成)。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
visuddhinanda 18 часов назад
Родитель
Сommit
c1a161cb66
46 измененных файлов с 6780 добавлено и 68 удалено
  1. 51 0
      api-test/cases/13_groups.php
  2. 27 0
      api-test/client/.openapi-generator/FILES
  3. 501 0
      api-test/client/lib/Api/GroupInvitesApi.php
  4. 723 50
      api-test/client/lib/Api/GroupsApi.php
  5. 16 2
      api-test/client/lib/Api/TipitakaExportsApi.php
  6. 409 0
      api-test/client/lib/Model/GetApiV3GroupInvitesToken200Response.php
  7. 552 0
      api-test/client/lib/Model/GetApiV3GroupInvitesToken200ResponseData.php
  8. 559 0
      api-test/client/lib/Model/GetApiV3GroupInvitesToken200ResponseDataGroup.php
  9. 627 0
      api-test/client/lib/Model/GetApiV3GroupInvitesToken200ResponseDataInviter.php
  10. 409 0
      api-test/client/lib/Model/PostApiV3GroupsGroupInviteLinks200Response.php
  11. 477 0
      api-test/client/lib/Model/PostApiV3GroupsGroupInviteLinks200ResponseData.php
  12. 409 0
      api-test/client/lib/Model/PostApiV3MeGroups200Response.php
  13. 412 0
      api-test/client/lib/Model/PostApiV3MeGroupsRequest.php
  14. 39 0
      api-v13/app/Http/Controllers/V3/GroupInviteController.php
  15. 43 0
      api-v13/app/Http/Controllers/V3/GroupInviteLinkController.php
  16. 30 2
      api-v13/app/Http/Controllers/V3/MeGroupController.php
  17. 29 0
      api-v13/app/Http/Requests/V3/StoreMeGroupRequest.php
  18. 27 0
      api-v13/app/Http/Resources/V3/GroupInviteLinkResource.php
  19. 47 0
      api-v13/app/Http/Resources/V3/GroupInviteResource.php
  20. 166 0
      api-v13/app/Services/V3/GroupInviteService.php
  21. 32 5
      api-v13/app/Services/V3/GroupMemberService.php
  22. 8 0
      api-v13/app/Services/V3/GroupService.php
  23. 1 0
      api-v13/resources/lang/en/messages.php
  24. 1 0
      api-v13/resources/lang/zh-Hans/messages.php
  25. 15 1
      api-v13/routes/v3/group.php
  26. 193 0
      api-v13/tests/Feature/GroupInviteV3Test.php
  27. 115 0
      dashboard-test/src/tests/group-invite.spec.ts
  28. 8 0
      dashboard-v6/src/Router.tsx
  29. 49 0
      dashboard-v6/src/api/group-invite.ts
  30. 263 2
      dashboard-v6/src/api/schema.d.ts
  31. 9 5
      dashboard-v6/src/components/group/GroupMember.tsx
  32. 81 0
      dashboard-v6/src/components/group/InviteLink.tsx
  33. 5 0
      dashboard-v6/src/locales/en-US/buttons.ts
  34. 6 0
      dashboard-v6/src/locales/en-US/label.ts
  35. 1 0
      dashboard-v6/src/locales/en-US/message.ts
  36. 5 0
      dashboard-v6/src/locales/zh-Hans/buttons.ts
  37. 6 0
      dashboard-v6/src/locales/zh-Hans/label.ts
  38. 1 0
      dashboard-v6/src/locales/zh-Hans/message.ts
  39. 5 0
      dashboard-v6/src/locales/zh-Hant/buttons.ts
  40. 6 0
      dashboard-v6/src/locales/zh-Hant/label.ts
  41. 1 0
      dashboard-v6/src/locales/zh-Hant/message.ts
  42. 162 0
      dashboard-v6/src/pages/team-invite.tsx
  43. 4 0
      openapi/public/assets/protocol/main.yaml
  44. 67 0
      openapi/public/assets/protocol/resources/auto/v3-group-invites-token.yaml
  45. 65 0
      openapi/public/assets/protocol/resources/auto/v3-groups-group-invite-links.yaml
  46. 118 1
      openapi/public/assets/protocol/resources/auto/v3-me-groups.yaml

+ 51 - 0
api-test/cases/13_groups.php

@@ -1,10 +1,12 @@
 <?php
 
+use \WikipaliApi\Api\GroupInvitesApi;
 use \WikipaliApi\Api\GroupsApi;
 use \WikipaliApi\Model\PatchApiV3GroupsGroupMembersMemberRequest;
 use \WikipaliApi\Model\PatchApiV3GroupsGroupRequest;
 use \WikipaliApi\Model\PostApiV3GroupsGroupMembersRequest;
 use \WikipaliApi\Model\PostApiV3GroupsRequest;
+use \WikipaliApi\Model\PostApiV3MeGroupsRequest;
 
 /*
  * v3 团队:/v3/groups(搜索、建、看、改、删)、/v3/me/groups、成员、团队文档。
@@ -225,3 +227,52 @@ test('GET /v3/groups/{group}/shares → 200;(无 token)→ 401', function
     $anon = request(fn () => api(GroupsApi::class)->getApiV3GroupsGroupSharesWithHttpInfo($group));
     assert_status(401, $anon, 'group shares 无 token');
 });
+
+/* ---- 邀请链接 ---- */
+
+test('POST /v3/groups/{group}/invite-links(无 token)→ 401;POST /v3/me/groups(无 token)→ 401', function () {
+    $res = request(fn () => api(GroupsApi::class)->postApiV3GroupsGroupInviteLinksWithHttpInfo('11111111-1111-4111-8111-111111111111'));
+    assert_status(401, $res, 'invite-links 无 token');
+    assert_problem($res, 'invite-links 无 token');
+
+    $body = new PostApiV3MeGroupsRequest();
+    $body->setInvite('a.b.c');
+    $join = request(fn () => api(GroupsApi::class)->postApiV3MeGroupsWithHttpInfo($body));
+    assert_status(401, $join, 'me/groups POST 无 token');
+});
+
+test('GET /v3/group-invites/{token}(伪造)→ 404;POST /v3/me/groups(伪造 / 缺 invite)→ 422', function () {
+    $token = required_token();
+    $fake = request(fn () => api(GroupInvitesApi::class)->getApiV3GroupInvitesTokenWithHttpInfo('a.b.c'));
+    assert_status(404, $fake, '伪造邀请');
+    assert_problem($fake, '伪造邀请');
+
+    $body = new PostApiV3MeGroupsRequest();
+    $body->setInvite('a.b.c');
+    $bad = request(fn () => api(GroupsApi::class, $token)->postApiV3MeGroupsWithHttpInfo($body));
+    assert_status(422, $bad, '伪造邀请加入');
+
+    $missing = raw('POST', '/v3/me/groups', [], [], $token);
+    assert_status(422, $missing, '缺 invite');
+});
+
+test('邀请链接一轮:签发 201 → 不登录打开 200 → 成员再同意 200(角色不变)', function () {
+    $token = required_token();
+    $group = test_group($token);
+
+    $issue = request(fn () => api(GroupsApi::class, $token)->postApiV3GroupsGroupInviteLinksWithHttpInfo($group));
+    assert_status(201, $issue, '签发邀请链接');
+    assert_eq('reader', $issue['body']['data']['role'] ?? null, '邀请链接的角色');
+    $invite = $issue['body']['data']['token'];
+
+    $show = request(fn () => api(GroupInvitesApi::class)->getApiV3GroupInvitesTokenWithHttpInfo($invite));
+    assert_status(200, $show, '打开邀请链接');
+    assert_eq($group, $show['body']['data']['group']['id'] ?? null, '邀请里的团队');
+    assert_eq(null, $show['body']['data']['member_role'] ?? null, '未登录时 member_role');
+
+    $body = new PostApiV3MeGroupsRequest();
+    $body->setInvite($invite);
+    $join = request(fn () => api(GroupsApi::class, $token)->postApiV3MeGroupsWithHttpInfo($body));
+    assert_status(200, $join, '已是成员再同意');
+    assert_eq('owner', $join['body']['data']['role'] ?? null, '再同意后角色不变');
+});

+ 27 - 0
api-test/client/.openapi-generator/FILES

@@ -17,6 +17,7 @@ docs/Api/CreditPolicyApi.md
 docs/Api/DiscussionsApi.md
 docs/Api/EmailCertificationsApi.md
 docs/Api/GlossariesApi.md
+docs/Api/GroupInvitesApi.md
 docs/Api/GroupsApi.md
 docs/Api/HeartbeatApi.md
 docs/Api/InvitesApi.md
@@ -114,6 +115,10 @@ docs/Model/GetApiV3DiscussionsSummary200ResponseDataStatusCounts.md
 docs/Model/GetApiV3GlossariesKind200Response.md
 docs/Model/GetApiV3GlossariesKind200ResponseDataInner.md
 docs/Model/GetApiV3GlossariesKind200ResponseMeta.md
+docs/Model/GetApiV3GroupInvitesToken200Response.md
+docs/Model/GetApiV3GroupInvitesToken200ResponseData.md
+docs/Model/GetApiV3GroupInvitesToken200ResponseDataGroup.md
+docs/Model/GetApiV3GroupInvitesToken200ResponseDataInviter.md
 docs/Model/GetApiV3Groups200Response.md
 docs/Model/GetApiV3Groups200ResponseDataInner.md
 docs/Model/GetApiV3GroupsGroupMembers200Response.md
@@ -242,6 +247,8 @@ docs/Model/PostApiV3DiscussionsDiscussionRepliesRequest.md
 docs/Model/PostApiV3DiscussionsRequest.md
 docs/Model/PostApiV3EmailCertificationsRequest.md
 docs/Model/PostApiV3Groups200Response.md
+docs/Model/PostApiV3GroupsGroupInviteLinks200Response.md
+docs/Model/PostApiV3GroupsGroupInviteLinks200ResponseData.md
 docs/Model/PostApiV3GroupsGroupMembers200Response.md
 docs/Model/PostApiV3GroupsGroupMembersRequest.md
 docs/Model/PostApiV3GroupsRequest.md
@@ -251,6 +258,8 @@ docs/Model/PostApiV3InvitesRequest.md
 docs/Model/PostApiV3MarkupPreviews200Response.md
 docs/Model/PostApiV3MarkupPreviews200ResponseData.md
 docs/Model/PostApiV3MarkupPreviewsRequest.md
+docs/Model/PostApiV3MeGroups200Response.md
+docs/Model/PostApiV3MeGroupsRequest.md
 docs/Model/PostApiV3MeReactions200Response.md
 docs/Model/PostApiV3MeReactionsRequest.md
 docs/Model/PostApiV3MeReadingTime200Response.md
@@ -286,6 +295,7 @@ lib/Api/CreditPolicyApi.php
 lib/Api/DiscussionsApi.php
 lib/Api/EmailCertificationsApi.php
 lib/Api/GlossariesApi.php
+lib/Api/GroupInvitesApi.php
 lib/Api/GroupsApi.php
 lib/Api/HeartbeatApi.php
 lib/Api/InvitesApi.php
@@ -387,6 +397,10 @@ lib/Model/GetApiV3DiscussionsSummary200ResponseDataStatusCounts.php
 lib/Model/GetApiV3GlossariesKind200Response.php
 lib/Model/GetApiV3GlossariesKind200ResponseDataInner.php
 lib/Model/GetApiV3GlossariesKind200ResponseMeta.php
+lib/Model/GetApiV3GroupInvitesToken200Response.php
+lib/Model/GetApiV3GroupInvitesToken200ResponseData.php
+lib/Model/GetApiV3GroupInvitesToken200ResponseDataGroup.php
+lib/Model/GetApiV3GroupInvitesToken200ResponseDataInviter.php
 lib/Model/GetApiV3Groups200Response.php
 lib/Model/GetApiV3Groups200ResponseDataInner.php
 lib/Model/GetApiV3GroupsGroupMembers200Response.php
@@ -516,6 +530,8 @@ lib/Model/PostApiV3DiscussionsDiscussionRepliesRequest.php
 lib/Model/PostApiV3DiscussionsRequest.php
 lib/Model/PostApiV3EmailCertificationsRequest.php
 lib/Model/PostApiV3Groups200Response.php
+lib/Model/PostApiV3GroupsGroupInviteLinks200Response.php
+lib/Model/PostApiV3GroupsGroupInviteLinks200ResponseData.php
 lib/Model/PostApiV3GroupsGroupMembers200Response.php
 lib/Model/PostApiV3GroupsGroupMembersRequest.php
 lib/Model/PostApiV3GroupsRequest.php
@@ -525,6 +541,8 @@ lib/Model/PostApiV3InvitesRequest.php
 lib/Model/PostApiV3MarkupPreviews200Response.php
 lib/Model/PostApiV3MarkupPreviews200ResponseData.php
 lib/Model/PostApiV3MarkupPreviewsRequest.php
+lib/Model/PostApiV3MeGroups200Response.php
+lib/Model/PostApiV3MeGroupsRequest.php
 lib/Model/PostApiV3MeReactions200Response.php
 lib/Model/PostApiV3MeReactionsRequest.php
 lib/Model/PostApiV3MeReadingTime200Response.php
@@ -561,6 +579,7 @@ test/Api/CreditPolicyApiTest.php
 test/Api/DiscussionsApiTest.php
 test/Api/EmailCertificationsApiTest.php
 test/Api/GlossariesApiTest.php
+test/Api/GroupInvitesApiTest.php
 test/Api/GroupsApiTest.php
 test/Api/HeartbeatApiTest.php
 test/Api/InvitesApiTest.php
@@ -658,6 +677,10 @@ test/Model/GetApiV3DiscussionsSummary200ResponseTest.php
 test/Model/GetApiV3GlossariesKind200ResponseDataInnerTest.php
 test/Model/GetApiV3GlossariesKind200ResponseMetaTest.php
 test/Model/GetApiV3GlossariesKind200ResponseTest.php
+test/Model/GetApiV3GroupInvitesToken200ResponseDataGroupTest.php
+test/Model/GetApiV3GroupInvitesToken200ResponseDataInviterTest.php
+test/Model/GetApiV3GroupInvitesToken200ResponseDataTest.php
+test/Model/GetApiV3GroupInvitesToken200ResponseTest.php
 test/Model/GetApiV3Groups200ResponseDataInnerTest.php
 test/Model/GetApiV3Groups200ResponseTest.php
 test/Model/GetApiV3GroupsGroupMembers200ResponseDataInnerTest.php
@@ -786,6 +809,8 @@ test/Model/PostApiV3DiscussionsDiscussionRepliesRequestTest.php
 test/Model/PostApiV3DiscussionsRequestTest.php
 test/Model/PostApiV3EmailCertificationsRequestTest.php
 test/Model/PostApiV3Groups200ResponseTest.php
+test/Model/PostApiV3GroupsGroupInviteLinks200ResponseDataTest.php
+test/Model/PostApiV3GroupsGroupInviteLinks200ResponseTest.php
 test/Model/PostApiV3GroupsGroupMembers200ResponseTest.php
 test/Model/PostApiV3GroupsGroupMembersRequestTest.php
 test/Model/PostApiV3GroupsRequestTest.php
@@ -795,6 +820,8 @@ test/Model/PostApiV3InvitesRequestTest.php
 test/Model/PostApiV3MarkupPreviews200ResponseDataTest.php
 test/Model/PostApiV3MarkupPreviews200ResponseTest.php
 test/Model/PostApiV3MarkupPreviewsRequestTest.php
+test/Model/PostApiV3MeGroups200ResponseTest.php
+test/Model/PostApiV3MeGroupsRequestTest.php
 test/Model/PostApiV3MeReactions200ResponseTest.php
 test/Model/PostApiV3MeReactionsRequestTest.php
 test/Model/PostApiV3MeReadingTime200ResponseDataTest.php

+ 501 - 0
api-test/client/lib/Api/GroupInvitesApi.php

@@ -0,0 +1,501 @@
+<?php
+/**
+ * GroupInvitesApi
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Api;
+
+use GuzzleHttp\Client;
+use GuzzleHttp\ClientInterface;
+use GuzzleHttp\Exception\ConnectException;
+use GuzzleHttp\Exception\RequestException;
+use GuzzleHttp\Psr7\MultipartStream;
+use GuzzleHttp\Psr7\Request;
+use GuzzleHttp\RequestOptions;
+use Psr\Http\Message\RequestInterface;
+use Psr\Http\Message\ResponseInterface;
+use WikipaliApi\ApiException;
+use WikipaliApi\Configuration;
+use WikipaliApi\FormDataProcessor;
+use WikipaliApi\HeaderSelector;
+use WikipaliApi\ObjectSerializer;
+
+/**
+ * GroupInvitesApi Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+class GroupInvitesApi
+{
+    /**
+     * @var ClientInterface
+     */
+    protected $client;
+
+    /**
+     * @var Configuration
+     */
+    protected $config;
+
+    /**
+     * @var HeaderSelector
+     */
+    protected $headerSelector;
+
+    /**
+     * @var int Host index
+     */
+    protected $hostIndex;
+
+    /** @var string[] $contentTypes **/
+    public const contentTypes = [
+        'getApiV3GroupInvitesToken' => [
+            'application/json',
+        ],
+    ];
+
+    /**
+     * @param ClientInterface $client
+     * @param Configuration   $config
+     * @param HeaderSelector  $selector
+     * @param int             $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
+     */
+    public function __construct(
+        ?ClientInterface $client = null,
+        ?Configuration $config = null,
+        ?HeaderSelector $selector = null,
+        int $hostIndex = 0
+    ) {
+        $this->client = $client ?: new Client();
+        $this->config = $config ?: Configuration::getDefaultConfiguration();
+        $this->headerSelector = $selector ?: new HeaderSelector();
+        $this->hostIndex = $hostIndex;
+    }
+
+    /**
+     * Set the host index
+     *
+     * @param int $hostIndex Host index (required)
+     */
+    public function setHostIndex($hostIndex): void
+    {
+        $this->hostIndex = $hostIndex;
+    }
+
+    /**
+     * Get the host index
+     *
+     * @return int Host index
+     */
+    public function getHostIndex()
+    {
+        return $this->hostIndex;
+    }
+
+    /**
+     * @return Configuration
+     */
+    public function getConfig()
+    {
+        return $this->config;
+    }
+
+    /**
+     * Operation getApiV3GroupInvitesToken
+     *
+     * 查看团队邀请
+     *
+     * @param  string $token 邀请链接里的 token (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3GroupInvitesToken'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return \WikipaliApi\Model\GetApiV3GroupInvitesToken200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails
+     */
+    public function getApiV3GroupInvitesToken($token, string $contentType = self::contentTypes['getApiV3GroupInvitesToken'][0])
+    {
+        list($response) = $this->getApiV3GroupInvitesTokenWithHttpInfo($token, $contentType);
+        return $response;
+    }
+
+    /**
+     * Operation getApiV3GroupInvitesTokenWithHttpInfo
+     *
+     * 查看团队邀请
+     *
+     * @param  string $token 邀请链接里的 token (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3GroupInvitesToken'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return array of \WikipaliApi\Model\GetApiV3GroupInvitesToken200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
+     */
+    public function getApiV3GroupInvitesTokenWithHttpInfo($token, string $contentType = self::contentTypes['getApiV3GroupInvitesToken'][0])
+    {
+        $request = $this->getApiV3GroupInvitesTokenRequest($token, $contentType);
+
+        try {
+            $options = $this->createHttpClientOption();
+            try {
+                $response = $this->client->send($request, $options);
+            } catch (RequestException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+                );
+            } catch (ConnectException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    null,
+                    null
+                );
+            }
+
+            $statusCode = $response->getStatusCode();
+
+
+            switch($statusCode) {
+                case 200:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\GetApiV3GroupInvitesToken200Response',
+                        $request,
+                        $response,
+                    );
+                case 404:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+                case 422:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+            }
+
+            
+
+            if ($statusCode < 200 || $statusCode > 299) {
+                throw new ApiException(
+                    sprintf(
+                        '[%d] Error connecting to the API (%s)',
+                        $statusCode,
+                        (string) $request->getUri()
+                    ),
+                    $statusCode,
+                    $response->getHeaders(),
+                    (string) $response->getBody()
+                );
+            }
+
+            return $this->handleResponseWithDataType(
+                '\WikipaliApi\Model\GetApiV3GroupInvitesToken200Response',
+                $request,
+                $response,
+            );
+        } catch (ApiException $e) {
+            switch ($e->getCode()) {
+                case 200:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\GetApiV3GroupInvitesToken200Response',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 404:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 422:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+            }
+        
+
+            throw $e;
+        }
+    }
+
+    /**
+     * Operation getApiV3GroupInvitesTokenAsync
+     *
+     * 查看团队邀请
+     *
+     * @param  string $token 邀请链接里的 token (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3GroupInvitesToken'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function getApiV3GroupInvitesTokenAsync($token, string $contentType = self::contentTypes['getApiV3GroupInvitesToken'][0])
+    {
+        return $this->getApiV3GroupInvitesTokenAsyncWithHttpInfo($token, $contentType)
+            ->then(
+                function ($response) {
+                    return $response[0];
+                }
+            );
+    }
+
+    /**
+     * Operation getApiV3GroupInvitesTokenAsyncWithHttpInfo
+     *
+     * 查看团队邀请
+     *
+     * @param  string $token 邀请链接里的 token (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3GroupInvitesToken'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function getApiV3GroupInvitesTokenAsyncWithHttpInfo($token, string $contentType = self::contentTypes['getApiV3GroupInvitesToken'][0])
+    {
+        $returnType = '\WikipaliApi\Model\GetApiV3GroupInvitesToken200Response';
+        $request = $this->getApiV3GroupInvitesTokenRequest($token, $contentType);
+
+        return $this->client
+            ->sendAsync($request, $this->createHttpClientOption())
+            ->then(
+                function ($response) use ($returnType) {
+                    if ($returnType === '\SplFileObject') {
+                        $content = $response->getBody(); //stream goes to serializer
+                    } else {
+                        $content = (string) $response->getBody();
+                        if ($returnType !== 'string') {
+                            $content = json_decode($content);
+                        }
+                    }
+
+                    return [
+                        ObjectSerializer::deserialize($content, $returnType, []),
+                        $response->getStatusCode(),
+                        $response->getHeaders()
+                    ];
+                },
+                function ($exception) {
+                    $response = $exception->getResponse();
+                    $statusCode = $response->getStatusCode();
+                    throw new ApiException(
+                        sprintf(
+                            '[%d] Error connecting to the API (%s)',
+                            $statusCode,
+                            $exception->getRequest()->getUri()
+                        ),
+                        $statusCode,
+                        $response->getHeaders(),
+                        (string) $response->getBody()
+                    );
+                }
+            );
+    }
+
+    /**
+     * Create request for operation 'getApiV3GroupInvitesToken'
+     *
+     * @param  string $token 邀请链接里的 token (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3GroupInvitesToken'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Psr7\Request
+     */
+    public function getApiV3GroupInvitesTokenRequest($token, string $contentType = self::contentTypes['getApiV3GroupInvitesToken'][0])
+    {
+
+        // verify the required parameter 'token' is set
+        if ($token === null || (is_array($token) && count($token) === 0)) {
+            throw new \InvalidArgumentException(
+                'Missing the required parameter $token when calling getApiV3GroupInvitesToken'
+            );
+        }
+
+
+        $resourcePath = '/v3/group-invites/{token}';
+        $formParams = [];
+        $queryParams = [];
+        $headerParams = [];
+        $httpBody = '';
+        $multipart = false;
+
+
+
+        // path params
+        if ($token !== null) {
+            $resourcePath = str_replace(
+                '{token}',
+                ObjectSerializer::toPathValue($token),
+                $resourcePath
+            );
+        }
+
+
+        $headers = $this->headerSelector->selectHeaders(
+            ['application/json', 'application/problem+json', ],
+            $contentType,
+            $multipart
+        );
+
+        // for model (json/xml)
+        if (count($formParams) > 0) {
+            if ($multipart) {
+                $multipartContents = [];
+                foreach ($formParams as $formParamName => $formParamValue) {
+                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+                    foreach ($formParamValueItems as $formParamValueItem) {
+                        $multipartContents[] = [
+                            'name' => $formParamName,
+                            'contents' => $formParamValueItem
+                        ];
+                    }
+                }
+                // for HTTP post (form)
+                $httpBody = new MultipartStream($multipartContents);
+
+            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+                # if Content-Type contains "application/json", json_encode the form parameters
+                try {
+                    $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR);
+                } catch (\JsonException $e) {
+                    throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
+                }
+            } else {
+                // for HTTP post (form)
+                $httpBody = ObjectSerializer::buildQuery($formParams);
+            }
+        }
+
+        // this endpoint requires Bearer authentication (access token)
+        if (!empty($this->config->getAccessToken())) {
+            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+        }
+
+        $defaultHeaders = [];
+        if ($this->config->getUserAgent()) {
+            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+        }
+
+        $headers = array_merge(
+            $defaultHeaders,
+            $headerParams,
+            $headers
+        );
+
+        $operationHost = $this->config->getHost();
+        $query = ObjectSerializer::buildQuery($queryParams);
+        return new Request(
+            'GET',
+            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+            $headers,
+            $httpBody
+        );
+    }
+
+    /**
+     * Create http client option
+     *
+     * @throws \RuntimeException on file opening failure
+     * @return array of http client options
+     */
+    protected function createHttpClientOption()
+    {
+        $options = [];
+        if ($this->config->getDebug()) {
+            $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a');
+            if (!$options[RequestOptions::DEBUG]) {
+                throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile());
+            }
+        }
+
+        if ($this->config->getCertFile()) {
+            $options[RequestOptions::CERT] = $this->config->getCertFile();
+        }
+
+        if ($this->config->getKeyFile()) {
+            $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile();
+        }
+
+        return $options;
+    }
+
+    private function handleResponseWithDataType(
+        string $dataType,
+        RequestInterface $request,
+        ResponseInterface $response
+    ): array {
+        if ($dataType === '\SplFileObject') {
+            $content = $response->getBody(); //stream goes to serializer
+        } else {
+            $content = (string) $response->getBody();
+            if ($dataType !== 'string') {
+                try {
+                    $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+                } catch (\JsonException $exception) {
+                    throw new ApiException(
+                        sprintf(
+                            'Error JSON decoding server response (%s)',
+                            $request->getUri()
+                        ),
+                        $response->getStatusCode(),
+                        $response->getHeaders(),
+                        $content
+                    );
+                }
+            }
+        }
+
+        return [
+            ObjectSerializer::deserialize($content, $dataType, []),
+            $response->getStatusCode(),
+            $response->getHeaders()
+        ];
+    }
+
+    private function responseWithinRangeCode(
+        string $rangeCode,
+        int $statusCode
+    ): bool {
+        $left = (int) ($rangeCode[0].'00');
+        $right = (int) ($rangeCode[0].'99');
+
+        return $statusCode >= $left && $statusCode <= $right;
+    }
+}

+ 723 - 50
api-test/client/lib/Api/GroupsApi.php

@@ -107,9 +107,15 @@ class GroupsApi
         'postApiV3Groups' => [
             'application/json',
         ],
+        'postApiV3GroupsGroupInviteLinks' => [
+            'application/json',
+        ],
         'postApiV3GroupsGroupMembers' => [
             'application/json',
         ],
+        'postApiV3MeGroups' => [
+            'application/json',
+        ],
     ];
 
     /**
@@ -3641,40 +3647,38 @@ class GroupsApi
     }
 
     /**
-     * Operation postApiV3GroupsGroupMembers
+     * Operation postApiV3GroupsGroupInviteLinks
      *
-     * 加一名成员
+     * 签一张团队邀请链接
      *
      * @param  string $group 团队 uid (required)
-     * @param  \WikipaliApi\Model\PostApiV3GroupsGroupMembersRequest $post_api_v3_groups_group_members_request post_api_v3_groups_group_members_request (required)
-     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupMembers'] to see the possible values for this operation
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupInviteLinks'] to see the possible values for this operation
      *
      * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
      * @throws \InvalidArgumentException
-     * @return \WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response|\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails
+     * @return \WikipaliApi\Model\PostApiV3GroupsGroupInviteLinks200Response|\WikipaliApi\Model\PostApiV3GroupsGroupInviteLinks200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails
      */
-    public function postApiV3GroupsGroupMembers($group, $post_api_v3_groups_group_members_request, string $contentType = self::contentTypes['postApiV3GroupsGroupMembers'][0])
+    public function postApiV3GroupsGroupInviteLinks($group, string $contentType = self::contentTypes['postApiV3GroupsGroupInviteLinks'][0])
     {
-        list($response) = $this->postApiV3GroupsGroupMembersWithHttpInfo($group, $post_api_v3_groups_group_members_request, $contentType);
+        list($response) = $this->postApiV3GroupsGroupInviteLinksWithHttpInfo($group, $contentType);
         return $response;
     }
 
     /**
-     * Operation postApiV3GroupsGroupMembersWithHttpInfo
+     * Operation postApiV3GroupsGroupInviteLinksWithHttpInfo
      *
-     * 加一名成员
+     * 签一张团队邀请链接
      *
      * @param  string $group 团队 uid (required)
-     * @param  \WikipaliApi\Model\PostApiV3GroupsGroupMembersRequest $post_api_v3_groups_group_members_request (required)
-     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupMembers'] to see the possible values for this operation
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupInviteLinks'] to see the possible values for this operation
      *
      * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
      * @throws \InvalidArgumentException
-     * @return array of \WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response|\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
+     * @return array of \WikipaliApi\Model\PostApiV3GroupsGroupInviteLinks200Response|\WikipaliApi\Model\PostApiV3GroupsGroupInviteLinks200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
      */
-    public function postApiV3GroupsGroupMembersWithHttpInfo($group, $post_api_v3_groups_group_members_request, string $contentType = self::contentTypes['postApiV3GroupsGroupMembers'][0])
+    public function postApiV3GroupsGroupInviteLinksWithHttpInfo($group, string $contentType = self::contentTypes['postApiV3GroupsGroupInviteLinks'][0])
     {
-        $request = $this->postApiV3GroupsGroupMembersRequest($group, $post_api_v3_groups_group_members_request, $contentType);
+        $request = $this->postApiV3GroupsGroupInviteLinksRequest($group, $contentType);
 
         try {
             $options = $this->createHttpClientOption();
@@ -3702,13 +3706,13 @@ class GroupsApi
             switch($statusCode) {
                 case 200:
                     return $this->handleResponseWithDataType(
-                        '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
+                        '\WikipaliApi\Model\PostApiV3GroupsGroupInviteLinks200Response',
                         $request,
                         $response,
                     );
                 case 201:
                     return $this->handleResponseWithDataType(
-                        '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
+                        '\WikipaliApi\Model\PostApiV3GroupsGroupInviteLinks200Response',
                         $request,
                         $response,
                     );
@@ -3748,7 +3752,7 @@ class GroupsApi
             }
 
             return $this->handleResponseWithDataType(
-                '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
+                '\WikipaliApi\Model\PostApiV3GroupsGroupInviteLinks200Response',
                 $request,
                 $response,
             );
@@ -3757,7 +3761,7 @@ class GroupsApi
                 case 200:
                     $data = ObjectSerializer::deserialize(
                         $e->getResponseBody(),
-                        '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
+                        '\WikipaliApi\Model\PostApiV3GroupsGroupInviteLinks200Response',
                         $e->getResponseHeaders()
                     );
                     $e->setResponseObject($data);
@@ -3765,7 +3769,7 @@ class GroupsApi
                 case 201:
                     $data = ObjectSerializer::deserialize(
                         $e->getResponseBody(),
-                        '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
+                        '\WikipaliApi\Model\PostApiV3GroupsGroupInviteLinks200Response',
                         $e->getResponseHeaders()
                     );
                     $e->setResponseObject($data);
@@ -3802,20 +3806,19 @@ class GroupsApi
     }
 
     /**
-     * Operation postApiV3GroupsGroupMembersAsync
+     * Operation postApiV3GroupsGroupInviteLinksAsync
      *
-     * 加一名成员
+     * 签一张团队邀请链接
      *
      * @param  string $group 团队 uid (required)
-     * @param  \WikipaliApi\Model\PostApiV3GroupsGroupMembersRequest $post_api_v3_groups_group_members_request (required)
-     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupMembers'] to see the possible values for this operation
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupInviteLinks'] to see the possible values for this operation
      *
      * @throws \InvalidArgumentException
      * @return \GuzzleHttp\Promise\PromiseInterface
      */
-    public function postApiV3GroupsGroupMembersAsync($group, $post_api_v3_groups_group_members_request, string $contentType = self::contentTypes['postApiV3GroupsGroupMembers'][0])
+    public function postApiV3GroupsGroupInviteLinksAsync($group, string $contentType = self::contentTypes['postApiV3GroupsGroupInviteLinks'][0])
     {
-        return $this->postApiV3GroupsGroupMembersAsyncWithHttpInfo($group, $post_api_v3_groups_group_members_request, $contentType)
+        return $this->postApiV3GroupsGroupInviteLinksAsyncWithHttpInfo($group, $contentType)
             ->then(
                 function ($response) {
                     return $response[0];
@@ -3824,21 +3827,20 @@ class GroupsApi
     }
 
     /**
-     * Operation postApiV3GroupsGroupMembersAsyncWithHttpInfo
+     * Operation postApiV3GroupsGroupInviteLinksAsyncWithHttpInfo
      *
-     * 加一名成员
+     * 签一张团队邀请链接
      *
      * @param  string $group 团队 uid (required)
-     * @param  \WikipaliApi\Model\PostApiV3GroupsGroupMembersRequest $post_api_v3_groups_group_members_request (required)
-     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupMembers'] to see the possible values for this operation
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupInviteLinks'] to see the possible values for this operation
      *
      * @throws \InvalidArgumentException
      * @return \GuzzleHttp\Promise\PromiseInterface
      */
-    public function postApiV3GroupsGroupMembersAsyncWithHttpInfo($group, $post_api_v3_groups_group_members_request, string $contentType = self::contentTypes['postApiV3GroupsGroupMembers'][0])
+    public function postApiV3GroupsGroupInviteLinksAsyncWithHttpInfo($group, string $contentType = self::contentTypes['postApiV3GroupsGroupInviteLinks'][0])
     {
-        $returnType = '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response';
-        $request = $this->postApiV3GroupsGroupMembersRequest($group, $post_api_v3_groups_group_members_request, $contentType);
+        $returnType = '\WikipaliApi\Model\PostApiV3GroupsGroupInviteLinks200Response';
+        $request = $this->postApiV3GroupsGroupInviteLinksRequest($group, $contentType);
 
         return $this->client
             ->sendAsync($request, $this->createHttpClientOption())
@@ -3877,34 +3879,26 @@ class GroupsApi
     }
 
     /**
-     * Create request for operation 'postApiV3GroupsGroupMembers'
+     * Create request for operation 'postApiV3GroupsGroupInviteLinks'
      *
      * @param  string $group 团队 uid (required)
-     * @param  \WikipaliApi\Model\PostApiV3GroupsGroupMembersRequest $post_api_v3_groups_group_members_request (required)
-     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupMembers'] to see the possible values for this operation
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupInviteLinks'] to see the possible values for this operation
      *
      * @throws \InvalidArgumentException
      * @return \GuzzleHttp\Psr7\Request
      */
-    public function postApiV3GroupsGroupMembersRequest($group, $post_api_v3_groups_group_members_request, string $contentType = self::contentTypes['postApiV3GroupsGroupMembers'][0])
+    public function postApiV3GroupsGroupInviteLinksRequest($group, string $contentType = self::contentTypes['postApiV3GroupsGroupInviteLinks'][0])
     {
 
         // verify the required parameter 'group' is set
         if ($group === null || (is_array($group) && count($group) === 0)) {
             throw new \InvalidArgumentException(
-                'Missing the required parameter $group when calling postApiV3GroupsGroupMembers'
-            );
-        }
-
-        // verify the required parameter 'post_api_v3_groups_group_members_request' is set
-        if ($post_api_v3_groups_group_members_request === null || (is_array($post_api_v3_groups_group_members_request) && count($post_api_v3_groups_group_members_request) === 0)) {
-            throw new \InvalidArgumentException(
-                'Missing the required parameter $post_api_v3_groups_group_members_request when calling postApiV3GroupsGroupMembers'
+                'Missing the required parameter $group when calling postApiV3GroupsGroupInviteLinks'
             );
         }
 
 
-        $resourcePath = '/v3/groups/{group}/members';
+        $resourcePath = '/v3/groups/{group}/invite-links';
         $formParams = [];
         $queryParams = [];
         $headerParams = [];
@@ -3930,16 +3924,695 @@ class GroupsApi
         );
 
         // for model (json/xml)
-        if (isset($post_api_v3_groups_group_members_request)) {
-            if (stripos($headers['Content-Type'], 'application/json') !== false) {
-                # if Content-Type contains "application/json", json_encode the body
+        if (count($formParams) > 0) {
+            if ($multipart) {
+                $multipartContents = [];
+                foreach ($formParams as $formParamName => $formParamValue) {
+                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+                    foreach ($formParamValueItems as $formParamValueItem) {
+                        $multipartContents[] = [
+                            'name' => $formParamName,
+                            'contents' => $formParamValueItem
+                        ];
+                    }
+                }
+                // for HTTP post (form)
+                $httpBody = new MultipartStream($multipartContents);
+
+            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+                # if Content-Type contains "application/json", json_encode the form parameters
                 try {
-                    $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($post_api_v3_groups_group_members_request), JSON_THROW_ON_ERROR);
+                    $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR);
                 } catch (\JsonException $e) {
                     throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
                 }
             } else {
-                $httpBody = $post_api_v3_groups_group_members_request;
+                // for HTTP post (form)
+                $httpBody = ObjectSerializer::buildQuery($formParams);
+            }
+        }
+
+        // this endpoint requires Bearer authentication (access token)
+        if (!empty($this->config->getAccessToken())) {
+            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+        }
+
+        $defaultHeaders = [];
+        if ($this->config->getUserAgent()) {
+            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+        }
+
+        $headers = array_merge(
+            $defaultHeaders,
+            $headerParams,
+            $headers
+        );
+
+        $operationHost = $this->config->getHost();
+        $query = ObjectSerializer::buildQuery($queryParams);
+        return new Request(
+            'POST',
+            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+            $headers,
+            $httpBody
+        );
+    }
+
+    /**
+     * Operation postApiV3GroupsGroupMembers
+     *
+     * 加一名成员
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  \WikipaliApi\Model\PostApiV3GroupsGroupMembersRequest $post_api_v3_groups_group_members_request post_api_v3_groups_group_members_request (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupMembers'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return \WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response|\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails
+     */
+    public function postApiV3GroupsGroupMembers($group, $post_api_v3_groups_group_members_request, string $contentType = self::contentTypes['postApiV3GroupsGroupMembers'][0])
+    {
+        list($response) = $this->postApiV3GroupsGroupMembersWithHttpInfo($group, $post_api_v3_groups_group_members_request, $contentType);
+        return $response;
+    }
+
+    /**
+     * Operation postApiV3GroupsGroupMembersWithHttpInfo
+     *
+     * 加一名成员
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  \WikipaliApi\Model\PostApiV3GroupsGroupMembersRequest $post_api_v3_groups_group_members_request (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupMembers'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return array of \WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response|\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
+     */
+    public function postApiV3GroupsGroupMembersWithHttpInfo($group, $post_api_v3_groups_group_members_request, string $contentType = self::contentTypes['postApiV3GroupsGroupMembers'][0])
+    {
+        $request = $this->postApiV3GroupsGroupMembersRequest($group, $post_api_v3_groups_group_members_request, $contentType);
+
+        try {
+            $options = $this->createHttpClientOption();
+            try {
+                $response = $this->client->send($request, $options);
+            } catch (RequestException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+                );
+            } catch (ConnectException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    null,
+                    null
+                );
+            }
+
+            $statusCode = $response->getStatusCode();
+
+
+            switch($statusCode) {
+                case 200:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
+                        $request,
+                        $response,
+                    );
+                case 201:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
+                        $request,
+                        $response,
+                    );
+                case 401:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+                case 403:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+                case 422:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+            }
+
+            
+
+            if ($statusCode < 200 || $statusCode > 299) {
+                throw new ApiException(
+                    sprintf(
+                        '[%d] Error connecting to the API (%s)',
+                        $statusCode,
+                        (string) $request->getUri()
+                    ),
+                    $statusCode,
+                    $response->getHeaders(),
+                    (string) $response->getBody()
+                );
+            }
+
+            return $this->handleResponseWithDataType(
+                '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
+                $request,
+                $response,
+            );
+        } catch (ApiException $e) {
+            switch ($e->getCode()) {
+                case 200:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 201:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 401:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 403:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 422:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+            }
+        
+
+            throw $e;
+        }
+    }
+
+    /**
+     * Operation postApiV3GroupsGroupMembersAsync
+     *
+     * 加一名成员
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  \WikipaliApi\Model\PostApiV3GroupsGroupMembersRequest $post_api_v3_groups_group_members_request (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupMembers'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function postApiV3GroupsGroupMembersAsync($group, $post_api_v3_groups_group_members_request, string $contentType = self::contentTypes['postApiV3GroupsGroupMembers'][0])
+    {
+        return $this->postApiV3GroupsGroupMembersAsyncWithHttpInfo($group, $post_api_v3_groups_group_members_request, $contentType)
+            ->then(
+                function ($response) {
+                    return $response[0];
+                }
+            );
+    }
+
+    /**
+     * Operation postApiV3GroupsGroupMembersAsyncWithHttpInfo
+     *
+     * 加一名成员
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  \WikipaliApi\Model\PostApiV3GroupsGroupMembersRequest $post_api_v3_groups_group_members_request (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupMembers'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function postApiV3GroupsGroupMembersAsyncWithHttpInfo($group, $post_api_v3_groups_group_members_request, string $contentType = self::contentTypes['postApiV3GroupsGroupMembers'][0])
+    {
+        $returnType = '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response';
+        $request = $this->postApiV3GroupsGroupMembersRequest($group, $post_api_v3_groups_group_members_request, $contentType);
+
+        return $this->client
+            ->sendAsync($request, $this->createHttpClientOption())
+            ->then(
+                function ($response) use ($returnType) {
+                    if ($returnType === '\SplFileObject') {
+                        $content = $response->getBody(); //stream goes to serializer
+                    } else {
+                        $content = (string) $response->getBody();
+                        if ($returnType !== 'string') {
+                            $content = json_decode($content);
+                        }
+                    }
+
+                    return [
+                        ObjectSerializer::deserialize($content, $returnType, []),
+                        $response->getStatusCode(),
+                        $response->getHeaders()
+                    ];
+                },
+                function ($exception) {
+                    $response = $exception->getResponse();
+                    $statusCode = $response->getStatusCode();
+                    throw new ApiException(
+                        sprintf(
+                            '[%d] Error connecting to the API (%s)',
+                            $statusCode,
+                            $exception->getRequest()->getUri()
+                        ),
+                        $statusCode,
+                        $response->getHeaders(),
+                        (string) $response->getBody()
+                    );
+                }
+            );
+    }
+
+    /**
+     * Create request for operation 'postApiV3GroupsGroupMembers'
+     *
+     * @param  string $group 团队 uid (required)
+     * @param  \WikipaliApi\Model\PostApiV3GroupsGroupMembersRequest $post_api_v3_groups_group_members_request (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3GroupsGroupMembers'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Psr7\Request
+     */
+    public function postApiV3GroupsGroupMembersRequest($group, $post_api_v3_groups_group_members_request, string $contentType = self::contentTypes['postApiV3GroupsGroupMembers'][0])
+    {
+
+        // verify the required parameter 'group' is set
+        if ($group === null || (is_array($group) && count($group) === 0)) {
+            throw new \InvalidArgumentException(
+                'Missing the required parameter $group when calling postApiV3GroupsGroupMembers'
+            );
+        }
+
+        // verify the required parameter 'post_api_v3_groups_group_members_request' is set
+        if ($post_api_v3_groups_group_members_request === null || (is_array($post_api_v3_groups_group_members_request) && count($post_api_v3_groups_group_members_request) === 0)) {
+            throw new \InvalidArgumentException(
+                'Missing the required parameter $post_api_v3_groups_group_members_request when calling postApiV3GroupsGroupMembers'
+            );
+        }
+
+
+        $resourcePath = '/v3/groups/{group}/members';
+        $formParams = [];
+        $queryParams = [];
+        $headerParams = [];
+        $httpBody = '';
+        $multipart = false;
+
+
+
+        // path params
+        if ($group !== null) {
+            $resourcePath = str_replace(
+                '{group}',
+                ObjectSerializer::toPathValue($group),
+                $resourcePath
+            );
+        }
+
+
+        $headers = $this->headerSelector->selectHeaders(
+            ['application/json', 'application/problem+json', ],
+            $contentType,
+            $multipart
+        );
+
+        // for model (json/xml)
+        if (isset($post_api_v3_groups_group_members_request)) {
+            if (stripos($headers['Content-Type'], 'application/json') !== false) {
+                # if Content-Type contains "application/json", json_encode the body
+                try {
+                    $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($post_api_v3_groups_group_members_request), JSON_THROW_ON_ERROR);
+                } catch (\JsonException $e) {
+                    throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
+                }
+            } else {
+                $httpBody = $post_api_v3_groups_group_members_request;
+            }
+        } elseif (count($formParams) > 0) {
+            if ($multipart) {
+                $multipartContents = [];
+                foreach ($formParams as $formParamName => $formParamValue) {
+                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+                    foreach ($formParamValueItems as $formParamValueItem) {
+                        $multipartContents[] = [
+                            'name' => $formParamName,
+                            'contents' => $formParamValueItem
+                        ];
+                    }
+                }
+                // for HTTP post (form)
+                $httpBody = new MultipartStream($multipartContents);
+
+            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+                # if Content-Type contains "application/json", json_encode the form parameters
+                try {
+                    $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR);
+                } catch (\JsonException $e) {
+                    throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
+                }
+            } else {
+                // for HTTP post (form)
+                $httpBody = ObjectSerializer::buildQuery($formParams);
+            }
+        }
+
+        // this endpoint requires Bearer authentication (access token)
+        if (!empty($this->config->getAccessToken())) {
+            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+        }
+
+        $defaultHeaders = [];
+        if ($this->config->getUserAgent()) {
+            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+        }
+
+        $headers = array_merge(
+            $defaultHeaders,
+            $headerParams,
+            $headers
+        );
+
+        $operationHost = $this->config->getHost();
+        $query = ObjectSerializer::buildQuery($queryParams);
+        return new Request(
+            'POST',
+            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+            $headers,
+            $httpBody
+        );
+    }
+
+    /**
+     * Operation postApiV3MeGroups
+     *
+     * 凭邀请链接加入团队
+     *
+     * @param  \WikipaliApi\Model\PostApiV3MeGroupsRequest $post_api_v3_me_groups_request post_api_v3_me_groups_request (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3MeGroups'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return \WikipaliApi\Model\PostApiV3MeGroups200Response|\WikipaliApi\Model\PostApiV3MeGroups200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails
+     */
+    public function postApiV3MeGroups($post_api_v3_me_groups_request, string $contentType = self::contentTypes['postApiV3MeGroups'][0])
+    {
+        list($response) = $this->postApiV3MeGroupsWithHttpInfo($post_api_v3_me_groups_request, $contentType);
+        return $response;
+    }
+
+    /**
+     * Operation postApiV3MeGroupsWithHttpInfo
+     *
+     * 凭邀请链接加入团队
+     *
+     * @param  \WikipaliApi\Model\PostApiV3MeGroupsRequest $post_api_v3_me_groups_request (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3MeGroups'] to see the possible values for this operation
+     *
+     * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
+     * @throws \InvalidArgumentException
+     * @return array of \WikipaliApi\Model\PostApiV3MeGroups200Response|\WikipaliApi\Model\PostApiV3MeGroups200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
+     */
+    public function postApiV3MeGroupsWithHttpInfo($post_api_v3_me_groups_request, string $contentType = self::contentTypes['postApiV3MeGroups'][0])
+    {
+        $request = $this->postApiV3MeGroupsRequest($post_api_v3_me_groups_request, $contentType);
+
+        try {
+            $options = $this->createHttpClientOption();
+            try {
+                $response = $this->client->send($request, $options);
+            } catch (RequestException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+                );
+            } catch (ConnectException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    null,
+                    null
+                );
+            }
+
+            $statusCode = $response->getStatusCode();
+
+
+            switch($statusCode) {
+                case 200:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\PostApiV3MeGroups200Response',
+                        $request,
+                        $response,
+                    );
+                case 201:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\PostApiV3MeGroups200Response',
+                        $request,
+                        $response,
+                    );
+                case 401:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+                case 403:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+                case 422:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+            }
+
+            
+
+            if ($statusCode < 200 || $statusCode > 299) {
+                throw new ApiException(
+                    sprintf(
+                        '[%d] Error connecting to the API (%s)',
+                        $statusCode,
+                        (string) $request->getUri()
+                    ),
+                    $statusCode,
+                    $response->getHeaders(),
+                    (string) $response->getBody()
+                );
+            }
+
+            return $this->handleResponseWithDataType(
+                '\WikipaliApi\Model\PostApiV3MeGroups200Response',
+                $request,
+                $response,
+            );
+        } catch (ApiException $e) {
+            switch ($e->getCode()) {
+                case 200:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\PostApiV3MeGroups200Response',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 201:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\PostApiV3MeGroups200Response',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 401:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 403:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 422:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+            }
+        
+
+            throw $e;
+        }
+    }
+
+    /**
+     * Operation postApiV3MeGroupsAsync
+     *
+     * 凭邀请链接加入团队
+     *
+     * @param  \WikipaliApi\Model\PostApiV3MeGroupsRequest $post_api_v3_me_groups_request (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3MeGroups'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function postApiV3MeGroupsAsync($post_api_v3_me_groups_request, string $contentType = self::contentTypes['postApiV3MeGroups'][0])
+    {
+        return $this->postApiV3MeGroupsAsyncWithHttpInfo($post_api_v3_me_groups_request, $contentType)
+            ->then(
+                function ($response) {
+                    return $response[0];
+                }
+            );
+    }
+
+    /**
+     * Operation postApiV3MeGroupsAsyncWithHttpInfo
+     *
+     * 凭邀请链接加入团队
+     *
+     * @param  \WikipaliApi\Model\PostApiV3MeGroupsRequest $post_api_v3_me_groups_request (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3MeGroups'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function postApiV3MeGroupsAsyncWithHttpInfo($post_api_v3_me_groups_request, string $contentType = self::contentTypes['postApiV3MeGroups'][0])
+    {
+        $returnType = '\WikipaliApi\Model\PostApiV3MeGroups200Response';
+        $request = $this->postApiV3MeGroupsRequest($post_api_v3_me_groups_request, $contentType);
+
+        return $this->client
+            ->sendAsync($request, $this->createHttpClientOption())
+            ->then(
+                function ($response) use ($returnType) {
+                    if ($returnType === '\SplFileObject') {
+                        $content = $response->getBody(); //stream goes to serializer
+                    } else {
+                        $content = (string) $response->getBody();
+                        if ($returnType !== 'string') {
+                            $content = json_decode($content);
+                        }
+                    }
+
+                    return [
+                        ObjectSerializer::deserialize($content, $returnType, []),
+                        $response->getStatusCode(),
+                        $response->getHeaders()
+                    ];
+                },
+                function ($exception) {
+                    $response = $exception->getResponse();
+                    $statusCode = $response->getStatusCode();
+                    throw new ApiException(
+                        sprintf(
+                            '[%d] Error connecting to the API (%s)',
+                            $statusCode,
+                            $exception->getRequest()->getUri()
+                        ),
+                        $statusCode,
+                        $response->getHeaders(),
+                        (string) $response->getBody()
+                    );
+                }
+            );
+    }
+
+    /**
+     * Create request for operation 'postApiV3MeGroups'
+     *
+     * @param  \WikipaliApi\Model\PostApiV3MeGroupsRequest $post_api_v3_me_groups_request (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['postApiV3MeGroups'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Psr7\Request
+     */
+    public function postApiV3MeGroupsRequest($post_api_v3_me_groups_request, string $contentType = self::contentTypes['postApiV3MeGroups'][0])
+    {
+
+        // verify the required parameter 'post_api_v3_me_groups_request' is set
+        if ($post_api_v3_me_groups_request === null || (is_array($post_api_v3_me_groups_request) && count($post_api_v3_me_groups_request) === 0)) {
+            throw new \InvalidArgumentException(
+                'Missing the required parameter $post_api_v3_me_groups_request when calling postApiV3MeGroups'
+            );
+        }
+
+
+        $resourcePath = '/v3/me/groups';
+        $formParams = [];
+        $queryParams = [];
+        $headerParams = [];
+        $httpBody = '';
+        $multipart = false;
+
+
+
+
+
+        $headers = $this->headerSelector->selectHeaders(
+            ['application/json', 'application/problem+json', ],
+            $contentType,
+            $multipart
+        );
+
+        // for model (json/xml)
+        if (isset($post_api_v3_me_groups_request)) {
+            if (stripos($headers['Content-Type'], 'application/json') !== false) {
+                # if Content-Type contains "application/json", json_encode the body
+                try {
+                    $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($post_api_v3_me_groups_request), JSON_THROW_ON_ERROR);
+                } catch (\JsonException $e) {
+                    throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
+                }
+            } else {
+                $httpBody = $post_api_v3_me_groups_request;
             }
         } elseif (count($formParams) > 0) {
             if ($multipart) {

+ 16 - 2
api-test/client/lib/Api/TipitakaExportsApi.php

@@ -433,7 +433,7 @@ class TipitakaExportsApi
      *
      * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
      * @throws \InvalidArgumentException
-     * @return \SplFileObject|\SplFileObject|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails
+     * @return \SplFileObject|\SplFileObject|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails
      */
     public function getApiV3TipitakaExportsExportFile($export, $expires, $signature, string $contentType = self::contentTypes['getApiV3TipitakaExportsExportFile'][0])
     {
@@ -453,7 +453,7 @@ class TipitakaExportsApi
      *
      * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
      * @throws \InvalidArgumentException
-     * @return array of \SplFileObject|\SplFileObject|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
+     * @return array of \SplFileObject|\SplFileObject|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
      */
     public function getApiV3TipitakaExportsExportFileWithHttpInfo($export, $expires, $signature, string $contentType = self::contentTypes['getApiV3TipitakaExportsExportFile'][0])
     {
@@ -495,6 +495,12 @@ class TipitakaExportsApi
                         $request,
                         $response,
                     );
+                case 302:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
                 case 403:
                     return $this->handleResponseWithDataType(
                         '\WikipaliApi\Model\ProblemDetails',
@@ -559,6 +565,14 @@ class TipitakaExportsApi
                     );
                     $e->setResponseObject($data);
                     throw $e;
+                case 302:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
                 case 403:
                     $data = ObjectSerializer::deserialize(
                         $e->getResponseBody(),

+ 409 - 0
api-test/client/lib/Model/GetApiV3GroupInvitesToken200Response.php

@@ -0,0 +1,409 @@
+<?php
+/**
+ * GetApiV3GroupInvitesToken200Response
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3GroupInvitesToken200Response Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3GroupInvitesToken200Response implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_group_invites_token__200_response';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'data' => '\WikipaliApi\Model\GetApiV3GroupInvitesToken200ResponseData'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'data' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'data' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'data' => 'data'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'data' => 'setData'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'data' => 'getData'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('data', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets data
+     *
+     * @return \WikipaliApi\Model\GetApiV3GroupInvitesToken200ResponseData|null
+     */
+    public function getData()
+    {
+        return $this->container['data'];
+    }
+
+    /**
+     * Sets data
+     *
+     * @param \WikipaliApi\Model\GetApiV3GroupInvitesToken200ResponseData|null $data data
+     *
+     * @return self
+     */
+    public function setData($data)
+    {
+        if (is_null($data)) {
+            throw new \InvalidArgumentException('non-nullable data cannot be null');
+        }
+        $this->container['data'] = $data;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 552 - 0
api-test/client/lib/Model/GetApiV3GroupInvitesToken200ResponseData.php

@@ -0,0 +1,552 @@
+<?php
+/**
+ * GetApiV3GroupInvitesToken200ResponseData
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3GroupInvitesToken200ResponseData Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3GroupInvitesToken200ResponseData implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_group_invites_token__200_response_data';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'group' => '\WikipaliApi\Model\GetApiV3GroupInvitesToken200ResponseDataGroup',
+        'inviter' => '\WikipaliApi\Model\GetApiV3GroupInvitesToken200ResponseDataInviter',
+        'role' => 'string',
+        'expires_at' => 'string',
+        'member_role' => 'string'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'group' => null,
+        'inviter' => null,
+        'role' => null,
+        'expires_at' => null,
+        'member_role' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'group' => false,
+        'inviter' => false,
+        'role' => false,
+        'expires_at' => false,
+        'member_role' => true
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'group' => 'group',
+        'inviter' => 'inviter',
+        'role' => 'role',
+        'expires_at' => 'expires_at',
+        'member_role' => 'member_role'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'group' => 'setGroup',
+        'inviter' => 'setInviter',
+        'role' => 'setRole',
+        'expires_at' => 'setExpiresAt',
+        'member_role' => 'setMemberRole'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'group' => 'getGroup',
+        'inviter' => 'getInviter',
+        'role' => 'getRole',
+        'expires_at' => 'getExpiresAt',
+        'member_role' => 'getMemberRole'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('group', $data ?? [], null);
+        $this->setIfExists('inviter', $data ?? [], null);
+        $this->setIfExists('role', $data ?? [], null);
+        $this->setIfExists('expires_at', $data ?? [], null);
+        $this->setIfExists('member_role', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets group
+     *
+     * @return \WikipaliApi\Model\GetApiV3GroupInvitesToken200ResponseDataGroup|null
+     */
+    public function getGroup()
+    {
+        return $this->container['group'];
+    }
+
+    /**
+     * Sets group
+     *
+     * @param \WikipaliApi\Model\GetApiV3GroupInvitesToken200ResponseDataGroup|null $group group
+     *
+     * @return self
+     */
+    public function setGroup($group)
+    {
+        if (is_null($group)) {
+            throw new \InvalidArgumentException('non-nullable group cannot be null');
+        }
+        $this->container['group'] = $group;
+
+        return $this;
+    }
+
+    /**
+     * Gets inviter
+     *
+     * @return \WikipaliApi\Model\GetApiV3GroupInvitesToken200ResponseDataInviter|null
+     */
+    public function getInviter()
+    {
+        return $this->container['inviter'];
+    }
+
+    /**
+     * Sets inviter
+     *
+     * @param \WikipaliApi\Model\GetApiV3GroupInvitesToken200ResponseDataInviter|null $inviter inviter
+     *
+     * @return self
+     */
+    public function setInviter($inviter)
+    {
+        if (is_null($inviter)) {
+            throw new \InvalidArgumentException('non-nullable inviter cannot be null');
+        }
+        $this->container['inviter'] = $inviter;
+
+        return $this;
+    }
+
+    /**
+     * Gets role
+     *
+     * @return string|null
+     */
+    public function getRole()
+    {
+        return $this->container['role'];
+    }
+
+    /**
+     * Sets role
+     *
+     * @param string|null $role role
+     *
+     * @return self
+     */
+    public function setRole($role)
+    {
+        if (is_null($role)) {
+            throw new \InvalidArgumentException('non-nullable role cannot be null');
+        }
+        $this->container['role'] = $role;
+
+        return $this;
+    }
+
+    /**
+     * Gets expires_at
+     *
+     * @return string|null
+     */
+    public function getExpiresAt()
+    {
+        return $this->container['expires_at'];
+    }
+
+    /**
+     * Sets expires_at
+     *
+     * @param string|null $expires_at expires_at
+     *
+     * @return self
+     */
+    public function setExpiresAt($expires_at)
+    {
+        if (is_null($expires_at)) {
+            throw new \InvalidArgumentException('non-nullable expires_at cannot be null');
+        }
+        $this->container['expires_at'] = $expires_at;
+
+        return $this;
+    }
+
+    /**
+     * Gets member_role
+     *
+     * @return string|null
+     */
+    public function getMemberRole()
+    {
+        return $this->container['member_role'];
+    }
+
+    /**
+     * Sets member_role
+     *
+     * @param string|null $member_role member_role
+     *
+     * @return self
+     */
+    public function setMemberRole($member_role)
+    {
+        if (is_null($member_role)) {
+            array_push($this->openAPINullablesSetToNull, 'member_role');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('member_role', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['member_role'] = $member_role;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 559 - 0
api-test/client/lib/Model/GetApiV3GroupInvitesToken200ResponseDataGroup.php

@@ -0,0 +1,559 @@
+<?php
+/**
+ * GetApiV3GroupInvitesToken200ResponseDataGroup
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3GroupInvitesToken200ResponseDataGroup Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3GroupInvitesToken200ResponseDataGroup implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_group_invites_token__200_response_data_group';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'id' => 'string',
+        'name' => 'string',
+        'description' => 'string',
+        'status' => 'int',
+        'owner' => '\WikipaliApi\Model\GetApiV3AdminAgentRuns200ResponseDataInnerUser'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'id' => null,
+        'name' => null,
+        'description' => null,
+        'status' => null,
+        'owner' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'id' => false,
+        'name' => false,
+        'description' => true,
+        'status' => false,
+        'owner' => true
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'id' => 'id',
+        'name' => 'name',
+        'description' => 'description',
+        'status' => 'status',
+        'owner' => 'owner'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'id' => 'setId',
+        'name' => 'setName',
+        'description' => 'setDescription',
+        'status' => 'setStatus',
+        'owner' => 'setOwner'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'id' => 'getId',
+        'name' => 'getName',
+        'description' => 'getDescription',
+        'status' => 'getStatus',
+        'owner' => 'getOwner'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('id', $data ?? [], null);
+        $this->setIfExists('name', $data ?? [], null);
+        $this->setIfExists('description', $data ?? [], null);
+        $this->setIfExists('status', $data ?? [], null);
+        $this->setIfExists('owner', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets id
+     *
+     * @return string|null
+     */
+    public function getId()
+    {
+        return $this->container['id'];
+    }
+
+    /**
+     * Sets id
+     *
+     * @param string|null $id id
+     *
+     * @return self
+     */
+    public function setId($id)
+    {
+        if (is_null($id)) {
+            throw new \InvalidArgumentException('non-nullable id cannot be null');
+        }
+        $this->container['id'] = $id;
+
+        return $this;
+    }
+
+    /**
+     * Gets name
+     *
+     * @return string|null
+     */
+    public function getName()
+    {
+        return $this->container['name'];
+    }
+
+    /**
+     * Sets name
+     *
+     * @param string|null $name name
+     *
+     * @return self
+     */
+    public function setName($name)
+    {
+        if (is_null($name)) {
+            throw new \InvalidArgumentException('non-nullable name cannot be null');
+        }
+        $this->container['name'] = $name;
+
+        return $this;
+    }
+
+    /**
+     * Gets description
+     *
+     * @return string|null
+     */
+    public function getDescription()
+    {
+        return $this->container['description'];
+    }
+
+    /**
+     * Sets description
+     *
+     * @param string|null $description description
+     *
+     * @return self
+     */
+    public function setDescription($description)
+    {
+        if (is_null($description)) {
+            array_push($this->openAPINullablesSetToNull, 'description');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('description', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['description'] = $description;
+
+        return $this;
+    }
+
+    /**
+     * Gets status
+     *
+     * @return int|null
+     */
+    public function getStatus()
+    {
+        return $this->container['status'];
+    }
+
+    /**
+     * Sets status
+     *
+     * @param int|null $status status
+     *
+     * @return self
+     */
+    public function setStatus($status)
+    {
+        if (is_null($status)) {
+            throw new \InvalidArgumentException('non-nullable status cannot be null');
+        }
+        $this->container['status'] = $status;
+
+        return $this;
+    }
+
+    /**
+     * Gets owner
+     *
+     * @return \WikipaliApi\Model\GetApiV3AdminAgentRuns200ResponseDataInnerUser|null
+     */
+    public function getOwner()
+    {
+        return $this->container['owner'];
+    }
+
+    /**
+     * Sets owner
+     *
+     * @param \WikipaliApi\Model\GetApiV3AdminAgentRuns200ResponseDataInnerUser|null $owner owner
+     *
+     * @return self
+     */
+    public function setOwner($owner)
+    {
+        if (is_null($owner)) {
+            array_push($this->openAPINullablesSetToNull, 'owner');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('owner', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['owner'] = $owner;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 627 - 0
api-test/client/lib/Model/GetApiV3GroupInvitesToken200ResponseDataInviter.php

@@ -0,0 +1,627 @@
+<?php
+/**
+ * GetApiV3GroupInvitesToken200ResponseDataInviter
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3GroupInvitesToken200ResponseDataInviter Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3GroupInvitesToken200ResponseDataInviter implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_group_invites_token__200_response_data_inviter';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'id' => 'string',
+        'nick_name' => 'string',
+        'user_name' => 'string',
+        'real_name' => 'string',
+        'sn' => 'int',
+        'avatar' => 'string',
+        'roles' => 'string[]'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'id' => null,
+        'nick_name' => null,
+        'user_name' => null,
+        'real_name' => null,
+        'sn' => null,
+        'avatar' => null,
+        'roles' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'id' => false,
+        'nick_name' => false,
+        'user_name' => false,
+        'real_name' => false,
+        'sn' => false,
+        'avatar' => true,
+        'roles' => true
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'id' => 'id',
+        'nick_name' => 'nickName',
+        'user_name' => 'userName',
+        'real_name' => 'realName',
+        'sn' => 'sn',
+        'avatar' => 'avatar',
+        'roles' => 'roles'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'id' => 'setId',
+        'nick_name' => 'setNickName',
+        'user_name' => 'setUserName',
+        'real_name' => 'setRealName',
+        'sn' => 'setSn',
+        'avatar' => 'setAvatar',
+        'roles' => 'setRoles'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'id' => 'getId',
+        'nick_name' => 'getNickName',
+        'user_name' => 'getUserName',
+        'real_name' => 'getRealName',
+        'sn' => 'getSn',
+        'avatar' => 'getAvatar',
+        'roles' => 'getRoles'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('id', $data ?? [], null);
+        $this->setIfExists('nick_name', $data ?? [], null);
+        $this->setIfExists('user_name', $data ?? [], null);
+        $this->setIfExists('real_name', $data ?? [], null);
+        $this->setIfExists('sn', $data ?? [], null);
+        $this->setIfExists('avatar', $data ?? [], null);
+        $this->setIfExists('roles', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets id
+     *
+     * @return string|null
+     */
+    public function getId()
+    {
+        return $this->container['id'];
+    }
+
+    /**
+     * Sets id
+     *
+     * @param string|null $id id
+     *
+     * @return self
+     */
+    public function setId($id)
+    {
+        if (is_null($id)) {
+            throw new \InvalidArgumentException('non-nullable id cannot be null');
+        }
+        $this->container['id'] = $id;
+
+        return $this;
+    }
+
+    /**
+     * Gets nick_name
+     *
+     * @return string|null
+     */
+    public function getNickName()
+    {
+        return $this->container['nick_name'];
+    }
+
+    /**
+     * Sets nick_name
+     *
+     * @param string|null $nick_name nick_name
+     *
+     * @return self
+     */
+    public function setNickName($nick_name)
+    {
+        if (is_null($nick_name)) {
+            throw new \InvalidArgumentException('non-nullable nick_name cannot be null');
+        }
+        $this->container['nick_name'] = $nick_name;
+
+        return $this;
+    }
+
+    /**
+     * Gets user_name
+     *
+     * @return string|null
+     */
+    public function getUserName()
+    {
+        return $this->container['user_name'];
+    }
+
+    /**
+     * Sets user_name
+     *
+     * @param string|null $user_name user_name
+     *
+     * @return self
+     */
+    public function setUserName($user_name)
+    {
+        if (is_null($user_name)) {
+            throw new \InvalidArgumentException('non-nullable user_name cannot be null');
+        }
+        $this->container['user_name'] = $user_name;
+
+        return $this;
+    }
+
+    /**
+     * Gets real_name
+     *
+     * @return string|null
+     */
+    public function getRealName()
+    {
+        return $this->container['real_name'];
+    }
+
+    /**
+     * Sets real_name
+     *
+     * @param string|null $real_name real_name
+     *
+     * @return self
+     */
+    public function setRealName($real_name)
+    {
+        if (is_null($real_name)) {
+            throw new \InvalidArgumentException('non-nullable real_name cannot be null');
+        }
+        $this->container['real_name'] = $real_name;
+
+        return $this;
+    }
+
+    /**
+     * Gets sn
+     *
+     * @return int|null
+     */
+    public function getSn()
+    {
+        return $this->container['sn'];
+    }
+
+    /**
+     * Sets sn
+     *
+     * @param int|null $sn sn
+     *
+     * @return self
+     */
+    public function setSn($sn)
+    {
+        if (is_null($sn)) {
+            throw new \InvalidArgumentException('non-nullable sn cannot be null');
+        }
+        $this->container['sn'] = $sn;
+
+        return $this;
+    }
+
+    /**
+     * Gets avatar
+     *
+     * @return string|null
+     */
+    public function getAvatar()
+    {
+        return $this->container['avatar'];
+    }
+
+    /**
+     * Sets avatar
+     *
+     * @param string|null $avatar avatar
+     *
+     * @return self
+     */
+    public function setAvatar($avatar)
+    {
+        if (is_null($avatar)) {
+            array_push($this->openAPINullablesSetToNull, 'avatar');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('avatar', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['avatar'] = $avatar;
+
+        return $this;
+    }
+
+    /**
+     * Gets roles
+     *
+     * @return string[]|null
+     */
+    public function getRoles()
+    {
+        return $this->container['roles'];
+    }
+
+    /**
+     * Sets roles
+     *
+     * @param string[]|null $roles roles
+     *
+     * @return self
+     */
+    public function setRoles($roles)
+    {
+        if (is_null($roles)) {
+            array_push($this->openAPINullablesSetToNull, 'roles');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('roles', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['roles'] = $roles;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 409 - 0
api-test/client/lib/Model/PostApiV3GroupsGroupInviteLinks200Response.php

@@ -0,0 +1,409 @@
+<?php
+/**
+ * PostApiV3GroupsGroupInviteLinks200Response
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * PostApiV3GroupsGroupInviteLinks200Response Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class PostApiV3GroupsGroupInviteLinks200Response implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'post_api_v3_groups_group_invite_links_200_response';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'data' => '\WikipaliApi\Model\PostApiV3GroupsGroupInviteLinks200ResponseData'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'data' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'data' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'data' => 'data'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'data' => 'setData'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'data' => 'getData'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('data', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets data
+     *
+     * @return \WikipaliApi\Model\PostApiV3GroupsGroupInviteLinks200ResponseData|null
+     */
+    public function getData()
+    {
+        return $this->container['data'];
+    }
+
+    /**
+     * Sets data
+     *
+     * @param \WikipaliApi\Model\PostApiV3GroupsGroupInviteLinks200ResponseData|null $data data
+     *
+     * @return self
+     */
+    public function setData($data)
+    {
+        if (is_null($data)) {
+            throw new \InvalidArgumentException('non-nullable data cannot be null');
+        }
+        $this->container['data'] = $data;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 477 - 0
api-test/client/lib/Model/PostApiV3GroupsGroupInviteLinks200ResponseData.php

@@ -0,0 +1,477 @@
+<?php
+/**
+ * PostApiV3GroupsGroupInviteLinks200ResponseData
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * PostApiV3GroupsGroupInviteLinks200ResponseData Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class PostApiV3GroupsGroupInviteLinks200ResponseData implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'post_api_v3_groups_group_invite_links_200_response_data';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'token' => 'string',
+        'role' => 'string',
+        'expires_at' => 'string'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'token' => null,
+        'role' => null,
+        'expires_at' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'token' => false,
+        'role' => false,
+        'expires_at' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'token' => 'token',
+        'role' => 'role',
+        'expires_at' => 'expires_at'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'token' => 'setToken',
+        'role' => 'setRole',
+        'expires_at' => 'setExpiresAt'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'token' => 'getToken',
+        'role' => 'getRole',
+        'expires_at' => 'getExpiresAt'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('token', $data ?? [], null);
+        $this->setIfExists('role', $data ?? [], null);
+        $this->setIfExists('expires_at', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets token
+     *
+     * @return string|null
+     */
+    public function getToken()
+    {
+        return $this->container['token'];
+    }
+
+    /**
+     * Sets token
+     *
+     * @param string|null $token token
+     *
+     * @return self
+     */
+    public function setToken($token)
+    {
+        if (is_null($token)) {
+            throw new \InvalidArgumentException('non-nullable token cannot be null');
+        }
+        $this->container['token'] = $token;
+
+        return $this;
+    }
+
+    /**
+     * Gets role
+     *
+     * @return string|null
+     */
+    public function getRole()
+    {
+        return $this->container['role'];
+    }
+
+    /**
+     * Sets role
+     *
+     * @param string|null $role role
+     *
+     * @return self
+     */
+    public function setRole($role)
+    {
+        if (is_null($role)) {
+            throw new \InvalidArgumentException('non-nullable role cannot be null');
+        }
+        $this->container['role'] = $role;
+
+        return $this;
+    }
+
+    /**
+     * Gets expires_at
+     *
+     * @return string|null
+     */
+    public function getExpiresAt()
+    {
+        return $this->container['expires_at'];
+    }
+
+    /**
+     * Sets expires_at
+     *
+     * @param string|null $expires_at expires_at
+     *
+     * @return self
+     */
+    public function setExpiresAt($expires_at)
+    {
+        if (is_null($expires_at)) {
+            throw new \InvalidArgumentException('non-nullable expires_at cannot be null');
+        }
+        $this->container['expires_at'] = $expires_at;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 409 - 0
api-test/client/lib/Model/PostApiV3MeGroups200Response.php

@@ -0,0 +1,409 @@
+<?php
+/**
+ * PostApiV3MeGroups200Response
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * PostApiV3MeGroups200Response Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class PostApiV3MeGroups200Response implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'post_api_v3_me_groups_200_response';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'data' => '\WikipaliApi\Model\GetApiV3MeGroups200ResponseDataInner'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'data' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'data' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'data' => 'data'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'data' => 'setData'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'data' => 'getData'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('data', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets data
+     *
+     * @return \WikipaliApi\Model\GetApiV3MeGroups200ResponseDataInner|null
+     */
+    public function getData()
+    {
+        return $this->container['data'];
+    }
+
+    /**
+     * Sets data
+     *
+     * @param \WikipaliApi\Model\GetApiV3MeGroups200ResponseDataInner|null $data data
+     *
+     * @return self
+     */
+    public function setData($data)
+    {
+        if (is_null($data)) {
+            throw new \InvalidArgumentException('non-nullable data cannot be null');
+        }
+        $this->container['data'] = $data;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 412 - 0
api-test/client/lib/Model/PostApiV3MeGroupsRequest.php

@@ -0,0 +1,412 @@
+<?php
+/**
+ * PostApiV3MeGroupsRequest
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * PostApiV3MeGroupsRequest Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class PostApiV3MeGroupsRequest implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'post_api_v3_me_groups_request';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'invite' => 'string'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'invite' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'invite' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'invite' => 'invite'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'invite' => 'setInvite'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'invite' => 'getInvite'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('invite', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        if ($this->container['invite'] === null) {
+            $invalidProperties[] = "'invite' can't be null";
+        }
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets invite
+     *
+     * @return string
+     */
+    public function getInvite()
+    {
+        return $this->container['invite'];
+    }
+
+    /**
+     * Sets invite
+     *
+     * @param string $invite 邀请链接里的 token
+     *
+     * @return self
+     */
+    public function setInvite($invite)
+    {
+        if (is_null($invite)) {
+            throw new \InvalidArgumentException('non-nullable invite cannot be null');
+        }
+        $this->container['invite'] = $invite;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 39 - 0
api-v13/app/Http/Controllers/V3/GroupInviteController.php

@@ -0,0 +1,39 @@
+<?php
+
+namespace App\Http\Controllers\V3;
+
+use App\Http\Controllers\Concerns\ResolvesCurrentUser;
+use App\Http\Controllers\Controller;
+use App\Http\Resources\V3\GroupInviteResource;
+use App\Services\V3\GroupInviteService;
+use Illuminate\Http\Request;
+
+/**
+ * 打开团队邀请链接:看是哪个团队、谁邀请的。
+ *
+ * 新能力,没有对应的 v2 端点。签发见 `POST /v3/groups/{group}/invite-links`,
+ * 同意加入见 `POST /v3/me/groups`。
+ */
+class GroupInviteController extends Controller
+{
+    use ResolvesCurrentUser;
+
+    public function __construct(private readonly GroupInviteService $invites) {}
+
+    /**
+     * 查看团队邀请
+     *
+     * 不登录也能看(私有团队也一样,链接本身就是凭证);登录了 `member_role` 给出
+     * 查看者在这个团队里现有的角色,还不是成员为 null。
+     *
+     * @unauthenticated
+     *
+     * @urlParam token string required 邀请链接里的 token
+     *
+     * @responseStatus 404 链接无效、已过期,或签发人已不能邀请
+     */
+    public function show(Request $request, string $token)
+    {
+        return GroupInviteResource::make($this->invites->preview($token, $this->currentUserUid($request)));
+    }
+}

+ 43 - 0
api-v13/app/Http/Controllers/V3/GroupInviteLinkController.php

@@ -0,0 +1,43 @@
+<?php
+
+namespace App\Http\Controllers\V3;
+
+use App\Http\Controllers\Concerns\ResolvesCurrentUser;
+use App\Http\Controllers\Controller;
+use App\Http\Resources\V3\GroupInviteLinkResource;
+use App\Models\GroupInfo;
+use App\Services\V3\GroupInviteService;
+use Illuminate\Http\Request;
+
+/**
+ * 团队邀请链接:owner / manager 签一张链接发给别人,对方同意后以 reader 身份加入。
+ *
+ * 新能力,没有对应的 v2 端点。链接是签名 token、不落库,规则见 {@see GroupInviteService}。
+ * 打开链接 `GET /v3/group-invites/{token}`,同意 `POST /v3/me/groups`。
+ * 不支持 AI 模型:成员管理只给人类账号。
+ */
+class GroupInviteLinkController extends Controller
+{
+    use ResolvesCurrentUser;
+
+    public function __construct(private readonly GroupInviteService $invites) {}
+
+    /**
+     * 签一张团队邀请链接
+     *
+     * 团队的 owner / manager 才能调用。7 天有效,经它加入的成员角色是 reader(只读)。
+     * 链接不能单独作废:签发人被移出团队或降为 editor / reader 时,他签的链接全部失效。
+     *
+     * @urlParam group string required 团队 uid
+     *
+     * @responseStatus 201 签发成功
+     * @responseStatus 403 不能管理这个团队的成员,或用 AI 模型的 token 调用
+     */
+    public function store(Request $request, GroupInfo $group)
+    {
+        return GroupInviteLinkResource::make($this->invites->issue(
+            $group->uid,
+            $this->currentUser($request)['user_uid'],
+        ))->response()->setStatusCode(201);
+    }
+}

+ 30 - 2
api-v13/app/Http/Controllers/V3/MeGroupController.php

@@ -5,7 +5,9 @@ namespace App\Http\Controllers\V3;
 use App\Http\Controllers\Concerns\ResolvesCurrentUser;
 use App\Http\Controllers\Controller;
 use App\Http\Requests\V3\IndexMeGroupRequest;
+use App\Http\Requests\V3\StoreMeGroupRequest;
 use App\Http\Resources\V3\MeGroupResource;
+use App\Services\V3\GroupInviteService;
 use App\Services\V3\GroupMemberService;
 
 /**
@@ -15,12 +17,18 @@ use App\Services\V3\GroupMemberService;
  * `GET /v2/group?view=studio&view2=…` 与 `GET /v2/group-my-number`(`GroupController`):
  * 「我创建的 / 我参加的」用 `owned` 过滤,数量读 `meta.total`。v2 那几份在
  * dashboard-v4 下线前原样保留,不要改动。
+ *
+ * 凭邀请链接加入团队(POST)是新能力,没有对应的 v2 端点;链接的签发与规则见
+ * {@see GroupInviteService}。
  */
 class MeGroupController extends Controller
 {
     use ResolvesCurrentUser;
 
-    public function __construct(private readonly GroupMemberService $members) {}
+    public function __construct(
+        private readonly GroupMemberService $members,
+        private readonly GroupInviteService $invites,
+    ) {}
 
     /**
      * 列出我加入的团队
@@ -32,7 +40,7 @@ class MeGroupController extends Controller
      * @queryParam page integer 页码。Default: 1
      * @queryParam per_page integer 每页数量,最大 200。Default: 100
      */
-    public function __invoke(IndexMeGroupRequest $request)
+    public function index(IndexMeGroupRequest $request)
     {
         $filters = $request->safe()->only(['search']);
         if ($request->has('owned')) {
@@ -45,4 +53,24 @@ class MeGroupController extends Controller
             $request->integer('per_page', 100),
         ));
     }
+
+    /**
+     * 凭邀请链接加入团队
+     *
+     * `invite` 是邀请链接里的 token(见 `POST /v3/groups/{group}/invite-links`),
+     * 加入后角色是 reader(只读)。已经是成员时原样返回现有的成员身份(200,角色不变)。
+     * 只给人类账号,AI 模型的 token 403。
+     *
+     * @bodyParam invite string required 邀请链接里的 token
+     *
+     * @responseStatus 201 已加入
+     * @responseStatus 403 用 AI 模型的 token 调用
+     */
+    public function store(StoreMeGroupRequest $request)
+    {
+        return MeGroupResource::make($this->invites->accept(
+            $request->validated('invite'),
+            $this->currentUser($request)['user_uid'],
+        ));
+    }
 }

+ 29 - 0
api-v13/app/Http/Requests/V3/StoreMeGroupRequest.php

@@ -0,0 +1,29 @@
+<?php
+
+namespace App\Http\Requests\V3;
+
+use Illuminate\Foundation\Http\FormRequest;
+
+/**
+ * `POST /v3/me/groups` 的入参:凭邀请链接里的 token 加入团队。
+ */
+class StoreMeGroupRequest extends FormRequest
+{
+    /**
+     * 登录在中间件里判,链接是否有效在 Service 里判(无效是 422 errors.invite)。
+     */
+    public function authorize(): bool
+    {
+        return true;
+    }
+
+    /**
+     * @return array<string, array<int, mixed>>
+     */
+    public function rules(): array
+    {
+        return [
+            'invite' => ['required', 'string', 'max:2048'],
+        ];
+    }
+}

+ 27 - 0
api-v13/app/Http/Resources/V3/GroupInviteLinkResource.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace App\Http\Resources\V3;
+
+use App\Services\V3\GroupInviteService;
+use Illuminate\Http\Request;
+
+/**
+ * 一张团队邀请链接:客户端把 token 拼进自己的邀请页地址发给别人。
+ *
+ * 载荷由 {@see GroupInviteService::issue()} 组好,本类只做形状声明。
+ */
+class GroupInviteLinkResource extends BaseResource
+{
+    /**
+     * @param  Request  $request
+     * @return array{
+     *     token: string,
+     *     role: string,
+     *     expires_at: string
+     * }
+     */
+    public function toArray($request): array
+    {
+        return $this->resource;
+    }
+}

+ 47 - 0
api-v13/app/Http/Resources/V3/GroupInviteResource.php

@@ -0,0 +1,47 @@
+<?php
+
+namespace App\Http\Resources\V3;
+
+use App\Http\Resources\Concerns\ResolvesActor;
+use App\Services\V3\GroupInviteService;
+use Illuminate\Http\Request;
+
+/**
+ * 打开邀请链接看到的内容:哪个团队、谁邀请的、以什么角色加入。
+ *
+ * `member_role` 是查看者在这个团队里现有的角色:没登录或还不是成员为 null。
+ * 载荷由 {@see GroupInviteService::preview()} 组好,团队的 creator 已预加载,本类不查库。
+ */
+class GroupInviteResource extends BaseResource
+{
+    use ResolvesActor;
+
+    /**
+     * @param  Request  $request
+     * @return array{
+     *     group: array{id: string, name: string, description: string|null, status: int, owner: array{id: string, nickName: string, userName: string, realName: string, sn: int, avatar: string|null, roles: array|null}|null},
+     *     inviter: array{id: string, nickName: string, userName: string, realName: string, sn: int, avatar: string|null, roles: array|null},
+     *     role: string,
+     *     expires_at: string,
+     *     member_role: string|null
+     * }
+     */
+    public function toArray($request): array
+    {
+        $group = $this->resource['group'];
+
+        return [
+            'group' => [
+                'id' => $group->uid,
+                'name' => $group->name,
+                'description' => $group->description,
+                'status' => (int) $group->status,
+                'owner' => $this->actor($group->creator),
+            ],
+            'inviter' => $this->resource['inviter'],
+            'role' => $this->resource['role'],
+            'expires_at' => $this->resource['expires_at'],
+            'member_role' => $this->resource['member']?->effectiveRole(),
+        ];
+    }
+}

+ 166 - 0
api-v13/app/Services/V3/GroupInviteService.php

@@ -0,0 +1,166 @@
+<?php
+
+namespace App\Services\V3;
+
+use App\Services\UserService;
+use Firebase\JWT\JWT;
+use Firebase\JWT\Key;
+use Illuminate\Auth\Access\AuthorizationException;
+use Illuminate\Database\Eloquent\Model;
+use Illuminate\Validation\ValidationException;
+use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
+
+/**
+ * 团队邀请链接:owner / manager 签一张链接,别人打开、同意后以 reader 身份加入团队。
+ *
+ * 新能力,没有对应的 v2 端点(v2 只能由管理者逐个加人)。
+ *
+ * 链接是签名 token,不落库(2026-11-23 用户定):
+ * - 载荷里写团队 uid、签发人、角色、过期时间,签名密钥与登录 token、agent 授权都分开;
+ * - 发出去的链接不能单独作废,只能等它过期({@see TTL});
+ * - 接受时再查一次签发人:已不在团队里、或已不是 owner / manager,链接一并失效——
+ *   降级或移除签发人,就撤销了他发出的所有链接。
+ *
+ * 只给人类账号:成员管理就是权限本身(同 {@see GroupMemberService}),模型 token 签发、接受都 403。
+ */
+class GroupInviteService
+{
+    /** 链接有效期 */
+    public const TTL = 60 * 60 * 24 * 7;
+
+    /** 经链接加入的角色:只读。要更高的角色,加入后由管理者改 */
+    public const ROLE = GroupMemberService::DEFAULT_ROLE;
+
+    private const TYPE = 'group-invite';
+
+    public function __construct(
+        private readonly GroupAbilityService $abilities,
+        private readonly AgentGrantService $agents,
+        private readonly UserService $users,
+        private readonly GroupMemberService $members,
+        private readonly GroupService $groups,
+    ) {}
+
+    /**
+     * 签一张邀请链接。
+     *
+     * @return array{token: string, role: string, expires_at: string}
+     *
+     * @throws AuthorizationException 调用者不能管理成员,或是 AI 模型
+     */
+    public function issue(string $groupUid, string $actorUid): array
+    {
+        $this->agents->assertHuman($actorUid);
+        $this->authorizeInviter($groupUid, $actorUid);
+
+        $expiresAt = time() + self::TTL;
+        $token = JWT::encode([
+            'typ' => self::TYPE,
+            'grp' => $groupUid,
+            'iss' => $actorUid,
+            'role' => self::ROLE,
+            'nbf' => time(),
+            'exp' => $expiresAt,
+        ], $this->key(), 'HS512');
+
+        return [
+            'token' => $token,
+            'role' => self::ROLE,
+            'expires_at' => gmdate('Y-m-d\TH:i:s\Z', $expiresAt),
+        ];
+    }
+
+    /**
+     * 打开链接看到的内容:哪个团队、谁邀请的、以什么角色加入;登录了再告诉他是不是已经在团队里。
+     *
+     * @return array{group: Model, inviter: array<string, mixed>, role: string, expires_at: string, member: Model|null}
+     *
+     * @throws NotFoundHttpException 链接无效、过期,或签发人已无权邀请
+     */
+    public function preview(string $token, ?string $viewerUid): array
+    {
+        $invite = $this->resolve($token)
+            ?? throw new NotFoundHttpException(__('messages.group_invite_invalid'));
+
+        return [
+            'group' => $invite['group'],
+            'inviter' => $this->users->byUuid($invite['inviter_uid']),
+            'role' => $invite['role'],
+            'expires_at' => $invite['expires_at'],
+            'member' => $viewerUid === null
+                ? null
+                : $this->abilities->membership($viewerUid, $invite['group']->uid),
+        ];
+    }
+
+    /**
+     * 同意邀请,加入团队。已经是成员就原样返回那条成员记录(角色不变,不会被降成 reader)。
+     *
+     * @throws ValidationException 链接无效、过期,或签发人已无权邀请
+     * @throws AuthorizationException 调用者是 AI 模型
+     */
+    public function accept(string $token, string $userUid): Model
+    {
+        $this->agents->assertHuman($userUid);
+        $invite = $this->resolve($token)
+            ?? throw ValidationException::withMessages(['invite' => __('messages.group_invite_invalid')]);
+
+        // 链接代表签发人拉人:以签发人身份加(resolve 已确认他仍能管理成员)
+        return $this->members->join($invite['group'], $userUid, $invite['inviter_uid']);
+    }
+
+    /**
+     * 验签并取出团队。伪造、过期、团队已删、签发人已无权邀请,一律 null(调用方报同一句「链接无效」)——
+     * 不告诉外人团队还在不在、签发人是谁。
+     *
+     * @return array{group: Model, inviter_uid: string, role: string, expires_at: string}|null
+     */
+    private function resolve(string $token): ?array
+    {
+        try {
+            $claims = JWT::decode($token, new Key($this->key(), 'HS512'));
+        } catch (\Throwable) {
+            return null;
+        }
+        if (($claims->typ ?? null) !== self::TYPE || empty($claims->grp) || empty($claims->iss)) {
+            return null;
+        }
+
+        $group = $this->groups->find((string) $claims->grp);
+        if ($group === null || ! $this->canInvite($group->uid, (string) $claims->iss)) {
+            return null;
+        }
+
+        return [
+            'group' => $group,
+            'inviter_uid' => (string) $claims->iss,
+            'role' => self::ROLE,
+            'expires_at' => gmdate('Y-m-d\TH:i:s\Z', (int) $claims->exp),
+        ];
+    }
+
+    /**
+     * @throws AuthorizationException
+     */
+    private function authorizeInviter(string $groupUid, string $uid): void
+    {
+        if (! $this->canInvite($groupUid, $uid)) {
+            throw new AuthorizationException(__('messages.group_forbidden'));
+        }
+    }
+
+    /** 能发邀请 = 能管理成员(owner / manager) */
+    private function canInvite(string $groupUid, string $uid): bool
+    {
+        return GroupAbilityService::roleAllows(
+            $this->abilities->roleIn($uid, $groupUid),
+            GroupAbilityService::MANAGE_MEMBERS,
+        );
+    }
+
+    /** 独立的签名密钥:邀请链接不能当登录 token 或 agent 授权用,反之亦然 */
+    private function key(): string
+    {
+        return hash('sha512', config('mint.app.jwt_secrets_key').'|'.self::TYPE);
+    }
+}

+ 32 - 5
api-v13/app/Services/V3/GroupMemberService.php

@@ -24,6 +24,9 @@ use Illuminate\Validation\ValidationException;
  */
 class GroupMemberService
 {
+    /** 加人不指定角色时的默认角色:只读 */
+    public const DEFAULT_ROLE = GroupMember::ROLE_READER;
+
     public function __construct(private readonly GroupAbilityService $abilities) {}
 
     /**
@@ -37,10 +40,7 @@ class GroupMemberService
      */
     public function listForUser(string $userUid, array $filters, int $perPage): LengthAwarePaginator
     {
-        return GroupMember::with([
-            'group:uid,name,description,owner,status,created_at',
-            'group.'.UserService::eagerLoadActor('creator')[0],
-        ])
+        return GroupMember::with($this->myGroupRelations())
             ->where('user_id', $userUid)
             ->whereHas('group', function ($query) use ($userUid, $filters) {
                 if (array_key_exists('owned', $filters)) {
@@ -95,7 +95,7 @@ class GroupMemberService
             throw ValidationException::withMessages(['user_id' => __('messages.group_member_exists')]);
         }
 
-        $role = $data['role'] ?? GroupMember::ROLE_READER;
+        $role = $data['role'] ?? self::DEFAULT_ROLE;
         $member = new GroupMember;
         $member->forceFill([
             'id' => app('snowflake')->id(),
@@ -109,6 +109,20 @@ class GroupMemberService
         return $member->load(UserService::eagerLoadActor()[0]);
     }
 
+    /**
+     * 由 `$addedBy` 把用户拉进团队(邀请链接用);已经是成员就原样返回,角色不变。
+     * 返回「我的团队」一行的形状(同 {@see listForUser()})。
+     *
+     * @throws AuthorizationException `$addedBy` 不能管理成员
+     */
+    public function join(GroupInfo $group, string $userUid, string $addedBy): GroupMember
+    {
+        $member = $this->abilities->membership($userUid, $group->uid)
+            ?? $this->add($group, $addedBy, ['user_id' => $userUid, 'role' => self::DEFAULT_ROLE]);
+
+        return $member->load($this->myGroupRelations());
+    }
+
     /**
      * 改成员角色。
      *
@@ -146,6 +160,19 @@ class GroupMemberService
         $member->delete();
     }
 
+    /**
+     * 「我的团队」一行要带的团队信息(me/groups 的形状)。
+     *
+     * @return list<string>
+     */
+    private function myGroupRelations(): array
+    {
+        return [
+            'group:uid,name,description,owner,status,created_at',
+            'group.'.UserService::eagerLoadActor('creator')[0],
+        ];
+    }
+
     /**
      * @throws AuthorizationException
      */

+ 8 - 0
api-v13/app/Services/V3/GroupService.php

@@ -211,6 +211,14 @@ class GroupService
         return $counts;
     }
 
+    /**
+     * 按 uid 取团队(带拥有者摘要),不判权限;不存在返回 null。
+     */
+    public function find(string $groupUid): ?GroupInfo
+    {
+        return $this->withCreator()->where('uid', $groupUid)->first();
+    }
+
     /**
      * @return Builder<GroupInfo>
      */

+ 1 - 0
api-v13/resources/lang/en/messages.php

@@ -63,6 +63,7 @@ return [
     'group_has_resources' => 'The team still owns resources. Transfer or delete them before deleting the team.',
     'group_name_exists' => 'You already have a team with this name.',
     'group_share_not_found' => 'This resource is not shared with this team.',
+    'group_invite_invalid' => 'This invitation link is invalid or has expired.',
     'agent_not_allowed' => 'AI models cannot perform this action. Please use a human account.',
     'channel_forbidden' => 'You are not allowed to do this.',
     'channel_studio_forbidden' => 'You cannot view or manage the channels of this studio (team).',

+ 1 - 0
api-v13/resources/lang/zh-Hans/messages.php

@@ -63,6 +63,7 @@ return [
     'group_has_resources' => '团队名下还有资源,请先转让或删除它们再删除团队。',
     'group_name_exists' => '你名下已经有同名的团队了。',
     'group_share_not_found' => '这项资源没有共享给这个团队。',
+    'group_invite_invalid' => '邀请链接无效或已过期。',
     'agent_not_allowed' => 'AI 模型不能执行这个操作,请用人类账号。',
     'channel_forbidden' => '你没有权限执行这个操作。',
     'channel_studio_forbidden' => '你不能查看或管理这个工作室(团队)的版本。',

+ 15 - 1
api-v13/routes/v3/group.php

@@ -11,13 +11,22 @@
 */
 
 use App\Http\Controllers\V3\GroupController;
+use App\Http\Controllers\V3\GroupInviteController;
+use App\Http\Controllers\V3\GroupInviteLinkController;
 use App\Http\Controllers\V3\GroupMemberController;
 use App\Http\Controllers\V3\GroupShareController;
 use App\Http\Controllers\V3\MeGroupController;
 use Illuminate\Support\Facades\Route;
 
 // 我加入的团队:没有第二个主体(不会出现 me 以外的值),所以是 /me/ 下的独立端点
-Route::get('me/groups', MeGroupController::class)->middleware('auth.v3')->name('me.groups.index');
+// POST 是凭邀请链接加入团队(加进「我的团队」),token 放请求体
+Route::get('me/groups', [MeGroupController::class, 'index'])->middleware('auth.v3')->name('me.groups.index');
+Route::post('me/groups', [MeGroupController::class, 'store'])->middleware('auth.v3')->name('me.groups.store');
+
+// 打开邀请链接:不登录也能看。token 是 JWT(base64url 三段,用点分隔)
+Route::get('group-invites/{token}', [GroupInviteController::class, 'show'])
+    ->name('group-invites.show')
+    ->where('token', '[A-Za-z0-9_\-]+\.[A-Za-z0-9_\-]+\.[A-Za-z0-9_\-]+');
 
 // 团队本身。详情可不登录(公开团队谁都能看),其余要登录。只注册 PATCH,不注册 PUT
 Route::apiResource('groups', GroupController::class)
@@ -56,4 +65,9 @@ Route::middleware('auth.v3')->scopeBindings()->group(function () {
         ->only(['index', 'destroy'])
         ->whereUuid('group')
         ->whereNumber('share');
+
+    // 团队邀请链接:只签发,不落库,所以没有列表与删除
+    Route::post('groups/{group}/invite-links', [GroupInviteLinkController::class, 'store'])
+        ->name('groups.invite-links.store')
+        ->whereUuid('group');
 });

+ 193 - 0
api-v13/tests/Feature/GroupInviteV3Test.php

@@ -0,0 +1,193 @@
+<?php
+
+use App\Models\GroupInfo;
+use App\Models\GroupMember;
+use App\Services\V3\GroupInviteService;
+use Firebase\JWT\JWT;
+use Illuminate\Foundation\Testing\RefreshDatabase;
+
+uses(RefreshDatabase::class);
+
+/**
+ * v3 团队邀请链接。
+ *
+ * 端点:
+ *   POST /api/v3/groups/{group}/invite-links   签一张链接(owner / manager)
+ *   GET  /api/v3/group-invites/{token}         打开链接(公开)
+ *   POST /api/v3/me/groups {invite}            同意,以 reader 加入
+ *
+ * 这里断言的是形状而非契约(spectator 未安装,见 v3-resource skill 第 3 步)。
+ */
+function issueInvite(string $team, string $inviter): string
+{
+    return test()->postJson("/api/v3/groups/{$team}/invite-links", [], authHeader($inviter))
+        ->assertCreated()
+        ->json('data.token');
+}
+
+/* ---------------- 签发 ---------------- */
+
+it('lets owners and managers issue an invite link', function (string $role) {
+    [$team, $users] = makeTeam();
+
+    $data = $this->postJson("/api/v3/groups/{$team}/invite-links", [], authHeader($users[$role]))
+        ->assertCreated()
+        ->json('data');
+
+    expect($data)->toHaveKeys(['token', 'role', 'expires_at']);
+    expect($data['role'])->toBe('reader');
+    expect($data['expires_at'])->toMatch('/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/');
+})->with(['owner', 'manager']);
+
+it('forbids editors, readers and outsiders from issuing links', function (string $role) {
+    [$team, $users] = makeTeam();
+
+    $this->postJson("/api/v3/groups/{$team}/invite-links", [], authHeader($users[$role]))
+        ->assertForbidden();
+})->with(['editor', 'reader', 'outsider']);
+
+it('requires login to issue a link', function () {
+    [$team] = makeTeam();
+
+    $this->postJson("/api/v3/groups/{$team}/invite-links")->assertUnauthorized();
+});
+
+it('forbids ai models from issuing links', function () {
+    [$team, $users] = makeTeam();
+    $model = makeModelAccount($users['owner']);
+    addGroupMember($team, $model, 1);
+
+    $this->postJson("/api/v3/groups/{$team}/invite-links", [], authHeader($model))
+        ->assertForbidden();
+});
+
+/* ---------------- 打开链接 ---------------- */
+
+it('shows the invitation without login', function () {
+    [$team, $users] = makeTeam();
+    $token = issueInvite($team, $users['manager']);
+
+    $data = $this->getJson("/api/v3/group-invites/{$token}")->assertOk()->json('data');
+
+    expect($data['group'])->toMatchArray(['id' => $team, 'name' => 'test team']);
+    expect($data['group'])->toHaveKeys(['description', 'status', 'owner']);
+    expect($data['inviter']['id'])->toBe($users['manager']);
+    expect($data['role'])->toBe('reader');
+    expect($data['member_role'])->toBeNull();
+});
+
+it('tells a logged-in member their current role', function () {
+    [$team, $users] = makeTeam();
+    $token = issueInvite($team, $users['owner']);
+
+    $this->getJson("/api/v3/group-invites/{$token}", authHeader($users['editor']))
+        ->assertOk()
+        ->assertJsonPath('data.member_role', 'editor');
+    $this->getJson("/api/v3/group-invites/{$token}", authHeader($users['outsider']))
+        ->assertOk()
+        ->assertJsonPath('data.member_role', null);
+});
+
+it('shows invitations to private teams too', function () {
+    [$team, $users] = makeTeam();
+    GroupInfo::where('uid', $team)->update(['status' => GroupInfo::STATUS_PRIVATE]);
+    $token = issueInvite($team, $users['owner']);
+
+    $this->getJson("/api/v3/group-invites/{$token}")->assertOk();
+});
+
+it('rejects forged, expired and foreign tokens', function (Closure $makeToken) {
+    [$team, $users] = makeTeam();
+    $token = $makeToken($team, $users['owner']);
+
+    $detail = $this->getJson("/api/v3/group-invites/{$token}")
+        ->assertNotFound()
+        ->json('detail');
+    expect($detail)->not->toBe('messages.group_invite_invalid');
+})->with([
+    'wrong key' => [fn (string $team, string $owner) => JWT::encode(
+        ['typ' => 'group-invite', 'grp' => $team, 'iss' => $owner, 'exp' => time() + 60], hash('sha512', 'not-the-key'), 'HS512')],
+    'expired' => [fn (string $team, string $owner) => JWT::encode(
+        ['typ' => 'group-invite', 'grp' => $team, 'iss' => $owner, 'nbf' => time() - 120, 'exp' => time() - 60],
+        hash('sha512', config('mint.app.jwt_secrets_key').'|group-invite'), 'HS512')],
+    'agent grant key' => [fn (string $team, string $owner) => JWT::encode(
+        ['typ' => 'group-invite', 'grp' => $team, 'iss' => $owner, 'exp' => time() + 60],
+        hash('sha512', config('mint.app.jwt_secrets_key').'|agent-grant'), 'HS512')],
+]);
+
+it('invalidates links once the inviter loses the manager role', function () {
+    [$team, $users] = makeTeam();
+    $token = issueInvite($team, $users['manager']);
+
+    GroupMember::where('group_id', $team)->where('user_id', $users['manager'])
+        ->update(['role' => 'reader', 'power' => 2]);
+
+    $this->getJson("/api/v3/group-invites/{$token}")->assertNotFound();
+    $this->postJson('/api/v3/me/groups', ['invite' => $token], authHeader($users['outsider']))
+        ->assertUnprocessable()
+        ->assertJsonValidationErrors('invite');
+});
+
+it('invalidates links when the team is deleted', function () {
+    [$team, $users] = makeTeam();
+    $token = issueInvite($team, $users['owner']);
+    GroupInfo::where('uid', $team)->delete();
+
+    $this->getJson("/api/v3/group-invites/{$token}")->assertNotFound();
+});
+
+/* ---------------- 同意加入 ---------------- */
+
+it('joins the team as a reader', function () {
+    [$team, $users] = makeTeam();
+    $token = issueInvite($team, $users['manager']);
+
+    $data = $this->postJson('/api/v3/me/groups', ['invite' => $token], authHeader($users['outsider']))
+        ->assertCreated()
+        ->json('data');
+
+    expect($data)->toMatchArray(['id' => $team, 'role' => GroupInviteService::ROLE]);
+    expect($data)->toHaveKeys(['member_id', 'joined_at']);
+    $row = GroupMember::where('group_id', $team)->where('user_id', $users['outsider'])->first();
+    expect($row->role)->toBe('reader');
+    expect((int) $row->power)->toBe(2);
+});
+
+it('keeps the existing role when a member accepts again', function () {
+    [$team, $users] = makeTeam();
+    $token = issueInvite($team, $users['owner']);
+
+    $this->postJson('/api/v3/me/groups', ['invite' => $token], authHeader($users['editor']))
+        ->assertOk()
+        ->assertJsonPath('data.role', 'editor');
+    expect(GroupMember::where('group_id', $team)->where('user_id', $users['editor'])->count())->toBe(1);
+});
+
+it('requires login to accept', function () {
+    [$team, $users] = makeTeam();
+    $token = issueInvite($team, $users['owner']);
+
+    $this->postJson('/api/v3/me/groups', ['invite' => $token])->assertUnauthorized();
+});
+
+it('requires an invite token to accept', function () {
+    $this->postJson('/api/v3/me/groups', [], authHeader(makeStudio('someone')))
+        ->assertUnprocessable()
+        ->assertJsonValidationErrors('invite');
+});
+
+it('rejects a garbage invite token', function () {
+    $this->postJson('/api/v3/me/groups', ['invite' => 'a.b.c'], authHeader(makeStudio('someone')))
+        ->assertUnprocessable()
+        ->assertJsonValidationErrors('invite');
+});
+
+it('forbids ai models from accepting', function () {
+    [$team, $users] = makeTeam();
+    $token = issueInvite($team, $users['owner']);
+    $model = makeModelAccount($users['outsider']);
+
+    $this->postJson('/api/v3/me/groups', ['invite' => $token], authHeader($model))
+        ->assertForbidden();
+    expect(GroupMember::where('group_id', $team)->where('user_id', $model)->exists())->toBeFalse();
+});

+ 115 - 0
dashboard-test/src/tests/group-invite.spec.ts

@@ -0,0 +1,115 @@
+import { test, expect, type APIRequestContext } from '@playwright/test';
+import { call } from '../lib/api.js';
+import { collect } from '../lib/collect.js';
+import { BASE, HAS_STUDENT, STUDENT_PASS, STUDENT_USER, shotDir } from '../lib/env.js';
+
+/**
+ * 团队邀请链接:成员页「获取邀请链接」→ 别人打开 /team-invite/:token →(登录)→ 同意 → 以只读成员加入。
+ * v3:POST /v3/groups/{group}/invite-links、GET /v3/group-invites/{token}、POST /v3/me/groups。
+ *
+ * E2E_USER 是团队 owner;E2E_STUDENT_USER 充当被邀请的人(没配就跳过)。
+ * 团队沿用「e2e 团队空间」。开跑前先把被邀请人移出团队,跑完留着(看结果用)。
+ */
+const SHOT = shotDir('group-invite');
+const TEAM = 'e2e 团队空间';
+
+async function teamId(request: APIRequestContext): Promise<string> {
+  const find = async () => {
+    const r = await call(request, 'GET', '/v3/me/groups?owned=true&per_page=200');
+    expect(r.status).toBe(200);
+    return (r.body.data as { id: string; name: string }[]).find((g) => g.name === TEAM)?.id;
+  };
+  let id = await find();
+  if (!id) {
+    const created = await call(request, 'POST', '/v3/groups', { name: TEAM });
+    expect(created.status).toBe(201);
+    id = created.body.data.id;
+  }
+  return id!;
+}
+
+async function memberOf(request: APIRequestContext, team: string, userId: string) {
+  const r = await call(request, 'GET', `/v3/groups/${team}/members?per_page=200`);
+  return (r.body.data as { id: string; role: string; user?: { id: string } }[]).find(
+    (m) => m.user?.id === userId,
+  );
+}
+
+test.describe('团队邀请链接', () => {
+  test.skip(!HAS_STUDENT, '需要第二个账号 E2E_STUDENT_USER 当被邀请人');
+
+  test('owner 取链接;未登录打开 → 登录 → 同意,以只读成员加入', async ({ page, request, browser }) => {
+    const log = collect(page);
+    const team = await teamId(request);
+    const student = (await call(request, 'GET', '/v3/me', undefined, 'student')).body.data as {
+      id: string;
+    };
+    const stale = await memberOf(request, team, student.id);
+    if (stale) await call(request, 'DELETE', `/v3/groups/${team}/members/${stale.id}`);
+
+    let link = '';
+    await test.step('1. 成员页:「获取邀请链接」弹出链接', async () => {
+      await page.goto(`workspace/team/${team}`, { waitUntil: 'networkidle' });
+      const issued = page.waitForResponse(
+        (r) => r.url().includes(`/api/v3/groups/${team}/invite-links`) && r.request().method() === 'POST',
+      );
+      await page.getByRole('button', { name: /获取邀请链接/ }).click();
+      expect((await issued).status()).toBe(201);
+      const modal = page.locator('.ant-modal:visible');
+      link = await modal.locator('input').inputValue();
+      expect(link).toMatch(/\/team-invite\/[\w-]+\.[\w-]+\.[\w-]+$/);
+      await expect(modal).toContainText('只读成员');
+      await page.screenshot({ path: `${SHOT}/01-link.png`, fullPage: true });
+      log.dump('1. 取链接');
+    });
+
+    // 被邀请人:全新的浏览器上下文,没有登录态
+    const ctx = await browser.newContext({ baseURL: BASE, storageState: { cookies: [], origins: [] } });
+    const guest = await ctx.newPage();
+    const guestLog = collect(guest);
+
+    await test.step('2. 未登录打开:看到邀请与「登录后加入」', async () => {
+      await guest.goto(link, { waitUntil: 'networkidle' });
+      await expect(guest.getByText(new RegExp(`邀请你加入团队空间「${TEAM}」`))).toBeVisible();
+      await expect(guest.getByText('加入后的角色:只读成员')).toBeVisible();
+      await guest.screenshot({ path: `${SHOT}/02-guest.png`, fullPage: true });
+      await guest.getByRole('button', { name: /登录后加入/ }).click();
+      await expect(guest).toHaveURL(/anonymous\/sign-in\?url=/);
+    });
+
+    await test.step('3. 登录后回到邀请页,点同意加入', async () => {
+      // ProForm 会渲染隐藏 input,必须用 :visible 过滤(同 auth.setup)
+      const inputs = guest.locator('form input:visible');
+      await inputs.nth(0).fill(STUDENT_USER);
+      await inputs.nth(1).fill(STUDENT_PASS);
+      await guest.getByRole('button', { name: /提 *交/ }).click();
+      await expect(guest).toHaveURL(/\/team-invite\//, { timeout: 20_000 });
+      const accepted = guest.waitForResponse(
+        (r) => r.url().endsWith('/api/v3/me/groups') && r.request().method() === 'POST',
+      );
+      await guest.getByRole('button', { name: /同意加入/ }).click();
+      expect((await accepted).status()).toBe(201);
+      await expect(guest).toHaveURL(new RegExp(`workspace/team/${team}$`));
+      expect((await memberOf(request, team, student.id))?.role).toBe('reader');
+      await guest.screenshot({ path: `${SHOT}/03-joined.png`, fullPage: true });
+      guestLog.dump('3. 同意加入');
+    });
+
+    await test.step('4. 再打开链接:提示已是成员', async () => {
+      await guest.goto(link, { waitUntil: 'networkidle' });
+      await expect(guest.getByText('你已经是这个团队的成员(只读成员)。')).toBeVisible();
+      await expect(guest.getByRole('button', { name: /进入团队空间/ })).toBeVisible();
+      await guest.screenshot({ path: `${SHOT}/04-member.png`, fullPage: true });
+    });
+    // 被邀请人留在团队里(本地测试数据不删,用户要看结果);下次跑时第一步会先移出
+    await ctx.close();
+  });
+
+  test('无效链接:提示无效或已过期', async ({ page }) => {
+    const log = collect(page);
+    await page.goto('team-invite/a.b.c', { waitUntil: 'networkidle' });
+    await expect(page.getByText(/邀请链接无效或已过期/)).toBeVisible();
+    await page.screenshot({ path: `${SHOT}/05-invalid.png`, fullPage: true });
+    log.dump('无效链接');
+  });
+});

+ 8 - 0
dashboard-v6/src/Router.tsx

@@ -36,6 +36,7 @@ const UsersSignUpInvite = lazy(() => import("./pages/users/sign-up-invite"));
 const UsersForgotPassword = lazy(() => import("./pages/users/forgot-password"));
 const UsersResetPassword = lazy(() => import("./pages/users/reset-password"));
 const DashboardIndex = lazy(() => import("./pages/dashboard/index"));
+const TeamInvite = lazy(() => import("./pages/team-invite"));
 
 const Home = lazy(() => import("./pages/home"));
 // 整页搜索;workspace 的搜索弹窗「在整页打开」跳到这里
@@ -85,6 +86,13 @@ const router = createBrowserRouter(
             { path: "reset-password/:token", Component: UsersResetPassword },
           ],
         },
+        // 团队邀请链接(components/group/InviteLink 生成):不登录也能看,借用未登录页的外壳
+        {
+          path: "team-invite/:token",
+          Component: AnonymousLayout,
+          handle: { crumb: "team-invite" },
+          children: [{ index: true, Component: TeamInvite }],
+        },
         {
           path: "dashboard",
           Component: DashboardLayout,

+ 49 - 0
dashboard-v6/src/api/group-invite.ts

@@ -0,0 +1,49 @@
+/**
+ * 团队邀请链接(v3):签发、打开、同意加入。
+ *
+ * 新能力,没有对应的 v2 端点。链接是服务端签名的 token(7 天有效、不落库),
+ * 经链接加入的成员一律是 reader;签发人被降级或移出团队时,他签的链接全部失效。
+ */
+import { api, unwrap, unwrapQuiet } from "./client";
+import type { paths } from "./schema";
+import { fullUrl } from "../utils";
+
+type GroupInviteResponse =
+  paths["/v3/group-invites/{token}"]["get"]["responses"][200]["content"]["application/json"];
+type GroupInviteLinkResponse =
+  paths["/v3/groups/{group}/invite-links"]["post"]["responses"][201]["content"]["application/json"];
+
+export type GroupInvite = NonNullable<GroupInviteResponse["data"]>;
+export type GroupInviteLink = NonNullable<GroupInviteLinkResponse["data"]>;
+
+/** 邀请页的完整地址(发给别人用),路由见 Router.tsx 的 team-invite/:token */
+export const groupInviteUrl = (token: string): string =>
+  fullUrl(`/team-invite/${token}`);
+
+/** 签一张邀请链接(owner / manager) */
+export const createGroupInviteLink = async (
+  group: string
+): Promise<GroupInviteLink | undefined> =>
+  unwrap(
+    await api.POST("/v3/groups/{group}/invite-links", {
+      params: { path: { group } },
+    })
+  ).data;
+
+/** 打开链接。无效 / 过期是 404,由邀请页自己渲染,不弹全局提示 */
+export const fetchGroupInvite = async (
+  token: string
+): Promise<GroupInvite | undefined> =>
+  unwrapQuiet(
+    await api.GET("/v3/group-invites/{token}", {
+      params: { path: { token } },
+    })
+  ).data;
+
+/** 同意加入,返回加入后的「我的团队」条目;已是成员时原样返回现有身份 */
+export const acceptGroupInvite = async (token: string) =>
+  unwrap(
+    await api.POST("/v3/me/groups", {
+      body: { invite: token },
+    })
+  ).data;

+ 263 - 2
dashboard-v6/src/api/schema.d.ts

@@ -8579,6 +8579,29 @@ export interface paths {
         patch?: never;
         trace?: never;
     };
+    "/v3/group-invites/{token}": {
+        parameters: {
+            query?: never;
+            header?: never;
+            path?: never;
+            cookie?: never;
+        };
+        /**
+         * 查看团队邀请
+         * @description 不登录也能看(私有团队也一样,链接本身就是凭证);登录了 `member_role` 给出
+         *     查看者在这个团队里现有的角色,还不是成员为 null。
+         *
+         *     实现:`V3\GroupInviteController@show`
+         */
+        get: operations["get_api_v3_group_invites_token_"];
+        put?: never;
+        post?: never;
+        delete?: never;
+        options?: never;
+        head?: never;
+        patch?: never;
+        trace?: never;
+    };
     "/v3/groups": {
         parameters: {
             query?: never;
@@ -8642,6 +8665,29 @@ export interface paths {
         patch: operations["patch_api_v3_groups_group_"];
         trace?: never;
     };
+    "/v3/groups/{group}/invite-links": {
+        parameters: {
+            query?: never;
+            header?: never;
+            path?: never;
+            cookie?: never;
+        };
+        get?: never;
+        put?: never;
+        /**
+         * 签一张团队邀请链接
+         * @description 团队的 owner / manager 才能调用。7 天有效,经它加入的成员角色是 reader(只读)。
+         *     链接不能单独作废:签发人被移出团队或降为 editor / reader 时,他签的链接全部失效。
+         *
+         *     实现:`V3\GroupInviteLinkController@store`
+         */
+        post: operations["post_api_v3_groups_group_invite_links"];
+        delete?: never;
+        options?: never;
+        head?: never;
+        patch?: never;
+        trace?: never;
+    };
     "/v3/groups/{group}/members": {
         parameters: {
             query?: never;
@@ -8959,11 +9005,19 @@ export interface paths {
          * 列出我加入的团队
          * @description 每条带我在团队里的角色(owner / manager / editor / reader),按加入时间排序。
          *
-         *     实现:`V3\MeGroupController@__invoke`
+         *     实现:`V3\MeGroupController@index`
          */
         get: operations["get_api_v3_me_groups"];
         put?: never;
-        post?: never;
+        /**
+         * 凭邀请链接加入团队
+         * @description `invite` 是邀请链接里的 token(见 `POST /v3/groups/{group}/invite-links`),
+         *     加入后角色是 reader(只读)。已经是成员时原样返回现有的成员身份(200,角色不变)。
+         *     只给人类账号,AI 模型的 token 403。
+         *
+         *     实现:`V3\MeGroupController@store`
+         */
+        post: operations["post_api_v3_me_groups"];
         delete?: never;
         options?: never;
         head?: never;
@@ -39286,6 +39340,69 @@ export interface operations {
             422: components["responses"]["ProblemValidation"];
         };
     };
+    get_api_v3_group_invites_token_: {
+        parameters: {
+            query?: never;
+            header?: never;
+            path: {
+                /** @description 邀请链接里的 token */
+                token: string;
+            };
+            cookie?: never;
+        };
+        requestBody?: never;
+        responses: {
+            /** @description 成功 */
+            200: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/json": {
+                        data?: {
+                            group?: {
+                                id?: string;
+                                name?: string;
+                                description?: string | null;
+                                status?: number;
+                                owner?: {
+                                    id?: string;
+                                    nickName?: string;
+                                    userName?: string;
+                                    realName?: string;
+                                    sn?: number;
+                                    avatar?: string;
+                                    roles?: string[];
+                                } | null;
+                            };
+                            inviter?: {
+                                id?: string;
+                                nickName?: string;
+                                userName?: string;
+                                realName?: string;
+                                sn?: number;
+                                avatar?: string | null;
+                                roles?: string[] | null;
+                            };
+                            role?: string;
+                            expires_at?: string;
+                            member_role?: string | null;
+                        };
+                    };
+                };
+            };
+            /** @description 链接无效、已过期,或签发人已不能邀请 */
+            404: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/problem+json": components["schemas"]["ProblemDetails"];
+                };
+            };
+            422: components["responses"]["ProblemValidation"];
+        };
+    };
     get_api_v3_groups: {
         parameters: {
             query?: {
@@ -39580,6 +39697,61 @@ export interface operations {
             422: components["responses"]["ProblemValidation"];
         };
     };
+    post_api_v3_groups_group_invite_links: {
+        parameters: {
+            query?: never;
+            header?: never;
+            path: {
+                /** @description 团队 uid */
+                group: string;
+            };
+            cookie?: never;
+        };
+        requestBody?: never;
+        responses: {
+            /** @description 成功 */
+            200: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/json": {
+                        data?: {
+                            token?: string;
+                            role?: string;
+                            expires_at?: string;
+                        };
+                    };
+                };
+            };
+            /** @description 签发成功 */
+            201: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/json": {
+                        data?: {
+                            token?: string;
+                            role?: string;
+                            expires_at?: string;
+                        };
+                    };
+                };
+            };
+            401: components["responses"]["ProblemUnauthorized"];
+            /** @description 不能管理这个团队的成员,或用 AI 模型的 token 调用 */
+            403: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/problem+json": components["schemas"]["ProblemDetails"];
+                };
+            };
+            422: components["responses"]["ProblemValidation"];
+        };
+    };
     get_api_v3_groups_group_members: {
         parameters: {
             query?: {
@@ -40499,6 +40671,95 @@ export interface operations {
             422: components["responses"]["ProblemValidation"];
         };
     };
+    post_api_v3_me_groups: {
+        parameters: {
+            query?: never;
+            header?: never;
+            path?: never;
+            cookie?: never;
+        };
+        requestBody: {
+            content: {
+                "application/json": {
+                    /** @description 邀请链接里的 token */
+                    invite: string;
+                };
+            };
+        };
+        responses: {
+            /** @description 成功 */
+            200: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/json": {
+                        data?: {
+                            id?: string;
+                            name?: string;
+                            description?: string | null;
+                            owner_id?: string;
+                            owner?: {
+                                id?: string;
+                                nickName?: string;
+                                userName?: string;
+                                realName?: string;
+                                sn?: number;
+                                avatar?: string;
+                                roles?: string[];
+                            } | null;
+                            status?: number;
+                            role?: string;
+                            member_id?: string;
+                            created_at?: string;
+                            joined_at?: string;
+                        };
+                    };
+                };
+            };
+            /** @description 已加入 */
+            201: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/json": {
+                        data?: {
+                            id?: string;
+                            name?: string;
+                            description?: string | null;
+                            owner_id?: string;
+                            owner?: {
+                                id?: string;
+                                nickName?: string;
+                                userName?: string;
+                                realName?: string;
+                                sn?: number;
+                                avatar?: string;
+                                roles?: string[];
+                            } | null;
+                            status?: number;
+                            role?: string;
+                            member_id?: string;
+                            created_at?: string;
+                            joined_at?: string;
+                        };
+                    };
+                };
+            };
+            401: components["responses"]["ProblemUnauthorized"];
+            /** @description 用 AI 模型的 token 调用 */
+            403: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/problem+json": components["schemas"]["ProblemDetails"];
+                };
+            };
+            422: components["responses"]["ProblemValidation"];
+        };
+    };
     get_api_v3_me_reactions: {
         parameters: {
             query?: {

+ 9 - 5
dashboard-v6/src/components/group/GroupMember.tsx

@@ -4,6 +4,7 @@ import { type ActionType, ProList } from "@ant-design/pro-components";
 import { Tag, Button, Layout, Popconfirm, Select, Space } from "antd";
 
 import GroupAddMember from "./AddMember";
+import GroupInviteLink from "./InviteLink";
 import User from "../auth/User";
 import type { IUser } from "../../api/Auth";
 import {
@@ -57,11 +58,14 @@ const GroupMemberWidget = ({ groupId }: IWidgetGroupFile) => {
           "-" +
           (memberCount?.toString() ?? "")
         }
-        toolBarRender={() => [
-          canManage && groupId ? (
-            <GroupAddMember key="add" groupId={groupId} onCreated={reload} />
-          ) : undefined,
-        ]}
+        toolBarRender={() =>
+          canManage && groupId
+            ? [
+                <GroupInviteLink key="invite" groupId={groupId} />,
+                <GroupAddMember key="add" groupId={groupId} onCreated={reload} />,
+              ]
+            : []
+        }
         request={async (params = {}) => {
           if (!groupId) {
             return { total: 0, success: false, data: [] };

+ 81 - 0
dashboard-v6/src/components/group/InviteLink.tsx

@@ -0,0 +1,81 @@
+import { useIntl } from "react-intl";
+import { useState } from "react";
+import { Button, Input, message, Modal, Space, Typography } from "antd";
+import { CopyOutlined, LinkOutlined } from "@ant-design/icons";
+
+import { createGroupInviteLink, groupInviteUrl } from "../../api/group-invite";
+
+interface IWidget {
+  groupId: string;
+}
+
+/**
+ * 「获取邀请链接」按钮:签一张链接,弹窗里给出地址与复制按钮。
+ * 每点一次签一张新的(旧的仍有效到过期),链接不落库、没有列表。
+ */
+const InviteLinkWidget = ({ groupId }: IWidget) => {
+  const intl = useIntl();
+  const [loading, setLoading] = useState(false);
+  const [link, setLink] = useState<{ url: string; expiresAt: string }>();
+
+  const open = async () => {
+    setLoading(true);
+    try {
+      // 失败(不是管理者等)由 unwrap 统一弹提示
+      const data = await createGroupInviteLink(groupId);
+      if (data?.token) {
+        setLink({
+          url: groupInviteUrl(data.token),
+          expiresAt: data.expires_at ?? "",
+        });
+      }
+    } finally {
+      setLoading(false);
+    }
+  };
+
+  const copy = () => {
+    if (!link) {
+      return;
+    }
+    navigator.clipboard.writeText(link.url).then(() => {
+      message.success(intl.formatMessage({ id: "message.copy.success" }));
+    });
+  };
+
+  return (
+    <>
+      <Button icon={<LinkOutlined />} loading={loading} onClick={open}>
+        {intl.formatMessage({ id: "buttons.group.invite.link" })}
+      </Button>
+      <Modal
+        open={!!link}
+        title={intl.formatMessage({ id: "buttons.group.invite.link" })}
+        onCancel={() => setLink(undefined)}
+        footer={null}
+        destroyOnHidden
+      >
+        <Space orientation="vertical" style={{ width: "100%" }}>
+          <Space.Compact style={{ width: "100%" }}>
+            <Input readOnly value={link?.url} onFocus={(e) => e.target.select()} />
+            <Button type="primary" icon={<CopyOutlined />} onClick={copy}>
+              {intl.formatMessage({ id: "buttons.copy" })}
+            </Button>
+          </Space.Compact>
+          <Typography.Text type="secondary">
+            {intl.formatMessage(
+              { id: "labels.group.invite.link.hint" },
+              {
+                expires: link?.expiresAt
+                  ? new Date(link.expiresAt).toLocaleString()
+                  : "",
+              }
+            )}
+          </Typography.Text>
+        </Space>
+      </Modal>
+    </>
+  );
+};
+
+export default InviteLinkWidget;

+ 5 - 0
dashboard-v6/src/locales/en-US/buttons.ts

@@ -120,6 +120,11 @@ const items = {
   "buttons.account.switch": "Switch account",
   "buttons.teamspace.leave": "Back to personal space",
   "buttons.back": "Back",
+  "buttons.group.invite.link": "Get Invite Link",
+  "buttons.group.invite.accept": "Accept and Join",
+  "buttons.group.invite.sign-in": "Sign in to Join",
+  "buttons.group.invite.enter": "Open Team Space",
+  "buttons.group.invite.decline": "Not Now",
 };
 
 export default items;

+ 6 - 0
dashboard-v6/src/locales/en-US/label.ts

@@ -201,6 +201,12 @@ const items = {
   "labels.route-error.404": "This content does not exist or has been deleted",
   "labels.route-error.403": "You are not allowed to view this content",
   "labels.route-error.other": "Failed to load. Please try again later",
+  "labels.group.invite.title": "Team Invitation",
+  "labels.group.invite.headline": "{inviter} invites you to join the team space “{name}”",
+  "labels.group.invite.role": "You will join as: {role}",
+  "labels.group.invite.link.hint": "Send this link to the people you want to invite. They join as Readers after accepting. The link is valid until {expires}.",
+  "labels.group.invite.invalid": "This invitation link is invalid or has expired. Ask a team manager for a new one.",
+  "labels.group.invite.member": "You are already a member of this team ({role}).",
 };
 
 export default items;

+ 1 - 0
dashboard-v6/src/locales/en-US/message.ts

@@ -20,6 +20,7 @@ const items = {
   "message.confirm-password.validate.fail": "password validate fail",
   "message.delete.success": "delete record {count}",
   "message.task.status.change": "Do you want change statue to {status}?",
+  "message.group.invite.joined": "You have joined “{name}”",
 };
 
 export default items;

+ 5 - 0
dashboard-v6/src/locales/zh-Hans/buttons.ts

@@ -121,6 +121,11 @@ const items = {
   "buttons.account.switch": "切换账号",
   "buttons.teamspace.leave": "切回个人空间",
   "buttons.back": "返回",
+  "buttons.group.invite.link": "获取邀请链接",
+  "buttons.group.invite.accept": "同意加入",
+  "buttons.group.invite.sign-in": "登录后加入",
+  "buttons.group.invite.enter": "进入团队空间",
+  "buttons.group.invite.decline": "暂不加入",
 };
 
 export default items;

+ 6 - 0
dashboard-v6/src/locales/zh-Hans/label.ts

@@ -205,6 +205,12 @@ const items = {
   "labels.route-error.404": "要找的内容不存在,或已被删除",
   "labels.route-error.403": "你没有权限查看这个内容",
   "labels.route-error.other": "加载失败,请稍后再试",
+  "labels.group.invite.title": "团队邀请",
+  "labels.group.invite.headline": "{inviter} 邀请你加入团队空间「{name}」",
+  "labels.group.invite.role": "加入后的角色:{role}",
+  "labels.group.invite.link.hint": "把这个链接发给要邀请的人,对方同意后以「只读成员」加入。链接在 {expires} 前有效。",
+  "labels.group.invite.invalid": "邀请链接无效或已过期,请向团队管理员索要新的链接。",
+  "labels.group.invite.member": "你已经是这个团队的成员({role})。",
 };
 
 export default items;

+ 1 - 0
dashboard-v6/src/locales/zh-Hans/message.ts

@@ -20,6 +20,7 @@ const items = {
   "message.confirm-password.validate.fail": "两次密码不一致",
   "message.delete.success": "成功删除{count}条数据",
   "message.task.status.change": "将任务状态修改为{status}吗?",
+  "message.group.invite.joined": "已加入团队「{name}」",
 };
 
 export default items;

+ 5 - 0
dashboard-v6/src/locales/zh-Hant/buttons.ts

@@ -121,6 +121,11 @@ const items = {
   "buttons.account.switch": "切換帳號",
   "buttons.teamspace.leave": "切回個人空間",
   "buttons.back": "返回",
+  "buttons.group.invite.link": "取得邀請連結",
+  "buttons.group.invite.accept": "同意加入",
+  "buttons.group.invite.sign-in": "登入後加入",
+  "buttons.group.invite.enter": "進入團隊空間",
+  "buttons.group.invite.decline": "暫不加入",
 };
 
 export default items;

+ 6 - 0
dashboard-v6/src/locales/zh-Hant/label.ts

@@ -205,6 +205,12 @@ const items = {
   "labels.route-error.404": "要找的內容不存在,或已被刪除",
   "labels.route-error.403": "你沒有權限查看這個內容",
   "labels.route-error.other": "載入失敗,請稍後再試",
+  "labels.group.invite.title": "團隊邀請",
+  "labels.group.invite.headline": "{inviter} 邀請你加入團隊空間「{name}」",
+  "labels.group.invite.role": "加入後的角色:{role}",
+  "labels.group.invite.link.hint": "把這個連結發給要邀請的人,對方同意後以「唯讀成員」加入。連結在 {expires} 前有效。",
+  "labels.group.invite.invalid": "邀請連結無效或已過期,請向團隊管理員索取新的連結。",
+  "labels.group.invite.member": "你已經是這個團隊的成員({role})。",
 };
 
 export default items;

+ 1 - 0
dashboard-v6/src/locales/zh-Hant/message.ts

@@ -20,6 +20,7 @@ const items = {
   "message.confirm-password.validate.fail": "兩次密碼不一致",
   "message.delete.success": "成功刪除{count}條資料",
   "message.task.status.change": "將任務狀態修改為{status}嗎?",
+  "message.group.invite.joined": "已加入團隊「{name}」",
 };
 
 export default items;

+ 162 - 0
dashboard-v6/src/pages/team-invite.tsx

@@ -0,0 +1,162 @@
+import { useEffect, useState } from "react";
+import { useIntl } from "react-intl";
+import { useNavigate, useParams } from "react-router";
+import { Alert, Button, Card, message, Space, Spin, Typography } from "antd";
+
+import {
+  acceptGroupInvite,
+  fetchGroupInvite,
+  type GroupInvite,
+} from "../api/group-invite";
+import { useAuth } from "../hooks/useAuth";
+import { useAppDispatch } from "../hooks";
+import { TO_HOME, TO_SIGN_IN } from "../reducers/current-user";
+import { refreshMyGroups } from "../features/teamspace/refreshMyGroups";
+
+/**
+ * 打开团队邀请链接:「xxx 邀请你加入团队空间 yyy」,同意后以只读成员加入。
+ *
+ * 不登录也能看;点「登录后加入」去登录页,登录完经 `?url=` 回到这里再点同意。
+ * 已经是成员的直接给「进入团队空间」。
+ */
+const Widget = () => {
+  const intl = useIntl();
+  const navigate = useNavigate();
+  const dispatch = useAppDispatch();
+  const { token } = useParams();
+  const { isAuthenticated } = useAuth();
+  const [invite, setInvite] = useState<GroupInvite>();
+  const [state, setState] = useState<"loading" | "ready" | "invalid">(
+    "loading"
+  );
+  const [joining, setJoining] = useState(false);
+
+  useEffect(() => {
+    if (!token) {
+      setState("invalid");
+      return;
+    }
+    setState("loading");
+    fetchGroupInvite(token)
+      .then((data) => {
+        setInvite(data);
+        setState(data ? "ready" : "invalid");
+      })
+      .catch(() => setState("invalid"));
+  }, [token]);
+
+  const roleLabel = (role?: string | null) =>
+    intl.formatMessage({ id: `labels.group.role.${role ?? "reader"}` });
+
+  const groupId = invite?.group?.id;
+  const enterTeam = () => navigate(`/workspace/team/${groupId}`);
+
+  const accept = async () => {
+    if (!token) {
+      return;
+    }
+    setJoining(true);
+    try {
+      // 失败(链接刚好过期、签发人被降级等)由 unwrap 统一弹提示
+      const joined = await acceptGroupInvite(token);
+      message.success(
+        intl.formatMessage(
+          { id: "message.group.invite.joined" },
+          { name: joined?.name ?? invite?.group?.name }
+        )
+      );
+      // 头像弹窗里的账户列表要多出这个团队
+      await refreshMyGroups(dispatch);
+      enterTeam();
+    } finally {
+      setJoining(false);
+    }
+  };
+
+  const signIn = () =>
+    navigate(`${TO_SIGN_IN}?url=${btoa(window.location.href)}`);
+
+  const title = intl.formatMessage({ id: "labels.group.invite.title" });
+
+  const body = () => {
+    if (state === "loading") {
+      return <Spin />;
+    }
+    if (state === "invalid" || !invite) {
+      return (
+        <Alert
+          type="warning"
+          showIcon
+          title={intl.formatMessage({ id: "labels.group.invite.invalid" })}
+        />
+      );
+    }
+    return (
+      <Space orientation="vertical" size="middle" style={{ width: "100%" }}>
+        <Typography.Title level={4} style={{ margin: 0 }}>
+          {intl.formatMessage(
+            { id: "labels.group.invite.headline" },
+            {
+              inviter: invite.inviter?.nickName,
+              name: invite.group?.name,
+            }
+          )}
+        </Typography.Title>
+        {invite.group?.description ? (
+          <Typography.Paragraph type="secondary" style={{ margin: 0 }}>
+            {invite.group.description}
+          </Typography.Paragraph>
+        ) : undefined}
+        {invite.member_role ? (
+          <>
+            <Alert
+              type="info"
+              showIcon
+              title={intl.formatMessage(
+                { id: "labels.group.invite.member" },
+                { role: roleLabel(invite.member_role) }
+              )}
+            />
+            <Button type="primary" onClick={enterTeam}>
+              {intl.formatMessage({ id: "buttons.group.invite.enter" })}
+            </Button>
+          </>
+        ) : (
+          <>
+            <Typography.Text>
+              {intl.formatMessage(
+                { id: "labels.group.invite.role" },
+                { role: roleLabel(invite.role) }
+              )}
+            </Typography.Text>
+            <Space>
+              {isAuthenticated ? (
+                <Button type="primary" loading={joining} onClick={accept}>
+                  {intl.formatMessage({ id: "buttons.group.invite.accept" })}
+                </Button>
+              ) : (
+                <Button type="primary" onClick={signIn}>
+                  {intl.formatMessage({ id: "buttons.group.invite.sign-in" })}
+                </Button>
+              )}
+              <Button onClick={() => navigate(TO_HOME)}>
+                {intl.formatMessage({ id: "buttons.group.invite.decline" })}
+              </Button>
+            </Space>
+          </>
+        )}
+      </Space>
+    );
+  };
+
+  return (
+    <>
+      <title>{title}</title>
+      <Card title={title} style={{ width: 440, maxWidth: "100%" }}>
+        {body()}
+      </Card>
+    </>
+  );
+};
+
+export default Widget;

+ 4 - 0
openapi/public/assets/protocol/main.yaml

@@ -815,10 +815,14 @@ paths:
     $ref: ./resources/auto/v3-email-certifications.yaml
   '/v3/glossaries/{kind}':
     $ref: ./resources/auto/v3-glossaries-kind.yaml
+  '/v3/group-invites/{token}':
+    $ref: ./resources/auto/v3-group-invites-token.yaml
   /v3/groups:
     $ref: ./resources/auto/v3-groups.yaml
   '/v3/groups/{group}':
     $ref: ./resources/auto/v3-groups-group.yaml
+  '/v3/groups/{group}/invite-links':
+    $ref: ./resources/auto/v3-groups-group-invite-links.yaml
   '/v3/groups/{group}/members':
     $ref: ./resources/auto/v3-groups-group-members.yaml
   '/v3/groups/{group}/members/{member}':

+ 67 - 0
openapi/public/assets/protocol/resources/auto/v3-group-invites-token.yaml

@@ -0,0 +1,67 @@
+# 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v3-group-invites-token.yaml
+get:
+  summary: 查看团队邀请
+  tags:
+    - group-invites
+  operationId: get_api_v3_group_invites_token_
+  description: |-
+    不登录也能看(私有团队也一样,链接本身就是凭证);登录了 `member_role` 给出
+    查看者在这个团队里现有的角色,还不是成员为 null。
+
+    实现:`V3\GroupInviteController@show`
+  security:
+    - {  }
+    -
+      bearerAuth: []
+  parameters:
+    -
+      name: token
+      in: path
+      required: true
+      schema:
+        type: string
+      description: '邀请链接里的 token'
+  responses:
+    200:
+      description: 成功
+      content:
+        application/json:
+          schema:
+            type: object
+            properties:
+              data:
+                type: object
+                properties:
+                  group:
+                    type: object
+                    properties:
+                      id: { type: string }
+                      name: { type: string }
+                      description: { type: string, nullable: true }
+                      status: { type: integer }
+                      owner: { type: object, properties: { id: { type: string }, nickName: { type: string }, userName: { type: string }, realName: { type: string }, sn: { type: integer }, avatar: { type: string }, roles: { type: array, items: { type: string } } }, nullable: true }
+                  inviter:
+                    type: object
+                    properties:
+                      id: { type: string }
+                      nickName: { type: string }
+                      userName: { type: string }
+                      realName: { type: string }
+                      sn: { type: integer }
+                      avatar: { type: string, nullable: true }
+                      roles: { type: array, items: { type: string }, nullable: true }
+                  role:
+                    type: string
+                  expires_at:
+                    type: string
+                  member_role:
+                    type: string
+                    nullable: true
+    404:
+      description: 链接无效、已过期,或签发人已不能邀请
+      content:
+        application/problem+json:
+          schema:
+            $ref: '../../main.yaml#/components/schemas/ProblemDetails'
+    422:
+      $ref: '../../main.yaml#/components/responses/ProblemValidation'

+ 65 - 0
openapi/public/assets/protocol/resources/auto/v3-groups-group-invite-links.yaml

@@ -0,0 +1,65 @@
+# 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v3-groups-group-invite-links.yaml
+post:
+  summary: 签一张团队邀请链接
+  tags:
+    - groups
+  operationId: post_api_v3_groups_group_invite_links
+  description: |-
+    团队的 owner / manager 才能调用。7 天有效,经它加入的成员角色是 reader(只读)。
+    链接不能单独作废:签发人被移出团队或降为 editor / reader 时,他签的链接全部失效。
+
+    实现:`V3\GroupInviteLinkController@store`
+  security:
+    -
+      bearerAuth: []
+  parameters:
+    -
+      name: group
+      in: path
+      required: true
+      schema:
+        type: string
+      description: '团队 uid'
+  responses:
+    200:
+      description: 成功
+      content:
+        application/json:
+          schema:
+            type: object
+            properties:
+              data:
+                type: object
+                properties:
+                  token:
+                    type: string
+                  role:
+                    type: string
+                  expires_at:
+                    type: string
+    201:
+      description: 签发成功
+      content:
+        application/json:
+          schema:
+            type: object
+            properties:
+              data:
+                type: object
+                properties:
+                  token:
+                    type: string
+                  role:
+                    type: string
+                  expires_at:
+                    type: string
+    401:
+      $ref: '../../main.yaml#/components/responses/ProblemUnauthorized'
+    403:
+      description: '不能管理这个团队的成员,或用 AI 模型的 token 调用'
+      content:
+        application/problem+json:
+          schema:
+            $ref: '../../main.yaml#/components/schemas/ProblemDetails'
+    422:
+      $ref: '../../main.yaml#/components/responses/ProblemValidation'

+ 118 - 1
openapi/public/assets/protocol/resources/auto/v3-me-groups.yaml

@@ -7,7 +7,7 @@ get:
   description: |-
     每条带我在团队里的角色(owner / manager / editor / reader),按加入时间排序。
 
-    实现:`V3\MeGroupController@__invoke`
+    实现:`V3\MeGroupController@index`
   security:
     -
       bearerAuth: []
@@ -80,3 +80,120 @@ get:
       $ref: '../../main.yaml#/components/responses/ProblemUnauthorized'
     422:
       $ref: '../../main.yaml#/components/responses/ProblemValidation'
+post:
+  summary: 凭邀请链接加入团队
+  tags:
+    - groups
+  operationId: post_api_v3_me_groups
+  description: |-
+    `invite` 是邀请链接里的 token(见 `POST /v3/groups/{group}/invite-links`),
+    加入后角色是 reader(只读)。已经是成员时原样返回现有的成员身份(200,角色不变)。
+    只给人类账号,AI 模型的 token 403。
+
+    实现:`V3\MeGroupController@store`
+  security:
+    -
+      bearerAuth: []
+  requestBody:
+    required: true
+    content:
+      application/json:
+        schema:
+          type: object
+          properties:
+            invite:
+              type: string
+              description: '邀请链接里的 token'
+          required:
+            - invite
+  responses:
+    200:
+      description: 成功
+      content:
+        application/json:
+          schema:
+            type: object
+            properties:
+              data:
+                type: object
+                properties:
+                  id:
+                    type: string
+                  name:
+                    type: string
+                  description:
+                    type: string
+                    nullable: true
+                  owner_id:
+                    type: string
+                  owner:
+                    type: object
+                    properties:
+                      id: { type: string }
+                      nickName: { type: string }
+                      userName: { type: string }
+                      realName: { type: string }
+                      sn: { type: integer }
+                      avatar: { type: string }
+                      roles: { type: array, items: { type: string } }
+                    nullable: true
+                  status:
+                    type: integer
+                  role:
+                    type: string
+                  member_id:
+                    type: string
+                  created_at:
+                    type: string
+                  joined_at:
+                    type: string
+    201:
+      description: 已加入
+      content:
+        application/json:
+          schema:
+            type: object
+            properties:
+              data:
+                type: object
+                properties:
+                  id:
+                    type: string
+                  name:
+                    type: string
+                  description:
+                    type: string
+                    nullable: true
+                  owner_id:
+                    type: string
+                  owner:
+                    type: object
+                    properties:
+                      id: { type: string }
+                      nickName: { type: string }
+                      userName: { type: string }
+                      realName: { type: string }
+                      sn: { type: integer }
+                      avatar: { type: string }
+                      roles: { type: array, items: { type: string } }
+                    nullable: true
+                  status:
+                    type: integer
+                  role:
+                    type: string
+                  member_id:
+                    type: string
+                  created_at:
+                    type: string
+                  joined_at:
+                    type: string
+    401:
+      $ref: '../../main.yaml#/components/responses/ProblemUnauthorized'
+    403:
+      description: '用 AI 模型的 token 调用'
+      content:
+        application/problem+json:
+          schema:
+            $ref: '../../main.yaml#/components/schemas/ProblemDetails'
+    422:
+      $ref: '../../main.yaml#/components/responses/ProblemValidation'