@tinkerlandai/indiana-sdk 0.0.1 → 0.2.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/server.d.ts CHANGED
@@ -1,766 +1,5 @@
1
- import * as zod from 'zod';
2
- import { z } from 'zod';
3
- import { b as GrooveError, a as FeatureClientOptions, J as JsonValue, d as FeatureResult, G as GrooveOptions, S as Scope } from './feature-client-CyYevYy2.js';
4
- export { F as FeatureClient, c as createFeatureClient } from './feature-client-CyYevYy2.js';
5
- import { F as FoundationApi } from './api-DDlcUvTv.js';
6
- import { b as FunnelCommand, F as FunnelRuntimeResponse, S as StackNode } from './funnel-runtime-C05ZECiP.js';
7
- export { d as AiPricingOptions, b as AiTokenQuote, a as AiTokenUsage, A as AiUsageContext, e as AiUsageMiddlewareOptions, f as AiUsageRecord, g as aiPriceSnapshotSchema, h as aiTokenQuoteSchema, c as createAiPricing, i as createAiUsageMiddleware, j as createConfiguredAiPricing } from './ai-usage-CzA11PV5.js';
1
+ import 'zod';
2
+ export { e as FeatureClient, f as FeatureClientOptions, n as FunnelDecisionInput, o as FunnelDecisionTimeoutError, p as FunnelDecisionUsedInput, g as FunnelNodeEvaluationContext, q as FunnelSignalInput, d as FunnelStartInput, h as IndianaError, r as IndianaServerOptions, k as createFeatureClient, s as createFunnelCampaignClient, t as createFunnelDecisionClient, u as createFunnelOrchestrationClient, v as createFunnelStartClient, w as createGuestToken, x as createIndianaServer, y as createNativeReceiptClient, z as createPaywallStartClient, m as evaluateFunnelNode, A as renewFunnelRun } from './funnel-runtime-start-DvrWekm0.js';
3
+ export { e as AiPricingOptions, d as AiTokenQuote, b as AiTokenUsage, a as AiUsageContext, f as AiUsageMiddlewareOptions, g as AiUsageRecord, h as aiPriceSnapshotSchema, i as aiTokenQuoteSchema, c as createAiPricing, j as createAiUsageMiddleware, k as createConfiguredAiPricing } from './ai-usage-CO0lDavO.js';
4
+ import './screen-DfuSw6Tz.js';
8
5
  import '@ai-sdk/provider';
