@marteye/studiojs 1.1.13 → 1.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.
@@ -1,6 +1,6 @@
1
1
  export default function SimpleHttpClient(baseUrl: string, apiKey: string, fetch: any, defaultTimeout: number, debug?: boolean): {
2
2
  get: <T>(path: string, queryParams?: any) => Promise<T>;
3
- post: <T_1>(path: string, body: any) => Promise<T_1>;
4
- delete: <T_2>(path: string) => Promise<T_2>;
3
+ post: <T>(path: string, body: any) => Promise<T>;
4
+ delete: <T>(path: string) => Promise<T>;
5
5
  };
6
6
  export type HttpClient = ReturnType<typeof SimpleHttpClient>;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { HttpClient } from "../net/http";
3
2
  export default function create(_: HttpClient): {
4
3
  /***
@@ -1,11 +1,9 @@
1
1
  import { HttpClient } from "../net/http";
2
2
  import { Customer } from "../types";
3
3
  export interface CreateCustomerPayload {
4
- firstName?: string;
5
- lastName?: string;
4
+ displayName: string;
6
5
  email?: string;
7
6
  phone?: string;
8
- tradingName: string;
9
7
  accountNumberPrefix?: string;
10
8
  accountNumber?: string;
11
9
  cphNumber?: string;
@@ -0,0 +1,12 @@
1
+ import { uploadFile } from "../utils/multipart-upload";
2
+ export default function create(): {
3
+ uploadFile: (input: Parameters<typeof uploadFile>[0], token: string) => Promise<{
4
+ message: string;
5
+ mediaType: string;
6
+ process: import("../utils/multipart-upload").VariantProcessingState;
7
+ }>;
8
+ deleteFile: (fileUrl: string, token: string) => Promise<{
9
+ data: boolean;
10
+ }>;
11
+ };
12
+ export type Files = ReturnType<typeof create>;
@@ -16,8 +16,10 @@ export default function create(httpClient: HttpClient): {
16
16
  metadata?: Record<string, any>;
17
17
  buyerCustomerId?: string;
18
18
  unitPriceInCents?: number;
19
- startedAt?: string;
20
- endedAt?: string;
19
+ reservePriceInCents?: number;
20
+ startingPriceInCents?: number;
21
+ startAt?: string;
22
+ endAt?: string;
21
23
  previousLotNumber?: string;
22
24
  saleStatus?: LotSaleStatus;
23
25
  }) => Promise<Lot>;
@@ -31,10 +33,12 @@ export default function create(httpClient: HttpClient): {
31
33
  notes?: string;
32
34
  unitOfSale?: "Per KG" | "Per Item" | "Per Lot" | "Per 1000KG";
33
35
  unitPriceInCents?: number;
36
+ reservePriceInCents?: number;
37
+ startingPriceInCents?: number;
34
38
  buyerCasual?: string | null;
35
39
  buyerCustomerId?: string | null;
36
- startedAt?: string | null;
37
- endedAt?: string | null;
40
+ startAt?: string | null;
41
+ endAt?: string | null;
38
42
  saleStatus?: LotSaleStatus;
39
43
  metadata?: Record<string, any>;
40
44
  }) => Promise<Lot>;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { HttpClient } from "../net/http";
3
2
  import { WebhookEvent } from "../types";
4
3
  export default function create(_: HttpClient): {
@@ -1,5 +1,4 @@
1
- /// <reference types="node" />
2
- import { HttpClient } from "./net/http";
1
+ import type { HttpClient } from "./net/http";
3
2
  export default function resources(httpClient: HttpClient): {
4
3
  markets: {
5
4
  get: (marketId: string) => Promise<import("./types").Market>;
@@ -7,8 +6,8 @@ export default function resources(httpClient: HttpClient): {
7
6
  sales: {
8
7
  get: (marketId: string, saleId: string) => Promise<import("./types").Sale>;
9
8
  list: (marketId: string, opts: {
10
- start?: string | undefined;
11
- end?: string | undefined;
9
+ start?: string;
10
+ end?: string;
12
11
  }) => Promise<{
13
12
  start: string;
14
13
  end: string;
@@ -18,113 +17,117 @@ export default function resources(httpClient: HttpClient): {
18
17
  name: string;
19
18
  startsAt: string;
20
19
  availableProductCodes: string[];
21
- recurring?: "Weekly" | "Bi-weekly" | "Monthly" | null | undefined;
22
- martEyeSaleType?: "LIVE" | "TIMED" | null | undefined;
23
- location?: string | null | undefined;
24
- description?: string | null | undefined;
25
- image?: string | null | undefined;
26
- cover?: string | null | undefined;
20
+ recurring?: null | "Weekly" | "Bi-weekly" | "Monthly";
21
+ martEyeSaleType?: "LIVE" | "TIMED" | null;
22
+ location?: string | null;
23
+ description?: string | null;
24
+ image?: string | null;
25
+ cover?: string | null;
27
26
  attributeDefaults?: {
28
27
  [attributekey: string]: string | number | boolean;
29
- } | undefined;
28
+ };
30
29
  }) => Promise<{
31
30
  saleId: string;
32
31
  }>;
33
32
  update: (marketId: string, saleId: string, data: {
34
- name?: string | undefined;
35
- recurring?: "Weekly" | "Bi-weekly" | "Monthly" | null | undefined;
36
- defaultProductCode?: string | undefined;
37
- attributeDefaults?: Record<string, any> | undefined;
38
- martEyeId?: string | null | undefined;
33
+ name?: string;
34
+ recurring?: "Weekly" | "Bi-weekly" | "Monthly" | null;
35
+ defaultProductCode?: string;
36
+ attributeDefaults?: Record<string, any>;
37
+ martEyeId?: string | null;
39
38
  marteyeSettings?: {
40
- description?: string | undefined;
41
- image?: string | undefined;
42
- logo?: string | undefined;
39
+ description?: string;
40
+ image?: string;
41
+ logo?: string;
43
42
  type: "LIVE" | "TIMED";
44
- location?: string | null | undefined;
45
- descriptionLines?: string[] | undefined;
46
- descriptionLink?: string | undefined;
47
- deposit?: number | undefined;
48
- hidePrices?: boolean | undefined;
49
- hideReplay?: boolean | undefined;
50
- labels?: string[] | undefined;
51
- tags?: string[] | undefined;
52
- details?: {
43
+ location?: string | null;
44
+ descriptionLines?: string[];
45
+ descriptionLink?: string;
46
+ deposit?: number;
47
+ hidePrices?: boolean;
48
+ hideReplay?: boolean;
49
+ labels?: string[];
50
+ tags?: string[];
51
+ details?: Array<{
53
52
  markdownBase64: string;
54
53
  title: string;
55
- }[] | undefined;
56
- cover?: string | undefined;
57
- primaryColour?: string | undefined;
58
- secondaryColour?: string | undefined;
59
- foregroundColour?: string | undefined;
60
- extensionTime?: number | undefined;
61
- incrementLadder?: {
54
+ }>;
55
+ cover?: string;
56
+ primaryColour?: string;
57
+ secondaryColour?: string;
58
+ foregroundColour?: string;
59
+ extensionTime?: number;
60
+ incrementLadder?: Array<{
62
61
  max: number;
63
62
  increment: number;
64
- }[] | undefined;
65
- hideNav?: boolean | undefined;
66
- signInOverrideLink?: string | undefined;
67
- published?: boolean | undefined;
68
- pin?: boolean | undefined;
69
- cascade?: boolean | undefined;
70
- reportEmail?: string | undefined;
71
- } | null | undefined;
63
+ }>;
64
+ hideNav?: boolean;
65
+ signInOverrideLink?: string;
66
+ published?: boolean;
67
+ pin?: boolean;
68
+ cascade?: boolean;
69
+ reportEmail?: string;
70
+ } | null;
72
71
  }) => Promise<import("./types").Sale>;
73
72
  };
74
73
  lots: {
75
74
  get: (marketId: string, saleId: string, lotId: string) => Promise<import("./types").Lot>;
76
75
  list: (marketId: string, saleId: string) => Promise<import("./types").Lot[]>;
77
76
  create: (marketId: string, saleId: string, data: {
78
- index?: number | undefined;
79
- lotNumber?: string | undefined;
80
- group?: string | undefined;
81
- productCode?: string | undefined;
82
- sellerCustomerId?: string | undefined;
83
- attributes?: Record<string, any> | undefined;
84
- metadata?: Record<string, any> | undefined;
85
- buyerCustomerId?: string | undefined;
86
- unitPriceInCents?: number | undefined;
87
- startedAt?: string | undefined;
88
- endedAt?: string | undefined;
89
- previousLotNumber?: string | undefined;
90
- saleStatus?: import("./types").LotSaleStatus | undefined;
77
+ index?: number;
78
+ lotNumber?: string;
79
+ group?: string;
80
+ productCode?: string;
81
+ sellerCustomerId?: string;
82
+ attributes?: Record<string, any>;
83
+ metadata?: Record<string, any>;
84
+ buyerCustomerId?: string;
85
+ unitPriceInCents?: number;
86
+ reservePriceInCents?: number;
87
+ startingPriceInCents?: number;
88
+ startAt?: string;
89
+ endAt?: string;
90
+ previousLotNumber?: string;
91
+ saleStatus?: import("./types").LotSaleStatus;
91
92
  }) => Promise<import("./types").Lot>;
92
93
  update: (marketId: string, saleId: string, lotId: string, data: {
93
- productCode?: string | undefined;
94
- attributes?: Record<string, any> | undefined;
95
- sellerCasual?: string | null | undefined;
96
- sellerCustomerId?: string | null | undefined;
97
- lotNumber?: string | null | undefined;
98
- remarks?: string | undefined;
99
- notes?: string | undefined;
100
- unitOfSale?: "Per KG" | "Per Item" | "Per Lot" | "Per 1000KG" | undefined;
101
- unitPriceInCents?: number | undefined;
102
- buyerCasual?: string | null | undefined;
103
- buyerCustomerId?: string | null | undefined;
104
- startedAt?: string | null | undefined;
105
- endedAt?: string | null | undefined;
106
- saleStatus?: import("./types").LotSaleStatus | undefined;
107
- metadata?: Record<string, any> | undefined;
94
+ productCode?: string;
95
+ attributes?: Record<string, any>;
96
+ sellerCasual?: string | null;
97
+ sellerCustomerId?: string | null;
98
+ lotNumber?: string | null;
99
+ remarks?: string;
100
+ notes?: string;
101
+ unitOfSale?: "Per KG" | "Per Item" | "Per Lot" | "Per 1000KG";
102
+ unitPriceInCents?: number;
103
+ reservePriceInCents?: number;
104
+ startingPriceInCents?: number;
105
+ buyerCasual?: string | null;
106
+ buyerCustomerId?: string | null;
107
+ startAt?: string | null;
108
+ endAt?: string | null;
109
+ saleStatus?: import("./types").LotSaleStatus;
110
+ metadata?: Record<string, any>;
108
111
  }) => Promise<import("./types").Lot>;
109
112
  delete: (marketId: string, saleId: string, lotId: string) => Promise<unknown>;
110
113
  };
111
114
  lotitems: {
112
115
  create: (marketId: string, saleId: string, lotId: string, data: {
113
- attributes?: Record<string, any> | undefined;
114
- notes?: {
116
+ attributes?: Record<string, any>;
117
+ notes?: Array<{
115
118
  text: string;
116
- }[] | undefined;
117
- metadata?: Record<string, any> | undefined;
119
+ }>;
120
+ metadata?: Record<string, any>;
118
121
  }) => Promise<import("./types").LotItem>;
119
122
  update: (marketId: string, saleId: string, lotId: string, itemId: string, data: {
120
- attributes?: Record<string, any> | undefined;
121
- index?: number | undefined;
122
- metadata?: Record<string, any> | undefined;
123
+ attributes?: Record<string, any>;
124
+ index?: number;
125
+ metadata?: Record<string, any>;
123
126
  }) => Promise<import("./types").LotItem>;
124
127
  delete: (marketId: string, saleId: string, lotId: string, itemId: string) => Promise<unknown>;
125
128
  };
126
129
  webhooks: {
127
- constructEvent: <T extends unknown>(bodyAsBuffer: Buffer, signature: string | null | undefined, endpointSecret: string | null | undefined) => Promise<import("./types").WebhookEvent<T>>;
130
+ constructEvent: <T extends unknown>(bodyAsBuffer: Buffer, signature: string | undefined | null, endpointSecret: string | undefined | null) => Promise<import("./types").WebhookEvent<T>>;
128
131
  };
129
132
  actions: {
130
133
  constructAction: (bodyAsBuffer: Buffer, signature: string, endpointSecret: string) => Promise<any>;
@@ -154,4 +157,14 @@ export default function resources(httpClient: HttpClient): {
154
157
  search: {
155
158
  query: (marketId: string, query: string) => Promise<import("./resources/search").SearchResult>;
156
159
  };
160
+ files: {
161
+ uploadFile: (input: Parameters<typeof import("./utils/multipart-upload").uploadFile>[0], token: string) => Promise<{
162
+ message: string;
163
+ mediaType: string;
164
+ process: import("./utils/multipart-upload").VariantProcessingState;
165
+ }>;
166
+ deleteFile: (fileUrl: string, token: string) => Promise<{
167
+ data: boolean;
168
+ }>;
169
+ };
157
170
  };
package/dist/studio.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import Resources from "./resources";
3
2
  export type StudioInstance = ReturnType<typeof Resources> & {
4
3
  isDebugMode: boolean;
@@ -16,8 +15,8 @@ export declare function Studio(info?: {
16
15
  sales: {
17
16
  get: (marketId: string, saleId: string) => Promise<import("./types").Sale>;
18
17
  list: (marketId: string, opts: {
19
- start?: string | undefined;
20
- end?: string | undefined;
18
+ start?: string;
19
+ end?: string;
21
20
  }) => Promise<{
22
21
  start: string;
23
22
  end: string;
@@ -27,113 +26,117 @@ export declare function Studio(info?: {
27
26
  name: string;
28
27
  startsAt: string;
29
28
  availableProductCodes: string[];
30
- recurring?: "Weekly" | "Bi-weekly" | "Monthly" | null | undefined;
31
- martEyeSaleType?: "LIVE" | "TIMED" | null | undefined;
32
- location?: string | null | undefined;
33
- description?: string | null | undefined;
34
- image?: string | null | undefined;
35
- cover?: string | null | undefined;
29
+ recurring?: null | "Weekly" | "Bi-weekly" | "Monthly";
30
+ martEyeSaleType?: "LIVE" | "TIMED" | null;
31
+ location?: string | null;
32
+ description?: string | null;
33
+ image?: string | null;
34
+ cover?: string | null;
36
35
  attributeDefaults?: {
37
36
  [attributekey: string]: string | number | boolean;
38
- } | undefined;
37
+ };
39
38
  }) => Promise<{
40
39
  saleId: string;
41
40
  }>;
42
41
  update: (marketId: string, saleId: string, data: {
43
- name?: string | undefined;
44
- recurring?: "Weekly" | "Bi-weekly" | "Monthly" | null | undefined;
45
- defaultProductCode?: string | undefined;
46
- attributeDefaults?: Record<string, any> | undefined;
47
- martEyeId?: string | null | undefined;
42
+ name?: string;
43
+ recurring?: "Weekly" | "Bi-weekly" | "Monthly" | null;
44
+ defaultProductCode?: string;
45
+ attributeDefaults?: Record<string, any>;
46
+ martEyeId?: string | null;
48
47
  marteyeSettings?: {
49
- description?: string | undefined;
50
- image?: string | undefined;
51
- logo?: string | undefined;
48
+ description?: string;
49
+ image?: string;
50
+ logo?: string;
52
51
  type: "LIVE" | "TIMED";
53
- location?: string | null | undefined;
54
- descriptionLines?: string[] | undefined;
55
- descriptionLink?: string | undefined;
56
- deposit?: number | undefined;
57
- hidePrices?: boolean | undefined;
58
- hideReplay?: boolean | undefined;
59
- labels?: string[] | undefined;
60
- tags?: string[] | undefined;
61
- details?: {
52
+ location?: string | null;
53
+ descriptionLines?: string[];
54
+ descriptionLink?: string;
55
+ deposit?: number;
56
+ hidePrices?: boolean;
57
+ hideReplay?: boolean;
58
+ labels?: string[];
59
+ tags?: string[];
60
+ details?: Array<{
62
61
  markdownBase64: string;
63
62
  title: string;
64
- }[] | undefined;
65
- cover?: string | undefined;
66
- primaryColour?: string | undefined;
67
- secondaryColour?: string | undefined;
68
- foregroundColour?: string | undefined;
69
- extensionTime?: number | undefined;
70
- incrementLadder?: {
63
+ }>;
64
+ cover?: string;
65
+ primaryColour?: string;
66
+ secondaryColour?: string;
67
+ foregroundColour?: string;
68
+ extensionTime?: number;
69
+ incrementLadder?: Array<{
71
70
  max: number;
72
71
  increment: number;
73
- }[] | undefined;
74
- hideNav?: boolean | undefined;
75
- signInOverrideLink?: string | undefined;
76
- published?: boolean | undefined;
77
- pin?: boolean | undefined;
78
- cascade?: boolean | undefined;
79
- reportEmail?: string | undefined;
80
- } | null | undefined;
72
+ }>;
73
+ hideNav?: boolean;
74
+ signInOverrideLink?: string;
75
+ published?: boolean;
76
+ pin?: boolean;
77
+ cascade?: boolean;
78
+ reportEmail?: string;
79
+ } | null;
81
80
  }) => Promise<import("./types").Sale>;
82
81
  };
83
82
  lots: {
84
83
  get: (marketId: string, saleId: string, lotId: string) => Promise<import("./types").Lot>;
85
84
  list: (marketId: string, saleId: string) => Promise<import("./types").Lot[]>;
86
85
  create: (marketId: string, saleId: string, data: {
87
- index?: number | undefined;
88
- lotNumber?: string | undefined;
89
- group?: string | undefined;
90
- productCode?: string | undefined;
91
- sellerCustomerId?: string | undefined;
92
- attributes?: Record<string, any> | undefined;
93
- metadata?: Record<string, any> | undefined;
94
- buyerCustomerId?: string | undefined;
95
- unitPriceInCents?: number | undefined;
96
- startedAt?: string | undefined;
97
- endedAt?: string | undefined;
98
- previousLotNumber?: string | undefined;
99
- saleStatus?: import("./types").LotSaleStatus | undefined;
86
+ index?: number;
87
+ lotNumber?: string;
88
+ group?: string;
89
+ productCode?: string;
90
+ sellerCustomerId?: string;
91
+ attributes?: Record<string, any>;
92
+ metadata?: Record<string, any>;
93
+ buyerCustomerId?: string;
94
+ unitPriceInCents?: number;
95
+ reservePriceInCents?: number;
96
+ startingPriceInCents?: number;
97
+ startAt?: string;
98
+ endAt?: string;
99
+ previousLotNumber?: string;
100
+ saleStatus?: import("./types").LotSaleStatus;
100
101
  }) => Promise<import("./types").Lot>;
101
102
  update: (marketId: string, saleId: string, lotId: string, data: {
102
- productCode?: string | undefined;
103
- attributes?: Record<string, any> | undefined;
104
- sellerCasual?: string | null | undefined;
105
- sellerCustomerId?: string | null | undefined;
106
- lotNumber?: string | null | undefined;
107
- remarks?: string | undefined;
108
- notes?: string | undefined;
109
- unitOfSale?: "Per KG" | "Per Item" | "Per Lot" | "Per 1000KG" | undefined;
110
- unitPriceInCents?: number | undefined;
111
- buyerCasual?: string | null | undefined;
112
- buyerCustomerId?: string | null | undefined;
113
- startedAt?: string | null | undefined;
114
- endedAt?: string | null | undefined;
115
- saleStatus?: import("./types").LotSaleStatus | undefined;
116
- metadata?: Record<string, any> | undefined;
103
+ productCode?: string;
104
+ attributes?: Record<string, any>;
105
+ sellerCasual?: string | null;
106
+ sellerCustomerId?: string | null;
107
+ lotNumber?: string | null;
108
+ remarks?: string;
109
+ notes?: string;
110
+ unitOfSale?: "Per KG" | "Per Item" | "Per Lot" | "Per 1000KG";
111
+ unitPriceInCents?: number;
112
+ reservePriceInCents?: number;
113
+ startingPriceInCents?: number;
114
+ buyerCasual?: string | null;
115
+ buyerCustomerId?: string | null;
116
+ startAt?: string | null;
117
+ endAt?: string | null;
118
+ saleStatus?: import("./types").LotSaleStatus;
119
+ metadata?: Record<string, any>;
117
120
  }) => Promise<import("./types").Lot>;
118
121
  delete: (marketId: string, saleId: string, lotId: string) => Promise<unknown>;
119
122
  };
120
123
  lotitems: {
121
124
  create: (marketId: string, saleId: string, lotId: string, data: {
122
- attributes?: Record<string, any> | undefined;
123
- notes?: {
125
+ attributes?: Record<string, any>;
126
+ notes?: Array<{
124
127
  text: string;
125
- }[] | undefined;
126
- metadata?: Record<string, any> | undefined;
128
+ }>;
129
+ metadata?: Record<string, any>;
127
130
  }) => Promise<import("./types").LotItem>;
128
131
  update: (marketId: string, saleId: string, lotId: string, itemId: string, data: {
129
- attributes?: Record<string, any> | undefined;
130
- index?: number | undefined;
131
- metadata?: Record<string, any> | undefined;
132
+ attributes?: Record<string, any>;
133
+ index?: number;
134
+ metadata?: Record<string, any>;
132
135
  }) => Promise<import("./types").LotItem>;
133
136
  delete: (marketId: string, saleId: string, lotId: string, itemId: string) => Promise<unknown>;
134
137
  };
135
138
  webhooks: {
136
- constructEvent: <T extends unknown>(bodyAsBuffer: Buffer, signature: string | null | undefined, endpointSecret: string | null | undefined) => Promise<import("./types").WebhookEvent<T>>;
139
+ constructEvent: <T extends unknown>(bodyAsBuffer: Buffer, signature: string | undefined | null, endpointSecret: string | undefined | null) => Promise<import("./types").WebhookEvent<T>>;
137
140
  };
138
141
  actions: {
139
142
  constructAction: (bodyAsBuffer: Buffer, signature: string, endpointSecret: string) => Promise<any>;
@@ -163,4 +166,14 @@ export declare function Studio(info?: {
163
166
  search: {
164
167
  query: (marketId: string, query: string) => Promise<import("./resources/search").SearchResult>;
165
168
  };
169
+ files: {
170
+ uploadFile: (input: Parameters<typeof import("./utils/multipart-upload").uploadFile>[0], token: string) => Promise<{
171
+ message: string;
172
+ mediaType: string;
173
+ process: import("./utils/multipart-upload").VariantProcessingState;
174
+ }>;
175
+ deleteFile: (fileUrl: string, token: string) => Promise<{
176
+ data: boolean;
177
+ }>;
178
+ };
166
179
  };
package/dist/types.d.ts CHANGED
@@ -255,12 +255,14 @@ export interface Lot {
255
255
  notes?: string;
256
256
  currency: CurrenciesWithGuinea;
257
257
  unitOfSale: UnitOfSale;
258
+ reservePriceInCents?: number | null;
259
+ startingPriceInCents?: number | null;
258
260
  unitPriceInCents?: number;
259
261
  buyerCasual?: string | null;
260
262
  buyerCustomerId: string | null;
261
263
  buyer?: ShortCustomerDetails | null;
262
- startedAt?: Timestamp;
263
- endedAt?: Timestamp;
264
+ startAt?: Timestamp;
265
+ endAt?: Timestamp;
264
266
  sellerInvoiceId: string | null;
265
267
  sellerInvoiceNumber?: number | undefined | null;
266
268
  buyerInvoiceId: string | null;