@nvisy/sdk 0.54.0 → 0.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/client.ts"],"sourcesContent":["/**\n * @fileoverview Main client for the Nvisy SDK.\n *\n * This module exports the {@link Nvisy} class, which is the primary entry point\n * for interacting with the Nvisy document processing API.\n *\n * @module client\n *\n * @example\n * ```typescript\n * const nvisy = new Nvisy({ apiToken: \"your-api-token\" });\n * const account = await nvisy.account.getAccount();\n * ```\n */\n\nimport type { NvisyConfig } from \"@/config.js\";\nimport { NvisyError } from \"@/errors.js\";\nimport { type ApiClient, createApiClient, resolveDefaults } from \"@/http.js\";\nimport {\n\tAccount,\n\tActivities,\n\tAnalytics,\n\tApiTokens,\n\tAuth,\n\tCapabilities,\n\tConnections,\n\tDetections,\n\tDocuments,\n\tInvites,\n\tMembers,\n\tNotifications,\n\tPipelines,\n\tPolicies,\n\tProviders,\n\tRedactions,\n\tReviews,\n\tStatus,\n\tSyncs,\n\tThreads,\n\tWebhooks,\n\tWorkspaces,\n} from \"@/services/index.js\";\n\n/**\n * Typed openapi-fetch client for the Nvisy API. Exposed via {@link Nvisy.api}\n * for advanced use cases requiring direct API access.\n */\nexport type { ApiClient } from \"@/http.js\";\n\n/**\n * Main client class for interacting with the Nvisy document processing API.\n *\n * @example\n * ```typescript\n * const nvisy = new Nvisy({ apiToken: \"your-api-token\" });\n * const account = await nvisy.account.getAccount();\n * const workspaces = await nvisy.workspaces.listWorkspaces();\n * ```\n */\nexport class Nvisy {\n\t/** The config this client was built from (for {@link withApiToken}). @internal */\n\treadonly #config: NvisyConfig;\n\n\t/** The resolved base URL. @internal */\n\treadonly #baseUrl: string;\n\n\t/**\n\t * The underlying openapi-fetch client instance.\n\t * @internal\n\t */\n\treadonly #api: ApiClient;\n\n\t/**\n\t * Creates a new authenticated Nvisy client.\n\t *\n\t * Requires an `apiToken` (sent as `Authorization: Bearer <token>`). For the\n\t * pre-auth surface (login / signup / OIDC start, auth capabilities, health),\n\t * use {@link NvisyGuest} from `@nvisy/sdk/guest`.\n\t *\n\t * @param config - Configuration options with a required `apiToken`\n\t * @throws {NvisyError} If the API token is missing or invalid\n\t *\n\t * @example\n\t * ```typescript\n\t * const nvisy = new Nvisy({ apiToken: \"your-api-token\" });\n\t * const account = await nvisy.account.getAccount();\n\t * ```\n\t */\n\tconstructor(config: NvisyConfig) {\n\t\tthis.#config = config;\n\t\tconst resolved = resolveDefaults(config);\n\t\tthis.#baseUrl = resolved.baseUrl;\n\t\tthis.#api = createApiClient({\n\t\t\tapiToken: this.#validateApiToken(config.apiToken),\n\t\t\tcredentials: config.credentials,\n\t\t\tfetch: config.fetch,\n\t\t\t...resolved,\n\t\t});\n\t}\n\n\t/**\n\t * Validates an API token format.\n\t *\n\t * @param apiToken - The API token to validate\n\t * @returns The trimmed API token if valid\n\t * @throws {NvisyError} If the API token is invalid\n\t * @internal\n\t */\n\t#validateApiToken(apiToken: string): string {\n\t\tif (typeof apiToken !== \"string\" || apiToken.trim().length === 0) {\n\t\t\tthrow new NvisyError(\"API token must be a non-empty string\");\n\t\t}\n\n\t\tconst trimmedToken = apiToken.trim();\n\t\tif (trimmedToken.length < 10) {\n\t\t\tthrow new NvisyError(\"API token must be at least 10 characters\");\n\t\t}\n\n\t\tif (!/^[a-zA-Z0-9_.-]+$/.test(trimmedToken)) {\n\t\t\tthrow new NvisyError(\"API token contains invalid characters\");\n\t\t}\n\n\t\treturn trimmedToken;\n\t}\n\n\t/**\n\t * Creates a new client with a different API token.\n\t *\n\t * Returns a new client instance with the new token. The original client\n\t * remains unchanged. All other configuration (base URL, headers, etc.)\n\t * is preserved in the new client.\n\t *\n\t * @param apiToken - The new API token\n\t * @returns A new Nvisy instance with the new token\n\t * @throws {NvisyError} If the API token is invalid\n\t *\n\t * @example\n\t * ```typescript\n\t * const nvisy = new Nvisy({ apiToken: \"original-token\" });\n\t * const newNvisy = nvisy.withApiToken(\"new-token\");\n\t *\n\t * // newNvisy uses the new token\n\t * // nvisy still uses the original token\n\t * ```\n\t */\n\twithApiToken(apiToken: string): Nvisy {\n\t\treturn new Nvisy({ ...this.#config, apiToken });\n\t}\n\n\t/**\n\t * The base URL used for API requests.\n\t *\n\t * @returns The configured base URL\n\t */\n\tget baseUrl(): string {\n\t\treturn this.#baseUrl;\n\t}\n\n\t/**\n\t * The underlying openapi-fetch client for direct API access.\n\t *\n\t * Use this for advanced scenarios where you need direct access to the\n\t * HTTP client, such as calling endpoints not covered by the service classes.\n\t *\n\t * @returns The configured ApiClient instance\n\t */\n\tget api(): ApiClient {\n\t\treturn this.#api;\n\t}\n\n\t/**\n\t * Service for authenticated auth operations (logout, desktop token). Pre-auth\n\t * sign-in lives on {@link NvisyGuest}.\n\t */\n\tget auth(): Auth {\n\t\treturn new Auth(this.#api);\n\t}\n\n\t/**\n\t * Service for API status and health checks.\n\t */\n\tget status(): Status {\n\t\treturn new Status(this.#api);\n\t}\n\n\t/**\n\t * Service for managing the authenticated user's account.\n\t */\n\tget account(): Account {\n\t\treturn new Account(this.#api);\n\t}\n\n\t/**\n\t * Service for viewing workspace activities.\n\t */\n\tget activities(): Activities {\n\t\treturn new Activities(this.#api);\n\t}\n\n\t/**\n\t * Service for workspace analytics.\n\t */\n\tget analytics(): Analytics {\n\t\treturn new Analytics(this.#api);\n\t}\n\n\t/**\n\t * Service for managing API tokens.\n\t */\n\tget apiTokens(): ApiTokens {\n\t\treturn new ApiTokens(this.#api);\n\t}\n\n\t/**\n\t * Service for managing connections.\n\t */\n\tget connections(): Connections {\n\t\treturn new Connections(this.#api);\n\t}\n\n\t/**\n\t * Service for document operations (upload, download, delete, review).\n\t */\n\tget documents(): Documents {\n\t\treturn new Documents(this.#api);\n\t}\n\n\t/**\n\t * Service for discussion threads and comments.\n\t */\n\tget threads(): Threads {\n\t\treturn new Threads(this.#api);\n\t}\n\n\t/**\n\t * Service for managing pipelines.\n\t */\n\tget pipelines(): Pipelines {\n\t\treturn new Pipelines(this.#api);\n\t}\n\n\t/**\n\t * Service for managing policies.\n\t */\n\tget policies(): Policies {\n\t\treturn new Policies(this.#api);\n\t}\n\n\t/**\n\t * Service for managing a workspace's inference providers.\n\t */\n\tget providers(): Providers {\n\t\treturn new Providers(this.#api);\n\t}\n\n\t/**\n\t * Service for reading the deployment's capabilities (labels, recognizers,\n\t * connectors, auth methods).\n\t */\n\tget capabilities(): Capabilities {\n\t\treturn new Capabilities(this.#api);\n\t}\n\n\t/**\n\t * Service for managing workspace invitations.\n\t */\n\tget invites(): Invites {\n\t\treturn new Invites(this.#api);\n\t}\n\n\t/**\n\t * Service for managing workspace members.\n\t */\n\tget members(): Members {\n\t\treturn new Members(this.#api);\n\t}\n\n\t/**\n\t * Service for managing notifications.\n\t */\n\tget notifications(): Notifications {\n\t\treturn new Notifications(this.#api);\n\t}\n\n\t/**\n\t * Service for pipeline detections and their redactions.\n\t */\n\tget detections(): Detections {\n\t\treturn new Detections(this.#api);\n\t}\n\n\t/**\n\t * Service for workspace redactions.\n\t */\n\tget redactions(): Redactions {\n\t\treturn new Redactions(this.#api);\n\t}\n\n\t/**\n\t * Service for document reviews (assigning documents to reviewers).\n\t */\n\tget reviews(): Reviews {\n\t\treturn new Reviews(this.#api);\n\t}\n\n\t/**\n\t * Service for managing connection syncs.\n\t */\n\tget syncs(): Syncs {\n\t\treturn new Syncs(this.#api);\n\t}\n\n\t/**\n\t * Service for managing webhooks.\n\t */\n\tget webhooks(): Webhooks {\n\t\treturn new Webhooks(this.#api);\n\t}\n\n\t/**\n\t * Service for managing workspaces.\n\t */\n\tget workspaces(): Workspaces {\n\t\treturn new Workspaces(this.#api);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;AA2DA,IAAa,QAAb,MAAa,MAAM;;CAElB,AAAS;;CAGT,AAAS;;;;;CAMT,AAAS;;;;;;;;;;;;;;;;;CAkBT,YAAY,QAAqB;EACh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KAAK,IAAI;CAC/B;;;;CAKA,IAAI,UAAmB;EACtB,OAAO,IAAI,QAAQ,KAAK,IAAI;CAC7B;;;;CAKA,IAAI,YAAuB;EAC1B,OAAO,IAAI,UAAU,KAAK,IAAI;CAC/B;;;;CAKA,IAAI,WAAqB;EACxB,OAAO,IAAI,SAAS,KAAK,IAAI;CAC9B;;;;CAKA,IAAI,YAAuB;EAC1B,OAAO,IAAI,UAAU,KAAK,IAAI;CAC/B;;;;;CAMA,IAAI,eAA6B;EAChC,OAAO,IAAI,aAAa,KAAK,IAAI;CAClC;;;;CAKA,IAAI,UAAmB;EACtB,OAAO,IAAI,QAAQ,KAAK,IAAI;CAC7B;;;;CAKA,IAAI,UAAmB;EACtB,OAAO,IAAI,QAAQ,KAAK,IAAI;CAC7B;;;;CAKA,IAAI,gBAA+B;EAClC,OAAO,IAAI,cAAc,KAAK,IAAI;CACnC;;;;CAKA,IAAI,aAAyB;EAC5B,OAAO,IAAI,WAAW,KAAK,IAAI;CAChC;;;;CAKA,IAAI,aAAyB;EAC5B,OAAO,IAAI,WAAW,KAAK,IAAI;CAChC;;;;CAKA,IAAI,UAAmB;EACtB,OAAO,IAAI,QAAQ,KAAK,IAAI;CAC7B;;;;CAKA,IAAI,QAAe;EAClB,OAAO,IAAI,MAAM,KAAK,IAAI;CAC3B;;;;CAKA,IAAI,WAAqB;EACxB,OAAO,IAAI,SAAS,KAAK,IAAI;CAC9B;;;;CAKA,IAAI,aAAyB;EAC5B,OAAO,IAAI,WAAW,KAAK,IAAI;CAChC;AACD"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/client.ts"],"sourcesContent":["/**\n * @fileoverview Main client for the Nvisy SDK.\n *\n * This module exports the {@link Nvisy} class, which is the primary entry point\n * for interacting with the Nvisy document processing API.\n *\n * @module client\n *\n * @example\n * ```typescript\n * const nvisy = new Nvisy({ apiToken: \"your-api-token\" });\n * const account = await nvisy.account.getAccount();\n * ```\n */\n\nimport type { NvisyOptions } from \"@/config.js\";\nimport { NvisyError } from \"@/errors.js\";\nimport { type ApiClient, createApiClient, resolveDefaults } from \"@/http.js\";\nimport {\n\tAccount,\n\tActivities,\n\tAnalytics,\n\tApiTokens,\n\tAuth,\n\tCapabilities,\n\tConnections,\n\tDetections,\n\tDocuments,\n\tInvites,\n\tMembers,\n\tNotifications,\n\tPipelines,\n\tPolicies,\n\tProviders,\n\tRedactions,\n\tReviews,\n\tStatus,\n\tSyncs,\n\tWebhooks,\n\tWorkspaces,\n} from \"@/services/index.js\";\n\n/**\n * Typed openapi-fetch client for the Nvisy API. Exposed via {@link Nvisy.api}\n * for advanced use cases requiring direct API access.\n */\nexport type { ApiClient } from \"@/http.js\";\n\n/**\n * Main client class for interacting with the Nvisy document processing API.\n *\n * @example\n * ```typescript\n * const nvisy = new Nvisy({ apiToken: \"your-api-token\" });\n * const account = await nvisy.account.getAccount();\n * const workspaces = await nvisy.workspaces.listWorkspaces();\n * ```\n */\nexport class Nvisy {\n\t/** The config this client was built from (for {@link withApiToken}). @internal */\n\treadonly #config: NvisyOptions;\n\n\t/** The resolved base URL. @internal */\n\treadonly #baseUrl: string;\n\n\t/**\n\t * The underlying openapi-fetch client instance.\n\t * @internal\n\t */\n\treadonly #api: ApiClient;\n\n\t/**\n\t * Creates a new authenticated Nvisy client.\n\t *\n\t * Authenticate with an `apiToken` (bearer) or `session: true` (the browser\n\t * cookie session established by the guest client's login / signup). For the\n\t * pre-auth surface (login / signup / OIDC start, auth capabilities, health),\n\t * use {@link NvisyGuest} from `@nvisy/sdk/guest`.\n\t *\n\t * @param config - Configuration; provide either `apiToken` or `session: true`\n\t * @throws {NvisyError} If an `apiToken` is provided but invalid\n\t *\n\t * @example\n\t * ```typescript\n\t * const nvisy = new Nvisy({ apiToken: \"your-api-token\" });\n\t * // or, after a browser login:\n\t * const nvisy = new Nvisy({ session: true });\n\t * ```\n\t */\n\tconstructor(config: NvisyOptions) {\n\t\tthis.#config = config;\n\t\tconst resolved = resolveDefaults(config);\n\t\tthis.#baseUrl = resolved.baseUrl;\n\n\t\tconst usesSession = config.session === true;\n\t\tthis.#api = createApiClient({\n\t\t\tapiToken: usesSession\n\t\t\t\t? undefined\n\t\t\t\t: this.#validateApiToken(config.apiToken),\n\t\t\t// Session auth sends cookies; default to \"include\" unless the caller\n\t\t\t// overrode `credentials` explicitly.\n\t\t\tcredentials: usesSession\n\t\t\t\t? (config.credentials ?? \"include\")\n\t\t\t\t: config.credentials,\n\t\t\tfetch: config.fetch,\n\t\t\t...resolved,\n\t\t});\n\t}\n\n\t/**\n\t * Validates an API token format.\n\t *\n\t * @param apiToken - The API token to validate\n\t * @returns The trimmed API token if valid\n\t * @throws {NvisyError} If the API token is invalid\n\t * @internal\n\t */\n\t#validateApiToken(apiToken: string | undefined): string {\n\t\tif (typeof apiToken !== \"string\" || apiToken.trim().length === 0) {\n\t\t\tthrow new NvisyError(\"API token must be a non-empty string\");\n\t\t}\n\n\t\tconst trimmedToken = apiToken.trim();\n\t\tif (trimmedToken.length < 10) {\n\t\t\tthrow new NvisyError(\"API token must be at least 10 characters\");\n\t\t}\n\n\t\tif (!/^[a-zA-Z0-9_.-]+$/.test(trimmedToken)) {\n\t\t\tthrow new NvisyError(\"API token contains invalid characters\");\n\t\t}\n\n\t\treturn trimmedToken;\n\t}\n\n\t/**\n\t * Creates a new client with a different API token.\n\t *\n\t * Returns a new client instance with the new token. The original client\n\t * remains unchanged. All other configuration (base URL, headers, etc.)\n\t * is preserved in the new client.\n\t *\n\t * @param apiToken - The new API token\n\t * @returns A new Nvisy instance with the new token\n\t * @throws {NvisyError} If the API token is invalid\n\t *\n\t * @example\n\t * ```typescript\n\t * const nvisy = new Nvisy({ apiToken: \"original-token\" });\n\t * const newNvisy = nvisy.withApiToken(\"new-token\");\n\t *\n\t * // newNvisy uses the new token\n\t * // nvisy still uses the original token\n\t * ```\n\t */\n\twithApiToken(apiToken: string): Nvisy {\n\t\tconst { baseUrl, headers, userAgent, credentials, withLogging, fetch } =\n\t\t\tthis.#config;\n\t\treturn new Nvisy({\n\t\t\tapiToken,\n\t\t\tbaseUrl,\n\t\t\theaders,\n\t\t\tuserAgent,\n\t\t\tcredentials,\n\t\t\twithLogging,\n\t\t\tfetch,\n\t\t});\n\t}\n\n\t/**\n\t * The base URL used for API requests.\n\t *\n\t * @returns The configured base URL\n\t */\n\tget baseUrl(): string {\n\t\treturn this.#baseUrl;\n\t}\n\n\t/**\n\t * The underlying openapi-fetch client for direct API access.\n\t *\n\t * Use this for advanced scenarios where you need direct access to the\n\t * HTTP client, such as calling endpoints not covered by the service classes.\n\t *\n\t * @returns The configured ApiClient instance\n\t */\n\tget api(): ApiClient {\n\t\treturn this.#api;\n\t}\n\n\t/**\n\t * Service for authenticated auth operations (logout, desktop token). Pre-auth\n\t * sign-in lives on {@link NvisyGuest}.\n\t */\n\tget auth(): Auth {\n\t\treturn new Auth(this.#api);\n\t}\n\n\t/**\n\t * Service for API status and health checks.\n\t */\n\tget status(): Status {\n\t\treturn new Status(this.#api);\n\t}\n\n\t/**\n\t * Service for managing the authenticated user's account.\n\t */\n\tget account(): Account {\n\t\treturn new Account(this.#api);\n\t}\n\n\t/**\n\t * Service for viewing workspace activities.\n\t */\n\tget activities(): Activities {\n\t\treturn new Activities(this.#api);\n\t}\n\n\t/**\n\t * Service for workspace analytics.\n\t */\n\tget analytics(): Analytics {\n\t\treturn new Analytics(this.#api);\n\t}\n\n\t/**\n\t * Service for managing API tokens.\n\t */\n\tget apiTokens(): ApiTokens {\n\t\treturn new ApiTokens(this.#api);\n\t}\n\n\t/**\n\t * Service for managing connections.\n\t */\n\tget connections(): Connections {\n\t\treturn new Connections(this.#api);\n\t}\n\n\t/**\n\t * Service for document operations (upload, download, delete, review).\n\t */\n\tget documents(): Documents {\n\t\treturn new Documents(this.#api);\n\t}\n\n\t/**\n\t * Service for managing pipelines.\n\t */\n\tget pipelines(): Pipelines {\n\t\treturn new Pipelines(this.#api);\n\t}\n\n\t/**\n\t * Service for managing policies.\n\t */\n\tget policies(): Policies {\n\t\treturn new Policies(this.#api);\n\t}\n\n\t/**\n\t * Service for managing a workspace's inference providers.\n\t */\n\tget providers(): Providers {\n\t\treturn new Providers(this.#api);\n\t}\n\n\t/**\n\t * Service for reading the deployment's capabilities (labels, recognizers,\n\t * connectors, auth methods).\n\t */\n\tget capabilities(): Capabilities {\n\t\treturn new Capabilities(this.#api);\n\t}\n\n\t/**\n\t * Service for managing workspace invitations.\n\t */\n\tget invites(): Invites {\n\t\treturn new Invites(this.#api);\n\t}\n\n\t/**\n\t * Service for managing workspace members.\n\t */\n\tget members(): Members {\n\t\treturn new Members(this.#api);\n\t}\n\n\t/**\n\t * Service for managing notifications.\n\t */\n\tget notifications(): Notifications {\n\t\treturn new Notifications(this.#api);\n\t}\n\n\t/**\n\t * Service for pipeline detections and their redactions.\n\t */\n\tget detections(): Detections {\n\t\treturn new Detections(this.#api);\n\t}\n\n\t/**\n\t * Service for workspace redactions.\n\t */\n\tget redactions(): Redactions {\n\t\treturn new Redactions(this.#api);\n\t}\n\n\t/**\n\t * Service for document reviews (assigning documents to reviewers).\n\t */\n\tget reviews(): Reviews {\n\t\treturn new Reviews(this.#api);\n\t}\n\n\t/**\n\t * Service for managing connection syncs.\n\t */\n\tget syncs(): Syncs {\n\t\treturn new Syncs(this.#api);\n\t}\n\n\t/**\n\t * Service for managing webhooks.\n\t */\n\tget webhooks(): Webhooks {\n\t\treturn new Webhooks(this.#api);\n\t}\n\n\t/**\n\t * Service for managing workspaces.\n\t */\n\tget workspaces(): Workspaces {\n\t\treturn new Workspaces(this.#api);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;AA0DA,IAAa,QAAb,MAAa,MAAM;;CAElB,AAAS;;CAGT,AAAS;;;;;CAMT,AAAS;;;;;;;;;;;;;;;;;;;CAoBT,YAAY,QAAsB;EACjC,KAAK,UAAU;EACf,MAAM,WAAW,gBAAgB,MAAM;EACvC,KAAK,WAAW,SAAS;EAEzB,MAAM,cAAc,OAAO,YAAY;EACvC,K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1B,OAAO,IAAI,UAAU,KAAK,IAAI;CAC/B;;;;CAKA,IAAI,YAAuB;EAC1B,OAAO,IAAI,UAAU,KAAK,IAAI;CAC/B;;;;CAKA,IAAI,WAAqB;EACxB,OAAO,IAAI,SAAS,KAAK,IAAI;CAC9B;;;;CAKA,IAAI,YAAuB;EAC1B,OAAO,IAAI,UAAU,KAAK,IAAI;CAC/B;;;;;CAMA,IAAI,eAA6B;EAChC,OAAO,IAAI,aAAa,KAAK,IAAI;CAClC;;;;CAKA,IAAI,UAAmB;EACtB,OAAO,IAAI,QAAQ,KAAK,IAAI;CAC7B;;;;CAKA,IAAI,UAAmB;EACtB,OAAO,IAAI,QAAQ,KAAK,IAAI;CAC7B;;;;CAKA,IAAI,gBAA+B;EAClC,OAAO,IAAI,cAAc,KAAK,IAAI;CACnC;;;;CAKA,IAAI,aAAyB;EAC5B,OAAO,IAAI,WAAW,KAAK,IAAI;CAChC;;;;CAKA,IAAI,aAAyB;EAC5B,OAAO,IAAI,WAAW,KAAK,IAAI;CAChC;;;;CAKA,IAAI,UAAmB;EACtB,OAAO,IAAI,QAAQ,KAAK,IAAI;CAC7B;;;;CAKA,IAAI,QAAe;EAClB,OAAO,IAAI,MAAM,KAAK,IAAI;CAC3B;;;;CAKA,IAAI,WAAqB;EACxB,OAAO,IAAI,SAAS,KAAK,IAAI;CAC9B;;;;CAKA,IAAI,aAAyB;EAC5B,OAAO,IAAI,WAAW,KAAK,IAAI;CAChC;AACD"}
@@ -1,2 +1,2 @@
1
- import { C as Activities, S as Analytics, _ as Detections, a as Status, b as Auth, c as Providers, d as Notifications, f as Members, g as Documents, h as GuestAuth, i as Syncs, l as Policies, m as GuestCapabilities, n as Webhooks, o as Reviews, p as Invites, r as Threads, s as Redactions, t as Workspaces, u as Pipelines, v as Connections, w as Account, x as ApiTokens, y as Capabilities } from "../index-DFbHT_eq.js";
2
- export { Account, Activities, Analytics, ApiTokens, Auth, Capabilities, Connections, Detections, Documents, GuestAuth, GuestCapabilities, Invites, Members, Notifications, Pipelines, Policies, Providers, Redactions, Reviews, Status, Syncs, Threads, Webhooks, Workspaces };
1
+ import { C as Account, S as Activities, _ as Connections, a as Reviews, b as ApiTokens, c as Policies, d as Members, f as Invites, g as Detections, h as Documents, i as Status, l as Pipelines, m as GuestAuth, n as Webhooks, o as Redactions, p as GuestCapabilities, r as Syncs, s as Providers, t as Workspaces, u as Notifications, v as Capabilities, x as Analytics, y as Auth } from "../index-tS6AFFSf.js";
2
+ export { Account, Activities, Analytics, ApiTokens, Auth, Capabilities, Connections, Detections, Documents, GuestAuth, GuestCapabilities, Invites, Members, Notifications, Pipelines, Policies, Providers, Redactions, Reviews, Status, Syncs, Webhooks, Workspaces };
@@ -1,3 +1,3 @@
1
- import { C as Activities, S as Analytics, _ as Detections, a as Status, b as Auth, c as Providers, d as Notifications, f as Members, g as Documents, h as GuestAuth, i as Syncs, l as Policies, m as GuestCapabilities, n as Webhooks, o as Reviews, p as Invites, r as Threads, s as Redactions, t as Workspaces, u as Pipelines, v as Connections, w as Account, x as ApiTokens, y as Capabilities } from "../services-BMmcawiT.js";
1
+ import { C as Account, S as Activities, _ as Connections, a as Reviews, b as ApiTokens, c as Policies, d as Members, f as Invites, g as Detections, h as Documents, i as Status, l as Pipelines, m as GuestAuth, n as Webhooks, o as Redactions, p as GuestCapabilities, r as Syncs, s as Providers, t as Workspaces, u as Notifications, v as Capabilities, x as Analytics, y as Auth } from "../services-BnCYM6gZ.js";
2
2
 
