@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,218 @@
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 { RFCDate } from "../types/index.js";
8
+ import { createTestHTTPClient } from "./testclient.js";
9
+
10
+ test("Companyinfo Accounting Company Info One", async () => {
11
+ const testHttpClient = createTestHTTPClient("accounting.companyInfoOne");
12
+
13
+ const apideck = new Apideck({
14
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
15
+ httpClient: testHttpClient,
16
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
17
+ });
18
+
19
+ const result = await apideck.accounting.companyInfo.get({
20
+ serviceId: "salesforce",
21
+ fields: "id,updated_at",
22
+ });
23
+ expect(result.httpMeta.response.status).toBe(200);
24
+ expect(result.getCompanyInfoResponse).toBeDefined();
25
+ expect(result.getCompanyInfoResponse).toEqual({
26
+ statusCode: 200,
27
+ status: "OK",
28
+ service: "xero",
29
+ resource: "company-info",
30
+ operation: "one",
31
+ data: {
32
+ id: "12345",
33
+ companyName: "SpaceX",
34
+ status: "active",
35
+ legalName: "SpaceX Inc.",
36
+ country: "US",
37
+ salesTaxNumber: "111.222.333",
38
+ defaultSalesTax: {
39
+ id: "1234",
40
+ name: "GST on Purchases",
41
+ code: "ABN",
42
+ description: "Reduced rate GST Purchases",
43
+ effectiveTaxRate: 10,
44
+ totalTaxRate: 10,
45
+ taxPayableAccountId: "123456",
46
+ taxRemittedAccountId: "123456",
47
+ components: [
48
+ {
49
+ id: "10",
50
+ name: "GST",
51
+ rate: 10,
52
+ compound: true,
53
+ },
54
+ {
55
+ id: "10",
56
+ name: "GST",
57
+ rate: 10,
58
+ compound: true,
59
+ },
60
+ {
61
+ id: "10",
62
+ name: "GST",
63
+ rate: 10,
64
+ compound: true,
65
+ },
66
+ ],
67
+ type: "NONE",
68
+ reportTaxType: "NONE",
69
+ originalTaxRateId: "12345",
70
+ status: "active",
71
+ rowVersion: "1-12345",
72
+ updatedBy: "12345",
73
+ createdBy: "12345",
74
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
75
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
76
+ passThrough: [
77
+ {
78
+ serviceId: "<id>",
79
+ extendPaths: [
80
+ {
81
+ path: "$.nested.property",
82
+ value: {
83
+ "TaxClassificationRef": {
84
+ "value": "EUC-99990201-V1-00020000",
85
+ },
86
+ },
87
+ },
88
+ {
89
+ path: "$.nested.property",
90
+ value: {
91
+ "TaxClassificationRef": {
92
+ "value": "EUC-99990201-V1-00020000",
93
+ },
94
+ },
95
+ },
96
+ ],
97
+ },
98
+ {
99
+ serviceId: "<id>",
100
+ extendPaths: [
101
+ {
102
+ path: "$.nested.property",
103
+ value: {
104
+ "TaxClassificationRef": {
105
+ "value": "EUC-99990201-V1-00020000",
106
+ },
107
+ },
108
+ },
109
+ {
110
+ path: "$.nested.property",
111
+ value: {
112
+ "TaxClassificationRef": {
113
+ "value": "EUC-99990201-V1-00020000",
114
+ },
115
+ },
116
+ },
117
+ ],
118
+ },
119
+ ],
120
+ customFields: [
121
+ {
122
+ id: "2389328923893298",
123
+ name: "employee_level",
124
+ description: "Employee Level",
125
+ value: true,
126
+ },
127
+ {
128
+ id: "2389328923893298",
129
+ name: "employee_level",
130
+ description: "Employee Level",
131
+ value: true,
132
+ },
133
+ {
134
+ id: "2389328923893298",
135
+ name: "employee_level",
136
+ description: "Employee Level",
137
+ value: 10,
138
+ },
139
+ ],
140
+ },
141
+ currency: "USD",
142
+ language: "EN",
143
+ fiscalYearStartMonth: "January",
144
+ companyStartDate: new RFCDate("2015-06-05"),
145
+ addresses: [
146
+ {
147
+ id: "123",
148
+ type: "primary",
149
+ string: "25 Spring Street, Blackburn, VIC 3130",
150
+ name: "HQ US",
151
+ line1: "Main street",
152
+ line2: "apt #",
153
+ line3: "Suite #",
154
+ line4: "delivery instructions",
155
+ streetNumber: "25",
156
+ city: "San Francisco",
157
+ state: "CA",
158
+ postalCode: "94104",
159
+ country: "US",
160
+ latitude: "40.759211",
161
+ longitude: "-73.984638",
162
+ county: "Santa Clara",
163
+ contactName: "Elon Musk",
164
+ salutation: "Mr",
165
+ phoneNumber: "111-111-1111",
166
+ fax: "122-111-1111",
167
+ email: "elon@musk.com",
168
+ website: "https://elonmusk.com",
169
+ notes: "Address notes or delivery instructions.",
170
+ rowVersion: "1-12345",
171
+ },
172
+ ],
173
+ phoneNumbers: [
174
+ {
175
+ id: "12345",
176
+ countryCode: "1",
177
+ areaCode: "323",
178
+ number: "111-111-1111",
179
+ extension: "105",
180
+ type: "primary",
181
+ },
182
+ {
183
+ id: "12345",
184
+ countryCode: "1",
185
+ areaCode: "323",
186
+ number: "111-111-1111",
187
+ extension: "105",
188
+ type: "primary",
189
+ },
190
+ {
191
+ id: "12345",
192
+ countryCode: "1",
193
+ areaCode: "323",
194
+ number: "111-111-1111",
195
+ extension: "105",
196
+ type: "primary",
197
+ },
198
+ ],
199
+ emails: [
200
+ {
201
+ id: "123",
202
+ email: "elon@musk.com",
203
+ type: "primary",
204
+ },
205
+ {
206
+ id: "123",
207
+ email: "elon@musk.com",
208
+ type: "primary",
209
+ },
210
+ ],
211
+ rowVersion: "1-12345",
212
+ updatedBy: "12345",
213
+ createdBy: "12345",
214
+ updatedAt: new Date("2020-09-30T07:43:32.000Z"),
215
+ createdAt: new Date("2020-09-30T07:43:32.000Z"),
216
+ },
217
+ });
218
+ });
@@ -0,0 +1,67 @@
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("Connectioncustommappings Vault Connection Custom Mappings All", async () => {
10
+ const testHttpClient = createTestHTTPClient(
11
+ "vault.connectionCustomMappingsAll",
12
+ );
13
+
14
+ const apideck = new Apideck({
15
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
16
+ httpClient: testHttpClient,
17
+ apiKey: process.env["APIDECK_API_KEY"] ?? "value",
18
+ });
19
+
20
+ const result = await apideck.vault.connectionCustomMappings.list({
21
+ unifiedApi: "crm",
22
+ serviceId: "pipedrive",
23
+ resource: "leads",
24
+ resourceId: "1234",
25
+ });
26
+ expect(result.httpMeta.response.status).toBe(200);
27
+ expect(result.getCustomMappingsResponse).toBeDefined();
28
+ expect(result.getCustomMappingsResponse).toEqual({
29
+ statusCode: 200,
30
+ status: "OK",
31
+ data: [
32
+ {
33
+ id: "hris+employees+first_aid_training",
34
+ label: "First Aid Training",
35
+ description: "First Aid Training completed after 2019-01-01",
36
+ value: "$.root.training.first_aid",
37
+ key: "first_aid_training",
38
+ required: false,
39
+ customField: true,
40
+ consumerId: "test_user_id",
41
+ example: "Some value",
42
+ },
43
+ {
44
+ id: "hris+employees+first_aid_training",
45
+ label: "First Aid Training",
46
+ description: "First Aid Training completed after 2019-01-01",
47
+ value: "$.root.training.first_aid",
48
+ key: "first_aid_training",
49
+ required: false,
50
+ customField: true,
51
+ consumerId: "test_user_id",
52
+ example: "Some value",
53
+ },
54
+ {
55
+ id: "hris+employees+first_aid_training",
56
+ label: "First Aid Training",
57
+ description: "First Aid Training completed after 2019-01-01",
58
+ value: "$.root.training.first_aid",
59
+ key: "first_aid_training",
60
+ required: false,
61
+ customField: true,
62
+ consumerId: "test_user_id",
63
+ example: "Some value",
64
+ },
65
+ ],
66
+ });
67
+ });