swcombine-sdk 1.0.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/LICENSE +21 -0
- package/README.md +404 -0
- package/dist/cjs/SWCombine.js +120 -0
- package/dist/cjs/SWCombine.js.map +1 -0
- package/dist/cjs/auth/OAuthClient.js +195 -0
- package/dist/cjs/auth/OAuthClient.js.map +1 -0
- package/dist/cjs/auth/TokenManager.js +139 -0
- package/dist/cjs/auth/TokenManager.js.map +1 -0
- package/dist/cjs/auth/permissions.js +281 -0
- package/dist/cjs/auth/permissions.js.map +1 -0
- package/dist/cjs/auth/scopes.js +285 -0
- package/dist/cjs/auth/scopes.js.map +1 -0
- package/dist/cjs/http/HttpClient.js +216 -0
- package/dist/cjs/http/HttpClient.js.map +1 -0
- package/dist/cjs/http/errors.js +156 -0
- package/dist/cjs/http/errors.js.map +1 -0
- package/dist/cjs/index.js +48 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/resources/ApiResource.js +44 -0
- package/dist/cjs/resources/ApiResource.js.map +1 -0
- package/dist/cjs/resources/BaseResource.js +33 -0
- package/dist/cjs/resources/BaseResource.js.map +1 -0
- package/dist/cjs/resources/CharacterResource.js +178 -0
- package/dist/cjs/resources/CharacterResource.js.map +1 -0
- package/dist/cjs/resources/DatacardResource.js +42 -0
- package/dist/cjs/resources/DatacardResource.js.map +1 -0
- package/dist/cjs/resources/EventsResource.js +42 -0
- package/dist/cjs/resources/EventsResource.js.map +1 -0
- package/dist/cjs/resources/FactionResource.js +162 -0
- package/dist/cjs/resources/FactionResource.js.map +1 -0
- package/dist/cjs/resources/GalaxyResource.js +184 -0
- package/dist/cjs/resources/GalaxyResource.js.map +1 -0
- package/dist/cjs/resources/InventoryResource.js +95 -0
- package/dist/cjs/resources/InventoryResource.js.map +1 -0
- package/dist/cjs/resources/LocationResource.js +20 -0
- package/dist/cjs/resources/LocationResource.js.map +1 -0
- package/dist/cjs/resources/MarketResource.js +44 -0
- package/dist/cjs/resources/MarketResource.js.map +1 -0
- package/dist/cjs/resources/NewsResource.js +109 -0
- package/dist/cjs/resources/NewsResource.js.map +1 -0
- package/dist/cjs/resources/TypesResource.js +75 -0
- package/dist/cjs/resources/TypesResource.js.map +1 -0
- package/dist/cjs/types/index.js +25 -0
- package/dist/cjs/types/index.js.map +1 -0
- package/dist/esm/SWCombine.js +116 -0
- package/dist/esm/SWCombine.js.map +1 -0
- package/dist/esm/auth/OAuthClient.js +188 -0
- package/dist/esm/auth/OAuthClient.js.map +1 -0
- package/dist/esm/auth/TokenManager.js +135 -0
- package/dist/esm/auth/TokenManager.js.map +1 -0
- package/dist/esm/auth/permissions.js +275 -0
- package/dist/esm/auth/permissions.js.map +1 -0
- package/dist/esm/auth/scopes.js +274 -0
- package/dist/esm/auth/scopes.js.map +1 -0
- package/dist/esm/http/HttpClient.js +209 -0
- package/dist/esm/http/HttpClient.js.map +1 -0
- package/dist/esm/http/errors.js +152 -0
- package/dist/esm/http/errors.js.map +1 -0
- package/dist/esm/index.js +15 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/resources/ApiResource.js +40 -0
- package/dist/esm/resources/ApiResource.js.map +1 -0
- package/dist/esm/resources/BaseResource.js +29 -0
- package/dist/esm/resources/BaseResource.js.map +1 -0
- package/dist/esm/resources/CharacterResource.js +168 -0
- package/dist/esm/resources/CharacterResource.js.map +1 -0
- package/dist/esm/resources/DatacardResource.js +38 -0
- package/dist/esm/resources/DatacardResource.js.map +1 -0
- package/dist/esm/resources/EventsResource.js +38 -0
- package/dist/esm/resources/EventsResource.js.map +1 -0
- package/dist/esm/resources/FactionResource.js +153 -0
- package/dist/esm/resources/FactionResource.js.map +1 -0
- package/dist/esm/resources/GalaxyResource.js +175 -0
- package/dist/esm/resources/GalaxyResource.js.map +1 -0
- package/dist/esm/resources/InventoryResource.js +90 -0
- package/dist/esm/resources/InventoryResource.js.map +1 -0
- package/dist/esm/resources/LocationResource.js +16 -0
- package/dist/esm/resources/LocationResource.js.map +1 -0
- package/dist/esm/resources/MarketResource.js +39 -0
- package/dist/esm/resources/MarketResource.js.map +1 -0
- package/dist/esm/resources/NewsResource.js +103 -0
- package/dist/esm/resources/NewsResource.js.map +1 -0
- package/dist/esm/resources/TypesResource.js +69 -0
- package/dist/esm/resources/TypesResource.js.map +1 -0
- package/dist/esm/types/index.js +22 -0
- package/dist/esm/types/index.js.map +1 -0
- package/dist/types/SWCombine.d.ts +66 -0
- package/dist/types/SWCombine.d.ts.map +1 -0
- package/dist/types/auth/OAuthClient.d.ts +48 -0
- package/dist/types/auth/OAuthClient.d.ts.map +1 -0
- package/dist/types/auth/TokenManager.d.ts +66 -0
- package/dist/types/auth/TokenManager.d.ts.map +1 -0
- package/dist/types/auth/permissions.d.ts +173 -0
- package/dist/types/auth/permissions.d.ts.map +1 -0
- package/dist/types/auth/scopes.d.ts +309 -0
- package/dist/types/auth/scopes.d.ts.map +1 -0
- package/dist/types/http/HttpClient.d.ts +64 -0
- package/dist/types/http/HttpClient.d.ts.map +1 -0
- package/dist/types/http/errors.d.ts +54 -0
- package/dist/types/http/errors.d.ts.map +1 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/resources/ApiResource.d.ts +56 -0
- package/dist/types/resources/ApiResource.d.ts.map +1 -0
- package/dist/types/resources/BaseResource.d.ts +16 -0
- package/dist/types/resources/BaseResource.d.ts.map +1 -0
- package/dist/types/resources/CharacterResource.d.ts +151 -0
- package/dist/types/resources/CharacterResource.d.ts.map +1 -0
- package/dist/types/resources/DatacardResource.d.ts +42 -0
- package/dist/types/resources/DatacardResource.d.ts.map +1 -0
- package/dist/types/resources/EventsResource.d.ts +34 -0
- package/dist/types/resources/EventsResource.d.ts.map +1 -0
- package/dist/types/resources/FactionResource.d.ts +166 -0
- package/dist/types/resources/FactionResource.d.ts.map +1 -0
- package/dist/types/resources/GalaxyResource.d.ts +134 -0
- package/dist/types/resources/GalaxyResource.d.ts.map +1 -0
- package/dist/types/resources/InventoryResource.d.ts +77 -0
- package/dist/types/resources/InventoryResource.d.ts.map +1 -0
- package/dist/types/resources/LocationResource.d.ts +18 -0
- package/dist/types/resources/LocationResource.d.ts.map +1 -0
- package/dist/types/resources/MarketResource.d.ts +34 -0
- package/dist/types/resources/MarketResource.d.ts.map +1 -0
- package/dist/types/resources/NewsResource.d.ts +54 -0
- package/dist/types/resources/NewsResource.d.ts.map +1 -0
- package/dist/types/resources/TypesResource.d.ts +72 -0
- package/dist/types/resources/TypesResource.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +296 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/package.json +75 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Galaxy resource for accessing galactic data
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.GalaxyResource = exports.GalaxyCitiesResource = exports.GalaxyStationsResource = exports.GalaxySystemsResource = exports.GalaxySectorsResource = exports.GalaxyPlanetsResource = void 0;
|
|
7
|
+
const BaseResource_js_1 = require("./BaseResource.js");
|
|
8
|
+
/**
|
|
9
|
+
* Galaxy planets resource
|
|
10
|
+
*/
|
|
11
|
+
class GalaxyPlanetsResource extends BaseResource_js_1.BaseResource {
|
|
12
|
+
/**
|
|
13
|
+
* List all planets (paginated)
|
|
14
|
+
* @param options - Optional pagination parameters
|
|
15
|
+
* @example
|
|
16
|
+
* const planets = await client.galaxy.planets.list();
|
|
17
|
+
* const morePlanets = await client.galaxy.planets.list({ start_index: 51, item_count: 50 });
|
|
18
|
+
*/
|
|
19
|
+
async list(options) {
|
|
20
|
+
const params = {
|
|
21
|
+
start_index: options?.start_index || 1,
|
|
22
|
+
item_count: options?.item_count || 50,
|
|
23
|
+
};
|
|
24
|
+
return this.http.get('/galaxy/planets/', { params });
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get planet by UID
|
|
28
|
+
*/
|
|
29
|
+
async get(options) {
|
|
30
|
+
return this.request('GET', `/galaxy/planets/${options.uid}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.GalaxyPlanetsResource = GalaxyPlanetsResource;
|
|
34
|
+
/**
|
|
35
|
+
* Galaxy sectors resource
|
|
36
|
+
*/
|
|
37
|
+
class GalaxySectorsResource extends BaseResource_js_1.BaseResource {
|
|
38
|
+
/**
|
|
39
|
+
* List all sectors (paginated)
|
|
40
|
+
* @param options - Optional pagination parameters
|
|
41
|
+
* @example
|
|
42
|
+
* const sectors = await client.galaxy.sectors.list();
|
|
43
|
+
* const moreSectors = await client.galaxy.sectors.list({ start_index: 51, item_count: 50 });
|
|
44
|
+
*/
|
|
45
|
+
async list(options) {
|
|
46
|
+
const params = {
|
|
47
|
+
start_index: options?.start_index || 1,
|
|
48
|
+
item_count: options?.item_count || 50,
|
|
49
|
+
};
|
|
50
|
+
return this.http.get('/galaxy/sectors/', { params });
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Get sector by name or UID
|
|
54
|
+
* @param options - Sector identifier (use lowercase sector name, e.g., 'seswenna')
|
|
55
|
+
* @example
|
|
56
|
+
* const sector = await client.galaxy.sectors.get({ uid: 'seswenna' });
|
|
57
|
+
*/
|
|
58
|
+
async get(options) {
|
|
59
|
+
return this.request('GET', `/galaxy/sectors/${options.uid}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.GalaxySectorsResource = GalaxySectorsResource;
|
|
63
|
+
/**
|
|
64
|
+
* Galaxy systems resource
|
|
65
|
+
*/
|
|
66
|
+
class GalaxySystemsResource extends BaseResource_js_1.BaseResource {
|
|
67
|
+
/**
|
|
68
|
+
* List all systems (paginated)
|
|
69
|
+
* @param options - Optional pagination parameters
|
|
70
|
+
* @example
|
|
71
|
+
* const systems = await client.galaxy.systems.list();
|
|
72
|
+
* const moreSystems = await client.galaxy.systems.list({ start_index: 51, item_count: 50 });
|
|
73
|
+
*/
|
|
74
|
+
async list(options) {
|
|
75
|
+
const params = {
|
|
76
|
+
start_index: options?.start_index || 1,
|
|
77
|
+
item_count: options?.item_count || 50,
|
|
78
|
+
};
|
|
79
|
+
return this.http.get('/galaxy/systems/', { params });
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Get system by UID
|
|
83
|
+
*/
|
|
84
|
+
async get(options) {
|
|
85
|
+
return this.request('GET', `/galaxy/systems/${options.uid}`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.GalaxySystemsResource = GalaxySystemsResource;
|
|
89
|
+
/**
|
|
90
|
+
* Galaxy stations resource
|
|
91
|
+
*/
|
|
92
|
+
class GalaxyStationsResource extends BaseResource_js_1.BaseResource {
|
|
93
|
+
/**
|
|
94
|
+
* List all stations in named systems with no ECM (paginated)
|
|
95
|
+
* @param options - Optional pagination parameters
|
|
96
|
+
* @example
|
|
97
|
+
* const stations = await client.galaxy.stations.list();
|
|
98
|
+
* const moreStations = await client.galaxy.stations.list({ start_index: 51, item_count: 50 });
|
|
99
|
+
*/
|
|
100
|
+
async list(options) {
|
|
101
|
+
const params = {
|
|
102
|
+
start_index: options?.start_index || 1,
|
|
103
|
+
item_count: options?.item_count || 50,
|
|
104
|
+
};
|
|
105
|
+
return this.http.get('/galaxy/stations/', { params });
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Get station by UID
|
|
109
|
+
*/
|
|
110
|
+
async get(options) {
|
|
111
|
+
return this.request('GET', `/galaxy/stations/${options.uid}`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
exports.GalaxyStationsResource = GalaxyStationsResource;
|
|
115
|
+
/**
|
|
116
|
+
* Galaxy cities resource
|
|
117
|
+
*/
|
|
118
|
+
class GalaxyCitiesResource extends BaseResource_js_1.BaseResource {
|
|
119
|
+
/**
|
|
120
|
+
* List all cities (paginated)
|
|
121
|
+
* @param options - Optional pagination parameters
|
|
122
|
+
* @example
|
|
123
|
+
* const cities = await client.galaxy.cities.list();
|
|
124
|
+
* const moreCities = await client.galaxy.cities.list({ start_index: 51, item_count: 50 });
|
|
125
|
+
*/
|
|
126
|
+
async list(options) {
|
|
127
|
+
const params = {
|
|
128
|
+
start_index: options?.start_index || 1,
|
|
129
|
+
item_count: options?.item_count || 50,
|
|
130
|
+
};
|
|
131
|
+
return this.http.get('/galaxy/cities/', { params });
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Get city by UID
|
|
135
|
+
*/
|
|
136
|
+
async get(options) {
|
|
137
|
+
return this.request('GET', `/galaxy/cities/${options.uid}`);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
exports.GalaxyCitiesResource = GalaxyCitiesResource;
|
|
141
|
+
/**
|
|
142
|
+
* Galaxy resource for accessing galactic information
|
|
143
|
+
*/
|
|
144
|
+
class GalaxyResource extends BaseResource_js_1.BaseResource {
|
|
145
|
+
constructor(http) {
|
|
146
|
+
super(http);
|
|
147
|
+
this.planets = new GalaxyPlanetsResource(http);
|
|
148
|
+
this.sectors = new GalaxySectorsResource(http);
|
|
149
|
+
this.systems = new GalaxySystemsResource(http);
|
|
150
|
+
this.stations = new GalaxyStationsResource(http);
|
|
151
|
+
this.cities = new GalaxyCitiesResource(http);
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Extract unique sectors from systems list
|
|
155
|
+
* This is a helper method since the API doesn't provide a direct sectors list endpoint
|
|
156
|
+
* @returns Array of unique sector information extracted from systems
|
|
157
|
+
* @example
|
|
158
|
+
* const sectorsData = await client.galaxy.getSectorsFromSystems();
|
|
159
|
+
* // Returns: [{ uid: '25:160', name: 'Seswenna', href: '...' }, ...]
|
|
160
|
+
*/
|
|
161
|
+
async getSectorsFromSystems() {
|
|
162
|
+
const systemsResponse = await this.systems.list();
|
|
163
|
+
// Handle paginated response
|
|
164
|
+
const systems = systemsResponse.system || systemsResponse;
|
|
165
|
+
// Extract unique sectors
|
|
166
|
+
const sectorMap = new Map();
|
|
167
|
+
for (const system of systems) {
|
|
168
|
+
const sector = system.location?.container;
|
|
169
|
+
if (sector?.attributes?.uid && sector.attributes.type === 'sector') {
|
|
170
|
+
const uid = sector.attributes.uid;
|
|
171
|
+
if (!sectorMap.has(uid)) {
|
|
172
|
+
sectorMap.set(uid, {
|
|
173
|
+
uid: uid,
|
|
174
|
+
name: sector.value,
|
|
175
|
+
href: sector.attributes.href,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return Array.from(sectorMap.values());
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
exports.GalaxyResource = GalaxyResource;
|
|
184
|
+
//# sourceMappingURL=GalaxyResource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GalaxyResource.js","sourceRoot":"","sources":["../../../src/resources/GalaxyResource.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAGH,uDAAiD;AAcjD;;GAEG;AACH,MAAa,qBAAsB,SAAQ,8BAAY;IACrD;;;;;;OAMG;IACH,KAAK,CAAC,IAAI,CAAC,OAAuD;QAChE,MAAM,MAAM,GAAG;YACb,WAAW,EAAE,OAAO,EAAE,WAAW,IAAI,CAAC;YACtC,UAAU,EAAE,OAAO,EAAE,UAAU,IAAI,EAAE;SACtC,CAAC;QACF,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAW,kBAAkB,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,GAAG,CAAC,OAAyB;QACjC,OAAO,IAAI,CAAC,OAAO,CAAS,KAAK,EAAE,mBAAmB,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACvE,CAAC;CACF;AAtBD,sDAsBC;AAED;;GAEG;AACH,MAAa,qBAAsB,SAAQ,8BAAY;IACrD;;;;;;OAMG;IACH,KAAK,CAAC,IAAI,CAAC,OAAuD;QAChE,MAAM,MAAM,GAAG;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O,CAAC,IAAI,EAAE,CAAC;QAElD,4BAA4B;QAC5B,MAAM,OAAO,GAAI,eAAuB,CAAC,MAAM,IAAI,eAAe,CAAC;QAEnE,yBAAyB;QACzB,MAAM,SAAS,GAAG,IAAI,GAAG,EAAwD,CAAC;QAElF,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC7B,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC;YAC1C,IAAI,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,MAAM,CAAC,UAAU,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBACnE,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC;gBAClC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;oBACxB,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE;wBACjB,GAAG,EAAE,GAAG;wBACR,IAAI,EAAE,MAAM,CAAC,KAAK;wBAClB,IAAI,EAAE,MAAM,CAAC,UAAU,CAAC,IAAI;qBAC7B,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC;IACxC,CAAC;CACF;AAjDD,wCAiDC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Inventory resource for managing entities
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.InventoryResource = exports.InventoryEntitiesResource = void 0;
|
|
7
|
+
const BaseResource_js_1 = require("./BaseResource.js");
|
|
8
|
+
/**
|
|
9
|
+
* Inventory entities resource
|
|
10
|
+
*/
|
|
11
|
+
class InventoryEntitiesResource extends BaseResource_js_1.BaseResource {
|
|
12
|
+
/**
|
|
13
|
+
* List entities in inventory (paginated with optional filtering)
|
|
14
|
+
* @param options - Inventory UID, entity type, assign type, and optional pagination/filtering parameters
|
|
15
|
+
* @example
|
|
16
|
+
* const entities = await client.inventory.entities.list({ uid: '1:12345', entityType: 'vehicle', assignType: 'pilot' });
|
|
17
|
+
* const moreEntities = await client.inventory.entities.list({ uid: '1:12345', entityType: 'vehicle', assignType: 'pilot', start_index: 51, item_count: 100 });
|
|
18
|
+
* const filteredEntities = await client.inventory.entities.list({
|
|
19
|
+
* uid: '1:12345',
|
|
20
|
+
* entityType: 'vehicle',
|
|
21
|
+
* assignType: 'pilot',
|
|
22
|
+
* filter_type: ['hp'],
|
|
23
|
+
* filter_value: ['100'],
|
|
24
|
+
* filter_inclusion: ['includes']
|
|
25
|
+
* });
|
|
26
|
+
*/
|
|
27
|
+
async list(options) {
|
|
28
|
+
const params = {
|
|
29
|
+
start_index: options.start_index || 1,
|
|
30
|
+
item_count: options.item_count || 50,
|
|
31
|
+
};
|
|
32
|
+
// Add filtering parameters if provided
|
|
33
|
+
if (options.filter_type) {
|
|
34
|
+
params.filter_type = options.filter_type;
|
|
35
|
+
}
|
|
36
|
+
if (options.filter_value) {
|
|
37
|
+
params.filter_value = options.filter_value;
|
|
38
|
+
}
|
|
39
|
+
if (options.filter_inclusion) {
|
|
40
|
+
params.filter_inclusion = options.filter_inclusion;
|
|
41
|
+
}
|
|
42
|
+
return this.http.get(`/inventory/${options.uid}/${options.entityType}/${options.assignType}`, { params });
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Get specific entity
|
|
46
|
+
*/
|
|
47
|
+
async get(options) {
|
|
48
|
+
return this.request('GET', `/inventory/${options.entityType}/${options.uid}`);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Update entity property
|
|
52
|
+
*/
|
|
53
|
+
async updateProperty(options) {
|
|
54
|
+
return this.request('POST', `/inventory/${options.entityType}/${options.uid}/property`, {
|
|
55
|
+
property: options.property,
|
|
56
|
+
value: options.value,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Add tag to entity
|
|
61
|
+
*/
|
|
62
|
+
async addTag(options) {
|
|
63
|
+
return this.request('PUT', `/inventory/${options.entityType}/${options.uid}/tag/${options.tag}`);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Remove tag from entity
|
|
67
|
+
*/
|
|
68
|
+
async removeTag(options) {
|
|
69
|
+
return this.request('DELETE', `/inventory/${options.entityType}/${options.uid}/tag/${options.tag}`);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Remove all tags from entity
|
|
73
|
+
*/
|
|
74
|
+
async removeAllTags(options) {
|
|
75
|
+
return this.request('DELETE', `/inventory/${options.entityType}/${options.uid}/tags`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
exports.InventoryEntitiesResource = InventoryEntitiesResource;
|
|
79
|
+
/**
|
|
80
|
+
* Inventory resource for managing inventories
|
|
81
|
+
*/
|
|
82
|
+
class InventoryResource extends BaseResource_js_1.BaseResource {
|
|
83
|
+
constructor(http) {
|
|
84
|
+
super(http);
|
|
85
|
+
this.entities = new InventoryEntitiesResource(http);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Get inventory by UID
|
|
89
|
+
*/
|
|
90
|
+
async get(options) {
|
|
91
|
+
return this.request('GET', `/inventory/${options.uid}`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
exports.InventoryResource = InventoryResource;
|
|
95
|
+
//# sourceMappingURL=InventoryResource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InventoryResource.js","sourceRoot":"","sources":["../../../src/resources/InventoryResource.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAGH,uDAAiD;AAGjD;;GAEG;AACH,MAAa,yBAA0B,SAAQ,8BAAY;IACzD;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,IAAI,CAAC,OAAqC;QAC9C,MAAM,MAAM,GAAgB;YAC1B,WAAW,EAAE,OAAO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AAC;IAED;;OAEG;IACH,KAAK,CAAC,SAAS,CAAC,OAAyD;QACvE,OAAO,IAAI,CAAC,OAAO,CACjB,QAAQ,EACR,cAAc,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,QAAQ,OAAO,CAAC,GAAG,EAAE,CACrE,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,aAAa,CAAC,OAA4C;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAO,QAAQ,EAAE,cAAc,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC;IAC9F,CAAC;CACF;AA3FD,8DA2FC;AAED;;GAEG;AACH,MAAa,iBAAkB,SAAQ,8BAAY;IAGjD,YAAY,IAAgB;QAC1B,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,QAAQ,GAAG,IAAI,yBAAyB,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,GAAG,CAAC,OAAwB;QAChC,OAAO,IAAI,CAAC,OAAO,CAAM,KAAK,EAAE,cAAc,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAC/D,CAAC;CACF;AAdD,8CAcC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Location resource for accessing entity locations
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.LocationResource = void 0;
|
|
7
|
+
const BaseResource_js_1 = require("./BaseResource.js");
|
|
8
|
+
/**
|
|
9
|
+
* Location resource for querying entity locations
|
|
10
|
+
*/
|
|
11
|
+
class LocationResource extends BaseResource_js_1.BaseResource {
|
|
12
|
+
/**
|
|
13
|
+
* Get entity location
|
|
14
|
+
*/
|
|
15
|
+
async get(options) {
|
|
16
|
+
return this.request('GET', `/location/${options.entityType}/${options.uid}`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.LocationResource = LocationResource;
|
|
20
|
+
//# sourceMappingURL=LocationResource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocationResource.js","sourceRoot":"","sources":["../../../src/resources/LocationResource.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,uDAAiD;AAGjD;;GAEG;AACH,MAAa,gBAAiB,SAAQ,8BAAY;IAChD;;OAEG;IACH,KAAK,CAAC,GAAG,CAAC,OAA4C;QACpD,OAAO,IAAI,CAAC,OAAO,CAAW,KAAK,EAAE,aAAa,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACzF,CAAC;CACF;AAPD,4CAOC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Market resource for accessing vendor data
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.MarketResource = exports.MarketVendorsResource = void 0;
|
|
7
|
+
const BaseResource_js_1 = require("./BaseResource.js");
|
|
8
|
+
/**
|
|
9
|
+
* Market vendors resource
|
|
10
|
+
*/
|
|
11
|
+
class MarketVendorsResource extends BaseResource_js_1.BaseResource {
|
|
12
|
+
/**
|
|
13
|
+
* List all public vendors (paginated)
|
|
14
|
+
* @param options - Optional pagination parameters
|
|
15
|
+
* @example
|
|
16
|
+
* const vendors = await client.market.vendors.list();
|
|
17
|
+
* const moreVendors = await client.market.vendors.list({ start_index: 51, item_count: 50 });
|
|
18
|
+
*/
|
|
19
|
+
async list(options) {
|
|
20
|
+
const params = {
|
|
21
|
+
start_index: options?.start_index || 1,
|
|
22
|
+
item_count: options?.item_count || 50,
|
|
23
|
+
};
|
|
24
|
+
return this.http.get('/market/vendors', { params });
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get vendor by UID
|
|
28
|
+
*/
|
|
29
|
+
async get(options) {
|
|
30
|
+
return this.request('GET', `/market/vendors/${options.uid}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.MarketVendorsResource = MarketVendorsResource;
|
|
34
|
+
/**
|
|
35
|
+
* Market resource for accessing market data
|
|
36
|
+
*/
|
|
37
|
+
class MarketResource extends BaseResource_js_1.BaseResource {
|
|
38
|
+
constructor(http) {
|
|
39
|
+
super(http);
|
|
40
|
+
this.vendors = new MarketVendorsResource(http);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.MarketResource = MarketResource;
|
|
44
|
+
//# sourceMappingURL=MarketResource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarketResource.js","sourceRoot":"","sources":["../../../src/resources/MarketResource.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAGH,uDAAiD;AAGjD;;GAEG;AACH,MAAa,qBAAsB,SAAQ,8BAAY;IACrD;;;;;;OAMG;IACH,KAAK,CAAC,IAAI,CAAC,OAAuD;QAChE,MAAM,MAAM,GAAG;YACb,WAAW,EAAE,OAAO,EAAE,WAAW,IAAI,CAAC;YACtC,UAAU,EAAE,OAAO,EAAE,UAAU,IAAI,EAAE;SACtC,CAAC;QACF,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAW,iBAAiB,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,GAAG,CAAC,OAAyB;QACjC,OAAO,IAAI,CAAC,OAAO,CAAS,KAAK,EAAE,mBAAmB,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACvE,CAAC;CACF;AAtBD,sDAsBC;AAED;;GAEG;AACH,MAAa,cAAe,SAAQ,8BAAY;IAG9C,YAAY,IAAgB;QAC1B,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,OAAO,GAAG,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;CACF;AAPD,wCAOC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* News resource for accessing news feeds
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NewsResource = exports.SimNewsResource = exports.GNSResource = void 0;
|
|
7
|
+
const BaseResource_js_1 = require("./BaseResource.js");
|
|
8
|
+
/**
|
|
9
|
+
* Galactic News Service (GNS) resource
|
|
10
|
+
*/
|
|
11
|
+
class GNSResource extends BaseResource_js_1.BaseResource {
|
|
12
|
+
/**
|
|
13
|
+
* List GNS news items (paginated with optional filtering)
|
|
14
|
+
* @param options - Optional category, pagination, and filtering parameters
|
|
15
|
+
* @example
|
|
16
|
+
* const news = await client.news.gns.list();
|
|
17
|
+
* const economyNews = await client.news.gns.list({ category: 'economy' });
|
|
18
|
+
* const moreNews = await client.news.gns.list({ start_index: 51, item_count: 50 });
|
|
19
|
+
* const searchNews = await client.news.gns.list({ search: 'battle', author: 'John Doe' });
|
|
20
|
+
* const factionNews = await client.news.gns.list({ faction: 'Empire', faction_type: 'government' });
|
|
21
|
+
*/
|
|
22
|
+
async list(options) {
|
|
23
|
+
const path = options?.category ? `/news/gns/${options.category}` : '/news/gns';
|
|
24
|
+
const params = {
|
|
25
|
+
start_index: options?.start_index || 1,
|
|
26
|
+
item_count: options?.item_count || 50,
|
|
27
|
+
};
|
|
28
|
+
if (options?.start_date !== undefined) {
|
|
29
|
+
params.start_date = options.start_date;
|
|
30
|
+
}
|
|
31
|
+
if (options?.end_date !== undefined) {
|
|
32
|
+
params.end_date = options.end_date;
|
|
33
|
+
}
|
|
34
|
+
if (options?.search) {
|
|
35
|
+
params.search = options.search;
|
|
36
|
+
}
|
|
37
|
+
if (options?.author) {
|
|
38
|
+
params.author = options.author;
|
|
39
|
+
}
|
|
40
|
+
if (options?.faction) {
|
|
41
|
+
params.faction = options.faction;
|
|
42
|
+
}
|
|
43
|
+
if (options?.faction_type) {
|
|
44
|
+
params.faction_type = options.faction_type;
|
|
45
|
+
}
|
|
46
|
+
return this.http.get(path, { params });
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Get specific GNS news item
|
|
50
|
+
*/
|
|
51
|
+
async get(options) {
|
|
52
|
+
return this.request('GET', `/news/gns/${options.id}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.GNSResource = GNSResource;
|
|
56
|
+
/**
|
|
57
|
+
* Sim News resource
|
|
58
|
+
*/
|
|
59
|
+
class SimNewsResource extends BaseResource_js_1.BaseResource {
|
|
60
|
+
/**
|
|
61
|
+
* List Sim News items (paginated with optional filtering)
|
|
62
|
+
* @param options - Optional category, pagination, and filtering parameters
|
|
63
|
+
* @example
|
|
64
|
+
* const news = await client.news.simNews.list();
|
|
65
|
+
* const playerNews = await client.news.simNews.list({ category: 'player' });
|
|
66
|
+
* const moreNews = await client.news.simNews.list({ start_index: 51, item_count: 50 });
|
|
67
|
+
* const searchNews = await client.news.simNews.list({ search: 'update', author: 'Admin' });
|
|
68
|
+
*/
|
|
69
|
+
async list(options) {
|
|
70
|
+
const path = options?.category ? `/news/simnews/${options.category}` : '/news/simnews';
|
|
71
|
+
const params = {
|
|
72
|
+
start_index: options?.start_index || 1,
|
|
73
|
+
item_count: options?.item_count || 50,
|
|
74
|
+
};
|
|
75
|
+
if (options?.start_date !== undefined) {
|
|
76
|
+
params.start_date = options.start_date;
|
|
77
|
+
}
|
|
78
|
+
if (options?.end_date !== undefined) {
|
|
79
|
+
params.end_date = options.end_date;
|
|
80
|
+
}
|
|
81
|
+
if (options?.search) {
|
|
82
|
+
params.search = options.search;
|
|
83
|
+
}
|
|
84
|
+
if (options?.author) {
|
|
85
|
+
params.author = options.author;
|
|
86
|
+
}
|
|
87
|
+
// Note: faction and faction_type are GNS-only parameters, not used for SimNews
|
|
88
|
+
return this.http.get(path, { params });
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Get specific Sim News item
|
|
92
|
+
*/
|
|
93
|
+
async get(options) {
|
|
94
|
+
return this.request('GET', `/news/simnews/${options.id}`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.SimNewsResource = SimNewsResource;
|
|
98
|
+
/**
|
|
99
|
+
* News resource for accessing news feeds
|
|
100
|
+
*/
|
|
101
|
+
class NewsResource extends BaseResource_js_1.BaseResource {
|
|
102
|
+
constructor(http) {
|
|
103
|
+
super(http);
|
|
104
|
+
this.gns = new GNSResource(http);
|
|
105
|
+
this.simNews = new SimNewsResource(http);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
exports.NewsResource = NewsResource;
|
|
109
|
+
//# sourceMappingURL=NewsResource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NewsResource.js","sourceRoot":"","sources":["../../../src/resources/NewsResource.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAGH,uDAAiD;AAGjD;;GAEG;AACH,MAAa,WAAY,SAAQ,8BAAY;IAC3C;;;;;;;;;OASG;IACH,KAAK,CAAC,IAAI,CAAC,OAAyB;QAClC,MAAM,IAAI,GAAG,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,aAAa,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;QAE/E,MAAM,MAAM,GAAgB;YAC1B,WAAW,EAAE,OAAO,EAAE,WAAW,IAAI,CAAC;YACtC,UAAU,EAAE,OAAO,EAAE,UAAU,IAAI,EAAE;SACtC,CAAC;QAEF,IAAI,OAAO,EAAE,UAAU,KAAK,SAAS,EAAE,CAAC;YACtC,MAAM,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACzC,CAAC;QACD,IAAI,OAAO,EAAE,QAAQ,KAAK,SAAS,EAAE,CAAC;YACpC,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACrC,CAAC;QACD,IAAI,OAAO,EAAE,MAAM,EAAE,CAAC;YACpB,MAAM,CAAC,MAAM,GAAG,O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AAC;QACD,IAAI,OAAO,EAAE,MAAM,EAAE,CAAC;YACpB,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QACjC,CAAC;QACD,IAAI,OAAO,EAAE,MAAM,EAAE,CAAC;YACpB,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QACjC,CAAC;QACD,+EAA+E;QAE/E,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAa,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IACrD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,GAAG,CAAC,OAA2B;QACnC,OAAO,IAAI,CAAC,OAAO,CAAW,KAAK,EAAE,iBAAiB,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;IACtE,CAAC;CACF;AAzCD,0CAyCC;AAED;;GAEG;AACH,MAAa,YAAa,SAAQ,8BAAY;IAI5C,YAAY,IAAgB;QAC1B,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,GAAG,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,CAAC,OAAO,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;CACF;AATD,oCASC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Types resource for accessing entity type information
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TypesResource = exports.TypesEntitiesResource = exports.TypesClassesResource = void 0;
|
|
7
|
+
const BaseResource_js_1 = require("./BaseResource.js");
|
|
8
|
+
/**
|
|
9
|
+
* Entity classes resource
|
|
10
|
+
*/
|
|
11
|
+
class TypesClassesResource extends BaseResource_js_1.BaseResource {
|
|
12
|
+
/**
|
|
13
|
+
* Get all classes for an entity type (paginated)
|
|
14
|
+
* @param options - Entity type and optional pagination parameters
|
|
15
|
+
* @example
|
|
16
|
+
* const classes = await client.types.classes.list({ entityType: 'vehicle' });
|
|
17
|
+
* const moreClasses = await client.types.classes.list({ entityType: 'vehicle', start_index: 51, item_count: 50 });
|
|
18
|
+
*/
|
|
19
|
+
async list(options) {
|
|
20
|
+
const params = {
|
|
21
|
+
start_index: options.start_index || 1,
|
|
22
|
+
item_count: options.item_count || 50,
|
|
23
|
+
};
|
|
24
|
+
return this.http.get(`/types/classes/${options.entityType}`, { params });
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.TypesClassesResource = TypesClassesResource;
|
|
28
|
+
/**
|
|
29
|
+
* Entities by type resource
|
|
30
|
+
*/
|
|
31
|
+
class TypesEntitiesResource extends BaseResource_js_1.BaseResource {
|
|
32
|
+
/**
|
|
33
|
+
* Get all entities of a type (paginated)
|
|
34
|
+
* @param options - Entity type, optional class filter, and optional pagination parameters
|
|
35
|
+
* @example
|
|
36
|
+
* const ships = await client.types.entities.list({ entityType: 'ships' });
|
|
37
|
+
* const moreShips = await client.types.entities.list({ entityType: 'ships', start_index: 51, item_count: 50 });
|
|
38
|
+
* const fighters = await client.types.entities.list({ entityType: 'ships', class: 'fighter', start_index: 1, item_count: 50 });
|
|
39
|
+
*/
|
|
40
|
+
async list(options) {
|
|
41
|
+
const path = options.class
|
|
42
|
+
? `/types/${options.entityType}/class/${options.class}`
|
|
43
|
+
: `/types/${options.entityType}`;
|
|
44
|
+
const params = {
|
|
45
|
+
start_index: options.start_index || 1,
|
|
46
|
+
item_count: options.item_count || 50,
|
|
47
|
+
};
|
|
48
|
+
return this.http.get(path, { params });
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Get specific entity type information
|
|
52
|
+
*/
|
|
53
|
+
async get(options) {
|
|
54
|
+
return this.request('GET', `/types/${options.entityType}/${options.uid}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.TypesEntitiesResource = TypesEntitiesResource;
|
|
58
|
+
/**
|
|
59
|
+
* Types resource for accessing type information
|
|
60
|
+
*/
|
|
61
|
+
class TypesResource extends BaseResource_js_1.BaseResource {
|
|
62
|
+
constructor(http) {
|
|
63
|
+
super(http);
|
|
64
|
+
this.classes = new TypesClassesResource(http);
|
|
65
|
+
this.entities = new TypesEntitiesResource(http);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Get all entity types
|
|
69
|
+
*/
|
|
70
|
+
async listEntityTypes() {
|
|
71
|
+
return this.request('GET', '/types/entitytypes');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.TypesResource = TypesResource;
|
|
75
|
+
//# sourceMappingURL=TypesResource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypesResource.js","sourceRoot":"","sources":["../../../src/resources/TypesResource.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAGH,uDAAiD;AAejD;;GAEG;AACH,MAAa,oBAAqB,SAAQ,8BAAY;IACpD;;;;;;OAMG;IACH,KAAK,CAAC,IAAI,CAAC,OAIV;QACC,MAAM,MAAM,GAAG;YACb,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,CAAC;YACrC,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,EAAE;SACrC,CAAC;QAEF,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAgB,kBAAkB,OAAO,CAAC,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IAC1F,CAAC;CACF;AApBD,oDAoBC;AAED;;GAEG;AACH,MAAa,qBAAsB,SAAQ,8BAAY;IACrD;;;;;;;OAOG;IACH,KAAK,CAAC,IAAI,CAAC,OAKV;QACC,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK;YACxB,CAAC,CAAC,UAAU,OAAO,CAAC,UAAU,UAAU,OAAO,CAAC,KAAK,EAAE;YACvD,CAAC,CAAC,UAAU,OAAO,CAAC,UAAU,EAAE,CAAC;QAEnC,MAAM,MAAM,GAAG;YACb,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,CAAC;YACrC,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,EAAE;SACrC,CAAC;QAEF,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAW,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IACnD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,GAAG,CAAC,OAA4C;QACpD,OAAO,IAAI,CAAC,OAAO,CAAS,KAAK,EAAE,UAAU,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACpF,CAAC;CACF;AAjCD,sDAiCC;AAED;;GAEG;AACH,MAAa,aAAc,SAAQ,8BAAY;IAI7C,YAAY,IAAgB;QAC1B,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,OAAO,GAAG,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,CAAC,QAAQ,GAAG,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,eAAe;QACnB,OAAO,IAAI,CAAC,OAAO,CAAe,KAAK,EAAE,oBAAoB,CAAC,CAAC;IACjE,CAAC;CACF;AAhBD,sCAgBC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Core types and interfaces for SW Combine SDK
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.MessageMode = exports.AccessType = exports.GrantType = void 0;
|
|
7
|
+
// ============================================================================
|
|
8
|
+
// Enums
|
|
9
|
+
// ============================================================================
|
|
10
|
+
var GrantType;
|
|
11
|
+
(function (GrantType) {
|
|
12
|
+
GrantType["AuthorizationCode"] = "authorization_code";
|
|
13
|
+
GrantType["RefreshToken"] = "refresh_token";
|
|
14
|
+
})(GrantType || (exports.GrantType = GrantType = {}));
|
|
15
|
+
var AccessType;
|
|
16
|
+
(function (AccessType) {
|
|
17
|
+
AccessType["Online"] = "online";
|
|
18
|
+
AccessType["Offline"] = "offline";
|
|
19
|
+
})(AccessType || (exports.AccessType = AccessType = {}));
|
|
20
|
+
var MessageMode;
|
|
21
|
+
(function (MessageMode) {
|
|
22
|
+
MessageMode["Sent"] = "sent";
|
|
23
|
+
MessageMode["Received"] = "received";
|
|
24
|
+
})(MessageMode || (exports.MessageMode = MessageMode = {}));
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAYH,+EAA+E;AAC/E,QAAQ;AACR,+EAA+E;AAE/E,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,qDAAwC,CAAA;IACxC,2CAA8B,CAAA;AAChC,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAED,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,+BAAiB,CAAA;IACjB,iCAAmB,CAAA;AACrB,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB;AAED,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,oCAAqB,CAAA;AACvB,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB"}
|