@spaciv/sdk 0.1.12 → 0.1.14

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 (36) hide show
  1. package/.openapi-generator/FILES +4 -0
  2. package/README.md +2 -2
  3. package/dist/apis/FilesApi.d.ts +37 -4
  4. package/dist/apis/FilesApi.js +69 -2
  5. package/dist/esm/apis/FilesApi.d.ts +37 -4
  6. package/dist/esm/apis/FilesApi.js +69 -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/ModelRecord.d.ts +1 -1
  14. package/dist/esm/models/ServerMessage.d.ts +92 -0
  15. package/dist/esm/models/ServerMessage.js +67 -0
  16. package/dist/esm/models/index.d.ts +4 -0
  17. package/dist/esm/models/index.js +4 -0
  18. package/dist/models/ClientMessage.d.ts +67 -0
  19. package/dist/models/ClientMessage.js +63 -0
  20. package/dist/models/EntityChangeActor.d.ts +61 -0
  21. package/dist/models/EntityChangeActor.js +60 -0
  22. package/dist/models/EntityChangedEvent.d.ts +84 -0
  23. package/dist/models/EntityChangedEvent.js +65 -0
  24. package/dist/models/ModelRecord.d.ts +1 -1
  25. package/dist/models/ServerMessage.d.ts +92 -0
  26. package/dist/models/ServerMessage.js +75 -0
  27. package/dist/models/index.d.ts +4 -0
  28. package/dist/models/index.js +4 -0
  29. package/package.json +1 -1
  30. package/src/apis/FilesApi.ts +113 -4
  31. package/src/models/ClientMessage.ts +114 -0
  32. package/src/models/EntityChangeActor.ts +108 -0
  33. package/src/models/EntityChangedEvent.ts +149 -0
  34. package/src/models/ModelRecord.ts +1 -1
  35. package/src/models/ServerMessage.ts +151 -0
  36. package/src/models/index.ts +4 -0
@@ -54,6 +54,13 @@ export interface FilesApiUpdateAccountFilesRequest {
54
54
  accountFilePatchBody: AccountFilePatchBody;
55
55
  }
56
56
 
57
+ export interface FilesApiUpdateAccountFilesContentRequest {
58
+ id: string;
59
+ ifMatch: string;
60
+ filename?: Blob;
61
+ name?: string;
62
+ }
63
+
57
64
  /**
58
65
  * FilesApi - interface
59
66
  *
@@ -95,7 +102,7 @@ export interface FilesApiInterface {
95
102
  deleteAccountFiles(requestParameters: FilesApiDeleteAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object>;
96
103
 
97
104
  /**
98
- * Returns the stored bytes of a file held against the account, with the `mimeType` recorded at upload as the `Content-Type`. Files belonging to other accounts are never returned. Served only from the user content host, so that a stored file is isolated from the application\'s own origin; any other host returns 404. The response always carries `Content-Disposition: attachment` and `Content-Security-Policy: default-src \'none\'`, so a file is downloaded rather than rendered even when the browser could display it. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. Requires the *View file storage* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored file matches a virus signature; the bytes are kept for investigation.
105
+ * Returns the stored bytes of a file held against the account, with the `mimeType` recorded when the content was last stored as the `Content-Type`. Files belonging to other accounts are never returned. Served only from the user content host, so that a stored file is isolated from the application\'s own origin; any other host returns 404. The response always carries `Content-Disposition: attachment` and `Content-Security-Policy: default-src \'none\'`, so a file is downloaded rather than rendered even when the browser could display it. The response\'s `ETag` identifies this version of the content: send it back as `If-Match` when replacing the content, so that a change made by someone else in the meantime is not overwritten. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. Requires the *View file storage* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored file matches a virus signature; the bytes are kept for investigation.
99
106
  * @summary Download an account file
100
107
  * @param {string} id
101
108
  * @param {*} [options] Override http request option.
@@ -105,7 +112,7 @@ export interface FilesApiInterface {
105
112
  getAccountFilesContentRaw(requestParameters: FilesApiGetAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>>;
106
113
 
107
114
  /**
108
- * Returns the stored bytes of a file held against the account, with the `mimeType` recorded at upload as the `Content-Type`. Files belonging to other accounts are never returned. Served only from the user content host, so that a stored file is isolated from the application\'s own origin; any other host returns 404. The response always carries `Content-Disposition: attachment` and `Content-Security-Policy: default-src \'none\'`, so a file is downloaded rather than rendered even when the browser could display it. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. Requires the *View file storage* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored file matches a virus signature; the bytes are kept for investigation.
115
+ * Returns the stored bytes of a file held against the account, with the `mimeType` recorded when the content was last stored as the `Content-Type`. Files belonging to other accounts are never returned. Served only from the user content host, so that a stored file is isolated from the application\'s own origin; any other host returns 404. The response always carries `Content-Disposition: attachment` and `Content-Security-Policy: default-src \'none\'`, so a file is downloaded rather than rendered even when the browser could display it. The response\'s `ETag` identifies this version of the content: send it back as `If-Match` when replacing the content, so that a change made by someone else in the meantime is not overwritten. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. Requires the *View file storage* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored file matches a virus signature; the bytes are kept for investigation.
109
116
  * Download an account file
110
117
  */
