wenum 1.92.1 → 1.94.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/index.d.mts +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +25 -6
- package/dist/index.mjs +23 -5
- package/package.json +1 -1
- package/src/page/entity.ts +24 -0
- package/src/page/index.ts +1 -0
- package/src/page/pid.ts +2 -1
- package/src/page/profile/index.ts +0 -1
- package/src/page/profile/profile.ts +4 -6
- package/src/r2/avatarR2Folder.ts +5 -4
- package/src/page/profile/addingEntity.ts +0 -7
package/dist/index.d.mts
CHANGED
|
@@ -68,15 +68,16 @@ declare const ZeroGameMeta: GameMetaProps;
|
|
|
68
68
|
|
|
69
69
|
type LeaderboardType = "score" | "duel" | "time" | "distance" | "weight";
|
|
70
70
|
|
|
71
|
-
type AddingEntityType = "gameToLeaderboard" | "playerToDuelGame" | "playerToNonDuelGame" | "memberToCircle";
|
|
72
|
-
type EntityType = "leaderboard" | "team" | "collection" | "uoi";
|
|
73
|
-
|
|
74
71
|
type PlayerType = 'uoi' | 'team' | 'collection';
|
|
75
72
|
|
|
76
73
|
type PostPrivacy = "public" | "private" | "parent" | "internal";
|
|
77
74
|
|
|
78
75
|
type LocationType = "none" | "point" | "street" | "city";
|
|
79
76
|
|
|
77
|
+
type AddingEntityType = "gameToLeaderboard" | "playerToDuelGame" | "playerToNonDuelGame" | "memberToCircle";
|
|
78
|
+
type EntityType = ProfileType | "collection";
|
|
79
|
+
declare function getPIDPrefixByEntityType(entityType: EntityType): string;
|
|
80
|
+
|
|
80
81
|
type PIDPrefixType = 'usr' | 'uoi' | 'tms' | 'arn' | 'evt' | 'col' | 'lbd' | 'gme' | 'mkt' | 'org' | 'lcp' | 'lcs' | 'lcc' | 'lip' | 'lis' | 'lic' | 'txt' | 'img' | 'pol' | 'vid' | '';
|
|
81
82
|
declare const PID_LENGTH = 9;
|
|
82
83
|
declare const PID_PREFIX_LENGTH = 3;
|
|
@@ -269,7 +270,7 @@ type PageR2Folder = 'collection' | 'game' | 'uoi' | 'user' | 'team' | 'leaderboa
|
|
|
269
270
|
declare function getPageR2CdnUrl(folder: PageR2Folder, pageID: string, imageID: string, size: ImageSize): string;
|
|
270
271
|
|
|
271
272
|
type AvatarR2Folder = 'collection' | 'game' | 'user' | 'team' | 'leaderboard' | 'arena' | 'event' | 'market' | '';
|
|
272
|
-
declare function
|
|
273
|
+
declare function getAvatarR2FolderByEntityType(entityType: EntityType): AvatarR2Folder;
|
|
273
274
|
declare function getAvatarR2CdnUrl(folder: AvatarR2Folder, pageID: string, imageID: string, size: ImageSize): string;
|
|
274
275
|
|
|
275
|
-
export { ALL_CARDGAMES_INTERESTS, ALL_INTEREST_CATEGORIES, ALL_LEISURE_INTERESTS, ALL_MUSIC_INTERESTS, ALL_PETS_INTERESTS, ALL_SPORTS_INTERESTS, ALL_TRAVEL_INTERESTS, type AccountStatus, type AddingEntityType, AdminAccountStatus, AttachmentType, AttendanceStatus, type AvatarR2Folder, BasketballPosition, type BroadcastType, type BuddyingStatus, COLLECTION_ATTRIBUTE_LABEL, COLLECTION_PETS_ATTRIBUTE_LABEL, COMMON_ATTRIBUTE_LABEL, type CardGamesInterestType, type CategoryType, ChallengeStatus, type CollectionAttributeType, type CollectionMetaProps, type CollectionMetaStatus, type CollectionOwnerStatus, type CollectionPetsAttributeType, type CollectionPrivacy, type CollectionStatus, type CollectionType, type CommonAttributeType, type CommonMarketType, type DuelGameResultType, type EntityType, type EventsNearbyProps, FollowingStatus, type GameMetaProps, type GameType, type GamesByTypeNearbyProps, type GamesNearbyProps, type Gender, type Handedness, INTERESTS_BY_CATEGORY, type ImageSize, type InterestNearbyProps, type InterestType, type LeaderboardType, type LeaderboardsByGameTypeNearbyProps, type LeisureInterestType, type LengthUnit, type LocationType, type MarketMetaProps, type MarketMetaStatus, type MarketType, type MarketsByTypeNearbyProps, type MemberingStatus, type MusicInterestType, type NearbyProps, type NotificationType, type PIDPrefixType, PID_LENGTH, PID_PREFIX_LENGTH, type PageR2Folder, type PageType, type PetsInterestType, type PlayerType, type PostPrivacy, type ProfilePermission, type ProfilePrivacy, type ProfileStatus, type ProfileType, ReactionType, type SocialMediaType, type SportsInterestType, type SubjectR2Folder, type SubjectType, type TennisBackhand, type TennisLevel, type TravelInterestType, UOI_ATTRIBUTE_LABEL, UOI_SPORTS_ATTRIBUTE_LABEL, UOI_SPORTS_BASKETBALL_ATTRIBUTE_LABEL, UOI_SPORTS_TENNIS_ATTRIBUTE_LABEL, type UoiAttributeType, type UoiSportsAttributeType, type UoiSportsBasketballAttributeType, type UoiSportsTennisAttributeType, type UserPronoun, type WeightUnit, ZeroCollectionMeta, ZeroGameMeta, ZeroMarketOption, getAvatarR2CdnUrl,
|
|
276
|
+
export { ALL_CARDGAMES_INTERESTS, ALL_INTEREST_CATEGORIES, ALL_LEISURE_INTERESTS, ALL_MUSIC_INTERESTS, ALL_PETS_INTERESTS, ALL_SPORTS_INTERESTS, ALL_TRAVEL_INTERESTS, type AccountStatus, type AddingEntityType, AdminAccountStatus, AttachmentType, AttendanceStatus, type AvatarR2Folder, BasketballPosition, type BroadcastType, type BuddyingStatus, COLLECTION_ATTRIBUTE_LABEL, COLLECTION_PETS_ATTRIBUTE_LABEL, COMMON_ATTRIBUTE_LABEL, type CardGamesInterestType, type CategoryType, ChallengeStatus, type CollectionAttributeType, type CollectionMetaProps, type CollectionMetaStatus, type CollectionOwnerStatus, type CollectionPetsAttributeType, type CollectionPrivacy, type CollectionStatus, type CollectionType, type CommonAttributeType, type CommonMarketType, type DuelGameResultType, type EntityType, type EventsNearbyProps, FollowingStatus, type GameMetaProps, type GameType, type GamesByTypeNearbyProps, type GamesNearbyProps, type Gender, type Handedness, INTERESTS_BY_CATEGORY, type ImageSize, type InterestNearbyProps, type InterestType, type LeaderboardType, type LeaderboardsByGameTypeNearbyProps, type LeisureInterestType, type LengthUnit, type LocationType, type MarketMetaProps, type MarketMetaStatus, type MarketType, type MarketsByTypeNearbyProps, type MemberingStatus, type MusicInterestType, type NearbyProps, type NotificationType, type PIDPrefixType, PID_LENGTH, PID_PREFIX_LENGTH, type PageR2Folder, type PageType, type PetsInterestType, type PlayerType, type PostPrivacy, type ProfilePermission, type ProfilePrivacy, type ProfileStatus, type ProfileType, ReactionType, type SocialMediaType, type SportsInterestType, type SubjectR2Folder, type SubjectType, type TennisBackhand, type TennisLevel, type TravelInterestType, UOI_ATTRIBUTE_LABEL, UOI_SPORTS_ATTRIBUTE_LABEL, UOI_SPORTS_BASKETBALL_ATTRIBUTE_LABEL, UOI_SPORTS_TENNIS_ATTRIBUTE_LABEL, type UoiAttributeType, type UoiSportsAttributeType, type UoiSportsBasketballAttributeType, type UoiSportsTennisAttributeType, type UserPronoun, type WeightUnit, ZeroCollectionMeta, ZeroGameMeta, ZeroMarketOption, getAvatarR2CdnUrl, getAvatarR2FolderByEntityType, getCollectionAttributeLabel, getCommonAttributeLabel, getEntityTypeByPID, getNearbyIndex, getPIDPrefixByEntityType, getPIDPrefixByProfileType, getPageR2CdnUrl, getProfileTypeByPID, getSubjectR2CdnUrl, getUoiAttributeLabel, isGamePID, isLeaderboardPID, isTeamPID, isUoiPID };
|
package/dist/index.d.ts
CHANGED
|
@@ -68,15 +68,16 @@ declare const ZeroGameMeta: GameMetaProps;
|
|
|
68
68
|
|
|
69
69
|
type LeaderboardType = "score" | "duel" | "time" | "distance" | "weight";
|
|
70
70
|
|
|
71
|
-
type AddingEntityType = "gameToLeaderboard" | "playerToDuelGame" | "playerToNonDuelGame" | "memberToCircle";
|
|
72
|
-
type EntityType = "leaderboard" | "team" | "collection" | "uoi";
|
|
73
|
-
|
|
74
71
|
type PlayerType = 'uoi' | 'team' | 'collection';
|
|
75
72
|
|
|
76
73
|
type PostPrivacy = "public" | "private" | "parent" | "internal";
|
|
77
74
|
|
|
78
75
|
type LocationType = "none" | "point" | "street" | "city";
|
|
79
76
|
|
|
77
|
+
type AddingEntityType = "gameToLeaderboard" | "playerToDuelGame" | "playerToNonDuelGame" | "memberToCircle";
|
|
78
|
+
type EntityType = ProfileType | "collection";
|
|
79
|
+
declare function getPIDPrefixByEntityType(entityType: EntityType): string;
|
|
80
|
+
|
|
80
81
|
type PIDPrefixType = 'usr' | 'uoi' | 'tms' | 'arn' | 'evt' | 'col' | 'lbd' | 'gme' | 'mkt' | 'org' | 'lcp' | 'lcs' | 'lcc' | 'lip' | 'lis' | 'lic' | 'txt' | 'img' | 'pol' | 'vid' | '';
|
|
81
82
|
declare const PID_LENGTH = 9;
|
|
82
83
|
declare const PID_PREFIX_LENGTH = 3;
|
|
@@ -269,7 +270,7 @@ type PageR2Folder = 'collection' | 'game' | 'uoi' | 'user' | 'team' | 'leaderboa
|
|
|
269
270
|
declare function getPageR2CdnUrl(folder: PageR2Folder, pageID: string, imageID: string, size: ImageSize): string;
|
|
270
271
|
|
|
271
272
|
type AvatarR2Folder = 'collection' | 'game' | 'user' | 'team' | 'leaderboard' | 'arena' | 'event' | 'market' | '';
|
|
272
|
-
declare function
|
|
273
|
+
declare function getAvatarR2FolderByEntityType(entityType: EntityType): AvatarR2Folder;
|
|
273
274
|
declare function getAvatarR2CdnUrl(folder: AvatarR2Folder, pageID: string, imageID: string, size: ImageSize): string;
|
|
274
275
|
|
|
275
|
-
export { ALL_CARDGAMES_INTERESTS, ALL_INTEREST_CATEGORIES, ALL_LEISURE_INTERESTS, ALL_MUSIC_INTERESTS, ALL_PETS_INTERESTS, ALL_SPORTS_INTERESTS, ALL_TRAVEL_INTERESTS, type AccountStatus, type AddingEntityType, AdminAccountStatus, AttachmentType, AttendanceStatus, type AvatarR2Folder, BasketballPosition, type BroadcastType, type BuddyingStatus, COLLECTION_ATTRIBUTE_LABEL, COLLECTION_PETS_ATTRIBUTE_LABEL, COMMON_ATTRIBUTE_LABEL, type CardGamesInterestType, type CategoryType, ChallengeStatus, type CollectionAttributeType, type CollectionMetaProps, type CollectionMetaStatus, type CollectionOwnerStatus, type CollectionPetsAttributeType, type CollectionPrivacy, type CollectionStatus, type CollectionType, type CommonAttributeType, type CommonMarketType, type DuelGameResultType, type EntityType, type EventsNearbyProps, FollowingStatus, type GameMetaProps, type GameType, type GamesByTypeNearbyProps, type GamesNearbyProps, type Gender, type Handedness, INTERESTS_BY_CATEGORY, type ImageSize, type InterestNearbyProps, type InterestType, type LeaderboardType, type LeaderboardsByGameTypeNearbyProps, type LeisureInterestType, type LengthUnit, type LocationType, type MarketMetaProps, type MarketMetaStatus, type MarketType, type MarketsByTypeNearbyProps, type MemberingStatus, type MusicInterestType, type NearbyProps, type NotificationType, type PIDPrefixType, PID_LENGTH, PID_PREFIX_LENGTH, type PageR2Folder, type PageType, type PetsInterestType, type PlayerType, type PostPrivacy, type ProfilePermission, type ProfilePrivacy, type ProfileStatus, type ProfileType, ReactionType, type SocialMediaType, type SportsInterestType, type SubjectR2Folder, type SubjectType, type TennisBackhand, type TennisLevel, type TravelInterestType, UOI_ATTRIBUTE_LABEL, UOI_SPORTS_ATTRIBUTE_LABEL, UOI_SPORTS_BASKETBALL_ATTRIBUTE_LABEL, UOI_SPORTS_TENNIS_ATTRIBUTE_LABEL, type UoiAttributeType, type UoiSportsAttributeType, type UoiSportsBasketballAttributeType, type UoiSportsTennisAttributeType, type UserPronoun, type WeightUnit, ZeroCollectionMeta, ZeroGameMeta, ZeroMarketOption, getAvatarR2CdnUrl,
|
|
276
|
+
export { ALL_CARDGAMES_INTERESTS, ALL_INTEREST_CATEGORIES, ALL_LEISURE_INTERESTS, ALL_MUSIC_INTERESTS, ALL_PETS_INTERESTS, ALL_SPORTS_INTERESTS, ALL_TRAVEL_INTERESTS, type AccountStatus, type AddingEntityType, AdminAccountStatus, AttachmentType, AttendanceStatus, type AvatarR2Folder, BasketballPosition, type BroadcastType, type BuddyingStatus, COLLECTION_ATTRIBUTE_LABEL, COLLECTION_PETS_ATTRIBUTE_LABEL, COMMON_ATTRIBUTE_LABEL, type CardGamesInterestType, type CategoryType, ChallengeStatus, type CollectionAttributeType, type CollectionMetaProps, type CollectionMetaStatus, type CollectionOwnerStatus, type CollectionPetsAttributeType, type CollectionPrivacy, type CollectionStatus, type CollectionType, type CommonAttributeType, type CommonMarketType, type DuelGameResultType, type EntityType, type EventsNearbyProps, FollowingStatus, type GameMetaProps, type GameType, type GamesByTypeNearbyProps, type GamesNearbyProps, type Gender, type Handedness, INTERESTS_BY_CATEGORY, type ImageSize, type InterestNearbyProps, type InterestType, type LeaderboardType, type LeaderboardsByGameTypeNearbyProps, type LeisureInterestType, type LengthUnit, type LocationType, type MarketMetaProps, type MarketMetaStatus, type MarketType, type MarketsByTypeNearbyProps, type MemberingStatus, type MusicInterestType, type NearbyProps, type NotificationType, type PIDPrefixType, PID_LENGTH, PID_PREFIX_LENGTH, type PageR2Folder, type PageType, type PetsInterestType, type PlayerType, type PostPrivacy, type ProfilePermission, type ProfilePrivacy, type ProfileStatus, type ProfileType, ReactionType, type SocialMediaType, type SportsInterestType, type SubjectR2Folder, type SubjectType, type TennisBackhand, type TennisLevel, type TravelInterestType, UOI_ATTRIBUTE_LABEL, UOI_SPORTS_ATTRIBUTE_LABEL, UOI_SPORTS_BASKETBALL_ATTRIBUTE_LABEL, UOI_SPORTS_TENNIS_ATTRIBUTE_LABEL, type UoiAttributeType, type UoiSportsAttributeType, type UoiSportsBasketballAttributeType, type UoiSportsTennisAttributeType, type UserPronoun, type WeightUnit, ZeroCollectionMeta, ZeroGameMeta, ZeroMarketOption, getAvatarR2CdnUrl, getAvatarR2FolderByEntityType, getCollectionAttributeLabel, getCommonAttributeLabel, getEntityTypeByPID, getNearbyIndex, getPIDPrefixByEntityType, getPIDPrefixByProfileType, getPageR2CdnUrl, getProfileTypeByPID, getSubjectR2CdnUrl, getUoiAttributeLabel, isGamePID, isLeaderboardPID, isTeamPID, isUoiPID };
|
package/dist/index.js
CHANGED
|
@@ -48,11 +48,12 @@ __export(index_exports, {
|
|
|
48
48
|
ZeroGameMeta: () => ZeroGameMeta,
|
|
49
49
|
ZeroMarketOption: () => ZeroMarketOption,
|
|
50
50
|
getAvatarR2CdnUrl: () => getAvatarR2CdnUrl,
|
|
51
|
-
|
|
51
|
+
getAvatarR2FolderByEntityType: () => getAvatarR2FolderByEntityType,
|
|
52
52
|
getCollectionAttributeLabel: () => getCollectionAttributeLabel,
|
|
53
53
|
getCommonAttributeLabel: () => getCommonAttributeLabel,
|
|
54
54
|
getEntityTypeByPID: () => getEntityTypeByPID,
|
|
55
55
|
getNearbyIndex: () => getNearbyIndex,
|
|
56
|
+
getPIDPrefixByEntityType: () => getPIDPrefixByEntityType,
|
|
56
57
|
getPIDPrefixByProfileType: () => getPIDPrefixByProfileType,
|
|
57
58
|
getPageR2CdnUrl: () => getPageR2CdnUrl,
|
|
58
59
|
getProfileTypeByPID: () => getProfileTypeByPID,
|
|
@@ -205,6 +206,22 @@ var AttachmentType = /* @__PURE__ */ ((AttachmentType2) => {
|
|
|
205
206
|
return AttachmentType2;
|
|
206
207
|
})(AttachmentType || {});
|
|
207
208
|
|
|
209
|
+
// src/page/entity.ts
|
|
210
|
+
function getPIDPrefixByEntityType(entityType) {
|
|
211
|
+
switch (entityType) {
|
|
212
|
+
case "uoi":
|
|
213
|
+
return "uoi";
|
|
214
|
+
case "team":
|
|
215
|
+
return "tms";
|
|
216
|
+
case "leaderboard":
|
|
217
|
+
return "lbd";
|
|
218
|
+
case "collection":
|
|
219
|
+
return "col";
|
|
220
|
+
default:
|
|
221
|
+
return "";
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
208
225
|
// src/auth.ts
|
|
209
226
|
var AdminAccountStatus = /* @__PURE__ */ ((AdminAccountStatus2) => {
|
|
210
227
|
AdminAccountStatus2[AdminAccountStatus2["None"] = 0] = "None";
|
|
@@ -453,7 +470,7 @@ function getPageR2CdnUrl(folder, pageID, imageID, size) {
|
|
|
453
470
|
}
|
|
454
471
|
|
|
455
472
|
// src/r2/avatarR2Folder.ts
|
|
456
|
-
var
|
|
473
|
+
var entityTypeToAvatarR2Folder = {
|
|
457
474
|
user: "user",
|
|
458
475
|
uoi: "user",
|
|
459
476
|
team: "team",
|
|
@@ -461,11 +478,12 @@ var profileTypeToAvatarR2Folder = {
|
|
|
461
478
|
event: "event",
|
|
462
479
|
market: "market",
|
|
463
480
|
leaderboard: "leaderboard",
|
|
464
|
-
game: "game"
|
|
481
|
+
game: "game",
|
|
482
|
+
collection: "collection"
|
|
465
483
|
};
|
|
466
|
-
function
|
|
484
|
+
function getAvatarR2FolderByEntityType(entityType) {
|
|
467
485
|
var _a;
|
|
468
|
-
return (_a =
|
|
486
|
+
return (_a = entityTypeToAvatarR2Folder[entityType]) != null ? _a : "";
|
|
469
487
|
}
|
|
470
488
|
function getAvatarR2CdnUrl(folder, pageID, imageID, size) {
|
|
471
489
|
if (!imageID) return "";
|
|
@@ -501,11 +519,12 @@ function getAvatarR2CdnUrl(folder, pageID, imageID, size) {
|
|
|
501
519
|
ZeroGameMeta,
|
|
502
520
|
ZeroMarketOption,
|
|
503
521
|
getAvatarR2CdnUrl,
|
|
504
|
-
|
|
522
|
+
getAvatarR2FolderByEntityType,
|
|
505
523
|
getCollectionAttributeLabel,
|
|
506
524
|
getCommonAttributeLabel,
|
|
507
525
|
getEntityTypeByPID,
|
|
508
526
|
getNearbyIndex,
|
|
527
|
+
getPIDPrefixByEntityType,
|
|
509
528
|
getPIDPrefixByProfileType,
|
|
510
529
|
getPageR2CdnUrl,
|
|
511
530
|
getProfileTypeByPID,
|
package/dist/index.mjs
CHANGED
|
@@ -138,6 +138,22 @@ var AttachmentType = /* @__PURE__ */ ((AttachmentType2) => {
|
|
|
138
138
|
return AttachmentType2;
|
|
139
139
|
})(AttachmentType || {});
|
|
140
140
|
|
|
141
|
+
// src/page/entity.ts
|
|
142
|
+
function getPIDPrefixByEntityType(entityType) {
|
|
143
|
+
switch (entityType) {
|
|
144
|
+
case "uoi":
|
|
145
|
+
return "uoi";
|
|
146
|
+
case "team":
|
|
147
|
+
return "tms";
|
|
148
|
+
case "leaderboard":
|
|
149
|
+
return "lbd";
|
|
150
|
+
case "collection":
|
|
151
|
+
return "col";
|
|
152
|
+
default:
|
|
153
|
+
return "";
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
141
157
|
// src/auth.ts
|
|
142
158
|
var AdminAccountStatus = /* @__PURE__ */ ((AdminAccountStatus2) => {
|
|
143
159
|
AdminAccountStatus2[AdminAccountStatus2["None"] = 0] = "None";
|
|
@@ -386,7 +402,7 @@ function getPageR2CdnUrl(folder, pageID, imageID, size) {
|
|
|
386
402
|
}
|
|
387
403
|
|
|
388
404
|
// src/r2/avatarR2Folder.ts
|
|
389
|
-
var
|
|
405
|
+
var entityTypeToAvatarR2Folder = {
|
|
390
406
|
user: "user",
|
|
391
407
|
uoi: "user",
|
|
392
408
|
team: "team",
|
|
@@ -394,11 +410,12 @@ var profileTypeToAvatarR2Folder = {
|
|
|
394
410
|
event: "event",
|
|
395
411
|
market: "market",
|
|
396
412
|
leaderboard: "leaderboard",
|
|
397
|
-
game: "game"
|
|
413
|
+
game: "game",
|
|
414
|
+
collection: "collection"
|
|
398
415
|
};
|
|
399
|
-
function
|
|
416
|
+
function getAvatarR2FolderByEntityType(entityType) {
|
|
400
417
|
var _a;
|
|
401
|
-
return (_a =
|
|
418
|
+
return (_a = entityTypeToAvatarR2Folder[entityType]) != null ? _a : "";
|
|
402
419
|
}
|
|
403
420
|
function getAvatarR2CdnUrl(folder, pageID, imageID, size) {
|
|
404
421
|
if (!imageID) return "";
|
|
@@ -433,11 +450,12 @@ export {
|
|
|
433
450
|
ZeroGameMeta,
|
|
434
451
|
ZeroMarketOption,
|
|
435
452
|
getAvatarR2CdnUrl,
|
|
436
|
-
|
|
453
|
+
getAvatarR2FolderByEntityType,
|
|
437
454
|
getCollectionAttributeLabel,
|
|
438
455
|
getCommonAttributeLabel,
|
|
439
456
|
getEntityTypeByPID,
|
|
440
457
|
getNearbyIndex,
|
|
458
|
+
getPIDPrefixByEntityType,
|
|
441
459
|
getPIDPrefixByProfileType,
|
|
442
460
|
getPageR2CdnUrl,
|
|
443
461
|
getProfileTypeByPID,
|
package/package.json
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ProfileType } from './profile';
|
|
2
|
+
|
|
3
|
+
export type AddingEntityType =
|
|
4
|
+
"gameToLeaderboard" |
|
|
5
|
+
"playerToDuelGame" |
|
|
6
|
+
"playerToNonDuelGame" |
|
|
7
|
+
"memberToCircle";
|
|
8
|
+
|
|
9
|
+
export type EntityType = ProfileType | "collection";
|
|
10
|
+
|
|
11
|
+
export function getPIDPrefixByEntityType(entityType: EntityType): string {
|
|
12
|
+
switch (entityType) {
|
|
13
|
+
case 'uoi':
|
|
14
|
+
return 'uoi';
|
|
15
|
+
case 'team':
|
|
16
|
+
return 'tms';
|
|
17
|
+
case 'leaderboard':
|
|
18
|
+
return 'lbd';
|
|
19
|
+
case 'collection':
|
|
20
|
+
return 'col';
|
|
21
|
+
default:
|
|
22
|
+
return '';
|
|
23
|
+
}
|
|
24
|
+
}
|
package/src/page/index.ts
CHANGED
package/src/page/pid.ts
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
export type ProfileType =
|
|
2
2
|
"none" |
|
|
3
3
|
"user" |
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
"uoi" |
|
|
5
|
+
"market"|
|
|
6
|
+
"arena"|
|
|
7
|
+
"organization"|
|
|
8
8
|
"event"|
|
|
9
9
|
"team"|
|
|
10
10
|
"leaderboard" |
|
|
11
11
|
"game"
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
14
|
export type ProfilePrivacy =
|
|
17
15
|
"public" |
|
|
18
16
|
"private" |
|
package/src/r2/avatarR2Folder.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ImageSize } from './imageSize';
|
|
2
|
-
import
|
|
2
|
+
import { EntityType } from 'src';
|
|
3
3
|
|
|
4
4
|
export type AvatarR2Folder = 'collection' | 'game' | 'user' | 'team' | 'leaderboard' | 'arena' | 'event' | 'market' | '';
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const entityTypeToAvatarR2Folder: Partial<Record<EntityType, AvatarR2Folder>> = {
|
|
7
7
|
user: 'user',
|
|
8
8
|
uoi: 'user',
|
|
9
9
|
team: 'team',
|
|
@@ -12,10 +12,11 @@ const profileTypeToAvatarR2Folder: Partial<Record<ProfileType, AvatarR2Folder>>
|
|
|
12
12
|
market: 'market',
|
|
13
13
|
leaderboard: 'leaderboard',
|
|
14
14
|
game: 'game',
|
|
15
|
+
collection: 'collection',
|
|
15
16
|
};
|
|
16
17
|
|
|
17
|
-
export function
|
|
18
|
-
return
|
|
18
|
+
export function getAvatarR2FolderByEntityType(entityType: EntityType): AvatarR2Folder {
|
|
19
|
+
return entityTypeToAvatarR2Folder[entityType] ?? '';
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
export function getAvatarR2CdnUrl(folder: AvatarR2Folder, pageID: string, imageID: string, size: ImageSize): string {
|