@neetru/sdk 3.6.0 → 3.8.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/CHANGELOG.md +104 -0
- package/README.md +66 -1
- package/dist/ai.cjs +298 -391
- package/dist/ai.d.cts +1 -1
- package/dist/ai.d.ts +1 -1
- package/dist/ai.mjs +298 -391
- package/dist/auth.cjs +3717 -5005
- package/dist/auth.d.cts +1 -1
- package/dist/auth.d.ts +1 -1
- package/dist/auth.mjs +3714 -5002
- package/dist/build-guard.cjs +101 -119
- package/dist/build-guard.mjs +91 -109
- package/dist/catalog.cjs +220 -225
- package/dist/catalog.d.cts +1 -1
- package/dist/catalog.d.ts +1 -1
- package/dist/catalog.mjs +220 -225
- package/dist/checkout.cjs +307 -323
- package/dist/checkout.d.cts +1 -1
- package/dist/checkout.d.ts +1 -1
- package/dist/checkout.mjs +306 -322
- package/dist/db-react.cjs +59 -87
- package/dist/db-react.d.cts +1 -1
- package/dist/db-react.d.ts +1 -1
- package/dist/db-react.mjs +56 -84
- package/dist/db.cjs +2128 -3014
- package/dist/db.d.cts +1 -1
- package/dist/db.d.ts +1 -1
- package/dist/db.mjs +2141 -3027
- package/dist/entitlements.cjs +19 -20
- package/dist/entitlements.d.cts +1 -1
- package/dist/entitlements.d.ts +1 -1
- package/dist/entitlements.mjs +19 -20
- package/dist/errors.cjs +16 -12
- package/dist/errors.d.cts +59 -3
- package/dist/errors.d.ts +59 -3
- package/dist/errors.mjs +15 -12
- package/dist/firestore-compat.cjs +241 -297
- package/dist/firestore-compat.d.cts +1 -1
- package/dist/firestore-compat.d.ts +1 -1
- package/dist/firestore-compat.mjs +215 -271
- package/dist/index.cjs +3942 -5134
- package/dist/index.d.cts +181 -5
- package/dist/index.d.ts +181 -5
- package/dist/index.mjs +4040 -5239
- package/dist/mobile.cjs +459 -344
- package/dist/mobile.d.cts +59 -4
- package/dist/mobile.d.ts +59 -4
- package/dist/mobile.mjs +459 -344
- package/dist/mocks.cjs +319 -447
- package/dist/mocks.d.cts +1 -1
- package/dist/mocks.d.ts +1 -1
- package/dist/mocks.mjs +313 -441
- package/dist/notifications.cjs +296 -317
- package/dist/notifications.d.cts +1 -1
- package/dist/notifications.d.ts +1 -1
- package/dist/notifications.mjs +295 -316
- package/dist/react.cjs +557 -707
- package/dist/react.d.cts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.mjs +547 -697
- package/dist/support.cjs +402 -328
- package/dist/support.d.cts +29 -3
- package/dist/support.d.ts +29 -3
- package/dist/support.mjs +401 -328
- package/dist/telemetry.cjs +267 -304
- package/dist/telemetry.d.cts +1 -1
- package/dist/telemetry.d.ts +1 -1
- package/dist/telemetry.mjs +267 -304
- package/dist/{types-Du_iioJ7.d.cts → types-D-9bjlM0.d.cts} +74 -1
- package/dist/{types-BPATkXYu.d.ts → types-bVztFQTI.d.ts} +74 -1
- package/dist/usage.cjs +233 -230
- package/dist/usage.d.cts +1 -1
- package/dist/usage.d.ts +1 -1
- package/dist/usage.mjs +233 -230
- package/dist/webhooks.cjs +328 -362
- package/dist/webhooks.d.cts +1 -1
- package/dist/webhooks.d.ts +1 -1
- package/dist/webhooks.mjs +325 -359
- package/package.json +5 -3
- package/dist/ai.cjs.map +0 -1
- package/dist/ai.mjs.map +0 -1
- package/dist/auth.cjs.map +0 -1
- package/dist/auth.mjs.map +0 -1
- package/dist/build-guard.cjs.map +0 -1
- package/dist/build-guard.mjs.map +0 -1
- package/dist/catalog.cjs.map +0 -1
- package/dist/catalog.mjs.map +0 -1
- package/dist/checkout.cjs.map +0 -1
- package/dist/checkout.mjs.map +0 -1
- package/dist/db-react.cjs.map +0 -1
- package/dist/db-react.mjs.map +0 -1
- package/dist/db.cjs.map +0 -1
- package/dist/db.mjs.map +0 -1
- package/dist/entitlements.cjs.map +0 -1
- package/dist/entitlements.mjs.map +0 -1
- package/dist/errors.cjs.map +0 -1
- package/dist/errors.mjs.map +0 -1
- package/dist/firestore-compat.cjs.map +0 -1
- package/dist/firestore-compat.mjs.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/mobile.cjs.map +0 -1
- package/dist/mobile.mjs.map +0 -1
- package/dist/mocks.cjs.map +0 -1
- package/dist/mocks.mjs.map +0 -1
- package/dist/notifications.cjs.map +0 -1
- package/dist/notifications.mjs.map +0 -1
- package/dist/react.cjs.map +0 -1
- package/dist/react.mjs.map +0 -1
- package/dist/support.cjs.map +0 -1
- package/dist/support.mjs.map +0 -1
- package/dist/telemetry.cjs.map +0 -1
- package/dist/telemetry.mjs.map +0 -1
- package/dist/usage.cjs.map +0 -1
- package/dist/usage.mjs.map +0 -1
- package/dist/webhooks.cjs.map +0 -1
- package/dist/webhooks.mjs.map +0 -1
|
@@ -113,6 +113,28 @@ declare class MockCheckout implements CheckoutNamespace {
|
|
|
113
113
|
}
|
|
114
114
|
declare function createCheckoutNamespace(config: ResolvedConfig): CheckoutNamespace;
|
|
115
115
|
|
|
116
|
+
/**
|
|
117
|
+
* 3.8.0 — Provedor de token do USUÁRIO FINAL, síncrono OU assíncrono.
|
|
118
|
+
*
|
|
119
|
+
* O namespace `auth` web lê o id_token de `localStorage` (síncrono). Em React
|
|
120
|
+
* Native o storage é assíncrono (`@neetru/sdk/mobile` → `getIdToken():
|
|
121
|
+
* Promise`). Antes desta versão `support` e a barra de conta só aceitavam o
|
|
122
|
+
* contrato síncrono — o módulo mobile ficava solto do `createNeetruClient`.
|
|
123
|
+
*
|
|
124
|
+
* Agora `createNeetruClient({ endUserAuth })` aceita qualquer objeto com
|
|
125
|
+
* `getIdToken()` (sync ou Promise) e, opcionalmente, `refreshTokens()` — o
|
|
126
|
+
* `MobileAuthNamespace` encaixa direto. O provedor fica registrado por client
|
|
127
|
+
* (WeakMap, sem mudar o shape público do `NeetruClient`) para a barra de conta
|
|
128
|
+
* (`fetchNeetruAccountBar`) achá-lo.
|
|
129
|
+
*/
|
|
130
|
+
|
|
131
|
+
interface EndUserTokenProvider {
|
|
132
|
+
/** id_token OIDC do usuário logado, ou `null`. Pode ser síncrono ou Promise. */
|
|
133
|
+
getIdToken(): string | null | undefined | Promise<string | null | undefined>;
|
|
134
|
+
/** Renova a sessão (refresh_token → id_token novo). `true` se renovou. */
|
|
135
|
+
refreshTokens?(): Promise<boolean>;
|
|
136
|
+
}
|
|
137
|
+
|
|
116
138
|
/** Bloco de texto de uma mensagem multimodal (OpenAI-compat). */
|
|
117
139
|
interface AiTextPart {
|
|
118
140
|
type: 'text';
|
|
@@ -1975,6 +1997,10 @@ interface NeetruClientConfig {
|
|
|
1975
1997
|
*
|
|
1976
1998
|
* Endpoints públicos (catalog) funcionam sem apiKey. Endpoints autenticados
|
|
1977
1999
|
* (entitlements, telemetry) lançam `missing_api_key` se ausente.
|
|
2000
|
+
*
|
|
2001
|
+
* **3.8.0: SÓ DE SERVIDOR.** Nunca coloque a chave no navegador ou no app
|
|
2002
|
+
* (`NEXT_PUBLIC_*`/`EXPO_PUBLIC_*`): o site/app chama a API do próprio produto
|
|
2003
|
+
* e o backend usa o SDK com a chave. Ver `strictServerOnlyKey`.
|
|
1978
2004
|
*/
|
|
1979
2005
|
apiKey?: string;
|
|
1980
2006
|
/**
|
|
@@ -2053,6 +2079,27 @@ interface NeetruClientConfig {
|
|
|
2053
2079
|
* Bypass total: `NEETRU_ALLOW_INSECURE_BASEURL=1` no env.
|
|
2054
2080
|
*/
|
|
2055
2081
|
allowedHosts?: string[];
|
|
2082
|
+
/**
|
|
2083
|
+
* 3.8.0 — a credencial `nrt_` é SÓ DE SERVIDOR. Quando o SDK recebe chave
|
|
2084
|
+
* (via `apiKey` ou `NEETRU_API_KEY`) rodando em navegador ou React Native:
|
|
2085
|
+
* - `false`/omitido (padrão nesta minor): aviso único no console (PT-BR,
|
|
2086
|
+
* sem imprimir a chave) e segue funcionando — pra não quebrar produtos
|
|
2087
|
+
* que ainda estão migrando;
|
|
2088
|
+
* - `true`: falha FECHADO com `NeetruError('server_only_key')`.
|
|
2089
|
+
*
|
|
2090
|
+
* **Na próxima MAJOR (4.0) a falha fechada vira o padrão.** No servidor
|
|
2091
|
+
* (Node/Edge) a opção não tem efeito.
|
|
2092
|
+
*/
|
|
2093
|
+
strictServerOnlyKey?: boolean;
|
|
2094
|
+
/**
|
|
2095
|
+
* 3.8.0 — provedor do token do USUÁRIO FINAL usado pelo `support`
|
|
2096
|
+
* (`X-Neetru-End-User-Token`) e pela barra de conta. Aceita `getIdToken()`
|
|
2097
|
+
* síncrono ou assíncrono (+ `refreshTokens()` opcional). Encaixa direto o
|
|
2098
|
+
* `createMobileAuthNamespace(...)` de `@neetru/sdk/mobile`; no backend do
|
|
2099
|
+
* produto, pode ser `{ getIdToken: () => idTokenQueOAppMandou }`.
|
|
2100
|
+
* Default: `client.auth`.
|
|
2101
|
+
*/
|
|
2102
|
+
endUserAuth?: EndUserTokenProvider;
|
|
2056
2103
|
}
|
|
2057
2104
|
/**
|
|
2058
2105
|
* Status do produto no catálogo público.
|
|
@@ -2362,6 +2409,13 @@ interface AuthNamespace {
|
|
|
2362
2409
|
* decodificados use `getUser()`; para validar assinatura use `verifyToken()`.
|
|
2363
2410
|
*/
|
|
2364
2411
|
getIdToken(): string | null;
|
|
2412
|
+
/**
|
|
2413
|
+
* 3.7.0 — renova a sessão do usuário final via `refresh_token` (rotation).
|
|
2414
|
+
* Resolve `true` se gravou um id_token novo; `false` em qualquer falha (sem
|
|
2415
|
+
* refresh token, revogado, rede). Opcional: mocks/implementações próprias
|
|
2416
|
+
* podem omitir. Usado pelo `client.support` antes de desistir num 401.
|
|
2417
|
+
*/
|
|
2418
|
+
refreshTokens?(): Promise<boolean>;
|
|
2365
2419
|
/** Limpa session local + revoga refresh token no servidor. */
|
|
2366
2420
|
signOut(): Promise<void>;
|
|
2367
2421
|
/** Retorna o user atual (do id_token cached) ou `null` se não logado. */
|
|
@@ -2557,7 +2611,17 @@ interface SupportTicket {
|
|
|
2557
2611
|
* 3.4: URL do primeiro anexo (screenshot) do ticket, quando enviado via
|
|
2558
2612
|
* `createTicket({ screenshotBase64 })`. `null` se nenhum anexo.
|
|
2559
2613
|
*/
|
|
2614
|
+
/**
|
|
2615
|
+
* Print do ticket. **3.7.0**: na LISTAGEM (`listMyTickets`) vem sempre `null`
|
|
2616
|
+
* — o Core não devolve mais `attachments`/`consoleLogs` na lista (pesados e
|
|
2617
|
+
* sensíveis). Use `screenshotAttached` pra saber se há print.
|
|
2618
|
+
*/
|
|
2560
2619
|
screenshotUrl: string | null;
|
|
2620
|
+
/**
|
|
2621
|
+
* 3.7.0 — se o ticket tem print anexado. Na LISTAGEM o Core não devolve mais
|
|
2622
|
+
* o anexo (`screenshotUrl` vem `null`); use este campo pra saber se há print.
|
|
2623
|
+
*/
|
|
2624
|
+
screenshotAttached?: boolean;
|
|
2561
2625
|
/**
|
|
2562
2626
|
* 3.4: ISO — setado pelo Core na transição do ticket pra `resolved`.
|
|
2563
2627
|
* `null` enquanto não resolvido.
|
|
@@ -2623,9 +2687,18 @@ interface SupportNamespace {
|
|
|
2623
2687
|
/**
|
|
2624
2688
|
* Lista meus tickets abertos. **3.0**: GET `/api/sdk/v1/support/tickets?productId=...`
|
|
2625
2689
|
* (canonical). `options.productSlug` override do `config.productId` default.
|
|
2690
|
+
*
|
|
2691
|
+
* **3.7.0**: o Core só lista os tickets do usuário final logado — o SDK manda
|
|
2692
|
+
* o id_token dele (`auth.getIdToken()`) em `X-Neetru-End-User-Token`. Sem
|
|
2693
|
+
* usuário logado lança `NeetruAuthRequiredError` (sem request). O mesmo vale
|
|
2694
|
+
* pra `markResolvedSeen`/`recordSatisfactionAttempt`/`submitSatisfaction`/
|
|
2695
|
+
* `contestTicket`. `createTicket` manda o header quando há usuário (o ticket
|
|
2696
|
+
* fica amarrado a ele) e segue sem ele quando não há.
|
|
2626
2697
|
*/
|
|
2627
2698
|
listMyTickets(options?: {
|
|
2628
2699
|
productSlug?: string;
|
|
2700
|
+
/** 3.7.0: quantos tickets (inteiro 1-50). Omitido → default do Core: 20. Máximo 50. */
|
|
2701
|
+
limit?: number;
|
|
2629
2702
|
}): Promise<SupportTicket[]>;
|
|
2630
2703
|
/**
|
|
2631
2704
|
* 3.4: marca que o usuário viu a notificação de resolução do ticket
|
|
@@ -2695,4 +2768,4 @@ interface CatalogListOptions {
|
|
|
2695
2768
|
includeDrafts?: boolean;
|
|
2696
2769
|
}
|
|
2697
2770
|
|
|
2698
|
-
export {
|
|
2771
|
+
export { type NeetruDbEngine as $, type AiChatChoice as A, type DbChangeType as B, type CatalogListOptions as C, DEFAULT_BASE_URL as D, type DbCollectionRef$1 as E, type DbDoc as F, type DbDocRef as G, type DbGetResult as H, type DbListResult as I, type DbNamespace as J, type DbQuery$1 as K, type DbSqlLease as L, type DbWhereFilter as M, type DbWhereFilter$1 as N, type EndUserTokenProvider as O, type EntitlementCheck as P, type FieldSentinel as Q, type IncrementSentinel as R, type ListNotificationsOptions as S, MockCheckout as T, MockNotifications as U, MockWebhooks as V, NEETRU_SENTINEL_KEY as W, type NeetruClient as X, type NeetruClientConfig as Y, type NeetruDb as Z, type NeetruDbDocuments as _, type AiChatMessage as a, NeetruDbError as a0, type NeetruDbErrorCode as a1, type NeetruDbOptions as a2, type NeetruDbTransport as a3, type NeetruEnv as a4, type NeetruSqlClient as a5, type NeetruUser as a6, type NotificationScopeOptions as a7, type NotificationsNamespace as a8, type Product as a9, type VerifyTokenOptions as aA, type VerifyWebhookRequestOptions as aB, type VerifyWebhookRequestResult as aC, type WebhookEndpoint as aD, type WebhookEvent as aE, type WebhookScopeOptions as aF, type WebhookTestResult as aG, type WebhooksNamespace as aH, type WithFieldSentinels as aI, __resetDbIdWarningForTests as aJ, createAiNamespace as aK, createCheckoutNamespace as aL, createNeetruDb as aM, createNotificationsNamespace as aN, createRestSyncTransport as aO, createWebhooksNamespace as aP, getWebSocketRealtimeClient as aQ, increment as aR, isFieldSentinel as aS, isIncrementSentinel as aT, isServerTimestampSentinel as aU, serverTimestamp as aV, verifyWebhookRequest as aW, verifyWebhookSignature as aX, type ProductNotification as aa, type ProductNotificationSeverity as ab, type ProductPlan as ac, type ProductStatus as ad, type RealtimeTransport as ae, type RedirectCallbackResult as af, type RegisterWebhookInput as ag, type ResolvedConfig as ah, type SendNotificationInput as ai, type ServerTimestampSentinel as aj, type SignInOptions as ak, type SqlOptions as al, type SupportNamespace as am, type SupportSeverity as an, type SupportStatus as ao, type SupportTicket as ap, type SyncErrorEvent as aq, type SyncState as ar, type TelemetryEventAck as as, type TelemetryEventInput as at, type TelemetryLogAck as au, type TelemetryLogInput as av, type Unsubscribe as aw, type UsageEventInput as ax, type UsageNamespace as ay, type UsageQuota as az, type AiChatOptions as b, type AiChatResult as c, type AiChatUsage as d, type AiContentPart as e, type AiImageUrlPart as f, type AiNamespace as g, type AiResponseFormat as h, type AiStreamHandle as i, type AiStreamMeta as j, type AiTextPart as k, type AuthNamespace as l, type AuthStateListener as m, type CatalogListResponse as n, type CheckoutAuthOpts as o, type CheckoutIntentInfo as p, type CheckoutIntentStatus as q, type CheckoutNamespace as r, type CheckoutStartInput as s, type CheckoutStartResult as t, type CheckoutTenantType as u, type CompleteSignInResult as v, type ConflictRecord as w, type CreateOfflineDocumentsOptions as x, type CreateTicketInput as y, type DbBatchOp as z };
|
|
@@ -113,6 +113,28 @@ declare class MockCheckout implements CheckoutNamespace {
|
|
|
113
113
|
}
|
|
114
114
|
declare function createCheckoutNamespace(config: ResolvedConfig): CheckoutNamespace;
|
|
115
115
|
|
|
116
|
+
/**
|
|
117
|
+
* 3.8.0 — Provedor de token do USUÁRIO FINAL, síncrono OU assíncrono.
|
|
118
|
+
*
|
|
119
|
+
* O namespace `auth` web lê o id_token de `localStorage` (síncrono). Em React
|
|
120
|
+
* Native o storage é assíncrono (`@neetru/sdk/mobile` → `getIdToken():
|
|
121
|
+
* Promise`). Antes desta versão `support` e a barra de conta só aceitavam o
|
|
122
|
+
* contrato síncrono — o módulo mobile ficava solto do `createNeetruClient`.
|
|
123
|
+
*
|
|
124
|
+
* Agora `createNeetruClient({ endUserAuth })` aceita qualquer objeto com
|
|
125
|
+
* `getIdToken()` (sync ou Promise) e, opcionalmente, `refreshTokens()` — o
|
|
126
|
+
* `MobileAuthNamespace` encaixa direto. O provedor fica registrado por client
|
|
127
|
+
* (WeakMap, sem mudar o shape público do `NeetruClient`) para a barra de conta
|
|
128
|
+
* (`fetchNeetruAccountBar`) achá-lo.
|
|
129
|
+
*/
|
|
130
|
+
|
|
131
|
+
interface EndUserTokenProvider {
|
|
132
|
+
/** id_token OIDC do usuário logado, ou `null`. Pode ser síncrono ou Promise. */
|
|
133
|
+
getIdToken(): string | null | undefined | Promise<string | null | undefined>;
|
|
134
|
+
/** Renova a sessão (refresh_token → id_token novo). `true` se renovou. */
|
|
135
|
+
refreshTokens?(): Promise<boolean>;
|
|
136
|
+
}
|
|
137
|
+
|
|
116
138
|
/** Bloco de texto de uma mensagem multimodal (OpenAI-compat). */
|
|
117
139
|
interface AiTextPart {
|
|
118
140
|
type: 'text';
|
|
@@ -1975,6 +1997,10 @@ interface NeetruClientConfig {
|
|
|
1975
1997
|
*
|
|
1976
1998
|
* Endpoints públicos (catalog) funcionam sem apiKey. Endpoints autenticados
|
|
1977
1999
|
* (entitlements, telemetry) lançam `missing_api_key` se ausente.
|
|
2000
|
+
*
|
|
2001
|
+
* **3.8.0: SÓ DE SERVIDOR.** Nunca coloque a chave no navegador ou no app
|
|
2002
|
+
* (`NEXT_PUBLIC_*`/`EXPO_PUBLIC_*`): o site/app chama a API do próprio produto
|
|
2003
|
+
* e o backend usa o SDK com a chave. Ver `strictServerOnlyKey`.
|
|
1978
2004
|
*/
|
|
1979
2005
|
apiKey?: string;
|
|
1980
2006
|
/**
|
|
@@ -2053,6 +2079,27 @@ interface NeetruClientConfig {
|
|
|
2053
2079
|
* Bypass total: `NEETRU_ALLOW_INSECURE_BASEURL=1` no env.
|
|
2054
2080
|
*/
|
|
2055
2081
|
allowedHosts?: string[];
|
|
2082
|
+
/**
|
|
2083
|
+
* 3.8.0 — a credencial `nrt_` é SÓ DE SERVIDOR. Quando o SDK recebe chave
|
|
2084
|
+
* (via `apiKey` ou `NEETRU_API_KEY`) rodando em navegador ou React Native:
|
|
2085
|
+
* - `false`/omitido (padrão nesta minor): aviso único no console (PT-BR,
|
|
2086
|
+
* sem imprimir a chave) e segue funcionando — pra não quebrar produtos
|
|
2087
|
+
* que ainda estão migrando;
|
|
2088
|
+
* - `true`: falha FECHADO com `NeetruError('server_only_key')`.
|
|
2089
|
+
*
|
|
2090
|
+
* **Na próxima MAJOR (4.0) a falha fechada vira o padrão.** No servidor
|
|
2091
|
+
* (Node/Edge) a opção não tem efeito.
|
|
2092
|
+
*/
|
|
2093
|
+
strictServerOnlyKey?: boolean;
|
|
2094
|
+
/**
|
|
2095
|
+
* 3.8.0 — provedor do token do USUÁRIO FINAL usado pelo `support`
|
|
2096
|
+
* (`X-Neetru-End-User-Token`) e pela barra de conta. Aceita `getIdToken()`
|
|
2097
|
+
* síncrono ou assíncrono (+ `refreshTokens()` opcional). Encaixa direto o
|
|
2098
|
+
* `createMobileAuthNamespace(...)` de `@neetru/sdk/mobile`; no backend do
|
|
2099
|
+
* produto, pode ser `{ getIdToken: () => idTokenQueOAppMandou }`.
|
|
2100
|
+
* Default: `client.auth`.
|
|
2101
|
+
*/
|
|
2102
|
+
endUserAuth?: EndUserTokenProvider;
|
|
2056
2103
|
}
|
|
2057
2104
|
/**
|
|
2058
2105
|
* Status do produto no catálogo público.
|
|
@@ -2362,6 +2409,13 @@ interface AuthNamespace {
|
|
|
2362
2409
|
* decodificados use `getUser()`; para validar assinatura use `verifyToken()`.
|
|
2363
2410
|
*/
|
|
2364
2411
|
getIdToken(): string | null;
|
|
2412
|
+
/**
|
|
2413
|
+
* 3.7.0 — renova a sessão do usuário final via `refresh_token` (rotation).
|
|
2414
|
+
* Resolve `true` se gravou um id_token novo; `false` em qualquer falha (sem
|
|
2415
|
+
* refresh token, revogado, rede). Opcional: mocks/implementações próprias
|
|
2416
|
+
* podem omitir. Usado pelo `client.support` antes de desistir num 401.
|
|
2417
|
+
*/
|
|
2418
|
+
refreshTokens?(): Promise<boolean>;
|
|
2365
2419
|
/** Limpa session local + revoga refresh token no servidor. */
|
|
2366
2420
|
signOut(): Promise<void>;
|
|
2367
2421
|
/** Retorna o user atual (do id_token cached) ou `null` se não logado. */
|
|
@@ -2557,7 +2611,17 @@ interface SupportTicket {
|
|
|
2557
2611
|
* 3.4: URL do primeiro anexo (screenshot) do ticket, quando enviado via
|
|
2558
2612
|
* `createTicket({ screenshotBase64 })`. `null` se nenhum anexo.
|
|
2559
2613
|
*/
|
|
2614
|
+
/**
|
|
2615
|
+
* Print do ticket. **3.7.0**: na LISTAGEM (`listMyTickets`) vem sempre `null`
|
|
2616
|
+
* — o Core não devolve mais `attachments`/`consoleLogs` na lista (pesados e
|
|
2617
|
+
* sensíveis). Use `screenshotAttached` pra saber se há print.
|
|
2618
|
+
*/
|
|
2560
2619
|
screenshotUrl: string | null;
|
|
2620
|
+
/**
|
|
2621
|
+
* 3.7.0 — se o ticket tem print anexado. Na LISTAGEM o Core não devolve mais
|
|
2622
|
+
* o anexo (`screenshotUrl` vem `null`); use este campo pra saber se há print.
|
|
2623
|
+
*/
|
|
2624
|
+
screenshotAttached?: boolean;
|
|
2561
2625
|
/**
|
|
2562
2626
|
* 3.4: ISO — setado pelo Core na transição do ticket pra `resolved`.
|
|
2563
2627
|
* `null` enquanto não resolvido.
|
|
@@ -2623,9 +2687,18 @@ interface SupportNamespace {
|
|
|
2623
2687
|
/**
|
|
2624
2688
|
* Lista meus tickets abertos. **3.0**: GET `/api/sdk/v1/support/tickets?productId=...`
|
|
2625
2689
|
* (canonical). `options.productSlug` override do `config.productId` default.
|
|
2690
|
+
*
|
|
2691
|
+
* **3.7.0**: o Core só lista os tickets do usuário final logado — o SDK manda
|
|
2692
|
+
* o id_token dele (`auth.getIdToken()`) em `X-Neetru-End-User-Token`. Sem
|
|
2693
|
+
* usuário logado lança `NeetruAuthRequiredError` (sem request). O mesmo vale
|
|
2694
|
+
* pra `markResolvedSeen`/`recordSatisfactionAttempt`/`submitSatisfaction`/
|
|
2695
|
+
* `contestTicket`. `createTicket` manda o header quando há usuário (o ticket
|
|
2696
|
+
* fica amarrado a ele) e segue sem ele quando não há.
|
|
2626
2697
|
*/
|
|
2627
2698
|
listMyTickets(options?: {
|
|
2628
2699
|
productSlug?: string;
|
|
2700
|
+
/** 3.7.0: quantos tickets (inteiro 1-50). Omitido → default do Core: 20. Máximo 50. */
|
|
2701
|
+
limit?: number;
|
|
2629
2702
|
}): Promise<SupportTicket[]>;
|
|
2630
2703
|
/**
|
|
2631
2704
|
* 3.4: marca que o usuário viu a notificação de resolução do ticket
|
|
@@ -2695,4 +2768,4 @@ interface CatalogListOptions {
|
|
|
2695
2768
|
includeDrafts?: boolean;
|
|
2696
2769
|
}
|
|
2697
2770
|
|
|
2698
|
-
export {
|
|
2771
|
+
export { type NeetruDbEngine as $, type AiChatChoice as A, type DbChangeType as B, type CatalogListOptions as C, DEFAULT_BASE_URL as D, type DbCollectionRef$1 as E, type DbDoc as F, type DbDocRef as G, type DbGetResult as H, type DbListResult as I, type DbNamespace as J, type DbQuery$1 as K, type DbSqlLease as L, type DbWhereFilter as M, type DbWhereFilter$1 as N, type EndUserTokenProvider as O, type EntitlementCheck as P, type FieldSentinel as Q, type IncrementSentinel as R, type ListNotificationsOptions as S, MockCheckout as T, MockNotifications as U, MockWebhooks as V, NEETRU_SENTINEL_KEY as W, type NeetruClient as X, type NeetruClientConfig as Y, type NeetruDb as Z, type NeetruDbDocuments as _, type AiChatMessage as a, NeetruDbError as a0, type NeetruDbErrorCode as a1, type NeetruDbOptions as a2, type NeetruDbTransport as a3, type NeetruEnv as a4, type NeetruSqlClient as a5, type NeetruUser as a6, type NotificationScopeOptions as a7, type NotificationsNamespace as a8, type Product as a9, type VerifyTokenOptions as aA, type VerifyWebhookRequestOptions as aB, type VerifyWebhookRequestResult as aC, type WebhookEndpoint as aD, type WebhookEvent as aE, type WebhookScopeOptions as aF, type WebhookTestResult as aG, type WebhooksNamespace as aH, type WithFieldSentinels as aI, __resetDbIdWarningForTests as aJ, createAiNamespace as aK, createCheckoutNamespace as aL, createNeetruDb as aM, createNotificationsNamespace as aN, createRestSyncTransport as aO, createWebhooksNamespace as aP, getWebSocketRealtimeClient as aQ, increment as aR, isFieldSentinel as aS, isIncrementSentinel as aT, isServerTimestampSentinel as aU, serverTimestamp as aV, verifyWebhookRequest as aW, verifyWebhookSignature as aX, type ProductNotification as aa, type ProductNotificationSeverity as ab, type ProductPlan as ac, type ProductStatus as ad, type RealtimeTransport as ae, type RedirectCallbackResult as af, type RegisterWebhookInput as ag, type ResolvedConfig as ah, type SendNotificationInput as ai, type ServerTimestampSentinel as aj, type SignInOptions as ak, type SqlOptions as al, type SupportNamespace as am, type SupportSeverity as an, type SupportStatus as ao, type SupportTicket as ap, type SyncErrorEvent as aq, type SyncState as ar, type TelemetryEventAck as as, type TelemetryEventInput as at, type TelemetryLogAck as au, type TelemetryLogInput as av, type Unsubscribe as aw, type UsageEventInput as ax, type UsageNamespace as ay, type UsageQuota as az, type AiChatOptions as b, type AiChatResult as c, type AiChatUsage as d, type AiContentPart as e, type AiImageUrlPart as f, type AiNamespace as g, type AiResponseFormat as h, type AiStreamHandle as i, type AiStreamMeta as j, type AiTextPart as k, type AuthNamespace as l, type AuthStateListener as m, type CatalogListResponse as n, type CheckoutAuthOpts as o, type CheckoutIntentInfo as p, type CheckoutIntentStatus as q, type CheckoutNamespace as r, type CheckoutStartInput as s, type CheckoutStartResult as t, type CheckoutTenantType as u, type CompleteSignInResult as v, type ConflictRecord as w, type CreateOfflineDocumentsOptions as x, type CreateTicketInput as y, type DbBatchOp as z };
|