@smartbills/sdk 1.0.1-alpha.5 → 1.1.0-alpha.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/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/index.d.ts +120 -2
- package/package.json +3 -3
package/dist/types/index.d.ts
CHANGED
|
@@ -794,6 +794,7 @@ declare abstract class BaseService {
|
|
|
794
794
|
};
|
|
795
795
|
protected _list<T>(url: string, params?: Record<string, unknown>, options?: RequestOptions): Promise<SBListResponse<T>>;
|
|
796
796
|
protected _get<T>(url: string, options?: RequestOptions): Promise<T>;
|
|
797
|
+
protected _getWithParams<T>(url: string, params?: Record<string, unknown>, options?: RequestOptions): Promise<T>;
|
|
797
798
|
protected _create<T>(url: string, data: unknown, options?: RequestOptions): Promise<T>;
|
|
798
799
|
protected _update<T>(url: string, data: unknown, options?: RequestOptions): Promise<T>;
|
|
799
800
|
protected _patch<T>(url: string, data: unknown, options?: RequestOptions): Promise<T>;
|
|
@@ -1312,6 +1313,120 @@ declare class ApprobationService extends BaseService {
|
|
|
1312
1313
|
downloadAttachmentsZip(reportId: number, options?: RequestOptions): Promise<Blob>;
|
|
1313
1314
|
}
|
|
1314
1315
|
|
|
1316
|
+
interface SBSubscription {
|
|
1317
|
+
id: string;
|
|
1318
|
+
planName?: string;
|
|
1319
|
+
planId?: string;
|
|
1320
|
+
status: string;
|
|
1321
|
+
trialEnd?: string;
|
|
1322
|
+
billingCycleAnchor?: string;
|
|
1323
|
+
currentPeriodStart?: string;
|
|
1324
|
+
currentPeriodEnd?: string;
|
|
1325
|
+
cancelAtPeriodEnd?: boolean;
|
|
1326
|
+
canceledAt?: string;
|
|
1327
|
+
}
|
|
1328
|
+
interface SBInvoice {
|
|
1329
|
+
id: string;
|
|
1330
|
+
number?: string;
|
|
1331
|
+
status: string;
|
|
1332
|
+
total: number;
|
|
1333
|
+
subtotal: number;
|
|
1334
|
+
tax?: number;
|
|
1335
|
+
currency: string;
|
|
1336
|
+
periodStart?: string;
|
|
1337
|
+
periodEnd?: string;
|
|
1338
|
+
paidAt?: string;
|
|
1339
|
+
createdAt: string;
|
|
1340
|
+
hostedInvoiceUrl?: string;
|
|
1341
|
+
invoicePdfUrl?: string;
|
|
1342
|
+
}
|
|
1343
|
+
interface SBUpcomingInvoice {
|
|
1344
|
+
total: number;
|
|
1345
|
+
subtotal: number;
|
|
1346
|
+
tax?: number;
|
|
1347
|
+
currency: string;
|
|
1348
|
+
periodStart?: string;
|
|
1349
|
+
periodEnd?: string;
|
|
1350
|
+
lines?: SBInvoiceLine[];
|
|
1351
|
+
}
|
|
1352
|
+
interface SBInvoiceLine {
|
|
1353
|
+
description?: string;
|
|
1354
|
+
amount: number;
|
|
1355
|
+
currency: string;
|
|
1356
|
+
quantity?: number;
|
|
1357
|
+
}
|
|
1358
|
+
interface SBBillingUsage {
|
|
1359
|
+
quotaKey: string;
|
|
1360
|
+
used: number;
|
|
1361
|
+
limit: number;
|
|
1362
|
+
percentage: number;
|
|
1363
|
+
}
|
|
1364
|
+
interface SBBillingPlan {
|
|
1365
|
+
id: string;
|
|
1366
|
+
name: string;
|
|
1367
|
+
description?: string;
|
|
1368
|
+
price: number;
|
|
1369
|
+
currency: string;
|
|
1370
|
+
interval: string;
|
|
1371
|
+
features?: string[];
|
|
1372
|
+
}
|
|
1373
|
+
interface UpgradeSubscriptionRequest {
|
|
1374
|
+
planId: string;
|
|
1375
|
+
}
|
|
1376
|
+
interface CreatePortalSessionRequest {
|
|
1377
|
+
returnUrl?: string;
|
|
1378
|
+
}
|
|
1379
|
+
interface SBPortalSession {
|
|
1380
|
+
url: string;
|
|
1381
|
+
}
|
|
1382
|
+
interface InvoiceListRequest {
|
|
1383
|
+
page?: number;
|
|
1384
|
+
pageSize?: number;
|
|
1385
|
+
}
|
|
1386
|
+
interface UsageHistoryRequest {
|
|
1387
|
+
page?: number;
|
|
1388
|
+
pageSize?: number;
|
|
1389
|
+
}
|
|
1390
|
+
interface SBBillingPaymentMethod {
|
|
1391
|
+
id: string;
|
|
1392
|
+
type: string;
|
|
1393
|
+
isDefault: boolean;
|
|
1394
|
+
card?: {
|
|
1395
|
+
brand: string;
|
|
1396
|
+
last4: string;
|
|
1397
|
+
expMonth: number;
|
|
1398
|
+
expYear: number;
|
|
1399
|
+
};
|
|
1400
|
+
}
|
|
1401
|
+
interface SBSetupIntent {
|
|
1402
|
+
clientSecret: string;
|
|
1403
|
+
}
|
|
1404
|
+
interface SBDowngradeValidation {
|
|
1405
|
+
canDowngrade: boolean;
|
|
1406
|
+
blockers?: string[];
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
declare class BillingService extends BaseService {
|
|
1410
|
+
getSubscription(options?: RequestOptions): Promise<SBSubscription>;
|
|
1411
|
+
upgradeSubscription(data: UpgradeSubscriptionRequest, options?: RequestOptions): Promise<SBSubscription>;
|
|
1412
|
+
cancelSubscription(options?: RequestOptions): Promise<SBSubscription>;
|
|
1413
|
+
getPlans(options?: RequestOptions): Promise<SBBillingPlan[]>;
|
|
1414
|
+
startTrial(data: UpgradeSubscriptionRequest, options?: RequestOptions): Promise<SBSubscription>;
|
|
1415
|
+
activateFreeTier(options?: RequestOptions): Promise<SBSubscription>;
|
|
1416
|
+
validateDowngrade(data: UpgradeSubscriptionRequest, options?: RequestOptions): Promise<SBDowngradeValidation>;
|
|
1417
|
+
listInvoices(params?: InvoiceListRequest, options?: RequestOptions): Promise<SBListResponse<SBInvoice>>;
|
|
1418
|
+
getInvoice(invoiceId: string, options?: RequestOptions): Promise<SBInvoice>;
|
|
1419
|
+
getUpcomingInvoice(options?: RequestOptions): Promise<SBUpcomingInvoice>;
|
|
1420
|
+
getUsage(options?: RequestOptions): Promise<SBBillingUsage[]>;
|
|
1421
|
+
getUsageHistory(params?: UsageHistoryRequest, options?: RequestOptions): Promise<SBListResponse<SBBillingUsage>>;
|
|
1422
|
+
getUsageByKey(quotaKey: string, options?: RequestOptions): Promise<SBBillingUsage>;
|
|
1423
|
+
createPortalSession(data?: CreatePortalSessionRequest, options?: RequestOptions): Promise<SBPortalSession>;
|
|
1424
|
+
getPaymentMethods(options?: RequestOptions): Promise<SBBillingPaymentMethod[]>;
|
|
1425
|
+
createSetupIntent(options?: RequestOptions): Promise<SBSetupIntent>;
|
|
1426
|
+
detachPaymentMethod(paymentMethodId: string, options?: RequestOptions): Promise<void>;
|
|
1427
|
+
setDefaultPaymentMethod(paymentMethodId: string, options?: RequestOptions): Promise<void>;
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1315
1430
|
/**
|
|
1316
1431
|
* A bill (accounts payable) in the Smartbills system.
|
|
1317
1432
|
*
|
|
@@ -3458,6 +3573,7 @@ interface ExpenseListRequest extends PaginationRequest {
|
|
|
3458
3573
|
maxAmount?: number;
|
|
3459
3574
|
hasAttachment?: boolean;
|
|
3460
3575
|
status?: string;
|
|
3576
|
+
expenseReportStatus?: string[];
|
|
3461
3577
|
}
|
|
3462
3578
|
/**
|
|
3463
3579
|
* Request payload for splitting an expense into multiple line items.
|
|
@@ -5617,7 +5733,7 @@ interface SmartbillsClientOptions {
|
|
|
5617
5733
|
declare const DEFAULT_BASE_URL = "https://api.smartbills.io";
|
|
5618
5734
|
|
|
5619
5735
|
declare class SmartbillsClient {
|
|
5620
|
-
|
|
5736
|
+
protected readonly http: HttpClient;
|
|
5621
5737
|
readonly users: UserService;
|
|
5622
5738
|
readonly businesses: BusinessService;
|
|
5623
5739
|
readonly businessUsers: BusinessUserService;
|
|
@@ -5644,6 +5760,7 @@ declare class SmartbillsClient {
|
|
|
5644
5760
|
readonly connect: ConnectService;
|
|
5645
5761
|
readonly locations: LocationService;
|
|
5646
5762
|
readonly tables: TableService;
|
|
5763
|
+
readonly billing: BillingService;
|
|
5647
5764
|
readonly workflows: WorkflowService;
|
|
5648
5765
|
constructor(options?: SmartbillsClientOptions);
|
|
5649
5766
|
setAccessToken(token: string | undefined): void;
|
|
@@ -5805,4 +5922,5 @@ declare function isConflictError(error: unknown): error is SmartbillsConflictErr
|
|
|
5805
5922
|
declare function isQuotaError(error: unknown): error is SmartbillsQuotaError;
|
|
5806
5923
|
declare function isRetryableError(error: unknown): boolean;
|
|
5807
5924
|
|
|
5808
|
-
export { AccessToken,
|
|
5925
|
+
export { AccessToken, AppInstallationService, AppInstallationStatus, ApprobationService, BaseService, BillApprovalStatus, BillApprovalType, BillService, BillStatus, BillingService, BusinessService, BusinessUserService, CheckoutDocumentType, CheckoutPaymentStatus, CheckoutService, CheckoutStatus, ConnectAccountStatus, ConnectService, DEFAULT_BASE_URL, EmailAccountService, EmailAccountStatus, EmailAccountSyncStatus, EmailAccountType, ErrorCode, ExpenseItemStatus, ExpenseJobService, ExpenseReportAuditLogAction, ExpenseReportExpenseService, ExpenseReportPaymentService, ExpenseReportService, ExpenseReportStatus, ExpenseService, HttpClient, IntegrationService, IntegrationStatus, InvitationService, InvitationStatus, LocationService, MailboxType, MembershipRole, MembershipService, NotificationService, NotificationType, PayerType, PaymentMethodService, ReceiptPaymentStatus, ReceiptPaymentType, ReceiptService, ReceiptSource, ReceiptType, ReportingService, SmartbillsApiError, SmartbillsAuthenticationError, SmartbillsClient, SmartbillsConflictError, SmartbillsError, SmartbillsNetworkError, SmartbillsNotFoundError, SmartbillsPermissionError, SmartbillsQuotaError, SmartbillsRateLimitError, SmartbillsValidationError, SyncTriggerType, TableService, TransactionService, TransactionType, UserService, VendorConnectionService, VendorConnectionStatus, VendorService, WorkflowService, WorkflowTriggerType, isApiError, isAuthenticationError, isConflictError, isNetworkError, isNotFoundError, isPermissionError, isQuotaError, isRateLimitError, isRetryableError, isSmartbillsError, isValidationError };
|
|
5926
|
+
export type { AddExpenseToReportRequest, AddExpensesToReportBatchRequest, ApprobationListRequest, AssociateExpenseReportUpdateRequest, BillApprovalRequest, BillBatchUpdateRequest, BillCancelRequest, BillCreateRequest, BillListRequest, BillMarkPaidRequest, BillReschedulePaymentRequest, BillRetryPaymentRequest, BillSchedulePaymentRequest, BillSubmitForApprovalRequest, BillTransitionRequest, BillUpdateRequest, BulkAssignCategoryRequest, BulkAssignExpenseReportRequest, BulkAssignReportCategoryRequest, BulkAssignVendorRequest, BulkBillApproveRequest, BulkBillCancelPaymentRequest, BulkBillDeleteRequest, BulkBillMarkPaidRequest, BulkBillRemindRequest, BulkBillRetryPaymentRequest, BulkBillSchedulePaymentRequest, BulkBillUnscheduleRequest, BulkBillUpdateRequest, BulkDeleteExpenseReportsRequest, BulkDeleteExpensesRequest, BulkDeleteVendorsRequest, BulkRemoveReportExpensesRequest, BusinessBatchUpdateRequest, BusinessBrandCreateRequest, BusinessCreateRequest, BusinessUpdateRequest, ConnectOnboardingRequest, CreateCheckoutPaymentIntentRequest, CreatePaymentMethodRequest, CreatePortalSessionRequest, CredentialProvider, EditExpenseInReportRequest, EmailAccountImapCreateRequest, EmailAccountListRequest, EmailAccountOAuth2CreateRequest, EmailAccountUpdateRequest, ErrorCodeType, ExpenseAttachmentDownloadRequest, ExpenseCategoryUpdateRequest, ExpenseExportRequest, ExpenseJobListRequest, ExpenseListRequest, ExpenseNoteUpdateRequest, ExpenseOverTimeRequest, ExpenseReportApproveRequest, ExpenseReportAssignLedgerAccountRequest, ExpenseReportCommentCreateRequest, ExpenseReportCreateRequest, ExpenseReportExportRequest, ExpenseReportListRequest, ExpenseReportPartialReimburseRequest, ExpenseReportPlanReimbursementRequest, ExpenseReportRecallRequest, ExpenseReportReimburseRequest, ExpenseReportRejectRequest, ExpenseReportRequestChangesRequest, ExpenseReportUpdateRequest, ExpenseSplitItem, ExpenseSplitRequest, HistoricalSyncRequest, HttpClientConfig, IntegrationCallbackRequest, IntegrationListRequest, InvitationCreateRequest, InvitationListRequest, InvoiceListRequest, LocationBatchCreateRequest, LocationBatchUpdateRequest, LocationCreateRequest, LocationImageUrlRequest, LocationListRequest, LocationUpdateRequest, MailboxUpdateRequest, MembershipCreateRequest, MembershipEmailInviteRequest, MembershipListRequest, MembershipRoleUpdateRequest, NotificationListRequest, PaginateBusinessRequest, PaginateTransactionRequest, PaginationRequest, PaymentMethodListRequest, ReceiptCreateRequest, ReceiptListRequest, ReceiptOCRCreateRequest, ReceiptUpdateRequest, RefundCheckoutPaymentRequest, ReportDateRange, ReportingRequest, RequestOptions, SBAddress, SBAppInstallation, SBApprobationSummary, SBBatchResponse, SBBill, SBBillApproval, SBBillApprovalHistoryItem, SBBillAttachment, SBBillBulkActionResponse, SBBillLineItem, SBBillStatusSummary, SBBillTax, SBBillTransitionResponse, SBBillingAddress, SBBillingPaymentMethod, SBBillingPlan, SBBillingUsage, SBBulkActionResponse, SBBulkActionResult, SBBusiness, SBBusinessBrand, SBBusinessPlan, SBCheckoutLineItem, SBCheckoutPayment, SBCheckoutPaymentDispute, SBCheckoutPaymentRefund, SBCheckoutTax, SBCheckoutTransactionResponse, SBConnectAccount, SBConnectAccountRequirements, SBConnectDashboardResponse, SBConnectOnboardingResponse, SBCoordinate, SBCreateCheckoutPaymentIntentResponse, SBDowngradeValidation, SBEmailAccount, SBEmailAccountAuthorizeResponse, SBEmployeeCategoryBreakdownReport, SBEntity, SBExpenseBulkActionResponse, SBExpenseByCategoryReport, SBExpenseByDayReport, SBExpenseByEmployeeReport, SBExpenseByVendorReport, SBExpenseJob, SBExpenseMonthlySummary, SBExpenseOverTimeDataPoint, SBExpenseOverTimeReport, SBExpenseReport, SBExpenseReportAuditLogEntry, SBExpenseReportBulkActionResponse, SBExpenseReportComment, SBExpenseReportItem, SBExpenseReportSummary, SBExpenseReportTimelineEntry, SBExpenseValidateResponse, SBFileDownloadResponse, SBIntegration, SBIntegrationAuthorizeResponse, SBInvitation, SBInvoice, SBInvoiceLine, SBListResponse, SBLocation, SBLocationImage, SBMailbox, SBMarketplaceApp, SBMembership, SBMerchantLedger, SBMoney, SBNotification, SBPagination, SBPaymentMethod, SBPaymentMethodBillingDetails, SBPaymentMethodSetupIntentResponse, SBPortalSession, SBReceipt, SBReceiptBarcode, SBReceiptBusiness, SBReceiptCustomer, SBReceiptDiscount, SBReceiptDocument, SBReceiptFee, SBReceiptLineItem, SBReceiptPayment, SBReceiptPaymentCard, SBReceiptRefund, SBReceiptTax, SBReceiptTransaction, SBReceiptVendor, SBSessionTokenResponse, SBSetupIntent, SBSubscription, SBSyncSession, SBTable, SBTableColumn, SBTableRow, SBTaxByCategoryReport, SBTaxByTypeReport, SBTaxByVendorReport, SBTaxSummaryReport, SBTimestamps, SBTransaction, SBTransactionAttachment, SBTransactionMerchant, SBTransactionTax, SBTransactionUploadResponse, SBTransactionVendor, SBUpcomingInvoice, SBUserAccount, SBValidateEmailResponse, SBVendor, SBVendorBulkActionResponse, SBVendorConnectResponse, SBVendorConnection, SBVendorImportResult, SBWorkflow, SBWorkflowCondition, SBWorkflowStep, SBWorkflowTestResponse, SmartbillsClientOptions, SmartbillsFieldError, SubmitDisputeEvidenceRequest, SyncSessionListRequest, TableCreateRequest, TableListRequest, TableUpdateRequest, TransactionBatchUpdateRequest, TransactionUpdateRequest, UpdateInstallationStatusRequest, UpgradeSubscriptionRequest, UsageHistoryRequest, UserUpdateRequest, VendorBatchUpdateRequest, VendorConnectRequest, VendorCreateRequest, VendorListRequest, VendorMergeRequest, VendorUpdateRequest, WorkflowCreateRequest, WorkflowListRequest, WorkflowTestRequest, WorkflowUpdateRequest };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smartbills/sdk",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0-alpha.1",
|
|
4
4
|
"description": "Smartbills SDK for JavaScript/TypeScript",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/cjs/index.cjs",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@rollup/plugin-typescript": "^12.1.2",
|
|
40
40
|
"@types/node": "^22.12.0",
|
|
41
41
|
"rollup": "^4.30.1",
|
|
42
|
-
"rollup-plugin-dts": "^6.
|
|
42
|
+
"rollup-plugin-dts": "^6.3.0",
|
|
43
43
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
44
44
|
"tslib": "^2.8.1",
|
|
45
45
|
"typescript": "^5.7.3"
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"registry": "https://registry.npmjs.org/"
|
|
50
50
|
},
|
|
51
51
|
"packageManager": "yarn@4.7.0",
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "53156d799ff9eabfee3b341997f79ec2dc19a52e"
|
|
53
53
|
}
|