@agentforge-io/sdk-server 4.78.0 → 4.80.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
@@ -6,7 +6,7 @@ export { BillingResource } from './resources/billing';
6
6
  export type { BillingCurrency, BillingEntitlement, BillingEntitlementStatus, BillingInterval, BillingLimits, BillingPlan, BillingInvoice, BillingInvoicePage, BillingInvoicesQuery, BillingPaymentMethod, BillingCheckoutInput, BillingStartTrialInput, AppBillingWebhookEvent, AppBillingWebhookEventName, AppBillingWebhookData, } from './resources/billing';
7
7
  export { APP_WEBHOOK_HEADERS, TOOL_CALLBACK_HEADERS, ToolCallbackSignatureError, signToolCallbackPayload, verifyAppWebhook, verifyToolCallbackSignature, } from './webhooks';
8
8
  export { WebhookResource, type SetAppWebhookInput } from './resources/webhook';
9
- export type { AppWebhook, AppWebhookEvent, AppWebhookEventName, AppCaseWebhookEvent, AppCaseWebhookEventName, AppConversationMessageWebhookEvent, AppChannelStatusWebhookEvent, AgentMe, AgentSummary, AppUserConnectorStatus, ApprovalCopyBundle, ChannelContext, ChatStreamChunk, ChatStreamEvent, ChatTokenRecord, ConnectorDefaultsResult, ConnectorDefaultsSource, ConnectorResourceItem, ConnectorStatus, ConnectorToolInfo, ConversationHistory, ConversationStatus, CreateAgentInput, CreateClickupTaskInput, CreateClickupTaskResult, ExternalToolSummary, IssueChatTokenInput, ListAgentsResult, ListConnectorResourcesResult, McpServerConfig, MessageRecord, MessageRole, PublicAppBranding, PublicProfileBlock, PublicProfileTemplate, PublicTeamLanding, CreateTeamInput, UpdateTeamInput, TeamSummary, TeamDetail, TeamTheme, TeamBusinessHours, TeamWeekday, TeamProfileBlock, ProfileBlockPlacement, ProfileBlockPosition, CatalogBlockPreview, ServiceCta, ServiceCtaAction, CatalogServicesBlockConfig, AppInstallation, TemplateConfigField, TemplateSummary, TemplateDetail, TemplateInstallStats, TemplatePublisher, TemplateAuthor, AppTemplatePolicy, TemplateCategoryRef, MarketplaceCategory, MarketplaceCategoryGroup, MarketplaceLocale, TemplateInstallResult, CheckSystemTemplateResult, TemplatePublishIssue, UpsertSystemTemplateInput, UpsertSystemTemplateResult, TemplateReview, TemplateRatingSummary, TemplateReviewsPage, BusinessReview, BusinessReviewsPage, ProductRatingSummary, ProductReview, ProductReviewOwner, ProductReviewsPage, ProductReviewsOwnerPage, ListProductReviewsInput, ListProductReviewsForOwnerInput, HideProductReviewInput, ProductLikeResult, ReceiptReviewable, ReceiptReviewables, SaveReceiptReviewInput, ListTemplateReviewsInput, SaveTemplateReviewInput, TemplateReportKind, CreateTemplateReportInput, TenantConfigEntry, Place, PlaceSuggestion, SearchPlacesInput, AutocompletePlacesInput, PlacesScope, CaseField, CaseBusinessState, CaseType, CaseState, CaseStateType, CasePayment, CasePaymentAccount, CasePaymentStatus, CaseReceiptPayment, CaseDestination, CaseView, CaseStateStep, CreateDirectOrderInput, CreateOpenOrderInput, OpenOrderFreeLine, OpenOrderLineMark, OpenOrderPayment, CreateDirectBookingInput, MoveCaseSlotInput, CaseSlot, CatalogAttendedAt, CatalogBookingRule, CaseOrigin, CaseOriginChannel, DirectOrderForm, DirectPaymentOption, CaseClosingMethod, CaseClosingOrder, CaseClosingReport, CaseReportPage, CaseReceipt, CaseReceiptLine, CaseProposal, CaseProposalAnswer, CaseProposalChange, CaseProposalInput, ListCasesInput, AddressValue, DeliveryLocalPricing, DeliverySettings, PaymentMethodKind, PaymentSettings, PaymentSettingsInput, PaymentAccount, PaymentCountry, PaymentFieldDef, PaymentMethodDef, StructuredConfigInput, StructuredConfigEntry, DeliveryQuoteStatus, DeliveryQuoteInput, DeliveryPricePreview, DeliveryPricingPreview, DeliveryPricingPreviewInput, DeliveryRoute, DeliveryRouteInput, DeliveryQuote, AppSelf, AppOwner, AppSelfConnector, AppSelfConnectors, AppSelfConnectorTools, AppSelfConnectorToolsResponse, RegisterToolInput, RegisterToolsInput, BusinessRoleEntry, Catalog, CatalogCheckoutCta, CatalogCategory, CatalogProduct, CatalogProductPhoto, CatalogProductKind, CatalogProductStatus, CatalogPriceKind, CatalogAvailability, CatalogLockableField, CatalogProductPage, UpsertCatalogInput, CreateCatalogCategoryInput, ListCatalogCategoriesInput, UpdateCatalogCategoryInput, CreateCatalogProductInput, UpdateCatalogProductInput, ListCatalogProductsInput, CatalogPhotoUploadTarget, SignCatalogPhotoUploadInput, AttachCatalogPhotoInput, AttachCatalogCategoryImageInput, CatalogImportItem, CatalogImportPreview, CatalogImportApplyResult, CatalogFileMapping, CatalogFilePlan, CatalogFilePreview, CatalogFileApplyResult, CatalogFileInput, CatalogFilePreviewInput, CatalogMenuItem, CatalogMenuRead, CatalogMenuReadInput, CatalogMenuAttachInput, CatalogMenuChatFile, CatalogMenuKeepInSyncInput, CatalogMenuKeepInSyncResult, CatalogOption, CatalogOptionGroup, SaveCatalogOptionGroupInput, CatalogOptionChoice, CatalogOptionChange, CatalogOptionChangesPlan, CatalogUnit, SaveCatalogUnitInput, CatalogSaleRule, CatalogFileApplyInput, CatalogFileErrorCode, CatalogImportSourceStatus, CatalogImportColumnMapping, CatalogImportRunResult, CatalogImportSource, CreateCatalogImportSourceInput, UpdateCatalogImportSourceInput, PreviewCatalogImportSourceInput, CatalogImportSourcePreview, CatalogSheetTab, CatalogTemplateSheet, CreateCatalogTemplateSheetInput, ReferenceMatchItemInput, ReferenceMatchDecisionKind, ReferenceMatchCandidate, ReferenceMatchDecision, ReferenceMatchInput, ReferenceMatchResult, ReferenceProductInput, ReferenceProductsBulkInput, ReferenceProductsBulkResult, ReferenceProduct, ListReferenceProductsInput, ReferenceProductPage, GoogleSheetsPickerInput, GoogleSheetsPickerSession, GoogleSheetsPickerErrorCode, GoogleSheetsPickerResult, RegisterToolsResult, ToolCallbackPayload, ToolCallRecord, ToolPermission, ToolPermissionMode, TokenUsage, TenantSecretEntry, UpdateAgentInput, InboxThreadMode, InboxMessageDirection, InboxMessageSource, InboxMessageType, InboxThreadCustomerProfileView, InboxThreadView, InboxMessageView, SupportKpiTotals, SupportKpiResponse, AgentAttentionLogRow, } from './types';
9
+ export type { AppWebhook, AppWebhookEvent, AppWebhookEventName, AppCaseWebhookEvent, AppCaseWebhookEventName, AppConversationMessageWebhookEvent, AppChannelStatusWebhookEvent, AgentMe, AgentSummary, AppUserConnectorStatus, ApprovalCopyBundle, ChannelContext, ChatStreamChunk, ChatStreamEvent, ChatTokenRecord, ConnectorDefaultsResult, ConnectorDefaultsSource, ConnectorResourceItem, ConnectorStatus, ConnectorToolInfo, ConversationHistory, ConversationStatus, CreateAgentInput, CreateClickupTaskInput, CreateClickupTaskResult, ExternalToolSummary, IssueChatTokenInput, ListAgentsResult, ListConnectorResourcesResult, McpServerConfig, MessageRecord, MessageRole, PublicAppBranding, PublicProfileBlock, PublicProfileTemplate, PublicTeamLanding, CreateTeamInput, UpdateTeamInput, TeamSummary, TeamDetail, TeamTheme, TeamBusinessHours, TeamWeekday, TeamProfileBlock, ProfileBlockPlacement, ProfileBlockPosition, CatalogBlockPreview, ServiceCta, ServiceCtaAction, CatalogServicesBlockConfig, AppInstallation, TemplateConfigField, TemplateSummary, TemplateDetail, TemplateInstallStats, TemplatePublisher, TemplateAuthor, AppTemplatePolicy, TemplateCategoryRef, MarketplaceCategory, MarketplaceCategoryGroup, MarketplaceLocale, TemplateInstallResult, CheckSystemTemplateResult, TemplatePublishIssue, UpsertSystemTemplateInput, UpsertSystemTemplateResult, TemplateReview, TemplateRatingSummary, TemplateReviewsPage, BusinessReview, BusinessReviewsPage, ProductRatingSummary, ProductReview, ProductReviewOwner, ProductReviewsPage, ProductReviewsOwnerPage, ListProductReviewsInput, ListProductReviewsForOwnerInput, HideProductReviewInput, ProductLikeResult, ReceiptReviewable, ReceiptReviewables, SaveReceiptReviewInput, ListTemplateReviewsInput, SaveTemplateReviewInput, TemplateReportKind, CreateTemplateReportInput, TenantConfigEntry, Place, PlaceSuggestion, SearchPlacesInput, AutocompletePlacesInput, PlacesScope, CaseField, CaseBusinessState, CaseType, CaseState, CaseStateType, CasePayment, CasePaymentAccount, CasePaymentStatus, CaseReceiptPayment, CaseDestination, CaseView, CaseContactLink, CaseStateStep, CreateDirectOrderInput, CreateOpenOrderInput, OpenOrderFreeLine, OpenOrderLineMark, OpenOrderPayment, CreateDirectBookingInput, MoveCaseSlotInput, CaseSlot, CatalogAttendedAt, CatalogBookingRule, CaseOrigin, CaseOriginChannel, DirectOrderForm, DirectPaymentOption, CaseClosingMethod, CaseClosingOrder, CaseClosingReport, CaseReportPage, CaseReceipt, CaseReceiptLine, CaseProposal, CaseProposalAnswer, CaseProposalChange, CaseProposalInput, ListCasesInput, AddressValue, DeliveryLocalPricing, DeliverySettings, PaymentMethodKind, PaymentSettings, PaymentSettingsInput, PaymentAccount, PaymentCountry, PaymentFieldDef, PaymentMethodDef, StructuredConfigInput, StructuredConfigEntry, DeliveryQuoteStatus, DeliveryQuoteInput, DeliveryPricePreview, DeliveryPricingPreview, DeliveryPricingPreviewInput, DeliveryRoute, DeliveryRouteInput, DeliveryQuote, AppSelf, AppOwner, AppSelfConnector, AppSelfConnectors, AppSelfConnectorTools, AppSelfConnectorToolsResponse, RegisterToolInput, RegisterToolsInput, BusinessRoleEntry, Catalog, CatalogCheckoutCta, CatalogCategory, CatalogProduct, CatalogProductPhoto, CatalogProductKind, CatalogProductStatus, CatalogPriceKind, CatalogAvailability, CatalogLockableField, CatalogProductPage, UpsertCatalogInput, CreateCatalogCategoryInput, ListCatalogCategoriesInput, UpdateCatalogCategoryInput, CreateCatalogProductInput, UpdateCatalogProductInput, ListCatalogProductsInput, CatalogPhotoUploadTarget, SignCatalogPhotoUploadInput, AttachCatalogPhotoInput, AttachCatalogCategoryImageInput, CatalogImportItem, CatalogImportPreview, CatalogImportApplyResult, CatalogFileMapping, CatalogFilePlan, CatalogFilePreview, CatalogFileApplyResult, CatalogFileInput, CatalogFilePreviewInput, CatalogMenuItem, CatalogMenuRead, CatalogMenuReadInput, CatalogMenuAttachInput, CatalogMenuChatFile, CatalogMenuKeepInSyncInput, CatalogMenuKeepInSyncResult, CatalogOption, CatalogOptionGroup, SaveCatalogOptionGroupInput, CatalogOptionChoice, CatalogOptionChange, CatalogOptionChangesPlan, CatalogUnit, SaveCatalogUnitInput, CatalogSaleRule, CatalogFileApplyInput, CatalogFileErrorCode, CatalogImportSourceStatus, CatalogImportColumnMapping, CatalogImportRunResult, CatalogImportSource, CreateCatalogImportSourceInput, UpdateCatalogImportSourceInput, PreviewCatalogImportSourceInput, CatalogImportSourcePreview, CatalogSheetTab, CatalogTemplateSheet, CreateCatalogTemplateSheetInput, ReferenceMatchItemInput, ReferenceMatchDecisionKind, ReferenceMatchCandidate, ReferenceMatchDecision, ReferenceMatchInput, ReferenceMatchResult, ReferenceProductInput, ReferenceProductsBulkInput, ReferenceProductsBulkResult, ReferenceProduct, ListReferenceProductsInput, ReferenceProductPage, GoogleCalendarAccount, GoogleCalendarEventInput, GoogleCalendarUpsertResult, GoogleCalendarBusyInput, GoogleCalendarBusyResult, GoogleSheetsPickerInput, GoogleSheetsPickerSession, GoogleSheetsPickerErrorCode, GoogleSheetsPickerResult, RegisterToolsResult, ToolCallbackPayload, ToolCallRecord, ToolPermission, ToolPermissionMode, TokenUsage, TenantSecretEntry, UpdateAgentInput, InboxThreadMode, InboxMessageDirection, InboxMessageSource, InboxMessageType, InboxThreadCustomerProfileView, InboxThreadView, InboxMessageView, SupportKpiTotals, SupportKpiResponse, AgentAttentionLogRow, } from './types';
10
10
  export { AgentsResource } from './resources/agents';
