@tinkerlandai/indiana-sdk 0.2.0 → 0.3.1

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.
@@ -1,5 +1,5 @@
1
1
  import { LanguageModelV4Usage, LanguageModelV4Middleware } from '@ai-sdk/provider';
2
- import { S as StackNode } from './screen-DfuSw6Tz.js';
2
+ import { S as StackNode } from './screen-Keau_Qa2.js';
3
3
  import { z } from 'zod';
4
4
 
5
5
  type OfferingProductItem = {
@@ -16,6 +16,274 @@ type OfferingGroupItem = {
16
16
  type OfferingItem = OfferingProductItem | OfferingGroupItem;
17
17
 
18
18
  declare const apiOperations: {
19
+ readonly getFeatures: {
20
+ readonly method: "GET";
21
+ readonly path: "features";
22
+ readonly permission: "features:read";
23
+ readonly audience: "mixed";
24
+ readonly request: z.ZodObject<{}, z.core.$strict>;
25
+ readonly response: z.ZodObject<{
26
+ requestId: z.ZodUUID;
27
+ scope: z.ZodObject<{
28
+ projectId: z.ZodString;
29
+ environment: z.ZodEnum<{
30
+ sandbox: "sandbox";
31
+ live: "live";
32
+ }>;
33
+ }, z.core.$strict>;
34
+ payload: z.ZodObject<{
35
+ scope: z.ZodObject<{
36
+ projectId: z.ZodString;
37
+ environment: z.ZodEnum<{
38
+ sandbox: "sandbox";
39
+ live: "live";
40
+ }>;
41
+ }, z.core.$strict>;
42
+ generation: z.ZodString;
43
+ evaluatedAt: z.ZodISODateTime;
44
+ expiresAt: z.ZodNullable<z.ZodISODateTime>;
45
+ features: z.ZodRecord<z.ZodString, z.ZodObject<{
46
+ defaultValue: z.ZodOptional<z.ZodJSONSchema>;
47
+ rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
48
+ id: z.ZodOptional<z.ZodString>;
49
+ force: z.ZodOptional<z.ZodJSONSchema>;
50
+ variations: z.ZodOptional<z.ZodArray<z.ZodJSONSchema>>;
51
+ key: z.ZodOptional<z.ZodString>;
52
+ range: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
53
+ tracks: z.ZodOptional<z.ZodArray<z.ZodObject<{
54
+ experiment: z.ZodObject<{
55
+ key: z.ZodString;
56
+ variations: z.ZodTuple<[z.ZodJSONSchema, z.ZodJSONSchema], z.ZodJSONSchema>;
57
+ urlPatterns: z.ZodOptional<z.ZodArray<z.ZodObject<{
58
+ include: z.ZodBoolean;
59
+ type: z.ZodEnum<{
60
+ regex: "regex";
61
+ simple: "simple";
62
+ }>;
63
+ pattern: z.ZodString;
64
+ }, z.core.$strict>>>;
65
+ force: z.ZodOptional<z.ZodNumber>;
66
+ active: z.ZodOptional<z.ZodBoolean>;
67
+ persistQueryString: z.ZodOptional<z.ZodBoolean>;
68
+ condition: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
69
+ parentConditions: z.ZodOptional<z.ZodArray<z.ZodObject<{
70
+ id: z.ZodString;
71
+ condition: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
72
+ gate: z.ZodOptional<z.ZodBoolean>;
73
+ }, z.core.$strict>>>;
74
+ weights: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
75
+ coverage: z.ZodOptional<z.ZodNumber>;
76
+ hashAttribute: z.ZodOptional<z.ZodString>;
77
+ fallbackAttribute: z.ZodOptional<z.ZodString>;
78
+ hashVersion: z.ZodOptional<z.ZodLiteral<2>>;
79
+ disableStickyBucketing: z.ZodOptional<z.ZodBoolean>;
80
+ bucketVersion: z.ZodOptional<z.ZodNumber>;
81
+ minBucketVersion: z.ZodOptional<z.ZodNumber>;
82
+ filters: z.ZodOptional<z.ZodArray<z.ZodObject<{
83
+ attribute: z.ZodOptional<z.ZodString>;
84
+ seed: z.ZodString;
85
+ hashVersion: z.ZodLiteral<2>;
86
+ ranges: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
87
+ }, z.core.$strict>>>;
88
+ ranges: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
89
+ meta: z.ZodOptional<z.ZodArray<z.ZodObject<{
90
+ key: z.ZodOptional<z.ZodString>;
91
+ name: z.ZodOptional<z.ZodString>;
92
+ passthrough: z.ZodOptional<z.ZodBoolean>;
93
+ }, z.core.$strict>>>;
94
+ seed: z.ZodOptional<z.ZodString>;
95
+ name: z.ZodOptional<z.ZodString>;
96
+ phase: z.ZodOptional<z.ZodString>;
97
+ }, z.core.$strict>;
98
+ result: z.ZodObject<{
99
+ value: z.ZodJSONSchema;
100
+ variationId: z.ZodNumber;
101
+ key: z.ZodString;
102
+ name: z.ZodOptional<z.ZodString>;
103
+ bucket: z.ZodOptional<z.ZodNumber>;
104
+ passthrough: z.ZodOptional<z.ZodBoolean>;
105
+ inExperiment: z.ZodBoolean;
106
+ hashUsed: z.ZodOptional<z.ZodBoolean>;
107
+ hashAttribute: z.ZodString;
108
+ hashValue: z.ZodString;
109
+ featureId: z.ZodNullable<z.ZodString>;
110
+ stickyBucketUsed: z.ZodOptional<z.ZodBoolean>;
111
+ }, z.core.$strict>;
112
+ }, z.core.$strict>>>;
113
+ condition: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
114
+ parentConditions: z.ZodOptional<z.ZodArray<z.ZodObject<{
115
+ id: z.ZodString;
116
+ condition: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
117
+ gate: z.ZodOptional<z.ZodBoolean>;
118
+ }, z.core.$strict>>>;
119
+ weights: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
120
+ coverage: z.ZodOptional<z.ZodNumber>;
121
+ hashAttribute: z.ZodOptional<z.ZodString>;
122
+ fallbackAttribute: z.ZodOptional<z.ZodString>;
123
+ hashVersion: z.ZodOptional<z.ZodLiteral<2>>;
124
+ disableStickyBucketing: z.ZodOptional<z.ZodBoolean>;
125
+ bucketVersion: z.ZodOptional<z.ZodNumber>;
126
+ minBucketVersion: z.ZodOptional<z.ZodNumber>;
127
+ filters: z.ZodOptional<z.ZodArray<z.ZodObject<{
128
+ attribute: z.ZodOptional<z.ZodString>;
129
+ seed: z.ZodString;
130
+ hashVersion: z.ZodLiteral<2>;
131
+ ranges: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
132
+ }, z.core.$strict>>>;
133
+ ranges: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
134
+ meta: z.ZodOptional<z.ZodArray<z.ZodObject<{
135
+ key: z.ZodOptional<z.ZodString>;
136
+ name: z.ZodOptional<z.ZodString>;
137
+ passthrough: z.ZodOptional<z.ZodBoolean>;
138
+ }, z.core.$strict>>>;
139
+ seed: z.ZodOptional<z.ZodString>;
140
+ name: z.ZodOptional<z.ZodString>;
141
+ phase: z.ZodOptional<z.ZodString>;
142
+ }, z.core.$strict>>>;
143
+ }, z.core.$strict>>;
144
+ savedGroups: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
145
+ type: z.ZodLiteral<"hashed">;
146
+ attributeKey: z.ZodString;
147
+ values: z.ZodArray<z.ZodString>;
148
+ }, z.core.$strict>, z.ZodObject<{
149
+ type: z.ZodLiteral<"list">;
150
+ attributeKey: z.ZodString;
151
+ values: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
152
+ }, z.core.$strict>, z.ZodObject<{
153
+ type: z.ZodLiteral<"condition">;
154
+ condition: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
155
+ }, z.core.$strict>]>>;
156
+ experiments: z.ZodRecord<z.ZodUUID, z.ZodObject<{
157
+ key: z.ZodString;
158
+ variations: z.ZodTuple<[z.ZodJSONSchema, z.ZodJSONSchema], z.ZodJSONSchema>;
159
+ urlPatterns: z.ZodOptional<z.ZodArray<z.ZodObject<{
160
+ include: z.ZodBoolean;
161
+ type: z.ZodEnum<{
162
+ regex: "regex";
163
+ simple: "simple";
164
+ }>;
165
+ pattern: z.ZodString;
166
+ }, z.core.$strict>>>;
167
+ force: z.ZodOptional<z.ZodNumber>;
168
+ active: z.ZodOptional<z.ZodBoolean>;
169
+ persistQueryString: z.ZodOptional<z.ZodBoolean>;
170
+ condition: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
171
+ parentConditions: z.ZodOptional<z.ZodArray<z.ZodObject<{
172
+ id: z.ZodString;
173
+ condition: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
174
+ gate: z.ZodOptional<z.ZodBoolean>;
175
+ }, z.core.$strict>>>;
176
+ weights: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
177
+ coverage: z.ZodOptional<z.ZodNumber>;
178
+ hashAttribute: z.ZodOptional<z.ZodString>;
179
+ fallbackAttribute: z.ZodOptional<z.ZodString>;
180
+ hashVersion: z.ZodOptional<z.ZodLiteral<2>>;
181
+ disableStickyBucketing: z.ZodOptional<z.ZodBoolean>;
182
+ bucketVersion: z.ZodOptional<z.ZodNumber>;
183
+ minBucketVersion: z.ZodOptional<z.ZodNumber>;
184
+ filters: z.ZodOptional<z.ZodArray<z.ZodObject<{
185
+ attribute: z.ZodOptional<z.ZodString>;
186
+ seed: z.ZodString;
187
+ hashVersion: z.ZodLiteral<2>;
188
+ ranges: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
189
+ }, z.core.$strict>>>;
190
+ ranges: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
191
+ meta: z.ZodOptional<z.ZodArray<z.ZodObject<{
192
+ key: z.ZodOptional<z.ZodString>;
193
+ name: z.ZodOptional<z.ZodString>;
194
+ passthrough: z.ZodOptional<z.ZodBoolean>;
195
+ }, z.core.$strict>>>;
196
+ seed: z.ZodOptional<z.ZodString>;
197
+ name: z.ZodOptional<z.ZodString>;
198
+ phase: z.ZodOptional<z.ZodString>;
199
+ }, z.core.$strict>>;
200
+ remoteFeatures: z.ZodArray<z.ZodString>;
201
+ }, z.core.$strict>;
202
+ }, z.core.$strict>;
203
+ };
204
+ readonly evaluateFeatures: {
205
+ readonly method: "POST";
206
+ readonly path: "features/evaluate";
207
+ readonly permission: "features:read";
208
+ readonly audience: "mixed";
209
+ readonly request: z.ZodObject<{
210
+ attributes: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
211
+ features: z.ZodOptional<z.ZodArray<z.ZodString>>;
212
+ customerId: z.ZodOptional<z.ZodUUID>;
213
+ }, z.core.$strict>;
214
+ readonly response: z.ZodObject<{
215
+ requestId: z.ZodUUID;
216
+ scope: z.ZodObject<{
217
+ projectId: z.ZodString;
218
+ environment: z.ZodEnum<{
219
+ sandbox: "sandbox";
220
+ live: "live";
221
+ }>;
222
+ }, z.core.$strict>;
223
+ generation: z.ZodString;
224
+ evaluatedAt: z.ZodISODateTime;
225
+ expiresAt: z.ZodNullable<z.ZodISODateTime>;
226
+ features: z.ZodRecord<z.ZodString, z.ZodObject<{
227
+ value: z.ZodJSONSchema;
228
+ source: z.ZodEnum<{
229
+ defaultValue: "defaultValue";
230
+ force: "force";
231
+ experiment: "experiment";
232
+ unknownFeature: "unknownFeature";
233
+ override: "override";
234
+ prerequisite: "prerequisite";
235
+ cyclicPrerequisite: "cyclicPrerequisite";
236
+ }>;
237
+ on: z.ZodBoolean;
238
+ off: z.ZodBoolean;
239
+ ruleId: z.ZodString;
240
+ experimentResult: z.ZodOptional<z.ZodObject<{
241
+ value: z.ZodJSONSchema;
242
+ variationId: z.ZodNumber;
243
+ key: z.ZodString;
244
+ name: z.ZodOptional<z.ZodString>;
245
+ bucket: z.ZodOptional<z.ZodNumber>;
246
+ passthrough: z.ZodOptional<z.ZodBoolean>;
247
+ inExperiment: z.ZodBoolean;
248
+ hashUsed: z.ZodOptional<z.ZodBoolean>;
249
+ hashAttribute: z.ZodString;
250
+ hashValue: z.ZodString;
251
+ featureId: z.ZodNullable<z.ZodString>;
252
+ stickyBucketUsed: z.ZodOptional<z.ZodBoolean>;
253
+ }, z.core.$strict>>;
254
+ }, z.core.$strict>>;
255
+ }, z.core.$strict>;
256
+ };
257
+ readonly trackEvents: {
258
+ readonly method: "POST";
259
+ readonly path: "events";
260
+ readonly permission: "events:write";
261
+ readonly audience: "mixed";
262
+ readonly request: z.ZodObject<{
263
+ customerId: z.ZodOptional<z.ZodUUID>;
264
+ events: z.ZodArray<z.ZodObject<{
265
+ eventUuid: z.ZodUUID;
266
+ timestamp: z.ZodISODateTime;
267
+ name: z.ZodString;
268
+ properties: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
269
+ deviceId: z.ZodOptional<z.ZodString>;
270
+ sessionId: z.ZodOptional<z.ZodString>;
271
+ }, z.core.$strict>>;
272
+ }, z.core.$strict>;
273
+ readonly response: z.ZodObject<{
274
+ requestId: z.ZodUUID;
275
+ scope: z.ZodObject<{
276
+ projectId: z.ZodString;
277
+ environment: z.ZodEnum<{
278
+ sandbox: "sandbox";
279
+ live: "live";
280
+ }>;
281
+ }, z.core.$strict>;
282
+ inserted: z.ZodNumber;
283
+ duplicates: z.ZodNumber;
284
+ rejected: z.ZodNumber;
285
+ }, z.core.$strict>;
286
+ };
19
287
  readonly readBalanceSource: {
20
288
  readonly method: "POST";
21
289
  readonly path: "balances/source/read";
@@ -874,9 +1142,14 @@ declare const apiOperations: {
874
1142
  quantity: z.ZodNumber;
875
1143
  }, z.core.$strict>>;
876
1144
  remove: z.ZodArray<z.ZodString>;
1145
+ restoreItems: z.ZodOptional<z.ZodArray<z.ZodObject<{
1146
+ price: z.ZodString;
1147
+ quantity: z.ZodNumber;
1148
+ }, z.core.$strict>>>;
877
1149
  prorationBehavior: z.ZodOptional<z.ZodEnum<{
878
1150
  always_invoice: "always_invoice";
879
1151
  create_prorations: "create_prorations";
1152
+ none: "none";
880
1153
  }>>;
881
1154
  prorationDate: z.ZodOptional<z.ZodNumber>;
882
1155
  paymentBehavior: z.ZodOptional<z.ZodLiteral<"error_if_incomplete">>;
@@ -1067,9 +1340,14 @@ declare const apiOperations: {
1067
1340
  quantity: z.ZodNumber;
1068
1341
  }, z.core.$strict>>;
1069
1342
  remove: z.ZodArray<z.ZodString>;
1343
+ restoreItems: z.ZodOptional<z.ZodArray<z.ZodObject<{
1344
+ price: z.ZodString;
1345
+ quantity: z.ZodNumber;
1346
+ }, z.core.$strict>>>;
1070
1347
  prorationBehavior: z.ZodOptional<z.ZodEnum<{
1071
1348
  always_invoice: "always_invoice";
1072
1349
  create_prorations: "create_prorations";
1350
+ none: "none";
1073
1351
  }>>;
1074
1352
  prorationDate: z.ZodOptional<z.ZodNumber>;
1075
1353
  paymentBehavior: z.ZodOptional<z.ZodLiteral<"error_if_incomplete">>;
@@ -1260,9 +1538,14 @@ declare const apiOperations: {
1260
1538
  quantity: z.ZodNumber;
1261
1539
  }, z.core.$strict>>;
1262
1540
  remove: z.ZodArray<z.ZodString>;
1541
+ restoreItems: z.ZodOptional<z.ZodArray<z.ZodObject<{
1542
+ price: z.ZodString;
1543
+ quantity: z.ZodNumber;
1544
+ }, z.core.$strict>>>;
1263
1545
  prorationBehavior: z.ZodOptional<z.ZodEnum<{
1264
1546
  always_invoice: "always_invoice";
1265
1547
  create_prorations: "create_prorations";
1548
+ none: "none";
1266
1549
  }>>;
1267
1550
  prorationDate: z.ZodOptional<z.ZodNumber>;
1268
1551
  paymentBehavior: z.ZodOptional<z.ZodLiteral<"error_if_incomplete">>;
@@ -1453,9 +1736,14 @@ declare const apiOperations: {
1453
1736
  quantity: z.ZodNumber;
1454
1737
  }, z.core.$strict>>;
1455
1738
  remove: z.ZodArray<z.ZodString>;
1739
+ restoreItems: z.ZodOptional<z.ZodArray<z.ZodObject<{
1740
+ price: z.ZodString;
1741
+ quantity: z.ZodNumber;
1742
+ }, z.core.$strict>>>;
1456
1743
  prorationBehavior: z.ZodOptional<z.ZodEnum<{
1457
1744
  always_invoice: "always_invoice";
1458
1745
  create_prorations: "create_prorations";
1746
+ none: "none";
1459
1747
  }>>;
1460
1748
  prorationDate: z.ZodOptional<z.ZodNumber>;
1461
1749
  paymentBehavior: z.ZodOptional<z.ZodLiteral<"error_if_incomplete">>;
@@ -1640,9 +1928,9 @@ declare const apiOperations: {
1640
1928
  free: "free";
1641
1929
  }>>;
1642
1930
  status: z.ZodOptional<z.ZodEnum<{
1931
+ active: "active";
1643
1932
  refunded: "refunded";
1644
1933
  trial: "trial";
1645
- active: "active";
1646
1934
  past_due: "past_due";
1647
1935
  ended: "ended";
1648
1936
  }>>;
@@ -1664,8 +1952,8 @@ declare const apiOperations: {
1664
1952
  subscriptions: z.ZodObject<{
1665
1953
  items: z.ZodArray<z.ZodObject<{
1666
1954
  status: z.ZodEnum<{
1667
- trial: "trial";
1668
1955
  active: "active";
1956
+ trial: "trial";
1669
1957
  past_due: "past_due";
1670
1958
  ended: "ended";
1671
1959
  }>;
@@ -1708,9 +1996,9 @@ declare const apiOperations: {
1708
1996
  free: "free";
1709
1997
  }>>;
1710
1998
  status: z.ZodOptional<z.ZodEnum<{
1999
+ active: "active";
1711
2000
  refunded: "refunded";
1712
2001
  trial: "trial";
1713
- active: "active";
1714
2002
  past_due: "past_due";
1715
2003
  ended: "ended";
1716
2004
  }>>;
@@ -1732,8 +2020,8 @@ declare const apiOperations: {
1732
2020
  purchases: z.ZodObject<{
1733
2021
  items: z.ZodArray<z.ZodObject<{
1734
2022
  status: z.ZodEnum<{
1735
- refunded: "refunded";
1736
2023
  active: "active";
2024
+ refunded: "refunded";
1737
2025
  ended: "ended";
1738
2026
  }>;
1739
2027
  orderId: z.ZodNullable<z.ZodUUID>;
@@ -2832,6 +3120,11 @@ declare const apiOperations: {
2832
3120
  featureIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
2833
3121
  }, z.core.$strict>>;
2834
3122
  membershipIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
3123
+ prorationBehavior: z.ZodOptional<z.ZodEnum<{
3124
+ none: "none";
3125
+ prorate_immediately: "prorate_immediately";
3126
+ bill_difference: "bill_difference";
3127
+ }>>;
2835
3128
  timing: z.ZodEnum<{
2836
3129
  immediate: "immediate";
2837
3130
  renewal: "renewal";
@@ -2944,9 +3237,14 @@ declare const apiOperations: {
2944
3237
  quantity: z.ZodNumber;
2945
3238
  }, z.core.$strict>>;
2946
3239
  remove: z.ZodArray<z.ZodString>;
3240
+ restoreItems: z.ZodOptional<z.ZodArray<z.ZodObject<{
3241
+ price: z.ZodString;
3242
+ quantity: z.ZodNumber;
3243
+ }, z.core.$strict>>>;
2947
3244
  prorationBehavior: z.ZodOptional<z.ZodEnum<{
2948
3245
  always_invoice: "always_invoice";
2949
3246
  create_prorations: "create_prorations";
3247
+ none: "none";
2950
3248
  }>>;
2951
3249
  prorationDate: z.ZodOptional<z.ZodNumber>;
2952
3250
  paymentBehavior: z.ZodOptional<z.ZodLiteral<"error_if_incomplete">>;
@@ -3118,9 +3416,14 @@ declare const apiOperations: {
3118
3416
  quantity: z.ZodNumber;
3119
3417
  }, z.core.$strict>>;
3120
3418
  remove: z.ZodArray<z.ZodString>;
3419
+ restoreItems: z.ZodOptional<z.ZodArray<z.ZodObject<{
3420
+ price: z.ZodString;
3421
+ quantity: z.ZodNumber;
3422
+ }, z.core.$strict>>>;
3121
3423
  prorationBehavior: z.ZodOptional<z.ZodEnum<{
3122
3424
  always_invoice: "always_invoice";
3123
3425
  create_prorations: "create_prorations";
3426
+ none: "none";
3124
3427
  }>>;
3125
3428
  prorationDate: z.ZodOptional<z.ZodNumber>;
3126
3429
  paymentBehavior: z.ZodOptional<z.ZodLiteral<"error_if_incomplete">>;
@@ -3326,9 +3629,14 @@ declare const apiOperations: {
3326
3629
  quantity: z.ZodNumber;
3327
3630
  }, z.core.$strict>>;
3328
3631
  remove: z.ZodArray<z.ZodString>;
3632
+ restoreItems: z.ZodOptional<z.ZodArray<z.ZodObject<{
3633
+ price: z.ZodString;
3634
+ quantity: z.ZodNumber;
3635
+ }, z.core.$strict>>>;
3329
3636
  prorationBehavior: z.ZodOptional<z.ZodEnum<{
3330
3637
  always_invoice: "always_invoice";
3331
3638
  create_prorations: "create_prorations";
3639
+ none: "none";
3332
3640
  }>>;
3333
3641
  prorationDate: z.ZodOptional<z.ZodNumber>;
3334
3642
  paymentBehavior: z.ZodOptional<z.ZodLiteral<"error_if_incomplete">>;
@@ -3955,9 +4263,9 @@ declare const apiOperations: {
3955
4263
  }>;
3956
4264
  }, z.core.$strict>], "kind">;
3957
4265
  status: z.ZodEnum<{
4266
+ active: "active";
3958
4267
  revoked: "revoked";
3959
4268
  prepared: "prepared";
3960
- active: "active";
3961
4269
  blocked: "blocked";
3962
4270
  }>;
3963
4271
  createdAt: z.ZodISODateTime;
@@ -4509,9 +4817,9 @@ declare const apiOperations: {
4509
4817
  }>;
4510
4818
  }, z.core.$strict>], "kind">;
4511
4819
  status: z.ZodEnum<{
4820
+ active: "active";
4512
4821
  revoked: "revoked";
4513
4822
  prepared: "prepared";
4514
- active: "active";
4515
4823
  blocked: "blocked";
4516
4824
  }>;
4517
4825
  createdAt: z.ZodISODateTime;
@@ -4830,9 +5138,9 @@ declare const apiOperations: {
4830
5138
  }>;
4831
5139
  }, z.core.$strict>], "kind">;
4832
5140
  status: z.ZodEnum<{
5141
+ active: "active";
4833
5142
  revoked: "revoked";
4834
5143
  prepared: "prepared";
4835
- active: "active";
4836
5144
  blocked: "blocked";
4837
5145
  }>;
4838
5146
  createdAt: z.ZodISODateTime;
@@ -5380,9 +5688,9 @@ declare const apiOperations: {
5380
5688
  }>;
5381
5689
  }, z.core.$strict>], "kind">;
