krawlet-js 2.0.1 → 2.1.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.cjs +83 -2
- package/dist/index.d.cts +73 -1
- package/dist/index.d.ts +73 -1
- package/dist/index.js +81 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -30,7 +30,8 @@ __export(index_exports, {
|
|
|
30
30
|
PlayersResource: () => PlayersResource,
|
|
31
31
|
ReportsResource: () => ReportsResource,
|
|
32
32
|
ShopsResource: () => ShopsResource,
|
|
33
|
-
StorageResource: () => StorageResource
|
|
33
|
+
StorageResource: () => StorageResource,
|
|
34
|
+
TransfersResource: () => TransfersResource
|
|
34
35
|
});
|
|
35
36
|
module.exports = __toCommonJS(index_exports);
|
|
36
37
|
|
|
@@ -749,6 +750,84 @@ var ApiKeyResource = class {
|
|
|
749
750
|
}
|
|
750
751
|
};
|
|
751
752
|
|
|
753
|
+
// src/resources/transfers.ts
|
|
754
|
+
var TransfersResource = class {
|
|
755
|
+
constructor(client) {
|
|
756
|
+
this.client = client;
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* List all transfers where the authenticated player is sender or recipient
|
|
760
|
+
* @returns Array of transfer records
|
|
761
|
+
*/
|
|
762
|
+
async getAll() {
|
|
763
|
+
const response = await this.client.request("/v1/transfers");
|
|
764
|
+
return response.data;
|
|
765
|
+
}
|
|
766
|
+
/**
|
|
767
|
+
* Queue a new transfer request
|
|
768
|
+
* @param data - Transfer request payload
|
|
769
|
+
* @returns Transfer record
|
|
770
|
+
*/
|
|
771
|
+
async create(data) {
|
|
772
|
+
const response = await this.client.request("/v1/transfers", {
|
|
773
|
+
method: "POST",
|
|
774
|
+
body: data
|
|
775
|
+
});
|
|
776
|
+
return response.data;
|
|
777
|
+
}
|
|
778
|
+
/**
|
|
779
|
+
* Retrieve transfer details by ID
|
|
780
|
+
* @param transferId - Transfer UUID
|
|
781
|
+
* @returns Transfer record
|
|
782
|
+
*/
|
|
783
|
+
async get(transferId) {
|
|
784
|
+
const response = await this.client.request(`/v1/transfers/${transferId}`);
|
|
785
|
+
return response.data;
|
|
786
|
+
}
|
|
787
|
+
/**
|
|
788
|
+
* Cancel a pending or in-progress transfer
|
|
789
|
+
* @param transferId - Transfer UUID
|
|
790
|
+
* @returns Updated transfer record
|
|
791
|
+
*/
|
|
792
|
+
async cancel(transferId) {
|
|
793
|
+
const response = await this.client.request(`/v1/transfers/${transferId}/cancel`, {
|
|
794
|
+
method: "POST"
|
|
795
|
+
});
|
|
796
|
+
return response.data;
|
|
797
|
+
}
|
|
798
|
+
/**
|
|
799
|
+
* Get current ender storage contents for the authenticated player
|
|
800
|
+
* @returns Contents snapshot
|
|
801
|
+
*/
|
|
802
|
+
async getContents() {
|
|
803
|
+
const response = await this.client.request("/v1/transfers/contents");
|
|
804
|
+
return response.data;
|
|
805
|
+
}
|
|
806
|
+
/**
|
|
807
|
+
* List active transfer targets available to the authenticated user
|
|
808
|
+
* @returns Array of transfer targets
|
|
809
|
+
*/
|
|
810
|
+
async getTargets() {
|
|
811
|
+
const response = await this.client.request("/v1/transfers/targets");
|
|
812
|
+
return response.data;
|
|
813
|
+
}
|
|
814
|
+
/**
|
|
815
|
+
* Request transfer from public/service storage into the authenticated player's storage
|
|
816
|
+
* @param data - Public storage transfer payload
|
|
817
|
+
* @returns Transfer and resolved source entity information
|
|
818
|
+
*/
|
|
819
|
+
async requestPublicStorage(data) {
|
|
820
|
+
const response = await this.client.request(
|
|
821
|
+
"/v1/requests/public-storage",
|
|
822
|
+
{
|
|
823
|
+
method: "POST",
|
|
824
|
+
body: data
|
|
825
|
+
}
|
|
826
|
+
);
|
|
827
|
+
return response.data;
|
|
828
|
+
}
|
|
829
|
+
};
|
|
830
|
+
|
|
752
831
|
// src/client.ts
|
|
753
832
|
var KrawletClient = class {
|
|
754
833
|
/**
|
|
@@ -774,6 +853,7 @@ var KrawletClient = class {
|
|
|
774
853
|
this.storage = new StorageResource(this.httpClient);
|
|
775
854
|
this.reports = new ReportsResource(this.httpClient);
|
|
776
855
|
this.apiKey = new ApiKeyResource(this.httpClient);
|
|
856
|
+
this.transfers = new TransfersResource(this.httpClient);
|
|
777
857
|
}
|
|
778
858
|
/**
|
|
779
859
|
* Get the last known rate limit information
|
|
@@ -813,5 +893,6 @@ var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => {
|
|
|
813
893
|
PlayersResource,
|
|
814
894
|
ReportsResource,
|
|
815
895
|
ShopsResource,
|
|
816
|
-
StorageResource
|
|
896
|
+
StorageResource,
|
|
897
|
+
TransfersResource
|
|
817
898
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -396,6 +396,65 @@ interface StorageData {
|
|
|
396
396
|
data: EnderStorageChest[];
|
|
397
397
|
retrievedAt: string;
|
|
398
398
|
}
|
|
399
|
+
interface StorageSlotItem {
|
|
400
|
+
name: string;
|
|
401
|
+
count: number;
|
|
402
|
+
nbt?: string | null;
|
|
403
|
+
}
|
|
404
|
+
interface StorageSlotContents {
|
|
405
|
+
items: StorageSlotItem[];
|
|
406
|
+
}
|
|
407
|
+
interface TransferTargetLink {
|
|
408
|
+
type: string;
|
|
409
|
+
value: string;
|
|
410
|
+
}
|
|
411
|
+
interface TransferTarget {
|
|
412
|
+
id: string;
|
|
413
|
+
name: string;
|
|
414
|
+
type: string;
|
|
415
|
+
links: TransferTargetLink[];
|
|
416
|
+
}
|
|
417
|
+
type TransferStatus = 'pending' | 'in_progress' | 'completed' | 'failed' | 'cancelled';
|
|
418
|
+
interface Transfer {
|
|
419
|
+
id: string;
|
|
420
|
+
status: TransferStatus;
|
|
421
|
+
error: string | null;
|
|
422
|
+
workerId?: number | null;
|
|
423
|
+
fromUUID: string;
|
|
424
|
+
fromUsername: string;
|
|
425
|
+
toUUID: string;
|
|
426
|
+
toUsername: string;
|
|
427
|
+
itemName: string | null;
|
|
428
|
+
itemNbt: string | null;
|
|
429
|
+
quantity: number | null;
|
|
430
|
+
quantityTransferred: number;
|
|
431
|
+
timestamp: string;
|
|
432
|
+
}
|
|
433
|
+
interface TransferCreateRequest {
|
|
434
|
+
to: string;
|
|
435
|
+
itemName?: string;
|
|
436
|
+
itemNbt?: string;
|
|
437
|
+
quantity?: number;
|
|
438
|
+
timeout?: number;
|
|
439
|
+
}
|
|
440
|
+
interface PublicStorageSourceEntity {
|
|
441
|
+
id: string;
|
|
442
|
+
name: string;
|
|
443
|
+
type: string;
|
|
444
|
+
alias?: string;
|
|
445
|
+
}
|
|
446
|
+
interface PublicStorageTransferRequest {
|
|
447
|
+
itemName: string;
|
|
448
|
+
itemNbt?: string;
|
|
449
|
+
quantity: number;
|
|
450
|
+
timeout?: number;
|
|
451
|
+
source?: string;
|
|
452
|
+
colors?: [number, number, number];
|
|
453
|
+
}
|
|
454
|
+
interface PublicStorageTransferResponse {
|
|
455
|
+
transfer: Transfer;
|
|
456
|
+
sourceEntity: PublicStorageSourceEntity;
|
|
457
|
+
}
|
|
399
458
|
interface ReportRecords<TRecord = unknown> {
|
|
400
459
|
count: number;
|
|
401
460
|
records: TRecord[];
|
|
@@ -558,6 +617,18 @@ declare class ApiKeyResource {
|
|
|
558
617
|
redeemQuickCode(code: string): Promise<QuickCodeRedeemResponse>;
|
|
559
618
|
}
|
|
560
619
|
|
|
620
|
+
declare class TransfersResource {
|
|
621
|
+
private client;
|
|
622
|
+
constructor(client: HttpClient);
|
|
623
|
+
getAll(): Promise<Transfer[]>;
|
|
624
|
+
create(data: TransferCreateRequest): Promise<Transfer>;
|
|
625
|
+
get(transferId: string): Promise<Transfer>;
|
|
626
|
+
cancel(transferId: string): Promise<Transfer>;
|
|
627
|
+
getContents(): Promise<StorageSlotContents>;
|
|
628
|
+
getTargets(): Promise<TransferTarget[]>;
|
|
629
|
+
requestPublicStorage(data: PublicStorageTransferRequest): Promise<PublicStorageTransferResponse>;
|
|
630
|
+
}
|
|
631
|
+
|
|
561
632
|
interface KrawletClientConfig {
|
|
562
633
|
baseUrl?: string;
|
|
563
634
|
apiKey?: string;
|
|
@@ -577,6 +648,7 @@ declare class KrawletClient {
|
|
|
577
648
|
readonly storage: StorageResource;
|
|
578
649
|
readonly reports: ReportsResource;
|
|
579
650
|
readonly apiKey: ApiKeyResource;
|
|
651
|
+
readonly transfers: TransfersResource;
|
|
580
652
|
constructor(config?: KrawletClientConfig);
|
|
581
653
|
getRateLimit(): RateLimit | undefined;
|
|
582
654
|
}
|
|
@@ -593,4 +665,4 @@ declare class KrawletError extends Error {
|
|
|
593
665
|
isRateLimitError(): boolean;
|
|
594
666
|
}
|
|
595
667
|
|
|
596
|
-
export { AddressesResource, type ApiKeyInfo, ApiKeyResource, type ApiKeyTier, type ApiKeyUsage, type ApiResponse, type ApiResponseMeta, type BaseQueryParams, type ChangeLogOptions, type ChangeLogResult, type ChatboxServiceInfo, type DetailedHealthResponse, type DiscordServiceInfo, type EnderStorageApiPayload, type EnderStorageChest, type EnderStorageCollection, type EnderStorageColor, type EnderStorageItem, type EnderStorageMeta, type EnderStoragePayload, ErrorCode, type ErrorResponse, type HealthChecks, HealthResource, type HealthResponse, type HealthServices, type HealthServicesDetailed, type Item, type ItemChangeLog, type ItemChangeLogResponse, type ItemChangeRecord, type ItemChangeType, type ItemChangesParams, type ItemSummary, type ItemUpdateSummary, ItemsResource, type KnownAddress, type KnownAddressType, KrawletClient, type KrawletClientConfig, KrawletError, type KromerServiceInfo, type Player, type PlayerNotifications, PlayersResource, type Price, type PriceChangeLog, type PriceChangeLogResponse, type PriceChangesParams, type QuickCodeGenerateResponse, type QuickCodeRedeemResponse, type RateLimit, type ReportRecords, type ReporterStats, ReportsResource, type RequestLog, type RequestLogsResponse, type ServiceInfo, type ServiceName, type ServiceStatus, type Shop, type ShopChangeField, type ShopChangeLog, type ShopChangeLogResponse, type ShopChangeRecord, type ShopChangesParams, type ShopSourceType, type ShopSyncData, ShopsResource, type StorageData, StorageResource, type SuccessfulPostRecord, type ValidationFailureRecord };
|
|
668
|
+
export { AddressesResource, type ApiKeyInfo, ApiKeyResource, type ApiKeyTier, type ApiKeyUsage, type ApiResponse, type ApiResponseMeta, type BaseQueryParams, type ChangeLogOptions, type ChangeLogResult, type ChatboxServiceInfo, type DetailedHealthResponse, type DiscordServiceInfo, type EnderStorageApiPayload, type EnderStorageChest, type EnderStorageCollection, type EnderStorageColor, type EnderStorageItem, type EnderStorageMeta, type EnderStoragePayload, ErrorCode, type ErrorResponse, type HealthChecks, HealthResource, type HealthResponse, type HealthServices, type HealthServicesDetailed, type Item, type ItemChangeLog, type ItemChangeLogResponse, type ItemChangeRecord, type ItemChangeType, type ItemChangesParams, type ItemSummary, type ItemUpdateSummary, ItemsResource, type KnownAddress, type KnownAddressType, KrawletClient, type KrawletClientConfig, KrawletError, type KromerServiceInfo, type Player, type PlayerNotifications, PlayersResource, type Price, type PriceChangeLog, type PriceChangeLogResponse, type PriceChangesParams, type PublicStorageSourceEntity, type PublicStorageTransferRequest, type PublicStorageTransferResponse, type QuickCodeGenerateResponse, type QuickCodeRedeemResponse, type RateLimit, type ReportRecords, type ReporterStats, ReportsResource, type RequestLog, type RequestLogsResponse, type ServiceInfo, type ServiceName, type ServiceStatus, type Shop, type ShopChangeField, type ShopChangeLog, type ShopChangeLogResponse, type ShopChangeRecord, type ShopChangesParams, type ShopSourceType, type ShopSyncData, ShopsResource, type StorageData, StorageResource, type StorageSlotContents, type StorageSlotItem, type SuccessfulPostRecord, type Transfer, type TransferCreateRequest, type TransferStatus, type TransferTarget, type TransferTargetLink, TransfersResource, type ValidationFailureRecord };
|
package/dist/index.d.ts
CHANGED
|
@@ -396,6 +396,65 @@ interface StorageData {
|
|
|
396
396
|
data: EnderStorageChest[];
|
|
397
397
|
retrievedAt: string;
|
|
398
398
|
}
|
|
399
|
+
interface StorageSlotItem {
|
|
400
|
+
name: string;
|
|
401
|
+
count: number;
|
|
402
|
+
nbt?: string | null;
|
|
403
|
+
}
|
|
404
|
+
interface StorageSlotContents {
|
|
405
|
+
items: StorageSlotItem[];
|
|
406
|
+
}
|
|
407
|
+
interface TransferTargetLink {
|
|
408
|
+
type: string;
|
|
409
|
+
value: string;
|
|
410
|
+
}
|
|
411
|
+
interface TransferTarget {
|
|
412
|
+
id: string;
|
|
413
|
+
name: string;
|
|
414
|
+
type: string;
|
|
415
|
+
links: TransferTargetLink[];
|
|
416
|
+
}
|
|
417
|
+
type TransferStatus = 'pending' | 'in_progress' | 'completed' | 'failed' | 'cancelled';
|
|
418
|
+
interface Transfer {
|
|
419
|
+
id: string;
|
|
420
|
+
status: TransferStatus;
|
|
421
|
+
error: string | null;
|
|
422
|
+
workerId?: number | null;
|
|
423
|
+
fromUUID: string;
|
|
424
|
+
fromUsername: string;
|
|
425
|
+
toUUID: string;
|
|
426
|
+
toUsername: string;
|
|
427
|
+
itemName: string | null;
|
|
428
|
+
itemNbt: string | null;
|
|
429
|
+
quantity: number | null;
|
|
430
|
+
quantityTransferred: number;
|
|
431
|
+
timestamp: string;
|
|
432
|
+
}
|
|
433
|
+
interface TransferCreateRequest {
|
|
434
|
+
to: string;
|
|
435
|
+
itemName?: string;
|
|
436
|
+
itemNbt?: string;
|
|
437
|
+
quantity?: number;
|
|
438
|
+
timeout?: number;
|
|
439
|
+
}
|
|
440
|
+
interface PublicStorageSourceEntity {
|
|
441
|
+
id: string;
|
|
442
|
+
name: string;
|
|
443
|
+
type: string;
|
|
444
|
+
alias?: string;
|
|
445
|
+
}
|
|
446
|
+
interface PublicStorageTransferRequest {
|
|
447
|
+
itemName: string;
|
|
448
|
+
itemNbt?: string;
|
|
449
|
+
quantity: number;
|
|
450
|
+
timeout?: number;
|
|
451
|
+
source?: string;
|
|
452
|
+
colors?: [number, number, number];
|
|
453
|
+
}
|
|
454
|
+
interface PublicStorageTransferResponse {
|
|
455
|
+
transfer: Transfer;
|
|
456
|
+
sourceEntity: PublicStorageSourceEntity;
|
|
457
|
+
}
|
|
399
458
|
interface ReportRecords<TRecord = unknown> {
|
|
400
459
|
count: number;
|
|
401
460
|
records: TRecord[];
|
|
@@ -558,6 +617,18 @@ declare class ApiKeyResource {
|
|
|
558
617
|
redeemQuickCode(code: string): Promise<QuickCodeRedeemResponse>;
|
|
559
618
|
}
|
|
560
619
|
|
|
620
|
+
declare class TransfersResource {
|
|
621
|
+
private client;
|
|
622
|
+
constructor(client: HttpClient);
|
|
623
|
+
getAll(): Promise<Transfer[]>;
|
|
624
|
+
create(data: TransferCreateRequest): Promise<Transfer>;
|
|
625
|
+
get(transferId: string): Promise<Transfer>;
|
|
626
|
+
cancel(transferId: string): Promise<Transfer>;
|
|
627
|
+
getContents(): Promise<StorageSlotContents>;
|
|
628
|
+
getTargets(): Promise<TransferTarget[]>;
|
|
629
|
+
requestPublicStorage(data: PublicStorageTransferRequest): Promise<PublicStorageTransferResponse>;
|
|
630
|
+
}
|
|
631
|
+
|
|
561
632
|
interface KrawletClientConfig {
|
|
562
633
|
baseUrl?: string;
|
|
563
634
|
apiKey?: string;
|
|
@@ -577,6 +648,7 @@ declare class KrawletClient {
|
|
|
577
648
|
readonly storage: StorageResource;
|
|
578
649
|
readonly reports: ReportsResource;
|
|
579
650
|
readonly apiKey: ApiKeyResource;
|
|
651
|
+
readonly transfers: TransfersResource;
|
|
580
652
|
constructor(config?: KrawletClientConfig);
|
|
581
653
|
getRateLimit(): RateLimit | undefined;
|
|
582
654
|
}
|
|
@@ -593,4 +665,4 @@ declare class KrawletError extends Error {
|
|
|
593
665
|
isRateLimitError(): boolean;
|
|
594
666
|
}
|
|
595
667
|
|
|
596
|
-
export { AddressesResource, type ApiKeyInfo, ApiKeyResource, type ApiKeyTier, type ApiKeyUsage, type ApiResponse, type ApiResponseMeta, type BaseQueryParams, type ChangeLogOptions, type ChangeLogResult, type ChatboxServiceInfo, type DetailedHealthResponse, type DiscordServiceInfo, type EnderStorageApiPayload, type EnderStorageChest, type EnderStorageCollection, type EnderStorageColor, type EnderStorageItem, type EnderStorageMeta, type EnderStoragePayload, ErrorCode, type ErrorResponse, type HealthChecks, HealthResource, type HealthResponse, type HealthServices, type HealthServicesDetailed, type Item, type ItemChangeLog, type ItemChangeLogResponse, type ItemChangeRecord, type ItemChangeType, type ItemChangesParams, type ItemSummary, type ItemUpdateSummary, ItemsResource, type KnownAddress, type KnownAddressType, KrawletClient, type KrawletClientConfig, KrawletError, type KromerServiceInfo, type Player, type PlayerNotifications, PlayersResource, type Price, type PriceChangeLog, type PriceChangeLogResponse, type PriceChangesParams, type QuickCodeGenerateResponse, type QuickCodeRedeemResponse, type RateLimit, type ReportRecords, type ReporterStats, ReportsResource, type RequestLog, type RequestLogsResponse, type ServiceInfo, type ServiceName, type ServiceStatus, type Shop, type ShopChangeField, type ShopChangeLog, type ShopChangeLogResponse, type ShopChangeRecord, type ShopChangesParams, type ShopSourceType, type ShopSyncData, ShopsResource, type StorageData, StorageResource, type SuccessfulPostRecord, type ValidationFailureRecord };
|
|
668
|
+
export { AddressesResource, type ApiKeyInfo, ApiKeyResource, type ApiKeyTier, type ApiKeyUsage, type ApiResponse, type ApiResponseMeta, type BaseQueryParams, type ChangeLogOptions, type ChangeLogResult, type ChatboxServiceInfo, type DetailedHealthResponse, type DiscordServiceInfo, type EnderStorageApiPayload, type EnderStorageChest, type EnderStorageCollection, type EnderStorageColor, type EnderStorageItem, type EnderStorageMeta, type EnderStoragePayload, ErrorCode, type ErrorResponse, type HealthChecks, HealthResource, type HealthResponse, type HealthServices, type HealthServicesDetailed, type Item, type ItemChangeLog, type ItemChangeLogResponse, type ItemChangeRecord, type ItemChangeType, type ItemChangesParams, type ItemSummary, type ItemUpdateSummary, ItemsResource, type KnownAddress, type KnownAddressType, KrawletClient, type KrawletClientConfig, KrawletError, type KromerServiceInfo, type Player, type PlayerNotifications, PlayersResource, type Price, type PriceChangeLog, type PriceChangeLogResponse, type PriceChangesParams, type PublicStorageSourceEntity, type PublicStorageTransferRequest, type PublicStorageTransferResponse, type QuickCodeGenerateResponse, type QuickCodeRedeemResponse, type RateLimit, type ReportRecords, type ReporterStats, ReportsResource, type RequestLog, type RequestLogsResponse, type ServiceInfo, type ServiceName, type ServiceStatus, type Shop, type ShopChangeField, type ShopChangeLog, type ShopChangeLogResponse, type ShopChangeRecord, type ShopChangesParams, type ShopSourceType, type ShopSyncData, ShopsResource, type StorageData, StorageResource, type StorageSlotContents, type StorageSlotItem, type SuccessfulPostRecord, type Transfer, type TransferCreateRequest, type TransferStatus, type TransferTarget, type TransferTargetLink, TransfersResource, type ValidationFailureRecord };
|
package/dist/index.js
CHANGED
|
@@ -713,6 +713,84 @@ var ApiKeyResource = class {
|
|
|
713
713
|
}
|
|
714
714
|
};
|
|
715
715
|
|
|
716
|
+
// src/resources/transfers.ts
|
|
717
|
+
var TransfersResource = class {
|
|
718
|
+
constructor(client) {
|
|
719
|
+
this.client = client;
|
|
720
|
+
}
|
|
721
|
+
/**
|
|
722
|
+
* List all transfers where the authenticated player is sender or recipient
|
|
723
|
+
* @returns Array of transfer records
|
|
724
|
+
*/
|
|
725
|
+
async getAll() {
|
|
726
|
+
const response = await this.client.request("/v1/transfers");
|
|
727
|
+
return response.data;
|
|
728
|
+
}
|
|
729
|
+
/**
|
|
730
|
+
* Queue a new transfer request
|
|
731
|
+
* @param data - Transfer request payload
|
|
732
|
+
* @returns Transfer record
|
|
733
|
+
*/
|
|
734
|
+
async create(data) {
|
|
735
|
+
const response = await this.client.request("/v1/transfers", {
|
|
736
|
+
method: "POST",
|
|
737
|
+
body: data
|
|
738
|
+
});
|
|
739
|
+
return response.data;
|
|
740
|
+
}
|
|
741
|
+
/**
|
|
742
|
+
* Retrieve transfer details by ID
|
|
743
|
+
* @param transferId - Transfer UUID
|
|
744
|
+
* @returns Transfer record
|
|
745
|
+
*/
|
|
746
|
+
async get(transferId) {
|
|
747
|
+
const response = await this.client.request(`/v1/transfers/${transferId}`);
|
|
748
|
+
return response.data;
|
|
749
|
+
}
|
|
750
|
+
/**
|
|
751
|
+
* Cancel a pending or in-progress transfer
|
|
752
|
+
* @param transferId - Transfer UUID
|
|
753
|
+
* @returns Updated transfer record
|
|
754
|
+
*/
|
|
755
|
+
async cancel(transferId) {
|
|
756
|
+
const response = await this.client.request(`/v1/transfers/${transferId}/cancel`, {
|
|
757
|
+
method: "POST"
|
|
758
|
+
});
|
|
759
|
+
return response.data;
|
|
760
|
+
}
|
|
761
|
+
/**
|
|
762
|
+
* Get current ender storage contents for the authenticated player
|
|
763
|
+
* @returns Contents snapshot
|
|
764
|
+
*/
|
|
765
|
+
async getContents() {
|
|
766
|
+
const response = await this.client.request("/v1/transfers/contents");
|
|
767
|
+
return response.data;
|
|
768
|
+
}
|
|
769
|
+
/**
|
|
770
|
+
* List active transfer targets available to the authenticated user
|
|
771
|
+
* @returns Array of transfer targets
|
|
772
|
+
*/
|
|
773
|
+
async getTargets() {
|
|
774
|
+
const response = await this.client.request("/v1/transfers/targets");
|
|
775
|
+
return response.data;
|
|
776
|
+
}
|
|
777
|
+
/**
|
|
778
|
+
* Request transfer from public/service storage into the authenticated player's storage
|
|
779
|
+
* @param data - Public storage transfer payload
|
|
780
|
+
* @returns Transfer and resolved source entity information
|
|
781
|
+
*/
|
|
782
|
+
async requestPublicStorage(data) {
|
|
783
|
+
const response = await this.client.request(
|
|
784
|
+
"/v1/requests/public-storage",
|
|
785
|
+
{
|
|
786
|
+
method: "POST",
|
|
787
|
+
body: data
|
|
788
|
+
}
|
|
789
|
+
);
|
|
790
|
+
return response.data;
|
|
791
|
+
}
|
|
792
|
+
};
|
|
793
|
+
|
|
716
794
|
// src/client.ts
|
|
717
795
|
var KrawletClient = class {
|
|
718
796
|
/**
|
|
@@ -738,6 +816,7 @@ var KrawletClient = class {
|
|
|
738
816
|
this.storage = new StorageResource(this.httpClient);
|
|
739
817
|
this.reports = new ReportsResource(this.httpClient);
|
|
740
818
|
this.apiKey = new ApiKeyResource(this.httpClient);
|
|
819
|
+
this.transfers = new TransfersResource(this.httpClient);
|
|
741
820
|
}
|
|
742
821
|
/**
|
|
743
822
|
* Get the last known rate limit information
|
|
@@ -776,5 +855,6 @@ export {
|
|
|
776
855
|
PlayersResource,
|
|
777
856
|
ReportsResource,
|
|
778
857
|
ShopsResource,
|
|
779
|
-
StorageResource
|
|
858
|
+
StorageResource,
|
|
859
|
+
TransfersResource
|
|
780
860
|
};
|