@viu/emporix-sdk 3.4.2 → 3.6.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.cts CHANGED
@@ -3765,6 +3765,10 @@ type AgentTrigger = {
3765
3765
  */
3766
3766
  events: string;
3767
3767
  filter?: CommerceEventTriggerFilter;
3768
+ /**
3769
+ * Optional IAM scopes used to obtain an Emporix token when the agent runs from a Commerce Event. When omitted or empty, the agent does not receive `emporix-token`. Each value must be a scope the caller is allowed to grant.
3770
+ */
3771
+ eventScopes?: Array<string>;
3768
3772
  };
3769
3773
  };
3770
3774
  /**
@@ -4423,6 +4427,15 @@ interface AttachmentOptions {
4423
4427
  */
4424
4428
  sessionId?: string;
4425
4429
  }
4430
+ /**
4431
+ * Options for {@link AiService.reuseAttachment}. `sessionId` is **required**
4432
+ * here, unlike in {@link AttachmentOptions}: the attachment is looked up inside
4433
+ * the session named by the `session-id` header, so omitting it is a guaranteed
4434
+ * `400` rather than a new session.
4435
+ */
4436
+ interface AttachmentReuseOptions {
4437
+ sessionId: string;
4438
+ }
4426
4439
  /** Base64+checksum export of agents with their components. */
4427
4440
  type AgentsExport = ExportResponse;
4428
4441
  /** Body for {@link AiService.exportAgents} — `{ agentIds }`. */