11
11
  export { AnalyticsResource } from './resources/analytics';
12
12
  export type { GetSupportKpisInput, GetAgentAttentionLogInput, } from './resources/analytics';
@@ -1,5 +1,5 @@
1
- import type { AgentForgeClient } from '../client';
2
- import type { AppUserConnectorStatus, ConnectorDefaultsResult, ConnectorStatus, CreateClickupTaskInput, CreateClickupTaskResult, GoogleSheetsPickerInput, GoogleSheetsPickerResult, GoogleSheetsPickerSession, ListConnectorResourcesResult, ToolPermission } from '../types';
1
+ import type { AgentForgeClient, RequestOptions } from '../client';
2
+ import type { AppUserConnectorStatus, ConnectorDefaultsResult, ConnectorStatus, CreateClickupTaskInput, CreateClickupTaskResult, GoogleCalendarAccount, GoogleCalendarBusyInput, GoogleCalendarBusyResult, GoogleCalendarEventInput, GoogleCalendarUpsertResult, GoogleSheetsPickerInput, GoogleSheetsPickerResult, GoogleSheetsPickerSession, ListConnectorResourcesResult, ToolPermission } from '../types';
3
3
  export declare class ConnectorsResource {
4
4
  private readonly client;
5
5
  constructor(client: AgentForgeClient);
@@ -496,6 +496,43 @@ export declare class ConnectorsResource {
496
496
  }): Promise<{
497
497
  connectorId: string;
498
498
  }>;
