attio-mcp 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +62 -0
- package/LICENSE +236 -0
- package/README.md +105 -0
- package/dist/api/attio-client.d.ts +25 -0
- package/dist/api/attio-client.d.ts.map +1 -0
- package/dist/api/attio-client.js +64 -0
- package/dist/api/attio-client.js.map +1 -0
- package/dist/api/attribute-types.d.ts +119 -0
- package/dist/api/attribute-types.d.ts.map +1 -0
- package/dist/api/attribute-types.js +320 -0
- package/dist/api/attribute-types.js.map +1 -0
- package/dist/api/client.d.ts +3 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +61 -0
- package/dist/api/client.js.map +1 -0
- package/dist/api/operations/batch.d.ts +55 -0
- package/dist/api/operations/batch.d.ts.map +1 -0
- package/dist/api/operations/batch.js +176 -0
- package/dist/api/operations/batch.js.map +1 -0
- package/dist/api/operations/crud.d.ts +61 -0
- package/dist/api/operations/crud.d.ts.map +1 -0
- package/dist/api/operations/crud.js +192 -0
- package/dist/api/operations/crud.js.map +1 -0
- package/dist/api/operations/index.d.ts +14 -0
- package/dist/api/operations/index.d.ts.map +1 -0
- package/dist/api/operations/index.js +18 -0
- package/dist/api/operations/index.js.map +1 -0
- package/dist/api/operations/lists.d.ts +66 -0
- package/dist/api/operations/lists.d.ts.map +1 -0
- package/dist/api/operations/lists.js +300 -0
- package/dist/api/operations/lists.js.map +1 -0
- package/dist/api/operations/notes.d.ts +29 -0
- package/dist/api/operations/notes.d.ts.map +1 -0
- package/dist/api/operations/notes.js +63 -0
- package/dist/api/operations/notes.js.map +1 -0
- package/dist/api/operations/retry.d.ts +48 -0
- package/dist/api/operations/retry.d.ts.map +1 -0
- package/dist/api/operations/retry.js +98 -0
- package/dist/api/operations/retry.js.map +1 -0
- package/dist/api/operations/search.d.ts +37 -0
- package/dist/api/operations/search.d.ts.map +1 -0
- package/dist/api/operations/search.js +186 -0
- package/dist/api/operations/search.js.map +1 -0
- package/dist/api/operations/tasks.d.ts +20 -0
- package/dist/api/operations/tasks.d.ts.map +1 -0
- package/dist/api/operations/tasks.js +87 -0
- package/dist/api/operations/tasks.js.map +1 -0
- package/dist/api/operations/types.d.ts +61 -0
- package/dist/api/operations/types.d.ts.map +1 -0
- package/dist/api/operations/types.js +10 -0
- package/dist/api/operations/types.js.map +1 -0
- package/dist/cli/commands/attributes.d.ts +34 -0
- package/dist/cli/commands/attributes.d.ts.map +1 -0
- package/dist/cli/commands/attributes.js +171 -0
- package/dist/cli/commands/attributes.js.map +1 -0
- package/dist/cli/discover.d.ts +3 -0
- package/dist/cli/discover.d.ts.map +1 -0
- package/dist/cli/discover.js +72 -0
- package/dist/cli/discover.js.map +1 -0
- package/dist/errors/api-errors.d.ts +191 -0
- package/dist/errors/api-errors.d.ts.map +1 -0
- package/dist/errors/api-errors.js +305 -0
- package/dist/errors/api-errors.js.map +1 -0
- package/dist/errors/company-errors.d.ts +40 -0
- package/dist/errors/company-errors.d.ts.map +1 -0
- package/dist/errors/company-errors.js +62 -0
- package/dist/errors/company-errors.js.map +1 -0
- package/dist/errors/value-match-error.d.ts +15 -0
- package/dist/errors/value-match-error.d.ts.map +1 -0
- package/dist/errors/value-match-error.js +40 -0
- package/dist/errors/value-match-error.js.map +1 -0
- package/dist/handlers/error-interceptor.d.ts +6 -0
- package/dist/handlers/error-interceptor.d.ts.map +1 -0
- package/dist/handlers/error-interceptor.js +17 -0
- package/dist/handlers/error-interceptor.js.map +1 -0
- package/dist/handlers/rate-limited-handler.d.ts +17 -0
- package/dist/handlers/rate-limited-handler.d.ts.map +1 -0
- package/dist/handlers/rate-limited-handler.js +126 -0
- package/dist/handlers/rate-limited-handler.js.map +1 -0
- package/dist/handlers/resources.d.ts +11 -0
- package/dist/handlers/resources.d.ts.map +1 -0
- package/dist/handlers/resources.js +109 -0
- package/dist/handlers/resources.js.map +1 -0
- package/dist/handlers/tool-configs/companies/attributes.d.ts +85 -0
- package/dist/handlers/tool-configs/companies/attributes.d.ts.map +1 -0
- package/dist/handlers/tool-configs/companies/attributes.js +203 -0
- package/dist/handlers/tool-configs/companies/attributes.js.map +1 -0
- package/dist/handlers/tool-configs/companies/batch.d.ts +145 -0
- package/dist/handlers/tool-configs/companies/batch.d.ts.map +1 -0
- package/dist/handlers/tool-configs/companies/batch.js +249 -0
- package/dist/handlers/tool-configs/companies/batch.js.map +1 -0
- package/dist/handlers/tool-configs/companies/crud.d.ts +103 -0
- package/dist/handlers/tool-configs/companies/crud.d.ts.map +1 -0
- package/dist/handlers/tool-configs/companies/crud.js +157 -0
- package/dist/handlers/tool-configs/companies/crud.js.map +1 -0
- package/dist/handlers/tool-configs/companies/definitions.d.ts +5 -0
- package/dist/handlers/tool-configs/companies/definitions.d.ts.map +1 -0
- package/dist/handlers/tool-configs/companies/definitions.js +9 -0
- package/dist/handlers/tool-configs/companies/definitions.js.map +1 -0
- package/dist/handlers/tool-configs/companies/formatters.d.ts +42 -0
- package/dist/handlers/tool-configs/companies/formatters.d.ts.map +1 -0
- package/dist/handlers/tool-configs/companies/formatters.js +324 -0
- package/dist/handlers/tool-configs/companies/formatters.js.map +1 -0
- package/dist/handlers/tool-configs/companies/index.d.ts +642 -0
- package/dist/handlers/tool-configs/companies/index.d.ts.map +1 -0
- package/dist/handlers/tool-configs/companies/index.js +86 -0
- package/dist/handlers/tool-configs/companies/index.js.map +1 -0
- package/dist/handlers/tool-configs/companies/notes.d.ts +61 -0
- package/dist/handlers/tool-configs/companies/notes.d.ts.map +1 -0
- package/dist/handlers/tool-configs/companies/notes.js +109 -0
- package/dist/handlers/tool-configs/companies/notes.js.map +1 -0
- package/dist/handlers/tool-configs/companies/relationships.d.ts +137 -0
- package/dist/handlers/tool-configs/companies/relationships.d.ts.map +1 -0
- package/dist/handlers/tool-configs/companies/relationships.js +163 -0
- package/dist/handlers/tool-configs/companies/relationships.js.map +1 -0
- package/dist/handlers/tool-configs/companies/search.d.ts +101 -0
- package/dist/handlers/tool-configs/companies/search.d.ts.map +1 -0
- package/dist/handlers/tool-configs/companies/search.js +163 -0
- package/dist/handlers/tool-configs/companies/search.js.map +1 -0
- package/dist/handlers/tool-configs/companies/types.d.ts +6 -0
- package/dist/handlers/tool-configs/companies/types.d.ts.map +1 -0
- package/dist/handlers/tool-configs/companies/types.js +2 -0
- package/dist/handlers/tool-configs/companies/types.js.map +1 -0
- package/dist/handlers/tool-configs/index.d.ts +12 -0
- package/dist/handlers/tool-configs/index.d.ts.map +1 -0
- package/dist/handlers/tool-configs/index.js +12 -0
- package/dist/handlers/tool-configs/index.js.map +1 -0
- package/dist/handlers/tool-configs/lists.d.ts +459 -0
- package/dist/handlers/tool-configs/lists.d.ts.map +1 -0
- package/dist/handlers/tool-configs/lists.js +597 -0
- package/dist/handlers/tool-configs/lists.js.map +1 -0
- package/dist/handlers/tool-configs/paginated-people.d.ts +197 -0
- package/dist/handlers/tool-configs/paginated-people.d.ts.map +1 -0
- package/dist/handlers/tool-configs/paginated-people.js +256 -0
- package/dist/handlers/tool-configs/paginated-people.js.map +1 -0
- package/dist/handlers/tool-configs/people/activity-search.d.ts +98 -0
- package/dist/handlers/tool-configs/people/activity-search.d.ts.map +1 -0
- package/dist/handlers/tool-configs/people/activity-search.js +113 -0
- package/dist/handlers/tool-configs/people/activity-search.js.map +1 -0
- package/dist/handlers/tool-configs/people/advanced-search.d.ts +62 -0
- package/dist/handlers/tool-configs/people/advanced-search.d.ts.map +1 -0
- package/dist/handlers/tool-configs/people/advanced-search.js +74 -0
- package/dist/handlers/tool-configs/people/advanced-search.js.map +1 -0
- package/dist/handlers/tool-configs/people/crud.d.ts +63 -0
- package/dist/handlers/tool-configs/people/crud.d.ts.map +1 -0
- package/dist/handlers/tool-configs/people/crud.js +71 -0
- package/dist/handlers/tool-configs/people/crud.js.map +1 -0
- package/dist/handlers/tool-configs/people/date-search.d.ts +42 -0
- package/dist/handlers/tool-configs/people/date-search.d.ts.map +1 -0
- package/dist/handlers/tool-configs/people/date-search.js +93 -0
- package/dist/handlers/tool-configs/people/date-search.js.map +1 -0
- package/dist/handlers/tool-configs/people/formatters.d.ts +19 -0
- package/dist/handlers/tool-configs/people/formatters.d.ts.map +1 -0
- package/dist/handlers/tool-configs/people/formatters.js +98 -0
- package/dist/handlers/tool-configs/people/formatters.js.map +1 -0
- package/dist/handlers/tool-configs/people/index.d.ts +407 -0
- package/dist/handlers/tool-configs/people/index.d.ts.map +1 -0
- package/dist/handlers/tool-configs/people/index.js +30 -0
- package/dist/handlers/tool-configs/people/index.js.map +1 -0
- package/dist/handlers/tool-configs/people/notes.d.ts +38 -0
- package/dist/handlers/tool-configs/people/notes.d.ts.map +1 -0
- package/dist/handlers/tool-configs/people/notes.js +57 -0
- package/dist/handlers/tool-configs/people/notes.js.map +1 -0
- package/dist/handlers/tool-configs/people/relationships.d.ts +112 -0
- package/dist/handlers/tool-configs/people/relationships.d.ts.map +1 -0
- package/dist/handlers/tool-configs/people/relationships.js +173 -0
- package/dist/handlers/tool-configs/people/relationships.js.map +1 -0
- package/dist/handlers/tool-configs/people/search.d.ts +53 -0
- package/dist/handlers/tool-configs/people/search.d.ts.map +1 -0
- package/dist/handlers/tool-configs/people/search.js +61 -0
- package/dist/handlers/tool-configs/people/search.js.map +1 -0
- package/dist/handlers/tool-configs/people-fix-complete.d.ts +6 -0
- package/dist/handlers/tool-configs/people-fix-complete.d.ts.map +1 -0
- package/dist/handlers/tool-configs/people-fix-complete.js +76 -0
- package/dist/handlers/tool-configs/people-fix-complete.js.map +1 -0
- package/dist/handlers/tool-configs/people-fixed.d.ts +12 -0
- package/dist/handlers/tool-configs/people-fixed.d.ts.map +1 -0
- package/dist/handlers/tool-configs/people-fixed.js +58 -0
- package/dist/handlers/tool-configs/people-fixed.js.map +1 -0
- package/dist/handlers/tool-configs/people-types.d.ts +32 -0
- package/dist/handlers/tool-configs/people-types.d.ts.map +1 -0
- package/dist/handlers/tool-configs/people-types.js +5 -0
- package/dist/handlers/tool-configs/people-types.js.map +1 -0
- package/dist/handlers/tool-configs/people.d.ts +599 -0
- package/dist/handlers/tool-configs/people.d.ts.map +1 -0
- package/dist/handlers/tool-configs/people.js +817 -0
- package/dist/handlers/tool-configs/people.js.map +1 -0
- package/dist/handlers/tool-configs/prompts.d.ts +69 -0
- package/dist/handlers/tool-configs/prompts.d.ts.map +1 -0
- package/dist/handlers/tool-configs/prompts.js +90 -0
- package/dist/handlers/tool-configs/prompts.js.map +1 -0
- package/dist/handlers/tool-configs/rate-limited-people.d.ts +203 -0
- package/dist/handlers/tool-configs/rate-limited-people.d.ts.map +1 -0
- package/dist/handlers/tool-configs/rate-limited-people.js +44 -0
- package/dist/handlers/tool-configs/rate-limited-people.js.map +1 -0
- package/dist/handlers/tool-configs/records/index.d.ts +282 -0
- package/dist/handlers/tool-configs/records/index.d.ts.map +1 -0
- package/dist/handlers/tool-configs/records/index.js +277 -0
- package/dist/handlers/tool-configs/records/index.js.map +1 -0
- package/dist/handlers/tool-configs/records.d.ts +282 -0
- package/dist/handlers/tool-configs/records.d.ts.map +1 -0
- package/dist/handlers/tool-configs/records.js +277 -0
- package/dist/handlers/tool-configs/records.js.map +1 -0
- package/dist/handlers/tool-configs/resource-specific-tools.d.ts +15 -0
- package/dist/handlers/tool-configs/resource-specific-tools.d.ts.map +1 -0
- package/dist/handlers/tool-configs/resource-specific-tools.js +33 -0
- package/dist/handlers/tool-configs/resource-specific-tools.js.map +1 -0
- package/dist/handlers/tool-configs/tasks.d.ts +127 -0
- package/dist/handlers/tool-configs/tasks.d.ts.map +1 -0
- package/dist/handlers/tool-configs/tasks.js +95 -0
- package/dist/handlers/tool-configs/tasks.js.map +1 -0
- package/dist/handlers/tool-types.d.ts +47 -0
- package/dist/handlers/tool-types.d.ts.map +1 -0
- package/dist/handlers/tool-types.js +2 -0
- package/dist/handlers/tool-types.js.map +1 -0
- package/dist/handlers/tools/config-verifier.d.ts +27 -0
- package/dist/handlers/tools/config-verifier.d.ts.map +1 -0
- package/dist/handlers/tools/config-verifier.js +108 -0
- package/dist/handlers/tools/config-verifier.js.map +1 -0
- package/dist/handlers/tools/dispatcher/core.d.ts +12 -0
- package/dist/handlers/tools/dispatcher/core.d.ts.map +1 -0
- package/dist/handlers/tools/dispatcher/core.js +276 -0
- package/dist/handlers/tools/dispatcher/core.js.map +1 -0
- package/dist/handlers/tools/dispatcher/formatting.d.ts +17 -0
- package/dist/handlers/tools/dispatcher/formatting.d.ts.map +1 -0
- package/dist/handlers/tools/dispatcher/formatting.js +25 -0
- package/dist/handlers/tools/dispatcher/formatting.js.map +1 -0
- package/dist/handlers/tools/dispatcher/logging.d.ts +63 -0
- package/dist/handlers/tools/dispatcher/logging.d.ts.map +1 -0
- package/dist/handlers/tools/dispatcher/logging.js +108 -0
- package/dist/handlers/tools/dispatcher/logging.js.map +1 -0
- package/dist/handlers/tools/dispatcher/operations/batch.d.ts +29 -0
- package/dist/handlers/tools/dispatcher/operations/batch.d.ts.map +1 -0
- package/dist/handlers/tools/dispatcher/operations/batch.js +137 -0
- package/dist/handlers/tools/dispatcher/operations/batch.js.map +1 -0
- package/dist/handlers/tools/dispatcher/operations/crud.d.ts +25 -0
- package/dist/handlers/tools/dispatcher/operations/crud.d.ts.map +1 -0
- package/dist/handlers/tools/dispatcher/operations/crud.js +110 -0
- package/dist/handlers/tools/dispatcher/operations/crud.js.map +1 -0
- package/dist/handlers/tools/dispatcher/operations/details.d.ts +13 -0
- package/dist/handlers/tools/dispatcher/operations/details.d.ts.map +1 -0
- package/dist/handlers/tools/dispatcher/operations/details.js +52 -0
- package/dist/handlers/tools/dispatcher/operations/details.js.map +1 -0
- package/dist/handlers/tools/dispatcher/operations/info.d.ts +25 -0
- package/dist/handlers/tools/dispatcher/operations/info.d.ts.map +1 -0
- package/dist/handlers/tools/dispatcher/operations/info.js +82 -0
- package/dist/handlers/tools/dispatcher/operations/info.js.map +1 -0
- package/dist/handlers/tools/dispatcher/operations/lists.d.ts +62 -0
- package/dist/handlers/tools/dispatcher/operations/lists.d.ts.map +1 -0
- package/dist/handlers/tools/dispatcher/operations/lists.js +283 -0
- package/dist/handlers/tools/dispatcher/operations/lists.js.map +1 -0
- package/dist/handlers/tools/dispatcher/operations/notes.d.ts +17 -0
- package/dist/handlers/tools/dispatcher/operations/notes.d.ts.map +1 -0
- package/dist/handlers/tools/dispatcher/operations/notes.js +102 -0
- package/dist/handlers/tools/dispatcher/operations/notes.js.map +1 -0
- package/dist/handlers/tools/dispatcher/operations/search.d.ts +43 -0
- package/dist/handlers/tools/dispatcher/operations/search.d.ts.map +1 -0
- package/dist/handlers/tools/dispatcher/operations/search.js +190 -0
- package/dist/handlers/tools/dispatcher/operations/search.js.map +1 -0
- package/dist/handlers/tools/dispatcher/validation.d.ts +27 -0
- package/dist/handlers/tools/dispatcher/validation.d.ts.map +1 -0
- package/dist/handlers/tools/dispatcher/validation.js +47 -0
- package/dist/handlers/tools/dispatcher/validation.js.map +1 -0
- package/dist/handlers/tools/dispatcher.d.ts +11 -0
- package/dist/handlers/tools/dispatcher.d.ts.map +1 -0
- package/dist/handlers/tools/dispatcher.js +15 -0
- package/dist/handlers/tools/dispatcher.js.map +1 -0
- package/dist/handlers/tools/error-types.d.ts +33 -0
- package/dist/handlers/tools/error-types.d.ts.map +1 -0
- package/dist/handlers/tools/error-types.js +21 -0
- package/dist/handlers/tools/error-types.js.map +1 -0
- package/dist/handlers/tools/formatters.d.ts +43 -0
- package/dist/handlers/tools/formatters.d.ts.map +1 -0
- package/dist/handlers/tools/formatters.js +170 -0
- package/dist/handlers/tools/formatters.js.map +1 -0
- package/dist/handlers/tools/index.d.ts +15 -0
- package/dist/handlers/tools/index.d.ts.map +1 -0
- package/dist/handlers/tools/index.js +34 -0
- package/dist/handlers/tools/index.js.map +1 -0
- package/dist/handlers/tools/registry.d.ts +1874 -0
- package/dist/handlers/tools/registry.d.ts.map +1 -0
- package/dist/handlers/tools/registry.js +103 -0
- package/dist/handlers/tools/registry.js.map +1 -0
- package/dist/health/http-server.d.ts +24 -0
- package/dist/health/http-server.d.ts.map +1 -0
- package/dist/health/http-server.js +106 -0
- package/dist/health/http-server.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +238 -0
- package/dist/index.js.map +1 -0
- package/dist/objects/base-operations.d.ts +41 -0
- package/dist/objects/base-operations.d.ts.map +1 -0
- package/dist/objects/base-operations.js +116 -0
- package/dist/objects/base-operations.js.map +1 -0
- package/dist/objects/batch-companies.d.ts +112 -0
- package/dist/objects/batch-companies.d.ts.map +1 -0
- package/dist/objects/batch-companies.js +347 -0
- package/dist/objects/batch-companies.js.map +1 -0
- package/dist/objects/companies/attributes.d.ts +83 -0
- package/dist/objects/companies/attributes.d.ts.map +1 -0
- package/dist/objects/companies/attributes.js +426 -0
- package/dist/objects/companies/attributes.js.map +1 -0
- package/dist/objects/companies/basic.d.ts +117 -0
- package/dist/objects/companies/basic.d.ts.map +1 -0
- package/dist/objects/companies/basic.js +367 -0
- package/dist/objects/companies/basic.js.map +1 -0
- package/dist/objects/companies/batch.d.ts +6 -0
- package/dist/objects/companies/batch.d.ts.map +1 -0
- package/dist/objects/companies/batch.js +6 -0
- package/dist/objects/companies/batch.js.map +1 -0
- package/dist/objects/companies/index.d.ts +13 -0
- package/dist/objects/companies/index.d.ts.map +1 -0
- package/dist/objects/companies/index.js +17 -0
- package/dist/objects/companies/index.js.map +1 -0
- package/dist/objects/companies/notes.d.ts +26 -0
- package/dist/objects/companies/notes.d.ts.map +1 -0
- package/dist/objects/companies/notes.js +199 -0
- package/dist/objects/companies/notes.js.map +1 -0
- package/dist/objects/companies/relationships.d.ts +41 -0
- package/dist/objects/companies/relationships.d.ts.map +1 -0
- package/dist/objects/companies/relationships.js +142 -0
- package/dist/objects/companies/relationships.js.map +1 -0
- package/dist/objects/companies/search.d.ts +158 -0
- package/dist/objects/companies/search.d.ts.map +1 -0
- package/dist/objects/companies/search.js +463 -0
- package/dist/objects/companies/search.js.map +1 -0
- package/dist/objects/companies/types.d.ts +27 -0
- package/dist/objects/companies/types.d.ts.map +1 -0
- package/dist/objects/companies/types.js +3 -0
- package/dist/objects/companies/types.js.map +1 -0
- package/dist/objects/lists.d.ts +148 -0
- package/dist/objects/lists.d.ts.map +1 -0
- package/dist/objects/lists.js +586 -0
- package/dist/objects/lists.js.map +1 -0
- package/dist/objects/paginated-people.d.ts +50 -0
- package/dist/objects/paginated-people.d.ts.map +1 -0
- package/dist/objects/paginated-people.js +171 -0
- package/dist/objects/paginated-people.js.map +1 -0
- package/dist/objects/people/basic.d.ts +90 -0
- package/dist/objects/people/basic.d.ts.map +1 -0
- package/dist/objects/people/basic.js +157 -0
- package/dist/objects/people/basic.js.map +1 -0
- package/dist/objects/people/batch.d.ts +24 -0
- package/dist/objects/people/batch.d.ts.map +1 -0
- package/dist/objects/people/batch.js +145 -0
- package/dist/objects/people/batch.js.map +1 -0
- package/dist/objects/people/index.d.ts +11 -0
- package/dist/objects/people/index.d.ts.map +1 -0
- package/dist/objects/people/index.js +17 -0
- package/dist/objects/people/index.js.map +1 -0
- package/dist/objects/people/notes.d.ts +20 -0
- package/dist/objects/people/notes.d.ts.map +1 -0
- package/dist/objects/people/notes.js +60 -0
- package/dist/objects/people/notes.js.map +1 -0
- package/dist/objects/people/relationships.d.ts +23 -0
- package/dist/objects/people/relationships.d.ts.map +1 -0
- package/dist/objects/people/relationships.js +116 -0
- package/dist/objects/people/relationships.js.map +1 -0
- package/dist/objects/people/search.d.ts +83 -0
- package/dist/objects/people/search.d.ts.map +1 -0
- package/dist/objects/people/search.js +286 -0
- package/dist/objects/people/search.js.map +1 -0
- package/dist/objects/people/types.d.ts +37 -0
- package/dist/objects/people/types.d.ts.map +1 -0
- package/dist/objects/people/types.js +71 -0
- package/dist/objects/people/types.js.map +1 -0
- package/dist/objects/people-write.d.ts +71 -0
- package/dist/objects/people-write.d.ts.map +1 -0
- package/dist/objects/people-write.js +261 -0
- package/dist/objects/people-write.js.map +1 -0
- package/dist/objects/records/formatters.d.ts +20 -0
- package/dist/objects/records/formatters.d.ts.map +1 -0
- package/dist/objects/records/formatters.js +47 -0
- package/dist/objects/records/formatters.js.map +1 -0
- package/dist/objects/records/index.d.ts +74 -0
- package/dist/objects/records/index.d.ts.map +1 -0
- package/dist/objects/records/index.js +374 -0
- package/dist/objects/records/index.js.map +1 -0
- package/dist/objects/records.d.ts +88 -0
- package/dist/objects/records.d.ts.map +1 -0
- package/dist/objects/records.js +432 -0
- package/dist/objects/records.js.map +1 -0
- package/dist/objects/tasks.d.ts +19 -0
- package/dist/objects/tasks.d.ts.map +1 -0
- package/dist/objects/tasks.js +23 -0
- package/dist/objects/tasks.js.map +1 -0
- package/dist/prompts/error-handler.d.ts +28 -0
- package/dist/prompts/error-handler.d.ts.map +1 -0
- package/dist/prompts/error-handler.js +47 -0
- package/dist/prompts/error-handler.js.map +1 -0
- package/dist/prompts/handlers.d.ts +49 -0
- package/dist/prompts/handlers.d.ts.map +1 -0
- package/dist/prompts/handlers.js +353 -0
- package/dist/prompts/handlers.js.map +1 -0
- package/dist/prompts/index.d.ts +11 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +15 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/templates/companies.d.ts +10 -0
- package/dist/prompts/templates/companies.d.ts.map +1 -0
- package/dist/prompts/templates/companies.js +128 -0
- package/dist/prompts/templates/companies.js.map +1 -0
- package/dist/prompts/templates/index.d.ts +42 -0
- package/dist/prompts/templates/index.d.ts.map +1 -0
- package/dist/prompts/templates/index.js +58 -0
- package/dist/prompts/templates/index.js.map +1 -0
- package/dist/prompts/templates/lists.d.ts +10 -0
- package/dist/prompts/templates/lists.d.ts.map +1 -0
- package/dist/prompts/templates/lists.js +127 -0
- package/dist/prompts/templates/lists.js.map +1 -0
- package/dist/prompts/templates/notes.d.ts +10 -0
- package/dist/prompts/templates/notes.d.ts.map +1 -0
- package/dist/prompts/templates/notes.js +119 -0
- package/dist/prompts/templates/notes.js.map +1 -0
- package/dist/prompts/templates/people.d.ts +10 -0
- package/dist/prompts/templates/people.d.ts.map +1 -0
- package/dist/prompts/templates/people.js +127 -0
- package/dist/prompts/templates/people.js.map +1 -0
- package/dist/prompts/types.d.ts +52 -0
- package/dist/prompts/types.d.ts.map +1 -0
- package/dist/prompts/types.js +5 -0
- package/dist/prompts/types.js.map +1 -0
- package/dist/types/attio.d.ts +424 -0
- package/dist/types/attio.d.ts.map +1 -0
- package/dist/types/attio.js +116 -0
- package/dist/types/attio.js.map +1 -0
- package/dist/types/company-types.d.ts +52 -0
- package/dist/types/company-types.d.ts.map +1 -0
- package/dist/types/company-types.js +5 -0
- package/dist/types/company-types.js.map +1 -0
- package/dist/types/tool-types.d.ts +262 -0
- package/dist/types/tool-types.d.ts.map +1 -0
- package/dist/types/tool-types.js +6 -0
- package/dist/types/tool-types.js.map +1 -0
- package/dist/utils/api-fallback.d.ts +39 -0
- package/dist/utils/api-fallback.d.ts.map +1 -0
- package/dist/utils/api-fallback.js +94 -0
- package/dist/utils/api-fallback.js.map +1 -0
- package/dist/utils/attribute-mapping/attribute-mappers.d.ts +39 -0
- package/dist/utils/attribute-mapping/attribute-mappers.d.ts.map +1 -0
- package/dist/utils/attribute-mapping/attribute-mappers.js +394 -0
- package/dist/utils/attribute-mapping/attribute-mappers.js.map +1 -0
- package/dist/utils/attribute-mapping/filter-translator.d.ts +9 -0
- package/dist/utils/attribute-mapping/filter-translator.d.ts.map +1 -0
- package/dist/utils/attribute-mapping/filter-translator.js +104 -0
- package/dist/utils/attribute-mapping/filter-translator.js.map +1 -0
- package/dist/utils/attribute-mapping/index.d.ts +10 -0
- package/dist/utils/attribute-mapping/index.d.ts.map +1 -0
- package/dist/utils/attribute-mapping/index.js +12 -0
- package/dist/utils/attribute-mapping/index.js.map +1 -0
- package/dist/utils/attribute-mapping/legacy-maps.d.ts +11 -0
- package/dist/utils/attribute-mapping/legacy-maps.d.ts.map +1 -0
- package/dist/utils/attribute-mapping/legacy-maps.js +54 -0
- package/dist/utils/attribute-mapping/legacy-maps.js.map +1 -0
- package/dist/utils/attribute-mapping/mapping-utils.d.ts +90 -0
- package/dist/utils/attribute-mapping/mapping-utils.d.ts.map +1 -0
- package/dist/utils/attribute-mapping/mapping-utils.js +145 -0
- package/dist/utils/attribute-mapping/mapping-utils.js.map +1 -0
- package/dist/utils/auto-discovery.d.ts +22 -0
- package/dist/utils/auto-discovery.d.ts.map +1 -0
- package/dist/utils/auto-discovery.js +143 -0
- package/dist/utils/auto-discovery.js.map +1 -0
- package/dist/utils/cli-colors.d.ts +36 -0
- package/dist/utils/cli-colors.d.ts.map +1 -0
- package/dist/utils/cli-colors.js +35 -0
- package/dist/utils/cli-colors.js.map +1 -0
- package/dist/utils/config-loader.d.ts +41 -0
- package/dist/utils/config-loader.d.ts.map +1 -0
- package/dist/utils/config-loader.js +167 -0
- package/dist/utils/config-loader.js.map +1 -0
- package/dist/utils/config-migration.d.ts +140 -0
- package/dist/utils/config-migration.d.ts.map +1 -0
- package/dist/utils/config-migration.js +310 -0
- package/dist/utils/config-migration.js.map +1 -0
- package/dist/utils/date-utils.d.ts +63 -0
- package/dist/utils/date-utils.d.ts.map +1 -0
- package/dist/utils/date-utils.js +329 -0
- package/dist/utils/date-utils.js.map +1 -0
- package/dist/utils/debug-b2b-segment.d.ts +2 -0
- package/dist/utils/debug-b2b-segment.d.ts.map +1 -0
- package/dist/utils/debug-b2b-segment.js +67 -0
- package/dist/utils/debug-b2b-segment.js.map +1 -0
- package/dist/utils/domain-utils.d.ts +46 -0
- package/dist/utils/domain-utils.d.ts.map +1 -0
- package/dist/utils/domain-utils.js +143 -0
- package/dist/utils/domain-utils.js.map +1 -0
- package/dist/utils/dynamic-import.d.ts +33 -0
- package/dist/utils/dynamic-import.d.ts.map +1 -0
- package/dist/utils/dynamic-import.js +41 -0
- package/dist/utils/dynamic-import.js.map +1 -0
- package/dist/utils/error-enhancer.d.ts +23 -0
- package/dist/utils/error-enhancer.d.ts.map +1 -0
- package/dist/utils/error-enhancer.js +188 -0
- package/dist/utils/error-enhancer.js.map +1 -0
- package/dist/utils/error-handler.d.ts +89 -0
- package/dist/utils/error-handler.d.ts.map +1 -0
- package/dist/utils/error-handler.js +336 -0
- package/dist/utils/error-handler.js.map +1 -0
- package/dist/utils/filters/builders/activity.d.ts +13 -0
- package/dist/utils/filters/builders/activity.d.ts.map +1 -0
- package/dist/utils/filters/builders/activity.js +65 -0
- package/dist/utils/filters/builders/activity.js.map +1 -0
- package/dist/utils/filters/builders/basic.d.ts +13 -0
- package/dist/utils/filters/builders/basic.d.ts.map +1 -0
- package/dist/utils/filters/builders/basic.js +36 -0
- package/dist/utils/filters/builders/basic.js.map +1 -0
- package/dist/utils/filters/builders/complex.d.ts +31 -0
- package/dist/utils/filters/builders/complex.d.ts.map +1 -0
- package/dist/utils/filters/builders/complex.js +92 -0
- package/dist/utils/filters/builders/complex.js.map +1 -0
- package/dist/utils/filters/builders/date.d.ts +17 -0
- package/dist/utils/filters/builders/date.d.ts.map +1 -0
- package/dist/utils/filters/builders/date.js +51 -0
- package/dist/utils/filters/builders/date.js.map +1 -0
- package/dist/utils/filters/builders/index.d.ts +8 -0
- package/dist/utils/filters/builders/index.d.ts.map +1 -0
- package/dist/utils/filters/builders/index.js +8 -0
- package/dist/utils/filters/builders/index.js.map +1 -0
- package/dist/utils/filters/builders/numeric.d.ts +17 -0
- package/dist/utils/filters/builders/numeric.d.ts.map +1 -0
- package/dist/utils/filters/builders/numeric.js +61 -0
- package/dist/utils/filters/builders/numeric.js.map +1 -0
- package/dist/utils/filters/builders/text.d.ts +17 -0
- package/dist/utils/filters/builders/text.d.ts.map +1 -0
- package/dist/utils/filters/builders/text.js +47 -0
- package/dist/utils/filters/builders/text.js.map +1 -0
- package/dist/utils/filters/builders/types.d.ts +2 -0
- package/dist/utils/filters/builders/types.d.ts.map +1 -0
- package/dist/utils/filters/builders/types.js +2 -0
- package/dist/utils/filters/builders/types.js.map +1 -0
- package/dist/utils/filters/builders.d.ts +2 -0
- package/dist/utils/filters/builders.d.ts.map +1 -0
- package/dist/utils/filters/builders.js +2 -0
- package/dist/utils/filters/builders.js.map +1 -0
- package/dist/utils/filters/cache.d.ts +80 -0
- package/dist/utils/filters/cache.d.ts.map +1 -0
- package/dist/utils/filters/cache.js +212 -0
- package/dist/utils/filters/cache.js.map +1 -0
- package/dist/utils/filters/index.d.ts +51 -0
- package/dist/utils/filters/index.d.ts.map +1 -0
- package/dist/utils/filters/index.js +67 -0
- package/dist/utils/filters/index.js.map +1 -0
- package/dist/utils/filters/operators.d.ts +65 -0
- package/dist/utils/filters/operators.d.ts.map +1 -0
- package/dist/utils/filters/operators.js +214 -0
- package/dist/utils/filters/operators.js.map +1 -0
- package/dist/utils/filters/relationship.d.ts +81 -0
- package/dist/utils/filters/relationship.d.ts.map +1 -0
- package/dist/utils/filters/relationship.js +393 -0
- package/dist/utils/filters/relationship.js.map +1 -0
- package/dist/utils/filters/translators.d.ts +120 -0
- package/dist/utils/filters/translators.d.ts.map +1 -0
- package/dist/utils/filters/translators.js +397 -0
- package/dist/utils/filters/translators.js.map +1 -0
- package/dist/utils/filters/types.d.ts +77 -0
- package/dist/utils/filters/types.d.ts.map +1 -0
- package/dist/utils/filters/types.js +85 -0
- package/dist/utils/filters/types.js.map +1 -0
- package/dist/utils/filters/utils.d.ts +86 -0
- package/dist/utils/filters/utils.d.ts.map +1 -0
- package/dist/utils/filters/utils.js +142 -0
- package/dist/utils/filters/utils.js.map +1 -0
- package/dist/utils/filters/validation-utils.d.ts +123 -0
- package/dist/utils/filters/validation-utils.d.ts.map +1 -0
- package/dist/utils/filters/validation-utils.js +282 -0
- package/dist/utils/filters/validation-utils.js.map +1 -0
- package/dist/utils/filters/validators.d.ts +73 -0
- package/dist/utils/filters/validators.d.ts.map +1 -0
- package/dist/utils/filters/validators.js +311 -0
- package/dist/utils/filters/validators.js.map +1 -0
- package/dist/utils/json-serializer.d.ts +68 -0
- package/dist/utils/json-serializer.d.ts.map +1 -0
- package/dist/utils/json-serializer.js +235 -0
- package/dist/utils/json-serializer.js.map +1 -0
- package/dist/utils/logger.d.ts +226 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +323 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/numeric-utils.d.ts +27 -0
- package/dist/utils/numeric-utils.d.ts.map +1 -0
- package/dist/utils/numeric-utils.js +83 -0
- package/dist/utils/numeric-utils.js.map +1 -0
- package/dist/utils/pagination.d.ts +85 -0
- package/dist/utils/pagination.d.ts.map +1 -0
- package/dist/utils/pagination.js +169 -0
- package/dist/utils/pagination.js.map +1 -0
- package/dist/utils/person-lookup.d.ts +35 -0
- package/dist/utils/person-lookup.d.ts.map +1 -0
- package/dist/utils/person-lookup.js +67 -0
- package/dist/utils/person-lookup.js.map +1 -0
- package/dist/utils/rate-limiter.d.ts +82 -0
- package/dist/utils/rate-limiter.d.ts.map +1 -0
- package/dist/utils/rate-limiter.js +159 -0
- package/dist/utils/rate-limiter.js.map +1 -0
- package/dist/utils/record-utils.d.ts +74 -0
- package/dist/utils/record-utils.d.ts.map +1 -0
- package/dist/utils/record-utils.js +312 -0
- package/dist/utils/record-utils.js.map +1 -0
- package/dist/utils/relationship-utils.d.ts +61 -0
- package/dist/utils/relationship-utils.d.ts.map +1 -0
- package/dist/utils/relationship-utils.js +242 -0
- package/dist/utils/relationship-utils.js.map +1 -0
- package/dist/utils/response-formatter.d.ts +121 -0
- package/dist/utils/response-formatter.d.ts.map +1 -0
- package/dist/utils/response-formatter.js +188 -0
- package/dist/utils/response-formatter.js.map +1 -0
- package/dist/utils/uri-parser.d.ts +18 -0
- package/dist/utils/uri-parser.d.ts.map +1 -0
- package/dist/utils/uri-parser.js +31 -0
- package/dist/utils/uri-parser.js.map +1 -0
- package/dist/utils/validation.d.ts +59 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +264 -0
- package/dist/utils/validation.js.map +1 -0
- package/dist/utils/value-matcher.d.ts +58 -0
- package/dist/utils/value-matcher.d.ts.map +1 -0
- package/dist/utils/value-matcher.js +131 -0
- package/dist/utils/value-matcher.js.map +1 -0
- package/dist/validators/attribute-validator.d.ts +59 -0
- package/dist/validators/attribute-validator.d.ts.map +1 -0
- package/dist/validators/attribute-validator.js +531 -0
- package/dist/validators/attribute-validator.js.map +1 -0
- package/dist/validators/company/field_detector.d.ts +5 -0
- package/dist/validators/company/field_detector.d.ts.map +1 -0
- package/dist/validators/company/field_detector.js +95 -0
- package/dist/validators/company/field_detector.js.map +1 -0
- package/dist/validators/company/index.d.ts +26 -0
- package/dist/validators/company/index.d.ts.map +1 -0
- package/dist/validators/company/index.js +433 -0
- package/dist/validators/company/index.js.map +1 -0
- package/dist/validators/company/type_cache.d.ts +14 -0
- package/dist/validators/company/type_cache.d.ts.map +1 -0
- package/dist/validators/company/type_cache.js +28 -0
- package/dist/validators/company/type_cache.js.map +1 -0
- package/dist/validators/company/types.d.ts +8 -0
- package/dist/validators/company/types.d.ts.map +1 -0
- package/dist/validators/company/types.js +2 -0
- package/dist/validators/company/types.js.map +1 -0
- package/dist/validators/company-validator.d.ts +2 -0
- package/dist/validators/company-validator.d.ts.map +1 -0
- package/dist/validators/company-validator.js +2 -0
- package/dist/validators/company-validator.js.map +1 -0
- package/package.json +167 -0
|
@@ -0,0 +1,586 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lists-related functionality
|
|
3
|
+
*/
|
|
4
|
+
import { getAttioClient } from '../api/attio-client.js';
|
|
5
|
+
import { getAllLists as getGenericLists, getListDetails as getGenericListDetails, getListEntries as getGenericListEntries, addRecordToList as addGenericRecordToList, removeRecordFromList as removeGenericRecordFromList, updateListEntry as updateGenericListEntry, executeBatchOperations, } from '../api/operations/index.js';
|
|
6
|
+
import { ResourceType } from '../types/attio.js';
|
|
7
|
+
import { processListEntries, transformFiltersToApiFormat, createPathBasedFilter, } from '../utils/record-utils.js';
|
|
8
|
+
/**
|
|
9
|
+
* Gets all lists in the workspace
|
|
10
|
+
*
|
|
11
|
+
* @param objectSlug - Optional object type to filter lists by (e.g., 'companies', 'people')
|
|
12
|
+
* @param limit - Maximum number of lists to fetch (default: 20)
|
|
13
|
+
* @returns Array of list objects
|
|
14
|
+
*/
|
|
15
|
+
export async function getLists(objectSlug, limit = 20) {
|
|
16
|
+
// Use the generic operation with fallback to direct implementation
|
|
17
|
+
try {
|
|
18
|
+
return await getGenericLists(objectSlug, limit);
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
if (process.env.NODE_ENV === 'development') {
|
|
22
|
+
console.log(`Generic getLists failed: ${error.message || 'Unknown error'}`);
|
|
23
|
+
}
|
|
24
|
+
// Fallback implementation
|
|
25
|
+
const api = getAttioClient();
|
|
26
|
+
let path = `/lists?limit=${limit}`;
|
|
27
|
+
if (objectSlug) {
|
|
28
|
+
path += `&objectSlug=${objectSlug}`;
|
|
29
|
+
}
|
|
30
|
+
const response = await api.get(path);
|
|
31
|
+
return response.data.data || [];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Gets details for a specific list
|
|
36
|
+
*
|
|
37
|
+
* @param listId - The ID of the list
|
|
38
|
+
* @returns List details
|
|
39
|
+
*/
|
|
40
|
+
export async function getListDetails(listId) {
|
|
41
|
+
// Use the generic operation with fallback to direct implementation
|
|
42
|
+
try {
|
|
43
|
+
return await getGenericListDetails(listId);
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
if (process.env.NODE_ENV === 'development') {
|
|
47
|
+
console.log(`Generic getListDetails failed: ${error.message || 'Unknown error'}`);
|
|
48
|
+
}
|
|
49
|
+
// Fallback implementation
|
|
50
|
+
const api = getAttioClient();
|
|
51
|
+
const path = `/lists/${listId}`;
|
|
52
|
+
const response = await api.get(path);
|
|
53
|
+
return response.data.data || response.data;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Utility function to attempt multiple API endpoints for list entries
|
|
58
|
+
*
|
|
59
|
+
* @param listId - The ID of the list
|
|
60
|
+
* @param limit - Maximum number of entries to fetch
|
|
61
|
+
* @param offset - Number of entries to skip
|
|
62
|
+
* @param filters - Optional filters to apply to list entries
|
|
63
|
+
* @returns Array of list entries
|
|
64
|
+
*/
|
|
65
|
+
async function tryMultipleListEntryEndpoints(listId, limit, offset, filters) {
|
|
66
|
+
const api = getAttioClient();
|
|
67
|
+
// Prepare the base data for POST requests
|
|
68
|
+
const baseData = {
|
|
69
|
+
limit: limit,
|
|
70
|
+
offset: offset,
|
|
71
|
+
expand: ['record'],
|
|
72
|
+
};
|
|
73
|
+
// Transform filters using our centralized utility function
|
|
74
|
+
const filterData = transformFiltersToApiFormat(filters);
|
|
75
|
+
// Setup endpoints with correct data
|
|
76
|
+
const endpoints = [
|
|
77
|
+
// Path 1: Direct query endpoint for the specific list with explicit parameters
|
|
78
|
+
{
|
|
79
|
+
method: 'post',
|
|
80
|
+
path: `/lists/${listId}/entries/query`,
|
|
81
|
+
data: { ...baseData, ...filterData },
|
|
82
|
+
},
|
|
83
|
+
// Path 2: General lists entries query endpoint with explicit parameters
|
|
84
|
+
{
|
|
85
|
+
method: 'post',
|
|
86
|
+
path: `/lists-entries/query`,
|
|
87
|
+
data: {
|
|
88
|
+
...baseData,
|
|
89
|
+
...filterData,
|
|
90
|
+
list_id: listId,
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
];
|
|
94
|
+
// Only add the GET endpoint if we don't have filters, as it doesn't support them
|
|
95
|
+
if (!filters || !filters.filters || filters.filters.length === 0) {
|
|
96
|
+
endpoints.push({
|
|
97
|
+
method: 'get',
|
|
98
|
+
path: `/lists-entries?list_id=${listId}&limit=${limit}&offset=${offset}&expand=record`,
|
|
99
|
+
data: { ...baseData }, // Copy baseData to ensure it has the required shape
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
// Try each endpoint in sequence until one works
|
|
103
|
+
for (const endpoint of endpoints) {
|
|
104
|
+
try {
|
|
105
|
+
if (process.env.NODE_ENV === 'development') {
|
|
106
|
+
console.log(`Trying ${endpoint.method.toUpperCase()} ${endpoint.path}`, endpoint.data ? JSON.stringify(endpoint.data) : '');
|
|
107
|
+
}
|
|
108
|
+
const response = endpoint.method === 'post'
|
|
109
|
+
? await api.post(endpoint.path, endpoint.data)
|
|
110
|
+
: await api.get(endpoint.path);
|
|
111
|
+
// Process the response to extract record IDs properly
|
|
112
|
+
const entries = response.data.data || [];
|
|
113
|
+
// Check if entries were found and log for debugging
|
|
114
|
+
if (process.env.NODE_ENV === 'development') {
|
|
115
|
+
const messageType = entries.length > 0 ? 'SUCCESS' : 'WARNING';
|
|
116
|
+
console.log(`[tryMultipleListEntryEndpoints] [${messageType}] Found ${entries.length} entries via ${endpoint.method.toUpperCase()} ${endpoint.path}`, {
|
|
117
|
+
listId,
|
|
118
|
+
limit,
|
|
119
|
+
offset,
|
|
120
|
+
hasFilters: filters && filters.filters ? filters.filters.length > 0 : false,
|
|
121
|
+
entryCount: entries.length,
|
|
122
|
+
endpoint: endpoint.method.toUpperCase(),
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
// Process entries to ensure record_id is properly set from the utils function
|
|
126
|
+
return processListEntries(entries);
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
if (process.env.NODE_ENV === 'development') {
|
|
130
|
+
console.log(`[tryMultipleListEntryEndpoints] [ERROR] Failed ${endpoint.method.toUpperCase()} ${endpoint.path}:`, error.message || 'Unknown error', {
|
|
131
|
+
listId,
|
|
132
|
+
limit,
|
|
133
|
+
offset,
|
|
134
|
+
hasFilters: filters && filters.filters ? filters.filters.length > 0 : false,
|
|
135
|
+
endpoint: endpoint.method.toUpperCase(),
|
|
136
|
+
path: endpoint.path,
|
|
137
|
+
errorType: error.name || 'UnknownError',
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
// Continue to next endpoint on failure
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
// If all endpoints fail, return empty array
|
|
145
|
+
return [];
|
|
146
|
+
}
|
|
147
|
+
// We no longer need this function as we use processListEntries from record-utils.js
|
|
148
|
+
/**
|
|
149
|
+
* Gets entries for a specific list
|
|
150
|
+
*
|
|
151
|
+
* @param listId - The ID of the list
|
|
152
|
+
* @param limit - Maximum number of entries to fetch (default: 20)
|
|
153
|
+
* @param offset - Number of entries to skip (default: 0)
|
|
154
|
+
* @param filters - Optional filters to apply to the list entries
|
|
155
|
+
* @returns Array of list entries
|
|
156
|
+
*/
|
|
157
|
+
export async function getListEntries(listId, limit = 20, offset = 0, filters) {
|
|
158
|
+
// Use the generic operation with fallback to direct implementation
|
|
159
|
+
try {
|
|
160
|
+
return await getGenericListEntries(listId, limit, offset, filters);
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
if (process.env.NODE_ENV === 'development') {
|
|
164
|
+
console.log(`[getListEntries] Generic list entries failed: ${error.message || 'Unknown error'}`, {
|
|
165
|
+
method: 'getGenericListEntries',
|
|
166
|
+
listId,
|
|
167
|
+
limit,
|
|
168
|
+
offset,
|
|
169
|
+
hasFilters: filters && filters.filters ? filters.filters.length > 0 : false,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
// Fallback to our multi-endpoint utility function with enhanced filter support
|
|
173
|
+
return await tryMultipleListEntryEndpoints(listId, limit, offset, filters);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Adds a record to a list
|
|
178
|
+
*
|
|
179
|
+
* @param listId - The ID of the list
|
|
180
|
+
* @param recordId - The ID of the record to add
|
|
181
|
+
* @param objectType - Optional object type ('companies', 'people', etc.)
|
|
182
|
+
* @param initialValues - Optional initial values for the list entry (e.g., stage)
|
|
183
|
+
* @returns The created list entry
|
|
184
|
+
*/
|
|
185
|
+
export async function addRecordToList(listId, recordId, objectType, initialValues) {
|
|
186
|
+
// Input validation to ensure required parameters
|
|
187
|
+
if (!listId || typeof listId !== 'string') {
|
|
188
|
+
throw new Error('Invalid list ID: Must be a non-empty string');
|
|
189
|
+
}
|
|
190
|
+
if (!recordId || typeof recordId !== 'string') {
|
|
191
|
+
throw new Error('Invalid record ID: Must be a non-empty string');
|
|
192
|
+
}
|
|
193
|
+
// Validate objectType if provided
|
|
194
|
+
if (objectType &&
|
|
195
|
+
!Object.values(ResourceType).includes(objectType)) {
|
|
196
|
+
const validTypes = Object.values(ResourceType).join(', ');
|
|
197
|
+
throw new Error(`Invalid object type: "${objectType}". Must be one of: ${validTypes}`);
|
|
198
|
+
}
|
|
199
|
+
// Use the generic operation with fallback to direct implementation
|
|
200
|
+
try {
|
|
201
|
+
return await addGenericRecordToList(listId, recordId, objectType, initialValues);
|
|
202
|
+
}
|
|
203
|
+
catch (error) {
|
|
204
|
+
if (process.env.NODE_ENV === 'development') {
|
|
205
|
+
console.log(`Generic addRecordToList failed: ${error.message || 'Unknown error'}`);
|
|
206
|
+
console.log(`Falling back to direct implementation for list ${listId} and record ${recordId}`);
|
|
207
|
+
}
|
|
208
|
+
// Fallback implementation
|
|
209
|
+
const api = getAttioClient();
|
|
210
|
+
const path = `/lists/${listId}/entries`;
|
|
211
|
+
// Default object type to 'companies' if not specified
|
|
212
|
+
const safeObjectType = objectType || 'companies';
|
|
213
|
+
// Construct the proper API payload according to Attio API requirements
|
|
214
|
+
// The API expects parent_record_id, parent_object, and optionally entry_values
|
|
215
|
+
const payload = {
|
|
216
|
+
data: {
|
|
217
|
+
parent_record_id: recordId,
|
|
218
|
+
parent_object: safeObjectType,
|
|
219
|
+
// Only include entry_values if initialValues is provided
|
|
220
|
+
...(initialValues && { entry_values: initialValues }),
|
|
221
|
+
},
|
|
222
|
+
};
|
|
223
|
+
if (process.env.NODE_ENV === 'development') {
|
|
224
|
+
console.log(`[addRecordToList:fallback] Request to ${path} with payload:`, JSON.stringify(payload));
|
|
225
|
+
console.log(`Object Type: ${safeObjectType}`);
|
|
226
|
+
if (initialValues) {
|
|
227
|
+
console.log(`Initial Values: ${JSON.stringify(initialValues)}`);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
try {
|
|
231
|
+
const response = await api.post(path, payload);
|
|
232
|
+
if (process.env.NODE_ENV === 'development') {
|
|
233
|
+
console.log(`[addRecordToList:fallback] Success response:`, JSON.stringify(response.data || {}));
|
|
234
|
+
}
|
|
235
|
+
return response.data.data || response.data;
|
|
236
|
+
}
|
|
237
|
+
catch (error) {
|
|
238
|
+
// Enhanced error handling for validation errors
|
|
239
|
+
if (process.env.NODE_ENV === 'development') {
|
|
240
|
+
console.error(`[addRecordToList] Error adding record ${recordId} to list ${listId}:`, error.message || 'Unknown error');
|
|
241
|
+
console.error('Status:', error.response?.status);
|
|
242
|
+
console.error('Response data:', JSON.stringify(error.response?.data || {}));
|
|
243
|
+
// Add additional debug information for validation errors
|
|
244
|
+
if (error.response?.data?.validation_errors) {
|
|
245
|
+
console.error('Validation errors:', JSON.stringify(error.response.data.validation_errors));
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
// Add more context to the error message
|
|
249
|
+
if (error.response?.status === 400) {
|
|
250
|
+
const validationErrors = error.response?.data?.validation_errors || [];
|
|
251
|
+
const errorDetails = validationErrors
|
|
252
|
+
.map((e) => `${e.path.join('.')}: ${e.message}`)
|
|
253
|
+
.join('; ');
|
|
254
|
+
throw new Error(`Validation error adding record to list: ${errorDetails || error.message}`);
|
|
255
|
+
}
|
|
256
|
+
// Let upstream handlers create specific, rich error objects.
|
|
257
|
+
throw error;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Updates a list entry (e.g., changing stage)
|
|
263
|
+
*
|
|
264
|
+
* @param listId - The ID of the list
|
|
265
|
+
* @param entryId - The ID of the list entry to update
|
|
266
|
+
* @param attributes - The attributes to update (e.g., { stage: "Demo Scheduling" })
|
|
267
|
+
* @returns The updated list entry
|
|
268
|
+
*/
|
|
269
|
+
export async function updateListEntry(listId, entryId, attributes) {
|
|
270
|
+
// Input validation
|
|
271
|
+
if (!listId || typeof listId !== 'string') {
|
|
272
|
+
throw new Error('Invalid list ID: Must be a non-empty string');
|
|
273
|
+
}
|
|
274
|
+
if (!entryId || typeof entryId !== 'string') {
|
|
275
|
+
throw new Error('Invalid entry ID: Must be a non-empty string');
|
|
276
|
+
}
|
|
277
|
+
if (!attributes ||
|
|
278
|
+
typeof attributes !== 'object' ||
|
|
279
|
+
Array.isArray(attributes)) {
|
|
280
|
+
throw new Error('Invalid attributes: Must be a non-empty object');
|
|
281
|
+
}
|
|
282
|
+
// Use the generic operation with fallback to direct implementation
|
|
283
|
+
try {
|
|
284
|
+
return await updateGenericListEntry(listId, entryId, attributes);
|
|
285
|
+
}
|
|
286
|
+
catch (error) {
|
|
287
|
+
if (process.env.NODE_ENV === 'development') {
|
|
288
|
+
console.log(`Generic updateListEntry failed: ${error.message || 'Unknown error'}`);
|
|
289
|
+
console.log(`Falling back to direct implementation for list ${listId}, entry ${entryId}`);
|
|
290
|
+
}
|
|
291
|
+
// Fallback implementation
|
|
292
|
+
const api = getAttioClient();
|
|
293
|
+
const path = `/lists/${listId}/entries/${entryId}`;
|
|
294
|
+
if (process.env.NODE_ENV === 'development') {
|
|
295
|
+
console.log(`[updateListEntry:fallback] Request to ${path} with attributes:`, JSON.stringify(attributes));
|
|
296
|
+
}
|
|
297
|
+
// Attio API expects updates to list entries in the 'data.values' structure
|
|
298
|
+
// This follows the same pattern as record updates in crud.ts
|
|
299
|
+
const response = await api.patch(path, {
|
|
300
|
+
data: {
|
|
301
|
+
values: attributes,
|
|
302
|
+
},
|
|
303
|
+
});
|
|
304
|
+
if (process.env.NODE_ENV === 'development') {
|
|
305
|
+
console.log(`[updateListEntry:fallback] Success response:`, JSON.stringify(response.data || {}));
|
|
306
|
+
}
|
|
307
|
+
return response.data.data || response.data;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Removes a record from a list
|
|
312
|
+
*
|
|
313
|
+
* @param listId - The ID of the list
|
|
314
|
+
* @param entryId - The ID of the list entry to remove
|
|
315
|
+
* @returns True if successful
|
|
316
|
+
*/
|
|
317
|
+
export async function removeRecordFromList(listId, entryId) {
|
|
318
|
+
// Use the generic operation with fallback to direct implementation
|
|
319
|
+
try {
|
|
320
|
+
return await removeGenericRecordFromList(listId, entryId);
|
|
321
|
+
}
|
|
322
|
+
catch (error) {
|
|
323
|
+
if (process.env.NODE_ENV === 'development') {
|
|
324
|
+
console.log(`Generic removeRecordFromList failed: ${error.message || 'Unknown error'}`);
|
|
325
|
+
}
|
|
326
|
+
// Fallback implementation
|
|
327
|
+
const api = getAttioClient();
|
|
328
|
+
const path = `/lists/${listId}/entries/${entryId}`;
|
|
329
|
+
await api.delete(path);
|
|
330
|
+
return true;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Gets details for multiple lists in batch
|
|
335
|
+
*
|
|
336
|
+
* @param listIds - Array of list IDs to fetch
|
|
337
|
+
* @param batchConfig - Optional batch configuration
|
|
338
|
+
* @returns Batch response with list details for each ID
|
|
339
|
+
*/
|
|
340
|
+
export async function batchGetListsDetails(listIds, batchConfig) {
|
|
341
|
+
// Create batch request items
|
|
342
|
+
const operations = listIds.map((listId) => ({
|
|
343
|
+
params: listId,
|
|
344
|
+
id: `get_list_${listId}`,
|
|
345
|
+
}));
|
|
346
|
+
// Execute batch operations
|
|
347
|
+
return executeBatchOperations(operations, (listId) => getListDetails(listId), batchConfig);
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Gets entries for multiple lists in batch
|
|
351
|
+
*
|
|
352
|
+
* @param listConfigs - Array of list configurations with ID, limit, and offset
|
|
353
|
+
* @param batchConfig - Optional batch configuration
|
|
354
|
+
* @returns Batch response with list entries for each configuration
|
|
355
|
+
*/
|
|
356
|
+
export async function batchGetListsEntries(listConfigs, batchConfig) {
|
|
357
|
+
// Create batch request items
|
|
358
|
+
const operations = listConfigs.map((config, index) => ({
|
|
359
|
+
params: config,
|
|
360
|
+
id: `get_list_entries_${config.listId}_${index}`,
|
|
361
|
+
}));
|
|
362
|
+
// Execute batch operations
|
|
363
|
+
return executeBatchOperations(operations, (params) => getListEntries(params.listId, params.limit, params.offset), batchConfig);
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Finds all lists that contain a specific record
|
|
367
|
+
*
|
|
368
|
+
* @param recordId - The ID of the record to find in lists
|
|
369
|
+
* @param objectType - Optional record type ('companies', 'people', etc.)
|
|
370
|
+
* @param includeEntryValues - Whether to include entry values in the result (default: false)
|
|
371
|
+
* @returns Array of list memberships
|
|
372
|
+
*/
|
|
373
|
+
/**
|
|
374
|
+
* Finds all lists that contain a specific record
|
|
375
|
+
*
|
|
376
|
+
* @param recordId - The ID of the record to find in lists
|
|
377
|
+
* @param objectType - Optional record type ('companies', 'people', etc.)
|
|
378
|
+
* @param includeEntryValues - Whether to include entry values in the result (default: false)
|
|
379
|
+
* @param batchSize - Number of lists to process in parallel (default: 5)
|
|
380
|
+
* @returns Array of list memberships
|
|
381
|
+
*
|
|
382
|
+
* @example
|
|
383
|
+
* // Find all lists containing a company record
|
|
384
|
+
* const memberships = await getRecordListMemberships('company-123', 'companies');
|
|
385
|
+
*
|
|
386
|
+
* // Find all lists containing a person record with entry values
|
|
387
|
+
* const membershipsWithValues = await getRecordListMemberships('person-456', 'people', true);
|
|
388
|
+
*/
|
|
389
|
+
export async function getRecordListMemberships(recordId, objectType, includeEntryValues = false, batchSize = 5) {
|
|
390
|
+
// Input validation
|
|
391
|
+
if (!recordId || typeof recordId !== 'string') {
|
|
392
|
+
throw new Error('Invalid record ID: Must be a non-empty string');
|
|
393
|
+
}
|
|
394
|
+
// Validate objectType if provided
|
|
395
|
+
if (objectType &&
|
|
396
|
+
!Object.values(ResourceType).includes(objectType)) {
|
|
397
|
+
const validTypes = Object.values(ResourceType).join(', ');
|
|
398
|
+
throw new Error(`Invalid object type: "${objectType}". Must be one of: ${validTypes}`);
|
|
399
|
+
}
|
|
400
|
+
// Validate batchSize
|
|
401
|
+
if (typeof batchSize !== 'number' || batchSize < 1 || batchSize > 20) {
|
|
402
|
+
throw new Error('Invalid batch size: Must be a number between 1 and 20');
|
|
403
|
+
}
|
|
404
|
+
const allMemberships = [];
|
|
405
|
+
try {
|
|
406
|
+
// First get all lists in the workspace
|
|
407
|
+
// If objectType is provided, filter lists by that object type
|
|
408
|
+
const lists = await getLists(objectType);
|
|
409
|
+
if (process.env.NODE_ENV === 'development') {
|
|
410
|
+
console.log(`[getRecordListMemberships] Found ${lists.length} ${objectType || ''} lists to check`);
|
|
411
|
+
}
|
|
412
|
+
// If no lists found, return empty array
|
|
413
|
+
if (!lists || lists.length === 0) {
|
|
414
|
+
return [];
|
|
415
|
+
}
|
|
416
|
+
// For each list, check entries in parallel using batch operation
|
|
417
|
+
const listConfigs = lists.map((list) => ({
|
|
418
|
+
listId: list.id?.list_id || (typeof list.id === 'string' ? list.id : ''),
|
|
419
|
+
// Use the list name from the list object for later reference
|
|
420
|
+
listName: list.name || list.title || 'Unnamed List',
|
|
421
|
+
// Set a higher limit to ensure we catch the record if it exists
|
|
422
|
+
limit: 100,
|
|
423
|
+
}));
|
|
424
|
+
// Process lists in batches to avoid overwhelming the API
|
|
425
|
+
// batchSize parameter allows customizing the concurrency level
|
|
426
|
+
for (let i = 0; i < listConfigs.length; i += batchSize) {
|
|
427
|
+
const batchLists = listConfigs.slice(i, i + batchSize);
|
|
428
|
+
if (process.env.NODE_ENV === 'development') {
|
|
429
|
+
console.log(`[getRecordListMemberships] Processing batch ${Math.floor(i / batchSize) + 1} (${batchLists.length} lists)`);
|
|
430
|
+
}
|
|
431
|
+
// For each list in the batch, get entries and check for record ID
|
|
432
|
+
const promises = batchLists.map(async (listConfig) => {
|
|
433
|
+
try {
|
|
434
|
+
// Get entries for this list
|
|
435
|
+
const entries = await getListEntries(listConfig.listId, listConfig.limit);
|
|
436
|
+
// Filter entries to find those matching the record ID
|
|
437
|
+
const matchingEntries = entries.filter((entry) => entry.record_id === recordId);
|
|
438
|
+
if (matchingEntries.length > 0) {
|
|
439
|
+
// Process matching entries into ListMembership format
|
|
440
|
+
matchingEntries.forEach((entry) => {
|
|
441
|
+
allMemberships.push({
|
|
442
|
+
listId: listConfig.listId,
|
|
443
|
+
listName: listConfig.listName,
|
|
444
|
+
entryId: entry.id?.entry_id || '',
|
|
445
|
+
// Include entry values if requested
|
|
446
|
+
...(includeEntryValues && {
|
|
447
|
+
entryValues: entry.values || {},
|
|
448
|
+
}),
|
|
449
|
+
});
|
|
450
|
+
});
|
|
451
|
+
if (process.env.NODE_ENV === 'development') {
|
|
452
|
+
console.log(`[getRecordListMemberships] Found ${matchingEntries.length} membership(s) in list "${listConfig.listName}"`);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
catch (error) {
|
|
457
|
+
// Log error but continue with other lists
|
|
458
|
+
if (process.env.NODE_ENV === 'development') {
|
|
459
|
+
console.error(`[getRecordListMemberships] Error getting entries for list ${listConfig.listId}: ${error.message || 'Unknown error'}`);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
});
|
|
463
|
+
// Wait for all promises in this batch to complete
|
|
464
|
+
await Promise.all(promises);
|
|
465
|
+
}
|
|
466
|
+
if (process.env.NODE_ENV === 'development') {
|
|
467
|
+
console.log(`[getRecordListMemberships] Total memberships found: ${allMemberships.length}`);
|
|
468
|
+
}
|
|
469
|
+
return allMemberships;
|
|
470
|
+
}
|
|
471
|
+
catch (error) {
|
|
472
|
+
// Log error for debugging
|
|
473
|
+
if (process.env.NODE_ENV === 'development') {
|
|
474
|
+
console.error(`[getRecordListMemberships] Error: ${error.message || 'Unknown error'}`);
|
|
475
|
+
}
|
|
476
|
+
throw error;
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* Filters list entries based on parent record properties using path-based filtering
|
|
481
|
+
*
|
|
482
|
+
* This function allows filtering list entries based on properties of their parent records,
|
|
483
|
+
* such as company name, email domain, or any other attribute of the parent record.
|
|
484
|
+
*
|
|
485
|
+
* @param listId - The ID of the list to filter entries from
|
|
486
|
+
* @param parentObjectType - The type of parent record (e.g., 'companies', 'people')
|
|
487
|
+
* @param parentAttributeSlug - The attribute of the parent record to filter by
|
|
488
|
+
* @param condition - The filter condition to apply
|
|
489
|
+
* @param value - The value to filter by
|
|
490
|
+
* @param limit - Maximum number of entries to fetch (default: 20)
|
|
491
|
+
* @param offset - Number of entries to skip (default: 0)
|
|
492
|
+
* @returns Array of filtered list entries
|
|
493
|
+
*
|
|
494
|
+
* @example
|
|
495
|
+
* // Get list entries for companies that have "Tech" in their industry
|
|
496
|
+
* const entries = await filterListEntriesByParent(
|
|
497
|
+
* 'list_12345',
|
|
498
|
+
* 'companies',
|
|
499
|
+
* 'industry',
|
|
500
|
+
* 'contains',
|
|
501
|
+
* 'Tech'
|
|
502
|
+
* );
|
|
503
|
+
*/
|
|
504
|
+
export async function filterListEntriesByParent(listId, parentObjectType, parentAttributeSlug, condition, value, limit = 20, offset = 0) {
|
|
505
|
+
// Input validation
|
|
506
|
+
if (!listId || typeof listId !== 'string') {
|
|
507
|
+
throw new Error('Invalid list ID: Must be a non-empty string');
|
|
508
|
+
}
|
|
509
|
+
if (!parentObjectType || typeof parentObjectType !== 'string') {
|
|
510
|
+
throw new Error('Invalid parent object type: Must be a non-empty string');
|
|
511
|
+
}
|
|
512
|
+
if (!parentAttributeSlug || typeof parentAttributeSlug !== 'string') {
|
|
513
|
+
throw new Error('Invalid parent attribute slug: Must be a non-empty string');
|
|
514
|
+
}
|
|
515
|
+
if (!condition || typeof condition !== 'string') {
|
|
516
|
+
throw new Error('Invalid condition: Must be a non-empty string');
|
|
517
|
+
}
|
|
518
|
+
// Use direct API interaction to perform path-based filtering
|
|
519
|
+
try {
|
|
520
|
+
// Get API client
|
|
521
|
+
const api = getAttioClient();
|
|
522
|
+
// Create path-based filter using our utility function
|
|
523
|
+
const { path, constraints } = createPathBasedFilter(listId, parentObjectType, parentAttributeSlug, condition, value);
|
|
524
|
+
// Construct the request payload
|
|
525
|
+
const payload = {
|
|
526
|
+
limit: limit,
|
|
527
|
+
offset: offset,
|
|
528
|
+
expand: ['record'],
|
|
529
|
+
path,
|
|
530
|
+
constraints,
|
|
531
|
+
};
|
|
532
|
+
if (process.env.NODE_ENV === 'development') {
|
|
533
|
+
console.log(`[filterListEntriesByParent] Filtering list ${listId} with path-based filter:`);
|
|
534
|
+
console.log(`- Parent Object Type: ${parentObjectType}`);
|
|
535
|
+
console.log(`- Parent Attribute: ${parentAttributeSlug}`);
|
|
536
|
+
console.log(`- Condition: ${condition}`);
|
|
537
|
+
console.log(`- Value: ${JSON.stringify(value)}`);
|
|
538
|
+
console.log(`- Request payload: ${JSON.stringify(payload)}`);
|
|
539
|
+
}
|
|
540
|
+
// Create API URL endpoint
|
|
541
|
+
const endpoint = `/lists/${listId}/entries/query`;
|
|
542
|
+
// Make the API request
|
|
543
|
+
const response = await api.post(endpoint, payload);
|
|
544
|
+
// Process the entries to ensure record_id is properly set
|
|
545
|
+
const entries = processListEntries(response.data.data || []);
|
|
546
|
+
if (process.env.NODE_ENV === 'development') {
|
|
547
|
+
console.log(`[filterListEntriesByParent] Found ${entries.length} matching entries`);
|
|
548
|
+
}
|
|
549
|
+
return entries;
|
|
550
|
+
}
|
|
551
|
+
catch (error) {
|
|
552
|
+
// Enhanced error logging
|
|
553
|
+
if (process.env.NODE_ENV === 'development') {
|
|
554
|
+
console.error(`[filterListEntriesByParent] Error filtering list entries: ${error.message || 'Unknown error'}`);
|
|
555
|
+
if (error.response) {
|
|
556
|
+
console.error('Status:', error.response.status);
|
|
557
|
+
console.error('Response data:', JSON.stringify(error.response.data || {}));
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
// Add context to error message
|
|
561
|
+
if (error.response?.status === 400) {
|
|
562
|
+
throw new Error(`Invalid filter parameters: ${error.message || 'Bad request'}`);
|
|
563
|
+
}
|
|
564
|
+
else if (error.response?.status === 404) {
|
|
565
|
+
throw new Error(`List ${listId} not found`);
|
|
566
|
+
}
|
|
567
|
+
throw error;
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* Filters list entries by parent record ID
|
|
572
|
+
*
|
|
573
|
+
* This is a specialized version of filterListEntriesByParent that specifically
|
|
574
|
+
* filters by the record ID of the parent record, which is a common use case.
|
|
575
|
+
*
|
|
576
|
+
* @param listId - The ID of the list to filter entries from
|
|
577
|
+
* @param recordId - The ID of the parent record to filter by
|
|
578
|
+
* @param limit - Maximum number of entries to fetch (default: 20)
|
|
579
|
+
* @param offset - Number of entries to skip (default: 0)
|
|
580
|
+
* @returns Array of filtered list entries
|
|
581
|
+
*/
|
|
582
|
+
export async function filterListEntriesByParentId(listId, recordId, limit = 20, offset = 0) {
|
|
583
|
+
return filterListEntriesByParent(listId, 'record', // This is a special case that will use just the parent_record path
|
|
584
|
+
'record_id', 'equals', recordId, limit, offset);
|
|
585
|
+
}
|
|
586
|
+
//# sourceMappingURL=lists.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lists.js","sourceRoot":"","sources":["../../src/objects/lists.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EACL,WAAW,IAAI,eAAe,EAC9B,cAAc,IAAI,qBAAqB,EACvC,cAAc,IAAI,qBAAqB,EACvC,eAAe,IAAI,sBAAsB,EACzC,oBAAoB,IAAI,2BAA2B,EACnD,eAAe,IAAI,sBAAsB,EAGzC,sBAAsB,GAGvB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAA6B,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EACL,kBAAkB,EAClB,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAYlC;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,UAAmB,E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AQ,EAAE,MAAM,KAAK,GAAG,EAAE,CAAC;YACnC,MAAM,IAAI,KAAK,CACb,8BAA8B,KAAK,CAAC,OAAO,IAAI,aAAa,EAAE,CAC/D,CAAC;QACJ,CAAC;aAAM,IAAI,KAAK,CAAC,QAAQ,EAAE,MAAM,KAAK,GAAG,EAAE,CAAC;YAC1C,MAAM,IAAI,KAAK,CAAC,QAAQ,MAAM,YAAY,CAAC,CAAC;QAC9C,CAAC;QAED,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC/C,MAAc,EACd,QAAgB,EAChB,QAAgB,EAAE,EAClB,SAAiB,CAAC;IAElB,OAAO,yBAAyB,CAC9B,MAAM,EACN,QAAQ,EAAE,mEAAmE;IAC7E,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,MAAM,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { DateRange, InteractionType, ActivityFilter, Person } from '../types/attio.js';
|
|
2
|
+
import { ListEntryFilters } from '../api/operations/index.js';
|
|
3
|
+
import { PaginatedResponse } from '../utils/pagination.js';
|
|
4
|
+
/**
|
|
5
|
+
* Advanced search for people with built-in pagination
|
|
6
|
+
*
|
|
7
|
+
* @param filters - Filter configuration
|
|
8
|
+
* @param page - Page number to return (default: 1)
|
|
9
|
+
* @param pageSize - Number of results per page (default: 20)
|
|
10
|
+
* @returns Paginated response with matching people
|
|
11
|
+
*/
|
|
12
|
+
export declare function paginatedSearchPeople(filters: ListEntryFilters, page?: number, pageSize?: number): Promise<PaginatedResponse<Person>>;
|
|
13
|
+
/**
|
|
14
|
+
* Search for people by creation date with pagination
|
|
15
|
+
*
|
|
16
|
+
* @param dateRange - Date range to filter by (when people were created)
|
|
17
|
+
* @param page - Page number to return (default: 1)
|
|
18
|
+
* @param pageSize - Number of results per page (default: 20)
|
|
19
|
+
* @returns Paginated response with matching people
|
|
20
|
+
*/
|
|
21
|
+
export declare function paginatedSearchPeopleByCreationDate(dateRange: DateRange | string | any, page?: number | string, pageSize?: number | string): Promise<PaginatedResponse<Person>>;
|
|
22
|
+
/**
|
|
23
|
+
* Search for people by modification date with pagination
|
|
24
|
+
*
|
|
25
|
+
* @param dateRange - Date range to filter by (when people were last modified)
|
|
26
|
+
* @param page - Page number to return (default: 1)
|
|
27
|
+
* @param pageSize - Number of results per page (default: 20)
|
|
28
|
+
* @returns Paginated response with matching people
|
|
29
|
+
*/
|
|
30
|
+
export declare function paginatedSearchPeopleByModificationDate(dateRange: DateRange | string | any, page?: number | string, pageSize?: number | string): Promise<PaginatedResponse<Person>>;
|
|
31
|
+
/**
|
|
32
|
+
* Search for people by last interaction with pagination
|
|
33
|
+
*
|
|
34
|
+
* @param dateRange - Date range to filter by (when the last interaction occurred)
|
|
35
|
+
* @param interactionType - Optional type of interaction to filter by
|
|
36
|
+
* @param page - Page number to return (default: 1)
|
|
37
|
+
* @param pageSize - Number of results per page (default: 20)
|
|
38
|
+
* @returns Paginated response with matching people
|
|
39
|
+
*/
|
|
40
|
+
export declare function paginatedSearchPeopleByLastInteraction(dateRange: DateRange | string | any, interactionType?: InteractionType | string, page?: number | string, pageSize?: number | string): Promise<PaginatedResponse<Person>>;
|
|
41
|
+
/**
|
|
42
|
+
* Search for people by activity with pagination
|
|
43
|
+
*
|
|
44
|
+
* @param activityFilter - Activity filter configuration
|
|
45
|
+
* @param page - Page number to return (default: 1)
|
|
46
|
+
* @param pageSize - Number of results per page (default: 20)
|
|
47
|
+
* @returns Paginated response with matching people
|
|
48
|
+
*/
|
|
49
|
+
export declare function paginatedSearchPeopleByActivity(activityFilter: ActivityFilter | string | any, page?: number | string, pageSize?: number | string): Promise<PaginatedResponse<Person>>;
|
|
50
|
+
//# sourceMappingURL=paginated-people.d.ts.map
|