@apideck/unify 0.23.0 → 0.23.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.
Files changed (93) hide show
  1. package/jsr.json +1 -1
  2. package/lib/config.d.ts +3 -3
  3. package/lib/config.js +3 -3
  4. package/models/components/note.d.ts +5 -0
  5. package/models/components/note.d.ts.map +1 -1
  6. package/models/components/note.js +4 -0
  7. package/models/components/note.js.map +1 -1
  8. package/models/components/noteinput.d.ts +5 -0
  9. package/models/components/noteinput.d.ts.map +1 -1
  10. package/models/components/noteinput.js +4 -0
  11. package/models/components/noteinput.js.map +1 -1
  12. package/package.json +5 -1
  13. package/src/__tests__/activities.test.ts +783 -0
  14. package/src/__tests__/agedcreditors.test.ts +279 -0
  15. package/src/__tests__/ageddebtors.test.ts +279 -0
  16. package/src/__tests__/apideckcompanies.test.ts +712 -0
  17. package/src/__tests__/apideckcustomers.test.ts +360 -0
  18. package/src/__tests__/apideckdepartments.test.ts +319 -0
  19. package/src/__tests__/apiresources.test.ts +61 -0
  20. package/src/__tests__/apis.test.ts +214 -0
  21. package/src/__tests__/applicants.test.ts +976 -0
  22. package/src/__tests__/applications.test.ts +329 -0
  23. package/src/__tests__/assertions.ts +13 -0
  24. package/src/__tests__/attachments.test.ts +363 -0
  25. package/src/__tests__/balancesheet.test.ts +451 -0
  26. package/src/__tests__/billpayments.test.ts +666 -0
  27. package/src/__tests__/bills.test.ts +1133 -0
  28. package/src/__tests__/collections.test.ts +115 -0
  29. package/src/__tests__/collectiontags.test.ts +66 -0
  30. package/src/__tests__/collectionticketcomments.test.ts +318 -0
  31. package/src/__tests__/collectiontickets.test.ts +436 -0
  32. package/src/__tests__/collectionusers.test.ts +122 -0
  33. package/src/__tests__/companies.test.ts +1059 -0
  34. package/src/__tests__/companyinfo.test.ts +218 -0
  35. package/src/__tests__/connectioncustommappings.test.ts +67 -0
  36. package/src/__tests__/connections.test.ts +1713 -0
  37. package/src/__tests__/connectionsettings.test.ts +280 -0
  38. package/src/__tests__/connectordocs.test.ts +28 -0
  39. package/src/__tests__/connectors.test.ts +751 -0
  40. package/src/__tests__/consumerrequestcounts.test.ts +41 -0
  41. package/src/__tests__/consumers.test.ts +517 -0
  42. package/src/__tests__/contacts.test.ts +957 -0
  43. package/src/__tests__/createcallback.test.ts +34 -0
  44. package/src/__tests__/creditnotes.test.ts +1362 -0
  45. package/src/__tests__/customers.test.ts +1089 -0
  46. package/src/__tests__/customfields.test.ts +50 -0
  47. package/src/__tests__/custommappings.test.ts +63 -0
  48. package/src/__tests__/departments.test.ts +359 -0
  49. package/src/__tests__/drivegroups.test.ts +318 -0
  50. package/src/__tests__/drives.test.ts +311 -0
  51. package/src/__tests__/employeepayrolls.test.ts +487 -0
  52. package/src/__tests__/employees.test.ts +1682 -0
  53. package/src/__tests__/employeeschedules.test.ts +456 -0
  54. package/src/__tests__/eventlogs.test.ts +157 -0
  55. package/src/__tests__/expenses.test.ts +566 -0
  56. package/src/__tests__/files.test.ts +392 -0
  57. package/src/__tests__/files.ts +56 -0
  58. package/src/__tests__/folders.test.ts +103 -0
  59. package/src/__tests__/invoiceitems.test.ts +586 -0
  60. package/src/__tests__/invoices.test.ts +1561 -0
  61. package/src/__tests__/jobs.test.ts +837 -0
  62. package/src/__tests__/journalentries.test.ts +1053 -0
  63. package/src/__tests__/leads.test.ts +897 -0
  64. package/src/__tests__/ledgeraccounts.test.ts +594 -0
  65. package/src/__tests__/locations.test.ts +561 -0
  66. package/src/__tests__/logs.test.ts +135 -0
  67. package/src/__tests__/messages.test.ts +396 -0
  68. package/src/__tests__/mockserver/README.md +52 -0
  69. package/src/__tests__/notes.test.ts +335 -0
  70. package/src/__tests__/opportunities.test.ts +503 -0
  71. package/src/__tests__/orders.test.ts +849 -0
  72. package/src/__tests__/payments.test.ts +557 -0
  73. package/src/__tests__/payrolls.test.ts +481 -0
  74. package/src/__tests__/pipelines.test.ts +383 -0
  75. package/src/__tests__/products.test.ts +505 -0
  76. package/src/__tests__/profitandloss.test.ts +221 -0
  77. package/src/__tests__/purchaseorders.test.ts +1464 -0
  78. package/src/__tests__/sessions.test.ts +70 -0
  79. package/src/__tests__/sharedlinks.test.ts +331 -0
  80. package/src/__tests__/stores.test.ts +39 -0
  81. package/src/__tests__/subsidiaries.test.ts +316 -0
  82. package/src/__tests__/suppliers.test.ts +1071 -0
  83. package/src/__tests__/taxrates.test.ts +472 -0
  84. package/src/__tests__/testclient.ts +48 -0
  85. package/src/__tests__/timeoffrequests.test.ts +381 -0
  86. package/src/__tests__/trackingcategories.test.ts +329 -0
  87. package/src/__tests__/uploadsessions.test.ts +142 -0
  88. package/src/__tests__/users.test.ts +667 -0
  89. package/src/__tests__/validateconnection.test.ts +32 -0
  90. package/src/__tests__/webhooks.test.ts +248 -0
  91. package/src/lib/config.ts +3 -3
  92. package/src/models/components/note.ts +9 -0
  93. package/src/models/components/noteinput.ts +9 -0
