swcombine.js 0.0.1
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/LICENSE +21 -0
- package/README +97 -0
- package/dist/index.cjs.js +21 -0
- package/dist/index.d.mts +33 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +21 -0
- package/dist/permissions.d.ts +289 -0
- package/dist/permissions.d.ts.map +1 -0
- package/dist/resources/ApiResource.d.ts +7 -0
- package/dist/resources/ApiResource.d.ts.map +1 -0
- package/dist/resources/Resource.d.ts +6 -0
- package/dist/resources/Resource.d.ts.map +1 -0
- package/dist/resources/index.d.ts +3 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/responses/SwcApiResponse.d.ts +8 -0
- package/dist/responses/SwcApiResponse.d.ts.map +1 -0
- package/dist/responses/api/getPermissionsResponse.d.ts +17 -0
- package/dist/responses/api/getPermissionsResponse.d.ts.map +1 -0
- package/dist/responses/api/index.d.ts +2 -0
- package/dist/responses/api/index.d.ts.map +1 -0
- package/dist/responses/index.d.ts +3 -0
- package/dist/responses/index.d.ts.map +1 -0
- package/dist/types/Permission.d.ts +7 -0
- package/dist/types/Permission.d.ts.map +1 -0
- package/dist/types/SwcTimestamp.d.ts +34 -0
- package/dist/types/SwcTimestamp.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +75 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Jordy de Koning
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Star Wars Combine Web Services 2.0 JS/TS SDK
|
|
2
|
+
|
|
3
|
+
Typescript and Javascript SDK for the Star Wars Combine 2.0 Web Services.
|
|
4
|
+
The SDK is currently a WIP. Status is as follows:
|
|
5
|
+
|
|
6
|
+
## API SDK Status
|
|
7
|
+
|
|
8
|
+
- :x: = Not yet implemented
|
|
9
|
+
- :construction: = Partially implemented
|
|
10
|
+
- :heavy_check_mark: = Implemented
|
|
11
|
+
- :white_check_mark: = Implemented and covered by tests
|
|
12
|
+
|
|
13
|
+
| Endpoint | Status | Availability | OAuth scope required (if applicable) |
|
|
14
|
+
| ------------------------------------------ | ------------------ | ---------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
15
|
+
| **<h3>OAuth</h3>** | :x: | Public | |
|
|
16
|
+
| Get token using server flow (node.js only) | :x: | Public | |
|
|
17
|
+
| Get token using client flow (browser only) | :x: | Public | |
|
|
18
|
+
| Get granted permissions | :x: | OAuth :lock: | |
|
|
19
|
+
| **<h3>Permissions</h3>** | :x: | | |
|
|
20
|
+
| List permissions | :heavy_check_mark: | Public | |
|
|
21
|
+
| **<h3>Rate Limits</h3>** | :x: | | |
|
|
22
|
+
| List rate limits | :x: | Public | |
|
|
23
|
+
| **<h3>Time</h3>** | :white_check_mark: | | |
|
|
24
|
+
| Get current SWC time | :white_check_mark: | Public/on device | |
|
|
25
|
+
| Convert between SWC and Unix time | :white_check_mark: | Public/on device | |
|
|
26
|
+
| Convert between SWC time and Date objects | :white_check_mark: | Public/on device | |
|
|
27
|
+
| **<h3>Character</h3>** | :x: | | |
|
|
28
|
+
| Get character info | :x: | OAuth :lock: | character_read |
|
|
29
|
+
| Get character's credits | :x: | OAuth :lock: | character_credits |
|
|
30
|
+
| Get character's creditlog | :x: | OAuth :lock: | character_credits |
|
|
31
|
+
| Get UID by handle(handlecheck) | :x: | Public | |
|
|
32
|
+
| List received messages | :x: | OAuth :lock: | messages_read |
|
|
33
|
+
| List sent messages | :x: | OAuth :lock: | messages_read |
|
|
34
|
+
| Send message from character | :x: | OAuth :lock: | messages_send |
|
|
35
|
+
| Get message by id | :x: | OAUth :lock: | messages_read |
|
|
36
|
+
| Delete message by id | :x: | OAuth :lock: | messages_delete |
|
|
37
|
+
| Get character's skills | :x: | OAuth :lock: | character_skills |
|
|
38
|
+
| List character's privileges | :x: | OAuth :lock: | character_privileges |
|
|
39
|
+
| Check if character has privilege | :x: | OAuth :lock: | character_privileges, and must be logged in as someone that can view the privileges of others. |
|
|
40
|
+
| Grant privilege to a character | :x: | OAuth :lock: | character_privileges, and must be logged in as someone that has the ability to grant privileges to others. |
|
|
41
|
+
| Revoke privilege from character | :x: | OAuth :lock: | character_privileges, and must be logged in as someone that can grant/revoke privileges of others. |
|
|
42
|
+
| **<h3>Datacard</h3>** | :x: | | |
|
|
43
|
+
| List datacards | :x: | OAuth :lock: | faction_datacards_read |
|
|
44
|
+
| Get datacard | :x: | OAuth :lock: | faction_datacards_read |
|
|
45
|
+
| Assign datacard | :x: | OAuth :lock: | faction_datacards_write |
|
|
46
|
+
| Delete datacard assignment | :x: | OAuth :lock: | faction_datacards_write |
|
|
47
|
+
| **<h3>Events</h3>** | :x: | | |
|
|
48
|
+
| List events for character | :x: | OAuth :lock: | character_events |
|
|
49
|
+
| Get event by uid | :x: | OAuth :lock: | character_events |
|
|
50
|
+
| **<h3>Factions</h3>** | :x: | | |
|
|
51
|
+
| List factions | :x: | Public | |
|
|
52
|
+
| Get faction by uid | :x: | Public | |
|
|
53
|
+
| Get faction credits | :x: | OAuth :lock: | faction_credits_read |
|
|
54
|
+
| Get faction's creditlog | :x: | OAuth :lock: | faction_credits_read |
|
|
55
|
+
| Send faction credits | :x: | OAuth :lock: | faction_credits_write |
|
|
56
|
+
| List faction's budgets | :x: | OAuth :lock: | faction_budgets_read |
|
|
57
|
+
| Get faction budget by uid | :x: | OAuth :lock: | faction_budgets_read |
|
|
58
|
+
| List faction members | :x: | OAuth :lock: | faction_members |
|
|
59
|
+
| Update faction member's infofields | :x: | OAuth :lock: | faction_members, and must be logged in as someone that can update infofields |
|
|
60
|
+
| List faction's stock holders | :x: | OAuth :lock: | faction_stocks |
|
|
61
|
+
| **<h3>Galaxy</h3>** | :x: | | |
|
|
62
|
+
| List sectors | :x: | Public | |
|
|
63
|
+
| Get sector by uid | :x: | Public | |
|
|
64
|
+
| List systems | :x: | Public | |
|
|
65
|
+
| Get system by uid | :x: | Public | |
|
|
66
|
+
| List planets | :x: | Public | |
|
|
67
|
+
| Get planet by uid | :x: | Public | |
|
|
68
|
+
| List stations | :x: | Public | |
|
|
69
|
+
| Get station by uid | :x: | Public | |
|
|
70
|
+
| List cities | :x: | Public | |
|
|
71
|
+
| Get city by uid | :x: | Public | |
|
|
72
|
+
| **<h3>Inventory</h3>** | :x: | | |
|
|
73
|
+
| List inventories | :x: | OAuth :lock: | [personal/faction]\_inv_overview |
|
|
74
|
+
| List entities in inventory | :x: | OAuth :lock: | [personal/faction]\_inv\_[inventory]\_read |
|
|
75
|
+
| Get one entity in inventory | :x: | OAuth :lock: | [personal/faction]\_inv\_[inventory]\_read |
|
|
76
|
+
| Modify entity info | :x: | OAuth :lock: | [personal/faction]\_inv\_[inventory]\_assign |
|
|
77
|
+
| Rename entity | :x: | OAuth :lock: | [personal/faction]\_inv\_[inventory]\_rename |
|
|
78
|
+
| Makeover entity | :x: | OAuth :lock: | [personal/faction]\_inv\_[inventory]\_makeover |
|
|
79
|
+
| Apply tag to entity | :x: | OAuth :lock: | [personal/faction]\_inv\_[inventory]\_tags_write |
|
|
80
|
+
| Remove tag from entity | :x: | OAuth :lock: | [personal/faction]\_inv\_[inventory]\_tags_write |
|
|
81
|
+
| Clear all tags from entity | :x: | OAuth :lock: | [personal/faction]\_inv\_[inventory]\_tags_write |
|
|
82
|
+
| **<h3>Location</h3>** | :x: | | |
|
|
83
|
+
| Get location for specified entity | :x: | OAuth :lock: | character_location |
|
|
84
|
+
| **<h3>Market</h3>** | :x: | |
|
|
85
|
+
| List all public market vendors | :x: | Public |
|
|
86
|
+
| Get vendor info | :x: | Public |
|
|
87
|
+
| **<h3>News</h3>** | :x: | | |
|
|
88
|
+
| List GNS news | :x: | Public | |
|
|
89
|
+
| Get one GNS Item | :x: | Public | |
|
|
90
|
+
| List Sim news | :x: | Public | |
|
|
91
|
+
| Get one Sim news item | :x: | Public | |
|
|
92
|
+
| **<h3>Types</h3>** | :x: | | |
|
|
93
|
+
| List classes of type | :x: | Public | |
|
|
94
|
+
| List entities of type | :x: | Public | |
|
|
95
|
+
| List entities by class and type | :x: | Public | |
|
|
96
|
+
| Get type for existing entity | :x: | Public | |
|
|
97
|
+
| List all entity types | :x: | Public | |
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
6
|
+
class Resource {
|
|
7
|
+
constructor(resourceName) {
|
|
8
|
+
__publicField(this, "resourceName");
|
|
9
|
+
this.resourceName = resourceName;
|
|
10
|
+
}
|
|
11
|
+
async get(endpointUrl) {
|
|
12
|
+
const url = `https://www.swcombine.com/ws/v2.0/${this.resourceName}/${endpointUrl}`;
|
|
13
|
+
const response = await fetch(url, {
|
|
14
|
+
headers: {
|
|
15
|
+
Accept: "application/json"
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
return response.json();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.Resource = Resource;
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare type GetPermissionsResponse = SwcApiResponse<GetPermissionsResponsePermissions>;
|
|
2
|
+
|
|
3
|
+
declare interface GetPermissionsResponsePermission {
|
|
4
|
+
attributes: GetPermissionsResponsePermissionAttributes;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
declare interface GetPermissionsResponsePermissionAttributes {
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
inherits: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
declare interface GetPermissionsResponsePermissions {
|
|
14
|
+
permissions: {
|
|
15
|
+
permission: GetPermissionsResponsePermission[];
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export declare abstract class Resource {
|
|
20
|
+
private resourceName;
|
|
21
|
+
protected constructor(resourceName: string);
|
|
22
|
+
protected get<T>(endpointUrl: string): Promise<T>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare interface SwcApiResponse<T> {
|
|
26
|
+
version: string;
|
|
27
|
+
timestamp: number;
|
|
28
|
+
resource: string;
|
|
29
|
+
request: string;
|
|
30
|
+
swcapi: T;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { }
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AAEvB,cAAc,eAAe,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
+
class Resource {
|
|
5
|
+
constructor(resourceName) {
|
|
6
|
+
__publicField(this, "resourceName");
|
|
7
|
+
this.resourceName = resourceName;
|
|
8
|
+
}
|
|
9
|
+
async get(endpointUrl) {
|
|
10
|
+
const url = `https://www.swcombine.com/ws/v2.0/${this.resourceName}/${endpointUrl}`;
|
|
11
|
+
const response = await fetch(url, {
|
|
12
|
+
headers: {
|
|
13
|
+
Accept: "application/json"
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
return response.json();
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
Resource
|
|
21
|
+
};
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
declare const _default: Readonly<{
|
|
2
|
+
character: Readonly<{
|
|
3
|
+
auth: "character_auth";
|
|
4
|
+
read: "character_read";
|
|
5
|
+
stats: "character_stats";
|
|
6
|
+
privileges: "character_privileges";
|
|
7
|
+
skills: "character_skills";
|
|
8
|
+
credits: Readonly<{
|
|
9
|
+
read: "character_credits";
|
|
10
|
+
readWrite: "character_credits_write";
|
|
11
|
+
}>;
|
|
12
|
+
force: "character_force";
|
|
13
|
+
location: "character_location";
|
|
14
|
+
events: "character_events";
|
|
15
|
+
all: "character_all";
|
|
16
|
+
}>;
|
|
17
|
+
messages: Readonly<{
|
|
18
|
+
read: "messages_read";
|
|
19
|
+
send: "messages_send";
|
|
20
|
+
delete: "messages_delete";
|
|
21
|
+
all: "messages_all";
|
|
22
|
+
}>;
|
|
23
|
+
faction: Readonly<{
|
|
24
|
+
read: "faction_read";
|
|
25
|
+
members: "faction_members";
|
|
26
|
+
stocks: "faction_stocks";
|
|
27
|
+
credits: Readonly<{
|
|
28
|
+
read: "faction_credits_read";
|
|
29
|
+
readWrite: "faction_credits_write";
|
|
30
|
+
}>;
|
|
31
|
+
budgets: Readonly<{
|
|
32
|
+
read: "faction_budgets_read";
|
|
33
|
+
readWrite: "faction_budgets_write";
|
|
34
|
+
}>;
|
|
35
|
+
datacards: Readonly<{
|
|
36
|
+
read: "faction_datacards_read";
|
|
37
|
+
readWrite: "faction_datacards_write";
|
|
38
|
+
}>;
|
|
39
|
+
all: "faction_all";
|
|
40
|
+
}>;
|
|
41
|
+
personalInventory: Readonly<{
|
|
42
|
+
ships: Readonly<{
|
|
43
|
+
read: "personal_inv_ships_read";
|
|
44
|
+
rename: "personal_inv_ships_rename";
|
|
45
|
+
assign: "personal_inv_ships_assign";
|
|
46
|
+
makeover: "personal_inv_ships_makeover";
|
|
47
|
+
tags: Readonly<{
|
|
48
|
+
read: "personal_inv_ships_tags_read";
|
|
49
|
+
readWrite: "personal_inv_ships_tags_write";
|
|
50
|
+
}>;
|
|
51
|
+
all: "personal_inv_ships_all";
|
|
52
|
+
}>;
|
|
53
|
+
vehicles: Readonly<{
|
|
54
|
+
read: "personal_inv_vehicles_read";
|
|
55
|
+
rename: "personal_inv_vehicles_rename";
|
|
56
|
+
assign: "personal_inv_vehicles_assign";
|
|
57
|
+
makeover: "personal_inv_vehicles_makeover";
|
|
58
|
+
tags: Readonly<{
|
|
59
|
+
read: "personal_inv_vehicles_tags_read";
|
|
60
|
+
readWrite: "personal_inv_vehicles_tags_write";
|
|
61
|
+
}>;
|
|
62
|
+
all: "personal_inv_vehicles_all";
|
|
63
|
+
}>;
|
|
64
|
+
stations: Readonly<{
|
|
65
|
+
read: "personal_inv_stations_read";
|
|
66
|
+
rename: "personal_inv_stations_rename";
|
|
67
|
+
assign: "personal_inv_stations_assign";
|
|
68
|
+
makeover: "personal_inv_stations_makeover";
|
|
69
|
+
tags: Readonly<{
|
|
70
|
+
read: "personal_inv_stations_tags_read";
|
|
71
|
+
readWrite: "personal_inv_stations_tags_write";
|
|
72
|
+
}>;
|
|
73
|
+
all: "personal_inv_stations_all";
|
|
74
|
+
}>;
|
|
75
|
+
cities: Readonly<{
|
|
76
|
+
read: "personal_inv_cities_read";
|
|
77
|
+
rename: "personal_inv_cities_rename";
|
|
78
|
+
assign: "personal_inv_cities_assign";
|
|
79
|
+
makeover: "personal_inv_cities_makeover";
|
|
80
|
+
tags: Readonly<{
|
|
81
|
+
read: "personal_inv_cities_tags_read";
|
|
82
|
+
readWrite: "personal_inv_cities_tags_write";
|
|
83
|
+
}>;
|
|
84
|
+
all: "personal_inv_cities_all";
|
|
85
|
+
}>;
|
|
86
|
+
facilities: Readonly<{
|
|
87
|
+
read: "personal_inv_facilities_read";
|
|
88
|
+
rename: "personal_inv_facilities_rename";
|
|
89
|
+
assign: "personal_inv_facilities_assign";
|
|
90
|
+
makeover: "personal_inv_facilities_makeover";
|
|
91
|
+
tags: Readonly<{
|
|
92
|
+
read: "personal_inv_facilities_tags_read";
|
|
93
|
+
readWrite: "personal_inv_facilities_tags_write";
|
|
94
|
+
}>;
|
|
95
|
+
all: "personal_inv_facilities_all";
|
|
96
|
+
}>;
|
|
97
|
+
planets: Readonly<{
|
|
98
|
+
read: "personal_inv_planets_read";
|
|
99
|
+
rename: "personal_inv_planets_rename";
|
|
100
|
+
assign: "personal_inv_planets_assign";
|
|
101
|
+
makeover: "personal_inv_planets_makeover";
|
|
102
|
+
tags: Readonly<{
|
|
103
|
+
read: "personal_inv_planets_tags_read";
|
|
104
|
+
readWrite: "personal_inv_planets_tags_write";
|
|
105
|
+
}>;
|
|
106
|
+
all: "personal_inv_planets_all";
|
|
107
|
+
}>;
|
|
108
|
+
items: Readonly<{
|
|
109
|
+
read: "personal_inv_items_read";
|
|
110
|
+
rename: "personal_inv_items_rename";
|
|
111
|
+
assign: "personal_inv_items_assign";
|
|
112
|
+
makeover: "personal_inv_items_makeover";
|
|
113
|
+
tags: Readonly<{
|
|
114
|
+
read: "personal_inv_items_tags_read";
|
|
115
|
+
readWrite: "personal_inv_items_tags_write";
|
|
116
|
+
}>;
|
|
117
|
+
all: "personal_inv_items_all";
|
|
118
|
+
}>;
|
|
119
|
+
npcs: Readonly<{
|
|
120
|
+
read: "personal_inv_npcs_read";
|
|
121
|
+
rename: "personal_inv_npcs_rename";
|
|
122
|
+
assign: "personal_inv_npcs_assign";
|
|
123
|
+
makeover: "personal_inv_npcs_makeover";
|
|
124
|
+
tags: Readonly<{
|
|
125
|
+
read: "personal_inv_npcs_tags_read";
|
|
126
|
+
readWrite: "personal_inv_npcs_tags_write";
|
|
127
|
+
}>;
|
|
128
|
+
all: "personal_inv_npcs_all";
|
|
129
|
+
}>;
|
|
130
|
+
droids: Readonly<{
|
|
131
|
+
read: "personal_inv_droids_read";
|
|
132
|
+
rename: "personal_inv_droids_rename";
|
|
133
|
+
assign: "personal_inv_droids_assign";
|
|
134
|
+
makeover: "personal_inv_droids_makeover";
|
|
135
|
+
tags: Readonly<{
|
|
136
|
+
read: "personal_inv_droids_tags_read";
|
|
137
|
+
readWrite: "personal_inv_droids_tags_write";
|
|
138
|
+
}>;
|
|
139
|
+
all: "personal_inv_droids_all";
|
|
140
|
+
}>;
|
|
141
|
+
materials: Readonly<{
|
|
142
|
+
read: "personal_inv_materials_read";
|
|
143
|
+
rename: "personal_inv_materials_rename";
|
|
144
|
+
assign: "personal_inv_materials_assign";
|
|
145
|
+
makeover: "personal_inv_materials_makeover";
|
|
146
|
+
tags: Readonly<{
|
|
147
|
+
read: "personal_inv_materials_tags_read";
|
|
148
|
+
readWrite: "personal_inv_materials_tags_write";
|
|
149
|
+
}>;
|
|
150
|
+
all: "personal_inv_materials_all";
|
|
151
|
+
}>;
|
|
152
|
+
creatures: Readonly<{
|
|
153
|
+
read: "personal_inv_creatures_read";
|
|
154
|
+
rename: "personal_inv_creatures_rename";
|
|
155
|
+
assign: "personal_inv_creatures_assign";
|
|
156
|
+
makeover: "personal_inv_creatures_makeover";
|
|
157
|
+
tags: Readonly<{
|
|
158
|
+
read: "personal_inv_creatures_tags_read";
|
|
159
|
+
readWrite: "personal_inv_creatures_tags_write";
|
|
160
|
+
}>;
|
|
161
|
+
all: "personal_inv_creatures_all";
|
|
162
|
+
}>;
|
|
163
|
+
}>;
|
|
164
|
+
factionInventory: Readonly<{
|
|
165
|
+
ships: Readonly<{
|
|
166
|
+
read: "faction_inv_ships_read";
|
|
167
|
+
rename: "faction_inv_ships_rename";
|
|
168
|
+
assign: "faction_inv_ships_assign";
|
|
169
|
+
makeover: "faction_inv_ships_makeover";
|
|
170
|
+
tags: Readonly<{
|
|
171
|
+
read: "faction_inv_ships_tags_read";
|
|
172
|
+
readWrite: "faction_inv_ships_tags_write";
|
|
173
|
+
}>;
|
|
174
|
+
all: "faction_inv_ships_all";
|
|
175
|
+
}>;
|
|
176
|
+
vehicles: Readonly<{
|
|
177
|
+
read: "faction_inv_vehicles_read";
|
|
178
|
+
rename: "faction_inv_vehicles_rename";
|
|
179
|
+
assign: "faction_inv_vehicles_assign";
|
|
180
|
+
makeover: "faction_inv_vehicles_makeover";
|
|
181
|
+
tags: Readonly<{
|
|
182
|
+
read: "faction_inv_vehicles_tags_read";
|
|
183
|
+
readWrite: "faction_inv_vehicles_tags_write";
|
|
184
|
+
}>;
|
|
185
|
+
all: "faction_inv_vehicles_all";
|
|
186
|
+
}>;
|
|
187
|
+
stations: Readonly<{
|
|
188
|
+
read: "faction_inv_stations_read";
|
|
189
|
+
rename: "faction_inv_stations_rename";
|
|
190
|
+
assign: "faction_inv_stations_assign";
|
|
191
|
+
makeover: "faction_inv_stations_makeover";
|
|
192
|
+
tags: Readonly<{
|
|
193
|
+
read: "faction_inv_stations_tags_read";
|
|
194
|
+
readWrite: "faction_inv_stations_tags_write";
|
|
195
|
+
}>;
|
|
196
|
+
all: "faction_inv_stations_all";
|
|
197
|
+
}>;
|
|
198
|
+
cities: Readonly<{
|
|
199
|
+
read: "faction_inv_cities_read";
|
|
200
|
+
rename: "faction_inv_cities_rename";
|
|
201
|
+
assign: "faction_inv_cities_assign";
|
|
202
|
+
makeover: "faction_inv_cities_makeover";
|
|
203
|
+
tags: Readonly<{
|
|
204
|
+
read: "faction_inv_cities_tags_read";
|
|
205
|
+
readWrite: "faction_inv_cities_tags_write";
|
|
206
|
+
}>;
|
|
207
|
+
all: "faction_inv_cities_all";
|
|
208
|
+
}>;
|
|
209
|
+
facilities: Readonly<{
|
|
210
|
+
read: "faction_inv_facilities_read";
|
|
211
|
+
rename: "faction_inv_facilities_rename";
|
|
212
|
+
assign: "faction_inv_facilities_assign";
|
|
213
|
+
makeover: "faction_inv_facilities_makeover";
|
|
214
|
+
tags: Readonly<{
|
|
215
|
+
read: "faction_inv_facilities_tags_read";
|
|
216
|
+
readWrite: "faction_inv_facilities_tags_write";
|
|
217
|
+
}>;
|
|
218
|
+
all: "faction_inv_facilities_all";
|
|
219
|
+
}>;
|
|
220
|
+
planets: Readonly<{
|
|
221
|
+
read: "faction_inv_planets_read";
|
|
222
|
+
rename: "faction_inv_planets_rename";
|
|
223
|
+
assign: "faction_inv_planets_assign";
|
|
224
|
+
makeover: "faction_inv_planets_makeover";
|
|
225
|
+
tags: Readonly<{
|
|
226
|
+
read: "faction_inv_planets_tags_read";
|
|
227
|
+
readWrite: "faction_inv_planets_tags_write";
|
|
228
|
+
}>;
|
|
229
|
+
all: "faction_inv_planets_all";
|
|
230
|
+
}>;
|
|
231
|
+
items: Readonly<{
|
|
232
|
+
read: "faction_inv_items_read";
|
|
233
|
+
rename: "faction_inv_items_rename";
|
|
234
|
+
assign: "faction_inv_items_assign";
|
|
235
|
+
makeover: "faction_inv_items_makeover";
|
|
236
|
+
tags: Readonly<{
|
|
237
|
+
read: "faction_inv_items_tags_read";
|
|
238
|
+
readWrite: "faction_inv_items_tags_write";
|
|
239
|
+
}>;
|
|
240
|
+
all: "faction_inv_items_all";
|
|
241
|
+
}>;
|
|
242
|
+
npcs: Readonly<{
|
|
243
|
+
read: "faction_inv_npcs_read";
|
|
244
|
+
rename: "faction_inv_npcs_rename";
|
|
245
|
+
assign: "faction_inv_npcs_assign";
|
|
246
|
+
makeover: "faction_inv_npcs_makeover";
|
|
247
|
+
tags: Readonly<{
|
|
248
|
+
read: "faction_inv_npcs_tags_read";
|
|
249
|
+
readWrite: "faction_inv_npcs_tags_write";
|
|
250
|
+
}>;
|
|
251
|
+
all: "faction_inv_npcs_all";
|
|
252
|
+
}>;
|
|
253
|
+
droids: Readonly<{
|
|
254
|
+
read: "faction_inv_droids_read";
|
|
255
|
+
rename: "faction_inv_droids_rename";
|
|
256
|
+
assign: "faction_inv_droids_assign";
|
|
257
|
+
makeover: "faction_inv_droids_makeover";
|
|
258
|
+
tags: Readonly<{
|
|
259
|
+
read: "faction_inv_droids_tags_read";
|
|
260
|
+
readWrite: "faction_inv_droids_tags_write";
|
|
261
|
+
}>;
|
|
262
|
+
all: "faction_inv_droids_all";
|
|
263
|
+
}>;
|
|
264
|
+
materials: Readonly<{
|
|
265
|
+
read: "faction_inv_materials_read";
|
|
266
|
+
rename: "faction_inv_materials_rename";
|
|
267
|
+
assign: "faction_inv_materials_assign";
|
|
268
|
+
makeover: "faction_inv_materials_makeover";
|
|
269
|
+
tags: Readonly<{
|
|
270
|
+
read: "faction_inv_materials_tags_read";
|
|
271
|
+
readWrite: "faction_inv_materials_tags_write";
|
|
272
|
+
}>;
|
|
273
|
+
all: "faction_inv_materials_all";
|
|
274
|
+
}>;
|
|
275
|
+
creatures: Readonly<{
|
|
276
|
+
read: "faction_inv_creatures_read";
|
|
277
|
+
rename: "faction_inv_creatures_rename";
|
|
278
|
+
assign: "faction_inv_creatures_assign";
|
|
279
|
+
makeover: "faction_inv_creatures_makeover";
|
|
280
|
+
tags: Readonly<{
|
|
281
|
+
read: "faction_inv_creatures_tags_read";
|
|
282
|
+
readWrite: "faction_inv_creatures_tags_write";
|
|
283
|
+
}>;
|
|
284
|
+
all: "faction_inv_creatures_all";
|
|
285
|
+
}>;
|
|
286
|
+
}>;
|
|
287
|
+
}>;
|
|
288
|
+
export default _default;
|
|
289
|
+
//# sourceMappingURL=permissions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAkSE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiResource.d.ts","sourceRoot":"","sources":["../../src/resources/ApiResource.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,qBAAqB,CAAA;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,QAAQ;;IAKlC,cAAc,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;CAsBrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Resource.d.ts","sourceRoot":"","sources":["../../src/resources/Resource.ts"],"names":[],"mappings":"AAAA,8BAAsB,QAAQ;IAC5B,OAAO,CAAC,YAAY,CAAQ;IAE5B,SAAS,aAAa,YAAY,EAAE,MAAM;cAI1B,GAAG,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;CASxD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwcApiResponse.d.ts","sourceRoot":"","sources":["../../src/responses/SwcApiResponse.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,WAAW,cAAc,CAAC,CAAC;IACvC,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,CAAC,CAAA;CACV"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import SwcApiResponse from '../SwcApiResponse';
|
|
2
|
+
export type GetPermissionsResponse = SwcApiResponse<GetPermissionsResponsePermissions>;
|
|
3
|
+
interface GetPermissionsResponsePermissions {
|
|
4
|
+
permissions: {
|
|
5
|
+
permission: GetPermissionsResponsePermission[];
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
interface GetPermissionsResponsePermission {
|
|
9
|
+
attributes: GetPermissionsResponsePermissionAttributes;
|
|
10
|
+
}
|
|
11
|
+
interface GetPermissionsResponsePermissionAttributes {
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
inherits: string;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=getPermissionsResponse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPermissionsResponse.d.ts","sourceRoot":"","sources":["../../../src/responses/api/getPermissionsResponse.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,mBAAmB,CAAA;AAE9C,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAC,iCAAiC,CAAC,CAAA;AAEtF,UAAU,iCAAiC;IACzC,WAAW,EAAE;QACX,UAAU,EAAE,gCAAgC,EAAE,CAAA;KAC/C,CAAA;CACF;AAED,UAAU,gCAAgC;IACxC,UAAU,EAAE,0CAA0C,CAAA;CACvD;AAED,UAAU,0CAA0C;IAClD,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/responses/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/responses/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA;AAErB,cAAc,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export default class Permission {
|
|
2
|
+
readonly name: string;
|
|
3
|
+
readonly description: string;
|
|
4
|
+
readonly inheritedPermissions: Permission[];
|
|
5
|
+
constructor(name: string, description: string, inheritedPermissions?: Permission[]);
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=Permission.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Permission.d.ts","sourceRoot":"","sources":["../../src/types/Permission.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B,SAAgB,IAAI,EAAE,MAAM,CAAA;IAE5B,SAAgB,WAAW,EAAE,MAAM,CAAA;IAEnC,SAAgB,oBAAoB,EAAE,UAAU,EAAE,CAAK;gBAEpC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,oBAAoB,GAAE,UAAU,EAAO;CAK9F"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility class for working with Star Wars Combine timestamps. Represents Combine Galactic Time and can convert unix timestamps and Date objects to/from CGT.
|
|
3
|
+
*/
|
|
4
|
+
export default class SwcTimestamp {
|
|
5
|
+
year: number;
|
|
6
|
+
day: number;
|
|
7
|
+
hour: number;
|
|
8
|
+
minute: number;
|
|
9
|
+
second: number;
|
|
10
|
+
private static swcStart;
|
|
11
|
+
/**
|
|
12
|
+
* Create a new SwcTimestamp object for a specific moment in Combine Galactic Time.
|
|
13
|
+
*/
|
|
14
|
+
constructor(year: number, day: number, hour?: number, minute?: number, second?: number);
|
|
15
|
+
/**
|
|
16
|
+
* Convert a unix timestamp to Combine Galactic Time.
|
|
17
|
+
* @param unixTimestamp timestamp to convert. Can be either seconds or milliseconds, the code will detect which units to use.
|
|
18
|
+
*/
|
|
19
|
+
static fromUnixTimestamp(unixTimestamp: number): SwcTimestamp;
|
|
20
|
+
/** convert a Date object into Combine Galactic Time. */
|
|
21
|
+
static fromDate(date: Date): SwcTimestamp;
|
|
22
|
+
/** Get the current Combine Galactic Time */
|
|
23
|
+
static now(): SwcTimestamp;
|
|
24
|
+
/**
|
|
25
|
+
* Convert the SWC timestamp into a unix timestamp
|
|
26
|
+
* @param unit whether the unix timestamp should be in seconds or milliseconds.
|
|
27
|
+
*/
|
|
28
|
+
toUnixTimestamp(unit: 'seconds' | 'milliseconds'): number;
|
|
29
|
+
/** Convert the SWC timestamp into a Date object */
|
|
30
|
+
toDate(): Date;
|
|
31
|
+
private static calculateSwcTimestampFromMillisecondsSinceStart;
|
|
32
|
+
private calculateMillisecondsSinceStartFromSwcTimestamp;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=SwcTimestamp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwcTimestamp.d.ts","sourceRoot":"","sources":["../../src/types/SwcTimestamp.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,YAAY;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IAEd,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAiC;IAExD;;OAEG;gBACS,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,MAAU,EAAE,MAAM,GAAE,MAAU,EAAE,MAAM,GAAE,MAAU;IAQ/F;;;OAGG;IACH,MAAM,CAAC,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,YAAY;IAO7D,wDAAwD;IACxD,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,YAAY;IAIzC,4CAA4C;IAC5C,MAAM,CAAC,GAAG,IAAI,YAAY;IAI1B;;;OAGG;IACH,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,cAAc,GAAG,MAAM;IAMzD,mDAAmD;IACnD,MAAM,IAAI,IAAI;IAId,OAAO,CAAC,MAAM,CAAC,+CAA+C;IAuB9D,OAAO,CAAC,+CAA+C;CAgBxD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "swcombine.js",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"swcombine",
|
|
7
|
+
"sdk"
|
|
8
|
+
],
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": {
|
|
12
|
+
"types": "./dist/index.d.mts",
|
|
13
|
+
"default": "./dist/index.esm.js"
|
|
14
|
+
},
|
|
15
|
+
"require": {
|
|
16
|
+
"types": "./dist/index.d.mts",
|
|
17
|
+
"default": "./dist/index.cjs.js"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"type": "module",
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"module": "./dist/index.esm.js",
|
|
24
|
+
"files": [
|
|
25
|
+
"dist"
|
|
26
|
+
],
|
|
27
|
+
"contributors": [
|
|
28
|
+
{
|
|
29
|
+
"name": "kaelon",
|
|
30
|
+
"email": "j.dekoning141@gmail.com"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "karnthis",
|
|
34
|
+
"email": "me@erinrivas.com"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "git+https://github.com/swc-unnamed/swcombine-js.git"
|
|
41
|
+
},
|
|
42
|
+
"bugs": {
|
|
43
|
+
"url": "https://github.com/swc-unnamed/swcombine-js/issues"
|
|
44
|
+
},
|
|
45
|
+
"homepage": "https://github.com/swc-unnamed/swcombine-js/#README",
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@eslint/js": "^9.19.0",
|
|
48
|
+
"@rollup/plugin-commonjs": "^28.0.2",
|
|
49
|
+
"@rollup/plugin-typescript": "^12.1.2",
|
|
50
|
+
"@types/node": "^22.13.0",
|
|
51
|
+
"@vitest/coverage-v8": "^3.0.4",
|
|
52
|
+
"eslint": "^9.19.0",
|
|
53
|
+
"eslint-config-prettier": "^10.0.1",
|
|
54
|
+
"eslint-plugin-prettier": "^5.2.3",
|
|
55
|
+
"jiti": "^2.4.2",
|
|
56
|
+
"prettier": "^3.4.2",
|
|
57
|
+
"rollup-plugin-node-externals": "^8.0.0",
|
|
58
|
+
"rollup-plugin-typescript-paths": "^1.5.0",
|
|
59
|
+
"tslib": "^2.8.1",
|
|
60
|
+
"typedoc": "^0.27.6",
|
|
61
|
+
"typescript": "^5.7.3",
|
|
62
|
+
"typescript-eslint": "^8.22.0",
|
|
63
|
+
"vite": "^6.0.11",
|
|
64
|
+
"vite-plugin-dts": "^4.5.0",
|
|
65
|
+
"vite-plugin-node-polyfills": "^0.23.0",
|
|
66
|
+
"vite-tsconfig-paths": "^5.1.4",
|
|
67
|
+
"vitest": "^3.0.4"
|
|
68
|
+
},
|
|
69
|
+
"scripts": {
|
|
70
|
+
"build": "tsc && vite build",
|
|
71
|
+
"packit": "npm run build && npm pack --pack-destination packs",
|
|
72
|
+
"gen-docs": "npx typedoc",
|
|
73
|
+
"test": "vitest"
|
|
74
|
+
}
|
|
75
|
+
}
|