@youidian/sdk 3.4.4 → 3.4.5

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
@@ -1,4 +1,4 @@
1
1
  export { OrderStatus as ClientOrderStatus, LoginDeviceType, LoginEnvironment, LoginEnvironmentInput, MessageUI, PaymentEventData, PaymentEventType, PaymentParams, PaymentUI, PaymentUIOptions, PollOptions, WechatMessageBindingUIOptions, createMessageUI, createPaymentUI, detectLoginEnvironment } from './client.cjs';
2
2
  export { FeedbackActor, FeedbackCategoryOption, FeedbackIdentityKind, FeedbackWidgetController, FeedbackWidgetOptions, createFeedbackWidget, mountFeedbackWidget } from './feedback.cjs';
3
3
  export { L as LoginCallbackOptions, a as LoginDisplayMode, b as LoginEventData, c as LoginEventType, d as LoginFallbackRedirectMode, e as LoginParams, f as LoginResult, g as LoginUI, h as LoginUIOptions, i as createLoginUI, j as handleLoginCallbackIfPresent } from './login-Dqemys65.cjs';
4
- export { ActiveSubscriptionInfo, BindPhoneNumberParams, BindPhoneNumberResponse, CancelOrderResponse, CompleteFreeOrderResponse, CreateBankTransferOrderParams, CreateMiniProgramOrderParams, CreateOrderParams, CreateOrderResponse, CreateWechatMessageBindingParams, CreateWechatMessageBindingResponse, CustomAmountRechargeRule, CustomAmountRechargeValidationResult, GetPhoneBindingParams, MerchantPricing, MerchantPricingBreakdownItem, MerchantPricingSnapshot, MessageTemplateDataValue, OrderDetails, OrderStatus, PaymentCallbackData, PaymentClient, PaymentClientOptions, PaymentNotification, PhoneBinding, PricingBreakdown, Product, ProductCustomAmount, ProductCustomAmountCurrency, ProductEntitlements, ProductInventory, ProductMetadata, ProductPrice, ProductResetRule, ProductStock, ProductStockLookupMode, ProductStockQueryOptions, ProductStocksQueryParams, ProductSubscriptionPeriod, SendMessageParams, SendMessageResponse, SendPhoneVerificationCodeParams, SendPhoneVerificationCodeResponse, UpdatePhoneNumberParams, UpdatePhoneNumberResponse, VerifiedLoginToken, WebhookPayload, WechatJsapiPayParams, getCustomAmountRechargeRule, validateCustomAmountRecharge } from './server.cjs';
4
+ export { ActiveSubscriptionInfo, BindPhoneNumberParams, BindPhoneNumberResponse, CancelOrderResponse, CompleteFreeOrderResponse, CreateBankTransferOrderParams, CreateMiniProgramOrderParams, CreateOrderParams, CreateOrderResponse, CreateWechatMessageBindingParams, CreateWechatMessageBindingResponse, CustomAmountRechargeRule, CustomAmountRechargeValidationResult, DiscountPolicy, GetPhoneBindingParams, MerchantPricing, MerchantPricingBreakdownItem, MerchantPricingSnapshot, MessageTemplateDataValue, OrderDetails, OrderStatus, PaymentCallbackData, PaymentClient, PaymentClientOptions, PaymentNotification, PhoneBinding, PricingBreakdown, Product, ProductCustomAmount, ProductCustomAmountCurrency, ProductEntitlements, ProductInventory, ProductMetadata, ProductPrice, ProductResetRule, ProductStock, ProductStockLookupMode, ProductStockQueryOptions, ProductStocksQueryParams, ProductSubscriptionPeriod, SendMessageParams, SendMessageResponse, SendPhoneVerificationCodeParams, SendPhoneVerificationCodeResponse, UpdatePhoneNumberParams, UpdatePhoneNumberResponse, UserProductDiscountEligibility, VerifiedLoginToken, WebhookPayload, WechatJsapiPayParams, getCustomAmountRechargeRule, validateCustomAmountRecharge } from './server.cjs';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { OrderStatus as ClientOrderStatus, LoginDeviceType, LoginEnvironment, LoginEnvironmentInput, MessageUI, PaymentEventData, PaymentEventType, PaymentParams, PaymentUI, PaymentUIOptions, PollOptions, WechatMessageBindingUIOptions, createMessageUI, createPaymentUI, detectLoginEnvironment } from './client.js';
2
2
  export { FeedbackActor, FeedbackCategoryOption, FeedbackIdentityKind, FeedbackWidgetController, FeedbackWidgetOptions, createFeedbackWidget, mountFeedbackWidget } from './feedback.js';
