@stackframe/stack-shared 2.8.27 → 2.8.30

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 (86) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/config/schema.d.mts +391 -15
  3. package/dist/config/schema.d.ts +391 -15
  4. package/dist/config/schema.js +70 -2
  5. package/dist/config/schema.js.map +1 -1
  6. package/dist/esm/config/schema.js +70 -3
  7. package/dist/esm/config/schema.js.map +1 -1
  8. package/dist/esm/helpers/emails.js +31 -7
  9. package/dist/esm/helpers/emails.js.map +1 -1
  10. package/dist/esm/interface/admin-interface.js +65 -9
  11. package/dist/esm/interface/admin-interface.js.map +1 -1
  12. package/dist/esm/interface/crud/config.js +40 -0
  13. package/dist/esm/interface/crud/config.js.map +1 -0
  14. package/dist/esm/interface/crud/projects.js +4 -0
  15. package/dist/esm/interface/crud/projects.js.map +1 -1
  16. package/dist/esm/interface/server-interface.js +26 -0
  17. package/dist/esm/interface/server-interface.js.map +1 -1
  18. package/dist/esm/known-errors.js +73 -1
  19. package/dist/esm/known-errors.js.map +1 -1
  20. package/dist/esm/schema-fields.js +67 -4
  21. package/dist/esm/schema-fields.js.map +1 -1
  22. package/dist/esm/utils/errors.js.map +1 -1
  23. package/dist/esm/utils/esbuild.js +15 -11
  24. package/dist/esm/utils/esbuild.js.map +1 -1
  25. package/dist/esm/utils/featurebase.js +176 -0
  26. package/dist/esm/utils/featurebase.js.map +1 -0
  27. package/dist/esm/utils/html.js +6 -1
  28. package/dist/esm/utils/html.js.map +1 -1
  29. package/dist/esm/utils/promises.js +24 -13
  30. package/dist/esm/utils/promises.js.map +1 -1
  31. package/dist/esm/utils/telemetry.js +39 -0
  32. package/dist/esm/utils/telemetry.js.map +1 -0
  33. package/dist/helpers/emails.d.mts +1 -1
  34. package/dist/helpers/emails.d.ts +1 -1
  35. package/dist/helpers/emails.js +31 -7
  36. package/dist/helpers/emails.js.map +1 -1
  37. package/dist/index.d.mts +2 -1
  38. package/dist/index.d.ts +2 -1
  39. package/dist/interface/admin-interface.d.mts +15 -6
  40. package/dist/interface/admin-interface.d.ts +15 -6
  41. package/dist/interface/admin-interface.js +65 -9
  42. package/dist/interface/admin-interface.js.map +1 -1
  43. package/dist/interface/crud/config.d.mts +49 -0
  44. package/dist/interface/crud/config.d.ts +49 -0
  45. package/dist/interface/crud/config.js +79 -0
  46. package/dist/interface/crud/config.js.map +1 -0
  47. package/dist/interface/crud/project-api-keys.d.mts +4 -4
  48. package/dist/interface/crud/project-api-keys.d.ts +4 -4
  49. package/dist/interface/crud/projects.d.mts +35 -7
  50. package/dist/interface/crud/projects.d.ts +35 -7
  51. package/dist/interface/crud/projects.js +4 -0
  52. package/dist/interface/crud/projects.js.map +1 -1
  53. package/dist/interface/server-interface.d.mts +9 -0
  54. package/dist/interface/server-interface.d.ts +9 -0
  55. package/dist/interface/server-interface.js +26 -0
  56. package/dist/interface/server-interface.js.map +1 -1
  57. package/dist/known-errors.d.mts +15 -0
  58. package/dist/known-errors.d.ts +15 -0
  59. package/dist/known-errors.js +73 -1
  60. package/dist/known-errors.js.map +1 -1
  61. package/dist/schema-fields.d.mts +88 -2
  62. package/dist/schema-fields.d.ts +88 -2
  63. package/dist/schema-fields.js +71 -3
  64. package/dist/schema-fields.js.map +1 -1
  65. package/dist/utils/errors.d.mts +3 -1
  66. package/dist/utils/errors.d.ts +3 -1
  67. package/dist/utils/errors.js.map +1 -1
  68. package/dist/utils/esbuild.js +15 -11
  69. package/dist/utils/esbuild.js.map +1 -1
  70. package/dist/utils/featurebase.d.mts +28 -0
  71. package/dist/utils/featurebase.d.ts +28 -0
  72. package/dist/utils/featurebase.js +201 -0
  73. package/dist/utils/featurebase.js.map +1 -0
  74. package/dist/utils/html.d.mts +2 -1
  75. package/dist/utils/html.d.ts +2 -1
  76. package/dist/utils/html.js +8 -2
  77. package/dist/utils/html.js.map +1 -1
  78. package/dist/utils/promises.d.mts +5 -1
  79. package/dist/utils/promises.d.ts +5 -1
  80. package/dist/utils/promises.js +24 -12
  81. package/dist/utils/promises.js.map +1 -1
  82. package/dist/utils/telemetry.d.mts +13 -0
  83. package/dist/utils/telemetry.d.ts +13 -0
  84. package/dist/utils/telemetry.js +66 -0
  85. package/dist/utils/telemetry.js.map +1 -0
  86. package/package.json +2 -1
