@fas-core/shared-types 1.0.124 → 1.0.126

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.mts CHANGED
@@ -104,6 +104,9 @@ declare const toIdString: (value: unknown) => string;
104
104
  declare const isNonEmptyString: (value: unknown) => value is string;
105
105
  declare const normalizeNumber: (value: unknown, fallback?: number) => number;
106
106
  declare const isValidEmail: (email: unknown) => email is string;
107
+ declare const MIN_PASSWORD_LENGTH = 8;
108
+ declare const isValidPassword: (value: unknown) => value is string;
109
+ declare const trimmedText: (value: unknown) => string;
107
110
 
108
111
  interface ICurrency extends BaseEntity {
109
112
  name: string;
@@ -220,6 +223,44 @@ interface CouponNetsuiteLink {
220
223
  syncedAt?: Date | string;
221
224
  }
222
225
 
226
+ declare const AuthProviderEnum: {
227
+ readonly CREDENTIALS: "credentials";
228
+ readonly GOOGLE: "google";
229
+ readonly APPLE: "apple";
230
+ readonly FACEBOOK: "facebook";
231
+ };
232
+ type AuthProvider = (typeof AuthProviderEnum)[keyof typeof AuthProviderEnum];
233
+ declare const AUTH_PROVIDER_VALUES: AuthProvider[];
234
+ declare const AccountSourceEnum: {
235
+ readonly SIGNUP: "signup";
236
+ readonly GOOGLE: "google";
237
+ readonly CHECKOUT: "checkout";
238
+ };
239
+ type AccountSource = (typeof AccountSourceEnum)[keyof typeof AccountSourceEnum];
240
+ declare const ACCOUNT_SOURCE_VALUES: AccountSource[];
241
+
242
+ declare const EDITABLE_CUSTOMER_FIELDS: readonly ["firstName", "lastName", "company", "phoneNumber", "profileImage", "address", "status"];
243
+ type EditableCustomerField = (typeof EDITABLE_CUSTOMER_FIELDS)[number];
244
+ interface CustomerSignupRequest {
245
+ email: string;
246
+ firstName: string;
247
+ lastName: string;
248
+ company?: string;
249
+ password: string;
250
+ phoneNumber?: string;
251
+ }
252
+ interface CustomerSocialLoginRequest {
253
+ email: string;
254
+ firstName: string;
255
+ lastName: string;
256
+ googleId: string;
257
+ profileImage?: string;
258
+ }
259
+ type CustomerProfileUpdateRequest = Partial<Pick<ICustomer, EditableCustomerField>> & {
260
+ oldPassword?: string;
261
+ newPassword?: string;
262
+ };
263
+
223
264
  interface IBrand extends BaseEntity {
224
265
  name: string;
225
266
  slug: string;
@@ -818,6 +859,10 @@ interface IOrder extends BaseEntity {
818
859
  interface ICustomer extends BaseEntity {
819
860
  netsuiteId: string;
820
861
  netsuiteEntityId: string;
862
+ netsuiteEmailValidated: boolean | null;
863
+ netsuiteProfileSyncedAt: Date | string | null;
864
+ netsuitePushedAt: Date | string | null;
865
+ netsuitePushError: string;
821
866
  netsuiteLinkAttempts: number;
822
867
  netsuiteLinkAttemptedAt: Date | string | null;
823
868
  netsuiteLinkError: string;
@@ -831,7 +876,7 @@ interface ICustomer extends BaseEntity {
831
876
  password?: string;
832
877
  status: boolean;
833
878
  lastLogin: Date;
834
- authProvider: "credentials" | "google" | "apple" | "facebook" | string | null;
879
+ authProvider: AuthProvider | string | null;
835
880
  googleId: string;
836
881
  emailVerified?: boolean;
837
882
  hasPassword: boolean;
@@ -855,6 +900,7 @@ interface IState extends BaseEntity {
855
900
  }
856
901
 
857
902
  interface IAddress extends BaseEntity {
903
+ netsuiteAddressbookId: string;
858
904
  addressLine1: string;
859
905
  addressLine2: string;
860
906
  city: string;
@@ -999,7 +1045,7 @@ declare const ADMIN_RESOURCE_LIST: readonly [{
999
1045
  readonly label: "Account";
1000
1046
  readonly group: "Settings";
1001
1047
  }];
1002
- declare const ADMIN_RESOURCES: ("stores" | "categories" | "podcast" | "blog" | "dashboard" | "metrics" | "products" | "brands" | "technical-specs" | "addon-configs" | "service-plans" | "relation-groups" | "configurators" | "orders" | "quotes" | "carts" | "transactions" | "coupons" | "store-fees" | "tax-rates" | "customers" | "contact-us" | "subscribers" | "faqs" | "email-templates" | "notifications" | "campaigns" | "currencies" | "redirects" | "cache" | "admins" | "account")[];
1048
+ declare const ADMIN_RESOURCES: ("orders" | "stores" | "categories" | "podcast" | "blog" | "dashboard" | "metrics" | "products" | "brands" | "technical-specs" | "addon-configs" | "service-plans" | "relation-groups" | "configurators" | "quotes" | "carts" | "transactions" | "coupons" | "store-fees" | "tax-rates" | "customers" | "contact-us" | "subscribers" | "faqs" | "email-templates" | "notifications" | "campaigns" | "currencies" | "redirects" | "cache" | "admins" | "account")[];
1003
1049
  type IAdminResource = (typeof ADMIN_RESOURCE_LIST)[number]['value'];
1004
1050
  declare const ADMIN_ACTIONS: readonly ["read", "write", "delete"];
1005
1051
  type IAdminBaseAction = (typeof ADMIN_ACTIONS)[number];
@@ -1084,6 +1130,18 @@ interface StoreAccessCheckInput extends StoreScopeInput {
1084
1130
  }
1085
1131
  declare const hasStoreAccess: (input: StoreAccessCheckInput) => boolean;
1086
1132
 
1133
+ declare const EDITABLE_ADMIN_FIELDS: readonly ["firstName", "lastName", "email", "phoneNumber", "role", "access_list", "joiningDate", "profileImage", "storeAccess", "status"];
1134
+ type EditableAdminField = (typeof EDITABLE_ADMIN_FIELDS)[number];
1135
+ type AdminCreateRequest = Partial<Pick<IAdmin, EditableAdminField>> & {
1136
+ firstName: string;
1137
+ lastName: string;
1138
+ email: string;
1139
+ password: string;
1140
+ };
1141
+ type AdminUpdateRequest = Partial<Pick<IAdmin, EditableAdminField>> & {
1142
+ newPassword?: string;
1143
+ };
1144
+
1087
1145
  declare const CaseStatusEnum: {
1088
1146
  readonly NOT_STARTED: "1";
1089
1147
  readonly IN_PROGRESS: "2";
@@ -6270,6 +6328,10 @@ interface NetsuiteLinkResult {
6270
6328
  netsuiteId: string;
6271
6329
  created: boolean;
6272
6330
  }
6331
+ interface NetsuiteCustomerLinkResult extends NetsuiteLinkResult {
6332
+ netsuiteEntityId: string;
6333
+ skipped?: string;
6334
+ }
6273
6335
 
6274
6336
  declare const NetsuiteRecordTypeEnum: {
6275
6337
  readonly SALES_ORDER: "salesOrder";
@@ -6460,10 +6522,16 @@ interface CheckoutPayload {
6460
6522
  customerNote?: string;
6461
6523
  poNumber?: string;
6462
6524
  }
6525
+ interface QuoteRequestResult {
6526
+ id: string;
6527
+ orderId: string;
6528
+ accountInvited?: boolean;
6529
+ }
6463
6530
  interface CheckoutResult {
6464
6531
  order: IOrder;
6465
6532
  redirectUrl?: string;
6466
6533
  clientToken?: string;
6534
+ accountInvited?: boolean;
6467
6535
  }
6468
6536
 
6469
6537
  declare const ProductEventTypeEnum: {
@@ -6515,4 +6583,4 @@ interface IWishlist extends BaseEntity {
6515
6583
  items: IWishlistItem[];
6516
6584
  }
6517
6585
 
6518
- export { ACTIVE_SUBSCRIPTION_CHANNELS, ADMIN_ACTIONS, ADMIN_AUDIT_ACTIONS, ADMIN_RESOURCES, ADMIN_RESOURCE_LIST, ALL_STORES, AWAITING_PAYMENT_STATUSES, type AddonAmountInput, type AddonGroupNetsuiteLink, type AddonNetsuiteLink, type AddonSelectionRef, type AddonSnapshot, type ApiResponse, type AppliedTax, BRAND_FIELDS, type BaseEntity, CAMPAIGN_RECIPIENT_STATUS_VALUES, CAMPAIGN_STATUS_VALUES, CART_STATUS_VALUES, CASE_ORIGIN_LABELS, CASE_ORIGIN_VALUES, CASE_PRIORITY_LABELS, CASE_PRIORITY_VALUES, CASE_PROFILE_LABELS, CASE_PROFILE_VALUES, CASE_STATUS_COLORS, CASE_STATUS_LABELS, CASE_STATUS_VALUES, CASE_TYPE_LABELS, CASE_TYPE_VALUES, CATEGORY_FIELDS, CONFIGURATOR_CONDITION_TYPE_VALUES, CONFIGURATOR_EFFECT_TYPE_VALUES, CONFIGURATOR_SELECT_MODE_VALUES, CONFIGURATOR_SOURCE_VALUES, CONTACT_PROFILE_OPTIONS, type CacheStatus, type CacheStoreTarget, CampaignRecipientStatusEnum, CampaignStatusEnum, type CartIssue, type CartIssueType, CartIssueTypes, CartStatusEnum, type CartValidation, type CaseOrigin, CaseOriginEnum, type CasePriority, CasePriorityEnum, type CaseProfile, CaseProfileEnum, type CaseStatus, CaseStatusEnum, type CaseType, CaseTypeEnum, type CategoryImportSummary, type CheckoutAddressInput, type CheckoutPayload, type CheckoutResult, ConfiguratorConditionTypeEnum, ConfiguratorEffectTypeEnum, ConfiguratorErrorCodeEnum, type ConfiguratorEvalContext, type ConfiguratorEvalError, type ConfiguratorEvalResult, ConfiguratorSelectModeEnum, type ConfiguratorSelections, ConfiguratorSourceEnum, type CouponNetsuiteLink, DEFAULT_SUBSCRIPTION_TOPICS, DISCOUNT_TYPE_VALUES, DiscountTypeEnum, EMAIL_PARAM_MISMATCH_KIND_VALUES, EMAIL_TEMPLATE_EVENT_VALUES, EMAIL_TEMPLATE_VARIABLES_BY_EVENT, EMPTY_ACCESS, type EffectiveAccess, type EmailParamMismatch, EmailParamMismatchKindEnum, EmailTemplateEventEnum, FEE_APPLIES_TO_VALUES, FeeAppliesToEnum, type FieldMap, type FieldMapping, type FieldSource, type IAddonConfig, type IAddonGroup, type IAddress, type IAdmin, type IAdminAction, type IAdminAuditAction, type IAdminAuditLog, type IAdminBaseAction, type IAdminPermission, type IAdminResource, type IAdminRole, type IAdminRoleCreate, type IAdminSafe, type IAdminStoreAccess, type IAppliedFee, type IBannerSlide, type IBlogAuthor, type IBlogCategory, type IBlogPost, type IBrand, type ICampaign, type ICampaignRecipient, type ICampaignStats, type ICart, type ICartItem, type ICartServicePlanSnapshot, type ICaseMessage, type ICategory, type ICategorySequence, type ICategorySubcategory, type ICategoryUrl, type IConfigurator, type IConfiguratorCondition, type IConfiguratorEffect, type IConfiguratorFacet, type IConfiguratorFacetValue, type IConfiguratorOption, type IConfiguratorPriceAdjustment, type IConfiguratorQuery, type IConfiguratorRule, type IConfiguratorSection, type IConfiguratorStep, type IConfiguratorTarget, type IContact, type ICountry, type ICoupon, type ICurrency, type ICustomer, type IDiscountType, type IEmailTemplate, type IFaq, type IFaqCategory, type IKeyValue, type ILinePricing, type IMediaAsset, INVENTORY_POLICY_VALUES, type INetsuiteCaseLink, type INetsuiteEvent, type INetsuiteOrderLink, type INetsuiteQueueEntry, type INotification, type IOrder, type IOrderItem, type IOrderLog, type IOrderShipment, type IOrderTransaction, type IPaymentLink, type IPodcastEpisode, type IPrice, type IProduct, type IProductDailyStat, type IProductRelationGroup, type IProductTechnicalSpec, type IProductTechnicalSpecTable, type IProductVariantFields, type IProductVariantOptionGroup, type IProductVariantOptionMatrix, type IProductVariantOptionValue, type IRedirect, type IRedirectSuggestion, type IRefundTransaction, type IRelationGroup, type ISEOMetaData, type ISelectableFee, type IServicePlan, type IShipFromAddress, type IShipping, type IShippingRate, type IState, type IStock, type IStore, type IStoreFee, type IStoreSettings, type ISubscriber, type ISubscriberConsent, type ISubscription, type ISummaryPricing, type ISupportCase, type ISupportCaseListItem, type ITaxRate, type ITechnicalSpecColumn, type ITechnicalSpecGroup, type ITransactionBase, type IUnmatched404, type IVariant, type IVariantOptionSelection, type IWishlist, type IWishlistItem, type Id, type InventoryPolicy, InventoryPolicyEnum, type LineChargeInput, type MatchResult, type Metadata, NETSUITE_EVENT_STATE_VALUES, NETSUITE_OWNED_FIELDS, NETSUITE_RECORD_TYPE_VALUES, NETSUITE_RELATION_GROUPS, NOTIFICATION_TYPE_VALUES, NetsuiteEventStateEnum, NetsuiteFieldProvider, type NetsuiteLinkResult, type NetsuiteOrderPreview, type NetsuiteOwnedEntity, type NetsuitePreviewLine, type NetsuitePushAttempt, type NetsuitePushOutcome, type NetsuiteReceipt, NetsuiteRecordTypeEnum, type NetsuiteRelationSource, type NetsuiteStatusChange, type NetsuiteStatusSyncResult, type NetsuiteSyncDefinition, NotificationTypeEnum, OPEN_ORDER_STATUSES, ORDER_LOG_TYPE_VALUES, ORDER_STATUS_VALUES, type OfferedAddon, type OfferedAddonGroup, type OfferedServicePlan, OrderLogTypeEnum, OrderStatusEnum, PAYMENT_GATEWAY_VALUES, PAYMENT_LINK_STATUS_VALUES, PAYMENT_METHOD_VALUES, PAYMENT_STATUS_VALUES, PLACED_OPEN_ORDER_STATUSES, PRICING_TYPE_VALUES, PRODUCT_FIELDS, PRODUCT_VARIANT_TYPE_VALUES, PROVIDERS, PURCHASE_ORDER_STATUSES, PUSH_CHECK_STATUS_VALUES, PaymentGatewayEnum, PaymentLinkStatusEnum, type PaymentLinkView, PaymentMethodEnum, PaymentStatusEnum, type PricedLineLike, type PricingType, PricingTypeEnum, type ProductAddonScope, ProductEventTypeEnum, type ProductServicePlanScope, type ProductVariantType, ProductVariantTypeEnum, type PromotionSyncResult, type PushCheck, PushCheckStatusEnum, type PushField, QUOTE_ORDER_STATUSES, RELATION_FIELDS, RESOURCE_OPERATIONS, RETIRED_CART_STATUSES, type RateAddress, type RatedShippingMethod, type RedirectTargetType, type ResolveAccessInput, type ResolvedAddonSelection, type RevalidationResult, SALE_TYPE_VALUES, SERVICE_PLAN_ELIGIBILITY_FIELD, STATUS_TONE_VALUES, SUBSCRIPTION_CHANNEL_VALUES, SUBSCRIPTION_TOPIC_LABELS, SUBSCRIPTION_TOPIC_VALUES, type SaleType, SaleTypeEnum, type SaleTypedLike, type SelectedShippingMethod, type ServicePlanNetsuiteLink, StatusToneEnum, type StockDemandLine, type StockStatus, StockStatusEnum, type StockVerdict, StockVerdictEnum, type StoreAccessCheckInput, type StoreScopeInput, SubscriptionChannelEnum, SubscriptionTopicEnum, type SyncPolicy, type SyncRisk, TAX_RATE_SOURCE_VALUES, TRANSACTION_TYPE_VALUES, TaxRateSourceEnum, type TaxSyncResult, TransactionTypeEnum, UNPLACED_ORDER_STATUSES, type VariantOptionMode, WIRED_EMAIL_TEMPLATE_EVENTS, actionsForResource, addonFields, addonUnitAmount, addonsOfLine, addonsUnitAmount, adjustmentsFor, applyPriceAdjustments, baseUnitPriceOfLine, blogAuthorFields, blogCategoryFields, blogPostFields, brandFields, can, canAny, canonicalizePath, canonicalizeSlug, canonicalizeUrlSegment, cartAcceptsItem, caseIsOpen, categoryFields, chargesOfLine, conditionHolds, couponFields, demandByKey, evaluateConfigurator, feeHint, formatMoney, grantedPermissions, groupHasDefaultAddon, hasStoreAccess, isConfigurationValid, isContactProfile, isNetsuiteOwned, isNonEmptyString, isQuoteOnlyItem, isValidAction, isValidEmail, missingGrants, netsuiteFieldCaution, netsuiteFieldConditional, netsuiteFieldDerivedFrom, netsuiteFieldNote, netsuiteFieldRisk, netsuiteFieldSource, netsuiteRelationSource, netsuiteStatusLabel, normalizeLineQuantity, normalizeNumber, normalizePath, orderLogTypeColorMap, paymentLinkStatusColorMap, paymentMethodColorMap, paymentStatusColorMap, podcastFields, productFields, readMapped, resolveAddonSelections, resolveEffectivePermissions, resolveProductAddonGroups, resolveProductServicePlans, resolveStoreScope, roundMoney, saleTypeOf, servicePlanFields, statusColors, statusTone, statusTones, stockVerdict, syncOwnerFor, toIdString, typeColorMap };
6586
+ export { ACCOUNT_SOURCE_VALUES, ACTIVE_SUBSCRIPTION_CHANNELS, ADMIN_ACTIONS, ADMIN_AUDIT_ACTIONS, ADMIN_RESOURCES, ADMIN_RESOURCE_LIST, ALL_STORES, AUTH_PROVIDER_VALUES, AWAITING_PAYMENT_STATUSES, type AccountSource, AccountSourceEnum, type AddonAmountInput, type AddonGroupNetsuiteLink, type AddonNetsuiteLink, type AddonSelectionRef, type AddonSnapshot, type AdminCreateRequest, type AdminUpdateRequest, type ApiResponse, type AppliedTax, type AuthProvider, AuthProviderEnum, BRAND_FIELDS, type BaseEntity, CAMPAIGN_RECIPIENT_STATUS_VALUES, CAMPAIGN_STATUS_VALUES, CART_STATUS_VALUES, CASE_ORIGIN_LABELS, CASE_ORIGIN_VALUES, CASE_PRIORITY_LABELS, CASE_PRIORITY_VALUES, CASE_PROFILE_LABELS, CASE_PROFILE_VALUES, CASE_STATUS_COLORS, CASE_STATUS_LABELS, CASE_STATUS_VALUES, CASE_TYPE_LABELS, CASE_TYPE_VALUES, CATEGORY_FIELDS, CONFIGURATOR_CONDITION_TYPE_VALUES, CONFIGURATOR_EFFECT_TYPE_VALUES, CONFIGURATOR_SELECT_MODE_VALUES, CONFIGURATOR_SOURCE_VALUES, CONTACT_PROFILE_OPTIONS, type CacheStatus, type CacheStoreTarget, CampaignRecipientStatusEnum, CampaignStatusEnum, type CartIssue, type CartIssueType, CartIssueTypes, CartStatusEnum, type CartValidation, type CaseOrigin, CaseOriginEnum, type CasePriority, CasePriorityEnum, type CaseProfile, CaseProfileEnum, type CaseStatus, CaseStatusEnum, type CaseType, CaseTypeEnum, type CategoryImportSummary, type CheckoutAddressInput, type CheckoutPayload, type CheckoutResult, ConfiguratorConditionTypeEnum, ConfiguratorEffectTypeEnum, ConfiguratorErrorCodeEnum, type ConfiguratorEvalContext, type ConfiguratorEvalError, type ConfiguratorEvalResult, ConfiguratorSelectModeEnum, type ConfiguratorSelections, ConfiguratorSourceEnum, type CouponNetsuiteLink, type CustomerProfileUpdateRequest, type CustomerSignupRequest, type CustomerSocialLoginRequest, DEFAULT_SUBSCRIPTION_TOPICS, DISCOUNT_TYPE_VALUES, DiscountTypeEnum, EDITABLE_ADMIN_FIELDS, EDITABLE_CUSTOMER_FIELDS, EMAIL_PARAM_MISMATCH_KIND_VALUES, EMAIL_TEMPLATE_EVENT_VALUES, EMAIL_TEMPLATE_VARIABLES_BY_EVENT, EMPTY_ACCESS, type EditableAdminField, type EditableCustomerField, type EffectiveAccess, type EmailParamMismatch, EmailParamMismatchKindEnum, EmailTemplateEventEnum, FEE_APPLIES_TO_VALUES, FeeAppliesToEnum, type FieldMap, type FieldMapping, type FieldSource, type IAddonConfig, type IAddonGroup, type IAddress, type IAdmin, type IAdminAction, type IAdminAuditAction, type IAdminAuditLog, type IAdminBaseAction, type IAdminPermission, type IAdminResource, type IAdminRole, type IAdminRoleCreate, type IAdminSafe, type IAdminStoreAccess, type IAppliedFee, type IBannerSlide, type IBlogAuthor, type IBlogCategory, type IBlogPost, type IBrand, type ICampaign, type ICampaignRecipient, type ICampaignStats, type ICart, type ICartItem, type ICartServicePlanSnapshot, type ICaseMessage, type ICategory, type ICategorySequence, type ICategorySubcategory, type ICategoryUrl, type IConfigurator, type IConfiguratorCondition, type IConfiguratorEffect, type IConfiguratorFacet, type IConfiguratorFacetValue, type IConfiguratorOption, type IConfiguratorPriceAdjustment, type IConfiguratorQuery, type IConfiguratorRule, type IConfiguratorSection, type IConfiguratorStep, type IConfiguratorTarget, type IContact, type ICountry, type ICoupon, type ICurrency, type ICustomer, type IDiscountType, type IEmailTemplate, type IFaq, type IFaqCategory, type IKeyValue, type ILinePricing, type IMediaAsset, INVENTORY_POLICY_VALUES, type INetsuiteCaseLink, type INetsuiteEvent, type INetsuiteOrderLink, type INetsuiteQueueEntry, type INotification, type IOrder, type IOrderItem, type IOrderLog, type IOrderShipment, type IOrderTransaction, type IPaymentLink, type IPodcastEpisode, type IPrice, type IProduct, type IProductDailyStat, type IProductRelationGroup, type IProductTechnicalSpec, type IProductTechnicalSpecTable, type IProductVariantFields, type IProductVariantOptionGroup, type IProductVariantOptionMatrix, type IProductVariantOptionValue, type IRedirect, type IRedirectSuggestion, type IRefundTransaction, type IRelationGroup, type ISEOMetaData, type ISelectableFee, type IServicePlan, type IShipFromAddress, type IShipping, type IShippingRate, type IState, type IStock, type IStore, type IStoreFee, type IStoreSettings, type ISubscriber, type ISubscriberConsent, type ISubscription, type ISummaryPricing, type ISupportCase, type ISupportCaseListItem, type ITaxRate, type ITechnicalSpecColumn, type ITechnicalSpecGroup, type ITransactionBase, type IUnmatched404, type IVariant, type IVariantOptionSelection, type IWishlist, type IWishlistItem, type Id, type InventoryPolicy, InventoryPolicyEnum, type LineChargeInput, MIN_PASSWORD_LENGTH, type MatchResult, type Metadata, NETSUITE_EVENT_STATE_VALUES, NETSUITE_OWNED_FIELDS, NETSUITE_RECORD_TYPE_VALUES, NETSUITE_RELATION_GROUPS, NOTIFICATION_TYPE_VALUES, type NetsuiteCustomerLinkResult, NetsuiteEventStateEnum, NetsuiteFieldProvider, type NetsuiteLinkResult, type NetsuiteOrderPreview, type NetsuiteOwnedEntity, type NetsuitePreviewLine, type NetsuitePushAttempt, type NetsuitePushOutcome, type NetsuiteReceipt, NetsuiteRecordTypeEnum, type NetsuiteRelationSource, type NetsuiteStatusChange, type NetsuiteStatusSyncResult, type NetsuiteSyncDefinition, NotificationTypeEnum, OPEN_ORDER_STATUSES, ORDER_LOG_TYPE_VALUES, ORDER_STATUS_VALUES, type OfferedAddon, type OfferedAddonGroup, type OfferedServicePlan, OrderLogTypeEnum, OrderStatusEnum, PAYMENT_GATEWAY_VALUES, PAYMENT_LINK_STATUS_VALUES, PAYMENT_METHOD_VALUES, PAYMENT_STATUS_VALUES, PLACED_OPEN_ORDER_STATUSES, PRICING_TYPE_VALUES, PRODUCT_FIELDS, PRODUCT_VARIANT_TYPE_VALUES, PROVIDERS, PURCHASE_ORDER_STATUSES, PUSH_CHECK_STATUS_VALUES, PaymentGatewayEnum, PaymentLinkStatusEnum, type PaymentLinkView, PaymentMethodEnum, PaymentStatusEnum, type PricedLineLike, type PricingType, PricingTypeEnum, type ProductAddonScope, ProductEventTypeEnum, type ProductServicePlanScope, type ProductVariantType, ProductVariantTypeEnum, type PromotionSyncResult, type PushCheck, PushCheckStatusEnum, type PushField, QUOTE_ORDER_STATUSES, type QuoteRequestResult, RELATION_FIELDS, RESOURCE_OPERATIONS, RETIRED_CART_STATUSES, type RateAddress, type RatedShippingMethod, type RedirectTargetType, type ResolveAccessInput, type ResolvedAddonSelection, type RevalidationResult, SALE_TYPE_VALUES, SERVICE_PLAN_ELIGIBILITY_FIELD, STATUS_TONE_VALUES, SUBSCRIPTION_CHANNEL_VALUES, SUBSCRIPTION_TOPIC_LABELS, SUBSCRIPTION_TOPIC_VALUES, type SaleType, SaleTypeEnum, type SaleTypedLike, type SelectedShippingMethod, type ServicePlanNetsuiteLink, StatusToneEnum, type StockDemandLine, type StockStatus, StockStatusEnum, type StockVerdict, StockVerdictEnum, type StoreAccessCheckInput, type StoreScopeInput, SubscriptionChannelEnum, SubscriptionTopicEnum, type SyncPolicy, type SyncRisk, TAX_RATE_SOURCE_VALUES, TRANSACTION_TYPE_VALUES, TaxRateSourceEnum, type TaxSyncResult, TransactionTypeEnum, UNPLACED_ORDER_STATUSES, type VariantOptionMode, WIRED_EMAIL_TEMPLATE_EVENTS, actionsForResource, addonFields, addonUnitAmount, addonsOfLine, addonsUnitAmount, adjustmentsFor, applyPriceAdjustments, baseUnitPriceOfLine, blogAuthorFields, blogCategoryFields, blogPostFields, brandFields, can, canAny, canonicalizePath, canonicalizeSlug, canonicalizeUrlSegment, cartAcceptsItem, caseIsOpen, categoryFields, chargesOfLine, conditionHolds, couponFields, demandByKey, evaluateConfigurator, feeHint, formatMoney, grantedPermissions, groupHasDefaultAddon, hasStoreAccess, isConfigurationValid, isContactProfile, isNetsuiteOwned, isNonEmptyString, isQuoteOnlyItem, isValidAction, isValidEmail, isValidPassword, missingGrants, netsuiteFieldCaution, netsuiteFieldConditional, netsuiteFieldDerivedFrom, netsuiteFieldNote, netsuiteFieldRisk, netsuiteFieldSource, netsuiteRelationSource, netsuiteStatusLabel, normalizeLineQuantity, normalizeNumber, normalizePath, orderLogTypeColorMap, paymentLinkStatusColorMap, paymentMethodColorMap, paymentStatusColorMap, podcastFields, productFields, readMapped, resolveAddonSelections, resolveEffectivePermissions, resolveProductAddonGroups, resolveProductServicePlans, resolveStoreScope, roundMoney, saleTypeOf, servicePlanFields, statusColors, statusTone, statusTones, stockVerdict, syncOwnerFor, toIdString, trimmedText, typeColorMap };
package/dist/index.d.ts CHANGED
@@ -104,6 +104,9 @@ declare const toIdString: (value: unknown) => string;
104
104
  declare const isNonEmptyString: (value: unknown) => value is string;
105
105
  declare const normalizeNumber: (value: unknown, fallback?: number) => number;
106
106
  declare const isValidEmail: (email: unknown) => email is string;
107
+ declare const MIN_PASSWORD_LENGTH = 8;
108
+ declare const isValidPassword: (value: unknown) => value is string;
109
+ declare const trimmedText: (value: unknown) => string;
107
110
 
108
111
  interface ICurrency extends BaseEntity {
109
112
  name: string;
@@ -220,6 +223,44 @@ interface CouponNetsuiteLink {
220
223
  syncedAt?: Date | string;
221
224
  }
222
225
 
226
+ declare const AuthProviderEnum: {
227
+ readonly CREDENTIALS: "credentials";
228
+ readonly GOOGLE: "google";
229
+ readonly APPLE: "apple";
230
+ readonly FACEBOOK: "facebook";
231
+ };
232
+ type AuthProvider = (typeof AuthProviderEnum)[keyof typeof AuthProviderEnum];
233
+ declare const AUTH_PROVIDER_VALUES: AuthProvider[];
234
+ declare const AccountSourceEnum: {
235
+ readonly SIGNUP: "signup";
236
+ readonly GOOGLE: "google";
237
+ readonly CHECKOUT: "checkout";
238
+ };
239
+ type AccountSource = (typeof AccountSourceEnum)[keyof typeof AccountSourceEnum];
240
+ declare const ACCOUNT_SOURCE_VALUES: AccountSource[];
241
+
242
+ declare const EDITABLE_CUSTOMER_FIELDS: readonly ["firstName", "lastName", "company", "phoneNumber", "profileImage", "address", "status"];
243
+ type EditableCustomerField = (typeof EDITABLE_CUSTOMER_FIELDS)[number];
244
+ interface CustomerSignupRequest {
245
+ email: string;
246
+ firstName: string;
247
+ lastName: string;
248
+ company?: string;
249
+ password: string;
250
+ phoneNumber?: string;
251
+ }
252
+ interface CustomerSocialLoginRequest {
253
+ email: string;
254
+ firstName: string;
255
+ lastName: string;
256
+ googleId: string;
257
+ profileImage?: string;
258
+ }
259
+ type CustomerProfileUpdateRequest = Partial<Pick<ICustomer, EditableCustomerField>> & {
260
+ oldPassword?: string;
261
+ newPassword?: string;
262
+ };
263
+
223
264
  interface IBrand extends BaseEntity {
224
265
  name: string;
225
266
  slug: string;
@@ -818,6 +859,10 @@ interface IOrder extends BaseEntity {
818
859
  interface ICustomer extends BaseEntity {
819
860
  netsuiteId: string;
820
861
  netsuiteEntityId: string;
862
+ netsuiteEmailValidated: boolean | null;
863
+ netsuiteProfileSyncedAt: Date | string | null;
864
+ netsuitePushedAt: Date | string | null;
865
+ netsuitePushError: string;
821
866
  netsuiteLinkAttempts: number;
822
867
  netsuiteLinkAttemptedAt: Date | string | null;
823
868
  netsuiteLinkError: string;
@@ -831,7 +876,7 @@ interface ICustomer extends BaseEntity {
831
876
  password?: string;
832
877
  status: boolean;
833
878
  lastLogin: Date;
834
- authProvider: "credentials" | "google" | "apple" | "facebook" | string | null;
879
+ authProvider: AuthProvider | string | null;
835
880
  googleId: string;
836
881
  emailVerified?: boolean;
837
882
  hasPassword: boolean;
@@ -855,6 +900,7 @@ interface IState extends BaseEntity {
855
900
  }
856
901
 
857
902
  interface IAddress extends BaseEntity {
903
+ netsuiteAddressbookId: string;
858
904
  addressLine1: string;
859
905
  addressLine2: string;
860
906
  city: string;
@@ -999,7 +1045,7 @@ declare const ADMIN_RESOURCE_LIST: readonly [{
999
1045
  readonly label: "Account";
1000
1046
  readonly group: "Settings";
1001
1047
  }];
1002
- declare const ADMIN_RESOURCES: ("stores" | "categories" | "podcast" | "blog" | "dashboard" | "metrics" | "products" | "brands" | "technical-specs" | "addon-configs" | "service-plans" | "relation-groups" | "configurators" | "orders" | "quotes" | "carts" | "transactions" | "coupons" | "store-fees" | "tax-rates" | "customers" | "contact-us" | "subscribers" | "faqs" | "email-templates" | "notifications" | "campaigns" | "currencies" | "redirects" | "cache" | "admins" | "account")[];
1048
+ declare const ADMIN_RESOURCES: ("orders" | "stores" | "categories" | "podcast" | "blog" | "dashboard" | "metrics" | "products" | "brands" | "technical-specs" | "addon-configs" | "service-plans" | "relation-groups" | "configurators" | "quotes" | "carts" | "transactions" | "coupons" | "store-fees" | "tax-rates" | "customers" | "contact-us" | "subscribers" | "faqs" | "email-templates" | "notifications" | "campaigns" | "currencies" | "redirects" | "cache" | "admins" | "account")[];
1003
1049
  type IAdminResource = (typeof ADMIN_RESOURCE_LIST)[number]['value'];
1004
1050
  declare const ADMIN_ACTIONS: readonly ["read", "write", "delete"];
1005
1051
  type IAdminBaseAction = (typeof ADMIN_ACTIONS)[number];
@@ -1084,6 +1130,18 @@ interface StoreAccessCheckInput extends StoreScopeInput {
1084
1130
  }
1085
1131
  declare const hasStoreAccess: (input: StoreAccessCheckInput) => boolean;
1086
1132
 
1133
+ declare const EDITABLE_ADMIN_FIELDS: readonly ["firstName", "lastName", "email", "phoneNumber", "role", "access_list", "joiningDate", "profileImage", "storeAccess", "status"];
1134
+ type EditableAdminField = (typeof EDITABLE_ADMIN_FIELDS)[number];
1135
+ type AdminCreateRequest = Partial<Pick<IAdmin, EditableAdminField>> & {
1136
+ firstName: string;
1137
+ lastName: string;
1138
+ email: string;
1139
+ password: string;
1140
+ };
1141
+ type AdminUpdateRequest = Partial<Pick<IAdmin, EditableAdminField>> & {
1142
+ newPassword?: string;
1143
+ };
1144
+
1087
1145
  declare const CaseStatusEnum: {
1088
1146
  readonly NOT_STARTED: "1";
1089
1147
  readonly IN_PROGRESS: "2";
@@ -6270,6 +6328,10 @@ interface NetsuiteLinkResult {
6270
6328
  netsuiteId: string;
6271
6329
  created: boolean;
6272
6330
  }
6331
+ interface NetsuiteCustomerLinkResult extends NetsuiteLinkResult {
6332
+ netsuiteEntityId: string;
6333
+ skipped?: string;
6334
+ }
6273
6335
 
6274
6336
  declare const NetsuiteRecordTypeEnum: {
6275
6337
  readonly SALES_ORDER: "salesOrder";
@@ -6460,10 +6522,16 @@ interface CheckoutPayload {
6460
6522
  customerNote?: string;
6461
6523
  poNumber?: string;
6462
6524
  }
6525
+ interface QuoteRequestResult {
6526
+ id: string;
6527
+ orderId: string;
6528
+ accountInvited?: boolean;
6529
+ }
6463
6530
  interface CheckoutResult {
6464
6531
  order: IOrder;
6465
6532
  redirectUrl?: string;
6466
6533
  clientToken?: string;
6534
+ accountInvited?: boolean;
6467
6535
  }
6468
6536
 
6469
6537
  declare const ProductEventTypeEnum: {
@@ -6515,4 +6583,4 @@ interface IWishlist extends BaseEntity {
6515
6583
  items: IWishlistItem[];
6516
6584
  }
6517
6585
 
6518
- export { ACTIVE_SUBSCRIPTION_CHANNELS, ADMIN_ACTIONS, ADMIN_AUDIT_ACTIONS, ADMIN_RESOURCES, ADMIN_RESOURCE_LIST, ALL_STORES, AWAITING_PAYMENT_STATUSES, type AddonAmountInput, type AddonGroupNetsuiteLink, type AddonNetsuiteLink, type AddonSelectionRef, type AddonSnapshot, type ApiResponse, type AppliedTax, BRAND_FIELDS, type BaseEntity, CAMPAIGN_RECIPIENT_STATUS_VALUES, CAMPAIGN_STATUS_VALUES, CART_STATUS_VALUES, CASE_ORIGIN_LABELS, CASE_ORIGIN_VALUES, CASE_PRIORITY_LABELS, CASE_PRIORITY_VALUES, CASE_PROFILE_LABELS, CASE_PROFILE_VALUES, CASE_STATUS_COLORS, CASE_STATUS_LABELS, CASE_STATUS_VALUES, CASE_TYPE_LABELS, CASE_TYPE_VALUES, CATEGORY_FIELDS, CONFIGURATOR_CONDITION_TYPE_VALUES, CONFIGURATOR_EFFECT_TYPE_VALUES, CONFIGURATOR_SELECT_MODE_VALUES, CONFIGURATOR_SOURCE_VALUES, CONTACT_PROFILE_OPTIONS, type CacheStatus, type CacheStoreTarget, CampaignRecipientStatusEnum, CampaignStatusEnum, type CartIssue, type CartIssueType, CartIssueTypes, CartStatusEnum, type CartValidation, type CaseOrigin, CaseOriginEnum, type CasePriority, CasePriorityEnum, type CaseProfile, CaseProfileEnum, type CaseStatus, CaseStatusEnum, type CaseType, CaseTypeEnum, type CategoryImportSummary, type CheckoutAddressInput, type CheckoutPayload, type CheckoutResult, ConfiguratorConditionTypeEnum, ConfiguratorEffectTypeEnum, ConfiguratorErrorCodeEnum, type ConfiguratorEvalContext, type ConfiguratorEvalError, type ConfiguratorEvalResult, ConfiguratorSelectModeEnum, type ConfiguratorSelections, ConfiguratorSourceEnum, type CouponNetsuiteLink, DEFAULT_SUBSCRIPTION_TOPICS, DISCOUNT_TYPE_VALUES, DiscountTypeEnum, EMAIL_PARAM_MISMATCH_KIND_VALUES, EMAIL_TEMPLATE_EVENT_VALUES, EMAIL_TEMPLATE_VARIABLES_BY_EVENT, EMPTY_ACCESS, type EffectiveAccess, type EmailParamMismatch, EmailParamMismatchKindEnum, EmailTemplateEventEnum, FEE_APPLIES_TO_VALUES, FeeAppliesToEnum, type FieldMap, type FieldMapping, type FieldSource, type IAddonConfig, type IAddonGroup, type IAddress, type IAdmin, type IAdminAction, type IAdminAuditAction, type IAdminAuditLog, type IAdminBaseAction, type IAdminPermission, type IAdminResource, type IAdminRole, type IAdminRoleCreate, type IAdminSafe, type IAdminStoreAccess, type IAppliedFee, type IBannerSlide, type IBlogAuthor, type IBlogCategory, type IBlogPost, type IBrand, type ICampaign, type ICampaignRecipient, type ICampaignStats, type ICart, type ICartItem, type ICartServicePlanSnapshot, type ICaseMessage, type ICategory, type ICategorySequence, type ICategorySubcategory, type ICategoryUrl, type IConfigurator, type IConfiguratorCondition, type IConfiguratorEffect, type IConfiguratorFacet, type IConfiguratorFacetValue, type IConfiguratorOption, type IConfiguratorPriceAdjustment, type IConfiguratorQuery, type IConfiguratorRule, type IConfiguratorSection, type IConfiguratorStep, type IConfiguratorTarget, type IContact, type ICountry, type ICoupon, type ICurrency, type ICustomer, type IDiscountType, type IEmailTemplate, type IFaq, type IFaqCategory, type IKeyValue, type ILinePricing, type IMediaAsset, INVENTORY_POLICY_VALUES, type INetsuiteCaseLink, type INetsuiteEvent, type INetsuiteOrderLink, type INetsuiteQueueEntry, type INotification, type IOrder, type IOrderItem, type IOrderLog, type IOrderShipment, type IOrderTransaction, type IPaymentLink, type IPodcastEpisode, type IPrice, type IProduct, type IProductDailyStat, type IProductRelationGroup, type IProductTechnicalSpec, type IProductTechnicalSpecTable, type IProductVariantFields, type IProductVariantOptionGroup, type IProductVariantOptionMatrix, type IProductVariantOptionValue, type IRedirect, type IRedirectSuggestion, type IRefundTransaction, type IRelationGroup, type ISEOMetaData, type ISelectableFee, type IServicePlan, type IShipFromAddress, type IShipping, type IShippingRate, type IState, type IStock, type IStore, type IStoreFee, type IStoreSettings, type ISubscriber, type ISubscriberConsent, type ISubscription, type ISummaryPricing, type ISupportCase, type ISupportCaseListItem, type ITaxRate, type ITechnicalSpecColumn, type ITechnicalSpecGroup, type ITransactionBase, type IUnmatched404, type IVariant, type IVariantOptionSelection, type IWishlist, type IWishlistItem, type Id, type InventoryPolicy, InventoryPolicyEnum, type LineChargeInput, type MatchResult, type Metadata, NETSUITE_EVENT_STATE_VALUES, NETSUITE_OWNED_FIELDS, NETSUITE_RECORD_TYPE_VALUES, NETSUITE_RELATION_GROUPS, NOTIFICATION_TYPE_VALUES, NetsuiteEventStateEnum, NetsuiteFieldProvider, type NetsuiteLinkResult, type NetsuiteOrderPreview, type NetsuiteOwnedEntity, type NetsuitePreviewLine, type NetsuitePushAttempt, type NetsuitePushOutcome, type NetsuiteReceipt, NetsuiteRecordTypeEnum, type NetsuiteRelationSource, type NetsuiteStatusChange, type NetsuiteStatusSyncResult, type NetsuiteSyncDefinition, NotificationTypeEnum, OPEN_ORDER_STATUSES, ORDER_LOG_TYPE_VALUES, ORDER_STATUS_VALUES, type OfferedAddon, type OfferedAddonGroup, type OfferedServicePlan, OrderLogTypeEnum, OrderStatusEnum, PAYMENT_GATEWAY_VALUES, PAYMENT_LINK_STATUS_VALUES, PAYMENT_METHOD_VALUES, PAYMENT_STATUS_VALUES, PLACED_OPEN_ORDER_STATUSES, PRICING_TYPE_VALUES, PRODUCT_FIELDS, PRODUCT_VARIANT_TYPE_VALUES, PROVIDERS, PURCHASE_ORDER_STATUSES, PUSH_CHECK_STATUS_VALUES, PaymentGatewayEnum, PaymentLinkStatusEnum, type PaymentLinkView, PaymentMethodEnum, PaymentStatusEnum, type PricedLineLike, type PricingType, PricingTypeEnum, type ProductAddonScope, ProductEventTypeEnum, type ProductServicePlanScope, type ProductVariantType, ProductVariantTypeEnum, type PromotionSyncResult, type PushCheck, PushCheckStatusEnum, type PushField, QUOTE_ORDER_STATUSES, RELATION_FIELDS, RESOURCE_OPERATIONS, RETIRED_CART_STATUSES, type RateAddress, type RatedShippingMethod, type RedirectTargetType, type ResolveAccessInput, type ResolvedAddonSelection, type RevalidationResult, SALE_TYPE_VALUES, SERVICE_PLAN_ELIGIBILITY_FIELD, STATUS_TONE_VALUES, SUBSCRIPTION_CHANNEL_VALUES, SUBSCRIPTION_TOPIC_LABELS, SUBSCRIPTION_TOPIC_VALUES, type SaleType, SaleTypeEnum, type SaleTypedLike, type SelectedShippingMethod, type ServicePlanNetsuiteLink, StatusToneEnum, type StockDemandLine, type StockStatus, StockStatusEnum, type StockVerdict, StockVerdictEnum, type StoreAccessCheckInput, type StoreScopeInput, SubscriptionChannelEnum, SubscriptionTopicEnum, type SyncPolicy, type SyncRisk, TAX_RATE_SOURCE_VALUES, TRANSACTION_TYPE_VALUES, TaxRateSourceEnum, type TaxSyncResult, TransactionTypeEnum, UNPLACED_ORDER_STATUSES, type VariantOptionMode, WIRED_EMAIL_TEMPLATE_EVENTS, actionsForResource, addonFields, addonUnitAmount, addonsOfLine, addonsUnitAmount, adjustmentsFor, applyPriceAdjustments, baseUnitPriceOfLine, blogAuthorFields, blogCategoryFields, blogPostFields, brandFields, can, canAny, canonicalizePath, canonicalizeSlug, canonicalizeUrlSegment, cartAcceptsItem, caseIsOpen, categoryFields, chargesOfLine, conditionHolds, couponFields, demandByKey, evaluateConfigurator, feeHint, formatMoney, grantedPermissions, groupHasDefaultAddon, hasStoreAccess, isConfigurationValid, isContactProfile, isNetsuiteOwned, isNonEmptyString, isQuoteOnlyItem, isValidAction, isValidEmail, missingGrants, netsuiteFieldCaution, netsuiteFieldConditional, netsuiteFieldDerivedFrom, netsuiteFieldNote, netsuiteFieldRisk, netsuiteFieldSource, netsuiteRelationSource, netsuiteStatusLabel, normalizeLineQuantity, normalizeNumber, normalizePath, orderLogTypeColorMap, paymentLinkStatusColorMap, paymentMethodColorMap, paymentStatusColorMap, podcastFields, productFields, readMapped, resolveAddonSelections, resolveEffectivePermissions, resolveProductAddonGroups, resolveProductServicePlans, resolveStoreScope, roundMoney, saleTypeOf, servicePlanFields, statusColors, statusTone, statusTones, stockVerdict, syncOwnerFor, toIdString, typeColorMap };
6586
+ export { ACCOUNT_SOURCE_VALUES, ACTIVE_SUBSCRIPTION_CHANNELS, ADMIN_ACTIONS, ADMIN_AUDIT_ACTIONS, ADMIN_RESOURCES, ADMIN_RESOURCE_LIST, ALL_STORES, AUTH_PROVIDER_VALUES, AWAITING_PAYMENT_STATUSES, type AccountSource, AccountSourceEnum, type AddonAmountInput, type AddonGroupNetsuiteLink, type AddonNetsuiteLink, type AddonSelectionRef, type AddonSnapshot, type AdminCreateRequest, type AdminUpdateRequest, type ApiResponse, type AppliedTax, type AuthProvider, AuthProviderEnum, BRAND_FIELDS, type BaseEntity, CAMPAIGN_RECIPIENT_STATUS_VALUES, CAMPAIGN_STATUS_VALUES, CART_STATUS_VALUES, CASE_ORIGIN_LABELS, CASE_ORIGIN_VALUES, CASE_PRIORITY_LABELS, CASE_PRIORITY_VALUES, CASE_PROFILE_LABELS, CASE_PROFILE_VALUES, CASE_STATUS_COLORS, CASE_STATUS_LABELS, CASE_STATUS_VALUES, CASE_TYPE_LABELS, CASE_TYPE_VALUES, CATEGORY_FIELDS, CONFIGURATOR_CONDITION_TYPE_VALUES, CONFIGURATOR_EFFECT_TYPE_VALUES, CONFIGURATOR_SELECT_MODE_VALUES, CONFIGURATOR_SOURCE_VALUES, CONTACT_PROFILE_OPTIONS, type CacheStatus, type CacheStoreTarget, CampaignRecipientStatusEnum, CampaignStatusEnum, type CartIssue, type CartIssueType, CartIssueTypes, CartStatusEnum, type CartValidation, type CaseOrigin, CaseOriginEnum, type CasePriority, CasePriorityEnum, type CaseProfile, CaseProfileEnum, type CaseStatus, CaseStatusEnum, type CaseType, CaseTypeEnum, type CategoryImportSummary, type CheckoutAddressInput, type CheckoutPayload, type CheckoutResult, ConfiguratorConditionTypeEnum, ConfiguratorEffectTypeEnum, ConfiguratorErrorCodeEnum, type ConfiguratorEvalContext, type ConfiguratorEvalError, type ConfiguratorEvalResult, ConfiguratorSelectModeEnum, type ConfiguratorSelections, ConfiguratorSourceEnum, type CouponNetsuiteLink, type CustomerProfileUpdateRequest, type CustomerSignupRequest, type CustomerSocialLoginRequest, DEFAULT_SUBSCRIPTION_TOPICS, DISCOUNT_TYPE_VALUES, DiscountTypeEnum, EDITABLE_ADMIN_FIELDS, EDITABLE_CUSTOMER_FIELDS, EMAIL_PARAM_MISMATCH_KIND_VALUES, EMAIL_TEMPLATE_EVENT_VALUES, EMAIL_TEMPLATE_VARIABLES_BY_EVENT, EMPTY_ACCESS, type EditableAdminField, type EditableCustomerField, type EffectiveAccess, type EmailParamMismatch, EmailParamMismatchKindEnum, EmailTemplateEventEnum, FEE_APPLIES_TO_VALUES, FeeAppliesToEnum, type FieldMap, type FieldMapping, type FieldSource, type IAddonConfig, type IAddonGroup, type IAddress, type IAdmin, type IAdminAction, type IAdminAuditAction, type IAdminAuditLog, type IAdminBaseAction, type IAdminPermission, type IAdminResource, type IAdminRole, type IAdminRoleCreate, type IAdminSafe, type IAdminStoreAccess, type IAppliedFee, type IBannerSlide, type IBlogAuthor, type IBlogCategory, type IBlogPost, type IBrand, type ICampaign, type ICampaignRecipient, type ICampaignStats, type ICart, type ICartItem, type ICartServicePlanSnapshot, type ICaseMessage, type ICategory, type ICategorySequence, type ICategorySubcategory, type ICategoryUrl, type IConfigurator, type IConfiguratorCondition, type IConfiguratorEffect, type IConfiguratorFacet, type IConfiguratorFacetValue, type IConfiguratorOption, type IConfiguratorPriceAdjustment, type IConfiguratorQuery, type IConfiguratorRule, type IConfiguratorSection, type IConfiguratorStep, type IConfiguratorTarget, type IContact, type ICountry, type ICoupon, type ICurrency, type ICustomer, type IDiscountType, type IEmailTemplate, type IFaq, type IFaqCategory, type IKeyValue, type ILinePricing, type IMediaAsset, INVENTORY_POLICY_VALUES, type INetsuiteCaseLink, type INetsuiteEvent, type INetsuiteOrderLink, type INetsuiteQueueEntry, type INotification, type IOrder, type IOrderItem, type IOrderLog, type IOrderShipment, type IOrderTransaction, type IPaymentLink, type IPodcastEpisode, type IPrice, type IProduct, type IProductDailyStat, type IProductRelationGroup, type IProductTechnicalSpec, type IProductTechnicalSpecTable, type IProductVariantFields, type IProductVariantOptionGroup, type IProductVariantOptionMatrix, type IProductVariantOptionValue, type IRedirect, type IRedirectSuggestion, type IRefundTransaction, type IRelationGroup, type ISEOMetaData, type ISelectableFee, type IServicePlan, type IShipFromAddress, type IShipping, type IShippingRate, type IState, type IStock, type IStore, type IStoreFee, type IStoreSettings, type ISubscriber, type ISubscriberConsent, type ISubscription, type ISummaryPricing, type ISupportCase, type ISupportCaseListItem, type ITaxRate, type ITechnicalSpecColumn, type ITechnicalSpecGroup, type ITransactionBase, type IUnmatched404, type IVariant, type IVariantOptionSelection, type IWishlist, type IWishlistItem, type Id, type InventoryPolicy, InventoryPolicyEnum, type LineChargeInput, MIN_PASSWORD_LENGTH, type MatchResult, type Metadata, NETSUITE_EVENT_STATE_VALUES, NETSUITE_OWNED_FIELDS, NETSUITE_RECORD_TYPE_VALUES, NETSUITE_RELATION_GROUPS, NOTIFICATION_TYPE_VALUES, type NetsuiteCustomerLinkResult, NetsuiteEventStateEnum, NetsuiteFieldProvider, type NetsuiteLinkResult, type NetsuiteOrderPreview, type NetsuiteOwnedEntity, type NetsuitePreviewLine, type NetsuitePushAttempt, type NetsuitePushOutcome, type NetsuiteReceipt, NetsuiteRecordTypeEnum, type NetsuiteRelationSource, type NetsuiteStatusChange, type NetsuiteStatusSyncResult, type NetsuiteSyncDefinition, NotificationTypeEnum, OPEN_ORDER_STATUSES, ORDER_LOG_TYPE_VALUES, ORDER_STATUS_VALUES, type OfferedAddon, type OfferedAddonGroup, type OfferedServicePlan, OrderLogTypeEnum, OrderStatusEnum, PAYMENT_GATEWAY_VALUES, PAYMENT_LINK_STATUS_VALUES, PAYMENT_METHOD_VALUES, PAYMENT_STATUS_VALUES, PLACED_OPEN_ORDER_STATUSES, PRICING_TYPE_VALUES, PRODUCT_FIELDS, PRODUCT_VARIANT_TYPE_VALUES, PROVIDERS, PURCHASE_ORDER_STATUSES, PUSH_CHECK_STATUS_VALUES, PaymentGatewayEnum, PaymentLinkStatusEnum, type PaymentLinkView, PaymentMethodEnum, PaymentStatusEnum, type PricedLineLike, type PricingType, PricingTypeEnum, type ProductAddonScope, ProductEventTypeEnum, type ProductServicePlanScope, type ProductVariantType, ProductVariantTypeEnum, type PromotionSyncResult, type PushCheck, PushCheckStatusEnum, type PushField, QUOTE_ORDER_STATUSES, type QuoteRequestResult, RELATION_FIELDS, RESOURCE_OPERATIONS, RETIRED_CART_STATUSES, type RateAddress, type RatedShippingMethod, type RedirectTargetType, type ResolveAccessInput, type ResolvedAddonSelection, type RevalidationResult, SALE_TYPE_VALUES, SERVICE_PLAN_ELIGIBILITY_FIELD, STATUS_TONE_VALUES, SUBSCRIPTION_CHANNEL_VALUES, SUBSCRIPTION_TOPIC_LABELS, SUBSCRIPTION_TOPIC_VALUES, type SaleType, SaleTypeEnum, type SaleTypedLike, type SelectedShippingMethod, type ServicePlanNetsuiteLink, StatusToneEnum, type StockDemandLine, type StockStatus, StockStatusEnum, type StockVerdict, StockVerdictEnum, type StoreAccessCheckInput, type StoreScopeInput, SubscriptionChannelEnum, SubscriptionTopicEnum, type SyncPolicy, type SyncRisk, TAX_RATE_SOURCE_VALUES, TRANSACTION_TYPE_VALUES, TaxRateSourceEnum, type TaxSyncResult, TransactionTypeEnum, UNPLACED_ORDER_STATUSES, type VariantOptionMode, WIRED_EMAIL_TEMPLATE_EVENTS, actionsForResource, addonFields, addonUnitAmount, addonsOfLine, addonsUnitAmount, adjustmentsFor, applyPriceAdjustments, baseUnitPriceOfLine, blogAuthorFields, blogCategoryFields, blogPostFields, brandFields, can, canAny, canonicalizePath, canonicalizeSlug, canonicalizeUrlSegment, cartAcceptsItem, caseIsOpen, categoryFields, chargesOfLine, conditionHolds, couponFields, demandByKey, evaluateConfigurator, feeHint, formatMoney, grantedPermissions, groupHasDefaultAddon, hasStoreAccess, isConfigurationValid, isContactProfile, isNetsuiteOwned, isNonEmptyString, isQuoteOnlyItem, isValidAction, isValidEmail, isValidPassword, missingGrants, netsuiteFieldCaution, netsuiteFieldConditional, netsuiteFieldDerivedFrom, netsuiteFieldNote, netsuiteFieldRisk, netsuiteFieldSource, netsuiteRelationSource, netsuiteStatusLabel, normalizeLineQuantity, normalizeNumber, normalizePath, orderLogTypeColorMap, paymentLinkStatusColorMap, paymentMethodColorMap, paymentStatusColorMap, podcastFields, productFields, readMapped, resolveAddonSelections, resolveEffectivePermissions, resolveProductAddonGroups, resolveProductServicePlans, resolveStoreScope, roundMoney, saleTypeOf, servicePlanFields, statusColors, statusTone, statusTones, stockVerdict, syncOwnerFor, toIdString, trimmedText, typeColorMap };
package/dist/index.js CHANGED
@@ -20,13 +20,17 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
+ ACCOUNT_SOURCE_VALUES: () => ACCOUNT_SOURCE_VALUES,
23
24
  ACTIVE_SUBSCRIPTION_CHANNELS: () => ACTIVE_SUBSCRIPTION_CHANNELS,
24
25
  ADMIN_ACTIONS: () => ADMIN_ACTIONS,
25
26
  ADMIN_AUDIT_ACTIONS: () => ADMIN_AUDIT_ACTIONS,
26
27
  ADMIN_RESOURCES: () => ADMIN_RESOURCES,
27
28
  ADMIN_RESOURCE_LIST: () => ADMIN_RESOURCE_LIST,
28
29
  ALL_STORES: () => ALL_STORES,
30
+ AUTH_PROVIDER_VALUES: () => AUTH_PROVIDER_VALUES,
29
31
  AWAITING_PAYMENT_STATUSES: () => AWAITING_PAYMENT_STATUSES,
32
+ AccountSourceEnum: () => AccountSourceEnum,
33
+ AuthProviderEnum: () => AuthProviderEnum,
30
34
  BRAND_FIELDS: () => BRAND_FIELDS,
31
35
  CAMPAIGN_RECIPIENT_STATUS_VALUES: () => CAMPAIGN_RECIPIENT_STATUS_VALUES,
32
36
  CAMPAIGN_STATUS_VALUES: () => CAMPAIGN_STATUS_VALUES,
@@ -65,6 +69,8 @@ __export(index_exports, {
65
69
  DEFAULT_SUBSCRIPTION_TOPICS: () => DEFAULT_SUBSCRIPTION_TOPICS,
66
70
  DISCOUNT_TYPE_VALUES: () => DISCOUNT_TYPE_VALUES,
67
71
  DiscountTypeEnum: () => DiscountTypeEnum,
72
+ EDITABLE_ADMIN_FIELDS: () => EDITABLE_ADMIN_FIELDS,
73
+ EDITABLE_CUSTOMER_FIELDS: () => EDITABLE_CUSTOMER_FIELDS,
68
74
  EMAIL_PARAM_MISMATCH_KIND_VALUES: () => EMAIL_PARAM_MISMATCH_KIND_VALUES,
69
75
  EMAIL_TEMPLATE_EVENT_VALUES: () => EMAIL_TEMPLATE_EVENT_VALUES,
70
76
  EMAIL_TEMPLATE_VARIABLES_BY_EVENT: () => EMAIL_TEMPLATE_VARIABLES_BY_EVENT,
@@ -75,6 +81,7 @@ __export(index_exports, {
75
81
  FeeAppliesToEnum: () => FeeAppliesToEnum,
76
82
  INVENTORY_POLICY_VALUES: () => INVENTORY_POLICY_VALUES,
77
83
  InventoryPolicyEnum: () => InventoryPolicyEnum,
84
+ MIN_PASSWORD_LENGTH: () => MIN_PASSWORD_LENGTH,
78
85
  NETSUITE_EVENT_STATE_VALUES: () => NETSUITE_EVENT_STATE_VALUES,
79
86
  NETSUITE_OWNED_FIELDS: () => NETSUITE_OWNED_FIELDS,
80
87
  NETSUITE_RECORD_TYPE_VALUES: () => NETSUITE_RECORD_TYPE_VALUES,
@@ -167,6 +174,7 @@ __export(index_exports, {
167
174
  isQuoteOnlyItem: () => isQuoteOnlyItem,
168
175
  isValidAction: () => isValidAction,
169
176
  isValidEmail: () => isValidEmail,
177
+ isValidPassword: () => isValidPassword,
170
178
  missingGrants: () => missingGrants,
171
179
  netsuiteFieldCaution: () => netsuiteFieldCaution,
172
180
  netsuiteFieldConditional: () => netsuiteFieldConditional,
@@ -200,6 +208,7 @@ __export(index_exports, {
200
208
  stockVerdict: () => stockVerdict,
201
209
  syncOwnerFor: () => syncOwnerFor,
202
210
  toIdString: () => toIdString,
211
+ trimmedText: () => trimmedText,
203
212
  typeColorMap: () => typeColorMap
204
213
  });
205
214
  module.exports = __toCommonJS(index_exports);
@@ -344,6 +353,20 @@ var hasStoreAccess = (input) => {
344
353
  return scope.includes(storeId);
345
354
  };
346
355
 
356
+ // src/admin/request.ts
357
+ var EDITABLE_ADMIN_FIELDS = [
358
+ "firstName",
359
+ "lastName",
360
+ "email",
361
+ "phoneNumber",
362
+ "role",
363
+ "access_list",
364
+ "joiningDate",
365
+ "profileImage",
366
+ "storeAccess",
367
+ "status"
368
+ ];
369
+
347
370
  // src/common/objectId.ts
348
371
  var toIdString = (value) => {
349
372
  if (!value) return "";
@@ -371,6 +394,33 @@ var normalizeNumber = (value, fallback = 0) => {
371
394
  return fallback;
372
395
  };
373
396
  var isValidEmail = (email) => typeof email === "string" && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email.trim());
397
+ var MIN_PASSWORD_LENGTH = 8;
398
+ var isValidPassword = (value) => typeof value === "string" && value.length >= MIN_PASSWORD_LENGTH;
399
+ var trimmedText = (value) => typeof value === "string" ? value.trim() : "";
400
+
401
+ // src/customer/request.ts
402
+ var AuthProviderEnum = {
403
+ CREDENTIALS: "credentials",
404
+ GOOGLE: "google",
405
+ APPLE: "apple",
406
+ FACEBOOK: "facebook"
407
+ };
408
+ var AUTH_PROVIDER_VALUES = Object.values(AuthProviderEnum);
409
+ var AccountSourceEnum = {
410
+ SIGNUP: "signup",
411
+ GOOGLE: "google",
412
+ CHECKOUT: "checkout"
413
+ };
414
+ var ACCOUNT_SOURCE_VALUES = Object.values(AccountSourceEnum);
415
+ var EDITABLE_CUSTOMER_FIELDS = [
416
+ "firstName",
417
+ "lastName",
418
+ "company",
419
+ "phoneNumber",
420
+ "profileImage",
421
+ "address",
422
+ "status"
423
+ ];
374
424
 
375
425
  // src/supportCase/interface.ts
376
426
  var CaseStatusEnum = {