@mapcreator/api 0.0.0-saga.1 → 0.0.0-saga.3

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 (90) hide show
  1. package/cjs/api/choropleth.d.ts +3 -3
  2. package/cjs/api/choropleth.d.ts.map +1 -1
  3. package/cjs/api/choropleth.js +17 -4
  4. package/cjs/api/choropleth.js.map +1 -1
  5. package/cjs/api/insetMap.d.ts +37 -0
  6. package/cjs/api/insetMap.d.ts.map +1 -0
  7. package/cjs/api/insetMap.js +49 -0
  8. package/cjs/api/insetMap.js.map +1 -0
  9. package/cjs/api/job.d.ts +1 -0
  10. package/cjs/api/job.d.ts.map +1 -1
  11. package/cjs/api/job.js.map +1 -1
  12. package/cjs/api/jobResult.d.ts +1 -1
  13. package/cjs/api/jobResult.d.ts.map +1 -1
  14. package/cjs/api/jobResult.js +1 -1
  15. package/cjs/api/jobResult.js.map +1 -1
  16. package/cjs/api/jobRevision.d.ts +2 -2
  17. package/cjs/api/jobRevision.d.ts.map +1 -1
  18. package/cjs/api/jobRevision.js +1 -1
  19. package/cjs/api/jobRevision.js.map +1 -1
  20. package/cjs/api/organisation.d.ts +2 -1
  21. package/cjs/api/organisation.d.ts.map +1 -1
  22. package/cjs/api/organisation.js +1 -2
  23. package/cjs/api/organisation.js.map +1 -1
  24. package/cjs/api/resources.d.ts +1 -1
  25. package/cjs/api/resources.d.ts.map +1 -1
  26. package/cjs/api/resources.js.map +1 -1
  27. package/cjs/index.d.ts +1 -0
  28. package/cjs/index.d.ts.map +1 -1
  29. package/cjs/index.js +1 -0
  30. package/cjs/index.js.map +1 -1
  31. package/esm/api/choropleth.d.ts +3 -3
  32. package/esm/api/choropleth.d.ts.map +1 -1
  33. package/esm/api/choropleth.js +17 -4
  34. package/esm/api/choropleth.js.map +1 -1
  35. package/esm/api/insetMap.d.ts +37 -0
  36. package/esm/api/insetMap.d.ts.map +1 -0
  37. package/esm/api/insetMap.js +44 -0
  38. package/esm/api/insetMap.js.map +1 -0
  39. package/esm/api/job.d.ts +1 -0
  40. package/esm/api/job.d.ts.map +1 -1
  41. package/esm/api/job.js.map +1 -1
  42. package/esm/api/jobResult.d.ts +1 -1
  43. package/esm/api/jobResult.d.ts.map +1 -1
  44. package/esm/api/jobResult.js +1 -1
  45. package/esm/api/jobResult.js.map +1 -1
  46. package/esm/api/jobRevision.d.ts +2 -2
  47. package/esm/api/jobRevision.d.ts.map +1 -1
  48. package/esm/api/jobRevision.js +1 -1
  49. package/esm/api/jobRevision.js.map +1 -1
  50. package/esm/api/organisation.d.ts +2 -1
  51. package/esm/api/organisation.d.ts.map +1 -1
  52. package/esm/api/organisation.js +1 -2
  53. package/esm/api/organisation.js.map +1 -1
  54. package/esm/api/resources.d.ts +1 -1
  55. package/esm/api/resources.d.ts.map +1 -1
  56. package/esm/api/resources.js.map +1 -1
  57. package/esm/index.d.ts +1 -0
  58. package/esm/index.d.ts.map +1 -1
  59. package/esm/index.js +1 -0
  60. package/esm/index.js.map +1 -1
  61. package/package.json +2 -2
  62. package/src/api/apiCommon.ts +70 -70
  63. package/src/api/choropleth.ts +125 -105
  64. package/src/api/color.ts +22 -22
  65. package/src/api/dimension.ts +44 -44
  66. package/src/api/dimensionSet.ts +20 -20
  67. package/src/api/feature.ts +22 -22
  68. package/src/api/font.ts +49 -49
  69. package/src/api/fontFamily.ts +43 -43
  70. package/src/api/highlight.ts +87 -87
  71. package/src/api/insetMap.ts +96 -0
  72. package/src/api/job.ts +130 -129
  73. package/src/api/jobResult.ts +95 -95
  74. package/src/api/jobRevision.ts +279 -278
  75. package/src/api/jobShare.ts +35 -35
  76. package/src/api/jobType.ts +26 -26
  77. package/src/api/language.ts +19 -19
  78. package/src/api/layer.ts +38 -38
  79. package/src/api/layerFaq.ts +53 -53
  80. package/src/api/layerGroup.ts +69 -69
  81. package/src/api/mapstyleSet.ts +48 -48
  82. package/src/api/message.ts +80 -80
  83. package/src/api/organisation.ts +95 -95
  84. package/src/api/resources.ts +145 -143
  85. package/src/api/svg.ts +33 -33
  86. package/src/api/svgSet.ts +56 -56
  87. package/src/api/user.ts +327 -327
  88. package/src/index.ts +43 -42
  89. package/src/oauth.ts +314 -314
  90. package/src/utils.ts +342 -342