@@ -1,3 +1,4 @@
1
+ import { DayInterval } from '../utils/dates.js';
1
2
  import * as yup from 'yup';
2
3
  import { DeepMerge } from '../utils/objects.js';
3
4
  import { Result } from '../utils/results.js';
@@ -28,6 +29,56 @@ declare const projectConfigSchema: yup.ObjectSchema<{
28
29
  }, yup.AnyObject, {
29
30
  sourceOfTruth: undefined;
30
31
  }, "">;
32
+ declare const branchPaymentsSchema: yup.ObjectSchema<{
33
+ stripeAccountId: string | undefined;
34
+ stripeAccountSetupComplete: boolean | undefined;
35
+ autoPay: {
36
+ interval?: DayInterval | undefined;
37
+ } | undefined;
38
+ exclusivityGroups: Record<string, Record<string, true | undefined>>;
39
+ offers: Record<string, {
40
+ displayName?: string | undefined;
41
+ serverOnly?: boolean | undefined;
42
+ freeTrial?: DayInterval | undefined;
43
+ customerType?: "user" | "team" | undefined;
44
+ stackable?: boolean | undefined;
45
+ prices: Record<string, {
46
+ USD?: string | undefined;
47
+ EUR?: string | undefined;
48
+ GBP?: string | undefined;
49
+ JPY?: string | undefined;
50
+ INR?: string | undefined;
51
+ AUD?: string | undefined;
52
+ CAD?: string | undefined;
53
+ interval?: DayInterval | undefined;
54
+ serverOnly?: boolean | undefined;
55
+ freeTrial?: DayInterval | undefined;
56
+ }>;
57
+ includedItems: Record<string, {
58
+ repeat?: "never" | DayInterval | undefined;
59
+ quantity?: number | undefined;
60
+ expires?: "never" | "when-purchase-expires" | "when-repeated" | undefined;
61
+ }>;
62
+ }>;
63
+ items: Record<string, {
64
+ displayName?: string | undefined;
65
+ customerType?: "user" | "team" | undefined;
66
+ default: {
67
+ repeat?: "never" | DayInterval | undefined;
68
+ quantity?: number | undefined;
69
+ expires?: "never" | "when-repeated" | undefined;
70
+ };
71
+ }>;
72
+ }, yup.AnyObject, {
73
+ stripeAccountId: undefined;
74
+ stripeAccountSetupComplete: undefined;
75
+ autoPay: {
76
+ interval: undefined;
77
+ };
78
+ exclusivityGroups: undefined;
79
+ offers: undefined;
80
+ items: undefined;
81
+ }, "">;
31
82
  declare const branchConfigSchema: yup.Schema<Omit<Omit<{
32
83
  sourceOfTruth: {
33
84
  type: "hosted";
@@ -38,7 +89,7 @@ declare const branchConfigSchema: yup.Schema<Omit<Omit<{
38
89
  type: "postgres";
39
90
  connectionString: string;
40
91
  };
41
- }, string>, "domains" | "teams" | "rbac" | "apiKeys" | "auth" | "users" | "emails"> & {
92
+ }, string>, "domains" | "teams" | "rbac" | "apiKeys" | "auth" | "payments" | "users" | "emails"> & {
42
93
  domains: {
43
94
  allowLocalhost?: boolean | undefined;
44
95
  };
@@ -84,6 +135,47 @@ declare const branchConfigSchema: yup.Schema<Omit<Omit<{
84
135
  }>;
85
136
  };
86
137
  };
