@getpara/core-sdk 2.0.0-dev.1 → 2.0.0-dev.2

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.
Files changed (97) hide show
  1. package/dist/cjs/ParaCore.js +3378 -0
  2. package/dist/cjs/PlatformUtils.js +15 -0
  3. package/dist/cjs/StorageUtils.js +15 -0
  4. package/dist/cjs/constants.js +87 -0
  5. package/dist/cjs/cryptography/utils.js +350 -0
  6. package/dist/cjs/errors.js +51 -0
  7. package/dist/cjs/external/mpcComputationClient.js +62 -0
  8. package/dist/cjs/external/userManagementClient.js +106 -0
  9. package/dist/cjs/index.js +100 -5043
  10. package/dist/cjs/package.json +3 -0
  11. package/dist/cjs/shares/KeyContainer.js +89 -0
  12. package/dist/cjs/shares/recovery.js +127 -0
  13. package/dist/cjs/shares/shareDistribution.js +104 -0
  14. package/dist/cjs/transmission/transmissionUtils.js +93 -0
  15. package/dist/cjs/types/auth.js +33 -0
  16. package/dist/cjs/types/config.js +43 -0
  17. package/dist/cjs/types/coreApi.js +89 -0
  18. package/dist/cjs/types/events.js +41 -0
  19. package/dist/cjs/types/index.js +54 -0
  20. package/dist/cjs/types/methods.js +15 -0
  21. package/dist/cjs/types/onRamps.js +33 -0
  22. package/dist/cjs/types/popup.js +35 -0
  23. package/dist/cjs/types/recovery.js +34 -0
  24. package/dist/cjs/types/theme.js +15 -0
  25. package/dist/cjs/types/wallet.js +31 -0
  26. package/dist/cjs/utils/autobind.js +41 -0
  27. package/dist/cjs/utils/events.js +45 -0
  28. package/dist/cjs/utils/formatting.js +116 -0
  29. package/dist/cjs/utils/index.js +41 -0
  30. package/dist/cjs/utils/json.js +37 -0
  31. package/dist/cjs/utils/listeners.js +71 -0
  32. package/dist/cjs/utils/onRamps.js +92 -0
  33. package/dist/cjs/utils/phone.js +73 -0
  34. package/dist/cjs/utils/polling.js +58 -0
  35. package/dist/cjs/utils/types.js +29 -0
  36. package/dist/cjs/utils/url.js +135 -0
  37. package/dist/cjs/utils/wallet.js +159 -0
  38. package/dist/esm/ParaCore.js +3343 -0
  39. package/dist/esm/PlatformUtils.js +0 -0
  40. package/dist/esm/StorageUtils.js +0 -0
  41. package/dist/esm/chunk-7B52C2XE.js +70 -0
  42. package/dist/esm/constants.js +45 -0
  43. package/dist/esm/cryptography/utils.js +282 -0
  44. package/dist/esm/errors.js +27 -0
  45. package/dist/esm/external/mpcComputationClient.js +30 -0
  46. package/dist/esm/external/userManagementClient.js +71 -0
  47. package/dist/esm/index.js +76 -5011
  48. package/dist/esm/package.json +4 -0
  49. package/dist/esm/shares/KeyContainer.js +57 -0
  50. package/dist/esm/shares/recovery.js +74 -0
  51. package/dist/esm/shares/shareDistribution.js +64 -0
  52. package/dist/esm/transmission/transmissionUtils.js +42 -0
  53. package/dist/esm/types/auth.js +11 -0
  54. package/dist/esm/types/config.js +20 -0
  55. package/dist/esm/types/coreApi.js +66 -0
  56. package/dist/esm/types/events.js +19 -0
  57. package/dist/esm/types/index.js +23 -0
  58. package/dist/esm/types/methods.js +0 -0
  59. package/dist/esm/types/onRamps.js +11 -0
  60. package/dist/esm/types/popup.js +13 -0
  61. package/dist/esm/types/recovery.js +12 -0
  62. package/dist/esm/types/theme.js +0 -0
  63. package/dist/esm/types/wallet.js +9 -0
  64. package/dist/esm/utils/autobind.js +19 -0
  65. package/dist/esm/utils/events.js +11 -0
  66. package/dist/esm/utils/formatting.js +76 -0
  67. package/dist/esm/utils/index.js +11 -0
  68. package/dist/esm/utils/json.js +15 -0
  69. package/dist/esm/utils/listeners.js +38 -0
  70. package/dist/esm/utils/onRamps.js +66 -0
  71. package/dist/esm/utils/phone.js +39 -0
  72. package/dist/esm/utils/polling.js +18 -0
  73. package/dist/esm/utils/types.js +7 -0
  74. package/dist/esm/utils/url.js +90 -0
  75. package/dist/esm/utils/wallet.js +103 -0
  76. package/dist/types/ParaCore.d.ts +115 -449
  77. package/dist/types/PlatformUtils.d.ts +4 -5
  78. package/dist/types/constants.d.ts +16 -13
  79. package/dist/types/index.d.ts +3 -3
  80. package/dist/types/shares/KeyContainer.d.ts +0 -2
  81. package/dist/types/types/auth.d.ts +16 -0
  82. package/dist/types/types/config.d.ts +12 -5
  83. package/dist/types/types/coreApi.d.ts +152 -58
  84. package/dist/types/types/events.d.ts +4 -1
  85. package/dist/types/types/index.d.ts +1 -0
  86. package/dist/types/types/methods.d.ts +49 -57
  87. package/dist/types/types/onRamps.d.ts +3 -3
  88. package/dist/types/types/wallet.d.ts +8 -3
  89. package/dist/types/utils/formatting.d.ts +5 -2
  90. package/dist/types/utils/onRamps.d.ts +12 -5
  91. package/dist/types/utils/phone.d.ts +4 -0
  92. package/dist/types/utils/wallet.d.ts +8 -7
  93. package/package.json +27 -26
  94. package/dist/cjs/index.js.br +0 -0
  95. package/dist/cjs/index.js.gz +0 -0
  96. package/dist/esm/index.js.br +0 -0
  97. package/dist/esm/index.js.gz +0 -0
