@laplace.live/internal 1.2.19 → 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 +85 -0
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -683,6 +683,8 @@ export declare namespace LaplaceInternal {
683
683
  periodLength?: number
684
684
  /** Unix timestamp (ms) - when this entry was recorded */
685
685
  submittedAt: number
686
+ /** Optional: URL or description of the evidence source (e.g., livestream clip, tweet) */
687
+ source?: string
686
688
  }
687
689
 
688
690
  /**
@@ -767,6 +769,8 @@ export declare namespace LaplaceInternal {
767
769
  periodLength?: number
768
770
  /** Optional: Update user's preferred cycle length (15-60) */
769
771
  cycleLength?: number
772
+ /** Optional: Evidence URL (must be a valid URL, max 256 chars) */
773
+ source?: string
770
774
  }
771
775
 
772
776
  /**
@@ -779,6 +783,87 @@ export declare namespace LaplaceInternal {
779
783
  /** ISO timestamp string */
780
784
  lastPeriodStart: string
781
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
+ }
782
867
  }
783
868
 
784
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.19",
3
+ "version": "1.2.21",
4
4
  "module": "index.d.ts",
5
5
  "devDependencies": {
6
6
  "@types/bun": "latest"