@nemphi/sdk 0.2.4682 → 0.2.4836

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.d.ts CHANGED
@@ -1465,8 +1465,20 @@ export interface ActionPreview {
1465
1465
  user_name: string;
1466
1466
  expires_at: string;
1467
1467
  }
1468
- /** What a live document is: a document, a spreadsheet or a presentation. */
1469
- export type LiveDocumentKind = "doc" | "sheet" | "slides";
1468
+ /**
1469
+ * What a live document is: a document, a spreadsheet, a presentation, or a
1470
+ * `file` on the shelves (an uploaded or synced workspace document).
1471
+ */
1472
+ export type LiveDocumentKind = "doc" | "sheet" | "slides" | "file";
1473
+ /** The workspace document a `file` live document stands for. */
1474
+ export interface LiveDocumentFile {
1475
+ document_id: string;
1476
+ filename: string;
1477
+ content_type: string;
1478
+ size_bytes: number;
1479
+ /** The extraction's status: uploaded, processing, processed or failed. */
1480
+ status: string;
1481
+ }
1470
1482
  /**
1471
1483
  * Where a live document lives: its owner's `personal` space (seen by the
1472
1484
  * members it is shared with too) or the workspace's shared `team` space.
@@ -1504,6 +1516,8 @@ export interface LiveDocument {
1504
1516
  space: LiveDocumentSpace;
1505
1517
  folder_id: string | null;
1506
1518
  created_by: string | null;
1519
+ /** The file a kind `file` document stands for; null on one the team edits. */
1520
+ file: LiveDocumentFile | null;
1507
1521
  /** Whether the caller owns it: a personal document they created. */
1508
1522
  owned: boolean;
1509
1523
  tags: LiveDocumentTag[];
@@ -1522,6 +1536,8 @@ export interface LiveDocumentFilter {
1522
1536
  folder_id?: string;
1523
1537
  top_level?: boolean;
1524
1538
  tag?: string;
1539
+ /** Only the documents this member (a user id) created. */
1540
+ created_by?: string;
1525
1541
  }
1526
1542
  /** A folder of documents; folders nest through `parent_id`. */
1527
1543
  export interface LiveDocumentFolder {
@@ -1543,6 +1559,76 @@ export interface LiveDocumentShares {
1543
1559
  email: string;
1544
1560
  }[];
1545
1561
  }
1562
+ /** How many days a transfer's link works. */
1563
+ export type TransferExpiryDays = 1 | 3 | 7 | 14 | 30;
1564
+ /** What `createTransfer` sends (`transfers.create`). */
1565
+ export interface TransferInput {
1566
+ live_document_ids: string[];
1567
+ /** The first document's title by default. */
1568
+ title?: string;
1569
+ message?: string;
1570
+ /** 7 by default. */
1571
+ expires_in_days?: TransferExpiryDays;
1572
+ /** 6 to 72 characters; none by default. */
1573
+ password?: string;
1574
+ /** Addresses mailed the link. */
1575
+ recipients?: string[];
1576
+ }
1577
+ /** One document a transfer carries. */
1578
+ export interface TransferItem {
1579
+ /** The item's id; absent in the create answer. */
1580
+ id?: string;
1581
+ live_document_id: string;
1582
+ title: string;
1583
+ kind: LiveDocumentKind;
1584
+ }
1585
+ /** A transfer just created: its link exists only in this answer. */
1586
+ export interface CreatedTransfer {
1587
+ id: string;
1588
+ url: string;
1589
+ title: string;
1590
+ expires_at: string;
1591
+ locked: boolean;
1592
+ items: TransferItem[];
1593
+ recipients: string[];
1594
+ }
1595
+ /** One of the caller's transfers (`transfers.list`). The link is not kept. */
1596
+ export interface Transfer {
1597
+ id: string;
1598
+ title: string;
1599
+ message: string;
1600
+ created_by: string;
1601
+ sender_name: string;
1602
+ expires_at: string;
1603
+ expired: boolean;
1604
+ locked: boolean;
1605
+ revoked_at: string | null;
1606
+ download_count: number;
1607
+ created_at: string;
1608
+ items: TransferItem[];
1609
+ }
1610
+ /** One document on a transfer's public page. */
1611
+ export interface PublicTransferItem {
1612
+ id: string;
1613
+ name: string;
1614
+ /** A file's size; null for a document rendered when it downloads. */
1615
+ size_bytes: number | null;
1616
+ content_type: string;
1617
+ }
1618
+ /** A transfer's public page; `items` is absent while it is locked. */
1619
+ export interface PublicTransfer {
1620
+ title: string;
1621
+ message: string;
1622
+ sender_name: string;
1623
+ expires_at: string;
1624
+ locked: boolean;
1625
+ items?: PublicTransferItem[];
1626
+ }
1627
+ /** An unlocked transfer: the key its downloads carry for an hour. */
1628
+ export interface UnlockedTransfer {
1629
+ key: string;
1630
+ items: PublicTransferItem[];
1631
+ }
1546
1632
  /** One of the workspace's document tags and what it means. */
