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,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for working with Attio records and responses
|
|
3
|
+
* Provides functions for processing list entries, extracting record information,
|
|
4
|
+
* and interacting with the Attio API.
|
|
5
|
+
*/
|
|
6
|
+
import { AttioListEntry } from '../types/attio.js';
|
|
7
|
+
import { transformFiltersToApiFormat, createDateRangeFilter, createCreatedDateFilter, createModifiedDateFilter, createLastInteractionFilter, createActivityFilter, createNumericFilter } from './filters/index.js';
|
|
8
|
+
export { transformFiltersToApiFormat, createDateRangeFilter, createCreatedDateFilter, createModifiedDateFilter, createLastInteractionFilter, createActivityFilter, createNumericFilter, };
|
|
9
|
+
export declare const API_PARAMS: {
|
|
10
|
+
EXPAND: string;
|
|
11
|
+
RECORD: string;
|
|
12
|
+
LIMIT: string;
|
|
13
|
+
OFFSET: string;
|
|
14
|
+
LIST_ID: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const ATTRIBUTE_SLUGS: {
|
|
17
|
+
CREATED_AT: string;
|
|
18
|
+
UPDATED_AT: string;
|
|
19
|
+
LAST_INTERACTION: string;
|
|
20
|
+
INTERACTION_TYPE: string;
|
|
21
|
+
EMAIL: string;
|
|
22
|
+
PHONE: string;
|
|
23
|
+
NAME: string;
|
|
24
|
+
WEBSITE: string;
|
|
25
|
+
INDUSTRY: string;
|
|
26
|
+
REVENUE: string;
|
|
27
|
+
EMPLOYEE_COUNT: string;
|
|
28
|
+
LIST_ID: string;
|
|
29
|
+
NOTE_CONTENT: string;
|
|
30
|
+
RELATIONSHIP: string;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Extracts and ensures record_id is properly populated in list entries
|
|
34
|
+
*
|
|
35
|
+
* @param entries - Raw list entries from API response
|
|
36
|
+
* @returns Processed list entries with record_id correctly populated
|
|
37
|
+
*/
|
|
38
|
+
export declare function processListEntries(entries: AttioListEntry[]): AttioListEntry[];
|
|
39
|
+
/**
|
|
40
|
+
* Safely extracts record name and type from a list entry if available
|
|
41
|
+
*
|
|
42
|
+
* @param entry - List entry that may contain record data
|
|
43
|
+
* @returns An object with record name and type or empty values if not available
|
|
44
|
+
*/
|
|
45
|
+
export declare function getRecordNameFromEntry(entry: AttioListEntry): {
|
|
46
|
+
name: string;
|
|
47
|
+
type: string;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Creates a path-based filter for filtering list entries by parent record properties
|
|
51
|
+
*
|
|
52
|
+
* This function constructs a filter that follows paths through related objects,
|
|
53
|
+
* which is necessary for filtering list entries based on properties of their parent records.
|
|
54
|
+
*
|
|
55
|
+
* @param listSlug - The slug of the list (either the API slug or list ID)
|
|
56
|
+
* @param parentObjectType - The type of the parent record (e.g., 'companies', 'people')
|
|
57
|
+
* @param parentAttributeSlug - The attribute of the parent record to filter by
|
|
58
|
+
* @param condition - The filter condition to apply
|
|
59
|
+
* @param value - The value to filter by
|
|
60
|
+
* @returns A filter object compatible with the Attio API for path-based filtering
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* // Filter for companies in a list named "prospects" that have "Tech" in their industry
|
|
64
|
+
* const filter = createPathBasedFilter('prospects', 'companies', 'industry', 'contains', 'Tech');
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* // Filter for people in a list with ID "list_12345" who have an email from apple.com
|
|
68
|
+
* const filter = createPathBasedFilter('list_12345', 'people', 'email_addresses', 'contains', '@apple.com');
|
|
69
|
+
*/
|
|
70
|
+
export declare function createPathBasedFilter(listSlug: string, parentObjectType: string, parentAttributeSlug: string, condition: string, value: any): {
|
|
71
|
+
path: string[][];
|
|
72
|
+
constraints: Record<string, any>;
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=record-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-utils.d.ts","sourceRoot":"","sources":["../../src/utils/record-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACxB,2BAA2B,EAC3B,oBAAoB,EACpB,mBAAmB,EAGpB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACxB,2BAA2B,EAC3B,oBAAoB,EACpB,mBAAmB,GACpB,CAAC;AAGF,eAAO,MAAM,UAAU;;;;;;CAMtB,CAAC;AAGF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;CAAoB,CAAC;AAEjD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,cAAc,EAAE,GACxB,cAAc,EAAE,CA6JlB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,cAAc,GAAG;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CA8CA;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,EACxB,mBAAmB,EAAE,MAAM,EAC3B,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,GAAG,GACT;IAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAAE,CA+ExD"}
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
import { transformFiltersToApiFormat, createDateRangeFilter, createCreatedDateFilter, createModifiedDateFilter, createLastInteractionFilter, createActivityFilter, createNumericFilter, FILTER_ATTRIBUTES, } from './filters/index.js';
|
|
2
|
+
// Re-export filter utilities for backwards compatibility
|
|
3
|
+
export { transformFiltersToApiFormat, createDateRangeFilter, createCreatedDateFilter, createModifiedDateFilter, createLastInteractionFilter, createActivityFilter, createNumericFilter, };
|
|
4
|
+
// API parameter constants for better maintainability
|
|
5
|
+
export const API_PARAMS = {
|
|
6
|
+
EXPAND: 'expand',
|
|
7
|
+
RECORD: 'record',
|
|
8
|
+
LIMIT: 'limit',
|
|
9
|
+
OFFSET: 'offset',
|
|
10
|
+
LIST_ID: 'list_id',
|
|
11
|
+
};
|
|
12
|
+
// Re-export attribute slugs for backwards compatibility
|
|
13
|
+
export const ATTRIBUTE_SLUGS = FILTER_ATTRIBUTES;
|
|
14
|
+
/**
|
|
15
|
+
* Extracts and ensures record_id is properly populated in list entries
|
|
16
|
+
*
|
|
17
|
+
* @param entries - Raw list entries from API response
|
|
18
|
+
* @returns Processed list entries with record_id correctly populated
|
|
19
|
+
*/
|
|
20
|
+
export function processListEntries(entries) {
|
|
21
|
+
return entries.map((entry) => {
|
|
22
|
+
// Debug logging in development mode
|
|
23
|
+
if (process.env.NODE_ENV === 'development') {
|
|
24
|
+
console.log(`[processListEntries] Processing entry:`, {
|
|
25
|
+
entryId: entry.id?.entry_id || 'unknown',
|
|
26
|
+
hasRecordId: !!entry.record_id,
|
|
27
|
+
hasRecord: !!entry.record,
|
|
28
|
+
hasParentRecordId: !!entry.parent_record_id,
|
|
29
|
+
valueKeys: entry.values ? Object.keys(entry.values) : [],
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
// If record_id is already defined and non-empty, no processing needed
|
|
33
|
+
if (entry.record_id &&
|
|
34
|
+
typeof entry.record_id === 'string' &&
|
|
35
|
+
entry.record_id.trim() !== '') {
|
|
36
|
+
return entry;
|
|
37
|
+
}
|
|
38
|
+
// Enhanced record_id extraction from multiple possible locations
|
|
39
|
+
let recordId;
|
|
40
|
+
// Option 1: Direct parent_record_id property
|
|
41
|
+
if (entry.parent_record_id) {
|
|
42
|
+
recordId = entry.parent_record_id;
|
|
43
|
+
}
|
|
44
|
+
// Option 2: Nested in record object
|
|
45
|
+
else if (entry.record?.id?.record_id) {
|
|
46
|
+
recordId = entry.record.id.record_id;
|
|
47
|
+
}
|
|
48
|
+
// Option 3: Nested in values.record_id
|
|
49
|
+
else if (entry.values &&
|
|
50
|
+
typeof entry.values === 'object' &&
|
|
51
|
+
'record_id' in entry.values) {
|
|
52
|
+
const recordIdValue = entry.values.record_id;
|
|
53
|
+
if (Array.isArray(recordIdValue) && recordIdValue.length > 0) {
|
|
54
|
+
// Handle array of values with possible value property
|
|
55
|
+
if (recordIdValue[0].value) {
|
|
56
|
+
recordId = recordIdValue[0].value;
|
|
57
|
+
}
|
|
58
|
+
else if (typeof recordIdValue[0] === 'string') {
|
|
59
|
+
recordId = recordIdValue[0];
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
else if (typeof recordIdValue === 'string') {
|
|
63
|
+
recordId = recordIdValue;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
// Option 4: Nested in values.record
|
|
67
|
+
else if (entry.values &&
|
|
68
|
+
typeof entry.values === 'object' &&
|
|
69
|
+
'record' in entry.values) {
|
|
70
|
+
const valuesWithRecord = entry.values;
|
|
71
|
+
if (valuesWithRecord.record?.id?.record_id) {
|
|
72
|
+
recordId = valuesWithRecord.record.id.record_id;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// Option 5: Check for reference_id property
|
|
76
|
+
else if (entry.reference_id) {
|
|
77
|
+
recordId = entry.reference_id;
|
|
78
|
+
}
|
|
79
|
+
// Option 6: Check for object_id property
|
|
80
|
+
else if (entry.object_id) {
|
|
81
|
+
recordId = entry.object_id;
|
|
82
|
+
}
|
|
83
|
+
// Option 7: Search all properties for anything ending with _record_id
|
|
84
|
+
else {
|
|
85
|
+
const possibleKeys = Object.keys(entry);
|
|
86
|
+
for (const key of possibleKeys) {
|
|
87
|
+
if (key.endsWith('_record_id') &&
|
|
88
|
+
typeof entry[key] === 'string' &&
|
|
89
|
+
entry[key]) {
|
|
90
|
+
recordId = entry[key];
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
// Option 8: If record object exists, look for record.reference_id or record.record_id
|
|
96
|
+
if (!recordId && entry.record) {
|
|
97
|
+
if (entry.record.reference_id) {
|
|
98
|
+
recordId = entry.record.reference_id;
|
|
99
|
+
}
|
|
100
|
+
else if (entry.record.record_id) {
|
|
101
|
+
recordId = entry.record.record_id;
|
|
102
|
+
}
|
|
103
|
+
else if (entry.record.id) {
|
|
104
|
+
// Various id object patterns
|
|
105
|
+
const idObj = entry.record.id;
|
|
106
|
+
if (typeof idObj === 'string') {
|
|
107
|
+
recordId = idObj;
|
|
108
|
+
}
|
|
109
|
+
else if (idObj.record_id) {
|
|
110
|
+
recordId = idObj.record_id;
|
|
111
|
+
}
|
|
112
|
+
else if (idObj.id && typeof idObj.id === 'string') {
|
|
113
|
+
recordId = idObj.id;
|
|
114
|
+
}
|
|
115
|
+
else if (idObj.reference_id &&
|
|
116
|
+
typeof idObj.reference_id === 'string') {
|
|
117
|
+
recordId = idObj.reference_id;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
// If a record_id was found, return updated entry
|
|
122
|
+
if (recordId) {
|
|
123
|
+
if (process.env.NODE_ENV === 'development') {
|
|
124
|
+
console.log(`[processListEntries] Found record_id: ${recordId} for entry ${entry.id?.entry_id || 'unknown'}`);
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
...entry,
|
|
128
|
+
record_id: recordId,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
// Additional fallback: Check if record has a uri property
|
|
132
|
+
if (entry.record?.uri) {
|
|
133
|
+
const uriParts = entry.record.uri.split('/');
|
|
134
|
+
if (uriParts.length > 0) {
|
|
135
|
+
recordId = uriParts[uriParts.length - 1];
|
|
136
|
+
if (process.env.NODE_ENV === 'development') {
|
|
137
|
+
console.log(`[processListEntries] Extracted record_id ${recordId} from URI: ${entry.record.uri}`);
|
|
138
|
+
}
|
|
139
|
+
return {
|
|
140
|
+
...entry,
|
|
141
|
+
record_id: recordId,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
// Unable to find record_id, log warning and return entry unchanged
|
|
146
|
+
if (process.env.NODE_ENV === 'development') {
|
|
147
|
+
console.warn(`[processListEntries] Could not extract record_id for entry ${entry.id?.entry_id || 'unknown'}`);
|
|
148
|
+
}
|
|
149
|
+
// Return entry unchanged if no record_id found
|
|
150
|
+
return entry;
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Safely extracts record name and type from a list entry if available
|
|
155
|
+
*
|
|
156
|
+
* @param entry - List entry that may contain record data
|
|
157
|
+
* @returns An object with record name and type or empty values if not available
|
|
158
|
+
*/
|
|
159
|
+
export function getRecordNameFromEntry(entry) {
|
|
160
|
+
const defaultResult = { name: '', type: '' };
|
|
161
|
+
// If no record data is available, return default
|
|
162
|
+
if (!entry.record || !entry.record.values) {
|
|
163
|
+
return defaultResult;
|
|
164
|
+
}
|
|
165
|
+
// Try to determine the record type based on available fields
|
|
166
|
+
// Companies typically have industry or website fields, people typically have email or phone
|
|
167
|
+
const isPerson = 'email' in entry.record.values || 'phone' in entry.record.values;
|
|
168
|
+
const isCompany = 'industry' in entry.record.values || 'website' in entry.record.values;
|
|
169
|
+
// Set the record type based on detected fields
|
|
170
|
+
let recordType = '';
|
|
171
|
+
if (isPerson && !isCompany) {
|
|
172
|
+
recordType = 'Person';
|
|
173
|
+
}
|
|
174
|
+
else if (isCompany && !isPerson) {
|
|
175
|
+
recordType = 'Company';
|
|
176
|
+
}
|
|
177
|
+
else if (entry.record.object_slug) {
|
|
178
|
+
// If we have an object_slug, use it to determine type
|
|
179
|
+
recordType =
|
|
180
|
+
entry.record.object_slug === 'people'
|
|
181
|
+
? 'Person'
|
|
182
|
+
: entry.record.object_slug === 'companies'
|
|
183
|
+
? 'Company'
|
|
184
|
+
: '';
|
|
185
|
+
}
|
|
186
|
+
// Extract name from the record values
|
|
187
|
+
const nameValues = entry.record.values.name;
|
|
188
|
+
let recordName = '';
|
|
189
|
+
if (Array.isArray(nameValues) &&
|
|
190
|
+
nameValues.length > 0 &&
|
|
191
|
+
'value' in nameValues[0]) {
|
|
192
|
+
recordName = nameValues[0].value || '';
|
|
193
|
+
}
|
|
194
|
+
return {
|
|
195
|
+
name: recordName,
|
|
196
|
+
type: recordType,
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Creates a path-based filter for filtering list entries by parent record properties
|
|
201
|
+
*
|
|
202
|
+
* This function constructs a filter that follows paths through related objects,
|
|
203
|
+
* which is necessary for filtering list entries based on properties of their parent records.
|
|
204
|
+
*
|
|
205
|
+
* @param listSlug - The slug of the list (either the API slug or list ID)
|
|
206
|
+
* @param parentObjectType - The type of the parent record (e.g., 'companies', 'people')
|
|
207
|
+
* @param parentAttributeSlug - The attribute of the parent record to filter by
|
|
208
|
+
* @param condition - The filter condition to apply
|
|
209
|
+
* @param value - The value to filter by
|
|
210
|
+
* @returns A filter object compatible with the Attio API for path-based filtering
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* // Filter for companies in a list named "prospects" that have "Tech" in their industry
|
|
214
|
+
* const filter = createPathBasedFilter('prospects', 'companies', 'industry', 'contains', 'Tech');
|
|
215
|
+
*
|
|
216
|
+
* @example
|
|
217
|
+
* // Filter for people in a list with ID "list_12345" who have an email from apple.com
|
|
218
|
+
* const filter = createPathBasedFilter('list_12345', 'people', 'email_addresses', 'contains', '@apple.com');
|
|
219
|
+
*/
|
|
220
|
+
export function createPathBasedFilter(listSlug, parentObjectType, parentAttributeSlug, condition, value) {
|
|
221
|
+
// Create path array for drilling down through objects
|
|
222
|
+
// First path element is [listSlug, "parent_record"] to navigate from list entry to its parent record
|
|
223
|
+
// Second path element is [parentObjectType, parentAttributeSlug] to navigate to specific attribute
|
|
224
|
+
const path = [
|
|
225
|
+
[listSlug, 'parent_record'],
|
|
226
|
+
[parentObjectType, parentAttributeSlug],
|
|
227
|
+
];
|
|
228
|
+
// Create constraints object based on condition and value
|
|
229
|
+
let constraints = {};
|
|
230
|
+
// Handle different condition types appropriately
|
|
231
|
+
if (condition === 'equals' || condition === 'eq') {
|
|
232
|
+
// For exact equality on simple attributes
|
|
233
|
+
constraints = { value };
|
|
234
|
+
}
|
|
235
|
+
else if (condition === 'contains') {
|
|
236
|
+
// For partial text matching
|
|
237
|
+
constraints = { contains: value };
|
|
238
|
+
}
|
|
239
|
+
else if (condition === 'starts_with') {
|
|
240
|
+
constraints = { starts_with: value };
|
|
241
|
+
}
|
|
242
|
+
else if (condition === 'ends_with') {
|
|
243
|
+
constraints = { ends_with: value };
|
|
244
|
+
}
|
|
245
|
+
else if (condition === 'greater_than' || condition === 'gt') {
|
|
246
|
+
constraints = { gt: value };
|
|
247
|
+
}
|
|
248
|
+
else if (condition === 'less_than' || condition === 'lt') {
|
|
249
|
+
constraints = { lt: value };
|
|
250
|
+
}
|
|
251
|
+
else if (condition === 'greater_than_or_equals' || condition === 'gte') {
|
|
252
|
+
constraints = { gte: value };
|
|
253
|
+
}
|
|
254
|
+
else if (condition === 'less_than_or_equals' || condition === 'lte') {
|
|
255
|
+
constraints = { lte: value };
|
|
256
|
+
}
|
|
257
|
+
else if (condition === 'not_equals' || condition === 'ne') {
|
|
258
|
+
constraints = { ne: value };
|
|
259
|
+
}
|
|
260
|
+
else if (condition === 'is_empty' || condition === 'is_not_set') {
|
|
261
|
+
constraints = { is_empty: true };
|
|
262
|
+
}
|
|
263
|
+
else if (condition === 'is_not_empty' || condition === 'is_set') {
|
|
264
|
+
constraints = { is_not_empty: true };
|
|
265
|
+
}
|
|
266
|
+
else if (condition === 'in') {
|
|
267
|
+
constraints = { in: Array.isArray(value) ? value : [value] };
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
// Default to exact match if condition is unknown
|
|
271
|
+
constraints = { value };
|
|
272
|
+
}
|
|
273
|
+
// Special case for filtering by record ID
|
|
274
|
+
if (parentAttributeSlug === 'id' || parentAttributeSlug === 'record_id') {
|
|
275
|
+
return {
|
|
276
|
+
path: [[listSlug, 'parent_record']],
|
|
277
|
+
constraints: { record_id: value },
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
// For filtering by name, we need to use full_name property
|
|
281
|
+
if (parentAttributeSlug === 'name') {
|
|
282
|
+
if (condition === 'equals') {
|
|
283
|
+
constraints = { full_name: value };
|
|
284
|
+
}
|
|
285
|
+
else if (condition === 'contains') {
|
|
286
|
+
constraints = { full_name: { contains: value } };
|
|
287
|
+
}
|
|
288
|
+
else if (condition === 'starts_with') {
|
|
289
|
+
constraints = { full_name: { starts_with: value } };
|
|
290
|
+
}
|
|
291
|
+
else if (condition === 'ends_with') {
|
|
292
|
+
constraints = { full_name: { ends_with: value } };
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
// For email addresses, we need to use email_address property
|
|
296
|
+
if (parentAttributeSlug === 'email_addresses') {
|
|
297
|
+
if (condition === 'equals') {
|
|
298
|
+
constraints = { email_address: value };
|
|
299
|
+
}
|
|
300
|
+
else if (condition === 'contains') {
|
|
301
|
+
constraints = { email_address: { contains: value } };
|
|
302
|
+
}
|
|
303
|
+
else if (condition === 'starts_with') {
|
|
304
|
+
constraints = { email_address: { starts_with: value } };
|
|
305
|
+
}
|
|
306
|
+
else if (condition === 'ends_with') {
|
|
307
|
+
constraints = { email_address: { ends_with: value } };
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
return { path, constraints };
|
|
311
|
+
}
|
|
312
|
+
//# sourceMappingURL=record-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-utils.js","sourceRoot":"","sources":["../../src/utils/record-utils.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACxB,2BAA2B,EAC3B,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,GAElB,MAAM,oBAAoB,CAAC;AAE5B,yDAAyD;AACzD,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACxB,2BAA2B,EAC3B,oBAAoB,EACpB,mBAAmB,GACpB,CAAC;AAEF,qDAAqD;AACrD,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;CACnB,CAAC;AAEF,wDAAwD;AACxD,MAAM,CAAC,MAAM,eAAe,GAAG,iBAAiB,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAyB;IAEzB,OAAO,OAAO,CAAC,GAAG,CA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
|
2
|
+
* Relationship utility functions for working with related records in Attio
|
|
3
|
+
* Provides functions for creating filters based on relationships between records.
|
|
4
|
+
*/
|
|
5
|
+
import { ListEntryFilters } from '../api/operations/index.js';
|
|
6
|
+
import { ResourceType, RelationshipType } from '../types/attio.js';
|
|
7
|
+
export { RelationshipType };
|
|
8
|
+
/**
|
|
9
|
+
* Configuration for a relationship-based filter
|
|
10
|
+
*/
|
|
11
|
+
export interface RelationshipFilterConfig {
|
|
12
|
+
sourceType: ResourceType;
|
|
13
|
+
targetType: ResourceType;
|
|
14
|
+
relationshipType: RelationshipType;
|
|
15
|
+
targetFilters: ListEntryFilters;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Creates a filter for people based on their associated company attributes
|
|
19
|
+
*
|
|
20
|
+
* @param companyFilter - Filters to apply to the related companies
|
|
21
|
+
* @returns Filter for finding people based on company attributes
|
|
22
|
+
*/
|
|
23
|
+
export declare function createPeopleByCompanyFilter(companyFilter: ListEntryFilters): ListEntryFilters;
|
|
24
|
+
/**
|
|
25
|
+
* Creates a filter for companies based on their associated people attributes
|
|
26
|
+
*
|
|
27
|
+
* @param peopleFilter - Filters to apply to the related people
|
|
28
|
+
* @returns Filter for finding companies based on people attributes
|
|
29
|
+
*/
|
|
30
|
+
export declare function createCompaniesByPeopleFilter(peopleFilter: ListEntryFilters): ListEntryFilters;
|
|
31
|
+
/**
|
|
32
|
+
* Creates a filter for records that belong to a specific list
|
|
33
|
+
*
|
|
34
|
+
* @param resourceType - The type of records to filter (people or companies)
|
|
35
|
+
* @param listId - The ID of the list to filter by
|
|
36
|
+
* @returns Filter for finding records that belong to the list
|
|
37
|
+
*/
|
|
38
|
+
export declare function createRecordsByListFilter(resourceType: ResourceType, listId: string): ListEntryFilters;
|
|
39
|
+
/**
|
|
40
|
+
* Creates a filter for finding people who work at companies in a specific list
|
|
41
|
+
*
|
|
42
|
+
* @param listId - The ID of the list that contains companies
|
|
43
|
+
* @returns Filter for finding people who work at companies in the specified list
|
|
44
|
+
*/
|
|
45
|
+
export declare function createPeopleByCompanyListFilter(listId: string): ListEntryFilters;
|
|
46
|
+
/**
|
|
47
|
+
* Creates a filter for finding companies that have people in a specific list
|
|
48
|
+
*
|
|
49
|
+
* @param listId - The ID of the list that contains people
|
|
50
|
+
* @returns Filter for finding companies that have people in the specified list
|
|
51
|
+
*/
|
|
52
|
+
export declare function createCompaniesByPeopleListFilter(listId: string): ListEntryFilters;
|
|
53
|
+
/**
|
|
54
|
+
* Creates a filter for records that have associated notes matching criteria
|
|
55
|
+
*
|
|
56
|
+
* @param resourceType - The type of records to filter (people or companies)
|
|
57
|
+
* @param textSearch - Text to search for in the notes
|
|
58
|
+
* @returns Filter for finding records with matching notes
|
|
59
|
+
*/
|
|
60
|
+
export declare function createRecordsByNotesFilter(resourceType: ResourceType, textSearch: string): ListEntryFilters;
|
|
61
|
+
//# sourceMappingURL=relationship-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relationship-utils.d.ts","sourceRoot":"","sources":["../../src/utils/relationship-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAmB,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EACL,YAAY,EAEZ,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAS5B;;GAEG;AACH,MAAM,WAAW,wBAAwB;IAEvC,UAAU,EAAE,YAAY,CAAC;IAGzB,UAAU,EAAE,YAAY,CAAC;IAGzB,gBAAgB,EAAE,gBAAgB,CAAC;IAGnC,aAAa,EAAE,gBAAgB,CAAC;CACjC;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,aAAa,EAAE,gBAAgB,GAC9B,gBAAgB,CAsClB;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,YAAY,EAAE,gBAAgB,GAC7B,gBAAgB,CAsClB;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,MAAM,GACb,gBAAgB,CAoClB;AAED;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,MAAM,GACb,gBAAgB,CAuBlB;AAED;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,MAAM,GACb,gBAAgB,CAuBlB;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,MAAM,GACjB,gBAAgB,CA+BlB"}
|