@neetru/sdk 3.3.0 → 3.4.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 +25 -0
- package/dist/ai.d.cts +1 -1
- package/dist/ai.d.ts +1 -1
- package/dist/auth.cjs +179 -2
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +1 -1
- package/dist/auth.d.ts +1 -1
- package/dist/auth.mjs +179 -2
- package/dist/auth.mjs.map +1 -1
- package/dist/catalog.d.cts +1 -1
- package/dist/catalog.d.ts +1 -1
- package/dist/checkout.d.cts +1 -1
- package/dist/checkout.d.ts +1 -1
- package/dist/db-react.d.cts +1 -1
- package/dist/db-react.d.ts +1 -1
- package/dist/db.cjs +17 -0
- package/dist/db.cjs.map +1 -1
- package/dist/db.d.cts +1 -1
- package/dist/db.d.ts +1 -1
- package/dist/db.mjs +17 -1
- package/dist/db.mjs.map +1 -1
- package/dist/entitlements.d.cts +1 -1
- package/dist/entitlements.d.ts +1 -1
- package/dist/firestore-compat.d.cts +1 -1
- package/dist/firestore-compat.d.ts +1 -1
- package/dist/index.cjs +180 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +180 -3
- package/dist/index.mjs.map +1 -1
- package/dist/mocks.cjs +68 -1
- package/dist/mocks.cjs.map +1 -1
- package/dist/mocks.d.cts +17 -1
- package/dist/mocks.d.ts +17 -1
- package/dist/mocks.mjs +68 -1
- package/dist/mocks.mjs.map +1 -1
- package/dist/notifications.d.cts +1 -1
- package/dist/notifications.d.ts +1 -1
- package/dist/react.d.cts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/support.cjs +98 -1
- package/dist/support.cjs.map +1 -1
- package/dist/support.d.cts +1 -1
- package/dist/support.d.ts +1 -1
- package/dist/support.mjs +98 -1
- package/dist/support.mjs.map +1 -1
- package/dist/telemetry.d.cts +1 -1
- package/dist/telemetry.d.ts +1 -1
- package/dist/{types-DQplLXIk.d.cts → types-BoFSCHF_.d.cts} +117 -2
- package/dist/{types-DslphKIM.d.ts → types-DdJyqBy-.d.ts} +117 -2
- package/dist/usage.d.cts +1 -1
- package/dist/usage.d.ts +1 -1
- package/dist/webhooks.d.cts +1 -1
- package/dist/webhooks.d.ts +1 -1
- package/package.json +1 -1
package/dist/telemetry.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ag as ResolvedConfig, ar as TelemetryEventInput, aq as TelemetryEventAck, at as TelemetryLogInput, as as TelemetryLogAck } from './types-
|
|
1
|
+
import { ag as ResolvedConfig, ar as TelemetryEventInput, aq as TelemetryEventAck, at as TelemetryLogInput, as as TelemetryLogAck } from './types-DdJyqBy-.js';
|
|
2
2
|
import 'drizzle-orm/node-postgres';
|
|
3
3
|
import './errors.js';
|
|
4
4
|
|
|
@@ -1626,7 +1626,31 @@ type NeetruDbEngine = NeetruDbTransport;
|
|
|
1626
1626
|
interface NeetruDbOptions {
|
|
1627
1627
|
/**
|
|
1628
1628
|
* ID opaco do banco lógico — emitido pelo Core em `POST /api/sdk/v1/db`.
|
|
1629
|
-
*
|
|
1629
|
+
*
|
|
1630
|
+
* **O que `dbId` REALMENTE faz** (bug_58811a43 — o texto antigo deste
|
|
1631
|
+
* JSDoc afirmava, incorretamente, que ele era "necessário para scoping
|
|
1632
|
+
* das coleções"):
|
|
1633
|
+
* - Nomeia o cache offline LOCAL (IndexedDB) e o canal de coordenação
|
|
1634
|
+
* entre abas (Web Locks): `neetru-db__{productId}__{dbId}__{env}`.
|
|
1635
|
+
* - Quando `transport === 'nosql-vm'`, é embutido como `_dbId` nos frames
|
|
1636
|
+
* de subscribe/validate enviados ao gateway realtime (filtra a
|
|
1637
|
+
* subscription no servidor — ver `NeetruRealtimeClient`).
|
|
1638
|
+
*
|
|
1639
|
+
* **O que `dbId` NÃO faz:**
|
|
1640
|
+
* - NÃO escopa as escritas/leituras REST do mundo Documentos
|
|
1641
|
+
* (`add`/`set`/`update`/`remove`/`list`, via
|
|
1642
|
+
* `/api/sdk/v1/datastore/*`) — elas são escopadas SOMENTE por
|
|
1643
|
+
* `x-neetru-tenant` (`tenantId` ?? `productId`), em QUALQUER
|
|
1644
|
+
* transport (inclusive `nosql-vm`: writes sempre saem pelo REST por
|
|
1645
|
+
* baixo — ver `createRestSyncTransport`).
|
|
1646
|
+
* - NÃO é usado pelo lease SQL. `client.db.sql(schema, { database })`
|
|
1647
|
+
* desambigua entre N bancos SQL via `SqlOptions.database`, um
|
|
1648
|
+
* parâmetro totalmente separado — `dbId` nunca chega lá.
|
|
1649
|
+
*
|
|
1650
|
+
* Se o produto precisa de bancos logicamente separados no **servidor**,
|
|
1651
|
+
* isso é uma decisão server-side (tenant/produto ou schema do Core), não
|
|
1652
|
+
* `dbId`. Omitir `dbId` em contexto browser dispara um aviso único no
|
|
1653
|
+
* console (dev-only) lembrando dessa distinção.
|
|
1630
1654
|
*/
|
|
1631
1655
|
dbId?: string;
|
|
1632
1656
|
/**
|
|
@@ -1794,6 +1818,8 @@ declare function createRestSyncTransport(config?: ResolvedConfig): RealtimeTrans
|
|
|
1794
1818
|
* @param wsFactory Factory de WebSocket injetável (testes).
|
|
1795
1819
|
*/
|
|
1796
1820
|
declare function getWebSocketRealtimeClient(gatewayUrl: string, ticketProvider: TicketProvider, dbId?: string, wsFactory?: WebSocketFactory): NeetruRealtimeClient;
|
|
1821
|
+
/** @internal Reseta o guard one-time do aviso de `dbId` ausente — uso exclusivo de testes. */
|
|
1822
|
+
declare function __resetDbIdWarningForTests(): void;
|
|
1797
1823
|
/**
|
|
1798
1824
|
* Cria o namespace `client.db` completo.
|
|
1799
1825
|
*
|
|
@@ -2400,6 +2426,43 @@ interface SupportTicket {
|
|
|
2400
2426
|
updatedAt?: string;
|
|
2401
2427
|
/** Slug do produto referenciado. */
|
|
2402
2428
|
productSlug?: string;
|
|
2429
|
+
/**
|
|
2430
|
+
* 3.4: URL da página onde o feedback/problema foi originado (input de
|
|
2431
|
+
* `createTicket`). `null` quando não informado.
|
|
2432
|
+
*/
|
|
2433
|
+
pageUrl: string | null;
|
|
2434
|
+
/**
|
|
2435
|
+
* 3.4: URL do primeiro anexo (screenshot) do ticket, quando enviado via
|
|
2436
|
+
* `createTicket({ screenshotBase64 })`. `null` se nenhum anexo.
|
|
2437
|
+
*/
|
|
2438
|
+
screenshotUrl: string | null;
|
|
2439
|
+
/**
|
|
2440
|
+
* 3.4: ISO — setado pelo Core na transição do ticket pra `resolved`.
|
|
2441
|
+
* `null` enquanto não resolvido.
|
|
2442
|
+
*/
|
|
2443
|
+
resolvedAt: string | null;
|
|
2444
|
+
/**
|
|
2445
|
+
* 3.4: ISO — setado por `markResolvedSeen` (idempotente, só na 1ª vez que
|
|
2446
|
+
* o cliente vê a notificação de resolução). `null` até então.
|
|
2447
|
+
*/
|
|
2448
|
+
resolvedNotifiedAt: string | null;
|
|
2449
|
+
/**
|
|
2450
|
+
* 3.4: quantas vezes o modal de satisfação foi exibido
|
|
2451
|
+
* (`recordSatisfactionAttempt`). Default `0`.
|
|
2452
|
+
*/
|
|
2453
|
+
satisfactionAttempts: number;
|
|
2454
|
+
/** 3.4: ISO da última tentativa de exibição do modal de satisfação. */
|
|
2455
|
+
lastSatisfactionAttemptAt: string | null;
|
|
2456
|
+
/**
|
|
2457
|
+
* 3.4: ISO — setado por `submitSatisfaction` (avaliação OU skip). Marca o
|
|
2458
|
+
* ciclo de satisfação como concluído (terminal, até uma eventual
|
|
2459
|
+
* `contestTicket`).
|
|
2460
|
+
*/
|
|
2461
|
+
satisfiedAt: string | null;
|
|
2462
|
+
/** 3.4: nota CSAT 1-5, ou `null` se ainda não avaliado / pulado. */
|
|
2463
|
+
rating: number | null;
|
|
2464
|
+
/** 3.4: comentário opcional da avaliação de satisfação. */
|
|
2465
|
+
satisfactionComment: string | null;
|
|
2403
2466
|
}
|
|
2404
2467
|
interface CreateTicketInput {
|
|
2405
2468
|
subject: string;
|
|
@@ -2414,6 +2477,19 @@ interface CreateTicketInput {
|
|
|
2414
2477
|
* Chaves limitadas a 64 chars; valores primitive (string/number/boolean/null).
|
|
2415
2478
|
*/
|
|
2416
2479
|
metadata?: Record<string, string | number | boolean | null>;
|
|
2480
|
+
/**
|
|
2481
|
+
* 3.4: URL da página onde o problema/feedback ocorreu. Propagado como
|
|
2482
|
+
* `pageUrl` no ticket.
|
|
2483
|
+
*/
|
|
2484
|
+
pageUrl?: string;
|
|
2485
|
+
/**
|
|
2486
|
+
* 3.4: screenshot em data URL base64 (cap ~700KB — mesmo limite do
|
|
2487
|
+
* `report-problem.ts` do Core). O Core converte em `attachments`/
|
|
2488
|
+
* `screenshotAttached`.
|
|
2489
|
+
*/
|
|
2490
|
+
screenshotBase64?: string;
|
|
2491
|
+
/** 3.4: logs de console relevantes capturados no momento do report. */
|
|
2492
|
+
consoleLogs?: string;
|
|
2417
2493
|
}
|
|
2418
2494
|
interface SupportNamespace {
|
|
2419
2495
|
/**
|
|
@@ -2429,6 +2505,45 @@ interface SupportNamespace {
|
|
|
2429
2505
|
listMyTickets(options?: {
|
|
2430
2506
|
productSlug?: string;
|
|
2431
2507
|
}): Promise<SupportTicket[]>;
|
|
2508
|
+
/**
|
|
2509
|
+
* 3.4: marca que o usuário viu a notificação de resolução do ticket
|
|
2510
|
+
* (`resolvedNotifiedAt`, idempotente — só seta se ainda `null` no Core).
|
|
2511
|
+
* POST `/api/sdk/v1/support/tickets/{id}/resolved-seen`. Requer Bearer +
|
|
2512
|
+
* ownership + ticket em `resolved`.
|
|
2513
|
+
*/
|
|
2514
|
+
markResolvedSeen(ticketId: string): Promise<void>;
|
|
2515
|
+
/**
|
|
2516
|
+
* 3.4: registra uma tentativa de exibição do modal de satisfação
|
|
2517
|
+
* (`satisfactionAttempts += 1`, `lastSatisfactionAttemptAt = now`).
|
|
2518
|
+
* **Chamar no SHOW do modal, não na resposta** — exibir já conta como
|
|
2519
|
+
* tentativa, evita reprompt infinito. POST
|
|
2520
|
+
* `/api/sdk/v1/support/tickets/{id}/satisfaction-attempt`. Requer Bearer +
|
|
2521
|
+
* ownership + ticket em `resolved`.
|
|
2522
|
+
*/
|
|
2523
|
+
recordSatisfactionAttempt(ticketId: string): Promise<void>;
|
|
2524
|
+
/**
|
|
2525
|
+
* 3.4: envia (ou pula) a avaliação de satisfação. `rating` é CSAT 1-5 ou
|
|
2526
|
+
* `null` (junto de `skipped: true`). Terminal — seta `satisfiedAt`. POST
|
|
2527
|
+
* `/api/sdk/v1/support/tickets/{id}/satisfaction`. Requer Bearer +
|
|
2528
|
+
* ownership.
|
|
2529
|
+
*/
|
|
2530
|
+
submitSatisfaction(input: {
|
|
2531
|
+
ticketId: string;
|
|
2532
|
+
rating: number | null;
|
|
2533
|
+
comment?: string | null;
|
|
2534
|
+
skipped: boolean;
|
|
2535
|
+
}): Promise<void>;
|
|
2536
|
+
/**
|
|
2537
|
+
* 3.4: contesta um ticket resolvido — reabre (`status='open'`) e zera o
|
|
2538
|
+
* ciclo de satisfação/notificação (`resolvedAt`, `resolvedNotifiedAt`,
|
|
2539
|
+
* `satisfactionAttempts`, `lastSatisfactionAttemptAt`, `satisfiedAt`,
|
|
2540
|
+
* `rating`, `satisfactionComment`). POST
|
|
2541
|
+
* `/api/sdk/v1/support/tickets/{id}/contest`. Requer Bearer + ownership +
|
|
2542
|
+
* ticket em `resolved`.
|
|
2543
|
+
*/
|
|
2544
|
+
contestTicket(ticketId: string, opts?: {
|
|
2545
|
+
comment?: string;
|
|
2546
|
+
}): Promise<void>;
|
|
2432
2547
|
}
|
|
2433
2548
|
/**
|
|
2434
2549
|
* Modo do SDK. `dev` ativa mocks automáticos (úteis pra testes e
|
|
@@ -2458,4 +2573,4 @@ interface CatalogListOptions {
|
|
|
2458
2573
|
includeDrafts?: boolean;
|
|
2459
2574
|
}
|
|
2460
2575
|
|
|
2461
|
-
export { NeetruDbError 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 EntitlementCheck as O, type FieldSentinel as P, type IncrementSentinel as Q, type ListNotificationsOptions as R, MockCheckout as S, MockNotifications as T, MockWebhooks as U, NEETRU_SENTINEL_KEY as V, type NeetruClient as W, type NeetruClientConfig as X, type NeetruDb as Y, type NeetruDbDocuments as Z, type NeetruDbEngine as _, type AiChatMessage as a, type NeetruDbErrorCode as a0, type NeetruDbOptions as a1, type NeetruDbTransport as a2, type NeetruEnv as a3, type NeetruSqlClient as a4, type NeetruUser as a5, type NotificationScopeOptions as a6, type NotificationsNamespace as a7, type Product as a8, type ProductNotification as a9, type VerifyWebhookRequestResult as aA, type WebhookEndpoint as aB, type WebhookEvent as aC, type WebhookScopeOptions as aD, type WebhookTestResult as aE, type WebhooksNamespace as aF, type WithFieldSentinels as aG,
|
|
2576
|
+
export { NeetruDbError 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 EntitlementCheck as O, type FieldSentinel as P, type IncrementSentinel as Q, type ListNotificationsOptions as R, MockCheckout as S, MockNotifications as T, MockWebhooks as U, NEETRU_SENTINEL_KEY as V, type NeetruClient as W, type NeetruClientConfig as X, type NeetruDb as Y, type NeetruDbDocuments as Z, type NeetruDbEngine as _, type AiChatMessage as a, type NeetruDbErrorCode as a0, type NeetruDbOptions as a1, type NeetruDbTransport as a2, type NeetruEnv as a3, type NeetruSqlClient as a4, type NeetruUser as a5, type NotificationScopeOptions as a6, type NotificationsNamespace as a7, type Product as a8, type ProductNotification as a9, type VerifyWebhookRequestResult as aA, type WebhookEndpoint as aB, type WebhookEvent as aC, type WebhookScopeOptions as aD, type WebhookTestResult as aE, type WebhooksNamespace as aF, type WithFieldSentinels as aG, __resetDbIdWarningForTests as aH, createAiNamespace as aI, createCheckoutNamespace as aJ, createNeetruDb as aK, createNotificationsNamespace as aL, createRestSyncTransport as aM, createWebhooksNamespace as aN, getWebSocketRealtimeClient as aO, increment as aP, isFieldSentinel as aQ, isIncrementSentinel as aR, isServerTimestampSentinel as aS, serverTimestamp as aT, verifyWebhookRequest as aU, verifyWebhookSignature as aV, type ProductNotificationSeverity as aa, type ProductPlan as ab, type ProductStatus as ac, type RealtimeTransport as ad, type RedirectCallbackResult as ae, type RegisterWebhookInput as af, type ResolvedConfig as ag, type SendNotificationInput as ah, type ServerTimestampSentinel as ai, type SignInOptions as aj, type SqlOptions as ak, type SupportNamespace as al, type SupportSeverity as am, type SupportStatus as an, type SupportTicket as ao, type SyncState as ap, type TelemetryEventAck as aq, type TelemetryEventInput as ar, type TelemetryLogAck as as, type TelemetryLogInput as at, type Unsubscribe as au, type UsageEventInput as av, type UsageNamespace as aw, type UsageQuota as ax, type VerifyTokenOptions as ay, type VerifyWebhookRequestOptions 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 };
|
|
@@ -1626,7 +1626,31 @@ type NeetruDbEngine = NeetruDbTransport;
|
|
|
1626
1626
|
interface NeetruDbOptions {
|
|
1627
1627
|
/**
|
|
1628
1628
|
* ID opaco do banco lógico — emitido pelo Core em `POST /api/sdk/v1/db`.
|
|
1629
|
-
*
|
|
1629
|
+
*
|
|
1630
|
+
* **O que `dbId` REALMENTE faz** (bug_58811a43 — o texto antigo deste
|
|
1631
|
+
* JSDoc afirmava, incorretamente, que ele era "necessário para scoping
|
|
1632
|
+
* das coleções"):
|
|
1633
|
+
* - Nomeia o cache offline LOCAL (IndexedDB) e o canal de coordenação
|
|
1634
|
+
* entre abas (Web Locks): `neetru-db__{productId}__{dbId}__{env}`.
|
|
1635
|
+
* - Quando `transport === 'nosql-vm'`, é embutido como `_dbId` nos frames
|
|
1636
|
+
* de subscribe/validate enviados ao gateway realtime (filtra a
|
|
1637
|
+
* subscription no servidor — ver `NeetruRealtimeClient`).
|
|
1638
|
+
*
|
|
1639
|
+
* **O que `dbId` NÃO faz:**
|
|
1640
|
+
* - NÃO escopa as escritas/leituras REST do mundo Documentos
|
|
1641
|
+
* (`add`/`set`/`update`/`remove`/`list`, via
|
|
1642
|
+
* `/api/sdk/v1/datastore/*`) — elas são escopadas SOMENTE por
|
|
1643
|
+
* `x-neetru-tenant` (`tenantId` ?? `productId`), em QUALQUER
|
|
1644
|
+
* transport (inclusive `nosql-vm`: writes sempre saem pelo REST por
|
|
1645
|
+
* baixo — ver `createRestSyncTransport`).
|
|
1646
|
+
* - NÃO é usado pelo lease SQL. `client.db.sql(schema, { database })`
|
|
1647
|
+
* desambigua entre N bancos SQL via `SqlOptions.database`, um
|
|
1648
|
+
* parâmetro totalmente separado — `dbId` nunca chega lá.
|
|
1649
|
+
*
|
|
1650
|
+
* Se o produto precisa de bancos logicamente separados no **servidor**,
|
|
1651
|
+
* isso é uma decisão server-side (tenant/produto ou schema do Core), não
|
|
1652
|
+
* `dbId`. Omitir `dbId` em contexto browser dispara um aviso único no
|
|
1653
|
+
* console (dev-only) lembrando dessa distinção.
|
|
1630
1654
|
*/
|
|
1631
1655
|
dbId?: string;
|
|
1632
1656
|
/**
|
|
@@ -1794,6 +1818,8 @@ declare function createRestSyncTransport(config?: ResolvedConfig): RealtimeTrans
|
|
|
1794
1818
|
* @param wsFactory Factory de WebSocket injetável (testes).
|
|
1795
1819
|
*/
|
|
1796
1820
|
declare function getWebSocketRealtimeClient(gatewayUrl: string, ticketProvider: TicketProvider, dbId?: string, wsFactory?: WebSocketFactory): NeetruRealtimeClient;
|
|
1821
|
+
/** @internal Reseta o guard one-time do aviso de `dbId` ausente — uso exclusivo de testes. */
|
|
1822
|
+
declare function __resetDbIdWarningForTests(): void;
|
|
1797
1823
|
/**
|
|
1798
1824
|
* Cria o namespace `client.db` completo.
|
|
1799
1825
|
*
|
|
@@ -2400,6 +2426,43 @@ interface SupportTicket {
|
|
|
2400
2426
|
updatedAt?: string;
|
|
2401
2427
|
/** Slug do produto referenciado. */
|
|
2402
2428
|
productSlug?: string;
|
|
2429
|
+
/**
|
|
2430
|
+
* 3.4: URL da página onde o feedback/problema foi originado (input de
|
|
2431
|
+
* `createTicket`). `null` quando não informado.
|
|
2432
|
+
*/
|
|
2433
|
+
pageUrl: string | null;
|
|
2434
|
+
/**
|
|
2435
|
+
* 3.4: URL do primeiro anexo (screenshot) do ticket, quando enviado via
|
|
2436
|
+
* `createTicket({ screenshotBase64 })`. `null` se nenhum anexo.
|
|
2437
|
+
*/
|
|
2438
|
+
screenshotUrl: string | null;
|
|
2439
|
+
/**
|
|
2440
|
+
* 3.4: ISO — setado pelo Core na transição do ticket pra `resolved`.
|
|
2441
|
+
* `null` enquanto não resolvido.
|
|
2442
|
+
*/
|
|
2443
|
+
resolvedAt: string | null;
|
|
2444
|
+
/**
|
|
2445
|
+
* 3.4: ISO — setado por `markResolvedSeen` (idempotente, só na 1ª vez que
|
|
2446
|
+
* o cliente vê a notificação de resolução). `null` até então.
|
|
2447
|
+
*/
|
|
2448
|
+
resolvedNotifiedAt: string | null;
|
|
2449
|
+
/**
|
|
2450
|
+
* 3.4: quantas vezes o modal de satisfação foi exibido
|
|
2451
|
+
* (`recordSatisfactionAttempt`). Default `0`.
|
|
2452
|
+
*/
|
|
2453
|
+
satisfactionAttempts: number;
|
|
2454
|
+
/** 3.4: ISO da última tentativa de exibição do modal de satisfação. */
|
|
2455
|
+
lastSatisfactionAttemptAt: string | null;
|
|
2456
|
+
/**
|
|
2457
|
+
* 3.4: ISO — setado por `submitSatisfaction` (avaliação OU skip). Marca o
|
|
2458
|
+
* ciclo de satisfação como concluído (terminal, até uma eventual
|
|
2459
|
+
* `contestTicket`).
|
|
2460
|
+
*/
|
|
2461
|
+
satisfiedAt: string | null;
|
|
2462
|
+
/** 3.4: nota CSAT 1-5, ou `null` se ainda não avaliado / pulado. */
|
|
2463
|
+
rating: number | null;
|
|
2464
|
+
/** 3.4: comentário opcional da avaliação de satisfação. */
|
|
2465
|
+
satisfactionComment: string | null;
|
|
2403
2466
|
}
|
|
2404
2467
|
interface CreateTicketInput {
|
|
2405
2468
|
subject: string;
|
|
@@ -2414,6 +2477,19 @@ interface CreateTicketInput {
|
|
|
2414
2477
|
* Chaves limitadas a 64 chars; valores primitive (string/number/boolean/null).
|
|
2415
2478
|
*/
|
|
2416
2479
|
metadata?: Record<string, string | number | boolean | null>;
|
|
2480
|
+
/**
|
|
2481
|
+
* 3.4: URL da página onde o problema/feedback ocorreu. Propagado como
|
|
2482
|
+
* `pageUrl` no ticket.
|
|
2483
|
+
*/
|
|
2484
|
+
pageUrl?: string;
|
|
2485
|
+
/**
|
|
2486
|
+
* 3.4: screenshot em data URL base64 (cap ~700KB — mesmo limite do
|
|
2487
|
+
* `report-problem.ts` do Core). O Core converte em `attachments`/
|
|
2488
|
+
* `screenshotAttached`.
|
|
2489
|
+
*/
|
|
2490
|
+
screenshotBase64?: string;
|
|
2491
|
+
/** 3.4: logs de console relevantes capturados no momento do report. */
|
|
2492
|
+
consoleLogs?: string;
|
|
2417
2493
|
}
|
|
2418
2494
|
interface SupportNamespace {
|
|
2419
2495
|
/**
|
|
@@ -2429,6 +2505,45 @@ interface SupportNamespace {
|
|
|
2429
2505
|
listMyTickets(options?: {
|
|
2430
2506
|
productSlug?: string;
|
|
2431
2507
|
}): Promise<SupportTicket[]>;
|
|
2508
|
+
/**
|
|
2509
|
+
* 3.4: marca que o usuário viu a notificação de resolução do ticket
|
|
2510
|
+
* (`resolvedNotifiedAt`, idempotente — só seta se ainda `null` no Core).
|
|
2511
|
+
* POST `/api/sdk/v1/support/tickets/{id}/resolved-seen`. Requer Bearer +
|
|
2512
|
+
* ownership + ticket em `resolved`.
|
|
2513
|
+
*/
|
|
2514
|
+
markResolvedSeen(ticketId: string): Promise<void>;
|
|
2515
|
+
/**
|
|
2516
|
+
* 3.4: registra uma tentativa de exibição do modal de satisfação
|
|
2517
|
+
* (`satisfactionAttempts += 1`, `lastSatisfactionAttemptAt = now`).
|
|
2518
|
+
* **Chamar no SHOW do modal, não na resposta** — exibir já conta como
|
|
2519
|
+
* tentativa, evita reprompt infinito. POST
|
|
2520
|
+
* `/api/sdk/v1/support/tickets/{id}/satisfaction-attempt`. Requer Bearer +
|
|
2521
|
+
* ownership + ticket em `resolved`.
|
|
2522
|
+
*/
|
|
2523
|
+
recordSatisfactionAttempt(ticketId: string): Promise<void>;
|
|
2524
|
+
/**
|
|
2525
|
+
* 3.4: envia (ou pula) a avaliação de satisfação. `rating` é CSAT 1-5 ou
|
|
2526
|
+
* `null` (junto de `skipped: true`). Terminal — seta `satisfiedAt`. POST
|
|
2527
|
+
* `/api/sdk/v1/support/tickets/{id}/satisfaction`. Requer Bearer +
|
|
2528
|
+
* ownership.
|
|
2529
|
+
*/
|
|
2530
|
+
submitSatisfaction(input: {
|
|
2531
|
+
ticketId: string;
|
|
2532
|
+
rating: number | null;
|
|
2533
|
+
comment?: string | null;
|
|
2534
|
+
skipped: boolean;
|
|
2535
|
+
}): Promise<void>;
|
|
2536
|
+
/**
|
|
2537
|
+
* 3.4: contesta um ticket resolvido — reabre (`status='open'`) e zera o
|
|
2538
|
+
* ciclo de satisfação/notificação (`resolvedAt`, `resolvedNotifiedAt`,
|
|
2539
|
+
* `satisfactionAttempts`, `lastSatisfactionAttemptAt`, `satisfiedAt`,
|
|
2540
|
+
* `rating`, `satisfactionComment`). POST
|
|
2541
|
+
* `/api/sdk/v1/support/tickets/{id}/contest`. Requer Bearer + ownership +
|
|
2542
|
+
* ticket em `resolved`.
|
|
2543
|
+
*/
|
|
2544
|
+
contestTicket(ticketId: string, opts?: {
|
|
2545
|
+
comment?: string;
|
|
2546
|
+
}): Promise<void>;
|
|
2432
2547
|
}
|
|
2433
2548
|
/**
|
|
2434
2549
|
* Modo do SDK. `dev` ativa mocks automáticos (úteis pra testes e
|
|
@@ -2458,4 +2573,4 @@ interface CatalogListOptions {
|
|
|
2458
2573
|
includeDrafts?: boolean;
|
|
2459
2574
|
}
|
|
2460
2575
|
|
|
2461
|
-
export { NeetruDbError 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 EntitlementCheck as O, type FieldSentinel as P, type IncrementSentinel as Q, type ListNotificationsOptions as R, MockCheckout as S, MockNotifications as T, MockWebhooks as U, NEETRU_SENTINEL_KEY as V, type NeetruClient as W, type NeetruClientConfig as X, type NeetruDb as Y, type NeetruDbDocuments as Z, type NeetruDbEngine as _, type AiChatMessage as a, type NeetruDbErrorCode as a0, type NeetruDbOptions as a1, type NeetruDbTransport as a2, type NeetruEnv as a3, type NeetruSqlClient as a4, type NeetruUser as a5, type NotificationScopeOptions as a6, type NotificationsNamespace as a7, type Product as a8, type ProductNotification as a9, type VerifyWebhookRequestResult as aA, type WebhookEndpoint as aB, type WebhookEvent as aC, type WebhookScopeOptions as aD, type WebhookTestResult as aE, type WebhooksNamespace as aF, type WithFieldSentinels as aG,
|
|
2576
|
+
export { NeetruDbError 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 EntitlementCheck as O, type FieldSentinel as P, type IncrementSentinel as Q, type ListNotificationsOptions as R, MockCheckout as S, MockNotifications as T, MockWebhooks as U, NEETRU_SENTINEL_KEY as V, type NeetruClient as W, type NeetruClientConfig as X, type NeetruDb as Y, type NeetruDbDocuments as Z, type NeetruDbEngine as _, type AiChatMessage as a, type NeetruDbErrorCode as a0, type NeetruDbOptions as a1, type NeetruDbTransport as a2, type NeetruEnv as a3, type NeetruSqlClient as a4, type NeetruUser as a5, type NotificationScopeOptions as a6, type NotificationsNamespace as a7, type Product as a8, type ProductNotification as a9, type VerifyWebhookRequestResult as aA, type WebhookEndpoint as aB, type WebhookEvent as aC, type WebhookScopeOptions as aD, type WebhookTestResult as aE, type WebhooksNamespace as aF, type WithFieldSentinels as aG, __resetDbIdWarningForTests as aH, createAiNamespace as aI, createCheckoutNamespace as aJ, createNeetruDb as aK, createNotificationsNamespace as aL, createRestSyncTransport as aM, createWebhooksNamespace as aN, getWebSocketRealtimeClient as aO, increment as aP, isFieldSentinel as aQ, isIncrementSentinel as aR, isServerTimestampSentinel as aS, serverTimestamp as aT, verifyWebhookRequest as aU, verifyWebhookSignature as aV, type ProductNotificationSeverity as aa, type ProductPlan as ab, type ProductStatus as ac, type RealtimeTransport as ad, type RedirectCallbackResult as ae, type RegisterWebhookInput as af, type ResolvedConfig as ag, type SendNotificationInput as ah, type ServerTimestampSentinel as ai, type SignInOptions as aj, type SqlOptions as ak, type SupportNamespace as al, type SupportSeverity as am, type SupportStatus as an, type SupportTicket as ao, type SyncState as ap, type TelemetryEventAck as aq, type TelemetryEventInput as ar, type TelemetryLogAck as as, type TelemetryLogInput as at, type Unsubscribe as au, type UsageEventInput as av, type UsageNamespace as aw, type UsageQuota as ax, type VerifyTokenOptions as ay, type VerifyWebhookRequestOptions 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 };
|
package/dist/usage.d.cts
CHANGED
package/dist/usage.d.ts
CHANGED
package/dist/webhooks.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { U as MockWebhooks, af as RegisterWebhookInput, az as VerifyWebhookRequestOptions, aA as VerifyWebhookRequestResult, aB as WebhookEndpoint, aC as WebhookEvent, aD as WebhookScopeOptions, aE as WebhookTestResult, aF as WebhooksNamespace,
|
|
1
|
+
export { U as MockWebhooks, af as RegisterWebhookInput, az as VerifyWebhookRequestOptions, aA as VerifyWebhookRequestResult, aB as WebhookEndpoint, aC as WebhookEvent, aD as WebhookScopeOptions, aE as WebhookTestResult, aF as WebhooksNamespace, aN as createWebhooksNamespace, aU as verifyWebhookRequest, aV as verifyWebhookSignature } from './types-BoFSCHF_.cjs';
|
|
2
2
|
import 'drizzle-orm/node-postgres';
|
|
3
3
|
import './errors.cjs';
|
package/dist/webhooks.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { U as MockWebhooks, af as RegisterWebhookInput, az as VerifyWebhookRequestOptions, aA as VerifyWebhookRequestResult, aB as WebhookEndpoint, aC as WebhookEvent, aD as WebhookScopeOptions, aE as WebhookTestResult, aF as WebhooksNamespace,
|
|
1
|
+
export { U as MockWebhooks, af as RegisterWebhookInput, az as VerifyWebhookRequestOptions, aA as VerifyWebhookRequestResult, aB as WebhookEndpoint, aC as WebhookEvent, aD as WebhookScopeOptions, aE as WebhookTestResult, aF as WebhooksNamespace, aN as createWebhooksNamespace, aU as verifyWebhookRequest, aV as verifyWebhookSignature } from './types-DdJyqBy-.js';
|
|
2
2
|
import 'drizzle-orm/node-postgres';
|
|
3
3
|
import './errors.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neetru/sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"description": "Neetru SDK 3.0 — biblioteca runtime universal (browser/Node/Edge) para consumir o ecossistema Neetru. Paths canonical /api/sdk/v1/*, productId obrigatório, Idempotency-Key em mutations, WebCrypto signatures, baseUrl allowlist fail-closed.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|