The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Enable Upstash Redis partner search provider
Rafief07cd77890d
diff --git a/apps/web/.env.example b/apps/web/.env.exampleindex fe76db1ae1..9df605790c 100644--- a/apps/web/.env.example+++ b/apps/web/.env.example@@ -23,6 +23,10 @@ PLANETSCALE_DATABASE_URL="http://root:unused@localhost:3900/planetscale"UPSTASH_REDIS_REST_URL=UPSTASH_REDIS_REST_TOKEN=+# Full-text partner search+PARTNER_SEARCH_PROVIDER=+PARTNER_SEARCH_INDEX_NAME=partner-search-v1+# Upstash QStash – required for queues and background jobs# Get your QStash Token here: https://upstash.com/docs/qstash/overall/getstartedQSTASH_URL="https://qstash-us-east-1.upstash.io"@@ -189,4 +193,4 @@ E2E_PARTNER_PASSWORD=# Veriff (Identity Verification)VERIFF_API_KEY=-VERIFF_SHARED_SECRET=\ No newline at end of file+VERIFF_SHARED_SECRET=diff --git a/apps/web/lib/api/partners/search/index.ts b/apps/web/lib/api/partners/search/index.tsindex 38fdd9bc0e..0091f735be 100644--- a/apps/web/lib/api/partners/search/index.ts+++ b/apps/web/lib/api/partners/search/index.ts@@ -7,3 +7,4 @@ export * from "./searchable-values";export * from "./serialize-document";export * from "./sync-documents";export * from "./types";+export * from "./upstash-redis-provider";diff --git a/apps/web/lib/api/partners/search/provider.ts b/apps/web/lib/api/partners/search/provider.tsindex 93c48ec684..754ad80ea9 100644--- a/apps/web/lib/api/partners/search/provider.ts+++ b/apps/web/lib/api/partners/search/provider.ts@@ -1,5 +1,22 @@-import { PartnerSearchProvider } from "./types";+import type { PartnerSearchProvider } from "./types";+import { createUpstashRedisPartnerSearchProvider } from "./upstash-redis-provider";++let upstashRedisProvider: PartnerSearchProvider | null = null;export function getPartnerSearchProvider(): PartnerSearchProvider | null {- return null;+ const provider = process.env.PARTNER_SEARCH_PROVIDER?.trim();++ if (!provider) {+ return null;+ }++ if (provider !== "upstash-redis") {+ throw new Error(`Unsupported partner search provider: ${provider}`);+ }++ if (!upstashRedisProvider) {+ upstashRedisProvider = createUpstashRedisPartnerSearchProvider();+ }++ return upstashRedisProvider;}diff --git a/apps/web/lib/api/partners/search/upstash-redis-provider.ts b/apps/web/lib/api/partners/search/upstash-redis-provider.tsnew file mode 100644index 0000000000..421725d819--- /dev/null+++ b/apps/web/lib/api/partners/search/upstash-redis-provider.ts@@ -0,0 +1,590 @@+import { chunk } from "@dub/utils";+import {+ Redis,+ s,+ type InferFilterFromSchema,+ type SearchIndex,+} from "@upstash/redis";+import {+ getPartnerSearchableValues,+ normalizePartnerSearchQuery,+} from "./searchable-values";+import type {+ PartnerSearchCountQuery,+ PartnerSearchDocument,+ PartnerSearchGroup,+ PartnerSearchGroupField,+ PartnerSearchListFilter,+ PartnerSearchMetricField,+ PartnerSearchProvider,+ PartnerSearchQuery,+} from "./types";++const DEFAULT_INDEX_NAME = "partner-search-v1";+const NULL_VALUE = "__none__";+const MAX_GROUPS = 1_000;+const TRANSIENT_RETRY_ATTEMPTS = 2;+const WRITE_BATCH_SIZE = 100;+const DOCUMENT_TYPE_PARTNER = "partner";+const DOCUMENT_TYPE_TAG = "tag";++// Upstash does not index JSON arrays as keyword fields, so tag shadow documents handle tag grouping in the same index+export const upstashPartnerSearchSchema = s.object({+ id: s.keyword(),+ programId: s.keyword(),+ partnerId: s.keyword(),+ documentType: s.keyword(),+ searchText: s.string().noStem(),+ emailNgrams: s.string().noStem(),+ status: s.keyword(),+ tenantId: s.keyword(),+ groupId: s.keyword(),+ country: s.keyword(),+ partnerTagIds: s.string().noStem(),+ partnerTagId: s.keyword(),+ referredByPartnerId: s.keyword(),+ totalClicks: s.number("F64"),+ totalLeads: s.number("F64"),+ totalConversions: s.number("F64"),+ totalSaleAmount: s.number("F64"),+ totalCommissions: s.number("F64"),+ netRevenue: s.number("F64"),+ earningsPerClick: s.number("F64"),+ averageLifetimeValue: s.number("F64"),+ clickToLeadRate: s.number("F64"),+ clickToConversionRate: s.number("F64"),+ leadToConversionRate: s.number("F64"),+ returnOnAdSpend: s.number("F64"),+ createdAt: s.date().fast(),+});++type UpstashPartnerSearchSchema = typeof upstashPartnerSearchSchema;+type UpstashPartnerSearchFilter =+ InferFilterFromSchema<UpstashPartnerSearchSchema>;+type UpstashPartnerSearchIndex = SearchIndex<UpstashPartnerSearchSchema>;++interface UpstashPartnerSearchDocument extends Record<string, unknown> {+ id: string;+ programId: string;+ partnerId: string;+ documentType: typeof DOCUMENT_TYPE_PARTNER | typeof DOCUMENT_TYPE_TAG;+ searchText: string;+ emailNgrams: string;+ status: string;+ tenantId: string;+ groupId: string;+ country: string;+ partnerTagIds: string;+ partnerTagIdsRaw: string[];+ partnerTagId: string;+ referredByPartnerId: string;+ totalClicks: number;+ totalLeads: number;+ totalConversions: number;+ totalSaleAmount: number;+ totalCommissions: number;+ netRevenue: number;+ earningsPerClick: number;+ averageLifetimeValue?: number;+ clickToLeadRate?: number;+ clickToConversionRate?: number;+ leadToConversionRate?: number;+ returnOnAdSpend?: number;+ createdAt: string;+}++interface CreateUpstashRedisPartnerSearchProviderOptions {+ redisClient?: Redis;+ indexName?: string;+}++function getIndexName(indexName?: string): string {+ return (+ indexName ??+ process.env.PARTNER_SEARCH_INDEX_NAME?.trim() ??+ DEFAULT_INDEX_NAME+ );+}++function getDocumentPrefix(indexName: string): string {+ return `${indexName}:`;+}++function getDocumentKey(indexName: string, documentId: string): string {+ return `${getDocumentPrefix(indexName)}partner:${documentId}`;+}++function getTagDocumentKey(+ indexName: string,+ documentId: string,+ partnerTagId: string,+): string {+ return `${getDocumentPrefix(indexName)}tag:${documentId}:${partnerTagId}`;+}++function createRedisClient(): Redis {+ const url = process.env.UPSTASH_REDIS_REST_URL;+ const token = process.env.UPSTASH_REDIS_REST_TOKEN;++ if (!url || !token) {+ throw new Error(+ "UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN are required for partner search.",+ );+ }++ return new Redis({ url, token });+}++function getEmailNgrams(email: string | null): string {+ if (!email) {+ return "";+ }++ const normalized = normalizePartnerSearchQuery(email);+ if (normalized.length < 3) {+ return normalized;+ }++ // Three-character tokens support partial email matches without a leading-wildcard regex query+ return Array.from(+ new Set(+ Array.from({ length: normalized.length - 2 }, (_, index) =>+ normalized.slice(index, index + 3),+ ),+ ),+ ).join(" ");+}++function getQueryNgrams(query: string): string[] {+ if (query.length < 3 || /\s/u.test(query)) {+ return [];+ }++ return Array.from(+ new Set(+ Array.from({ length: query.length - 2 }, (_, index) =>+ query.slice(index, index + 3),+ ),+ ),+ );+}++function escapeRegex(value: string): string {+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");+}++function serializeUpstashDocument(+ document: PartnerSearchDocument,+ documentType: typeof DOCUMENT_TYPE_PARTNER | typeof DOCUMENT_TYPE_TAG,+ partnerTagId = NULL_VALUE,+): UpstashPartnerSearchDocument {+ return {+ id: document.id,+ programId: document.programId,+ partnerId: document.partnerId,+ documentType,+ searchText: getPartnerSearchableValues(document)+ .map(normalizePartnerSearchQuery)+ .join(" "),+ emailNgrams: getEmailNgrams(document.email),+ status: document.status,+ tenantId: document.tenantId ?? NULL_VALUE,+ groupId: document.groupId ?? NULL_VALUE,+ country: document.country ?? NULL_VALUE,+ partnerTagIds: document.partnerTagIds.join(" "),+ partnerTagIdsRaw: document.partnerTagIds,+ partnerTagId,+ referredByPartnerId: document.referredByPartnerId ?? NULL_VALUE,+ totalClicks: document.totalClicks,+ totalLeads: document.totalLeads,+ totalConversions: document.totalConversions,+ totalSaleAmount: document.totalSaleAmount,+ totalCommissions: document.totalCommissions,+ netRevenue: document.netRevenue,+ earningsPerClick: document.earningsPerClick,+ ...(document.averageLifetimeValue !== null && {+ averageLifetimeValue: document.averageLifetimeValue,+ }),+ ...(document.clickToLeadRate !== null && {+ clickToLeadRate: document.clickToLeadRate,+ }),+ ...(document.clickToConversionRate !== null && {+ clickToConversionRate: document.clickToConversionRate,+ }),+ ...(document.leadToConversionRate !== null && {+ leadToConversionRate: document.leadToConversionRate,+ }),+ ...(document.returnOnAdSpend !== null && {+ returnOnAdSpend: document.returnOnAdSpend,+ }),+ createdAt: document.createdAt,+ };+}++function buildListFilter(+ field: "groupId" | "country" | "partnerTagIds",+ filter: PartnerSearchListFilter,+): {+ include?: UpstashPartnerSearchFilter;+ exclude?: UpstashPartnerSearchFilter;+} {+ const condition = {+ [field]: { $in: filter.values },+ } as UpstashPartnerSearchFilter;++ return filter.operator === "IN"+ ? { include: condition }+ : { exclude: condition };+}++function buildTextFilter(query: string): UpstashPartnerSearchFilter {+ const alternatives: UpstashPartnerSearchFilter[] = [+ { searchText: { $smart: query } },+ ];++ if (!/\s/u.test(query)) {+ alternatives.push({ searchText: { $regex: `${escapeRegex(query)}.*` } });+ }++ const emailNgrams = getQueryNgrams(query);+ if (emailNgrams.length > 0) {+ alternatives.push({+ $must: emailNgrams.map((ngram) => ({ emailNgrams: ngram })),+ });+ }++ return { $should: alternatives } as unknown as UpstashPartnerSearchFilter;+}++function buildUpstashFilter(+ { programId, query, filters }: PartnerSearchCountQuery,+ documentType:+ | typeof DOCUMENT_TYPE_PARTNER+ | typeof DOCUMENT_TYPE_TAG = DOCUMENT_TYPE_PARTNER,+): UpstashPartnerSearchFilter {+ const must: UpstashPartnerSearchFilter[] = [+ { documentType: { $eq: documentType } },+ { programId: { $eq: programId } },+ buildTextFilter(normalizePartnerSearchQuery(query)),+ ];+ const mustNot: UpstashPartnerSearchFilter[] = [];++ if (filters?.status) {+ must.push({ status: { $eq: filters.status } });+ }+ if (filters?.tenantId) {+ must.push({ tenantId: { $eq: filters.tenantId } });+ }+ if (filters?.partnerIds?.length) {+ must.push({ partnerId: { $in: filters.partnerIds } });+ }++ const listFilters: [+ "groupId" | "country" | "partnerTagIds",+ PartnerSearchListFilter | undefined,+ ][] = [+ ["groupId", filters?.groupIds],+ ["country", filters?.countries],+ ["partnerTagIds", filters?.partnerTagIds],+ ];++ for (const [field, listFilter] of listFilters) {+ if (!listFilter) {+ continue;+ }++ const { include, exclude } = buildListFilter(field, listFilter);+ if (include) {+ must.push(include);+ }+ if (exclude) {+ mustNot.push(exclude);+ }+ }++ if (filters?.referredByPartnerId) {+ must.push({+ referredByPartnerId: { $eq: filters.referredByPartnerId },+ });+ }++ for (const [field, range] of Object.entries(filters?.metrics ?? {})) {+ const condition = {+ ...(range.min !== undefined && { $gte: range.min }),+ ...(range.max !== undefined && { $lte: range.max }),+ };+ must.push({+ [field as PartnerSearchMetricField]: condition,+ } as UpstashPartnerSearchFilter);+ }++ return {+ $must: must,+ ...(mustNot.length > 0 && { $mustNot: mustNot }),+ } as UpstashPartnerSearchFilter;+}++function isTransientError(error: unknown): boolean {+ if (error instanceof TypeError) {+ return true;+ }++ const message = error instanceof Error ? error.message : String(error);+ return /\b(429|500|502|503|504)\b|rate.?limit|timeout|timed out|fetch failed|network|ECONNRESET|ETIMEDOUT/i.test(+ message,+ );+}++async function withTransientRetry<T>(operation: () => Promise<T>): Promise<T> {+ for (let attempt = 1; attempt <= TRANSIENT_RETRY_ATTEMPTS; attempt++) {+ try {+ return await operation();+ } catch (error) {+ if (attempt === TRANSIENT_RETRY_ATTEMPTS || !isTransientError(error)) {+ throw error;+ }++ await new Promise((resolve) =>+ setTimeout(resolve, 50 * attempt + Math.random() * 25),+ );+ }+ }++ throw new Error("Partner search operation failed.");+}++function getGroupIndexField(+ field: PartnerSearchGroupField,+): "status" | "country" | "groupId" | "partnerTagId" | "referredByPartnerId" {+ return field;+}++function mapGroupValue(value: string): string | null {+ return value === NULL_VALUE ? null : value;+}++function getStoredDocument(+ value: UpstashPartnerSearchDocument[] | null,+): UpstashPartnerSearchDocument | null {+ return value?.[0] ?? null;+}++async function getStoredDocuments(+ redisClient: Redis,+ indexName: string,+ documentIds: string[],+): Promise<(UpstashPartnerSearchDocument | null)[]> {+ if (documentIds.length === 0) {+ return [];+ }++ const values = await withTransientRetry(() =>+ redisClient.json.mget<(UpstashPartnerSearchDocument[] | null)[]>(+ documentIds.map((documentId) => getDocumentKey(indexName, documentId)),+ "$",+ ),+ );++ return values.map(getStoredDocument);+}++function getStaleTagDocumentKeys(+ indexName: string,+ documents: PartnerSearchDocument[],+ storedDocuments: (UpstashPartnerSearchDocument | null)[],+): string[] {+ return documents.flatMap((document, index) => {+ const currentTagIds = new Set(document.partnerTagIds);+ return (storedDocuments[index]?.partnerTagIdsRaw ?? [])+ .filter((partnerTagId) => !currentTagIds.has(partnerTagId))+ .map((partnerTagId) =>+ getTagDocumentKey(indexName, document.id, partnerTagId),+ );+ });+}++function getUpsertEntries(+ indexName: string,+ documents: PartnerSearchDocument[],+) {+ return documents.flatMap((document) => [+ {+ key: getDocumentKey(indexName, document.id),+ path: "$",+ value: serializeUpstashDocument(document, DOCUMENT_TYPE_PARTNER),+ },+ ...document.partnerTagIds.map((partnerTagId) => ({+ key: getTagDocumentKey(indexName, document.id, partnerTagId),+ path: "$",+ value: serializeUpstashDocument(+ document,+ DOCUMENT_TYPE_TAG,+ partnerTagId,+ ),+ })),+ ]);+}++async function upsertDocumentBatch(+ redisClient: Redis,+ indexName: string,+ documents: PartnerSearchDocument[],+) {+ const storedDocuments = await getStoredDocuments(+ redisClient,+ indexName,+ documents.map(({ id }) => id),+ );+ const staleTagDocumentKeys = getStaleTagDocumentKeys(+ indexName,+ documents,+ storedDocuments,+ );++ if (staleTagDocumentKeys.length > 0) {+ await withTransientRetry(() => redisClient.del(...staleTagDocumentKeys));+ }++ await withTransientRetry(() =>+ redisClient.json.mset(...getUpsertEntries(indexName, documents)),+ );+}++async function deleteDocumentBatch(+ redisClient: Redis,+ indexName: string,+ documentIds: string[],+) {+ const storedDocuments = await getStoredDocuments(+ redisClient,+ indexName,+ documentIds,+ );+ const tagDocumentKeys = storedDocuments.flatMap((document, index) =>+ (document?.partnerTagIdsRaw ?? []).map((partnerTagId) =>+ getTagDocumentKey(indexName, documentIds[index]!, partnerTagId),+ ),+ );++ await withTransientRetry(() =>+ redisClient.del(+ ...documentIds.map((documentId) => getDocumentKey(indexName, documentId)),+ ...tagDocumentKeys,+ ),+ );+}++export async function createUpstashRedisPartnerSearchIndex({+ redisClient = createRedisClient(),+ indexName,+}: CreateUpstashRedisPartnerSearchProviderOptions = {}) {+ const resolvedIndexName = getIndexName(indexName);++ return redisClient.search.createIndex({+ name: resolvedIndexName,+ dataType: "json",+ prefix: getDocumentPrefix(resolvedIndexName),+ schema: upstashPartnerSearchSchema,+ skipInitialScan: true,+ existsOk: true,+ });+}++export function createUpstashRedisPartnerSearchProvider({+ redisClient = createRedisClient(),+ indexName,+}: CreateUpstashRedisPartnerSearchProviderOptions = {}): PartnerSearchProvider {+ const resolvedIndexName = getIndexName(indexName);+ const index: UpstashPartnerSearchIndex = redisClient.search.index({+ name: resolvedIndexName,+ schema: upstashPartnerSearchSchema,+ });++ return {+ async search(query: PartnerSearchQuery) {+ const filter = buildUpstashFilter(query);+ const offset = (query.page - 1) * query.pageSize;+ const orderBy = query.sort+ ? ({+ [query.sort.field]: query.sort.order.toUpperCase(),+ } as Record<string, "ASC" | "DESC">)+ : undefined;++ const [results, { count }] = await Promise.all([+ withTransientRetry(() =>+ index.query({+ filter,+ limit: query.pageSize,+ offset,+ select: { id: true, partnerId: true },+ ...(orderBy && { orderBy }),+ }),+ ),+ withTransientRetry(() => index.count({ filter })),+ ]);++ return {+ hits: results.map(({ data, score }) => ({+ id: data.id,+ partnerId: data.partnerId,+ score,+ })),+ total: count,+ };+ },++ async count(query) {+ const result = await withTransientRetry(() =>+ index.count({ filter: buildUpstashFilter(query) }),+ );+ return result.count;+ },++ async groupBy(query, field): Promise<PartnerSearchGroup[]> {+ const indexField = getGroupIndexField(field);+ const documentType =+ field === "partnerTagId" ? DOCUMENT_TYPE_TAG : DOCUMENT_TYPE_PARTNER;+ const result = await withTransientRetry(() =>+ index.aggregate({+ filter: buildUpstashFilter(query, documentType),+ aggregations: {+ groups: {+ $terms: {+ field: indexField,+ size: MAX_GROUPS,+ },+ },+ },+ }),+ );++ return result.groups.buckets.flatMap(({ key, docCount }) => {+ const value = mapGroupValue(key);+ if (field === "referredByPartnerId" && value === null) {+ return [];+ }+ return [{ value, count: docCount }];+ });+ },++ async upsert(documents) {+ for (const documentBatch of chunk(documents, WRITE_BATCH_SIZE)) {+ await upsertDocumentBatch(+ redisClient,+ resolvedIndexName,+ documentBatch,+ );+ }+ },++ async delete(documentIds) {+ for (const documentIdBatch of chunk(documentIds, WRITE_BATCH_SIZE)) {+ await deleteDocumentBatch(+ redisClient,+ resolvedIndexName,+ documentIdBatch,+ );+ }+ },+ };+}diff --git a/apps/web/package.json b/apps/web/package.jsonindex ca16b4d597..6bf535220f 100644--- a/apps/web/package.json+++ b/apps/web/package.json@@ -59,7 +59,7 @@"@types/buffer-crc32": "0.2.0","@upstash/qstash": "^2.11.0","@upstash/ratelimit": "^2.0.6",- "@upstash/redis": "^1.35.3",+ "@upstash/redis": "^1.38.2","@upstash/vector": "^1.2.2","@upstash/workflow": "^1.3.0","@vercel/edge-config": "^0.4.1",diff --git a/apps/web/scripts/partners/create-partner-search-index.ts b/apps/web/scripts/partners/create-partner-search-index.tsnew file mode 100644index 0000000000..2ac281af5a--- /dev/null+++ b/apps/web/scripts/partners/create-partner-search-index.ts@@ -0,0 +1,19 @@+import { createUpstashRedisPartnerSearchIndex } from "@/lib/api/partners/search";+import "dotenv-flow/config";++async function main() {+ const index = await createUpstashRedisPartnerSearchIndex();+ const description = await index.describe();++ if (!description) {+ throw new Error("Partner search index was not created.");+ }++ console.log(`Partner search index is ready: ${description.name}`);+ console.log(`Document prefix: ${description.prefixes.join(", ")}`);+}++main().catch((error) => {+ console.error("Failed to create partner search index:", error);+ process.exit(1);+});diff --git a/apps/web/tests/partners/upstash-redis-partner-search-provider.test.ts b/apps/web/tests/partners/upstash-redis-partner-search-provider.test.tsnew file mode 100644index 0000000000..ca26df50de--- /dev/null+++ b/apps/web/tests/partners/upstash-redis-partner-search-provider.test.ts@@ -0,0 +1,335 @@+import {+ createUpstashRedisPartnerSearchIndex,+ createUpstashRedisPartnerSearchProvider,+ type PartnerSearchDocument,+} from "@/lib/api/partners/search";+import type { Redis } from "@upstash/redis";+import { beforeEach, describe, expect, it, vi } from "vitest";++const document: PartnerSearchDocument = {+ id: "pge_test",+ programId: "prog_test",+ partnerId: "pn_test",+ name: "Rafi Hasan",+ email: "[email protected]",+ companyName: "Dub Partners",+ description: "Developer tools educator",+ platformTypes: ["website", "youtube", "twitter"],+ platformIdentifiers: ["rafi.dev", "@rafi-youtube", "@rafi-on-x"],+ linkDomains: ["dub.sh"],+ linkKeys: ["rafi"],+ shortLinks: ["https://dub.sh/rafi"],+ destinationUrls: ["https://example.com/referrals/rafi"],+ status: "approved",+ tenantId: null,+ groupId: null,+ country: "CA",+ partnerTagIds: ["ptag_test"],+ referredByPartnerId: null,+ totalClicks: 100,+ totalLeads: 20,+ totalConversions: 10,+ totalSaleAmount: 50_000,+ totalCommissions: 10_000,+ netRevenue: 40_000,+ earningsPerClick: 5,+ averageLifetimeValue: 5_000,+ clickToLeadRate: 0.2,+ clickToConversionRate: 0.1,+ leadToConversionRate: 0.5,+ returnOnAdSpend: 5,+ createdAt: "2026-08-08T00:00:00.000Z",+ updatedAt: "2026-08-08T00:00:00.000Z",+};++const mocks = vi.hoisted(() => ({+ aggregate: vi.fn(),+ count: vi.fn(),+ createIndex: vi.fn(),+ del: vi.fn(),+ index: vi.fn(),+ jsonMget: vi.fn(),+ jsonMset: vi.fn(),+ query: vi.fn(),+}));++function createRedisMock(): Redis {+ const searchIndex = {+ aggregate: mocks.aggregate,+ count: mocks.count,+ query: mocks.query,+ };++ mocks.index.mockReturnValue(searchIndex);++ return {+ del: mocks.del,+ json: {+ mget: mocks.jsonMget,+ mset: mocks.jsonMset,+ },+ search: {+ createIndex: mocks.createIndex,+ index: mocks.index,+ },+ } as unknown as Redis;+}++describe("Upstash Redis partner search provider", () => {+ beforeEach(() => {+ vi.clearAllMocks();+ mocks.aggregate.mockResolvedValue({+ groups: { buckets: [], sumOtherDocCount: 0 },+ });+ mocks.count.mockResolvedValue({ count: 0 });+ mocks.createIndex.mockResolvedValue(undefined);+ mocks.del.mockResolvedValue(0);+ mocks.jsonMget.mockResolvedValue([]);+ mocks.jsonMset.mockResolvedValue("OK");+ mocks.query.mockResolvedValue([]);+ });++ it("searches within the program and supports partial email matching", async () => {+ mocks.query.mockResolvedValue([+ {+ key: "test-index:partner:pge_test",+ score: 2,+ data: { id: document.id, partnerId: document.partnerId },+ },+ ]);+ mocks.count.mockResolvedValue({ count: 1 });+ const provider = createUpstashRedisPartnerSearchProvider({+ redisClient: createRedisMock(),+ indexName: "test-index",+ });++ const result = await provider.search({+ programId: document.programId,+ query: "examp",+ page: 3,+ pageSize: 25,+ sort: { field: "totalSaleAmount", order: "desc" },+ });++ expect(result).toEqual({+ hits: [{ id: document.id, partnerId: document.partnerId, score: 2 }],+ total: 1,+ });+ expect(mocks.query).toHaveBeenCalledWith(+ expect.objectContaining({+ limit: 25,+ offset: 50,+ orderBy: { totalSaleAmount: "DESC" },+ select: { id: true, partnerId: true },+ }),+ );++ const filter = mocks.query.mock.calls[0]![0].filter;+ expect(JSON.stringify(filter)).toContain('"programId":{"$eq":"prog_test"}');+ expect(JSON.stringify(filter)).toContain(+ '"documentType":{"$eq":"partner"}',+ );+ expect(JSON.stringify(filter)).toContain('"emailNgrams":"exa"');+ expect(JSON.stringify(filter)).toContain('"emailNgrams":"xam"');+ expect(JSON.stringify(filter)).toContain('"emailNgrams":"amp"');+ });++ it("passes list exclusions and metric ranges to Upstash", async () => {+ const provider = createUpstashRedisPartnerSearchProvider({+ redisClient: createRedisMock(),+ indexName: "test-index",+ });++ await provider.count({+ programId: document.programId,+ query: "rafi",+ filters: {+ countries: { values: ["US", "CA"], operator: "NOT_IN" },+ partnerTagIds: { values: ["ptag_test"], operator: "IN" },+ metrics: { totalSaleAmount: { min: 100, max: 1_000 } },+ },+ });++ const filter = mocks.count.mock.calls[0]![0].filter;+ expect(filter.$must).toEqual(+ expect.arrayContaining([+ { partnerTagIds: { $in: ["ptag_test"] } },+ { totalSaleAmount: { $gte: 100, $lte: 1_000 } },+ ]),+ );+ expect(filter.$mustNot).toEqual([{ country: { $in: ["US", "CA"] } }]);+ });++ it("retries a transient provider error", async () => {+ mocks.count+ .mockRejectedValueOnce(new Error("Upstash returned 503"))+ .mockResolvedValueOnce({ count: 1 });+ const provider = createUpstashRedisPartnerSearchProvider({+ redisClient: createRedisMock(),+ indexName: "test-index",+ });++ await expect(+ provider.count({ programId: document.programId, query: "rafi" }),+ ).resolves.toBe(1);+ expect(mocks.count).toHaveBeenCalledTimes(2);+ });++ it("does not retry a permanent provider error", async () => {+ mocks.count.mockRejectedValue(new Error("Invalid search filter"));+ const provider = createUpstashRedisPartnerSearchProvider({+ redisClient: createRedisMock(),+ indexName: "test-index",+ });++ await expect(+ provider.count({ programId: document.programId, query: "rafi" }),+ ).rejects.toThrow("Invalid search filter");+ expect(mocks.count).toHaveBeenCalledTimes(1);+ });++ it("writes the partner document and tag shadow documents", async () => {+ mocks.jsonMget.mockResolvedValue([null]);+ const provider = createUpstashRedisPartnerSearchProvider({+ redisClient: createRedisMock(),+ indexName: "test-index",+ });++ await provider.upsert([document]);++ expect(mocks.jsonMget).toHaveBeenCalledWith(+ ["test-index:partner:pge_test"],+ "$",+ );+ const entries = mocks.jsonMset.mock.calls[0]!;+ expect(entries).toHaveLength(2);+ expect(entries[0]).toEqual(+ expect.objectContaining({+ key: "test-index:partner:pge_test",+ path: "$",+ value: expect.objectContaining({+ documentType: "partner",+ partnerTagIds: "ptag_test",+ partnerTagIdsRaw: ["ptag_test"],+ tenantId: "__none__",+ }),+ }),+ );+ expect(entries[1]).toEqual(+ expect.objectContaining({+ key: "test-index:tag:pge_test:ptag_test",+ value: expect.objectContaining({+ documentType: "tag",+ partnerTagId: "ptag_test",+ }),+ }),+ );+ expect(entries[0].value.searchText).toContain("[email protected]");+ expect(entries[0].value.searchText).toContain("dub partners");+ expect(entries[0].value.searchText).toContain("rafi-on-x");+ expect(entries[0].value.searchText).toContain("referrals/rafi");+ expect(entries[0].value.emailNgrams).toContain("exa");+ });++ it("removes stale tag shadow documents before updating", async () => {+ mocks.jsonMget.mockResolvedValue([+ [{ partnerTagIdsRaw: ["ptag_old", "ptag_test"] }],+ ]);+ const provider = createUpstashRedisPartnerSearchProvider({+ redisClient: createRedisMock(),+ indexName: "test-index",+ });++ await provider.upsert([document]);++ expect(mocks.del).toHaveBeenCalledWith("test-index:tag:pge_test:ptag_old");+ expect(mocks.del.mock.invocationCallOrder[0]).toBeLessThan(+ mocks.jsonMset.mock.invocationCallOrder[0]!,+ );+ });++ it("bounds Upstash write batches", async () => {+ mocks.jsonMget.mockImplementation(async (keys: string[]) =>+ keys.map(() => null),+ );+ const provider = createUpstashRedisPartnerSearchProvider({+ redisClient: createRedisMock(),+ indexName: "test-index",+ });+ const documents = Array.from({ length: 101 }, (_, index) => ({+ ...document,+ id: `pge_${index}`,+ partnerTagIds: [],+ }));++ await provider.upsert(documents);++ expect(mocks.jsonMget).toHaveBeenCalledTimes(2);+ expect(mocks.jsonMset).toHaveBeenCalledTimes(2);+ expect(mocks.jsonMset.mock.calls[0]).toHaveLength(100);+ expect(mocks.jsonMset.mock.calls[1]).toHaveLength(1);+ });++ it("deletes the partner document and its tag shadow documents", async () => {+ mocks.jsonMget.mockResolvedValue([+ [{ partnerTagIdsRaw: ["ptag_one", "ptag_two"] }],+ ]);+ const provider = createUpstashRedisPartnerSearchProvider({+ redisClient: createRedisMock(),+ indexName: "test-index",+ });++ await provider.delete([document.id]);++ expect(mocks.del).toHaveBeenCalledWith(+ "test-index:partner:pge_test",+ "test-index:tag:pge_test:ptag_one",+ "test-index:tag:pge_test:ptag_two",+ );+ });++ it("groups partner tags using tag shadow documents", async () => {+ mocks.aggregate.mockResolvedValue({+ groups: {+ buckets: [{ key: "ptag_test", docCount: 12 }],+ sumOtherDocCount: 0,+ },+ });+ const provider = createUpstashRedisPartnerSearchProvider({+ redisClient: createRedisMock(),+ indexName: "test-index",+ });++ await expect(+ provider.groupBy(+ { programId: document.programId, query: "rafi" },+ "partnerTagId",+ ),+ ).resolves.toEqual([{ value: "ptag_test", count: 12 }]);++ const request = mocks.aggregate.mock.calls[0]![0];+ expect(request.aggregations.groups.$terms.field).toBe("partnerTagId");+ expect(JSON.stringify(request.filter)).toContain(+ '"documentType":{"$eq":"tag"}',+ );+ });++ it("creates the index explicitly with the partner-search prefix", async () => {+ const redisClient = createRedisMock();++ await createUpstashRedisPartnerSearchIndex({+ redisClient,+ indexName: "test-index",+ });++ expect(mocks.createIndex).toHaveBeenCalledWith(+ expect.objectContaining({+ name: "test-index",+ dataType: "json",+ prefix: "test-index:",+ existsOk: true,+ skipInitialScan: true,+ }),+ );+ });+});diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 1925b54eef..a30e511162 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -154,10 +154,10 @@ importers:version: 2.11.0'@upstash/ratelimit':specifier: ^2.0.6- version: 2.0.6(@upstash/[email protected])+ version: 2.0.6(@upstash/[email protected])'@upstash/redis':- specifier: ^1.35.3- version: 1.35.3+ specifier: ^1.38.2+ version: 1.38.2'@upstash/vector':specifier: ^1.2.2version: 1.2.2@@ -672,7 +672,7 @@ importers:dependencies:'@hubspot/cli':specifier: ^7.6.2- version: 7.6.2(@babel/[email protected])(@types/[email protected])(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected]))([email protected])([email protected])([email protected](@types/[email protected])([email protected]))+ version: 7.6.2(@babel/[email protected])(@types/[email protected])(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected]))([email protected])([email protected])([email protected](@types/[email protected])([email protected]))devDependencies:'@types/node':specifier: 18.11.9@@ -4289,99 +4289,116 @@ packages:'@react-email/[email protected]':resolution: {integrity: sha512-ljDiQiJDu/Fq//vSIIP0z5Nuvt4+DX1RqGasstChDGJB/14ogd4VdNS9aacoede/ZjGy3o3Qb+cxyS+XgM6SwQ==}engines: {node: '>=20.0.0'}+ deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.peerDependencies:react: ^18.0 || ^19.0 || ^19.0.0-rc'@react-email/[email protected]':resolution: {integrity: sha512-qXyj7RZLE7POy9BMKSoqQ00tOXThjOZSUnI2Yu9i29IHngPlmrNayIWBoVKtElES7OWwypUcpiajwi1mUWx6/A==}engines: {node: '>=20.0.0'}+ deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.peerDependencies:react: ^18.0 || ^19.0 || ^19.0.0-rc'@react-email/[email protected]':resolution: {integrity: sha512-M3B7JpVH4ytgn83/ujRR1k1DQHvTeABiDM61OvAbjLRPhC/5KLHU5KkzIbbuGIrjWwxAbL1kSQzU8MhLEtSxyw==}engines: {node: '>=20.0.0'}+ deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.peerDependencies:react: ^18.0 || ^19.0 || ^19.0.0-rc'@react-email/[email protected]':resolution: {integrity: sha512-jfhebvv3dVsp3OdPgKXnk8+e2pBiDVZejDOBFzBa/IblrAJ9cQDkN6rBD5IyEg8hTOxwbw3iaI/yZFmDmIguIA==}engines: {node: '>=20.0.0'}+ deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.peerDependencies:react: ^18.0 || ^19.0 || ^19.0.0-rc'@react-email/[email protected]':resolution: {integrity: sha512-f+W+Bk2AjNO77zynE33rHuQhyqVICx4RYtGX9NKsGUg0wWjdGP0qAuIkhx9Rnmk4/hFMo1fUrtYNqca9fwJdHg==}engines: {node: '>=20.0.0'}+ deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.peerDependencies:react: ^18.0 || ^19.0 || ^19.0.0-rc'@react-email/[email protected]':resolution: {integrity: sha512-zY81ED6o5MWMzBkr9uZFuT24lWarT+xIbOZxI6C9dsFmCWBczM8IE1BgOI8rhpUK4JcYVDy1uKxYAFqsx2Bc4w==}engines: {node: '>=20.0.0'}+ deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.peerDependencies:react: ^18.0 || ^19.0 || ^19.0.0-rc'@react-email/[email protected]':resolution: {integrity: sha512-QWBB56RkkU0AJ9h+qy33gfT5iuZknPC7Un/IjZv9B0QmMIK+WWacc0cH6y2SV5Cv/b99hU94fjEMOOO4enpkbQ==}engines: {node: '>=20.0.0'}+ deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.peerDependencies:react: ^18.0 || ^19.0 || ^19.0.0-rc'@react-email/[email protected]':resolution: {integrity: sha512-0urVSgCmQIfx5r7Xc586miBnQUVnGp3OTYUm8m5pwtQRdTRO5XrTtEfNJ3JhYhSOruV0nD8fd+dXtKXobum6tA==}engines: {node: '>=20.0.0'}+ deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.peerDependencies:react: ^18.0 || ^19.0 || ^19.0.0-rc'@react-email/[email protected]':resolution: {integrity: sha512-AJg6le/08Gz4tm+6MtKXqtNNyKHzmooOCdmtqmWxD7FxoAdU1eVcizhtQ0gcnVaY6ethEyE/hnEzQxt1zu5Kog==}engines: {node: '>=20.0.0'}+ deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.peerDependencies:react: ^18.0 || ^19.0 || ^19.0.0-rc'@react-email/[email protected]':resolution: {integrity: sha512-jmsKnQm1ykpBzw4hCYHwBkt5pW2jScXffPeEH5ZRF5tZeF5b1pvlFTO9han7C0pCkZYo1kEvWiRtx69yfCIwuw==}engines: {node: '>=20.0.0'}+ deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.peerDependencies:react: ^18.0 || ^19.0 || ^19.0.0-rc'@react-email/[email protected]':resolution: {integrity: sha512-TwmOmBDibavUQpXBxpmZYi2Iks/yeZOzFYh+di9EltMSnEabH8dMZXrl+pxNXzCgZ2XE8HY7VmUL65Lenfu5PA==}engines: {node: '>=20.0.0'}+ deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.peerDependencies:react: ^18.0 || ^19.0 || ^19.0.0-rc'@react-email/[email protected]':resolution: {integrity: sha512-KTShZesan+UsreU7PDUV90afrZwU5TLwYlALuCSU0OT+/U8lULNNbAUekg+tGwCnOfIKYtpDPKkAMRdYlqUznw==}engines: {node: '>=20.0.0'}+ deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.peerDependencies:react: ^18.0 || ^19.0 || ^19.0.0-rc'@react-email/[email protected]':resolution: {integrity: sha512-sRCpEARNVTf3FQhZOC+JTvu5r6ubiYWkT0ucYXg8ctkyi4G8QG+jgYPiNUqVeTLA2STOfmPM/nrk1nb84y6CPQ==}engines: {node: '>=20.0.0'}+ deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.peerDependencies:react: ^18.0 || ^19.0 || ^19.0.0-rc'@react-email/[email protected]':resolution: {integrity: sha512-lkWc/NjOcefRZMkQoSDDbuKBEBDES9aXnFEOuPH845wD3TxPwh+QTf0fStuzjoRLUZWpHnio4z7qGGRYusn/sw==}engines: {node: '>=20.0.0'}+ deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.peerDependencies:react: ^18.0 || ^19.0 || ^19.0.0-rc'@react-email/[email protected]':resolution: {integrity: sha512-gSuYK5fsMbGk87jDebqQ6fa2fKcWlkf2Dkva8kMONqLgGCq8/0d+ZQYMEJsdidIeBo3kmsnHZPrwdFB4HgjUXg==}engines: {node: '>=20.0.0'}+ deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.peerDependencies:react: ^18.0 || ^19.0 || ^19.0.0-rc'@react-email/[email protected]':resolution: {integrity: sha512-drQ0C7vi7P0uE7Ox1Cyiujsx0oqp2RbIscOdSBR5qvzw3EKjlGbW2pWjQ000cjxTq3Si7lqlRKhOIF8MzOnqHw==}+ deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.'@react-email/[email protected]':resolution: {integrity: sha512-aYK8q0IPkBXyMsbpMXgxazwHxYJxTrXrV95GFuu2HbEiIToMwSyUgb8HDFYwPqqfV03/jbwqlsXmFxsOd+VNaw==}engines: {node: '>=20.0.0'}+ deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.peerDependencies:react: ^18.0 || ^19.0 || ^19.0.0-rc@@ -4395,18 +4412,21 @@ packages:'@react-email/[email protected]':resolution: {integrity: sha512-bYnOac40vIKCId7IkwuLAAsa3fKfSfqCvv6epJKmPE0JBuu5qI4FHFCl9o9dVpIIS08s/ub+Y/txoMt0dYziGw==}engines: {node: '>=20.0.0'}+ deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.peerDependencies:react: ^18.0 || ^19.0 || ^19.0.0-rc'@react-email/[email protected]':resolution: {integrity: sha512-qNl65ye3W0Rd5udhdORzTV9ezjb+GFqQQSae03NDzXtmJq6sqVXNWNiVolAjvJNypim+zGXmv6J9TcV5aNtE/w==}engines: {node: '>=20.0.0'}+ deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.peerDependencies:react: ^18.0 || ^19.0 || ^19.0.0-rc'@react-email/[email protected]':resolution: {integrity: sha512-7Ey+kiWliJdxPMCLYsdDts8ffp4idlP//w4Ui3q/A5kokVaLSNKG8DOg/8qAuzWmRiGwNQVOKBk7PXNlK5W+sg==}engines: {node: '>=20.0.0'}+ deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.peerDependencies:'@react-email/body': 0.2.1'@react-email/button': 0.2.1@@ -4445,6 +4465,7 @@ packages:'@react-email/[email protected]':resolution: {integrity: sha512-TYqkioRS45wTR5il3dYk/SbUjjEdhSwh9BtRNB99qNH1pXAwA45H7rAuxehiu8iJQJH0IyIr+6n62gBz9ezmsw==}engines: {node: '>=20.0.0'}+ deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.peerDependencies:react: ^18.0 || ^19.0 || ^19.0.0-rc@@ -5400,6 +5421,7 @@ packages:'@team-plain/[email protected]':resolution: {integrity: sha512-AHSXyt1kDt74m9YKZBCRCd6cQjB8QjUNr9cehtR2QHzZ/8yXJPzawPJDqOQ3ms5KvwuYrBx2qT3e6C/zrQ5UtA==}+ deprecated: This package is now deprecated. Please use @team-plain/graphql, @team-plain/webhooks and @team-plain/ui-components (https://github.com/team-plain/sdk)'@tediousjs/[email protected]':resolution: {integrity: sha512-7qSgZbincDDDFyRweCIEvZULFAw5iz/DeunhvuxpL31nfntX3P4Yd4HkHBRg9H8CdqY1e5WFN1PZIz/REL9MVQ==}@@ -6000,6 +6022,7 @@ packages:'@ungap/[email protected]':resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==}+ deprecated: Potential CWE-502 - Update to 1.3.1 or higher'@upstash/[email protected]':resolution: {integrity: sha512-7qJHGxpQgQr9/vmeS1PktEwvNAF7TI4iJDi8Pu2CFZ9YUGHZH4fOP5TfYlZ4aVxfopnELiE4BS4FBjyK7V1/xQ==}@@ -6013,8 +6036,8 @@ packages:peerDependencies:'@upstash/redis': ^1.34.3- '@upstash/[email protected]':- resolution: {integrity: sha512-hSjv66NOuahW3MisRGlSgoszU2uONAY2l5Qo3Sae8OT3/Tng9K+2/cBRuyPBX8egwEGcNNCF9+r0V6grNnhL+w==}+ '@upstash/[email protected]':+ resolution: {integrity: sha512-RZ+JaRCVIS+ZTGnjOnDMr+/0aqDxsBb5rV6aW+Pys4SGELwr5lwE3UbLHRCHqMQ5Ulxj0b/CFBHfbmE175Otog==}'@upstash/[email protected]':resolution: {integrity: sha512-ptQ9xnxtKqmpNK52PCcHCszlPOLxIBfjsv7ty8RoF95pkjctS9rSjTQ3Pl9bx5VFbpDj+0dMXw88WLt6swDkgQ==}@@ -7187,6 +7210,7 @@ packages:resolution: {integrity: sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==}+ deprecated: Active development of CryptoJS has been discontinued. This library is no longer maintained.resolution: {integrity: sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==}@@ -9575,6 +9599,7 @@ packages:resolution: {integrity: sha512-1Y4upYpzhoweEMkFDogMU8fKLCs+ciNKviTotrrMZ8duqlycERcB38GYXpu4xcwm6YBn86cTXd7za2yUl0GAkg==}engines: {node: '>= 16'}+ deprecated: A security vulnerability has been reported with the preventCsvInjection option which has been fixed in version 5.5.11. Please upgrade as soon as possible.resolution: {integrity: sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==}@@ -11004,6 +11029,7 @@ packages:resolution: {integrity: sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==}engines: {node: '>=10'}+ deprecated: No longer maintained. Please contact the author of the relevant native addon; alternatives are available.hasBin: true@@ -12566,6 +12592,7 @@ packages:resolution: {integrity: sha512-4t0noZX9t6GcPTfBAbIbbIU4pfpCwh0ueq3S4O/5qXI1VwK1outmxhe9dOiEWqMz3MW2LKgDTpqWV+37IWuVbA==}engines: {node: ^18 || >=20}+ deprecated: unmaintainedhasBin: truepeerDependencies:typescript: ^5.0.0@@ -14508,9 +14535,9 @@ snapshots:'@babel/core': 7.24.5'@babel/helper-plugin-utils': 7.25.9- '@babel/[email protected](@babel/[email protected])':+ '@babel/[email protected](@babel/[email protected])':dependencies:- '@babel/core': 7.24.5+ '@babel/core': 7.28.4'@babel/helper-plugin-utils': 7.27.1optional: true@@ -15340,7 +15367,7 @@ snapshots:- encoding- supports-color- '@hubspot/[email protected](@babel/[email protected])(@types/[email protected])(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected]))([email protected])([email protected])([email protected](@types/[email protected])([email protected]))':+ '@hubspot/[email protected](@babel/[email protected])(@types/[email protected])(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected]))([email protected])([email protected])([email protected](@types/[email protected])([email protected]))':dependencies:'@hubspot/local-dev-lib': 3.19.1'@hubspot/project-parsing-lib': 0.8.6(@hubspot/[email protected])@@ -15371,7 +15398,7 @@ snapshots:yargs: 17.7.2yargs-parser: 21.1.1optionalDependencies:- '@hubspot/cms-dev-server': 1.0.38(@babel/[email protected])(@types/[email protected])(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected]))([email protected])+ '@hubspot/cms-dev-server': 1.0.38(@babel/[email protected])(@types/[email protected])(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected]))([email protected])'@modelcontextprotocol/sdk': 1.13.3transitivePeerDependencies:- '@babel/core'@@ -15409,7 +15436,7 @@ snapshots:react-dom: 18.3.1([email protected])optional: true- '@hubspot/[email protected](@babel/[email protected])(@types/[email protected])(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected]))([email protected])':+ '@hubspot/[email protected](@babel/[email protected])(@types/[email protected])(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected]))([email protected])':dependencies:'@babel/code-frame': 7.26.2'@babel/parser': 7.26.2@@ -15436,7 +15463,7 @@ snapshots:ansi-to-html: 0.7.2babel-plugin-macros: 3.1.0- babel-plugin-styled-components: 2.1.4(@babel/[email protected])([email protected]([email protected]([email protected]))([email protected]))+ babel-plugin-styled-components: 2.1.4(@babel/[email protected])([email protected]([email protected]([email protected]))([email protected]))chalk: 5.4.1class-variance-authority: 0.7.0cli-progress: 3.12.0@@ -15455,7 +15482,7 @@ snapshots:react-dom: 18.3.1([email protected])request: 2.88.2storybook: 8.6.14([email protected])tailwind-merge: 2.6.0tailwindcss-animate: 1.0.7typescript: 4.7.4@@ -19730,7 +19757,7 @@ snapshots:'@upstash/[email protected]':dependencies:- '@upstash/redis': 1.35.3+ '@upstash/redis': 1.38.2'@upstash/[email protected]':dependencies:@@ -19738,12 +19765,12 @@ snapshots:jose: 5.10.0neverthrow: 7.2.0- '@upstash/[email protected](@upstash/[email protected])':+ '@upstash/[email protected](@upstash/[email protected])':dependencies:'@upstash/core-analytics': 0.0.10- '@upstash/redis': 1.35.3+ '@upstash/redis': 1.38.2- '@upstash/[email protected]':+ '@upstash/[email protected]':dependencies:uncrypto: 0.1.3@@ -20484,11 +20511,11 @@ snapshots:resolve: 1.22.6optional: true- [email protected](@babel/[email protected])([email protected]([email protected]([email protected]))([email protected])):+ [email protected](@babel/[email protected])([email protected]([email protected]([email protected]))([email protected])):dependencies:'@babel/helper-annotate-as-pure': 7.27.3'@babel/helper-module-imports': 7.25.9- '@babel/plugin-syntax-jsx': 7.27.1(@babel/[email protected])+ '@babel/plugin-syntax-jsx': 7.27.1(@babel/[email protected])lodash: 4.17.21picomatch: 2.3.1@@ -27577,12 +27604,12 @@ snapshots:tslib: 2.6.2optional: truedependencies:client-only: 0.0.1react: 18.3.1optionalDependencies:- '@babel/core': 7.24.5+ '@babel/core': 7.28.4babel-plugin-macros: 3.1.0optional: true