3.0 KiB
3.0 KiB
AGENTS
Learned User Preferences
- Wants a TypeScript Clarizen client with SDK-style API:
new Clarizen(url, apiToken)and namespaced methods (e.g.clarizen.data.entityQuery(...)). - Wants session authentication via
authentication.login(user, pass)that returns an API session for subsequent calls, not only static API tokens. - May describe requirements in Portuguese as well as English.
- Wants full Clarizen API typings from
https://api.clarizen.com/V2.0/services/types/, including nested types (Condition,Expression,Operator, etc.) — not genericJsonObjectshortcuts for documented fields. - When adding types, follow nested type links from the API docs and model every referenced type, not only top-level operation params.
- When extending the SDK, cross-check the Planview Adaptive Work REST API Guide (V2) with live
api.clarizen.comdocs; apply guide content only when it adds value beyond the live schema pages. - Wants automatic retry (3 attempts) on all Clarizen HTTP calls except when the API returns
SessionTimeout.
Learned Workspace Facts
- ARCO monorepo (RivusLab):
clarizen-lib/is the Clarizen SDK; sibling apps consume@arco/clarizen-libvia npm workspaces orfile:../clarizen-lib. - TypeScript package
@arco/clarizen-lib: Clarizen / Planview Adaptive Work REST API V2.0 client. - Clarizen V2.0 REST on
api.clarizen.comis the Planview Adaptive Work API (Clarizen host, same V2.0 surface). - Target API surface:
https://api.clarizen.com/V2.0/services/; operations grouped in namespaces (data,authentication,metadata, etc.). - Type schemas at
https://api.clarizen.com/V2.0/services/types/drive request/response TypeScript types (e.g. EntityQuerywhereisCondition, sort isordersnotorderBy). - Secondary reference: Planview Adaptive Work REST API Guide V2 at https://success.planview.com/Planview_AdaptiveWork/API/REST_API_Guide_Version_2
- HTTP auth:
Authorization: ApiKey {token}for API keys;Authorization: Session {sessionId}after login. - All SDK HTTP traffic goes through
HttpClient.request; retries are centralized there (3 attempts, no retry onSessionTimeout). - Multi-tenant session login:
loginWithDiscoverycallsauthentication.getServerDefinition, setsbaseUrlfromserverLocation, thenauthentication.login. Clarizen.createForLogin(baseUrl?)builds a client without prior auth for the discovery/login flow.- Entity CRUD is exposed as
clarizen.objects(REST under/V2.0/services/data/objects/{typeName}/...). - API TypeScript types are generated from crawled schema (
npm run scrape:types→src/generated/clarizen-schema.json,npm run generate:types→src/clarizen-api-types.ts). - Planview guide notes live in
docs/references/planview-rest-api-v2.md. - Org metadata catalog:
listEntities+describeMetadatawithflags: ["fields", "relations"];clarizen.metadata.fetchCatalog()at runtime;npm run scrape:metadata→src/generated/metadata-catalog.json+metadata-types.ts. Filter out names containingC_orR_(custom fields/relations/entities).