{
  "status": 200,
  "body": {
    "jsonrpc": "2.0",
    "id": 10,
    "result": {
      "content": [
        {
          "type": "text",
          "text": "[\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"requestApproval\",\n    \"description\": \"Move a record into workflow approval: marks it pending and emits a `request-approval` workflow command. Requires the collection to have enableWorkflow=true.\",\n    \"params\": [\n      {\n        \"name\": \"orgid\",\n        \"type\": \"String\",\n        \"description\": \"Org id.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"datatype\",\n        \"type\": \"String\",\n        \"description\": \"Datatype.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"id\",\n        \"type\": \"String\",\n        \"description\": \"Record sk.\",\n        \"required\": true\n      }\n    ],\n    \"returns\": \"The record (with updated workflow.status).\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"approve\",\n    \"description\": \"Approve a pending record via the workflow command bus.\",\n    \"params\": [\n      {\n        \"name\": \"orgid\",\n        \"type\": \"String\",\n        \"description\": \"Org id.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"datatype\",\n        \"type\": \"String\",\n        \"description\": \"Datatype.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"id\",\n        \"type\": \"String\",\n        \"description\": \"Record sk.\",\n        \"required\": true\n      }\n    ],\n    \"returns\": \"true on success.\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"reject\",\n    \"description\": \"Reject a pending record via the workflow command bus.\",\n    \"params\": [\n      {\n        \"name\": \"orgid\",\n        \"type\": \"String\",\n        \"description\": \"Org id.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"datatype\",\n        \"type\": \"String\",\n        \"description\": \"Datatype.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"id\",\n        \"type\": \"String\",\n        \"description\": \"Record sk.\",\n        \"required\": true\n      }\n    ],\n    \"returns\": \"true on success.\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"isUnique\",\n    \"description\": \"Check whether a value is unique on a given attribute. Honours collection schema property `uniqueScope` (single field or array) — when set, scopeValue must also be supplied. For `collection` datatype, also fuzzy-matches name.\",\n    \"params\": [\n      {\n        \"name\": \"orgId\",\n        \"type\": \"String\",\n        \"description\": \"Org id.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"datatype\",\n        \"type\": \"String\",\n        \"description\": \"Datatype to search.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"attribute\",\n        \"type\": \"String\",\n        \"description\": \"Field name to check for uniqueness.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"value\",\n        \"type\": \"Object\",\n        \"description\": \"Value to check.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"scopeValue\",\n        \"type\": \"Object\",\n        \"description\": \"Required when the property has uniqueScope set.\",\n        \"required\": true\n      }\n    ],\n    \"returns\": \"sk of the existing record (truthy = NOT unique), or undefined when the value is unused.\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"getPartial\",\n    \"description\": \"Read a subset of fields off a record (provider-level projection).\",\n    \"params\": [\n      {\n        \"name\": \"orgid\",\n        \"type\": \"String\",\n        \"description\": \"Org id.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"datatype\",\n        \"type\": \"String\",\n        \"description\": \"Datatype.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"id\",\n        \"type\": \"String\",\n        \"description\": \"Record sk.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"fields\",\n        \"type\": \"Array\",\n        \"description\": \"Field names to include.\",\n        \"required\": true\n      }\n    ],\n    \"returns\": \"Partial record.\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"findOne\",\n    \"description\": \"Find a record by sk (must be a valid ObjectId). Optionally enriches type-specific related data.\",\n    \"params\": [\n      {\n        \"name\": \"orgid\",\n        \"type\": \"String\",\n        \"description\": \"Org id.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"datatype\",\n        \"type\": \"String\",\n        \"description\": \"Datatype.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"id\",\n        \"type\": \"String\",\n        \"description\": \"Record sk (ObjectId).\",\n        \"required\": true\n      },\n      {\n        \"name\": \"enrich\",\n        \"type\": \"Object\",\n        \"description\": \"Whether to apply enrichment.\",\n        \"required\": false\n      }\n    ],\n    \"returns\": \"BaseModel or null.\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"findOneAnyId\",\n    \"description\": \"Find a record by any natural identifier — username, email, slug, name, sku, number, or sk/_id (case-insensitive). Returns the first match; warns if multiple were found.\",\n    \"params\": [\n      {\n        \"name\": \"orgId\",\n        \"type\": \"String\",\n        \"description\": \"Org id.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"datatype\",\n        \"type\": \"String\",\n        \"description\": \"Datatype.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"dataId\",\n        \"type\": \"String\",\n        \"description\": \"Identifier value.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"options\",\n        \"type\": \"Object\",\n        \"description\": \"DataOptions including enrich flag.\",\n        \"required\": true\n      }\n    ],\n    \"returns\": \"BaseModel or undefined.\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"findByAttribute\",\n    \"description\": \"Find records matching attribute = value (or list all of a datatype when both omitted). Optionally enriches.\",\n    \"params\": [\n      {\n        \"name\": \"orgid\",\n        \"type\": \"String\",\n        \"description\": \"Org id.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"datatype\",\n        \"type\": \"String\",\n        \"description\": \"Datatype.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"attribute\",\n        \"type\": \"String\",\n        \"description\": \"Field name.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"value\",\n        \"type\": \"String\",\n        \"description\": \"Field value.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"options\",\n        \"type\": \"Object\",\n        \"description\": \"DataOptions.\",\n        \"required\": true\n      }\n    ],\n    \"returns\": \"BaseModelDTO with matching records.\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"findTimedData\",\n    \"description\": \"Find records of one or more time-anchored datatypes (event/reservation/task/sf_subscription/schedule) overlapping a date range. Defaults to the next 30 days when endDate is omitted.\",\n    \"params\": [\n      {\n        \"name\": \"orgid\",\n        \"type\": \"String\",\n        \"description\": \"Org id.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"startDate\",\n        \"type\": \"Object\",\n        \"description\": \"ISO date or Date — defaults to now.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"endDate\",\n        \"type\": \"Object\",\n        \"description\": \"ISO date or Date — defaults to startDate + 30 days.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"datatypes\",\n        \"type\": \"Object\",\n        \"description\": \"Single datatype, comma string, or array. Defaults to all five.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"options\",\n        \"type\": \"Object\",\n        \"description\": \"DataOptions.\",\n        \"required\": true\n      }\n    ],\n    \"returns\": \"Map keyed by datatype → BaseModelDTO.\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"findPageData\",\n    \"description\": \"Power site/storefront page queries: resolves either a specific record (by slug/name/sk) or builds a filtered listing across categories, tags, attribute filters (price ranges, keyword Elastic queries) for a \\\"collection-subSchema\\\" pair.\",\n    \"params\": [\n      {\n        \"name\": \"orgId\",\n        \"type\": \"String\",\n        \"description\": \"Org id.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"dataTypeTemp\",\n        \"type\": \"String\",\n        \"description\": \"\\\"collection-subSchema\\\" string (or just \\\"collection\\\").\",\n        \"required\": true\n      },\n      {\n        \"name\": \"dataId\",\n        \"type\": \"String\",\n        \"description\": \"Record id/slug for single-record fetch (skip filters when provided).\",\n        \"required\": true\n      },\n      {\n        \"name\": \"attributes\",\n        \"type\": \"Object\",\n        \"description\": \"Filter map (or JSON string) of attribute → value, including special \\\"price\\\" range.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"keyword\",\n        \"type\": \"String\",\n        \"description\": \"Optional free-text keyword (routes through ElasticSearch query shape).\",\n        \"required\": true\n      },\n      {\n        \"name\": \"categories\",\n        \"type\": \"Object\",\n        \"description\": \"Single string, CSV, or array of category names.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"tags\",\n        \"type\": \"Object\",\n        \"description\": \"Single string, CSV, or array of tag names.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"options\",\n        \"type\": \"Object\",\n        \"description\": \"DataOptions.\",\n        \"required\": true\n      }\n    ],\n    \"returns\": \"BaseModelDTO of matching records.\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"findRelated\",\n    \"description\": \"Find related records (same datatype) by overlapping post.categories or post.tags of a primary record resolved through findOneAnyId.\",\n    \"params\": [\n      {\n        \"name\": \"orgid\",\n        \"type\": \"String\",\n        \"description\": \"Org id.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"datatype\",\n        \"type\": \"String\",\n        \"description\": \"Datatype.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"anyId\",\n        \"type\": \"String\",\n        \"description\": \"Identifier of the primary record.\",\n        \"required\": true\n      }\n    ],\n    \"returns\": \"BaseModelDTO of related records (or [] when primary has no taxonomy).\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"find\",\n    \"description\": \"Generic find: paginated query against a datatype with optional enrichment.\",\n    \"params\": [\n      {\n        \"name\": \"orgid\",\n        \"type\": \"String\",\n        \"description\": \"Org id.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"datatype\",\n        \"type\": \"String\",\n        \"description\": \"Datatype.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"query\",\n        \"type\": \"Object\",\n        \"description\": \"Mongo or ES query body.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"options\",\n        \"type\": \"Object\",\n        \"description\": \"DataOptions (page, pageSize, sort, enrich, ...).\",\n        \"required\": false\n      }\n    ],\n    \"returns\": \"BaseModelDTO.\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"findExperts\",\n    \"description\": \"Find experts in the configured shared org (`appmint-expert` collection).\",\n    \"params\": [\n      {\n        \"name\": \"keyword\",\n        \"type\": \"String\",\n        \"description\": \"Search keyword.\",\n        \"required\": true\n      }\n    ],\n    \"returns\": \"BaseModelDTO of expert profiles.\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"findAsset\",\n    \"description\": \"Find shared assets (templates, components) — runs against the configured SHARED_ORG instead of the caller's org.\",\n    \"params\": [\n      {\n        \"name\": \"datatype\",\n        \"type\": \"String\",\n        \"description\": \"Datatype in the shared org.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"query\",\n        \"type\": \"Object\",\n        \"description\": \"Mongo query.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"options\",\n        \"type\": \"Object\",\n        \"description\": \"DataOptions.\",\n        \"required\": true\n      }\n    ],\n    \"returns\": \"BaseModelDTO.\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"searchAsset\",\n    \"description\": \"Free-text search shared assets (delegates to search() against SHARED_ORG).\",\n    \"params\": [\n      {\n        \"name\": \"datatype\",\n        \"type\": \"String\",\n        \"description\": \"Datatype.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"keyword\",\n        \"type\": \"Object\",\n        \"description\": \"Search keyword.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"query\",\n        \"type\": \"Object\",\n        \"description\": \"Optional Mongo filter.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"options\",\n        \"type\": \"Object\",\n        \"description\": \"DataOptions.\",\n        \"required\": true\n      }\n    ],\n    \"returns\": \"BaseModelDTO.\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"deleteAssets\",\n    \"description\": \"Delete one or more shared/in-org assets. For component-style datatypes the underlying record is `flexdata`; for template datatypes the underlying record is `fileinfo` and the file payload is also removed.\",\n    \"params\": [\n      {\n        \"name\": \"orgId\",\n        \"type\": \"Object\",\n        \"description\": \"Org id (overridden to SHARED_ORG for component/tag-template).\",\n        \"required\": true\n      },\n      {\n        \"name\": \"datatype\",\n        \"type\": \"String\",\n        \"description\": \"Asset datatype.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"ids\",\n        \"type\": \"Object\",\n        \"description\": \"Single id or array.\",\n        \"required\": true\n      }\n    ],\n    \"returns\": \"true.\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"updateAsset\",\n    \"description\": \"Update an asset record — flexdata for component-style, fileinfo (and the underlying file payload) for template-style.\",\n    \"params\": [\n      {\n        \"name\": \"orgId\",\n        \"type\": \"Object\",\n        \"description\": \"Org id.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"datatype\",\n        \"type\": \"String\",\n        \"description\": \"Asset datatype.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"id\",\n        \"type\": \"Object\",\n        \"description\": \"Asset id.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"data\",\n        \"type\": \"Object\",\n        \"description\": \"Update payload.\",\n        \"required\": true\n      }\n    ],\n    \"returns\": \"void.\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"getDataTypeCategories\",\n    \"description\": \"Look up the `category` record whose name matches a datatype — used for taxonomy headers.\",\n    \"params\": [\n      {\n        \"name\": \"orgId\",\n        \"type\": \"String\",\n        \"description\": \"Org id.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"datatype\",\n        \"type\": \"String\",\n        \"description\": \"Datatype.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"options\",\n        \"type\": \"Object\",\n        \"description\": \"DataOptions.\",\n        \"required\": true\n      }\n    ],\n    \"returns\": \"Category BaseModel or undefined.\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"getTags\",\n    \"description\": \"List the org's tag vocabulary from the `tag` collection, projected to sk/name/value, optionally filtered by a keyword matched anywhere in the tag name. Returns every match rather than a page — callers use this to populate tag pickers, and find() would otherwise cap it at 50. Uniqueness is enforced on the way in by addTag, so the list is already free of duplicates.\",\n    \"params\": [\n      {\n        \"name\": \"orgId\",\n        \"type\": \"String\",\n        \"description\": \"Org id.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"keyword\",\n        \"type\": \"String\",\n        \"description\": \"Optional search — matches anywhere in the tag name. Omit for the whole vocabulary.\",\n        \"required\": true\n      }\n    ],\n    \"returns\": \"BaseModelDTO of matching tag records, sorted by name, carrying only sk/name/value.\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"addTag\",\n    \"description\": \"Add a tag to the org's tag vocabulary. This is what keeps the collection free of duplicates: a tag whose name already exists (case-insensitive) is returned as-is instead of creating a second record, so reads never have to de-duplicate.\",\n    \"params\": [\n      {\n        \"name\": \"orgId\",\n        \"type\": \"String\",\n        \"description\": \"Org id.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"tag\",\n        \"type\": \"Object\",\n        \"description\": \"{ name (required), value? }. Name is stored lower-case; value defaults to it.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"author\",\n        \"type\": \"Object\",\n        \"description\": \"Author label.\",\n        \"required\": false\n      }\n    ],\n    \"returns\": \"The created or already-existing tag record.\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"findByTag\",\n    \"description\": \"Provider-level multi-tag query.\",\n    \"params\": [\n      {\n        \"name\": \"orgId\",\n        \"type\": \"String\",\n        \"description\": \"Org id.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"datatype\",\n        \"type\": \"String\",\n        \"description\": \"Datatype.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"tags\",\n        \"type\": \"Array\",\n        \"description\": \"Array of tag names.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"options\",\n        \"type\": \"Object\",\n        \"description\": \"DataOptions.\",\n        \"required\": true\n      }\n    ],\n    \"returns\": \"BaseModelDTO.\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"search\",\n    \"description\": \"Free-text search via the provider. Falls back to find() when keyword is empty. Auto-recovers from \\\"text index required\\\" by calling fixCollection once and retrying.\",\n    \"params\": [\n      {\n        \"name\": \"orgid\",\n        \"type\": \"String\",\n        \"description\": \"Org id.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"datatype\",\n        \"type\": \"String\",\n        \"description\": \"Datatype to search (defaults to site_index when empty).\",\n        \"required\": true\n      },\n      {\n        \"name\": \"keyword\",\n        \"type\": \"Object\",\n        \"description\": \"Search keyword.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"query\",\n        \"type\": \"Object\",\n        \"description\": \"Mongo filter to AND with the text query.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"options\",\n        \"type\": \"Object\",\n        \"description\": \"DataOptions.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"tries\",\n        \"type\": \"Object\",\n        \"description\": \"Internal retry counter.\",\n        \"required\": false\n      }\n    ],\n    \"returns\": \"BaseModelDTO.\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"createNoChecks\",\n    \"description\": \"Insert a record bypassing all collection/workflow/schedule pre/post processing — used by bulk import, history rewrite, and migration.\",\n    \"params\": [\n      {\n        \"name\": \"orgid\",\n        \"type\": \"String\",\n        \"description\": \"Org id.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"data\",\n        \"type\": \"Object\",\n        \"description\": \"BaseModel to insert.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"returnObject\",\n        \"type\": \"Object\",\n        \"description\": \"When true, returns the inserted object.\",\n        \"required\": false\n      },\n      {\n        \"name\": \"uniqueFields\",\n        \"type\": \"Array\",\n        \"description\": \"Optional unique-field guard.\",\n        \"required\": true\n      }\n    ],\n    \"returns\": \"Inserted record (when returnObject=true) or provider-shaped result.\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"createExtended\",\n    \"description\": \"Custom create variants. Currently supports `create-page-from-template`: clones a page from the configured SHARED_ORG into the caller's org with a unique name/slug suffix.\",\n    \"params\": [\n      {\n        \"name\": \"orgid\",\n        \"type\": \"String\",\n        \"description\": \"Org id.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"createData\",\n        \"type\": \"Object\",\n        \"description\": \"{ data, action, options }.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"created_by\",\n        \"type\": \"Object\",\n        \"description\": \"Author label.\",\n        \"required\": false\n      }\n    ],\n    \"returns\": \"Created record (delegates to create()).\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"create\",\n    \"description\": \"Create a record with full pipeline: collection lookup, datatype guards (company/reservation/event/user/customer use dedicated services), workflow + schedule materialisation, system events, Stripe/PayPal hookups for subscription plans. Drops duplicate calls (same payload) defensively.\",\n    \"params\": [\n      {\n        \"name\": \"orgid\",\n        \"type\": \"String\",\n        \"description\": \"Org id.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"data\",\n        \"type\": \"Object\",\n        \"description\": \"BaseModel to create. Must include datatype + non-empty data.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"created_by\",\n        \"type\": \"Object\",\n        \"description\": \"Author label (defaults \\\"system\\\").\",\n        \"required\": false\n      }\n    ],\n    \"returns\": \"Created record with id resolved.\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"update\",\n    \"description\": \"Update a record with full pipeline: caller-source guards, history versioning + activity logging, workflow stage reset, schedule re-link, Stripe/PayPal subscription-plan upstream sync, COLLECTION_UPDATE event.\",\n    \"params\": [\n      {\n        \"name\": \"orgid\",\n        \"type\": \"String\",\n        \"description\": \"Org id.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"id\",\n        \"type\": \"String\",\n        \"description\": \"Record sk.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"data\",\n        \"type\": \"Object\",\n        \"description\": \"BaseModel with mutated fields.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"modified_by\",\n        \"type\": \"Object\",\n        \"description\": \"Author label (defaults \\\"system\\\").\",\n        \"required\": false\n      }\n    ],\n    \"returns\": \"Updated record.\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"updatePartial\",\n    \"description\": \"Provider-level partial update — sets the provided dotted-path key/value pairs without going through the full update pipeline.\",\n    \"params\": [\n      {\n        \"name\": \"orgid\",\n        \"type\": \"String\",\n        \"description\": \"Org id.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"datatype\",\n        \"type\": \"Object\",\n        \"description\": \"Datatype.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"id\",\n        \"type\": \"String\",\n        \"description\": \"Record sk.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"keyValuePair\",\n        \"type\": \"Object\",\n        \"description\": \"Map of dotted path → new value.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"updateBy\",\n        \"type\": \"String\",\n        \"description\": \"Audit label (currently informational).\",\n        \"required\": true\n      }\n    ],\n    \"returns\": \"Provider-shaped update result.\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"updateSystemFields\",\n    \"description\": \"Restricted partial update for BaseModel wrapper fields (notes, stats, workflow, state, owner, requiredRole, post, style, name, etc.). Cannot touch `data` or `data.*`.\",\n    \"params\": [\n      {\n        \"name\": \"orgid\",\n        \"type\": \"String\",\n        \"description\": \"Org id.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"datatype\",\n        \"type\": \"Object\",\n        \"description\": \"Datatype.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"id\",\n        \"type\": \"String\",\n        \"description\": \"Record sk.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"keyValuePair\",\n        \"type\": \"Object\",\n        \"description\": \"Map of dotted path → new value. Top-level segment must be a whitelisted system field.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"updateBy\",\n        \"type\": \"String\",\n        \"description\": \"Audit label.\",\n        \"required\": true\n      }\n    ],\n    \"returns\": \"Provider-shaped update result.\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"publish\",\n    \"description\": \"Publish a page or post: copies the source into the `published` collection and bumps state. No-op for any other datatype.\",\n    \"params\": [\n      {\n        \"name\": \"orgid\",\n        \"type\": \"String\",\n        \"description\": \"Org id.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"datatype\",\n        \"type\": \"String\",\n        \"description\": \"page or post.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"id\",\n        \"type\": \"String\",\n        \"description\": \"Record sk.\",\n        \"required\": true\n      }\n    ],\n    \"returns\": \"\\\"published\\\" / \\\"already published\\\".\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"unpublish\",\n    \"description\": \"Unpublish a page or post: removes the corresponding `published` row and resets the source state to draft.\",\n    \"params\": [\n      {\n        \"name\": \"orgid\",\n        \"type\": \"String\",\n        \"description\": \"Org id.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"datatype\",\n        \"type\": \"String\",\n        \"description\": \"page or post.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"id\",\n        \"type\": \"String\",\n        \"description\": \"Record sk.\",\n        \"required\": true\n      }\n    ],\n    \"returns\": \"\\\"unpublished\\\".\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"delete\",\n    \"description\": \"Delete a record with full cascade: cancels owned tasks/activities/published/history, fires SendNotificationCommand for messages, emits COLLECTION_DELETE, cancels owned schedules, writes a TrashCreateCommand for restore, then provider-deletes the record.\",\n    \"params\": [\n      {\n        \"name\": \"orgid\",\n        \"type\": \"String\",\n        \"description\": \"Org id.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"datatype\",\n        \"type\": \"String\",\n        \"description\": \"Datatype.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"id\",\n        \"type\": \"Object\",\n        \"description\": \"Record sk.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"silent\",\n        \"type\": \"Object\",\n        \"description\": \"Skip cascades + events when true.\",\n        \"required\": false\n      },\n      {\n        \"name\": \"deletedBy\",\n        \"type\": \"String\",\n        \"description\": \"Audit label.\",\n        \"required\": true\n      }\n    ],\n    \"returns\": \"void (provider-shaped).\",\n    \"group\": \"repository\"\n  },\n  {\n    \"service\": \"RepositoryCrudService\",\n    \"method\": \"deleteBulk\",\n    \"description\": \"Iterate `delete()` over a list of ids, swallowing per-id errors. Returns a per-id success/error report.\",\n    \"params\": [\n      {\n        \"name\": \"orgid\",\n        \"type\": \"String\",\n        \"description\": \"Org id.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"datatype\",\n        \"type\": \"String\",\n        \"description\": \"Datatype.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"uids\",\n        \"type\": \"Array\",\n        \"description\": \"Array of record sks.\",\n        \"required\": true\n      },\n      {\n        \"name\": \"deletedBy\",\n        \"type\": \"String\",\n        \"description\": \"Audit label.\",\n        \"required\": true\n      }\n    ],\n    \"returns\": \"Array of `{ id, success?, error? }`.\",\n    \"group\": \"repository\"\n  }\n]"
        }
      ],
      "isError": false
    }
  }
}
