{"version":3,"file":"errors.cjs","sources":["../../src/errors.ts"],"sourcesContent":["import { TanStackDBError } from '@tanstack/db'\n\n// Query Collection Errors\nexport class QueryCollectionError extends TanStackDBError {\n  constructor(message: string) {\n    super(message)\n    this.name = `QueryCollectionError`\n  }\n}\n\nexport class QueryKeyRequiredError extends QueryCollectionError {\n  constructor() {\n    super(`[QueryCollection] queryKey must be provided.`)\n    this.name = `QueryKeyRequiredError`\n  }\n}\n\nexport class QueryFnRequiredError extends QueryCollectionError {\n  constructor() {\n    super(`[QueryCollection] queryFn must be provided.`)\n    this.name = `QueryFnRequiredError`\n  }\n}\n\nexport class QueryClientRequiredError extends QueryCollectionError {\n  constructor() {\n    super(`[QueryCollection] queryClient must be provided.`)\n    this.name = `QueryClientRequiredError`\n  }\n}\n\nexport class GetKeyRequiredError extends QueryCollectionError {\n  constructor() {\n    super(`[QueryCollection] getKey must be provided.`)\n    this.name = `GetKeyRequiredError`\n  }\n}\n\nexport class SyncNotInitializedError extends QueryCollectionError {\n  constructor() {\n    super(\n      `Collection must be in 'ready' state for manual sync operations. Sync not initialized yet.`,\n    )\n    this.name = `SyncNotInitializedError`\n  }\n}\n\nexport class InvalidItemStructureError extends QueryCollectionError {\n  constructor(message: string) {\n    super(`Invalid item structure: ${message}`)\n    this.name = `InvalidItemStructureError`\n  }\n}\n\nexport class ItemNotFoundError extends QueryCollectionError {\n  constructor(key: string | number) {\n    super(`Item with key '${key}' does not exist.`)\n    this.name = `ItemNotFoundError`\n  }\n}\n\nexport class DuplicateKeyInBatchError extends QueryCollectionError {\n  constructor(key: string | number) {\n    super(`Duplicate key '${key}' found within batch operations`)\n    this.name = `DuplicateKeyInBatchError`\n  }\n}\n\nexport class UpdateOperationItemNotFoundError extends QueryCollectionError {\n  constructor(key: string | number) {\n    super(`Update operation: Item with key '${key}' does not exist`)\n    this.name = `UpdateOperationItemNotFoundError`\n  }\n}\n\nexport class DeleteOperationItemNotFoundError extends QueryCollectionError {\n  constructor(key: string | number) {\n    super(`Delete operation: Item with key '${key}' does not exist`)\n    this.name = `DeleteOperationItemNotFoundError`\n  }\n}\n\nexport class InvalidSyncOperationError extends QueryCollectionError {\n  constructor(message: string) {\n    super(`Invalid sync operation: ${message}`)\n    this.name = `InvalidSyncOperationError`\n  }\n}\n\nexport class UnknownOperationTypeError extends QueryCollectionError {\n  constructor(type: string) {\n    super(`Unknown operation type: ${type}`)\n    this.name = `UnknownOperationTypeError`\n  }\n}\n\nexport class MissingKeyFieldError extends QueryCollectionError {\n  constructor(operation: string, message: string) {\n    super(`${operation} item must contain the key field: ${message}`)\n    this.name = `MissingKeyFieldError`\n  }\n}\n"],"names":["TanStackDBError"],"mappings":";;;AAGO,MAAM,6BAA6BA,GAAAA,gBAAgB;AAAA,EACxD,YAAY,SAAiB;AAC3B,UAAM,OAAO;AACb,SAAK,OAAO;AAAA,EACd;AACF;AAEO,MAAM,8BAA8B,qBAAqB;AAAA,EAC9D,cAAc;AACZ,UAAM,8CAA8C;AACpD,SAAK,OAAO;AAAA,EACd;AACF;AAEO,MAAM,6BAA6B,qBAAqB;AAAA,EAC7D,cAAc;AACZ,UAAM,6CAA6C;AACnD,SAAK,OAAO;AAAA,EACd;AACF;AAEO,MAAM,iCAAiC,qBAAqB;AAAA,EACjE,cAAc;AACZ,UAAM,iDAAiD;AACvD,SAAK,OAAO;AAAA,EACd;AACF;AAEO,MAAM,4BAA4B,qBAAqB;AAAA,EAC5D,cAAc;AACZ,UAAM,4CAA4C;AAClD,SAAK,OAAO;AAAA,EACd;AACF;AAEO,MAAM,gCAAgC,qBAAqB;AAAA,EAChE,cAAc;AACZ;AAAA,MACE;AAAA,IAAA;AAEF,SAAK,OAAO;AAAA,EACd;AACF;AAEO,MAAM,kCAAkC,qBAAqB;AAAA,EAClE,YAAY,SAAiB;AAC3B,UAAM,2BAA2B,OAAO,EAAE;AAC1C,SAAK,OAAO;AAAA,EACd;AACF;AAEO,MAAM,0BAA0B,qBAAqB;AAAA,EAC1D,YAAY,KAAsB;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