@verma-consulting/common-library 0.1.44 → 0.1.46

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
@@ -13,6 +13,7 @@ declare const formatPhoneNumber: (value: string) => string;
13
13
  declare const openInNewTab: (url: string) => void;
14
14
  declare function stripHtmlTags(html: string): string;
15
15
  declare const toCurrencyValue: (value: number | string) => number;
16
+ declare const formatRelativeTime: (input?: string | Date | number) => string;
16
17
 
17
18
  interface GenericPayload {
18
19
  label?: string;
@@ -2078,8 +2079,9 @@ declare enum commentRole {
2078
2079
  }
2079
2080
  declare enum chatType {
2080
2081
  chat_gpt = "chat_gpt",
2081
- deepseek = "deepseek",
2082
- claude = "claude"
2082
+ gemini = "gemini",
2083
+ claude = "claude",
2084
+ deepseek = "deepseek"
2083
2085
  }
2084
2086
  declare enum integrationType {
2085
2087
  stripe = "stripe",
@@ -2089,8 +2091,9 @@ declare enum integrationType {
2089
2091
  slack = "slack",
2090
2092
  fixer_io = "fixer_io",
2091
2093
  chat_gpt = "chat_gpt",
2092
- deepseek = "deepseek",
2094
+ gemini = "gemini",
2093
2095
  claude = "claude",
2096
+ deepseek = "deepseek",
2094
2097
  google_maps = "google_maps",
2095
2098
  shippo = "shippo",
2096
2099
  shopify = "shopify"
@@ -3245,6 +3248,7 @@ declare const defaults: {
3245
3248
  title: string;
3246
3249
  description: string;
3247
3250
  category: string;
3251
+ type: string;
3248
3252
  key: string;
3249
3253
  secret: string;
3250
3254
  logo: string;
@@ -3785,4 +3789,4 @@ declare const defaultTypes: {
3785
3789
  };
3786
3790
  };
3787
3791
 
3788
- export { type ActivityInterface, type AddressInterface, type AmountDetailsInterface, type AnalyticsQueryInterface, AppMode, type AutomaticPaymentMethodsInterface, type AutomaticTaxInterface, type BatchShipmentInterface, type BillingDetailsInterface, CalculationType, type CampaignInterface, CampaignType, type CancellationDetailsInterface, type CardInterface, type CarrierAccountInterface, type CarrierAccountResponseInterface, type CarrierMappingInterface, CategoryType, ChartType, type ChatInterface, type ClientInterface, type CommentInterface, type ContactInterface, type ContentInterface, ContentType, type CurrentRateInterface, type CustomsItemInterface, type DealInterface, DealType, DeviceNotification, type DisputeInterface, type EmailInterface, type EngagementInterface, type EvidenceDetailsInterface, type EvidenceInterface, FeatureType, type FileInterface, type FilterInterface, FilterType, FormFieldOrder, FormFieldType, FrequencyType, Gender, type GenericPayload, type IntegrationInterface, type InventoryInterface, type InvoiceInterface, type LabelOptionsInterface, LandingPath, LandingView, type LeadInterface, LeadType, type ListInterface, type MarketingFeatureInterface, type ModelInterface, ModelType, type Notation, type NotificationInterface, type OperationInterface, type OrderAddressInterface, type OrderInterface, OrganizationFeatures, type OrganizationInterface, type OrganizationModelInterface, type PackageDimensionsInterface, type ParcelInputInterface, type PauseCollectionInterface, type PaymentInterface, type PaymentMethodInterface, type PermissionInterface, PermissionType, PlatformLanguage, type PoolInterface, type PriceInterface, type PriceRecurringInterface, Priority, type ProductInterface, type PromptInterface, type QueryFilterInterface, type RatesOptionsInterface, type RefundInterface, type RefundResponseInterface, type RegisterInterface, type ReportInterface, type SchemaInterface, type SentEmailInterface, type ServiceLevelsResponseInterface, type ShippingInterface, type ShippingRateInterface, type ShippingTransactionInterface, type ShippoAddressInterface, type ShippoBatchResponseInterface, type ShippoCustomsDeclarationInputInterface, type ShippoCustomsResponseInterface, type ShippoParcelInterface, type ShippoParcelResponseInterface, type ShippoRatesResponseInterface, type ShippoTrackingResponseInterface, type ShippoTransactionResponseInterface, SourceType, type StatisticInterface, type StripeAccountInterface, type StripeCustomer, type StripePaymentIntent, type SubscriptionInterface, type TagInterface, type TaskInterface, type TokenInterface, type TrackingHistoryInterface, type TrackingInfoInterface, type UsageInterface, UsageType, type UserInterface, UserSettingType, type WaitlistInterface, accountType, action, addressType, automaticTaxStatus, billingReason, billingScheme, camelCaseToWords, capitalizeSentence, captureMethod, chatType, clientType, collectionMethod, commentRole, constants, currency, customerType, defaultTypes, defaults, disputeReason, disputeStatus, financialStatus, formatPhoneNumber, fulfillmentStatus, getRandomArbitrary, girth, grabAge, integrationCategory, integrationType, isNumber, largeNumberLabel, missingPaymentMethod, normalizeKey, openInNewTab, operationType, organizationFilterType, packageType, paymentAllowRedirect, paymentCancellationReason, paymentFutureUsage, paymentMethodAllowReDisplay, paymentMethodType, paymentStatus, prettifyString, priceType, productType, refundFailureReason, refundPendingReason, refundReason, refundStatus, shippingProvider, shippingServiceLevel, snakeToPretty, status, stripHtmlTags, subscriptionCancellationReason, taxBehavior, taxExempt, tiersMode, toCurrencyValue, trigger, unit, userRole, userSource, userStatus, validEmail, weightUnit };
3792
+ export { type ActivityInterface, type AddressInterface, type AmountDetailsInterface, type AnalyticsQueryInterface, AppMode, type AutomaticPaymentMethodsInterface, type AutomaticTaxInterface, type BatchShipmentInterface, type BillingDetailsInterface, CalculationType, type CampaignInterface, CampaignType, type CancellationDetailsInterface, type CardInterface, type CarrierAccountInterface, type CarrierAccountResponseInterface, type CarrierMappingInterface, CategoryType, ChartType, type ChatInterface, type ClientInterface, type CommentInterface, type ContactInterface, type ContentInterface, ContentType, type CurrentRateInterface, type CustomsItemInterface, type DealInterface, DealType, DeviceNotification, type DisputeInterface, type EmailInterface, type EngagementInterface, type EvidenceDetailsInterface, type EvidenceInterface, FeatureType, type FileInterface, type FilterInterface, FilterType, FormFieldOrder, FormFieldType, FrequencyType, Gender, type GenericPayload, type IntegrationInterface, type InventoryInterface, type InvoiceInterface, type LabelOptionsInterface, LandingPath, LandingView, type LeadInterface, LeadType, type ListInterface, type MarketingFeatureInterface, type ModelInterface, ModelType, type Notation, type NotificationInterface, type OperationInterface, type OrderAddressInterface, type OrderInterface, OrganizationFeatures, type OrganizationInterface, type OrganizationModelInterface, type PackageDimensionsInterface, type ParcelInputInterface, type PauseCollectionInterface, type PaymentInterface, type PaymentMethodInterface, type PermissionInterface, PermissionType, PlatformLanguage, type PoolInterface, type PriceInterface, type PriceRecurringInterface, Priority, type ProductInterface, type PromptInterface, type QueryFilterInterface, type RatesOptionsInterface, type RefundInterface, type RefundResponseInterface, type RegisterInterface, type ReportInterface, type SchemaInterface, type SentEmailInterface, type ServiceLevelsResponseInterface, type ShippingInterface, type ShippingRateInterface, type ShippingTransactionInterface, type ShippoAddressInterface, type ShippoBatchResponseInterface, type ShippoCustomsDeclarationInputInterface, type ShippoCustomsResponseInterface, type ShippoParcelInterface, type ShippoParcelResponseInterface, type ShippoRatesResponseInterface, type ShippoTrackingResponseInterface, type ShippoTransactionResponseInterface, SourceType, type StatisticInterface, type StripeAccountInterface, type StripeCustomer, type StripePaymentIntent, type SubscriptionInterface, type TagInterface, type TaskInterface, type TokenInterface, type TrackingHistoryInterface, type TrackingInfoInterface, type UsageInterface, UsageType, type UserInterface, UserSettingType, type WaitlistInterface, accountType, action, addressType, automaticTaxStatus, billingReason, billingScheme, camelCaseToWords, capitalizeSentence, captureMethod, chatType, clientType, collectionMethod, commentRole, constants, currency, customerType, defaultTypes, defaults, disputeReason, disputeStatus, financialStatus, formatPhoneNumber, formatRelativeTime, fulfillmentStatus, getRandomArbitrary, girth, grabAge, integrationCategory, integrationType, isNumber, largeNumberLabel, missingPaymentMethod, normalizeKey, openInNewTab, operationType, organizationFilterType, packageType, paymentAllowRedirect, paymentCancellationReason, paymentFutureUsage, paymentMethodAllowReDisplay, paymentMethodType, paymentStatus, prettifyString, priceType, productType, refundFailureReason, refundPendingReason, refundReason, refundStatus, shippingProvider, shippingServiceLevel, snakeToPretty, status, stripHtmlTags, subscriptionCancellationReason, taxBehavior, taxExempt, tiersMode, toCurrencyValue, trigger, unit, userRole, userSource, userStatus, validEmail, weightUnit };
package/dist/index.d.ts CHANGED
@@ -13,6 +13,7 @@ declare const formatPhoneNumber: (value: string) => string;
13
13
  declare const openInNewTab: (url: string) => void;
14
14
  declare function stripHtmlTags(html: string): string;
15
15
  declare const toCurrencyValue: (value: number | string) => number;
16
+ declare const formatRelativeTime: (input?: string | Date | number) => string;
16
17
 
17
18
  interface GenericPayload {
18
19
  label?: string;
@@ -2078,8 +2079,9 @@ declare enum commentRole {
2078
2079
  }
2079
2080
  declare enum chatType {
2080
2081
  chat_gpt = "chat_gpt",
2081
- deepseek = "deepseek",
2082
- claude = "claude"
2082
+ gemini = "gemini",
2083
+ claude = "claude",
2084
+ deepseek = "deepseek"
2083
2085
  }
2084
2086
  declare enum integrationType {
2085
2087
  stripe = "stripe",
@@ -2089,8 +2091,9 @@ declare enum integrationType {
2089
2091
  slack = "slack",
2090
2092
  fixer_io = "fixer_io",
2091
2093
  chat_gpt = "chat_gpt",
2092
- deepseek = "deepseek",
2094
+ gemini = "gemini",
2093
2095
  claude = "claude",
2096
+ deepseek = "deepseek",
2094
2097
  google_maps = "google_maps",
2095
2098
  shippo = "shippo",
2096
2099
  shopify = "shopify"
@@ -3245,6 +3248,7 @@ declare const defaults: {
3245
3248
  title: string;
3246
3249
  description: string;
3247
3250
  category: string;
3251
+ type: string;
3248
3252
  key: string;
3249
3253
  secret: string;
3250
3254
  logo: string;
@@ -3785,4 +3789,4 @@ declare const defaultTypes: {
3785
3789
  };
3786
3790
  };
3787
3791
 
3788
- export { type ActivityInterface, type AddressInterface, type AmountDetailsInterface, type AnalyticsQueryInterface, AppMode, type AutomaticPaymentMethodsInterface, type AutomaticTaxInterface, type BatchShipmentInterface, type BillingDetailsInterface, CalculationType, type CampaignInterface, CampaignType, type CancellationDetailsInterface, type CardInterface, type CarrierAccountInterface, type CarrierAccountResponseInterface, type CarrierMappingInterface, CategoryType, ChartType, type ChatInterface, type ClientInterface, type CommentInterface, type ContactInterface, type ContentInterface, ContentType, type CurrentRateInterface, type CustomsItemInterface, type DealInterface, DealType, DeviceNotification, type DisputeInterface, type EmailInterface, type EngagementInterface, type EvidenceDetailsInterface, type EvidenceInterface, FeatureType, type FileInterface, type FilterInterface, FilterType, FormFieldOrder, FormFieldType, FrequencyType, Gender, type GenericPayload, type IntegrationInterface, type InventoryInterface, type InvoiceInterface, type LabelOptionsInterface, LandingPath, LandingView, type LeadInterface, LeadType, type ListInterface, type MarketingFeatureInterface, type ModelInterface, ModelType, type Notation, type NotificationInterface, type OperationInterface, type OrderAddressInterface, type OrderInterface, OrganizationFeatures, type OrganizationInterface, type OrganizationModelInterface, type PackageDimensionsInterface, type ParcelInputInterface, type PauseCollectionInterface, type PaymentInterface, type PaymentMethodInterface, type PermissionInterface, PermissionType, PlatformLanguage, type PoolInterface, type PriceInterface, type PriceRecurringInterface, Priority, type ProductInterface, type PromptInterface, type QueryFilterInterface, type RatesOptionsInterface, type RefundInterface, type RefundResponseInterface, type RegisterInterface, type ReportInterface, type SchemaInterface, type SentEmailInterface, type ServiceLevelsResponseInterface, type ShippingInterface, type ShippingRateInterface, type ShippingTransactionInterface, type ShippoAddressInterface, type ShippoBatchResponseInterface, type ShippoCustomsDeclarationInputInterface, type ShippoCustomsResponseInterface, type ShippoParcelInterface, type ShippoParcelResponseInterface, type ShippoRatesResponseInterface, type ShippoTrackingResponseInterface, type ShippoTransactionResponseInterface, SourceType, type StatisticInterface, type StripeAccountInterface, type StripeCustomer, type StripePaymentIntent, type SubscriptionInterface, type TagInterface, type TaskInterface, type TokenInterface, type TrackingHistoryInterface, type TrackingInfoInterface, type UsageInterface, UsageType, type UserInterface, UserSettingType, type WaitlistInterface, accountType, action, addressType, automaticTaxStatus, billingReason, billingScheme, camelCaseToWords, capitalizeSentence, captureMethod, chatType, clientType, collectionMethod, commentRole, constants, currency, customerType, defaultTypes, defaults, disputeReason, disputeStatus, financialStatus, formatPhoneNumber, fulfillmentStatus, getRandomArbitrary, girth, grabAge, integrationCategory, integrationType, isNumber, largeNumberLabel, missingPaymentMethod, normalizeKey, openInNewTab, operationType, organizationFilterType, packageType, paymentAllowRedirect, paymentCancellationReason, paymentFutureUsage, paymentMethodAllowReDisplay, paymentMethodType, paymentStatus, prettifyString, priceType, productType, refundFailureReason, refundPendingReason, refundReason, refundStatus, shippingProvider, shippingServiceLevel, snakeToPretty, status, stripHtmlTags, subscriptionCancellationReason, taxBehavior, taxExempt, tiersMode, toCurrencyValue, trigger, unit, userRole, userSource, userStatus, validEmail, weightUnit };
3792
+ export { type ActivityInterface, type AddressInterface, type AmountDetailsInterface, type AnalyticsQueryInterface, AppMode, type AutomaticPaymentMethodsInterface, type AutomaticTaxInterface, type BatchShipmentInterface, type BillingDetailsInterface, CalculationType, type CampaignInterface, CampaignType, type CancellationDetailsInterface, type CardInterface, type CarrierAccountInterface, type CarrierAccountResponseInterface, type CarrierMappingInterface, CategoryType, ChartType, type ChatInterface, type ClientInterface, type CommentInterface, type ContactInterface, type ContentInterface, ContentType, type CurrentRateInterface, type CustomsItemInterface, type DealInterface, DealType, DeviceNotification, type DisputeInterface, type EmailInterface, type EngagementInterface, type EvidenceDetailsInterface, type EvidenceInterface, FeatureType, type FileInterface, type FilterInterface, FilterType, FormFieldOrder, FormFieldType, FrequencyType, Gender, type GenericPayload, type IntegrationInterface, type InventoryInterface, type InvoiceInterface, type LabelOptionsInterface, LandingPath, LandingView, type LeadInterface, LeadType, type ListInterface, type MarketingFeatureInterface, type ModelInterface, ModelType, type Notation, type NotificationInterface, type OperationInterface, type OrderAddressInterface, type OrderInterface, OrganizationFeatures, type OrganizationInterface, type OrganizationModelInterface, type PackageDimensionsInterface, type ParcelInputInterface, type PauseCollectionInterface, type PaymentInterface, type PaymentMethodInterface, type PermissionInterface, PermissionType, PlatformLanguage, type PoolInterface, type PriceInterface, type PriceRecurringInterface, Priority, type ProductInterface, type PromptInterface, type QueryFilterInterface, type RatesOptionsInterface, type RefundInterface, type RefundResponseInterface, type RegisterInterface, type ReportInterface, type SchemaInterface, type SentEmailInterface, type ServiceLevelsResponseInterface, type ShippingInterface, type ShippingRateInterface, type ShippingTransactionInterface, type ShippoAddressInterface, type ShippoBatchResponseInterface, type ShippoCustomsDeclarationInputInterface, type ShippoCustomsResponseInterface, type ShippoParcelInterface, type ShippoParcelResponseInterface, type ShippoRatesResponseInterface, type ShippoTrackingResponseInterface, type ShippoTransactionResponseInterface, SourceType, type StatisticInterface, type StripeAccountInterface, type StripeCustomer, type StripePaymentIntent, type SubscriptionInterface, type TagInterface, type TaskInterface, type TokenInterface, type TrackingHistoryInterface, type TrackingInfoInterface, type UsageInterface, UsageType, type UserInterface, UserSettingType, type WaitlistInterface, accountType, action, addressType, automaticTaxStatus, billingReason, billingScheme, camelCaseToWords, capitalizeSentence, captureMethod, chatType, clientType, collectionMethod, commentRole, constants, currency, customerType, defaultTypes, defaults, disputeReason, disputeStatus, financialStatus, formatPhoneNumber, formatRelativeTime, fulfillmentStatus, getRandomArbitrary, girth, grabAge, integrationCategory, integrationType, isNumber, largeNumberLabel, missingPaymentMethod, normalizeKey, openInNewTab, operationType, organizationFilterType, packageType, paymentAllowRedirect, paymentCancellationReason, paymentFutureUsage, paymentMethodAllowReDisplay, paymentMethodType, paymentStatus, prettifyString, priceType, productType, refundFailureReason, refundPendingReason, refundReason, refundStatus, shippingProvider, shippingServiceLevel, snakeToPretty, status, stripHtmlTags, subscriptionCancellationReason, taxBehavior, taxExempt, tiersMode, toCurrencyValue, trigger, unit, userRole, userSource, userStatus, validEmail, weightUnit };
package/dist/index.js CHANGED
@@ -67,6 +67,7 @@ __export(index_exports, {
67
67
  disputeStatus: () => disputeStatus,
68
68
  financialStatus: () => financialStatus,
69
69
  formatPhoneNumber: () => formatPhoneNumber,
70
+ formatRelativeTime: () => formatRelativeTime,
70
71
  fulfillmentStatus: () => fulfillmentStatus,
71
72
  getRandomArbitrary: () => getRandomArbitrary,
72
73
  girth: () => girth,
@@ -197,6 +198,26 @@ var toCurrencyValue = (value) => {
197
198
  const num = parseFloat(String(value)) || 0;
198
199
  return parseFloat(num.toFixed(2));
199
200
  };
201
+ var formatRelativeTime = (input) => {
202
+ if (input == null) return "";
203
+ const date = typeof input === "number" ? new Date(input) : typeof input === "string" ? new Date(input) : input;
204
+ if (isNaN(date.getTime())) return "";
205
+ const now = /* @__PURE__ */ new Date();
206
+ const diffMs = now.getTime() - date.getTime();
207
+ if (diffMs < 0) return "Just now";
208
+ const diffMins = Math.floor(diffMs / 6e4);
209
+ const diffHours = Math.floor(diffMs / 36e5);
210
+ const diffDays = Math.floor(diffMs / 864e5);
211
+ if (diffMins < 1) return "Just now";
212
+ if (diffMins < 60) return `${diffMins}m ago`;
213
+ if (diffHours < 24) return `${diffHours}h ago`;
214
+ if (diffDays < 7) return `${diffDays}d ago`;
215
+ return date.toLocaleDateString("en-US", {
216
+ month: "short",
217
+ day: "numeric",
218
+ year: date.getFullYear() !== now.getFullYear() ? "numeric" : void 0
219
+ });
220
+ };
200
221
 
201
222
  // src/enums.ts
202
223
  var LandingPath = /* @__PURE__ */ ((LandingPath2) => {
@@ -820,8 +841,9 @@ var commentRole = /* @__PURE__ */ ((commentRole2) => {
820
841
  })(commentRole || {});
821
842
  var chatType = /* @__PURE__ */ ((chatType2) => {
822
843
  chatType2["chat_gpt"] = "chat_gpt";
823
- chatType2["deepseek"] = "deepseek";
844
+ chatType2["gemini"] = "gemini";
824
845
  chatType2["claude"] = "claude";
846
+ chatType2["deepseek"] = "deepseek";
825
847
  return chatType2;
826
848
  })(chatType || {});
827
849
  var integrationType = /* @__PURE__ */ ((integrationType2) => {
@@ -832,8 +854,9 @@ var integrationType = /* @__PURE__ */ ((integrationType2) => {
832
854
  integrationType2["slack"] = "slack";
833
855
  integrationType2["fixer_io"] = "fixer_io";
834
856
  integrationType2["chat_gpt"] = "chat_gpt";
835
- integrationType2["deepseek"] = "deepseek";
857
+ integrationType2["gemini"] = "gemini";
836
858
  integrationType2["claude"] = "claude";
859
+ integrationType2["deepseek"] = "deepseek";
837
860
  integrationType2["google_maps"] = "google_maps";
838
861
  integrationType2["shippo"] = "shippo";
839
862
  integrationType2["shopify"] = "shopify";
@@ -2036,15 +2059,15 @@ var constants = {
2036
2059
  description: "ChatGPT is an artificial intelligence (AI) chatbot that uses natural language processing to generate human-like responses to user input.",
2037
2060
  title: "Integrate chatGPT to your platform",
2038
2061
  logo: "img/integrations/chatgpt.png",
2039
- new: false
2062
+ new: true
2040
2063
  },
2041
2064
  {
2042
- name: "DeepSeek",
2065
+ name: "Gemini",
2043
2066
  category: "AI",
2044
- type: "deepseek",
2045
- description: "DeepSeek is a Chinese artificial intelligence company that develops open-source large language models (LLMs).",
2046
- title: "Integrate DeepSeek to your platform",
2047
- logo: "img/integrations/deepseek.png",
2067
+ type: "gemini",
2068
+ description: "Gemini is Google's multimodal AI model that can understand and generate text, code, images, and more to help you build and scale intelligent applications.",
2069
+ title: "Integrate Gemini to your platform",
2070
+ logo: "img/integrations/gemini.png",
2048
2071
  new: true
2049
2072
  },
2050
2073
  {
@@ -2055,6 +2078,15 @@ var constants = {
2055
2078
  title: "Integrate Claude to your platform",
2056
2079
  logo: "img/integrations/claude.png",
2057
2080
  new: true
2081
+ },
2082
+ {
2083
+ name: "DeepSeek",
2084
+ category: "AI",
2085
+ type: "deepseek",
2086
+ description: "DeepSeek is a Chinese artificial intelligence company that develops open-source large language models (LLMs).",
2087
+ title: "Integrate DeepSeek to your platform",
2088
+ logo: "img/integrations/deepseek.png",
2089
+ new: true
2058
2090
  }
2059
2091
  ]
2060
2092
  },
@@ -2617,6 +2649,7 @@ var defaults = {
2617
2649
  title: "",
2618
2650
  description: "",
2619
2651
  category: "",
2652
+ type: "",
2620
2653
  key: "",
2621
2654
  secret: "",
2622
2655
  logo: "",
@@ -3196,6 +3229,7 @@ var defaultTypes_default = defaultTypes;
3196
3229
  disputeStatus,
3197
3230
  financialStatus,
3198
3231
  formatPhoneNumber,
3232
+ formatRelativeTime,
3199
3233
  fulfillmentStatus,
3200
3234
  getRandomArbitrary,
3201
3235
  girth,