@basedone/core 0.2.3 → 0.2.5
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/{chunk-SKX4VGEN.mjs → chunk-P5C65GIG.mjs} +172 -0
- package/dist/ecommerce.d.mts +370 -2
- package/dist/ecommerce.d.ts +370 -2
- package/dist/ecommerce.js +172 -0
- package/dist/ecommerce.mjs +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +172 -0
- package/dist/index.mjs +1 -1
- package/lib/ecommerce/client/customer.ts +191 -0
- package/lib/ecommerce/types/enums.ts +2 -0
- package/lib/ecommerce/types/requests.ts +62 -0
- package/lib/ecommerce/types/responses.ts +196 -0
- package/package.json +1 -1
|
@@ -951,6 +951,36 @@ export interface ActiveFlashSalesResponse {
|
|
|
951
951
|
serverTime: string;
|
|
952
952
|
}
|
|
953
953
|
|
|
954
|
+
/**
|
|
955
|
+
* Flash sale allowance info for a single product
|
|
956
|
+
*/
|
|
957
|
+
export interface FlashSaleAllowanceInfo {
|
|
958
|
+
/** Flash sale ID */
|
|
959
|
+
flashSaleId: string;
|
|
960
|
+
/** Limit per customer (null = no limit) */
|
|
961
|
+
limitPerCustomer: number | null;
|
|
962
|
+
/** Quantity already purchased by user */
|
|
963
|
+
purchased: number;
|
|
964
|
+
/** Remaining quantity user can purchase (null = no limit) */
|
|
965
|
+
remaining: number | null;
|
|
966
|
+
/** Current sale price */
|
|
967
|
+
salePrice: string;
|
|
968
|
+
/** Maximum quantity available in flash sale (null = unlimited) */
|
|
969
|
+
maxQuantity: number | null;
|
|
970
|
+
/** Remaining quantity in flash sale (null = unlimited) */
|
|
971
|
+
remainingQuantity: number | null;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
/**
|
|
975
|
+
* Get flash sale allowance response
|
|
976
|
+
*/
|
|
977
|
+
export interface GetFlashSaleAllowanceResponse {
|
|
978
|
+
/** Allowances by product ID */
|
|
979
|
+
allowances: Record<string, FlashSaleAllowanceInfo>;
|
|
980
|
+
/** Whether user is authenticated */
|
|
981
|
+
authenticated: boolean;
|
|
982
|
+
}
|
|
983
|
+
|
|
954
984
|
// ============================================
|
|
955
985
|
// SHIPPING RESPONSES
|
|
956
986
|
// ============================================
|
|
@@ -1099,3 +1129,169 @@ export interface ProcessPaymentResponse {
|
|
|
1099
1129
|
errorCode?: string;
|
|
1100
1130
|
}
|
|
1101
1131
|
|
|
1132
|
+
// ============================================================================
|
|
1133
|
+
// GEM System Responses
|
|
1134
|
+
// ============================================================================
|
|
1135
|
+
|
|
1136
|
+
/**
|
|
1137
|
+
* Gem source type - how gems were earned
|
|
1138
|
+
*/
|
|
1139
|
+
export type GemSource =
|
|
1140
|
+
| "BUILDER_CODE"
|
|
1141
|
+
| "PREDICTION"
|
|
1142
|
+
| "CARD_SPEND"
|
|
1143
|
+
| "MALL_SPEND"
|
|
1144
|
+
| "ADMIN"
|
|
1145
|
+
| "REFUND";
|
|
1146
|
+
|
|
1147
|
+
/**
|
|
1148
|
+
* Get gem balance response
|
|
1149
|
+
*/
|
|
1150
|
+
export interface GetGemBalanceResponse {
|
|
1151
|
+
/** User ID */
|
|
1152
|
+
userId: string;
|
|
1153
|
+
/** Total gems owned */
|
|
1154
|
+
totalGems: number;
|
|
1155
|
+
/** Available gems (not reserved) */
|
|
1156
|
+
availableGems: number;
|
|
1157
|
+
/** Gems expiring within 30 days */
|
|
1158
|
+
expiringSoon: number;
|
|
1159
|
+
/** Last balance update timestamp */
|
|
1160
|
+
lastUpdated: string;
|
|
1161
|
+
/** USD equivalent (totalGems / 100) */
|
|
1162
|
+
usdEquivalent: number;
|
|
1163
|
+
/** Conversion rate (gems per $1) */
|
|
1164
|
+
conversionRate: number;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
/**
|
|
1168
|
+
* Gem history item type
|
|
1169
|
+
*/
|
|
1170
|
+
export type GemHistoryType = "earn" | "spend" | "expire";
|
|
1171
|
+
|
|
1172
|
+
/**
|
|
1173
|
+
* Gem history item
|
|
1174
|
+
*/
|
|
1175
|
+
export interface GemHistoryItem {
|
|
1176
|
+
/** Transaction ID */
|
|
1177
|
+
id: string;
|
|
1178
|
+
/** Type of transaction */
|
|
1179
|
+
type: GemHistoryType;
|
|
1180
|
+
/** Amount of gems (positive for earn, negative for spend) */
|
|
1181
|
+
amount: number;
|
|
1182
|
+
/** Source type (for earn transactions) */
|
|
1183
|
+
source?: GemSource;
|
|
1184
|
+
/** Reason description (for spend transactions) */
|
|
1185
|
+
reason?: string;
|
|
1186
|
+
/** When the transaction occurred */
|
|
1187
|
+
createdAt: string;
|
|
1188
|
+
/** When the gems expire (for earn transactions) */
|
|
1189
|
+
expiresAt?: string;
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
/**
|
|
1193
|
+
* Get gem history response
|
|
1194
|
+
*/
|
|
1195
|
+
export interface GetGemHistoryResponse {
|
|
1196
|
+
/** History items */
|
|
1197
|
+
items: GemHistoryItem[];
|
|
1198
|
+
/** Total count of items */
|
|
1199
|
+
total: number;
|
|
1200
|
+
/** Pagination info */
|
|
1201
|
+
pagination: {
|
|
1202
|
+
/** Items per page */
|
|
1203
|
+
limit: number;
|
|
1204
|
+
/** Current offset */
|
|
1205
|
+
offset: number;
|
|
1206
|
+
/** Whether more items exist */
|
|
1207
|
+
hasMore: boolean;
|
|
1208
|
+
};
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
/**
|
|
1212
|
+
* Expiring gem batch
|
|
1213
|
+
*/
|
|
1214
|
+
export interface ExpiringGemBatch {
|
|
1215
|
+
/** Batch ID */
|
|
1216
|
+
id: string;
|
|
1217
|
+
/** Remaining gems in batch */
|
|
1218
|
+
amount: number;
|
|
1219
|
+
/** How the gems were earned */
|
|
1220
|
+
source: GemSource;
|
|
1221
|
+
/** When the batch expires */
|
|
1222
|
+
expiresAt: string;
|
|
1223
|
+
/** When the batch was created */
|
|
1224
|
+
createdAt: string;
|
|
1225
|
+
/** Days until expiry */
|
|
1226
|
+
daysUntilExpiry: number;
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
/**
|
|
1230
|
+
* Get expiring gems response
|
|
1231
|
+
*/
|
|
1232
|
+
export interface GetExpiringGemsResponse {
|
|
1233
|
+
/** Total gems expiring within the query period */
|
|
1234
|
+
totalExpiring: number;
|
|
1235
|
+
/** Expiring batches */
|
|
1236
|
+
batches: ExpiringGemBatch[];
|
|
1237
|
+
/** Query parameters used */
|
|
1238
|
+
queryParams: {
|
|
1239
|
+
/** Days ahead that were queried */
|
|
1240
|
+
days: number;
|
|
1241
|
+
};
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
// ============================================================================
|
|
1245
|
+
// Browsing Location Responses
|
|
1246
|
+
// ============================================================================
|
|
1247
|
+
|
|
1248
|
+
/**
|
|
1249
|
+
* User's browsing location for geo-based product filtering
|
|
1250
|
+
*/
|
|
1251
|
+
export interface BrowsingLocation {
|
|
1252
|
+
/** Location ID */
|
|
1253
|
+
id: string;
|
|
1254
|
+
/** Full display address */
|
|
1255
|
+
formattedAddress: string;
|
|
1256
|
+
/** City name */
|
|
1257
|
+
city: string;
|
|
1258
|
+
/** State/Province (if applicable) */
|
|
1259
|
+
stateProvince?: string | null;
|
|
1260
|
+
/** ISO 2-letter country code */
|
|
1261
|
+
country: string;
|
|
1262
|
+
/** Latitude coordinate */
|
|
1263
|
+
latitude: number;
|
|
1264
|
+
/** Longitude coordinate */
|
|
1265
|
+
longitude: number;
|
|
1266
|
+
/** Last updated timestamp */
|
|
1267
|
+
updatedAt: string;
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
/**
|
|
1271
|
+
* Get browsing location response
|
|
1272
|
+
*/
|
|
1273
|
+
export interface GetBrowsingLocationResponse {
|
|
1274
|
+
/** User's saved browsing location (null if not set) */
|
|
1275
|
+
location: BrowsingLocation | null;
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
/**
|
|
1279
|
+
* Save browsing location response
|
|
1280
|
+
*/
|
|
1281
|
+
export interface SaveBrowsingLocationResponse {
|
|
1282
|
+
/** Whether the operation was successful */
|
|
1283
|
+
success: boolean;
|
|
1284
|
+
/** The saved location */
|
|
1285
|
+
location: BrowsingLocation;
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
/**
|
|
1289
|
+
* Delete browsing location response
|
|
1290
|
+
*/
|
|
1291
|
+
export interface DeleteBrowsingLocationResponse {
|
|
1292
|
+
/** Whether the operation was successful */
|
|
1293
|
+
success: boolean;
|
|
1294
|
+
/** Success message */
|
|
1295
|
+
message: string;
|
|
1296
|
+
}
|
|
1297
|
+
|