@lokiengineering/loki-common-node 0.0.1-rc

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 ADDED
@@ -0,0 +1,194 @@
1
+ # @lokiengineering/loki-common-node
2
+
3
+ Shared TypeScript enums and types for Loki services. This library provides type-safe enum definitions to ensure consistency across multiple services.
4
+
5
+ ## Requirements
6
+
7
+ - **Node.js**: >= 24.0.0
8
+ - **npm**: >= 10.0.0
9
+
10
+ ## Installation
11
+
12
+ ```bash
13
+ npm install @lokiengineering/loki-common-node
14
+ ```
15
+
16
+ ## Usage
17
+
18
+ Import enums from the library:
19
+
20
+ ```typescript
21
+ import { /* enum names */ } from '@lokiengineering/loki-common-node';
22
+ ```
23
+
24
+ Example (once enums are added):
25
+
26
+ ```typescript
27
+ import { Status } from '@lokiengineering/loki-common-node';
28
+
29
+ const currentStatus: Status = Status.Active;
30
+ ```
31
+
32
+ ## Development
33
+
34
+ ### Setup
35
+
36
+ 1. Clone the repository:
37
+ ```bash
38
+ git clone https://github.com/loki-engineering/loki-common-node.git
39
+ cd loki-common-node
40
+ ```
41
+
42
+ 2. Install Node 24+ (or use nvm):
43
+ ```bash
44
+ nvm use 24
45
+ ```
46
+
47
+ 3. Install dependencies:
48
+ ```bash
49
+ npm install
50
+ ```
51
+
52
+ ### Building
53
+
54
+ Build the TypeScript code:
55
+
56
+ ```bash
57
+ npm run build
58
+ ```
59
+
60
+ Output will be in the `dist/` directory.
61
+
62
+ ### Development Mode
63
+
64
+ Run TypeScript compiler in watch mode:
65
+
66
+ ```bash
67
+ npm run dev
68
+ ```
69
+
70
+ ### Type Checking
71
+
72
+ Check for TypeScript errors without building:
73
+
74
+ ```bash
75
+ npm run type-check
76
+ ```
77
+
78
+ ### Code Formatting
79
+
80
+ Format code with Prettier:
81
+
82
+ ```bash
83
+ npm run format
84
+ ```
85
+
86
+ Check if code is properly formatted (without modifying):
87
+
88
+ ```bash
89
+ npm run format:check
90
+ ```
91
+
92
+ ### Cleaning
93
+
94
+ Remove build artifacts:
95
+
96
+ ```bash
97
+ npm run clean
98
+ ```
99
+
100
+ ## Project Structure
101
+
102
+ ```
103
+ src/
104
+ ├── index.ts # Main entry point (barrel exports)
105
+ └── enums/ # Enum definitions
106
+ ├── status.ts # (example)
107
+ └── roles.ts # (example)
108
+
109
+ dist/ # Compiled output (generated)
110
+ ```
111
+
112
+ ## Adding New Enums
113
+
114
+ 1. Create a new file in `src/enums/`:
115
+ ```typescript
116
+ // src/enums/status.ts
117
+ export enum Status {
118
+ Active = 'ACTIVE',
119
+ Inactive = 'INACTIVE',
120
+ Pending = 'PENDING',
121
+ }
122
+ ```
123
+
124
+ 2. Export it from `src/index.ts`:
125
+ ```typescript
126
+ export * from './enums/status';
127
+ ```
128
+
129
+ 3. Build and test:
130
+ ```bash
131
+ npm run build
132
+ npm run type-check
133
+ ```
134
+
135
+ ## Publishing
136
+
137
+ ### Setup NPM Token
138
+
139
+ 1. Generate an npm token with publish access (at https://npmjs.com/settings/~/tokens)
140
+ 2. Add it to GitHub repository secrets as `NPM_TOKEN`
141
+
142
+ ### Publish a Release
143
+
144
+ The version is automatically read from `package.json`, so:
145
+
146
+ 1. Update the version in `package.json` (e.g., `0.1.0`)
147
+ 2. Commit and push to main
148
+ 3. Create a git tag matching the version: `git tag v0.1.0`
149
+ 4. Push the tag: `git push origin v0.1.0`
150
+ 5. GitHub Actions automatically builds and publishes to npm
151
+
152
+ The workflow will:
153
+ - ✓ Verify that `package.json` version matches the git tag
154
+ - ✓ Build TypeScript
155
+ - ✓ Run type checking and formatting checks
156
+ - ✓ Publish to npm registry with appropriate tag
157
+
158
+ ### Version & Tag Format
159
+
160
+ The tag must match the version in `package.json` exactly (without the `v` prefix):
161
+
162
+ **Stable releases:**
163
+ - Version: `1.0.0`
164
+ - Tag: `v1.0.0`
165
+ - Published to npm as `@lokiengineering/loki-common-node@1.0.0` (tagged as `latest`)
166
+
167
+ **Prerelease versions:**
168
+ - Version: `1.0.0-rc` or `1.0.0-beta.1`
169
+ - Tag: `v1.0.0-rc` or `v1.0.0-beta.1`
170
+ - Published to npm as `@lokiengineering/loki-common-node@1.0.0-rc` (tagged as `next`)
171
+
172
+ Prerelease versions are published with the `next` tag on npm, so users must explicitly install them:
173
+ ```bash
174
+ npm install @lokiengineering/loki-common-node@next
175
+ ```
176
+
177
+ ## Versioning
178
+
179
+ This package follows [Semantic Versioning](https://semver.org/):
180
+ - **MAJOR**: Breaking changes to enum definitions
181
+ - **MINOR**: New enums or backward-compatible additions
182
+ - **PATCH**: Bug fixes and documentation
183
+
184
+ ## License
185
+
186
+ MIT
187
+
188
+ ## Contributing
189
+
190
+ Contributions are welcome! Please ensure:
191
+ - TypeScript code is strictly typed
192
+ - All enums are well-documented
193
+ - Type definitions are included
194
+ - Changes maintain backward compatibility where possible
@@ -0,0 +1,256 @@
1
+ declare enum WalletTransactionReason {
2
+ WITHDRAWAL = "withdrawal",
3
+ DEPOSIT_LOCK = "deposit_lock",
4
+ DEPOSIT_REFUND = "deposit_refund",
5
+ RENTAL_CHARGE = "rental_charge",
6
+ LATE_FEE = "late_fee",
7
+ DAMAGE_PENALTY = "damage_penalty",
8
+ LOST_FORFEITURE = "lost_forfeiture",
9
+ MANUAL_REFUND = "manual_refund",
10
+ TOP_UP = "top_up"
11
+ }
12
+ declare enum WalletTransactionType {
13
+ CREDIT = "credit",
14
+ DEBIT = "debit"
15
+ }
16
+ declare enum MembershipTier {
17
+ BASIC = "basic"
18
+ }
19
+ declare enum GameTier {
20
+ A_PLUS = "A+",
21
+ A = "A",
22
+ B = "B",
23
+ C = "C"
24
+ }
25
+ declare enum Genre {
26
+ actionAdventure = "Action Adventure",
27
+ actionRPG = "Action RPG",
28
+ adventure = "Adventure",
29
+ fighting = "Fighting",
30
+ racing = "Racing",
31
+ sports = "Sports",
32
+ openWorld = "Open World"
33
+ }
34
+ declare enum Platform {
35
+ PS4 = "ps4",
36
+ PS5 = "ps5"
37
+ }
38
+ declare enum HouseListPlatform {
39
+ PS4 = "ps4",
40
+ PS5 = "ps5",
41
+ ALL = "all"
42
+ }
43
+ declare enum ArticleType {
44
+ NEWS = "news",
45
+ UPDATE = "update",
46
+ SAFETY = "safety",
47
+ PROMO = "promo",
48
+ HELP = "help",
49
+ GUIDE = "guide",
50
+ REVIEW = "review",
51
+ LEGAL = "legal"
52
+ }
53
+ declare enum AdminRole {
54
+ SUPER_ADMIN = "superadmin",
55
+ OPS = "operation",
56
+ Support = "support"
57
+ }
58
+ declare enum GameCopyStatus {
59
+ AVAILABLE = "available",
60
+ RESERVED = "reserved",
61
+ RENTED = "rented",
62
+ QC_CHECKING = "qc_checking",
63
+ DAMAGED = "damaged",
64
+ MAINTENANCE = "maintenance",
65
+ RETIRED = "retired"
66
+ }
67
+ declare enum AuthProvider {
68
+ PASSWORD = "password",
69
+ GOOGLE = "google"
70
+ }
71
+ declare enum TokenType {
72
+ ACCESS = "access",
73
+ REFRESH = "refresh"
74
+ }
75
+ declare enum GamePlayMode {
76
+ SINGLE_PLAYER = "single_player",
77
+ MULTIPLAYER = "multiplayer",
78
+ CO_OP = "co_op"
79
+ }
80
+ declare enum OrderType {
81
+ NEW = "new",
82
+ EXTEND = "extend"
83
+ }
84
+ declare enum VerificationTokenType {
85
+ EMAIL_VERIFICATION = "email_verification",
86
+ PASSWORD_RESET = "password_reset"
87
+ }
88
+ declare enum EmailTemplateType {
89
+ EMAIL_VERIFICATION = "email_verification",
90
+ PASSWORD_RESET = "password_reset",
91
+ PASSWORD_CONFIRMATION = "password_confirmation"
92
+ }
93
+ declare enum OrderStatus {
94
+ AWAITING_PAYMENT = "awaiting_payment",
95
+ ORDERED = "ordered",
96
+ OUTBOUND = "outbound",
97
+ DELIVERED = "delivered",
98
+ INBOUND = "inbound",
99
+ QC_CHECKING = "qc_checking",
100
+ QC_PASSED = "qc_passed",
101
+ CANCELLED = "cancelled",
102
+ LOST = "lost",
103
+ DAMAGE_DETECTED = "damage_detected",
104
+ LOST_OUTBOUND = "lost_outbound",
105
+ LOST_INBOUND = "lost_inbound",
106
+ COMPLETED = "completed"
107
+ }
108
+ declare enum OrderItemStatus {
109
+ ACTIVE = "active",//
110
+ EXTENDED = "extended",// item rental has been extended
111
+ RETURNED = "returned",// item returned, pending QC
112
+ DAMAGED = "damaged",// damage detected on this specific item
113
+ LOST = "lost"
114
+ }
115
+ declare enum RefundStatus {
116
+ PENDING = "pending",
117
+ PROCESSED = "processed",
118
+ REJECTED = "rejected",
119
+ DONE = "done"
120
+ }
121
+ declare enum IncidentResolution {
122
+ PENDING = "pending",
123
+ FULL_REFUND = "full_refund",
124
+ PARTIAL_REFUND = "partial_refund",
125
+ NO_REFUND = "no_refund",
126
+ RESOLVED = "resolved"
127
+ }
128
+ declare enum OrderIncidentType {
129
+ INBOUND_DAMAGE = "inbound_damage",
130
+ OUTBOUND_DAMAGE = "outbound_damage",
131
+ UNFULFILLABLE = "unfulfillable"
132
+ }
133
+ declare enum PeriodKey {
134
+ Weeks = "weeks",
135
+ Days = "days",
136
+ Months = "months",
137
+ Seconds = "seconds"
138
+ }
139
+ declare enum DeliveryDirection {
140
+ INBOUND = "inbound",
141
+ OUTBOUND = "outbound"
142
+ }
143
+ declare enum ActorType {
144
+ ADMIN = "admin",
145
+ USER = "user",
146
+ SYSTEM = "system"
147
+ }
148
+ declare enum DeliveryStatus {
149
+ PENDING = "pending",
150
+ DISPATCHED = "dispatched",
151
+ DELIVERED = "delivered"
152
+ }
153
+
154
+ declare enum MaturityRating {
155
+ EVERYONE = "Everyone",
156
+ EVERYONE_10_PLUS = "10+",
157
+ TEEN_13_PLUS = "13+",
158
+ ADULTS_18_PLUS = "18+",
159
+ UNRATED = "Unrated"
160
+ }
161
+ declare enum ContentDescriptor {
162
+ VIOLENCE = "violence",
163
+ GORE = "gore",
164
+ LANGUAGE = "language",
165
+ SUGGESTIVE = "suggestive",
166
+ SUBSTANCES = "substances",
167
+ GAMBLING = "gambling"
168
+ }
169
+
170
+ declare enum AssetVisibility {
171
+ PRIVATE = "private",
172
+ PUBLIC = "public"
173
+ }
174
+ declare enum AssetType {
175
+ GAME = "game",
176
+ GAME_EDITION = "game_edition",
177
+ QC_OUTBOUND = "qc_outbound",
178
+ QC_INBOUND = "qc_inbound"
179
+ }
180
+ declare const VisibilityToTypeMap: {
181
+ public: AssetType[];
182
+ private: AssetType[];
183
+ };
184
+
185
+ declare enum ErrorEntity {
186
+ Game = "game",
187
+ Cache = "cache",
188
+ Slug = "slug",
189
+ Order = "order",
190
+ User = "user",
191
+ AdminUser = "admin",
192
+ AuthIdentity = "auth_identity",
193
+ UserAddress = "user_address",
194
+ OrderStatus = "order_status",
195
+ GameEdition = "game_edition",
196
+ PricingConfig = "pricing_config",
197
+ RentalPeriodRule = "rental_period_rule",
198
+ TierMultiplier = "tier_multiplier",
199
+ OrderCostComponent = "order_cost_component",
200
+ GameCopy = "game_copy",
201
+ Tag = "tag",
202
+ GameTag = "game_tag",
203
+ HouseList = "house_list",
204
+ HouseListGame = "house_list_game",
205
+ CartItem = "cart_item",
206
+ OrderDelivery = "order_delivery",
207
+ Wallet = "wallet",
208
+ WalletTransaction = "wallet_transaction",
209
+ UpcomingRelease = "upcoming_release"
210
+ }
211
+ declare enum ServerErrorEnum {
212
+ CACHE_LOCK_FAILURE = "CACHE_LOCK_FAILURE",
213
+ PRICING_RECALCULATION_IN_PROGRESS = "PRICING_RECALCULATION_IN_PROGRESS",
214
+ INVALID_PRICING_VARIABLES = "INVALID_PRICING_VARIABLES",
215
+ MISSING_PRICING_VARIABLES = "MISSING_PRICING_VARIABLES",
216
+ GENERAL = "GENERAL"
217
+ }
218
+ declare enum BusinessLogicErrorEnum {
219
+ INSUFFICIENT_BALANCE = "INSUFFICIENT_BALANCE",
220
+ COPY_HAS_ACTIVE_RESERVATION = "COPY_HAS_ACTIVE_RESERVATION",
221
+ CART_EMPTY = "CART_EMPTY",
222
+ UNFINISHED_ORDER_EXISTS = "UNFINISHED_ORDER_EXISTS",
223
+ NOT_AVAILABLE_FOR_RENT = "NOT_AVAILABLE_FOR_RENT",
224
+ INVALID_RENTAL_DURATION = "INVALID_RENTAL_DURATION",
225
+ WALLET_FROZEN = "WALLET_FROZEN",
226
+ CANNOT_DELETE_PRIMARY_ADDRESS = "CANNOT_DELETE_PRIMARY_ADDRESS",
227
+ MAX_DEPOSIT_EXCEEDED = "MAX_DEPOSIT_EXCEEDED",
228
+ EDITION_HAS_ACTIVE_COPIES = "EDITION_HAS_ACTIVE_COPIES",
229
+ INVALID_ORDER_TRANSITION_CONFIG = "INVALID_ORDER_TRANSITION_CONFIG"
230
+ }
231
+ declare enum GeneralErrorEnum {
232
+ ROUTE_NOT_FOUND = "ROUTE_NOT_FOUND",
233
+ INVALID_CREDENTIALS = "INVALID_CREDENTIALS",
234
+ INVALID_REFRESH_TOKEN = "INVALID_REFRESH_TOKEN",
235
+ TOKEN_EXPIRED = "TOKEN_EXPIRED",
236
+ TOKEN_INVALID = "TOKEN_INVALID",
237
+ FORBIDDEN = "FORBIDDEN",
238
+ UNAUTHORIZED = "UNAUTHORIZED",
239
+ INVALID_VERIFICATION_TOKEN = "INVALID_VERIFICATION_TOKEN",
240
+ RATE_LIMITED = "RATE_LIMITED",
241
+ EMAIL_ALREADY_VERIFIED = "EMAIL_ALREADY_VERIFIED",
242
+ NOT_FOUND = "NOT_FOUND"
243
+ }
244
+ declare enum ParseError {
245
+ INVALID_RESPONSE = "INVALID_RESPONSE",
246
+ INVALID_INPUT = "INVALID_INPUT"
247
+ }
248
+ type ErrorEnum = ServerErrorEnum | BusinessLogicErrorEnum | GeneralErrorEnum | ParseError;
249
+
250
+ declare enum PayoutKnownBank {
251
+ BCA = "bca",
252
+ BNI = "bni",
253
+ MANDIRI = "mandiri"
254
+ }
255
+
256
+ export { ActorType, AdminRole, ArticleType, AssetType, AssetVisibility, AuthProvider, BusinessLogicErrorEnum, ContentDescriptor, DeliveryDirection, DeliveryStatus, EmailTemplateType, ErrorEntity, type ErrorEnum, GameCopyStatus, GamePlayMode, GameTier, GeneralErrorEnum, Genre, HouseListPlatform, IncidentResolution, MaturityRating, MembershipTier, OrderIncidentType, OrderItemStatus, OrderStatus, OrderType, ParseError, PayoutKnownBank, PeriodKey, Platform, RefundStatus, ServerErrorEnum, TokenType, VerificationTokenType, VisibilityToTypeMap, WalletTransactionReason, WalletTransactionType };
package/dist/index.js ADDED
@@ -0,0 +1,331 @@
1
+ // src/enums/business.enum.ts
2
+ var WalletTransactionReason = /* @__PURE__ */ ((WalletTransactionReason2) => {
3
+ WalletTransactionReason2["WITHDRAWAL"] = "withdrawal";
4
+ WalletTransactionReason2["DEPOSIT_LOCK"] = "deposit_lock";
5
+ WalletTransactionReason2["DEPOSIT_REFUND"] = "deposit_refund";
6
+ WalletTransactionReason2["RENTAL_CHARGE"] = "rental_charge";
7
+ WalletTransactionReason2["LATE_FEE"] = "late_fee";
8
+ WalletTransactionReason2["DAMAGE_PENALTY"] = "damage_penalty";
9
+ WalletTransactionReason2["LOST_FORFEITURE"] = "lost_forfeiture";
10
+ WalletTransactionReason2["MANUAL_REFUND"] = "manual_refund";
11
+ WalletTransactionReason2["TOP_UP"] = "top_up";
12
+ return WalletTransactionReason2;
13
+ })(WalletTransactionReason || {});
14
+ var WalletTransactionType = /* @__PURE__ */ ((WalletTransactionType2) => {
15
+ WalletTransactionType2["CREDIT"] = "credit";
16
+ WalletTransactionType2["DEBIT"] = "debit";
17
+ return WalletTransactionType2;
18
+ })(WalletTransactionType || {});
19
+ var MembershipTier = /* @__PURE__ */ ((MembershipTier2) => {
20
+ MembershipTier2["BASIC"] = "basic";
21
+ return MembershipTier2;
22
+ })(MembershipTier || {});
23
+ var GameTier = /* @__PURE__ */ ((GameTier2) => {
24
+ GameTier2["A_PLUS"] = "A+";
25
+ GameTier2["A"] = "A";
26
+ GameTier2["B"] = "B";
27
+ GameTier2["C"] = "C";
28
+ return GameTier2;
29
+ })(GameTier || {});
30
+ var Genre = /* @__PURE__ */ ((Genre2) => {
31
+ Genre2["actionAdventure"] = "Action Adventure";
32
+ Genre2["actionRPG"] = "Action RPG";
33
+ Genre2["adventure"] = "Adventure";
34
+ Genre2["fighting"] = "Fighting";
35
+ Genre2["racing"] = "Racing";
36
+ Genre2["sports"] = "Sports";
37
+ Genre2["openWorld"] = "Open World";
38
+ return Genre2;
39
+ })(Genre || {});
40
+ var Platform = /* @__PURE__ */ ((Platform2) => {
41
+ Platform2["PS4"] = "ps4";
42
+ Platform2["PS5"] = "ps5";
43
+ return Platform2;
44
+ })(Platform || {});
45
+ var HouseListPlatform = /* @__PURE__ */ ((HouseListPlatform2) => {
46
+ HouseListPlatform2["PS4"] = "ps4";
47
+ HouseListPlatform2["PS5"] = "ps5";
48
+ HouseListPlatform2["ALL"] = "all";
49
+ return HouseListPlatform2;
50
+ })(HouseListPlatform || {});
51
+ var ArticleType = /* @__PURE__ */ ((ArticleType2) => {
52
+ ArticleType2["NEWS"] = "news";
53
+ ArticleType2["UPDATE"] = "update";
54
+ ArticleType2["SAFETY"] = "safety";
55
+ ArticleType2["PROMO"] = "promo";
56
+ ArticleType2["HELP"] = "help";
57
+ ArticleType2["GUIDE"] = "guide";
58
+ ArticleType2["REVIEW"] = "review";
59
+ ArticleType2["LEGAL"] = "legal";
60
+ return ArticleType2;
61
+ })(ArticleType || {});
62
+ var AdminRole = /* @__PURE__ */ ((AdminRole2) => {
63
+ AdminRole2["SUPER_ADMIN"] = "superadmin";
64
+ AdminRole2["OPS"] = "operation";
65
+ AdminRole2["Support"] = "support";
66
+ return AdminRole2;
67
+ })(AdminRole || {});
68
+ var GameCopyStatus = /* @__PURE__ */ ((GameCopyStatus2) => {
69
+ GameCopyStatus2["AVAILABLE"] = "available";
70
+ GameCopyStatus2["RESERVED"] = "reserved";
71
+ GameCopyStatus2["RENTED"] = "rented";
72
+ GameCopyStatus2["QC_CHECKING"] = "qc_checking";
73
+ GameCopyStatus2["DAMAGED"] = "damaged";
74
+ GameCopyStatus2["MAINTENANCE"] = "maintenance";
75
+ GameCopyStatus2["RETIRED"] = "retired";
76
+ return GameCopyStatus2;
77
+ })(GameCopyStatus || {});
78
+ var AuthProvider = /* @__PURE__ */ ((AuthProvider2) => {
79
+ AuthProvider2["PASSWORD"] = "password";
80
+ AuthProvider2["GOOGLE"] = "google";
81
+ return AuthProvider2;
82
+ })(AuthProvider || {});
83
+ var TokenType = /* @__PURE__ */ ((TokenType2) => {
84
+ TokenType2["ACCESS"] = "access";
85
+ TokenType2["REFRESH"] = "refresh";
86
+ return TokenType2;
87
+ })(TokenType || {});
88
+ var GamePlayMode = /* @__PURE__ */ ((GamePlayMode2) => {
89
+ GamePlayMode2["SINGLE_PLAYER"] = "single_player";
90
+ GamePlayMode2["MULTIPLAYER"] = "multiplayer";
91
+ GamePlayMode2["CO_OP"] = "co_op";
92
+ return GamePlayMode2;
93
+ })(GamePlayMode || {});
94
+ var OrderType = /* @__PURE__ */ ((OrderType2) => {
95
+ OrderType2["NEW"] = "new";
96
+ OrderType2["EXTEND"] = "extend";
97
+ return OrderType2;
98
+ })(OrderType || {});
99
+ var VerificationTokenType = /* @__PURE__ */ ((VerificationTokenType2) => {
100
+ VerificationTokenType2["EMAIL_VERIFICATION"] = "email_verification";
101
+ VerificationTokenType2["PASSWORD_RESET"] = "password_reset";
102
+ return VerificationTokenType2;
103
+ })(VerificationTokenType || {});
104
+ var EmailTemplateType = /* @__PURE__ */ ((EmailTemplateType2) => {
105
+ EmailTemplateType2["EMAIL_VERIFICATION"] = "email_verification";
106
+ EmailTemplateType2["PASSWORD_RESET"] = "password_reset";
107
+ EmailTemplateType2["PASSWORD_CONFIRMATION"] = "password_confirmation";
108
+ return EmailTemplateType2;
109
+ })(EmailTemplateType || {});
110
+ var OrderStatus = /* @__PURE__ */ ((OrderStatus2) => {
111
+ OrderStatus2["AWAITING_PAYMENT"] = "awaiting_payment";
112
+ OrderStatus2["ORDERED"] = "ordered";
113
+ OrderStatus2["OUTBOUND"] = "outbound";
114
+ OrderStatus2["DELIVERED"] = "delivered";
115
+ OrderStatus2["INBOUND"] = "inbound";
116
+ OrderStatus2["QC_CHECKING"] = "qc_checking";
117
+ OrderStatus2["QC_PASSED"] = "qc_passed";
118
+ OrderStatus2["CANCELLED"] = "cancelled";
119
+ OrderStatus2["LOST"] = "lost";
120
+ OrderStatus2["DAMAGE_DETECTED"] = "damage_detected";
121
+ OrderStatus2["LOST_OUTBOUND"] = "lost_outbound";
122
+ OrderStatus2["LOST_INBOUND"] = "lost_inbound";
123
+ OrderStatus2["COMPLETED"] = "completed";
124
+ return OrderStatus2;
125
+ })(OrderStatus || {});
126
+ var OrderItemStatus = /* @__PURE__ */ ((OrderItemStatus2) => {
127
+ OrderItemStatus2["ACTIVE"] = "active";
128
+ OrderItemStatus2["EXTENDED"] = "extended";
129
+ OrderItemStatus2["RETURNED"] = "returned";
130
+ OrderItemStatus2["DAMAGED"] = "damaged";
131
+ OrderItemStatus2["LOST"] = "lost";
132
+ return OrderItemStatus2;
133
+ })(OrderItemStatus || {});
134
+ var RefundStatus = /* @__PURE__ */ ((RefundStatus2) => {
135
+ RefundStatus2["PENDING"] = "pending";
136
+ RefundStatus2["PROCESSED"] = "processed";
137
+ RefundStatus2["REJECTED"] = "rejected";
138
+ RefundStatus2["DONE"] = "done";
139
+ return RefundStatus2;
140
+ })(RefundStatus || {});
141
+ var IncidentResolution = /* @__PURE__ */ ((IncidentResolution2) => {
142
+ IncidentResolution2["PENDING"] = "pending";
143
+ IncidentResolution2["FULL_REFUND"] = "full_refund";
144
+ IncidentResolution2["PARTIAL_REFUND"] = "partial_refund";
145
+ IncidentResolution2["NO_REFUND"] = "no_refund";
146
+ IncidentResolution2["RESOLVED"] = "resolved";
147
+ return IncidentResolution2;
148
+ })(IncidentResolution || {});
149
+ var OrderIncidentType = /* @__PURE__ */ ((OrderIncidentType2) => {
150
+ OrderIncidentType2["INBOUND_DAMAGE"] = "inbound_damage";
151
+ OrderIncidentType2["OUTBOUND_DAMAGE"] = "outbound_damage";
152
+ OrderIncidentType2["UNFULFILLABLE"] = "unfulfillable";
153
+ return OrderIncidentType2;
154
+ })(OrderIncidentType || {});
155
+ var PeriodKey = /* @__PURE__ */ ((PeriodKey2) => {
156
+ PeriodKey2["Weeks"] = "weeks";
157
+ PeriodKey2["Days"] = "days";
158
+ PeriodKey2["Months"] = "months";
159
+ PeriodKey2["Seconds"] = "seconds";
160
+ return PeriodKey2;
161
+ })(PeriodKey || {});
162
+ var DeliveryDirection = /* @__PURE__ */ ((DeliveryDirection2) => {
163
+ DeliveryDirection2["INBOUND"] = "inbound";
164
+ DeliveryDirection2["OUTBOUND"] = "outbound";
165
+ return DeliveryDirection2;
166
+ })(DeliveryDirection || {});
167
+ var ActorType = /* @__PURE__ */ ((ActorType2) => {
168
+ ActorType2["ADMIN"] = "admin";
169
+ ActorType2["USER"] = "user";
170
+ ActorType2["SYSTEM"] = "system";
171
+ return ActorType2;
172
+ })(ActorType || {});
173
+ var DeliveryStatus = /* @__PURE__ */ ((DeliveryStatus2) => {
174
+ DeliveryStatus2["PENDING"] = "pending";
175
+ DeliveryStatus2["DISPATCHED"] = "dispatched";
176
+ DeliveryStatus2["DELIVERED"] = "delivered";
177
+ return DeliveryStatus2;
178
+ })(DeliveryStatus || {});
179
+
180
+ // src/enums/rating.enum.ts
181
+ var MaturityRating = /* @__PURE__ */ ((MaturityRating2) => {
182
+ MaturityRating2["EVERYONE"] = "Everyone";
183
+ MaturityRating2["EVERYONE_10_PLUS"] = "10+";
184
+ MaturityRating2["TEEN_13_PLUS"] = "13+";
185
+ MaturityRating2["ADULTS_18_PLUS"] = "18+";
186
+ MaturityRating2["UNRATED"] = "Unrated";
187
+ return MaturityRating2;
188
+ })(MaturityRating || {});
189
+ var ContentDescriptor = /* @__PURE__ */ ((ContentDescriptor2) => {
190
+ ContentDescriptor2["VIOLENCE"] = "violence";
191
+ ContentDescriptor2["GORE"] = "gore";
192
+ ContentDescriptor2["LANGUAGE"] = "language";
193
+ ContentDescriptor2["SUGGESTIVE"] = "suggestive";
194
+ ContentDescriptor2["SUBSTANCES"] = "substances";
195
+ ContentDescriptor2["GAMBLING"] = "gambling";
196
+ return ContentDescriptor2;
197
+ })(ContentDescriptor || {});
198
+
199
+ // src/enums/config.enum.ts
200
+ var AssetVisibility = /* @__PURE__ */ ((AssetVisibility2) => {
201
+ AssetVisibility2["PRIVATE"] = "private";
202
+ AssetVisibility2["PUBLIC"] = "public";
203
+ return AssetVisibility2;
204
+ })(AssetVisibility || {});
205
+ var AssetType = /* @__PURE__ */ ((AssetType2) => {
206
+ AssetType2["GAME"] = "game";
207
+ AssetType2["GAME_EDITION"] = "game_edition";
208
+ AssetType2["QC_OUTBOUND"] = "qc_outbound";
209
+ AssetType2["QC_INBOUND"] = "qc_inbound";
210
+ return AssetType2;
211
+ })(AssetType || {});
212
+ var VisibilityToTypeMap = {
213
+ ["public" /* PUBLIC */]: ["game" /* GAME */, "game_edition" /* GAME_EDITION */],
214
+ ["private" /* PRIVATE */]: ["qc_inbound" /* QC_INBOUND */, "qc_outbound" /* QC_OUTBOUND */]
215
+ };
216
+
217
+ // src/enums/error.enum.ts
218
+ var ErrorEntity = /* @__PURE__ */ ((ErrorEntity2) => {
219
+ ErrorEntity2["Game"] = "game";
220
+ ErrorEntity2["Cache"] = "cache";
221
+ ErrorEntity2["Slug"] = "slug";
222
+ ErrorEntity2["Order"] = "order";
223
+ ErrorEntity2["User"] = "user";
224
+ ErrorEntity2["AdminUser"] = "admin";
225
+ ErrorEntity2["AuthIdentity"] = "auth_identity";
226
+ ErrorEntity2["UserAddress"] = "user_address";
227
+ ErrorEntity2["OrderStatus"] = "order_status";
228
+ ErrorEntity2["GameEdition"] = "game_edition";
229
+ ErrorEntity2["PricingConfig"] = "pricing_config";
230
+ ErrorEntity2["RentalPeriodRule"] = "rental_period_rule";
231
+ ErrorEntity2["TierMultiplier"] = "tier_multiplier";
232
+ ErrorEntity2["OrderCostComponent"] = "order_cost_component";
233
+ ErrorEntity2["GameCopy"] = "game_copy";
234
+ ErrorEntity2["Tag"] = "tag";
235
+ ErrorEntity2["GameTag"] = "game_tag";
236
+ ErrorEntity2["HouseList"] = "house_list";
237
+ ErrorEntity2["HouseListGame"] = "house_list_game";
238
+ ErrorEntity2["CartItem"] = "cart_item";
239
+ ErrorEntity2["OrderDelivery"] = "order_delivery";
240
+ ErrorEntity2["Wallet"] = "wallet";
241
+ ErrorEntity2["WalletTransaction"] = "wallet_transaction";
242
+ ErrorEntity2["UpcomingRelease"] = "upcoming_release";
243
+ return ErrorEntity2;
244
+ })(ErrorEntity || {});
245
+ var ServerErrorEnum = /* @__PURE__ */ ((ServerErrorEnum2) => {
246
+ ServerErrorEnum2["CACHE_LOCK_FAILURE"] = "CACHE_LOCK_FAILURE";
247
+ ServerErrorEnum2["PRICING_RECALCULATION_IN_PROGRESS"] = "PRICING_RECALCULATION_IN_PROGRESS";
248
+ ServerErrorEnum2["INVALID_PRICING_VARIABLES"] = "INVALID_PRICING_VARIABLES";
249
+ ServerErrorEnum2["MISSING_PRICING_VARIABLES"] = "MISSING_PRICING_VARIABLES";
250
+ ServerErrorEnum2["GENERAL"] = "GENERAL";
251
+ return ServerErrorEnum2;
252
+ })(ServerErrorEnum || {});
253
+ var BusinessLogicErrorEnum = /* @__PURE__ */ ((BusinessLogicErrorEnum2) => {
254
+ BusinessLogicErrorEnum2["INSUFFICIENT_BALANCE"] = "INSUFFICIENT_BALANCE";
255
+ BusinessLogicErrorEnum2["COPY_HAS_ACTIVE_RESERVATION"] = "COPY_HAS_ACTIVE_RESERVATION";
256
+ BusinessLogicErrorEnum2["CART_EMPTY"] = "CART_EMPTY";
257
+ BusinessLogicErrorEnum2["UNFINISHED_ORDER_EXISTS"] = "UNFINISHED_ORDER_EXISTS";
258
+ BusinessLogicErrorEnum2["NOT_AVAILABLE_FOR_RENT"] = "NOT_AVAILABLE_FOR_RENT";
259
+ BusinessLogicErrorEnum2["INVALID_RENTAL_DURATION"] = "INVALID_RENTAL_DURATION";
260
+ BusinessLogicErrorEnum2["WALLET_FROZEN"] = "WALLET_FROZEN";
261
+ BusinessLogicErrorEnum2["CANNOT_DELETE_PRIMARY_ADDRESS"] = "CANNOT_DELETE_PRIMARY_ADDRESS";
262
+ BusinessLogicErrorEnum2["MAX_DEPOSIT_EXCEEDED"] = "MAX_DEPOSIT_EXCEEDED";
263
+ BusinessLogicErrorEnum2["EDITION_HAS_ACTIVE_COPIES"] = "EDITION_HAS_ACTIVE_COPIES";
264
+ BusinessLogicErrorEnum2["INVALID_ORDER_TRANSITION_CONFIG"] = "INVALID_ORDER_TRANSITION_CONFIG";
265
+ return BusinessLogicErrorEnum2;
266
+ })(BusinessLogicErrorEnum || {});
267
+ var GeneralErrorEnum = /* @__PURE__ */ ((GeneralErrorEnum2) => {
268
+ GeneralErrorEnum2["ROUTE_NOT_FOUND"] = "ROUTE_NOT_FOUND";
269
+ GeneralErrorEnum2["INVALID_CREDENTIALS"] = "INVALID_CREDENTIALS";
270
+ GeneralErrorEnum2["INVALID_REFRESH_TOKEN"] = "INVALID_REFRESH_TOKEN";
271
+ GeneralErrorEnum2["TOKEN_EXPIRED"] = "TOKEN_EXPIRED";
272
+ GeneralErrorEnum2["TOKEN_INVALID"] = "TOKEN_INVALID";
273
+ GeneralErrorEnum2["FORBIDDEN"] = "FORBIDDEN";
274
+ GeneralErrorEnum2["UNAUTHORIZED"] = "UNAUTHORIZED";
275
+ GeneralErrorEnum2["INVALID_VERIFICATION_TOKEN"] = "INVALID_VERIFICATION_TOKEN";
276
+ GeneralErrorEnum2["RATE_LIMITED"] = "RATE_LIMITED";
277
+ GeneralErrorEnum2["EMAIL_ALREADY_VERIFIED"] = "EMAIL_ALREADY_VERIFIED";
278
+ GeneralErrorEnum2["NOT_FOUND"] = "NOT_FOUND";
279
+ return GeneralErrorEnum2;
280
+ })(GeneralErrorEnum || {});
281
+ var ParseError = /* @__PURE__ */ ((ParseError2) => {
282
+ ParseError2["INVALID_RESPONSE"] = "INVALID_RESPONSE";
283
+ ParseError2["INVALID_INPUT"] = "INVALID_INPUT";
284
+ return ParseError2;
285
+ })(ParseError || {});
286
+
287
+ // src/enums/bank.enum.ts
288
+ var PayoutKnownBank = /* @__PURE__ */ ((PayoutKnownBank2) => {
289
+ PayoutKnownBank2["BCA"] = "bca";
290
+ PayoutKnownBank2["BNI"] = "bni";
291
+ PayoutKnownBank2["MANDIRI"] = "mandiri";
292
+ return PayoutKnownBank2;
293
+ })(PayoutKnownBank || {});
294
+ export {
295
+ ActorType,
296
+ AdminRole,
297
+ ArticleType,
298
+ AssetType,
299
+ AssetVisibility,
300
+ AuthProvider,
301
+ BusinessLogicErrorEnum,
302
+ ContentDescriptor,
303
+ DeliveryDirection,
304
+ DeliveryStatus,
305
+ EmailTemplateType,
306
+ ErrorEntity,
307
+ GameCopyStatus,
308
+ GamePlayMode,
309
+ GameTier,
310
+ GeneralErrorEnum,
311
+ Genre,
312
+ HouseListPlatform,
313
+ IncidentResolution,
314
+ MaturityRating,
315
+ MembershipTier,
316
+ OrderIncidentType,
317
+ OrderItemStatus,
318
+ OrderStatus,
319
+ OrderType,
320
+ ParseError,
321
+ PayoutKnownBank,
322
+ PeriodKey,
323
+ Platform,
324
+ RefundStatus,
325
+ ServerErrorEnum,
326
+ TokenType,
327
+ VerificationTokenType,
328
+ VisibilityToTypeMap,
329
+ WalletTransactionReason,
330
+ WalletTransactionType
331
+ };
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@lokiengineering/loki-common-node",
3
+ "version": "0.0.1-rc",
4
+ "description": "Shared TypeScript enums and types for Loki services",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/loki-engineering/loki-common-node.git"
9
+ },
10
+ "bugs": {
11
+ "url": "https://github.com/loki-engineering/loki-common-node/issues"
12
+ },
13
+ "homepage": "https://github.com/loki-engineering/loki-common-node#readme",
14
+ "engines": {
15
+ "node": ">=24.0.0"
16
+ },
17
+ "type": "module",
18
+ "main": "./dist/index.js",
19
+ "types": "./dist/index.d.ts",
20
+ "exports": {
21
+ ".": {
22
+ "types": "./dist/index.d.ts",
23
+ "default": "./dist/index.js"
24
+ }
25
+ },
26
+ "files": [
27
+ "dist"
28
+ ],
29
+ "scripts": {
30
+ "build": "tsup src/index.ts --format esm --dts",
31
+ "dev": "tsup src/index.ts --format esm --dts --watch",
32
+ "type-check": "tsc --noEmit",
33
+ "format": "prettier --write \"src/**/*.ts\"",
34
+ "format:check": "prettier --check \"src/**/*.ts\"",
35
+ "clean": "rm -rf dist"
36
+ },
37
+ "keywords": [
38
+ "enums",
39
+ "types",
40
+ "typescript",
41
+ "loki"
42
+ ],
43
+ "devDependencies": {
44
+ "@types/node": "^24.0.0",
45
+ "prettier": "^3.2.0",
46
+ "tsup": "^8.0.0",
47
+ "typescript": "^5.4.0"
48
+ },
49
+ "publishConfig": {
50
+ "access": "public"
51
+ }
52
+ }