diff --git a/models_gen.go b/models_gen.go index 63d2cd3..9f08277 100644 --- a/models_gen.go +++ b/models_gen.go @@ -342,7 +342,7 @@ type AccountInfo struct { AccountName string `json:"account_name" toon:"account_name"` // Account avatar URL. Avatar string `json:"avatar" toon:"avatar"` - // Calling country code for the contact phone. + // ISO 3166-1 alpha-2 region code of the contact phone (e.g. "CN", "US", "HK"). CountryCode string `json:"country_code" toon:"country_code"` // Account creation time, Unix timestamp in seconds. CreatedAt Timestamp `json:"created_at" toon:"created_at"` @@ -3986,7 +3986,7 @@ type InsightTopkAlertByLabelRequest struct { // InviteMemberItem is generated from the Flashduty OpenAPI schema. type InviteMemberItem struct { - // Country code + // ISO 3166-1 alpha-2 region code for `phone` (e.g. "CN"). Validated and normalized to upper case before storage; invalid values are rejected with a 400. Also the parsing hint when `phone` has no "+" prefix (defaults to "CN"). CountryCode string `json:"country_code,omitempty" toon:"country_code,omitempty"` // Email address Email string `json:"email,omitempty" toon:"email,omitempty"` @@ -5079,7 +5079,7 @@ type MappingSchemaUpdateRequest struct { // MemberDeleteRequest is generated from the Flashduty OpenAPI schema. type MemberDeleteRequest struct { - // Phone country code, used with phone + // Region hint for parsing `phone` when it has no "+" prefix — an ISO 3166-1 alpha-2 code such as "CN" (the default when omitted). Legacy digit calling codes like "86" are still accepted in this parsing context. CountryCode string `json:"country_code,omitempty" toon:"country_code,omitempty"` // Email address. Only used when neither `member_id` nor `member_name` is provided Email string `json:"email,omitempty" toon:"email,omitempty"` @@ -5119,7 +5119,7 @@ type MemberInfoResponse struct { AccountTimeZone string `json:"account_time_zone" toon:"account_time_zone"` // Member avatar URL Avatar string `json:"avatar" toon:"avatar"` - // Phone country code + // ISO 3166-1 alpha-2 region code of the member's contact phone (e.g. "CN", "US", "HK"). CountryCode string `json:"country_code" toon:"country_code"` // Account domain Domain string `json:"domain" toon:"domain"` @@ -5167,7 +5167,7 @@ type MemberItem struct { AccountRoleIDs []uint64 `json:"account_role_ids" toon:"account_role_ids"` // Avatar URL Avatar string `json:"avatar" toon:"avatar"` - // Phone country code + // ISO 3166-1 alpha-2 region code of the member's contact phone (e.g. "CN", "US", "HK"). CountryCode string `json:"country_code" toon:"country_code"` // Creation timestamp (Unix seconds) CreatedAt Timestamp `json:"created_at" toon:"created_at"` @@ -5221,7 +5221,7 @@ type MemberListResponse struct { // MemberResetInfoRequest is generated from the Flashduty OpenAPI schema. type MemberResetInfoRequest struct { - // Country or region code used to parse phone. + // Region hint for parsing `phone` when it has no "+" prefix — an ISO 3166-1 alpha-2 code such as "CN" (the default when omitted). Legacy digit calling codes like "86" are still accepted in this parsing context. CountryCode string `json:"country_code,omitempty" toon:"country_code,omitempty"` // Email address used to identify the member. Email string `json:"email,omitempty" toon:"email,omitempty"` @@ -5243,7 +5243,7 @@ type MemberResetInfoRequest struct { type MemberResetInfoUpdates struct { // New avatar URL. Avatar string `json:"avatar,omitempty" toon:"avatar,omitempty"` - // Country or region code for the new phone number. + // ISO 3166-1 alpha-2 region code (e.g. "CN", "US"). Updated independently — `phone` is not required — and also used as the parsing hint for `phone`. Invalid values are rejected with a 400; an explicit empty string is not allowed. CountryCode string `json:"country_code,omitempty" toon:"country_code,omitempty"` // New email address. Email string `json:"email,omitempty" toon:"email,omitempty"` @@ -5622,6 +5622,8 @@ type PersonItem struct { As string `json:"as" toon:"as"` // Avatar URL Avatar string `json:"avatar" toon:"avatar"` + // ISO 3166-1 alpha-2 region code of the contact phone (e.g. "CN", "US", "HK"). + CountryCode string `json:"country_code" toon:"country_code"` // Email address Email string `json:"email" toon:"email"` // Email verified diff --git a/openapi/openapi.en.json b/openapi/openapi.en.json index e005676..20ab146 100644 --- a/openapi/openapi.en.json +++ b/openapi/openapi.en.json @@ -17514,7 +17514,7 @@ "Platform/Members" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Members Manage** (`organization`) |", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Members Manage** (`organization`) |\n\n## Usage\n\n- `country_code` must be an ISO 3166-1 alpha-2 region code (e.g. \"CN\"). It is validated and normalized to upper case before storage; invalid values are rejected with a 400.\n- When a member's `phone` has no \"+\" prefix, it is parsed with that member's `country_code` as the region hint (defaults to \"CN\" when omitted).", "href": "/en/api-reference/platform/members/member-invite", "metadata": { "sidebarTitle": "Invite members" @@ -17584,6 +17584,13 @@ "role_ids": [ 6 ] + }, + { + "member_name": "Dave", + "phone": "13800138000", + "country_code": "CN", + "locale": "zh-CN", + "time_zone": "Asia/Shanghai" } ] } @@ -17821,7 +17828,7 @@ "Platform/Members" ], "x-mint": { - "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **300 requests/minute**; **20 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Identify the member with one of `member_id`, `member_name`, `email`, `phone`, or `ref_id`. If multiple identifiers are present, the server checks them in that order.\n- When identifying or updating a member by `phone`, include `country_code` when the number needs country-specific parsing.\n- Put the profile fields to write under `updates`: `member_name`, `password`, `phone`, `country_code`, `email`, `avatar`, `locale`, `time_zone`, or `ref_id`.\n- Members provisioned by SSO cannot be changed when SSO marks them as externally managed.\n- `updates` must carry at least one field; an object with every field omitted is rejected.", + "content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **300 requests/minute**; **20 requests/second** per account |\n| Permissions | None — any valid `app_key` can call this operation |\n\n## Usage\n\n- Identify the member with one of `member_id`, `member_name`, `email`, `phone`, or `ref_id`. If multiple identifiers are present, the server checks them in that order.\n- `updates.country_code` is an ISO 3166-1 alpha-2 region code (e.g. \"CN\", \"US\"). It is an independently updatable field: `updates.phone` is not required, and the new region is stored even when the phone is unchanged. An explicit empty string is rejected with a 400.\n- When `updates.phone` has no \"+\" prefix, it is parsed with `updates.country_code` as the region hint, falling back to the member's stored region and then to \"CN\". Legacy digit calling codes such as \"86\" remain accepted only as parsing hints — stored values are always ISO region codes.\n- The top-level `country_code` is only a parsing hint for the identifying `phone`; it is never stored.\n- Put the profile fields to write under `updates`: `member_name`, `password`, `phone`, `country_code`, `email`, `avatar`, `locale`, `time_zone`, or `ref_id`.\n- Members provisioned by SSO cannot be changed when SSO marks them as externally managed.\n- `updates` must carry at least one field; an object with every field omitted is rejected.", "href": "/en/api-reference/platform/members/member-reset-info", "metadata": { "sidebarTitle": "Reset member info" @@ -21020,7 +21027,7 @@ "acme-corp" ], "phone": "138****8000", - "country_code": "86", + "country_code": "CN", "email": "ops@acme.example", "avatar": "https://cdn.flashcat.cloud/avatar/acme.png", "locale": "zh-CN", @@ -45504,7 +45511,7 @@ }, "country_code": { "type": "string", - "description": "Phone country code" + "description": "ISO 3166-1 alpha-2 region code of the member's contact phone (e.g. \"CN\", \"US\", \"HK\")." }, "avatar": { "type": "string", @@ -45609,7 +45616,7 @@ }, "country_code": { "type": "string", - "description": "Phone country code" + "description": "ISO 3166-1 alpha-2 region code of the member's contact phone (e.g. \"CN\", \"US\", \"HK\")." }, "phone": { "type": "string", @@ -45724,7 +45731,7 @@ }, "country_code": { "type": "string", - "description": "Phone country code, used with phone" + "description": "Region hint for parsing `phone` when it has no \"+\" prefix — an ISO 3166-1 alpha-2 code such as \"CN\" (the default when omitted). Legacy digit calling codes like \"86\" are still accepted in this parsing context." }, "ref_id": { "type": "string", @@ -45757,7 +45764,7 @@ }, "country_code": { "type": "string", - "description": "Country code" + "description": "ISO 3166-1 alpha-2 region code for `phone` (e.g. \"CN\"). Validated and normalized to upper case before storage; invalid values are rejected with a 400. Also the parsing hint when `phone` has no \"+\" prefix (defaults to \"CN\")." }, "role_ids": { "type": "array", @@ -45954,7 +45961,7 @@ }, "country_code": { "type": "string", - "description": "Country or region code used to parse phone." + "description": "Region hint for parsing `phone` when it has no \"+\" prefix — an ISO 3166-1 alpha-2 code such as \"CN\" (the default when omitted). Legacy digit calling codes like \"86\" are still accepted in this parsing context." }, "ref_id": { "type": "string", @@ -45990,7 +45997,7 @@ }, "country_code": { "type": "string", - "description": "Country or region code for the new phone number." + "description": "ISO 3166-1 alpha-2 region code (e.g. \"CN\", \"US\"). Updated independently — `phone` is not required — and also used as the parsing hint for `phone`. Invalid values are rejected with a 400; an explicit empty string is not allowed." }, "email": { "type": "string", @@ -46076,6 +46083,10 @@ "type": "string", "description": "Email address" }, + "country_code": { + "type": "string", + "description": "ISO 3166-1 alpha-2 region code of the contact phone (e.g. \"CN\", \"US\", \"HK\")." + }, "phone": { "type": "string", "description": "Phone number" @@ -48376,7 +48387,7 @@ }, "country_code": { "type": "string", - "description": "Calling country code for the contact phone." + "description": "ISO 3166-1 alpha-2 region code of the contact phone (e.g. \"CN\", \"US\", \"HK\")." }, "email": { "type": "string", diff --git a/openapi/openapi.zh.json b/openapi/openapi.zh.json index b6cfa2c..030d6d5 100644 --- a/openapi/openapi.zh.json +++ b/openapi/openapi.zh.json @@ -17506,7 +17506,7 @@ "平台/成员管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **成员管理**(`organization`) |", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **成员管理**(`organization`) |\n\n## 使用说明\n\n- `country_code` 必须是 ISO 3166-1 alpha-2 地区代码(如 \"CN\");写入前校验并统一转为大写,非法值返回 400。\n- 当成员的 `phone` 不带 \"+\" 前缀时,按该成员的 `country_code` 作为地区提示解析(未传时默认 \"CN\")。", "href": "/zh/api-reference/platform/members/member-invite", "metadata": { "sidebarTitle": "邀请成员" @@ -17576,6 +17576,13 @@ "role_ids": [ 6 ] + }, + { + "member_name": "Dave", + "phone": "13800138000", + "country_code": "CN", + "locale": "zh-CN", + "time_zone": "Asia/Shanghai" } ] } @@ -17813,7 +17820,7 @@ "平台/成员管理" ], "x-mint": { - "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **300 次/分钟**;**20 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 使用 `member_id`、`member_name`、`email`、`phone` 或 `ref_id` 中任一字段定位成员;如果同时传多个字段,服务端按上述顺序匹配。\n- 使用 `phone` 定位或更新手机号时,可同时传 `country_code` 辅助解析。\n- `updates` 承载要写入的新资料,支持 `member_name`、`password`、`phone`、`country_code`、`email`、`avatar`、`locale`、`time_zone`、`ref_id`。\n- 由 SSO 托管且不可编辑的成员不能通过此接口修改。\n- `updates` 至少要带一个字段;所有字段都不传的空对象会被拒绝。", + "content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **300 次/分钟**;**20 次/秒** |\n| 权限要求 | 无 —— 持有有效的 `app_key` 即可调用 |\n\n## 使用说明\n\n- 使用 `member_id`、`member_name`、`email`、`phone` 或 `ref_id` 中任一字段定位成员;如果同时传多个字段,服务端按上述顺序匹配。\n- `updates.country_code` 为 ISO 3166-1 alpha-2 地区代码(如 \"CN\"、\"US\")。它是独立可更新字段:无需同时传 `updates.phone`,即使手机号不变也会写入新的地区代码;显式传空字符串会被拒绝(400)。\n- 当 `updates.phone` 不带 \"+\" 前缀时,按 `updates.country_code` 作为地区提示解析;未传时依次回退到成员已存的地区代码、默认值 \"CN\"。\"86\" 等数字电话区号仅在解析场景兼容,存储值一律为 ISO 地区代码。\n- 顶层的 `country_code` 仅作为定位用 `phone` 的解析提示,不会被存储。\n- `updates` 承载要写入的新资料,支持 `member_name`、`password`、`phone`、`country_code`、`email`、`avatar`、`locale`、`time_zone`、`ref_id`。\n- 由 SSO 托管且不可编辑的成员不能通过此接口修改。\n- `updates` 至少要带一个字段;所有字段都不传的空对象会被拒绝。", "href": "/zh/api-reference/platform/members/member-reset-info", "metadata": { "sidebarTitle": "重置成员信息" @@ -21012,7 +21019,7 @@ "acme-corp" ], "phone": "138****8000", - "country_code": "86", + "country_code": "CN", "email": "ops@acme.example", "avatar": "https://cdn.flashcat.cloud/avatar/acme.png", "locale": "zh-CN", @@ -45495,7 +45502,7 @@ }, "country_code": { "type": "string", - "description": "手机国家区号" + "description": "成员联系手机的 ISO 3166-1 alpha-2 地区代码(如 \"CN\"、\"US\"、\"HK\")。" }, "avatar": { "type": "string", @@ -45600,7 +45607,7 @@ }, "country_code": { "type": "string", - "description": "手机国家区号" + "description": "成员联系手机的 ISO 3166-1 alpha-2 地区代码(如 \"CN\"、\"US\"、\"HK\")。" }, "phone": { "type": "string", @@ -45715,7 +45722,7 @@ }, "country_code": { "type": "string", - "description": "国家区号,配合 phone 使用" + "description": "当 `phone` 不带 \"+\" 前缀时的解析地区提示 —— ISO 3166-1 alpha-2 地区代码(如 \"CN\",未传时默认 \"CN\")。此解析场景仍兼容 \"86\" 等数字电话区号。" }, "ref_id": { "type": "string", @@ -45748,7 +45755,7 @@ }, "country_code": { "type": "string", - "description": "国家区号" + "description": "`phone` 的 ISO 3166-1 alpha-2 地区代码(如 \"CN\");写入前校验并统一转为大写,非法值返回 400。当 `phone` 不带 \"+\" 前缀时兼作解析提示(未传时默认 \"CN\")。" }, "role_ids": { "type": "array", @@ -45945,7 +45952,7 @@ }, "country_code": { "type": "string", - "description": "手机号对应的国家或地区区号,用于解析 phone。" + "description": "当 `phone` 不带 \"+\" 前缀时的解析地区提示 —— ISO 3166-1 alpha-2 地区代码(如 \"CN\",未传时默认 \"CN\")。此解析场景仍兼容 \"86\" 等数字电话区号。" }, "ref_id": { "type": "string", @@ -45981,7 +45988,7 @@ }, "country_code": { "type": "string", - "description": "新手机号对应的国家或地区区号。" + "description": "ISO 3166-1 alpha-2 地区代码(如 \"CN\"、\"US\")。可独立更新(无需同时传 `phone`),并兼作解析 `phone` 的地区提示;非法值返回 400,显式传空字符串也会被拒绝。" }, "email": { "type": "string", @@ -46067,6 +46074,10 @@ "type": "string", "description": "邮箱地址" }, + "country_code": { + "type": "string", + "description": "联系手机的 ISO 3166-1 alpha-2 地区代码(如 \"CN\"、\"US\"、\"HK\")。" + }, "phone": { "type": "string", "description": "手机号" @@ -48367,7 +48378,7 @@ }, "country_code": { "type": "string", - "description": "联系电话的国家区号。" + "description": "联系手机的 ISO 3166-1 alpha-2 地区代码(如 \"CN\"、\"US\"、\"HK\")。" }, "email": { "type": "string",