@playdrop/playdrop-cli 0.16.5 → 0.16.11
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/bin/playdrop +1 -2
- package/config/client-meta.json +4 -4
- package/dist/apiClient.d.ts +2 -2
- package/dist/apiClient.js +16 -20
- package/dist/appUrls.d.ts +2 -2
- package/dist/appUrls.js +31 -33
- package/dist/apps/build.d.ts +2 -2
- package/dist/apps/build.js +83 -83
- package/dist/apps/index.d.ts +7 -7
- package/dist/apps/index.js +8 -8
- package/dist/apps/loadCheck.d.ts +28 -16
- package/dist/apps/loadCheck.js +411 -279
- package/dist/apps/registration.d.ts +3 -3
- package/dist/apps/registration.js +1 -1
- package/dist/apps/staticHtml.d.ts +3 -3
- package/dist/apps/staticHtml.js +90 -91
- package/dist/apps/surfaceProfiles.d.ts +2 -2
- package/dist/apps/surfaceProfiles.js +6 -6
- package/dist/apps/upload.d.ts +5 -5
- package/dist/apps/upload.js +75 -81
- package/dist/apps/validate.d.ts +2 -2
- package/dist/apps/validate.js +18 -22
- package/dist/assetSpecs.d.ts +2 -2
- package/dist/assetSpecs.js +35 -35
- package/dist/assets/model-artifacts.d.ts +1 -1
- package/dist/assets/model-artifacts.js +81 -77
- package/dist/assets/model-worker.d.ts +1 -1
- package/dist/assets/model-worker.js +6 -6
- package/dist/browser.js +9 -9
- package/dist/catalogue-utils.d.ts +1 -1
- package/dist/catalogue-utils.js +26 -26
- package/dist/catalogue.d.ts +21 -16
- package/dist/catalogue.js +509 -413
- package/dist/clientInfo.d.ts +1 -1
- package/dist/clientInfo.js +28 -28
- package/dist/commandContext.d.ts +5 -5
- package/dist/commandContext.js +19 -23
- package/dist/commands/accounts.js +6 -6
- package/dist/commands/ads.js +16 -16
- package/dist/commands/agents.d.ts +2 -2
- package/dist/commands/agents.js +131 -127
- package/dist/commands/boosts.js +41 -31
- package/dist/commands/browse.d.ts +2 -2
- package/dist/commands/browse.js +168 -128
- package/dist/commands/build.js +9 -9
- package/dist/commands/captureListing.d.ts +8 -8
- package/dist/commands/captureListing.js +292 -332
- package/dist/commands/changelog.js +1 -1
- package/dist/commands/chat.js +51 -53
- package/dist/commands/check.d.ts +1 -1
- package/dist/commands/check.js +44 -44
- package/dist/commands/clients.d.ts +3 -3
- package/dist/commands/clients.js +67 -64
- package/dist/commands/comments.js +36 -29
- package/dist/commands/create.js +305 -312
- package/dist/commands/createRemixContent.d.ts +1 -1
- package/dist/commands/createRemixContent.js +65 -60
- package/dist/commands/creations.js +205 -135
- package/dist/commands/credits.js +37 -27
- package/dist/commands/detail.js +40 -34
- package/dist/commands/dev.js +103 -126
- package/dist/commands/devBrowser.js +74 -65
- package/dist/commands/devRuntimeAssets.d.ts +4 -4
- package/dist/commands/devRuntimeAssets.js +38 -40
- package/dist/commands/devServer.d.ts +4 -4
- package/dist/commands/devServer.js +183 -174
- package/dist/commands/devShared.d.ts +3 -3
- package/dist/commands/devShared.js +31 -31
- package/dist/commands/doctor.d.ts +5 -5
- package/dist/commands/doctor.js +63 -57
- package/dist/commands/documentation.js +42 -32
- package/dist/commands/feedback.js +59 -42
- package/dist/commands/format.js +9 -9
- package/dist/commands/generation.d.ts +2 -2
- package/dist/commands/generation.js +344 -326
- package/dist/commands/init.d.ts +4 -4
- package/dist/commands/init.js +64 -61
- package/dist/commands/login.d.ts +2 -2
- package/dist/commands/login.js +42 -62
- package/dist/commands/logout.js +4 -4
- package/dist/commands/marketing.d.ts +8 -8
- package/dist/commands/marketing.js +246 -297
- package/dist/commands/notes.js +19 -19
- package/dist/commands/notifications.js +34 -22
- package/dist/commands/npmProcess.js +3 -3
- package/dist/commands/ownedRuntimeImageValidation.d.ts +1 -1
- package/dist/commands/ownedRuntimeImageValidation.js +19 -17
- package/dist/commands/play.js +12 -21
- package/dist/commands/publicPages.js +8 -4
- package/dist/commands/review.js +123 -110
- package/dist/commands/search.js +107 -88
- package/dist/commands/tags.js +10 -12
- package/dist/commands/taskCaptureSession.d.ts +3 -3
- package/dist/commands/taskCaptureSession.js +3 -3
- package/dist/commands/tweaks.js +25 -23
- package/dist/commands/upgrade.js +40 -31
- package/dist/commands/upload-content.d.ts +5 -5
- package/dist/commands/upload-content.js +130 -122
- package/dist/commands/upload-graph.d.ts +1 -1
- package/dist/commands/upload-graph.js +7 -11
- package/dist/commands/upload.d.ts +7 -7
- package/dist/commands/upload.js +196 -217
- package/dist/commands/validate.js +33 -32
- package/dist/commands/versionsBrowse.js +61 -51
- package/dist/commands/whoami.js +11 -14
- package/dist/commands/worker/archive-staging.d.ts +9 -0
- package/dist/commands/worker/archive-staging.js +257 -0
- package/dist/commands/worker/instrument-evidence.d.ts +1 -1
- package/dist/commands/worker/instrument-evidence.js +41 -43
- package/dist/commands/worker/provider-telemetry.d.ts +2 -1
- package/dist/commands/worker/provider-telemetry.js +181 -64
- package/dist/commands/worker/runtime.d.ts +18 -3
- package/dist/commands/worker/runtime.js +291 -239
- package/dist/commands/worker.d.ts +83 -22
- package/dist/commands/worker.js +1980 -1411
- package/dist/commands/workspaces.d.ts +2 -2
- package/dist/commands/workspaces.js +57 -57
- package/dist/config.js +23 -20
- package/dist/devAuth.d.ts +3 -3
- package/dist/devAuth.js +20 -17
- package/dist/environment.d.ts +1 -1
- package/dist/environment.js +34 -34
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +7 -7
- package/dist/externalAssetPackValidation.d.ts +1 -1
- package/dist/externalAssetPackValidation.js +9 -9
- package/dist/http.d.ts +1 -1
- package/dist/http.js +9 -9
- package/dist/index.js +657 -664
- package/dist/listingCaptureLease.js +23 -23
- package/dist/listingPreflight.d.ts +2 -2
- package/dist/listingPreflight.js +33 -33
- package/dist/messages.js +6 -14
- package/dist/output.js +9 -9
- package/dist/playwright.d.ts +1 -1
- package/dist/playwright.js +35 -40
- package/dist/proxyFetch.js +30 -27
- package/dist/recorderRelease.js +8 -8
- package/dist/refs.d.ts +5 -5
- package/dist/refs.js +40 -37
- package/dist/sessionCookie.js +15 -21
- package/dist/shellProbe.js +5 -5
- package/dist/taskSelection.d.ts +3 -3
- package/dist/taskSelection.js +67 -62
- package/dist/taskUtils.d.ts +1 -1
- package/dist/taskUtils.js +4 -4
- package/dist/tweakStaleness.d.ts +3 -3
- package/dist/tweakStaleness.js +8 -8
- package/dist/uploadLog.d.ts +3 -3
- package/dist/uploadLog.js +51 -51
- package/dist/versionCompare.js +3 -3
- package/dist/workerAppProject.d.ts +1 -1
- package/dist/workerAppProject.js +10 -17
- package/dist/workspaceAuth.d.ts +1 -1
- package/dist/workspaceAuth.js +28 -22
- package/node_modules/@playdrop/ai-client/dist/index.d.ts +35 -35
- package/node_modules/@playdrop/ai-client/dist/index.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/client.d.ts +34 -33
- package/node_modules/@playdrop/api-client/dist/client.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/core/errors.d.ts +1 -1
- package/node_modules/@playdrop/api-client/dist/core/errors.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/core/request.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/core/request.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/admin.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/admin.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/admin.js +4 -1
- package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.d.ts +4 -3
- package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.js +12 -0
- package/node_modules/@playdrop/api-client/dist/domains/ai.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/ai.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts +4 -4
- package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/asset-packs.d.ts +4 -4
- package/node_modules/@playdrop/api-client/dist/domains/asset-packs.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts +4 -4
- package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/auth.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/auth.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/chat.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/chat.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/comments.d.ts +3 -3
- package/node_modules/@playdrop/api-client/dist/domains/comments.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/free-credits.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/free-credits.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/me.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/me.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/payments.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/payments.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/player-meta.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/player-meta.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/playtrade.d.ts +3 -3
- package/node_modules/@playdrop/api-client/dist/domains/playtrade.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/playtrade.js +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/search.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/search.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/tags.d.ts +2 -2
- package/node_modules/@playdrop/api-client/dist/domains/tags.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/index.d.ts +19 -18
- package/node_modules/@playdrop/api-client/dist/index.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/index.js +7 -2
- package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js +47 -47
- package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.js +32 -47
- package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/format-utils.js +16 -18
- package/node_modules/@playdrop/boxel-core/dist/src/format-utils.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/geometry.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/index.d.ts +4 -4
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/common.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/index.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js +44 -45
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/types.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js +40 -44
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.js +30 -34
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.d.ts +4 -4
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.js +23 -20
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.js +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.js +21 -21
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.js +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/index.d.ts +19 -19
- package/node_modules/@playdrop/boxel-core/dist/src/materials.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/materials.js +12 -16
- package/node_modules/@playdrop/boxel-core/dist/src/materials.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.js +38 -41
- package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/serialization.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/serialization.js +54 -56
- package/node_modules/@playdrop/boxel-core/dist/src/serialization.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/textures.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/textures.js +39 -45
- package/node_modules/@playdrop/boxel-core/dist/src/textures.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.js +39 -43
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js +35 -35
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.js +18 -18
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js +50 -48
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.js +22 -26
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.js +8 -8
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.js +23 -28
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/types.d.ts +8 -8
- package/node_modules/@playdrop/boxel-core/dist/src/validation.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/validation.js +93 -95
- package/node_modules/@playdrop/boxel-core/dist/src/validation.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.js +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/voxels.d.ts +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/voxels.js +2 -7
- package/node_modules/@playdrop/boxel-core/dist/src/voxels.js.map +1 -1
- package/node_modules/@playdrop/boxel-three/dist/src/animations.d.ts +3 -3
- package/node_modules/@playdrop/boxel-three/dist/src/builders.d.ts +4 -4
- package/node_modules/@playdrop/boxel-three/dist/src/context.d.ts +3 -3
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.d.ts +6 -6
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.js +9 -1
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/image.d.ts +3 -3
- package/node_modules/@playdrop/boxel-three/dist/src/index.d.ts +17 -17
- package/node_modules/@playdrop/boxel-three/dist/src/instantiate.d.ts +9 -9
- package/node_modules/@playdrop/boxel-three/dist/src/nodes.d.ts +3 -3
- package/node_modules/@playdrop/boxel-three/dist/src/nodes.js +1 -1
- package/node_modules/@playdrop/boxel-three/dist/src/overlays.d.ts +2 -2
- package/node_modules/@playdrop/boxel-three/dist/src/primitives.d.ts +1 -1
- package/node_modules/@playdrop/boxel-three/dist/src/scene.d.ts +1 -1
- package/node_modules/@playdrop/boxel-three/dist/src/skinned-mesh.d.ts +2 -2
- package/node_modules/@playdrop/boxel-three/dist/src/texture-atlas.d.ts +1 -1
- package/node_modules/@playdrop/boxel-three/dist/src/textures.d.ts +3 -3
- package/node_modules/@playdrop/boxel-three/dist/src/types.d.ts +4 -4
- package/node_modules/@playdrop/boxel-three/dist/src/voxels/faces.d.ts +2 -2
- package/node_modules/@playdrop/boxel-three/dist/src/voxels/mesher.d.ts +1 -1
- package/node_modules/@playdrop/boxel-three/dist/test/fixtures/render-worker.d.ts +1 -1
- package/node_modules/@playdrop/config/client-meta.json +4 -4
- package/node_modules/@playdrop/config/dist/src/client-meta.d.ts +1 -1
- package/node_modules/@playdrop/config/dist/src/client-meta.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/client-meta.js +10 -10
- package/node_modules/@playdrop/config/dist/src/constants.js +10 -10
- package/node_modules/@playdrop/config/dist/src/creator-plans.d.ts +1 -1
- package/node_modules/@playdrop/config/dist/src/creator-plans.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/creator-plans.js +27 -28
- package/node_modules/@playdrop/config/dist/src/deployment.d.ts +4 -4
- package/node_modules/@playdrop/config/dist/src/deployment.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/deployment.js +42 -41
- package/node_modules/@playdrop/config/dist/src/game-arena.js +12 -12
- package/node_modules/@playdrop/config/dist/src/index.d.ts +9 -9
- package/node_modules/@playdrop/config/dist/src/index.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/index.js +24 -25
- package/node_modules/@playdrop/config/dist/src/public-deployment.d.ts +4 -4
- package/node_modules/@playdrop/config/dist/src/public-deployment.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/public-deployment.js +41 -39
- package/node_modules/@playdrop/config/dist/src/runtime-client-meta.js +1 -3
- package/node_modules/@playdrop/config/dist/src/runtime-service-origins.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/runtime-service-origins.js +23 -25
- package/node_modules/@playdrop/config/dist/src/server/fastify.d.ts +5 -5
- package/node_modules/@playdrop/config/dist/src/server/fastify.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/server/fastify.js +44 -46
- package/node_modules/@playdrop/config/dist/src/server/logging.d.ts +1 -1
- package/node_modules/@playdrop/config/dist/src/server/logging.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/server/logging.js +6 -8
- package/node_modules/@playdrop/config/dist/src/types.d.ts +2 -2
- package/node_modules/@playdrop/config/dist/test/creator-plans.test.js +12 -12
- package/node_modules/@playdrop/config/dist/test/deployment.test.js +59 -59
- package/node_modules/@playdrop/config/dist/test/fastify.test.js +4 -4
- package/node_modules/@playdrop/config/dist/test/game-arena.test.js +8 -8
- package/node_modules/@playdrop/config/dist/test/logging.test.js +6 -6
- package/node_modules/@playdrop/config/dist/test/validateClientEnvironment.test.js +57 -57
- package/node_modules/@playdrop/config/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@playdrop/types/dist/agent-task-playtest.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/agent-task-terminal.d.ts +2 -2
- package/node_modules/@playdrop/types/dist/agent-task-terminal.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/api.d.ts +314 -250
- package/node_modules/@playdrop/types/dist/api.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/api.js +40 -59
- package/node_modules/@playdrop/types/dist/app-capability-filters.d.ts +2 -2
- package/node_modules/@playdrop/types/dist/app-playtest-tape.d.ts +6 -6
- package/node_modules/@playdrop/types/dist/app-playtest-tape.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/app-review.d.ts +2 -2
- package/node_modules/@playdrop/types/dist/app-review.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/app-review.js +1 -6
- package/node_modules/@playdrop/types/dist/app.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/asset-pack.d.ts +5 -5
- package/node_modules/@playdrop/types/dist/asset-spec.d.ts +4 -4
- package/node_modules/@playdrop/types/dist/asset.d.ts +11 -11
- package/node_modules/@playdrop/types/dist/attachment-policy.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/chat.d.ts +3 -3
- package/node_modules/@playdrop/types/dist/creator-public-image.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/graph.d.ts +4 -4
- package/node_modules/@playdrop/types/dist/index.d.ts +25 -25
- package/node_modules/@playdrop/types/dist/instrument-evidence.d.ts +2 -2
- package/node_modules/@playdrop/types/dist/instrument-evidence.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/instrument-evidence.js +2 -11
- package/node_modules/@playdrop/types/dist/locale.d.ts +2 -2
- package/node_modules/@playdrop/types/dist/locale.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/locale.js +2 -17
- package/node_modules/@playdrop/types/dist/owned-assets.d.ts +2 -2
- package/node_modules/@playdrop/types/dist/owned-assets.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/player-meta.d.ts +3 -3
- package/node_modules/@playdrop/types/dist/player-meta.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/playtest-notes.d.ts +11 -11
- package/node_modules/@playdrop/types/dist/playtest-notes.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/playtrade.d.ts +8 -5
- package/node_modules/@playdrop/types/dist/playtrade.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/realtime.d.ts +1 -1
- package/node_modules/@playdrop/types/dist/tweaks.d.ts +4 -4
- package/node_modules/@playdrop/types/dist/tweaks.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/tweaks.js +12 -2
- package/node_modules/@playdrop/types/dist/version.d.ts +14 -14
- package/node_modules/@playdrop/types/dist/version.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/version.js +4 -1
- package/node_modules/@playdrop/vox-three/dist/src/index.d.ts +1 -1
- package/node_modules/@playdrop/vox-three/dist/src/vox.d.ts +2 -2
- package/node_modules/@playdrop/vox-three/dist/src/vox.js +20 -18
- package/node_modules/@playdrop/vox-three/dist/src/vox.js.map +1 -1
- package/node_modules/@playdrop/vox-three/dist/test/vox.test.js +11 -14
- package/node_modules/@playdrop/vox-three/dist/test/vox.test.js.map +1 -1
- package/package.json +1 -1
|
@@ -13,24 +13,26 @@ exports.resolveApiOrigin = resolveApiOrigin;
|
|
|
13
13
|
exports.resolveRealtimeOrigin = resolveRealtimeOrigin;
|
|
14
14
|
exports.resolveAiOrigin = resolveAiOrigin;
|
|
15
15
|
exports.resolveStructuredLogFields = resolveStructuredLogFields;
|
|
16
|
-
const DEPLOY_ROLE_VALUES = new Set([
|
|
17
|
-
const DEPLOY_SLOT_VALUES = new Set([
|
|
18
|
-
const PUBLIC_SURFACE_VALUES = new Set([
|
|
16
|
+
const DEPLOY_ROLE_VALUES = new Set(["prod", "preview"]);
|
|
17
|
+
const DEPLOY_SLOT_VALUES = new Set(["blue", "green"]);
|
|
18
|
+
const PUBLIC_SURFACE_VALUES = new Set(["prod", "preview", "blue", "green"]);
|
|
19
19
|
function normalizeValue(value) {
|
|
20
|
-
if (typeof value !==
|
|
20
|
+
if (typeof value !== "string") {
|
|
21
21
|
return null;
|
|
22
22
|
}
|
|
23
23
|
const normalized = value.trim().toLowerCase();
|
|
24
24
|
return normalized.length > 0 ? normalized : null;
|
|
25
25
|
}
|
|
26
26
|
function normalizeOrigin(value) {
|
|
27
|
-
return value.trim().replace(/\/+$/,
|
|
27
|
+
return value.trim().replace(/\/+$/, "");
|
|
28
28
|
}
|
|
29
29
|
function buildDefaultOrigin(params) {
|
|
30
30
|
const { servicePrefix, surface, websocket = false } = params;
|
|
31
|
-
const protocol = websocket ?
|
|
32
|
-
const host = surface ===
|
|
33
|
-
? servicePrefix
|
|
31
|
+
const protocol = websocket ? "wss" : "https";
|
|
32
|
+
const host = surface === "prod"
|
|
33
|
+
? servicePrefix
|
|
34
|
+
? `${servicePrefix}.playdrop.ai`
|
|
35
|
+
: "www.playdrop.ai"
|
|
34
36
|
: servicePrefix
|
|
35
37
|
? `${servicePrefix}.${surface}.playdrop.ai`
|
|
36
38
|
: `${surface}.playdrop.ai`;
|
|
@@ -62,83 +64,83 @@ function parsePublicSurface(value) {
|
|
|
62
64
|
return normalized;
|
|
63
65
|
}
|
|
64
66
|
function resolveDeployRole(env = process.env) {
|
|
65
|
-
return parseDeployRole(env[
|
|
66
|
-
?? (env['NODE_ENV'] === 'production' ? 'prod' : 'preview');
|
|
67
|
+
return parseDeployRole(env["PLAYDROP_DEPLOY_ROLE"]) ?? (env["NODE_ENV"] === "production" ? "prod" : "preview");
|
|
67
68
|
}
|
|
68
69
|
function resolveDeploySlot(env = process.env) {
|
|
69
|
-
return parseDeploySlot(env[
|
|
70
|
+
return parseDeploySlot(env["PLAYDROP_SLOT"]);
|
|
70
71
|
}
|
|
71
72
|
function resolvePublicSurface(env = process.env) {
|
|
72
|
-
const explicit = parsePublicSurface(env[
|
|
73
|
+
const explicit = parsePublicSurface(env["PLAYDROP_PUBLIC_SURFACE"]);
|
|
73
74
|
if (explicit) {
|
|
74
75
|
return explicit;
|
|
75
76
|
}
|
|
76
|
-
return resolveDeployRole(env) ===
|
|
77
|
+
return resolveDeployRole(env) === "preview" ? "preview" : "prod";
|
|
77
78
|
}
|
|
78
79
|
function resolveEnvironmentName(env = process.env) {
|
|
79
|
-
const explicit = typeof env[
|
|
80
|
+
const explicit = typeof env["PLAYDROP_ENVIRONMENT"] === "string" ? env["PLAYDROP_ENVIRONMENT"].trim() : "";
|
|
80
81
|
if (explicit.length > 0) {
|
|
81
82
|
return explicit;
|
|
82
83
|
}
|
|
83
|
-
const nodeEnv = typeof env[
|
|
84
|
-
return nodeEnv.length > 0 ? nodeEnv :
|
|
84
|
+
const nodeEnv = typeof env["NODE_ENV"] === "string" ? env["NODE_ENV"].trim() : "";
|
|
85
|
+
return nodeEnv.length > 0 ? nodeEnv : "development";
|
|
85
86
|
}
|
|
86
87
|
function resolveSeoIndexingMode(env = process.env) {
|
|
87
|
-
const explicit = normalizeValue(env[
|
|
88
|
-
if (explicit ===
|
|
89
|
-
return
|
|
88
|
+
const explicit = normalizeValue(env["PLAYDROP_SEO_INDEXING"]);
|
|
89
|
+
if (explicit === "public") {
|
|
90
|
+
return "public";
|
|
90
91
|
}
|
|
91
|
-
if (explicit ===
|
|
92
|
-
return
|
|
92
|
+
if (explicit === "private") {
|
|
93
|
+
return "private";
|
|
93
94
|
}
|
|
94
|
-
if (explicit ===
|
|
95
|
-
return
|
|
95
|
+
if (explicit === "noindex") {
|
|
96
|
+
return "noindex";
|
|
96
97
|
}
|
|
97
|
-
return resolveDeployRole(env) ===
|
|
98
|
+
return resolveDeployRole(env) === "prod" ? "public" : "noindex";
|
|
98
99
|
}
|
|
99
100
|
function resolveWebOrigin(env = process.env) {
|
|
100
|
-
const explicit = typeof env[
|
|
101
|
+
const explicit = typeof env["PLAYDROP_PUBLIC_ORIGIN"] === "string" ? env["PLAYDROP_PUBLIC_ORIGIN"].trim() : "";
|
|
101
102
|
if (explicit.length > 0) {
|
|
102
103
|
return normalizeOrigin(explicit);
|
|
103
104
|
}
|
|
104
|
-
const legacy = typeof env[
|
|
105
|
+
const legacy = typeof env["PLAYDROP_WEB_BASE_URL"] === "string" ? env["PLAYDROP_WEB_BASE_URL"].trim() : "";
|
|
105
106
|
if (legacy.length > 0) {
|
|
106
107
|
return normalizeOrigin(legacy);
|
|
107
108
|
}
|
|
108
109
|
return buildDefaultOrigin({ surface: resolvePublicSurface(env) });
|
|
109
110
|
}
|
|
110
111
|
function resolveApiOrigin(env = process.env) {
|
|
111
|
-
const explicit = typeof env[
|
|
112
|
+
const explicit = typeof env["PLAYDROP_API_BASE_URL"] === "string" ? env["PLAYDROP_API_BASE_URL"].trim() : "";
|
|
112
113
|
if (explicit.length > 0) {
|
|
113
114
|
return normalizeOrigin(explicit);
|
|
114
115
|
}
|
|
115
|
-
return buildDefaultOrigin({ servicePrefix:
|
|
116
|
+
return buildDefaultOrigin({ servicePrefix: "api", surface: resolvePublicSurface(env) });
|
|
116
117
|
}
|
|
117
118
|
function resolveRealtimeOrigin(env = process.env) {
|
|
118
|
-
const explicit = typeof env[
|
|
119
|
+
const explicit = typeof env["PLAYDROP_REALTIME_BASE_URL"] === "string" ? env["PLAYDROP_REALTIME_BASE_URL"].trim() : "";
|
|
119
120
|
if (explicit.length > 0) {
|
|
120
121
|
return normalizeOrigin(explicit);
|
|
121
122
|
}
|
|
122
|
-
return buildDefaultOrigin({ servicePrefix:
|
|
123
|
+
return buildDefaultOrigin({ servicePrefix: "play", surface: resolvePublicSurface(env), websocket: true });
|
|
123
124
|
}
|
|
124
125
|
function resolveAiOrigin(env = process.env) {
|
|
125
|
-
const explicit = typeof env[
|
|
126
|
+
const explicit = typeof env["PLAYDROP_AI_BASE_URL"] === "string" ? env["PLAYDROP_AI_BASE_URL"].trim() : "";
|
|
126
127
|
if (explicit.length > 0) {
|
|
127
128
|
return normalizeOrigin(explicit);
|
|
128
129
|
}
|
|
129
|
-
return buildDefaultOrigin({ servicePrefix:
|
|
130
|
+
return buildDefaultOrigin({ servicePrefix: "ai", surface: resolvePublicSurface(env) });
|
|
130
131
|
}
|
|
131
132
|
function resolveStructuredLogFields(service, env = process.env) {
|
|
132
|
-
const releaseVersion = typeof env[
|
|
133
|
-
? env[
|
|
134
|
-
: typeof env[
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
133
|
+
const releaseVersion = typeof env["PLAYDROP_RELEASE_VERSION"] === "string" && env["PLAYDROP_RELEASE_VERSION"].trim().length > 0
|
|
134
|
+
? env["PLAYDROP_RELEASE_VERSION"].trim()
|
|
135
|
+
: typeof env["NEXT_PUBLIC_PLAYDROP_RELEASE_VERSION"] === "string" &&
|
|
136
|
+
env["NEXT_PUBLIC_PLAYDROP_RELEASE_VERSION"].trim().length > 0
|
|
137
|
+
? env["NEXT_PUBLIC_PLAYDROP_RELEASE_VERSION"].trim()
|
|
138
|
+
: "0.0.0";
|
|
139
|
+
const buildNumber = parseReleaseBuild(env["PLAYDROP_BUILD_NUMBER"] ?? env["NEXT_PUBLIC_PLAYDROP_BUILD_NUMBER"]);
|
|
138
140
|
const slot = resolveDeploySlot(env);
|
|
139
141
|
return {
|
|
140
142
|
environment: resolveEnvironmentName(env),
|
|
141
|
-
slot: slot ??
|
|
143
|
+
slot: slot ?? "none",
|
|
142
144
|
service,
|
|
143
145
|
release_version: releaseVersion,
|
|
144
146
|
build_number: buildNumber,
|
|
@@ -11,9 +11,7 @@ function readRuntimeClientMeta() {
|
|
|
11
11
|
const version = typeof raw?.version === "string"
|
|
12
12
|
? raw.version.trim()
|
|
13
13
|
: "";
|
|
14
|
-
const build = typeof raw?.build === "string"
|
|
15
|
-
? raw.build.trim()
|
|
16
|
-
: "";
|
|
14
|
+
const build = typeof raw?.build === "string" ? raw.build.trim() : "";
|
|
17
15
|
if (!version || !build) {
|
|
18
16
|
throw new Error("missing_runtime_client_meta");
|
|
19
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-service-origins.d.ts","sourceRoot":"","sources":["../../src/runtime-service-origins.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B;;;;;;;CAOhC,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,MAAM,OAAO,6BAA6B,CAAC;AAC5E,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAoEpE,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CA0B/E;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,eAAe,CAAC;CAC1B,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"runtime-service-origins.d.ts","sourceRoot":"","sources":["../../src/runtime-service-origins.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B;;;;;;;CAOhC,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,MAAM,OAAO,6BAA6B,CAAC;AAC5E,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAoEpE,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CA0B/E;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,eAAe,CAAC;CAC1B,GAAG,MAAM,CAaT;AA2BD,wBAAgB,4BAA4B,CAAC,KAAK,EAAE;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAChD,GAAG,MAAM,CAgCT;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,GAAG,MAAM,CAOT;AAED,wBAAgB,6BAA6B,CAAC,KAAK,EAAE;IACnD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,GAAG,MAAM,CAkCT;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,GAAG,MAAM,CAwBT;AAED,wBAAgB,wBAAwB,IAAI,MAAM,CAUjD;AAED,wBAAgB,6BAA6B,IAAI,MAAM,CAUtD;AAED,wBAAgB,2BAA2B,IAAI,MAAM,CAUpD"}
|
|
@@ -19,14 +19,7 @@ exports.RUNTIME_SERVICE_DEFAULT_PORTS = {
|
|
|
19
19
|
assets: 8082,
|
|
20
20
|
};
|
|
21
21
|
const PLAYDROP_SURFACES = new Set(["prod", "preview", "blue", "green"]);
|
|
22
|
-
const PLAYDROP_SERVICE_PREFIXES = new Set([
|
|
23
|
-
"www",
|
|
24
|
-
"api",
|
|
25
|
-
"play",
|
|
26
|
-
"admin",
|
|
27
|
-
"ai",
|
|
28
|
-
"assets",
|
|
29
|
-
]);
|
|
22
|
+
const PLAYDROP_SERVICE_PREFIXES = new Set(["www", "api", "play", "admin", "ai", "assets"]);
|
|
30
23
|
function trimTrailingSlash(value) {
|
|
31
24
|
return value.replace(/\/+$/, "");
|
|
32
25
|
}
|
|
@@ -37,21 +30,22 @@ function normalizeHttpProtocol(value) {
|
|
|
37
30
|
return value === "https:" || value === "https" ? "https:" : "http:";
|
|
38
31
|
}
|
|
39
32
|
function isLoopbackHostname(hostname) {
|
|
40
|
-
return hostname === "localhost"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
33
|
+
return (hostname === "localhost" ||
|
|
34
|
+
hostname === "127.0.0.1" ||
|
|
35
|
+
hostname === "0.0.0.0" ||
|
|
36
|
+
hostname === "::1" ||
|
|
37
|
+
hostname === "[::1]");
|
|
45
38
|
}
|
|
46
39
|
function isIpv4Hostname(hostname) {
|
|
47
40
|
const parts = hostname.split(".");
|
|
48
|
-
return parts.length === 4 &&
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
41
|
+
return (parts.length === 4 &&
|
|
42
|
+
parts.every((part) => {
|
|
43
|
+
if (!/^\d{1,3}$/.test(part)) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
const value = Number(part);
|
|
47
|
+
return Number.isInteger(value) && value >= 0 && value <= 255;
|
|
48
|
+
}));
|
|
55
49
|
}
|
|
56
50
|
function isIpHostname(hostname) {
|
|
57
51
|
return isIpv4Hostname(hostname) || hostname.includes(":");
|
|
@@ -60,9 +54,9 @@ function formatHostnameForUrl(hostname) {
|
|
|
60
54
|
return hostname.includes(":") && !hostname.startsWith("[") ? `[${hostname}]` : hostname;
|
|
61
55
|
}
|
|
62
56
|
function resolveDefaultPort(service, defaultPorts = exports.RUNTIME_SERVICE_DEFAULT_PORTS) {
|
|
63
|
-
return defaultPorts[service]
|
|
64
|
-
|
|
65
|
-
|
|
57
|
+
return (defaultPorts[service] ??
|
|
58
|
+
exports.RUNTIME_SERVICE_DEFAULT_PORTS[service] ??
|
|
59
|
+
exports.RUNTIME_SERVICE_DEFAULT_PORTS.www);
|
|
66
60
|
}
|
|
67
61
|
function stripKnownServicePrefix(hostname) {
|
|
68
62
|
const parts = hostname.split(".");
|
|
@@ -98,8 +92,12 @@ function buildPlaydropServiceOrigin(input) {
|
|
|
98
92
|
const service = input.service.trim().toLowerCase() || "www";
|
|
99
93
|
const surface = input.surface;
|
|
100
94
|
const hostname = service === "www"
|
|
101
|
-
? surface === "prod"
|
|
102
|
-
|
|
95
|
+
? surface === "prod"
|
|
96
|
+
? "www.playdrop.ai"
|
|
97
|
+
: `${surface}.playdrop.ai`
|
|
98
|
+
: surface === "prod"
|
|
99
|
+
? `${service}.playdrop.ai`
|
|
100
|
+
: `${service}.${surface}.playdrop.ai`;
|
|
103
101
|
return `${protocol}//${hostname}`;
|
|
104
102
|
}
|
|
105
103
|
function resolveLocalDomainServiceOrigin(input) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { FastifyInstance, FastifyLoggerOptions, FastifyReply, FastifyRequest, FastifyServerOptions, RawServerDefault } from
|
|
2
|
-
import { Writable } from
|
|
3
|
-
import type { ClientErrorResponseBody, ClientGuard, ClientRuntimeInfo, ClientValidationFailure, ClientValidator, NormalizedClientRuntimeInfo } from
|
|
4
|
-
declare module
|
|
1
|
+
import type { FastifyInstance, FastifyLoggerOptions, FastifyReply, FastifyRequest, FastifyServerOptions, RawServerDefault } from "fastify";
|
|
2
|
+
import { Writable } from "node:stream";
|
|
3
|
+
import type { ClientErrorResponseBody, ClientGuard, ClientRuntimeInfo, ClientValidationFailure, ClientValidator, NormalizedClientRuntimeInfo } from "../types";
|
|
4
|
+
declare module "fastify" {
|
|
5
5
|
interface FastifyRequest {
|
|
6
6
|
clientRuntime?: NormalizedClientRuntimeInfo;
|
|
7
7
|
requestLogContext?: {
|
|
@@ -62,7 +62,7 @@ export declare function buildFastifyLogger(service: string): (FastifyLoggerOptio
|
|
|
62
62
|
export declare function buildFastifyServerOptions(params: {
|
|
63
63
|
service: string;
|
|
64
64
|
bodyLimit?: number;
|
|
65
|
-
trustProxy?: FastifyServerOptions<RawServerDefault>[
|
|
65
|
+
trustProxy?: FastifyServerOptions<RawServerDefault>["trustProxy"];
|
|
66
66
|
}): FastifyServerOptions<RawServerDefault>;
|
|
67
67
|
export declare function registerStructuredRequestLogging(app: FastifyInstance): void;
|
|
68
68
|
export declare function readClientHeaders(request: FastifyRequest): ClientRuntimeInfo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fastify.d.ts","sourceRoot":"","sources":["../../../src/server/fastify.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,oBAAoB,EAEpB,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAIjB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"fastify.d.ts","sourceRoot":"","sources":["../../../src/server/fastify.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,oBAAoB,EAEpB,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAIjB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,KAAK,EACV,uBAAuB,EACvB,WAAW,EACX,iBAAiB,EACjB,uBAAuB,EACvB,eAAe,EACf,2BAA2B,EAC5B,MAAM,UAAU,CAAC;AAGlB,OAAO,QAAQ,SAAS,CAAC;IACvB,UAAU,cAAc;QACtB,aAAa,CAAC,EAAE,2BAA2B,CAAC;QAC5C,iBAAiB,CAAC,EAAE;YAClB,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB,MAAM,CAAC,EAAE,MAAM,CAAC;SACjB,CAAC;KACH;CACF;AAUD,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE;IACL,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CACjC,GACA,IAAI,CAUN;AAgBD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM;UAYxC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;gBACjB,MAAM;gBACN;QACV,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG;YACpB,KAAK,EAAE,MAAM,CAAC;SACf,CAAC;KACH;eACU,MAAM,MAAM;aACd,QAAQ;;;;;kBARjB,CAAH;eAAmB,CAAC;mBACZ,CAAC;gBACJ,CAAC;yBACY,CAAA;sBACJ,CAAC;;;;;;;;;;sBAYiC,CAAC;;;;;;;UAhBxC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;gBACjB,MAAM;gBACN;QACV,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG;YACpB,KAAK,EAAE,MAAM,CAAC;SACf,CAAC;KACH;eACU,MAAM,MAAM;EAW1B;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,oBAAoB,CAAC,gBAAgB,CAAC,CAAC,YAAY,CAAC,CAAC;CACnE,GAAG,oBAAoB,CAAC,gBAAgB,CAAC,CAqBzC;AAED,wBAAgB,gCAAgC,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI,CA+C3E;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,cAAc,GAAG,iBAAiB,CAkB5E;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,uBAAuB,GAAG,uBAAuB,CAiE3F;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,GAAE,CAAC,OAAO,EAAE,cAAc,KAAK,iBAAqC,EAC1E,SAAS,GAAE,eAA2C,EACtD,SAAS,GAAE,CAAC,OAAO,EAAE,uBAAuB,KAAK,uBAA2C,GAC3F,WAAW,CAkBb;AAED,eAAO,MAAM,qBAAqB,aAAqB,CAAC"}
|
|
@@ -37,7 +37,7 @@ function setRequestLogContext(request, input) {
|
|
|
37
37
|
}
|
|
38
38
|
function createStructuredLogMirrorStream(logFilePath) {
|
|
39
39
|
node_fs_1.default.mkdirSync(node_path_1.default.dirname(logFilePath), { recursive: true });
|
|
40
|
-
const fileStream = node_fs_1.default.createWriteStream(logFilePath, { flags:
|
|
40
|
+
const fileStream = node_fs_1.default.createWriteStream(logFilePath, { flags: "a" });
|
|
41
41
|
return new node_stream_1.Writable({
|
|
42
42
|
write(chunk, _encoding, callback) {
|
|
43
43
|
process.stdout.write(chunk);
|
|
@@ -50,9 +50,9 @@ function createStructuredLogMirrorStream(logFilePath) {
|
|
|
50
50
|
}
|
|
51
51
|
function buildFastifyLogger(service) {
|
|
52
52
|
const logger = {
|
|
53
|
-
level: process.env[
|
|
53
|
+
level: process.env["LOG_LEVEL"]?.trim() || "info",
|
|
54
54
|
base: (0, index_1.resolveStructuredLogFields)(service),
|
|
55
|
-
messageKey:
|
|
55
|
+
messageKey: "message",
|
|
56
56
|
formatters: {
|
|
57
57
|
level(label) {
|
|
58
58
|
return { level: label };
|
|
@@ -76,33 +76,33 @@ function buildFastifyServerOptions(params) {
|
|
|
76
76
|
},
|
|
77
77
|
logger: buildFastifyLogger(params.service),
|
|
78
78
|
disableRequestLogging: true,
|
|
79
|
-
requestIdHeader:
|
|
79
|
+
requestIdHeader: "x-request-id",
|
|
80
80
|
genReqId(request) {
|
|
81
|
-
const explicit = request.headers[
|
|
82
|
-
if (typeof explicit ===
|
|
81
|
+
const explicit = request.headers["x-request-id"];
|
|
82
|
+
if (typeof explicit === "string" && explicit.trim().length > 0) {
|
|
83
83
|
return explicit.trim();
|
|
84
84
|
}
|
|
85
|
-
if (Array.isArray(explicit) && typeof explicit[0] ===
|
|
85
|
+
if (Array.isArray(explicit) && typeof explicit[0] === "string" && explicit[0].trim().length > 0) {
|
|
86
86
|
return explicit[0].trim();
|
|
87
87
|
}
|
|
88
88
|
return (0, node_crypto_1.randomUUID)();
|
|
89
89
|
},
|
|
90
|
-
...(typeof params.bodyLimit ===
|
|
90
|
+
...(typeof params.bodyLimit === "number" ? { bodyLimit: params.bodyLimit } : {}),
|
|
91
91
|
...(params.trustProxy !== undefined ? { trustProxy: params.trustProxy } : {}),
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
94
|
function registerStructuredRequestLogging(app) {
|
|
95
|
-
app.addHook(
|
|
96
|
-
reply.header(
|
|
95
|
+
app.addHook("onRequest", async (request, reply) => {
|
|
96
|
+
reply.header("x-request-id", request.id);
|
|
97
97
|
request.log.info({
|
|
98
98
|
request_id: request.id,
|
|
99
99
|
method: request.method,
|
|
100
100
|
path: request.url,
|
|
101
101
|
host: request.hostname,
|
|
102
102
|
remote_ip: request.ip,
|
|
103
|
-
},
|
|
103
|
+
}, "request_started");
|
|
104
104
|
});
|
|
105
|
-
app.addHook(
|
|
105
|
+
app.addHook("onError", async (request, _reply, error) => {
|
|
106
106
|
const context = request.requestLogContext ?? {};
|
|
107
107
|
request.log.error({
|
|
108
108
|
err: error,
|
|
@@ -111,11 +111,11 @@ function registerStructuredRequestLogging(app) {
|
|
|
111
111
|
path: request.url,
|
|
112
112
|
user_id: context.userId,
|
|
113
113
|
room_id: context.roomId,
|
|
114
|
-
},
|
|
114
|
+
}, "request_failed");
|
|
115
115
|
});
|
|
116
|
-
app.addHook(
|
|
116
|
+
app.addHook("onResponse", async (request, reply) => {
|
|
117
117
|
const context = request.requestLogContext ?? {};
|
|
118
|
-
const elapsedMs = typeof reply.elapsedTime ===
|
|
118
|
+
const elapsedMs = typeof reply.elapsedTime === "number" ? Math.round(reply.elapsedTime) : undefined;
|
|
119
119
|
request.log.info({
|
|
120
120
|
request_id: request.id,
|
|
121
121
|
method: request.method,
|
|
@@ -125,7 +125,7 @@ function registerStructuredRequestLogging(app) {
|
|
|
125
125
|
duration_ms: elapsedMs,
|
|
126
126
|
user_id: context.userId,
|
|
127
127
|
room_id: context.roomId,
|
|
128
|
-
},
|
|
128
|
+
}, "request_completed");
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
131
|
function readClientHeaders(request) {
|
|
@@ -133,68 +133,66 @@ function readClientHeaders(request) {
|
|
|
133
133
|
const getHeader = (name) => {
|
|
134
134
|
const value = headers[name] ?? headers[name.toLowerCase()];
|
|
135
135
|
if (Array.isArray(value)) {
|
|
136
|
-
return typeof value[0] ===
|
|
136
|
+
return typeof value[0] === "string" ? value[0] : undefined;
|
|
137
137
|
}
|
|
138
|
-
return typeof value ===
|
|
138
|
+
return typeof value === "string" ? value : undefined;
|
|
139
139
|
};
|
|
140
140
|
return {
|
|
141
|
-
client: getHeader(index_1.CLIENT_HEADER_NAMES.client) ??
|
|
142
|
-
clientVersion: getHeader(index_1.CLIENT_HEADER_NAMES.clientVersion) ??
|
|
143
|
-
clientBuild: getHeader(index_1.CLIENT_HEADER_NAMES.clientBuild) ??
|
|
144
|
-
platform: getHeader(index_1.CLIENT_HEADER_NAMES.platform) ??
|
|
145
|
-
platformVersion: getHeader(index_1.CLIENT_HEADER_NAMES.platformVersion) ??
|
|
141
|
+
client: getHeader(index_1.CLIENT_HEADER_NAMES.client) ?? "",
|
|
142
|
+
clientVersion: getHeader(index_1.CLIENT_HEADER_NAMES.clientVersion) ?? "",
|
|
143
|
+
clientBuild: getHeader(index_1.CLIENT_HEADER_NAMES.clientBuild) ?? "",
|
|
144
|
+
platform: getHeader(index_1.CLIENT_HEADER_NAMES.platform) ?? "",
|
|
145
|
+
platformVersion: getHeader(index_1.CLIENT_HEADER_NAMES.platformVersion) ?? "",
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
148
|
function formatClientError(failure) {
|
|
149
149
|
const missingHeaders = failure.missingHeaders ?? null;
|
|
150
|
-
const provided = failure.ok ? null : failure.provided ?? null;
|
|
150
|
+
const provided = failure.ok ? null : (failure.provided ?? null);
|
|
151
151
|
const currentVersion = provided?.clientVersion ?? null;
|
|
152
152
|
const currentBuild = provided?.clientBuild ?? null;
|
|
153
153
|
const defaultMessage = (() => {
|
|
154
154
|
switch (failure.code) {
|
|
155
|
-
case
|
|
155
|
+
case "missing_client_metadata": {
|
|
156
156
|
if (missingHeaders && missingHeaders.length > 0) {
|
|
157
|
-
return `Unsupported request. Missing client headers: ${missingHeaders.join(
|
|
157
|
+
return `Unsupported request. Missing client headers: ${missingHeaders.join(", ")}.`;
|
|
158
158
|
}
|
|
159
|
-
return
|
|
159
|
+
return "Unsupported request. Client metadata headers are required.";
|
|
160
160
|
}
|
|
161
|
-
case
|
|
162
|
-
return
|
|
163
|
-
case
|
|
161
|
+
case "unsupported_client":
|
|
162
|
+
return "Unsupported client. Please update your application to continue.";
|
|
163
|
+
case "unsupported_client_version": {
|
|
164
164
|
const currentLabel = currentVersion
|
|
165
|
-
? `${currentVersion}${currentBuild !== null ? ` build ${currentBuild}` :
|
|
165
|
+
? `${currentVersion}${currentBuild !== null ? ` build ${currentBuild}` : ""}`
|
|
166
166
|
: currentBuild !== null
|
|
167
167
|
? `build ${currentBuild}`
|
|
168
|
-
:
|
|
169
|
-
const requiredVersion = failure.requiredVersion ?? currentVersion ??
|
|
168
|
+
: "unknown";
|
|
169
|
+
const requiredVersion = failure.requiredVersion ?? currentVersion ?? "latest";
|
|
170
170
|
const requiredBuildLabel = failure.requiredBuild !== null && failure.requiredBuild !== undefined
|
|
171
171
|
? ` build ${failure.requiredBuild}`
|
|
172
|
-
:
|
|
172
|
+
: "";
|
|
173
173
|
return `Unsupported version. Please update the app. Current version ${currentLabel}. Requires version ${requiredVersion}${requiredBuildLabel}.`;
|
|
174
174
|
}
|
|
175
|
-
case
|
|
175
|
+
case "unsupported_client_build": {
|
|
176
176
|
const currentLabel = currentVersion
|
|
177
|
-
? `${currentVersion}${currentBuild !== null ? ` build ${currentBuild}` :
|
|
177
|
+
? `${currentVersion}${currentBuild !== null ? ` build ${currentBuild}` : ""}`
|
|
178
178
|
: currentBuild !== null
|
|
179
179
|
? `build ${currentBuild}`
|
|
180
|
-
:
|
|
181
|
-
const requiredVersion = failure.requiredVersion ?? currentVersion ??
|
|
180
|
+
: "unknown";
|
|
181
|
+
const requiredVersion = failure.requiredVersion ?? currentVersion ?? "latest";
|
|
182
182
|
const requiredBuildLabel = failure.requiredBuild !== null && failure.requiredBuild !== undefined
|
|
183
183
|
? ` build ${failure.requiredBuild}`
|
|
184
|
-
:
|
|
184
|
+
: "";
|
|
185
185
|
return `Unsupported version. Please update the app. Current version ${currentLabel}. Requires version ${requiredVersion}${requiredBuildLabel}.`;
|
|
186
186
|
}
|
|
187
|
-
case
|
|
187
|
+
case "unsupported_platform_version": {
|
|
188
188
|
const requirement = failure.requiredPlatformVersion
|
|
189
189
|
? `version ${failure.requiredPlatformVersion} or later`
|
|
190
|
-
:
|
|
191
|
-
const runtime = provided
|
|
192
|
-
? `${provided.platform} ${provided.platformVersion}`
|
|
193
|
-
: 'current platform unknown';
|
|
190
|
+
: "a newer platform version";
|
|
191
|
+
const runtime = provided ? `${provided.platform} ${provided.platformVersion}` : "current platform unknown";
|
|
194
192
|
return `Unsupported platform version. Requires ${requirement}. (${runtime})`;
|
|
195
193
|
}
|
|
196
194
|
default:
|
|
197
|
-
return
|
|
195
|
+
return "Unsupported client environment. Please update and try again.";
|
|
198
196
|
}
|
|
199
197
|
})();
|
|
200
198
|
return {
|
|
@@ -213,7 +211,7 @@ function buildClientGuard(reader = readClientHeaders, validator = index_1.valida
|
|
|
213
211
|
const runtimeInfo = reader(request);
|
|
214
212
|
const validation = validator(runtimeInfo);
|
|
215
213
|
if (!validation.ok) {
|
|
216
|
-
const statusCode = validation.code ===
|
|
214
|
+
const statusCode = validation.code === "missing_client_metadata" ? 400 : 426;
|
|
217
215
|
request.log.warn({ runtimeInfo }, `Rejected client: ${validation.code}`);
|
|
218
216
|
await reply.code(statusCode).send(formatter(validation));
|
|
219
217
|
return null;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare function resolveStructuredLogFilePath(service: string, env?: NodeJS.ProcessEnv): string | null;
|
|
2
|
-
export declare function createStructuredLogEmitter(service: string, env?: NodeJS.ProcessEnv): (payload: Record<string, unknown>, stream?:
|
|
2
|
+
export declare function createStructuredLogEmitter(service: string, env?: NodeJS.ProcessEnv): (payload: Record<string, unknown>, stream?: "stdout" | "stderr") => void;
|
|
3
3
|
//# sourceMappingURL=logging.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../../src/server/logging.ts"],"names":[],"mappings":"AAYA,wBAAgB,4BAA4B,
|
|
1
|
+
{"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../../src/server/logging.ts"],"names":[],"mappings":"AAYA,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,IAAI,CAMjH;AAED,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,MAAM,EACf,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,KAAK,IAAI,CAmB1E"}
|
|
@@ -8,8 +8,8 @@ exports.createStructuredLogEmitter = createStructuredLogEmitter;
|
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
10
|
function normalizeStructuredLogDir(env = process.env) {
|
|
11
|
-
const value = env[
|
|
12
|
-
if (typeof value !==
|
|
11
|
+
const value = env["PLAYDROP_STRUCTURED_LOG_DIR"];
|
|
12
|
+
if (typeof value !== "string") {
|
|
13
13
|
return null;
|
|
14
14
|
}
|
|
15
15
|
const normalized = value.trim();
|
|
@@ -24,18 +24,16 @@ function resolveStructuredLogFilePath(service, env = process.env) {
|
|
|
24
24
|
}
|
|
25
25
|
function createStructuredLogEmitter(service, env = process.env) {
|
|
26
26
|
const logFilePath = resolveStructuredLogFilePath(service, env);
|
|
27
|
-
const fileStream = logFilePath
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return (payload, stream = 'stdout') => {
|
|
31
|
-
const normalizedPayload = Object.prototype.hasOwnProperty.call(payload, 'timestamp')
|
|
27
|
+
const fileStream = logFilePath ? fs_1.default.createWriteStream(logFilePath, { flags: "a" }) : null;
|
|
28
|
+
return (payload, stream = "stdout") => {
|
|
29
|
+
const normalizedPayload = Object.prototype.hasOwnProperty.call(payload, "timestamp")
|
|
32
30
|
? payload
|
|
33
31
|
: {
|
|
34
32
|
timestamp: new Date().toISOString(),
|
|
35
33
|
...payload,
|
|
36
34
|
};
|
|
37
35
|
const line = `${JSON.stringify(normalizedPayload)}\n`;
|
|
38
|
-
if (stream ===
|
|
36
|
+
if (stream === "stderr") {
|
|
39
37
|
process.stderr.write(line);
|
|
40
38
|
}
|
|
41
39
|
else {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FastifyRequest, FastifyReply } from
|
|
1
|
+
import type { FastifyRequest, FastifyReply } from "fastify";
|
|
2
2
|
export interface ClientPlatformRule {
|
|
3
3
|
minimumVersion?: string;
|
|
4
4
|
message?: string;
|
|
@@ -34,7 +34,7 @@ export interface ClientValidationSuccess {
|
|
|
34
34
|
}
|
|
35
35
|
export interface ClientValidationFailure {
|
|
36
36
|
ok: false;
|
|
37
|
-
code:
|
|
37
|
+
code: "missing_client_metadata" | "unsupported_client" | "unsupported_client_version" | "unsupported_client_build" | "unsupported_platform_version";
|
|
38
38
|
message?: string;
|
|
39
39
|
requiredVersion?: string;
|
|
40
40
|
requiredBuild?: number;
|
|
@@ -6,12 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const strict_1 = __importDefault(require("node:assert/strict"));
|
|
7
7
|
const node_test_1 = __importDefault(require("node:test"));
|
|
8
8
|
const creator_plans_1 = require("../src/creator-plans");
|
|
9
|
-
(0, node_test_1.default)(
|
|
9
|
+
(0, node_test_1.default)("creator plans define progressively higher concurrent task limits", () => {
|
|
10
10
|
strict_1.default.equal(creator_plans_1.CREATOR_PLAN_CATALOG.BASIC.maxConcurrentTasks, 1);
|
|
11
11
|
strict_1.default.equal(creator_plans_1.CREATOR_PLAN_CATALOG.PLUS.maxConcurrentTasks, 5);
|
|
12
12
|
strict_1.default.equal(creator_plans_1.CREATOR_PLAN_CATALOG.PRO.maxConcurrentTasks, 10);
|
|
13
13
|
});
|
|
14
|
-
(0, node_test_1.default)(
|
|
14
|
+
(0, node_test_1.default)("creator referrals add one game and 200 MB up to the referral cap", () => {
|
|
15
15
|
strict_1.default.deepEqual((0, creator_plans_1.resolveCreatorReferralBonus)(3), {
|
|
16
16
|
successfulReferrals: 3,
|
|
17
17
|
rewardedReferrals: 3,
|
|
@@ -26,18 +26,18 @@ const creator_plans_1 = require("../src/creator-plans");
|
|
|
26
26
|
});
|
|
27
27
|
strict_1.default.throws(() => (0, creator_plans_1.resolveCreatorReferralBonus)(-1), /invalid_successful_referral_count/);
|
|
28
28
|
});
|
|
29
|
-
(0, node_test_1.default)(
|
|
30
|
-
strict_1.default.equal((0, creator_plans_1.getNextCreatorPlanResetAt)(new Date(
|
|
29
|
+
(0, node_test_1.default)("weekly reset is Friday 5 PM ET during standard time", () => {
|
|
30
|
+
strict_1.default.equal((0, creator_plans_1.getNextCreatorPlanResetAt)(new Date("2026-01-12T12:00:00Z")).toISOString(), "2026-01-16T22:00:00.000Z");
|
|
31
31
|
});
|
|
32
|
-
(0, node_test_1.default)(
|
|
33
|
-
strict_1.default.equal((0, creator_plans_1.getNextCreatorPlanResetAt)(new Date(
|
|
32
|
+
(0, node_test_1.default)("weekly reset is Friday 5 PM ET during daylight time", () => {
|
|
33
|
+
strict_1.default.equal((0, creator_plans_1.getNextCreatorPlanResetAt)(new Date("2026-08-03T12:00:00Z")).toISOString(), "2026-08-07T21:00:00.000Z");
|
|
34
34
|
});
|
|
35
|
-
(0, node_test_1.default)(
|
|
36
|
-
strict_1.default.equal((0, creator_plans_1.getNextCreatorPlanResetAt)(new Date(
|
|
35
|
+
(0, node_test_1.default)("weekly reset stays at local 5 PM across the spring DST boundary", () => {
|
|
36
|
+
strict_1.default.equal((0, creator_plans_1.getNextCreatorPlanResetAt)(new Date("2026-03-07T23:00:00Z")).toISOString(), "2026-03-13T21:00:00.000Z");
|
|
37
37
|
});
|
|
38
|
-
(0, node_test_1.default)(
|
|
39
|
-
strict_1.default.equal((0, creator_plans_1.getNextCreatorPlanResetAt)(new Date(
|
|
38
|
+
(0, node_test_1.default)("weekly reset stays at local 5 PM across the fall DST boundary", () => {
|
|
39
|
+
strict_1.default.equal((0, creator_plans_1.getNextCreatorPlanResetAt)(new Date("2026-10-31T22:00:00Z")).toISOString(), "2026-11-06T22:00:00.000Z");
|
|
40
40
|
});
|
|
41
|
-
(0, node_test_1.default)(
|
|
42
|
-
strict_1.default.equal((0, creator_plans_1.getNextCreatorPlanResetAt)(new Date(
|
|
41
|
+
(0, node_test_1.default)("the exact reset instant advances to the next week", () => {
|
|
42
|
+
strict_1.default.equal((0, creator_plans_1.getNextCreatorPlanResetAt)(new Date("2026-08-07T21:00:00Z")).toISOString(), "2026-08-14T21:00:00.000Z");
|
|
43
43
|
});
|