@@ -0,0 +1,221 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { expect, test } from "vitest";
6
+ import { Apideck } from "../index.js";
7
+ import { createTestHTTPClient } from "./testclient.js";
8
+
9
+ test("Profitandloss Accounting Profit And Loss One", async () => {
10
+ const testHttpClient = createTestHTTPClient("accounting.profitAndLossOne");
11
+
12
+ const apideck = new Apideck({
13
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
14
+ httpClient: testHttpClient,
15
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
16
+ });
17
+
18
+ const result = await apideck.accounting.profitAndLoss.get({
19
+ serviceId: "salesforce",
20
+ filter: {
21
+ customerId: "123abc",
22
+ startDate: "2021-01-01",
23
+ endDate: "2021-12-31",
24
+ },
25
+ passThrough: {
26
+ "search": "San Francisco",
27
+ },
28
+ fields: "id,updated_at",
29
+ });
30
+ expect(result.httpMeta.response.status).toBe(200);
31
+ expect(result.getProfitAndLossResponse).toBeDefined();
32
+ expect(result.getProfitAndLossResponse).toEqual({
33
+ statusCode: 200,
34
+ status: "OK",
35
+ service: "quickbooks",
36
+ resource: "ProfitAndLosses",
37
+ operation: "one",
38
+ data: {
39
+ id: "12345",
40
+ reportName: "ProfitAndLoss",
41
+ startDate: "2017-01-01",
42
+ endDate: "2017-01-31",
43
+ currency: "USD",
44
+ income: {
45
+ id: "123",
46
+ code: "123",
47
+ title: "Operating Income",
48
+ type: "Section",
49
+ total: 60000,
50
+ records: [
51
+ {
52
+ "id": "137",
53
+ "title": "Sales of products",
54
+ "code": "137",
55
+ "type": "Section",
56
+ "total": 20000,
57
+ "records": [
58
+ {
59
+ "id": "13701",
60
+ "title": "Sales of products",
61
+ "code": "13701",
62
+ "type": "Record",
63
+ "total": 20000,
64
+ },
65
+ ],
66
+ },
67
+ {
68
+ "id": "138",
69
+ "title": "Sales of services",
70
+ "code": "138",
71
+ "type": "Section",
72
+ "total": 40000,
73
+ "records": [
74
+ {
75
+ "id": "789",
76
+ "code": "789",
77
+ "title": "Sales of External Services",
78
+ "type": "Record",
79
+ "total": 10000,
80
+ },
81
+ {
82
+ "id": "101",
83
+ "code": "101",
84
+ "title": "Sales of Internal Services",
85
+ "type": "Record",
86
+ "total": 30000,
87
+ },
88
+ ],
89
+ },
90
+ ],
91
+ },
92
+ costOfGoodsSold: {
93
+ id: "123",
94
+ code: "123",
95
+ title: "Cost of Goods Sold",
96
+ type: "Section",
97
+ total: 12000,
98
+ records: [
99
+ {
100
+ "id": "123",
101
+ "code": "123",
102
+ "title": "COGS Sales",
103
+ "type": "Record",
104
+ "total": 12000,
105
+ },
106
+ ],
107
+ },
108
+ expenses: {
109
+ id: "123",
110
+ code: "123",
111
+ title: "Operating Expenses",
112
+ type: "Section",
113
+ total: 14000,
114
+ records: [
115
+ {
116
+ "id": "137",
117
+ "title": "Maintenance",
118
+ "code": "137",
119
+ "type": "Record",
120
+ "total": 1000,
121
+ },
122
+ {
123
+ "id": "138",
124
+ "title": "Rent",
125
+ "code": "138",
126
+ "type": "Record",
127
+ "total": 10000,
128
+ },
129
+ {
130
+ "id": "789",
131
+ "code": "789",
132
+ "title": "Utilities",
133
+ "type": "Section",
134
+ "total": 3000,
135
+ "records": [
136
+ {
137
+ "id": "101",
138
+ "code": "101",
139
+ "title": "Electricity",
140
+ "type": "Record",
141
+ "total": 2000,
142
+ },
143
+ {
144
+ "id": "102",
145
+ "code": "102",
146
+ "title": "Telephone",
147
+ "type": "Record",
148
+ "total": 1000,
149
+ },
150
+ ],
151
+ },
152
+ ],
153
+ },
154
+ otherIncome: {
155
+ id: "123",
156
+ code: "123",
157
+ title: "Other Income",
158
+ type: "Section",
159
+ total: 3000,
160
+ records: [
161
+ {
162
+ "id": "123",
163
+ "code": "123",
164
+ "title": "Interest Income",
165
+ "type": "Record",
166
+ "total": 2000,
167
+ },
168
+ {
169
+ "id": "123",
170
+ "code": "123",
171
+ "title": "Foreign Exchange Gain",
172
+ "type": "Record",
173
+ "total": 1000,
174
+ },
175
+ ],
176
+ },
177
+ otherExpenses: {
178
+ id: "123",
179
+ code: "123",
180
+ title: "Other Expenses",
181
+ type: "Section",
182
+ total: 1000,
183
+ records: [
184
+ {
185
+ "id": "123",
186
+ "code": "123",
187
+ "title": "Unrealized Gain/Loss",
188
+ "type": "Record",
189
+ "total": 1000,
190
+ },
191
+ ],
192
+ },
193
+ uncategorizedAccounts: {
194
+ id: "123",
195
+ code: "123",
196
+ title: "Uncategorized Accounts",
197
+ type: "Section",
198
+ total: 0,
199
+ records: [
200
+ {
201
+ "id": "123",
202
+ "code": "123",
203
+ "title": "Elimination Adjustments",
204
+ "type": "Record",
205
+ "total": 0,
206
+ },
207
+ ],
208
+ },
209
+ grossProfit: {
210
+ total: 10000,
211
+ },
212
+ netOperatingIncome: {
213
+ total: 10000,
214
+ },
215
+ netIncome: {
216
+ total: 10000,
217
+ },
218
+ customer: "123",
219
+ },
220
+ });
221
+ });