499
+ private requireAppSecretFor;
500
+ /**
501
+ * `GET /app-user/connector-resources/google-calendar/account` — is this end
502
+ * user connected, with which email, and can we write? Not connected is a
503
+ * 200 with `connected: false`.
504
+ */
505
+ googleCalendarAccountForAppUser(input: {
506
+ externalUserId: string;
507
+ }, options?: Pick<RequestOptions, 'timeoutMs'>): Promise<GoogleCalendarAccount>;
508
+ /**
509
+ * `PUT /app-user/connector-resources/google-calendar/events/:eventId` —
510
+ * idempotent create-or-update of one event. `eventId` is chosen by the
511
+ * caller (stable per booking) so retries never duplicate.
512
+ */
513
+ googleCalendarUpsertEventForAppUser(eventId: string, input: {
514
+ externalUserId: string;
515
+ calendarId?: string;
516
+ event: GoogleCalendarEventInput;
517
+ }, options?: Pick<RequestOptions, 'timeoutMs'>): Promise<GoogleCalendarUpsertResult>;
518
+ /**
519
+ * `DELETE /app-user/connector-resources/google-calendar/events/:eventId` —
520
+ * removes the event. An event already gone at Google answers
521
+ * `{ deleted: false }` (200), not an error.
522
+ */
523
+ googleCalendarDeleteEventForAppUser(eventId: string, input: {
524
+ externalUserId: string;
525
+ calendarId?: string;
526
+ }, options?: Pick<RequestOptions, 'timeoutMs'>): Promise<{
527
+ deleted: boolean;
528
+ }>;
529
+ /**
530
+ * `POST /app-user/connector-resources/google-calendar/busy` — busy
531
+ * intervals of the end user's calendar in `[timeMin, timeMax]` (≤ 62 days).
532
+ * `excludePrivateProperty` is a property NAME: events carrying it, whatever
533
+ * its value, are left out (the ones we wrote ourselves). Pass `{ timeoutMs }` for a latency budget.
534
+ */
535
+ googleCalendarBusyForAppUser(input: GoogleCalendarBusyInput, options?: Pick<RequestOptions, 'timeoutMs'>): Promise<GoogleCalendarBusyResult>;
499
536
  }
