@keystrokehq/ramp 0.0.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 (107) hide show
  1. package/README.md +149 -0
  2. package/dist/_official/index.d.mts +3 -0
  3. package/dist/_official/index.mjs +3 -0
  4. package/dist/_runtime/index.d.mts +1 -0
  5. package/dist/_runtime/index.mjs +1 -0
  6. package/dist/accounting-fields.d.mts +116 -0
  7. package/dist/accounting-fields.mjs +108 -0
  8. package/dist/accounting-gl-accounts.d.mts +63 -0
  9. package/dist/accounting-gl-accounts.mjs +49 -0
  10. package/dist/accounting-i6txC-MI.mjs +116 -0
  11. package/dist/accounting-subsidiaries.d.mts +59 -0
  12. package/dist/accounting-subsidiaries.mjs +49 -0
  13. package/dist/accounting-sync.d.mts +57 -0
  14. package/dist/accounting-sync.mjs +51 -0
  15. package/dist/accounting-tracking-categories.d.mts +36 -0
  16. package/dist/accounting-tracking-categories.mjs +34 -0
  17. package/dist/accounting-vendors.d.mts +62 -0
  18. package/dist/accounting-vendors.mjs +49 -0
  19. package/dist/applications.d.mts +59 -0
  20. package/dist/applications.mjs +35 -0
  21. package/dist/bills-B8W9et3K.mjs +86 -0
  22. package/dist/bills.d.mts +381 -0
  23. package/dist/bills.mjs +134 -0
  24. package/dist/business-CztnWUvt.mjs +83 -0
  25. package/dist/business.d.mts +28 -0
  26. package/dist/business.mjs +20 -0
  27. package/dist/card-programs.d.mts +90 -0
  28. package/dist/card-programs.mjs +50 -0
  29. package/dist/cards-BfgPcR38.mjs +153 -0
  30. package/dist/cards.d.mts +287 -0
  31. package/dist/cards.mjs +166 -0
  32. package/dist/cashbacks.d.mts +46 -0
  33. package/dist/cashbacks.mjs +34 -0
  34. package/dist/client.d.mts +79 -0
  35. package/dist/client.mjs +248 -0
  36. package/dist/common-CUpmNYXw.mjs +64 -0
  37. package/dist/connection.d.mts +2 -0
  38. package/dist/connection.mjs +3 -0
  39. package/dist/departments.d.mts +63 -0
  40. package/dist/departments.mjs +79 -0
  41. package/dist/entities.d.mts +38 -0
  42. package/dist/entities.mjs +34 -0
  43. package/dist/errors-Sm92tugz.d.mts +42 -0
  44. package/dist/events.d.mts +30 -0
  45. package/dist/events.mjs +39 -0
  46. package/dist/factory-Da6YVHdL.mjs +15 -0
  47. package/dist/index.d.mts +1 -0
  48. package/dist/index.mjs +1 -0
  49. package/dist/integration-BGliAxAS.mjs +124 -0
  50. package/dist/integration-Dd6tOtSy.d.mts +47 -0
  51. package/dist/limits.d.mts +179 -0
  52. package/dist/limits.mjs +84 -0
  53. package/dist/locations.d.mts +69 -0
  54. package/dist/locations.mjs +80 -0
  55. package/dist/memos.d.mts +42 -0
  56. package/dist/memos.mjs +36 -0
  57. package/dist/messaging.d.mts +1 -0
  58. package/dist/messaging.mjs +1 -0
  59. package/dist/new-resources-BBJsJEjT.mjs +77 -0
  60. package/dist/organization-BSaEpvBn.mjs +103 -0
  61. package/dist/provider-app-JO525h-N.d.mts +45 -0
  62. package/dist/purchase-orders.d.mts +75 -0
  63. package/dist/purchase-orders.mjs +36 -0
  64. package/dist/receipt-integrations.d.mts +31 -0
  65. package/dist/receipt-integrations.mjs +38 -0
  66. package/dist/receipts-STq41c2M.mjs +53 -0
  67. package/dist/receipts.d.mts +62 -0
  68. package/dist/receipts.mjs +61 -0
  69. package/dist/reimbursements-OknrZUMF.mjs +37 -0
  70. package/dist/reimbursements.d.mts +89 -0
  71. package/dist/reimbursements.mjs +39 -0
  72. package/dist/schemas/index.d.mts +887 -0
  73. package/dist/schemas/index.mjs +56 -0
  74. package/dist/shared-CTTtP5gv.mjs +24 -0
  75. package/dist/spend-programs.d.mts +48 -0
  76. package/dist/spend-programs.mjs +34 -0
  77. package/dist/spend-requests.d.mts +95 -0
  78. package/dist/spend-requests.mjs +53 -0
  79. package/dist/statements.d.mts +41 -0
  80. package/dist/statements.mjs +37 -0
  81. package/dist/transactions-Djd0oIGK.mjs +53 -0
  82. package/dist/transactions.d.mts +181 -0
  83. package/dist/transactions.mjs +81 -0
  84. package/dist/transfers-WBQZVdGP.mjs +40 -0
  85. package/dist/transfers.d.mts +72 -0
  86. package/dist/transfers.mjs +36 -0
  87. package/dist/triggers/index.d.mts +81 -0
  88. package/dist/triggers/index.mjs +199 -0
  89. package/dist/unified-requests.d.mts +67 -0
  90. package/dist/unified-requests.mjs +37 -0
  91. package/dist/users-ufcXrfNK.mjs +74 -0
  92. package/dist/users.d.mts +204 -0
  93. package/dist/users.mjs +101 -0
  94. package/dist/vendor-bank-accounts.d.mts +110 -0
  95. package/dist/vendor-bank-accounts.mjs +83 -0
  96. package/dist/vendors-B7DQrlAn.d.mts +1116 -0
  97. package/dist/vendors-Bx1cgXwC.mjs +83 -0
  98. package/dist/vendors.d.mts +116 -0
  99. package/dist/vendors.mjs +84 -0
  100. package/dist/verification.d.mts +22 -0
  101. package/dist/verification.mjs +38 -0
  102. package/dist/webhook-CsbvcgrC.mjs +61 -0
  103. package/dist/webhook-sde3Ui2N.d.mts +68 -0
  104. package/dist/webhooks-mgmt-d1xgVpWx.mjs +35 -0
  105. package/dist/webhooks.d.mts +83 -0
  106. package/dist/webhooks.mjs +81 -0
  107. package/package.json +222 -0