@@ -1,95 +1,95 @@
1
- import {
2
- type ApiCommon,
3
- type ApiCommonData,
4
- type ApiError,
5
- type ApiSuccess,
6
- type Flatten,
7
- type Revivers,
8
- deletedNoneParam,
9
- lastJobRevision,
10
- request,
11
- } from '../utils.js';
12
-
13
- export type JobResult = {
14
- jobRevisionId: number;
15
- revision: number;
16
- status: string;
17
- };
18
-
19
- export type ApiJobResult = {
20
- data: {
21
- job_revision_id: number; // The id of the job revision
22
- revision: number; // The revision number of the job revision
23
- mapstyle_id: number; // The id of the map style
24
- interface_version: string; // The version of the interface (searchable, sortable)
25
- fix: string; //
26
- status: string; // The status of the job result (searchable, sortable)
27
- fail_reason: string; // A human-readable reason of why the map failed to process
28
- process_start: string; // The datetime when the job process started (searchable, sortable)
29
- process_end: string; // The datetime when the job process ended (searchable, sortable)
30
- dealt_with: boolean; // Checks if the Support fixed an issue (searchable, sortable)
31
- bought: boolean; // Checks if the result is bought or not (searchable, sortable)
32
- contract_id: number; // The id of the contract that was active when the map was created
33
- callback: string; // URL to another API which can finish a map (searchable, sortable)
34
- last_downloaded: string; // The last time the archive was downloaded (searchable, sortable)
35
- } & ApiCommonData;
36
- } & Omit<ApiSuccess, 'data'> | ApiError;
37
-
38
- export type ApiJobResultData = Flatten<Exclude<ApiJobResult, ApiError>['data']>;
39
-
40
- export const jobResultRevivers: Revivers<ApiJobResult, JobResult> = {
41
- mapstyle_id: undefined,
42
- interface_version: undefined,
43
- fix: undefined,
44
- fail_reason: undefined,
45
- process_start: undefined,
46
- process_end: undefined,
47
- dealt_with: undefined,
48
- bought: undefined,
49
- contract_id: undefined,
50
- callback: undefined,
51
- last_downloaded: undefined,
52
- };
53
-
54
- export async function uploadJobResultPreview(
55
- jobId: number,
56
- blob: Blob,
57
- ): Promise<Record<string, never>> {
58
- const pathname = `/v1/jobs/${jobId}/revisions/${lastJobRevision}/result/preview`;
59
- const path = `${pathname}?${deletedNoneParam}`;
60
- const body = new FormData();
61
-
62
- body.append('preview', blob);
63
-
64
- return request<ApiCommon, Record<string, never>>(path, body);
65
- }
66
-
67
- export type JobResultHostedImage = {
68
- url: string;
69
- message: string;
70
- };
71
-
72
- export type ApiJobResultHostedImage = {
73
- data: {
74
- url: string;
75
- message: string;
76
- } & ApiCommonData;
77
- } & Omit<ApiSuccess, 'data'> | ApiError;
78
-
79
- export type ApiJobResultHostedImageData = Flatten<Exclude<ApiJobResultHostedImage, ApiError>['data']>;
80
-
81
- export async function uploadJobResultHostedImage(
82
- jobId: number,
83
- blob: Blob,
84
- fileName: string,
85
- fileType: 'jpg' | 'png' | 'svg',
86
- ): Promise<JobResultHostedImage> {
87
- const pathname = `/v1/jobs/${jobId}/revisions/${lastJobRevision}/result/hosted-${fileType}`;
88
- const path = `${pathname}?${deletedNoneParam}`;
89
- const body = new FormData();
90
-
91
- body.append(fileType, blob);
92
- body.append('filename', fileName);
93
-
94
- return request<ApiJobResultHostedImage, JobResultHostedImage>(path, body);
95
- }
1
+ import {
2
+ type ApiCommon,
3
+ type ApiCommonData,
4
+ type ApiError,
5
+ type ApiSuccess,
6
+ type Flatten,
7
+ type Revivers,
8
+ deletedNoneParam,
9
+ lastJobRevision,
10
+ request,
11
+ } from '../utils.js';
12
+
13
+ export type JobResult = {
14
+ jobRevisionId: number;
15
+ revision: number;
16
+ status: string;
17
+ };
18
+
19
+ export type ApiJobResult = {
20
+ data: {
21
+ job_revision_id: number; // The id of the job revision
22
+ revision: number; // The revision number of the job revision
23
+ mapstyle_id: number; // The id of the map style
24
+ interface_version: string; // The version of the interface (searchable, sortable)
25
+ fix: string; //
26
+ status: string; // The status of the job result (searchable, sortable)
27
+ fail_reason: string; // A human-readable reason of why the map failed to process
28
+ process_start: string; // The datetime when the job process started (searchable, sortable)
29
+ process_end: string; // The datetime when the job process ended (searchable, sortable)
30
+ dealt_with: boolean; // Checks if the Support fixed an issue (searchable, sortable)
31
+ bought: boolean; // Checks if the result is bought or not (searchable, sortable)
32
+ subscription_id: number; // The id of the subscription that was active when the map was created
33
+ callback: string; // URL to another API which can finish a map (searchable, sortable)
34
+ last_downloaded: string; // The last time the archive was downloaded (searchable, sortable)
35
+ } & ApiCommonData;
36
+ } & Omit<ApiSuccess, 'data'> | ApiError;
37
+
38
+ export type ApiJobResultData = Flatten<Exclude<ApiJobResult, ApiError>['data']>;
39
+
40
+ export const jobResultRevivers: Revivers<ApiJobResult, JobResult> = {
41
+ mapstyle_id: undefined,
42
+ interface_version: undefined,
43
+ fix: undefined,
44
+ fail_reason: undefined,
45
+ process_start: undefined,
46
+ process_end: undefined,
47
+ dealt_with: undefined,
48
+ bought: undefined,
49
+ subscription_id: undefined,
50
+ callback: undefined,
51
+ last_downloaded: undefined,
52
+ };
53
+
54
+ export async function uploadJobResultPreview(
55
+ jobId: number,
56
+ blob: Blob,
57
+ ): Promise<Record<string, never>> {
58
+ const pathname = `/v1/jobs/${jobId}/revisions/${lastJobRevision}/result/preview`;
59
+ const path = `${pathname}?${deletedNoneParam}`;
60
+ const body = new FormData();
61
+
62
+ body.append('preview', blob);
63
+
64
+ return request<ApiCommon, Record<string, never>>(path, body);
65
+ }
66
+
67
+ export type JobResultHostedImage = {
68
+ url: string;
69
+ message: string;
70
+ };
71
+
72
+ export type ApiJobResultHostedImage = {
73
+ data: {
74
+ url: string;
75
+ message: string;
76
+ } & ApiCommonData;
77
+ } & Omit<ApiSuccess, 'data'> | ApiError;
78
+
79
+ export type ApiJobResultHostedImageData = Flatten<Exclude<ApiJobResultHostedImage, ApiError>['data']>;
80
+
81
+ export async function uploadJobResultHostedImage(
82
+ jobId: number,
83
+ blob: Blob,
84
+ fileName: string,
85
+ fileType: 'jpg' | 'png' | 'svg',
86
+ ): Promise<JobResultHostedImage> {
87
+ const pathname = `/v1/jobs/${jobId}/revisions/${lastJobRevision}/result/hosted-${fileType}`;
88
+ const path = `${pathname}?${deletedNoneParam}`;
89
+ const body = new FormData();
90
+
91
+ body.append(fileType, blob);
92
+ body.append('filename', fileName);
93
+
94
+ return request<ApiJobResultHostedImage, JobResultHostedImage>(path, body);
95
+ }