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,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Central export point for all filter-related functionality
|
|
3
|
+
* Maintains backward compatibility while providing organized module structure
|
|
4
|
+
*/
|
|
5
|
+
// Export all types
|
|
6
|
+
export * from './types.js';
|
|
7
|
+
// Export all validators
|
|
8
|
+
export * from './validators.js';
|
|
9
|
+
// Export all builders
|
|
10
|
+
export * from './builders.js';
|
|
11
|
+
// Export all translators
|
|
12
|
+
export * from './translators.js';
|
|
13
|
+
// Export all operators
|
|
14
|
+
export * from './operators.js';
|
|
15
|
+
// Export all utilities
|
|
16
|
+
export * from './utils.js';
|
|
17
|
+
// Export cache utilities
|
|
18
|
+
export * from './cache.js';
|
|
19
|
+
// Export relationship utilities
|
|
20
|
+
export * from './relationship.js';
|
|
21
|
+
// Re-export namespaced Basic utilities for backward compatibility
|
|
22
|
+
import { transformFiltersToApiFormat } from './translators.js';
|
|
23
|
+
import { validateFilterStructure } from './validators.js';
|
|
24
|
+
import { createEqualsFilter, createContainsFilter, combineWithAnd, combineWithOr, } from './builders.js';
|
|
25
|
+
export const Basic = {
|
|
26
|
+
validateFilterStructure,
|
|
27
|
+
transformFiltersToApiFormat,
|
|
28
|
+
createEqualsFilter,
|
|
29
|
+
createContainsFilter,
|
|
30
|
+
combineWithAnd,
|
|
31
|
+
combineWithOr,
|
|
32
|
+
};
|
|
33
|
+
// Re-export namespaced Range utilities for backward compatibility
|
|
34
|
+
import { createDateRangeFilter, createCreatedDateFilter, createModifiedDateFilter, createNumericFilter, createRevenueFilter, createEmployeeCountFilter, } from './builders.js';
|
|
35
|
+
export const Range = {
|
|
36
|
+
createDateRangeFilter,
|
|
37
|
+
createCreatedDateFilter,
|
|
38
|
+
createModifiedDateFilter,
|
|
39
|
+
createNumericFilter,
|
|
40
|
+
createRevenueFilter,
|
|
41
|
+
createEmployeeCountFilter,
|
|
42
|
+
};
|
|
43
|
+
// Re-export namespaced Activity utilities for backward compatibility
|
|
44
|
+
import { createActivityFilter, createLastInteractionFilter, } from './builders.js';
|
|
45
|
+
export const Activity = {
|
|
46
|
+
createActivityFilter,
|
|
47
|
+
createLastInteractionFilter,
|
|
48
|
+
};
|
|
49
|
+
// Re-export namespaced Relationship utilities for backward compatibility
|
|
50
|
+
import { applyRateLimit, createPeopleByCompanyFilter, createCompaniesByPeopleFilter, createRecordsByListFilter, createPeopleByCompanyListFilter, createCompaniesByPeopleListFilter, createRecordsByNotesFilter, } from './relationship.js';
|
|
51
|
+
export const Relationship = {
|
|
52
|
+
applyRateLimit,
|
|
53
|
+
createPeopleByCompanyFilter,
|
|
54
|
+
createCompaniesByPeopleFilter,
|
|
55
|
+
createRecordsByListFilter,
|
|
56
|
+
createPeopleByCompanyListFilter,
|
|
57
|
+
createCompaniesByPeopleListFilter,
|
|
58
|
+
createRecordsByNotesFilter,
|
|
59
|
+
};
|
|
60
|
+
// Legacy exports for backward compatibility
|
|
61
|
+
import { combineFiltersWithAnd, combineFiltersWithOr } from './builders.js';
|
|
62
|
+
export { transformFiltersToApiFormat, createEqualsFilter, createContainsFilter, combineFiltersWithAnd, combineFiltersWithOr, createDateRangeFilter, createCreatedDateFilter, createModifiedDateFilter, createNumericFilter, createRevenueFilter, createEmployeeCountFilter, createLastInteractionFilter, createActivityFilter,
|
|
63
|
+
// Relationship filters
|
|
64
|
+
createPeopleByCompanyFilter, createCompaniesByPeopleFilter, createRecordsByListFilter, createPeopleByCompanyListFilter, createCompaniesByPeopleListFilter, createRecordsByNotesFilter, };
|
|
65
|
+
// Re-export ATTRIBUTES as FILTER_ATTRIBUTES for backward compatibility
|
|
66
|
+
export { ATTRIBUTES as FILTER_ATTRIBUTES } from './types.js';
|
|
67
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/filters/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,mBAAmB;AACnB,cAAc,YAAY,CAAC;AAE3B,wBAAwB;AACxB,cAAc,iBAAiB,CAAC;AAEhC,sBAAsB;AACtB,cAAc,eAAe,CAAC;AAE9B,yBAAyB;AACzB,cAAc,kBAAkB,CAAC;AAEjC,uBAAuB;AACvB,cAAc,gBAAgB,CAAC;AAE/B,uBAAuB;AACvB,cAAc,YAAY,CAAC;AAE3B,yBAAyB;AACzB,cAAc,YAAY,CAAC;AAE3B,gCAAgC;AAChC,cAAc,mBAAmB,CAAC;AAElC,kEAAkE;AAClE,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EAC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,6BAA6B,EAC7B,yBAAyB,EACzB,+BAA+B,EAC/B,iCAAiC,EACjC,0BAA0B,GAC3B,CAAC;AAEF,uEAAuE;AACvE,OAAO,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filter operator implementations and utilities
|
|
3
|
+
* Provides functionality for working with logical and comparison operators
|
|
4
|
+
*/
|
|
5
|
+
import { ListEntryFilters, FilterConditionType } from './types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Checks if an operator is supported for a specific field
|
|
8
|
+
*
|
|
9
|
+
* @param fieldSlug - The field slug to check
|
|
10
|
+
* @param operator - The operator to validate
|
|
11
|
+
* @returns True if the operator is supported for the field
|
|
12
|
+
*/
|
|
13
|
+
export declare function isOperatorSupportedForField(fieldSlug: string, operator: string): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Maps a generic operator to a field-specific operator
|
|
16
|
+
*
|
|
17
|
+
* @param fieldSlug - The field slug
|
|
18
|
+
* @param operator - The generic operator
|
|
19
|
+
* @returns The mapped operator for the specific field
|
|
20
|
+
*/
|
|
21
|
+
export declare function mapOperatorForField(fieldSlug: string, operator: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Inverts a filter condition (returns the opposite condition)
|
|
24
|
+
*
|
|
25
|
+
* @param condition - The condition to invert
|
|
26
|
+
* @returns The inverted condition
|
|
27
|
+
*/
|
|
28
|
+
export declare function invertCondition(condition: FilterConditionType): FilterConditionType;
|
|
29
|
+
/**
|
|
30
|
+
* Creates a NOT filter by inverting all conditions in the given filters
|
|
31
|
+
*
|
|
32
|
+
* @param filters - The filters to negate
|
|
33
|
+
* @returns Negated filter set
|
|
34
|
+
*/
|
|
35
|
+
export declare function createNotFilter(filters: ListEntryFilters): ListEntryFilters;
|
|
36
|
+
/**
|
|
37
|
+
* Checks if a condition requires a value
|
|
38
|
+
*
|
|
39
|
+
* @param condition - The condition to check
|
|
40
|
+
* @returns True if the condition requires a value
|
|
41
|
+
*/
|
|
42
|
+
export declare function conditionRequiresValue(condition: FilterConditionType): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Gets the comparison type for a filter condition
|
|
45
|
+
*
|
|
46
|
+
* @param condition - The filter condition
|
|
47
|
+
* @returns The comparison type (equality, range, text, etc.)
|
|
48
|
+
*/
|
|
49
|
+
export declare function getComparisonType(condition: FilterConditionType): string;
|
|
50
|
+
/**
|
|
51
|
+
* Determines if two filter conditions are compatible for combination
|
|
52
|
+
*
|
|
53
|
+
* @param condition1 - First condition
|
|
54
|
+
* @param condition2 - Second condition
|
|
55
|
+
* @returns True if conditions can be combined
|
|
56
|
+
*/
|
|
57
|
+
export declare function areConditionsCompatible(condition1: FilterConditionType, condition2: FilterConditionType): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Simplifies a filter by combining compatible conditions
|
|
60
|
+
*
|
|
61
|
+
* @param filters - The filters to simplify
|
|
62
|
+
* @returns Simplified filter set
|
|
63
|
+
*/
|
|
64
|
+
export declare function simplifyFilters(filters: ListEntryFilters): ListEntryFilters;
|
|
65
|
+
//# sourceMappingURL=operators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operators.d.ts","sourceRoot":"","sources":["../../../src/utils/filters/operators.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,gBAAgB,EAEhB,mBAAmB,EAEpB,MAAM,YAAY,CAAC;AAEpB;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GACf,OAAO,CAUT;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GACf,MAAM,CASR;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,mBAAmB,GAC7B,mBAAmB,CAiBrB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,gBAAgB,CAc3E;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,mBAAmB,GAC7B,OAAO,CAST;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,mBAAmB,GAAG,MAAM,CAiCxE;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,mBAAmB,EAC/B,UAAU,EAAE,mBAAmB,GAC9B,OAAO,CAeT;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,gBAAgB,CA6D3E"}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filter operator implementations and utilities
|
|
3
|
+
* Provides functionality for working with logical and comparison operators
|
|
4
|
+
*/
|
|
5
|
+
import { FilterConditionType, FIELD_SPECIAL_HANDLING, } from './types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Checks if an operator is supported for a specific field
|
|
8
|
+
*
|
|
9
|
+
* @param fieldSlug - The field slug to check
|
|
10
|
+
* @param operator - The operator to validate
|
|
11
|
+
* @returns True if the operator is supported for the field
|
|
12
|
+
*/
|
|
13
|
+
export function isOperatorSupportedForField(fieldSlug, operator) {
|
|
14
|
+
const specialHandling = FIELD_SPECIAL_HANDLING[fieldSlug];
|
|
15
|
+
if (!specialHandling || !specialHandling.operators) {
|
|
16
|
+
// No special handling defined, assume all operators are supported
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
// Check if the operator is in the allowed list
|
|
20
|
+
return specialHandling.operators.includes(operator);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Maps a generic operator to a field-specific operator
|
|
24
|
+
*
|
|
25
|
+
* @param fieldSlug - The field slug
|
|
26
|
+
* @param operator - The generic operator
|
|
27
|
+
* @returns The mapped operator for the specific field
|
|
28
|
+
*/
|
|
29
|
+
export function mapOperatorForField(fieldSlug, operator) {
|
|
30
|
+
const specialHandling = FIELD_SPECIAL_HANDLING[fieldSlug];
|
|
31
|
+
if (!specialHandling) {
|
|
32
|
+
return operator;
|
|
33
|
+
}
|
|
34
|
+
// Check if there's a mapping for this operator
|
|
35
|
+
return specialHandling[operator] || operator;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Inverts a filter condition (returns the opposite condition)
|
|
39
|
+
*
|
|
40
|
+
* @param condition - The condition to invert
|
|
41
|
+
* @returns The inverted condition
|
|
42
|
+
*/
|
|
43
|
+
export function invertCondition(condition) {
|
|
44
|
+
const inversionMap = {
|
|
45
|
+
[FilterConditionType.EQUALS]: FilterConditionType.NOT_EQUALS,
|
|
46
|
+
[FilterConditionType.NOT_EQUALS]: FilterConditionType.EQUALS,
|
|
47
|
+
[FilterConditionType.CONTAINS]: FilterConditionType.NOT_CONTAINS,
|
|
48
|
+
[FilterConditionType.NOT_CONTAINS]: FilterConditionType.CONTAINS,
|
|
49
|
+
[FilterConditionType.GREATER_THAN]: FilterConditionType.LESS_THAN_OR_EQUALS,
|
|
50
|
+
[FilterConditionType.GREATER_THAN_OR_EQUALS]: FilterConditionType.LESS_THAN,
|
|
51
|
+
[FilterConditionType.LESS_THAN]: FilterConditionType.GREATER_THAN_OR_EQUALS,
|
|
52
|
+
[FilterConditionType.LESS_THAN_OR_EQUALS]: FilterConditionType.GREATER_THAN,
|
|
53
|
+
[FilterConditionType.IS_EMPTY]: FilterConditionType.IS_NOT_EMPTY,
|
|
54
|
+
[FilterConditionType.IS_NOT_EMPTY]: FilterConditionType.IS_EMPTY,
|
|
55
|
+
};
|
|
56
|
+
return inversionMap[condition] || condition;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Creates a NOT filter by inverting all conditions in the given filters
|
|
60
|
+
*
|
|
61
|
+
* @param filters - The filters to negate
|
|
62
|
+
* @returns Negated filter set
|
|
63
|
+
*/
|
|
64
|
+
export function createNotFilter(filters) {
|
|
65
|
+
const negatedFilters = (filters.filters &&
|
|
66
|
+
filters.filters.map((filter) => ({
|
|
67
|
+
...filter,
|
|
68
|
+
condition: invertCondition(filter.condition),
|
|
69
|
+
}))) ||
|
|
70
|
+
[];
|
|
71
|
+
return {
|
|
72
|
+
filters: negatedFilters,
|
|
73
|
+
// Invert the matchAny logic as well
|
|
74
|
+
matchAny: !filters.matchAny,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Checks if a condition requires a value
|
|
79
|
+
*
|
|
80
|
+
* @param condition - The condition to check
|
|
81
|
+
* @returns True if the condition requires a value
|
|
82
|
+
*/
|
|
83
|
+
export function conditionRequiresValue(condition) {
|
|
84
|
+
const noValueConditions = [
|
|
85
|
+
FilterConditionType.IS_EMPTY,
|
|
86
|
+
FilterConditionType.IS_NOT_EMPTY,
|
|
87
|
+
FilterConditionType.IS_SET,
|
|
88
|
+
FilterConditionType.IS_NOT_SET,
|
|
89
|
+
];
|
|
90
|
+
return !noValueConditions.includes(condition);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Gets the comparison type for a filter condition
|
|
94
|
+
*
|
|
95
|
+
* @param condition - The filter condition
|
|
96
|
+
* @returns The comparison type (equality, range, text, etc.)
|
|
97
|
+
*/
|
|
98
|
+
export function getComparisonType(condition) {
|
|
99
|
+
const equalityConditions = [
|
|
100
|
+
FilterConditionType.EQUALS,
|
|
101
|
+
FilterConditionType.NOT_EQUALS,
|
|
102
|
+
];
|
|
103
|
+
const rangeConditions = [
|
|
104
|
+
FilterConditionType.GREATER_THAN,
|
|
105
|
+
FilterConditionType.GREATER_THAN_OR_EQUALS,
|
|
106
|
+
FilterConditionType.LESS_THAN,
|
|
107
|
+
FilterConditionType.LESS_THAN_OR_EQUALS,
|
|
108
|
+
];
|
|
109
|
+
const textConditions = [
|
|
110
|
+
FilterConditionType.CONTAINS,
|
|
111
|
+
FilterConditionType.NOT_CONTAINS,
|
|
112
|
+
FilterConditionType.STARTS_WITH,
|
|
113
|
+
FilterConditionType.ENDS_WITH,
|
|
114
|
+
];
|
|
115
|
+
const existenceConditions = [
|
|
116
|
+
FilterConditionType.IS_EMPTY,
|
|
117
|
+
FilterConditionType.IS_NOT_EMPTY,
|
|
118
|
+
FilterConditionType.IS_SET,
|
|
119
|
+
FilterConditionType.IS_NOT_SET,
|
|
120
|
+
];
|
|
121
|
+
if (equalityConditions.includes(condition))
|
|
122
|
+
return 'equality';
|
|
123
|
+
if (rangeConditions.includes(condition))
|
|
124
|
+
return 'range';
|
|
125
|
+
if (textConditions.includes(condition))
|
|
126
|
+
return 'text';
|
|
127
|
+
if (existenceConditions.includes(condition))
|
|
128
|
+
return 'existence';
|
|
129
|
+
return 'unknown';
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Determines if two filter conditions are compatible for combination
|
|
133
|
+
*
|
|
134
|
+
* @param condition1 - First condition
|
|
135
|
+
* @param condition2 - Second condition
|
|
136
|
+
* @returns True if conditions can be combined
|
|
137
|
+
*/
|
|
138
|
+
export function areConditionsCompatible(condition1, condition2) {
|
|
139
|
+
const type1 = getComparisonType(condition1);
|
|
140
|
+
const type2 = getComparisonType(condition2);
|
|
141
|
+
// Same types are generally compatible
|
|
142
|
+
if (type1 === type2)
|
|
143
|
+
return true;
|
|
144
|
+
// Range conditions can be combined (e.g., greater than AND less than)
|
|
145
|
+
if (type1 === 'range' && type2 === 'range')
|
|
146
|
+
return true;
|
|
147
|
+
// Existence conditions cannot be combined with value conditions
|
|
148
|
+
if (type1 === 'existence' || type2 === 'existence')
|
|
149
|
+
return false;
|
|
150
|
+
// Default to incompatible
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Simplifies a filter by combining compatible conditions
|
|
155
|
+
*
|
|
156
|
+
* @param filters - The filters to simplify
|
|
157
|
+
* @returns Simplified filter set
|
|
158
|
+
*/
|
|
159
|
+
export function simplifyFilters(filters) {
|
|
160
|
+
const simplifiedFilters = [];
|
|
161
|
+
const filterMap = new Map();
|
|
162
|
+
// Group filters by attribute
|
|
163
|
+
filters.filters &&
|
|
164
|
+
filters.filters.forEach((filter) => {
|
|
165
|
+
const key = filter.attribute.slug;
|
|
166
|
+
if (!filterMap.has(key)) {
|
|
167
|
+
filterMap.set(key, []);
|
|
168
|
+
}
|
|
169
|
+
filterMap.get(key).push(filter);
|
|
170
|
+
});
|
|
171
|
+
// Simplify each group
|
|
172
|
+
filterMap.forEach((filterGroup, _attribute) => {
|
|
173
|
+
if (filterGroup.length === 1) {
|
|
174
|
+
// Single filter, no simplification needed
|
|
175
|
+
simplifiedFilters.push(...filterGroup);
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
// Multiple filters for same attribute, check if they can be combined
|
|
179
|
+
const rangeFilters = filterGroup.filter((f) => getComparisonType(f.condition) === 'range');
|
|
180
|
+
if (rangeFilters.length === 2) {
|
|
181
|
+
// Potentially combinable range filters
|
|
182
|
+
const [filter1, filter2] = rangeFilters;
|
|
183
|
+
// Check for min/max combination
|
|
184
|
+
if ((filter1.condition === FilterConditionType.GREATER_THAN ||
|
|
185
|
+
filter1.condition === FilterConditionType.GREATER_THAN_OR_EQUALS) &&
|
|
186
|
+
(filter2.condition === FilterConditionType.LESS_THAN ||
|
|
187
|
+
filter2.condition === FilterConditionType.LESS_THAN_OR_EQUALS)) {
|
|
188
|
+
// This is a valid range, keep both
|
|
189
|
+
simplifiedFilters.push(filter1, filter2);
|
|
190
|
+
}
|
|
191
|
+
else if ((filter2.condition === FilterConditionType.GREATER_THAN ||
|
|
192
|
+
filter2.condition === FilterConditionType.GREATER_THAN_OR_EQUALS) &&
|
|
193
|
+
(filter1.condition === FilterConditionType.LESS_THAN ||
|
|
194
|
+
filter1.condition === FilterConditionType.LESS_THAN_OR_EQUALS)) {
|
|
195
|
+
// This is a valid range, keep both
|
|
196
|
+
simplifiedFilters.push(filter1, filter2);
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
// Incompatible range conditions, keep all
|
|
200
|
+
simplifiedFilters.push(...filterGroup);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
// Cannot simplify, keep all filters
|
|
205
|
+
simplifiedFilters.push(...filterGroup);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
return {
|
|
210
|
+
filters: simplifiedFilters,
|
|
211
|
+
matchAny: filters.matchAny,
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
//# sourceMappingURL=operators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operators.js","sourceRoot":"","sources":["../../../src/utils/filters/operators.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAGL,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,YAAY,CAAC;AAEpB;;;;;;GAMG;AACH,MAAM,UAAU,2BAA2B,CACzC,SAAiB,EACjB,QAAgB;IAEhB,MAAM,eAAe,GAAG,sBAAsB,CAAC,SAAS,CAAC,CAAC;IAE1D,IAAI,CAAC,eAAe,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,CAAC;QACnD,kEAAkE;QAClE,OAAO,IAAI,CAAC;IACd,CAAC;IAED,+CAA+C;IAC/C,OAAO,eAAe,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACtD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CACjC,SAAiB,EACjB,QAAgB;IAEhB,MAAM,eAAe,GAAG,sBAAsB,CAAC,SAAS,CAAC,CAAC;IAE1D,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,+CAA+C;IAC/C,OAAO,eAAe,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC;AAC/C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAC7B,SAA8B;IAE9B,MAAM,YAAY,GAEd;QACF,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,EAAE,OAAO,CAAC,QAAQ;KAC3B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Relationship filtering utilities
|
|
3
|
+
* These utilities help create filters based on relationships between records
|
|
4
|
+
*/
|
|
5
|
+
import { ListEntryFilters, ResourceType } from './types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Applies rate limiting to relationship queries
|
|
8
|
+
* Throws RelationshipRateLimitError if the rate limit is exceeded
|
|
9
|
+
*
|
|
10
|
+
* @param req - Request object
|
|
11
|
+
* @param relationshipType - Type of relationship query
|
|
12
|
+
* @param isNested - Whether this is a nested relationship query
|
|
13
|
+
* @throws RelationshipRateLimitError if rate limit exceeded
|
|
14
|
+
*/
|
|
15
|
+
export declare function applyRateLimit(req: any, relationshipType: string, isNested?: boolean): void;
|
|
16
|
+
/**
|
|
17
|
+
* Creates a filter for people based on their associated company attributes
|
|
18
|
+
* Includes rate limiting for this resource-intensive operation
|
|
19
|
+
*
|
|
20
|
+
* @param companyFilter - Filters to apply to the related companies
|
|
21
|
+
* @param req - Optional request object for rate limiting (if not provided, rate limiting is skipped)
|
|
22
|
+
* @returns Filter for finding people based on company attributes
|
|
23
|
+
* @throws RelationshipRateLimitError if rate limit exceeded
|
|
24
|
+
*/
|
|
25
|
+
export declare function createPeopleByCompanyFilter(companyFilter: ListEntryFilters, req?: any): ListEntryFilters;
|
|
26
|
+
/**
|
|
27
|
+
* Creates a filter for companies based on their associated people attributes
|
|
28
|
+
* Includes rate limiting for this resource-intensive operation
|
|
29
|
+
*
|
|
30
|
+
* @param peopleFilter - Filters to apply to the related people
|
|
31
|
+
* @param req - Optional request object for rate limiting (if not provided, rate limiting is skipped)
|
|
32
|
+
* @returns Filter for finding companies based on people attributes
|
|
33
|
+
* @throws RelationshipRateLimitError if rate limit exceeded
|
|
34
|
+
*/
|
|
35
|
+
export declare function createCompaniesByPeopleFilter(peopleFilter: ListEntryFilters, req?: any): ListEntryFilters;
|
|
36
|
+
/**
|
|
37
|
+
* Creates a filter for records that belong to a specific list
|
|
38
|
+
* Includes rate limiting for this operation and caching for better performance
|
|
39
|
+
*
|
|
40
|
+
* @param resourceType - The type of records to filter (people or companies)
|
|
41
|
+
* @param listId - The ID of the list to filter by
|
|
42
|
+
* @param req - Optional request object for rate limiting (if not provided, rate limiting is skipped)
|
|
43
|
+
* @param useCache - Whether to use caching (default: true)
|
|
44
|
+
* @returns Filter for finding records that belong to the list
|
|
45
|
+
* @throws RelationshipRateLimitError if rate limit exceeded
|
|
46
|
+
*/
|
|
47
|
+
export declare function createRecordsByListFilter(resourceType: ResourceType, listId: string, req?: any, useCache?: boolean): ListEntryFilters;
|
|
48
|
+
/**
|
|
49
|
+
* Creates a filter for finding people who work at companies in a specific list
|
|
50
|
+
* This is a nested relationship query with rate limiting and caching applied
|
|
51
|
+
*
|
|
52
|
+
* @param listId - The ID of the list that contains companies
|
|
53
|
+
* @param req - Optional request object for rate limiting (if not provided, rate limiting is skipped)
|
|
54
|
+
* @param useCache - Whether to use caching (default: true)
|
|
55
|
+
* @returns Filter for finding people who work at companies in the specified list
|
|
56
|
+
* @throws RelationshipRateLimitError if rate limit exceeded
|
|
57
|
+
*/
|
|
58
|
+
export declare function createPeopleByCompanyListFilter(listId: string, req?: any, useCache?: boolean): ListEntryFilters;
|
|
59
|
+
/**
|
|
60
|
+
* Creates a filter for finding companies that have people in a specific list
|
|
61
|
+
* This is a nested relationship query with rate limiting and caching applied
|
|
62
|
+
*
|
|
63
|
+
* @param listId - The ID of the list that contains people
|
|
64
|
+
* @param req - Optional request object for rate limiting (if not provided, rate limiting is skipped)
|
|
65
|
+
* @param useCache - Whether to use caching (default: true)
|
|
66
|
+
* @returns Filter for finding companies that have people in the specified list
|
|
67
|
+
* @throws RelationshipRateLimitError if rate limit exceeded
|
|
68
|
+
*/
|
|
69
|
+
export declare function createCompaniesByPeopleListFilter(listId: string, req?: any, useCache?: boolean): ListEntryFilters;
|
|
70
|
+
/**
|
|
71
|
+
* Creates a filter for records that have associated notes matching criteria
|
|
72
|
+
* Includes rate limiting for text search operations
|
|
73
|
+
*
|
|
74
|
+
* @param resourceType - The type of records to filter (people or companies)
|
|
75
|
+
* @param textSearch - Text to search for in the notes
|
|
76
|
+
* @param req - Optional request object for rate limiting (if not provided, rate limiting is skipped)
|
|
77
|
+
* @returns Filter for finding records with matching notes
|
|
78
|
+
* @throws RelationshipRateLimitError if rate limit exceeded
|
|
79
|
+
*/
|
|
80
|
+
export declare function createRecordsByNotesFilter(resourceType: ResourceType, textSearch: string, req?: any): ListEntryFilters;
|
|
81
|
+
//# sourceMappingURL=relationship.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relationship.d.ts","sourceRoot":"","sources":["../../../src/utils/filters/relationship.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,OAAO,EACL,gBAAgB,EAGhB,YAAY,EAIb,MAAM,YAAY,CAAC;AAWpB;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,GAAG,EACR,gBAAgB,EAAE,MAAM,EACxB,QAAQ,GAAE,OAAe,GACxB,IAAI,CAaN;AAiDD;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CACzC,aAAa,EAAE,gBAAgB,EAC/B,GAAG,CAAC,EAAE,GAAG,GACR,gBAAgB,CAgDlB;AAED;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAC3C,YAAY,EAAE,gBAAgB,EAC9B,GAAG,CAAC,EAAE,GAAG,GACR,gBAAgB,CAgDlB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,MAAM,EACd,GAAG,CAAC,EAAE,GAAG,EACT,QAAQ,GAAE,OAAc,GACvB,gBAAgB,CAgElB;AAED;;;;;;;;;GASG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,MAAM,EACd,GAAG,CAAC,EAAE,GAAG,EACT,QAAQ,GAAE,OAAc,GACvB,gBAAgB,CAkElB;AAED;;;;;;;;;GASG;AACH,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,MAAM,EACd,GAAG,CAAC,EAAE,GAAG,EACT,QAAQ,GAAE,OAAc,GACvB,gBAAgB,CAkElB;AAED;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,MAAM,EAClB,GAAG,CAAC,EAAE,GAAG,GACR,gBAAgB,CAyClB"}
|