@spaciv/sdk 0.1.13 → 0.1.15

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.
Files changed (33) hide show
  1. package/.openapi-generator/FILES +4 -0
  2. package/README.md +2 -2
  3. package/dist/apis/AuthenticationApi.d.ts +4 -4
  4. package/dist/apis/AuthenticationApi.js +2 -2
  5. package/dist/esm/apis/AuthenticationApi.d.ts +4 -4
  6. package/dist/esm/apis/AuthenticationApi.js +2 -2
  7. package/dist/esm/models/ClientMessage.d.ts +67 -0
  8. package/dist/esm/models/ClientMessage.js +55 -0
  9. package/dist/esm/models/EntityChangeActor.d.ts +61 -0
  10. package/dist/esm/models/EntityChangeActor.js +52 -0
  11. package/dist/esm/models/EntityChangedEvent.d.ts +84 -0
  12. package/dist/esm/models/EntityChangedEvent.js +57 -0
  13. package/dist/esm/models/ServerMessage.d.ts +92 -0
  14. package/dist/esm/models/ServerMessage.js +67 -0
  15. package/dist/esm/models/index.d.ts +4 -0
  16. package/dist/esm/models/index.js +4 -0
  17. package/dist/models/ClientMessage.d.ts +67 -0
  18. package/dist/models/ClientMessage.js +63 -0
  19. package/dist/models/EntityChangeActor.d.ts +61 -0
  20. package/dist/models/EntityChangeActor.js +60 -0
  21. package/dist/models/EntityChangedEvent.d.ts +84 -0
  22. package/dist/models/EntityChangedEvent.js +65 -0
  23. package/dist/models/ServerMessage.d.ts +92 -0
  24. package/dist/models/ServerMessage.js +75 -0
  25. package/dist/models/index.d.ts +4 -0
  26. package/dist/models/index.js +4 -0
  27. package/package.json +1 -1
  28. package/src/apis/AuthenticationApi.ts +4 -4
  29. package/src/models/ClientMessage.ts +114 -0
  30. package/src/models/EntityChangeActor.ts +108 -0
  31. package/src/models/EntityChangedEvent.ts +149 -0
  32. package/src/models/ServerMessage.ts +151 -0
  33. package/src/models/index.ts +4 -0
