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,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Datacard resource for managing datacards
|
|
3
|
+
*/
|
|
4
|
+
import { BaseResource } from './BaseResource.js';
|
|
5
|
+
/**
|
|
6
|
+
* Datacard resource for managing datacards
|
|
7
|
+
*/
|
|
8
|
+
export class DatacardResource extends BaseResource {
|
|
9
|
+
/**
|
|
10
|
+
* List datacards owned by faction
|
|
11
|
+
*/
|
|
12
|
+
async list(options) {
|
|
13
|
+
return this.request('GET', `/datacards/${options.factionId}`);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Get specific datacard
|
|
17
|
+
*/
|
|
18
|
+
async get(options) {
|
|
19
|
+
return this.request('GET', `/datacard/${options.uid}`);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Create datacard
|
|
23
|
+
*/
|
|
24
|
+
async create(options) {
|
|
25
|
+
return this.request('POST', `/datacard`, {
|
|
26
|
+
factionId: options.factionId,
|
|
27
|
+
name: options.name,
|
|
28
|
+
description: options.description,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Delete datacard
|
|
33
|
+
*/
|
|
34
|
+
async delete(options) {
|
|
35
|
+
return this.request('DELETE', `/datacard/${options.uid}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=DatacardResource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatacardResource.js","sourceRoot":"","sources":["../../../src/resources/DatacardResource.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AASjD;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,YAAY;IAChD;;OAEG;IACH,KAAK,CAAC,IAAI,CAAC,OAA8B;QACvC,OAAO,IAAI,CAAC,OAAO,CAAa,KAAK,EAAE,cAAc,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,GAAG,CAAC,OAAwB;QAChC,OAAO,IAAI,CAAC,OAAO,CAAW,KAAK,EAAE,aAAa,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACnE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,OAAkE;QAC7E,OAAO,IAAI,CAAC,OAAO,CAAW,MAAM,EAAE,WAAW,EAAE;YACjD,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,WAAW,EAAE,OAAO,CAAC,WAAW;SACjC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,OAAwB;QACnC,OAAO,IAAI,CAAC,OAAO,CAAO,QAAQ,EAAE,aAAa,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAClE,CAAC;CACF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Events resource for accessing event data
|
|
3
|
+
*/
|
|
4
|
+
import { BaseResource } from './BaseResource.js';
|
|
5
|
+
/**
|
|
6
|
+
* Events resource for querying events
|
|
7
|
+
*/
|
|
8
|
+
export class EventsResource extends BaseResource {
|
|
9
|
+
/**
|
|
10
|
+
* List events by type and mode (paginated)
|
|
11
|
+
* @param options - Event mode, event type, and optional pagination/filtering parameters
|
|
12
|
+
* @example
|
|
13
|
+
* const events = await client.events.list({ eventMode: 'personal', eventType: 'all' });
|
|
14
|
+
* const moreEvents = await client.events.list({ eventMode: 'personal', eventType: 'all', start_index: 50, item_count: 50 });
|
|
15
|
+
* const recentEvents = await client.events.list({ eventMode: 'personal', eventType: 'all', start_time: 1640000000 });
|
|
16
|
+
* const factionEvents = await client.events.list({ eventMode: 'faction', eventType: 'all', faction_id: '20:123' });
|
|
17
|
+
*/
|
|
18
|
+
async list(options) {
|
|
19
|
+
const params = {
|
|
20
|
+
start_index: options.start_index !== undefined ? options.start_index : 0, // 0-based indexing!
|
|
21
|
+
item_count: options.item_count || 50,
|
|
22
|
+
};
|
|
23
|
+
if (options.start_time !== undefined) {
|
|
24
|
+
params.start_time = options.start_time;
|
|
25
|
+
}
|
|
26
|
+
if (options.faction_id) {
|
|
27
|
+
params.faction_id = options.faction_id;
|
|
28
|
+
}
|
|
29
|
+
return this.http.get(`/events/${options.eventMode}/${options.eventType}`, { params });
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Get specific event
|
|
33
|
+
*/
|
|
34
|
+
async get(options) {
|
|
35
|
+
return this.request('GET', `/event/${options.uid}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=EventsResource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventsResource.js","sourceRoot":"","sources":["../../../src/resources/EventsResource.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,YAAY;IAC9C;;;;;;;;OAQG;IACH,KAAK,CAAC,IAAI,CAAC,OAOV;QACC,MAAM,MAAM,GAAgB;YAC1B,WAAW,EAAE,OAAO,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,oBAAoB;YAC9F,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,EAAE;SACrC,CAAC;QAEF,IAAI,OAAO,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YACrC,MAAM,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACzC,CAAC;QACD,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YACvB,MAAM,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACzC,CAAC;QAED,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAU,WAAW,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IACjG,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,GAAG,CAAC,OAAwB;QAChC,OAAO,IAAI,CAAC,OAAO,CAAQ,KAAK,EAAE,UAAU,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAC7D,CAAC;CACF"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Faction resource for accessing faction data
|
|
3
|
+
*/
|
|
4
|
+
import { BaseResource } from './BaseResource.js';
|
|
5
|
+
/**
|
|
6
|
+
* Faction members resource
|
|
7
|
+
*/
|
|
8
|
+
export class FactionMembersResource extends BaseResource {
|
|
9
|
+
/**
|
|
10
|
+
* List faction members (paginated)
|
|
11
|
+
* @param options - Faction ID and optional pagination parameters
|
|
12
|
+
* @example
|
|
13
|
+
* const members = await client.faction.members.list({ factionId: '20:123' });
|
|
14
|
+
* const moreMembers = await client.faction.members.list({ factionId: '20:123', start_index: 51, item_count: 50 });
|
|
15
|
+
*/
|
|
16
|
+
async list(options) {
|
|
17
|
+
const params = {
|
|
18
|
+
start_index: options.start_index || 1,
|
|
19
|
+
item_count: options.item_count || 50,
|
|
20
|
+
};
|
|
21
|
+
return this.http.get(`/faction/${options.factionId}/members`, { params });
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Add or update faction member
|
|
25
|
+
*/
|
|
26
|
+
async update(options) {
|
|
27
|
+
return this.request('POST', `/faction/${options.factionId}/members`, {
|
|
28
|
+
characterId: options.characterId,
|
|
29
|
+
rank: options.rank,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Faction budgets resource
|
|
35
|
+
*/
|
|
36
|
+
export class FactionBudgetsResource extends BaseResource {
|
|
37
|
+
/**
|
|
38
|
+
* List faction budgets (paginated)
|
|
39
|
+
* @param options - Faction ID and optional pagination parameters
|
|
40
|
+
* @example
|
|
41
|
+
* const budgets = await client.faction.budgets.list({ factionId: '20:123' });
|
|
42
|
+
* const moreBudgets = await client.faction.budgets.list({ factionId: '20:123', start_index: 51, item_count: 50 });
|
|
43
|
+
*/
|
|
44
|
+
async list(options) {
|
|
45
|
+
const params = {
|
|
46
|
+
start_index: options.start_index || 1,
|
|
47
|
+
item_count: options.item_count || 50,
|
|
48
|
+
};
|
|
49
|
+
return this.http.get(`/faction/${options.factionId}/budgets`, { params });
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Get specific budget
|
|
53
|
+
*/
|
|
54
|
+
async get(options) {
|
|
55
|
+
return this.request('GET', `/faction/${options.factionId}/budget/${options.budgetId}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Faction stockholders resource
|
|
60
|
+
*/
|
|
61
|
+
export class FactionStockholdersResource extends BaseResource {
|
|
62
|
+
/**
|
|
63
|
+
* List faction stockholders (paginated)
|
|
64
|
+
* @param options - Faction ID and optional pagination parameters
|
|
65
|
+
* @example
|
|
66
|
+
* const stockholders = await client.faction.stockholders.list({ factionId: '20:123' });
|
|
67
|
+
* const moreStockholders = await client.faction.stockholders.list({ factionId: '20:123', start_index: 51, item_count: 50 });
|
|
68
|
+
*/
|
|
69
|
+
async list(options) {
|
|
70
|
+
const params = {
|
|
71
|
+
start_index: options.start_index || 1,
|
|
72
|
+
item_count: options.item_count || 50,
|
|
73
|
+
};
|
|
74
|
+
return this.http.get(`/faction/${options.factionId}/stockholders`, { params });
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Faction credits resource
|
|
79
|
+
*/
|
|
80
|
+
export class FactionCreditsResource extends BaseResource {
|
|
81
|
+
/**
|
|
82
|
+
* Get faction credits
|
|
83
|
+
*/
|
|
84
|
+
async get(options) {
|
|
85
|
+
return this.request('GET', `/faction/${options.factionId}/credits`);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Transfer faction credits
|
|
89
|
+
*/
|
|
90
|
+
async update(options) {
|
|
91
|
+
return this.request('POST', `/faction/${options.factionId}/credits`, {
|
|
92
|
+
amount: options.amount,
|
|
93
|
+
recipient: options.recipient,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Faction credit log resource
|
|
99
|
+
*/
|
|
100
|
+
export class FactionCreditlogResource extends BaseResource {
|
|
101
|
+
/**
|
|
102
|
+
* Get faction credit log (paginated)
|
|
103
|
+
* @param options - Faction ID and optional pagination/filtering parameters
|
|
104
|
+
* @example
|
|
105
|
+
* const creditlog = await client.faction.creditlog.list({ factionId: '20:123' });
|
|
106
|
+
* const moreLogs = await client.faction.creditlog.list({ factionId: '20:123', start_index: 51, item_count: 100 });
|
|
107
|
+
* const oldestLogs = await client.faction.creditlog.list({ factionId: '20:123', start_id: 1 });
|
|
108
|
+
*/
|
|
109
|
+
async list(options) {
|
|
110
|
+
const params = {
|
|
111
|
+
start_index: options.start_index || 1,
|
|
112
|
+
item_count: options.item_count || 50,
|
|
113
|
+
};
|
|
114
|
+
if (options.start_id !== undefined) {
|
|
115
|
+
params.start_id = options.start_id;
|
|
116
|
+
}
|
|
117
|
+
return this.http.get(`/faction/${options.factionId}/creditlog`, { params });
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Faction resource for managing factions
|
|
122
|
+
*/
|
|
123
|
+
export class FactionResource extends BaseResource {
|
|
124
|
+
constructor(http) {
|
|
125
|
+
super(http);
|
|
126
|
+
this.members = new FactionMembersResource(http);
|
|
127
|
+
this.budgets = new FactionBudgetsResource(http);
|
|
128
|
+
this.stockholders = new FactionStockholdersResource(http);
|
|
129
|
+
this.credits = new FactionCreditsResource(http);
|
|
130
|
+
this.creditlog = new FactionCreditlogResource(http);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Get faction by UID
|
|
134
|
+
*/
|
|
135
|
+
async get(options) {
|
|
136
|
+
return this.request('GET', `/faction/${options.uid}`);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* List all factions (paginated)
|
|
140
|
+
* @param options - Optional pagination parameters
|
|
141
|
+
* @example
|
|
142
|
+
* const factions = await client.faction.list();
|
|
143
|
+
* const moreFactions = await client.faction.list({ start_index: 51, item_count: 50 });
|
|
144
|
+
*/
|
|
145
|
+
async list(options) {
|
|
146
|
+
const params = {
|
|
147
|
+
start_index: options?.start_index || 1,
|
|
148
|
+
item_count: options?.item_count || 50,
|
|
149
|
+
};
|
|
150
|
+
return this.http.get('/factions', { params });
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=FactionResource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FactionResource.js","sourceRoot":"","sources":["../../../src/resources/FactionResource.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAqCjD;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,YAAY;IACtD;;;;;;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,IA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CAAC;QAChD,IAAI,CAAC,YAAY,GAAG,IAAI,2BAA2B,CAAC,IAAI,CAAC,CAAC;QAC1D,IAAI,CAAC,OAAO,GAAG,IAAI,sBAAsB,CAAC,IAAI,CAAC,CAAC;QAChD,IAAI,CAAC,SAAS,GAAG,IAAI,wBAAwB,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,GAAG,CAAC,OAA0B;QAClC,OAAO,IAAI,CAAC,OAAO,CAAU,KAAK,EAAE,YAAY,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;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,CAAY,WAAW,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IAC3D,CAAC;CACF"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Galaxy resource for accessing galactic data
|
|
3
|
+
*/
|
|
4
|
+
import { BaseResource } from './BaseResource.js';
|
|
5
|
+
/**
|
|
6
|
+
* Galaxy planets resource
|
|
7
|
+
*/
|
|
8
|
+
export class GalaxyPlanetsResource extends BaseResource {
|
|
9
|
+
/**
|
|
10
|
+
* List all planets (paginated)
|
|
11
|
+
* @param options - Optional pagination parameters
|
|
12
|
+
* @example
|
|
13
|
+
* const planets = await client.galaxy.planets.list();
|
|
14
|
+
* const morePlanets = await client.galaxy.planets.list({ start_index: 51, item_count: 50 });
|
|
15
|
+
*/
|
|
16
|
+
async list(options) {
|
|
17
|
+
const params = {
|
|
18
|
+
start_index: options?.start_index || 1,
|
|
19
|
+
item_count: options?.item_count || 50,
|
|
20
|
+
};
|
|
21
|
+
return this.http.get('/galaxy/planets/', { params });
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Get planet by UID
|
|
25
|
+
*/
|
|
26
|
+
async get(options) {
|
|
27
|
+
return this.request('GET', `/galaxy/planets/${options.uid}`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Galaxy sectors resource
|
|
32
|
+
*/
|
|
33
|
+
export class GalaxySectorsResource extends BaseResource {
|
|
34
|
+
/**
|
|
35
|
+
* List all sectors (paginated)
|
|
36
|
+
* @param options - Optional pagination parameters
|
|
37
|
+
* @example
|
|
38
|
+
* const sectors = await client.galaxy.sectors.list();
|
|
39
|
+
* const moreSectors = await client.galaxy.sectors.list({ start_index: 51, item_count: 50 });
|
|
40
|
+
*/
|
|
41
|
+
async list(options) {
|
|
42
|
+
const params = {
|
|
43
|
+
start_index: options?.start_index || 1,
|
|
44
|
+
item_count: options?.item_count || 50,
|
|
45
|
+
};
|
|
46
|
+
return this.http.get('/galaxy/sectors/', { params });
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Get sector by name or UID
|
|
50
|
+
* @param options - Sector identifier (use lowercase sector name, e.g., 'seswenna')
|
|
51
|
+
* @example
|
|
52
|
+
* const sector = await client.galaxy.sectors.get({ uid: 'seswenna' });
|
|
53
|
+
*/
|
|
54
|
+
async get(options) {
|
|
55
|
+
return this.request('GET', `/galaxy/sectors/${options.uid}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Galaxy systems resource
|
|
60
|
+
*/
|
|
61
|
+
export class GalaxySystemsResource extends BaseResource {
|
|
62
|
+
/**
|
|
63
|
+
* List all systems (paginated)
|
|
64
|
+
* @param options - Optional pagination parameters
|
|
65
|
+
* @example
|
|
66
|
+
* const systems = await client.galaxy.systems.list();
|
|
67
|
+
* const moreSystems = await client.galaxy.systems.list({ start_index: 51, item_count: 50 });
|
|
68
|
+
*/
|
|
69
|
+
async list(options) {
|
|
70
|
+
const params = {
|
|
71
|
+
start_index: options?.start_index || 1,
|
|
72
|
+
item_count: options?.item_count || 50,
|
|
73
|
+
};
|
|
74
|
+
return this.http.get('/galaxy/systems/', { params });
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Get system by UID
|
|
78
|
+
*/
|
|
79
|
+
async get(options) {
|
|
80
|
+
return this.request('GET', `/galaxy/systems/${options.uid}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Galaxy stations resource
|
|
85
|
+
*/
|
|
86
|
+
export class GalaxyStationsResource extends BaseResource {
|
|
87
|
+
/**
|
|
88
|
+
* List all stations in named systems with no ECM (paginated)
|
|
89
|
+
* @param options - Optional pagination parameters
|
|
90
|
+
* @example
|
|
91
|
+
* const stations = await client.galaxy.stations.list();
|
|
92
|
+
* const moreStations = await client.galaxy.stations.list({ start_index: 51, item_count: 50 });
|
|
93
|
+
*/
|
|
94
|
+
async list(options) {
|
|
95
|
+
const params = {
|
|
96
|
+
start_index: options?.start_index || 1,
|
|
97
|
+
item_count: options?.item_count || 50,
|
|
98
|
+
};
|
|
99
|
+
return this.http.get('/galaxy/stations/', { params });
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Get station by UID
|
|
103
|
+
*/
|
|
104
|
+
async get(options) {
|
|
105
|
+
return this.request('GET', `/galaxy/stations/${options.uid}`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Galaxy cities resource
|
|
110
|
+
*/
|
|
111
|
+
export class GalaxyCitiesResource extends BaseResource {
|
|
112
|
+
/**
|
|
113
|
+
* List all cities (paginated)
|
|
114
|
+
* @param options - Optional pagination parameters
|
|
115
|
+
* @example
|
|
116
|
+
* const cities = await client.galaxy.cities.list();
|
|
117
|
+
* const moreCities = await client.galaxy.cities.list({ start_index: 51, item_count: 50 });
|
|
118
|
+
*/
|
|
119
|
+
async list(options) {
|
|
120
|
+
const params = {
|
|
121
|
+
start_index: options?.start_index || 1,
|
|
122
|
+
item_count: options?.item_count || 50,
|
|
123
|
+
};
|
|
124
|
+
return this.http.get('/galaxy/cities/', { params });
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Get city by UID
|
|
128
|
+
*/
|
|
129
|
+
async get(options) {
|
|
130
|
+
return this.request('GET', `/galaxy/cities/${options.uid}`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Galaxy resource for accessing galactic information
|
|
135
|
+
*/
|
|
136
|
+
export class GalaxyResource extends BaseResource {
|
|
137
|
+
constructor(http) {
|
|
138
|
+
super(http);
|
|
139
|
+
this.planets = new GalaxyPlanetsResource(http);
|
|
140
|
+
this.sectors = new GalaxySectorsResource(http);
|
|
141
|
+
this.systems = new GalaxySystemsResource(http);
|
|
142
|
+
this.stations = new GalaxyStationsResource(http);
|
|
143
|
+
this.cities = new GalaxyCitiesResource(http);
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Extract unique sectors from systems list
|
|
147
|
+
* This is a helper method since the API doesn't provide a direct sectors list endpoint
|
|
148
|
+
* @returns Array of unique sector information extracted from systems
|
|
149
|
+
* @example
|
|
150
|
+
* const sectorsData = await client.galaxy.getSectorsFromSystems();
|
|
151
|
+
* // Returns: [{ uid: '25:160', name: 'Seswenna', href: '...' }, ...]
|
|
152
|
+
*/
|
|
153
|
+
async getSectorsFromSystems() {
|
|
154
|
+
const systemsResponse = await this.systems.list();
|
|
155
|
+
// Handle paginated response
|
|
156
|
+
const systems = systemsResponse.system || systemsResponse;
|
|
157
|
+
// Extract unique sectors
|
|
158
|
+
const sectorMap = new Map();
|
|
159
|
+
for (const system of systems) {
|
|
160
|
+
const sector = system.location?.container;
|
|
161
|
+
if (sector?.attributes?.uid && sector.attributes.type === 'sector') {
|
|
162
|
+
const uid = sector.attributes.uid;
|
|
163
|
+
if (!sectorMap.has(uid)) {
|
|
164
|
+
sectorMap.set(uid, {
|
|
165
|
+
uid: uid,
|
|
166
|
+
name: sector.value,
|
|
167
|
+
href: sector.attributes.href,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return Array.from(sectorMap.values());
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=GalaxyResource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GalaxyResource.js","sourceRoot":"","sources":["../../../src/resources/GalaxyResource.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAcjD;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,YAAY;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;AAED;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,YAAY;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;;;;;OAKG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AAS,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"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inventory resource for managing entities
|
|
3
|
+
*/
|
|
4
|
+
import { BaseResource } from './BaseResource.js';
|
|
5
|
+
/**
|
|
6
|
+
* Inventory entities resource
|
|
7
|
+
*/
|
|
8
|
+
export class InventoryEntitiesResource extends BaseResource {
|
|
9
|
+
/**
|
|
10
|
+
* List entities in inventory (paginated with optional filtering)
|
|
11
|
+
* @param options - Inventory UID, entity type, assign type, and optional pagination/filtering parameters
|
|
12
|
+
* @example
|
|
13
|
+
* const entities = await client.inventory.entities.list({ uid: '1:12345', entityType: 'vehicle', assignType: 'pilot' });
|
|
14
|
+
* const moreEntities = await client.inventory.entities.list({ uid: '1:12345', entityType: 'vehicle', assignType: 'pilot', start_index: 51, item_count: 100 });
|
|
15
|
+
* const filteredEntities = await client.inventory.entities.list({
|
|
16
|
+
* uid: '1:12345',
|
|
17
|
+
* entityType: 'vehicle',
|
|
18
|
+
* assignType: 'pilot',
|
|
19
|
+
* filter_type: ['hp'],
|
|
20
|
+
* filter_value: ['100'],
|
|
21
|
+
* filter_inclusion: ['includes']
|
|
22
|
+
* });
|
|
23
|
+
*/
|
|
24
|
+
async list(options) {
|
|
25
|
+
const params = {
|
|
26
|
+
start_index: options.start_index || 1,
|
|
27
|
+
item_count: options.item_count || 50,
|
|
28
|
+
};
|
|
29
|
+
// Add filtering parameters if provided
|
|
30
|
+
if (options.filter_type) {
|
|
31
|
+
params.filter_type = options.filter_type;
|
|
32
|
+
}
|
|
33
|
+
if (options.filter_value) {
|
|
34
|
+
params.filter_value = options.filter_value;
|
|
35
|
+
}
|
|
36
|
+
if (options.filter_inclusion) {
|
|
37
|
+
params.filter_inclusion = options.filter_inclusion;
|
|
38
|
+
}
|
|
39
|
+
return this.http.get(`/inventory/${options.uid}/${options.entityType}/${options.assignType}`, { params });
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Get specific entity
|
|
43
|
+
*/
|
|
44
|
+
async get(options) {
|
|
45
|
+
return this.request('GET', `/inventory/${options.entityType}/${options.uid}`);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Update entity property
|
|
49
|
+
*/
|
|
50
|
+
async updateProperty(options) {
|
|
51
|
+
return this.request('POST', `/inventory/${options.entityType}/${options.uid}/property`, {
|
|
52
|
+
property: options.property,
|
|
53
|
+
value: options.value,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Add tag to entity
|
|
58
|
+
*/
|
|
59
|
+
async addTag(options) {
|
|
60
|
+
return this.request('PUT', `/inventory/${options.entityType}/${options.uid}/tag/${options.tag}`);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Remove tag from entity
|
|
64
|
+
*/
|
|
65
|
+
async removeTag(options) {
|
|
66
|
+
return this.request('DELETE', `/inventory/${options.entityType}/${options.uid}/tag/${options.tag}`);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Remove all tags from entity
|
|
70
|
+
*/
|
|
71
|
+
async removeAllTags(options) {
|
|
72
|
+
return this.request('DELETE', `/inventory/${options.entityType}/${options.uid}/tags`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Inventory resource for managing inventories
|
|
77
|
+
*/
|
|
78
|
+
export class InventoryResource extends BaseResource {
|
|
79
|
+
constructor(http) {
|
|
80
|
+
super(http);
|
|
81
|
+
this.entities = new InventoryEntitiesResource(http);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Get inventory by UID
|
|
85
|
+
*/
|
|
86
|
+
async get(options) {
|
|
87
|
+
return this.request('GET', `/inventory/${options.uid}`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=InventoryResource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InventoryResource.js","sourceRoot":"","sources":["../../../src/resources/InventoryResource.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,YAAY;IACzD;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,IAAI,CAAC,OAAqC;QAC9C,MAAM,MAAM,GAAgB;YAC1B,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,CAAC;YACrC,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,EAAE;SACrC,CAAC;QAEF,uCAAuC;QACvC,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;YACxB,MAAM,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QAC3C,CAAC;QACD,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;YACzB,MAAM,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;QAC7C,CAAC;QACD,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;YAC7B,MAAM,CAAC,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QACrD,CAAC;QAED,OAAO,IAAI,CAAC,IAAI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C1B,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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Location resource for accessing entity locations
|
|
3
|
+
*/
|
|
4
|
+
import { BaseResource } from './BaseResource.js';
|
|
5
|
+
/**
|
|
6
|
+
* Location resource for querying entity locations
|
|
7
|
+
*/
|
|
8
|
+
export class LocationResource extends BaseResource {
|
|
9
|
+
/**
|
|
10
|
+
* Get entity location
|
|
11
|
+
*/
|
|
12
|
+
async get(options) {
|
|
13
|
+
return this.request('GET', `/location/${options.entityType}/${options.uid}`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=LocationResource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocationResource.js","sourceRoot":"","sources":["../../../src/resources/LocationResource.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,YAAY;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"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Market resource for accessing vendor data
|
|
3
|
+
*/
|
|
4
|
+
import { BaseResource } from './BaseResource.js';
|
|
5
|
+
/**
|
|
6
|
+
* Market vendors resource
|
|
7
|
+
*/
|
|
8
|
+
export class MarketVendorsResource extends BaseResource {
|
|
9
|
+
/**
|
|
10
|
+
* List all public vendors (paginated)
|
|
11
|
+
* @param options - Optional pagination parameters
|
|
12
|
+
* @example
|
|
13
|
+
* const vendors = await client.market.vendors.list();
|
|
14
|
+
* const moreVendors = await client.market.vendors.list({ start_index: 51, item_count: 50 });
|
|
15
|
+
*/
|
|
16
|
+
async list(options) {
|
|
17
|
+
const params = {
|
|
18
|
+
start_index: options?.start_index || 1,
|
|
19
|
+
item_count: options?.item_count || 50,
|
|
20
|
+
};
|
|
21
|
+
return this.http.get('/market/vendors', { params });
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Get vendor by UID
|
|
25
|
+
*/
|
|
26
|
+
async get(options) {
|
|
27
|
+
return this.request('GET', `/market/vendors/${options.uid}`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Market resource for accessing market data
|
|
32
|
+
*/
|
|
33
|
+
export class MarketResource extends BaseResource {
|
|
34
|
+
constructor(http) {
|
|
35
|
+
super(http);
|
|
36
|
+
this.vendors = new MarketVendorsResource(http);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=MarketResource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarketResource.js","sourceRoot":"","sources":["../../../src/resources/MarketResource.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,YAAY;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;AAED;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,YAAY;IAG9C,YAAY,IAAgB;QAC1B,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,OAAO,GAAG,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;CACF"}
|