@marteye/studiojs 1.1.25 → 1.1.26

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.js CHANGED
@@ -71,7 +71,7 @@ function SimpleHttpClient(baseUrl, apiKey, fetch, defaultTimeout, debug = false)
71
71
  }
72
72
 
73
73
  // Path: studiojs/src/resources/markets.ts
74
- function create$c(_) {
74
+ function create$d(_) {
75
75
  const actions = {
76
76
  /***
77
77
  * This is used to construct the action from the request body
@@ -101,7 +101,7 @@ function create$c(_) {
101
101
  return actions;
102
102
  }
103
103
 
104
- function create$b(httpClient) {
104
+ function create$c(httpClient) {
105
105
  return {
106
106
  list: async (marketId) => {
107
107
  return httpClient.get(`/${marketId}/adjustments`);
@@ -112,6 +112,72 @@ function create$b(httpClient) {
112
112
  };
113
113
  }
114
114
 
115
+ function create$b(httpClient) {
116
+ let applications = {
117
+ /**
118
+ * List applications for a market with optional filtering
119
+ * @param marketId - ID of the market
120
+ * @param options - Optional query parameters for filtering and pagination
121
+ * @returns Paginated list of applications
122
+ */
123
+ list: async (marketId, options) => {
124
+ return httpClient.get(`/${marketId}/applications`, options);
125
+ },
126
+ /**
127
+ * Get a single application by ID
128
+ * @param marketId - ID of the market
129
+ * @param applicationId - ID of the application
130
+ * @returns The application details
131
+ */
132
+ get: async (marketId, applicationId) => {
133
+ return httpClient.get(`/${marketId}/applications/${applicationId}`);
134
+ },
135
+ /**
136
+ * Create a new application
137
+ * @param marketId - ID of the market
138
+ * @param applicationData - The application data
139
+ * @returns The created application
140
+ */
141
+ create: async (marketId, applicationData) => {
142
+ return httpClient.post(`/${marketId}/applications`, applicationData);
143
+ },
144
+ /**
145
+ * Update an existing application
146
+ * @param marketId - ID of the market
147
+ * @param applicationId - ID of the application to update
148
+ * @param updateData - The fields to update
149
+ * @returns The updated application
150
+ * @throws Error if the application is already approved or rejected
151
+ */
152
+ update: async (marketId, applicationId, updateData) => {
153
+ return httpClient.post(`/${marketId}/applications/${applicationId}`, updateData);
154
+ },
155
+ /**
156
+ * Approve an application
157
+ * @param marketId - ID of the market
158
+ * @param applicationId - ID of the application to approve
159
+ * @param notes - Optional notes for the approval
160
+ * @returns The approved application
161
+ * @throws Error if the application is not in pending status
162
+ */
163
+ approve: async (marketId, applicationId, notes) => {
164
+ return httpClient.post(`/${marketId}/applications/${applicationId}/approve`, { notes });
165
+ },
166
+ /**
167
+ * Reject an application
168
+ * @param marketId - ID of the market
169
+ * @param applicationId - ID of the application to reject
170
+ * @param notes - Optional notes for the rejection
171
+ * @returns The rejected application
172
+ * @throws Error if the application is not in pending status
173
+ */
174
+ reject: async (marketId, applicationId, notes) => {
175
+ return httpClient.post(`/${marketId}/applications/${applicationId}/reject`, { notes });
176
+ },
177
+ };
178
+ return applications;
179
+ }
180
+
115
181
  // Path: studiojs/src/resources/markets.ts
116
182
  function create$a(httpClient) {
117
183
  let customers = {
@@ -5115,9 +5181,10 @@ function resources(httpClient) {
5115
5181
  lots: create$7(httpClient),
5116
5182
  lotitems: create$8(httpClient),
5117
5183
  webhooks: create(),
5118
- actions: create$c(),
5184
+ actions: create$d(),
5185
+ applications: create$b(httpClient),
5119
5186
  settings: create$2(httpClient),
5120
- adjustments: create$b(httpClient),
5187
+ adjustments: create$c(httpClient),
5121
5188
  productCodes: create$5(httpClient),
5122
5189
  taxRates: create$1(httpClient),
5123
5190
  customers: create$a(httpClient),