3
- export { Account, Activities, Analytics, ApiTokens, Auth, Capabilities, Connections, Detections, Documents, GuestAuth, GuestCapabilities, Invites, Members, Notifications, Pipelines, Policies, Providers, Redactions, Reviews, Status, Syncs, Threads, Webhooks, Workspaces };
3
+ export { Account, Activities, Analytics, ApiTokens, Auth, Capabilities, Connections, Detections, Documents, GuestAuth, GuestCapabilities, Invites, Members, Notifications, Pipelines, Policies, Providers, Redactions, Reviews, Status, Syncs, Webhooks, Workspaces };
@@ -1727,6 +1727,37 @@ var Reviews = class {
1727
1727
  return data;
1728
1728
  }
1729
1729
  /**
1730
+ * Rename a review (update its title / purpose).
1731
+ * @param workspaceId - Workspace id
1732
+ * @param reviewId - Review ID
1733
+ * @param updates - The review rename request
1734
+ * @returns Promise that resolves with the updated review
1735
+ * @throws {ApiError} if the request fails
1736
+ */
1737
+ async updateReview(workspaceId, reviewId, updates) {
1738
+ const { data } = await this.#api.PATCH("/workspaces/{workspaceId}/reviews/{reviewId}", {
1739
+ params: { path: {
1740
+ workspaceId,
1741
+ reviewId
1742
+ } },
1743
+ body: updates
1744
+ });
1745
+ return data;
1746
+ }
1747
+ /**
1748
+ * Delete a review.
1749
+ * @param workspaceId - Workspace id
1750
+ * @param reviewId - Review ID
1751
+ * @returns Promise that resolves when the review is deleted
1752
+ * @throws {ApiError} if the request fails
1753
+ */
1754
+ async deleteReview(workspaceId, reviewId) {
1755
+ await this.#api.DELETE("/workspaces/{workspaceId}/reviews/{reviewId}", { params: { path: {
1756
+ workspaceId,
1757
+ reviewId
1758
+ } } });
1759
+ }
1760
+ /**
1730
1761
  * Assign a reviewer to a review (idempotent).
1731
1762
  * @param workspaceId - Workspace id
1732
1763
  * @param reviewId - Review ID
@@ -1787,11 +1818,11 @@ var Reviews = class {
1787
1818
  return data;
1788
1819
  }
1789
1820
  /**
1790
- * Get a review's timeline: the events in its life.
1821
+ * Get a review's timeline: comments interleaved with lifecycle events.
1791
1822
  * @param workspaceId - Workspace id
1792
1823
  * @param reviewId - Review ID
1793
1824
  * @param query - Optional pagination (limit, after)
1794
- * @returns Promise that resolves with a paginated list of review events
1825
+ * @returns Promise that resolves with a paginated list of timeline entries
1795
1826
  * @throws {ApiError} if the request fails
1796
1827
  */