3
3
  export { L as LoginCallbackOptions, a as LoginDisplayMode, b as LoginEventData, c as LoginEventType, d as LoginFallbackRedirectMode, e as LoginParams, f as LoginResult, g as LoginUI, h as LoginUIOptions, i as createLoginUI, j as handleLoginCallbackIfPresent } from './login-Dqemys65.js';
4
- export { ActiveSubscriptionInfo, BindPhoneNumberParams, BindPhoneNumberResponse, CancelOrderResponse, CompleteFreeOrderResponse, CreateBankTransferOrderParams, CreateMiniProgramOrderParams, CreateOrderParams, CreateOrderResponse, CreateWechatMessageBindingParams, CreateWechatMessageBindingResponse, CustomAmountRechargeRule, CustomAmountRechargeValidationResult, GetPhoneBindingParams, MerchantPricing, MerchantPricingBreakdownItem, MerchantPricingSnapshot, MessageTemplateDataValue, OrderDetails, OrderStatus, PaymentCallbackData, PaymentClient, PaymentClientOptions, PaymentNotification, PhoneBinding, PricingBreakdown, Product, ProductCustomAmount, ProductCustomAmountCurrency, ProductEntitlements, ProductInventory, ProductMetadata, ProductPrice, ProductResetRule, ProductStock, ProductStockLookupMode, ProductStockQueryOptions, ProductStocksQueryParams, ProductSubscriptionPeriod, SendMessageParams, SendMessageResponse, SendPhoneVerificationCodeParams, SendPhoneVerificationCodeResponse, UpdatePhoneNumberParams, UpdatePhoneNumberResponse, VerifiedLoginToken, WebhookPayload, WechatJsapiPayParams, getCustomAmountRechargeRule, validateCustomAmountRecharge } from './server.js';
4
+ export { ActiveSubscriptionInfo, BindPhoneNumberParams, BindPhoneNumberResponse, CancelOrderResponse, CompleteFreeOrderResponse, CreateBankTransferOrderParams, CreateMiniProgramOrderParams, CreateOrderParams, CreateOrderResponse, CreateWechatMessageBindingParams, CreateWechatMessageBindingResponse, CustomAmountRechargeRule, CustomAmountRechargeValidationResult, DiscountPolicy, GetPhoneBindingParams, MerchantPricing, MerchantPricingBreakdownItem, MerchantPricingSnapshot, MessageTemplateDataValue, OrderDetails, OrderStatus, PaymentCallbackData, PaymentClient, PaymentClientOptions, PaymentNotification, PhoneBinding, PricingBreakdown, Product, ProductCustomAmount, ProductCustomAmountCurrency, ProductEntitlements, ProductInventory, ProductMetadata, ProductPrice, ProductResetRule, ProductStock, ProductStockLookupMode, ProductStockQueryOptions, ProductStocksQueryParams, ProductSubscriptionPeriod, SendMessageParams, SendMessageResponse, SendPhoneVerificationCodeParams, SendPhoneVerificationCodeResponse, UpdatePhoneNumberParams, UpdatePhoneNumberResponse, UserProductDiscountEligibility, VerifiedLoginToken, WebhookPayload, WechatJsapiPayParams, getCustomAmountRechargeRule, validateCustomAmountRecharge } from './server.js';
package/dist/index.js CHANGED
@@ -3194,6 +3194,30 @@ var PaymentClient = class {
3194
3194
  const path = params.toString() ? `/products?${params.toString()}` : "/products";
3195
3195
  return this.request("GET", path);
3196
3196
  }
3197
+ /** Fetch all currently active discount policies for the configured app. */
3198
+ async getDiscountPolicies() {
3199
+ return this.request("GET", "/discount-policies");
3200
+ }
3201
+ /** Fetch currently active discount policies for one product. */
3202
+ async getProductDiscountPolicies(productIdOrCode) {
3203
+ const value = productIdOrCode?.trim();
3204
+ if (!value) throw new Error("productIdOrCode is required");
3205
+ return this.request(
3206
+ "GET",
3207
+ `/products/${encodeURIComponent(value)}/discount-policies`
3208
+ );
3209
+ }
3210
+ /** Query one user's discount eligibility for one product. */
3211
+ async getUserProductDiscountEligibility(userId, productIdOrCode) {
3212
+ const userValue = userId?.trim();
3213
+ const productValue = productIdOrCode?.trim();
3214
+ if (!userValue) throw new Error("userId is required");
3215
+ if (!productValue) throw new Error("productIdOrCode is required");
3216
+ return this.request(
3217
+ "GET",
3218
+ `/users/${encodeURIComponent(userValue)}/products/${encodeURIComponent(productValue)}/discount-eligibility`
3219
+ );
3220
+ }
3197
3221
  /**
3198
3222
  * Fetch the realtime stock snapshot for a single product.
3199
3223
  */