500
537
  /** Who answers a channel: `agent` (the AI) or `human` (only people). */
501
538
  export type InboxChannelReplyMode = 'human' | 'agent';
@@ -579,6 +579,64 @@ class ConnectorsResource {
579
579
  }
580
580
  return this.client.request('POST', `/app-user/connector-resources/${encodeURIComponent(connectorId)}/api-key`, { apiKey, externalUserId: input.externalUserId });
581
581
  }
582
+ // ─── App-user Google Calendar (PDK-CALENDAR-SYNC) ────────────────────────
583
+ //
584
+ // Reads/writes the end user's OWN Google Calendar grant through
585
+ // `/app-user/connector-resources/google-calendar/*` (sk_live_, App
586
+ // whitelist enforced). All four need `appSecret`, call `client.request()`
587
+ // directly, and accept `{ timeoutMs }` (ms, or `null` for none) to override
588
+ // the client's default per-call timeout. Platform failures surface as
589
+ // `AgentForgeError` (`status` + `code`): 404 `CONNECTOR_NOT_CONNECTED`
590
+ // (an `AgentForgeNotFoundError`), 409 `CONNECTOR_RECONNECT_REQUIRED` /
591
+ // `CONNECTOR_SCOPE_MISSING`, 429/503 `PROVIDER_UNAVAILABLE`, 400 input.
592
+ // Timeouts / network failures throw `AgentForgeNetworkError` (no `code`).
593
+ requireAppSecretFor(method) {
594
+ if (!this.client.getAppSecret()) {
595
+ throw new Error(`connectors.${method} requires appSecret (sk_live_/sk_test_) in ` +
596
+ 'AgentForgeClient. This surface authenticates AS the App, not via chatToken/apiKey.');
597
+ }
598
+ }
599
+ /**
600
+ * `GET /app-user/connector-resources/google-calendar/account` — is this end
601
+ * user connected, with which email, and can we write? Not connected is a
602
+ * 200 with `connected: false`.
603
+ */
604
+ async googleCalendarAccountForAppUser(input, options) {
605
+ this.requireAppSecretFor('googleCalendarAccountForAppUser');
606
+ const params = new URLSearchParams({ externalUserId: input.externalUserId });
607
+ return this.client.request('GET', `/app-user/connector-resources/google-calendar/account?${params.toString()}`, undefined, options);
608
+ }
609
+ /**
610
+ * `PUT /app-user/connector-resources/google-calendar/events/:eventId` —
611
+ * idempotent create-or-update of one event. `eventId` is chosen by the
612
+ * caller (stable per booking) so retries never duplicate.
613
+ */
614
+ async googleCalendarUpsertEventForAppUser(eventId, input, options) {
615
+ this.requireAppSecretFor('googleCalendarUpsertEventForAppUser');
616
+ return this.client.request('PUT', `/app-user/connector-resources/google-calendar/events/${encodeURIComponent(eventId)}`, input, options);
617
+ }
618
+ /**
619
+ * `DELETE /app-user/connector-resources/google-calendar/events/:eventId` —
620
+ * removes the event. An event already gone at Google answers
621
+ * `{ deleted: false }` (200), not an error.
622
+ */
623
+ async googleCalendarDeleteEventForAppUser(eventId, input, options) {
624
+ this.requireAppSecretFor('googleCalendarDeleteEventForAppUser');
625
+ const params = new URLSearchParams({ externalUserId: input.externalUserId });
626
+ if (input.calendarId)
627
+ params.set('calendarId', input.calendarId);
628
+ return this.client.request('DELETE', `/app-user/connector-resources/google-calendar/events/${encodeURIComponent(eventId)}?${params.toString()}`, undefined, options);
629
+ }
630
+ /**
631
+ * `POST /app-user/connector-resources/google-calendar/busy` — busy
632
+ * intervals of the end user's calendar in `[timeMin, timeMax]` (≤ 62 days).
633
+ * `excludePrivateProperty` is a property NAME: events carrying it, whatever
634
+ * its value, are left out (the ones we wrote ourselves). Pass `{ timeoutMs }` for a latency budget.
635
+ */
636
+ async googleCalendarBusyForAppUser(input, options) {
637
+ this.requireAppSecretFor('googleCalendarBusyForAppUser');
638
+ return this.client.request('POST', '/app-user/connector-resources/google-calendar/busy', input, options);
639
+ }
582
640
  }