@@ -1,4 +1,4 @@
1
- import { AuthType, PrimaryAuthInfo, ServerAuthStateLogin, ServerAuthStateSignup, AuthMethod, ServerAuthStateVerify, VerifiedAuth, AuthExtras, OAuthMethod, WalletType } from '@getpara/user-management-client';
1
+ import { PrimaryAuthInfo, ServerAuthStateLogin, ServerAuthStateSignup, AuthMethod, ServerAuthStateVerify, VerifiedAuth, AuthExtras, TOAuthMethod, TWalletType, TelegramAuthResponse } from '@getpara/user-management-client';
2
2
  import { Theme } from './theme.js';
3
3
  import { RecoveryStatus } from './recovery.js';
4
4
  import { Wallet } from './wallet.js';
@@ -6,30 +6,16 @@ type Device = {
6
6
  sessionId: string;
7
7
  encryptionKey: string;
8
8
  };
9
- export type EmbeddedWalletType = Exclude<WalletType, never>;
10
- export type ExternalWalletType = Exclude<WalletType, never>;
9
+ export type EmbeddedWalletType = Exclude<TWalletType, never>;
10
+ export type ExternalWalletType = Exclude<TWalletType, never>;
11
11
  export type VerifyExternalWalletV1 = {
12
12
  address: string;
13
13
  signedMessage: string;
14
14
  cosmosPublicKeyHex?: string;
15
15
  cosmosSigner?: string;
16
16
  };
