@follenfang/fupload 0.0.17 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fupload/SKILL.md +1 -1
- package/fupload/scripts/fupload_cli/__init__.py +1 -1
- package/fupload/scripts/fupload_cli/dd.py +23 -6
- package/fupload/scripts/fupload_cli/dd_broker.py +2 -1
- package/fupload/scripts/fupload_cli/dd_sidecar.py +2 -1
- package/npm/skill-manifest.json +11 -11
- package/package.json +1 -1
package/fupload/SKILL.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: fupload
|
|
3
3
|
description: Explicit author-publishing workflow for World of Warcraft plugins, configuration shares, and WA/strings on NewBeeBox, NetEase DD, CurseForge, Heybox Workshop, and ModUs.Creator, including local Creator login reuse and plugin ZIP publishing. Use only when the user explicitly invokes `$fupload`, explicitly asks to use the Fupload Skill, or loads this Skill by path. Do not trigger from ordinary mentions of publishing, NewBeeBox, DD, CurseForge, Heybox, ModUs, plugins, configurations, or WA.
|
|
4
4
|
metadata:
|
|
5
|
-
version: "0.0.
|
|
5
|
+
version: "0.0.18"
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Fupload
|
|
@@ -20,6 +20,8 @@ from .trust import trusted_local_dir, trusted_roaming_dir, verify_dd_executable
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
EXPECTED_DD_VERSION = os.environ.get("FUPLOAD_DD_EXPECTED_VERSION", "any")
|
|
23
|
+
SIDECAR_DEFAULT_RESPONSE_TIMEOUT_SECONDS = 180
|
|
24
|
+
SIDECAR_UPLOAD_RESPONSE_TIMEOUT_SECONDS = 660
|
|
23
25
|
LIFE_TYPES = [
|
|
24
26
|
{"name": "7 days", "value": "seven_day"},
|
|
25
27
|
{"name": "14 days", "value": "fourteen_day"},
|
|
@@ -326,7 +328,7 @@ class Sidecar:
|
|
|
326
328
|
self.responses.put(FuploadError("DD sidecar exited without a result", kind="sidecar_error"))
|
|
327
329
|
|
|
328
330
|
def _next_result(
|
|
329
|
-
self, *, timeout: float =
|
|
331
|
+
self, *, timeout: float = SIDECAR_DEFAULT_RESPONSE_TIMEOUT_SECONDS, endpoint: Optional[str] = None,
|
|
330
332
|
stage: Optional[str] = None,
|
|
331
333
|
verification_required: bool = False,
|
|
332
334
|
) -> Dict[str, Any]:
|
|
@@ -377,6 +379,11 @@ class Sidecar:
|
|
|
377
379
|
else:
|
|
378
380
|
expected_stage, uncertain = "dependency_get", False
|
|
379
381
|
response = self._next_result(
|
|
382
|
+
timeout=(
|
|
383
|
+
SIDECAR_UPLOAD_RESPONSE_TIMEOUT_SECONDS
|
|
384
|
+
if action == "upload"
|
|
385
|
+
else SIDECAR_DEFAULT_RESPONSE_TIMEOUT_SECONDS
|
|
386
|
+
),
|
|
380
387
|
endpoint=endpoint,
|
|
381
388
|
stage=expected_stage,
|
|
382
389
|
verification_required=uncertain,
|
|
@@ -1950,7 +1957,10 @@ class DD:
|
|
|
1950
1957
|
if available and any(str(value) not in available for value in values):
|
|
1951
1958
|
raise ValidationError("selection contains an unavailable live option", path=path)
|
|
1952
1959
|
|
|
1953
|
-
def _validate_options(
|
|
1960
|
+
def _validate_options(
|
|
1961
|
+
self, session: Sidecar, resource: str, form: Mapping[str, Any], *,
|
|
1962
|
+
validate_optional_dependencies: bool = True,
|
|
1963
|
+
) -> None:
|
|
1954
1964
|
game_type = form.get("game_type")
|
|
1955
1965
|
if resource == "plugin":
|
|
1956
1966
|
versions = session.get("/game_versions/list", {"game_type": game_type})
|
|
@@ -1983,11 +1993,11 @@ class DD:
|
|
|
1983
1993
|
if form.get("share_code_life_type"):
|
|
1984
1994
|
self._validate_choices(LIFE_TYPES, [form.get("share_code_life_type")], ("value",), "$.share_code_life_type")
|
|
1985
1995
|
|
|
1986
|
-
if form.get("need_anchor_vip"):
|
|
1996
|
+
if validate_optional_dependencies and form.get("need_anchor_vip"):
|
|
1987
1997
|
vip_levels = session.get("/anchor_vip/level/list", {"enrich_acts": "false"})
|
|
1988
1998
|
self._validate_choices(vip_levels, form.get("vip_levels") or [], ("id", "level", "value"), "$.vip_levels")
|
|
1989
1999
|
|
|
1990
|
-
if form.get("jump_room"):
|
|
2000
|
+
if validate_optional_dependencies and form.get("jump_room"):
|
|
1991
2001
|
channels = safe_channels(session.cc_get("https://api.cc.163.com/v1/mixteammsgproxy/channelList?source=pluginPublish"))
|
|
1992
2002
|
if not channels["items"]:
|
|
1993
2003
|
raise FuploadError("live channel response contained no selectable values", kind="platform_data_error")
|
|
@@ -1996,7 +2006,7 @@ class DD:
|
|
|
1996
2006
|
if wanted not in available:
|
|
1997
2007
|
raise ValidationError("room/channel selection is unavailable", path="$.channel_id")
|
|
1998
2008
|
|
|
1999
|
-
if form.get("with_associate"):
|
|
2009
|
+
if validate_optional_dependencies and form.get("with_associate"):
|
|
2000
2010
|
references = self._associated_refs(session, game_type)
|
|
2001
2011
|
if not references:
|
|
2002
2012
|
raise FuploadError("live association response contained no selectable values", kind="platform_data_error")
|
|
@@ -2105,7 +2115,14 @@ class DD:
|
|
|
2105
2115
|
validate_locked_usage_mode(current, form, doc)
|
|
2106
2116
|
normalize_commercial(form, "plugin", create=action == "create")
|
|
2107
2117
|
validate_plugin_submission(form, doc)
|
|
2108
|
-
|
|
2118
|
+
# A version-only update cannot change these optional metadata fields.
|
|
2119
|
+
# Validate their live dependencies on create/edit, but do not block a
|
|
2120
|
+
# release merely because an already-saved room, VIP, or association is
|
|
2121
|
+
# temporarily absent from an auxiliary option endpoint.
|
|
2122
|
+
self._validate_options(
|
|
2123
|
+
session, "plugin", form,
|
|
2124
|
+
validate_optional_dependencies=action != "update",
|
|
2125
|
+
)
|
|
2109
2126
|
validate_no_display_objects(form, "plugin")
|
|
2110
2127
|
if doc.get("logo_file"):
|
|
2111
2128
|
form["logo"] = session.upload(doc["logo_file"], "addon", file_name="", media=True, max_bytes=10 * 1024 * 1024)
|
|
@@ -23,6 +23,7 @@ STATE_NAME = "broker.json"
|
|
|
23
23
|
STARTUP_NAME = "broker.starting.json"
|
|
24
24
|
MAX_REQUEST_BYTES = 64 * 1024 * 1024
|
|
25
25
|
IDLE_SECONDS = 10 * 60
|
|
26
|
+
BROKER_WRITE_TIMEOUT_SECONDS = 15 * 60
|
|
26
27
|
|
|
27
28
|
|
|
28
29
|
def _dd_module():
|
|
@@ -545,7 +546,7 @@ def execute(session_id: str, kind: str, resource: str, action: str, payload: Dic
|
|
|
545
546
|
"resource": resource,
|
|
546
547
|
"action": action,
|
|
547
548
|
"payload": payload,
|
|
548
|
-
})
|
|
549
|
+
}, timeout=BROKER_WRITE_TIMEOUT_SECONDS if kind == "write" else 300)
|
|
549
550
|
|
|
550
551
|
|
|
551
552
|
def _read_request(connection: socket.socket) -> Dict[str, Any]:
|
|
@@ -42,6 +42,7 @@ _SENSITIVE_KEYS = {
|
|
|
42
42
|
"presigneduri", "presigned_uri", "signature", "client_secret", "api_key", "auth_key", "password", "secret",
|
|
43
43
|
}
|
|
44
44
|
_MAX_LOG_BODY = 1024 * 1024
|
|
45
|
+
OBJECT_PUT_TIMEOUT_SECONDS = 600
|
|
45
46
|
_CONFIG_CONTENT_KEYS = {
|
|
46
47
|
"known_addon", "unknown_addon", "wtf", "material", "font",
|
|
47
48
|
"known_wa", "unknown_wa", "retail_ui_config",
|
|
@@ -831,7 +832,7 @@ def run_command(session, command):
|
|
|
831
832
|
request = urllib.request.Request(
|
|
832
833
|
info["url"], data=data, method="PUT", headers=headers,
|
|
833
834
|
)
|
|
834
|
-
with urllib.request.urlopen(request, timeout=
|
|
835
|
+
with urllib.request.urlopen(request, timeout=OBJECT_PUT_TIMEOUT_SECONDS) as response:
|
|
835
836
|
if response.status != 200:
|
|
836
837
|
try:
|
|
837
838
|
response_body = response.read()
|
package/npm/skill-manifest.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": "fupload.npm-skill-manifest.v1",
|
|
3
3
|
"package_name": "@follenfang/fupload",
|
|
4
|
-
"package_version": "0.0.
|
|
5
|
-
"skill_version": "0.0.
|
|
6
|
-
"tree_sha256": "
|
|
4
|
+
"package_version": "0.0.18",
|
|
5
|
+
"skill_version": "0.0.18",
|
|
6
|
+
"tree_sha256": "36d839247defb278814b13da703acef8766aeb4f01efb8bda4c3d104367ac13b",
|
|
7
7
|
"files": [
|
|
8
8
|
{
|
|
9
9
|
"path": "agents/openai.yaml",
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
{
|
|
114
114
|
"path": "scripts/fupload_cli/__init__.py",
|
|
115
115
|
"bytes": 50,
|
|
116
|
-
"sha256": "
|
|
116
|
+
"sha256": "b899101a4de87efa255361fb768398e6f03a68740eca391ba57991984bd77c55"
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
119
|
"path": "scripts/fupload_cli/blackbox_web.py",
|
|
@@ -137,18 +137,18 @@
|
|
|
137
137
|
},
|
|
138
138
|
{
|
|
139
139
|
"path": "scripts/fupload_cli/dd_broker.py",
|
|
140
|
-
"bytes":
|
|
141
|
-
"sha256": "
|
|
140
|
+
"bytes": 28353,
|
|
141
|
+
"sha256": "1b05604c27253cd77b40bb2b549a5cd1c99434245ccb60959f989ec690e3c70f"
|
|
142
142
|
},
|
|
143
143
|
{
|
|
144
144
|
"path": "scripts/fupload_cli/dd_sidecar.py",
|
|
145
|
-
"bytes":
|
|
146
|
-
"sha256": "
|
|
145
|
+
"bytes": 39206,
|
|
146
|
+
"sha256": "722038884c5b050c2c6030f5d4e7b1088c1fb9b614e99c3b241b539631cbc3e3"
|
|
147
147
|
},
|
|
148
148
|
{
|
|
149
149
|
"path": "scripts/fupload_cli/dd.py",
|
|
150
|
-
"bytes":
|
|
151
|
-
"sha256": "
|
|
150
|
+
"bytes": 115318,
|
|
151
|
+
"sha256": "588102eb959e9f4737c39311cd689e400e2b0a8197abc231a145f342c03dbd68"
|
|
152
152
|
},
|
|
153
153
|
{
|
|
154
154
|
"path": "scripts/fupload_cli/errors.py",
|
|
@@ -208,7 +208,7 @@
|
|
|
208
208
|
{
|
|
209
209
|
"path": "SKILL.md",
|
|
210
210
|
"bytes": 28383,
|
|
211
|
-
"sha256": "
|
|
211
|
+
"sha256": "512d6d5b7d34987009c12675e4cee4c540950e32ac808fbf4081d8db6c3157f0"
|
|
212
212
|
}
|
|
213
213
|
]
|
|
214
214
|
}
|