@laplace.live/internal 1.2.20 → 1.2.21

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.
Files changed (2) hide show
  1. package/index.d.ts +82 -1
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -769,7 +769,7 @@ export declare namespace LaplaceInternal {
769
769
  periodLength?: number
770
770
  /** Optional: Update user's preferred cycle length (15-60) */
771
771
  cycleLength?: number
772
- /** Optional: URL or description of the evidence source */
772
+ /** Optional: Evidence URL (must be a valid URL, max 256 chars) */
773
773
  source?: string
774
774
  }
775
775
 
@@ -783,6 +783,87 @@ export declare namespace LaplaceInternal {
783
783
  /** ISO timestamp string */
784
784
  lastPeriodStart: string
785
785
  }
786
+
787
+ // ============================================
788
+ // Fertility Contribution Types (Anonymous Submissions)
789
+ // ============================================
790
+
791
+ /**
792
+ * Status of a fertility contribution
793
+ */
794
+ export type ContributionStatus = 'pending' | 'approved' | 'rejected'
795
+
796
+ /**
797
+ * Request body for POST /laplace/fertility-contribute
798
+ * Anonymous users submit period data with Turnstile verification
799
+ */
800
+ export interface FertilityContributeRequest {
801
+ /** Bilibili user ID */
802
+ uid: number
803
+ /** Unix timestamp (ms) when period started */
804
+ periodStart: number
805
+ /** Optional: How many days this period lasted (1-15) */
806
+ periodLength?: number
807
+ /** Optional: Update user's preferred cycle length (15-60) */
808
+ cycleLength?: number
809
+ /** Optional: Evidence URL (must be a valid URL, max 500 chars) */
810
+ source?: string
811
+ /** Cloudflare Turnstile token for bot verification */
812
+ turnstileToken: string
813
+ }
814
+
815
+ /**
816
+ * A fertility contribution record
817
+ * Returned by GET /laplace/fertility-contributions
818
+ */
819
+ export interface FertilityContribution {
820
+ id: number
821
+ uid: number
822
+ periodStart: number
823
+ periodLength?: number
824
+ cycleLength?: number
825
+ source?: string
826
+ status: ContributionStatus
827
+ contributorIp?: string
828
+ /** ISO timestamp string */
829
+ createdAt: string
830
+ /** ISO timestamp string */
831
+ reviewedAt?: string
832
+ rejectReason?: string
833
+ }
834
+
835
+ /**
836
+ * Response for GET /laplace/fertility-contributions
837
+ */
838
+ export interface FertilityContributionsListResponse {
839
+ data: FertilityContribution[]
840
+ total: number
841
+ }
842
+
843
+ /**
844
+ * Success response for POST /laplace/fertility-contribute
845
+ */
846
+ export interface FertilityContributeResponse {
847
+ success: true
848
+ id: number
849
+ message: string
850
+ }
851
+
852
+ /**
853
+ * Request body for POST /laplace/fertility-contribution-reject/:id
854
+ */
855
+ export interface FertilityContributionRejectRequest {
856
+ reason?: string
857
+ }
858
+
859
+ /**
860
+ * Response for approve/reject endpoints
861
+ */
862
+ export interface FertilityContributionActionResponse {
863
+ success: true
864
+ id: number
865
+ status: ContributionStatus
866
+ }
786
867
  }
787
868
 
788
869
  /** Migrated from experiments.sparanoid.net */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laplace.live/internal",
3
- "version": "1.2.20",
3
+ "version": "1.2.21",
4
4
  "module": "index.d.ts",
5
5
  "devDependencies": {
6
6
  "@types/bun": "latest"