1547
1633
  export interface LiveDocumentWorkspaceTag {
1548
1634
  id: string;
@@ -1557,6 +1643,8 @@ export interface LiveDocumentState {
1557
1643
  id: string;
1558
1644
  title: string;
1559
1645
  kind: LiveDocumentKind;
1646
+ /** The file a kind `file` document stands for; null on one the team edits. */
1647
+ file: LiveDocumentFile | null;
1560
1648
  state: string;
1561
1649
  seq: number;
1562
1650
  /** Set while the document is in the trash, where it opens read-only. */
@@ -1586,6 +1674,8 @@ export interface Document {
1586
1674
  /** Upload only: true when the bytes were already filed for this tenant
1587
1675
  * and the returned document is the existing one, not a new row. */
1588
1676
  duplicate?: boolean;
1677
+ /** Upload only: the Docs shelf entry made when the upload named a place. */
1678
+ live_document_id?: string;
1589
1679
  extracted?: unknown;
1590
1680
  error?: string;
1591
1681
  }
@@ -1598,6 +1688,30 @@ export type CompanyDocumentKind = "rut" | "company_registration";
1598
1688
  * `knowledge.search` either way.
1599
1689
  */
1600
1690
  export type UploadDocumentKind = CompanyDocumentKind | "context";
1691
+ /** What `beginUpload` takes: the file's name, type and exact size, and
1692
+ * optionally a kind hint and a Docs shelf place (filed on completion). */
1693
+ export interface BeginUploadInput {
1694
+ filename: string;
1695
+ content_type?: string;
1696
+ size_bytes: number;
1697
+ kind?: UploadDocumentKind;
1698
+ space?: LiveDocumentSpace;
1699
+ folder_id?: string;
1700
+ title?: string;
1701
+ }
1702
+ /** An open upload session: send `parts` parts of `part_size` bytes each
1703
+ * (the last one shorter), in order from 1, before `expires_at`. */
1704
+ export interface UploadSession {
1705
+ id: string;
1706
+ part_size: number;
1707
+ parts: number;
1708
+ expires_at: string;
1709
+ }
1710
+ /** One part recorded, and the bytes the session holds so far. */
1711
+ export interface UploadPartResult {
1712
+ number: number;
1713
+ bytes_received: number;
1714
+ }
1601
1715
  /**
1602
1716
  * The tenant's own legal/fiscal identity, filled by parsing its
1603
1717
  * registration document (Colombia: the RUT) or via `company.set_profile`.
@@ -4104,7 +4218,7 @@ export interface CanvasStat {
4104
4218
  }
4105
4219
  /** Selects one live record source with optional filters (records blocks). */
4106
4220
  export interface RecordsQuery {
4107
- source: "invoices" | "bills" | "parties" | "items" | "quotes" | "sales_orders" | "rentals" | "purchase_orders" | "employees" | "assets" | "bank_transactions" | "warehouses" | "stock_levels" | "stock_movements" | "inventory_counts" | "payroll_runs" | "payslips" | "payroll_novelties" | "payroll_parameters" | "payment_runs" | "journal_entries" | "accounts" | "agent_runs" | "crm_deals" | "members" | "roles" | "policies" | "connections" | "email_accounts" | "email_templates" | "email_campaigns" | "categorization_rules" | "documents" | "calendar_events" | "connected_calendar_events" | "calendar_accounts" | "connected_calendars" | "projects" | "project_tasks" | "project_columns" | "live_documents" | "agents" | "tags" | "tag_dimensions" | "crm_pipelines" | "crm_stages" | "crm_fields" | "payments" | "banks" | "payment_formats" | "apps" | "booking_types" | "bookings" | "ai_models";
4221
+ source: "invoices" | "bills" | "parties" | "items" | "quotes" | "sales_orders" | "rentals" | "purchase_orders" | "employees" | "assets" | "bank_transactions" | "warehouses" | "stock_levels" | "stock_movements" | "inventory_counts" | "payroll_runs" | "payslips" | "payroll_novelties" | "payroll_parameters" | "payment_runs" | "journal_entries" | "accounts" | "agent_runs" | "crm_deals" | "members" | "roles" | "policies" | "connections" | "email_accounts" | "email_templates" | "email_campaigns" | "categorization_rules" | "documents" | "calendar_events" | "connected_calendar_events" | "calendar_accounts" | "drive_accounts" | "connected_calendars" | "projects" | "project_tasks" | "project_columns" | "live_documents" | "agents" | "tags" | "tag_dimensions" | "crm_pipelines" | "crm_stages" | "crm_fields" | "payments" | "banks" | "payment_formats" | "apps" | "booking_types" | "bookings" | "ai_models";
4108
4222
  /** Status filter in the source's own vocabulary (e.g. draft | posted; unmatched). */
4109
4223
  status?: string;
4110
4224
  /** Kind filter where the source has one (parties: customer | vendor | both). */
@@ -5719,6 +5833,25 @@ export interface CalendarConnection {
5719
5833
  last_error: string | null;
5720
5834
  calendars: ConnectedCalendar[];
5721
5835
  }
5836
+ /** A drive a member connects, mirrored into their personal Docs. */
5837
+ export type DriveProvider = "google" | "onedrive";
5838
+ /** One of the member's connected drives (`drives.list`). Never carries credentials. */
5839
+ export interface DriveAccount {
5840
+ id: string;
5841
+ provider: DriveProvider;
5842
+ address: string;
5843
+ /** `error`: the provider refused the connection and it waits to be connected again. */
5844
+ status: "active" | "error" | "disconnected";
5845
+ last_synced_at: string | null;
5846
+ last_error: string | null;
5847
+ /** The Docs folder the drive mirrors into, once the first sync made it. */
5848
+ root_folder_id: string | null;
5849
+ files: number;
5850
+ folders: number;
5851
+ /** Items left out (too large, edited here since, refused by the provider). */
5852
+ skipped: number;
5853
+ created_at: string;
5854
+ }
5722
5855
  export interface ConnectedCalendarEvent {
5723
5856
  id: string;
5724
5857
  calendar_id: string;
@@ -8079,7 +8212,22 @@ export interface NemphiClient {
8079
8212
  filename?: string;
8080
8213
  kind?: UploadDocumentKind;
8081
8214
  partyId?: string;
8215
+ /** Shelve the upload under Docs: a space, a folder of it, a title. */
8216
+ place?: LiveDocumentPlace & {
8217
+ title?: string;
8218
+ };
8082
8219
  }): Promise<Document>;
8220
+ /** Start a large upload (up to 5 GiB) sent in parts. */
8221
+ beginUpload(input: BeginUploadInput): Promise<UploadSession>;
8222
+ /** Send part `number` (from 1, in order): exactly `part_size` bytes, the
8223
+ * last part the rest. Sending the last recorded part again is answered
8224
+ * as the session stands. */
8225
+ uploadPart(id: string, number: number, body: Blob | Uint8Array): Promise<UploadPartResult>;
8226
+ /** Assemble the parts and file the document, the same answer as
8227
+ * `uploadDocument` (with `duplicate` for bytes already filed). */
8228
+ completeUpload(id: string): Promise<Document>;
8229
+ /** Abandon an upload and discard its parts. */
8230
+ abortUpload(id: string): Promise<void>;
8083
8231
  /**
8084
8232
  * Upload a workspace company logo (PNG/JPEG/WebP/GIF, max 2 MiB).
8085
8233
  * Owners and admins only. Sets `company_profiles.logo_url` to
@@ -8137,6 +8285,8 @@ export interface NemphiClient {
8137
8285
  id: string;
8138
8286
  deleted: boolean;
8139
8287
  }>;
8288
+ /** Puts a folder inside another folder of its space (empty: the top level). */
8289
+ moveLiveDocumentFolder(id: string, parentId: string): Promise<LiveDocumentFolder>;
8140
8290
  listLiveDocumentTags(): Promise<LiveDocumentWorkspaceTag[]>;
8141
8291
  /** Puts a tag on a document by name; a new name adds the tag to the workspace. */
8142
8292
  tagLiveDocument(id: string, tag: string): Promise<LiveDocument>;
@@ -8182,6 +8332,40 @@ export interface NemphiClient {
8182
8332
  * content type — for showing what was shared, not only its name.
8183
8333
  */
8184
8334
  downloadDocument(id: string): Promise<Response>;
8335
+ /** Sends documents through a public link, mailed to any recipients. */
8336
+ createTransfer(input: TransferInput): Promise<CreatedTransfer>;
8337
+ /** The caller's transfers (an owner or admin: the workspace's), newest first. */
8338
+ listTransfers(): Promise<Transfer[]>;
8339
+ /** Stops a transfer's link working, for everyone. */
8340
+ revokeTransfer(id: string): Promise<{
8341
+ id: string;
8342
+ revoked: boolean;
8343
+ }>;
8344
+ /** A transfer's public page, by its link's token; no session needed. */
8345
+ getPublicTransfer(token: string): Promise<PublicTransfer>;
8346
+ /** Unlocks a password-locked transfer; a wrong password fails with code `locked`. */
8347
+ unlockPublicTransfer(token: string, password: string): Promise<UnlockedTransfer>;
8348
+ /** One document of a transfer, as a streamable attachment `Response`. */
8349
+ downloadPublicTransferItem(token: string, item: string, key?: string): Promise<Response>;
8350
+ /** Every document of a transfer as one zip, streamed. */
8351
+ downloadPublicTransferZip(token: string, key?: string): Promise<Response>;
8352
+ /** The member's connected Google Drive and OneDrive accounts. */
8353
+ listDriveAccounts(): Promise<DriveAccount[]>;
8354
+ /** Starts connecting a drive: open `auth_url`; the provider returns to `returnTo`. */
8355
+ connectDriveAccount(input: {
8356
+ provider: DriveProvider;
8357
+ returnTo?: string;
8358
+ }): Promise<{
8359
+ auth_url: string;
8360
+ }>;
8361
+ /** Queues a sync of one of the member's drives now. */
8362
+ syncDriveAccount(id: string): Promise<{
8363
+ queued: boolean;
8364
+ }>;
8365
+ /** Forgets a drive's credentials and stops syncing; the copied documents stay. */
8366
+ disconnectDriveAccount(id: string): Promise<{
8367
+ disconnected: boolean;
8368
+ }>;
8185
8369
  /**
8186
8370
  * The action ledger, cursor-paged by id. `after` walks forward from a
8187
8371
  * cursor (oldest first); `before` walks backward from the newest