krawlet-js 1.3.1 → 1.3.3
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 +18 -1
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +1 -0
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -162,6 +162,7 @@ const items = await client.shops.getItems('123');
|
|
|
162
162
|
|
|
163
163
|
// Update a shop (requires ShopSync authentication)
|
|
164
164
|
const shopData = {
|
|
165
|
+
sourceType: 'modem', // Optional: 'modem' (default) or 'radio_tower'
|
|
165
166
|
info: {
|
|
166
167
|
name: 'My Shop',
|
|
167
168
|
description: 'A great shop',
|
|
@@ -189,6 +190,22 @@ const shopData = {
|
|
|
189
190
|
await client.shops.update(shopData, 'kraw_shopsync_token');
|
|
190
191
|
```
|
|
191
192
|
|
|
193
|
+
#### Shop Source Types
|
|
194
|
+
|
|
195
|
+
The `sourceType` field indicates how a shop was added to the system:
|
|
196
|
+
|
|
197
|
+
| Type | Description |
|
|
198
|
+
|------|-------------|
|
|
199
|
+
| `modem` | Shop was added via direct modem connection (default) |
|
|
200
|
+
| `radio_tower` | Shop was added via CC Radio Tower (remote/relay) |
|
|
201
|
+
|
|
202
|
+
```typescript
|
|
203
|
+
import type { Shop, ShopSourceType } from 'krawlet-js';
|
|
204
|
+
|
|
205
|
+
const shop: Shop = await client.shops.get('123');
|
|
206
|
+
console.log(shop.sourceType); // 'modem' or 'radio_tower'
|
|
207
|
+
```
|
|
208
|
+
|
|
192
209
|
### Items
|
|
193
210
|
|
|
194
211
|
Retrieve item listings across all shops.
|
|
@@ -352,7 +369,7 @@ The client automatically retries requests when rate limits are exceeded with exp
|
|
|
352
369
|
The library is written in TypeScript and provides full type definitions.
|
|
353
370
|
|
|
354
371
|
```typescript
|
|
355
|
-
import type { Shop, Item, Player, KrawletError } from 'krawlet-js';
|
|
372
|
+
import type { Shop, Item, Player, ShopSourceType, KrawletError } from 'krawlet-js';
|
|
356
373
|
|
|
357
374
|
// All responses are fully typed
|
|
358
375
|
const shops: Shop[] = await client.shops.getAll();
|
package/dist/index.cjs
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -16,6 +16,7 @@ declare enum ErrorCode {
|
|
|
16
16
|
type KnownAddressType = 'official' | 'shop' | 'gamble' | 'service' | 'company';
|
|
17
17
|
type PlayerNotifications = 'none' | 'self' | 'all';
|
|
18
18
|
type ItemChangeType = 'added' | 'removed';
|
|
19
|
+
type ShopSourceType = 'modem' | 'radio_tower';
|
|
19
20
|
interface Price {
|
|
20
21
|
id: string;
|
|
21
22
|
value: number;
|
|
@@ -49,6 +50,7 @@ interface Shop {
|
|
|
49
50
|
computerId: number;
|
|
50
51
|
softwareName: string | null;
|
|
51
52
|
softwareVersion: string | null;
|
|
53
|
+
sourceType: ShopSourceType;
|
|
52
54
|
locationCoordinates: string | null;
|
|
53
55
|
locationDescription: string | null;
|
|
54
56
|
locationDimension: string | null;
|
|
@@ -112,6 +114,7 @@ interface PriceChangeLog {
|
|
|
112
114
|
updatedAt: string;
|
|
113
115
|
}
|
|
114
116
|
interface ShopSyncData {
|
|
117
|
+
sourceType?: ShopSourceType;
|
|
115
118
|
info: {
|
|
116
119
|
name: string;
|
|
117
120
|
description?: string;
|
|
@@ -467,4 +470,4 @@ declare class KrawletError extends Error {
|
|
|
467
470
|
isRateLimitError(): boolean;
|
|
468
471
|
}
|
|
469
472
|
|
|
470
|
-
export { AddressesResource, type ApiKeyInfo, ApiKeyResource, type ApiKeyTier, type ApiKeyUsage, type ApiResponse, type ApiResponseMeta, type ChangeLogOptions, type ChangeLogResult, type ChatboxServiceInfo, type DetailedHealthResponse, type DiscordServiceInfo, ErrorCode, type ErrorResponse, type HealthChecks, HealthResource, type HealthResponse, type HealthServices, type HealthServicesDetailed, type Item, type ItemChangeLog, type ItemChangeType, ItemsResource, type KnownAddress, type KnownAddressType, KrawletClient, type KrawletClientConfig, KrawletError, type KromerServiceInfo, type Player, type PlayerNotifications, PlayersResource, type Price, type PriceChangeLog, type QuickCodeGenerateResponse, type QuickCodeRedeemResponse, type RateLimit, type ReportRecords, ReportsResource, type RequestLog, type RequestLogsResponse, type ServiceInfo, type ServiceName, type ServiceStatus, type Shop, type ShopChangeLog, type ShopSyncData, ShopsResource, type StorageData, StorageResource };
|
|
473
|
+
export { AddressesResource, type ApiKeyInfo, ApiKeyResource, type ApiKeyTier, type ApiKeyUsage, type ApiResponse, type ApiResponseMeta, type ChangeLogOptions, type ChangeLogResult, type ChatboxServiceInfo, type DetailedHealthResponse, type DiscordServiceInfo, ErrorCode, type ErrorResponse, type HealthChecks, HealthResource, type HealthResponse, type HealthServices, type HealthServicesDetailed, type Item, type ItemChangeLog, type ItemChangeType, ItemsResource, type KnownAddress, type KnownAddressType, KrawletClient, type KrawletClientConfig, KrawletError, type KromerServiceInfo, type Player, type PlayerNotifications, PlayersResource, type Price, type PriceChangeLog, type QuickCodeGenerateResponse, type QuickCodeRedeemResponse, type RateLimit, type ReportRecords, ReportsResource, type RequestLog, type RequestLogsResponse, type ServiceInfo, type ServiceName, type ServiceStatus, type Shop, type ShopChangeLog, type ShopSourceType, type ShopSyncData, ShopsResource, type StorageData, StorageResource };
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ declare enum ErrorCode {
|
|
|
16
16
|
type KnownAddressType = 'official' | 'shop' | 'gamble' | 'service' | 'company';
|
|
17
17
|
type PlayerNotifications = 'none' | 'self' | 'all';
|
|
18
18
|
type ItemChangeType = 'added' | 'removed';
|
|
19
|
+
type ShopSourceType = 'modem' | 'radio_tower';
|
|
19
20
|
interface Price {
|
|
20
21
|
id: string;
|
|
21
22
|
value: number;
|
|
@@ -49,6 +50,7 @@ interface Shop {
|
|
|
49
50
|
computerId: number;
|
|
50
51
|
softwareName: string | null;
|
|
51
52
|
softwareVersion: string | null;
|
|
53
|
+
sourceType: ShopSourceType;
|
|
52
54
|
locationCoordinates: string | null;
|
|
53
55
|
locationDescription: string | null;
|
|
54
56
|
locationDimension: string | null;
|
|
@@ -112,6 +114,7 @@ interface PriceChangeLog {
|
|
|
112
114
|
updatedAt: string;
|
|
113
115
|
}
|
|
114
116
|
interface ShopSyncData {
|
|
117
|
+
sourceType?: ShopSourceType;
|
|
115
118
|
info: {
|
|
116
119
|
name: string;
|
|
117
120
|
description?: string;
|
|
@@ -467,4 +470,4 @@ declare class KrawletError extends Error {
|
|
|
467
470
|
isRateLimitError(): boolean;
|
|
468
471
|
}
|
|
469
472
|
|
|
470
|
-
export { AddressesResource, type ApiKeyInfo, ApiKeyResource, type ApiKeyTier, type ApiKeyUsage, type ApiResponse, type ApiResponseMeta, type ChangeLogOptions, type ChangeLogResult, type ChatboxServiceInfo, type DetailedHealthResponse, type DiscordServiceInfo, ErrorCode, type ErrorResponse, type HealthChecks, HealthResource, type HealthResponse, type HealthServices, type HealthServicesDetailed, type Item, type ItemChangeLog, type ItemChangeType, ItemsResource, type KnownAddress, type KnownAddressType, KrawletClient, type KrawletClientConfig, KrawletError, type KromerServiceInfo, type Player, type PlayerNotifications, PlayersResource, type Price, type PriceChangeLog, type QuickCodeGenerateResponse, type QuickCodeRedeemResponse, type RateLimit, type ReportRecords, ReportsResource, type RequestLog, type RequestLogsResponse, type ServiceInfo, type ServiceName, type ServiceStatus, type Shop, type ShopChangeLog, type ShopSyncData, ShopsResource, type StorageData, StorageResource };
|
|
473
|
+
export { AddressesResource, type ApiKeyInfo, ApiKeyResource, type ApiKeyTier, type ApiKeyUsage, type ApiResponse, type ApiResponseMeta, type ChangeLogOptions, type ChangeLogResult, type ChatboxServiceInfo, type DetailedHealthResponse, type DiscordServiceInfo, ErrorCode, type ErrorResponse, type HealthChecks, HealthResource, type HealthResponse, type HealthServices, type HealthServicesDetailed, type Item, type ItemChangeLog, type ItemChangeType, ItemsResource, type KnownAddress, type KnownAddressType, KrawletClient, type KrawletClientConfig, KrawletError, type KromerServiceInfo, type Player, type PlayerNotifications, PlayersResource, type Price, type PriceChangeLog, type QuickCodeGenerateResponse, type QuickCodeRedeemResponse, type RateLimit, type ReportRecords, ReportsResource, type RequestLog, type RequestLogsResponse, type ServiceInfo, type ServiceName, type ServiceStatus, type Shop, type ShopChangeLog, type ShopSourceType, type ShopSyncData, ShopsResource, type StorageData, StorageResource };
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "krawlet-js",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "TypeScript/JavaScript client library for the Krawlet Minecraft economy tracking API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -44,8 +44,9 @@
|
|
|
44
44
|
"build": "tsup src/index.ts --format cjs,esm --dts --clean",
|
|
45
45
|
"dev": "tsup src/index.ts --format cjs,esm --dts --watch",
|
|
46
46
|
"test": "vitest",
|
|
47
|
-
"test:coverage": "
|
|
47
|
+
"test:coverage": "vitest run --coverage",
|
|
48
48
|
"lint": "eslint src --ext .ts",
|
|
49
|
-
"format": "prettier --write \"src/**/*.ts\""
|
|
49
|
+
"format": "prettier --write \"src/**/*.ts\"",
|
|
50
|
+
"version": "node -e \"const v = require('./package.json').version; require('fs').writeFileSync('./src/version.ts', '/** Package version */\\nexport const VERSION = \\'' + v + '\\';\\n')\" && git add src/version.ts"
|
|
50
51
|
}
|
|
51
52
|
}
|