usrspace-browser-addon/types.d.ts

940 lines
28 KiB
TypeScript

export type Storage = {
calendar?: Calendar | undefined;
spaceApi?: SpaceApi | undefined;
};
export type Calendar = readonly CalendarEntry[];
export type CalendarEntry = {
readonly begin: string;
readonly begin_date: `${number}.${number}.${number}`;
readonly begin_time: `${number}:${number}`;
readonly end: string;
readonly end_date: `${number}.${number}.${number}`;
readonly end_time: `${number}:${number}`;
readonly name: string;
readonly description: string | null;
readonly location: string | null;
};
/**
* SpaceAPI v14
*/
export interface SpaceApi {
/**
* The versions your SpaceAPI endpoint supports
*/
api_compatibility: string[];
/**
* The name of your space
*/
space: string;
/**
* URL to your space logo
*/
logo: string;
/**
* URL to your space website
*/
url: string;
/**
* Position data such as a postal address or geographic coordinates
*/
location: {
/**
* The postal address of your space (street, block, housenumber, zip code, city, whatever you usually need in your country, and the country itself).<br>Examples: <ul><li>Netzladen e.V., Breite Straße 74, 53111 Bonn, Germany</li></ul>
*/
address?: string;
/**
* Latitude of your space location, in degree with decimal places. Use positive values for locations north of the equator, negative values for locations south of equator.
*/
lat: number;
/**
* Longitude of your space location, in degree with decimal places. Use positive values for locations east of Greenwich, and negative values for locations west of Greenwich.
*/
lon: number;
/**
* The timezone the space is located in. It should be formatted according to the <a target="_blank" href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">TZ database location names</a>.
*/
timezone?: string;
[k: string]: unknown;
};
/**
* A flag indicating if the hackerspace uses SpaceFED, a federated login scheme so that visiting hackers can use the space WiFi with their home space credentials.
*/
spacefed?: {
/**
* See the <a target="_blank" href="https://spacefed.net/index.php/Category:Howto/Spacenet">wiki</a>.
*/
spacenet: boolean;
/**
* See the <a target="_blank" href="https://spacefed.net/index.php?title=Spacesaml">wiki</a>.
*/
spacesaml: boolean;
[k: string]: unknown;
};
/**
* URL(s) of webcams in your space
*/
cam?: [string, ...string[]];
/**
* A collection of status-related data: actual open/closed status, icons, last change timestamp etc.
*/
state?: {
/**
* A flag which indicates whether the space is currently open or closed. The state 'undefined' can be achieved by omitting this field. A missing 'open' property carries the semantics of a temporary unavailability of the state, whereas the absence of the 'state' property itself means the state is generally not implemented for this space. This field is also allowed to explicitly have the value null for backwards compatibility with older schema versions, but this is deprecated and will be removed in a future version.
*/
open?: boolean | null;
/**
* The Unix timestamp when the space status changed most recently
*/
lastchange?: number;
/**
* The person who lastly changed the state e.g. opened or closed the space
*/
trigger_person?: string;
/**
* An additional free-form string, could be something like <samp>'open for public'</samp>, <samp>'members only'</samp> or whatever you want it to be
*/
message?: string;
/**
* Icons that show the status graphically
*/
icon?: {
/**
* The URL to your customized space logo showing an open space
*/
open: string;
/**
* The URL to your customized space logo showing a closed space
*/
closed: string;
[k: string]: unknown;
};
[k: string]: unknown;
};
/**
* Events which happened recently in your space and which could be interesting to the public, like 'User X has entered/triggered/did something at timestamp Z'
*/
events?: {
/**
* Name or other identity of the subject (e.g. <samp>J. Random Hacker</samp>, <samp>fridge</samp>, <samp>3D printer</samp>, …)
*/
name: string;
/**
* Action (e.g. <samp>check-in</samp>, <samp>check-out</samp>, <samp>finish-print</samp>, …). Define your own actions and use them consistently, canonical actions are not (yet) specified
*/
type: string;
/**
* Unix timestamp when the event occurred
*/
timestamp: number;
/**
* A custom text field to give more information about the event
*/
extra?: string;
[k: string]: unknown;
}[];
/**
* Contact information about your space
*/
contact: {
/**
* Phone number, including country code with a leading plus sign
*/
phone?: string;
/**
* URI for Voice-over-IP via SIP
*/
sip?: string;
/**
* Persons who carry a key and are able to open the space upon request. One of the fields irc_nick, phone, email or twitter must be specified.
*/
keymasters?: [
{
/**
* Real name
*/
name?: string;
/**
* Contact the person with this nickname directly in irc if available. The irc channel to be used is defined in the contact/irc field.
*/
irc_nick?: string;
/**
* Phone number, including country code with a leading plus sign
*/
phone?: string;
/**
* Email address which can be base64 encoded
*/
email?: string;
/**
* Twitter username with leading <code>@</code>
*/
twitter?: string;
/**
* XMPP (Jabber) ID
*/
xmpp?: string;
/**
* Mastodon username
*/
mastodon?: string;
/**
* Matrix username (including domain)
*/
matrix?: string;
[k: string]: unknown;
},
...{
/**
* Real name
*/
name?: string;
/**
* Contact the person with this nickname directly in irc if available. The irc channel to be used is defined in the contact/irc field.
*/
irc_nick?: string;
/**
* Phone number, including country code with a leading plus sign
*/
phone?: string;
/**
* Email address which can be base64 encoded
*/
email?: string;
/**
* Twitter username with leading <code>@</code>
*/
twitter?: string;
/**
* XMPP (Jabber) ID
*/
xmpp?: string;
/**
* Mastodon username
*/
mastodon?: string;
/**
* Matrix username (including domain)
*/
matrix?: string;
[k: string]: unknown;
}[],
];
/**
* URL of the IRC channel
*/
irc?: string;
/**
* Twitter username with leading <code>@</code>
*/
twitter?: string;
/**
* Mastodon username
*/
mastodon?: string;
/**
* Facebook account URL
*/
facebook?: string;
/**
* Identi.ca or StatusNet account, in the form <samp>yourspace@example.org</samp>
*/
identica?: string;
/**
* Foursquare ID, in the form <samp>4d8a9114d85f3704eab301dc</samp>
*/
foursquare?: string;
/**
* E-mail address for contacting your space. If this is a mailing list consider to use the contact/ml field.
*/
email?: string;
/**
* The e-mail address of your mailing list. If you use Google Groups then the e-mail looks like <samp>your-group@googlegroups.com</samp>.
*/
ml?: string;
/**
* A public Jabber/XMPP multi-user chatroom in the form <samp>chatroom@conference.example.net</samp>
*/
xmpp?: string;
/**
* A separate email address for issue reports. This value can be Base64-encoded.
*/
issue_mail?: string;
/**
* A URL to find information about the Space in the Gopherspace
*/
gopher?: string;
/**
* Matrix channel/community for the Hackerspace
*/
matrix?: string;
/**
* URL to a Mumble server/channel, as specified in https://wiki.mumble.info/wiki/Mumble_URL
*/
mumble?: string;
[k: string]: unknown;
};
/**
* Data of various sensors in your space (e.g. temperature, humidity, amount of Club-Mate left, …). The only canonical property is the <em>temp</em> property, additional sensor types may be defined by you. In this case, you are requested to share your definition for inclusion in this specification.
*/
sensors?: {
/**
* Temperature sensor. To convert from one unit of temperature to another consider <a href="http://en.wikipedia.org/wiki/Temperature_conversion_formulas" target="_blank">Wikipedia</a>.
*/
temperature?: {
/**
* The sensor value
*/
value: number;
/**
* The unit of the sensor value
*/
unit: '°C' | '°F' | 'K' | '°De' | '°N' | '°R' | '°Ré' | '°Rø';
/**
* The location of your sensor
*/
location: string;
/**
* This field is an additional field to give your sensor a name. This can be useful if you have multiple sensors in the same location.
*/
name?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
/**
* Sensor type to indicate if a certain door is locked
*/
door_locked?: {
/**
* The sensor value
*/
value: boolean;
/**
* The location of your sensor
*/
location: string;
/**
* This field is an additional field to give your sensor a name. This can be useful if you have multiple sensors in the same location.
*/
name?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
/**
* Barometer sensor
*/
barometer?: {
/**
* The sensor value
*/
value: number;
/**
* The unit of pressure used by your sensor<br>Note: The <code>hPA</code> unit is deprecated and should not be used anymore. Use the correct <code>hPa</code> unit instead.
*/
unit: 'hPa' | 'hPA';
/**
* The location of your sensor
*/
location: string;
/**
* This field is an additional field to give your sensor a name. This can be useful if you have multiple sensors in the same location.
*/
name?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
/**
* Compound radiation sensor. Check this <a rel="nofollow" href="https://sites.google.com/site/diygeigercounter/gm-tubes-supported" target="_blank">resource</a>.
*/
radiation?: {
/**
* An alpha sensor
*/
alpha?: {
/**
* Observed counts per minute (ocpm) or actual radiation value. If the value are the observed counts then the dead_time and conversion_factor fields must be defined as well. CPM formula: <div>cpm = ocpm ( 1 + 1 / (1 - ocpm x dead_time) )</div> Conversion formula: <div>µSv/h = cpm x conversion_factor</div>
*/
value: number;
/**
* Choose the appropriate unit for your radiation sensor instance
*/
unit: 'cpm' | 'r/h' | 'µSv/h' | 'mSv/a' | 'µSv/a';
/**
* The dead time in µs. See the description of the value field to see how to use the dead time.
*/
dead_time?: number;
/**
* The conversion from the <em>cpm</em> unit to another unit hardly depends on your tube type. See the description of the value field to see how to use the conversion factor. <strong>Note:</strong> only trust your manufacturer if it comes to the actual factor value. The internet seems <a rel="nofollow" href="http://sapporohibaku.wordpress.com/2011/10/15/conversion-factor/" target="_blank">full of wrong copy & pastes</a>, don't even trust your neighbour hackerspace. If in doubt ask the tube manufacturer.
*/
conversion_factor?: number;
/**
* The location of your sensor
*/
location?: string;
/**
* This field is an additional field to give your sensor a name. This can be useful if you have multiple sensors in the same location.
*/
name?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
/**
* A beta sensor
*/
beta?: {
/**
* Observed counts per minute (ocpm) or actual radiation value. If the value are the observed counts then the dead_time and conversion_factor fields must be defined as well. CPM formula: <div>cpm = ocpm ( 1 + 1 / (1 - ocpm x dead_time) )</div> Conversion formula: <div>µSv/h = cpm x conversion_factor</div>
*/
value: number;
/**
* Choose the appropriate unit for your radiation sensor instance
*/
unit: 'cpm' | 'r/h' | 'µSv/h' | 'mSv/a' | 'µSv/a';
/**
* The dead time in µs. See the description of the value field to see how to use the dead time.
*/
dead_time?: number;
/**
* The conversion from the <em>cpm</em> unit to another unit hardly depends on your tube type. See the description of the value field to see how to use the conversion factor. <strong>Note:</strong> only trust your manufacturer if it comes to the actual factor value. The internet seems <a rel="nofollow" href="http://sapporohibaku.wordpress.com/2011/10/15/conversion-factor/" target="_blank">full of wrong copy & pastes</a>, don't even trust your neighbour hackerspace. If in doubt ask the tube manufacturer.
*/
conversion_factor?: number;
/**
* The location of your sensor
*/
location?: string;
/**
* This field is an additional field to give your sensor a name. This can be useful if you have multiple sensors in the same location.
*/
name?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
/**
* A gamma sensor
*/
gamma?: {
/**
* Observed counts per minute (ocpm) or actual radiation value. If the value are the observed counts then the dead_time and conversion_factor fields must be defined as well. CPM formula: <div>cpm = ocpm ( 1 + 1 / (1 - ocpm x dead_time) )</div> Conversion formula: <div>µSv/h = cpm x conversion_factor</div>
*/
value: number;
/**
* Choose the appropriate unit for your radiation sensor instance
*/
unit: 'cpm' | 'r/h' | 'µSv/h' | 'mSv/a' | 'µSv/a';
/**
* The dead time in µs. See the description of the value field to see how to use the dead time.
*/
dead_time?: number;
/**
* The conversion from the <em>cpm</em> unit to another unit hardly depends on your tube type. See the description of the value field to see how to use the conversion factor. <strong>Note:</strong> only trust your manufacturer if it comes to the actual factor value. The internet seems <a rel="nofollow" href="http://sapporohibaku.wordpress.com/2011/10/15/conversion-factor/" target="_blank">full of wrong copy & pastes</a>, don't even trust your neighbour hackerspace. If in doubt ask the tube manufacturer.
*/
conversion_factor?: number;
/**
* The location of your sensor
*/
location?: string;
/**
* This field is an additional field to give your sensor a name. This can be useful if you have multiple sensors in the same location.
*/
name?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
/**
* A sensor which cannot filter beta and gamma radiation separately.
*/
beta_gamma?: {
/**
* Observed counts per minute (ocpm) or actual radiation value. If the value are the observed counts then the dead_time and conversion_factor fields must be defined as well. CPM formula: <div>cpm = ocpm ( 1 + 1 / (1 - ocpm x dead_time) )</div> Conversion formula: <div>µSv/h = cpm x conversion_factor</div>
*/
value: number;
/**
* Choose the appropriate unit for your radiation sensor instance
*/
unit: 'cpm' | 'r/h' | 'µSv/h' | 'mSv/a' | 'µSv/a';
/**
* The dead time in µs. See the description of the value field to see how to use the dead time.
*/
dead_time?: number;
/**
* The conversion from the <em>cpm</em> unit to another unit hardly depends on your tube type. See the description of the value field to see how to use the conversion factor. <strong>Note:</strong> only trust your manufacturer if it comes to the actual factor value. The internet seems <a rel="nofollow" href="http://sapporohibaku.wordpress.com/2011/10/15/conversion-factor/" target="_blank">full of wrong copy & pastes</a>, don't even trust your neighbour hackerspace. If in doubt ask the tube manufacturer.
*/
conversion_factor?: number;
/**
* The location of your sensor
*/
location?: string;
/**
* This field is an additional field to give your sensor a name. This can be useful if you have multiple sensors in the same location.
*/
name?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
[k: string]: unknown;
};
/**
* Humidity sensor
*/
humidity?: {
/**
* The sensor value
*/
value: number;
/**
* The unit of the sensor value. You should always define the unit though if the sensor is a flag of a boolean type then you can of course omit it.
*/
unit: '%';
/**
* The location of your sensor
*/
location: string;
/**
* This field is an additional field to give your sensor a name. This can be useful if you have multiple sensors in the same location.
*/
name?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
/**
* How much Mate and beer is in your fridge?
*/
beverage_supply?: {
/**
* The sensor value
*/
value: number;
/**
* The unit, either <samp>btl</samp> for bottles or <samp>crt</samp> for crates
*/
unit: 'btl' | 'crt';
/**
* The location of your sensor
*/
location?: string;
/**
* This field is an additional field to give your sensor a name. This can be useful if you have multiple sensors in the same location.
*/
name?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
/**
* The power consumption of a specific device or of your whole space
*/
power_consumption?: {
/**
* The sensor value
*/
value: number;
/**
* The unit of the sensor value. You should always define the unit though if the sensor is a flag of a boolean type then you can of course omit it.
*/
unit: 'mW' | 'W' | 'VA';
/**
* The location of your sensor
*/
location: string;
/**
* This field is an additional field to give your sensor a name. This can be useful if you have multiple sensors in the same location.
*/
name?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
/**
* Your wind sensor
*/
wind?: {
properties: {
speed: {
/**
* The sensor value
*/
value: number;
/**
* The unit of the sensor value. You should always define the unit though if the sensor is a flag of a boolean type then you can of course omit it.
*/
unit: 'm/s' | 'km/h' | 'kn';
[k: string]: unknown;
};
gust: {
/**
* The sensor value
*/
value: number;
/**
* The unit of the sensor value. You should always define the unit though if the sensor is a flag of a boolean type then you can of course omit it.
*/
unit: 'm/s' | 'km/h' | 'kn';
[k: string]: unknown;
};
/**
* The wind direction in degrees
*/
direction: {
/**
* The sensor value
*/
value: number;
/**
* The unit of the sensor value. You should always define the unit though if the sensor is a flag of a boolean type then you can of course omit it.
*/
unit: '°';
[k: string]: unknown;
};
/**
* Height above mean sea level
*/
elevation: {
/**
* The sensor value
*/
value: number;
/**
* The unit of the sensor value. You should always define the unit though if the sensor is a flag of a boolean type then you can of course omit it.
*/
unit: 'm';
[k: string]: unknown;
};
[k: string]: unknown;
};
/**
* The location of your sensor
*/
location: string;
/**
* This field is an additional field to give your sensor a name. This can be useful if you have multiple sensors in the same location.
*/
name?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
/**
* This sensor type is to specify the currently active ethernet or wireless network devices. You can create different instances for each network type.
*/
network_connections?: {
/**
* This field is optional but you can use it to the network type such as <samp>wifi</samp> or <samp>cable</samp>. You can even expose the number of <a href="https://spacefed.net/wiki/index.php/Spacenet" target="_blank">spacenet</a>-authenticated connections.
*/
type?: 'wifi' | 'cable' | 'spacenet';
/**
* The amount of network connections.
*/
value: number;
/**
* The machines that are currently connected with the network.
*/
machines?: {
/**
* The machine name.
*/
name?: string;
/**
* The machine's MAC address of the format <samp>D3:3A:DB:EE:FF:00</samp>.
*/
mac: string;
[k: string]: unknown;
}[];
/**
* The location of your sensor
*/
location?: string;
/**
* This field is an additional field to give your sensor a name. This can be useful if you have multiple sensors in the same location.
*/
name?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
/**
* How rich is your hackerspace?
*/
account_balance?: {
/**
* How much?
*/
value: number;
/**
* What's the currency? It should be formatted according to <a href="https://en.wikipedia.org/wiki/ISO_4217" target="_blank">ISO 4217</a> short-code format.
*/
unit: string;
/**
* If you have more than one account you can use this field to specify where it is.
*/
location?: string;
/**
* Give your sensor instance a name.
*/
name?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
/**
* Specify the number of space members.
*/
total_member_count?: {
/**
* The amount of your space members.
*/
value: number;
/**
* Specify the location if your hackerspace has different departments (for whatever reason). This field is for one department. Every department should have its own sensor instance.
*/
location?: string;
/**
* You can use this field to specify if this sensor instance counts active or inactive members.
*/
name?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
/**
* Specify the number of people that are currently in your space. Optionally you can define a list of names.
*/
people_now_present?: {
/**
* The amount of present people.
*/
value: number;
/**
* If you use multiple sensor instances for different rooms, use this field to indicate the location.
*/
location?: string;
/**
* Give this sensor a name if necessary at all. Use the location field for the rooms. This field is not intended to be used for names of hackerspace members. Use the field 'names' instead.
*/
name?: string;
/**
* List of hackerspace members that are currently occupying the space.
*/
names?: [string, ...string[]];
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[];
/**
* The current network traffic, in bits/second or packets/second (or both)
*/
network_traffic?: [
{
properties: {
bits_per_second?: {
/**
* The measurement value, in bits/second
*/
value: number;
/**
* The maximum available throughput in bits/second, e.g. as sold by your ISP
*/
maximum?: number;
[k: string]: unknown;
};
packets_per_second?: {
/**
* The measurement value, in packets/second
*/
value: number;
[k: string]: unknown;
};
[k: string]: unknown;
};
/**
* Name of the measurement, e.g. to distinguish between upstream and downstream traffic
*/
name?: string;
/**
* Location the measurement relates to, e.g. <samp>WiFi</samp> or <samp>Uplink</samp>
*/
location?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
},
...{
properties: {
bits_per_second?: {
/**
* The measurement value, in bits/second
*/
value: number;
/**
* The maximum available throughput in bits/second, e.g. as sold by your ISP
*/
maximum?: number;
[k: string]: unknown;
};
packets_per_second?: {
/**
* The measurement value, in packets/second
*/
value: number;
[k: string]: unknown;
};
[k: string]: unknown;
};
/**
* Name of the measurement, e.g. to distinguish between upstream and downstream traffic
*/
name?: string;
/**
* Location the measurement relates to, e.g. <samp>WiFi</samp> or <samp>Uplink</samp>
*/
location?: string;
/**
* An extra field that you can use to attach some additional information to this sensor instance
*/
description?: string;
[k: string]: unknown;
}[],
];
[k: string]: unknown;
};
/**
* Feeds where users can get updates of your space
*/
feeds?: {
blog?: {
/**
* Type of the feed
*/
type?: string;
/**
* Feed URL
*/
url: string;
[k: string]: unknown;
};
wiki?: {
/**
* Type of the feed
*/
type?: string;
/**
* Feed URL
*/
url: string;
[k: string]: unknown;
};
calendar?: {
/**
* Type of the feed
*/
type?: string;
/**
* Feed URL
*/
url: string;
[k: string]: unknown;
};
flickr?: {
/**
* Type of the feed
*/
type?: string;
/**
* Feed URL
*/
url: string;
[k: string]: unknown;
};
[k: string]: unknown;
};
/**
* Your project sites (links to GitHub, wikis or wherever your projects are hosted)
*/
projects?: string[];
/**
* Arbitrary links that you'd like to share
*/
links?: {
/**
* The link name
*/
name: string;
/**
* An extra field for a more detailed description of the link
*/
description?: string;
/**
* The URL
*/
url: string;
[k: string]: unknown;
}[];
/**
* A list of the different membership plans your hackerspace might have. Set the value according to your billing process. For example, if your membership fee is 10€ per month, but you bill it yearly (aka. the member pays the fee once per year), set the amount to 120 an the billing_interval to yearly.
*/
membership_plans?: {
/**
* The name of the membership plan
*/
name: string;
/**
* How much does this plan cost?
*/
value: number;
/**
* What's the currency? It should be formatted according to <a href="https://en.wikipedia.org/wiki/ISO_4217" target="_blank">ISO 4217</a> short-code format.
*/
currency: string;
/**
* How often is the membership billed? If you select other, please specify in the description what your billing interval is.
*/
billing_interval: 'yearly' | 'monthly' | 'weekly' | 'daily' | 'hourly' | 'other';
/**
* A free form string
*/
description?: string;
[k: string]: unknown;
}[];
[k: string]: unknown;
}