@nodaro/sdk 2.74.0 → 2.75.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/{chunk-6RH2SICN.cjs → chunk-4GSUIOTT.cjs} +2 -2
- package/dist/chunk-4GSUIOTT.cjs.map +1 -0
- package/dist/{chunk-INRVOUKE.js → chunk-66IQZPPW.js} +47 -3
- package/dist/chunk-66IQZPPW.js.map +1 -0
- package/dist/{chunk-KKQKJD7K.js → chunk-DNONFO6S.js} +2 -2
- package/dist/chunk-DNONFO6S.js.map +1 -0
- package/dist/{chunk-BNJUMQQ3.cjs → chunk-IKZIXM5C.cjs} +24 -8
- package/dist/{chunk-BNJUMQQ3.cjs.map → chunk-IKZIXM5C.cjs.map} +1 -1
- package/dist/{chunk-UDRP64FX.js → chunk-NEGNTQLF.js} +24 -8
- package/dist/{chunk-UDRP64FX.js.map → chunk-NEGNTQLF.js.map} +1 -1
- package/dist/{chunk-NJ5ZFUWJ.js → chunk-O6YXG4BM.js} +3 -3
- package/dist/{chunk-NJ5ZFUWJ.js.map → chunk-O6YXG4BM.js.map} +1 -1
- package/dist/{chunk-VVVJW4DD.cjs → chunk-QSPTSAEI.cjs} +10 -10
- package/dist/{chunk-VVVJW4DD.cjs.map → chunk-QSPTSAEI.cjs.map} +1 -1
- package/dist/{chunk-SRL555ST.cjs → chunk-R427LDUV.cjs} +3 -3
- package/dist/{chunk-SRL555ST.cjs.map → chunk-R427LDUV.cjs.map} +1 -1
- package/dist/{chunk-IKJNFENZ.js → chunk-UX5SMJEI.js} +6 -6
- package/dist/{chunk-IKJNFENZ.js.map → chunk-UX5SMJEI.js.map} +1 -1
- package/dist/{chunk-YDRNPIUC.cjs → chunk-VMV5JH4U.cjs} +47 -3
- package/dist/chunk-VMV5JH4U.cjs.map +1 -0
- package/dist/entries/billing.cjs +2 -2
- package/dist/entries/billing.d.cts +93 -5
- package/dist/entries/billing.d.ts +93 -5
- package/dist/entries/billing.js +1 -1
- package/dist/entries/characters.d.cts +1 -1
- package/dist/entries/characters.d.ts +1 -1
- package/dist/entries/client.cjs +10 -10
- package/dist/entries/client.d.cts +1 -1
- package/dist/entries/client.d.ts +1 -1
- package/dist/entries/client.js +5 -5
- package/dist/entries/core.cjs +5 -5
- package/dist/entries/core.js +1 -1
- package/dist/entries/creatures.d.cts +1 -1
- package/dist/entries/creatures.d.ts +1 -1
- package/dist/entries/credits.cjs +2 -2
- package/dist/entries/credits.d.cts +49 -9
- package/dist/entries/credits.d.ts +49 -9
- package/dist/entries/credits.js +1 -1
- package/dist/entries/locations.d.cts +1 -1
- package/dist/entries/locations.d.ts +1 -1
- package/dist/entries/media.d.cts +1 -1
- package/dist/entries/media.d.ts +1 -1
- package/dist/entries/nodes.cjs +2 -2
- package/dist/entries/nodes.d.cts +1 -1
- package/dist/entries/nodes.d.ts +1 -1
- package/dist/entries/nodes.js +1 -1
- package/dist/entries/objects.d.cts +1 -1
- package/dist/entries/objects.d.ts +1 -1
- package/dist/entries/scene3d.d.cts +2 -2
- package/dist/entries/scene3d.d.ts +2 -2
- package/dist/index.cjs +14 -14
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +5 -5
- package/dist/{nodes-DEGPmZ9a.d.cts → nodes-DtSP2yna.d.cts} +6 -3
- package/dist/{nodes-CHXTwiWW.d.ts → nodes-HKVmoCnt.d.ts} +6 -3
- package/package.json +3 -3
- package/dist/chunk-6RH2SICN.cjs.map +0 -1
- package/dist/chunk-INRVOUKE.js.map +0 -1
- package/dist/chunk-KKQKJD7K.js.map +0 -1
- package/dist/chunk-YDRNPIUC.cjs.map +0 -1
|
@@ -84,6 +84,8 @@ interface BillingPlansResult {
|
|
|
84
84
|
max: number;
|
|
85
85
|
currency: string;
|
|
86
86
|
};
|
|
87
|
+
/** The Stripe publishable key to mount the embedded Checkout form with (`uiMode: "embedded"`); `null` when the deployment has none: use the Checkout page. Absent on a server released before it. */
|
|
88
|
+
stripePublishableKey?: string | null;
|
|
87
89
|
}
|
|
88
90
|
/** The account's latest subscription record. */
|
|
89
91
|
interface BillingSubscription {
|
|
@@ -91,7 +93,7 @@ interface BillingSubscription {
|
|
|
91
93
|
stripe_subscription_id: string | null;
|
|
92
94
|
/** The plan id: `"basic"`, `"standard"`, … */
|
|
93
95
|
tier: string;
|
|
94
|
-
/** `"active"`, `"trialing"`, `"past_due"`, `"paused"`, `"canceled"`, `"incomplete"`, `"incomplete_expired"` or `"expired"`. */
|
|
96
|
+
/** `"active"`, `"trialing"`, `"past_due"`, `"unpaid"`, `"paused"`, `"canceled"`, `"incomplete"`, `"incomplete_expired"` or `"expired"`. */
|
|
95
97
|
status: string;
|
|
96
98
|
stripe_price_id: string | null;
|
|
97
99
|
/** ISO-8601. */
|
|
@@ -257,7 +259,29 @@ declare class BillingResource {
|
|
|
257
259
|
* plan's checkout answers `409` while the account already has a
|
|
258
260
|
* subscription: use {@link BillingResource.changePlan}. `ForbiddenError`
|
|
259
261
|
* with the code `self_serve_disabled` on a deployment that does not sell to
|
|
260
|
-
* its users.
|
|
262
|
+
* its users.
|
|
263
|
+
*
|
|
264
|
+
* With `uiMode: "embedded"` the answer is `{ url: null, clientSecret,
|
|
265
|
+
* sessionId }` for Stripe's embedded Checkout: mount it with
|
|
266
|
+
* `clientSecret` and the plans' {@link BillingPlansResult.stripePublishableKey};
|
|
267
|
+
* it never redirects, and `returnPath` / `embedded` are not used (still
|
|
268
|
+
* validated: an invalid `returnPath` is still a `400`). When it
|
|
269
|
+
* completes, poll {@link BillingResource.checkoutStatus} with `sessionId`
|
|
270
|
+
* until `granted`. A `NodaroError` with status `503` and the code
|
|
271
|
+
* `embedded_checkout_unavailable` means the deployment has no embedded
|
|
272
|
+
* form: use the page (no `uiMode`).
|
|
273
|
+
*
|
|
274
|
+
* Pass `replacesSessionId` (the embedded form's earlier `sessionId`) when
|
|
275
|
+
* this session replaces one of yours, so the two are never payable at once.
|
|
276
|
+
* With it, a `NodaroError` with `status` 409 and `code`
|
|
277
|
+
* `checkout_already_complete` means that purchase is paid, so do not ask
|
|
278
|
+
* again; `checkout_in_progress` means its payment is being confirmed, so
|
|
279
|
+
* read {@link BillingResource.checkoutStatus} and ask again once its status
|
|
280
|
+
* reads `open` with `paymentUnderWay: false`, or `expired` (it can still be
|
|
281
|
+
* refused then: ask again on the person's action, or space the retries); a
|
|
282
|
+
* `NotFoundError` (`checkout_session_not_found`) means it is not yours, or
|
|
283
|
+
* is not a session of this same purchase (the same plan checkout, pack or
|
|
284
|
+
* load amount). **Signed-in session only.**
|
|
261
285
|
*/
|
|
262
286
|
checkout(input: BillingCheckoutInput): Promise<BillingCheckoutSession>;
|
|
263
287
|
/**
|
|
@@ -265,9 +289,28 @@ declare class BillingResource {
|
|
|
265
289
|
* a whole amount (`amountUsd`, within {@link BillingPlansResult.topUpRange})
|
|
266
290
|
* as credits at the packs' rate; `credits` is what it will grant. The card
|
|
267
291
|
* is saved for auto top-up. `returnPath` as in {@link checkout}.
|
|
292
|
+
*
|
|
293
|
+
* With `uiMode: "embedded"` the answer is `{ url: null, clientSecret,
|
|
294
|
+
* sessionId, credits }` for Stripe's embedded Checkout, as in
|
|
295
|
+
* {@link checkout} (mount it with the plans' `stripePublishableKey`;
|
|
296
|
+
* `returnPath` / `embedded` are not used, but still validated; a `503`
|
|
297
|
+
* `embedded_checkout_unavailable` means use the page). `replacesSessionId`
|
|
298
|
+
* and its refusals as in {@link checkout}.
|
|
268
299
|
* **Signed-in session only.**
|
|
269
300
|
*/
|
|
270
301
|
loadCredits(input: BillingLoadInput): Promise<BillingLoadSession>;
|
|
302
|
+
/**
|
|
303
|
+
* `GET /v1/billing/checkout-session/:sessionId` → where one of your own
|
|
304
|
+
* Checkout sessions stands: `status`, `paymentStatus`, `mode`, and
|
|
305
|
+
* `granted` once its credits or plan are on the account. After Stripe's
|
|
306
|
+
* embedded form completes, poll it until `granted` is true, then read the
|
|
307
|
+
* balance again. `paymentUnderWay: true` means replacing the session
|
|
308
|
+
* (`replacesSessionId`) would be refused `checkout_in_progress`; `false`
|
|
309
|
+
* means no submitted payment is seen on it. A session that is not yours (or does not exist) is a
|
|
310
|
+
* `NotFoundError` with the code `checkout_session_not_found`; limited to
|
|
311
|
+
* 60 reads a minute per account. **Signed-in session only.**
|
|
312
|
+
*/
|
|
313
|
+
checkoutStatus(sessionId: string): Promise<BillingCheckoutStatus>;
|
|
271
314
|
/**
|
|
272
315
|
* `POST /v1/billing/manage-subscription` → a Stripe Customer Portal page
|
|
273
316
|
* (the card, the billing address, the invoices, cancelling): send the person
|
|
@@ -377,6 +420,8 @@ interface BillingAutoRechargeSaved {
|
|
|
377
420
|
thresholdCredits: number | null;
|
|
378
421
|
amountUsd: number | null;
|
|
379
422
|
}
|
|
423
|
+
/** Where a Checkout session is paid: `"hosted"` (the default) is the Stripe Checkout page; `"embedded"` is Stripe's embedded form inside your own page. */
|
|
424
|
+
type BillingUiMode = "hosted" | "embedded";
|
|
380
425
|
/** What `billing.checkout()` sends. */
|
|
381
426
|
interface BillingCheckoutInput {
|
|
382
427
|
/** A plan's monthly or yearly price id, or a credit pack's (`BillingTopUp.id`). */
|
|
@@ -387,10 +432,27 @@ interface BillingCheckoutInput {
|
|
|
387
432
|
returnPath?: string;
|
|
388
433
|
/** Set by an embedded first-party surface: return to the app's public checkout-complete page. */
|
|
389
434
|
embedded?: boolean;
|
|
435
|
+
/** `"embedded"` answers a session for Stripe's embedded form instead of a page (`returnPath` and `embedded` are then not used, but still validated: an invalid `returnPath` is still a `400`). Absent = `"hosted"`. */
|
|
436
|
+
uiMode?: BillingUiMode;
|
|
437
|
+
/**
|
|
438
|
+
* The id of an earlier Checkout session of yours that this one replaces (the embedded form's `sessionId`).
|
|
439
|
+
* With it, a `NodaroError` with `status` 409 and `code` `checkout_already_complete` means that purchase is paid,
|
|
440
|
+
* so do not ask again; `checkout_in_progress` means its payment is being confirmed, so read `checkoutStatus` and
|
|
441
|
+
* ask again once its status reads `open` with `paymentUnderWay: false`, or `expired` (it can still be refused
|
|
442
|
+
* then: ask again on the person's action, or space the retries); a `NotFoundError`
|
|
443
|
+
* (`checkout_session_not_found`) means it is not yours, or is not a session of this same purchase (the same
|
|
444
|
+
* plan checkout, pack or load amount).
|
|
445
|
+
*/
|
|
446
|
+
replacesSessionId?: string;
|
|
390
447
|
}
|
|
391
|
-
/** A Stripe Checkout page to send the person to. */
|
|
448
|
+
/** A Stripe Checkout page to send the person to, or (with `uiMode: "embedded"`) a session for Stripe's embedded form. */
|
|
392
449
|
interface BillingCheckoutSession {
|
|
450
|
+
/** The Checkout page; `null` for an embedded session. */
|
|
393
451
|
url: string | null;
|
|
452
|
+
/** An embedded session's client secret, to mount Stripe's embedded Checkout with. */
|
|
453
|
+
clientSecret?: string;
|
|
454
|
+
/** An embedded session's id, for {@link BillingResource.checkoutStatus}. */
|
|
455
|
+
sessionId?: string;
|
|
394
456
|
}
|
|
395
457
|
/** What `billing.loadCredits()` sends. */
|
|
396
458
|
interface BillingLoadInput {
|
|
@@ -399,12 +461,38 @@ interface BillingLoadInput {
|
|
|
399
461
|
/** As in {@link BillingCheckoutInput.returnPath}; wins over `embedded`. */
|
|
400
462
|
returnPath?: string;
|
|
401
463
|
embedded?: boolean;
|
|
464
|
+
/** As in {@link BillingCheckoutInput.uiMode}: with `"embedded"`, `returnPath` and `embedded` are not used, but still validated. */
|
|
465
|
+
uiMode?: BillingUiMode;
|
|
466
|
+
/** As in {@link BillingCheckoutInput.replacesSessionId}. */
|
|
467
|
+
replacesSessionId?: string;
|
|
402
468
|
}
|
|
403
|
-
/** A Stripe Checkout page for a load, and the credits it grants. */
|
|
469
|
+
/** A Stripe Checkout page (or, with `uiMode: "embedded"`, an embedded session) for a load, and the credits it grants. */
|
|
404
470
|
interface BillingLoadSession {
|
|
471
|
+
/** The Checkout page; `null` for an embedded session. */
|
|
405
472
|
url: string | null;
|
|
473
|
+
/** An embedded session's client secret, to mount Stripe's embedded Checkout with. */
|
|
474
|
+
clientSecret?: string;
|
|
475
|
+
/** An embedded session's id, for {@link BillingResource.checkoutStatus}. */
|
|
476
|
+
sessionId?: string;
|
|
406
477
|
credits: number;
|
|
407
478
|
}
|
|
479
|
+
/** What `billing.checkoutStatus()` answers: where one of your own Checkout sessions stands. */
|
|
480
|
+
interface BillingCheckoutStatus {
|
|
481
|
+
/** `"complete"` once the form was paid (or needed no payment). */
|
|
482
|
+
status: "open" | "complete" | "expired";
|
|
483
|
+
paymentStatus: "paid" | "unpaid" | "no_payment_required";
|
|
484
|
+
mode: "payment" | "subscription";
|
|
485
|
+
/** True once the purchase's credits or plan have been granted to the account. */
|
|
486
|
+
granted: boolean;
|
|
487
|
+
/**
|
|
488
|
+
* `true`: the session is open and its payment has been submitted, so a `checkout()` or `loadCredits()` naming
|
|
489
|
+
* it as `replacesSessionId` would be refused `checkout_in_progress`. `false`: no submitted payment is seen on
|
|
490
|
+
* the session (also once it is complete or expired). A replacement can still be refused then, so ask again
|
|
491
|
+
* only on the person's action, or space the retries; and a request for another purchase than the session's
|
|
492
|
+
* answers `checkout_session_not_found` whatever this reads. Absent on a platform that does not send it yet.
|
|
493
|
+
*/
|
|
494
|
+
paymentUnderWay?: boolean;
|
|
495
|
+
}
|
|
408
496
|
/** What `billing.portal()` sends. */
|
|
409
497
|
interface BillingPortalInput {
|
|
410
498
|
/** Where the portal's Back goes: a path on the calling origin; default the app's `/billing`. */
|
|
@@ -426,4 +514,4 @@ interface BillingChangePlanResult {
|
|
|
426
514
|
tier: string;
|
|
427
515
|
}
|
|
428
516
|
|
|
429
|
-
export { type BillingAccountSummary, type BillingAutoRecharge, type BillingAutoRechargeInput, type BillingAutoRechargeSaved, type BillingCard, type BillingChangePlanInput, type BillingChangePlanResult, type BillingCheckoutInput, type BillingCheckoutSession, type BillingDetails, type BillingDocument, type BillingLoadInput, type BillingLoadSession, type BillingMoney, type BillingMonthlyPrice, type BillingPaymentMethod, type BillingPlan, type BillingPlanPrices, type BillingPlansResult, type BillingPortalInput, type BillingPortalSession, type BillingPriceCredits, type BillingPurchase, BillingResource, type BillingSubscription, type BillingSubscriptionResult, type BillingSurface, type BillingTopUp, type BillingUsageCategory, type BillingYearlyPrice };
|
|
517
|
+
export { type BillingAccountSummary, type BillingAutoRecharge, type BillingAutoRechargeInput, type BillingAutoRechargeSaved, type BillingCard, type BillingChangePlanInput, type BillingChangePlanResult, type BillingCheckoutInput, type BillingCheckoutSession, type BillingCheckoutStatus, type BillingDetails, type BillingDocument, type BillingLoadInput, type BillingLoadSession, type BillingMoney, type BillingMonthlyPrice, type BillingPaymentMethod, type BillingPlan, type BillingPlanPrices, type BillingPlansResult, type BillingPortalInput, type BillingPortalSession, type BillingPriceCredits, type BillingPurchase, BillingResource, type BillingSubscription, type BillingSubscriptionResult, type BillingSurface, type BillingTopUp, type BillingUiMode, type BillingUsageCategory, type BillingYearlyPrice };
|
|
@@ -84,6 +84,8 @@ interface BillingPlansResult {
|
|
|
84
84
|
max: number;
|
|
85
85
|
currency: string;
|
|
86
86
|
};
|
|
87
|
+
/** The Stripe publishable key to mount the embedded Checkout form with (`uiMode: "embedded"`); `null` when the deployment has none: use the Checkout page. Absent on a server released before it. */
|
|
88
|
+
stripePublishableKey?: string | null;
|
|
87
89
|
}
|
|
88
90
|
/** The account's latest subscription record. */
|
|
89
91
|
interface BillingSubscription {
|
|
@@ -91,7 +93,7 @@ interface BillingSubscription {
|
|
|
91
93
|
stripe_subscription_id: string | null;
|
|
92
94
|
/** The plan id: `"basic"`, `"standard"`, … */
|
|
93
95
|
tier: string;
|
|
94
|
-
/** `"active"`, `"trialing"`, `"past_due"`, `"paused"`, `"canceled"`, `"incomplete"`, `"incomplete_expired"` or `"expired"`. */
|
|
96
|
+
/** `"active"`, `"trialing"`, `"past_due"`, `"unpaid"`, `"paused"`, `"canceled"`, `"incomplete"`, `"incomplete_expired"` or `"expired"`. */
|
|
95
97
|
status: string;
|
|
96
98
|
stripe_price_id: string | null;
|
|
97
99
|
/** ISO-8601. */
|
|
@@ -257,7 +259,29 @@ declare class BillingResource {
|
|
|
257
259
|
* plan's checkout answers `409` while the account already has a
|
|
258
260
|
* subscription: use {@link BillingResource.changePlan}. `ForbiddenError`
|
|
259
261
|
* with the code `self_serve_disabled` on a deployment that does not sell to
|
|
260
|
-
* its users.
|
|
262
|
+
* its users.
|
|
263
|
+
*
|
|
264
|
+
* With `uiMode: "embedded"` the answer is `{ url: null, clientSecret,
|
|
265
|
+
* sessionId }` for Stripe's embedded Checkout: mount it with
|
|
266
|
+
* `clientSecret` and the plans' {@link BillingPlansResult.stripePublishableKey};
|
|
267
|
+
* it never redirects, and `returnPath` / `embedded` are not used (still
|
|
268
|
+
* validated: an invalid `returnPath` is still a `400`). When it
|
|
269
|
+
* completes, poll {@link BillingResource.checkoutStatus} with `sessionId`
|
|
270
|
+
* until `granted`. A `NodaroError` with status `503` and the code
|
|
271
|
+
* `embedded_checkout_unavailable` means the deployment has no embedded
|
|
272
|
+
* form: use the page (no `uiMode`).
|
|
273
|
+
*
|
|
274
|
+
* Pass `replacesSessionId` (the embedded form's earlier `sessionId`) when
|
|
275
|
+
* this session replaces one of yours, so the two are never payable at once.
|
|
276
|
+
* With it, a `NodaroError` with `status` 409 and `code`
|
|
277
|
+
* `checkout_already_complete` means that purchase is paid, so do not ask
|
|
278
|
+
* again; `checkout_in_progress` means its payment is being confirmed, so
|
|
279
|
+
* read {@link BillingResource.checkoutStatus} and ask again once its status
|
|
280
|
+
* reads `open` with `paymentUnderWay: false`, or `expired` (it can still be
|
|
281
|
+
* refused then: ask again on the person's action, or space the retries); a
|
|
282
|
+
* `NotFoundError` (`checkout_session_not_found`) means it is not yours, or
|
|
283
|
+
* is not a session of this same purchase (the same plan checkout, pack or
|
|
284
|
+
* load amount). **Signed-in session only.**
|
|
261
285
|
*/
|
|
262
286
|
checkout(input: BillingCheckoutInput): Promise<BillingCheckoutSession>;
|
|
263
287
|
/**
|
|
@@ -265,9 +289,28 @@ declare class BillingResource {
|
|
|
265
289
|
* a whole amount (`amountUsd`, within {@link BillingPlansResult.topUpRange})
|
|
266
290
|
* as credits at the packs' rate; `credits` is what it will grant. The card
|
|
267
291
|
* is saved for auto top-up. `returnPath` as in {@link checkout}.
|
|
292
|
+
*
|
|
293
|
+
* With `uiMode: "embedded"` the answer is `{ url: null, clientSecret,
|
|
294
|
+
* sessionId, credits }` for Stripe's embedded Checkout, as in
|
|
295
|
+
* {@link checkout} (mount it with the plans' `stripePublishableKey`;
|
|
296
|
+
* `returnPath` / `embedded` are not used, but still validated; a `503`
|
|
297
|
+
* `embedded_checkout_unavailable` means use the page). `replacesSessionId`
|
|
298
|
+
* and its refusals as in {@link checkout}.
|
|
268
299
|
* **Signed-in session only.**
|
|
269
300
|
*/
|
|
270
301
|
loadCredits(input: BillingLoadInput): Promise<BillingLoadSession>;
|
|
302
|
+
/**
|
|
303
|
+
* `GET /v1/billing/checkout-session/:sessionId` → where one of your own
|
|
304
|
+
* Checkout sessions stands: `status`, `paymentStatus`, `mode`, and
|
|
305
|
+
* `granted` once its credits or plan are on the account. After Stripe's
|
|
306
|
+
* embedded form completes, poll it until `granted` is true, then read the
|
|
307
|
+
* balance again. `paymentUnderWay: true` means replacing the session
|
|
308
|
+
* (`replacesSessionId`) would be refused `checkout_in_progress`; `false`
|
|
309
|
+
* means no submitted payment is seen on it. A session that is not yours (or does not exist) is a
|
|
310
|
+
* `NotFoundError` with the code `checkout_session_not_found`; limited to
|
|
311
|
+
* 60 reads a minute per account. **Signed-in session only.**
|
|
312
|
+
*/
|
|
313
|
+
checkoutStatus(sessionId: string): Promise<BillingCheckoutStatus>;
|
|
271
314
|
/**
|
|
272
315
|
* `POST /v1/billing/manage-subscription` → a Stripe Customer Portal page
|
|
273
316
|
* (the card, the billing address, the invoices, cancelling): send the person
|
|
@@ -377,6 +420,8 @@ interface BillingAutoRechargeSaved {
|
|
|
377
420
|
thresholdCredits: number | null;
|
|
378
421
|
amountUsd: number | null;
|
|
379
422
|
}
|
|
423
|
+
/** Where a Checkout session is paid: `"hosted"` (the default) is the Stripe Checkout page; `"embedded"` is Stripe's embedded form inside your own page. */
|
|
424
|
+
type BillingUiMode = "hosted" | "embedded";
|
|
380
425
|
/** What `billing.checkout()` sends. */
|
|
381
426
|
interface BillingCheckoutInput {
|
|
382
427
|
/** A plan's monthly or yearly price id, or a credit pack's (`BillingTopUp.id`). */
|
|
@@ -387,10 +432,27 @@ interface BillingCheckoutInput {
|
|
|
387
432
|
returnPath?: string;
|
|
388
433
|
/** Set by an embedded first-party surface: return to the app's public checkout-complete page. */
|
|
389
434
|
embedded?: boolean;
|
|
435
|
+
/** `"embedded"` answers a session for Stripe's embedded form instead of a page (`returnPath` and `embedded` are then not used, but still validated: an invalid `returnPath` is still a `400`). Absent = `"hosted"`. */
|
|
436
|
+
uiMode?: BillingUiMode;
|
|
437
|
+
/**
|
|
438
|
+
* The id of an earlier Checkout session of yours that this one replaces (the embedded form's `sessionId`).
|
|
439
|
+
* With it, a `NodaroError` with `status` 409 and `code` `checkout_already_complete` means that purchase is paid,
|
|
440
|
+
* so do not ask again; `checkout_in_progress` means its payment is being confirmed, so read `checkoutStatus` and
|
|
441
|
+
* ask again once its status reads `open` with `paymentUnderWay: false`, or `expired` (it can still be refused
|
|
442
|
+
* then: ask again on the person's action, or space the retries); a `NotFoundError`
|
|
443
|
+
* (`checkout_session_not_found`) means it is not yours, or is not a session of this same purchase (the same
|
|
444
|
+
* plan checkout, pack or load amount).
|
|
445
|
+
*/
|
|
446
|
+
replacesSessionId?: string;
|
|
390
447
|
}
|
|
391
|
-
/** A Stripe Checkout page to send the person to. */
|
|
448
|
+
/** A Stripe Checkout page to send the person to, or (with `uiMode: "embedded"`) a session for Stripe's embedded form. */
|
|
392
449
|
interface BillingCheckoutSession {
|
|
450
|
+
/** The Checkout page; `null` for an embedded session. */
|
|
393
451
|
url: string | null;
|
|
452
|
+
/** An embedded session's client secret, to mount Stripe's embedded Checkout with. */
|
|
453
|
+
clientSecret?: string;
|
|
454
|
+
/** An embedded session's id, for {@link BillingResource.checkoutStatus}. */
|
|
455
|
+
sessionId?: string;
|
|
394
456
|
}
|
|
395
457
|
/** What `billing.loadCredits()` sends. */
|
|
396
458
|
interface BillingLoadInput {
|
|
@@ -399,12 +461,38 @@ interface BillingLoadInput {
|
|
|
399
461
|
/** As in {@link BillingCheckoutInput.returnPath}; wins over `embedded`. */
|
|
400
462
|
returnPath?: string;
|
|
401
463
|
embedded?: boolean;
|
|
464
|
+
/** As in {@link BillingCheckoutInput.uiMode}: with `"embedded"`, `returnPath` and `embedded` are not used, but still validated. */
|
|
465
|
+
uiMode?: BillingUiMode;
|
|
466
|
+
/** As in {@link BillingCheckoutInput.replacesSessionId}. */
|
|
467
|
+
replacesSessionId?: string;
|
|
402
468
|
}
|
|
403
|
-
/** A Stripe Checkout page for a load, and the credits it grants. */
|
|
469
|
+
/** A Stripe Checkout page (or, with `uiMode: "embedded"`, an embedded session) for a load, and the credits it grants. */
|
|
404
470
|
interface BillingLoadSession {
|
|
471
|
+
/** The Checkout page; `null` for an embedded session. */
|
|
405
472
|
url: string | null;
|
|
473
|
+
/** An embedded session's client secret, to mount Stripe's embedded Checkout with. */
|
|
474
|
+
clientSecret?: string;
|
|
475
|
+
/** An embedded session's id, for {@link BillingResource.checkoutStatus}. */
|
|
476
|
+
sessionId?: string;
|
|
406
477
|
credits: number;
|
|
407
478
|
}
|
|
479
|
+
/** What `billing.checkoutStatus()` answers: where one of your own Checkout sessions stands. */
|
|
480
|
+
interface BillingCheckoutStatus {
|
|
481
|
+
/** `"complete"` once the form was paid (or needed no payment). */
|
|
482
|
+
status: "open" | "complete" | "expired";
|
|
483
|
+
paymentStatus: "paid" | "unpaid" | "no_payment_required";
|
|
484
|
+
mode: "payment" | "subscription";
|
|
485
|
+
/** True once the purchase's credits or plan have been granted to the account. */
|
|
486
|
+
granted: boolean;
|
|
487
|
+
/**
|
|
488
|
+
* `true`: the session is open and its payment has been submitted, so a `checkout()` or `loadCredits()` naming
|
|
489
|
+
* it as `replacesSessionId` would be refused `checkout_in_progress`. `false`: no submitted payment is seen on
|
|
490
|
+
* the session (also once it is complete or expired). A replacement can still be refused then, so ask again
|
|
491
|
+
* only on the person's action, or space the retries; and a request for another purchase than the session's
|
|
492
|
+
* answers `checkout_session_not_found` whatever this reads. Absent on a platform that does not send it yet.
|
|
493
|
+
*/
|
|
494
|
+
paymentUnderWay?: boolean;
|
|
495
|
+
}
|
|
408
496
|
/** What `billing.portal()` sends. */
|
|
409
497
|
interface BillingPortalInput {
|
|
410
498
|
/** Where the portal's Back goes: a path on the calling origin; default the app's `/billing`. */
|
|
@@ -426,4 +514,4 @@ interface BillingChangePlanResult {
|
|
|
426
514
|
tier: string;
|
|
427
515
|
}
|
|
428
516
|
|
|
429
|
-
export { type BillingAccountSummary, type BillingAutoRecharge, type BillingAutoRechargeInput, type BillingAutoRechargeSaved, type BillingCard, type BillingChangePlanInput, type BillingChangePlanResult, type BillingCheckoutInput, type BillingCheckoutSession, type BillingDetails, type BillingDocument, type BillingLoadInput, type BillingLoadSession, type BillingMoney, type BillingMonthlyPrice, type BillingPaymentMethod, type BillingPlan, type BillingPlanPrices, type BillingPlansResult, type BillingPortalInput, type BillingPortalSession, type BillingPriceCredits, type BillingPurchase, BillingResource, type BillingSubscription, type BillingSubscriptionResult, type BillingSurface, type BillingTopUp, type BillingUsageCategory, type BillingYearlyPrice };
|
|
517
|
+
export { type BillingAccountSummary, type BillingAutoRecharge, type BillingAutoRechargeInput, type BillingAutoRechargeSaved, type BillingCard, type BillingChangePlanInput, type BillingChangePlanResult, type BillingCheckoutInput, type BillingCheckoutSession, type BillingCheckoutStatus, type BillingDetails, type BillingDocument, type BillingLoadInput, type BillingLoadSession, type BillingMoney, type BillingMonthlyPrice, type BillingPaymentMethod, type BillingPlan, type BillingPlanPrices, type BillingPlansResult, type BillingPortalInput, type BillingPortalSession, type BillingPriceCredits, type BillingPurchase, BillingResource, type BillingSubscription, type BillingSubscriptionResult, type BillingSurface, type BillingTopUp, type BillingUiMode, type BillingUsageCategory, type BillingYearlyPrice };
|
package/dist/entries/billing.js
CHANGED
|
@@ -4,7 +4,7 @@ import { EntityStyle, CharacterAspectRatio, CharacterAttachColumn } from '@nodar
|
|
|
4
4
|
export { CHARACTER_ASPECT_DEFAULTS, CHARACTER_ASPECT_OPTIONS, CHARACTER_STYLES, CharacterAspectRatio, EntityStyle } from '@nodaro/shared/entities';
|
|
5
5
|
import { TtsProvider } from '@nodaro/shared/models';
|
|
6
6
|
import { N as NodaroClientCore } from '../developer-apps-D59GfAnO.cjs';
|
|
7
|
-
import { l as GenerationSessionParams, a4 as Subject } from '../nodes-
|
|
7
|
+
import { l as GenerationSessionParams, a4 as Subject } from '../nodes-DtSP2yna.cjs';
|
|
8
8
|
import { SetKeeperCatalogInput, SetKeeperCatalogResult } from './keepers.cjs';
|
|
9
9
|
import '@nodaro/shared/apps';
|
|
10
10
|
import '@nodaro/shared/organizations';
|
|
@@ -4,7 +4,7 @@ import { EntityStyle, CharacterAspectRatio, CharacterAttachColumn } from '@nodar
|
|
|
4
4
|
export { CHARACTER_ASPECT_DEFAULTS, CHARACTER_ASPECT_OPTIONS, CHARACTER_STYLES, CharacterAspectRatio, EntityStyle } from '@nodaro/shared/entities';
|
|
5
5
|
import { TtsProvider } from '@nodaro/shared/models';
|
|
6
6
|
import { N as NodaroClientCore } from '../developer-apps-D59GfAnO.js';
|
|
7
|
-
import { l as GenerationSessionParams, a4 as Subject } from '../nodes-
|
|
7
|
+
import { l as GenerationSessionParams, a4 as Subject } from '../nodes-HKVmoCnt.js';
|
|
8
8
|
import { SetKeeperCatalogInput, SetKeeperCatalogResult } from './keepers.js';
|
|
9
9
|
import '@nodaro/shared/apps';
|
|
10
10
|
import '@nodaro/shared/organizations';
|
package/dist/entries/client.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkQSPTSAEI_cjs = require('../chunk-QSPTSAEI.cjs');
|
|
4
4
|
require('../chunk-WKNWJDF6.cjs');
|
|
5
5
|
require('../chunk-3B47IHB3.cjs');
|
|
6
6
|
require('../chunk-WUM6CWTE.cjs');
|
|
@@ -36,7 +36,7 @@ require('../chunk-VTHHSO2K.cjs');
|
|
|
36
36
|
require('../chunk-K7G4OYDH.cjs');
|
|
37
37
|
require('../chunk-ZCWKX4V6.cjs');
|
|
38
38
|
require('../chunk-DUE24QGQ.cjs');
|
|
39
|
-
require('../chunk-
|
|
39
|
+
require('../chunk-4GSUIOTT.cjs');
|
|
40
40
|
require('../chunk-A3S55XGF.cjs');
|
|
41
41
|
require('../chunk-KKH7QQAR.cjs');
|
|
42
42
|
require('../chunk-CLBLAWH3.cjs');
|
|
@@ -50,13 +50,13 @@ require('../chunk-YFS2LMG4.cjs');
|
|
|
50
50
|
require('../chunk-4DCXJ77J.cjs');
|
|
51
51
|
require('../chunk-TQLOD7OL.cjs');
|
|
52
52
|
require('../chunk-EJJIA765.cjs');
|
|
53
|
-
var
|
|
53
|
+
var chunkR427LDUV_cjs = require('../chunk-R427LDUV.cjs');
|
|
54
54
|
require('../chunk-4AD3CBDK.cjs');
|
|
55
55
|
require('../chunk-A3XA6UNM.cjs');
|
|
56
|
-
require('../chunk-
|
|
56
|
+
require('../chunk-IKZIXM5C.cjs');
|
|
57
57
|
require('../chunk-7BMKQ36V.cjs');
|
|
58
58
|
require('../chunk-CAM74LQ2.cjs');
|
|
59
|
-
require('../chunk-
|
|
59
|
+
require('../chunk-VMV5JH4U.cjs');
|
|
60
60
|
require('../chunk-GU3YOOCK.cjs');
|
|
61
61
|
require('../chunk-7OLINQTA.cjs');
|
|
62
62
|
require('../chunk-XZQ6Z4T6.cjs');
|
|
@@ -65,23 +65,23 @@ require('../chunk-XZQ6Z4T6.cjs');
|
|
|
65
65
|
|
|
66
66
|
Object.defineProperty(exports, "NodaroClient", {
|
|
67
67
|
enumerable: true,
|
|
68
|
-
get: function () { return
|
|
68
|
+
get: function () { return chunkQSPTSAEI_cjs.NodaroClient; }
|
|
69
69
|
});
|
|
70
70
|
Object.defineProperty(exports, "createClient", {
|
|
71
71
|
enumerable: true,
|
|
72
|
-
get: function () { return
|
|
72
|
+
get: function () { return chunkQSPTSAEI_cjs.createClient; }
|
|
73
73
|
});
|
|
74
74
|
Object.defineProperty(exports, "CallbackAuth", {
|
|
75
75
|
enumerable: true,
|
|
76
|
-
get: function () { return
|
|
76
|
+
get: function () { return chunkR427LDUV_cjs.CallbackAuth; }
|
|
77
77
|
});
|
|
78
78
|
Object.defineProperty(exports, "StaticTokenAuth", {
|
|
79
79
|
enumerable: true,
|
|
80
|
-
get: function () { return
|
|
80
|
+
get: function () { return chunkR427LDUV_cjs.StaticTokenAuth; }
|
|
81
81
|
});
|
|
82
82
|
Object.defineProperty(exports, "supabaseAuth", {
|
|
83
83
|
enumerable: true,
|
|
84
|
-
get: function () { return
|
|
84
|
+
get: function () { return chunkR427LDUV_cjs.supabaseAuth; }
|
|
85
85
|
});
|
|
86
86
|
//# sourceMappingURL=client.cjs.map
|
|
87
87
|
//# sourceMappingURL=client.cjs.map
|
|
@@ -5,7 +5,7 @@ import { TrashResource } from './trash.cjs';
|
|
|
5
5
|
import { JobsResource } from './jobs.cjs';
|
|
6
6
|
import { VideoProResource } from './video-pro.cjs';
|
|
7
7
|
import { ExecutionsResource } from './executions.cjs';
|
|
8
|
-
import { t as NodesResource } from '../nodes-
|
|
8
|
+
import { t as NodesResource } from '../nodes-DtSP2yna.cjs';
|
|
9
9
|
import { Scene3DResource } from './scene3d.cjs';
|
|
10
10
|
import { N as NodaroClientCore, h as DeveloperAppsResource, a as ClientOptions } from '../developer-apps-D59GfAnO.cjs';
|
|
11
11
|
export { A as Auth, C as CallbackAuth, b as ConnectedApp, S as StaticTokenAuth, i as UserIdentity, s as supabaseAuth } from '../developer-apps-D59GfAnO.cjs';
|
package/dist/entries/client.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { TrashResource } from './trash.js';
|
|
|
5
5
|
import { JobsResource } from './jobs.js';
|
|
6
6
|
import { VideoProResource } from './video-pro.js';
|
|
7
7
|
import { ExecutionsResource } from './executions.js';
|
|
8
|
-
import { t as NodesResource } from '../nodes-
|
|
8
|
+
import { t as NodesResource } from '../nodes-HKVmoCnt.js';
|
|
9
9
|
import { Scene3DResource } from './scene3d.js';
|
|
10
10
|
import { N as NodaroClientCore, h as DeveloperAppsResource, a as ClientOptions } from '../developer-apps-D59GfAnO.js';
|
|
11
11
|
export { A as Auth, C as CallbackAuth, b as ConnectedApp, S as StaticTokenAuth, i as UserIdentity, s as supabaseAuth } from '../developer-apps-D59GfAnO.js';
|
package/dist/entries/client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { NodaroClient, createClient } from '../chunk-
|
|
1
|
+
export { NodaroClient, createClient } from '../chunk-UX5SMJEI.js';
|
|
2
2
|
import '../chunk-S5V37WYY.js';
|
|
3
3
|
import '../chunk-YN6CBIIB.js';
|
|
4
4
|
import '../chunk-33HT46A3.js';
|
|
@@ -34,7 +34,7 @@ import '../chunk-HNUCPUIX.js';
|
|
|
34
34
|
import '../chunk-54NGEY45.js';
|
|
35
35
|
import '../chunk-YVU2M7MI.js';
|
|
36
36
|
import '../chunk-H77BJMV2.js';
|
|
37
|
-
import '../chunk-
|
|
37
|
+
import '../chunk-DNONFO6S.js';
|
|
38
38
|
import '../chunk-65E3JBFZ.js';
|
|
39
39
|
import '../chunk-D5X3NKSI.js';
|
|
40
40
|
import '../chunk-VGY3WBNY.js';
|
|
@@ -48,13 +48,13 @@ import '../chunk-BU5A6K4C.js';
|
|
|
48
48
|
import '../chunk-HAS6PMQN.js';
|
|
49
49
|
import '../chunk-CCXY4ZJM.js';
|
|
50
50
|
import '../chunk-SZ67PDKE.js';
|
|
51
|
-
export { CallbackAuth, StaticTokenAuth, supabaseAuth } from '../chunk-
|
|
51
|
+
export { CallbackAuth, StaticTokenAuth, supabaseAuth } from '../chunk-O6YXG4BM.js';
|
|
52
52
|
import '../chunk-IJAJTVEW.js';
|
|
53
53
|
import '../chunk-HUYI5G3D.js';
|
|
54
|
-
import '../chunk-
|
|
54
|
+
import '../chunk-NEGNTQLF.js';
|
|
55
55
|
import '../chunk-OJHJBNJZ.js';
|
|
56
56
|
import '../chunk-JAGTW35C.js';
|
|
57
|
-
import '../chunk-
|
|
57
|
+
import '../chunk-66IQZPPW.js';
|
|
58
58
|
import '../chunk-YUY56PT7.js';
|
|
59
59
|
import '../chunk-AZMUM5WG.js';
|
|
60
60
|
import '../chunk-CBDUHYTR.js';
|
package/dist/entries/core.cjs
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
require('../chunk-X7XP5WBP.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkR427LDUV_cjs = require('../chunk-R427LDUV.cjs');
|
|
5
5
|
require('../chunk-4AD3CBDK.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "CallbackAuth", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkR427LDUV_cjs.CallbackAuth; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "NodaroClientCore", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkR427LDUV_cjs.NodaroClientCore; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "StaticTokenAuth", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkR427LDUV_cjs.StaticTokenAuth; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "supabaseAuth", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunkR427LDUV_cjs.supabaseAuth; }
|
|
24
24
|
});
|
|
25
25
|
//# sourceMappingURL=core.cjs.map
|
|
26
26
|
//# sourceMappingURL=core.cjs.map
|
package/dist/entries/core.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../chunk-AUDHV3OE.js';
|
|
2
|
-
export { CallbackAuth, NodaroClientCore, StaticTokenAuth, supabaseAuth } from '../chunk-
|
|
2
|
+
export { CallbackAuth, NodaroClientCore, StaticTokenAuth, supabaseAuth } from '../chunk-O6YXG4BM.js';
|
|
3
3
|
import '../chunk-IJAJTVEW.js';
|
|
4
4
|
//# sourceMappingURL=core.js.map
|
|
5
5
|
//# sourceMappingURL=core.js.map
|
|
@@ -2,7 +2,7 @@ import { CreatureAttachColumn, ObjectAspectRatio } from '@nodaro/shared/entities
|
|
|
2
2
|
export { OBJECT_ASPECT_DEFAULTS as CREATURE_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS as CREATURE_ASPECT_OPTIONS, CREATURE_ATTACH_COLUMNS, ObjectAspectRatio as CreatureAspectRatio, CreatureAttachColumn } from '@nodaro/shared/entities';
|
|
3
3
|
import { TtsProvider } from '@nodaro/shared/models';
|
|
4
4
|
import { N as NodaroClientCore } from '../developer-apps-D59GfAnO.cjs';
|
|
5
|
-
import { l as GenerationSessionParams, a4 as Subject } from '../nodes-
|
|
5
|
+
import { l as GenerationSessionParams, a4 as Subject } from '../nodes-DtSP2yna.cjs';
|
|
6
6
|
import { SetKeeperCatalogInput, SetKeeperCatalogResult } from './keepers.cjs';
|
|
7
7
|
import '@nodaro/shared/apps';
|
|
8
8
|
import '@nodaro/shared/organizations';
|
|
@@ -2,7 +2,7 @@ import { CreatureAttachColumn, ObjectAspectRatio } from '@nodaro/shared/entities
|
|
|
2
2
|
export { OBJECT_ASPECT_DEFAULTS as CREATURE_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS as CREATURE_ASPECT_OPTIONS, CREATURE_ATTACH_COLUMNS, ObjectAspectRatio as CreatureAspectRatio, CreatureAttachColumn } from '@nodaro/shared/entities';
|
|
3
3
|
import { TtsProvider } from '@nodaro/shared/models';
|
|
4
4
|
import { N as NodaroClientCore } from '../developer-apps-D59GfAnO.js';
|
|
5
|
-
import { l as GenerationSessionParams, a4 as Subject } from '../nodes-
|
|
5
|
+
import { l as GenerationSessionParams, a4 as Subject } from '../nodes-HKVmoCnt.js';
|
|
6
6
|
import { SetKeeperCatalogInput, SetKeeperCatalogResult } from './keepers.js';
|
|
7
7
|
import '@nodaro/shared/apps';
|
|
8
8
|
import '@nodaro/shared/organizations';
|
package/dist/entries/credits.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
require('../chunk-ALUUBPDG.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkIKZIXM5C_cjs = require('../chunk-IKZIXM5C.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "CreditsResource", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkIKZIXM5C_cjs.CreditsResource; }
|
|
11
11
|
});
|
|
12
12
|
//# sourceMappingURL=credits.cjs.map
|
|
13
13
|
//# sourceMappingURL=credits.cjs.map
|
|
@@ -131,7 +131,21 @@ interface ModelCostDisplay extends DisplayUnitInfo {
|
|
|
131
131
|
type FreeGrantState = "unclaimed" | "granted" | "withheld" | "revoked";
|
|
132
132
|
/** `UserBalance.welcomeOffer` — what an app needs to show the welcome offer. */
|
|
133
133
|
interface WelcomeOfferState {
|
|
134
|
-
/**
|
|
134
|
+
/**
|
|
135
|
+
* Open the welcome popup by itself now. Decided by the server: the grant is
|
|
136
|
+
* unclaimed, "Maybe later" was never answered, and the popup has opened by
|
|
137
|
+
* itself fewer than three times, none of them in the last 24 hours. When an
|
|
138
|
+
* app opens it because this is true, it reports that with
|
|
139
|
+
* `markWelcomeOfferSeen("shown")`; an app should also not open it by itself
|
|
140
|
+
* twice in one visit. Absent from a server released before this field,
|
|
141
|
+
* which sends `popupSeen` alone: open it then while `popupSeen` is false
|
|
142
|
+
* (`welcomeOffer.popupDue ?? welcomeOffer.popupSeen === false`).
|
|
143
|
+
*/
|
|
144
|
+
popupDue?: boolean;
|
|
145
|
+
/**
|
|
146
|
+
* `!popupDue`, kept for apps written before `popupDue`: they open the popup
|
|
147
|
+
* while it is false. Read `popupDue` instead.
|
|
148
|
+
*/
|
|
135
149
|
popupSeen: boolean;
|
|
136
150
|
/**
|
|
137
151
|
* The account already has its credits (granted elsewhere) but still owes
|
|
@@ -139,7 +153,11 @@ interface WelcomeOfferState {
|
|
|
139
153
|
* claim records it.
|
|
140
154
|
*/
|
|
141
155
|
consentPending: boolean;
|
|
142
|
-
/**
|
|
156
|
+
/**
|
|
157
|
+
* The credits a claim grants. Name this figure in the offer; never hard-code
|
|
158
|
+
* it. With `consentPending`, the credits the account WAS granted, which can
|
|
159
|
+
* be more than a claim grants today (an earlier, larger grant is kept).
|
|
160
|
+
*/
|
|
143
161
|
credits: number;
|
|
144
162
|
}
|
|
145
163
|
/** What `claimWelcomeOffer` sends: the browser signals plus the app answering. */
|
|
@@ -165,9 +183,19 @@ interface WelcomeOfferClaimResult {
|
|
|
165
183
|
consent: "granted";
|
|
166
184
|
/** Where the free grant stands after the claim — `"withheld"` when the abuse gate refused it. */
|
|
167
185
|
grant: FreeGrantState;
|
|
168
|
-
/**
|
|
186
|
+
/**
|
|
187
|
+
* The grant's figure. A grant tops the subscription credits UP TO it (it is
|
|
188
|
+
* not added on top), so a claim that lands it leaves the subscription credits
|
|
189
|
+
* at no less than this. For an account granted before the call, what it was
|
|
190
|
+
* given, which can be more than a claim grants today.
|
|
191
|
+
*/
|
|
169
192
|
credits: number;
|
|
170
193
|
}
|
|
194
|
+
/**
|
|
195
|
+
* What `markWelcomeOfferSeen` reports. `"shown"`: the popup opened by itself.
|
|
196
|
+
* `"later"`: the user answered "Maybe later".
|
|
197
|
+
*/
|
|
198
|
+
type WelcomeOfferSeenEvent = "shown" | "later";
|
|
171
199
|
/** The answer of `POST /v1/credits/welcome-offer/seen`. */
|
|
172
200
|
interface WelcomeOfferSeenResult {
|
|
173
201
|
ok: true;
|
|
@@ -523,16 +551,28 @@ declare class CreditsResource {
|
|
|
523
551
|
*/
|
|
524
552
|
claimWelcomeOffer(input?: WelcomeOfferClaimInput): Promise<WelcomeOfferClaimResult>;
|
|
525
553
|
/**
|
|
526
|
-
* `POST /v1/credits/welcome-offer/seen` →
|
|
527
|
-
*
|
|
528
|
-
*
|
|
529
|
-
*
|
|
554
|
+
* `POST /v1/credits/welcome-offer/seen` → tells the server what happened to
|
|
555
|
+
* the welcome popup, which decides `balance().welcomeOffer.popupDue` from it
|
|
556
|
+
* on every app:
|
|
557
|
+
*
|
|
558
|
+
* - `"shown"`: the popup opened by itself (because `popupDue` was true).
|
|
559
|
+
* Counts one of the account's three showings while the popup is due;
|
|
560
|
+
* nothing is counted otherwise (a second call within 24 hours, after
|
|
561
|
+
* "Maybe later", after the third), so a repeated call is harmless.
|
|
562
|
+
* - `"later"`: the user answered "Maybe later". The popup does not open by
|
|
563
|
+
* itself again.
|
|
564
|
+
*
|
|
565
|
+
* A close without an answer (the ×, Escape, a click outside) is reported by
|
|
566
|
+
* not calling this at all. Called with no event, it sends no body, and the
|
|
567
|
+
* server reads that as `"later"` (what apps written before the event sent on
|
|
568
|
+
* any close). Both writes are idempotent; a failed call only means the
|
|
569
|
+
* popup may show once more, so callers usually ignore errors.
|
|
530
570
|
*
|
|
531
571
|
* **Browser session only**, like {@link claimWelcomeOffer}: 403 for an API
|
|
532
572
|
* key or OAuth app token, 409 `welcome_offer_disabled` while the offer is
|
|
533
573
|
* off, 404 on a self-hosted instance.
|
|
534
574
|
*/
|
|
535
|
-
markWelcomeOfferSeen(): Promise<WelcomeOfferSeenResult>;
|
|
575
|
+
markWelcomeOfferSeen(event?: WelcomeOfferSeenEvent): Promise<WelcomeOfferSeenResult>;
|
|
536
576
|
}
|
|
537
577
|
|
|
538
|
-
export { type BalanceAllowance, type BalanceDisplay, type CreditHistoryEntry, type CreditHistoryFilters, type CreditHistoryJob, type CreditHistoryKind, type CreditHistoryOptions, type CreditHistoryPage, type CreditTransaction, type CreditTransactionsOptions, type CreditTransactionsPage, CreditsResource, type DisplayUnitInfo, type FreeGrantState, type ModelCostDisplay, type ModelCostError, type ModelCostResult, type ModelCostsDisplay, type ModelCostsResult, type SignupGrantClaimResult, type SignupKeys, type UsageByCategory, type UsageByGroup, type UsageByModel, type UsageOverTime, type UsageSummary, type UsageSummaryBucket, type UsageSummaryOptions, type UsageSummaryTotals, type UserBalance, type WelcomeOfferClaimInput, type WelcomeOfferClaimResult, type WelcomeOfferSeenResult, type WelcomeOfferState };
|
|
578
|
+
export { type BalanceAllowance, type BalanceDisplay, type CreditHistoryEntry, type CreditHistoryFilters, type CreditHistoryJob, type CreditHistoryKind, type CreditHistoryOptions, type CreditHistoryPage, type CreditTransaction, type CreditTransactionsOptions, type CreditTransactionsPage, CreditsResource, type DisplayUnitInfo, type FreeGrantState, type ModelCostDisplay, type ModelCostError, type ModelCostResult, type ModelCostsDisplay, type ModelCostsResult, type SignupGrantClaimResult, type SignupKeys, type UsageByCategory, type UsageByGroup, type UsageByModel, type UsageOverTime, type UsageSummary, type UsageSummaryBucket, type UsageSummaryOptions, type UsageSummaryTotals, type UserBalance, type WelcomeOfferClaimInput, type WelcomeOfferClaimResult, type WelcomeOfferSeenEvent, type WelcomeOfferSeenResult, type WelcomeOfferState };
|