primitive-functions 0.3.0-alpha.12 → 0.3.0-alpha.13

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 +46 -2
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -579,7 +579,9 @@ export interface FunctionApi {
579
579
  "cohortRetention"(args?: {
580
580
  "current_timestamp"?: string | number | boolean;
581
581
  "_bust"?: string | number | boolean;
582
+ "testUsers"?: string | number | boolean;
582
583
  }): Promise<{
584
+ testUsers: "include" | "exclude" | "only";
583
585
  weeks: number[];
584
586
  rows: {
585
587
  signup_week: number;
@@ -598,7 +600,9 @@ export interface FunctionApi {
598
600
  "windowDays"?: string | number | boolean;
599
601
  "current_timestamp"?: string | number | boolean;
600
602
  "_bust"?: string | number | boolean;
603
+ "testUsers"?: string | number | boolean;
601
604
  }): Promise<{
605
+ testUsers: "include" | "exclude" | "only";
602
606
  window_days: number;
603
607
  rows: {
604
608
  day_ts: number;
@@ -672,8 +676,10 @@ export interface FunctionApi {
672
676
  "page"?: string | number | boolean;
673
677
  "current_timestamp"?: string | number | boolean;
674
678
  "_bust"?: string | number | boolean;
679
+ "testUsers"?: string | number | boolean;
675
680
  "filter"?: Record<string, Record<string, string | number | boolean | Array<string | number | boolean>>>;
676
681
  }): Promise<{
682
+ testUsers: "include" | "exclude" | "only";
677
683
  page: number;
678
684
  page_size: number;
679
685
  total_rows: number;
@@ -716,8 +722,10 @@ export interface FunctionApi {
716
722
  "groupBy"?: string | number | boolean;
717
723
  "current_timestamp"?: string | number | boolean;
718
724
  "_bust"?: string | number | boolean;
725
+ "testUsers"?: string | number | boolean;
719
726
  "filter"?: Record<string, Record<string, string | number | boolean | Array<string | number | boolean>>>;
720
727
  }): Promise<{
728
+ testUsers: "include" | "exclude" | "only";
721
729
  group_by: string;
722
730
  rows: {
723
731
  group_value: string;
@@ -734,7 +742,9 @@ export interface FunctionApi {
734
742
  "overviewDau"(args?: {
735
743
  "current_timestamp"?: string | number | boolean;
736
744
  "_bust"?: string | number | boolean;
745
+ "testUsers"?: string | number | boolean;
737
746
  }): Promise<{
747
+ testUsers: "include" | "exclude" | "only";
738
748
  value: number;
739
749
  previous: number;
740
750
  deltaPct?: number | null;
@@ -748,7 +758,9 @@ export interface FunctionApi {
748
758
  "windowDays"?: string | number | boolean;
749
759
  "current_timestamp"?: string | number | boolean;
750
760
  "_bust"?: string | number | boolean;
761
+ "testUsers"?: string | number | boolean;
751
762
  }): Promise<{
763
+ testUsers: "include" | "exclude" | "only";
752
764
  window_days: number;
753
765
  retained_users: number;
754
766
  new_users: number;
@@ -766,7 +778,9 @@ export interface FunctionApi {
766
778
  "overviewMau"(args?: {
767
779
  "current_timestamp"?: string | number | boolean;
768
780
  "_bust"?: string | number | boolean;
781
+ "testUsers"?: string | number | boolean;
769
782
  }): Promise<{
783
+ testUsers: "include" | "exclude" | "only";
770
784
  value: number;
771
785
  previous: number;
772
786
  deltaPct?: number | null;
@@ -779,7 +793,9 @@ export interface FunctionApi {
779
793
  "overviewWau"(args?: {
780
794
  "current_timestamp"?: string | number | boolean;
781
795
  "_bust"?: string | number | boolean;
796
+ "testUsers"?: string | number | boolean;
782
797
  }): Promise<{
798
+ testUsers: "include" | "exclude" | "only";
783
799
  value: number;
784
800
  previous: number;
785
801
  deltaPct?: number | null;
@@ -793,7 +809,9 @@ export interface FunctionApi {
793
809
  "windowDays"?: string | number | boolean;
794
810
  "current_timestamp"?: string | number | boolean;
795
811
  "_bust"?: string | number | boolean;
812
+ "testUsers"?: string | number | boolean;
796
813
  }): Promise<{
814
+ testUsers: "include" | "exclude" | "only";
797
815
  window_days: number;
798
816
  rows: {
799
817
  day_ts: number;
@@ -815,7 +833,9 @@ export interface FunctionApi {
815
833
  "offset"?: string | number | boolean;
816
834
  "current_timestamp"?: string | number | boolean;
817
835
  "_bust"?: string | number | boolean;
836
+ "testUsers"?: string | number | boolean;
818
837
  }): Promise<{
838
+ testUsers: "include" | "exclude" | "only";
819
839
  query: string;
820
840
  limit: number;
821
841
  offset: number;
@@ -875,7 +895,9 @@ export interface FunctionApi {
875
895
  "limit"?: string | number | boolean;
876
896
  "current_timestamp"?: string | number | boolean;
877
897
  "_bust"?: string | number | boolean;
898
+ "testUsers"?: string | number | boolean;
878
899
  }): Promise<{
900
+ testUsers: "include" | "exclude" | "only";
879
901
  windowDays: number;
880
902
  limit: number;
881
903
  results: {
@@ -3422,13 +3444,15 @@ export interface FunctionApi {
3422
3444
  "db3Id": string | number;
3423
3445
  }): Promise<{
3424
3446
  indexes: {
3425
- /** The index's name: `idx_records_<model>_<field>` for a field's shared index, `idx_uc_<model>_<constraint>` for a declared compound constraint's, `idx_named_<model>_<name>` for one registered with a name; a `_<n>` suffix when two models' names would collide. */
3447
+ /** The index's name: `idx_records_<model>_<field>` for a field's shared index, `idx_uc_<model>_<constraint>` for a declared compound constraint's, `idx_named_<model>_<name>` for one registered with a name, `idx_members_<model>_<field>` for a string-set field's member index; a `_<n>` suffix when two models' names would collide. */
3426
3448
  name: string;
3427
3449
  model: string;
3428
3450
  /** The fields, in index order. */
3429
3451
  fields: string[];
3430
3452
  /** Whether a write that would give two live records the same key is refused (a null or absent value is never part of a key). */
3431
3453
  unique: boolean;
3454
+ /** `true` for a string-set field's member index, which serves `$contains`, any-of, membership levels and unfiltered facets on the field. Absent on any other index. */
3455
+ members?: boolean;
3432
3456
  /** Why the index exists: a declaration that marks the fields `indexed` or `unique` (or a compound constraint), and a registration through these routes. The index is dropped when the last origin goes. */
3433
3457
  origins: {
3434
3458
  kind: "declaration" | "named";
@@ -3445,16 +3469,20 @@ export interface FunctionApi {
3445
3469
  fields?: string[];
3446
3470
  unique?: boolean;
3447
3471
  name?: string;
3472
+ /** `true` registers a member index on `field`, a string-set field: it takes no `fields`, `unique` or `name`. */
3473
+ members?: boolean;
3448
3474
  };
3449
3475
  }): Promise<{
3450
3476
  index: {
3451
- /** The index's name: `idx_records_<model>_<field>` for a field's shared index, `idx_uc_<model>_<constraint>` for a declared compound constraint's, `idx_named_<model>_<name>` for one registered with a name; a `_<n>` suffix when two models' names would collide. */
3477
+ /** The index's name: `idx_records_<model>_<field>` for a field's shared index, `idx_uc_<model>_<constraint>` for a declared compound constraint's, `idx_named_<model>_<name>` for one registered with a name, `idx_members_<model>_<field>` for a string-set field's member index; a `_<n>` suffix when two models' names would collide. */
3452
3478
  name: string;
3453
3479
  model: string;
3454
3480
  /** The fields, in index order. */
3455
3481
  fields: string[];
3456
3482
  /** Whether a write that would give two live records the same key is refused (a null or absent value is never part of a key). */
3457
3483
  unique: boolean;
3484
+ /** `true` for a string-set field's member index, which serves `$contains`, any-of, membership levels and unfiltered facets on the field. Absent on any other index. */
3485
+ members?: boolean;
3458
3486
  /** Why the index exists: a declaration that marks the fields `indexed` or `unique` (or a compound constraint), and a registration through these routes. The index is dropped when the last origin goes. */
3459
3487
  origins: {
3460
3488
  kind: "declaration" | "named";
@@ -7936,6 +7964,7 @@ export interface FunctionApi {
7936
7964
  "name"?: string | number | boolean;
7937
7965
  "limit"?: string | number | boolean;
7938
7966
  "cursor"?: string | number | boolean;
7967
+ "testUsers"?: string | number | boolean;
7939
7968
  }): Promise<{
7940
7969
  items: {
7941
7970
  userId: string;
@@ -7946,10 +7975,13 @@ export interface FunctionApi {
7946
7975
  addedAt: string | null;
7947
7976
  status: string;
7948
7977
  disabledAt?: string;
7978
+ testUser: boolean;
7949
7979
  }[];
7950
7980
  hasMore: boolean;
7951
7981
  nextCursor?: string;
7952
7982
  prevCursor?: string;
7983
+ /** Rows examined by a `testUsers` filtered read; absent when unfiltered. */
7984
+ scanned?: number;
7953
7985
  }>;
7954
7986
  /** `users.lookup` — GET /users/lookup. Look up a user by identifier */
7955
7987
  "lookup"(args?: {
@@ -9007,6 +9039,11 @@ export interface UserPageOptions {
9007
9039
  limit?: number;
9008
9040
  /** The `nextCursor` of the page before this one. */
9009
9041
  cursor?: string;
9042
+ /**
9043
+ * `exclude` lists only real users, `only` only `+primitivetest` test users.
9044
+ * Omitted or `include` lists every user.
9045
+ */
9046
+ testUsers?: "include" | "exclude" | "only";
9010
9047
  }
9011
9048
 
9012
9049
  /** One user on the roster, as the platform's own users route reports them. */
@@ -9019,6 +9056,8 @@ export interface UserPageItem {
9019
9056
  addedAt: string | null;
9020
9057
  status: string;
9021
9058
  disabledAt: string | null;
9059
+ /** True when the email has the `+primitivetest` test-login shape. */
9060
+ testUser: boolean;
9022
9061
  [key: string]: unknown;
9023
9062
  }
9024
9063
 
@@ -9028,6 +9067,11 @@ export interface UserPage {
9028
9067
  hasMore: boolean;
9029
9068
  /** Absent on the last page. */
9030
9069
  nextCursor?: string;
9070
+ /**
9071
+ * Roster rows examined, on a `testUsers`-filtered page only. A filtered page
9072
+ * can be empty and still have `hasMore`: keep following `nextCursor`.
9073
+ */
9074
+ scanned?: number;
9031
9075
  }
9032
9076
 
9033
9077
  /** How a nested start is keyed and labelled — #3280. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "primitive-functions",
3
- "version": "0.3.0-alpha.12",
3
+ "version": "0.3.0-alpha.13",
4
4
  "description": "The module a Primitive server function imports. Supplied by the platform at invoke time; reserved here so the name is ours before the runtime lands.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Primitive LLC",