5382
5690
  status: z.ZodEnum<{
5691
+ active: "active";
5383
5692
  revoked: "revoked";
5384
5693
  prepared: "prepared";
5385
- active: "active";
5386
5694
  blocked: "blocked";
5387
5695
  }>;
5388
5696
  createdAt: z.ZodISODateTime;
@@ -5648,11 +5956,11 @@ declare const apiOperations: {
5648
5956
  entityId: z.ZodNullable<z.ZodUUID>;
5649
5957
  topN: z.ZodNullable<z.ZodNumber>;
5650
5958
  groupBy: z.ZodUnion<readonly [z.ZodEnum<{
5959
+ source: "source";
5651
5960
  customer: "customer";
5652
5961
  plan: "plan";
5653
5962
  entity: "entity";
5654
5963
  entitlement: "entitlement";
5655
- source: "source";
5656
5964
  resource: "resource";
5657
5965
  dimension: "dimension";
5658
5966
  }>, z.ZodString]>;
@@ -5780,10 +6088,10 @@ declare const apiOperations: {
5780
6088
  customerId: z.ZodUUID;
5781
6089
  idempotencyKey: z.ZodString;
5782
6090
  status: z.ZodEnum<{
6091
+ rejected: "rejected";
5783
6092
  failed: "failed";
5784
6093
  accepted: "accepted";
5785
6094
  queued: "queued";
5786
- rejected: "rejected";
5787
6095
  }>;
5788
6096
  receipt: z.ZodNullable<z.ZodObject<{
5789
6097
  id: z.ZodUUID;
@@ -6923,12 +7231,12 @@ declare const apiOperations: {
6923
7231
  }>;
6924
7232
  status: z.ZodEnum<{
6925
7233
  unknown: "unknown";
7234
+ active: "active";
6926
7235
  pending: "pending";
6927
7236
  trialing: "trialing";
6928
7237
  expired: "expired";
6929
7238
  scheduled: "scheduled";
6930
7239
  trial: "trial";
6931
- active: "active";
6932
7240
  past_due: "past_due";
6933
7241
  ended: "ended";
6934
7242
  paused: "paused";
@@ -7023,9 +7331,9 @@ declare const apiOperations: {
7023
7331
  customerId: z.ZodOptional<z.ZodUUID>;
7024
7332
  query: z.ZodObject<{
7025
7333
  type: z.ZodNullable<z.ZodEnum<{
7334
+ source: "source";
7026
7335
  usage: "usage";
7027
7336
  invoice: "invoice";
7028
- source: "source";
7029
7337
  debt: "debt";
7030
7338
  transaction: "transaction";
7031
7339
  settlement: "settlement";
@@ -7042,9 +7350,9 @@ declare const apiOperations: {
7042
7350
  at: z.ZodISODateTime;
7043
7351
  id: z.ZodUUID;
7044
7352
  type: z.ZodEnum<{
7353
+ source: "source";
7045
7354
  usage: "usage";
7046
7355
  invoice: "invoice";
7047
- source: "source";
7048
7356
  debt: "debt";
7049
7357
  transaction: "transaction";
7050
7358
  settlement: "settlement";
@@ -7121,10 +7429,10 @@ declare const apiOperations: {
7121
7429
  quantity: z.ZodString;
7122
7430
  unlimited: z.ZodBoolean;
7123
7431
  status: z.ZodEnum<{
7432
+ active: "active";
7124
7433
  revoked: "revoked";
7125
7434
  expired: "expired";
7126
7435
  scheduled: "scheduled";
7127
- active: "active";
7128
7436
  unavailable: "unavailable";
7129
7437
  }>;
7130
7438
  startsAt: z.ZodISODateTime;
@@ -7330,9 +7638,9 @@ declare const apiOperations: {
7330
7638
  at: z.ZodISODateTime;
7331
7639
  id: z.ZodUUID;
7332
7640
  type: z.ZodEnum<{
7641
+ source: "source";
7333
7642
  usage: "usage";
7334
7643
  invoice: "invoice";
7335
- source: "source";
7336
7644
  debt: "debt";
7337
7645
  transaction: "transaction";
7338
7646
  settlement: "settlement";
@@ -8735,16 +9043,16 @@ declare const apiOperations: {
8735
9043
  versionId: z.ZodDefault<z.ZodString>;
8736
9044
  holdingStatus: z.ZodDefault<z.ZodEnum<{
8737
9045
  "": "";
9046
+ active: "active";
8738
9047
  expired: "expired";
8739
9048
  scheduled: "scheduled";
8740
9049
  none: "none";
8741
- active: "active";
8742
9050
  unavailable: "unavailable";
8743
9051
  }>>;
8744
9052
  membershipStatus: z.ZodDefault<z.ZodEnum<{
8745
9053
  "": "";
8746
- trial: "trial";
8747
9054
  active: "active";
9055
+ trial: "trial";
8748
9056
  past_due: "past_due";
8749
9057
  ended: "ended";
8750
9058
  }>>;
@@ -9269,6 +9577,9 @@ type ApiOperation = keyof typeof apiOperations;
9269
9577
  type ApiInput<K extends ApiOperation> = z.input<(typeof apiOperations)[K]["request"]>;
9270
9578
  type ApiOutput<K extends ApiOperation> = z.output<(typeof apiOperations)[K]["response"]>;
9271
9579
  interface FoundationApi {
9580
+ getFeatures(): Promise<ApiOutput<"getFeatures">>;
9581
+ evaluateFeatures(input: ApiInput<"evaluateFeatures">): Promise<ApiOutput<"evaluateFeatures">>;
9582
+ trackEvents(input: ApiInput<"trackEvents">): Promise<ApiOutput<"trackEvents">>;
9272
9583
  resolvePaywall(input: ApiInput<"resolvePaywall">): Promise<ApiOutput<"resolvePaywall">>;
9273
9584
  resolveOffering(input: ApiInput<"resolveOffering">): Promise<ApiOutput<"resolveOffering">>;
9274
9585
  setupPayment(input: ApiInput<"setupPayment"> & {
@@ -0,0 +1 @@
1
+ import{Y as S,_b as C,gc as k,jc as L,mc as T,nc as v,oc as j,rc as R,ui as V}from"./chunk-D37O6FAW.js";var U={name:"@tinkerlandai/indiana-sdk",version:"0.3.1",description:"Framework-independent Indiana SDK for customer identity, entitlements, credits, offers and growth surfaces.",license:"UNLICENSED",repository:{type:"git",url:"git+https://github.com/tinkerlandai/Indiana.git",directory:"packages/sdk"},engines:{node:">=22"},publishConfig:{access:"public",tag:"beta"},type:"module",sideEffects:!1,files:["dist","README.md","README.zh-CN.md","CHANGELOG.md","THIRD_PARTY_NOTICES.md"],exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./popup":{types:"./dist/popup.d.ts",import:"./dist/popup.js"},"./server":{types:"./dist/server.d.ts",import:"./dist/server.js"},"./openrouter":{types:"./dist/openrouter.d.ts",import:"./dist/openrouter.js"},"./native-shell":{types:"./dist/native-shell.d.ts",import:"./dist/native-shell.js"},"./page":{types:"./dist/page.d.ts",import:"./dist/page.js"}},scripts:{build:"tsup",prepack:"pnpm run build",typecheck:"tsc --noEmit"},dependencies:{"@ai-sdk/provider":"4.0.26","@types/json-schema":"7.0.15","css-tree":"^3.2.1",dompurify:"^3.4.15",zod:"4.6.5"},devDependencies:{"@indiana/contracts":"workspace:*","@openrouter/sdk":"^1.4.25","@types/css-tree":"^3.2.0",ai:"7.0.136",tsup:"^8.5.1",typescript:"^5.9.3"},peerDependencies:{"@openrouter/sdk":"^1.4.25"},peerDependenciesMeta:{"@openrouter/sdk":{optional:!0}}};var e=class extends Error{constructor(h,d,n,N,i){super(d);this.code=h;this.status=n;this.requestId=N;this.name="IndianaError",this.reason=i?.reason;let c=T(h,n??0,{...i,retryAfter:i?.retryAfterSeconds===void 0?void 0:String(i.retryAfterSeconds)});this.retryable=c.retryable,this.recovery=c.recovery,this.retryAfterSeconds=c.retryAfterSeconds}code;status;requestId;retryable;recovery;retryAfterSeconds;reason},$=Symbol("IndianaNoContent");function J(l,A){let h=l.webView??"hosted";if(!["hosted","embedded"].includes(h))throw new e("INVALID_REQUEST","Invalid Web View mode");let d=l.scope?S.parse(l.scope):void 0,n=new URL(l.baseUrl);if(n.username||n.password||n.search||n.hash)throw new e("INVALID_URL","baseUrl must not contain credentials, query, or fragment");if(n.protocol!=="https:"&&!(n.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(n.hostname)))throw new e("INVALID_URL","Use HTTPS, or HTTP on localhost during development");let N=l.fetch??globalThis.fetch.bind(globalThis),i=l.timeoutMs??1e4;if(!Number.isFinite(i)||i<=0||i>12e4)throw new e("INVALID_TIMEOUT","timeoutMs must be between 1 and 120000");let c=null,b,u=0,p=null,f=new Set;function D(){u+=1,c=null,p=null;for(let s of f)s.abort();f.clear()}async function M(s,q={},O="POST",H={}){if(!c)throw new e("NOT_IDENTIFIED","Call identify with a server-issued customer token first");let g=u,o=new AbortController;f.add(o);let y=()=>g!==u?new e("IDENTITY_CHANGED","Customer identity changed while the request was in flight"):new e("TIMEOUT","Indiana request timed out"),I,x=new Promise((r,a)=>{I=()=>a(y()),o.signal.addEventListener("abort",I,{once:!0})}),K=setTimeout(()=>o.abort(),i),G=async()=>{let r=await N(`${n.href.replace(/\/$/,"")}/api/v1/${s}`,{method:O,headers:{"Content-Type":"application/json",Authorization:`Bearer ${c}`,[v]:R.current,[j]:U.version,...d?{"X-Indiana-Project":d.projectId,"X-Indiana-Environment":d.environment}:{}},body:O==="POST"?JSON.stringify(q):void 0,signal:o.signal,credentials:"omit",cache:"no-store",redirect:"error",...H.keepalive?{keepalive:!0}:{}});if(o.signal.aborted)throw y();let a;try{a=r.status===204?$:await r.json()}catch{throw o.signal.aborted?y():new e(r.ok?"INVALID_RESPONSE":"HTTP_ERROR","The gateway returned an unreadable response",r.status,r.headers.get("X-Request-Id")??void 0)}if(o.signal.aborted)throw y();if(g!==u)throw new e("IDENTITY_CHANGED","Customer identity changed while the request was in flight");if(!r.ok){let t=L.safeParse(a),m=t.success&&(!C.safeParse(t.data.error.code).success||k(t.data.error.code,r.status)),_=m?t.data.error.code:"HTTP_ERROR",P=T(_,r.status,{retryAfter:r.headers.get("Retry-After"),recovery:m?t.data.error.recovery:void 0,reason:m?t.data.error.reason:void 0});throw new e(_,m?t.data.error.message:"Indiana request failed",r.status,r.headers.get("X-Request-Id")??(t.success?t.data.requestId:void 0),{...P,...t.success&&t.data.error.retryable===!1?{retryable:!1}:{},...P.retryAfterSeconds===void 0&&t.success&&t.data.error.retryAfterSeconds!==void 0?{retryAfterSeconds:t.data.error.retryAfterSeconds}:{}})}if(r.headers.get(v)!==R.current)throw new e("PROTOCOL_MISMATCH","Response protocol does not match this SDK");if(d&&a&&typeof a=="object"&&"scope"in a){let t=S.safeParse(a.scope);if(!t.success||t.data.projectId!==d.projectId||t.data.environment!==d.environment)throw new e("SCOPE_MISMATCH","Response scope does not match this SDK instance")}let E=r.headers.get("X-Indiana-Web-View");if(E){if(!/^\/web-view\/renderer\/[a-f0-9]{64}$/.test(E))throw new e("INVALID_RESPONSE","Invalid Web View renderer metadata");b=E}let w=r.headers.get("X-Indiana-Telemetry-Subject");if(w){if(!/^[a-f0-9]{64}$/.test(w))throw new e("INVALID_RESPONSE","Invalid telemetry identity");p!==w&&(p=w,A?.(p))}return a};try{return await Promise.race([G(),x])}catch(r){throw g!==u?new e("IDENTITY_CHANGED","Customer identity changed while the request was in flight"):r instanceof e?r:new e(o.signal.aborted?"TIMEOUT":"NETWORK_ERROR",o.signal.aborted?"Indiana request timed out":"Unable to read the Indiana response")}finally{clearTimeout(K),o.signal.removeEventListener("abort",I),f.delete(o)}}return{subjectKey:()=>p,screenUrl(s){if(!V.safeParse(s).success)throw new e("INVALID_RESPONSE","Invalid published screen render address");return new URL(s,n).href},webViewUrl(){if(h!=="embedded"){if(!b)throw new e("INVALID_RESPONSE","The gateway did not provide a hosted Web View renderer");return new URL(b,n).href}},identify(s){if(!s.trim()||/\s/.test(s)||s.length>4096)throw new e("INVALID_TOKEN","A nonempty server-issued token is required");D(),c=s},reset:D,request:M}}export{e as a,J as b};