@centrali-io/centrali-sdk 6.17.0 → 8.0.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/README.md CHANGED
@@ -782,13 +782,12 @@ async function run() {
782
782
  // - triggerParams: static config from the trigger definition
783
783
  // - executionParams: dynamic data from the current invocation
784
784
 
785
- const result = await api.httpRequest({
786
- url: 'https://api.example.com/data',
787
- method: 'POST',
788
- body: JSON.stringify(executionParams.payload)
789
- });
785
+ const result = await api.httpPost(
786
+ 'https://api.example.com/data',
787
+ executionParams.payload
788
+ );
790
789
 
791
- return { success: true, data: result };
790
+ return { success: true, data: result.data };
792
791
  }
793
792
  ```
794
793
 
@@ -802,7 +801,9 @@ What `triggerParams` and `executionParams` contain depends on how the function i
802
801
  |--------------|-----------------|-------------------|
803
802
  | **HTTP trigger** | Static params from trigger definition | `{ payload }` — parsed request body |
804
803
  | **Endpoint trigger** | Static params from trigger definition | `{ payload, method, headers, query }` — full HTTP context |
804
+ | **Event-driven trigger** | Static params from trigger definition | `{ payload }` |
805
805
  | **Scheduled trigger** | Static params from trigger definition (max 64KB) | `{}` — empty |
806
+ | **On-demand trigger** | Static params from trigger definition | `{ payload }` — passed to `invoke_trigger` |
806
807
  | **Pages action** | `{ input, token }` — from page action invocation | `{}` — empty |
807
808
  | **Orchestration step** | Orchestration input + previous step outputs + decrypted encrypted params | Not used (all input arrives via `triggerParams`) |
808
809
 
@@ -812,13 +813,32 @@ Every compute function has access to `api`, which provides:
812
813
 
813
814
  | Category | Methods |
814
815
  |----------|---------|
815
- | **Records** | `queryRecords`, `fetchRecord`, `createRecord`, `updateRecord`, `deleteRecord`, `bulkCreateRecords`, `bulkUpdateRecords`, `bulkDeleteRecords` |
816
- | **HTTP** | `httpRequest`, `httpFetch` (outbound calls to allowed domains) |
816
+ | **Records** | `queryRecords`, `aggregateRecords`, `fetchRecord`, `fetchRecordByUniqueField`, `createRecord`, `upsertRecord`, `updateRecord`, `deleteRecord`, `incrementField`, `decrementField`, `compareSecret` |
817
+ | **Records (many)** | `batchCreateRecords`, `batchUpdateRecords`, `batchDeleteRecords`, `bulkCreateRecords`, `bulkUpdateRecords`, `bulkDeleteRecords` — up to 1,000 records each; `bulk*` aggregates events, `batch*` does not |
818
+ | **HTTP** | `httpGet(url, config?)`, `httpPost(url, data?, config?)`, `httpPut(url, data?, config?)`, `httpDelete(url, config?)` — `config` is `{ headers, timeout }`; each returns `{ status, statusText, headers, data }`. Outbound calls reach allow-listed domains only |
817
819
  | **Files** | `storeFile`, `storeAsCSV`, `storeAsJSON` |
818
820
  | **Crypto** | `crypto.sha256`, `crypto.hmacSha256`, `crypto.rsaSign`, `crypto.signJwt` |
819
- | **Utilities** | `uuid`, `formatDate`, `chunk`, `merge`, `math`, `evaluate`, `renderTemplate`, `log`, `logError` |
821
+ | **Utilities** | `uuid`, `formatDate`, `renderTemplate`, `log`, `logError` |
822
+ | **Namespaced** | `lodash.{chunk,flatten,uniq,merge}`, `math.{evaluate,round,sum,mean,median,std,…}`, `base64.{encode,decode}` — note these are **not** top-level: `api.chunk`, `api.merge` and `api.evaluate` do not exist |
820
823
  | **Conversion** | `toCSV`, `toJSON` |
821
824
 
825
+ > There is no `api.httpRequest` and no `api.httpFetch`. Both were listed here and in the MCP
826
+ > `describe` tool until 2026-08-15; neither has ever existed. Use the verb-specific methods above.
827
+
828
+ #### What a compute function cannot do
829
+
830
+ - **It cannot start an orchestration.** There is no `api` method for it. `orchestrationRunId` and
831
+ `orchestrationStepId` on the execution context are inbound — set when the function is already a
832
+ step in an orchestration. The relationship is orchestration → function, never the reverse. To
833
+ start an orchestration from a webhook, point the sender at the orchestration service's own
834
+ HMAC-verified endpoint (`POST /ws/{ws}/webhooks/{path}`).
835
+ - **It cannot send an outbound webhook.** Outbound delivery is driven by webhook subscriptions
836
+ reacting to record events, not called from function code.
837
+
838
+ **Outbound HTTP is deny-by-default.** `isDomainAllowed` returns `false` on an empty allow-list, so
839
+ a function reaches nothing external until the workspace allow-lists the domain. Wildcards use the
840
+ `*.example.com` form and match subdomains only, not the apex.
841
+
822
842
  #### Secrets in Compute Functions
823
843
 
824
844
  Compute functions have **no built-in environment variables or secrets field**. To pass secrets (API keys, credentials) to a compute function:
package/dist/index.d.ts CHANGED
@@ -2666,6 +2666,22 @@ interface AlertDefinition {
2666
2666
  lastEvaluatedAt: string | null;
2667
2667
  /** ISO timestamp of the last evaluation that fired */
2668
2668
  lastTriggeredAt: string | null;
2669
+ /**
2670
+ * Sanitized message from the most recent failed evaluation, or null if the
2671
+ * alert is healthy. Truncated, with row values redacted — diagnostic, not
2672
+ * a verbatim driver error.
2673
+ */
2674
+ lastError: string | null;
2675
+ /**
2676
+ * ISO timestamp of that failure. Distinct from `lastEvaluatedAt`, which by
2677
+ * design only advances on a successful evaluation.
2678
+ */
2679
+ lastErrorAt: string | null;
2680
+ /**
2681
+ * Consecutive failed evaluations; `0` means healthy. A run length, not a
2682
+ * total — the first successful query execution resets it.
2683
+ */
2684
+ consecutiveFailures: number;
2669
2685
  /** User ID who created the alert */
2670
2686
  createdBy: string;
2671
2687
  /** ISO timestamp of creation */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@centrali-io/centrali-sdk",
3
- "version": "6.17.0",
3
+ "version": "8.0.0",
4
4
  "description": "Centrali Node SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -69,6 +69,22 @@ export interface AlertDefinition {
69
69
  lastEvaluatedAt: string | null;
70
70
  /** ISO timestamp of the last evaluation that fired */
71
71
  lastTriggeredAt: string | null;
72
+ /**
73
+ * Sanitized message from the most recent failed evaluation, or null if the
74
+ * alert is healthy. Truncated, with row values redacted — diagnostic, not
75
+ * a verbatim driver error.
76
+ */
77
+ lastError: string | null;
78
+ /**
79
+ * ISO timestamp of that failure. Distinct from `lastEvaluatedAt`, which by
80
+ * design only advances on a successful evaluation.
81
+ */
82
+ lastErrorAt: string | null;
83
+ /**
84
+ * Consecutive failed evaluations; `0` means healthy. A run length, not a
85
+ * total — the first successful query execution resets it.
86
+ */
87
+ consecutiveFailures: number;
72
88
  /** User ID who created the alert */
73
89
  createdBy: string;
74
90
  /** ISO timestamp of creation */