@getpara/user-management-client 2.0.0-dev.0 → 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.
@@ -1,4 +1,6 @@
1
1
  import { Auth, AuthInfo, AuthParams, PrimaryAuth, PrimaryAuthInfo, VerifiedAuth, WalletParams, WalletRef } from './types/index.js';
2
+ import { AccountMetadata, AccountMetadataKey, LinkedAccounts, PregenAuth, PregenAuthInfo, PregenOrGuestAuth } from './types/auth.js';
3
+ import { PregenIds, TPregenIdentifierType } from './types/wallet.js';
2
4
  export declare function isWalletId(params: WalletParams): params is {
3
5
  walletId: string;
4
6
  };
@@ -11,12 +13,18 @@ export declare function isPhone(params: AuthParams | undefined): params is Auth<
11
13
  export declare function isPhoneLegacy(params: AuthParams | undefined): params is Auth<'phoneLegacy'>;
12
14
  export declare function isFarcaster(params: AuthParams | undefined): params is Auth<'farcaster'>;
13
15
  export declare function isTelegram(params: AuthParams | undefined): params is Auth<'telegram'>;
14
- export declare function isUserId(params: AuthParams | undefined): params is Auth<'userId'>;
15
16
  export declare function isExternalWallet(params: AuthParams | undefined): params is Auth<'externalWallet'>;
17
+ export declare function isX(params: AuthParams | undefined): params is Auth<'x'>;
18
+ export declare function isDiscord(params: AuthParams | undefined): params is Auth<'discord'>;
19
+ export declare function isCustomId(params: AuthParams | undefined): params is Auth<'customId'>;
20
+ export declare function isGuestId(params: AuthParams | undefined): params is Auth<'guestId'>;
21
+ export declare function isUserId(params: AuthParams | undefined): params is Auth<'userId'>;
16
22
  export declare function isPrimary(params: AuthParams | undefined): params is PrimaryAuth;
17
23
  export declare function isVerifiedAuth(params: AuthParams | undefined): params is VerifiedAuth;
24
+ export declare function isPregenAuth(params: AuthParams | undefined): params is PregenAuth;
18
25
  type ExtractAuthOpts = {
19
26
  allowUserId?: boolean;
27
+ allowPregen?: boolean;
20
28
  isRequired?: boolean;
21
29
  };
22
30
  export declare function extractAuthInfo(obj: AuthParams): PrimaryAuthInfo | undefined;
@@ -25,12 +33,27 @@ export declare function extractAuthInfo(obj: AuthParams, opts: ExtractAuthOpts &
25
33
  }): PrimaryAuthInfo | undefined;
26
34
  export declare function extractAuthInfo(obj: AuthParams, opts: ExtractAuthOpts & {
27
35
  isRequired: true;
36
+ allowPregen?: undefined | false;
28
37
  }): PrimaryAuthInfo;
29
38
  export declare function extractAuthInfo(obj: AuthParams, opts: ExtractAuthOpts & {
30
39
  allowUserId: true;
31
- }): AuthInfo | undefined;
40
+ }): PrimaryAuthInfo | AuthInfo<'userId'> | undefined;
32
41
  export declare function extractAuthInfo(obj: AuthParams, opts: ExtractAuthOpts & {
33
42
  allowUserId: true;
34
43
  isRequired: true;
35
- }): AuthInfo;
44
+ }): PrimaryAuthInfo | AuthInfo<'userId'>;
45
+ export declare function extractAuthInfo(obj: AuthParams, opts: ExtractAuthOpts & {
46
+ allowPregen: true;
47
+ }): PregenAuthInfo | undefined;
48
+ export declare function extractAuthInfo(obj: AuthParams, opts: ExtractAuthOpts & {
49
+ allowPregen: true;
50
+ isRequired: true;
51
+ }): PregenAuthInfo;
52
+ export declare function toPregenTypeAndId(auth: PregenOrGuestAuth): [TPregenIdentifierType, string];
53
+ export declare function toPregenIds(auth: PregenAuth): PregenIds;
54
+ export declare function fromAccountMetadata(obj: Partial<Record<AccountMetadataKey, {
55
+ date: string;
56
+ metadata: object;
57
+ }>> | undefined): AccountMetadata;
58
+ export declare function fromLinkedAccounts({ primary, linked }: LinkedAccounts<string>): LinkedAccounts<Date>;
36
59
  export {};
package/package.json CHANGED
@@ -1,31 +1,13 @@
1
1
  {
2
2
  "name": "@getpara/user-management-client",
3
- "version": "2.0.0-dev.0",
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,
9
- "scripts": {
10
- "build": "rm -rf dist && node ./scripts/build.mjs && yarn build:types",
11
- "old-build": "yarn build:cjs && yarn build:esm && yarn build:types",
12
- "build:cjs": "rm -rf dist/cjs && tsc --module commonjs --outDir dist/cjs && printf '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
13
- "build:esm": "rm -rf dist/esm && tsc --module es6 --outDir dist/esm && printf '{\"type\":\"module\",\"sideEffects\":false}' > dist/esm/package.json",
14
- "build:types": "rm -rf dist/types && tsc --module es6 --declarationDir dist/types --emitDeclarationOnly --declaration",
15
- "test": "vitest run --coverage"
16
- },
3
+ "version": "2.0.0-dev.2",
17
4
  "dependencies": {
18
- "axios": "^1.6.3",
19
- "libphonenumber-js": "1.11.2",
20
- "qs": "^6.12.0"
5
+ "axios": "^1.8.4",
6
+ "libphonenumber-js": "^1.11.7"
21
7
  },
22
8
  "devDependencies": {
23
- "typescript": "^5.0.4"
9
+ "typescript": "^5.8.3"
24
10
  },
25
- "files": [
26
- "dist",
27
- "package.json"
28
- ],
29
11
  "exports": {
30
12
  ".": {
31
13
  "types": "./dist/types/index.d.ts",
@@ -33,5 +15,22 @@
33
15
  "require": "./dist/cjs/index.js"
34
16
  }
35
17
  },
36
- "gitHead": "f94ef031ef0e1894f5f0800e55f6ca2904641780"
18
+ "files": [
19
+ "dist",
20
+ "package.json"
21
+ ],
22
+ "gitHead": "77d818539daa181c839a40f0ad5362af4058844e",
23
+ "main": "dist/cjs/index.js",
24
+ "module": "dist/esm/index.js",
25
+ "scripts": {
26
+ "build": "rm -rf dist && node ./scripts/build.mjs && yarn build:types",
27
+ "build:cjs": "rm -rf dist/cjs && tsc --module commonjs --outDir dist/cjs && printf '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
28
+ "build:esm": "rm -rf dist/esm && tsc --module es6 --outDir dist/esm && printf '{\"type\":\"module\",\"sideEffects\":false}' > dist/esm/package.json",
29
+ "build:types": "rm -rf dist/types && tsc --module es6 --declarationDir dist/types --emitDeclarationOnly --declaration",
30
+ "old-build": "yarn build:cjs && yarn build:esm && yarn build:types",
31
+ "test": "vitest run --coverage"
32
+ },
33
+ "sideEffects": false,
34
+ "types": "dist/types/index.d.ts",
35
+ "typings": "dist/types/index.d.ts"
37
36
  }
Binary file
Binary file
Binary file
Binary file