@@ -0,0 +1,81 @@
1
+ import { createRampClient } from "./client.mjs";
2
+ import { a as rampWebhookSubscriptionListSchema, i as rampWebhookSubscriptionListInputSchema, n as rampWebhookSubscriptionDeleteInputSchema, o as rampWebhookSubscriptionSchema, r as rampWebhookSubscriptionGetInputSchema, s as rampWebhookSubscriptionUpdateInputSchema, t as rampWebhookSubscriptionCreateInputSchema } from "./webhooks-mgmt-d1xgVpWx.mjs";
3
+ import { t as rampOperation } from "./factory-Da6YVHdL.mjs";
4
+ import { t as omitUndefined } from "./shared-CTTtP5gv.mjs";
5
+ import { z } from "zod";
6
+
7
+ //#region src/webhooks.ts
8
+ const listWebhookSubscriptions = rampOperation({
9
+ id: "list_webhook_subscriptions",
10
+ name: "List Webhook Subscriptions",
11
+ description: "List webhook subscriptions registered on the connected Ramp app.",
12
+ input: rampWebhookSubscriptionListInputSchema,
13
+ output: rampWebhookSubscriptionListSchema,
14
+ run: async (input, credentials) => {
15
+ const client = createRampClient(credentials);
16
+ return rampWebhookSubscriptionListSchema.parse(await client.request("/webhooks", { query: omitUndefined({
17
+ page_size: input.pageSize,
18
+ start: input.cursor
19
+ }) }));
20
+ }
21
+ });
22
+ const getWebhookSubscription = rampOperation({
23
+ id: "get_webhook_subscription",
24
+ name: "Get Webhook Subscription",
25
+ description: "Fetch a webhook subscription by id.",
26
+ input: rampWebhookSubscriptionGetInputSchema,
27
+ output: rampWebhookSubscriptionSchema,
28
+ run: async (input, credentials) => {
29
+ const client = createRampClient(credentials);
30
+ return rampWebhookSubscriptionSchema.parse(await client.request(`/webhooks/${encodeURIComponent(input.webhookId)}`));
31
+ }
32
+ });
33
+ const createWebhookSubscription = rampOperation({
34
+ id: "create_webhook_subscription",
35
+ name: "Create Webhook Subscription",
36
+ description: "Register a new webhook subscription. Will trigger Ramp's URL-validation handshake.",
37
+ input: rampWebhookSubscriptionCreateInputSchema,
38
+ output: rampWebhookSubscriptionSchema,
39
+ needsApproval: true,
40
+ run: async (input, credentials) => {
41
+ const client = createRampClient(credentials);
42
+ const { idempotency_key, ...body } = input;
43
+ return rampWebhookSubscriptionSchema.parse(await client.request("/webhooks", {
44
+ method: "POST",
45
+ body,
46
+ ...idempotency_key !== void 0 ? { idempotencyKey: idempotency_key } : {}
47
+ }));
48
+ }
49
+ });
50
+ const updateWebhookSubscription = rampOperation({
51
+ id: "update_webhook_subscription",
52
+ name: "Update Webhook Subscription",
53
+ description: "Update URL, active state, or enabled events on an existing subscription.",
54
+ input: rampWebhookSubscriptionUpdateInputSchema,
55
+ output: rampWebhookSubscriptionSchema,
56
+ needsApproval: true,
57
+ run: async (input, credentials) => {
58
+ const client = createRampClient(credentials);
59
+ const { webhookId, ...body } = input;
60
+ await client.request(`/webhooks/${encodeURIComponent(webhookId)}`, {
61
+ method: "PATCH",
62
+ body: omitUndefined(body)
63
+ });
64
+ return rampWebhookSubscriptionSchema.parse(await client.request(`/webhooks/${encodeURIComponent(webhookId)}`));
65
+ }
66
+ });
67
+ const deleteWebhookSubscription = rampOperation({
68
+ id: "delete_webhook_subscription",
69
+ name: "Delete Webhook Subscription",
70
+ description: "Delete a webhook subscription by id.",
71
+ input: rampWebhookSubscriptionDeleteInputSchema,
72
+ output: z.object({ success: z.boolean() }),
73
+ needsApproval: true,
74
+ run: async (input, credentials) => {
75
+ await createRampClient(credentials).request(`/webhooks/${encodeURIComponent(input.webhookId)}`, { method: "DELETE" });
76
+ return { success: true };
77
+ }
78
+ });
79
+
80
+ //#endregion
81
+ export { createWebhookSubscription, deleteWebhookSubscription, getWebhookSubscription, listWebhookSubscriptions, updateWebhookSubscription };
package/package.json ADDED
@@ -0,0 +1,222 @@
1
+ {
2
+ "name": "@keystrokehq/ramp",
3
+ "version": "0.0.1",
4
+ "private": false,
5
+ "sideEffects": false,
6
+ "type": "module",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.mts",
10
+ "default": "./dist/index.mjs"
11
+ },
12
+ "./connection": {
13
+ "types": "./dist/connection.d.mts",
14
+ "default": "./dist/connection.mjs"
15
+ },
16
+ "./messaging": {
17
+ "types": "./dist/messaging.d.mts",
18
+ "default": "./dist/messaging.mjs"
19
+ },
20
+ "./client": {
21
+ "types": "./dist/client.d.mts",
22
+ "default": "./dist/client.mjs"
23
+ },
24
+ "./schemas": {
25
+ "types": "./dist/schemas/index.d.mts",
26
+ "default": "./dist/schemas/index.mjs"
27
+ },
28
+ "./_official": {
29
+ "types": "./dist/_official/index.d.mts",
30
+ "default": "./dist/_official/index.mjs"
31
+ },
32
+ "./events": {
33
+ "types": "./dist/events.d.mts",
34
+ "default": "./dist/events.mjs"
35
+ },
36
+ "./triggers": {
37
+ "types": "./dist/triggers/index.d.mts",
38
+ "default": "./dist/triggers/index.mjs"
39
+ },
40
+ "./verification": {
41
+ "types": "./dist/verification.d.mts",
42
+ "default": "./dist/verification.mjs"
43
+ },
44
+ "./transactions": {
45
+ "types": "./dist/transactions.d.mts",
46
+ "default": "./dist/transactions.mjs"
47
+ },
48
+ "./users": {
49
+ "types": "./dist/users.d.mts",
50
+ "default": "./dist/users.mjs"
51
+ },
52
+ "./cards": {
53
+ "types": "./dist/cards.d.mts",
54
+ "default": "./dist/cards.mjs"
55
+ },
56
+ "./card-programs": {
57
+ "types": "./dist/card-programs.d.mts",
58
+ "default": "./dist/card-programs.mjs"
59
+ },
60
+ "./bills": {
61
+ "types": "./dist/bills.d.mts",
62
+ "default": "./dist/bills.mjs"
63
+ },
64
+ "./vendors": {
65
+ "types": "./dist/vendors.d.mts",
66
+ "default": "./dist/vendors.mjs"
67
+ },
68
+ "./vendor-bank-accounts": {
69
+ "types": "./dist/vendor-bank-accounts.d.mts",
70
+ "default": "./dist/vendor-bank-accounts.mjs"
71
+ },
72
+ "./reimbursements": {
73
+ "types": "./dist/reimbursements.d.mts",
74
+ "default": "./dist/reimbursements.mjs"
75
+ },
76
+ "./departments": {
77
+ "types": "./dist/departments.d.mts",
78
+ "default": "./dist/departments.mjs"
79
+ },
80
+ "./locations": {
81
+ "types": "./dist/locations.d.mts",
82
+ "default": "./dist/locations.mjs"
83
+ },
84
+ "./limits": {
85
+ "types": "./dist/limits.d.mts",
86
+ "default": "./dist/limits.mjs"
87
+ },
88
+ "./memos": {
89
+ "types": "./dist/memos.d.mts",
90
+ "default": "./dist/memos.mjs"
91
+ },
92
+ "./receipts": {
93
+ "types": "./dist/receipts.d.mts",
94
+ "default": "./dist/receipts.mjs"
95
+ },
96
+ "./receipt-integrations": {
97
+ "types": "./dist/receipt-integrations.d.mts",
98
+ "default": "./dist/receipt-integrations.mjs"
99
+ },
100
+ "./statements": {
101
+ "types": "./dist/statements.d.mts",
102
+ "default": "./dist/statements.mjs"
103
+ },
104
+ "./business": {
105
+ "types": "./dist/business.d.mts",
106
+ "default": "./dist/business.mjs"
107
+ },
108
+ "./entities": {
109
+ "types": "./dist/entities.d.mts",
110
+ "default": "./dist/entities.mjs"
111
+ },
112
+ "./spend-programs": {
113
+ "types": "./dist/spend-programs.d.mts",
114
+ "default": "./dist/spend-programs.mjs"
115
+ },
116
+ "./spend-requests": {
117
+ "types": "./dist/spend-requests.d.mts",
118
+ "default": "./dist/spend-requests.mjs"
119
+ },
120
+ "./accounting-fields": {
121
+ "types": "./dist/accounting-fields.d.mts",
122
+ "default": "./dist/accounting-fields.mjs"
123
+ },
124
+ "./accounting-gl-accounts": {
125
+ "types": "./dist/accounting-gl-accounts.d.mts",
126
+ "default": "./dist/accounting-gl-accounts.mjs"
127
+ },
128
+ "./accounting-vendors": {
129
+ "types": "./dist/accounting-vendors.d.mts",
130
+ "default": "./dist/accounting-vendors.mjs"
131
+ },
132
+ "./accounting-sync": {
133
+ "types": "./dist/accounting-sync.d.mts",
134
+ "default": "./dist/accounting-sync.mjs"
135
+ },
136
+ "./accounting-subsidiaries": {
137
+ "types": "./dist/accounting-subsidiaries.d.mts",
138
+ "default": "./dist/accounting-subsidiaries.mjs"
139
+ },
140
+ "./accounting-tracking-categories": {
141
+ "types": "./dist/accounting-tracking-categories.d.mts",
142
+ "default": "./dist/accounting-tracking-categories.mjs"
143
+ },
144
+ "./transfers": {
145
+ "types": "./dist/transfers.d.mts",
146
+ "default": "./dist/transfers.mjs"
147
+ },
148
+ "./cashbacks": {
149
+ "types": "./dist/cashbacks.d.mts",
150
+ "default": "./dist/cashbacks.mjs"
151
+ },
152
+ "./webhooks": {
153
+ "types": "./dist/webhooks.d.mts",
154
+ "default": "./dist/webhooks.mjs"
155
+ },
156
+ "./purchase-orders": {
157
+ "types": "./dist/purchase-orders.d.mts",
158
+ "default": "./dist/purchase-orders.mjs"
159
+ },
160
+ "./applications": {
161
+ "types": "./dist/applications.d.mts",
162
+ "default": "./dist/applications.mjs"
163
+ },
164
+ "./unified-requests": {
165
+ "types": "./dist/unified-requests.d.mts",
166
+ "default": "./dist/unified-requests.mjs"
167
+ },
168
+ "./_runtime": {
169
+ "types": "./dist/_runtime/index.d.mts",
170
+ "default": "./dist/_runtime/index.mjs"
171
+ }
172
+ },
173
+ "files": [
174
+ "dist",
175
+ "README.md",
176
+ "LICENSE"
177
+ ],
178
+ "scripts": {
179
+ "typecheck": "tsgo --build",
180
+ "build": "tsdown",
181
+ "lint": "biome check .",
182
+ "test:unit": "vitest run --passWithNoTests --project unit",
183
+ "test:int": "vitest run --passWithNoTests --project int",
184
+ "prepublishOnly": "pnpm build && pnpm test:unit",
185
+ "lint:fix": "biome check --write ."
186
+ },
187
+ "dependencies": {
188
+ "@keystrokehq/integration-authoring": "^0.0.1",
189
+ "@keystrokehq/core": "^0.0.5",
190
+ "zod": "^4.3.6"
191
+ },
192
+ "devDependencies": {
193
+ "@types/node": "catalog:",
194
+ "@keystrokehq/test-utils": "workspace:*",
195
+ "@keystrokehq/typescript-config": "workspace:*",
196
+ "tsdown": "catalog:",
197
+ "typescript": "catalog:",
198
+ "vitest": "catalog:"
199
+ },
200
+ "keywords": [
201
+ "ramp",
202
+ "keystroke",
203
+ "integration",
204
+ "finance",
205
+ "corporate-cards",
206
+ "spend-management",
207
+ "bill-pay",
208
+ "accounting",
209
+ "reimbursements",
210
+ "expense"
211
+ ],
212
+ "repository": {
213
+ "type": "git",
214
+ "url": "https://github.com/keystrokehq/integrations",
215
+ "directory": "integrations/ramp"
216
+ },
217
+ "license": "MIT",
218
+ "publishConfig": {
219
+ "access": "public",
220
+ "registry": "https://registry.npmjs.org/"
221
+ }
222
+ }