@sudobility/types 1.9.54 → 1.9.56
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/README.md +44 -280
- package/dist/index.js +28 -201
- package/dist/index.js.map +1 -1
- package/dist/types/blockchain/common.js +9 -16
- package/dist/types/blockchain/common.js.map +1 -1
- package/dist/types/blockchain/index.js +3 -17
- package/dist/types/blockchain/index.js.map +1 -1
- package/dist/types/blockchain/validation.js +6 -12
- package/dist/types/blockchain/validation.js.map +1 -1
- package/dist/types/business/enums.js +46 -49
- package/dist/types/business/enums.js.map +1 -1
- package/dist/types/business/wallet-status.js +10 -16
- package/dist/types/business/wallet-status.js.map +1 -1
- package/dist/types/common.js +1 -2
- package/dist/types/common.js.map +1 -1
- package/dist/types/config/app-config.js +1 -2
- package/dist/types/config/app-config.js.map +1 -1
- package/dist/types/config/environment.js +2 -5
- package/dist/types/config/environment.js.map +1 -1
- package/dist/types/consumables/index.js +1 -2
- package/dist/types/consumables/index.js.map +1 -1
- package/dist/types/entity/entity.js +6 -9
- package/dist/types/entity/entity.js.map +1 -1
- package/dist/types/entity/permissions.js +12 -17
- package/dist/types/entity/permissions.js.map +1 -1
- package/dist/types/entity/requests.js +1 -2
- package/dist/types/entity/requests.js.map +1 -1
- package/dist/types/entity/responses.js +1 -2
- package/dist/types/entity/responses.js.map +1 -1
- package/dist/types/infrastructure/analytics.js +3 -7
- package/dist/types/infrastructure/analytics.js.map +1 -1
- package/dist/types/infrastructure/api.js +5 -9
- package/dist/types/infrastructure/api.js.map +1 -1
- package/dist/types/infrastructure/firebase-user.js +1 -2
- package/dist/types/infrastructure/firebase-user.js.map +1 -1
- package/dist/types/infrastructure/navigation.js +1 -2
- package/dist/types/infrastructure/network.js +1 -4
- package/dist/types/infrastructure/network.js.map +1 -1
- package/dist/types/infrastructure/wallet.js +2 -5
- package/dist/types/infrastructure/wallet.js.map +1 -1
- package/dist/types/subscription/entitlements.js +1 -4
- package/dist/types/subscription/entitlements.js.map +1 -1
- package/dist/types/subscription/period.js +2 -5
- package/dist/types/subscription/period.js.map +1 -1
- package/dist/types/subscription/rate-limits.js +2 -5
- package/dist/types/subscription/rate-limits.js.map +1 -1
- package/dist/utils/async-helpers.js +7 -16
- package/dist/utils/async-helpers.js.map +1 -1
- package/dist/utils/auth/admin-emails.js +3 -8
- package/dist/utils/auth/admin-emails.js.map +1 -1
- package/dist/utils/auth/auth.js +14 -24
- package/dist/utils/auth/auth.js.map +1 -1
- package/dist/utils/blockchain/address.js +20 -31
- package/dist/utils/blockchain/address.js.map +1 -1
- package/dist/utils/blockchain/event-helpers.js +9 -20
- package/dist/utils/blockchain/event-helpers.js.map +1 -1
- package/dist/utils/constants/application.js +2 -20
- package/dist/utils/constants/application.js.map +1 -1
- package/dist/utils/constants/status-values.js +1 -4
- package/dist/utils/constants/status-values.js.map +1 -1
- package/dist/utils/formatting/currency.js +6 -11
- package/dist/utils/formatting/currency.js.map +1 -1
- package/dist/utils/formatting/date.js +7 -16
- package/dist/utils/formatting/date.js.map +1 -1
- package/dist/utils/formatting/string.js +16 -34
- package/dist/utils/formatting/string.js.map +1 -1
- package/dist/utils/logging/logger.js +2 -10
- package/dist/utils/logging/logger.js.map +1 -1
- package/dist/utils/url/url-params.js +1 -6
- package/dist/utils/url/url-params.js.map +1 -1
- package/dist/utils/validation/type-validation.js +27 -48
- package/dist/utils/validation/type-validation.js.map +1 -1
- package/dist/utils/validation/web3-username-validator.js +6 -10
- package/dist/utils/validation/web3-username-validator.js.map +1 -1
- package/package.json +3 -11
- package/dist/index.cjs +0 -243
- package/dist/types/blockchain/common.cjs +0 -127
- package/dist/types/blockchain/index.cjs +0 -30
- package/dist/types/blockchain/validation.cjs +0 -144
- package/dist/types/business/enums.cjs +0 -367
- package/dist/types/business/wallet-status.cjs +0 -38
- package/dist/types/common.cjs +0 -12
- package/dist/types/config/app-config.cjs +0 -6
- package/dist/types/config/environment.cjs +0 -24
- package/dist/types/consumables/index.cjs +0 -8
- package/dist/types/entity/entity.cjs +0 -51
- package/dist/types/entity/permissions.cjs +0 -93
- package/dist/types/entity/requests.cjs +0 -7
- package/dist/types/entity/responses.cjs +0 -7
- package/dist/types/infrastructure/analytics.cjs +0 -212
- package/dist/types/infrastructure/api.cjs +0 -43
- package/dist/types/infrastructure/firebase-user.cjs +0 -10
- package/dist/types/infrastructure/navigation.cjs +0 -3
- package/dist/types/infrastructure/network.cjs +0 -18
- package/dist/types/infrastructure/wallet.cjs +0 -37
- package/dist/types/subscription/entitlements.cjs +0 -14
- package/dist/types/subscription/period.cjs +0 -29
- package/dist/types/subscription/rate-limits.cjs +0 -20
- package/dist/utils/async-helpers.cjs +0 -244
- package/dist/utils/auth/admin-emails.cjs +0 -79
- package/dist/utils/auth/auth.cjs +0 -99
- package/dist/utils/blockchain/address.cjs +0 -225
- package/dist/utils/blockchain/event-helpers.cjs +0 -143
- package/dist/utils/constants/application.cjs +0 -152
- package/dist/utils/constants/status-values.cjs +0 -14
- package/dist/utils/formatting/currency.cjs +0 -39
- package/dist/utils/formatting/date.cjs +0 -197
- package/dist/utils/formatting/string.cjs +0 -326
- package/dist/utils/logging/logger.cjs +0 -92
- package/dist/utils/url/url-params.cjs +0 -128
- package/dist/utils/validation/type-validation.cjs +0 -250
- package/dist/utils/validation/web3-username-validator.cjs +0 -132
|
@@ -1,367 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Platform-agnostic enums for discrete states.
|
|
4
|
-
* These replace string literals throughout the application.
|
|
5
|
-
*
|
|
6
|
-
* @since 1.0.0
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.Currency = exports.ErrorType = exports.FeatureFlag = exports.EmailValidationState = exports.PlatformType = exports.ConnectionState = exports.ConnectionType = exports.EmailSortCriteria = exports.SortOrder = exports.EmailAddressType = exports.InfoType = exports.NotificationType = exports.RequestStatus = exports.SubscriptionAction = exports.EmailAction = exports.MediumView = exports.MobileView = exports.EmailComposeType = exports.FontSize = exports.Theme = exports.Chain = exports.ChainType = exports.AuthStatus = void 0;
|
|
10
|
-
/**
|
|
11
|
-
* Authentication status of a wallet connection.
|
|
12
|
-
* @since 1.0.0
|
|
13
|
-
*/
|
|
14
|
-
var AuthStatus;
|
|
15
|
-
(function (AuthStatus) {
|
|
16
|
-
/** Wallet is connected but not yet verified via signature */
|
|
17
|
-
AuthStatus["CONNECTED"] = "connected";
|
|
18
|
-
/** Wallet is not connected */
|
|
19
|
-
AuthStatus["DISCONNECTED"] = "disconnected";
|
|
20
|
-
/** Wallet is connected and ownership is verified via signature */
|
|
21
|
-
AuthStatus["VERIFIED"] = "verified";
|
|
22
|
-
})(AuthStatus || (exports.AuthStatus = AuthStatus = {}));
|
|
23
|
-
/**
|
|
24
|
-
* Blockchain family classification.
|
|
25
|
-
* @since 1.0.0
|
|
26
|
-
*/
|
|
27
|
-
var ChainType;
|
|
28
|
-
(function (ChainType) {
|
|
29
|
-
/** Ethereum Virtual Machine compatible chains */
|
|
30
|
-
ChainType["EVM"] = "evm";
|
|
31
|
-
/** Solana blockchain */
|
|
32
|
-
ChainType["SOLANA"] = "solana";
|
|
33
|
-
})(ChainType || (exports.ChainType = ChainType = {}));
|
|
34
|
-
/**
|
|
35
|
-
* Supported blockchain networks across EVM and Solana ecosystems.
|
|
36
|
-
* Includes mainnets, testnets, and local development chains.
|
|
37
|
-
* @since 1.0.0
|
|
38
|
-
*/
|
|
39
|
-
var Chain;
|
|
40
|
-
(function (Chain) {
|
|
41
|
-
// Ethereum
|
|
42
|
-
Chain["ETH_MAINNET"] = "eth-mainnet";
|
|
43
|
-
Chain["ETH_SEPOLIA"] = "eth-sepolia";
|
|
44
|
-
Chain["ETH_GOERLI"] = "eth-goerli";
|
|
45
|
-
// Polygon
|
|
46
|
-
Chain["POLYGON_MAINNET"] = "polygon-mainnet";
|
|
47
|
-
Chain["POLYGON_MUMBAI"] = "polygon-mumbai";
|
|
48
|
-
Chain["POLYGON_AMOY"] = "polygon-amoy";
|
|
49
|
-
// Optimism
|
|
50
|
-
Chain["OPTIMISM_MAINNET"] = "optimism-mainnet";
|
|
51
|
-
Chain["OPTIMISM_SEPOLIA"] = "optimism-sepolia";
|
|
52
|
-
Chain["OPTIMISM_GOERLI"] = "optimism-goerli";
|
|
53
|
-
// Arbitrum
|
|
54
|
-
Chain["ARBITRUM_MAINNET"] = "arbitrum-mainnet";
|
|
55
|
-
Chain["ARBITRUM_SEPOLIA"] = "arbitrum-sepolia";
|
|
56
|
-
Chain["ARBITRUM_GOERLI"] = "arbitrum-goerli";
|
|
57
|
-
// Base
|
|
58
|
-
Chain["BASE_MAINNET"] = "base-mainnet";
|
|
59
|
-
Chain["BASE_SEPOLIA"] = "base-sepolia";
|
|
60
|
-
Chain["BASE_GOERLI"] = "base-goerli";
|
|
61
|
-
// Avalanche
|
|
62
|
-
Chain["AVALANCHE_MAINNET"] = "avalanche-mainnet";
|
|
63
|
-
Chain["AVALANCHE_FUJI"] = "avalanche-fuji";
|
|
64
|
-
// BNB Chain (formerly Binance Smart Chain)
|
|
65
|
-
Chain["BNB_MAINNET"] = "bnb-mainnet";
|
|
66
|
-
Chain["BNB_TESTNET"] = "bnb-testnet";
|
|
67
|
-
// Gnosis Chain (formerly xDai)
|
|
68
|
-
Chain["GNOSIS_MAINNET"] = "gnosis-mainnet";
|
|
69
|
-
Chain["GNOSIS_CHIADO"] = "gnosis-chiado";
|
|
70
|
-
// Celo
|
|
71
|
-
Chain["CELO_MAINNET"] = "celo-mainnet";
|
|
72
|
-
Chain["CELO_ALFAJORES"] = "celo-alfajores";
|
|
73
|
-
// zkSync
|
|
74
|
-
Chain["ZKSYNC_MAINNET"] = "zksync-mainnet";
|
|
75
|
-
Chain["ZKSYNC_SEPOLIA"] = "zksync-sepolia";
|
|
76
|
-
// Linea
|
|
77
|
-
Chain["LINEA_MAINNET"] = "linea-mainnet";
|
|
78
|
-
Chain["LINEA_SEPOLIA"] = "linea-sepolia";
|
|
79
|
-
// Scroll
|
|
80
|
-
Chain["SCROLL_MAINNET"] = "scroll-mainnet";
|
|
81
|
-
Chain["SCROLL_SEPOLIA"] = "scroll-sepolia";
|
|
82
|
-
// Monad
|
|
83
|
-
Chain["MONAD_MAINNET"] = "monad-mainnet";
|
|
84
|
-
Chain["MONAD_TESTNET"] = "monad-testnet";
|
|
85
|
-
// Story Protocol
|
|
86
|
-
Chain["STORY_MAINNET"] = "story-mainnet";
|
|
87
|
-
Chain["STORY_TESTNET"] = "story-testnet";
|
|
88
|
-
// Plume Network
|
|
89
|
-
Chain["PLUME_MAINNET"] = "plume-mainnet";
|
|
90
|
-
Chain["PLUME_TESTNET"] = "plume-testnet";
|
|
91
|
-
// Nexus
|
|
92
|
-
Chain["NEXUS_MAINNET"] = "nexus-mainnet";
|
|
93
|
-
Chain["NEXUS_TESTNET"] = "nexus-testnet";
|
|
94
|
-
// HyperEVM
|
|
95
|
-
Chain["HYPEREVM_MAINNET"] = "hyperevm-mainnet";
|
|
96
|
-
Chain["HYPEREVM_TESTNET"] = "hyperevm-testnet";
|
|
97
|
-
// Sonic (gaming-focused chain)
|
|
98
|
-
Chain["SONIC_MAINNET"] = "sonic-mainnet";
|
|
99
|
-
Chain["SONIC_TESTNET"] = "sonic-testnet";
|
|
100
|
-
Chain["SONIC_BLAZE"] = "sonic-blaze";
|
|
101
|
-
// Unichain (Uniswap L2)
|
|
102
|
-
Chain["UNICHAIN_MAINNET"] = "unichain-mainnet";
|
|
103
|
-
Chain["UNICHAIN_SEPOLIA"] = "unichain-sepolia";
|
|
104
|
-
// World Chain (Worldcoin L2)
|
|
105
|
-
Chain["WORLD_MAINNET"] = "world-mainnet";
|
|
106
|
-
// XDC Network
|
|
107
|
-
Chain["XDC_MAINNET"] = "xdc-mainnet";
|
|
108
|
-
// Ink
|
|
109
|
-
Chain["INK_TESTNET"] = "ink-testnet";
|
|
110
|
-
// AI-focused chains
|
|
111
|
-
// Bittensor (TAO) - Substrate-based, not EVM
|
|
112
|
-
// Fetch.ai
|
|
113
|
-
Chain["FETCH_MAINNET"] = "fetch-mainnet";
|
|
114
|
-
Chain["FETCH_TESTNET"] = "fetch-testnet";
|
|
115
|
-
// Akash Network - Cosmos-based, not EVM
|
|
116
|
-
// Gensyn - AI compute chain
|
|
117
|
-
Chain["GENSYN_MAINNET"] = "gensyn-mainnet";
|
|
118
|
-
Chain["GENSYN_TESTNET"] = "gensyn-testnet";
|
|
119
|
-
// Ritual - AI inference chain
|
|
120
|
-
Chain["RITUAL_MAINNET"] = "ritual-mainnet";
|
|
121
|
-
Chain["RITUAL_TESTNET"] = "ritual-testnet";
|
|
122
|
-
// Solana
|
|
123
|
-
Chain["SOLANA_MAINNET"] = "solana-mainnet";
|
|
124
|
-
Chain["SOLANA_DEVNET"] = "solana-devnet";
|
|
125
|
-
Chain["SOLANA_TESTNET"] = "solana-testnet";
|
|
126
|
-
// Local development
|
|
127
|
-
Chain["EVM_LOCAL"] = "evm-local";
|
|
128
|
-
Chain["SOLANA_LOCAL"] = "solana-local";
|
|
129
|
-
})(Chain || (exports.Chain = Chain = {}));
|
|
130
|
-
/**
|
|
131
|
-
* UI theme preference.
|
|
132
|
-
* @since 1.0.0
|
|
133
|
-
*/
|
|
134
|
-
var Theme;
|
|
135
|
-
(function (Theme) {
|
|
136
|
-
/** Light color scheme */
|
|
137
|
-
Theme["LIGHT"] = "light";
|
|
138
|
-
/** Dark color scheme */
|
|
139
|
-
Theme["DARK"] = "dark";
|
|
140
|
-
/** Follow OS/system preference */
|
|
141
|
-
Theme["SYSTEM"] = "system";
|
|
142
|
-
})(Theme || (exports.Theme = Theme = {}));
|
|
143
|
-
/**
|
|
144
|
-
* UI font size preference.
|
|
145
|
-
* @since 1.2.0
|
|
146
|
-
*/
|
|
147
|
-
var FontSize;
|
|
148
|
-
(function (FontSize) {
|
|
149
|
-
FontSize["SMALL"] = "small";
|
|
150
|
-
FontSize["MEDIUM"] = "medium";
|
|
151
|
-
FontSize["LARGE"] = "large";
|
|
152
|
-
})(FontSize || (exports.FontSize = FontSize = {}));
|
|
153
|
-
/**
|
|
154
|
-
* Email composition mode.
|
|
155
|
-
* @since 1.0.0
|
|
156
|
-
*/
|
|
157
|
-
var EmailComposeType;
|
|
158
|
-
(function (EmailComposeType) {
|
|
159
|
-
EmailComposeType["NEW"] = "new";
|
|
160
|
-
EmailComposeType["REPLY"] = "reply";
|
|
161
|
-
EmailComposeType["REPLY_ALL"] = "replyAll";
|
|
162
|
-
EmailComposeType["FORWARD"] = "forward";
|
|
163
|
-
})(EmailComposeType || (exports.EmailComposeType = EmailComposeType = {}));
|
|
164
|
-
/**
|
|
165
|
-
* Mobile navigation view states.
|
|
166
|
-
* @since 1.0.0
|
|
167
|
-
*/
|
|
168
|
-
var MobileView;
|
|
169
|
-
(function (MobileView) {
|
|
170
|
-
MobileView["EMAIL_ADDRESSES"] = "emailAddresses";
|
|
171
|
-
MobileView["FOLDERS"] = "folders";
|
|
172
|
-
MobileView["EMAILS"] = "emails";
|
|
173
|
-
MobileView["EMAIL_BODY"] = "emailBody";
|
|
174
|
-
})(MobileView || (exports.MobileView = MobileView = {}));
|
|
175
|
-
/**
|
|
176
|
-
* Medium-screen (tablet) navigation pane selection.
|
|
177
|
-
* @since 1.0.0
|
|
178
|
-
*/
|
|
179
|
-
var MediumView;
|
|
180
|
-
(function (MediumView) {
|
|
181
|
-
MediumView["LEFT"] = "left";
|
|
182
|
-
MediumView["RIGHT"] = "right";
|
|
183
|
-
})(MediumView || (exports.MediumView = MediumView = {}));
|
|
184
|
-
/**
|
|
185
|
-
* Actions that can be performed on an email message.
|
|
186
|
-
* @since 1.0.0
|
|
187
|
-
*/
|
|
188
|
-
var EmailAction;
|
|
189
|
-
(function (EmailAction) {
|
|
190
|
-
EmailAction["OPEN"] = "open";
|
|
191
|
-
EmailAction["REPLY"] = "reply";
|
|
192
|
-
EmailAction["FORWARD"] = "forward";
|
|
193
|
-
EmailAction["DELETE"] = "delete";
|
|
194
|
-
EmailAction["STAR"] = "star";
|
|
195
|
-
EmailAction["UNSTAR"] = "unstar";
|
|
196
|
-
EmailAction["MARK_READ"] = "mark_read";
|
|
197
|
-
EmailAction["MARK_UNREAD"] = "mark_unread";
|
|
198
|
-
})(EmailAction || (exports.EmailAction = EmailAction = {}));
|
|
199
|
-
/**
|
|
200
|
-
* Subscription lifecycle actions.
|
|
201
|
-
* @since 1.3.0
|
|
202
|
-
*/
|
|
203
|
-
var SubscriptionAction;
|
|
204
|
-
(function (SubscriptionAction) {
|
|
205
|
-
SubscriptionAction["VIEW"] = "view";
|
|
206
|
-
SubscriptionAction["PURCHASE"] = "purchase";
|
|
207
|
-
SubscriptionAction["CANCEL"] = "cancel";
|
|
208
|
-
SubscriptionAction["RESTORE"] = "restore";
|
|
209
|
-
})(SubscriptionAction || (exports.SubscriptionAction = SubscriptionAction = {}));
|
|
210
|
-
/**
|
|
211
|
-
* Network request lifecycle states.
|
|
212
|
-
* @since 1.0.0
|
|
213
|
-
*/
|
|
214
|
-
var RequestStatus;
|
|
215
|
-
(function (RequestStatus) {
|
|
216
|
-
/** No request in progress */
|
|
217
|
-
RequestStatus["IDLE"] = "idle";
|
|
218
|
-
/** Request is in flight */
|
|
219
|
-
RequestStatus["LOADING"] = "loading";
|
|
220
|
-
/** Request completed successfully */
|
|
221
|
-
RequestStatus["SUCCESS"] = "success";
|
|
222
|
-
/** Request failed */
|
|
223
|
-
RequestStatus["ERROR"] = "error";
|
|
224
|
-
})(RequestStatus || (exports.RequestStatus = RequestStatus = {}));
|
|
225
|
-
/**
|
|
226
|
-
* UI notification severity levels.
|
|
227
|
-
* @since 1.0.0
|
|
228
|
-
*/
|
|
229
|
-
var NotificationType;
|
|
230
|
-
(function (NotificationType) {
|
|
231
|
-
NotificationType["INFO"] = "info";
|
|
232
|
-
NotificationType["SUCCESS"] = "success";
|
|
233
|
-
NotificationType["WARNING"] = "warning";
|
|
234
|
-
NotificationType["ERROR"] = "error";
|
|
235
|
-
})(NotificationType || (exports.NotificationType = NotificationType = {}));
|
|
236
|
-
/**
|
|
237
|
-
* Info-level UI feedback types.
|
|
238
|
-
* @since 1.0.0
|
|
239
|
-
*/
|
|
240
|
-
var InfoType;
|
|
241
|
-
(function (InfoType) {
|
|
242
|
-
InfoType["INFO"] = "info";
|
|
243
|
-
InfoType["SUCCESS"] = "success";
|
|
244
|
-
InfoType["WARNING"] = "warning";
|
|
245
|
-
InfoType["ERROR"] = "error";
|
|
246
|
-
})(InfoType || (exports.InfoType = InfoType = {}));
|
|
247
|
-
/**
|
|
248
|
-
* Email address resolution types.
|
|
249
|
-
* @since 1.0.0
|
|
250
|
-
*/
|
|
251
|
-
var EmailAddressType;
|
|
252
|
-
(function (EmailAddressType) {
|
|
253
|
-
EmailAddressType["DIRECT"] = "direct";
|
|
254
|
-
EmailAddressType["ENS"] = "ens";
|
|
255
|
-
EmailAddressType["SNS"] = "sns";
|
|
256
|
-
EmailAddressType["CUSTOM"] = "custom";
|
|
257
|
-
})(EmailAddressType || (exports.EmailAddressType = EmailAddressType = {}));
|
|
258
|
-
/**
|
|
259
|
-
* Sort order direction.
|
|
260
|
-
* @since 1.0.0
|
|
261
|
-
*/
|
|
262
|
-
var SortOrder;
|
|
263
|
-
(function (SortOrder) {
|
|
264
|
-
SortOrder["ASC"] = "asc";
|
|
265
|
-
SortOrder["DESC"] = "desc";
|
|
266
|
-
})(SortOrder || (exports.SortOrder = SortOrder = {}));
|
|
267
|
-
/**
|
|
268
|
-
* Fields by which emails can be sorted.
|
|
269
|
-
* @since 1.0.0
|
|
270
|
-
*/
|
|
271
|
-
var EmailSortCriteria;
|
|
272
|
-
(function (EmailSortCriteria) {
|
|
273
|
-
EmailSortCriteria["DATE"] = "date";
|
|
274
|
-
EmailSortCriteria["SUBJECT"] = "subject";
|
|
275
|
-
EmailSortCriteria["FROM"] = "from";
|
|
276
|
-
EmailSortCriteria["SIZE"] = "size";
|
|
277
|
-
})(EmailSortCriteria || (exports.EmailSortCriteria = EmailSortCriteria = {}));
|
|
278
|
-
/**
|
|
279
|
-
* Network connection type (WiFi, cellular, etc.).
|
|
280
|
-
* @since 1.1.0
|
|
281
|
-
*/
|
|
282
|
-
var ConnectionType;
|
|
283
|
-
(function (ConnectionType) {
|
|
284
|
-
ConnectionType["UNKNOWN"] = "unknown";
|
|
285
|
-
ConnectionType["NONE"] = "none";
|
|
286
|
-
ConnectionType["WIFI"] = "wifi";
|
|
287
|
-
ConnectionType["CELLULAR_2G"] = "2g";
|
|
288
|
-
ConnectionType["CELLULAR_3G"] = "3g";
|
|
289
|
-
ConnectionType["CELLULAR_4G"] = "4g";
|
|
290
|
-
ConnectionType["CELLULAR_5G"] = "5g";
|
|
291
|
-
ConnectionType["ETHERNET"] = "ethernet";
|
|
292
|
-
})(ConnectionType || (exports.ConnectionType = ConnectionType = {}));
|
|
293
|
-
/**
|
|
294
|
-
* Wallet/network connection lifecycle states.
|
|
295
|
-
* Consolidated from WalletConnectionState, NetworkStatus, and ConnectionState.
|
|
296
|
-
* @since 1.0.0
|
|
297
|
-
*/
|
|
298
|
-
var ConnectionState;
|
|
299
|
-
(function (ConnectionState) {
|
|
300
|
-
ConnectionState["UNKNOWN"] = "unknown";
|
|
301
|
-
ConnectionState["DISCONNECTED"] = "disconnected";
|
|
302
|
-
ConnectionState["CONNECTING"] = "connecting";
|
|
303
|
-
ConnectionState["CONNECTED"] = "connected";
|
|
304
|
-
ConnectionState["RECONNECTING"] = "reconnecting";
|
|
305
|
-
ConnectionState["VERIFIED"] = "verified";
|
|
306
|
-
ConnectionState["LIMITED"] = "limited";
|
|
307
|
-
ConnectionState["ERROR"] = "error";
|
|
308
|
-
})(ConnectionState || (exports.ConnectionState = ConnectionState = {}));
|
|
309
|
-
/**
|
|
310
|
-
* Runtime platform identification.
|
|
311
|
-
* @since 1.0.0
|
|
312
|
-
*/
|
|
313
|
-
var PlatformType;
|
|
314
|
-
(function (PlatformType) {
|
|
315
|
-
PlatformType["WEB"] = "web";
|
|
316
|
-
PlatformType["REACT_NATIVE"] = "react_native";
|
|
317
|
-
PlatformType["DESKTOP"] = "desktop";
|
|
318
|
-
})(PlatformType || (exports.PlatformType = PlatformType = {}));
|
|
319
|
-
/**
|
|
320
|
-
* Email address validation status.
|
|
321
|
-
* @since 1.0.0
|
|
322
|
-
*/
|
|
323
|
-
var EmailValidationState;
|
|
324
|
-
(function (EmailValidationState) {
|
|
325
|
-
EmailValidationState["VALID"] = "valid";
|
|
326
|
-
EmailValidationState["INVALID"] = "invalid";
|
|
327
|
-
EmailValidationState["PENDING"] = "pending";
|
|
328
|
-
EmailValidationState["UNKNOWN"] = "unknown";
|
|
329
|
-
})(EmailValidationState || (exports.EmailValidationState = EmailValidationState = {}));
|
|
330
|
-
/**
|
|
331
|
-
* Feature flags for gating experimental or premium features.
|
|
332
|
-
* @since 1.2.0
|
|
333
|
-
*/
|
|
334
|
-
var FeatureFlag;
|
|
335
|
-
(function (FeatureFlag) {
|
|
336
|
-
FeatureFlag["AI_SEARCH"] = "ai_search";
|
|
337
|
-
FeatureFlag["SMART_COMPOSE"] = "smart_compose";
|
|
338
|
-
FeatureFlag["ADVANCED_FILTERS"] = "advanced_filters";
|
|
339
|
-
FeatureFlag["DARK_MODE"] = "dark_mode";
|
|
340
|
-
FeatureFlag["NOTIFICATIONS"] = "notifications";
|
|
341
|
-
FeatureFlag["ANALYTICS"] = "analytics";
|
|
342
|
-
})(FeatureFlag || (exports.FeatureFlag = FeatureFlag = {}));
|
|
343
|
-
/**
|
|
344
|
-
* High-level error category classification.
|
|
345
|
-
* @since 1.0.0
|
|
346
|
-
*/
|
|
347
|
-
var ErrorType;
|
|
348
|
-
(function (ErrorType) {
|
|
349
|
-
ErrorType["NETWORK"] = "network";
|
|
350
|
-
ErrorType["AUTH"] = "auth";
|
|
351
|
-
ErrorType["VALIDATION"] = "validation";
|
|
352
|
-
ErrorType["PERMISSION"] = "permission";
|
|
353
|
-
ErrorType["UNKNOWN"] = "unknown";
|
|
354
|
-
})(ErrorType || (exports.ErrorType = ErrorType = {}));
|
|
355
|
-
/**
|
|
356
|
-
* Fiat currency codes for subscription pricing.
|
|
357
|
-
* @since 1.3.0
|
|
358
|
-
*/
|
|
359
|
-
var Currency;
|
|
360
|
-
(function (Currency) {
|
|
361
|
-
Currency["USD"] = "USD";
|
|
362
|
-
Currency["EUR"] = "EUR";
|
|
363
|
-
Currency["GBP"] = "GBP";
|
|
364
|
-
Currency["CAD"] = "CAD";
|
|
365
|
-
Currency["AUD"] = "AUD";
|
|
366
|
-
})(Currency || (exports.Currency = Currency = {}));
|
|
367
|
-
//# sourceMappingURL=enums.js.map
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Wallet status management types
|
|
4
|
-
* Defines the structure for tracking wallet connection and verification state
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.getWalletConnectionState = exports.isWalletVerified = exports.isWalletConnected = void 0;
|
|
8
|
-
const enums_1 = require("./enums");
|
|
9
|
-
/**
|
|
10
|
-
* Type guard to check if wallet status is defined
|
|
11
|
-
*/
|
|
12
|
-
const isWalletConnected = (status) => {
|
|
13
|
-
return (status !== undefined && status !== null && Boolean(status.walletAddress));
|
|
14
|
-
};
|
|
15
|
-
exports.isWalletConnected = isWalletConnected;
|
|
16
|
-
/**
|
|
17
|
-
* Type guard to check if wallet is verified (has message and signature)
|
|
18
|
-
*/
|
|
19
|
-
const isWalletVerified = (status) => {
|
|
20
|
-
return ((0, exports.isWalletConnected)(status) &&
|
|
21
|
-
Boolean(status.message) &&
|
|
22
|
-
Boolean(status.signature));
|
|
23
|
-
};
|
|
24
|
-
exports.isWalletVerified = isWalletVerified;
|
|
25
|
-
/**
|
|
26
|
-
* Get current wallet connection state
|
|
27
|
-
*/
|
|
28
|
-
const getWalletConnectionState = (status) => {
|
|
29
|
-
if (!(0, exports.isWalletConnected)(status)) {
|
|
30
|
-
return enums_1.ConnectionState.DISCONNECTED;
|
|
31
|
-
}
|
|
32
|
-
if ((0, exports.isWalletVerified)(status)) {
|
|
33
|
-
return enums_1.ConnectionState.VERIFIED;
|
|
34
|
-
}
|
|
35
|
-
return enums_1.ConnectionState.CONNECTED;
|
|
36
|
-
};
|
|
37
|
-
exports.getWalletConnectionState = getWalletConnectionState;
|
|
38
|
-
//# sourceMappingURL=wallet-status.js.map
|
package/dist/types/common.cjs
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Common utility types used throughout the application.
|
|
4
|
-
*
|
|
5
|
-
* Provides foundational types like {@link Optional}, {@link Result},
|
|
6
|
-
* {@link ValidationResult}, and API response structures used across
|
|
7
|
-
* every package in the ecosystem.
|
|
8
|
-
*
|
|
9
|
-
* @since 1.0.0
|
|
10
|
-
*/
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
//# sourceMappingURL=common.js.map
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Environment configuration types for cross-platform applications
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.StorageType = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* Storage type enumeration for cross-platform storage abstraction.
|
|
9
|
-
*
|
|
10
|
-
* Provides runtime-accessible values for different storage mechanisms
|
|
11
|
-
* across web browsers, React Native, and Node.js environments.
|
|
12
|
-
*/
|
|
13
|
-
var StorageType;
|
|
14
|
-
(function (StorageType) {
|
|
15
|
-
/** Web browser localStorage for persistent client-side storage */
|
|
16
|
-
StorageType["LOCAL_STORAGE"] = "localStorage";
|
|
17
|
-
/** Web browser sessionStorage for session-based storage */
|
|
18
|
-
StorageType["SESSION_STORAGE"] = "sessionStorage";
|
|
19
|
-
/** React Native AsyncStorage for mobile persistent storage */
|
|
20
|
-
StorageType["ASYNC_STORAGE"] = "asyncStorage";
|
|
21
|
-
/** In-memory storage for testing or temporary data */
|
|
22
|
-
StorageType["MEMORY"] = "memory";
|
|
23
|
-
})(StorageType || (exports.StorageType = StorageType = {}));
|
|
24
|
-
//# sourceMappingURL=environment.js.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @fileoverview Consumable Credits Type Definitions
|
|
4
|
-
* @description Shared API contract types for consumable credit system.
|
|
5
|
-
* Used by both consumables_service (backend) and consumables_client (frontend).
|
|
6
|
-
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @fileoverview Entity Type Definitions
|
|
4
|
-
* @description Core types for the entity/organization system used across shapeshyft and whisperly
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.InvitationStatus = exports.EntityRole = exports.EntityType = void 0;
|
|
8
|
-
// ========================================
|
|
9
|
-
// ENUMS
|
|
10
|
-
// ========================================
|
|
11
|
-
/**
|
|
12
|
-
* Type of entity.
|
|
13
|
-
* - personal: Auto-created for each user, cannot be deleted
|
|
14
|
-
* - organization: User-created, supports multiple members
|
|
15
|
-
*/
|
|
16
|
-
var EntityType;
|
|
17
|
-
(function (EntityType) {
|
|
18
|
-
EntityType["PERSONAL"] = "personal";
|
|
19
|
-
EntityType["ORGANIZATION"] = "organization";
|
|
20
|
-
})(EntityType || (exports.EntityType = EntityType = {}));
|
|
21
|
-
/**
|
|
22
|
-
* Role of a user within an entity.
|
|
23
|
-
* Determines permissions for various operations.
|
|
24
|
-
* - OWNER: Only for organizations. Full access including user management.
|
|
25
|
-
* - MANAGER: Can manage projects and endpoints. Used for personal entities.
|
|
26
|
-
* - MEMBER: Read-only access to projects and endpoints.
|
|
27
|
-
*/
|
|
28
|
-
var EntityRole;
|
|
29
|
-
(function (EntityRole) {
|
|
30
|
-
/** Organization owner: full access including invite users, change roles, manage projects/endpoints */
|
|
31
|
-
EntityRole["OWNER"] = "owner";
|
|
32
|
-
/** Can manage projects and endpoints, but cannot manage users. Default role for personal entities. */
|
|
33
|
-
EntityRole["MANAGER"] = "manager";
|
|
34
|
-
/** Read-only access to projects and endpoints */
|
|
35
|
-
EntityRole["MEMBER"] = "member";
|
|
36
|
-
})(EntityRole || (exports.EntityRole = EntityRole = {}));
|
|
37
|
-
/**
|
|
38
|
-
* Status of an entity invitation.
|
|
39
|
-
*/
|
|
40
|
-
var InvitationStatus;
|
|
41
|
-
(function (InvitationStatus) {
|
|
42
|
-
/** Invitation sent, awaiting response */
|
|
43
|
-
InvitationStatus["PENDING"] = "pending";
|
|
44
|
-
/** Invitation accepted, user is now a member */
|
|
45
|
-
InvitationStatus["ACCEPTED"] = "accepted";
|
|
46
|
-
/** Invitation declined by the invitee */
|
|
47
|
-
InvitationStatus["DECLINED"] = "declined";
|
|
48
|
-
/** Invitation expired (not accepted within time limit) */
|
|
49
|
-
InvitationStatus["EXPIRED"] = "expired";
|
|
50
|
-
})(InvitationStatus || (exports.InvitationStatus = InvitationStatus = {}));
|
|
51
|
-
//# sourceMappingURL=entity.js.map
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @fileoverview Entity Permission Type Definitions
|
|
4
|
-
* @description Permission types and constants for role-based access control
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.ROLE_PERMISSIONS = exports.MEMBER_PERMISSIONS = exports.MANAGER_PERMISSIONS = exports.OWNER_PERMISSIONS = void 0;
|
|
8
|
-
exports.getPermissionsForRole = getPermissionsForRole;
|
|
9
|
-
exports.hasPermission = hasPermission;
|
|
10
|
-
const entity_1 = require("./entity");
|
|
11
|
-
// ========================================
|
|
12
|
-
// ROLE PERMISSION MAPPINGS
|
|
13
|
-
// ========================================
|
|
14
|
-
/**
|
|
15
|
-
* Permission set for the Owner role (organizations only).
|
|
16
|
-
* Full access including user management, project and endpoint management.
|
|
17
|
-
* Organizations have exactly one owner; personal entities don't use this role.
|
|
18
|
-
*/
|
|
19
|
-
exports.OWNER_PERMISSIONS = {
|
|
20
|
-
canViewEntity: true,
|
|
21
|
-
canEditEntity: true,
|
|
22
|
-
canDeleteEntity: true,
|
|
23
|
-
canManageMembers: true,
|
|
24
|
-
canInviteMembers: true,
|
|
25
|
-
canManageProjects: true,
|
|
26
|
-
canCreateProjects: true,
|
|
27
|
-
canViewProjects: true,
|
|
28
|
-
canManageApiKeys: true,
|
|
29
|
-
canViewApiKeys: true,
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Permission set for the Manager role.
|
|
33
|
-
* Can manage projects and endpoints, but cannot manage users.
|
|
34
|
-
* This is the default role for personal entities.
|
|
35
|
-
*/
|
|
36
|
-
exports.MANAGER_PERMISSIONS = {
|
|
37
|
-
canViewEntity: true,
|
|
38
|
-
canEditEntity: true,
|
|
39
|
-
canDeleteEntity: false,
|
|
40
|
-
canManageMembers: false,
|
|
41
|
-
canInviteMembers: false,
|
|
42
|
-
canManageProjects: true,
|
|
43
|
-
canCreateProjects: true,
|
|
44
|
-
canViewProjects: true,
|
|
45
|
-
canManageApiKeys: true,
|
|
46
|
-
canViewApiKeys: true,
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* Permission set for the Member role.
|
|
50
|
-
* Read-only access to projects and endpoints.
|
|
51
|
-
*/
|
|
52
|
-
exports.MEMBER_PERMISSIONS = {
|
|
53
|
-
canViewEntity: true,
|
|
54
|
-
canEditEntity: false,
|
|
55
|
-
canDeleteEntity: false,
|
|
56
|
-
canManageMembers: false,
|
|
57
|
-
canInviteMembers: false,
|
|
58
|
-
canManageProjects: false,
|
|
59
|
-
canCreateProjects: false,
|
|
60
|
-
canViewProjects: true,
|
|
61
|
-
canManageApiKeys: false,
|
|
62
|
-
canViewApiKeys: true,
|
|
63
|
-
};
|
|
64
|
-
/**
|
|
65
|
-
* Maps each role to its permission set.
|
|
66
|
-
* Used by permission checking utilities.
|
|
67
|
-
*/
|
|
68
|
-
exports.ROLE_PERMISSIONS = {
|
|
69
|
-
[entity_1.EntityRole.OWNER]: exports.OWNER_PERMISSIONS,
|
|
70
|
-
[entity_1.EntityRole.MANAGER]: exports.MANAGER_PERMISSIONS,
|
|
71
|
-
[entity_1.EntityRole.MEMBER]: exports.MEMBER_PERMISSIONS,
|
|
72
|
-
};
|
|
73
|
-
// ========================================
|
|
74
|
-
// UTILITY FUNCTIONS
|
|
75
|
-
// ========================================
|
|
76
|
-
/**
|
|
77
|
-
* Get permissions for a given role.
|
|
78
|
-
* @param role - The entity role
|
|
79
|
-
* @returns The permission set for that role
|
|
80
|
-
*/
|
|
81
|
-
function getPermissionsForRole(role) {
|
|
82
|
-
return exports.ROLE_PERMISSIONS[role];
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Check if a role has a specific permission.
|
|
86
|
-
* @param role - The entity role to check
|
|
87
|
-
* @param permission - The permission key to check
|
|
88
|
-
* @returns Whether the role has the permission
|
|
89
|
-
*/
|
|
90
|
-
function hasPermission(role, permission) {
|
|
91
|
-
return exports.ROLE_PERMISSIONS[role][permission];
|
|
92
|
-
}
|
|
93
|
-
//# sourceMappingURL=permissions.js.map
|