@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.
- package/cjs/api/choropleth.d.ts +3 -3
- package/cjs/api/choropleth.d.ts.map +1 -1
- package/cjs/api/choropleth.js +17 -4
- package/cjs/api/choropleth.js.map +1 -1
- package/cjs/api/insetMap.d.ts +37 -0
- package/cjs/api/insetMap.d.ts.map +1 -0
- package/cjs/api/insetMap.js +49 -0
- package/cjs/api/insetMap.js.map +1 -0
- package/cjs/api/job.d.ts +1 -0
- package/cjs/api/job.d.ts.map +1 -1
- package/cjs/api/job.js.map +1 -1
- package/cjs/api/jobResult.d.ts +1 -1
- package/cjs/api/jobResult.d.ts.map +1 -1
- package/cjs/api/jobResult.js +1 -1
- package/cjs/api/jobResult.js.map +1 -1
- package/cjs/api/jobRevision.d.ts +2 -2
- package/cjs/api/jobRevision.d.ts.map +1 -1
- package/cjs/api/jobRevision.js +1 -1
- package/cjs/api/jobRevision.js.map +1 -1
- package/cjs/api/organisation.d.ts +2 -1
- package/cjs/api/organisation.d.ts.map +1 -1
- package/cjs/api/organisation.js +1 -2
- package/cjs/api/organisation.js.map +1 -1
- package/cjs/api/resources.d.ts +1 -1
- package/cjs/api/resources.d.ts.map +1 -1
- package/cjs/api/resources.js.map +1 -1
- package/cjs/index.d.ts +1 -0
- package/cjs/index.d.ts.map +1 -1
- package/cjs/index.js +1 -0
- package/cjs/index.js.map +1 -1
- package/esm/api/choropleth.d.ts +3 -3
- package/esm/api/choropleth.d.ts.map +1 -1
- package/esm/api/choropleth.js +17 -4
- package/esm/api/choropleth.js.map +1 -1
- package/esm/api/insetMap.d.ts +37 -0
- package/esm/api/insetMap.d.ts.map +1 -0
- package/esm/api/insetMap.js +44 -0
- package/esm/api/insetMap.js.map +1 -0
- package/esm/api/job.d.ts +1 -0
- package/esm/api/job.d.ts.map +1 -1
- package/esm/api/job.js.map +1 -1
- package/esm/api/jobResult.d.ts +1 -1
- package/esm/api/jobResult.d.ts.map +1 -1
- package/esm/api/jobResult.js +1 -1
- package/esm/api/jobResult.js.map +1 -1
- package/esm/api/jobRevision.d.ts +2 -2
- package/esm/api/jobRevision.d.ts.map +1 -1
- package/esm/api/jobRevision.js +1 -1
- package/esm/api/jobRevision.js.map +1 -1
- package/esm/api/organisation.d.ts +2 -1
- package/esm/api/organisation.d.ts.map +1 -1
- package/esm/api/organisation.js +1 -2
- package/esm/api/organisation.js.map +1 -1
- package/esm/api/resources.d.ts +1 -1
- package/esm/api/resources.d.ts.map +1 -1
- package/esm/api/resources.js.map +1 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +1 -0
- package/esm/index.js.map +1 -1
- package/package.json +2 -2
- package/src/api/apiCommon.ts +70 -70
- package/src/api/choropleth.ts +125 -105
- package/src/api/color.ts +22 -22
- package/src/api/dimension.ts +44 -44
- package/src/api/dimensionSet.ts +20 -20
- package/src/api/feature.ts +22 -22
- package/src/api/font.ts +49 -49
- package/src/api/fontFamily.ts +43 -43
- package/src/api/highlight.ts +87 -87
- package/src/api/insetMap.ts +96 -0
- package/src/api/job.ts +130 -129
- package/src/api/jobResult.ts +95 -95
- package/src/api/jobRevision.ts +279 -278
- package/src/api/jobShare.ts +35 -35
- package/src/api/jobType.ts +26 -26
- package/src/api/language.ts +19 -19
- package/src/api/layer.ts +38 -38
- package/src/api/layerFaq.ts +53 -53
- package/src/api/layerGroup.ts +69 -69
- package/src/api/mapstyleSet.ts +48 -48
- package/src/api/message.ts +80 -80
- package/src/api/organisation.ts +95 -95
- package/src/api/resources.ts +145 -143
- package/src/api/svg.ts +33 -33
- package/src/api/svgSet.ts +56 -56
- package/src/api/user.ts +327 -327
- package/src/index.ts +43 -42
- package/src/oauth.ts +314 -314
- package/src/utils.ts +342 -342
package/src/api/jobResult.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
+
}
|