Explorar o código

Merge pull request #2506 from visuddhinanda/development

Development
visuddhinanda hai 1 día
pai
achega
5957867905
Modificáronse 70 ficheiros con 6987 adicións e 254 borrados
  1. 0 0
      CLAUDE.md
  2. 51 0
      api-test/cases/13_groups.php
  3. 27 0
      api-test/client/.openapi-generator/FILES
  4. 501 0
      api-test/client/lib/Api/GroupInvitesApi.php
  5. 723 50
      api-test/client/lib/Api/GroupsApi.php
  6. 16 2
      api-test/client/lib/Api/TipitakaExportsApi.php
  7. 409 0
      api-test/client/lib/Model/GetApiV3GroupInvitesToken200Response.php
  8. 552 0
      api-test/client/lib/Model/GetApiV3GroupInvitesToken200ResponseData.php
  9. 559 0
      api-test/client/lib/Model/GetApiV3GroupInvitesToken200ResponseDataGroup.php
  10. 627 0
      api-test/client/lib/Model/GetApiV3GroupInvitesToken200ResponseDataInviter.php
  11. 409 0
      api-test/client/lib/Model/PostApiV3GroupsGroupInviteLinks200Response.php
  12. 477 0
      api-test/client/lib/Model/PostApiV3GroupsGroupInviteLinks200ResponseData.php
  13. 409 0
      api-test/client/lib/Model/PostApiV3MeGroups200Response.php
  14. 412 0
      api-test/client/lib/Model/PostApiV3MeGroupsRequest.php
  15. 1 1
      api-v13/app/Console/Commands/MqExportTipitaka.php
  16. 0 4
      api-v13/app/Facades/RedisCache.php
  17. 39 0
      api-v13/app/Http/Controllers/V3/GroupInviteController.php
  18. 43 0
      api-v13/app/Http/Controllers/V3/GroupInviteLinkController.php
  19. 30 2
      api-v13/app/Http/Controllers/V3/MeGroupController.php
  20. 3 1
      api-v13/app/Http/Controllers/V3/TipitakaExportFileController.php
  21. 29 0
      api-v13/app/Http/Requests/V3/StoreMeGroupRequest.php
  22. 27 0
      api-v13/app/Http/Resources/V3/GroupInviteLinkResource.php
  23. 47 0
      api-v13/app/Http/Resources/V3/GroupInviteResource.php
  24. 1 64
      api-v13/app/Services/RedisCache.php
  25. 2 19
      api-v13/app/Services/RedisCacheFake.php
  26. 166 0
      api-v13/app/Services/V3/GroupInviteService.php
  27. 32 5
      api-v13/app/Services/V3/GroupMemberService.php
  28. 8 0
      api-v13/app/Services/V3/GroupService.php
  29. 40 13
      api-v13/app/Services/V3/TipitakaExportDownload.php
  30. 43 16
      api-v13/app/Services/V3/TipitakaExportService.php
  31. 3 2
      api-v13/config/mint.php
  32. 4 1
      api-v13/documents/tasks.md
  33. 1 0
      api-v13/resources/lang/en/messages.php
  34. 1 0
      api-v13/resources/lang/zh-Hans/messages.php
  35. 15 1
      api-v13/routes/v3/group.php
  36. 193 0
      api-v13/tests/Feature/GroupInviteV3Test.php
  37. 0 41
      api-v13/tests/Feature/RedisCacheTest.php
  38. 56 3
      api-v13/tests/Feature/TipitakaExportV3Test.php
  39. 115 0
      dashboard-test/src/tests/group-invite.spec.ts
  40. 8 0
      dashboard-v6/src/Router.tsx
  41. 49 0
      dashboard-v6/src/api/group-invite.ts
  42. 274 3
      dashboard-v6/src/api/schema.d.ts
  43. 2 3
      dashboard-v6/src/components/article/TypePali.tsx
  44. 2 3
      dashboard-v6/src/components/article/components/ArticleReaderToolbar.tsx
  45. 1 1
      dashboard-v6/src/components/attachment/AttachmentImport.tsx
  46. 2 2
      dashboard-v6/src/components/channel/ChannelMy.tsx
  47. 1 1
      dashboard-v6/src/components/course/CourseInfoEdit.tsx
  48. 1 1
      dashboard-v6/src/components/course/CourseMemberList.tsx
  49. 1 1
      dashboard-v6/src/components/general/DataImport.tsx
  50. 9 5
      dashboard-v6/src/components/group/GroupMember.tsx
  51. 81 0
      dashboard-v6/src/components/group/InviteLink.tsx
  52. 1 1
      dashboard-v6/src/components/setting/SettingAccount.tsx
  53. 4 4
      dashboard-v6/src/components/term/TermShare.tsx
  54. 5 0
      dashboard-v6/src/locales/en-US/buttons.ts
  55. 6 0
      dashboard-v6/src/locales/en-US/label.ts
  56. 1 0
      dashboard-v6/src/locales/en-US/message.ts
  57. 5 0
      dashboard-v6/src/locales/zh-Hans/buttons.ts
  58. 6 0
      dashboard-v6/src/locales/zh-Hans/label.ts
  59. 1 0
      dashboard-v6/src/locales/zh-Hans/message.ts
  60. 5 0
      dashboard-v6/src/locales/zh-Hant/buttons.ts
  61. 6 0
      dashboard-v6/src/locales/zh-Hant/label.ts
  62. 1 0
      dashboard-v6/src/locales/zh-Hant/message.ts
  63. 162 0
      dashboard-v6/src/pages/team-invite.tsx
  64. 2 2
      dashboard-v6/src/pages/workspace/channel/show.tsx
  65. 18 0
      dashboard-v6/src/utils.ts
  66. 4 0
      openapi/public/assets/protocol/main.yaml
  67. 67 0
      openapi/public/assets/protocol/resources/auto/v3-group-invites-token.yaml
  68. 65 0
      openapi/public/assets/protocol/resources/auto/v3-groups-group-invite-links.yaml
  69. 118 1
      openapi/public/assets/protocol/resources/auto/v3-me-groups.yaml
  70. 8 1
      openapi/public/assets/protocol/resources/auto/v3-tipitaka-exports-export-file.yaml

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
CLAUDE.md


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

@@ -1,10 +1,12 @@
 <?php
 <?php
 
 
+use \WikipaliApi\Api\GroupInvitesApi;
 use \WikipaliApi\Api\GroupsApi;
 use \WikipaliApi\Api\GroupsApi;
 use \WikipaliApi\Model\PatchApiV3GroupsGroupMembersMemberRequest;
 use \WikipaliApi\Model\PatchApiV3GroupsGroupMembersMemberRequest;
 use \WikipaliApi\Model\PatchApiV3GroupsGroupRequest;
 use \WikipaliApi\Model\PatchApiV3GroupsGroupRequest;
 use \WikipaliApi\Model\PostApiV3GroupsGroupMembersRequest;
 use \WikipaliApi\Model\PostApiV3GroupsGroupMembersRequest;
 use \WikipaliApi\Model\PostApiV3GroupsRequest;
 use \WikipaliApi\Model\PostApiV3GroupsRequest;