@@ -4619,8 +4632,27 @@ declare class AiService {
4619
4632
  * (`POST /agentic/{agentId}/attachments`, multipart, HTTP 201). The response
4620
4633
  * `sessionId` must be threaded into subsequent chat calls to bind the file.
4621
4634
  * Pass `opts.sessionId` to attach to an existing session.
4635
+ *
4636
+ * The endpoint takes exactly one of `attachment` or `attachmentId` — both or
4637
+ * neither is a `400`. This method always sends the file; to point a second
4638
+ * agent at a file already in the session, use {@link reuseAttachment}.
4622
4639
  */
4623
4640
  uploadAttachment(agentId: string, attachment: Blob | File, opts?: AttachmentOptions, auth?: AuthContext): Promise<Attachment>;
4641
+ /**
4642
+ * Assign an attachment that already exists in a session to another agent
4643
+ * (`POST /agentic/{agentId}/attachments` with the `attachmentId` form field,
4644
+ * HTTP 204 — nothing is returned, unlike {@link uploadAttachment}'s 201).
4645
+ *
4646
+ * Use it to hand a second agent the same file instead of uploading it twice.
4647
+ * The attachment is resolved inside `opts.sessionId`, which is why that is
4648
+ * required rather than optional — the id alone does not identify a file.
4649
+ *
4650
+ * ```ts
4651
+ * const { id, sessionId } = await client.ai.uploadAttachment("agent-a", file);
4652
+ * await client.ai.reuseAttachment("agent-b", id!, { sessionId: sessionId! });
4653
+ * ```
4654
+ */
4655
+ reuseAttachment(agentId: string, attachmentId: string, opts: AttachmentReuseOptions, auth?: AuthContext): Promise<void>;
4624
4656
  /** Export agents + components as a base64/checksum blob (`POST /agentic/agents/export`). */
4625
4657
  exportAgents(body: AgentsExportRequest, auth?: AuthContext): Promise<AgentsExport>;
4626
4658
  /** Import previously-exported agents (`POST /agentic/agents/import`). */
@@ -8876,12 +8908,21 @@ interface ListReindexJobsOptions {
8876
8908
  pageSize?: number;
8877
8909
  /** Raw Emporix `q` filter string. */
8878
8910
  q?: string;
8911
+ /** Emporix sort syntax, e.g. `"metadata.createdAt:desc"`. */
8912
+ sort?: string;
8879
8913
  /** Ask for `X-Total-Count` — becomes a request header, not a query parameter. */
8880
8914
  totalCount?: boolean;
8881
8915
  }
8882
8916
  /**
8883
8917
  * Emporix Indexing Service (`/indexing/{tenant}/…`): search-index provider
8884
8918
  * configurations and reindex. Server-side; defaults to the service token.
8919
+ *
8920
+ * On the `BATTERY_INCLUDED` provider every write validates the stored
8921
+ * `indexName`/`writeKey` against the search backend *before* it takes effect:
8922
+ * invalid credentials fail with `400` and when that validation is itself
8923
+ * unreachable the call fails with `502`. Either way nothing is written — so a
8924
+ * `400` from these methods can mean the credentials are wrong rather than the
8925
+ * request body.
8885
8926
  */
8886
8927
  declare class IndexingService {
8887
8928
  private readonly ctx;
@@ -8892,9 +8933,9 @@ declare class IndexingService {
8892
8933
  listConfigurations(auth?: AuthContext): Promise<IndexConfig[]>;
8893
8934
  /** Get a configuration by provider name. */
8894
8935
  getConfiguration(provider: string, auth?: AuthContext): Promise<IndexConfig>;
8895
- /** Create a configuration. */
8936
+ /** Create a configuration. Nothing is stored if credential validation fails. */
8896
8937
  createConfiguration(input: IndexConfig, auth?: AuthContext): Promise<IndexConfigCreated>;
8897
- /** Update a configuration by provider name. */
8938
+ /** Update a configuration. Left unchanged if credential validation fails. */
8898
8939
  updateConfiguration(provider: string, input: IndexConfig, auth?: AuthContext): Promise<void>;
8899
8940
  /** Delete a configuration by provider name. */
8900
8941
  deleteConfiguration(provider: string, auth?: AuthContext): Promise<void>;
@@ -8907,6 +8948,9 @@ declare class IndexingService {
8907
8948
  * given `entityType`; set `rag: true` to also rebuild the RAG vector index
8908
8949
  * (PRODUCT only). Resolves to the created job (`201`) or, when a job for that
8909
8950
  * `entityType` is already `IN_PROGRESS`, that running job (`200`).
8951
+ *
8952
+ * On `BATTERY_INCLUDED` with `entityType: "PRODUCT"` the stored credentials
8953
+ * are validated first; no job is created on the `400`/`502` cases above.
8910
8954
  */
8911
8955
  createReindexJob(input: ReindexJobInput, auth?: AuthContext): Promise<ReindexJob>;
8912
8956
  /** List reindex jobs (paginated). */
@@ -8914,7 +8958,8 @@ declare class IndexingService {
8914
8958
  /** Fetch one reindex job by id. */
8915
8959
  getReindexJob(reindexJobId: string, auth?: AuthContext): Promise<ReindexJob>;
8916
8960
  /**
8917
- * Trigger a reindex.
8961
+ * Trigger a reindex. On `BATTERY_INCLUDED` the same credential validation
8962
+ * runs first, so this can fail with `400`/`502` before any job starts.
8918
8963
  * @deprecated since 2026-06-18, removal 2026-12-01 — use {@link createReindexJob}
8919
8964
  * (`createReindexJob({ entityType: "PRODUCT" })`), which returns a trackable job.
8920
8965
  */
@@ -12982,4 +13027,4 @@ declare function productIdFromYrn(yrn: string | undefined): string;
12982
13027
  */
12983
13028
  declare function productYrn(tenant: string, productId: string): string;
12984
13029
 
12985
- export { type AddedPoints, type AdminCustomer, type AdminCustomerAddress, type AdminCustomerAddressInput, type AdminCustomerAddressList, type AdminCustomerAddressUpdate, type AdminCustomerCreated, type AdminCustomerImport, type AdminCustomerImportAccount, type AdminCustomerImportResult, type AdminCustomerInput, type AdminCustomerLegacyAuth, type AdminCustomerList, type AdminCustomerPatch, type AdminCustomerSearchQuery, type AdminCustomerUpdate, type AdminPasswordMigrationRetention, type AdminPasswordMigrationRetentionInput, type Agent, type AgentAnalytics, type AgentExecutions, type AgentFromTemplate, type AgentInput, type AgentPatchOp, type AgentRequestLog, type AgentSearchQuery, type AgentSessionLog, type AgentTemplate, type AgenticPatchOp, type AgentsExport, type AgentsExportRequest, type AgentsImport, type AgentsImportRequest, AiService, type AnalyticsQuery, type Approval, type ApprovalCreated, type ApprovalDecision, type ApprovalInput, type ApprovalList, type ApprovalPatch, type ApprovalPermittedInput, type ApprovalPermittedResult, ApprovalService, type ApprovalUsersQuery, type ApprovalUsersResult, type Assignee, type Attachment, type AttachmentOptions, type AuditLogChangeType, type AuditLogEntry, type AuditLogPage, type AuditLogPathChange, type AuditLogQuery, type AuditLogRelatedEntity, AuditLogService, AuthContext, AvailabilityService, type BatchNextIdEntry, type Brand, type BrandInput, type BrandList, BrandService, type BrandUpdate, type BulkInstanceResult, type BulkPatchInstanceItem, CartService, type Catalog, type CatalogCreated, type CatalogInput, type CatalogList, type CatalogPatch, CatalogService, type CatalogUpdate, CategoryService, type CgRelation, type CgRelationList, type ChatRequest, type ChatResponse, type ChatStreamOptions, CheckoutService, ClientConfigService, type ClientConfiguration, ClientContext, CloudFunctionsService, type CommerceEvents, CompaniesService, type CompletionMessage, type CompletionRequest, type CompletionResponse, type Configuration$1 as Configuration, type ConfigurationDraft, ContactsService, type Conversation, type ConversationSearchQuery, type ConversionFactorInput, type ConversionFactorResult, type ConvertUnitInput, type ConvertUnitResult, type CookieIo, type Country, type CountryList, CountryService, type CountryUpdate, type Coupon$1 as Coupon, type CouponCreated, type CouponInput, type CouponList, CouponService, type CouponUpdate, type Created, type Currency, type CurrencyCreated, type CurrencyInput, type CurrencyList, CurrencyService, type CurrencyUpdate, type CustomEntity, type CustomEntityDraft, type CustomInstance, type CustomInstanceDraft, CustomerAdminService, CustomerGroupsService, CustomerService, type CustomerSessionState, type CustomerSessionStore, type CustomerSummaryBatch, CustomerTokenRefresher, type DeleteAgentOptions, type DeleteConfigOptions, type DeliveryCreated, type DeliveryCycleInput, type DeliverySlot, type DeliverySlotList, type DeliveryTime$1 as DeliveryTime, type DeliveryTimeInput, type DeliveryTimeList, type DeliveryTimeUpdate, type DeliveryWindow$2 as DeliveryWindow, type DeliveryWindowList, type DeliveryWindowValidation, EmporixAuthError, EmporixClient, EmporixConfig, type EmporixCore, EmporixError, EmporixForbiddenError, EmporixInsufficientScopeError, EmporixNetworkError, EmporixNotFoundError, EmporixServerError, type EmporixStorage, type EmporixStorageKey, EmporixTimeoutError, EmporixValidationError, type ExchangeRate, type ExchangeRateCreated, type ExchangeRateInput, type ExchangeRateList, type ExchangeRateUpdate, type ExecutionsQuery, type Fee$1 as Fee, type FeeDraft, FeeService, type FindSiteInput, type GetOptions, type IamAccessControl, type IamAccessControlCreated, type IamAccessControlUpsert, type IamGroup, type IamGroupCreate, type IamGroupCreated, AssignmentCreateRequest as IamGroupMemberAssignment, type IamGroupMemberCreated, type IamGroupMemberInput, type IamGroupUpdate, type IamScope, type IamScopeCreated, type IamScopeUpsert, IamService, type IamUser, type IamUserCreate, type IamUserCreated, type IamUserDetail, type IamUserScopes, type IamUserUpdate, type ImportCancelResult, type ImportConfig, type ImportErrorRecord, type ImportPage, type ImportPageOptions, type ImportRecordOutcome, type ImportRun, type ImportRunDetail, type ImportRunEvent, type ImportRunInput, type ImportRunMode, type ImportRunStatus, type ImportRunStream, type ImportSchedule, ImportService, type ImportStream, type ImportedRecord, type IndexConfig, type IndexConfigCreated, type IndexPublicConfig, IndexingService, type InstanceSearchBody, type InvoiceJob, type InvoiceJobCreated, type InvoiceJobDraft, InvoiceService, type InvokeCloudFunctionOptions, type ItemFee, type ItemFeeDraft, type ItemFeeSearch, type ItemFeeSearchByProductId, type ItemFeeSearchByProductIds, type Job, type JobIdResponse, type Label, type LabelInput, type LabelList, LabelService, type LabelUpdate, type ListConfigOptions, type ListCustomEntitiesOptions, type ListFeesQuery, type ListInstancesQuery, type ListQuery, type ListQuoteReasonsQuery, type ListQuotesQuery, type ListReindexJobsOptions, type ListSchemaReferencesQuery, type ListSchemasQuery, LocationsService, LogLevel, type McpServer, type McpServerInput, MediaService, type MetadataFilter, type MinimumFee, type MutateOptions, type NewPointsEntry, type NextIdCommandRequest, type NextIdOptions, type NextIdResponse, type NextIdsBatchRequest, type NextIdsBatchResponse, type OAuthConfig, type OAuthInput, type OrderCycleList, type OrderEntryEventCreate, type OrderStatusChange, OrdersService, type PackagingProductsChange, type PackingEvent, type PackingEventList, PaginatedItems, PaymentGatewayService, type PersistedAnonymousSession, type PickOrder, type PickOrderList, type PickPackAck, PickPackService, type PointsSummary, PriceService, ProductService, type ProviderModels, QueryFor, type Quote, type QuoteCreated, type QuoteDraft, type QuoteHistory, type QuoteInput, type QuoteReason, type QuoteReasonCreated, type QuoteReasonDraft, type QuoteReasonUpdate, type QuoteResult, QuoteService, type QuoteSlotInput, type QuoteUpdate, RagIndexerService, type RagType, type RecalculationJob, type RecalculationJobCreated, type RecalculationJobInput, type RedeemCouponResult, type RedeemMyPointsInput, type RedeemOption, type RedeemOptionList, type RedeemedPoints, type Redemption, type RedemptionCreated, type RedemptionInput, type ReferralCoupon, type Region, type RegionList, type ReindexEntityType, type ReindexInput, type ReindexJob, type ReindexJobInput, type ReindexJobStatus, ResolvedConfig, type ResourceCreated, type Return, type ReturnCreated, type ReturnInput, type ReturnList, type ReturnPatch, type ReturnUpdate, ReturnsService, RewardPointsService, STORAGE_KEYS, SalesOrdersService, type Schema, type SchemaAttribute, type SchemaDraft, type SchemaExport, type SchemaImportInput, type SchemaInstanceBulkCreateItem, type SchemaInstanceBulkUpsertItem, type SchemaReference, type SchemaReferenceCreated, type SchemaReferenceInput, type SchemaReferenceUpdateInput, SchemaService, type SchemaTypeName, type SchemaUpdate, type SearchImportedRecordsOptions, type SearchInstancesQuery, type SearchQuery, type SearchStreamRecordsOptions, SegmentService, type SequenceSchema, type SequenceSchemaCreate, SequentialIdService, type ServerCookieJar, type ServiceClass, ServiceName, type SessionAttributeInput, type SessionContext, type SessionContextPatch, SessionContextService, type SetItemFeesOptions, type ShippingFee, type ShippingGroup, type ShippingGroupList, type ShippingMethod, type ShippingMethodList, type ShippingPatch, ShippingService, type ShoppingList, type ShoppingListDraft, type ShoppingListItem, ShoppingListService, type Site$1 as Site, type SiteCreated, type SiteFields, type SiteInput, type SiteList, type SiteMixin, type SiteMixinCreated, type SiteMixins, SiteService, StoredAnonymousSession, type TaxCalculationInput, type TaxCalculationRequest, type TaxCalculationResult, type TaxClass, type TaxConfig, type TaxConfigCreated, type TaxCreation as TaxConfigInput, type TaxUpdate as TaxConfigUpdate, type TaxLocation, TaxService, TenantConfigService, type TextRequest, type TextResponse, type Token, type TokenInput, TokenProvider, type TokenStorage, type Tool, type ToolInput, type Unit, type UnitCreated, UnitHandlingService, type UnitInput, type UnitUpdate, type Vendor, type VendorCreated, type VendorInput, type VendorList, type VendorLocation, type VendorLocationInput, type VendorLocationList, type VendorLocationUpdate, type VendorSearchQuery, VendorService, type VendorUpdate, type WebhookConfig, type WebhookConfigCreated, type WebhookConfigDraft, type WebhookConfigPatch, type WebhookDashboardAccess, WebhookService, type WebhookStatistics, type WebhookStatisticsQuery, type WebhookSubscription, type WebhookSubscriptionUpdateItem, type WebhookSubscriptionUpdateResultItem, type Zone, type ZoneList, approvalStatusPatch, createCookieBackedStorage, createCookieStorage, createCore, createEmporixClient, createListenerSet, createLocalStorage, createLocalStorageStorage, createMemoryStorage, createServerStorage, createSessionStorage, emporixKey, errorFromResponse, fromWebStorage, getCustomerSessionStore, parseAnonymousSession, pickFee, productIdFromYrn, productYrn, resolveZone, serverAuth, siteMeta };
13030
+ export { type AddedPoints, type AdminCustomer, type AdminCustomerAddress, type AdminCustomerAddressInput, type AdminCustomerAddressList, type AdminCustomerAddressUpdate, type AdminCustomerCreated, type AdminCustomerImport, type AdminCustomerImportAccount, type AdminCustomerImportResult, type AdminCustomerInput, type AdminCustomerLegacyAuth, type AdminCustomerList, type AdminCustomerPatch, type AdminCustomerSearchQuery, type AdminCustomerUpdate, type AdminPasswordMigrationRetention, type AdminPasswordMigrationRetentionInput, type Agent, type AgentAnalytics, type AgentExecutions, type AgentFromTemplate, type AgentInput, type AgentPatchOp, type AgentRequestLog, type AgentSearchQuery, type AgentSessionLog, type AgentTemplate, type AgenticPatchOp, type AgentsExport, type AgentsExportRequest, type AgentsImport, type AgentsImportRequest, AiService, type AnalyticsQuery, type Approval, type ApprovalCreated, type ApprovalDecision, type ApprovalInput, type ApprovalList, type ApprovalPatch, type ApprovalPermittedInput, type ApprovalPermittedResult, ApprovalService, type ApprovalUsersQuery, type ApprovalUsersResult, type Assignee, type Attachment, type AttachmentOptions, type AttachmentReuseOptions, type AuditLogChangeType, type AuditLogEntry, type AuditLogPage, type AuditLogPathChange, type AuditLogQuery, type AuditLogRelatedEntity, AuditLogService, AuthContext, AvailabilityService, type BatchNextIdEntry, type Brand, type BrandInput, type BrandList, BrandService, type BrandUpdate, type BulkInstanceResult, type BulkPatchInstanceItem, CartService, type Catalog, type CatalogCreated, type CatalogInput, type CatalogList, type CatalogPatch, CatalogService, type CatalogUpdate, CategoryService, type CgRelation, type CgRelationList, type ChatRequest, type ChatResponse, type ChatStreamOptions, CheckoutService, ClientConfigService, type ClientConfiguration, ClientContext, CloudFunctionsService, type CommerceEvents, CompaniesService, type CompletionMessage, type CompletionRequest, type CompletionResponse, type Configuration$1 as Configuration, type ConfigurationDraft, ContactsService, type Conversation, type ConversationSearchQuery, type ConversionFactorInput, type ConversionFactorResult, type ConvertUnitInput, type ConvertUnitResult, type CookieIo, type Country, type CountryList, CountryService, type CountryUpdate, type Coupon$1 as Coupon, type CouponCreated, type CouponInput, type CouponList, CouponService, type CouponUpdate, type Created, type Currency, type CurrencyCreated, type CurrencyInput, type CurrencyList, CurrencyService, type CurrencyUpdate, type CustomEntity, type CustomEntityDraft, type CustomInstance, type CustomInstanceDraft, CustomerAdminService, CustomerGroupsService, CustomerService, type CustomerSessionState, type CustomerSessionStore, type CustomerSummaryBatch, CustomerTokenRefresher, type DeleteAgentOptions, type DeleteConfigOptions, type DeliveryCreated, type DeliveryCycleInput, type DeliverySlot, type DeliverySlotList, type DeliveryTime$1 as DeliveryTime, type DeliveryTimeInput, type DeliveryTimeList, type DeliveryTimeUpdate, type DeliveryWindow$2 as DeliveryWindow, type DeliveryWindowList, type DeliveryWindowValidation, EmporixAuthError, EmporixClient, EmporixConfig, type EmporixCore, EmporixError, EmporixForbiddenError, EmporixInsufficientScopeError, EmporixNetworkError, EmporixNotFoundError, EmporixServerError, type EmporixStorage, type EmporixStorageKey, EmporixTimeoutError, EmporixValidationError, type ExchangeRate, type ExchangeRateCreated, type ExchangeRateInput, type ExchangeRateList, type ExchangeRateUpdate, type ExecutionsQuery, type Fee$1 as Fee, type FeeDraft, FeeService, type FindSiteInput, type GetOptions, type IamAccessControl, type IamAccessControlCreated, type IamAccessControlUpsert, type IamGroup, type IamGroupCreate, type IamGroupCreated, AssignmentCreateRequest as IamGroupMemberAssignment, type IamGroupMemberCreated, type IamGroupMemberInput, type IamGroupUpdate, type IamScope, type IamScopeCreated, type IamScopeUpsert, IamService, type IamUser, type IamUserCreate, type IamUserCreated, type IamUserDetail, type IamUserScopes, type IamUserUpdate, type ImportCancelResult, type ImportConfig, type ImportErrorRecord, type ImportPage, type ImportPageOptions, type ImportRecordOutcome, type ImportRun, type ImportRunDetail, type ImportRunEvent, type ImportRunInput, type ImportRunMode, type ImportRunStatus, type ImportRunStream, type ImportSchedule, ImportService, type ImportStream, type ImportedRecord, type IndexConfig, type IndexConfigCreated, type IndexPublicConfig, IndexingService, type InstanceSearchBody, type InvoiceJob, type InvoiceJobCreated, type InvoiceJobDraft, InvoiceService, type InvokeCloudFunctionOptions, type ItemFee, type ItemFeeDraft, type ItemFeeSearch, type ItemFeeSearchByProductId, type ItemFeeSearchByProductIds, type Job, type JobIdResponse, type Label, type LabelInput, type LabelList, LabelService, type LabelUpdate, type ListConfigOptions, type ListCustomEntitiesOptions, type ListFeesQuery, type ListInstancesQuery, type ListQuery, type ListQuoteReasonsQuery, type ListQuotesQuery, type ListReindexJobsOptions, type ListSchemaReferencesQuery, type ListSchemasQuery, LocationsService, LogLevel, type McpServer, type McpServerInput, MediaService, type MetadataFilter, type MinimumFee, type MutateOptions, type NewPointsEntry, type NextIdCommandRequest, type NextIdOptions, type NextIdResponse, type NextIdsBatchRequest, type NextIdsBatchResponse, type OAuthConfig, type OAuthInput, type OrderCycleList, type OrderEntryEventCreate, type OrderStatusChange, OrdersService, type PackagingProductsChange, type PackingEvent, type PackingEventList, PaginatedItems, PaymentGatewayService, type PersistedAnonymousSession, type PickOrder, type PickOrderList, type PickPackAck, PickPackService, type PointsSummary, PriceService, ProductService, type ProviderModels, QueryFor, type Quote, type QuoteCreated, type QuoteDraft, type QuoteHistory, type QuoteInput, type QuoteReason, type QuoteReasonCreated, type QuoteReasonDraft, type QuoteReasonUpdate, type QuoteResult, QuoteService, type QuoteSlotInput, type QuoteUpdate, RagIndexerService, type RagType, type RecalculationJob, type RecalculationJobCreated, type RecalculationJobInput, type RedeemCouponResult, type RedeemMyPointsInput, type RedeemOption, type RedeemOptionList, type RedeemedPoints, type Redemption, type RedemptionCreated, type RedemptionInput, type ReferralCoupon, type Region, type RegionList, type ReindexEntityType, type ReindexInput, type ReindexJob, type ReindexJobInput, type ReindexJobStatus, ResolvedConfig, type ResourceCreated, type Return, type ReturnCreated, type ReturnInput, type ReturnList, type ReturnPatch, type ReturnUpdate, ReturnsService, RewardPointsService, STORAGE_KEYS, SalesOrdersService, type Schema, type SchemaAttribute, type SchemaDraft, type SchemaExport, type SchemaImportInput, type SchemaInstanceBulkCreateItem, type SchemaInstanceBulkUpsertItem, type SchemaReference, type SchemaReferenceCreated, type SchemaReferenceInput, type SchemaReferenceUpdateInput, SchemaService, type SchemaTypeName, type SchemaUpdate, type SearchImportedRecordsOptions, type SearchInstancesQuery, type SearchQuery, type SearchStreamRecordsOptions, SegmentService, type SequenceSchema, type SequenceSchemaCreate, SequentialIdService, type ServerCookieJar, type ServiceClass, ServiceName, type SessionAttributeInput, type SessionContext, type SessionContextPatch, SessionContextService, type SetItemFeesOptions, type ShippingFee, type ShippingGroup, type ShippingGroupList, type ShippingMethod, type ShippingMethodList, type ShippingPatch, ShippingService, type ShoppingList, type ShoppingListDraft, type ShoppingListItem, ShoppingListService, type Site$1 as Site, type SiteCreated, type SiteFields, type SiteInput, type SiteList, type SiteMixin, type SiteMixinCreated, type SiteMixins, SiteService, StoredAnonymousSession, type TaxCalculationInput, type TaxCalculationRequest, type TaxCalculationResult, type TaxClass, type TaxConfig, type TaxConfigCreated, type TaxCreation as TaxConfigInput, type TaxUpdate as TaxConfigUpdate, type TaxLocation, TaxService, TenantConfigService, type TextRequest, type TextResponse, type Token, type TokenInput, TokenProvider, type TokenStorage, type Tool, type ToolInput, type Unit, type UnitCreated, UnitHandlingService, type UnitInput, type UnitUpdate, type Vendor, type VendorCreated, type VendorInput, type VendorList, type VendorLocation, type VendorLocationInput, type VendorLocationList, type VendorLocationUpdate, type VendorSearchQuery, VendorService, type VendorUpdate, type WebhookConfig, type WebhookConfigCreated, type WebhookConfigDraft, type WebhookConfigPatch, type WebhookDashboardAccess, WebhookService, type WebhookStatistics, type WebhookStatisticsQuery, type WebhookSubscription, type WebhookSubscriptionUpdateItem, type WebhookSubscriptionUpdateResultItem, type Zone, type ZoneList, approvalStatusPatch, createCookieBackedStorage, createCookieStorage, createCore, createEmporixClient, createListenerSet, createLocalStorage, createLocalStorageStorage, createMemoryStorage, createServerStorage, createSessionStorage, emporixKey, errorFromResponse, fromWebStorage, getCustomerSessionStore, parseAnonymousSession, pickFee, productIdFromYrn, productYrn, resolveZone, serverAuth, siteMeta };
package/dist/index.d.ts CHANGED
@@ -3765,6 +3765,10 @@ type AgentTrigger = {
3765
3765
  */
3766
3766
  events: string;
3767
3767
  filter?: CommerceEventTriggerFilter;
3768
+ /**
3769
+ * Optional IAM scopes used to obtain an Emporix token when the agent runs from a Commerce Event. When omitted or empty, the agent does not receive `emporix-token`. Each value must be a scope the caller is allowed to grant.
3770
+ */
3771
+ eventScopes?: Array<string>;
3768
3772
  };
3769
3773
  };
3770
3774
  /**
@@ -4423,6 +4427,15 @@ interface AttachmentOptions {
4423
4427
  */
4424
4428
  sessionId?: string;
4425
4429
  }
4430
+ /**
4431
+ * Options for {@link AiService.reuseAttachment}. `sessionId` is **required**
4432
+ * here, unlike in {@link AttachmentOptions}: the attachment is looked up inside
4433
+ * the session named by the `session-id` header, so omitting it is a guaranteed
4434
+ * `400` rather than a new session.
4435
+ */
4436
+ interface AttachmentReuseOptions {
4437
+ sessionId: string;
4438
+ }
4426
4439
  /** Base64+checksum export of agents with their components. */
4427
4440
  type AgentsExport = ExportResponse;
4428
4441
  /** Body for {@link AiService.exportAgents} — `{ agentIds }`. */
@@ -4619,8 +4632,27 @@ declare class AiService {
4619
4632
  * (`POST /agentic/{agentId}/attachments`, multipart, HTTP 201). The response
4620
4633
  * `sessionId` must be threaded into subsequent chat calls to bind the file.
4621
4634
  * Pass `opts.sessionId` to attach to an existing session.
4635
+ *
4636
+ * The endpoint takes exactly one of `attachment` or `attachmentId` — both or
4637
+ * neither is a `400`. This method always sends the file; to point a second
4638
+ * agent at a file already in the session, use {@link reuseAttachment}.
4622
4639
  */
4623
4640
  uploadAttachment(agentId: string, attachment: Blob | File, opts?: AttachmentOptions, auth?: AuthContext): Promise<Attachment>;
4641
+ /**
4642
+ * Assign an attachment that already exists in a session to another agent
4643
+ * (`POST /agentic/{agentId}/attachments` with the `attachmentId` form field,
4644
+ * HTTP 204 — nothing is returned, unlike {@link uploadAttachment}'s 201).
4645
+ *
4646
+ * Use it to hand a second agent the same file instead of uploading it twice.
4647
+ * The attachment is resolved inside `opts.sessionId`, which is why that is
4648
+ * required rather than optional — the id alone does not identify a file.
4649
+ *
4650
+ * ```ts
4651
+ * const { id, sessionId } = await client.ai.uploadAttachment("agent-a", file);
4652
+ * await client.ai.reuseAttachment("agent-b", id!, { sessionId: sessionId! });
4653
+ * ```
4654
+ */
4655
+ reuseAttachment(agentId: string, attachmentId: string, opts: AttachmentReuseOptions, auth?: AuthContext): Promise<void>;
4624
4656
  /** Export agents + components as a base64/checksum blob (`POST /agentic/agents/export`). */
4625
4657
  exportAgents(body: AgentsExportRequest, auth?: AuthContext): Promise<AgentsExport>;
4626
4658
  /** Import previously-exported agents (`POST /agentic/agents/import`). */
@@ -8876,12 +8908,21 @@ interface ListReindexJobsOptions {
8876
8908
  pageSize?: number;
8877
8909
  /** Raw Emporix `q` filter string. */
8878
8910
  q?: string;
8911
+ /** Emporix sort syntax, e.g. `"metadata.createdAt:desc"`. */
8912
+ sort?: string;
8879
8913
  /** Ask for `X-Total-Count` — becomes a request header, not a query parameter. */
8880
8914
  totalCount?: boolean;
8881
8915
  }
8882
8916
  /**
8883
8917
  * Emporix Indexing Service (`/indexing/{tenant}/…`): search-index provider
8884
8918
  * configurations and reindex. Server-side; defaults to the service token.
8919
+ *
8920
+ * On the `BATTERY_INCLUDED` provider every write validates the stored
8921
+ * `indexName`/`writeKey` against the search backend *before* it takes effect:
8922
+ * invalid credentials fail with `400` and when that validation is itself
8923
+ * unreachable the call fails with `502`. Either way nothing is written — so a
8924
+ * `400` from these methods can mean the credentials are wrong rather than the
8925
+ * request body.
8885
8926
  */
8886
8927
  declare class IndexingService {
8887
8928
  private readonly ctx;
@@ -8892,9 +8933,9 @@ declare class IndexingService {
8892
8933
  listConfigurations(auth?: AuthContext): Promise<IndexConfig[]>;
8893
8934
  /** Get a configuration by provider name. */
8894
8935
  getConfiguration(provider: string, auth?: AuthContext): Promise<IndexConfig>;
8895
- /** Create a configuration. */
8936
+ /** Create a configuration. Nothing is stored if credential validation fails. */
8896
8937
  createConfiguration(input: IndexConfig, auth?: AuthContext): Promise<IndexConfigCreated>;
8897
- /** Update a configuration by provider name. */
8938
+ /** Update a configuration. Left unchanged if credential validation fails. */
8898
8939
  updateConfiguration(provider: string, input: IndexConfig, auth?: AuthContext): Promise<void>;
8899
8940
  /** Delete a configuration by provider name. */
8900
8941
  deleteConfiguration(provider: string, auth?: AuthContext): Promise<void>;
@@ -8907,6 +8948,9 @@ declare class IndexingService {
8907
8948
  * given `entityType`; set `rag: true` to also rebuild the RAG vector index
8908
8949
  * (PRODUCT only). Resolves to the created job (`201`) or, when a job for that
8909
8950
  * `entityType` is already `IN_PROGRESS`, that running job (`200`).
8951
+ *
8952
+ * On `BATTERY_INCLUDED` with `entityType: "PRODUCT"` the stored credentials
8953
+ * are validated first; no job is created on the `400`/`502` cases above.
8910
8954
  */
8911
8955
  createReindexJob(input: ReindexJobInput, auth?: AuthContext): Promise<ReindexJob>;
8912
8956
  /** List reindex jobs (paginated). */
@@ -8914,7 +8958,8 @@ declare class IndexingService {
8914
8958
  /** Fetch one reindex job by id. */
8915
8959
  getReindexJob(reindexJobId: string, auth?: AuthContext): Promise<ReindexJob>;
8916
8960
  /**
8917
- * Trigger a reindex.
8961
+ * Trigger a reindex. On `BATTERY_INCLUDED` the same credential validation
8962
+ * runs first, so this can fail with `400`/`502` before any job starts.
8918
8963
  * @deprecated since 2026-06-18, removal 2026-12-01 — use {@link createReindexJob}
8919
8964
  * (`createReindexJob({ entityType: "PRODUCT" })`), which returns a trackable job.
8920
8965
  */
@@ -12982,4 +13027,4 @@ declare function productIdFromYrn(yrn: string | undefined): string;
12982
13027
  */
12983
13028
  declare function productYrn(tenant: string, productId: string): string;
12984
13029
 
12985
- export { type AddedPoints, type AdminCustomer, type AdminCustomerAddress, type AdminCustomerAddressInput, type AdminCustomerAddressList, type AdminCustomerAddressUpdate, type AdminCustomerCreated, type AdminCustomerImport, type AdminCustomerImportAccount, type AdminCustomerImportResult, type AdminCustomerInput, type AdminCustomerLegacyAuth, type AdminCustomerList, type AdminCustomerPatch, type AdminCustomerSearchQuery, type AdminCustomerUpdate, type AdminPasswordMigrationRetention, type AdminPasswordMigrationRetentionInput, type Agent, type AgentAnalytics, type AgentExecutions, type AgentFromTemplate, type AgentInput, type AgentPatchOp, type AgentRequestLog, type AgentSearchQuery, type AgentSessionLog, type AgentTemplate, type AgenticPatchOp, type AgentsExport, type AgentsExportRequest, type AgentsImport, type AgentsImportRequest, AiService, type AnalyticsQuery, type Approval, type ApprovalCreated, type ApprovalDecision, type ApprovalInput, type ApprovalList, type ApprovalPatch, type ApprovalPermittedInput, type ApprovalPermittedResult, ApprovalService, type ApprovalUsersQuery, type ApprovalUsersResult, type Assignee, type Attachment, type AttachmentOptions, type AuditLogChangeType, type AuditLogEntry, type AuditLogPage, type AuditLogPathChange, type AuditLogQuery, type AuditLogRelatedEntity, AuditLogService, AuthContext, AvailabilityService, type BatchNextIdEntry, type Brand, type BrandInput, type BrandList, BrandService, type BrandUpdate, type BulkInstanceResult, type BulkPatchInstanceItem, CartService, type Catalog, type CatalogCreated, type CatalogInput, type CatalogList, type CatalogPatch, CatalogService, type CatalogUpdate, CategoryService, type CgRelation, type CgRelationList, type ChatRequest, type ChatResponse, type ChatStreamOptions, CheckoutService, ClientConfigService, type ClientConfiguration, ClientContext, CloudFunctionsService, type CommerceEvents, CompaniesService, type CompletionMessage, type CompletionRequest, type CompletionResponse, type Configuration$1 as Configuration, type ConfigurationDraft, ContactsService, type Conversation, type ConversationSearchQuery, type ConversionFactorInput, type ConversionFactorResult, type ConvertUnitInput, type ConvertUnitResult, type CookieIo, type Country, type CountryList, CountryService, type CountryUpdate, type Coupon$1 as Coupon, type CouponCreated, type CouponInput, type CouponList, CouponService, type CouponUpdate, type Created, type Currency, type CurrencyCreated, type CurrencyInput, type CurrencyList, CurrencyService, type CurrencyUpdate, type CustomEntity, type CustomEntityDraft, type CustomInstance, type CustomInstanceDraft, CustomerAdminService, CustomerGroupsService, CustomerService, type CustomerSessionState, type CustomerSessionStore, type CustomerSummaryBatch, CustomerTokenRefresher, type DeleteAgentOptions, type DeleteConfigOptions, type DeliveryCreated, type DeliveryCycleInput, type DeliverySlot, type DeliverySlotList, type DeliveryTime$1 as DeliveryTime, type DeliveryTimeInput, type DeliveryTimeList, type DeliveryTimeUpdate, type DeliveryWindow$2 as DeliveryWindow, type DeliveryWindowList, type DeliveryWindowValidation, EmporixAuthError, EmporixClient, EmporixConfig, type EmporixCore, EmporixError, EmporixForbiddenError, EmporixInsufficientScopeError, EmporixNetworkError, EmporixNotFoundError, EmporixServerError, type EmporixStorage, type EmporixStorageKey, EmporixTimeoutError, EmporixValidationError, type ExchangeRate, type ExchangeRateCreated, type ExchangeRateInput, type ExchangeRateList, type ExchangeRateUpdate, type ExecutionsQuery, type Fee$1 as Fee, type FeeDraft, FeeService, type FindSiteInput, type GetOptions, type IamAccessControl, type IamAccessControlCreated, type IamAccessControlUpsert, type IamGroup, type IamGroupCreate, type IamGroupCreated, AssignmentCreateRequest as IamGroupMemberAssignment, type IamGroupMemberCreated, type IamGroupMemberInput, type IamGroupUpdate, type IamScope, type IamScopeCreated, type IamScopeUpsert, IamService, type IamUser, type IamUserCreate, type IamUserCreated, type IamUserDetail, type IamUserScopes, type IamUserUpdate, type ImportCancelResult, type ImportConfig, type ImportErrorRecord, type ImportPage, type ImportPageOptions, type ImportRecordOutcome, type ImportRun, type ImportRunDetail, type ImportRunEvent, type ImportRunInput, type ImportRunMode, type ImportRunStatus, type ImportRunStream, type ImportSchedule, ImportService, type ImportStream, type ImportedRecord, type IndexConfig, type IndexConfigCreated, type IndexPublicConfig, IndexingService, type InstanceSearchBody, type InvoiceJob, type InvoiceJobCreated, type InvoiceJobDraft, InvoiceService, type InvokeCloudFunctionOptions, type ItemFee, type ItemFeeDraft, type ItemFeeSearch, type ItemFeeSearchByProductId, type ItemFeeSearchByProductIds, type Job, type JobIdResponse, type Label, type LabelInput, type LabelList, LabelService, type LabelUpdate, type ListConfigOptions, type ListCustomEntitiesOptions, type ListFeesQuery, type ListInstancesQuery, type ListQuery, type ListQuoteReasonsQuery, type ListQuotesQuery, type ListReindexJobsOptions, type ListSchemaReferencesQuery, type ListSchemasQuery, LocationsService, LogLevel, type McpServer, type McpServerInput, MediaService, type MetadataFilter, type MinimumFee, type MutateOptions, type NewPointsEntry, type NextIdCommandRequest, type NextIdOptions, type NextIdResponse, type NextIdsBatchRequest, type NextIdsBatchResponse, type OAuthConfig, type OAuthInput, type OrderCycleList, type OrderEntryEventCreate, type OrderStatusChange, OrdersService, type PackagingProductsChange, type PackingEvent, type PackingEventList, PaginatedItems, PaymentGatewayService, type PersistedAnonymousSession, type PickOrder, type PickOrderList, type PickPackAck, PickPackService, type PointsSummary, PriceService, ProductService, type ProviderModels, QueryFor, type Quote, type QuoteCreated, type QuoteDraft, type QuoteHistory, type QuoteInput, type QuoteReason, type QuoteReasonCreated, type QuoteReasonDraft, type QuoteReasonUpdate, type QuoteResult, QuoteService, type QuoteSlotInput, type QuoteUpdate, RagIndexerService, type RagType, type RecalculationJob, type RecalculationJobCreated, type RecalculationJobInput, type RedeemCouponResult, type RedeemMyPointsInput, type RedeemOption, type RedeemOptionList, type RedeemedPoints, type Redemption, type RedemptionCreated, type RedemptionInput, type ReferralCoupon, type Region, type RegionList, type ReindexEntityType, type ReindexInput, type ReindexJob, type ReindexJobInput, type ReindexJobStatus, ResolvedConfig, type ResourceCreated, type Return, type ReturnCreated, type ReturnInput, type ReturnList, type ReturnPatch, type ReturnUpdate, ReturnsService, RewardPointsService, STORAGE_KEYS, SalesOrdersService, type Schema, type SchemaAttribute, type SchemaDraft, type SchemaExport, type SchemaImportInput, type SchemaInstanceBulkCreateItem, type SchemaInstanceBulkUpsertItem, type SchemaReference, type SchemaReferenceCreated, type SchemaReferenceInput, type SchemaReferenceUpdateInput, SchemaService, type SchemaTypeName, type SchemaUpdate, type SearchImportedRecordsOptions, type SearchInstancesQuery, type SearchQuery, type SearchStreamRecordsOptions, SegmentService, type SequenceSchema, type SequenceSchemaCreate, SequentialIdService, type ServerCookieJar, type ServiceClass, ServiceName, type SessionAttributeInput, type SessionContext, type SessionContextPatch, SessionContextService, type SetItemFeesOptions, type ShippingFee, type ShippingGroup, type ShippingGroupList, type ShippingMethod, type ShippingMethodList, type ShippingPatch, ShippingService, type ShoppingList, type ShoppingListDraft, type ShoppingListItem, ShoppingListService, type Site$1 as Site, type SiteCreated, type SiteFields, type SiteInput, type SiteList, type SiteMixin, type SiteMixinCreated, type SiteMixins, SiteService, StoredAnonymousSession, type TaxCalculationInput, type TaxCalculationRequest, type TaxCalculationResult, type TaxClass, type TaxConfig, type TaxConfigCreated, type TaxCreation as TaxConfigInput, type TaxUpdate as TaxConfigUpdate, type TaxLocation, TaxService, TenantConfigService, type TextRequest, type TextResponse, type Token, type TokenInput, TokenProvider, type TokenStorage, type Tool, type ToolInput, type Unit, type UnitCreated, UnitHandlingService, type UnitInput, type UnitUpdate, type Vendor, type VendorCreated, type VendorInput, type VendorList, type VendorLocation, type VendorLocationInput, type VendorLocationList, type VendorLocationUpdate, type VendorSearchQuery, VendorService, type VendorUpdate, type WebhookConfig, type WebhookConfigCreated, type WebhookConfigDraft, type WebhookConfigPatch, type WebhookDashboardAccess, WebhookService, type WebhookStatistics, type WebhookStatisticsQuery, type WebhookSubscription, type WebhookSubscriptionUpdateItem, type WebhookSubscriptionUpdateResultItem, type Zone, type ZoneList, approvalStatusPatch, createCookieBackedStorage, createCookieStorage, createCore, createEmporixClient, createListenerSet, createLocalStorage, createLocalStorageStorage, createMemoryStorage, createServerStorage, createSessionStorage, emporixKey, errorFromResponse, fromWebStorage, getCustomerSessionStore, parseAnonymousSession, pickFee, productIdFromYrn, productYrn, resolveZone, serverAuth, siteMeta };
13030
+ export { type AddedPoints, type AdminCustomer, type AdminCustomerAddress, type AdminCustomerAddressInput, type AdminCustomerAddressList, type AdminCustomerAddressUpdate, type AdminCustomerCreated, type AdminCustomerImport, type AdminCustomerImportAccount, type AdminCustomerImportResult, type AdminCustomerInput, type AdminCustomerLegacyAuth, type AdminCustomerList, type AdminCustomerPatch, type AdminCustomerSearchQuery, type AdminCustomerUpdate, type AdminPasswordMigrationRetention, type AdminPasswordMigrationRetentionInput, type Agent, type AgentAnalytics, type AgentExecutions, type AgentFromTemplate, type AgentInput, type AgentPatchOp, type AgentRequestLog, type AgentSearchQuery, type AgentSessionLog, type AgentTemplate, type AgenticPatchOp, type AgentsExport, type AgentsExportRequest, type AgentsImport, type AgentsImportRequest, AiService, type AnalyticsQuery, type Approval, type ApprovalCreated, type ApprovalDecision, type ApprovalInput, type ApprovalList, type ApprovalPatch, type ApprovalPermittedInput, type ApprovalPermittedResult, ApprovalService, type ApprovalUsersQuery, type ApprovalUsersResult, type Assignee, type Attachment, type AttachmentOptions, type AttachmentReuseOptions, type AuditLogChangeType, type AuditLogEntry, type AuditLogPage, type AuditLogPathChange, type AuditLogQuery, type AuditLogRelatedEntity, AuditLogService, AuthContext, AvailabilityService, type BatchNextIdEntry, type Brand, type BrandInput, type BrandList, BrandService, type BrandUpdate, type BulkInstanceResult, type BulkPatchInstanceItem, CartService, type Catalog, type CatalogCreated, type CatalogInput, type CatalogList, type CatalogPatch, CatalogService, type CatalogUpdate, CategoryService, type CgRelation, type CgRelationList, type ChatRequest, type ChatResponse, type ChatStreamOptions, CheckoutService, ClientConfigService, type ClientConfiguration, ClientContext, CloudFunctionsService, type CommerceEvents, CompaniesService, type CompletionMessage, type CompletionRequest, type CompletionResponse, type Configuration$1 as Configuration, type ConfigurationDraft, ContactsService, type Conversation, type ConversationSearchQuery, type ConversionFactorInput, type ConversionFactorResult, type ConvertUnitInput, type ConvertUnitResult, type CookieIo, type Country, type CountryList, CountryService, type CountryUpdate, type Coupon$1 as Coupon, type CouponCreated, type CouponInput, type CouponList, CouponService, type CouponUpdate, type Created, type Currency, type CurrencyCreated, type CurrencyInput, type CurrencyList, CurrencyService, type CurrencyUpdate, type CustomEntity, type CustomEntityDraft, type CustomInstance, type CustomInstanceDraft, CustomerAdminService, CustomerGroupsService, CustomerService, type CustomerSessionState, type CustomerSessionStore, type CustomerSummaryBatch, CustomerTokenRefresher, type DeleteAgentOptions, type DeleteConfigOptions, type DeliveryCreated, type DeliveryCycleInput, type DeliverySlot, type DeliverySlotList, type DeliveryTime$1 as DeliveryTime, type DeliveryTimeInput, type DeliveryTimeList, type DeliveryTimeUpdate, type DeliveryWindow$2 as DeliveryWindow, type DeliveryWindowList, type DeliveryWindowValidation, EmporixAuthError, EmporixClient, EmporixConfig, type EmporixCore, EmporixError, EmporixForbiddenError, EmporixInsufficientScopeError, EmporixNetworkError, EmporixNotFoundError, EmporixServerError, type EmporixStorage, type EmporixStorageKey, EmporixTimeoutError, EmporixValidationError, type ExchangeRate, type ExchangeRateCreated, type ExchangeRateInput, type ExchangeRateList, type ExchangeRateUpdate, type ExecutionsQuery, type Fee$1 as Fee, type FeeDraft, FeeService, type FindSiteInput, type GetOptions, type IamAccessControl, type IamAccessControlCreated, type IamAccessControlUpsert, type IamGroup, type IamGroupCreate, type IamGroupCreated, AssignmentCreateRequest as IamGroupMemberAssignment, type IamGroupMemberCreated, type IamGroupMemberInput, type IamGroupUpdate, type IamScope, type IamScopeCreated, type IamScopeUpsert, IamService, type IamUser, type IamUserCreate, type IamUserCreated, type IamUserDetail, type IamUserScopes, type IamUserUpdate, type ImportCancelResult, type ImportConfig, type ImportErrorRecord, type ImportPage, type ImportPageOptions, type ImportRecordOutcome, type ImportRun, type ImportRunDetail, type ImportRunEvent, type ImportRunInput, type ImportRunMode, type ImportRunStatus, type ImportRunStream, type ImportSchedule, ImportService, type ImportStream, type ImportedRecord, type IndexConfig, type IndexConfigCreated, type IndexPublicConfig, IndexingService, type InstanceSearchBody, type InvoiceJob, type InvoiceJobCreated, type InvoiceJobDraft, InvoiceService, type InvokeCloudFunctionOptions, type ItemFee, type ItemFeeDraft, type ItemFeeSearch, type ItemFeeSearchByProductId, type ItemFeeSearchByProductIds, type Job, type JobIdResponse, type Label, type LabelInput, type LabelList, LabelService, type LabelUpdate, type ListConfigOptions, type ListCustomEntitiesOptions, type ListFeesQuery, type ListInstancesQuery, type ListQuery, type ListQuoteReasonsQuery, type ListQuotesQuery, type ListReindexJobsOptions, type ListSchemaReferencesQuery, type ListSchemasQuery, LocationsService, LogLevel, type McpServer, type McpServerInput, MediaService, type MetadataFilter, type MinimumFee, type MutateOptions, type NewPointsEntry, type NextIdCommandRequest, type NextIdOptions, type NextIdResponse, type NextIdsBatchRequest, type NextIdsBatchResponse, type OAuthConfig, type OAuthInput, type OrderCycleList, type OrderEntryEventCreate, type OrderStatusChange, OrdersService, type PackagingProductsChange, type PackingEvent, type PackingEventList, PaginatedItems, PaymentGatewayService, type PersistedAnonymousSession, type PickOrder, type PickOrderList, type PickPackAck, PickPackService, type PointsSummary, PriceService, ProductService, type ProviderModels, QueryFor, type Quote, type QuoteCreated, type QuoteDraft, type QuoteHistory, type QuoteInput, type QuoteReason, type QuoteReasonCreated, type QuoteReasonDraft, type QuoteReasonUpdate, type QuoteResult, QuoteService, type QuoteSlotInput, type QuoteUpdate, RagIndexerService, type RagType, type RecalculationJob, type RecalculationJobCreated, type RecalculationJobInput, type RedeemCouponResult, type RedeemMyPointsInput, type RedeemOption, type RedeemOptionList, type RedeemedPoints, type Redemption, type RedemptionCreated, type RedemptionInput, type ReferralCoupon, type Region, type RegionList, type ReindexEntityType, type ReindexInput, type ReindexJob, type ReindexJobInput, type ReindexJobStatus, ResolvedConfig, type ResourceCreated, type Return, type ReturnCreated, type ReturnInput, type ReturnList, type ReturnPatch, type ReturnUpdate, ReturnsService, RewardPointsService, STORAGE_KEYS, SalesOrdersService, type Schema, type SchemaAttribute, type SchemaDraft, type SchemaExport, type SchemaImportInput, type SchemaInstanceBulkCreateItem, type SchemaInstanceBulkUpsertItem, type SchemaReference, type SchemaReferenceCreated, type SchemaReferenceInput, type SchemaReferenceUpdateInput, SchemaService, type SchemaTypeName, type SchemaUpdate, type SearchImportedRecordsOptions, type SearchInstancesQuery, type SearchQuery, type SearchStreamRecordsOptions, SegmentService, type SequenceSchema, type SequenceSchemaCreate, SequentialIdService, type ServerCookieJar, type ServiceClass, ServiceName, type SessionAttributeInput, type SessionContext, type SessionContextPatch, SessionContextService, type SetItemFeesOptions, type ShippingFee, type ShippingGroup, type ShippingGroupList, type ShippingMethod, type ShippingMethodList, type ShippingPatch, ShippingService, type ShoppingList, type ShoppingListDraft, type ShoppingListItem, ShoppingListService, type Site$1 as Site, type SiteCreated, type SiteFields, type SiteInput, type SiteList, type SiteMixin, type SiteMixinCreated, type SiteMixins, SiteService, StoredAnonymousSession, type TaxCalculationInput, type TaxCalculationRequest, type TaxCalculationResult, type TaxClass, type TaxConfig, type TaxConfigCreated, type TaxCreation as TaxConfigInput, type TaxUpdate as TaxConfigUpdate, type TaxLocation, TaxService, TenantConfigService, type TextRequest, type TextResponse, type Token, type TokenInput, TokenProvider, type TokenStorage, type Tool, type ToolInput, type Unit, type UnitCreated, UnitHandlingService, type UnitInput, type UnitUpdate, type Vendor, type VendorCreated, type VendorInput, type VendorList, type VendorLocation, type VendorLocationInput, type VendorLocationList, type VendorLocationUpdate, type VendorSearchQuery, VendorService, type VendorUpdate, type WebhookConfig, type WebhookConfigCreated, type WebhookConfigDraft, type WebhookConfigPatch, type WebhookDashboardAccess, WebhookService, type WebhookStatistics, type WebhookStatisticsQuery, type WebhookSubscription, type WebhookSubscriptionUpdateItem, type WebhookSubscriptionUpdateResultItem, type Zone, type ZoneList, approvalStatusPatch, createCookieBackedStorage, createCookieStorage, createCore, createEmporixClient, createListenerSet, createLocalStorage, createLocalStorageStorage, createMemoryStorage, createServerStorage, createSessionStorage, emporixKey, errorFromResponse, fromWebStorage, getCustomerSessionStore, parseAnonymousSession, pickFee, productIdFromYrn, productYrn, resolveZone, serverAuth, siteMeta };
package/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import { LocationsService } from './chunk-IAOWDMTA.js';
2
2
  export { LocationsService } from './chunk-IAOWDMTA.js';
3
- import { MediaService } from './chunk-TI56QENX.js';
4
- export { MediaService } from './chunk-TI56QENX.js';
3
+ import { MediaService } from './chunk-CSYXGTOH.js';
4
+ export { MediaService } from './chunk-CSYXGTOH.js';
5
5
  import { OrdersService, SalesOrdersService } from './chunk-P3RANRGB.js';
6
6
  export { OrdersService, SalesOrdersService } from './chunk-P3RANRGB.js';
7
7
  import { auth, resolveToken, DefaultTokenProvider, CustomerRefreshRegistry, PaymentGatewayService } from './chunk-4VRUMCS2.js';
8
8
  export { CustomerRefreshRegistry, DefaultTokenProvider, PaymentGatewayService, auth, resolveToken } from './chunk-4VRUMCS2.js';
9
9
  import { PriceService } from './chunk-ZOFGDNSX.js';
10
10
  export { PriceService } from './chunk-ZOFGDNSX.js';
11
- import { ProductService } from './chunk-JQWUGGRV.js';
12
- export { ProductService } from './chunk-JQWUGGRV.js';
11
+ import { ProductService } from './chunk-2SHTDVOC.js';
12
+ export { ProductService } from './chunk-2SHTDVOC.js';
13
13
  import { SegmentService } from './chunk-3G5KROEC.js';
14
14
  export { SegmentService } from './chunk-3G5KROEC.js';
15
15
  import { AvailabilityService } from './chunk-XQAOHHXL.js';
@@ -945,7 +945,7 @@ var HttpClient = class {
945
945
  };
946
946
 
947
947
  // package.json
948
- var version = "3.4.2";
948
+ var version = "3.6.0";
949
949
 
950
950
  // src/version.ts
951
951
  var SDK_VERSION = version;
@@ -2770,6 +2770,10 @@ var AiService = class {
2770
2770
  * (`POST /agentic/{agentId}/attachments`, multipart, HTTP 201). The response
2771
2771
  * `sessionId` must be threaded into subsequent chat calls to bind the file.
2772
2772
  * Pass `opts.sessionId` to attach to an existing session.
2773
+ *
2774
+ * The endpoint takes exactly one of `attachment` or `attachmentId` — both or
2775
+ * neither is a `400`. This method always sends the file; to point a second
2776
+ * agent at a file already in the session, use {@link reuseAttachment}.
2773
2777
  */
2774
2778
  async uploadAttachment(agentId, attachment, opts = {}, auth2 = SERVICE10) {
2775
2779
  const form = new FormData();
@@ -2782,6 +2786,31 @@ var AiService = class {
2782
2786
  ...opts.sessionId ? { headers: { "session-id": opts.sessionId } } : {}
2783
2787
  });
2784
2788
  }
2789
+ /**
2790
+ * Assign an attachment that already exists in a session to another agent
2791
+ * (`POST /agentic/{agentId}/attachments` with the `attachmentId` form field,
2792
+ * HTTP 204 — nothing is returned, unlike {@link uploadAttachment}'s 201).
2793
+ *
2794
+ * Use it to hand a second agent the same file instead of uploading it twice.
2795
+ * The attachment is resolved inside `opts.sessionId`, which is why that is
2796
+ * required rather than optional — the id alone does not identify a file.
2797
+ *
2798
+ * ```ts
2799
+ * const { id, sessionId } = await client.ai.uploadAttachment("agent-a", file);
2800
+ * await client.ai.reuseAttachment("agent-b", id!, { sessionId: sessionId! });
2801
+ * ```
2802
+ */
2803
+ async reuseAttachment(agentId, attachmentId, opts, auth2 = SERVICE10) {
2804
+ const form = new FormData();
2805
+ form.append("attachmentId", attachmentId);
2806
+ await this.ctx.http.request({
2807
+ method: "POST",
2808
+ path: `${this.base()}/agentic/${encodeURIComponent(agentId)}/attachments`,
2809
+ auth: auth2,
2810
+ body: form,
2811
+ headers: { "session-id": opts.sessionId }
2812
+ });
2813
+ }
2785
2814
  /** Export agents + components as a base64/checksum blob (`POST /agentic/agents/export`). */
2786
2815
  async exportAgents(body, auth2 = SERVICE10) {
2787
2816
  return this.ctx.http.request({
@@ -4144,7 +4173,7 @@ var IndexingService = class {
4144
4173
  auth: auth2
4145
4174
  });
4146
4175
  }
4147
- /** Create a configuration. */
4176
+ /** Create a configuration. Nothing is stored if credential validation fails. */
4148
4177
  async createConfiguration(input, auth2 = SERVICE21) {
4149
4178
  return this.ctx.http.request({
4150
4179
  method: "POST",
@@ -4153,7 +4182,7 @@ var IndexingService = class {
4153
4182
  body: input
4154
4183
  });
4155
4184
  }
4156
- /** Update a configuration by provider name. */
4185
+ /** Update a configuration. Left unchanged if credential validation fails. */
4157
4186
  async updateConfiguration(provider, input, auth2 = SERVICE21) {
4158
4187
  await this.ctx.http.request({
4159
4188
  method: "PUT",
@@ -4187,6 +4216,9 @@ var IndexingService = class {
4187
4216
  * given `entityType`; set `rag: true` to also rebuild the RAG vector index
4188
4217
  * (PRODUCT only). Resolves to the created job (`201`) or, when a job for that
4189
4218
  * `entityType` is already `IN_PROGRESS`, that running job (`200`).
4219
+ *
4220
+ * On `BATTERY_INCLUDED` with `entityType: "PRODUCT"` the stored credentials
4221
+ * are validated first; no job is created on the `400`/`502` cases above.
4190
4222
  */
4191
4223
  async createReindexJob(input, auth2 = SERVICE21) {
4192
4224
  return this.ctx.http.request({
@@ -4202,6 +4234,7 @@ var IndexingService = class {
4202
4234
  const pageSize = opts.pageSize ?? 50;
4203
4235
  const query = { pageNumber, pageSize };
4204
4236
  if (opts.q !== void 0) query.q = opts.q;
4237
+ if (opts.sort !== void 0) query.sort = opts.sort;
4205
4238
  return requestPage(
4206
4239
  this.ctx.http,
4207
4240
  {
@@ -4226,7 +4259,8 @@ var IndexingService = class {
4226
4259
  });
4227
4260
  }
4228
4261
  /**
4229
- * Trigger a reindex.
4262
+ * Trigger a reindex. On `BATTERY_INCLUDED` the same credential validation
4263
+ * runs first, so this can fail with `400`/`502` before any job starts.
4230
4264
  * @deprecated since 2026-06-18, removal 2026-12-01 — use {@link createReindexJob}
4231
4265
  * (`createReindexJob({ entityType: "PRODUCT" })`), which returns a trackable job.
4232
4266
  */