1797
1828
  async getTimeline(workspaceId, reviewId, query) {
@@ -1805,6 +1836,73 @@ var Reviews = class {
1805
1836
  return data;
1806
1837
  }
1807
1838
  /**
1839
+ * Get a review's lifecycle events (assignments, status changes, etc.).
1840
+ * @param workspaceId - Workspace id
1841
+ * @param reviewId - Review ID
1842
+ * @param query - Optional pagination (limit, after)
1843
+ * @returns Promise that resolves with a paginated list of review events
1844
+ * @throws {ApiError} if the request fails
1845
+ */
1846
+ async getEvents(workspaceId, reviewId, query) {
1847
+ const { data } = await this.#api.GET("/workspaces/{workspaceId}/reviews/{reviewId}/events", { params: {
1848
+ path: {
1849
+ workspaceId,
1850
+ reviewId
1851
+ },
1852
+ query
1853
+ } });
1854
+ return data;
1855
+ }
1856
+ /**
1857
+ * Add a comment to a review.
1858
+ * @param workspaceId - Workspace id
1859
+ * @param reviewId - Review ID
1860
+ * @param comment - The comment to add
1861
+ * @returns Promise that resolves with the created comment
1862
+ * @throws {ApiError} if the request fails
1863
+ */
1864
+ async addComment(workspaceId, reviewId, comment) {
1865
+ const { data } = await this.#api.POST("/workspaces/{workspaceId}/reviews/{reviewId}/comments", {
1866
+ params: { path: {
1867
+ workspaceId,
1868
+ reviewId
1869
+ } },
1870
+ body: comment
1871
+ });
1872
+ return data;
1873
+ }
1874
+ /**
1875
+ * Edit a comment.
1876
+ * @param workspaceId - Workspace id
1877
+ * @param commentId - Comment ID
1878
+ * @param updates - The comment update
1879
+ * @returns Promise that resolves with the updated comment
1880
+ * @throws {ApiError} if the request fails
1881
+ */
1882
+ async updateComment(workspaceId, commentId, updates) {
1883
+ const { data } = await this.#api.PATCH("/workspaces/{workspaceId}/comments/{commentId}", {
1884
+ params: { path: {
1885
+ workspaceId,
1886
+ commentId
1887
+ } },
1888
+ body: updates
1889
+ });
1890
+ return data;
1891
+ }
1892
+ /**
1893
+ * Delete a comment.
1894
+ * @param workspaceId - Workspace id
1895
+ * @param commentId - Comment ID
1896
+ * @returns Promise that resolves when the comment is deleted
1897
+ * @throws {ApiError} if the request fails
1898
+ */
1899
+ async deleteComment(workspaceId, commentId) {
1900
+ await this.#api.DELETE("/workspaces/{workspaceId}/comments/{commentId}", { params: { path: {
1901
+ workspaceId,
1902
+ commentId
1903
+ } } });
1904
+ }
1905
+ /**
1808
1906
  * Link a detection to a review (idempotent).
1809
1907
  * @param workspaceId - Workspace id
1810
1908
  * @param reviewId - Review ID
@@ -1982,172 +2080,6 @@ var Syncs = class {
1982
2080
  }
1983
2081
  };
1984
2082
 
1985
- //#endregion
1986
- //#region src/services/threads.ts
1987
- /**
1988
- * Service for discussion threads and the comments within them.
1989
- */
1990
- var Threads = class {
1991
- #api;
1992
- constructor(api) {
1993
- this.#api = api;
1994
- }
1995
- /**
1996
- * List a workspace's threads
1997
- * @param workspaceId - Workspace id
1998
- * @param query - Optional pagination and filters (status, limit, after)
1999
- * @returns Promise that resolves with a paginated list of threads
2000
- * @throws {ApiError} if the request fails
2001
- */
2002
- async listThreads(workspaceId, query) {
2003
- const { data } = await this.#api.GET("/workspaces/{workspaceId}/threads", { params: {
2004
- path: { workspaceId },
2005
- query
2006
- } });
2007
- return data;
2008
- }
2009
- /**
2010
- * Open a new thread in a workspace
2011
- * @param workspaceId - Workspace id
2012
- * @param thread - Thread creation request
2013
- * @returns Promise that resolves with the created thread
2014
- * @throws {ApiError} if the request fails
2015
- */
2016
- async openThread(workspaceId, thread) {
2017
- const { data } = await this.#api.POST("/workspaces/{workspaceId}/threads", {
2018
- params: { path: { workspaceId } },
2019
- body: thread
2020
- });
2021
- return data;
2022
- }
2023
- /**
2024
- * Rename a thread
2025
- * @param workspaceId - Workspace id
2026
- * @param threadId - Thread ID
2027
- * @param updates - Thread rename request
2028
- * @returns Promise that resolves with the updated thread
2029
- * @throws {ApiError} if the request fails
2030
- */
2031
- async renameThread(workspaceId, threadId, updates) {
2032
- const { data } = await this.#api.PATCH("/workspaces/{workspaceId}/threads/{threadId}", {
2033
- params: { path: {
2034
- workspaceId,
2035
- threadId
2036
- } },
2037
- body: updates
2038
- });
2039
- return data;
2040
- }
2041
- /**
2042
- * Delete a thread
2043
- * @param workspaceId - Workspace id
2044
- * @param threadId - Thread ID
2045
- * @returns Promise that resolves when the thread is deleted
2046
- * @throws {ApiError} if the request fails
2047
- */
2048
- async deleteThread(workspaceId, threadId) {
2049
- await this.#api.DELETE("/workspaces/{workspaceId}/threads/{threadId}", { params: { path: {
2050
- workspaceId,
2051
- threadId
2052
- } } });
2053
- }
2054
- /**
2055
- * Close a thread, ending the discussion.
2056
- * @param workspaceId - Workspace id
2057
- * @param threadId - Thread ID
2058
- * @returns Promise that resolves with the closed thread
2059
- * @throws {ApiError} if the request fails
2060
- */
2061
- async closeThread(workspaceId, threadId) {
2062
- const { data } = await this.#api.POST("/workspaces/{workspaceId}/threads/{threadId}/close", { params: { path: {
2063
- workspaceId,
2064
- threadId
2065
- } } });
2066
- return data;
2067
- }
2068
- /**
2069
- * Reopen a closed thread.
2070
- * @param workspaceId - Workspace id
2071
- * @param threadId - Thread ID
2072
- * @returns Promise that resolves with the reopened thread
2073
- * @throws {ApiError} if the request fails
2074
- */
2075
- async reopenThread(workspaceId, threadId) {
2076
- const { data } = await this.#api.DELETE("/workspaces/{workspaceId}/threads/{threadId}/close", { params: { path: {
2077
- workspaceId,
2078
- threadId
2079
- } } });
2080
- return data;
2081
- }
2082
- /**
2083
- * List a thread's timeline: comments interleaved with lifecycle events.
2084
- * @param workspaceId - Workspace id
2085
- * @param threadId - Thread ID
2086
- * @param query - Optional pagination parameters (limit, after)
2087
- * @returns Promise that resolves with a paginated timeline
2088
- * @throws {ApiError} if the request fails
2089
- */
2090
- async listTimeline(workspaceId, threadId, query) {
2091
- const { data } = await this.#api.GET("/workspaces/{workspaceId}/threads/{threadId}/timeline", { params: {
2092
- path: {
2093
- workspaceId,
2094
- threadId
2095
- },
2096
- query
2097
- } });
2098
- return data;
2099
- }
2100
- /**
2101
- * Post a comment to a thread
2102
- * @param workspaceId - Workspace id
2103
- * @param threadId - Thread ID
2104
- * @param comment - Comment creation request
2105
- * @returns Promise that resolves with the created comment
2106
- * @throws {ApiError} if the request fails
2107
- */
2108
- async createComment(workspaceId, threadId, comment) {
2109
- const { data } = await this.#api.POST("/workspaces/{workspaceId}/threads/{threadId}/comments", {
2110
- params: { path: {
2111
- workspaceId,
2112
- threadId
2113
- } },
2114
- body: comment
2115
- });
2116
- return data;
2117
- }
2118
- /**
2119
- * Edit a comment
2120
- * @param workspaceId - Workspace id
2121
- * @param commentId - Comment ID
2122
- * @param updates - Comment update request
2123
- * @returns Promise that resolves with the updated comment
2124
- * @throws {ApiError} if the request fails
2125
- */
2126
- async updateComment(workspaceId, commentId, updates) {
2127
- const { data } = await this.#api.PATCH("/workspaces/{workspaceId}/comments/{commentId}", {
2128
- params: { path: {
2129
- workspaceId,
2130
- commentId
2131
- } },
2132
- body: updates
2133
- });
2134
- return data;
2135
- }
2136
- /**
2137
- * Delete a comment
2138
- * @param workspaceId - Workspace id
2139
- * @param commentId - Comment ID
2140
- * @returns Promise that resolves when the comment is deleted
2141
- * @throws {ApiError} if the request fails
2142
- */
2143
- async deleteComment(workspaceId, commentId) {
2144
- await this.#api.DELETE("/workspaces/{workspaceId}/comments/{commentId}", { params: { path: {
2145
- workspaceId,
2146
- commentId
2147
- } } });
2148
- }
2149
- };
2150
-
2151
2083
  //#endregion
2152
2084
  //#region src/services/webhooks.ts
2153
2085
  /**
@@ -2368,5 +2300,5 @@ var Workspaces = class {
2368
2300
  };
2369
2301
 
2370
2302
  //#endregion
2371
- export { Activities as C, Analytics as S, Detections as _, Status as a, Auth as b, Providers as c, Notifications as d, Members as f, Documents as g, GuestAuth as h, Syncs as i, Policies as l, GuestCapabilities as m, Webhooks as n, Reviews as o, Invites as p, Threads as r, Redactions as s, Workspaces as t, Pipelines as u, Connections as v, Account as w, ApiTokens as x, Capabilities as y };
2372
- //# sourceMappingURL=services-BMmcawiT.js.map
2303
+ export { Account as C, Activities as S, Connections as _, Reviews as a, ApiTokens as b, Policies as c, Members as d, Invites as f, Detections as g, Documents as h, Status as i, Pipelines as l, GuestAuth as m, Webhooks as n, Redactions as o, GuestCapabilities as p, Syncs as r, Providers as s, Workspaces as t, Notifications as u, Capabilities as v, Analytics as x, Auth as y };
2304
+ //# sourceMappingURL=services-BnCYM6gZ.js.map