+use \WikipaliApi\Model\PostApiV3MeGroupsRequest;
 
 
 /*
 /*
  * v3 团队:/v3/groups(搜索、建、看、改、删)、/v3/me/groups、成员、团队文档。
  * 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));
     $anon = request(fn () => api(GroupsApi::class)->getApiV3GroupsGroupSharesWithHttpInfo($group));
     assert_status(401, $anon, 'group shares 无 token');
     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/DiscussionsApi.md
 docs/Api/EmailCertificationsApi.md
 docs/Api/EmailCertificationsApi.md
 docs/Api/GlossariesApi.md
 docs/Api/GlossariesApi.md
+docs/Api/GroupInvitesApi.md
 docs/Api/GroupsApi.md
 docs/Api/GroupsApi.md
 docs/Api/HeartbeatApi.md
 docs/Api/HeartbeatApi.md
 docs/Api/InvitesApi.md
 docs/Api/InvitesApi.md
@@ -114,6 +115,10 @@ docs/Model/GetApiV3DiscussionsSummary200ResponseDataStatusCounts.md
 docs/Model/GetApiV3GlossariesKind200Response.md
 docs/Model/GetApiV3GlossariesKind200Response.md
 docs/Model/GetApiV3GlossariesKind200ResponseDataInner.md
 docs/Model/GetApiV3GlossariesKind200ResponseDataInner.md
 docs/Model/GetApiV3GlossariesKind200ResponseMeta.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/GetApiV3Groups200Response.md
 docs/Model/GetApiV3Groups200ResponseDataInner.md
 docs/Model/GetApiV3Groups200ResponseDataInner.md
 docs/Model/GetApiV3GroupsGroupMembers200Response.md
 docs/Model/GetApiV3GroupsGroupMembers200Response.md
@@ -242,6 +247,8 @@ docs/Model/PostApiV3DiscussionsDiscussionRepliesRequest.md
 docs/Model/PostApiV3DiscussionsRequest.md
 docs/Model/PostApiV3DiscussionsRequest.md
 docs/Model/PostApiV3EmailCertificationsRequest.md
 docs/Model/PostApiV3EmailCertificationsRequest.md
 docs/Model/PostApiV3Groups200Response.md
 docs/Model/PostApiV3Groups200Response.md
+docs/Model/PostApiV3GroupsGroupInviteLinks200Response.md
+docs/Model/PostApiV3GroupsGroupInviteLinks200ResponseData.md
 docs/Model/PostApiV3GroupsGroupMembers200Response.md
 docs/Model/PostApiV3GroupsGroupMembers200Response.md
 docs/Model/PostApiV3GroupsGroupMembersRequest.md
 docs/Model/PostApiV3GroupsGroupMembersRequest.md
 docs/Model/PostApiV3GroupsRequest.md
 docs/Model/PostApiV3GroupsRequest.md
@@ -251,6 +258,8 @@ docs/Model/PostApiV3InvitesRequest.md
 docs/Model/PostApiV3MarkupPreviews200Response.md
 docs/Model/PostApiV3MarkupPreviews200Response.md
 docs/Model/PostApiV3MarkupPreviews200ResponseData.md
 docs/Model/PostApiV3MarkupPreviews200ResponseData.md
 docs/Model/PostApiV3MarkupPreviewsRequest.md
 docs/Model/PostApiV3MarkupPreviewsRequest.md
+docs/Model/PostApiV3MeGroups200Response.md
+docs/Model/PostApiV3MeGroupsRequest.md
 docs/Model/PostApiV3MeReactions200Response.md
 docs/Model/PostApiV3MeReactions200Response.md
 docs/Model/PostApiV3MeReactionsRequest.md
 docs/Model/PostApiV3MeReactionsRequest.md
 docs/Model/PostApiV3MeReadingTime200Response.md
 docs/Model/PostApiV3MeReadingTime200Response.md
@@ -286,6 +295,7 @@ lib/Api/CreditPolicyApi.php
 lib/Api/DiscussionsApi.php
 lib/Api/DiscussionsApi.php
 lib/Api/EmailCertificationsApi.php
 lib/Api/EmailCertificationsApi.php
 lib/Api/GlossariesApi.php
 lib/Api/GlossariesApi.php
+lib/Api/GroupInvitesApi.php
 lib/Api/GroupsApi.php
 lib/Api/GroupsApi.php
 lib/Api/HeartbeatApi.php
 lib/Api/HeartbeatApi.php
 lib/Api/InvitesApi.php
 lib/Api/InvitesApi.php
@@ -387,6 +397,10 @@ lib/Model/GetApiV3DiscussionsSummary200ResponseDataStatusCounts.php
 lib/Model/GetApiV3GlossariesKind200Response.php
 lib/Model/GetApiV3GlossariesKind200Response.php
 lib/Model/GetApiV3GlossariesKind200ResponseDataInner.php
 lib/Model/GetApiV3GlossariesKind200ResponseDataInner.php
 lib/Model/GetApiV3GlossariesKind200ResponseMeta.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/GetApiV3Groups200Response.php
 lib/Model/GetApiV3Groups200ResponseDataInner.php
 lib/Model/GetApiV3Groups200ResponseDataInner.php
 lib/Model/GetApiV3GroupsGroupMembers200Response.php
 lib/Model/GetApiV3GroupsGroupMembers200Response.php
@@ -516,6 +530,8 @@ lib/Model/PostApiV3DiscussionsDiscussionRepliesRequest.php
 lib/Model/PostApiV3DiscussionsRequest.php
 lib/Model/PostApiV3DiscussionsRequest.php
 lib/Model/PostApiV3EmailCertificationsRequest.php
 lib/Model/PostApiV3EmailCertificationsRequest.php
 lib/Model/PostApiV3Groups200Response.php
 lib/Model/PostApiV3Groups200Response.php
+lib/Model/PostApiV3GroupsGroupInviteLinks200Response.php
+lib/Model/PostApiV3GroupsGroupInviteLinks200ResponseData.php
 lib/Model/PostApiV3GroupsGroupMembers200Response.php
 lib/Model/PostApiV3GroupsGroupMembers200Response.php
 lib/Model/PostApiV3GroupsGroupMembersRequest.php
 lib/Model/PostApiV3GroupsGroupMembersRequest.php
 lib/Model/PostApiV3GroupsRequest.php
 lib/Model/PostApiV3GroupsRequest.php
@@ -525,6 +541,8 @@ lib/Model/PostApiV3InvitesRequest.php
 lib/Model/PostApiV3MarkupPreviews200Response.php
 lib/Model/PostApiV3MarkupPreviews200Response.php
 lib/Model/PostApiV3MarkupPreviews200ResponseData.php
 lib/Model/PostApiV3MarkupPreviews200ResponseData.php
 lib/Model/PostApiV3MarkupPreviewsRequest.php
 lib/Model/PostApiV3MarkupPreviewsRequest.php
+lib/Model/PostApiV3MeGroups200Response.php
+lib/Model/PostApiV3MeGroupsRequest.php
 lib/Model/PostApiV3MeReactions200Response.php
 lib/Model/PostApiV3MeReactions200Response.php
 lib/Model/PostApiV3MeReactionsRequest.php
 lib/Model/PostApiV3MeReactionsRequest.php
 lib/Model/PostApiV3MeReadingTime200Response.php
 lib/Model/PostApiV3MeReadingTime200Response.php
@@ -561,6 +579,7 @@ test/Api/CreditPolicyApiTest.php
 test/Api/DiscussionsApiTest.php
 test/Api/DiscussionsApiTest.php
 test/Api/EmailCertificationsApiTest.php
 test/Api/EmailCertificationsApiTest.php
 test/Api/GlossariesApiTest.php
 test/Api/GlossariesApiTest.php
+test/Api/GroupInvitesApiTest.php
 test/Api/GroupsApiTest.php
 test/Api/GroupsApiTest.php
 test/Api/HeartbeatApiTest.php
 test/Api/HeartbeatApiTest.php
 test/Api/InvitesApiTest.php
 test/Api/InvitesApiTest.php
@@ -658,6 +677,10 @@ test/Model/GetApiV3DiscussionsSummary200ResponseTest.php
 test/Model/GetApiV3GlossariesKind200ResponseDataInnerTest.php
 test/Model/GetApiV3GlossariesKind200ResponseDataInnerTest.php
 test/Model/GetApiV3GlossariesKind200ResponseMetaTest.php
 test/Model/GetApiV3GlossariesKind200ResponseMetaTest.php
 test/Model/GetApiV3GlossariesKind200ResponseTest.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/GetApiV3Groups200ResponseDataInnerTest.php
 test/Model/GetApiV3Groups200ResponseTest.php
 test/Model/GetApiV3Groups200ResponseTest.php
 test/Model/GetApiV3GroupsGroupMembers200ResponseDataInnerTest.php
 test/Model/GetApiV3GroupsGroupMembers200ResponseDataInnerTest.php
@@ -786,6 +809,8 @@ test/Model/PostApiV3DiscussionsDiscussionRepliesRequestTest.php
 test/Model/PostApiV3DiscussionsRequestTest.php
 test/Model/PostApiV3DiscussionsRequestTest.php
 test/Model/PostApiV3EmailCertificationsRequestTest.php
 test/Model/PostApiV3EmailCertificationsRequestTest.php
 test/Model/PostApiV3Groups200ResponseTest.php
 test/Model/PostApiV3Groups200ResponseTest.php
+test/Model/PostApiV3GroupsGroupInviteLinks200ResponseDataTest.php
+test/Model/PostApiV3GroupsGroupInviteLinks200ResponseTest.php
 test/Model/PostApiV3GroupsGroupMembers200ResponseTest.php
 test/Model/PostApiV3GroupsGroupMembers200ResponseTest.php
 test/Model/PostApiV3GroupsGroupMembersRequestTest.php
 test/Model/PostApiV3GroupsGroupMembersRequestTest.php
 test/Model/PostApiV3GroupsRequestTest.php
 test/Model/PostApiV3GroupsRequestTest.php
@@ -795,6 +820,8 @@ test/Model/PostApiV3InvitesRequestTest.php
 test/Model/PostApiV3MarkupPreviews200ResponseDataTest.php
 test/Model/PostApiV3MarkupPreviews200ResponseDataTest.php
 test/Model/PostApiV3MarkupPreviews200ResponseTest.php
 test/Model/PostApiV3MarkupPreviews200ResponseTest.php
 test/Model/PostApiV3MarkupPreviewsRequestTest.php
 test/Model/PostApiV3MarkupPreviewsRequestTest.php
+test/Model/PostApiV3MeGroups200ResponseTest.php
+test/Model/PostApiV3MeGroupsRequestTest.php
 test/Model/PostApiV3MeReactions200ResponseTest.php
 test/Model/PostApiV3MeReactions200ResponseTest.php
 test/Model/PostApiV3MeReactionsRequestTest.php
 test/Model/PostApiV3MeReactionsRequestTest.php
 test/Model/PostApiV3MeReadingTime200ResponseDataTest.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' => [
         'postApiV3Groups' => [
             'application/json',
             'application/json',
         ],
         ],
+        'postApiV3GroupsGroupInviteLinks' => [
+            'application/json',
+        ],
         'postApiV3GroupsGroupMembers' => [
         'postApiV3GroupsGroupMembers' => [
             'application/json',
             'application/json',
         ],
         ],
+        'postApiV3MeGroups' => [
+            'application/json',
+        ],
     ];
     ];
 
 
     /**
     /**
@@ -3641,40 +3647,38 @@ class GroupsApi
     }
     }
 
 
     /**
     /**
-     * Operation postApiV3GroupsGroupMembers
+     * Operation postApiV3GroupsGroupInviteLinks
      *
      *
-     * 加一名成员
+     * 签一张团队邀请链接
      *
      *
      * @param  string $group 团队 uid (required)
      * @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 \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
      * @throws \InvalidArgumentException
      * @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;
         return $response;
     }
     }
 
 
     /**
     /**
-     * Operation postApiV3GroupsGroupMembersWithHttpInfo
+     * Operation postApiV3GroupsGroupInviteLinksWithHttpInfo
      *
      *
-     * 加一名成员
+     * 签一张团队邀请链接
      *
      *
      * @param  string $group 团队 uid (required)
      * @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 \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
      * @throws \InvalidArgumentException
      * @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 {
         try {
             $options = $this->createHttpClientOption();
             $options = $this->createHttpClientOption();
@@ -3702,13 +3706,13 @@ class GroupsApi
             switch($statusCode) {
             switch($statusCode) {
                 case 200:
                 case 200:
                     return $this->handleResponseWithDataType(
                     return $this->handleResponseWithDataType(
-                        '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
+                        '\WikipaliApi\Model\PostApiV3GroupsGroupInviteLinks200Response',
                         $request,
                         $request,
                         $response,
                         $response,
                     );
                     );
                 case 201:
                 case 201:
                     return $this->handleResponseWithDataType(
                     return $this->handleResponseWithDataType(
-                        '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
+                        '\WikipaliApi\Model\PostApiV3GroupsGroupInviteLinks200Response',
                         $request,
                         $request,
                         $response,
                         $response,
                     );
                     );
@@ -3748,7 +3752,7 @@ class GroupsApi
             }
             }
 
 
             return $this->handleResponseWithDataType(
             return $this->handleResponseWithDataType(
-                '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
+                '\WikipaliApi\Model\PostApiV3GroupsGroupInviteLinks200Response',
                 $request,
                 $request,
                 $response,
                 $response,
             );
             );
@@ -3757,7 +3761,7 @@ class GroupsApi
                 case 200:
                 case 200:
                     $data = ObjectSerializer::deserialize(
                     $data = ObjectSerializer::deserialize(
                         $e->getResponseBody(),
                         $e->getResponseBody(),
-                        '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
+                        '\WikipaliApi\Model\PostApiV3GroupsGroupInviteLinks200Response',
                         $e->getResponseHeaders()
                         $e->getResponseHeaders()
                     );
                     );
                     $e->setResponseObject($data);
                     $e->setResponseObject($data);
@@ -3765,7 +3769,7 @@ class GroupsApi
                 case 201:
                 case 201:
                     $data = ObjectSerializer::deserialize(
                     $data = ObjectSerializer::deserialize(
                         $e->getResponseBody(),
                         $e->getResponseBody(),
-                        '\WikipaliApi\Model\PostApiV3GroupsGroupMembers200Response',
+                        '\WikipaliApi\Model\PostApiV3GroupsGroupInviteLinks200Response',
                         $e->getResponseHeaders()
                         $e->getResponseHeaders()
                     );
                     );
                     $e->setResponseObject($data);
                     $e->setResponseObject($data);
@@ -3802,20 +3806,19 @@ class GroupsApi
     }
     }
 
 
     /**
     /**
-     * Operation postApiV3GroupsGroupMembersAsync
+     * Operation postApiV3GroupsGroupInviteLinksAsync
      *
      *
-     * 加一名成员
+     * 签一张团队邀请链接
      *
      *
      * @param  string $group 团队 uid (required)
      * @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
      * @throws \InvalidArgumentException
      * @return \GuzzleHttp\Promise\PromiseInterface
      * @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(
             ->then(
                 function ($response) {
                 function ($response) {
                     return $response[0];
                     return $response[0];
@@ -3824,21 +3827,20 @@ class GroupsApi
     }
     }
 
 
     /**
     /**
-     * Operation postApiV3GroupsGroupMembersAsyncWithHttpInfo
+     * Operation postApiV3GroupsGroupInviteLinksAsyncWithHttpInfo
      *
      *
-     * 加一名成员
+     * 签一张团队邀请链接
      *
      *
      * @param  string $group 团队 uid (required)
      * @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
      * @throws \InvalidArgumentException
      * @return \GuzzleHttp\Promise\PromiseInterface
      * @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
         return $this->client
             ->sendAsync($request, $this->createHttpClientOption())
             ->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  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
      * @throws \InvalidArgumentException
      * @return \GuzzleHttp\Psr7\Request
      * @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
         // verify the required parameter 'group' is set
         if ($group === null || (is_array($group) && count($group) === 0)) {
         if ($group === null || (is_array($group) && count($group) === 0)) {
             throw new \InvalidArgumentException(
             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 = [];
         $formParams = [];
         $queryParams = [];
         $queryParams = [];
         $headerParams = [];
         $headerParams = [];
@@ -3930,16 +3924,695 @@ class GroupsApi
         );
         );
 
 
         // for model (json/xml)
         // 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 {
                 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) {
                 } catch (\JsonException $e) {
                     throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
                     throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
                 }
                 }
             } else {
             } 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) {
         } elseif (count($formParams) > 0) {
             if ($multipart) {
             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 \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
      * @throws \InvalidArgumentException
      * @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])
     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 \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
      * @throws \InvalidArgumentException
      * @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])
     public function getApiV3TipitakaExportsExportFileWithHttpInfo($export, $expires, $signature, string $contentType = self::contentTypes['getApiV3TipitakaExportsExportFile'][0])
     {
     {
@@ -495,6 +495,12 @@ class TipitakaExportsApi
                         $request,
                         $request,
                         $response,
                         $response,
                     );
                     );
+                case 302:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
                 case 403:
                 case 403:
                     return $this->handleResponseWithDataType(
                     return $this->handleResponseWithDataType(
                         '\WikipaliApi\Model\ProblemDetails',
                         '\WikipaliApi\Model\ProblemDetails',
@@ -559,6 +565,14 @@ class TipitakaExportsApi
                     );
                     );
                     $e->setResponseObject($data);
                     $e->setResponseObject($data);
                     throw $e;
                     throw $e;
+                case 302:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
                 case 403:
                 case 403:
                     $data = ObjectSerializer::deserialize(
                     $data = ObjectSerializer::deserialize(
                         $e->getResponseBody(),
                         $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));
+    }
+}
+
+

+ 1 - 1
api-v13/app/Console/Commands/MqExportTipitaka.php

@@ -10,7 +10,7 @@ use Illuminate\Console\Attributes\Signature;
 use Illuminate\Console\Command;
 use Illuminate\Console\Command;
 
 
 /**
 /**
- * 三藏下载(`/v3/tipitaka-exports`)的 worker:生成文件存进 Redis。单部作品的队列 `export_tipitaka`
+ * 三藏下载(`/v3/tipitaka-exports`)的 worker:生成文件存进临时区(生产是 S3)。单部作品的队列 `export_tipitaka`
  * 与打包的队列 `export_tipitaka_bulk`(`--bulk`)各跑一个,大打包不会堵住单部作品的下载。
  * 与打包的队列 `export_tipitaka_bulk`(`--bulk`)各跑一个,大打包不会堵住单部作品的下载。
  *
  *
  * 一次只处理一条(prefetch 1),生成完才 ack。最大的 channel 整个打包约 4 分钟(实测 cs6 html 217 秒,2026-11-22),
  * 一次只处理一条(prefetch 1),生成完才 ack。最大的 channel 整个打包约 4 分钟(实测 cs6 html 217 秒,2026-11-22),

+ 0 - 4
api-v13/app/Facades/RedisCache.php

@@ -14,10 +14,6 @@ use Illuminate\Support\Facades\Facade;
  * @method static bool has(string $key)
  * @method static bool has(string $key)
  * @method static bool forget(string $key)
  * @method static bool forget(string $key)
  * @method static int increment(string $key, int $value = 1)
  * @method static int increment(string $key, int $value = 1)
- * @method static bool putBinary(string $key, string $bytes, \DateTimeInterface|\DateInterval|int|null $ttl = null)
- * @method static string|null getBinary(string $key)
- * @method static int|null binaryLength(string $key)
- * @method static string getBinaryRange(string $key, int $start, int $end)
  *
  *
  * @see \App\Services\RedisCache
  * @see \App\Services\RedisCache
  */
  */

