@marteye/studiojs 1.1.23 → 1.1.25
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/dist/index.d.ts +174 -109
- package/dist/index.esm.js +310 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +313 -5
- package/dist/index.js.map +1 -1
- package/dist/resources/files.d.ts +6 -2
- package/dist/resources/lots.d.ts +1 -0
- package/dist/resources.d.ts +6 -1
- package/dist/studio.d.ts +6 -1
- package/dist/types.d.ts +6 -0
- package/dist/utils/eartag.d.ts +4 -3
- package/dist/utils/lots.d.ts +10 -0
- package/dist/utils/multipart-upload.d.ts +23 -3
- package/package.json +2 -1
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { uploadMultipartFile, uploadSingleFile } from "../utils/multipart-upload";
|
|
2
2
|
export default function create(): {
|
|
3
|
-
|
|
3
|
+
uploadSingleFile: (input: Parameters<typeof uploadSingleFile>[0], token: string) => Promise<{
|
|
4
|
+
message: string;
|
|
5
|
+
data: import("../types").Media;
|
|
6
|
+
}>;
|
|
7
|
+
uploadMultipartFile: (input: Parameters<typeof uploadMultipartFile>[0], token: string) => Promise<{
|
|
4
8
|
message: string;
|
|
5
9
|
mediaType: string;
|
|
6
10
|
process: import("../utils/multipart-upload").VariantProcessingState;
|
package/dist/resources/lots.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export default function create(httpClient: HttpClient): {
|
|
|
41
41
|
endAt?: string | null;
|
|
42
42
|
saleStatus?: LotSaleStatus;
|
|
43
43
|
metadata?: Record<string, any>;
|
|
44
|
+
inputAccessories?: Record<string, any>;
|
|
44
45
|
}) => Promise<Lot>;
|
|
45
46
|
delete: (marketId: string, saleId: string, lotId: string) => Promise<unknown>;
|
|
46
47
|
};
|
package/dist/resources.d.ts
CHANGED
|
@@ -108,6 +108,7 @@ export default function resources(httpClient: HttpClient): {
|
|
|
108
108
|
endAt?: string | null;
|
|
109
109
|
saleStatus?: import("./types").LotSaleStatus;
|
|
110
110
|
metadata?: Record<string, any>;
|
|
111
|
+
inputAccessories?: Record<string, any>;
|
|
111
112
|
}) => Promise<import("./types").Lot>;
|
|
112
113
|
delete: (marketId: string, saleId: string, lotId: string) => Promise<unknown>;
|
|
113
114
|
};
|
|
@@ -158,7 +159,11 @@ export default function resources(httpClient: HttpClient): {
|
|
|
158
159
|
query: (marketId: string, query: string) => Promise<import("./resources/search").SearchResult>;
|
|
159
160
|
};
|
|
160
161
|
files: {
|
|
161
|
-
|
|
162
|
+
uploadSingleFile: (input: Parameters<typeof import("./utils/multipart-upload").uploadSingleFile>[0], token: string) => Promise<{
|
|
163
|
+
message: string;
|
|
164
|
+
data: import("./types").Media;
|
|
165
|
+
}>;
|
|
166
|
+
uploadMultipartFile: (input: Parameters<typeof import("./utils/multipart-upload").uploadMultipartFile>[0], token: string) => Promise<{
|
|
162
167
|
message: string;
|
|
163
168
|
mediaType: string;
|
|
164
169
|
process: import("./utils/multipart-upload").VariantProcessingState;
|
package/dist/studio.d.ts
CHANGED
|
@@ -117,6 +117,7 @@ export declare function Studio(info?: {
|
|
|
117
117
|
endAt?: string | null;
|
|
118
118
|
saleStatus?: import("./types").LotSaleStatus;
|
|
119
119
|
metadata?: Record<string, any>;
|
|
120
|
+
inputAccessories?: Record<string, any>;
|
|
120
121
|
}) => Promise<import("./types").Lot>;
|
|
121
122
|
delete: (marketId: string, saleId: string, lotId: string) => Promise<unknown>;
|
|
122
123
|
};
|
|
@@ -167,7 +168,11 @@ export declare function Studio(info?: {
|
|
|
167
168
|
query: (marketId: string, query: string) => Promise<import("./resources/search").SearchResult>;
|
|
168
169
|
};
|
|
169
170
|
files: {
|
|
170
|
-
|
|
171
|
+
uploadSingleFile: (input: Parameters<typeof import("./utils/multipart-upload").uploadSingleFile>[0], token: string) => Promise<{
|
|
172
|
+
message: string;
|
|
173
|
+
data: import("./types").Media;
|
|
174
|
+
}>;
|
|
175
|
+
uploadMultipartFile: (input: Parameters<typeof import("./utils/multipart-upload").uploadMultipartFile>[0], token: string) => Promise<{
|
|
171
176
|
message: string;
|
|
172
177
|
mediaType: string;
|
|
173
178
|
process: import("./utils/multipart-upload").VariantProcessingState;
|
package/dist/types.d.ts
CHANGED
|
@@ -463,6 +463,7 @@ export interface Product {
|
|
|
463
463
|
};
|
|
464
464
|
}
|
|
465
465
|
export interface Cart {
|
|
466
|
+
customerId: string;
|
|
466
467
|
updatedAt: Timestamp;
|
|
467
468
|
itemsById: {
|
|
468
469
|
[itemId: string]: CartItem;
|
|
@@ -843,6 +844,11 @@ export interface Invoice extends Omit<Omit<Omit<Omit<DraftInvoice, "ledgerAccoun
|
|
|
843
844
|
*/
|
|
844
845
|
internalNextInvoiceId: string | null;
|
|
845
846
|
emailNotifications?: string[];
|
|
847
|
+
emailStatus?: {
|
|
848
|
+
recipient: string;
|
|
849
|
+
status: "sent" | "delivered" | "opened" | "bounced";
|
|
850
|
+
timestamp: Timestamp;
|
|
851
|
+
}[];
|
|
846
852
|
pitchPayLink: string | null;
|
|
847
853
|
}
|
|
848
854
|
export interface Printer {
|
package/dist/utils/eartag.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export default class EarTag {
|
|
|
7
7
|
static get countryCodesByNumber(): {
|
|
8
8
|
[code: string]: CountryCode;
|
|
9
9
|
};
|
|
10
|
+
private normalisedCountryCode;
|
|
10
11
|
private _raw;
|
|
11
12
|
get raw(): string;
|
|
12
13
|
private _isEartag;
|
|
@@ -15,9 +16,9 @@ export default class EarTag {
|
|
|
15
16
|
get isoCountryCode(): string | undefined;
|
|
16
17
|
private _nationalIdentifier?;
|
|
17
18
|
get nationalIdentifier(): string | undefined;
|
|
18
|
-
constructor(input: string, fallbackCountryCode?: CountryCode);
|
|
19
|
-
static parse(str: string, fallbackCountryCode?: CountryCode): EarTag;
|
|
20
|
-
static format(str: string): string | null;
|
|
19
|
+
constructor(input: string, fallbackCountryCode?: CountryCode | string | null);
|
|
20
|
+
static parse(str: string, fallbackCountryCode?: CountryCode | string | null): EarTag;
|
|
21
|
+
static format(str: string, marketCountry?: string | null | undefined): string | null;
|
|
21
22
|
toString(): string;
|
|
22
23
|
isISO24631(): boolean;
|
|
23
24
|
toISO24631(): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function lotComparator<T extends {
|
|
2
|
+
lotNumber: string;
|
|
3
|
+
}>(a: T, b: T): number;
|
|
4
|
+
export declare function sortByLotNumber<T extends {
|
|
5
|
+
lotNumber: string;
|
|
6
|
+
}>(lots: T[]): T[];
|
|
7
|
+
/***
|
|
8
|
+
* Generate the next lot number in a sequence:
|
|
9
|
+
*/
|
|
10
|
+
export declare function nextLotNumber(previousLotNumber: string): string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { Media } from "../types";
|
|
2
3
|
/**
|
|
3
4
|
|--------------------------------------------------
|
|
4
5
|
| START OF MEDIA CRATE CODE
|
|
@@ -14,10 +15,10 @@ export declare const processorPayload: z.ZodObject<{
|
|
|
14
15
|
assetPath: string;
|
|
15
16
|
suffix: string;
|
|
16
17
|
}>;
|
|
17
|
-
export declare const IMAGE_SIZES_VALUES: readonly ["small", "medium", "large"];
|
|
18
|
+
export declare const IMAGE_SIZES_VALUES: readonly ["thumbnail", "small", "medium", "large"];
|
|
18
19
|
export declare const VIDEO_TASKS_VALUES: readonly ["compressed", "thumbnail"];
|
|
19
20
|
export declare const videoTaskSchema: z.ZodEnum<["compressed", "thumbnail"]>;
|
|
20
|
-
export declare const imageSizeSchema: z.ZodEnum<["small", "medium", "large"]>;
|
|
21
|
+
export declare const imageSizeSchema: z.ZodEnum<["thumbnail", "small", "medium", "large"]>;
|
|
21
22
|
export type ImageSize = z.infer<typeof imageSizeSchema>;
|
|
22
23
|
export type ProcessorPayload = z.infer<typeof processorPayload>;
|
|
23
24
|
export type VideoVMPayload = ProcessorPayload & {
|
|
@@ -76,6 +77,12 @@ export type MediaUploadOptions = {
|
|
|
76
77
|
}) => void;
|
|
77
78
|
};
|
|
78
79
|
};
|
|
80
|
+
/**
|
|
81
|
+
|--------------------------------------------------
|
|
82
|
+
| Make a File Path
|
|
83
|
+
|--------------------------------------------------
|
|
84
|
+
*/
|
|
85
|
+
export declare function createFilePath(marketId: string, saleId: string, lotId: string, attributeId: string, fileName: string): string;
|
|
79
86
|
/**
|
|
80
87
|
* Starts a multipart upload process for a file
|
|
81
88
|
* @param {Object} params - The parameters for starting the upload
|
|
@@ -197,5 +204,18 @@ export type ChunkedInput = {
|
|
|
197
204
|
* @returns {Promise<MediaFinishUploadResponse>}
|
|
198
205
|
* @throws {Error} When upload fails
|
|
199
206
|
*/
|
|
200
|
-
export declare const
|
|
207
|
+
export declare const uploadMultipartFile: (input: FileInput | ChunkedInput, token: string) => Promise<MediaFinishUploadResponse>;
|
|
208
|
+
export type SingleFileInput = {
|
|
209
|
+
file?: File;
|
|
210
|
+
filePath?: never;
|
|
211
|
+
uploadConfig: MediaUploadOptions;
|
|
212
|
+
} | {
|
|
213
|
+
filePath?: string;
|
|
214
|
+
file?: never;
|
|
215
|
+
uploadConfig: MediaUploadOptions;
|
|
216
|
+
};
|
|
217
|
+
export declare const uploadSingleFile: (input: SingleFileInput, token: string) => Promise<{
|
|
218
|
+
message: string;
|
|
219
|
+
data: Media;
|
|
220
|
+
}>;
|
|
201
221
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marteye/studiojs",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.25",
|
|
4
4
|
"description": "MartEye Studio JavaScript SDK",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"build": "npm run clean && rollup -c",
|
|
26
26
|
"watch": "rollup -c -w",
|
|
27
27
|
"test": "jest --coverage",
|
|
28
|
+
"test:watch": "jest --watch",
|
|
28
29
|
"build:types": "tsc --emitDeclarationOnly",
|
|
29
30
|
"build:publish": "npm run build && npm publish --access public"
|
|
30
31
|
},
|