@getpara/user-management-client 1.5.1 → 1.6.0
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/cjs/index.js +21 -0
- package/dist/cjs/index.js.br +0 -0
- package/dist/cjs/index.js.gz +0 -0
- package/dist/cjs/package.json +3 -0
- package/dist/esm/index.js +21 -0
- package/dist/esm/index.js.br +0 -0
- package/dist/esm/index.js.gz +0 -0
- package/dist/esm/package.json +4 -0
- package/dist/types/client.d.ts +4 -1
- package/dist/types/types/auth.d.ts +5 -0
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
var __create = Object.create;
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
7
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
@@ -18,6 +20,7 @@ var __spreadValues = (a, b) => {
|
|
|
18
20
|
}
|
|
19
21
|
return a;
|
|
20
22
|
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
24
|
var __objRest = (source, exclude) => {
|
|
22
25
|
var target = {};
|
|
23
26
|
for (var prop in source)
|
|
@@ -1003,6 +1006,24 @@ var Client = class {
|
|
|
1003
1006
|
return res.data;
|
|
1004
1007
|
});
|
|
1005
1008
|
}
|
|
1009
|
+
// GET /users/:userId/accounts
|
|
1010
|
+
getAccountMetadata(userId, partnerId) {
|
|
1011
|
+
return __async(this, null, function* () {
|
|
1012
|
+
const res = yield this.baseRequest.get(`/users/${userId}/oauth/accounts`, {
|
|
1013
|
+
params: { partnerId }
|
|
1014
|
+
});
|
|
1015
|
+
return {
|
|
1016
|
+
accountMetadata: Object.entries(res.data.accountMetadata || {}).reduce(
|
|
1017
|
+
(acc, [method, obj]) => __spreadProps(__spreadValues({}, acc), {
|
|
1018
|
+
[method]: __spreadProps(__spreadValues({}, obj), {
|
|
1019
|
+
date: new Date(obj.date)
|
|
1020
|
+
})
|
|
1021
|
+
}),
|
|
1022
|
+
{}
|
|
1023
|
+
)
|
|
1024
|
+
};
|
|
1025
|
+
});
|
|
1026
|
+
}
|
|
1006
1027
|
};
|
|
1007
1028
|
var client_default = Client;
|
|
1008
1029
|
|
package/dist/cjs/index.js.br
CHANGED
|
Binary file
|
package/dist/cjs/index.js.gz
CHANGED
|
Binary file
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
2
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
6
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -14,6 +16,7 @@ var __spreadValues = (a, b) => {
|
|
|
14
16
|
}
|
|
15
17
|
return a;
|
|
16
18
|
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
17
20
|
var __objRest = (source, exclude) => {
|
|
18
21
|
var target = {};
|
|
19
22
|
for (var prop in source)
|
|
@@ -942,6 +945,24 @@ var Client = class {
|
|
|
942
945
|
return res.data;
|
|
943
946
|
});
|
|
944
947
|
}
|
|
948
|
+
// GET /users/:userId/accounts
|
|
949
|
+
getAccountMetadata(userId, partnerId) {
|
|
950
|
+
return __async(this, null, function* () {
|
|
951
|
+
const res = yield this.baseRequest.get(`/users/${userId}/oauth/accounts`, {
|
|
952
|
+
params: { partnerId }
|
|
953
|
+
});
|
|
954
|
+
return {
|
|
955
|
+
accountMetadata: Object.entries(res.data.accountMetadata || {}).reduce(
|
|
956
|
+
(acc, [method, obj]) => __spreadProps(__spreadValues({}, acc), {
|
|
957
|
+
[method]: __spreadProps(__spreadValues({}, obj), {
|
|
958
|
+
date: new Date(obj.date)
|
|
959
|
+
})
|
|
960
|
+
}),
|
|
961
|
+
{}
|
|
962
|
+
)
|
|
963
|
+
};
|
|
964
|
+
});
|
|
965
|
+
}
|
|
945
966
|
};
|
|
946
967
|
var client_default = Client;
|
|
947
968
|
|
package/dist/esm/index.js.br
CHANGED
|
Binary file
|
package/dist/esm/index.js.gz
CHANGED
|
Binary file
|
package/dist/types/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosResponse } from 'axios';
|
|
2
|
-
import { Auth, AuthMethod, AuthParams, BackupKitEmailProps, BiometricLocationHint, Chain, CurrentWalletIds, EncryptedKeyShare, EncryptorType, KeyShareType, Network, OnRampAsset, OnRampConfig, OnRampProvider, OnRampPurchase, OnRampPurchaseCreateParams, OnRampPurchaseUpdateParams, PasswordStatus, PregenIds, PublicKeyStatus, PublicKeyType, TelegramAuthResponse, TPregenIdentifierType, VerificationEmailProps, WalletEntity, WalletParams, WalletScheme, WalletType } from './types/index.js';
|
|
2
|
+
import { AccountMetadata, Auth, AuthMethod, AuthParams, BackupKitEmailProps, BiometricLocationHint, Chain, CurrentWalletIds, EncryptedKeyShare, EncryptorType, KeyShareType, Network, OnRampAsset, OnRampConfig, OnRampProvider, OnRampPurchase, OnRampPurchaseCreateParams, OnRampPurchaseUpdateParams, PasswordStatus, PregenIds, PublicKeyStatus, PublicKeyType, TelegramAuthResponse, TPregenIdentifierType, VerificationEmailProps, WalletEntity, WalletParams, WalletScheme, WalletType } from './types/index.js';
|
|
3
3
|
interface ConfigOpts {
|
|
4
4
|
useFetchAdapter?: boolean;
|
|
5
5
|
}
|
|
@@ -335,5 +335,8 @@ declare class Client {
|
|
|
335
335
|
verifyPasswordChallenge(partnerId: string, body: verifyPasswordChallengeBody): Promise<any>;
|
|
336
336
|
getEncryptedWalletPrivateKey(passwordId: string): Promise<any>;
|
|
337
337
|
getUser(userId: string): Promise<any>;
|
|
338
|
+
getAccountMetadata(userId: string, partnerId: string): Promise<{
|
|
339
|
+
accountMetadata: AccountMetadata;
|
|
340
|
+
}>;
|
|
338
341
|
}
|
|
339
342
|
export default Client;
|
|
@@ -84,3 +84,8 @@ export type TelegramAuthResponse = {
|
|
|
84
84
|
photo_url?: string;
|
|
85
85
|
username?: string;
|
|
86
86
|
};
|
|
87
|
+
export type AccountMetadataKey = Lowercase<Exclude<OAuthMethod, OAuthMethod.TWITTER> | 'X'>;
|
|
88
|
+
export type AccountMetadata = Partial<Record<AccountMetadataKey, {
|
|
89
|
+
date: Date;
|
|
90
|
+
metadata: Record<string, any>;
|
|
91
|
+
}>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/user-management-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"require": "./dist/cjs/index.js"
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "2dd6c8ea893d72d693804e5c5b0856d2ea6c3a7a"
|
|
37
37
|
}
|