@viu/emporix-sdk 2.33.4 → 2.34.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/CHANGELOG.md +40 -0
- package/dist/index.cjs +27 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +60 -5
- package/dist/index.d.ts +60 -5
- package/dist/index.js +26 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1023,12 +1023,30 @@ type SequenceSchema$1 = SequenceSchemaCreate$1 & {
|
|
|
1023
1023
|
};
|
|
1024
1024
|
};
|
|
1025
1025
|
/**
|
|
1026
|
-
*
|
|
1026
|
+
* Placeholder definitions used in `preText` and `postText`. Names must start and end with `__`.
|
|
1027
1027
|
*/
|
|
1028
1028
|
type Placeholders = {
|
|
1029
1029
|
[key: string]: {
|
|
1030
|
-
|
|
1030
|
+
/**
|
|
1031
|
+
* Flag indicating whether the placeholder must be resolved when generating an ID.
|
|
1032
|
+
*/
|
|
1033
|
+
required: boolean;
|
|
1034
|
+
/**
|
|
1035
|
+
* Replacement used when the placeholder is not set in the request. Used only when `required` is `false`.
|
|
1036
|
+
*/
|
|
1031
1037
|
default?: string;
|
|
1038
|
+
/**
|
|
1039
|
+
* Dotted path into the site or site mixins response. Resolved when `siteCode` is provided.
|
|
1040
|
+
*/
|
|
1041
|
+
sitePath?: string;
|
|
1042
|
+
/**
|
|
1043
|
+
* Maximum array elements to include. Defaults to `3`. Ignored for scalars.
|
|
1044
|
+
*/
|
|
1045
|
+
arrayLimit?: number;
|
|
1046
|
+
/**
|
|
1047
|
+
* Separator for joined array elements. Defaults to `-`. Ignored for scalars.
|
|
1048
|
+
*/
|
|
1049
|
+
delimiter?: string;
|
|
1032
1050
|
};
|
|
1033
1051
|
};
|
|
1034
1052
|
type SequenceSchemaCreate$1 = {
|
|
@@ -1867,7 +1885,7 @@ type IdResponse$1 = {
|
|
|
1867
1885
|
/**
|
|
1868
1886
|
* Type which the schema should be assigned to. Can be one of the predefined values or any custom schema type id.
|
|
1869
1887
|
*/
|
|
1870
|
-
type SchemaType = 'CART' | 'CART_ITEM' | 'CATEGORY' | 'COMPANY' | 'COUPON' | 'CUSTOMER' | 'CUSTOMER_ADDRESS' | 'ORDER' | 'ORDER_ENTRY' | 'PRODUCT' | 'QUOTE' | 'RETURN' | 'PRICE_LIST' | 'SITE' | 'CUSTOM_ENTITY' | 'VENDOR' | 'MEDIA';
|
|
1888
|
+
type SchemaType = 'AVAILABILITY' | 'CART' | 'CART_ITEM' | 'CATEGORY' | 'COMPANY' | 'COUPON' | 'CUSTOMER' | 'CUSTOMER_ADDRESS' | 'LOCATION' | 'ORDER' | 'ORDER_ENTRY' | 'PRODUCT' | 'QUOTE' | 'RETURN' | 'PRICE_LIST' | 'SITE' | 'CUSTOM_ENTITY' | 'VENDOR' | 'MEDIA';
|
|
1871
1889
|
/**
|
|
1872
1890
|
* Type of the attribute.
|
|
1873
1891
|
*
|
|
@@ -10802,7 +10820,7 @@ type CreateQuoteApprovalRequest = GenericApprovalForCreate & {
|
|
|
10802
10820
|
* Approval partial update operation list.
|
|
10803
10821
|
*/
|
|
10804
10822
|
type UpdateApprovalRequest = Array<{
|
|
10805
|
-
op: '
|
|
10823
|
+
op: 'add' | 'remove' | 'replace';
|
|
10806
10824
|
path: '/status' | '/details*' | '/comment' | '/approverComment' | '/resource/deliveryWindow*';
|
|
10807
10825
|
value?: ApprovalStatus | string | {
|
|
10808
10826
|
[key: string]: unknown;
|
|
@@ -10911,6 +10929,32 @@ declare class ApprovalService {
|
|
|
10911
10929
|
/** Search for users eligible to approve a resource. Returns an array. */
|
|
10912
10930
|
searchApprovers(input: ApprovalUsersQuery, auth?: AuthContext): Promise<ApprovalUsersResult>;
|
|
10913
10931
|
}
|
|
10932
|
+
/** The status transitions a client can request. `PENDING` and `EXPIRED` are set by Emporix. */
|
|
10933
|
+
type ApprovalDecision = "APPROVED" | "DECLINED" | "CLOSED";
|
|
10934
|
+
/**
|
|
10935
|
+
* Builds the JSON-Patch for an approval decision, with both measured quirks baked in.
|
|
10936
|
+
*
|
|
10937
|
+
* Two things about this patch are counter-intuitive, both measured against tenant
|
|
10938
|
+
* `viu` on 2026-08-18:
|
|
10939
|
+
*
|
|
10940
|
+
* 1. **`replace` is lowercase.** The upstream spec shipped the enum uppercase and the
|
|
10941
|
+
* live API answers `REPLACE` with 400. That is repaired at the spec level (see
|
|
10942
|
+
* `scripts/spec-patches.ts`), so the type now guides you correctly.
|
|
10943
|
+
* 2. **The approver comment needs `add`, not `replace`.** `approverComment` does not
|
|
10944
|
+
* exist on a fresh approval, and `replace` on an absent field answers
|
|
10945
|
+
* `APPROVAL-400010` «Missing field "approverComment"». Because PATCH is atomic,
|
|
10946
|
+
* that failure takes the status change down with it — the decision silently does
|
|
10947
|
+
* not happen. `add` creates the field and overwrites it on a second decision, so
|
|
10948
|
+
* it is correct in both cases. The upstream spec's own «Add comment by the
|
|
10949
|
+
* approver» example agrees; only its enum did not.
|
|
10950
|
+
*
|
|
10951
|
+
* Status and comment travel in one request on purpose: since PATCH is atomic, a
|
|
10952
|
+
* rejection can never land without its reason.
|
|
10953
|
+
*
|
|
10954
|
+
* @example
|
|
10955
|
+
* await client.approvals.updateApproval(id, approvalStatusPatch("DECLINED", "Over budget"), auth);
|
|
10956
|
+
*/
|
|
10957
|
+
declare function approvalStatusPatch(status: ApprovalDecision, approverComment?: string): ApprovalPatch;
|
|
10914
10958
|
|
|
10915
10959
|
/** The Emporix SDK entry point. One instance safely serves many concurrent shoppers. */
|
|
10916
10960
|
declare class EmporixClient {
|
|
@@ -11062,7 +11106,18 @@ declare function createEmporixClient<S extends Record<string, ServiceClass<unkno
|
|
|
11062
11106
|
* (`urn:yaas:hybris:product:product:<tenant>;<productId>`). Cart and order line
|
|
11063
11107
|
* items carry only the YRN, not a bare product id. Returns "" when the YRN is
|
|
11064
11108
|
* missing or has no `;` segment.
|
|
11109
|
+
*
|
|
11110
|
+
* Approval resource items are an exception: their `itemYrn` is frequently the bare
|
|
11111
|
+
* product id with no YRN wrapper, so this returns "" and you want the sibling
|
|
11112
|
+
* `itemId` as a fallback. Measured on tenant `viu`, 2026-08-18.
|
|
11065
11113
|
*/
|
|
11066
11114
|
declare function productIdFromYrn(yrn: string | undefined): string;
|
|
11115
|
+
/**
|
|
11116
|
+
* Builds a product `itemYrn` — the form `carts.addItem` requires.
|
|
11117
|
+
*
|
|
11118
|
+
* The inverse of {@link productIdFromYrn}. Emporix rejects anything else with
|
|
11119
|
+
* «Given yrn does not match yaas urn scheme».
|
|
11120
|
+
*/
|
|
11121
|
+
declare function productYrn(tenant: string, productId: string): string;
|
|
11067
11122
|
|
|
11068
|
-
export { type AddedPoints, type AdminCustomer, type AdminCustomerAddress, type AdminCustomerAddressInput, type AdminCustomerAddressList, type AdminCustomerAddressUpdate, type AdminCustomerCreated, type AdminCustomerInput, type AdminCustomerList, type AdminCustomerPatch, type AdminCustomerSearchQuery, type AdminCustomerUpdate, 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 ApprovalInput, type ApprovalList, type ApprovalPatch, type ApprovalPermittedInput, type ApprovalPermittedResult, ApprovalService, type ApprovalUsersQuery, type ApprovalUsersResult, type Assignee, type Attachment, type AttachmentOptions, 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 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, SepaExportService, type SepaJob, type SepaJobCreated, type SepaJobInput, 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 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, createCookieBackedStorage, createCore, createEmporixClient, createServerStorage, errorFromResponse, parseAnonymousSession, pickFee, productIdFromYrn, resolveZone, serverAuth };
|
|
11123
|
+
export { type AddedPoints, type AdminCustomer, type AdminCustomerAddress, type AdminCustomerAddressInput, type AdminCustomerAddressList, type AdminCustomerAddressUpdate, type AdminCustomerCreated, type AdminCustomerInput, type AdminCustomerList, type AdminCustomerPatch, type AdminCustomerSearchQuery, type AdminCustomerUpdate, 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, 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 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, SepaExportService, type SepaJob, type SepaJobCreated, type SepaJobInput, 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 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, createCore, createEmporixClient, createServerStorage, errorFromResponse, parseAnonymousSession, pickFee, productIdFromYrn, productYrn, resolveZone, serverAuth };
|
package/dist/index.d.ts
CHANGED
|
@@ -1023,12 +1023,30 @@ type SequenceSchema$1 = SequenceSchemaCreate$1 & {
|
|
|
1023
1023
|
};
|
|
1024
1024
|
};
|
|
1025
1025
|
/**
|
|
1026
|
-
*
|
|
1026
|
+
* Placeholder definitions used in `preText` and `postText`. Names must start and end with `__`.
|
|
1027
1027
|
*/
|
|
1028
1028
|
type Placeholders = {
|
|
1029
1029
|
[key: string]: {
|
|
1030
|
-
|
|
1030
|
+
/**
|
|
1031
|
+
* Flag indicating whether the placeholder must be resolved when generating an ID.
|
|
1032
|
+
*/
|
|
1033
|
+
required: boolean;
|
|
1034
|
+
/**
|
|
1035
|
+
* Replacement used when the placeholder is not set in the request. Used only when `required` is `false`.
|
|
1036
|
+
*/
|
|
1031
1037
|
default?: string;
|
|
1038
|
+
/**
|
|
1039
|
+
* Dotted path into the site or site mixins response. Resolved when `siteCode` is provided.
|
|
1040
|
+
*/
|
|
1041
|
+
sitePath?: string;
|
|
1042
|
+
/**
|
|
1043
|
+
* Maximum array elements to include. Defaults to `3`. Ignored for scalars.
|
|
1044
|
+
*/
|
|
1045
|
+
arrayLimit?: number;
|
|
1046
|
+
/**
|
|
1047
|
+
* Separator for joined array elements. Defaults to `-`. Ignored for scalars.
|
|
1048
|
+
*/
|
|
1049
|
+
delimiter?: string;
|
|
1032
1050
|
};
|
|
1033
1051
|
};
|
|
1034
1052
|
type SequenceSchemaCreate$1 = {
|
|
@@ -1867,7 +1885,7 @@ type IdResponse$1 = {
|
|
|
1867
1885
|
/**
|
|
1868
1886
|
* Type which the schema should be assigned to. Can be one of the predefined values or any custom schema type id.
|
|
1869
1887
|
*/
|
|
1870
|
-
type SchemaType = 'CART' | 'CART_ITEM' | 'CATEGORY' | 'COMPANY' | 'COUPON' | 'CUSTOMER' | 'CUSTOMER_ADDRESS' | 'ORDER' | 'ORDER_ENTRY' | 'PRODUCT' | 'QUOTE' | 'RETURN' | 'PRICE_LIST' | 'SITE' | 'CUSTOM_ENTITY' | 'VENDOR' | 'MEDIA';
|
|
1888
|
+
type SchemaType = 'AVAILABILITY' | 'CART' | 'CART_ITEM' | 'CATEGORY' | 'COMPANY' | 'COUPON' | 'CUSTOMER' | 'CUSTOMER_ADDRESS' | 'LOCATION' | 'ORDER' | 'ORDER_ENTRY' | 'PRODUCT' | 'QUOTE' | 'RETURN' | 'PRICE_LIST' | 'SITE' | 'CUSTOM_ENTITY' | 'VENDOR' | 'MEDIA';
|
|
1871
1889
|
/**
|
|
1872
1890
|
* Type of the attribute.
|
|
1873
1891
|
*
|
|
@@ -10802,7 +10820,7 @@ type CreateQuoteApprovalRequest = GenericApprovalForCreate & {
|
|
|
10802
10820
|
* Approval partial update operation list.
|
|
10803
10821
|
*/
|
|
10804
10822
|
type UpdateApprovalRequest = Array<{
|
|
10805
|
-
op: '
|
|
10823
|
+
op: 'add' | 'remove' | 'replace';
|
|
10806
10824
|
path: '/status' | '/details*' | '/comment' | '/approverComment' | '/resource/deliveryWindow*';
|
|
10807
10825
|
value?: ApprovalStatus | string | {
|
|
10808
10826
|
[key: string]: unknown;
|
|
@@ -10911,6 +10929,32 @@ declare class ApprovalService {
|
|
|
10911
10929
|
/** Search for users eligible to approve a resource. Returns an array. */
|
|
10912
10930
|
searchApprovers(input: ApprovalUsersQuery, auth?: AuthContext): Promise<ApprovalUsersResult>;
|
|
10913
10931
|
}
|
|
10932
|
+
/** The status transitions a client can request. `PENDING` and `EXPIRED` are set by Emporix. */
|
|
10933
|
+
type ApprovalDecision = "APPROVED" | "DECLINED" | "CLOSED";
|
|
10934
|
+
/**
|
|
10935
|
+
* Builds the JSON-Patch for an approval decision, with both measured quirks baked in.
|
|
10936
|
+
*
|
|
10937
|
+
* Two things about this patch are counter-intuitive, both measured against tenant
|
|
10938
|
+
* `viu` on 2026-08-18:
|
|
10939
|
+
*
|
|
10940
|
+
* 1. **`replace` is lowercase.** The upstream spec shipped the enum uppercase and the
|
|
10941
|
+
* live API answers `REPLACE` with 400. That is repaired at the spec level (see
|
|
10942
|
+
* `scripts/spec-patches.ts`), so the type now guides you correctly.
|
|
10943
|
+
* 2. **The approver comment needs `add`, not `replace`.** `approverComment` does not
|
|
10944
|
+
* exist on a fresh approval, and `replace` on an absent field answers
|
|
10945
|
+
* `APPROVAL-400010` «Missing field "approverComment"». Because PATCH is atomic,
|
|
10946
|
+
* that failure takes the status change down with it — the decision silently does
|
|
10947
|
+
* not happen. `add` creates the field and overwrites it on a second decision, so
|
|
10948
|
+
* it is correct in both cases. The upstream spec's own «Add comment by the
|
|
10949
|
+
* approver» example agrees; only its enum did not.
|
|
10950
|
+
*
|
|
10951
|
+
* Status and comment travel in one request on purpose: since PATCH is atomic, a
|
|
10952
|
+
* rejection can never land without its reason.
|
|
10953
|
+
*
|
|
10954
|
+
* @example
|
|
10955
|
+
* await client.approvals.updateApproval(id, approvalStatusPatch("DECLINED", "Over budget"), auth);
|
|
10956
|
+
*/
|
|
10957
|
+
declare function approvalStatusPatch(status: ApprovalDecision, approverComment?: string): ApprovalPatch;
|
|
10914
10958
|
|
|
10915
10959
|
/** The Emporix SDK entry point. One instance safely serves many concurrent shoppers. */
|
|
10916
10960
|
declare class EmporixClient {
|
|
@@ -11062,7 +11106,18 @@ declare function createEmporixClient<S extends Record<string, ServiceClass<unkno
|
|
|
11062
11106
|
* (`urn:yaas:hybris:product:product:<tenant>;<productId>`). Cart and order line
|
|
11063
11107
|
* items carry only the YRN, not a bare product id. Returns "" when the YRN is
|
|
11064
11108
|
* missing or has no `;` segment.
|
|
11109
|
+
*
|
|
11110
|
+
* Approval resource items are an exception: their `itemYrn` is frequently the bare
|
|
11111
|
+
* product id with no YRN wrapper, so this returns "" and you want the sibling
|
|
11112
|
+
* `itemId` as a fallback. Measured on tenant `viu`, 2026-08-18.
|
|
11065
11113
|
*/
|
|
11066
11114
|
declare function productIdFromYrn(yrn: string | undefined): string;
|
|
11115
|
+
/**
|
|
11116
|
+
* Builds a product `itemYrn` — the form `carts.addItem` requires.
|
|
11117
|
+
*
|
|
11118
|
+
* The inverse of {@link productIdFromYrn}. Emporix rejects anything else with
|
|
11119
|
+
* «Given yrn does not match yaas urn scheme».
|
|
11120
|
+
*/
|
|
11121
|
+
declare function productYrn(tenant: string, productId: string): string;
|
|
11067
11122
|
|
|
11068
|
-
export { type AddedPoints, type AdminCustomer, type AdminCustomerAddress, type AdminCustomerAddressInput, type AdminCustomerAddressList, type AdminCustomerAddressUpdate, type AdminCustomerCreated, type AdminCustomerInput, type AdminCustomerList, type AdminCustomerPatch, type AdminCustomerSearchQuery, type AdminCustomerUpdate, 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 ApprovalInput, type ApprovalList, type ApprovalPatch, type ApprovalPermittedInput, type ApprovalPermittedResult, ApprovalService, type ApprovalUsersQuery, type ApprovalUsersResult, type Assignee, type Attachment, type AttachmentOptions, 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 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, SepaExportService, type SepaJob, type SepaJobCreated, type SepaJobInput, 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 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, createCookieBackedStorage, createCore, createEmporixClient, createServerStorage, errorFromResponse, parseAnonymousSession, pickFee, productIdFromYrn, resolveZone, serverAuth };
|
|
11123
|
+
export { type AddedPoints, type AdminCustomer, type AdminCustomerAddress, type AdminCustomerAddressInput, type AdminCustomerAddressList, type AdminCustomerAddressUpdate, type AdminCustomerCreated, type AdminCustomerInput, type AdminCustomerList, type AdminCustomerPatch, type AdminCustomerSearchQuery, type AdminCustomerUpdate, 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, 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 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, SepaExportService, type SepaJob, type SepaJobCreated, type SepaJobInput, 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 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, createCore, createEmporixClient, createServerStorage, errorFromResponse, parseAnonymousSession, pickFee, productIdFromYrn, productYrn, resolveZone, serverAuth };
|
package/dist/index.js
CHANGED
|
@@ -39,6 +39,17 @@ export { EmporixAuthError, EmporixError, EmporixForbiddenError, EmporixInsuffici
|
|
|
39
39
|
// src/core/config.ts
|
|
40
40
|
var DEFAULT_HOST = "https://api.emporix.io";
|
|
41
41
|
var TENANT_RE = /^[a-z][a-z0-9]{2,15}$/;
|
|
42
|
+
function warnOnMisplacedContext(input) {
|
|
43
|
+
if (!("context" in input)) return;
|
|
44
|
+
const logger = input.logger;
|
|
45
|
+
if (logger === false) return;
|
|
46
|
+
const message = "EmporixConfig has no top-level `context` \u2014 it is being ignored. Move it into `credentials.storefront.context`, otherwise the anonymous token carries no site/currency/country and price matching returns an empty list without erroring.";
|
|
47
|
+
if (logger && typeof logger.warn === "function") {
|
|
48
|
+
logger.warn(message);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
console.warn(`[emporix] ${message}`);
|
|
52
|
+
}
|
|
42
53
|
function validateConfig(input) {
|
|
43
54
|
if (!TENANT_RE.test(input.tenant)) {
|
|
44
55
|
throw new Error(
|
|
@@ -48,6 +59,7 @@ function validateConfig(input) {
|
|
|
48
59
|
if (!input.credentials) {
|
|
49
60
|
throw new Error("credentials is required (provide at least one of backend/storefront/custom)");
|
|
50
61
|
}
|
|
62
|
+
warnOnMisplacedContext(input);
|
|
51
63
|
return {
|
|
52
64
|
tenant: input.tenant,
|
|
53
65
|
host: input.host ?? DEFAULT_HOST,
|
|
@@ -686,7 +698,7 @@ var HttpClient = class {
|
|
|
686
698
|
};
|
|
687
699
|
|
|
688
700
|
// package.json
|
|
689
|
-
var version = "2.
|
|
701
|
+
var version = "2.34.0";
|
|
690
702
|
|
|
691
703
|
// src/version.ts
|
|
692
704
|
var SDK_VERSION = version;
|
|
@@ -4769,6 +4781,15 @@ var ApprovalService = class {
|
|
|
4769
4781
|
});
|
|
4770
4782
|
}
|
|
4771
4783
|
};
|
|
4784
|
+
function approvalStatusPatch(status, approverComment) {
|
|
4785
|
+
const comment = approverComment?.trim() ?? "";
|
|
4786
|
+
return [
|
|
4787
|
+
{ op: "replace", path: "/status", value: status },
|
|
4788
|
+
// `as const` on both fields: the generated type narrows `path` to an enum too, so
|
|
4789
|
+
// a widened `string` from the spread would not be assignable.
|
|
4790
|
+
...comment !== "" ? [{ op: "add", path: "/approverComment", value: comment }] : []
|
|
4791
|
+
];
|
|
4792
|
+
}
|
|
4772
4793
|
|
|
4773
4794
|
// src/client.ts
|
|
4774
4795
|
var EmporixClient = class {
|
|
@@ -4959,7 +4980,10 @@ function productIdFromYrn(yrn) {
|
|
|
4959
4980
|
const semi = yrn.lastIndexOf(";");
|
|
4960
4981
|
return semi >= 0 ? yrn.slice(semi + 1) : "";
|
|
4961
4982
|
}
|
|
4983
|
+
function productYrn(tenant, productId) {
|
|
4984
|
+
return `urn:yaas:hybris:product:product:${tenant};${productId}`;
|
|
4985
|
+
}
|
|
4962
4986
|
|
|
4963
|
-
export { AiService, ApprovalService, BrandService, CatalogService, ClientConfigService, CloudFunctionsService, CountryService, CouponService, CurrencyService, CustomerAdminService, DEFAULT_HOST, EmporixClient, FeeService, HttpClient, ImportService, IndexingService, InvoiceService, LEVEL, LabelService, LevelResolver, PickPackService, QuoteService, RagIndexerService, ReturnsService, RewardPointsService, STORAGE_KEYS, SchemaService, SepaExportService, SequentialIdService, SessionContextService, ShippingService, ShoppingListService, SiteService, TaxService, TenantConfigService, UnitHandlingService, VendorService, WebhookService, createConsoleLogger, createCookieBackedStorage, createCore, createEmporixClient, createNoopLogger, createServerStorage, parseAnonymousSession, pickFee, productIdFromYrn, redact, resolveZone, serverAuth, validateConfig };
|
|
4987
|
+
export { AiService, ApprovalService, BrandService, CatalogService, ClientConfigService, CloudFunctionsService, CountryService, CouponService, CurrencyService, CustomerAdminService, DEFAULT_HOST, EmporixClient, FeeService, HttpClient, ImportService, IndexingService, InvoiceService, LEVEL, LabelService, LevelResolver, PickPackService, QuoteService, RagIndexerService, ReturnsService, RewardPointsService, STORAGE_KEYS, SchemaService, SepaExportService, SequentialIdService, SessionContextService, ShippingService, ShoppingListService, SiteService, TaxService, TenantConfigService, UnitHandlingService, VendorService, WebhookService, approvalStatusPatch, createConsoleLogger, createCookieBackedStorage, createCore, createEmporixClient, createNoopLogger, createServerStorage, parseAnonymousSession, pickFee, productIdFromYrn, productYrn, redact, resolveZone, serverAuth, validateConfig };
|
|
4964
4988
|
//# sourceMappingURL=index.js.map
|
|
4965
4989
|
//# sourceMappingURL=index.js.map
|