@marteye/studiojs 1.1.14 → 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
  /***
@@ -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>;
@@ -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,117 +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
- reservePriceInCents?: number | undefined;
88
- startingPriceInCents?: number | undefined;
89
- startAt?: string | undefined;
90
- endAt?: string | undefined;
91
- previousLotNumber?: string | undefined;
92
- 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;
93
92
  }) => Promise<import("./types").Lot>;
94
93
  update: (marketId: string, saleId: string, lotId: string, data: {
95
- productCode?: string | undefined;
96
- attributes?: Record<string, any> | undefined;
97
- sellerCasual?: string | null | undefined;
98
- sellerCustomerId?: string | null | undefined;
99
- lotNumber?: string | null | undefined;
100
- remarks?: string | undefined;
101
- notes?: string | undefined;
102
- unitOfSale?: "Per KG" | "Per Item" | "Per Lot" | "Per 1000KG" | undefined;
103
- unitPriceInCents?: number | undefined;
104
- reservePriceInCents?: number | undefined;
105
- startingPriceInCents?: number | undefined;
106
- buyerCasual?: string | null | undefined;
107
- buyerCustomerId?: string | null | undefined;
108
- startAt?: string | null | undefined;
109
- endAt?: string | null | undefined;
110
- saleStatus?: import("./types").LotSaleStatus | undefined;
111
- 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>;
112
111
  }) => Promise<import("./types").Lot>;
113
112
  delete: (marketId: string, saleId: string, lotId: string) => Promise<unknown>;
114
113
  };
115
114
  lotitems: {
116
115
  create: (marketId: string, saleId: string, lotId: string, data: {
117
- attributes?: Record<string, any> | undefined;
118
- notes?: {
116
+ attributes?: Record<string, any>;
117
+ notes?: Array<{
119
118
  text: string;
120
- }[] | undefined;
121
- metadata?: Record<string, any> | undefined;
119
+ }>;
120
+ metadata?: Record<string, any>;
122
121
  }) => Promise<import("./types").LotItem>;
123
122
  update: (marketId: string, saleId: string, lotId: string, itemId: string, data: {
124
- attributes?: Record<string, any> | undefined;
125
- index?: number | undefined;
126
- metadata?: Record<string, any> | undefined;
123
+ attributes?: Record<string, any>;
124
+ index?: number;
125
+ metadata?: Record<string, any>;
127
126
  }) => Promise<import("./types").LotItem>;
128
127
  delete: (marketId: string, saleId: string, lotId: string, itemId: string) => Promise<unknown>;
129
128
  };
130
129
  webhooks: {
131
- 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>>;
132
131
  };
133
132
  actions: {
134
133
  constructAction: (bodyAsBuffer: Buffer, signature: string, endpointSecret: string) => Promise<any>;
@@ -158,4 +157,14 @@ export default function resources(httpClient: HttpClient): {
158
157
  search: {
159
158
  query: (marketId: string, query: string) => Promise<import("./resources/search").SearchResult>;
160
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
+ };
161
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,117 +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
- reservePriceInCents?: number | undefined;
97
- startingPriceInCents?: number | undefined;
98
- startAt?: string | undefined;
99
- endAt?: string | undefined;
100
- previousLotNumber?: string | undefined;
101
- 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;
102
101
  }) => Promise<import("./types").Lot>;
103
102
  update: (marketId: string, saleId: string, lotId: string, data: {
104
- productCode?: string | undefined;
105
- attributes?: Record<string, any> | undefined;
106
- sellerCasual?: string | null | undefined;
107
- sellerCustomerId?: string | null | undefined;
108
- lotNumber?: string | null | undefined;
109
- remarks?: string | undefined;
110
- notes?: string | undefined;
111
- unitOfSale?: "Per KG" | "Per Item" | "Per Lot" | "Per 1000KG" | undefined;
112
- unitPriceInCents?: number | undefined;
113
- reservePriceInCents?: number | undefined;
114
- startingPriceInCents?: number | undefined;
115
- buyerCasual?: string | null | undefined;
116
- buyerCustomerId?: string | null | undefined;
117
- startAt?: string | null | undefined;
118
- endAt?: string | null | undefined;
119
- saleStatus?: import("./types").LotSaleStatus | undefined;
120
- 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>;
121
120
  }) => Promise<import("./types").Lot>;
122
121
  delete: (marketId: string, saleId: string, lotId: string) => Promise<unknown>;
123
122
  };
124
123
  lotitems: {
125
124
  create: (marketId: string, saleId: string, lotId: string, data: {
126
- attributes?: Record<string, any> | undefined;
127
- notes?: {
125
+ attributes?: Record<string, any>;
126
+ notes?: Array<{
128
127
  text: string;
129
- }[] | undefined;
130
- metadata?: Record<string, any> | undefined;
128
+ }>;
129
+ metadata?: Record<string, any>;
131
130
  }) => Promise<import("./types").LotItem>;
132
131
  update: (marketId: string, saleId: string, lotId: string, itemId: string, data: {
133
- attributes?: Record<string, any> | undefined;
134
- index?: number | undefined;
135
- metadata?: Record<string, any> | undefined;
132
+ attributes?: Record<string, any>;
133
+ index?: number;
134
+ metadata?: Record<string, any>;
136
135
  }) => Promise<import("./types").LotItem>;
137
136
  delete: (marketId: string, saleId: string, lotId: string, itemId: string) => Promise<unknown>;
138
137
  };
139
138
  webhooks: {
140
- 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>>;
141
140
  };
142
141
  actions: {
143
142
  constructAction: (bodyAsBuffer: Buffer, signature: string, endpointSecret: string) => Promise<any>;
@@ -167,4 +166,14 @@ export declare function Studio(info?: {
167
166
  search: {
168
167
  query: (marketId: string, query: string) => Promise<import("./resources/search").SearchResult>;
169
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
+ };
170
179
  };