@fas-core/shared-types 1.0.125 → 1.0.127
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 +76 -3
- package/dist/index.d.ts +76 -3
- package/dist/index.js +54 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +54 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -104,6 +104,11 @@ 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;
|
|
110
|
+
declare const COMPANY_MAX_LENGTH = 83;
|
|
111
|
+
declare const companyNameOf: (value: unknown) => string;
|
|
107
112
|
|
|
108
113
|
interface ICurrency extends BaseEntity {
|
|
109
114
|
name: string;
|
|
@@ -153,6 +158,7 @@ interface RatedShippingMethod {
|
|
|
153
158
|
total: number;
|
|
154
159
|
free: boolean;
|
|
155
160
|
estimated: boolean;
|
|
161
|
+
handlingTaxable?: boolean;
|
|
156
162
|
}
|
|
157
163
|
|
|
158
164
|
interface IStoreSettings {
|
|
@@ -220,6 +226,44 @@ interface CouponNetsuiteLink {
|
|
|
220
226
|
syncedAt?: Date | string;
|
|
221
227
|
}
|
|
222
228
|
|
|
229
|
+
declare const AuthProviderEnum: {
|
|
230
|
+
readonly CREDENTIALS: "credentials";
|
|
231
|
+
readonly GOOGLE: "google";
|
|
232
|
+
readonly APPLE: "apple";
|
|
233
|
+
readonly FACEBOOK: "facebook";
|
|
234
|
+
};
|
|
235
|
+
type AuthProvider = (typeof AuthProviderEnum)[keyof typeof AuthProviderEnum];
|
|
236
|
+
declare const AUTH_PROVIDER_VALUES: AuthProvider[];
|
|
237
|
+
declare const AccountSourceEnum: {
|
|
238
|
+
readonly SIGNUP: "signup";
|
|
239
|
+
readonly GOOGLE: "google";
|
|
240
|
+
readonly CHECKOUT: "checkout";
|
|
241
|
+
};
|
|
242
|
+
type AccountSource = (typeof AccountSourceEnum)[keyof typeof AccountSourceEnum];
|
|
243
|
+
declare const ACCOUNT_SOURCE_VALUES: AccountSource[];
|
|
244
|
+
|
|
245
|
+
declare const EDITABLE_CUSTOMER_FIELDS: readonly ["firstName", "lastName", "company", "phoneNumber", "profileImage", "address", "status"];
|
|
246
|
+
type EditableCustomerField = (typeof EDITABLE_CUSTOMER_FIELDS)[number];
|
|
247
|
+
interface CustomerSignupRequest {
|
|
248
|
+
email: string;
|
|
249
|
+
firstName: string;
|
|
250
|
+
lastName: string;
|
|
251
|
+
company?: string;
|
|
252
|
+
password: string;
|
|
253
|
+
phoneNumber?: string;
|
|
254
|
+
}
|
|
255
|
+
interface CustomerSocialLoginRequest {
|
|
256
|
+
email: string;
|
|
257
|
+
firstName: string;
|
|
258
|
+
lastName: string;
|
|
259
|
+
googleId: string;
|
|
260
|
+
profileImage?: string;
|
|
261
|
+
}
|
|
262
|
+
type CustomerProfileUpdateRequest = Partial<Pick<ICustomer, EditableCustomerField>> & {
|
|
263
|
+
oldPassword?: string;
|
|
264
|
+
newPassword?: string;
|
|
265
|
+
};
|
|
266
|
+
|
|
223
267
|
interface IBrand extends BaseEntity {
|
|
224
268
|
name: string;
|
|
225
269
|
slug: string;
|
|
@@ -622,6 +666,7 @@ interface SelectedShippingMethod {
|
|
|
622
666
|
total: number;
|
|
623
667
|
free: boolean;
|
|
624
668
|
estimated: boolean;
|
|
669
|
+
handlingTaxable?: boolean;
|
|
625
670
|
cartFingerprint?: string;
|
|
626
671
|
}
|
|
627
672
|
interface AppliedTax {
|
|
@@ -820,6 +865,8 @@ interface ICustomer extends BaseEntity {
|
|
|
820
865
|
netsuiteEntityId: string;
|
|
821
866
|
netsuiteEmailValidated: boolean | null;
|
|
822
867
|
netsuiteProfileSyncedAt: Date | string | null;
|
|
868
|
+
netsuitePushedAt: Date | string | null;
|
|
869
|
+
netsuitePushError: string;
|
|
823
870
|
netsuiteLinkAttempts: number;
|
|
824
871
|
netsuiteLinkAttemptedAt: Date | string | null;
|
|
825
872
|
netsuiteLinkError: string;
|
|
@@ -833,7 +880,7 @@ interface ICustomer extends BaseEntity {
|
|
|
833
880
|
password?: string;
|
|
834
881
|
status: boolean;
|
|
835
882
|
lastLogin: Date;
|
|
836
|
-
authProvider:
|
|
883
|
+
authProvider: AuthProvider | string | null;
|
|
837
884
|
googleId: string;
|
|
838
885
|
emailVerified?: boolean;
|
|
839
886
|
hasPassword: boolean;
|
|
@@ -857,6 +904,7 @@ interface IState extends BaseEntity {
|
|
|
857
904
|
}
|
|
858
905
|
|
|
859
906
|
interface IAddress extends BaseEntity {
|
|
907
|
+
netsuiteAddressbookId: string;
|
|
860
908
|
addressLine1: string;
|
|
861
909
|
addressLine2: string;
|
|
862
910
|
city: string;
|
|
@@ -1001,7 +1049,7 @@ declare const ADMIN_RESOURCE_LIST: readonly [{
|
|
|
1001
1049
|
readonly label: "Account";
|
|
1002
1050
|
readonly group: "Settings";
|
|
1003
1051
|
}];
|
|
1004
|
-
declare const ADMIN_RESOURCES: ("stores" | "categories" | "podcast" | "blog" | "dashboard" | "metrics" | "products" | "brands" | "technical-specs" | "addon-configs" | "service-plans" | "relation-groups" | "configurators" | "
|
|
1052
|
+
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")[];
|
|
1005
1053
|
type IAdminResource = (typeof ADMIN_RESOURCE_LIST)[number]['value'];
|
|
1006
1054
|
declare const ADMIN_ACTIONS: readonly ["read", "write", "delete"];
|
|
1007
1055
|
type IAdminBaseAction = (typeof ADMIN_ACTIONS)[number];
|
|
@@ -1086,6 +1134,18 @@ interface StoreAccessCheckInput extends StoreScopeInput {
|
|
|
1086
1134
|
}
|
|
1087
1135
|
declare const hasStoreAccess: (input: StoreAccessCheckInput) => boolean;
|
|
1088
1136
|
|
|
1137
|
+
declare const EDITABLE_ADMIN_FIELDS: readonly ["firstName", "lastName", "email", "phoneNumber", "role", "access_list", "joiningDate", "profileImage", "storeAccess", "status"];
|
|
1138
|
+
type EditableAdminField = (typeof EDITABLE_ADMIN_FIELDS)[number];
|
|
1139
|
+
type AdminCreateRequest = Partial<Pick<IAdmin, EditableAdminField>> & {
|
|
1140
|
+
firstName: string;
|
|
1141
|
+
lastName: string;
|
|
1142
|
+
email: string;
|
|
1143
|
+
password: string;
|
|
1144
|
+
};
|
|
1145
|
+
type AdminUpdateRequest = Partial<Pick<IAdmin, EditableAdminField>> & {
|
|
1146
|
+
newPassword?: string;
|
|
1147
|
+
};
|
|
1148
|
+
|
|
1089
1149
|
declare const CaseStatusEnum: {
|
|
1090
1150
|
readonly NOT_STARTED: "1";
|
|
1091
1151
|
readonly IN_PROGRESS: "2";
|
|
@@ -6272,6 +6332,10 @@ interface NetsuiteLinkResult {
|
|
|
6272
6332
|
netsuiteId: string;
|
|
6273
6333
|
created: boolean;
|
|
6274
6334
|
}
|
|
6335
|
+
interface NetsuiteCustomerLinkResult extends NetsuiteLinkResult {
|
|
6336
|
+
netsuiteEntityId: string;
|
|
6337
|
+
skipped?: string;
|
|
6338
|
+
}
|
|
6275
6339
|
|
|
6276
6340
|
declare const NetsuiteRecordTypeEnum: {
|
|
6277
6341
|
readonly SALES_ORDER: "salesOrder";
|
|
@@ -6461,11 +6525,20 @@ interface CheckoutPayload {
|
|
|
6461
6525
|
acceptedTerms: boolean;
|
|
6462
6526
|
customerNote?: string;
|
|
6463
6527
|
poNumber?: string;
|
|
6528
|
+
company?: string;
|
|
6529
|
+
}
|
|
6530
|
+
interface QuoteRequestResult {
|
|
6531
|
+
id: string;
|
|
6532
|
+
orderId: string;
|
|
6533
|
+
accountInvited?: boolean;
|
|
6534
|
+
receiptToken?: string;
|
|
6464
6535
|
}
|
|
6465
6536
|
interface CheckoutResult {
|
|
6466
6537
|
order: IOrder;
|
|
6467
6538
|
redirectUrl?: string;
|
|
6468
6539
|
clientToken?: string;
|
|
6540
|
+
accountInvited?: boolean;
|
|
6541
|
+
receiptToken?: string;
|
|
6469
6542
|
}
|
|
6470
6543
|
|
|
6471
6544
|
declare const ProductEventTypeEnum: {
|
|
@@ -6517,4 +6590,4 @@ interface IWishlist extends BaseEntity {
|
|
|
6517
6590
|
items: IWishlistItem[];
|
|
6518
6591
|
}
|
|
6519
6592
|
|
|
6520
|
-
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 };
|
|
6593
|
+
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, COMPANY_MAX_LENGTH, 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, companyNameOf, 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,11 @@ 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;
|
|
110
|
+
declare const COMPANY_MAX_LENGTH = 83;
|
|
111
|
+
declare const companyNameOf: (value: unknown) => string;
|
|
107
112
|
|
|
108
113
|
interface ICurrency extends BaseEntity {
|
|
109
114
|
name: string;
|
|
@@ -153,6 +158,7 @@ interface RatedShippingMethod {
|
|
|
153
158
|
total: number;
|
|
154
159
|
free: boolean;
|
|
155
160
|
estimated: boolean;
|
|
161
|
+
handlingTaxable?: boolean;
|
|
156
162
|
}
|
|
157
163
|
|
|
158
164
|
interface IStoreSettings {
|
|
@@ -220,6 +226,44 @@ interface CouponNetsuiteLink {
|
|
|
220
226
|
syncedAt?: Date | string;
|
|
221
227
|
}
|
|
222
228
|
|
|
229
|
+
declare const AuthProviderEnum: {
|
|
230
|
+
readonly CREDENTIALS: "credentials";
|
|
231
|
+
readonly GOOGLE: "google";
|
|
232
|
+
readonly APPLE: "apple";
|
|
233
|
+
readonly FACEBOOK: "facebook";
|
|
234
|
+
};
|
|
235
|
+
type AuthProvider = (typeof AuthProviderEnum)[keyof typeof AuthProviderEnum];
|
|
236
|
+
declare const AUTH_PROVIDER_VALUES: AuthProvider[];
|
|
237
|
+
declare const AccountSourceEnum: {
|
|
238
|
+
readonly SIGNUP: "signup";
|
|
239
|
+
readonly GOOGLE: "google";
|
|
240
|
+
readonly CHECKOUT: "checkout";
|
|
241
|
+
};
|
|
242
|
+
type AccountSource = (typeof AccountSourceEnum)[keyof typeof AccountSourceEnum];
|
|
243
|
+
declare const ACCOUNT_SOURCE_VALUES: AccountSource[];
|
|
244
|
+
|
|
245
|
+
declare const EDITABLE_CUSTOMER_FIELDS: readonly ["firstName", "lastName", "company", "phoneNumber", "profileImage", "address", "status"];
|
|
246
|
+
type EditableCustomerField = (typeof EDITABLE_CUSTOMER_FIELDS)[number];
|
|
247
|
+
interface CustomerSignupRequest {
|
|
248
|
+
email: string;
|
|
249
|
+
firstName: string;
|
|
250
|
+
lastName: string;
|
|
251
|
+
company?: string;
|
|
252
|
+
password: string;
|
|
253
|
+
phoneNumber?: string;
|
|
254
|
+
}
|
|
255
|
+
interface CustomerSocialLoginRequest {
|
|
256
|
+
email: string;
|
|
257
|
+
firstName: string;
|
|
258
|
+
lastName: string;
|
|
259
|
+
googleId: string;
|
|
260
|
+
profileImage?: string;
|
|
261
|
+
}
|
|
262
|
+
type CustomerProfileUpdateRequest = Partial<Pick<ICustomer, EditableCustomerField>> & {
|
|
263
|
+
oldPassword?: string;
|
|
264
|
+
newPassword?: string;
|
|
265
|
+
};
|
|
266
|
+
|
|
223
267
|
interface IBrand extends BaseEntity {
|
|
224
268
|
name: string;
|
|
225
269
|
slug: string;
|
|
@@ -622,6 +666,7 @@ interface SelectedShippingMethod {
|
|
|
622
666
|
total: number;
|
|
623
667
|
free: boolean;
|
|
624
668
|
estimated: boolean;
|
|
669
|
+
handlingTaxable?: boolean;
|
|
625
670
|
cartFingerprint?: string;
|
|
626
671
|
}
|
|
627
672
|
interface AppliedTax {
|
|
@@ -820,6 +865,8 @@ interface ICustomer extends BaseEntity {
|
|
|
820
865
|
netsuiteEntityId: string;
|
|
821
866
|
netsuiteEmailValidated: boolean | null;
|
|
822
867
|
netsuiteProfileSyncedAt: Date | string | null;
|
|
868
|
+
netsuitePushedAt: Date | string | null;
|
|
869
|
+
netsuitePushError: string;
|
|
823
870
|
netsuiteLinkAttempts: number;
|
|
824
871
|
netsuiteLinkAttemptedAt: Date | string | null;
|
|
825
872
|
netsuiteLinkError: string;
|
|
@@ -833,7 +880,7 @@ interface ICustomer extends BaseEntity {
|
|
|
833
880
|
password?: string;
|
|
834
881
|
status: boolean;
|
|
835
882
|
lastLogin: Date;
|
|
836
|
-
authProvider:
|
|
883
|
+
authProvider: AuthProvider | string | null;
|
|
837
884
|
googleId: string;
|
|
838
885
|
emailVerified?: boolean;
|
|
839
886
|
hasPassword: boolean;
|
|
@@ -857,6 +904,7 @@ interface IState extends BaseEntity {
|
|
|
857
904
|
}
|
|
858
905
|
|
|
859
906
|
interface IAddress extends BaseEntity {
|
|
907
|
+
netsuiteAddressbookId: string;
|
|
860
908
|
addressLine1: string;
|
|
861
909
|
addressLine2: string;
|
|
862
910
|
city: string;
|
|
@@ -1001,7 +1049,7 @@ declare const ADMIN_RESOURCE_LIST: readonly [{
|
|
|
1001
1049
|
readonly label: "Account";
|
|
1002
1050
|
readonly group: "Settings";
|
|
1003
1051
|
}];
|
|
1004
|
-
declare const ADMIN_RESOURCES: ("stores" | "categories" | "podcast" | "blog" | "dashboard" | "metrics" | "products" | "brands" | "technical-specs" | "addon-configs" | "service-plans" | "relation-groups" | "configurators" | "
|
|
1052
|
+
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")[];
|
|
1005
1053
|
type IAdminResource = (typeof ADMIN_RESOURCE_LIST)[number]['value'];
|
|
1006
1054
|
declare const ADMIN_ACTIONS: readonly ["read", "write", "delete"];
|
|
1007
1055
|
type IAdminBaseAction = (typeof ADMIN_ACTIONS)[number];
|
|
@@ -1086,6 +1134,18 @@ interface StoreAccessCheckInput extends StoreScopeInput {
|
|
|
1086
1134
|
}
|
|
1087
1135
|
declare const hasStoreAccess: (input: StoreAccessCheckInput) => boolean;
|
|
1088
1136
|
|
|
1137
|
+
declare const EDITABLE_ADMIN_FIELDS: readonly ["firstName", "lastName", "email", "phoneNumber", "role", "access_list", "joiningDate", "profileImage", "storeAccess", "status"];
|
|
1138
|
+
type EditableAdminField = (typeof EDITABLE_ADMIN_FIELDS)[number];
|
|
1139
|
+
type AdminCreateRequest = Partial<Pick<IAdmin, EditableAdminField>> & {
|
|
1140
|
+
firstName: string;
|
|
1141
|
+
lastName: string;
|
|
1142
|
+
email: string;
|
|
1143
|
+
password: string;
|
|
1144
|
+
};
|
|
1145
|
+
type AdminUpdateRequest = Partial<Pick<IAdmin, EditableAdminField>> & {
|
|
1146
|
+
newPassword?: string;
|
|
1147
|
+
};
|
|
1148
|
+
|
|
1089
1149
|
declare const CaseStatusEnum: {
|
|
1090
1150
|
readonly NOT_STARTED: "1";
|
|
1091
1151
|
readonly IN_PROGRESS: "2";
|
|
@@ -6272,6 +6332,10 @@ interface NetsuiteLinkResult {
|
|
|
6272
6332
|
netsuiteId: string;
|
|
6273
6333
|
created: boolean;
|
|
6274
6334
|
}
|
|
6335
|
+
interface NetsuiteCustomerLinkResult extends NetsuiteLinkResult {
|
|
6336
|
+
netsuiteEntityId: string;
|
|
6337
|
+
skipped?: string;
|
|
6338
|
+
}
|
|
6275
6339
|
|
|
6276
6340
|
declare const NetsuiteRecordTypeEnum: {
|
|
6277
6341
|
readonly SALES_ORDER: "salesOrder";
|
|
@@ -6461,11 +6525,20 @@ interface CheckoutPayload {
|
|
|
6461
6525
|
acceptedTerms: boolean;
|
|
6462
6526
|
customerNote?: string;
|
|
6463
6527
|
poNumber?: string;
|
|
6528
|
+
company?: string;
|
|
6529
|
+
}
|
|
6530
|
+
interface QuoteRequestResult {
|
|
6531
|
+
id: string;
|
|
6532
|
+
orderId: string;
|
|
6533
|
+
accountInvited?: boolean;
|
|
6534
|
+
receiptToken?: string;
|
|
6464
6535
|
}
|
|
6465
6536
|
interface CheckoutResult {
|
|
6466
6537
|
order: IOrder;
|
|
6467
6538
|
redirectUrl?: string;
|
|
6468
6539
|
clientToken?: string;
|
|
6540
|
+
accountInvited?: boolean;
|
|
6541
|
+
receiptToken?: string;
|
|
6469
6542
|
}
|
|
6470
6543
|
|
|
6471
6544
|
declare const ProductEventTypeEnum: {
|
|
@@ -6517,4 +6590,4 @@ interface IWishlist extends BaseEntity {
|
|
|
6517
6590
|
items: IWishlistItem[];
|
|
6518
6591
|
}
|
|
6519
6592
|
|
|
6520
|
-
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 };
|
|
6593
|
+
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, COMPANY_MAX_LENGTH, 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, companyNameOf, 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,
|
|
@@ -43,6 +47,7 @@ __export(index_exports, {
|
|
|
43
47
|
CASE_TYPE_LABELS: () => CASE_TYPE_LABELS,
|
|
44
48
|
CASE_TYPE_VALUES: () => CASE_TYPE_VALUES,
|
|
45
49
|
CATEGORY_FIELDS: () => CATEGORY_FIELDS,
|
|
50
|
+
COMPANY_MAX_LENGTH: () => COMPANY_MAX_LENGTH,
|
|
46
51
|
CONFIGURATOR_CONDITION_TYPE_VALUES: () => CONFIGURATOR_CONDITION_TYPE_VALUES,
|
|
47
52
|
CONFIGURATOR_EFFECT_TYPE_VALUES: () => CONFIGURATOR_EFFECT_TYPE_VALUES,
|
|
48
53
|
CONFIGURATOR_SELECT_MODE_VALUES: () => CONFIGURATOR_SELECT_MODE_VALUES,
|
|
@@ -65,6 +70,8 @@ __export(index_exports, {
|
|
|
65
70
|
DEFAULT_SUBSCRIPTION_TOPICS: () => DEFAULT_SUBSCRIPTION_TOPICS,
|
|
66
71
|
DISCOUNT_TYPE_VALUES: () => DISCOUNT_TYPE_VALUES,
|
|
67
72
|
DiscountTypeEnum: () => DiscountTypeEnum,
|
|
73
|
+
EDITABLE_ADMIN_FIELDS: () => EDITABLE_ADMIN_FIELDS,
|
|
74
|
+
EDITABLE_CUSTOMER_FIELDS: () => EDITABLE_CUSTOMER_FIELDS,
|
|
68
75
|
EMAIL_PARAM_MISMATCH_KIND_VALUES: () => EMAIL_PARAM_MISMATCH_KIND_VALUES,
|
|
69
76
|
EMAIL_TEMPLATE_EVENT_VALUES: () => EMAIL_TEMPLATE_EVENT_VALUES,
|
|
70
77
|
EMAIL_TEMPLATE_VARIABLES_BY_EVENT: () => EMAIL_TEMPLATE_VARIABLES_BY_EVENT,
|
|
@@ -75,6 +82,7 @@ __export(index_exports, {
|
|
|
75
82
|
FeeAppliesToEnum: () => FeeAppliesToEnum,
|
|
76
83
|
INVENTORY_POLICY_VALUES: () => INVENTORY_POLICY_VALUES,
|
|
77
84
|
InventoryPolicyEnum: () => InventoryPolicyEnum,
|
|
85
|
+
MIN_PASSWORD_LENGTH: () => MIN_PASSWORD_LENGTH,
|
|
78
86
|
NETSUITE_EVENT_STATE_VALUES: () => NETSUITE_EVENT_STATE_VALUES,
|
|
79
87
|
NETSUITE_OWNED_FIELDS: () => NETSUITE_OWNED_FIELDS,
|
|
80
88
|
NETSUITE_RECORD_TYPE_VALUES: () => NETSUITE_RECORD_TYPE_VALUES,
|
|
@@ -151,6 +159,7 @@ __export(index_exports, {
|
|
|
151
159
|
caseIsOpen: () => caseIsOpen,
|
|
152
160
|
categoryFields: () => categoryFields,
|
|
153
161
|
chargesOfLine: () => chargesOfLine,
|
|
162
|
+
companyNameOf: () => companyNameOf,
|
|
154
163
|
conditionHolds: () => conditionHolds,
|
|
155
164
|
couponFields: () => couponFields,
|
|
156
165
|
demandByKey: () => demandByKey,
|
|
@@ -167,6 +176,7 @@ __export(index_exports, {
|
|
|
167
176
|
isQuoteOnlyItem: () => isQuoteOnlyItem,
|
|
168
177
|
isValidAction: () => isValidAction,
|
|
169
178
|
isValidEmail: () => isValidEmail,
|
|
179
|
+
isValidPassword: () => isValidPassword,
|
|
170
180
|
missingGrants: () => missingGrants,
|
|
171
181
|
netsuiteFieldCaution: () => netsuiteFieldCaution,
|
|
172
182
|
netsuiteFieldConditional: () => netsuiteFieldConditional,
|
|
@@ -200,6 +210,7 @@ __export(index_exports, {
|
|
|
200
210
|
stockVerdict: () => stockVerdict,
|
|
201
211
|
syncOwnerFor: () => syncOwnerFor,
|
|
202
212
|
toIdString: () => toIdString,
|
|
213
|
+
trimmedText: () => trimmedText,
|
|
203
214
|
typeColorMap: () => typeColorMap
|
|
204
215
|
});
|
|
205
216
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -344,6 +355,20 @@ var hasStoreAccess = (input) => {
|
|
|
344
355
|
return scope.includes(storeId);
|
|
345
356
|
};
|
|
346
357
|
|
|
358
|
+
// src/admin/request.ts
|
|
359
|
+
var EDITABLE_ADMIN_FIELDS = [
|
|
360
|
+
"firstName",
|
|
361
|
+
"lastName",
|
|
362
|
+
"email",
|
|
363
|
+
"phoneNumber",
|
|
364
|
+
"role",
|
|
365
|
+
"access_list",
|
|
366
|
+
"joiningDate",
|
|
367
|
+
"profileImage",
|
|
368
|
+
"storeAccess",
|
|
369
|
+
"status"
|
|
370
|
+
];
|
|
371
|
+
|
|
347
372
|
// src/common/objectId.ts
|
|
348
373
|
var toIdString = (value) => {
|
|
349
374
|
if (!value) return "";
|
|
@@ -371,6 +396,35 @@ var normalizeNumber = (value, fallback = 0) => {
|
|
|
371
396
|
return fallback;
|
|
372
397
|
};
|
|
373
398
|
var isValidEmail = (email) => typeof email === "string" && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email.trim());
|
|
399
|
+
var MIN_PASSWORD_LENGTH = 8;
|
|
400
|
+
var isValidPassword = (value) => typeof value === "string" && value.length >= MIN_PASSWORD_LENGTH;
|
|
401
|
+
var trimmedText = (value) => typeof value === "string" ? value.trim() : "";
|
|
402
|
+
var COMPANY_MAX_LENGTH = 83;
|
|
403
|
+
var companyNameOf = (value) => trimmedText(value).slice(0, COMPANY_MAX_LENGTH).trim();
|
|
404
|
+
|
|
405
|
+
// src/customer/request.ts
|
|
406
|
+
var AuthProviderEnum = {
|
|
407
|
+
CREDENTIALS: "credentials",
|
|
408
|
+
GOOGLE: "google",
|
|
409
|
+
APPLE: "apple",
|
|
410
|
+
FACEBOOK: "facebook"
|
|
411
|
+
};
|
|
412
|
+
var AUTH_PROVIDER_VALUES = Object.values(AuthProviderEnum);
|
|
413
|
+
var AccountSourceEnum = {
|
|
414
|
+
SIGNUP: "signup",
|
|
415
|
+
GOOGLE: "google",
|
|
416
|
+
CHECKOUT: "checkout"
|
|
417
|
+
};
|
|
418
|
+
var ACCOUNT_SOURCE_VALUES = Object.values(AccountSourceEnum);
|
|
419
|
+
var EDITABLE_CUSTOMER_FIELDS = [
|
|
420
|
+
"firstName",
|
|
421
|
+
"lastName",
|
|
422
|
+
"company",
|
|
423
|
+
"phoneNumber",
|
|
424
|
+
"profileImage",
|
|
425
|
+
"address",
|
|
426
|
+
"status"
|
|
427
|
+
];
|
|
374
428
|
|
|
375
429
|
// src/supportCase/interface.ts
|
|
376
430
|
var CaseStatusEnum = {
|