@@ -0,0 +1,92 @@
1
+ /**
2
+ * spaciv API
3
+ * The spaciv API powers workplace planning: modelling how many people an organisation has, how they work, and how much space that requires. ## Getting started 1. Exchange credentials for an access token using one of the operations under **Authentication**. 2. Send that token on every subsequent request as `Authorization: Bearer <token>`. 3. Access tokens are short lived. Call `POST /v1/auth/refresh-token` to obtain a new one before the old one expires. ## Conventions Every operation is versioned under `/v1`. Collections are plural (`GET /v1/dashboards` lists, `POST /v1/dashboards` creates) and individual records live beneath them (`/v1/dashboards/{id}`). Singular paths such as `/v1/account`, `/v1/project` and `/v1/user` refer to the record the access token was issued for. Request and response bodies are JSON. Timestamps are RFC 3339. Identifiers are opaque strings unless documented otherwise, and collection operations return the records visible to the account the token was issued for. Failures return an [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem document with a `detail` field describing what went wrong.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: support@spaciv.com
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { EntityChangedEvent } from './EntityChangedEvent';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface ServerMessage
17
+ */
18
+ export interface ServerMessage {
19
+ [key: string]: any | any;
20
+ /**
21
+ *
22
+ * @type {string}
23
+ * @memberof ServerMessage
24
+ */
25
+ code?: ServerMessageCodeEnum;
26
+ /**
27
+ *
28
+ * @type {Array<EntityChangedEvent>}
29
+ * @memberof ServerMessage
30
+ */
31
+ events?: Array<EntityChangedEvent>;
32
+ /**
33
+ *
34
+ * @type {string}
35
+ * @memberof ServerMessage
36
+ */
37
+ message?: string;
38
+ /**
39
+ *
40
+ * @type {string}
41
+ * @memberof ServerMessage
42
+ */
43
+ topic?: string;
44
+ /**
45
+ *
46
+ * @type {string}
47
+ * @memberof ServerMessage
48
+ */
49
+ type: ServerMessageTypeEnum;
50
+ /**
51
+ *
52
+ * @type {number}
53
+ * @memberof ServerMessage
54
+ */
55
+ v: ServerMessageVEnum;
56
+ }
57
+ /**
58
+ * @export
59
+ */
60
+ export declare const ServerMessageCodeEnum: {
61
+ readonly InvalidTopic: "invalid_topic";
62
+ readonly Forbidden: "forbidden";
63
+ readonly NotFound: "not_found";
64
+ readonly TooManySubscriptions: "too_many_subscriptions";
65
+ readonly Unavailable: "unavailable";
66
+ };
67
+ export type ServerMessageCodeEnum = typeof ServerMessageCodeEnum[keyof typeof ServerMessageCodeEnum];
68
+ /**
69
+ * @export
70
+ */
71
+ export declare const ServerMessageTypeEnum: {
72
+ readonly Changed: "changed";
73
+ readonly Subscribed: "subscribed";
74
+ readonly Resync: "resync";
75
+ readonly Error: "error";
76
+ };
77
+ export type ServerMessageTypeEnum = typeof ServerMessageTypeEnum[keyof typeof ServerMessageTypeEnum];
78
+ /**
79
+ * @export
80
+ */
81
+ export declare const ServerMessageVEnum: {
82
+ readonly NUMBER_1: 1;
83
+ };
84
+ export type ServerMessageVEnum = typeof ServerMessageVEnum[keyof typeof ServerMessageVEnum];
85
+ /**
86
+ * Check if a given object implements the ServerMessage interface.
87
+ */
88
+ export declare function instanceOfServerMessage(value: object): value is ServerMessage;
89
+ export declare function ServerMessageFromJSON(json: any): ServerMessage;
90
+ export declare function ServerMessageFromJSONTyped(json: any, ignoreDiscriminator: boolean): ServerMessage;
91
+ export declare function ServerMessageToJSON(json: any): ServerMessage;
92
+ export declare function ServerMessageToJSONTyped(value?: ServerMessage | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * spaciv API
6
+ * The spaciv API powers workplace planning: modelling how many people an organisation has, how they work, and how much space that requires. ## Getting started 1. Exchange credentials for an access token using one of the operations under **Authentication**. 2. Send that token on every subsequent request as `Authorization: Bearer <token>`. 3. Access tokens are short lived. Call `POST /v1/auth/refresh-token` to obtain a new one before the old one expires. ## Conventions Every operation is versioned under `/v1`. Collections are plural (`GET /v1/dashboards` lists, `POST /v1/dashboards` creates) and individual records live beneath them (`/v1/dashboards/{id}`). Singular paths such as `/v1/account`, `/v1/project` and `/v1/user` refer to the record the access token was issued for. Request and response bodies are JSON. Timestamps are RFC 3339. Identifiers are opaque strings unless documented otherwise, and collection operations return the records visible to the account the token was issued for. Failures return an [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem document with a `detail` field describing what went wrong.
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ * Contact: support@spaciv.com
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.ServerMessageVEnum = exports.ServerMessageTypeEnum = exports.ServerMessageCodeEnum = void 0;
17
+ exports.instanceOfServerMessage = instanceOfServerMessage;
18
+ exports.ServerMessageFromJSON = ServerMessageFromJSON;
19
+ exports.ServerMessageFromJSONTyped = ServerMessageFromJSONTyped;
20
+ exports.ServerMessageToJSON = ServerMessageToJSON;
21
+ exports.ServerMessageToJSONTyped = ServerMessageToJSONTyped;
22
+ const EntityChangedEvent_1 = require("./EntityChangedEvent");
23
+ /**
24
+ * @export
25
+ */
26
+ exports.ServerMessageCodeEnum = {
27
+ InvalidTopic: 'invalid_topic',
28
+ Forbidden: 'forbidden',
29
+ NotFound: 'not_found',
30
+ TooManySubscriptions: 'too_many_subscriptions',
31
+ Unavailable: 'unavailable'
32
+ };
33
+ /**
34
+ * @export
35
+ */
36
+ exports.ServerMessageTypeEnum = {
37
+ Changed: 'changed',
38
+ Subscribed: 'subscribed',
39
+ Resync: 'resync',
40
+ Error: 'error'
41
+ };
42
+ /**
43
+ * @export
44
+ */
45
+ exports.ServerMessageVEnum = {
46
+ NUMBER_1: 1
47
+ };
48
+ /**
49
+ * Check if a given object implements the ServerMessage interface.
50
+ */
51
+ function instanceOfServerMessage(value) {
52
+ if (!('type' in value) || value['type'] === undefined)
53
+ return false;
54
+ if (!('v' in value) || value['v'] === undefined)
55
+ return false;
56
+ return true;
57
+ }
58
+ function ServerMessageFromJSON(json) {
59
+ return ServerMessageFromJSONTyped(json, false);
60
+ }
61
+ function ServerMessageFromJSONTyped(json, ignoreDiscriminator) {
62
+ if (json == null) {
63
+ return json;
64
+ }
65
+ return Object.assign(Object.assign({}, json), { 'code': json['code'] == null ? undefined : json['code'], 'events': json['events'] == null ? undefined : (json['events'].map(EntityChangedEvent_1.EntityChangedEventFromJSON)), 'message': json['message'] == null ? undefined : json['message'], 'topic': json['topic'] == null ? undefined : json['topic'], 'type': json['type'], 'v': json['v'] });
66
+ }
67
+ function ServerMessageToJSON(json) {
68
+ return ServerMessageToJSONTyped(json, false);
69
+ }
70
+ function ServerMessageToJSONTyped(value, ignoreDiscriminator = false) {
71
+ if (value == null) {
72
+ return value;
73
+ }
74
+ return Object.assign(Object.assign({}, value), { 'code': value['code'], 'events': value['events'] == null ? undefined : (value['events'].map(EntityChangedEvent_1.EntityChangedEventToJSON)), 'message': value['message'], 'topic': value['topic'], 'type': value['type'], 'v': value['v'] });
75
+ }
@@ -81,6 +81,7 @@ export * from './CalcTreeValue';
81
81
  export * from './CalcTypeSingleValue';
82
82
  export * from './ChangelogOption';
83
83
  export * from './ChangelogValueOption';
84
+ export * from './ClientMessage';
84
85
  export * from './ConfidentialityData';
85
86
  export * from './Contribution';
86
87
  export * from './ContributionChangelogBody';
@@ -166,6 +167,8 @@ export * from './DatasetDataOneOf2';
166
167
  export * from './DatasetModify';
167
168
  export * from './DatasetRes';
168
169
  export * from './DaysOffData';
170
+ export * from './EntityChangeActor';
171
+ export * from './EntityChangedEvent';
169
172
  export * from './EntryPatch';
170
173
  export * from './EntryPatchPropertiesValue';
171
174
  export * from './ErrorDetail';
@@ -319,6 +322,7 @@ export * from './ScriptUsageResBody';
319
322
  export * from './ScriptWebhookResBody';
320
323
  export * from './SendPasswordPutReqBody';
321
324
  export * from './SerializedEvent';
325
+ export * from './ServerMessage';
322
326
  export * from './SingleSelectChangelogData';
323
327
  export * from './SingleSelectContributionData';
324
328
  export * from './SingleSelectData';
@@ -99,6 +99,7 @@ __exportStar(require("./CalcTreeValue"), exports);
99
99
  __exportStar(require("./CalcTypeSingleValue"), exports);
100
100
  __exportStar(require("./ChangelogOption"), exports);
101
101
  __exportStar(require("./ChangelogValueOption"), exports);
102
+ __exportStar(require("./ClientMessage"), exports);
102
103
  __exportStar(require("./ConfidentialityData"), exports);
103
104
  __exportStar(require("./Contribution"), exports);
104
105
  __exportStar(require("./ContributionChangelogBody"), exports);
@@ -184,6 +185,8 @@ __exportStar(require("./DatasetDataOneOf2"), exports);
184
185
  __exportStar(require("./DatasetModify"), exports);
185
186
  __exportStar(require("./DatasetRes"), exports);
186
187
  __exportStar(require("./DaysOffData"), exports);
188
+ __exportStar(require("./EntityChangeActor"), exports);
189
+ __exportStar(require("./EntityChangedEvent"), exports);
187
190
  __exportStar(require("./EntryPatch"), exports);
188
191
  __exportStar(require("./EntryPatchPropertiesValue"), exports);
189
192
  __exportStar(require("./ErrorDetail"), exports);
@@ -337,6 +340,7 @@ __exportStar(require("./ScriptUsageResBody"), exports);
337
340
  __exportStar(require("./ScriptWebhookResBody"), exports);
338
341
  __exportStar(require("./SendPasswordPutReqBody"), exports);
339
342
  __exportStar(require("./SerializedEvent"), exports);
343
+ __exportStar(require("./ServerMessage"), exports);
340
344
  __exportStar(require("./SingleSelectChangelogData"), exports);
341
345
  __exportStar(require("./SingleSelectContributionData"), exports);
342
346
  __exportStar(require("./SingleSelectData"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spaciv/sdk",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "OpenAPI client for @spaciv/sdk",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -224,7 +224,7 @@ export interface AuthenticationApiInterface {
224
224
  createAuthLogout(requestParameters: AuthenticationApiCreateAuthLogoutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
225
225
 
226
226
  /**
227
- * Exchanges the refresh token cookie (`__Host-token`, or `token` when `AUTH_COOKIE_SECURE` is false) for a fresh short-lived access token. Optionally scope the token to a specific account or project by providing `account` and/or `project` in the request body. For OIDC accounts, the provider\'s token is silently re-validated on each refresh. A successful refresh rotates the cookie, keeping the session\'s original expiry. The session\'s refresh token advances at most once a minute: within that minute, presenting the current token sets no cookie, and presenting the token it just replaced sets a cookie for the current one. A superseded refresh token is still accepted for a short grace period, so parallel refreshes and retries succeed; presenting it after that revokes the whole session. Returns `401` when no access token could be minted: an invalid refresh token, a missing or signed-out session, a reused refresh token, a deleted user, or, for a refresh scoped to an `account`, unusable session data or an OIDC provider that rejects the session\'s token. Returning the user to sign-in is the usual response. Returns `503` when, for a refresh scoped to an `account`, the OIDC provider could not be reached or reported a transient failure. The session is still valid, so retry the refresh later rather than signing the user out. Returns `403` when the session is valid but is not authorised for the requested `account`, which typically means the account mandates a sign-in method the session did not use. The session stays usable for other accounts, so keep it and cancel only the account-scoped action.
227
+ * Exchanges the refresh token cookie (`__Host-token`, or `token` when `AUTH_COOKIE_SECURE` is false) for a fresh short-lived access token. Optionally scope the token to a specific account or project by providing `account` and/or `project` in the request body. For OIDC accounts, the provider\'s token is silently re-validated on each refresh. A successful refresh rotates the cookie, keeping the session\'s original expiry. The session\'s refresh token advances at most once a minute: within that minute, presenting the current token sets no cookie, and presenting the token it just replaced sets a cookie for the current one. A superseded refresh token is still accepted for a short grace period, so parallel refreshes and retries succeed; presenting it after that revokes the whole session. Returns `401` when no access token could be minted: an invalid refresh token, a missing or signed-out session, a reused refresh token, a deleted user, or, for a refresh scoped to an `account`, unusable session data or an OIDC provider that rejects the session\'s token. Returning the user to sign-in is the usual response. Returns `503` when, for a refresh scoped to an `account`, the OIDC provider could not be reached or reported a transient failure. The session is still valid, so retry the refresh later rather than signing the user out. Returns `403` when the session is valid but is not authorised for the requested `account`, which typically means the account mandates a sign-in method the session did not use, or when a refresh without an `account` comes from a session that signed in through an account\'s own OIDC provider: such a session only gets tokens for an account. The session stays usable for the accounts it is authorised for, so keep it and cancel only the action that needed the token.
228
228
  * @summary Refresh an access token
229
229
  * @param {AuthRefreshTokenReqBody} authRefreshTokenReqBody
230
230
  * @param {Cookie} [hostToken]
@@ -236,7 +236,7 @@ export interface AuthenticationApiInterface {
236
236
  createAuthRefreshTokenRaw(requestParameters: AuthenticationApiCreateAuthRefreshTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AuthRefreshTokenResBody>>;
237
237
 
238
238
  /**
239
- * Exchanges the refresh token cookie (`__Host-token`, or `token` when `AUTH_COOKIE_SECURE` is false) for a fresh short-lived access token. Optionally scope the token to a specific account or project by providing `account` and/or `project` in the request body. For OIDC accounts, the provider\'s token is silently re-validated on each refresh. A successful refresh rotates the cookie, keeping the session\'s original expiry. The session\'s refresh token advances at most once a minute: within that minute, presenting the current token sets no cookie, and presenting the token it just replaced sets a cookie for the current one. A superseded refresh token is still accepted for a short grace period, so parallel refreshes and retries succeed; presenting it after that revokes the whole session. Returns `401` when no access token could be minted: an invalid refresh token, a missing or signed-out session, a reused refresh token, a deleted user, or, for a refresh scoped to an `account`, unusable session data or an OIDC provider that rejects the session\'s token. Returning the user to sign-in is the usual response. Returns `503` when, for a refresh scoped to an `account`, the OIDC provider could not be reached or reported a transient failure. The session is still valid, so retry the refresh later rather than signing the user out. Returns `403` when the session is valid but is not authorised for the requested `account`, which typically means the account mandates a sign-in method the session did not use. The session stays usable for other accounts, so keep it and cancel only the account-scoped action.
239
+ * Exchanges the refresh token cookie (`__Host-token`, or `token` when `AUTH_COOKIE_SECURE` is false) for a fresh short-lived access token. Optionally scope the token to a specific account or project by providing `account` and/or `project` in the request body. For OIDC accounts, the provider\'s token is silently re-validated on each refresh. A successful refresh rotates the cookie, keeping the session\'s original expiry. The session\'s refresh token advances at most once a minute: within that minute, presenting the current token sets no cookie, and presenting the token it just replaced sets a cookie for the current one. A superseded refresh token is still accepted for a short grace period, so parallel refreshes and retries succeed; presenting it after that revokes the whole session. Returns `401` when no access token could be minted: an invalid refresh token, a missing or signed-out session, a reused refresh token, a deleted user, or, for a refresh scoped to an `account`, unusable session data or an OIDC provider that rejects the session\'s token. Returning the user to sign-in is the usual response. Returns `503` when, for a refresh scoped to an `account`, the OIDC provider could not be reached or reported a transient failure. The session is still valid, so retry the refresh later rather than signing the user out. Returns `403` when the session is valid but is not authorised for the requested `account`, which typically means the account mandates a sign-in method the session did not use, or when a refresh without an `account` comes from a session that signed in through an account\'s own OIDC provider: such a session only gets tokens for an account. The session stays usable for the accounts it is authorised for, so keep it and cancel only the action that needed the token.
240
240
  * Refresh an access token
241
241
  */
242
242
  createAuthRefreshToken(requestParameters: AuthenticationApiCreateAuthRefreshTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AuthRefreshTokenResBody>;
@@ -588,7 +588,7 @@ export class AuthenticationApi extends runtime.BaseAPI implements Authentication
588
588
  }
589
589
 
590
590
  /**
591
- * Exchanges the refresh token cookie (`__Host-token`, or `token` when `AUTH_COOKIE_SECURE` is false) for a fresh short-lived access token. Optionally scope the token to a specific account or project by providing `account` and/or `project` in the request body. For OIDC accounts, the provider\'s token is silently re-validated on each refresh. A successful refresh rotates the cookie, keeping the session\'s original expiry. The session\'s refresh token advances at most once a minute: within that minute, presenting the current token sets no cookie, and presenting the token it just replaced sets a cookie for the current one. A superseded refresh token is still accepted for a short grace period, so parallel refreshes and retries succeed; presenting it after that revokes the whole session. Returns `401` when no access token could be minted: an invalid refresh token, a missing or signed-out session, a reused refresh token, a deleted user, or, for a refresh scoped to an `account`, unusable session data or an OIDC provider that rejects the session\'s token. Returning the user to sign-in is the usual response. Returns `503` when, for a refresh scoped to an `account`, the OIDC provider could not be reached or reported a transient failure. The session is still valid, so retry the refresh later rather than signing the user out. Returns `403` when the session is valid but is not authorised for the requested `account`, which typically means the account mandates a sign-in method the session did not use. The session stays usable for other accounts, so keep it and cancel only the account-scoped action.
591
+ * Exchanges the refresh token cookie (`__Host-token`, or `token` when `AUTH_COOKIE_SECURE` is false) for a fresh short-lived access token. Optionally scope the token to a specific account or project by providing `account` and/or `project` in the request body. For OIDC accounts, the provider\'s token is silently re-validated on each refresh. A successful refresh rotates the cookie, keeping the session\'s original expiry. The session\'s refresh token advances at most once a minute: within that minute, presenting the current token sets no cookie, and presenting the token it just replaced sets a cookie for the current one. A superseded refresh token is still accepted for a short grace period, so parallel refreshes and retries succeed; presenting it after that revokes the whole session. Returns `401` when no access token could be minted: an invalid refresh token, a missing or signed-out session, a reused refresh token, a deleted user, or, for a refresh scoped to an `account`, unusable session data or an OIDC provider that rejects the session\'s token. Returning the user to sign-in is the usual response. Returns `503` when, for a refresh scoped to an `account`, the OIDC provider could not be reached or reported a transient failure. The session is still valid, so retry the refresh later rather than signing the user out. Returns `403` when the session is valid but is not authorised for the requested `account`, which typically means the account mandates a sign-in method the session did not use, or when a refresh without an `account` comes from a session that signed in through an account\'s own OIDC provider: such a session only gets tokens for an account. The session stays usable for the accounts it is authorised for, so keep it and cancel only the action that needed the token.
592
592
  * Refresh an access token
593
593
  */
594
594
  async createAuthRefreshTokenRaw(requestParameters: AuthenticationApiCreateAuthRefreshTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AuthRefreshTokenResBody>> {
@@ -620,7 +620,7 @@ export class AuthenticationApi extends runtime.BaseAPI implements Authentication
620
620
  }
621
621
 
622
622
  /**
623
- * Exchanges the refresh token cookie (`__Host-token`, or `token` when `AUTH_COOKIE_SECURE` is false) for a fresh short-lived access token. Optionally scope the token to a specific account or project by providing `account` and/or `project` in the request body. For OIDC accounts, the provider\'s token is silently re-validated on each refresh. A successful refresh rotates the cookie, keeping the session\'s original expiry. The session\'s refresh token advances at most once a minute: within that minute, presenting the current token sets no cookie, and presenting the token it just replaced sets a cookie for the current one. A superseded refresh token is still accepted for a short grace period, so parallel refreshes and retries succeed; presenting it after that revokes the whole session. Returns `401` when no access token could be minted: an invalid refresh token, a missing or signed-out session, a reused refresh token, a deleted user, or, for a refresh scoped to an `account`, unusable session data or an OIDC provider that rejects the session\'s token. Returning the user to sign-in is the usual response. Returns `503` when, for a refresh scoped to an `account`, the OIDC provider could not be reached or reported a transient failure. The session is still valid, so retry the refresh later rather than signing the user out. Returns `403` when the session is valid but is not authorised for the requested `account`, which typically means the account mandates a sign-in method the session did not use. The session stays usable for other accounts, so keep it and cancel only the account-scoped action.
623
+ * Exchanges the refresh token cookie (`__Host-token`, or `token` when `AUTH_COOKIE_SECURE` is false) for a fresh short-lived access token. Optionally scope the token to a specific account or project by providing `account` and/or `project` in the request body. For OIDC accounts, the provider\'s token is silently re-validated on each refresh. A successful refresh rotates the cookie, keeping the session\'s original expiry. The session\'s refresh token advances at most once a minute: within that minute, presenting the current token sets no cookie, and presenting the token it just replaced sets a cookie for the current one. A superseded refresh token is still accepted for a short grace period, so parallel refreshes and retries succeed; presenting it after that revokes the whole session. Returns `401` when no access token could be minted: an invalid refresh token, a missing or signed-out session, a reused refresh token, a deleted user, or, for a refresh scoped to an `account`, unusable session data or an OIDC provider that rejects the session\'s token. Returning the user to sign-in is the usual response. Returns `503` when, for a refresh scoped to an `account`, the OIDC provider could not be reached or reported a transient failure. The session is still valid, so retry the refresh later rather than signing the user out. Returns `403` when the session is valid but is not authorised for the requested `account`, which typically means the account mandates a sign-in method the session did not use, or when a refresh without an `account` comes from a session that signed in through an account\'s own OIDC provider: such a session only gets tokens for an account. The session stays usable for the accounts it is authorised for, so keep it and cancel only the action that needed the token.
624
624
  * Refresh an access token
625
625
  */
626
626
  async createAuthRefreshToken(requestParameters: AuthenticationApiCreateAuthRefreshTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AuthRefreshTokenResBody> {
@@ -0,0 +1,114 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * spaciv API
5
+ * The spaciv API powers workplace planning: modelling how many people an organisation has, how they work, and how much space that requires. ## Getting started 1. Exchange credentials for an access token using one of the operations under **Authentication**. 2. Send that token on every subsequent request as `Authorization: Bearer <token>`. 3. Access tokens are short lived. Call `POST /v1/auth/refresh-token` to obtain a new one before the old one expires. ## Conventions Every operation is versioned under `/v1`. Collections are plural (`GET /v1/dashboards` lists, `POST /v1/dashboards` creates) and individual records live beneath them (`/v1/dashboards/{id}`). Singular paths such as `/v1/account`, `/v1/project` and `/v1/user` refer to the record the access token was issued for. Request and response bodies are JSON. Timestamps are RFC 3339. Identifiers are opaque strings unless documented otherwise, and collection operations return the records visible to the account the token was issued for. Failures return an [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem document with a `detail` field describing what went wrong.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@spaciv.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface ClientMessage
20
+ */
21
+ export interface ClientMessage {
22
+ [key: string]: any | any;
23
+ /**
24
+ *
25
+ * @type {string}
26
+ * @memberof ClientMessage
27
+ */
28
+ token?: string;
29
+ /**
30
+ * Between 1 and 100 topics for subscribe and unsubscribe. A message must fit within 128 KiB as sent, so topics whose JSON encoding is long go in several messages.
31
+ * @type {Array<string>}
32
+ * @memberof ClientMessage
33
+ */
34
+ topics?: Array<string>;
35
+ /**
36
+ *
37
+ * @type {string}
38
+ * @memberof ClientMessage
39
+ */
40
+ type: ClientMessageTypeEnum;
41
+ /**
42
+ *
43
+ * @type {number}
44
+ * @memberof ClientMessage
45
+ */
46
+ v: ClientMessageVEnum;
47
+ }
48
+
49
+
50
+ /**
51
+ * @export
52
+ */
53
+ export const ClientMessageTypeEnum = {
54
+ Auth: 'auth',
55
+ Subscribe: 'subscribe',
56
+ Unsubscribe: 'unsubscribe'
57
+ } as const;
58
+ export type ClientMessageTypeEnum = typeof ClientMessageTypeEnum[keyof typeof ClientMessageTypeEnum];
59
+
60
+ /**
61
+ * @export
62
+ */
63
+ export const ClientMessageVEnum = {
64
+ NUMBER_1: 1
65
+ } as const;
66
+ export type ClientMessageVEnum = typeof ClientMessageVEnum[keyof typeof ClientMessageVEnum];
67
+
68
+
69
+ /**
70
+ * Check if a given object implements the ClientMessage interface.
71
+ */
72
+ export function instanceOfClientMessage(value: object): value is ClientMessage {
73
+ if (!('type' in value) || value['type'] === undefined) return false;
74
+ if (!('v' in value) || value['v'] === undefined) return false;
75
+ return true;
76
+ }
77
+
78
+ export function ClientMessageFromJSON(json: any): ClientMessage {
79
+ return ClientMessageFromJSONTyped(json, false);
80
+ }
81
+
82
+ export function ClientMessageFromJSONTyped(json: any, ignoreDiscriminator: boolean): ClientMessage {
83
+ if (json == null) {
84
+ return json;
85
+ }
86
+ return {
87
+
88
+ ...json,
89
+ 'token': json['token'] == null ? undefined : json['token'],
90
+ 'topics': json['topics'] == null ? undefined : json['topics'],
91
+ 'type': json['type'],
92
+ 'v': json['v'],
93
+ };
94
+ }
95
+
96
+ export function ClientMessageToJSON(json: any): ClientMessage {
97
+ return ClientMessageToJSONTyped(json, false);
98
+ }
99
+
100
+ export function ClientMessageToJSONTyped(value?: ClientMessage | null, ignoreDiscriminator: boolean = false): any {
101
+ if (value == null) {
102
+ return value;
103
+ }
104
+
105
+ return {
106
+
107
+ ...value,
108
+ 'token': value['token'],
109
+ 'topics': value['topics'],
110
+ 'type': value['type'],
111
+ 'v': value['v'],
112
+ };
113
+ }
114
+
@@ -0,0 +1,108 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * spaciv API
5
+ * The spaciv API powers workplace planning: modelling how many people an organisation has, how they work, and how much space that requires. ## Getting started 1. Exchange credentials for an access token using one of the operations under **Authentication**. 2. Send that token on every subsequent request as `Authorization: Bearer <token>`. 3. Access tokens are short lived. Call `POST /v1/auth/refresh-token` to obtain a new one before the old one expires. ## Conventions Every operation is versioned under `/v1`. Collections are plural (`GET /v1/dashboards` lists, `POST /v1/dashboards` creates) and individual records live beneath them (`/v1/dashboards/{id}`). Singular paths such as `/v1/account`, `/v1/project` and `/v1/user` refer to the record the access token was issued for. Request and response bodies are JSON. Timestamps are RFC 3339. Identifiers are opaque strings unless documented otherwise, and collection operations return the records visible to the account the token was issued for. Failures return an [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem document with a `detail` field describing what went wrong.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@spaciv.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface EntityChangeActor
20
+ */
21
+ export interface EntityChangeActor {
22
+ [key: string]: any | any;
23
+ /**
24
+ *
25
+ * @type {string}
26
+ * @memberof EntityChangeActor
27
+ */
28
+ clientId?: string;
29
+ /**
30
+ *
31
+ * @type {string}
32
+ * @memberof EntityChangeActor
33
+ */
34
+ session: string;
35
+ /**
36
+ *
37
+ * @type {string}
38
+ * @memberof EntityChangeActor
39
+ */
40
+ type: EntityChangeActorTypeEnum;
41
+ /**
42
+ *
43
+ * @type {number}
44
+ * @memberof EntityChangeActor
45
+ */
46
+ user: number;
47
+ }
48
+
49
+
50
+ /**
51
+ * @export
52
+ */
53
+ export const EntityChangeActorTypeEnum = {
54
+ User: 'user',
55
+ System: 'system',
56
+ Anonymous: 'anonymous',
57
+ Unknown: 'unknown'
58
+ } as const;
59
+ export type EntityChangeActorTypeEnum = typeof EntityChangeActorTypeEnum[keyof typeof EntityChangeActorTypeEnum];
60
+
61
+
62
+ /**
63
+ * Check if a given object implements the EntityChangeActor interface.
64
+ */
65
+ export function instanceOfEntityChangeActor(value: object): value is EntityChangeActor {
66
+ if (!('session' in value) || value['session'] === undefined) return false;
67
+ if (!('type' in value) || value['type'] === undefined) return false;
68
+ if (!('user' in value) || value['user'] === undefined) return false;
69
+ return true;
70
+ }
71
+
72
+ export function EntityChangeActorFromJSON(json: any): EntityChangeActor {
73
+ return EntityChangeActorFromJSONTyped(json, false);
74
+ }
75
+
76
+ export function EntityChangeActorFromJSONTyped(json: any, ignoreDiscriminator: boolean): EntityChangeActor {
77
+ if (json == null) {
78
+ return json;
79
+ }
80
+ return {
81
+
82
+ ...json,
83
+ 'clientId': json['clientId'] == null ? undefined : json['clientId'],
84
+ 'session': json['session'],
85
+ 'type': json['type'],
86
+ 'user': json['user'],
87
+ };
88
+ }
89
+
90
+ export function EntityChangeActorToJSON(json: any): EntityChangeActor {
91
+ return EntityChangeActorToJSONTyped(json, false);
92
+ }
93
+
94
+ export function EntityChangeActorToJSONTyped(value?: EntityChangeActor | null, ignoreDiscriminator: boolean = false): any {
95
+ if (value == null) {
96
+ return value;
97
+ }
98
+
99
+ return {
100
+
101
+ ...value,
102
+ 'clientId': value['clientId'],
103
+ 'session': value['session'],
104
+ 'type': value['type'],
105
+ 'user': value['user'],
106
+ };
107
+ }
108
+
@@ -0,0 +1,149 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * spaciv API
5
+ * The spaciv API powers workplace planning: modelling how many people an organisation has, how they work, and how much space that requires. ## Getting started 1. Exchange credentials for an access token using one of the operations under **Authentication**. 2. Send that token on every subsequent request as `Authorization: Bearer <token>`. 3. Access tokens are short lived. Call `POST /v1/auth/refresh-token` to obtain a new one before the old one expires. ## Conventions Every operation is versioned under `/v1`. Collections are plural (`GET /v1/dashboards` lists, `POST /v1/dashboards` creates) and individual records live beneath them (`/v1/dashboards/{id}`). Singular paths such as `/v1/account`, `/v1/project` and `/v1/user` refer to the record the access token was issued for. Request and response bodies are JSON. Timestamps are RFC 3339. Identifiers are opaque strings unless documented otherwise, and collection operations return the records visible to the account the token was issued for. Failures return an [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem document with a `detail` field describing what went wrong.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@spaciv.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { EntityChangeActor } from './EntityChangeActor';
17
+ import {
18
+ EntityChangeActorFromJSON,
19
+ EntityChangeActorFromJSONTyped,
20
+ EntityChangeActorToJSON,
21
+ EntityChangeActorToJSONTyped,
22
+ } from './EntityChangeActor';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface EntityChangedEvent
28
+ */
29
+ export interface EntityChangedEvent {
30
+ [key: string]: any | any;
31
+ /**
32
+ *
33
+ * @type {number}
34
+ * @memberof EntityChangedEvent
35
+ */
36
+ account: number;
37
+ /**
38
+ *
39
+ * @type {EntityChangeActor}
40
+ * @memberof EntityChangedEvent
41
+ */
42
+ actor: EntityChangeActor;
43
+ /**
44
+ *
45
+ * @type {string}
46
+ * @memberof EntityChangedEvent
47
+ */
48
+ at: string;
49
+ /**
50
+ *
51
+ * @type {string}
52
+ * @memberof EntityChangedEvent
53
+ */
54
+ id: string;
55
+ /**
56
+ *
57
+ * @type {string}
58
+ * @memberof EntityChangedEvent
59
+ */
60
+ op: EntityChangedEventOpEnum;
61
+ /**
62
+ *
63
+ * @type {number}
64
+ * @memberof EntityChangedEvent
65
+ */
66
+ project?: number;
67
+ /**
68
+ *
69
+ * @type {string}
70
+ * @memberof EntityChangedEvent
71
+ */
72
+ type: string;
73
+ /**
74
+ *
75
+ * @type {string}
76
+ * @memberof EntityChangedEvent
77
+ */
78
+ version?: string;
79
+ }
80
+
81
+
82
+ /**
83
+ * @export
84
+ */
85
+ export const EntityChangedEventOpEnum = {
86
+ Upsert: 'upsert',
87
+ Delete: 'delete'
88
+ } as const;
89
+ export type EntityChangedEventOpEnum = typeof EntityChangedEventOpEnum[keyof typeof EntityChangedEventOpEnum];
90
+
91
+
92
+ /**
93
+ * Check if a given object implements the EntityChangedEvent interface.
94
+ */
95
+ export function instanceOfEntityChangedEvent(value: object): value is EntityChangedEvent {
96
+ if (!('account' in value) || value['account'] === undefined) return false;
97
+ if (!('actor' in value) || value['actor'] === undefined) return false;
98
+ if (!('at' in value) || value['at'] === undefined) return false;
99
+ if (!('id' in value) || value['id'] === undefined) return false;
100
+ if (!('op' in value) || value['op'] === undefined) return false;
101
+ if (!('type' in value) || value['type'] === undefined) return false;
102
+ return true;
103
+ }
104
+
105
+ export function EntityChangedEventFromJSON(json: any): EntityChangedEvent {
106
+ return EntityChangedEventFromJSONTyped(json, false);
107
+ }
108
+
109
+ export function EntityChangedEventFromJSONTyped(json: any, ignoreDiscriminator: boolean): EntityChangedEvent {
110
+ if (json == null) {
111
+ return json;
112
+ }
113
+ return {
114
+
115
+ ...json,
116
+ 'account': json['account'],
117
+ 'actor': EntityChangeActorFromJSON(json['actor']),
118
+ 'at': json['at'],
119
+ 'id': json['id'],
120
+ 'op': json['op'],
121
+ 'project': json['project'] == null ? undefined : json['project'],
122
+ 'type': json['type'],
123
+ 'version': json['version'] == null ? undefined : json['version'],
124
+ };
125
+ }
126
+
127
+ export function EntityChangedEventToJSON(json: any): EntityChangedEvent {
128
+ return EntityChangedEventToJSONTyped(json, false);
129
+ }
130
+
131
+ export function EntityChangedEventToJSONTyped(value?: EntityChangedEvent | null, ignoreDiscriminator: boolean = false): any {
132
+ if (value == null) {
133
+ return value;
134
+ }
135
+
136
+ return {
137
+
138
+ ...value,
139
+ 'account': value['account'],
140
+ 'actor': EntityChangeActorToJSON(value['actor']),
141
+ 'at': value['at'],
142
+ 'id': value['id'],
143
+ 'op': value['op'],
144
+ 'project': value['project'],
145
+ 'type': value['type'],
146
+ 'version': value['version'],
147
+ };
148
+ }
149
+