+ 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\Concerns\ResolvesCurrentUser;
 use App\Http\Controllers\Controller;
 use App\Http\Controllers\Controller;
 use App\Http\Requests\V3\IndexMeGroupRequest;
 use App\Http\Requests\V3\IndexMeGroupRequest;
+use App\Http\Requests\V3\StoreMeGroupRequest;
 use App\Http\Resources\V3\MeGroupResource;
 use App\Http\Resources\V3\MeGroupResource;
+use App\Services\V3\GroupInviteService;
 use App\Services\V3\GroupMemberService;
 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`):
  * `GET /v2/group?view=studio&view2=…` 与 `GET /v2/group-my-number`(`GroupController`):
  * 「我创建的 / 我参加的」用 `owned` 过滤,数量读 `meta.total`。v2 那几份在
  * 「我创建的 / 我参加的」用 `owned` 过滤,数量读 `meta.total`。v2 那几份在
  * dashboard-v4 下线前原样保留,不要改动。
  * dashboard-v4 下线前原样保留,不要改动。
+ *
+ * 凭邀请链接加入团队(POST)是新能力,没有对应的 v2 端点;链接的签发与规则见
+ * {@see GroupInviteService}。
  */
  */
 class MeGroupController extends Controller
 class MeGroupController extends Controller
 {
 {
     use ResolvesCurrentUser;
     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 page integer 页码。Default: 1
      * @queryParam per_page integer 每页数量,最大 200。Default: 100
      * @queryParam per_page integer 每页数量,最大 200。Default: 100
      */
      */
-    public function __invoke(IndexMeGroupRequest $request)
+    public function index(IndexMeGroupRequest $request)
     {
     {
         $filters = $request->safe()->only(['search']);
         $filters = $request->safe()->only(['search']);
         if ($request->has('owned')) {
         if ($request->has('owned')) {
@@ -45,4 +53,24 @@ class MeGroupController extends Controller
             $request->integer('per_page', 100),
             $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'],
+        ));
+    }
 }
 }

+ 3 - 1
api-v13/app/Http/Controllers/V3/TipitakaExportFileController.php

@@ -17,7 +17,8 @@ class TipitakaExportFileController extends Controller
     /**
     /**
      * 下载文件
      * 下载文件
      *
      *
-     * 支持 `Range`(206,断点续传)与 `If-None-Match`(304,ETag 就是导出 id)。
+     * 文件存在 S3 时 302 跳到 S3 的临时链接(1 小时有效,客户端跟随跳转即可);本地开发直接返回文件。
+     * 两种情况都支持 `Range`(206,断点续传)与 `If-None-Match`(304)。
      * 离线包(offline)是 NDJSON,带 `Content-Encoding: gzip`,HTTP 客户端会自动解压。
      * 离线包(offline)是 NDJSON,带 `Content-Encoding: gzip`,HTTP 客户端会自动解压。
      * 签名无效或过期 403,文件已过期 404。
      * 签名无效或过期 403,文件已过期 404。
      *
      *
@@ -30,6 +31,7 @@ class TipitakaExportFileController extends Controller
      *
      *
      * @responseFile application/zip application/epub+zip application/vnd.openxmlformats-officedocument.wordprocessingml.document application/x-ndjson
      * @responseFile application/zip application/epub+zip application/vnd.openxmlformats-officedocument.wordprocessingml.document application/x-ndjson
      *
      *
+     * @responseStatus 302 文件在 S3:跳到临时下载链接
      * @responseStatus 206 Range 请求的部分内容
      * @responseStatus 206 Range 请求的部分内容
      * @responseStatus 304 If-None-Match 命中,本地文件就是最新的
      * @responseStatus 304 If-None-Match 命中,本地文件就是最新的
      * @responseStatus 403 签名无效或已过期
      * @responseStatus 403 签名无效或已过期

+ 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(),
+        ];
+    }
+}

+ 1 - 64
api-v13/app/Services/RedisCache.php

@@ -28,12 +28,6 @@ use RedisCluster;
  *
  *
  * 集群与 Laravel Cache 用的单机 Redis 不是同一个库,旧缓存不迁移,切换后冷启动。
  * 集群与 Laravel Cache 用的单机 Redis 不是同一个库,旧缓存不迁移,切换后冷启动。
  *
  *
- * 二进制(导出的 zip、epub 等)走另一组方法 putBinary / getBinary / binaryLength / getBinaryRange:
- * 原样存字节,不经 JSON。同一个 key 只能用一组方法读写——用 get() 读二进制 key 会抛 JsonException,
- * 所以二进制 key 要放在自己的命名空间下(如 `/tipitaka-export/file/…`)。大文件用 getBinaryRange
- * 分块读(GETRANGE),不必把整个值读进 PHP 内存,也正好支持 HTTP Range。
- * 2026-11-21 在 3 主 3 从集群上实测 40MB:SET 95ms、GET 76ms、1MB×40 次 GETRANGE 共 74ms,字节完整。
- *
  * 业务代码通过门面 App\Facades\RedisCache 调用;测试用 RedisCache::fake()
  * 业务代码通过门面 App\Facades\RedisCache 调用;测试用 RedisCache::fake()
  * 换成内存实现(见 RedisCacheFake)。
  * 换成内存实现(见 RedisCacheFake)。
  */
  */
@@ -127,44 +121,6 @@ class RedisCache
         return $this->incrementBy($this->key($key), $value);
         return $this->incrementBy($this->key($key), $value);
     }
     }
 
 
-    /**
-     * 原样写入字节(不经 JSON)。TTL 语义同 put()。
-     */
-    public function putBinary(string $key, string $bytes, DateTimeInterface|DateInterval|int|null $ttl = null): bool
-    {
-        $seconds = $this->secondsUntil($ttl ?? static::$defaultTtl);
-
-        if ($seconds <= 0) {
-            return $this->forget($key);
-        }
-
-        return $this->write($this->key($key), $bytes, $seconds);
-    }
-
-    /**
-     * 原样读回 putBinary() 写入的字节;不存在返回 null。
-     */
-    public function getBinary(string $key): ?string
-    {
-        return $this->read($this->key($key));
-    }
-
-    /**
-     * 值的字节数(STRLEN);不存在返回 null。
-     */
-    public function binaryLength(string $key): ?int
-    {
-        return $this->length($this->key($key));
-    }
-
-    /**
-     * 读字节闭区间 [$start, $end](GETRANGE),越界部分截掉;不存在返回空串。
-     */
-    public function getBinaryRange(string $key, int $start, int $end): string
-    {
-        return $this->range($this->key($key), $start, $end);
-    }
-
     /**
     /**
      * 前缀与 key 之间用 / 隔开:`dev` + `foo` → `dev/foo`;`/task/1` 本身带 /,得 `dev/task/1`。
      * 前缀与 key 之间用 / 隔开:`dev` + `foo` → `dev/foo`;`/task/1` 本身带 /,得 `dev/task/1`。
      */
      */
@@ -174,7 +130,7 @@ class RedisCache
     }
     }
 
 
     /**
     /**
-     * 以下六个是仅有的 Redis 存取原语,RedisCacheFake 只需覆盖它们。
+     * 以下四个是仅有的 Redis 存取原语,RedisCacheFake 只需覆盖它们。
      * 参数 $key 已带前缀。
      * 参数 $key 已带前缀。
      */
      */
     protected function read(string $key): ?string
     protected function read(string $key): ?string
@@ -204,25 +160,6 @@ class RedisCache
         return (int) $this->redis()->incrby($key, $value);
         return (int) $this->redis()->incrby($key, $value);
     }
     }
 
 
-    /**
-     * STRLEN 对不存在的 key 返回 0,与空值分不清,所以先看 EXISTS。
-     */
-    protected function length(string $key): ?int
-    {
-        if (! $this->redis()->exists($key)) {
-            return null;
-        }
-
-        return (int) $this->redis()->strlen($key);
-    }
-
-    protected function range(string $key, int $start, int $end): string
-    {
-        $value = $this->redis()->getRange($key, $start, $end);
-
-        return is_string($value) ? $value : '';
-    }
-
     /**
     /**
      * 第一个参数 null 表示不读 php.ini 里的具名集群,直接用种子节点。
      * 第一个参数 null 表示不读 php.ini 里的具名集群,直接用种子节点。
      */
      */

+ 2 - 19
api-v13/app/Services/RedisCacheFake.php

@@ -5,8 +5,8 @@ namespace App\Services;
 /**
 /**
  * RedisCache 的内存实现,供测试使用(相当于 Laravel Cache 的 array store)。
  * RedisCache 的内存实现,供测试使用(相当于 Laravel Cache 的 array store)。
  *
  *
- * 只替换存取原语,序列化、TTL 换算、null 语义仍走 RedisCache 本身,
- * 所以测试覆盖到的是真实逻辑。二进制的 length / range 两个原语也在这里覆盖。通过 App\Facades\RedisCache::fake() 启用。
+ * 只替换四个存取原语,序列化、TTL 换算、null 语义仍走 RedisCache 本身,
+ * 所以测试覆盖到的是真实逻辑。通过 App\Facades\RedisCache::fake() 启用。
  */
  */
 class RedisCacheFake extends RedisCache
 class RedisCacheFake extends RedisCache
 {
 {
@@ -60,21 +60,4 @@ class RedisCacheFake extends RedisCache
 
 
         return $next;
         return $next;
     }
     }
-
-    protected function length(string $key): ?int
-    {
-        $value = $this->read($key);
-
-        return $value === null ? null : strlen($value);
-    }
-
-    protected function range(string $key, int $start, int $end): string
-    {
-        $value = $this->read($key) ?? '';
-        if ($start >= strlen($value) || $end < $start) {
-            return '';
-        }
-
-        return substr($value, $start, $end - $start + 1);
-    }
 }
 }

+ 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
 class GroupMemberService
 {
 {
+    /** 加人不指定角色时的默认角色:只读 */
+    public const DEFAULT_ROLE = GroupMember::ROLE_READER;
+
     public function __construct(private readonly GroupAbilityService $abilities) {}
     public function __construct(private readonly GroupAbilityService $abilities) {}
 
 
     /**
     /**
@@ -37,10 +40,7 @@ class GroupMemberService
      */
      */
     public function listForUser(string $userUid, array $filters, int $perPage): LengthAwarePaginator
     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)
             ->where('user_id', $userUid)
             ->whereHas('group', function ($query) use ($userUid, $filters) {
             ->whereHas('group', function ($query) use ($userUid, $filters) {
                 if (array_key_exists('owned', $filters)) {
                 if (array_key_exists('owned', $filters)) {
@@ -95,7 +95,7 @@ class GroupMemberService
             throw ValidationException::withMessages(['user_id' => __('messages.group_member_exists')]);
             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 = new GroupMember;
         $member->forceFill([
         $member->forceFill([
             'id' => app('snowflake')->id(),
             'id' => app('snowflake')->id(),
@@ -109,6 +109,20 @@ class GroupMemberService
         return $member->load(UserService::eagerLoadActor()[0]);
         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();
         $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
      * @throws AuthorizationException
      */
      */

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

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

+ 40 - 13
api-v13/app/Services/V3/TipitakaExportDownload.php

@@ -2,19 +2,27 @@
 
 
 namespace App\Services\V3;
 namespace App\Services\V3;
 
 
-use App\Facades\RedisCache;
+use Illuminate\Support\Facades\Storage;
 use Symfony\Component\HttpFoundation\HeaderUtils;
 use Symfony\Component\HttpFoundation\HeaderUtils;
 use Symfony\Component\HttpFoundation\Response;
 use Symfony\Component\HttpFoundation\Response;
 use Symfony\Component\HttpFoundation\StreamedResponse;
 use Symfony\Component\HttpFoundation\StreamedResponse;
 
 
 /**
 /**
- * 把 Redis 里的导出文件流给客户端:按 1MB 分块 GETRANGE 读,不把整个文件读进 PHP 内存;
- * 支持单段 `Range`(mobile 断点续传)与 `If-None-Match`(id 即内容指纹,可当强 ETag)。
+ * 把临时区里的导出文件交给客户端。
+ *
+ * - 默认磁盘是 S3(生产):302 跳到 S3 的临时签名链接,流量不经 PHP;文件名由链接参数给,
+ *   类型与离线包的 `Content-Encoding: gzip` 已写在对象上,`Range` / `If-None-Match` 由 S3 处理。
+ * - 其他磁盘(本地开发):自己流式读,按 1MB 分块,不把整个文件读进内存;
+ *   支持单段 `Range`(mobile 断点续传)与 `If-None-Match`。ETag 按文件的大小与修改时间算,不用导出 id:
+ *   同一范围重新生成会覆盖同一个文件,旧 id 的链接拿到的是新文件。
  */
  */
 class TipitakaExportDownload
 class TipitakaExportDownload
 {
 {
     private const CHUNK = 1024 * 1024;
     private const CHUNK = 1024 * 1024;
 
 
+    /** 跳去 S3 的签名链接有效多久(秒)。每次下载现签;给慢速网络下的大文件留足时间。 */
+    private const REDIRECT_TTL = 3600;
+
     public function __construct(private readonly TipitakaExportService $exports) {}
     public function __construct(private readonly TipitakaExportService $exports) {}
 
 
     public function respond(string $id, ?string $range, ?string $ifNoneMatch): Response
     public function respond(string $id, ?string $range, ?string $ifNoneMatch): Response
@@ -23,14 +31,21 @@ class TipitakaExportDownload
         if ($file === null) {
         if ($file === null) {
             abort(404, __('messages.export_not_found'));
             abort(404, __('messages.export_not_found'));
         }
         }
-        $etag = '"'.$id.'"';
+        $disposition = HeaderUtils::makeDisposition(
+            HeaderUtils::DISPOSITION_ATTACHMENT,
+            $file['filename'],
+            $this->asciiFallback($file['filename']),
+        );
+        if (config('filesystems.disks.'.config('filesystems.default').'.driver') === 's3') {
+            return redirect()->away(Storage::temporaryUrl($file['path'], now()->addSeconds(self::REDIRECT_TTL), [
+                'ResponseContentDisposition' => $disposition,
+            ]));
+        }
+
+        $etag = '"'.$file['size'].'-'.Storage::lastModified($file['path']).'"';
         $headers = [
         $headers = [
             'Content-Type' => $file['content_type'],
             'Content-Type' => $file['content_type'],
-            'Content-Disposition' => HeaderUtils::makeDisposition(
-                HeaderUtils::DISPOSITION_ATTACHMENT,
-                $file['filename'],
-                $this->asciiFallback($file['filename']),
-            ),
+            'Content-Disposition' => $disposition,
             'Accept-Ranges' => 'bytes',
             'Accept-Ranges' => 'bytes',
             'ETag' => $etag,
             'ETag' => $etag,
             'Cache-Control' => 'private, max-age=0, must-revalidate',
             'Cache-Control' => 'private, max-age=0, must-revalidate',
@@ -62,13 +77,25 @@ class TipitakaExportDownload
             $headers['Content-Range'] = "bytes {$start}-{$end}/{$size}";
             $headers['Content-Range'] = "bytes {$start}-{$end}/{$size}";
         }
         }
         $headers['Content-Length'] = (string) ($end - $start + 1);
         $headers['Content-Length'] = (string) ($end - $start + 1);
-        $key = $this->exports->fileKey($id);
+        $path = $file['path'];
 
 
-        return new StreamedResponse(function () use ($key, $start, $end) {
-            for ($offset = $start; $offset <= $end; $offset += self::CHUNK) {
-                echo RedisCache::getBinaryRange($key, $offset, min($end, $offset + self::CHUNK - 1));
+        return new StreamedResponse(function () use ($path, $start, $end) {
+            $stream = Storage::readStream($path);
+            if ($stream === null) {
+                return;
+            }
+            fseek($stream, $start);
+            $remaining = $end - $start + 1;
+            while ($remaining > 0 && ! feof($stream)) {
+                $chunk = fread($stream, min(self::CHUNK, $remaining));
+                if ($chunk === false || $chunk === '') {
+                    break;
+                }
+                echo $chunk;
                 flush();
                 flush();
+                $remaining -= strlen($chunk);
             }
             }
+            fclose($stream);
         }, $status, $headers);
         }, $status, $headers);
     }
     }
 
 

+ 43 - 16
api-v13/app/Services/V3/TipitakaExportService.php

@@ -10,8 +10,10 @@ use App\Services\TipitakaCatalogService;
 use Illuminate\Database\Eloquent\Builder;
 use Illuminate\Database\Eloquent\Builder;
 use Illuminate\Support\Carbon;
 use Illuminate\Support\Carbon;
 use Illuminate\Support\Facades\Log;
 use Illuminate\Support\Facades\Log;
+use Illuminate\Support\Facades\Storage;
 use Illuminate\Support\Facades\URL;
 use Illuminate\Support\Facades\URL;
 use Illuminate\Validation\ValidationException;
 use Illuminate\Validation\ValidationException;
+use RuntimeException;
 use Throwable;
 use Throwable;
 
 
 /**
 /**
@@ -19,7 +21,11 @@ use Throwable;
  *
  *
  * 流程:请求方 request() → 已有同一份文件就直接给;没有就写一条 queued 状态、投递到 RabbitMQ
  * 流程:请求方 request() → 已有同一份文件就直接给;没有就写一条 queued 状态、投递到 RabbitMQ
  * (TipitakaExportQueue:单部作品与打包分两个队列)→ worker `mq:export.tipitaka` 调 run() 生成(TipitakaExportBuilder)→
  * (TipitakaExportQueue:单部作品与打包分两个队列)→ worker `mq:export.tipitaka` 调 run() 生成(TipitakaExportBuilder)→
- * 文件以二进制存进 Redis 集群(RedisCache::putBinary),保留 `mint.tipitaka_export.ttl`。
+ * 文件存进默认磁盘的临时区(生产是 S3),状态存 Redis,保留 `mint.tipitaka_export.ttl`。
+ *
+ * **文件路径按范围固定,不跟 id 走**({@see self::filePath()}):同一 channel、同一范围、同一格式永远是同一个对象。
+ * Redis 状态过期、或译文改了换了 id,重新生成时覆盖原来那份,临时区不会积累没人读的旧文件。
+ * 旧 id 的下载链接(7 天内)拿到的是覆盖后的最新文件。
  *
  *
  * **id 就是内容指纹**:channel + 范围 + 格式 + 模板版本 + 范围内句子的最后修改时间与条数。
  * **id 就是内容指纹**:channel + 范围 + 格式 + 模板版本 + 范围内句子的最后修改时间与条数。
  * 所以谁先生成谁就给后来的人用;译文一改,指纹就变,自然重新生成,不需要失效逻辑。
  * 所以谁先生成谁就给后来的人用;译文一改,指纹就变,自然重新生成,不需要失效逻辑。
@@ -121,8 +127,8 @@ class TipitakaExportService
             abort(404, __('messages.export_not_found'));
             abort(404, __('messages.export_not_found'));
         }
         }
         $this->abilities->assertReadable($status['channel'], $userUid);
         $this->abilities->assertReadable($status['channel'], $userUid);
-        if ($status['status'] === 'ready' && ! $this->fileExists($id)) {
-            // 文件被 Redis 淘汰了,状态还在:当作没生成过,让客户端重新发起
+        if ($status['status'] === 'ready' && ! $this->fileExists($status)) {
+            // 文件被清掉了,状态还在:当作没生成过,让客户端重新发起
             abort(404, __('messages.export_not_found'));
             abort(404, __('messages.export_not_found'));
         }
         }
 
 
@@ -197,12 +203,12 @@ class TipitakaExportService
     }
     }
 
 
     /**
     /**
-     * worker 入口:生成一份导出并存进 Redis。已经生成好、或状态已过期被清掉的直接跳过。
+     * worker 入口:生成一份导出,文件存进临时区、状态存 Redis。已经生成好、或状态已过期被清掉的直接跳过。
      */
      */
     public function run(string $id): void
     public function run(string $id): void
     {
     {
         $status = $this->find($id);
         $status = $this->find($id);
-        if ($status === null || ($status['status'] === 'ready' && $this->fileExists($id))) {
+        if ($status === null || ($status['status'] === 'ready' && $this->fileExists($status))) {
             return;
             return;
         }
         }
         $status = $this->save(['status' => 'running', 'progress' => 0.0, 'message' => null] + $status);
         $status = $this->save(['status' => 'running', 'progress' => 0.0, 'message' => null] + $status);
@@ -218,7 +224,14 @@ class TipitakaExportService
                 throw new BusinessException(__('messages.export_too_large'), 422, 'export-too-large');
                 throw new BusinessException(__('messages.export_too_large'), 422, 'export-too-large');
             }
             }
             $ttl = (int) config('mint.tipitaka_export.ttl');
             $ttl = (int) config('mint.tipitaka_export.ttl');
-            RedisCache::putBinary($this->fileKey($id), $file, $ttl);
+            // S3 上把类型与传输编码写进对象:下载时直接跳到 S3,离线包靠 Content-Encoding: gzip 让客户端自动解压
+            $stored = Storage::put($this->filePath($status), $file, array_filter([
+                'ContentType' => $status['content_type'],
+                'ContentEncoding' => $status['format'] === 'offline' ? 'gzip' : null,
+            ]));
+            if (! $stored) {
+                throw new RuntimeException('tipitaka-export: cannot store '.$this->filePath($status));
+            }
             $this->save([
             $this->save([
                 'status' => 'ready',
                 'status' => 'ready',
                 'progress' => 1.0,
                 'progress' => 1.0,
@@ -235,31 +248,42 @@ class TipitakaExportService
     }
     }
 
 
     /**
     /**
-     * 文件在 Redis 里的 key。下载接口按它分块读。
+     * 文件在默认磁盘上的路径(临时区):`{temporary}/tipitaka-exports/{channel}/{format}/{work-sn | category-id | channel}`。
+     * 只由 channel、范围、格式决定,与内容指纹(id)、模板版本无关,重新生成时覆盖同一个对象。
+     *
+     * @param  array<string, mixed>  $status  导出状态(spec() 的字段)
      */
      */
-    public function fileKey(string $id): string
+    public function filePath(array $status): string
     {
     {
-        return "/tipitaka-export/file/{$id}";
+        $scope = match ($status['scope']['kind']) {
+            'work' => 'work-'.$status['scope']['work'],
+            'category' => 'category-'.$status['scope']['category'],
+            default => 'channel',
+        };
+
+        return config('mint.attachments.bucket_name.temporary')."/tipitaka-exports/{$status['channel']}/{$status['format']}/{$scope}";
     }
     }
 
 
     /**
     /**
      * 已生成的文件的元数据;没有(或不可下载)返回 null。
      * 已生成的文件的元数据;没有(或不可下载)返回 null。
      *
      *
-     * @return array{filename: string, content_type: string, content_encoding: string|null, size: int}|null
+     * @return array{path: string, filename: string, content_type: string, content_encoding: string|null, size: int}|null
      */
      */
     public function file(string $id): ?array
     public function file(string $id): ?array
     {
     {
         $status = $this->find($id);
         $status = $this->find($id);
-        $size = RedisCache::binaryLength($this->fileKey($id));
-        if ($status === null || $status['status'] !== 'ready' || $size === null) {
+        if ($status === null || $status['status'] !== 'ready' || ! $this->fileExists($status)) {
             return null;
             return null;
         }
         }
+        $path = $this->filePath($status);
 
 
         return [
         return [
+            'path' => $path,
             'filename' => $status['filename'],
             'filename' => $status['filename'],
             'content_type' => $status['content_type'],
             'content_type' => $status['content_type'],
             'content_encoding' => $status['format'] === 'offline' ? 'gzip' : null,
             'content_encoding' => $status['format'] === 'offline' ? 'gzip' : null,
-            'size' => $size,
+            // 按文件实际大小:这个范围后来又生成过的话,旧 id 的状态里记的是旧文件的大小
+            'size' => (int) Storage::size($path),
         ];
         ];
     }
     }
 
 
@@ -357,7 +381,7 @@ class TipitakaExportService
     private function reusable(array $status): bool
     private function reusable(array $status): bool
     {
     {
         return match ($status['status']) {
         return match ($status['status']) {
-            'ready' => $this->fileExists($status['id']),
+            'ready' => $this->fileExists($status),
             'queued', 'running' => now()->diffInSeconds($status['updated_at'], true) < (int) config('mint.tipitaka_export.stale_after'),
             'queued', 'running' => now()->diffInSeconds($status['updated_at'], true) < (int) config('mint.tipitaka_export.stale_after'),
             default => false,
             default => false,
         };
         };
@@ -417,9 +441,12 @@ class TipitakaExportService
         return $status;
         return $status;
     }
     }
 
 
-    private function fileExists(string $id): bool
+    /**
+     * @param  array<string, mixed>  $status
+     */
+    private function fileExists(array $status): bool
     {
     {
-        return RedisCache::binaryLength($this->fileKey($id)) !== null;
+        return Storage::exists($this->filePath($status));
     }
     }
 
 
     private function statusKey(string $id): string
     private function statusKey(string $id): string

+ 3 - 2
api-v13/config/mint.php

@@ -216,9 +216,10 @@ return [
     'tipitaka_export' => [
     'tipitaka_export' => [
         // 生成前按范围内句子的 strlen 之和估算,超过就 422,不排队
         // 生成前按范围内句子的 strlen 之和估算,超过就 422,不排队
         'max_source_chars' => (int) env('TIPITAKA_EXPORT_MAX_SOURCE_CHARS', 160 * 1024 * 1024),
         'max_source_chars' => (int) env('TIPITAKA_EXPORT_MAX_SOURCE_CHARS', 160 * 1024 * 1024),
-        // 生成后的文件超过就判失败、不写 Redis(单个值太大会撑爆从库同步缓冲,见 RedisCache 类注释)
+        // 生成后的文件超过就判失败、不上传(整个文件在 worker 内存里拼好再传,cs6 整个 channel 的 html zip 是 44MB)
         'max_file_bytes' => (int) env('TIPITAKA_EXPORT_MAX_FILE_BYTES', 64 * 1024 * 1024),
         'max_file_bytes' => (int) env('TIPITAKA_EXPORT_MAX_FILE_BYTES', 64 * 1024 * 1024),
-        // 文件与状态在 Redis 里保留多久
+        // 导出状态在 Redis 里保留多久。文件在临时区(mint.attachments.bucket_name.temporary/tipitaka-exports/),
+        // 路径按范围固定:状态过期或译文改了,重新生成时覆盖同一个文件
         'ttl' => 7 * 24 * 3600,
         'ttl' => 7 * 24 * 3600,
         // 排队 / 生成中的状态多久没更新就当作 worker 丢了,下次请求重新排队
         // 排队 / 生成中的状态多久没更新就当作 worker 丢了,下次请求重新排队
         'stale_after' => 1800,
         'stale_after' => 1800,

+ 4 - 1
api-v13/documents/tasks.md

@@ -46,7 +46,10 @@ php artisan mq:export.tipitaka --bulk
 三藏下载的两个 worker 要分开跑,打包才不会堵住单部作品。它们处理完一条才 ack。实测 cs6 整个 channel(282 部作品)的 html 打包 217 秒、zip 43.7 MiB、
 三藏下载的两个 worker 要分开跑,打包才不会堵住单部作品。它们处理完一条才 ack。实测 cs6 整个 channel(282 部作品)的 html 打包 217 秒、zip 43.7 MiB、
 内存峰值 172 MB(2026-11-22,段落缓存全冷;阅读段落冷启动优化之前是 2286 秒)。
 内存峰值 172 MB(2026-11-22,段落缓存全冷;阅读段落冷启动优化之前是 2286 秒)。
 数据库或渲染变慢时仍可能超过 RabbitMQ 的 `consumer_timeout`(默认 30 分钟),建议调大,否则跑到一半被服务端断开(开发机 `rabbitmq.conf` 是 333600000,约 92 小时)。
 数据库或渲染变慢时仍可能超过 RabbitMQ 的 `consumer_timeout`(默认 30 分钟),建议调大,否则跑到一半被服务端断开(开发机 `rabbitmq.conf` 是 333600000,约 92 小时)。
-生成的文件存在 Redis 集群里(7 天,`mint.tipitaka_export`),中间文件在 `storage/app/tmp/tipitaka-export/`,跑完即删。
+生成的文件存在默认磁盘的临时区 `{ATTACHMENTS_TEMPORARY_BUCKET_NAME}/tipitaka-exports/{channel}/{format}/{work-sn|category-id|channel}`
+(生产是 S3,下载时 302 跳到 S3 临时链接)。路径只按范围定,Redis 里的导出状态(7 天,`mint.tipitaka_export`)过期或译文改了,
+重新生成时覆盖同一个文件,不会积累旧文件。
+中间文件在 `storage/app/tmp/tipitaka-export/`,跑完即删。
 epub / docx 依赖服务器上的 `pandoc`(3.x,路径可用 `PANDOC_PATH` 指定)。
 epub / docx 依赖服务器上的 `pandoc`(3.x,路径可用 `PANDOC_PATH` 指定)。
 
 
 `ai_translate_v2`(`rabbitmq:consume`)待第二阶段重构 worker 后补上。`content` 队列已移除(无消费者,发送端已注释,见 `SentenceController@update` 的 FIXME)。
 `ai_translate_v2`(`rabbitmq:consume`)待第二阶段重构 worker 后补上。`content` 队列已移除(无消费者,发送端已注释,见 `SentenceController@update` 的 FIXME)。

+ 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_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_name_exists' => 'You already have a team with this name.',
     'group_share_not_found' => 'This resource is not shared with this team.',
     '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.',
     'agent_not_allowed' => 'AI models cannot perform this action. Please use a human account.',
     'channel_forbidden' => 'You are not allowed to do this.',
     'channel_forbidden' => 'You are not allowed to do this.',
     'channel_studio_forbidden' => 'You cannot view or manage the channels of this studio (team).',
     '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_has_resources' => '团队名下还有资源,请先转让或删除它们再删除团队。',
     'group_name_exists' => '你名下已经有同名的团队了。',
     'group_name_exists' => '你名下已经有同名的团队了。',
     'group_share_not_found' => '这项资源没有共享给这个团队。',
     'group_share_not_found' => '这项资源没有共享给这个团队。',
+    'group_invite_invalid' => '邀请链接无效或已过期。',
     'agent_not_allowed' => 'AI 模型不能执行这个操作,请用人类账号。',
     'agent_not_allowed' => 'AI 模型不能执行这个操作,请用人类账号。',
     'channel_forbidden' => '你没有权限执行这个操作。',
     'channel_forbidden' => '你没有权限执行这个操作。',
     'channel_studio_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\GroupController;
+use App\Http\Controllers\V3\GroupInviteController;
+use App\Http\Controllers\V3\GroupInviteLinkController;
 use App\Http\Controllers\V3\GroupMemberController;
 use App\Http\Controllers\V3\GroupMemberController;
 use App\Http\Controllers\V3\GroupShareController;
 use App\Http\Controllers\V3\GroupShareController;
 use App\Http\Controllers\V3\MeGroupController;
 use App\Http\Controllers\V3\MeGroupController;
 use Illuminate\Support\Facades\Route;
 use Illuminate\Support\Facades\Route;
 
 
 // 我加入的团队:没有第二个主体(不会出现 me 以外的值),所以是 /me/ 下的独立端点
 // 我加入的团队:没有第二个主体(不会出现 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
 // 团队本身。详情可不登录(公开团队谁都能看),其余要登录。只注册 PATCH,不注册 PUT
 Route::apiResource('groups', GroupController::class)
 Route::apiResource('groups', GroupController::class)
@@ -56,4 +65,9 @@ Route::middleware('auth.v3')->scopeBindings()->group(function () {
         ->only(['index', 'destroy'])
         ->only(['index', 'destroy'])
         ->whereUuid('group')
         ->whereUuid('group')
         ->whereNumber('share');
         ->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();
+});

+ 0 - 41
api-v13/tests/Feature/RedisCacheTest.php

@@ -131,30 +131,6 @@ test('increment 从 0 开始累加,返回新值', function () {
         ->and(RedisCache::get('c'))->toBe(6);
         ->and(RedisCache::get('c'))->toBe(6);
 });
 });
 
 
-test('二进制原样往返,长度与区间读取正确', function () {
-    $bytes = "\x00\xff\x80PK\x03\x04".random_bytes(1000);
-    RedisCache::putBinary('/bin/a', $bytes, 60);
-
-    expect(RedisCache::getBinary('/bin/a'))->toBe($bytes)
-        ->and(RedisCache::binaryLength('/bin/a'))->toBe(strlen($bytes))
-        ->and(RedisCache::getBinaryRange('/bin/a', 2, 5))->toBe(substr($bytes, 2, 4))
-        ->and(RedisCache::getBinaryRange('/bin/a', 1000, 9999))->toBe(substr($bytes, 1000))
-        ->and(RedisCache::getBinaryRange('/bin/a', 99999, 100000))->toBe('');
-});
-
-test('二进制 key 不存在时读到 null,TTL <= 0 等同 forget', function () {
-    RedisCache::putBinary('/bin/b', 'x', 60);
-    RedisCache::putBinary('/bin/b', 'y', 0);
-
-    expect(RedisCache::getBinary('/bin/b'))->toBeNull()
-        ->and(RedisCache::binaryLength('/bin/b'))->toBeNull()
-        ->and(RedisCache::getBinaryRange('/bin/b', 0, 10))->toBe('');
-});
-
-test('非 UTF-8 字节用 put 存不了,必须走 putBinary', function () {
-    expect(fn () => RedisCache::put('/bin/c', "\xff\xfe"))->toThrow(JsonException::class);
-});
-
 /*
 /*
 | 第二部分:契约。连真实 Redis Cluster(mint.redis_cluster),证明 key 名带前缀、
 | 第二部分:契约。连真实 Redis Cluster(mint.redis_cluster),证明 key 名带前缀、
 | 值是 JSON、整数是纯文本(ai-translate 用 int() 读 /task/{id}/pointer)、TTL 与写值一条命令落地,
 | 值是 JSON、整数是纯文本(ai-translate 用 int() 读 /task/{id}/pointer)、TTL 与写值一条命令落地,
@@ -233,20 +209,3 @@ test('不存在的 key 读到 null / 默认值,forget 返回 false', function
         ->and($cache->get('missing', 'd'))->toBe('d')
         ->and($cache->get('missing', 'd'))->toBe('d')
         ->and($cache->forget('missing'))->toBeFalse();
         ->and($cache->forget('missing'))->toBeFalse();
 })->skip(fn () => ! realRedisAvailable(), '没有可用的 Redis Cluster');
 })->skip(fn () => ! realRedisAvailable(), '没有可用的 Redis Cluster');
-
-test('二进制在集群里原样落地、带 TTL,可按区间读', function () {
-    $cache = new RedisCacheService(prefix: redisCacheTestPrefix());
-    $bytes = random_bytes(3 * 1024 * 1024);
-    $cache->putBinary('bin', $bytes, 60);
-
-    $chunks = '';
-    for ($offset = 0; $offset < strlen($bytes); $offset += 1048576) {
-        $chunks .= $cache->getBinaryRange('bin', $offset, $offset + 1048575);
-    }
-
-    expect(rawRedisCluster()->get(redisCacheTestPrefix().'/bin'))->toBe($bytes)
-        ->and(rawRedisCluster()->ttl(redisCacheTestPrefix().'/bin'))->toBeGreaterThan(0)->toBeLessThanOrEqual(60)
-        ->and($cache->binaryLength('bin'))->toBe(strlen($bytes))
-        ->and($chunks)->toBe($bytes)
-        ->and($cache->binaryLength('missing-bin'))->toBeNull();
-})->skip(fn () => ! realRedisAvailable(), '没有可用的 Redis Cluster');

+ 56 - 3
api-v13/tests/Feature/TipitakaExportV3Test.php

@@ -1,24 +1,29 @@
 <?php
 <?php
 
 
+use App\Facades\RedisCache;
 use App\Models\BookTitle;
 use App\Models\BookTitle;
 use App\Models\Channel;
 use App\Models\Channel;
 use App\Models\PaliText;
 use App\Models\PaliText;
 use App\Models\ProgressChapter;
 use App\Models\ProgressChapter;
+use App\Models\Sentence;
 use App\Models\Tag;
 use App\Models\Tag;
 use App\Models\TagMap;
 use App\Models\TagMap;
 use App\Services\V3\TipitakaExportQueue;
 use App\Services\V3\TipitakaExportQueue;
 use App\Services\V3\TipitakaExportService;
 use App\Services\V3\TipitakaExportService;
 use Illuminate\Foundation\Testing\RefreshDatabase;
 use Illuminate\Foundation\Testing\RefreshDatabase;
+use Illuminate\Support\Facades\Storage;
 use Illuminate\Support\Str;
 use Illuminate\Support\Str;
 
 
 /*
 /*
 | 三藏下载 /v3/tipitaka-exports。这里断言的是形状而非契约(spectator 未安装)。
 | 三藏下载 /v3/tipitaka-exports。这里断言的是形状而非契约(spectator 未安装)。
 | 生成在测试里同步调 TipitakaExportService::run(),队列换成 mock,不连 RabbitMQ;
 | 生成在测试里同步调 TipitakaExportService::run(),队列换成 mock,不连 RabbitMQ;
-| 文件进的是 RedisCacheFake(TestCase 已换好)。
+| 文件进的是 Storage::fake() 的默认磁盘(本地磁盘的流式下载);S3 的跳转单独一条测。
 */
 */
 
 
 uses(RefreshDatabase::class);
 uses(RefreshDatabase::class);
 
 
+beforeEach(fn () => Storage::fake());
+
 function exportPaliText(int $book, int $paragraph, int $level, int $chapterLen, string $toc = ''): PaliText
 function exportPaliText(int $book, int $paragraph, int $level, int $chapterLen, string $toc = ''): PaliText
 {
 {
     $row = new PaliText;
     $row = new PaliText;
@@ -155,7 +160,6 @@ it('generates an html work export and serves it through the signed link', functi
     $file = $this->get($data['download_url'])
     $file = $this->get($data['download_url'])
         ->assertOk()
         ->assertOk()
         ->assertHeader('Content-Type', 'application/zip')
         ->assertHeader('Content-Type', 'application/zip')
-        ->assertHeader('ETag', '"'.$data['id'].'"')
         ->assertHeader('Accept-Ranges', 'bytes');
         ->assertHeader('Accept-Ranges', 'bytes');
     expect($file->headers->get('Content-Disposition'))->toContain("filename*=utf-8''");
     expect($file->headers->get('Content-Disposition'))->toContain("filename*=utf-8''");
     $bytes = $file->streamedContent();
     $bytes = $file->streamedContent();
@@ -174,7 +178,56 @@ it('generates an html work export and serves it through the signed link', functi
         ->assertHeader('Content-Range', "bytes 10-19/{$data['size']}");
         ->assertHeader('Content-Range', "bytes 10-19/{$data['size']}");
     expect($part->streamedContent())->toBe(substr($bytes, 10, 10));
     expect($part->streamedContent())->toBe(substr($bytes, 10, 10));
     $this->get($data['download_url'], ['Range' => 'bytes=999999999-'])->assertStatus(416);
     $this->get($data['download_url'], ['Range' => 'bytes=999999999-'])->assertStatus(416);
-    $this->get($data['download_url'], ['If-None-Match' => '"'.$data['id'].'"'])->assertStatus(304);
+    $this->get($data['download_url'], ['If-None-Match' => $file->headers->get('ETag')])->assertStatus(304);
+});
+
+it('stores the file in the temporary area and redirects to a signed S3 link when the disk is S3', function () {
+    config(['filesystems.default' => 's3']);
+    Storage::fake('s3')->buildTemporaryUrlsUsing(
+        fn (string $path, DateTimeInterface $expiration, array $options) => "https://s3.test/{$path}?".http_build_query($options)
+    );
+    fakeExportQueue();
+    ['channel' => $channel, 'sn' => $sn] = exportFixture();
+
+    $data = exportReady(['channel' => $channel, 'work' => $sn, 'format' => 'html']);
+    $path = config('mint.attachments.bucket_name.temporary')."/tipitaka-exports/{$channel}/html/work-{$sn}";
+    Storage::disk('s3')->assertExists($path);
+    expect(Storage::disk('s3')->size($path))->toBe($data['size']);
+
+    $location = $this->get($data['download_url'])->assertRedirect()->headers->get('Location');
+    expect($location)->toStartWith("https://s3.test/{$path}?")
+        ->and(urldecode($location))->toContain('ResponseContentDisposition=attachment;')->toContain("filename*=utf-8''");
+
+    // 文件被生命周期规则清掉了:状态还在也当作没有
+    Storage::disk('s3')->delete($path);
+    $this->get($data['download_url'])->assertNotFound();
+    $this->getJson("/api/v3/tipitaka-exports/{$data['id']}")->assertNotFound();
+});
+
+it('regenerates into the same file once the status expires or the translation changes', function () {
+    fakeExportQueue();
+    ['channel' => $channel, 'sn' => $sn] = exportFixture();
+    $path = config('mint.attachments.bucket_name.temporary')."/tipitaka-exports/{$channel}/html/work-{$sn}";
+
+    $first = exportReady(['channel' => $channel, 'work' => $sn, 'format' => 'html']);
+    expect(Storage::files(dirname($path)))->toBe([$path]);
+
+    // Redis 里的状态过期:重新生成,同一个 id、同一个文件
+    RedisCache::forget("/tipitaka-export/status/{$first['id']}");
+    $again = exportReady(['channel' => $channel, 'work' => $sn, 'format' => 'html']);
+    expect($again['id'])->toBe($first['id'])
+        ->and(Storage::files(dirname($path)))->toBe([$path]);
+
+    // 译文改了:换了 id,仍覆盖同一个文件;旧 id 的链接拿到的是新文件
+    $sentence = Sentence::where('channel_uid', $channel)->orderBy('paragraph')->first();
+    // 范围统计(指纹的来源)缓存 5 分钟;指纹看 max(updated_at),改动要晚于建好的数据
+    $this->travel(6)->minutes();
+    $sentence->forceFill(['content' => '改过的译文', 'strlen' => 5])->save();
+    $changed = exportReady(['channel' => $channel, 'work' => $sn, 'format' => 'html']);
+    expect($changed['id'])->not->toBe($first['id'])
+        ->and(Storage::files(dirname($path)))->toBe([$path]);
+    $files = unzipExport($this->get($first['download_url'])->assertOk()->streamedContent());
+    expect(array_values($files)[0])->toContain('改过的译文');
 });
 });
 
 
 it('rejects the file link without a valid signature', function () {
 it('rejects the file link without a valid signature', function () {

+ 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 UsersForgotPassword = lazy(() => import("./pages/users/forgot-password"));
 const UsersResetPassword = lazy(() => import("./pages/users/reset-password"));
 const UsersResetPassword = lazy(() => import("./pages/users/reset-password"));
 const DashboardIndex = lazy(() => import("./pages/dashboard/index"));
 const DashboardIndex = lazy(() => import("./pages/dashboard/index"));
+const TeamInvite = lazy(() => import("./pages/team-invite"));
 
 
 const Home = lazy(() => import("./pages/home"));
 const Home = lazy(() => import("./pages/home"));
 // 整页搜索;workspace 的搜索弹窗「在整页打开」跳到这里
 // 整页搜索;workspace 的搜索弹窗「在整页打开」跳到这里
@@ -85,6 +86,13 @@ const router = createBrowserRouter(
             { path: "reset-password/:token", Component: UsersResetPassword },
             { 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",
           path: "dashboard",
           Component: DashboardLayout,
           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;

+ 274 - 3
dashboard-v6/src/api/schema.d.ts

@@ -8579,6 +8579,29 @@ export interface paths {
         patch?: never;
         patch?: never;
         trace?: 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": {
     "/v3/groups": {
         parameters: {
         parameters: {
             query?: never;
             query?: never;
@@ -8642,6 +8665,29 @@ export interface paths {
         patch: operations["patch_api_v3_groups_group_"];
         patch: operations["patch_api_v3_groups_group_"];
         trace?: never;
         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": {
     "/v3/groups/{group}/members": {
         parameters: {
         parameters: {
             query?: never;
             query?: never;
@@ -8959,11 +9005,19 @@ export interface paths {
          * 列出我加入的团队
          * 列出我加入的团队
          * @description 每条带我在团队里的角色(owner / manager / editor / reader),按加入时间排序。
          * @description 每条带我在团队里的角色(owner / manager / editor / reader),按加入时间排序。
          *
          *
-         *     实现:`V3\MeGroupController@__invoke`
+         *     实现:`V3\MeGroupController@index`
          */
          */
         get: operations["get_api_v3_me_groups"];
         get: operations["get_api_v3_me_groups"];
         put?: never;
         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;
         delete?: never;
         options?: never;
         options?: never;
         head?: never;
         head?: never;
@@ -9623,7 +9677,8 @@ export interface paths {
         };
         };
         /**
         /**
          * 下载文件
          * 下载文件
-         * @description 支持 `Range`(206,断点续传)与 `If-None-Match`(304,ETag 就是导出 id)。
+         * @description 文件存在 S3 时 302 跳到 S3 的临时链接(1 小时有效,客户端跟随跳转即可);本地开发直接返回文件。
+         *     两种情况都支持 `Range`(206,断点续传)与 `If-None-Match`(304)。
          *     离线包(offline)是 NDJSON,带 `Content-Encoding: gzip`,HTTP 客户端会自动解压。
          *     离线包(offline)是 NDJSON,带 `Content-Encoding: gzip`,HTTP 客户端会自动解压。
          *     签名无效或过期 403,文件已过期 404。
          *     签名无效或过期 403,文件已过期 404。
          *
          *
@@ -39285,6 +39340,69 @@ export interface operations {
             422: components["responses"]["ProblemValidation"];
             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: {
     get_api_v3_groups: {
         parameters: {
         parameters: {
             query?: {
             query?: {
@@ -39579,6 +39697,61 @@ export interface operations {
             422: components["responses"]["ProblemValidation"];
             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: {
     get_api_v3_groups_group_members: {
         parameters: {
         parameters: {
             query?: {
             query?: {
@@ -40498,6 +40671,95 @@ export interface operations {
             422: components["responses"]["ProblemValidation"];
             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: {
     get_api_v3_me_reactions: {
         parameters: {
         parameters: {
             query?: {
             query?: {
@@ -42933,6 +43195,15 @@ export interface operations {
                     "application/x-ndjson": string;
                     "application/x-ndjson": string;
                 };
                 };
             };
             };
+            /** @description 文件在 S3:跳到临时下载链接 */
+            302: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/problem+json": components["schemas"]["ProblemDetails"];
+                };
+            };
             /** @description If-None-Match 命中,本地文件就是最新的 */
             /** @description If-None-Match 命中,本地文件就是最新的 */
             304: {
             304: {
                 headers: {
                 headers: {

+ 2 - 3
dashboard-v6/src/components/article/TypePali.tsx

@@ -28,7 +28,7 @@ import type { TTarget } from "../../types";
 import TocPath from "../tipitaka/TocPath";
 import TocPath from "../tipitaka/TocPath";
 import ParagraphNode from "../tipitaka/ParagraphNode";
 import ParagraphNode from "../tipitaka/ParagraphNode";
 import "./article.css";
 import "./article.css";
-import { articlePath, fullUrl } from "../../utils";
+import { articlePath, fullUrl, libraryUrl } from "../../utils";
 
 
 import { useIntl } from "react-intl";
 import { useIntl } from "react-intl";
 
 
@@ -200,8 +200,7 @@ const TypePali = ({
                 if (key === "tpl") setTplOpen(true);
                 if (key === "tpl") setTplOpen(true);
                 if (key === "library" && channels) {
                 if (key === "library" && channels) {
                   window.open(
                   window.open(
-                    import.meta.env.VITE_APP_API_SERVER +
-                      `/library/tipitaka/${id}/read?channel=${channels[0]}`,
+                    libraryUrl(`tipitaka/${id}/read?channel=${channels[0]}`),
                     "_blank",
                     "_blank",
                   );
                   );
                 }
                 }

+ 2 - 3
dashboard-v6/src/components/article/components/ArticleReaderToolbar.tsx

@@ -16,7 +16,7 @@ import { useAppSelector } from "../../../hooks";
 import { currentUser } from "../../../reducers/current-user";
 import { currentUser } from "../../../reducers/current-user";
 
 
 import { useState } from "react";
 import { useState } from "react";
-import { articlePath, fullUrl } from "../../../utils";
+import { articlePath, fullUrl, libraryUrl } from "../../../utils";
 
 
 import type { TRole } from "../../../api/Auth";
 import type { TRole } from "../../../api/Auth";
 import { useIntl } from "react-intl";
 import { useIntl } from "react-intl";
@@ -135,8 +135,7 @@ const TypeArticleReaderToolbarWidget = ({
                     break;
                     break;
                   case "open_in_library":
                   case "open_in_library":
                     window.open(
                     window.open(
-                      import.meta.env.VITE_APP_API_SERVER +
-                        `/library/anthology/${anthologyId}/read/${articleId}`,
+                      libraryUrl(`anthology/${anthologyId}/read/${articleId}`),
                       "_blank"
                       "_blank"
                     );
                     );
                     break;
                     break;

+ 1 - 1
dashboard-v6/src/components/attachment/AttachmentImport.tsx

@@ -30,7 +30,7 @@ const AttachmentImportWidget = ({
     name: "file",
     name: "file",
     listType: "picture",
     listType: "picture",
     multiple: replaceId ? false : true,
     multiple: replaceId ? false : true,
-    action: `${import.meta.env.BASE_URL}/api/v2/attachment?id=${replaceId}`,
+    action: `/api/v2/attachment?id=${replaceId}`,
     headers: {
     headers: {
       Authorization: `Bearer ${getToken()}`,
       Authorization: `Bearer ${getToken()}`,
     },
     },

+ 2 - 2
dashboard-v6/src/components/channel/ChannelMy.tsx

@@ -35,6 +35,7 @@ import TokenModal from "../token/TokenModal";
 import NissayaAlignerModal from "../nissaya/NissayaAlignerModal";
 import NissayaAlignerModal from "../nissaya/NissayaAlignerModal";
 import { useChannelProgress } from "./hooks/useChannelProgress";
 import { useChannelProgress } from "./hooks/useChannelProgress";
 import type { IChannel, IChannelItem } from "../../api/channel";
 import type { IChannel, IChannelItem } from "../../api/channel";
+import { libraryUrl } from "../../utils";
 
 
 const { Search } = Input;
 const { Search } = Input;
 
 
@@ -336,8 +337,7 @@ const ChannelMy = ({
                         break;
                         break;
                       case "library":
                       case "library":
                         window.open(
                         window.open(
-                          import.meta.env.VITE_APP_API_SERVER +
-                            `/library/tipitaka?channel=${ch.id}`,
+                          libraryUrl(`tipitaka?channel=${ch.id}`),
                           "_blank"
                           "_blank"
                         );
                         );
                         break;
                         break;

+ 1 - 1
dashboard-v6/src/components/course/CourseInfoEdit.tsx

@@ -206,7 +206,7 @@ const CourseInfoEditWidget = ({
                 return true;
                 return true;
               },
               },
             }}
             }}
-            action={`${import.meta.env.BASE_URL}/api/v2/attachment`}
+            action={`/api/v2/attachment`}
             extra="封面必须为正方形。最大512*512"
             extra="封面必须为正方形。最大512*512"
           />
           />
         </ProForm.Group>
         </ProForm.Group>

+ 1 - 1
dashboard-v6/src/components/course/CourseMemberList.tsx

@@ -408,7 +408,7 @@ const CourseMemberListWidget = ({ courseId, onSelect }: IWidget) => {
           />,
           />,
           <Tooltip title="导出成员列表">
           <Tooltip title="导出成员列表">
             <a
             <a
-              href={`${import.meta.env.BASE_URL}/api/v2/course-member-export?course_id=${courseId}`}
+              href={`/api/v2/course-member-export?course_id=${courseId}`}
               target="_blank"
               target="_blank"
               key="export"
               key="export"
               rel="noreferrer"
               rel="noreferrer"

+ 1 - 1
dashboard-v6/src/components/general/DataImport.tsx

@@ -92,7 +92,7 @@ const DataImportWidget = ({
         fieldProps={{
         fieldProps={{
           name: "file",
           name: "file",
         }}
         }}
-        action={`${import.meta.env.BASE_URL}/api/v2/attachments?is_tmp=true`}
+        action={`/api/v2/attachments?is_tmp=true`}
       />
       />
     </ModalForm>
     </ModalForm>
   );
   );

+ 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 { Tag, Button, Layout, Popconfirm, Select, Space } from "antd";
 
 
 import GroupAddMember from "./AddMember";
 import GroupAddMember from "./AddMember";
+import GroupInviteLink from "./InviteLink";
 import User from "../auth/User";
 import User from "../auth/User";
 import type { IUser } from "../../api/Auth";
 import type { IUser } from "../../api/Auth";
 import {
 import {
@@ -57,11 +58,14 @@ const GroupMemberWidget = ({ groupId }: IWidgetGroupFile) => {
           "-" +
           "-" +
           (memberCount?.toString() ?? "")
           (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 = {}) => {
         request={async (params = {}) => {
           if (!groupId) {
           if (!groupId) {
             return { total: 0, success: false, data: [] };
             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;

+ 1 - 1
dashboard-v6/src/components/setting/SettingAccount.tsx

@@ -112,7 +112,7 @@ const SettingAccountWidget = () => {
             return true;
             return true;
           },
           },
         }}
         }}
-        action={`${import.meta.env.BASE_URL}/api/v2/attachment?type=avatar`}
+        action={`/api/v2/attachment?type=avatar`}
         extra="必须为正方形。最大512*512"
         extra="必须为正方形。最大512*512"
       />
       />
       <ProFormText
       <ProFormText

+ 4 - 4
dashboard-v6/src/components/term/TermShare.tsx

@@ -8,7 +8,7 @@ import {
   LinkOutlined,
   LinkOutlined,
 } from "@ant-design/icons";
 } from "@ant-design/icons";
 
 
-import { fullUrl } from "../../utils";
+import { fullUrl, libraryUrl } from "../../utils";
 
 
 const { Text } = Typography;
 const { Text } = Typography;
 
 
@@ -26,8 +26,8 @@ const TermShareWidget = ({ id, trigger, open, onClose }: IWidget) => {
   const isOpen = open ?? innerOpen;
   const isOpen = open ?? innerOpen;
 
 
   // 藏经阁(对外公开)访问链接
   // 藏经阁(对外公开)访问链接
-  const libraryUrl = id
-    ? `${import.meta.env.VITE_APP_API_SERVER}/library/wiki/${intl.locale}/${id}`
+  const libraryLink = id
+    ? libraryUrl(`wiki/${intl.locale}/${id}`, true)
     : "";
     : "";
   // 译经楼(工作台)访问链接
   // 译经楼(工作台)访问链接
   const studioUrl = id ? fullUrl(`/workspace/term/${id}`) : "";
   const studioUrl = id ? fullUrl(`/workspace/term/${id}`) : "";
@@ -92,7 +92,7 @@ const TermShareWidget = ({ id, trigger, open, onClose }: IWidget) => {
       >
       >
         {linkRow(
         {linkRow(
           intl.formatMessage({ id: "labels.library.access.link" }),
           intl.formatMessage({ id: "labels.library.access.link" }),
-          libraryUrl,
+          libraryLink,
           <GlobalOutlined />
           <GlobalOutlined />
         )}
         )}
         <Text
         <Text

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

@@ -120,6 +120,11 @@ const items = {
   "buttons.account.switch": "Switch account",
   "buttons.account.switch": "Switch account",
   "buttons.teamspace.leave": "Back to personal space",
   "buttons.teamspace.leave": "Back to personal space",
   "buttons.back": "Back",
   "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;
 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.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.403": "You are not allowed to view this content",
   "labels.route-error.other": "Failed to load. Please try again later",
   "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;
 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.confirm-password.validate.fail": "password validate fail",
   "message.delete.success": "delete record {count}",
   "message.delete.success": "delete record {count}",
   "message.task.status.change": "Do you want change statue to {status}?",
   "message.task.status.change": "Do you want change statue to {status}?",
+  "message.group.invite.joined": "You have joined “{name}”",
 };
 };
 
 
 export default items;
 export default items;

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

@@ -121,6 +121,11 @@ const items = {
   "buttons.account.switch": "切换账号",
   "buttons.account.switch": "切换账号",
   "buttons.teamspace.leave": "切回个人空间",
   "buttons.teamspace.leave": "切回个人空间",
   "buttons.back": "返回",
   "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;
 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.404": "要找的内容不存在,或已被删除",
   "labels.route-error.403": "你没有权限查看这个内容",
   "labels.route-error.403": "你没有权限查看这个内容",
   "labels.route-error.other": "加载失败,请稍后再试",
   "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;
 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.confirm-password.validate.fail": "两次密码不一致",
   "message.delete.success": "成功删除{count}条数据",
   "message.delete.success": "成功删除{count}条数据",
   "message.task.status.change": "将任务状态修改为{status}吗?",
   "message.task.status.change": "将任务状态修改为{status}吗?",
+  "message.group.invite.joined": "已加入团队「{name}」",
 };
 };
 
 
 export default items;
 export default items;

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

@@ -121,6 +121,11 @@ const items = {
   "buttons.account.switch": "切換帳號",
   "buttons.account.switch": "切換帳號",
   "buttons.teamspace.leave": "切回個人空間",
   "buttons.teamspace.leave": "切回個人空間",
   "buttons.back": "返回",
   "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;
 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.404": "要找的內容不存在,或已被刪除",
   "labels.route-error.403": "你沒有權限查看這個內容",
   "labels.route-error.403": "你沒有權限查看這個內容",
   "labels.route-error.other": "載入失敗,請稍後再試",
   "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;
 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.confirm-password.validate.fail": "兩次密碼不一致",
   "message.delete.success": "成功刪除{count}條資料",
   "message.delete.success": "成功刪除{count}條資料",
   "message.task.status.change": "將任務狀態修改為{status}嗎?",
   "message.task.status.change": "將任務狀態修改為{status}嗎?",
+  "message.group.invite.joined": "已加入團隊「{name}」",
 };
 };
 
 
 export default items;
 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;

+ 2 - 2
dashboard-v6/src/pages/workspace/channel/show.tsx

@@ -7,7 +7,7 @@ import { ExportOutlined, TeamOutlined } from "@ant-design/icons";
 import ChapterInChannelList from "../../../components/channel/ChapterInChannelList";
 import ChapterInChannelList from "../../../components/channel/ChapterInChannelList";
 import ShareModal from "../../../components/share/ShareModal";
 import ShareModal from "../../../components/share/ShareModal";
 
 
-import { articlePath, fullUrl } from "../../../utils";
+import { articlePath, fullUrl, libraryUrl } from "../../../utils";
 import type { IArticleParam } from "../../../types/article";
 import type { IArticleParam } from "../../../types/article";
 import { EResType } from "../../../components/share/utils";
 import { EResType } from "../../../components/share/utils";
 import { fetchChannel } from "../../../api/channel";
 import { fetchChannel } from "../../../api/channel";
@@ -39,7 +39,7 @@ const Widget = () => {
             <Space>
             <Space>
               <Button
               <Button
                 icon={<ExportOutlined />}
                 icon={<ExportOutlined />}
-                href={`${import.meta.env.VITE_APP_API_SERVER}/library/tipitaka/channels/${channelId}`}
+                href={libraryUrl(`tipitaka/channels/${channelId}`)}
                 target="_blank"
                 target="_blank"
               >
               >
                 {intl.formatMessage({
                 {intl.formatMessage({

+ 18 - 0
dashboard-v6/src/utils.ts

@@ -37,6 +37,24 @@ export function fullUrl(url: string): string {
   return path ? `${prefix}/${path}` : `${prefix}/`;
   return path ? `${prefix}/${path}` : `${prefix}/`;
 }
 }
 
 
+/**
+ * 藏经阁(Laravel library)地址:VITE_APP_API_SERVER + /library/<path>。
+ * library 不在 v6 的 BASE_URL 下,所以不能用 fullUrl()。
+ * VITE_APP_API_SERVER 为空时是同域的相对路径。
+ * @param path library 下的路径,如 `tipitaka?channel=xxx`(前导 "/" 可有可无)
+ * @param absolute 要复制给别人的链接传 true:VITE_APP_API_SERVER 不是完整地址时补上当前域名
+ */
+export function libraryUrl(path: string, absolute = false): string {
+  const server = (import.meta.env.VITE_APP_API_SERVER ?? "").replace(
+    /\/+$/,
+    ""
+  );
+  const url = `${server}/library/${path.replace(/^\/+/, "")}`;
+  return absolute && !/^https?:\/\//.test(url)
+    ? window.location.origin + url
+    : url;
+}
+
 export function PaliToEn(pali: string): string {
 export function PaliToEn(pali: string): string {
   let output: string = pali.toLowerCase();
   let output: string = pali.toLowerCase();
   output = output.replaceAll("ā", "a");
   output = output.replaceAll("ā", "a");

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

@@ -815,10 +815,14 @@ paths:
     $ref: ./resources/auto/v3-email-certifications.yaml
     $ref: ./resources/auto/v3-email-certifications.yaml
   '/v3/glossaries/{kind}':
   '/v3/glossaries/{kind}':
     $ref: ./resources/auto/v3-glossaries-kind.yaml
     $ref: ./resources/auto/v3-glossaries-kind.yaml
+  '/v3/group-invites/{token}':
+    $ref: ./resources/auto/v3-group-invites-token.yaml
   /v3/groups:
   /v3/groups:
     $ref: ./resources/auto/v3-groups.yaml
     $ref: ./resources/auto/v3-groups.yaml
   '/v3/groups/{group}':
   '/v3/groups/{group}':
     $ref: ./resources/auto/v3-groups-group.yaml
     $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':
   '/v3/groups/{group}/members':
     $ref: ./resources/auto/v3-groups-group-members.yaml
     $ref: ./resources/auto/v3-groups-group-members.yaml
   '/v3/groups/{group}/members/{member}':
   '/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: |-
   description: |-
     每条带我在团队里的角色(owner / manager / editor / reader),按加入时间排序。
     每条带我在团队里的角色(owner / manager / editor / reader),按加入时间排序。
 
 
-    实现:`V3\MeGroupController@__invoke`
+    实现:`V3\MeGroupController@index`
   security:
   security:
     -
     -
       bearerAuth: []
       bearerAuth: []
@@ -80,3 +80,120 @@ get:
       $ref: '../../main.yaml#/components/responses/ProblemUnauthorized'
       $ref: '../../main.yaml#/components/responses/ProblemUnauthorized'
     422:
     422:
       $ref: '../../main.yaml#/components/responses/ProblemValidation'
       $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'

+ 8 - 1
openapi/public/assets/protocol/resources/auto/v3-tipitaka-exports-export-file.yaml

@@ -5,7 +5,8 @@ get:
     - tipitaka-exports
     - tipitaka-exports
   operationId: get_api_v3_tipitaka_exports_export_file
   operationId: get_api_v3_tipitaka_exports_export_file
   description: |-
   description: |-
-    支持 `Range`(206,断点续传)与 `If-None-Match`(304,ETag 就是导出 id)。
+    文件存在 S3 时 302 跳到 S3 的临时链接(1 小时有效,客户端跟随跳转即可);本地开发直接返回文件。
+    两种情况都支持 `Range`(206,断点续传)与 `If-None-Match`(304)。
     离线包(offline)是 NDJSON,带 `Content-Encoding: gzip`,HTTP 客户端会自动解压。
     离线包(offline)是 NDJSON,带 `Content-Encoding: gzip`,HTTP 客户端会自动解压。
     签名无效或过期 403,文件已过期 404。
     签名无效或过期 403,文件已过期 404。
 
 
@@ -75,6 +76,12 @@ get:
           schema:
           schema:
             type: string
             type: string
             format: binary
             format: binary
+    302:
+      description: '文件在 S3:跳到临时下载链接'
+      content:
+        application/problem+json:
+          schema:
+            $ref: '../../main.yaml#/components/schemas/ProblemDetails'
     304:
     304:
       description: 'If-None-Match 命中,本地文件就是最新的'
       description: 'If-None-Match 命中,本地文件就是最新的'
     403:
     403:

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio