akeyless-client-commons 1.1.23 → 1.1.24

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.
@@ -3,7 +3,7 @@ import { FirebaseStorage } from 'firebase/storage';
3
3
  import { Auth, GoogleAuthProvider, User } from 'firebase/auth';
4
4
  import { AppCheck } from 'firebase/app-check';
5
5
  import { WhereFilterOp, Unsubscribe, Firestore, CollectionReference, DocumentData, Timestamp, DocumentSnapshot } from 'firebase/firestore';
6
- import { TObject, NxUser, CountryOptions, LanguageOptions, UserPermissionsObject, userPermissionsObjectValue, Client, RedisUpdateType, RedisUpdatePayload, SocketCallbackResponse } from 'akeyless-types-commons';
6
+ import { TObject, NxUser, CountryOptions, LanguageOptions, firebase_timestamp, UserPermissionsObject, userPermissionsObjectValue, Client, RedisUpdateType, RedisUpdatePayload, SocketCallbackResponse } from 'akeyless-types-commons';
7
7
  import React, { Dispatch, SetStateAction } from 'react';
8
8
  import { ClassValue } from 'clsx';
9
9
 
@@ -234,7 +234,7 @@ interface TimeOptions {
234
234
  tz?: string;
235
235
  defaultReturnedValue?: string;
236
236
  }
237
- declare function timestamp_to_string(firebaseTimestamp: Timestamp | Date | string, options?: TimeOptions): string;
237
+ declare function timestamp_to_string(firebaseTimestamp: Timestamp | Date | string | firebase_timestamp, options?: TimeOptions): string;
238
238
  declare function timestamp_to_millis(firebaseTimestamp: Timestamp): number;
239
239
  declare function sort_by_timestamp(a: Timestamp, b: Timestamp, reverse?: boolean): number;
240
240
 
@@ -3,7 +3,7 @@ import { FirebaseStorage } from 'firebase/storage';
3
3
  import { Auth, GoogleAuthProvider, User } from 'firebase/auth';
4
4
  import { AppCheck } from 'firebase/app-check';
5
5
  import { WhereFilterOp, Unsubscribe, Firestore, CollectionReference, DocumentData, Timestamp, DocumentSnapshot } from 'firebase/firestore';
6
- import { TObject, NxUser, CountryOptions, LanguageOptions, UserPermissionsObject, userPermissionsObjectValue, Client, RedisUpdateType, RedisUpdatePayload, SocketCallbackResponse } from 'akeyless-types-commons';
6
+ import { TObject, NxUser, CountryOptions, LanguageOptions, firebase_timestamp, UserPermissionsObject, userPermissionsObjectValue, Client, RedisUpdateType, RedisUpdatePayload, SocketCallbackResponse } from 'akeyless-types-commons';
7
7
  import React, { Dispatch, SetStateAction } from 'react';
8
8
  import { ClassValue } from 'clsx';
9
9
 
@@ -234,7 +234,7 @@ interface TimeOptions {
234
234
  tz?: string;
235
235
  defaultReturnedValue?: string;
236
236
  }
237
- declare function timestamp_to_string(firebaseTimestamp: Timestamp | Date | string, options?: TimeOptions): string;
237
+ declare function timestamp_to_string(firebaseTimestamp: Timestamp | Date | string | firebase_timestamp, options?: TimeOptions): string;
238
238
  declare function timestamp_to_millis(firebaseTimestamp: Timestamp): number;
239
239
  declare function sort_by_timestamp(a: Timestamp, b: Timestamp, reverse?: boolean): number;
240
240
 
@@ -2276,6 +2276,8 @@ function timestamp_to_string(firebaseTimestamp, options) {
2276
2276
  date = firebaseTimestamp.toDate();
2277
2277
  } else if (_instanceof(firebaseTimestamp, Date)) {
2278
2278
  date = firebaseTimestamp;
2279
+ } else if (firebaseTimestamp._seconds && firebaseTimestamp._nanoseconds) {
2280
+ date = new Date(firebaseTimestamp._seconds * 1e3 + firebaseTimestamp._nanoseconds / 1e6);
2279
2281
  } else if (typeof firebaseTimestamp === "string") {
2280
2282
  date = import_moment_timezone.default.utc(firebaseTimestamp, (options === null || options === void 0 ? void 0 : options.fromFormat) || "DD/MM/YYYY HH:mm:ss").toDate();
2281
2283
  if (isNaN(date.getTime())) {
@@ -1900,6 +1900,8 @@ function timestamp_to_string(firebaseTimestamp, options) {
1900
1900
  date = firebaseTimestamp.toDate();
1901
1901
  } else if (_instanceof(firebaseTimestamp, Date)) {
1902
1902
  date = firebaseTimestamp;
1903
+ } else if (firebaseTimestamp._seconds && firebaseTimestamp._nanoseconds) {
1904
+ date = new Date(firebaseTimestamp._seconds * 1e3 + firebaseTimestamp._nanoseconds / 1e6);
1903
1905
  } else if (typeof firebaseTimestamp === "string") {
1904
1906
  date = moment2.utc(firebaseTimestamp, (options === null || options === void 0 ? void 0 : options.fromFormat) || "DD/MM/YYYY HH:mm:ss").toDate();
1905
1907
  if (isNaN(date.getTime())) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akeyless-client-commons",
3
- "version": "1.1.23",
3
+ "version": "1.1.24",
4
4
  "scripts": {
5
5
  "build": "tsup",
6
6
  "deploy": "npm run build && npm version patch --no-git-tag-version && npm publish",