138
+ payments: {
139
+ stripeAccountId?: string | undefined;
140
+ stripeAccountSetupComplete?: boolean | undefined;
141
+ autoPay?: {
142
+ interval?: DayInterval | undefined;
143
+ } | undefined;
144
+ items: Record<string, {
145
+ displayName?: string | undefined;
146
+ customerType?: "user" | "team" | undefined;
147
+ default: {
148
+ repeat?: "never" | DayInterval | undefined;
149
+ quantity?: number | undefined;
150
+ expires?: "never" | "when-repeated" | undefined;
151
+ };
152
+ }>;
153
+ exclusivityGroups: Record<string, Record<string, true | undefined>>;
154
+ offers: Record<string, {
155
+ displayName?: string | undefined;
156
+ serverOnly?: boolean | undefined;
157
+ freeTrial?: DayInterval | undefined;
158
+ customerType?: "user" | "team" | undefined;
159
+ stackable?: boolean | undefined;
160
+ prices: Record<string, {
161
+ USD?: string | undefined;
162
+ EUR?: string | undefined;
163
+ GBP?: string | undefined;
164
+ JPY?: string | undefined;
165
+ INR?: string | undefined;
166
+ AUD?: string | undefined;
167
+ CAD?: string | undefined;
168
+ interval?: DayInterval | undefined;
169
+ serverOnly?: boolean | undefined;
170
+ freeTrial?: DayInterval | undefined;
171
+ }>;
172
+ includedItems: Record<string, {
173
+ repeat?: "never" | DayInterval | undefined;
174
+ quantity?: number | undefined;
175
+ expires?: "never" | "when-purchase-expires" | "when-repeated" | undefined;
176
+ }>;
177
+ }>;
178
+ };
87
179
  users: {
88
180
  allowClientUserDeletion?: boolean | undefined;
89
181
  };
@@ -101,7 +193,7 @@ declare const branchConfigSchema: yup.Schema<Omit<Omit<{
101
193
  };
102
194
  }, yup.AnyObject, Omit<Omit<{
103
195
  sourceOfTruth: undefined;
104
- }, string>, "domains" | "teams" | "rbac" | "apiKeys" | "auth" | "users" | "emails"> & {
196
+ }, string>, "domains" | "teams" | "rbac" | "apiKeys" | "auth" | "payments" | "users" | "emails"> & {
105
197
  rbac: {
106
198
  permissions: undefined;
107
199
  defaultPermissions: {
@@ -147,6 +239,16 @@ declare const branchConfigSchema: yup.Schema<Omit<Omit<{
147
239
  themes: undefined;
148
240
  templates: undefined;
149
241
  };
242
+ payments: {
243
+ stripeAccountId: undefined;
244
+ stripeAccountSetupComplete: undefined;
245
+ autoPay: {
246
+ interval: undefined;
247
+ };
248
+ exclusivityGroups: undefined;
249
+ offers: undefined;
250
+ items: undefined;
251
+ };
150
252
  }, "">;
151
253
  declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
152
254
  sourceOfTruth: {
@@ -158,7 +260,7 @@ declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
158
260
  type: "postgres";
159
261
  connectionString: string;
160
262
  };
161
- }, string>, "domains" | "teams" | "rbac" | "apiKeys" | "auth" | "users" | "emails"> & {
263
+ }, string>, "domains" | "teams" | "rbac" | "apiKeys" | "auth" | "payments" | "users" | "emails"> & {
162
264
  domains: {
163
265
  allowLocalhost?: boolean | undefined;
164
266
  };
@@ -204,6 +306,47 @@ declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
204
306
  }>;
205
307
  };
206
308
  };
309
+ payments: {
310
+ stripeAccountId?: string | undefined;
311
+ stripeAccountSetupComplete?: boolean | undefined;
312
+ autoPay?: {
313
+ interval?: DayInterval | undefined;
314
+ } | undefined;
315
+ items: Record<string, {
316
+ displayName?: string | undefined;
317
+ customerType?: "user" | "team" | undefined;
318
+ default: {
319
+ repeat?: "never" | DayInterval | undefined;
320
+ quantity?: number | undefined;
321
+ expires?: "never" | "when-repeated" | undefined;
322
+ };
323
+ }>;
324
+ exclusivityGroups: Record<string, Record<string, true | undefined>>;
325
+ offers: Record<string, {
326
+ displayName?: string | undefined;
327
+ serverOnly?: boolean | undefined;
328
+ freeTrial?: DayInterval | undefined;
329
+ customerType?: "user" | "team" | undefined;
330
+ stackable?: boolean | undefined;
331
+ prices: Record<string, {
332
+ USD?: string | undefined;
333
+ EUR?: string | undefined;
334
+ GBP?: string | undefined;
335
+ JPY?: string | undefined;
336
+ INR?: string | undefined;
337
+ AUD?: string | undefined;
338
+ CAD?: string | undefined;
339
+ interval?: DayInterval | undefined;
340
+ serverOnly?: boolean | undefined;
341
+ freeTrial?: DayInterval | undefined;
342
+ }>;
343
+ includedItems: Record<string, {
344
+ repeat?: "never" | DayInterval | undefined;
345
+ quantity?: number | undefined;
346
+ expires?: "never" | "when-purchase-expires" | "when-repeated" | undefined;
347
+ }>;
348
+ }>;
349
+ };
207
350
  users: {
208
351
  allowClientUserDeletion?: boolean | undefined;
209
352
  };