9
-
10
- declare const funnelDecisionSchema: z.ZodObject<{
11
- requestId: z.ZodUUID;
12
- decisionId: z.ZodUUID;
13
- customerId: z.ZodUUID;
14
- assignmentId: z.ZodUUID;
15
- evaluationVersionId: z.ZodUUID;
16
- policyVersionId: z.ZodUUID;
17
- value: z.ZodJSONSchema;
18
- state: z.ZodEnum<{
19
- inactive: "inactive";
20
- expired: "expired";
21
- active: "active";
22
- }>;
23
- validUntil: z.ZodNullable<z.ZodISODateTime>;
24
- }, z.core.$strict>;
25
- declare const funnelDecisionCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
26
- operation: z.ZodLiteral<"decide">;
27
- funnelId: z.ZodUUID;
28
- requestId: z.ZodUUID;
29
- customerId: z.ZodUUID;
30
- attributes: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
31
- }, z.core.$strict>, z.ZodObject<{
32
- operation: z.ZodLiteral<"read_decision">;
33
- decisionId: z.ZodUUID;
34
- }, z.core.$strict>, z.ZodObject<{
35
- operation: z.ZodLiteral<"feature_config">;
36
- funnelId: z.ZodUUID;
37
- }, z.core.$strict>, z.ZodObject<{
38
- operation: z.ZodLiteral<"report_used">;
39
- decisionId: z.ZodUUID;
40
- eventId: z.ZodUUID;
41
- occurredAt: z.ZodISODateTime;
42
- reference: z.ZodOptional<z.ZodString>;
43
- }, z.core.$strict>], "operation">;
44
- type FunnelDecision = z.infer<typeof funnelDecisionSchema>;
45
- type FunnelDecisionCommand = z.infer<typeof funnelDecisionCommandSchema>;
46
-
47
- /** Current order recovery is independent of a Funnel run credential. The trusted backend supplies its API key. */
48
- declare const nativeReceiptCommandSchema: z.ZodObject<{
49
- operation: z.ZodLiteral<"native_receipt">;
50
- requestId: z.ZodUUID;
51
- customerToken: z.ZodString;
52
- orderId: z.ZodUUID;
53
- receiptId: z.ZodUUID;
54
- nativeEvidence: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
55
- provider: z.ZodLiteral<"apple">;
56
- orderId: z.ZodUUID;
57
- receiptId: z.ZodUUID;
58
- signedTransaction: z.ZodString;
59
- }, z.core.$strict>, z.ZodObject<{
60
- provider: z.ZodLiteral<"google">;
61
- orderId: z.ZodUUID;
62
- receiptId: z.ZodUUID;
63
- purchaseToken: z.ZodString;
64
- }, z.core.$strict>], "provider">>;
65
- }, z.core.$strict>;
66
- type NativeReceiptCommand = z.infer<typeof nativeReceiptCommandSchema>;
67
-
68
- declare const funnelOrchestrationCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
69
- operation: z.ZodLiteral<"signal">;
70
- runId: z.ZodUUID;
71
- nodeId: z.ZodString;
72
- eventName: z.ZodString;
73
- eventId: z.ZodUUID;
74
- data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
75
- }, z.core.$strict>, z.ZodObject<{
76
- operation: z.ZodLiteral<"read_results">;
77
- runId: z.ZodUUID;
78
- }, z.core.$strict>], "operation">;
79
- type FunnelOrchestrationCommand = z.infer<typeof funnelOrchestrationCommandSchema>;
80
-
81
- type Start = Extract<FunnelCommand, {
82
- operation: "start";
83
- }>;
84
- type FunnelStartInput = Omit<Start, "operation">;
85
- /**
86
- * Trusted host start. The host persists requestId before calling; retries reuse the entire input.
87
- * customerToken is required: an identified customer session, or a guest session from resumeGuestSession.
88
- */
89
- declare function createFunnelStartClient(options: GrooveServerOptions): {
90
- start(input: FunnelStartInput): Promise<FunnelRuntimeResponse & {
91
- runToken: string;
92
- }>;
93
- };
94
-
95
- type FunnelDecisionInput = Omit<Extract<FunnelDecisionCommand, {
96
- operation: "decide";
97
- }>, "operation" | "funnelId">;
98
- type FunnelDecisionUsedInput = Omit<Extract<FunnelDecisionCommand, {
99
- operation: "report_used";
100
- }>, "operation">;
101
- declare class FunnelDecisionTimeoutError extends GrooveError {
102
- readonly decisionId: string;
103
- readonly decisionRequestId: string;
104
- constructor(decisionId: string, decisionRequestId: string);
105
- }
106
- declare function createFunnelDecisionClient(options: GrooveServerOptions & {
107
- funnelId: string;
108
- }): {
109
- features(input?: Omit<FeatureClientOptions, "load" | "scope" | "funnelId">): {
110
- init: () => Promise<{
111
- scope: {
112
- projectId: string;
113
- environment: "sandbox" | "live";
114
- };
115
- funnelId: string;
116
- versionId: string;
117
- expiresAt: string | null;
118
- features: Record<string, {
119
- defaultValue: zod.JSONType;
120
- rules: {
121
- force?: zod.JSONType | undefined;
122
- variations?: zod.JSONType[] | undefined;
123
- weights?: number[] | undefined;
124
- key?: string | undefined;
125
- hashAttribute?: string | undefined;
126
- fallbackAttribute?: string | undefined;
127
- hashVersion?: 2 | undefined;
128
- disableStickyBucketing?: boolean | undefined;
129
- bucketVersion?: number | undefined;
130
- minBucketVersion?: number | undefined;
131
- coverage?: number | undefined;
132
- seed?: string | undefined;
133
- range?: [number, number] | undefined;
134
- ranges?: [number, number][] | undefined;
135
- meta?: {
136
- key: string;
137
- name?: string | undefined;
138
- passthrough?: boolean | undefined;
139
- }[] | undefined;
140
- name?: string | undefined;
141
- phase?: string | undefined;
142
- id?: string | undefined;
143
- condition?: Record<string, zod.JSONType> | undefined;
144
- parentConditions?: {
145
- id: string;
146
- condition: Record<string, zod.JSONType>;
147
- gate?: boolean | undefined;
148
- }[] | undefined;
149
- filters?: {
150
- seed: string;
151
- hashVersion: 2;
152
- ranges: [number, number][];
153
- attribute?: string | undefined;
154
- }[] | undefined;
155
- }[];
156
- }>;
157
- savedGroups: Record<string, {
158
- type: "condition";
159
- condition: Record<string, zod.JSONType>;
160
- } | {
161
- type: "list";
162
- attributeKey: string;
163
- values: (string | number)[];
164
- }>;
165
- }>;
166
- refresh: () => Promise<{
167
- scope: {
168
- projectId: string;
169
- environment: "sandbox" | "live";
170
- };
171
- funnelId: string;
172
- versionId: string;
173
- expiresAt: string | null;
174
- features: Record<string, {
175
- defaultValue: zod.JSONType;
176
- rules: {
177
- force?: zod.JSONType | undefined;
178
- variations?: zod.JSONType[] | undefined;
179
- weights?: number[] | undefined;
180
- key?: string | undefined;
181
- hashAttribute?: string | undefined;
182
- fallbackAttribute?: string | undefined;
183
- hashVersion?: 2 | undefined;
184
- disableStickyBucketing?: boolean | undefined;
185
- bucketVersion?: number | undefined;
186
- minBucketVersion?: number | undefined;
187
- coverage?: number | undefined;
188
- seed?: string | undefined;
189
- range?: [number, number] | undefined;
190
- ranges?: [number, number][] | undefined;
191
- meta?: {
192
- key: string;
193
- name?: string | undefined;
194
- passthrough?: boolean | undefined;
195
- }[] | undefined;
196
- name?: string | undefined;
197
- phase?: string | undefined;
198
- id?: string | undefined;
199
- condition?: Record<string, zod.JSONType> | undefined;
200
- parentConditions?: {
201
- id: string;
202
- condition: Record<string, zod.JSONType>;
203
- gate?: boolean | undefined;
204
- }[] | undefined;
205
- filters?: {
206
- seed: string;
207
- hashVersion: 2;
208
- ranges: [number, number][];
209
- attribute?: string | undefined;
210
- }[] | undefined;
211
- }[];
212
- }>;
213
- savedGroups: Record<string, {
214
- type: "condition";
215
- condition: Record<string, zod.JSONType>;
216
- } | {
217
- type: "list";
218
- attributeKey: string;
219
- values: (string | number)[];
220
- }>;
221
- }>;
222
- readonly versionId: string | null;
223
- setAttributes(attributes: Record<string, JsonValue>): void;
224
- evalFeature: (key: string) => FeatureResult<JsonValue>;
225
- getFeatureValue(key: string, fallback: JsonValue): JsonValue;
226
- reset(): void;
227
- };
228
- read: (decisionId: string) => Promise<{
229
- scope: {
230
- projectId: string;
231
- environment: "sandbox" | "live";
232
- };
233
- decisionId: string;
234
- requestId: string;
235
- status: "pending" | "failed" | "completed";
236
- decision: {
237
- requestId: string;
238
- decisionId: string;
239
- customerId: string;
240
- assignmentId: string;
241
- evaluationVersionId: string;
242
- policyVersionId: string;
243
- value: zod.JSONType;
244
- state: "expired" | "active" | "inactive";
245
- validUntil: string | null;
246
- } | null;
247
- }>;
248
- /** Accept once and return its current state without waiting for completion. */
249
- submit(input: FunnelDecisionInput): Promise<{
250
- scope: {
251
- projectId: string;
252
- environment: "sandbox" | "live";
253
- };
254
- decisionId: string;
255
- requestId: string;
256
- status: "pending" | "failed" | "completed";
257
- decision: {
258
- requestId: string;
259
- decisionId: string;
260
- customerId: string;
261
- assignmentId: string;
262
- evaluationVersionId: string;
263
- policyVersionId: string;
264
- value: zod.JSONType;
265
- state: "expired" | "active" | "inactive";
266
- validUntil: string | null;
267
- } | null;
268
- }>;
269
- decide(input: FunnelDecisionInput): Promise<FunnelDecision>;
270
- reportUsed(input: FunnelDecisionUsedInput): Promise<{
271
- scope: {
272
- projectId: string;
273
- environment: "sandbox" | "live";
274
- };
275
- decisionId: string;
276
- eventId: string;
277
- source: "caller_reported";
278
- }>;
279
- };
280
-
281
- /** Call from the integrating app's authenticated backend. Never ship its API key to a device. */
282
- declare function createNativeReceiptClient(options: GrooveServerOptions): {
283
- recover(input: NativeReceiptCommand): Promise<{
284
- scope: {
285
- projectId: string;
286
- environment: "sandbox" | "live";
287
- };
288
- requestId: string;
289
- orderId: string;
290
- receiptId: string;
291
- orderStatus: "created" | "pending" | "trialing" | "paid" | "cancelled" | "failed";
292
- refunded: boolean;
293
- nativeCompletion?: {
294
- orderId: string;
295
- receiptId: string;
296
- transactionIds: string[];
297
- membership: boolean;
298
- } | undefined;
299
- }>;
300
- };
301
-
302
- type FunnelSignalInput = Omit<Extract<FunnelOrchestrationCommand, {
303
- operation: "signal";
304
- }>, "operation">;
305
- /** Custom receipts are optional application facts. They cannot assert verified payment. */
306
- declare function createFunnelOrchestrationClient(options: GrooveServerOptions): {
307
- signal(input: FunnelSignalInput): Promise<{
308
- scope: {
309
- projectId: string;
310
- environment: "sandbox" | "live";
311
- };
312
- runId: string;
313
- eventId: string;
314
- accepted: boolean;
315
- }>;
316
- readResults(runId: string): Promise<{
317
- scope: {
318
- projectId: string;
319
- environment: "sandbox" | "live";
320
- };
321
- runId: string;
322
- results: Record<string, zod.JSONType>;
323
- }>;
324
- };
325
-
326
- /** Generate on the trusted host and retain in its HttpOnly cookie; reuse for creation retries. */
327
- declare function createGuestToken(): string;
328
- interface GrooveServerOptions extends GrooveOptions {
329
- apiKey: string;
330
- scope: Scope;
331
- }
332
- declare function createGrooveServer(options: GrooveServerOptions): FoundationApi;
333
-
334
- /** Rotate short-lived browser access without starting or authorizing another run. */
335
- declare function renewFunnelRun(options: GrooveServerOptions, input: {
336
- runId: string;
337
- customerId: string;
338
- }): Promise<{
339
- scope: {
340
- projectId: string;
341
- environment: "sandbox" | "live";
342
- };
343
- run: {
344
- id: string;
345
- funnelId: string;
346
- versionId: string;
347
- revision: number;
348
- visit: number;
349
- nodeId: string;
350
- nodeType: "action" | "split" | "end" | "feature" | "checkout" | "condition" | "screen" | "entry" | "auth" | "wait";
351
- status: "failed" | "running" | "completed" | "closed" | "ineligible" | "waiting";
352
- canBack: boolean;
353
- authenticated: boolean;
354
- locale: string;
355
- commerce: {
356
- provider: "apple" | "google" | "stripe";
357
- currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
358
- } | null;
359
- checkout: {
360
- product: {
361
- type: "picker";
362
- pickerId: string;
363
- allowedProductVersionIds: string[];
364
- } | {
365
- type: "fixed";
366
- productVersionId: string;
367
- };
368
- selectedProductVersionId: string | null;
369
- } | null;
370
- answers: Record<string, string | boolean | string[]>;
371
- parameters: Record<string, zod.JSONType>;
372
- screen: {
373
- id: string;
374
- document: {
375
- kind: "screen";
376
- schemaVersion: 3;
377
- name: string;
378
- surface: "popup" | "page" | "paywall" | "onboarding";
379
- presentation: {
380
- type: "modal";
381
- size: "sm" | "md" | "lg";
382
- } | {
383
- type: "sheet";
384
- size: "sm" | "md" | "lg";
385
- } | {
386
- type: "fullscreen";
387
- };
388
- theme: {
389
- primary: string;
390
- background: string;
391
- text: string;
392
- radius: "none" | "full" | "sm" | "md" | "lg";
393
- font: "system" | "serif" | "rounded" | "mono";
394
- };
395
- pages: {
396
- id: string;
397
- name: string;
398
- root: StackNode;
399
- theme?: {
400
- primary: string;
401
- background: string;
402
- text: string;
403
- radius: "none" | "full" | "sm" | "md" | "lg";
404
- font: "system" | "serif" | "rounded" | "mono";
405
- } | undefined;
406
- editorPosition?: {
407
- x: number;
408
- y: number;
409
- } | undefined;
410
- }[];
411
- strings: {
412
- defaultLocale: string;
413
- locales: Record<string, Record<string, string>>;
414
- };
415
- actions: ({
416
- type: "event";
417
- close: boolean;
418
- id: string;
419
- event: string;
420
- properties: Record<string, string | number | boolean | null>;
421
- } | {
422
- type: "close";
423
- close: true;
424
- id: string;
425
- event: string;
426
- properties: Record<string, string | number | boolean | null>;
427
- } | {
428
- type: "open_url";
429
- close: boolean;
430
- url: string;
431
- id: string;
432
- event: string;
433
- properties: Record<string, string | number | boolean | null>;
434
- } | {
435
- type: "claim_offer";
436
- close: boolean;
437
- couponId: string;
438
- id: string;
439
- event: string;
440
- properties: Record<string, string | number | boolean | null>;
441
- })[];
442
- };
443
- presentation: {
444
- type: "modal";
445
- size: "sm" | "md" | "lg";
446
- } | {
447
- type: "sheet";
448
- size: "sm" | "md" | "lg";
449
- } | {
450
- type: "fullscreen";
451
- } | {
452
- type: "inline";
453
- };
454
- outputs: string[];
455
- inputs: {
456
- key: string;
457
- componentId: string;
458
- required: boolean;
459
- }[];
460
- capabilities: {
461
- nodes: Record<string, {
462
- base: {
463
- text?: string | undefined;
464
- label?: string | undefined;
465
- alt?: string | undefined;
466
- html?: string | undefined;
467
- price?: {
468
- current: string;
469
- original: string | null;
470
- period: string;
471
- } | undefined;
472
- code?: string | undefined;
473
- countdownAt?: string | undefined;
474
- planId?: string | undefined;
475
- planVersionId?: string | undefined;
476
- currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
477
- couponId?: string | undefined;
478
- offerId?: string | undefined;
479
- unavailable?: boolean | undefined;
480
- unavailableReason?: string | undefined;
481
- missing?: string[] | undefined;
482
- };
483
- picker?: string | undefined;
484
- byPlan?: Record<string, {
485
- text?: string | undefined;
486
- label?: string | undefined;
487
- alt?: string | undefined;
488
- html?: string | undefined;
489
- price?: {
490
- current: string;
491
- original: string | null;
492
- period: string;
493
- } | undefined;
494
- code?: string | undefined;
495
- countdownAt?: string | undefined;
496
- planId?: string | undefined;
497
- planVersionId?: string | undefined;
498
- currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
499
- couponId?: string | undefined;
500
- offerId?: string | undefined;
501
- unavailable?: boolean | undefined;
502
- unavailableReason?: string | undefined;
503
- missing?: string[] | undefined;
504
- }> | undefined;
505
- }>;
506
- plans: Record<string, {
507
- id: string;
508
- versionId: string;
509
- name: string;
510
- price: string;
511
- period: string;
512
- currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
513
- }>;
514
- pickers: Record<string, {
515
- options: string[];
516
- selected: string | null;
517
- }>;
518
- diagnostics: {
519
- nodeId: string;
520
- message: string;
521
- }[];
522
- };
523
- customerData: {
524
- nodes: Record<string, {
525
- source: "membership" | "credit_balance" | "credit_transactions" | "billing" | "billing_controls" | "customer_plans" | "credit_packs" | "credit_pack_orders" | "offer_history";
526
- status: "error" | "ready" | "idle" | "loading";
527
- stale: boolean;
528
- preview: boolean;
529
- resources: {
530
- key: string;
531
- name: string;
532
- spendable: string;
533
- reserved: string;
534
- available: string;
535
- expiry: string | null;
536
- sources: {
537
- id: string;
538
- label: string;
539
- detail: string[];
540
- facts: {
541
- label: string;
542
- value: string;
543
- }[];
544
- value?: string | undefined;
545
- status?: string | undefined;
546
- purchaseId?: string | undefined;
547
- invoiceUrl?: string | undefined;
548
- billingActions?: {
549
- action: "invoice_open";
550
- label: string;
551
- }[] | undefined;
552
- membershipActions?: {
553
- value: string;
554
- label: string;
555
- }[] | undefined;
556
- }[];
557
- sourceCount: number;
558
- sourcePage: number;
559
- hasNextSources: boolean;
560
- hasPreviousSources: boolean;
561
- }[];
562
- rows: {
563
- id: string;
564
- label: string;
565
- detail: string[];
566
- facts: {
567
- label: string;
568
- value: string;
569
- }[];
570
- value?: string | undefined;
571
- status?: string | undefined;
572
- purchaseId?: string | undefined;
573
- invoiceUrl?: string | undefined;
574
- billingActions?: {
575
- action: "invoice_open";
576
- label: string;
577
- }[] | undefined;
578
- membershipActions?: {
579
- value: string;
580
- label: string;
581
- }[] | undefined;
582
- }[];
583
- hasNext: boolean;
584
- hasPrevious: boolean;
585
- page: number;
586
- filter: string;
587
- errorCode?: string | undefined;
588
- errorMessage?: string | undefined;
589
- updatedAt?: string | undefined;
590
- buyingId?: string | undefined;
591
- membershipBusy?: boolean | undefined;
592
- billingBusy?: boolean | undefined;
593
- membershipReview?: {
594
- title: string;
595
- note: string;
596
- facts: {
597
- label: string;
598
- value: string;
599
- }[];
600
- } | undefined;
601
- membershipResult?: string | undefined;
602
- }>;
603
- };
604
- dataCursors: Record<string, {
605
- kind: "ledger";
606
- cursor: {
607
- at: string;
608
- id: string;
609
- type: "source" | "usage" | "debt" | "transaction" | "settlement";
610
- };
611
- } | {
612
- kind: "billing";
613
- cursor: string;
614
- } | null>;
615
- } | null;
616
- instruction: {
617
- type: "native_purchase";
618
- receiptId: string;
619
- orderId: string;
620
- productVersionId: string;
621
- provider: "apple" | "google";
622
- productId: string;
623
- productKind: "lifetime" | "membership" | "credit_pack";
624
- replacement: {
625
- sourceOrderId: string;
626
- sourceProductId: string;
627
- policy: "apple_store" | "google_full_price";
628
- sourceAccountTokens: string[];
629
- } | null;
630
- offerKind: "none" | "introductory" | "promotional";
631
- currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
632
- catalogAmountMinor: number;
633
- discountMinor: number;
634
- trialDays: number | null;
635
- seatBundle: {
636
- key: string;
637
- quantity: number;
638
- }[];
639
- applePromotionalOffer: {
640
- offerId: string;
641
- keyId: string;
642
- nonce: string;
643
- signature: string;
644
- timestamp: number;
645
- } | null;
646
- appAccountToken?: string | undefined;
647
- obfuscatedAccountId?: string | undefined;
648
- obfuscatedProfileId?: string | undefined;
649
- basePlanId?: string | undefined;
650
- offerId?: string | undefined;
651
- } | {
652
- type: "confirm_membership_change";
653
- changeKind: "seats" | "plan";
654
- seat: {
655
- key: string;
656
- fromQuantity: number;
657
- toQuantity: number;
658
- } | null;
659
- seats: {
660
- key: string;
661
- fromQuantity: number;
662
- toQuantity: number;
663
- }[];
664
- receiptId: string;
665
- productVersionId: string;
666
- currency: string;
667
- creditMinor: string;
668
- debitMinor: string;
669
- discountMinor: string;
670
- taxMinor: string;
671
- totalMinor: string;
672
- effectiveAt: string;
673
- timing: "immediate" | "renewal";
674
- } | {
675
- type: "wait";
676
- nodeId: string;
677
- visit: number;
678
- deadlineAt: string;
679
- eventKey: string | null;
680
- } | {
681
- type: "confirm_billing_adjustment";
682
- receiptId: string;
683
- invoiceId: string;
684
- originalInvoiceId: string;
685
- currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
686
- amountMinor: string;
687
- startsAt: string;
688
- endsAt: string;
689
- } | {
690
- type: "confirm_billing_authorization";
691
- receiptId: string;
692
- authorizationId: string;
693
- terms: {
694
- kind: "postpaid";
695
- maxOutstandingMinor: string;
696
- cashPrice: {
697
- currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
698
- pricing: {
699
- kind: "flat";
700
- units: string;
701
- unitAmountMinor: string;
702
- } | {
703
- kind: "graduated" | "volume";
704
- units: string;
705
- tiers: {
706
- upTo: string | null;
707
- unitAmountMinor: string;
708
- flatAmountMinor?: number | undefined;
709
- }[];
710
- };
711
- billingCycle?: {
712
- interval: "month" | "year";
713
- count: number;
714
- anchor: "membership" | "calendar";
715
- } | undefined;
716
- };
717
- productVersionId: string;
718
- entitlementVersionId: string;
719
- currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
720
- maxAmountMinorPerPeriod: string;
721
- } | {
722
- kind: "auto_topup";
723
- threshold: string;
724
- maxPurchasesPerDay: number;
725
- purchaseAmountMinor: string;
726
- purchaseUnits: string;
727
- productVersionId: string;
728
- entitlementVersionId: string;
729
- currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
730
- maxAmountMinorPerPeriod: string;
731
- purchaseLimits?: {
732
- hour?: number | undefined;
733
- week?: number | undefined;
734
- month?: number | undefined;
735
- } | undefined;
736
- };
737
- setupUrl: string | null;
738
- } | {
739
- type: "authenticate";
740
- } | {
741
- type: "checkout";
742
- receiptId: string;
743
- productVersionId: string;
744
- url: string;
745
- } | {
746
- type: "open_url";
747
- receiptId: string;
748
- url: string;
749
- } | null;
750
- pendingRequest: {
751
- requestId: string;
752
- authenticationRequired: boolean;
753
- } | null;
754
- runExpiresAt: string;
755
- credentialExpiresAt: string | null;
756
- };
757
- nativeCompletion?: {
758
- orderId: string;
759
- receiptId: string;
760
- transactionIds: string[];
761
- membership: boolean;
762
- } | undefined;
763
- runToken?: string | undefined;
764
- }>;
765
-
766
- export { FeatureClientOptions, type FunnelDecisionInput, FunnelDecisionTimeoutError, type FunnelDecisionUsedInput, type FunnelSignalInput, type FunnelStartInput, GrooveError, type GrooveServerOptions, createFunnelDecisionClient, createFunnelOrchestrationClient, createFunnelStartClient, createGrooveServer, createGuestToken, createNativeReceiptClient, renewFunnelRun };