palbase 0.4.0 → 0.5.0
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/dist/ai/index.js +2 -2
- package/dist/backend/engine.js +2 -2
- package/dist/backend/env.js +1 -1
- package/dist/backend/index.js +10 -10
- package/dist/backend/stack.js +1 -1
- package/dist/backend/test.js +2 -2
- package/dist/chunks/{IVDNNHII.js → 2GGJKIKT.js} +2 -2
- package/dist/chunks/{BJL2FT5W.js → 2S5VK2PA.js} +1 -1
- package/dist/chunks/{ZFX4BFQR.js → 6SXSYK4S.js} +2 -2
- package/dist/chunks/{3OIKIBMG.js → 73WBTWOK.js} +2 -2
- package/dist/chunks/{UNTTPATW.js → ABBUC5HE.js} +1 -1
- package/dist/chunks/{SUNHFMDO.js → C627JALV.js} +2 -2
- package/dist/chunks/{6JO3UVPT.js → CC36MKWZ.js} +2 -2
- package/dist/chunks/{TRHIZOIS.js → COCND66P.js} +3 -3
- package/dist/chunks/{ODFLUINN.js → FEHN6AHI.js} +1 -1
- package/dist/chunks/{BHT2IHBE.js → GUR3A4M7.js} +2 -2
- package/dist/chunks/HNMC2RJ7.js +20 -0
- package/dist/chunks/{RKNVSAGY.js → IOIQM4QO.js} +1 -1
- package/dist/chunks/{CY6B75KF.js → OROMWNJD.js} +2 -2
- package/dist/chunks/{FS222NNP.js → R5BCF2YW.js} +2 -2
- package/dist/chunks/{ST2NZ4TZ.js → RBUTW6OM.js} +1 -1
- package/dist/chunks/{2AT72FFB.js → RQFK2F3Q.js} +2 -2
- package/dist/cli.js +129 -125
- package/dist/refuse/ai.js +1 -1
- package/dist/refuse/backend.js +1 -1
- package/dist/refuse/server.js +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/testing.js +2 -2
- package/dist/web/index.js +2 -2
- package/dist/web/palbe.js +2 -2
- package/dist/web/paywall.js +2 -2
- package/dist/web/vite.js +2 -2
- package/package.json +2 -2
- package/types/backend/src/container.d.ts +4 -2
- package/types/backend/src/decorators.d.ts +32 -17
- package/types/backend/src/engine.d.ts +9 -4
- package/types/backend/src/env.d.ts +1 -1
- package/types/backend/src/index.d.ts +2 -1
- package/types/backend/src/tasks.d.ts +168 -0
- package/types/internal/src/modules/auth.d.ts +64 -47
- package/types/internal/src/modules/machines.d.ts +320 -79
- package/types/internal/src/modules/notify.d.ts +3 -3
- package/types/internal/src/modules/purchases.d.ts +562 -3
- package/types/internal/src/modules/storage.d.ts +31 -2
- package/types/web/src/client.d.ts +7 -0
- package/types/web/src/paywall/placement.d.ts +2 -0
- package/types/web/src/purchases.d.ts +3 -1
- package/dist/chunks/EGRDFD5C.js +0 -20
|
@@ -239,6 +239,36 @@ export type AppliedStripe = {
|
|
|
239
239
|
[key: string]: StripeProduct;
|
|
240
240
|
}) | null;
|
|
241
241
|
};
|
|
242
|
+
/**
|
|
243
|
+
* A key the project's apps sent in their attributes, as they said it — unverified, a suggestion for writing rules —, never its value.
|
|
244
|
+
*/
|
|
245
|
+
export type AttributeKey = {
|
|
246
|
+
/**
|
|
247
|
+
* The key.
|
|
248
|
+
*/
|
|
249
|
+
key: string;
|
|
250
|
+
/**
|
|
251
|
+
* When an app last sent it — the hour's: a key is seen again at most once an hour.
|
|
252
|
+
*/
|
|
253
|
+
last_seen_at: string;
|
|
254
|
+
/**
|
|
255
|
+
* How many hours it was seen in: counted at most once an hour, as the apps go on sending it.
|
|
256
|
+
*/
|
|
257
|
+
seen_hours: number;
|
|
258
|
+
/**
|
|
259
|
+
* The JSON type it was last sent as.
|
|
260
|
+
*/
|
|
261
|
+
type: "string" | "number" | "boolean";
|
|
262
|
+
};
|
|
263
|
+
/**
|
|
264
|
+
* The attribute keys the project's apps sent (at most 200), as they said them, unverified: the most used first.
|
|
265
|
+
*/
|
|
266
|
+
export type AttributeKeys = {
|
|
267
|
+
/**
|
|
268
|
+
* The keys, by the hours each was seen in, then the newest seen.
|
|
269
|
+
*/
|
|
270
|
+
attributes: AttributeKey[];
|
|
271
|
+
};
|
|
242
272
|
/**
|
|
243
273
|
* The project's one definition of what it sells: each product once — its kind, plans and prices, its names in each language, the channels it is sold on and what it gives. Read strictly: a field it does not know is refused (400 `invalid_catalog`). What a store's rules allow is not part of the shape: POST /purchases/catalog/validate says it, problem by problem.
|
|
244
274
|
*/
|
|
@@ -473,6 +503,337 @@ export type Channel = {
|
|
|
473
503
|
*/
|
|
474
504
|
tax_code?: string;
|
|
475
505
|
};
|
|
506
|
+
/**
|
|
507
|
+
* A chart, period by period.
|
|
508
|
+
*/
|
|
509
|
+
export type Chart = {
|
|
510
|
+
/**
|
|
511
|
+
* A cohort's: the unit of its ages' values.
|
|
512
|
+
*/
|
|
513
|
+
age_unit?: "currency" | "count" | "ratio";
|
|
514
|
+
/**
|
|
515
|
+
* The chart's key.
|
|
516
|
+
*/
|
|
517
|
+
chart: "revenue" | "mrr" | "mrr_movement" | "arr" | "active_subscriptions" | "active_subscriptions_movement" | "active_trials" | "active_trials_movement" | "new_trials" | "paid_subscriptions" | "churn" | "subscription_status" | "refunds" | "refund_rate" | "non_subscription_purchases" | "new_customers" | "active_customers" | "initial_conversion" | "conversion_to_paying" | "trial_conversion" | "realized_ltv_per_customer" | "realized_ltv_per_paying_customer" | "subscription_retention" | "cohort_explorer";
|
|
518
|
+
/**
|
|
519
|
+
* The cohort explorer's cohorts.
|
|
520
|
+
*/
|
|
521
|
+
cohort?: "new_customers" | "new_paying_customers";
|
|
522
|
+
/**
|
|
523
|
+
* When the chart was computed.
|
|
524
|
+
*/
|
|
525
|
+
computed_at: string;
|
|
526
|
+
/**
|
|
527
|
+
* The currency money is reported in.
|
|
528
|
+
*/
|
|
529
|
+
currency: string;
|
|
530
|
+
/**
|
|
531
|
+
* Whether a value holds an estimate: taxes the store did not state (an App Store or Google Play price's VAT), the stores' commission and Stripe's fee (proceeds), a Google Play offer's period at its plan's recurring price (any revenue type).
|
|
532
|
+
*/
|
|
533
|
+
estimated: boolean;
|
|
534
|
+
/**
|
|
535
|
+
* The values it is filtered to.
|
|
536
|
+
*/
|
|
537
|
+
filters: ChartFilter[];
|
|
538
|
+
/**
|
|
539
|
+
* The first day.
|
|
540
|
+
*/
|
|
541
|
+
from: string;
|
|
542
|
+
/**
|
|
543
|
+
* flow, snapshot, ratio or cohort (ChartDefinition).
|
|
544
|
+
*/
|
|
545
|
+
kind: "flow" | "snapshot" | "ratio" | "cohort";
|
|
546
|
+
/**
|
|
547
|
+
* Its name.
|
|
548
|
+
*/
|
|
549
|
+
name: string;
|
|
550
|
+
/**
|
|
551
|
+
* The periods.
|
|
552
|
+
*/
|
|
553
|
+
resolution: "day" | "week" | "month";
|
|
554
|
+
/**
|
|
555
|
+
* A monetary chart's: what of the money it counts.
|
|
556
|
+
*/
|
|
557
|
+
revenue_type?: "gross" | "net_of_taxes" | "proceeds";
|
|
558
|
+
/**
|
|
559
|
+
* Whether the stores' test purchases count.
|
|
560
|
+
*/
|
|
561
|
+
sandbox: boolean;
|
|
562
|
+
/**
|
|
563
|
+
* The dimension it is split by; absent for none.
|
|
564
|
+
*/
|
|
565
|
+
segment?: "store" | "platform" | "country" | "product" | "plan" | "duration" | "sandbox" | "paywall" | "experiment";
|
|
566
|
+
/**
|
|
567
|
+
* The chart's segments, the biggest first: one, all, when it is not split; else the 20 largest values and, when there are more, `(other)` last, the rest together.
|
|
568
|
+
*/
|
|
569
|
+
segments: ChartSegment[];
|
|
570
|
+
summary: ChartSummary;
|
|
571
|
+
/**
|
|
572
|
+
* The last day, included.
|
|
573
|
+
*/
|
|
574
|
+
to: string;
|
|
575
|
+
/**
|
|
576
|
+
* The currencies of amounts left out: the European Central Bank publishes no rate of them (or none for their day).
|
|
577
|
+
*/
|
|
578
|
+
unconverted: string[];
|
|
579
|
+
/**
|
|
580
|
+
* The unit of its values.
|
|
581
|
+
*/
|
|
582
|
+
unit: "currency" | "count" | "ratio";
|
|
583
|
+
/**
|
|
584
|
+
* The conversion timeframe or customer lifetime; absent for none (to now).
|
|
585
|
+
*/
|
|
586
|
+
window_days?: number;
|
|
587
|
+
};
|
|
588
|
+
/**
|
|
589
|
+
* A cohort's value at an age.
|
|
590
|
+
*/
|
|
591
|
+
export type ChartAge = {
|
|
592
|
+
/**
|
|
593
|
+
* The age: periods of the resolution (renewals, for retention) from the cohort's start.
|
|
594
|
+
*/
|
|
595
|
+
age: number;
|
|
596
|
+
/**
|
|
597
|
+
* The age is not over for every member of the cohort.
|
|
598
|
+
*/
|
|
599
|
+
incomplete?: boolean;
|
|
600
|
+
/**
|
|
601
|
+
* The measures, by key.
|
|
602
|
+
*/
|
|
603
|
+
measures: {
|
|
604
|
+
[key: string]: number;
|
|
605
|
+
};
|
|
606
|
+
/**
|
|
607
|
+
* The value, in the chart's age unit.
|
|
608
|
+
*/
|
|
609
|
+
value: number;
|
|
610
|
+
};
|
|
611
|
+
/**
|
|
612
|
+
* A chart: what it is called and counts.
|
|
613
|
+
*/
|
|
614
|
+
export type ChartDefinition = {
|
|
615
|
+
/**
|
|
616
|
+
* A cohort's: the unit of its ages' values.
|
|
617
|
+
*/
|
|
618
|
+
age_unit?: "currency" | "count" | "ratio";
|
|
619
|
+
/**
|
|
620
|
+
* Its definition: what it counts, over which period, and how refunds, product changes, resubscriptions and test purchases count.
|
|
621
|
+
*/
|
|
622
|
+
description: string;
|
|
623
|
+
/**
|
|
624
|
+
* The chart's key, as GET /purchases/charts/{chart} names it.
|
|
625
|
+
*/
|
|
626
|
+
key: "revenue" | "mrr" | "mrr_movement" | "arr" | "active_subscriptions" | "active_subscriptions_movement" | "active_trials" | "active_trials_movement" | "new_trials" | "paid_subscriptions" | "churn" | "subscription_status" | "refunds" | "refund_rate" | "non_subscription_purchases" | "new_customers" | "active_customers" | "initial_conversion" | "conversion_to_paying" | "trial_conversion" | "realized_ltv_per_customer" | "realized_ltv_per_paying_customer" | "subscription_retention" | "cohort_explorer";
|
|
627
|
+
/**
|
|
628
|
+
* flow (what happened in a period; the summary sums), snapshot (the state at a period's end; the summary is the last), ratio (one measure over another; the summary divides the sums), cohort (what began in a period, over its ages).
|
|
629
|
+
*/
|
|
630
|
+
kind: "flow" | "snapshot" | "ratio" | "cohort";
|
|
631
|
+
/**
|
|
632
|
+
* The measures each point is made of.
|
|
633
|
+
*/
|
|
634
|
+
measures: ChartMeasure[];
|
|
635
|
+
/**
|
|
636
|
+
* Its name.
|
|
637
|
+
*/
|
|
638
|
+
name: string;
|
|
639
|
+
/**
|
|
640
|
+
* Whether it is money, of the revenue type asked for.
|
|
641
|
+
*/
|
|
642
|
+
revenue: boolean;
|
|
643
|
+
/**
|
|
644
|
+
* Whether it is segmented and filtered by the dimensions.
|
|
645
|
+
*/
|
|
646
|
+
segmentable: boolean;
|
|
647
|
+
/**
|
|
648
|
+
* The unit of its values: currency (units of the reporting currency, 12.5 is 12.50), count, ratio (0.25 is a quarter).
|
|
649
|
+
*/
|
|
650
|
+
unit: "currency" | "count" | "ratio";
|
|
651
|
+
/**
|
|
652
|
+
* Whether it takes window_days (a conversion timeframe, a customer lifetime).
|
|
653
|
+
*/
|
|
654
|
+
window: boolean;
|
|
655
|
+
};
|
|
656
|
+
/**
|
|
657
|
+
* What a chart is segmented or filtered by.
|
|
658
|
+
*/
|
|
659
|
+
export type ChartDimension = {
|
|
660
|
+
/**
|
|
661
|
+
* Its values.
|
|
662
|
+
*/
|
|
663
|
+
description: string;
|
|
664
|
+
/**
|
|
665
|
+
* The dimension.
|
|
666
|
+
*/
|
|
667
|
+
key: "store" | "platform" | "country" | "product" | "plan" | "duration" | "sandbox" | "paywall" | "experiment";
|
|
668
|
+
};
|
|
669
|
+
/**
|
|
670
|
+
* A value a dimension is filtered to.
|
|
671
|
+
*/
|
|
672
|
+
export type ChartFilter = {
|
|
673
|
+
/**
|
|
674
|
+
* The dimension.
|
|
675
|
+
*/
|
|
676
|
+
dimension: "store" | "platform" | "country" | "product" | "plan" | "duration" | "sandbox" | "paywall" | "experiment";
|
|
677
|
+
/**
|
|
678
|
+
* The value.
|
|
679
|
+
*/
|
|
680
|
+
value: string;
|
|
681
|
+
};
|
|
682
|
+
/**
|
|
683
|
+
* The charts the module draws, and what they are cut by.
|
|
684
|
+
*/
|
|
685
|
+
export type ChartList = {
|
|
686
|
+
/**
|
|
687
|
+
* Every chart, with its definition.
|
|
688
|
+
*/
|
|
689
|
+
charts: ChartDefinition[];
|
|
690
|
+
/**
|
|
691
|
+
* What a segmentable chart is segmented and filtered by.
|
|
692
|
+
*/
|
|
693
|
+
dimensions: ChartDimension[];
|
|
694
|
+
/**
|
|
695
|
+
* What of the money a monetary chart counts.
|
|
696
|
+
*/
|
|
697
|
+
revenue_types: ("gross" | "net_of_taxes" | "proceeds")[];
|
|
698
|
+
};
|
|
699
|
+
/**
|
|
700
|
+
* One of the numbers a chart's point is made of.
|
|
701
|
+
*/
|
|
702
|
+
export type ChartMeasure = {
|
|
703
|
+
/**
|
|
704
|
+
* What it counts.
|
|
705
|
+
*/
|
|
706
|
+
description: string;
|
|
707
|
+
/**
|
|
708
|
+
* Its key in a point's measures.
|
|
709
|
+
*/
|
|
710
|
+
key: string;
|
|
711
|
+
/**
|
|
712
|
+
* Its unit.
|
|
713
|
+
*/
|
|
714
|
+
unit: "currency" | "count" | "ratio";
|
|
715
|
+
};
|
|
716
|
+
/**
|
|
717
|
+
* A period's value, and the measures it is made of.
|
|
718
|
+
*/
|
|
719
|
+
export type ChartPoint = {
|
|
720
|
+
/**
|
|
721
|
+
* A cohort's ages, from 0.
|
|
722
|
+
*/
|
|
723
|
+
ages?: ChartAge[];
|
|
724
|
+
/**
|
|
725
|
+
* The period (a cohort's window) is not over: the value may still change.
|
|
726
|
+
*/
|
|
727
|
+
incomplete?: boolean;
|
|
728
|
+
/**
|
|
729
|
+
* The measures, by key (ChartDefinition's measures).
|
|
730
|
+
*/
|
|
731
|
+
measures: {
|
|
732
|
+
[key: string]: number;
|
|
733
|
+
};
|
|
734
|
+
/**
|
|
735
|
+
* The period's first day (a Monday for a week, the 1st for a month).
|
|
736
|
+
*/
|
|
737
|
+
period: string;
|
|
738
|
+
/**
|
|
739
|
+
* The chart's value, in its unit.
|
|
740
|
+
*/
|
|
741
|
+
value: number;
|
|
742
|
+
};
|
|
743
|
+
/**
|
|
744
|
+
* A value of the dimension a chart is split by (all, when it is not).
|
|
745
|
+
*/
|
|
746
|
+
export type ChartSegment = {
|
|
747
|
+
/**
|
|
748
|
+
* The value (a store, a country, a product's key …); all for the whole; `(other)` for the values past the 20 largest, together.
|
|
749
|
+
*/
|
|
750
|
+
key: string;
|
|
751
|
+
/**
|
|
752
|
+
* What the value is called (a product's name, a paywall's), when it has a name.
|
|
753
|
+
*/
|
|
754
|
+
label?: string;
|
|
755
|
+
/**
|
|
756
|
+
* Its value in each period, in order.
|
|
757
|
+
*/
|
|
758
|
+
points: ChartPoint[];
|
|
759
|
+
summary: ChartSummary;
|
|
760
|
+
};
|
|
761
|
+
/**
|
|
762
|
+
* The chart over its whole range: a flow's and a ratio's measures summed (and divided), a snapshot's last period's, a cohort's sizes summed and its ages over the cohorts that completed them.
|
|
763
|
+
*/
|
|
764
|
+
export type ChartSummary = {
|
|
765
|
+
/**
|
|
766
|
+
* A cohort's ages over every cohort that completed them.
|
|
767
|
+
*/
|
|
768
|
+
ages?: ChartAge[];
|
|
769
|
+
/**
|
|
770
|
+
* The measures over the range.
|
|
771
|
+
*/
|
|
772
|
+
measures: {
|
|
773
|
+
[key: string]: number;
|
|
774
|
+
};
|
|
775
|
+
/**
|
|
776
|
+
* The value over the range.
|
|
777
|
+
*/
|
|
778
|
+
value: number;
|
|
779
|
+
};
|
|
780
|
+
/**
|
|
781
|
+
* The project's figures of now and of its last 28 days.
|
|
782
|
+
*/
|
|
783
|
+
export type ChartsOverview = {
|
|
784
|
+
/**
|
|
785
|
+
* Customers seen in the 28 days.
|
|
786
|
+
*/
|
|
787
|
+
active_customers_last_28_days: number;
|
|
788
|
+
/**
|
|
789
|
+
* Paid subscriptions in force now.
|
|
790
|
+
*/
|
|
791
|
+
active_subscriptions: number;
|
|
792
|
+
/**
|
|
793
|
+
* Free trials in force now.
|
|
794
|
+
*/
|
|
795
|
+
active_trials: number;
|
|
796
|
+
/**
|
|
797
|
+
* When it was computed.
|
|
798
|
+
*/
|
|
799
|
+
computed_at: string;
|
|
800
|
+
/**
|
|
801
|
+
* The currency money is reported in.
|
|
802
|
+
*/
|
|
803
|
+
currency: string;
|
|
804
|
+
/**
|
|
805
|
+
* Whether a figure holds an estimate (taxes, commission, a Google Play offer's period).
|
|
806
|
+
*/
|
|
807
|
+
estimated: boolean;
|
|
808
|
+
/**
|
|
809
|
+
* MRR now.
|
|
810
|
+
*/
|
|
811
|
+
mrr: number;
|
|
812
|
+
/**
|
|
813
|
+
* Customers first counted in the 28 days.
|
|
814
|
+
*/
|
|
815
|
+
new_customers_last_28_days: number;
|
|
816
|
+
/**
|
|
817
|
+
* Revenue over the 28 days, refunds taken off.
|
|
818
|
+
*/
|
|
819
|
+
revenue_last_28_days: number;
|
|
820
|
+
/**
|
|
821
|
+
* What of the money revenue counts.
|
|
822
|
+
*/
|
|
823
|
+
revenue_type: "gross" | "net_of_taxes" | "proceeds";
|
|
824
|
+
/**
|
|
825
|
+
* Whether the stores' test purchases count.
|
|
826
|
+
*/
|
|
827
|
+
sandbox: boolean;
|
|
828
|
+
/**
|
|
829
|
+
* The first of the 28 days.
|
|
830
|
+
*/
|
|
831
|
+
since: string;
|
|
832
|
+
/**
|
|
833
|
+
* The currencies of amounts left out: the European Central Bank publishes no rate of them.
|
|
834
|
+
*/
|
|
835
|
+
unconverted: string[];
|
|
836
|
+
};
|
|
476
837
|
/**
|
|
477
838
|
* A Stripe Checkout session to send the customer to.
|
|
478
839
|
*/
|
|
@@ -3266,6 +3627,39 @@ export type PlacementRequest = {
|
|
|
3266
3627
|
*/
|
|
3267
3628
|
paywall_id: string;
|
|
3268
3629
|
};
|
|
3630
|
+
/**
|
|
3631
|
+
* What a placement's viewers did, by where what they were shown came from.
|
|
3632
|
+
*/
|
|
3633
|
+
export type PlacementResults = {
|
|
3634
|
+
/**
|
|
3635
|
+
* When the numbers were counted.
|
|
3636
|
+
*/
|
|
3637
|
+
computed_at: string;
|
|
3638
|
+
/**
|
|
3639
|
+
* The days of exposures the results look back over.
|
|
3640
|
+
*/
|
|
3641
|
+
days: number;
|
|
3642
|
+
/**
|
|
3643
|
+
* The placement.
|
|
3644
|
+
*/
|
|
3645
|
+
placement: string;
|
|
3646
|
+
/**
|
|
3647
|
+
* Whether the stores' test purchases count.
|
|
3648
|
+
*/
|
|
3649
|
+
sandbox: boolean;
|
|
3650
|
+
/**
|
|
3651
|
+
* Where the results look back to: exposures from then on are counted.
|
|
3652
|
+
*/
|
|
3653
|
+
since: string;
|
|
3654
|
+
/**
|
|
3655
|
+
* Each source: the placement's rules in their order, then the rules it no longer has, the experiments' variants and the default, the newest shown first.
|
|
3656
|
+
*/
|
|
3657
|
+
sources: PlacementSource[];
|
|
3658
|
+
/**
|
|
3659
|
+
* The days after first seeing what a source showed a purchase counts for it.
|
|
3660
|
+
*/
|
|
3661
|
+
window_days: number;
|
|
3662
|
+
};
|
|
3269
3663
|
/**
|
|
3270
3664
|
* One of a placement's rules: when all its conditions hold for a viewer — none holds for everyone —, it shows its target.
|
|
3271
3665
|
*/
|
|
@@ -3320,6 +3714,63 @@ export type PlacementRules = {
|
|
|
3320
3714
|
export type PlacementRulesRequest = {
|
|
3321
3715
|
rules: PlacementRule[];
|
|
3322
3716
|
};
|
|
3717
|
+
/**
|
|
3718
|
+
* One source's numbers: what showed a paywall at the placement — a rule, a variant of the experiment running for everyone there, the default — and the paywall.
|
|
3719
|
+
*/
|
|
3720
|
+
export type PlacementSource = {
|
|
3721
|
+
/**
|
|
3722
|
+
* converters over viewers. A viewer never signed in cannot be followed to a purchase: the rate is a lower bound.
|
|
3723
|
+
*/
|
|
3724
|
+
conversion_rate: number;
|
|
3725
|
+
/**
|
|
3726
|
+
* How many of its viewers made one.
|
|
3727
|
+
*/
|
|
3728
|
+
converters: number;
|
|
3729
|
+
/**
|
|
3730
|
+
* The experiment whose variant it showed: the one its rule sent viewers to (kind rule), or the one running for everyone there (kind experiment).
|
|
3731
|
+
*/
|
|
3732
|
+
experiment_id?: string;
|
|
3733
|
+
/**
|
|
3734
|
+
* How many times it was shown (a subject once in ten minutes).
|
|
3735
|
+
*/
|
|
3736
|
+
exposures: number;
|
|
3737
|
+
/**
|
|
3738
|
+
* Where what was shown came from: a rule, the experiment running for everyone at the placement, its default.
|
|
3739
|
+
*/
|
|
3740
|
+
kind: "rule" | "experiment" | "default";
|
|
3741
|
+
/**
|
|
3742
|
+
* The paywall shown.
|
|
3743
|
+
*/
|
|
3744
|
+
paywall_id: string;
|
|
3745
|
+
/**
|
|
3746
|
+
* The purchases the stores confirmed (a subscription's start, a one-time product) that its viewers made within the window after first seeing it — each counted once, for what its buyer saw first at the placement.
|
|
3747
|
+
*/
|
|
3748
|
+
purchases: number;
|
|
3749
|
+
/**
|
|
3750
|
+
* What its purchases were paid to date, renewals included, net of refunds, by currency.
|
|
3751
|
+
*/
|
|
3752
|
+
revenue: Revenue[];
|
|
3753
|
+
/**
|
|
3754
|
+
* Whether the rule is one of the placement's rules now; false for a rule since removed, the experiment and the default.
|
|
3755
|
+
*/
|
|
3756
|
+
rule_current: boolean;
|
|
3757
|
+
/**
|
|
3758
|
+
* The rule that showed it (kind rule).
|
|
3759
|
+
*/
|
|
3760
|
+
rule_id?: string;
|
|
3761
|
+
/**
|
|
3762
|
+
* The rule's name, while the placement has it.
|
|
3763
|
+
*/
|
|
3764
|
+
rule_name?: string;
|
|
3765
|
+
/**
|
|
3766
|
+
* The experiment's variant it showed.
|
|
3767
|
+
*/
|
|
3768
|
+
variant?: string;
|
|
3769
|
+
/**
|
|
3770
|
+
* How many subjects saw it: users, guests, and installations no one had signed in on.
|
|
3771
|
+
*/
|
|
3772
|
+
viewers: number;
|
|
3773
|
+
};
|
|
3323
3774
|
/**
|
|
3324
3775
|
* The project's placements (at most 200), by key.
|
|
3325
3776
|
*/
|
|
@@ -3996,13 +4447,17 @@ export type SaveCatalogError = {
|
|
|
3996
4447
|
status: number;
|
|
3997
4448
|
};
|
|
3998
4449
|
/**
|
|
3999
|
-
* The project's choices for its customers' purchases; the defaults (everyone, cancel on delete, UTC) until it makes its own.
|
|
4450
|
+
* The project's choices for its customers' purchases and for its charts; the defaults (everyone, cancel on delete, UTC, USD, standard commission, Stripe's 2.9% + 0.30 USD) until it makes its own.
|
|
4000
4451
|
*/
|
|
4001
4452
|
export type Settings = {
|
|
4002
4453
|
/**
|
|
4003
4454
|
* Whether a deleted user's renewing web (Stripe) subscriptions stop renewing; they keep the period they paid. Only the customer can cancel what they bought in the App Store or Google Play.
|
|
4004
4455
|
*/
|
|
4005
4456
|
cancel_on_delete: boolean;
|
|
4457
|
+
/**
|
|
4458
|
+
* The currency the charts report money in: every amount converted at the European Central Bank's reference rate of the day it was paid (USD unless set). One the Bank published a rate of in the last ten days. The ledger keeps what was paid as it was paid: changing it changes every chart from its first day.
|
|
4459
|
+
*/
|
|
4460
|
+
reporting_currency: string;
|
|
4006
4461
|
/**
|
|
4007
4462
|
* Whether a store's test purchases — Apple's sandbox (where App Review and TestFlight buy), Google Play's license testers, Stripe's test mode — open entitlements here: everyone, only the customers on sandbox_allowlist, or nobody.
|
|
4008
4463
|
*/
|
|
@@ -4011,6 +4466,22 @@ export type Settings = {
|
|
|
4011
4466
|
* The customers whose test purchases open entitlements when sandbox_access is allowlist.
|
|
4012
4467
|
*/
|
|
4013
4468
|
sandbox_allowlist: string[];
|
|
4469
|
+
/**
|
|
4470
|
+
* The share the App Store and Google Play keep, which the charts' proceeds take off: standard (30%; 15% of a subscription's renewals after its first paid year in the App Store, and of every subscription on Google Play) or small_business (15%: the App Store Small Business Program, Google Play's first million). standard unless set.
|
|
4471
|
+
*/
|
|
4472
|
+
store_commission: "standard" | "small_business";
|
|
4473
|
+
/**
|
|
4474
|
+
* Stripe's fee of a payment, which the ledger does not hold, as the charts' proceeds take it off: its share in basis points (290 is 2.9%, unless set), up to 2000.
|
|
4475
|
+
*/
|
|
4476
|
+
stripe_fee_bps: number;
|
|
4477
|
+
/**
|
|
4478
|
+
* The currency of Stripe's fixed fee (USD unless set): one the European Central Bank published a rate of in the last ten days.
|
|
4479
|
+
*/
|
|
4480
|
+
stripe_fee_fixed_currency: string;
|
|
4481
|
+
/**
|
|
4482
|
+
* And its fixed part, in micro-units of stripe_fee_fixed_currency (300000 is 0.30, unless set).
|
|
4483
|
+
*/
|
|
4484
|
+
stripe_fee_fixed_micros: number;
|
|
4014
4485
|
/**
|
|
4015
4486
|
* Where the quotas' calendar windows (a day, a month) begin: an IANA name such as Europe/Istanbul.
|
|
4016
4487
|
*/
|
|
@@ -4028,6 +4499,10 @@ export type SettingsUpdate = {
|
|
|
4028
4499
|
* Whether a deleted user's renewing web (Stripe) subscriptions stop renewing; they keep the period they paid. Only the customer can cancel what they bought in the App Store or Google Play.
|
|
4029
4500
|
*/
|
|
4030
4501
|
cancel_on_delete?: boolean;
|
|
4502
|
+
/**
|
|
4503
|
+
* The currency the charts report money in: every amount converted at the European Central Bank's reference rate of the day it was paid (USD unless set). One the Bank published a rate of in the last ten days. The ledger keeps what was paid as it was paid: changing it changes every chart from its first day.
|
|
4504
|
+
*/
|
|
4505
|
+
reporting_currency?: string;
|
|
4031
4506
|
/**
|
|
4032
4507
|
* Whether a store's test purchases — Apple's sandbox (where App Review and TestFlight buy), Google Play's license testers, Stripe's test mode — open entitlements here: everyone, only the customers on sandbox_allowlist, or nobody.
|
|
4033
4508
|
*/
|
|
@@ -4036,6 +4511,22 @@ export type SettingsUpdate = {
|
|
|
4036
4511
|
* The customers whose test purchases open entitlements when sandbox_access is allowlist.
|
|
4037
4512
|
*/
|
|
4038
4513
|
sandbox_allowlist?: string[];
|
|
4514
|
+
/**
|
|
4515
|
+
* The share the App Store and Google Play keep, which the charts' proceeds take off: standard (30%; 15% of a subscription's renewals after its first paid year in the App Store, and of every subscription on Google Play) or small_business (15%: the App Store Small Business Program, Google Play's first million). standard unless set.
|
|
4516
|
+
*/
|
|
4517
|
+
store_commission?: "standard" | "small_business";
|
|
4518
|
+
/**
|
|
4519
|
+
* Stripe's fee of a payment, which the ledger does not hold, as the charts' proceeds take it off: its share in basis points (290 is 2.9%, unless set), up to 2000.
|
|
4520
|
+
*/
|
|
4521
|
+
stripe_fee_bps?: number;
|
|
4522
|
+
/**
|
|
4523
|
+
* The currency of Stripe's fixed fee (USD unless set): one the European Central Bank published a rate of in the last ten days.
|
|
4524
|
+
*/
|
|
4525
|
+
stripe_fee_fixed_currency?: string;
|
|
4526
|
+
/**
|
|
4527
|
+
* And its fixed part, in micro-units of stripe_fee_fixed_currency (300000 is 0.30, unless set).
|
|
4528
|
+
*/
|
|
4529
|
+
stripe_fee_fixed_micros?: number;
|
|
4039
4530
|
/**
|
|
4040
4531
|
* Where the quotas' calendar windows (a day, a month) begin: an IANA name such as Europe/Istanbul.
|
|
4041
4532
|
*/
|
|
@@ -4736,6 +5227,50 @@ export declare function client(t: Transport): {
|
|
|
4736
5227
|
body: Catalog; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
4737
5228
|
signal?: AbortSignal;
|
|
4738
5229
|
}): Promise<Reply<200, CatalogValidation>>;
|
|
5230
|
+
/**
|
|
5231
|
+
* List the charts
|
|
5232
|
+
*
|
|
5233
|
+
* Every chart the module draws from the project's ledger — RevenueCat's charts: revenue, MRR and its movement, ARR, active subscriptions and trials and their movements, new trials, paid subscriptions, churn, subscription status, refunds and the refund rate, non-subscription purchases, new and active customers, initial conversion, conversion to paying, trial conversion, realized LTV per customer and per paying customer, subscription retention, the cohort explorer — each with its definition (what it counts, over which period, and how refunds, product changes, resubscriptions and test purchases count), the unit of its values and the measures its points are made of; the dimensions charts are segmented and filtered by; the revenue types.
|
|
5234
|
+
*/
|
|
5235
|
+
listCharts(input?: {
|
|
5236
|
+
signal?: AbortSignal;
|
|
5237
|
+
}): Promise<Reply<200, ChartList>>;
|
|
5238
|
+
/**
|
|
5239
|
+
* Read the charts' overview
|
|
5240
|
+
*
|
|
5241
|
+
* The project's figures at a glance: MRR, active subscriptions and active trials now; revenue (of revenue_type), new customers and active customers over the last 28 days, today included — each as its chart counts it. Money is in the reporting currency (or currency); an amount in a currency the European Central Bank does not publish is left out and named (unconverted). A replica computes two charts (the overview among them) at once and one of a project; another is refused at once as busy (503 `charts_busy`, Retry-After), and so is one that takes longer than 15 seconds. The same request within a minute is answered from the replica's cache (a change of the project's settings drops it there). A replica computes 3 charts of a project in a row, then one each 10 seconds (6 a minute); past that a chart is refused (429 `too_many_charts`, Retry-After) — an answer from the cache is not counted.
|
|
5242
|
+
*/
|
|
5243
|
+
getChartsOverview(input?: {
|
|
5244
|
+
query?: {
|
|
5245
|
+
sandbox?: boolean; /** What of the money a monetary chart counts: gross (what customers paid), net_of_taxes, or proceeds (net of taxes and the store's commission); gross unless said. What the ledger does not state is estimated, and the answer says so (estimated). */
|
|
5246
|
+
revenue_type?: "gross" | "net_of_taxes" | "proceeds"; /** The currency to report money in, for this answer: one the European Central Bank publishes a reference rate for. The project's reporting currency (settings) unless said. */
|
|
5247
|
+
currency?: string;
|
|
5248
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
5249
|
+
signal?: AbortSignal;
|
|
5250
|
+
}): Promise<Reply<200, ChartsOverview>>;
|
|
5251
|
+
/**
|
|
5252
|
+
* Read a chart
|
|
5253
|
+
*
|
|
5254
|
+
* One chart of the project's ledger, period by period (GET /purchases/charts says what each counts). Periods are UTC days, ISO weeks (Monday to Sunday) or calendar months, the first and the last cut to `from` and `to` (both included, at most two years apart; `to` later than today is today). A flow counts what happened in the period, a snapshot is the state at its end (now, for the period now is in), a ratio divides its measures, a cohort follows what began in the period over its ages. The ledger is read whole each time: a refund arriving later, a renewal, a product change, a guest merged into an account and a change of the settings are in the next answer. Money is converted to the reporting currency (or `currency`) at the European Central Bank's reference rate of the day it was paid; what is in a currency it does not publish is left out and named (`unconverted`). A store's test purchases count only with sandbox=true. `segment` splits a segmentable chart by a dimension: the 20 largest values each a segment, the rest together in one keyed `(other)` (the segments' sum is the whole; a subscription changing segment is churned in one and moved in to the other); `filter` (repeated, one dimension:value each) keeps what has one of the values given for each dimension named. The paywall and experiment dimensions attribute a subscription whose first purchase is in the days asked for (by the exposures of those days and the 7 before); an older one is `none`. A cohort chart follows at most 120 cohorts (by day, 120 days). Answered as CSV when the request accepts text/csv first: a row a segment and period (and age, for a cohort), its value, its measures. The ledger is read customer by customer, never held whole. A customer holding more than 20,000 transactions is refused (422 `chart_too_large`). The same request within a minute is answered from the replica's cache (a change of the project's settings drops it there). A replica computes two charts at once and one of a project; another is refused at once as busy (503 `charts_busy`, Retry-After), and so is one whose reading and computing take longer than 15 seconds. A replica computes 3 charts of a project in a row, then one each 10 seconds (6 a minute); past that a chart is refused (429 `too_many_charts`, Retry-After) — an answer from the cache is not counted.
|
|
5255
|
+
*/
|
|
5256
|
+
getChart(input: {
|
|
5257
|
+
path: {
|
|
5258
|
+
chart: "revenue" | "mrr" | "mrr_movement" | "arr" | "active_subscriptions" | "active_subscriptions_movement" | "active_trials" | "active_trials_movement" | "new_trials" | "paid_subscriptions" | "churn" | "subscription_status" | "refunds" | "refund_rate" | "non_subscription_purchases" | "new_customers" | "active_customers" | "initial_conversion" | "conversion_to_paying" | "trial_conversion" | "realized_ltv_per_customer" | "realized_ltv_per_paying_customer" | "subscription_retention" | "cohort_explorer";
|
|
5259
|
+
};
|
|
5260
|
+
query?: {
|
|
5261
|
+
from?: string; /** The last day, YYYY-MM-DD, included: today unless said (a later day is today). */
|
|
5262
|
+
to?: string; /** The periods: day, week (ISO, Monday to Sunday) or month; day unless said. */
|
|
5263
|
+
resolution?: "day" | "week" | "month"; /** Count the stores' test purchases too (Apple's sandbox, Stripe's test mode); segment or filter by sandbox to tell them apart. */
|
|
5264
|
+
sandbox?: boolean; /** Split the chart by a dimension (a segmentable chart's). */
|
|
5265
|
+
segment?: "store" | "platform" | "country" | "product" | "plan" | "duration" | "sandbox" | "paywall" | "experiment"; /** Keep what has, for each dimension named, one of the values given: one dimension:value a parameter, repeated for more (filter=store:apple&filter=country:TR&filter=country:DE), at most 20; the value is everything after the first colon (commas and colons are the value's). A segmentable chart's. */
|
|
5266
|
+
filter?: string[]; /** The currency to report money in, for this answer: one the European Central Bank publishes a reference rate for. The project's reporting currency (settings) unless said. */
|
|
5267
|
+
currency?: string; /** What of the money a monetary chart counts: gross (what customers paid), net_of_taxes, or proceeds (net of taxes and the store's commission); gross unless said. What the ledger does not state is estimated, and the answer says so (estimated). */
|
|
5268
|
+
revenue_type?: "gross" | "net_of_taxes" | "proceeds"; /** The conversion charts' conversion timeframe and the lifetime charts' customer lifetime, in days from a customer's first day (0: that day); to now unless said. */
|
|
5269
|
+
window_days?: number; /** The cohort explorer's cohorts: new_customers (by their first day; unless said) or new_paying_customers (by their first payment). */
|
|
5270
|
+
cohort?: "new_customers" | "new_paying_customers";
|
|
5271
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
5272
|
+
signal?: AbortSignal;
|
|
5273
|
+
}): Promise<Reply<200, Chart>>;
|
|
4739
5274
|
/**
|
|
4740
5275
|
* The connect page
|
|
4741
5276
|
*
|
|
@@ -5277,6 +5812,14 @@ export declare function client(t: Transport): {
|
|
|
5277
5812
|
listPlacements(input?: {
|
|
5278
5813
|
signal?: AbortSignal;
|
|
5279
5814
|
}): Promise<Reply<200, Placements>>;
|
|
5815
|
+
/**
|
|
5816
|
+
* List the attribute keys apps send
|
|
5817
|
+
*
|
|
5818
|
+
* The attribute keys the project's apps sent with a placement's paywall (X-Palbase-Attributes), as the apps said them: a suggestion for writing `attribute` conditions, not a list of what an app defines. They are unverified — any holder of the project's publishable key can send a key. Each key with the JSON type it was last sent as (a string that reads as a number is a string), the hours it was seen in, and when it was last seen; the values are never kept. The most used come first: by `seen_hours`, then the newest seen. A key is seen again at most once an hour (`last_seen_at` is the hour's, `seen_hours` rises at most once an hour). A project keeps at most 200 keys; past them a new key takes the place of the key seen longest ago when that one was last seen over 24 hours ago, else it is not kept — keys sent once age out, the keys apps go on sending stay.
|
|
5819
|
+
*/
|
|
5820
|
+
listAttributeKeys(input?: {
|
|
5821
|
+
signal?: AbortSignal;
|
|
5822
|
+
}): Promise<Reply<200, AttributeKeys>>;
|
|
5280
5823
|
/**
|
|
5281
5824
|
* Give a placement a paywall
|
|
5282
5825
|
*
|
|
@@ -5341,7 +5884,7 @@ export declare function client(t: Transport): {
|
|
|
5341
5884
|
"X-Palbase-Client-Version"?: string; /** The registered app's id: app rules read it. */
|
|
5342
5885
|
"X-Palbase-App"?: string; /** The SDK's name and version, name/version (palbase-swift/1.4.0): sdk_version rules read it. */
|
|
5343
5886
|
"X-Palbase-SDK"?: string; /** The store's country — StoreKit's Storefront.countryCode, Play's billing country —, ISO 3166-1 alpha-2 or alpha-3: country rules read it, the request's address's country when absent. */
|
|
5344
|
-
"X-Palbase-Storefront"?: string; /** What the app says of the viewer, for attribute rules (targeting only): a JSON object of at most 20 keys (a letter, then letters, digits and _ . -, at most 40), values strings (at most 256), numbers or booleans; at most 2 KiB, non-ASCII escaped (\uXXXX). */
|
|
5887
|
+
"X-Palbase-Storefront"?: string; /** What the app says of the viewer, for attribute rules (targeting only): a JSON object of at most 20 keys (a letter, then letters, digits and _ . -, at most 40), values strings (at most 256), numbers or booleans; at most 2 KiB, non-ASCII escaped (\uXXXX). Its keys, and their types, are kept as the app said them to suggest in the rules' editor (GET /purchases/placements/attributes); its values never are. */
|
|
5345
5888
|
"X-Palbase-Attributes"?: string; /** The app's languages: locale rules read the first. */
|
|
5346
5889
|
"Accept-Language"?: string;
|
|
5347
5890
|
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
@@ -5362,6 +5905,22 @@ export declare function client(t: Transport): {
|
|
|
5362
5905
|
body: PreviewRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
5363
5906
|
signal?: AbortSignal;
|
|
5364
5907
|
}): Promise<Reply<200, PlacementPreview>>;
|
|
5908
|
+
/**
|
|
5909
|
+
* Read a placement's results by rule
|
|
5910
|
+
*
|
|
5911
|
+
* What a placement's viewers did over its last `days` (30 unless said, at most 90), by where what they were shown came from: each rule — with the variant of the experiment it sent them to —, each variant of the experiment running for everyone there, the default; one source for each rule, variant and paywall the placement's exposures name. Each counts as an experiment's variants are counted: exposures and viewers (distinct subjects); the purchases the stores confirmed that its viewers made within `window_days` (7 unless said) after first seeing it — the ledger's, never what an app reports —, each counted once, for what its buyer saw first at the placement; how many viewers made one; the conversion rate; what was paid for them to date, net of refunds, by currency. The placement's rules come first, in their order and named; then the rules it no longer has (`rule_current` false, unnamed), the experiments' variants and the default, the newest shown first. A store's test purchases count only with sandbox=true (a development environment's are all test purchases). Counting that takes longer than 15 seconds is refused as busy (503 `results_busy`, Retry-After) rather than left running.
|
|
5912
|
+
*/
|
|
5913
|
+
getPlacementResults(input: {
|
|
5914
|
+
path: {
|
|
5915
|
+
placement: string;
|
|
5916
|
+
};
|
|
5917
|
+
query?: {
|
|
5918
|
+
days?: number; /** The days after first seeing what a source showed a purchase counts for it (7 unless said). */
|
|
5919
|
+
window_days?: number; /** Count the stores' test purchases too. */
|
|
5920
|
+
sandbox?: boolean;
|
|
5921
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
5922
|
+
signal?: AbortSignal;
|
|
5923
|
+
}): Promise<Reply<200, PlacementResults>>;
|
|
5365
5924
|
/**
|
|
5366
5925
|
* Read a placement's rules
|
|
5367
5926
|
*
|
|
@@ -5400,7 +5959,7 @@ export declare function client(t: Transport): {
|
|
|
5400
5959
|
/**
|
|
5401
5960
|
* Change the settings
|
|
5402
5961
|
*
|
|
5403
|
-
* Changes the settings given — whether a store's test purchases open entitlements, ending a deleted user's renewing web subscriptions, where the quotas' calendar windows begin — and leaves the others as they are.
|
|
5962
|
+
* Changes the settings given — whether a store's test purchases open entitlements, ending a deleted user's renewing web subscriptions, where the quotas' calendar windows begin, the charts' reporting currency, store commission and Stripe fee — and leaves the others as they are.
|
|
5404
5963
|
*/
|
|
5405
5964
|
updateSettings(input: {
|
|
5406
5965
|
headers?: {
|