@centrali-io/centrali-sdk 6.6.0 → 6.7.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/dist/index.d.ts CHANGED
@@ -285,6 +285,11 @@ declare function getAllowedDomainsApiPath(workspaceId: string, domainId?: string
285
285
  * Generate Webhook Subscriptions API URL PATH.
286
286
  */
287
287
  declare function getWebhookSubscriptionsApiPath(workspaceId: string, subscriptionId?: string): string;
288
+ /**
289
+ * Generate the payload-versions API URL PATH. Lists the outbound payload
290
+ * versions a subscription can be pinned to.
291
+ */
292
+ declare function getWebhookPayloadVersionsApiPath(workspaceId: string): string;
288
293
  /**
289
294
  * Generate rotate-secret API URL PATH for a webhook subscription.
290
295
  */
@@ -2339,6 +2344,8 @@ interface FunctionRun {
2339
2344
  triggerType?: string | null;
2340
2345
  orchestrationRunId?: string | null;
2341
2346
  orchestrationStepId?: string | null;
2347
+ /** Inbound durable buffer link (CEN-1297) — set for buffered webhook-trigger runs. */
2348
+ inboundEventId?: string | null;
2342
2349
  originalRunId?: string | null;
2343
2350
  isRerun: boolean;
2344
2351
  rerunCount: number;
@@ -2693,6 +2700,20 @@ interface WebhookSubscription {
2693
2700
  * undefined on subsequent reads so it is safe to pass subscriptions around.
2694
2701
  */
2695
2702
  secret?: string;
2703
+ /**
2704
+ * Outbound payload version this subscription receives — a date-string
2705
+ * (`YYYY-MM`). Deliveries are projected into the shape this version
2706
+ * describes. Frozen at creation; change it to upgrade to a newer shape.
2707
+ */
2708
+ payloadVersion: string;
2709
+ /**
2710
+ * Opaque builder-supplied tenant identifier. Carried onto outbound
2711
+ * delivery rows by the platform so embeds and tenant-scoped views can
2712
+ * filter to a single customer without leaking cross-tenant events.
2713
+ * Centrali never parses or interprets this value — it's the builder's
2714
+ * own customer/account/workspace id, whatever shape that takes.
2715
+ */
2716
+ tenantId?: string | null;
2696
2717
  workspaceSlug: string;
2697
2718
  createdAt?: string;
2698
2719
  updatedAt?: string;
@@ -2716,6 +2737,8 @@ interface WebhookDelivery {
2716
2737
  responseBody?: string | null;
2717
2738
  /** Delivery ID the row was replayed from, or null for original deliveries. */
2718
2739
  replayedFrom?: string | null;
2740
+ /** Outbound payload version this delivery was projected into and served with. */
2741
+ payloadVersion: string;
2719
2742
  createdAt: string;
2720
2743
  updatedAt: string;
2721
2744
  }
@@ -2732,6 +2755,19 @@ interface CreateWebhookSubscriptionInput {
2732
2755
  /** Optional — restrict to a subset of collections. Omit for all collections. */
2733
2756
  recordSlugs?: string[];
2734
2757
  active?: boolean;
2758
+ /**
2759
+ * Optional outbound payload version to pin the subscription to. Omit to
2760
+ * freeze to the latest version at creation time. Must be a value returned
2761
+ * by `getPayloadVersions()`.
2762
+ */
2763
+ payloadVersion?: string;
2764
+ /**
2765
+ * Optional opaque tenant identifier — typically the builder's own
2766
+ * customer or account id. Surfaces on every delivery the subscription
2767
+ * produces so tenant-scoped views (e.g. an embedded Event Log) can
2768
+ * filter to one customer.
2769
+ */
2770
+ tenantId?: string | null;
2735
2771
  }
2736
2772
  interface UpdateWebhookSubscriptionInput {
2737
2773
  name?: string;
@@ -2744,6 +2780,26 @@ interface UpdateWebhookSubscriptionInput {
2744
2780
  */
2745
2781
  recordSlugs?: string[];
2746
2782
  active?: boolean;
2783
+ /**
2784
+ * Upgrade (or downgrade) the outbound payload version. Must be a value
2785
+ * returned by `getPayloadVersions()`. Omit to leave the version unchanged.
2786
+ */
2787
+ payloadVersion?: string;
2788
+ /**
2789
+ * Update the opaque tenant identifier. Pass `null` to clear it; omit to
2790
+ * leave it unchanged. Past deliveries are not retroactively rewritten —
2791
+ * the new value applies to deliveries created after the update.
2792
+ */
2793
+ tenantId?: string | null;
2794
+ }
2795
+ /**
2796
+ * Outbound payload versions a subscription can be pinned to. Returned by
2797
+ * `getPayloadVersions()`. `versions` is oldest-first; `latest` is what a
2798
+ * subscription created without an explicit version is frozen to.
2799
+ */
2800
+ interface WebhookPayloadVersions {
2801
+ versions: string[];
2802
+ latest: string;
2747
2803
  }
2748
2804
  interface ListWebhookDeliveriesOptions {
2749
2805
  status?: WebhookDeliveryStatus;
@@ -5112,6 +5168,18 @@ declare class WebhookSubscriptionsManager {
5112
5168
  * capture it before closing the response.
5113
5169
  */
5114
5170
  rotateSecret(subscriptionId: string): Promise<ApiResponse<WebhookSubscription>>;
5171
+ /**
5172
+ * List the outbound payload versions a subscription can be pinned to via
5173
+ * `create`/`update`'s `payloadVersion`. Each version selects the shape its
5174
+ * deliveries are projected into; subscribers upgrade on their own timeline.
5175
+ *
5176
+ * @example
5177
+ * ```ts
5178
+ * const { data } = await centrali.webhookSubscriptions.getPayloadVersions();
5179
+ * console.log('Latest payload version:', data.latest);
5180
+ * ```
5181
+ */
5182
+ getPayloadVersions(): Promise<ApiResponse<WebhookPayloadVersions>>;
5115
5183
  }
5116
5184
 
5117
5185
  /** Mirror of `@centrali/query`'s `ValidateOptions`. */
@@ -6058,4 +6126,4 @@ declare class CentraliSDK {
6058
6126
  checkAuthorization(options: CheckAuthorizationOptions): Promise<ApiResponse<AuthorizationResult>>;
6059
6127
  }
6060
6128
 
6061
- export { type AcceptSuggestionResult, type AddAllowedDomainOptions, type AllowedDomain, type AllowedDomainsListResponse, AllowedDomainsManager, type AnomalyAnalysisResult, type AnomalyDetectionData, type AnomalyEventType, type AnomalyInsight, type AnomalyInsightData, AnomalyInsightsManager, type ApiResponse, type ArrayPropertyDefinition, AuditLogManager, type AuthorizationResult, type BasePropertyDefinition, type BatchScanResult, type BatchScanStatus, type BooleanPropertyDefinition, type BulkOperationResult, CANONICAL_OPERATORS, type CanonicalOperator, CentraliError, CentraliSDK, type CentraliSDKOptions, type CheckAuthorizationOptions, CollectionsManager, type ComputeEventType, type ComputeFunction, ComputeFunctionsManager, type ComputeJobStatus, type ComputeJobStatusResponse, type ConditionOperator, type CreateComputeFunctionInput, type CreateOrchestrationInput, type CreateSmartQueryInput, type CreateStructureInput, type CreateTriggerInput, type CreateWebhookSubscriptionInput, type DateTimePropertyDefinition, type DateWindowOption, type DeleteRecordOptions, type EndpointResponse, type ExecuteSavedQueryValues, type ExecuteSmartQueryOptions, type ExpandOptions, type FieldCondition, type FieldConditionMap, type FileMetadata, FilesManager, type FilterOperators, type FilterValue, type FunctionMemoryUsage, type FunctionRun, type FunctionRunError, type FunctionRunExecutionSource, type FunctionRunStatus, FunctionRunsManager, type FunctionTrigger, type GetRecordOptions, type IncludeClause, type InsightSeverity, type InsightStatus, type InsightType, type InsightsSummary, type InvokeEndpointOptions, type InvokeTriggerOptions, JOINS_MAX_LENGTH, type JoinClause, type JoinType, type LegacyTranslateOptions, type LegacyTranslateResult, type LegacyTranslateWarning, type ListAllTriggersOptions, type ListCollectionsOptions, type ListComputeFunctionsOptions, type ListFunctionRunsOptions, type ListInsightsOptions, type ListOrchestrationRunsOptions, type ListOrchestrationsOptions, type ListSmartQueryOptions, type ListStructuresOptions, type ListValidationSuggestionsOptions, type ListWebhookDeliveriesOptions, type NumberPropertyDefinition, OPERATOR_METADATA, type ObjectPropertyDefinition, type OperatorMeta, type OperatorTypeApplicability, type OperatorValueShape, type Orchestration, type OrchestrationCaseEvaluation, type OrchestrationCondition, type OrchestrationConditionEvaluation, type OrchestrationDecisionCase, type OrchestrationDecisionResult, type OrchestrationDelayConfig, type OrchestrationEventType, type OrchestrationFailureReason, type OrchestrationOnFailure, type OrchestrationOnSuccess, type OrchestrationRetryConfig, type OrchestrationRun, type OrchestrationRunStatus, type OrchestrationRunStep, OrchestrationRunsManager, type OrchestrationScheduleType, type OrchestrationStatus, type OrchestrationStep, type OrchestrationStepError, type OrchestrationStepStatus, type OrchestrationStepType, type OrchestrationTrigger, type OrchestrationTriggerMetadata, type OrchestrationTriggerType, OrchestrationsManager, type PageClause, type PaginatedResponse, type ParsedUrlQuery, type PropertyDefinition, type PropertyType, type QueryDefinition, type QueryError, type QueryErrorCode, type QueryExecutionMode, type QueryHttpError, type QueryHttpErrorCode, QueryManager, type QueryRecordOptions, type QueryResult, type QueryResultMeta, type QueryValidateOptions, type QueryVariableDefinition, RECORDS_PAGE_DEFAULT_LIMIT, RECORDS_PAGE_MAX_LIMIT, type RealtimeAnomalyDetectionEvent, type RealtimeAnomalyInsightEvent, type RealtimeCloseEvent, type RealtimeError, type RealtimeEvent, type RealtimeEventType, type RealtimeFunctionRunEvent, RealtimeManager, type RealtimeOrchestrationRunEvent, type RealtimeRecordEvent, type RealtimeSubscribeOptions, type RealtimeSubscription, type RealtimeValidationBatchEvent, type RealtimeValidationSuggestionEvent, type RecordEventType, RecordEvents, type RecordTtlOptions, RecordsManager, type ReferencePropertyDefinition, type ResourceCategory, type SavedQueryDefinition, type SavedQueryScalarBinding, type ScalarValue, type SchemaDiscoveryMode, type SearchHit, type SearchOptions, type SearchResponse, type SelectClause, SmartQueriesManager, type SmartQuery, type SmartQueryDefinition, type SmartQueryExecuteResult, type SmartQueryFieldCondition, type SmartQueryJoin, type SmartQuerySort, type SmartQueryWhereClause, type SortClause, type StepEncryptedParam, type StringPropertyDefinition, type Structure, StructuresManager, type TestComputeFunctionInput, type TestComputeFunctionResult, type TestSmartQueryInput, type TextSearchClause, type TriggerExecutionType, type TriggerHealthMetrics, type TriggerHealthStatus, type TriggerInvokeResponse, type TriggerOrchestrationRunOptions, type TriggerScanOptions, type TriggerWithHealth, TriggersManager, type UpdateComputeFunctionInput, type UpdateOrchestrationInput, type UpdateSmartQueryInput, type UpdateStructureInput, type UpdateTriggerInput, type UpdateWebhookSubscriptionInput, type UrlParserOptions, type ValidateStructureInput, type ValidationBatchData, type ValidationEventType, type ValidationIssueType, ValidationManager, type ValidationResult, type ValidationSuggestion, type ValidationSuggestionData, type ValidationSuggestionStatus, type ValidationSummary, type VariableType, type WaitForScanOptions, type WebhookCancelResponse, type WebhookDeliveriesListMeta, type WebhookDelivery, type WebhookDeliveryStatus, type WebhookDeliverySummary, type WebhookReplayResponse, type WebhookSubscription, WebhookSubscriptionsManager, type WhereExpression, fetchClientToken, getAllowedDomainsApiPath, getAnomalyAnalysisTriggerApiPath, getAnomalyInsightAcknowledgeApiPath, getAnomalyInsightDismissApiPath, getAnomalyInsightsApiPath, getAnomalyInsightsBulkAcknowledgeApiPath, getAnomalyInsightsSummaryApiPath, getApiUrl, getAuthUrl, getCollectionBySlugApiPath, getCollectionInsightsApiPath, getCollectionValidateApiPath, getCollectionsApiPath, getComputeFunctionTestApiPath, getComputeFunctionsApiPath, getComputeJobStatusApiPath, getEndpointApiPath, getFileUploadApiPath, getFilesCanonicalApiPath, getFunctionRunsApiPath, getFunctionRunsByFunctionApiPath, getFunctionRunsByTriggerApiPath, getFunctionTriggerExecuteApiPath, getFunctionTriggerPauseApiPath, getFunctionTriggerResumeApiPath, getFunctionTriggersApiPath, getOrchestrationRunStepsApiPath, getOrchestrationRunsApiPath, getOrchestrationRunsCanonicalApiPath, getOrchestrationsApiPath, getRealtimeUrl, getRecordApiPath, getSavedQueryCanonicalByIdPath, getSavedQueryCanonicalCollectionPath, getSavedQueryCanonicalExecutePath, getSavedQueryCanonicalTestPath, getSearchApiPath, getSmartQueriesApiPath, getSmartQueriesStructureApiPath, getSmartQueryByNameApiPath, getSmartQueryExecuteApiPath, getSmartQueryTestApiPath, getStructureBySlugApiPath, getStructureInsightsApiPath, getStructureValidateApiPath, getStructuresApiPath, getValidationBulkAcceptApiPath, getValidationBulkRejectApiPath, getValidationPendingCountApiPath, getValidationRecordSuggestionsApiPath, getValidationScanApiPath, getValidationSuggestionAcceptApiPath, getValidationSuggestionRejectApiPath, getValidationSuggestionsApiPath, getValidationSummaryApiPath, getWebhookDeliveryCancelApiPath, getWebhookDeliveryRetryApiPath, getWebhookSubscriptionDeliveriesApiPath, getWebhookSubscriptionRotateSecretApiPath, getWebhookSubscriptionsApiPath, isCentraliError, operatorsForFieldType };
6129
+ export { type AcceptSuggestionResult, type AddAllowedDomainOptions, type AllowedDomain, type AllowedDomainsListResponse, AllowedDomainsManager, type AnomalyAnalysisResult, type AnomalyDetectionData, type AnomalyEventType, type AnomalyInsight, type AnomalyInsightData, AnomalyInsightsManager, type ApiResponse, type ArrayPropertyDefinition, AuditLogManager, type AuthorizationResult, type BasePropertyDefinition, type BatchScanResult, type BatchScanStatus, type BooleanPropertyDefinition, type BulkOperationResult, CANONICAL_OPERATORS, type CanonicalOperator, CentraliError, CentraliSDK, type CentraliSDKOptions, type CheckAuthorizationOptions, CollectionsManager, type ComputeEventType, type ComputeFunction, ComputeFunctionsManager, type ComputeJobStatus, type ComputeJobStatusResponse, type ConditionOperator, type CreateComputeFunctionInput, type CreateOrchestrationInput, type CreateSmartQueryInput, type CreateStructureInput, type CreateTriggerInput, type CreateWebhookSubscriptionInput, type DateTimePropertyDefinition, type DateWindowOption, type DeleteRecordOptions, type EndpointResponse, type ExecuteSavedQueryValues, type ExecuteSmartQueryOptions, type ExpandOptions, type FieldCondition, type FieldConditionMap, type FileMetadata, FilesManager, type FilterOperators, type FilterValue, type FunctionMemoryUsage, type FunctionRun, type FunctionRunError, type FunctionRunExecutionSource, type FunctionRunStatus, FunctionRunsManager, type FunctionTrigger, type GetRecordOptions, type IncludeClause, type InsightSeverity, type InsightStatus, type InsightType, type InsightsSummary, type InvokeEndpointOptions, type InvokeTriggerOptions, JOINS_MAX_LENGTH, type JoinClause, type JoinType, type LegacyTranslateOptions, type LegacyTranslateResult, type LegacyTranslateWarning, type ListAllTriggersOptions, type ListCollectionsOptions, type ListComputeFunctionsOptions, type ListFunctionRunsOptions, type ListInsightsOptions, type ListOrchestrationRunsOptions, type ListOrchestrationsOptions, type ListSmartQueryOptions, type ListStructuresOptions, type ListValidationSuggestionsOptions, type ListWebhookDeliveriesOptions, type NumberPropertyDefinition, OPERATOR_METADATA, type ObjectPropertyDefinition, type OperatorMeta, type OperatorTypeApplicability, type OperatorValueShape, type Orchestration, type OrchestrationCaseEvaluation, type OrchestrationCondition, type OrchestrationConditionEvaluation, type OrchestrationDecisionCase, type OrchestrationDecisionResult, type OrchestrationDelayConfig, type OrchestrationEventType, type OrchestrationFailureReason, type OrchestrationOnFailure, type OrchestrationOnSuccess, type OrchestrationRetryConfig, type OrchestrationRun, type OrchestrationRunStatus, type OrchestrationRunStep, OrchestrationRunsManager, type OrchestrationScheduleType, type OrchestrationStatus, type OrchestrationStep, type OrchestrationStepError, type OrchestrationStepStatus, type OrchestrationStepType, type OrchestrationTrigger, type OrchestrationTriggerMetadata, type OrchestrationTriggerType, OrchestrationsManager, type PageClause, type PaginatedResponse, type ParsedUrlQuery, type PropertyDefinition, type PropertyType, type QueryDefinition, type QueryError, type QueryErrorCode, type QueryExecutionMode, type QueryHttpError, type QueryHttpErrorCode, QueryManager, type QueryRecordOptions, type QueryResult, type QueryResultMeta, type QueryValidateOptions, type QueryVariableDefinition, RECORDS_PAGE_DEFAULT_LIMIT, RECORDS_PAGE_MAX_LIMIT, type RealtimeAnomalyDetectionEvent, type RealtimeAnomalyInsightEvent, type RealtimeCloseEvent, type RealtimeError, type RealtimeEvent, type RealtimeEventType, type RealtimeFunctionRunEvent, RealtimeManager, type RealtimeOrchestrationRunEvent, type RealtimeRecordEvent, type RealtimeSubscribeOptions, type RealtimeSubscription, type RealtimeValidationBatchEvent, type RealtimeValidationSuggestionEvent, type RecordEventType, RecordEvents, type RecordTtlOptions, RecordsManager, type ReferencePropertyDefinition, type ResourceCategory, type SavedQueryDefinition, type SavedQueryScalarBinding, type ScalarValue, type SchemaDiscoveryMode, type SearchHit, type SearchOptions, type SearchResponse, type SelectClause, SmartQueriesManager, type SmartQuery, type SmartQueryDefinition, type SmartQueryExecuteResult, type SmartQueryFieldCondition, type SmartQueryJoin, type SmartQuerySort, type SmartQueryWhereClause, type SortClause, type StepEncryptedParam, type StringPropertyDefinition, type Structure, StructuresManager, type TestComputeFunctionInput, type TestComputeFunctionResult, type TestSmartQueryInput, type TextSearchClause, type TriggerExecutionType, type TriggerHealthMetrics, type TriggerHealthStatus, type TriggerInvokeResponse, type TriggerOrchestrationRunOptions, type TriggerScanOptions, type TriggerWithHealth, TriggersManager, type UpdateComputeFunctionInput, type UpdateOrchestrationInput, type UpdateSmartQueryInput, type UpdateStructureInput, type UpdateTriggerInput, type UpdateWebhookSubscriptionInput, type UrlParserOptions, type ValidateStructureInput, type ValidationBatchData, type ValidationEventType, type ValidationIssueType, ValidationManager, type ValidationResult, type ValidationSuggestion, type ValidationSuggestionData, type ValidationSuggestionStatus, type ValidationSummary, type VariableType, type WaitForScanOptions, type WebhookCancelResponse, type WebhookDeliveriesListMeta, type WebhookDelivery, type WebhookDeliveryStatus, type WebhookDeliverySummary, type WebhookPayloadVersions, type WebhookReplayResponse, type WebhookSubscription, WebhookSubscriptionsManager, type WhereExpression, fetchClientToken, getAllowedDomainsApiPath, getAnomalyAnalysisTriggerApiPath, getAnomalyInsightAcknowledgeApiPath, getAnomalyInsightDismissApiPath, getAnomalyInsightsApiPath, getAnomalyInsightsBulkAcknowledgeApiPath, getAnomalyInsightsSummaryApiPath, getApiUrl, getAuthUrl, getCollectionBySlugApiPath, getCollectionInsightsApiPath, getCollectionValidateApiPath, getCollectionsApiPath, getComputeFunctionTestApiPath, getComputeFunctionsApiPath, getComputeJobStatusApiPath, getEndpointApiPath, getFileUploadApiPath, getFilesCanonicalApiPath, getFunctionRunsApiPath, getFunctionRunsByFunctionApiPath, getFunctionRunsByTriggerApiPath, getFunctionTriggerExecuteApiPath, getFunctionTriggerPauseApiPath, getFunctionTriggerResumeApiPath, getFunctionTriggersApiPath, getOrchestrationRunStepsApiPath, getOrchestrationRunsApiPath, getOrchestrationRunsCanonicalApiPath, getOrchestrationsApiPath, getRealtimeUrl, getRecordApiPath, getSavedQueryCanonicalByIdPath, getSavedQueryCanonicalCollectionPath, getSavedQueryCanonicalExecutePath, getSavedQueryCanonicalTestPath, getSearchApiPath, getSmartQueriesApiPath, getSmartQueriesStructureApiPath, getSmartQueryByNameApiPath, getSmartQueryExecuteApiPath, getSmartQueryTestApiPath, getStructureBySlugApiPath, getStructureInsightsApiPath, getStructureValidateApiPath, getStructuresApiPath, getValidationBulkAcceptApiPath, getValidationBulkRejectApiPath, getValidationPendingCountApiPath, getValidationRecordSuggestionsApiPath, getValidationScanApiPath, getValidationSuggestionAcceptApiPath, getValidationSuggestionRejectApiPath, getValidationSuggestionsApiPath, getValidationSummaryApiPath, getWebhookDeliveryCancelApiPath, getWebhookDeliveryRetryApiPath, getWebhookPayloadVersionsApiPath, getWebhookSubscriptionDeliveriesApiPath, getWebhookSubscriptionRotateSecretApiPath, getWebhookSubscriptionsApiPath, isCentraliError, operatorsForFieldType };
package/dist/index.js CHANGED
@@ -150,6 +150,7 @@ __export(index_exports, {
150
150
  getValidationSummaryApiPath: () => getValidationSummaryApiPath,
151
151
  getWebhookDeliveryCancelApiPath: () => getWebhookDeliveryCancelApiPath,
152
152
  getWebhookDeliveryRetryApiPath: () => getWebhookDeliveryRetryApiPath,
153
+ getWebhookPayloadVersionsApiPath: () => getWebhookPayloadVersionsApiPath,
153
154
  getWebhookSubscriptionDeliveriesApiPath: () => getWebhookSubscriptionDeliveriesApiPath,
154
155
  getWebhookSubscriptionRotateSecretApiPath: () => getWebhookSubscriptionRotateSecretApiPath,
155
156
  getWebhookSubscriptionsApiPath: () => getWebhookSubscriptionsApiPath,
@@ -385,6 +386,9 @@ function getWebhookSubscriptionsApiPath(workspaceId, subscriptionId) {
385
386
  const basePath = `data/workspace/${workspaceId}/api/v1/webhook-subscriptions`;
386
387
  return subscriptionId ? `${basePath}/${subscriptionId}` : basePath;
387
388
  }
389
+ function getWebhookPayloadVersionsApiPath(workspaceId) {
390
+ return `data/workspace/${workspaceId}/api/v1/webhook-subscriptions/payload-versions`;
391
+ }
388
392
  function getWebhookSubscriptionRotateSecretApiPath(workspaceId, subscriptionId) {
389
393
  return `data/workspace/${workspaceId}/api/v1/webhook-subscriptions/${subscriptionId}/rotate-secret`;
390
394
  }
@@ -7999,6 +8003,21 @@ var WebhookSubscriptionsManager = class {
7999
8003
  const path = getWebhookSubscriptionRotateSecretApiPath(this.workspaceId, subscriptionId);
8000
8004
  return this.requestFn("POST", path);
8001
8005
  }
8006
+ /**
8007
+ * List the outbound payload versions a subscription can be pinned to via
8008
+ * `create`/`update`'s `payloadVersion`. Each version selects the shape its
8009
+ * deliveries are projected into; subscribers upgrade on their own timeline.
8010
+ *
8011
+ * @example
8012
+ * ```ts
8013
+ * const { data } = await centrali.webhookSubscriptions.getPayloadVersions();
8014
+ * console.log('Latest payload version:', data.latest);
8015
+ * ```
8016
+ */
8017
+ getPayloadVersions() {
8018
+ const path = getWebhookPayloadVersionsApiPath(this.workspaceId);
8019
+ return this.requestFn("GET", path);
8020
+ }
8002
8021
  };
8003
8022
 
8004
8023
  // src/client.ts
@@ -9315,6 +9334,7 @@ var CentraliSDK = class {
9315
9334
  getValidationSummaryApiPath,
9316
9335
  getWebhookDeliveryCancelApiPath,
9317
9336
  getWebhookDeliveryRetryApiPath,
9337
+ getWebhookPayloadVersionsApiPath,
9318
9338
  getWebhookSubscriptionDeliveriesApiPath,
9319
9339
  getWebhookSubscriptionRotateSecretApiPath,
9320
9340
  getWebhookSubscriptionsApiPath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@centrali-io/centrali-sdk",
3
- "version": "6.6.0",
3
+ "version": "6.7.0",
4
4
  "description": "Centrali Node SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -424,6 +424,14 @@ export function getWebhookSubscriptionsApiPath(workspaceId: string, subscription
424
424
  return subscriptionId ? `${basePath}/${subscriptionId}` : basePath;
425
425
  }
426
426
 
427
+ /**
428
+ * Generate the payload-versions API URL PATH. Lists the outbound payload
429
+ * versions a subscription can be pinned to.
430
+ */
431
+ export function getWebhookPayloadVersionsApiPath(workspaceId: string): string {
432
+ return `data/workspace/${workspaceId}/api/v1/webhook-subscriptions/payload-versions`;
433
+ }
434
+
427
435
  /**
428
436
  * Generate rotate-secret API URL PATH for a webhook subscription.
429
437
  */
@@ -11,12 +11,14 @@ import type {
11
11
  WebhookDeliveriesListMeta,
12
12
  WebhookReplayResponse,
13
13
  WebhookCancelResponse,
14
+ WebhookPayloadVersions,
14
15
  CreateWebhookSubscriptionInput,
15
16
  UpdateWebhookSubscriptionInput,
16
17
  ListWebhookDeliveriesOptions,
17
18
  } from '../types/webhooks';
18
19
  import {
19
20
  getWebhookSubscriptionsApiPath,
21
+ getWebhookPayloadVersionsApiPath,
20
22
  getWebhookSubscriptionRotateSecretApiPath,
21
23
  getWebhookSubscriptionDeliveriesApiPath,
22
24
  getWebhookDeliveryRetryApiPath,
@@ -203,4 +205,20 @@ export class WebhookSubscriptionsManager {
203
205
  const path = getWebhookSubscriptionRotateSecretApiPath(this.workspaceId, subscriptionId);
204
206
  return this.requestFn<WebhookSubscription>('POST', path);
205
207
  }
208
+
209
+ /**
210
+ * List the outbound payload versions a subscription can be pinned to via
211
+ * `create`/`update`'s `payloadVersion`. Each version selects the shape its
212
+ * deliveries are projected into; subscribers upgrade on their own timeline.
213
+ *
214
+ * @example
215
+ * ```ts
216
+ * const { data } = await centrali.webhookSubscriptions.getPayloadVersions();
217
+ * console.log('Latest payload version:', data.latest);
218
+ * ```
219
+ */
220
+ public getPayloadVersions(): Promise<ApiResponse<WebhookPayloadVersions>> {
221
+ const path = getWebhookPayloadVersionsApiPath(this.workspaceId);
222
+ return this.requestFn<WebhookPayloadVersions>('GET', path);
223
+ }
206
224
  }
@@ -102,6 +102,8 @@ export interface FunctionRun {
102
102
  triggerType?: string | null;
103
103
  orchestrationRunId?: string | null;
104
104
  orchestrationStepId?: string | null;
105
+ /** Inbound durable buffer link (CEN-1297) — set for buffered webhook-trigger runs. */
106
+ inboundEventId?: string | null;
105
107
  originalRunId?: string | null;
106
108
  isRerun: boolean;
107
109
  rerunCount: number;
@@ -22,6 +22,20 @@ export interface WebhookSubscription {
22
22
  * undefined on subsequent reads so it is safe to pass subscriptions around.
23
23
  */
24
24
  secret?: string;
25
+ /**
26
+ * Outbound payload version this subscription receives — a date-string
27
+ * (`YYYY-MM`). Deliveries are projected into the shape this version
28
+ * describes. Frozen at creation; change it to upgrade to a newer shape.
29
+ */
30
+ payloadVersion: string;
31
+ /**
32
+ * Opaque builder-supplied tenant identifier. Carried onto outbound
33
+ * delivery rows by the platform so embeds and tenant-scoped views can
34
+ * filter to a single customer without leaking cross-tenant events.
35
+ * Centrali never parses or interprets this value — it's the builder's
36
+ * own customer/account/workspace id, whatever shape that takes.
37
+ */
38
+ tenantId?: string | null;
25
39
  workspaceSlug: string;
26
40
  createdAt?: string;
27
41
  updatedAt?: string;
@@ -46,6 +60,8 @@ export interface WebhookDelivery {
46
60
  responseBody?: string | null;
47
61
  /** Delivery ID the row was replayed from, or null for original deliveries. */
48
62
  replayedFrom?: string | null;
63
+ /** Outbound payload version this delivery was projected into and served with. */
64
+ payloadVersion: string;
49
65
  createdAt: string;
50
66
  updatedAt: string;
51
67
  }
@@ -64,6 +80,19 @@ export interface CreateWebhookSubscriptionInput {
64
80
  /** Optional — restrict to a subset of collections. Omit for all collections. */
65
81
  recordSlugs?: string[];
66
82
  active?: boolean;
83
+ /**
84
+ * Optional outbound payload version to pin the subscription to. Omit to
85
+ * freeze to the latest version at creation time. Must be a value returned
86
+ * by `getPayloadVersions()`.
87
+ */
88
+ payloadVersion?: string;
89
+ /**
90
+ * Optional opaque tenant identifier — typically the builder's own
91
+ * customer or account id. Surfaces on every delivery the subscription
92
+ * produces so tenant-scoped views (e.g. an embedded Event Log) can
93
+ * filter to one customer.
94
+ */
95
+ tenantId?: string | null;
67
96
  }
68
97
 
69
98
  export interface UpdateWebhookSubscriptionInput {
@@ -77,6 +106,27 @@ export interface UpdateWebhookSubscriptionInput {
77
106
  */
78
107
  recordSlugs?: string[];
79
108
  active?: boolean;
109
+ /**
110
+ * Upgrade (or downgrade) the outbound payload version. Must be a value
111
+ * returned by `getPayloadVersions()`. Omit to leave the version unchanged.
112
+ */
113
+ payloadVersion?: string;
114
+ /**
115
+ * Update the opaque tenant identifier. Pass `null` to clear it; omit to
116
+ * leave it unchanged. Past deliveries are not retroactively rewritten —
117
+ * the new value applies to deliveries created after the update.
118
+ */
119
+ tenantId?: string | null;
120
+ }
121
+
122
+ /**
123
+ * Outbound payload versions a subscription can be pinned to. Returned by
124
+ * `getPayloadVersions()`. `versions` is oldest-first; `latest` is what a
125
+ * subscription created without an explicit version is frozen to.
126
+ */
127
+ export interface WebhookPayloadVersions {
128
+ versions: string[];
129
+ latest: string;
80
130
  }
81
131
 
82
132
  export interface ListWebhookDeliveriesOptions {