17
- export type PortalUrlType = 'createAuth' | 'createPassword' | 'loginAuth' | 'loginPassword' | 'txReview' | 'onRamp';
17
+ export type PortalUrlType = 'createAuth' | 'createPassword' | 'loginAuth' | 'loginPassword' | 'txReview' | 'onRamp' | 'telegramLogin';
18
18
  export type PortalUrlOptions = {
19
- params?: Record<string, string | undefined | null>;
20
- authType?: AuthType;
21
- isForNewDevice?: boolean;
22
- loginEncryptionPublicKey?: string;
23
- newDeviceSessionId?: string;
24
- newDeviceEncryptionKey?: string;
25
- partnerId?: string;
26
- sessionId?: string;
27
- theme?: Theme;
28
- pathId?: string;
29
- displayName?: string;
30
- pfpUrl?: string;
31
- };
32
- export type PortalUrlOptionsV2 = {
33
19
  params?: Record<string, string | undefined | null>;
34
20
  isForNewDevice?: boolean;
35
21
  thisDevice?: Device;
@@ -38,40 +24,7 @@ export type PortalUrlOptionsV2 = {
38
24
  portalTheme?: Theme;
39
25
  pathId?: string;
40
26
  shorten?: boolean;
41
- };
42
- export type GetWebAuthUrlForLoginParams = {
43
- /**
44
- * The session ID for the URL.
45
- */
46
- sessionId: string;
47
- /**
48
- * Either 'email' | 'phone' | 'farcaster' | 'telegram'
49
- */
50
- authType?: AuthType;
51
- /**
52
- * The public key to use for encrypting the login encryption key.
53
- */
54
- loginEncryptionPublicKey: string;
55
- /**
56
- * The partner ID for the URL.
57
- */
58
- partnerId?: string;
59
- /**
60
- * The session ID for the new device being registered.
61
- */
62
- newDeviceSessionId?: string;
63
- /**
64
- * The public key for the new device being registered.
65
- */
66
- newDeviceEncryptionKey?: string;
67
- /**
68
- * The Telegram or Farcaster display name for the user.
69
- */
70
- displayName?: string;
71
- /**
72
- * The Telegram or Farcaster URL for the user's profile picture.
73
- */
74
- pfpUrl?: string;
27
+ isEmbedded?: boolean;
75
28
  };
76
29
  export type WithAuthMethod = {
77
30
  /**
@@ -97,6 +50,12 @@ export type WithShorten = {
97
50
  */
98
51
  shorten?: boolean;
99
52
  };
53
+ export type WithIsPasskeySupported = {
54
+ /**
55
+ * Whether the current device supports WebAuth passkeys.
56
+ */
57
+ isPasskeySupported: boolean;
58
+ };
100
59
  export type PollParams = {
101
60
  /**
102
61
  * A callback function that will be invoked on each method poll.
@@ -107,6 +66,23 @@ export type PollParams = {
107
66
  */
108
67
  onCancel?: () => void;
109
68
  };
69
+ export type FarcasterParams = PollParams & {
70
+ /**
71
+ * A function returning a boolean, indicating whether the Farcaster login process should be cancelled.
72
+ */
73
+ isCanceled?: () => boolean;
74
+ /**
75
+ * A callback function that will be invoked with the Farcaster Connect URI when it is available.
76
+ * You will need to display the URI as a QR code.
77
+ */
78
+ onConnectUri?: (uri: string) => void;
79
+ };
80
+ export type TelegramParams = {
81
+ /**
82
+ * The response received from the Telegram login bot.
83
+ */
84
+ telegramAuthResponse: TelegramAuthResponse;
85
+ };
110
86
  export type LoginUrlParams = WithAuthMethod & WithCustomTheme & WithShorten & {
111
87
  sessionId?: string;
112
88
  };
@@ -120,15 +96,26 @@ export type OAuthUrlParams = {
120
96
  /**
121
97
  * The third-party OAuth service.
122
98
  */
123
- method: Exclude<OAuthMethod, 'TELEGRAM' | 'FARCASTER'>;
99
+ method: Exclude<TOAuthMethod, 'TELEGRAM' | 'FARCASTER'>;
100
+ /**
101
+ * The app scheme to redirect to after OAuth is complete.
102
+ */
103
+ appScheme?: string;
104
+ };
105
+ export type OAuthParams = OAuthUrlParams & PollParams & {
124
106
  /**
125
- * The deeplink URL to redirect to after OAuth is complete.
107
+ * A function returning a boolean, indicating whether the OAuth process should be cancelled.
126
108
  */
127
- deeplinkUrl?: string;
109
+ isCanceled?: () => boolean;
110
+ /**
111
+ * A callback function that will be invoked with the OAuth URL when it is available.
112
+ * For example, you can use this to open the URL in a new window or tab.
113
+ */
114
+ onOAuthUrl?: (url: string) => void;
128
115
  };
129
116
  export type AuthStateBaseParams = WithCustomTheme & WithUseShortUrls;
130
117
  export type AuthStateVerify = ServerAuthStateVerify;
131
- export type AuthStateLogin = Omit<ServerAuthStateLogin, 'loginAuthMethods'> & {
118
+ export type AuthStateLogin = Omit<ServerAuthStateLogin, 'loginAuthMethods'> & WithIsPasskeySupported & {
132
119
  /**
133
120
  * A Para Portal URL for logging in via a WebAuth passkey. For best compatibility, you should open this URL in a new window or tab.
134
121
  */
@@ -142,7 +129,7 @@ export type AuthStateLogin = Omit<ServerAuthStateLogin, 'loginAuthMethods'> & {
142
129
  */
143
130
  passwordUrl?: string;
144
131
  };
145
- export type AuthStateSignup = Omit<ServerAuthStateSignup, 'signupAuthMethods'> & {
132
+ export type AuthStateSignup = Omit<ServerAuthStateSignup, 'signupAuthMethods'> & WithIsPasskeySupported & {
146
133
  /**
147
134
  * A Para Portal URL for creating a new WebAuth passkey.
148
135
  */
@@ -188,4 +175,9 @@ export type Verify2faResponse = {
188
175
  };
189
176
  export type CoreAuthInfo = PrimaryAuthInfo & AuthExtras;
190
177
  export type StorageType = 'local' | 'session' | 'secure' | 'all';
178
+ export type GetWalletBalanceParams = {
179
+ walletId: string;
180
+ rpcUrl?: string;
181
+ };
182
+ export type GetWalletBalanceResponse = Promise<string | undefined>;
191
183
  export {};
@@ -1,7 +1,7 @@
1
- import { Network, OnRampAsset, OnRampProvider, OnRampPurchaseType, WalletType } from '@getpara/user-management-client';
1
+ import { Network, OnRampAsset, OnRampProvider, OnRampPurchaseType, TWalletType } from '@getpara/user-management-client';
2
2
  export type ProviderAssetInfo = [string, Partial<Record<OnRampPurchaseType, boolean>>];
3
- export type OnRampAssetInfo = Record<WalletType, Partial<Record<Network, Partial<Record<OnRampAsset, Partial<Record<OnRampProvider, ProviderAssetInfo>>>>>>>;
4
- export type OnRampAssetInfoRow = [WalletType, Network, OnRampAsset, Partial<Record<OnRampProvider, ProviderAssetInfo>>];
3
+ export type OnRampAssetInfo = Record<TWalletType, Partial<Record<Network, Partial<Record<OnRampAsset, Partial<Record<OnRampProvider, ProviderAssetInfo>>>>>>>;
4
+ export type OnRampAssetInfoRow = [TWalletType, Network, OnRampAsset, Partial<Record<OnRampProvider, ProviderAssetInfo>>];
5
5
  export declare enum OnRampMethod {
6
6
  ACH = "ACH",
7
7
  DEBIT = "Debit",
@@ -1,4 +1,4 @@
1
- import { EmbeddedWalletType, ExternalWalletType, PartnerEntity, TPregenIdentifierType, WalletScheme } from '@getpara/user-management-client';
1
+ import { EmbeddedWalletType, ExternalWalletType, PartnerEntity, TExternalWallet, TPregenIdentifierType, TWalletScheme } from '@getpara/user-management-client';
2
2
  export interface Wallet {
3
3
  createdAt?: string;
4
4
  id: string;
@@ -7,7 +7,7 @@ export interface Wallet {
7
7
  address?: string;
8
8
  addressSecondary?: string;
9
9
  publicKey?: string;
10
- scheme?: WalletScheme;
10
+ scheme?: TWalletScheme;
11
11
  type?: EmbeddedWalletType | ExternalWalletType;
12
12
  isPregen?: boolean;
13
13
  pregenIdentifier?: string;
@@ -20,6 +20,11 @@ export interface Wallet {
20
20
  lastUsedPartnerId?: string;
21
21
  isExternal?: boolean;
22
22
  isExternalWithParaAuth?: boolean;
23
+ externalProviderId?: TExternalWallet;
24
+ isExternalWithVerification?: boolean;
25
+ isExternalConnectionOnly?: boolean;
26
+ ensName?: string | null;
27
+ ensAvatar?: string | null;
23
28
  }
24
29
  /** @deprecated */
25
30
  export declare enum PregenIdentifierType {
@@ -37,4 +42,4 @@ export interface DeniedSignatureResWithUrl extends DeniedSignatureRes {
37
42
  }
38
43
  export type SignatureRes = SuccessfulSignatureRes | DeniedSignatureRes;
39
44
  export type FullSignatureRes = SuccessfulSignatureRes | DeniedSignatureResWithUrl;
40
- export type ExternalWalletConnectionType = 'NONE' | 'CONNECTION_ONLY' | 'AUTHENTICATED';
45
+ export type ExternalWalletConnectionType = 'NONE' | 'CONNECTION_ONLY' | 'AUTHENTICATED' | 'VERIFICATION';
@@ -1,4 +1,4 @@
1
- import { WalletTypeProp } from '../types/index.js';
1
+ import { TWalletType } from '@getpara/user-management-client';
2
2
  export type Hex = `0x${string}`;
3
3
  export interface Signature {
4
4
  r: Hex;
@@ -10,7 +10,10 @@ export declare function hexToSignature(hexSig: string): Signature;
10
10
  export declare function hexToUint8Array(hex: string): Uint8Array;
11
11
  export declare function hexToDecimal(hex: string): string;
12
12
  export declare function decimalToHex(decimal: string): Hex;
13
+ export declare function compressPubkey(pubkey: Uint8Array): Uint8Array;
14
+ export declare function rawSecp256k1PubkeyToRawAddress(pubkeyData: Uint8Array): Uint8Array;
13
15
  export declare function getCosmosAddress(publicKey: string, prefix: string): string;
14
- export declare function truncateAddress(str: string, addressType: WalletTypeProp, { prefix }?: {
16
+ export declare function truncateAddress(str: string, addressType: TWalletType, { prefix, targetLength, }?: {
15
17
  prefix?: string;
18
+ targetLength?: number;
16
19
  }): string;
@@ -1,12 +1,19 @@
1
- import { Network, OnRampAsset, WalletType } from '@getpara/user-management-client';
1
+ import { Network, OnRampAsset, OnRampProvider, OnRampPurchaseType, TWalletType } from '@getpara/user-management-client';
2
2
  import { OnRampAssetInfoRow, OnRampAssetInfo } from '../types/index.js';
3
3
  export declare function toAssetInfoArray(data: OnRampAssetInfo): OnRampAssetInfoRow[];
4
- export declare function getOnRampNetworks(data: OnRampAssetInfo, { walletType, allowed }?: {
5
- walletType?: WalletType;
4
+ export declare function getOnRampNetworks(data: OnRampAssetInfo, { walletType, allowed, assets, providers, action, }?: {
5
+ walletType?: TWalletType;
6
6
  allowed?: Network[];
7
+ assets?: OnRampAsset[];
8
+ providers?: OnRampProvider[];
9
+ action?: OnRampPurchaseType;
7
10
  }): Network[];
8
- export declare function getOnRampAssets(data: OnRampAssetInfo, { walletType, network, allowed, }?: {
9
- walletType?: WalletType;
11
+ export declare function getOnRampAssets(data: OnRampAssetInfo, { walletType, network, allowed, providers, action, }?: {
12
+ walletType?: TWalletType;
10
13
  network?: Network;
11
14
  allowed?: OnRampAsset[];
15
+ providers?: OnRampProvider[];
16
+ action?: OnRampPurchaseType;
12
17
  }): OnRampAsset[];
18
+ export declare const NETWORK_PREFIXES: Partial<Record<Network, string>>;
19
+ export declare function getNetworkPrefix(network: Network): string | undefined;
@@ -5,3 +5,7 @@ export declare function formatPhoneNumber(phone: string, countryCode: string | u
5
5
  forDisplay: true;
6
6
  }): string | null;
7
7
  export declare function displayPhoneNumber(phone: string, countryCode?: string): string;
8
+ export declare function splitPhoneNumber(phone: `+${number}`): {
9
+ phone: string;
10
+ countryCode: string;
11
+ };
@@ -1,12 +1,13 @@
1
- import { CurrentWalletIds, SupportedWalletTypes, TPregenIdentifierType, WalletEntity, WalletScheme, WalletType } from '@getpara/user-management-client';
2
- import { Wallet, WalletTypeProp } from '../types/index.js';
3
- export declare const WalletSchemeTypeMap: Record<WalletScheme, Partial<Record<WalletType, true>>>;
1
+ import { CurrentWalletIds, SupportedWalletTypes, TPregenIdentifierType, WalletEntity, TWalletScheme, TWalletType } from '@getpara/user-management-client';
2
+ import { Wallet } from '../types/index.js';
3
+ export declare const WalletSchemeTypeMap: Record<TWalletScheme, Partial<Record<TWalletType, true>>>;
4
4
  export declare function isPregenIdentifierMatch(a: string | null | undefined, b: string | null | undefined, type: TPregenIdentifierType): boolean;
5
- export declare function isWalletSupported(types: WalletType[], wallet: Omit<Wallet, 'signer'>): boolean;
6
- export declare function getSchemes(types: WalletTypeProp[] | SupportedWalletTypes): WalletScheme[];
7
- export declare function getWalletTypes(schemes: WalletScheme[]): WalletType[];
8
- export declare function getEquivalentTypes(types: WalletTypeProp[] | WalletTypeProp): WalletType[];
5
+ export declare function isWalletSupported(types: TWalletType[], wallet: Omit<Wallet, 'signer'>): boolean;
6
+ export declare function getSchemes(types: TWalletType[] | SupportedWalletTypes): TWalletScheme[];
7
+ export declare function getWalletTypes(schemes: TWalletScheme[]): TWalletType[];
8
+ export declare function getEquivalentTypes(types: TWalletType[] | TWalletType): TWalletType[];
9
9
  export declare function entityToWallet(w: WalletEntity): Omit<Wallet, 'signer'>;
10
10
  export declare function migrateWallet(obj: Record<string, unknown>): Wallet;
11
11
  export declare function supportedWalletTypesEq(a: SupportedWalletTypes, b: SupportedWalletTypes): boolean;
12
12
  export declare function mergeCurrentWalletIds(original: CurrentWalletIds, additional: CurrentWalletIds): CurrentWalletIds;
13
+ export declare function newUuid(): string;
package/package.json CHANGED
@@ -1,38 +1,21 @@
1
1
  {
2
2
  "name": "@getpara/core-sdk",
3
- "version": "2.0.0-dev.1",
4
- "main": "dist/cjs/index.js",
5
- "module": "dist/esm/index.js",
6
- "types": "dist/types/index.d.ts",
7
- "typings": "dist/types/index.d.ts",
8
- "sideEffects": false,
3
+ "version": "2.0.0-dev.2",
9
4
  "dependencies": {
10
- "@celo/utils": "^8.0.0",
5
+ "@celo/utils": "^8.0.2",
11
6
  "@cosmjs/encoding": "^0.32.4",
12
- "@getpara/user-management-client": "2.0.0-dev.1",
7
+ "@ethereumjs/util": "^9.1.0",
8
+ "@getpara/user-management-client": "2.0.0-dev.2",
13
9
  "@noble/hashes": "^1.5.0",
14
10
  "base64url": "^3.0.1",
15
- "ethereumjs-util": "7.1.5",
16
- "libphonenumber-js": "1.11.2",
11
+ "libphonenumber-js": "^1.11.7",
17
12
  "node-forge": "^1.3.1",
18
- "qs": "^6.12.0"
19
- },
20
- "scripts": {
21
- "build": "rm -rf dist && node ./scripts/build.mjs && yarn build:types && yarn post-build",
22
- "old-build": "yarn build:cjs && yarn build:esm && yarn build:types; yarn post-build",
23
- "post-build": "./scripts/set-version.sh",
24
- "build:cjs": "rm -rf dist/cjs && tsc --module commonjs --outDir dist/cjs && printf '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
25
- "build:esm": "rm -rf dist/esm && tsc --module es6 --outDir dist/esm && printf '{\"type\":\"module\",\"sideEffects\":false}' > dist/esm/package.json",
26
- "build:types": "rm -rf dist/types && tsc --module es6 --declarationDir dist/types --emitDeclarationOnly --declaration",
27
- "test": "vitest run --coverage"
13
+ "uuid": "^11.1.0"
28
14
  },
29
15
  "devDependencies": {
30
- "typescript": "5.1.6"
16
+ "@faker-js/faker": "^9.5.1",
17
+ "typescript": "^5.8.3"
31
18
  },
32
- "files": [
33
- "dist",
34
- "package.json"
35
- ],
36
19
  "exports": {
37
20
  ".": {
38
21
  "types": "./dist/types/index.d.ts",
@@ -40,5 +23,23 @@
40
23
  "require": "./dist/cjs/index.js"
41
24
  }
42
25
  },
43
- "gitHead": "426e843bd6084fb2e5f30ab87b02c79fc2f52832"
26
+ "files": [
27
+ "dist",
28
+ "package.json"
29
+ ],
30
+ "gitHead": "77d818539daa181c839a40f0ad5362af4058844e",
31
+ "main": "dist/cjs/index.js",
32
+ "module": "dist/esm/index.js",
33
+ "scripts": {
34
+ "build": "rm -rf dist && node ./scripts/build.mjs && yarn build:types",
35
+ "build:cjs": "rm -rf dist/cjs && tsc --module commonjs --outDir dist/cjs && printf '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
36
+ "build:esm": "rm -rf dist/esm && tsc --module es6 --outDir dist/esm && printf '{\"type\":\"module\",\"sideEffects\":false}' > dist/esm/package.json",
37
+ "build:types": "rm -rf dist/types && tsc --module es6 --declarationDir dist/types --emitDeclarationOnly --declaration",
38
+ "old-build": "yarn build:cjs && yarn build:esm && yarn build:types; yarn post-build",
39
+ "post-build": "./scripts/set-version.sh",
40
+ "test": "vitest run --coverage"
41
+ },
42
+ "sideEffects": false,
43
+ "types": "dist/types/index.d.ts",
44
+ "typings": "dist/types/index.d.ts"
44
45
  }
Binary file
Binary file
Binary file
Binary file