583
641
  exports.ConnectorsResource = ConnectorsResource;
584
642
  function inboxPath(agentId) {
package/dist/types.d.ts CHANGED
@@ -1995,6 +1995,53 @@ export type GoogleSheetsPickerResult = {
1995
1995
  ok: false;
1996
1996
  error: GoogleSheetsPickerErrorCode | (string & {});
1997
1997
  };
1998
+ /** `connectors.googleCalendarAccountForAppUser`. Not connected → `connected: false`, `accountEmail: null`. */
1999
+ export interface GoogleCalendarAccount {
2000
+ connected: boolean;
2001
+ accountEmail: string | null;
2002
+ /** The grant carries the write scope (`calendar.events`). */
2003
+ canWrite: boolean;
2004
+ }
2005
+ export interface GoogleCalendarEventInput {
2006
+ summary: string;
2007
+ description?: string;
2008
+ location?: string;
2009
+ /** ISO 8601 date-time with offset. */
2010
+ startsAt: string;
2011
+ endsAt: string;
2012
+ /** IANA zone, e.g. `America/Bogota`. */
2013
+ timeZone: string;
2014
+ /** Stored as extended private properties on the Google event (used to tell our events from the user's). */
2015
+ privateProperties?: Record<string, string>;
2016
+ }
2017
+ export interface GoogleCalendarUpsertResult {
2018
+ /** Google event id (the caller's `eventId`). */
2019
+ id: string;
2020
+ /** HTML link to the event, when Google returns one. */
2021
+ link: string | null;
2022
+ /** `true` when created, `false` when an existing event was updated. */
2023
+ created: boolean;
2024
+ }
2025
+ export interface GoogleCalendarBusyInput {
2026
+ externalUserId: string;
2027
+ /** Defaults to `primary`. */
2028
+ calendarId?: string;
2029
+ /** ISO 8601. `timeMax - timeMin` ≤ 62 days. */
2030
+ timeMin: string;
2031
+ timeMax: string;
2032
+ /** NAME of a private extended property: events carrying it, whatever its value, are ignored (our own writes). */
2033
+ excludePrivateProperty?: string;
2034
+ }
2035
+ export interface GoogleCalendarBusyResult {
2036
+ busy: Array<{
2037
+ startsAt: string;
2038
+ endsAt: string;
2039
+ }>;
2040
+ /** Zone of the calendar. */
2041
+ timeZone: string;
2042
+ /** More busy intervals exist than were returned. */
2043
+ truncated: boolean;
2044
+ }
1998
2045
  /** A place as the platform returns it (`places.search` / `places.reverse`). */
1999
2046
  export interface Place {
2000
2047
  formatted: string;
@@ -2385,6 +2432,8 @@ export interface CaseDestination {
2385
2432
  currency: string;
2386
2433
  };
2387
2434
  }
2435
+ /** PDK-LOYALTY S1c — how a case's contact was linked. */
2436
+ export type CaseContactLink = 'explicit' | 'app_user' | 'phone' | 'created';
2388
2437
  export interface CaseView {
2389
2438
  id: string;
2390
2439
  /** Per workspace, sequential (ordering). People read `code`. */
@@ -2409,6 +2458,12 @@ export interface CaseView {
2409
2458
  customerRef: string | null;
2410
2459
  /** PDK-LOYALTY-CRM L1 — the business contact (`contacts.getById`) this case belongs to; `null` when none resolved (absent on an older platform). */
2411
2460
  contactId?: string | null;
2461
+ /**
2462
+ * How `contactId` was linked: `explicit` (the App sent `customer.contactId` with its secret key and vouches for it),
2463
+ * `app_user` (the signed-in end user's linked contact), `phone` (a unique phone match) or `created` (made from the
2464
+ * order itself). `null` with no contact and for cases from before this field; absent on an older platform.
2465
+ */
2466
+ contactLink?: CaseContactLink | null;
2412
2467
  /** States the business can move it to now, each with what the customer is
2413
2468
  * told when it moves there (AGF-CASES C3; absent when nothing is said). */
2414
2469
  nextStates: Array<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentforge-io/sdk-server",
3
- "version": "4.78.0",
3
+ "version": "4.80.0",
4
4
  "description": "Server-side SDK for backend apps integrating with AgentForge platform. Auth via ChatToken, ak_live_ API key or App secret (sk_live_), with App installations across tenants.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",