@@ -292,7 +435,7 @@ declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
292
435
  };
293
436
  }, yup.AnyObject, Omit<NonNullable<Omit<Omit<{
294
437
  sourceOfTruth: undefined;
295
- }, string>, "domains" | "teams" | "rbac" | "apiKeys" | "auth" | "users" | "emails"> & {
438
+ }, string>, "domains" | "teams" | "rbac" | "apiKeys" | "auth" | "payments" | "users" | "emails"> & {
296
439
  rbac: {
297
440
  permissions: undefined;
298
441
  defaultPermissions: {
@@ -338,10 +481,20 @@ declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
338
481
  themes: undefined;
339
482
  templates: undefined;
340
483
  };
484
+ payments: {
485
+ stripeAccountId: undefined;
486
+ stripeAccountSetupComplete: undefined;
487
+ autoPay: {
488
+ interval: undefined;
489
+ };
490
+ exclusivityGroups: undefined;
491
+ offers: undefined;
492
+ items: undefined;
493
+ };
341
494
  }>, "domains" | "auth" | "emails"> & {
342
495
  auth: Omit<NonNullable<Omit<Omit<{
343
496
  sourceOfTruth: undefined;
344
- }, string>, "domains" | "teams" | "rbac" | "apiKeys" | "auth" | "users" | "emails"> & {
497
+ }, string>, "domains" | "teams" | "rbac" | "apiKeys" | "auth" | "payments" | "users" | "emails"> & {
345
498
  rbac: {
346
499
  permissions: undefined;
347
500
  defaultPermissions: {
@@ -387,10 +540,20 @@ declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
387
540
  themes: undefined;
388
541
  templates: undefined;
389
542
  };
543
+ payments: {
544
+ stripeAccountId: undefined;
545
+ stripeAccountSetupComplete: undefined;
546
+ autoPay: {
547
+ interval: undefined;
548
+ };
549
+ exclusivityGroups: undefined;
550
+ offers: undefined;
551
+ items: undefined;
552
+ };
390
553
  }>, "oauth"> & {
391
554
  oauth: Omit<NonNullable<Omit<Omit<{
392
555
  sourceOfTruth: undefined;
393
- }, string>, "domains" | "teams" | "rbac" | "apiKeys" | "auth" | "users" | "emails"> & {
556
+ }, string>, "domains" | "teams" | "rbac" | "apiKeys" | "auth" | "payments" | "users" | "emails"> & {
394
557
  rbac: {
395
558
  permissions: undefined;
396
559
  defaultPermissions: {
@@ -436,13 +599,23 @@ declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
436
599
  themes: undefined;
437
600
  templates: undefined;
438
601
  };
602
+ payments: {
603
+ stripeAccountId: undefined;
604
+ stripeAccountSetupComplete: undefined;
605
+ autoPay: {
606
+ interval: undefined;
607
+ };
608
+ exclusivityGroups: undefined;
609
+ offers: undefined;
610
+ items: undefined;
611
+ };
439
612
  }>, "providers"> & {
440
613
  providers: undefined;
441
614
  };
442
615
  };
443
616
  emails: Omit<NonNullable<Omit<Omit<{
444
617
  sourceOfTruth: undefined;
445
- }, string>, "domains" | "teams" | "rbac" | "apiKeys" | "auth" | "users" | "emails"> & {
618
+ }, string>, "domains" | "teams" | "rbac" | "apiKeys" | "auth" | "payments" | "users" | "emails"> & {
446
619
  rbac: {
447
620
  permissions: undefined;
448
621
  defaultPermissions: {
@@ -488,6 +661,16 @@ declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
488
661
  themes: undefined;
489
662
  templates: undefined;
490
663
  };
664
+ payments: {
665
+ stripeAccountId: undefined;
666
+ stripeAccountSetupComplete: undefined;
667
+ autoPay: {
668
+ interval: undefined;
669
+ };
670
+ exclusivityGroups: undefined;
671
+ offers: undefined;
672
+ items: undefined;
673
+ };
491
674
  }>, "server"> & {
492
675
  server: {
493
676
  isShared: undefined;
@@ -501,7 +684,7 @@ declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
501
684
  };
502
685
  domains: Omit<NonNullable<Omit<Omit<{
503
686
  sourceOfTruth: undefined;
504
- }, string>, "domains" | "teams" | "rbac" | "apiKeys" | "auth" | "users" | "emails"> & {
687
+ }, string>, "domains" | "teams" | "rbac" | "apiKeys" | "auth" | "payments" | "users" | "emails"> & {
505
688
  rbac: {
506
689
  permissions: undefined;
507
690
  defaultPermissions: {
@@ -547,6 +730,16 @@ declare const environmentConfigSchema: yup.Schema<Omit<NonNullable<Omit<Omit<{
547
730
  themes: undefined;
548
731
  templates: undefined;
549
732
  };
733
+ payments: {
734
+ stripeAccountId: undefined;
735
+ stripeAccountSetupComplete: undefined;
736
+ autoPay: {
737
+ interval: undefined;
738
+ };
739
+ exclusivityGroups: undefined;
740
+ offers: undefined;
741
+ items: undefined;
742
+ };
550
743
  }>, "trustedDomains"> & {
551
744
  trustedDomains: undefined;
552
745
  };
@@ -561,7 +754,7 @@ declare const organizationConfigSchema: yup.Schema<Omit<NonNullable<Omit<NonNull
561
754
  type: "postgres";
562
755
  connectionString: string;
563
756
  };
564
- }, string>, "domains" | "teams" | "rbac" | "apiKeys" | "auth" | "users" | "emails"> & {
757
+ }, string>, "domains" | "teams" | "rbac" | "apiKeys" | "auth" | "payments" | "users" | "emails"> & {
565
758
  domains: {
566
759
  allowLocalhost?: boolean | undefined;
567
760
  };
@@ -607,6 +800,47 @@ declare const organizationConfigSchema: yup.Schema<Omit<NonNullable<Omit<NonNull
607
800
  }>;
608
801
  };
609
802
  };
803
+ payments: {
804
+ stripeAccountId?: string | undefined;
805
+ stripeAccountSetupComplete?: boolean | undefined;
806
+ autoPay?: {
807
+ interval?: DayInterval | undefined;
808
+ } | undefined;
809
+ items: Record<string, {
810
+ displayName?: string | undefined;
811
+ customerType?: "user" | "team" | undefined;
812
+ default: {
813
+ repeat?: "never" | DayInterval | undefined;
814
+ quantity?: number | undefined;
815
+ expires?: "never" | "when-repeated" | undefined;
816
+ };
817
+ }>;
818
+ exclusivityGroups: Record<string, Record<string, true | undefined>>;
819
+ offers: Record<string, {
820
+ displayName?: string | undefined;
821
+ serverOnly?: boolean | undefined;
822
+ freeTrial?: DayInterval | undefined;
823
+ customerType?: "user" | "team" | undefined;
824
+ stackable?: boolean | undefined;
825
+ prices: Record<string, {
826
+ USD?: string | undefined;
827
+ EUR?: string | undefined;
828
+ GBP?: string | undefined;
829
+ JPY?: string | undefined;
830
+ INR?: string | undefined;
831
+ AUD?: string | undefined;
832
+ CAD?: string | undefined;
833
+ interval?: DayInterval | undefined;
834
+ serverOnly?: boolean | undefined;
835
+ freeTrial?: DayInterval | undefined;
836
+ }>;
837
+ includedItems: Record<string, {
838
+ repeat?: "never" | DayInterval | undefined;
839
+ quantity?: number | undefined;
840
+ expires?: "never" | "when-purchase-expires" | "when-repeated" | undefined;
841
+ }>;
842
+ }>;
843
+ };
610
844
  users: {
611
845
  allowClientUserDeletion?: boolean | undefined;
612
846
  };
@@ -695,7 +929,7 @@ declare const organizationConfigSchema: yup.Schema<Omit<NonNullable<Omit<NonNull
695
929
  };
696
930
  }>, never> & {}, yup.AnyObject, Omit<NonNullable<Omit<NonNullable<Omit<Omit<{
697
931
  sourceOfTruth: undefined;
698
- }, string>, "domains" | "teams" | "rbac" | "apiKeys" | "auth" | "users" | "emails"> & {
932
+ }, string>, "domains" | "teams" | "rbac" | "apiKeys" | "auth" | "payments" | "users" | "emails"> & {
699
933
  rbac: {
700
934
  permissions: undefined;
701
935
  defaultPermissions: {
@@ -741,10 +975,20 @@ declare const organizationConfigSchema: yup.Schema<Omit<NonNullable<Omit<NonNull
741
975
  themes: undefined;
742
976
  templates: undefined;
743
977
  };
978
+ payments: {
979
+ stripeAccountId: undefined;
980
+ stripeAccountSetupComplete: undefined;
981
+ autoPay: {
982
+ interval: undefined;
983
+ };
984
+ exclusivityGroups: undefined;
985
+ offers: undefined;
986
+ items: undefined;
987
+ };
744
988
  }>, "domains" | "auth" | "emails"> & {
745
989
  auth: Omit<NonNullable<Omit<Omit<{
746
990
  sourceOfTruth: undefined;
747
- }, string>, "domains" | "teams" | "rbac" | "apiKeys" | "auth" | "users" | "emails"> & {
991
+ }, string>, "domains" | "teams" | "rbac" | "apiKeys" | "auth" | "payments" | "users" | "emails"> & {
748
992
  rbac: {
749
993
  permissions: undefined;
750
994
  defaultPermissions: {
@@ -790,10 +1034,20 @@ declare const organizationConfigSchema: yup.Schema<Omit<NonNullable<Omit<NonNull
790
1034
  themes: undefined;
791
1035
  templates: undefined;
792
1036
  };
1037
+ payments: {
1038
+ stripeAccountId: undefined;
1039
+ stripeAccountSetupComplete: undefined;
1040
+ autoPay: {
1041
+ interval: undefined;
1042
+ };
1043
+ exclusivityGroups: undefined;
1044
+ offers: undefined;
1045
+ items: undefined;
1046
+ };
793
1047
  }>, "oauth"> & {
794
1048
  oauth: Omit<NonNullable<Omit<Omit<{
795
1049
  sourceOfTruth: undefined;
796
- }, string>, "domains" | "teams" | "rbac" | "apiKeys" | "auth" | "users" | "emails"> & {
1050
+ }, string>, "domains" | "teams" | "rbac" | "apiKeys" | "auth" | "payments" | "users" | "emails"> & {
797
1051
  rbac: {
798
1052
  permissions: undefined;
799
1053
  defaultPermissions: {
@@ -839,13 +1093,23 @@ declare const organizationConfigSchema: yup.Schema<Omit<NonNullable<Omit<NonNull
839
1093
  themes: undefined;
840
1094
  templates: undefined;
841
1095
  };
1096
+ payments: {
1097
+ stripeAccountId: undefined;
1098
+ stripeAccountSetupComplete: undefined;
1099
+ autoPay: {
1100
+ interval: undefined;
1101
+ };
1102
+ exclusivityGroups: undefined;
1103
+ offers: undefined;
1104
+ items: undefined;
1105
+ };
842
1106
  }>, "providers"> & {
843
1107
  providers: undefined;
844
1108
  };
845
1109
  };
846
1110
  emails: Omit<NonNullable<Omit<Omit<{
847
1111
  sourceOfTruth: undefined;
848
- }, string>, "domains" | "teams" | "rbac" | "apiKeys" | "auth" | "users" | "emails"> & {
1112
+ }, string>, "domains" | "teams" | "rbac" | "apiKeys" | "auth" | "payments" | "users" | "emails"> & {
849
1113
  rbac: {
850
1114
  permissions: undefined;
851
1115
  defaultPermissions: {
@@ -891,6 +1155,16 @@ declare const organizationConfigSchema: yup.Schema<Omit<NonNullable<Omit<NonNull
891
1155
  themes: undefined;
892
1156
  templates: undefined;
893
1157
  };
1158
+ payments: {
1159
+ stripeAccountId: undefined;
1160
+ stripeAccountSetupComplete: undefined;
1161
+ autoPay: {
1162
+ interval: undefined;
1163
+ };
1164
+ exclusivityGroups: undefined;
1165
+ offers: undefined;
1166
+ items: undefined;
1167
+ };
894
1168
  }>, "server"> & {
895
1169
  server: {
896
1170
  isShared: undefined;
@@ -904,7 +1178,7 @@ declare const organizationConfigSchema: yup.Schema<Omit<NonNullable<Omit<NonNull
904
1178
  };
905
1179
  domains: Omit<NonNullable<Omit<Omit<{
906
1180
  sourceOfTruth: undefined;
907
- }, string>, "domains" | "teams" | "rbac" | "apiKeys" | "auth" | "users" | "emails"> & {
1181
+ }, string>, "domains" | "teams" | "rbac" | "apiKeys" | "auth" | "payments" | "users" | "emails"> & {
908
1182
  rbac: {
909
1183
  permissions: undefined;
910
1184
  defaultPermissions: {
@@ -950,6 +1224,16 @@ declare const organizationConfigSchema: yup.Schema<Omit<NonNullable<Omit<NonNull
950
1224
  themes: undefined;
951
1225
  templates: undefined;
952
1226
  };
1227
+ payments: {
1228
+ stripeAccountId: undefined;
1229
+ stripeAccountSetupComplete: undefined;
1230
+ autoPay: {
1231
+ interval: undefined;
1232
+ };
1233
+ exclusivityGroups: undefined;
1234
+ offers: undefined;
1235
+ items: undefined;
1236
+ };
953
1237
  }>, "trustedDomains"> & {
954
1238
  trustedDomains: undefined;
955
1239
  };
@@ -1078,6 +1362,44 @@ declare const organizationConfigDefaults: {
1078
1362
  };
1079
1363
  };
1080
1364
  };
1365
+ readonly payments: {
1366
+ readonly stripeAccountId: undefined;
1367
+ readonly stripeAccountSetupComplete: false;
1368
+ readonly autoPay: undefined;
1369
+ readonly exclusivityGroups: (key: string) => (key: string) => undefined;
1370
+ readonly offers: (key: string) => {
1371
+ readonly displayName: string;
1372
+ readonly customerType: undefined;
1373
+ readonly freeTrial: undefined;
1374
+ readonly serverOnly: false;
1375
+ readonly stackable: undefined;
1376
+ readonly prices: (key: string) => {
1377
+ interval: undefined;
1378
+ serverOnly: false;
1379
+ freeTrial: undefined;
1380
+ USD: undefined;
1381
+ EUR: undefined;
1382
+ GBP: undefined;
1383
+ JPY: undefined;
1384
+ INR: undefined;
1385
+ AUD: undefined;
1386
+ CAD: undefined;
1387
+ };
1388
+ readonly includedItems: (key: string) => {
1389
+ quantity: undefined;
1390
+ repeat: "never";
1391
+ expires: "when-repeated";
1392
+ };
1393
+ };
1394
+ readonly items: (key: string) => {
1395
+ readonly displayName: string;
1396
+ readonly default: {
1397
+ readonly quantity: 0;
1398
+ readonly expires: "when-repeated";
1399
+ readonly repeat: "never";
1400
+ };
1401
+ };
1402
+ };
1081
1403
  };
1082
1404
  type ReplaceFunctionsWithObjects<T> = T & (T extends (arg: infer K extends string) => infer R ? Record<K, R> & object : unknown);
1083
1405
  type DeepReplaceFunctionsWithObjects<T> = T extends object ? {
@@ -1266,6 +1588,59 @@ declare function sanitizeOrganizationConfig(config: OrganizationRenderedConfigBe
1266
1588
  };
1267
1589
  };
1268
1590
  };
1591
+ payments: {
1592
+ items: {
1593
+ [x: string]: {
1594
+ customerType?: "user" | "team" | undefined;
1595
+ default: {
1596
+ repeat: "never" | [number, "day" | "week" | "year" | "month"];
1597
+ quantity: number;
1598
+ expires: "never" | "when-repeated";
1599
+ };
1600
+ displayName: string;
1601
+ };
1602
+ };
1603
+ stripeAccountId: string | undefined;
1604
+ stripeAccountSetupComplete: boolean;
1605
+ autoPay: {
1606
+ interval?: [number, "day" | "week" | "year" | "month"] | undefined;
1607
+ } | undefined;
1608
+ exclusivityGroups: {
1609
+ [x: string]: {
1610
+ [x: string]: true | undefined;
1611
+ };
1612
+ };
1613
+ offers: {
1614
+ [x: string]: {
1615
+ displayName: string;
1616
+ serverOnly: boolean;
1617
+ freeTrial: [number, "day" | "week" | "year" | "month"] | undefined;
1618
+ customerType: "user" | "team" | undefined;
1619
+ stackable: boolean | undefined;
1620
+ prices: {
1621
+ [x: string]: {
1622
+ USD: string | undefined;
1623
+ EUR: string | undefined;
1624
+ GBP: string | undefined;
1625
+ JPY: string | undefined;
1626
+ INR: string | undefined;
1627
+ AUD: string | undefined;
1628
+ CAD: string | undefined;
1629
+ interval: [number, "day" | "week" | "year" | "month"] | undefined;
1630
+ serverOnly: boolean;
1631
+ freeTrial: [number, "day" | "week" | "year" | "month"] | undefined;
1632
+ };
1633
+ };
1634
+ includedItems: {
1635
+ [x: string]: {
1636
+ repeat: "never" | [number, "day" | "week" | "year" | "month"];
1637
+ quantity: number | undefined;
1638
+ expires: "never" | "when-purchase-expires" | "when-repeated";
1639
+ };
1640
+ };
1641
+ };
1642
+ };
1643
+ };
1269
1644
  users: {
1270
1645
  allowClientUserDeletion: boolean;
1271
1646
  };
@@ -1327,5 +1702,6 @@ type ProjectRenderedConfig = Expand<Awaited<ReturnType<typeof sanitizeProjectCon
1327
1702
  type BranchRenderedConfig = Expand<Awaited<ReturnType<typeof sanitizeBranchConfig<BranchRenderedConfigBeforeSanitization>>>>;
1328
1703
  type EnvironmentRenderedConfig = Expand<Awaited<ReturnType<typeof sanitizeEnvironmentConfig<EnvironmentRenderedConfigBeforeSanitization>>>>;
1329
1704
  type OrganizationRenderedConfig = Expand<Awaited<ReturnType<typeof sanitizeOrganizationConfig>>>;
1705
+ type CompleteConfig = OrganizationRenderedConfig;
1330
1706
 
1331
- export { type BranchConfigOverride, type BranchConfigOverrideOverride, type BranchIncompleteConfig, type BranchRenderedConfig, type ConfigLevel, type EnvironmentConfigOverride, type EnvironmentConfigOverrideOverride, type EnvironmentIncompleteConfig, type EnvironmentRenderedConfig, type OrganizationConfigOverride, type OrganizationConfigOverrideOverride, type OrganizationIncompleteConfig, type OrganizationRenderedConfig, type ProjectConfigOverride, type ProjectConfigOverrideOverride, type ProjectIncompleteConfig, type ProjectRenderedConfig, type ValidatedToHaveNoConfigOverrideErrors, type ValidatedToHaveNoIncompleteConfigWarnings, applyBranchDefaults, applyEnvironmentDefaults, applyOrganizationDefaults, applyProjectDefaults, assertNoConfigOverrideErrors, branchConfigSchema, configLevels, environmentConfigSchema, getConfigOverrideErrors, getIncompleteConfigWarnings, migrateConfigOverride, organizationConfigSchema, projectConfigSchema, sanitizeBranchConfig, sanitizeEnvironmentConfig, sanitizeOrganizationConfig, sanitizeProjectConfig };
1707
+ export { type BranchConfigOverride, type BranchConfigOverrideOverride, type BranchIncompleteConfig, type BranchRenderedConfig, type CompleteConfig, type ConfigLevel, type EnvironmentConfigOverride, type EnvironmentConfigOverrideOverride, type EnvironmentIncompleteConfig, type EnvironmentRenderedConfig, type OrganizationConfigOverride, type OrganizationConfigOverrideOverride, type OrganizationIncompleteConfig, type OrganizationRenderedConfig, type ProjectConfigOverride, type ProjectConfigOverrideOverride, type ProjectIncompleteConfig, type ProjectRenderedConfig, type ValidatedToHaveNoConfigOverrideErrors, type ValidatedToHaveNoIncompleteConfigWarnings, applyBranchDefaults, applyEnvironmentDefaults, applyOrganizationDefaults, applyProjectDefaults, assertNoConfigOverrideErrors, branchConfigSchema, branchPaymentsSchema, configLevels, environmentConfigSchema, getConfigOverrideErrors, getIncompleteConfigWarnings, migrateConfigOverride, organizationConfigSchema, projectConfigSchema, sanitizeBranchConfig, sanitizeEnvironmentConfig, sanitizeOrganizationConfig, sanitizeProjectConfig };