111
118
  getAccountFilesContent(requestParameters: FilesApiGetAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
@@ -144,6 +151,25 @@ export interface FilesApiInterface {
144
151
  */
145
152
  updateAccountFiles(requestParameters: FilesApiUpdateAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelRecord>;
146
153
 
154
+ /**
155
+ * Replaces the stored bytes of a file held against the account and returns the updated record, with the new version of the content as the `ETag`. Send the request as `multipart/form-data` with a single file field named `file`. The uploaded file\'s name is ignored: the file keeps its name and identifier, so anything already referencing it keeps working. `mimeType` is detected again from the new contents. Maximum file size is 25 MiB, and the content is rejected if a virus scan fails. Send the `ETag` returned when the content was read as `If-Match`. If the file has been replaced since then, the request is rejected with 412 and nothing changes; read the content again before deciding what to save. A missing `If-Match` is rejected with 422, and `*` with 400. The difference in size counts towards the account\'s 1 GiB storage quota, and content that would take the account past it is rejected with 413. A 409 means concurrent changes to the account\'s files kept changing its usage while the content was being replaced. The new content may already be stored, so read the content and its `ETag` again before deciding what to save: retrying with the same `If-Match` is rejected with 412 if it was. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. A quarantined file cannot be replaced (403). Requires the *Edit file storage* permission.
156
+ * @summary Replace an account file\'s content
157
+ * @param {string} id
158
+ * @param {string} ifMatch The ETag returned when the file\&#39;s content was read. The content is replaced only if it has not changed since.
159
+ * @param {Blob} [filename] filename of the file being uploaded
160
+ * @param {string} [name] general purpose name for multipart form value
161
+ * @param {*} [options] Override http request option.
162
+ * @throws {RequiredError}
163
+ * @memberof FilesApiInterface
164
+ */
165
+ updateAccountFilesContentRaw(requestParameters: FilesApiUpdateAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ModelRecord>>;
166
+
167
+ /**
168
+ * Replaces the stored bytes of a file held against the account and returns the updated record, with the new version of the content as the `ETag`. Send the request as `multipart/form-data` with a single file field named `file`. The uploaded file\'s name is ignored: the file keeps its name and identifier, so anything already referencing it keeps working. `mimeType` is detected again from the new contents. Maximum file size is 25 MiB, and the content is rejected if a virus scan fails. Send the `ETag` returned when the content was read as `If-Match`. If the file has been replaced since then, the request is rejected with 412 and nothing changes; read the content again before deciding what to save. A missing `If-Match` is rejected with 422, and `*` with 400. The difference in size counts towards the account\'s 1 GiB storage quota, and content that would take the account past it is rejected with 413. A 409 means concurrent changes to the account\'s files kept changing its usage while the content was being replaced. The new content may already be stored, so read the content and its `ETag` again before deciding what to save: retrying with the same `If-Match` is rejected with 412 if it was. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. A quarantined file cannot be replaced (403). Requires the *Edit file storage* permission.
169
+ * Replace an account file\'s content
170
+ */
171
+ updateAccountFilesContent(requestParameters: FilesApiUpdateAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelRecord>;
172
+
147
173
  }
148
174
 
149
175
  /**
@@ -263,7 +289,7 @@ export class FilesApi extends runtime.BaseAPI implements FilesApiInterface {
263
289
  }
264
290
 
265
291
  /**
266
- * Returns the stored bytes of a file held against the account, with the `mimeType` recorded at upload as the `Content-Type`. Files belonging to other accounts are never returned. Served only from the user content host, so that a stored file is isolated from the application\'s own origin; any other host returns 404. The response always carries `Content-Disposition: attachment` and `Content-Security-Policy: default-src \'none\'`, so a file is downloaded rather than rendered even when the browser could display it. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. Requires the *View file storage* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored file matches a virus signature; the bytes are kept for investigation.
292
+ * Returns the stored bytes of a file held against the account, with the `mimeType` recorded when the content was last stored as the `Content-Type`. Files belonging to other accounts are never returned. Served only from the user content host, so that a stored file is isolated from the application\'s own origin; any other host returns 404. The response always carries `Content-Disposition: attachment` and `Content-Security-Policy: default-src \'none\'`, so a file is downloaded rather than rendered even when the browser could display it. The response\'s `ETag` identifies this version of the content: send it back as `If-Match` when replacing the content, so that a change made by someone else in the meantime is not overwritten. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. Requires the *View file storage* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored file matches a virus signature; the bytes are kept for investigation.
267
293
  * Download an account file
268
294
  */
269
295
  async getAccountFilesContentRaw(requestParameters: FilesApiGetAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> {
@@ -305,7 +331,7 @@ export class FilesApi extends runtime.BaseAPI implements FilesApiInterface {
305
331
  }
306
332
 
307
333
  /**
308
- * Returns the stored bytes of a file held against the account, with the `mimeType` recorded at upload as the `Content-Type`. Files belonging to other accounts are never returned. Served only from the user content host, so that a stored file is isolated from the application\'s own origin; any other host returns 404. The response always carries `Content-Disposition: attachment` and `Content-Security-Policy: default-src \'none\'`, so a file is downloaded rather than rendered even when the browser could display it. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. Requires the *View file storage* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored file matches a virus signature; the bytes are kept for investigation.
334
+ * Returns the stored bytes of a file held against the account, with the `mimeType` recorded when the content was last stored as the `Content-Type`. Files belonging to other accounts are never returned. Served only from the user content host, so that a stored file is isolated from the application\'s own origin; any other host returns 404. The response always carries `Content-Disposition: attachment` and `Content-Security-Policy: default-src \'none\'`, so a file is downloaded rather than rendered even when the browser could display it. The response\'s `ETag` identifies this version of the content: send it back as `If-Match` when replacing the content, so that a change made by someone else in the meantime is not overwritten. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. Requires the *View file storage* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored file matches a virus signature; the bytes are kept for investigation.
309
335
  * Download an account file
310
336
  */
311
337
  async getAccountFilesContent(requestParameters: FilesApiGetAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> {
@@ -417,4 +443,87 @@ export class FilesApi extends runtime.BaseAPI implements FilesApiInterface {
417
443
  return await response.value();
418
444
  }
419
445
 
446
+ /**
447
+ * Replaces the stored bytes of a file held against the account and returns the updated record, with the new version of the content as the `ETag`. Send the request as `multipart/form-data` with a single file field named `file`. The uploaded file\'s name is ignored: the file keeps its name and identifier, so anything already referencing it keeps working. `mimeType` is detected again from the new contents. Maximum file size is 25 MiB, and the content is rejected if a virus scan fails. Send the `ETag` returned when the content was read as `If-Match`. If the file has been replaced since then, the request is rejected with 412 and nothing changes; read the content again before deciding what to save. A missing `If-Match` is rejected with 422, and `*` with 400. The difference in size counts towards the account\'s 1 GiB storage quota, and content that would take the account past it is rejected with 413. A 409 means concurrent changes to the account\'s files kept changing its usage while the content was being replaced. The new content may already be stored, so read the content and its `ETag` again before deciding what to save: retrying with the same `If-Match` is rejected with 412 if it was. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. A quarantined file cannot be replaced (403). Requires the *Edit file storage* permission.
448
+ * Replace an account file\'s content
449
+ */
450
+ async updateAccountFilesContentRaw(requestParameters: FilesApiUpdateAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ModelRecord>> {
451
+ if (requestParameters['id'] == null) {
452
+ throw new runtime.RequiredError(
453
+ 'id',
454
+ 'Required parameter "id" was null or undefined when calling updateAccountFilesContent().'
455
+ );
456
+ }
457
+
458
+ if (requestParameters['ifMatch'] == null) {
459
+ throw new runtime.RequiredError(
460
+ 'ifMatch',
461
+ 'Required parameter "ifMatch" was null or undefined when calling updateAccountFilesContent().'
462
+ );
463
+ }
464
+
465
+ const queryParameters: any = {};
466
+
467
+ const headerParameters: runtime.HTTPHeaders = {};
468
+
469
+ if (requestParameters['ifMatch'] != null) {
470
+ headerParameters['If-Match'] = String(requestParameters['ifMatch']);
471
+ }
472
+
473
+ if (this.configuration && this.configuration.accessToken) {
474
+ const token = this.configuration.accessToken;
475
+ const tokenString = await token("accessToken", []);
476
+
477
+ if (tokenString) {
478
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
479
+ }
480
+ }
481
+ const consumes: runtime.Consume[] = [
482
+ { contentType: 'multipart/form-data' },
483
+ ];
484
+ // @ts-ignore: canConsumeForm may be unused
485
+ const canConsumeForm = runtime.canConsumeForm(consumes);
486
+
487
+ let formParams: { append(param: string, value: any): any };
488
+ let useForm = false;
489
+ // use FormData to transmit files using content-type "multipart/form-data"
490
+ useForm = canConsumeForm;
491
+ if (useForm) {
492
+ formParams = new FormData();
493
+ } else {
494
+ formParams = new URLSearchParams();
495
+ }
496
+
497
+ if (requestParameters['filename'] != null) {
498
+ formParams.append('filename', requestParameters['filename'] as any);
499
+ }
500
+
501
+ if (requestParameters['name'] != null) {
502
+ formParams.append('name', requestParameters['name'] as any);
503
+ }
504
+
505
+
506
+ let urlPath = `/v1/account/files/{id}/content`;
507
+ urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
508
+
509
+ const response = await this.request({
510
+ path: urlPath,
511
+ method: 'PUT',
512
+ headers: headerParameters,
513
+ query: queryParameters,
514
+ body: formParams,
515
+ }, initOverrides);
516
+
517
+ return new runtime.JSONApiResponse(response, (jsonValue) => ModelRecordFromJSON(jsonValue));
518
+ }
519
+
520
+ /**
521
+ * Replaces the stored bytes of a file held against the account and returns the updated record, with the new version of the content as the `ETag`. Send the request as `multipart/form-data` with a single file field named `file`. The uploaded file\'s name is ignored: the file keeps its name and identifier, so anything already referencing it keeps working. `mimeType` is detected again from the new contents. Maximum file size is 25 MiB, and the content is rejected if a virus scan fails. Send the `ETag` returned when the content was read as `If-Match`. If the file has been replaced since then, the request is rejected with 412 and nothing changes; read the content again before deciding what to save. A missing `If-Match` is rejected with 422, and `*` with 400. The difference in size counts towards the account\'s 1 GiB storage quota, and content that would take the account past it is rejected with 413. A 409 means concurrent changes to the account\'s files kept changing its usage while the content was being replaced. The new content may already be stored, so read the content and its `ETag` again before deciding what to save: retrying with the same `If-Match` is rejected with 412 if it was. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. A quarantined file cannot be replaced (403). Requires the *Edit file storage* permission.
522
+ * Replace an account file\'s content
523
+ */
524
+ async updateAccountFilesContent(requestParameters: FilesApiUpdateAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelRecord> {
525
+ const response = await this.updateAccountFilesContentRaw(requestParameters, initOverrides);
526
+ return await response.value();
527
+ }
528
+
420
529
  }
@@ -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
+
@@ -32,7 +32,7 @@ export interface ModelRecord {
32
32
  */
33
33
  id: string;
34
34
  /**
35
- * Media type detected from the file's contents at upload time, rather than from its name or the type the client declared.
35
+ * Media type detected from the file's contents when they were last stored, rather than from its name or the type the client declared.
36
36
  * @type {string}
37
37
  * @memberof ModelRecord
38
38
  */