@workbenchcrm/sdk 1.1.0 → 1.2.1
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.mts +38 -39
- package/dist/index.d.ts +38 -39
- package/dist/index.js +31 -31
- package/dist/index.mjs +30 -30
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -369,11 +369,11 @@ interface ListJobsOptions extends ListOptions {
|
|
|
369
369
|
/**
|
|
370
370
|
* Service request status values
|
|
371
371
|
*/
|
|
372
|
-
type ServiceRequestStatus = 'new' | '
|
|
372
|
+
type ServiceRequestStatus = 'new' | 'in_progress' | 'assessment_complete' | 'completed' | 'cancelled';
|
|
373
373
|
/**
|
|
374
374
|
* Service request priority values
|
|
375
375
|
*/
|
|
376
|
-
type ServiceRequestPriority = 'low' | '
|
|
376
|
+
type ServiceRequestPriority = 'low' | 'medium' | 'high' | 'urgent';
|
|
377
377
|
/**
|
|
378
378
|
* Service request record
|
|
379
379
|
*/
|
|
@@ -1140,48 +1140,47 @@ declare class JobsResource {
|
|
|
1140
1140
|
}
|
|
1141
1141
|
|
|
1142
1142
|
/**
|
|
1143
|
-
*
|
|
1144
|
-
* @description Service Requests resource for the Workbench SDK
|
|
1143
|
+
* Requests resource for the Workbench SDK.
|
|
1145
1144
|
*
|
|
1146
1145
|
* Provides methods for managing service requests in Workbench CRM.
|
|
1146
|
+
*
|
|
1147
|
+
* @module resources/requests
|
|
1147
1148
|
*/
|
|
1148
1149
|
|
|
1149
1150
|
/**
|
|
1150
|
-
*
|
|
1151
|
+
* Requests resource for managing service requests.
|
|
1152
|
+
*
|
|
1153
|
+
* Service requests track customer service inquiries, including
|
|
1154
|
+
* contact information, service details, and status.
|
|
1151
1155
|
*
|
|
1152
1156
|
* @example
|
|
1153
1157
|
* ```typescript
|
|
1154
1158
|
* const workbench = new WorkbenchClient({ apiKey: 'wbk_live_xxx' });
|
|
1155
1159
|
*
|
|
1156
|
-
* // Create a
|
|
1157
|
-
* const { data: request } = await workbench.
|
|
1158
|
-
* title: '
|
|
1159
|
-
* contact_name: '
|
|
1160
|
-
* contact_email: '
|
|
1161
|
-
*
|
|
1162
|
-
* address: '123 Main St, Anytown, USA',
|
|
1163
|
-
* priority: 'high'
|
|
1160
|
+
* // Create a new request
|
|
1161
|
+
* const { data: request } = await workbench.requests.create({
|
|
1162
|
+
* title: 'AC Not Cooling',
|
|
1163
|
+
* contact_name: 'John Doe',
|
|
1164
|
+
* contact_email: 'john@example.com',
|
|
1165
|
+
* priority: 'urgent'
|
|
1164
1166
|
* });
|
|
1165
|
-
*
|
|
1166
|
-
* // Update request status
|
|
1167
|
-
* await workbench.serviceRequests.update(request.id, { status: 'scheduled' });
|
|
1168
1167
|
* ```
|
|
1169
1168
|
*/
|
|
1170
|
-
declare class
|
|
1169
|
+
declare class RequestsResource {
|
|
1171
1170
|
private readonly client;
|
|
1172
1171
|
constructor(client: WorkbenchClient);
|
|
1173
1172
|
/**
|
|
1174
|
-
* List all
|
|
1173
|
+
* List all requests
|
|
1175
1174
|
*
|
|
1176
1175
|
* Returns a paginated list of service requests for the authenticated business.
|
|
1177
1176
|
*
|
|
1178
1177
|
* @param options - List options (pagination, filtering, sorting)
|
|
1179
|
-
* @returns Paginated list of
|
|
1178
|
+
* @returns Paginated list of requests
|
|
1180
1179
|
*
|
|
1181
1180
|
* @example
|
|
1182
1181
|
* ```typescript
|
|
1183
1182
|
* // List new requests
|
|
1184
|
-
* const { data, pagination } = await workbench.
|
|
1183
|
+
* const { data, pagination } = await workbench.requests.list({
|
|
1185
1184
|
* status: 'new',
|
|
1186
1185
|
* priority: 'urgent',
|
|
1187
1186
|
* per_page: 50
|
|
@@ -1190,27 +1189,27 @@ declare class ServiceRequestsResource {
|
|
|
1190
1189
|
*/
|
|
1191
1190
|
list(options?: ListServiceRequestsOptions): Promise<ListResponse<ServiceRequest>>;
|
|
1192
1191
|
/**
|
|
1193
|
-
* Get a
|
|
1192
|
+
* Get a request by ID
|
|
1194
1193
|
*
|
|
1195
|
-
* @param id -
|
|
1196
|
-
* @returns
|
|
1194
|
+
* @param id - Request UUID
|
|
1195
|
+
* @returns Request details
|
|
1197
1196
|
*
|
|
1198
1197
|
* @example
|
|
1199
1198
|
* ```typescript
|
|
1200
|
-
* const { data: request } = await workbench.
|
|
1199
|
+
* const { data: request } = await workbench.requests.get('request-uuid');
|
|
1201
1200
|
* console.log(`Request: ${request.title} (${request.status})`);
|
|
1202
1201
|
* ```
|
|
1203
1202
|
*/
|
|
1204
1203
|
get(id: string): Promise<ApiResponse<ServiceRequest>>;
|
|
1205
1204
|
/**
|
|
1206
|
-
* Create a new
|
|
1205
|
+
* Create a new request
|
|
1207
1206
|
*
|
|
1208
|
-
* @param data -
|
|
1209
|
-
* @returns Created
|
|
1207
|
+
* @param data - Request data
|
|
1208
|
+
* @returns Created request
|
|
1210
1209
|
*
|
|
1211
1210
|
* @example
|
|
1212
1211
|
* ```typescript
|
|
1213
|
-
* const { data: request } = await workbench.
|
|
1212
|
+
* const { data: request } = await workbench.requests.create({
|
|
1214
1213
|
* title: 'AC Not Cooling',
|
|
1215
1214
|
* description: 'Air conditioner is running but not producing cold air',
|
|
1216
1215
|
* contact_name: 'John Doe',
|
|
@@ -1226,16 +1225,16 @@ declare class ServiceRequestsResource {
|
|
|
1226
1225
|
*/
|
|
1227
1226
|
create(data: CreateServiceRequestOptions): Promise<ApiResponse<ServiceRequest>>;
|
|
1228
1227
|
/**
|
|
1229
|
-
* Update a
|
|
1228
|
+
* Update a request
|
|
1230
1229
|
*
|
|
1231
|
-
* @param id -
|
|
1230
|
+
* @param id - Request UUID
|
|
1232
1231
|
* @param data - Fields to update
|
|
1233
|
-
* @returns Updated
|
|
1232
|
+
* @returns Updated request
|
|
1234
1233
|
*
|
|
1235
1234
|
* @example
|
|
1236
1235
|
* ```typescript
|
|
1237
1236
|
* // Assign to client and schedule
|
|
1238
|
-
* const { data: request } = await workbench.
|
|
1237
|
+
* const { data: request } = await workbench.requests.update('request-uuid', {
|
|
1239
1238
|
* client_id: 'client-uuid',
|
|
1240
1239
|
* status: 'scheduled',
|
|
1241
1240
|
* notes: 'Scheduled for Monday morning'
|
|
@@ -1244,15 +1243,15 @@ declare class ServiceRequestsResource {
|
|
|
1244
1243
|
*/
|
|
1245
1244
|
update(id: string, data: UpdateServiceRequestOptions): Promise<ApiResponse<ServiceRequest>>;
|
|
1246
1245
|
/**
|
|
1247
|
-
* Delete a
|
|
1246
|
+
* Delete a request
|
|
1248
1247
|
*
|
|
1249
|
-
* Permanently deletes a
|
|
1248
|
+
* Permanently deletes a request. This action cannot be undone.
|
|
1250
1249
|
*
|
|
1251
|
-
* @param id -
|
|
1250
|
+
* @param id - Request UUID
|
|
1252
1251
|
*
|
|
1253
1252
|
* @example
|
|
1254
1253
|
* ```typescript
|
|
1255
|
-
* await workbench.
|
|
1254
|
+
* await workbench.requests.delete('request-uuid');
|
|
1256
1255
|
* ```
|
|
1257
1256
|
*/
|
|
1258
1257
|
delete(id: string): Promise<void>;
|
|
@@ -1713,8 +1712,8 @@ declare class WorkbenchClient {
|
|
|
1713
1712
|
readonly quotes: QuotesResource;
|
|
1714
1713
|
/** Jobs resource */
|
|
1715
1714
|
readonly jobs: JobsResource;
|
|
1716
|
-
/**
|
|
1717
|
-
readonly
|
|
1715
|
+
/** Requests resource */
|
|
1716
|
+
readonly requests: RequestsResource;
|
|
1718
1717
|
/** Webhooks resource */
|
|
1719
1718
|
readonly webhooks: WebhooksResource;
|
|
1720
1719
|
/** Notifications resource */
|
|
@@ -1900,4 +1899,4 @@ declare function constructWebhookEvent<T = Record<string, unknown>>(payload: str
|
|
|
1900
1899
|
timestamp: string;
|
|
1901
1900
|
};
|
|
1902
1901
|
|
|
1903
|
-
export { type ApiError, type ApiResponse, type BusinessUserRole, type Client, type ClientStatus, ClientsResource, type CreateClientOptions, type CreateInvoiceOptions, type CreateJobOptions, type CreateQuoteOptions, type CreateServiceRequestOptions, type CreateWebhookOptions, type Invoice, type InvoiceItem, type InvoiceStatus, InvoicesResource, type Job, type JobPriority, type JobStatus, JobsResource, type ListClientsOptions, type ListInvoicesOptions, type ListJobsOptions, type ListOptions, type ListQuotesOptions, type ListResponse, type ListServiceRequestsOptions, type ListWebhookDeliveriesOptions, type NotificationEvent, type NotificationResult, type NotificationType, NotificationsResource, type Pagination, type Quote, type QuoteItem, type QuoteStatus, QuotesResource, type RequestOptions, type ResponseMeta, type SendCustomNotificationOptions, type SendToClientOptions, type SendToTeamOptions, type ServiceRequest, type ServiceRequestPriority, type ServiceRequestStatus,
|
|
1902
|
+
export { type ApiError, type ApiResponse, type BusinessUserRole, type Client, type ClientStatus, ClientsResource, type CreateClientOptions, type CreateInvoiceOptions, type CreateJobOptions, type CreateQuoteOptions, type CreateServiceRequestOptions, type CreateWebhookOptions, type Invoice, type InvoiceItem, type InvoiceStatus, InvoicesResource, type Job, type JobPriority, type JobStatus, JobsResource, type ListClientsOptions, type ListInvoicesOptions, type ListJobsOptions, type ListOptions, type ListQuotesOptions, type ListResponse, type ListServiceRequestsOptions, type ListWebhookDeliveriesOptions, type NotificationEvent, type NotificationResult, type NotificationType, NotificationsResource, type Pagination, type Quote, type QuoteItem, type QuoteStatus, QuotesResource, type RequestOptions, RequestsResource, type ResponseMeta, type SendCustomNotificationOptions, type SendToClientOptions, type SendToTeamOptions, type ServiceRequest, type ServiceRequestPriority, type ServiceRequestStatus, type UpdateClientOptions, type UpdateInvoiceOptions, type UpdateJobOptions, type UpdateQuoteOptions, type UpdateServiceRequestOptions, type UpdateWebhookOptions, type VerifyOptions, type Webhook, type WebhookDelivery, type WebhookEvent, type WebhookSignature, WebhookVerificationError, WebhooksResource, WorkbenchClient, type WorkbenchConfig, WorkbenchError, computeSignature, constructWebhookEvent, parseSignatureHeader, verifyWebhookSignature };
|
package/dist/index.d.ts
CHANGED
|
@@ -369,11 +369,11 @@ interface ListJobsOptions extends ListOptions {
|
|
|
369
369
|
/**
|
|
370
370
|
* Service request status values
|
|
371
371
|
*/
|
|
372
|
-
type ServiceRequestStatus = 'new' | '
|
|
372
|
+
type ServiceRequestStatus = 'new' | 'in_progress' | 'assessment_complete' | 'completed' | 'cancelled';
|
|
373
373
|
/**
|
|
374
374
|
* Service request priority values
|
|
375
375
|
*/
|
|
376
|
-
type ServiceRequestPriority = 'low' | '
|
|
376
|
+
type ServiceRequestPriority = 'low' | 'medium' | 'high' | 'urgent';
|
|
377
377
|
/**
|
|
378
378
|
* Service request record
|
|
379
379
|
*/
|
|
@@ -1140,48 +1140,47 @@ declare class JobsResource {
|
|
|
1140
1140
|
}
|
|
1141
1141
|
|
|
1142
1142
|
/**
|
|
1143
|
-
*
|
|
1144
|
-
* @description Service Requests resource for the Workbench SDK
|
|
1143
|
+
* Requests resource for the Workbench SDK.
|
|
1145
1144
|
*
|
|
1146
1145
|
* Provides methods for managing service requests in Workbench CRM.
|
|
1146
|
+
*
|
|
1147
|
+
* @module resources/requests
|
|
1147
1148
|
*/
|
|
1148
1149
|
|
|
1149
1150
|
/**
|
|
1150
|
-
*
|
|
1151
|
+
* Requests resource for managing service requests.
|
|
1152
|
+
*
|
|
1153
|
+
* Service requests track customer service inquiries, including
|
|
1154
|
+
* contact information, service details, and status.
|
|
1151
1155
|
*
|
|
1152
1156
|
* @example
|
|
1153
1157
|
* ```typescript
|
|
1154
1158
|
* const workbench = new WorkbenchClient({ apiKey: 'wbk_live_xxx' });
|
|
1155
1159
|
*
|
|
1156
|
-
* // Create a
|
|
1157
|
-
* const { data: request } = await workbench.
|
|
1158
|
-
* title: '
|
|
1159
|
-
* contact_name: '
|
|
1160
|
-
* contact_email: '
|
|
1161
|
-
*
|
|
1162
|
-
* address: '123 Main St, Anytown, USA',
|
|
1163
|
-
* priority: 'high'
|
|
1160
|
+
* // Create a new request
|
|
1161
|
+
* const { data: request } = await workbench.requests.create({
|
|
1162
|
+
* title: 'AC Not Cooling',
|
|
1163
|
+
* contact_name: 'John Doe',
|
|
1164
|
+
* contact_email: 'john@example.com',
|
|
1165
|
+
* priority: 'urgent'
|
|
1164
1166
|
* });
|
|
1165
|
-
*
|
|
1166
|
-
* // Update request status
|
|
1167
|
-
* await workbench.serviceRequests.update(request.id, { status: 'scheduled' });
|
|
1168
1167
|
* ```
|
|
1169
1168
|
*/
|
|
1170
|
-
declare class
|
|
1169
|
+
declare class RequestsResource {
|
|
1171
1170
|
private readonly client;
|
|
1172
1171
|
constructor(client: WorkbenchClient);
|
|
1173
1172
|
/**
|
|
1174
|
-
* List all
|
|
1173
|
+
* List all requests
|
|
1175
1174
|
*
|
|
1176
1175
|
* Returns a paginated list of service requests for the authenticated business.
|
|
1177
1176
|
*
|
|
1178
1177
|
* @param options - List options (pagination, filtering, sorting)
|
|
1179
|
-
* @returns Paginated list of
|
|
1178
|
+
* @returns Paginated list of requests
|
|
1180
1179
|
*
|
|
1181
1180
|
* @example
|
|
1182
1181
|
* ```typescript
|
|
1183
1182
|
* // List new requests
|
|
1184
|
-
* const { data, pagination } = await workbench.
|
|
1183
|
+
* const { data, pagination } = await workbench.requests.list({
|
|
1185
1184
|
* status: 'new',
|
|
1186
1185
|
* priority: 'urgent',
|
|
1187
1186
|
* per_page: 50
|
|
@@ -1190,27 +1189,27 @@ declare class ServiceRequestsResource {
|
|
|
1190
1189
|
*/
|
|
1191
1190
|
list(options?: ListServiceRequestsOptions): Promise<ListResponse<ServiceRequest>>;
|
|
1192
1191
|
/**
|
|
1193
|
-
* Get a
|
|
1192
|
+
* Get a request by ID
|
|
1194
1193
|
*
|
|
1195
|
-
* @param id -
|
|
1196
|
-
* @returns
|
|
1194
|
+
* @param id - Request UUID
|
|
1195
|
+
* @returns Request details
|
|
1197
1196
|
*
|
|
1198
1197
|
* @example
|
|
1199
1198
|
* ```typescript
|
|
1200
|
-
* const { data: request } = await workbench.
|
|
1199
|
+
* const { data: request } = await workbench.requests.get('request-uuid');
|
|
1201
1200
|
* console.log(`Request: ${request.title} (${request.status})`);
|
|
1202
1201
|
* ```
|
|
1203
1202
|
*/
|
|
1204
1203
|
get(id: string): Promise<ApiResponse<ServiceRequest>>;
|
|
1205
1204
|
/**
|
|
1206
|
-
* Create a new
|
|
1205
|
+
* Create a new request
|
|
1207
1206
|
*
|
|
1208
|
-
* @param data -
|
|
1209
|
-
* @returns Created
|
|
1207
|
+
* @param data - Request data
|
|
1208
|
+
* @returns Created request
|
|
1210
1209
|
*
|
|
1211
1210
|
* @example
|
|
1212
1211
|
* ```typescript
|
|
1213
|
-
* const { data: request } = await workbench.
|
|
1212
|
+
* const { data: request } = await workbench.requests.create({
|
|
1214
1213
|
* title: 'AC Not Cooling',
|
|
1215
1214
|
* description: 'Air conditioner is running but not producing cold air',
|
|
1216
1215
|
* contact_name: 'John Doe',
|
|
@@ -1226,16 +1225,16 @@ declare class ServiceRequestsResource {
|
|
|
1226
1225
|
*/
|
|
1227
1226
|
create(data: CreateServiceRequestOptions): Promise<ApiResponse<ServiceRequest>>;
|
|
1228
1227
|
/**
|
|
1229
|
-
* Update a
|
|
1228
|
+
* Update a request
|
|
1230
1229
|
*
|
|
1231
|
-
* @param id -
|
|
1230
|
+
* @param id - Request UUID
|
|
1232
1231
|
* @param data - Fields to update
|
|
1233
|
-
* @returns Updated
|
|
1232
|
+
* @returns Updated request
|
|
1234
1233
|
*
|
|
1235
1234
|
* @example
|
|
1236
1235
|
* ```typescript
|
|
1237
1236
|
* // Assign to client and schedule
|
|
1238
|
-
* const { data: request } = await workbench.
|
|
1237
|
+
* const { data: request } = await workbench.requests.update('request-uuid', {
|
|
1239
1238
|
* client_id: 'client-uuid',
|
|
1240
1239
|
* status: 'scheduled',
|
|
1241
1240
|
* notes: 'Scheduled for Monday morning'
|
|
@@ -1244,15 +1243,15 @@ declare class ServiceRequestsResource {
|
|
|
1244
1243
|
*/
|
|
1245
1244
|
update(id: string, data: UpdateServiceRequestOptions): Promise<ApiResponse<ServiceRequest>>;
|
|
1246
1245
|
/**
|
|
1247
|
-
* Delete a
|
|
1246
|
+
* Delete a request
|
|
1248
1247
|
*
|
|
1249
|
-
* Permanently deletes a
|
|
1248
|
+
* Permanently deletes a request. This action cannot be undone.
|
|
1250
1249
|
*
|
|
1251
|
-
* @param id -
|
|
1250
|
+
* @param id - Request UUID
|
|
1252
1251
|
*
|
|
1253
1252
|
* @example
|
|
1254
1253
|
* ```typescript
|
|
1255
|
-
* await workbench.
|
|
1254
|
+
* await workbench.requests.delete('request-uuid');
|
|
1256
1255
|
* ```
|
|
1257
1256
|
*/
|
|
1258
1257
|
delete(id: string): Promise<void>;
|
|
@@ -1713,8 +1712,8 @@ declare class WorkbenchClient {
|
|
|
1713
1712
|
readonly quotes: QuotesResource;
|
|
1714
1713
|
/** Jobs resource */
|
|
1715
1714
|
readonly jobs: JobsResource;
|
|
1716
|
-
/**
|
|
1717
|
-
readonly
|
|
1715
|
+
/** Requests resource */
|
|
1716
|
+
readonly requests: RequestsResource;
|
|
1718
1717
|
/** Webhooks resource */
|
|
1719
1718
|
readonly webhooks: WebhooksResource;
|
|
1720
1719
|
/** Notifications resource */
|
|
@@ -1900,4 +1899,4 @@ declare function constructWebhookEvent<T = Record<string, unknown>>(payload: str
|
|
|
1900
1899
|
timestamp: string;
|
|
1901
1900
|
};
|
|
1902
1901
|
|
|
1903
|
-
export { type ApiError, type ApiResponse, type BusinessUserRole, type Client, type ClientStatus, ClientsResource, type CreateClientOptions, type CreateInvoiceOptions, type CreateJobOptions, type CreateQuoteOptions, type CreateServiceRequestOptions, type CreateWebhookOptions, type Invoice, type InvoiceItem, type InvoiceStatus, InvoicesResource, type Job, type JobPriority, type JobStatus, JobsResource, type ListClientsOptions, type ListInvoicesOptions, type ListJobsOptions, type ListOptions, type ListQuotesOptions, type ListResponse, type ListServiceRequestsOptions, type ListWebhookDeliveriesOptions, type NotificationEvent, type NotificationResult, type NotificationType, NotificationsResource, type Pagination, type Quote, type QuoteItem, type QuoteStatus, QuotesResource, type RequestOptions, type ResponseMeta, type SendCustomNotificationOptions, type SendToClientOptions, type SendToTeamOptions, type ServiceRequest, type ServiceRequestPriority, type ServiceRequestStatus,
|
|
1902
|
+
export { type ApiError, type ApiResponse, type BusinessUserRole, type Client, type ClientStatus, ClientsResource, type CreateClientOptions, type CreateInvoiceOptions, type CreateJobOptions, type CreateQuoteOptions, type CreateServiceRequestOptions, type CreateWebhookOptions, type Invoice, type InvoiceItem, type InvoiceStatus, InvoicesResource, type Job, type JobPriority, type JobStatus, JobsResource, type ListClientsOptions, type ListInvoicesOptions, type ListJobsOptions, type ListOptions, type ListQuotesOptions, type ListResponse, type ListServiceRequestsOptions, type ListWebhookDeliveriesOptions, type NotificationEvent, type NotificationResult, type NotificationType, NotificationsResource, type Pagination, type Quote, type QuoteItem, type QuoteStatus, QuotesResource, type RequestOptions, RequestsResource, type ResponseMeta, type SendCustomNotificationOptions, type SendToClientOptions, type SendToTeamOptions, type ServiceRequest, type ServiceRequestPriority, type ServiceRequestStatus, type UpdateClientOptions, type UpdateInvoiceOptions, type UpdateJobOptions, type UpdateQuoteOptions, type UpdateServiceRequestOptions, type UpdateWebhookOptions, type VerifyOptions, type Webhook, type WebhookDelivery, type WebhookEvent, type WebhookSignature, WebhookVerificationError, WebhooksResource, WorkbenchClient, type WorkbenchConfig, WorkbenchError, computeSignature, constructWebhookEvent, parseSignatureHeader, verifyWebhookSignature };
|
package/dist/index.js
CHANGED
|
@@ -25,7 +25,7 @@ __export(index_exports, {
|
|
|
25
25
|
JobsResource: () => JobsResource,
|
|
26
26
|
NotificationsResource: () => NotificationsResource,
|
|
27
27
|
QuotesResource: () => QuotesResource,
|
|
28
|
-
|
|
28
|
+
RequestsResource: () => RequestsResource,
|
|
29
29
|
WebhookVerificationError: () => WebhookVerificationError,
|
|
30
30
|
WebhooksResource: () => WebhooksResource,
|
|
31
31
|
WorkbenchClient: () => WorkbenchClient,
|
|
@@ -522,24 +522,24 @@ var JobsResource = class {
|
|
|
522
522
|
}
|
|
523
523
|
};
|
|
524
524
|
|
|
525
|
-
// src/resources/
|
|
526
|
-
var
|
|
525
|
+
// src/resources/requests.ts
|
|
526
|
+
var RequestsResource = class {
|
|
527
527
|
client;
|
|
528
528
|
constructor(client) {
|
|
529
529
|
this.client = client;
|
|
530
530
|
}
|
|
531
531
|
/**
|
|
532
|
-
* List all
|
|
532
|
+
* List all requests
|
|
533
533
|
*
|
|
534
534
|
* Returns a paginated list of service requests for the authenticated business.
|
|
535
535
|
*
|
|
536
536
|
* @param options - List options (pagination, filtering, sorting)
|
|
537
|
-
* @returns Paginated list of
|
|
537
|
+
* @returns Paginated list of requests
|
|
538
538
|
*
|
|
539
539
|
* @example
|
|
540
540
|
* ```typescript
|
|
541
541
|
* // List new requests
|
|
542
|
-
* const { data, pagination } = await workbench.
|
|
542
|
+
* const { data, pagination } = await workbench.requests.list({
|
|
543
543
|
* status: 'new',
|
|
544
544
|
* priority: 'urgent',
|
|
545
545
|
* per_page: 50
|
|
@@ -547,7 +547,7 @@ var ServiceRequestsResource = class {
|
|
|
547
547
|
* ```
|
|
548
548
|
*/
|
|
549
549
|
async list(options = {}) {
|
|
550
|
-
return this.client.get("/v1/
|
|
550
|
+
return this.client.get("/v1/requests", {
|
|
551
551
|
page: options.page,
|
|
552
552
|
per_page: options.per_page,
|
|
553
553
|
search: options.search,
|
|
@@ -559,29 +559,29 @@ var ServiceRequestsResource = class {
|
|
|
559
559
|
});
|
|
560
560
|
}
|
|
561
561
|
/**
|
|
562
|
-
* Get a
|
|
562
|
+
* Get a request by ID
|
|
563
563
|
*
|
|
564
|
-
* @param id -
|
|
565
|
-
* @returns
|
|
564
|
+
* @param id - Request UUID
|
|
565
|
+
* @returns Request details
|
|
566
566
|
*
|
|
567
567
|
* @example
|
|
568
568
|
* ```typescript
|
|
569
|
-
* const { data: request } = await workbench.
|
|
569
|
+
* const { data: request } = await workbench.requests.get('request-uuid');
|
|
570
570
|
* console.log(`Request: ${request.title} (${request.status})`);
|
|
571
571
|
* ```
|
|
572
572
|
*/
|
|
573
573
|
async get(id) {
|
|
574
|
-
return this.client.get(`/v1/
|
|
574
|
+
return this.client.get(`/v1/requests/${id}`);
|
|
575
575
|
}
|
|
576
576
|
/**
|
|
577
|
-
* Create a new
|
|
577
|
+
* Create a new request
|
|
578
578
|
*
|
|
579
|
-
* @param data -
|
|
580
|
-
* @returns Created
|
|
579
|
+
* @param data - Request data
|
|
580
|
+
* @returns Created request
|
|
581
581
|
*
|
|
582
582
|
* @example
|
|
583
583
|
* ```typescript
|
|
584
|
-
* const { data: request } = await workbench.
|
|
584
|
+
* const { data: request } = await workbench.requests.create({
|
|
585
585
|
* title: 'AC Not Cooling',
|
|
586
586
|
* description: 'Air conditioner is running but not producing cold air',
|
|
587
587
|
* contact_name: 'John Doe',
|
|
@@ -596,19 +596,19 @@ var ServiceRequestsResource = class {
|
|
|
596
596
|
* ```
|
|
597
597
|
*/
|
|
598
598
|
async create(data) {
|
|
599
|
-
return this.client.post("/v1/
|
|
599
|
+
return this.client.post("/v1/requests", data);
|
|
600
600
|
}
|
|
601
601
|
/**
|
|
602
|
-
* Update a
|
|
602
|
+
* Update a request
|
|
603
603
|
*
|
|
604
|
-
* @param id -
|
|
604
|
+
* @param id - Request UUID
|
|
605
605
|
* @param data - Fields to update
|
|
606
|
-
* @returns Updated
|
|
606
|
+
* @returns Updated request
|
|
607
607
|
*
|
|
608
608
|
* @example
|
|
609
609
|
* ```typescript
|
|
610
610
|
* // Assign to client and schedule
|
|
611
|
-
* const { data: request } = await workbench.
|
|
611
|
+
* const { data: request } = await workbench.requests.update('request-uuid', {
|
|
612
612
|
* client_id: 'client-uuid',
|
|
613
613
|
* status: 'scheduled',
|
|
614
614
|
* notes: 'Scheduled for Monday morning'
|
|
@@ -616,22 +616,22 @@ var ServiceRequestsResource = class {
|
|
|
616
616
|
* ```
|
|
617
617
|
*/
|
|
618
618
|
async update(id, data) {
|
|
619
|
-
return this.client.put(`/v1/
|
|
619
|
+
return this.client.put(`/v1/requests/${id}`, data);
|
|
620
620
|
}
|
|
621
621
|
/**
|
|
622
|
-
* Delete a
|
|
622
|
+
* Delete a request
|
|
623
623
|
*
|
|
624
|
-
* Permanently deletes a
|
|
624
|
+
* Permanently deletes a request. This action cannot be undone.
|
|
625
625
|
*
|
|
626
|
-
* @param id -
|
|
626
|
+
* @param id - Request UUID
|
|
627
627
|
*
|
|
628
628
|
* @example
|
|
629
629
|
* ```typescript
|
|
630
|
-
* await workbench.
|
|
630
|
+
* await workbench.requests.delete('request-uuid');
|
|
631
631
|
* ```
|
|
632
632
|
*/
|
|
633
633
|
async delete(id) {
|
|
634
|
-
await this.client.delete(`/v1/
|
|
634
|
+
await this.client.delete(`/v1/requests/${id}`);
|
|
635
635
|
}
|
|
636
636
|
};
|
|
637
637
|
|
|
@@ -1048,8 +1048,8 @@ var WorkbenchClient = class {
|
|
|
1048
1048
|
quotes;
|
|
1049
1049
|
/** Jobs resource */
|
|
1050
1050
|
jobs;
|
|
1051
|
-
/**
|
|
1052
|
-
|
|
1051
|
+
/** Requests resource */
|
|
1052
|
+
requests;
|
|
1053
1053
|
/** Webhooks resource */
|
|
1054
1054
|
webhooks;
|
|
1055
1055
|
/** Notifications resource */
|
|
@@ -1073,7 +1073,7 @@ var WorkbenchClient = class {
|
|
|
1073
1073
|
this.invoices = new InvoicesResource(this);
|
|
1074
1074
|
this.quotes = new QuotesResource(this);
|
|
1075
1075
|
this.jobs = new JobsResource(this);
|
|
1076
|
-
this.
|
|
1076
|
+
this.requests = new RequestsResource(this);
|
|
1077
1077
|
this.webhooks = new WebhooksResource(this);
|
|
1078
1078
|
this.notifications = new NotificationsResource(this);
|
|
1079
1079
|
}
|
|
@@ -1292,7 +1292,7 @@ function constructWebhookEvent(payload, signature, secret, options = {}) {
|
|
|
1292
1292
|
JobsResource,
|
|
1293
1293
|
NotificationsResource,
|
|
1294
1294
|
QuotesResource,
|
|
1295
|
-
|
|
1295
|
+
RequestsResource,
|
|
1296
1296
|
WebhookVerificationError,
|
|
1297
1297
|
WebhooksResource,
|
|
1298
1298
|
WorkbenchClient,
|
package/dist/index.mjs
CHANGED
|
@@ -483,24 +483,24 @@ var JobsResource = class {
|
|
|
483
483
|
}
|
|
484
484
|
};
|
|
485
485
|
|
|
486
|
-
// src/resources/
|
|
487
|
-
var
|
|
486
|
+
// src/resources/requests.ts
|
|
487
|
+
var RequestsResource = class {
|
|
488
488
|
client;
|
|
489
489
|
constructor(client) {
|
|
490
490
|
this.client = client;
|
|
491
491
|
}
|
|
492
492
|
/**
|
|
493
|
-
* List all
|
|
493
|
+
* List all requests
|
|
494
494
|
*
|
|
495
495
|
* Returns a paginated list of service requests for the authenticated business.
|
|
496
496
|
*
|
|
497
497
|
* @param options - List options (pagination, filtering, sorting)
|
|
498
|
-
* @returns Paginated list of
|
|
498
|
+
* @returns Paginated list of requests
|
|
499
499
|
*
|
|
500
500
|
* @example
|
|
501
501
|
* ```typescript
|
|
502
502
|
* // List new requests
|
|
503
|
-
* const { data, pagination } = await workbench.
|
|
503
|
+
* const { data, pagination } = await workbench.requests.list({
|
|
504
504
|
* status: 'new',
|
|
505
505
|
* priority: 'urgent',
|
|
506
506
|
* per_page: 50
|
|
@@ -508,7 +508,7 @@ var ServiceRequestsResource = class {
|
|
|
508
508
|
* ```
|
|
509
509
|
*/
|
|
510
510
|
async list(options = {}) {
|
|
511
|
-
return this.client.get("/v1/
|
|
511
|
+
return this.client.get("/v1/requests", {
|
|
512
512
|
page: options.page,
|
|
513
513
|
per_page: options.per_page,
|
|
514
514
|
search: options.search,
|
|
@@ -520,29 +520,29 @@ var ServiceRequestsResource = class {
|
|
|
520
520
|
});
|
|
521
521
|
}
|
|
522
522
|
/**
|
|
523
|
-
* Get a
|
|
523
|
+
* Get a request by ID
|
|
524
524
|
*
|
|
525
|
-
* @param id -
|
|
526
|
-
* @returns
|
|
525
|
+
* @param id - Request UUID
|
|
526
|
+
* @returns Request details
|
|
527
527
|
*
|
|
528
528
|
* @example
|
|
529
529
|
* ```typescript
|
|
530
|
-
* const { data: request } = await workbench.
|
|
530
|
+
* const { data: request } = await workbench.requests.get('request-uuid');
|
|
531
531
|
* console.log(`Request: ${request.title} (${request.status})`);
|
|
532
532
|
* ```
|
|
533
533
|
*/
|
|
534
534
|
async get(id) {
|
|
535
|
-
return this.client.get(`/v1/
|
|
535
|
+
return this.client.get(`/v1/requests/${id}`);
|
|
536
536
|
}
|
|
537
537
|
/**
|
|
538
|
-
* Create a new
|
|
538
|
+
* Create a new request
|
|
539
539
|
*
|
|
540
|
-
* @param data -
|
|
541
|
-
* @returns Created
|
|
540
|
+
* @param data - Request data
|
|
541
|
+
* @returns Created request
|
|
542
542
|
*
|
|
543
543
|
* @example
|
|
544
544
|
* ```typescript
|
|
545
|
-
* const { data: request } = await workbench.
|
|
545
|
+
* const { data: request } = await workbench.requests.create({
|
|
546
546
|
* title: 'AC Not Cooling',
|
|
547
547
|
* description: 'Air conditioner is running but not producing cold air',
|
|
548
548
|
* contact_name: 'John Doe',
|
|
@@ -557,19 +557,19 @@ var ServiceRequestsResource = class {
|
|
|
557
557
|
* ```
|
|
558
558
|
*/
|
|
559
559
|
async create(data) {
|
|
560
|
-
return this.client.post("/v1/
|
|
560
|
+
return this.client.post("/v1/requests", data);
|
|
561
561
|
}
|
|
562
562
|
/**
|
|
563
|
-
* Update a
|
|
563
|
+
* Update a request
|
|
564
564
|
*
|
|
565
|
-
* @param id -
|
|
565
|
+
* @param id - Request UUID
|
|
566
566
|
* @param data - Fields to update
|
|
567
|
-
* @returns Updated
|
|
567
|
+
* @returns Updated request
|
|
568
568
|
*
|
|
569
569
|
* @example
|
|
570
570
|
* ```typescript
|
|
571
571
|
* // Assign to client and schedule
|
|
572
|
-
* const { data: request } = await workbench.
|
|
572
|
+
* const { data: request } = await workbench.requests.update('request-uuid', {
|
|
573
573
|
* client_id: 'client-uuid',
|
|
574
574
|
* status: 'scheduled',
|
|
575
575
|
* notes: 'Scheduled for Monday morning'
|
|
@@ -577,22 +577,22 @@ var ServiceRequestsResource = class {
|
|
|
577
577
|
* ```
|
|
578
578
|
*/
|
|
579
579
|
async update(id, data) {
|
|
580
|
-
return this.client.put(`/v1/
|
|
580
|
+
return this.client.put(`/v1/requests/${id}`, data);
|
|
581
581
|
}
|
|
582
582
|
/**
|
|
583
|
-
* Delete a
|
|
583
|
+
* Delete a request
|
|
584
584
|
*
|
|
585
|
-
* Permanently deletes a
|
|
585
|
+
* Permanently deletes a request. This action cannot be undone.
|
|
586
586
|
*
|
|
587
|
-
* @param id -
|
|
587
|
+
* @param id - Request UUID
|
|
588
588
|
*
|
|
589
589
|
* @example
|
|
590
590
|
* ```typescript
|
|
591
|
-
* await workbench.
|
|
591
|
+
* await workbench.requests.delete('request-uuid');
|
|
592
592
|
* ```
|
|
593
593
|
*/
|
|
594
594
|
async delete(id) {
|
|
595
|
-
await this.client.delete(`/v1/
|
|
595
|
+
await this.client.delete(`/v1/requests/${id}`);
|
|
596
596
|
}
|
|
597
597
|
};
|
|
598
598
|
|
|
@@ -1009,8 +1009,8 @@ var WorkbenchClient = class {
|
|
|
1009
1009
|
quotes;
|
|
1010
1010
|
/** Jobs resource */
|
|
1011
1011
|
jobs;
|
|
1012
|
-
/**
|
|
1013
|
-
|
|
1012
|
+
/** Requests resource */
|
|
1013
|
+
requests;
|
|
1014
1014
|
/** Webhooks resource */
|
|
1015
1015
|
webhooks;
|
|
1016
1016
|
/** Notifications resource */
|
|
@@ -1034,7 +1034,7 @@ var WorkbenchClient = class {
|
|
|
1034
1034
|
this.invoices = new InvoicesResource(this);
|
|
1035
1035
|
this.quotes = new QuotesResource(this);
|
|
1036
1036
|
this.jobs = new JobsResource(this);
|
|
1037
|
-
this.
|
|
1037
|
+
this.requests = new RequestsResource(this);
|
|
1038
1038
|
this.webhooks = new WebhooksResource(this);
|
|
1039
1039
|
this.notifications = new NotificationsResource(this);
|
|
1040
1040
|
}
|
|
@@ -1252,7 +1252,7 @@ export {
|
|
|
1252
1252
|
JobsResource,
|
|
1253
1253
|
NotificationsResource,
|
|
1254
1254
|
QuotesResource,
|
|
1255
|
-
|
|
1255
|
+
RequestsResource,
|
|
1256
1256
|
WebhookVerificationError,
|
|
1257
1257
|
WebhooksResource,
|
|
1258
1258
|
WorkbenchClient,
|